Subir proyecto
This commit is contained in:
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{B as t,W as n,c as r,l as i,r as a}from"./button-BhAQo6Sy.js";var o=e(n(),1),s=o.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function c(){return o.useContext(s)}function l(e={}){let{guess:t,label:n,metadata:i,textRef:a,index:s}=e,{register:l,unregister:u,subscribeMapChange:d,nextIndexRef:f}=c(),p=o.useRef(-1),[m,h]=o.useState(s==null&&t?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1),g=s??m,_=o.useRef(null),v=o.useCallback(e=>{let t=_.current;t&&u(t),_.current=e,e&&l(e,{metadata:i??null,index:s??null,label:n,textRef:a})},[s,l,u,i,n,a]);return r(()=>{if(s==null)return d(e=>{let t=_.current?e.get(_.current)?.index:null;t!=null&&h(t)})},[s,d]),{ref:v,index:g}}var u=a();function d(e){let{children:n,elementsRef:a,labelsRef:c,onMapChange:l}=e,d=i(l),[,v]=o.useState(!1),y=t(p).current,b=t(f).current,x=o.useRef(0),S=o.useRef(!0),C=o.useRef([]),w=o.useRef(null),T=i(()=>{S.current||(S.current=!0,v(e=>!e))}),E=i((e,t)=>{b.set(e,t),T()}),D=i(e=>{b.delete(e),T()}),O=i(e=>{let t=new Map;return a.current.length=0,c&&(c.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),a.current[e.index]=e.element,c&&(c.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),x.current=a.current.length,t});function k(e){if(w.current?.disconnect(),w.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!g(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&_(r,n)>0){t.disconnect(),T();return}r=n}});w.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=h(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let A=i(()=>{let[e,t]=m(b),n=O(e);k(t),C.current=e,S.current=!1,y.forEach(e=>e(n)),d(n)});r(()=>(S.current||O(C.current),()=>{a.current=[],c&&(c.current=[])}),[a,c,O]),r(()=>{S.current&&A()}),r(()=>()=>{w.current?.disconnect(),S.current=!0},[]);let j=i(e=>(y.add(e),()=>{y.delete(e)})),M=o.useMemo(()=>({register:E,unregister:D,subscribeMapChange:j,nextIndexRef:x}),[E,D,j,x]);return(0,u.jsx)(s.Provider,{value:M,children:n})}function f(){return new Map}function p(){return new Set}function m(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>_(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function h(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function g(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function _(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}export{l as n,d as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{P as t,W as n}from"./button-BhAQo6Sy.js";var r=e(n(),1).forwardRef(function(e,n){let{className:r,render:i,orientation:a=`horizontal`,style:o,...s}=e;return t(`div`,e,{state:{orientation:a},ref:n,props:[{role:`separator`,"aria-orientation":a},s]})});export{r as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]);export{t};
|
||||
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]);export{t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,W as n,j as r,n as i,r as a}from"./button-BhAQo6Sy.js";import{V as o}from"./api-Bb85n68L.js";import{t as s}from"./arrow-left-CQp0ScTZ.js";import{n as c}from"./switch-DMNAfdJq.js";import{t as l}from"./type-Df9tHIH_.js";import"./input-DbQb1wvc.js";var u=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,d=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=u[n[e]&63];return t},f=e(n(),1),p=a();function m({source:e,title:n,description:a,icon:c,actions:u}){return(0,p.jsxs)(`header`,{className:`flex flex-col gap-5 border-b pb-5 lg:flex-row lg:items-center lg:justify-between`,children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3.5`,children:[(0,p.jsx)(o,{to:`/fonts/index`,className:r(i({variant:`outline`,size:`icon`}),`mt-0.5 shrink-0`),"aria-label":wp.i18n.__(`Back to font library`,`jooosi-fon`),children:(0,p.jsx)(s,{"aria-hidden":`true`})}),(0,p.jsx)(`span`,{className:`mt-0.5 hidden size-9 shrink-0 place-items-center rounded-xl border bg-card shadow-xs sm:grid`,children:c||(0,p.jsx)(l,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})}),(0,p.jsxs)(`div`,{className:`min-w-0`,children:[(0,p.jsx)(t,{variant:`primary-light`,size:`sm`,radius:`full`,children:e}),(0,p.jsx)(`h1`,{className:`mb-0 mt-2 text-2xl font-semibold tracking-[-0.025em] sm:text-[1.75rem] sm:leading-tight`,children:n}),(0,p.jsx)(`p`,{className:`mb-0 mt-1.5 max-w-2xl text-sm leading-6 text-muted-foreground`,children:a})]})]}),u&&(0,p.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-2 pl-[3.25rem] sm:pl-[6.5rem] lg:pl-0`,children:u})]})}function h({label:e,value:t,suffix:n,min:i,max:a,step:o=1,onChange:s,compact:c=!1,className:l}){let u=(0,f.useId)(),[d,m]=(0,f.useState)(String(t));return(0,f.useEffect)(()=>m(String(t)),[t]),(0,p.jsxs)(`div`,{className:r(c?`grid min-w-32 grid-cols-[1fr_auto] items-center gap-x-2 gap-y-1 text-xs font-medium`:`grid grid-cols-[5rem_minmax(5rem,1fr)_4.5rem] items-center gap-2 text-xs font-medium`,l),children:[(0,p.jsx)(`span`,{id:u,className:`text-muted-foreground`,children:e}),(0,p.jsx)(`input`,{type:`range`,min:i,max:a,step:o,value:t,onChange:e=>s(Number(e.target.value)),"aria-labelledby":u,className:r(`h-5 w-full cursor-pointer overflow-visible accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,c&&`col-span-2 row-start-2`)}),(0,p.jsxs)(`span`,{className:r(`flex min-w-0 items-center rounded-md border bg-background focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/50`,c&&`col-start-2 row-start-1 min-w-16`),children:[(0,p.jsx)(`input`,{type:`number`,min:i,max:a,step:o,value:d,onChange:e=>{let t=e.target.value;m(t);let n=Number(t);t!==``&&Number.isFinite(n)&&n>=i&&n<=a&&s(n)},onBlur:()=>{let e=Number(d);if(!Number.isFinite(e)){m(String(t));return}let n=Math.min(a,Math.max(i,e));m(String(n)),s(n)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(m(String(t)),e.currentTarget.blur())},"aria-labelledby":u,className:`min-w-0 flex-1 appearance-none bg-transparent py-1 pl-1.5 text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`}),n&&(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`pr-1.5 text-muted-foreground`,children:n})]})]})}function g(){return(0,p.jsxs)(`div`,{className:`space-y-5`,"aria-busy":`true`,"aria-label":wp.i18n.__(`Loading font editor`,`jooosi-fon`),children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3.5 border-b pb-5`,children:[(0,p.jsx)(c,{className:`size-9 shrink-0 rounded-lg`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,p.jsx)(c,{className:`h-5 w-28 rounded-full`}),(0,p.jsx)(c,{className:`h-8 w-64 max-w-full`}),(0,p.jsx)(c,{className:`h-4 w-[34rem] max-w-full`})]})]}),(0,p.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b p-4`,children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(c,{className:`h-4 w-24`}),(0,p.jsx)(c,{className:`h-3 w-64 max-w-full`})]}),(0,p.jsx)(c,{className:`hidden h-9 w-72 sm:block`})]}),(0,p.jsx)(c,{className:`h-64 rounded-none sm:h-72`}),(0,p.jsx)(`div`,{className:`grid grid-cols-2 gap-px bg-border lg:grid-cols-4`,children:[0,1,2,3].map(e=>(0,p.jsx)(c,{className:`h-16 rounded-none bg-card`},e))})]}),(0,p.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,p.jsx)(c,{className:`h-80 rounded-xl`}),(0,p.jsx)(c,{className:`h-80 rounded-xl`})]}),(0,p.jsx)(`span`,{className:`sr-only`,children:wp.i18n.__(`Loading font editor`,`jooosi-fon`)})]})}export{d as i,g as n,h as r,m as t};
|
||||
+1067
File diff suppressed because one or more lines are too long
+53
@@ -0,0 +1,53 @@
|
||||
import { inspectFontFile, preloadFontInspector } from './font-inspector';
|
||||
import type { FontFile } from '@/types/fonts';
|
||||
|
||||
interface FontInspectionInitRequest {
|
||||
type: 'init';
|
||||
preloadWoff2: boolean;
|
||||
}
|
||||
|
||||
interface FontInspectionJobRequest {
|
||||
type: 'inspect';
|
||||
id: number;
|
||||
file: FontFile;
|
||||
}
|
||||
|
||||
type FontInspectionRequest = FontInspectionInitRequest | FontInspectionJobRequest;
|
||||
|
||||
interface FontInspectionResponse {
|
||||
id: number;
|
||||
result?: Awaited<ReturnType<typeof inspectFontFile>>;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
const workerScope = globalThis as unknown as {
|
||||
onmessage: ((event: MessageEvent<FontInspectionRequest>) => void) | null;
|
||||
postMessage: (message: FontInspectionResponse | { type: 'ready' | 'init-error'; error?: string }) => void;
|
||||
};
|
||||
|
||||
workerScope.onmessage = async ({ data }) => {
|
||||
if (data.type === 'init') {
|
||||
try {
|
||||
if (data.preloadWoff2) {
|
||||
await preloadFontInspector();
|
||||
}
|
||||
workerScope.postMessage({ type: 'ready' });
|
||||
} catch (error) {
|
||||
workerScope.postMessage({
|
||||
type: 'init-error',
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await inspectFontFile(data.file);
|
||||
workerScope.postMessage({ id: data.id, result });
|
||||
} catch (error) {
|
||||
workerScope.postMessage({
|
||||
id: data.id,
|
||||
error: error instanceof Error ? error.message : 'Unable to inspect this font.',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
function e(e){switch(e){case`woff`:case`font/woff`:return`woff`;case`ttf`:case`font/ttf`:return`truetype`;case`otf`:case`font/otf`:return`opentype`;case`eot`:case`font/eot`:return`embedded-opentype`;default:return`woff2`}}function t(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`'`,`\\'`).replace(/[\n\r\f]/g,e=>`\\${e.codePointAt(0)?.toString(16)} `)}function n(e){let t=e.trim().toLowerCase();return/^(normal|italic|oblique(?:\s+-?\d+(?:\.\d+)?deg(?:\s+-?\d+(?:\.\d+)?deg)?)?)$/.test(t)?t:`normal`}function r(e){let t=String(e).trim().toLowerCase();if(t===`normal`||t===`bold`)return t;let n=t.split(/\s+/).map(Number);return n.length>0&&n.length<=2&&n.every(e=>Number.isFinite(e)&&e>=1&&e<=1e3)?t:null}function i(e){let t=String(e??``).trim().toLowerCase();if(!t)return null;if(/^(normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded)$/.test(t))return t;let n=t.split(/\s+/),r=n.map(e=>Number(e.replace(`%`,``)));return r.length>0&&r.length<=2&&n.every(e=>/^\d+(?:\.\d+)?%$/.test(e))&&r.every(e=>Number.isFinite(e)&&e>0&&e<=1e3)?t:null}function a(e){let t=e?.trim().toLowerCase();return t&&[`auto`,`block`,`swap`,`fallback`,`optional`].includes(t)?t:`auto`}function o(e){let t=`U\\+[0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?`,n=RegExp(`^${t}(?:\\s*,\\s*${t})*$`,`i`);return e&&n.test(e.trim())?e.trim():null}function s(s,c,l=`auto`){return s.trim()?c.filter(e=>e.isEnabled!==!1).map(c=>{let u=[`font-family: '${t(s)}';`,`font-style: ${n(c.style)};`,`font-display: ${a(c.display||l)};`],d=r(c.weight);d&&u.push(`font-weight: ${d};`);let f=i(c.width);if(f&&u.push(`font-stretch: ${f};`),c.files.length>0){let n=c.files.map(n=>`url('${t(n.attachment_url)}') format('${e(n.extension)}')`);u.push(`src: ${n.join(`, `)};`)}let p=o(c.unicodeRange);return p&&u.push(`unicode-range: ${p};`),`@font-face {\n ${u.join(`
|
||||
`)}\n}`}).join(`
|
||||
|
||||
`):``}function c(e){return`--jf--family-${e.replace(/[^a-zA-Z0-9\-_]+/g,`-`).toLowerCase()}`}export{c as n,s as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{r as e}from"./button-BhAQo6Sy.js";var t=e();function n(){return(0,t.jsxs)(`svg`,{viewBox:`0 0 16 16`,className:`size-5`,"aria-hidden":`true`,children:[(0,t.jsx)(`path`,{fill:`#f29900`,d:`M13.5 2H8L1 13h5.5z`}),(0,t.jsx)(`path`,{fill:`#1a73e8`,d:`M8 2h5v11H8z`}),(0,t.jsx)(`circle`,{fill:`#ea4335`,cx:`3.25`,cy:`4.25`,r:`2.25`}),(0,t.jsx)(`path`,{fill:`#0d652d`,d:`M13.33 10 13 13a3 3 0 0 1 0-6l.33 3z`}),(0,t.jsx)(`path`,{fill:`#174ea6`,d:`M10.5 4.5A2.5 2.5 0 0 1 13 2l.45 2.5L13 7a2.5 2.5 0 0 1-2.5-2.5z`}),(0,t.jsx)(`path`,{fill:`#1a73e8`,d:`M13 2a2.5 2.5 0 0 1 0 5`}),(0,t.jsx)(`path`,{fill:`#34a853`,d:`M13 7a3 3 0 0 1 0 6`})]})}export{n as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{R as e,S as t}from"./button-BhAQo6Sy.js";var n=`ArrowUp`,r=`ArrowDown`,i=`ArrowLeft`,a=`ArrowRight`,o=`Home`,s=new Set([n,r,i,a,o,`End`]),c=[`Shift`,`Control`,`Alt`,`Meta`];function l(e){return t(e)&&e.tagName===`INPUT`}function u(e){return!!(l(e)&&e.selectionStart!=null||t(e)&&e.tagName===`TEXTAREA`)}function d(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=f(e,t,`left`),a=p(e),o=p(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=f(e,t,`top`),r=p(e),i=p(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function f(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function p(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function m(t){return e(19)?t:t?`true`:void 0}export{n as a,c,a as i,u as l,r as n,s as o,i as r,o as s,m as t,d as u};
|
||||
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{B as t,E as n,L as r,P as i,W as a,c as o,d as s,j as c,l,r as u,x as d}from"./button-BhAQo6Sy.js";import{M as f,a as p,c as m,i as h,o as g,r as _,s as v,x as y,y as b}from"./api-Bb85n68L.js";var x=e(a(),1);function S(e){return e?.ownerDocument||document}function C(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function w(e,t){if(!e||!t)return!1;let r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&n(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function T(e){return`composedPath`in e?e.composedPath()[0]:e.target}function E(e,t){return t<0||t>=e.length}function D(e,t){return k(e.current,{disabledIndices:t})}function O(e,t){return k(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function k(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&A(e,a,r));return a}function A(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!M(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function j(e){return e.visibility===`hidden`||e.visibility===`collapse`}function M(e,t=e?s(e):null){return!e||!e.isConnected||!t||j(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var N=x.createContext(void 0);function P(){return x.useContext(N)?.direction??`ltr`}function F(e={}){let{id:n,implicit:i=!1,controlRef:a}=e,{controlId:s,registerControlId:c}=h(),u=b(n),f=i?s:void 0,p=t(()=>Symbol()),m=x.useRef(!1),g=x.useRef(n!=null),_=l(()=>{!m.current||c===r||(m.current=!1,c(p.current,void 0))});return o(()=>{if(c===r)return;let e;if(i){let t=a?.current;e=d(t)&&t.closest(`label`)!=null?n??null:f??u}else if(n!=null)g.current=!0,e=n;else if(g.current)e=u;else{_();return}if(e===void 0){_();return}m.current=!0,c(p.current,e)},[n,a,f,c,i,u,p,_]),x.useEffect(()=>_,[_]),s??u}var I=x.forwardRef(function(e,t){let{render:n,className:r,id:a,name:s,value:c,disabled:u=!1,onValueChange:d,defaultValue:b,autoFocus:w=!1,style:T,...E}=e,{state:D,name:O,disabled:k,setTouched:A,setDirty:j,validityData:M,setFocused:N,setFilled:P,validationMode:I,validation:L}=g(),{clearErrors:R}=p(),z=k||u,B=O??s,V={...D,disabled:z},{labelId:H}=h(),U=F({id:a});o(()=>{let e=c!=null;L.inputRef.current?.value||e&&c!==``?P(!0):e&&c===``&&P(!1)},[L.inputRef,P,c]);let W=x.useRef(null);o(()=>{w&&W.current===C(S(W.current))&&N(!0)},[w,N]);let[G]=m({controlled:c,default:b,name:`FieldControl`,state:`value`}),K=c!==void 0,q=K?G:void 0,J=l(()=>L.inputRef.current?.value);return _(L.inputRef,U,q,J,!z,s),i(`input`,e,{ref:[t,W],state:V,props:[{id:U,disabled:z,name:B,ref:L.inputRef,"aria-labelledby":H,autoFocus:w,...K?{value:q}:{defaultValue:b},onChange(e){let t=e.currentTarget.value;d?.(t,y(f,e.nativeEvent)),j(t!==(M.initialValue??``)),P(t!==``),e.nativeEvent.defaultPrevented||(R(B),L.change(t))},onFocus(){N(!0)},onBlur(e){A(!0),N(!1),I===`onBlur`&&L.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(A(!0),L.commit(e.currentTarget.value))}},E,e=>L.getValidationProps(z,e)],stateAttributesMapping:v})}),L=u(),R=x.forwardRef(function(e,t){return(0,L.jsx)(I,{ref:t,...e})});function z({className:e,type:t,...n}){return(0,L.jsx)(R,{type:t,"data-slot":`input`,className:c(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}export{O as a,E as c,w as d,T as f,k as i,A as l,F as n,D as o,S as p,P as r,M as s,z as t,C as u};
|
||||
+1
@@ -0,0 +1 @@
|
||||
function e(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}export{e as t};
|
||||
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{j as e,n as t,r as n}from"./button-BhAQo6Sy.js";import{V as r}from"./api-Bb85n68L.js";import{t as i}from"./arrow-left-CQp0ScTZ.js";var a=n();function o({title:n,description:o,eyebrow:s,backTo:c,actions:l}){return(0,a.jsxs)(`header`,{className:`relative overflow-hidden rounded-2xl border bg-card shadow-xs`,children:[(0,a.jsx)(`div`,{className:`pointer-events-none absolute -right-20 -top-32 size-72 rounded-full bg-primary/6 blur-3xl`,"aria-hidden":`true`}),(0,a.jsxs)(`div`,{className:`relative flex flex-col gap-5 p-5 sm:p-6 lg:flex-row lg:items-center lg:justify-between`,children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3.5`,children:[c&&(0,a.jsx)(r,{to:c,"aria-label":wp.i18n.__(`Go back`,`jooosi-fon`),className:e(t({variant:`ghost`,size:`icon`}),`mt-0.5 shrink-0 border bg-background shadow-xs`),children:(0,a.jsx)(i,{"aria-hidden":`true`})}),(0,a.jsxs)(`div`,{className:`min-w-0`,children:[s&&(0,a.jsxs)(`p`,{className:`mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-primary`,children:[(0,a.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,"aria-hidden":`true`}),s]}),(0,a.jsx)(`h1`,{className:`m-0 text-2xl font-semibold tracking-[-0.025em] text-foreground sm:text-[2rem] sm:leading-tight`,children:n}),(0,a.jsx)(`p`,{className:`mb-0 mt-2 max-w-3xl text-sm leading-6 text-muted-foreground`,children:o})]})]}),l&&(0,a.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-2 lg:justify-end`,children:l})]})]})}export{o as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{s as n,l as r,o as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{j as e,r as t}from"./button-BhAQo6Sy.js";import{t as n}from"./Separator-D9XfIgMe.js";var r=t();function i({className:t,orientation:i=`horizontal`,...a}){return(0,r.jsx)(n,{"data-slot":`separator`,orientation:i,className:e(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,t),...a})}export{i as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
||||
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t};
|
||||
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{U as t,W as n,c as r,j as i,r as a}from"./button-BhAQo6Sy.js";import{y as o}from"./api-Bb85n68L.js";var s=t(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),c=e(n(),1);function l(e,t,n,i=!0,a){let[s,l]=c.useState(),d=o(a?`${a}-label`:void 0),f=e??t??s;return r(()=>{let r=e||t||!i?void 0:u(n.current,d);s!==r&&l(r)}),f}function u(e,t){let n=d(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function d(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var f=a();function p({className:e,...t}){return(0,f.jsx)(s,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:i(`size-4 animate-spin`,e),...t})}export{l as n,p as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{I as t,P as n,U as r,V as i,W as a,a as o,c as s,i as c,j as l,r as u,z as d}from"./button-BhAQo6Sy.js";import{M as f,a as ee,c as p,h as te,i as ne,l as re,m as ie,o as m,r as h,s as g,x as _,y as ae}from"./api-Bb85n68L.js";import{n as oe}from"./spinner-B0ROFxgI.js";import{n as se}from"./input-DbQb1wvc.js";var v=r(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),y=u();function b({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`skeleton`,className:l(`animate-pulse rounded-md bg-muted`,e),...t})}var x=e(a(),1),S=x.createContext(void 0);function C(){let e=x.useContext(S);if(e===void 0)throw Error(i(63));return e}var w={...g,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},T=x.forwardRef(function(e,r){let{checked:i,className:a,defaultChecked:l,"aria-labelledby":u,form:g,id:v,inputRef:b,name:C,nativeButton:T=!1,onCheckedChange:E,readOnly:D=!1,required:O=!1,disabled:ce=!1,render:le,uncheckedValue:k,value:A,style:ue,...j}=e,{clearErrors:M}=ee(),{state:N,setTouched:P,setDirty:F,validityData:I,setFilled:L,setFocused:R,validationMode:z,disabled:B,name:V,validation:H}=m(),{labelId:U}=ne(),W=B||ce,G=V??C,K=x.useRef(null),de=d(K,b,H.inputRef),q=x.useRef(null),J=ae(),Y=se({id:v,implicit:!1,controlRef:q}),X=T?void 0:Y,[Z,fe]=p({controlled:i,default:!!l,name:`Switch`,state:`checked`});h(q,J,Z,void 0,!W,C),s(()=>{K.current&&L(K.current.checked)},[L]),re(Z,()=>{M(G),F(Z!==I.initialValue),L(Z),H.change(Z)});let{getButtonProps:pe,buttonRef:me}=c({disabled:W,native:T}),he=oe(u,U,K,!T,X),ge={id:T?Y:J,role:`switch`,"aria-checked":Z,"aria-readonly":D||void 0,"aria-required":O||void 0,"aria-labelledby":he,onFocus(){W||R(!0)},onBlur(){let e=K.current;!e||W||(P(!0),R(!1),z===`onBlur`&&H.commit(e.checked))},onClick(e){if(D||W)return;e.preventDefault();let t=K.current;t&&o(t,e)}},_e={...H.getValidationProps(W),checked:Z,disabled:W,form:g,id:X,name:G,required:O,style:G?te:ie,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:de,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D){e.preventDefault();return}let t=e.currentTarget.checked,n=_(f,e.nativeEvent);E?.(t,n),!n.isCanceled&&fe(t)},onClick(e){e.stopPropagation()},onFocus(){q.current?.focus()},...A===void 0?t:{value:A}},Q=x.useMemo(()=>({...N,checked:Z,disabled:W,readOnly:D,required:O}),[N,Z,W,D,O]),$=n(`span`,e,{state:Q,ref:[r,q,me],props:[ge,j,pe,e=>H.getValidationProps(W,e)],stateAttributesMapping:w});return(0,y.jsxs)(S.Provider,{value:Q,children:[$,!Z&&G&&k!==void 0&&(0,y.jsx)(`input`,{type:`hidden`,form:g,name:G,value:k,disabled:W}),(0,y.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),E=x.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,s=C();return n(`span`,e,{state:s,ref:t,stateAttributesMapping:w,props:o})});function D({className:e,size:t=`default`,...n}){return(0,y.jsx)(T,{"data-slot":`switch`,"data-size":t,className:l(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,y.jsx)(E,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}export{b as n,v as r,D as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{U as e}from"./button-BhAQo6Sy.js";var t=e(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]);export{t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{U as t,W as n,j as r,r as i}from"./button-BhAQo6Sy.js";import{J as a}from"./api-Bb85n68L.js";import"./switch-DMNAfdJq.js";import{t as o}from"./input-DbQb1wvc.js";var s=t(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),c=i();function l({label:e,hint:t,error:n,children:i,className:a}){return(0,c.jsxs)(`label`,{className:r(`grid gap-1.5 text-sm font-medium text-foreground`,a),children:[(0,c.jsx)(`span`,{children:e}),i,(n||t)&&(0,c.jsx)(`span`,{className:r(`text-xs font-normal text-muted-foreground`,n&&`text-destructive`),children:n||t})]})}function u(e){return(0,c.jsx)(o,{...e})}function d({className:e,...t}){return(0,c.jsx)(`select`,{className:r(`h-8 w-full rounded-lg border border-input bg-background px-2.5 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,e),...t})}var f=e(n(),1);function p(e){let t=(0,f.useRef)(!1),n=a(({currentLocation:n,nextLocation:r})=>e&&!t.current&&n.pathname!==r.pathname);return(0,f.useEffect)(()=>{let t=t=>{e&&t.preventDefault()};return window.addEventListener(`beforeunload`,t),()=>window.removeEventListener(`beforeunload`,t)},[e]),(0,f.useEffect)(()=>{n.state===`blocked`&&(window.confirm(wp.i18n.__(`You have unsaved changes. Leave this page?`,`jooosi-fon`))?n.proceed():n.reset())},[n]),(0,f.useCallback)(()=>{t.current=!0},[])}export{s as a,u as i,l as n,d as r,p as t};
|
||||
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user