intlayer-editor 6.0.0-canary.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/intlayer-editor.mjs
CHANGED
|
@@ -30,11 +30,20 @@ if (envIndex !== -1 && args[envIndex + 1]) {
|
|
|
30
30
|
const envFileIndex = args.findIndex(
|
|
31
31
|
(arg) => arg === '---env-file' || arg === '--env-file' || arg === '-f'
|
|
32
32
|
);
|
|
33
|
+
if (envFileIndex !== -1 && args[envFileIndex + 1]) {
|
|
34
|
+
envFile = args[envFileIndex + 1];
|
|
35
|
+
}
|
|
33
36
|
|
|
34
37
|
if (args[0] === 'start') {
|
|
35
38
|
// Start the server pointing to the package's 'dist' directory
|
|
36
|
-
const command = `
|
|
37
|
-
const child = exec(command
|
|
39
|
+
const command = `node ${distPath}`;
|
|
40
|
+
const child = exec(command, {
|
|
41
|
+
env: {
|
|
42
|
+
...process.env,
|
|
43
|
+
NODE_ENV: env,
|
|
44
|
+
...(envFileIndex !== -1 ? { ENV_FILE: envFile } : {}),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
38
47
|
|
|
39
48
|
// Pipe child's stdout and stderr to the parent process
|
|
40
49
|
child.stdout.on('data', (data) => {
|
|
@@ -335,4 +335,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
335
335
|
|
|
336
336
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
337
337
|
`},kR=Jie(rae)(NL),iae={config:tae},aae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(a){return n.reduceRight(function(s,l){return l(s)},a)}};function IL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],IL(e[n],t[n]))}),wR(wR({},e),t)}var oae={type:"cancelation",msg:"operation is manually canceled"};function wy(e){var t=!1,n=new Promise(function(r,a){e.then(function(s){return t?a(oae):r(s)}),e.catch(a)});return n.cancel=function(){return t=!0},n}var sae=Xie.create({config:Qie,isInitialized:!1,resolve:null,reject:null,monaco:null}),OL=Oie(sae,2),yu=OL[0],Wh=OL[1];function lae(e){var t=iae.config(e),n=t.monaco,r=Iie(t,["monaco"]);Wh(function(a){return{config:IL(a.config,r),monaco:n}})}function cae(){var e=yu(function(t){var n=t.monaco,r=t.isInitialized,a=t.resolve;return{monaco:n,isInitialized:r,resolve:a}});if(!e.isInitialized){if(Wh({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),wy(Ty);if(window.monaco&&window.monaco.editor)return DL(window.monaco),e.resolve(window.monaco),wy(Ty);aae(uae,fae)(hae)}return wy(Ty)}function uae(e){return document.body.appendChild(e)}function dae(e){var t=document.createElement("script");return e&&(t.src=e),t}function fae(e){var t=yu(function(r){var a=r.config,s=r.reject;return{config:a,reject:s}}),n=dae("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function hae(){var e=yu(function(n){var r=n.config,a=n.resolve,s=n.reject;return{config:r,resolve:a,reject:s}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){DL(n),e.resolve(n)},function(n){e.reject(n)})}function DL(e){yu().monaco||Wh({monaco:e})}function pae(){return yu(function(e){var t=e.monaco;return t})}var Ty=new Promise(function(e,t){return Wh({resolve:e,reject:t})}),LL={config:lae,init:cae,__getMonacoInstance:pae},mae={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Cy=mae,gae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},yae=gae;function vae({children:e}){return Ie.createElement("div",{style:yae.container},e)}var bae=vae,_ae=bae;function Eae({width:e,height:t,isEditorReady:n,loading:r,_ref:a,className:s,wrapperProps:l}){return Ie.createElement("section",{style:{...Cy.wrapper,width:e,height:t},...l},!n&&Ie.createElement(_ae,null,r),Ie.createElement("div",{ref:a,style:{...Cy.fullWidth,...!n&&Cy.hide},className:s}))}var Sae=Eae,jL=E.memo(Sae);function xae(e){E.useEffect(e,[])}var PL=xae;function Aae(e,t,n=!0){let r=E.useRef(!0);E.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Fn=Aae;function Cc(){}function ys(e,t,n,r){return wae(e,r)||Tae(e,t,n,r)}function wae(e,t){return e.editor.getModel(ML(e,t))}function Tae(e,t,n,r){return e.editor.createModel(t,n,r?ML(e,r):void 0)}function ML(e,t){return e.Uri.parse(t)}function Cae({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:a,originalModelPath:s,modifiedModelPath:l,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:g={},height:y="100%",width:_="100%",className:x,wrapperProps:A={},beforeMount:C=Cc,onMount:w=Cc}){let[S,T]=E.useState(!1),[N,R]=E.useState(!0),O=E.useRef(null),D=E.useRef(null),j=E.useRef(null),H=E.useRef(w),Z=E.useRef(C),q=E.useRef(!1);PL(()=>{let ae=LL.init();return ae.then(M=>(D.current=M)&&R(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>O.current?W():ae.cancel()}),Fn(()=>{if(O.current&&D.current){let ae=O.current.getOriginalEditor(),M=ys(D.current,e||"",r||n||"text",s||"");M!==ae.getModel()&&ae.setModel(M)}},[s],S),Fn(()=>{if(O.current&&D.current){let ae=O.current.getModifiedEditor(),M=ys(D.current,t||"",a||n||"text",l||"");M!==ae.getModel()&&ae.setModel(M)}},[l],S),Fn(()=>{let ae=O.current.getModifiedEditor();ae.getOption(D.current.editor.EditorOption.readOnly)?ae.setValue(t||""):t!==ae.getValue()&&(ae.executeEdits("",[{range:ae.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),ae.pushUndoStop())},[t],S),Fn(()=>{O.current?.getModel()?.original.setValue(e||"")},[e],S),Fn(()=>{let{original:ae,modified:M}=O.current.getModel();D.current.editor.setModelLanguage(ae,r||n||"text"),D.current.editor.setModelLanguage(M,a||n||"text")},[n,r,a],S),Fn(()=>{D.current?.editor.setTheme(f)},[f],S),Fn(()=>{O.current?.updateOptions(g)},[g],S);let te=E.useCallback(()=>{if(!D.current)return;Z.current(D.current);let ae=ys(D.current,e||"",r||n||"text",s||""),M=ys(D.current,t||"",a||n||"text",l||"");O.current?.setModel({original:ae,modified:M})},[n,t,a,e,r,s,l]),ce=E.useCallback(()=>{!q.current&&j.current&&(O.current=D.current.editor.createDiffEditor(j.current,{automaticLayout:!0,...g}),te(),D.current?.editor.setTheme(f),T(!0),q.current=!0)},[g,f,te]);E.useEffect(()=>{S&&H.current(O.current,D.current)},[S]),E.useEffect(()=>{!N&&!S&&ce()},[N,S,ce]);function W(){let ae=O.current?.getModel();u||ae?.original?.dispose(),d||ae?.modified?.dispose(),O.current?.dispose()}return Ie.createElement(jL,{width:_,height:y,isEditorReady:S,loading:p,_ref:j,className:x,wrapperProps:A})}var Rae=Cae;E.memo(Rae);function kae(e){let t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}var Nae=kae,nf=new Map;function Iae({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:a,path:s,theme:l="light",line:u,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:g=!0,keepCurrentModel:y=!1,width:_="100%",height:x="100%",className:A,wrapperProps:C={},beforeMount:w=Cc,onMount:S=Cc,onChange:T,onValidate:N=Cc}){let[R,O]=E.useState(!1),[D,j]=E.useState(!0),H=E.useRef(null),Z=E.useRef(null),q=E.useRef(null),te=E.useRef(S),ce=E.useRef(w),W=E.useRef(),ae=E.useRef(r),M=Nae(s),X=E.useRef(!1),G=E.useRef(!1);PL(()=>{let ie=LL.init();return ie.then(F=>(H.current=F)&&j(!1)).catch(F=>F?.type!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>Z.current?P():ie.cancel()}),Fn(()=>{let ie=ys(H.current,e||r||"",t||a||"",s||n||"");ie!==Z.current?.getModel()&&(g&&nf.set(M,Z.current?.saveViewState()),Z.current?.setModel(ie),g&&Z.current?.restoreViewState(nf.get(s)))},[s],R),Fn(()=>{Z.current?.updateOptions(f)},[f],R),Fn(()=>{!Z.current||r===void 0||(Z.current.getOption(H.current.editor.EditorOption.readOnly)?Z.current.setValue(r):r!==Z.current.getValue()&&(G.current=!0,Z.current.executeEdits("",[{range:Z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),Z.current.pushUndoStop(),G.current=!1))},[r],R),Fn(()=>{let ie=Z.current?.getModel();ie&&a&&H.current?.editor.setModelLanguage(ie,a)},[a],R),Fn(()=>{u!==void 0&&Z.current?.revealLine(u)},[u],R),Fn(()=>{H.current?.editor.setTheme(l)},[l],R);let ge=E.useCallback(()=>{if(!(!q.current||!H.current)&&!X.current){ce.current(H.current);let ie=s||n,F=ys(H.current,r||e||"",t||a||"",ie||"");Z.current=H.current?.editor.create(q.current,{model:F,automaticLayout:!0,...f},p),g&&Z.current.restoreViewState(nf.get(ie)),H.current.editor.setTheme(l),u!==void 0&&Z.current.revealLine(u),O(!0),X.current=!0}},[e,t,n,r,a,s,f,p,g,l,u]);E.useEffect(()=>{R&&te.current(Z.current,H.current)},[R]),E.useEffect(()=>{!D&&!R&&ge()},[D,R,ge]),ae.current=r,E.useEffect(()=>{R&&T&&(W.current?.dispose(),W.current=Z.current?.onDidChangeModelContent(ie=>{G.current||T(Z.current.getValue(),ie)}))},[R,T]),E.useEffect(()=>{if(R){let ie=H.current.editor.onDidChangeMarkers(F=>{let J=Z.current.getModel()?.uri;if(J&&F.find(oe=>oe.path===J.path)){let oe=H.current.editor.getModelMarkers({resource:J});N?.(oe)}});return()=>{ie?.dispose()}}return()=>{}},[R,N]);function P(){W.current?.dispose(),y?g&&nf.set(s,Z.current.saveViewState()):Z.current.getModel()?.dispose(),Z.current.dispose()}return Ie.createElement(jL,{width:_,height:x,isEditorReady:R,loading:d,_ref:q,className:A,wrapperProps:C})}var Oae=Iae,Dae=E.memo(Oae);const Lae=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:a=!0,isReadOnly:s=!1,onChange:l})=>{const u=E.useRef(null),d=E.useRef(null),[f,p]=E.useState({height:0,width:0}),g=E.useMemo(()=>n?"vs-dark-transparent":"hc-light-theme",[n]),y=(x,A)=>{d.current=x;const C=(x.getContentHeight()??0)+25;A.editor.defineTheme("vs-dark-transparent",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),A.editor.defineTheme("hc-light-theme",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),A.editor.setTheme(g),A.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),A.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),A.languages.typescript.typescriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),A.languages.typescript.javascriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),p({height:C,width:u.current?.clientWidth??0})},_=r??e.split(`
|
|
338
|
-
`).length>1;return v.jsxs("div",{className:_e("relative h-full w-full text-sm",r&&"ml-0"),children:[a&&v.jsx("div",{className:"sticky top-5 z-10",children:v.jsx("div",{className:_e("absolute bottom-0 right-2 flex h-7 items-center"),children:v.jsx(kk,{content:e})})}),v.jsx("div",{className:"z-0 grid size-full grid-cols-[0px] overflow-auto",ref:u,children:v.jsx(Dae,{...f,defaultLanguage:"typescript",language:t,loading:v.jsx(As,{}),defaultValue:String(e).replace(/\n$/,""),onMount:y,onChange:l,options:{readOnly:s,cursorStyle:"line",minimap:{enabled:!1},scrollbar:{vertical:"hidden",verticalScrollbarSize:0,alwaysConsumeMouseWheel:!1},folding:!1,renderValidationDecorations:"off",quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,mouseWheelScrollSensitivity:0,fastScrollSensitivity:0,scrollBeyondLastLine:!1,lineNumbers:_?"on":"off"},theme:g,className:"my-2 rounded-md"})})]})},jae=({dictionary:e,isDarkMode:t})=>{const{setEditedContent:n,editedContent:r}=xn(),a=l=>{try{return JSON.parse(l),!0}catch{return!1}},s=E.useMemo(()=>r?.[e.localId]?.content??e?.content??{},[e]);return v.jsx(Ar,{background:"none",border:!0,roundedSize:"xl",className:"w-full overflow-hidden p-3",children:v.jsx(Lae,{language:"json",onChange:l=>{a(l??"{}")&&n(e.localId,JSON.parse(l??"{}"))},isDarkMode:t,children:JSON.stringify(s,null,2)})})},rf=({section:e,onValueChange:t})=>{const{multilingual:n,text:r,number:a,boolean:s,node:l,array:u,enumeration:d,triggerPlaceHolder:f,nest:p,condition:g,markdown:y,insertion:_,reactNode:x,file:A}=cn("node-type-selector"),C=Os(e),[w,S]=E.useState(C),T=N=>{S(N),t(N)};return v.jsxs(Re,{value:w,onValueChange:T,children:[v.jsx(Re.Trigger,{children:v.jsx(Re.Value,{placeholder:f})}),v.jsxs(Re.Content,{children:[v.jsx(Re.Item,{value:$.Translation,children:n}),v.jsx(Re.Item,{value:$.Text,children:r}),v.jsx(Re.Item,{value:$.Number,children:a}),v.jsx(Re.Item,{value:$.Boolean,children:s}),v.jsx(Re.Item,{value:$.Object,children:l}),v.jsx(Re.Item,{value:$.Array,children:u}),v.jsx(Re.Item,{value:$.Enumeration,children:d}),v.jsx(Re.Item,{value:$.Insertion,children:_}),v.jsx(Re.Item,{value:$.Markdown,children:y}),v.jsx(Re.Item,{value:$.Nested,children:p}),v.jsx(Re.Item,{value:$.Condition,children:g}),v.jsx(Re.Item,{value:$.ReactNode,disabled:!0,children:x}),v.jsx(Re.Item,{value:$.File,children:A})]})]})},Jv=({section:e,dictionaryKey:t,keyPath:n,onNodeTypeChange:r})=>{const a=Gr()?.internationalization.locales??[],s=Os(e),l=FR(e),u=d=>{const f=Wl(s,a,d);r(f)};if(s===$.Translation||s===$.Condition||s===$.Enumeration){const d=Object.keys(e[s])[0],f=[...n,{type:s,key:d}];return v.jsxs("div",{className:"flex w-full flex-col gap-1",children:[v.jsx(rf,{section:e,onValueChange:p=>r(Wl(p,a))}),v.jsx(Jv,{section:l,keyPath:f,dictionaryKey:t,onNodeTypeChange:u})]})}if(s===$.Array){const d=[...n,{type:s,key:0}];return v.jsxs("div",{className:"flex w-full flex-col gap-1",children:[v.jsx(rf,{section:e,onValueChange:f=>r(Wl(f,a))}),v.jsx(Jv,{section:l,keyPath:d,dictionaryKey:t,onNodeTypeChange:u})]})}return s===$.Object?v.jsxs(v.Fragment,{children:[v.jsx(rf,{section:e,onValueChange:d=>r(Wl(d,a))}),v.jsx("div",{className:"ml-10 mt-6",children:v.jsx(Mae,{keyPath:n,section:e,dictionaryKey:t})})]}):v.jsx(rf,{section:e,onValueChange:d=>r(Wl(d,a))})},o_=({sectionKey:e,section:t,keyPath:n,dictionaryKey:r})=>{const{focusedContent:a,setFocusedContentKeyPath:s}=da(),{renameEditedContent:l,addEditedContent:u}=Ds(),{titleInput:d,deleteButton:f}=cn("structure-view"),p=g=>{l(r,g,n);const y=n.slice(0,-1),_=n[n.length-1],x=[...y,{..._,key:g}];s(x)};return v.jsx(Ar,{transparency:"xl",roundedSize:"xl",className:"w-full min-w-80 gap-2 overflow-auto px-5 py-2",border:!0,borderColor:"text",background:"none","aria-selected":Wc(n,a?.keyPath??[]),onClick:()=>s(n),children:v.jsxs("div",{className:"flex w-full flex-col items-start justify-between gap-3",children:[typeof e=="string"&&v.jsxs("div",{className:"w-full",children:[v.jsxs("div",{className:"flex w-full items-center justify-between gap-10",children:[v.jsx(YI,{name:"key","aria-label":"Key",placeholder:d.placeholder.value,defaultValue:e,onSave:g=>p(g),variant:la.INVISIBLE}),v.jsx(ot,{label:f.label.value,variant:at.HOVERABLE,size:Kn.ICON_SM,color:it.TEXT,className:"translate-x-2",Icon:mh,onClick:()=>{u(r,void 0,n);const g=n.slice(0,-1);s(g)}})]}),v.jsxs("span",{className:"text-neutral ml-3 text-sm",children:["( ",Af(e)," )"]})]}),v.jsx(Jv,{keyPath:n,dictionaryKey:r,section:t,onNodeTypeChange:g=>{u(r,g,n)}})]})})},Pae=({section:e,keyPath:t,dictionaryKey:n})=>{const{addNodeButton:r}=cn("structure-view"),{setFocusedContentKeyPath:a}=lb(),{addEditedContent:s}=Ds();return!e||typeof e!="object"?v.jsx("div",{children:"Not an object"}):v.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto",children:[v.jsx("ul",{className:"mr-auto flex flex-col gap-4",children:Object.keys(e).map(l=>v.jsx("li",{className:"flex w-full",children:v.jsx(o_,{sectionKey:l,section:e?.[l],keyPath:[...t,{type:$.Object,key:l}],dictionaryKey:n})},l))}),v.jsx(ot,{label:r.label.value,variant:at.HOVERABLE,size:Kn.MD,color:it.TEXT,Icon:ph,className:"flex-1",onClick:()=>{const u=[...t,{type:$.Object,key:"newKey"}];s(n,"",u),a(u)},children:r.text})]})},Mae=({section:e,keyPath:t,dictionaryKey:n})=>!e||typeof e!="object"||typeof e.nodeType=="string"?v.jsx(o_,{sectionKey:"content",section:e,keyPath:t,dictionaryKey:n}):v.jsx(Pae,{section:e,keyPath:t,dictionaryKey:n}),zae=({dictionary:e})=>{const{content:t,key:n,localId:r}=e,{editedContent:a}=xn(),s=typeof a?.[r]?.content>"u"?t:a?.[r]?.content;return v.jsx(o_,{section:s,keyPath:[],dictionaryKey:e.key})},Bae=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:a})=>{const s=Gr(),[l,u]=E.useState(1),{returnToDictionaryList:d}=cn("dictionary-field-editor"),{setFocusedContent:f}=lb(),{setLocaleDictionaries:p}=dh();return E.useEffect(()=>{f(g=>({...g??{},dictionaryKey:e.key,dictionaryLocalId:e.localId})),p(g=>({...g,[e.localId]:e}))},[]),v.jsx(XQ,{availableLocales:s?.internationalization.locales??[],children:v.jsxs("div",{className:"flex size-full flex-col gap-6 px-2",children:[v.jsx(ot,{onClick:t,variant:at.HOVERABLE,className:"z-10 ml-5 mr-auto",color:it.TEXT,Icon:_2,label:d.label.value,children:d.text}),v.jsx(hu,{defaultValue:l,onChange:g=>u(g),color:du.TEXT,size:fu.SM,className:"m-auto w-full max-w-xl",choices:[{content:"Details",value:0},{content:"Structure",value:2},{content:"Content",value:1},{content:"JSON",value:3}].filter(({value:g})=>!(!r.includes("remote")&&g===0))}),l===0&&v.jsx(Rie,{dictionary:e}),l===2&&v.jsx(zae,{dictionary:e}),l===1&&v.jsx(Tie,{dictionary:e,isDarkMode:n}),l===3&&v.jsx(jae,{dictionary:e,isDarkMode:n}),v.jsx(cD,{dictionary:e,mode:r,onDelete:()=>{f(null),a?.()}})]})})},Vae=({children:e,isHidden:t,minWidth:n=0,align:r="left",className:a,...s})=>v.jsx("div",{className:_e("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out",t?"":"grid-cols-[1fr]",a),"aria-hidden":t,...s,children:v.jsx("div",{style:{minWidth:`${n}px`},tabIndex:t!==!1?void 0:-1,className:_e(r==="right"&&"ml-auto"),children:e})}),Uae=e=>{switch(e){case"sm":return 640;case"md":return 768;case"lg":return 1024;case"xl":return 1280;case"2xl":return 1536;default:return e}},Fae=()=>{if(typeof window>"u")return;const e=window.navigator?.userAgent;if(!(typeof e>"u"))return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},$ae=e=>{if(!(typeof window>"u"))return(window?.innerWidth??0)<=e},NR=(e="md")=>{const t=Uae(e),n=Fae(),r=$ae(t);return{isMobileScreen:r,isMobileUserAgent:n,isMobile:r??n}},Hae=(e="md")=>{const[t,n]=E.useState(NR(e));return E.useEffect(()=>{const r=()=>{n(NR(e))};return window.addEventListener("resize",r,{passive:!0}),()=>window.removeEventListener("resize",r)},[e]),t},Gae=e=>{const t=e.getBoundingClientRect(),n=t.top,r=t.bottom-1;if(n>=0&&r<=window.innerHeight){const s=t.left+t.width/2,l=t.top+10,u=document.elementFromPoint(s,l);return e===u||e.contains(u)}return!1},Zh=AI((e,t)=>({drawers:{},open:n=>e(r=>({drawers:{...r.drawers,[n]:!0}})),close:n=>e(r=>({drawers:{...r.drawers,[n]:!1}})),isOpen:n=>t().drawers[n]??!1})),zL=({title:e,identifier:t,children:n,header:r,closeOnOutsideClick:a=!0,backButton:s,isOpen:l,onClose:u})=>{const{isMobile:d}=Hae("md"),f=E.useRef(null),p=E.useRef(null),{close:g,open:y,isOpen:_}=Zh(wI(A=>({close:()=>A.close(t),open:()=>A.open(t),isOpen:A.isOpen(t)})));TI({disableScroll:_,key:t?`right_drawer_${t}`:"right_drawer"}),E.useEffect(()=>{const A=C=>{try{if(!f.current)return;const w=_&&a,S=C.target&&!f.current.contains(C.target),T=Gae(f.current);(w&&S&&T||!C.target)&&(g(),u?.())}catch{g(),u?.()}};return window.addEventListener("mousedown",A),()=>window.removeEventListener("mousedown",A)},[_,g,u,a,t]),E.useEffect(()=>{l!==void 0&&(l?y():(g(),u?.()))},[g,y,u,l,t]);const x=A=>{A.target===A.currentTarget&&d&&(g(),u?.())};return v.jsx("div",{className:"fixed right-0 top-0 z-50 flex h-full justify-end",children:v.jsx(Vae,{isHidden:!_,align:"right",children:v.jsxs(Ar,{className:"text-text relative flex h-screen w-screen flex-col md:w-[400px]",ref:f,roundedSize:"none",children:[v.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[v.jsxs("div",{className:"flex justify-between gap-3",children:[v.jsx("div",{children:s&&v.jsx(ot,{variant:at.HOVERABLE,color:it.TEXT,label:s.text??"Go back",onClick:s.onBack,Icon:T2,children:s?.text})}),v.jsx("div",{children:v.jsx(ot,{variant:at.HOVERABLE,color:it.TEXT,label:"Close",className:"ml-auto",onClick:g,Icon:ho,size:Kn.ICON_MD})})]}),e&&v.jsx("h2",{className:"flex items-center justify-center text-lg font-bold",children:e}),r]}),v.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-2",children:v.jsx("div",{className:"flex flex-1 flex-col",onClick:x,ref:p,children:n})})]})})})};var s_="ToastProvider",[l_,Kae,qae]=eO("Toast"),[BL,Wae]=eu("Toast",[qae]),[Zae,Yh]=BL(s_),c_=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:l}=e,[u,d]=E.useState(null),[f,p]=E.useState(0),g=E.useRef(!1),y=E.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${s_}\`. Expected non-empty \`string\`.`),v.jsx(l_.Provider,{scope:t,children:v.jsx(Zae,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:s,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:E.useCallback(()=>p(_=>_+1),[]),onToastRemove:E.useCallback(()=>p(_=>_-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:y,children:l})})};c_.displayName=s_;var VL="ToastViewport",Yae=["F8"],eb="toast.viewportPause",tb="toast.viewportResume",u_=E.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Yae,label:a="Notifications ({hotkey})",...s}=e,l=Yh(VL,n),u=Kae(n),d=E.useRef(null),f=E.useRef(null),p=E.useRef(null),g=E.useRef(null),y=wt(t,g,l.onViewportChange),_=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=l.toastCount>0;E.useEffect(()=>{const C=w=>{r.length!==0&&r.every(T=>w[T]||w.code===T)&&g.current?.focus()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[r]),E.useEffect(()=>{const C=d.current,w=g.current;if(x&&C&&w){const S=()=>{if(!l.isClosePausedRef.current){const O=new CustomEvent(eb);w.dispatchEvent(O),l.isClosePausedRef.current=!0}},T=()=>{if(l.isClosePausedRef.current){const O=new CustomEvent(tb);w.dispatchEvent(O),l.isClosePausedRef.current=!1}},N=O=>{!C.contains(O.relatedTarget)&&T()},R=()=>{C.contains(document.activeElement)||T()};return C.addEventListener("focusin",S),C.addEventListener("focusout",N),C.addEventListener("pointermove",S),C.addEventListener("pointerleave",R),window.addEventListener("blur",S),window.addEventListener("focus",T),()=>{C.removeEventListener("focusin",S),C.removeEventListener("focusout",N),C.removeEventListener("pointermove",S),C.removeEventListener("pointerleave",R),window.removeEventListener("blur",S),window.removeEventListener("focus",T)}}},[x,l.isClosePausedRef]);const A=E.useCallback(({tabbingDirection:C})=>{const S=u().map(T=>{const N=T.ref.current,R=[N,...coe(N)];return C==="forwards"?R:R.reverse()});return(C==="forwards"?S.reverse():S).flat()},[u]);return E.useEffect(()=>{const C=g.current;if(C){const w=S=>{const T=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!T){const R=document.activeElement,O=S.shiftKey;if(S.target===C&&O){f.current?.focus();return}const H=A({tabbingDirection:O?"backwards":"forwards"}),Z=H.findIndex(q=>q===R);Ry(H.slice(Z+1))?S.preventDefault():O?f.current?.focus():p.current?.focus()}};return C.addEventListener("keydown",w),()=>C.removeEventListener("keydown",w)}},[u,A]),v.jsxs(y$,{ref:d,role:"region","aria-label":a.replace("{hotkey}",_),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&v.jsx(nb,{ref:f,onFocusFromOutsideViewport:()=>{const C=A({tabbingDirection:"forwards"});Ry(C)}}),v.jsx(l_.Slot,{scope:n,children:v.jsx(He.ol,{tabIndex:-1,...s,ref:y})}),x&&v.jsx(nb,{ref:p,onFocusFromOutsideViewport:()=>{const C=A({tabbingDirection:"backwards"});Ry(C)}})]})});u_.displayName=VL;var UL="ToastFocusProxy",nb=E.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,s=Yh(UL,n);return v.jsx(j0,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!s.viewport?.contains(u)&&r()}})});nb.displayName=UL;var vu="Toast",Xae="toast.swipeStart",Qae="toast.swipeMove",Jae="toast.swipeCancel",eoe="toast.swipeEnd",d_=E.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:s,...l}=e,[u,d]=If({prop:r,defaultProp:a??!0,onChange:s,caller:vu});return v.jsx(tu,{present:n||u,children:v.jsx(roe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:_r(e.onPause),onResume:_r(e.onResume),onSwipeStart:Qe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Qe(e.onSwipeMove,f=>{const{x:p,y:g}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Qe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Qe(e.onSwipeEnd,f=>{const{x:p,y:g}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),d(!1)})})})});d_.displayName=vu;var[toe,noe]=BL(vu,{onClose(){}}),roe=E.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:s,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:y,onSwipeEnd:_,...x}=e,A=Yh(vu,n),[C,w]=E.useState(null),S=wt(t,W=>w(W)),T=E.useRef(null),N=E.useRef(null),R=a||A.duration,O=E.useRef(0),D=E.useRef(R),j=E.useRef(0),{onToastAdd:H,onToastRemove:Z}=A,q=_r(()=>{C?.contains(document.activeElement)&&A.viewport?.focus(),l()}),te=E.useCallback(W=>{!W||W===1/0||(window.clearTimeout(j.current),O.current=new Date().getTime(),j.current=window.setTimeout(q,W))},[q]);E.useEffect(()=>{const W=A.viewport;if(W){const ae=()=>{te(D.current),f?.()},M=()=>{const X=new Date().getTime()-O.current;D.current=D.current-X,window.clearTimeout(j.current),d?.()};return W.addEventListener(eb,M),W.addEventListener(tb,ae),()=>{W.removeEventListener(eb,M),W.removeEventListener(tb,ae)}}},[A.viewport,R,d,f,te]),E.useEffect(()=>{s&&!A.isClosePausedRef.current&&te(R)},[s,R,A.isClosePausedRef,te]),E.useEffect(()=>(H(),()=>Z()),[H,Z]);const ce=E.useMemo(()=>C?GL(C):null,[C]);return A.viewport?v.jsxs(v.Fragment,{children:[ce&&v.jsx(ioe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ce}),v.jsx(toe,{scope:n,onClose:q,children:fo.createPortal(v.jsx(l_.ItemSlot,{scope:n,children:v.jsx(g$,{asChild:!0,onEscapeKeyDown:Qe(u,()=>{A.isFocusedToastEscapeKeyDownRef.current||q(),A.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(He.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":A.swipeDirection,...x,ref:S,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Qe(e.onKeyDown,W=>{W.key==="Escape"&&(u?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(A.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Qe(e.onPointerDown,W=>{W.button===0&&(T.current={x:W.clientX,y:W.clientY})}),onPointerMove:Qe(e.onPointerMove,W=>{if(!T.current)return;const ae=W.clientX-T.current.x,M=W.clientY-T.current.y,X=!!N.current,G=["left","right"].includes(A.swipeDirection),ge=["left","up"].includes(A.swipeDirection)?Math.min:Math.max,P=G?ge(0,ae):0,ie=G?0:ge(0,M),F=W.pointerType==="touch"?10:2,J={x:P,y:ie},oe={originalEvent:W,delta:J};X?(N.current=J,af(Qae,g,oe,{discrete:!1})):IR(J,A.swipeDirection,F)?(N.current=J,af(Xae,p,oe,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(ae)>F||Math.abs(M)>F)&&(T.current=null)}),onPointerUp:Qe(e.onPointerUp,W=>{const ae=N.current,M=W.target;if(M.hasPointerCapture(W.pointerId)&&M.releasePointerCapture(W.pointerId),N.current=null,T.current=null,ae){const X=W.currentTarget,G={originalEvent:W,delta:ae};IR(ae,A.swipeDirection,A.swipeThreshold)?af(eoe,_,G,{discrete:!0}):af(Jae,y,G,{discrete:!0}),X.addEventListener("click",ge=>ge.preventDefault(),{once:!0})}})})})}),A.viewport)})]}):null}),ioe=e=>{const{__scopeToast:t,children:n,...r}=e,a=Yh(vu,t),[s,l]=E.useState(!1),[u,d]=E.useState(!1);return soe(()=>l(!0)),E.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:v.jsx(vh,{asChild:!0,children:v.jsx(j0,{...r,children:s&&v.jsxs(v.Fragment,{children:[a.label," ",n]})})})},aoe="ToastTitle",f_=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(He.div,{...r,ref:t})});f_.displayName=aoe;var ooe="ToastDescription",h_=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(He.div,{...r,ref:t})});h_.displayName=ooe;var FL="ToastAction",p_=E.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?v.jsx(HL,{altText:n,asChild:!0,children:v.jsx(Xh,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${FL}\`. Expected non-empty \`string\`.`),null)});p_.displayName=FL;var $L="ToastClose",Xh=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=noe($L,n);return v.jsx(HL,{asChild:!0,children:v.jsx(He.button,{type:"button",...r,ref:t,onClick:Qe(e.onClick,a.onClose)})})});Xh.displayName=$L;var HL=E.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return v.jsx(He.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function GL(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),loe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...GL(r))}}),t}function af(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?q1(a,s):a.dispatchEvent(s)}var IR=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),s=r>a;return t==="left"||t==="right"?s&&r>n:!s&&a>n};function soe(e=()=>{}){const t=_r(e);ln(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function loe(e){return e.nodeType===e.ELEMENT_NODE}function coe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ry(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var uoe=c_,KL=u_,qL=d_,WL=f_,ZL=h_,doe=p_,YL=Xh;const foe=Object.freeze(Object.defineProperty({__proto__:null,Action:doe,Close:YL,Description:ZL,Provider:uoe,Root:qL,Title:WL,Toast:d_,ToastAction:p_,ToastClose:Xh,ToastDescription:h_,ToastProvider:c_,ToastTitle:f_,ToastViewport:u_,Viewport:KL,createToastScope:Wae},Symbol.toStringTag,{value:"Module"})),hoe=foe,poe=({className:e,...t})=>v.jsx(KL,{className:_e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}),moe=ur("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{error:"bg-error/40 text-text",success:"bg-success/30 text-text",default:"bg-card/80 text-text"}},defaultVariants:{variant:"default"}}),goe=({className:e,variant:t,...n})=>v.jsx(qL,{className:_e(moe({variant:t}),e),...n}),yoe=({className:e,...t})=>v.jsx(YL,{className:_e("text-text/50 hover:text-text/80 focus:outline-hidden absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:v.jsx(ho,{className:"size-5"})}),voe=({className:e,...t})=>v.jsx(WL,{className:_e("text-sm font-semibold [&+div]:text-xs",e),...t}),boe=({className:e,...t})=>v.jsx(ZL,{className:_e("text-sm opacity-90",e),...t}),_oe=1,Eoe=900*1e3;let ky=0;const Soe=()=>(ky=(ky+1)%Number.MAX_SAFE_INTEGER,ky.toString()),Ny=new Map,OR=e=>{if(Ny.has(e))return;const t=setTimeout(()=>{Ny.delete(e),Rc({type:"REMOVE_TOAST",toastId:e})},Eoe);Ny.set(e,t)},xoe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,_oe)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?OR(n):e.toasts.forEach(r=>{OR(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},wf=[];let Tf={toasts:[]};const Rc=e=>{Tf=xoe(Tf,e),wf.forEach(t=>{t(Tf)})},Aoe=({...e})=>{const t=Soe(),n=a=>Rc({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Rc({type:"DISMISS_TOAST",toastId:t});return Rc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}},XL=()=>{const[e,t]=E.useState(Tf);return E.useEffect(()=>(wf.push(t),()=>{const n=wf.indexOf(t);n>-1&&wf.splice(n,1)}),[e]),{...e,toast:Aoe,dismiss:n=>Rc({type:"DISMISS_TOAST",toastId:n})}},woe=()=>{const{toasts:e}=XL();return v.jsxs(hoe.Provider,{children:[e.map(({id:t,title:n,description:r,action:a,...s})=>v.jsxs(goe,{...s,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(voe,{children:n}),r&&v.jsx(boe,{children:r})]}),a,v.jsx(yoe,{})]},t)),v.jsx(poe,{})]})};var Toe={};const Coe={queries:{retry:1,refetchOnWindowFocus:!1,staleTime:0,gcTime:1e3*60*10},mutations:{retry:0}},DR=e=>e.split("_").join(" "),Roe=()=>{const{toast:e}=XL();return{onError:r=>{[(()=>{try{if(typeof r=="string")return JSON.parse(r)}catch{}return r})()].flat().forEach(s=>e({title:DR((Toe.NODE_ENV==="production"?s?.title:s?.code)??"Error"),description:s?.message??String(s??"An error occurred"),variant:"error"}))},onSuccess:r=>{r?.error&&e({title:DR(r.error.title??r.error.code??"Error"),description:r.error.message??r.error.code??"An error occurred",variant:"error"}),r?.message&&e({title:r.message,description:r.description,variant:"success"})}}},koe=({children:e})=>{const{onError:t,onSuccess:n}=Roe(),r=new bI({onSuccess:n,onError:t,onSettled:(s,l,u,d,f)=>{f.meta?.invalidateQueries&&f.meta.invalidateQueries.forEach(p=>{a.invalidateQueries({queryKey:p})})}}),a=new Q5({defaultOptions:Coe,mutationCache:r});return v.jsx(r8,{client:a,children:e})},Noe=({children:e})=>v.jsx(o4,{features:j5,children:e}),Ioe=({children:e})=>v.jsx(Noe,{children:v.jsxs(koe,{children:[v.jsx(woe,{}),e]})}),Ooe=({children:e})=>v.jsx(r2,{children:v.jsx(LU,{children:v.jsx(E1,{path:"*",element:e})})}),rb="dictionaryList",m_=e=>`dictionary_edition_${e}`,QL=e=>{const t=m_(e),{isOpen:n,open:r,close:a}=Zh(),{getEditedContentValue:s}=Ds(),{focusedContent:l,setFocusedContent:u}=da();return E.useEffect(()=>{l&&(l.keyPath?.length??0)>0&&r(t)},[l,r,t]),{isOpen:n(t),focusedContent:l,getEditedContentValue:s,close:()=>{a(t),u(d=>d?.dictionaryKey?{...d,keyPath:[]}:d)}}},Doe=({locale:e,identifier:t,handleOnBack:n,isDarkMode:r})=>{const{modalTitle:a,openDictionaryEditor:s,noDictionaryFocused:l,focusedDictionaryNotFound:u}=Yc(ab),[d,f]=E.useState(!1),{focusedContent:p}=QL(t),{data:g}=DI(),y=E.useCallback(()=>{f(!1),n()},[n]),_=p?.dictionaryKey;if(!_)return v.jsx("span",{className:"mx-auto my-10 text-sm text-neutral",children:l});const x=ZB(_,p.keyPath??[],g);return x?v.jsxs(v.Fragment,{children:[v.jsx(p0,{isOpen:d,onClose:()=>f(!1),hasCloseButton:!0,title:a.value,size:"xl",transparency:"lg",children:v.jsx("div",{className:"size-full px-3 pt-5",children:v.jsx(Bae,{dictionary:x,onClickDictionaryList:y,isDarkMode:r,mode:["local","remote"],onDelete:()=>{f(!1),n()}})})}),v.jsxs("div",{className:"border-text/20 /20 mb-5 flex w-full border-b border-dashed px-3 pb-2",children:[v.jsx("h3",{className:"w-full text-center text-lg",children:x.title?x.title:x.key}),v.jsx(ot,{variant:"hoverable",color:"text",size:"icon-md",IconRight:N1,label:s.label.value,onClick:()=>f(!0)})]}),v.jsx(KW,{dictionary:x,locale:e,mode:["local","remote"]})]}):v.jsx("span",{className:"mx-auto my-10 text-sm text-neutral",children:u})},Loe=({locale:e,dictionaryKey:t,isDarkMode:n})=>{const{backButtonText:r}=Yc(ab),a=m_(t),{focusedContent:s,close:l}=QL(t),{openDictionaryListDrawer:u}=Zh(f=>({openDictionaryListDrawer:()=>f.open(rb)})),d=()=>{l(),u()};return v.jsx(zL,{identifier:a,backButton:{onBack:d,text:r.value},onClose:l,children:s&&v.jsx(Doe,{focusedContent:s,locale:e,identifier:a,handleOnBack:d,isDarkMode:n})})},joe=({locale:e,isDarkMode:t})=>{const{focusedContent:n}=da(),r=n?.dictionaryKey;return r?v.jsx(Loe,{locale:e,dictionaryKey:r,isDarkMode:t}):v.jsx(v.Fragment,{})},Poe=()=>{const{drawerTitle:e,buttonLabel:t}=Yc(PR),{close:n,open:r}=Zh(),{localeDictionaries:a}=ZR(),{editedContent:s}=xn(),{setFocusedContent:l}=da(),u=f=>{n(rb),l({dictionaryKey:f}),r(m_(f))},d=f=>Object.keys(s??{}).includes(f);return v.jsx(zL,{title:e.label.value,identifier:rb,children:Object.values(a).map(f=>v.jsx("div",{children:v.jsx(ot,{label:t.label({dictionaryLocalId:f.localId}).value,onClick:()=>u(f.localId),variant:"hoverable",color:"text",IconRight:Nf,size:"md",isFullWidth:!0,children:d(f.localId)?`✎ ${f.key}`:f.key})},f.localId))})},JL=(...e)=>$1(gh(e)),Moe=e=>{const{message:t}=Yc(MR);return v.jsx("div",{className:JL("bg-neutral/30 py-1 px-3 rounded-2xl font-bold text-text text-sm transition-opacity duration-100",e?.dictionaryKey?"opacity-100":"opacity-0"),children:e?.dictionaryKey?t({dictionaryKey:e.dictionaryKey}):""})},zoe=({children:e})=>{const[t]=ia(Sn.INTLAYER_CURRENT_LOCALE,void 0,{receive:!0,emit:!1}),[n]=ia(Sn.INTLAYER_HOVERED_CONTENT_CHANGED,null),{data:r}=DI(),{setLocaleDictionaries:a}=dh();return E.useEffect(()=>{if(!r)return;const s=Object.fromEntries(Object.values(r).flat().map(l=>[l.localId,l]));a(s)},[r]),v.jsxs("div",{className:"bg-card relative size-full p-3",children:[e,v.jsx("div",{className:"absolute bottom-2 right-2",children:v.jsx(Moe,{...n})}),v.jsx(joe,{locale:t}),v.jsx(Poe,{})]})},Boe=()=>{const[e,t]=E.useState();return E.useEffect(()=>{fetch("/api/config").then(n=>n.json()).then(n=>t(n.data))},[]),e},Voe=({children:e,iframeRef:t})=>{const n=Boe(),r=n?.editor.applicationURL?n?.editor.applicationURL:"*",a=n?.editor.editorURL??"*";return n?v.jsx(wV,{postMessage:s=>{window?.postMessage(s,a),t.current?.contentWindow?.postMessage(s,r)},allowedOrigins:[r,a],mode:"editor",configuration:n,children:e}):v.jsx(As,{})},Uoe=()=>{const{editedContent:e,setEditedContentState:t}=xn(),n=()=>{const r=localStorage?.getItem("INTLAYER_EDITED_CONTENT_CHANGED");if(r)try{const a=JSON.parse(r);t(a)}catch(a){console.error(a)}};return E.useEffect(()=>{typeof e>"u"||localStorage?.setItem("INTLAYER_EDITED_CONTENT_CHANGED",JSON.stringify(e))},[e]),E.useEffect(()=>{typeof e<"u"||n()},[]),n},Foe=()=>{const{title:e,description:t,documentationLink:n}=Yc(zR);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsx(f0,{className:"mb-8",children:e}),v.jsx("strong",{className:"text-neutral block",children:t}),v.jsx(bb,{label:n.label.value,href:"https://intlayer.org/doc/concept/configuration#editor-configuration",color:"text",children:n.text})]})},$oe=({iframeRef:e,applicationPath:t})=>{const{editor:n}=Gr(),r=()=>a(n.enabled),a=_V();JR(r),Uoe(),CV();const[s,l]=E.useState(!0),[u]=TV(void 0,{receive:!0,emit:!1});return E.useEffect(()=>{typeof u=="string"&&window.history.replaceState({},"",u)},[u]),n.applicationURL?v.jsxs("div",{className:"size-full overflow-hidden rounded-lg",children:[v.jsx(As,{isLoading:s}),v.jsx("iframe",{src:`${n.applicationURL}${t}`,title:"Intlayer Application",className:JL("size-full",s&&"hidden"),ref:e,onLoad:()=>{l(!1),r()}})]}):v.jsx("div",{className:"flex size-full items-center justify-center",children:v.jsx(Ar,{className:"flex max-w-xl flex-col gap-4 p-6",children:v.jsx(Foe,{})})})},Hoe=()=>{const e=E.useRef(null),t=fa();return v.jsx(Voe,{iframeRef:e,children:v.jsx(OV,{disableEditor:!0,children:v.jsx(zoe,{children:v.jsx($oe,{iframeRef:e,applicationPath:t.pathname})})})})},Goe=()=>v.jsx(Ooe,{children:v.jsx(Ioe,{children:v.jsx(Hoe,{})})});EM.createRoot(document.getElementById("root")).render(v.jsx(E.StrictMode,{children:v.jsx(Goe,{})}));
|
|
338
|
+
`).length>1;return v.jsxs("div",{className:_e("relative h-full w-full text-sm",r&&"ml-0"),children:[a&&v.jsx("div",{className:"sticky top-5 z-10",children:v.jsx("div",{className:_e("absolute bottom-0 right-2 flex h-7 items-center"),children:v.jsx(kk,{content:e})})}),v.jsx("div",{className:"z-0 grid size-full grid-cols-[0px] overflow-auto",ref:u,children:v.jsx(Dae,{...f,defaultLanguage:"typescript",language:t,loading:v.jsx(As,{}),defaultValue:String(e).replace(/\n$/,""),onMount:y,onChange:l,options:{readOnly:s,cursorStyle:"line",minimap:{enabled:!1},scrollbar:{vertical:"hidden",verticalScrollbarSize:0,alwaysConsumeMouseWheel:!1},folding:!1,renderValidationDecorations:"off",quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,mouseWheelScrollSensitivity:0,fastScrollSensitivity:0,scrollBeyondLastLine:!1,lineNumbers:_?"on":"off"},theme:g,className:"my-2 rounded-md"})})]})},jae=({dictionary:e,isDarkMode:t})=>{const{setEditedContent:n,editedContent:r}=xn(),a=l=>{try{return JSON.parse(l),!0}catch{return!1}},s=E.useMemo(()=>r?.[e.localId]?.content??e?.content??{},[e]);return v.jsx(Ar,{background:"none",border:!0,roundedSize:"xl",className:"w-full overflow-hidden p-3",children:v.jsx(Lae,{language:"json",onChange:l=>{a(l??"{}")&&n(e.localId,JSON.parse(l??"{}"))},isDarkMode:t,children:JSON.stringify(s,null,2)})})},rf=({section:e,onValueChange:t})=>{const{multilingual:n,text:r,number:a,boolean:s,node:l,array:u,enumeration:d,triggerPlaceHolder:f,nest:p,condition:g,markdown:y,insertion:_,reactNode:x,file:A}=cn("node-type-selector"),C=Os(e),[w,S]=E.useState(C),T=N=>{S(N),t(N)};return v.jsxs(Re,{value:w,onValueChange:T,children:[v.jsx(Re.Trigger,{children:v.jsx(Re.Value,{placeholder:f})}),v.jsxs(Re.Content,{children:[v.jsx(Re.Item,{value:$.Translation,children:n}),v.jsx(Re.Item,{value:$.Text,children:r}),v.jsx(Re.Item,{value:$.Number,children:a}),v.jsx(Re.Item,{value:$.Boolean,children:s}),v.jsx(Re.Item,{value:$.Object,children:l}),v.jsx(Re.Item,{value:$.Array,children:u}),v.jsx(Re.Item,{value:$.Enumeration,children:d}),v.jsx(Re.Item,{value:$.Insertion,children:_}),v.jsx(Re.Item,{value:$.Markdown,children:y}),v.jsx(Re.Item,{value:$.Nested,children:p}),v.jsx(Re.Item,{value:$.Condition,children:g}),v.jsx(Re.Item,{value:$.ReactNode,disabled:!0,children:x}),v.jsx(Re.Item,{value:$.File,children:A})]})]})},Jv=({section:e,dictionaryKey:t,keyPath:n,onNodeTypeChange:r})=>{const a=Gr()?.internationalization.locales??[],s=Os(e),l=FR(e),u=d=>{const f=Wl(s,a,d);r(f)};if(s===$.Translation||s===$.Condition||s===$.Enumeration){const d=Object.keys(e[s])[0],f=[...n,{type:s,key:d}];return v.jsxs("div",{className:"flex w-full flex-col gap-1",children:[v.jsx(rf,{section:e,onValueChange:p=>r(Wl(p,a))}),v.jsx(Jv,{section:l,keyPath:f,dictionaryKey:t,onNodeTypeChange:u})]})}if(s===$.Array){const d=[...n,{type:s,key:0}];return v.jsxs("div",{className:"flex w-full flex-col gap-1",children:[v.jsx(rf,{section:e,onValueChange:f=>r(Wl(f,a))}),v.jsx(Jv,{section:l,keyPath:d,dictionaryKey:t,onNodeTypeChange:u})]})}return s===$.Object?v.jsxs(v.Fragment,{children:[v.jsx(rf,{section:e,onValueChange:d=>r(Wl(d,a))}),v.jsx("div",{className:"ml-10 mt-6",children:v.jsx(Mae,{keyPath:n,section:e,dictionaryKey:t})})]}):v.jsx(rf,{section:e,onValueChange:d=>r(Wl(d,a))})},o_=({sectionKey:e,section:t,keyPath:n,dictionaryKey:r})=>{const{focusedContent:a,setFocusedContentKeyPath:s}=da(),{renameEditedContent:l,addEditedContent:u}=Ds(),{titleInput:d,deleteButton:f}=cn("structure-view"),p=g=>{l(r,g,n);const y=n.slice(0,-1),_=n[n.length-1],x=[...y,{..._,key:g}];s(x)};return v.jsx(Ar,{transparency:"xl",roundedSize:"xl",className:"w-full min-w-80 gap-2 overflow-auto px-5 py-2",border:!0,borderColor:"text",background:"none","aria-selected":Wc(n,a?.keyPath??[]),onClick:()=>s(n),children:v.jsxs("div",{className:"flex w-full flex-col items-start justify-between gap-3",children:[typeof e=="string"&&v.jsxs("div",{className:"w-full",children:[v.jsxs("div",{className:"flex w-full items-center justify-between gap-10",children:[v.jsx(YI,{name:"key","aria-label":"Key",placeholder:d.placeholder.value,defaultValue:e,onSave:g=>p(g),variant:la.INVISIBLE}),v.jsx(ot,{label:f.label.value,variant:at.HOVERABLE,size:Kn.ICON_SM,color:it.TEXT,className:"translate-x-2",Icon:mh,onClick:()=>{u(r,void 0,n);const g=n.slice(0,-1);s(g)}})]}),v.jsxs("span",{className:"text-neutral ml-3 text-sm",children:["( ",Af(e)," )"]})]}),v.jsx(Jv,{keyPath:n,dictionaryKey:r,section:t,onNodeTypeChange:g=>{u(r,g,n)}})]})})},Pae=({section:e,keyPath:t,dictionaryKey:n})=>{const{addNodeButton:r}=cn("structure-view"),{setFocusedContentKeyPath:a}=lb(),{addEditedContent:s}=Ds();return!e||typeof e!="object"?v.jsx("div",{children:"Not an object"}):v.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto",children:[v.jsx("ul",{className:"mr-auto flex flex-col gap-4",children:Object.keys(e).map(l=>v.jsx("li",{className:"flex w-full",children:v.jsx(o_,{sectionKey:l,section:e?.[l],keyPath:[...t,{type:$.Object,key:l}],dictionaryKey:n})},l))}),v.jsx(ot,{label:r.label.value,variant:at.HOVERABLE,size:Kn.MD,color:it.TEXT,Icon:ph,className:"flex-1",onClick:()=>{const u=[...t,{type:$.Object,key:"newKey"}];s(n,"",u),a(u)},children:r.text})]})},Mae=({section:e,keyPath:t,dictionaryKey:n})=>!e||typeof e!="object"||typeof e.nodeType=="string"?v.jsx(o_,{sectionKey:"content",section:e,keyPath:t,dictionaryKey:n}):v.jsx(Pae,{section:e,keyPath:t,dictionaryKey:n}),zae=({dictionary:e})=>{const{content:t,key:n,localId:r}=e,{editedContent:a}=xn(),s=typeof a?.[r]?.content>"u"?t:a?.[r]?.content;return v.jsx(o_,{section:s,keyPath:[],dictionaryKey:n})},Bae=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:a})=>{const s=Gr(),[l,u]=E.useState(1),{returnToDictionaryList:d}=cn("dictionary-field-editor"),{setFocusedContent:f}=lb(),{setLocaleDictionaries:p}=dh();return E.useEffect(()=>{f(g=>({...g??{},dictionaryKey:e.key,dictionaryLocalId:e.localId})),p(g=>({...g,[e.localId]:e}))},[]),v.jsx(XQ,{availableLocales:s?.internationalization.locales??[],children:v.jsxs("div",{className:"flex size-full flex-col gap-6 px-2",children:[v.jsx(ot,{onClick:t,variant:at.HOVERABLE,className:"z-10 ml-5 mr-auto",color:it.TEXT,Icon:_2,label:d.label.value,children:d.text}),v.jsx(hu,{defaultValue:l,onChange:g=>u(g),color:du.TEXT,size:fu.SM,className:"m-auto w-full max-w-xl",choices:[{content:"Details",value:0},{content:"Structure",value:2},{content:"Content",value:1},{content:"JSON",value:3}].filter(({value:g})=>!(!r.includes("remote")&&g===0))}),l===0&&v.jsx(Rie,{dictionary:e}),l===2&&v.jsx(zae,{dictionary:e}),l===1&&v.jsx(Tie,{dictionary:e,isDarkMode:n}),l===3&&v.jsx(jae,{dictionary:e,isDarkMode:n}),v.jsx(cD,{dictionary:e,mode:r,onDelete:()=>{f(null),a?.()}})]})})},Vae=({children:e,isHidden:t,minWidth:n=0,align:r="left",className:a,...s})=>v.jsx("div",{className:_e("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out",t?"":"grid-cols-[1fr]",a),"aria-hidden":t,...s,children:v.jsx("div",{style:{minWidth:`${n}px`},tabIndex:t!==!1?void 0:-1,className:_e(r==="right"&&"ml-auto"),children:e})}),Uae=e=>{switch(e){case"sm":return 640;case"md":return 768;case"lg":return 1024;case"xl":return 1280;case"2xl":return 1536;default:return e}},Fae=()=>{if(typeof window>"u")return;const e=window.navigator?.userAgent;if(!(typeof e>"u"))return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},$ae=e=>{if(!(typeof window>"u"))return(window?.innerWidth??0)<=e},NR=(e="md")=>{const t=Uae(e),n=Fae(),r=$ae(t);return{isMobileScreen:r,isMobileUserAgent:n,isMobile:r??n}},Hae=(e="md")=>{const[t,n]=E.useState(NR(e));return E.useEffect(()=>{const r=()=>{n(NR(e))};return window.addEventListener("resize",r,{passive:!0}),()=>window.removeEventListener("resize",r)},[e]),t},Gae=e=>{const t=e.getBoundingClientRect(),n=t.top,r=t.bottom-1;if(n>=0&&r<=window.innerHeight){const s=t.left+t.width/2,l=t.top+10,u=document.elementFromPoint(s,l);return e===u||e.contains(u)}return!1},Zh=AI((e,t)=>({drawers:{},open:n=>e(r=>({drawers:{...r.drawers,[n]:!0}})),close:n=>e(r=>({drawers:{...r.drawers,[n]:!1}})),isOpen:n=>t().drawers[n]??!1})),zL=({title:e,identifier:t,children:n,header:r,closeOnOutsideClick:a=!0,backButton:s,isOpen:l,onClose:u})=>{const{isMobile:d}=Hae("md"),f=E.useRef(null),p=E.useRef(null),{close:g,open:y,isOpen:_}=Zh(wI(A=>({close:()=>A.close(t),open:()=>A.open(t),isOpen:A.isOpen(t)})));TI({disableScroll:_,key:t?`right_drawer_${t}`:"right_drawer"}),E.useEffect(()=>{const A=C=>{try{if(!f.current)return;const w=_&&a,S=C.target&&!f.current.contains(C.target),T=Gae(f.current);(w&&S&&T||!C.target)&&(g(),u?.())}catch{g(),u?.()}};return window.addEventListener("mousedown",A),()=>window.removeEventListener("mousedown",A)},[_,g,u,a,t]),E.useEffect(()=>{l!==void 0&&(l?y():(g(),u?.()))},[g,y,u,l,t]);const x=A=>{A.target===A.currentTarget&&d&&(g(),u?.())};return v.jsx("div",{className:"fixed right-0 top-0 z-50 flex h-full justify-end",children:v.jsx(Vae,{isHidden:!_,align:"right",children:v.jsxs(Ar,{className:"text-text relative flex h-screen w-screen flex-col md:w-[400px]",ref:f,roundedSize:"none",children:[v.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[v.jsxs("div",{className:"flex justify-between gap-3",children:[v.jsx("div",{children:s&&v.jsx(ot,{variant:at.HOVERABLE,color:it.TEXT,label:s.text??"Go back",onClick:s.onBack,Icon:T2,children:s?.text})}),v.jsx("div",{children:v.jsx(ot,{variant:at.HOVERABLE,color:it.TEXT,label:"Close",className:"ml-auto",onClick:g,Icon:ho,size:Kn.ICON_MD})})]}),e&&v.jsx("h2",{className:"flex items-center justify-center text-lg font-bold",children:e}),r]}),v.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-2",children:v.jsx("div",{className:"flex flex-1 flex-col",onClick:x,ref:p,children:n})})]})})})};var s_="ToastProvider",[l_,Kae,qae]=eO("Toast"),[BL,Wae]=eu("Toast",[qae]),[Zae,Yh]=BL(s_),c_=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:l}=e,[u,d]=E.useState(null),[f,p]=E.useState(0),g=E.useRef(!1),y=E.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${s_}\`. Expected non-empty \`string\`.`),v.jsx(l_.Provider,{scope:t,children:v.jsx(Zae,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:s,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:E.useCallback(()=>p(_=>_+1),[]),onToastRemove:E.useCallback(()=>p(_=>_-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:y,children:l})})};c_.displayName=s_;var VL="ToastViewport",Yae=["F8"],eb="toast.viewportPause",tb="toast.viewportResume",u_=E.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Yae,label:a="Notifications ({hotkey})",...s}=e,l=Yh(VL,n),u=Kae(n),d=E.useRef(null),f=E.useRef(null),p=E.useRef(null),g=E.useRef(null),y=wt(t,g,l.onViewportChange),_=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=l.toastCount>0;E.useEffect(()=>{const C=w=>{r.length!==0&&r.every(T=>w[T]||w.code===T)&&g.current?.focus()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[r]),E.useEffect(()=>{const C=d.current,w=g.current;if(x&&C&&w){const S=()=>{if(!l.isClosePausedRef.current){const O=new CustomEvent(eb);w.dispatchEvent(O),l.isClosePausedRef.current=!0}},T=()=>{if(l.isClosePausedRef.current){const O=new CustomEvent(tb);w.dispatchEvent(O),l.isClosePausedRef.current=!1}},N=O=>{!C.contains(O.relatedTarget)&&T()},R=()=>{C.contains(document.activeElement)||T()};return C.addEventListener("focusin",S),C.addEventListener("focusout",N),C.addEventListener("pointermove",S),C.addEventListener("pointerleave",R),window.addEventListener("blur",S),window.addEventListener("focus",T),()=>{C.removeEventListener("focusin",S),C.removeEventListener("focusout",N),C.removeEventListener("pointermove",S),C.removeEventListener("pointerleave",R),window.removeEventListener("blur",S),window.removeEventListener("focus",T)}}},[x,l.isClosePausedRef]);const A=E.useCallback(({tabbingDirection:C})=>{const S=u().map(T=>{const N=T.ref.current,R=[N,...coe(N)];return C==="forwards"?R:R.reverse()});return(C==="forwards"?S.reverse():S).flat()},[u]);return E.useEffect(()=>{const C=g.current;if(C){const w=S=>{const T=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!T){const R=document.activeElement,O=S.shiftKey;if(S.target===C&&O){f.current?.focus();return}const H=A({tabbingDirection:O?"backwards":"forwards"}),Z=H.findIndex(q=>q===R);Ry(H.slice(Z+1))?S.preventDefault():O?f.current?.focus():p.current?.focus()}};return C.addEventListener("keydown",w),()=>C.removeEventListener("keydown",w)}},[u,A]),v.jsxs(y$,{ref:d,role:"region","aria-label":a.replace("{hotkey}",_),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&v.jsx(nb,{ref:f,onFocusFromOutsideViewport:()=>{const C=A({tabbingDirection:"forwards"});Ry(C)}}),v.jsx(l_.Slot,{scope:n,children:v.jsx(He.ol,{tabIndex:-1,...s,ref:y})}),x&&v.jsx(nb,{ref:p,onFocusFromOutsideViewport:()=>{const C=A({tabbingDirection:"backwards"});Ry(C)}})]})});u_.displayName=VL;var UL="ToastFocusProxy",nb=E.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,s=Yh(UL,n);return v.jsx(j0,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!s.viewport?.contains(u)&&r()}})});nb.displayName=UL;var vu="Toast",Xae="toast.swipeStart",Qae="toast.swipeMove",Jae="toast.swipeCancel",eoe="toast.swipeEnd",d_=E.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:s,...l}=e,[u,d]=If({prop:r,defaultProp:a??!0,onChange:s,caller:vu});return v.jsx(tu,{present:n||u,children:v.jsx(roe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:_r(e.onPause),onResume:_r(e.onResume),onSwipeStart:Qe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Qe(e.onSwipeMove,f=>{const{x:p,y:g}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Qe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Qe(e.onSwipeEnd,f=>{const{x:p,y:g}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),d(!1)})})})});d_.displayName=vu;var[toe,noe]=BL(vu,{onClose(){}}),roe=E.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:s,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:y,onSwipeEnd:_,...x}=e,A=Yh(vu,n),[C,w]=E.useState(null),S=wt(t,W=>w(W)),T=E.useRef(null),N=E.useRef(null),R=a||A.duration,O=E.useRef(0),D=E.useRef(R),j=E.useRef(0),{onToastAdd:H,onToastRemove:Z}=A,q=_r(()=>{C?.contains(document.activeElement)&&A.viewport?.focus(),l()}),te=E.useCallback(W=>{!W||W===1/0||(window.clearTimeout(j.current),O.current=new Date().getTime(),j.current=window.setTimeout(q,W))},[q]);E.useEffect(()=>{const W=A.viewport;if(W){const ae=()=>{te(D.current),f?.()},M=()=>{const X=new Date().getTime()-O.current;D.current=D.current-X,window.clearTimeout(j.current),d?.()};return W.addEventListener(eb,M),W.addEventListener(tb,ae),()=>{W.removeEventListener(eb,M),W.removeEventListener(tb,ae)}}},[A.viewport,R,d,f,te]),E.useEffect(()=>{s&&!A.isClosePausedRef.current&&te(R)},[s,R,A.isClosePausedRef,te]),E.useEffect(()=>(H(),()=>Z()),[H,Z]);const ce=E.useMemo(()=>C?GL(C):null,[C]);return A.viewport?v.jsxs(v.Fragment,{children:[ce&&v.jsx(ioe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ce}),v.jsx(toe,{scope:n,onClose:q,children:fo.createPortal(v.jsx(l_.ItemSlot,{scope:n,children:v.jsx(g$,{asChild:!0,onEscapeKeyDown:Qe(u,()=>{A.isFocusedToastEscapeKeyDownRef.current||q(),A.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(He.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":A.swipeDirection,...x,ref:S,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Qe(e.onKeyDown,W=>{W.key==="Escape"&&(u?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(A.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Qe(e.onPointerDown,W=>{W.button===0&&(T.current={x:W.clientX,y:W.clientY})}),onPointerMove:Qe(e.onPointerMove,W=>{if(!T.current)return;const ae=W.clientX-T.current.x,M=W.clientY-T.current.y,X=!!N.current,G=["left","right"].includes(A.swipeDirection),ge=["left","up"].includes(A.swipeDirection)?Math.min:Math.max,P=G?ge(0,ae):0,ie=G?0:ge(0,M),F=W.pointerType==="touch"?10:2,J={x:P,y:ie},oe={originalEvent:W,delta:J};X?(N.current=J,af(Qae,g,oe,{discrete:!1})):IR(J,A.swipeDirection,F)?(N.current=J,af(Xae,p,oe,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(ae)>F||Math.abs(M)>F)&&(T.current=null)}),onPointerUp:Qe(e.onPointerUp,W=>{const ae=N.current,M=W.target;if(M.hasPointerCapture(W.pointerId)&&M.releasePointerCapture(W.pointerId),N.current=null,T.current=null,ae){const X=W.currentTarget,G={originalEvent:W,delta:ae};IR(ae,A.swipeDirection,A.swipeThreshold)?af(eoe,_,G,{discrete:!0}):af(Jae,y,G,{discrete:!0}),X.addEventListener("click",ge=>ge.preventDefault(),{once:!0})}})})})}),A.viewport)})]}):null}),ioe=e=>{const{__scopeToast:t,children:n,...r}=e,a=Yh(vu,t),[s,l]=E.useState(!1),[u,d]=E.useState(!1);return soe(()=>l(!0)),E.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:v.jsx(vh,{asChild:!0,children:v.jsx(j0,{...r,children:s&&v.jsxs(v.Fragment,{children:[a.label," ",n]})})})},aoe="ToastTitle",f_=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(He.div,{...r,ref:t})});f_.displayName=aoe;var ooe="ToastDescription",h_=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(He.div,{...r,ref:t})});h_.displayName=ooe;var FL="ToastAction",p_=E.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?v.jsx(HL,{altText:n,asChild:!0,children:v.jsx(Xh,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${FL}\`. Expected non-empty \`string\`.`),null)});p_.displayName=FL;var $L="ToastClose",Xh=E.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=noe($L,n);return v.jsx(HL,{asChild:!0,children:v.jsx(He.button,{type:"button",...r,ref:t,onClick:Qe(e.onClick,a.onClose)})})});Xh.displayName=$L;var HL=E.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return v.jsx(He.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function GL(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),loe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...GL(r))}}),t}function af(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?q1(a,s):a.dispatchEvent(s)}var IR=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),s=r>a;return t==="left"||t==="right"?s&&r>n:!s&&a>n};function soe(e=()=>{}){const t=_r(e);ln(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function loe(e){return e.nodeType===e.ELEMENT_NODE}function coe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ry(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var uoe=c_,KL=u_,qL=d_,WL=f_,ZL=h_,doe=p_,YL=Xh;const foe=Object.freeze(Object.defineProperty({__proto__:null,Action:doe,Close:YL,Description:ZL,Provider:uoe,Root:qL,Title:WL,Toast:d_,ToastAction:p_,ToastClose:Xh,ToastDescription:h_,ToastProvider:c_,ToastTitle:f_,ToastViewport:u_,Viewport:KL,createToastScope:Wae},Symbol.toStringTag,{value:"Module"})),hoe=foe,poe=({className:e,...t})=>v.jsx(KL,{className:_e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}),moe=ur("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{error:"bg-error/40 text-text",success:"bg-success/30 text-text",default:"bg-card/80 text-text"}},defaultVariants:{variant:"default"}}),goe=({className:e,variant:t,...n})=>v.jsx(qL,{className:_e(moe({variant:t}),e),...n}),yoe=({className:e,...t})=>v.jsx(YL,{className:_e("text-text/50 hover:text-text/80 focus:outline-hidden absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:v.jsx(ho,{className:"size-5"})}),voe=({className:e,...t})=>v.jsx(WL,{className:_e("text-sm font-semibold [&+div]:text-xs",e),...t}),boe=({className:e,...t})=>v.jsx(ZL,{className:_e("text-sm opacity-90",e),...t}),_oe=1,Eoe=900*1e3;let ky=0;const Soe=()=>(ky=(ky+1)%Number.MAX_SAFE_INTEGER,ky.toString()),Ny=new Map,OR=e=>{if(Ny.has(e))return;const t=setTimeout(()=>{Ny.delete(e),Rc({type:"REMOVE_TOAST",toastId:e})},Eoe);Ny.set(e,t)},xoe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,_oe)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?OR(n):e.toasts.forEach(r=>{OR(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},wf=[];let Tf={toasts:[]};const Rc=e=>{Tf=xoe(Tf,e),wf.forEach(t=>{t(Tf)})},Aoe=({...e})=>{const t=Soe(),n=a=>Rc({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Rc({type:"DISMISS_TOAST",toastId:t});return Rc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}},XL=()=>{const[e,t]=E.useState(Tf);return E.useEffect(()=>(wf.push(t),()=>{const n=wf.indexOf(t);n>-1&&wf.splice(n,1)}),[e]),{...e,toast:Aoe,dismiss:n=>Rc({type:"DISMISS_TOAST",toastId:n})}},woe=()=>{const{toasts:e}=XL();return v.jsxs(hoe.Provider,{children:[e.map(({id:t,title:n,description:r,action:a,...s})=>v.jsxs(goe,{...s,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(voe,{children:n}),r&&v.jsx(boe,{children:r})]}),a,v.jsx(yoe,{})]},t)),v.jsx(poe,{})]})};var Toe={};const Coe={queries:{retry:1,refetchOnWindowFocus:!1,staleTime:0,gcTime:1e3*60*10},mutations:{retry:0}},DR=e=>e.split("_").join(" "),Roe=()=>{const{toast:e}=XL();return{onError:r=>{[(()=>{try{if(typeof r=="string")return JSON.parse(r)}catch{}return r})()].flat().forEach(s=>e({title:DR((Toe.NODE_ENV==="production"?s?.title:s?.code)??"Error"),description:s?.message??String(s??"An error occurred"),variant:"error"}))},onSuccess:r=>{r?.error&&e({title:DR(r.error.title??r.error.code??"Error"),description:r.error.message??r.error.code??"An error occurred",variant:"error"}),r?.message&&e({title:r.message,description:r.description,variant:"success"})}}},koe=({children:e})=>{const{onError:t,onSuccess:n}=Roe(),r=new bI({onSuccess:n,onError:t,onSettled:(s,l,u,d,f)=>{f.meta?.invalidateQueries&&f.meta.invalidateQueries.forEach(p=>{a.invalidateQueries({queryKey:p})})}}),a=new Q5({defaultOptions:Coe,mutationCache:r});return v.jsx(r8,{client:a,children:e})},Noe=({children:e})=>v.jsx(o4,{features:j5,children:e}),Ioe=({children:e})=>v.jsx(Noe,{children:v.jsxs(koe,{children:[v.jsx(woe,{}),e]})}),Ooe=({children:e})=>v.jsx(r2,{children:v.jsx(LU,{children:v.jsx(E1,{path:"*",element:e})})}),rb="dictionaryList",m_=e=>`dictionary_edition_${e}`,QL=e=>{const t=m_(e),{isOpen:n,open:r,close:a}=Zh(),{getEditedContentValue:s}=Ds(),{focusedContent:l,setFocusedContent:u}=da();return E.useEffect(()=>{l&&(l.keyPath?.length??0)>0&&r(t)},[l,r,t]),{isOpen:n(t),focusedContent:l,getEditedContentValue:s,close:()=>{a(t),u(d=>d?.dictionaryKey?{...d,keyPath:[]}:d)}}},Doe=({locale:e,identifier:t,handleOnBack:n,isDarkMode:r})=>{const{modalTitle:a,openDictionaryEditor:s,noDictionaryFocused:l,focusedDictionaryNotFound:u}=Yc(ab),[d,f]=E.useState(!1),{focusedContent:p}=QL(t),{data:g}=DI(),y=E.useCallback(()=>{f(!1),n()},[n]),_=p?.dictionaryKey;if(!_)return v.jsx("span",{className:"mx-auto my-10 text-sm text-neutral",children:l});const x=ZB(_,p.keyPath??[],g);return x?v.jsxs(v.Fragment,{children:[v.jsx(p0,{isOpen:d,onClose:()=>f(!1),hasCloseButton:!0,title:a.value,size:"xl",transparency:"lg",children:v.jsx("div",{className:"size-full px-3 pt-5",children:v.jsx(Bae,{dictionary:x,onClickDictionaryList:y,isDarkMode:r,mode:["local","remote"],onDelete:()=>{f(!1),n()}})})}),v.jsxs("div",{className:"border-text/20 /20 mb-5 flex w-full border-b border-dashed px-3 pb-2",children:[v.jsx("h3",{className:"w-full text-center text-lg",children:x.title?x.title:x.key}),v.jsx(ot,{variant:"hoverable",color:"text",size:"icon-md",IconRight:N1,label:s.label.value,onClick:()=>f(!0)})]}),v.jsx(KW,{dictionary:x,locale:e,mode:["local","remote"]})]}):v.jsx("span",{className:"mx-auto my-10 text-sm text-neutral",children:u})},Loe=({locale:e,dictionaryKey:t,isDarkMode:n})=>{const{backButtonText:r}=Yc(ab),a=m_(t),{focusedContent:s,close:l}=QL(t),{openDictionaryListDrawer:u}=Zh(f=>({openDictionaryListDrawer:()=>f.open(rb)})),d=()=>{l(),u()};return v.jsx(zL,{identifier:a,backButton:{onBack:d,text:r.value},onClose:l,children:s&&v.jsx(Doe,{focusedContent:s,locale:e,identifier:a,handleOnBack:d,isDarkMode:n})})},joe=({locale:e,isDarkMode:t})=>{const{focusedContent:n}=da(),r=n?.dictionaryKey;return r?v.jsx(Loe,{locale:e,dictionaryKey:r,isDarkMode:t}):v.jsx(v.Fragment,{})},Poe=()=>{const{drawerTitle:e,buttonLabel:t}=Yc(PR),{close:n,open:r}=Zh(),{localeDictionaries:a}=ZR(),{editedContent:s}=xn(),{setFocusedContent:l}=da(),u=f=>{n(rb),l({dictionaryKey:f}),r(m_(f))},d=f=>Object.keys(s??{}).includes(f);return v.jsx(zL,{title:e.label.value,identifier:rb,children:Object.values(a).map(f=>v.jsx("div",{children:v.jsx(ot,{label:t.label({dictionaryLocalId:f.localId}).value,onClick:()=>u(f.localId),variant:"hoverable",color:"text",IconRight:Nf,size:"md",isFullWidth:!0,children:d(f.localId)?`✎ ${f.key}`:f.key})},f.localId))})},JL=(...e)=>$1(gh(e)),Moe=e=>{const{message:t}=Yc(MR);return v.jsx("div",{className:JL("bg-neutral/30 py-1 px-3 rounded-2xl font-bold text-text text-sm transition-opacity duration-100",e?.dictionaryKey?"opacity-100":"opacity-0"),children:e?.dictionaryKey?t({dictionaryKey:e.dictionaryKey}):""})},zoe=({children:e})=>{const[t]=ia(Sn.INTLAYER_CURRENT_LOCALE,void 0,{receive:!0,emit:!1}),[n]=ia(Sn.INTLAYER_HOVERED_CONTENT_CHANGED,null),{data:r}=DI(),{setLocaleDictionaries:a}=dh();return E.useEffect(()=>{if(!r)return;const s=Object.fromEntries(Object.values(r).flat().map(l=>[l.localId,l]));a(s)},[r]),v.jsxs("div",{className:"bg-card relative size-full p-3",children:[e,v.jsx("div",{className:"absolute bottom-2 right-2",children:v.jsx(Moe,{...n})}),v.jsx(joe,{locale:t}),v.jsx(Poe,{})]})},Boe=()=>{const[e,t]=E.useState();return E.useEffect(()=>{fetch("/api/config").then(n=>n.json()).then(n=>t(n.data))},[]),e},Voe=({children:e,iframeRef:t})=>{const n=Boe(),r=n?.editor.applicationURL?n?.editor.applicationURL:"*",a=n?.editor.editorURL??"*";return n?v.jsx(wV,{postMessage:s=>{window?.postMessage(s,a),t.current?.contentWindow?.postMessage(s,r)},allowedOrigins:[r,a],mode:"editor",configuration:n,children:e}):v.jsx(As,{})},Uoe=()=>{const{editedContent:e,setEditedContentState:t}=xn(),n=()=>{const r=localStorage?.getItem("INTLAYER_EDITED_CONTENT_CHANGED");if(r)try{const a=JSON.parse(r);t(a)}catch(a){console.error(a)}};return E.useEffect(()=>{typeof e>"u"||localStorage?.setItem("INTLAYER_EDITED_CONTENT_CHANGED",JSON.stringify(e))},[e]),E.useEffect(()=>{typeof e<"u"||n()},[]),n},Foe=()=>{const{title:e,description:t,documentationLink:n}=Yc(zR);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsx(f0,{className:"mb-8",children:e}),v.jsx("strong",{className:"text-neutral block",children:t}),v.jsx(bb,{label:n.label.value,href:"https://intlayer.org/doc/concept/configuration#editor-configuration",color:"text",children:n.text})]})},$oe=({iframeRef:e,applicationPath:t})=>{const{editor:n}=Gr(),r=()=>a(n.enabled),a=_V();JR(r),Uoe(),CV();const[s,l]=E.useState(!0),[u]=TV(void 0,{receive:!0,emit:!1});return E.useEffect(()=>{typeof u=="string"&&window.history.replaceState({},"",u)},[u]),n.applicationURL?v.jsxs("div",{className:"size-full overflow-hidden rounded-lg",children:[v.jsx(As,{isLoading:s}),v.jsx("iframe",{src:`${n.applicationURL}${t}`,title:"Intlayer Application",className:JL("size-full",s&&"hidden"),ref:e,onLoad:()=>{l(!1),r()}})]}):v.jsx("div",{className:"flex size-full items-center justify-center",children:v.jsx(Ar,{className:"flex max-w-xl flex-col gap-4 p-6",children:v.jsx(Foe,{})})})},Hoe=()=>{const e=E.useRef(null),t=fa();return v.jsx(Voe,{iframeRef:e,children:v.jsx(OV,{disableEditor:!0,children:v.jsx(zoe,{children:v.jsx($oe,{iframeRef:e,applicationPath:t.pathname})})})})},Goe=()=>v.jsx(Ooe,{children:v.jsx(Ioe,{children:v.jsx(Hoe,{})})});EM.createRoot(document.getElementById("root")).render(v.jsx(E.StrictMode,{children:v.jsx(Goe,{})}));
|
package/client/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Intlayer Editor</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Dg-ukSXj.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BMlcL898.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer-editor",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
|
|
6
6
|
"keywords": [
|
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
"react-dom": "^19.1.1",
|
|
78
78
|
"react-router-dom": "^7.4.0",
|
|
79
79
|
"rimraf": "^6.0.1",
|
|
80
|
-
"@intlayer/config": "6.0.0
|
|
81
|
-
"@intlayer/
|
|
82
|
-
"@intlayer/
|
|
83
|
-
"@intlayer/editor-react": "6.0.0
|
|
84
|
-
"@intlayer/unmerged-dictionaries-entry": "6.0.0
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
80
|
+
"@intlayer/config": "6.0.0",
|
|
81
|
+
"@intlayer/core": "6.0.0",
|
|
82
|
+
"@intlayer/api": "6.0.0",
|
|
83
|
+
"@intlayer/editor-react": "6.0.0",
|
|
84
|
+
"@intlayer/unmerged-dictionaries-entry": "6.0.0",
|
|
85
|
+
"@intlayer/design-system": "6.0.0",
|
|
86
|
+
"express-intlayer": "6.0.0",
|
|
87
|
+
"react-intlayer": "6.0.0",
|
|
88
|
+
"vite-intlayer": "6.0.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@tailwindcss/vite": "^4.0.14",
|
|
@@ -117,16 +117,16 @@
|
|
|
117
117
|
"react-dom": ">=16.0.0",
|
|
118
118
|
"react-router-dom": ">=6.0.0",
|
|
119
119
|
"tailwind-merge": "^3.3.0",
|
|
120
|
-
"@intlayer/
|
|
121
|
-
"@intlayer/
|
|
122
|
-
"@intlayer/
|
|
123
|
-
"@intlayer/
|
|
124
|
-
"@intlayer/unmerged-dictionaries-entry": "6.0.0
|
|
125
|
-
"intlayer": "6.0.0
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"@intlayer/
|
|
120
|
+
"@intlayer/config": "6.0.0",
|
|
121
|
+
"@intlayer/core": "6.0.0",
|
|
122
|
+
"@intlayer/design-system": "6.0.0",
|
|
123
|
+
"@intlayer/editor-react": "6.0.0",
|
|
124
|
+
"@intlayer/unmerged-dictionaries-entry": "6.0.0",
|
|
125
|
+
"react-intlayer": "6.0.0",
|
|
126
|
+
"vite-intlayer": "6.0.0",
|
|
127
|
+
"@intlayer/chokidar": "6.0.0",
|
|
128
|
+
"intlayer": "6.0.0",
|
|
129
|
+
"@intlayer/dictionaries-entry": "6.0.0"
|
|
130
130
|
},
|
|
131
131
|
"engines": {
|
|
132
132
|
"node": ">=14.18"
|