@phis/ui 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cms/phi-cms-layout-renderer.js +11 -2
- package/components/controls/phi-image-control.js +9 -1
- package/components/controls/phi-multi-select-control.js +4 -2
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-select-control.d.ts +21 -0
- package/components/controls/phi-select-control.js +2 -2
- package/components/controls/phi-status-dot-control.d.ts +15 -0
- package/components/controls/phi-status-dot-control.js +25 -0
- package/components/controls/phi-table-control.js +8 -1
- package/components/controls/phi-tree-control.js +5 -4
- package/components/controls/phi-tree-select-control.js +1 -0
- package/components/forms/auth-admin-settings-labels.d.ts +4 -0
- package/components/forms/auth-admin-settings-labels.js +11 -3
- package/components/forms/form-provider-contract.d.ts +1 -1
- package/components/forms/form-provider-contract.js +1 -1
- package/components/layouts/clients/phi-split-card-half.d.ts +4 -1
- package/components/layouts/clients/phi-split-card-half.js +2 -2
- package/components/layouts/clients/phi-split-card-layout-client.d.ts +6 -3
- package/components/layouts/clients/phi-split-card-layout-client.js +5 -3
- package/components/layouts/clients/phi-three-column-layout-client.d.ts +20 -1
- package/components/layouts/clients/phi-three-column-layout-client.js +31 -15
- package/components/layouts/layout-definitions.d.ts +96 -0
- package/components/layouts/layout-definitions.js +40 -2
- package/components/layouts/plugins/split-card-layout-plugin.js +1 -1
- package/components/layouts/plugins/three-column-layout-plugin.js +1 -1
- package/components/layouts/split-card-geometry.d.ts +9 -4
- package/components/layouts/split-card-geometry.js +29 -13
- package/components/media/media-folder-options.d.ts +10 -0
- package/components/media/media-folder-options.js +14 -0
- package/components/navigation/phi-link.d.ts +7 -1
- package/components/navigation/phi-link.js +6 -2
- package/components/root/phi-root-theme-resolver.js +2 -0
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/widgets/client/shared/phi-rendered-value.js +1 -1
- package/components/widgets/inspector-field-row.js +4 -1
- package/components/widgets/label-sets/account.js +6 -2
- package/components/widgets/label-sets/admin-users.d.ts +3 -0
- package/components/widgets/label-sets/admin-users.js +8 -2
- package/components/widgets/label-sets/effects.js +5 -1
- package/components/widgets/label-sets/gallery.js +2 -2
- package/components/widgets/label-sets/inspector.js +4 -0
- package/components/widgets/label-sets/observability-logs.js +2 -2
- package/components/widgets/label-sets/profile.js +2 -1
- package/components/widgets/label-types/gallery.d.ts +2 -3
- package/components/widgets/label-types/gallery.js +1 -4
- package/components/widgets/label-types/inspector.d.ts +4 -0
- package/components/widgets/label-types/inspector.js +2 -0
- package/components/widgets/shared/markdown-body-client.js +1 -1
- package/components/widgets/shared/markdown-image-vocabulary.js +1 -1
- package/constants/cms-layout-proportions.d.ts +6 -0
- package/constants/cms-layout-proportions.js +17 -0
- package/constants/runtime-module-ownership.js +1 -0
- package/helpers/page-reference-tree.js +8 -0
- package/helpers/table-action-links.d.ts +11 -0
- package/helpers/table-action-links.js +14 -0
- package/helpers/table-action-row-link.d.ts +8 -0
- package/helpers/table-action-row-link.js +14 -0
- package/package.json +2 -2
- package/plugins/factories/widget-renderers.d.ts +7 -1
- package/plugins/factories/widget-renderers.js +12 -2
- package/plugins/runtime-modules/asset/authoring-widgets.js +2 -2
- package/plugins/runtime-modules/asset/data-providers.js +1 -1
- package/plugins/runtime-modules/asset/services/options.js +7 -11
- package/plugins/runtime-modules/asset/widgets/area-upload/plugin.js +0 -2
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/plugin.js +0 -2
- package/plugins/runtime-modules/asset/widgets/image-inspector/plugin.js +0 -2
- package/plugins/runtime-modules/asset/widgets/media-picker/plugin.js +0 -2
- package/plugins/runtime-modules/asset/widgets.js +4 -4
- package/plugins/runtime-modules/auth/admin-settings-forms.js +47 -1
- package/plugins/runtime-modules/auth/authoring-widgets.js +4 -8
- package/plugins/runtime-modules/auth/data-providers.js +2 -0
- package/plugins/runtime-modules/auth/widgets/auth-workflow/plugin.js +0 -6
- package/plugins/runtime-modules/auth/widgets/logout/plugin.js +0 -2
- package/plugins/runtime-modules/auth/widgets/security/plugin.js +0 -2
- package/plugins/runtime-modules/auth/widgets.js +5 -3
- package/plugins/runtime-modules/avatar/authoring-widgets.js +2 -2
- package/plugins/runtime-modules/avatar/widgets/account-avatar/plugin.js +0 -2
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/plugin.js +0 -2
- package/plugins/runtime-modules/avatar/widgets.js +2 -2
- package/plugins/runtime-modules/builder/authoring-widgets.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-choice-cascader.d.ts +28 -0
- package/plugins/runtime-modules/builder/clients/inspector-choice-cascader.js +98 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +27 -3
- package/plugins/runtime-modules/builder/clients/inspector-record-field-options.d.ts +17 -0
- package/plugins/runtime-modules/builder/clients/inspector-record-field-options.js +21 -0
- package/plugins/runtime-modules/builder/clients/inspector-translate-switch.d.ts +24 -0
- package/plugins/runtime-modules/builder/clients/inspector-translate-switch.js +29 -0
- package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +4 -2
- package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +6 -6
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +17 -0
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +12 -2
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +0 -2
- package/plugins/runtime-modules/builder/widgets.js +3 -3
- package/plugins/runtime-modules/contracts.js +8 -4
- package/plugins/runtime-modules/core/authoring-widgets.js +2 -2
- package/plugins/runtime-modules/core/data-providers.d.ts +7 -3
- package/plugins/runtime-modules/core/data-providers.js +11 -1
- package/plugins/runtime-modules/core/definition.d.ts +8 -4
- package/plugins/runtime-modules/core/form-providers.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/breadcrumb/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/cascader/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/draft-status/client.d.ts +2 -1
- package/plugins/runtime-modules/core/widgets/draft-status/client.js +4 -3
- package/plugins/runtime-modules/core/widgets/gallery/authoring.js +6 -8
- package/plugins/runtime-modules/core/widgets/gallery/client.js +4 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -4
- package/plugins/runtime-modules/core/widgets/image/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.js +24 -22
- package/plugins/runtime-modules/core/widgets/record/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.d.ts +9 -5
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +5 -7
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +63 -4
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +45 -11
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +23 -4
- package/plugins/runtime-modules/core/widgets/simple-text/server.d.ts +4 -2
- package/plugins/runtime-modules/core/widgets/simple-text/server.js +7 -6
- package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
- package/plugins/runtime-modules/core/widgets/table/config.js +12 -4
- package/plugins/runtime-modules/core/widgets/table/plugin.js +21 -1
- package/plugins/runtime-modules/core/widgets/thread-conversation/plugin.js +0 -2
- package/plugins/runtime-modules/core/widgets/tree/config.js +2 -1
- package/plugins/runtime-modules/core/widgets/tree/plugin.js +16 -1
- package/plugins/runtime-modules/core/widgets.js +1 -1
- package/plugins/runtime-modules/observability/data-providers.js +1 -1
- package/plugins/runtime-modules/theme/authoring-widgets.js +5 -5
- package/plugins/runtime-modules/theme/brand-theme-model.d.ts +4 -1
- package/plugins/runtime-modules/theme/brand-theme-model.js +6 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +0 -5
- package/plugins/runtime-modules/theme/widgets.js +4 -4
- package/plugins/runtime-modules/threads/labels.js +6 -2
- package/plugins/runtime-modules/user-management/addon-roles.d.ts +28 -7
- package/plugins/runtime-modules/user-management/addon-roles.js +42 -17
- package/plugins/runtime-modules/user-management/client-data-providers.js +6 -0
- package/plugins/runtime-modules/user-management/data-providers.js +11 -2
- package/plugins/runtime-modules/user-management/forms.js +40 -1
- package/plugins/runtime-modules/user-management/ids.d.ts +1 -0
- package/plugins/runtime-modules/user-management/ids.js +1 -0
- package/plugins/runtime-modules/user-management/services/options.d.ts +14 -3
- package/plugins/runtime-modules/user-management/services/options.js +52 -16
- package/plugins/runtime-modules/user-management/services/table.js +8 -24
- package/plugins/runtime-modules/user-management/services/users-query.d.ts +9 -0
- package/plugins/runtime-modules/user-management/services/users-query.js +29 -0
- package/plugins/runtime-modules/video/widgets/embed/plugin.js +0 -2
- package/plugins/runtime-modules/video/widgets.js +1 -1
- package/styles/controls.css +20 -0
- package/styles/layout.css +4 -4
- package/theme/phi-link-mark.d.ts +26 -0
- package/theme/phi-link-mark.js +26 -0
- package/theme/phi-theme-tokens.d.ts +3 -2
- package/theme/phi-theme-tokens.js +3 -1
- package/types/cms-config.d.ts +12 -4
- package/types/cms-config.js +3 -0
- package/types/cms-plugins.d.ts +26 -4
- package/types/core-widget-placements.d.ts +4 -4
- package/types/site-config.d.ts +3 -0
- package/types/table-widget.d.ts +17 -1
- package/types/tree.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/authoring.d.ts +0 -2
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/authoring.js +0 -6
- package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.d.ts +0 -2
- package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.js +0 -6
- package/plugins/runtime-modules/auth/widgets/auth-methods/authoring.d.ts +0 -7
- package/plugins/runtime-modules/auth/widgets/auth-methods/authoring.js +0 -12
- package/plugins/runtime-modules/auth/widgets/auth-workflow/authoring.d.ts +0 -7
- package/plugins/runtime-modules/auth/widgets/auth-workflow/authoring.js +0 -12
- package/plugins/runtime-modules/auth/widgets/logout/authoring.d.ts +0 -3
- package/plugins/runtime-modules/auth/widgets/logout/authoring.js +0 -8
- package/plugins/runtime-modules/auth/widgets/security/authoring.d.ts +0 -3
- package/plugins/runtime-modules/auth/widgets/security/authoring.js +0 -8
- package/plugins/runtime-modules/avatar/widgets/account-avatar/authoring.d.ts +0 -2
- package/plugins/runtime-modules/avatar/widgets/account-avatar/authoring.js +0 -6
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/authoring.d.ts +0 -2
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/authoring.js +0 -6
- package/plugins/runtime-modules/builder/widgets/structure-region/internal-builder.d.ts +0 -22
- package/plugins/runtime-modules/builder/widgets/structure-region/internal-builder.js +0 -8
- package/plugins/runtime-modules/core/widgets/form-preview/authoring.d.ts +0 -10
- package/plugins/runtime-modules/core/widgets/form-preview/authoring.js +0 -15
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +0 -3
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +0 -9
- package/plugins/runtime-modules/theme/widgets/brand-controls/authoring.d.ts +0 -76
- package/plugins/runtime-modules/theme/widgets/brand-controls/authoring.js +0 -30
|
@@ -262,6 +262,8 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
262
262
|
type: "choice",
|
|
263
263
|
heading: "Folder",
|
|
264
264
|
label: "Folder",
|
|
265
|
+
description: "The media folder whose public pictures are shown.",
|
|
266
|
+
presentation: "cascader",
|
|
265
267
|
optionsProvider: { providerKey: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderChoices },
|
|
266
268
|
},
|
|
267
269
|
{ key: "topLevelOnly", type: "boolean", label: "This folder only", description: "Leave the pictures in its subfolders out." },
|
|
@@ -269,12 +271,20 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
269
271
|
key: "sort",
|
|
270
272
|
type: "choice",
|
|
271
273
|
label: "Order",
|
|
274
|
+
description: "The order the pictures follow.",
|
|
272
275
|
options: [
|
|
273
276
|
{ value: "name_asc", label: "By file name" },
|
|
274
277
|
{ value: "created_at_desc", label: "Newest first" },
|
|
275
278
|
],
|
|
276
279
|
},
|
|
277
|
-
{
|
|
280
|
+
{
|
|
281
|
+
key: "limit",
|
|
282
|
+
type: "number",
|
|
283
|
+
label: "At most",
|
|
284
|
+
description: `How many pictures are shown at most. ${PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT} when left empty, ${PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT} at the very most.`,
|
|
285
|
+
min: 1,
|
|
286
|
+
max: PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT,
|
|
287
|
+
},
|
|
278
288
|
],
|
|
279
289
|
},
|
|
280
290
|
];
|
|
@@ -348,10 +348,11 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
348
348
|
type: "choice";
|
|
349
349
|
heading: string;
|
|
350
350
|
label: string;
|
|
351
|
+
description: string;
|
|
352
|
+
presentation: "cascader";
|
|
351
353
|
optionsProvider: {
|
|
352
354
|
providerKey: `${string}/${string}`;
|
|
353
355
|
};
|
|
354
|
-
description?: undefined;
|
|
355
356
|
options?: undefined;
|
|
356
357
|
min?: undefined;
|
|
357
358
|
max?: undefined;
|
|
@@ -361,6 +362,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
361
362
|
label: string;
|
|
362
363
|
description: string;
|
|
363
364
|
heading?: undefined;
|
|
365
|
+
presentation?: undefined;
|
|
364
366
|
optionsProvider?: undefined;
|
|
365
367
|
options?: undefined;
|
|
366
368
|
min?: undefined;
|
|
@@ -369,24 +371,26 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
369
371
|
key: string;
|
|
370
372
|
type: "choice";
|
|
371
373
|
label: string;
|
|
374
|
+
description: string;
|
|
372
375
|
options: {
|
|
373
376
|
value: string;
|
|
374
377
|
label: string;
|
|
375
378
|
}[];
|
|
376
379
|
heading?: undefined;
|
|
380
|
+
presentation?: undefined;
|
|
377
381
|
optionsProvider?: undefined;
|
|
378
|
-
description?: undefined;
|
|
379
382
|
min?: undefined;
|
|
380
383
|
max?: undefined;
|
|
381
384
|
} | {
|
|
382
385
|
key: string;
|
|
383
386
|
type: "number";
|
|
384
387
|
label: string;
|
|
388
|
+
description: string;
|
|
385
389
|
min: number;
|
|
386
390
|
max: number;
|
|
387
391
|
heading?: undefined;
|
|
392
|
+
presentation?: undefined;
|
|
388
393
|
optionsProvider?: undefined;
|
|
389
|
-
description?: undefined;
|
|
390
394
|
options?: undefined;
|
|
391
395
|
})[];
|
|
392
396
|
resources?: undefined;
|
|
@@ -615,7 +619,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
615
619
|
}, {
|
|
616
620
|
readonly key: "separator";
|
|
617
621
|
readonly type: "string";
|
|
618
|
-
readonly label: "Separator";
|
|
622
|
+
readonly label: "Separator character";
|
|
619
623
|
}, {
|
|
620
624
|
readonly key: "rootValue";
|
|
621
625
|
readonly type: "string";
|
|
@@ -223,7 +223,7 @@ export declare const PHI_CORE_FORM_PROVIDER_DESCRIPTORS: {
|
|
|
223
223
|
}, {
|
|
224
224
|
readonly key: "separator";
|
|
225
225
|
readonly type: "string";
|
|
226
|
-
readonly label: "Separator";
|
|
226
|
+
readonly label: "Separator character";
|
|
227
227
|
}, {
|
|
228
228
|
readonly key: "rootValue";
|
|
229
229
|
readonly type: "string";
|
|
@@ -18,7 +18,7 @@ export const PHI_BREADCRUMB_WIDGET_DEFINITION = {
|
|
|
18
18
|
{ key: "showArea", type: "boolean", label: "Show Area" },
|
|
19
19
|
{ key: "showPath", type: "boolean", label: "Show Path" },
|
|
20
20
|
{ key: "pathLabel", type: "string", label: "Path Label" },
|
|
21
|
-
{ key: "separator", type: "string", label: "Separator" },
|
|
21
|
+
{ key: "separator", type: "string", label: "Separator character" },
|
|
22
22
|
],
|
|
23
23
|
parseConfig: parsePhiCmsBreadcrumbWidgetConfig,
|
|
24
24
|
};
|
|
@@ -27,5 +27,5 @@ export declare const PHI_CASCADER_WIDGET_BUILDER_PLUGIN: {
|
|
|
27
27
|
fields: import("../../../../../types").PhiCmsConfigField[];
|
|
28
28
|
parseConfig: (raw: Record<string, unknown>) => PhiCascaderWidgetConfig;
|
|
29
29
|
editorInteraction?: import("../../../../../types").PhiCmsBuilderWidgetEditorInteraction;
|
|
30
|
-
renderEditor
|
|
30
|
+
renderEditor?: ((args_0: import("../../../../../types").PhiCmsBuilderWidgetRenderArgs<PhiCascaderWidgetConfig>) => import("react").ReactNode) | undefined;
|
|
31
31
|
};
|
|
@@ -42,7 +42,7 @@ export const PHI_CASCADER_WIDGET_DEFINITION = {
|
|
|
42
42
|
{ key: "placeholder", type: "string", label: "Placeholder" },
|
|
43
43
|
...buildPhiChoiceControlOptionFields("toolbar"),
|
|
44
44
|
{ key: "allowRoot", type: "boolean", label: "Allow Root" },
|
|
45
|
-
{ key: "separator", type: "string", label: "Separator" },
|
|
45
|
+
{ key: "separator", type: "string", label: "Separator character" },
|
|
46
46
|
{ key: "rootValue", type: "string", label: "Root Value" },
|
|
47
47
|
{
|
|
48
48
|
key: "normalize",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type PhiDraftStatusWidgetLabels } from "../../../../../components/widgets/label-types/draft-status";
|
|
2
2
|
import type { PhiDraftStatusWidgetConfig } from "./config";
|
|
3
3
|
/**
|
|
4
|
-
* The draft state a Controller states, drawn as a
|
|
4
|
+
* The draft state a Controller states, drawn as a dot in the Theme's status colours; its word is the
|
|
5
|
+
* tooltip over the row, path and dot alike.
|
|
5
6
|
*
|
|
6
7
|
* Nothing is read here and nothing is worked out. The Controller the placement names is asked once,
|
|
7
8
|
* when this mounts, and answers to this address; every change after reaches it as a broadcast from
|
|
@@ -6,7 +6,7 @@ import { readPhiDraftStatusSignalValue } from "../../../../../types/draft-status
|
|
|
6
6
|
import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
|
|
7
7
|
import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../../components/runtime/runtime-signal-bus";
|
|
8
8
|
import { usePhiSignalIdentity } from "../../../../../components/runtime/runtime-signal-identity";
|
|
9
|
-
import {
|
|
9
|
+
import { PhiStatusDotControl } from "../../../../../components/controls/phi-status-dot-control";
|
|
10
10
|
import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
|
|
11
11
|
import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
|
|
12
12
|
import { PHI_DRAFT_STATUS_WIDGET_DEFAULT_LABELS, formatPhiDraftStatusRevisionLabel, } from "../../../../../components/widgets/label-types/draft-status";
|
|
@@ -28,7 +28,8 @@ function buildStatusLabel(state, labels) {
|
|
|
28
28
|
return labels.unavailable;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* The draft state a Controller states, drawn as a
|
|
31
|
+
* The draft state a Controller states, drawn as a dot in the Theme's status colours; its word is the
|
|
32
|
+
* tooltip over the row, path and dot alike.
|
|
32
33
|
*
|
|
33
34
|
* Nothing is read here and nothing is worked out. The Controller the placement names is asked once,
|
|
34
35
|
* when this mounts, and answers to this address; every change after reaches it as a broadcast from
|
|
@@ -114,5 +115,5 @@ export function PhiDraftStatusWidget({ config, labels = PHI_DRAFT_STATUS_WIDGET_
|
|
|
114
115
|
? token.colorSuccess
|
|
115
116
|
: token.colorError;
|
|
116
117
|
const error = state?.status === "error" ? state.error ?? labels.readFailed : null;
|
|
117
|
-
return (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: 12, wrap: "wrap", style: { width: "100%" }, children: [
|
|
118
|
+
return (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: 12, wrap: "wrap", style: { width: "100%" }, children: [_jsx(PhiStatusDotControl, { color: color, label: buildStatusLabel(state, labels), children: state?.subject ? (_jsx(PhiTypographyControl, { code: true, children: state.subject })) : null }), error ? (_jsx(PhiTypographyControl, { type: "danger", children: error })) : null] }));
|
|
118
119
|
}
|
|
@@ -8,7 +8,7 @@ import { PHI_GALLERY_WIDGET_DEFINITION, } from "./config";
|
|
|
8
8
|
import { resolvePhiSpacingScaleValue } from "../../../../../components/widgets/config/spacing-options";
|
|
9
9
|
import { PHI_SEQUENCE_SETTINGS_DEFAULTS } from "../../../../../components/widgets/config/sequence-settings";
|
|
10
10
|
import { resolvePhiGalleryFrame } from "./defaults";
|
|
11
|
-
import {
|
|
11
|
+
import { PHI_GALLERY_WIDGET_DEFAULT_LABELS, } from "../../../../../components/widgets/label-types/gallery";
|
|
12
12
|
/** How many dots stand for "more than one page" on the canvas, which does not know how many pictures there are. */
|
|
13
13
|
const EDITOR_DOT_COUNT = 3;
|
|
14
14
|
/**
|
|
@@ -30,14 +30,12 @@ function PhiGalleryWidgetEditor({ config }) {
|
|
|
30
30
|
const hasFolder = folderId != null && folderId !== "";
|
|
31
31
|
const recordField = config?.recordField;
|
|
32
32
|
/*
|
|
33
|
-
* Where a field of the page record is named, the pictures are that field's and the
|
|
34
|
-
*
|
|
35
|
-
* that decides nothing.
|
|
33
|
+
* Where a field of the page record is named, the pictures are that field's and the Inspector already
|
|
34
|
+
* says which: the canvas adds no sentence. Saying "no folder chosen" there sent the author looking for
|
|
35
|
+
* a setting that decides nothing, so the Folder hints are for a Gallery that reads a Folder only.
|
|
36
36
|
*/
|
|
37
37
|
const labels = PHI_GALLERY_WIDGET_DEFAULT_LABELS;
|
|
38
|
-
const hint = recordField
|
|
39
|
-
? formatPhiGalleryWidgetLabel(labels.canvasRecordField, recordField)
|
|
40
|
-
: hasFolder ? labels.canvasFolder : labels.canvasNoFolder;
|
|
38
|
+
const hint = recordField ? null : hasFolder ? labels.canvasFolder : labels.canvasNoFolder;
|
|
41
39
|
const { aspectRatio } = resolvePhiGalleryFrame(config);
|
|
42
40
|
const arrowStyle = {
|
|
43
41
|
position: "absolute",
|
|
@@ -74,6 +72,6 @@ function PhiGalleryWidgetEditor({ config }) {
|
|
|
74
72
|
height: token.marginXS,
|
|
75
73
|
borderRadius: token.borderRadiusSM,
|
|
76
74
|
background: page === 0 ? token.colorPrimary : token.colorFill,
|
|
77
|
-
} }, page))) })) : null, _jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: hint })] }));
|
|
75
|
+
} }, page))) })) : null, hint ? (_jsx(PhiTypographyControl, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: hint })) : null] }));
|
|
78
76
|
}
|
|
79
77
|
export const PHI_GALLERY_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_GALLERY_WIDGET_DEFINITION, ({ config }) => _jsx(PhiGalleryWidgetEditor, { config: config ?? undefined }));
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { PhiSequenceRun, resolvePhiSequenceRunSpan } from "../../../../../components/motion/phi-sequence-run";
|
|
6
|
+
import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-control";
|
|
6
7
|
import { PhiImageControl } from "../../../../../components/controls/phi-image-control";
|
|
7
8
|
import { readPhiAspectRatio, resolvePhiImagePresentation } from "../../../../../components/media/image-presentation";
|
|
8
9
|
import { PHI_GALLERY_WIDGET_DEFAULT_LABELS, } from "../../../../../components/widgets/label-types/gallery";
|
|
@@ -68,5 +69,8 @@ export function PhiGalleryWidget({ config, images: imagesInput, pictures, labels
|
|
|
68
69
|
borderRadius: token.borderRadius,
|
|
69
70
|
overflow: "hidden",
|
|
70
71
|
};
|
|
72
|
+
if (items.length === 0) {
|
|
73
|
+
return _jsx(PhiEmptyControl, { description: labels.empty });
|
|
74
|
+
}
|
|
71
75
|
return (_jsx(PhiSequenceRun, { items: items.map((item) => (_jsx(GalleryPicture, { item: item, variantKey: config?.variantKey, fit: fit, preview: config?.preview === true, sizes: sizes, aspectRatio: aspectRatio }, item.key))), settings: config, labels: labels, itemStyle: frameStyle, thumbnails: thumbnails, thumbnailWidth: PHI_GALLERY_THUMBNAIL_WIDTH }));
|
|
72
76
|
}
|
|
@@ -98,7 +98,7 @@ export const PHI_GALLERY_WIDGET_DEFINITION = {
|
|
|
98
98
|
{
|
|
99
99
|
key: "recordField",
|
|
100
100
|
type: "record-field",
|
|
101
|
-
label: "
|
|
101
|
+
label: "Record",
|
|
102
102
|
description: "Shows the pictures of a field of the record this page is about, instead of the Folder's.",
|
|
103
103
|
kinds: ["pictures"],
|
|
104
104
|
},
|
|
@@ -17,5 +17,9 @@ export type PhiGalleryWidgetServerProps = {
|
|
|
17
17
|
* they are in the HTML and the window knows what to load before anything is on screen. A record of
|
|
18
18
|
* another shape is somebody else's Provider bound here by mistake. Either failure is the author's to
|
|
19
19
|
* read and is nothing on a live page, rather than an empty gallery anywhere.
|
|
20
|
+
*
|
|
21
|
+
* Having no picture is not a failure: a product without pictures, an empty Folder, a Gallery with no
|
|
22
|
+
* Folder chosen. The Gallery says so itself, in the Foundation's empty state, so a page never needs a
|
|
23
|
+
* second Widget standing by for the case.
|
|
20
24
|
*/
|
|
21
|
-
export declare function PhiGalleryWidgetServer({ runtime, registry, config, widgetId, translate }: PhiGalleryWidgetServerProps): Promise<import("react").JSX.Element
|
|
25
|
+
export declare function PhiGalleryWidgetServer({ runtime, registry, config, widgetId, translate }: PhiGalleryWidgetServerProps): Promise<import("react").JSX.Element>;
|
|
@@ -19,19 +19,23 @@ function isPublicAssetReference(value) {
|
|
|
19
19
|
* they are in the HTML and the window knows what to load before anything is on screen. A record of
|
|
20
20
|
* another shape is somebody else's Provider bound here by mistake. Either failure is the author's to
|
|
21
21
|
* read and is nothing on a live page, rather than an empty gallery anywhere.
|
|
22
|
+
*
|
|
23
|
+
* Having no picture is not a failure: a product without pictures, an empty Folder, a Gallery with no
|
|
24
|
+
* Folder chosen. The Gallery says so itself, in the Foundation's empty state, so a page never needs a
|
|
25
|
+
* second Widget standing by for the case.
|
|
22
26
|
*/
|
|
23
27
|
export async function PhiGalleryWidgetServer({ runtime, registry, config, widgetId, translate = true }) {
|
|
24
28
|
const labels = await getPhiGalleryWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
25
29
|
const renderMode = readPhiRuntimeTreeRenderMode(config);
|
|
26
30
|
/*
|
|
27
31
|
* Where the Page has a record and the Widget names a field of it, the record's pictures take the place
|
|
28
|
-
* of the Folder's -- by their address, in the page's language already -- and a record without any
|
|
29
|
-
*
|
|
32
|
+
* of the Folder's -- by their address, in the page's language already -- and a record without any shows
|
|
33
|
+
* the empty state. A Page about no record draws the Folder, which stands in for the field.
|
|
30
34
|
*/
|
|
31
35
|
const recordField = await resolvePhiWidgetRecordField({ registry, runtime, key: config.recordField, kinds: ["pictures"] });
|
|
32
36
|
if (recordField.bound) {
|
|
33
37
|
const pictures = recordField.field?.value ?? [];
|
|
34
|
-
return
|
|
38
|
+
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Gallery, componentProps: { config, pictures, labels } }));
|
|
35
39
|
}
|
|
36
40
|
const result = registry && config.source
|
|
37
41
|
? await resolvePhiRecordSource({ registry, runtime, binding: config.source })
|
|
@@ -46,7 +50,7 @@ export async function PhiGalleryWidgetServer({ runtime, registry, config, widget
|
|
|
46
50
|
return (_jsx(PhiWidgetFailureServer, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Gallery, widgetId: widgetId, title: labels.unavailable, description: `The record bound from "${config.source?.providerKey ?? ""}" is not a list of images.` }));
|
|
47
51
|
}
|
|
48
52
|
if (!images || images.length === 0) {
|
|
49
|
-
return
|
|
53
|
+
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Gallery, componentProps: { config, images: [], labels } }));
|
|
50
54
|
}
|
|
51
55
|
/*
|
|
52
56
|
* Each picture's description from the Media library, in the page's language: the Library's text is
|
|
@@ -103,7 +103,7 @@ export const PHI_IMAGE_WIDGET_DEFINITION = {
|
|
|
103
103
|
{
|
|
104
104
|
key: "recordField",
|
|
105
105
|
type: "record-field",
|
|
106
|
-
label: "Record
|
|
106
|
+
label: "Record",
|
|
107
107
|
description: "Shows a picture of the record this page is about instead of the picture chosen here, which stands in where the page has no record.",
|
|
108
108
|
kinds: ["picture"],
|
|
109
109
|
},
|
|
@@ -417,6 +417,7 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
|
|
|
417
417
|
}) | {
|
|
418
418
|
key: string;
|
|
419
419
|
type: "choice";
|
|
420
|
+
heading: string;
|
|
420
421
|
label: string;
|
|
421
422
|
emptyOption: {
|
|
422
423
|
value: string;
|
|
@@ -426,6 +427,16 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
|
|
|
426
427
|
value: PhiMarkdownImageFloat;
|
|
427
428
|
label: string;
|
|
428
429
|
}[];
|
|
430
|
+
} | {
|
|
431
|
+
key: string;
|
|
432
|
+
type: "choice";
|
|
433
|
+
heading: string;
|
|
434
|
+
label: string;
|
|
435
|
+
options: {
|
|
436
|
+
value: "xxs" | "xs" | "sm" | "base" | "md" | "lg" | "xl" | "xxl" | "none";
|
|
437
|
+
label: "xxs" | "xs" | "sm" | "base" | "md" | "lg" | "xl" | "xxl" | "none";
|
|
438
|
+
}[];
|
|
439
|
+
emptyOption?: undefined;
|
|
429
440
|
})[];
|
|
430
441
|
parseConfig: typeof parsePhiCmsMarkdownWidgetConfig;
|
|
431
442
|
};
|
|
@@ -108,7 +108,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
fields: [
|
|
111
|
-
{ key: "eyebrow", type: "string", label: "Eyebrow" },
|
|
111
|
+
{ key: "eyebrow", type: "string", heading: "Text", label: "Eyebrow" },
|
|
112
112
|
{
|
|
113
113
|
key: "sourceMode",
|
|
114
114
|
type: "choice",
|
|
@@ -122,7 +122,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
122
122
|
{
|
|
123
123
|
key: "recordField",
|
|
124
124
|
type: "record-field",
|
|
125
|
-
label: "Record
|
|
125
|
+
label: "Record",
|
|
126
126
|
description: "Shows a field of the record this page is about instead of the text. The text stands in where the page has no record.",
|
|
127
127
|
kinds: ["markdown", "text"],
|
|
128
128
|
},
|
|
@@ -164,10 +164,28 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
164
164
|
label: "FAQ for search engines",
|
|
165
165
|
visibleWhen: { field: "foldSections", notEquals: "none" },
|
|
166
166
|
},
|
|
167
|
+
{
|
|
168
|
+
key: "headingOffset",
|
|
169
|
+
type: "number",
|
|
170
|
+
label: "Heading Offset",
|
|
171
|
+
description: "Moves every heading of the text down by this many levels: at 1, a # heading is drawn as H2, ## as H3, and so on. For a text that stands under a page title of its own, so its first heading does not compete with it.",
|
|
172
|
+
min: 0,
|
|
173
|
+
max: PHI_MARKDOWN_HEADING_OFFSET_MAX,
|
|
174
|
+
precision: 0,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
key: "tocKey",
|
|
178
|
+
type: "string",
|
|
179
|
+
label: "TOC Key",
|
|
180
|
+
// Empty is no key, and a TOC on "Auto" connects to the text all the same.
|
|
181
|
+
placeholder: "Auto",
|
|
182
|
+
description: "A name for this text's table of contents. A Markdown TOC widget set to Binding Mode \"Target\" with the same TOC Key lists this text's headings and no other's. Leave it empty while the page has one Markdown text: a TOC on \"Auto\" finds it by itself.",
|
|
183
|
+
},
|
|
167
184
|
{
|
|
168
185
|
key: "imageFloat",
|
|
169
186
|
type: "choice",
|
|
170
|
-
|
|
187
|
+
heading: "Image",
|
|
188
|
+
label: "Float",
|
|
171
189
|
// No float is the default and stores nothing; the line says so instead of an empty picker.
|
|
172
190
|
emptyOption: { value: "none", label: "None" },
|
|
173
191
|
options: PHI_MARKDOWN_IMAGE_FLOAT_OPTIONS,
|
|
@@ -180,7 +198,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
180
198
|
{
|
|
181
199
|
key: "imageFloatWidth",
|
|
182
200
|
type: "choice",
|
|
183
|
-
label: "
|
|
201
|
+
label: "Width",
|
|
184
202
|
emptyOption: { value: "large", label: "Large (golden)" },
|
|
185
203
|
options: [
|
|
186
204
|
{ value: "small", label: "Small" },
|
|
@@ -195,7 +213,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
195
213
|
{
|
|
196
214
|
key: "imageAspectRatio",
|
|
197
215
|
type: "choice",
|
|
198
|
-
label: "
|
|
216
|
+
label: "Proportion",
|
|
199
217
|
options: [
|
|
200
218
|
{ value: "auto", label: "Automatic" },
|
|
201
219
|
{ value: "phi", label: "φ (golden)" },
|
|
@@ -209,6 +227,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
209
227
|
{
|
|
210
228
|
key: "textBlockSpacingBefore",
|
|
211
229
|
type: "choice",
|
|
230
|
+
heading: "Spacing",
|
|
212
231
|
label: "Before Paragraph",
|
|
213
232
|
options: PHI_MARKDOWN_SPACING_OPTIONS,
|
|
214
233
|
},
|
|
@@ -230,23 +249,6 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
230
249
|
label: "After Header",
|
|
231
250
|
options: PHI_MARKDOWN_SPACING_OPTIONS,
|
|
232
251
|
},
|
|
233
|
-
{
|
|
234
|
-
key: "headingOffset",
|
|
235
|
-
type: "number",
|
|
236
|
-
label: "Heading Offset",
|
|
237
|
-
description: "Moves every heading of the text down by this many levels: at 1, a # heading is drawn as H2, ## as H3, and so on. For a text that stands under a page title of its own, so its first heading does not compete with it.",
|
|
238
|
-
min: 0,
|
|
239
|
-
max: PHI_MARKDOWN_HEADING_OFFSET_MAX,
|
|
240
|
-
precision: 0,
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
key: "tocKey",
|
|
244
|
-
type: "string",
|
|
245
|
-
label: "TOC Key",
|
|
246
|
-
// Empty is no key, and a TOC on "Auto" connects to the text all the same.
|
|
247
|
-
placeholder: "Auto",
|
|
248
|
-
description: "A name for this text's table of contents. A Markdown TOC widget set to Binding Mode \"Target\" with the same TOC Key lists this text's headings and no other's. Leave it empty while the page has one Markdown text: a TOC on \"Auto\" finds it by itself.",
|
|
249
|
-
},
|
|
250
252
|
// The markers are an unordered list's: a `1.` list counts, whatever its level's marker says.
|
|
251
253
|
...buildPhiBulletListFields("list", "Unordered Lists"),
|
|
252
254
|
],
|
|
@@ -193,7 +193,7 @@ export const PHI_RECORD_WIDGET_DEFINITION = {
|
|
|
193
193
|
options: [
|
|
194
194
|
{ value: "outlined", label: "Outlined" },
|
|
195
195
|
{ value: "filled", label: "Filled" },
|
|
196
|
-
{ value: "solid", label: "Solid" },
|
|
196
|
+
{ value: "solid", label: "Solid color" },
|
|
197
197
|
],
|
|
198
198
|
},
|
|
199
199
|
{
|
|
@@ -6,22 +6,26 @@ import type { PhiWidgetFontFamilyKey, PhiWidgetFontSizeKey } from "../../../../.
|
|
|
6
6
|
export type PhiSimpleTextWidgetClientLabels = {
|
|
7
7
|
text: string;
|
|
8
8
|
};
|
|
9
|
+
/** Where a linked text leads, resolved on the server: a Page reference means nothing in a browser. */
|
|
10
|
+
export type PhiSimpleTextWidgetLink = {
|
|
11
|
+
href: string;
|
|
12
|
+
newTab: boolean;
|
|
13
|
+
external: boolean;
|
|
14
|
+
};
|
|
9
15
|
export type PhiSimpleTextWidgetClientConfig = {
|
|
10
16
|
renderMode?: PhiRenderableBlockRenderMode;
|
|
11
|
-
href?: string;
|
|
12
17
|
icon?: string;
|
|
13
18
|
color?: string;
|
|
14
19
|
fontFamily?: PhiWidgetFontFamilyKey;
|
|
15
20
|
fontSize?: PhiWidgetFontSizeKey;
|
|
16
|
-
external?: boolean;
|
|
17
|
-
newTab?: boolean;
|
|
18
21
|
tone?: PhiTextTone;
|
|
19
22
|
marks?: PhiSimpleTextMark[];
|
|
20
23
|
textTransform?: PhiTextTransform;
|
|
21
24
|
letterSpacing?: PhiLetterSpacingStep;
|
|
22
|
-
disabled?: boolean;
|
|
23
25
|
};
|
|
24
26
|
export type PhiSimpleTextWidgetClientProps = PhiClientBlockBaseProps<PhiSimpleTextWidgetClientLabels, PhiSimpleTextWidgetClientConfig> & {
|
|
25
27
|
blockId: PhiCmsInstanceId;
|
|
28
|
+
/** Absent, or `null` for a target that resolved to nothing: the text draws as text. */
|
|
29
|
+
link?: PhiSimpleTextWidgetLink | null;
|
|
26
30
|
};
|
|
27
|
-
export declare function PhiSimpleTextWidgetClient({ blockId, labels, config, }: PhiSimpleTextWidgetClientProps): import("react").JSX.Element;
|
|
31
|
+
export declare function PhiSimpleTextWidgetClient({ blockId, labels, config, link, }: PhiSimpleTextWidgetClientProps): import("react").JSX.Element;
|
|
@@ -13,7 +13,7 @@ import { hasPhiSimpleTextMark } from "./marks";
|
|
|
13
13
|
import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
|
|
14
14
|
import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
|
|
15
15
|
const PHI_LINE_HEIGHT_LG = 1.6;
|
|
16
|
-
export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
16
|
+
export function PhiSimpleTextWidgetClient({ blockId, labels, config, link = null, }) {
|
|
17
17
|
const { fonts, token } = usePhiConfig();
|
|
18
18
|
const [textOverride, setTextOverride] = useState(null);
|
|
19
19
|
const [iconOverride, setIconOverride] = useState({
|
|
@@ -33,7 +33,6 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
|
33
33
|
value: undefined,
|
|
34
34
|
});
|
|
35
35
|
const [styleOverride, setStyleOverride] = useState({});
|
|
36
|
-
const hasHref = typeof config?.href === "string" && config.href.trim().length > 0;
|
|
37
36
|
const isLiveMode = config?.renderMode == null || config.renderMode === "live";
|
|
38
37
|
const textValue = textOverride ?? labels.text;
|
|
39
38
|
const iconValue = iconOverride.active ? iconOverride.value : config?.icon;
|
|
@@ -45,7 +44,6 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
|
45
44
|
italic: styleOverride.italic ?? hasPhiSimpleTextMark(config, "italic"),
|
|
46
45
|
underline: styleOverride.underline ?? hasPhiSimpleTextMark(config, "underline"),
|
|
47
46
|
delete: styleOverride.delete ?? hasPhiSimpleTextMark(config, "strike"),
|
|
48
|
-
disabled: config?.disabled,
|
|
49
47
|
code: styleOverride.code ?? hasPhiSimpleTextMark(config, "code"),
|
|
50
48
|
};
|
|
51
49
|
const resolvedFontFamily = styleValue.code
|
|
@@ -110,7 +108,7 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
|
110
108
|
* A linked text's colour is the link's (`PhiLink`), which answers the pointer; the words inside inherit
|
|
111
109
|
* it. Stated on them as well, the colour stood over the link's and the hover never showed.
|
|
112
110
|
*/
|
|
113
|
-
const contentColor =
|
|
111
|
+
const contentColor = link ? undefined : textColor;
|
|
114
112
|
const contentNode = (_jsxs(PhiFlexControl, { align: "center", gap: 8, style: {
|
|
115
113
|
width: "fit-content",
|
|
116
114
|
maxWidth: "100%",
|
|
@@ -119,7 +117,7 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
|
119
117
|
lineHeight: resolvedFontSize ? PHI_LINE_HEIGHT_LG : "inherit",
|
|
120
118
|
color: contentColor ?? undefined,
|
|
121
119
|
fontFamily: resolvedFontFamily,
|
|
122
|
-
}, children: [iconValue ? _jsx(PhiIcon, { name: iconValue, size: "1.25em" }) : null, _jsx(PhiTypographyControl, { type: config?.tone, strong: styleValue.strong, italic: styleValue.italic, underline: styleValue.underline, delete: styleValue.delete,
|
|
120
|
+
}, children: [iconValue ? _jsx(PhiIcon, { name: iconValue, size: "1.25em" }) : null, _jsx(PhiTypographyControl, { type: config?.tone, strong: styleValue.strong, italic: styleValue.italic, underline: styleValue.underline, delete: styleValue.delete, code: styleValue.code, style: {
|
|
123
121
|
color: contentColor ?? "inherit",
|
|
124
122
|
fontSize: resolvedFontSize ?? "inherit",
|
|
125
123
|
lineHeight: resolvedFontSize ? PHI_LINE_HEIGHT_LG : "inherit",
|
|
@@ -127,10 +125,10 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
|
|
|
127
125
|
...(config?.textTransform === "uppercase" ? { textTransform: "uppercase" } : {}),
|
|
128
126
|
...(config?.letterSpacing ? { letterSpacing: PHI_LETTER_SPACING_STEPS[config.letterSpacing] } : {}),
|
|
129
127
|
}, children: textValue })] }));
|
|
130
|
-
if (!
|
|
128
|
+
if (!link) {
|
|
131
129
|
return contentNode;
|
|
132
130
|
}
|
|
133
|
-
return (_jsx(PhiLink, { href:
|
|
131
|
+
return (_jsx(PhiLink, { href: link.href, external: link.external, newTab: link.newTab, markExternal: true, onClick: isLiveMode
|
|
134
132
|
? undefined
|
|
135
133
|
: (event) => {
|
|
136
134
|
event.preventDefault();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PhiTextSource } from "../../../../../helpers/text-source";
|
|
2
2
|
import { type PhiSimpleTextMark } from "../../../../../types/core-widget-placements";
|
|
3
|
+
import { type PhiLinkTarget } from "../../../../../types/references";
|
|
3
4
|
import type { PhiCmsResolvedContent } from "../../../../../types";
|
|
4
5
|
import type { PhiWidgetFontFamilyKey, PhiWidgetFontSizeKey } from "../../../../../types/site-theme";
|
|
5
6
|
import { type PhiCmsWidgetConfigBase } from "../../../../../components/widgets/config/parser-primitives";
|
|
@@ -7,20 +8,24 @@ import { type PhiLetterSpacingStep, type PhiTextTransform } from "../../../../..
|
|
|
7
8
|
import { type PhiTextTone } from "../../../../../components/widgets/config/text-tone";
|
|
8
9
|
export type PhiCmsSimpleTextWidgetConfig = PhiCmsWidgetConfigBase & {
|
|
9
10
|
text?: string;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Where the text leads, as every Control that leads somewhere keeps it: a Page by identity, an address
|
|
13
|
+
* elsewhere as a URL with its own new-tab choice (`REFERENCES.md`). A text box for a path was what this
|
|
14
|
+
* Widget had before, and the paths typed into it went stale the moment their Page moved.
|
|
15
|
+
*/
|
|
16
|
+
linkTarget?: PhiLinkTarget;
|
|
17
|
+
/** A link field of the page record that is where the text leads instead of `linkTarget`. */
|
|
18
|
+
linkRecordField?: string;
|
|
11
19
|
icon?: string;
|
|
12
20
|
color?: string;
|
|
13
21
|
fontFamily?: PhiWidgetFontFamilyKey;
|
|
14
22
|
fontSize?: PhiWidgetFontSizeKey;
|
|
15
|
-
external?: boolean;
|
|
16
|
-
newTab?: boolean;
|
|
17
23
|
tone?: PhiTextTone;
|
|
18
24
|
marks?: PhiSimpleTextMark[];
|
|
19
25
|
/** Capitals for a label (`text-case-vocabulary.ts`); absent, as written. */
|
|
20
26
|
textTransform?: PhiTextTransform;
|
|
21
27
|
/** A spacing step for a label in capitals; absent, normal. */
|
|
22
28
|
letterSpacing?: PhiLetterSpacingStep;
|
|
23
|
-
disabled?: boolean;
|
|
24
29
|
/** `"preset"` while the words are a Preset's and translated globally (`helpers/text-source.ts`). */
|
|
25
30
|
textSource?: PhiTextSource;
|
|
26
31
|
/** A text, number or date field of the page record to show instead of the Widget's own text. */
|
|
@@ -371,6 +376,44 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
|
|
|
371
376
|
key: string;
|
|
372
377
|
type: "choice";
|
|
373
378
|
label: string;
|
|
379
|
+
visibleWhen: {
|
|
380
|
+
field: string;
|
|
381
|
+
equals: null;
|
|
382
|
+
notEquals?: undefined;
|
|
383
|
+
};
|
|
384
|
+
emptyOption: {
|
|
385
|
+
value: string;
|
|
386
|
+
label: string;
|
|
387
|
+
};
|
|
388
|
+
emptyValue: undefined;
|
|
389
|
+
options: ({
|
|
390
|
+
readonly value: "secondary";
|
|
391
|
+
readonly label: "Secondary";
|
|
392
|
+
} | {
|
|
393
|
+
readonly value: "success";
|
|
394
|
+
readonly label: "Success";
|
|
395
|
+
} | {
|
|
396
|
+
readonly value: "warning";
|
|
397
|
+
readonly label: "Warning";
|
|
398
|
+
} | {
|
|
399
|
+
readonly value: "danger";
|
|
400
|
+
readonly label: "Danger";
|
|
401
|
+
})[];
|
|
402
|
+
patchOnChange?: undefined;
|
|
403
|
+
} | {
|
|
404
|
+
key: string;
|
|
405
|
+
type: "choice";
|
|
406
|
+
label: string;
|
|
407
|
+
visibleWhen: {
|
|
408
|
+
field: string;
|
|
409
|
+
notEquals: null;
|
|
410
|
+
equals?: undefined;
|
|
411
|
+
};
|
|
412
|
+
emptyOption: {
|
|
413
|
+
value: string;
|
|
414
|
+
label: string;
|
|
415
|
+
};
|
|
416
|
+
emptyValue: undefined;
|
|
374
417
|
options: ({
|
|
375
418
|
readonly value: "secondary";
|
|
376
419
|
readonly label: "Secondary";
|
|
@@ -384,6 +427,9 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
|
|
|
384
427
|
readonly value: "danger";
|
|
385
428
|
readonly label: "Danger";
|
|
386
429
|
})[];
|
|
430
|
+
patchOnChange: {
|
|
431
|
+
color: undefined;
|
|
432
|
+
};
|
|
387
433
|
} | {
|
|
388
434
|
key: string;
|
|
389
435
|
type: "choice";
|
|
@@ -395,6 +441,10 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
|
|
|
395
441
|
readonly value: "uppercase";
|
|
396
442
|
readonly label: "Capitals";
|
|
397
443
|
})[];
|
|
444
|
+
visibleWhen?: undefined;
|
|
445
|
+
emptyOption?: undefined;
|
|
446
|
+
emptyValue?: undefined;
|
|
447
|
+
patchOnChange?: undefined;
|
|
398
448
|
} | {
|
|
399
449
|
key: string;
|
|
400
450
|
type: "choice";
|
|
@@ -409,6 +459,10 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
|
|
|
409
459
|
readonly value: "wider";
|
|
410
460
|
readonly label: "Wider";
|
|
411
461
|
})[];
|
|
462
|
+
visibleWhen?: undefined;
|
|
463
|
+
emptyOption?: undefined;
|
|
464
|
+
emptyValue?: undefined;
|
|
465
|
+
patchOnChange?: undefined;
|
|
412
466
|
})[];
|
|
413
467
|
defaultConfig: {
|
|
414
468
|
maxSize: {
|
|
@@ -422,4 +476,9 @@ export declare function resolvePhiSimpleTextWidgetText(config: PhiSimpleTextWidg
|
|
|
422
476
|
preferConfigText?: boolean;
|
|
423
477
|
}, fallbackText?: string): string;
|
|
424
478
|
export declare const PHI_SIMPLE_TEXT_WIDGET_PLUGIN_TYPE: string;
|
|
479
|
+
/**
|
|
480
|
+
* The patch the toolbar's colour writes: a colour of the author's own replaces the tone, because the two
|
|
481
|
+
* exclude each other and the colour is what would draw. Taking the colour away leaves the default tone.
|
|
482
|
+
*/
|
|
483
|
+
export declare function applyPhiSimpleTextColor(color: string | null | undefined): Pick<PhiCmsSimpleTextWidgetConfig, "color" | "tone">;
|
|
425
484
|
export {};
|