@intlayer/design-system 9.0.0-canary.0 → 9.0.0-canary.10
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/esm/api/hooks/ai.mjs +20 -1
- package/dist/esm/api/hooks/ai.mjs.map +1 -1
- package/dist/esm/api/hooks/asset.mjs +78 -0
- package/dist/esm/api/hooks/asset.mjs.map +1 -0
- package/dist/esm/api/hooks/dictionary.mjs +15 -3
- package/dist/esm/api/hooks/dictionary.mjs.map +1 -1
- package/dist/esm/api/hooks/utils.mjs +1 -1
- package/dist/esm/api/index.mjs +4 -3
- package/dist/esm/api/useAuth/useOAuth2.mjs +2 -2
- package/dist/esm/api/useAuth/useSession.mjs +1 -1
- package/dist/esm/api/useIntlayerAPI.mjs +6 -1
- package/dist/esm/api/useIntlayerAPI.mjs.map +1 -1
- package/dist/esm/components/Command/index.mjs +8 -8
- package/dist/esm/components/Command/index.mjs.map +1 -1
- package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +105 -36
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +32 -10
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +120 -35
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +246 -0
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +10 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +377 -18
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +506 -0
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +10 -6
- package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +9 -9
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/contentEditor.content.mjs +79 -0
- package/dist/esm/components/DictionaryFieldEditor/contentEditor.content.mjs.map +1 -0
- package/dist/esm/components/Form/Form.mjs +3 -43
- package/dist/esm/components/Form/Form.mjs.map +1 -1
- package/dist/esm/components/Form/elements/FormElement.mjs +2 -3
- package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
- package/dist/esm/components/Form/elements/MultiselectElement.mjs +2 -3
- package/dist/esm/components/Form/elements/MultiselectElement.mjs.map +1 -1
- package/dist/esm/components/Form/elements/OTPElement.mjs +2 -3
- package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -1
- package/dist/esm/components/Form/elements/SelectElement.mjs +2 -3
- package/dist/esm/components/Form/elements/SelectElement.mjs.map +1 -1
- package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs +2 -3
- package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs.map +1 -1
- package/dist/esm/components/Form/index.mjs +21 -2
- package/dist/esm/components/Form/layout/FormItemLayout.mjs +8 -5
- package/dist/esm/components/Form/layout/FormItemLayout.mjs.map +1 -1
- package/dist/esm/components/LanguageBackground/LanguageBackground.mjs +3 -8
- package/dist/esm/components/LanguageBackground/LanguageBackground.mjs.map +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
- package/dist/esm/components/MarkdownEditor/MarkdownEditor.mjs +113 -0
- package/dist/esm/components/MarkdownEditor/MarkdownEditor.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/extensions.mjs +103 -0
- package/dist/esm/components/MarkdownEditor/extensions.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/generative/AICompletionCommands.mjs +51 -0
- package/dist/esm/components/MarkdownEditor/generative/AICompletionCommands.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs +100 -0
- package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/generative/AISelectorCommands.mjs +81 -0
- package/dist/esm/components/MarkdownEditor/generative/AISelectorCommands.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/generative/GenerativeMenuSwitch.mjs +47 -0
- package/dist/esm/components/MarkdownEditor/generative/GenerativeMenuSwitch.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/generative/useAICompletion.mjs +83 -0
- package/dist/esm/components/MarkdownEditor/generative/useAICompletion.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/imageUpload.mjs +47 -0
- package/dist/esm/components/MarkdownEditor/imageUpload.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/index.mjs +4 -0
- package/dist/esm/components/MarkdownEditor/markdownEditor.content.mjs +1140 -0
- package/dist/esm/components/MarkdownEditor/markdownEditor.content.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble-item.mjs +20 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble-item.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble.mjs +39 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-bubble.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-command-item.mjs +25 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-command-item.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-command.mjs +61 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor-command.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor.mjs +27 -0
- package/dist/esm/components/MarkdownEditor/novel/components/editor.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/components/index.mjs +8 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/ai-highlight.mjs +74 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/ai-highlight.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/custom-keymap.mjs +37 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/custom-keymap.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/image-resizer.mjs +49 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/image-resizer.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs +51 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/slash-command.mjs +79 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/slash-command.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/updated-image.mjs +17 -0
- package/dist/esm/components/MarkdownEditor/novel/extensions/updated-image.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/index.mjs +17 -0
- package/dist/esm/components/MarkdownEditor/novel/plugins/index.mjs +3 -0
- package/dist/esm/components/MarkdownEditor/novel/plugins/upload-images.mjs +92 -0
- package/dist/esm/components/MarkdownEditor/novel/plugins/upload-images.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/utils/atoms.mjs +39 -0
- package/dist/esm/components/MarkdownEditor/novel/utils/atoms.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/novel/utils/index.mjs +38 -0
- package/dist/esm/components/MarkdownEditor/novel/utils/index.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/selectors/ColorSelector.mjs +176 -0
- package/dist/esm/components/MarkdownEditor/selectors/ColorSelector.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/selectors/LinkSelector.mjs +95 -0
- package/dist/esm/components/MarkdownEditor/selectors/LinkSelector.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/selectors/NodeSelector.mjs +139 -0
- package/dist/esm/components/MarkdownEditor/selectors/NodeSelector.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/selectors/TextButtons.mjs +81 -0
- package/dist/esm/components/MarkdownEditor/selectors/TextButtons.mjs.map +1 -0
- package/dist/esm/components/MarkdownEditor/slashCommand.mjs +161 -0
- package/dist/esm/components/MarkdownEditor/slashCommand.mjs.map +1 -0
- package/dist/esm/components/Pattern/GridDistortionPattern.mjs +275 -0
- package/dist/esm/components/Pattern/GridDistortionPattern.mjs.map +1 -0
- package/dist/esm/components/Pattern/index.mjs +2 -1
- package/dist/esm/components/SwitchSelector/useSwitchSelector.mjs +0 -1
- package/dist/esm/components/SwitchSelector/useSwitchSelector.mjs.map +1 -1
- package/dist/esm/components/Table/Table.mjs +1 -1
- package/dist/esm/components/Table/Table.mjs.map +1 -1
- package/dist/esm/components/Tag/index.mjs +0 -9
- package/dist/esm/components/Tag/index.mjs.map +1 -1
- package/dist/esm/components/Toaster/Toast.mjs +1 -1
- package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
- package/dist/esm/components/index.mjs +27 -6
- package/dist/esm/hooks/useIsMounted.mjs +4 -2
- package/dist/esm/hooks/useIsMounted.mjs.map +1 -1
- package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
- package/dist/esm/routes.mjs +2 -1
- package/dist/esm/routes.mjs.map +1 -1
- package/dist/esm/utils/cn.mjs +2 -8
- package/dist/types/api/hooks/ai.d.ts +5 -1
- package/dist/types/api/hooks/ai.d.ts.map +1 -1
- package/dist/types/api/hooks/asset.d.ts +27 -0
- package/dist/types/api/hooks/asset.d.ts.map +1 -0
- package/dist/types/api/hooks/audit.d.ts +1 -1
- package/dist/types/api/hooks/dictionary.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +4 -3
- package/dist/types/api/useIntlayerAPI.d.ts +41 -276
- package/dist/types/api/useIntlayerAPI.d.ts.map +1 -1
- package/dist/types/components/Badge/index.d.ts +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts.map +1 -1
- package/dist/types/components/Container/index.d.ts +2 -2
- package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +246 -0
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +10 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +2 -0
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +506 -0
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +2 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +1 -1
- package/dist/types/components/DictionaryFieldEditor/contentEditor.content.d.ts +80 -0
- package/dist/types/components/DictionaryFieldEditor/contentEditor.content.d.ts.map +1 -0
- package/dist/types/components/Form/Form.d.ts +27 -47
- package/dist/types/components/Form/Form.d.ts.map +1 -1
- package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts +1 -1
- package/dist/types/components/Form/elements/CheckboxElement.d.ts +1 -1
- package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
- package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
- package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/InputElement.d.ts +1 -1
- package/dist/types/components/Form/elements/InputPasswordElement.d.ts +1 -1
- package/dist/types/components/Form/elements/MultiselectElement.d.ts +1 -1
- package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/OTPElement.d.ts +1 -1
- package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SearchInputElement.d.ts +1 -1
- package/dist/types/components/Form/elements/SelectElement.d.ts +1 -1
- package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +1 -1
- package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/TextAreaElement.d.ts +1 -1
- package/dist/types/components/Form/index.d.ts +22 -3
- package/dist/types/components/Form/layout/FormItemLayout.d.ts.map +1 -1
- package/dist/types/components/IDE/CopyCode.d.ts +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +2 -2
- package/dist/types/components/Input/Radio.d.ts +2 -2
- package/dist/types/components/LanguageBackground/LanguageBackground.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +31 -0
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/extensions.d.ts +11 -0
- package/dist/types/components/MarkdownEditor/extensions.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts +18 -0
- package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts +22 -0
- package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts +17 -0
- package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts +26 -0
- package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts +30 -0
- package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/imageUpload.d.ts +29 -0
- package/dist/types/components/MarkdownEditor/imageUpload.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/index.d.ts +3 -0
- package/dist/types/components/MarkdownEditor/markdownEditor.content.d.ts +1135 -0
- package/dist/types/components/MarkdownEditor/markdownEditor.content.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts +14 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts +18 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts +28 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts +34 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts +23 -0
- package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/components/index.d.ts +8 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts +36 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/custom-keymap.d.ts +17 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/custom-keymap.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts +7 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts +30 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts +38 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/updated-image.d.ts +8 -0
- package/dist/types/components/MarkdownEditor/novel/extensions/updated-image.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/index.d.ts +16 -0
- package/dist/types/components/MarkdownEditor/novel/plugins/index.d.ts +2 -0
- package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts +22 -0
- package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts +21 -0
- package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts +10 -0
- package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts +17 -0
- package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts +15 -0
- package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts +22 -0
- package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts +11 -0
- package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts.map +1 -0
- package/dist/types/components/MarkdownEditor/slashCommand.d.ts +29 -0
- package/dist/types/components/MarkdownEditor/slashCommand.d.ts.map +1 -0
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Pattern/GridDistortionPattern.d.ts +15 -0
- package/dist/types/components/Pattern/GridDistortionPattern.d.ts.map +1 -0
- package/dist/types/components/Pattern/index.d.ts +2 -1
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +3 -3
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts +10 -2
- package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts.map +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +2 -2
- package/dist/types/components/Tag/index.d.ts +2 -2
- package/dist/types/components/Tag/index.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +29 -8
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/routes.d.ts +2 -1
- package/dist/types/routes.d.ts.map +1 -1
- package/dist/types/utils/cn.d.ts +2 -7
- package/package.json +69 -39
- package/src/components/MarkdownEditor/markdown-editor.css +297 -0
- package/dist/esm/utils/cn.mjs.map +0 -1
- package/dist/types/utils/cn.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useAiAPI } from "../useIntlayerAPI.mjs";
|
|
4
|
+
import { useAppQuery } from "./utils.mjs";
|
|
4
5
|
import { useMutation } from "@tanstack/react-query";
|
|
5
6
|
|
|
6
7
|
//#region src/api/hooks/ai.ts
|
|
@@ -60,7 +61,25 @@ const useAutocomplete = () => {
|
|
|
60
61
|
mutationFn: (args) => aiAPI.autocomplete(args)
|
|
61
62
|
});
|
|
62
63
|
};
|
|
64
|
+
const useCustomQuery = () => {
|
|
65
|
+
const aiAPI = useAiAPI();
|
|
66
|
+
return useMutation({
|
|
67
|
+
mutationKey: ["ai-customQuery"],
|
|
68
|
+
mutationFn: (args) => aiAPI.customQuery(args)
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const useGetAIStats = (options) => {
|
|
72
|
+
const aiAPI = useAiAPI();
|
|
73
|
+
return useAppQuery({
|
|
74
|
+
queryKey: ["ai", "stats"],
|
|
75
|
+
queryFn: ({ signal }) => aiAPI.getAIStats({ signal }),
|
|
76
|
+
requireUser: true,
|
|
77
|
+
requireOrganization: true,
|
|
78
|
+
requireProject: true,
|
|
79
|
+
...options
|
|
80
|
+
});
|
|
81
|
+
};
|
|
63
82
|
|
|
64
83
|
//#endregion
|
|
65
|
-
export { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useTranslateJSONDeclaration };
|
|
84
|
+
export { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useCustomQuery, useGetAIStats, useTranslateJSONDeclaration };
|
|
66
85
|
//# sourceMappingURL=ai.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.mjs","names":[],"sources":["../../../../src/api/hooks/ai.ts"],"sourcesContent":["'use client';\n\nimport type {\n AskDocQuestionBody,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationMetadataBody,\n AuditTagBody,\n AutocompleteBody,\n TranslateJSONBody,\n} from '@intlayer/backend';\nimport { useMutation } from '@tanstack/react-query';\nimport { useAiAPI } from '../useIntlayerAPI';\n\nexport const useTranslateJSONDeclaration = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-translateJSON'],\n mutationFn: (args: TranslateJSONBody) => aiAPI.translateJSON(args),\n });\n};\n\nexport const useAuditContentDeclaration = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclaration'],\n mutationFn: (args: AuditContentDeclarationBody) =>\n aiAPI.auditContentDeclaration(args),\n });\n};\n\nexport const useAuditContentDeclarationMetadata = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationMetadata'],\n mutationFn: (args: AuditContentDeclarationMetadataBody) =>\n aiAPI.auditContentDeclarationMetadata(args),\n });\n};\n\nexport const useAuditContentDeclarationField = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationField'],\n mutationFn: (args: AuditContentDeclarationFieldBody) =>\n aiAPI.auditContentDeclarationField(args),\n });\n};\n\nexport const useAuditTag = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditTag'],\n mutationFn: (args: AuditTagBody) => aiAPI.auditTag(args),\n });\n};\n\nexport const useAskDocQuestion = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: [],\n mutationFn: (args?: AskDocQuestionBody) => aiAPI.askDocQuestion(args),\n });\n};\n\nexport const useChat = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-chat'],\n mutationFn: (args?: AskDocQuestionBody) => aiAPI.chat(args as any),\n });\n};\n\nexport const useAutocomplete = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-autocomplete'],\n mutationFn: (args?: AutocompleteBody) => aiAPI.autocomplete(args),\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai.mjs","names":[],"sources":["../../../../src/api/hooks/ai.ts"],"sourcesContent":["'use client';\n\nimport type {\n AskDocQuestionBody,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationMetadataBody,\n AuditTagBody,\n AutocompleteBody,\n CustomQueryBody,\n TranslateJSONBody,\n} from '@intlayer/backend';\nimport { type UseQueryOptions, useMutation } from '@tanstack/react-query';\nimport { useAiAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useTranslateJSONDeclaration = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-translateJSON'],\n mutationFn: (args: TranslateJSONBody) => aiAPI.translateJSON(args),\n });\n};\n\nexport const useAuditContentDeclaration = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclaration'],\n mutationFn: (args: AuditContentDeclarationBody) =>\n aiAPI.auditContentDeclaration(args),\n });\n};\n\nexport const useAuditContentDeclarationMetadata = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationMetadata'],\n mutationFn: (args: AuditContentDeclarationMetadataBody) =>\n aiAPI.auditContentDeclarationMetadata(args),\n });\n};\n\nexport const useAuditContentDeclarationField = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationField'],\n mutationFn: (args: AuditContentDeclarationFieldBody) =>\n aiAPI.auditContentDeclarationField(args),\n });\n};\n\nexport const useAuditTag = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-auditTag'],\n mutationFn: (args: AuditTagBody) => aiAPI.auditTag(args),\n });\n};\n\nexport const useAskDocQuestion = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: [],\n mutationFn: (args?: AskDocQuestionBody) => aiAPI.askDocQuestion(args),\n });\n};\n\nexport const useChat = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-chat'],\n mutationFn: (args?: AskDocQuestionBody) => aiAPI.chat(args as any),\n });\n};\n\nexport const useAutocomplete = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-autocomplete'],\n mutationFn: (args?: AutocompleteBody) => aiAPI.autocomplete(args),\n });\n};\n\nexport const useCustomQuery = () => {\n const aiAPI = useAiAPI();\n\n return useMutation({\n mutationKey: ['ai-customQuery'],\n mutationFn: (args: CustomQueryBody) => aiAPI.customQuery(args),\n });\n};\n\nexport const useGetAIStats = (options?: Partial<UseQueryOptions>) => {\n const aiAPI = useAiAPI();\n\n return useAppQuery({\n queryKey: ['ai', 'stats'],\n queryFn: ({ signal }) => aiAPI.getAIStats({ signal }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n"],"mappings":";;;;;;;AAgBA,MAAa,oCAAoC;CAC/C,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,mBAAmB;EACjC,aAAa,SAA4B,MAAM,cAAc,KAAK;EACnE,CAAC;;AAGJ,MAAa,mCAAmC;CAC9C,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,6BAA6B;EAC3C,aAAa,SACX,MAAM,wBAAwB,KAAK;EACtC,CAAC;;AAGJ,MAAa,2CAA2C;CACtD,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,qCAAqC;EACnD,aAAa,SACX,MAAM,gCAAgC,KAAK;EAC9C,CAAC;;AAGJ,MAAa,wCAAwC;CACnD,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,kCAAkC;EAChD,aAAa,SACX,MAAM,6BAA6B,KAAK;EAC3C,CAAC;;AAGJ,MAAa,oBAAoB;CAC/B,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,cAAc;EAC5B,aAAa,SAAuB,MAAM,SAAS,KAAK;EACzD,CAAC;;AAGJ,MAAa,0BAA0B;CACrC,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,EAAE;EACf,aAAa,SAA8B,MAAM,eAAe,KAAK;EACtE,CAAC;;AAGJ,MAAa,gBAAgB;CAC3B,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,UAAU;EACxB,aAAa,SAA8B,MAAM,KAAK,KAAY;EACnE,CAAC;;AAGJ,MAAa,wBAAwB;CACnC,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,kBAAkB;EAChC,aAAa,SAA4B,MAAM,aAAa,KAAK;EAClE,CAAC;;AAGJ,MAAa,uBAAuB;CAClC,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,aAAa,CAAC,iBAAiB;EAC/B,aAAa,SAA0B,MAAM,YAAY,KAAK;EAC/D,CAAC;;AAGJ,MAAa,iBAAiB,YAAuC;CACnE,MAAM,QAAQ,UAAU;AAExB,QAAO,YAAY;EACjB,UAAU,CAAC,MAAM,QAAQ;EACzB,UAAU,EAAE,aAAa,MAAM,WAAW,EAAE,QAAQ,CAAC;EACrD,aAAa;EACb,qBAAqB;EACrB,gBAAgB;EAChB,GAAG;EACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useAssetAPI } from "../useIntlayerAPI.mjs";
|
|
4
|
+
import { useAuthEnable } from "./utils.mjs";
|
|
5
|
+
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
6
|
+
|
|
7
|
+
//#region src/api/hooks/asset.ts
|
|
8
|
+
/**
|
|
9
|
+
* Query hook — returns all assets for the current session project.
|
|
10
|
+
*/
|
|
11
|
+
const useGetAssets = (page, pageSize, options) => {
|
|
12
|
+
const assetAPI = useAssetAPI();
|
|
13
|
+
const { enable } = useAuthEnable({ requireUser: true });
|
|
14
|
+
return useQuery({
|
|
15
|
+
queryKey: [
|
|
16
|
+
"assets",
|
|
17
|
+
page,
|
|
18
|
+
pageSize
|
|
19
|
+
],
|
|
20
|
+
queryFn: () => assetAPI.getAssets(page, pageSize),
|
|
21
|
+
enabled: options?.enabled === false ? false : enable,
|
|
22
|
+
...options
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Query hook — returns a single asset by ID.
|
|
27
|
+
*/
|
|
28
|
+
const useGetAssetById = (assetId, options) => {
|
|
29
|
+
const assetAPI = useAssetAPI();
|
|
30
|
+
const { enable } = useAuthEnable({ requireUser: true });
|
|
31
|
+
return useQuery({
|
|
32
|
+
queryKey: ["assets", assetId],
|
|
33
|
+
queryFn: () => assetAPI.getAssetById(assetId),
|
|
34
|
+
enabled: options?.enabled === false ? false : enable,
|
|
35
|
+
...options
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Mutation hook — uploads a new asset image.
|
|
40
|
+
*/
|
|
41
|
+
const useUploadAsset = () => {
|
|
42
|
+
const assetAPI = useAssetAPI();
|
|
43
|
+
return useMutation({
|
|
44
|
+
mutationKey: ["assets", "upload"],
|
|
45
|
+
mutationFn: ({ file, alt, caption }) => assetAPI.uploadAsset(file, alt, caption),
|
|
46
|
+
meta: { invalidateQueries: [["assets"]] }
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Mutation hook — updates asset metadata (name, alt text, caption).
|
|
51
|
+
*/
|
|
52
|
+
const useUpdateAsset = () => {
|
|
53
|
+
const assetAPI = useAssetAPI();
|
|
54
|
+
return useMutation({
|
|
55
|
+
mutationKey: ["assets", "update"],
|
|
56
|
+
mutationFn: ({ assetId, originalName, alt, caption }) => assetAPI.updateAsset(assetId, {
|
|
57
|
+
originalName,
|
|
58
|
+
alt,
|
|
59
|
+
caption
|
|
60
|
+
}),
|
|
61
|
+
meta: { invalidateQueries: [["assets"]] }
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Mutation hook — deletes an asset by ID.
|
|
66
|
+
*/
|
|
67
|
+
const useDeleteAsset = () => {
|
|
68
|
+
const assetAPI = useAssetAPI();
|
|
69
|
+
return useMutation({
|
|
70
|
+
mutationKey: ["assets"],
|
|
71
|
+
mutationFn: (assetId) => assetAPI.deleteAsset(assetId),
|
|
72
|
+
meta: { invalidateQueries: [["assets"]] }
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { useDeleteAsset, useGetAssetById, useGetAssets, useUpdateAsset, useUploadAsset };
|
|
78
|
+
//# sourceMappingURL=asset.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset.mjs","names":[],"sources":["../../../../src/api/hooks/asset.ts"],"sourcesContent":["'use client';\n\nimport type {\n AssetAPI,\n GetAssetByIdResult,\n GetAssetsResult,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useMutation,\n useQuery,\n} from '@tanstack/react-query';\nimport { useAssetAPI } from '../useIntlayerAPI';\nimport { useAuthEnable } from './utils';\n\n/**\n * Query hook — returns all assets for the current session project.\n */\nexport const useGetAssets = (\n page?: number,\n pageSize?: number,\n options?: Partial<UseQueryOptions<GetAssetsResult>>\n) => {\n const assetAPI = useAssetAPI();\n const { enable } = useAuthEnable({ requireUser: true });\n\n return useQuery<GetAssetsResult>({\n queryKey: ['assets', page, pageSize],\n queryFn: () => assetAPI.getAssets(page, pageSize),\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\n/**\n * Query hook — returns a single asset by ID.\n */\nexport const useGetAssetById = (\n assetId: string,\n options?: Partial<UseQueryOptions<GetAssetByIdResult>>\n) => {\n const assetAPI = useAssetAPI();\n const { enable } = useAuthEnable({ requireUser: true });\n\n return useQuery<GetAssetByIdResult>({\n queryKey: ['assets', assetId],\n queryFn: () => assetAPI.getAssetById(assetId),\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\n/**\n * Mutation hook — uploads a new asset image.\n */\nexport const useUploadAsset = () => {\n const assetAPI = useAssetAPI();\n\n return useMutation({\n mutationKey: ['assets', 'upload'],\n mutationFn: ({\n file,\n alt,\n caption,\n }: {\n file: File;\n alt?: string;\n caption?: string;\n }) => assetAPI.uploadAsset(file, alt, caption),\n meta: {\n invalidateQueries: [['assets']],\n },\n });\n};\n\n/**\n * Mutation hook — updates asset metadata (name, alt text, caption).\n */\nexport const useUpdateAsset = () => {\n const assetAPI = useAssetAPI();\n\n return useMutation({\n mutationKey: ['assets', 'update'],\n mutationFn: ({\n assetId,\n originalName,\n alt,\n caption,\n }: {\n assetId: string;\n originalName?: string;\n alt?: string;\n caption?: string;\n }) => assetAPI.updateAsset(assetId, { originalName, alt, caption }),\n meta: {\n invalidateQueries: [['assets']],\n },\n });\n};\n\n/**\n * Mutation hook — deletes an asset by ID.\n */\nexport const useDeleteAsset = () => {\n const assetAPI = useAssetAPI();\n\n return useMutation({\n mutationKey: ['assets'],\n mutationFn: (assetId: string) => assetAPI.deleteAsset(assetId),\n meta: {\n invalidateQueries: [['assets']],\n },\n });\n};\n"],"mappings":";;;;;;;;;;AAkBA,MAAa,gBACX,MACA,UACA,YACG;CACH,MAAM,WAAW,aAAa;CAC9B,MAAM,EAAE,WAAW,cAAc,EAAE,aAAa,MAAM,CAAC;AAEvD,QAAO,SAA0B;EAC/B,UAAU;GAAC;GAAU;GAAM;GAAS;EACpC,eAAe,SAAS,UAAU,MAAM,SAAS;EACjD,SAAS,SAAS,YAAY,QAAQ,QAAQ;EAC9C,GAAG;EACJ,CAAC;;;;;AAMJ,MAAa,mBACX,SACA,YACG;CACH,MAAM,WAAW,aAAa;CAC9B,MAAM,EAAE,WAAW,cAAc,EAAE,aAAa,MAAM,CAAC;AAEvD,QAAO,SAA6B;EAClC,UAAU,CAAC,UAAU,QAAQ;EAC7B,eAAe,SAAS,aAAa,QAAQ;EAC7C,SAAS,SAAS,YAAY,QAAQ,QAAQ;EAC9C,GAAG;EACJ,CAAC;;;;;AAMJ,MAAa,uBAAuB;CAClC,MAAM,WAAW,aAAa;AAE9B,QAAO,YAAY;EACjB,aAAa,CAAC,UAAU,SAAS;EACjC,aAAa,EACX,MACA,KACA,cAKI,SAAS,YAAY,MAAM,KAAK,QAAQ;EAC9C,MAAM,EACJ,mBAAmB,CAAC,CAAC,SAAS,CAAC,EAChC;EACF,CAAC;;;;;AAMJ,MAAa,uBAAuB;CAClC,MAAM,WAAW,aAAa;AAE9B,QAAO,YAAY;EACjB,aAAa,CAAC,UAAU,SAAS;EACjC,aAAa,EACX,SACA,cACA,KACA,cAMI,SAAS,YAAY,SAAS;GAAE;GAAc;GAAK;GAAS,CAAC;EACnE,MAAM,EACJ,mBAAmB,CAAC,CAAC,SAAS,CAAC,EAChC;EACF,CAAC;;;;;AAMJ,MAAa,uBAAuB;CAClC,MAAM,WAAW,aAAa;AAE9B,QAAO,YAAY;EACjB,aAAa,CAAC,SAAS;EACvB,aAAa,YAAoB,SAAS,YAAY,QAAQ;EAC9D,MAAM,EACJ,mBAAmB,CAAC,CAAC,SAAS,CAAC,EAChC;EACF,CAAC"}
|
|
@@ -80,7 +80,11 @@ const usePushDictionaries = () => {
|
|
|
80
80
|
return useMutation({
|
|
81
81
|
mutationKey: ["dictionaries"],
|
|
82
82
|
mutationFn: (args) => dictionaryAPI.pushDictionaries(args.dictionaries),
|
|
83
|
-
meta: { invalidateQueries: [
|
|
83
|
+
meta: { invalidateQueries: [
|
|
84
|
+
["dictionaries"],
|
|
85
|
+
["dictionary"],
|
|
86
|
+
["dictionariesKeys"]
|
|
87
|
+
] }
|
|
84
88
|
});
|
|
85
89
|
};
|
|
86
90
|
const useUpdateDictionary = () => {
|
|
@@ -88,7 +92,11 @@ const useUpdateDictionary = () => {
|
|
|
88
92
|
return useMutation({
|
|
89
93
|
mutationKey: ["dictionaries"],
|
|
90
94
|
mutationFn: (args) => dictionaryAPI.updateDictionary(args),
|
|
91
|
-
meta: { invalidateQueries: [
|
|
95
|
+
meta: { invalidateQueries: [
|
|
96
|
+
["dictionaries"],
|
|
97
|
+
["dictionary"],
|
|
98
|
+
["dictionariesKeys"]
|
|
99
|
+
] }
|
|
92
100
|
});
|
|
93
101
|
};
|
|
94
102
|
const useDeleteDictionary = () => {
|
|
@@ -96,7 +104,11 @@ const useDeleteDictionary = () => {
|
|
|
96
104
|
return useMutation({
|
|
97
105
|
mutationKey: ["dictionaries"],
|
|
98
106
|
mutationFn: (args) => dictionaryAPI.deleteDictionary(args.dictionaryId),
|
|
99
|
-
meta: { invalidateQueries: [
|
|
107
|
+
meta: { invalidateQueries: [
|
|
108
|
+
["dictionaries"],
|
|
109
|
+
["dictionary"],
|
|
110
|
+
["dictionariesKeys"]
|
|
111
|
+
] }
|
|
100
112
|
});
|
|
101
113
|
};
|
|
102
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.mjs","names":[],"sources":["../../../../src/api/hooks/dictionary.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddDictionaryBody,\n DeleteDictionaryParam,\n GetDictionariesParams,\n GetDictionaryParams,\n GetDictionaryQuery,\n PushDictionariesBody,\n UpdateDictionaryBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n} from '@tanstack/react-query';\nimport { useDictionaryAPI } from '../useIntlayerAPI';\nimport { useAppQuery, useAuthEnable } from './utils';\n\nexport const useGetDictionaries = (\n filters?: GetDictionariesParams,\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionaries', filters],\n queryFn: ({ signal }) => dictionaryAPI.getDictionaries(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useInfiniteGetDictionaries = (\n filters?: Omit<GetDictionariesParams, 'page'>,\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n const { enable } = useAuthEnable({\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\n return useInfiniteQuery({\n queryKey: ['dictionaries', 'infinite', filters],\n queryFn: async ({ pageParam = 1, signal }) => {\n const res = await dictionaryAPI.getDictionaries(\n { ...filters, page: pageParam },\n { signal }\n );\n return res;\n },\n getNextPageParam: (lastPage) => {\n if (lastPage.data.length === 0) return undefined;\n const currentPage = lastPage.page ?? 1;\n const totalPages = lastPage.total_pages ?? 1;\n return currentPage < totalPages ? currentPage + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\nexport const useGetDictionariesKeys = (options?: Partial<UseQueryOptions>) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionariesKeys'],\n queryFn: () => dictionaryAPI.getDictionariesKeys(),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useGetDictionary = (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionary', dictionaryKey],\n queryFn: ({ signal }) =>\n dictionaryAPI.getDictionary(dictionaryKey, version, {\n signal,\n }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddDictionary = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: AddDictionaryBody) => dictionaryAPI.addDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const usePushDictionaries = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: PushDictionariesBody) =>\n dictionaryAPI.pushDictionaries(args.dictionaries),\n meta: {\n invalidateQueries: [['dictionaries']
|
|
1
|
+
{"version":3,"file":"dictionary.mjs","names":[],"sources":["../../../../src/api/hooks/dictionary.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddDictionaryBody,\n DeleteDictionaryParam,\n GetDictionariesParams,\n GetDictionaryParams,\n GetDictionaryQuery,\n PushDictionariesBody,\n UpdateDictionaryBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n} from '@tanstack/react-query';\nimport { useDictionaryAPI } from '../useIntlayerAPI';\nimport { useAppQuery, useAuthEnable } from './utils';\n\nexport const useGetDictionaries = (\n filters?: GetDictionariesParams,\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionaries', filters],\n queryFn: ({ signal }) => dictionaryAPI.getDictionaries(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useInfiniteGetDictionaries = (\n filters?: Omit<GetDictionariesParams, 'page'>,\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n const { enable } = useAuthEnable({\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\n return useInfiniteQuery({\n queryKey: ['dictionaries', 'infinite', filters],\n queryFn: async ({ pageParam = 1, signal }) => {\n const res = await dictionaryAPI.getDictionaries(\n { ...filters, page: pageParam },\n { signal }\n );\n return res;\n },\n getNextPageParam: (lastPage) => {\n if (lastPage.data.length === 0) return undefined;\n const currentPage = lastPage.page ?? 1;\n const totalPages = lastPage.total_pages ?? 1;\n return currentPage < totalPages ? currentPage + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\nexport const useGetDictionariesKeys = (options?: Partial<UseQueryOptions>) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionariesKeys'],\n queryFn: () => dictionaryAPI.getDictionariesKeys(),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useGetDictionary = (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n options?: Partial<UseQueryOptions>\n) => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useAppQuery({\n queryKey: ['dictionary', dictionaryKey],\n queryFn: ({ signal }) =>\n dictionaryAPI.getDictionary(dictionaryKey, version, {\n signal,\n }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddDictionary = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: AddDictionaryBody) => dictionaryAPI.addDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const usePushDictionaries = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: PushDictionariesBody) =>\n dictionaryAPI.pushDictionaries(args.dictionaries),\n meta: {\n invalidateQueries: [\n ['dictionaries'],\n ['dictionary'],\n ['dictionariesKeys'],\n ],\n },\n });\n};\n\nexport const useUpdateDictionary = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: UpdateDictionaryBody) =>\n dictionaryAPI.updateDictionary(args),\n meta: {\n invalidateQueries: [\n ['dictionaries'],\n ['dictionary'],\n ['dictionariesKeys'],\n ],\n },\n });\n};\n\nexport const useDeleteDictionary = () => {\n const dictionaryAPI = useDictionaryAPI();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: DeleteDictionaryParam) =>\n dictionaryAPI.deleteDictionary(args.dictionaryId),\n meta: {\n invalidateQueries: [\n ['dictionaries'],\n ['dictionary'],\n ['dictionariesKeys'],\n ],\n },\n });\n};\n"],"mappings":";;;;;;;AAmBA,MAAa,sBACX,SACA,YACG;CACH,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,UAAU,CAAC,gBAAgB,QAAQ;EACnC,UAAU,EAAE,aAAa,cAAc,gBAAgB,SAAS,EAAE,QAAQ,CAAC;EAE3E,aAAa;EACb,qBAAqB;EACrB,gBAAgB;EAChB,GAAG;EACJ,CAAC;;AAGJ,MAAa,8BACX,SACA,YACG;CACH,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,EAAE,WAAW,cAAc;EAC/B,aAAa;EACb,qBAAqB;EACrB,gBAAgB;EACjB,CAAC;AAEF,QAAO,iBAAiB;EACtB,UAAU;GAAC;GAAgB;GAAY;GAAQ;EAC/C,SAAS,OAAO,EAAE,YAAY,GAAG,aAAa;AAK5C,UAAO,MAJW,cAAc,gBAC9B;IAAE,GAAG;IAAS,MAAM;IAAW,EAC/B,EAAE,QAAQ,CACX;;EAGH,mBAAmB,aAAa;AAC9B,OAAI,SAAS,KAAK,WAAW,EAAG,QAAO;GACvC,MAAM,cAAc,SAAS,QAAQ;AAErC,UAAO,eADY,SAAS,eAAe,KACT,cAAc,IAAI;;EAEtD,kBAAkB;EAClB,SAAS,SAAS,YAAY,QAAQ,QAAQ;EAC9C,GAAG;EACJ,CAAC;;AAGJ,MAAa,0BAA0B,YAAuC;CAC5E,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,UAAU,CAAC,mBAAmB;EAC9B,eAAe,cAAc,qBAAqB;EAClD,aAAa;EACb,qBAAqB;EACrB,gBAAgB;EAChB,GAAG;EACJ,CAAC;;AAGJ,MAAa,oBACX,eACA,SACA,YACG;CACH,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,UAAU,CAAC,cAAc,cAAc;EACvC,UAAU,EAAE,aACV,cAAc,cAAc,eAAe,SAAS,EAClD,QACD,CAAC;EACJ,aAAa;EACb,qBAAqB;EACrB,gBAAgB;EAChB,GAAG;EACJ,CAAC;;AAGJ,MAAa,yBAAyB;CACpC,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,eAAe;EAC7B,aAAa,SAA4B,cAAc,cAAc,KAAK;EAC1E,MAAM,EACJ,mBAAmB,CAAC,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,EAC5D;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,eAAe;EAC7B,aAAa,SACX,cAAc,iBAAiB,KAAK,aAAa;EACnD,MAAM,EACJ,mBAAmB;GACjB,CAAC,eAAe;GAChB,CAAC,aAAa;GACd,CAAC,mBAAmB;GACrB,EACF;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,eAAe;EAC7B,aAAa,SACX,cAAc,iBAAiB,KAAK;EACtC,MAAM,EACJ,mBAAmB;GACjB,CAAC,eAAe;GAChB,CAAC,aAAa;GACd,CAAC,mBAAmB;GACrB,EACF;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,eAAe;EAC7B,aAAa,SACX,cAAc,iBAAiB,KAAK,aAAa;EACnD,MAAM,EACJ,mBAAmB;GACjB,CAAC,eAAe;GAChB,CAAC,aAAa;GACd,CAAC,mBAAmB;GACrB,EACF;EACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useAuth } from "../useAuth/useAuth.mjs";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
5
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
|
+
import { useQuery } from "@tanstack/react-query";
|
|
6
6
|
|
|
7
7
|
//#region src/api/hooks/utils.ts
|
|
8
8
|
const useAuthEnable = ({ requireUser, requireProject, requireOrganization }) => {
|
package/dist/esm/api/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useOAuth2 } from "./useAuth/useOAuth2.mjs";
|
|
2
2
|
import { useSession } from "./useAuth/useSession.mjs";
|
|
3
3
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
4
|
-
import { useAiAPI, useAuditAPI, useBitbucketAPI, useDictionaryAPI, useEditorAPI, useEnvironmentAPI, useGithubAPI, useGitlabAPI, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useNewsletterAPI, useOAuthAPI, useOrganizationAPI, useProjectAPI, useReviewerAPI, useSearchAPI, useShowcaseProjectAPI, useStripeAPI, useTagAPI, useTranslateAPI, useUserAPI } from "./useIntlayerAPI.mjs";
|
|
5
|
-
import { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useTranslateJSONDeclaration } from "./hooks/ai.mjs";
|
|
4
|
+
import { useAiAPI, useAssetAPI, useAuditAPI, useBitbucketAPI, useDictionaryAPI, useEditorAPI, useEnvironmentAPI, useGithubAPI, useGitlabAPI, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useNewsletterAPI, useOAuthAPI, useOrganizationAPI, useProjectAPI, useReviewerAPI, useSearchAPI, useShowcaseProjectAPI, useStripeAPI, useTagAPI, useTranslateAPI, useUserAPI } from "./useIntlayerAPI.mjs";
|
|
5
|
+
import { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useCustomQuery, useGetAIStats, useTranslateJSONDeclaration } from "./hooks/ai.mjs";
|
|
6
|
+
import { useDeleteAsset, useGetAssetById, useGetAssets, useUpdateAsset, useUploadAsset } from "./hooks/asset.mjs";
|
|
6
7
|
import { useAuditScan, useGetRecursiveAuditStatus, useStartRecursiveAudit } from "./hooks/audit.mjs";
|
|
7
8
|
import { useAddPasskey, useAskResetPassword, useChangePassword, useDeletePasskey, useDeleteSSOProvider, useDisableTwoFactor, useEnableTwoFactor, useGetUserByAccount, useGetVerifyEmailStatus, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useRegister, useRegisterSSO, useResetPassword, useSignInMagicLink, useSignInPasskey, useSignInSSO, useUnlinkAccount, useVerifyBackupCode, useVerifyEmail, useVerifyTotp } from "./hooks/auth.mjs";
|
|
8
9
|
import { useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos } from "./hooks/bitbucket.mjs";
|
|
@@ -24,4 +25,4 @@ import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob
|
|
|
24
25
|
import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.mjs";
|
|
25
26
|
import { useUser } from "./useUser/index.mjs";
|
|
26
27
|
|
|
27
|
-
export { useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAskDocQuestion, useAskResetPassword, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetCIConfig, useGetChatHistory, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
|
|
28
|
+
export { useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAskDocQuestion, useAskResetPassword, useAssetAPI, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useCustomQuery, useDeleteAccessKey, useDeleteAsset, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAIStats, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetAssetById, useGetAssets, useGetCIConfig, useGetChatHistory, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateAsset, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadAsset, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { editor } from "@intlayer/config/built";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
5
3
|
import { getOAuthAPI } from "@intlayer/api";
|
|
6
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
|
+
import { editor } from "@intlayer/config/built";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
|
|
9
9
|
//#region src/api/useAuth/useOAuth2.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
|
+
import { useConfiguration } from "@intlayer/editor-react";
|
|
4
5
|
import { editor } from "@intlayer/config/built";
|
|
5
6
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/api/useAuth/useSession.ts
|
|
9
9
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
@@ -4,6 +4,7 @@ import { getAuthAPI } from "../libs/auth.mjs";
|
|
|
4
4
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
5
5
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
6
6
|
import { getAiAPI } from "@intlayer/api/ai";
|
|
7
|
+
import { getAssetAPI } from "@intlayer/api/asset";
|
|
7
8
|
import { getAuditAPI } from "@intlayer/api/audit";
|
|
8
9
|
import { getBitbucketAPI } from "@intlayer/api/bitbucket";
|
|
9
10
|
import { getDictionaryAPI } from "@intlayer/api/dictionary";
|
|
@@ -122,7 +123,11 @@ const useEnvironmentAPI = (props) => {
|
|
|
122
123
|
const { options, resolvedConfig } = useIntlayerOAuthOptions(props);
|
|
123
124
|
return getEnvironmentAPI(options, resolvedConfig);
|
|
124
125
|
};
|
|
126
|
+
const useAssetAPI = (props) => {
|
|
127
|
+
const { options, resolvedConfig } = useIntlayerOAuthOptions(props);
|
|
128
|
+
return getAssetAPI(options, resolvedConfig);
|
|
129
|
+
};
|
|
125
130
|
|
|
126
131
|
//#endregion
|
|
127
|
-
export { useAiAPI, useAuditAPI, useBitbucketAPI, useDictionaryAPI, useEditorAPI, useEnvironmentAPI, useGithubAPI, useGitlabAPI, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useNewsletterAPI, useOAuthAPI, useOrganizationAPI, useProjectAPI, useReviewerAPI, useSearchAPI, useShowcaseProjectAPI, useStripeAPI, useTagAPI, useTranslateAPI, useUserAPI };
|
|
132
|
+
export { useAiAPI, useAssetAPI, useAuditAPI, useBitbucketAPI, useDictionaryAPI, useEditorAPI, useEnvironmentAPI, useGithubAPI, useGitlabAPI, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useNewsletterAPI, useOAuthAPI, useOrganizationAPI, useProjectAPI, useReviewerAPI, useSearchAPI, useShowcaseProjectAPI, useStripeAPI, useTagAPI, useTranslateAPI, useUserAPI };
|
|
128
133
|
//# sourceMappingURL=useIntlayerAPI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAPI.mjs","names":["getOAuthAPI"],"sources":["../../../src/api/useIntlayerAPI.ts"],"sourcesContent":["'use client';\n\nimport {\n type FetcherOptions,\n getIntlayerAPI,\n type IntlayerAPI,\n} from '@intlayer/api';\nimport { getAiAPI } from '@intlayer/api/ai';\nimport { getAuditAPI } from '@intlayer/api/audit';\nimport { getBitbucketAPI } from '@intlayer/api/bitbucket';\nimport { getDictionaryAPI } from '@intlayer/api/dictionary';\nimport { getEditorAPI } from '@intlayer/api/editor';\nimport { getEnvironmentAPI } from '@intlayer/api/environment';\nimport { getGithubAPI } from '@intlayer/api/github';\nimport { getGitlabAPI } from '@intlayer/api/gitlab';\nimport { getNewsletterAPI } from '@intlayer/api/newsletter';\nimport { getOAuthAPI } from '@intlayer/api/oAuth';\nimport { getOrganizationAPI } from '@intlayer/api/organization';\nimport { getProjectAPI } from '@intlayer/api/project';\nimport { getReviewerAPI } from '@intlayer/api/reviewer';\nimport { getSearchAPI } from '@intlayer/api/search';\nimport { getShowcaseProjectAPI } from '@intlayer/api/showcaseProject';\nimport { getStripeAPI } from '@intlayer/api/stripe';\nimport { getTagAPI } from '@intlayer/api/tag';\nimport { getTranslateAPI } from '@intlayer/api/translate';\nimport { getUserAPI } from '@intlayer/api/user';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type AuthAPI, getAuthAPI } from '../libs/auth';\nimport { useAuth } from './useAuth';\n\nexport type UseIntlayerAuthProps = {\n options?: FetcherOptions;\n intlayerConfiguration?: IntlayerConfig;\n};\n\nexport const useIntlayerOAuthOptions = (props?: UseIntlayerAuthProps) => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken } = useAuth();\n\n const options = {\n ...(oAuth2AccessToken && {\n headers: {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n },\n }),\n ...(props?.options ?? {}),\n };\n\n const rawConfig = props?.intlayerConfiguration ?? configuration;\n // Only use the config if it's fully populated; an empty object (e.g. while\n // the session is still loading) has no `editor` key and would crash API\n // getters that do `intlayerConfig.editor.backendURL`.\n const resolvedConfig = rawConfig?.editor ? rawConfig : undefined;\n\n return { options, resolvedConfig };\n};\n\nexport const useIntlayerOAuth = (props?: UseIntlayerAuthProps): IntlayerAPI => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getIntlayerAPI(options, resolvedConfig);\n};\n\nexport const useIntlayerAuth = (props?: UseIntlayerAuthProps): AuthAPI => {\n const configuration = useConfiguration();\n\n return getAuthAPI(props?.intlayerConfiguration ?? configuration);\n};\n\nexport const useOrganizationAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getOrganizationAPI(options, resolvedConfig);\n};\n\nexport const useProjectAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getProjectAPI(options, resolvedConfig);\n};\n\nexport const useUserAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getUserAPI(options, resolvedConfig);\n};\n\nexport const useOAuthAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getOAuthAPI(options, resolvedConfig);\n};\n\nexport const useDictionaryAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getDictionaryAPI(options, resolvedConfig);\n};\n\nexport const useStripeAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getStripeAPI(options, resolvedConfig);\n};\n\nexport const useAiAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getAiAPI(options, resolvedConfig);\n};\n\nexport const useAuditAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getAuditAPI(options, resolvedConfig);\n};\n\nexport const useTagAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getTagAPI(options, resolvedConfig);\n};\n\nexport const useSearchAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getSearchAPI(options, resolvedConfig);\n};\n\nexport const useEditorAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getEditorAPI(options, resolvedConfig);\n};\n\nexport const useNewsletterAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getNewsletterAPI(options, resolvedConfig);\n};\n\nexport const useGithubAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getGithubAPI(options, resolvedConfig);\n};\n\nexport const useGitlabAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getGitlabAPI(options, resolvedConfig);\n};\n\nexport const useBitbucketAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getBitbucketAPI(options, resolvedConfig);\n};\n\nexport const useShowcaseProjectAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getShowcaseProjectAPI(options, resolvedConfig);\n};\n\nexport const useTranslateAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getTranslateAPI(options, resolvedConfig);\n};\n\nexport const useReviewerAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getReviewerAPI(options, resolvedConfig);\n};\n\nexport const useEnvironmentAPI = (props?: UseIntlayerAuthProps) => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getEnvironmentAPI(options, resolvedConfig);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.mjs","names":["getOAuthAPI"],"sources":["../../../src/api/useIntlayerAPI.ts"],"sourcesContent":["'use client';\n\nimport {\n type FetcherOptions,\n getIntlayerAPI,\n type IntlayerAPI,\n} from '@intlayer/api';\nimport { getAiAPI } from '@intlayer/api/ai';\nimport { getAssetAPI } from '@intlayer/api/asset';\nimport { getAuditAPI } from '@intlayer/api/audit';\nimport { getBitbucketAPI } from '@intlayer/api/bitbucket';\nimport { getDictionaryAPI } from '@intlayer/api/dictionary';\nimport { getEditorAPI } from '@intlayer/api/editor';\nimport { getEnvironmentAPI } from '@intlayer/api/environment';\nimport { getGithubAPI } from '@intlayer/api/github';\nimport { getGitlabAPI } from '@intlayer/api/gitlab';\nimport { getNewsletterAPI } from '@intlayer/api/newsletter';\nimport { getOAuthAPI } from '@intlayer/api/oAuth';\nimport { getOrganizationAPI } from '@intlayer/api/organization';\nimport { getProjectAPI } from '@intlayer/api/project';\nimport { getReviewerAPI } from '@intlayer/api/reviewer';\nimport { getSearchAPI } from '@intlayer/api/search';\nimport { getShowcaseProjectAPI } from '@intlayer/api/showcaseProject';\nimport { getStripeAPI } from '@intlayer/api/stripe';\nimport { getTagAPI } from '@intlayer/api/tag';\nimport { getTranslateAPI } from '@intlayer/api/translate';\nimport { getUserAPI } from '@intlayer/api/user';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type AuthAPI, getAuthAPI } from '../libs/auth';\nimport { useAuth } from './useAuth';\n\nexport type UseIntlayerAuthProps = {\n options?: FetcherOptions;\n intlayerConfiguration?: IntlayerConfig;\n};\n\nexport const useIntlayerOAuthOptions = (props?: UseIntlayerAuthProps) => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken } = useAuth();\n\n const options = {\n ...(oAuth2AccessToken && {\n headers: {\n Authorization: `Bearer ${oAuth2AccessToken.accessToken}`,\n },\n }),\n ...(props?.options ?? {}),\n };\n\n const rawConfig = props?.intlayerConfiguration ?? configuration;\n // Only use the config if it's fully populated; an empty object (e.g. while\n // the session is still loading) has no `editor` key and would crash API\n // getters that do `intlayerConfig.editor.backendURL`.\n const resolvedConfig = rawConfig?.editor ? rawConfig : undefined;\n\n return { options, resolvedConfig };\n};\n\nexport const useIntlayerOAuth = (props?: UseIntlayerAuthProps): IntlayerAPI => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getIntlayerAPI(options, resolvedConfig);\n};\n\nexport const useIntlayerAuth = (props?: UseIntlayerAuthProps): AuthAPI => {\n const configuration = useConfiguration();\n\n return getAuthAPI(props?.intlayerConfiguration ?? configuration);\n};\n\nexport const useOrganizationAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getOrganizationAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getOrganizationAPI(options, resolvedConfig);\n};\n\nexport const useProjectAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getProjectAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getProjectAPI(options, resolvedConfig);\n};\n\nexport const useUserAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getUserAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getUserAPI(options, resolvedConfig);\n};\n\nexport const useOAuthAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getOAuthAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getOAuthAPI(options, resolvedConfig);\n};\n\nexport const useDictionaryAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getDictionaryAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getDictionaryAPI(options, resolvedConfig);\n};\n\nexport const useStripeAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getStripeAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getStripeAPI(options, resolvedConfig);\n};\n\nexport const useAiAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getAiAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getAiAPI(options, resolvedConfig);\n};\n\nexport const useAuditAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getAuditAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getAuditAPI(options, resolvedConfig);\n};\n\nexport const useTagAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getTagAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getTagAPI(options, resolvedConfig);\n};\n\nexport const useSearchAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getSearchAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getSearchAPI(options, resolvedConfig);\n};\n\nexport const useEditorAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getEditorAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getEditorAPI(options, resolvedConfig);\n};\n\nexport const useNewsletterAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getNewsletterAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getNewsletterAPI(options, resolvedConfig);\n};\n\nexport const useGithubAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getGithubAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getGithubAPI(options, resolvedConfig);\n};\n\nexport const useGitlabAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getGitlabAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getGitlabAPI(options, resolvedConfig);\n};\n\nexport const useBitbucketAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getBitbucketAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getBitbucketAPI(options, resolvedConfig);\n};\n\nexport const useShowcaseProjectAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getShowcaseProjectAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getShowcaseProjectAPI(options, resolvedConfig);\n};\n\nexport const useTranslateAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getTranslateAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getTranslateAPI(options, resolvedConfig);\n};\n\nexport const useReviewerAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getReviewerAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getReviewerAPI(options, resolvedConfig);\n};\n\nexport const useEnvironmentAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getEnvironmentAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getEnvironmentAPI(options, resolvedConfig);\n};\n\nexport const useAssetAPI = (\n props?: UseIntlayerAuthProps\n): ReturnType<typeof getAssetAPI> => {\n const { options, resolvedConfig } = useIntlayerOAuthOptions(props);\n return getAssetAPI(options, resolvedConfig);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,2BAA2B,UAAiC;CACvE,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,EAAE,sBAAsB,SAAS;CAEvC,MAAM,UAAU;EACd,GAAI,qBAAqB,EACvB,SAAS,EACP,eAAe,UAAU,kBAAkB,eAC5C,EACF;EACD,GAAI,OAAO,WAAW,EAAE;EACzB;CAED,MAAM,YAAY,OAAO,yBAAyB;AAMlD,QAAO;EAAE;EAAS,gBAFK,WAAW,SAAS,YAAY;EAErB;;AAGpC,MAAa,oBAAoB,UAA8C;CAC7E,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,eAAe,SAAS,eAAe;;AAGhD,MAAa,mBAAmB,UAA0C;CACxE,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,WAAW,OAAO,yBAAyB,cAAc;;AAGlE,MAAa,sBACX,UAC0C;CAC1C,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,mBAAmB,SAAS,eAAe;;AAGpD,MAAa,iBACX,UACqC;CACrC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,cAAc,SAAS,eAAe;;AAG/C,MAAa,cACX,UACkC;CAClC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,WAAW,SAAS,eAAe;;AAG5C,MAAa,eACX,UACmC;CACnC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAOA,cAAY,SAAS,eAAe;;AAG7C,MAAa,oBACX,UACwC;CACxC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,iBAAiB,SAAS,eAAe;;AAGlD,MAAa,gBACX,UACoC;CACpC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,YACX,UACgC;CAChC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,SAAS,SAAS,eAAe;;AAG1C,MAAa,eACX,UACmC;CACnC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,YAAY,SAAS,eAAe;;AAG7C,MAAa,aACX,UACiC;CACjC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,UAAU,SAAS,eAAe;;AAG3C,MAAa,gBACX,UACoC;CACpC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,gBACX,UACoC;CACpC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,oBACX,UACwC;CACxC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,iBAAiB,SAAS,eAAe;;AAGlD,MAAa,gBACX,UACoC;CACpC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,gBACX,UACoC;CACpC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,mBACX,UACuC;CACvC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,gBAAgB,SAAS,eAAe;;AAGjD,MAAa,yBACX,UAC6C;CAC7C,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,sBAAsB,SAAS,eAAe;;AAGvD,MAAa,mBACX,UACuC;CACvC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,gBAAgB,SAAS,eAAe;;AAGjD,MAAa,kBACX,UACsC;CACtC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,eAAe,SAAS,eAAe;;AAGhD,MAAa,qBACX,UACyC;CACzC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,kBAAkB,SAAS,eAAe;;AAGnD,MAAa,eACX,UACmC;CACnC,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,YAAY,SAAS,eAAe"}
|
|
@@ -8,7 +8,7 @@ import { Command as Command$1 } from "cmdk";
|
|
|
8
8
|
|
|
9
9
|
//#region src/components/Command/index.tsx
|
|
10
10
|
const CommandRoot = ({ className, ...props }) => /* @__PURE__ */ jsx(Command$1, {
|
|
11
|
-
className: cn("flex flex-col overflow-hidden rounded-md", className),
|
|
11
|
+
className: cn("flex flex-col overflow-hidden rounded-md px-3 py-2", className),
|
|
12
12
|
...props
|
|
13
13
|
});
|
|
14
14
|
const CommandDialog = ({ children, ...props }) => /* @__PURE__ */ jsx(Dialog, {
|
|
@@ -22,10 +22,10 @@ const CommandDialog = ({ children, ...props }) => /* @__PURE__ */ jsx(Dialog, {
|
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
24
|
const CommandInput = ({ className, ...props }) => /* @__PURE__ */ jsxs("div", {
|
|
25
|
-
className: "flex
|
|
25
|
+
className: cn("flex flex-1 items-center gap-2 px-3 py-2", "rounded-2xl supports-[corner-shape:squircle]:rounded-4xl", "bg-neutral-50 dark:bg-neutral-950", "ring-1 ring-neutral-100 dark:ring-neutral-700", "transition-shadow duration-100 focus-within:ring-3 hover:ring-3", className),
|
|
26
26
|
"cmdk-input-wrapper": "",
|
|
27
|
-
children: [/* @__PURE__ */ jsx(Search, { className: "
|
|
28
|
-
className:
|
|
27
|
+
children: [/* @__PURE__ */ jsx(Search, { className: "size-4 shrink-0 opacity-50" }), /* @__PURE__ */ jsx(Command$1.Input, {
|
|
28
|
+
className: "flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
29
29
|
...props
|
|
30
30
|
})]
|
|
31
31
|
});
|
|
@@ -33,7 +33,7 @@ const CommandList = ({ className, ...props }) => /* @__PURE__ */ jsx(Command$1.L
|
|
|
33
33
|
className: cn("max-h-75 overflow-y-auto overflow-x-hidden", className),
|
|
34
34
|
...props
|
|
35
35
|
});
|
|
36
|
-
const CommandEmpty = (props) => /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
36
|
+
const CommandEmpty$1 = (props) => /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
37
37
|
className: "py-6 text-center text-sm",
|
|
38
38
|
...props
|
|
39
39
|
});
|
|
@@ -45,7 +45,7 @@ const CommandSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx(Comman
|
|
|
45
45
|
className: cn("-mx-1 h-px bg-border", className),
|
|
46
46
|
...props
|
|
47
47
|
});
|
|
48
|
-
const CommandItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
48
|
+
const CommandItem$1 = ({ className, ...props }) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
49
49
|
className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className),
|
|
50
50
|
...props
|
|
51
51
|
});
|
|
@@ -77,10 +77,10 @@ const Command = {
|
|
|
77
77
|
Dialog: CommandDialog,
|
|
78
78
|
Input: CommandInput,
|
|
79
79
|
List: CommandList,
|
|
80
|
-
Empty: CommandEmpty,
|
|
80
|
+
Empty: CommandEmpty$1,
|
|
81
81
|
Group: CommandGroup,
|
|
82
82
|
Separator: CommandSeparator,
|
|
83
|
-
Item: CommandItem,
|
|
83
|
+
Item: CommandItem$1,
|
|
84
84
|
Shortcut: CommandShortcut
|
|
85
85
|
};
|
|
86
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["CommandPrimitive"],"sources":["../../../../src/components/Command/index.tsx"],"sourcesContent":["/* eslint-disable react/no-unknown-property */\n'use client';\n\nimport {\n Dialog,\n DialogContent,\n type DialogProps,\n} from '@radix-ui/react-dialog';\nimport { cn } from '@utils/cn';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport type { ComponentProps, FC, HTMLAttributes } from 'react';\n\nexport const CommandRoot: FC<ComponentProps<typeof CommandPrimitive>> = ({\n className,\n ...props\n}) => (\n <CommandPrimitive\n className={cn('flex flex-col overflow-hidden rounded-md'
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["CommandPrimitive","CommandEmpty","CommandItem"],"sources":["../../../../src/components/Command/index.tsx"],"sourcesContent":["/* eslint-disable react/no-unknown-property */\n'use client';\n\nimport {\n Dialog,\n DialogContent,\n type DialogProps,\n} from '@radix-ui/react-dialog';\nimport { cn } from '@utils/cn';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport type { ComponentProps, FC, HTMLAttributes } from 'react';\n\nexport const CommandRoot: FC<ComponentProps<typeof CommandPrimitive>> = ({\n className,\n ...props\n}) => (\n <CommandPrimitive\n className={cn(\n 'flex flex-col overflow-hidden rounded-md px-3 py-2',\n className\n )}\n {...props}\n />\n);\n\ntype CommandDialogProps = DialogProps;\n\nconst CommandDialog: FC<CommandDialogProps> = ({ children, ...props }) => (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <CommandRoot className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </CommandRoot>\n </DialogContent>\n </Dialog>\n);\n\nconst CommandInput: FC<ComponentProps<typeof CommandPrimitive.Input>> = ({\n className,\n ...props\n}) => (\n <div\n className={cn(\n 'flex flex-1 items-center gap-2 px-3 py-2',\n 'rounded-2xl supports-[corner-shape:squircle]:rounded-4xl',\n 'bg-neutral-50 dark:bg-neutral-950',\n 'ring-1 ring-neutral-100 dark:ring-neutral-700',\n 'transition-shadow duration-100 focus-within:ring-3 hover:ring-3',\n className\n )}\n cmdk-input-wrapper=\"\"\n >\n <Search className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n className=\"flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n {...props}\n />\n </div>\n);\n\nconst CommandList: FC<ComponentProps<typeof CommandPrimitive.List>> = ({\n className,\n ...props\n}) => (\n <CommandPrimitive.List\n className={cn('max-h-75 overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n);\n\nconst CommandEmpty: FC<ComponentProps<typeof CommandPrimitive.Empty>> = (\n props\n) => <CommandPrimitive.Empty className=\"py-6 text-center text-sm\" {...props} />;\n\nconst CommandGroup: FC<ComponentProps<typeof CommandPrimitive.Group>> = ({\n className,\n ...props\n}) => (\n <CommandPrimitive.Group\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs',\n className\n )}\n {...props}\n />\n);\n\nconst CommandSeparator: FC<\n ComponentProps<typeof CommandPrimitive.Separator>\n> = ({ className, ...props }) => (\n <CommandPrimitive.Separator\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n);\n\nconst CommandItem: FC<ComponentProps<typeof CommandPrimitive.Item>> = ({\n className,\n ...props\n}) => (\n <CommandPrimitive.Item\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50',\n className\n )}\n {...props}\n />\n);\n\nconst CommandShortcut = ({\n className,\n ...props\n}: HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n 'ml-auto text-muted-foreground text-xs tracking-widest',\n className\n )}\n {...props}\n />\n );\n};\n\n/**\n * Usage example:\n * ```jsx\n * <Command>\n * <Command.Trigger>\n * <Command.Input placeholder=\"Search...\" />\n * </Command.Trigger>\n * <Command.Dialog>\n * <Command.List>\n * <Command.Item>Item 1</Command.Item>\n * <Command.Item>Item 2</Command.Item>\n * <Command.Item>Item 3</Command.Item>\n * </Command.List>\n * </Command.Dialog>\n * </Command>\n * ```\n */\nexport const Command = {\n ...CommandRoot,\n Dialog: CommandDialog,\n Input: CommandInput,\n List: CommandList,\n Empty: CommandEmpty,\n Group: CommandGroup,\n Separator: CommandSeparator,\n Item: CommandItem,\n Shortcut: CommandShortcut,\n};\n"],"mappings":";;;;;;;;;AAaA,MAAa,eAA4D,EACvE,WACA,GAAG,YAEH,oBAACA,WAAD;CACE,WAAW,GACT,sDACA,UACD;CACD,GAAI;CACJ;AAKJ,MAAM,iBAAyC,EAAE,UAAU,GAAG,YAC5D,oBAAC,QAAD;CAAQ,GAAI;WACV,oBAAC,eAAD;EAAe,WAAU;YACvB,oBAAC,aAAD;GAAa,WAAU;GACpB;GACW;EACA;CACT;AAGX,MAAM,gBAAmE,EACvE,WACA,GAAG,YAEH,qBAAC,OAAD;CACE,WAAW,GACT,4CACA,4DACA,qCACA,iDACA,mEACA,UACD;CACD,sBAAmB;WATrB,CAWE,oBAAC,QAAD,EAAQ,WAAU,8BAA+B,GACjD,oBAACA,UAAiB,OAAlB;EACE,WAAU;EACV,GAAI;EACJ,EACE;;AAGR,MAAM,eAAiE,EACrE,WACA,GAAG,YAEH,oBAACA,UAAiB,MAAlB;CACE,WAAW,GAAG,8CAA8C,UAAU;CACtE,GAAI;CACJ;AAGJ,MAAMC,kBACJ,UACG,oBAACD,UAAiB,OAAlB;CAAwB,WAAU;CAA2B,GAAI;CAAS;AAE/E,MAAM,gBAAmE,EACvE,WACA,GAAG,YAEH,oBAACA,UAAiB,OAAlB;CACE,WAAW,GACT,0NACA,UACD;CACD,GAAI;CACJ;AAGJ,MAAM,oBAED,EAAE,WAAW,GAAG,YACnB,oBAACA,UAAiB,WAAlB;CACE,WAAW,GAAG,wBAAwB,UAAU;CAChD,GAAI;CACJ;AAGJ,MAAME,iBAAiE,EACrE,WACA,GAAG,YAEH,oBAACF,UAAiB,MAAlB;CACE,WAAW,GACT,2PACA,UACD;CACD,GAAI;CACJ;AAGJ,MAAM,mBAAmB,EACvB,WACA,GAAG,YACkC;AACrC,QACE,oBAAC,QAAD;EACE,WAAW,GACT,yDACA,UACD;EACD,GAAI;EACJ;;;;;;;;;;;;;;;;;;;AAqBN,MAAa,UAAU;CACrB,GAAG;CACH,QAAQ;CACR,OAAO;CACP,MAAM;CACN,OAAOC;CACP,OAAO;CACP,WAAW;CACX,MAAMC;CACN,UAAU;CACX"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { NodeWrapper } from "./NodeWrapper/index.mjs";
|
|
4
|
+
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
4
5
|
import { createElement } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/DictionaryEditor/DictionaryEditor.tsx
|
|
9
9
|
const DictionaryEditor = ({ dictionary, ...props }) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../utils/cn.mjs";
|
|
4
4
|
import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
|
|
5
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
5
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
6
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
7
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
8
8
|
|
|
9
9
|
//#region src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StringWrapper } from "./StringWrapper.mjs";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { useEditedContent } from "@intlayer/editor-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
5
5
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownWrapper.mjs","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.tsx"],"sourcesContent":["import type { MarkdownContent } from '@intlayer/core/transpiler';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\
|
|
1
|
+
{"version":3,"file":"MarkdownWrapper.mjs","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.tsx"],"sourcesContent":["import type { MarkdownContent } from '@intlayer/core/transpiler';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype MarkdownWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: MarkdownContent<ContentNode>;\n};\n\nexport const MarkdownWrapper: FC<MarkdownWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeTypes.MARKDOWN,\n },\n ];\n\n const subSection = section[NodeTypes.MARKDOWN] as ContentNode;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n"],"mappings":";;;;;AAWA,MAAa,mBAA6C,UAAU;CAClE,MAAM,EAAE,SAAS,YAAY;CAE7B,MAAM,aAAwB,CAC5B,GAAG,SACH,EACE,MAAM,UAAU,UACjB,CACF;CAED,MAAM,aAAa,QAAQ,UAAU;AAErC,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,aAAD;GAAa,GAAI;GAAO,SAAS;GAAY,SAAS;GAAc;EAChE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/NumberWrapper.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.mjs";
|
|
2
2
|
import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useEditorLocale } from "@intlayer/editor-react";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
|
|
@@ -13,9 +13,9 @@ import { NestedObjectWrapper } from "./NestedObjectWrapper.mjs";
|
|
|
13
13
|
import { NumberWrapper } from "./NumberWrapper.mjs";
|
|
14
14
|
import { PluralWrapper } from "./PluralWrapper.mjs";
|
|
15
15
|
import { TranslationWrapper } from "./TranslationWrapper.mjs";
|
|
16
|
+
import { useEditorLocale } from "@intlayer/editor-react";
|
|
16
17
|
import { memo, useMemo } from "react";
|
|
17
18
|
import { jsx } from "react/jsx-runtime";
|
|
18
|
-
import { useEditorLocale } from "@intlayer/editor-react";
|
|
19
19
|
import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
20
20
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
21
21
|
|