@mgamadeus/ddd-admin-ui 0.1.0-rc.6 → 0.2.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/.claude/skills/ddd-admin-ui-specialist/SKILL.md +56 -2
- package/CHANGELOG.md +243 -1
- package/README.md +266 -26
- package/STANDARDS.md +173 -2
- package/dist/components.css +27 -3
- package/dist/data/DeltaText.d.ts +29 -0
- package/dist/data/DeltaText.d.ts.map +1 -0
- package/dist/data/DeltaText.js +36 -0
- package/dist/data/DeltaText.js.map +1 -0
- package/dist/data/MetricGrid.d.ts +15 -0
- package/dist/data/MetricGrid.d.ts.map +1 -0
- package/dist/data/MetricGrid.js +17 -0
- package/dist/data/MetricGrid.js.map +1 -0
- package/dist/data/MetricTile.d.ts +32 -0
- package/dist/data/MetricTile.d.ts.map +1 -0
- package/dist/data/MetricTile.js +13 -0
- package/dist/data/MetricTile.js.map +1 -0
- package/dist/data/NoteList.d.ts +19 -0
- package/dist/data/NoteList.d.ts.map +1 -0
- package/dist/data/NoteList.js +23 -0
- package/dist/data/NoteList.js.map +1 -0
- package/dist/data/delta.d.ts +40 -0
- package/dist/data/delta.d.ts.map +1 -0
- package/dist/data/delta.js +40 -0
- package/dist/data/delta.js.map +1 -0
- package/dist/data/index.d.ts +6 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +7 -0
- package/dist/data/index.js.map +1 -0
- package/dist/design-studio/contract.d.ts +162 -0
- package/dist/design-studio/contract.d.ts.map +1 -0
- package/dist/design-studio/contract.js +2 -0
- package/dist/design-studio/contract.js.map +1 -0
- package/dist/design-studio/index.d.ts +45 -0
- package/dist/design-studio/index.d.ts.map +1 -0
- package/dist/design-studio/index.js +47 -0
- package/dist/design-studio/index.js.map +1 -0
- package/dist/form/ColorValueField.d.ts +37 -0
- package/dist/form/ColorValueField.d.ts.map +1 -0
- package/dist/form/ColorValueField.js +74 -0
- package/dist/form/ColorValueField.js.map +1 -0
- package/dist/form/FormDialog.d.ts +1 -0
- package/dist/form/FormDialog.d.ts.map +1 -1
- package/dist/form/FormDialog.js +3 -1
- package/dist/form/FormDialog.js.map +1 -1
- package/dist/form/FormDrawer.d.ts +12 -1
- package/dist/form/FormDrawer.d.ts.map +1 -1
- package/dist/form/FormDrawer.js +9 -2
- package/dist/form/FormDrawer.js.map +1 -1
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +2 -0
- package/dist/form/index.js.map +1 -1
- package/dist/glass/QuickFilterPills.d.ts +7 -0
- package/dist/glass/QuickFilterPills.d.ts.map +1 -1
- package/dist/glass/QuickFilterPills.js +4 -3
- package/dist/glass/QuickFilterPills.js.map +1 -1
- package/dist/i18n/format.d.ts +3 -2
- package/dist/i18n/format.d.ts.map +1 -1
- package/dist/i18n/format.js +3 -2
- package/dist/i18n/format.js.map +1 -1
- package/dist/i18n/formatLocale.d.ts +8 -0
- package/dist/i18n/formatLocale.d.ts.map +1 -0
- package/dist/i18n/formatLocale.js +10 -0
- package/dist/i18n/formatLocale.js.map +1 -0
- package/dist/i18n/hints.json +498 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n-keys.json +4444 -351
- package/dist/list/ActionsHeaderText.d.ts +5 -0
- package/dist/list/ActionsHeaderText.d.ts.map +1 -0
- package/dist/list/ActionsHeaderText.js +9 -0
- package/dist/list/ActionsHeaderText.js.map +1 -0
- package/dist/list/Combobox.d.ts +11 -1
- package/dist/list/Combobox.d.ts.map +1 -1
- package/dist/list/Combobox.js +10 -7
- package/dist/list/Combobox.js.map +1 -1
- package/dist/list/EntityListBody.d.ts +9 -1
- package/dist/list/EntityListBody.d.ts.map +1 -1
- package/dist/list/EntityListBody.js +5 -3
- package/dist/list/EntityListBody.js.map +1 -1
- package/dist/list/EntityListBulkBar.d.ts +45 -3
- package/dist/list/EntityListBulkBar.d.ts.map +1 -1
- package/dist/list/EntityListBulkBar.js +31 -5
- package/dist/list/EntityListBulkBar.js.map +1 -1
- package/dist/list/EntityListEmpty.d.ts +9 -3
- package/dist/list/EntityListEmpty.d.ts.map +1 -1
- package/dist/list/EntityListEmpty.js +3 -3
- package/dist/list/EntityListEmpty.js.map +1 -1
- package/dist/list/EntityListTable.d.ts +3 -2
- package/dist/list/EntityListTable.d.ts.map +1 -1
- package/dist/list/EntityListTable.js +12 -8
- package/dist/list/EntityListTable.js.map +1 -1
- package/dist/list/EntityListToolbar.d.ts +30 -0
- package/dist/list/EntityListToolbar.d.ts.map +1 -1
- package/dist/list/EntityListToolbar.js +18 -4
- package/dist/list/EntityListToolbar.js.map +1 -1
- package/dist/list/EntityListViewToggle.d.ts +4 -1
- package/dist/list/EntityListViewToggle.d.ts.map +1 -1
- package/dist/list/EntityListViewToggle.js +15 -4
- package/dist/list/EntityListViewToggle.js.map +1 -1
- package/dist/list/cells.d.ts +10 -2
- package/dist/list/cells.d.ts.map +1 -1
- package/dist/list/cells.js +15 -6
- package/dist/list/cells.js.map +1 -1
- package/dist/list/columns.d.ts +85 -0
- package/dist/list/columns.d.ts.map +1 -0
- package/dist/list/columns.js +88 -0
- package/dist/list/columns.js.map +1 -0
- package/dist/list/filters.d.ts +19 -1
- package/dist/list/filters.d.ts.map +1 -1
- package/dist/list/filters.js +47 -3
- package/dist/list/filters.js.map +1 -1
- package/dist/list/index.d.ts +6 -0
- package/dist/list/index.d.ts.map +1 -1
- package/dist/list/index.js +3 -0
- package/dist/list/index.js.map +1 -1
- package/dist/logic/browser/normalizeImage.d.ts +69 -0
- package/dist/logic/browser/normalizeImage.d.ts.map +1 -0
- package/dist/logic/browser/normalizeImage.js +147 -0
- package/dist/logic/browser/normalizeImage.js.map +1 -0
- package/dist/logic/index.d.ts +25 -2
- package/dist/logic/index.d.ts.map +1 -1
- package/dist/logic/index.js +15 -1
- package/dist/logic/index.js.map +1 -1
- package/dist/logic/pure/colorValue.d.ts +22 -0
- package/dist/logic/pure/colorValue.d.ts.map +1 -0
- package/dist/logic/pure/colorValue.js +34 -0
- package/dist/logic/pure/colorValue.js.map +1 -0
- package/dist/logic/pure/confirm.d.ts +1 -0
- package/dist/logic/pure/confirm.d.ts.map +1 -1
- package/dist/logic/pure/confirm.js.map +1 -1
- package/dist/logic/pure/dateRangePresets.d.ts +33 -0
- package/dist/logic/pure/dateRangePresets.d.ts.map +1 -0
- package/dist/logic/pure/dateRangePresets.js +41 -0
- package/dist/logic/pure/dateRangePresets.js.map +1 -0
- package/dist/logic/pure/format.d.ts +3 -3
- package/dist/logic/pure/format.d.ts.map +1 -1
- package/dist/logic/pure/format.js +13 -12
- package/dist/logic/pure/format.js.map +1 -1
- package/dist/logic/pure/imageCrop.d.ts +99 -0
- package/dist/logic/pure/imageCrop.d.ts.map +1 -0
- package/dist/logic/pure/imageCrop.js +198 -0
- package/dist/logic/pure/imageCrop.js.map +1 -0
- package/dist/logic/pure/injectedApi.d.ts +83 -0
- package/dist/logic/pure/injectedApi.d.ts.map +1 -0
- package/dist/logic/pure/injectedApi.js +87 -0
- package/dist/logic/pure/injectedApi.js.map +1 -0
- package/dist/logic/pure/listTracks.d.ts +14 -2
- package/dist/logic/pure/listTracks.d.ts.map +1 -1
- package/dist/logic/pure/listTracks.js +15 -4
- package/dist/logic/pure/listTracks.js.map +1 -1
- package/dist/logic/pure/locales.d.ts +22 -0
- package/dist/logic/pure/locales.d.ts.map +1 -1
- package/dist/logic/pure/locales.js +43 -0
- package/dist/logic/pure/locales.js.map +1 -1
- package/dist/logic/pure/navigation.d.ts +159 -0
- package/dist/logic/pure/navigation.d.ts.map +1 -0
- package/dist/logic/pure/navigation.js +158 -0
- package/dist/logic/pure/navigation.js.map +1 -0
- package/dist/logic/pure/runSequential.d.ts +42 -0
- package/dist/logic/pure/runSequential.d.ts.map +1 -1
- package/dist/logic/pure/runSequential.js +65 -13
- package/dist/logic/pure/runSequential.js.map +1 -1
- package/dist/logic/pure/textLimits.d.ts +18 -0
- package/dist/logic/pure/textLimits.d.ts.map +1 -0
- package/dist/logic/pure/textLimits.js +14 -0
- package/dist/logic/pure/textLimits.js.map +1 -0
- package/dist/logic/react/textLimits.d.ts +8 -0
- package/dist/logic/react/textLimits.d.ts.map +1 -0
- package/dist/logic/react/textLimits.js +9 -0
- package/dist/logic/react/textLimits.js.map +1 -0
- package/dist/logic/react/useEntityTranslations.d.ts +16 -1
- package/dist/logic/react/useEntityTranslations.d.ts.map +1 -1
- package/dist/logic/react/useEntityTranslations.js +18 -4
- package/dist/logic/react/useEntityTranslations.js.map +1 -1
- package/dist/logic/react/useMediaQuery.d.ts +14 -0
- package/dist/logic/react/useMediaQuery.d.ts.map +1 -0
- package/dist/logic/react/useMediaQuery.js +24 -0
- package/dist/logic/react/useMediaQuery.js.map +1 -0
- package/dist/logic/react/useMemoryUrlState.d.ts +13 -0
- package/dist/logic/react/useMemoryUrlState.d.ts.map +1 -0
- package/dist/logic/react/useMemoryUrlState.js +41 -0
- package/dist/logic/react/useMemoryUrlState.js.map +1 -0
- package/dist/logic/react/useOptimisticRowPatches.d.ts +16 -0
- package/dist/logic/react/useOptimisticRowPatches.d.ts.map +1 -0
- package/dist/logic/react/useOptimisticRowPatches.js +39 -0
- package/dist/logic/react/useOptimisticRowPatches.js.map +1 -0
- package/dist/markdown/MarkdownEditor.d.ts +36 -0
- package/dist/markdown/MarkdownEditor.d.ts.map +1 -0
- package/dist/markdown/MarkdownEditor.js +36 -0
- package/dist/markdown/MarkdownEditor.js.map +1 -0
- package/dist/markdown/MarkdownPreview.d.ts +15 -0
- package/dist/markdown/MarkdownPreview.d.ts.map +1 -0
- package/dist/markdown/MarkdownPreview.js +17 -0
- package/dist/markdown/MarkdownPreview.js.map +1 -0
- package/dist/markdown/index.d.ts +7 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +9 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/loadMarkdownLibrary.d.ts +28 -0
- package/dist/markdown/loadMarkdownLibrary.d.ts.map +1 -0
- package/dist/markdown/loadMarkdownLibrary.js +40 -0
- package/dist/markdown/loadMarkdownLibrary.js.map +1 -0
- package/dist/markdown/markdownPipeline.d.ts +20 -0
- package/dist/markdown/markdownPipeline.d.ts.map +1 -0
- package/dist/markdown/markdownPipeline.js +50 -0
- package/dist/markdown/markdownPipeline.js.map +1 -0
- package/dist/markdown/renderMarkdownEditor.d.ts +18 -0
- package/dist/markdown/renderMarkdownEditor.d.ts.map +1 -0
- package/dist/markdown/renderMarkdownEditor.js +14 -0
- package/dist/markdown/renderMarkdownEditor.js.map +1 -0
- package/dist/markdown/useMarkdownLibrary.d.ts +24 -0
- package/dist/markdown/useMarkdownLibrary.d.ts.map +1 -0
- package/dist/markdown/useMarkdownLibrary.js +47 -0
- package/dist/markdown/useMarkdownLibrary.js.map +1 -0
- package/dist/media/ImageCropDialog.d.ts +48 -0
- package/dist/media/ImageCropDialog.d.ts.map +1 -0
- package/dist/media/ImageCropDialog.js +203 -0
- package/dist/media/ImageCropDialog.js.map +1 -0
- package/dist/media/MediaItemField.d.ts.map +1 -1
- package/dist/media/MediaItemField.js +3 -1
- package/dist/media/MediaItemField.js.map +1 -1
- package/dist/media/MediaItemPickerDialog.d.ts +1 -0
- package/dist/media/MediaItemPickerDialog.d.ts.map +1 -1
- package/dist/media/MediaItemPickerDialog.js +3 -1
- package/dist/media/MediaItemPickerDialog.js.map +1 -1
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +2 -0
- package/dist/media/index.js.map +1 -1
- package/dist/next/index.d.ts +1 -0
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +1 -0
- package/dist/next/index.js.map +1 -1
- package/dist/next/useNextPathname.d.ts +7 -0
- package/dist/next/useNextPathname.d.ts.map +1 -0
- package/dist/next/useNextPathname.js +9 -0
- package/dist/next/useNextPathname.js.map +1 -0
- package/dist/page/DetailHeader.d.ts.map +1 -1
- package/dist/page/DetailHeader.js +3 -1
- package/dist/page/DetailHeader.js.map +1 -1
- package/dist/page/MaintenanceActionCard.d.ts +29 -0
- package/dist/page/MaintenanceActionCard.d.ts.map +1 -0
- package/dist/page/MaintenanceActionCard.js +21 -0
- package/dist/page/MaintenanceActionCard.js.map +1 -0
- package/dist/page/PageHeader.d.ts.map +1 -1
- package/dist/page/PageHeader.js +3 -1
- package/dist/page/PageHeader.js.map +1 -1
- package/dist/page/RouteError.d.ts +26 -0
- package/dist/page/RouteError.d.ts.map +1 -0
- package/dist/page/RouteError.js +35 -0
- package/dist/page/RouteError.js.map +1 -0
- package/dist/page/RouteLoading.d.ts +16 -0
- package/dist/page/RouteLoading.d.ts.map +1 -0
- package/dist/page/RouteLoading.js +17 -0
- package/dist/page/RouteLoading.js.map +1 -0
- package/dist/page/SectionHeader.d.ts.map +1 -1
- package/dist/page/SectionHeader.js +3 -1
- package/dist/page/SectionHeader.js.map +1 -1
- package/dist/page/index.d.ts +6 -0
- package/dist/page/index.d.ts.map +1 -1
- package/dist/page/index.js +5 -0
- package/dist/page/index.js.map +1 -1
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/confirmDialogView.d.ts +1 -0
- package/dist/primitives/confirmDialogView.d.ts.map +1 -1
- package/dist/primitives/confirmDialogView.js +3 -1
- package/dist/primitives/confirmDialogView.js.map +1 -1
- package/dist/primitives/descriptionContent.d.ts +8 -0
- package/dist/primitives/descriptionContent.d.ts.map +1 -0
- package/dist/primitives/descriptionContent.js +7 -0
- package/dist/primitives/descriptionContent.js.map +1 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/pathname.d.ts +22 -0
- package/dist/primitives/pathname.d.ts.map +1 -0
- package/dist/primitives/pathname.js +23 -0
- package/dist/primitives/pathname.js.map +1 -0
- package/dist/primitives/segmented-control.d.ts +37 -3
- package/dist/primitives/segmented-control.d.ts.map +1 -1
- package/dist/primitives/segmented-control.js +45 -10
- package/dist/primitives/segmented-control.js.map +1 -1
- package/dist/provider/AdminUiProvider.d.ts +2 -2
- package/dist/provider/AdminUiProvider.d.ts.map +1 -1
- package/dist/provider/AdminUiProvider.js +14 -3
- package/dist/provider/AdminUiProvider.js.map +1 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/types.d.ts +19 -0
- package/dist/provider/types.d.ts.map +1 -1
- package/dist/scripts/check-contrast.mjs +353 -0
- package/dist/shell/AccountMenu.d.ts +51 -0
- package/dist/shell/AccountMenu.d.ts.map +1 -0
- package/dist/shell/AccountMenu.js +34 -0
- package/dist/shell/AccountMenu.js.map +1 -0
- package/dist/shell/AppShell.d.ts +68 -0
- package/dist/shell/AppShell.d.ts.map +1 -0
- package/dist/shell/AppShell.js +56 -0
- package/dist/shell/AppShell.js.map +1 -0
- package/dist/shell/LanguageMenu.d.ts +36 -0
- package/dist/shell/LanguageMenu.d.ts.map +1 -0
- package/dist/shell/LanguageMenu.js +33 -0
- package/dist/shell/LanguageMenu.js.map +1 -0
- package/dist/shell/NavItemMarks.d.ts +21 -0
- package/dist/shell/NavItemMarks.d.ts.map +1 -0
- package/dist/shell/NavItemMarks.js +30 -0
- package/dist/shell/NavItemMarks.js.map +1 -0
- package/dist/shell/ShellBreadcrumbs.d.ts +26 -0
- package/dist/shell/ShellBreadcrumbs.d.ts.map +1 -0
- package/dist/shell/ShellBreadcrumbs.js +78 -0
- package/dist/shell/ShellBreadcrumbs.js.map +1 -0
- package/dist/shell/ShellDocumentTitle.d.ts +27 -0
- package/dist/shell/ShellDocumentTitle.d.ts.map +1 -0
- package/dist/shell/ShellDocumentTitle.js +50 -0
- package/dist/shell/ShellDocumentTitle.js.map +1 -0
- package/dist/shell/ShellMobileMenu.d.ts +33 -0
- package/dist/shell/ShellMobileMenu.d.ts.map +1 -0
- package/dist/shell/ShellMobileMenu.js +33 -0
- package/dist/shell/ShellMobileMenu.js.map +1 -0
- package/dist/shell/ShellNavLink.d.ts +18 -0
- package/dist/shell/ShellNavLink.d.ts.map +1 -0
- package/dist/shell/ShellNavLink.js +16 -0
- package/dist/shell/ShellNavLink.js.map +1 -0
- package/dist/shell/ShellNavList.d.ts +18 -0
- package/dist/shell/ShellNavList.d.ts.map +1 -0
- package/dist/shell/ShellNavList.js +45 -0
- package/dist/shell/ShellNavList.js.map +1 -0
- package/dist/shell/ShellNavRail.d.ts +11 -0
- package/dist/shell/ShellNavRail.d.ts.map +1 -0
- package/dist/shell/ShellNavRail.js +97 -0
- package/dist/shell/ShellNavRail.js.map +1 -0
- package/dist/shell/ShellSidebar.d.ts +32 -0
- package/dist/shell/ShellSidebar.d.ts.map +1 -0
- package/dist/shell/ShellSidebar.js +29 -0
- package/dist/shell/ShellSidebar.js.map +1 -0
- package/dist/shell/ShellTopBar.d.ts +23 -0
- package/dist/shell/ShellTopBar.d.ts.map +1 -0
- package/dist/shell/ShellTopBar.js +25 -0
- package/dist/shell/ShellTopBar.js.map +1 -0
- package/dist/shell/index.d.ts +28 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +19 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/navClasses.d.ts +12 -0
- package/dist/shell/navClasses.d.ts.map +1 -0
- package/dist/shell/navClasses.js +14 -0
- package/dist/shell/navClasses.js.map +1 -0
- package/dist/shell/shellContext.d.ts +30 -0
- package/dist/shell/shellContext.d.ts.map +1 -0
- package/dist/shell/shellContext.js +7 -0
- package/dist/shell/shellContext.js.map +1 -0
- package/dist/shell/useShellShortcut.d.ts +12 -0
- package/dist/shell/useShellShortcut.d.ts.map +1 -0
- package/dist/shell/useShellShortcut.js +42 -0
- package/dist/shell/useShellShortcut.js.map +1 -0
- package/dist/shell/useSidebarCollapsed.d.ts +10 -0
- package/dist/shell/useSidebarCollapsed.d.ts.map +1 -0
- package/dist/shell/useSidebarCollapsed.js +49 -0
- package/dist/shell/useSidebarCollapsed.js.map +1 -0
- package/dist/shell-background/ShaderBackground.d.ts +27 -0
- package/dist/shell-background/ShaderBackground.d.ts.map +1 -0
- package/dist/shell-background/ShaderBackground.js +92 -0
- package/dist/shell-background/ShaderBackground.js.map +1 -0
- package/dist/shell-background/ShaderCanvas.d.ts +16 -0
- package/dist/shell-background/ShaderCanvas.d.ts.map +1 -0
- package/dist/shell-background/ShaderCanvas.js +197 -0
- package/dist/shell-background/ShaderCanvas.js.map +1 -0
- package/dist/shell-background/index.d.ts +5 -0
- package/dist/shell-background/index.d.ts.map +1 -0
- package/dist/shell-background/index.js +5 -0
- package/dist/shell-background/index.js.map +1 -0
- package/dist/shell-background/shader.d.ts +81 -0
- package/dist/shell-background/shader.d.ts.map +1 -0
- package/dist/shell-background/shader.js +194 -0
- package/dist/shell-background/shader.js.map +1 -0
- package/dist/showcase/Showcase.d.ts +12 -2
- package/dist/showcase/Showcase.d.ts.map +1 -1
- package/dist/showcase/Showcase.js +24 -6
- package/dist/showcase/Showcase.js.map +1 -1
- package/dist/showcase/coverage.d.ts.map +1 -1
- package/dist/showcase/coverage.js +55 -4
- package/dist/showcase/coverage.js.map +1 -1
- package/dist/showcase/fixtures.d.ts +9 -0
- package/dist/showcase/fixtures.d.ts.map +1 -0
- package/dist/showcase/fixtures.js +268 -0
- package/dist/showcase/fixtures.js.map +1 -0
- package/dist/showcase/index.d.ts +2 -0
- package/dist/showcase/index.d.ts.map +1 -1
- package/dist/showcase/index.js +1 -0
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/sections/DataShowcase.d.ts +3 -0
- package/dist/showcase/sections/DataShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/DataShowcase.js +15 -0
- package/dist/showcase/sections/DataShowcase.js.map +1 -0
- package/dist/showcase/sections/FormAdditionsShowcase.d.ts +3 -0
- package/dist/showcase/sections/FormAdditionsShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/FormAdditionsShowcase.js +15 -0
- package/dist/showcase/sections/FormAdditionsShowcase.js.map +1 -0
- package/dist/showcase/sections/FormShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/FormShowcase.js +2 -1
- package/dist/showcase/sections/FormShowcase.js.map +1 -1
- package/dist/showcase/sections/ListAdditionsShowcase.d.ts +3 -0
- package/dist/showcase/sections/ListAdditionsShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/ListAdditionsShowcase.js +61 -0
- package/dist/showcase/sections/ListAdditionsShowcase.js.map +1 -0
- package/dist/showcase/sections/ListShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/ListShowcase.js +2 -1
- package/dist/showcase/sections/ListShowcase.js.map +1 -1
- package/dist/showcase/sections/MarkdownShowcase.d.ts +21 -0
- package/dist/showcase/sections/MarkdownShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/MarkdownShowcase.js +28 -0
- package/dist/showcase/sections/MarkdownShowcase.js.map +1 -0
- package/dist/showcase/sections/MediaCropShowcase.d.ts +3 -0
- package/dist/showcase/sections/MediaCropShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/MediaCropShowcase.js +56 -0
- package/dist/showcase/sections/MediaCropShowcase.js.map +1 -0
- package/dist/showcase/sections/MediaShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/MediaShowcase.js +2 -1
- package/dist/showcase/sections/MediaShowcase.js.map +1 -1
- package/dist/showcase/sections/PageAdditionsShowcase.d.ts +3 -0
- package/dist/showcase/sections/PageAdditionsShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/PageAdditionsShowcase.js +7 -0
- package/dist/showcase/sections/PageAdditionsShowcase.js.map +1 -0
- package/dist/showcase/sections/PageShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/PageShowcase.js +4 -3
- package/dist/showcase/sections/PageShowcase.js.map +1 -1
- package/dist/showcase/sections/PrimitivesAdditionsShowcase.d.ts +3 -0
- package/dist/showcase/sections/PrimitivesAdditionsShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/PrimitivesAdditionsShowcase.js +20 -0
- package/dist/showcase/sections/PrimitivesAdditionsShowcase.js.map +1 -0
- package/dist/showcase/sections/PrimitivesShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/PrimitivesShowcase.js +3 -2
- package/dist/showcase/sections/PrimitivesShowcase.js.map +1 -1
- package/dist/showcase/sections/ShellShowcase.d.ts +3 -0
- package/dist/showcase/sections/ShellShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/ShellShowcase.js +71 -0
- package/dist/showcase/sections/ShellShowcase.js.map +1 -0
- package/dist/showcase/sections/TranslationsShowcase.d.ts +2 -0
- package/dist/showcase/sections/TranslationsShowcase.d.ts.map +1 -1
- package/dist/showcase/sections/TranslationsShowcase.js +5 -1
- package/dist/showcase/sections/TranslationsShowcase.js.map +1 -1
- package/dist/showcase/sections/WorkersShowcase.d.ts +3 -0
- package/dist/showcase/sections/WorkersShowcase.d.ts.map +1 -0
- package/dist/showcase/sections/WorkersShowcase.js +15 -0
- package/dist/showcase/sections/WorkersShowcase.js.map +1 -0
- package/dist/tokens.json +276 -5
- package/dist/translations/AppTranslationKeyDrawer.d.ts +14 -0
- package/dist/translations/AppTranslationKeyDrawer.d.ts.map +1 -0
- package/dist/translations/AppTranslationKeyDrawer.js +197 -0
- package/dist/translations/AppTranslationKeyDrawer.js.map +1 -0
- package/dist/translations/AppTranslationsScreen.d.ts +25 -0
- package/dist/translations/AppTranslationsScreen.d.ts.map +1 -0
- package/dist/translations/AppTranslationsScreen.js +139 -0
- package/dist/translations/AppTranslationsScreen.js.map +1 -0
- package/dist/translations/ConfigImportCards.d.ts +26 -0
- package/dist/translations/ConfigImportCards.d.ts.map +1 -0
- package/dist/translations/ConfigImportCards.js +59 -0
- package/dist/translations/ConfigImportCards.js.map +1 -0
- package/dist/translations/LanguagesScreen.d.ts +20 -0
- package/dist/translations/LanguagesScreen.d.ts.map +1 -0
- package/dist/translations/LanguagesScreen.js +110 -0
- package/dist/translations/LanguagesScreen.js.map +1 -0
- package/dist/translations/LocalesScreen.d.ts +22 -0
- package/dist/translations/LocalesScreen.d.ts.map +1 -0
- package/dist/translations/LocalesScreen.js +92 -0
- package/dist/translations/LocalesScreen.js.map +1 -0
- package/dist/translations/TranslatableField.d.ts +13 -2
- package/dist/translations/TranslatableField.d.ts.map +1 -1
- package/dist/translations/TranslatableField.js +23 -5
- package/dist/translations/TranslatableField.js.map +1 -1
- package/dist/translations/TranslatableInput.d.ts.map +1 -1
- package/dist/translations/TranslatableInput.js +4 -1
- package/dist/translations/TranslatableInput.js.map +1 -1
- package/dist/translations/TranslatableMarkdown.d.ts +2 -0
- package/dist/translations/TranslatableMarkdown.d.ts.map +1 -1
- package/dist/translations/TranslatableMarkdown.js +12 -7
- package/dist/translations/TranslatableMarkdown.js.map +1 -1
- package/dist/translations/TranslationCompleteness.d.ts +11 -0
- package/dist/translations/TranslationCompleteness.d.ts.map +1 -0
- package/dist/translations/TranslationCompleteness.js +73 -0
- package/dist/translations/TranslationCompleteness.js.map +1 -0
- package/dist/translations/adminFormat.d.ts +27 -0
- package/dist/translations/adminFormat.d.ts.map +1 -0
- package/dist/translations/adminFormat.js +39 -0
- package/dist/translations/adminFormat.js.map +1 -0
- package/dist/translations/adminTypes.d.ts +136 -0
- package/dist/translations/adminTypes.d.ts.map +1 -0
- package/dist/translations/adminTypes.js +9 -0
- package/dist/translations/adminTypes.js.map +1 -0
- package/dist/translations/api.d.ts +225 -0
- package/dist/translations/api.d.ts.map +1 -0
- package/dist/translations/api.js +132 -0
- package/dist/translations/api.js.map +1 -0
- package/dist/translations/focusOverLimit.d.ts +7 -0
- package/dist/translations/focusOverLimit.d.ts.map +1 -0
- package/dist/translations/focusOverLimit.js +23 -0
- package/dist/translations/focusOverLimit.js.map +1 -0
- package/dist/translations/index.d.ts +22 -0
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +13 -0
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/useContentLocales.d.ts +17 -0
- package/dist/translations/useContentLocales.d.ts.map +1 -0
- package/dist/translations/useContentLocales.js +33 -0
- package/dist/translations/useContentLocales.js.map +1 -0
- package/dist/translations/useEntityTranslator.d.ts +34 -0
- package/dist/translations/useEntityTranslator.d.ts.map +1 -0
- package/dist/translations/useEntityTranslator.js +49 -0
- package/dist/translations/useEntityTranslator.js.map +1 -0
- package/dist/workers/WorkerRestartButton.d.ts +19 -0
- package/dist/workers/WorkerRestartButton.d.ts.map +1 -0
- package/dist/workers/WorkerRestartButton.js +59 -0
- package/dist/workers/WorkerRestartButton.js.map +1 -0
- package/dist/workers/WorkerTransportScreen.d.ts +24 -0
- package/dist/workers/WorkerTransportScreen.d.ts.map +1 -0
- package/dist/workers/WorkerTransportScreen.js +121 -0
- package/dist/workers/WorkerTransportScreen.js.map +1 -0
- package/dist/workers/WorkersOverviewScreen.d.ts +30 -0
- package/dist/workers/WorkersOverviewScreen.d.ts.map +1 -0
- package/dist/workers/WorkersOverviewScreen.js +61 -0
- package/dist/workers/WorkersOverviewScreen.js.map +1 -0
- package/dist/workers/api.d.ts +113 -0
- package/dist/workers/api.d.ts.map +1 -0
- package/dist/workers/api.js +73 -0
- package/dist/workers/api.js.map +1 -0
- package/dist/workers/charts.d.ts +94 -0
- package/dist/workers/charts.d.ts.map +1 -0
- package/dist/workers/charts.js +238 -0
- package/dist/workers/charts.js.map +1 -0
- package/dist/workers/format.d.ts +96 -0
- package/dist/workers/format.d.ts.map +1 -0
- package/dist/workers/format.js +231 -0
- package/dist/workers/format.js.map +1 -0
- package/dist/workers/history.d.ts +20 -0
- package/dist/workers/history.d.ts.map +1 -0
- package/dist/workers/history.js +84 -0
- package/dist/workers/history.js.map +1 -0
- package/dist/workers/index.d.ts +24 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +19 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/overview.d.ts +72 -0
- package/dist/workers/overview.d.ts.map +1 -0
- package/dist/workers/overview.js +323 -0
- package/dist/workers/overview.js.map +1 -0
- package/dist/workers/status.d.ts +11 -0
- package/dist/workers/status.d.ts.map +1 -0
- package/dist/workers/status.js +106 -0
- package/dist/workers/status.js.map +1 -0
- package/dist/workers/transport.d.ts +78 -0
- package/dist/workers/transport.d.ts.map +1 -0
- package/dist/workers/transport.js +407 -0
- package/dist/workers/transport.js.map +1 -0
- package/dist/workers/types.d.ts +234 -0
- package/dist/workers/types.d.ts.map +1 -0
- package/dist/workers/types.js +8 -0
- package/dist/workers/types.js.map +1 -0
- package/dist/workers/useWorkersWindow.d.ts +12 -0
- package/dist/workers/useWorkersWindow.d.ts.map +1 -0
- package/dist/workers/useWorkersWindow.js +38 -0
- package/dist/workers/useWorkersWindow.js.map +1 -0
- package/dist/workers/window.d.ts +30 -0
- package/dist/workers/window.d.ts.map +1 -0
- package/dist/workers/window.js +39 -0
- package/dist/workers/window.js.map +1 -0
- package/package.json +39 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { type ApiMutationHook, type ApiQueryHook, type InjectableBaseApi, type InjectedRequest } from '../logic/pure/injectedApi.js';
|
|
2
|
+
import type { AdminLanguage, AdminLocale, AppTranslationCompletenessResponse, AppTranslationKey, AppTranslationKeyArg, AppTranslationKeyResponse, AppTranslationKeysResponse, AppTranslationsGenerateAllResponse, AppTranslationsGenerateArg, AppTranslationsGenerateResponse, AppTranslationValue, AppTranslationValueResponse, LanguageResponse, LanguagesResponse, LocaleResponse, LocalesResponse, TranslateEntitiesArg, TranslateEntitiesResponse, TranslationsDeleteResponse, TranslationsListArg } from './adminTypes.js';
|
|
3
|
+
/** Cache tag types of the translation operations. */
|
|
4
|
+
export declare const APP_TRANSLATIONS_TAG = "AdminUiAppTranslations";
|
|
5
|
+
export declare const LANGUAGES_TAG = "AdminUiLanguages";
|
|
6
|
+
export declare const LOCALES_TAG = "AdminUiLocales";
|
|
7
|
+
/** The hooks `createTranslationsApi` returns; the translation screens take them as their `api`. */
|
|
8
|
+
export interface TranslationsApi {
|
|
9
|
+
/** `GET {appTranslations}/keys/list` (QueryOptions). */
|
|
10
|
+
useAppTranslationKeysQuery: ApiQueryHook<TranslationsListArg, AppTranslationKeysResponse>;
|
|
11
|
+
/** `GET {appTranslations}/keys/{appTranslationKeyId}?expand=`. */
|
|
12
|
+
useAppTranslationKeyQuery: ApiQueryHook<AppTranslationKeyArg, AppTranslationKeyResponse>;
|
|
13
|
+
/** `PATCH {appTranslations}/keys` with `{ appTranslationKey }` (create without `id`, update with it). */
|
|
14
|
+
useUpdateAppTranslationKeyMutation: ApiMutationHook<{
|
|
15
|
+
appTranslationKey: AppTranslationKey;
|
|
16
|
+
}, AppTranslationKeyResponse>;
|
|
17
|
+
/** `DELETE {appTranslations}/keys/{appTranslationKeyId}`. */
|
|
18
|
+
useDeleteAppTranslationKeyMutation: ApiMutationHook<{
|
|
19
|
+
appTranslationKeyId: string | number;
|
|
20
|
+
}, TranslationsDeleteResponse>;
|
|
21
|
+
/** `PATCH {appTranslations}/values` with `{ appTranslationValue }`. */
|
|
22
|
+
useUpdateAppTranslationValueMutation: ApiMutationHook<{
|
|
23
|
+
appTranslationValue: AppTranslationValue;
|
|
24
|
+
}, AppTranslationValueResponse>;
|
|
25
|
+
/** `DELETE {appTranslations}/values/{appTranslationValueId}`. */
|
|
26
|
+
useDeleteAppTranslationValueMutation: ApiMutationHook<{
|
|
27
|
+
appTranslationValueId: string | number;
|
|
28
|
+
}, TranslationsDeleteResponse>;
|
|
29
|
+
/** `GET {appTranslations}/keys/completeness`: per active locale and writing style. */
|
|
30
|
+
useAppTranslationCompletenessQuery: ApiQueryHook<void, AppTranslationCompletenessResponse>;
|
|
31
|
+
/** `GET {appTranslations}/keys/generate/{localeId}?writingStyle=&previewOnly=` (a write: it starts a generation). */
|
|
32
|
+
useGenerateAppTranslationsMutation: ApiMutationHook<AppTranslationsGenerateArg, AppTranslationsGenerateResponse>;
|
|
33
|
+
/** `GET {appTranslations}/keys/generate-all` (a write: every missing value of every active locale). */
|
|
34
|
+
useGenerateAllAppTranslationsMutation: ApiMutationHook<void, AppTranslationsGenerateAllResponse>;
|
|
35
|
+
/** `GET {languages}/list` (QueryOptions). */
|
|
36
|
+
useLanguagesQuery: ApiQueryHook<TranslationsListArg, LanguagesResponse>;
|
|
37
|
+
/** `PATCH {languages}` with `{ language }`. */
|
|
38
|
+
useUpdateLanguageMutation: ApiMutationHook<{
|
|
39
|
+
language: AdminLanguage;
|
|
40
|
+
}, LanguageResponse>;
|
|
41
|
+
/** `GET {languages}/importFromConfig`: creates or updates every configured language. */
|
|
42
|
+
useImportLanguagesFromConfigMutation: ApiMutationHook<void, LanguagesResponse>;
|
|
43
|
+
/** `GET {locales}/list` (QueryOptions). */
|
|
44
|
+
useLocalesQuery: ApiQueryHook<TranslationsListArg, LocalesResponse>;
|
|
45
|
+
/** `PATCH {locales}` with `{ locale }`. */
|
|
46
|
+
useUpdateLocaleMutation: ApiMutationHook<{
|
|
47
|
+
locale: AdminLocale;
|
|
48
|
+
}, LocaleResponse>;
|
|
49
|
+
/** `GET {locales}/importFromConfig`: creates or updates every configured locale. */
|
|
50
|
+
useImportLocalesFromConfigMutation: ApiMutationHook<void, LocalesResponse>;
|
|
51
|
+
/** `POST {translations}/translateEntities`: AI-translates entities into locales (changes nothing stored). */
|
|
52
|
+
useTranslateEntitiesMutation: ApiMutationHook<TranslateEntitiesArg, TranslateEntitiesResponse>;
|
|
53
|
+
}
|
|
54
|
+
/** Path segments below `apiPrefix`, as the application's controllers mount them. */
|
|
55
|
+
export interface TranslationsApiPaths {
|
|
56
|
+
/** App translation keys, values and completeness (default `app-translations`). */
|
|
57
|
+
appTranslations: string;
|
|
58
|
+
/** Languages (default `languages`). */
|
|
59
|
+
languages: string;
|
|
60
|
+
/** Locales (default `locales`). */
|
|
61
|
+
locales: string;
|
|
62
|
+
/** Entity translation (default `translations`). */
|
|
63
|
+
translations: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const DEFAULT_TRANSLATIONS_API_PATHS: Readonly<TranslationsApiPaths>;
|
|
66
|
+
export interface CreateTranslationsApiOptions {
|
|
67
|
+
/** The host's RTK Query api (`createApi` with the React hooks module). */
|
|
68
|
+
baseApi: InjectableBaseApi;
|
|
69
|
+
/** The common prefix of the controllers, without a trailing slash (`/api/admin/common`). */
|
|
70
|
+
apiPrefix: string;
|
|
71
|
+
/** Path segments that differ from `DEFAULT_TRANSLATIONS_API_PATHS`. */
|
|
72
|
+
paths?: Partial<TranslationsApiPaths>;
|
|
73
|
+
}
|
|
74
|
+
/** The request of every operation, on `apiPrefix` and the paths. Pure: no RTK runtime. */
|
|
75
|
+
export declare const buildTranslationsRequests: (apiPrefix: string, paths?: Partial<TranslationsApiPaths>) => {
|
|
76
|
+
appTranslationKeys: (arg: TranslationsListArg) => InjectedRequest;
|
|
77
|
+
appTranslationKey: ({ appTranslationKeyId, expand }: AppTranslationKeyArg) => InjectedRequest;
|
|
78
|
+
updateAppTranslationKey: (body: {
|
|
79
|
+
appTranslationKey: AppTranslationKey;
|
|
80
|
+
}) => InjectedRequest;
|
|
81
|
+
deleteAppTranslationKey: ({ appTranslationKeyId }: {
|
|
82
|
+
appTranslationKeyId: string | number;
|
|
83
|
+
}) => InjectedRequest;
|
|
84
|
+
updateAppTranslationValue: (body: {
|
|
85
|
+
appTranslationValue: AppTranslationValue;
|
|
86
|
+
}) => InjectedRequest;
|
|
87
|
+
deleteAppTranslationValue: ({ appTranslationValueId }: {
|
|
88
|
+
appTranslationValueId: string | number;
|
|
89
|
+
}) => InjectedRequest;
|
|
90
|
+
appTranslationCompleteness: () => InjectedRequest;
|
|
91
|
+
generateAppTranslations: ({ localeId, writingStyle, previewOnly }: AppTranslationsGenerateArg) => InjectedRequest;
|
|
92
|
+
generateAllAppTranslations: () => InjectedRequest;
|
|
93
|
+
languages: (arg: TranslationsListArg) => InjectedRequest;
|
|
94
|
+
updateLanguage: (body: {
|
|
95
|
+
language: AdminLanguage;
|
|
96
|
+
}) => InjectedRequest;
|
|
97
|
+
importLanguagesFromConfig: () => InjectedRequest;
|
|
98
|
+
locales: (arg: TranslationsListArg) => InjectedRequest;
|
|
99
|
+
updateLocale: (body: {
|
|
100
|
+
locale: AdminLocale;
|
|
101
|
+
}) => InjectedRequest;
|
|
102
|
+
importLocalesFromConfig: () => InjectedRequest;
|
|
103
|
+
translateEntities: (body: TranslateEntitiesArg) => InjectedRequest;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The operations as injected (endpoint name → definition). Cache: each query provides its tag type; a key or value
|
|
107
|
+
* write invalidates every app translation query (list, key, completeness); a language write or import invalidates the
|
|
108
|
+
* languages; a locale write or import (the `isActive` toggle) the locales and the completeness (it counts active
|
|
109
|
+
* locales); a generation the app translations. The entity translation invalidates nothing.
|
|
110
|
+
*/
|
|
111
|
+
export declare const translationsEndpointDefinitions: (apiPrefix: string, paths?: Partial<TranslationsApiPaths>) => {
|
|
112
|
+
readonly adminUiAppTranslationKeys: {
|
|
113
|
+
readonly kind: "query";
|
|
114
|
+
readonly request: (arg: TranslationsListArg) => InjectedRequest;
|
|
115
|
+
readonly providesTags: string[];
|
|
116
|
+
};
|
|
117
|
+
readonly adminUiAppTranslationKey: {
|
|
118
|
+
readonly kind: "query";
|
|
119
|
+
readonly request: ({ appTranslationKeyId, expand }: AppTranslationKeyArg) => InjectedRequest;
|
|
120
|
+
readonly providesTags: string[];
|
|
121
|
+
};
|
|
122
|
+
readonly adminUiUpdateAppTranslationKey: {
|
|
123
|
+
readonly kind: "mutation";
|
|
124
|
+
readonly request: (body: {
|
|
125
|
+
appTranslationKey: AppTranslationKey;
|
|
126
|
+
}) => InjectedRequest;
|
|
127
|
+
readonly invalidatesTags: string[];
|
|
128
|
+
};
|
|
129
|
+
readonly adminUiDeleteAppTranslationKey: {
|
|
130
|
+
readonly kind: "mutation";
|
|
131
|
+
readonly request: ({ appTranslationKeyId }: {
|
|
132
|
+
appTranslationKeyId: string | number;
|
|
133
|
+
}) => InjectedRequest;
|
|
134
|
+
readonly invalidatesTags: string[];
|
|
135
|
+
};
|
|
136
|
+
readonly adminUiUpdateAppTranslationValue: {
|
|
137
|
+
readonly kind: "mutation";
|
|
138
|
+
readonly request: (body: {
|
|
139
|
+
appTranslationValue: AppTranslationValue;
|
|
140
|
+
}) => InjectedRequest;
|
|
141
|
+
readonly invalidatesTags: string[];
|
|
142
|
+
};
|
|
143
|
+
readonly adminUiDeleteAppTranslationValue: {
|
|
144
|
+
readonly kind: "mutation";
|
|
145
|
+
readonly request: ({ appTranslationValueId }: {
|
|
146
|
+
appTranslationValueId: string | number;
|
|
147
|
+
}) => InjectedRequest;
|
|
148
|
+
readonly invalidatesTags: string[];
|
|
149
|
+
};
|
|
150
|
+
readonly adminUiAppTranslationCompleteness: {
|
|
151
|
+
readonly kind: "query";
|
|
152
|
+
readonly request: () => InjectedRequest;
|
|
153
|
+
readonly providesTags: string[];
|
|
154
|
+
};
|
|
155
|
+
readonly adminUiGenerateAppTranslations: {
|
|
156
|
+
readonly kind: "mutation";
|
|
157
|
+
readonly request: ({ localeId, writingStyle, previewOnly }: AppTranslationsGenerateArg) => InjectedRequest;
|
|
158
|
+
readonly invalidatesTags: string[];
|
|
159
|
+
};
|
|
160
|
+
readonly adminUiGenerateAllAppTranslations: {
|
|
161
|
+
readonly kind: "mutation";
|
|
162
|
+
readonly request: () => InjectedRequest;
|
|
163
|
+
readonly invalidatesTags: string[];
|
|
164
|
+
};
|
|
165
|
+
readonly adminUiLanguages: {
|
|
166
|
+
readonly kind: "query";
|
|
167
|
+
readonly request: (arg: TranslationsListArg) => InjectedRequest;
|
|
168
|
+
readonly providesTags: readonly ["AdminUiLanguages"];
|
|
169
|
+
};
|
|
170
|
+
readonly adminUiUpdateLanguage: {
|
|
171
|
+
readonly kind: "mutation";
|
|
172
|
+
readonly request: (body: {
|
|
173
|
+
language: AdminLanguage;
|
|
174
|
+
}) => InjectedRequest;
|
|
175
|
+
readonly invalidatesTags: readonly ["AdminUiLanguages"];
|
|
176
|
+
};
|
|
177
|
+
readonly adminUiImportLanguagesFromConfig: {
|
|
178
|
+
readonly kind: "mutation";
|
|
179
|
+
readonly request: () => InjectedRequest;
|
|
180
|
+
readonly invalidatesTags: readonly ["AdminUiLanguages"];
|
|
181
|
+
};
|
|
182
|
+
readonly adminUiLocales: {
|
|
183
|
+
readonly kind: "query";
|
|
184
|
+
readonly request: (arg: TranslationsListArg) => InjectedRequest;
|
|
185
|
+
readonly providesTags: readonly ["AdminUiLocales"];
|
|
186
|
+
};
|
|
187
|
+
readonly adminUiUpdateLocale: {
|
|
188
|
+
readonly kind: "mutation";
|
|
189
|
+
readonly request: (body: {
|
|
190
|
+
locale: AdminLocale;
|
|
191
|
+
}) => InjectedRequest;
|
|
192
|
+
readonly invalidatesTags: readonly ["AdminUiLocales", "AdminUiAppTranslations"];
|
|
193
|
+
};
|
|
194
|
+
readonly adminUiImportLocalesFromConfig: {
|
|
195
|
+
readonly kind: "mutation";
|
|
196
|
+
readonly request: () => InjectedRequest;
|
|
197
|
+
readonly invalidatesTags: readonly ["AdminUiLocales", "AdminUiAppTranslations"];
|
|
198
|
+
};
|
|
199
|
+
readonly adminUiTranslateEntities: {
|
|
200
|
+
readonly kind: "mutation";
|
|
201
|
+
readonly request: (body: TranslateEntitiesArg) => InjectedRequest;
|
|
202
|
+
readonly invalidatesTags: readonly [];
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Injects the translation operations into the host's RTK Query api and returns their hooks. Call it once at module
|
|
207
|
+
* scope; a second call with the same api, prefix and paths returns the first result.
|
|
208
|
+
*
|
|
209
|
+
* ```ts
|
|
210
|
+
* export const translationsApi = createTranslationsApi({ baseApi: adminApi, apiPrefix: '/api/admin/common' });
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
export declare const createTranslationsApi: ({ baseApi, apiPrefix, paths }: CreateTranslationsApiOptions) => TranslationsApi;
|
|
214
|
+
/** Fixed answers of a `createStaticTranslationsApi`; a query without one stays loading, a write echoes its body. */
|
|
215
|
+
export interface StaticTranslationsData {
|
|
216
|
+
appTranslationKeys?: (arg: TranslationsListArg) => AppTranslationKeysResponse | undefined;
|
|
217
|
+
appTranslationKey?: (arg: AppTranslationKeyArg) => AppTranslationKeyResponse | undefined;
|
|
218
|
+
completeness?: AppTranslationCompletenessResponse;
|
|
219
|
+
languages?: (arg: TranslationsListArg) => LanguagesResponse | undefined;
|
|
220
|
+
locales?: (arg: TranslationsListArg) => LocalesResponse | undefined;
|
|
221
|
+
translateEntities?: (arg: TranslateEntitiesArg) => TranslateEntitiesResponse | Promise<TranslateEntitiesResponse>;
|
|
222
|
+
}
|
|
223
|
+
/** A `TranslationsApi` answering fixed payloads, without a store or a request: for showcases, tests and design reviews. */
|
|
224
|
+
export declare const createStaticTranslationsApi: (data: StaticTranslationsData) => TranslationsApi;
|
|
225
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/translations/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EAMrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,kCAAkC,EAClC,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,kCAAkC,EAClC,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAChD,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAE5C,m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E,CAAC,GAAG,EAAE,mBAAmB,KAAK,0BAA0B,GAAG,SAAS,CAAC;IAC1F,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,yBAAyB,GAAG,SAAS,CAAC;IACzF,YAAY,CAAC,EAAE,kCAAkC,CAAC;IAClD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,iBAAiB,GAAG,SAAS,CAAC;IACxE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,eAAe,GAAG,SAAS,CAAC;IACpE,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACnH;AAED,2HAA2H;AAC3H,eAAO,MAAM,2BAA2B,GAAI,MAAM,sBAAsB,KAAG,eAiBzE,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { injectEndpointsOnce, staticMutationHook, staticQueryHook, toQueryString, trimApiPrefix, } from "../logic/pure/injectedApi.js";
|
|
2
|
+
/** Cache tag types of the translation operations. */
|
|
3
|
+
export const APP_TRANSLATIONS_TAG = 'AdminUiAppTranslations';
|
|
4
|
+
export const LANGUAGES_TAG = 'AdminUiLanguages';
|
|
5
|
+
export const LOCALES_TAG = 'AdminUiLocales';
|
|
6
|
+
export const DEFAULT_TRANSLATIONS_API_PATHS = Object.freeze({
|
|
7
|
+
appTranslations: 'app-translations',
|
|
8
|
+
languages: 'languages',
|
|
9
|
+
locales: 'locales',
|
|
10
|
+
translations: 'translations',
|
|
11
|
+
});
|
|
12
|
+
const listQuery = ({ filters, orderBy, top, skip, select, expand }) => toQueryString({ filters, orderBy, top, skip, select, expand });
|
|
13
|
+
const trimSegment = (segment) => segment.replace(/^\/+|\/+$/g, '');
|
|
14
|
+
/** The request of every operation, on `apiPrefix` and the paths. Pure: no RTK runtime. */
|
|
15
|
+
export const buildTranslationsRequests = (apiPrefix, paths = {}) => {
|
|
16
|
+
const prefix = trimApiPrefix(apiPrefix);
|
|
17
|
+
const resolved = { ...DEFAULT_TRANSLATIONS_API_PATHS, ...paths };
|
|
18
|
+
const appTranslations = `${prefix}/${trimSegment(resolved.appTranslations)}`;
|
|
19
|
+
const languages = `${prefix}/${trimSegment(resolved.languages)}`;
|
|
20
|
+
const locales = `${prefix}/${trimSegment(resolved.locales)}`;
|
|
21
|
+
const translations = `${prefix}/${trimSegment(resolved.translations)}`;
|
|
22
|
+
const id = (value) => encodeURIComponent(String(value));
|
|
23
|
+
return {
|
|
24
|
+
appTranslationKeys: (arg) => ({ url: `${appTranslations}/keys/list${listQuery(arg)}` }),
|
|
25
|
+
appTranslationKey: ({ appTranslationKeyId, expand }) => ({
|
|
26
|
+
url: `${appTranslations}/keys/${id(appTranslationKeyId)}${toQueryString({ expand })}`,
|
|
27
|
+
}),
|
|
28
|
+
updateAppTranslationKey: (body) => ({ url: `${appTranslations}/keys`, method: 'PATCH', body }),
|
|
29
|
+
deleteAppTranslationKey: ({ appTranslationKeyId }) => ({
|
|
30
|
+
url: `${appTranslations}/keys/${id(appTranslationKeyId)}`,
|
|
31
|
+
method: 'DELETE',
|
|
32
|
+
}),
|
|
33
|
+
updateAppTranslationValue: (body) => ({
|
|
34
|
+
url: `${appTranslations}/values`,
|
|
35
|
+
method: 'PATCH',
|
|
36
|
+
body,
|
|
37
|
+
}),
|
|
38
|
+
deleteAppTranslationValue: ({ appTranslationValueId }) => ({
|
|
39
|
+
url: `${appTranslations}/values/${id(appTranslationValueId)}`,
|
|
40
|
+
method: 'DELETE',
|
|
41
|
+
}),
|
|
42
|
+
appTranslationCompleteness: () => ({ url: `${appTranslations}/keys/completeness` }),
|
|
43
|
+
generateAppTranslations: ({ localeId, writingStyle, previewOnly }) => ({
|
|
44
|
+
url: `${appTranslations}/keys/generate/${id(localeId)}${toQueryString({ writingStyle, previewOnly: previewOnly === undefined ? undefined : previewOnly ? 1 : 0 })}`,
|
|
45
|
+
}),
|
|
46
|
+
generateAllAppTranslations: () => ({ url: `${appTranslations}/keys/generate-all` }),
|
|
47
|
+
languages: (arg) => ({ url: `${languages}/list${listQuery(arg)}` }),
|
|
48
|
+
updateLanguage: (body) => ({ url: languages, method: 'PATCH', body }),
|
|
49
|
+
importLanguagesFromConfig: () => ({ url: `${languages}/importFromConfig` }),
|
|
50
|
+
locales: (arg) => ({ url: `${locales}/list${listQuery(arg)}` }),
|
|
51
|
+
updateLocale: (body) => ({ url: locales, method: 'PATCH', body }),
|
|
52
|
+
importLocalesFromConfig: () => ({ url: `${locales}/importFromConfig` }),
|
|
53
|
+
translateEntities: (body) => ({ url: `${translations}/translateEntities`, method: 'POST', body }),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The operations as injected (endpoint name → definition). Cache: each query provides its tag type; a key or value
|
|
58
|
+
* write invalidates every app translation query (list, key, completeness); a language write or import invalidates the
|
|
59
|
+
* languages; a locale write or import (the `isActive` toggle) the locales and the completeness (it counts active
|
|
60
|
+
* locales); a generation the app translations. The entity translation invalidates nothing.
|
|
61
|
+
*/
|
|
62
|
+
export const translationsEndpointDefinitions = (apiPrefix, paths) => {
|
|
63
|
+
const requests = buildTranslationsRequests(apiPrefix, paths);
|
|
64
|
+
const appTranslations = [APP_TRANSLATIONS_TAG];
|
|
65
|
+
return {
|
|
66
|
+
adminUiAppTranslationKeys: { kind: 'query', request: requests.appTranslationKeys, providesTags: appTranslations },
|
|
67
|
+
adminUiAppTranslationKey: { kind: 'query', request: requests.appTranslationKey, providesTags: appTranslations },
|
|
68
|
+
adminUiUpdateAppTranslationKey: { kind: 'mutation', request: requests.updateAppTranslationKey, invalidatesTags: appTranslations },
|
|
69
|
+
adminUiDeleteAppTranslationKey: { kind: 'mutation', request: requests.deleteAppTranslationKey, invalidatesTags: appTranslations },
|
|
70
|
+
adminUiUpdateAppTranslationValue: { kind: 'mutation', request: requests.updateAppTranslationValue, invalidatesTags: appTranslations },
|
|
71
|
+
adminUiDeleteAppTranslationValue: { kind: 'mutation', request: requests.deleteAppTranslationValue, invalidatesTags: appTranslations },
|
|
72
|
+
adminUiAppTranslationCompleteness: { kind: 'query', request: requests.appTranslationCompleteness, providesTags: appTranslations },
|
|
73
|
+
adminUiGenerateAppTranslations: { kind: 'mutation', request: requests.generateAppTranslations, invalidatesTags: appTranslations },
|
|
74
|
+
adminUiGenerateAllAppTranslations: { kind: 'mutation', request: requests.generateAllAppTranslations, invalidatesTags: appTranslations },
|
|
75
|
+
adminUiLanguages: { kind: 'query', request: requests.languages, providesTags: [LANGUAGES_TAG] },
|
|
76
|
+
adminUiUpdateLanguage: { kind: 'mutation', request: requests.updateLanguage, invalidatesTags: [LANGUAGES_TAG] },
|
|
77
|
+
adminUiImportLanguagesFromConfig: { kind: 'mutation', request: requests.importLanguagesFromConfig, invalidatesTags: [LANGUAGES_TAG] },
|
|
78
|
+
adminUiLocales: { kind: 'query', request: requests.locales, providesTags: [LOCALES_TAG] },
|
|
79
|
+
adminUiUpdateLocale: { kind: 'mutation', request: requests.updateLocale, invalidatesTags: [LOCALES_TAG, APP_TRANSLATIONS_TAG] },
|
|
80
|
+
adminUiImportLocalesFromConfig: { kind: 'mutation', request: requests.importLocalesFromConfig, invalidatesTags: [LOCALES_TAG, APP_TRANSLATIONS_TAG] },
|
|
81
|
+
adminUiTranslateEntities: { kind: 'mutation', request: requests.translateEntities, invalidatesTags: [] },
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Injects the translation operations into the host's RTK Query api and returns their hooks. Call it once at module
|
|
86
|
+
* scope; a second call with the same api, prefix and paths returns the first result.
|
|
87
|
+
*
|
|
88
|
+
* ```ts
|
|
89
|
+
* export const translationsApi = createTranslationsApi({ baseApi: adminApi, apiPrefix: '/api/admin/common' });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export const createTranslationsApi = ({ baseApi, apiPrefix, paths }) => {
|
|
93
|
+
const memoKey = `translations:${trimApiPrefix(apiPrefix)}:${JSON.stringify({ ...DEFAULT_TRANSLATIONS_API_PATHS, ...paths })}`;
|
|
94
|
+
return injectEndpointsOnce(baseApi, memoKey, [APP_TRANSLATIONS_TAG, LANGUAGES_TAG, LOCALES_TAG], translationsEndpointDefinitions(apiPrefix, paths), hookOf => ({
|
|
95
|
+
useAppTranslationKeysQuery: hookOf('adminUiAppTranslationKeys'),
|
|
96
|
+
useAppTranslationKeyQuery: hookOf('adminUiAppTranslationKey'),
|
|
97
|
+
useUpdateAppTranslationKeyMutation: hookOf('adminUiUpdateAppTranslationKey'),
|
|
98
|
+
useDeleteAppTranslationKeyMutation: hookOf('adminUiDeleteAppTranslationKey'),
|
|
99
|
+
useUpdateAppTranslationValueMutation: hookOf('adminUiUpdateAppTranslationValue'),
|
|
100
|
+
useDeleteAppTranslationValueMutation: hookOf('adminUiDeleteAppTranslationValue'),
|
|
101
|
+
useAppTranslationCompletenessQuery: hookOf('adminUiAppTranslationCompleteness'),
|
|
102
|
+
useGenerateAppTranslationsMutation: hookOf('adminUiGenerateAppTranslations'),
|
|
103
|
+
useGenerateAllAppTranslationsMutation: hookOf('adminUiGenerateAllAppTranslations'),
|
|
104
|
+
useLanguagesQuery: hookOf('adminUiLanguages'),
|
|
105
|
+
useUpdateLanguageMutation: hookOf('adminUiUpdateLanguage'),
|
|
106
|
+
useImportLanguagesFromConfigMutation: hookOf('adminUiImportLanguagesFromConfig'),
|
|
107
|
+
useLocalesQuery: hookOf('adminUiLocales'),
|
|
108
|
+
useUpdateLocaleMutation: hookOf('adminUiUpdateLocale'),
|
|
109
|
+
useImportLocalesFromConfigMutation: hookOf('adminUiImportLocalesFromConfig'),
|
|
110
|
+
useTranslateEntitiesMutation: hookOf('adminUiTranslateEntities'),
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
/** A `TranslationsApi` answering fixed payloads, without a store or a request: for showcases, tests and design reviews. */
|
|
114
|
+
export const createStaticTranslationsApi = (data) => ({
|
|
115
|
+
useAppTranslationKeysQuery: staticQueryHook(arg => data.appTranslationKeys?.(arg)),
|
|
116
|
+
useAppTranslationKeyQuery: staticQueryHook(arg => data.appTranslationKey?.(arg)),
|
|
117
|
+
useUpdateAppTranslationKeyMutation: staticMutationHook(({ appTranslationKey }) => ({ appTranslationKey: { id: appTranslationKey.id ?? 1, ...appTranslationKey } })),
|
|
118
|
+
useDeleteAppTranslationKeyMutation: staticMutationHook(() => ({})),
|
|
119
|
+
useUpdateAppTranslationValueMutation: staticMutationHook(({ appTranslationValue }) => ({ appTranslationValue })),
|
|
120
|
+
useDeleteAppTranslationValueMutation: staticMutationHook(() => ({})),
|
|
121
|
+
useAppTranslationCompletenessQuery: staticQueryHook(() => data.completeness),
|
|
122
|
+
useGenerateAppTranslationsMutation: staticMutationHook(({ writingStyle }) => ({ appTranslationsResult: { writingStyle, translatedKeysCount: 0 } })),
|
|
123
|
+
useGenerateAllAppTranslationsMutation: staticMutationHook(() => ({ appTranslationsResults: { elements: [] } })),
|
|
124
|
+
useLanguagesQuery: staticQueryHook(arg => data.languages?.(arg)),
|
|
125
|
+
useUpdateLanguageMutation: staticMutationHook(({ language }) => ({ language })),
|
|
126
|
+
useImportLanguagesFromConfigMutation: staticMutationHook(() => data.languages?.({}) ?? { languages: { elements: [] } }),
|
|
127
|
+
useLocalesQuery: staticQueryHook(arg => data.locales?.(arg)),
|
|
128
|
+
useUpdateLocaleMutation: staticMutationHook(({ locale }) => ({ locale })),
|
|
129
|
+
useImportLocalesFromConfigMutation: staticMutationHook(() => data.locales?.({}) ?? { locales: { elements: [] } }),
|
|
130
|
+
useTranslateEntitiesMutation: staticMutationHook(arg => (data.translateEntities ? data.translateEntities(arg) : { translatedEntities: { elements: [] } })),
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/translations/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,mBA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,yBAAyB,EAAE,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/E,oCAAoC,EAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACvH,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5D,uBAAuB,EAAE,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACzE,kCAAkC,EAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACjH,4BAA4B,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC3J,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* After a refused submit: opens the first translatable text over its limit inside `container` (the form or the
|
|
3
|
+
* dialog that was submitted, so a second form on the page is never touched) and focuses its editor. Returns whether
|
|
4
|
+
* one was found. The tab switch is form-wide, so the focus follows on the next frame, once the editor shows that text.
|
|
5
|
+
*/
|
|
6
|
+
export declare const focusFirstOverLimitTranslation: (container: ParentNode | null | undefined) => boolean;
|
|
7
|
+
//# sourceMappingURL=focusOverLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusOverLimit.d.ts","sourceRoot":"","sources":["../../src/translations/focusOverLimit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAI,WAAW,UAAU,GAAG,IAAI,GAAG,SAAS,KAAG,OAczF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* After a refused submit: opens the first translatable text over its limit inside `container` (the form or the
|
|
3
|
+
* dialog that was submitted, so a second form on the page is never touched) and focuses its editor. Returns whether
|
|
4
|
+
* one was found. The tab switch is form-wide, so the focus follows on the next frame, once the editor shows that text.
|
|
5
|
+
*/
|
|
6
|
+
export const focusFirstOverLimitTranslation = (container) => {
|
|
7
|
+
const tab = container?.querySelector('[data-translatable-field] [role="tab"][data-over-limit]');
|
|
8
|
+
if (!tab)
|
|
9
|
+
return false;
|
|
10
|
+
const field = tab.closest('[data-translatable-field]');
|
|
11
|
+
if (tab.getAttribute('aria-selected') !== 'true')
|
|
12
|
+
tab.click();
|
|
13
|
+
const focusEditor = () => {
|
|
14
|
+
const editor = field?.querySelector('textarea, input:not([type="hidden"]):not([type="checkbox"]), [contenteditable="true"]');
|
|
15
|
+
editor?.focus();
|
|
16
|
+
};
|
|
17
|
+
if (typeof requestAnimationFrame === 'function')
|
|
18
|
+
requestAnimationFrame(focusEditor);
|
|
19
|
+
else
|
|
20
|
+
focusEditor();
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=focusOverLimit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusOverLimit.js","sourceRoot":"","sources":["../../src/translations/focusOverLimit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAwC,EAAW,EAAE;IAClG,MAAM,GAAG,GAAG,SAAS,EAAE,aAAa,CAAc,yDAAyD,CAAC,CAAC;IAC7G,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAc,2BAA2B,CAAC,CAAC;IACpE,IAAI,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;QAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,MAAM,MAAM,GAAG,KAAK,EAAE,aAAa,CACjC,uFAAuF,CACxF,CAAC;QACF,MAAM,EAAE,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC;IACF,IAAI,OAAO,qBAAqB,KAAK,UAAU;QAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;;QAC/E,WAAW,EAAE,CAAC;IACnB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -28,4 +28,26 @@ export type { TranslationTabs, UseEntityTranslationsOptions, UseEntityTranslatio
|
|
|
28
28
|
export { useTranslationRunner } from '../logic/react/useTranslationRunner.js';
|
|
29
29
|
/** @deprecated moved to logic/react/useTranslationRunner — the re-export is removed in a later minor */
|
|
30
30
|
export type { TranslationRunner, TranslationRunResult, TranslationTaskProgress, TranslationTaskStatus, } from '../logic/react/useTranslationRunner.js';
|
|
31
|
+
export { focusFirstOverLimitTranslation } from './focusOverLimit.js';
|
|
32
|
+
export { APP_TRANSLATIONS_TAG, buildTranslationsRequests, createStaticTranslationsApi, createTranslationsApi, DEFAULT_TRANSLATIONS_API_PATHS, LANGUAGES_TAG, LOCALES_TAG, translationsEndpointDefinitions, } from './api.js';
|
|
33
|
+
export type { CreateTranslationsApiOptions, StaticTranslationsData, TranslationsApi, TranslationsApiPaths } from './api.js';
|
|
34
|
+
export type * from './adminTypes.js';
|
|
35
|
+
export { APP_TRANSLATION_CONTEXT_OPTIONS, APP_TRANSLATION_WRITING_STYLE_OPTIONS, appTranslationValueLocaleKey, completenessPercent, LANGUAGE_WRITING_STYLES_OPTIONS, sortAppTranslationValues, TEXT_DIRECTION_OPTIONS, toLanguageCodeMap, } from './adminFormat.js';
|
|
36
|
+
export type { LanguageCodeMap } from './adminFormat.js';
|
|
37
|
+
export { AppTranslationsScreen } from './AppTranslationsScreen.js';
|
|
38
|
+
export type { AppTranslationsScreenProps } from './AppTranslationsScreen.js';
|
|
39
|
+
export { AppTranslationKeyDrawer } from './AppTranslationKeyDrawer.js';
|
|
40
|
+
export type { AppTranslationKeyDrawerProps } from './AppTranslationKeyDrawer.js';
|
|
41
|
+
export { TranslationCompleteness } from './TranslationCompleteness.js';
|
|
42
|
+
export type { TranslationCompletenessProps } from './TranslationCompleteness.js';
|
|
43
|
+
export { LanguagesScreen } from './LanguagesScreen.js';
|
|
44
|
+
export type { LanguagesScreenProps } from './LanguagesScreen.js';
|
|
45
|
+
export { LocalesScreen } from './LocalesScreen.js';
|
|
46
|
+
export type { LocaleFlag, LocalesScreenProps } from './LocalesScreen.js';
|
|
47
|
+
export { ConfigImportCard, useConfigImport } from './ConfigImportCards.js';
|
|
48
|
+
export type { ConfigImport, ConfigImportCardProps, ConfigImportKind } from './ConfigImportCards.js';
|
|
49
|
+
export { LOCALE_OBJECT_TYPE, useEntityTranslator } from './useEntityTranslator.js';
|
|
50
|
+
export type { EntityTranslationRequest, EntityTranslator, UseEntityTranslatorOptions } from './useEntityTranslator.js';
|
|
51
|
+
export { toContentLocaleKeys, useContentLocales } from './useContentLocales.js';
|
|
52
|
+
export type { UseContentLocalesOptions } from './useContentLocales.js';
|
|
31
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC/F,YAAY,EAAE,0BAA0B,EAAE,6B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uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACnF,YAAY,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -15,4 +15,17 @@ export { blankTranslations, buildTranslationInfos, hydrateTranslations, mergeTra
|
|
|
15
15
|
export { useEntityTranslations } from "../logic/react/useEntityTranslations.js";
|
|
16
16
|
/** @deprecated moved to logic/react/useTranslationRunner — the re-export is removed in a later minor */
|
|
17
17
|
export { useTranslationRunner } from "../logic/react/useTranslationRunner.js";
|
|
18
|
+
export { focusFirstOverLimitTranslation } from "./focusOverLimit.js";
|
|
19
|
+
// Admin screens on the host's RTK Query api (`createTranslationsApi`): app translation keys with their drawer and
|
|
20
|
+
// completeness, languages, locales, the import from configuration, the entity translator and the content locales.
|
|
21
|
+
export { APP_TRANSLATIONS_TAG, buildTranslationsRequests, createStaticTranslationsApi, createTranslationsApi, DEFAULT_TRANSLATIONS_API_PATHS, LANGUAGES_TAG, LOCALES_TAG, translationsEndpointDefinitions, } from "./api.js";
|
|
22
|
+
export { APP_TRANSLATION_CONTEXT_OPTIONS, APP_TRANSLATION_WRITING_STYLE_OPTIONS, appTranslationValueLocaleKey, completenessPercent, LANGUAGE_WRITING_STYLES_OPTIONS, sortAppTranslationValues, TEXT_DIRECTION_OPTIONS, toLanguageCodeMap, } from "./adminFormat.js";
|
|
23
|
+
export { AppTranslationsScreen } from "./AppTranslationsScreen.js";
|
|
24
|
+
export { AppTranslationKeyDrawer } from "./AppTranslationKeyDrawer.js";
|
|
25
|
+
export { TranslationCompleteness } from "./TranslationCompleteness.js";
|
|
26
|
+
export { LanguagesScreen } from "./LanguagesScreen.js";
|
|
27
|
+
export { LocalesScreen } from "./LocalesScreen.js";
|
|
28
|
+
export { ConfigImportCard, useConfigImport } from "./ConfigImportCards.js";
|
|
29
|
+
export { LOCALE_OBJECT_TYPE, useEntityTranslator } from "./useEntityTranslator.js";
|
|
30
|
+
export { toContentLocaleKeys, useContentLocales } from "./useContentLocales.js";
|
|
18
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,6BAA8B,CAAC;AAE/F,0FAA0F;AAC1F,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACpG,iGAAiG;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA4B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAEhE,mGAAmG;AACnG,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAC;AAG3C,yGAAy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EAC/B,qCAAqC,EACrC,4BAA4B,EAC5B,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA6B,CAAC;AAEpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA+B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA+B,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAyB,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AdminLocale } from './adminTypes.js';
|
|
2
|
+
import type { TranslationsApi } from './api.js';
|
|
3
|
+
/** The content locale keys of active locales: one `<languageCode>::<style>` per language, in the order given. */
|
|
4
|
+
export declare const toContentLocaleKeys: (locales: readonly AdminLocale[], writingStyle: "FORMAL" | "INFORMAL") => string[];
|
|
5
|
+
export interface UseContentLocalesOptions {
|
|
6
|
+
/** Used while the list loads, when it fails or when no locale is active (e.g. `['en::FORMAL', 'de::FORMAL']`). */
|
|
7
|
+
fallback?: readonly string[];
|
|
8
|
+
/** The writing style of the keys (default `FORMAL`). */
|
|
9
|
+
writingStyle?: 'FORMAL' | 'INFORMAL';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The content locales an entity form offers, as full keys (`de::FORMAL`), loaded from the active locales
|
|
13
|
+
* (`GET …/locales/list`). Stored keys beyond these (`de::INFORMAL`) are added by `useEntityTranslations` from the
|
|
14
|
+
* loaded entity.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useContentLocales: (api: TranslationsApi, { fallback, writingStyle }?: UseContentLocalesOptions) => readonly string[];
|
|
17
|
+
//# sourceMappingURL=useContentLocales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContentLocales.d.ts","sourceRoot":"","sources":["../../src/translations/useContentLocales.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,iHAAiH;AACjH,eAAO,MAAM,mBAAmB,GAAI,SAAS,SAAS,WAAW,EAAE,EAAE,cAAc,QAAQ,GAAG,UAAU,KAAG,MAAM,EAOhH,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,kHAAkH;IAClH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,wDAAwD;IACxD,YAAY,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACtC;AAID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,eAAe,EAAE,6BAAoD,wBAA6B,KAAG,SAAS,MAAM,EAO1J,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { buildFieldFilter } from '@mgamadeus/ddd-web/query';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
const ACTIVE_LOCALES_ARG = {
|
|
5
|
+
select: 'id,languageCode,countryShortCode,isActive',
|
|
6
|
+
filters: buildFieldFilter('isActive', '1'),
|
|
7
|
+
top: 500,
|
|
8
|
+
};
|
|
9
|
+
/** The content locale keys of active locales: one `<languageCode>::<style>` per language, in the order given. */
|
|
10
|
+
export const toContentLocaleKeys = (locales, writingStyle) => {
|
|
11
|
+
const keys = [];
|
|
12
|
+
for (const locale of locales) {
|
|
13
|
+
const key = locale.languageCode ? `${locale.languageCode}::${writingStyle}` : null;
|
|
14
|
+
if (key && !keys.includes(key))
|
|
15
|
+
keys.push(key);
|
|
16
|
+
}
|
|
17
|
+
return keys;
|
|
18
|
+
};
|
|
19
|
+
const NO_LOCALES = [];
|
|
20
|
+
/**
|
|
21
|
+
* The content locales an entity form offers, as full keys (`de::FORMAL`), loaded from the active locales
|
|
22
|
+
* (`GET …/locales/list`). Stored keys beyond these (`de::INFORMAL`) are added by `useEntityTranslations` from the
|
|
23
|
+
* loaded entity.
|
|
24
|
+
*/
|
|
25
|
+
export const useContentLocales = (api, { fallback = NO_LOCALES, writingStyle = 'FORMAL' } = {}) => {
|
|
26
|
+
const { data } = api.useLocalesQuery(ACTIVE_LOCALES_ARG);
|
|
27
|
+
const elements = data?.locales.elements;
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
const keys = toContentLocaleKeys(elements ?? [], writingStyle);
|
|
30
|
+
return keys.length > 0 ? keys : fallback;
|
|
31
|
+
}, [elements, writingStyle, fallback]);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=useContentLocales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContentLocales.js","sourceRoot":"","sources":["../../src/translations/useContentLocales.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,MAAM,kBAAkB,GAAwB;IAC9C,MAAM,EAAE,2CAA2C;IACnD,OAAO,EAAE,gBAAgB,CAAC,UAAU,EAAE,GAAG,CAAC;IAC1C,GAAG,EAAE,GAAG;CACT,CAAC;AAEF,iHAAiH;AACjH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAA+B,EAAE,YAAmC,EAAY,EAAE;IACpH,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,YAAY,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnF,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AASF,MAAM,UAAU,GAAsB,EAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAoB,EAAE,EAAE,QAAQ,GAAG,UAAU,EAAE,YAAY,GAAG,QAAQ,KAA+B,EAAE,EAAqB,EAAE;IAC9J,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;IACxC,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,IAAI,GAAG,mBAAmB,CAAC,QAAQ,IAAI,EAAE,EAAE,YAAY,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3C,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type TranslationsStore } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
import type { TranslatableEntityPayload } from './adminTypes.js';
|
|
3
|
+
import type { TranslationsApi } from './api.js';
|
|
4
|
+
/** The PHP class of a locale in a request body. */
|
|
5
|
+
export declare const LOCALE_OBJECT_TYPE = "DDD\\Domain\\Common\\Entities\\Locales\\Locale";
|
|
6
|
+
export interface EntityTranslationRequest {
|
|
7
|
+
/** The draft entity as the forms send it: `objectType`, `id`, plain values and `translationInfos`. */
|
|
8
|
+
entity: TranslatableEntityPayload;
|
|
9
|
+
/** Target locale as a full key (`de::FORMAL`). */
|
|
10
|
+
locale: string;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
/** Translates a draft into one locale and answers the translated entity's translations store. */
|
|
14
|
+
export type EntityTranslator = (request: EntityTranslationRequest) => Promise<TranslationsStore>;
|
|
15
|
+
export interface UseEntityTranslatorOptions {
|
|
16
|
+
/** The content's default locale (`en::FORMAL`): its language is marked as the default of the target locale. */
|
|
17
|
+
defaultLocale?: string;
|
|
18
|
+
/** `false` switches the AI translation off (the hook answers `undefined`, the controls hide). */
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The AI translation of an entity draft (`POST …/translateEntities`), one request per target locale: feed it to
|
|
23
|
+
* `useTranslationRunner` (`./logic`), which runs the locales a few at a time and lets each finish on its own — a long
|
|
24
|
+
* entity in many locales in one request runs into gateway timeouts. Aborting the runner aborts the requests in flight.
|
|
25
|
+
* Answers `undefined` while `enabled` is false.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const translator = useEntityTranslator(translationsApi);
|
|
29
|
+
* const runner = useTranslationRunner();
|
|
30
|
+
* runner.run(targets, async (locale, signal) => applyStore(await translator!({ entity: draft, locale, signal })));
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const useEntityTranslator: (api: TranslationsApi, { defaultLocale, enabled }?: UseEntityTranslatorOptions) => EntityTranslator | undefined;
|
|
34
|
+
//# sourceMappingURL=useEntityTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityTranslator.d.ts","sourceRoot":"","sources":["../../src/translations/useEntityTranslator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmD,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAItH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,mDAAmD;AACnD,eAAO,MAAM,kBAAkB,mDAAmD,CAAC;AAEnF,MAAM,WAAW,wBAAwB;IACvC,sGAAsG;IACtG,MAAM,EAAE,yBAAyB,CAAC;IAClC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,iGAAiG;AACjG,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,wBAAwB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEjG,MAAM,WAAW,0BAA0B;IACzC,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iGAAiG;IACjG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,eAAe,EAAE,6BAAkD,0BAA+B,KAAG,gBAAgB,GAAG,SA8BhK,CAAC"}
|