@phis/ui 0.8.1 → 0.8.3
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/README.md +9 -2
- package/components/calendar/gregory-calendar-adapter-client.js +1 -0
- package/components/controls/phi-accordion-control.d.ts +6 -0
- package/components/controls/phi-accordion-control.js +8 -13
- package/components/controls/phi-background-control.js +2 -5
- package/components/controls/phi-builder-insert-picker-control-labels.d.ts +2 -0
- package/components/controls/phi-builder-insert-picker-control-labels.js +1 -0
- package/components/controls/phi-builder-insert-picker-control.js +10 -11
- package/components/controls/phi-cascader-control.d.ts +9 -3
- package/components/controls/phi-cascader-control.js +38 -10
- package/components/controls/phi-checkbox-group-control.d.ts +3 -1
- package/components/controls/phi-checkbox-group-control.js +2 -2
- package/components/controls/phi-collapse-control.d.ts +9 -2
- package/components/controls/phi-collapse-control.js +14 -2
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-color-field-control.d.ts +6 -1
- package/components/controls/phi-color-field-control.js +2 -2
- package/components/controls/phi-confirm-control.d.ts +1 -1
- package/components/controls/phi-confirm-control.js +71 -2
- package/components/controls/phi-confirm-dialog.js +2 -1
- package/components/controls/phi-date-picker-control.js +1 -1
- package/components/controls/phi-dimension-control.d.ts +3 -1
- package/components/controls/phi-dimension-control.js +2 -2
- package/components/controls/phi-geometry-control.js +1 -1
- package/components/controls/phi-length-control.d.ts +6 -1
- package/components/controls/phi-length-control.js +3 -2
- package/components/controls/phi-multi-select-control.d.ts +6 -1
- package/components/controls/phi-multi-select-control.js +3 -3
- package/components/controls/phi-segmented-control.d.ts +6 -1
- package/components/controls/phi-segmented-control.js +3 -3
- package/components/controls/phi-switch-control.d.ts +3 -1
- package/components/controls/phi-switch-control.js +3 -3
- package/components/controls/phi-table-control.d.ts +8 -1
- package/components/controls/phi-table-control.js +11 -5
- package/components/forms/compound-form-controls.js +16 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/media-widget-labels.d.ts +2 -0
- package/components/media/media-widget-labels.js +2 -0
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-asset-inspector-section.js +19 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
- package/components/shell/phi-builder-icon.js +9 -1
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/phi-table-surface.d.ts +25 -0
- package/components/tables/phi-table-surface.js +25 -0
- package/components/widgets/builder/phi-static-rows-editor.js +4 -1
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-choice-controller.d.ts +8 -1
- package/components/widgets/client/shared/phi-choice-controller.js +16 -1
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/config/choice-shared.d.ts +2 -0
- package/components/widgets/config/choice-shared.js +1 -0
- package/components/widgets/config/image-variant-options.d.ts +4 -1
- package/components/widgets/config/image-variant-options.js +27 -14
- package/components/widgets/inspector-field-row.d.ts +14 -1
- package/components/widgets/inspector-field-row.js +21 -1
- package/components/widgets/label-sets/builder-chrome.js +2 -0
- package/components/widgets/label-sets/inspector.js +10 -0
- package/components/widgets/label-sets/security.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +5 -0
- package/components/widgets/label-types/inspector.js +5 -0
- package/components/widgets/label-types/security.d.ts +2 -0
- package/components/widgets/signals/signal-endpoint-list.js +4 -1
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/runtime-module-ownership.js +1 -0
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/cms-inspector-drawer.d.ts +15 -0
- package/helpers/cms-inspector-drawer.js +37 -0
- package/helpers/cms-layout-defaults.js +1 -1
- package/helpers/preset-tree-contract-check.js +56 -0
- package/helpers/text-source.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/definition.d.ts +1 -1
- package/plugins/runtime-modules/accounting/definition.js +0 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +4 -4
- package/plugins/runtime-modules/accounting/ids.js +4 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +2 -1
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +5 -4
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +80 -38
- package/plugins/runtime-modules/admin/definition.d.ts +1 -1
- package/plugins/runtime-modules/admin/definition.js +0 -1
- package/plugins/runtime-modules/admin/module.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.js +0 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -1
- package/plugins/runtime-modules/area-base-definition.d.ts +19 -1
- package/plugins/runtime-modules/area-base-definition.js +18 -0
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/area-definitions.d.ts +8 -8
- package/plugins/runtime-modules/area-definitions.js +4 -3
- package/plugins/runtime-modules/area-root-route.d.ts +8 -0
- package/plugins/runtime-modules/area-root-route.js +11 -1
- package/plugins/runtime-modules/asset/labels.js +4 -0
- package/plugins/runtime-modules/asset/metadata-form.d.ts +0 -28
- package/plugins/runtime-modules/asset/metadata-form.js +6 -10
- package/plugins/runtime-modules/asset/services/options.d.ts +3 -2
- package/plugins/runtime-modules/asset/services/options.js +4 -3
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -1
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +3 -3
- package/plugins/runtime-modules/auth/widgets/security/client.js +2 -2
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.js +1 -1
- package/plugins/runtime-modules/builder/area-settings-form.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.d.ts +16 -0
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.js +9 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +97 -10
- package/plugins/runtime-modules/builder/clients/pages-header.js +7 -6
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +7 -4
- package/plugins/runtime-modules/builder/definition.d.ts +1 -1
- package/plugins/runtime-modules/builder/definition.js +0 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +10 -4
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -8
- package/plugins/runtime-modules/builder/page-meta-form.js +5 -2
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +20 -13
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +8 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +491 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/core/authoring-widgets.js +2 -1
- package/plugins/runtime-modules/core/messaging/label-defaults.d.ts +49 -0
- package/plugins/runtime-modules/core/messaging/label-defaults.js +48 -0
- package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -28
- package/plugins/runtime-modules/core/messaging/labels.js +52 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +3 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/select-box/client.js +13 -4
- package/plugins/runtime-modules/core/widgets/select-box/config.js +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/table/client.js +17 -8
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +1 -1143
- package/plugins/runtime-modules/core/widgets/table/config.js +144 -125
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +2 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +76 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +44 -1
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +28 -13
- package/plugins/runtime-modules/editor/definition.d.ts +1 -1
- package/plugins/runtime-modules/editor/definition.js +0 -1
- package/plugins/runtime-modules/editor/module.d.ts +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +16 -8
- package/plugins/runtime-modules/public/definition.d.ts +1 -1
- package/plugins/runtime-modules/public/definition.js +0 -1
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +109 -86
- package/plugins/runtime-modules/threads/controller/client.js +10 -12
- package/plugins/runtime-modules/threads/controller/definition.d.ts +6 -0
- package/plugins/runtime-modules/threads/controller/definition.js +17 -6
- package/styles/controls.css +49 -1
- package/styles/layout.css +3 -2
- package/types/calendar.d.ts +5 -0
- package/types/cms-plugins.d.ts +30 -10
- package/types/table-widget.d.ts +8 -2
|
@@ -162,7 +162,12 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
162
162
|
label: "pub header main three column",
|
|
163
163
|
config: {
|
|
164
164
|
...resolvePhiLayoutCreationPreset("threecol", "panel"),
|
|
165
|
+
/*
|
|
166
|
+
* App: three equal columns, the page title in the middle never needs more than a third. Public:
|
|
167
|
+
* unbalanced, the navigation in the middle takes what the brand and the actions leave.
|
|
168
|
+
*/
|
|
165
169
|
balancedSides: isApp,
|
|
170
|
+
...(isApp ? { sideShare: 33 } : {}),
|
|
166
171
|
justify: "space-between",
|
|
167
172
|
contentAlign: "center",
|
|
168
173
|
},
|
|
@@ -250,23 +255,26 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
250
255
|
id: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutFooterBottom,
|
|
251
256
|
siteId: page.siteId,
|
|
252
257
|
parentLayoutNodeId: null,
|
|
253
|
-
widgetType: buildPhiCmsLayoutNamespacedTypeKey(resolvePhiCmsLayoutPluginKey("
|
|
258
|
+
widgetType: buildPhiCmsLayoutNamespacedTypeKey(resolvePhiCmsLayoutPluginKey("three-column"), "three-column"),
|
|
254
259
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
255
260
|
sortOrder: 40,
|
|
256
261
|
status: 1,
|
|
257
262
|
flags: 0,
|
|
258
263
|
visibilityMask: page.visibilityMask,
|
|
259
|
-
label: "pub footer bottom
|
|
264
|
+
label: "pub footer bottom three column",
|
|
265
|
+
/*
|
|
266
|
+
* 20 : 60 : 20, the copyright line in the middle. The sides stand empty for a Site to fill;
|
|
267
|
+
* on a phone empty sides take nothing and the middle the whole row (LAYOUTING.md).
|
|
268
|
+
*/
|
|
260
269
|
config: {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
...resolvePhiLayoutCreationPreset("threecol", "panel"),
|
|
271
|
+
balancedSides: true,
|
|
272
|
+
sideShare: 20,
|
|
273
|
+
contentAlign: "center",
|
|
265
274
|
paddingTop: PHI_SPACE.sm,
|
|
266
275
|
paddingRight: PHI_SPACE.base,
|
|
267
276
|
paddingBottom: PHI_SPACE.sm,
|
|
268
277
|
paddingLeft: PHI_SPACE.base,
|
|
269
|
-
wrap: true,
|
|
270
278
|
minSize: { height: 48 },
|
|
271
279
|
},
|
|
272
280
|
},
|
|
@@ -417,7 +425,7 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
417
425
|
siteId: page.siteId,
|
|
418
426
|
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutFooterBottom,
|
|
419
427
|
widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("simple-text"), "simple-text"),
|
|
420
|
-
slotIndex:
|
|
428
|
+
slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Middle,
|
|
421
429
|
sortOrder: 0,
|
|
422
430
|
status: 1,
|
|
423
431
|
flags: 0,
|
|
@@ -4,7 +4,6 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE_DEFINITION: Omit<{
|
|
|
4
4
|
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
5
5
|
description: string;
|
|
6
6
|
category: "foundation";
|
|
7
|
-
icon: string;
|
|
8
7
|
formProviders: {
|
|
9
8
|
handlers: readonly [{
|
|
10
9
|
readonly key: `${string}/${string}`;
|
|
@@ -40,4 +39,5 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE_DEFINITION: Omit<{
|
|
|
40
39
|
kind: "module";
|
|
41
40
|
eligibleAreas: readonly ["public" | "app" | "admin" | "builder" | "editor" | "accounting"];
|
|
42
41
|
title: "Public Base" | "App Base" | "Accounting Base" | "Admin Base" | "Builder Base" | "Editor Base";
|
|
42
|
+
icon: string;
|
|
43
43
|
};
|
|
@@ -8,6 +8,5 @@ export const PHI_PUBLIC_RUNTIME_MODULE_DEFINITION = definePhiAreaBaseRuntimeModu
|
|
|
8
8
|
serverBinding: PHI_CORE_SERVER_BINDING,
|
|
9
9
|
description: "Locked Public Area shell, navigation surfaces, root routes, and public form handlers.",
|
|
10
10
|
category: "foundation",
|
|
11
|
-
icon: "antd:global",
|
|
12
11
|
formProviders: { handlers: PHI_PUBLIC_FORM_HANDLER_PROVIDER_DESCRIPTORS },
|
|
13
12
|
});
|
|
@@ -7,7 +7,6 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE: {
|
|
|
7
7
|
moduleId: "@phis/ui/modules/public";
|
|
8
8
|
category: "foundation";
|
|
9
9
|
description: string;
|
|
10
|
-
icon: string;
|
|
11
10
|
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
12
11
|
formProviders: {
|
|
13
12
|
handlers: readonly [{
|
|
@@ -43,4 +42,5 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE: {
|
|
|
43
42
|
kind: "module";
|
|
44
43
|
eligibleAreas: readonly ["public" | "app" | "admin" | "builder" | "editor" | "accounting"];
|
|
45
44
|
title: "Public Base" | "App Base" | "Accounting Base" | "Admin Base" | "Builder Base" | "Editor Base";
|
|
45
|
+
icon: string;
|
|
46
46
|
};
|
|
@@ -53,6 +53,7 @@ import { PhiPresetSizeControl } from "../../../../../components/controls/phi-pre
|
|
|
53
53
|
import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
|
|
54
54
|
import { PhiCheckboxControl } from "../../../../../components/controls/phi-checkbox-control";
|
|
55
55
|
import { PhiLabeledControl } from "../../../../../components/controls/phi-labeled-control";
|
|
56
|
+
import { PhiDescriptionHint } from "../../../../../components/controls/phi-description-tooltip-icon";
|
|
56
57
|
import { PhiNumberControl } from "../../../../../components/controls/phi-number-control";
|
|
57
58
|
import { PhiPaddingControl } from "../../../../../components/controls/phi-padding-control";
|
|
58
59
|
import { PhiColorControl } from "../../../../../components/controls/phi-color-control";
|
|
@@ -1145,6 +1146,7 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1145
1146
|
},
|
|
1146
1147
|
{
|
|
1147
1148
|
key: "gradients",
|
|
1149
|
+
description: _jsxs(_Fragment, { children: ["Three runs Buttons, badges, tags and switches can be filled with. ", previewMode === "dark" ? "Dark" : "Light", " mode; a slot left alone follows the palette's colours."] }),
|
|
1148
1150
|
label: (_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "wrap", style: { minWidth: 0 }, [PHI_VISUAL_ANCHOR_PART_ATTRIBUTE]: "gradients", children: [_jsx(PhiTypographyControl, { strong: true, style: { width: sectionLabelWidth }, children: "Gradients" }), _jsx(PhiFlexControl, { gap: clientToken.paddingXXS, "aria-hidden": true, children: PHI_THEME_GRADIENT_KEYS.map((key) => (_jsx("span", { style: {
|
|
1149
1151
|
width: clientToken.controlHeightSM * 1.5,
|
|
1150
1152
|
height: clientToken.controlHeightSM,
|
|
@@ -1152,76 +1154,76 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1152
1154
|
background: `linear-gradient(${gradients[key].direction}, ${gradients[key].stops
|
|
1153
1155
|
.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`,
|
|
1154
1156
|
} }, key))) })] })),
|
|
1155
|
-
children: (
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1157
|
+
children: (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.padding, children: PHI_THEME_GRADIENT_KEYS.map((key, index) => {
|
|
1158
|
+
const gradient = gradients[key];
|
|
1159
|
+
// The run the author stated, and the text tone they chose -- either may stand alone.
|
|
1160
|
+
const own = readPhiThemeGradient(ownGradients[key]);
|
|
1161
|
+
const ownTone = readPhiThemeGradientTextTone(ownGradients[key]);
|
|
1162
|
+
const text = resolvePhiThemeGradientText(gradient, gradientInks);
|
|
1163
|
+
const contrast = resolvePhiThemeGradientContrast(gradient, text);
|
|
1164
|
+
const tone = gradient.text ?? resolvePhiThemeGradientAutoTextTone(gradient, gradientInks);
|
|
1165
|
+
const otherTone = tone === "light" ? "dark" : "light";
|
|
1166
|
+
// Neither of the Theme's text colours reads: then the run itself is what has to change.
|
|
1167
|
+
const otherContrast = resolvePhiThemeGradientContrast(gradient, gradientInks[otherTone]);
|
|
1168
|
+
const neitherReads = otherContrast != null && otherContrast.ratio < 4.5;
|
|
1169
|
+
/*
|
|
1170
|
+
* An error where the author's choice is what reads poorly: a run they stated, or a text
|
|
1171
|
+
* colour they chose while the other one would read. Otherwise the palette's colours are
|
|
1172
|
+
* what falls short, and it is a hint.
|
|
1173
|
+
*/
|
|
1174
|
+
const contrastLevel = own || (ownTone && !neitherReads) ? "error" : "info";
|
|
1175
|
+
const paint = `linear-gradient(${gradient.direction}, ${gradient.stops
|
|
1176
|
+
.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
|
|
1177
|
+
return (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsx(PhiTypographyControl, { strong: true, children: `Gradient ${index + 1}` }), own || ownTone ? (_jsx(PhiButtonControl, { size: "small", type: "link", style: { paddingInline: 0, height: clientToken.controlHeightSM }, onClick: () => publishDraft(mergeThemeGradient(draftRef.current, key, null, previewMode)), label: "Reset to palette" })) : null] }), _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "wrap", "aria-hidden": true, children: [[false, true].map((hover) => (_jsx("span", { style: {
|
|
1178
|
+
display: "inline-flex",
|
|
1179
|
+
alignItems: "center",
|
|
1180
|
+
height: clientToken.controlHeight,
|
|
1181
|
+
paddingInline: clientToken.padding,
|
|
1182
|
+
borderRadius: 999,
|
|
1183
|
+
background: paint,
|
|
1184
|
+
color: text,
|
|
1185
|
+
fontSize: clientToken.fontSize,
|
|
1186
|
+
fontWeight: 600,
|
|
1187
|
+
whiteSpace: "nowrap",
|
|
1188
|
+
...(hover ? { filter: PHI_GRADIENT_HOVER_FILTER } : {}),
|
|
1189
|
+
}, children: hover ? "Hover" : `Gradient ${index + 1}` }, hover ? "hover" : "rest"))), _jsx("span", { style: {
|
|
1190
|
+
display: "inline-flex",
|
|
1191
|
+
alignItems: "center",
|
|
1192
|
+
paddingInline: clientToken.paddingXS,
|
|
1193
|
+
borderRadius: clientToken.borderRadiusSM,
|
|
1194
|
+
background: paint,
|
|
1195
|
+
color: text,
|
|
1196
|
+
fontSize: clientToken.fontSizeSM,
|
|
1197
|
+
fontWeight: 600,
|
|
1198
|
+
lineHeight: 2,
|
|
1199
|
+
}, children: "Badge" })] }), _jsx(PhiBackgroundControl, { value: normalizePhiBackgroundWidgetConfig({
|
|
1200
|
+
base: { kind: "gradient", direction: gradient.direction, stops: gradient.stops },
|
|
1201
|
+
}), baseKinds: ["gradient"], overlay: false, filters: [], motionModes: [], imageSourceKinds: [], onChange: (value) => {
|
|
1202
|
+
const base = normalizePhiBackgroundWidgetConfig(value).base;
|
|
1203
|
+
if (base.kind !== "gradient")
|
|
1204
|
+
return;
|
|
1205
|
+
publishDraft(mergeThemeGradient(draftRef.current, key, { direction: base.direction, stops: base.stops, ...(ownTone ? { text: ownTone } : {}) }, previewMode));
|
|
1206
|
+
} }, `${key}-${previewMode}`), _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXXS, children: [_jsx(PhiTypographyControl, { type: "secondary", children: "Label colour" }), _jsx(PhiSegmentedControl, { block: true, value: ownTone ?? "auto", options: [
|
|
1207
|
+
{ value: "auto", label: "Automatic" },
|
|
1208
|
+
{ value: "light", label: "Light text" },
|
|
1209
|
+
{ value: "dark", label: "Dark text" },
|
|
1210
|
+
], onChange: (next) => {
|
|
1211
|
+
// Only the words change: a run the author stated stays theirs, a derived one stays derived.
|
|
1212
|
+
const run = own ? { direction: own.direction, stops: own.stops } : null;
|
|
1213
|
+
const slot = next === "auto"
|
|
1214
|
+
? run
|
|
1215
|
+
: run ? { ...run, text: next } : { text: next };
|
|
1216
|
+
publishDraft(mergeThemeGradient(draftRef.current, key, slot, previewMode));
|
|
1217
|
+
} })] }), contrast != null && contrast.ratio < 4.5 ? (_jsx(PhiAlertControl, { showIcon: true, level: contrastLevel,
|
|
1218
|
+
// Small: a note beside a setting in a narrow panel, not a page's message.
|
|
1219
|
+
title: (_jsx("span", { style: { display: "block", fontSize: clientToken.fontSize, fontWeight: 600, lineHeight: 1.4 }, children: `Label contrast ${contrast.ratio.toFixed(1)}:1 at stop ${contrast.stopIndex + 1} (${contrast.color})${contrast.hover ? " under the pointer" : ""}.` })), description: (_jsx("span", { style: { display: "block", fontSize: clientToken.fontSizeSM, lineHeight: 1.45 }, children: [
|
|
1220
|
+
own ? null : "This run is derived from the palette's colours.",
|
|
1221
|
+
"Labels on Buttons, badges and tags need 4.5:1 to read reliably.",
|
|
1222
|
+
neitherReads
|
|
1223
|
+
? "Neither of the Theme's text colours reaches it here: make the run's stops lighter or darker."
|
|
1224
|
+
: `The ${otherTone} text reads better: choose it, or move the stops away from the ${tone} text.`,
|
|
1225
|
+
].filter(Boolean).join(" ") })) })) : null] }, key));
|
|
1226
|
+
}) })),
|
|
1225
1227
|
},
|
|
1226
1228
|
...THEME_COLOR_SEED_SECTIONS.map((section) => {
|
|
1227
1229
|
const seedAuthored = isThemeSeedAuthored(ownPalette, section.key, previewMode);
|
|
@@ -1361,7 +1363,9 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1361
1363
|
{
|
|
1362
1364
|
key: "buttonShadow",
|
|
1363
1365
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Button Shadow" }),
|
|
1364
|
-
|
|
1366
|
+
description: "Under each kind of Button. Theme keeps the tinted line; applies to both modes.",
|
|
1367
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, children: [PHI_THEME_BUTTON_SHADOW_KINDS.map((item) => (_jsx(PhiSegmentedControl, { label: item.label, value: readThemeButtonShadowChoice(state.draft, item.key), options: PHI_THEME_BUTTON_SHADOW_OPTIONS, block: true, onChange: (choice) => publishDraft(mergeThemeButtonShadow(state.draft, item.key, choice)) }, item.key))), _jsx(PhiDividerControl, { style: { marginBlock: 0 } }), _jsx(PhiSelectControl, { label: "Primary fill", description: "Fills every primary Button with one of the Theme's gradients (Color tab). A Button can "
|
|
1368
|
+
+ "still choose its own with the Gradient variant.", value: readPhiThemeGradientKey(state.draft.buttons?.primaryGradient) ?? "none", options: [
|
|
1365
1369
|
{ value: "none", label: "Colour" },
|
|
1366
1370
|
...PHI_THEME_GRADIENT_KEYS.map((key, index) => ({ value: key, label: `Gradient ${index + 1}` })),
|
|
1367
1371
|
], onChange: (choice) => publishDraft(mergeThemePrimaryButtonGradient(state.draft, choice === "none" ? null : choice)) })] })),
|
|
@@ -1369,12 +1373,14 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1369
1373
|
{
|
|
1370
1374
|
key: "surfaceShadow",
|
|
1371
1375
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Surface Shadow" }),
|
|
1372
|
-
|
|
1376
|
+
description: "How deep the Soft and Strong shadow of cards, layouts and pictures are; each mode has its own.",
|
|
1377
|
+
children: (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, children: PHI_SURFACE_SHADOW_STEPS.map((step) => (_jsx(PhiSegmentedControl, { label: PHI_THEME_SURFACE_SHADOW_LABELS[step], value: readPhiSurfaceShadowDepth(state.draft.shadows, step), options: PHI_THEME_SURFACE_SHADOW_OPTIONS, block: true, onChange: (depth) => publishDraft(mergeThemeSurfaceShadowDepth(state.draft, step, depth)) }, step))) })),
|
|
1373
1378
|
},
|
|
1374
1379
|
{
|
|
1375
1380
|
key: "externalLinks",
|
|
1376
1381
|
label: _jsx(PhiTypographyControl, { strong: true, children: "External Links" }),
|
|
1377
|
-
|
|
1382
|
+
description: "An arrow after a link in text that leads to another site",
|
|
1383
|
+
children: (_jsx(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingSM, wrap: "wrap", children: _jsx(PhiSwitchControl, { checked: readPhiThemeExternalLinkMark(state.draft.links), checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeExternalLinkMark(state.draft, checked)) }) })),
|
|
1378
1384
|
},
|
|
1379
1385
|
{
|
|
1380
1386
|
key: "radius",
|
|
@@ -1396,20 +1402,31 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1396
1402
|
},
|
|
1397
1403
|
{
|
|
1398
1404
|
key: "fontFamily",
|
|
1405
|
+
/*
|
|
1406
|
+
* A typeface from the library is served in subsets cut to the characters a page uses, which
|
|
1407
|
+
* changes the file. Some commercial webfont licences forbid exactly that, and the choice of a
|
|
1408
|
+
* font is where an author can still act on it -- so the title says it while the library offers
|
|
1409
|
+
* any.
|
|
1410
|
+
*/
|
|
1399
1411
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Font Family" }),
|
|
1412
|
+
description: siteFontAssets.options.length > 0
|
|
1413
|
+
? "Typefaces from the media library are delivered as subsets, which modifies the font file. "
|
|
1414
|
+
+ "Check that the font's licence permits subsetting before using it."
|
|
1415
|
+
: undefined,
|
|
1400
1416
|
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [fontSlots.map((item) => (_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: item.label }), _jsx(PhiSelectControl, { ariaLabel: `${item.label} font`, value: item.authored ?? undefined, placeholder: item.inherited || "Not installed", options: fontOptions, allowClear: true, size: "medium", style: { minWidth: 0, flex: "1 1 auto" }, onChange: (value) => publishDraft(
|
|
1401
1417
|
// A cleared select reports nothing, which hands the slot back to the Set.
|
|
1402
|
-
mergeThemeFontSlot(state.draft, item.key, value ?? null)) })] }, item.key))),
|
|
1418
|
+
mergeThemeFontSlot(state.draft, item.key, value ?? null)) })] }, item.key))), _jsx(PhiDividerControl, { style: { marginBlock: clientToken.paddingXXS } }), _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: "Headings" }), _jsx(PhiSegmentedControl, { value: readPhiThemeHeadingFont(state.draft.typography), options: PHI_THEME_HEADING_FONT_OPTIONS, size: "small", onChange: (heading) => publishDraft(mergeThemeHeadingFont(state.draft, heading)) })] })] })),
|
|
1403
1419
|
},
|
|
1404
1420
|
{
|
|
1405
1421
|
key: "fontSize",
|
|
1406
1422
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Base Font Size" }),
|
|
1407
|
-
children: (
|
|
1423
|
+
children: (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsxs(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: ["Font size ", _jsx(PhiDescriptionHint, { description: "The seed every other type size is derived from." })] }), _jsxs(PhiTypographyControl, { code: true, children: [baseFontSize, "px"] })] }) })),
|
|
1408
1424
|
},
|
|
1409
1425
|
{
|
|
1410
1426
|
key: "wireframe",
|
|
1411
1427
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Wireframe" }),
|
|
1412
|
-
|
|
1428
|
+
description: "Dividing lines in dialogs and popovers, outlined steps and radios",
|
|
1429
|
+
children: (_jsx(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingSM, wrap: "wrap", children: _jsx(PhiSwitchControl, { checked: wireframe, checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => updateToken({ wireframe: checked }) }) })),
|
|
1413
1430
|
},
|
|
1414
1431
|
{
|
|
1415
1432
|
/*
|
|
@@ -1419,7 +1436,8 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1419
1436
|
*/
|
|
1420
1437
|
key: "pageWidth",
|
|
1421
1438
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Page Width" }),
|
|
1422
|
-
children: (
|
|
1439
|
+
children: (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsxs(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: ["Maximum ", _jsx(PhiDescriptionHint, { description: `How wide a Page gets on a wide screen. At least ${PHI_CONTAINER_BREAKPOINT_REGION}px, `
|
|
1440
|
+
+ "the width from which a Region counts as wide." })] }), _jsx(PhiNumberControl, { prefix: "px", value: pageMax, step: 1, min: PHI_CONTAINER_BREAKPOINT_REGION, onChange: (next) => updateToken({ pageMax: next == null ? undefined : next }) })] }) })),
|
|
1423
1441
|
},
|
|
1424
1442
|
{
|
|
1425
1443
|
/*
|
|
@@ -1430,13 +1448,15 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1430
1448
|
*/
|
|
1431
1449
|
key: "pagePadding",
|
|
1432
1450
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Page Padding" }),
|
|
1451
|
+
description: "The default of a Page that does not set its own, in Public or in App and the staff Areas: "
|
|
1452
|
+
+ "a phone below 768px, a tablet below 1200px.",
|
|
1433
1453
|
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsx(PhiSegmentedControl, { value: pagePaddingScope, options: [
|
|
1434
1454
|
{ value: "pagePadding", label: "Public" },
|
|
1435
1455
|
{ value: "signedInPagePadding", label: "Signed in" },
|
|
1436
1456
|
], onChange: setPagePaddingScope }), _jsx(PhiSegmentedControl, { value: pagePaddingBand, options: PHI_THEME_PAGE_PADDING_BANDS.map((band) => ({ value: band, label: band })), onChange: setPagePaddingBand }), _jsx(PhiPaddingControl, { value: pagePadding, showGap: false, onChange: (next) => updateToken(Object.fromEntries(PHI_THEME_PAGE_PADDING_SIDES.map((side) => {
|
|
1437
1457
|
const value = next?.[`padding${side}`] ?? next?.padding;
|
|
1438
1458
|
return [`${pagePaddingScope}${side}${pagePaddingBand}`, value == null ? undefined : value];
|
|
1439
|
-
}))) })
|
|
1459
|
+
}))) })] })),
|
|
1440
1460
|
},
|
|
1441
1461
|
{
|
|
1442
1462
|
/*
|
|
@@ -1446,9 +1466,9 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1446
1466
|
*/
|
|
1447
1467
|
key: "layoutGap",
|
|
1448
1468
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Layout Gap" }),
|
|
1449
|
-
children: (
|
|
1450
|
-
|
|
1451
|
-
|
|
1469
|
+
children: (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "nowrap", children: [_jsxs(PhiTypographyControl, { style: { flex: `0 0 ${fieldLabelWidth}px` }, children: ["Gap ", _jsx(PhiDescriptionHint, { description: "Between the rows and columns of a Layout that does not set its own gap." })] }), _jsx(PhiSelectControl, { ariaLabel: "Layout gap", size: "medium", value: layoutGap, options: PHI_SPACING_SCALE_KEYS.map((key) => ({ value: key, label: PHI_SPACING_SCALE_DEFAULT_LABELS[key] })), style: { minWidth: 0, flex: "1 1 auto" }, onChange: (key) => updateToken({
|
|
1470
|
+
layoutGap: key === PHI_LAYOUT.layoutGap ? undefined : resolvePhiSpacingScaleValue(key),
|
|
1471
|
+
}) })] }) })),
|
|
1452
1472
|
},
|
|
1453
1473
|
] }) })] }));
|
|
1454
1474
|
}
|
|
@@ -1748,12 +1768,13 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1748
1768
|
{
|
|
1749
1769
|
key: "wordmark",
|
|
1750
1770
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Wordmark" }),
|
|
1771
|
+
description: showsWordmark
|
|
1772
|
+
? _jsxs(_Fragment, { children: ["The Site name as it is set. One part per colour: a two-tone name is one word written in two. With no part at all the frame shows ", fallbackWordmark, "."] })
|
|
1773
|
+
: _jsx(_Fragment, { children: "The Brand is the Logo alone. The name is not drawn, and neither is the Eyebrow above it." }),
|
|
1751
1774
|
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, style: {
|
|
1752
1775
|
"--phi-labeled-control-label-width": "33.333333%",
|
|
1753
1776
|
"--phi-labeled-control-width": "100%",
|
|
1754
|
-
}, children: [_jsx(
|
|
1755
|
-
? _jsxs(_Fragment, { children: ["The Site name as it is set. One part per colour: a two-tone name is one word written in two. With no part at all the frame shows ", fallbackWordmark, "."] })
|
|
1756
|
-
: _jsx(_Fragment, { children: "The Brand is the Logo alone. The name is not drawn, and neither is the Eyebrow above it." }) }), _jsx(PhiSwitchControl, { label: "Show name", checked: showsWordmark, checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeWordmarkShows(state.draft, checked)) }), showsWordmark && (_jsxs(_Fragment, { children: [editableWordmarkParts.map((part, index) => (_jsx(PhiLabeledControl, { label: `Part #${index + 1}`, fill: true, children: _jsxs(PhiFlexControl, { gap: clientToken.paddingXXS, align: "center", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTextControl, { value: part.text, placeholder: index === 0 ? fallbackWordmark : "Part", ariaLabel: `Wordmark part ${index + 1}`, allowClear: false, onChange: (next) => updateWordmarkPart(index, { text: next ?? "" }) }), _jsx(PhiColorControl, { mode: "single", allowClear: true,
|
|
1777
|
+
}, children: [_jsx(PhiSwitchControl, { label: "Show name", checked: showsWordmark, checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeWordmarkShows(state.draft, checked)) }), showsWordmark && (_jsxs(_Fragment, { children: [editableWordmarkParts.map((part, index) => (_jsx(PhiLabeledControl, { label: `Part #${index + 1}`, fill: true, children: _jsxs(PhiFlexControl, { gap: clientToken.paddingXXS, align: "center", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTextControl, { value: part.text, placeholder: index === 0 ? fallbackWordmark : "Part", ariaLabel: `Wordmark part ${index + 1}`, allowClear: false, onChange: (next) => updateWordmarkPart(index, { text: next ?? "" }) }), _jsx(PhiColorControl, { mode: "single", allowClear: true,
|
|
1757
1778
|
// A part's row is narrow: the swatch says the colour, the value would overflow it.
|
|
1758
1779
|
showText: false,
|
|
1759
1780
|
// The colour of the mode being authored; the other mode keeps its own.
|
|
@@ -1797,10 +1818,12 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1797
1818
|
*/
|
|
1798
1819
|
key: "share",
|
|
1799
1820
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Link preview" }),
|
|
1821
|
+
description: "The picture a shared link shows where its Page states none, cut to 1200 x 630 "
|
|
1822
|
+
+ "around its focus. Only a publicly delivered picture can be chosen.",
|
|
1800
1823
|
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, style: {
|
|
1801
1824
|
"--phi-labeled-control-label-width": "33.333333%",
|
|
1802
1825
|
"--phi-labeled-control-width": "100%",
|
|
1803
|
-
}, children: [
|
|
1826
|
+
}, children: [shareImagePresentation?.url ? (_jsx(PhiCardControl, { size: "small", padding: clientToken.paddingXS, cover: (_jsx(PhiImageControl, { presentation: shareImagePresentation, source: "asset", alt: brand.shareImage?.alt || shareAsset?.altText || "Link preview picture", width: 1200, height: 630, blurDataUrl: shareAsset?.blurDataUrl ?? null, sizes: "400px" })), children: _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXXS, style: { minWidth: 0 }, children: [runtime.site.hostname ? (_jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: clientToken.fontSizeSM }, children: runtime.site.hostname })) : null, _jsx(PhiTypographyControl, { strong: true, children: runtime.site.name || "Page title" }), _jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: clientToken.fontSizeSM }, children: resolvePhiSiteDescription(brand.slogan?.label) })] }) })) : null, _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingXS, style: { minWidth: 0 }, children: [_jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: _jsx(PhiMediaPickerBinding, { config: {
|
|
1804
1827
|
mediaType: PhiMediaKind.Image,
|
|
1805
1828
|
pageSize: 12,
|
|
1806
1829
|
showPagination: true,
|
|
@@ -1808,7 +1831,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1808
1831
|
showSearchBar: true,
|
|
1809
1832
|
}, labels: mediaPickerLabels, searchLabels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, siteSpaceOnly: true, isAssetSelectable: (asset) => isPhiMediaAssetPublic(asset.deliveryPolicy, asset.lifecycleStatus), value: brand.shareImage?.assetId ?? null, onAssetSelect: (asset) => publishDraft(mergeThemeBrand(state.draft, {
|
|
1810
1833
|
shareImage: { assetId: asset.id, ...(brand.shareImage?.alt ? { alt: brand.shareImage.alt } : {}) },
|
|
1811
|
-
})), onAssetClear: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })) }) }), brand.shareImage ? (_jsx(PhiButtonControl, { size: "small", type: "
|
|
1834
|
+
})), onAssetClear: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })) }) }), brand.shareImage ? (_jsx(PhiButtonControl, { size: "small", type: "text", danger: true, style: { flexShrink: 0 }, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Remove", onClick: () => publishDraft(mergeThemeBrand(state.draft, { shareImage: null })) })) : null] }), _jsx(PhiLabeledControl, { label: "Alt", fill: true, children: _jsx(PhiTextControl, { value: brand.shareImage?.alt ?? "", placeholder: shareAsset?.altText || "Alt text", ariaLabel: "Link preview alt text", allowClear: false, disabled: !brand.shareImage, onChange: (next) => brand.shareImage && publishDraft(mergeThemeBrand(state.draft, {
|
|
1812
1835
|
shareImage: next?.trim()
|
|
1813
1836
|
? { assetId: brand.shareImage.assetId, alt: next }
|
|
1814
1837
|
: { assetId: brand.shareImage.assetId },
|
|
@@ -10,7 +10,6 @@ import { usePhiRuntimeConditionStateResponder } from "../../../../components/run
|
|
|
10
10
|
import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
|
|
11
11
|
import { dispatchPhiSignalCapability } from "../../../../components/runtime/runtime-signal-identity";
|
|
12
12
|
import { PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION, } from "./definition";
|
|
13
|
-
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
14
13
|
import { readPhiPositiveInteger } from "../../../../components/widgets/client/shared/phi-table-provider-request";
|
|
15
14
|
import { readPhiCustomerFileThreadId } from "../services/customer-file-read";
|
|
16
15
|
import { PHI_CUSTOMER_FILE_MEMBER_PARAM } from "../../../../constants/customer-file";
|
|
@@ -35,11 +34,6 @@ function readSelectedThreadId(value) {
|
|
|
35
34
|
* what came back. Reading `{ thread: { thread: { id } } }` out of it is a statement about the Core
|
|
36
35
|
* route's answer, which is exactly the kind of knowledge that belongs in the Module and nowhere else.
|
|
37
36
|
*/
|
|
38
|
-
/** The member a customer file Page's person Table chose, from its query (`filters.userId`). */
|
|
39
|
-
function readChosenMemberId(value) {
|
|
40
|
-
const filters = isPhiRecord(value) && isPhiRecord(value.filters) ? value.filters : null;
|
|
41
|
-
return filters ? readPhiPositiveInteger(filters.userId) : null;
|
|
42
|
-
}
|
|
43
37
|
function readCreatedThreadId(value) {
|
|
44
38
|
const payload = value?.payload;
|
|
45
39
|
const threadId = payload?.thread?.thread?.id;
|
|
@@ -105,10 +99,11 @@ function PhiThreadsControllerView({ address, config, }) {
|
|
|
105
99
|
emitCapability("conditionStateChange", { state: { ready: true, threadOpen: threadId != null } }, correlationId);
|
|
106
100
|
}, [emitCapability]);
|
|
107
101
|
/*
|
|
108
|
-
* Another member chosen:
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
102
|
+
* Another member chosen: the Tables that read something of theirs are told as filters, whatever shows
|
|
103
|
+
* something of theirs by binding params -- the addresses tiles -- as binding params, and their file is
|
|
104
|
+
* read from the request the Tables make for the same choice (it joins that one, so a choice stays one
|
|
105
|
+
* entry in the access log) and handed to the file panel. Nobody chosen, the reader's own file and a
|
|
106
|
+
* failed read all close the panel; the Tables say why.
|
|
112
107
|
*/
|
|
113
108
|
const openMemberFile = useCallback((userId, correlationId) => {
|
|
114
109
|
if (memberRead.current.userId === userId)
|
|
@@ -117,7 +112,9 @@ function PhiThreadsControllerView({ address, config, }) {
|
|
|
117
112
|
const controller = userId == null ? null : new AbortController();
|
|
118
113
|
memberRead.current = { userId, controller };
|
|
119
114
|
setFileThreadId(null);
|
|
120
|
-
// The addresses ask in their next render, while the read below is under way, and join it.
|
|
115
|
+
// The Tables and the addresses ask in their next render, while the read below is under way, and join it.
|
|
116
|
+
// The customer file Provider reads the member from the `userId` filter (`query.filters.userId`).
|
|
117
|
+
emitCapability("memberFiltersChange", { userId }, correlationId);
|
|
121
118
|
emitCapability("memberParamsChange", { params: { [PHI_CUSTOMER_FILE_MEMBER_PARAM]: userId } }, correlationId);
|
|
122
119
|
emitCapability("fileThreadChange", { threadId: null }, correlationId);
|
|
123
120
|
if (userId == null || !controller)
|
|
@@ -228,7 +225,8 @@ function PhiThreadsControllerView({ address, config, }) {
|
|
|
228
225
|
return;
|
|
229
226
|
}
|
|
230
227
|
if (signal.channel === "member" && signal.action === "change") {
|
|
231
|
-
|
|
228
|
+
// The member select's value: the user id as text, `""` for nobody.
|
|
229
|
+
openMemberFile(readPhiPositiveInteger(signal.value), signal.correlationId);
|
|
232
230
|
return;
|
|
233
231
|
}
|
|
234
232
|
if (signal.channel === "opened" && signal.action === "change") {
|
|
@@ -68,6 +68,12 @@ export declare const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION: {
|
|
|
68
68
|
action: "change";
|
|
69
69
|
valueType: "json";
|
|
70
70
|
valueSchema: `${string}/signals/${string}`;
|
|
71
|
+
} | {
|
|
72
|
+
id: string;
|
|
73
|
+
channel: string;
|
|
74
|
+
action: "change";
|
|
75
|
+
valueType: "string";
|
|
76
|
+
valueSchema?: undefined;
|
|
71
77
|
} | {
|
|
72
78
|
id: string;
|
|
73
79
|
channel: string;
|
|
@@ -83,6 +83,18 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
|
|
|
83
83
|
valueType: "json",
|
|
84
84
|
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableBindingParams,
|
|
85
85
|
},
|
|
86
|
+
/*
|
|
87
|
+
* The same member as a Table's filters (`{ userId }`, `null` for nobody), for the Tables that read
|
|
88
|
+
* something of theirs -- the person and the conversations: a select answers a user id as text, and a
|
|
89
|
+
* Table takes filters, so the choice is translated here, as the Groups Controller hands a chosen group
|
|
90
|
+
* to the membership Table.
|
|
91
|
+
*/
|
|
92
|
+
{
|
|
93
|
+
id: "memberFiltersChange",
|
|
94
|
+
action: "change",
|
|
95
|
+
valueType: "json",
|
|
96
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableFilters,
|
|
97
|
+
},
|
|
86
98
|
{ id: "dialogOpen", action: "activate", valueType: "none" },
|
|
87
99
|
{ id: "dialogClose", action: "close", valueType: "none" },
|
|
88
100
|
{ id: "formSubmit", action: "activate", valueType: "none" },
|
|
@@ -115,17 +127,16 @@ export const PHI_THREADS_RUNTIME_CONTROLLER_DEFINITION = {
|
|
|
115
127
|
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableSelection,
|
|
116
128
|
},
|
|
117
129
|
/*
|
|
118
|
-
* The member a customer file Page chose: its
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* `
|
|
130
|
+
* The member a customer file Page chose: its member select's value, the user id as text (`""` for
|
|
131
|
+
* nobody). It goes out to the Tables as `memberFiltersChange` and to the addresses as
|
|
132
|
+
* `memberParamsChange`; the file's id comes from the same read the Tables make for that choice, joined
|
|
133
|
+
* rather than asked again (`readPhiCustomerFileThreadId`), and goes out as `fileThreadChange`.
|
|
122
134
|
*/
|
|
123
135
|
{
|
|
124
136
|
id: "memberChange",
|
|
125
137
|
channel: "member",
|
|
126
138
|
action: "change",
|
|
127
|
-
valueType: "
|
|
128
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableQuery,
|
|
139
|
+
valueType: "string",
|
|
129
140
|
},
|
|
130
141
|
/*
|
|
131
142
|
* A Table's action, and a conversation's Reply, which a conversation says as a row action with the
|