@phis/ui 0.4.3 → 0.4.4
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/controls/phi-anchor-nav-control.js +4 -1
- package/components/controls/phi-background-control.js +21 -6
- package/components/controls/phi-bullet-list-control.d.ts +7 -2
- package/components/controls/phi-bullet-list-control.js +4 -3
- package/components/controls/phi-color-control.js +4 -2
- package/components/controls/phi-drawer-control-adapter.js +3 -2
- package/components/controls/phi-inline-text-editor.js +7 -1
- package/components/controls/phi-length-control.js +1 -1
- package/components/controls/phi-ribbon-control.d.ts +13 -4
- package/components/controls/phi-ribbon-control.js +10 -6
- package/components/controls/phi-ribbon-wrap-control.d.ts +26 -0
- package/components/controls/phi-ribbon-wrap-control.js +25 -0
- package/components/controls/phi-select-control.js +5 -2
- package/components/controls/phi-series-chart-control.d.ts +48 -0
- package/components/controls/phi-series-chart-control.js +82 -0
- package/components/controls/phi-text-control.js +57 -3
- package/components/controls/phi-tree-control.js +1 -1
- package/components/controls/phi-truncated-hover-text.d.ts +15 -0
- package/components/controls/phi-truncated-hover-text.js +25 -0
- package/components/forms/link-target-form-control.d.ts +1 -1
- package/components/forms/link-target-form-control.js +2 -45
- package/components/forms/phi-form-widget-frame.js +4 -2
- package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
- package/components/navigation/phi-link.js +6 -1
- package/components/regions/clients/cms-region-container-client.js +6 -1
- package/components/regions/phi-cms-region-container.js +3 -0
- package/components/regions/phi-cms-region-shell.d.ts +12 -1
- package/components/regions/phi-cms-region-shell.js +81 -19
- package/components/root/phi-config-provider.d.ts +13 -0
- package/components/root/phi-config-provider.js +12 -1
- package/components/root/phi-root-background.d.ts +7 -0
- package/components/root/phi-root-background.js +20 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/root/phi-shell-chrome-overlay.d.ts +12 -1
- package/components/root/phi-shell-chrome-overlay.js +19 -3
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/shell/use-phi-shell-sticky-top.js +61 -16
- package/components/surface/phi-surface-tone.d.ts +13 -0
- package/components/surface/phi-surface-tone.js +21 -0
- package/components/widgets/client/bullet-list-entries-editor.js +7 -1
- package/components/widgets/client/html-editor.js +1 -1
- package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
- package/components/widgets/client/shared/use-page-reference-options.js +57 -0
- package/components/widgets/config/background.d.ts +32 -1
- package/components/widgets/config/background.js +41 -2
- package/components/widgets/label-sets/background.js +2 -0
- package/components/widgets/label-types/background.d.ts +1 -0
- package/components/widgets/label-types/background.js +1 -0
- package/components/widgets/shared/bullet-list-vocabulary.d.ts +10 -0
- package/components/widgets/shared/bullet-list-vocabulary.js +5 -2
- package/components/widgets/shared/card-body-client.d.ts +5 -3
- package/components/widgets/shared/card-body-client.js +49 -6
- package/components/widgets/shared/card-vocabulary.d.ts +12 -2
- package/components/widgets/shared/card-vocabulary.js +7 -0
- package/components/widgets/shared/markdown-body-client.js +39 -10
- package/helpers/cms-container-chrome.js +6 -1
- package/helpers/locale.d.ts +8 -0
- package/helpers/locale.js +18 -0
- package/helpers/shell-region-style.js +2 -1
- package/helpers/surface-style.d.ts +12 -1
- package/helpers/surface-style.js +28 -2
- package/module-dashboard-cards.d.ts +1 -1
- package/module-dashboard-cards.js +1 -1
- package/package.json +1 -1
- package/plugins/runtime-modules/area-definitions.d.ts +0 -42
- package/plugins/runtime-modules/area-definitions.js +3 -8
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +20 -1
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +3 -2
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +25 -15
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +4 -0
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +15 -4
- package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
- package/plugins/runtime-modules/client-authoring-module.js +13 -3
- package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
- package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
- package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +6 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +19 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +13 -3
- package/plugins/runtime-modules/core/widgets/card/server.js +1 -0
- package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/description/editor.js +3 -2
- package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +9 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
- package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
- package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -0
- package/plugins/runtime-modules/dashboard/card-rows.d.ts +3 -1
- package/plugins/runtime-modules/dashboard/card-rows.js +30 -2
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +29 -7
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +19 -15
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +5 -9
- package/server-helpers/cms-link-targets.js +6 -0
- package/styles/controls.css +64 -2
- package/styles/layout.css +45 -2
- package/styles/shell.css +73 -0
- package/theme/phi-antd-token-resolver.js +20 -1
- package/theme/phi-theme-tokens.d.ts +1 -1
- package/theme/phi-theme-tokens.js +1 -0
- package/theme/phi-theme.d.ts +5 -0
- package/theme/phi-theme.js +21 -0
- package/theme/phi-tokens.d.ts +16 -15
- package/theme/phi-tokens.js +16 -15
- package/types/cms-plugins.d.ts +2 -0
- package/types/dashboard-cards.d.ts +39 -4
- package/types/dashboard-cards.js +6 -0
- package/types/site-theme.d.ts +10 -2
|
@@ -28,7 +28,7 @@ export function PhiHeaderNavigationWidgetClient({ runtime, items, menuTheme, hei
|
|
|
28
28
|
minHeight: 0,
|
|
29
29
|
overflow: "hidden",
|
|
30
30
|
whiteSpace: "nowrap",
|
|
31
|
-
fontSize: token.
|
|
31
|
+
fontSize: token.fontSize,
|
|
32
32
|
}, children: items.map((item) => (_jsx("span", { style: {
|
|
33
33
|
display: "inline-flex",
|
|
34
34
|
alignItems: "center",
|
|
@@ -46,7 +46,7 @@ export function PhiHeaderNavigationWidgetClient({ runtime, items, menuTheme, hei
|
|
|
46
46
|
minHeight: 0,
|
|
47
47
|
flex: 1,
|
|
48
48
|
justifyContent: align === "center" ? "center" : "flex-start",
|
|
49
|
-
}, children: _jsx(PhiMenuControl, { mode: "horizontal", menuTheme: menuTheme, selectedKeys: selectedKeys, items: menuItems, fontSize: token.
|
|
49
|
+
}, children: _jsx(PhiMenuControl, { mode: "horizontal", menuTheme: menuTheme, selectedKeys: selectedKeys, items: menuItems, fontSize: token.fontSize, style: {
|
|
50
50
|
display: "flex",
|
|
51
51
|
alignItems: "center",
|
|
52
52
|
justifyContent: align === "center" ? "center" : "flex-start",
|
|
@@ -11,7 +11,7 @@ export function PhiHtmlWidgetClient({ blockId, config, }) {
|
|
|
11
11
|
const [fontSizeOverride, setFontSizeOverride] = useState(null);
|
|
12
12
|
const html = typeof config?.html === "string" ? config.html.trim() : "";
|
|
13
13
|
const resolvedFontFamily = resolvePhiWidgetFontFamily(fontFamilyOverride ?? config?.fontFamily, fonts, token);
|
|
14
|
-
const resolvedFontSize = resolvePhiWidgetFontSize(fontSizeOverride ?? config?.fontSize, token, "
|
|
14
|
+
const resolvedFontSize = resolvePhiWidgetFontSize(fontSizeOverride ?? config?.fontSize, token, "base");
|
|
15
15
|
const receiver = createPhiRenderableBlockReceiver("widget", blockId);
|
|
16
16
|
usePhiRenderableBlockSignalListener(receiver, (signal) => {
|
|
17
17
|
if (signal.channel === "fontFamily" && signal.action === "change") {
|
|
@@ -44,8 +44,15 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
|
|
|
44
44
|
textAlign: "start";
|
|
45
45
|
textBlockSpacingBefore: "none";
|
|
46
46
|
textBlockSpacingAfter: "sm";
|
|
47
|
-
headingBlockSpacingBefore: "
|
|
47
|
+
headingBlockSpacingBefore: "sm";
|
|
48
48
|
headingBlockSpacingAfter: "sm";
|
|
49
|
+
headingOffset: number;
|
|
50
|
+
list: {
|
|
51
|
+
level1: "dot";
|
|
52
|
+
level2: "circle";
|
|
53
|
+
level3: "dash";
|
|
54
|
+
gap: "xs";
|
|
55
|
+
};
|
|
49
56
|
};
|
|
50
57
|
contentBinding: {
|
|
51
58
|
storage: "markdown";
|
|
@@ -57,7 +64,318 @@ export declare const PHI_MARKDOWN_WIDGET_DEFINITION: {
|
|
|
57
64
|
value: string;
|
|
58
65
|
};
|
|
59
66
|
};
|
|
60
|
-
fields:
|
|
67
|
+
fields: (({
|
|
68
|
+
key: string;
|
|
69
|
+
label: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
required?: boolean;
|
|
72
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
73
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
74
|
+
heading?: string;
|
|
75
|
+
} & {
|
|
76
|
+
type: "string" | "url" | "icon";
|
|
77
|
+
emptyValue?: "";
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
}) | ({
|
|
80
|
+
key: string;
|
|
81
|
+
label: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
required?: boolean;
|
|
84
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
85
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
86
|
+
heading?: string;
|
|
87
|
+
} & {
|
|
88
|
+
type: "link-target";
|
|
89
|
+
clearsWhenEmpty?: readonly string[];
|
|
90
|
+
}) | ({
|
|
91
|
+
key: string;
|
|
92
|
+
label: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
required?: boolean;
|
|
95
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
96
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
97
|
+
heading?: string;
|
|
98
|
+
} & {
|
|
99
|
+
type: "readonly";
|
|
100
|
+
}) | ({
|
|
101
|
+
key: string;
|
|
102
|
+
label: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
required?: boolean;
|
|
105
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
106
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
107
|
+
heading?: string;
|
|
108
|
+
} & {
|
|
109
|
+
type: "data-provider";
|
|
110
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
111
|
+
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
112
|
+
}) | ({
|
|
113
|
+
key: string;
|
|
114
|
+
label: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
required?: boolean;
|
|
117
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
118
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
119
|
+
heading?: string;
|
|
120
|
+
} & {
|
|
121
|
+
type: "calendar-adapter";
|
|
122
|
+
}) | ({
|
|
123
|
+
key: string;
|
|
124
|
+
label: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
required?: boolean;
|
|
127
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
128
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
129
|
+
heading?: string;
|
|
130
|
+
} & {
|
|
131
|
+
type: "video-provider";
|
|
132
|
+
}) | ({
|
|
133
|
+
key: string;
|
|
134
|
+
label: string;
|
|
135
|
+
description?: string;
|
|
136
|
+
required?: boolean;
|
|
137
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
138
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
139
|
+
heading?: string;
|
|
140
|
+
} & {
|
|
141
|
+
type: "dimension";
|
|
142
|
+
widthKey?: string;
|
|
143
|
+
heightKey?: string;
|
|
144
|
+
widthPlaceholder?: string;
|
|
145
|
+
heightPlaceholder?: string;
|
|
146
|
+
patchOnChange?: Record<string, unknown>;
|
|
147
|
+
}) | ({
|
|
148
|
+
key: string;
|
|
149
|
+
label: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
required?: boolean;
|
|
152
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
153
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
154
|
+
heading?: string;
|
|
155
|
+
} & {
|
|
156
|
+
type: "length";
|
|
157
|
+
min?: number;
|
|
158
|
+
max?: number;
|
|
159
|
+
step?: number;
|
|
160
|
+
precision?: number;
|
|
161
|
+
}) | ({
|
|
162
|
+
key: string;
|
|
163
|
+
label: string;
|
|
164
|
+
description?: string;
|
|
165
|
+
required?: boolean;
|
|
166
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
167
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
168
|
+
heading?: string;
|
|
169
|
+
} & {
|
|
170
|
+
type: "radius";
|
|
171
|
+
topLeftKey: string;
|
|
172
|
+
topRightKey: string;
|
|
173
|
+
bottomLeftKey: string;
|
|
174
|
+
bottomRightKey: string;
|
|
175
|
+
}) | ({
|
|
176
|
+
key: string;
|
|
177
|
+
label: string;
|
|
178
|
+
description?: string;
|
|
179
|
+
required?: boolean;
|
|
180
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
181
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
182
|
+
heading?: string;
|
|
183
|
+
} & {
|
|
184
|
+
type: "padding";
|
|
185
|
+
paddingKey?: string;
|
|
186
|
+
gapKey?: string;
|
|
187
|
+
paddingTopKey?: string;
|
|
188
|
+
paddingRightKey?: string;
|
|
189
|
+
paddingBottomKey?: string;
|
|
190
|
+
paddingLeftKey?: string;
|
|
191
|
+
section?: string;
|
|
192
|
+
}) | ({
|
|
193
|
+
key: string;
|
|
194
|
+
label: string;
|
|
195
|
+
description?: string;
|
|
196
|
+
required?: boolean;
|
|
197
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
198
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
199
|
+
heading?: string;
|
|
200
|
+
} & {
|
|
201
|
+
type: "color";
|
|
202
|
+
mode?: import("../../../../../types").PhiCmsConfigFieldColorMode;
|
|
203
|
+
defaultToken?: import("../../../../../theme/phi-theme-tokens").PhiThemeTokenKey;
|
|
204
|
+
section?: string;
|
|
205
|
+
}) | ({
|
|
206
|
+
key: string;
|
|
207
|
+
label: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
required?: boolean;
|
|
210
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
211
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
212
|
+
heading?: string;
|
|
213
|
+
} & {
|
|
214
|
+
type: "boolean";
|
|
215
|
+
}) | ({
|
|
216
|
+
key: string;
|
|
217
|
+
label: string;
|
|
218
|
+
description?: string;
|
|
219
|
+
required?: boolean;
|
|
220
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
221
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
222
|
+
heading?: string;
|
|
223
|
+
} & {
|
|
224
|
+
type: "image";
|
|
225
|
+
}) | ({
|
|
226
|
+
key: string;
|
|
227
|
+
label: string;
|
|
228
|
+
description?: string;
|
|
229
|
+
required?: boolean;
|
|
230
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
231
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
232
|
+
heading?: string;
|
|
233
|
+
} & {
|
|
234
|
+
type: "slot-texts";
|
|
235
|
+
}) | ({
|
|
236
|
+
key: string;
|
|
237
|
+
label: string;
|
|
238
|
+
description?: string;
|
|
239
|
+
required?: boolean;
|
|
240
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
241
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
242
|
+
heading?: string;
|
|
243
|
+
} & {
|
|
244
|
+
type: "number-list";
|
|
245
|
+
min?: number;
|
|
246
|
+
}) | ({
|
|
247
|
+
key: string;
|
|
248
|
+
label: string;
|
|
249
|
+
description?: string;
|
|
250
|
+
required?: boolean;
|
|
251
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
252
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
253
|
+
heading?: string;
|
|
254
|
+
} & {
|
|
255
|
+
type: "flags";
|
|
256
|
+
options: readonly {
|
|
257
|
+
value: number;
|
|
258
|
+
label: string;
|
|
259
|
+
}[];
|
|
260
|
+
}) | ({
|
|
261
|
+
key: string;
|
|
262
|
+
label: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
required?: boolean;
|
|
265
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
266
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
267
|
+
heading?: string;
|
|
268
|
+
} & {
|
|
269
|
+
type: "number";
|
|
270
|
+
min?: number;
|
|
271
|
+
max?: number;
|
|
272
|
+
step?: number;
|
|
273
|
+
precision?: number;
|
|
274
|
+
prefix?: string;
|
|
275
|
+
presentation?: "slider";
|
|
276
|
+
suffix?: string;
|
|
277
|
+
}) | ({
|
|
278
|
+
key: string;
|
|
279
|
+
label: string;
|
|
280
|
+
description?: string;
|
|
281
|
+
required?: boolean;
|
|
282
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
283
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
284
|
+
heading?: string;
|
|
285
|
+
} & {
|
|
286
|
+
type: "choice";
|
|
287
|
+
valueType: "number";
|
|
288
|
+
options: import("@phis/contracts/controls").PhiControlOption<number>[];
|
|
289
|
+
emptyOption?: import("@phis/contracts/controls").PhiControlOption;
|
|
290
|
+
emptyValue?: null | undefined;
|
|
291
|
+
placeholder?: string;
|
|
292
|
+
mode?: never;
|
|
293
|
+
presentation?: never;
|
|
294
|
+
optionsProvider?: never;
|
|
295
|
+
allowCustom?: never;
|
|
296
|
+
createBehavior?: never;
|
|
297
|
+
filter?: never;
|
|
298
|
+
patchOnChange?: never;
|
|
299
|
+
optionPresets?: never;
|
|
300
|
+
}) | ({
|
|
301
|
+
key: string;
|
|
302
|
+
label: string;
|
|
303
|
+
description?: string;
|
|
304
|
+
required?: boolean;
|
|
305
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
306
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
307
|
+
heading?: string;
|
|
308
|
+
} & {
|
|
309
|
+
type: "choice";
|
|
310
|
+
mode?: import("../../../../../types").PhiCmsConfigFieldChoiceMode;
|
|
311
|
+
valueType?: Exclude<import("../../../../../types").PhiCmsConfigFieldChoiceValueType, "number">;
|
|
312
|
+
presentation?: import("../../../../../types").PhiCmsConfigFieldChoicePresentation;
|
|
313
|
+
options?: import("@phis/contracts/controls").PhiControlOption[];
|
|
314
|
+
optionsProvider?: import("@phis/contracts/controls").PhiControlOptionsProviderConfig;
|
|
315
|
+
allowCustom?: boolean;
|
|
316
|
+
createBehavior?: import("../../../../../types").PhiCmsConfigFieldChoiceCreateBehavior;
|
|
317
|
+
placeholder?: string;
|
|
318
|
+
filter?: import("../../../../../types").PhiCmsConfigFieldChoiceFilter;
|
|
319
|
+
emptyOption?: import("@phis/contracts/controls").PhiControlOption;
|
|
320
|
+
emptyValue?: null | undefined;
|
|
321
|
+
patchOnChange?: Record<string, unknown>;
|
|
322
|
+
optionPresets?: import("../../../../../types/cms-plugins").PhiCmsConfigFieldOptionPresets;
|
|
323
|
+
}) | ({
|
|
324
|
+
key: string;
|
|
325
|
+
label: string;
|
|
326
|
+
description?: string;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
329
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
330
|
+
heading?: string;
|
|
331
|
+
} & {
|
|
332
|
+
type: "collection";
|
|
333
|
+
itemKeyField: string;
|
|
334
|
+
itemLabelField?: string;
|
|
335
|
+
itemFields: import("../../../../../types").PhiCmsConfigField[];
|
|
336
|
+
defaultItem?: Record<string, unknown>;
|
|
337
|
+
addLabel?: string;
|
|
338
|
+
emptyLabel?: string;
|
|
339
|
+
minItems?: number;
|
|
340
|
+
maxItems?: number;
|
|
341
|
+
reorderable?: boolean;
|
|
342
|
+
presentation?: import("../../../../../types").PhiCmsConfigFieldCollectionPresentation;
|
|
343
|
+
editLabel?: string;
|
|
344
|
+
}) | ({
|
|
345
|
+
key: string;
|
|
346
|
+
label: string;
|
|
347
|
+
description?: string;
|
|
348
|
+
required?: boolean;
|
|
349
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
350
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
351
|
+
heading?: string;
|
|
352
|
+
} & {
|
|
353
|
+
type: "surface";
|
|
354
|
+
tone?: false;
|
|
355
|
+
}) | ({
|
|
356
|
+
key: string;
|
|
357
|
+
label: string;
|
|
358
|
+
description?: string;
|
|
359
|
+
required?: boolean;
|
|
360
|
+
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
361
|
+
visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
|
|
362
|
+
heading?: string;
|
|
363
|
+
} & {
|
|
364
|
+
type: "grid-placement" | "column-count";
|
|
365
|
+
section?: string;
|
|
366
|
+
}) | {
|
|
367
|
+
key: string;
|
|
368
|
+
type: "choice";
|
|
369
|
+
label: string;
|
|
370
|
+
emptyOption: {
|
|
371
|
+
value: string;
|
|
372
|
+
label: string;
|
|
373
|
+
};
|
|
374
|
+
options: {
|
|
375
|
+
value: PhiMarkdownImageFloat;
|
|
376
|
+
label: string;
|
|
377
|
+
}[];
|
|
378
|
+
})[];
|
|
61
379
|
parseConfig: typeof parsePhiCmsMarkdownWidgetConfig;
|
|
62
380
|
};
|
|
63
381
|
export declare const PHI_MARKDOWN_WIDGET_PLUGIN_TYPE: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
2
2
|
import { PHI_SPACING_SCALE_KEYS } from "../../../../../components/widgets/config/spacing-options";
|
|
3
3
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
4
|
-
import { buildPhiBulletListFields, readPhiBulletListStyle, } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
|
|
4
|
+
import { buildPhiBulletListFields, PHI_BULLET_LIST_DEFAULT_STYLE, readPhiBulletListStyle, } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
|
|
5
5
|
import { readNumber, readRenderableBlockConfig, readString, } from "../../../../../components/widgets/config/parser-primitives";
|
|
6
6
|
const PHI_MARKDOWN_TEXT_ALIGN_OPTIONS = [
|
|
7
7
|
{ value: "start", label: "Start" },
|
|
@@ -81,8 +81,11 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
81
81
|
textAlign: "start",
|
|
82
82
|
textBlockSpacingBefore: "none",
|
|
83
83
|
textBlockSpacingAfter: "sm",
|
|
84
|
-
headingBlockSpacingBefore: "
|
|
84
|
+
headingBlockSpacingBefore: "sm",
|
|
85
85
|
headingBlockSpacingAfter: "sm",
|
|
86
|
+
headingOffset: 0,
|
|
87
|
+
// What the list draws with when nothing is set, so the Inspector shows it rather than empty fields.
|
|
88
|
+
list: { ...PHI_BULLET_LIST_DEFAULT_STYLE },
|
|
86
89
|
},
|
|
87
90
|
contentBinding: {
|
|
88
91
|
storage: "markdown",
|
|
@@ -127,6 +130,8 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
127
130
|
key: "imageFloat",
|
|
128
131
|
type: "choice",
|
|
129
132
|
label: "Image Float",
|
|
133
|
+
// No float is the default and stores nothing; the line says so instead of an empty picker.
|
|
134
|
+
emptyOption: { value: "none", label: "None" },
|
|
130
135
|
options: PHI_MARKDOWN_IMAGE_FLOAT_OPTIONS,
|
|
131
136
|
},
|
|
132
137
|
{
|
|
@@ -157,12 +162,21 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
|
|
|
157
162
|
key: "headingOffset",
|
|
158
163
|
type: "number",
|
|
159
164
|
label: "Heading Offset",
|
|
165
|
+
description: "Moves every heading of the text down by this many levels: at 1, a # heading is drawn as H2, ## as H3, and so on. For a text that stands under a page title of its own, so its first heading does not compete with it.",
|
|
160
166
|
min: 0,
|
|
161
167
|
max: PHI_MARKDOWN_HEADING_OFFSET_MAX,
|
|
162
168
|
precision: 0,
|
|
163
169
|
},
|
|
164
|
-
{
|
|
165
|
-
|
|
170
|
+
{
|
|
171
|
+
key: "tocKey",
|
|
172
|
+
type: "string",
|
|
173
|
+
label: "TOC Key",
|
|
174
|
+
// Empty is no key, and a TOC on "Auto" connects to the text all the same.
|
|
175
|
+
placeholder: "Auto",
|
|
176
|
+
description: "A name for this text's table of contents. A Markdown TOC widget set to Binding Mode \"Target\" with the same TOC Key lists this text's headings and no other's. Leave it empty while the page has one Markdown text: a TOC on \"Auto\" finds it by itself.",
|
|
177
|
+
},
|
|
178
|
+
// The markers are an unordered list's: a `1.` list counts, whatever its level's marker says.
|
|
179
|
+
...buildPhiBulletListFields("list", "Unordered Lists"),
|
|
166
180
|
],
|
|
167
181
|
parseConfig: parsePhiCmsMarkdownWidgetConfig,
|
|
168
182
|
};
|
|
@@ -69,7 +69,15 @@ export function PhiMarkdownWidgetEditor({ blockId, config, onChange, onSourceLoc
|
|
|
69
69
|
* On the field's own text, not on `style`: `style` places the control as a whole, and with a clear
|
|
70
70
|
* button the control is a wrapper around the textarea, which is where the text is.
|
|
71
71
|
*/
|
|
72
|
-
inputStyle:
|
|
72
|
+
inputStyle: {
|
|
73
|
+
...(config?.textAlign ? { textAlign: config.textAlign } : {}),
|
|
74
|
+
/*
|
|
75
|
+
* The text's own padding, stated, as a single-line field's would be: half of what the first line
|
|
76
|
+
* leaves of a control's height. Stated, the clear button finds the first line by it, as it does in
|
|
77
|
+
* every field that states one; left to Ant Design it hung at its own offset, half a line above.
|
|
78
|
+
*/
|
|
79
|
+
paddingBlock: "calc((var(--ant-control-height) - 1lh) / 2)",
|
|
80
|
+
}, style: {
|
|
73
81
|
/*
|
|
74
82
|
* As wide as the slot: the Widget fills its inline axis (`fill-inline`), so the frame decides the
|
|
75
83
|
* width and the editor takes it. A fixed 520px here dated from when the Widget was intrinsic and
|
|
@@ -6,11 +6,16 @@ import { usePhiConfig } from "../../../../../components/root/phi-config-provider
|
|
|
6
6
|
import { PhiAnchorNavControl } from "../../../../../components/controls/phi-anchor-nav-control";
|
|
7
7
|
import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-control";
|
|
8
8
|
import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
|
|
9
|
+
/*
|
|
10
|
+
* Indented by depth below the shallowest heading listed, not below `h1`: a contents that starts at `h3`
|
|
11
|
+
* (a document whose headings moved down under a page title) would otherwise stand two steps off its line.
|
|
12
|
+
*/
|
|
9
13
|
function buildAnchorItems(headings, indent) {
|
|
14
|
+
const topLevel = headings.reduce((lowest, heading) => Math.min(lowest, heading.level), Infinity);
|
|
10
15
|
return headings.map((heading) => ({
|
|
11
16
|
key: heading.id,
|
|
12
17
|
href: `#${heading.id}`,
|
|
13
|
-
title: (_jsx("span", { style: { display: "block", paddingInlineStart: (heading.level -
|
|
18
|
+
title: (_jsx("span", { style: { display: "block", paddingInlineStart: (heading.level - topLevel) * indent, minWidth: 0 }, children: _jsx(PhiTypographyControl, { ellipsis: { tooltip: heading.text }, style: { display: "block", color: "inherit", fontSize: "inherit", lineHeight: "inherit" }, children: heading.text }) })),
|
|
14
19
|
}));
|
|
15
20
|
}
|
|
16
21
|
function filterHeadings(headings, config) {
|
|
@@ -39,9 +39,11 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
39
39
|
filter?: undefined;
|
|
40
40
|
placeholder?: undefined;
|
|
41
41
|
visibleWhen?: undefined;
|
|
42
|
+
description?: undefined;
|
|
42
43
|
min?: undefined;
|
|
43
44
|
max?: undefined;
|
|
44
45
|
precision?: undefined;
|
|
46
|
+
prefix?: undefined;
|
|
45
47
|
} | {
|
|
46
48
|
key: string;
|
|
47
49
|
type: "choice";
|
|
@@ -55,13 +57,16 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
55
57
|
equals: string;
|
|
56
58
|
};
|
|
57
59
|
options?: undefined;
|
|
60
|
+
description?: undefined;
|
|
58
61
|
min?: undefined;
|
|
59
62
|
max?: undefined;
|
|
60
63
|
precision?: undefined;
|
|
64
|
+
prefix?: undefined;
|
|
61
65
|
} | {
|
|
62
66
|
key: string;
|
|
63
67
|
type: "string";
|
|
64
68
|
label: string;
|
|
69
|
+
description: string;
|
|
65
70
|
visibleWhen: {
|
|
66
71
|
field: string;
|
|
67
72
|
equals: string;
|
|
@@ -72,6 +77,7 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
72
77
|
min?: undefined;
|
|
73
78
|
max?: undefined;
|
|
74
79
|
precision?: undefined;
|
|
80
|
+
prefix?: undefined;
|
|
75
81
|
} | {
|
|
76
82
|
key: string;
|
|
77
83
|
type: "string";
|
|
@@ -80,9 +86,11 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
80
86
|
filter?: undefined;
|
|
81
87
|
placeholder?: undefined;
|
|
82
88
|
visibleWhen?: undefined;
|
|
89
|
+
description?: undefined;
|
|
83
90
|
min?: undefined;
|
|
84
91
|
max?: undefined;
|
|
85
92
|
precision?: undefined;
|
|
93
|
+
prefix?: undefined;
|
|
86
94
|
} | {
|
|
87
95
|
key: string;
|
|
88
96
|
type: "number";
|
|
@@ -94,10 +102,14 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
94
102
|
filter?: undefined;
|
|
95
103
|
placeholder?: undefined;
|
|
96
104
|
visibleWhen?: undefined;
|
|
105
|
+
description?: undefined;
|
|
106
|
+
prefix?: undefined;
|
|
97
107
|
} | {
|
|
98
108
|
key: string;
|
|
99
109
|
type: "number";
|
|
100
110
|
label: string;
|
|
111
|
+
description: string;
|
|
112
|
+
prefix: string;
|
|
101
113
|
options?: undefined;
|
|
102
114
|
filter?: undefined;
|
|
103
115
|
placeholder?: undefined;
|
|
@@ -113,9 +125,11 @@ export declare const PHI_MARKDOWN_TOC_WIDGET_DEFINITION: {
|
|
|
113
125
|
filter?: undefined;
|
|
114
126
|
placeholder?: undefined;
|
|
115
127
|
visibleWhen?: undefined;
|
|
128
|
+
description?: undefined;
|
|
116
129
|
min?: undefined;
|
|
117
130
|
max?: undefined;
|
|
118
131
|
precision?: undefined;
|
|
132
|
+
prefix?: undefined;
|
|
119
133
|
})[];
|
|
120
134
|
parseConfig: typeof parsePhiCmsMarkdownTocWidgetConfig;
|
|
121
135
|
};
|
|
@@ -58,11 +58,23 @@ export const PHI_MARKDOWN_TOC_WIDGET_DEFINITION = {
|
|
|
58
58
|
placeholder: "Select widget",
|
|
59
59
|
visibleWhen: { field: "bindingMode", equals: "target" },
|
|
60
60
|
},
|
|
61
|
-
{
|
|
61
|
+
{
|
|
62
|
+
key: "tocKey",
|
|
63
|
+
type: "string",
|
|
64
|
+
label: "TOC Key",
|
|
65
|
+
description: "The TOC Key of the Markdown widget whose headings this table of contents lists, as set in that widget's settings. Useful when a page has several Markdown texts; a Markdown Widget picked above narrows it to that one.",
|
|
66
|
+
visibleWhen: { field: "bindingMode", equals: "target" },
|
|
67
|
+
},
|
|
62
68
|
{ key: "title", type: "string", label: "Title" },
|
|
63
69
|
{ key: "minLevel", type: "number", label: "Min Heading Level", min: 1, max: 6, precision: 0 },
|
|
64
70
|
{ key: "maxLevel", type: "number", label: "Max Heading Level", min: 1, max: 6, precision: 0 },
|
|
65
|
-
{
|
|
71
|
+
{
|
|
72
|
+
key: "offsetTop",
|
|
73
|
+
type: "number",
|
|
74
|
+
label: "Offset Top",
|
|
75
|
+
description: "How far below the window's top edge a heading stands after a click in the contents, in pixels. Set it to the height of whatever stays fixed at the top, such as a sticky header, so the heading is not hidden beneath it.",
|
|
76
|
+
prefix: "px",
|
|
77
|
+
},
|
|
66
78
|
{ key: "showTitle", type: "boolean", label: "Show Title" },
|
|
67
79
|
],
|
|
68
80
|
parseConfig: parsePhiCmsMarkdownTocWidgetConfig,
|
|
@@ -4,7 +4,8 @@ import { resolvePhiBuilderAreaAsCmsArea, } from "../../../../../constants/cms-ar
|
|
|
4
4
|
import { getPhiBuilderNavigationDefaultScopeKey, createPhiBuilderNavigationPageLookup, resolvePhiBuilderNavigationPageTargets, } from "../../../../../helpers/cms-navigation-catalog";
|
|
5
5
|
import { PhiQuickLinksWidgetClient } from "./client";
|
|
6
6
|
import { PHI_QUICK_LINKS_WIDGET_DEFINITION } from "./config";
|
|
7
|
-
import {
|
|
7
|
+
import { mapPhiNavItemsToQuickLinksItems } from "./items";
|
|
8
|
+
import { mapPhiBuilderNavigationItemsToNavItems } from "../../../../../components/widgets/builder/navigation-items";
|
|
8
9
|
function PhiQuickLinksWidgetBuilderEditor({ runtime, config, canvas, }) {
|
|
9
10
|
if (!canvas.catalogHydrated) {
|
|
10
11
|
return null;
|
|
@@ -15,7 +16,11 @@ function PhiQuickLinksWidgetBuilderEditor({ runtime, config, canvas, }) {
|
|
|
15
16
|
if (!navigation) {
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/*
|
|
20
|
+
* The live render's path: the draft's items as the navigation the Site would serve -- hidden ones left
|
|
21
|
+
* out -- then mapped to links the way the server maps them, so the canvas shows what the page shows.
|
|
22
|
+
*/
|
|
23
|
+
const items = mapPhiNavItemsToQuickLinksItems(mapPhiBuilderNavigationItemsToNavItems(resolvePhiBuilderNavigationPageTargets(currentCmsArea, navigation.items, createPhiBuilderNavigationPageLookup(canvas.pageCatalogForArea))), runtime.locale.current, currentCmsArea, false);
|
|
19
24
|
return (_jsx(PhiQuickLinksWidgetClient, { labels: { title: config.title }, config: {
|
|
20
25
|
columns: config.columns ?? 2,
|
|
21
26
|
separator: config.separator ?? true,
|
|
@@ -76,8 +76,8 @@ export function PhiQuickLinksWidgetClient({ labels, config, }) {
|
|
|
76
76
|
width: "100%",
|
|
77
77
|
minWidth: 0,
|
|
78
78
|
color: "inherit",
|
|
79
|
-
fontSize: token.
|
|
80
|
-
lineHeight: token.
|
|
79
|
+
fontSize: token.fontSize,
|
|
80
|
+
lineHeight: token.lineHeight,
|
|
81
81
|
}, children: labels.title })) : null, _jsx("div", { style: {
|
|
82
82
|
display: "grid",
|
|
83
83
|
gridTemplateColumns: `repeat(${groupedItems.length}, minmax(0, 1fr))`,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type PhiBuilderNavigationItem } from "../../../../../helpers/cms-navigation-catalog";
|
|
2
1
|
import type { PhiNavItem } from "../../../../../components/shell/shell-types";
|
|
3
2
|
import type { PhiQuickLinksWidgetItem } from "./client";
|
|
4
3
|
export declare function mapPhiNavItemsToQuickLinksItems(items: PhiNavItem[], locale: string, area: string, interactive?: boolean): PhiQuickLinksWidgetItem[];
|
|
5
|
-
export declare function mapPhiBuilderNavigationItemsToQuickLinksItems(items: PhiBuilderNavigationItem[], locale: string, area: string): PhiQuickLinksWidgetItem[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolvePhiNavHref } from "../../../../../helpers/locale";
|
|
2
|
-
import {} from "../../../../../helpers/cms-navigation-catalog";
|
|
3
2
|
export function mapPhiNavItemsToQuickLinksItems(items, locale, area, interactive = true) {
|
|
4
3
|
return items
|
|
5
4
|
.filter((item) => !item.separator && Boolean(item.href))
|
|
@@ -11,17 +10,3 @@ export function mapPhiNavItemsToQuickLinksItems(items, locale, area, interactive
|
|
|
11
10
|
newTab: interactive ? item.newTab : false,
|
|
12
11
|
}));
|
|
13
12
|
}
|
|
14
|
-
function flattenPhiBuilderNavigationItems(items) {
|
|
15
|
-
return items.flatMap((item) => [item, ...(Array.isArray(item.children) ? flattenPhiBuilderNavigationItems(item.children) : [])]);
|
|
16
|
-
}
|
|
17
|
-
export function mapPhiBuilderNavigationItemsToQuickLinksItems(items, locale, area) {
|
|
18
|
-
return flattenPhiBuilderNavigationItems(items)
|
|
19
|
-
.filter((item) => item.href !== null)
|
|
20
|
-
.map((item) => ({
|
|
21
|
-
label: item.label,
|
|
22
|
-
href: resolvePhiNavHref(locale, area, item.href),
|
|
23
|
-
icon: item.icon ?? undefined,
|
|
24
|
-
external: false,
|
|
25
|
-
newTab: false,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
@@ -21,7 +21,7 @@ function PhiSidebarNavigationWidgetEditor({ runtime, config, canvas, }) {
|
|
|
21
21
|
export const PHI_SIDEBAR_NAVIGATION_WIDGET_BUILDER_PLUGIN = {
|
|
22
22
|
...PHI_SIDEBAR_NAVIGATION_WIDGET_DEFINITION,
|
|
23
23
|
renderEditor: ({ runtime, config, authoring }) => authoring ? (_jsx(PhiSidebarNavigationWidgetEditor, { runtime: runtime, config: config, canvas: authoring.canvas })) : null,
|
|
24
|
-
renderEditorTools: ({ config, authoring }) => authoring?.updateConfig ? (_jsx(PhiWidgetTypographyToolButton, { fontFamily: config.fontFamily, fontSize: config.fontSize, defaultFontSize: "
|
|
24
|
+
renderEditorTools: ({ config, authoring }) => authoring?.updateConfig ? (_jsx(PhiWidgetTypographyToolButton, { fontFamily: config.fontFamily, fontSize: config.fontSize, defaultFontSize: "base", ariaLabel: "Sidebar navigation typography", onChange: ({ fontFamily, fontSize }) => authoring.updateConfig?.({
|
|
25
25
|
...(fontFamily !== undefined ? { fontFamily: fontFamily ?? undefined } : {}),
|
|
26
26
|
...(fontSize !== undefined ? { fontSize: fontSize ?? undefined } : {}),
|
|
27
27
|
}) })) : null,
|
|
@@ -33,7 +33,7 @@ function usePhiSidebarMenuPresentation(config) {
|
|
|
33
33
|
const sider = usePhiSiderContext();
|
|
34
34
|
return {
|
|
35
35
|
fontFamily: resolvePhiWidgetFontFamily(config?.fontFamily, fonts, token),
|
|
36
|
-
fontSize: resolvePhiWidgetFontSize(config?.fontSize, token, "
|
|
36
|
+
fontSize: resolvePhiWidgetFontSize(config?.fontSize, token, "base"),
|
|
37
37
|
collapsed: sider?.collapsed ?? false,
|
|
38
38
|
collapsedWidth: sider?.collapsedWidth ?? 40,
|
|
39
39
|
};
|