@intlayer/design-system 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +10 -10
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +150 -10
- package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts +120 -8
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +75 -5
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +6 -6
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts +105 -7
- package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts +45 -3
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/signIn.content.d.ts +195 -13
- package/dist/components/Auth/SignInForm/signIn.content.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts +60 -4
- package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +8 -8
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +165 -11
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts +105 -7
- package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -1
- package/dist/components/Auth/VerifyEmailForm/index.content.d.ts +60 -4
- package/dist/components/Auth/VerifyEmailForm/index.content.d.ts.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts +15 -1
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -4
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +114 -8
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts +30 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +195 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +60 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +22 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +387 -26
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +180 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +3 -3
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +3 -3
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +165 -11
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +10 -4
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -6
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +150 -10
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +45 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +60 -4
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/editorView.content.d.ts +105 -7
- package/dist/components/DictionaryFieldEditor/editorView.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +135 -6
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +59 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/IDE/CopyButton.cjs +1 -1
- package/dist/components/IDE/CopyButton.cjs.map +1 -1
- package/dist/components/IDE/CopyButton.content.d.ts +15 -1
- package/dist/components/IDE/CopyButton.content.d.ts.map +1 -1
- package/dist/components/IDE/CopyButton.d.ts.map +1 -1
- package/dist/components/IDE/CopyButton.mjs +1 -1
- package/dist/components/IDE/CopyButton.mjs.map +1 -1
- package/dist/components/Loader/index.content.d.ts +12 -1
- package/dist/components/Loader/index.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +5 -5
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +6 -6
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +105 -7
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +3 -3
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +75 -5
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/{index-Di_3dNqI.js → index-BVYRWLUL.js} +3 -2
- package/dist/index-BVYRWLUL.js.map +1 -0
- package/dist/{index-ZARcTrR0.cjs → index-DTQyeqio.cjs} +3 -2
- package/dist/index-DTQyeqio.cjs.map +1 -0
- package/package.json +19 -19
- package/dist/index-Di_3dNqI.js.map +0 -1
- package/dist/index-ZARcTrR0.cjs.map +0 -1
|
@@ -14,12 +14,15 @@ const NodeTypeSelector = ({
|
|
|
14
14
|
section
|
|
15
15
|
}) => {
|
|
16
16
|
const {
|
|
17
|
-
|
|
17
|
+
multilingual,
|
|
18
18
|
text,
|
|
19
19
|
node,
|
|
20
20
|
array,
|
|
21
21
|
enumeration,
|
|
22
|
-
triggerPlaceHolder
|
|
22
|
+
triggerPlaceHolder,
|
|
23
|
+
nest,
|
|
24
|
+
condition,
|
|
25
|
+
markdown
|
|
23
26
|
} = useDictionary(nodeTypeSelectorContent);
|
|
24
27
|
const nodeType = getSectionType(section);
|
|
25
28
|
const [keyType, setKeyType] = useState(nodeType);
|
|
@@ -75,11 +78,14 @@ const NodeTypeSelector = ({
|
|
|
75
78
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: keyType, onValueChange, children: [
|
|
76
79
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, { className: "w-40", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: triggerPlaceHolder }) }),
|
|
77
80
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
78
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Translation, children:
|
|
81
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Translation, children: multilingual }),
|
|
79
82
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Text, children: text }),
|
|
80
83
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Object, children: node }),
|
|
81
84
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Array, children: array }),
|
|
82
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Enumeration, children: enumeration })
|
|
85
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Enumeration, children: enumeration }),
|
|
86
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Markdown, children: markdown }),
|
|
87
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Nested, children: nest }),
|
|
88
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: NodeType.Condition, children: condition })
|
|
83
89
|
] })
|
|
84
90
|
] });
|
|
85
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type ContentNode,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n getSectionType,\n} from '@intlayer/core';\nimport { useEditedContentActions } from '@intlayer/editor-react';\nimport { type FC, useEffect, useState } from 'react';\
|
|
1
|
+
{"version":3,"file":"NodeTypeSelector.mjs","sources":["../../../src/components/DictionaryFieldEditor/NodeTypeSelector.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type ContentNode,\n type EnumerationContent,\n type KeyPath,\n NodeType,\n type TranslationContent,\n getSectionType,\n} from '@intlayer/core';\nimport { useEditedContentActions } from '@intlayer/editor-react';\nimport { type FC, useEffect, useState } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Select } from '../Select';\nimport { nodeTypeSelectorContent } from './nodeTypeSelector.content';\n\ntype NodeTypeSelectorProps = {\n keyPath: KeyPath[];\n dictionaryKey: string;\n section: ContentNode;\n};\n\nexport const NodeTypeSelector: FC<NodeTypeSelectorProps> = ({\n keyPath,\n dictionaryKey,\n section,\n}) => {\n const {\n multilingual,\n text,\n node,\n array,\n enumeration,\n triggerPlaceHolder,\n nest,\n condition,\n markdown,\n } = useDictionary(nodeTypeSelectorContent);\n const nodeType = getSectionType(section);\n const [keyType, setKeyType] = useState<NodeType>(nodeType);\n const { addEditedContent } = useEditedContentActions();\n const { locales } = getConfiguration().internationalization;\n\n const onValueChange = (keyType: NodeType) => {\n setKeyType(keyType);\n\n switch (keyType) {\n case NodeType.Translation:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Translation,\n [NodeType.Translation]: Object.assign(\n {},\n ...locales.map((locale) => ({\n [locale]: '',\n }))\n ),\n } as TranslationContent<ContentNode>,\n keyPath\n );\n break;\n case NodeType.Enumeration:\n addEditedContent(\n dictionaryKey,\n {\n nodeType: NodeType.Enumeration,\n [NodeType.Enumeration]: {\n '1': '',\n '>1': '',\n },\n } as EnumerationContent<ContentNode>,\n keyPath\n );\n break;\n case NodeType.Object:\n addEditedContent(dictionaryKey, {}, keyPath);\n break;\n case NodeType.Array:\n addEditedContent(dictionaryKey, [''], keyPath);\n break;\n case NodeType.Text:\n addEditedContent(dictionaryKey, '', keyPath);\n break;\n default:\n addEditedContent(dictionaryKey, {}, keyPath);\n }\n };\n\n useEffect(() => {\n setKeyType(nodeType);\n }, [nodeType]);\n\n return (\n <Select value={keyType} onValueChange={onValueChange}>\n <Select.Trigger className=\"w-40\">\n <Select.Value placeholder={triggerPlaceHolder} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value={NodeType.Translation}>{multilingual}</Select.Item>\n <Select.Item value={NodeType.Text}>{text}</Select.Item>\n <Select.Item value={NodeType.Object}>{node}</Select.Item>\n <Select.Item value={NodeType.Array}>{array}</Select.Item>\n <Select.Item value={NodeType.Enumeration}>{enumeration}</Select.Item>\n <Select.Item value={NodeType.Markdown}>{markdown}</Select.Item>\n <Select.Item value={NodeType.Nested}>{nest}</Select.Item>\n <Select.Item value={NodeType.Condition}>{condition}</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"names":["keyType","jsxs","jsx"],"mappings":";;;;;;;;;;AAuBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA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,KAAA,QAAA,EAAO,OAAO,SAAS,eACtB,UAAA;AAAA,IAACC,kCAAAA,IAAA,OAAO,SAAP,EAAe,WAAU,QACxB,UAACA,sCAAA,OAAO,OAAP,EAAa,aAAa,mBAAA,CAAoB,EACjD,CAAA;AAAA,IACAD,kCAAAA,KAAC,OAAO,SAAP,EACC,UAAA;AAAA,MAAAC,sCAAC,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAa,cAAA;AAAA,4CACvD,OAAO,MAAP,EAAY,OAAO,SAAS,MAAO,UAAK,MAAA;AAAA,4CACxC,OAAO,MAAP,EAAY,OAAO,SAAS,QAAS,UAAK,MAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,OAAQ,UAAM,OAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,aAAc,UAAY,aAAA;AAAA,4CACtD,OAAO,MAAP,EAAY,OAAO,SAAS,UAAW,UAAS,UAAA;AAAA,4CAChD,OAAO,MAAP,EAAY,OAAO,SAAS,QAAS,UAAK,MAAA;AAAA,4CAC1C,OAAO,MAAP,EAAY,OAAO,SAAS,WAAY,UAAU,UAAA,CAAA;AAAA,IAAA,EACrD,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -11,7 +11,7 @@ require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
|
11
11
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
12
12
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
13
13
|
const hooks_useGetAllDictionaries = require("../../../hooks/useGetAllDictionaries.cjs");
|
|
14
|
-
require("../../../index-
|
|
14
|
+
require("../../../index-DTQyeqio.cjs");
|
|
15
15
|
require("@intlayer/config/client");
|
|
16
16
|
require("@intlayer/api");
|
|
17
17
|
require("../../Button/Button.cjs");
|
|
@@ -118,7 +118,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
118
118
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
119
119
|
{
|
|
120
120
|
type: "button",
|
|
121
|
-
label: auditButton.label,
|
|
121
|
+
label: auditButton.label.value,
|
|
122
122
|
disabled: isSubmitting,
|
|
123
123
|
Icon: lucideReact.WandSparkles,
|
|
124
124
|
variant: "outline",
|
|
@@ -133,7 +133,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
133
133
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
134
134
|
{
|
|
135
135
|
type: "button",
|
|
136
|
-
label: resetButton.label,
|
|
136
|
+
label: resetButton.label.value,
|
|
137
137
|
disabled: !isEdited || isSubmitting,
|
|
138
138
|
Icon: lucideReact.RotateCcw,
|
|
139
139
|
variant: "outline",
|
|
@@ -147,7 +147,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
147
147
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
148
148
|
{
|
|
149
149
|
type: "submit",
|
|
150
|
-
label: publishButton.label,
|
|
150
|
+
label: publishButton.label.value,
|
|
151
151
|
disabled: !isEdited || isSubmitting,
|
|
152
152
|
Icon: lucideReact.ArrowUpFromLine,
|
|
153
153
|
color: "text",
|
|
@@ -159,7 +159,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
159
159
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
160
160
|
{
|
|
161
161
|
type: "submit",
|
|
162
|
-
label: saveButton.label,
|
|
162
|
+
label: saveButton.label.value,
|
|
163
163
|
disabled: !isEdited || isSubmitting,
|
|
164
164
|
Icon: lucideReact.Save,
|
|
165
165
|
color: "text",
|
|
@@ -171,7 +171,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
171
171
|
components_Form_layout_FormItemLayout.Form.Button,
|
|
172
172
|
{
|
|
173
173
|
type: "submit",
|
|
174
|
-
label: downloadButton.label,
|
|
174
|
+
label: downloadButton.label.value,
|
|
175
175
|
disabled: !isEdited || isSubmitting,
|
|
176
176
|
Icon: lucideReact.Download,
|
|
177
177
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label.value}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useWriteDictionary","getSaveFormSchema","useGetAllDictionaries","useAuditContentDeclaration","useEditedContent","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAM,W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;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAa5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAa5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAatD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA8K/C,CAAC"}
|
|
@@ -9,7 +9,7 @@ import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
|
9
9
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
10
10
|
import { usePushDictionaries, useWriteDictionary, useAuditContentDeclaration } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
11
11
|
import { useGetAllDictionaries } from "../../../hooks/useGetAllDictionaries.mjs";
|
|
12
|
-
import "../../../index-
|
|
12
|
+
import "../../../index-BVYRWLUL.js";
|
|
13
13
|
import "@intlayer/config/client";
|
|
14
14
|
import "@intlayer/api";
|
|
15
15
|
import "../../Button/Button.mjs";
|
|
@@ -116,7 +116,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
116
116
|
Form.Button,
|
|
117
117
|
{
|
|
118
118
|
type: "button",
|
|
119
|
-
label: auditButton.label,
|
|
119
|
+
label: auditButton.label.value,
|
|
120
120
|
disabled: isSubmitting,
|
|
121
121
|
Icon: WandSparkles,
|
|
122
122
|
variant: "outline",
|
|
@@ -131,7 +131,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
131
131
|
Form.Button,
|
|
132
132
|
{
|
|
133
133
|
type: "button",
|
|
134
|
-
label: resetButton.label,
|
|
134
|
+
label: resetButton.label.value,
|
|
135
135
|
disabled: !isEdited || isSubmitting,
|
|
136
136
|
Icon: RotateCcw,
|
|
137
137
|
variant: "outline",
|
|
@@ -145,7 +145,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
145
145
|
Form.Button,
|
|
146
146
|
{
|
|
147
147
|
type: "submit",
|
|
148
|
-
label: publishButton.label,
|
|
148
|
+
label: publishButton.label.value,
|
|
149
149
|
disabled: !isEdited || isSubmitting,
|
|
150
150
|
Icon: ArrowUpFromLine,
|
|
151
151
|
color: "text",
|
|
@@ -157,7 +157,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
157
157
|
Form.Button,
|
|
158
158
|
{
|
|
159
159
|
type: "submit",
|
|
160
|
-
label: saveButton.label,
|
|
160
|
+
label: saveButton.label.value,
|
|
161
161
|
disabled: !isEdited || isSubmitting,
|
|
162
162
|
Icon: Save,
|
|
163
163
|
color: "text",
|
|
@@ -169,7 +169,7 @@ const SaveForm = ({ dictionary, mode }) => {
|
|
|
169
169
|
Form.Button,
|
|
170
170
|
{
|
|
171
171
|
type: "submit",
|
|
172
|
-
label: downloadButton.label,
|
|
172
|
+
label: downloadButton.label.value,
|
|
173
173
|
disabled: !isEdited || isSubmitting,
|
|
174
174
|
Icon: Download,
|
|
175
175
|
color: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label.value}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["editedDictionary","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAM,WAAuC,CAAC,EAAE,YAAY,WAAW;AACtE,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AACvD,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAC3C,QAAA,EAAE,gBAAgB,IAAI,mBAAmB;AAC/C,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAI,sBAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7B,2BAA2B;AAE7B,QAAM,EAAE,eAA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OAAO,cAAc,MAAM;AAAA,YAC3B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW,MAAM;AAAA,YACxB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe,MAAM;AAAA,YAC5B,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
|
@@ -2,24 +2,164 @@ export declare const saveDictionaryContent: {
|
|
|
2
2
|
key: string;
|
|
3
3
|
content: {
|
|
4
4
|
auditButton: {
|
|
5
|
-
text: import('@intlayer/core').
|
|
6
|
-
|
|
5
|
+
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
6
|
+
en: string;
|
|
7
|
+
'en-GB': string;
|
|
8
|
+
fr: string;
|
|
9
|
+
es: string;
|
|
10
|
+
de: string;
|
|
11
|
+
ja: string;
|
|
12
|
+
ko: string;
|
|
13
|
+
zh: string;
|
|
14
|
+
it: string;
|
|
15
|
+
pt: string;
|
|
16
|
+
hi: string;
|
|
17
|
+
ar: string;
|
|
18
|
+
ru: string;
|
|
19
|
+
}>;
|
|
20
|
+
label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
21
|
+
en: string;
|
|
22
|
+
'en-GB': string;
|
|
23
|
+
fr: string;
|
|
24
|
+
es: string;
|
|
25
|
+
de: string;
|
|
26
|
+
ja: string;
|
|
27
|
+
ko: string;
|
|
28
|
+
zh: string;
|
|
29
|
+
it: string;
|
|
30
|
+
pt: string;
|
|
31
|
+
hi: string;
|
|
32
|
+
ar: string;
|
|
33
|
+
ru: string;
|
|
34
|
+
}>;
|
|
7
35
|
};
|
|
8
36
|
resetButton: {
|
|
9
|
-
text: import('@intlayer/core').
|
|
10
|
-
|
|
37
|
+
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
38
|
+
en: string;
|
|
39
|
+
'en-GB': string;
|
|
40
|
+
fr: string;
|
|
41
|
+
es: string;
|
|
42
|
+
de: string;
|
|
43
|
+
ja: string;
|
|
44
|
+
ko: string;
|
|
45
|
+
zh: string;
|
|
46
|
+
it: string;
|
|
47
|
+
pt: string;
|
|
48
|
+
hi: string;
|
|
49
|
+
ar: string;
|
|
50
|
+
ru: string;
|
|
51
|
+
}>;
|
|
52
|
+
label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
53
|
+
en: string;
|
|
54
|
+
'en-GB': string;
|
|
55
|
+
fr: string;
|
|
56
|
+
es: string;
|
|
57
|
+
de: string;
|
|
58
|
+
ja: string;
|
|
59
|
+
ko: string;
|
|
60
|
+
zh: string;
|
|
61
|
+
it: string;
|
|
62
|
+
pt: string;
|
|
63
|
+
hi: string;
|
|
64
|
+
ar: string;
|
|
65
|
+
ru: string;
|
|
66
|
+
}>;
|
|
11
67
|
};
|
|
12
68
|
saveButton: {
|
|
13
|
-
text: import('@intlayer/core').
|
|
14
|
-
|
|
69
|
+
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
70
|
+
en: string;
|
|
71
|
+
'en-GB': string;
|
|
72
|
+
fr: string;
|
|
73
|
+
es: string;
|
|
74
|
+
de: string;
|
|
75
|
+
ja: string;
|
|
76
|
+
ko: string;
|
|
77
|
+
zh: string;
|
|
78
|
+
it: string;
|
|
79
|
+
pt: string;
|
|
80
|
+
hi: string;
|
|
81
|
+
ar: string;
|
|
82
|
+
ru: string;
|
|
83
|
+
}>;
|
|
84
|
+
label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
85
|
+
en: string;
|
|
86
|
+
'en-GB': string;
|
|
87
|
+
fr: string;
|
|
88
|
+
es: string;
|
|
89
|
+
de: string;
|
|
90
|
+
ja: string;
|
|
91
|
+
ko: string;
|
|
92
|
+
zh: string;
|
|
93
|
+
it: string;
|
|
94
|
+
pt: string;
|
|
95
|
+
hi: string;
|
|
96
|
+
ar: string;
|
|
97
|
+
ru: string;
|
|
98
|
+
}>;
|
|
15
99
|
};
|
|
16
100
|
publishButton: {
|
|
17
|
-
text: import('@intlayer/core').
|
|
18
|
-
|
|
101
|
+
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
102
|
+
en: string;
|
|
103
|
+
'en-GB': string;
|
|
104
|
+
fr: string;
|
|
105
|
+
es: string;
|
|
106
|
+
de: string;
|
|
107
|
+
ja: string;
|
|
108
|
+
ko: string;
|
|
109
|
+
zh: string;
|
|
110
|
+
it: string;
|
|
111
|
+
pt: string;
|
|
112
|
+
hi: string;
|
|
113
|
+
ar: string;
|
|
114
|
+
ru: string;
|
|
115
|
+
}>;
|
|
116
|
+
label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
117
|
+
en: string;
|
|
118
|
+
'en-GB': string;
|
|
119
|
+
fr: string;
|
|
120
|
+
es: string;
|
|
121
|
+
de: string;
|
|
122
|
+
ja: string;
|
|
123
|
+
ko: string;
|
|
124
|
+
zh: string;
|
|
125
|
+
it: string;
|
|
126
|
+
pt: string;
|
|
127
|
+
hi: string;
|
|
128
|
+
ar: string;
|
|
129
|
+
ru: string;
|
|
130
|
+
}>;
|
|
19
131
|
};
|
|
20
132
|
downloadButton: {
|
|
21
|
-
text: import('@intlayer/core').
|
|
22
|
-
|
|
133
|
+
text: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
134
|
+
en: string;
|
|
135
|
+
'en-GB': string;
|
|
136
|
+
fr: string;
|
|
137
|
+
es: string;
|
|
138
|
+
de: string;
|
|
139
|
+
ja: string;
|
|
140
|
+
ko: string;
|
|
141
|
+
zh: string;
|
|
142
|
+
it: string;
|
|
143
|
+
pt: string;
|
|
144
|
+
hi: string;
|
|
145
|
+
ar: string;
|
|
146
|
+
ru: string;
|
|
147
|
+
}>;
|
|
148
|
+
label: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
149
|
+
en: string;
|
|
150
|
+
'en-GB': string;
|
|
151
|
+
fr: string;
|
|
152
|
+
es: string;
|
|
153
|
+
de: string;
|
|
154
|
+
ja: string;
|
|
155
|
+
ko: string;
|
|
156
|
+
zh: string;
|
|
157
|
+
it: string;
|
|
158
|
+
pt: string;
|
|
159
|
+
hi: string;
|
|
160
|
+
ar: string;
|
|
161
|
+
ru: string;
|
|
162
|
+
}>;
|
|
23
163
|
};
|
|
24
164
|
};
|
|
25
165
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveForm.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"saveForm.content.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoKZ,CAAC"}
|
|
@@ -22,7 +22,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
24
|
className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
|
|
25
|
-
"aria-label": versionListLabel,
|
|
25
|
+
"aria-label": versionListLabel.value,
|
|
26
26
|
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(components_DropDown_index.DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
|
|
27
27
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_DropDown_index.DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
28
28
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "px-2", children: selectedVersion ?? "LTS" }),
|
|
@@ -46,7 +46,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
46
46
|
border: true,
|
|
47
47
|
roundedSize: "2xl",
|
|
48
48
|
borderColor: "text",
|
|
49
|
-
"aria-label": versionSwitcherLabel,
|
|
49
|
+
"aria-label": versionSwitcherLabel.value,
|
|
50
50
|
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
51
51
|
components_Button_Button.Button,
|
|
52
52
|
{
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":["useDictionary","versionSwitcherContent","useVersionSwitcher","jsx","Fragment","jsxs","DropDown","MoveVertical","Container","Button"],"mappings":";;;;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAAA,cAAA;AAAA,IAC3DC;AAAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1CC,gFAAAA,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAASC,2BAAA,kBAAA,IAAAC,WAAA,kBAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAAD,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY,iBAAiB;AAAA,MAE7B,UAAAE,2BAAA,kBAAA,KAACC,0BAAS,UAAA,EAAA,YAAY,qBACpB,UAAA;AAAA,QAACH,2BAAAA,kBAAAA,IAAAG,0BAAA,SAAS,SAAT,EAAiB,YAAY,qBAC5B,UAACD,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,UAAAF,2BAAA,kBAAA,IAAC,OAAI,EAAA,WAAU,QAAQ,UAAA,mBAAmB,OAAM;AAAA,UAChDA,2BAAAA,kBAAAA,IAACI,YA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"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;CAC7C,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkEpD,CAAC"}
|
|
@@ -20,7 +20,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
className: "border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors",
|
|
23
|
-
"aria-label": versionListLabel,
|
|
23
|
+
"aria-label": versionListLabel.value,
|
|
24
24
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DropDown, { identifier: DROPDOWN_IDENTIFIER, children: [
|
|
25
25
|
/* @__PURE__ */ jsxRuntimeExports.jsx(DropDown.Trigger, { identifier: DROPDOWN_IDENTIFIER, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
26
26
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-2", children: selectedVersion ?? "LTS" }),
|
|
@@ -44,7 +44,7 @@ const VersionSwitcher = ({ panelProps }) => {
|
|
|
44
44
|
border: true,
|
|
45
45
|
roundedSize: "2xl",
|
|
46
46
|
borderColor: "text",
|
|
47
|
-
"aria-label": versionSwitcherLabel,
|
|
47
|
+
"aria-label": versionSwitcherLabel.value,
|
|
48
48
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: "divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1", children: availableVersions.reverse().map((version) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49
49
|
Button,
|
|
50
50
|
{
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\
|
|
1
|
+
{"version":3,"file":"VersionSwitcher.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { MoveVertical } from 'lucide-react';\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button } from '../../Button';\nimport { Container } from '../../Container';\nimport { DropDown, type PanelProps } from '../../DropDown';\nimport { useVersionSwitcher } from './VersionSwitcherContext';\nimport versionSwitcherContent from './versionSwitcherDropDown.content';\n\nexport type VersionSwitcherProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'version-switcher';\n\nexport const VersionSwitcher: FC<VersionSwitcherProps> = ({ panelProps }) => {\n const { switchTo, versionSwitcherLabel, versionListLabel } = useDictionary(\n versionSwitcherContent\n );\n const { selectedVersion, availableVersions, setSelectedVersion } =\n useVersionSwitcher();\n\n if (availableVersions.length === 0) {\n return <></>;\n }\n\n return (\n <div\n className=\"border-text text-text dark:border-text-dark dark:text-text-dark rounded-xl border transition-colors\"\n aria-label={versionListLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2\">{selectedVersion ?? 'LTS'}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"left-auto right-0\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"sm\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={versionSwitcherLabel.value}\n >\n <ol className=\"divide-text/20 dark:divide-text-dark/20 divide-y divide-dashed overflow-y-auto p-1\">\n {availableVersions.reverse().map((version) => (\n <li className=\"px-1.5 py-1\" key={version}>\n <Button\n onClick={() => setSelectedVersion(version)}\n label={`${switchTo} v${version}`}\n isActive={selectedVersion === version}\n variant=\"hoverable\"\n color=\"text\"\n isFullWidth\n textAlign=\"left\"\n size=\"sm\"\n >\n <div className=\"text-neutral dark:text-neutral-dark flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1 text-sm\">\n {version}\n </div>\n </Button>\n </li>\n ))}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"names":["jsx","Fragment","jsxs"],"mappings":";;;;;;;;;AAeA,MAAM,sBAAsB;AAErB,MAAM,kBAA4C,CAAC,EAAE,iBAAiB;AAC3E,QAAM,EAAE,UAAU,sBAAsB,iBAAqB,IAAA;AAAA,IAC3D;AAAA,EACF;AACA,QAAM,EAAE,iBAAiB,mBAAmB,mBAAA,IAC1C,mBAAmB;AAEjB,MAAA,kBAAkB,WAAW,GAAG;AAClC,WAASA,kCAAA,IAAAC,kBAAA,UAAA,EAAA;AAAA,EAAA;AAIT,SAAAD,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY,iBAAiB;AAAA,MAE7B,UAAAE,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AAA,MACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n type FC,\n} from 'react';\
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.cjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n type FC,\n} from 'react';\nimport { usePersistedStore } from '../../../hooks';\n\ntype VersionSwitcherContextProps = {\n availableVersions: string[];\n selectedVersion: string | null;\n setSelectedVersion: Dispatch<SetStateAction<string | null>>;\n};\n\nconst VersionSwitcherContext = createContext<VersionSwitcherContextProps>({\n availableVersions: [],\n selectedVersion: null,\n setSelectedVersion: () => {},\n});\n\nexport const useVersionSwitcher = () => useContext(VersionSwitcherContext);\n\ntype VersionSwitcherProviderProps = {\n availableVersions: string[];\n defaultSelectedVersion?: string;\n};\n\nexport const VersionSwitcherProvider: FC<\n PropsWithChildren<VersionSwitcherProviderProps>\n> = ({ availableVersions, defaultSelectedVersion, children }) => {\n const [selectedVersion, setSelectedVersion] = usePersistedStore<\n string | null\n >('version-selector', defaultSelectedVersion);\n\n return (\n <VersionSwitcherContext.Provider\n value={{\n availableVersions,\n selectedVersion,\n setSelectedVersion,\n }}\n >\n {children}\n </VersionSwitcherContext.Provider>\n );\n};\n"],"names":["createContext","useContext","usePersistedStore","jsx"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,yBAAyBA,WAAAA,cAA2C;AAAA,EACxE,mBAAmB,CAAC;AAAA,EACpB,iBAAiB;AAAA,EACjB,oBAAoB,MAAM;AAAA,EAAA;AAC5B,CAAC;AAEY,MAAA,qBAAqB,MAAMC,WAAAA,WAAW,sBAAsB;AAOlE,MAAM,0BAET,CAAC,EAAE,mBAAmB,wBAAwB,eAAe;AAC/D,QAAM,CAAC,iBAAiB,kBAAkB,IAAIC,wBAAAA,kBAE5C,oBAAoB,sBAAsB;AAG1C,SAAAC,2BAAA,kBAAA;AAAA,IAAC,uBAAuB;AAAA,IAAvB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAGf,KAAK,2BAA2B,GAAG;IACjC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC7D,CAAC;AAQF,eAAO,MAAM,kBAAkB,mCAA2C,CAAC;AAE3E,KAAK,4BAA4B,GAAG;IAClC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,EAAE,CACtC,iBAAiB,CAAC,4BAA4B,CAAC,CAiBhD,CAAC"}
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSwitcherContext.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n type FC,\n} from 'react';\
|
|
1
|
+
{"version":3,"file":"VersionSwitcherContext.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n type FC,\n} from 'react';\nimport { usePersistedStore } from '../../../hooks';\n\ntype VersionSwitcherContextProps = {\n availableVersions: string[];\n selectedVersion: string | null;\n setSelectedVersion: Dispatch<SetStateAction<string | null>>;\n};\n\nconst VersionSwitcherContext = createContext<VersionSwitcherContextProps>({\n availableVersions: [],\n selectedVersion: null,\n setSelectedVersion: () => {},\n});\n\nexport const useVersionSwitcher = () => useContext(VersionSwitcherContext);\n\ntype VersionSwitcherProviderProps = {\n availableVersions: string[];\n defaultSelectedVersion?: string;\n};\n\nexport const VersionSwitcherProvider: FC<\n PropsWithChildren<VersionSwitcherProviderProps>\n> = ({ availableVersions, defaultSelectedVersion, children }) => {\n const [selectedVersion, setSelectedVersion] = usePersistedStore<\n string | null\n >('version-selector', defaultSelectedVersion);\n\n return (\n <VersionSwitcherContext.Provider\n value={{\n availableVersions,\n selectedVersion,\n setSelectedVersion,\n }}\n >\n {children}\n </VersionSwitcherContext.Provider>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;;;;;AAkBA,MAAM,yBAAyB,cAA2C;AAAA,EACxE,mBAAmB,CAAC;AAAA,EACpB,iBAAiB;AAAA,EACjB,oBAAoB,MAAM;AAAA,EAAA;AAC5B,CAAC;AAEY,MAAA,qBAAqB,MAAM,WAAW,sBAAsB;AAOlE,MAAM,0BAET,CAAC,EAAE,mBAAmB,wBAAwB,eAAe;AAC/D,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,kBAE5C,oBAAoB,sBAAsB;AAG1C,SAAAA,kCAAA;AAAA,IAAC,uBAAuB;AAAA,IAAvB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|