@phis/ui 0.4.2 → 0.4.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/components/cms/phi-cms-layout-renderer.js +4 -3
- package/components/cms/phi-cms-page-render-scope.d.ts +4 -5
- package/components/cms/phi-cms-page-render-scope.js +43 -22
- package/components/cms/phi-cms-render-diagnostic-client.js +7 -3
- package/components/cms/phi-cms-render-error-boundary.js +2 -1
- package/components/controls/phi-anchor-nav-control.js +4 -1
- package/components/controls/phi-background-control.js +21 -6
- package/components/controls/phi-bullet-list-control.d.ts +7 -2
- package/components/controls/phi-bullet-list-control.js +35 -5
- package/components/controls/phi-color-control.js +4 -2
- package/components/controls/phi-drawer-control-adapter.js +3 -2
- package/components/controls/phi-inline-text-editor.js +7 -1
- package/components/controls/phi-length-control.js +1 -1
- package/components/controls/phi-ribbon-control.d.ts +38 -0
- package/components/controls/phi-ribbon-control.js +57 -0
- package/components/controls/phi-ribbon-wrap-control.d.ts +26 -0
- package/components/controls/phi-ribbon-wrap-control.js +25 -0
- package/components/controls/phi-select-control.js +5 -2
- package/components/controls/phi-series-chart-control.d.ts +48 -0
- package/components/controls/phi-series-chart-control.js +82 -0
- package/components/controls/phi-table-control.d.ts +3 -0
- package/components/controls/phi-table-control.js +13 -1
- package/components/controls/phi-text-control.js +57 -3
- package/components/controls/phi-tree-control.js +4 -4
- package/components/controls/phi-truncated-hover-text.d.ts +15 -0
- package/components/controls/phi-truncated-hover-text.js +25 -0
- package/components/forms/link-target-form-control.d.ts +1 -1
- package/components/forms/link-target-form-control.js +2 -45
- package/components/forms/phi-form-widget-frame.js +4 -2
- package/components/forms/shared-form-provider-registry.js +1 -4
- package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
- package/components/media/asset-collection-runtime.js +6 -16
- package/components/media/media-font-metrics.d.ts +3 -0
- package/components/media/media-font-metrics.js +43 -0
- package/components/media/phi-area-upload-widget.js +53 -97
- package/components/media/phi-image-preview-data.d.ts +13 -0
- package/components/media/phi-image-preview-data.js +184 -9
- package/components/media/phi-media-picker-binding.js +16 -13
- package/components/media/phi-media-upload.d.ts +15 -8
- package/components/media/phi-media-upload.js +18 -9
- package/components/media/phi-site-font-assets.js +7 -8
- package/components/navigation/phi-link.js +6 -1
- package/components/overlays/phi-overlay-container-client.js +16 -1
- package/components/regions/clients/cms-region-container-client.js +6 -1
- package/components/regions/phi-cms-region-container.js +3 -0
- package/components/regions/phi-cms-region-shell.d.ts +12 -1
- package/components/regions/phi-cms-region-shell.js +81 -19
- package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
- package/components/root/phi-config-provider.d.ts +13 -0
- package/components/root/phi-config-provider.js +12 -1
- package/components/root/phi-root-background.d.ts +7 -0
- package/components/root/phi-root-background.js +20 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/root/phi-shell-chrome-overlay.d.ts +12 -1
- package/components/root/phi-shell-chrome-overlay.js +19 -3
- package/components/runtime/runtime-controller-materialization.js +12 -1
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/shell/use-phi-shell-sticky-top.js +61 -16
- package/components/state/scoped-state-store.js +20 -3
- package/components/surface/phi-surface-tone.d.ts +13 -0
- package/components/surface/phi-surface-tone.js +21 -0
- package/components/tables/client/phi-table-binding.d.ts +2 -1
- package/components/tables/client/phi-table-binding.js +45 -21
- package/components/trees/client/phi-tree-binding.js +19 -11
- package/components/widgets/client/bullet-list-entries-editor.d.ts +26 -0
- package/components/widgets/client/bullet-list-entries-editor.js +109 -0
- package/components/widgets/client/html-editor.js +1 -1
- package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
- package/components/widgets/client/shared/use-page-reference-options.js +57 -0
- package/components/widgets/config/background.d.ts +32 -1
- package/components/widgets/config/background.js +41 -2
- package/components/widgets/config/choice-shared.js +12 -13
- package/components/widgets/config/command-buttons.d.ts +5 -1
- package/components/widgets/config/command-buttons.js +38 -81
- package/components/widgets/config/control-signal-config.d.ts +3 -1
- package/components/widgets/config/control-signal-config.js +19 -17
- package/components/widgets/config/image-source-parser.d.ts +1 -0
- package/components/widgets/config/image-source-parser.js +7 -8
- package/components/widgets/config/mask.d.ts +6 -1
- package/components/widgets/config/mask.js +24 -1
- package/components/widgets/config/parser-primitives.js +72 -0
- package/components/widgets/config/stack-tabs.d.ts +1 -1
- package/components/widgets/config/stack-tabs.js +2 -3
- package/components/widgets/config/strict-config-reader.d.ts +40 -0
- package/components/widgets/config/strict-config-reader.js +174 -0
- package/components/widgets/label-sets/background.js +2 -0
- package/components/widgets/label-sets/effects.js +2 -0
- package/components/widgets/label-types/background.d.ts +1 -0
- package/components/widgets/label-types/background.js +1 -0
- package/components/widgets/label-types/effects.d.ts +1 -0
- package/components/widgets/label-types/effects.js +1 -0
- package/components/widgets/navigation-descriptor-resolver.server.js +20 -8
- package/components/widgets/shared/bullet-list-vocabulary.d.ts +27 -1
- package/components/widgets/shared/bullet-list-vocabulary.js +24 -4
- package/components/widgets/shared/card-body-client.d.ts +18 -4
- package/components/widgets/shared/card-body-client.js +126 -26
- package/components/widgets/shared/card-vocabulary.d.ts +31 -4
- package/components/widgets/shared/card-vocabulary.js +35 -2
- package/components/widgets/shared/markdown-body-client.js +39 -10
- package/components/widgets/signals/control-signal-capabilities.d.ts +0 -18
- package/components/widgets/signals/control-signal-capabilities.js +10 -22
- package/components/workspace/catalog-store.d.ts +4 -3
- package/components/workspace/catalog-store.js +6 -5
- package/gateway/dashboard-cards-route.js +1 -0
- package/gateway/internal-references.d.ts +6 -1
- package/gateway/internal-references.js +48 -23
- package/gateway/site-cms-write-validation.d.ts +9 -0
- package/gateway/site-cms-write-validation.js +78 -0
- package/gateway/site-proxy.js +19 -3
- package/helpers/cms-container-chrome.js +6 -1
- package/helpers/locale.d.ts +8 -0
- package/helpers/locale.js +18 -0
- package/helpers/renderable-block-serialization.js +1 -1
- package/helpers/shell-region-style.js +2 -1
- package/helpers/surface-style.d.ts +12 -1
- package/helpers/surface-style.js +28 -2
- package/module-dashboard-cards.d.ts +1 -1
- package/module-dashboard-cards.js +1 -1
- package/next/config.d.mts +3 -0
- package/next/config.mjs +28 -1
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +5 -1
- package/plugins/runtime-modules/accounting/presets.d.ts +9 -0
- package/plugins/runtime-modules/accounting/presets.js +37 -0
- package/plugins/runtime-modules/accounting/server.d.ts +1 -4
- package/plugins/runtime-modules/accounting/server.js +4 -7
- package/plugins/runtime-modules/app/presets.d.ts +18 -0
- package/plugins/runtime-modules/app/presets.js +67 -0
- package/plugins/runtime-modules/app/server.d.ts +1 -4
- package/plugins/runtime-modules/app/server.js +4 -7
- package/plugins/runtime-modules/area-definitions.d.ts +0 -42
- package/plugins/runtime-modules/area-definitions.js +3 -8
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/services/collection.js +9 -1
- package/plugins/runtime-modules/asset/services/options.js +2 -2
- package/plugins/runtime-modules/builder/area-settings-answer.js +2 -1
- package/plugins/runtime-modules/builder/authoring-canvas.js +6 -6
- package/plugins/runtime-modules/builder/cards.js +3 -5
- package/plugins/runtime-modules/builder/clients/builder-region-overrides.js +3 -3
- package/plugins/runtime-modules/builder/clients/canvas-widget.js +15 -54
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +25 -35
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +8 -8
- package/plugins/runtime-modules/builder/clients/inspector-title.js +6 -6
- package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +11 -25
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
- package/plugins/runtime-modules/builder/clients/mode-switch.js +1 -1
- package/plugins/runtime-modules/builder/clients/pages-header.js +11 -11
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +15 -31
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +1 -1
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.d.ts +26 -0
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.js +36 -0
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +1 -0
- package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +2 -2
- package/plugins/runtime-modules/builder/cms-instance-allocator.js +8 -28
- package/plugins/runtime-modules/builder/controller/client.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.js +0 -8
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +11 -30
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +15 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.js +4 -7
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/page-controller.js +16 -68
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.d.ts +2 -5
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +6 -50
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -3
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +89 -153
- package/plugins/runtime-modules/builder/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/builder/data-providers.js +1 -0
- package/plugins/runtime-modules/builder/definition.d.ts +1 -0
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +64 -30
- package/plugins/runtime-modules/builder/developer-workspace-store.js +255 -61
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +4 -3
- package/plugins/runtime-modules/builder/history.d.ts +3 -1
- package/plugins/runtime-modules/builder/options-providers.js +3 -2
- package/plugins/runtime-modules/builder/page-catalog-client.js +19 -7
- package/plugins/runtime-modules/builder/page-meta-form.js +1 -0
- package/plugins/runtime-modules/builder/page-references-provider.js +1 -1
- package/plugins/runtime-modules/builder/persistence.js +33 -69
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +2 -2
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -19
- package/plugins/runtime-modules/builder/render-root-node-preview.server.js +20 -3
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +28 -18
- package/plugins/runtime-modules/builder/runtime-module-selection.d.ts +2 -12
- package/plugins/runtime-modules/builder/runtime-module-selection.js +16 -42
- package/plugins/runtime-modules/builder/services/navigation-table.js +9 -15
- package/plugins/runtime-modules/builder/services/page-source-tree.js +8 -8
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +10 -10
- package/plugins/runtime-modules/builder/services/signal-routes-table.js +3 -3
- package/plugins/runtime-modules/builder/signal-route-selection.d.ts +1 -2
- package/plugins/runtime-modules/builder/signal-route-selection.js +2 -2
- package/plugins/runtime-modules/builder/signal-wiring-options.js +3 -2
- package/plugins/runtime-modules/builder/structure-dnd.js +8 -61
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +17 -10
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +27 -22
- package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +55 -0
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +142 -0
- package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
- package/plugins/runtime-modules/client-authoring-module.js +13 -3
- package/plugins/runtime-modules/client-manifests/common.js +1 -1
- package/plugins/runtime-modules/{runtime-calendar-adapters.js → core/calendar-adapters.js} +2 -2
- package/plugins/runtime-modules/{client-calendar-adapters/core.js → core/client-calendar-adapters.js} +1 -1
- package/plugins/runtime-modules/core/content-entries/table.js +1 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/core/data-providers.js +2 -1
- package/plugins/runtime-modules/core/definition.d.ts +3 -0
- package/plugins/runtime-modules/core/definition.js +1 -1
- package/plugins/runtime-modules/core/messaging/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/core/messaging/data-providers.js +1 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +1 -1
- package/plugins/runtime-modules/core/server.js +1 -1
- package/plugins/runtime-modules/core/themes.d.ts +44 -0
- package/plugins/runtime-modules/core/themes.js +12 -0
- package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
- package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
- package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +301 -254
- package/plugins/runtime-modules/core/widgets/card/config.js +68 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +41 -4
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/card/server.js +32 -3
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +7 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +9 -2
- package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/description/editor.js +7 -63
- package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +11 -4
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
- package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
- package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +5 -25
- package/plugins/runtime-modules/core/widgets/result/config.js +2 -0
- package/plugins/runtime-modules/core/widgets/result/server.js +25 -19
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +11 -2
- package/plugins/runtime-modules/core/widgets/table/client.js +8 -4
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +6 -83
- package/plugins/runtime-modules/core/widgets/table/config.js +302 -452
- package/plugins/runtime-modules/core/widgets/tree/config.js +5 -2
- package/plugins/runtime-modules/dashboard/card-rows.d.ts +7 -0
- package/plugins/runtime-modules/dashboard/card-rows.js +87 -0
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +32 -12
- package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
- package/plugins/runtime-modules/groups/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/groups/data-providers.js +3 -3
- package/plugins/runtime-modules/groups/definition.d.ts +2 -0
- package/plugins/runtime-modules/localization/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/localization/data-providers.js +2 -0
- package/plugins/runtime-modules/localization/definition.d.ts +3 -0
- package/plugins/runtime-modules/localization/services/table.js +3 -7
- package/plugins/runtime-modules/observability/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/observability/data-providers.js +1 -0
- package/plugins/runtime-modules/observability/definition.d.ts +1 -0
- package/plugins/runtime-modules/observability/module.d.ts +1 -0
- package/plugins/runtime-modules/observability/services/table.js +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +2 -105
- package/plugins/runtime-modules/public/presets.d.ts +115 -0
- package/plugins/runtime-modules/{area-base-presets.js → public/presets.js} +19 -119
- package/plugins/runtime-modules/public/server.d.ts +1 -4
- package/plugins/runtime-modules/public/server.js +4 -7
- package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +7 -8
- package/plugins/runtime-modules/public-base-page-references.d.ts +1 -1
- package/plugins/runtime-modules/public-base-page-references.js +1 -1
- package/plugins/runtime-modules/revisions/controller/client.js +11 -11
- package/plugins/runtime-modules/revisions/services/table.js +3 -3
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +22 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +111 -72
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +28 -31
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +1 -1
- package/plugins/runtime-modules/theme-descriptors.js +1 -1
- package/plugins/runtime-modules/user-management/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/user-management/data-providers.js +1 -0
- package/plugins/runtime-modules/user-management/definition.d.ts +2 -0
- package/server-helpers/cms-link-targets.js +6 -0
- package/styles/control-shape.css +11 -11
- package/styles/controls.css +67 -5
- package/styles/layout.css +61 -9
- package/styles/shell.css +73 -0
- package/theme/phi-antd-token-resolver.js +20 -1
- package/theme/phi-theme-tokens.d.ts +1 -1
- package/theme/phi-theme-tokens.js +1 -0
- package/theme/phi-theme.d.ts +5 -0
- package/theme/phi-theme.js +21 -0
- package/theme/phi-tokens.d.ts +16 -15
- package/theme/phi-tokens.js +16 -15
- package/types/cms-config.js +142 -185
- package/types/cms-plugins.d.ts +6 -11
- package/types/core-widget-placements.d.ts +14 -3
- package/types/dashboard-cards.d.ts +48 -4
- package/types/dashboard-cards.js +6 -0
- package/types/media.d.ts +0 -3
- package/types/renderable-block.d.ts +6 -1
- package/types/site-theme.d.ts +10 -2
- package/types/table-widget.d.ts +9 -0
- package/types/table-widget.js +20 -0
- package/types.d.ts +1 -1
- package/widget-config.d.ts +2 -0
- package/widget-config.js +6 -0
- package/plugins/runtime-modules/area-base-presets.d.ts +0 -139
- /package/plugins/runtime-modules/{runtime-calendar-adapters.d.ts → core/calendar-adapters.d.ts} +0 -0
- /package/plugins/runtime-modules/{client-calendar-adapters/core.d.ts → core/client-calendar-adapters.d.ts} +0 -0
|
@@ -56,11 +56,14 @@ function readBindingTools(value) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function readSource(value) {
|
|
59
|
-
if (!isPhiRecord(value) || !isPhiRuntimeDataProviderKey(value.providerKey)
|
|
59
|
+
if (!isPhiRecord(value) || !isPhiRuntimeDataProviderKey(value.providerKey))
|
|
60
|
+
return null;
|
|
61
|
+
const resourceKey = readString(value.resourceKey);
|
|
62
|
+
if (!resourceKey)
|
|
60
63
|
return null;
|
|
61
64
|
return {
|
|
62
65
|
providerKey: value.providerKey,
|
|
63
|
-
resourceKey
|
|
66
|
+
resourceKey,
|
|
64
67
|
params: isPhiRecord(value.params) ? value.params : undefined,
|
|
65
68
|
};
|
|
66
69
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PhiDashboardCardPayload, type PhiDashboardCardSeries, type PhiDashboardCardRow } from "../../../types/dashboard-cards";
|
|
2
|
+
/** The card rows a list answer carries, or a Collection holds. */
|
|
3
|
+
export declare function readPhiDashboardCardRows(value: unknown, source?: string): PhiDashboardCardRow[];
|
|
4
|
+
/** One card's refreshed payload. */
|
|
5
|
+
export declare function readPhiDashboardCardPayload(value: unknown): PhiDashboardCardPayload;
|
|
6
|
+
/** The latest figure of the first series: the headline of a `series` card whose provider states none. */
|
|
7
|
+
export declare function readPhiDashboardSeriesHeadline(series: PhiDashboardCardSeries, locale: string): string | undefined;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { readPhiTimelineEntry } from "@phis/contracts/timeline";
|
|
2
|
+
import { isPhiDashboardCardId, } from "../../../types/dashboard-cards";
|
|
3
|
+
import { createPhiResponseReader, requirePhiField, } from "../../../components/widgets/config/strict-config-reader";
|
|
4
|
+
/*
|
|
5
|
+
* The Dashboard's rows and payloads, read as the Site's door writes them (`gateway/dashboard-cards-route.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Both came in by cast: the list's rows as "an object, so a row", and a refreshed payload as whatever
|
|
8
|
+
* the door answered. A row without its title then disappeared without a word, and a payload of the wrong
|
|
9
|
+
* shape rendered as an empty card. Read field by field now, a wrong answer is an error naming the field,
|
|
10
|
+
* which the Collection shows as the card list's error.
|
|
11
|
+
*/
|
|
12
|
+
const PHI_DASHBOARD_CARD_FORMS = ["stat", "list", "series"];
|
|
13
|
+
function readCardId(reader) {
|
|
14
|
+
return requirePhiField(reader, "cardId", "a Dashboard card id", (key) => reader.value(key, "a Dashboard card id", (value) => (isPhiDashboardCardId(value) ? value : undefined)));
|
|
15
|
+
}
|
|
16
|
+
function readTimelineEntry(reader, index) {
|
|
17
|
+
return readPhiTimelineEntry(reader.record) ?? reader.fail(String(index), "a timeline entry with a key", reader.record);
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
* A series is read whole: a point with one value too few would draw a line that drops to nothing on the
|
|
21
|
+
* day it lost, which looks like data. So each point states a finite number for every label, or the payload
|
|
22
|
+
* is an error naming the point.
|
|
23
|
+
*/
|
|
24
|
+
function readSeries(reader) {
|
|
25
|
+
const labels = requirePhiField(reader, "labels", "a list of series labels", reader.stringList);
|
|
26
|
+
if (labels.length === 0) {
|
|
27
|
+
reader.fail("labels", "at least one series label", labels);
|
|
28
|
+
}
|
|
29
|
+
const points = requirePhiField(reader, "points", "a list of points", (key) => reader.list(key, (point) => ({
|
|
30
|
+
at: requirePhiField(point, "at", "an ISO date or instant", point.string),
|
|
31
|
+
values: requirePhiField(point, "values", `${labels.length} finite numbers, one per label`, (valuesKey) => point.value(valuesKey, `${labels.length} finite numbers, one per label`, (value) => Array.isArray(value)
|
|
32
|
+
&& value.length === labels.length
|
|
33
|
+
&& value.every((entry) => typeof entry === "number" && Number.isFinite(entry))
|
|
34
|
+
? value
|
|
35
|
+
: undefined)),
|
|
36
|
+
})));
|
|
37
|
+
const unit = reader.string("unit");
|
|
38
|
+
return { labels, points, ...(unit === undefined ? {} : { unit }) };
|
|
39
|
+
}
|
|
40
|
+
function readPayloadFields(reader) {
|
|
41
|
+
const value = reader.string("value");
|
|
42
|
+
const entries = reader.list("entries", readTimelineEntry);
|
|
43
|
+
const series = reader.object("series", readSeries);
|
|
44
|
+
const description = reader.string("description");
|
|
45
|
+
const meta = reader.string("meta");
|
|
46
|
+
const error = reader.string("error");
|
|
47
|
+
return {
|
|
48
|
+
cardId: readCardId(reader),
|
|
49
|
+
...(value === undefined ? {} : { value }),
|
|
50
|
+
...(entries === undefined ? {} : { entries }),
|
|
51
|
+
...(series === undefined ? {} : { series }),
|
|
52
|
+
...(description === undefined ? {} : { description }),
|
|
53
|
+
...(meta === undefined ? {} : { meta }),
|
|
54
|
+
...(error === undefined ? {} : { error }),
|
|
55
|
+
resolvedAt: requirePhiField(reader, "resolvedAt", "an instant", reader.string),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function readRowFields(reader) {
|
|
59
|
+
const eyebrow = reader.string("eyebrow");
|
|
60
|
+
const description = reader.string("description");
|
|
61
|
+
const mark = reader.string("mark");
|
|
62
|
+
const href = reader.string("href");
|
|
63
|
+
const payload = reader.object("payload", readPayloadFields);
|
|
64
|
+
return {
|
|
65
|
+
cardId: readCardId(reader),
|
|
66
|
+
form: requirePhiField(reader, "form", '"stat", "list" or "series"', (key) => reader.oneOf(key, PHI_DASHBOARD_CARD_FORMS)),
|
|
67
|
+
title: requirePhiField(reader, "title", "a text", reader.string),
|
|
68
|
+
...(eyebrow === undefined ? {} : { eyebrow }),
|
|
69
|
+
...(description === undefined ? {} : { description }),
|
|
70
|
+
...(mark === undefined ? {} : { mark }),
|
|
71
|
+
...(href === undefined ? {} : { href }),
|
|
72
|
+
...(payload === undefined ? {} : { payload }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** The card rows a list answer carries, or a Collection holds. */
|
|
76
|
+
export function readPhiDashboardCardRows(value, source = "The Dashboard card list") {
|
|
77
|
+
return createPhiResponseReader({ cards: value }, source).list("cards", readRowFields) ?? [];
|
|
78
|
+
}
|
|
79
|
+
/** One card's refreshed payload. */
|
|
80
|
+
export function readPhiDashboardCardPayload(value) {
|
|
81
|
+
return readPayloadFields(createPhiResponseReader(value, "The Dashboard card"));
|
|
82
|
+
}
|
|
83
|
+
/** The latest figure of the first series: the headline of a `series` card whose provider states none. */
|
|
84
|
+
export function readPhiDashboardSeriesHeadline(series, locale) {
|
|
85
|
+
const latest = series.points[series.points.length - 1]?.values[0];
|
|
86
|
+
return latest === undefined ? undefined : new Intl.NumberFormat(locale).format(latest);
|
|
87
|
+
}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { readPhiTimelineEntries } from "@phis/contracts/timeline";
|
|
5
|
-
import { PHI_DASHBOARD_CARD_LIST_LIMIT, } from "../../../../types/dashboard-cards";
|
|
5
|
+
import { PHI_DASHBOARD_CARD_LIST_LIMIT, PHI_DASHBOARD_CARD_SERIES_LIMIT, } from "../../../../types/dashboard-cards";
|
|
6
6
|
import { PhiCardWidgetClient } from "../../../../components/widgets/shared/card-body-client";
|
|
7
7
|
import {} from "../../../../components/widgets/shared/card-vocabulary";
|
|
8
8
|
import { PHI_SURFACE_CARD } from "../../../../helpers/surface-presets";
|
|
9
9
|
import { PhiCollectionViewControl } from "../../../../components/controls/phi-collection-view-control";
|
|
10
10
|
import { PhiAlertControl } from "../../../../components/controls/phi-alert-control";
|
|
11
11
|
import { PhiEmptyControl } from "../../../../components/controls/phi-empty-control";
|
|
12
|
-
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
13
12
|
import { usePhiPathname } from "../../../../components/runtime/use-phi-pathname";
|
|
13
|
+
import { readPhiDashboardCardPayload, readPhiDashboardCardRows, readPhiDashboardSeriesHeadline, } from "../card-rows";
|
|
14
14
|
import { PhiTimelineControl } from "../../../../components/controls/phi-timeline-control";
|
|
15
|
+
import { PhiSeriesChartControl } from "../../../../components/controls/phi-series-chart-control";
|
|
15
16
|
import { usePhiIntlLocale } from "../../../../components/root/phi-intl-locale";
|
|
16
|
-
import { formatPhiRelativeTime } from "../../../../helpers/format-date-time";
|
|
17
|
+
import { formatPhiDate, formatPhiRelativeTime } from "../../../../helpers/format-date-time";
|
|
17
18
|
/**
|
|
18
19
|
* A Dashboard, drawn.
|
|
19
20
|
*
|
|
@@ -33,8 +34,7 @@ const CARD_MIN_COLUMN_WIDTH = 260;
|
|
|
33
34
|
* A Module's form, and the Core body that draws it.
|
|
34
35
|
*
|
|
35
36
|
* Two vocabularies that agree today, and deliberately not one type. `form` is what a Module
|
|
36
|
-
* declares about its contribution; `body` is what Core draws. They agree now and are allowed to stop
|
|
37
|
-
* a `series` form would reasonably draw in whatever body Core has for a graphic, under another name.
|
|
37
|
+
* declares about its contribution; `body` is what Core draws. They agree now and are allowed to stop.
|
|
38
38
|
*
|
|
39
39
|
* A total map rather than a condition, so a form that joins the vocabulary stops this file compiling
|
|
40
40
|
* instead of quietly falling back to a heading.
|
|
@@ -42,6 +42,7 @@ const CARD_MIN_COLUMN_WIDTH = 260;
|
|
|
42
42
|
const CARD_BODY_BY_FORM = {
|
|
43
43
|
stat: "stat",
|
|
44
44
|
list: "list",
|
|
45
|
+
series: "series",
|
|
45
46
|
};
|
|
46
47
|
/**
|
|
47
48
|
* A `list` card's entries as the Timeline draws them: the first few, each time in the page's locale.
|
|
@@ -62,11 +63,27 @@ function PhiDashboardCardList({ entries }) {
|
|
|
62
63
|
...(entry.pending ? { pending: true } : {}),
|
|
63
64
|
})) }));
|
|
64
65
|
}
|
|
66
|
+
/*
|
|
67
|
+
* A point's day as the calendar day it names. An ISO date read by `Date` is midnight in UTC, which is
|
|
68
|
+
* the day before west of Greenwich; an instant is formatted where the reader is.
|
|
69
|
+
*/
|
|
70
|
+
function formatSeriesKey(at, locale) {
|
|
71
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(at)
|
|
72
|
+
? new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" }).format(new Date(`${at}T00:00:00Z`))
|
|
73
|
+
: formatPhiDate(at, locale);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A `series` card's chart: its first few series over every point, each day in the page's locale. Drawn
|
|
77
|
+
* here and handed to the card, as a list is, so a Card on a Public page never loads the chart Control.
|
|
78
|
+
*/
|
|
79
|
+
function PhiDashboardCardSeriesChart({ series, title }) {
|
|
80
|
+
const locale = usePhiIntlLocale();
|
|
81
|
+
const labels = series.labels.slice(0, PHI_DASHBOARD_CARD_SERIES_LIMIT);
|
|
82
|
+
return (_jsx(PhiSeriesChartControl, { locale: locale, title: title, keys: series.points.map((point) => formatSeriesKey(point.at, locale)), series: labels.map((label, index) => ({ label, values: series.points.map((point) => point.values[index]) })), ...(series.unit ? { unit: series.unit } : {}) }));
|
|
83
|
+
}
|
|
65
84
|
function readRows(binding) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.map((item) => item)
|
|
69
|
-
.filter((row) => typeof row.cardId === "string" && typeof row.title === "string");
|
|
85
|
+
// A Collection holds items of no particular type; the rows are read again, not cast.
|
|
86
|
+
return readPhiDashboardCardRows(binding.data?.items ?? [], "The Dashboard Collection");
|
|
70
87
|
}
|
|
71
88
|
/**
|
|
72
89
|
* One card, and its own request where the list did not bring its payload.
|
|
@@ -86,6 +103,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
|
|
|
86
103
|
* says the same thing by comparison: an answer to a question no longer being asked is simply not this
|
|
87
104
|
* card's answer.
|
|
88
105
|
*/
|
|
106
|
+
const locale = usePhiIntlLocale();
|
|
89
107
|
const requestKey = `${area}\u0000${pathname}\u0000${row.cardId}`;
|
|
90
108
|
const delivered = row.payload ?? null;
|
|
91
109
|
const [resolved, setResolved] = useState(null);
|
|
@@ -106,7 +124,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
|
|
|
106
124
|
if (!response.ok) {
|
|
107
125
|
throw new Error(`Card payload request failed (${response.status}).`);
|
|
108
126
|
}
|
|
109
|
-
return (await response.json());
|
|
127
|
+
return readPhiDashboardCardPayload(await response.json());
|
|
110
128
|
})
|
|
111
129
|
.then((payload) => setResolved({ key: requestKey, payload, failure: null }))
|
|
112
130
|
.catch((error) => {
|
|
@@ -127,6 +145,8 @@ function PhiDashboardCard({ row, area, pathname, }) {
|
|
|
127
145
|
const payload = current?.payload ?? null;
|
|
128
146
|
const error = current?.failure ?? payload?.error ?? null;
|
|
129
147
|
const entries = row.form === "list" ? readPhiTimelineEntries(payload?.entries) : [];
|
|
148
|
+
const series = row.form === "series" ? payload?.series ?? null : null;
|
|
149
|
+
const value = payload?.value ?? (series ? readPhiDashboardSeriesHeadline(series, locale) : undefined);
|
|
130
150
|
return (_jsx(PhiCardWidgetClient, { labels: {
|
|
131
151
|
...(row.eyebrow ? { eyebrow: row.eyebrow } : {}),
|
|
132
152
|
/*
|
|
@@ -137,7 +157,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
|
|
|
137
157
|
* screen together and the card reads the same before and after it resolves.
|
|
138
158
|
*/
|
|
139
159
|
title: row.title,
|
|
140
|
-
...(
|
|
160
|
+
...(value ? { value } : {}),
|
|
141
161
|
...(payload?.description ?? row.description
|
|
142
162
|
? { description: payload?.description ?? row.description }
|
|
143
163
|
: {}),
|
|
@@ -154,7 +174,7 @@ function PhiDashboardCard({ row, area, pathname, }) {
|
|
|
154
174
|
* this; that this file still does is what will move to a Controller when the Dashboard gets a
|
|
155
175
|
* clock (DASHBOARD.md section 4).
|
|
156
176
|
*/
|
|
157
|
-
binding: { loading: current === null, error }, listContent: entries.length > 0 ? _jsx(PhiDashboardCardList, { entries: entries }) : null }));
|
|
177
|
+
binding: { loading: current === null, error }, listContent: series ? (_jsx(PhiDashboardCardSeriesChart, { series: series, title: row.title })) : entries.length > 0 ? _jsx(PhiDashboardCardList, { entries: entries }) : null }));
|
|
158
178
|
}
|
|
159
179
|
export function PhiDashboardCardCollectionViewBinding({ config, binding, widgetId, }) {
|
|
160
180
|
void widgetId;
|
|
@@ -3,13 +3,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { PHI_DASHBOARD_CARD_DATA_PROVIDER_KEY, PHI_DASHBOARD_CARD_ITEM_RENDERER_KEY, PHI_DASHBOARD_CARD_RESOURCE_KEY, } from "../../../../constants/dashboard-card-provider-keys";
|
|
5
5
|
import { PhiCollectionProviderClient, } from "../../../../components/widgets/client/shared/phi-collection-provider";
|
|
6
|
+
import { readPhiDashboardCardRows } from "../card-rows";
|
|
6
7
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
7
8
|
import { usePhiPathname } from "../../../../components/runtime/use-phi-pathname";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The fan-in, from the browser's side: one request, and no idea what stands behind it.
|
|
11
|
+
*
|
|
12
|
+
* Everything that decides which cards exist -- the Area's Module catalog, each contributor's own list,
|
|
13
|
+
* who is looking -- is server knowledge, so this asks the Site's own door and passes the answer on as
|
|
14
|
+
* ordinary Collection rows. That is the whole reason the door exists: a Module definition must never
|
|
15
|
+
* reach the browser, and a provider that collected the contributions here would drag every one of them
|
|
16
|
+
* in with it.
|
|
17
|
+
*
|
|
18
|
+
* It sends where it stands. The Area is config, because a page belongs to one and the preset that
|
|
19
|
+
* placed this Widget knows which; the path is read live, because that is what changes when a Site puts
|
|
20
|
+
* a Dashboard somewhere else.
|
|
21
|
+
*/
|
|
13
22
|
async function queryDashboardCards(request, pathname) {
|
|
14
23
|
if (request.resourceKey !== PHI_DASHBOARD_CARD_RESOURCE_KEY) {
|
|
15
24
|
throw new Error(`Unknown Dashboard collection "${request.resourceKey}".`);
|
|
@@ -36,10 +45,11 @@ async function queryDashboardCards(request, pathname) {
|
|
|
36
45
|
if (!response.ok) {
|
|
37
46
|
throw new Error(`Dashboard cards request failed (${response.status}).`);
|
|
38
47
|
}
|
|
39
|
-
const
|
|
48
|
+
const payload = await response.json();
|
|
49
|
+
const rows = readPhiDashboardCardRows(isPhiRecord(payload) ? payload.cards : undefined);
|
|
40
50
|
return {
|
|
41
51
|
resourceKey: request.resourceKey,
|
|
42
|
-
items: rows,
|
|
52
|
+
items: rows.map((row) => ({ ...row })),
|
|
43
53
|
total: rows.length,
|
|
44
54
|
loading: false,
|
|
45
55
|
error: null,
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-id";
|
|
2
2
|
import { PHI_DASHBOARD_RUNTIME_MODULE_ID } from "../ids";
|
|
3
|
-
import {
|
|
4
|
-
import { PhiCmsFlags, PhiCmsPageType, PhiCmsRegionType } from "../../../../constants/phi-cms";
|
|
3
|
+
import { PhiCmsPageType } from "../../../../constants/phi-cms";
|
|
5
4
|
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
6
|
-
import { resolvePhiShellHeaderHeight } from "../../../../helpers/shell-region-style";
|
|
7
5
|
import { buildPhiBasePageContentScaffold } from "../../../../components/regions/presets/phi-base-page-layout";
|
|
8
6
|
import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
|
|
9
7
|
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
10
8
|
import { buildPhiDashboardCardsWidget } from "./dashboard-cards-page-tree";
|
|
11
9
|
import { getPhiDashboardCardsEmptyDescription } from "./area-dashboard-label-set";
|
|
10
|
+
/*
|
|
11
|
+
* No Header bottom band: the Dashboard has no commands -- nothing to save, preview or publish -- and the
|
|
12
|
+
* band stood empty under the title.
|
|
13
|
+
*/
|
|
12
14
|
const SYNTHETIC_BUILDER_DASHBOARD_REGION_IDS = {
|
|
13
|
-
regionHeaderBottom: -580,
|
|
14
15
|
regionContent: -581,
|
|
15
16
|
};
|
|
16
|
-
const SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap({
|
|
17
|
-
domain: "page",
|
|
18
|
-
ownerModuleId: PHI_DASHBOARD_RUNTIME_MODULE_ID,
|
|
19
|
-
presetKey: "builder-dashboard-page",
|
|
20
|
-
}, [
|
|
21
|
-
"layoutHeaderBottom",
|
|
22
|
-
]);
|
|
23
17
|
const SYNTHETIC_BUILDER_DASHBOARD_WIDGET_IDS = createPhiPresetCmsInstanceIdMap({
|
|
24
18
|
domain: "page",
|
|
25
19
|
ownerModuleId: PHI_DASHBOARD_RUNTIME_MODULE_ID,
|
|
@@ -56,38 +50,9 @@ export async function buildPhiDefaultBuilderDashboardPageTree({ page, runtime, }
|
|
|
56
50
|
},
|
|
57
51
|
overlays: [],
|
|
58
52
|
regions: [
|
|
59
|
-
nodes.region({
|
|
60
|
-
id: SYNTHETIC_BUILDER_DASHBOARD_REGION_IDS.regionHeaderBottom,
|
|
61
|
-
regionType: PhiCmsRegionType.HeaderBottom,
|
|
62
|
-
rootLayoutNodeId: SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS.layoutHeaderBottom,
|
|
63
|
-
sortOrder: 25,
|
|
64
|
-
config: {
|
|
65
|
-
flags: PhiCmsFlags.Sticky,
|
|
66
|
-
/*
|
|
67
|
-
* No Effect or Shadow of its own, like every other Builder Header. A `glass` authored here
|
|
68
|
-
* frosts this one Region against the Site's Shell Chrome Overlay, so the Dashboard's Header
|
|
69
|
-
* stopped matching the Sider and Footer beside it. What the frame looks like belongs to the Theme.
|
|
70
|
-
*/
|
|
71
|
-
size: { height: `${resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "bottom")}px` },
|
|
72
|
-
offsetTop: resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "main"),
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
53
|
scaffold.region,
|
|
76
54
|
],
|
|
77
55
|
layoutNodes: [
|
|
78
|
-
nodes.layout({
|
|
79
|
-
creationPreset: { layoutKind: "threecol", preset: "panel" },
|
|
80
|
-
typeKey: "three-column",
|
|
81
|
-
id: SYNTHETIC_BUILDER_DASHBOARD_LAYOUT_IDS.layoutHeaderBottom,
|
|
82
|
-
parentLayoutNodeId: null,
|
|
83
|
-
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
84
|
-
sortOrder: 0,
|
|
85
|
-
label: "builder dashboard header bottom",
|
|
86
|
-
config: {
|
|
87
|
-
balancedSides: true,
|
|
88
|
-
contentAlign: "center",
|
|
89
|
-
},
|
|
90
|
-
}),
|
|
91
56
|
scaffold.layoutNode,
|
|
92
57
|
],
|
|
93
58
|
contentWidgets: [
|
|
@@ -98,6 +98,7 @@ export declare const PHI_GROUPS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
98
98
|
search: false;
|
|
99
99
|
sorting: "none";
|
|
100
100
|
pagination: "offset";
|
|
101
|
+
total: true;
|
|
101
102
|
filterFields?: undefined;
|
|
102
103
|
};
|
|
103
104
|
actions: ({
|
|
@@ -210,6 +211,7 @@ export declare const PHI_GROUPS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
210
211
|
filterFields: string[];
|
|
211
212
|
sorting: "none";
|
|
212
213
|
pagination: "offset";
|
|
214
|
+
total: true;
|
|
213
215
|
search?: undefined;
|
|
214
216
|
};
|
|
215
217
|
actions: {
|
|
@@ -117,7 +117,7 @@ export const PHI_GROUPS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
117
117
|
{ key: "spaceUsedBytes", title: "Space used", type: "number" },
|
|
118
118
|
{ key: "spaceQuotaBytes", title: "Space quota", type: "number" },
|
|
119
119
|
],
|
|
120
|
-
query: { search: false, sorting: "none", pagination: "offset" },
|
|
120
|
+
query: { search: false, sorting: "none", pagination: "offset", total: true },
|
|
121
121
|
actions: [
|
|
122
122
|
{ key: "refresh", title: "Refresh", scope: "resource" },
|
|
123
123
|
{ key: "create", title: "Create", scope: "resource", valueType: "json" },
|
|
@@ -196,7 +196,7 @@ export const PHI_GROUPS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
196
196
|
{ key: "spaceUsedBytes", title: "Space used", type: "number" },
|
|
197
197
|
{ key: "spaceQuotaBytes", title: "Space quota", type: "number" },
|
|
198
198
|
],
|
|
199
|
-
query: { search: false, sorting: "none", pagination: "offset" },
|
|
199
|
+
query: { search: false, sorting: "none", pagination: "offset", total: true },
|
|
200
200
|
actions: [
|
|
201
201
|
{ key: "refresh", title: "Refresh", scope: "resource" },
|
|
202
202
|
// A Manager runs the team and may end it. Putting one back is not offered here, because a
|
|
@@ -246,7 +246,7 @@ export const PHI_GROUPS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
246
246
|
{ key: "sourceProviderId", title: "Source", type: "string" },
|
|
247
247
|
{ key: "createdAt", title: "Since", type: "datetime" },
|
|
248
248
|
],
|
|
249
|
-
query: { filterFields: ["groupId"], sorting: "none", pagination: "offset" },
|
|
249
|
+
query: { filterFields: ["groupId"], sorting: "none", pagination: "offset", total: true },
|
|
250
250
|
actions: [
|
|
251
251
|
{
|
|
252
252
|
key: "delete", title: "Remove", scope: "row",
|
|
@@ -110,6 +110,7 @@ export declare const PHI_GROUPS_RUNTIME_MODULE_DEFINITION: {
|
|
|
110
110
|
search: false;
|
|
111
111
|
sorting: "none";
|
|
112
112
|
pagination: "offset";
|
|
113
|
+
total: true;
|
|
113
114
|
filterFields?: undefined;
|
|
114
115
|
};
|
|
115
116
|
actions: ({
|
|
@@ -222,6 +223,7 @@ export declare const PHI_GROUPS_RUNTIME_MODULE_DEFINITION: {
|
|
|
222
223
|
filterFields: string[];
|
|
223
224
|
sorting: "none";
|
|
224
225
|
pagination: "offset";
|
|
226
|
+
total: true;
|
|
225
227
|
search?: undefined;
|
|
226
228
|
};
|
|
227
229
|
actions: {
|
|
@@ -57,6 +57,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
57
57
|
filterFields: never[];
|
|
58
58
|
sorting: "none";
|
|
59
59
|
pagination: "none";
|
|
60
|
+
total?: undefined;
|
|
60
61
|
facets?: undefined;
|
|
61
62
|
};
|
|
62
63
|
recordRead: true;
|
|
@@ -128,6 +129,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
128
129
|
filterFields: string[];
|
|
129
130
|
sorting: "none";
|
|
130
131
|
pagination: "offset";
|
|
132
|
+
total: true;
|
|
131
133
|
facets: string[];
|
|
132
134
|
};
|
|
133
135
|
actions: ({
|
|
@@ -206,6 +208,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
206
208
|
filterFields: string[];
|
|
207
209
|
sorting: "none";
|
|
208
210
|
pagination: "offset";
|
|
211
|
+
total: true;
|
|
209
212
|
facets: string[];
|
|
210
213
|
};
|
|
211
214
|
recordRead: true;
|
|
@@ -107,6 +107,7 @@ export const PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
107
107
|
filterFields: ["locale"],
|
|
108
108
|
sorting: "none",
|
|
109
109
|
pagination: "offset",
|
|
110
|
+
total: true,
|
|
110
111
|
facets: ["site", "platformLocales", "selectedLocale"],
|
|
111
112
|
},
|
|
112
113
|
actions: [
|
|
@@ -146,6 +147,7 @@ export const PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
146
147
|
filterFields: ["locale", "context", "status"],
|
|
147
148
|
sorting: "none",
|
|
148
149
|
pagination: "offset",
|
|
150
|
+
total: true,
|
|
149
151
|
facets: ["selectedLocale", "availableLocales", "contexts"],
|
|
150
152
|
},
|
|
151
153
|
recordRead: true,
|
|
@@ -85,6 +85,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_MODULE_DEFINITION: {
|
|
|
85
85
|
filterFields: never[];
|
|
86
86
|
sorting: "none";
|
|
87
87
|
pagination: "none";
|
|
88
|
+
total?: undefined;
|
|
88
89
|
facets?: undefined;
|
|
89
90
|
};
|
|
90
91
|
recordRead: true;
|
|
@@ -156,6 +157,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_MODULE_DEFINITION: {
|
|
|
156
157
|
filterFields: string[];
|
|
157
158
|
sorting: "none";
|
|
158
159
|
pagination: "offset";
|
|
160
|
+
total: true;
|
|
159
161
|
facets: string[];
|
|
160
162
|
};
|
|
161
163
|
actions: ({
|
|
@@ -234,6 +236,7 @@ export declare const PHI_LOCALIZATION_RUNTIME_MODULE_DEFINITION: {
|
|
|
234
236
|
filterFields: string[];
|
|
235
237
|
sorting: "none";
|
|
236
238
|
pagination: "offset";
|
|
239
|
+
total: true;
|
|
237
240
|
facets: string[];
|
|
238
241
|
};
|
|
239
242
|
recordRead: true;
|
|
@@ -37,12 +37,8 @@ async function loadSiteTranslations({ query, signal, }) {
|
|
|
37
37
|
}));
|
|
38
38
|
return {
|
|
39
39
|
rows,
|
|
40
|
-
total: typeof translations.total === "number" ? translations.total :
|
|
41
|
-
summary: {
|
|
42
|
-
localeTotal: typeof translations.localeTotal === "number"
|
|
43
|
-
? translations.localeTotal
|
|
44
|
-
: rows.length,
|
|
45
|
-
},
|
|
40
|
+
total: typeof translations.total === "number" ? translations.total : undefined,
|
|
41
|
+
summary: typeof translations.localeTotal === "number" ? { localeTotal: translations.localeTotal } : {},
|
|
46
42
|
resolvedQuery: selectedLocale
|
|
47
43
|
? { filters: { locale: selectedLocale } }
|
|
48
44
|
: undefined,
|
|
@@ -74,7 +70,7 @@ async function loadEditorTranslations({ query, signal, }) {
|
|
|
74
70
|
const site = isPhiRecord(result?.site) ? result.site : {};
|
|
75
71
|
return {
|
|
76
72
|
rows,
|
|
77
|
-
total: typeof translations.total === "number" ? translations.total :
|
|
73
|
+
total: typeof translations.total === "number" ? translations.total : undefined,
|
|
78
74
|
resolvedQuery: selectedLocale
|
|
79
75
|
? { filters: { locale: selectedLocale } }
|
|
80
76
|
: undefined,
|
|
@@ -44,7 +44,7 @@ async function loadRows({ resourceKey, query, signal, }) {
|
|
|
44
44
|
const rows = readPhiTableRows(payload.rows);
|
|
45
45
|
return {
|
|
46
46
|
rows,
|
|
47
|
-
total: typeof payload.total === "number" && Number.isFinite(payload.total) ? payload.total :
|
|
47
|
+
total: typeof payload.total === "number" && Number.isFinite(payload.total) ? payload.total : undefined,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
async function readRecord({ resourceKey, rowIdentity, signal, }) {
|