@antelopejs/dms 0.20.2 → 0.20.4
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 +49 -0
- package/README.md +1 -1
- package/dist/config/internal/state.d.ts +5 -3
- package/dist/config/internal/state.js +9 -1
- package/dist/config/internal/state.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-targets.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js +276 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
- package/dist/implementations/dms-builder/engine/driver-packages.js +16 -4
- package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/index.js +1 -0
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -1
- package/dist/implementations/dms-html-render/index.js +5 -2
- package/dist/implementations/dms-html-render/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +1 -0
- package/dist/mcp/page-verify/index.js +1 -0
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/redact-report.d.ts +2 -0
- package/dist/mcp/page-verify/redact-report.js +120 -0
- package/dist/mcp/page-verify/redact-report.js.map +1 -0
- package/dist/mcp/page-verify/render.js +4 -1
- package/dist/mcp/page-verify/render.js.map +1 -1
- package/dist/mcp/redact.d.ts +87 -0
- package/dist/mcp/redact.js +139 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/tools/builder-compose.js +11 -2
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-project.js +59 -26
- package/dist/mcp/tools/builder-project.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +41 -4
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-shared.d.ts +3 -1
- package/dist/mcp/tools/builder-shared.js +5 -0
- package/dist/mcp/tools/builder-shared.js.map +1 -1
- package/dist/mcp/tools/database.js +3 -2
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/page-verify.js +3 -2
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/frontend-vue/dms.frontend.ts +6 -2
- package/frontend-vue/eslint-globals.generated.mjs +259 -942
- package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +5 -3
- package/frontend-vue/layers/dms-auth/app/composables/useOAuthErrorToast.ts +6 -4
- package/frontend-vue/layers/dms-auth/app/composables/usePostLoginRedirect.ts +3 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +12 -4
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +12 -6
- package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +4 -2
- package/frontend-vue/layers/dms-auth/server/oauth.ts +13 -7
- package/frontend-vue/layers/dms-auth/server/session.ts +37 -6
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
- package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
- package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
- package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
- package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
- package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
- package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
- package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
- package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
- package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
- package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
- package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
- package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
- package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
- package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
- package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
- package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
- package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
- package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
- package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
- package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
- package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
- package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
- package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +5 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +11 -13
- package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +6 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +12 -10
- package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +7 -4
- package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +59 -31
- package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +37 -24
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -4
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/profile/ProfileSummaryRow.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/security/SecuritySessions.vue +35 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +4 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +26 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/security/useSessionHandoff.ts +3 -6
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useAccountData.ts +16 -12
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +12 -9
- package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +13 -6
- package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +81 -0
- package/frontend-vue/layers/dms-layout/app/build/utils/submittedUrl.ts +14 -0
- package/frontend-vue/layers/dms-layout/app/components/AppWidgetsDock.vue +3 -1
- package/frontend-vue/layers/dms-layout/app/composables/general/useSystemState.ts +4 -5
- package/frontend-vue/layers/dms-layout/app/composables/layout/useServedHeaderActions.ts +7 -5
- package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStoreActions.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +17 -4
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageComponentPreload.ts +15 -7
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageRecordDeletion.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/profile/useUserLanguage.ts +3 -2
- package/frontend-vue/layers/dms-layout/app/composables/useCommandPaletteSources.ts +20 -2
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/roles.vue +5 -1
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/shortcuts.vue +4 -1
- package/frontend-vue/layers/dms-layout/app/pages/[...slug].vue +13 -5
- package/frontend-vue/layers/dms-layout/app/plugins/command-palette-session.client.ts +8 -8
- package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-mcp-navigate.client.ts +4 -2
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/plugins/notification-stream.client.ts +47 -40
- package/frontend-vue/layers/dms-layout/app/plugins/permission-preview.client.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/plugins/profile-sync.client.ts +3 -10
- package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +3 -2
- package/frontend-vue/layers/dms-layout/server/html-render.ts +5 -1
- package/frontend-vue/layers/dms-layout/server/render-token.ts +3 -2
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
- package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
- package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetActions.ts +24 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetConfirmation.ts +53 -30
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +8 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetTypes.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowNavigation.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +156 -99
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +194 -161
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/blockDataState.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useGuard.ts +38 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +34 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexSeriesStyle.ts +32 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +13 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/useActionConfirm.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +23 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultChoiceTypes.ts +11 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +7 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +22 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +5 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +10 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +12 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +4 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +10 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +21 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/detach.ts +9 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/files/useFileMetadata.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +38 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +6 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +19 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentCancel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +28 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +5 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +15 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/form/registerFormFunctions.ts +7 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/stringSet.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +60 -16
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +5 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +13 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/layout/rowSidePanel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/currentPageLive.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/liveCadence.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/missedTally.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/live/pageLiveController.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/usePageDataRefresh.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +42 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +63 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnStructure.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +71 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableStates.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/rowId.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +21 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionBulkRequests.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +1 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionNavigation.ts +12 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +25 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewCounts.ts +4 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +18 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewEvents.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickActions.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickFilters.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useCardFields.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useReorderHandles.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +19 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRecordLink.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableReorder.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/bulkActions.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +14 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/expandedRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +12 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/reorder.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/sortableColumns.ts +38 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableCounts.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +14 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +22 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +27 -6
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
- package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
- package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
- package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
- package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
- package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
- package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
- package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
- package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
- package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
- package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
- package/frontend-vue/lazy-plugin.ts +1 -1
- package/frontend-vue/package.json +5 -4
- package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
- package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
- package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
- package/frontend-vue/scripts/check-dms-components.mjs +152 -246
- package/frontend-vue/scripts/check-invariants.mjs +100 -42
- package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
- package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
- package/frontend-vue/scripts/dms-components-script.mjs +375 -0
- package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
- package/frontend-vue/scripts/jsconfig.json +10 -0
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
- package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
- package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
- package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
- package/frontend-vue/scripts/test-dms-components.mjs +70 -5
- package/frontend-vue/server/request-body.ts +29 -5
- package/package.json +5 -3
- package/frontend-vue/eslint-test-quality.mjs +0 -62
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
| Date
|
|
6
|
-
| null
|
|
7
|
-
| undefined
|
|
8
|
-
| Record<string, unknown>
|
|
9
|
-
| unknown[];
|
|
1
|
+
import { isJsonValue } from "../build/utils/json";
|
|
2
|
+
import type { JsonValue } from "../types/json";
|
|
3
|
+
|
|
4
|
+
export type Primitive = JsonValue | Date | undefined;
|
|
10
5
|
|
|
11
6
|
const KEYWORD_VALUES: Record<
|
|
12
7
|
Parameters<typeof isKeyword>[0],
|
|
@@ -33,7 +28,10 @@ const PARSER_REGISTRY = [
|
|
|
33
28
|
},
|
|
34
29
|
{
|
|
35
30
|
test: isStringJSON,
|
|
36
|
-
parse: (value: string) =>
|
|
31
|
+
parse: (value: string): Primitive => {
|
|
32
|
+
const parsed: unknown = JSON.parse(value);
|
|
33
|
+
return isJsonValue(parsed) ? parsed : value;
|
|
34
|
+
},
|
|
37
35
|
},
|
|
38
36
|
];
|
|
39
37
|
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
/** Any function: what it returns is unknown until a guard reads it. */
|
|
2
|
+
type CallableFunction = (...args: any[]) => Parameters<typeof isNull>[0];
|
|
3
|
+
|
|
4
|
+
/** The type each `typeof` result a guard below tests for narrows to. */
|
|
5
|
+
interface TypeofResults {
|
|
6
|
+
string: string;
|
|
7
|
+
number: number;
|
|
8
|
+
boolean: boolean;
|
|
9
|
+
undefined: undefined;
|
|
10
|
+
function: CallableFunction;
|
|
11
|
+
bigint: bigint;
|
|
12
|
+
symbol: symbol;
|
|
13
|
+
}
|
|
2
14
|
|
|
3
15
|
const createTypeGuard =
|
|
4
|
-
<
|
|
5
|
-
(v: unknown): v is
|
|
16
|
+
<K extends keyof TypeofResults>(type: K) =>
|
|
17
|
+
(v: unknown): v is TypeofResults[K] =>
|
|
6
18
|
typeof v === type;
|
|
7
19
|
|
|
8
|
-
export const isString = createTypeGuard
|
|
9
|
-
export const isNumber = createTypeGuard
|
|
10
|
-
export const isBoolean = createTypeGuard
|
|
11
|
-
export const isUndefined = createTypeGuard
|
|
12
|
-
export const isObject =
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
20
|
+
export const isString = createTypeGuard("string");
|
|
21
|
+
export const isNumber = createTypeGuard("number");
|
|
22
|
+
export const isBoolean = createTypeGuard("boolean");
|
|
23
|
+
export const isUndefined = createTypeGuard("undefined");
|
|
24
|
+
export const isObject = (v: unknown): v is Record<string, unknown> =>
|
|
25
|
+
typeof v === "object";
|
|
26
|
+
export const isFunction = createTypeGuard("function");
|
|
27
|
+
export const isBigint = createTypeGuard("bigint");
|
|
28
|
+
export const isSymbol = createTypeGuard("symbol");
|
|
16
29
|
|
|
17
30
|
export const isNull = (value: unknown): value is null => value === null;
|
|
18
31
|
|
|
@@ -24,7 +37,7 @@ export const isJSON = (value: Parameters<typeof isString>[0]): boolean => {
|
|
|
24
37
|
return false;
|
|
25
38
|
}
|
|
26
39
|
try {
|
|
27
|
-
const parsed = JSON.parse(value);
|
|
40
|
+
const parsed: unknown = JSON.parse(value);
|
|
28
41
|
return isObject(parsed) && !isNull(parsed);
|
|
29
42
|
} catch {
|
|
30
43
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from "vue";
|
|
2
|
+
import { type ComponentPublicInstance, ref } from "vue";
|
|
3
3
|
import { backgroundHex } from "./color-input";
|
|
4
4
|
import { THEME_MODES, type ThemeMode } from "./theme-types";
|
|
5
5
|
|
|
@@ -23,7 +23,10 @@ const pickerValue = ref<Record<ThemeMode, string>>({
|
|
|
23
23
|
dark: "#000000",
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
function setHalf(
|
|
26
|
+
function setHalf(
|
|
27
|
+
mode: ThemeMode,
|
|
28
|
+
element: Element | ComponentPublicInstance | null,
|
|
29
|
+
): void {
|
|
27
30
|
halves[mode] = element instanceof HTMLElement ? element : null;
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isString } from "#dms-core/app/utils/type-check";
|
|
1
2
|
import {
|
|
2
3
|
logoKey,
|
|
3
4
|
parseLogoKey,
|
|
@@ -235,7 +236,7 @@ async function storedBlob(
|
|
|
235
236
|
store.get(blobKeyOf(layer, name)),
|
|
236
237
|
);
|
|
237
238
|
const value: unknown = found?.result;
|
|
238
|
-
return
|
|
239
|
+
return isString(value) ? value : undefined;
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
/** The draft with a slot showing in a mode what the saved theme holds there. */
|
|
@@ -73,21 +73,21 @@ export function withoutLogo(
|
|
|
73
73
|
export const MAX_LOGO_BYTES = 512 * 1024;
|
|
74
74
|
|
|
75
75
|
/** The types the module accepts, by the extension they are picked by. */
|
|
76
|
-
const LOGO_TYPES_BY_EXTENSION
|
|
77
|
-
svg
|
|
78
|
-
png
|
|
79
|
-
jpg
|
|
80
|
-
jpeg
|
|
81
|
-
webp
|
|
82
|
-
ico
|
|
83
|
-
|
|
76
|
+
const LOGO_TYPES_BY_EXTENSION = new Map<string, readonly string[]>([
|
|
77
|
+
["svg", ["image/svg+xml"]],
|
|
78
|
+
["png", ["image/png"]],
|
|
79
|
+
["jpg", ["image/jpeg"]],
|
|
80
|
+
["jpeg", ["image/jpeg"]],
|
|
81
|
+
["webp", ["image/webp"]],
|
|
82
|
+
["ico", ["image/x-icon", "image/vnd.microsoft.icon"]],
|
|
83
|
+
]);
|
|
84
84
|
|
|
85
|
-
const ACCEPTED_TYPES =
|
|
85
|
+
const ACCEPTED_TYPES = [...LOGO_TYPES_BY_EXTENSION.values()].flat();
|
|
86
86
|
|
|
87
87
|
export const LOGO_INPUT_ACCEPT = [
|
|
88
88
|
...new Set([
|
|
89
89
|
...ACCEPTED_TYPES,
|
|
90
|
-
...
|
|
90
|
+
...[...LOGO_TYPES_BY_EXTENSION.keys()].map((extension) => `.${extension}`),
|
|
91
91
|
]),
|
|
92
92
|
].join(",");
|
|
93
93
|
|
|
@@ -99,9 +99,7 @@ export function logoContentType(file: PickedFile): string | undefined {
|
|
|
99
99
|
return ACCEPTED_TYPES.includes(file.type) ? file.type : undefined;
|
|
100
100
|
}
|
|
101
101
|
const extension = file.name.split(".").pop()?.toLowerCase() ?? "";
|
|
102
|
-
return
|
|
103
|
-
? LOGO_TYPES_BY_EXTENSION[extension]?.[0]
|
|
104
|
-
: undefined;
|
|
102
|
+
return LOGO_TYPES_BY_EXTENSION.get(extension)?.[0];
|
|
105
103
|
}
|
|
106
104
|
|
|
107
105
|
/** Why a file cannot be a logo, as an i18n key, before it is sent. */
|
|
@@ -83,9 +83,13 @@ export function editOf(saved: SavedTheme): ThemeEdit {
|
|
|
83
83
|
|
|
84
84
|
type Values = Partial<Record<string, string>>;
|
|
85
85
|
|
|
86
|
+
function ownValue(values: Values, key: string): string | undefined {
|
|
87
|
+
return Object.hasOwn(values, key) ? values[key] : undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
86
90
|
function differingKeys(next: Values, saved: Values): string[] {
|
|
87
91
|
return [...new Set([...Object.keys(next), ...Object.keys(saved)])].filter(
|
|
88
|
-
(key) => next
|
|
92
|
+
(key) => ownValue(next, key) !== ownValue(saved, key),
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
95
|
|
|
@@ -134,7 +138,7 @@ function rebaseValues(
|
|
|
134
138
|
),
|
|
135
139
|
);
|
|
136
140
|
for (const key of differingKeys(draft, from)) {
|
|
137
|
-
const value = draft
|
|
141
|
+
const value = ownValue(draft, key);
|
|
138
142
|
if (value === undefined) result.delete(key);
|
|
139
143
|
else result.set(key, value);
|
|
140
144
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PALETTE_SHADES, paletteShade } from "./catalog";
|
|
2
|
-
import
|
|
2
|
+
import { isFunction, isUndefined } from "#dms-core/app/utils/type-check";
|
|
3
|
+
import type { ThemeDraft, ThemeMode, ThemeVariables } from "./theme-types";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The custom properties the DMS's own stylesheets declare, raw (`var(...)`
|
|
@@ -57,12 +58,12 @@ function modeOf(selectorText: string): keyof DmsTokens | undefined {
|
|
|
57
58
|
function holds(rule: ReadableRule): boolean {
|
|
58
59
|
if (rule.media) {
|
|
59
60
|
return (
|
|
60
|
-
|
|
61
|
+
!isFunction(globalThis.matchMedia) ||
|
|
61
62
|
matchMedia(rule.media.mediaText).matches
|
|
62
63
|
);
|
|
63
64
|
}
|
|
64
65
|
if (rule.conditionText !== undefined) {
|
|
65
|
-
return
|
|
66
|
+
return isUndefined(globalThis.CSS) || CSS.supports(rule.conditionText);
|
|
66
67
|
}
|
|
67
68
|
return true;
|
|
68
69
|
}
|
|
@@ -147,15 +148,15 @@ export interface PreviewStyleInput {
|
|
|
147
148
|
function paletteVariables(
|
|
148
149
|
draft: ThemeDraft,
|
|
149
150
|
dmsColors: PreviewStyleInput["dmsColors"],
|
|
150
|
-
):
|
|
151
|
+
): ThemeVariables {
|
|
151
152
|
const roles = new Set([
|
|
152
153
|
...Object.keys(dmsColors),
|
|
153
154
|
...Object.keys(draft.colors),
|
|
154
155
|
]);
|
|
155
|
-
const draftColors
|
|
156
|
-
const variables:
|
|
156
|
+
const draftColors = new Map(Object.entries(draft.colors));
|
|
157
|
+
const variables: ThemeVariables = {};
|
|
157
158
|
for (const role of roles) {
|
|
158
|
-
const palette = draftColors
|
|
159
|
+
const palette = draftColors.get(role) ?? dmsColors[role];
|
|
159
160
|
if (!palette) continue;
|
|
160
161
|
for (const shade of PALETTE_SHADES) {
|
|
161
162
|
variables[`--ui-color-${role}-${shade}`] = paletteShade(palette, shade);
|
|
@@ -170,11 +171,12 @@ function paletteVariables(
|
|
|
170
171
|
* draft's shared and mode values. Inline beats every stylesheet rule, so the
|
|
171
172
|
* saved theme and the page's own mode cannot leak in.
|
|
172
173
|
*/
|
|
173
|
-
export function previewStyle(input: PreviewStyleInput):
|
|
174
|
+
export function previewStyle(input: PreviewStyleInput): ThemeVariables {
|
|
174
175
|
const { tokens, draft, mode } = input;
|
|
176
|
+
const modeTokens =
|
|
177
|
+
mode === "dark" ? { ...tokens.light, ...tokens.dark } : tokens.light;
|
|
175
178
|
return {
|
|
176
|
-
...
|
|
177
|
-
...(mode === "dark" ? tokens.dark : {}),
|
|
179
|
+
...modeTokens,
|
|
178
180
|
...paletteVariables(draft, input.dmsColors),
|
|
179
181
|
...draft.variables.shared,
|
|
180
182
|
...draft.variables[mode],
|
|
@@ -33,11 +33,14 @@ export function svgAspect(text: string): number | undefined {
|
|
|
33
33
|
return width > 0 && height > 0 ? width / height : undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/** A drawing's size in pixels. */
|
|
37
|
+
interface PixelSize {
|
|
38
38
|
width: number;
|
|
39
39
|
height: number;
|
|
40
|
-
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The email header's size for an aspect ratio. */
|
|
43
|
+
export function emailLogoSize(aspect: number): PixelSize {
|
|
41
44
|
const width = Math.min(
|
|
42
45
|
Math.round(EMAIL_LOGO_HEIGHT * aspect),
|
|
43
46
|
EMAIL_LOGO_MAX_WIDTH,
|
|
@@ -57,7 +60,7 @@ function loadImage(url: string): Promise<HTMLImageElement> {
|
|
|
57
60
|
function drawnSize(
|
|
58
61
|
image: HTMLImageElement,
|
|
59
62
|
svgText: string | undefined,
|
|
60
|
-
):
|
|
63
|
+
): PixelSize {
|
|
61
64
|
const width = image.naturalWidth || 1;
|
|
62
65
|
const height = image.naturalHeight || 1;
|
|
63
66
|
if (svgText !== undefined) {
|
|
@@ -89,6 +89,27 @@ async function pendingLogoOf(file: File): Promise<PendingLogo | undefined> {
|
|
|
89
89
|
: undefined;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Where a picked file goes: the file itself in each target, except the email
|
|
94
|
+
* slot, which takes a copy mail clients can show. A target whose logo cannot
|
|
95
|
+
* be drawn gets no placement.
|
|
96
|
+
*/
|
|
97
|
+
async function placementsOf(
|
|
98
|
+
targets: Omit<LogoPlacement, "logo">[],
|
|
99
|
+
file: File,
|
|
100
|
+
): Promise<LogoPlacement[]> {
|
|
101
|
+
const picked = await pendingLogoOf(file);
|
|
102
|
+
const needsRaster = targets.some(({ slot }) => slot === "email");
|
|
103
|
+
const mailFile =
|
|
104
|
+
needsRaster && !isMailable(file) ? await rasterizeForEmail(file) : file;
|
|
105
|
+
const mailLogo = mailFile ? await pendingLogoOf(mailFile) : undefined;
|
|
106
|
+
const logoFor = (slot: LogoSlot) => (slot === "email" ? mailLogo : picked);
|
|
107
|
+
return targets.flatMap((target) => {
|
|
108
|
+
const logo = logoFor(target.slot);
|
|
109
|
+
return logo ? [{ ...target, logo }] : [];
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
92
113
|
function viewerMode(): ThemeMode {
|
|
93
114
|
return typeof document !== "undefined" &&
|
|
94
115
|
document.documentElement.classList.contains("dark")
|
|
@@ -96,6 +117,42 @@ function viewerMode(): ThemeMode {
|
|
|
96
117
|
: "light";
|
|
97
118
|
}
|
|
98
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Keeps the device's copy of the draft in step with `edit`: once the edits
|
|
122
|
+
* settle for {@link DEVICE_SYNC_DELAY_MS}, and at once when the scope ends with
|
|
123
|
+
* a copy still due. The copy is a best effort that never rejects, so nothing
|
|
124
|
+
* waits for it.
|
|
125
|
+
*/
|
|
126
|
+
function syncDeviceDraft(
|
|
127
|
+
load: ShallowRef<BrandingLoad>,
|
|
128
|
+
edit: ComputedRef<ThemeEdit | null>,
|
|
129
|
+
): void {
|
|
130
|
+
let syncTimer: ReturnType<typeof setTimeout> | undefined;
|
|
131
|
+
|
|
132
|
+
function syncDevice(): void {
|
|
133
|
+
syncTimer = undefined;
|
|
134
|
+
const current = edit.value;
|
|
135
|
+
if (!current) return;
|
|
136
|
+
const copied =
|
|
137
|
+
changeCount(current) > 0
|
|
138
|
+
? storeDraft(current)
|
|
139
|
+
: forgetDraft(current.saved.layer);
|
|
140
|
+
copied.catch(() => undefined);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
watch(load, () => {
|
|
144
|
+
clearTimeout(syncTimer);
|
|
145
|
+
syncTimer = setTimeout(syncDevice, DEVICE_SYNC_DELAY_MS);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
onScopeDispose(() => {
|
|
149
|
+
if (syncTimer !== undefined) {
|
|
150
|
+
clearTimeout(syncTimer);
|
|
151
|
+
syncDevice();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
99
156
|
/**
|
|
100
157
|
* The Branding editor's state and actions. The state is one {@link BrandingLoad};
|
|
101
158
|
* every edit goes through the pure functions of `model.ts`.
|
|
@@ -144,16 +201,7 @@ export function useBrandingEditor(api: BrandingApi): BrandingEditor {
|
|
|
144
201
|
const refusal = logoRefusal(file);
|
|
145
202
|
logoProblem.value = refusal ?? null;
|
|
146
203
|
if (refusal) return;
|
|
147
|
-
const
|
|
148
|
-
const needsRaster = targets.some(({ slot }) => slot === "email");
|
|
149
|
-
const mailFile =
|
|
150
|
-
needsRaster && !isMailable(file) ? await rasterizeForEmail(file) : file;
|
|
151
|
-
const mailLogo = mailFile ? await pendingLogoOf(mailFile) : undefined;
|
|
152
|
-
const logoFor = (slot: LogoSlot) => (slot === "email" ? mailLogo : picked);
|
|
153
|
-
const placements = targets.flatMap((target) => {
|
|
154
|
-
const logo = logoFor(target.slot);
|
|
155
|
-
return logo ? [{ ...target, logo }] : [];
|
|
156
|
-
});
|
|
204
|
+
const placements = await placementsOf(targets, file);
|
|
157
205
|
update((current) => placeLogos(current, placements));
|
|
158
206
|
if (placements.length < targets.length) {
|
|
159
207
|
logoProblem.value = "branding.logo.not_drawable";
|
|
@@ -214,27 +262,7 @@ export function useBrandingEditor(api: BrandingApi): BrandingEditor {
|
|
|
214
262
|
load.value = { ...current, created: result.data };
|
|
215
263
|
}
|
|
216
264
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
function syncDevice(): void {
|
|
220
|
-
syncTimer = undefined;
|
|
221
|
-
const current = edit.value;
|
|
222
|
-
if (!current) return;
|
|
223
|
-
if (changeCount(current) > 0) void storeDraft(current);
|
|
224
|
-
else void forgetDraft(current.saved.layer);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
watch(load, () => {
|
|
228
|
-
clearTimeout(syncTimer);
|
|
229
|
-
syncTimer = setTimeout(syncDevice, DEVICE_SYNC_DELAY_MS);
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
onScopeDispose(() => {
|
|
233
|
-
if (syncTimer !== undefined) {
|
|
234
|
-
clearTimeout(syncTimer);
|
|
235
|
-
syncDevice();
|
|
236
|
-
}
|
|
237
|
-
});
|
|
265
|
+
syncDeviceDraft(load, edit);
|
|
238
266
|
|
|
239
267
|
return {
|
|
240
268
|
load,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isFunction } from "#dms-core/app/utils/type-check";
|
|
1
2
|
import { catalogToken, type ThemeValueKind } from "./catalog";
|
|
2
3
|
import type { ThemeDraft } from "./theme-types";
|
|
3
4
|
import { VARIABLE_SET_NAMES } from "./theme-types";
|
|
@@ -56,7 +57,7 @@ function isOfKind(value: string, kind: ThemeValueKind): boolean {
|
|
|
56
57
|
const css = globalThis.CSS;
|
|
57
58
|
return (
|
|
58
59
|
value.trim() === "" ||
|
|
59
|
-
|
|
60
|
+
!isFunction(css?.supports) ||
|
|
60
61
|
css.supports(kind, value)
|
|
61
62
|
);
|
|
62
63
|
}
|
|
@@ -59,7 +59,7 @@ watch(
|
|
|
59
59
|
|
|
60
60
|
function closeOnLinkClick(event: MouseEvent): void {
|
|
61
61
|
if (!sidebarOpen.value) return;
|
|
62
|
-
if (
|
|
62
|
+
if (event.target instanceof Element && event.target.closest("a[href]")) {
|
|
63
63
|
closeMobileSidebar();
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -124,11 +124,11 @@ function baseButton(action: LayoutHeaderAction): ButtonProps {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
type LinkTarget = Extract<ActionTarget, { type: "page" | "external" }>;
|
|
128
127
|
type UrlTarget = Extract<ActionTarget, { url: string }>;
|
|
128
|
+
type QuickActionTarget = Extract<ActionTarget, { type: "quickAction" }>;
|
|
129
129
|
|
|
130
130
|
const hasTargetUrl = (target: ActionTarget): target is UrlTarget =>
|
|
131
|
-
isString(
|
|
131
|
+
"url" in target && isString(target.url);
|
|
132
132
|
|
|
133
133
|
const pageUrlValues = computed(() => ({
|
|
134
134
|
routeParams: siteLayout.findMatchingRoute(route.path)?.params,
|
|
@@ -149,32 +149,44 @@ function withPageValues(action: LayoutHeaderAction): LayoutHeaderAction {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
const LINK_TARGETS: Partial<
|
|
153
|
-
Record<ActionTarget["type"], (target: LinkTarget) => ButtonProps>
|
|
154
|
-
> = {
|
|
155
|
-
page: (target) => ({ to: target.url }),
|
|
156
|
-
external: (target) => {
|
|
157
|
-
const newTab = target.type === "external" && target.newTab;
|
|
158
|
-
return {
|
|
159
|
-
to: target.url,
|
|
160
|
-
target: newTab ? "_blank" : undefined,
|
|
161
|
-
trailingIcon: newTab ? "i-ph-arrow-square-out" : undefined,
|
|
162
|
-
};
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
|
|
166
152
|
function linkProps(action: LayoutHeaderAction): ButtonProps | undefined {
|
|
167
153
|
const { target } = action;
|
|
168
154
|
if (action.confirm || !target) return undefined;
|
|
169
|
-
|
|
155
|
+
if (target.type === "page") return { to: target.url };
|
|
156
|
+
if (target.type !== "external") return undefined;
|
|
157
|
+
return {
|
|
158
|
+
to: target.url,
|
|
159
|
+
target: target.newTab ? "_blank" : undefined,
|
|
160
|
+
trailingIcon: target.newTab ? "i-ph-arrow-square-out" : undefined,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The button the action targets run. A served button with a target is a
|
|
166
|
+
* `PageHeaderButton`, which always carries a label.
|
|
167
|
+
*/
|
|
168
|
+
function customButtonOf(
|
|
169
|
+
action: LayoutHeaderAction,
|
|
170
|
+
target: ActionTarget,
|
|
171
|
+
): CustomButton {
|
|
172
|
+
return {
|
|
173
|
+
label: action.label ?? "",
|
|
174
|
+
target,
|
|
175
|
+
confirm: action.confirm,
|
|
176
|
+
disabled: action.disabled,
|
|
177
|
+
disabledReason: action.disabledReason,
|
|
178
|
+
};
|
|
170
179
|
}
|
|
171
180
|
|
|
172
181
|
function resolveQuickActionButton(
|
|
173
182
|
action: LayoutHeaderAction,
|
|
174
183
|
base: ButtonProps,
|
|
175
|
-
|
|
184
|
+
target: QuickActionTarget,
|
|
176
185
|
): ResolvedHeaderAction | null {
|
|
177
|
-
const quickAction = findServedQuickAction(
|
|
186
|
+
const quickAction = findServedQuickAction(
|
|
187
|
+
quickActions.value?.actions,
|
|
188
|
+
target.id,
|
|
189
|
+
);
|
|
178
190
|
if (!quickAction) return null;
|
|
179
191
|
return {
|
|
180
192
|
id: action.id,
|
|
@@ -185,7 +197,7 @@ function resolveQuickActionButton(
|
|
|
185
197
|
label: base.label || processI18n(quickAction.displayName),
|
|
186
198
|
onClick: () =>
|
|
187
199
|
action.confirm
|
|
188
|
-
? handleCustomButton(action
|
|
200
|
+
? handleCustomButton(customButtonOf(action, target))
|
|
189
201
|
: dispatchQuickActionTarget(quickAction.target),
|
|
190
202
|
},
|
|
191
203
|
};
|
|
@@ -212,9 +224,10 @@ function resolveAction(
|
|
|
212
224
|
disabledReason,
|
|
213
225
|
};
|
|
214
226
|
}
|
|
215
|
-
|
|
216
|
-
if (
|
|
217
|
-
|
|
227
|
+
const { target } = action;
|
|
228
|
+
if (!target) return null;
|
|
229
|
+
if (target.type === "quickAction") {
|
|
230
|
+
return resolveQuickActionButton(action, base, target);
|
|
218
231
|
}
|
|
219
232
|
return {
|
|
220
233
|
id: action.id,
|
|
@@ -222,7 +235,7 @@ function resolveAction(
|
|
|
222
235
|
button: {
|
|
223
236
|
...base,
|
|
224
237
|
...(linkProps(action) ?? {
|
|
225
|
-
onClick: () => handleCustomButton(action
|
|
238
|
+
onClick: () => handleCustomButton(customButtonOf(action, target)),
|
|
226
239
|
}),
|
|
227
240
|
},
|
|
228
241
|
disabledReason,
|
package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue
CHANGED
|
@@ -3,6 +3,7 @@ import { formatRelativeTime } from "#dms-core/app/utils/formatter";
|
|
|
3
3
|
import NotificationCard from "./NotificationCard.vue";
|
|
4
4
|
import { useNavBadges } from "#dms-ui/app/entries/composables/navigation/useNavBadges";
|
|
5
5
|
import { settleWidgetRequest } from "./widgetRequest";
|
|
6
|
+
import { submittedUrlOf } from "../../utils/submittedUrl";
|
|
6
7
|
import {
|
|
7
8
|
settledRenderedBellCounts,
|
|
8
9
|
type UserNotification,
|
|
@@ -73,10 +74,7 @@ const refreshCounts = () =>
|
|
|
73
74
|
});
|
|
74
75
|
|
|
75
76
|
const handleFormSubmitSuccess = async (event: Event) => {
|
|
76
|
-
|
|
77
|
-
const submitUrl = customEvent.detail?.data?.submitUrl;
|
|
78
|
-
|
|
79
|
-
if (submitUrl && submitUrl.includes("/api/notification/")) {
|
|
77
|
+
if (submittedUrlOf(event)?.includes("/api/notification/")) {
|
|
80
78
|
if (!isOpen.value) {
|
|
81
79
|
await refreshCounts();
|
|
82
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from "vue";
|
|
2
|
+
import { computed, type VNode } from "vue";
|
|
3
3
|
|
|
4
4
|
import DmsIconWell, {
|
|
5
5
|
type IconWellTone,
|
|
@@ -46,7 +46,7 @@ const placeholderText = computed(() =>
|
|
|
46
46
|
|
|
47
47
|
defineSlots<{
|
|
48
48
|
/** The summary, after the lead. */
|
|
49
|
-
default?: () =>
|
|
49
|
+
default?: () => VNode[];
|
|
50
50
|
}>();
|
|
51
51
|
|
|
52
52
|
const { t } = useI18n();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { isBoolean, isObject, isString } from "#dms-core/app/utils/type-check";
|
|
2
3
|
import { MONO_CHIP_CLASS } from "#dms-ui/app/entries/utils/monoChip";
|
|
3
4
|
import DmsModalEscHint from "#dms-ui/app/entries/components/modal/ModalEscHint";
|
|
4
5
|
import { useSecurityFormat } from "../../../../composables/settings/security/useSecurityFormat";
|
|
@@ -11,18 +12,41 @@ import {
|
|
|
11
12
|
useSessionHandoff,
|
|
12
13
|
} from "../../../../composables/security/useSessionHandoff";
|
|
13
14
|
|
|
15
|
+
/** A session as the list shows it; the details it can do without are optional. */
|
|
14
16
|
interface SessionInfo {
|
|
15
17
|
_id: string;
|
|
16
|
-
browser
|
|
17
|
-
os
|
|
18
|
-
ip
|
|
19
|
-
deviceType
|
|
20
|
-
location
|
|
21
|
-
createdAt
|
|
18
|
+
browser?: string | null;
|
|
19
|
+
os?: string | null;
|
|
20
|
+
ip?: string | null;
|
|
21
|
+
deviceType?: string | null;
|
|
22
|
+
location?: string | null;
|
|
23
|
+
createdAt?: string | null;
|
|
22
24
|
lastActiveAt: string;
|
|
23
25
|
isCurrent: boolean;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
const SESSION_DETAIL_FIELDS = [
|
|
29
|
+
"browser",
|
|
30
|
+
"os",
|
|
31
|
+
"ip",
|
|
32
|
+
"deviceType",
|
|
33
|
+
"location",
|
|
34
|
+
"createdAt",
|
|
35
|
+
] as const satisfies readonly (keyof SessionInfo)[];
|
|
36
|
+
|
|
37
|
+
function isSessionInfo(value: unknown): value is SessionInfo {
|
|
38
|
+
return (
|
|
39
|
+
value !== null &&
|
|
40
|
+
isObject(value) &&
|
|
41
|
+
isString(value._id) &&
|
|
42
|
+
isString(value.lastActiveAt) &&
|
|
43
|
+
isBoolean(value.isCurrent) &&
|
|
44
|
+
SESSION_DETAIL_FIELDS.every(
|
|
45
|
+
(field) => value[field] == null || isString(value[field]),
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
26
50
|
/** The sessions, and when they were read: what "active 5 minutes ago" counts from. */
|
|
27
51
|
interface SessionsRead {
|
|
28
52
|
sessions: SessionInfo[];
|
|
@@ -41,7 +65,7 @@ const SKELETON_COUNT = 3;
|
|
|
41
65
|
const BROWSER_VERSION = /\s+[\d.]+$/;
|
|
42
66
|
const DEFAULT_DEVICE_ICON = "i-ph-desktop";
|
|
43
67
|
const DEVICE_ICONS: Readonly<
|
|
44
|
-
Partial<Record<SessionInfo["deviceType"]
|
|
68
|
+
Partial<Record<NonNullable<SessionInfo["deviceType"]>, string>>
|
|
45
69
|
> = {
|
|
46
70
|
desktop: "i-ph-desktop",
|
|
47
71
|
mobile: "i-ph-device-mobile",
|
|
@@ -58,7 +82,7 @@ const { formatDate, formatRelative } = useSecurityFormat();
|
|
|
58
82
|
|
|
59
83
|
const list = useApiData<SessionsRead>(SESSIONS_URL, {
|
|
60
84
|
transform: (sessions) => ({
|
|
61
|
-
sessions: sessions
|
|
85
|
+
sessions: Array.isArray(sessions) ? sessions.filter(isSessionInfo) : [],
|
|
62
86
|
readAt: Date.now(),
|
|
63
87
|
}),
|
|
64
88
|
});
|
|
@@ -79,7 +103,8 @@ const otherSessions = computed(() =>
|
|
|
79
103
|
);
|
|
80
104
|
|
|
81
105
|
const deviceIcon = (session: SessionInfo): string =>
|
|
82
|
-
DEVICE_ICONS[session.deviceType] ??
|
|
106
|
+
(session.deviceType ? DEVICE_ICONS[session.deviceType] : undefined) ??
|
|
107
|
+
DEFAULT_DEVICE_ICON;
|
|
83
108
|
|
|
84
109
|
const sessionName = (session: SessionInfo): string =>
|
|
85
110
|
t("page.settings.security.sessions.device_name", {
|
|
@@ -258,7 +283,7 @@ const retryActions = computed(() => [
|
|
|
258
283
|
<span v-if="session.isCurrent" class="text-muted text-xs">
|
|
259
284
|
{{
|
|
260
285
|
t("page.settings.security.sessions.signed_in", {
|
|
261
|
-
date: formatDate(session.createdAt),
|
|
286
|
+
date: session.createdAt ? formatDate(session.createdAt) : "",
|
|
262
287
|
})
|
|
263
288
|
}}
|
|
264
289
|
</span>
|
|
@@ -74,8 +74,8 @@ function categoryOf(name: string): VariableCategory {
|
|
|
74
74
|
|
|
75
75
|
function collectNames(rules: CSSRuleList, names: Set<string>): void {
|
|
76
76
|
for (const rule of Array.from(rules)) {
|
|
77
|
-
if ("cssRules" in rule && rule.cssRules) {
|
|
78
|
-
collectNames(
|
|
77
|
+
if ("cssRules" in rule && rule.cssRules instanceof CSSRuleList) {
|
|
78
|
+
collectNames(rule.cssRules, names);
|
|
79
79
|
}
|
|
80
80
|
if (rule instanceof CSSStyleRule) {
|
|
81
81
|
for (const property of Array.from(rule.style)) {
|