@mgamadeus/ddd-admin-ui 0.1.0 → 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 +217 -0
- package/README.md +262 -23
- package/STANDARDS.md +171 -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/FormDrawer.d.ts +11 -1
- package/dist/form/FormDrawer.d.ts.map +1 -1
- package/dist/form/FormDrawer.js +7 -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/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/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/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,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,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,8BAA8B,CAAC;AAwBtC,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAkD5C,MAAM,CAAC,MAAM,8BAA8B,GAAmC,MAAM,CAAC,MAAM,CAAC;IAC1F,eAAe,EAAE,kBAAkB;IACnC,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CAC7B,CAAC,CAAC;AAWH,MAAM,SAAS,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAuB,EAAU,EAAE,CACjG,aAAa,CAAC,EAAE,OAAO,EAA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,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,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC9G,0FAA0F;AAC1F,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACpG,iGAAiG;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,0FAA0F;AAC1F,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B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Infos, 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,0FAA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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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { normalizeTranslationsStore, parseTranslationKey } from '@mgamadeus/ddd-web/contract';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useTranslate } from "../i18n/useTranslate.js";
|
|
5
|
+
/** The PHP class of a locale in a request body. */
|
|
6
|
+
export const LOCALE_OBJECT_TYPE = 'DDD\\Domain\\Common\\Entities\\Locales\\Locale';
|
|
7
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
|
+
/**
|
|
9
|
+
* The AI translation of an entity draft (`POST …/translateEntities`), one request per target locale: feed it to
|
|
10
|
+
* `useTranslationRunner` (`./logic`), which runs the locales a few at a time and lets each finish on its own — a long
|
|
11
|
+
* entity in many locales in one request runs into gateway timeouts. Aborting the runner aborts the requests in flight.
|
|
12
|
+
* Answers `undefined` while `enabled` is false.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* const translator = useEntityTranslator(translationsApi);
|
|
16
|
+
* const runner = useTranslationRunner();
|
|
17
|
+
* runner.run(targets, async (locale, signal) => applyStore(await translator!({ entity: draft, locale, signal })));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const useEntityTranslator = (api, { defaultLocale = 'en::FORMAL', enabled = true } = {}) => {
|
|
21
|
+
const { t } = useTranslate();
|
|
22
|
+
const [translateEntities] = api.useTranslateEntitiesMutation();
|
|
23
|
+
const defaultLanguage = parseTranslationKey(defaultLocale)?.languageCode ?? 'en';
|
|
24
|
+
const translator = useCallback(async ({ entity, locale, signal }) => {
|
|
25
|
+
const languageCode = parseTranslationKey(locale)?.languageCode ?? locale;
|
|
26
|
+
const request = translateEntities({
|
|
27
|
+
entitiesToTranslate: { elements: [entity] },
|
|
28
|
+
localesToTranslate: {
|
|
29
|
+
elements: [{ objectType: LOCALE_OBJECT_TYPE, languageCode, countryShortCode: null, isDefaultLocaleForLanguage: languageCode === defaultLanguage }],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
if (signal.aborted)
|
|
33
|
+
request.abort();
|
|
34
|
+
const abort = () => request.abort();
|
|
35
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
36
|
+
try {
|
|
37
|
+
const translated = (await request.unwrap()).translatedEntities?.elements?.[0];
|
|
38
|
+
if (!translated)
|
|
39
|
+
throw new Error(t('No translation returned for %locale%', { replacements: { locale } }));
|
|
40
|
+
const infos = translated.translationInfos;
|
|
41
|
+
return isRecord(infos) ? normalizeTranslationsStore(infos.translationsStore) : {};
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
signal.removeEventListener('abort', abort);
|
|
45
|
+
}
|
|
46
|
+
}, [translateEntities, defaultLanguage, t]);
|
|
47
|
+
return enabled ? translator : undefined;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=useEntityTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityTranslator.js","sourceRoot":"","sources":["../../src/translations/useEntityTranslator.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAA0B,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gDAAgD,CAAC;AAoBnF,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAE5I;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GA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AE,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1G,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC;YAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpF,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EACD,CAAC,iBAAiB,EAAE,eAAe,EAAE,CAAC,CAAC,CACxC,CAAC;IAEF,OAAO,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WorkersApi } from './api.js';
|
|
2
|
+
export interface WorkerRestartButtonProps {
|
|
3
|
+
api: WorkersApi;
|
|
4
|
+
/** One transport; without it every live worker process is asked. */
|
|
5
|
+
transport?: string;
|
|
6
|
+
/** Live processes now (the confirmation names the count). */
|
|
7
|
+
liveProcessCount?: number;
|
|
8
|
+
/** `icon` for a table row, `button` for a page header. */
|
|
9
|
+
variant?: 'button' | 'icon';
|
|
10
|
+
/** The monitoring is off: the backend refuses a restart (400), the button says why. */
|
|
11
|
+
monitoringEnabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The only action of the workers screens (no scaling controls): a restart request. Each live process stops after its
|
|
15
|
+
* current message and whatever runs the workers starts it again; a process inside a long job finishes that job first.
|
|
16
|
+
* Confirmation first, then the asked processes. Disabled while `WriteAccessProvider` says no, or the monitoring is off.
|
|
17
|
+
*/
|
|
18
|
+
export declare const WorkerRestartButton: ({ api, transport, liveProcessCount, variant, monitoringEnabled }: WorkerRestartButtonProps) => import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=WorkerRestartButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerRestartButton.d.ts","sourceRoot":"","sources":["../../src/workers/WorkerRestartButton.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,UAAU,CAAC;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,uFAAuF;IACvF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,kEAAoF,wBAAwB,gCAqI/I,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { normalizeDddError } from '@mgamadeus/ddd-web/contract';
|
|
4
|
+
import { RotateCcw } from 'lucide-react';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { useTranslate } from "../i18n/useTranslate.js";
|
|
7
|
+
import { notify } from "../logic/pure/notify.js";
|
|
8
|
+
import { useWriteAccess } from "../logic/react/writeAccess.js";
|
|
9
|
+
import { StatusCallout } from "../page/StatusCallout.js";
|
|
10
|
+
import { Button } from "../primitives/button.js";
|
|
11
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../primitives/dialog.js";
|
|
12
|
+
import { shortClassName, shortHost } from "./format.js";
|
|
13
|
+
const processCount = (t, count) => t('{count, plural, one {# process} other {# processes}}', { count });
|
|
14
|
+
/**
|
|
15
|
+
* The only action of the workers screens (no scaling controls): a restart request. Each live process stops after its
|
|
16
|
+
* current message and whatever runs the workers starts it again; a process inside a long job finishes that job first.
|
|
17
|
+
* Confirmation first, then the asked processes. Disabled while `WriteAccessProvider` says no, or the monitoring is off.
|
|
18
|
+
*/
|
|
19
|
+
export const WorkerRestartButton = ({ api, transport, liveProcessCount, variant = 'button', monitoringEnabled = true }) => {
|
|
20
|
+
const { t } = useTranslate();
|
|
21
|
+
const writeAccess = useWriteAccess();
|
|
22
|
+
const [restart, restartState] = api.useRestartMutation();
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
const [result, setResult] = useState(null);
|
|
25
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
26
|
+
const label = transport ? t('Restart workers of %transport%', { replacements: { transport } }) : t('Restart all workers');
|
|
27
|
+
const disabledReason = !writeAccess.allowed
|
|
28
|
+
? (writeAccess.reason ?? t('Writes are switched off'))
|
|
29
|
+
: !monitoringEnabled
|
|
30
|
+
? t('The worker monitoring is off: the live processes are not known, so none can be asked.')
|
|
31
|
+
: undefined;
|
|
32
|
+
const openDialog = () => {
|
|
33
|
+
setResult(null);
|
|
34
|
+
setErrorMessage(null);
|
|
35
|
+
setOpen(true);
|
|
36
|
+
};
|
|
37
|
+
const submit = async () => {
|
|
38
|
+
if (!writeAccess.allowed)
|
|
39
|
+
return;
|
|
40
|
+
setErrorMessage(null);
|
|
41
|
+
try {
|
|
42
|
+
const response = await restart(transport ? { transport } : {}).unwrap();
|
|
43
|
+
const restartResult = { requestedProcessCount: response.requestedProcessCount, processes: response.workerProcesses.elements ?? [] };
|
|
44
|
+
setResult(restartResult);
|
|
45
|
+
notify.success(t('Restart requested for %processes%', { replacements: { processes: processCount(t, restartResult.requestedProcessCount) } }));
|
|
46
|
+
}
|
|
47
|
+
catch (restartError) {
|
|
48
|
+
setErrorMessage(normalizeDddError(restartError, t('The restart could not be requested.')).message);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs("span", { className: "contents", onClick: event => event.stopPropagation(), children: [_jsx("span", { className: "inline-flex", title: disabledReason ?? label, "data-row-action-ignore": true, children: variant === 'icon' ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": label, disabled: Boolean(disabledReason), onClick: openDialog, children: _jsx(RotateCcw, {}) })) : (_jsxs(Button, { type: "button", variant: "outline", disabled: Boolean(disabledReason), onClick: openDialog, children: [_jsx(RotateCcw, { "aria-hidden": true }), transport ? t('Restart workers') : t('Restart all workers')] })) }), _jsx(Dialog, { open: open, onOpenChange: setOpen, children: _jsx(DialogContent, { className: "sm:max-w-lg", children: result ? (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: result.requestedProcessCount === 0
|
|
52
|
+
? t('No live process to ask')
|
|
53
|
+
: t('Asked %processes% to restart', { replacements: { processes: processCount(t, result.requestedProcessCount) } }) }), _jsx(DialogDescription, { children: result.requestedProcessCount === 0
|
|
54
|
+
? t('No worker process is running right now: nothing to restart.')
|
|
55
|
+
: t('Each one stops after its current message and is started again. Its stop shows as “Restart requested” under Processes.') })] }), result.processes.length > 0 && (_jsx("ul", { className: "max-h-64 divide-y overflow-y-auto rounded-xl bg-tint", children: result.processes.map(process => (_jsxs("li", { className: "space-y-0.5 px-3 py-2", title: process.processKey ?? undefined, children: [_jsx("p", { className: "truncate font-mono text-xs", children: t('%host% · pid %pid%', { replacements: { host: shortHost(process.hostName), pid: process.processId ?? '—' } }) }), _jsxs("p", { className: "truncate text-xs text-muted-foreground", children: [process.transport, ' · ', process.currentMessageClass
|
|
56
|
+
? t('finishing %messageClass% first', { replacements: { messageClass: shortClassName(process.currentMessageClass) } })
|
|
57
|
+
: t('idle, stops at its next tick')] })] }, process.processKey ?? String(process.id)))) })), _jsx(DialogFooter, { children: _jsx(Button, { type: "button", onClick: () => setOpen(false), children: t('Done', { context: 'dialog-action' }) }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: transport ? t('Restart the workers of %transport%?', { replacements: { transport } }) : t('Restart all workers?') }), _jsx(DialogDescription, { children: t('Every live process stops after its current message and is started again with the current code and settings. A process inside a long job finishes that job first; nothing is scaled and no message is lost.') })] }), liveProcessCount !== undefined && (_jsxs("p", { className: "text-sm", children: [_jsx("span", { className: "font-semibold tabular-nums", children: processCount(t, liveProcessCount) }), ' ', _jsx("span", { className: "text-muted-foreground", children: t('live right now.') })] })), errorMessage && _jsx(StatusCallout, { tone: "destructive", size: "compact", title: errorMessage }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => setOpen(false), children: t('Cancel', { context: 'dialog-action' }) }), _jsxs(Button, { type: "button", disabled: !writeAccess.allowed || restartState.isLoading, title: writeAccess.allowed ? undefined : writeAccess.reason, onClick: () => void submit(), children: [_jsx(RotateCcw, { "aria-hidden": true }), restartState.isLoading ? t('Requesting…') : t('Request restart')] })] })] })) }) })] }));
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=WorkerRestartButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerRestartButton.js","sourceRoot":"","sources":["../../src/workers/WorkerRestartButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAA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G,EAC3F,eAAM,SAAS,EAAC,uBAAuB,YAAE,CAAC,CAAC,iBAAiB,CAAC,GAAQ,IACnE,CACL,EACA,YAAY,IAAI,KAAC,aAAa,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,YAAY,GAAI,EACzF,MAAC,YAAY,eACX,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAClE,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,GACnC,EACT,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,WAAW,CAAC,OAAO,IAAI,YAAY,CAAC,SAAS,EACxD,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,aAE5B,KAAC,SAAS,0BAAe,EACxB,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAC1D,IACI,IACd,CACJ,GACa,GACT,IACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { UrlStateAdapter } from '../logic/pure/urlListState.js';
|
|
2
|
+
import type { WorkersApi } from './api.js';
|
|
3
|
+
import { type WorkerTransportTab } from './overview.js';
|
|
4
|
+
export interface WorkerTransportScreenProps {
|
|
5
|
+
api: WorkersApi;
|
|
6
|
+
/** The Messenger transport name (the host's route parameter, decoded). */
|
|
7
|
+
transport: string;
|
|
8
|
+
/** The workers overview (the back link). */
|
|
9
|
+
backHref: string;
|
|
10
|
+
/** Where window, tab and filters live (`window`, `tab`, `outcome`, `process`); without one they live in component state. */
|
|
11
|
+
urlStateAdapter?: UrlStateAdapter;
|
|
12
|
+
/** The first tab without an adapter (`processes` for a link from the live panel). */
|
|
13
|
+
initialTab?: WorkerTransportTab;
|
|
14
|
+
/** Live data refresh in ms while the tab is visible (default 15 s; 0 = off). */
|
|
15
|
+
pollingIntervalMs?: number;
|
|
16
|
+
/** Pins the end of the chart window (a showcase, a test). */
|
|
17
|
+
historyAnchorMs?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One transport: state and worker list entry, the restart request, and three tabs — Overview (facts, charts over a
|
|
21
|
+
* window, message classes, live processes), Message runs and Processes. With a URL adapter every view is a link.
|
|
22
|
+
*/
|
|
23
|
+
export declare const WorkerTransportScreen: ({ api, transport, backHref, urlStateAdapter, initialTab, pollingIntervalMs, historyAnchorMs, }: WorkerTransportScreenProps) => import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=WorkerTransportScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerTransportScreen.d.ts","sourceRoot":"","sources":["../../src/workers/WorkerTransportScreen.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AAoH7E,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,4HAA4H;IAC5H,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,qFAAqF;IACrF,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,gGAQnC,0BAA0B,gCAkG5B,CAAC"}
|