@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PhiRuntimeDataProviderBinding } from "../../../../../types/runtime-data-provider";
|
|
2
|
+
import { type PhiSequenceSettings } from "../../../../../components/widgets/config/sequence-settings";
|
|
2
3
|
import { type PhiContentEntryKind } from "../../../../../constants/content-entry-kinds";
|
|
3
4
|
import { type PhiLinkTarget } from "../../../../../types/references";
|
|
4
5
|
import { PHI_ENTRY_LIST_DEFAULT_PARTS } from "../../../../../constants/content-entry-parts";
|
|
@@ -6,9 +7,10 @@ import { type PhiCmsWidgetConfigBase } from "../../../../../components/widgets/c
|
|
|
6
7
|
/**
|
|
7
8
|
* How the entries stand on the page (`CONTENT_ENTRIES.md`): `stack` is each entry whole, one under the
|
|
8
9
|
* next; `cards` a grid of cards, each leading to its entry's detail Page; `compact` one line of date and
|
|
9
|
-
* title with a teaser under it, for a sidebar or a home page
|
|
10
|
+
* title with a teaser under it, for a sidebar or a home page; `slideshow` the same cards a few at a
|
|
11
|
+
* time, moving the way a Gallery moves (`sequence-settings.ts`).
|
|
10
12
|
*/
|
|
11
|
-
export declare const PHI_ENTRY_LIST_PRESENTATIONS: readonly ["stack", "cards", "compact"];
|
|
13
|
+
export declare const PHI_ENTRY_LIST_PRESENTATIONS: readonly ["stack", "cards", "compact", "slideshow"];
|
|
12
14
|
export type PhiEntryListPresentation = (typeof PHI_ENTRY_LIST_PRESENTATIONS)[number];
|
|
13
15
|
/**
|
|
14
16
|
* Where the entries come from: the newest of the kind, or the ones closest to one entry -- a "more like
|
|
@@ -19,7 +21,7 @@ export type PhiEntryListSource = (typeof PHI_ENTRY_LIST_SOURCES)[number];
|
|
|
19
21
|
export { PHI_ENTRY_LIST_DEFAULT_PARTS };
|
|
20
22
|
/** As many as a page can carry without becoming an archive, which is a later address. */
|
|
21
23
|
export declare const PHI_ENTRY_LIST_DEFAULT_LIMIT = 10;
|
|
22
|
-
export type PhiEntryListWidgetConfig = PhiCmsWidgetConfigBase & {
|
|
24
|
+
export type PhiEntryListWidgetConfig = PhiCmsWidgetConfigBase & PhiSequenceSettings & {
|
|
23
25
|
/** Which content kind's entries (`CONTENT_ENTRIES.md`). */
|
|
24
26
|
kind: PhiContentEntryKind;
|
|
25
27
|
/**
|
|
@@ -70,45 +72,336 @@ export declare const PHI_ENTRY_LIST_WIDGET_DEFINITION: {
|
|
|
70
72
|
translatesOwnText: true;
|
|
71
73
|
icon: string;
|
|
72
74
|
slotSizePolicy: "fill-inline";
|
|
73
|
-
fields: ({
|
|
75
|
+
fields: (({
|
|
74
76
|
key: string;
|
|
75
|
-
type: "choice";
|
|
76
77
|
label: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
heading?:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
visibleWhen?: undefined;
|
|
87
|
-
providerKind?: undefined;
|
|
88
|
-
} | {
|
|
78
|
+
description?: string;
|
|
79
|
+
required?: boolean;
|
|
80
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
81
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
82
|
+
heading?: string;
|
|
83
|
+
} & {
|
|
84
|
+
type: "string" | "url" | "icon";
|
|
85
|
+
emptyValue?: "";
|
|
86
|
+
}) | ({
|
|
89
87
|
key: string;
|
|
88
|
+
label: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
required?: boolean;
|
|
91
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
92
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
93
|
+
heading?: string;
|
|
94
|
+
} & {
|
|
90
95
|
type: "link-target";
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
visibleWhen?:
|
|
99
|
-
|
|
100
|
-
}
|
|
96
|
+
clearsWhenEmpty?: readonly string[];
|
|
97
|
+
}) | ({
|
|
98
|
+
key: string;
|
|
99
|
+
label: string;
|
|
100
|
+
description?: string;
|
|
101
|
+
required?: boolean;
|
|
102
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
103
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
104
|
+
heading?: string;
|
|
105
|
+
} & {
|
|
106
|
+
type: "readonly";
|
|
107
|
+
}) | ({
|
|
108
|
+
key: string;
|
|
109
|
+
label: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
required?: boolean;
|
|
112
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
113
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
114
|
+
heading?: string;
|
|
115
|
+
} & {
|
|
116
|
+
type: "data-provider";
|
|
117
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
118
|
+
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
119
|
+
}) | ({
|
|
120
|
+
key: string;
|
|
121
|
+
label: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
required?: boolean;
|
|
124
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
125
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
126
|
+
heading?: string;
|
|
127
|
+
} & {
|
|
128
|
+
type: "calendar-adapter";
|
|
129
|
+
}) | ({
|
|
130
|
+
key: string;
|
|
131
|
+
label: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
required?: boolean;
|
|
134
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
135
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
136
|
+
heading?: string;
|
|
137
|
+
} & {
|
|
138
|
+
type: "video-provider";
|
|
139
|
+
}) | ({
|
|
140
|
+
key: string;
|
|
141
|
+
label: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
required?: boolean;
|
|
144
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
145
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
146
|
+
heading?: string;
|
|
147
|
+
} & {
|
|
148
|
+
type: "dimension";
|
|
149
|
+
widthKey?: string;
|
|
150
|
+
heightKey?: string;
|
|
151
|
+
widthPlaceholder?: string;
|
|
152
|
+
heightPlaceholder?: string;
|
|
153
|
+
patchOnChange?: Record<string, unknown>;
|
|
154
|
+
}) | ({
|
|
101
155
|
key: string;
|
|
156
|
+
label: string;
|
|
157
|
+
description?: string;
|
|
158
|
+
required?: boolean;
|
|
159
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
160
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
161
|
+
heading?: string;
|
|
162
|
+
} & {
|
|
163
|
+
type: "length";
|
|
164
|
+
min?: number;
|
|
165
|
+
max?: number;
|
|
166
|
+
step?: number;
|
|
167
|
+
precision?: number;
|
|
168
|
+
}) | ({
|
|
169
|
+
key: string;
|
|
170
|
+
label: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
required?: boolean;
|
|
173
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
174
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
175
|
+
heading?: string;
|
|
176
|
+
} & {
|
|
177
|
+
type: "radius";
|
|
178
|
+
topLeftKey: string;
|
|
179
|
+
topRightKey: string;
|
|
180
|
+
bottomLeftKey: string;
|
|
181
|
+
bottomRightKey: string;
|
|
182
|
+
}) | ({
|
|
183
|
+
key: string;
|
|
184
|
+
label: string;
|
|
185
|
+
description?: string;
|
|
186
|
+
required?: boolean;
|
|
187
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
188
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
189
|
+
heading?: string;
|
|
190
|
+
} & {
|
|
191
|
+
type: "padding";
|
|
192
|
+
paddingKey?: string;
|
|
193
|
+
gapKey?: string;
|
|
194
|
+
paddingTopKey?: string;
|
|
195
|
+
paddingRightKey?: string;
|
|
196
|
+
paddingBottomKey?: string;
|
|
197
|
+
paddingLeftKey?: string;
|
|
198
|
+
section?: string;
|
|
199
|
+
}) | ({
|
|
200
|
+
key: string;
|
|
201
|
+
label: string;
|
|
202
|
+
description?: string;
|
|
203
|
+
required?: boolean;
|
|
204
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
205
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
206
|
+
heading?: string;
|
|
207
|
+
} & {
|
|
208
|
+
type: "color";
|
|
209
|
+
mode?: import("../../../../../types").PhiCmsConfigFieldColorMode;
|
|
210
|
+
defaultToken?: import("../../../../../theme/phi-theme-tokens").PhiThemeTokenKey;
|
|
211
|
+
section?: string;
|
|
212
|
+
}) | ({
|
|
213
|
+
key: string;
|
|
214
|
+
label: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
required?: boolean;
|
|
217
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
218
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
219
|
+
heading?: string;
|
|
220
|
+
} & {
|
|
221
|
+
type: "boolean";
|
|
222
|
+
}) | ({
|
|
223
|
+
key: string;
|
|
224
|
+
label: string;
|
|
225
|
+
description?: string;
|
|
226
|
+
required?: boolean;
|
|
227
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
228
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
229
|
+
heading?: string;
|
|
230
|
+
} & {
|
|
231
|
+
type: "image";
|
|
232
|
+
}) | ({
|
|
233
|
+
key: string;
|
|
234
|
+
label: string;
|
|
235
|
+
description?: string;
|
|
236
|
+
required?: boolean;
|
|
237
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
238
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
239
|
+
heading?: string;
|
|
240
|
+
} & {
|
|
241
|
+
type: "slot-texts";
|
|
242
|
+
}) | ({
|
|
243
|
+
key: string;
|
|
244
|
+
label: string;
|
|
245
|
+
description?: string;
|
|
246
|
+
required?: boolean;
|
|
247
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
248
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
249
|
+
heading?: string;
|
|
250
|
+
} & {
|
|
251
|
+
type: "number-list";
|
|
252
|
+
min?: number;
|
|
253
|
+
}) | ({
|
|
254
|
+
key: string;
|
|
255
|
+
label: string;
|
|
256
|
+
description?: string;
|
|
257
|
+
required?: boolean;
|
|
258
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
259
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
260
|
+
heading?: string;
|
|
261
|
+
} & {
|
|
262
|
+
type: "flags";
|
|
263
|
+
options: readonly {
|
|
264
|
+
value: number;
|
|
265
|
+
label: string;
|
|
266
|
+
}[];
|
|
267
|
+
}) | ({
|
|
268
|
+
key: string;
|
|
269
|
+
label: string;
|
|
270
|
+
description?: string;
|
|
271
|
+
required?: boolean;
|
|
272
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
273
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
274
|
+
heading?: string;
|
|
275
|
+
} & {
|
|
102
276
|
type: "number";
|
|
277
|
+
min?: number;
|
|
278
|
+
max?: number;
|
|
279
|
+
step?: number;
|
|
280
|
+
precision?: number;
|
|
281
|
+
prefix?: string;
|
|
282
|
+
presentation?: "slider";
|
|
283
|
+
suffix?: string;
|
|
284
|
+
}) | ({
|
|
285
|
+
key: string;
|
|
286
|
+
label: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
required?: boolean;
|
|
289
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
290
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
291
|
+
heading?: string;
|
|
292
|
+
} & {
|
|
293
|
+
type: "choice";
|
|
294
|
+
valueType: "number";
|
|
295
|
+
options: import("@phis/contracts/controls").PhiControlOption<number>[];
|
|
296
|
+
emptyOption?: import("@phis/contracts/controls").PhiControlOption;
|
|
297
|
+
emptyValue?: null | undefined;
|
|
298
|
+
placeholder?: string;
|
|
299
|
+
mode?: never;
|
|
300
|
+
presentation?: never;
|
|
301
|
+
optionsProvider?: never;
|
|
302
|
+
allowCustom?: never;
|
|
303
|
+
createBehavior?: never;
|
|
304
|
+
filter?: never;
|
|
305
|
+
patchOnChange?: never;
|
|
306
|
+
optionPresets?: never;
|
|
307
|
+
}) | ({
|
|
308
|
+
key: string;
|
|
309
|
+
label: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
required?: boolean;
|
|
312
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
313
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
314
|
+
heading?: string;
|
|
315
|
+
} & {
|
|
316
|
+
type: "choice";
|
|
317
|
+
mode?: import("../../../../../types").PhiCmsConfigFieldChoiceMode;
|
|
318
|
+
valueType?: Exclude<import("../../../../../types").PhiCmsConfigFieldChoiceValueType, "number">;
|
|
319
|
+
presentation?: import("../../../../../types").PhiCmsConfigFieldChoicePresentation;
|
|
320
|
+
options?: import("@phis/contracts/controls").PhiControlOption[];
|
|
321
|
+
optionsProvider?: import("@phis/contracts/controls").PhiControlOptionsProviderConfig;
|
|
322
|
+
allowCustom?: boolean;
|
|
323
|
+
createBehavior?: import("../../../../../types").PhiCmsConfigFieldChoiceCreateBehavior;
|
|
324
|
+
placeholder?: string;
|
|
325
|
+
filter?: import("../../../../../types").PhiCmsConfigFieldChoiceFilter;
|
|
326
|
+
emptyOption?: import("@phis/contracts/controls").PhiControlOption;
|
|
327
|
+
emptyValue?: null | undefined;
|
|
328
|
+
patchOnChange?: Record<string, unknown>;
|
|
329
|
+
optionPresets?: import("../../../../../types/cms-plugins").PhiCmsConfigFieldOptionPresets;
|
|
330
|
+
}) | ({
|
|
331
|
+
key: string;
|
|
332
|
+
label: string;
|
|
333
|
+
description?: string;
|
|
334
|
+
required?: boolean;
|
|
335
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
336
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
337
|
+
heading?: string;
|
|
338
|
+
} & {
|
|
339
|
+
type: "collection";
|
|
340
|
+
itemKeyField: string;
|
|
341
|
+
itemLabelField?: string;
|
|
342
|
+
itemFields: import("../../../../../types").PhiCmsConfigField[];
|
|
343
|
+
defaultItem?: Record<string, unknown>;
|
|
344
|
+
addLabel?: string;
|
|
345
|
+
emptyLabel?: string;
|
|
346
|
+
minItems?: number;
|
|
347
|
+
maxItems?: number;
|
|
348
|
+
reorderable?: boolean;
|
|
349
|
+
presentation?: import("../../../../../types").PhiCmsConfigFieldCollectionPresentation;
|
|
350
|
+
editLabel?: string;
|
|
351
|
+
}) | ({
|
|
352
|
+
key: string;
|
|
353
|
+
label: string;
|
|
354
|
+
description?: string;
|
|
355
|
+
required?: boolean;
|
|
356
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
357
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
358
|
+
heading?: string;
|
|
359
|
+
} & {
|
|
360
|
+
type: "background";
|
|
361
|
+
section?: string;
|
|
362
|
+
storage?: import("../../../../../types").PhiCmsConfigFieldValueStorage;
|
|
363
|
+
}) | ({
|
|
364
|
+
key: string;
|
|
365
|
+
label: string;
|
|
366
|
+
description?: string;
|
|
367
|
+
required?: boolean;
|
|
368
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
369
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
370
|
+
heading?: string;
|
|
371
|
+
} & {
|
|
372
|
+
type: "border";
|
|
373
|
+
section?: string;
|
|
374
|
+
storage?: import("../../../../../types").PhiCmsConfigFieldValueStorage;
|
|
375
|
+
}) | ({
|
|
376
|
+
key: string;
|
|
377
|
+
label: string;
|
|
378
|
+
description?: string;
|
|
379
|
+
required?: boolean;
|
|
380
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
381
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
382
|
+
heading?: string;
|
|
383
|
+
} & {
|
|
384
|
+
type: "surface";
|
|
385
|
+
tone?: false;
|
|
386
|
+
}) | ({
|
|
387
|
+
key: string;
|
|
103
388
|
label: string;
|
|
104
|
-
description
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
389
|
+
description?: string;
|
|
390
|
+
required?: boolean;
|
|
391
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
392
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
393
|
+
heading?: string;
|
|
394
|
+
} & {
|
|
395
|
+
type: "shadow" | "grid-placement" | "column-count";
|
|
396
|
+
section?: string;
|
|
397
|
+
}) | {
|
|
398
|
+
key: string;
|
|
399
|
+
type: "choice";
|
|
400
|
+
label: string;
|
|
401
|
+
options: {
|
|
402
|
+
value: "news" | "blog";
|
|
403
|
+
label: "news" | "blog";
|
|
404
|
+
}[];
|
|
112
405
|
} | {
|
|
113
406
|
key: string;
|
|
114
407
|
type: "flags";
|
|
@@ -138,64 +431,70 @@ export declare const PHI_ENTRY_LIST_WIDGET_DEFINITION: {
|
|
|
138
431
|
readonly value: number;
|
|
139
432
|
readonly label: "Link";
|
|
140
433
|
})[];
|
|
141
|
-
heading?: undefined;
|
|
142
|
-
description?: undefined;
|
|
143
|
-
mode?: undefined;
|
|
144
|
-
placeholder?: undefined;
|
|
145
|
-
optionsProvider?: undefined;
|
|
146
|
-
visibleWhen?: undefined;
|
|
147
|
-
providerKind?: undefined;
|
|
148
|
-
} | {
|
|
149
|
-
key: string;
|
|
150
|
-
type: "choice";
|
|
151
|
-
mode: "multiple";
|
|
152
|
-
label: string;
|
|
153
|
-
description: string;
|
|
154
|
-
placeholder: string;
|
|
155
|
-
optionsProvider: {
|
|
156
|
-
providerKey: `${string}/${string}`;
|
|
157
|
-
params: {
|
|
158
|
-
noneValue: string;
|
|
159
|
-
categoryNoneLabel: string;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
visibleWhen: {
|
|
163
|
-
field: string;
|
|
164
|
-
notEquals: string;
|
|
165
|
-
equals?: undefined;
|
|
166
|
-
};
|
|
167
|
-
options?: undefined;
|
|
168
|
-
heading?: undefined;
|
|
169
|
-
providerKind?: undefined;
|
|
170
|
-
} | {
|
|
171
|
-
key: string;
|
|
172
|
-
type: "data-provider";
|
|
173
|
-
providerKind: "record";
|
|
174
|
-
label: string;
|
|
175
|
-
description: string;
|
|
176
|
-
visibleWhen: {
|
|
177
|
-
field: string;
|
|
178
|
-
equals: string;
|
|
179
|
-
notEquals?: undefined;
|
|
180
|
-
};
|
|
181
|
-
options?: undefined;
|
|
182
|
-
heading?: undefined;
|
|
183
|
-
mode?: undefined;
|
|
184
|
-
placeholder?: undefined;
|
|
185
|
-
optionsProvider?: undefined;
|
|
186
|
-
} | {
|
|
187
|
-
key: string;
|
|
188
|
-
type: "string";
|
|
189
|
-
label: string;
|
|
190
|
-
options?: undefined;
|
|
191
|
-
heading?: undefined;
|
|
192
|
-
description?: undefined;
|
|
193
|
-
mode?: undefined;
|
|
194
|
-
placeholder?: undefined;
|
|
195
|
-
optionsProvider?: undefined;
|
|
196
|
-
visibleWhen?: undefined;
|
|
197
|
-
providerKind?: undefined;
|
|
198
434
|
})[];
|
|
199
|
-
defaultConfig:
|
|
435
|
+
defaultConfig: {
|
|
436
|
+
visibleCount: 1;
|
|
437
|
+
transition: "slide";
|
|
438
|
+
durationMs: 320;
|
|
439
|
+
easing: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out";
|
|
440
|
+
gap: "xs";
|
|
441
|
+
lookahead: 1;
|
|
442
|
+
mountPolicy: "lazy-keep";
|
|
443
|
+
controls: "both";
|
|
444
|
+
loop: false;
|
|
445
|
+
autoplayMs: 0;
|
|
446
|
+
renderMode?: import("../../../../../types").PhiRenderableBlockRenderMode;
|
|
447
|
+
visibility?: import("../../../../../types").PhiRenderableBlockVisibility;
|
|
448
|
+
accessPolicy?: import("@phis/contracts/access").PhiViewerAccessPolicy;
|
|
449
|
+
viewportFlags?: import("../../../../../types").PhiViewportFlags;
|
|
450
|
+
enabled?: boolean;
|
|
451
|
+
debugMode?: boolean;
|
|
452
|
+
anchor?: import("../../../../../types").PhiRenderableBlockAnchor;
|
|
453
|
+
zIndex?: number;
|
|
454
|
+
opacity?: number;
|
|
455
|
+
surface?: import("../../../../../types/surface").PhiSurface;
|
|
456
|
+
className?: string;
|
|
457
|
+
size?: import("../../../../../types").PhiRenderableBlockResponsiveSize;
|
|
458
|
+
minSize?: import("../../../../../types").PhiRenderableBlockResponsiveSize;
|
|
459
|
+
maxSize?: import("../../../../../types").PhiRenderableBlockResponsiveSize;
|
|
460
|
+
collapsedSizeHint?: import("../../../../../types").PhiRenderableBlockSize;
|
|
461
|
+
effects?: import("../../../../../types").PhiRenderableBlockEffects;
|
|
462
|
+
/** Which content kind's entries (`CONTENT_ENTRIES.md`). */
|
|
463
|
+
kind: PhiContentEntryKind;
|
|
464
|
+
/**
|
|
465
|
+
* Where an entry's title leads: the kind's detail route, a Page target the slug fills per entry
|
|
466
|
+
* (REFERENCES.md). Absent, or a route that does not resolve, and the titles are not links.
|
|
467
|
+
*/
|
|
468
|
+
detailLinkTarget?: PhiLinkTarget;
|
|
469
|
+
presentation: PhiEntryListPresentation;
|
|
470
|
+
/**
|
|
471
|
+
* How many entries at most.
|
|
472
|
+
*
|
|
473
|
+
* A ceiling in the Widget rather than a page parameter: what a Site shows on its list page is a
|
|
474
|
+
* decision it makes once in the Builder, and a visitor who could ask for five hundred entries would be
|
|
475
|
+
* asking the server to render them.
|
|
476
|
+
*/
|
|
477
|
+
limit: number;
|
|
478
|
+
/** Which parts of each entry show (`constants/content-entry-parts.ts`). */
|
|
479
|
+
show: number;
|
|
480
|
+
source: PhiEntryListSource;
|
|
481
|
+
/**
|
|
482
|
+
* Which categories a `latest` list shows, by id, and `none` for the entries filed under no category;
|
|
483
|
+
* empty is every entry. An id whose category was deleted since filters nothing -- it is left standing
|
|
484
|
+
* rather than swept, and a list left with only such ids shows every entry again.
|
|
485
|
+
*
|
|
486
|
+
* By id, not by address: a category renamed or given another address is still the one the list was
|
|
487
|
+
* set to (REFERENCES.md says the same of Pages).
|
|
488
|
+
*/
|
|
489
|
+
categories: string[];
|
|
490
|
+
/**
|
|
491
|
+
* The entry a `related` list is about, as a record binding (`types/record-provider.ts`) -- the one the
|
|
492
|
+
* header and text above it are bound to, so the three share one read. A detail route's tree writes the
|
|
493
|
+
* route's slug into it; a list with no entry to be related to shows nothing.
|
|
494
|
+
*/
|
|
495
|
+
relatedTo: PhiRuntimeDataProviderBinding | null;
|
|
496
|
+
/** A heading drawn above the entries, and only where there are any; empty for none. */
|
|
497
|
+
title: string;
|
|
498
|
+
};
|
|
200
499
|
parseConfig: typeof parsePhiEntryListWidgetConfig;
|
|
201
500
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readPhiRuntimeDataProviderBinding, } from "../../../../../types/runtime-data-provider";
|
|
2
2
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
3
|
+
import { buildPhiSequenceSettingsFields, PHI_SEQUENCE_SETTINGS_DEFAULTS, readPhiSequenceSettings, } from "../../../../../components/widgets/config/sequence-settings";
|
|
3
4
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
4
5
|
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../../../constants/core-data-provider-keys";
|
|
5
6
|
import { PHI_CONTENT_ENTRY_CURATION_NONE_CONFIG_KEYS } from "../../../../../components/forms/content-entry-curation-config";
|
|
@@ -10,9 +11,10 @@ import { readInteger, readRenderableBlockConfig, } from "../../../../../componen
|
|
|
10
11
|
/**
|
|
11
12
|
* How the entries stand on the page (`CONTENT_ENTRIES.md`): `stack` is each entry whole, one under the
|
|
12
13
|
* next; `cards` a grid of cards, each leading to its entry's detail Page; `compact` one line of date and
|
|
13
|
-
* title with a teaser under it, for a sidebar or a home page
|
|
14
|
+
* title with a teaser under it, for a sidebar or a home page; `slideshow` the same cards a few at a
|
|
15
|
+
* time, moving the way a Gallery moves (`sequence-settings.ts`).
|
|
14
16
|
*/
|
|
15
|
-
export const PHI_ENTRY_LIST_PRESENTATIONS = ["stack", "cards", "compact"];
|
|
17
|
+
export const PHI_ENTRY_LIST_PRESENTATIONS = ["stack", "cards", "compact", "slideshow"];
|
|
16
18
|
/**
|
|
17
19
|
* Where the entries come from: the newest of the kind, or the ones closest to one entry -- a "more like
|
|
18
20
|
* this" list under a detail Page, bound to that entry's record in `relatedTo`.
|
|
@@ -43,12 +45,23 @@ function readLimit(value) {
|
|
|
43
45
|
}
|
|
44
46
|
return Math.min(limit, PHI_ENTRY_LIST_MAX_LIMIT);
|
|
45
47
|
}
|
|
48
|
+
function failSequence(key, value, expected) {
|
|
49
|
+
throw new Error(`Invalid Entries ${key} ${JSON.stringify(value)}. Expected ${expected}.`);
|
|
50
|
+
}
|
|
51
|
+
/** A slideshow's settings, shown only while the list is one. */
|
|
52
|
+
const PHI_ENTRY_LIST_SEQUENCE_FIELDS = buildPhiSequenceSettingsFields({
|
|
53
|
+
countLabel: "Visible Entries",
|
|
54
|
+
heading: "Slideshow",
|
|
55
|
+
visibleWhen: { field: "presentation", equals: "slideshow" },
|
|
56
|
+
});
|
|
46
57
|
export function normalizePhiEntryListWidgetConfig(config) {
|
|
47
58
|
const raw = isPhiRecord(config)
|
|
48
59
|
? config
|
|
49
60
|
: {};
|
|
50
61
|
return {
|
|
51
62
|
...readRenderableBlockConfig(raw),
|
|
63
|
+
// Read strictly, as the Gallery reads them: a run that moves other than written is a quiet mistake.
|
|
64
|
+
...readPhiSequenceSettings(raw, failSequence),
|
|
52
65
|
// A new list shows News until somebody picks its kind in the Inspector.
|
|
53
66
|
kind: isPhiContentEntryKind(raw.kind) ? raw.kind : "news",
|
|
54
67
|
detailLinkTarget: readPhiLinkTarget(raw.detailLinkTarget) ?? undefined,
|
|
@@ -97,6 +110,7 @@ export const PHI_ENTRY_LIST_WIDGET_DEFINITION = {
|
|
|
97
110
|
{ value: "stack", label: "Whole entries" },
|
|
98
111
|
{ value: "cards", label: "Cards" },
|
|
99
112
|
{ value: "compact", label: "Compact" },
|
|
113
|
+
{ value: "slideshow", label: "Slideshow" },
|
|
100
114
|
],
|
|
101
115
|
},
|
|
102
116
|
{
|
|
@@ -142,12 +156,16 @@ export const PHI_ENTRY_LIST_WIDGET_DEFINITION = {
|
|
|
142
156
|
key: "relatedTo",
|
|
143
157
|
type: "data-provider",
|
|
144
158
|
providerKind: "record",
|
|
159
|
+
providerKey: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.contentEntry,
|
|
145
160
|
label: "Related to",
|
|
146
161
|
description: "The entry; a detail Page binds it to its own.",
|
|
147
162
|
visibleWhen: { field: "source", equals: "related" },
|
|
148
163
|
},
|
|
149
164
|
{ key: "title", type: "string", label: "Heading" },
|
|
165
|
+
...PHI_ENTRY_LIST_SEQUENCE_FIELDS.window,
|
|
166
|
+
...PHI_ENTRY_LIST_SEQUENCE_FIELDS.movement,
|
|
167
|
+
...PHI_ENTRY_LIST_SEQUENCE_FIELDS.controls,
|
|
150
168
|
],
|
|
151
|
-
defaultConfig: normalizePhiEntryListWidgetConfig(null),
|
|
169
|
+
defaultConfig: { ...normalizePhiEntryListWidgetConfig(null), ...PHI_SEQUENCE_SETTINGS_DEFAULTS },
|
|
152
170
|
parseConfig: parsePhiEntryListWidgetConfig,
|
|
153
171
|
};
|
|
@@ -9,6 +9,7 @@ import { trBulk } from "../../../../../server-helpers/translate";
|
|
|
9
9
|
import { readPhiBoundContentEntry } from "../../content-entries/record-source.server";
|
|
10
10
|
import { buildPhiEntryViews } from "./view.server";
|
|
11
11
|
import { normalizePhiEntryListWidgetConfig } from "./config";
|
|
12
|
+
import { pickPhiSequenceSettings } from "../../../../../components/widgets/config/sequence-settings";
|
|
12
13
|
/**
|
|
13
14
|
* One kind's published entries, read while the page is drawn (`CONTENT_ENTRIES.md`).
|
|
14
15
|
*
|
|
@@ -78,6 +79,7 @@ export async function PhiEntryListWidget({ config, runtime, registry, links, tra
|
|
|
78
79
|
entries: views,
|
|
79
80
|
labels,
|
|
80
81
|
presentation: settings.presentation,
|
|
82
|
+
...(settings.presentation === "slideshow" ? { sequence: pickPhiSequenceSettings(settings) } : {}),
|
|
81
83
|
parts: settings.show,
|
|
82
84
|
...(title ? { title } : {}),
|
|
83
85
|
emptyBehavior: related ? "hide" : "say",
|