@antelopejs/dms 0.25.6 → 0.25.7-next.1111.gaba637e
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/CHANGELOG.md +0 -60
- package/README.md +1 -1
- package/data/mockup-spec.schema.json +223 -303
- package/dist/implementations/dms-auth/account-emails.js +2 -2
- package/dist/implementations/dms-auth/account-emails.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +2 -1
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/search-route.js +5 -8
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +1 -4
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +1 -5
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +0 -4
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +17 -5
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mockup-export/capture.d.ts +15 -0
- package/dist/mcp/mockup-export/capture.js +97 -0
- package/dist/mcp/mockup-export/capture.js.map +1 -0
- package/dist/mcp/mockup-export/document.d.ts +4 -0
- package/dist/mcp/mockup-export/document.js +199 -0
- package/dist/mcp/mockup-export/document.js.map +1 -0
- package/dist/mcp/mockup-export/index.d.ts +23 -0
- package/dist/mcp/mockup-export/index.js +90 -0
- package/dist/mcp/mockup-export/index.js.map +1 -0
- package/dist/mcp/mockup-export/plan.d.ts +78 -0
- package/dist/mcp/mockup-export/plan.js +257 -0
- package/dist/mcp/mockup-export/plan.js.map +1 -0
- package/dist/mcp/mockup-export/route.d.ts +13 -0
- package/dist/mcp/mockup-export/route.js +66 -0
- package/dist/mcp/mockup-export/route.js.map +1 -0
- package/dist/mcp/page-verify/index.d.ts +14 -0
- package/dist/mcp/page-verify/index.js +9 -5
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +2 -1
- package/dist/mcp/page-verify/mockup.js +1 -0
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +22 -4
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +1 -0
- package/dist/mcp/tools/mockup-export-pdf.js +71 -0
- package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +10 -3
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +2 -0
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +1 -0
- package/dist/mcp/tools/page-verify.js +5 -1
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mockup/apply-notes.d.ts +1 -1
- package/dist/mockup/apply-notes.js +1 -2
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +0 -3
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/compile.d.ts +6 -1
- package/dist/mockup/compile.js +29 -25
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +10 -62
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/database-manifest.d.ts +2 -0
- package/dist/mockup/database-manifest.js +75 -0
- package/dist/mockup/database-manifest.js.map +1 -0
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/entities.d.ts +20 -0
- package/dist/mockup/entities.js +213 -0
- package/dist/mockup/entities.js.map +1 -0
- package/dist/mockup/files.d.ts +2 -2
- package/dist/mockup/files.js +2 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixture-answers.d.ts +1 -0
- package/dist/mockup/fixture-answers.js +1 -1
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/{capture-routes.d.ts → fixture-routes.d.ts} +11 -6
- package/dist/mockup/fixture-routes.js +155 -0
- package/dist/mockup/fixture-routes.js.map +1 -0
- package/dist/mockup/fixtures.d.ts +1 -3
- package/dist/mockup/fixtures.js +2 -25
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +1 -10
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/generate.js +4 -1
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.js +2 -17
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +3 -0
- package/dist/mockup/index.js +3 -0
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-entities.d.ts +5 -0
- package/dist/mockup/json-schema-entities.js +141 -0
- package/dist/mockup/json-schema-entities.js.map +1 -0
- package/dist/mockup/json-schema.js +23 -24
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/json.d.ts +8 -0
- package/dist/mockup/json.js +20 -0
- package/dist/mockup/json.js.map +1 -0
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/manifest-blocks.d.ts +19 -0
- package/dist/mockup/manifest-blocks.js +65 -0
- package/dist/mockup/manifest-blocks.js.map +1 -0
- package/dist/mockup/model.d.ts +106 -255
- package/dist/mockup/model.js +86 -82
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/module-manifests.d.ts +22 -0
- package/dist/mockup/module-manifests.js +28 -0
- package/dist/mockup/module-manifests.js.map +1 -0
- package/dist/mockup/modules-schema.d.ts +2 -0
- package/dist/mockup/modules-schema.js +42 -0
- package/dist/mockup/modules-schema.js.map +1 -0
- package/dist/mockup/modules.d.ts +20 -9
- package/dist/mockup/modules.js +146 -22
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/page-links.d.ts +1 -2
- package/dist/mockup/page-links.js +3 -14
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +4 -1
- package/dist/mockup/refusals.js +15 -1
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +1 -5
- package/dist/mockup/routes.js +9 -171
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/saas-manifest.d.ts +2 -0
- package/dist/mockup/saas-manifest.js +496 -0
- package/dist/mockup/saas-manifest.js.map +1 -0
- package/dist/mockup/sample-rows.js +0 -4
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/state.d.ts +76 -0
- package/dist/mockup/state.js +22 -0
- package/dist/mockup/state.js.map +1 -0
- package/dist/mockup/{summary-fields.js → store-summary.js} +1 -1
- package/dist/mockup/store-summary.js.map +1 -0
- package/dist/mockup/store.d.ts +1 -2
- package/dist/mockup/store.js +16 -22
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-columns.js +3 -9
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +1 -4
- package/dist/mockup/table-options.js +2 -40
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/tenancy.d.ts +19 -0
- package/dist/mockup/tenancy.js +73 -0
- package/dist/mockup/tenancy.js.map +1 -0
- package/dist/mockup/tenant-rows.d.ts +4 -0
- package/dist/mockup/tenant-rows.js +19 -0
- package/dist/mockup/tenant-rows.js.map +1 -0
- package/dist/mockup/validate.d.ts +1 -7
- package/dist/mockup/validate.js +3 -76
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +0 -1
- package/dist/pages/account.js +0 -1
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +0 -2
- package/dist/pages/settings/overview/account-summary.js +8 -17
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +1 -2
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +4 -2
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +1 -7
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +0 -1
- package/dist/utils/account-notifications.js.map +1 -1
- package/dist/utils/email-change-mail.js +2 -2
- package/dist/utils/email-change-mail.js.map +1 -1
- package/dist/utils/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +0 -1
- package/dist/validation/index.js.map +1 -1
- package/frontend-vue/eslint-globals.generated.mjs +2 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +1 -4
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +1 -17
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +0 -3
- package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +0 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +2 -3
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +5 -23
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +0 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +443 -12
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -8
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -8
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +0 -2
- package/frontend-vue/layers/dms-layout/app/app.config.ts +0 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +4 -7
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +29 -14
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +0 -2
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +3 -19
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +110 -9
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -8
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +9 -6
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +2 -6
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +22 -27
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +10 -8
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +3 -39
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +5 -38
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +3 -1
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +4 -23
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +31 -39
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +9 -60
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +1 -7
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +1 -14
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +0 -13
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +0 -3
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -3
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +165 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +1 -22
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +182 -125
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -114
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +4 -10
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +48 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +76 -8
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +65 -9
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +6 -26
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +6 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +175 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +35 -109
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +18 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +76 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +63 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +1 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +13 -68
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +7 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +0 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +0 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +0 -38
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +3 -69
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +7 -20
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +0 -36
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +0 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +5 -21
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +0 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +4 -32
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +2 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +6 -68
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +0 -5
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +48 -73
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +11 -18
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +125 -34
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +3 -7
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +149 -84
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +119 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +72 -43
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +92 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +1 -35
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +17 -44
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +177 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +14 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +14 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +151 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -56
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +3 -0
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +7 -4
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +0 -5
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +20 -2
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +15 -51
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +0 -10
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +0 -3
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +0 -5
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +28 -2
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +38 -12
- package/frontend-vue/scripts/check-invariants.mjs +0 -101
- package/package.json +5 -5
- package/skills/dms/SKILL.md +2 -4
- package/skills/dms-module/SKILL.md +0 -3
- package/dist/implementations/dms-base/group-order.d.ts +0 -18
- package/dist/implementations/dms-base/group-order.js +0 -66
- package/dist/implementations/dms-base/group-order.js.map +0 -1
- package/dist/mockup/capture-routes.js +0 -101
- package/dist/mockup/capture-routes.js.map +0 -1
- package/dist/mockup/capture.d.ts +0 -10
- package/dist/mockup/capture.js +0 -64
- package/dist/mockup/capture.js.map +0 -1
- package/dist/mockup/header-action.d.ts +0 -47
- package/dist/mockup/header-action.js +0 -46
- package/dist/mockup/header-action.js.map +0 -1
- package/dist/mockup/json-schema-header.d.ts +0 -2
- package/dist/mockup/json-schema-header.js +0 -69
- package/dist/mockup/json-schema-header.js.map +0 -1
- package/dist/mockup/json-schema-layout.d.ts +0 -2
- package/dist/mockup/json-schema-layout.js +0 -61
- package/dist/mockup/json-schema-layout.js.map +0 -1
- package/dist/mockup/summary-fields.js.map +0 -1
- package/dist/mockup/table-param-filters.d.ts +0 -52
- package/dist/mockup/table-param-filters.js +0 -83
- package/dist/mockup/table-param-filters.js.map +0 -1
- package/dist/mockup/table-row-actions.d.ts +0 -2
- package/dist/mockup/table-row-actions.js +0 -85
- package/dist/mockup/table-row-actions.js.map +0 -1
- package/dist/mockup/unknown-keys.d.ts +0 -3
- package/dist/mockup/unknown-keys.js +0 -45
- package/dist/mockup/unknown-keys.js.map +0 -1
- package/dist/utils/email-plain-text.d.ts +0 -1
- package/dist/utils/email-plain-text.js +0 -95
- package/dist/utils/email-plain-text.js.map +0 -1
- package/dist/utils/html-email.d.ts +0 -8
- package/dist/utils/html-email.js +0 -9
- package/dist/utils/html-email.js.map +0 -1
- package/dist/utils/image-signatures.d.ts +0 -3
- package/dist/utils/image-signatures.js +0 -22
- package/dist/utils/image-signatures.js.map +0 -1
- package/dist/utils/sse-keepalive/index.d.ts +0 -3
- package/dist/utils/sse-keepalive/index.js +0 -8
- package/dist/utils/sse-keepalive/index.js.map +0 -1
- package/dist/validation/allowed-keys.d.ts +0 -2
- package/dist/validation/allowed-keys.js +0 -16
- package/dist/validation/allowed-keys.js.map +0 -1
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +0 -485
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +0 -27
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +0 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +0 -49
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +0 -110
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +0 -75
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +0 -67
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +0 -247
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +0 -181
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +0 -45
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +0 -136
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +0 -96
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +0 -10
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -61
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +0 -37
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +0 -279
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +0 -130
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +0 -154
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +0 -149
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +0 -42
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +0 -90
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +0 -1
- /package/dist/mockup/{summary-fields.d.ts → store-summary.d.ts} +0 -0
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { computed, onBeforeUnmount, shallowRef, watch, type Ref } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
MOCKUP_CAPTURE_SUFFIX,
|
|
4
|
-
mockupEndpoint,
|
|
5
|
-
type MockupDataMode,
|
|
6
|
-
type MockupPageState,
|
|
7
|
-
} from "../../utils/mockup";
|
|
8
|
-
import {
|
|
9
|
-
captureKey,
|
|
10
|
-
claimCaptureUpload,
|
|
11
|
-
mockupCaptures,
|
|
12
|
-
releaseCaptureUpload,
|
|
13
|
-
storePageCapture,
|
|
14
|
-
type CapturedLayout,
|
|
15
|
-
} from "../../utils/mockupCaptures";
|
|
16
|
-
import { readsRealData } from "../../utils/mockupRealData";
|
|
17
|
-
|
|
18
|
-
/** How long a page whose capture failed waits before its live frame is asked again: a slow page or a busy machine may draw it next time. */
|
|
19
|
-
const CAPTURE_RETRY_MS = 60_000;
|
|
20
|
-
|
|
21
|
-
/** What the captures of an Overview are kept by. */
|
|
22
|
-
export interface OverviewCaptureOptions {
|
|
23
|
-
/** The mockup's name, which the captures are kept under. */
|
|
24
|
-
name: string;
|
|
25
|
-
/** Whether the Overview is on screen: opening it again asks again for the captures that failed. */
|
|
26
|
-
isOpen: Readonly<Ref<boolean>>;
|
|
27
|
-
/** The pages, whose keys the captures are current for. */
|
|
28
|
-
pages: Readonly<Ref<readonly MockupPageState[]>>;
|
|
29
|
-
/** The developer's Real data choice, if any: each page is captured by it. */
|
|
30
|
-
dataMode: Readonly<Ref<MockupDataMode | undefined>>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The images of the pages, which show a page whose frame is not drawn live:
|
|
35
|
-
* kept by mockup, outside the viewer, which the dashboard builds again on a
|
|
36
|
-
* step of the browser's history, so a viewer built again finds them, with
|
|
37
|
-
* the height and blocks each page had when it was captured. A capture is
|
|
38
|
-
* current while its key is the page's own, which leaves out the sidebar, so
|
|
39
|
-
* changing one page recaptures that page alone. A page whose live frame could
|
|
40
|
-
* not draw its image is not asked again for the same key until
|
|
41
|
-
* {@link CAPTURE_RETRY_MS} passed, or the Overview opens again. The capture
|
|
42
|
-
* of the first page, once current and drawn from fixtures, is also sent to
|
|
43
|
-
* the server, which keeps it beside the spec for the cards of the Mockups
|
|
44
|
-
* page. A drawing of real rows is never sent, since `mockups/` is committed
|
|
45
|
-
* and read by the AI. A newer capture cancels the send of an older one, a
|
|
46
|
-
* failed send is dropped, and a send outlives the Overview.
|
|
47
|
-
*/
|
|
48
|
-
export function useOverviewCaptures(
|
|
49
|
-
options: OverviewCaptureOptions,
|
|
50
|
-
drawnOf: (page: string) => CapturedLayout,
|
|
51
|
-
) {
|
|
52
|
-
const captures = mockupCaptures(options.name);
|
|
53
|
-
const { $authFetch } = useAuthFetch();
|
|
54
|
-
let upload: AbortController | undefined;
|
|
55
|
-
const failed = shallowRef<ReadonlyMap<string, string>>(new Map());
|
|
56
|
-
const retries = new Set<ReturnType<typeof setTimeout>>();
|
|
57
|
-
function forget(page: string, key: string): void {
|
|
58
|
-
if (failed.value.get(page) !== key) return;
|
|
59
|
-
const next = new Map(failed.value);
|
|
60
|
-
next.delete(page);
|
|
61
|
-
failed.value = next;
|
|
62
|
-
}
|
|
63
|
-
watch(options.isOpen, () => {
|
|
64
|
-
if (failed.value.size) failed.value = new Map();
|
|
65
|
-
});
|
|
66
|
-
onBeforeUnmount(() => {
|
|
67
|
-
for (const retry of retries) clearTimeout(retry);
|
|
68
|
-
});
|
|
69
|
-
const keys = computed(
|
|
70
|
-
() =>
|
|
71
|
-
new Map(
|
|
72
|
-
options.pages.value.map((page) => [
|
|
73
|
-
page.id,
|
|
74
|
-
captureKey(page, readsRealData(page, options.dataMode.value)),
|
|
75
|
-
]),
|
|
76
|
-
),
|
|
77
|
-
);
|
|
78
|
-
const firstCapture = computed(() => {
|
|
79
|
-
const first = options.pages.value[0];
|
|
80
|
-
if (!first || readsRealData(first, options.dataMode.value)) return undefined;
|
|
81
|
-
const page = first.id;
|
|
82
|
-
const key = keys.value.get(page);
|
|
83
|
-
return key !== undefined && captures.value.get(page)?.key === key
|
|
84
|
-
? { page, key }
|
|
85
|
-
: undefined;
|
|
86
|
-
});
|
|
87
|
-
function send(page: string, key: string): void {
|
|
88
|
-
const url = captures.value.get(page)?.url;
|
|
89
|
-
if (!url || !claimCaptureUpload(options.name, page, key)) return;
|
|
90
|
-
upload?.abort();
|
|
91
|
-
const current = new AbortController();
|
|
92
|
-
upload = current;
|
|
93
|
-
fetch(url, { signal: current.signal })
|
|
94
|
-
.then((response) => response.blob())
|
|
95
|
-
.then((image) =>
|
|
96
|
-
$authFetch(mockupEndpoint(options.name, MOCKUP_CAPTURE_SUFFIX), {
|
|
97
|
-
method: "PUT",
|
|
98
|
-
query: { page },
|
|
99
|
-
body: image,
|
|
100
|
-
signal: current.signal,
|
|
101
|
-
}),
|
|
102
|
-
)
|
|
103
|
-
.catch(() => releaseCaptureUpload(options.name, page, key));
|
|
104
|
-
}
|
|
105
|
-
watch(
|
|
106
|
-
() => {
|
|
107
|
-
const first = firstCapture.value;
|
|
108
|
-
return first && JSON.stringify([first.page, first.key]);
|
|
109
|
-
},
|
|
110
|
-
() => {
|
|
111
|
-
const first = firstCapture.value;
|
|
112
|
-
if (first) send(first.page, first.key);
|
|
113
|
-
},
|
|
114
|
-
{ immediate: true },
|
|
115
|
-
);
|
|
116
|
-
return {
|
|
117
|
-
captures,
|
|
118
|
-
failed,
|
|
119
|
-
keys,
|
|
120
|
-
needsCapture: (page: string, key: string) =>
|
|
121
|
-
captures.value.get(page)?.key !== key && failed.value.get(page) !== key,
|
|
122
|
-
capture: (page: string, key: string, image: Blob) =>
|
|
123
|
-
storePageCapture(options.name, page, key, image, drawnOf(page)),
|
|
124
|
-
captureFailed: (page: string, key: string) => {
|
|
125
|
-
failed.value = new Map(failed.value).set(page, key);
|
|
126
|
-
const retry = setTimeout(() => {
|
|
127
|
-
retries.delete(retry);
|
|
128
|
-
forget(page, key);
|
|
129
|
-
}, CAPTURE_RETRY_MS);
|
|
130
|
-
retries.add(retry);
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/** The captures of an Overview's pages, and what records them. */
|
|
136
|
-
export type OverviewCaptures = ReturnType<typeof useOverviewCaptures>;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from "../../../../dms-core/app/types/json";
|
|
2
|
-
import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
|
|
3
|
-
import { isRecord, PREVIEW_CHANNEL } from "./blockPreviewChannel";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Parent → iframe: draw the preview's frame to an image and answer with a
|
|
7
|
-
* `capture` of the same `id`. The frame is captured as it is, so a parent
|
|
8
|
-
* asks once the page it sent is drawn.
|
|
9
|
-
*/
|
|
10
|
-
export interface PreviewCaptureRequestMessage {
|
|
11
|
-
channel: typeof PREVIEW_CHANNEL;
|
|
12
|
-
type: "capture";
|
|
13
|
-
/** Pairs the answer with the request. */
|
|
14
|
-
id: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Iframe → parent: the image of the frame a `capture` asked for. A Blob is structured-cloned into the parent's realm, so `instanceof Blob` holds there. */
|
|
18
|
-
export interface PreviewCaptureMessage {
|
|
19
|
-
channel: typeof PREVIEW_CHANNEL;
|
|
20
|
-
type: "capture";
|
|
21
|
-
/** The `id` of the request this answers. */
|
|
22
|
-
id: number;
|
|
23
|
-
image: Blob;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Iframe → parent: the frame could not be captured. */
|
|
27
|
-
export interface PreviewCaptureFailedMessage {
|
|
28
|
-
channel: typeof PREVIEW_CHANNEL;
|
|
29
|
-
type: "capture";
|
|
30
|
-
/** The `id` of the request this answers. */
|
|
31
|
-
id: number;
|
|
32
|
-
error: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Iframe → parent: the answer to a `capture` request, the image or why there is none. */
|
|
36
|
-
export type PreviewCaptureAnswer =
|
|
37
|
-
PreviewCaptureMessage | PreviewCaptureFailedMessage;
|
|
38
|
-
|
|
39
|
-
export function previewCaptureRequestMessage(
|
|
40
|
-
id: number,
|
|
41
|
-
): PreviewCaptureRequestMessage {
|
|
42
|
-
return { channel: PREVIEW_CHANNEL, type: "capture", id };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function previewCaptureMessage(
|
|
46
|
-
id: number,
|
|
47
|
-
image: Blob,
|
|
48
|
-
): PreviewCaptureMessage {
|
|
49
|
-
return { channel: PREVIEW_CHANNEL, type: "capture", id, image };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function previewCaptureFailedMessage(
|
|
53
|
-
id: number,
|
|
54
|
-
error: string,
|
|
55
|
-
): PreviewCaptureFailedMessage {
|
|
56
|
-
return { channel: PREVIEW_CHANNEL, type: "capture", id, error };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function isRequestId(value: JsonValue | undefined): value is number {
|
|
60
|
-
return isNumber(value) && Number.isInteger(value);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** Whether `value` is a `capture` request: an integer id, nothing else asked. */
|
|
64
|
-
export function isCaptureRequestMessage(
|
|
65
|
-
value: Parameters<typeof isRecord>[0],
|
|
66
|
-
): value is PreviewCaptureRequestMessage {
|
|
67
|
-
return (
|
|
68
|
-
isRecord(value) &&
|
|
69
|
-
value.channel === PREVIEW_CHANNEL &&
|
|
70
|
-
value.type === "capture" &&
|
|
71
|
-
isNumber(value.id) &&
|
|
72
|
-
Number.isInteger(value.id)
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The answer to a `capture` in the fields the preview posted: an image Blob,
|
|
78
|
-
* or why there is none; undefined when it holds neither. The image is checked
|
|
79
|
-
* for what it is, a Blob of an image type, since a string or a JSON object in
|
|
80
|
-
* its place would be handed to an `<img>` as a source.
|
|
81
|
-
*/
|
|
82
|
-
export function parseCaptureAnswer({
|
|
83
|
-
id,
|
|
84
|
-
image,
|
|
85
|
-
error,
|
|
86
|
-
}: {
|
|
87
|
-
id?: JsonValue;
|
|
88
|
-
image?: JsonValue | Blob;
|
|
89
|
-
error?: JsonValue;
|
|
90
|
-
}): PreviewCaptureAnswer | undefined {
|
|
91
|
-
if (!isRequestId(id)) return undefined;
|
|
92
|
-
if (image instanceof Blob && image.type.startsWith("image/")) {
|
|
93
|
-
return previewCaptureMessage(id, image);
|
|
94
|
-
}
|
|
95
|
-
return isString(error) ? previewCaptureFailedMessage(id, error) : undefined;
|
|
96
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { isObject } from "../../../../dms-core/app/utils/type-check";
|
|
2
|
-
|
|
3
|
-
export const PREVIEW_CHANNEL = "dms-preview";
|
|
4
|
-
|
|
5
|
-
/** Whether a posted value is an object with fields, which the message files read the fields of. */
|
|
6
|
-
export function isRecord(
|
|
7
|
-
value: Parameters<typeof isObject>[0],
|
|
8
|
-
): value is Record<string, unknown> {
|
|
9
|
-
return isObject(value) && value !== null && !Array.isArray(value);
|
|
10
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from "../../../../dms-core/app/types/json";
|
|
2
|
-
import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
|
|
3
|
-
import type {
|
|
4
|
-
PreviewBlockRect,
|
|
5
|
-
PreviewFont,
|
|
6
|
-
PreviewRect,
|
|
7
|
-
} from "./blockPreviewMessages";
|
|
8
|
-
import { isObjectValue } from "./json";
|
|
9
|
-
|
|
10
|
-
function isFiniteNumber(value: JsonValue | undefined): value is number {
|
|
11
|
-
return isNumber(value) && Number.isFinite(value);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** A rectangle a preview reported, or undefined when any side is not a finite number. */
|
|
15
|
-
export function parseRect(
|
|
16
|
-
value: JsonValue | undefined,
|
|
17
|
-
): PreviewRect | undefined {
|
|
18
|
-
if (!isObjectValue(value)) return undefined;
|
|
19
|
-
const { x, y, width, height } = value;
|
|
20
|
-
return isFiniteNumber(x) &&
|
|
21
|
-
isFiniteNumber(y) &&
|
|
22
|
-
isFiniteNumber(width) &&
|
|
23
|
-
isFiniteNumber(height)
|
|
24
|
-
? { x, y, width, height }
|
|
25
|
-
: undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** The type a preview reported for a text, or undefined when a field is missing. */
|
|
29
|
-
export function parseFont(
|
|
30
|
-
value: JsonValue | undefined,
|
|
31
|
-
): PreviewFont | undefined {
|
|
32
|
-
if (!isObjectValue(value)) return undefined;
|
|
33
|
-
const { family, size, weight, lineHeight, letterSpacing, color, align } =
|
|
34
|
-
value;
|
|
35
|
-
return isString(family) &&
|
|
36
|
-
isString(size) &&
|
|
37
|
-
isString(weight) &&
|
|
38
|
-
isString(lineHeight) &&
|
|
39
|
-
isString(letterSpacing) &&
|
|
40
|
-
isString(color) &&
|
|
41
|
-
isString(align)
|
|
42
|
-
? { family, size, weight, lineHeight, letterSpacing, color, align }
|
|
43
|
-
: undefined;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function parseBlockRect(
|
|
47
|
-
value: JsonValue | undefined,
|
|
48
|
-
): PreviewBlockRect | undefined {
|
|
49
|
-
if (!isObjectValue(value) || !isString(value.path)) return undefined;
|
|
50
|
-
const rect = parseRect(value.rect);
|
|
51
|
-
return rect ? { path: value.path, rect } : undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Where each block of a preview sits, or undefined when any entry is malformed. */
|
|
55
|
-
export function parseBlockRects(
|
|
56
|
-
value: JsonValue | undefined,
|
|
57
|
-
): PreviewBlockRect[] | undefined {
|
|
58
|
-
if (!Array.isArray(value)) return undefined;
|
|
59
|
-
const blocks = value.map(parseBlockRect);
|
|
60
|
-
return blocks.every((block) => block !== undefined) ? blocks : undefined;
|
|
61
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** The dot grid of the DMS canvases: the flow canvas's background and the mockup viewer's. */
|
|
2
|
-
export const DOT_GRID = Object.freeze({
|
|
3
|
-
/** Step between two dots, in px at zoom 1. */
|
|
4
|
-
gap: 24,
|
|
5
|
-
/** Diameter of a dot, in px at zoom 1. */
|
|
6
|
-
size: 1.2,
|
|
7
|
-
color: "rgba(127, 140, 170, 0.25)",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
/** Where a canvas looks: screen = `x` + world × `zoom`, as Vue Flow's viewport and the Overview's camera both measure it. */
|
|
11
|
-
export interface DotGridView {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
zoom: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const FLAT_VIEW: DotGridView = { x: 0, y: 0, zoom: 1 };
|
|
18
|
-
|
|
19
|
-
const radius = DOT_GRID.size / 2;
|
|
20
|
-
const TILE = `url("data:image/svg+xml,${encodeURIComponent(
|
|
21
|
-
`<svg xmlns="http://www.w3.org/2000/svg" width="${DOT_GRID.gap}" height="${DOT_GRID.gap}"><circle cx="${radius}" cy="${radius}" r="${radius}" fill="${DOT_GRID.color}"/></svg>`,
|
|
22
|
-
)}")`;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The CSS background that draws {@link DOT_GRID} on a surface seen through
|
|
26
|
-
* `view`. It repeats the tile Vue Flow's `<Background variant="dots">` draws,
|
|
27
|
-
* at the same phase, so a dot sits where the flow canvas would put it.
|
|
28
|
-
*/
|
|
29
|
-
export function dotGridStyle(view: DotGridView = FLAT_VIEW) {
|
|
30
|
-
const step = DOT_GRID.gap * view.zoom;
|
|
31
|
-
const shift = 1 + step / 2;
|
|
32
|
-
return {
|
|
33
|
-
backgroundImage: TILE,
|
|
34
|
-
backgroundSize: `${step}px ${step}px`,
|
|
35
|
-
backgroundPosition: `${view.x - shift}px ${view.y - shift}px`,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/** A country whose company registration number is read. */
|
|
2
|
-
export type CompanyNumberCountry = "BE" | "FR";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* What a person types, without its spaces, dots, dashes and
|
|
6
|
-
* slashes, in upper case.
|
|
7
|
-
*/
|
|
8
|
-
export function compactIdentifier(value: string): string {
|
|
9
|
-
return value.replace(/[\s.\-/]/g, "").toUpperCase();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** The remainder of a digit string of any length divided by 97. */
|
|
13
|
-
function mod97(digits: string): number {
|
|
14
|
-
let remainder = 0;
|
|
15
|
-
for (const digit of digits) {
|
|
16
|
-
remainder = (remainder * 10 + Number(digit)) % 97;
|
|
17
|
-
}
|
|
18
|
-
return remainder;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** Whether a digit string passes the Luhn check (ISO/IEC 7812). */
|
|
22
|
-
function passesLuhn(digits: string): boolean {
|
|
23
|
-
let sum = 0;
|
|
24
|
-
for (let index = 0; index < digits.length; index++) {
|
|
25
|
-
const digit = Number(digits[digits.length - 1 - index]);
|
|
26
|
-
const weighted = index % 2 === 1 ? digit * 2 : digit;
|
|
27
|
-
sum += weighted > 9 ? weighted - 9 : weighted;
|
|
28
|
-
}
|
|
29
|
-
return sum % 10 === 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const IBAN = /^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* An IBAN without spaces (`BE68539007547034`), checked against its
|
|
36
|
-
* two check digits (ISO 13616, modulo 97); `undefined` when it is none.
|
|
37
|
-
*/
|
|
38
|
-
export function readIban(value: string): string | undefined {
|
|
39
|
-
const iban = compactIdentifier(value);
|
|
40
|
-
if (!IBAN.test(iban)) return undefined;
|
|
41
|
-
const numeric = `${iban.slice(4)}${iban.slice(0, 4)}`.replace(
|
|
42
|
-
/[A-Z]/g,
|
|
43
|
-
(letter) => String(letter.charCodeAt(0) - 55),
|
|
44
|
-
);
|
|
45
|
-
return mod97(numeric) === 1 ? iban : undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** An IBAN as printed, in groups of four: `BE68 5390 0754 7034`. */
|
|
49
|
-
export function formatIban(iban: string): string {
|
|
50
|
-
return iban.replace(/(.{4})(?=.)/g, "$1 ");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const BIC = /^[A-Z0-9]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?$/;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* A BIC of 8 or 11 characters (ISO 9362): party prefix, country,
|
|
57
|
-
* location and an optional branch; `undefined` when it is none.
|
|
58
|
-
*/
|
|
59
|
-
export function readBic(value: string): string | undefined {
|
|
60
|
-
const bic = compactIdentifier(value);
|
|
61
|
-
return BIC.test(bic) ? bic : undefined;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** The ten digits of a Belgian enterprise number, or `undefined`. */
|
|
65
|
-
function readBelgianEnterpriseNumber(digits: string): string | undefined {
|
|
66
|
-
const number = digits.length === 9 ? `0${digits}` : digits;
|
|
67
|
-
if (!/^[01]\d{9}$/.test(number)) return undefined;
|
|
68
|
-
const check = 97 - mod97(number.slice(0, 8));
|
|
69
|
-
return check === Number(number.slice(8)) ? number : undefined;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** The nine digits of a French SIREN, or `undefined`. */
|
|
73
|
-
function readSiren(digits: string): string | undefined {
|
|
74
|
-
return /^\d{9}$/.test(digits) && passesLuhn(digits) ? digits : undefined;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const COMPANY_NUMBER_READERS = new Map<
|
|
78
|
-
string,
|
|
79
|
-
(digits: string) => string | undefined
|
|
80
|
-
>([
|
|
81
|
-
["BE", readBelgianEnterpriseNumber],
|
|
82
|
-
["FR", readSiren],
|
|
83
|
-
]);
|
|
84
|
-
|
|
85
|
-
/** Whether `country` is one whose company number is read. */
|
|
86
|
-
export function isCompanyNumberCountry(
|
|
87
|
-
country: unknown,
|
|
88
|
-
): country is CompanyNumberCountry {
|
|
89
|
-
return typeof country === "string" && COMPANY_NUMBER_READERS.has(country);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* A company registration number of `country` as its register
|
|
94
|
-
* writes it, digits only: a Belgian enterprise number of ten digits (the
|
|
95
|
-
* nine of before 2005 get their leading zero), a French SIREN of nine.
|
|
96
|
-
* Typed with its country's code in front (`BE 0123.456.749`), it reads the
|
|
97
|
-
* same. `undefined` when it is none.
|
|
98
|
-
*/
|
|
99
|
-
export function readCompanyNumber(
|
|
100
|
-
value: string,
|
|
101
|
-
country: CompanyNumberCountry,
|
|
102
|
-
): string | undefined {
|
|
103
|
-
const compact = compactIdentifier(value);
|
|
104
|
-
const digits = compact.startsWith(country)
|
|
105
|
-
? compact.slice(country.length)
|
|
106
|
-
: compact;
|
|
107
|
-
return COMPANY_NUMBER_READERS.get(country)?.(digits);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* A company registration number as its country prints it:
|
|
112
|
-
* `0123.456.749` in Belgium, `123 456 782` in France.
|
|
113
|
-
*/
|
|
114
|
-
export function formatCompanyNumber(
|
|
115
|
-
number: string,
|
|
116
|
-
country: CompanyNumberCountry,
|
|
117
|
-
): string {
|
|
118
|
-
if (country === "BE") {
|
|
119
|
-
return `${number.slice(0, 4)}.${number.slice(4, 7)}.${number.slice(7)}`;
|
|
120
|
-
}
|
|
121
|
-
return number.replace(/(\d{3})(?=\d)/g, "$1 ");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The format of each country's VAT number after its country code, as the
|
|
126
|
-
* EU's VIES service lists it, plus Northern Ireland (`XI`) and Great Britain.
|
|
127
|
-
*/
|
|
128
|
-
const VAT_NUMBER_FORMATS = new Map<string, RegExp>([
|
|
129
|
-
["AT", /^U\d{8}$/],
|
|
130
|
-
["BE", /^[01]\d{9}$/],
|
|
131
|
-
["BG", /^\d{9,10}$/],
|
|
132
|
-
["CY", /^\d{8}[A-Z]$/],
|
|
133
|
-
["CZ", /^\d{8,10}$/],
|
|
134
|
-
["DE", /^\d{9}$/],
|
|
135
|
-
["DK", /^\d{8}$/],
|
|
136
|
-
["EE", /^\d{9}$/],
|
|
137
|
-
["EL", /^\d{9}$/],
|
|
138
|
-
["ES", /^[A-Z0-9]\d{7}[A-Z0-9]$/],
|
|
139
|
-
["FI", /^\d{8}$/],
|
|
140
|
-
["FR", /^[A-HJ-NP-Z0-9]{2}\d{9}$/],
|
|
141
|
-
["GB", /^(?:\d{9}|\d{12}|GD\d{3}|HA\d{3})$/],
|
|
142
|
-
["HR", /^\d{11}$/],
|
|
143
|
-
["HU", /^\d{8}$/],
|
|
144
|
-
["IE", /^(?:\d{7}[A-W][A-IW]?|\d[A-Z+*]\d{5}[A-W])$/],
|
|
145
|
-
["IT", /^\d{11}$/],
|
|
146
|
-
["LT", /^(?:\d{9}|\d{12})$/],
|
|
147
|
-
["LU", /^\d{8}$/],
|
|
148
|
-
["LV", /^\d{11}$/],
|
|
149
|
-
["MT", /^\d{8}$/],
|
|
150
|
-
["NL", /^\d{9}B\d{2}$/],
|
|
151
|
-
["PL", /^\d{10}$/],
|
|
152
|
-
["PT", /^\d{9}$/],
|
|
153
|
-
["RO", /^[1-9]\d{1,9}$/],
|
|
154
|
-
["SE", /^\d{10}01$/],
|
|
155
|
-
["SI", /^\d{8}$/],
|
|
156
|
-
["SK", /^\d{10}$/],
|
|
157
|
-
["XI", /^(?:\d{9}|\d{12}|GD\d{3}|HA\d{3})$/],
|
|
158
|
-
]);
|
|
159
|
-
|
|
160
|
-
/** German VAT check digit: ISO 7064 MOD 11,10 over the first eight digits. */
|
|
161
|
-
function passesGermanCheck(number: string): boolean {
|
|
162
|
-
let product = 10;
|
|
163
|
-
for (const digit of number.slice(0, 8)) {
|
|
164
|
-
let sum = (Number(digit) + product) % 10;
|
|
165
|
-
if (sum === 0) sum = 10;
|
|
166
|
-
product = (2 * sum) % 11;
|
|
167
|
-
}
|
|
168
|
-
const check = (11 - product) % 10;
|
|
169
|
-
return check === Number(number[8]);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/** French VAT key: `(12 + 3 × (SIREN mod 97)) mod 97`, when it is numeric. */
|
|
173
|
-
function passesFrenchCheck(number: string): boolean {
|
|
174
|
-
const key = number.slice(0, 2);
|
|
175
|
-
if (!/^\d{2}$/.test(key)) return true;
|
|
176
|
-
const siren = number.slice(2);
|
|
177
|
-
return Number(key) === (12 + 3 * mod97(siren)) % 97;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** Luxembourg VAT: the first six digits modulo 89 are the last two. */
|
|
181
|
-
function passesLuxembourgCheck(number: string): boolean {
|
|
182
|
-
return Number(number.slice(0, 6)) % 89 === Number(number.slice(6));
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** The check digits of the countries whose public rule is stable; the format only elsewhere. */
|
|
186
|
-
const VAT_CHECKS = new Map<string, (number: string) => boolean>([
|
|
187
|
-
["BE", (number) => readBelgianEnterpriseNumber(number) !== undefined],
|
|
188
|
-
["DE", passesGermanCheck],
|
|
189
|
-
["FR", passesFrenchCheck],
|
|
190
|
-
["IT", passesLuhn],
|
|
191
|
-
["LU", passesLuxembourgCheck],
|
|
192
|
-
]);
|
|
193
|
-
|
|
194
|
-
/** The code a person may type for a VAT country, read as VIES writes it. */
|
|
195
|
-
const VAT_PREFIX_ALIASES = new Map([["GR", "EL"]]);
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* A VAT number as VIES writes it (`BE0123456749`): its country's
|
|
199
|
-
* code, then its number without spaces. The number must have its country's
|
|
200
|
-
* format; Belgium, Germany, France, Italy and Luxembourg also check its check
|
|
201
|
-
* digits. A number typed without its country's code reads in
|
|
202
|
-
* `defaultCountry`, and a Belgian one of nine digits gets its leading zero.
|
|
203
|
-
* `undefined` when it is none.
|
|
204
|
-
*/
|
|
205
|
-
export function readVatNumber(
|
|
206
|
-
value: string,
|
|
207
|
-
defaultCountry?: string,
|
|
208
|
-
): string | undefined {
|
|
209
|
-
const compact = compactIdentifier(value);
|
|
210
|
-
const typedPrefix = compact.slice(0, 2);
|
|
211
|
-
const isPrefixed = /^[A-Z]{2}$/.test(typedPrefix);
|
|
212
|
-
const prefix = isPrefixed ? typedPrefix : defaultCountry?.toUpperCase();
|
|
213
|
-
if (!prefix) return undefined;
|
|
214
|
-
const country = VAT_PREFIX_ALIASES.get(prefix) ?? prefix;
|
|
215
|
-
const format = VAT_NUMBER_FORMATS.get(country);
|
|
216
|
-
if (!format) return undefined;
|
|
217
|
-
const typed = isPrefixed ? compact.slice(2) : compact;
|
|
218
|
-
const number = country === "BE" && typed.length === 9 ? `0${typed}` : typed;
|
|
219
|
-
if (!format.test(number)) return undefined;
|
|
220
|
-
const check = VAT_CHECKS.get(country);
|
|
221
|
-
if (check && !check(number)) return undefined;
|
|
222
|
-
return `${country}${number}`;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/** The identifier a field holds; the input's `identifier` option. */
|
|
226
|
-
export type IdentifierKind = "iban" | "bic" | "vat_number" | "company_number";
|
|
227
|
-
|
|
228
|
-
/** The options of the identifier input a reading depends on. */
|
|
229
|
-
export interface IdentifierRule {
|
|
230
|
-
identifier: IdentifierKind;
|
|
231
|
-
/** `vat_number`: the country a number without its code is read in. */
|
|
232
|
-
defaultCountry?: string;
|
|
233
|
-
/** `company_number`: the country whose register the number belongs to. */
|
|
234
|
-
country?: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const IDENTIFIER_READERS: Record<
|
|
238
|
-
IdentifierKind,
|
|
239
|
-
(value: string, rule: IdentifierRule) => string | undefined
|
|
240
|
-
> = {
|
|
241
|
-
iban: readIban,
|
|
242
|
-
bic: readBic,
|
|
243
|
-
vat_number: (value, rule) => readVatNumber(value, rule.defaultCountry),
|
|
244
|
-
company_number: (value, rule) =>
|
|
245
|
-
isCompanyNumberCountry(rule.country)
|
|
246
|
-
? readCompanyNumber(value, rule.country)
|
|
247
|
-
: undefined,
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* The stored form of what was typed into an identifier input, or
|
|
252
|
-
* `undefined` when it is not an identifier of the field's kind.
|
|
253
|
-
*/
|
|
254
|
-
export function readIdentifier(
|
|
255
|
-
value: string,
|
|
256
|
-
rule: IdentifierRule,
|
|
257
|
-
): string | undefined {
|
|
258
|
-
return IDENTIFIER_READERS[rule.identifier](value, rule);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* A stored identifier as it is printed: an IBAN in groups of four, a
|
|
263
|
-
* company number as its country writes it, the others as stored.
|
|
264
|
-
*/
|
|
265
|
-
export function formatIdentifier(value: string, rule: IdentifierRule): string {
|
|
266
|
-
if (rule.identifier === "iban") return formatIban(value);
|
|
267
|
-
if (
|
|
268
|
-
rule.identifier === "company_number" &&
|
|
269
|
-
isCompanyNumberCountry(rule.country)
|
|
270
|
-
) {
|
|
271
|
-
return formatCompanyNumber(value, rule.country);
|
|
272
|
-
}
|
|
273
|
-
return value;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/** The message key a refused identifier of `kind` shows. */
|
|
277
|
-
export function identifierErrorKey(kind: IdentifierKind): string {
|
|
278
|
-
return `dms.field_errors.invalid_${kind}`;
|
|
279
|
-
}
|