@intlayer/design-system 8.3.0 → 8.3.2

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.
Files changed (45) hide show
  1. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  2. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
  3. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
  4. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  5. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  6. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  7. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +1 -1
  8. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  9. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +1 -1
  10. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  11. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs +1 -1
  12. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  13. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  14. package/dist/esm/components/IDE/CodeBlockShiki.mjs +1 -1
  15. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  16. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  17. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  18. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  19. package/dist/esm/components/MaxHeightSmoother/index.mjs +1 -1
  20. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  21. package/dist/esm/components/Modal/Modal.mjs +1 -1
  22. package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
  23. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  24. package/dist/esm/components/RightDrawer/RightDrawer.mjs +1 -1
  25. package/dist/esm/hooks/index.mjs +1 -1
  26. package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
  27. package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
  28. package/dist/types/components/Badge/index.d.ts +3 -3
  29. package/dist/types/components/Button/Button.d.ts +4 -4
  30. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +3 -3
  31. package/dist/types/components/Command/index.d.ts +1 -1
  32. package/dist/types/components/Container/index.d.ts +4 -4
  33. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  34. package/dist/types/components/Input/Checkbox.d.ts +3 -3
  35. package/dist/types/components/Input/Input.d.ts +2 -2
  36. package/dist/types/components/Input/OTPInput.d.ts +1 -1
  37. package/dist/types/components/Link/Link.d.ts +3 -3
  38. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +0 -12
  39. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  40. package/dist/types/components/Pagination/Pagination.d.ts +2 -2
  41. package/dist/types/components/SwitchSelector/index.d.ts +2 -2
  42. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  43. package/dist/types/components/Tag/index.d.ts +3 -3
  44. package/dist/types/components/Toaster/Toast.d.ts +1 -1
  45. package/package.json +25 -25
@@ -1,2 +1,2 @@
1
- "use client";import{Button as e,ButtonColor as t,ButtonSize as n,ButtonVariant as r}from"../Button/Button.mjs";import{AutoCompleteTextarea as i}from"../TextArea/AutocompleteTextArea.mjs";import{useUser as a}from"../../hooks/useUser/index.mjs";import{useEffect as o,useState as s}from"react";import{Check as c,X as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=({children:p,onContentChange:m,disabled:h,validate:g,additionalButtons:_,...v})=>{let{isAuthenticated:y}=a(),[b,x]=s(p),[S,C]=s(0),w=b!==p,T=()=>{x(p),C(e=>e+1)},E=()=>{m(b)},D=e=>x(e.currentTarget.value??``),O=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!h&&k?(e.preventDefault(),E()):e.key===`Escape`&&(e.preventDefault(),T())};o(()=>{x(p),C(e=>e+1)},[p]);let k=g?.(b)??!0;return f(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[d(i,{onChange:D,onKeyDown:O,variant:`invisible`,className:`size-full`,value:p,isActive:y,disabled:h,"aria-label":`Editable textarea content`,"aria-describedby":w||_?`content-editor-textarea-actions`:void 0,"aria-invalid":!k,...v},S),(w||_)&&f(`div`,{id:`content-editor-textarea-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[w&&f(u,{children:[d(e,{Icon:c,label:`Save changes${k?``:` (invalid content)`}`,variant:r.HOVERABLE,color:t.TEXT,size:n.ICON_SM,className:`cursor-pointer hover:scale-110`,disabled:h||!k,onClick:E,"aria-describedby":k?void 0:`textarea-validation-error`}),d(e,{Icon:l,label:`Cancel changes`,variant:r.HOVERABLE,size:n.ICON_SM,color:t.TEXT,className:`cursor-pointer hover:scale-110`,onClick:T,disabled:h})]}),_]})]},p)};export{p as ContentEditorTextArea};
1
+ "use client";import{useUser as e}from"../../hooks/useUser/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{AutoCompleteTextarea as a}from"../TextArea/AutocompleteTextArea.mjs";import{useEffect as o,useState as s}from"react";import{Check as c,X as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=({children:p,onContentChange:m,disabled:h,validate:g,additionalButtons:_,...v})=>{let{isAuthenticated:y}=e(),[b,x]=s(p),[S,C]=s(0),w=b!==p,T=()=>{x(p),C(e=>e+1)},E=()=>{m(b)},D=e=>x(e.currentTarget.value??``),O=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!h&&k?(e.preventDefault(),E()):e.key===`Escape`&&(e.preventDefault(),T())};o(()=>{x(p),C(e=>e+1)},[p]);let k=g?.(b)??!0;return f(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[d(a,{onChange:D,onKeyDown:O,variant:`invisible`,className:`size-full`,value:p,isActive:y,disabled:h,"aria-label":`Editable textarea content`,"aria-describedby":w||_?`content-editor-textarea-actions`:void 0,"aria-invalid":!k,...v},S),(w||_)&&f(`div`,{id:`content-editor-textarea-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[w&&f(u,{children:[d(t,{Icon:c,label:`Save changes${k?``:` (invalid content)`}`,variant:i.HOVERABLE,color:n.TEXT,size:r.ICON_SM,className:`cursor-pointer hover:scale-110`,disabled:h||!k,onClick:E,"aria-describedby":k?void 0:`textarea-validation-error`}),d(t,{Icon:l,label:`Cancel changes`,variant:i.HOVERABLE,size:r.ICON_SM,color:n.TEXT,className:`cursor-pointer hover:scale-110`,onClick:T,disabled:h})]}),_]})]},p)};export{p as ContentEditorTextArea};
2
2
  //# sourceMappingURL=ContentEditorTextArea.mjs.map
@@ -1,2 +1,2 @@
1
- import{ItemLayout as e}from"../ItemLayout.mjs";import{NodeWrapper as t,traceKeys as n}from"./index.mjs";import{memo as r,useMemo as i}from"react";import{jsx as a}from"react/jsx-runtime";import{camelCaseToSentence as o}from"@intlayer/config/client";import{NodeType as s}from"@intlayer/types/nodeType";import{isSameKeyPath as c}from"@intlayer/core/utils";const l=r(r=>{let{keyPath:l,section:u,focusedKeyPath:d=[],onFocusKeyPath:f}=r;return i(()=>Object.keys(u??{}).filter(e=>!n.includes(e)),[u]).map(n=>{let i={key:n,type:s.Object},p=[...l,i],m=c(p,d);return a(e,{level:l.length,title:o(n),description:``,isSelected:m,onClick:e=>{e.stopPropagation(),f(m?[]:p)},children:a(t,{...r,keyPath:p,section:u[n]})},n)})});export{l as NestedObjectWrapper};
1
+ import{ItemLayout as e}from"../ItemLayout.mjs";import{NodeWrapper as t,traceKeys as n}from"./index.mjs";import{camelCaseToSentence as r}from"@intlayer/config/client";import{memo as i,useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";import{NodeType as s}from"@intlayer/types/nodeType";import{isSameKeyPath as c}from"@intlayer/core/utils";const l=i(i=>{let{keyPath:l,section:u,focusedKeyPath:d=[],onFocusKeyPath:f}=i;return a(()=>Object.keys(u??{}).filter(e=>!n.includes(e)),[u]).map(n=>{let a={key:n,type:s.Object},p=[...l,a],m=c(p,d);return o(e,{level:l.length,title:r(n),description:``,isSelected:m,onClick:e=>{e.stopPropagation(),f(m?[]:p)},children:o(t,{...i,keyPath:p,section:u[n]})},n)})});export{l as NestedObjectWrapper};
2
2
  //# sourceMappingURL=NestedObjectWrapper.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{renameKey as e}from"../../../utils/object.mjs";import{Container as t}from"../../Container/index.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonTextAlign as a,ButtonVariant as o}from"../../Button/Button.mjs";import{InputVariant as s}from"../../Input/Input.mjs";import{useAuditContentDeclarationField as c}from"../../../hooks/reactQuery.mjs";import{SwitchSelector as l,SwitchSelectorColor as u,SwitchSelectorSize as d}from"../../SwitchSelector/index.mjs";import{useLocaleSwitcherContent as f}from"../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{ContentEditorInput as p}from"../../ContentEditor/ContentEditorInput.mjs";import{ContentEditorTextArea as m}from"../../ContentEditor/ContentEditorTextArea.mjs";import{Label as h}from"../../Label/index.mjs";import{MarkdownRenderer as g}from"../../MarkDownRender/MarkDownRender.mjs";import{EnumKeyInput as _}from"../EnumKeyInput.mjs";import{Fragment as v,useState as y}from"react";import{Plus as b,Trash as x,WandSparkles as S}from"lucide-react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import{useIntlayer as E,useLocale as D}from"react-intlayer";import{getLocaleName as O}from"@intlayer/core/localization";import{useConfiguration as k,useEditedContent as A}from"@intlayer/editor-react";import{getEmptyNode as j,getNodeType as M}from"@intlayer/core/dictionaryManipulator";import{NodeType as N}from"@intlayer/types/nodeType";const P=[`filePath`,`id`,`nodeType`],F=({keyPath:e,dictionary:t,...a})=>{let{editedContent:l,addEditedContent:u}=A(),d=k(),{mutate:f,isPending:p}=c();return w(m,{variant:s.DEFAULT,onContentChange:n=>u(t.localId,n,e),additionalButtons:w(n,{Icon:S,label:`Audit`,variant:o.HOVERABLE,size:i.ICON_SM,color:r.TEXT,className:`cursor-pointer hover:scale-110`,isLoading:p,onClick:()=>{f({fileContent:JSON.stringify({...t,...l?.[t.localId]??{}}),keyPath:e,locales:d.internationalization.locales??[],aiOptions:{apiKey:d.ai?.apiKey,model:d.ai?.model,temperature:d.ai?.temperature}},{onSuccess:n=>{if(n?.data)try{let r=n.data.fileContent;u(t.localId,r,e)}catch(e){console.error(e)}}})}}),...a})},I=({keyPath:e,dictionary:t,...n})=>{let{addEditedContent:r}=A();return w(p,{variant:s.DEFAULT,onContentChange:n=>r(t.localId,n,e),...n})},L=[{content:`False`,value:!1},{content:`True`,value:!0}],R=({dictionary:e,keyPath:t,...n})=>{let{addEditedContent:r}=A();return w(l,{choices:L,value:!0,onChange:n=>r(e.localId,n,t),color:u.TEXT,size:d.SM,...n})},z=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{locale:i,defaultLocale:a}=D(),{selectedLocales:o,availableLocales:s}=f(),c=e[N.Translation],l=Object.keys(c),u=s.length>o.length?o:[...new Set([...s,...l])],d=e[N.Translation];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:u.map(e=>{let o=`${JSON.stringify(t)}-translation-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:O(e,i)})}),w(`tr`,{className:`flex`,children:w(`td`,{className:`flex w-full`,children:w($,{section:d[e]??j(d[a]),keyPath:[...t,{type:N.Translation,key:e}],dictionary:n,renderSection:r})})})]},o)})})})},B=({section:t,keyPath:i,dictionary:s,renderSection:c})=>{let{addEditedContent:l}=A(),{addNewEnumeration:u,removeEnumeration:d}=E(`navigation-view`),f=t[N.Enumeration],p=Object.keys(f)[0];return T(`div`,{className:`flex flex-col gap-2`,children:[w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(t[N.Enumeration]).map(r=>{let a=[...i,{type:N.Enumeration,key:r}],o=`${JSON.stringify(i)}-enumeration-${r}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full`,children:w(`td`,{className:`flex w-full`,children:w(`div`,{className:`flex flex-1`,children:w(n,{label:d.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:x,onClick:()=>l(s.localId,void 0,a),children:d.text})})})}),w(`tr`,{className:`w-full p-2`,children:w(`td`,{className:`flex w-full`,children:w(_,{value:r,onChange:n=>{let a=t[N.Enumeration],o=e(a,r,n),c={...t,[N.Enumeration]:o};console.log(`newValue`,c),l(s.localId,c,i)}})})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w(Q,{section:f[r]??j(f[p]),keyPath:a,dictionary:s,renderSection:c})})})]},o)})})}),w(n,{label:u.label.value,variant:o.HOVERABLE,color:r.NEUTRAL,textAlign:a.LEFT,isFullWidth:!0,onClick:()=>l(s.localId,j(f[p])??``,[...i,{type:N.Enumeration,key:`unknown`}]),Icon:b,className:`m-2`,children:u.text})]})},V=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[N.Condition];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`true`,`false`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-condition-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(e)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:i[e]??j(i.true),keyPath:[...t,{type:N.Condition,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},H=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[N.Gender];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`male`,`female`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-gender-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(e)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:i[e]??j(i.male),keyPath:[...t,{type:N.Gender,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},U=({section:e,keyPath:t,dictionary:i,renderSection:s})=>{let{addEditedContent:c}=A(),{addNewElement:l,removeElement:u}=E(`navigation-view`);return T(`div`,{className:`flex flex-col gap-2`,children:[w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:e.map((r,a)=>{let o=`${JSON.stringify(t)}-array-${a}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full p-2`,children:w(`td`,{className:`flex w-full`,children:T(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[w(`span`,{className:`text-xs`,children:String(a)}),w(n,{label:u.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,onClick:()=>{let e=[...t,{type:N.Array,key:a}];c(i.localId,void 0,e)},Icon:x,children:u.text})]})})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:r??j(e[0]),keyPath:[...t,{type:N.Array,key:a}],dictionary:i,renderSection:s})})})]},o)})})}),w(n,{label:l.label.value,variant:o.HOVERABLE,color:r.NEUTRAL,textAlign:a.LEFT,isFullWidth:!0,onClick:()=>{let n=[...t,{type:N.Array,key:e.length}];c(i.localId,j(e[0])??``,n,!1)},Icon:b,children:l.text})]})},W=({section:e,keyPath:t,dictionary:n,renderSection:r})=>w(C,{children:w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(e).map(i=>{let a=[...t,{type:N.Object,key:i}],o=e,s=Object.keys(o)[0],c=o[i]??j(o[s]),l=`${JSON.stringify(t)}-object-${i}`;return T(v,{children:[w(`tr`,{className:`mt-2 p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(i)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w(Q,{section:c,keyPath:a,dictionary:n,renderSection:r})})})]},l)})})})});var G=function(e){return e[e.Edit=0]=`Edit`,e[e.Preview=1]=`Preview`,e}(G||{}),K=function(e){return e[e.Edit=0]=`Edit`,e[e.Preview=1]=`Preview`,e}(K||{});const q=({section:e,keyPath:t,dictionary:n})=>{let[r,i]=y(K.Edit),a=[{content:`Edit`,value:K.Edit},{content:`Preview`,value:K.Preview}],o=[...t,{type:N.HTML}],s=e[N.HTML];return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[w(l,{choices:a,value:r,onChange:i,color:u.TEXT,size:d.SM,className:`ml-auto`}),w($,{section:s,keyPath:o,dictionary:n,renderSection:r===K.Preview?e=>w(`div`,{dangerouslySetInnerHTML:{__html:e}}):void 0})]})},J=({section:e,keyPath:t,dictionary:n,isDarkMode:r})=>{let[i,a]=y(G.Edit),o=[{content:`Edit`,value:G.Edit},{content:`Preview`,value:G.Preview}],s=[...t,{type:N.Markdown}],c=e[N.Markdown];return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[w(l,{choices:o,value:i,onChange:a,color:u.TEXT,size:d.SM,className:`ml-auto`}),w($,{section:c,keyPath:s,dictionary:n,renderSection:i===G.Preview?e=>w(g,{isDarkMode:r,children:e}):void 0})]})},Y=({section:e,keyPath:t,...n})=>{let r=[...t,{type:N.Insertion}],i=e[N.Insertion];return w(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:w($,{section:i,keyPath:r,...n})})},X=({section:e,keyPath:t,...n})=>{let r=[...t,{type:N.File}],i=e[N.File],{content:a}=e;return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[T(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),w($,{section:a,keyPath:r,...n})]})},Z=({keyPath:e,dictionary:t,renderSection:n,section:r,...i})=>{let{addEditedContent:a}=A(),o=r[N.Nested],c=[...e,{type:N.Nested}];return T(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[w(h,{children:`Dictionary key`}),w(p,{"aria-label":`Edit field`,type:`text`,variant:s.DEFAULT,...i,onContentChange:e=>{a(t.localId,{...o,dictionaryKey:String(e)},c)},children:o.dictionaryKey??``}),w(h,{children:`Path (optional)`}),w(p,{"aria-label":`Edit field`,type:`text`,variant:s.DEFAULT,...i,onContentChange:e=>{a(t.localId,{...o,path:e===``?void 0:e},c)},children:o.path??``})]})},Q=({section:e,keyPath:t,dictionary:n,renderSection:r,isDarkMode:i})=>{let{tsxNotEditable:a}=E(`navigation-view`),o=M(e);return o===N.ReactNode?T(`div`,{className:`flex w-full flex-col gap-2`,children:[w(`span`,{children:`(React Node)`}),w(`span`,{className:`flex text-neutral text-xs`,children:a})]}):o===N.Nested?w(Z,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Translation?w(z,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Enumeration?w(B,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Condition?w(V,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Gender?w(H,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Insertion?w(Y,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Markdown?w(J,{dictionary:n,keyPath:t,section:e,isDarkMode:i}):o===N.HTML?w(q,{dictionary:n,keyPath:t,section:e}):o===N.File?w(X,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Array?w(U,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Object?w(W,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Number?w(`div`,{className:`w-full p-2`,children:w(I,{dictionary:n,keyPath:t,type:`number`,"aria-label":`Edit field`,children:e})}):o===N.Text?w(`div`,{className:`w-full p-2`,children:typeof r==`function`?r(e):w(F,{variant:s.DEFAULT,"aria-label":`Edit field`,keyPath:t,dictionary:n,children:e})}):o===N.Boolean?w(`div`,{className:`w-full p-2`,children:w(R,{dictionary:n,keyPath:t,value:e})}):T(`div`,{className:`w-full p-2`,children:[`Error. Format not supported.`,JSON.stringify(e,null,2),JSON.stringify(t,null,2),`NodeType : `,o]})},$=e=>w(t,{border:!0,background:`none`,className:`top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky`,roundedSize:`xl`,children:w(Q,{...e})});export{Q as TextEditor,$ as TextEditorContainer,P as traceKeys};
1
+ "use client";import{renameKey as e}from"../../../utils/object.mjs";import{useAuditContentDeclarationField as t}from"../../../hooks/reactQuery.mjs";import{Container as n}from"../../Container/index.mjs";import{Button as r,ButtonColor as i,ButtonSize as a,ButtonTextAlign as o,ButtonVariant as s}from"../../Button/Button.mjs";import{InputVariant as c}from"../../Input/Input.mjs";import{SwitchSelector as l,SwitchSelectorColor as u,SwitchSelectorSize as d}from"../../SwitchSelector/index.mjs";import{useLocaleSwitcherContent as f}from"../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{ContentEditorInput as p}from"../../ContentEditor/ContentEditorInput.mjs";import{ContentEditorTextArea as m}from"../../ContentEditor/ContentEditorTextArea.mjs";import{Label as h}from"../../Label/index.mjs";import{MarkdownRenderer as g}from"../../MarkDownRender/MarkDownRender.mjs";import{EnumKeyInput as _}from"../EnumKeyInput.mjs";import{Fragment as v,useState as y}from"react";import{Plus as b,Trash as x,WandSparkles as S}from"lucide-react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import{useConfiguration as E,useEditedContent as D}from"@intlayer/editor-react";import{useIntlayer as O,useLocale as k}from"react-intlayer";import{getLocaleName as A}from"@intlayer/core/localization";import{getEmptyNode as j,getNodeType as M}from"@intlayer/core/dictionaryManipulator";import{NodeType as N}from"@intlayer/types/nodeType";const P=[`filePath`,`id`,`nodeType`],F=({keyPath:e,dictionary:n,...o})=>{let{editedContent:l,addEditedContent:u}=D(),d=E(),{mutate:f,isPending:p}=t();return w(m,{variant:c.DEFAULT,onContentChange:t=>u(n.localId,t,e),additionalButtons:w(r,{Icon:S,label:`Audit`,variant:s.HOVERABLE,size:a.ICON_SM,color:i.TEXT,className:`cursor-pointer hover:scale-110`,isLoading:p,onClick:()=>{f({fileContent:JSON.stringify({...n,...l?.[n.localId]??{}}),keyPath:e,locales:d.internationalization.locales??[],aiOptions:{apiKey:d.ai?.apiKey,model:d.ai?.model,temperature:d.ai?.temperature}},{onSuccess:t=>{if(t?.data)try{let r=t.data.fileContent;u(n.localId,r,e)}catch(e){console.error(e)}}})}}),...o})},I=({keyPath:e,dictionary:t,...n})=>{let{addEditedContent:r}=D();return w(p,{variant:c.DEFAULT,onContentChange:n=>r(t.localId,n,e),...n})},L=[{content:`False`,value:!1},{content:`True`,value:!0}],R=({dictionary:e,keyPath:t,...n})=>{let{addEditedContent:r}=D();return w(l,{choices:L,value:!0,onChange:n=>r(e.localId,n,t),color:u.TEXT,size:d.SM,...n})},z=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{locale:i,defaultLocale:a}=k(),{selectedLocales:o,availableLocales:s}=f(),c=e[N.Translation],l=Object.keys(c),u=s.length>o.length?o:[...new Set([...s,...l])],d=e[N.Translation];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:u.map(e=>{let o=`${JSON.stringify(t)}-translation-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:A(e,i)})}),w(`tr`,{className:`flex`,children:w(`td`,{className:`flex w-full`,children:w($,{section:d[e]??j(d[a]),keyPath:[...t,{type:N.Translation,key:e}],dictionary:n,renderSection:r})})})]},o)})})})},B=({section:t,keyPath:n,dictionary:a,renderSection:c})=>{let{addEditedContent:l}=D(),{addNewEnumeration:u,removeEnumeration:d}=O(`navigation-view`),f=t[N.Enumeration],p=Object.keys(f)[0];return T(`div`,{className:`flex flex-col gap-2`,children:[w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(t[N.Enumeration]).map(i=>{let o=[...n,{type:N.Enumeration,key:i}],s=`${JSON.stringify(n)}-enumeration-${i}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full`,children:w(`td`,{className:`flex w-full`,children:w(`div`,{className:`flex flex-1`,children:w(r,{label:d.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:x,onClick:()=>l(a.localId,void 0,o),children:d.text})})})}),w(`tr`,{className:`w-full p-2`,children:w(`td`,{className:`flex w-full`,children:w(_,{value:i,onChange:r=>{let o=t[N.Enumeration],s=e(o,i,r),c={...t,[N.Enumeration]:s};console.log(`newValue`,c),l(a.localId,c,n)}})})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w(Q,{section:f[i]??j(f[p]),keyPath:o,dictionary:a,renderSection:c})})})]},s)})})}),w(r,{label:u.label.value,variant:s.HOVERABLE,color:i.NEUTRAL,textAlign:o.LEFT,isFullWidth:!0,onClick:()=>l(a.localId,j(f[p])??``,[...n,{type:N.Enumeration,key:`unknown`}]),Icon:b,className:`m-2`,children:u.text})]})},V=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[N.Condition];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`true`,`false`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-condition-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(e)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:i[e]??j(i.true),keyPath:[...t,{type:N.Condition,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},H=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[N.Gender];return w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`male`,`female`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-gender-${e}`;return T(v,{children:[w(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(e)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:i[e]??j(i.male),keyPath:[...t,{type:N.Gender,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},U=({section:e,keyPath:t,dictionary:n,renderSection:a})=>{let{addEditedContent:c}=D(),{addNewElement:l,removeElement:u}=O(`navigation-view`);return T(`div`,{className:`flex flex-col gap-2`,children:[w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex w-full flex-col gap-2`,children:e.map((i,o)=>{let s=`${JSON.stringify(t)}-array-${o}`;return T(v,{children:[w(`tr`,{className:`mt-2 w-full p-2`,children:w(`td`,{className:`flex w-full`,children:T(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[w(`span`,{className:`text-xs`,children:String(o)}),w(r,{label:u.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,onClick:()=>{let e=[...t,{type:N.Array,key:o}];c(n.localId,void 0,e)},Icon:x,children:u.text})]})})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w($,{section:i??j(e[0]),keyPath:[...t,{type:N.Array,key:o}],dictionary:n,renderSection:a})})})]},s)})})}),w(r,{label:l.label.value,variant:s.HOVERABLE,color:i.NEUTRAL,textAlign:o.LEFT,isFullWidth:!0,onClick:()=>{let r=[...t,{type:N.Array,key:e.length}];c(n.localId,j(e[0])??``,r,!1)},Icon:b,children:l.text})]})},W=({section:e,keyPath:t,dictionary:n,renderSection:r})=>w(C,{children:w(`table`,{className:`w-full`,children:w(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(e).map(i=>{let a=[...t,{type:N.Object,key:i}],o=e,s=Object.keys(o)[0],c=o[i]??j(o[s]),l=`${JSON.stringify(t)}-object-${i}`;return T(v,{children:[w(`tr`,{className:`mt-2 p-2 text-xs`,children:w(`td`,{className:`flex w-full`,children:String(i)})}),w(`tr`,{className:`block w-full`,children:w(`td`,{className:`flex w-full`,children:w(Q,{section:c,keyPath:a,dictionary:n,renderSection:r})})})]},l)})})})});var G=function(e){return e[e.Edit=0]=`Edit`,e[e.Preview=1]=`Preview`,e}(G||{}),K=function(e){return e[e.Edit=0]=`Edit`,e[e.Preview=1]=`Preview`,e}(K||{});const q=({section:e,keyPath:t,dictionary:n})=>{let[r,i]=y(K.Edit),a=[{content:`Edit`,value:K.Edit},{content:`Preview`,value:K.Preview}],o=[...t,{type:N.HTML}],s=e[N.HTML];return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[w(l,{choices:a,value:r,onChange:i,color:u.TEXT,size:d.SM,className:`ml-auto`}),w($,{section:s,keyPath:o,dictionary:n,renderSection:r===K.Preview?e=>w(`div`,{dangerouslySetInnerHTML:{__html:e}}):void 0})]})},J=({section:e,keyPath:t,dictionary:n,isDarkMode:r})=>{let[i,a]=y(G.Edit),o=[{content:`Edit`,value:G.Edit},{content:`Preview`,value:G.Preview}],s=[...t,{type:N.Markdown}],c=e[N.Markdown];return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[w(l,{choices:o,value:i,onChange:a,color:u.TEXT,size:d.SM,className:`ml-auto`}),w($,{section:c,keyPath:s,dictionary:n,renderSection:i===G.Preview?e=>w(g,{isDarkMode:r,children:e}):void 0})]})},Y=({section:e,keyPath:t,...n})=>{let r=[...t,{type:N.Insertion}],i=e[N.Insertion];return w(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:w($,{section:i,keyPath:r,...n})})},X=({section:e,keyPath:t,...n})=>{let r=[...t,{type:N.File}],i=e[N.File],{content:a}=e;return T(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[T(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),w($,{section:a,keyPath:r,...n})]})},Z=({keyPath:e,dictionary:t,renderSection:n,section:r,...i})=>{let{addEditedContent:a}=D(),o=r[N.Nested],s=[...e,{type:N.Nested}];return T(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[w(h,{children:`Dictionary key`}),w(p,{"aria-label":`Edit field`,type:`text`,variant:c.DEFAULT,...i,onContentChange:e=>{a(t.localId,{...o,dictionaryKey:String(e)},s)},children:o.dictionaryKey??``}),w(h,{children:`Path (optional)`}),w(p,{"aria-label":`Edit field`,type:`text`,variant:c.DEFAULT,...i,onContentChange:e=>{a(t.localId,{...o,path:e===``?void 0:e},s)},children:o.path??``})]})},Q=({section:e,keyPath:t,dictionary:n,renderSection:r,isDarkMode:i})=>{let{tsxNotEditable:a}=O(`navigation-view`),o=M(e);return o===N.ReactNode?T(`div`,{className:`flex w-full flex-col gap-2`,children:[w(`span`,{children:`(React Node)`}),w(`span`,{className:`flex text-neutral text-xs`,children:a})]}):o===N.Nested?w(Z,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Translation?w(z,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Enumeration?w(B,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Condition?w(V,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Gender?w(H,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Insertion?w(Y,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Markdown?w(J,{dictionary:n,keyPath:t,section:e,isDarkMode:i}):o===N.HTML?w(q,{dictionary:n,keyPath:t,section:e}):o===N.File?w(X,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Array?w(U,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Object?w(W,{dictionary:n,renderSection:r,keyPath:t,section:e}):o===N.Number?w(`div`,{className:`w-full p-2`,children:w(I,{dictionary:n,keyPath:t,type:`number`,"aria-label":`Edit field`,children:e})}):o===N.Text?w(`div`,{className:`w-full p-2`,children:typeof r==`function`?r(e):w(F,{variant:c.DEFAULT,"aria-label":`Edit field`,keyPath:t,dictionary:n,children:e})}):o===N.Boolean?w(`div`,{className:`w-full p-2`,children:w(R,{dictionary:n,keyPath:t,value:e})}):T(`div`,{className:`w-full p-2`,children:[`Error. Format not supported.`,JSON.stringify(e,null,2),JSON.stringify(t,null,2),`NodeType : `,o]})},$=e=>w(n,{border:!0,background:`none`,className:`top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky`,roundedSize:`xl`,children:w(Q,{...e})});export{Q as TextEditor,$ as TextEditorContainer,P as traceKeys};
2
2
  //# sourceMappingURL=TextEditor.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{ButtonColor as e}from"../../Button/Button.mjs";import{useSession as t}from"../../../hooks/useAuth/useSession.mjs";import{useAddDictionary as n,useGetProjects as r}from"../../../hooks/reactQuery.mjs";import{MultiSelect as i}from"../../Select/Multiselect.mjs";import{useForm as a}from"../../Form/FormBase.mjs";import{Form as o}from"../../Form/Form.mjs";import{useDictionarySchema as s}from"./useDictionaryFormSchema.mjs";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useIntlayer as u}from"react-intlayer";const d=({onDictionaryCreated:d})=>{let{session:f}=t(),{project:p}=f??{},{mutate:m,isPending:h}=n(),{data:g}=r(),_=s(String(p?.id)),{form:v,isSubmitting:y}=a(_),{keyInput:b,createDictionaryButton:x,projectInput:S}=u(`dictionary-form`);return l(o,{schema:_,onSubmitSuccess:e=>{m({dictionary:e},{onSuccess:()=>{d?.()}})},className:`m-auto w-full max-w-[400px]`,...v,children:[c(o.Input,{name:`key`,label:b.label.value,placeholder:b.placeholder.value,isRequired:!0}),l(o.MultiSelect,{name:`projectIds`,label:S.label.value,children:[c(i.Trigger,{getBadgeValue:e=>g?.data?.find(t=>String(t.id)===e)?.name??e,children:c(i.Input,{placeholder:S.placeholder.value})}),c(i.Content,{children:c(i.List,{children:g?.data?.map(e=>c(i.Item,{value:String(e.id),children:e.name},String(e.id)))})})]}),c(o.Button,{className:`mt-12 ml-auto`,type:`submit`,color:e.TEXT,isLoading:y||h,label:x.ariaLabel.value,isFullWidth:!0,children:x.text})]})};export{d as DictionaryCreationForm};
1
+ "use client";import{useSession as e}from"../../../hooks/useAuth/useSession.mjs";import{useAddDictionary as t,useGetProjects as n}from"../../../hooks/reactQuery.mjs";import{ButtonColor as r}from"../../Button/Button.mjs";import{MultiSelect as i}from"../../Select/Multiselect.mjs";import{useForm as a}from"../../Form/FormBase.mjs";import{Form as o}from"../../Form/Form.mjs";import{useDictionarySchema as s}from"./useDictionaryFormSchema.mjs";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useIntlayer as u}from"react-intlayer";const d=({onDictionaryCreated:d})=>{let{session:f}=e(),{project:p}=f??{},{mutate:m,isPending:h}=t(),{data:g}=n(),_=s(String(p?.id)),{form:v,isSubmitting:y}=a(_),{keyInput:b,createDictionaryButton:x,projectInput:S}=u(`dictionary-form`);return l(o,{schema:_,onSubmitSuccess:e=>{m({dictionary:e},{onSuccess:()=>{d?.()}})},className:`m-auto w-full max-w-[400px]`,...v,children:[c(o.Input,{name:`key`,label:b.label.value,placeholder:b.placeholder.value,isRequired:!0}),l(o.MultiSelect,{name:`projectIds`,label:S.label.value,children:[c(i.Trigger,{getBadgeValue:e=>g?.data?.find(t=>String(t.id)===e)?.name??e,children:c(i.Input,{placeholder:S.placeholder.value})}),c(i.Content,{children:c(i.List,{children:g?.data?.map(e=>c(i.Item,{value:String(e.id),children:e.name},String(e.id)))})})]}),c(o.Button,{className:`mt-12 ml-auto`,type:`submit`,color:r.TEXT,isLoading:y||h,label:x.ariaLabel.value,isFullWidth:!0,children:x.text})]})};export{d as DictionaryCreationForm};
2
2
  //# sourceMappingURL=DictionaryCreationForm.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Loader as e}from"../../Loader/index.mjs";import{ButtonColor as t,ButtonSize as n,ButtonVariant as r}from"../../Button/Button.mjs";import{Checkbox as i}from"../../Input/Checkbox.mjs";import{useSession as a}from"../../../hooks/useAuth/useSession.mjs";import{useAuditContentDeclarationMetadata as o,useGetProjects as s,useGetTags as c}from"../../../hooks/reactQuery.mjs";import{MultiSelect as l}from"../../Select/Multiselect.mjs";import{Select as u}from"../../Select/Select.mjs";import{useForm as d}from"../../Form/FormBase.mjs";import{Form as f}from"../../Form/Form.mjs";import{useDictionaryDetailsSchema as p}from"./useDictionaryDetailsSchema.mjs";import{useEffect as m}from"react";import{WandSparkles as h}from"lucide-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useIntlayer as v}from"react-intlayer";import{useEditedContent as y}from"@intlayer/editor-react";import{AnimatePresence as b,motion as x}from"framer-motion";import{useWatch as S}from"react-hook-form";const C=({dictionary:C,mode:w})=>{let{session:T}=a(),{project:E}=T??{},{data:D,isLoading:O}=s(),{data:k}=c(),A=D?.data??[],j=k?.data??[],M=p(String(E?.id)),{form:N,isSubmitting:P}=d(M,{defaultValues:{...C,location:C.location??`remote`}}),{editedContent:F,setEditedDictionary:I}=y(),{titleInput:L,keyInput:R,descriptionInput:z,projectInput:B,tagsSelect:V,locationSelect:H,importModeSelect:U,filePathInput:W,auditButton:G}=v(`dictionary-details`),{mutate:K,isPending:q}=o(),J=F?.[C.localId];m(()=>{N.reset({...C,location:C.location??`remote`})},[C,N?.reset]),m(()=>{J===void 0&&N.reset({...C,location:C.location??`remote`})},[J]);let Y=()=>{let e={...C,...J};K({fileContent:JSON.stringify(e)},{onSuccess:t=>{if(t?.data)try{let n=t.data.fileContent;I(t=>({...t,...e,...n})),N.reset({...e,...n})}catch(e){console.error(e)}}})},X=S({control:N.control,name:`location`}),Z=X===`local`||X===`hybrid`;return _(f,{className:`flex w-full flex-col gap-8`,...N,schema:M,children:[_(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[g(f.EditableFieldInput,{name:`key`,label:R.label,placeholder:R.label.value,description:R.description,disabled:P,isRequired:!0,onSave:e=>{N.setValue(`key`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},key:e}))}}),g(f.EditableFieldInput,{name:`title`,label:L.label,placeholder:L.placeholder.value,description:L.description,disabled:P,onSave:e=>{N.setValue(`title`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},title:e}))}})]}),g(f.EditableFieldTextArea,{name:`description`,label:z.label,placeholder:z.placeholder.value,description:z.description,disabled:P,onSave:e=>{N.setValue(`description`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},description:e}))}}),_(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[g(f.Field,{control:N.control,name:`location`,render:({field:e})=>{let t=e.value,n=t===`local`||t===`hybrid`,r=t===`remote`||t===`hybrid`,a=t=>{if(!t&&!r)return;let n=t?r?`hybrid`:`local`:`remote`;e.onChange(n);let i=t?N.getValues(`filePath`)??C.filePath:void 0;t||N.setValue(`filePath`,void 0),I(e=>({...C,...e??{},location:n,filePath:i}))},o=t=>{if(!t&&!n)return;let r=t?n?`hybrid`:`remote`:`local`;e.onChange(r),I(e=>({...C,...e??{},location:r}))};return _(f.Item,{className:`flex flex-col gap-2 px-1`,children:[g(f.Label,{className:`ml-1`,children:H.label}),_(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[g(i,{id:`location-local`,name:`location-local`,label:H.local.value,checked:n,disabled:!w.includes(`local`)&&!w.includes(`remote`),onChange:e=>a(e.target.checked)}),g(i,{id:`location-remote`,name:`location-remote`,label:H.remote.value,checked:r,disabled:!w.includes(`remote`)&&C.location!==`remote`&&C.location!==`hybrid`,onChange:e=>o(e.target.checked)})]}),g(f.Description,{children:H.testDescription}),g(f.Message,{})]})}}),g(b,{mode:`wait`,children:Z&&g(x.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},className:`overflow-hidden`,children:g(f.Input,{name:`filePath`,label:W.label.value,placeholder:W.placeholder.value,description:W.description.value,disabled:P||!Z,onChange:e=>{let t=e.target.value;I(e=>({...C,...e??{},filePath:t}))}})},`filePath-input`)})]}),g(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:_(f.Select,{name:`importMode`,label:U.label.value,description:U.description.value,onValueChange:e=>{N.setValue(`importMode`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},importMode:e}))},children:[g(u.Trigger,{children:g(u.Value,{placeholder:U.label.value})}),_(u.Content,{children:[g(u.Item,{value:`static`,children:U.static.value}),g(u.Item,{value:`dynamic`,children:U.dynamic.value}),g(u.Item,{value:`live`,children:U.live.value})]})]})}),_(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[_(f.MultiSelect,{name:`projectIds`,label:B.label.value,description:B.description,onValueChange:e=>{let t=[e].flat();N.setValue(`projectIds`,t,{shouldDirty:!0}),I(e=>({...C,...e??{},projectIds:t}))},children:[g(l.Trigger,{getBadgeValue:e=>A?.find(t=>String(t.id)===e)?.name??e,children:g(l.Input,{placeholder:B.placeholder.value})}),g(l.Content,{children:g(e,{isLoading:O,children:g(l.List,{children:A?.map(e=>g(l.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),_(f.MultiSelect,{name:`tags`,label:V.label.value,description:V.description,onValueChange:e=>{let t=[e].flat();N.setValue(`tags`,t,{shouldDirty:!0}),I(e=>({...C,...e??{},tags:t}))},children:[g(l.Trigger,{getBadgeValue:e=>j?.find(t=>String(t.key)===e)?.name??e,children:g(l.Input,{placeholder:V.placeholder.value})}),g(l.Content,{children:g(e,{isLoading:O,children:g(l.List,{children:j?.map(e=>g(l.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),g(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:g(f.Button,{type:`button`,size:n.ICON_MD,label:G.label.value,Icon:h,variant:r.OUTLINE,color:t.TEXT,className:`max-md:w-full`,onClick:Y,disabled:P||q,isLoading:q})})]})};export{C as DictionaryDetailsForm};
1
+ "use client";import{useSession as e}from"../../../hooks/useAuth/useSession.mjs";import{useAuditContentDeclarationMetadata as t,useGetProjects as n,useGetTags as r}from"../../../hooks/reactQuery.mjs";import{Loader as i}from"../../Loader/index.mjs";import{ButtonColor as a,ButtonSize as o,ButtonVariant as s}from"../../Button/Button.mjs";import{Checkbox as c}from"../../Input/Checkbox.mjs";import{MultiSelect as l}from"../../Select/Multiselect.mjs";import{Select as u}from"../../Select/Select.mjs";import{useForm as d}from"../../Form/FormBase.mjs";import{Form as f}from"../../Form/Form.mjs";import{useDictionaryDetailsSchema as p}from"./useDictionaryDetailsSchema.mjs";import{useEffect as m}from"react";import{WandSparkles as h}from"lucide-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useEditedContent as v}from"@intlayer/editor-react";import{useIntlayer as y}from"react-intlayer";import{AnimatePresence as b,motion as x}from"framer-motion";import{useWatch as S}from"react-hook-form";const C=({dictionary:C,mode:w})=>{let{session:T}=e(),{project:E}=T??{},{data:D,isLoading:O}=n(),{data:k}=r(),A=D?.data??[],j=k?.data??[],M=p(String(E?.id)),{form:N,isSubmitting:P}=d(M,{defaultValues:{...C,location:C.location??`remote`}}),{editedContent:F,setEditedDictionary:I}=v(),{titleInput:L,keyInput:R,descriptionInput:z,projectInput:B,tagsSelect:V,locationSelect:H,importModeSelect:U,filePathInput:W,auditButton:G}=y(`dictionary-details`),{mutate:K,isPending:q}=t(),J=F?.[C.localId];m(()=>{N.reset({...C,location:C.location??`remote`})},[C,N?.reset]),m(()=>{J===void 0&&N.reset({...C,location:C.location??`remote`})},[J]);let Y=()=>{let e={...C,...J};K({fileContent:JSON.stringify(e)},{onSuccess:t=>{if(t?.data)try{let n=t.data.fileContent;I(t=>({...t,...e,...n})),N.reset({...e,...n})}catch(e){console.error(e)}}})},X=S({control:N.control,name:`location`}),Z=X===`local`||X===`hybrid`;return _(f,{className:`flex w-full flex-col gap-8`,...N,schema:M,children:[_(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[g(f.EditableFieldInput,{name:`key`,label:R.label,placeholder:R.label.value,description:R.description,disabled:P,isRequired:!0,onSave:e=>{N.setValue(`key`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},key:e}))}}),g(f.EditableFieldInput,{name:`title`,label:L.label,placeholder:L.placeholder.value,description:L.description,disabled:P,onSave:e=>{N.setValue(`title`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},title:e}))}})]}),g(f.EditableFieldTextArea,{name:`description`,label:z.label,placeholder:z.placeholder.value,description:z.description,disabled:P,onSave:e=>{N.setValue(`description`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},description:e}))}}),_(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[g(f.Field,{control:N.control,name:`location`,render:({field:e})=>{let t=e.value,n=t===`local`||t===`hybrid`,r=t===`remote`||t===`hybrid`,i=t=>{if(!t&&!r)return;let n=t?r?`hybrid`:`local`:`remote`;e.onChange(n);let i=t?N.getValues(`filePath`)??C.filePath:void 0;t||N.setValue(`filePath`,void 0),I(e=>({...C,...e??{},location:n,filePath:i}))},a=t=>{if(!t&&!n)return;let r=t?n?`hybrid`:`remote`:`local`;e.onChange(r),I(e=>({...C,...e??{},location:r}))};return _(f.Item,{className:`flex flex-col gap-2 px-1`,children:[g(f.Label,{className:`ml-1`,children:H.label}),_(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[g(c,{id:`location-local`,name:`location-local`,label:H.local.value,checked:n,disabled:!w.includes(`local`)&&!w.includes(`remote`),onChange:e=>i(e.target.checked)}),g(c,{id:`location-remote`,name:`location-remote`,label:H.remote.value,checked:r,disabled:!w.includes(`remote`)&&C.location!==`remote`&&C.location!==`hybrid`,onChange:e=>a(e.target.checked)})]}),g(f.Description,{children:H.testDescription}),g(f.Message,{})]})}}),g(b,{mode:`wait`,children:Z&&g(x.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},className:`overflow-hidden`,children:g(f.Input,{name:`filePath`,label:W.label.value,placeholder:W.placeholder.value,description:W.description.value,disabled:P||!Z,onChange:e=>{let t=e.target.value;I(e=>({...C,...e??{},filePath:t}))}})},`filePath-input`)})]}),g(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:_(f.Select,{name:`importMode`,label:U.label.value,description:U.description.value,onValueChange:e=>{N.setValue(`importMode`,e,{shouldDirty:!0}),I(t=>({...C,...t??{},importMode:e}))},children:[g(u.Trigger,{children:g(u.Value,{placeholder:U.label.value})}),_(u.Content,{children:[g(u.Item,{value:`static`,children:U.static.value}),g(u.Item,{value:`dynamic`,children:U.dynamic.value}),g(u.Item,{value:`live`,children:U.live.value})]})]})}),_(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[_(f.MultiSelect,{name:`projectIds`,label:B.label.value,description:B.description,onValueChange:e=>{let t=[e].flat();N.setValue(`projectIds`,t,{shouldDirty:!0}),I(e=>({...C,...e??{},projectIds:t}))},children:[g(l.Trigger,{getBadgeValue:e=>A?.find(t=>String(t.id)===e)?.name??e,children:g(l.Input,{placeholder:B.placeholder.value})}),g(l.Content,{children:g(i,{isLoading:O,children:g(l.List,{children:A?.map(e=>g(l.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),_(f.MultiSelect,{name:`tags`,label:V.label.value,description:V.description,onValueChange:e=>{let t=[e].flat();N.setValue(`tags`,t,{shouldDirty:!0}),I(e=>({...C,...e??{},tags:t}))},children:[g(l.Trigger,{getBadgeValue:e=>j?.find(t=>String(t.key)===e)?.name??e,children:g(l.Input,{placeholder:V.placeholder.value})}),g(l.Content,{children:g(i,{isLoading:O,children:g(l.List,{children:j?.map(e=>g(l.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),g(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:g(f.Button,{type:`button`,size:o.ICON_MD,label:G.label.value,Icon:h,variant:s.OUTLINE,color:a.TEXT,className:`max-md:w-full`,onClick:Y,disabled:P||q,isLoading:q})})]})};export{C as DictionaryDetailsForm};
2
2
  //# sourceMappingURL=DictionaryDetailsForm.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Button as e,ButtonColor as t,ButtonVariant as n}from"../Button/Button.mjs";import{CopyToClipboard as r}from"../CopyToClipboard/index.mjs";import{LocaleSwitcherContentProvider as i}from"../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{Tab as a}from"../Tab/Tab.mjs";import{ContentEditor as o}from"./ContentEditor.mjs";import{DictionaryDetailsForm as s}from"./DictionaryDetails/DictionaryDetailsForm.mjs";import{JSONEditor as c}from"./JSONEditor.mjs";import{SaveForm as l}from"./SaveForm/SaveForm.mjs";import{StructureEditor as u}from"./StructureEditor.mjs";import{useEffect as d}from"react";import{ArrowLeft as f}from"lucide-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useIntlayer as h}from"react-intlayer";import{useConfiguration as g,useDictionariesRecordActions as _,useFocusUnmergedDictionary as v}from"@intlayer/editor-react";const y=({dictionary:y,onClickDictionaryList:b,isDarkMode:x,mode:S,onDelete:C,onSave:w,showReturnButton:T=!0})=>{let E=g(),{returnToDictionaryList:D}=h(`dictionary-field-editor`),{setFocusedContent:O}=v(),{setLocaleDictionaries:k}=_();return d(()=>{O(e=>({...e??{},dictionaryKey:y.key,dictionaryLocalId:y.localId})),k(e=>({...e,[y.localId]:y}))},[]),p(i,{availableLocales:E?.internationalization.locales??[],children:m(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[T&&p(e,{onClick:b,variant:n.HOVERABLE,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:t.TEXT,Icon:f,label:D.label.value,children:D.text}),p(`div`,{className:`min-h-0 flex-1`,children:m(a,{defaultTab:`content`,variant:`ghost`,fullHeight:!0,headerClassName:`sticky top-0 z-10 rounded-xl bg-background/20 pb-4`,children:[S.includes(`remote`)&&p(a.Item,{label:`Details`,value:`details`,children:p(s,{dictionary:y,mode:S})}),p(a.Item,{label:`Structure`,value:`structure`,children:p(u,{dictionary:y})}),p(a.Item,{label:`Content`,value:`content`,children:p(o,{dictionary:y,isDarkMode:x})}),p(a.Item,{label:`JSON`,value:`json`,children:p(c,{dictionary:y,isDarkMode:x})})]})}),m(`div`,{className:`sticky bottom-16 z-20 flex shrink-0 flex-wrap items-center justify-end gap-10 border-card border-t p-4 md:bottom-0`,children:[p(r,{text:y.id,className:`text-nowrap text-neutral text-sm`,size:9,children:y.id}),p(l,{dictionary:y,mode:S,onDelete:()=>{O(null),C?.()},onSave:w})]})]})})};export{y as DictionaryFieldEditor};
1
+ "use client";import{Button as e,ButtonColor as t,ButtonVariant as n}from"../Button/Button.mjs";import{CopyToClipboard as r}from"../CopyToClipboard/index.mjs";import{LocaleSwitcherContentProvider as i}from"../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{Tab as a}from"../Tab/Tab.mjs";import{ContentEditor as o}from"./ContentEditor.mjs";import{DictionaryDetailsForm as s}from"./DictionaryDetails/DictionaryDetailsForm.mjs";import{JSONEditor as c}from"./JSONEditor.mjs";import{SaveForm as l}from"./SaveForm/SaveForm.mjs";import{StructureEditor as u}from"./StructureEditor.mjs";import{useEffect as d}from"react";import{ArrowLeft as f}from"lucide-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useConfiguration as h,useDictionariesRecordActions as g,useFocusUnmergedDictionary as _}from"@intlayer/editor-react";import{useIntlayer as v}from"react-intlayer";const y=({dictionary:y,onClickDictionaryList:b,isDarkMode:x,mode:S,onDelete:C,onSave:w,showReturnButton:T=!0})=>{let E=h(),{returnToDictionaryList:D}=v(`dictionary-field-editor`),{setFocusedContent:O}=_(),{setLocaleDictionaries:k}=g();return d(()=>{O(e=>({...e??{},dictionaryKey:y.key,dictionaryLocalId:y.localId})),k(e=>({...e,[y.localId]:y}))},[]),p(i,{availableLocales:E?.internationalization.locales??[],children:m(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[T&&p(e,{onClick:b,variant:n.HOVERABLE,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:t.TEXT,Icon:f,label:D.label.value,children:D.text}),p(`div`,{className:`min-h-0 flex-1`,children:m(a,{defaultTab:`content`,variant:`ghost`,fullHeight:!0,headerClassName:`sticky top-0 z-10 rounded-xl bg-background/20 pb-4`,children:[S.includes(`remote`)&&p(a.Item,{label:`Details`,value:`details`,children:p(s,{dictionary:y,mode:S})}),p(a.Item,{label:`Structure`,value:`structure`,children:p(u,{dictionary:y})}),p(a.Item,{label:`Content`,value:`content`,children:p(o,{dictionary:y,isDarkMode:x})}),p(a.Item,{label:`JSON`,value:`json`,children:p(c,{dictionary:y,isDarkMode:x})})]})}),m(`div`,{className:`sticky bottom-16 z-20 flex shrink-0 flex-wrap items-center justify-end gap-10 border-card border-t p-4 md:bottom-0`,children:[p(r,{text:y.id,className:`text-nowrap text-neutral text-sm`,size:9,children:y.id}),p(l,{dictionary:y,mode:S,onDelete:()=>{O(null),C?.()},onSave:w})]})]})})};export{y as DictionaryFieldEditor};
2
2
  //# sourceMappingURL=DictionaryFieldEditor.mjs.map
@@ -1,2 +1,2 @@
1
- import{Breadcrumb as e}from"../Breadcrumb/index.mjs";import{jsx as t}from"react/jsx-runtime";import{camelCaseToSentence as n}from"@intlayer/config/client";const r=({keyPath:r,dictionaryKey:i,onClickKeyPath:a,locale:o,color:s,showDictionaryKey:c=!0})=>t(e,{links:[...c?[{text:n(i),onClick:a?()=>a([]):void 0}]:[],...r.map((e,t)=>({onClick:a?()=>a?.(r.slice(0,t+1)):void 0,text:e.key?.toString()??``}))],locale:o,elementType:`location`,color:s});export{r as KeyPathBreadcrumb};
1
+ import{Breadcrumb as e}from"../Breadcrumb/index.mjs";import{camelCaseToSentence as t}from"@intlayer/config/client";import{jsx as n}from"react/jsx-runtime";const r=({keyPath:r,dictionaryKey:i,onClickKeyPath:a,locale:o,color:s,showDictionaryKey:c=!0})=>n(e,{links:[...c?[{text:t(i),onClick:a?()=>a([]):void 0}]:[],...r.map((e,t)=>({onClick:a?()=>a?.(r.slice(0,t+1)):void 0,text:e.key?.toString()??``}))],locale:o,elementType:`location`,color:s});export{r as KeyPathBreadcrumb};
2
2
  //# sourceMappingURL=KeyPathBreadcrumb.mjs.map
@@ -1,2 +1,2 @@
1
- import{Button as e,ButtonColor as t,ButtonTextAlign as n,ButtonVariant as r}from"../../Button/Button.mjs";import{Accordion as i}from"../../Accordion/Accordion.mjs";import{getIsEditableSection as a}from"../getIsEditableSection.mjs";import{ChevronRight as o,Plus as s}from"lucide-react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"@intlayer/config/built";import{camelCaseToSentence as f}from"@intlayer/config/client";import{useIntlayer as p}from"react-intlayer";import{useEditedContentActions as m,useEditorLocale as h,useFocusUnmergedDictionary as g}from"@intlayer/editor-react";import{getContentNodeByKeyPath as _,getEmptyNode as v,getNodeType as y}from"@intlayer/core/dictionaryManipulator";import{NodeType as b}from"@intlayer/types/nodeType";import{isSameKeyPath as x}from"@intlayer/core/utils";const S=[`filePath`,`id`,`nodeType`],C=({section:S,keyPath:w,dictionary:T})=>{let{locales:E}=d.internationalization,D=_(S,w,h()),{addEditedContent:O}=m(),{setFocusedContentKeyPath:k,focusedContent:A}=g(),{addNewElement:j,goToField:M}=p(`navigation-view`),N=y(D),P=e=>(A?.keyPath?.length??0)>0&&x(e,A?.keyPath??[]),F=a(D);return D?F?l(e,{label:M.label.value,variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(w),IconRight:o,children:f(w[w.length-1].key)}):typeof D==`object`?N===b.ReactNode?l(c,{children:`React Node`}):N===b.Translation?l(`div`,{className:`flex flex-col justify-between gap-2`,children:E.map(e=>l(C,{keyPath:[...w,{type:b.Translation,key:e}],section:S,dictionary:T},e))}):N===b.Enumeration||N===b.Condition?l(`div`,{className:`flex flex-col justify-between gap-2`,children:Object.keys(D[N]).map(e=>l(C,{keyPath:[...w,{type:N,key:e}],section:S,dictionary:T},e))}):N===b.Array?u(`div`,{className:`flex flex-col justify-between gap-2`,children:[D.map((n,s)=>{let c=[...w,{type:b.Array,key:s}];return a(n)?u(e,{label:`${M.label.value} ${s}`,variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(c),IconRight:o,isActive:P(c),children:[`Item `,s]},JSON.stringify(c)):l(i,{label:`${M.label.value} ${s}`,header:`Item ${s}`,isActive:P(c),onClick:()=>k(c),children:l(`div`,{className:`mt-2 flex w-full max-w-full`,children:l(`div`,{className:`flex-1 pl-10`,children:l(C,{keyPath:c,section:S,dictionary:T})})})},JSON.stringify(c))}),l(e,{label:j.label.value,variant:r.HOVERABLE,color:t.NEUTRAL,textAlign:n.LEFT,onClick:()=>{let e=[...w,{type:b.Array,key:D.length}],t=D,n=v(t[t.length-1])??``;O(T.localId,n,e,!1),k(e)},Icon:s,children:j.text})]}):typeof D.nodeType==`string`?l(C,{keyPath:[...w,{type:D.nodeType}],section:S,dictionary:T}):l(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:Object.keys(D).map(n=>{let s=[...w,{type:b.Object,key:n}];return a(_(S,s))?l(e,{label:`${M.label.value} ${n}`,isActive:P(s),variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(s),IconRight:o,children:f(n)},n):l(i,{label:`${M.label.value} ${n}`,isActive:P(s),onClick:()=>k(s),header:f(n),children:l(`div`,{className:`mt-2 flex w-full max-w-full`,children:l(`div`,{className:`flex-1 pl-10`,children:l(C,{keyPath:s,section:S,dictionary:T})})})},n)})}):u(c,{children:[`Error loading section --`,N,`--`,JSON.stringify(D),`--`,JSON.stringify(w)]}):l(c,{})};export{C as NavigationViewNode,S as traceKeys};
1
+ import{Button as e,ButtonColor as t,ButtonTextAlign as n,ButtonVariant as r}from"../../Button/Button.mjs";import{Accordion as i}from"../../Accordion/Accordion.mjs";import{getIsEditableSection as a}from"../getIsEditableSection.mjs";import o from"@intlayer/config/built";import{camelCaseToSentence as s}from"@intlayer/config/client";import{ChevronRight as c,Plus as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useEditedContentActions as p,useEditorLocale as m,useFocusUnmergedDictionary as h}from"@intlayer/editor-react";import{useIntlayer as g}from"react-intlayer";import{getContentNodeByKeyPath as _,getEmptyNode as v,getNodeType as y}from"@intlayer/core/dictionaryManipulator";import{NodeType as b}from"@intlayer/types/nodeType";import{isSameKeyPath as x}from"@intlayer/core/utils";const S=[`filePath`,`id`,`nodeType`],C=({section:S,keyPath:w,dictionary:T})=>{let{locales:E}=o.internationalization,D=_(S,w,m()),{addEditedContent:O}=p(),{setFocusedContentKeyPath:k,focusedContent:A}=h(),{addNewElement:j,goToField:M}=g(`navigation-view`),N=y(D),P=e=>(A?.keyPath?.length??0)>0&&x(e,A?.keyPath??[]),F=a(D);return D?F?d(e,{label:M.label.value,variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(w),IconRight:c,children:s(w[w.length-1].key)}):typeof D==`object`?N===b.ReactNode?d(u,{children:`React Node`}):N===b.Translation?d(`div`,{className:`flex flex-col justify-between gap-2`,children:E.map(e=>d(C,{keyPath:[...w,{type:b.Translation,key:e}],section:S,dictionary:T},e))}):N===b.Enumeration||N===b.Condition?d(`div`,{className:`flex flex-col justify-between gap-2`,children:Object.keys(D[N]).map(e=>d(C,{keyPath:[...w,{type:N,key:e}],section:S,dictionary:T},e))}):N===b.Array?f(`div`,{className:`flex flex-col justify-between gap-2`,children:[D.map((n,o)=>{let s=[...w,{type:b.Array,key:o}];return a(n)?f(e,{label:`${M.label.value} ${o}`,variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(s),IconRight:c,isActive:P(s),children:[`Item `,o]},JSON.stringify(s)):d(i,{label:`${M.label.value} ${o}`,header:`Item ${o}`,isActive:P(s),onClick:()=>k(s),children:d(`div`,{className:`mt-2 flex w-full max-w-full`,children:d(`div`,{className:`flex-1 pl-10`,children:d(C,{keyPath:s,section:S,dictionary:T})})})},JSON.stringify(s))}),d(e,{label:j.label.value,variant:r.HOVERABLE,color:t.NEUTRAL,textAlign:n.LEFT,onClick:()=>{let e=[...w,{type:b.Array,key:D.length}],t=D,n=v(t[t.length-1])??``;O(T.localId,n,e,!1),k(e)},Icon:l,children:j.text})]}):typeof D.nodeType==`string`?d(C,{keyPath:[...w,{type:D.nodeType}],section:S,dictionary:T}):d(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:Object.keys(D).map(n=>{let o=[...w,{type:b.Object,key:n}];return a(_(S,o))?d(e,{label:`${M.label.value} ${n}`,isActive:P(o),variant:r.HOVERABLE,color:t.TEXT,className:`w-full`,onClick:()=>k(o),IconRight:c,children:s(n)},n):d(i,{label:`${M.label.value} ${n}`,isActive:P(o),onClick:()=>k(o),header:s(n),children:d(`div`,{className:`mt-2 flex w-full max-w-full`,children:d(`div`,{className:`flex-1 pl-10`,children:d(C,{keyPath:o,section:S,dictionary:T})})})},n)})}):f(u,{children:[`Error loading section --`,N,`--`,JSON.stringify(D),`--`,JSON.stringify(w)]}):d(u,{})};export{C as NavigationViewNode,S as traceKeys};
2
2
  //# sourceMappingURL=NavigationViewNode.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../../utils/cn.mjs";import{ButtonColor as t,ButtonVariant as n}from"../../Button/Button.mjs";import{useAuth as r}from"../../../hooks/useAuth/useAuth.mjs";import{useDeleteDictionary as i,usePushDictionaries as a,useWriteDictionary as o}from"../../../hooks/reactQuery.mjs";import{Modal as s,ModalSize as c}from"../../Modal/Modal.mjs";import{Form as l}from"../../Form/Form.mjs";import{useState as u}from"react";import{ArrowUpFromLine as d,Download as f,RotateCcw as p,Save as m,Trash as h}from"lucide-react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{useIntlayer as y}from"react-intlayer";import{useDictionariesRecordActions as b,useEditedContent as x}from"@intlayer/editor-react";const S=({dictionary:S,mode:C,className:w,onDelete:T,onSave:E,...D})=>{let[O,k]=u(!1),{setLocaleDictionary:A}=b(),{mutate:j,isPending:M}=i(),{mutate:N,isPending:P}=o(),{mutate:F,isPending:I}=a(),L=P||I,{editedContent:R,restoreEditedContent:z}=x(),{deleteButton:B,resetButton:V,saveButton:H,publishButton:U,downloadButton:W,confirmation:G}=y(`save-dictionary-details`),{isAuthenticated:K}=r(),q=R?.[S.localId],J=q&&JSON.stringify(q)!==JSON.stringify(S),Y=S?.id!==void 0,X=async()=>{R?.[S.localId]&&N({dictionary:{...S,...R?.[S.localId]}},{onSuccess:()=>{A(R?.[S.localId]),z(S.localId),k(!1),E?.()}})},Z=()=>{let e={...S,...R?.[S.localId]};F({dictionaries:[e]},{onSuccess:t=>{t&&(A(e),z(S.localId),E?.())}})},Q=()=>{S.id&&j({dictionaryId:S.id},{onSuccess:e=>{e&&T?.()}})};return v(g,{children:[_(s,{isOpen:O,title:G.title.value,size:c.MD,onClose:()=>k(!1),padding:`md`,children:v(`form`,{className:`size-full`,children:[_(`p`,{className:`py-4 text-neutral text-sm`,children:G.message}),v(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[_(l.Button,{label:G.cancelButton.label.value,disabled:!J||L,color:t.TEXT,className:`max-md:w-full`,variant:n.OUTLINE,onClick:()=>k(!1),children:G.cancelButton.text}),_(l.Button,{label:G.confirmButton.label.value,disabled:!J||L,Icon:m,color:t.TEXT,className:`max-md:w-full`,isLoading:I,onClick:X,children:G.confirmButton.text})]})]})}),v(`form`,{className:e(`flex justify-end gap-2 max-md:flex-col`,w),...D,children:[C.includes(`remote`)&&Y&&T&&K&&_(l.Button,{label:B.label.value,Icon:h,color:t.ERROR,variant:n.OUTLINE,className:`max-md:w-full`,isLoading:M,onClick:Q,children:B.text}),J&&_(l.Button,{label:V.label.value,disabled:!J,Icon:p,variant:n.OUTLINE,color:t.TEXT,className:`max-md:w-full`,onClick:()=>z(S.localId),children:V.text}),C.includes(`local`)&&_(l.Button,{label:W.label.value,disabled:!J||L,Icon:f,color:t.TEXT,variant:K?n.OUTLINE:n.DEFAULT,className:`max-md:w-full`,isLoading:P,onClick:()=>k(!0),children:W.text}),C.includes(`remote`)&&K&&!Y&&_(l.Button,{label:U.label.value,disabled:L,Icon:d,color:t.TEXT,className:`max-md:w-full`,isLoading:I,onClick:Z,children:U.text}),C.includes(`remote`)&&K&&Y&&J&&_(l.Button,{label:H.label.value,disabled:!J||L,Icon:m,color:`text`,className:`max-md:w-full`,isLoading:I,onClick:Z,children:H.text})]})]})};export{S as SaveForm};
1
+ "use client";import{cn as e}from"../../../utils/cn.mjs";import{useAuth as t}from"../../../hooks/useAuth/useAuth.mjs";import{useDeleteDictionary as n,usePushDictionaries as r,useWriteDictionary as i}from"../../../hooks/reactQuery.mjs";import{ButtonColor as a,ButtonVariant as o}from"../../Button/Button.mjs";import{Modal as s,ModalSize as c}from"../../Modal/Modal.mjs";import{Form as l}from"../../Form/Form.mjs";import{useState as u}from"react";import{ArrowUpFromLine as d,Download as f,RotateCcw as p,Save as m,Trash as h}from"lucide-react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{useDictionariesRecordActions as y,useEditedContent as b}from"@intlayer/editor-react";import{useIntlayer as x}from"react-intlayer";const S=({dictionary:S,mode:C,className:w,onDelete:T,onSave:E,...D})=>{let[O,k]=u(!1),{setLocaleDictionary:A}=y(),{mutate:j,isPending:M}=n(),{mutate:N,isPending:P}=i(),{mutate:F,isPending:I}=r(),L=P||I,{editedContent:R,restoreEditedContent:z}=b(),{deleteButton:B,resetButton:V,saveButton:H,publishButton:U,downloadButton:W,confirmation:G}=x(`save-dictionary-details`),{isAuthenticated:K}=t(),q=R?.[S.localId],J=q&&JSON.stringify(q)!==JSON.stringify(S),Y=S?.id!==void 0,X=async()=>{R?.[S.localId]&&N({dictionary:{...S,...R?.[S.localId]}},{onSuccess:()=>{A(R?.[S.localId]),z(S.localId),k(!1),E?.()}})},Z=()=>{let e={...S,...R?.[S.localId]};F({dictionaries:[e]},{onSuccess:t=>{t&&(A(e),z(S.localId),E?.())}})},Q=()=>{S.id&&j({dictionaryId:S.id},{onSuccess:e=>{e&&T?.()}})};return v(g,{children:[_(s,{isOpen:O,title:G.title.value,size:c.MD,onClose:()=>k(!1),padding:`md`,children:v(`form`,{className:`size-full`,children:[_(`p`,{className:`py-4 text-neutral text-sm`,children:G.message}),v(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[_(l.Button,{label:G.cancelButton.label.value,disabled:!J||L,color:a.TEXT,className:`max-md:w-full`,variant:o.OUTLINE,onClick:()=>k(!1),children:G.cancelButton.text}),_(l.Button,{label:G.confirmButton.label.value,disabled:!J||L,Icon:m,color:a.TEXT,className:`max-md:w-full`,isLoading:I,onClick:X,children:G.confirmButton.text})]})]})}),v(`form`,{className:e(`flex justify-end gap-2 max-md:flex-col`,w),...D,children:[C.includes(`remote`)&&Y&&T&&K&&_(l.Button,{label:B.label.value,Icon:h,color:a.ERROR,variant:o.OUTLINE,className:`max-md:w-full`,isLoading:M,onClick:Q,children:B.text}),J&&_(l.Button,{label:V.label.value,disabled:!J,Icon:p,variant:o.OUTLINE,color:a.TEXT,className:`max-md:w-full`,onClick:()=>z(S.localId),children:V.text}),C.includes(`local`)&&_(l.Button,{label:W.label.value,disabled:!J||L,Icon:f,color:a.TEXT,variant:K?o.OUTLINE:o.DEFAULT,className:`max-md:w-full`,isLoading:P,onClick:()=>k(!0),children:W.text}),C.includes(`remote`)&&K&&!Y&&_(l.Button,{label:U.label.value,disabled:L,Icon:d,color:a.TEXT,className:`max-md:w-full`,isLoading:I,onClick:Z,children:U.text}),C.includes(`remote`)&&K&&Y&&J&&_(l.Button,{label:H.label.value,disabled:!J||L,Icon:m,color:`text`,className:`max-md:w-full`,isLoading:I,onClick:Z,children:H.text})]})]})};export{S as SaveForm};
2
2
  //# sourceMappingURL=SaveForm.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Container as e}from"../../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../../Button/Button.mjs";import{InputVariant as a}from"../../Input/Input.mjs";import{EditableFieldInput as o}from"../../EditableField/EditableFieldInput.mjs";import{NodeTypeSelector as s}from"../NodeTypeSelector.mjs";import{Plus as c,Trash as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{camelCaseToSentence as p}from"@intlayer/config/client";import{useIntlayer as m}from"react-intlayer";import{useConfiguration as h,useEditedContentActions as g,useFocusUnmergedDictionary as _}from"@intlayer/editor-react";import{getDefaultNode as v,getNodeChildren as y,getNodeType as b}from"@intlayer/core/dictionaryManipulator";import{NodeType as x}from"@intlayer/types/nodeType";import{isSameKeyPath as S}from"@intlayer/core/utils";const C=({section:e,dictionaryLocalId:t,keyPath:n,onNodeTypeChange:r})=>{let i=h()?.internationalization.locales??[],a=b(e),o=y(e),c=e=>{r(v(a,i,e))};if(a===x.Translation||a===x.Condition||a===x.Gender||a===x.Enumeration){let l=Object.keys(e[a])[0],u=[...n,{type:a,key:l}];return f(`div`,{className:`flex w-full flex-col gap-1`,children:[d(s,{section:e,onValueChange:e=>r(v(e,i))}),d(C,{section:o,keyPath:u,dictionaryLocalId:t,onNodeTypeChange:c})]})}if(a===x.Array){let l=[...n,{type:a,key:0}];return f(`div`,{className:`flex w-full flex-col gap-1`,children:[d(s,{section:e,onValueChange:e=>r(v(e,i))}),d(C,{section:o,keyPath:l,dictionaryLocalId:t,onNodeTypeChange:c})]})}return a===x.Object?f(u,{children:[d(s,{section:e,onValueChange:e=>r(v(e,i))}),d(`div`,{className:`mt-6 ml-10`,children:d(E,{keyPath:n,section:e,dictionaryLocalId:t})})]}):d(s,{section:e,onValueChange:e=>r(v(e,i))})},w=({sectionKey:s,section:c,keyPath:u,dictionaryLocalId:h})=>{let{focusedContent:v,setFocusedContentKeyPath:y}=_(),{renameEditedContent:b,addEditedContent:x}=g(),{titleInput:w,deleteButton:T}=m(`structure-view`),E=e=>{b(h,e,u);let t=u.slice(0,-1),n=u[u.length-1];y([...t,{...n,key:e}])};return d(e,{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":S(u,v?.keyPath??[]),onClick:()=>y(u),children:f(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof s==`string`&&f(`div`,{className:`w-full`,children:[f(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[d(o,{name:`key`,"aria-label":`Key`,placeholder:w.placeholder.value,defaultValue:s,onSave:e=>E(e),variant:a.INVISIBLE}),d(t,{label:T.label.value,variant:i.HOVERABLE,size:r.ICON_SM,color:n.TEXT,className:`translate-x-2`,Icon:l,onClick:()=>{x(h,void 0,u),y(u.slice(0,-1))}})]}),f(`span`,{className:`ml-3 text-neutral text-sm`,children:[`( `,p(s),` )`]})]}),d(C,{keyPath:u,dictionaryLocalId:h,section:c,onNodeTypeChange:e=>{x(h,e,u)}})]})})},T=({section:e,keyPath:a,dictionaryLocalId:o})=>{let{addNodeButton:s}=m(`structure-view`),{setFocusedContentKeyPath:l}=_(),{addEditedContent:u}=g();return!e||typeof e!=`object`?d(`div`,{children:`Not an object`}):f(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[d(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(e).map(t=>d(`li`,{className:`flex w-full`,children:d(w,{sectionKey:t,section:e?.[t],keyPath:[...a,{type:x.Object,key:t}],dictionaryLocalId:o})},`${JSON.stringify(a)}-object-${t}`))}),d(t,{label:s.label.value,variant:i.HOVERABLE,size:r.MD,color:n.TEXT,Icon:c,className:`flex-1`,onClick:()=>{let e=[...a,{type:x.Object,key:`newKey`}];u(o,``,e),l(e)},children:s.text})]})},E=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?d(w,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):d(T,{section:e,keyPath:t,dictionaryLocalId:n});export{w as NodeView,T as ObjectView,E as StructureView};
1
+ "use client";import{Container as e}from"../../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../../Button/Button.mjs";import{InputVariant as a}from"../../Input/Input.mjs";import{EditableFieldInput as o}from"../../EditableField/EditableFieldInput.mjs";import{NodeTypeSelector as s}from"../NodeTypeSelector.mjs";import{camelCaseToSentence as c}from"@intlayer/config/client";import{Plus as l,Trash as u}from"lucide-react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{useConfiguration as m,useEditedContentActions as h,useFocusUnmergedDictionary as g}from"@intlayer/editor-react";import{useIntlayer as _}from"react-intlayer";import{getDefaultNode as v,getNodeChildren as y,getNodeType as b}from"@intlayer/core/dictionaryManipulator";import{NodeType as x}from"@intlayer/types/nodeType";import{isSameKeyPath as S}from"@intlayer/core/utils";const C=({section:e,dictionaryLocalId:t,keyPath:n,onNodeTypeChange:r})=>{let i=m()?.internationalization.locales??[],a=b(e),o=y(e),c=e=>{r(v(a,i,e))};if(a===x.Translation||a===x.Condition||a===x.Gender||a===x.Enumeration){let l=Object.keys(e[a])[0],u=[...n,{type:a,key:l}];return p(`div`,{className:`flex w-full flex-col gap-1`,children:[f(s,{section:e,onValueChange:e=>r(v(e,i))}),f(C,{section:o,keyPath:u,dictionaryLocalId:t,onNodeTypeChange:c})]})}if(a===x.Array){let l=[...n,{type:a,key:0}];return p(`div`,{className:`flex w-full flex-col gap-1`,children:[f(s,{section:e,onValueChange:e=>r(v(e,i))}),f(C,{section:o,keyPath:l,dictionaryLocalId:t,onNodeTypeChange:c})]})}return a===x.Object?p(d,{children:[f(s,{section:e,onValueChange:e=>r(v(e,i))}),f(`div`,{className:`mt-6 ml-10`,children:f(E,{keyPath:n,section:e,dictionaryLocalId:t})})]}):f(s,{section:e,onValueChange:e=>r(v(e,i))})},w=({sectionKey:s,section:l,keyPath:d,dictionaryLocalId:m})=>{let{focusedContent:v,setFocusedContentKeyPath:y}=g(),{renameEditedContent:b,addEditedContent:x}=h(),{titleInput:w,deleteButton:T}=_(`structure-view`),E=e=>{b(m,e,d);let t=d.slice(0,-1),n=d[d.length-1];y([...t,{...n,key:e}])};return f(e,{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":S(d,v?.keyPath??[]),onClick:()=>y(d),children:p(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof s==`string`&&p(`div`,{className:`w-full`,children:[p(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[f(o,{name:`key`,"aria-label":`Key`,placeholder:w.placeholder.value,defaultValue:s,onSave:e=>E(e),variant:a.INVISIBLE}),f(t,{label:T.label.value,variant:i.HOVERABLE,size:r.ICON_SM,color:n.TEXT,className:`translate-x-2`,Icon:u,onClick:()=>{x(m,void 0,d),y(d.slice(0,-1))}})]}),p(`span`,{className:`ml-3 text-neutral text-sm`,children:[`( `,c(s),` )`]})]}),f(C,{keyPath:d,dictionaryLocalId:m,section:l,onNodeTypeChange:e=>{x(m,e,d)}})]})})},T=({section:e,keyPath:a,dictionaryLocalId:o})=>{let{addNodeButton:s}=_(`structure-view`),{setFocusedContentKeyPath:c}=g(),{addEditedContent:u}=h();return!e||typeof e!=`object`?f(`div`,{children:`Not an object`}):p(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[f(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(e).map(t=>f(`li`,{className:`flex w-full`,children:f(w,{sectionKey:t,section:e?.[t],keyPath:[...a,{type:x.Object,key:t}],dictionaryLocalId:o})},`${JSON.stringify(a)}-object-${t}`))}),f(t,{label:s.label.value,variant:i.HOVERABLE,size:r.MD,color:n.TEXT,Icon:l,className:`flex-1`,onClick:()=>{let e=[...a,{type:x.Object,key:`newKey`}];u(o,``,e),c(e)},children:s.text})]})},E=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?f(w,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):f(T,{section:e,keyPath:t,dictionaryLocalId:n});export{w as NodeView,T as ObjectView,E as StructureView};
2
2
  //# sourceMappingURL=StructureView.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{MaxHeightSmoother as t}from"../MaxHeightSmoother/index.mjs";import{useEffect as n,useRef as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{useIntlayer as s}from"react-intlayer";const c=({isRollable:c=!0,minHeight:l=700,children:u,className:d})=>{let[f,p]=i(0),[m,h]=i(!0),g=r(null),{expandCollapseContent:_}=s(`expand-collapse`),v=f>l;return n(()=>{let e=()=>{g.current&&p(g.current.scrollHeight)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]),c?v?o(`div`,{className:`w-full`,children:[a(t,{isHidden:m,minHeight:l,className:`w-full overflow-x-auto overflow-y-hidden`,children:a(`div`,{className:e(`grid min-h-0 w-full`,d),ref:g,children:u})}),v&&a(`button`,{className:e(`flex w-full cursor-pointer items-center justify-center`,`bg-gradient-to-t from-card/80 to-transparent px-3 py-2`,`text-md text-neutral-700 backdrop-blur`,`transition-all duration-300 hover:py-3`,`dark:text-neutral-400`),type:`button`,onClick:()=>h(e=>!e),children:_(m)})]}):a(`div`,{className:e(`grid min-h-0 w-full`,d),ref:g,children:u}):u};export{c as ExpandCollapse};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{MaxHeightSmoother as t}from"../MaxHeightSmoother/index.mjs";import{useEffect as n,useRef as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{useIntlayer as s}from"react-intlayer";const c=({isRollable:c=!0,minHeight:l=700,children:u,className:d})=>{let[f,p]=i(0),[m,h]=i(!0),g=r(null),{expandCollapseContent:_}=s(`expand-collapse`),v=f>l;return n(()=>{let e=()=>{g.current&&p(g.current.clientHeight)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]),c?v?o(t,{isHidden:m,minHeight:l,className:`w-full overflow-x-auto overflow-y-hidden`,children:[a(`div`,{className:e(`grid w-full`,d),ref:g,children:u}),a(`button`,{className:e(`absolute right-0 bottom-0 flex w-full cursor-pointer items-center justify-center rounded-t-2xl bg-gradient-to-t from-card/80 to-transparent px-3 py-0.5 text-md text-neutral-700 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all duration-300 hover:py-1 dark:text-neutral-400`,m?`w-full`:`w-32`),type:`button`,onClick:()=>h(e=>!e),children:_(m)})]}):a(`div`,{className:e(`grid w-full`,d),ref:g,children:u}):u};export{c as ExpandCollapse};
2
2
  //# sourceMappingURL=ExpandCollapse.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandCollapse.mjs","names":[],"sources":["../../../../src/components/ExpandCollapse/ExpandCollapse.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { type FC, type ReactNode, useEffect, useRef, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\n/**\n * Props for the ExpandCollapse component\n */\nexport type ExpandCollapseProps = {\n /** Whether the component should provide expand/collapse functionality. If false, renders children directly */\n isRollable?: boolean;\n /** Minimum height in pixels before showing the expand/collapse toggle */\n minHeight?: number;\n /** Content that may overflow and trigger the expand/collapse behavior */\n children: ReactNode;\n /** Additional CSS classes for styling customization */\n className?: string;\n};\n\n/** Default minimum height threshold for triggering expand/collapse behavior */\nconst DEFAULT_MIN_HEIGHT = 700;\n\n/**\n * ExpandCollapse Component\n *\n * A smart content container that automatically provides expand/collapse functionality\n * when content exceeds a specified height threshold. Features smooth animations,\n * internationalized toggle text, and intelligent height detection.\n *\n * @example\n * ```tsx\n * <ExpandCollapse minHeight={300}>\n * <div>Very long content that will be collapsed...</div>\n * </ExpandCollapse>\n * ```\n *\n * ## Key Features\n * - **Smart Detection**: Automatically detects when content exceeds height threshold\n * - **Smooth Animations**: Uses CSS transitions for smooth expand/collapse effects\n * - **Internationalization**: Toggle text supports multiple languages via Intlayer\n * - **Customizable Height**: Configurable minimum height threshold\n * - **Performance Optimized**: Only applies collapse behavior when necessary\n * - **Accessibility**: Proper ARIA attributes and keyboard support\n *\n * ## Behavior Logic\n * 1. **Measurement Phase**: Measures actual content height on mount\n * 2. **Comparison**: Compares content height against minHeight threshold\n * 3. **Conditional Rendering**:\n * - If content ≤ minHeight: Renders normally without collapse functionality\n * - If content > minHeight: Enables expand/collapse with toggle button\n * 4. **State Management**: Manages collapsed/expanded state with smooth transitions\n *\n * ## When to Use\n * - Long-form content (articles, documentation, code blocks)\n * - Lists or tables that may grow beyond comfortable viewing height\n * - User-generated content with unpredictable length\n * - FAQ sections or expandable content cards\n * - Code examples or JSON data display\n *\n * ## Accessibility Features\n * - **Keyboard Navigation**: Toggle button is focusable and keyboard accessible\n * - **Screen Reader Support**: Proper ARIA labels and state announcements\n * - **Visual Indicators**: Clear visual cues for collapsed/expanded states\n * - **Smooth Animations**: Respects user preferences for reduced motion\n *\n * ## Internationalization\n * - Supports multiple languages through Intlayer integration\n * - Toggle text automatically adapts to current locale\n * - Includes translations for \"Show all\" and \"Show less\" states\n *\n * @param props - ExpandCollapseProps\n * @returns React functional component\n */\nexport const ExpandCollapse: FC<ExpandCollapseProps> = ({\n isRollable = true,\n minHeight = DEFAULT_MIN_HEIGHT,\n children,\n className,\n}) => {\n const [codeContainerHeight, setCodeContainerHeight] = useState(0);\n const [isCollapsed, setIsCollapsed] = useState(true);\n const codeContainerRef = useRef<HTMLDivElement>(null);\n const { expandCollapseContent } = useIntlayer('expand-collapse');\n\n const isTooBig = codeContainerHeight > minHeight;\n\n useEffect(() => {\n const measure = () => {\n if (codeContainerRef.current) {\n setCodeContainerHeight(codeContainerRef.current.scrollHeight);\n }\n };\n\n measure();\n\n window.addEventListener('resize', measure);\n return () => window.removeEventListener('resize', measure);\n }, [children]);\n\n if (!isRollable) {\n return children;\n }\n\n if (!isTooBig) {\n return (\n <div\n className={cn('grid min-h-0 w-full', className)}\n ref={codeContainerRef}\n >\n {children}\n </div>\n );\n }\n\n return (\n <div className=\"w-full\">\n <MaxHeightSmoother\n isHidden={isCollapsed}\n minHeight={minHeight}\n className=\"w-full overflow-x-auto overflow-y-hidden\"\n >\n <div\n className={cn('grid min-h-0 w-full', className)}\n ref={codeContainerRef}\n >\n {children}\n </div>\n </MaxHeightSmoother>\n\n {isTooBig && (\n <button\n className={cn(\n 'flex w-full cursor-pointer items-center justify-center',\n 'bg-gradient-to-t from-card/80 to-transparent px-3 py-2',\n 'text-md text-neutral-700 backdrop-blur',\n 'transition-all duration-300 hover:py-3',\n 'dark:text-neutral-400'\n )}\n type=\"button\"\n onClick={() => setIsCollapsed((prev) => !prev)}\n >\n {expandCollapseContent(isCollapsed)}\n </button>\n )}\n </div>\n );\n};\n"],"mappings":"mRAsBA,MAqDa,GAA2C,CACtD,aAAa,GACb,YAAY,IACZ,WACA,eACI,CACJ,GAAM,CAAC,EAAqB,GAA0B,EAAS,EAAE,CAC3D,CAAC,EAAa,GAAkB,EAAS,GAAK,CAC9C,EAAmB,EAAuB,KAAK,CAC/C,CAAE,yBAA0B,EAAY,kBAAkB,CAE1D,EAAW,EAAsB,EA8BvC,OA5BA,MAAgB,CACd,IAAM,MAAgB,CAChB,EAAiB,SACnB,EAAuB,EAAiB,QAAQ,aAAa,EAOjE,OAHA,GAAS,CAET,OAAO,iBAAiB,SAAU,EAAQ,KAC7B,OAAO,oBAAoB,SAAU,EAAQ,EACzD,CAAC,EAAS,CAAC,CAET,EAIA,EAYH,EAAC,MAAD,CAAK,UAAU,kBAAf,CACE,EAAC,EAAD,CACE,SAAU,EACC,YACX,UAAU,oDAEV,EAAC,MAAD,CACE,UAAW,EAAG,sBAAuB,EAAU,CAC/C,IAAK,EAEJ,WACG,CAAA,CACY,CAAA,CAEnB,GACC,EAAC,SAAD,CACE,UAAW,EACT,yDACA,yDACA,yCACA,yCACA,wBACD,CACD,KAAK,SACL,YAAe,EAAgB,GAAS,CAAC,EAAK,UAE7C,EAAsB,EAAY,CAC5B,CAAA,CAEP,GAvCJ,EAAC,MAAD,CACE,UAAW,EAAG,sBAAuB,EAAU,CAC/C,IAAK,EAEJ,WACG,CAAA,CAVD"}
1
+ {"version":3,"file":"ExpandCollapse.mjs","names":[],"sources":["../../../../src/components/ExpandCollapse/ExpandCollapse.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { type FC, type ReactNode, useEffect, useRef, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\n/**\n * Props for the ExpandCollapse component\n */\nexport type ExpandCollapseProps = {\n /** Whether the component should provide expand/collapse functionality. If false, renders children directly */\n isRollable?: boolean;\n /** Minimum height in pixels before showing the expand/collapse toggle */\n minHeight?: number;\n /** Content that may overflow and trigger the expand/collapse behavior */\n children: ReactNode;\n /** Additional CSS classes for styling customization */\n className?: string;\n};\n\n/** Default minimum height threshold for triggering expand/collapse behavior */\nconst DEFAULT_MIN_HEIGHT = 700;\n\n/**\n * ExpandCollapse Component\n *\n * A smart content container that automatically provides expand/collapse functionality\n * when content exceeds a specified height threshold. Features smooth animations,\n * internationalized toggle text, and intelligent height detection.\n *\n * @example\n * ```tsx\n * <ExpandCollapse minHeight={300}>\n * <div>Very long content that will be collapsed...</div>\n * </ExpandCollapse>\n * ```\n *\n * ## Key Features\n * - **Smart Detection**: Automatically detects when content exceeds height threshold\n * - **Smooth Animations**: Uses CSS transitions for smooth expand/collapse effects\n * - **Internationalization**: Toggle text supports multiple languages via Intlayer\n * - **Customizable Height**: Configurable minimum height threshold\n * - **Performance Optimized**: Only applies collapse behavior when necessary\n * - **Accessibility**: Proper ARIA attributes and keyboard support\n *\n * ## Behavior Logic\n * 1. **Measurement Phase**: Measures actual content height on mount\n * 2. **Comparison**: Compares content height against minHeight threshold\n * 3. **Conditional Rendering**:\n * - If content ≤ minHeight: Renders normally without collapse functionality\n * - If content > minHeight: Enables expand/collapse with toggle button\n * 4. **State Management**: Manages collapsed/expanded state with smooth transitions\n *\n * ## When to Use\n * - Long-form content (articles, documentation, code blocks)\n * - Lists or tables that may grow beyond comfortable viewing height\n * - User-generated content with unpredictable length\n * - FAQ sections or expandable content cards\n * - Code examples or JSON data display\n *\n * ## Accessibility Features\n * - **Keyboard Navigation**: Toggle button is focusable and keyboard accessible\n * - **Screen Reader Support**: Proper ARIA labels and state announcements\n * - **Visual Indicators**: Clear visual cues for collapsed/expanded states\n * - **Smooth Animations**: Respects user preferences for reduced motion\n *\n * ## Internationalization\n * - Supports multiple languages through Intlayer integration\n * - Toggle text automatically adapts to current locale\n * - Includes translations for \"Show all\" and \"Show less\" states\n *\n * @param props - ExpandCollapseProps\n * @returns React functional component\n */\nexport const ExpandCollapse: FC<ExpandCollapseProps> = ({\n isRollable = true,\n minHeight = DEFAULT_MIN_HEIGHT,\n children,\n className,\n}) => {\n const [codeContainerHeight, setCodeContainerHeight] = useState(0);\n const [isCollapsed, setIsCollapsed] = useState(true);\n const codeContainerRef = useRef<HTMLDivElement>(null);\n const { expandCollapseContent } = useIntlayer('expand-collapse');\n\n const isTooBig = codeContainerHeight > minHeight;\n\n useEffect(() => {\n const measure = () => {\n if (codeContainerRef.current) {\n setCodeContainerHeight(codeContainerRef.current.clientHeight);\n }\n };\n\n measure();\n\n window.addEventListener('resize', measure);\n return () => window.removeEventListener('resize', measure);\n }, [children]);\n\n if (!isRollable) {\n return children;\n }\n\n if (!isTooBig) {\n return (\n <div className={cn('grid w-full', className)} ref={codeContainerRef}>\n {children}\n </div>\n );\n }\n\n return (\n <MaxHeightSmoother\n isHidden={isCollapsed}\n minHeight={minHeight}\n className=\"w-full overflow-x-auto overflow-y-hidden\"\n >\n <div className={cn('grid w-full', className)} ref={codeContainerRef}>\n {children}\n </div>\n <button\n className={cn(\n 'absolute right-0 bottom-0 flex w-full cursor-pointer items-center justify-center rounded-t-2xl bg-gradient-to-t from-card/80 to-transparent px-3 py-0.5 text-md text-neutral-700 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all duration-300 hover:py-1 dark:text-neutral-400',\n isCollapsed ? 'w-full' : 'w-32'\n )}\n type=\"button\"\n onClick={() => setIsCollapsed((prev) => !prev)}\n >\n {expandCollapseContent(isCollapsed)}\n </button>\n </MaxHeightSmoother>\n );\n};\n"],"mappings":"mRAsBA,MAqDa,GAA2C,CACtD,aAAa,GACb,YAAY,IACZ,WACA,eACI,CACJ,GAAM,CAAC,EAAqB,GAA0B,EAAS,EAAE,CAC3D,CAAC,EAAa,GAAkB,EAAS,GAAK,CAC9C,EAAmB,EAAuB,KAAK,CAC/C,CAAE,yBAA0B,EAAY,kBAAkB,CAE1D,EAAW,EAAsB,EA2BvC,OAzBA,MAAgB,CACd,IAAM,MAAgB,CAChB,EAAiB,SACnB,EAAuB,EAAiB,QAAQ,aAAa,EAOjE,OAHA,GAAS,CAET,OAAO,iBAAiB,SAAU,EAAQ,KAC7B,OAAO,oBAAoB,SAAU,EAAQ,EACzD,CAAC,EAAS,CAAC,CAET,EAIA,EASH,EAAC,EAAD,CACE,SAAU,EACC,YACX,UAAU,oDAHZ,CAKE,EAAC,MAAD,CAAK,UAAW,EAAG,cAAe,EAAU,CAAE,IAAK,EAChD,WACG,CAAA,CACN,EAAC,SAAD,CACE,UAAW,EACT,sSACA,EAAc,SAAW,OAC1B,CACD,KAAK,SACL,YAAe,EAAgB,GAAS,CAAC,EAAK,UAE7C,EAAsB,EAAY,CAC5B,CAAA,CACS,GAzBlB,EAAC,MAAD,CAAK,UAAW,EAAG,cAAe,EAAU,CAAE,IAAK,EAChD,WACG,CAAA,CAPD"}
@@ -1,2 +1,2 @@
1
- "use client";import{InputIndicator as e,InputOTP as t,InputOTPGroup as n,InputOTPSeparator as r,InputOTPSlot as i}from"../../Input/OTPInput.mjs";import{useItemSelector as a}from"../../../hooks/useItemSelector.mjs";import{useFormField as o}from"../FormField.mjs";import{FormItemLayout as s}from"../layout/FormItemLayout.mjs";import{Form as c}from"../Form.mjs";import{useEffect as l,useRef as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{useFormContext as m}from"react-hook-form";const h=e=>e?.getAttribute(`aria-selected`)===`true`,g=({field:c,name:m,label:g,description:_,isRequired:v,info:y,showErrorMessage:b,children:x,slots:S=6,maxLength:C=6,...w})=>{let{error:T}=o(),E=u([]),{choiceIndicatorPosition:D,calculatePosition:O}=a(E,{selector:h,isHoverable:!0});return l(()=>{O()},[]),f(s,{htmlFor:m,label:g,description:_,isRequired:v,info:y,showErrorMessage:b,"aria-invalid":!!T,children:f(t,{onChange:c.onChange,defaultValue:c.value,maxLength:C,pattern:`^[0-9]+$`,onActiveSlotChange:O,...w,children:x??p(d,{children:[p(n,{children:[f(i,{index:0,ref:e=>{E.current[0]=e}}),f(i,{index:1,ref:e=>{E.current[1]=e}}),f(i,{index:2,ref:e=>{E.current[2]=e}})]}),f(r,{}),p(n,{children:[f(i,{index:3,ref:e=>{E.current[3]=e}}),f(i,{index:4,ref:e=>{E.current[4]=e}}),f(i,{index:5,ref:e=>{E.current[5]=e}})]}),D&&f(e,{style:D})]})})})},_=({name:e,description:t,label:n,isRequired:r,info:i,showErrorMessage:a,children:o,slots:s=6,maxLength:l=6,...u})=>{let{control:d}=m();return f(c.Field,{control:d,name:e,render:({field:c})=>f(g,{field:c,name:e,label:n,description:t,isRequired:r,info:i,showErrorMessage:a,slots:s,maxLength:l,...u,children:o})})};export{_ as OTPElement};
1
+ "use client";import{useItemSelector as e}from"../../../hooks/useItemSelector.mjs";import{InputIndicator as t,InputOTP as n,InputOTPGroup as r,InputOTPSeparator as i,InputOTPSlot as a}from"../../Input/OTPInput.mjs";import{useFormField as o}from"../FormField.mjs";import{FormItemLayout as s}from"../layout/FormItemLayout.mjs";import{Form as c}from"../Form.mjs";import{useEffect as l,useRef as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{useFormContext as m}from"react-hook-form";const h=e=>e?.getAttribute(`aria-selected`)===`true`,g=({field:c,name:m,label:g,description:_,isRequired:v,info:y,showErrorMessage:b,children:x,slots:S=6,maxLength:C=6,...w})=>{let{error:T}=o(),E=u([]),{choiceIndicatorPosition:D,calculatePosition:O}=e(E,{selector:h,isHoverable:!0});return l(()=>{O()},[]),f(s,{htmlFor:m,label:g,description:_,isRequired:v,info:y,showErrorMessage:b,"aria-invalid":!!T,children:f(n,{onChange:c.onChange,defaultValue:c.value,maxLength:C,pattern:`^[0-9]+$`,onActiveSlotChange:O,...w,children:x??p(d,{children:[p(r,{children:[f(a,{index:0,ref:e=>{E.current[0]=e}}),f(a,{index:1,ref:e=>{E.current[1]=e}}),f(a,{index:2,ref:e=>{E.current[2]=e}})]}),f(i,{}),p(r,{children:[f(a,{index:3,ref:e=>{E.current[3]=e}}),f(a,{index:4,ref:e=>{E.current[4]=e}}),f(a,{index:5,ref:e=>{E.current[5]=e}})]}),D&&f(t,{style:D})]})})})},_=({name:e,description:t,label:n,isRequired:r,info:i,showErrorMessage:a,children:o,slots:s=6,maxLength:l=6,...u})=>{let{control:d}=m();return f(c.Field,{control:d,name:e,render:({field:c})=>f(g,{field:c,name:e,label:n,description:t,isRequired:r,info:i,showErrorMessage:a,slots:s,maxLength:l,...u,children:o})})};export{_ as OTPElement};
2
2
  //# sourceMappingURL=OTPElement.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{CodeDefault as e}from"./CodeBlockClient.mjs";import{useEffect as t,useState as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=new Map,a=new Map,o=async e=>{if(i.has(e))return i.get(e);let t;switch(e){case`typescript`:case`ts`:t=await import(`shiki/langs/typescript.mjs`);break;case`javascript`:case`js`:t=await import(`shiki/langs/javascript.mjs`);break;case`bash`:case`sh`:case`shell`:t=await import(`shiki/langs/bash.mjs`);break;case`json`:t=await import(`shiki/langs/json.mjs`);break;case`tsx`:t=await import(`shiki/langs/tsx.mjs`);break;case`vue`:t=await import(`shiki/langs/vue.mjs`);break;case`html`:t=await import(`shiki/langs/html.mjs`);break;case`xml`:t=await import(`shiki/langs/xml.mjs`);break;case`yaml`:t=await import(`shiki/langs/yaml.mjs`);break;default:t=await import(`shiki/langs/typescript.mjs`);break}let n=t.default;return i.set(e,n),n},s=async e=>{if(a.has(e))return a.get(e);let t;switch(e){case`github-dark`:t=await import(`shiki/themes/github-dark.mjs`);break;default:t=await import(`shiki/themes/github-light.mjs`);break}let n=t.default;return a.set(e,n),n};let c=null;const l=async()=>(c||=import(`shiki/bundle/web`).then(({createHighlighter:e})=>e({langs:[],themes:[]})),c),u=async(e,t,n)=>{let r=n?`github-dark`:`github-light`,[i,a,c]=await Promise.all([l(),o(t),s(r)]);return i.getLoadedLanguages().includes(t)||await i.loadLanguage(a),i.getLoadedThemes().includes(r)||await i.loadTheme(c),i.codeToHtml(e,{lang:t,theme:r})},d=({children:i,lang:a,isDarkMode:o})=>{let[s,c]=n(null);return t(()=>{let e=!1;return u(i,a,o).then(t=>{e||c(t)}).catch(t=>{console.error(`Failed to highlight code:`,t),!e&&s===null&&c(``)}),()=>{e=!0}},[i,a,o]),r(`div`,{className:`min-w-0 max-w-full overflow-auto bg-transparent [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&_pre::-webkit-scrollbar]:hidden [&_pre]:[-ms-overflow-style:none] [&_pre]:[scrollbar-width:none]`,children:s?r(`div`,{dangerouslySetInnerHTML:{__html:s}}):r(e,{children:i})})};export{d as CodeBlockShiki};
1
+ "use client";import{CodeDefault as e}from"./CodeBlockClient.mjs";import{useEffect as t,useState as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=new Map,a=new Map,o=async e=>{if(i.has(e))return i.get(e);let t;switch(e){case`typescript`:case`ts`:t=await import(`shiki/langs/typescript.mjs`);break;case`javascript`:case`js`:t=await import(`shiki/langs/javascript.mjs`);break;case`bash`:case`sh`:case`shell`:t=await import(`shiki/langs/bash.mjs`);break;case`json`:t=await import(`shiki/langs/json.mjs`);break;case`jsonc`:case`json5`:t=await import(`shiki/langs/json5.mjs`);break;case`tsx`:t=await import(`shiki/langs/tsx.mjs`);break;case`vue`:t=await import(`shiki/langs/vue.mjs`);break;case`html`:t=await import(`shiki/langs/html.mjs`);break;case`xml`:t=await import(`shiki/langs/xml.mjs`);break;case`yaml`:t=await import(`shiki/langs/yaml.mjs`);break;default:t=await import(`shiki/langs/typescript.mjs`);break}let n=t.default;return i.set(e,n),n},s=async e=>{if(a.has(e))return a.get(e);let t;switch(e){case`github-dark`:t=await import(`shiki/themes/github-dark.mjs`);break;default:t=await import(`shiki/themes/github-light.mjs`);break}let n=t.default;return a.set(e,n),n};let c=null;const l=async()=>(c||=import(`shiki/bundle/web`).then(({createHighlighter:e})=>e({langs:[],themes:[]})),c),u=async(e,t,n)=>{let r=n?`github-dark`:`github-light`,[i,a,c]=await Promise.all([l(),o(t),s(r)]);return i.getLoadedLanguages().includes(t)||await i.loadLanguage(a),i.getLoadedThemes().includes(r)||await i.loadTheme(c),i.codeToHtml(e,{lang:t,theme:r})},d=({children:i,lang:a,isDarkMode:o})=>{let[s,c]=n(null);return t(()=>{let e=!1;return u(i,a,o).then(t=>{e||c(t)}).catch(t=>{console.error(`Failed to highlight code:`,t),!e&&s===null&&c(``)}),()=>{e=!0}},[i,a,o]),r(`div`,{className:`min-w-0 max-w-full overflow-auto bg-transparent [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&_pre::-webkit-scrollbar]:hidden [&_pre]:[-ms-overflow-style:none] [&_pre]:[scrollbar-width:none]`,children:s?r(`div`,{dangerouslySetInnerHTML:{__html:s}}):r(e,{children:i})})};export{d as CodeBlockShiki};
2
2
  //# sourceMappingURL=CodeBlockShiki.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockShiki.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useEffect, useState } from 'react';\nimport type {\n BundledLanguage,\n BundledTheme,\n HighlighterGeneric,\n} from 'shiki/bundle/web';\nimport { CodeDefault } from './CodeBlockClient';\n\n// Map of loaded modules to avoid re-importing\nconst languageCache = new Map<BundledLanguage, any>();\nconst themeCache = new Map<BundledTheme, any>();\n\n// Lazy load language modules\nconst loadLanguage = async (lang: BundledLanguage): Promise<any> => {\n if (languageCache.has(lang)) return languageCache.get(lang);\n\n let languageModule: any;\n switch (lang) {\n case 'typescript':\n case 'ts':\n languageModule = await import('shiki/langs/typescript.mjs');\n break;\n case 'javascript':\n case 'js':\n languageModule = await import('shiki/langs/javascript.mjs');\n break;\n case 'bash':\n case 'sh':\n case 'shell':\n languageModule = await import('shiki/langs/bash.mjs');\n break;\n case 'json':\n languageModule = await import('shiki/langs/json.mjs');\n break;\n case 'tsx':\n languageModule = await import('shiki/langs/tsx.mjs');\n break;\n case 'vue':\n languageModule = await import('shiki/langs/vue.mjs');\n break;\n case 'html':\n languageModule = await import('shiki/langs/html.mjs');\n break;\n case 'xml':\n languageModule = await import('shiki/langs/xml.mjs');\n break;\n case 'yaml':\n languageModule = await import('shiki/langs/yaml.mjs');\n break;\n default:\n languageModule = await import('shiki/langs/typescript.mjs');\n break;\n }\n\n const language = languageModule.default;\n languageCache.set(lang, language);\n return language;\n};\n\n// Lazy load theme modules\nconst loadTheme = async (themeName: BundledTheme): Promise<any> => {\n if (themeCache.has(themeName)) return themeCache.get(themeName);\n\n let themeModule: any;\n switch (themeName) {\n case 'github-dark':\n themeModule = await import('shiki/themes/github-dark.mjs');\n break;\n case 'github-light':\n default:\n themeModule = await import('shiki/themes/github-light.mjs');\n break;\n }\n\n const theme = themeModule.default;\n themeCache.set(themeName, theme);\n return theme;\n};\n\n// Singleton Highlighter Instance\nlet highlighterPromise: Promise<HighlighterGeneric<any, any>> | null = null;\n\nconst getHighlighterInstance = async () => {\n if (!highlighterPromise) {\n highlighterPromise = import('shiki/bundle/web').then(\n ({ createHighlighter }) =>\n createHighlighter({\n langs: [],\n themes: [],\n })\n );\n }\n return highlighterPromise;\n};\n\n// Create a promise for highlighting\nconst highlightCode = async (\n code: string,\n lang: BundledLanguage,\n isDarkMode?: boolean\n): Promise<string> => {\n const themeName: BundledTheme = isDarkMode ? 'github-dark' : 'github-light';\n\n // Load highlighter, language, and theme in parallel\n const [highlighter, languageModule, themeModule] = await Promise.all([\n getHighlighterInstance(),\n loadLanguage(lang),\n loadTheme(themeName),\n ]);\n\n // Load into the singleton instance if not already loaded\n if (!highlighter.getLoadedLanguages().includes(lang)) {\n await highlighter.loadLanguage(languageModule);\n }\n if (!highlighter.getLoadedThemes().includes(themeName)) {\n await highlighter.loadTheme(themeModule);\n }\n\n return highlighter.codeToHtml(code, {\n lang,\n theme: themeName,\n });\n};\n\nexport type CodeBlockShikiProps = {\n children: string;\n lang: BundledLanguage;\n isDarkMode?: boolean;\n};\n\nexport const CodeBlockShiki: FC<CodeBlockShikiProps> = ({\n children,\n lang,\n isDarkMode,\n}) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n highlightCode(children, lang, isDarkMode)\n .then((result) => {\n if (!isCancelled) setHtml(result);\n })\n .catch((error) => {\n console.error('Failed to highlight code:', error);\n if (!isCancelled && html === null) setHtml('');\n });\n\n return () => {\n isCancelled = true;\n };\n }, [children, lang, isDarkMode]);\n\n return (\n <div className=\"min-w-0 max-w-full overflow-auto bg-transparent [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&_pre::-webkit-scrollbar]:hidden [&_pre]:[-ms-overflow-style:none] [&_pre]:[scrollbar-width:none]\">\n {html ? (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n <div dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <CodeDefault>{children}</CodeDefault>\n )}\n </div>\n );\n};\n"],"mappings":"yJAWA,MAAM,EAAgB,IAAI,IACpB,EAAa,IAAI,IAGjB,EAAe,KAAO,IAAwC,CAClE,GAAI,EAAc,IAAI,EAAK,CAAE,OAAO,EAAc,IAAI,EAAK,CAE3D,IAAI,EACJ,OAAQ,EAAR,CACE,IAAK,aACL,IAAK,KACH,EAAiB,MAAM,OAAO,8BAC9B,MACF,IAAK,aACL,IAAK,KACH,EAAiB,MAAM,OAAO,8BAC9B,MACF,IAAK,OACL,IAAK,KACL,IAAK,QACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,QACE,EAAiB,MAAM,OAAO,8BAC9B,MAGJ,IAAM,EAAW,EAAe,QAEhC,OADA,EAAc,IAAI,EAAM,EAAS,CAC1B,GAIH,EAAY,KAAO,IAA0C,CACjE,GAAI,EAAW,IAAI,EAAU,CAAE,OAAO,EAAW,IAAI,EAAU,CAE/D,IAAI,EACJ,OAAQ,EAAR,CACE,IAAK,cACH,EAAc,MAAM,OAAO,gCAC3B,MAEF,QACE,EAAc,MAAM,OAAO,iCAC3B,MAGJ,IAAM,EAAQ,EAAY,QAE1B,OADA,EAAW,IAAI,EAAW,EAAM,CACzB,GAIT,IAAI,EAAmE,KAEvE,MAAM,EAAyB,UAC7B,AACE,IAAqB,OAAO,oBAAoB,MAC7C,CAAE,uBACD,EAAkB,CAChB,MAAO,EAAE,CACT,OAAQ,EAAE,CACX,CAAC,CACL,CAEI,GAIH,EAAgB,MACpB,EACA,EACA,IACoB,CACpB,IAAM,EAA0B,EAAa,cAAgB,eAGvD,CAAC,EAAa,EAAgB,GAAe,MAAM,QAAQ,IAAI,CACnE,GAAwB,CACxB,EAAa,EAAK,CAClB,EAAU,EAAU,CACrB,CAAC,CAUF,OAPK,EAAY,oBAAoB,CAAC,SAAS,EAAK,EAClD,MAAM,EAAY,aAAa,EAAe,CAE3C,EAAY,iBAAiB,CAAC,SAAS,EAAU,EACpD,MAAM,EAAY,UAAU,EAAY,CAGnC,EAAY,WAAW,EAAM,CAClC,OACA,MAAO,EACR,CAAC,EASS,GAA2C,CACtD,WACA,OACA,gBACI,CACJ,GAAM,CAAC,EAAM,GAAW,EAAwB,KAAK,CAmBrD,OAjBA,MAAgB,CACd,IAAI,EAAc,GAWlB,OATA,EAAc,EAAU,EAAM,EAAW,CACtC,KAAM,GAAW,CACX,GAAa,EAAQ,EAAO,EACjC,CACD,MAAO,GAAU,CAChB,QAAQ,MAAM,4BAA6B,EAAM,CAC7C,CAAC,GAAe,IAAS,MAAM,EAAQ,GAAG,EAC9C,KAES,CACX,EAAc,KAEf,CAAC,EAAU,EAAM,EAAW,CAAC,CAG9B,EAAC,MAAD,CAAK,UAAU,6OACZ,EAEC,EAAC,MAAD,CAAK,wBAAyB,CAAE,OAAQ,EAAM,CAAI,CAAA,CAElD,EAAC,EAAD,CAAc,WAAuB,CAAA,CAEnC,CAAA"}
1
+ {"version":3,"file":"CodeBlockShiki.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useEffect, useState } from 'react';\nimport type {\n BundledLanguage,\n BundledTheme,\n HighlighterGeneric,\n} from 'shiki/bundle/web';\nimport { CodeDefault } from './CodeBlockClient';\n\n// Map of loaded modules to avoid re-importing\nconst languageCache = new Map<BundledLanguage, any>();\nconst themeCache = new Map<BundledTheme, any>();\n\n// Lazy load language modules\nconst loadLanguage = async (lang: BundledLanguage): Promise<any> => {\n if (languageCache.has(lang)) return languageCache.get(lang);\n\n let languageModule: any;\n switch (lang) {\n case 'typescript':\n case 'ts':\n languageModule = await import('shiki/langs/typescript.mjs');\n break;\n case 'javascript':\n case 'js':\n languageModule = await import('shiki/langs/javascript.mjs');\n break;\n case 'bash':\n case 'sh':\n case 'shell':\n languageModule = await import('shiki/langs/bash.mjs');\n break;\n case 'json':\n languageModule = await import('shiki/langs/json.mjs');\n break;\n case 'jsonc':\n case 'json5':\n languageModule = await import('shiki/langs/json5.mjs');\n break;\n case 'tsx':\n languageModule = await import('shiki/langs/tsx.mjs');\n break;\n case 'vue':\n languageModule = await import('shiki/langs/vue.mjs');\n break;\n case 'html':\n languageModule = await import('shiki/langs/html.mjs');\n break;\n case 'xml':\n languageModule = await import('shiki/langs/xml.mjs');\n break;\n case 'yaml':\n languageModule = await import('shiki/langs/yaml.mjs');\n break;\n default:\n languageModule = await import('shiki/langs/typescript.mjs');\n break;\n }\n\n const language = languageModule.default;\n languageCache.set(lang, language);\n return language;\n};\n\n// Lazy load theme modules\nconst loadTheme = async (themeName: BundledTheme): Promise<any> => {\n if (themeCache.has(themeName)) return themeCache.get(themeName);\n\n let themeModule: any;\n switch (themeName) {\n case 'github-dark':\n themeModule = await import('shiki/themes/github-dark.mjs');\n break;\n case 'github-light':\n default:\n themeModule = await import('shiki/themes/github-light.mjs');\n break;\n }\n\n const theme = themeModule.default;\n themeCache.set(themeName, theme);\n return theme;\n};\n\n// Singleton Highlighter Instance\nlet highlighterPromise: Promise<HighlighterGeneric<any, any>> | null = null;\n\nconst getHighlighterInstance = async () => {\n if (!highlighterPromise) {\n highlighterPromise = import('shiki/bundle/web').then(\n ({ createHighlighter }) =>\n createHighlighter({\n langs: [],\n themes: [],\n })\n );\n }\n return highlighterPromise;\n};\n\n// Create a promise for highlighting\nconst highlightCode = async (\n code: string,\n lang: BundledLanguage,\n isDarkMode?: boolean\n): Promise<string> => {\n const themeName: BundledTheme = isDarkMode ? 'github-dark' : 'github-light';\n\n // Load highlighter, language, and theme in parallel\n const [highlighter, languageModule, themeModule] = await Promise.all([\n getHighlighterInstance(),\n loadLanguage(lang),\n loadTheme(themeName),\n ]);\n\n // Load into the singleton instance if not already loaded\n if (!highlighter.getLoadedLanguages().includes(lang)) {\n await highlighter.loadLanguage(languageModule);\n }\n if (!highlighter.getLoadedThemes().includes(themeName)) {\n await highlighter.loadTheme(themeModule);\n }\n\n return highlighter.codeToHtml(code, {\n lang,\n theme: themeName,\n });\n};\n\nexport type CodeBlockShikiProps = {\n children: string;\n lang: BundledLanguage;\n isDarkMode?: boolean;\n};\n\nexport const CodeBlockShiki: FC<CodeBlockShikiProps> = ({\n children,\n lang,\n isDarkMode,\n}) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n highlightCode(children, lang, isDarkMode)\n .then((result) => {\n if (!isCancelled) setHtml(result);\n })\n .catch((error) => {\n console.error('Failed to highlight code:', error);\n if (!isCancelled && html === null) setHtml('');\n });\n\n return () => {\n isCancelled = true;\n };\n }, [children, lang, isDarkMode]);\n\n return (\n <div className=\"min-w-0 max-w-full overflow-auto bg-transparent [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&_pre::-webkit-scrollbar]:hidden [&_pre]:[-ms-overflow-style:none] [&_pre]:[scrollbar-width:none]\">\n {html ? (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n <div dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <CodeDefault>{children}</CodeDefault>\n )}\n </div>\n );\n};\n"],"mappings":"yJAWA,MAAM,EAAgB,IAAI,IACpB,EAAa,IAAI,IAGjB,EAAe,KAAO,IAAwC,CAClE,GAAI,EAAc,IAAI,EAAK,CAAE,OAAO,EAAc,IAAI,EAAK,CAE3D,IAAI,EACJ,OAAQ,EAAR,CACE,IAAK,aACL,IAAK,KACH,EAAiB,MAAM,OAAO,8BAC9B,MACF,IAAK,aACL,IAAK,KACH,EAAiB,MAAM,OAAO,8BAC9B,MACF,IAAK,OACL,IAAK,KACL,IAAK,QACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,QACL,IAAK,QACH,EAAiB,MAAM,OAAO,yBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,IAAK,MACH,EAAiB,MAAM,OAAO,uBAC9B,MACF,IAAK,OACH,EAAiB,MAAM,OAAO,wBAC9B,MACF,QACE,EAAiB,MAAM,OAAO,8BAC9B,MAGJ,IAAM,EAAW,EAAe,QAEhC,OADA,EAAc,IAAI,EAAM,EAAS,CAC1B,GAIH,EAAY,KAAO,IAA0C,CACjE,GAAI,EAAW,IAAI,EAAU,CAAE,OAAO,EAAW,IAAI,EAAU,CAE/D,IAAI,EACJ,OAAQ,EAAR,CACE,IAAK,cACH,EAAc,MAAM,OAAO,gCAC3B,MAEF,QACE,EAAc,MAAM,OAAO,iCAC3B,MAGJ,IAAM,EAAQ,EAAY,QAE1B,OADA,EAAW,IAAI,EAAW,EAAM,CACzB,GAIT,IAAI,EAAmE,KAEvE,MAAM,EAAyB,UAC7B,AACE,IAAqB,OAAO,oBAAoB,MAC7C,CAAE,uBACD,EAAkB,CAChB,MAAO,EAAE,CACT,OAAQ,EAAE,CACX,CAAC,CACL,CAEI,GAIH,EAAgB,MACpB,EACA,EACA,IACoB,CACpB,IAAM,EAA0B,EAAa,cAAgB,eAGvD,CAAC,EAAa,EAAgB,GAAe,MAAM,QAAQ,IAAI,CACnE,GAAwB,CACxB,EAAa,EAAK,CAClB,EAAU,EAAU,CACrB,CAAC,CAUF,OAPK,EAAY,oBAAoB,CAAC,SAAS,EAAK,EAClD,MAAM,EAAY,aAAa,EAAe,CAE3C,EAAY,iBAAiB,CAAC,SAAS,EAAU,EACpD,MAAM,EAAY,UAAU,EAAY,CAGnC,EAAY,WAAW,EAAM,CAClC,OACA,MAAO,EACR,CAAC,EASS,GAA2C,CACtD,WACA,OACA,gBACI,CACJ,GAAM,CAAC,EAAM,GAAW,EAAwB,KAAK,CAmBrD,OAjBA,MAAgB,CACd,IAAI,EAAc,GAWlB,OATA,EAAc,EAAU,EAAM,EAAW,CACtC,KAAM,GAAW,CACX,GAAa,EAAQ,EAAO,EACjC,CACD,MAAO,GAAU,CAChB,QAAQ,MAAM,4BAA6B,EAAM,CAC7C,CAAC,GAAe,IAAS,MAAM,EAAQ,GAAG,EAC9C,KAES,CACX,EAAc,KAEf,CAAC,EAAU,EAAM,EAAW,CAAC,CAG9B,EAAC,MAAD,CAAK,UAAU,6OACZ,EAEC,EAAC,MAAD,CAAK,wBAAyB,CAAE,OAAQ,EAAM,CAAI,CAAA,CAElD,EAAC,EAAD,CAAc,WAAuB,CAAA,CAEnC,CAAA"}
@@ -1,2 +1,2 @@
1
- "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonTextAlign as i,ButtonVariant as a}from"../Button/Button.mjs";import{Input as o}from"../Input/Input.mjs";import{usePersistedStore as s}from"../../hooks/usePersistedStore.mjs";import{DropDown as c}from"../DropDown/index.mjs";import{SwitchSelector as l,SwitchSelectorColor as u,SwitchSelectorSize as d}from"../SwitchSelector/index.mjs";import{useLocaleSwitcherContent as f}from"./LocaleSwitcherContentContext.mjs";import{useMemo as p,useRef as m,useState as h}from"react";import{Check as g,Globe as _,MoveVertical as v}from"lucide-react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useIntlayer as S,useLocale as C}from"react-intlayer";import{getHTMLTextDir as w,getLocaleName as T}from"@intlayer/core/localization";import*as E from"@intlayer/types/locales";import D from"fuse.js";const O=`locale-switcher-content`,k=({panelProps:k,isMultilingual:A=!0})=>{let{switchTo:j,searchInput:M,localeSwitcherLabel:N,languageListLabel:P,seeAllLocalesSwitch:F}=S(`locale-switcher-content`),I=m(null),{locale:L}=C(),{availableLocales:R,selectedLocales:z,setSelectedLocales:B}=f(),V=p(()=>R.map(e=>({locale:e,englishName:T(e,E.ENGLISH),currentLocaleName:T(e,L),ownLocaleName:T(e)})),[R,L]),[H,U]=h(``),[W,G]=s(`locale-content-selector-see-all-locales`,!1),K=p(()=>new D(V,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[V]),q=p(()=>H?K.search(H).map(e=>e.item):V,[H,V,K]),J=e=>{A?z.includes(e)?z.length>1&&B(t=>t.filter(t=>t!==e)):B(t=>[...t,e]):B([e])},Y=e=>{G(e),B(e?R:[L])};return b(`div`,{className:`rounded-xl border border-text text-text transition-colors`,children:x(c,{identifier:O,children:[b(c.Trigger,{identifier:O,label:N.value,className:`p-0!`,roundedSize:`3xl`,children:x(`div`,{className:`flex w-full items-center justify-between`,children:[b(`div`,{className:`px-2 py-1`,children:b(_,{size:16})}),b(v,{className:`self-center`,size:16})]})}),b(c.Panel,{identifier:O,isOverable:!0,isFocusable:!0,className:`right-0 left-auto`,...k,children:x(e,{className:`max-h-[60vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,border:!0,roundedSize:`2xl`,borderColor:`text`,"aria-label":P.value,children:[A&&b(`div`,{className:`m-auto p-2`,children:b(l,{defaultValue:W,onChange:Y,color:u.TEXT,size:d.SM,className:`!w-60`,choices:[{content:F.true.value,value:!0},{content:F.false.value,value:!1}]})}),!(A&&W)&&x(y,{children:[b(`div`,{className:`p-3`,children:b(o,{type:`search`,"aria-label":M.ariaLabel.value,placeholder:M.placeholder.value,onChange:e=>U(e.target.value),ref:I})}),b(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:q.map(({locale:e,currentLocaleName:o,ownLocaleName:s})=>b(`li`,{className:`px-1.5 py-1`,children:b(t,{onClick:()=>J(e),label:`${j} ${o}`,disabled:!(R??R).includes(e),isActive:z.includes(e),variant:a.HOVERABLE,color:n.TEXT,isFullWidth:!0,textAlign:i.LEFT,size:r.SM,children:x(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[A&&b(`div`,{className:`w-4`,children:z.includes(e)&&b(g,{className:`size-full`})}),x(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[x(`div`,{className:`flex flex-col text-nowrap`,children:[b(`span`,{dir:w(e),lang:e,children:s}),b(`span`,{className:`text-neutral text-xs`,children:o})]}),b(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})};export{k as LocaleSwitcherContent};
1
+ "use client";import{usePersistedStore as e}from"../../hooks/usePersistedStore.mjs";import{Container as t}from"../Container/index.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonTextAlign as a,ButtonVariant as o}from"../Button/Button.mjs";import{Input as s}from"../Input/Input.mjs";import{DropDown as c}from"../DropDown/index.mjs";import{SwitchSelector as l,SwitchSelectorColor as u,SwitchSelectorSize as d}from"../SwitchSelector/index.mjs";import{useLocaleSwitcherContent as f}from"./LocaleSwitcherContentContext.mjs";import{useMemo as p,useRef as m,useState as h}from"react";import{Check as g,Globe as _,MoveVertical as v}from"lucide-react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useIntlayer as S,useLocale as C}from"react-intlayer";import{getHTMLTextDir as w,getLocaleName as T}from"@intlayer/core/localization";import*as E from"@intlayer/types/locales";import D from"fuse.js";const O=`locale-switcher-content`,k=({panelProps:k,isMultilingual:A=!0})=>{let{switchTo:j,searchInput:M,localeSwitcherLabel:N,languageListLabel:P,seeAllLocalesSwitch:F}=S(`locale-switcher-content`),I=m(null),{locale:L}=C(),{availableLocales:R,selectedLocales:z,setSelectedLocales:B}=f(),V=p(()=>R.map(e=>({locale:e,englishName:T(e,E.ENGLISH),currentLocaleName:T(e,L),ownLocaleName:T(e)})),[R,L]),[H,U]=h(``),[W,G]=e(`locale-content-selector-see-all-locales`,!1),K=p(()=>new D(V,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[V]),q=p(()=>H?K.search(H).map(e=>e.item):V,[H,V,K]),J=e=>{A?z.includes(e)?z.length>1&&B(t=>t.filter(t=>t!==e)):B(t=>[...t,e]):B([e])},Y=e=>{G(e),B(e?R:[L])};return b(`div`,{className:`rounded-xl border border-text text-text transition-colors`,children:x(c,{identifier:O,children:[b(c.Trigger,{identifier:O,label:N.value,className:`p-0!`,roundedSize:`3xl`,children:x(`div`,{className:`flex w-full items-center justify-between`,children:[b(`div`,{className:`px-2 py-1`,children:b(_,{size:16})}),b(v,{className:`self-center`,size:16})]})}),b(c.Panel,{identifier:O,isOverable:!0,isFocusable:!0,className:`right-0 left-auto`,...k,children:x(t,{className:`max-h-[60vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,border:!0,roundedSize:`2xl`,borderColor:`text`,"aria-label":P.value,children:[A&&b(`div`,{className:`m-auto p-2`,children:b(l,{defaultValue:W,onChange:Y,color:u.TEXT,size:d.SM,className:`!w-60`,choices:[{content:F.true.value,value:!0},{content:F.false.value,value:!1}]})}),!(A&&W)&&x(y,{children:[b(`div`,{className:`p-3`,children:b(s,{type:`search`,"aria-label":M.ariaLabel.value,placeholder:M.placeholder.value,onChange:e=>U(e.target.value),ref:I})}),b(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:q.map(({locale:e,currentLocaleName:t,ownLocaleName:s})=>b(`li`,{className:`px-1.5 py-1`,children:b(n,{onClick:()=>J(e),label:`${j} ${t}`,disabled:!(R??R).includes(e),isActive:z.includes(e),variant:o.HOVERABLE,color:r.TEXT,isFullWidth:!0,textAlign:a.LEFT,size:i.SM,children:x(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[A&&b(`div`,{className:`w-4`,children:z.includes(e)&&b(g,{className:`size-full`})}),x(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[x(`div`,{className:`flex flex-col text-nowrap`,children:[b(`span`,{dir:w(e),lang:e,children:s}),b(`span`,{className:`text-neutral text-xs`,children:t})]}),b(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})};export{k as LocaleSwitcherContent};
2
2
  //# sourceMappingURL=LocaleSwitcherContent.mjs.map
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../../utils/cn.mjs";import{Link as t}from"../Link/Link.mjs";import{H1 as n,H2 as r,H3 as i,H4 as a,H5 as o,H6 as s}from"../Headers/index.mjs";import{CodeProvider as c}from"../IDE/CodeContext.mjs";import{Code as l}from"../IDE/Code.mjs";import{TabProvider as u}from"../Tab/TabContext.mjs";import{Tab as d}from"../Tab/Tab.mjs";import{Table as f}from"../Table/Table.mjs";import{createContext as p,useContext as m}from"react";import{Fragment as h,jsx as g}from"react/jsx-runtime";import{renderMarkdown as _}from"react-intlayer";const v=p({}),y={h1:e=>g(n,{isClickable:!0,className:`text-text`,...e}),h2:e=>g(r,{isClickable:!0,className:`mt-16 text-text`,...e}),h3:e=>g(i,{isClickable:!0,className:`mt-5 text-text`,...e}),h4:e=>g(a,{isClickable:!0,className:`mt-3 text-text`,...e}),h5:e=>g(o,{isClickable:!0,className:`mt-3 text-text`,...e}),h6:e=>g(s,{isClickable:!0,className:`mt-3 text-text`,...e}),strong:e=>g(`strong`,{className:`text-text`,...e}),code:({className:e,children:t,...n})=>{let{isDarkMode:r}=m(v),i=String(t??``).replace(/\n$/,``);if(!e)return g(`code`,{className:`rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm`,children:i});let a=e?.replace(/lang(?:uage)?-/,``)||`plaintext`;return g(l,{...n,language:a,showHeader:!0,isDarkMode:r,children:i})},blockquote:({className:t,...n})=>g(`blockquote`,{className:e(`mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral`,t),...n}),ul:({className:t,...n})=>g(`ul`,{className:e(`mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80`,t),...n}),ol:({className:t,...n})=>g(`ol`,{className:e(`mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80`,t),...n}),img:({className:t,alt:n,src:r,...i})=>g(`img`,{...i,alt:n??``,loading:`lazy`,className:e(`max-h-[80vh] max-w-full rounded-md`,t),src:`${r}?raw=true`}),a:e=>{let{locale:n}=m(v);return g(t,{isExternalLink:e.href?.startsWith(`http`),underlined:!0,locale:n,label:``,color:`text`,...e})},pre:e=>g(h,{children:e.children}),table:e=>g(f,{isRollable:!0,...e}),th:({className:t,...n})=>g(`th`,{className:e(`border-neutral border-b bg-neutral/10 p-4`,t),...n}),tr:({className:t,...n})=>g(`tr`,{className:e(`hover:/10 hover:bg-neutral/10`,t),...n}),td:({className:t,...n})=>g(`td`,{className:e(`border-neutral-500/50 border-b p-4`,t),...n}),hr:({className:t,...n})=>g(`hr`,{className:e(`mx-6 mt-16 text-neutral`,t),...n}),Tabs:e=>g(d,{...e,className:`rounded-xl border border-card`,headerClassName:`sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto`}),Tab:d.Item,Columns:({className:t,...n})=>g(`div`,{className:e(`flex gap-4 max-md:flex-col`,t),...n}),Column:({className:t,...n})=>g(`div`,{className:e(`flex-1`,t),...n})},b=e=>({components:y}),x=({children:e,isDarkMode:t=!1,locale:n,forceBlock:r,preserveFrontmatter:i,tagfilter:a,components:o,wrapper:s})=>{let l=_(e,{components:{...y,...o},wrapper:s,forceBlock:r,preserveFrontmatter:i,tagfilter:a});return g(v.Provider,{value:{isDarkMode:t,locale:n},children:g(c,{children:g(u,{children:l})})})};export{x as MarkdownRenderer,y as baseMarkdownComponents,b as getIntlayerMarkdownOptions};
1
+ import{cn as e}from"../../utils/cn.mjs";import{Link as t}from"../Link/Link.mjs";import{H1 as n,H2 as r,H3 as i,H4 as a,H5 as o,H6 as s}from"../Headers/index.mjs";import{CodeProvider as c}from"../IDE/CodeContext.mjs";import{Code as l}from"../IDE/Code.mjs";import{TabProvider as u}from"../Tab/TabContext.mjs";import{Tab as d}from"../Tab/Tab.mjs";import{Table as f}from"../Table/Table.mjs";import{Fragment as p,jsx as m}from"react/jsx-runtime";import{renderMarkdown as h}from"react-intlayer";const g=e=>m(n,{isClickable:!0,className:`text-text`,...e}),_=e=>m(r,{isClickable:!0,className:`mt-16 text-text`,...e}),v=e=>m(i,{isClickable:!0,className:`mt-5 text-text`,...e}),y=e=>m(a,{isClickable:!0,className:`mt-3 text-text`,...e}),b=e=>m(o,{isClickable:!0,className:`mt-3 text-text`,...e}),x=e=>m(s,{isClickable:!0,className:`mt-3 text-text`,...e}),S=e=>m(`strong`,{className:`text-text`,...e}),C=e=>({className:t,children:n,...r})=>{let i=String(n??``).replace(/\n$/,``);if(!t)return m(`code`,{className:`rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm`,children:i});let a=t?.replace(/lang(?:uage)?-/,``)||`plaintext`;return m(l,{...r,language:a,showHeader:!0,isDarkMode:e,children:i})},w=({className:t,...n})=>m(`blockquote`,{className:e(`mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral`,t),...n}),T=({className:t,...n})=>m(`ul`,{className:e(`mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80`,t),...n}),E=({className:t,...n})=>m(`ol`,{className:e(`mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80`,t),...n}),D=({className:t,alt:n,src:r,...i})=>m(`img`,{...i,alt:n??``,loading:`lazy`,className:e(`max-h-[80vh] max-w-full rounded-md`,t),src:`${r}?raw=true`}),O=e=>n=>m(t,{isExternalLink:n.href?.startsWith(`http`),underlined:!0,locale:e,label:``,color:`text`,...n}),k={h1:g,h2:_,h3:v,h4:y,h5:b,h6:x,strong:S,blockquote:w,ul:T,ol:E,img:D,pre:e=>m(p,{children:e.children}),table:e=>m(f,{isRollable:!0,...e}),th:({className:t,...n})=>m(`th`,{className:e(`border-neutral border-b bg-neutral/10 p-4`,t),...n}),tr:({className:t,...n})=>m(`tr`,{className:e(`hover:/10 hover:bg-neutral/10`,t),...n}),td:({className:t,...n})=>m(`td`,{className:e(`border-neutral-500/50 border-b p-4`,t),...n}),hr:({className:t,...n})=>m(`hr`,{className:e(`mx-6 mt-16 text-neutral`,t),...n}),Tabs:e=>m(d,{...e,className:`rounded-xl border border-card`,headerClassName:`sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto`}),Tab:d.Item,Columns:({className:t,...n})=>m(`div`,{className:e(`flex gap-4 max-md:flex-col`,t),...n}),Column:({className:t,...n})=>m(`div`,{className:e(`flex-1`,t),...n})},A=(e,t)=>({...k,code:C(e),a:O(t)}),j=k,M=e=>({components:j}),N=({children:e,isDarkMode:t=!1,locale:n,forceBlock:r,preserveFrontmatter:i,tagfilter:a,components:o,wrapper:s})=>m(c,{children:m(u,{children:h(e,{components:{...A(t,n),...o},wrapper:s,forceBlock:r,preserveFrontmatter:i,tagfilter:a})})});export{N as MarkdownRenderer,j as baseMarkdownComponents,M as getIntlayerMarkdownOptions};
2
2
  //# sourceMappingURL=MarkDownRender.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n createContext,\n type FC,\n useContext,\n} from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\n// Context to pass dynamic variables to static components without re-creating them\ninterface MarkdownContextType {\n isDarkMode?: boolean;\n locale?: LocalesValues;\n}\nconst MarkdownContext = createContext<MarkdownContextType>({});\n\n// Extracted, stable component renderers\nconst H1Renderer = (props: ComponentProps<'h1'>) => (\n <H1 isClickable className=\"text-text\" {...props} />\n);\nconst H2Renderer = (props: ComponentProps<'h2'>) => (\n <H2 isClickable className=\"mt-16 text-text\" {...props} />\n);\nconst H3Renderer = (props: ComponentProps<'h3'>) => (\n <H3 isClickable className=\"mt-5 text-text\" {...props} />\n);\nconst H4Renderer = (props: ComponentProps<'h4'>) => (\n <H4 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H5Renderer = (props: ComponentProps<'h5'>) => (\n <H5 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H6Renderer = (props: ComponentProps<'h6'>) => (\n <H6 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst StrongRenderer = (props: ComponentProps<'strong'>) => (\n <strong className=\"text-text\" {...props} />\n);\n\nconst CodeRenderer = ({\n className,\n children,\n ...rest\n}: ComponentProps<'code'>) => {\n const { isDarkMode } = useContext(MarkdownContext);\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm\">\n {content}\n </code>\n );\n }\n\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code {...rest} language={language} showHeader isDarkMode={isDarkMode}>\n {content}\n </Code>\n );\n};\n\nconst BlockquoteRenderer = ({\n className,\n ...props\n}: ComponentProps<'blockquote'>) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n);\n\nconst UlRenderer = ({ className, ...props }: ComponentProps<'ul'>) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst OlRenderer = ({ className, ...props }: ComponentProps<'ol'>) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst ImgRenderer = ({\n className,\n alt,\n src,\n ...props\n}: ComponentProps<'img'>) => (\n <img\n {...props}\n alt={alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${src}?raw=true`}\n />\n);\n\nconst LinkRenderer = (props: ComponentProps<'a'>) => {\n const { locale } = useContext(MarkdownContext);\n return (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined\n locale={locale}\n label=\"\"\n color=\"text\"\n {...(props as any)}\n />\n );\n};\n\nconst PreRenderer = (props: ComponentProps<'pre'>) => <>{props.children}</>;\nconst TableRenderer = (props: ComponentProps<typeof Table>) => (\n <Table isRollable {...props} />\n);\nconst ThRenderer = ({ className, ...props }: ComponentProps<'th'>) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n);\nconst TrRenderer = ({ className, ...props }: ComponentProps<'tr'>) => (\n <tr className={cn('hover:/10 hover:bg-neutral/10', className)} {...props} />\n);\nconst TdRenderer = ({ className, ...props }: ComponentProps<'td'>) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n);\nconst HrRenderer = ({ className, ...props }: ComponentProps<'hr'>) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n);\n\nconst TabsRenderer = (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n);\nconst ColumnsRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n);\nconst ColumnRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n);\n\n// Static configuration object\nexport const baseMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n code: CodeRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\n a: LinkRenderer,\n pre: PreRenderer,\n table: TableRenderer,\n th: ThRenderer,\n tr: TrRenderer,\n td: TdRenderer,\n hr: HrRenderer,\n Tabs: TabsRenderer,\n Tab: Tab.Item,\n Columns: ColumnsRenderer,\n Column: ColumnRenderer,\n};\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions = (_isDarkMode?: boolean) => ({\n components: baseMarkdownComponents,\n});\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode = false,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n // `renderMarkdown` now receives stable object references.\n const markdownContent = renderMarkdown(children, {\n components: {\n ...baseMarkdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <MarkdownContext.Provider value={{ isDarkMode, locale }}>\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n </MarkdownContext.Provider>\n );\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\n// Extracted, stable component renderers\nconst H1Renderer = (props: ComponentProps<'h1'>) => (\n <H1 isClickable className=\"text-text\" {...props} />\n);\nconst H2Renderer = (props: ComponentProps<'h2'>) => (\n <H2 isClickable className=\"mt-16 text-text\" {...props} />\n);\nconst H3Renderer = (props: ComponentProps<'h3'>) => (\n <H3 isClickable className=\"mt-5 text-text\" {...props} />\n);\nconst H4Renderer = (props: ComponentProps<'h4'>) => (\n <H4 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H5Renderer = (props: ComponentProps<'h5'>) => (\n <H5 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H6Renderer = (props: ComponentProps<'h6'>) => (\n <H6 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst StrongRenderer = (props: ComponentProps<'strong'>) => (\n <strong className=\"text-text\" {...props} />\n);\n\nconst createCodeRenderer = (isDarkMode?: boolean) => {\n return ({ className, children, ...rest }: ComponentProps<'code'>) => {\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm\">\n {content}\n </code>\n );\n }\n\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code {...rest} language={language} showHeader isDarkMode={isDarkMode}>\n {content}\n </Code>\n );\n };\n};\n\nconst BlockquoteRenderer = ({\n className,\n ...props\n}: ComponentProps<'blockquote'>) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n);\n\nconst UlRenderer = ({ className, ...props }: ComponentProps<'ul'>) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst OlRenderer = ({ className, ...props }: ComponentProps<'ol'>) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst ImgRenderer = ({\n className,\n alt,\n src,\n ...props\n}: ComponentProps<'img'>) => (\n <img\n {...props}\n alt={alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${src}?raw=true`}\n />\n);\n\nconst createLinkRenderer = (locale?: LocalesValues) => {\n return (props: ComponentProps<'a'>) => (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined\n locale={locale}\n label=\"\"\n color=\"text\"\n {...(props as any)}\n />\n );\n};\n\nconst PreRenderer = (props: ComponentProps<'pre'>) => <>{props.children}</>;\nconst TableRenderer = (props: ComponentProps<typeof Table>) => (\n <Table isRollable {...props} />\n);\nconst ThRenderer = ({ className, ...props }: ComponentProps<'th'>) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n);\nconst TrRenderer = ({ className, ...props }: ComponentProps<'tr'>) => (\n <tr className={cn('hover:/10 hover:bg-neutral/10', className)} {...props} />\n);\nconst TdRenderer = ({ className, ...props }: ComponentProps<'td'>) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n);\nconst HrRenderer = ({ className, ...props }: ComponentProps<'hr'>) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n);\n\nconst TabsRenderer = (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n);\nconst ColumnsRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n);\nconst ColumnRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n);\n\n// Static configuration object for static renderers\nconst staticMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\n pre: PreRenderer,\n table: TableRenderer,\n th: ThRenderer,\n tr: TrRenderer,\n td: TdRenderer,\n hr: HrRenderer,\n Tabs: TabsRenderer,\n Tab: Tab.Item,\n Columns: ColumnsRenderer,\n Column: ColumnRenderer,\n};\n\n// Factory function to create components with dynamic props\nconst createMarkdownComponents = (\n isDarkMode?: boolean,\n locale?: LocalesValues\n) => ({\n ...staticMarkdownComponents,\n code: createCodeRenderer(isDarkMode),\n a: createLinkRenderer(locale),\n});\n\n// Export static renderers for backward compatibility\nexport const baseMarkdownComponents = staticMarkdownComponents;\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions = (_isDarkMode?: boolean) => ({\n components: baseMarkdownComponents,\n});\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode = false,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n // Generate components with props bound to them\n const markdownComponents = createMarkdownComponents(isDarkMode, locale);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0,...c})=>t(`div`,{"aria-hidden":o?r:void 0,tabIndex:o?0:void 0,role:o?`button`:`none`,className:e(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-[grid-template-rows] duration-500 ease-in-out`,r!==void 0&&!r&&`grid-rows-[1fr] overflow-x-auto`,a&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,o&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,i),...c,children:t(`div`,{style:{minHeight:`${s}px`},className:`min-h-0 overflow-hidden`,children:n})});export{n as MaxHeightSmoother};
1
+ import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0,...c})=>t(`div`,{"aria-hidden":o?r:void 0,tabIndex:o?0:void 0,role:o?`button`:`none`,className:e(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out`,r!==void 0&&!r&&`grid-rows-[1fr] overflow-x-auto`,a&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,o&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,i),...c,children:t(`div`,{style:{minHeight:`${s}px`},className:e(a&&`group-hover/height-smoother:visible`,o&&`group-focus/height-smoother:visible`,i),children:n})});export{n as MaxHeightSmoother};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-[grid-template-rows] duration-500 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className=\"min-h-0 overflow-hidden\"\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":"gFAmKA,MAAa,GAAiD,CAC5D,WACA,WACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,YAAY,EACZ,GAAG,KAEH,EAAC,MAAD,CACE,cAAa,EAAc,EAAW,IAAA,GACtC,SAAU,EAAc,EAAI,IAAA,GAC5B,KAAM,EAAc,SAAW,OAC/B,UAAW,EACT,sIACO,IAAa,QAClB,CAAC,GACD,kCACF,GAAc,8CACd,GACE,wGACF,EACD,CACD,GAAI,WAEJ,EAAC,MAAD,CACE,MAAO,CACL,UAAW,GAAG,EAAU,IACzB,CACD,UAAU,0BAET,WACG,CAAA,CACF,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className={cn(\n isOverable && 'group-hover/height-smoother:visible',\n isFocusable && 'group-focus/height-smoother:visible',\n className\n )}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":"gFAmKA,MAAa,GAAiD,CAC5D,WACA,WACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,YAAY,EACZ,GAAG,KAEH,EAAC,MAAD,CACE,cAAa,EAAc,EAAW,IAAA,GACtC,SAAU,EAAc,EAAI,IAAA,GAC5B,KAAM,EAAc,SAAW,OAC/B,UAAW,EACT,qHACO,IAAa,QAClB,CAAC,GACD,kCACF,GAAc,8CACd,GACE,wGACF,EACD,CACD,GAAI,WAEJ,EAAC,MAAD,CACE,MAAO,CACL,UAAW,GAAG,EAAU,IACzB,CACD,UAAW,EACT,GAAc,sCACd,GAAe,sCACf,EACD,CAEA,WACG,CAAA,CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Container as t}from"../Container/index.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonVariant as a}from"../Button/Button.mjs";import{H3 as o}from"../Headers/index.mjs";import{useGetElementOrWindow as s}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as c}from"../../hooks/useScrollBlockage/index.mjs";import{useEffect as l}from"react";import{cva as u}from"class-variance-authority";import{X as d}from"lucide-react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{motion as h}from"framer-motion";import{createPortal as g}from"react-dom";let _=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e.XL=`xl`,e.UNSET=`unset`,e}({});const v=u(`flex cursor-default flex-col overflow-hidden shadow-sm`,{variants:{size:{sm:`h-auto max-h-[30vh] w-[95vw] max-w-xl`,md:`h-auto max-h-[50vh] w-[95vw] max-w-xl`,lg:`h-auto max-h-[70vh] w-[95vw] max-w-4xl`,xl:`h-auto max-h-[95vh] w-[95vw] max-w-6xl`,unset:`h-auto max-h-[95vh] w-[95vw]`}},defaultVariants:{size:`unset`}}),y={none:`p-0`,sm:`px-2 py-4`,md:`px-4 py-6`,lg:`px-6 py-8`,xl:`px-8 py-10`,"2xl":`px-10 py-12`},b=h.create(t),x=({children:t,isOpen:u,container:x,onClose:S,hasCloseButton:C=!1,title:w,size:T=_.MD,className:E,isScrollable:D=!1,disableScroll:O=!0,padding:k=`none`,...A})=>{let j=s(x);if(c({key:`modal`,disableScroll:u&&O}),l(()=>{let e=e=>{e.key===`Escape`&&u&&S&&S()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,S]),!j)return p(f,{});let M=!!w,N=y[k||`none`];return g(p(h.div,{className:`invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-hidden bg-background/40 backdrop-blur`,animate:u?`visible`:`invisible`,variants:{visible:{opacity:1,visibility:`visible`,transition:{duration:.1,when:`beforeChildren`}},invisible:{opacity:0,visibility:`hidden`,transition:{duration:.1,when:`afterChildren`}}},onClick:e=>{e.stopPropagation(),S?.()},"aria-hidden":!u,children:m(b,{onClick:e=>e.stopPropagation(),initial:{scale:u?.5:1},animate:{scale:u?1:.5},transition:{duration:.3},className:v({size:T,className:E}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...A,children:[m(`div`,{className:e(`relative flex-none px-4 pt-4`,C&&M?`flex items-start`:C?`flex justify-end`:M?`items-center`:`hidden`),children:[M&&p(o,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:w}),C&&p(n,{variant:a.HOVERABLE,color:r.TEXT,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),S?.()},Icon:d,size:i.ICON_MD})]}),p(`div`,{className:e(`flex min-h-0 w-full flex-1 flex-col`,D===!0&&`overflow-auto`,D===`y`&&`overflow-y-auto overflow-x-hidden`,D===`x`&&`overflow-x-auto overflow-y-hidden`,!D&&`overflow-visible`),children:p(`div`,{className:e(`flex h-full w-full flex-1 flex-col`,N),children:t})})]})}),j)};export{x as Modal,_ as ModalSize};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{useGetElementOrWindow as t}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as n}from"../../hooks/useScrollBlockage/index.mjs";import{Container as r}from"../Container/index.mjs";import{Button as i,ButtonColor as a,ButtonSize as o,ButtonVariant as s}from"../Button/Button.mjs";import{H3 as c}from"../Headers/index.mjs";import{useEffect as l}from"react";import{cva as u}from"class-variance-authority";import{X as d}from"lucide-react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{motion as h}from"framer-motion";import{createPortal as g}from"react-dom";let _=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e.XL=`xl`,e.UNSET=`unset`,e}({});const v=u(`flex cursor-default flex-col overflow-hidden shadow-sm`,{variants:{size:{sm:`h-auto max-h-[30vh] w-[95vw] max-w-xl`,md:`h-auto max-h-[50vh] w-[95vw] max-w-xl`,lg:`h-auto max-h-[70vh] w-[95vw] max-w-4xl`,xl:`h-auto max-h-[95vh] w-[95vw] max-w-6xl`,unset:`h-auto max-h-[95vh] w-[95vw]`}},defaultVariants:{size:`unset`}}),y={none:`p-0`,sm:`px-2 py-4`,md:`px-4 py-6`,lg:`px-6 py-8`,xl:`px-8 py-10`,"2xl":`px-10 py-12`},b=h.create(r),x=({children:r,isOpen:u,container:x,onClose:S,hasCloseButton:C=!1,title:w,size:T=_.MD,className:E,isScrollable:D=!1,disableScroll:O=!0,padding:k=`none`,...A})=>{let j=t(x);if(n({key:`modal`,disableScroll:u&&O}),l(()=>{let e=e=>{e.key===`Escape`&&u&&S&&S()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,S]),!j)return p(f,{});let M=!!w,N=y[k||`none`];return g(p(h.div,{className:`invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-hidden bg-background/40 backdrop-blur`,animate:u?`visible`:`invisible`,variants:{visible:{opacity:1,visibility:`visible`,transition:{duration:.1,when:`beforeChildren`}},invisible:{opacity:0,visibility:`hidden`,transition:{duration:.1,when:`afterChildren`}}},onClick:e=>{e.stopPropagation(),S?.()},"aria-hidden":!u,children:m(b,{onClick:e=>e.stopPropagation(),initial:{scale:u?.5:1},animate:{scale:u?1:.5},transition:{duration:.3},className:v({size:T,className:E}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...A,children:[m(`div`,{className:e(`relative flex-none px-4 pt-4`,C&&M?`flex items-start`:C?`flex justify-end`:M?`items-center`:`hidden`),children:[M&&p(c,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:w}),C&&p(i,{variant:s.HOVERABLE,color:a.TEXT,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),S?.()},Icon:d,size:o.ICON_MD})]}),p(`div`,{className:e(`flex min-h-0 w-full flex-1 flex-col`,D===!0&&`overflow-auto`,D===`y`&&`overflow-y-auto overflow-x-hidden`,D===`x`&&`overflow-x-auto overflow-y-hidden`,!D&&`overflow-visible`),children:p(`div`,{className:e(`flex h-full w-full flex-1 flex-col`,N),children:r})})]})}),j)};export{x as Modal,_ as ModalSize};
2
2
  //# sourceMappingURL=Modal.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{MaxHeightSmoother as t}from"../MaxHeightSmoother/index.mjs";import{useScrollBlockage as n}from"../../hooks/useScrollBlockage/index.mjs";import{useScrollDetection as r}from"../../hooks/useScrollDetection.mjs";import{Burger as i}from"./Burger.mjs";import{useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{m as l}from"framer-motion";const u={open:{transition:{staggerChildren:.07,delayChildren:.2}},closed:{transition:{staggerChildren:.05,staggerDirection:-1}}},d=`bg-card/95 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur`,f=({logo:f,topChildren:p,topSections:m=[],bottomChildren:h,bottomSections:g=[],rightItems:_,rollable:v=!0})=>{let[y,b]=o(!1),[x,S]=o(!1),C=a(null);n({disableScroll:v,key:`mobile_nav`}),r({onScrollUp:()=>b(!1),onScrollDown:()=>b(!0),isEnabled:!x&&v});let w=y?0:C.current?.clientHeight??0,T=m.length+g.length>0;return c(`nav`,{className:e(d,`sticky top-0 z-50 flex w-screen flex-col transition`,y?`-translate-y-full`:`translate-y-0`),id:`mobile-menu`,children:[c(`div`,{className:`flex w-full items-center justify-between gap-1 px-4 py-3 md:gap-[10vw]`,ref:C,children:[f,c(`div`,{className:`flex w-full flex-1 items-center justify-end gap-6`,children:[s(`div`,{className:`flex w-full items-center justify-end gap-1`,children:_}),T&&s(i,{isActive:x,onClick:()=>S(e=>!e)})]})]}),s(`div`,{className:e(d,`absolute bottom-0 left-0 w-full translate-y-full`),children:s(t,{isHidden:!x,children:c(l.div,{className:`flex w-full flex-col pt-10 pb-[20%] text-lg text-text tracking-wide`,onClick:()=>S(!1),animate:x?`open`:`closed`,variants:u,style:{height:`calc(100vh - ${w}px)`},children:[p,c(`div`,{className:`flex h-full flex-col justify-center`,children:[m,g]}),s(`div`,{className:`m-auto flex w-full max-w-[400px] items-center justify-center gap-1 px-5 py-3`,children:h})]})})})]})};export{f as MobileNavbar};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{useScrollBlockage as t}from"../../hooks/useScrollBlockage/index.mjs";import{useScrollDetection as n}from"../../hooks/useScrollDetection.mjs";import{MaxHeightSmoother as r}from"../MaxHeightSmoother/index.mjs";import{Burger as i}from"./Burger.mjs";import{useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{m as l}from"framer-motion";const u={open:{transition:{staggerChildren:.07,delayChildren:.2}},closed:{transition:{staggerChildren:.05,staggerDirection:-1}}},d=`bg-card/95 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur`,f=({logo:f,topChildren:p,topSections:m=[],bottomChildren:h,bottomSections:g=[],rightItems:_,rollable:v=!0})=>{let[y,b]=o(!1),[x,S]=o(!1),C=a(null);t({disableScroll:v,key:`mobile_nav`}),n({onScrollUp:()=>b(!1),onScrollDown:()=>b(!0),isEnabled:!x&&v});let w=y?0:C.current?.clientHeight??0,T=m.length+g.length>0;return c(`nav`,{className:e(d,`sticky top-0 z-50 flex w-screen flex-col transition`,y?`-translate-y-full`:`translate-y-0`),id:`mobile-menu`,children:[c(`div`,{className:`flex w-full items-center justify-between gap-1 px-4 py-3 md:gap-[10vw]`,ref:C,children:[f,c(`div`,{className:`flex w-full flex-1 items-center justify-end gap-6`,children:[s(`div`,{className:`flex w-full items-center justify-end gap-1`,children:_}),T&&s(i,{isActive:x,onClick:()=>S(e=>!e)})]})]}),s(`div`,{className:e(d,`absolute bottom-0 left-0 w-full translate-y-full`),children:s(r,{isHidden:!x,children:c(l.div,{className:`flex w-full flex-col pt-10 pb-[20%] text-lg text-text tracking-wide`,onClick:()=>S(!1),animate:x?`open`:`closed`,variants:u,style:{height:`calc(100vh - ${w}px)`},children:[p,c(`div`,{className:`flex h-full flex-col justify-center`,children:[m,g]}),s(`div`,{className:`m-auto flex w-full max-w-[400px] items-center justify-center gap-1 px-5 py-3`,children:h})]})})})]})};export{f as MobileNavbar};
2
2
  //# sourceMappingURL=MobileNavbar.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useItemSelector as a}from"../../hooks/useItemSelector.mjs";import{useEffect as o,useRef as s}from"react";import{cva as c}from"class-variance-authority";import{ChevronLeft as l,ChevronRight as u,MoreHorizontal as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=c(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`,destructive:`background-destructive`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}});let h=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({}),g=function(e){return e.DEFAULT=`default`,e.BORDERED=`bordered`,e.GHOST=`ghost`,e}({});const _=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},v=e=>e?.getAttribute(`aria-current`)===`true`,y=e=>e===h.SM?r.ICON_SM:e===h.LG?r.ICON_LG:r.ICON_MD,b=e=>f(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),x=({currentPage:r,totalPages:c,onPageChange:x,showFirstLast:S=!1,showPrevNext:C=!0,maxVisiblePages:w=5,disabled:T=!1,size:E=h.MD,variant:D=g.DEFAULT,color:O=n.TEXT,className:k,...A})=>{let j=_(r,c,w),M=y(E),N=r===1,P=r===c,F=s([]),I=s(null),{choiceIndicatorPosition:L,calculatePosition:R}=a(F,{selector:v,isHoverable:!0});if(o(()=>{let e=setTimeout(()=>{R()},300);return()=>clearTimeout(e)},[r,R]),c<=1)return null;let z=e=>{!T&&e>=1&&e<=c&&e!==r&&x(e)};return f(`div`,{className:e(m({size:E,variant:D}),k),...A,children:p(`div`,{className:`relative flex items-center gap-1`,children:[L&&f(b,{style:L,ref:I}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r-1),disabled:T||N,label:`Go to previous page`,Icon:l,ref:e=>{e&&(F.current[0]=e)},className:`min-w-0 px-2`}),f(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:j.map((a,o)=>{if(a===`ellipsis`)return f(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:f(d,{className:`h-4 w-4 text-muted-foreground`})},`ellipsis-${a}-${o}`);let s=a===r,c=(C?1:0)+j.slice(0,o).filter(e=>e!==`ellipsis`).length;return f(t,{variant:s?i.DEFAULT:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(a),disabled:T,label:`Go to page ${a}`,"aria-current":s?`true`:`false`,ref:e=>{e&&(F.current[c]=e)},className:e(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,E===`sm`&&`h-6 w-6 text-xs`,E===`lg`&&`h-10 w-10 text-base`,s&&`font-semibold`),children:a},a)})}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r+1),disabled:T||P,label:`Go to next page`,Icon:u,ref:e=>{let t=(C?1:0)+j.filter(e=>e!==`ellipsis`).length;e&&(F.current[t]=e)},className:`min-w-0 px-2`})]})})};export{x as Pagination,h as PaginationSize,g as PaginationVariant,m as paginationVariants};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{useItemSelector as t}from"../../hooks/useItemSelector.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonVariant as a}from"../Button/Button.mjs";import{useEffect as o,useRef as s}from"react";import{cva as c}from"class-variance-authority";import{ChevronLeft as l,ChevronRight as u,MoreHorizontal as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=c(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`,destructive:`background-destructive`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}});let h=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({}),g=function(e){return e.DEFAULT=`default`,e.BORDERED=`bordered`,e.GHOST=`ghost`,e}({});const _=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},v=e=>e?.getAttribute(`aria-current`)===`true`,y=e=>e===h.SM?i.ICON_SM:e===h.LG?i.ICON_LG:i.ICON_MD,b=e=>f(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),x=({currentPage:i,totalPages:c,onPageChange:x,showFirstLast:S=!1,showPrevNext:C=!0,maxVisiblePages:w=5,disabled:T=!1,size:E=h.MD,variant:D=g.DEFAULT,color:O=r.TEXT,className:k,...A})=>{let j=_(i,c,w),M=y(E),N=i===1,P=i===c,F=s([]),I=s(null),{choiceIndicatorPosition:L,calculatePosition:R}=t(F,{selector:v,isHoverable:!0});if(o(()=>{let e=setTimeout(()=>{R()},300);return()=>clearTimeout(e)},[i,R]),c<=1)return null;let z=e=>{!T&&e>=1&&e<=c&&e!==i&&x(e)};return f(`div`,{className:e(m({size:E,variant:D}),k),...A,children:p(`div`,{className:`relative flex items-center gap-1`,children:[L&&f(b,{style:L,ref:I}),C&&f(n,{variant:a.OUTLINE,size:M,color:r.TEXT,onClick:()=>z(i-1),disabled:T||N,label:`Go to previous page`,Icon:l,ref:e=>{e&&(F.current[0]=e)},className:`min-w-0 px-2`}),f(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:j.map((t,o)=>{if(t===`ellipsis`)return f(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:f(d,{className:`h-4 w-4 text-muted-foreground`})},`ellipsis-${t}-${o}`);let s=t===i,c=(C?1:0)+j.slice(0,o).filter(e=>e!==`ellipsis`).length;return f(n,{variant:s?a.DEFAULT:a.OUTLINE,size:M,color:r.TEXT,onClick:()=>z(t),disabled:T,label:`Go to page ${t}`,"aria-current":s?`true`:`false`,ref:e=>{e&&(F.current[c]=e)},className:e(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,E===`sm`&&`h-6 w-6 text-xs`,E===`lg`&&`h-10 w-10 text-base`,s&&`font-semibold`),children:t},t)})}),C&&f(n,{variant:a.OUTLINE,size:M,color:r.TEXT,onClick:()=>z(i+1),disabled:T||P,label:`Go to next page`,Icon:u,ref:e=>{let t=(C?1:0)+j.filter(e=>e!==`ellipsis`).length;e&&(F.current[t]=e)},className:`min-w-0 px-2`})]})})};export{x as Pagination,h as PaginationSize,g as PaginationVariant,m as paginationVariants};
2
2
  //# sourceMappingURL=Pagination.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useDevice as a}from"../../hooks/useDevice.mjs";import{KeyboardShortcut as o}from"../KeyboardShortcut/KeyboardShortcut.mjs";import{Popover as s}from"../Popover/dynamic.mjs";import{useGetElementOrWindow as c}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as l}from"../../hooks/useScrollBlockage/index.mjs";import{MaxWidthSmoother as u}from"../MaxWidthSmoother/index.mjs";import{isElementAtTopAndNotCovered as d}from"./isElementAtTopAndNotCovered.mjs";import{useRightDrawer as f}from"./useRightDrawer.mjs";import{useEffect as p,useRef as m}from"react";import{ChevronLeft as h,X as g}from"lucide-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useIntlayer as b}from"react-intlayer";import{createPortal as x}from"react-dom";const S=({title:S,identifier:C,children:w,header:T,footer:E,closeOnOutsideClick:D=!0,backButton:O,isOpen:k,onClose:A,container:j})=>{let M=b(`right-drawer`),{isMobile:N}=a(`md`),P=m(null),F=m(null),I=c(j),{open:L,close:R,isOpen:z}=f(),B=z(C),V=B;l({disableScroll:V,key:C?`right_drawer_${C}`:`right_drawer`}),p(()=>{let e=e=>{try{if(!P.current)return;let t=V&&D,n=e.target&&!P.current.contains(e.target),r=d(P.current);(t&&n&&r||!e.target)&&(R(C),A?.())}catch{R(C),A?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[V,R,A,D,C]);let H=m(A);return p(()=>{H.current=A},[A]),p(()=>{k!==void 0&&k!==B&&(k?L(C):(R(C),H.current?.()))},[k,B,C,L,R]),I?x(v(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:v(u,{isHidden:!V,align:`right`,children:y(e,{className:`relative flex h-screen w-screen flex-col text-text md:w-[400px]`,ref:P,roundedSize:`none`,children:[y(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[y(`div`,{className:`flex justify-between gap-3`,children:[v(`div`,{children:O&&v(t,{variant:i.HOVERABLE,color:n.TEXT,label:O.text??M.goBack.value,onClick:O.onBack,Icon:h,children:O?.text})}),v(`div`,{children:y(s,{identifier:`close-drawer`,children:[v(t,{variant:i.HOVERABLE,color:n.TEXT,label:`Close`,className:`ml-auto`,onClick:()=>{R(C),A?.()},Icon:g,size:r.ICON_MD}),v(s.Detail,{identifier:`close-drawer`,children:y(`div`,{className:`flex items-center gap-2 p-2`,children:[v(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:M.closeDrawer}),v(o,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{R(C),A?.()}})]})})]})})]}),S&&v(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:S}),T]}),v(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:v(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&N&&(R(C),A?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N&&(R(C),A?.()))},ref:F,role:`button`,tabIndex:0,children:w})}),E&&v(`div`,{className:`shrink-0`,children:E})]})})}),I):v(_,{})};export{S as RightDrawer};
1
+ "use client";import{useGetElementOrWindow as e}from"../../hooks/useGetElementOrWindow.mjs";import{useDevice as t}from"../../hooks/useDevice.mjs";import{useScrollBlockage as n}from"../../hooks/useScrollBlockage/index.mjs";import{Container as r}from"../Container/index.mjs";import{Button as i,ButtonColor as a,ButtonSize as o,ButtonVariant as s}from"../Button/Button.mjs";import{KeyboardShortcut as c}from"../KeyboardShortcut/KeyboardShortcut.mjs";import{Popover as l}from"../Popover/dynamic.mjs";import{MaxWidthSmoother as u}from"../MaxWidthSmoother/index.mjs";import{isElementAtTopAndNotCovered as d}from"./isElementAtTopAndNotCovered.mjs";import{useRightDrawer as f}from"./useRightDrawer.mjs";import{useEffect as p,useRef as m}from"react";import{ChevronLeft as h,X as g}from"lucide-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useIntlayer as b}from"react-intlayer";import{createPortal as x}from"react-dom";const S=({title:S,identifier:C,children:w,header:T,footer:E,closeOnOutsideClick:D=!0,backButton:O,isOpen:k,onClose:A,container:j})=>{let M=b(`right-drawer`),{isMobile:N}=t(`md`),P=m(null),F=m(null),I=e(j),{open:L,close:R,isOpen:z}=f(),B=z(C),V=B;n({disableScroll:V,key:C?`right_drawer_${C}`:`right_drawer`}),p(()=>{let e=e=>{try{if(!P.current)return;let t=V&&D,n=e.target&&!P.current.contains(e.target),r=d(P.current);(t&&n&&r||!e.target)&&(R(C),A?.())}catch{R(C),A?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[V,R,A,D,C]);let H=m(A);return p(()=>{H.current=A},[A]),p(()=>{k!==void 0&&k!==B&&(k?L(C):(R(C),H.current?.()))},[k,B,C,L,R]),I?x(v(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:v(u,{isHidden:!V,align:`right`,children:y(r,{className:`relative flex h-screen w-screen flex-col text-text md:w-[400px]`,ref:P,roundedSize:`none`,children:[y(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[y(`div`,{className:`flex justify-between gap-3`,children:[v(`div`,{children:O&&v(i,{variant:s.HOVERABLE,color:a.TEXT,label:O.text??M.goBack.value,onClick:O.onBack,Icon:h,children:O?.text})}),v(`div`,{children:y(l,{identifier:`close-drawer`,children:[v(i,{variant:s.HOVERABLE,color:a.TEXT,label:`Close`,className:`ml-auto`,onClick:()=>{R(C),A?.()},Icon:g,size:o.ICON_MD}),v(l.Detail,{identifier:`close-drawer`,children:y(`div`,{className:`flex items-center gap-2 p-2`,children:[v(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:M.closeDrawer}),v(c,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{R(C),A?.()}})]})})]})})]}),S&&v(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:S}),T]}),v(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:v(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&N&&(R(C),A?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N&&(R(C),A?.()))},ref:F,role:`button`,tabIndex:0,children:w})}),E&&v(`div`,{className:`shrink-0`,children:E})]})})}),I):v(_,{})};export{S as RightDrawer};
2
2
  //# sourceMappingURL=RightDrawer.mjs.map
@@ -1 +1 @@
1
- import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditScan as E,useAuditTag as D,useAutocomplete as O,useBitbucketAuth as k,useBitbucketCheckConfig as A,useBitbucketGetConfigFile as j,useBitbucketRepos as M,useCancelSubscription as N,useChangePassword as P,useCreateUser as F,useDeleteAccessKey as I,useDeleteDictionary as L,useDeleteOrganization as R,useDeletePasskey as z,useDeleteProject as B,useDeleteSSOProvider as V,useDeleteShowcaseProject as H,useDeleteTag as U,useDeleteUser as W,useDisableTwoFactor as G,useEnableTwoFactor as K,useGetCIConfig as q,useGetDictionaries as J,useGetDictionariesKeys as Y,useGetDictionary as X,useGetDiscussions as Z,useGetDiscussionsData as Q,useGetEditorDictionaries as $,useGetNewsletterStatus as ee,useGetOrganizations as te,useGetOtherShowcaseProjects as ne,useGetPricing as re,useGetProjects as ie,useGetRecursiveAuditStatus as ae,useGetShowcaseProjectById as oe,useGetShowcaseProjects as se,useGetSubscription as ce,useGetTags as le,useGetUserByAccount as ue,useGetUserById as de,useGetUsers as fe,useGetVerifyEmailStatus as pe,useGithubAuth as me,useGithubCheckConfig as he,useGithubGetAuthUrl as ge,useGithubGetConfigFile as _e,useGithubRepos as ve,useGitlabAuth as ye,useGitlabCheckConfig as be,useGitlabGetConfigFile as xe,useGitlabProjects as Se,useInfiniteGetDictionaries as Ce,useListPasskeys as we,useListSSOProviders as Te,useLogin as Ee,useLogout as De,usePushCIConfig as Oe,usePushDictionaries as ke,useQueryClient as Ae,useRefreshAccessKey as je,useRegister as Me,useRegisterSSO as Ne,useResetPassword as Pe,useSearchDoc as Fe,useSelectOrganization as Ie,useSelectProject as Le,useSignInMagicLink as Re,useSignInPasskey as ze,useSignInSSO as Be,useStartRecursiveAudit as Ve,useSubmitShowcaseProject as He,useSubscribeToNewsletter as Ue,useToggleShowcaseDownvote as We,useToggleShowcaseUpvote as Ge,useTranslateJSONDeclaration as Ke,useTriggerBuild as qe,useTriggerWebhook as Je,useUnselectOrganization as Ye,useUnselectProject as Xe,useUnsubscribeFromNewsletter as Ze,useUpdateDictionary as Qe,useUpdateOrganization as $e,useUpdateOrganizationMembers as et,useUpdateOrganizationMembersById as tt,useUpdateProject as nt,useUpdateProjectMembers as rt,useUpdateShowcaseProject as it,useUpdateTag as at,useUpdateUser as ot,useVerifyBackupCode as st,useVerifyEmail as ct,useVerifyTotp as lt,useWriteDictionary as ut}from"./reactQuery.mjs";import{usePersistedStore as dt}from"./usePersistedStore.mjs";import{useItemSelector as ft}from"./useItemSelector.mjs";import{useUser as pt}from"./useUser/index.mjs";import{useHorizontalSwipe as mt}from"./useHorizontalSwipe.mjs";import{useGetElementById as ht}from"./useGetElementById.mjs";import{useGetElementOrWindow as gt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as _t}from"./useIsDarkMode.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useKeyboardDetector as yt}from"./useKeyboardDetector.mjs";import{useScreenWidth as bt}from"./useScreenWidth.mjs";import{useScrollBlockage as xt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as St}from"./useScrollDetection.mjs";import{useScrollY as Ct}from"./useScrollY.mjs";import{useSearch as wt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditScan,D as useAuditTag,u as useAuth,O as useAutocomplete,k as useBitbucketAuth,A as useBitbucketCheckConfig,j as useBitbucketGetConfigFile,M as useBitbucketRepos,N as useCancelSubscription,P as useChangePassword,F as useCreateUser,I as useDeleteAccessKey,L as useDeleteDictionary,R as useDeleteOrganization,z as useDeletePasskey,B as useDeleteProject,V as useDeleteSSOProvider,H as useDeleteShowcaseProject,U as useDeleteTag,W as useDeleteUser,s as useDevice,G as useDisableTwoFactor,K as useEnableTwoFactor,q as useGetCIConfig,J as useGetDictionaries,Y as useGetDictionariesKeys,X as useGetDictionary,Z as useGetDiscussions,Q as useGetDiscussionsData,$ as useGetEditorDictionaries,ht as useGetElementById,gt as useGetElementOrWindow,ee as useGetNewsletterStatus,te as useGetOrganizations,ne as useGetOtherShowcaseProjects,re as useGetPricing,ie as useGetProjects,ae as useGetRecursiveAuditStatus,oe as useGetShowcaseProjectById,se as useGetShowcaseProjects,ce as useGetSubscription,le as useGetTags,ue as useGetUserByAccount,de as useGetUserById,fe as useGetUsers,pe as useGetVerifyEmailStatus,me as useGithubAuth,he as useGithubCheckConfig,ge as useGithubGetAuthUrl,_e as useGithubGetConfigFile,ve as useGithubRepos,ye as useGitlabAuth,be as useGitlabCheckConfig,xe as useGitlabGetConfigFile,Se as useGitlabProjects,mt as useHorizontalSwipe,Ce as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,_t as useIsDarkMode,vt as useIsMounted,ft as useItemSelector,yt as useKeyboardDetector,we as useListPasskeys,Te as useListSSOProviders,Ee as useLogin,De as useLogout,c as useOAuth2,dt as usePersistedStore,Oe as usePushCIConfig,ke as usePushDictionaries,Ae as useQueryClient,je as useRefreshAccessKey,Me as useRegister,Ne as useRegisterSSO,Pe as useResetPassword,bt as useScreenWidth,xt as useScrollBlockage,St as useScrollDetection,Ct as useScrollY,wt as useSearch,Fe as useSearchDoc,Ie as useSelectOrganization,Le as useSelectProject,l as useSession,Re as useSignInMagicLink,ze as useSignInPasskey,Be as useSignInSSO,Ve as useStartRecursiveAudit,He as useSubmitShowcaseProject,Ue as useSubscribeToNewsletter,We as useToggleShowcaseDownvote,Ge as useToggleShowcaseUpvote,Ke as useTranslateJSONDeclaration,qe as useTriggerBuild,Je as useTriggerWebhook,Ye as useUnselectOrganization,Xe as useUnselectProject,Ze as useUnsubscribeFromNewsletter,Qe as useUpdateDictionary,$e as useUpdateOrganization,et as useUpdateOrganizationMembers,tt as useUpdateOrganizationMembersById,nt as useUpdateProject,rt as useUpdateProjectMembers,it as useUpdateShowcaseProject,at as useUpdateTag,ot as useUpdateUser,pt as useUser,st as useVerifyBackupCode,ct as useVerifyEmail,lt as useVerifyTotp,ut as useWriteDictionary};
1
+ import{useKeyboardDetector as e}from"./useKeyboardDetector.mjs";import{useGetElementOrWindow as t}from"./useGetElementOrWindow.mjs";import{useScrollY as n}from"./useScrollY.mjs";import{usePersistedStore as r}from"./usePersistedStore.mjs";import{useHorizontalSwipe as i}from"./useHorizontalSwipe.mjs";import{useItemSelector as a}from"./useItemSelector.mjs";import{calculateIsMobile as o,checkIsIOS as s,checkIsIphoneOrSafariDevice as c,checkIsMac as l,checkIsMobileScreen as u,checkIsMobileUserAgent as d,getBreakpointFromSize as f,useDevice as p}from"./useDevice.mjs";import{useOAuth2 as m}from"./useAuth/useOAuth2.mjs";import{useSession as h}from"./useAuth/useSession.mjs";import{useAuth as g}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as _,useIntlayerOAuth as v}from"./useIntlayerAPI.mjs";import{useAddDictionary as y,useAddNewAccessKey as b,useAddOrganization as x,useAddOrganizationMember as S,useAddPasskey as C,useAddProject as w,useAddTag as T,useAppQuery as E,useAskDocQuestion as D,useAskResetPassword as O,useAuditContentDeclaration as k,useAuditContentDeclarationField as A,useAuditContentDeclarationMetadata as j,useAuditScan as M,useAuditTag as N,useAutocomplete as P,useBitbucketAuth as F,useBitbucketCheckConfig as I,useBitbucketGetConfigFile as L,useBitbucketRepos as R,useCancelSubscription as z,useChangePassword as B,useCreateUser as V,useDeleteAccessKey as H,useDeleteDictionary as U,useDeleteOrganization as W,useDeletePasskey as G,useDeleteProject as K,useDeleteSSOProvider as q,useDeleteShowcaseProject as J,useDeleteTag as Y,useDeleteUser as X,useDisableTwoFactor as Z,useEnableTwoFactor as Q,useGetCIConfig as $,useGetDictionaries as ee,useGetDictionariesKeys as te,useGetDictionary as ne,useGetDiscussions as re,useGetDiscussionsData as ie,useGetEditorDictionaries as ae,useGetNewsletterStatus as oe,useGetOrganizations as se,useGetOtherShowcaseProjects as ce,useGetPricing as le,useGetProjects as ue,useGetRecursiveAuditStatus as de,useGetShowcaseProjectById as fe,useGetShowcaseProjects as pe,useGetSubscription as me,useGetTags as he,useGetUserByAccount as ge,useGetUserById as _e,useGetUsers as ve,useGetVerifyEmailStatus as ye,useGithubAuth as be,useGithubCheckConfig as xe,useGithubGetAuthUrl as Se,useGithubGetConfigFile as Ce,useGithubRepos as we,useGitlabAuth as Te,useGitlabCheckConfig as Ee,useGitlabGetConfigFile as De,useGitlabProjects as Oe,useInfiniteGetDictionaries as ke,useListPasskeys as Ae,useListSSOProviders as je,useLogin as Me,useLogout as Ne,usePushCIConfig as Pe,usePushDictionaries as Fe,useQueryClient as Ie,useRefreshAccessKey as Le,useRegister as Re,useRegisterSSO as ze,useResetPassword as Be,useSearchDoc as Ve,useSelectOrganization as He,useSelectProject as Ue,useSignInMagicLink as We,useSignInPasskey as Ge,useSignInSSO as Ke,useStartRecursiveAudit as qe,useSubmitShowcaseProject as Je,useSubscribeToNewsletter as Ye,useToggleShowcaseDownvote as Xe,useToggleShowcaseUpvote as Ze,useTranslateJSONDeclaration as Qe,useTriggerBuild as $e,useTriggerWebhook as et,useUnselectOrganization as tt,useUnselectProject as nt,useUnsubscribeFromNewsletter as rt,useUpdateDictionary as it,useUpdateOrganization as at,useUpdateOrganizationMembers as ot,useUpdateOrganizationMembersById as st,useUpdateProject as ct,useUpdateProjectMembers as lt,useUpdateShowcaseProject as ut,useUpdateTag as dt,useUpdateUser as ft,useVerifyBackupCode as pt,useVerifyEmail as mt,useVerifyTotp as ht,useWriteDictionary as gt}from"./reactQuery.mjs";import{useSearch as _t}from"./useSearch.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useGetElementById as yt}from"./useGetElementById.mjs";import{useIsDarkMode as bt}from"./useIsDarkMode.mjs";import{useScreenWidth as xt}from"./useScreenWidth.mjs";import{useScrollBlockage as St}from"./useScrollBlockage/index.mjs";import{useScrollDetection as Ct}from"./useScrollDetection.mjs";import{useUser as wt}from"./useUser/index.mjs";export{o as calculateIsMobile,s as checkIsIOS,c as checkIsIphoneOrSafariDevice,l as checkIsMac,u as checkIsMobileScreen,d as checkIsMobileUserAgent,f as getBreakpointFromSize,y as useAddDictionary,b as useAddNewAccessKey,x as useAddOrganization,S as useAddOrganizationMember,C as useAddPasskey,w as useAddProject,T as useAddTag,E as useAppQuery,D as useAskDocQuestion,O as useAskResetPassword,k as useAuditContentDeclaration,A as useAuditContentDeclarationField,j as useAuditContentDeclarationMetadata,M as useAuditScan,N as useAuditTag,g as useAuth,P as useAutocomplete,F as useBitbucketAuth,I as useBitbucketCheckConfig,L as useBitbucketGetConfigFile,R as useBitbucketRepos,z as useCancelSubscription,B as useChangePassword,V as useCreateUser,H as useDeleteAccessKey,U as useDeleteDictionary,W as useDeleteOrganization,G as useDeletePasskey,K as useDeleteProject,q as useDeleteSSOProvider,J as useDeleteShowcaseProject,Y as useDeleteTag,X as useDeleteUser,p as useDevice,Z as useDisableTwoFactor,Q as useEnableTwoFactor,$ as useGetCIConfig,ee as useGetDictionaries,te as useGetDictionariesKeys,ne as useGetDictionary,re as useGetDiscussions,ie as useGetDiscussionsData,ae as useGetEditorDictionaries,yt as useGetElementById,t as useGetElementOrWindow,oe as useGetNewsletterStatus,se as useGetOrganizations,ce as useGetOtherShowcaseProjects,le as useGetPricing,ue as useGetProjects,de as useGetRecursiveAuditStatus,fe as useGetShowcaseProjectById,pe as useGetShowcaseProjects,me as useGetSubscription,he as useGetTags,ge as useGetUserByAccount,_e as useGetUserById,ve as useGetUsers,ye as useGetVerifyEmailStatus,be as useGithubAuth,xe as useGithubCheckConfig,Se as useGithubGetAuthUrl,Ce as useGithubGetConfigFile,we as useGithubRepos,Te as useGitlabAuth,Ee as useGitlabCheckConfig,De as useGitlabGetConfigFile,Oe as useGitlabProjects,i as useHorizontalSwipe,ke as useInfiniteGetDictionaries,_ as useIntlayerAuth,v as useIntlayerOAuth,bt as useIsDarkMode,vt as useIsMounted,a as useItemSelector,e as useKeyboardDetector,Ae as useListPasskeys,je as useListSSOProviders,Me as useLogin,Ne as useLogout,m as useOAuth2,r as usePersistedStore,Pe as usePushCIConfig,Fe as usePushDictionaries,Ie as useQueryClient,Le as useRefreshAccessKey,Re as useRegister,ze as useRegisterSSO,Be as useResetPassword,xt as useScreenWidth,St as useScrollBlockage,Ct as useScrollDetection,n as useScrollY,_t as useSearch,Ve as useSearchDoc,He as useSelectOrganization,Ue as useSelectProject,h as useSession,We as useSignInMagicLink,Ge as useSignInPasskey,Ke as useSignInSSO,qe as useStartRecursiveAudit,Je as useSubmitShowcaseProject,Ye as useSubscribeToNewsletter,Xe as useToggleShowcaseDownvote,Ze as useToggleShowcaseUpvote,Qe as useTranslateJSONDeclaration,$e as useTriggerBuild,et as useTriggerWebhook,tt as useUnselectOrganization,nt as useUnselectProject,rt as useUnsubscribeFromNewsletter,it as useUpdateDictionary,at as useUpdateOrganization,ot as useUpdateOrganizationMembers,st as useUpdateOrganizationMembersById,ct as useUpdateProject,lt as useUpdateProjectMembers,ut as useUpdateShowcaseProject,dt as useUpdateTag,ft as useUpdateUser,wt as useUser,pt as useVerifyBackupCode,mt as useVerifyEmail,ht as useVerifyTotp,gt as useWriteDictionary};
@@ -1,2 +1,2 @@
1
- "use client";import{useQuery as e}from"@tanstack/react-query";import t from"@intlayer/config/built";import{useConfiguration as n}from"@intlayer/editor-react";import{getOAuthAPI as r}from"@intlayer/api";const i=i=>{let a=n(),o=i??a??t,{data:s}=e({queryKey:[`oAuth2AccessToken`],queryFn:r(o).getOAuth2AccessToken,enabled:!!(o.editor.clientId&&o.editor.clientSecret),staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1});return{oAuth2AccessToken:s?.data}};export{i as useOAuth2};
1
+ "use client";import e from"@intlayer/config/built";import{useQuery as t}from"@tanstack/react-query";import{useConfiguration as n}from"@intlayer/editor-react";import{getOAuthAPI as r}from"@intlayer/api";const i=i=>{let a=n(),o=i??a??e,{data:s}=t({queryKey:[`oAuth2AccessToken`],queryFn:r(o).getOAuth2AccessToken,enabled:!!(o.editor.clientId&&o.editor.clientSecret),staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1});return{oAuth2AccessToken:s?.data}};export{i as useOAuth2};
2
2
  //# sourceMappingURL=useOAuth2.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{getAuthAPI as e}from"../../libs/auth.mjs";import{useQueryClient as t}from"../reactQuery.mjs";import{useQuery as n}from"@tanstack/react-query";import r from"@intlayer/config/built";import{useConfiguration as i}from"@intlayer/editor-react";const a=(a,o)=>{let s=i(),c=o??s??r,l=t(),{data:u,isFetched:d,refetch:f}=n({queryKey:[`session`],queryFn:async()=>(await e(c).getSession()).data,staleTime:60*1e3,gcTime:300*1e3,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,enabled:!a}),p=u??(d?null:void 0),m=e=>{l.setQueryData([`session`],e)},h=async()=>(await f()).data;return{session:p,fetchSession:h,revalidateSession:h,setSession:m}};export{a as useSession};
1
+ "use client";import{getAuthAPI as e}from"../../libs/auth.mjs";import{useQueryClient as t}from"../reactQuery.mjs";import n from"@intlayer/config/built";import{useQuery as r}from"@tanstack/react-query";import{useConfiguration as i}from"@intlayer/editor-react";const a=(a,o)=>{let s=i(),c=o??s??n,l=t(),{data:u,isFetched:d,refetch:f}=r({queryKey:[`session`],queryFn:async()=>(await e(c).getSession()).data,staleTime:60*1e3,gcTime:300*1e3,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,enabled:!a}),p=u??(d?null:void 0),m=e=>{l.setQueryData([`session`],e)},h=async()=>(await f()).data;return{session:p,fetchSession:h,revalidateSession:h,setSession:m}};export{a as useSession};
2
2
  //# sourceMappingURL=useSession.mjs.map
@@ -43,9 +43,9 @@ declare enum BadgeSize {
43
43
  * @description Defines the styling variants for different badge combinations
44
44
  */
45
45
  declare const badgeVariants: (props?: {
46
- color?: "error" | "custom" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text" | "success";
47
- variant?: "default" | "none" | "outline" | "hoverable";
48
- size?: "lg" | "sm" | "md";
46
+ color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "success";
47
+ variant?: "none" | "default" | "outline" | "hoverable";
48
+ size?: "sm" | "md" | "lg";
49
49
  } & class_variance_authority_types0.ClassProp) => string;
50
50
  /**
51
51
  * Badge component props interface
@@ -60,10 +60,10 @@ declare enum ButtonTextAlign {
60
60
  * Enhanced button variants with improved accessibility and focus states
61
61
  */
62
62
  declare const buttonVariants: (props?: {
63
- size?: "lg" | "sm" | "md" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
64
- color?: "error" | "custom" | "primary" | "secondary" | "destructive" | "neutral" | "card" | "light" | "dark" | "text" | "current" | "text-inverse" | "success";
65
- roundedSize?: "lg" | "sm" | "md" | "xl" | "none" | "2xl" | "3xl" | "4xl" | "5xl" | "full";
66
- variant?: "default" | "input" | "none" | "outline" | "link" | "invisible-link" | "hoverable" | "fade";
63
+ size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
64
+ color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "card" | "light" | "dark" | "current" | "text-inverse" | "success";
65
+ roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "4xl" | "5xl" | "full";
66
+ variant?: "input" | "none" | "default" | "outline" | "link" | "invisible-link" | "hoverable" | "fade";
67
67
  textAlign?: "left" | "center" | "right";
68
68
  isFullWidth?: boolean;
69
69
  } & class_variance_authority_types0.ClassProp) => string;
@@ -4,9 +4,9 @@ import { VariantProps } from "class-variance-authority";
4
4
 
5
5
  //#region src/components/CollapsibleTable/CollapsibleTable.d.ts
6
6
  declare const collapsibleTableVariants: (props?: {
7
- size?: "lg" | "sm" | "md" | "xl" | "full";
8
- variant?: "default" | "dark" | "ghost" | "outlined";
9
- spacing?: "lg" | "sm" | "md" | "none" | "auto";
7
+ size?: "sm" | "md" | "lg" | "xl" | "full";
8
+ variant?: "default" | "ghost" | "dark" | "outlined";
9
+ spacing?: "sm" | "md" | "lg" | "none" | "auto";
10
10
  } & class_variance_authority_types0.ClassProp) => string;
11
11
  interface CollapsibleTableProps extends Omit<HTMLAttributes<HTMLElement>, 'title'>, VariantProps<typeof collapsibleTableVariants> {
12
12
  /** Table title displayed in the header */
@@ -29,7 +29,7 @@ declare const Command: {
29
29
  ref?: React.Ref<HTMLInputElement>;
30
30
  } & {
31
31
  asChild?: boolean;
32
- }, "key" | "asChild" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
32
+ }, "key" | keyof react.InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "onChange" | "value"> & {
33
33
  value?: string;
34
34
  onValueChange?: (search: string) => void;
35
35
  } & react.RefAttributes<HTMLInputElement>>;
@@ -8,14 +8,14 @@ import { VariantProps } from "class-variance-authority";
8
8
  * Provides flexible styling options for background, padding, borders, and layout
9
9
  */
10
10
  declare const containerVariants: (props?: {
11
- roundedSize?: "lg" | "sm" | "md" | "xl" | "none" | "2xl" | "3xl" | "4xl" | "full";
12
- transparency?: "lg" | "sm" | "md" | "xl" | "none" | "full" | "xs";
13
- padding?: "lg" | "sm" | "md" | "xl" | "none" | "2xl";
11
+ roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "4xl" | "full";
12
+ transparency?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | "full";
13
+ padding?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
14
14
  separator?: "both" | "without" | "x" | "y";
15
15
  border?: "with" | "none";
16
16
  borderColor?: "error" | "success" | "text" | "primary" | "secondary" | "neutral" | "card" | "warning";
17
17
  background?: "with" | "none" | "hoverable";
18
- gap?: "lg" | "sm" | "md" | "xl" | "none" | "2xl";
18
+ gap?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
19
19
  } & class_variance_authority_types0.ClassProp) => string;
20
20
  /** Available rounded corner sizes for the container */
21
21
  declare enum ContainerRoundedSize {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockShiki.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"mappings":";;;;KA8HY,mBAAA;EACV,QAAA;EACA,IAAA,EAAM,eAAA;EACN,UAAA;AAAA;AAAA,cAGW,cAAA,EAAgB,EAAA,CAAG,mBAAA"}
1
+ {"version":3,"file":"CodeBlockShiki.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"mappings":";;;;KAkIY,mBAAA;EACV,QAAA;EACA,IAAA,EAAM,eAAA;EACN,UAAA;AAAA;AAAA,cAGW,cAAA,EAAgB,EAAA,CAAG,mBAAA"}
@@ -5,9 +5,9 @@ import { VariantProps } from "class-variance-authority";
5
5
  //#region src/components/Input/Checkbox.d.ts
6
6
  declare const checkboxVariants: (props?: {
7
7
  variant?: "default";
8
- size?: "lg" | "sm" | "md" | "xs";
9
- color?: "error" | "success" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark";
10
- validationStyleEnabled?: "disabled" | "enabled";
8
+ size?: "xs" | "sm" | "md" | "lg";
9
+ color?: "error" | "success" | "text" | "primary" | "secondary" | "neutral" | "destructive" | "custom" | "light" | "dark";
10
+ validationStyleEnabled?: "enabled" | "disabled";
11
11
  } & class_variance_authority_types0.ClassProp) => string;
12
12
  declare enum CheckboxSize {
13
13
  XS = "xs",
@@ -5,8 +5,8 @@ import { VariantProps } from "class-variance-authority";
5
5
  //#region src/components/Input/Input.d.ts
6
6
  declare const inputVariants: (props?: {
7
7
  variant?: "default" | "invisible";
8
- size?: "lg" | "sm" | "md";
9
- validationStyleEnabled?: "disabled" | "enabled";
8
+ size?: "sm" | "md" | "lg";
9
+ validationStyleEnabled?: "enabled" | "disabled";
10
10
  } & class_variance_authority_types0.ClassProp) => string;
11
11
  declare enum InputVariant {
12
12
  DEFAULT = "default",
@@ -57,7 +57,7 @@ declare const OTPInputContext: react.Context<RenderProps>;
57
57
  declare const OTPInput: FC<OTPInputProps>;
58
58
  type InputOTPProps = Omit<ComponentProps<typeof OTPInput>, 'children'>;
59
59
  declare const inputSlotVariants: (props?: {
60
- size?: "lg" | "sm" | "md" | "xl";
60
+ size?: "sm" | "md" | "lg" | "xl";
61
61
  } & class_variance_authority_types0.ClassProp) => string;
62
62
  declare const InputOTP: FC<InputOTPProps>;
63
63
  declare const InputOTPGroup: ({
@@ -54,9 +54,9 @@ declare enum LinkUnderlined {
54
54
  }
55
55
  declare const linkVariants: (props?: {
56
56
  variant?: "default" | "invisible-link" | "hoverable" | "button" | "button-outlined";
57
- roundedSize?: "lg" | "sm" | "md" | "xl" | "none" | "2xl" | "3xl" | "full";
58
- color?: "error" | "custom" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text" | "text-inverse" | "success";
59
- size?: "lg" | "custom" | "sm" | "md" | "xl";
57
+ roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
58
+ color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "success";
59
+ size?: "sm" | "md" | "lg" | "xl" | "custom";
60
60
  underlined?: boolean | LinkUnderlined.DEFAULT;
61
61
  } & class_variance_authority_types0.ClassProp) => string;
62
62
  type LinkProps = DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & VariantProps<typeof linkVariants> & {
@@ -14,11 +14,6 @@ declare const baseMarkdownComponents: {
14
14
  h5: (props: ComponentProps<"h5">) => react_jsx_runtime0.JSX.Element;
15
15
  h6: (props: ComponentProps<"h6">) => react_jsx_runtime0.JSX.Element;
16
16
  strong: (props: ComponentProps<"strong">) => react_jsx_runtime0.JSX.Element;
17
- code: ({
18
- className,
19
- children,
20
- ...rest
21
- }: ComponentProps<"code">) => react_jsx_runtime0.JSX.Element;
22
17
  blockquote: ({
23
18
  className,
24
19
  ...props
@@ -37,7 +32,6 @@ declare const baseMarkdownComponents: {
37
32
  src,
38
33
  ...props
39
34
  }: ComponentProps<"img">) => react_jsx_runtime0.JSX.Element;
40
- a: (props: ComponentProps<"a">) => react_jsx_runtime0.JSX.Element;
41
35
  pre: (props: ComponentProps<"pre">) => react_jsx_runtime0.JSX.Element;
42
36
  table: (props: ComponentProps<typeof Table>) => react_jsx_runtime0.JSX.Element;
43
37
  th: ({
@@ -92,11 +86,6 @@ declare const getIntlayerMarkdownOptions: (_isDarkMode?: boolean) => {
92
86
  h5: (props: ComponentProps<"h5">) => react_jsx_runtime0.JSX.Element;
93
87
  h6: (props: ComponentProps<"h6">) => react_jsx_runtime0.JSX.Element;
94
88
  strong: (props: ComponentProps<"strong">) => react_jsx_runtime0.JSX.Element;
95
- code: ({
96
- className,
97
- children,
98
- ...rest
99
- }: ComponentProps<"code">) => react_jsx_runtime0.JSX.Element;
100
89
  blockquote: ({
101
90
  className,
102
91
  ...props
@@ -115,7 +104,6 @@ declare const getIntlayerMarkdownOptions: (_isDarkMode?: boolean) => {
115
104
  src,
116
105
  ...props
117
106
  }: ComponentProps<"img">) => react_jsx_runtime0.JSX.Element;
118
- a: (props: ComponentProps<"a">) => react_jsx_runtime0.JSX.Element;
119
107
  pre: (props: ComponentProps<"pre">) => react_jsx_runtime0.JSX.Element;
120
108
  table: (props: ComponentProps<typeof Table>) => react_jsx_runtime0.JSX.Element;
121
109
  th: ({
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.d.ts","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"mappings":"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"}
1
+ {"version":3,"file":"MarkDownRender.d.ts","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"mappings":"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"}
@@ -4,8 +4,8 @@ import { VariantProps } from "class-variance-authority";
4
4
 
5
5
  //#region src/components/Pagination/Pagination.d.ts
6
6
  declare const paginationVariants: (props?: {
7
- size?: "lg" | "sm" | "md";
8
- color?: "text" | "primary" | "secondary" | "destructive" | "neutral";
7
+ size?: "sm" | "md" | "lg";
8
+ color?: "text" | "primary" | "secondary" | "neutral" | "destructive";
9
9
  variant?: "default" | "bordered" | "ghost";
10
10
  } & class_variance_authority_types0.ClassProp) => string;
11
11
  declare enum PaginationSize {
@@ -28,7 +28,7 @@ declare enum SwitchSelectorColor {
28
28
  TEXT = "text"
29
29
  }
30
30
  declare const switchSelectorVariant: (props?: {
31
- color?: "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text";
31
+ color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark";
32
32
  disabled?: boolean;
33
33
  } & class_variance_authority_types0.ClassProp) => string;
34
34
  declare enum SwitchSelectorSize {
@@ -37,7 +37,7 @@ declare enum SwitchSelectorSize {
37
37
  LG = "lg"
38
38
  }
39
39
  declare const choiceVariant: (props?: {
40
- size?: "lg" | "sm" | "md";
40
+ size?: "sm" | "md" | "lg";
41
41
  } & class_variance_authority_types0.ClassProp) => string;
42
42
  /**
43
43
  *
@@ -15,7 +15,7 @@ declare enum TabSelectorColor {
15
15
  TEXT = "text"
16
16
  }
17
17
  declare const tabSelectorVariant: (props?: {
18
- color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark";
18
+ color?: "text" | "primary" | "secondary" | "neutral" | "destructive" | "light" | "dark";
19
19
  } & class_variance_authority_types0.ClassProp) => string;
20
20
  type TabSelectorItemProps = HTMLAttributes<HTMLElement> & {
21
21
  key: string | number;
@@ -185,9 +185,9 @@ declare enum TagBackground {
185
185
  WITH = "with"
186
186
  }
187
187
  declare const containerVariants: (props?: {
188
- roundedSize?: "lg" | "sm" | "md" | "xl" | "none" | "2xl" | "3xl" | "full";
189
- color?: "error" | "primary" | "neutral" | "text" | "success" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
190
- size?: "lg" | "sm" | "md" | "xl" | "xs";
188
+ roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
189
+ color?: "error" | "text" | "primary" | "neutral" | "success" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
190
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
191
191
  border?: "none" | "with";
192
192
  background?: "none" | "with";
193
193
  } & class_variance_authority_types0.ClassProp) => string;
@@ -25,7 +25,7 @@ declare const ToastViewport: FC<ComponentProps<typeof ToastPrimitives.Viewport>>
25
25
  * ```
26
26
  */
27
27
  declare const toastVariants: (props?: {
28
- variant?: "error" | "success" | "default";
28
+ variant?: "default" | "error" | "success";
29
29
  } & class_variance_authority_types0.ClassProp) => string;
30
30
  /**
31
31
  * Toast Component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/design-system",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "private": false,
5
5
  "description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
6
6
  "keywords": [
@@ -104,29 +104,29 @@
104
104
  "typecheck_": "tsc --noEmit --project tsconfig.types.json"
105
105
  },
106
106
  "dependencies": {
107
- "@better-auth/passkey": "1.5.4",
108
- "@better-auth/sso": "1.5.4",
109
- "@intlayer/api": "8.3.0",
110
- "@intlayer/config": "8.3.0",
111
- "@intlayer/core": "8.3.0",
112
- "@intlayer/dictionaries-entry": "8.3.0",
113
- "@intlayer/editor-react": "8.3.0",
114
- "@intlayer/types": "8.3.0",
107
+ "@better-auth/passkey": "1.5.5",
108
+ "@better-auth/sso": "1.5.5",
109
+ "@intlayer/api": "8.3.2",
110
+ "@intlayer/config": "8.3.2",
111
+ "@intlayer/core": "8.3.2",
112
+ "@intlayer/dictionaries-entry": "8.3.2",
113
+ "@intlayer/editor-react": "8.3.2",
114
+ "@intlayer/types": "8.3.2",
115
115
  "@radix-ui/react-dialog": "1.1.15",
116
116
  "@radix-ui/react-select": "2.2.6",
117
117
  "@radix-ui/react-slot": "1.2.4",
118
118
  "@radix-ui/react-toast": "1.2.15",
119
119
  "@tailwindcss/aspect-ratio": "0.4.2",
120
- "better-auth": "1.4.21",
120
+ "better-auth": "1.5.5",
121
121
  "class-variance-authority": "0.7.1",
122
122
  "cmdk": "1.1.1",
123
- "react-intlayer": "8.3.0",
123
+ "react-intlayer": "8.3.2",
124
124
  "rollup-preserve-directives": "1.1.3",
125
125
  "zod": "4.3.6"
126
126
  },
127
127
  "devDependencies": {
128
- "@intlayer/backend": "8.3.0",
129
- "@shikijs/transformers": "4.0.1",
128
+ "@intlayer/backend": "8.3.2",
129
+ "@shikijs/transformers": "4.0.2",
130
130
  "@storybook/addon-a11y": "8.6.14",
131
131
  "@storybook/addon-essentials": "8.6.14",
132
132
  "@storybook/addon-interactions": "8.6.14",
@@ -148,42 +148,42 @@
148
148
  "@testing-library/react": "16.3.2",
149
149
  "@testing-library/user-event": "14.6.1",
150
150
  "@types/espree": "11.1.0",
151
- "@types/node": "25.4.0",
151
+ "@types/node": "25.5.0",
152
152
  "@types/react": "19.2.14",
153
153
  "@types/react-dom": "19.2.3",
154
154
  "@utils/ts-config": "1.0.4",
155
155
  "@utils/ts-config-types": "1.0.4",
156
156
  "fast-glob": "3.3.3",
157
- "intlayer": "8.3.0",
157
+ "intlayer": "8.3.2",
158
158
  "rimraf": "6.1.3",
159
- "shiki": "4.0.1",
159
+ "shiki": "4.0.2",
160
160
  "storybook": "8.6.17",
161
161
  "tsdown": "0.21.2",
162
162
  "typescript": "5.9.3",
163
- "vite": "7.3.1",
164
- "vite-intlayer": "8.3.0",
163
+ "vite": "8.0.0",
164
+ "vite-intlayer": "8.3.2",
165
165
  "vite-plugin-dts": "4.5.4",
166
166
  "vite-tsconfig-paths": "6.1.1",
167
- "vitest": "4.0.18"
167
+ "vitest": "4.1.0"
168
168
  },
169
169
  "peerDependencies": {
170
170
  "@better-fetch/fetch": "1.1.21",
171
171
  "@hookform/resolvers": "5.2.2",
172
- "@intlayer/backend": "8.3.0",
172
+ "@intlayer/backend": "8.3.2",
173
173
  "@monaco-editor/react": "4.7.0",
174
- "@shikijs/transformers": "4.0.1",
174
+ "@shikijs/transformers": "4.0.2",
175
175
  "@tanstack/react-query": "5.90.21",
176
176
  "@tanstack/react-query-devtools": "5.91.3",
177
177
  "clsx": "2.1.1",
178
- "framer-motion": "12.35.1",
178
+ "framer-motion": "12.36.0",
179
179
  "fuse.js": "7.1.0",
180
- "intlayer": "8.3.0",
180
+ "intlayer": "8.3.2",
181
181
  "lucide-react": "0.577.0",
182
182
  "react": ">=16.0.0",
183
183
  "react-dom": ">=16.0.0",
184
184
  "react-hook-form": "7.71.2",
185
- "react-intlayer": "8.3.0",
186
- "shiki": "4.0.1",
185
+ "react-intlayer": "8.3.2",
186
+ "shiki": "4.0.2",
187
187
  "tailwind-merge": "3.5.0",
188
188
  "tailwindcss": "4.2.1"
189
189
  },