@intlayer/design-system 8.12.5-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/hooks/project.mjs +12 -1
- package/dist/esm/api/hooks/project.mjs.map +1 -1
- package/dist/esm/api/index.mjs +7 -6
- package/dist/esm/api/useIntlayerAPI.mjs +6 -1
- package/dist/esm/api/useIntlayerAPI.mjs.map +1 -1
- package/dist/esm/components/Avatar/index.mjs +1 -1
- package/dist/esm/components/Avatar/index.mjs.map +1 -1
- package/dist/esm/components/Breadcrumb/index.mjs +10 -7
- package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/esm/components/Button/Button.mjs +4 -2
- package/dist/esm/components/Button/Button.mjs.map +1 -1
- package/dist/esm/components/Carousel/index.mjs +1 -1
- package/dist/esm/components/Carousel/index.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/Container/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 +147 -36
- 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/DropDown/index.mjs.map +1 -1
- package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs +1 -1
- package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- 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/Headers/index.mjs +6 -6
- package/dist/esm/components/Headers/index.mjs.map +1 -1
- package/dist/esm/components/HeightResizer/index.mjs +1 -1
- package/dist/esm/components/HeightResizer/index.mjs.map +1 -1
- package/dist/esm/components/Input/Input.mjs.map +1 -1
- package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs.map +1 -1
- package/dist/esm/components/Link/Link.mjs +1 -1
- package/dist/esm/components/Link/Link.mjs.map +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +2 -2
- 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.map +1 -1
- package/dist/esm/components/Navbar/Burger.mjs +1 -1
- package/dist/esm/components/Navbar/Burger.mjs.map +1 -1
- package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/esm/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/esm/components/Popover/static.mjs +1 -1
- package/dist/esm/components/Popover/static.mjs.map +1 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs +1 -1
- package/dist/esm/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/esm/components/Select/Select.mjs.map +1 -1
- package/dist/esm/components/Steps/index.mjs +2 -2
- package/dist/esm/components/Steps/index.mjs.map +1 -1
- package/dist/esm/components/SwitchSelector/SwitchSelector.mjs +1 -1
- package/dist/esm/components/SwitchSelector/SwitchSelector.mjs.map +1 -1
- package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs.map +1 -1
- package/dist/esm/components/TabSelector/TabSelector.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/TextArea/AutoSizeTextArea.mjs +1 -1
- package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
- package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
- package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
- package/dist/esm/components/Toaster/Toast.mjs +2 -2
- package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
- package/dist/esm/components/index.mjs +26 -6
- package/dist/esm/routes.mjs +6 -5
- package/dist/esm/routes.mjs.map +1 -1
- package/dist/esm/structured-data/buildAuthorJsonLd.mjs +15 -0
- package/dist/esm/structured-data/buildAuthorJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildBreadcrumbsJsonLd.mjs +21 -0
- package/dist/esm/structured-data/buildBreadcrumbsJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildCreativeWorkJsonLd.mjs +45 -0
- package/dist/esm/structured-data/buildCreativeWorkJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildFAQPageJsonLd.mjs +23 -0
- package/dist/esm/structured-data/buildFAQPageJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildOrganizationJsonLd.mjs +32 -0
- package/dist/esm/structured-data/buildOrganizationJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildProductJsonLd.mjs +24 -0
- package/dist/esm/structured-data/buildProductJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.mjs +54 -0
- package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/buildWebsiteJsonLd.mjs +30 -0
- package/dist/esm/structured-data/buildWebsiteJsonLd.mjs.map +1 -0
- package/dist/esm/structured-data/index.mjs +10 -0
- 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/project.d.ts +2 -1
- package/dist/types/api/hooks/project.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +5 -4
- package/dist/types/api/useIntlayerAPI.d.ts +15 -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 +2 -2
- package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +6 -6
- package/dist/types/components/Button/Button.d.ts.map +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 +1 -1
- package/dist/types/components/Container/index.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 +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/DropDown/index.d.ts.map +1 -1
- 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/Headers/index.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Input/Input.d.ts.map +1 -1
- package/dist/types/components/Input/Radio.d.ts +1 -1
- 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/Modal/Modal.d.ts.map +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/Select/Select.d.ts.map +1 -1
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +2 -2
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts.map +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/dist/types/components/Tag/index.d.ts.map +1 -1
- package/dist/types/components/TextArea/AutoSizeTextArea.d.ts +1 -1
- package/dist/types/components/index.d.ts +23 -3
- package/dist/types/routes.d.ts +8 -7
- package/dist/types/routes.d.ts.map +1 -1
- package/dist/types/structured-data/buildAuthorJsonLd.d.ts +25 -0
- package/dist/types/structured-data/buildAuthorJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildBreadcrumbsJsonLd.d.ts +36 -0
- package/dist/types/structured-data/buildBreadcrumbsJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildCreativeWorkJsonLd.d.ts +80 -0
- package/dist/types/structured-data/buildCreativeWorkJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildFAQPageJsonLd.d.ts +32 -0
- package/dist/types/structured-data/buildFAQPageJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildOrganizationJsonLd.d.ts +47 -0
- package/dist/types/structured-data/buildOrganizationJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildProductJsonLd.d.ts +44 -0
- package/dist/types/structured-data/buildProductJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts +83 -0
- package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/buildWebsiteJsonLd.d.ts +43 -0
- package/dist/types/structured-data/buildWebsiteJsonLd.d.ts.map +1 -0
- package/dist/types/structured-data/index.d.ts +9 -0
- package/package.json +69 -33
- package/src/components/MarkdownEditor/markdown-editor.css +297 -0
- package/tailwind.css +11 -3
|
@@ -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"}
|
|
@@ -15,6 +15,17 @@ const useGetProjects = (filters, options) => {
|
|
|
15
15
|
...options
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
+
const useGetProjectInsights = (options) => {
|
|
19
|
+
const projectAPI = useProjectAPI();
|
|
20
|
+
return useAppQuery({
|
|
21
|
+
queryKey: ["project", "insights"],
|
|
22
|
+
queryFn: ({ signal }) => projectAPI.getProjectInsights({ signal }),
|
|
23
|
+
requireUser: true,
|
|
24
|
+
requireOrganization: true,
|
|
25
|
+
requireProject: true,
|
|
26
|
+
...options
|
|
27
|
+
});
|
|
28
|
+
};
|
|
18
29
|
const useAddProject = () => {
|
|
19
30
|
const projectAPI = useProjectAPI();
|
|
20
31
|
return useMutation({
|
|
@@ -191,5 +202,5 @@ const useUpdateMemberAccess = () => {
|
|
|
191
202
|
};
|
|
192
203
|
|
|
193
204
|
//#endregion
|
|
194
|
-
export { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers };
|
|
205
|
+
export { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjectInsights, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers };
|
|
195
206
|
//# sourceMappingURL=project.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.mjs","names":[],"sources":["../../../../src/api/hooks/project.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddNewAccessKeyBody,\n AddProjectBody,\n DeleteAccessKeyBody,\n GetProjectsParams,\n PushProjectConfigurationBody,\n RefreshAccessKeyBody,\n SelectProjectParam,\n UpdateMemberAccessBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useMutation,\n useQueryClient,\n} from '@tanstack/react-query';\nimport { useProjectAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) => projectAPI.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) => projectAPI.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) => projectAPI.updateProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const usePushProjectConfiguration = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['project', 'push-configuration'],\n mutationFn: (args: PushProjectConfigurationBody) =>\n projectAPI.pushProjectConfiguration(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n projectAPI.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => projectAPI.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProjectById = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (projectId: string) =>\n projectAPI.deleteProjectByIdAdmin(projectId),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) => projectAPI.selectProject(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => projectAPI.unselectProject(),\n meta: {\n resetQueries: [\n ['session'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: null,\n });\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => projectAPI.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => projectAPI.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => projectAPI.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n projectAPI.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: AddNewAccessKeyBody) => projectAPI.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: DeleteAccessKeyBody) => projectAPI.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n projectAPI.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useUpdateMemberAccess = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'member-access'],\n mutationFn: ({\n userId,\n ...body\n }: UpdateMemberAccessBody & { userId: string }) =>\n projectAPI.updateMemberAccess(userId, body),\n meta: {\n invalidateQueries: [['projects'], ['session']],\n },\n });\n};\n"],"mappings":";;;;;;;AAsBA,MAAa,kBACX,SACA,YACG;CACH,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU,CAAC,YAAY,QAAQ;EAC/B,UAAU,EAAE,aAAa,WAAW,YAAY,SAAS,EAAE,QAAQ,CAAC;EAEpE,aAAa;EACb,qBAAqB;EACrB,GAAG;EACJ,CAAC;;AAGJ,MAAa,sBAAsB;CACjC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW;EACzB,aAAa,SAAyB,WAAW,WAAW,KAAK;EACjE,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,CAAC,EAClC;EACF,CAAC;;AAGJ,MAAa,yBAAyB;CACpC,MAAM,aAAa,eAAe;CAClC,MAAM,cAAc,gBAAgB;AAEpC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW;EACzB,aAAa,SAA4B,WAAW,cAAc,KAAK;EACvE,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,CAAC,EAClC;EACD,YAAY,SAAS;GACnB,MAAM,UAAU,YAAY,aAAa,CAAC,UAAU,CAAC;AAErD,eAAY,aAAa,CAAC,UAAU,EAAE;IACpC,GAAI,WAAW,EAAE;IACjB,SAAS,KAAK;IACf,CAAC;;EAEL,CAAC;;AAGJ,MAAa,oCAAoC;CAC/C,MAAM,aAAa,eAAe;CAClC,MAAM,cAAc,gBAAgB;AAEpC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,qBAAqB;EAC9C,aAAa,SACX,WAAW,yBAAyB,KAAK;EAC3C,YAAY,SAAS;GACnB,MAAM,UAAU,YAAY,aAAa,CAAC,UAAU,CAAC;AAErD,eAAY,aAAa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gB,KAAK;EAC3E,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,2BAA2B;CACtC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SAA8B,WAAW,gBAAgB,KAAK;EAC3E,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SACX,WAAW,iBAAiB,KAAK;EACnC,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,8BAA8B;CACzC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,gBAAgB;EAC1C,aAAa,EACX,QACA,GAAG,WAEH,WAAW,mBAAmB,QAAQ,KAAK;EAC7C,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,EAC/C;EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"project.mjs","names":[],"sources":["../../../../src/api/hooks/project.ts"],"sourcesContent":["'use client';\n\nimport type {\n AddNewAccessKeyBody,\n AddProjectBody,\n DeleteAccessKeyBody,\n GetProjectsParams,\n PushProjectConfigurationBody,\n RefreshAccessKeyBody,\n SelectProjectParam,\n UpdateMemberAccessBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n} from '@intlayer/backend';\nimport {\n type UseQueryOptions,\n useMutation,\n useQueryClient,\n} from '@tanstack/react-query';\nimport { useProjectAPI } from '../useIntlayerAPI';\nimport { useAppQuery } from './utils';\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) => projectAPI.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useGetProjectInsights = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['project', 'insights'],\n queryFn: ({ signal }) => projectAPI.getProjectInsights({ signal }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) => projectAPI.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) => projectAPI.updateProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const usePushProjectConfiguration = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['project', 'push-configuration'],\n mutationFn: (args: PushProjectConfigurationBody) =>\n projectAPI.pushProjectConfiguration(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n projectAPI.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => projectAPI.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProjectById = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (projectId: string) =>\n projectAPI.deleteProjectByIdAdmin(projectId),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) => projectAPI.selectProject(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: data.data,\n });\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const projectAPI = useProjectAPI();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => projectAPI.unselectProject(),\n meta: {\n resetQueries: [\n ['session'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n queryClient.setQueryData(['session'], {\n ...(session ?? {}),\n project: null,\n });\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const projectAPI = useProjectAPI();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => projectAPI.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => projectAPI.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => projectAPI.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n projectAPI.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: AddNewAccessKeyBody) => projectAPI.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: DeleteAccessKeyBody) => projectAPI.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['session', 'access-keys'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n projectAPI.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['session']],\n },\n });\n};\n\nexport const useUpdateMemberAccess = () => {\n const projectAPI = useProjectAPI();\n\n return useMutation({\n mutationKey: ['projects', 'member-access'],\n mutationFn: ({\n userId,\n ...body\n }: UpdateMemberAccessBody & { userId: string }) =>\n projectAPI.updateMemberAccess(userId, body),\n meta: {\n invalidateQueries: [['projects'], ['session']],\n },\n });\n};\n"],"mappings":";;;;;;;AAsBA,MAAa,kBACX,SACA,YACG;CACH,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU,CAAC,YAAY,QAAQ;EAC/B,UAAU,EAAE,aAAa,WAAW,YAAY,SAAS,EAAE,QAAQ,CAAC;EAEpE,aAAa;EACb,qBAAqB;EACrB,GAAG;EACJ,CAAC;;AAGJ,MAAa,yBAAyB,YAAuC;CAC3E,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,UAAU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EACF,CAAC;;AAGJ,MAAa,4BAA4B;CACvC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,WAAW,cAAc;EACvC,aAAa,SACX,WAAW,iBAAiB,KAAK;EACnC,MAAM,EACJ,mBAAmB,CAAC,CAAC,UAAU,CAAC,EACjC;EACF,CAAC;;AAGJ,MAAa,8BAA8B;CACzC,MAAM,aAAa,eAAe;AAElC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,gBAAgB;EAC1C,aAAa,EACX,QACA,GAAG,WAEH,WAAW,mBAAmB,QAAQ,KAAK;EAC7C,MAAM,EACJ,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,EAC/C;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";
|
|
@@ -14,7 +16,7 @@ import { useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetC
|
|
|
14
16
|
import { useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects } from "./hooks/gitlab.mjs";
|
|
15
17
|
import { useGetNewsletterStatus, useSubscribeToNewsletter, useUnsubscribeFromNewsletter } from "./hooks/newsletter.mjs";
|
|
16
18
|
import { useAddOrganization, useAddOrganizationMember, useDeleteOrganization, useDeleteOrganizationById, useGetOrganizations, useSelectOrganization, useUnselectOrganization, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById } from "./hooks/organization.mjs";
|
|
17
|
-
import { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers } from "./hooks/project.mjs";
|
|
19
|
+
import { useAddNewAccessKey, useAddProject, useDeleteAccessKey, useDeleteProject, useDeleteProjectById, useGetCIConfig, useGetProjectInsights, useGetProjects, usePushCIConfig, usePushProjectConfiguration, useRefreshAccessKey, useSelectProject, useTriggerBuild, useTriggerWebhook, useUnselectProject, useUpdateMemberAccess, useUpdateProject, useUpdateProjectMembers } from "./hooks/project.mjs";
|
|
18
20
|
import { useContactReviewer, useCreateMission, useDeleteReviewerProfile, useEstimateMission, useGetAdminReviewers, useGetChatHistory, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useRegisterAsReviewer, useSendReviewerMessage, useSubmitReview, useUpdateMissionStatus, useUpdateReviewerProfile, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useValidateReviewerProfile } from "./hooks/reviewer.mjs";
|
|
19
21
|
import { useSearchDoc } from "./hooks/search.mjs";
|
|
20
22
|
import { useDeleteShowcaseProject, useGetOtherShowcaseProjects, useGetShowcaseProjectById, useGetShowcaseProjects, useSubmitShowcaseProject, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useUpdateShowcaseProject } from "./hooks/showcaseProject.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, 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,SAAS,eAAe;;AAGpD,MAAa,iBAAiB,UAAiC;CAC7D,MAAM,EAAE,SAAS,mBAAmB,wBAAwB,MAAM;AAClE,QAAO,cAAc,SAAS,eAAe;;AAG/C,MAAa,cAAc,UAAiC;CAC1D,MAAM,EAAE,SAAS,mBAAmB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G9C,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"}
|
|
@@ -85,7 +85,7 @@ const Avatar = ({ fullname, className, isLoading = false, isLoggedIn = true, src
|
|
|
85
85
|
]);
|
|
86
86
|
return /* @__PURE__ */ jsx(Container, {
|
|
87
87
|
isClickable,
|
|
88
|
-
className: cn(`rounded-full border-[1.3px] border-text p-
|
|
88
|
+
className: cn(`rounded-full border-[1.3px] border-text p-0.38 ring-offset-0 transition-ring duration-200`, size === "sm" && "size-7 border-[1px] p-0.25", size === "md" && "size-9", size === "lg" && "size-12", size === "xl" && "size-16", size === "2xl" && "size-24", isClickable && `cursor-pointer hover:opacity-80 focus:outline-none focus:ring-3 focus:ring-text/50 focus:ring-offset-2`, hoverable && `hover:opacity-80 hover:ring-4 hover:ring-text/30 hover:ring-offset-2`, !isClickable && focusable && `focus:outline-none focus:ring-3 focus:ring-text/50 focus:ring-offset-2`, displayLoader && "animate-pulse", className),
|
|
89
89
|
onClick,
|
|
90
90
|
...accessibilityProps,
|
|
91
91
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { User } from 'lucide-react';\nimport type { ComponentProps, FC, HTMLAttributes } from 'react';\nimport { useMemo } from 'react';\nimport { Loader } from '../Loader';\n\n/**\n * Props for the Avatar component\n */\nexport interface AvatarProps extends Omit<ComponentProps<'button'>, 'onClick'> {\n /** Image source URL for the avatar */\n src?: string;\n /** Full name used to generate initials and alt text */\n fullname?: string;\n /** Displays a loading spinner when true */\n isLoading?: boolean;\n /** Whether the user is authenticated */\n isLoggedIn?: boolean;\n /** Size variant of the avatar */\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Click handler - when provided, makes the avatar clickable */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Alternative text for accessibility */\n alt?: string;\n /** Whether the avatar should be focusable when not clickable */\n focusable?: boolean;\n /** Whether the avatar should be hoverable */\n hoverable?: boolean;\n}\n\n/**\n * @description Gets the capital letters from a name.\n * @param name - The name to extract capitals from.\n * @param separator - The separator to split the name (default is an empty string, which splits by each character).\n * @returns {string[]} An array of capital letters from the name.\n */\nexport const getCapitals = (name: string, separator = ' '): string[] => {\n if (!name) return [];\n\n const parts =\n separator === ' '\n ? name.trim().split(/\\s+/) // handle multiple spaces\n : name.split(separator);\n\n return parts.filter(Boolean).map((word) => word.charAt(0).toUpperCase());\n};\n\n/**\n * Container component that renders either a button or div based on interactivity\n */\nconst Container: FC<\n HTMLAttributes<HTMLElement> & {\n isClickable: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }\n> = ({ isClickable, onClick, ...props }) => {\n if (isClickable && onClick) {\n return (\n <button\n {...(props as ComponentProps<'button'>)}\n onClick={onClick}\n type=\"button\"\n />\n );\n }\n\n return (\n <div\n {...(props as ComponentProps<'div'>)}\n role={\n props.tabIndex !== undefined || props['aria-label'] ? 'img' : undefined\n }\n />\n );\n};\n\n/**\n * Avatar component that displays user profile images, initials, or a default user icon.\n * Supports loading states, authentication states, and accessibility features.\n *\n * @example\n * ```tsx\n * // With image\n * <Avatar src=\"https://example.com/avatar.jpg\" fullname=\"John Doe\" />\n *\n * // With initials\n * <Avatar fullname=\"John Doe\" />\n *\n * // Clickable avatar\n * <Avatar\n * fullname=\"John Doe\"\n * onClick={(e) => console.log('Avatar clicked')}\n * />\n *\n * // Loading state\n * <Avatar isLoading fullname=\"John Doe\" />\n * ```\n */\nexport const Avatar: FC<AvatarProps> = ({\n fullname,\n className,\n isLoading = false,\n isLoggedIn = true,\n src,\n onClick,\n size = 'md',\n alt,\n focusable = false,\n hoverable = false,\n ...props\n}) => {\n const isImageDefined = Boolean(src);\n const isNameDefined = Boolean((fullname ?? '').length > 0);\n const capitals = fullname ? getCapitals(fullname) : undefined;\n\n // Display logic\n const displayLoader = isLoading;\n const displayAvatar = isLoggedIn && !displayLoader && isImageDefined;\n const displayInitials =\n isLoggedIn && !displayLoader && !displayAvatar && isNameDefined;\n const displayUserIcon =\n isLoggedIn && !displayLoader && !displayAvatar && !displayInitials;\n\n const isClickable = onClick !== undefined;\n\n // Accessibility attributes\n const accessibilityProps = useMemo(() => {\n const baseProps: Record<string, any> = {};\n\n if (displayAvatar && alt) {\n baseProps['aria-label'] = alt;\n } else if (displayAvatar && fullname) {\n baseProps['aria-label'] = `Avatar of ${fullname}`;\n } else if (displayInitials && fullname) {\n baseProps['aria-label'] = `Avatar initials for ${fullname}`;\n } else if (displayUserIcon) {\n baseProps['aria-label'] = 'Default user avatar';\n } else if (displayLoader) {\n baseProps['aria-label'] = 'Loading avatar';\n baseProps['aria-busy'] = true;\n }\n\n if (!isClickable && focusable) {\n baseProps.tabIndex = 0;\n }\n\n if (isClickable) {\n baseProps['aria-describedby'] = 'avatar-description';\n }\n\n return baseProps;\n }, [\n displayAvatar,\n displayInitials,\n displayUserIcon,\n displayLoader,\n alt,\n fullname,\n isClickable,\n focusable,\n ]);\n\n return (\n <Container\n isClickable={isClickable}\n className={cn(\n `rounded-full border-[1.3px] border-text p-
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { User } from 'lucide-react';\nimport type { ComponentProps, FC, HTMLAttributes } from 'react';\nimport { useMemo } from 'react';\nimport { Loader } from '../Loader';\n\n/**\n * Props for the Avatar component\n */\nexport interface AvatarProps extends Omit<ComponentProps<'button'>, 'onClick'> {\n /** Image source URL for the avatar */\n src?: string;\n /** Full name used to generate initials and alt text */\n fullname?: string;\n /** Displays a loading spinner when true */\n isLoading?: boolean;\n /** Whether the user is authenticated */\n isLoggedIn?: boolean;\n /** Size variant of the avatar */\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Click handler - when provided, makes the avatar clickable */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Alternative text for accessibility */\n alt?: string;\n /** Whether the avatar should be focusable when not clickable */\n focusable?: boolean;\n /** Whether the avatar should be hoverable */\n hoverable?: boolean;\n}\n\n/**\n * @description Gets the capital letters from a name.\n * @param name - The name to extract capitals from.\n * @param separator - The separator to split the name (default is an empty string, which splits by each character).\n * @returns {string[]} An array of capital letters from the name.\n */\nexport const getCapitals = (name: string, separator = ' '): string[] => {\n if (!name) return [];\n\n const parts =\n separator === ' '\n ? name.trim().split(/\\s+/) // handle multiple spaces\n : name.split(separator);\n\n return parts.filter(Boolean).map((word) => word.charAt(0).toUpperCase());\n};\n\n/**\n * Container component that renders either a button or div based on interactivity\n */\nconst Container: FC<\n HTMLAttributes<HTMLElement> & {\n isClickable: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }\n> = ({ isClickable, onClick, ...props }) => {\n if (isClickable && onClick) {\n return (\n <button\n {...(props as ComponentProps<'button'>)}\n onClick={onClick}\n type=\"button\"\n />\n );\n }\n\n return (\n <div\n {...(props as ComponentProps<'div'>)}\n role={\n props.tabIndex !== undefined || props['aria-label'] ? 'img' : undefined\n }\n />\n );\n};\n\n/**\n * Avatar component that displays user profile images, initials, or a default user icon.\n * Supports loading states, authentication states, and accessibility features.\n *\n * @example\n * ```tsx\n * // With image\n * <Avatar src=\"https://example.com/avatar.jpg\" fullname=\"John Doe\" />\n *\n * // With initials\n * <Avatar fullname=\"John Doe\" />\n *\n * // Clickable avatar\n * <Avatar\n * fullname=\"John Doe\"\n * onClick={(e) => console.log('Avatar clicked')}\n * />\n *\n * // Loading state\n * <Avatar isLoading fullname=\"John Doe\" />\n * ```\n */\nexport const Avatar: FC<AvatarProps> = ({\n fullname,\n className,\n isLoading = false,\n isLoggedIn = true,\n src,\n onClick,\n size = 'md',\n alt,\n focusable = false,\n hoverable = false,\n ...props\n}) => {\n const isImageDefined = Boolean(src);\n const isNameDefined = Boolean((fullname ?? '').length > 0);\n const capitals = fullname ? getCapitals(fullname) : undefined;\n\n // Display logic\n const displayLoader = isLoading;\n const displayAvatar = isLoggedIn && !displayLoader && isImageDefined;\n const displayInitials =\n isLoggedIn && !displayLoader && !displayAvatar && isNameDefined;\n const displayUserIcon =\n isLoggedIn && !displayLoader && !displayAvatar && !displayInitials;\n\n const isClickable = onClick !== undefined;\n\n // Accessibility attributes\n const accessibilityProps = useMemo(() => {\n const baseProps: Record<string, any> = {};\n\n if (displayAvatar && alt) {\n baseProps['aria-label'] = alt;\n } else if (displayAvatar && fullname) {\n baseProps['aria-label'] = `Avatar of ${fullname}`;\n } else if (displayInitials && fullname) {\n baseProps['aria-label'] = `Avatar initials for ${fullname}`;\n } else if (displayUserIcon) {\n baseProps['aria-label'] = 'Default user avatar';\n } else if (displayLoader) {\n baseProps['aria-label'] = 'Loading avatar';\n baseProps['aria-busy'] = true;\n }\n\n if (!isClickable && focusable) {\n baseProps.tabIndex = 0;\n }\n\n if (isClickable) {\n baseProps['aria-describedby'] = 'avatar-description';\n }\n\n return baseProps;\n }, [\n displayAvatar,\n displayInitials,\n displayUserIcon,\n displayLoader,\n alt,\n fullname,\n isClickable,\n focusable,\n ]);\n\n return (\n <Container\n isClickable={isClickable}\n className={cn(\n `rounded-full border-[1.3px] border-text p-0.38 ring-offset-0 transition-ring duration-200`,\n size === 'sm' && 'size-7 border-[1px] p-0.25',\n size === 'md' && 'size-9',\n size === 'lg' && 'size-12',\n size === 'xl' && 'size-16',\n size === '2xl' && 'size-24',\n isClickable &&\n `cursor-pointer hover:opacity-80 focus:outline-none focus:ring-3 focus:ring-text/50 focus:ring-offset-2`,\n hoverable &&\n `hover:opacity-80 hover:ring-4 hover:ring-text/30 hover:ring-offset-2`,\n !isClickable &&\n focusable &&\n `focus:outline-none focus:ring-3 focus:ring-text/50 focus:ring-offset-2`,\n displayLoader && 'animate-pulse',\n className\n )}\n onClick={onClick}\n {...accessibilityProps}\n {...props}\n >\n <div className=\"relative flex aspect-square size-full flex-row items-center justify-center\">\n <div className=\"absolute top-0 left-0 flex aspect-square size-full flex-col items-center justify-center rounded-full bg-text text-text-opposite\">\n {displayLoader && (\n <Loader className=\"w-3/4\" aria-label=\"Loading user avatar\" />\n )}\n\n {displayAvatar && (\n <img\n className=\"size-full rounded-full object-cover\"\n src={src}\n srcSet={src}\n alt={alt ?? `Avatar of ${fullname}`}\n width={59}\n height={59}\n loading=\"lazy\"\n draggable={false}\n />\n )}\n\n {displayInitials && (\n <div\n className={cn(\n 'flex size-full items-center justify-center gap-[0.1rem] font-bold max-md:py-1',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n size === 'lg' && 'text-base',\n size === 'xl' && 'text-lg',\n size === '2xl' && 'text-xl'\n )}\n >\n {capitals?.map((capital, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Capitals are primitives and order is fixed\n <span key={`${capital}-${index}`}>{capital}</span>\n ))}\n </div>\n )}\n\n {displayUserIcon && (\n <User\n size={cn(\n size === 'sm' && 14,\n size === 'md' && 25,\n size === 'lg' && 30,\n size === 'xl' && 40\n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aAAU,gBAAgB;AAC1B,aAAU,eAAe;;AAG3B,MAAI,CAAC,eAAe,UAClB,WAAU,WAAW;AAGvB,MAAI,YACF,WAAU,sBAAsB;AAGlC,SAAO;IACN;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,WAAD;EACe;EACb,WAAW,GACT,6FACA,SAAS,QAAQ,8BACjB,SAAS,QAAQ,UACjB,SAAS,QAAQ,WACjB,SAAS,QAAQ,WACjB,SAAS,SAAS,WAClB,eACE,0GACF,aACE,wEACF,CAAC,eACC,aACA,0EACF,iBAAiB,iBACjB,UACD;EACQ;EACT,GAAI;EACJ,GAAI;YAEJ,oBAAC,OAAD;GAAK,WAAU;aACb,qBAAC,OAAD;IAAK,WAAU;cAAf;KACG,iBACC,oBAAC,QAAD;MAAQ,WAAU;MAAQ,cAAW;MAAwB;KAG9D,iBACC,oBAAC,OAAD;MACE,WAAU;MACL;MACL,QAAQ;MACR,KAAK,OAAO,aAAa;MACzB,OAAO;MACP,QAAQ;MACR,SAAQ;MACR,WAAW;MACX;KAGH,mBACC,oBAAC,OAAD;MACE,WAAW,GACT,iFACA,SAAS,QAAQ,WACjB,SAAS,QAAQ,WACjB,SAAS,QAAQ,aACjB,SAAS,QAAQ,WACjB,SAAS,SAAS,UACnB;gBAEA,UAAU,KAAK,SAAS,UAEvB,oBAAC,QAAD,YAAmC,SAAe,EAAvC,GAAG,QAAQ,GAAG,QAAyB,CAClD;MACE;KAGP,mBACC,oBAAC,MAAD;MACE,MAAM,GACJ,SAAS,QAAQ,IACjB,SAAS,QAAQ,IACjB,SAAS,QAAQ,IACjB,SAAS,QAAQ,GAClB;MACD,cAAW;MACX;KAEA;;GACF;EACI"}
|
|
@@ -32,12 +32,14 @@ const getColorClass = (color) => {
|
|
|
32
32
|
/**
|
|
33
33
|
* Breadcrumb variant styles using class-variance-authority
|
|
34
34
|
*/
|
|
35
|
-
const breadcrumbVariants = cva("flex flex-row flex-wrap items-center
|
|
35
|
+
const breadcrumbVariants = cva("flex flex-row flex-wrap items-center", {
|
|
36
36
|
variants: {
|
|
37
37
|
size: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
xs: "gap-1 text-xs",
|
|
39
|
+
sm: "gap-1.5 text-sm",
|
|
40
|
+
md: "gap-2 text-base",
|
|
41
|
+
lg: "gap-3 text-lg",
|
|
42
|
+
xl: "gap-4 text-xl"
|
|
41
43
|
},
|
|
42
44
|
spacing: {
|
|
43
45
|
compact: "gap-1",
|
|
@@ -46,7 +48,7 @@ const breadcrumbVariants = cva("flex flex-row flex-wrap items-center text-sm", {
|
|
|
46
48
|
}
|
|
47
49
|
},
|
|
48
50
|
defaultVariants: {
|
|
49
|
-
size: "
|
|
51
|
+
size: "md",
|
|
50
52
|
spacing: "normal"
|
|
51
53
|
}
|
|
52
54
|
});
|
|
@@ -67,7 +69,7 @@ const LinkLink = ({ href, lang, children, onClick, color, position, locale, clas
|
|
|
67
69
|
...props,
|
|
68
70
|
label: `${linkLabel} ${children}`,
|
|
69
71
|
itemID: href,
|
|
70
|
-
size: "
|
|
72
|
+
size: "custom",
|
|
71
73
|
children: /* @__PURE__ */ jsx("span", {
|
|
72
74
|
itemProp: "name",
|
|
73
75
|
children
|
|
@@ -88,6 +90,7 @@ const ButtonLink = ({ children: text, onClick, color, position, className, ...pr
|
|
|
88
90
|
label: `${linkLabel} ${text}`,
|
|
89
91
|
color,
|
|
90
92
|
itemProp: "item",
|
|
93
|
+
size: "custom",
|
|
91
94
|
...props,
|
|
92
95
|
children: /* @__PURE__ */ jsx("span", {
|
|
93
96
|
itemProp: "name",
|
|
@@ -134,7 +137,7 @@ const Span = ({ children, position, className, ...props }) => /* @__PURE__ */ js
|
|
|
134
137
|
* { onClick: handleCategory, text: 'Electronics' },
|
|
135
138
|
* 'Smartphones'
|
|
136
139
|
* ]}
|
|
137
|
-
* size="
|
|
140
|
+
* size="md"
|
|
138
141
|
* ariaLabel="Product navigation"
|
|
139
142
|
* />
|
|
140
143
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { getIntlayer } from 'intlayer';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { type FC, Fragment, type HTMLAttributes, type ReactNode } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Button, type ButtonProps } from '../Button';\nimport { Link, type LinkColor } from '../Link';\n\n/**\n * Props for LinkLink sub-component that renders breadcrumb items as links\n */\ntype LinkLinkProps = {\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n /**\n * Locale for internationalization\n */\n locale?: LocalesValues;\n /**\n * URL to navigate to\n */\n href?: string;\n /**\n * Link color\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Click handler\n */\n onClick?: () => void;\n /**\n * Children content\n */\n children?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n} & Omit<\n HTMLAttributes<HTMLAnchorElement>,\n 'href' | 'onClick' | 'color' | 'children' | 'className'\n>;\n\n/**\n * Maps LinkColor to corresponding Tailwind text color classes\n */\nconst getColorClass = (color?: LinkColor | `${LinkColor}`): string => {\n if (!color) return '';\n\n const colorMap: Record<LinkColor, string> = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n neutral: 'text-neutral',\n light: 'text-white',\n dark: 'text-neutral-800',\n text: 'text-text',\n 'text-inverse': 'text-text-opposite',\n error: 'text-error',\n success: 'text-success',\n custom: '',\n };\n\n return colorMap[color as LinkColor] || '';\n};\n\n/**\n * Breadcrumb variant styles using class-variance-authority\n */\nconst breadcrumbVariants = cva('flex flex-row flex-wrap items-center text-sm', {\n variants: {\n size: {\n small: 'gap-1 text-xs',\n medium: 'gap-2 text-sm',\n large: 'gap-3 text-base',\n },\n spacing: {\n compact: 'gap-1',\n normal: 'gap-2',\n loose: 'gap-4',\n },\n },\n defaultVariants: {\n size: 'medium',\n spacing: 'normal',\n },\n});\n\n/**\n * LinkLink sub-component for breadcrumb items that navigate to other pages\n */\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n className,\n ...props\n}) => {\n const content = getIntlayer('breadcrumb');\n const linkLabel = content.linkLabel;\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n isExternalLink={false}\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n size=\"sm\"\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for ButtonLink sub-component that renders breadcrumb items as interactive buttons\n */\ntype ButtonButtonProps = {\n /**\n * Text content for the breadcrumb button\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\n/**\n * ButtonLink sub-component for breadcrumb items with click handlers\n */\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n className,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Button\n onClick={onClick}\n variant=\"link\"\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for Span sub-component that renders static breadcrumb text\n */\ntype SpanProps = {\n /**\n * Text content for the static breadcrumb item\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Span sub-component for static breadcrumb text items\n */\nconst Span: FC<SpanProps> = ({ children, position, className, ...props }) => (\n <span\n itemProp=\"item\"\n className={cn(\n 'inline-flex items-center',\n 'font-medium text-neutral-700',\n 'transition-colors duration-200',\n className\n )}\n >\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\n/**\n * Detailed breadcrumb link configuration with optional href or onClick\n */\ntype DetailedBreadcrumbLink = {\n /**\n * URL to navigate to when the breadcrumb item is clicked\n */\n href?: string;\n /**\n * Text content to display for this breadcrumb item\n */\n text: string;\n /**\n * Custom click handler function for interactive breadcrumb items\n */\n onClick?: () => void;\n};\n\n/**\n * Union type representing different breadcrumb item configurations:\n * - string: Simple text breadcrumb item\n * - DetailedBreadcrumbLink: Object with href, text, and/or onClick properties\n */\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n /**\n * Array of breadcrumb items\n */\n links: BreadcrumbLink[];\n /**\n * Color scheme for breadcrumb links\n * @default \"text\"\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Locale for internationalization\n */\n locale?: LocalesValues;\n /**\n * Element type for ARIA current attribute\n * @default 'page'\n */\n elementType?: 'page' | 'location';\n /**\n * Custom separator between breadcrumb items\n * @default ChevronRightIcon\n */\n separator?: ReactNode;\n /**\n * ARIA label for breadcrumb navigation\n * @default 'breadcrumb'\n */\n ariaLabel?: string;\n /**\n * Whether to include structured data markup\n * @default true\n */\n includeStructuredData?: boolean;\n /**\n * Maximum number of breadcrumb items to show before truncation\n */\n maxItems?: number;\n} & VariantProps<typeof breadcrumbVariants> &\n HTMLAttributes<HTMLOListElement>;\n\n/**\n * Breadcrumb component providing navigational context with accessibility features\n *\n * Features:\n * - Supports links, buttons, and static text elements\n * - Full keyboard navigation support\n * - ARIA attributes for screen readers\n * - Schema.org structured data for SEO\n * - Customizable separators and styling\n * - Internationalization support\n * - Responsive design variants\n *\n * @example\n * ```tsx\n * <Breadcrumb\n * links={[\n * 'Home',\n * { href: '/products', text: 'Products' },\n * { onClick: handleCategory, text: 'Electronics' },\n * 'Smartphones'\n * ]}\n * size=\"medium\"\n * ariaLabel=\"Product navigation\"\n * />\n * ```\n */\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = 'text',\n locale,\n elementType = 'page',\n separator = <ChevronRightIcon size={10} />,\n ariaLabel = 'breadcrumb',\n includeStructuredData = true,\n maxItems,\n size,\n spacing,\n ...props\n}) => {\n const displayLinks =\n maxItems && links.length > maxItems\n ? [...links.slice(0, 1), '...', ...links.slice(-(maxItems - 2))]\n : links;\n\n return (\n <nav aria-label={ariaLabel}>\n <ol\n className={cn(breadcrumbVariants({ size, spacing }), className)}\n {...(includeStructuredData && {\n itemScope: true,\n itemType: 'http://schema.org/BreadcrumbList',\n })}\n {...props}\n >\n {displayLinks.map((link, index) => {\n const isLastLink = index === displayLinks.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === displayLinks.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n const isTruncated = link === '...';\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n const separatorColorClass = getColorClass(color);\n\n if (isTruncated) {\n return (\n <Fragment key={`truncated-${text}`}>\n <li className=\"flex items-center\" aria-hidden=\"true\">\n <span className=\"text-neutral-500\">…</span>\n </li>\n {!isLastLink && (\n <li aria-hidden=\"true\" className=\"flex items-center\">\n <span className={cn(separatorColorClass)}>{separator}</span>\n </li>\n )}\n </Fragment>\n );\n }\n\n let section = (\n <Span\n key={text}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(\n 'transition-colors duration-200',\n isActive && 'text-neutral-900'\n )}\n >\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n className={cn(isActive && 'cursor-default text-neutral-900')}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(isActive && 'cursor-default text-neutral-900')}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n {...(includeStructuredData && {\n itemProp: 'itemListElement',\n itemScope: true,\n itemType: 'https://schema.org/ListItem',\n })}\n key={text}\n className=\"flex items-center\"\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <li aria-hidden=\"true\" className=\"flex items-center\">\n <span className={cn(separatorColorClass)}>{separator}</span>\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAM,iBAAiB,UAA+C;AACpE,KAAI,CAAC,MAAO,QAAO;AAenB,QAAO;EAZL,SAAS;EACT,WAAW;EACX,SAAS;EACT,OAAO;EACP,MAAM;EACN,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,SAAS;EACT,QAAQ;EAGK,CAAC,UAAuB;;;;;AAMzC,MAAM,qBAAqB,IAAI,gDAAgD;CAC7E,UAAU;EACR,MAAM;GACJ,OAAO;GACP,QAAQ;GACR,OAAO;GACR;EACD,SAAS;GACP,SAAS;GACT,QAAQ;GACR,OAAO;GACR;EACF;CACD,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CACF,CAAC;;;;AAKF,MAAM,YAA+B,EACnC,MACA,MACA,UACA,SACA,OACA,UACA,QACA,WACA,GAAG,YACC;CAEJ,MAAM,YADU,YAAY,aACH,CAAC;AAE1B,QACE,8CACE,oBAAC,MAAD;EACQ;EACE;EACD;EACE;EACT,UAAS;EACT,gBAAgB;EAChB;EACA,UAAS;EACT,GAAI;EACJ,OAAO,GAAG,UAAU,GAAG;EACvB,QAAQ;EACR,MAAK;YAEL,oBAAC,QAAD;GAAM,UAAS;GAAQ;GAAgB;EAClC,GACP,oBAAC,QAAD;EAAM,UAAS;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;EACD"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { getIntlayer } from 'intlayer';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { type FC, Fragment, type HTMLAttributes, type ReactNode } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Button, type ButtonProps } from '../Button';\nimport { Link, type LinkColor } from '../Link';\n\n/**\n * Props for LinkLink sub-component that renders breadcrumb items as links\n */\ntype LinkLinkProps = {\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n /**\n * Locale for internationalization\n */\n locale?: LocalesValues;\n /**\n * URL to navigate to\n */\n href?: string;\n /**\n * Link color\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Click handler\n */\n onClick?: () => void;\n /**\n * Children content\n */\n children?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n} & Omit<\n HTMLAttributes<HTMLAnchorElement>,\n 'href' | 'onClick' | 'color' | 'children' | 'className'\n>;\n\n/**\n * Maps LinkColor to corresponding Tailwind text color classes\n */\nconst getColorClass = (color?: LinkColor | `${LinkColor}`): string => {\n if (!color) return '';\n\n const colorMap: Record<LinkColor, string> = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n neutral: 'text-neutral',\n light: 'text-white',\n dark: 'text-neutral-800',\n text: 'text-text',\n 'text-inverse': 'text-text-opposite',\n error: 'text-error',\n success: 'text-success',\n custom: '',\n };\n\n return colorMap[color as LinkColor] || '';\n};\n\n/**\n * Breadcrumb variant styles using class-variance-authority\n */\nconst breadcrumbVariants = cva('flex flex-row flex-wrap items-center', {\n variants: {\n size: {\n xs: 'gap-1 text-xs',\n sm: 'gap-1.5 text-sm',\n md: 'gap-2 text-base',\n lg: 'gap-3 text-lg',\n xl: 'gap-4 text-xl',\n },\n spacing: {\n compact: 'gap-1',\n normal: 'gap-2',\n loose: 'gap-4',\n },\n },\n defaultVariants: {\n size: 'md',\n spacing: 'normal',\n },\n});\n\n/**\n * LinkLink sub-component for breadcrumb items that navigate to other pages\n */\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n className,\n ...props\n}) => {\n const content = getIntlayer('breadcrumb');\n const linkLabel = content.linkLabel;\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n isExternalLink={false}\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n size=\"custom\"\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for ButtonLink sub-component that renders breadcrumb items as interactive buttons\n */\ntype ButtonButtonProps = {\n /**\n * Text content for the breadcrumb button\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\n/**\n * ButtonLink sub-component for breadcrumb items with click handlers\n */\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n className,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Button\n onClick={onClick}\n variant=\"link\"\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n size=\"custom\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for Span sub-component that renders static breadcrumb text\n */\ntype SpanProps = {\n /**\n * Text content for the static breadcrumb item\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Span sub-component for static breadcrumb text items\n */\nconst Span: FC<SpanProps> = ({ children, position, className, ...props }) => (\n <span\n itemProp=\"item\"\n className={cn(\n 'inline-flex items-center',\n 'font-medium text-neutral-700',\n 'transition-colors duration-200',\n className\n )}\n >\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\n/**\n * Detailed breadcrumb link configuration with optional href or onClick\n */\ntype DetailedBreadcrumbLink = {\n /**\n * URL to navigate to when the breadcrumb item is clicked\n */\n href?: string;\n /**\n * Text content to display for this breadcrumb item\n */\n text: string;\n /**\n * Custom click handler function for interactive breadcrumb items\n */\n onClick?: () => void;\n};\n\n/**\n * Union type representing different breadcrumb item configurations:\n * - string: Simple text breadcrumb item\n * - DetailedBreadcrumbLink: Object with href, text, and/or onClick properties\n */\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n /**\n * Array of breadcrumb items\n */\n links: BreadcrumbLink[];\n /**\n * Color scheme for breadcrumb links\n * @default \"text\"\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Locale for internationalization\n */\n locale?: LocalesValues;\n /**\n * Element type for ARIA current attribute\n * @default 'page'\n */\n elementType?: 'page' | 'location';\n /**\n * Custom separator between breadcrumb items\n * @default ChevronRightIcon\n */\n separator?: ReactNode;\n /**\n * ARIA label for breadcrumb navigation\n * @default 'breadcrumb'\n */\n ariaLabel?: string;\n /**\n * Whether to include structured data markup\n * @default true\n */\n includeStructuredData?: boolean;\n /**\n * Maximum number of breadcrumb items to show before truncation\n */\n maxItems?: number;\n} & VariantProps<typeof breadcrumbVariants> &\n HTMLAttributes<HTMLOListElement>;\n\n/**\n * Breadcrumb component providing navigational context with accessibility features\n *\n * Features:\n * - Supports links, buttons, and static text elements\n * - Full keyboard navigation support\n * - ARIA attributes for screen readers\n * - Schema.org structured data for SEO\n * - Customizable separators and styling\n * - Internationalization support\n * - Responsive design variants\n *\n * @example\n * ```tsx\n * <Breadcrumb\n * links={[\n * 'Home',\n * { href: '/products', text: 'Products' },\n * { onClick: handleCategory, text: 'Electronics' },\n * 'Smartphones'\n * ]}\n * size=\"md\"\n * ariaLabel=\"Product navigation\"\n * />\n * ```\n */\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = 'text',\n locale,\n elementType = 'page',\n separator = <ChevronRightIcon size={10} />,\n ariaLabel = 'breadcrumb',\n includeStructuredData = true,\n maxItems,\n size,\n spacing,\n ...props\n}) => {\n const displayLinks =\n maxItems && links.length > maxItems\n ? [...links.slice(0, 1), '...', ...links.slice(-(maxItems - 2))]\n : links;\n\n return (\n <nav aria-label={ariaLabel}>\n <ol\n className={cn(breadcrumbVariants({ size, spacing }), className)}\n {...(includeStructuredData && {\n itemScope: true,\n itemType: 'http://schema.org/BreadcrumbList',\n })}\n {...props}\n >\n {displayLinks.map((link, index) => {\n const isLastLink = index === displayLinks.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === displayLinks.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n const isTruncated = link === '...';\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n const separatorColorClass = getColorClass(color);\n\n if (isTruncated) {\n return (\n <Fragment key={`truncated-${text}`}>\n <li className=\"flex items-center\" aria-hidden=\"true\">\n <span className=\"text-neutral-500\">…</span>\n </li>\n {!isLastLink && (\n <li aria-hidden=\"true\" className=\"flex items-center\">\n <span className={cn(separatorColorClass)}>{separator}</span>\n </li>\n )}\n </Fragment>\n );\n }\n\n let section = (\n <Span\n key={text}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(\n 'transition-colors duration-200',\n isActive && 'text-neutral-900'\n )}\n >\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n className={cn(isActive && 'cursor-default text-neutral-900')}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(isActive && 'cursor-default text-neutral-900')}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n {...(includeStructuredData && {\n itemProp: 'itemListElement',\n itemScope: true,\n itemType: 'https://schema.org/ListItem',\n })}\n key={text}\n className=\"flex items-center\"\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <li aria-hidden=\"true\" className=\"flex items-center\">\n <span className={cn(separatorColorClass)}>{separator}</span>\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAM,iBAAiB,UAA+C;AACpE,KAAI,CAAC,MAAO,QAAO;AAenB,QAAO;EAZL,SAAS;EACT,WAAW;EACX,SAAS;EACT,OAAO;EACP,MAAM;EACN,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,SAAS;EACT,QAAQ;EAGK,CAAC,UAAuB;;;;;AAMzC,MAAM,qBAAqB,IAAI,wCAAwC;CACrE,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,SAAS;GACP,SAAS;GACT,QAAQ;GACR,OAAO;GACR;EACF;CACD,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CACF,CAAC;;;;AAKF,MAAM,YAA+B,EACnC,MACA,MACA,UACA,SACA,OACA,UACA,QACA,WACA,GAAG,YACC;CAEJ,MAAM,YADU,YAAY,aACH,CAAC;AAE1B,QACE,8CACE,oBAAC,MAAD;EACQ;EACE;EACD;EACE;EACT,UAAS;EACT,gBAAgB;EAChB;EACA,UAAS;EACT,GAAI;EACJ,OAAO,GAAG,UAAU,GAAG;EACvB,QAAQ;EACR,MAAK;YAEL,oBAAC,QAAD;GAAM,UAAS;GAAQ;GAAgB;EACl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AG;MAAiB;KACzD,EACI,IALI,KAKJ;KAEb;GACC;EACD"}
|
|
@@ -14,7 +14,8 @@ const buttonIconVariants = cva("flex-none shrink-0", {
|
|
|
14
14
|
"icon-sm": "size-3",
|
|
15
15
|
"icon-md": "size-4",
|
|
16
16
|
"icon-lg": "size-5",
|
|
17
|
-
"icon-xl": "size-6"
|
|
17
|
+
"icon-xl": "size-6",
|
|
18
|
+
custom: ""
|
|
18
19
|
} },
|
|
19
20
|
defaultVariants: { size: "md" }
|
|
20
21
|
});
|
|
@@ -32,7 +33,8 @@ const buttonVariants = cva("relative inline-flex cursor-pointer items-center jus
|
|
|
32
33
|
"icon-sm": "p-1.5",
|
|
33
34
|
"icon-md": "p-1.5",
|
|
34
35
|
"icon-lg": "p-1.5",
|
|
35
|
-
"icon-xl": "p-3"
|
|
36
|
+
"icon-xl": "p-3",
|
|
37
|
+
custom: ""
|
|
36
38
|
},
|
|
37
39
|
color: {
|
|
38
40
|
primary: "hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light",
|