@phis/ui 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cms/phi-cms-layout-renderer.js +1 -1
- package/components/controls/phi-collection-header-control.js +1 -1
- package/components/controls/phi-collection-view-control.js +2 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +2 -2
- package/components/controls/phi-image-control.d.ts +6 -1
- package/components/controls/phi-image-control.js +23 -4
- package/components/controls/phi-lightbox-image-control-adapter.d.ts +2 -0
- package/components/controls/phi-lightbox-image-control-adapter.js +11 -0
- package/components/controls/phi-lightbox-image-control.d.ts +3 -2
- package/components/controls/phi-lightbox-image-control.js +7 -3
- package/components/controls/phi-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +5 -2
- package/components/controls/phi-overlay-control-contract.d.ts +5 -0
- package/components/controls/phi-pagination-control-adapter.d.ts +2 -0
- package/components/controls/phi-pagination-control-adapter.js +15 -0
- package/components/controls/phi-pagination-control.d.ts +2 -1
- package/components/controls/phi-pagination-control.js +11 -7
- package/components/controls/phi-table-control.js +1 -1
- package/components/controls/phi-timeline-control-adapter.d.ts +2 -0
- package/components/controls/phi-timeline-control-adapter.js +28 -0
- package/components/controls/phi-timeline-control.d.ts +3 -1
- package/components/controls/phi-timeline-control.js +8 -22
- package/components/controls/phi-tour-control.js +25 -7
- package/components/controls/phi-tour-viewport.d.ts +36 -0
- package/components/controls/phi-tour-viewport.js +86 -0
- package/components/controls/phi-zoom-image-overlay.d.ts +17 -0
- package/components/controls/phi-zoom-image-overlay.js +58 -0
- package/components/layouts/layout-definitions.d.ts +0 -18
- package/components/layouts/layout-definitions.js +7 -1
- package/components/layouts/plugins/carousel-layout-plugin.js +2 -1
- package/components/media/aspect-ratios.d.ts +14 -0
- package/components/media/aspect-ratios.js +13 -0
- package/components/motion/phi-sequence-run.d.ts +27 -0
- package/components/motion/phi-sequence-run.js +87 -0
- package/components/motion/phi-sequence-viewport.d.ts +16 -0
- package/components/motion/phi-sequence-viewport.js +97 -34
- package/components/overlays/phi-overlay-container-client.js +5 -2
- package/components/runtime/runtime-visual-anchors.d.ts +13 -2
- package/components/runtime/runtime-visual-anchors.js +49 -3
- package/components/widgets/config/image-variant-options.d.ts +3 -5
- package/components/widgets/config/image-variant-options.js +11 -11
- package/components/widgets/config/sequence-settings.d.ts +75 -0
- package/components/widgets/config/sequence-settings.js +173 -0
- package/components/widgets/label-sets/content-entries.d.ts +9 -0
- package/components/widgets/label-sets/content-entries.js +17 -0
- package/components/widgets/label-types/gallery.d.ts +2 -10
- package/components/widgets/label-types/sequence.d.ts +18 -0
- package/components/widgets/label-types/sequence.js +1 -0
- package/helpers/cms-layout-defaults.js +9 -2
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/motion.d.ts +7 -0
- package/helpers/motion.js +7 -0
- package/package.json +1 -1
- package/plugins/runtime-modules/asset/data-providers.d.ts +4 -0
- package/plugins/runtime-modules/asset/data-providers.js +1 -0
- package/plugins/runtime-modules/asset/definition.d.ts +4 -0
- package/plugins/runtime-modules/asset/presets.d.ts +53 -1
- package/plugins/runtime-modules/asset/presets.js +16 -12
- package/plugins/runtime-modules/asset/tour.d.ts +44 -0
- package/plugins/runtime-modules/asset/tour.js +53 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +42 -18
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +2 -2
- package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +10 -0
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +18 -3
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
- package/plugins/runtime-modules/builder/presets.js +5 -3
- package/plugins/runtime-modules/builder/tour.d.ts +316 -0
- package/plugins/runtime-modules/builder/tour.js +337 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +3 -2
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +10 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +25 -1
- package/plugins/runtime-modules/core/widgets/entry-detail/config.d.ts +2 -0
- package/plugins/runtime-modules/core/widgets/entry-detail/config.js +8 -1
- package/plugins/runtime-modules/core/widgets/entry-header/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/entry-header/config.js +8 -1
- package/plugins/runtime-modules/core/widgets/entry-list/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/entry-list/client.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +392 -93
- package/plugins/runtime-modules/core/widgets/entry-list/config.js +21 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.js +2 -0
- package/plugins/runtime-modules/core/widgets/gallery/authoring.js +62 -10
- package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +6 -1
- package/plugins/runtime-modules/core/widgets/gallery/client.js +7 -79
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +337 -144
- package/plugins/runtime-modules/core/widgets/gallery/config.js +52 -113
- package/plugins/runtime-modules/core/widgets/gallery/defaults.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/gallery/defaults.js +20 -0
- package/plugins/runtime-modules/core/widgets/image/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/config.d.ts +29 -4
- package/plugins/runtime-modules/core/widgets/image/config.js +19 -2
- package/plugins/runtime-modules/core/widgets/image/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +25 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +25 -1
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +79 -3
- package/plugins/runtime-modules/core/widgets/tour-button/client.js +1 -1
- package/plugins/runtime-modules/revisions/presets.d.ts +53 -2
- package/plugins/runtime-modules/revisions/presets.js +16 -12
- package/plugins/runtime-modules/revisions/tour.d.ts +43 -0
- package/plugins/runtime-modules/revisions/tour.js +51 -0
- package/plugins/runtime-modules/theme/presets.d.ts +36 -4
- package/plugins/runtime-modules/theme/tour.d.ts +45 -11
- package/plugins/runtime-modules/theme/tour.js +39 -8
- package/plugins/runtime-modules/tour/controller/address.js +2 -2
- package/plugins/runtime-modules/tour/controller/client.js +43 -2
- package/plugins/runtime-modules/tour/controller/definition.js +2 -1
- package/server-helpers/cms-request.js +1 -0
- package/server-helpers/page-tour.d.ts +10 -3
- package/server-helpers/page-tour.js +25 -12
- package/types/cms-config.d.ts +3 -1
- package/types/cms-config.js +3 -3
- package/types/cms-plugins.d.ts +31 -4
- package/types/tour-controller.d.ts +10 -0
- package/types/tour-controller.js +13 -0
- package/types/tours.d.ts +27 -25
- package/types/tours.js +9 -23
- package/types/visual-anchors.d.ts +15 -0
- package/types/visual-anchors.js +12 -0
- package/types.d.ts +2 -0
- package/types.js +4 -1
package/types/cms-plugins.d.ts
CHANGED
|
@@ -93,7 +93,12 @@ export type PhiCmsConfigFieldChoicePresentation = "select" | "segmented" | "tabs
|
|
|
93
93
|
*/
|
|
94
94
|
export type PhiCmsConfigFieldCollectionPresentation = "inline" | "overlay" | "select";
|
|
95
95
|
export type PhiCmsConfigFieldChoiceMode = "single" | "multiple";
|
|
96
|
-
|
|
96
|
+
/**
|
|
97
|
+
* What a `choice` stores. A text or a list of texts is the rule; `number` is a closed list of numbers --
|
|
98
|
+
* a key that is a number everywhere else, in the parser, the URL and the contracts, as the Image's
|
|
99
|
+
* Variant is -- and is stored as that number rather than spelled as a text the reader has to convert.
|
|
100
|
+
*/
|
|
101
|
+
export type PhiCmsConfigFieldChoiceValueType = "string" | "string[]" | "number";
|
|
97
102
|
export type PhiCmsConfigFieldChoiceCreateBehavior = "none" | "accept-custom" | "create-record";
|
|
98
103
|
export type PhiCmsConfigFieldColorMode = "single" | "gradient" | "both";
|
|
99
104
|
export type PhiCmsConfigFieldValueStorage = "field" | "self";
|
|
@@ -135,6 +140,12 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
135
140
|
}) | (PhiCmsConfigFieldBase & {
|
|
136
141
|
type: "data-provider";
|
|
137
142
|
providerKind?: PhiRuntimeDataProviderKind;
|
|
143
|
+
/**
|
|
144
|
+
* The one record Provider this binding names, for a Widget that can only read one: a Gallery
|
|
145
|
+
* reads a Folder, an entry header an entry. The Inspector then offers no choice of Provider -- a list
|
|
146
|
+
* that holds a single right answer and several wrong ones -- and asks only for its parameters.
|
|
147
|
+
*/
|
|
148
|
+
providerKey?: PhiRuntimeDataProviderKey;
|
|
138
149
|
}) | (PhiCmsConfigFieldBase & {
|
|
139
150
|
type: "calendar-adapter";
|
|
140
151
|
}) | (PhiCmsConfigFieldBase & {
|
|
@@ -235,10 +246,25 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
235
246
|
*/
|
|
236
247
|
presentation?: "slider";
|
|
237
248
|
suffix?: string;
|
|
249
|
+
}) | (PhiCmsConfigFieldBase & {
|
|
250
|
+
type: "choice";
|
|
251
|
+
valueType: "number";
|
|
252
|
+
options: PhiControlOption<number>[];
|
|
253
|
+
emptyOption?: PhiControlOption;
|
|
254
|
+
emptyValue?: null | undefined;
|
|
255
|
+
placeholder?: string;
|
|
256
|
+
mode?: never;
|
|
257
|
+
presentation?: never;
|
|
258
|
+
optionsProvider?: never;
|
|
259
|
+
allowCustom?: never;
|
|
260
|
+
createBehavior?: never;
|
|
261
|
+
filter?: never;
|
|
262
|
+
patchOnChange?: never;
|
|
263
|
+
optionPresets?: never;
|
|
238
264
|
}) | (PhiCmsConfigFieldBase & {
|
|
239
265
|
type: "choice";
|
|
240
266
|
mode?: PhiCmsConfigFieldChoiceMode;
|
|
241
|
-
valueType?: PhiCmsConfigFieldChoiceValueType
|
|
267
|
+
valueType?: Exclude<PhiCmsConfigFieldChoiceValueType, "number">;
|
|
242
268
|
presentation?: PhiCmsConfigFieldChoicePresentation;
|
|
243
269
|
options?: PhiControlOption[];
|
|
244
270
|
optionsProvider?: PhiControlOptionsProviderConfig;
|
|
@@ -635,11 +661,12 @@ export type PhiResolvedCmsRequest = {
|
|
|
635
661
|
runtime: PhiBlockRuntime;
|
|
636
662
|
serverCapabilities: import("./server-capabilities").PhiCapabilitySnapshot | null;
|
|
637
663
|
/**
|
|
638
|
-
* The Tour the Page's route carries, untranslated, with the
|
|
639
|
-
* Translated only where the Area has a Controller to hand it to (types/tours.ts).
|
|
664
|
+
* The Tour the Page's route carries, untranslated, with the Module that owns it and the language that
|
|
665
|
+
* Module writes in. Translated only where the Area has a Controller to hand it to (types/tours.ts).
|
|
640
666
|
*/
|
|
641
667
|
pageTour?: {
|
|
642
668
|
definition: import("./tours").PhiTourDefinition;
|
|
669
|
+
ownerModuleId: PhiRuntimeModuleId;
|
|
643
670
|
sourceLocale?: string;
|
|
644
671
|
} | null;
|
|
645
672
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a Tour is asked for: the Tour Controller of the Area, which the Tour Module mounts.
|
|
3
|
+
*
|
|
4
|
+
* Here, in the foundation, rather than in that Module: the Tour button is Core's, so any Area -- and any
|
|
5
|
+
* Module's own Page -- can place it without depending on the Tour Module. With the Module off nobody
|
|
6
|
+
* answers at this address, and the button, never told that a Tour is there, stays hidden.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PHI_TOUR_CONTROLLER_PLUGIN_KEY = "@phis/ui/modules/tour/controller";
|
|
9
|
+
export declare const PHI_TOUR_CONTROLLER_KEY = "default";
|
|
10
|
+
export declare const PHI_TOUR_CONTROLLER_ADDRESS: `controller:${string}/${string}:${string}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PHI_SHARED_PACKAGE_NAME, createPhiControllerSignalAddress } from "./signals";
|
|
2
|
+
// Apart from `types/tours.ts`, so the Tour button, placed in every Area, carries the address and not the
|
|
3
|
+
// Tour definition's checks.
|
|
4
|
+
/**
|
|
5
|
+
* Where a Tour is asked for: the Tour Controller of the Area, which the Tour Module mounts.
|
|
6
|
+
*
|
|
7
|
+
* Here, in the foundation, rather than in that Module: the Tour button is Core's, so any Area -- and any
|
|
8
|
+
* Module's own Page -- can place it without depending on the Tour Module. With the Module off nobody
|
|
9
|
+
* answers at this address, and the button, never told that a Tour is there, stays hidden.
|
|
10
|
+
*/
|
|
11
|
+
export const PHI_TOUR_CONTROLLER_PLUGIN_KEY = `${PHI_SHARED_PACKAGE_NAME}/modules/tour/controller`;
|
|
12
|
+
export const PHI_TOUR_CONTROLLER_KEY = "default";
|
|
13
|
+
export const PHI_TOUR_CONTROLLER_ADDRESS = createPhiControllerSignalAddress(PHI_TOUR_CONTROLLER_PLUGIN_KEY, PHI_TOUR_CONTROLLER_KEY, "default");
|
package/types/tours.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type PhiSignalAddress } from "./signals";
|
|
1
|
+
import { type PhiSignalAction, type PhiSignalAddress, type PhiSignalChannel, type PhiSignalValue, type PhiSignalValueSchema, type PhiSignalValueType } from "./signals";
|
|
2
|
+
import type { PhiVisualAnchorAddress } from "./visual-anchors";
|
|
2
3
|
/**
|
|
3
4
|
* Guided Tours ([design/TOURS.md](../design/TOURS.md)).
|
|
4
5
|
*
|
|
@@ -7,20 +8,6 @@ import { type PhiSignalAddress } from "./signals";
|
|
|
7
8
|
* (`pageTour` among its flags) receives it as a Page overlay of its config. There is no registry of
|
|
8
9
|
* Tours and no Tour content in the CMS.
|
|
9
10
|
*/
|
|
10
|
-
/**
|
|
11
|
-
* The addresses a step can point at: a CMS instance, one of its declared subcontrols, a Region. A
|
|
12
|
-
* Controller is an address too, but it owns no element, so it is never a visual target.
|
|
13
|
-
*/
|
|
14
|
-
export type PhiVisualAnchorAddress = Exclude<PhiSignalAddress, `controller:${string}`>;
|
|
15
|
-
/**
|
|
16
|
-
* The attribute a Phi Control marks one of its parts with -- a Table's header row, its toolbar -- so the
|
|
17
|
-
* Widget drawing that Control can offer the part as `cms:<instanceId>:<part>` (design/TOURS.md,
|
|
18
|
-
* Visual-anchor registration). An inert mark until a Widget registers the part: the address is the
|
|
19
|
-
* Widget's contract, the attribute only says where the part is drawn.
|
|
20
|
-
*/
|
|
21
|
-
export declare const PHI_VISUAL_ANCHOR_PART_ATTRIBUTE = "data-phi-anchor-part";
|
|
22
|
-
/** The instance a part address belongs to -- `cms:<id>` of `cms:<id>:<part>` -- or `null` for a whole one. */
|
|
23
|
-
export declare function readPhiVisualAnchorOwner(address: string): PhiVisualAnchorAddress | null;
|
|
24
11
|
/**
|
|
25
12
|
* Where a step's panel sits relative to its target. Four sides, not Ant Design's twelve: a Tour points
|
|
26
13
|
* at something, and the corner variants are layout tuning no definition should have to carry.
|
|
@@ -28,6 +15,20 @@ export declare function readPhiVisualAnchorOwner(address: string): PhiVisualAnch
|
|
|
28
15
|
export type PhiTourPlacement = "top" | "bottom" | "left" | "right";
|
|
29
16
|
/** What a step does when its target is not there to point at: pass over it, or end the Tour. */
|
|
30
17
|
export type PhiTourMissingTargetPolicy = "skip" | "stop";
|
|
18
|
+
/**
|
|
19
|
+
* One signal a step sends: to prepare what it points at, or to put it away again (design/TOURS.md,
|
|
20
|
+
* Signaling and orchestration). An ordinary Area signal under the Tour Controller's address, to one named
|
|
21
|
+
* receiver that already listens for it -- the Tour adds no channel and no receiver of its own. The value
|
|
22
|
+
* travels with the Page, so it is plain data.
|
|
23
|
+
*/
|
|
24
|
+
export type PhiTourStepSignal = {
|
|
25
|
+
receiver: PhiSignalAddress;
|
|
26
|
+
channel: PhiSignalChannel;
|
|
27
|
+
action: PhiSignalAction;
|
|
28
|
+
valueType: PhiSignalValueType;
|
|
29
|
+
valueSchema?: PhiSignalValueSchema;
|
|
30
|
+
value?: PhiSignalValue;
|
|
31
|
+
};
|
|
31
32
|
export type PhiTourStepDefinition = {
|
|
32
33
|
/** The step's identity within its Tour; progress is stored under it, never under a position. */
|
|
33
34
|
key: string;
|
|
@@ -41,6 +42,17 @@ export type PhiTourStepDefinition = {
|
|
|
41
42
|
description?: string;
|
|
42
43
|
placement?: PhiTourPlacement;
|
|
43
44
|
ifMissing?: PhiTourMissingTargetPolicy;
|
|
45
|
+
/**
|
|
46
|
+
* Sent when the step is asked for, before its target is waited for: what makes the target appear --
|
|
47
|
+
* selecting something so its Inspector opens, opening a slot.
|
|
48
|
+
*/
|
|
49
|
+
prepare?: readonly PhiTourStepSignal[];
|
|
50
|
+
/**
|
|
51
|
+
* Sent when the step is left, however it is left: the next step, the previous one, a step passed over,
|
|
52
|
+
* the Tour closed or finished, the Page left. What `prepare` opened, this puts away, so nothing a step
|
|
53
|
+
* brought up stands in front of the steps after it.
|
|
54
|
+
*/
|
|
55
|
+
release?: readonly PhiTourStepSignal[];
|
|
44
56
|
};
|
|
45
57
|
export type PhiTourDefinition = {
|
|
46
58
|
/** `<module id>/<key>`: namespaced by the Module that owns the Page. */
|
|
@@ -62,16 +74,6 @@ export type PhiTourLabels = {
|
|
|
62
74
|
export type PhiResolvedPageTour = PhiTourDefinition & {
|
|
63
75
|
labels: PhiTourLabels;
|
|
64
76
|
};
|
|
65
|
-
/**
|
|
66
|
-
* Where a Tour is asked for: the Tour Controller of the Area, which the Tour Module mounts.
|
|
67
|
-
*
|
|
68
|
-
* Here, in the foundation, rather than in that Module: the Tour button is Core's, so any Area -- and any
|
|
69
|
-
* Module's own Page -- can place it without depending on the Tour Module. With the Module off nobody
|
|
70
|
-
* answers at this address, and the button, never told that a Tour is there, stays hidden.
|
|
71
|
-
*/
|
|
72
|
-
export declare const PHI_TOUR_CONTROLLER_PLUGIN_KEY = "@phis/ui/modules/tour/controller";
|
|
73
|
-
export declare const PHI_TOUR_CONTROLLER_KEY = "default";
|
|
74
|
-
export declare const PHI_TOUR_CONTROLLER_ADDRESS: `controller:${string}/${string}:${string}`;
|
|
75
77
|
/** The flag a Controller definition carries to receive the shown Page's Tour as `pageTour` in its config. */
|
|
76
78
|
export declare const PHI_PAGE_TOUR_CONTROLLER_FLAG = "pageTour";
|
|
77
79
|
/** The config key the Page's Tour arrives under. */
|
package/types/tours.js
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* The attribute a Phi Control marks one of its parts with -- a Table's header row, its toolbar -- so the
|
|
4
|
-
* Widget drawing that Control can offer the part as `cms:<instanceId>:<part>` (design/TOURS.md,
|
|
5
|
-
* Visual-anchor registration). An inert mark until a Widget registers the part: the address is the
|
|
6
|
-
* Widget's contract, the attribute only says where the part is drawn.
|
|
7
|
-
*/
|
|
8
|
-
export const PHI_VISUAL_ANCHOR_PART_ATTRIBUTE = "data-phi-anchor-part";
|
|
9
|
-
/** The instance a part address belongs to -- `cms:<id>` of `cms:<id>:<part>` -- or `null` for a whole one. */
|
|
10
|
-
export function readPhiVisualAnchorOwner(address) {
|
|
11
|
-
const [family, instanceId, part] = address.split(":");
|
|
12
|
-
return family === "cms" && instanceId && part ? `cms:${instanceId}` : null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Where a Tour is asked for: the Tour Controller of the Area, which the Tour Module mounts.
|
|
16
|
-
*
|
|
17
|
-
* Here, in the foundation, rather than in that Module: the Tour button is Core's, so any Area -- and any
|
|
18
|
-
* Module's own Page -- can place it without depending on the Tour Module. With the Module off nobody
|
|
19
|
-
* answers at this address, and the button, never told that a Tour is there, stays hidden.
|
|
20
|
-
*/
|
|
21
|
-
export const PHI_TOUR_CONTROLLER_PLUGIN_KEY = `${PHI_SHARED_PACKAGE_NAME}/modules/tour/controller`;
|
|
22
|
-
export const PHI_TOUR_CONTROLLER_KEY = "default";
|
|
23
|
-
export const PHI_TOUR_CONTROLLER_ADDRESS = createPhiControllerSignalAddress(PHI_TOUR_CONTROLLER_PLUGIN_KEY, PHI_TOUR_CONTROLLER_KEY, "default");
|
|
1
|
+
import { isPhiSignalAction, isPhiSignalValueType, } from "./signals";
|
|
24
2
|
/** The flag a Controller definition carries to receive the shown Page's Tour as `pageTour` in its config. */
|
|
25
3
|
export const PHI_PAGE_TOUR_CONTROLLER_FLAG = "pageTour";
|
|
26
4
|
/** The config key the Page's Tour arrives under. */
|
|
@@ -53,6 +31,14 @@ export function collectPhiTourDefinitionErrors(definition) {
|
|
|
53
31
|
if (step.target?.startsWith("controller:")) {
|
|
54
32
|
errors.push(`Tour "${definition.id}" step "${step.key}" points at a Controller, which draws nothing.`);
|
|
55
33
|
}
|
|
34
|
+
for (const signal of [...step.prepare ?? [], ...step.release ?? []]) {
|
|
35
|
+
if (signal.receiver === "broadcast") {
|
|
36
|
+
errors.push(`Tour "${definition.id}" step "${step.key}" broadcasts; a step signal names its receiver.`);
|
|
37
|
+
}
|
|
38
|
+
if (!isPhiSignalAction(signal.action) || !isPhiSignalValueType(signal.valueType)) {
|
|
39
|
+
errors.push(`Tour "${definition.id}" step "${step.key}" sends "${signal.channel}" with an unknown action or value type.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
56
42
|
}
|
|
57
43
|
return errors;
|
|
58
44
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PhiSignalAddress } from "./signals";
|
|
2
|
+
/**
|
|
3
|
+
* The addresses a step can point at: a CMS instance, one of its declared subcontrols, a Region. A
|
|
4
|
+
* Controller is an address too, but it owns no element, so it is never a visual target.
|
|
5
|
+
*/
|
|
6
|
+
export type PhiVisualAnchorAddress = Exclude<PhiSignalAddress, `controller:${string}`>;
|
|
7
|
+
/**
|
|
8
|
+
* The attribute a Phi Control marks one of its parts with -- a Table's header row, its toolbar -- so the
|
|
9
|
+
* Widget drawing that Control can offer the part as `cms:<instanceId>:<part>` (design/TOURS.md,
|
|
10
|
+
* Visual-anchor registration). An inert mark until a Widget registers the part: the address is the
|
|
11
|
+
* Widget's contract, the attribute only says where the part is drawn.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PHI_VISUAL_ANCHOR_PART_ATTRIBUTE = "data-phi-anchor-part";
|
|
14
|
+
/** The instance a part address belongs to -- `cms:<id>` of `cms:<id>:<part>` -- or `null` for a whole one. */
|
|
15
|
+
export declare function readPhiVisualAnchorOwner(address: string): PhiVisualAnchorAddress | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribute a Phi Control marks one of its parts with -- a Table's header row, its toolbar -- so the
|
|
3
|
+
* Widget drawing that Control can offer the part as `cms:<instanceId>:<part>` (design/TOURS.md,
|
|
4
|
+
* Visual-anchor registration). An inert mark until a Widget registers the part: the address is the
|
|
5
|
+
* Widget's contract, the attribute only says where the part is drawn.
|
|
6
|
+
*/
|
|
7
|
+
export const PHI_VISUAL_ANCHOR_PART_ATTRIBUTE = "data-phi-anchor-part";
|
|
8
|
+
/** The instance a part address belongs to -- `cms:<id>` of `cms:<id>:<part>` -- or `null` for a whole one. */
|
|
9
|
+
export function readPhiVisualAnchorOwner(address) {
|
|
10
|
+
const [family, instanceId, part] = address.split(":");
|
|
11
|
+
return family === "cms" && instanceId && part ? `cms:${instanceId}` : null;
|
|
12
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -42,7 +42,9 @@ export type * from "./types/site-theme";
|
|
|
42
42
|
export * from "./types/server-capabilities";
|
|
43
43
|
export * from "./types/core-runtime-controller";
|
|
44
44
|
export * from "./types/signals";
|
|
45
|
+
export * from "./types/tour-controller";
|
|
45
46
|
export * from "./types/tours";
|
|
47
|
+
export * from "./types/visual-anchors";
|
|
46
48
|
export type { PhiCmsWidgetConfigBase } from "./components/widgets/config/parser-primitives";
|
|
47
49
|
export * from "./components/widgets/config/control-signal-config";
|
|
48
50
|
export type * from "./components/widgets/config/background";
|
package/types.js
CHANGED
|
@@ -21,6 +21,9 @@ export * from "./types/runtime-module-locale";
|
|
|
21
21
|
export * from "./types/server-capabilities";
|
|
22
22
|
export * from "./types/core-runtime-controller";
|
|
23
23
|
export * from "./types/signals";
|
|
24
|
-
// The Tour Controller's address
|
|
24
|
+
// The Tour Controller's address, the Tour definition shape and the visual anchors, for a Module that
|
|
25
|
+
// brings its own Tour.
|
|
26
|
+
export * from "./types/tour-controller";
|
|
25
27
|
export * from "./types/tours";
|
|
28
|
+
export * from "./types/visual-anchors";
|
|
26
29
|
export * from "./components/widgets/config/control-signal-config";
|