@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
package/README.md
CHANGED
|
@@ -21,19 +21,25 @@ pnpm add @mgamadeus/ddd-web radix-ui react react-dom lucide-react react-hook-for
|
|
|
21
21
|
|
|
22
22
|
| Entry | What it holds | May import (besides React and its peers) |
|
|
23
23
|
|---|---|---|
|
|
24
|
-
| `./logic` | pure helpers (`formatDate`, `defineStatusMap`, conditions, schemas, `notify`, `runSequential`), React hooks without markup (`useUrlListState`, `useEntityDrawer`, `useRowSelection`, `useEntityTranslations`, …), browser helpers (`prepareImageFile`, `readStored` / `writeStored`, `buildStorageKey`), date input values (`toDateInputValue`, `fromDateTimeInputValue`, …), `withStickyParams`, `useLatestSearch`, `useConfirm` (the provider's confirmation), `WriteAccessProvider` / `useWriteAccess` | `./i18n` |
|
|
24
|
+
| `./logic` | pure helpers (`formatDate`, `defineStatusMap`, conditions, schemas, `notify`, `runSequential`, the navigation model with `resolveCrumbs`, `resolveDocumentTitle`, `filterNavigation`, `findActiveNavigation`), React hooks without markup (`useUrlListState`, `useEntityDrawer`, `useRowSelection`, `useEntityTranslations`, …), browser helpers (`prepareImageFile`, `readStored` / `writeStored`, `buildStorageKey`), date input values (`toDateInputValue`, `fromDateTimeInputValue`, …), `withStickyParams`, `useLatestSearch`, `useConfirm` (the provider's confirmation), `WriteAccessProvider` / `useWriteAccess`, date range presets, bulk summaries with skipped rows (`skipSequential`, `bulkSummaryText`), text limits (`countCodePoints`, `overLimitKeys`), colour values, `useMediaQuery`, the image normaliser (`normalizeImage`) and crop geometry, the api injection of the screen entries (`InjectableBaseApi`, `ApiQueryHook`, `staticQueryHook`, …), `useMemoryUrlState`, `useOptimisticRowPatches` | `./i18n` |
|
|
25
25
|
| `./i18n` | the UI text store (`m`, `translateText`, `setTranslations`), `useTranslate`, `<Translate>`, number / date formats of the UI locale, server-message translation | — |
|
|
26
|
-
| `./primitives` | buttons, inputs, selects, dialogs, sheets, popovers, menus, tooltips, tables, badges, `SegmentedControl`, `cn`, the portal container, the header slot of form actions (`FormActionsSlotProvider`, `FormActionsSlot`) | `./i18n` |
|
|
27
|
-
| `./list` | entity list card, toolbar, search, filters, table, grid, load-more, status badge, cells, multi-select, combobox, bulk bar | logic, i18n, primitives |
|
|
28
|
-
| `./page` | page header and frame, `EntityListPage`, detail shell and header, tabs, section header, definition list, page toolbar, editable card, status callout, entity metadata | logic, i18n, primitives; from list only `EmptyValue`, `EntityListEmpty`, `EntityListCard` |
|
|
29
|
-
| `./form` | `Form`, `FormField`, `FormSection`, `FormActions`, `FormDrawer`, `FormDialog`, `FormHeader`, `FormWrapper`, `FormJumpBar`, `FormErrors`, `FormSubmitButton`, `useConfirmDialog` | logic, i18n, primitives; from page only `DetailHeader`, `EntityMetadata` |
|
|
30
|
-
| `./translations` | `TranslatableInput`, `TranslatableMarkdown` (editor injected), their form-bound variants, `TranslationControls` | logic, i18n, primitives; from form only `fieldLabels`, `useConfirmDialog` |
|
|
31
|
-
| `./
|
|
26
|
+
| `./primitives` | buttons, inputs, selects, dialogs, sheets, popovers, menus, tooltips, tables, badges, `SegmentedControl`, `cn`, the portal container, the link component and pathname hook contexts, the header slot of form actions (`FormActionsSlotProvider`, `FormActionsSlot`) | `./i18n` |
|
|
27
|
+
| `./list` | entity list card, toolbar, search, filters, table, grid, load-more, status badge, cells, multi-select, combobox, bulk bar, column factories (`textColumn`, `moneyColumn`, `actionsColumn`, …), the toolbar's filter toggle, count and clear as blocks | logic, i18n, primitives |
|
|
28
|
+
| `./page` | page header and frame, `EntityListPage`, detail shell and header, tabs, section header, definition list, page toolbar, editable card, status callout, entity metadata, route states (`RouteError`, `RouteLoading`), `MaintenanceActionCard` | logic, i18n, primitives; from list only `EmptyValue`, `EntityListEmpty`, `EntityListCard` |
|
|
29
|
+
| `./form` | `Form`, `FormField`, `FormSection`, `FormActions`, `FormDrawer`, `FormDialog`, `FormHeader`, `FormWrapper`, `FormJumpBar`, `FormErrors`, `FormSubmitButton`, `useConfirmDialog`, `ColorValueField` | logic, i18n, primitives; from page only `DetailHeader`, `EntityMetadata` |
|
|
30
|
+
| `./translations` | `TranslatableInput`, `TranslatableMarkdown` (editor injected), their form-bound variants, `TranslationControls`, `focusFirstOverLimitTranslation`; the admin screens on the host's api (`createTranslationsApi`): `AppTranslationsScreen` with `AppTranslationKeyDrawer` and `TranslationCompleteness`, `LanguagesScreen`, `LocalesScreen`, `ConfigImportCard`, `useEntityTranslator`, `useContentLocales` | logic, i18n, primitives, list, page; from form only `fieldLabels`, `useConfirmDialog`, `Form`, `FormActions`, `FormDrawer`, `FormField`, `FormSubmitButton` |
|
|
31
|
+
| `./workers` | the screens of the worker monitoring on the host's api (`createWorkersApi`): `WorkersOverviewScreen`, `WorkerTransportScreen` and their parts (tiles, live panel, throughput and transport tables, history charts as SVG, message runs, processes, restart request), the status maps, the payload types | logic, i18n, primitives, list, page |
|
|
32
|
+
| `./media` | `MediaItemField`, `FormMediaItemField`, `MediaItemPickerDialog`, `MediaPreview`, `ImageCropDialog` (crop surface: file and aspect options in; cropped blob, skip or cancel out) | logic, i18n, primitives, list, form |
|
|
32
33
|
| `./glass` | `GlassPill`, `QuickFilterPills`, `CollapsibleCard`, `GlassGroup`, `ActionRow` | logic, i18n, primitives |
|
|
34
|
+
| `./shell` | the application frame `AppShell` (top bar with slots, sidebar with groups, badges and locks, the icon rail and its `[` shortcut, the mobile menu, the content frame), `ShellBreadcrumbs`, `ShellDocumentTitle`, `AccountMenu`, `LanguageMenu`, their parts and hooks (`useSidebarCollapsed`, `useShellShortcut`) | logic, i18n, primitives |
|
|
35
|
+
| `./shell-background` | `ShaderBackground`: the animated WebGL background (loaded lazily; a host that does not import the entry pays nothing) | — |
|
|
33
36
|
| `./provider` | `AdminUiProvider` (also the dialog behind `useConfirm`), `useAdminUi`, `defaultStorageKey` | logic, i18n, primitives; types only from media and translations |
|
|
34
|
-
| `./next` | Next.js adapters: `useNextUrlStateAdapter`, `useNextDrawerUrlAdapter`, `useListViewParam`, the one URL writer (`queueSearchParamsWrite`) | logic, provider; the only entry importing `next/*` |
|
|
37
|
+
| `./next` | Next.js adapters: `useNextUrlStateAdapter`, `useNextDrawerUrlAdapter`, `useNextPathname`, `useListViewParam`, the one URL writer (`queueSearchParamsWrite`) | logic, provider; the only entry importing `next/*` |
|
|
35
38
|
| `./notify-sonner` | `sonnerNotifications` (the notification adapter on `sonner`) and its `Toaster` | logic; the only entry importing `sonner` |
|
|
36
|
-
| `./showcase` | `Showcase`: a development page drawing every block in the host theme, light and dark, one section per entry, the host's sections appended; `SHOWCASE_COVERAGE` | logic, i18n, primitives, list, page, form, translations, media, glass; never `./next
|
|
39
|
+
| `./showcase` | `Showcase`: a development page drawing every block in the host theme, light and dark, one section per entry, the host's sections appended; `SHOWCASE_COVERAGE`; the sample payloads of the screens (`showcaseWorkersData`, `showcaseTranslationsData`) | logic, i18n, primitives, list, page, form, translations, media, glass, data, workers, shell, shell-background; never `./next`, `./notify-sonner` or `./markdown` (its section loads through `loadMarkdown`) |
|
|
40
|
+
| `./data` | key figures: `MetricTile` (label, value, delta, hint, sparkline slot, skeleton), `MetricTileSkeleton`, `MetricGrid`, `DeltaText`, `NoteList`, the delta helpers `resolveDelta`, `relativeChange`, `deltaDirectionOf`, `deltaToneOf` | logic, i18n, primitives |
|
|
41
|
+
| `./markdown` | `MarkdownEditor`, `MarkdownPreview` (sanitised), `renderMarkdownEditor` (the `renderEditor` slot of `./translations` and `AdminUiProvider.renderMarkdownEditor`); loads `@uiw/react-md-editor` and `rehype-sanitize` after hydration | logic, i18n, primitives; translations type-only; the only entry reaching its optional peers |
|
|
42
|
+
| `./design-studio` | `designStudioComponents`: the `components` of `@mgamadeus/ddd-design-studio`'s provider, every slot mapped to the block of the same name; the slot types (`DesignStudioComponentsContract`, structural copy) | primitives, list, page, glass; never imports the studio |
|
|
37
43
|
| `./theme.css`, `./components.css` | the Tailwind theme binding and the structural CSS of the blocks | — |
|
|
38
44
|
| `./tokens.json`, `./i18n-keys.json` | the host contract (colour roles, properties, layers, data attributes) and the text manifest | — |
|
|
39
45
|
|
|
@@ -54,10 +60,14 @@ from the entry that owns it.
|
|
|
54
60
|
| `next` | optional peer | `^16.0.0` — needed by `./next` only |
|
|
55
61
|
| `sonner` | optional peer | `^2.0.0` — needed by `./notify-sonner` only |
|
|
56
62
|
| `tailwindcss` | optional peer | `^4.1.0` — the host's build compiles the CSS |
|
|
63
|
+
| `@uiw/react-md-editor` | optional peer | `^4.1.0` — needed by `./markdown` only |
|
|
64
|
+
| `rehype-sanitize` | optional peer | `^6.0.0` — needed by `./markdown` only |
|
|
57
65
|
| `radix-ui` | peer | `^1.8.1` — one copy per app, as with React (see below) |
|
|
58
66
|
| `class-variance-authority`, `cmdk`, `clsx`, `tailwind-merge` | dependencies | imported inside `./primitives` only |
|
|
59
67
|
|
|
60
|
-
Without `next` or `sonner` every entry except `./next` and `./notify-sonner` imports and type-checks.
|
|
68
|
+
Without `next` or `sonner` every entry except `./next` and `./notify-sonner` imports and type-checks. `./markdown`
|
|
69
|
+
imports its two peers only after hydration (a dynamic import), so it loads without them and a host that never imports
|
|
70
|
+
it never bundles them.
|
|
61
71
|
|
|
62
72
|
**One Radix copy.** Radix keeps focus traps, outside-click layers and portals in module state. Two copies of one
|
|
63
73
|
Radix package in an app (the package's dialogs from `radix-ui`, a host dialog from an older single
|
|
@@ -114,10 +124,12 @@ It reads the host's `node_modules` (npm and pnpm layouts) and the folders above
|
|
|
114
124
|
2. **Tokens.** Declare on `:root` (and under `.dark` where themed) every property of
|
|
115
125
|
[`tokens.json`](./tokens.json): the 31 colour roles, `--nav-h`, `--content-max`, `--radius`, the surface and glass
|
|
116
126
|
alphas and shadows, `--glass-control-shadow`. Dark mode is a `.dark` class on an ancestor; the default border
|
|
117
|
-
colour is the `border` role. `components.css` sets the
|
|
118
|
-
`overlay` 50, `popover` 50)
|
|
119
|
-
9999px, `--segmented-control-duration` 200ms)
|
|
120
|
-
wins.
|
|
127
|
+
colour is the `border` role. `components.css` sets the five `--layer-*` defaults (`raised` 10, `sticky` 20, `chrome`
|
|
128
|
+
30, `overlay` 50, `popover` 50), the two optional properties of `SegmentedControl` (`--segmented-control-radius`
|
|
129
|
+
9999px, `--segmented-control-duration` 200ms) and the two of `AppShell` (`--sidebar-w` 16rem, `--sidebar-rail-w`
|
|
130
|
+
5rem) with zero specificity in the lowest cascade layer, so any host value wins. `ShaderBackground` reads
|
|
131
|
+
`--shell-background-base`, `--shell-background-blob-1` and `--shell-background-blob-2` (optional; fallbacks
|
|
132
|
+
`--background`, `--brand-light`, `--accent`). Check a built
|
|
121
133
|
stylesheet against the contract:
|
|
122
134
|
|
|
123
135
|
```sh
|
|
@@ -130,12 +142,42 @@ It reads the host's `node_modules` (npm and pnpm layouts) and the folders above
|
|
|
130
142
|
theme stores HSL channels); a property read anywhere else (`background-color: var(--card)`, `color-mix()`,
|
|
131
143
|
`light-dark()`, or passed on to another custom property that is read so) must hold a colour.
|
|
132
144
|
|
|
145
|
+
Check the contrast of the pairs `tokens.json` declares (`contrast.pairs`: text and UI roles on their backgrounds,
|
|
146
|
+
4.5:1 for text, 3:1 for large text and UI parts), light and dark:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
npx ddd-admin-ui-check-contrast <built css file or folder> [tokens.json] [--exceptions <file.json>] [--allow-unevaluated]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
It prints each pair's ratio per theme and exits 1 on a pair below its minimum that no exception list names: the
|
|
153
|
+
package's (`contrast.exceptions` of `tokens.json`) merged with the host's file passed as `--exceptions`. A background
|
|
154
|
+
`role/NN` is that role at NN % over the card (status badges). Values it cannot compute (named colours, `color-mix()`,
|
|
155
|
+
`lab()`, `light-dark()`, …) count as failures unless `--allow-unevaluated` is passed. Run it in the host's CI on its
|
|
156
|
+
built CSS, like `ddd-admin-ui-check-tokens`.
|
|
157
|
+
|
|
158
|
+
An exception file is an array (or `{ "exceptions": [...] }`) of entries in the format of the package's list; `theme`
|
|
159
|
+
is optional (both themes when absent), `reason` is required:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
[
|
|
163
|
+
{ "foreground": "muted-foreground", "background": "card", "theme": "dark", "reason": "captions only, large text" }
|
|
164
|
+
]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The package lists the light status pairs (`success` on `card`, and `success`, `warning`, `destructive`, `info` on
|
|
168
|
+
their 15 % tints): status colours used as text or on their tint, themed by each host, until an emphasis role exists.
|
|
169
|
+
|
|
170
|
+
**Layers checklist.** The package's dialogs, sheets and drawers open at layer 50 (`--layer-overlay`), its popovers,
|
|
171
|
+
selects, menus and tooltips at 50 too (`--layer-popover`). A host whose own overlay scale is higher (a dialog at
|
|
172
|
+
9999, toasts at 100) raises them on `:root` (`--layer-overlay: 10000; --layer-popover: 10001`), or the package's
|
|
173
|
+
dialogs open under the host's chrome.
|
|
174
|
+
|
|
133
175
|
3. **Provider** above every page. Blocks draw tooltips (a date cell shows the relative time on hover), so a page
|
|
134
176
|
without the provider fails with "`Tooltip` must be used within `TooltipProvider`".
|
|
135
177
|
|
|
136
178
|
```tsx
|
|
137
179
|
'use client';
|
|
138
|
-
import { useNextDrawerUrlAdapter, useNextUrlStateAdapter } from '@mgamadeus/ddd-admin-ui/next';
|
|
180
|
+
import { useNextDrawerUrlAdapter, useNextPathname, useNextUrlStateAdapter } from '@mgamadeus/ddd-admin-ui/next';
|
|
139
181
|
import { sonnerNotifications, Toaster } from '@mgamadeus/ddd-admin-ui/notify-sonner';
|
|
140
182
|
import { AdminUiProvider } from '@mgamadeus/ddd-admin-ui/provider';
|
|
141
183
|
|
|
@@ -145,6 +187,7 @@ It reads the host's `node_modules` (npm and pnpm layouts) and the folders above
|
|
|
145
187
|
tooltipDelayMs={150}
|
|
146
188
|
useUrlStateAdapter={useNextUrlStateAdapter}
|
|
147
189
|
useDrawerUrlAdapter={useNextDrawerUrlAdapter}
|
|
190
|
+
usePathname={useNextPathname}
|
|
148
191
|
>
|
|
149
192
|
{children}
|
|
150
193
|
<Toaster />
|
|
@@ -157,9 +200,12 @@ It reads the host's `node_modules` (npm and pnpm layouts) and the folders above
|
|
|
157
200
|
default `document.body`), `tooltipDelayMs`, `translations` (a `TranslationAdapter` that feeds the text store from a
|
|
158
201
|
host store), `useUrlStateAdapter`, `useDrawerUrlAdapter`, `upload`, `renderMarkdownEditor`, `aiTranslation`,
|
|
159
202
|
`preserveSearchParams` (search parameters the URL writer never removes), `linkComponent` (the router link of every
|
|
160
|
-
block that renders a link; wrap it with `withStickyParams` to keep sticky search parameters), `
|
|
161
|
-
|
|
162
|
-
|
|
203
|
+
block that renders a link; wrap it with `withStickyParams` to keep sticky search parameters), `usePathname` (the
|
|
204
|
+
router's pathname hook for the shell's active entry, breadcrumbs and title: `useNextPathname` from `./next`; without
|
|
205
|
+
it `location.pathname` after hydration), `confirm` (the host's confirmation service behind `useConfirm()`),
|
|
206
|
+
`formatLocale` (the `Intl` locale date cells format in, when it differs from the UI language's), `textLimits`
|
|
207
|
+
(`{ singleLine, multiline }`: default length limits of translatable text fields, in code points). Without a
|
|
208
|
+
notification adapter `notify.*` does nothing and warns once outside production.
|
|
163
209
|
|
|
164
210
|
```tsx
|
|
165
211
|
const StickyLink: PageLinkComponent = ({ href, ...props }) => {
|
|
@@ -181,6 +227,13 @@ It reads the host's `node_modules` (npm and pnpm layouts) and the folders above
|
|
|
181
227
|
variants ("Clear all translations?"). The package dialog then does not render. The host's dialog must come from the
|
|
182
228
|
same Radix copy as the blocks (see Peers).
|
|
183
229
|
|
|
230
|
+
5. **Markdown** (optional): with `@uiw/react-md-editor` and `rehype-sanitize` installed, pass
|
|
231
|
+
`renderMarkdownEditor({ rows: 8 })` from `./markdown` as `AdminUiProvider.renderMarkdownEditor` or as a field's
|
|
232
|
+
`renderEditor`. The editor loads after hydration (the server draws a skeleton, no `next/*`); its stylesheet comes
|
|
233
|
+
with the library's module, and a bundler that cannot import CSS from `node_modules` adds
|
|
234
|
+
`@import '@uiw/react-md-editor/markdown-editor.css'`. If the editor cannot be loaded at run time, the field is a plain
|
|
235
|
+
text area.
|
|
236
|
+
|
|
184
237
|
## Server and client
|
|
185
238
|
|
|
186
239
|
Every file that calls a hook, `createContext` or `react-dom` starts with `'use client'`; barrels and `./logic`'s pure
|
|
@@ -204,6 +257,134 @@ function props there.
|
|
|
204
257
|
`toDateTimeInputValue` / `fromDateTimeInputValue` (`./logic`). Empty or invalid gives `''` / `null`; no arithmetic. A
|
|
205
258
|
local time skipped when the clocks go forward resolves an hour later, a repeated one to its first occurrence.
|
|
206
259
|
|
|
260
|
+
## Screens on the host's API
|
|
261
|
+
|
|
262
|
+
`./workers` and `./translations` bring whole admin screens for endpoints of the framework. They never import a host
|
|
263
|
+
SDK and never reach RTK at run time: the host passes the RTK Query api it already has (`createApi` from
|
|
264
|
+
`@reduxjs/toolkit/query/react`, its base query carrying origin, session and refresh, e.g. `createDddBaseQuery` of
|
|
265
|
+
`@mgamadeus/ddd-web/api`), the entry injects its operations once and returns the hooks; every screen takes them as
|
|
266
|
+
`api`.
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
// adminApi.ts — module scope, once
|
|
270
|
+
import { createTranslationsApi } from '@mgamadeus/ddd-admin-ui/translations';
|
|
271
|
+
import { createWorkersApi } from '@mgamadeus/ddd-admin-ui/workers';
|
|
272
|
+
|
|
273
|
+
export const workersApi = createWorkersApi({ baseApi: adminApi, apiPrefix: '/api/admin/maintenance/workers' });
|
|
274
|
+
export const translationsApi = createTranslationsApi({ baseApi: adminApi, apiPrefix: '/api/admin/common' });
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
A second call with the same api and prefix returns the first result. The cache tags are the entry's own
|
|
278
|
+
(`AdminUiWorkers`, `AdminUiAppTranslations`, `AdminUiLanguages`, `AdminUiLocales`); a write invalidates what it
|
|
279
|
+
changes. The screens follow the host's setup: links through `AdminUiProvider.linkComponent`, writes (restart,
|
|
280
|
+
generation, toggles, imports, saves) disabled under `WriteAccessProvider` with its reason, confirmations through
|
|
281
|
+
`useConfirm`, toasts through `notify`. Filters, tabs, windows and the drawer live in the URL when the host passes its
|
|
282
|
+
adapters (`urlStateAdapter`, `drawerUrlAdapter`), in component state otherwise. `createStaticWorkersApi` /
|
|
283
|
+
`createStaticTranslationsApi` answer fixed payloads (the showcase's `showcaseWorkersData` /
|
|
284
|
+
`showcaseTranslationsData`) for design reviews and tests.
|
|
285
|
+
|
|
286
|
+
### `./workers`
|
|
287
|
+
|
|
288
|
+
The screens of the worker monitoring, on Core's `WorkersControllerTrait` (mgamadeus/ddd **3.23.1** or later: the
|
|
289
|
+
endpoints since 3.18.0, throughput windows since 3.20.0, the recent window of a transport since 3.23.1). Since 3.35.1
|
|
290
|
+
the trait calls `throwForbiddenUnlessWorkersAccessAllowed()` first in every action: an application whose access rule is
|
|
291
|
+
not a role overrides it on its controller; the screens need nothing for it (a 403 shows as the screen's error).
|
|
292
|
+
|
|
293
|
+
| Hook | Endpoint (below `apiPrefix`) |
|
|
294
|
+
|---|---|
|
|
295
|
+
| `useOverviewQuery` | `GET /overview` |
|
|
296
|
+
| `useHistoryQuery` | `GET /history?from&to&stepSeconds` |
|
|
297
|
+
| `useTransportDetailQuery` | `GET /transports/{transport}?from&to&stepSeconds` |
|
|
298
|
+
| `useMessageRunsQuery`, `useProcessesQuery` | `GET /transports/{transport}/messageRuns`, `/processes` (QueryOptions) |
|
|
299
|
+
| `useRestartMutation` | `POST /restart` with `{}` or `{ transport }` (invalidates the live reads) |
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
'use client';
|
|
303
|
+
// app/maintenance/workers/page.tsx and app/maintenance/workers/[transport]/page.tsx
|
|
304
|
+
import { useNextUrlStateAdapter } from '@mgamadeus/ddd-admin-ui/next';
|
|
305
|
+
import { WorkersOverviewScreen, WorkerTransportScreen } from '@mgamadeus/ddd-admin-ui/workers';
|
|
306
|
+
|
|
307
|
+
const transportHref = (transport: string, tab?: string) =>
|
|
308
|
+
`/maintenance/workers/${encodeURIComponent(transport)}${tab ? `?tab=${tab}` : ''}`;
|
|
309
|
+
|
|
310
|
+
export const WorkersPage = () => (
|
|
311
|
+
<WorkersOverviewScreen api={workersApi} transportHref={transportHref} urlStateAdapter={useNextUrlStateAdapter({ listId: 'workers' })} />
|
|
312
|
+
);
|
|
313
|
+
export const TransportPage = ({ transport }: { transport: string }) => (
|
|
314
|
+
<WorkerTransportScreen
|
|
315
|
+
api={workersApi}
|
|
316
|
+
transport={transport}
|
|
317
|
+
backHref="/maintenance/workers"
|
|
318
|
+
urlStateAdapter={useNextUrlStateAdapter({ listId: `workers.${transport}` })}
|
|
319
|
+
/>
|
|
320
|
+
);
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
The overview refreshes every 10 s and the history every minute while the tab is visible; the only action is the
|
|
324
|
+
restart request (no scaling control). The charts are SVG drawn by the entry (no chart library, no optional peer), in
|
|
325
|
+
the colour roles of `tokens.json`; a step without a reading is a gap, never a 0.
|
|
326
|
+
|
|
327
|
+
### `./translations` (admin screens)
|
|
328
|
+
|
|
329
|
+
The app translation keys and values with their completeness, the languages and locales, and the entity translation,
|
|
330
|
+
on the application's admin controllers: the modules ship the entities and services, not controller traits
|
|
331
|
+
(**mgamadeus/ddd-common-translations** 1.0.7 or later for the completeness and the generation, checked with 1.1.1;
|
|
332
|
+
**mgamadeus/ddd-common-political** 1.0.0 or later for `Language` / `Locale`, checked with 1.0.19). The paths below
|
|
333
|
+
`apiPrefix` are those of these controllers; `paths` renames a segment
|
|
334
|
+
(`createTranslationsApi({ …, paths: { appTranslations: 'appTranslations' } })`).
|
|
335
|
+
|
|
336
|
+
| Hook | Endpoint (below `apiPrefix`, default segments) |
|
|
337
|
+
|---|---|
|
|
338
|
+
| `useAppTranslationKeysQuery`, `useAppTranslationKeyQuery` | `GET app-translations/keys/list`, `GET app-translations/keys/{id}?expand=appTranslationValues` |
|
|
339
|
+
| `useUpdateAppTranslationKeyMutation`, `useDeleteAppTranslationKeyMutation` | `PATCH app-translations/keys` (`{ appTranslationKey }`), `DELETE app-translations/keys/{id}` |
|
|
340
|
+
| `useUpdateAppTranslationValueMutation`, `useDeleteAppTranslationValueMutation` | `PATCH app-translations/values` (`{ appTranslationValue }`), `DELETE app-translations/values/{id}` |
|
|
341
|
+
| `useAppTranslationCompletenessQuery` | `GET app-translations/keys/completeness` |
|
|
342
|
+
| `useGenerateAppTranslationsMutation`, `useGenerateAllAppTranslationsMutation` | `GET app-translations/keys/generate/{localeId}?writingStyle=`, `GET app-translations/keys/generate-all` |
|
|
343
|
+
| `useLanguagesQuery`, `useUpdateLanguageMutation`, `useImportLanguagesFromConfigMutation` | `GET languages/list`, `PATCH languages` (`{ language }`), `GET languages/importFromConfig` |
|
|
344
|
+
| `useLocalesQuery`, `useUpdateLocaleMutation`, `useImportLocalesFromConfigMutation` | `GET locales/list`, `PATCH locales` (`{ locale }`), `GET locales/importFromConfig` |
|
|
345
|
+
| `useTranslateEntitiesMutation` | `POST translations/translateEntities` (`{ entitiesToTranslate, localesToTranslate }`) |
|
|
346
|
+
|
|
347
|
+
```tsx
|
|
348
|
+
'use client';
|
|
349
|
+
import { useNextDrawerUrlAdapter, useNextUrlStateAdapter } from '@mgamadeus/ddd-admin-ui/next';
|
|
350
|
+
import { AppTranslationsScreen, ConfigImportCard, LocalesScreen } from '@mgamadeus/ddd-admin-ui/translations';
|
|
351
|
+
|
|
352
|
+
export const AppTranslationsPage = () => (
|
|
353
|
+
<AppTranslationsScreen
|
|
354
|
+
api={translationsApi}
|
|
355
|
+
urlStateAdapter={useNextUrlStateAdapter({ listId: 'appTranslations' })}
|
|
356
|
+
drawerUrlAdapter={useNextDrawerUrlAdapter()}
|
|
357
|
+
/>
|
|
358
|
+
);
|
|
359
|
+
export const LocalesPage = () => <LocalesScreen api={translationsApi} urlStateAdapter={useNextUrlStateAdapter({ listId: 'locales' })} />;
|
|
360
|
+
export const ImportsPage = () => <ConfigImportCard api={translationsApi} kind="languages" />;
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
`useEntityTranslator(translationsApi)` translates an entity draft into one locale per request and feeds
|
|
364
|
+
`useTranslationRunner` (`./logic`); `useContentLocales(translationsApi, { fallback })` gives the content locale keys of
|
|
365
|
+
the active locales. `ConfigImportCard` is a `MaintenanceActionCard` (`./page`): title, description, run, the outcome of
|
|
366
|
+
the last run.
|
|
367
|
+
|
|
368
|
+
## Design studio
|
|
369
|
+
|
|
370
|
+
`./design-studio` exports `designStudioComponents`, the `components` value the provider of
|
|
371
|
+
`@mgamadeus/ddd-design-studio` takes (targets studio **0.7.x**, checked against 0.7.3). Every slot maps to the block of
|
|
372
|
+
the same name: the shadcn-style primitives (`Button` … `DropdownMenuSeparator`), `Combobox`, `SearchField` and
|
|
373
|
+
`StatusBadge` from `./list`, `QuickFilterPills` from `./glass`, `PageHeader`, `StatusCallout`, `CardGrid` and
|
|
374
|
+
`PageSections` from `./page`.
|
|
375
|
+
|
|
376
|
+
```tsx
|
|
377
|
+
import { designStudioComponents } from '@mgamadeus/ddd-admin-ui/design-studio';
|
|
378
|
+
|
|
379
|
+
<DesignStudioProvider components={designStudioComponents} /* api, router, paths, … */ />;
|
|
380
|
+
// one slot of your own: components={{ ...designStudioComponents, Button: MyButton }}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
The entry never imports the studio and adds no dependency: `DesignStudioComponentsContract` is a structural copy of
|
|
384
|
+
the studio's `DesignStudioComponents`, and the map is typed against it; the studio passes a subset of each block's
|
|
385
|
+
props, so the map is assignable to the studio's own type. A later studio minor that adds or changes a slot needs a new
|
|
386
|
+
release of this entry. The host's `TooltipProvider` (part of `AdminUiProvider`) and theme apply as for every block.
|
|
387
|
+
|
|
207
388
|
## Showcase
|
|
208
389
|
|
|
209
390
|
`./showcase` is a development page, not a screen block: mount it on a route of the host, below `AdminUiProvider`, to
|
|
@@ -234,6 +415,63 @@ hydration, and applied in the render right after it. A list that mounts on the c
|
|
|
234
415
|
its first render, so it never renders or requests twice. `useHydrated()` (`./logic`) gives the same switch to host
|
|
235
416
|
code.
|
|
236
417
|
|
|
418
|
+
## Shell and navigation
|
|
419
|
+
|
|
420
|
+
`./shell` is the application frame; its content comes from the host. ONE navigation tree (types in `./logic`) feeds
|
|
421
|
+
the sidebar, the mobile menu, the breadcrumbs and the document title:
|
|
422
|
+
|
|
423
|
+
```tsx
|
|
424
|
+
'use client';
|
|
425
|
+
import { m } from '@mgamadeus/ddd-admin-ui/i18n';
|
|
426
|
+
import type { NavigationItem } from '@mgamadeus/ddd-admin-ui/logic';
|
|
427
|
+
import { AccountMenu, AppShell, LanguageMenu, type UseEntityLabel } from '@mgamadeus/ddd-admin-ui/shell';
|
|
428
|
+
|
|
429
|
+
const NAVIGATION: NavigationItem<'item'>[] = [
|
|
430
|
+
{ key: 'home', label: m('Home'), href: '/', exact: true, icon: House },
|
|
431
|
+
{
|
|
432
|
+
key: 'catalog', label: m('Catalog'), icon: Boxes, children: [
|
|
433
|
+
{ key: 'items', label: m('Items'), href: '/items', icon: Shapes, badge: waiting, crumbs: [
|
|
434
|
+
{ segment: 'create', label: m('Create item') },
|
|
435
|
+
{ segment: ':itemId', entity: 'item', children: [{ segment: 'details', label: m('Details') }] },
|
|
436
|
+
] },
|
|
437
|
+
{ key: 'reports', label: m('Reports'), href: '/reports', lockedReason: m('Not in your plan') },
|
|
438
|
+
],
|
|
439
|
+
},
|
|
440
|
+
{ key: 'old', label: m('Old screen'), href: 'https://old.example/screen', external: true },
|
|
441
|
+
];
|
|
442
|
+
// the page's own query, so the crumb sends no request of its own
|
|
443
|
+
const useEntityLabel: UseEntityLabel<'item'> = ({ id }) => { const query = useItemQuery(id); return { text: query.data?.name, isLoading: query.isLoading }; };
|
|
444
|
+
|
|
445
|
+
<AppShell navigation={NAVIGATION} canAccess={item => rights.allows(item.key)} useEntityLabel={useEntityLabel}
|
|
446
|
+
brand={<Link href="/" aria-label="Home"><Logo /></Link>} documentTitle={{ appName: 'Admin' }}
|
|
447
|
+
topBarEnd={<><LanguageMenu languages={languages} current={code} onChange={setCode} /><AccountMenu name={user.name} entries={accountEntries} /></>}>
|
|
448
|
+
{children}
|
|
449
|
+
</AppShell>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
- **Entries**: a leaf has `href` (`exact` for an overview whose siblings live below it), optional `badge` (work
|
|
453
|
+
waiting), `lockedReason` (a commercial lock: still a link, marked), `external` (a plain `<a>`, marked "Opens outside
|
|
454
|
+
this app"); a group has `children` (groups nest) and optionally its own `href` (its label links, the caret toggles).
|
|
455
|
+
Labels are UI texts, translated when rendered.
|
|
456
|
+
- **Breadcrumbs** (`resolveCrumbs`): the groups as text (a link when a group has its own page), the entry as a link,
|
|
457
|
+
then per leaf `crumbs` — child segments as literals or `:params` (a literal wins), each with a fixed `label`, a
|
|
458
|
+
`label(segment, t, params)`, or an `entity` key named by the host's `useEntityLabel` hook (the id while it loads). A
|
|
459
|
+
route without label adds no crumb; `link: false` keeps a crumb as text. Narrow trails fold into an ellipsis menu
|
|
460
|
+
(container queries, no measurement).
|
|
461
|
+
- **Rights**: `canAccess(item)` hides refused items from the sidebar (a group left empty disappears); the breadcrumbs
|
|
462
|
+
resolve against the whole tree and show a refused crumb as text. Presentation only: the server still checks.
|
|
463
|
+
- **Pathname and links**: the provider's `usePathname` (`useNextPathname`) and `linkComponent` (sticky parameters with
|
|
464
|
+
`withStickyParams`); no router import in the blocks. `AppShell.pathname` overrides.
|
|
465
|
+
- **Collapse**: the foot row and `[` toggle the icon rail (not while typing or in a dialog or menu, not below `lg`),
|
|
466
|
+
remembered in localStorage per `collapsedStorageKey`, applied right after hydration (the server renders the full
|
|
467
|
+
column). The rail shows groups as flyout menus.
|
|
468
|
+
- **Document title**: `documentTitle={{ appName }}` keeps `document.title` on the page (`Details · Blue widget · Admin`);
|
|
469
|
+
`resolveDocumentTitle(pathname, navigation, { appName })` gives the same text on the server.
|
|
470
|
+
- **Background**: `background={<ShaderBackground />}` from `./shell-background` (lazy WebGL, nothing with reduced
|
|
471
|
+
motion or without WebGL). The page background then sits on `<html>`.
|
|
472
|
+
- **RTL**: logical sides throughout; with Radix's `Direction.Provider dir="rtl"` the menus and the mobile sheet open
|
|
473
|
+
from the right.
|
|
474
|
+
|
|
237
475
|
## Texts
|
|
238
476
|
|
|
239
477
|
The UI language lives in one store: `setTranslations(languageCode, writingStyle, bundle)` (or the provider's
|
|
@@ -264,7 +502,7 @@ project's `.claude/skills/`. Idempotent; repoints an existing symlink, never tou
|
|
|
264
502
|
|
|
265
503
|
## Versioning
|
|
266
504
|
|
|
267
|
-
0.x: each minor may break. Pin the exact version while the package is in 0.x (`"@mgamadeus/ddd-admin-ui": "0.1
|
|
505
|
+
0.x: each minor may break. Pin the exact version while the package is in 0.x (`"@mgamadeus/ddd-admin-ui": "0.2.1"`,
|
|
268
506
|
`pnpm add -E` / `npm install -E`); modules peer on the version they were tested with. Stable releases are published
|
|
269
507
|
under the `latest` dist-tag, pre-releases (`x.y.z-…`) under `next`. Changes per release: [CHANGELOG.md](CHANGELOG.md).
|
|
270
508
|
|
|
@@ -275,7 +513,7 @@ pnpm install
|
|
|
275
513
|
pnpm typecheck
|
|
276
514
|
pnpm test # unit tests beside the sources, script tests and a failing fixture per check-package rule
|
|
277
515
|
pnpm build # tsc → dist, declaration specifiers, stylesheets, manifests and shipped scripts
|
|
278
|
-
pnpm test:render # after the build: list snapshot (as in 0.1.0-rc.2), form actions snapshot (as in 0.1.0-rc.5), write access, status contexts, the showcase
|
|
516
|
+
pnpm test:render # after the build: list snapshot (as in 0.1.0-rc.2), form actions snapshot (as in 0.1.0-rc.5), write access, status contexts, the showcase, the shell
|
|
279
517
|
node scripts/check-package.mjs --dir .
|
|
280
518
|
pnpm pack --pack-destination "$TMPDIR" && test/consumer/run.sh "$TMPDIR"/mgamadeus-ddd-admin-ui-*.tgz pnpm "$TMPDIR/consumer-pnpm"
|
|
281
519
|
```
|
|
@@ -285,16 +523,17 @@ pnpm pack --pack-destination "$TMPDIR" && test/consumer/run.sh "$TMPDIR"/mgamade
|
|
|
285
523
|
| `node scripts/build.mjs` (`pnpm build`) | removes `dist`, `tsc -p tsconfig.build.json` (one JS and declaration file per source file, directives kept, `.js` specifiers), rewrites the declarations' specifiers to `.js`, copies CSS, JSON and the shipped scripts into `dist` |
|
|
286
524
|
| `node scripts/check-package.mjs --dir <package root or extracted tarball>` | the 13 package rules: exports and bins, directives, specifiers, no app alias, deny list (`--deny a,b` or `CHECK_PACKAGE_DENY`; `--require-deny-list` on release), declared dependencies, entry edges and reach, module state once, `files` and `sideEffects`, declarations in a strict consumer, no tests, fresh text manifest, tokens |
|
|
287
525
|
| `node scripts/tokens-utilities.mjs [--write]` | checks (or regenerates) the `utilities` lists of `tokens.json` from the source |
|
|
288
|
-
| `pnpm test:render` | server-renders list tables, bodies and badges from the build: without the optional table props the markup equals `test/consumer/fixtures/plain/list-snapshot.html` (taken from 0.1.0-rc.2); `FormActions`, `FormSubmitButton`, `AddEntityButton`, `EntityListBulkBar` and the headers without the props of 0.1.0-rc.6 equal `form-actions-snapshot.html` (taken from 0.1.0-rc.5); `WriteAccessProvider` disables the write controls; a status map's translation context reaches `StatusBadge`; the showcase renders (light, dark, every section) and its coverage list matches the exports |
|
|
526
|
+
| `pnpm test:render` | server-renders list tables, bodies and badges from the build: without the optional table props the markup equals `test/consumer/fixtures/plain/list-snapshot.html` (taken from 0.1.0-rc.2); `FormActions`, `FormSubmitButton`, `AddEntityButton`, `EntityListBulkBar` and the headers without the props of 0.1.0-rc.6 equal `form-actions-snapshot.html` (taken from 0.1.0-rc.5); `WriteAccessProvider` disables the write controls; a status map's translation context reaches `StatusBadge`; the showcase renders (light, dark, every section) and its coverage list matches the exports; the `./workers` and `./translations` screens render on the sample payloads and write access disables their writes; the shell renders from one navigation (sidebar, breadcrumbs, title, rights predicate) |
|
|
289
527
|
| `node scripts/build-i18n-manifest.mjs [--check]` (`pnpm i18n:manifest`) | regenerates `i18n-keys.json` from the source and `i18n/hints.json`; run it after changing a text or the version |
|
|
290
528
|
| `node scripts/check-tokens.mjs <css> [tokens.json]` | the host check above (shipped as `ddd-admin-ui-check-tokens`) |
|
|
291
529
|
| `node scripts/check-radix.mjs [host folder]` | the Radix copy check above (shipped as `ddd-admin-ui-check-radix`) |
|
|
530
|
+
| `node scripts/check-contrast.mjs <css> [tokens.json]` | the contrast check above (shipped as `ddd-admin-ui-check-contrast`) |
|
|
292
531
|
|
|
293
532
|
Source files import each other with explicit `.ts` / `.tsx` extensions and never through a directory. The consumer
|
|
294
533
|
tests (`test/consumer/run.sh <tarball> <npm|pnpm> <workDir>`) install the packed tarball into a project without the
|
|
295
534
|
optional peers and into a Next 16 app, and check imports, strict type checks, the production build and CSS, hydration,
|
|
296
|
-
form labels across entries, nested overlays, form dialogs, the save shortcut, header slots and
|
|
297
|
-
headless Chrome.
|
|
535
|
+
form labels across entries, nested overlays, form dialogs, the save shortcut, header slots, confirmations and the
|
|
536
|
+
shell (collapse, shortcut, mobile menu, breadcrumbs, title, RTL) in headless Chrome.
|
|
298
537
|
|
|
299
538
|
## License
|
|
300
539
|
|
package/STANDARDS.md
CHANGED
|
@@ -10,11 +10,17 @@ Where the names below come from (setup and the entry list: [`README.md`](./READM
|
|
|
10
10
|
|---|---|
|
|
11
11
|
| `@mgamadeus/ddd-admin-ui/logic` | `useUrlListState`, `useRowSelection`, `useEntityDrawer`, `drawerKey`, `defineStatusMap`, `formatDate`, `formatDateTime`, `runSequentialWithSummary`, `nextListSort`, `parseListSort`, `formatListSort`, `useConfirm`, `WriteAccessProvider`, `useWriteAccess` |
|
|
12
12
|
| `@mgamadeus/ddd-admin-ui/list` | `EntityListToolbar`, `EntityListBody`, `EntityListTable`, `EntityListViewToggle`, `EntityListBulkBar`, `FilterPanel`, `FilterText`, `FilterSelect`, `FilterMultiSelect`, `FilterDateRange`, `YES_NO_FILTER_OPTIONS`, `StatusBadge`, `IdCell`, `DateCell`, `BooleanCell`, `ImageCell`, `EmptyValue`, `orEmpty`, `MultiSelect`, `ChipToggleGroup`, `Combobox`, `Tag` |
|
|
13
|
-
| `@mgamadeus/ddd-admin-ui/page` | `EntityListPage`, `PageToolbar`, `ExportButton`, `AddEntityButton`, `EntityDetailShell`, `SectionHeader`, `DefinitionList`, `EditableCard`, `IconValue`, `IconValueRow`, `PageSections`, `CardGrid`, `PageFrame`, `PageHeader` |
|
|
13
|
+
| `@mgamadeus/ddd-admin-ui/page` | `EntityListPage`, `PageToolbar`, `ExportButton`, `AddEntityButton`, `EntityDetailShell`, `SectionHeader`, `DefinitionList`, `EditableCard`, `IconValue`, `IconValueRow`, `PageSections`, `CardGrid`, `PageFrame`, `PageHeader`, `MaintenanceActionCard` |
|
|
14
14
|
| `@mgamadeus/ddd-admin-ui/form` | `FormDrawer`, `FormDialog`, `FormActions`, `FormField`, `FormSection`, `FormHeader`, `useConfirmDialog` |
|
|
15
15
|
| `@mgamadeus/ddd-admin-ui/glass` | `QuickFilterPills`, `CollapsibleCard`, `GlassGroup`, `ActionRow` |
|
|
16
16
|
| `@mgamadeus/ddd-admin-ui/primitives` | `Button`, `Card`, `CardContent`, `SegmentedControl`, `FormActionsSlotProvider`, `FormActionsSlot` |
|
|
17
|
-
| `@mgamadeus/ddd-admin-ui/
|
|
17
|
+
| `@mgamadeus/ddd-admin-ui/workers` | `createWorkersApi`, `WorkersOverviewScreen`, `WorkerTransportScreen` |
|
|
18
|
+
| `@mgamadeus/ddd-admin-ui/translations` | `createTranslationsApi`, `AppTranslationsScreen`, `LanguagesScreen`, `LocalesScreen` |
|
|
19
|
+
| `@mgamadeus/ddd-admin-ui/next` | `useNextUrlStateAdapter`, `useNextDrawerUrlAdapter`, `useListViewParam`, `useNextPathname` |
|
|
20
|
+
| `@mgamadeus/ddd-admin-ui/shell` | `AppShell`, `ShellBreadcrumbs`, `ShellDocumentTitle`, `AccountMenu`, `LanguageMenu`, `LanguageMenuSub`, `UseEntityLabel` |
|
|
21
|
+
| `@mgamadeus/ddd-admin-ui/shell-background` | `ShaderBackground` |
|
|
22
|
+
| `@mgamadeus/ddd-admin-ui/data` | `MetricTile`, `MetricGrid`, `DeltaText`, `NoteList`, `relativeChange` |
|
|
23
|
+
| `@mgamadeus/ddd-admin-ui/markdown` | `renderMarkdownEditor`, `MarkdownEditor`, `MarkdownPreview` |
|
|
18
24
|
|
|
19
25
|
Every screen renders below `AdminUiProvider`. A screen that may not write sets that once with `WriteAccessProvider`
|
|
20
26
|
(§ 15).
|
|
@@ -555,3 +561,166 @@ read `useWriteAccess()` (`disabled={!writeAccess.allowed}`).
|
|
|
555
561
|
|
|
556
562
|
It replaces no guard: every write handler keeps its own check (`if (!writeAccess.allowed) return;`), and the server
|
|
557
563
|
checks every request. Without a provider writes are allowed.
|
|
564
|
+
|
|
565
|
+
## 16. Date presets, bulk menus, column factories, table breakpoint
|
|
566
|
+
|
|
567
|
+
```tsx
|
|
568
|
+
// A date filter with presets: all time, today, last 7 / 30 days, custom (or the host's list). One write per pick.
|
|
569
|
+
<FilterDateRange label="Created" presets from={list.values.createdFrom} to={list.values.createdTo}
|
|
570
|
+
onFromChange={value => list.setValue('createdFrom', value)} onToChange={value => list.setValue('createdTo', value)}
|
|
571
|
+
onRangeChange={range => { list.setValue('createdFrom', range.from); list.setValue('createdTo', range.to); }} />
|
|
572
|
+
|
|
573
|
+
// Columns from factories: id, sort key and filter are separate inputs; formats are explicit.
|
|
574
|
+
const columns = [
|
|
575
|
+
idColumn<Order>({ id: 'id', header: 'ID', value: o => o.id, width: '88px' }),
|
|
576
|
+
textColumn<Order>({ id: 'customer', header: 'Customer', value: o => o.customer?.name, sortKey: 'customer.name', width: '2fr' }),
|
|
577
|
+
moneyColumn<Order>({ id: 'total', header: 'Total', value: o => o.total, currency: o => o.currency, width: '120px' }),
|
|
578
|
+
dateColumn<Order>({ id: 'created', header: 'Created', value: o => o.changeHistory?.createdTime, sortKey: 'created', sortStart: 'desc' }),
|
|
579
|
+
actionsColumn<Order>({ cell: o => <RowActions order={o} /> }), // width 'content', pinned to the end
|
|
580
|
+
];
|
|
581
|
+
|
|
582
|
+
// Bulk actions with sub-choices, a confirmation with the count, a hint on a disabled action.
|
|
583
|
+
<EntityListBulkBar selection={selection} moreOnServer={list.hasMore} actions={[
|
|
584
|
+
{ id: 'move', label: 'Move', choices: sections, choicesLabel: 'Move to', onChoose: choice => moveSelected(choice.id),
|
|
585
|
+
confirm: { title: m('Move %count% rows?'), confirmLabel: m('Move') } },
|
|
586
|
+
{ id: 'activate', label: 'Activate', disabled: allActive, hint: m('Every selected row is active already'), onClick: activate },
|
|
587
|
+
]} />
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
- **Date presets** write the same `YYYY-MM-DD` bounds as typed dates, so "Clear filters" (both bounds `''`) is "All time"
|
|
591
|
+
and the URL keeps two keys. The filter derives the preset from the bounds (a range that matches no preset is custom);
|
|
592
|
+
a host that wants "Last 7 days" to roll forward keeps `preset` / `onPresetChange` itself. "Today" is the viewer's
|
|
593
|
+
local day (`today` overrides it).
|
|
594
|
+
- **Bulk summaries**: a run returns `skipSequential(reason)` for a row it leaves alone; the toast says
|
|
595
|
+
`Deleted 3 of 5 tracks · 2 skipped` (or the host's clauses per reason through `skipReasons`). A bulk endpoint's
|
|
596
|
+
answer uses `bulkSummaryText({ succeeded, failed, skipped }, labels)`.
|
|
597
|
+
- **Factories** return plain `EntityListColumn`s; mix them with hand-written columns. `moneyColumn` requires a currency,
|
|
598
|
+
`numberColumn` takes explicit `Intl.NumberFormatOptions` or the host's formatter; nothing falls back to a locale
|
|
599
|
+
default. A column with `width: 'content'` is as wide as its widest cell (a row's actions).
|
|
600
|
+
- **Breakpoint**: a list with cards shows the table from `md`; `tableBreakpoint="lg"` (many columns) or `"always"` on
|
|
601
|
+
`EntityListBody`, and the same value on `EntityListViewToggle`.
|
|
602
|
+
- **Outside the package toolbar** (a host filter sheet, a custom row): `FilterToggleButton`, `FilterCountBadge`,
|
|
603
|
+
`ClearFiltersButton` are the toolbar's own controls.
|
|
604
|
+
- `EntityListEmpty`: the built-in "Clear search" is an outline `sm` button (`xs` when compact); give a host `action` the
|
|
605
|
+
same size, or set `clearSearchSize`.
|
|
606
|
+
- `DateCell` formats in the provider's `formatLocale` when set (a cell's `locale` wins); `ImageCell` takes `bordered`
|
|
607
|
+
and `objectFit`.
|
|
608
|
+
|
|
609
|
+
## 17. Translatable texts: language tabs and limits
|
|
610
|
+
|
|
611
|
+
```tsx
|
|
612
|
+
const tabs = useEntityTranslations({ fields: ['name', 'description'], locales, defaultLocale: 'en::FORMAL',
|
|
613
|
+
tabModel: 'language', initialLocale: uiLanguageCode });
|
|
614
|
+
|
|
615
|
+
<FormTranslatableInput<Values> name="translations.name" label="Name" tabs={tabs} maxLength={80} />
|
|
616
|
+
// on submit: refuse when overLimitKeys(values.translations.name, 80).length > 0, then
|
|
617
|
+
focusFirstOverLimitTranslation(formElement);
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
- **Keys stay full** (`locale::style`, the backend's `#[Translatable]` keys). With `tabModel: 'language'` each tab edits
|
|
621
|
+
one key, chosen the same way every time (the default locale for its language, else a stored key before an offered
|
|
622
|
+
one, in `styleOrder`) and named on the tab when it is not FORMAL (`DE · Informal`); the language's other keys stay in
|
|
623
|
+
the value and go back unchanged. Every loaded key is sent back; a cleared text removes only its key.
|
|
624
|
+
- **Limits** count code points (`countCodePoints`; `countText` for another count). The counter sits under the field, an
|
|
625
|
+
over-limit tab is marked, the field is `aria-invalid`; nothing is cut and a stored value over the limit stays. The
|
|
626
|
+
host sets defaults once (`AdminUiProvider textLimits={{ singleLine: 120, multiline: 2000 }}`); a field's
|
|
627
|
+
`maxLength` wins. The helper searches only the container it gets (the form or dialog that was submitted).
|
|
628
|
+
|
|
629
|
+
## 18. Key figures — `MetricTile`, `MetricGrid`, `DeltaText`, `NoteList`
|
|
630
|
+
|
|
631
|
+
```tsx
|
|
632
|
+
<MetricGrid columns={4} isLoading={query.isLoading}>
|
|
633
|
+
<MetricTile label="Visitors" icon={<Users aria-hidden />} value={formatUiNumber(stats.visitors)}
|
|
634
|
+
delta={<DeltaText value={relativeChange(stats.visitors, stats.previousVisitors)} format="percent"
|
|
635
|
+
title="Against the previous 30 days" />}
|
|
636
|
+
hint={`Previous: ${formatUiNumber(stats.previousVisitors)}`} sparkline={<HostSparkline points={stats.series} />} />
|
|
637
|
+
<MetricTile label="Errors" value={formatUiNumber(stats.errors)} delta={<DeltaText value={stats.errorChange} preference="lower" />} />
|
|
638
|
+
</MetricGrid>
|
|
639
|
+
<NoteList notes={[{ id: 'sampled', text: 'Figures are sampled every 15 minutes.' }]} />
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
- Values come formatted (`formatUiNumber`, the host's money formatter); a tile never formats or loads.
|
|
643
|
+
- `DeltaText`: `preference="lower"` where down is good (costs, errors, durations), `"none"` where neither side is;
|
|
644
|
+
zero is neutral; `format="percent"` takes a fraction (`relativeChange`), a currency passes its code explicitly.
|
|
645
|
+
Arrow, sign and a hidden word carry the direction, never the colour alone.
|
|
646
|
+
- The sparkline is the host's chart in the `sparkline` slot; the package ships no chart library.
|
|
647
|
+
- Notes qualify the figures (sampling, a missing source); a state of the page is a `StatusCallout`.
|
|
648
|
+
- After a palette change run `ddd-admin-ui-check-contrast <built css>`: the declared pairs must reach AA in both themes.
|
|
649
|
+
|
|
650
|
+
## 19. Markdown, route states, image crop, colour values, the drawer beside the page
|
|
651
|
+
|
|
652
|
+
- **Markdown fields**: `renderEditor={renderMarkdownEditor({ rows: 12 })}` from `./markdown` (or once as
|
|
653
|
+
`AdminUiProvider.renderMarkdownEditor`); read-only text: `MarkdownPreview`, the same sanitising (raw HTML parsed, then
|
|
654
|
+
GitHub's rules plus images; a single newline is a line break). Never `dangerouslySetInnerHTML` for user markdown.
|
|
655
|
+
- **Route states**: Next `error.tsx` renders `<RouteError onRetry={reset} onReport={host report} />` inside the shell;
|
|
656
|
+
`loading.tsx` renders `<RouteLoading variant="list" | "detail" | "form" />`. Layouts above them stay mounted.
|
|
657
|
+
- **Image crop**: a picked image goes through `ImageCropDialog` (aspect options from the host, `allowSkip` for "Use
|
|
658
|
+
original"); `onResult` gives a blob for the host's upload adapter. Minimum sizes and per-use presets are checked by the
|
|
659
|
+
host on the result; heavy normalisation can run in a host worker through `output.runInWorker`, whose worker calls
|
|
660
|
+
`renderNormalizedImage`.
|
|
661
|
+
- **Colour values**: `ColorValueField` with an explicit `format` (`hex`, or `hex-alpha` when the backend stores an
|
|
662
|
+
alpha); it writes normalised values only (`#rrggbb` / `#rrggbbaa`), `null` for none with `clearable`.
|
|
663
|
+
- **Master-detail drawer**: `FormDrawer modal={false}` from `md` up (`nonModalFrom`) sits beside the page without an
|
|
664
|
+
overlay; the page stays clickable, picking another row swaps the drawer's content, a click outside never closes it.
|
|
665
|
+
Below that width it is the modal drawer.
|
|
666
|
+
- **Server texts in pickers**: `translate={false}` on `Combobox`, `QuickFilterPills` or `SegmentedControl` (and per
|
|
667
|
+
option) for names from the server; UI texts stay translated.
|
|
668
|
+
|
|
669
|
+
## 20. Framework screens — `./workers`, `./translations`
|
|
670
|
+
|
|
671
|
+
The worker monitoring and the translation admin are package screens: mount them, do not rebuild them.
|
|
672
|
+
|
|
673
|
+
```tsx
|
|
674
|
+
// once, at module scope: the operations are injected into the host's RTK Query api
|
|
675
|
+
export const workersApi = createWorkersApi({ baseApi: adminApi, apiPrefix: '/api/admin/maintenance/workers' });
|
|
676
|
+
export const translationsApi = createTranslationsApi({ baseApi: adminApi, apiPrefix: '/api/admin/common' });
|
|
677
|
+
|
|
678
|
+
<WorkersOverviewScreen api={workersApi} transportHref={transportHref} urlStateAdapter={useNextUrlStateAdapter({ listId: 'workers' })} />
|
|
679
|
+
<LocalesScreen api={translationsApi} urlStateAdapter={useNextUrlStateAdapter({ listId: 'locales' })} />
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
- Pass the host's URL adapters (`urlStateAdapter`, `drawerUrlAdapter`), so windows, tabs, filters and drawers are
|
|
683
|
+
links; without them the state is local to the screen.
|
|
684
|
+
- Gate writes with the screen's `WriteAccessProvider` like any other screen: restart, generation, toggles, imports and
|
|
685
|
+
saves follow it.
|
|
686
|
+
- A maintenance action of the host (a backfill, an import) is a `MaintenanceActionCard` (`./page`): the screen owns the
|
|
687
|
+
request and the confirmation (`useConfirm`), the card shows run, pending and the last outcome.
|
|
688
|
+
- Charts of the workers screens are the entry's SVG charts (`WorkerTimeChart`, `WorkerSparkline`): a `null` reading
|
|
689
|
+
is a gap, never a 0; no chart library is added for them.
|
|
690
|
+
## 21. Application frame — `AppShell` and one navigation
|
|
691
|
+
|
|
692
|
+
One module of the host owns the navigation tree (`NavigationItem[]`, a module constant with `m()`-marked labels); the
|
|
693
|
+
area layout renders `AppShell` with it once, so route changes keep the frame mounted. Never a second list for the
|
|
694
|
+
breadcrumbs, the mobile menu or the tab title: they all resolve the same tree.
|
|
695
|
+
|
|
696
|
+
```tsx
|
|
697
|
+
// area layout (client): the frame, its slots, the rights predicate, the entity names
|
|
698
|
+
<AppShell
|
|
699
|
+
navigation={ADMIN_NAVIGATION}
|
|
700
|
+
canAccess={canSee} // stable: useCallback over the session's rights
|
|
701
|
+
useEntityLabel={useAdminEntityLabel} // module-level hook: the page's own query per entity kind
|
|
702
|
+
collapsedStorageKey="admin.sidebar.collapsed" // one per area
|
|
703
|
+
brand={<HomeLink />}
|
|
704
|
+
topBarEnd={<><LanguageMenu … /><AccountMenu … /></>}
|
|
705
|
+
mobileMenuFooter={<AccountSummary name={user.name} />}
|
|
706
|
+
documentTitle={{ appName: t('Admin') }}
|
|
707
|
+
>
|
|
708
|
+
{children}
|
|
709
|
+
</AppShell>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
- **Crumbs live on the leaf** (`crumbs`): every page below an entry adds its segment there — `create`, `:itemId` with
|
|
713
|
+
`entity: 'item'`, the tabs as literal children. A page that is only a redirect gets `link: false`. A new entry or
|
|
714
|
+
segment in the tree gets its crumb and its title for free.
|
|
715
|
+
- **Entity names** come from the host hook with the same arguments as the page's own query (one cache entry, no extra
|
|
716
|
+
request); while it loads the crumb shows a skeleton, without a name the id.
|
|
717
|
+
- **Rights**: `canAccess` removes what the viewer may not open from the sidebar; the crumb of such a page stays as
|
|
718
|
+
text. Hiding is presentation — the server refuses the request.
|
|
719
|
+
- **Locks and badges**: `lockedReason` for a commercial lock (the entry stays a link, its page explains), `badge` only
|
|
720
|
+
for work with a deadline (a zero renders nothing).
|
|
721
|
+
- **Links and pathname** come from the provider (`linkComponent` with `withStickyParams`, `usePathname={useNextPathname}`);
|
|
722
|
+
the frame imports no router.
|
|
723
|
+
- **Background**: `ShaderBackground` from `./shell-background`, passed as `background`; a host without it never loads
|
|
724
|
+
it.
|
|
725
|
+
- **Page widths and insets** stay the page's (`PageFrame`, `EntityListPage`): `<main>` has no padding of its own.
|
|
726
|
+
|