@phis/ui 0.6.3 → 0.6.5
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-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-segmented-control.js +15 -1
- 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/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/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/widgets/inspector-field-row.js +4 -1
- 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/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-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/authoring-widgets.js +4 -8
- package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
- 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 +7 -3
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +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/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 +11 -3
- 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/editor/services/releases-table.js +4 -1
- package/plugins/runtime-modules/observability/data-providers.js +1 -1
- package/plugins/runtime-modules/observability/services/table.js +3 -1
- package/plugins/runtime-modules/theme/authoring-widgets.js +5 -5
- 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/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 +11 -25
- 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/layout.css +4 -4
- 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/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
|
@@ -461,7 +461,7 @@ export const PHI_SPLIT_CARD_LAYOUT_DEFINITION = {
|
|
|
461
461
|
defaultAnchor: PHI_CENTRED_SLOT_DEFAULT_ANCHOR,
|
|
462
462
|
slotSizePolicy: "fill-inline",
|
|
463
463
|
title: "Split Card",
|
|
464
|
-
description: "Two cards
|
|
464
|
+
description: "Two cards side by side, one Surface for both.",
|
|
465
465
|
category: "structure",
|
|
466
466
|
iconName: "split-card",
|
|
467
467
|
defaultConfig: { ...PHI_SPLIT_CARD_LAYOUT_DEFAULTS },
|
|
@@ -469,7 +469,27 @@ export const PHI_SPLIT_CARD_LAYOUT_DEFINITION = {
|
|
|
469
469
|
creationConfig: { ...PHI_SPLIT_CARD_LAYOUT_CREATION_CONFIG },
|
|
470
470
|
// The outer inset and the gap between the cards are the Paddings panel's; the rest is the Surface.
|
|
471
471
|
fields: [
|
|
472
|
-
|
|
472
|
+
/*
|
|
473
|
+
* Above the switch, not under it: the switch goes at 50/50, which has no larger card to swap, and a
|
|
474
|
+
* picker under it would move up a row the moment that is chosen. φ is the default and stores nothing.
|
|
475
|
+
*/
|
|
476
|
+
{
|
|
477
|
+
key: "ratio",
|
|
478
|
+
type: "choice",
|
|
479
|
+
label: "Ratio",
|
|
480
|
+
presentation: "segmented",
|
|
481
|
+
emptyOption: { value: "golden", label: "φ" },
|
|
482
|
+
options: [
|
|
483
|
+
{ value: "50-50", label: "50/50" },
|
|
484
|
+
{ value: "20-80", label: "20/80" },
|
|
485
|
+
],
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
key: "swapRatio",
|
|
489
|
+
type: "boolean",
|
|
490
|
+
label: "Swap ratio",
|
|
491
|
+
visibleWhen: { field: "ratio", notEquals: "50-50" },
|
|
492
|
+
},
|
|
473
493
|
...PHI_LAYOUT_PADDING_FIELDS,
|
|
474
494
|
],
|
|
475
495
|
slots: [...PHI_CMS_SPLIT_LAYOUT_SLOTS],
|
|
@@ -488,6 +508,24 @@ export const PHI_THREE_COLUMN_LAYOUT_DEFINITION = {
|
|
|
488
508
|
fields: [
|
|
489
509
|
...PHI_LAYOUT_PADDING_FIELDS,
|
|
490
510
|
{ key: "balancedSides", type: "boolean", label: "Balanced Sides" },
|
|
511
|
+
/*
|
|
512
|
+
* What each balanced side takes of the row; the middle takes the rest. 25 % is the default and stores
|
|
513
|
+
* nothing (`constants/cms-layout-proportions.ts`). A side with a fixed width below keeps it.
|
|
514
|
+
*/
|
|
515
|
+
{
|
|
516
|
+
key: "sideShare",
|
|
517
|
+
type: "choice",
|
|
518
|
+
valueType: "number",
|
|
519
|
+
label: "Side Width",
|
|
520
|
+
visibleWhen: { field: "balancedSides", equals: true },
|
|
521
|
+
emptyOption: { value: "default", label: "25 %", separator: "after" },
|
|
522
|
+
options: [
|
|
523
|
+
{ value: 10, label: "10 %" },
|
|
524
|
+
{ value: 20, label: "20 %" },
|
|
525
|
+
{ value: 30, label: "30 %" },
|
|
526
|
+
{ value: 33, label: "33 % (equal columns)" },
|
|
527
|
+
],
|
|
528
|
+
},
|
|
491
529
|
{ key: "leftWidth", type: "length", label: "Left Width", min: 0 },
|
|
492
530
|
{ key: "middleWidth", type: "length", label: "Middle Width", min: 0 },
|
|
493
531
|
{ key: "rightWidth", type: "length", label: "Right Width", min: 0 },
|
|
@@ -7,5 +7,5 @@ import { PHI_SPLIT_CARD_LAYOUT_DEFINITION } from "../layout-definitions";
|
|
|
7
7
|
export const PHI_SPLIT_CARD_LAYOUT_PLUGIN = {
|
|
8
8
|
...PHI_SPLIT_CARD_LAYOUT_DEFINITION,
|
|
9
9
|
parseConfig: parsePhiCmsSplitCardLayoutConfig,
|
|
10
|
-
...definePhiLayoutRenderers(({ node, config, renderSequentialSlotChildren }, renderMode) => (_jsx(PhiSplitCardLayout, { blockId: node.id, layoutKind: "split", slots: renderSequentialSlotChildren(node), gap: config.gap, swapRatio: config.swapRatio, zIndex: config.zIndex, surface: config.surface, padding: config.padding, paddingTop: config.paddingTop, paddingRight: config.paddingRight, paddingBottom: config.paddingBottom, paddingLeft: config.paddingLeft, labelEnd: config.labelEnd, editSlotAnchor: resolvePhiLayoutAnchor(config.anchor, PHI_SPLIT_CARD_LAYOUT_DEFINITION.defaultAnchor), size: config.size, minSize: config.minSize, maxSize: config.maxSize, collapsedSizeHint: config.collapsedSizeHint, renderMode: renderMode }, `layout-${node.id}`))),
|
|
10
|
+
...definePhiLayoutRenderers(({ node, config, renderSequentialSlotChildren }, renderMode) => (_jsx(PhiSplitCardLayout, { blockId: node.id, layoutKind: "split", slots: renderSequentialSlotChildren(node), gap: config.gap, swapRatio: config.swapRatio, ratio: config.ratio, zIndex: config.zIndex, surface: config.surface, padding: config.padding, paddingTop: config.paddingTop, paddingRight: config.paddingRight, paddingBottom: config.paddingBottom, paddingLeft: config.paddingLeft, labelEnd: config.labelEnd, editSlotAnchor: resolvePhiLayoutAnchor(config.anchor, PHI_SPLIT_CARD_LAYOUT_DEFINITION.defaultAnchor), size: config.size, minSize: config.minSize, maxSize: config.maxSize, collapsedSizeHint: config.collapsedSizeHint, renderMode: renderMode }, `layout-${node.id}`))),
|
|
11
11
|
};
|
|
@@ -7,5 +7,5 @@ import { PHI_THREE_COLUMN_LAYOUT_DEFINITION } from "../layout-definitions";
|
|
|
7
7
|
export const PHI_THREE_COLUMN_LAYOUT_PLUGIN = {
|
|
8
8
|
...PHI_THREE_COLUMN_LAYOUT_DEFINITION,
|
|
9
9
|
parseConfig: parsePhiCmsThreeColumnLayoutConfig,
|
|
10
|
-
...definePhiLayoutRenderers(({ node, config, renderSequentialSlotChildren }, renderMode) => (_jsx(PhiThreeColumnLayout, { blockId: node.id, layoutKind: "threecol", slots: renderSequentialSlotChildren(node), balancedSides: config.balancedSides, gap: config.gap, align: config.align, justify: config.justify, wrap: config.wrap, leftWidth: config.leftWidth, middleWidth: config.middleWidth, rightWidth: config.rightWidth, editSlotAnchor: resolvePhiLayoutAnchor(config.anchor, PHI_THREE_COLUMN_LAYOUT_DEFINITION.defaultAnchor), zIndex: config.zIndex, surface: config.surface, padding: config.padding, paddingTop: config.paddingTop, paddingRight: config.paddingRight, paddingBottom: config.paddingBottom, paddingLeft: config.paddingLeft, labelEnd: config.labelEnd, size: config.size, minSize: config.minSize, maxSize: config.maxSize, collapsedSizeHint: config.collapsedSizeHint, renderMode: renderMode }, `layout-${node.id}`))),
|
|
10
|
+
...definePhiLayoutRenderers(({ node, config, renderSequentialSlotChildren }, renderMode) => (_jsx(PhiThreeColumnLayout, { blockId: node.id, layoutKind: "threecol", slots: renderSequentialSlotChildren(node), balancedSides: config.balancedSides, sideShare: config.sideShare, gap: config.gap, align: config.align, justify: config.justify, wrap: config.wrap, leftWidth: config.leftWidth, middleWidth: config.middleWidth, rightWidth: config.rightWidth, editSlotAnchor: resolvePhiLayoutAnchor(config.anchor, PHI_THREE_COLUMN_LAYOUT_DEFINITION.defaultAnchor), zIndex: config.zIndex, surface: config.surface, padding: config.padding, paddingTop: config.paddingTop, paddingRight: config.paddingRight, paddingBottom: config.paddingBottom, paddingLeft: config.paddingLeft, labelEnd: config.labelEnd, size: config.size, minSize: config.minSize, maxSize: config.maxSize, collapsedSizeHint: config.collapsedSizeHint, renderMode: renderMode }, `layout-${node.id}`))),
|
|
11
11
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PhiSurfaceGroundFrame } from "../surface/phi-surface-ground";
|
|
2
|
+
import { type PhiCmsSplitCardRatio } from "../../constants/cms-layout-proportions";
|
|
2
3
|
/**
|
|
3
4
|
* Where one card's part of the shared Background lies, measured against the card.
|
|
4
5
|
*
|
|
@@ -6,9 +7,13 @@ import type { PhiSurfaceGroundFrame } from "../surface/phi-surface-ground";
|
|
|
6
7
|
* the paint is as wide as the Split Card's content box (`100cqw`, the Split Card being the query
|
|
7
8
|
* container) and moved left by the card's own offset. The left card's offset is nothing; the right
|
|
8
9
|
* card's is the left card's width and the gap, and the left card's width is fixed by the columns
|
|
9
|
-
* (`resolvePhiSplitCardColumns`): what the gap leaves, shared 1 to φ, or φ to 1 when
|
|
10
|
+
* (`resolvePhiSplitCardColumns`): what the gap leaves, shared in the ratio -- 1 to φ, or φ to 1 when
|
|
11
|
+
* swapped. The
|
|
10
12
|
* height needs nothing: both cards are stretched to the row, which is the content box's height.
|
|
11
13
|
*/
|
|
12
|
-
export declare function resolvePhiSplitCardGroundFrame(side: "left" | "right", gap: string, swapped?: boolean): PhiSurfaceGroundFrame;
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
export declare function resolvePhiSplitCardGroundFrame(side: "left" | "right", gap: string, swapped?: boolean, ratio?: PhiCmsSplitCardRatio): PhiSurfaceGroundFrame;
|
|
15
|
+
/**
|
|
16
|
+
* The two columns: the smaller card left and the larger right, or the other way round when swapped. In
|
|
17
|
+
* `fr`, so the gap comes out of the row first and the rest is shared in the ratio.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolvePhiSplitCardColumns(swapped?: boolean, ratio?: PhiCmsSplitCardRatio): string;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import { PHI_CMS_SPLIT_CARD_DEFAULT_RATIO, } from "../../constants/cms-layout-proportions";
|
|
1
2
|
/*
|
|
2
3
|
* The Split Card's geometry, apart from its Client half: the Layout renders on the server and reads the
|
|
3
4
|
* ratio for its columns, and a value imported from a Client file arrives there as a client reference.
|
|
4
5
|
*/
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Each ratio in units of the smaller card: how many the larger is, and both together -- written out, so
|
|
8
|
+
* the CSS carries no float residue. φ: the larger card is φ times as wide as the smaller. 50/50 has no
|
|
9
|
+
* larger card, so swapping it changes nothing.
|
|
10
|
+
*/
|
|
11
|
+
const PHI_SPLIT_CARD_RATIO_SHARES = {
|
|
12
|
+
golden: { larger: "1.61803398875", total: "2.61803398875" },
|
|
13
|
+
"50-50": { larger: "1", total: "2" },
|
|
14
|
+
"20-80": { larger: "4", total: "5" },
|
|
15
|
+
};
|
|
16
|
+
/** The left and the right card's share, in units of the smaller one. */
|
|
17
|
+
function resolvePhiSplitCardShares(ratio, swapped) {
|
|
18
|
+
const { larger, total } = PHI_SPLIT_CARD_RATIO_SHARES[ratio];
|
|
19
|
+
return { left: swapped ? larger : "1", right: swapped ? "1" : larger, total };
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* Where one card's part of the shared Background lies, measured against the card.
|
|
11
23
|
*
|
|
@@ -13,12 +25,14 @@ const PHI_SPLIT_CARD_SHARES = "2.61803398875";
|
|
|
13
25
|
* the paint is as wide as the Split Card's content box (`100cqw`, the Split Card being the query
|
|
14
26
|
* container) and moved left by the card's own offset. The left card's offset is nothing; the right
|
|
15
27
|
* card's is the left card's width and the gap, and the left card's width is fixed by the columns
|
|
16
|
-
* (`resolvePhiSplitCardColumns`): what the gap leaves, shared 1 to φ, or φ to 1 when
|
|
28
|
+
* (`resolvePhiSplitCardColumns`): what the gap leaves, shared in the ratio -- 1 to φ, or φ to 1 when
|
|
29
|
+
* swapped. The
|
|
17
30
|
* height needs nothing: both cards are stretched to the row, which is the content box's height.
|
|
18
31
|
*/
|
|
19
|
-
export function resolvePhiSplitCardGroundFrame(side, gap, swapped = false) {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
32
|
+
export function resolvePhiSplitCardGroundFrame(side, gap, swapped = false, ratio = PHI_CMS_SPLIT_CARD_DEFAULT_RATIO) {
|
|
33
|
+
const shares = resolvePhiSplitCardShares(ratio, swapped);
|
|
34
|
+
const leftShare = shares.left === "1" ? "" : ` * ${shares.left}`;
|
|
35
|
+
const leftWidth = `((100cqw - ${gap})${leftShare} / ${shares.total})`;
|
|
22
36
|
/*
|
|
23
37
|
* Stacked (`styles/layout.css`), each card shows the whole Background on its own: the cards no longer
|
|
24
38
|
* share a row, and the height the lower card's piece would start at is not something CSS knows.
|
|
@@ -28,9 +42,11 @@ export function resolvePhiSplitCardGroundFrame(side, gap, swapped = false) {
|
|
|
28
42
|
width: "var(--phi-split-card-ground-width, 100cqw)",
|
|
29
43
|
};
|
|
30
44
|
}
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The two columns: the smaller card left and the larger right, or the other way round when swapped. In
|
|
47
|
+
* `fr`, so the gap comes out of the row first and the rest is shared in the ratio.
|
|
48
|
+
*/
|
|
49
|
+
export function resolvePhiSplitCardColumns(swapped = false, ratio = PHI_CMS_SPLIT_CARD_DEFAULT_RATIO) {
|
|
50
|
+
const shares = resolvePhiSplitCardShares(ratio, swapped);
|
|
51
|
+
return `minmax(0, ${shares.left}fr) minmax(0, ${shares.right}fr)`;
|
|
36
52
|
}
|
|
@@ -28,5 +28,15 @@ export declare function buildPhiMediaFolderCascaderOptions(folders: PhiMediaAsse
|
|
|
28
28
|
value: string;
|
|
29
29
|
label: string;
|
|
30
30
|
})[];
|
|
31
|
+
/**
|
|
32
|
+
* Every Folder as a choice by its id, for a setting that names one: its own name, and the Folder it
|
|
33
|
+
* stands in as its `parentValue`, so a cascader shows the tree and a Folder that holds others can be
|
|
34
|
+
* chosen itself.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildPhiMediaFolderChoiceOptions(folders: readonly PhiMediaAssetFolder[]): {
|
|
37
|
+
parentValue?: string | undefined;
|
|
38
|
+
value: string;
|
|
39
|
+
label: string;
|
|
40
|
+
}[];
|
|
31
41
|
export declare function resolvePhiMediaFolderIdFromValue(folders: PhiMediaAssetFolder[], value: string | null | undefined): number | null;
|
|
32
42
|
export declare function combinePhiMediaFlagValues(presentationFlags: number[]): number;
|
|
@@ -76,6 +76,20 @@ export function buildPhiMediaFolderCascaderOptions(folders, presentation) {
|
|
|
76
76
|
};
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Every Folder as a choice by its id, for a setting that names one: its own name, and the Folder it
|
|
81
|
+
* stands in as its `parentValue`, so a cascader shows the tree and a Folder that holds others can be
|
|
82
|
+
* chosen itself.
|
|
83
|
+
*/
|
|
84
|
+
export function buildPhiMediaFolderChoiceOptions(folders) {
|
|
85
|
+
return [...folders]
|
|
86
|
+
.sort((left, right) => left.name.localeCompare(right.name) || left.id - right.id)
|
|
87
|
+
.map((folder) => ({
|
|
88
|
+
value: String(folder.id),
|
|
89
|
+
label: folder.name,
|
|
90
|
+
...(folder.parentId == null ? {} : { parentValue: String(folder.parentId) }),
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
79
93
|
export function resolvePhiMediaFolderIdFromValue(folders, value) {
|
|
80
94
|
const trimmed = value?.trim() ?? "";
|
|
81
95
|
if (!trimmed || trimmed === "/") {
|
|
@@ -43,6 +43,7 @@ declare const PHI_ANTD_ICON_LOADERS: {
|
|
|
43
43
|
readonly FileUnknownTwoTone: () => Promise<typeof import("@ant-design/icons/es/icons/FileUnknownTwoTone")>;
|
|
44
44
|
readonly FileZipTwoTone: () => Promise<typeof import("@ant-design/icons/es/icons/FileZipTwoTone")>;
|
|
45
45
|
readonly FolderAddOutlined: () => Promise<typeof import("@ant-design/icons-svg/es/asn/FolderAddOutlined")>;
|
|
46
|
+
readonly FolderOutlined: () => Promise<typeof import("@ant-design/icons-svg/es/asn/FolderOutlined")>;
|
|
46
47
|
readonly FontColorsOutlined: () => Promise<typeof import("@ant-design/icons-svg/es/asn/FontColorsOutlined")>;
|
|
47
48
|
readonly FontSizeOutlined: () => Promise<typeof import("@ant-design/icons-svg/es/asn/FontSizeOutlined")>;
|
|
48
49
|
readonly FormOutlined: () => Promise<typeof import("@ant-design/icons-svg/es/asn/FormOutlined")>;
|
|
@@ -64,6 +64,7 @@ const PHI_ANTD_ICON_LOADERS = {
|
|
|
64
64
|
FileUnknownTwoTone: () => import("@ant-design/icons/es/icons/FileUnknownTwoTone"),
|
|
65
65
|
FileZipTwoTone: () => import("@ant-design/icons/es/icons/FileZipTwoTone"),
|
|
66
66
|
FolderAddOutlined: () => import("@ant-design/icons-svg/es/asn/FolderAddOutlined"),
|
|
67
|
+
FolderOutlined: () => import("@ant-design/icons-svg/es/asn/FolderOutlined"),
|
|
67
68
|
FontColorsOutlined: () => import("@ant-design/icons-svg/es/asn/FontColorsOutlined"),
|
|
68
69
|
FontSizeOutlined: () => import("@ant-design/icons-svg/es/asn/FontSizeOutlined"),
|
|
69
70
|
FormOutlined: () => import("@ant-design/icons-svg/es/asn/FormOutlined"),
|
|
@@ -353,6 +354,8 @@ export const PHI_ANTD_ICON_NAMES = {
|
|
|
353
354
|
"eye-outlined": "EyeOutlined",
|
|
354
355
|
"folder-add": "FolderAddOutlined",
|
|
355
356
|
"folder-add-outlined": "FolderAddOutlined",
|
|
357
|
+
folder: "FolderOutlined",
|
|
358
|
+
"folder-outlined": "FolderOutlined",
|
|
356
359
|
link: "LinkOutlined",
|
|
357
360
|
"link-outlined": "LinkOutlined",
|
|
358
361
|
lock: "LockOutlined",
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PhiFlexControl } from "../controls/phi-flex-control";
|
|
4
|
+
import { PhiTruncatedHoverText } from "../controls/phi-truncated-hover-text";
|
|
4
5
|
import { PhiTypographyControl } from "../controls/phi-typography-control";
|
|
5
6
|
/** The label column every Inspector row shares, so a control that draws its own header lines up with the rest. */
|
|
6
7
|
export const PHI_INSPECTOR_FIELD_LABEL_WIDTH = 140;
|
|
8
|
+
/* The box that cuts the words is the one the hover text measures. */
|
|
9
|
+
const PHI_INSPECTOR_FIELD_LABEL_TEXT_STYLE = { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" };
|
|
7
10
|
export function PhiInspectorFieldRow({ label, children, labelWidth = PHI_INSPECTOR_FIELD_LABEL_WIDTH, }) {
|
|
8
|
-
return (_jsxs(PhiFlexControl, { align: "flex-start", gap: 12, wrap: false, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${labelWidth}px`, minWidth: 0,
|
|
11
|
+
return (_jsxs(PhiFlexControl, { align: "flex-start", gap: 12, wrap: false, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${labelWidth}px`, minWidth: 0, lineHeight: "var(--phi-control-height)" }, children: _jsx(PhiTruncatedHoverText, { title: label, children: _jsx("span", { style: PHI_INSPECTOR_FIELD_LABEL_TEXT_STYLE, children: label }) }) }), _jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: children })] }));
|
|
9
12
|
}
|
|
@@ -68,6 +68,9 @@ export declare function getPhiAdminUsersTableWidgetLabels(options: PhiGlobalTran
|
|
|
68
68
|
company: string;
|
|
69
69
|
roles: string;
|
|
70
70
|
rolesPlaceholder: string;
|
|
71
|
+
addonRoles: string;
|
|
72
|
+
addonRolesPlaceholder: string;
|
|
73
|
+
addonRolesHint: string;
|
|
71
74
|
changePassword: string;
|
|
72
75
|
createPasswordHint: string;
|
|
73
76
|
authOnlyHint: string;
|
|
@@ -26,8 +26,8 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
26
26
|
column_roles: "Roles",
|
|
27
27
|
column_addon_roles: "Add-on roles",
|
|
28
28
|
addon_roles_all: "all roles",
|
|
29
|
-
filter_addon_role: "Add-on
|
|
30
|
-
filter_addon_role_hint: definePhiMessageLabel("Show users who hold
|
|
29
|
+
filter_addon_role: "Add-on",
|
|
30
|
+
filter_addon_role_hint: definePhiMessageLabel("Show users who hold any role of an Add-on. Site Admins hold every role."),
|
|
31
31
|
column_user_flags: "User flags",
|
|
32
32
|
column_site_flags: "Site flags",
|
|
33
33
|
column_last_login: "Last login",
|
|
@@ -59,6 +59,9 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
59
59
|
editor_company: "Company",
|
|
60
60
|
editor_roles: "Roles",
|
|
61
61
|
editor_roles_placeholder: "Choose roles",
|
|
62
|
+
editor_addon_roles: "Add-on roles",
|
|
63
|
+
editor_addon_roles_placeholder: "Choose Add-on roles",
|
|
64
|
+
editor_addon_roles_hint: definePhiMessageLabel("A Site Admin holds every Add-on role. Your own Add-on roles cannot be changed here."),
|
|
62
65
|
editor_change_password: "Require password reset",
|
|
63
66
|
editor_create_password_hint: definePhiMessageLabel("New users are created with a temporary password and receive a reset link."),
|
|
64
67
|
editor_auth_only_hint: definePhiMessageLabel("Leave roles empty for an auth-only account."),
|
|
@@ -159,6 +162,9 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
|
|
|
159
162
|
company: labels.editor_company,
|
|
160
163
|
roles: labels.editor_roles,
|
|
161
164
|
rolesPlaceholder: labels.editor_roles_placeholder,
|
|
165
|
+
addonRoles: labels.editor_addon_roles,
|
|
166
|
+
addonRolesPlaceholder: labels.editor_addon_roles_placeholder,
|
|
167
|
+
addonRolesHint: labels.editor_addon_roles_hint,
|
|
162
168
|
changePassword: labels.editor_change_password,
|
|
163
169
|
createPasswordHint: labels.editor_create_password_hint,
|
|
164
170
|
authOnlyHint: labels.editor_auth_only_hint,
|
|
@@ -14,9 +14,9 @@ const PHI_GALLERY_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
14
14
|
region: PHI_GALLERY_WIDGET_DEFAULT_LABELS.region,
|
|
15
15
|
pages: definePhiMessageLabel(PHI_GALLERY_WIDGET_DEFAULT_LABELS.pages),
|
|
16
16
|
unavailable: definePhiMessageLabel(PHI_GALLERY_WIDGET_DEFAULT_LABELS.unavailable),
|
|
17
|
+
empty: PHI_GALLERY_WIDGET_DEFAULT_LABELS.empty,
|
|
17
18
|
canvas_folder: definePhiMessageLabel(PHI_GALLERY_WIDGET_DEFAULT_LABELS.canvasFolder),
|
|
18
19
|
canvas_no_folder: definePhiMessageLabel(PHI_GALLERY_WIDGET_DEFAULT_LABELS.canvasNoFolder),
|
|
19
|
-
canvas_record_field: definePhiMessageLabel(PHI_GALLERY_WIDGET_DEFAULT_LABELS.canvasRecordField),
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
export async function getPhiGalleryWidgetLabels(options) {
|
|
@@ -30,8 +30,8 @@ export async function getPhiGalleryWidgetLabels(options) {
|
|
|
30
30
|
region: labels.region,
|
|
31
31
|
pages: labels.pages,
|
|
32
32
|
unavailable: labels.unavailable,
|
|
33
|
+
empty: labels.empty,
|
|
33
34
|
canvasFolder: labels.canvas_folder,
|
|
34
35
|
canvasNoFolder: labels.canvas_no_folder,
|
|
35
|
-
canvasRecordField: labels.canvas_record_field,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -70,6 +70,8 @@ const PHI_INSPECTOR_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
70
70
|
field_select_calendar: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectCalendar,
|
|
71
71
|
field_select_video_provider: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectVideoProvider,
|
|
72
72
|
field_select_record_field: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectRecordField,
|
|
73
|
+
field_record_field_none: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.recordFieldNone,
|
|
74
|
+
field_translate_text: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.translateText,
|
|
73
75
|
link_none: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.none,
|
|
74
76
|
link_page: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.page,
|
|
75
77
|
link_external: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.external,
|
|
@@ -160,6 +162,8 @@ export async function getPhiInspectorWidgetLabels(options) {
|
|
|
160
162
|
selectCalendar: labels.field_select_calendar,
|
|
161
163
|
selectVideoProvider: labels.field_select_video_provider,
|
|
162
164
|
selectRecordField: labels.field_select_record_field,
|
|
165
|
+
recordFieldNone: labels.field_record_field_none,
|
|
166
|
+
translateText: labels.field_translate_text,
|
|
163
167
|
linkTarget: {
|
|
164
168
|
none: labels.link_none,
|
|
165
169
|
page: labels.link_page,
|
|
@@ -6,7 +6,7 @@ const PHI_OBSERVABILITY_LOGS_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
6
6
|
ctx: PHI_TR_CTX_WEB_UI_LABEL,
|
|
7
7
|
labels: {
|
|
8
8
|
search_placeholder: "Search messages, events, and metadata",
|
|
9
|
-
service_label: "
|
|
9
|
+
service_label: "Source",
|
|
10
10
|
level_label: "Level",
|
|
11
11
|
event_label: "Event",
|
|
12
12
|
area_label: "Area",
|
|
@@ -25,7 +25,7 @@ const PHI_OBSERVABILITY_LOGS_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
25
25
|
filter_error: "Error",
|
|
26
26
|
column_time: "Time",
|
|
27
27
|
column_level: "Level",
|
|
28
|
-
column_service: "
|
|
28
|
+
column_service: "Source",
|
|
29
29
|
column_event: "Event",
|
|
30
30
|
column_area: "Area",
|
|
31
31
|
column_user: "User",
|
|
@@ -220,7 +220,8 @@ const PHI_PASSWORD_CHANGE_REQUIRED_LABEL_SET = definePhiLabelSet({
|
|
|
220
220
|
text: definePhiMessageLabel("An administrator asked you to choose a new password before you continue. " +
|
|
221
221
|
"Enter the one you signed in with, then your new one. If you do not know it, use the link in " +
|
|
222
222
|
"the email we sent you."),
|
|
223
|
-
|
|
223
|
+
// Not opening as `text` does: a message is keyed by how it starts, and the two must stay two.
|
|
224
|
+
email_only_text: definePhiMessageLabel("Before you continue, an administrator asked you to choose a new password. " +
|
|
224
225
|
"Use the link in the email we sent you to set it, then sign in again."),
|
|
225
226
|
sign_out: "Sign out",
|
|
226
227
|
},
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { PhiSequenceControlLabels } from "./sequence";
|
|
2
2
|
export type PhiGalleryWidgetLabels = PhiSequenceControlLabels & {
|
|
3
3
|
unavailable: string;
|
|
4
|
+
/** What the Gallery shows where it has no picture to show. */
|
|
5
|
+
empty: string;
|
|
4
6
|
/** The Builder canvas's hint under a Gallery whose Folder is chosen. */
|
|
5
7
|
canvasFolder: string;
|
|
6
8
|
/** The Builder canvas's hint under a Gallery whose Folder is not chosen yet. */
|
|
7
9
|
canvasNoFolder: string;
|
|
8
|
-
/** The Builder canvas's hint under a Gallery bound to a field of the page record, `%1` the field. */
|
|
9
|
-
canvasRecordField: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const PHI_GALLERY_WIDGET_DEFAULT_LABELS: PhiGalleryWidgetLabels;
|
|
12
|
-
export declare function formatPhiGalleryWidgetLabel(template: string, value: string): string;
|
|
@@ -7,10 +7,7 @@ export const PHI_GALLERY_WIDGET_DEFAULT_LABELS = {
|
|
|
7
7
|
region: "Pictures",
|
|
8
8
|
pages: "Choose pictures",
|
|
9
9
|
unavailable: "The pictures could not be read.",
|
|
10
|
+
empty: "No pictures yet",
|
|
10
11
|
canvasFolder: "The public pictures of the chosen media folder, read when the page is drawn.",
|
|
11
12
|
canvasNoFolder: "No folder chosen yet. Pick one in the inspector; its public pictures are read when the page is drawn.",
|
|
12
|
-
canvasRecordField: 'The pictures of the page record\'s field "%1", read when the page is drawn.',
|
|
13
13
|
};
|
|
14
|
-
export function formatPhiGalleryWidgetLabel(template, value) {
|
|
15
|
-
return template.replace("%1", value);
|
|
16
|
-
}
|
|
@@ -104,6 +104,10 @@ export type PhiInspectorFieldLabels = {
|
|
|
104
104
|
selectCalendar: string;
|
|
105
105
|
selectVideoProvider: string;
|
|
106
106
|
selectRecordField: string;
|
|
107
|
+
/** The first entry of a record-field select: the Widget shows its own content. */
|
|
108
|
+
recordFieldNone: string;
|
|
109
|
+
/** The switch that leaves a Widget's own words as written (`NoTranslate`). */
|
|
110
|
+
translateText: string;
|
|
107
111
|
linkTarget: PhiInspectorLinkTargetLabels;
|
|
108
112
|
};
|
|
109
113
|
export declare const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS: PhiInspectorWidgetLabels;
|
|
@@ -73,6 +73,8 @@ export const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS = {
|
|
|
73
73
|
selectCalendar: "Select a calendar",
|
|
74
74
|
selectVideoProvider: "Select a video provider",
|
|
75
75
|
selectRecordField: "Select a field of the page's record",
|
|
76
|
+
recordFieldNone: "None",
|
|
77
|
+
translateText: "Translate text",
|
|
76
78
|
linkTarget: {
|
|
77
79
|
none: "None",
|
|
78
80
|
page: "Page",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* reference of every route.
|
|
5
5
|
*
|
|
6
6
|
* Two places say it, and the nearer one wins. The Widget states what every picture in its text does -- the
|
|
7
|
-
* Inspector's "
|
|
7
|
+
* Inspector's "Proportion", "Float" and "Width" under "Image" -- and a picture that needs something else
|
|
8
8
|
* says so in its own address, after the Asset: ``, or
|
|
9
9
|
* ``. The address stays a
|
|
10
10
|
* `phis:asset/<id>` reference for everything that reads one (the server's reference index finds the id at
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PHI_CMS_THREE_COLUMN_SIDE_SHARES: readonly [10, 20, 25, 30, 33];
|
|
2
|
+
export type PhiCmsThreeColumnSideShare = (typeof PHI_CMS_THREE_COLUMN_SIDE_SHARES)[number];
|
|
3
|
+
export declare const PHI_CMS_THREE_COLUMN_DEFAULT_SIDE_SHARE: PhiCmsThreeColumnSideShare;
|
|
4
|
+
export declare const PHI_CMS_SPLIT_CARD_RATIOS: readonly ["golden", "50-50", "20-80"];
|
|
5
|
+
export type PhiCmsSplitCardRatio = (typeof PHI_CMS_SPLIT_CARD_RATIOS)[number];
|
|
6
|
+
export declare const PHI_CMS_SPLIT_CARD_DEFAULT_RATIO: PhiCmsSplitCardRatio;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The proportions a Layout's columns can be set to: plain values, without imports, so a parser, a
|
|
3
|
+
* Layout client and a geometry helper read them without pulling in the Layout registry.
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
* What a balanced side of a Three Column Layout takes of the row, in percent; the middle takes the rest.
|
|
7
|
+
* 33 is three equal columns (33 : 34 : 33). 25 is the default and is stored as absent: it is the 1 : 2 : 1
|
|
8
|
+
* the Layout always had, so a row that states nothing reads as before.
|
|
9
|
+
*/
|
|
10
|
+
export const PHI_CMS_THREE_COLUMN_SIDE_SHARES = [10, 20, 25, 30, 33];
|
|
11
|
+
export const PHI_CMS_THREE_COLUMN_DEFAULT_SIDE_SHARE = 25;
|
|
12
|
+
/*
|
|
13
|
+
* The ratio a Split Card's two cards stand in. `golden` is the default and is stored as absent: it is the
|
|
14
|
+
* ratio the Split Card always had. `50-50` has no larger card, so `swapRatio` has nothing to swap there.
|
|
15
|
+
*/
|
|
16
|
+
export const PHI_CMS_SPLIT_CARD_RATIOS = ["golden", "50-50", "20-80"];
|
|
17
|
+
export const PHI_CMS_SPLIT_CARD_DEFAULT_RATIO = "golden";
|
|
@@ -170,6 +170,7 @@ const PHI_RUNTIME_MODULE_OWNERSHIP = {
|
|
|
170
170
|
"options/admin-site-locales": ["localization", "admin-site-locales"],
|
|
171
171
|
"options/core-site-locales": ["core", "site-locales"],
|
|
172
172
|
"options/user-management-addon-roles": ["user-management", "addon-roles"],
|
|
173
|
+
"options/user-management-addon-role-choices": ["user-management", "addon-role-choices"],
|
|
173
174
|
"options/builder-area-root-route": ["builder", "area-root-route"],
|
|
174
175
|
"options/builder-landing-page": ["builder", "landing-page"],
|
|
175
176
|
"options/builder-collection-item-renderers": ["builder", "collection-item-renderers"],
|
|
@@ -29,6 +29,7 @@ export function buildPhiBuilderPageReferenceTree(area, nodes, allNodes, labels =
|
|
|
29
29
|
value: reference ?? node.key,
|
|
30
30
|
label: node.storagePath === "/" ? labelLanding(node.title, labels) : node.title,
|
|
31
31
|
description: path,
|
|
32
|
+
...(isPhiPageContainerNode(node) ? { icon: PHI_PAGE_CONTAINER_ICON } : {}),
|
|
32
33
|
...(reference
|
|
33
34
|
? { meta: { reference, title: node.title, path } }
|
|
34
35
|
: { disabled: true }),
|
|
@@ -38,6 +39,12 @@ export function buildPhiBuilderPageReferenceTree(area, nodes, allNodes, labels =
|
|
|
38
39
|
};
|
|
39
40
|
});
|
|
40
41
|
}
|
|
42
|
+
/** What a container stands under in a Page tree: a folder, so it reads apart from the Pages beside it. */
|
|
43
|
+
const PHI_PAGE_CONTAINER_ICON = "antd:folder";
|
|
44
|
+
/** A path with no Page of its own -- a container -- as opposed to a Page, or a Page whose deletion was published. */
|
|
45
|
+
function isPhiPageContainerNode(node) {
|
|
46
|
+
return node.reference == null && node.tombstoned !== true;
|
|
47
|
+
}
|
|
41
48
|
function labelLanding(title, labels) {
|
|
42
49
|
const trimmed = title.trim();
|
|
43
50
|
return trimmed ? `${trimmed} ${labels.landing}` : labels.landing;
|
|
@@ -69,6 +76,7 @@ export function buildPhiBuilderPageScopeTree(area, nodes, allNodes, labels = PHI
|
|
|
69
76
|
value: reference ?? (folder ? `${PHI_PAGE_SCOPE_FOLDER_VALUE_PREFIX}${folder}` : node.key),
|
|
70
77
|
label: node.storagePath === "/" ? labelLanding(node.title, labels) : node.title,
|
|
71
78
|
description: folder ?? resolvePhiBuilderCmsFetchPath(area, node.key, allNodes),
|
|
79
|
+
...(isPhiPageContainerNode(node) ? { icon: PHI_PAGE_CONTAINER_ICON } : {}),
|
|
72
80
|
...(reference == null && folder == null ? { disabled: true } : {}),
|
|
73
81
|
...(children ? { children } : {}),
|
|
74
82
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PhiResolvedLinkTargets } from "../types/references";
|
|
2
|
+
import type { PhiTableActionDefinition } from "../types/table-widget";
|
|
3
|
+
/**
|
|
4
|
+
* The actions with where their `linkTarget` leads, for the client to draw.
|
|
5
|
+
*
|
|
6
|
+
* Resolved on the server, in the render that resolved every target of the page in one pass: a Page
|
|
7
|
+
* reference means nothing in a browser, and the address it answers on is the server's to know. An
|
|
8
|
+
* action without a target is handed back as it is; one whose target resolved to nothing carries `null`
|
|
9
|
+
* and draws no link (`REFERENCES.md`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolvePhiTableActionLinks<TAction extends PhiTableActionDefinition>(actions: readonly TAction[] | undefined, links: PhiResolvedLinkTargets | null | undefined): TAction[] | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolvePhiLinkHref } from "./link-target";
|
|
2
|
+
/**
|
|
3
|
+
* The actions with where their `linkTarget` leads, for the client to draw.
|
|
4
|
+
*
|
|
5
|
+
* Resolved on the server, in the render that resolved every target of the page in one pass: a Page
|
|
6
|
+
* reference means nothing in a browser, and the address it answers on is the server's to know. An
|
|
7
|
+
* action without a target is handed back as it is; one whose target resolved to nothing carries `null`
|
|
8
|
+
* and draws no link (`REFERENCES.md`).
|
|
9
|
+
*/
|
|
10
|
+
export function resolvePhiTableActionLinks(actions, links) {
|
|
11
|
+
return actions?.map((action) => (action.linkTarget
|
|
12
|
+
? { ...action, link: resolvePhiLinkHref(action.linkTarget, links) }
|
|
13
|
+
: action));
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PhiTableActionDefinition } from "../types/table-widget";
|
|
2
|
+
/**
|
|
3
|
+
* The action with the address one row gives it, where it reads one (`hrefPath`).
|
|
4
|
+
*
|
|
5
|
+
* The row's address is the row's own -- an entry's review page, a ticket's link elsewhere -- and wins
|
|
6
|
+
* over the action's target. A row with nothing at the path leaves the action as it was resolved.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolvePhiTableRowActionLink<TAction extends PhiTableActionDefinition>(action: TAction, rowHref: unknown): TAction;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isPhiExternalHref } from "./external-href";
|
|
2
|
+
/**
|
|
3
|
+
* The action with the address one row gives it, where it reads one (`hrefPath`).
|
|
4
|
+
*
|
|
5
|
+
* The row's address is the row's own -- an entry's review page, a ticket's link elsewhere -- and wins
|
|
6
|
+
* over the action's target. A row with nothing at the path leaves the action as it was resolved.
|
|
7
|
+
*/
|
|
8
|
+
export function resolvePhiTableRowActionLink(action, rowHref) {
|
|
9
|
+
if (!action.hrefPath || typeof rowHref !== "string" || !rowHref.trim())
|
|
10
|
+
return action;
|
|
11
|
+
const newTab = action.newTab === true;
|
|
12
|
+
// A new tab is an anchor's to open: a route of the Site taken in place never opens one.
|
|
13
|
+
return { ...action, link: { href: rowHref, newTab, external: newTab || isPhiExternalHref(rowHref) } };
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -521,7 +521,7 @@
|
|
|
521
521
|
"@lexical/rich-text": "0.50.0",
|
|
522
522
|
"@lexical/selection": "0.50.0",
|
|
523
523
|
"@lexical/utils": "0.50.0",
|
|
524
|
-
"@phis/contracts": "^0.7.
|
|
524
|
+
"@phis/contracts": "^0.7.13",
|
|
525
525
|
"dayjs": "^1.11.23",
|
|
526
526
|
"dom-serializer": "^2.0.0",
|
|
527
527
|
"htmlparser2": "^10.1.0",
|
|
@@ -7,4 +7,10 @@ export declare function definePhiPassiveWidgetRenderers<TConfig>(renderer: (args
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}>;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The house placeholder in a Preview: the Widget's name and type, still.
|
|
12
|
+
*
|
|
13
|
+
* Drawn by the renderer for a Widget whose Preview policy is `visualPlaceholder`; a Widget does not
|
|
14
|
+
* call it from a `renderPreview` of its own.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderPhiWidgetPreviewPlaceholder(widget: PhiCmsContentWidgetNode, pluginTitle?: string | null): import("react").FunctionComponentElement<import("../../components/widgets/built-in/widget-preview-client").PhiWidgetPreviewFallbackProps>;
|
|
@@ -6,6 +6,16 @@ export function definePhiPassiveWidgetRenderers(renderer) {
|
|
|
6
6
|
renderPreview: (args) => createElement(PhiWidgetInertPreview, null, renderer(args)),
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The house placeholder in a Preview: the Widget's name and type, still.
|
|
11
|
+
*
|
|
12
|
+
* Drawn by the renderer for a Widget whose Preview policy is `visualPlaceholder`; a Widget does not
|
|
13
|
+
* call it from a `renderPreview` of its own.
|
|
14
|
+
*/
|
|
15
|
+
export function renderPhiWidgetPreviewPlaceholder(widget, pluginTitle) {
|
|
16
|
+
return createElement(PhiWidgetPreviewFallback, {
|
|
17
|
+
widget,
|
|
18
|
+
pluginTitle,
|
|
19
|
+
summary: "This widget is inactive in preview mode.",
|
|
20
|
+
});
|
|
11
21
|
}
|
|
@@ -6,7 +6,7 @@ import { PHI_MEDIA_PICKER_WIDGET_DEFINITION, } from "./widgets/media-picker/conf
|
|
|
6
6
|
import { createPhiAuthoringWidgetModule, definePhiAuthoringWidgetModuleLoader, } from "../client-authoring-widget-module";
|
|
7
7
|
export default createPhiAuthoringWidgetModule([
|
|
8
8
|
definePhiAuthoringWidgetModuleLoader(PHI_AREA_UPLOAD_WIDGET_DEFINITION, () => import("./widgets/area-upload/authoring").then((module) => module.PHI_AREA_UPLOAD_WIDGET_BUILDER_PLUGIN)),
|
|
9
|
-
definePhiAuthoringWidgetModuleLoader(PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION, () =>
|
|
10
|
-
definePhiAuthoringWidgetModuleLoader(PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION, () =>
|
|
9
|
+
definePhiAuthoringWidgetModuleLoader(PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION, () => Promise.resolve(PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION)),
|
|
10
|
+
definePhiAuthoringWidgetModuleLoader(PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION, () => Promise.resolve(PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION)),
|
|
11
11
|
definePhiAuthoringWidgetModuleLoader(PHI_MEDIA_PICKER_WIDGET_DEFINITION, () => import("./widgets/media-picker/authoring").then((module) => module.PHI_MEDIA_PICKER_WIDGET_BUILDER_PLUGIN)),
|
|
12
12
|
]);
|