@phis/ui 0.3.0 → 0.4.1

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.
Files changed (164) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +1 -1
  2. package/components/controls/phi-collection-header-control.js +1 -1
  3. package/components/controls/phi-collection-view-control.js +2 -1
  4. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  5. package/components/controls/phi-drawer-control-adapter.js +2 -2
  6. package/components/controls/phi-image-control.d.ts +6 -1
  7. package/components/controls/phi-image-control.js +23 -4
  8. package/components/controls/phi-lightbox-image-control-adapter.d.ts +2 -0
  9. package/components/controls/phi-lightbox-image-control-adapter.js +11 -0
  10. package/components/controls/phi-lightbox-image-control.d.ts +3 -2
  11. package/components/controls/phi-lightbox-image-control.js +7 -3
  12. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  13. package/components/controls/phi-modal-control-adapter.js +5 -2
  14. package/components/controls/phi-overlay-control-contract.d.ts +5 -0
  15. package/components/controls/phi-pagination-control-adapter.d.ts +2 -0
  16. package/components/controls/phi-pagination-control-adapter.js +15 -0
  17. package/components/controls/phi-pagination-control.d.ts +2 -1
  18. package/components/controls/phi-pagination-control.js +11 -7
  19. package/components/controls/phi-table-control.d.ts +6 -1
  20. package/components/controls/phi-table-control.js +17 -5
  21. package/components/controls/phi-timeline-control-adapter.d.ts +2 -0
  22. package/components/controls/phi-timeline-control-adapter.js +28 -0
  23. package/components/controls/phi-timeline-control.d.ts +3 -1
  24. package/components/controls/phi-timeline-control.js +8 -22
  25. package/components/controls/phi-tour-control.js +25 -7
  26. package/components/controls/phi-tour-viewport.d.ts +36 -0
  27. package/components/controls/phi-tour-viewport.js +86 -0
  28. package/components/controls/phi-zoom-image-overlay.d.ts +17 -0
  29. package/components/controls/phi-zoom-image-overlay.js +58 -0
  30. package/components/layouts/layout-definitions.d.ts +2 -20
  31. package/components/layouts/layout-definitions.js +13 -2
  32. package/components/layouts/plugins/carousel-layout-plugin.js +2 -1
  33. package/components/media/aspect-ratios.d.ts +14 -0
  34. package/components/media/aspect-ratios.js +13 -0
  35. package/components/motion/phi-sequence-run.d.ts +27 -0
  36. package/components/motion/phi-sequence-run.js +87 -0
  37. package/components/motion/phi-sequence-viewport.d.ts +16 -0
  38. package/components/motion/phi-sequence-viewport.js +97 -34
  39. package/components/overlays/phi-overlay-container-client.js +5 -2
  40. package/components/runtime/runtime-visual-anchors.d.ts +13 -2
  41. package/components/runtime/runtime-visual-anchors.js +49 -3
  42. package/components/shell/use-phi-shell-sticky-top.d.ts +5 -0
  43. package/components/shell/use-phi-shell-sticky-top.js +78 -0
  44. package/components/widgets/config/image-variant-options.d.ts +3 -5
  45. package/components/widgets/config/image-variant-options.js +11 -11
  46. package/components/widgets/config/sequence-settings.d.ts +75 -0
  47. package/components/widgets/config/sequence-settings.js +173 -0
  48. package/components/widgets/helpers/semantic-html-translation.d.ts +3 -1
  49. package/components/widgets/helpers/semantic-html-translation.js +8 -3
  50. package/components/widgets/label-sets/content-entries.d.ts +9 -0
  51. package/components/widgets/label-sets/content-entries.js +17 -0
  52. package/components/widgets/label-types/gallery.d.ts +2 -10
  53. package/components/widgets/label-types/sequence.d.ts +18 -0
  54. package/components/widgets/label-types/sequence.js +1 -0
  55. package/components/widgets/navigation-descriptor-resolver.server.js +6 -1
  56. package/components/widgets/shared/markdown-render.js +15 -5
  57. package/helpers/cms-layout-defaults.js +9 -2
  58. package/helpers/cms-region-keys.d.ts +1 -1
  59. package/helpers/motion.d.ts +7 -0
  60. package/helpers/motion.js +7 -0
  61. package/helpers/text-source.d.ts +19 -0
  62. package/helpers/text-source.js +20 -0
  63. package/next/config.mjs +1 -1
  64. package/package.json +1 -1
  65. package/plugins/runtime-modules/asset/data-providers.d.ts +4 -0
  66. package/plugins/runtime-modules/asset/data-providers.js +1 -0
  67. package/plugins/runtime-modules/asset/definition.d.ts +4 -0
  68. package/plugins/runtime-modules/asset/presets.d.ts +53 -1
  69. package/plugins/runtime-modules/asset/presets.js +16 -12
  70. package/plugins/runtime-modules/asset/tour.d.ts +44 -0
  71. package/plugins/runtime-modules/asset/tour.js +53 -0
  72. package/plugins/runtime-modules/auth/trees/phi-default-pub-confirm-page-tree.js +3 -0
  73. package/plugins/runtime-modules/auth/trees/phi-default-pub-login-page-tree.js +2 -0
  74. package/plugins/runtime-modules/auth/trees/phi-default-pub-registration-page-tree.js +3 -0
  75. package/plugins/runtime-modules/auth/trees/phi-default-pub-reset-password-page-tree.js +3 -0
  76. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +42 -18
  77. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +2 -2
  78. package/plugins/runtime-modules/builder/clients/widget-inspector.js +9 -0
  79. package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +10 -0
  80. package/plugins/runtime-modules/builder/controller/workspace-controller.js +18 -3
  81. package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
  82. package/plugins/runtime-modules/builder/presets.js +5 -3
  83. package/plugins/runtime-modules/builder/tour.d.ts +316 -0
  84. package/plugins/runtime-modules/builder/tour.js +337 -0
  85. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
  86. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +4 -0
  87. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +3 -2
  88. package/plugins/runtime-modules/core/widgets/card/server.js +4 -2
  89. package/plugins/runtime-modules/core/widgets/collection-view/client.js +10 -0
  90. package/plugins/runtime-modules/core/widgets/description/config.d.ts +28 -1
  91. package/plugins/runtime-modules/core/widgets/description/config.js +2 -0
  92. package/plugins/runtime-modules/core/widgets/description/server.js +10 -12
  93. package/plugins/runtime-modules/core/widgets/entry-detail/config.d.ts +2 -0
  94. package/plugins/runtime-modules/core/widgets/entry-detail/config.js +8 -1
  95. package/plugins/runtime-modules/core/widgets/entry-header/config.d.ts +3 -0
  96. package/plugins/runtime-modules/core/widgets/entry-header/config.js +8 -1
  97. package/plugins/runtime-modules/core/widgets/entry-list/client.d.ts +4 -1
  98. package/plugins/runtime-modules/core/widgets/entry-list/client.js +3 -2
  99. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +392 -93
  100. package/plugins/runtime-modules/core/widgets/entry-list/config.js +21 -3
  101. package/plugins/runtime-modules/core/widgets/entry-list/server.js +4 -2
  102. package/plugins/runtime-modules/core/widgets/gallery/authoring.js +62 -10
  103. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +6 -1
  104. package/plugins/runtime-modules/core/widgets/gallery/client.js +7 -79
  105. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +337 -144
  106. package/plugins/runtime-modules/core/widgets/gallery/config.js +52 -113
  107. package/plugins/runtime-modules/core/widgets/gallery/defaults.d.ts +15 -0
  108. package/plugins/runtime-modules/core/widgets/gallery/defaults.js +20 -0
  109. package/plugins/runtime-modules/core/widgets/html/server.js +1 -1
  110. package/plugins/runtime-modules/core/widgets/image/client.js +1 -1
  111. package/plugins/runtime-modules/core/widgets/image/config.d.ts +29 -4
  112. package/plugins/runtime-modules/core/widgets/image/config.js +19 -2
  113. package/plugins/runtime-modules/core/widgets/image/editor.js +1 -1
  114. package/plugins/runtime-modules/core/widgets/markdown-toc/server.js +7 -2
  115. package/plugins/runtime-modules/core/widgets/quick-links/config.d.ts +3 -0
  116. package/plugins/runtime-modules/core/widgets/quick-links/config.js +2 -0
  117. package/plugins/runtime-modules/core/widgets/quick-links/plugin.js +4 -2
  118. package/plugins/runtime-modules/core/widgets/quick-links/server.d.ts +5 -1
  119. package/plugins/runtime-modules/core/widgets/quick-links/server.js +4 -2
  120. package/plugins/runtime-modules/core/widgets/result/config.d.ts +25 -1
  121. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +28 -1
  122. package/plugins/runtime-modules/core/widgets/simple-text/config.js +2 -0
  123. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +1 -1
  124. package/plugins/runtime-modules/core/widgets/simple-text/server.d.ts +4 -1
  125. package/plugins/runtime-modules/core/widgets/simple-text/server.js +3 -3
  126. package/plugins/runtime-modules/core/widgets/table/client.js +1 -1
  127. package/plugins/runtime-modules/core/widgets/table/config.d.ts +80 -3
  128. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  129. package/plugins/runtime-modules/core/widgets/tour-button/client.js +1 -1
  130. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +12 -4
  131. package/plugins/runtime-modules/public/trees/phi-default-pub-contact-page-tree.js +2 -0
  132. package/plugins/runtime-modules/public/trees/phi-default-pub-unsubscribe-page-tree.js +3 -0
  133. package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +2 -1
  134. package/plugins/runtime-modules/revisions/presets.d.ts +53 -2
  135. package/plugins/runtime-modules/revisions/presets.js +16 -12
  136. package/plugins/runtime-modules/revisions/tour.d.ts +43 -0
  137. package/plugins/runtime-modules/revisions/tour.js +51 -0
  138. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +4 -0
  139. package/plugins/runtime-modules/theme/presets.d.ts +36 -4
  140. package/plugins/runtime-modules/theme/tour.d.ts +45 -11
  141. package/plugins/runtime-modules/theme/tour.js +39 -8
  142. package/plugins/runtime-modules/tour/controller/address.js +2 -2
  143. package/plugins/runtime-modules/tour/controller/client.js +43 -2
  144. package/plugins/runtime-modules/tour/controller/definition.js +2 -1
  145. package/server-helpers/cms-request.js +1 -0
  146. package/server-helpers/page-tour.d.ts +10 -3
  147. package/server-helpers/page-tour.js +25 -12
  148. package/server-helpers/translate.d.ts +9 -0
  149. package/server-helpers/translate.js +14 -0
  150. package/styles/controls.css +15 -1
  151. package/styles/root.css +20 -19
  152. package/types/cms-config.d.ts +3 -1
  153. package/types/cms-config.js +3 -3
  154. package/types/cms-plugins.d.ts +31 -4
  155. package/types/core-widget-placements.d.ts +5 -0
  156. package/types/table-widget.d.ts +2 -0
  157. package/types/tour-controller.d.ts +10 -0
  158. package/types/tour-controller.js +13 -0
  159. package/types/tours.d.ts +27 -25
  160. package/types/tours.js +9 -23
  161. package/types/visual-anchors.d.ts +15 -0
  162. package/types/visual-anchors.js +12 -0
  163. package/types.d.ts +2 -0
  164. package/types.js +4 -1
@@ -1,3 +1,4 @@
1
+ import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../../../constants/core-data-provider-keys";
1
2
  import { isPhiRecord } from "../../../../../helpers/is-record";
2
3
  import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
3
4
  import { readPhiContentEntryRecordBinding } from "../../../../../helpers/content-entry-record-binding";
@@ -32,7 +33,13 @@ export const PHI_ENTRY_HEADER_WIDGET_DEFINITION = {
32
33
  icon: "antd:profile",
33
34
  slotSizePolicy: "fill-inline",
34
35
  fields: [
35
- { key: "entry", type: "data-provider", providerKind: "record", label: "Entry" },
36
+ {
37
+ key: "entry",
38
+ type: "data-provider",
39
+ providerKind: "record",
40
+ providerKey: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.contentEntry,
41
+ label: "Entry",
42
+ },
36
43
  { key: "show", type: "flags", label: "Show", options: phiContentEntryPartOptions(PHI_ENTRY_HEADER_PARTS) },
37
44
  {
38
45
  key: "titleLevel",
@@ -1,4 +1,5 @@
1
1
  import { type PhiMarkdownBlock } from "../../../../../components/widgets/shared/markdown-body-client";
2
+ import type { PhiSequenceSettings } from "../../../../../components/widgets/config/sequence-settings";
2
3
  import type { PhiEntryListPresentation } from "./config";
3
4
  import type { PhiContentEntryReaderLabels } from "../../../../../components/widgets/label-sets/content-entries";
4
5
  /**
@@ -53,6 +54,8 @@ export type PhiEntryListWidgetClientProps = {
53
54
  parts: number;
54
55
  /** The list's own heading, drawn only above entries -- an empty related list leaves no heading behind. */
55
56
  title?: string;
57
+ /** How a slideshow moves; only a slideshow is handed one. */
58
+ sequence?: PhiSequenceSettings;
56
59
  /** Whether no entries is said or simply nothing: a related list under an entry says nothing. */
57
60
  emptyBehavior?: "say" | "hide";
58
61
  };
@@ -92,4 +95,4 @@ export declare function PhiEntryBody({ entry, parts, labels, }: {
92
95
  * through one: the Controls are where antd lives, and a server component cannot use them. Nothing here
93
96
  * depends on the visitor, so the first paint already carries every entry.
94
97
  */
95
- export declare function PhiEntryListWidgetClient({ entries, labels, presentation, parts, title, emptyBehavior, }: PhiEntryListWidgetClientProps): import("react").JSX.Element | null;
98
+ export declare function PhiEntryListWidgetClient({ entries, labels, presentation, parts, title, sequence, emptyBehavior, }: PhiEntryListWidgetClientProps): import("react").JSX.Element | null;
@@ -10,6 +10,7 @@ import { PhiLink } from "../../../../../components/navigation/phi-link";
10
10
  import { PhiMarkdownWidgetClient, } from "../../../../../components/widgets/shared/markdown-body-client";
11
11
  import { PhiCollectionLayoutControl } from "../../../../../components/controls/phi-collection-layout-control";
12
12
  import { PhiCardWidgetClient } from "../../../../../components/widgets/shared/card-body-client";
13
+ import { PhiSequenceRun } from "../../../../../components/motion/phi-sequence-run";
13
14
  import { PHI_SURFACE_CARD } from "../../../../../helpers/surface-presets";
14
15
  import { PHI_FONT_SIZE, PHI_SPACE } from "../../../../../theme/antd-css-var-contract";
15
16
  import { hasPhiContentEntryPart, PhiContentEntryPart } from "../../../../../constants/content-entry-parts";
@@ -113,7 +114,7 @@ function PhiEntryArticle({ entry, labels, parts, }) {
113
114
  * through one: the Controls are where antd lives, and a server component cannot use them. Nothing here
114
115
  * depends on the visitor, so the first paint already carries every entry.
115
116
  */
116
- export function PhiEntryListWidgetClient({ entries, labels, presentation, parts, title, emptyBehavior = "say", }) {
117
+ export function PhiEntryListWidgetClient({ entries, labels, presentation, parts, title, sequence, emptyBehavior = "say", }) {
117
118
  if (entries.length === 0) {
118
119
  if (emptyBehavior === "hide")
119
120
  return null;
@@ -125,6 +126,6 @@ export function PhiEntryListWidgetClient({ entries, labels, presentation, parts,
125
126
  * Still an `h2`, in the rule, so the Page's outline keeps it.
126
127
  */
127
128
  const heading = title ? (_jsx(PhiDividerControl, { titlePlacement: "start", style: { margin: 0 }, children: _jsx(PhiTypographyControl, { presentation: "title", level: 2, style: { margin: 0, fontSize: PHI_FONT_SIZE.lg }, children: title }) })) : null;
128
- const body = presentation === "cards" ? (_jsx(PhiCollectionLayoutControl, { mode: "grid", gap: PHI_SPACE.base, minColumnWidth: ENTRY_CARD_MIN_COLUMN_WIDTH, items: entries.map((entry) => _jsx(PhiEntryCard, { entry: entry, parts: parts }, entry.id)) })) : presentation === "compact" ? (_jsx(PhiFlexControl, { vertical: true, gap: PHI_SPACE.base, children: entries.map((entry) => _jsx(PhiEntryLine, { entry: entry, parts: parts }, entry.id)) })) : (_jsx(PhiFlexControl, { vertical: true, gap: PHI_SPACE.lg, children: entries.map((entry, index) => (_jsxs(PhiFlexControl, { vertical: true, gap: PHI_SPACE.lg, children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiEntryArticle, { entry: entry, labels: labels, parts: parts })] }, entry.id))) }));
129
+ const body = presentation === "slideshow" ? (_jsx(PhiSequenceRun, { items: entries.map((entry) => _jsx(PhiEntryCard, { entry: entry, parts: parts }, entry.id)), settings: sequence, labels: labels.sequence })) : presentation === "cards" ? (_jsx(PhiCollectionLayoutControl, { mode: "grid", gap: PHI_SPACE.base, minColumnWidth: ENTRY_CARD_MIN_COLUMN_WIDTH, items: entries.map((entry) => _jsx(PhiEntryCard, { entry: entry, parts: parts }, entry.id)) })) : presentation === "compact" ? (_jsx(PhiFlexControl, { vertical: true, gap: PHI_SPACE.base, children: entries.map((entry) => _jsx(PhiEntryLine, { entry: entry, parts: parts }, entry.id)) })) : (_jsx(PhiFlexControl, { vertical: true, gap: PHI_SPACE.lg, children: entries.map((entry, index) => (_jsxs(PhiFlexControl, { vertical: true, gap: PHI_SPACE.lg, children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiEntryArticle, { entry: entry, labels: labels, parts: parts })] }, entry.id))) }));
129
130
  return heading ? (_jsxs(PhiFlexControl, { vertical: true, gap: PHI_SPACE.base, children: [heading, body] })) : body;
130
131
  }
@@ -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
- options: {
78
- value: string;
79
- label: string;
80
- }[];
81
- heading?: undefined;
82
- description?: undefined;
83
- mode?: undefined;
84
- placeholder?: undefined;
85
- optionsProvider?: undefined;
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
- heading: string;
92
- label: string;
93
- options?: undefined;
94
- description?: undefined;
95
- mode?: undefined;
96
- placeholder?: undefined;
97
- optionsProvider?: undefined;
98
- visibleWhen?: undefined;
99
- providerKind?: undefined;
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: string;
105
- options?: undefined;
106
- heading?: undefined;
107
- mode?: undefined;
108
- placeholder?: undefined;
109
- optionsProvider?: undefined;
110
- visibleWhen?: undefined;
111
- providerKind?: undefined;
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: PhiEntryListWidgetConfig;
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
  };