@intlayer/design-system 9.0.0-canary.0 → 9.0.0-canary.1
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/index.mjs +6 -5
- 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/ContentEditor/ContentEditorTextArea.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +132 -35
- package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +33 -11
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +146 -35
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +308 -0
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +12 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +460 -20
- 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/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/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 +3 -4
- 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/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +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/Modal/Modal.mjs +2 -2
- package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs +1 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
- package/dist/esm/components/Tab/Tab.mjs +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 +26 -6
- package/dist/esm/hooks/index.mjs +8 -8
- package/dist/esm/routes.mjs +2 -1
- package/dist/esm/routes.mjs.map +1 -1
- 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/index.d.ts +4 -3
- package/dist/types/api/useIntlayerAPI.d.ts +14 -2
- 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 +5 -5
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts +2 -2
- 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/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 +308 -0
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +12 -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/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/FormElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +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/Input/Checkbox.d.ts +2 -2
- package/dist/types/components/Input/Radio.d.ts +2 -2
- package/dist/types/components/Link/Link.d.ts +2 -2
- 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 +2 -2
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +3 -3
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/Tab/Tab.d.ts +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
- 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 +23 -3
- package/dist/types/routes.d.ts +2 -1
- package/dist/types/routes.d.ts.map +1 -1
- package/package.json +63 -32
- package/src/components/MarkdownEditor/markdown-editor.css +297 -0
|
@@ -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"}
|
package/dist/esm/api/index.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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";
|
|
6
|
-
import { useAuditScan, useGetRecursiveAuditStatus, useStartRecursiveAudit } from "./hooks/audit.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";
|
|
7
5
|
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";
|
|
6
|
+
import { useUser } from "./useUser/index.mjs";
|
|
7
|
+
import { useAskDocQuestion, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useChat, useCustomQuery, useGetAIStats, useTranslateJSONDeclaration } from "./hooks/ai.mjs";
|
|
8
|
+
import { useDeleteAsset, useGetAssetById, useGetAssets, useUpdateAsset, useUploadAsset } from "./hooks/asset.mjs";
|
|
9
|
+
import { useAuditScan, useGetRecursiveAuditStatus, useStartRecursiveAudit } from "./hooks/audit.mjs";
|
|
8
10
|
import { useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos } from "./hooks/bitbucket.mjs";
|
|
9
11
|
import { useAddDictionary, useDeleteDictionary, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useInfiniteGetDictionaries, usePushDictionaries, useUpdateDictionary } from "./hooks/dictionary.mjs";
|
|
10
12
|
import { useGetDiscussions, useGetDiscussionsData } from "./hooks/discussions.mjs";
|
|
@@ -22,6 +24,5 @@ import { useAcceptAffiliateInvitation, useCancelSubscription, useCreatePortalSes
|
|
|
22
24
|
import { useAddTag, useDeleteTag, useGetTags, useUpdateTag } from "./hooks/tag.mjs";
|
|
23
25
|
import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob, useStopTranslationJob } from "./hooks/translate.mjs";
|
|
24
26
|
import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.mjs";
|
|
25
|
-
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 };
|
|
@@ -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 = (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\nexport const useAssetAPI = (props?: UseIntlayerAuthProps) => {\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,sBAAsB,UAAiC;CAClE,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,mBAAmB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AAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,gBAAgB,UAAiC;CAC5D,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,aAAa,SAAS,eAAe;;AAG9C,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,gBAAgB,SAAS,eAAe;;AAGjD,MAAa,yBAAyB,UAAiC;CACrE,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,sBAAsB,SAAS,eAAe;;AAGvD,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,gBAAgB,SAAS,eAAe;;AAGjD,MAAa,kBAAkB,UAAiC;CAC9D,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,eAAe,SAAS,eAAe;;AAGhD,MAAa,qBAAqB,UAAiC;CACjE,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,kBAAkB,SAAS,eAAe;;AAGnD,MAAa,eAAe,UAAiC;CAC3D,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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+1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useUser } from "../../api/useUser/index.mjs";
|
|
4
3
|
import { Button } from "../Button/Button.mjs";
|
|
4
|
+
import { useUser } from "../../api/useUser/index.mjs";
|
|
5
5
|
import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { Check, X } from "lucide-react";
|
|
@@ -1,23 +1,50 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Container } from "../Container/index.mjs";
|
|
4
|
+
import { useGetDictionaries } from "../../api/hooks/dictionary.mjs";
|
|
4
5
|
import { LocaleSwitcherContent } from "../LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";
|
|
6
|
+
import { Pagination } from "../Pagination/Pagination.mjs";
|
|
5
7
|
import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
|
|
6
8
|
import { getIsEditableSection } from "./getIsEditableSection.mjs";
|
|
7
9
|
import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
|
|
8
10
|
import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
|
|
9
|
-
import { useDeferredValue, useEffect, useTransition } from "react";
|
|
11
|
+
import { useCallback, useDeferredValue, useEffect, useMemo, useState, useTransition } from "react";
|
|
10
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useIntlayer } from "react-intlayer";
|
|
11
14
|
import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
12
15
|
import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
|
|
13
16
|
|
|
14
17
|
//#region src/components/DictionaryFieldEditor/ContentEditor.tsx
|
|
15
18
|
const ContentEditor = ({ dictionary, isDarkMode }) => {
|
|
16
|
-
const {
|
|
19
|
+
const { itemPagination, variantSwitcher, metaSwitcher } = useIntlayer("content-editor");
|
|
17
20
|
const { editedContent } = useEditedContent();
|
|
18
21
|
const { focusedContent, setFocusedContentKeyPath: _setFocusedContentKeyPath } = useFocusUnmergedDictionary();
|
|
19
22
|
const [, startTransition] = useTransition();
|
|
20
23
|
const setFocusedContentKeyPath = (keyPath) => startTransition(() => _setFocusedContentKeyPath(keyPath));
|
|
24
|
+
const [activeDictionary, setActiveDictionary] = useState(dictionary);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setActiveDictionary(dictionary);
|
|
27
|
+
}, [dictionary.localId]);
|
|
28
|
+
const hasQualifier = dictionary.item !== void 0 || dictionary.variant !== void 0 || dictionary.meta !== void 0;
|
|
29
|
+
const { data: siblingsData } = useGetDictionaries({ keys: [dictionary.key] }, { enabled: hasQualifier && !!dictionary.key });
|
|
30
|
+
const allSiblings = useMemo(() => siblingsData?.data ?? [], [siblingsData]);
|
|
31
|
+
const itemDicts = useMemo(() => {
|
|
32
|
+
if (dictionary.item === void 0) return [];
|
|
33
|
+
return allSiblings.filter((d) => d.item !== void 0).sort((a, b) => (a.item ?? 0) - (b.item ?? 0));
|
|
34
|
+
}, [dictionary, allSiblings]);
|
|
35
|
+
const variantDicts = useMemo(() => {
|
|
36
|
+
if (dictionary.variant === void 0) return [];
|
|
37
|
+
return allSiblings.filter((d) => d.variant !== void 0);
|
|
38
|
+
}, [dictionary, allSiblings]);
|
|
39
|
+
const metaDicts = useMemo(() => {
|
|
40
|
+
if (dictionary.meta === void 0) return [];
|
|
41
|
+
return allSiblings.filter((d) => d.meta !== void 0);
|
|
42
|
+
}, [dictionary, allSiblings]);
|
|
43
|
+
const switchSibling = useCallback((sibling) => {
|
|
44
|
+
setActiveDictionary(sibling);
|
|
45
|
+
setFocusedContentKeyPath([]);
|
|
46
|
+
}, [setFocusedContentKeyPath]);
|
|
47
|
+
const { content, key, localId } = activeDictionary;
|
|
21
48
|
const focusedKeyPath = focusedContent?.keyPath;
|
|
22
49
|
const section = typeof editedContent?.[localId]?.content === "undefined" ? content : editedContent?.[localId]?.content;
|
|
23
50
|
const currentLocale = useEditorLocale();
|
|
@@ -30,39 +57,109 @@ const ContentEditor = ({ dictionary, isDarkMode }) => {
|
|
|
30
57
|
useEffect(() => {
|
|
31
58
|
if (typeof focusedSection === "undefined") setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);
|
|
32
59
|
}, []);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const currentItemIndex = itemDicts.findIndex((dictionary) => dictionary.localId === activeDictionary.localId);
|
|
61
|
+
const currentVariant = activeDictionary.variant;
|
|
62
|
+
const currentMetaId = activeDictionary.meta?.id;
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
64
|
+
hasQualifier && /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: "mb-4 flex flex-wrap items-center gap-4",
|
|
66
|
+
children: [
|
|
67
|
+
itemDicts.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
68
|
+
className: "flex items-center gap-2",
|
|
69
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: "font-medium text-muted text-xs",
|
|
71
|
+
children: itemPagination.label
|
|
72
|
+
}), /* @__PURE__ */ jsx(Pagination, {
|
|
73
|
+
currentPage: currentItemIndex >= 0 ? currentItemIndex + 1 : 1,
|
|
74
|
+
totalPages: itemDicts.length,
|
|
75
|
+
onPageChange: (page) => {
|
|
76
|
+
const target = itemDicts[page - 1];
|
|
77
|
+
if (target) switchSibling(target);
|
|
78
|
+
},
|
|
79
|
+
size: "sm"
|
|
80
|
+
})]
|
|
81
|
+
}),
|
|
82
|
+
variantDicts.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "flex flex-wrap items-center gap-2",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsxs("span", {
|
|
86
|
+
className: "font-medium text-muted text-xs",
|
|
87
|
+
children: [variantSwitcher.label, ":"]
|
|
88
|
+
}),
|
|
89
|
+
variantDicts.map((sibling) => {
|
|
90
|
+
const isActive = sibling.localId === activeDictionary.localId;
|
|
91
|
+
return /* @__PURE__ */ jsx("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
onClick: () => !isActive && switchSibling(sibling),
|
|
94
|
+
className: `rounded-lg px-3 py-1 text-xs transition-colors ${isActive ? "bg-text font-semibold text-text-opposite" : "cursor-pointer border border-border hover:bg-text/10"}`,
|
|
95
|
+
children: sibling.variant
|
|
96
|
+
}, sibling.localId);
|
|
97
|
+
}),
|
|
98
|
+
currentVariant !== void 0 && !variantDicts.some((d) => d.localId === dictionary.localId) && /* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: "rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs",
|
|
100
|
+
children: currentVariant
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
}),
|
|
104
|
+
metaDicts.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: "flex flex-wrap items-center gap-2",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsxs("span", {
|
|
108
|
+
className: "font-medium text-muted text-xs",
|
|
109
|
+
children: [metaSwitcher.label, ":"]
|
|
110
|
+
}),
|
|
111
|
+
metaDicts.map((sibling) => {
|
|
112
|
+
const isActive = sibling.localId === activeDictionary.localId;
|
|
113
|
+
return /* @__PURE__ */ jsx("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
onClick: () => !isActive && switchSibling(sibling),
|
|
116
|
+
className: `rounded-lg px-3 py-1 text-xs transition-colors ${isActive ? "bg-text font-semibold text-text-opposite" : "cursor-pointer border border-border hover:bg-text/10"}`,
|
|
117
|
+
children: sibling.meta?.id
|
|
118
|
+
}, sibling.localId);
|
|
119
|
+
}),
|
|
120
|
+
currentMetaId !== void 0 && !metaDicts.some((d) => d.localId === dictionary.localId) && /* @__PURE__ */ jsx("span", {
|
|
121
|
+
className: "rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs",
|
|
122
|
+
children: currentMetaId
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsxs("div", {
|
|
129
|
+
className: "mb-6 flex items-center justify-between gap-2",
|
|
130
|
+
children: [/* @__PURE__ */ jsx(KeyPathBreadcrumb, {
|
|
131
|
+
dictionaryKey: key,
|
|
132
|
+
keyPath: focusedKeyPath ?? [],
|
|
133
|
+
onClickKeyPath: setFocusedContentKeyPath
|
|
134
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: "flex items-center gap-2",
|
|
136
|
+
children: /* @__PURE__ */ jsx(LocaleSwitcherContent, {})
|
|
137
|
+
})]
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ jsxs("div", {
|
|
140
|
+
className: "flex flex-1 gap-2 overflow-visible max-md:flex-col",
|
|
141
|
+
children: [typeof section === "object" && section && !isEditableBaseSection && Object.keys(section).length > 0 && /* @__PURE__ */ jsx(Container, {
|
|
142
|
+
border: true,
|
|
143
|
+
background: "none",
|
|
144
|
+
className: "top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]",
|
|
145
|
+
roundedSize: "2xl",
|
|
146
|
+
transparency: "xs",
|
|
147
|
+
children: /* @__PURE__ */ jsx(NavigationViewNode, {
|
|
148
|
+
keyPath: [],
|
|
149
|
+
section,
|
|
150
|
+
dictionary: activeDictionary
|
|
151
|
+
})
|
|
152
|
+
}), (isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && /* @__PURE__ */ jsx("div", {
|
|
153
|
+
className: isStale ? "pointer-events-none flex-1 opacity-50 transition-opacity" : "flex-1 transition-opacity",
|
|
154
|
+
children: /* @__PURE__ */ jsx(TextEditorContainer, {
|
|
155
|
+
keyPath: deferredKeyPath ?? [],
|
|
156
|
+
section: deferredSection,
|
|
157
|
+
dictionary: activeDictionary,
|
|
158
|
+
isDarkMode
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
})
|
|
162
|
+
] });
|
|
66
163
|
};
|
|
67
164
|
|
|
68
165
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';\nimport {\n useEditedContent,\n useEditorLocale,\n useFocusUnmergedDictionary,\n} from '@intlayer/editor-react';\nimport type { Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { type FC, useDeferredValue, useEffect, useTransition } from 'react';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { TextEditorContainer } from './ContentEditorView/TextEditor';\nimport { getIsEditableSection } from './getIsEditableSection';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { content, key, localId } = dictionary;\n const { editedContent } = useEditedContent();\n const {\n focusedContent,\n setFocusedContentKeyPath: _setFocusedContentKeyPath,\n } = useFocusUnmergedDictionary();\n const [, startTransition] = useTransition();\n const setFocusedContentKeyPath: typeof _setFocusedContentKeyPath = (\n keyPath\n ) => startTransition(() => _setFocusedContentKeyPath(keyPath));\n\n const focusedKeyPath = focusedContent?.keyPath;\n const section =\n typeof editedContent?.[localId as LocalDictionaryId]?.content ===\n 'undefined'\n ? content\n : editedContent?.[localId as LocalDictionaryId]?.content;\n\n const currentLocale = useEditorLocale();\n const focusedSection = getContentNodeByKeyPath(\n section,\n focusedKeyPath ?? [],\n currentLocale\n );\n\n // Defer the expensive right-panel render so navigation clicks feel instant.\n // The stale section stays visible while React computes the new one in background.\n const deferredKeyPath = useDeferredValue(focusedKeyPath);\n const deferredSection = useDeferredValue(focusedSection);\n const isStale = deferredSection !== focusedSection;\n\n const isEditableBaseSection = getIsEditableSection(section);\n const isEditableFocusedSection = getIsEditableSection(deferredSection);\n\n useEffect(() => {\n if (typeof focusedSection === 'undefined') {\n setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);\n }\n }, []);\n\n return (\n <div>\n <div className=\"mb-6 flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n <div className=\"flex flex-1 gap-2 overflow-visible max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n !isEditableBaseSection &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"2xl\"\n transparency=\"xs\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionary={dictionary}\n />\n </Container>\n )}\n {(isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && (\n <div\n className={\n isStale\n ? 'pointer-events-none flex-1 opacity-50 transition-opacity'\n : 'flex-1 transition-opacity'\n }\n >\n <TextEditorContainer\n keyPath={deferredKeyPath ?? []}\n section={deferredSection}\n dictionary={dictionary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IACF;IACG;IACZ;GACQ,IAEd,6BAA6B,mBAAmB,EAAE,EAAE,SAAS,MAC7D,oBAAC,OAAD;GACE,WACE,UACI,6DACA;aAGN,oBAAC,qBAAD;IACE,SAAS,mBAAmB,EAAE;IAC9B,SAAS;IACG;IACA;IACZ;GACE,EAEJ;IACF"}
|
|
1
|
+
{"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/DictionaryFieldEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { useGetDictionaries } from '@api/index';\nimport { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';\nimport {\n useEditedContent,\n useEditorLocale,\n useFocusUnmergedDictionary,\n} from '@intlayer/editor-react';\nimport type { Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport {\n type FC,\n useCallback,\n useDeferredValue,\n useEffect,\n useMemo,\n useState,\n useTransition,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Container } from '../Container';\nimport { LocaleSwitcherContent } from '../LocaleSwitcherContentDropDown';\nimport { Pagination } from '../Pagination';\nimport { TextEditorContainer } from './ContentEditorView/TextEditor';\nimport { getIsEditableSection } from './getIsEditableSection';\nimport { KeyPathBreadcrumb } from './KeyPathBreadcrumb';\nimport { NavigationViewNode } from './NavigationView/NavigationViewNode';\n\ntype NodeEditorProps = {\n dictionary: Dictionary;\n isDarkMode?: boolean;\n};\n\nexport const ContentEditor: FC<NodeEditorProps> = ({\n dictionary,\n isDarkMode,\n}) => {\n const { itemPagination, variantSwitcher, metaSwitcher } =\n useIntlayer('content-editor');\n const { editedContent } = useEditedContent();\n const {\n focusedContent,\n setFocusedContentKeyPath: _setFocusedContentKeyPath,\n } = useFocusUnmergedDictionary();\n const [, startTransition] = useTransition();\n const setFocusedContentKeyPath: typeof _setFocusedContentKeyPath = (\n keyPath\n ) => startTransition(() => _setFocusedContentKeyPath(keyPath));\n\n const [activeDictionary, setActiveDictionary] =\n useState<Dictionary>(dictionary);\n\n useEffect(() => {\n setActiveDictionary(dictionary);\n }, [dictionary.localId]);\n\n const hasQualifier =\n dictionary.item !== undefined ||\n dictionary.variant !== undefined ||\n dictionary.meta !== undefined;\n\n const { data: siblingsData } = useGetDictionaries(\n { keys: [dictionary.key] },\n { enabled: hasQualifier && !!dictionary.key }\n );\n\n const allSiblings = useMemo<Dictionary[]>(\n () => (siblingsData?.data ?? []) as unknown as Dictionary[],\n [siblingsData]\n );\n\n const itemDicts = useMemo<Dictionary[]>(() => {\n if (dictionary.item === undefined) return [];\n return allSiblings\n .filter((d) => d.item !== undefined)\n .sort((a, b) => (a.item ?? 0) - (b.item ?? 0));\n }, [dictionary, allSiblings]);\n\n const variantDicts = useMemo<Dictionary[]>(() => {\n if (dictionary.variant === undefined) return [];\n return allSiblings.filter((d) => d.variant !== undefined);\n }, [dictionary, allSiblings]);\n\n const metaDicts = useMemo<Dictionary[]>(() => {\n if (dictionary.meta === undefined) return [];\n return allSiblings.filter((d) => d.meta !== undefined);\n }, [dictionary, allSiblings]);\n\n const switchSibling = useCallback(\n (sibling: Dictionary) => {\n setActiveDictionary(sibling);\n setFocusedContentKeyPath([]);\n },\n [setFocusedContentKeyPath]\n );\n\n const { content, key, localId } = activeDictionary;\n const focusedKeyPath = focusedContent?.keyPath;\n const section =\n typeof editedContent?.[localId as LocalDictionaryId]?.content ===\n 'undefined'\n ? content\n : editedContent?.[localId as LocalDictionaryId]?.content;\n\n const currentLocale = useEditorLocale();\n const focusedSection = getContentNodeByKeyPath(\n section,\n focusedKeyPath ?? [],\n currentLocale\n );\n\n const deferredKeyPath = useDeferredValue(focusedKeyPath);\n const deferredSection = useDeferredValue(focusedSection);\n const isStale = deferredSection !== focusedSection;\n\n const isEditableBaseSection = getIsEditableSection(section);\n const isEditableFocusedSection = getIsEditableSection(deferredSection);\n\n useEffect(() => {\n if (typeof focusedSection === 'undefined') {\n setFocusedContentKeyPath(focusedContent?.keyPath?.slice(0, -1) ?? []);\n }\n }, []);\n\n const currentItemIndex = itemDicts.findIndex(\n (dictionary) => dictionary.localId === activeDictionary.localId\n );\n const currentVariant = activeDictionary.variant;\n const currentMetaId = activeDictionary.meta?.id;\n\n return (\n <div>\n {/* Qualifier navigation controls */}\n {hasQualifier && (\n <div className=\"mb-4 flex flex-wrap items-center gap-4\">\n {itemDicts.length > 0 && (\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-muted text-xs\">\n {itemPagination.label}\n </span>\n <Pagination\n currentPage={currentItemIndex >= 0 ? currentItemIndex + 1 : 1}\n totalPages={itemDicts.length}\n onPageChange={(page) => {\n const target = itemDicts[page - 1];\n if (target) switchSibling(target);\n }}\n size=\"sm\"\n />\n </div>\n )}\n\n {variantDicts.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-medium text-muted text-xs\">\n {variantSwitcher.label}:\n </span>\n {variantDicts.map((sibling) => {\n const isActive = sibling.localId === activeDictionary.localId;\n return (\n <button\n key={sibling.localId}\n type=\"button\"\n onClick={() => !isActive && switchSibling(sibling)}\n className={`rounded-lg px-3 py-1 text-xs transition-colors ${\n isActive\n ? 'bg-text font-semibold text-text-opposite'\n : 'cursor-pointer border border-border hover:bg-text/10'\n }`}\n >\n {sibling.variant}\n </button>\n );\n })}\n {currentVariant !== undefined &&\n !variantDicts.some((d) => d.localId === dictionary.localId) && (\n <span className=\"rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs\">\n {currentVariant}\n </span>\n )}\n </div>\n )}\n\n {metaDicts.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-medium text-muted text-xs\">\n {metaSwitcher.label}:\n </span>\n {metaDicts.map((sibling) => {\n const isActive = sibling.localId === activeDictionary.localId;\n return (\n <button\n key={sibling.localId}\n type=\"button\"\n onClick={() => !isActive && switchSibling(sibling)}\n className={`rounded-lg px-3 py-1 text-xs transition-colors ${\n isActive\n ? 'bg-text font-semibold text-text-opposite'\n : 'cursor-pointer border border-border hover:bg-text/10'\n }`}\n >\n {sibling.meta?.id}\n </button>\n );\n })}\n {currentMetaId !== undefined &&\n !metaDicts.some((d) => d.localId === dictionary.localId) && (\n <span className=\"rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs\">\n {currentMetaId}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n <div className=\"mb-6 flex items-center justify-between gap-2\">\n <KeyPathBreadcrumb\n dictionaryKey={key}\n keyPath={focusedKeyPath ?? []}\n onClickKeyPath={setFocusedContentKeyPath}\n />\n <div className=\"flex items-center gap-2\">\n <LocaleSwitcherContent />\n </div>\n </div>\n <div className=\"flex flex-1 gap-2 overflow-visible max-md:flex-col\">\n {typeof section === 'object' &&\n section &&\n !isEditableBaseSection &&\n Object.keys(section).length > 0 && (\n <Container\n border\n background=\"none\"\n className=\"top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]\"\n roundedSize=\"2xl\"\n transparency=\"xs\"\n >\n <NavigationViewNode\n keyPath={[]}\n section={section}\n dictionary={activeDictionary}\n />\n </Container>\n )}\n {(isEditableFocusedSection || (deferredKeyPath ?? []).length > 0) && (\n <div\n className={\n isStale\n ? 'pointer-events-none flex-1 opacity-50 transition-opacity'\n : 'flex-1 transition-opacity'\n }\n >\n <TextEditorContainer\n keyPath={deferredKeyPath ?? []}\n section={deferredSection}\n dictionary={activeDictionary}\n isDarkMode={isDarkMode}\n />\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAa,iBAAsC,EACjD,YACA,iBACI;CACJ,MAAM,EAAE,gBAAgB,iBAAiB,iBACvC,YAAY,iBAAiB;CAC/B,MAAM,EAAE,kBAAkB,kBAAkB;CAC5C,MAAM,EACJ,gBACA,0BAA0B,8BACxB,4BAA4B;CAChC,MAAM,GAAG,mBAAmB,eAAe;CAC3C,MAAM,4BACJ,YACG,sBAAsB,0BAA0B,QAAQ,CAAC;CAE9D,MAAM,CAAC,kBAAkB,uBACvB,SAA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