@mgamadeus/ddd-admin-ui 0.0.0-stage → 0.1.0-rc.2
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 +159 -0
- package/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +239 -2
- package/STANDARDS.md +385 -0
- package/dist/cli/ddd-admin-ui.d.ts +3 -0
- package/dist/cli/ddd-admin-ui.d.ts.map +1 -0
- package/dist/cli/ddd-admin-ui.js +18 -0
- package/dist/cli/ddd-admin-ui.js.map +1 -0
- package/dist/cli/linkSkills.d.ts +25 -0
- package/dist/cli/linkSkills.d.ts.map +1 -0
- package/dist/cli/linkSkills.js +76 -0
- package/dist/cli/linkSkills.js.map +1 -0
- package/dist/components.css +187 -0
- package/dist/form/DrawerFooter.d.ts +18 -0
- package/dist/form/DrawerFooter.d.ts.map +1 -0
- package/dist/form/DrawerFooter.js +47 -0
- package/dist/form/DrawerFooter.js.map +1 -0
- package/dist/form/Form.d.ts +28 -0
- package/dist/form/Form.d.ts.map +1 -0
- package/dist/form/Form.js +20 -0
- package/dist/form/Form.js.map +1 -0
- package/dist/form/FormActions.d.ts +35 -0
- package/dist/form/FormActions.d.ts.map +1 -0
- package/dist/form/FormActions.js +80 -0
- package/dist/form/FormActions.js.map +1 -0
- package/dist/form/FormDrawer.d.ts +36 -0
- package/dist/form/FormDrawer.d.ts.map +1 -0
- package/dist/form/FormDrawer.js +31 -0
- package/dist/form/FormDrawer.js.map +1 -0
- package/dist/form/FormErrors.d.ts +22 -0
- package/dist/form/FormErrors.d.ts.map +1 -0
- package/dist/form/FormErrors.js +46 -0
- package/dist/form/FormErrors.js.map +1 -0
- package/dist/form/FormField.d.ts +74 -0
- package/dist/form/FormField.d.ts.map +1 -0
- package/dist/form/FormField.js +46 -0
- package/dist/form/FormField.js.map +1 -0
- package/dist/form/FormHeader.d.ts +20 -0
- package/dist/form/FormHeader.d.ts.map +1 -0
- package/dist/form/FormHeader.js +9 -0
- package/dist/form/FormHeader.js.map +1 -0
- package/dist/form/FormJumpBar.d.ts +20 -0
- package/dist/form/FormJumpBar.d.ts.map +1 -0
- package/dist/form/FormJumpBar.js +49 -0
- package/dist/form/FormJumpBar.js.map +1 -0
- package/dist/form/FormSubmitButton.d.ts +17 -0
- package/dist/form/FormSubmitButton.d.ts.map +1 -0
- package/dist/form/FormSubmitButton.js +14 -0
- package/dist/form/FormSubmitButton.js.map +1 -0
- package/dist/form/FormWrapper.d.ts +13 -0
- package/dist/form/FormWrapper.d.ts.map +1 -0
- package/dist/form/FormWrapper.js +15 -0
- package/dist/form/FormWrapper.js.map +1 -0
- package/dist/form/drawerSlots.d.ts +10 -0
- package/dist/form/drawerSlots.d.ts.map +1 -0
- package/dist/form/drawerSlots.js +7 -0
- package/dist/form/drawerSlots.js.map +1 -0
- package/dist/form/fieldLabels.d.ts +17 -0
- package/dist/form/fieldLabels.d.ts.map +1 -0
- package/dist/form/fieldLabels.js +20 -0
- package/dist/form/fieldLabels.js.map +1 -0
- package/dist/form/formPanelClasses.d.ts +3 -0
- package/dist/form/formPanelClasses.d.ts.map +1 -0
- package/dist/form/formPanelClasses.js +3 -0
- package/dist/form/formPanelClasses.js.map +1 -0
- package/dist/form/index.d.ts +58 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +34 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/useConfirmDialog.d.ts +9 -0
- package/dist/form/useConfirmDialog.d.ts.map +1 -0
- package/dist/form/useConfirmDialog.js +29 -0
- package/dist/form/useConfirmDialog.js.map +1 -0
- package/dist/glass/ActionRow.d.ts +27 -0
- package/dist/glass/ActionRow.d.ts.map +1 -0
- package/dist/glass/ActionRow.js +22 -0
- package/dist/glass/ActionRow.js.map +1 -0
- package/dist/glass/CollapsibleCard.d.ts +36 -0
- package/dist/glass/CollapsibleCard.d.ts.map +1 -0
- package/dist/glass/CollapsibleCard.js +27 -0
- package/dist/glass/CollapsibleCard.js.map +1 -0
- package/dist/glass/GlassGroup.d.ts +26 -0
- package/dist/glass/GlassGroup.d.ts.map +1 -0
- package/dist/glass/GlassGroup.js +34 -0
- package/dist/glass/GlassGroup.js.map +1 -0
- package/dist/glass/GlassPill.d.ts +23 -0
- package/dist/glass/GlassPill.d.ts.map +1 -0
- package/dist/glass/GlassPill.js +20 -0
- package/dist/glass/GlassPill.js.map +1 -0
- package/dist/glass/QuickFilterPills.d.ts +38 -0
- package/dist/glass/QuickFilterPills.d.ts.map +1 -0
- package/dist/glass/QuickFilterPills.js +30 -0
- package/dist/glass/QuickFilterPills.js.map +1 -0
- package/dist/glass/index.d.ts +11 -0
- package/dist/glass/index.d.ts.map +1 -0
- package/dist/glass/index.js +7 -0
- package/dist/glass/index.js.map +1 -0
- package/dist/i18n/Translate.d.ts +8 -0
- package/dist/i18n/Translate.d.ts.map +1 -0
- package/dist/i18n/Translate.js +9 -0
- package/dist/i18n/Translate.js.map +1 -0
- package/dist/i18n/format.d.ts +13 -0
- package/dist/i18n/format.d.ts.map +1 -0
- package/dist/i18n/format.js +15 -0
- package/dist/i18n/format.js.map +1 -0
- package/dist/i18n/hints.json +130 -0
- package/dist/i18n/index.d.ts +7 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +7 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/localeFormat.d.ts +10 -0
- package/dist/i18n/localeFormat.d.ts.map +1 -0
- package/dist/i18n/localeFormat.js +36 -0
- package/dist/i18n/localeFormat.js.map +1 -0
- package/dist/i18n/plural.d.ts +15 -0
- package/dist/i18n/plural.d.ts.map +1 -0
- package/dist/i18n/plural.js +95 -0
- package/dist/i18n/plural.js.map +1 -0
- package/dist/i18n/serverMessages.d.ts +26 -0
- package/dist/i18n/serverMessages.d.ts.map +1 -0
- package/dist/i18n/serverMessages.js +146 -0
- package/dist/i18n/serverMessages.js.map +1 -0
- package/dist/i18n/store.d.ts +36 -0
- package/dist/i18n/store.d.ts.map +1 -0
- package/dist/i18n/store.js +36 -0
- package/dist/i18n/store.js.map +1 -0
- package/dist/i18n/useTranslate.d.ts +17 -0
- package/dist/i18n/useTranslate.d.ts.map +1 -0
- package/dist/i18n/useTranslate.js +22 -0
- package/dist/i18n/useTranslate.js.map +1 -0
- package/dist/i18n-keys.json +1069 -0
- package/dist/list/ChipToggleGroup.d.ts +36 -0
- package/dist/list/ChipToggleGroup.d.ts.map +1 -0
- package/dist/list/ChipToggleGroup.js +34 -0
- package/dist/list/ChipToggleGroup.js.map +1 -0
- package/dist/list/Combobox.d.ts +32 -0
- package/dist/list/Combobox.d.ts.map +1 -0
- package/dist/list/Combobox.js +27 -0
- package/dist/list/Combobox.js.map +1 -0
- package/dist/list/EmptyValue.d.ts +14 -0
- package/dist/list/EmptyValue.d.ts.map +1 -0
- package/dist/list/EmptyValue.js +11 -0
- package/dist/list/EmptyValue.js.map +1 -0
- package/dist/list/EntityListBody.d.ts +27 -0
- package/dist/list/EntityListBody.d.ts.map +1 -0
- package/dist/list/EntityListBody.js +24 -0
- package/dist/list/EntityListBody.js.map +1 -0
- package/dist/list/EntityListBulkBar.d.ts +38 -0
- package/dist/list/EntityListBulkBar.d.ts.map +1 -0
- package/dist/list/EntityListBulkBar.js +19 -0
- package/dist/list/EntityListBulkBar.js.map +1 -0
- package/dist/list/EntityListCard.d.ts +22 -0
- package/dist/list/EntityListCard.d.ts.map +1 -0
- package/dist/list/EntityListCard.js +15 -0
- package/dist/list/EntityListCard.js.map +1 -0
- package/dist/list/EntityListEmpty.d.ts +13 -0
- package/dist/list/EntityListEmpty.d.ts.map +1 -0
- package/dist/list/EntityListEmpty.js +11 -0
- package/dist/list/EntityListEmpty.js.map +1 -0
- package/dist/list/EntityListGrid.d.ts +29 -0
- package/dist/list/EntityListGrid.d.ts.map +1 -0
- package/dist/list/EntityListGrid.js +21 -0
- package/dist/list/EntityListGrid.js.map +1 -0
- package/dist/list/EntityListLoadMore.d.ts +15 -0
- package/dist/list/EntityListLoadMore.d.ts.map +1 -0
- package/dist/list/EntityListLoadMore.js +27 -0
- package/dist/list/EntityListLoadMore.js.map +1 -0
- package/dist/list/EntityListStatus.d.ts +11 -0
- package/dist/list/EntityListStatus.d.ts.map +1 -0
- package/dist/list/EntityListStatus.js +22 -0
- package/dist/list/EntityListStatus.js.map +1 -0
- package/dist/list/EntityListTable.d.ts +34 -0
- package/dist/list/EntityListTable.d.ts.map +1 -0
- package/dist/list/EntityListTable.js +43 -0
- package/dist/list/EntityListTable.js.map +1 -0
- package/dist/list/EntityListToolbar.d.ts +39 -0
- package/dist/list/EntityListToolbar.d.ts.map +1 -0
- package/dist/list/EntityListToolbar.js +25 -0
- package/dist/list/EntityListToolbar.js.map +1 -0
- package/dist/list/EntityListViewToggle.d.ts +17 -0
- package/dist/list/EntityListViewToggle.d.ts.map +1 -0
- package/dist/list/EntityListViewToggle.js +38 -0
- package/dist/list/EntityListViewToggle.js.map +1 -0
- package/dist/list/MultiSelect.d.ts +33 -0
- package/dist/list/MultiSelect.d.ts.map +1 -0
- package/dist/list/MultiSelect.js +60 -0
- package/dist/list/MultiSelect.js.map +1 -0
- package/dist/list/SearchField.d.ts +24 -0
- package/dist/list/SearchField.d.ts.map +1 -0
- package/dist/list/SearchField.js +42 -0
- package/dist/list/SearchField.js.map +1 -0
- package/dist/list/StatusBadge.d.ts +34 -0
- package/dist/list/StatusBadge.d.ts.map +1 -0
- package/dist/list/StatusBadge.js +44 -0
- package/dist/list/StatusBadge.js.map +1 -0
- package/dist/list/Tag.d.ts +16 -0
- package/dist/list/Tag.d.ts.map +1 -0
- package/dist/list/Tag.js +15 -0
- package/dist/list/Tag.js.map +1 -0
- package/dist/list/cells.d.ts +53 -0
- package/dist/list/cells.d.ts.map +1 -0
- package/dist/list/cells.js +62 -0
- package/dist/list/cells.js.map +1 -0
- package/dist/list/filterClasses.d.ts +8 -0
- package/dist/list/filterClasses.d.ts.map +1 -0
- package/dist/list/filterClasses.js +8 -0
- package/dist/list/filterClasses.js.map +1 -0
- package/dist/list/filterOptions.d.ts +7 -0
- package/dist/list/filterOptions.d.ts.map +1 -0
- package/dist/list/filterOptions.js +7 -0
- package/dist/list/filterOptions.js.map +1 -0
- package/dist/list/filters.d.ts +78 -0
- package/dist/list/filters.d.ts.map +1 -0
- package/dist/list/filters.js +54 -0
- package/dist/list/filters.js.map +1 -0
- package/dist/list/index.d.ts +89 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/index.js +51 -0
- package/dist/list/index.js.map +1 -0
- package/dist/list/types.d.ts +59 -0
- package/dist/list/types.d.ts.map +1 -0
- package/dist/list/types.js +3 -0
- package/dist/list/types.js.map +1 -0
- package/dist/logic/browser/prepareImageFile.d.ts +18 -0
- package/dist/logic/browser/prepareImageFile.d.ts.map +1 -0
- package/dist/logic/browser/prepareImageFile.js +26 -0
- package/dist/logic/browser/prepareImageFile.js.map +1 -0
- package/dist/logic/index.d.ts +57 -0
- package/dist/logic/index.d.ts.map +1 -0
- package/dist/logic/index.js +39 -0
- package/dist/logic/index.js.map +1 -0
- package/dist/logic/pure/conditions.d.ts +46 -0
- package/dist/logic/pure/conditions.d.ts.map +1 -0
- package/dist/logic/pure/conditions.js +39 -0
- package/dist/logic/pure/conditions.js.map +1 -0
- package/dist/logic/pure/confirm.d.ts +19 -0
- package/dist/logic/pure/confirm.d.ts.map +1 -0
- package/dist/logic/pure/confirm.js +10 -0
- package/dist/logic/pure/confirm.js.map +1 -0
- package/dist/logic/pure/displayMode.d.ts +12 -0
- package/dist/logic/pure/displayMode.d.ts.map +1 -0
- package/dist/logic/pure/displayMode.js +11 -0
- package/dist/logic/pure/displayMode.js.map +1 -0
- package/dist/logic/pure/entityDrawer.d.ts +24 -0
- package/dist/logic/pure/entityDrawer.d.ts.map +1 -0
- package/dist/logic/pure/entityDrawer.js +3 -0
- package/dist/logic/pure/entityDrawer.js.map +1 -0
- package/dist/logic/pure/fieldPath.d.ts +9 -0
- package/dist/logic/pure/fieldPath.d.ts.map +1 -0
- package/dist/logic/pure/fieldPath.js +17 -0
- package/dist/logic/pure/fieldPath.js.map +1 -0
- package/dist/logic/pure/formValues.d.ts +14 -0
- package/dist/logic/pure/formValues.d.ts.map +1 -0
- package/dist/logic/pure/formValues.js +82 -0
- package/dist/logic/pure/formValues.js.map +1 -0
- package/dist/logic/pure/format.d.ts +15 -0
- package/dist/logic/pure/format.d.ts.map +1 -0
- package/dist/logic/pure/format.js +53 -0
- package/dist/logic/pure/format.js.map +1 -0
- package/dist/logic/pure/locales.d.ts +27 -0
- package/dist/logic/pure/locales.d.ts.map +1 -0
- package/dist/logic/pure/locales.js +50 -0
- package/dist/logic/pure/locales.js.map +1 -0
- package/dist/logic/pure/notify.d.ts +42 -0
- package/dist/logic/pure/notify.d.ts.map +1 -0
- package/dist/logic/pure/notify.js +52 -0
- package/dist/logic/pure/notify.js.map +1 -0
- package/dist/logic/pure/rowActivation.d.ts +6 -0
- package/dist/logic/pure/rowActivation.d.ts.map +1 -0
- package/dist/logic/pure/rowActivation.js +7 -0
- package/dist/logic/pure/rowActivation.js.map +1 -0
- package/dist/logic/pure/runSequential.d.ts +31 -0
- package/dist/logic/pure/runSequential.d.ts.map +1 -0
- package/dist/logic/pure/runSequential.js +47 -0
- package/dist/logic/pure/runSequential.js.map +1 -0
- package/dist/logic/pure/schemas.d.ts +14 -0
- package/dist/logic/pure/schemas.d.ts.map +1 -0
- package/dist/logic/pure/schemas.js +6 -0
- package/dist/logic/pure/schemas.js.map +1 -0
- package/dist/logic/pure/serverViolations.d.ts +35 -0
- package/dist/logic/pure/serverViolations.d.ts.map +1 -0
- package/dist/logic/pure/serverViolations.js +77 -0
- package/dist/logic/pure/serverViolations.js.map +1 -0
- package/dist/logic/pure/status.d.ts +21 -0
- package/dist/logic/pure/status.d.ts.map +1 -0
- package/dist/logic/pure/status.js +3 -0
- package/dist/logic/pure/status.js.map +1 -0
- package/dist/logic/pure/submitError.d.ts +11 -0
- package/dist/logic/pure/submitError.d.ts.map +1 -0
- package/dist/logic/pure/submitError.js +9 -0
- package/dist/logic/pure/submitError.js.map +1 -0
- package/dist/logic/pure/translationState.d.ts +29 -0
- package/dist/logic/pure/translationState.d.ts.map +1 -0
- package/dist/logic/pure/translationState.js +88 -0
- package/dist/logic/pure/translationState.js.map +1 -0
- package/dist/logic/pure/urlListState.d.ts +18 -0
- package/dist/logic/pure/urlListState.d.ts.map +1 -0
- package/dist/logic/pure/urlListState.js +3 -0
- package/dist/logic/pure/urlListState.js.map +1 -0
- package/dist/logic/react/conditionHooks.d.ts +20 -0
- package/dist/logic/react/conditionHooks.d.ts.map +1 -0
- package/dist/logic/react/conditionHooks.js +51 -0
- package/dist/logic/react/conditionHooks.js.map +1 -0
- package/dist/logic/react/useCopyToClipboard.d.ts +9 -0
- package/dist/logic/react/useCopyToClipboard.d.ts.map +1 -0
- package/dist/logic/react/useCopyToClipboard.js +28 -0
- package/dist/logic/react/useCopyToClipboard.js.map +1 -0
- package/dist/logic/react/useDebouncedValue.d.ts +3 -0
- package/dist/logic/react/useDebouncedValue.d.ts.map +1 -0
- package/dist/logic/react/useDebouncedValue.js +12 -0
- package/dist/logic/react/useDebouncedValue.js.map +1 -0
- package/dist/logic/react/useEntityDrawer.d.ts +54 -0
- package/dist/logic/react/useEntityDrawer.d.ts.map +1 -0
- package/dist/logic/react/useEntityDrawer.js +81 -0
- package/dist/logic/react/useEntityDrawer.js.map +1 -0
- package/dist/logic/react/useEntityTranslations.d.ts +57 -0
- package/dist/logic/react/useEntityTranslations.d.ts.map +1 -0
- package/dist/logic/react/useEntityTranslations.js +50 -0
- package/dist/logic/react/useEntityTranslations.js.map +1 -0
- package/dist/logic/react/useFormDirty.d.ts +15 -0
- package/dist/logic/react/useFormDirty.d.ts.map +1 -0
- package/dist/logic/react/useFormDirty.js +17 -0
- package/dist/logic/react/useFormDirty.js.map +1 -0
- package/dist/logic/react/useGrowingWindowList.d.ts +50 -0
- package/dist/logic/react/useGrowingWindowList.d.ts.map +1 -0
- package/dist/logic/react/useGrowingWindowList.js +38 -0
- package/dist/logic/react/useGrowingWindowList.js.map +1 -0
- package/dist/logic/react/useHydrated.d.ts +7 -0
- package/dist/logic/react/useHydrated.d.ts.map +1 -0
- package/dist/logic/react/useHydrated.js +12 -0
- package/dist/logic/react/useHydrated.js.map +1 -0
- package/dist/logic/react/useInfiniteScrollSentinel.d.ts +6 -0
- package/dist/logic/react/useInfiniteScrollSentinel.d.ts.map +1 -0
- package/dist/logic/react/useInfiniteScrollSentinel.js +24 -0
- package/dist/logic/react/useInfiniteScrollSentinel.js.map +1 -0
- package/dist/logic/react/useLocaleName.d.ts +3 -0
- package/dist/logic/react/useLocaleName.d.ts.map +1 -0
- package/dist/logic/react/useLocaleName.js +10 -0
- package/dist/logic/react/useLocaleName.js.map +1 -0
- package/dist/logic/react/useRowActivation.d.ts +12 -0
- package/dist/logic/react/useRowActivation.d.ts.map +1 -0
- package/dist/logic/react/useRowActivation.js +35 -0
- package/dist/logic/react/useRowActivation.js.map +1 -0
- package/dist/logic/react/useRowSelection.d.ts +40 -0
- package/dist/logic/react/useRowSelection.d.ts.map +1 -0
- package/dist/logic/react/useRowSelection.js +70 -0
- package/dist/logic/react/useRowSelection.js.map +1 -0
- package/dist/logic/react/useTranslationRunner.d.ts +27 -0
- package/dist/logic/react/useTranslationRunner.d.ts.map +1 -0
- package/dist/logic/react/useTranslationRunner.js +57 -0
- package/dist/logic/react/useTranslationRunner.js.map +1 -0
- package/dist/logic/react/useUnsavedChangesGuard.d.ts +30 -0
- package/dist/logic/react/useUnsavedChangesGuard.d.ts.map +1 -0
- package/dist/logic/react/useUnsavedChangesGuard.js +66 -0
- package/dist/logic/react/useUnsavedChangesGuard.js.map +1 -0
- package/dist/logic/react/useUrlListState.d.ts +39 -0
- package/dist/logic/react/useUrlListState.d.ts.map +1 -0
- package/dist/logic/react/useUrlListState.js +96 -0
- package/dist/logic/react/useUrlListState.js.map +1 -0
- package/dist/media/FormMediaItemField.d.ts +38 -0
- package/dist/media/FormMediaItemField.d.ts.map +1 -0
- package/dist/media/FormMediaItemField.js +35 -0
- package/dist/media/FormMediaItemField.js.map +1 -0
- package/dist/media/MediaItemField.d.ts +20 -0
- package/dist/media/MediaItemField.d.ts.map +1 -0
- package/dist/media/MediaItemField.js +15 -0
- package/dist/media/MediaItemField.js.map +1 -0
- package/dist/media/MediaItemPickerDialog.d.ts +48 -0
- package/dist/media/MediaItemPickerDialog.d.ts.map +1 -0
- package/dist/media/MediaItemPickerDialog.js +36 -0
- package/dist/media/MediaItemPickerDialog.js.map +1 -0
- package/dist/media/MediaPreview.d.ts +16 -0
- package/dist/media/MediaPreview.d.ts.map +1 -0
- package/dist/media/MediaPreview.js +20 -0
- package/dist/media/MediaPreview.js.map +1 -0
- package/dist/media/index.d.ts +18 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +9 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/types.d.ts +24 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +2 -0
- package/dist/media/types.js.map +1 -0
- package/dist/next/index.d.ts +8 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +8 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/listViewParam.d.ts +3 -0
- package/dist/next/listViewParam.d.ts.map +1 -0
- package/dist/next/listViewParam.js +3 -0
- package/dist/next/listViewParam.js.map +1 -0
- package/dist/next/searchParamsWriter.d.ts +31 -0
- package/dist/next/searchParamsWriter.d.ts.map +1 -0
- package/dist/next/searchParamsWriter.js +87 -0
- package/dist/next/searchParamsWriter.js.map +1 -0
- package/dist/next/storage.d.ts +11 -0
- package/dist/next/storage.d.ts.map +1 -0
- package/dist/next/storage.js +34 -0
- package/dist/next/storage.js.map +1 -0
- package/dist/next/useListViewParam.d.ts +12 -0
- package/dist/next/useListViewParam.d.ts.map +1 -0
- package/dist/next/useListViewParam.js +45 -0
- package/dist/next/useListViewParam.js.map +1 -0
- package/dist/next/useNextDrawerUrlAdapter.d.ts +11 -0
- package/dist/next/useNextDrawerUrlAdapter.d.ts.map +1 -0
- package/dist/next/useNextDrawerUrlAdapter.js +28 -0
- package/dist/next/useNextDrawerUrlAdapter.js.map +1 -0
- package/dist/next/useNextUrlStateAdapter.d.ts +20 -0
- package/dist/next/useNextUrlStateAdapter.d.ts.map +1 -0
- package/dist/next/useNextUrlStateAdapter.js +28 -0
- package/dist/next/useNextUrlStateAdapter.js.map +1 -0
- package/dist/notify-sonner/Toaster.d.ts +8 -0
- package/dist/notify-sonner/Toaster.d.ts.map +1 -0
- package/dist/notify-sonner/Toaster.js +24 -0
- package/dist/notify-sonner/Toaster.js.map +1 -0
- package/dist/notify-sonner/index.d.ts +3 -0
- package/dist/notify-sonner/index.d.ts.map +1 -0
- package/dist/notify-sonner/index.js +4 -0
- package/dist/notify-sonner/index.js.map +1 -0
- package/dist/notify-sonner/sonnerNotifications.d.ts +4 -0
- package/dist/notify-sonner/sonnerNotifications.d.ts.map +1 -0
- package/dist/notify-sonner/sonnerNotifications.js +29 -0
- package/dist/notify-sonner/sonnerNotifications.js.map +1 -0
- package/dist/page/DefinitionList.d.ts +24 -0
- package/dist/page/DefinitionList.d.ts.map +1 -0
- package/dist/page/DefinitionList.js +20 -0
- package/dist/page/DefinitionList.js.map +1 -0
- package/dist/page/DetailHeader.d.ts +26 -0
- package/dist/page/DetailHeader.d.ts.map +1 -0
- package/dist/page/DetailHeader.js +14 -0
- package/dist/page/DetailHeader.js.map +1 -0
- package/dist/page/EditableCard.d.ts +39 -0
- package/dist/page/EditableCard.d.ts.map +1 -0
- package/dist/page/EditableCard.js +21 -0
- package/dist/page/EditableCard.js.map +1 -0
- package/dist/page/EntityDetailShell.d.ts +48 -0
- package/dist/page/EntityDetailShell.d.ts.map +1 -0
- package/dist/page/EntityDetailShell.js +25 -0
- package/dist/page/EntityDetailShell.js.map +1 -0
- package/dist/page/EntityListPage.d.ts +30 -0
- package/dist/page/EntityListPage.d.ts.map +1 -0
- package/dist/page/EntityListPage.js +12 -0
- package/dist/page/EntityListPage.js.map +1 -0
- package/dist/page/EntityMetadata.d.ts +21 -0
- package/dist/page/EntityMetadata.d.ts.map +1 -0
- package/dist/page/EntityMetadata.js +39 -0
- package/dist/page/EntityMetadata.js.map +1 -0
- package/dist/page/EntityTabs.d.ts +38 -0
- package/dist/page/EntityTabs.d.ts.map +1 -0
- package/dist/page/EntityTabs.js +51 -0
- package/dist/page/EntityTabs.js.map +1 -0
- package/dist/page/PageFrame.d.ts +25 -0
- package/dist/page/PageFrame.d.ts.map +1 -0
- package/dist/page/PageFrame.js +11 -0
- package/dist/page/PageFrame.js.map +1 -0
- package/dist/page/PageHeader.d.ts +27 -0
- package/dist/page/PageHeader.d.ts.map +1 -0
- package/dist/page/PageHeader.js +16 -0
- package/dist/page/PageHeader.js.map +1 -0
- package/dist/page/PageLayout.d.ts +15 -0
- package/dist/page/PageLayout.d.ts.map +1 -0
- package/dist/page/PageLayout.js +10 -0
- package/dist/page/PageLayout.js.map +1 -0
- package/dist/page/PageToolbar.d.ts +73 -0
- package/dist/page/PageToolbar.d.ts.map +1 -0
- package/dist/page/PageToolbar.js +49 -0
- package/dist/page/PageToolbar.js.map +1 -0
- package/dist/page/SectionHeader.d.ts +27 -0
- package/dist/page/SectionHeader.d.ts.map +1 -0
- package/dist/page/SectionHeader.js +14 -0
- package/dist/page/SectionHeader.js.map +1 -0
- package/dist/page/StatusCallout.d.ts +28 -0
- package/dist/page/StatusCallout.d.ts.map +1 -0
- package/dist/page/StatusCallout.js +35 -0
- package/dist/page/StatusCallout.js.map +1 -0
- package/dist/page/index.d.ts +29 -0
- package/dist/page/index.d.ts.map +1 -0
- package/dist/page/index.js +20 -0
- package/dist/page/index.js.map +1 -0
- package/dist/page/links.d.ts +18 -0
- package/dist/page/links.d.ts.map +1 -0
- package/dist/page/links.js +4 -0
- package/dist/page/links.js.map +1 -0
- package/dist/primitives/alert.d.ts +17 -0
- package/dist/primitives/alert.d.ts.map +1 -0
- package/dist/primitives/alert.js +36 -0
- package/dist/primitives/alert.js.map +1 -0
- package/dist/primitives/badge.d.ts +10 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +30 -0
- package/dist/primitives/badge.js.map +1 -0
- package/dist/primitives/breadcrumb.d.ts +12 -0
- package/dist/primitives/breadcrumb.d.ts.map +1 -0
- package/dist/primitives/breadcrumb.js +33 -0
- package/dist/primitives/breadcrumb.js.map +1 -0
- package/dist/primitives/button.d.ts +12 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +51 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/card.d.ts +10 -0
- package/dist/primitives/card.d.ts.map +1 -0
- package/dist/primitives/card.js +29 -0
- package/dist/primitives/card.js.map +1 -0
- package/dist/primitives/checkbox.d.ts +5 -0
- package/dist/primitives/checkbox.d.ts.map +1 -0
- package/dist/primitives/checkbox.js +11 -0
- package/dist/primitives/checkbox.js.map +1 -0
- package/dist/primitives/cn.d.ts +4 -0
- package/dist/primitives/cn.d.ts.map +1 -0
- package/dist/primitives/cn.js +5 -0
- package/dist/primitives/cn.js.map +1 -0
- package/dist/primitives/collapsible.d.ts +6 -0
- package/dist/primitives/collapsible.d.ts.map +1 -0
- package/dist/primitives/collapsible.js +14 -0
- package/dist/primitives/collapsible.js.map +1 -0
- package/dist/primitives/command.d.ts +19 -0
- package/dist/primitives/command.d.ts.map +1 -0
- package/dist/primitives/command.js +38 -0
- package/dist/primitives/command.js.map +1 -0
- package/dist/primitives/dialog.d.ts +18 -0
- package/dist/primitives/dialog.d.ts.map +1 -0
- package/dist/primitives/dialog.js +44 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/dropdown-menu.d.ts +23 -0
- package/dist/primitives/dropdown-menu.d.ts.map +1 -0
- package/dist/primitives/dropdown-menu.js +48 -0
- package/dist/primitives/dropdown-menu.js.map +1 -0
- package/dist/primitives/fieldSurface.d.ts +23 -0
- package/dist/primitives/fieldSurface.d.ts.map +1 -0
- package/dist/primitives/fieldSurface.js +23 -0
- package/dist/primitives/fieldSurface.js.map +1 -0
- package/dist/primitives/index.d.ts +26 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +27 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/input.d.ts +12 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +20 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/label.d.ts +5 -0
- package/dist/primitives/label.d.ts.map +1 -0
- package/dist/primitives/label.js +10 -0
- package/dist/primitives/label.js.map +1 -0
- package/dist/primitives/listSurface.d.ts +8 -0
- package/dist/primitives/listSurface.d.ts.map +1 -0
- package/dist/primitives/listSurface.js +8 -0
- package/dist/primitives/listSurface.js.map +1 -0
- package/dist/primitives/popover.d.ts +11 -0
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/primitives/popover.js +31 -0
- package/dist/primitives/popover.js.map +1 -0
- package/dist/primitives/portal.d.ts +16 -0
- package/dist/primitives/portal.d.ts.map +1 -0
- package/dist/primitives/portal.js +9 -0
- package/dist/primitives/portal.js.map +1 -0
- package/dist/primitives/select.d.ts +21 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +50 -0
- package/dist/primitives/select.js.map +1 -0
- package/dist/primitives/separator.d.ts +5 -0
- package/dist/primitives/separator.d.ts.map +1 -0
- package/dist/primitives/separator.js +10 -0
- package/dist/primitives/separator.js.map +1 -0
- package/dist/primitives/sheet.d.ts +15 -0
- package/dist/primitives/sheet.d.ts.map +1 -0
- package/dist/primitives/sheet.js +46 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/primitives/skeleton.d.ts +3 -0
- package/dist/primitives/skeleton.d.ts.map +1 -0
- package/dist/primitives/skeleton.js +7 -0
- package/dist/primitives/skeleton.js.map +1 -0
- package/dist/primitives/switch.d.ts +7 -0
- package/dist/primitives/switch.d.ts.map +1 -0
- package/dist/primitives/switch.js +10 -0
- package/dist/primitives/switch.js.map +1 -0
- package/dist/primitives/table.d.ts +11 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/table.js +30 -0
- package/dist/primitives/table.js.map +1 -0
- package/dist/primitives/textarea.d.ts +4 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +11 -0
- package/dist/primitives/textarea.js.map +1 -0
- package/dist/primitives/tooltip.d.ts +8 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip.js +21 -0
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/provider/AdminUiProvider.d.ts +9 -0
- package/dist/provider/AdminUiProvider.d.ts.map +1 -0
- package/dist/provider/AdminUiProvider.js +47 -0
- package/dist/provider/AdminUiProvider.js.map +1 -0
- package/dist/provider/adminUiContext.d.ts +6 -0
- package/dist/provider/adminUiContext.d.ts.map +1 -0
- package/dist/provider/adminUiContext.js +9 -0
- package/dist/provider/adminUiContext.js.map +1 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +5 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/storageKey.d.ts +4 -0
- package/dist/provider/storageKey.d.ts.map +1 -0
- package/dist/provider/storageKey.js +3 -0
- package/dist/provider/storageKey.js.map +1 -0
- package/dist/provider/types.d.ts +65 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +2 -0
- package/dist/provider/types.js.map +1 -0
- package/dist/scripts/build-i18n-manifest.mjs +138 -0
- package/dist/scripts/check-radix.mjs +131 -0
- package/dist/scripts/check-tokens.mjs +236 -0
- package/dist/theme.css +48 -0
- package/dist/tokens.json +401 -0
- package/dist/translations/FormTranslatableFields.d.ts +30 -0
- package/dist/translations/FormTranslatableFields.d.ts.map +1 -0
- package/dist/translations/FormTranslatableFields.js +58 -0
- package/dist/translations/FormTranslatableFields.js.map +1 -0
- package/dist/translations/TranslatableField.d.ts +48 -0
- package/dist/translations/TranslatableField.d.ts.map +1 -0
- package/dist/translations/TranslatableField.js +44 -0
- package/dist/translations/TranslatableField.js.map +1 -0
- package/dist/translations/TranslatableInput.d.ts +14 -0
- package/dist/translations/TranslatableInput.d.ts.map +1 -0
- package/dist/translations/TranslatableInput.js +15 -0
- package/dist/translations/TranslatableInput.js.map +1 -0
- package/dist/translations/TranslatableMarkdown.d.ts +21 -0
- package/dist/translations/TranslatableMarkdown.d.ts.map +1 -0
- package/dist/translations/TranslatableMarkdown.js +12 -0
- package/dist/translations/TranslatableMarkdown.js.map +1 -0
- package/dist/translations/TranslationControls.d.ts +22 -0
- package/dist/translations/TranslationControls.d.ts.map +1 -0
- package/dist/translations/TranslationControls.js +31 -0
- package/dist/translations/TranslationControls.js.map +1 -0
- package/dist/translations/index.d.ts +31 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +18 -0
- package/dist/translations/index.js.map +1 -0
- package/package.json +156 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type WritingStyle } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
/**
|
|
3
|
+
* One tab of a translatable field. `key` is the FULL translation key as the backend stores it (`en::FORMAL`,
|
|
4
|
+
* `de::INFORMAL`, `de:at:FORMAL`) — never collapsed to the language: `de::FORMAL` and `de::INFORMAL` are two texts.
|
|
5
|
+
*/
|
|
6
|
+
export interface TranslatableLocale {
|
|
7
|
+
key: string;
|
|
8
|
+
languageCode: string;
|
|
9
|
+
writingStyle: WritingStyle;
|
|
10
|
+
/** Short tab label: `DE`, `DE-AT`, `DE · Informal`. */
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
/** Splits a full key; a key that is not `<language>:<country>:<style>` is kept as a FORMAL entry of its own text. */
|
|
14
|
+
export declare const toTranslatableLocale: (key: string) => TranslatableLocale;
|
|
15
|
+
/**
|
|
16
|
+
* The tabs a form shows: every offered locale plus every key the loaded entity already has (so a stored
|
|
17
|
+
* `de::INFORMAL` text is visible and editable, and never silently dropped), the default locale first, then the
|
|
18
|
+
* offered order, then extra stored keys alphabetically.
|
|
19
|
+
*/
|
|
20
|
+
export declare const mergeLocaleKeys: (defaultLocale: string, offered: readonly string[], stored: readonly string[]) => TranslatableLocale[];
|
|
21
|
+
/**
|
|
22
|
+
* The spelled-out name of a translation key for tooltips, in the UI language: `de::INFORMAL` → "Deutsch · Informell"
|
|
23
|
+
* (UI German), `de:at:FORMAL` → "German (Austria)". The writing style is named only for INFORMAL (FORMAL is the default
|
|
24
|
+
* of every content text). `informalLabel` is "Informal" (the caller passes its `t`).
|
|
25
|
+
*/
|
|
26
|
+
export declare const localeDisplayName: (key: string, uiLanguageCode: string, informalLabel: string) => string;
|
|
27
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/locales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qHAAqH;AACrH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,kBAYlD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,eAAe,MAAM,EACrB,SAAS,SAAS,MAAM,EAAE,EAC1B,QAAQ,SAAS,MAAM,EAAE,KACxB,kBAAkB,EAKpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,gBAAgB,MAAM,EAAE,eAAe,MAAM,KAAG,MAa9F,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { parseTranslationKey } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
/** Splits a full key; a key that is not `<language>:<country>:<style>` is kept as a FORMAL entry of its own text. */
|
|
3
|
+
export const toTranslatableLocale = (key) => {
|
|
4
|
+
const parts = parseTranslationKey(key);
|
|
5
|
+
if (!parts)
|
|
6
|
+
return { key, languageCode: key, writingStyle: 'FORMAL', label: key.toUpperCase() };
|
|
7
|
+
const language = parts.countryCode
|
|
8
|
+
? `${parts.languageCode}-${parts.countryCode}`.toUpperCase()
|
|
9
|
+
: parts.languageCode.toUpperCase();
|
|
10
|
+
return {
|
|
11
|
+
key,
|
|
12
|
+
languageCode: parts.languageCode,
|
|
13
|
+
writingStyle: parts.writingStyle,
|
|
14
|
+
label: parts.writingStyle === 'INFORMAL' ? `${language} · Informal` : language,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The tabs a form shows: every offered locale plus every key the loaded entity already has (so a stored
|
|
19
|
+
* `de::INFORMAL` text is visible and editable, and never silently dropped), the default locale first, then the
|
|
20
|
+
* offered order, then extra stored keys alphabetically.
|
|
21
|
+
*/
|
|
22
|
+
export const mergeLocaleKeys = (defaultLocale, offered, stored) => {
|
|
23
|
+
const keys = [defaultLocale];
|
|
24
|
+
for (const key of offered)
|
|
25
|
+
if (!keys.includes(key))
|
|
26
|
+
keys.push(key);
|
|
27
|
+
for (const key of [...stored].sort())
|
|
28
|
+
if (!keys.includes(key))
|
|
29
|
+
keys.push(key);
|
|
30
|
+
return keys.map(toTranslatableLocale);
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The spelled-out name of a translation key for tooltips, in the UI language: `de::INFORMAL` → "Deutsch · Informell"
|
|
34
|
+
* (UI German), `de:at:FORMAL` → "German (Austria)". The writing style is named only for INFORMAL (FORMAL is the default
|
|
35
|
+
* of every content text). `informalLabel` is "Informal" (the caller passes its `t`).
|
|
36
|
+
*/
|
|
37
|
+
export const localeDisplayName = (key, uiLanguageCode, informalLabel) => {
|
|
38
|
+
const parts = parseTranslationKey(key);
|
|
39
|
+
const languageCode = parts?.languageCode ?? key.split(':')[0];
|
|
40
|
+
let name = languageCode.toUpperCase();
|
|
41
|
+
try {
|
|
42
|
+
name =
|
|
43
|
+
new Intl.DisplayNames([uiLanguageCode], { type: 'language' }).of(parts?.countryCode ? `${languageCode}-${parts.countryCode.toUpperCase()}` : languageCode) ?? name;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// an unknown code: the short label stays
|
|
47
|
+
}
|
|
48
|
+
return parts?.writingStyle === 'INFORMAL' ? `${name} · ${informalLabel}` : name;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../../src/logic/pure/locales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAqB,MAAM,6BAA6B,CAAC;AAcrF,qHAAqH;AACrH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAsB,EAAE;IACtE,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;IAChG,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW;QAChC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE;QAC5D,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO;QACL,GAAG;QACH,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,KAAK,EAAE,KAAK,CAAC,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG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AC;IAAC,MAAM,CAAC;QACP,yCAAyC;IAC3C,CAAC;IACD,OAAO,KAAK,EAAE,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClF,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FormSubmitError } from './submitError.js';
|
|
2
|
+
/** The options every toast system understands. A host adapter maps them onto its own toast API. */
|
|
3
|
+
export interface NotifyOptions {
|
|
4
|
+
/** A toast with the same id replaces the one shown (a `loading` progress becomes its `success` / `error`). */
|
|
5
|
+
id?: string | number;
|
|
6
|
+
/** A second, muted line under the message. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Milliseconds until the toast closes by itself; the adapter's default when left out. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** One button in the toast (e.g. "Undo", "Open"); the toast closes after the click. */
|
|
11
|
+
action?: NotifyAction;
|
|
12
|
+
}
|
|
13
|
+
export interface NotifyAction {
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** What `notify` and `runSequentialWithSummary` need from a toast system. Every call answers the toast's id. */
|
|
18
|
+
export interface NotificationAdapter {
|
|
19
|
+
success: (message: string, options?: NotifyOptions) => string | number;
|
|
20
|
+
info: (message: string, options?: NotifyOptions) => string | number;
|
|
21
|
+
error: (message: string, options?: NotifyOptions) => string | number;
|
|
22
|
+
/** A toast that stays until it is replaced (same `id`) or dismissed. */
|
|
23
|
+
loading: (message: string, options?: NotifyOptions) => string | number;
|
|
24
|
+
/** Closes one toast, or every toast without an id. */
|
|
25
|
+
dismiss: (id?: string | number) => void;
|
|
26
|
+
}
|
|
27
|
+
/** Registers the toast system behind `notify`; `null` unregisters it. */
|
|
28
|
+
export declare const setNotificationAdapter: (next: NotificationAdapter | null) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Toasts through the registered adapter (rendered once at the root by the host, so a toast survives a client
|
|
31
|
+
* navigation: create → redirect to the new entity still shows "… created").
|
|
32
|
+
*/
|
|
33
|
+
export declare const notify: {
|
|
34
|
+
success: (message: string, options?: NotifyOptions) => string | number;
|
|
35
|
+
info: (message: string, options?: NotifyOptions) => string | number;
|
|
36
|
+
error: (message: string, options?: NotifyOptions) => string | number;
|
|
37
|
+
loading: (message: string, options?: NotifyOptions) => string | number;
|
|
38
|
+
/** A failed save: the server's message, the violation count as description, shown longer. */
|
|
39
|
+
submitError: (error: FormSubmitError, options?: NotifyOptions) => string | number;
|
|
40
|
+
dismiss: (id?: string | number) => void;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=notify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/notify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,mGAAmG;AACnG,MAAM,WAAW,aAAa;IAC5B,8GAA8G;IAC9G,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,gHAAgH;AAChH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,GAAG,MAAM,CAAC;IACvE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,GAAG,MAAM,CAAC;IACpE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,GAAG,MAAM,CAAC;IACrE,wEAAwE;IACxE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,GAAG,MAAM,CAAC;IACvE,sDAAsD;IACtD,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACzC;AAOD,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,GAAI,MAAM,mBAAmB,GAAG,IAAI,KAAG,IAEzE,CAAC;AAoBF;;;GAGG;AACH,eAAO,MAAM,MAAM;uBACE,MAAM,YAAY,aAAa;oBAClC,MAAM,YAAY,aAAa;qBAC9B,MAAM,YAAY,aAAa;uBAC7B,MAAM,YAAY,aAAa;IAClD,6FAA6F;yBACxE,eAAe,YAAY,aAAa;mBAa9C,MAAM,GAAG,MAAM,KAAG,IAAI;CAGtC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { translateText } from "../../i18n/store.js";
|
|
2
|
+
/** Module state: the one registered adapter (the provider registers it; tests or a host may call this directly). */
|
|
3
|
+
let adapter = null;
|
|
4
|
+
let warnedMissingAdapter = false;
|
|
5
|
+
let fallbackId = 0;
|
|
6
|
+
/** Registers the toast system behind `notify`; `null` unregisters it. */
|
|
7
|
+
export const setNotificationAdapter = (next) => {
|
|
8
|
+
adapter = next;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Without an adapter a call does nothing and warns once outside production; it never throws, so the caller's own
|
|
12
|
+
* error handling still runs. The answered id is the given one or a local counter.
|
|
13
|
+
*/
|
|
14
|
+
const withAdapter = (call, options) => {
|
|
15
|
+
if (adapter)
|
|
16
|
+
return call(adapter);
|
|
17
|
+
if (!warnedMissingAdapter && process.env.NODE_ENV !== 'production') {
|
|
18
|
+
warnedMissingAdapter = true;
|
|
19
|
+
console.warn('notify: no notification adapter registered; toasts are dropped until one is.');
|
|
20
|
+
}
|
|
21
|
+
if (options?.id !== undefined)
|
|
22
|
+
return options.id;
|
|
23
|
+
fallbackId += 1;
|
|
24
|
+
return `notify-${fallbackId}`;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Toasts through the registered adapter (rendered once at the root by the host, so a toast survives a client
|
|
28
|
+
* navigation: create → redirect to the new entity still shows "… created").
|
|
29
|
+
*/
|
|
30
|
+
export const notify = {
|
|
31
|
+
success: (message, options) => withAdapter(registered => registered.success(message, options), options),
|
|
32
|
+
info: (message, options) => withAdapter(registered => registered.info(message, options), options),
|
|
33
|
+
error: (message, options) => withAdapter(registered => registered.error(message, options), options),
|
|
34
|
+
loading: (message, options) => withAdapter(registered => registered.loading(message, options), options),
|
|
35
|
+
/** A failed save: the server's message, the violation count as description, shown longer. */
|
|
36
|
+
submitError: (error, options) => {
|
|
37
|
+
const merged = {
|
|
38
|
+
description: error.validationErrors.length > 0
|
|
39
|
+
? translateText('{count, plural, one {# validation error} other {# validation errors}}', {
|
|
40
|
+
count: error.validationErrors.length,
|
|
41
|
+
})
|
|
42
|
+
: undefined,
|
|
43
|
+
duration: 8000,
|
|
44
|
+
...options,
|
|
45
|
+
};
|
|
46
|
+
return withAdapter(registered => registered.error(error.message, merged), merged);
|
|
47
|
+
},
|
|
48
|
+
dismiss: (id) => {
|
|
49
|
+
adapter?.dismiss(id);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../../src/logic/pure/notify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA+BpD,oHAAoH;AACpH,IAAI,OAAO,GAA+B,IAAI,CAAC;AAC/C,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,yEAAyE;AACzE,MAAM,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AAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAC/H,6FAA6F;IAC7F,WAAW,EAAE,CAAC,KAAsB,EAAE,OAAuB,EAAE,EAAE;QAC/D,MAAM,MAAM,GAAkB;YAC5B,WAAW,EACT,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC;gBAC/B,CAAC,CAAC,aAAa,CAAC,uEAAuE,EAAE;oBACrF,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM;iBACrC,CAAC;gBACJ,CAAC,CAAC,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,GAAG,OAAO;SACX,CAAC;QACF,OAAO,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,EAAE,CAAC,EAAoB,EAAQ,EAAE;QACtC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every descendant that owns its own click. One `closest()` test on a list row or card replaces per-control
|
|
3
|
+
* `stopPropagation` calls. `[data-row-action-ignore]` is the escape hatch for a non-semantic clickable.
|
|
4
|
+
*/
|
|
5
|
+
export declare const INTERACTIVE_SELECTOR: string;
|
|
6
|
+
//# sourceMappingURL=rowActivation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowActivation.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/rowActivation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAE2C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every descendant that owns its own click. One `closest()` test on a list row or card replaces per-control
|
|
3
|
+
* `stopPropagation` calls. `[data-row-action-ignore]` is the escape hatch for a non-semantic clickable.
|
|
4
|
+
*/
|
|
5
|
+
export const INTERACTIVE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="switch"], ' +
|
|
6
|
+
'[role="menuitem"], [role="link"], [role="tab"], [data-row-action-ignore]';
|
|
7
|
+
//# sourceMappingURL=rowActivation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowActivation.js","sourceRoot":"","sources":["../../../src/logic/pure/rowActivation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kGAAkG;IAClG,0EAA0E,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SequentialFailure<TKey> {
|
|
2
|
+
key: TKey;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SequentialOutcome<TKey> {
|
|
6
|
+
succeeded: TKey[];
|
|
7
|
+
failed: SequentialFailure<TKey>[];
|
|
8
|
+
total: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Runs one request per key, strictly one after another (the old bulk loops; never `Promise.all` — the backend and the
|
|
12
|
+
* write guard see one write at a time, and the order is the list order). A failure is recorded and the loop goes on.
|
|
13
|
+
*/
|
|
14
|
+
export declare const runSequential: <TKey>(keys: readonly TKey[], run: (key: TKey) => Promise<unknown>, onProgress?: (done: number, total: number) => void) => Promise<SequentialOutcome<TKey>>;
|
|
15
|
+
export interface SequentialSummaryLabels {
|
|
16
|
+
/** `Deleting` — the progress toast reads `Deleting tracks… 2/5`. */
|
|
17
|
+
progress: string;
|
|
18
|
+
/** `Deleted` — the summary reads `Deleted 5 tracks` / `Deleted 3 of 5 tracks · 2 failed`. */
|
|
19
|
+
done: string;
|
|
20
|
+
/** Singular noun (`track`). */
|
|
21
|
+
noun: string;
|
|
22
|
+
/** Plural noun, default `noun + 's'`. */
|
|
23
|
+
nounPlural?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `runSequential` with the standard toasts: one progress toast that counts up, replaced by the summary (success when
|
|
27
|
+
* every call passed, an error with the first failure's message otherwise). Returns the outcome for follow-ups (clear
|
|
28
|
+
* the selection, refetch, a result dialog).
|
|
29
|
+
*/
|
|
30
|
+
export declare const runSequentialWithSummary: <TKey>(keys: readonly TKey[], run: (key: TKey) => Promise<unknown>, labels: SequentialSummaryLabels) => Promise<SequentialOutcome<TKey>>;
|
|
31
|
+
//# sourceMappingURL=runSequential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSequential.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/runSequential.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB,CAAC,IAAI;IACrC,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB,CAAC,IAAI;IACrC,SAAS,EAAE,IAAI,EAAE,CAAC;IAClB,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAU,IAAI,EACtC,MAAM,SAAS,IAAI,EAAE,EACrB,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,EACpC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACjD,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAajC,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAU,IAAI,EACjD,MAAM,SAAS,IAAI,EAAE,EACrB,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,EACpC,QAAQ,uBAAuB,KAC9B,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CA4BjC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { normalizeDddError } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
import { translateText } from "../../i18n/store.js";
|
|
3
|
+
import { notify } from "./notify.js";
|
|
4
|
+
/**
|
|
5
|
+
* Runs one request per key, strictly one after another (the old bulk loops; never `Promise.all` — the backend and the
|
|
6
|
+
* write guard see one write at a time, and the order is the list order). A failure is recorded and the loop goes on.
|
|
7
|
+
*/
|
|
8
|
+
export const runSequential = async (keys, run, onProgress) => {
|
|
9
|
+
const succeeded = [];
|
|
10
|
+
const failed = [];
|
|
11
|
+
for (const key of keys) {
|
|
12
|
+
try {
|
|
13
|
+
await run(key);
|
|
14
|
+
succeeded.push(key);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
failed.push({ key, message: normalizeDddError(error).message });
|
|
18
|
+
}
|
|
19
|
+
onProgress?.(succeeded.length + failed.length, keys.length);
|
|
20
|
+
}
|
|
21
|
+
return { succeeded, failed, total: keys.length };
|
|
22
|
+
};
|
|
23
|
+
const countNoun = (count, labels) => count === 1 ? labels.noun : (labels.nounPlural ?? `${labels.noun}s`);
|
|
24
|
+
/**
|
|
25
|
+
* `runSequential` with the standard toasts: one progress toast that counts up, replaced by the summary (success when
|
|
26
|
+
* every call passed, an error with the first failure's message otherwise). Returns the outcome for follow-ups (clear
|
|
27
|
+
* the selection, refetch, a result dialog).
|
|
28
|
+
*/
|
|
29
|
+
export const runSequentialWithSummary = async (keys, run, labels) => {
|
|
30
|
+
const total = keys.length;
|
|
31
|
+
const plural = countNoun(2, labels);
|
|
32
|
+
const toastId = notify.loading(translateText('%progress% %nouns%… %done%/%total%', { replacements: { progress: labels.progress, nouns: plural, done: 0, total } }));
|
|
33
|
+
const outcome = await runSequential(keys, run, done => {
|
|
34
|
+
notify.loading(translateText('%progress% %nouns%… %done%/%total%', { replacements: { progress: labels.progress, nouns: plural, done, total } }), { id: toastId });
|
|
35
|
+
});
|
|
36
|
+
const succeeded = outcome.succeeded.length;
|
|
37
|
+
if (outcome.failed.length === 0) {
|
|
38
|
+
notify.success(translateText('%done% %count% %noun%', { replacements: { done: labels.done, count: succeeded, noun: countNoun(succeeded, labels) } }), { id: toastId });
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
notify.error(translateText('%done% %succeeded% of %total% %noun% · %failed% failed', {
|
|
42
|
+
replacements: { done: labels.done, succeeded, total, noun: countNoun(total, labels), failed: outcome.failed.length },
|
|
43
|
+
}), { id: toastId, description: outcome.failed[0]?.message, duration: 8000 });
|
|
44
|
+
}
|
|
45
|
+
return outcome;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=runSequential.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSequential.js","sourceRoot":"","sources":["../../../src/logic/pure/runSequential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAarC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,IAAqB,EACrB,GAAoC,EACpC,UAAkD,EAChB,EAAE;IACpC,MAAM,SAAS,GAAW,EAAE,CAAC;IAC7B,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,CAA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,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,EAChI,EAAE,EAAE,EAAE,OAAO,EAAE,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC3C,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CACZ,aAAa,CAAC,uBAAuB,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,EACrI,EAAE,EAAE,EAAE,OAAO,EAAE,CAChB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,CACV,aAAa,CAAC,wDAAwD,EAAE;YACtE,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;SACrH,CAAC,EACF,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CACzE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The form value of a media reference field: the picked item's id and the preview it shows (`null` = none). */
|
|
3
|
+
export interface MediaItemValue {
|
|
4
|
+
id: string;
|
|
5
|
+
previewUrl: string | null;
|
|
6
|
+
}
|
|
7
|
+
/** Schema of a media reference field (`null` = none picked). */
|
|
8
|
+
export declare const mediaItemValueSchema: z.ZodNullable<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
/** Schema of one field's texts in the form's `translations` value (`{ 'locale::style': text }`). */
|
|
13
|
+
export declare const propertyTranslationsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
14
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gHAAgH;AAChH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,gEAAgE;AAChE,eAAO,MAAM,oBAAoB;;;kBAA6E,CAAC;AAE/G,oGAAoG;AACpG,eAAO,MAAM,0BAA0B,uCAAmC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Schema of a media reference field (`null` = none picked). */
|
|
3
|
+
export const mediaItemValueSchema = z.object({ id: z.string(), previewUrl: z.string().nullable() }).nullable();
|
|
4
|
+
/** Schema of one field's texts in the form's `translations` value (`{ 'locale::style': text }`). */
|
|
5
|
+
export const propertyTranslationsSchema = z.record(z.string(), z.string());
|
|
6
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/logic/pure/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE/G,oGAAoG;AACpG,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side validation violations of a DDD error body and where they belong in a form. Pure functions (no React),
|
|
3
|
+
* so the mapping is unit-tested on its own; `FormErrors` applies them.
|
|
4
|
+
*/
|
|
5
|
+
/** One server-side validation violation (`validationErrors.elements[].elements[]` of a DDD error body). */
|
|
6
|
+
export interface FormValidationError {
|
|
7
|
+
/** The violation's property as the server sent it (`placeOfResidence`). */
|
|
8
|
+
propertyName: string;
|
|
9
|
+
/**
|
|
10
|
+
* Full dotted path: the entity's `jsonPath` (`.` for the validated root, `.setting.` for a nested object) plus the
|
|
11
|
+
* property, array keys as segments (`teams[0].name` → `teams.0.name`). The form field it belongs to is matched on it.
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
}
|
|
16
|
+
/** The dotted path of a violation: its entity's `jsonPath` plus its property path, `[key]` written as `.key`. */
|
|
17
|
+
export declare const violationPath: (jsonPath: unknown, propertyName: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Flattens a DDD `validationErrors` body (a set of per-entity sets of violations, each with `propertyName` and
|
|
20
|
+
* `errorMessage`, the set carrying the entity's `jsonPath`) into one list; anything else yields none.
|
|
21
|
+
*/
|
|
22
|
+
export declare const parseValidationErrors: (validationErrors: unknown) => FormValidationError[];
|
|
23
|
+
/**
|
|
24
|
+
* The form field a violation belongs to, among the fields the form shows (`fieldNames`), or `undefined`:
|
|
25
|
+
* 1. `aliases` (server path → field name) for a field named differently from the property,
|
|
26
|
+
* 2. the field named like the path,
|
|
27
|
+
* 3. the path without its leading segments (a request wrapper or nested entity the form flattens:
|
|
28
|
+
* `account.placeOfResidence` → `placeOfResidence`),
|
|
29
|
+
* 4. the entity's own texts in the form's `translations` group (`name` → `translations.name`),
|
|
30
|
+
* 5. the one field nested under any other form group whose name ends in the path.
|
|
31
|
+
*/
|
|
32
|
+
export declare const matchViolationField: (path: string, fieldNames: Iterable<string>, aliases?: Readonly<Record<string, string>>) => string | undefined;
|
|
33
|
+
/** A readable name for a path no form field shows: `setting.maxSpeed` → `Setting › Max speed`. */
|
|
34
|
+
export declare const humanizeViolationPath: (path: string) => string;
|
|
35
|
+
//# sourceMappingURL=serverViolations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverViolations.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/serverViolations.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,2GAA2G;AAC3G,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAWD,iHAAiH;AACjH,eAAO,MAAM,aAAa,GAAI,UAAU,OAAO,EAAE,cAAc,MAAM,KAAG,MAK1D,CAAC;AAEf;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,kBAAkB,OAAO,KAAG,mBAAmB,EAejF,CAAC;AAEL;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,MAAM,EACZ,YAAY,QAAQ,CAAC,MAAM,CAAC,EAC5B,UAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,KAC7C,MAAM,GAAG,SAYX,CAAC;AAaF,kGAAkG;AAClG,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,MAKrC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { translateText } from "../../i18n/store.js";
|
|
2
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
const elementsOf = (value) => {
|
|
4
|
+
if (!isRecord(value))
|
|
5
|
+
return [];
|
|
6
|
+
const { elements } = value;
|
|
7
|
+
return Array.isArray(elements) ? elements : [];
|
|
8
|
+
};
|
|
9
|
+
/** The dotted path of a violation: its entity's `jsonPath` plus its property path, `[key]` written as `.key`. */
|
|
10
|
+
export const violationPath = (jsonPath, propertyName) => `${typeof jsonPath === 'string' ? jsonPath : ''}.${propertyName}`
|
|
11
|
+
.replace(/\[([^\]]*)\]/g, '.$1')
|
|
12
|
+
.split('.')
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
.join('.');
|
|
15
|
+
/**
|
|
16
|
+
* Flattens a DDD `validationErrors` body (a set of per-entity sets of violations, each with `propertyName` and
|
|
17
|
+
* `errorMessage`, the set carrying the entity's `jsonPath`) into one list; anything else yields none.
|
|
18
|
+
*/
|
|
19
|
+
export const parseValidationErrors = (validationErrors) => elementsOf(validationErrors).flatMap(group => {
|
|
20
|
+
const jsonPath = isRecord(group) ? group.jsonPath : undefined;
|
|
21
|
+
return elementsOf(group).flatMap(violation => {
|
|
22
|
+
if (!isRecord(violation))
|
|
23
|
+
return [];
|
|
24
|
+
const { propertyName, errorMessage } = violation;
|
|
25
|
+
const property = typeof propertyName === 'string' && propertyName ? propertyName : 'unknown';
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
propertyName: property,
|
|
29
|
+
path: violationPath(jsonPath, property) || property,
|
|
30
|
+
errorMessage: typeof errorMessage === 'string' && errorMessage ? errorMessage : translateText('Unknown error'),
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* The form field a violation belongs to, among the fields the form shows (`fieldNames`), or `undefined`:
|
|
37
|
+
* 1. `aliases` (server path → field name) for a field named differently from the property,
|
|
38
|
+
* 2. the field named like the path,
|
|
39
|
+
* 3. the path without its leading segments (a request wrapper or nested entity the form flattens:
|
|
40
|
+
* `account.placeOfResidence` → `placeOfResidence`),
|
|
41
|
+
* 4. the entity's own texts in the form's `translations` group (`name` → `translations.name`),
|
|
42
|
+
* 5. the one field nested under any other form group whose name ends in the path.
|
|
43
|
+
*/
|
|
44
|
+
export const matchViolationField = (path, fieldNames, aliases = {}) => {
|
|
45
|
+
const names = new Set(fieldNames);
|
|
46
|
+
const segments = path.split('.');
|
|
47
|
+
for (let start = 0; start < segments.length; start++) {
|
|
48
|
+
const candidate = segments.slice(start).join('.');
|
|
49
|
+
const alias = aliases[candidate];
|
|
50
|
+
if (alias)
|
|
51
|
+
return alias;
|
|
52
|
+
if (names.has(candidate))
|
|
53
|
+
return candidate;
|
|
54
|
+
}
|
|
55
|
+
if (names.has(`translations.${path}`))
|
|
56
|
+
return `translations.${path}`;
|
|
57
|
+
const nested = [...names].filter(name => name.endsWith(`.${path}`));
|
|
58
|
+
return nested.length === 1 ? nested[0] : undefined;
|
|
59
|
+
};
|
|
60
|
+
const humanizeSegment = (segment) => {
|
|
61
|
+
if (/^\d+$/.test(segment))
|
|
62
|
+
return `#${Number(segment) + 1}`;
|
|
63
|
+
const words = segment
|
|
64
|
+
.replace(/([a-z\d])([A-Z])/g, '$1 $2')
|
|
65
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
|
|
66
|
+
.replace(/[_-]+/g, ' ')
|
|
67
|
+
.trim()
|
|
68
|
+
.toLowerCase();
|
|
69
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
70
|
+
};
|
|
71
|
+
/** A readable name for a path no form field shows: `setting.maxSpeed` → `Setting › Max speed`. */
|
|
72
|
+
export const humanizeViolationPath = (path) => path
|
|
73
|
+
.split('.')
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.map(humanizeSegment)
|
|
76
|
+
.join(' › ');
|
|
77
|
+
//# sourceMappingURL=serverViolations.js.map
|
|
@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IAAI,KAAK,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAAE,OAAO,gBAAgB,IAAI,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAe,EAAU,EAAE;IAClD,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,OAAO;SAClB,OAAO,CAAC,mBAAmB,EAAE,OAAO,CAAC;SACrC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,IAAI,EAAE;SACN,WAAW,EAAE,CAAC;IACjB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAU,EAAE,CAC5D,IAAI;KACD,KAAK,CAAC,GAAG,CAAC;KACV,MAAM,CAAC,OAAO,CAAC;KACf,GAAG,CAAC,eAAe,CAAC;KACpB,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
/**
|
|
3
|
+
* The status tones (one badge style per status family):
|
|
4
|
+
* `neutral` not started / inactive / unknown · `info` informational or finished · `success` running / done / active ·
|
|
5
|
+
* `warning` paused / pending / needs attention · `danger` failed / cancelled / blocked · `highlight` a featured flag
|
|
6
|
+
* (yellow fill, e.g. "Electric") · `brand` an identity mark (cyan tint).
|
|
7
|
+
*/
|
|
8
|
+
export type StatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'highlight' | 'brand';
|
|
9
|
+
/** One value of a status family: label, tone and (strongly recommended — never colour alone) an icon. */
|
|
10
|
+
export interface StatusDefinition {
|
|
11
|
+
label: string;
|
|
12
|
+
tone: StatusTone;
|
|
13
|
+
icon?: LucideIcon;
|
|
14
|
+
/** Hover text (e.g. what the status means). */
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A status family: every value of one enum → its badge. Define it once per family and reuse it in rows, cards, details. */
|
|
18
|
+
export type StatusMap<TValue extends string = string> = Readonly<Record<TValue, StatusDefinition>>;
|
|
19
|
+
/** Typed identity helper: `defineStatusMap<Campaign['status'] & string>({ RUNNING: { … }, … })` checks completeness. */
|
|
20
|
+
export declare const defineStatusMap: <TValue extends string>(map: Record<TValue, StatusDefinition>) => StatusMap<TValue>;
|
|
21
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAEvG,yGAAyG;AACzG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4HAA4H;AAC5H,MAAM,MAAM,SAAS,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEnG,wHAAwH;AACxH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAG,SAAS,CAAC,MAAM,CAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"AAsBA,wHAAwH;AACxH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAwB,GAAqC,EAAqB,EAAE,CAAC,GAAG,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FormValidationError, parseValidationErrors } from './serverViolations.js';
|
|
2
|
+
export { parseValidationErrors };
|
|
3
|
+
export type { FormValidationError };
|
|
4
|
+
/** A failed save, ready for `FormErrors`. */
|
|
5
|
+
export interface FormSubmitError {
|
|
6
|
+
message: string;
|
|
7
|
+
validationErrors: FormValidationError[];
|
|
8
|
+
}
|
|
9
|
+
/** Turns whatever a save rejected with into the banner's content. */
|
|
10
|
+
export declare const toFormSubmitError: (error: unknown, fallbackMessage: string) => FormSubmitError;
|
|
11
|
+
//# sourceMappingURL=submitError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitError.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/submitError.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;CACzC;AAED,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,EAAE,iBAAiB,MAAM,KAAG,eAG3E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { normalizeDddError } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
import { parseValidationErrors } from "./serverViolations.js";
|
|
3
|
+
export { parseValidationErrors };
|
|
4
|
+
/** Turns whatever a save rejected with into the banner's content. */
|
|
5
|
+
export const toFormSubmitError = (error, fallbackMessage) => {
|
|
6
|
+
const normalized = normalizeDddError(error, fallbackMessage);
|
|
7
|
+
return { message: normalized.message, validationErrors: parseValidationErrors(normalized.validationErrors) };
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=submitError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitError.js","sourceRoot":"","sources":["../../../src/logic/pure/submitError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAA4B,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AASjC,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAE,eAAuB,EAAmB,EAAE;IAC5F,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAC7D,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;AAC/G,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type PropertyTranslations, type TranslationInfos, type TranslationsStore } from '@mgamadeus/ddd-web/contract';
|
|
2
|
+
/**
|
|
3
|
+
* The pure half of `useEntityTranslations` (no React): hydration, payload and merge of a translations store, keyed
|
|
4
|
+
* by the FULL `locale::style` key throughout. Kept separate so the lossless round trip can be checked without a DOM.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TRANSLATION_INFOS_OBJECT_TYPE = "DDD\\Domain\\Base\\Entities\\Translatable\\TranslationInfos";
|
|
7
|
+
export type FieldTranslations<F extends string> = Record<F, PropertyTranslations>;
|
|
8
|
+
export interface HydratedTranslations<F extends string> {
|
|
9
|
+
translations: FieldTranslations<F>;
|
|
10
|
+
/** Store entries of translatable properties outside `fields`: sent back unchanged. */
|
|
11
|
+
passthrough: TranslationsStore;
|
|
12
|
+
}
|
|
13
|
+
export declare const blankTranslations: <F extends string>(fields: readonly F[]) => FieldTranslations<F>;
|
|
14
|
+
export declare const nonBlankEntries: (map: PropertyTranslations) => PropertyTranslations;
|
|
15
|
+
/**
|
|
16
|
+
* Reads an entity as loaded: every `field × locale::style` of its store, untouched (collapsing keys to the language
|
|
17
|
+
* with `split('::')[0]` would drop the style variants). A field with an empty store falls back to the plain property under the default
|
|
18
|
+
* locale (legacy rows that never had translations), so its text is not cleared by the next save.
|
|
19
|
+
*/
|
|
20
|
+
export declare const hydrateTranslations: <F extends string>(entity: unknown, fields: readonly F[], defaultLocale: string) => HydratedTranslations<F>;
|
|
21
|
+
/**
|
|
22
|
+
* The `translationInfos` of a save: the passthrough store plus every non-blank `field × locale::style` the state
|
|
23
|
+
* holds (blank = cleared by the user). Meta: current and default language/style from
|
|
24
|
+
* the default locale, `replaceExistingTranslations: true`. `availableTranslations` is left out (server-computed).
|
|
25
|
+
*/
|
|
26
|
+
export declare const buildTranslationInfos: <F extends string>(translations: FieldTranslations<F>, passthrough: TranslationsStore, fields: readonly F[], defaultLocale: string) => TranslationInfos;
|
|
27
|
+
/** Merges translated texts into the state, filling only blank entries (never what the user typed meanwhile). */
|
|
28
|
+
export declare const mergeTranslatedStore: <F extends string>(previous: FieldTranslations<F>, store: TranslationsStore, fields: readonly F[]) => FieldTranslations<F>;
|
|
29
|
+
//# sourceMappingURL=translationState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translationState.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/translationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AAEH,eAAO,MAAM,6BAA6B,gEAAgE,CAAC;AAE3G,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAElF,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM;IACpD,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACnC,sFAAsF;IACtF,WAAW,EAAE,iBAAiB,CAAC;CAChC;AAKD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,SAAS,CAAC,EAAE,KAAG,iBAAiB,CAAC,CAAC,CAI7F,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,KAAK,oBAAoB,KAAG,oBACsB,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,MAAM,EAClD,QAAQ,OAAO,EACf,QAAQ,SAAS,CAAC,EAAE,EACpB,eAAe,MAAM,KACpB,oBAAoB,CAAC,CAAC,CAoBxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,EACpD,cAAc,iBAAiB,CAAC,CAAC,CAAC,EAClC,aAAa,iBAAiB,EAC9B,QAAQ,SAAS,CAAC,EAAE,EACpB,eAAe,MAAM,KACpB,gBAsBF,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,EACnD,UAAU,iBAAiB,CAAC,CAAC,CAAC,EAC9B,OAAO,iBA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