@phis/ui 0.7.8 → 0.8.0
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/controls/phi-address-control.d.ts +23 -0
- package/components/controls/phi-address-control.js +43 -0
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-country-select-control.d.ts +22 -0
- package/components/controls/phi-country-select-control.js +16 -0
- package/components/controls/phi-dialog-control.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +5 -3
- package/components/controls/phi-drawer-control.d.ts +7 -5
- package/components/controls/phi-float-button-control.d.ts +8 -1
- package/components/controls/phi-float-button-control.js +19 -3
- package/components/controls/phi-form-control.js +52 -8
- package/components/controls/phi-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +14 -37
- package/components/controls/phi-modal-control.d.ts +5 -5
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-overlay-control-contract.d.ts +52 -17
- package/components/controls/phi-overlay-control-contract.js +55 -30
- package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
- package/components/controls/phi-reveal-once-dialog-control.js +52 -0
- package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
- package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- package/components/forms/form-option-flags.d.ts +20 -0
- package/components/forms/form-option-flags.js +38 -0
- package/components/forms/form-provider-contract.d.ts +23 -0
- package/components/forms/form-provider-contract.js +36 -0
- package/components/forms/form-provider-registry.d.ts +5 -1
- package/components/forms/shared-form-provider-registry.js +13 -0
- package/components/forms/structured-field-labels.d.ts +24 -0
- package/components/forms/structured-field-labels.js +43 -0
- package/components/forms/structured-form-field-controls.d.ts +12 -0
- package/components/forms/structured-form-field-controls.js +65 -0
- package/components/overlays/phi-overlay-container-client.js +2 -2
- package/components/regions/phi-cms-region-shell.js +2 -2
- package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/shell/phi-antd-icon.d.ts +1 -8
- package/components/shell/phi-antd-icon.js +1 -227
- package/components/shell/phi-icon-names.d.ts +19 -0
- package/components/shell/phi-icon-names.js +264 -0
- package/components/shell/phi-icon.d.ts +2 -11
- package/components/shell/phi-icon.js +4 -32
- package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
- package/components/widgets/client/shared/phi-command-buttons.js +10 -4
- package/components/widgets/client/shared/phi-rendered-value.js +27 -3
- package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
- package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
- package/components/widgets/config/background.d.ts +3 -2
- package/components/widgets/config/choice-shared.d.ts +10 -1
- package/components/widgets/config/choice-shared.js +8 -2
- package/components/widgets/label-sets/admin-locales.js +1 -1
- package/components/widgets/label-sets/admin-users.d.ts +2 -5
- package/components/widgets/label-sets/admin-users.js +4 -10
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -0
- package/components/widgets/label-sets/profile.js +28 -0
- package/components/widgets/label-sets/search-results.js +2 -4
- package/components/widgets/label-sets/table.js +9 -0
- package/components/widgets/label-types/effects.d.ts +3 -2
- package/components/widgets/label-types/effects.js +1 -2
- package/components/widgets/label-types/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/server/builder-chrome.d.ts +4 -1
- package/components/widgets/server/builder-chrome.js +2 -2
- package/components/widgets/shared/markdown-body-client.d.ts +26 -0
- package/components/widgets/shared/markdown-body-client.js +31 -1
- package/components/widgets/shared/markdown-render.d.ts +10 -2
- package/components/widgets/shared/markdown-render.js +35 -13
- package/constants/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +25 -0
- package/constants/customer-file.js +26 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +12 -0
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +1 -0
- package/constants.js +2 -0
- package/gateway/form-handler-request.d.ts +22 -0
- package/gateway/form-handler-request.js +40 -0
- package/gateway/label-set.d.ts +15 -2
- package/gateway/label-set.js +60 -22
- package/gateway/site-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -0
- package/helpers/cms-dialog.d.ts +5 -20
- package/helpers/cms-dialog.js +8 -13
- package/helpers/cms-page-catalog.d.ts +10 -0
- package/helpers/cms-page-catalog.js +19 -0
- package/helpers/cms-preset-nodes.d.ts +4 -4
- package/helpers/cms-preset-nodes.js +1 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/country-names.d.ts +12 -0
- package/helpers/country-names.js +14 -0
- package/helpers/phi-metadata.d.ts +33 -1
- package/helpers/phi-metadata.js +62 -1
- package/helpers/preset-table-check.d.ts +34 -0
- package/helpers/preset-table-check.js +124 -0
- package/helpers/preset-text-source-check.d.ts +4 -1
- package/helpers/preset-text-source-check.js +6 -1
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +30 -5
- package/helpers/public-route-claims.d.ts +9 -1
- package/helpers/public-route-claims.js +23 -3
- package/helpers/record-fields.d.ts +1 -5
- package/helpers/record-fields.js +15 -6
- package/helpers/route-address-check.d.ts +22 -2
- package/helpers/route-address-check.js +29 -8
- package/helpers/site-address-row.d.ts +23 -0
- package/helpers/site-address-row.js +36 -0
- package/helpers/surface-style.d.ts +8 -1
- package/helpers/surface-style.js +12 -2
- package/helpers/thread-inbox-row.d.ts +20 -0
- package/helpers/thread-inbox-row.js +26 -0
- package/helpers/translation-format.d.ts +26 -0
- package/helpers/translation-format.js +31 -0
- package/module-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +1 -0
- package/module-page-check.js +1 -0
- package/module-records.d.ts +2 -2
- package/module-records.js +1 -0
- package/next/area-route.js +34 -1
- package/next/root-route.js +4 -5
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
- package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
- package/plugins/runtime-modules/accounting/data-providers.js +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
- package/plugins/runtime-modules/accounting/ids.js +23 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
- package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/app/client-data-providers.js +9 -0
- package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
- package/plugins/runtime-modules/app/data-providers.js +80 -0
- package/plugins/runtime-modules/app/definition.d.ts +131 -0
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +46 -1
- package/plugins/runtime-modules/app/forms.js +195 -1
- package/plugins/runtime-modules/app/ids.d.ts +7 -0
- package/plugins/runtime-modules/app/ids.js +8 -0
- package/plugins/runtime-modules/app/module.d.ts +131 -0
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
- package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
- package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
- package/plugins/runtime-modules/asset/presets.d.ts +4 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
- package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
- package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
- package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
- package/plugins/runtime-modules/blog/presets.d.ts +4 -0
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
- package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
- package/plugins/runtime-modules/builder/persistence.js +4 -0
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
- package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
- package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
- package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
- package/plugins/runtime-modules/client-manifests/app.js +3 -0
- package/plugins/runtime-modules/client-manifests/builder.js +10 -0
- package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +23 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
- package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
- package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
- package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
- package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
- package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
- package/plugins/runtime-modules/descriptor-compiler.js +44 -16
- package/plugins/runtime-modules/editor/presets.d.ts +4 -0
- package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/localization/presets.d.ts +4 -0
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
- package/plugins/runtime-modules/news/presets.d.ts +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
- package/plugins/runtime-modules/resolver.js +17 -0
- package/plugins/runtime-modules/revisions/controller/client.js +13 -11
- package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/table.js +13 -4
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/definition.js +1 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
- package/plugins/runtime-modules/threads/data-providers.js +85 -0
- package/plugins/runtime-modules/threads/definition.d.ts +115 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +3 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
- package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
- package/plugins/runtime-modules/user-management/data-providers.js +101 -3
- package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
- package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
- package/plugins/runtime-modules/user-management/ids.js +9 -0
- package/plugins/runtime-modules/user-management/presets.js +17 -1
- package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
- package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
- package/server-helpers/cms-page-record.d.ts +9 -1
- package/server-helpers/cms-page-record.js +11 -1
- package/server-helpers/cms-request.js +8 -5
- package/server-helpers/link-preview-image.d.ts +30 -0
- package/server-helpers/link-preview-image.js +57 -0
- package/server-helpers/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/shell.css +30 -6
- package/theme/phi-theme-composition.js +9 -0
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.js +103 -0
- package/theme/phi-theme-tokens.d.ts +2 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/cms-module-descriptors.d.ts +14 -0
- package/types/cms-overlay.d.ts +13 -6
- package/types/cms-overlay.js +6 -22
- package/types/cms-plugins.d.ts +14 -2
- package/types/cms.d.ts +10 -0
- package/types/core-widget-placements.d.ts +3 -3
- package/types/link-preview.d.ts +19 -0
- package/types/link-preview.js +19 -0
- package/types/record-provider.d.ts +22 -1
- package/types/site-theme.d.ts +27 -0
- package/types/table-embed.d.ts +48 -0
- package/types/table-embed.js +1 -0
- package/types/table-widget.d.ts +14 -0
- package/types/widget-runtime.d.ts +3 -0
- package/types.d.ts +1 -0
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
|
@@ -48,6 +48,11 @@ export type PhiDeveloperBuilderPageMetaDraft = {
|
|
|
48
48
|
* why it is resolved apart from them at save time.
|
|
49
49
|
*/
|
|
50
50
|
index?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The picture a link to the Page shows, as the Page holds it (`page.layoutConfig.shareImage`). No
|
|
53
|
+
* dialog field edits it yet; it is carried from the Page into its next save so a save keeps it.
|
|
54
|
+
*/
|
|
55
|
+
shareImage?: import("../../../types/link-preview").PhiShareImage | null;
|
|
51
56
|
};
|
|
52
57
|
export type PhiDeveloperBuilderDraftAllocation = {
|
|
53
58
|
revisionId: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "server-only";
|
|
2
|
+
import { type PhiShareImage } from "../../../types/link-preview";
|
|
2
3
|
import type { PhiBlockRuntime } from "../../../types/widget-runtime";
|
|
3
4
|
import type { PhiRuntimeModuleCatalog } from "../../../types";
|
|
4
5
|
import type { PhiCmsPageRecordDescriptor } from "../../../types/record-provider";
|
|
@@ -29,6 +30,12 @@ export type PhiBuilderPageMeta = {
|
|
|
29
30
|
* Carried into the Page's next save, which states the tree whole.
|
|
30
31
|
*/
|
|
31
32
|
controllerSettings: PhiCmsTreeControllerSettings;
|
|
33
|
+
/**
|
|
34
|
+
* The picture a link to the Page shows (`page.layoutConfig.shareImage`), from the same chain. No dialog
|
|
35
|
+
* field states it yet -- a preset, a Module or an agent does -- so it is carried into the next save, which
|
|
36
|
+
* states the Page's config whole.
|
|
37
|
+
*/
|
|
38
|
+
shareImage: PhiShareImage | null;
|
|
32
39
|
};
|
|
33
40
|
/**
|
|
34
41
|
* The record a route preset's Page is about, for the Page the Builder is on: `null` for a Page that is no
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "server-only";
|
|
2
|
+
import { PHI_PAGE_SHARE_IMAGE_CONFIG_KEY, readPhiShareImage } from "../../../types/link-preview";
|
|
2
3
|
import { applyPhiPresetTreeCurrentContent } from "../../../server-helpers/cms-bound-content";
|
|
3
4
|
import { cache } from "react";
|
|
4
5
|
import { cookies } from "next/headers";
|
|
@@ -294,6 +295,7 @@ async function buildPageMetaForScope(runtime, area, pageKey, runtimeModuleCatalo
|
|
|
294
295
|
isDeleted: draftPage.page.page.status === PhiCmsStatus.Deleted,
|
|
295
296
|
index: readPageIndexFlag(draftPage.page.page.flags),
|
|
296
297
|
controllerSettings: draftPage.page.controllerSettings ?? [],
|
|
298
|
+
shareImage: readPageShareImage(draftPage.page.page),
|
|
297
299
|
};
|
|
298
300
|
}
|
|
299
301
|
if (draftPage?.page) {
|
|
@@ -303,6 +305,7 @@ async function buildPageMetaForScope(runtime, area, pageKey, runtimeModuleCatalo
|
|
|
303
305
|
isDeleted: draftPage.page.page.status === PhiCmsStatus.Deleted,
|
|
304
306
|
index: readPageIndexFlag(draftPage.page.page.flags),
|
|
305
307
|
controllerSettings: draftPage.page.controllerSettings ?? [],
|
|
308
|
+
shareImage: readPageShareImage(draftPage.page.page),
|
|
306
309
|
};
|
|
307
310
|
}
|
|
308
311
|
if (resolvedPage?.page?.pageMeta) {
|
|
@@ -312,6 +315,7 @@ async function buildPageMetaForScope(runtime, area, pageKey, runtimeModuleCatalo
|
|
|
312
315
|
isDeleted: resolvedPage.page.page.status === PhiCmsStatus.Deleted,
|
|
313
316
|
index: readPageIndexFlag(resolvedPage.page.page.flags),
|
|
314
317
|
controllerSettings: resolvedPage.page.controllerSettings ?? [],
|
|
318
|
+
shareImage: readPageShareImage(resolvedPage.page.page),
|
|
315
319
|
};
|
|
316
320
|
}
|
|
317
321
|
const presetTree = presetResolution
|
|
@@ -336,16 +340,21 @@ async function buildPageMetaForScope(runtime, area, pageKey, runtimeModuleCatalo
|
|
|
336
340
|
* the first source that holds titles, and a resolved Page without them still holds the tree.
|
|
337
341
|
*/
|
|
338
342
|
const controllerSettings = resolvedPage?.page?.controllerSettings ?? presetTree?.controllerSettings ?? [];
|
|
343
|
+
const shareImage = readPageShareImage(resolvedPage?.page?.page ?? presetTree?.page);
|
|
339
344
|
if (!presetTree?.pageMeta) {
|
|
340
|
-
return { title: null, description: null, index: presetIndex, controllerSettings };
|
|
345
|
+
return { title: null, description: null, index: presetIndex, controllerSettings, shareImage };
|
|
341
346
|
}
|
|
342
347
|
return {
|
|
343
348
|
title: presetTree.pageMeta.title?.value ?? null,
|
|
344
349
|
description: presetTree.pageMeta.description?.value ?? null,
|
|
345
350
|
index: presetIndex,
|
|
346
351
|
controllerSettings,
|
|
352
|
+
shareImage,
|
|
347
353
|
};
|
|
348
354
|
}
|
|
355
|
+
function readPageShareImage(page) {
|
|
356
|
+
return readPhiShareImage(page?.layoutConfig?.[PHI_PAGE_SHARE_IMAGE_CONFIG_KEY]);
|
|
357
|
+
}
|
|
349
358
|
function readPageIndexFlag(flags) {
|
|
350
359
|
return !hasPhiFlag(flags, PhiCmsFlags.NoIndex);
|
|
351
360
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { phiAreaPath } from "../../../helpers/locale";
|
|
3
3
|
import { resolvePhiBuilderAreaAsCmsArea, resolvePhiBuilderAreaMask } from "../../../constants/cms-areas";
|
|
4
4
|
import { PhiCmsFlags, PhiCmsStatus } from "../../../constants/phi-cms";
|
|
5
|
+
import { PHI_PAGE_SHARE_IMAGE_CONFIG_KEY } from "../../../types/link-preview";
|
|
5
6
|
import { readPhiCmsInstanceId } from "../../../types/cms-instance-id";
|
|
6
7
|
import { getPhiBuilderPageDraftKey, getPhiBuilderRegionDraftKey, PHI_BUILDER_PAGE_REGION_KEYS, PHI_BUILDER_SHELL_REGION_KEYS, } from "./region-keys";
|
|
7
8
|
import { getPhiBuilderDefaultRegionDraft } from "./region-defaults";
|
|
@@ -526,6 +527,8 @@ export async function savePhiDeveloperBuilderDraft(state, regionDrafts, workspac
|
|
|
526
527
|
const currentPagePresetSource = resolvePhiBuilderPagePresetSource(pageKey, pages);
|
|
527
528
|
const currentAreaPresetSource = state.areaPresetSourcesByArea[area] ?? null;
|
|
528
529
|
const pageMetaDraft = state.pageMetaDrafts?.[getPhiBuilderPageDraftKey(area, "page_meta", pageKey)] ?? null;
|
|
530
|
+
// The Page's config beside its Regions: the share picture it holds travels with every save.
|
|
531
|
+
const pageShareImage = pageMetaDraft?.shareImage ? { [PHI_PAGE_SHARE_IMAGE_CONFIG_KEY]: pageMetaDraft.shareImage } : {};
|
|
529
532
|
/*
|
|
530
533
|
* The Page flags travel apart from the rest of the meta draft: the titles become translated
|
|
531
534
|
* messages and this is a column on the row, so the payload splits them even though the dialog
|
|
@@ -631,6 +634,7 @@ export async function savePhiDeveloperBuilderDraft(state, regionDrafts, workspac
|
|
|
631
634
|
drawerRightRootLayoutNodeId: pageRootIds.drawer_right ?? null,
|
|
632
635
|
layoutConfig: {
|
|
633
636
|
pageRegionConfigs,
|
|
637
|
+
...pageShareImage,
|
|
634
638
|
},
|
|
635
639
|
},
|
|
636
640
|
overlays: [],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buildPhiRuntimeModulePackageRoutePrefix } from "../../../helpers/runtime-module-route-path";
|
|
2
2
|
import { buildPhiPublicRouteAddressMap, findPhiPublicRoutePathCollisions, } from "../../../helpers/public-route-claims";
|
|
3
3
|
import { isPhiAssignablePublicRoutePath, } from "../../../helpers/cms-area-config";
|
|
4
|
+
import { isPhiRouteAddressBeneath } from "../../../helpers/route-address-check";
|
|
4
5
|
import { assignPhiWorkspacePublicRoutePaths } from "./workspace-catalog-actions";
|
|
5
6
|
import { listPhiAlwaysActiveRuntimeModuleIds } from "../settings";
|
|
6
7
|
import { markPhiBuilderModuleAreasDirty } from "./developer-workspace-store";
|
|
@@ -53,12 +54,14 @@ function buildPhiBuilderPublicAddressMap(state, options) {
|
|
|
53
54
|
*/
|
|
54
55
|
function suggestPhiPublicRoutePath(moduleId, declaredPath, taken) {
|
|
55
56
|
const namespaced = `${buildPhiRuntimeModulePackageRoutePrefix(moduleId)}${declaredPath}`;
|
|
56
|
-
|
|
57
|
+
// Free, and neither beneath nor above an address another holds.
|
|
58
|
+
const free = (candidate) => !taken.has(candidate) && ![...taken.keys()].some((held) => isPhiRouteAddressBeneath(held, candidate) || isPhiRouteAddressBeneath(candidate, held));
|
|
59
|
+
if (free(namespaced)) {
|
|
57
60
|
return namespaced;
|
|
58
61
|
}
|
|
59
62
|
for (let attempt = 2; attempt < 20; attempt += 1) {
|
|
60
63
|
const candidate = `${namespaced}-${attempt}`;
|
|
61
|
-
if (
|
|
64
|
+
if (free(candidate)) {
|
|
62
65
|
return candidate;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
@@ -93,7 +96,9 @@ export function resolvePhiBuilderPublicRouteCollisionAnswers(state, moduleId) {
|
|
|
93
96
|
presetKey: collision.claim.presetKey,
|
|
94
97
|
title: collision.claim.title,
|
|
95
98
|
declaredPath: collision.path,
|
|
96
|
-
heldBy:
|
|
99
|
+
heldBy: collision.relation === "same"
|
|
100
|
+
? describePhiPublicRouteAddressHolder(collision.heldBy, moduleTitles)
|
|
101
|
+
: `${describePhiPublicRouteAddressHolder(collision.heldBy, moduleTitles)} (${collision.heldPath})`,
|
|
97
102
|
published: collision.heldBy.kind === "page" ? collision.heldBy.published : collision.heldBy.claim.live === true,
|
|
98
103
|
path,
|
|
99
104
|
};
|
package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js
CHANGED
|
@@ -140,7 +140,7 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
140
140
|
config: {
|
|
141
141
|
title: null,
|
|
142
142
|
placement: "right",
|
|
143
|
-
size: 377,
|
|
143
|
+
size: { width: 377 },
|
|
144
144
|
mountPolicy: "lazy-keep",
|
|
145
145
|
surface: { background: { base: { kind: "none" }, filter: "glass" } },
|
|
146
146
|
mask: { appearance: "transparent" },
|
|
@@ -531,6 +531,8 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
531
531
|
// it the Form instance the overlay waits for before it opens.
|
|
532
532
|
slotIndex: 1,
|
|
533
533
|
sortOrder: 0,
|
|
534
|
+
// The Builder's Label Set, translated already.
|
|
535
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
534
536
|
label: "Signal routes",
|
|
535
537
|
config: {
|
|
536
538
|
/*
|
|
@@ -724,7 +724,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
724
724
|
label: "Builder area settings",
|
|
725
725
|
config: {
|
|
726
726
|
title: labels.areaSettings.title,
|
|
727
|
-
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
727
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
728
728
|
/*
|
|
729
729
|
* Mounted with the Page rather than on first open, because the controls inside show state
|
|
730
730
|
* rather than ask for it.
|
|
@@ -754,7 +754,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
754
754
|
label: "Builder page metadata",
|
|
755
755
|
config: {
|
|
756
756
|
title: labels.pages.pageMeta,
|
|
757
|
-
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
757
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
758
758
|
mountPolicy: "lazy-keep",
|
|
759
759
|
closeMode: "immediate",
|
|
760
760
|
signalRoutes: {
|
|
@@ -775,7 +775,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
775
775
|
label: "Builder module detail",
|
|
776
776
|
config: {
|
|
777
777
|
title: modulesLabels?.detail.title ?? "Module details",
|
|
778
|
-
|
|
778
|
+
size: { width: 640 },
|
|
779
779
|
mountPolicy: "lazy-keep",
|
|
780
780
|
closeMode: "immediate",
|
|
781
781
|
signalRoutes: {
|
|
@@ -796,7 +796,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
796
796
|
label: "Builder module usage",
|
|
797
797
|
config: {
|
|
798
798
|
title: modulesLabels?.usage.title ?? "This Module draws on pages",
|
|
799
|
-
|
|
799
|
+
size: { width: 680 },
|
|
800
800
|
mountPolicy: "lazy-keep",
|
|
801
801
|
closeMode: "immediate",
|
|
802
802
|
signalRoutes: {
|
|
@@ -817,7 +817,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
817
817
|
label: "Builder public route collision",
|
|
818
818
|
config: {
|
|
819
819
|
title: modulesLabels?.publicRoutes.title ?? "Public addresses are taken",
|
|
820
|
-
|
|
820
|
+
size: { width: 720 },
|
|
821
821
|
mountPolicy: "lazy-keep",
|
|
822
822
|
closeMode: "immediate",
|
|
823
823
|
signalRoutes: {
|
|
@@ -1240,6 +1240,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1240
1240
|
parentLayoutNodeId: PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS.areaSettingsFields,
|
|
1241
1241
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[0].slotIndex,
|
|
1242
1242
|
sortOrder: 0,
|
|
1243
|
+
// The Builder's Label Set, translated already.
|
|
1244
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1243
1245
|
label: "dev area settings form",
|
|
1244
1246
|
config: {
|
|
1245
1247
|
formId: PHI_BUILDER_AREA_SETTINGS_FORM_ID,
|
|
@@ -1530,6 +1532,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1530
1532
|
id: PHI_BUILDER_MODULES_TABLE_WIDGET_ID,
|
|
1531
1533
|
parentLayoutNodeId: SYNTHETIC_DEV_LAYOUT_IDS.layoutContent,
|
|
1532
1534
|
slotIndex: 0,
|
|
1535
|
+
// The Builder's Label Set, translated already.
|
|
1536
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1533
1537
|
label: "dev modules table",
|
|
1534
1538
|
config: {
|
|
1535
1539
|
source: {
|
|
@@ -1678,6 +1682,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1678
1682
|
parentLayoutNodeId: PHI_BUILDER_MODULE_USAGE_LAYOUT_IDS.moduleUsageBody,
|
|
1679
1683
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[1].slotIndex,
|
|
1680
1684
|
sortOrder: 1,
|
|
1685
|
+
// The Builder's Label Set, translated already.
|
|
1686
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1681
1687
|
label: "Builder module usage rows",
|
|
1682
1688
|
config: {
|
|
1683
1689
|
source: {
|
|
@@ -1755,6 +1761,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1755
1761
|
parentLayoutNodeId: PHI_BUILDER_PUBLIC_ROUTES_LAYOUT_IDS.publicRoutesBody,
|
|
1756
1762
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[1].slotIndex,
|
|
1757
1763
|
sortOrder: 1,
|
|
1764
|
+
// The Builder's Label Set, translated already.
|
|
1765
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1758
1766
|
label: "Builder public route collision rows",
|
|
1759
1767
|
config: {
|
|
1760
1768
|
source: {
|
|
@@ -1838,6 +1846,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1838
1846
|
parentLayoutNodeId: PHI_BUILDER_MODULE_DETAIL_LAYOUT_IDS.body,
|
|
1839
1847
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
1840
1848
|
sortOrder: 0,
|
|
1849
|
+
// The Builder's Label Set, translated already.
|
|
1850
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1841
1851
|
label: "dev module detail fields",
|
|
1842
1852
|
config: {
|
|
1843
1853
|
source: {
|
|
@@ -1907,6 +1917,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1907
1917
|
id: SYNTHETIC_DEV_WIDGET_IDS.widgetNavigationSource,
|
|
1908
1918
|
parentLayoutNodeId: SYNTHETIC_DEV_LAYOUT_IDS.layoutContent,
|
|
1909
1919
|
slotIndex: 0,
|
|
1920
|
+
// The Builder's Label Set, translated already.
|
|
1921
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1910
1922
|
label: "dev navigation source",
|
|
1911
1923
|
config: {
|
|
1912
1924
|
source: {
|
|
@@ -1948,6 +1960,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1948
1960
|
id: SYNTHETIC_DEV_WIDGET_IDS.widgetNavigationItems,
|
|
1949
1961
|
parentLayoutNodeId: SYNTHETIC_DEV_LAYOUT_IDS.layoutContent,
|
|
1950
1962
|
slotIndex: 1,
|
|
1963
|
+
// The Builder's Label Set, translated already.
|
|
1964
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
1951
1965
|
label: "dev navigation items",
|
|
1952
1966
|
config: {
|
|
1953
1967
|
source: {
|
|
@@ -2076,7 +2090,20 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
2076
2090
|
slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Left,
|
|
2077
2091
|
sortOrder: 0,
|
|
2078
2092
|
label: "dev builder mode switch",
|
|
2079
|
-
config: {
|
|
2093
|
+
config: {
|
|
2094
|
+
// The mode chosen goes to the Builder Controller, which enters the editor or the preview.
|
|
2095
|
+
signalRoutes: {
|
|
2096
|
+
emits: [{
|
|
2097
|
+
routeKey: "builder-mode-change",
|
|
2098
|
+
capabilityId: "change",
|
|
2099
|
+
scope: "area",
|
|
2100
|
+
channel: "builderMode",
|
|
2101
|
+
action: "change",
|
|
2102
|
+
valueType: "string",
|
|
2103
|
+
receiver: createPhiBuilderControllerAddress(),
|
|
2104
|
+
}],
|
|
2105
|
+
},
|
|
2106
|
+
},
|
|
2080
2107
|
}),
|
|
2081
2108
|
]
|
|
2082
2109
|
: []),
|
|
@@ -3,9 +3,11 @@ import { type PhiSignalRouteSet } from "../../../../../types/signals";
|
|
|
3
3
|
export type PhiBuilderChromeWidgetConfig = {
|
|
4
4
|
signalRoutes?: PhiSignalRouteSet;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
6
|
+
/** A chrome Widget that only draws Builder state -- the Inspector's heading -- reads no config at all. */
|
|
7
|
+
export type PhiBuilderChromeStateWidgetConfig = Record<string, never>;
|
|
8
|
+
type PhiBuilderChromeWidgetDefinition<TConfig = PhiBuilderChromeWidgetConfig> = Pick<PhiCmsWidgetPlugin<TConfig>, "kind" | "pluginKey" | "typeKey" | "title" | "description" | "category" | "iconFamily" | "runtimeSignals" | "slotSizePolicy" | "fields" | "parseConfig">;
|
|
9
|
+
export declare const PHI_BUILDER_MODE_SWITCH_WIDGET_DEFINITION: PhiBuilderChromeWidgetDefinition<PhiBuilderChromeWidgetConfig>;
|
|
10
|
+
export declare const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_DEFINITION: PhiBuilderChromeWidgetDefinition<PhiBuilderChromeStateWidgetConfig>;
|
|
9
11
|
export type PhiBuilderInspectorSectionWidgetSpec = {
|
|
10
12
|
typeKey: string;
|
|
11
13
|
view: "region" | "layout" | "widget";
|
|
@@ -175,6 +177,6 @@ export declare const PHI_BUILDER_INSPECTOR_SECTION_WIDGET_DEFINITIONS: {
|
|
|
175
177
|
readonly section: "signals";
|
|
176
178
|
readonly title: "Widget Signals";
|
|
177
179
|
};
|
|
178
|
-
definition: PhiBuilderChromeWidgetDefinition
|
|
180
|
+
definition: PhiBuilderChromeWidgetDefinition<PhiBuilderChromeWidgetConfig>;
|
|
179
181
|
}[];
|
|
180
182
|
export {};
|
|
@@ -3,6 +3,9 @@ import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet } from "../../../../../
|
|
|
3
3
|
function parseBuilderChromeWidgetConfig(config) {
|
|
4
4
|
return { signalRoutes: readPhiSignalRouteSet(config.signalRoutes) ?? undefined };
|
|
5
5
|
}
|
|
6
|
+
function parseBuilderChromeStateWidgetConfig() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
6
9
|
function createBuilderChromeWidgetDefinition(options) {
|
|
7
10
|
return {
|
|
8
11
|
kind: "widget",
|
|
@@ -15,7 +18,7 @@ function createBuilderChromeWidgetDefinition(options) {
|
|
|
15
18
|
runtimeSignals: options.runtimeSignals,
|
|
16
19
|
slotSizePolicy: options.slotSizePolicy,
|
|
17
20
|
fields: [],
|
|
18
|
-
parseConfig:
|
|
21
|
+
parseConfig: options.parseConfig,
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
24
|
export const PHI_BUILDER_MODE_SWITCH_WIDGET_DEFINITION = createBuilderChromeWidgetDefinition({
|
|
@@ -23,12 +26,18 @@ export const PHI_BUILDER_MODE_SWITCH_WIDGET_DEFINITION = createBuilderChromeWidg
|
|
|
23
26
|
slotSizePolicy: "intrinsic",
|
|
24
27
|
title: "Builder Mode Switch",
|
|
25
28
|
description: "Editor and preview switch for Builder workspaces.",
|
|
29
|
+
/* The mode chosen, along the routes its tree writes: the Builder Controller enters the editor or the preview. */
|
|
30
|
+
runtimeSignals: {
|
|
31
|
+
emits: [{ id: "change", action: "change", valueType: "string" }],
|
|
32
|
+
},
|
|
33
|
+
parseConfig: parseBuilderChromeWidgetConfig,
|
|
26
34
|
});
|
|
27
35
|
export const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_DEFINITION = createBuilderChromeWidgetDefinition({
|
|
28
36
|
typeKey: "builder-inspector-header",
|
|
29
37
|
slotSizePolicy: "intrinsic",
|
|
30
38
|
title: "Builder Inspector Header",
|
|
31
39
|
description: "Dynamic node kind and type heading for Builder inspector overlays.",
|
|
40
|
+
parseConfig: parseBuilderChromeStateWidgetConfig,
|
|
32
41
|
});
|
|
33
42
|
export const PHI_BUILDER_INSPECTOR_SECTION_WIDGET_SPECS = [
|
|
34
43
|
{ typeKey: "builder-region-geometry-inspector", view: "region", section: "geometry", title: "Region Geometry" },
|
|
@@ -63,5 +72,6 @@ export const PHI_BUILDER_INSPECTOR_SECTION_WIDGET_DEFINITIONS = PHI_BUILDER_INSP
|
|
|
63
72
|
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.builderInspector,
|
|
64
73
|
}],
|
|
65
74
|
},
|
|
75
|
+
parseConfig: parseBuilderChromeWidgetConfig,
|
|
66
76
|
}),
|
|
67
77
|
}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PhiCmsBuilderWidgetPlugin } from "../../../../../types";
|
|
2
|
-
import { type
|
|
3
|
-
export declare const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_BUILDER_PLUGIN: PhiCmsBuilderWidgetPlugin<
|
|
2
|
+
import { type PhiBuilderChromeStateWidgetConfig } from "../chrome/config";
|
|
3
|
+
export declare const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_BUILDER_PLUGIN: PhiCmsBuilderWidgetPlugin<PhiBuilderChromeStateWidgetConfig>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PhiCmsWidgetPlugin } from "../../../../../types";
|
|
2
|
-
import { type
|
|
3
|
-
export declare const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_PLUGIN: PhiCmsWidgetPlugin<
|
|
2
|
+
import { type PhiBuilderChromeStateWidgetConfig } from "../chrome/config";
|
|
3
|
+
export declare const PHI_BUILDER_INSPECTOR_HEADER_WIDGET_PLUGIN: PhiCmsWidgetPlugin<PhiBuilderChromeStateWidgetConfig>;
|
|
@@ -3,6 +3,6 @@ import { PhiBuilderModeSwitchWidget } from "../../../../../components/widgets/se
|
|
|
3
3
|
import { PHI_BUILDER_MODE_SWITCH_WIDGET_DEFINITION } from "../chrome/config";
|
|
4
4
|
export const PHI_BUILDER_MODE_SWITCH_WIDGET_PLUGIN = {
|
|
5
5
|
...PHI_BUILDER_MODE_SWITCH_WIDGET_DEFINITION,
|
|
6
|
-
render: ({ runtime }) => _jsx(PhiBuilderModeSwitchWidget, { runtime: runtime }),
|
|
6
|
+
render: ({ runtime, config }) => _jsx(PhiBuilderModeSwitchWidget, { runtime: runtime, signalRoutes: config?.signalRoutes }),
|
|
7
7
|
renderPreview: ({ runtime }) => _jsx(PhiBuilderModeSwitchWidget, { runtime: runtime, disabled: true }),
|
|
8
8
|
};
|
|
@@ -41,7 +41,7 @@ import { PhiTypographyControl } from "../../../../../components/controls/phi-typ
|
|
|
41
41
|
import { PhiIcon } from "../../../../../components/shell/phi-icon";
|
|
42
42
|
import { PhiSurfaceTone } from "../../../../../components/surface/phi-surface-tone";
|
|
43
43
|
import { resolvePhiSurfaceToneClassName } from "../../../../../types/surface";
|
|
44
|
-
import {
|
|
44
|
+
import { phiSurfaceTakesToneGround, resolvePhiSurfaceToneGround } from "../../../../../helpers/surface-style";
|
|
45
45
|
import { joinPhiClassNames } from "../../../../../helpers/class-names";
|
|
46
46
|
/** The Region's root Layout placed into another tree, at the slot it is moved to. */
|
|
47
47
|
function buildStructureRootLayoutNode(draft, parentLayoutNodeId, slotIndex) {
|
|
@@ -374,7 +374,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
374
374
|
...(effectiveDraft?.surface?.background
|
|
375
375
|
? resolvePhiBackgroundWidgetStyle(effectiveDraft.surface.background)
|
|
376
376
|
: {}),
|
|
377
|
-
...(toneGround ? { backgroundColor:
|
|
377
|
+
...(toneGround ? { backgroundColor: resolvePhiSurfaceToneGround(effectiveDraft?.surface?.tone) } : {}),
|
|
378
378
|
};
|
|
379
379
|
const slotBorderStyle = effectiveDraft?.surface?.border ? resolvePhiBorderWidgetStyle(effectiveDraft.surface.border) : {};
|
|
380
380
|
const regionConfig = (effectiveDraft?.regionConfig ?? null);
|
|
@@ -6,12 +6,15 @@ import { PHI_COMMON_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST } from "./commo
|
|
|
6
6
|
import { extendPhiRuntimeModuleDataProviderClientManifest } from "../../../components/runtime/runtime-module-data-provider-client-manifest";
|
|
7
7
|
import { PHI_DASHBOARD_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS } from "../dashboard/client-data-providers";
|
|
8
8
|
import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS } from "../groups/client-data-providers";
|
|
9
|
+
import { PHI_APP_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS } from "../app/client-data-providers";
|
|
9
10
|
import { extendPhiRuntimeModuleRenderClientManifest } from "../../../components/runtime/runtime-module-render-client-manifest";
|
|
10
11
|
import { PHI_AUTH_SECURITY_RENDER_CLIENT_LOADER } from "./auth-render-clients";
|
|
11
12
|
export const PHI_APP_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST = extendPhiRuntimeModuleDataProviderClientManifest(PHI_COMMON_RUNTIME_MODULE_DATA_PROVIDER_CLIENT_MANIFEST, [
|
|
12
13
|
// The App reads groups too: someone sees which groups they are in and who else is in them.
|
|
13
14
|
...PHI_DASHBOARD_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS,
|
|
14
15
|
...PHI_GROUPS_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS,
|
|
16
|
+
// The account's own addresses, on its Profile page.
|
|
17
|
+
...PHI_APP_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS,
|
|
15
18
|
]);
|
|
16
19
|
export { PHI_COMMON_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST as PHI_APP_RUNTIME_MODULE_CALENDAR_ADAPTER_CLIENT_MANIFEST } from "./common";
|
|
17
20
|
export { PHI_COMMON_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST as PHI_APP_RUNTIME_MODULE_MEDIA_SOURCE_CLIENT_MANIFEST } from "./common";
|
|
@@ -23,6 +23,16 @@ export const PHI_BUILDER_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST = extendPhiRuntim
|
|
|
23
23
|
PhiCmsWidgetType.AssetFocalRect,
|
|
24
24
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../../../components/media/phi-asset-focal-rect-widget").then((module) => module.PhiAssetFocalRectWidget))),
|
|
25
25
|
],
|
|
26
|
+
...[
|
|
27
|
+
[PhiRuntimeRenderClientType.BuilderBrandThemeControls, "PhiBuilderBrandThemeControlsWidgetClient"],
|
|
28
|
+
[PhiRuntimeRenderClientType.BuilderBrandThemePreview, "PhiBuilderBrandThemePreviewWidgetClient"],
|
|
29
|
+
[PhiRuntimeRenderClientType.BuilderBrandStyleControls, "PhiBuilderBrandStyleControlsWidgetClient"],
|
|
30
|
+
[PhiRuntimeRenderClientType.BuilderBrandBackgroundControls, "PhiBuilderBrandBackgroundControlsWidgetClient"],
|
|
31
|
+
[PhiRuntimeRenderClientType.BuilderBrandIdentityControls, "PhiBuilderBrandIdentityControlsWidgetClient"],
|
|
32
|
+
].map(([type, name]) => [
|
|
33
|
+
type,
|
|
34
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../../../plugins/runtime-modules/theme/widgets/brand-controls/client").then((module) => module[name]))),
|
|
35
|
+
]),
|
|
26
36
|
[
|
|
27
37
|
PhiRuntimeRenderClientType.BuilderModeSwitch,
|
|
28
38
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../../../plugins/runtime-modules/builder/clients/mode-switch").then((module) => module.PhiBuilderModeSwitchWidgetClient))),
|
|
@@ -95,6 +95,10 @@ export declare function definePhiContentEntryRoutes(spec: PhiContentEntryRoutesS
|
|
|
95
95
|
path: string;
|
|
96
96
|
landingPage?: true;
|
|
97
97
|
title: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
shareImage?: {
|
|
100
|
+
asset: string;
|
|
101
|
+
};
|
|
98
102
|
defaultPageFlags?: number;
|
|
99
103
|
loadTree: (context: PhiCmsDescriptorBuildContext & {
|
|
100
104
|
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PHI_SHARED_PACKAGE_NAME } from "../../constants/package";
|
|
2
|
-
import { createPhiRuntimeModuleId } from "../../constants/module-identity";
|
|
2
|
+
import { createPhiRuntimeModuleId, isPhiModuleScopedIdentifier, readPhiRuntimeModulePackageName } from "../../constants/module-identity";
|
|
3
3
|
import { PHI_RECORD_FIELD_KINDS } from "../../constants/record-field-kinds";
|
|
4
4
|
import { isPhiCalendarAdapterKey } from "../../types/calendar";
|
|
5
5
|
import { collectPhiVideoProviderDescriptorErrors, isPhiVideoProviderKey, } from "../../types/video";
|
|
@@ -12,6 +12,7 @@ import { isPhiNamespacedRuntimeKey } from "../../types/runtime-data-provider";
|
|
|
12
12
|
import { collectPhiModuleIconErrors } from "../../helpers/module-icons";
|
|
13
13
|
import { isPhiViewerAccessPolicyProviderOwned, } from "../../types/access";
|
|
14
14
|
import { isPhiOwnedRuntimeModuleId, isPhiRuntimeModuleSourceLocale, resolvePhiRuntimeModuleSourceLocale, } from "../../types/runtime-module-locale";
|
|
15
|
+
import { readPhiFormHandlerPathError } from "../../gateway/form-handler-request";
|
|
15
16
|
/*
|
|
16
17
|
* The Modules named here are named by id, as data. Importing their `ids.ts` bound every file that
|
|
17
18
|
* reads this one -- the Foundation among them -- to the Module folders at compile time (MODULES.md,
|
|
@@ -513,6 +514,7 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
|
|
|
513
514
|
const ownerModuleIdByFormValidationKey = new Map();
|
|
514
515
|
const ownerModuleIdByFormHandlerKey = new Map();
|
|
515
516
|
const ownerModuleIdByFormId = new Map();
|
|
517
|
+
const ownerModuleIdByTableEmbedKey = new Map();
|
|
516
518
|
let platformModuleId = null;
|
|
517
519
|
for (const entry of entries) {
|
|
518
520
|
const { definition } = entry;
|
|
@@ -605,6 +607,22 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
|
|
|
605
607
|
}
|
|
606
608
|
ownerModuleIdByDataProviderKey.set(provider.key, definition.moduleId);
|
|
607
609
|
}
|
|
610
|
+
// TABLES.md; columns and parameters are `checkPhiEmbeddableTables`'s.
|
|
611
|
+
for (const embed of definition.embeddableTables ?? []) {
|
|
612
|
+
const subject = `${definition.moduleId}: embeddable Table "${embed.key}"`;
|
|
613
|
+
const provider = definition.dataProviders?.find((candidate) => candidate.key === embed.source?.providerKey);
|
|
614
|
+
const owner = embed.key.slice(0, embed.key.indexOf("/table-embeds/"));
|
|
615
|
+
if (!isPhiModuleScopedIdentifier("table-embeds", embed.key) || ![definition.moduleId, readPhiRuntimeModulePackageName(definition.moduleId)].includes(owner)) {
|
|
616
|
+
throw new Error(`${subject} needs a table-embeds key of its own Module.`);
|
|
617
|
+
}
|
|
618
|
+
if (provider?.kind !== "table" || !provider.resources.some((resource) => resource.resourceKey === embed.source.resourceKey)) {
|
|
619
|
+
throw new Error(`${subject} reads a resource no table Provider of this Module declares.`);
|
|
620
|
+
}
|
|
621
|
+
if (ownerModuleIdByTableEmbedKey.has(embed.key))
|
|
622
|
+
throw new Error(`${subject} is owned twice.`);
|
|
623
|
+
assertOwnedAccessPolicy(definition.moduleId, ownerProviderId, embed.accessPolicy, `embeddable Table "${embed.key}"`);
|
|
624
|
+
ownerModuleIdByTableEmbedKey.set(embed.key, definition.moduleId);
|
|
625
|
+
}
|
|
608
626
|
for (const adapter of definition.calendarAdapters ?? []) {
|
|
609
627
|
if (!isPhiCalendarAdapterKey(adapter.key)) {
|
|
610
628
|
throw new Error(`${definition.moduleId}: invalid Calendar adapter key "${adapter.key}".`);
|
|
@@ -683,6 +701,10 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
|
|
|
683
701
|
(provider.requiresCsrf && provider.csrfPath == null)) {
|
|
684
702
|
throw new Error(`${definition.moduleId}: form handler provider "${provider.key}" has invalid immutable execution metadata.`);
|
|
685
703
|
}
|
|
704
|
+
const pathError = readPhiFormHandlerPathError(provider.upstreamPath);
|
|
705
|
+
if (pathError) {
|
|
706
|
+
throw new Error(`${definition.moduleId}: form handler provider "${provider.key}" has an invalid upstream path: ${pathError}.`);
|
|
707
|
+
}
|
|
686
708
|
if (provider.credentialPolicy === "auth-link" && definition.moduleId !== PHI_AUTH_RUNTIME_MODULE_ID) {
|
|
687
709
|
throw new Error(`${definition.moduleId}: form handler provider "${provider.key}" cannot claim Core-only auth-link credentials.`);
|
|
688
710
|
}
|
|
@@ -815,6 +837,14 @@ function assertPhiRecordDeclaration(owner, declaration) {
|
|
|
815
837
|
throw new Error(`${owner} field "${field.key}" has no label.`);
|
|
816
838
|
}
|
|
817
839
|
}
|
|
840
|
+
// A link preview names declared fields of the kind it shows: a title and a description are text.
|
|
841
|
+
const kinds = new Map(declaration.fields.map((field) => [field.key, field.kind]));
|
|
842
|
+
for (const [role, kind] of [["titleField", "text"], ["descriptionField", "text"], ["imageField", "picture"]]) {
|
|
843
|
+
const key = declaration.share?.[role];
|
|
844
|
+
if (key !== undefined && kinds.get(key) !== kind) {
|
|
845
|
+
throw new Error(`${owner} share.${role} "${key}" is no declared ${kind} field.`);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
818
848
|
}
|
|
819
849
|
function assertPhiRuntimeModuleRecordProviders(definition, entry) {
|
|
820
850
|
const descriptors = (definition.dataProviders ?? []).flatMap((provider) => provider.kind === "record" ? [provider] : []);
|
|
@@ -769,6 +769,29 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
769
769
|
readonly min: 0;
|
|
770
770
|
readonly precision: 0;
|
|
771
771
|
}];
|
|
772
|
+
} | {
|
|
773
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
774
|
+
key: `${string}/${string}`;
|
|
775
|
+
title: "Country";
|
|
776
|
+
valueType: "string";
|
|
777
|
+
presentation: "control";
|
|
778
|
+
settingsFields: readonly [{
|
|
779
|
+
readonly key: "allowClear";
|
|
780
|
+
readonly type: "boolean";
|
|
781
|
+
readonly label: "Allow clear";
|
|
782
|
+
}];
|
|
783
|
+
} | {
|
|
784
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
785
|
+
key: `${string}/${string}`;
|
|
786
|
+
title: "Address";
|
|
787
|
+
valueType: "json";
|
|
788
|
+
presentation: "control";
|
|
789
|
+
} | {
|
|
790
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
791
|
+
key: `${string}/${string}`;
|
|
792
|
+
title: "Flags";
|
|
793
|
+
valueType: "number";
|
|
794
|
+
presentation: "control";
|
|
772
795
|
})[];
|
|
773
796
|
readonly validationRules: ({
|
|
774
797
|
ownerModuleId: "@phis/ui/modules/core";
|
|
@@ -373,6 +373,29 @@ export declare const PHI_CORE_FORM_PROVIDER_DESCRIPTORS: {
|
|
|
373
373
|
readonly min: 0;
|
|
374
374
|
readonly precision: 0;
|
|
375
375
|
}];
|
|
376
|
+
} | {
|
|
377
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
378
|
+
key: `${string}/${string}`;
|
|
379
|
+
title: "Country";
|
|
380
|
+
valueType: "string";
|
|
381
|
+
presentation: "control";
|
|
382
|
+
settingsFields: readonly [{
|
|
383
|
+
readonly key: "allowClear";
|
|
384
|
+
readonly type: "boolean";
|
|
385
|
+
readonly label: "Allow clear";
|
|
386
|
+
}];
|
|
387
|
+
} | {
|
|
388
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
389
|
+
key: `${string}/${string}`;
|
|
390
|
+
title: "Address";
|
|
391
|
+
valueType: "json";
|
|
392
|
+
presentation: "control";
|
|
393
|
+
} | {
|
|
394
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
395
|
+
key: `${string}/${string}`;
|
|
396
|
+
title: "Flags";
|
|
397
|
+
valueType: "number";
|
|
398
|
+
presentation: "control";
|
|
376
399
|
})[];
|
|
377
400
|
readonly validationRules: ({
|
|
378
401
|
ownerModuleId: "@phis/ui/modules/core";
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a cell shows and what a condition reads, neither of which is a flag.
|
|
3
|
-
*
|
|
4
|
-
* `state` is the name a badge draws and `archived` and `locked` the answers a row action asks for; the
|
|
5
|
-
* enum values are strings because that is what an enum column and a condition compare against. The
|
|
6
|
-
* status itself stays on the row, because the filter above is written against what the route takes.
|
|
7
|
-
*
|
|
8
|
-
* One badge, so one state wins: archived over everything, then unread -- a message waiting to be read is
|
|
9
|
-
* what the reader acts on, and a lock is read in the conversation once it is open -- then locked.
|
|
10
|
-
*/
|
|
11
|
-
export declare function readPhiThreadInboxRow(row: Record<string, unknown>): {
|
|
12
|
-
kind: string;
|
|
13
|
-
status: string;
|
|
14
|
-
archived: boolean;
|
|
15
|
-
locked: boolean;
|
|
16
|
-
state: string;
|
|
17
|
-
};
|
|
18
1
|
/**
|
|
19
2
|
* What a row action writes, in the shape `PATCH /api/site/threads/{id}` takes it: archiving and reopening
|
|
20
3
|
* change the status, locking and unlocking the lock. Both are one row everybody in the conversation
|