@intlayer/design-system 3.5.5 → 3.5.6
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 +241 -17
- package/dist/CodeBlockShiki-BlmZyrr7.cjs +29 -0
- package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +1 -0
- package/dist/CodeBlockShiki-CcpV9SVi.js +29 -0
- package/dist/CodeBlockShiki-CcpV9SVi.js.map +1 -0
- package/dist/Form-BB0kpER9.cjs +301 -0
- package/dist/Form-BB0kpER9.cjs.map +1 -0
- package/dist/Form-BDcoNTLV.cjs.map +1 -1
- package/dist/Form-DGLgTAdY.js +302 -0
- package/dist/Form-DGLgTAdY.js.map +1 -0
- package/dist/Form-DhsgC7kB.js.map +1 -1
- package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +11 -11
- package/dist/components/Breadcrumb/index.cjs +5 -2
- 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 +5 -2
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/ClickOutsideDiv/index.cjs +26 -0
- package/dist/components/ClickOutsideDiv/index.cjs.map +1 -0
- package/dist/components/ClickOutsideDiv/index.d.ts +6 -0
- package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -0
- package/dist/components/ClickOutsideDiv/index.mjs +26 -0
- package/dist/components/ClickOutsideDiv/index.mjs.map +1 -0
- package/dist/components/ContentEditor/ContentEditorCode.cjs +78 -0
- package/dist/components/ContentEditor/ContentEditorCode.cjs.map +1 -0
- package/dist/components/ContentEditor/ContentEditorCode.d.ts +11 -0
- package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +1 -0
- package/dist/components/ContentEditor/ContentEditorCode.mjs +78 -0
- package/dist/components/ContentEditor/ContentEditorCode.mjs.map +1 -0
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +30 -26
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +2 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +30 -26
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +3 -3
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +3 -3
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +161 -69
- 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 +163 -71
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +123 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +14 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +123 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +9 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +15 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +15 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +6 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +9 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +12 -4
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +12 -4
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +7 -5
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +7 -5
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +117 -55
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts +4 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +115 -53
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +8 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +13 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +10 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +10 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +23 -10
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts +2 -0
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +23 -10
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -4
- 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 +3 -5
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +13 -13
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +13 -13
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +73 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +7 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +73 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +37 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +14 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +37 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs +8 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts +3 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs +8 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/index.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +54 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +10 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +55 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/index.cjs +5 -0
- package/dist/components/DictionaryFieldEditor/index.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/index.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/index.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/index.mjs +6 -1
- package/dist/components/DictionaryFieldEditor/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs +5 -1
- package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs +6 -2
- package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -8
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -8
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/Form/FormLabel.cjs +6 -2
- package/dist/components/Form/FormLabel.cjs.map +1 -1
- package/dist/components/Form/FormLabel.d.ts.map +1 -1
- package/dist/components/Form/FormLabel.mjs +6 -2
- package/dist/components/Form/FormLabel.mjs.map +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
- package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/components/IDE/Code.cjs +77 -0
- package/dist/components/IDE/Code.cjs.map +1 -0
- package/dist/components/IDE/Code.d.ts +18 -0
- package/dist/components/IDE/Code.d.ts.map +1 -0
- package/dist/components/IDE/Code.mjs +77 -0
- package/dist/components/IDE/Code.mjs.map +1 -0
- package/dist/components/IDE/CodeBlock.cjs +54 -0
- package/dist/components/IDE/CodeBlock.cjs.map +1 -0
- package/dist/components/IDE/CodeBlock.d.ts +12 -0
- package/dist/components/IDE/CodeBlock.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlock.mjs +54 -0
- package/dist/components/IDE/CodeBlock.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockClient.cjs +55 -0
- package/dist/components/IDE/CodeBlockClient.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockClient.mjs +55 -0
- package/dist/components/IDE/CodeBlockClient.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.cjs +28 -0
- package/dist/components/IDE/CodeBlockLoader.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.d.ts +4 -0
- package/dist/components/IDE/CodeBlockLoader.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockLoader.mjs +28 -0
- package/dist/components/IDE/CodeBlockLoader.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockServer.cjs +53 -0
- package/dist/components/IDE/CodeBlockServer.cjs.map +1 -0
- package/dist/components/IDE/CodeBlockServer.d.ts +12 -0
- package/dist/components/IDE/CodeBlockServer.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockServer.mjs +53 -0
- package/dist/components/IDE/CodeBlockServer.mjs.map +1 -0
- package/dist/components/IDE/CodeBlockShiki.d.ts +3 -0
- package/dist/components/IDE/CodeBlockShiki.d.ts.map +1 -0
- package/dist/components/IDE/CodeBlockclient.d.ts +12 -0
- package/dist/components/IDE/CodeBlockclient.d.ts.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.cjs +20 -0
- package/dist/components/IDE/CodeConditionalRenderer.cjs.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.d.ts +4 -0
- package/dist/components/IDE/CodeConditionalRenderer.d.ts.map +1 -0
- package/dist/components/IDE/CodeConditionalRenderer.mjs +20 -0
- package/dist/components/IDE/CodeConditionalRenderer.mjs.map +1 -0
- package/dist/components/IDE/CodeContext.cjs +57 -0
- package/dist/components/IDE/CodeContext.cjs.map +1 -0
- package/dist/components/IDE/CodeContext.d.ts +26 -0
- package/dist/components/IDE/CodeContext.d.ts.map +1 -0
- package/dist/components/IDE/CodeContext.mjs +57 -0
- package/dist/components/IDE/CodeContext.mjs.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.cjs +30 -0
- package/dist/components/IDE/CodeFormatSelector.cjs.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.d.ts +3 -0
- package/dist/components/IDE/CodeFormatSelector.d.ts.map +1 -0
- package/dist/components/IDE/CodeFormatSelector.mjs +30 -0
- package/dist/components/IDE/CodeFormatSelector.mjs.map +1 -0
- package/dist/components/IDE/CodeRenderer.cjs +27 -0
- package/dist/components/IDE/CodeRenderer.cjs.map +1 -0
- package/dist/components/IDE/CodeRenderer.d.ts +5 -0
- package/dist/components/IDE/CodeRenderer.d.ts.map +1 -0
- package/dist/components/IDE/CodeRenderer.mjs +27 -0
- package/dist/components/IDE/CodeRenderer.mjs.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.cjs +28 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.cjs.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts +3 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.d.ts.map +1 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.mjs +28 -0
- package/dist/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -0
- package/dist/components/IDE/EditableCodeBlock.d.ts +9 -0
- package/dist/components/IDE/EditableCodeBlock.d.ts.map +1 -0
- package/dist/components/IDE/MarkDownRender.cjs +2 -3
- package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.d.ts.map +1 -1
- package/dist/components/IDE/MarkDownRender.mjs +1 -2
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/IDE/PackageManagerSelector.cjs +20 -0
- package/dist/components/IDE/PackageManagerSelector.cjs.map +1 -0
- package/dist/components/IDE/PackageManagerSelector.d.ts +3 -0
- package/dist/components/IDE/PackageManagerSelector.d.ts.map +1 -0
- package/dist/components/IDE/PackageManagerSelector.mjs +20 -0
- package/dist/components/IDE/PackageManagerSelector.mjs.map +1 -0
- package/dist/components/IDE/index.cjs +2 -2
- package/dist/components/IDE/index.d.ts +1 -1
- package/dist/components/IDE/index.d.ts.map +1 -1
- package/dist/components/IDE/index.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +13 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +218 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +218 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +42 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +15 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +42 -0
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.cjs +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.d.ts +3 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.mjs +8 -0
- package/dist/components/LocaleSwitcherContentDropDown/index.mjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +118 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +18 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +119 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -0
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs +14 -22
- 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 +14 -22
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs +20 -26
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts +2 -0
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +20 -26
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +3 -3
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +3 -3
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +4 -0
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.d.ts.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +5 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/index.cjs +16 -4
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +15 -3
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +8 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +9 -2
- package/dist/hooks/intlayerAPIHooks.cjs +80 -5
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +12 -2
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +80 -5
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +1 -5
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +1 -5
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +4 -2
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +4 -1
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs +4 -2
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +11 -2
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +17 -5
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +17 -5
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/libs/intlayer-api/ai.cjs +33 -3
- package/dist/libs/intlayer-api/ai.cjs.map +1 -1
- package/dist/libs/intlayer-api/ai.d.ts +9 -3
- package/dist/libs/intlayer-api/ai.d.ts.map +1 -1
- package/dist/libs/intlayer-api/ai.mjs +33 -3
- package/dist/libs/intlayer-api/ai.mjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.cjs +2 -2
- package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.d.ts +3 -3
- package/dist/libs/intlayer-api/dictionary.d.ts.map +1 -1
- package/dist/libs/intlayer-api/dictionary.mjs +2 -2
- package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
- package/dist/libs/intlayer-api/index.cjs +3 -1
- package/dist/libs/intlayer-api/index.cjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +22 -4
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/libs/intlayer-api/index.mjs +3 -1
- package/dist/libs/intlayer-api/index.mjs.map +1 -1
- package/dist/libs/intlayer-api/tag.cjs +52 -0
- package/dist/libs/intlayer-api/tag.cjs.map +1 -0
- package/dist/libs/intlayer-api/tag.d.ts +16 -0
- package/dist/libs/intlayer-api/tag.d.ts.map +1 -0
- package/dist/libs/intlayer-api/tag.mjs +52 -0
- package/dist/libs/intlayer-api/tag.mjs.map +1 -0
- package/dist/tailwind.css +1 -1
- package/package.json +13 -14
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { t } from "intlayer";
|
|
2
|
+
const versionSwitcherContent = {
|
|
3
|
+
key: "version-switcher",
|
|
4
|
+
content: {
|
|
5
|
+
versionSwitcherLabel: t({
|
|
6
|
+
en: "Version selector",
|
|
7
|
+
"en-GB": "Version selector",
|
|
8
|
+
fr: "Sélecteur de version",
|
|
9
|
+
es: "Selector de versión",
|
|
10
|
+
de: "Version wähler",
|
|
11
|
+
ja: "バージョンセレクター",
|
|
12
|
+
ko: "버전 선택기",
|
|
13
|
+
zh: "版本选择器",
|
|
14
|
+
it: "Selettore di versione",
|
|
15
|
+
pt: "Seletor de versão",
|
|
16
|
+
hi: "संस्करण चयनकर्ता",
|
|
17
|
+
ar: "منتقي الإصدار",
|
|
18
|
+
ru: "Выбор версии"
|
|
19
|
+
}),
|
|
20
|
+
versionListLabel: t({
|
|
21
|
+
en: "Version list",
|
|
22
|
+
"en-GB": "Version list",
|
|
23
|
+
fr: "Liste des versions",
|
|
24
|
+
es: "Lista de versiones",
|
|
25
|
+
de: "Versionsliste",
|
|
26
|
+
ja: "バージョンリスト",
|
|
27
|
+
ko: "버전 목록",
|
|
28
|
+
zh: "版本列表",
|
|
29
|
+
it: "Elenco delle versioni",
|
|
30
|
+
pt: "Lista de versões",
|
|
31
|
+
hi: "संस्करण सूची",
|
|
32
|
+
ar: "قائمة الإصدارات",
|
|
33
|
+
ru: "Список версий"
|
|
34
|
+
}),
|
|
35
|
+
switchTo: t({
|
|
36
|
+
en: "Switch to",
|
|
37
|
+
fr: "Passer à",
|
|
38
|
+
es: "Cambiar a",
|
|
39
|
+
"en-GB": "Switch to",
|
|
40
|
+
de: "Wechseln Sie zu",
|
|
41
|
+
ja: "に切り替える",
|
|
42
|
+
ko: "전환",
|
|
43
|
+
zh: "切换到",
|
|
44
|
+
it: "Passa a",
|
|
45
|
+
pt: "Mudar para",
|
|
46
|
+
hi: "स्विच करें",
|
|
47
|
+
ar: "التبديل إلى",
|
|
48
|
+
ru: "Переключиться на"
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
versionSwitcherContent as default
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=versionSwitcherDropDown.content.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionSwitcherDropDown.content.mjs","sources":["../../../../src/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.ts"],"sourcesContent":["import { t, type DeclarationContent } from 'intlayer';\n\nconst versionSwitcherContent = {\n key: 'version-switcher',\n content: {\n versionSwitcherLabel: t({\n en: 'Version selector',\n 'en-GB': 'Version selector',\n fr: 'Sélecteur de version',\n es: 'Selector de versión',\n de: 'Version wähler',\n ja: 'バージョンセレクター',\n ko: '버전 선택기',\n zh: '版本选择器',\n it: 'Selettore di versione',\n pt: 'Seletor de versão',\n hi: 'संस्करण चयनकर्ता',\n ar: 'منتقي الإصدار',\n ru: 'Выбор версии',\n }),\n versionListLabel: t({\n en: 'Version list',\n 'en-GB': 'Version list',\n fr: 'Liste des versions',\n es: 'Lista de versiones',\n de: 'Versionsliste',\n ja: 'バージョンリスト',\n ko: '버전 목록',\n zh: '版本列表',\n it: 'Elenco delle versioni',\n pt: 'Lista de versões',\n hi: 'संस्करण सूची',\n ar: 'قائمة الإصدارات',\n ru: 'Список версий',\n }),\n switchTo: t({\n en: 'Switch to',\n fr: 'Passer à',\n es: 'Cambiar a',\n 'en-GB': 'Switch to',\n de: 'Wechseln Sie zu',\n ja: 'に切り替える',\n ko: '전환',\n zh: '切换到',\n it: 'Passa a',\n pt: 'Mudar para',\n hi: 'स्विच करें',\n ar: 'التبديل إلى',\n ru: 'Переключиться на',\n }),\n },\n} satisfies DeclarationContent;\n\nexport default versionSwitcherContent;\n"],"names":[],"mappings":";AAEA,MAAM,yBAAyB;AAAA,EAC7B,KAAK;AAAA,EACL,SAAS;AAAA,IACP,sBAAsB,EAAE;AAAA,MACtB,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,kBAAkB,EAAE;AAAA,MAClB,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,IACD,UAAU,EAAE;AAAA,MACV,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACL,CAAA;AAAA,EAAA;AAEL;"}
|
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const components_DictionaryFieldEditor_DictionariesSelector_DictionariesSelector = require("./DictionariesSelector/DictionariesSelector.cjs");
|
|
4
4
|
const components_DictionaryFieldEditor_DictionaryCreationForm_DictionaryCreationForm = require("./DictionaryCreationForm/DictionaryCreationForm.cjs");
|
|
5
5
|
const components_DictionaryFieldEditor_DictionaryFieldEditor = require("./DictionaryFieldEditor.cjs");
|
|
6
|
+
const components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcher = require("./VersionSwitcherDropDown/VersionSwitcher.cjs");
|
|
7
|
+
const components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext = require("./VersionSwitcherDropDown/VersionSwitcherContext.cjs");
|
|
6
8
|
exports.DictionariesSelector = components_DictionaryFieldEditor_DictionariesSelector_DictionariesSelector.DictionariesSelector;
|
|
7
9
|
exports.DictionaryCreationForm = components_DictionaryFieldEditor_DictionaryCreationForm_DictionaryCreationForm.DictionaryCreationForm;
|
|
8
10
|
exports.DictionaryFieldEditor = components_DictionaryFieldEditor_DictionaryFieldEditor.DictionaryFieldEditor;
|
|
11
|
+
exports.VersionSwitcher = components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcher.VersionSwitcher;
|
|
12
|
+
exports.VersionSwitcherProvider = components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext.VersionSwitcherProvider;
|
|
13
|
+
exports.useVersionSwitcher = components_DictionaryFieldEditor_VersionSwitcherDropDown_VersionSwitcherContext.useVersionSwitcher;
|
|
9
14
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryFieldEditor/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { DictionariesSelector } from "./DictionariesSelector/DictionariesSelector.mjs";
|
|
2
2
|
import { DictionaryCreationForm } from "./DictionaryCreationForm/DictionaryCreationForm.mjs";
|
|
3
3
|
import { DictionaryFieldEditor } from "./DictionaryFieldEditor.mjs";
|
|
4
|
+
import { VersionSwitcher } from "./VersionSwitcherDropDown/VersionSwitcher.mjs";
|
|
5
|
+
import { VersionSwitcherProvider, useVersionSwitcher } from "./VersionSwitcherDropDown/VersionSwitcherContext.mjs";
|
|
4
6
|
export {
|
|
5
7
|
DictionariesSelector,
|
|
6
8
|
DictionaryCreationForm,
|
|
7
|
-
DictionaryFieldEditor
|
|
9
|
+
DictionaryFieldEditor,
|
|
10
|
+
VersionSwitcher,
|
|
11
|
+
VersionSwitcherProvider,
|
|
12
|
+
useVersionSwitcher
|
|
8
13
|
};
|
|
9
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -19,7 +19,11 @@ const EditableFieldInput = require$$0.forwardRef(({ onSave, onCancel, ...props }
|
|
|
19
19
|
onCancel?.();
|
|
20
20
|
};
|
|
21
21
|
require$$0.useImperativeHandle(ref, () => inputRef.current);
|
|
22
|
-
const value =
|
|
22
|
+
const value = require$$0.useMemo(
|
|
23
|
+
() => props.value ?? inputRef.current?.value ?? props.defaultValue,
|
|
24
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
|
+
[props.value, props.defaultValue, inputRef.current?.value]
|
|
26
|
+
);
|
|
23
27
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
24
28
|
components_EditableField_EditableFieldLayout.EditableFieldLayout,
|
|
25
29
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldInput.cjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value
|
|
1
|
+
{"version":3,"file":"EditableFieldInput.cjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value = useMemo(\n () =>\n (props.value as string) ??\n inputRef.current?.value ??\n (props.defaultValue as string),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.value, props.defaultValue, inputRef.current?.value]\n );\n\n return (\n <EditableFieldLayout\n value={value}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldInput.displayName = 'EditableFieldInput';\n"],"names":["forwardRef","useRef","useImperativeHandle","useMemo","jsx","EditableFieldLayout","Input"],"mappings":";;;;;;;;;AAWa,MAAA,qBAAqBA,sBAGhC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,WAAWC,kBAAyB,IAAI;AAE9C,QAAM,aAAa,MAAM;AAEd,aAAA,SAAS,SAAS,SAAS,EAAE;AAAA,EACxC;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAAA;AAEjD,eAAA;AAAA,EACb;AAGoBC,aAAAA,oBAAA,KAAK,MAAM,SAAS,OAAQ;AAEhD,QAAM,QAAQC,WAAA;AAAA,IACZ,MACG,MAAM,SACP,SAAS,SAAS,SACjB,MAAM;AAAA;AAAA,IAET,CAAC,MAAM,OAAO,MAAM,cAAc,SAAS,SAAS,KAAK;AAAA,EAC3D;AAGE,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,UAACD,2BAAA,kBAAA,IAAAE,uBAAA,OAAA,EAAM,KAAK,UAAW,GAAG,MAAO,CAAA;AAAA,IAAA;AAAA,EACnC;AAEJ,CAAC;AAED,mBAAmB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGlD,KAAK,uBAAuB,GAAG,UAAU,GAAG;IAC1C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"EditableFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGlD,KAAK,uBAAuB,GAAG,UAAU,GAAG;IAC1C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mIAuC7B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
|
-
import { forwardRef, useRef, useImperativeHandle } from "react";
|
|
3
|
+
import { forwardRef, useRef, useImperativeHandle, useMemo } from "react";
|
|
4
4
|
import { Input } from "../Input/Input.mjs";
|
|
5
5
|
import "../Input/InputPassword.mjs";
|
|
6
6
|
import "../Input/Checkbox.mjs";
|
|
@@ -17,7 +17,11 @@ const EditableFieldInput = forwardRef(({ onSave, onCancel, ...props }, ref) => {
|
|
|
17
17
|
onCancel?.();
|
|
18
18
|
};
|
|
19
19
|
useImperativeHandle(ref, () => inputRef.current);
|
|
20
|
-
const value =
|
|
20
|
+
const value = useMemo(
|
|
21
|
+
() => props.value ?? inputRef.current?.value ?? props.defaultValue,
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
[props.value, props.defaultValue, inputRef.current?.value]
|
|
24
|
+
);
|
|
21
25
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22
26
|
EditableFieldLayout,
|
|
23
27
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldInput.mjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value
|
|
1
|
+
{"version":3,"file":"EditableFieldInput.mjs","sources":["../../../src/components/EditableField/EditableFieldInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';\nimport { Input, type InputProps } from '../Input';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldInputProps = InputProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldInput = forwardRef<\n HTMLInputElement,\n EditableFieldInputProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(inputRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (inputRef.current) {\n inputRef.current.value = inputRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n // Expose the input ref to parent components\n useImperativeHandle(ref, () => inputRef.current!);\n\n const value = useMemo(\n () =>\n (props.value as string) ??\n inputRef.current?.value ??\n (props.defaultValue as string),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.value, props.defaultValue, inputRef.current?.value]\n );\n\n return (\n <EditableFieldLayout\n value={value}\n onCancel={handleCancel}\n onSave={handleSave}\n >\n <Input ref={inputRef} {...props} />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldInput.displayName = 'EditableFieldInput';\n"],"names":["jsx"],"mappings":";;;;;;;AAWa,MAAA,qBAAqB,WAGhC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,WAAW,OAAyB,IAAI;AAE9C,QAAM,aAAa,MAAM;AAEd,aAAA,SAAS,SAAS,SAAS,EAAE;AAAA,EACxC;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,IAAA;AAEjD,eAAA;AAAA,EACb;AAGoB,sBAAA,KAAK,MAAM,SAAS,OAAQ;AAEhD,QAAM,QAAQ;AAAA,IACZ,MACG,MAAM,SACP,SAAS,SAAS,SACjB,MAAM;AAAA;AAAA,IAET,CAAC,MAAM,OAAO,MAAM,cAAc,SAAS,SAAS,KAAK;AAAA,EAC3D;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MAER,UAACA,kCAAA,IAAA,OAAA,EAAM,KAAK,UAAW,GAAG,MAAO,CAAA;AAAA,IAAA;AAAA,EACnC;AAEJ,CAAC;AAED,mBAAmB,cAAc;"}
|
|
@@ -19,14 +19,9 @@ const EditableFieldTextArea = require$$0.forwardRef(({ onSave, onCancel, ...prop
|
|
|
19
19
|
onCancel?.();
|
|
20
20
|
};
|
|
21
21
|
const memoValue = require$$0.useMemo(
|
|
22
|
-
() =>
|
|
22
|
+
() => props.value ?? textAreaRef.current?.value ?? props.defaultValue ?? "",
|
|
23
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
[
|
|
25
|
-
props.value,
|
|
26
|
-
props.defaultValue,
|
|
27
|
-
textAreaRef.current?.value,
|
|
28
|
-
textAreaRef.current?.defaultValue
|
|
29
|
-
]
|
|
24
|
+
[props.value, props.defaultValue, textAreaRef.current?.value]
|
|
30
25
|
);
|
|
31
26
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
32
27
|
components_EditableField_EditableFieldLayout.EditableFieldLayout,
|
|
@@ -41,7 +36,6 @@ const EditableFieldTextArea = require$$0.forwardRef(({ onSave, onCancel, ...prop
|
|
|
41
36
|
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
42
37
|
components_TextArea_AutoSizeTextArea.AutoSizedTextArea,
|
|
43
38
|
{
|
|
44
|
-
defaultValue: memoValue,
|
|
45
39
|
className: "leading-6",
|
|
46
40
|
ref: textAreaRef,
|
|
47
41
|
onClick: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea = forwardRef<\n HTMLTextAreaElement,\n EditableFieldTextAreaProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue = useMemo(\n () =>\n
|
|
1
|
+
{"version":3,"file":"EditableFieldTextArea.cjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea = forwardRef<\n HTMLTextAreaElement,\n EditableFieldTextAreaProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue = useMemo(\n () =>\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '',\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.value, props.defaultValue, textAreaRef.current?.value]\n );\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldTextArea.displayName = 'EditableFieldTextArea';\n"],"names":["forwardRef","useRef","useImperativeHandle","useMemo","jsx","EditableFieldLayout","AutoSizedTextArea"],"mappings":";;;;;;;;AAWa,MAAA,wBAAwBA,sBAGnC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,cAAcC,kBAA4B,IAAI;AAGhCC,aAAAA,oBAAA,KAAK,MAAM,YAAY,OAAQ;AAEnD,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YAAYC,WAAA;AAAA,IAChB,MACG,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAAA;AAAA,IAEF,CAAC,MAAM,OAAO,MAAM,cAAc,YAAY,SAAS,KAAK;AAAA,EAC9D;AAGE,SAAAC,2BAAA,kBAAA;AAAA,IAACC,6CAAA;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAAD,2BAAA,kBAAA;AAAA,QAACE,qCAAA;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ,CAAC;AAED,sBAAsB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG7E,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"EditableFieldTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG7E,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,yIAoDhC,CAAC"}
|
|
@@ -17,14 +17,9 @@ const EditableFieldTextArea = forwardRef(({ onSave, onCancel, ...props }, ref) =
|
|
|
17
17
|
onCancel?.();
|
|
18
18
|
};
|
|
19
19
|
const memoValue = useMemo(
|
|
20
|
-
() =>
|
|
20
|
+
() => props.value ?? textAreaRef.current?.value ?? props.defaultValue ?? "",
|
|
21
21
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
|
-
[
|
|
23
|
-
props.value,
|
|
24
|
-
props.defaultValue,
|
|
25
|
-
textAreaRef.current?.value,
|
|
26
|
-
textAreaRef.current?.defaultValue
|
|
27
|
-
]
|
|
22
|
+
[props.value, props.defaultValue, textAreaRef.current?.value]
|
|
28
23
|
);
|
|
29
24
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
30
25
|
EditableFieldLayout,
|
|
@@ -39,7 +34,6 @@ const EditableFieldTextArea = forwardRef(({ onSave, onCancel, ...props }, ref) =
|
|
|
39
34
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
40
35
|
AutoSizedTextArea,
|
|
41
36
|
{
|
|
42
|
-
defaultValue: memoValue,
|
|
43
37
|
className: "leading-6",
|
|
44
38
|
ref: textAreaRef,
|
|
45
39
|
onClick: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldTextArea.mjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea = forwardRef<\n HTMLTextAreaElement,\n EditableFieldTextAreaProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue = useMemo(\n () =>\n
|
|
1
|
+
{"version":3,"file":"EditableFieldTextArea.mjs","sources":["../../../src/components/EditableField/EditableFieldTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';\nimport { AutoSizedTextArea, type AutoSizedTextAreaProps } from '../TextArea';\nimport { EditableFieldLayout } from './EditableFieldLayout';\n\ntype EditableFieldTextAreaProps = AutoSizedTextAreaProps & {\n onSave?: (value: string) => void;\n onCancel?: () => void;\n};\n\nexport const EditableFieldTextArea = forwardRef<\n HTMLTextAreaElement,\n EditableFieldTextAreaProps\n>(({ onSave, onCancel, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n // Expose the text area ref to parent components\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const handleSave = () => {\n // Your save logic here\n onSave?.(textAreaRef.current?.value ?? '');\n };\n\n const handleCancel = () => {\n if (textAreaRef.current) {\n textAreaRef.current.value = textAreaRef.current.defaultValue ?? '';\n }\n onCancel?.();\n };\n\n const memoValue = useMemo(\n () =>\n (props.value as string) ??\n textAreaRef.current?.value ??\n (props.defaultValue as string) ??\n '',\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.value, props.defaultValue, textAreaRef.current?.value]\n );\n\n return (\n <EditableFieldLayout\n value={memoValue}\n onCancel={handleCancel}\n onSave={handleSave}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <AutoSizedTextArea\n className=\"leading-6\"\n ref={textAreaRef}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n {...props}\n />\n </EditableFieldLayout>\n );\n});\n\nEditableFieldTextArea.displayName = 'EditableFieldTextArea';\n"],"names":["jsx"],"mappings":";;;;;;AAWa,MAAA,wBAAwB,WAGnC,CAAC,EAAE,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AACnC,QAAA,cAAc,OAA4B,IAAI;AAGhC,sBAAA,KAAK,MAAM,YAAY,OAAQ;AAEnD,QAAM,aAAa,MAAM;AAEd,aAAA,YAAY,SAAS,SAAS,EAAE;AAAA,EAC3C;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY,SAAS;AACvB,kBAAY,QAAQ,QAAQ,YAAY,QAAQ,gBAAgB;AAAA,IAAA;AAEvD,eAAA;AAAA,EACb;AAEA,QAAM,YAAY;AAAA,IAChB,MACG,MAAM,SACP,YAAY,SAAS,SACpB,MAAM,gBACP;AAAA;AAAA,IAEF,CAAC,MAAM,OAAO,MAAM,cAAc,YAAY,SAAS,KAAK;AAAA,EAC9D;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,MAEA,UAAAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,KAAK;AAAA,UACL,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,cAAE,gBAAgB;AAAA,UACpB;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ,CAAC;AAED,sBAAsB,cAAc;"}
|
|
@@ -6,12 +6,16 @@ const require$$0 = require("react");
|
|
|
6
6
|
const utils_cn = require("../../utils/cn.cjs");
|
|
7
7
|
const components_Label_index = require("../Label/index.cjs");
|
|
8
8
|
const components_Form_FormField = require("./FormField.cjs");
|
|
9
|
-
const FormLabel = require$$0.forwardRef((props, ref) => {
|
|
9
|
+
const FormLabel = require$$0.forwardRef(({ className, ...props }, ref) => {
|
|
10
10
|
const { error, formItemId } = components_Form_FormField.useFormField();
|
|
11
11
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
12
12
|
components_Label_index.Label,
|
|
13
13
|
{
|
|
14
|
-
className: utils_cn.cn(
|
|
14
|
+
className: utils_cn.cn(
|
|
15
|
+
"mb-2",
|
|
16
|
+
error && "text-error dark:text-error-dark",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
15
19
|
ref,
|
|
16
20
|
htmlFor: formItemId,
|
|
17
21
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.cjs","sources":["../../../src/components/Form/FormLabel.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ElementRef,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\nimport { useFormField } from './FormField';\n\nexport const FormLabel = forwardRef<\n ElementRef<typeof Label>,\n ComponentPropsWithoutRef<typeof Label>\n>((props, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n className={cn(error && 'text-error dark:text-error-dark')}\n ref={ref}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n"],"names":["forwardRef","useFormField","jsx","Label","cn"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"FormLabel.cjs","sources":["../../../src/components/Form/FormLabel.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ElementRef,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\nimport { useFormField } from './FormField';\n\nexport const FormLabel = forwardRef<\n ElementRef<typeof Label>,\n ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n className={cn(\n 'mb-2',\n error && 'text-error dark:text-error-dark',\n className\n )}\n ref={ref}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n"],"names":["forwardRef","useFormField","jsx","Label","cn"],"mappings":";;;;;;;;AAWa,MAAA,YAAYA,sBAGvB,CAAC,EAAE,WAAW,GAAG,SAAS,QAAQ;AAClC,QAAM,EAAE,OAAO,WAAW,IAAIC,uCAAa;AAGzC,SAAAC,2BAAA,kBAAA;AAAA,IAACC,uBAAA;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACA,SAAS;AAAA,QACT;AAAA,MACF;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACR,GAAG;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;AACD,UAAU,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.d.ts","sourceRoot":"","sources":["../../../src/components/Form/FormLabel.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"FormLabel.d.ts","sourceRoot":"","sources":["../../../src/components/Form/FormLabel.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,mNAkBpB,CAAC"}
|
|
@@ -4,12 +4,16 @@ import { forwardRef } from "react";
|
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
5
|
import { Label } from "../Label/index.mjs";
|
|
6
6
|
import { useFormField } from "./FormField.mjs";
|
|
7
|
-
const FormLabel = forwardRef((props, ref) => {
|
|
7
|
+
const FormLabel = forwardRef(({ className, ...props }, ref) => {
|
|
8
8
|
const { error, formItemId } = useFormField();
|
|
9
9
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10
10
|
Label,
|
|
11
11
|
{
|
|
12
|
-
className: cn(
|
|
12
|
+
className: cn(
|
|
13
|
+
"mb-2",
|
|
14
|
+
error && "text-error dark:text-error-dark",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
13
17
|
ref,
|
|
14
18
|
htmlFor: formItemId,
|
|
15
19
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.mjs","sources":["../../../src/components/Form/FormLabel.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ElementRef,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\nimport { useFormField } from './FormField';\n\nexport const FormLabel = forwardRef<\n ElementRef<typeof Label>,\n ComponentPropsWithoutRef<typeof Label>\n>((props, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n className={cn(error && 'text-error dark:text-error-dark')}\n ref={ref}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n"],"names":["jsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"FormLabel.mjs","sources":["../../../src/components/Form/FormLabel.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ElementRef,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\nimport { useFormField } from './FormField';\n\nexport const FormLabel = forwardRef<\n ElementRef<typeof Label>,\n ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n className={cn(\n 'mb-2',\n error && 'text-error dark:text-error-dark',\n className\n )}\n ref={ref}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n"],"names":["jsx"],"mappings":";;;;;;AAWa,MAAA,YAAY,WAGvB,CAAC,EAAE,WAAW,GAAG,SAAS,QAAQ;AAClC,QAAM,EAAE,OAAO,WAAW,IAAI,aAAa;AAGzC,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS;AAAA,QACT;AAAA,MACF;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACR,GAAG;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;AACD,UAAU,cAAc;"}
|
|
@@ -3,7 +3,7 @@ import { EditableFieldInput } from '../../EditableField/EditableFieldInput';
|
|
|
3
3
|
import { FormElementProps } from './FormElement';
|
|
4
4
|
type EditableFieldInputElementProps = Omit<FormElementProps<typeof EditableFieldInput>, 'Element'> & Omit<ComponentProps<typeof EditableFieldInput>, 'onChange'> & {
|
|
5
5
|
name: string;
|
|
6
|
-
description?:
|
|
6
|
+
description?: ReactNode;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldInputElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/EditableFieldInputElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,KAAK,8BAA8B,GAAG,IAAI,CACxC,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,EAC3C,SAAS,CACV,GACC,IAAI,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"EditableFieldInputElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/EditableFieldInputElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,KAAK,8BAA8B,GAAG,IAAI,CACxC,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,EAC3C,SAAS,CACV,GACC,IAAI,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEJ,eAAO,MAAM,yBAAyB,UAC7B,8BAA8B,4CAQtC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { EditableFieldTextArea } from '../../EditableField/EditableFieldTextArea
|
|
|
3
3
|
import { FormElementProps } from './FormElement';
|
|
4
4
|
type EditableFieldTextAreaElementProps = Omit<FormElementProps<typeof EditableFieldTextArea>, 'Element'> & Omit<ComponentProps<typeof EditableFieldTextArea>, 'onChange'> & {
|
|
5
5
|
name: string;
|
|
6
|
-
description?:
|
|
6
|
+
description?: ReactNode;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableFieldTextAreaElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/EditableFieldTextAreaElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,KAAK,iCAAiC,GAAG,IAAI,CAC3C,gBAAgB,CAAC,OAAO,qBAAqB,CAAC,EAC9C,SAAS,CACV,GACC,IAAI,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"EditableFieldTextAreaElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/EditableFieldTextAreaElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,KAAK,iCAAiC,GAAG,IAAI,CAC3C,gBAAgB,CAAC,OAAO,qBAAqB,CAAC,EAC9C,SAAS,CACV,GACC,IAAI,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEJ,eAAO,MAAM,4BAA4B,UAChC,iCAAiC,4CAQzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/SelectElement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectElement.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/elements/SelectElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,KAAK,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GACzE,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEJ,eAAO,MAAM,aAAa,yFASvB,mBAAmB,4CAgCrB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../jsx-runtime-XHKiWCTo.cjs");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const utils_cn = require("../../utils/cn.cjs");
|
|
6
|
+
const components_Container_index = require("../Container/index.cjs");
|
|
7
|
+
const components_IDE_CodeBlockClient = require("./CodeBlockClient.cjs");
|
|
8
|
+
const components_IDE_CodeConditionalRenderer = require("./CodeConditionalRenderer.cjs");
|
|
9
|
+
const components_IDE_CodeFormatSelector = require("./CodeFormatSelector.cjs");
|
|
10
|
+
const components_IDE_ContentDeclarationFormatSelector = require("./ContentDeclarationFormatSelector.cjs");
|
|
11
|
+
const components_IDE_CopyButton = require("./CopyButton.cjs");
|
|
12
|
+
const components_IDE_PackageManagerSelector = require("./PackageManagerSelector.cjs");
|
|
13
|
+
const Code = require$$0.forwardRef(
|
|
14
|
+
({
|
|
15
|
+
children,
|
|
16
|
+
language,
|
|
17
|
+
isDarkMode,
|
|
18
|
+
showHeader = true,
|
|
19
|
+
showLineNumbers = true,
|
|
20
|
+
className,
|
|
21
|
+
fileName,
|
|
22
|
+
packageManager,
|
|
23
|
+
codeFormat,
|
|
24
|
+
contentDeclarationFormat,
|
|
25
|
+
...props
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const code = children.endsWith("\n") ? children.slice(0, -1) : children;
|
|
28
|
+
const hadSelectInHeader = packageManager || codeFormat || contentDeclarationFormat;
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
30
|
+
components_IDE_CodeConditionalRenderer.CodeConditionalRender,
|
|
31
|
+
{
|
|
32
|
+
packageManager,
|
|
33
|
+
codeFormat,
|
|
34
|
+
contentDeclarationFormat,
|
|
35
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
36
|
+
components_Container_index.Container,
|
|
37
|
+
{
|
|
38
|
+
className: utils_cn.cn(
|
|
39
|
+
"relative text-sm leading-6",
|
|
40
|
+
showLineNumbers && "with-line-number ml-0",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
transparency: "lg",
|
|
44
|
+
ref,
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "bg-card/50 dark:bg-card-dark/50 text-neutral dark:text-neutral-dark grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs", children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: "truncate", children: fileName ?? language }),
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51
|
+
packageManager && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_IDE_PackageManagerSelector.PackageManagerSelector, {}),
|
|
52
|
+
codeFormat && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_IDE_CodeFormatSelector.CodeFormatSelector, {}),
|
|
53
|
+
contentDeclarationFormat && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_IDE_ContentDeclarationFormatSelector.ContentDeclarationFormatSelector, {})
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "sticky top-28", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: utils_cn.cn([
|
|
60
|
+
"absolute bottom-0 right-2 flex h-8 items-center",
|
|
61
|
+
hadSelectInHeader && "h-11"
|
|
62
|
+
]),
|
|
63
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_IDE_CopyButton.CopyButton, { content: code })
|
|
64
|
+
}
|
|
65
|
+
) })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "grid size-full grid-cols-[0px] overflow-auto p-3", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_IDE_CodeBlockClient.CodeBlock, { lang: language, isDarkMode, children: code }) })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
Code.displayName = "Code";
|
|
76
|
+
exports.Code = Code;
|
|
77
|
+
//# sourceMappingURL=Code.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.cjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n PackageManager,\n CodeFormat,\n ContentDeclarationFormat,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyButton } from './CopyButton';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code = forwardRef<HTMLDivElement, CodeCompProps>(\n (\n {\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n },\n ref\n ) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n ref={ref}\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 dark:bg-card-dark/50 text-neutral dark:text-neutral-dark grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-28\">\n <div\n className={cn([\n 'absolute bottom-0 right-2 flex h-8 items-center',\n hadSelectInHeader && 'h-11',\n ])}\n >\n <CopyButton content={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n }\n);\n\nCode.displayName = 'Code';\n"],"names":["forwardRef","jsx","CodeConditionalRender","jsxs","Container","cn","Fragment","PackageManagerSelector","CodeFormatSelector","ContentDeclarationFormatSelector","CopyButton","CodeBlock"],"mappings":";;;;;;;;;;;;AAiCO,MAAM,OAAOA,WAAA;AAAA,EAClB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QACG;AACG,UAAA,OAAO,SAAS,SAAS,IAAI,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AAEzD,UAAA,oBACJ,kBAAkB,cAAc;AAGhC,WAAAC,2BAAA,kBAAA;AAAA,MAACC,uCAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QAEA,UAAAC,2BAAA,kBAAA;AAAA,UAACC,2BAAA;AAAA,UAAA;AAAA,YACC,WAAWC,SAAA;AAAA,cACT;AAAA,cACA,mBAAmB;AAAA,cACnB;AAAA,YACF;AAAA,YACA,cAAa;AAAA,YACb;AAAA,YACC,GAAG;AAAA,YAEH,UAAA;AAAA,cAAA,cAEGF,2BAAA,kBAAA,KAAAG,uCAAA,EAAA,UAAA;AAAA,gBAACH,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,4KACb,UAAA;AAAA,kBAAAF,2BAAA,kBAAA,IAAC,QAAK,EAAA,WAAU,YAAY,UAAA,YAAY,UAAS;AAAA,kBACjDE,2BAAAA,kBAAAA,KAAC,OAAI,EAAA,WAAU,2BACZ,UAAA;AAAA,oBAAA,mEAAmBI,sCAAuB,wBAAA,EAAA;AAAA,oBAC1C,+DAAeC,kCAAmB,oBAAA,EAAA;AAAA,oBAClC,6EACEC,gDAAAA,kCAAiC,CAAA,CAAA;AAAA,kBAAA,EAEtC,CAAA;AAAA,gBAAA,GACF;AAAA,gBACAR,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,iBACb,UAAAA,2BAAA,kBAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWI,SAAAA,GAAG;AAAA,sBACZ;AAAA,sBACA,qBAAqB;AAAA,oBAAA,CACtB;AAAA,oBAED,UAAAJ,2BAAAA,kBAAAA,IAACS,0BAAAA,YAAW,EAAA,SAAS,KAAM,CAAA;AAAA,kBAAA;AAAA,gBAAA,EAE/B,CAAA;AAAA,cAAA,GACF;AAAA,cAEFT,2BAAAA,kBAAAA,IAAC,OAAI,EAAA,WAAU,oDACb,UAAAA,2BAAA,kBAAA,IAACU,4CAAU,MAAM,UAAU,YACxB,UAAA,KACH,CAAA,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAGN;AAEA,KAAK,cAAc;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { BundledLanguage } from 'shiki';
|
|
3
|
+
import { PackageManager, CodeFormat, ContentDeclarationFormat } from './CodeContext';
|
|
4
|
+
export type CodeCompAttributes = {
|
|
5
|
+
fileName?: string;
|
|
6
|
+
packageManager?: PackageManager;
|
|
7
|
+
codeFormat?: CodeFormat;
|
|
8
|
+
contentDeclarationFormat?: ContentDeclarationFormat;
|
|
9
|
+
};
|
|
10
|
+
export declare const Code: import('react').ForwardRefExoticComponent<{
|
|
11
|
+
children: string;
|
|
12
|
+
fileName?: string;
|
|
13
|
+
language: BundledLanguage;
|
|
14
|
+
isDarkMode?: boolean;
|
|
15
|
+
showHeader?: boolean;
|
|
16
|
+
showLineNumbers?: boolean;
|
|
17
|
+
} & CodeCompAttributes & HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACrD,CAAC;AAYF,eAAO,MAAM,IAAI;cATL,MAAM;eACL,MAAM;cACP,eAAe;iBACZ,OAAO;iBACP,OAAO;sBACF,OAAO;wGA2E1B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Container } from "../Container/index.mjs";
|
|
5
|
+
import { CodeBlock } from "./CodeBlockClient.mjs";
|
|
6
|
+
import { CodeConditionalRender } from "./CodeConditionalRenderer.mjs";
|
|
7
|
+
import { CodeFormatSelector } from "./CodeFormatSelector.mjs";
|
|
8
|
+
import { ContentDeclarationFormatSelector } from "./ContentDeclarationFormatSelector.mjs";
|
|
9
|
+
import { CopyButton } from "./CopyButton.mjs";
|
|
10
|
+
import { PackageManagerSelector } from "./PackageManagerSelector.mjs";
|
|
11
|
+
const Code = forwardRef(
|
|
12
|
+
({
|
|
13
|
+
children,
|
|
14
|
+
language,
|
|
15
|
+
isDarkMode,
|
|
16
|
+
showHeader = true,
|
|
17
|
+
showLineNumbers = true,
|
|
18
|
+
className,
|
|
19
|
+
fileName,
|
|
20
|
+
packageManager,
|
|
21
|
+
codeFormat,
|
|
22
|
+
contentDeclarationFormat,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const code = children.endsWith("\n") ? children.slice(0, -1) : children;
|
|
26
|
+
const hadSelectInHeader = packageManager || codeFormat || contentDeclarationFormat;
|
|
27
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28
|
+
CodeConditionalRender,
|
|
29
|
+
{
|
|
30
|
+
packageManager,
|
|
31
|
+
codeFormat,
|
|
32
|
+
contentDeclarationFormat,
|
|
33
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
34
|
+
Container,
|
|
35
|
+
{
|
|
36
|
+
className: cn(
|
|
37
|
+
"relative text-sm leading-6",
|
|
38
|
+
showLineNumbers && "with-line-number ml-0",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
transparency: "lg",
|
|
42
|
+
ref,
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
showHeader && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card/50 dark:bg-card-dark/50 text-neutral dark:text-neutral-dark grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs", children: [
|
|
47
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: fileName ?? language }),
|
|
48
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
49
|
+
packageManager && /* @__PURE__ */ jsxRuntimeExports.jsx(PackageManagerSelector, {}),
|
|
50
|
+
codeFormat && /* @__PURE__ */ jsxRuntimeExports.jsx(CodeFormatSelector, {}),
|
|
51
|
+
contentDeclarationFormat && /* @__PURE__ */ jsxRuntimeExports.jsx(ContentDeclarationFormatSelector, {})
|
|
52
|
+
] })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky top-28", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: cn([
|
|
58
|
+
"absolute bottom-0 right-2 flex h-8 items-center",
|
|
59
|
+
hadSelectInHeader && "h-11"
|
|
60
|
+
]),
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { content: code })
|
|
62
|
+
}
|
|
63
|
+
) })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid size-full grid-cols-[0px] overflow-auto p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { lang: language, isDarkMode, children: code }) })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
Code.displayName = "Code";
|
|
74
|
+
export {
|
|
75
|
+
Code
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=Code.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.mjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n PackageManager,\n CodeFormat,\n ContentDeclarationFormat,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyButton } from './CopyButton';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code = forwardRef<HTMLDivElement, CodeCompProps>(\n (\n {\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n },\n ref\n ) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n ref={ref}\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 dark:bg-card-dark/50 text-neutral dark:text-neutral-dark grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-28\">\n <div\n className={cn([\n 'absolute bottom-0 right-2 flex h-8 items-center',\n hadSelectInHeader && 'h-11',\n ])}\n >\n <CopyButton content={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n }\n);\n\nCode.displayName = 'Code';\n"],"names":["jsx","jsxs","Fragment"],"mappings":";;;;;;;;;;AAiCO,MAAM,OAAO;AAAA,EAClB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QACG;AACG,UAAA,OAAO,SAAS,SAAS,IAAI,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AAEzD,UAAA,oBACJ,kBAAkB,cAAc;AAGhC,WAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QAEA,UAAAC,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,mBAAmB;AAAA,cACnB;AAAA,YACF;AAAA,YACA,cAAa;AAAA,YACb;AAAA,YACC,GAAG;AAAA,YAEH,UAAA;AAAA,cAAA,cAEGA,kCAAA,KAAAC,4BAAA,EAAA,UAAA;AAAA,gBAACD,kCAAAA,KAAA,OAAA,EAAI,WAAU,4KACb,UAAA;AAAA,kBAAAD,kCAAA,IAAC,QAAK,EAAA,WAAU,YAAY,UAAA,YAAY,UAAS;AAAA,kBACjDC,kCAAAA,KAAC,OAAI,EAAA,WAAU,2BACZ,UAAA;AAAA,oBAAA,wDAAmB,wBAAuB,EAAA;AAAA,oBAC1C,oDAAe,oBAAmB,EAAA;AAAA,oBAClC,kEACE,kCAAiC,CAAA,CAAA;AAAA,kBAAA,EAEtC,CAAA;AAAA,gBAAA,GACF;AAAA,gBACAD,kCAAAA,IAAC,OAAI,EAAA,WAAU,iBACb,UAAAA,kCAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAW,GAAG;AAAA,sBACZ;AAAA,sBACA,qBAAqB;AAAA,oBAAA,CACtB;AAAA,oBAED,UAAAA,kCAAAA,IAAC,YAAW,EAAA,SAAS,KAAM,CAAA;AAAA,kBAAA;AAAA,gBAAA,EAE/B,CAAA;AAAA,cAAA,GACF;AAAA,cAEFA,kCAAAA,IAAC,OAAI,EAAA,WAAU,oDACb,UAAAA,kCAAA,IAAC,aAAU,MAAM,UAAU,YACxB,UAAA,KACH,CAAA,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAGN;AAEA,KAAK,cAAc;"}
|