@phis/ui 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/cms/plugins.d.ts +1 -0
- package/cms/plugins.js +2 -0
- package/components/cms/phi-cms-root-layout.js +30 -1
- package/components/controls/phi-background-control.d.ts +6 -1
- package/components/controls/phi-background-control.js +12 -4
- package/components/controls/phi-button-control.d.ts +13 -1
- package/components/controls/phi-button-control.js +21 -3
- package/components/controls/phi-dropdown-control.js +2 -2
- package/components/controls/phi-media-asset-tile-control.js +10 -10
- package/components/controls/phi-progress-control.d.ts +10 -2
- package/components/controls/phi-progress-control.js +6 -2
- package/components/controls/phi-ribbon-control.d.ts +4 -1
- package/components/controls/phi-ribbon-control.js +5 -3
- package/components/controls/phi-ribbon-wrap-control.d.ts +7 -1
- package/components/controls/phi-ribbon-wrap-control.js +8 -2
- package/components/controls/phi-segmented-control.d.ts +4 -1
- package/components/controls/phi-segmented-control.js +13 -2
- package/components/controls/phi-surface-control.d.ts +2 -0
- package/components/controls/phi-surface-control.js +16 -1
- package/components/controls/phi-switch-control.d.ts +4 -1
- package/components/controls/phi-switch-control.js +8 -2
- package/components/controls/phi-tag-control.d.ts +4 -1
- package/components/controls/phi-tag-control.js +11 -3
- package/components/layouts/phi-layout-view-model.js +10 -1
- package/components/regions/clients/cms-region-container-client.js +11 -1
- package/components/regions/phi-cms-region-container.js +5 -1
- package/components/regions/phi-cms-region-shell.d.ts +10 -0
- package/components/regions/phi-cms-region-shell.js +53 -7
- package/components/root/phi-root-layout.d.ts +1 -0
- package/components/root/phi-root-layout.js +1 -0
- package/components/root/phi-root-theme-resolver.js +12 -1
- package/components/root/phi-shell-chrome-overlay.d.ts +6 -0
- package/components/root/phi-shell-chrome-overlay.js +7 -1
- package/components/runtime/runtime-module-context.d.ts +12 -1
- package/components/runtime/runtime-module-context.js +6 -1
- package/components/shell/phi-cms-shell.d.ts +7 -1
- package/components/shell/phi-cms-shell.js +4 -2
- package/components/shell/use-phi-shell-header-bands.d.ts +5 -0
- package/components/shell/use-phi-shell-header-bands.js +64 -0
- package/components/shell/use-phi-shell-sticky-bottom.d.ts +18 -0
- package/components/shell/use-phi-shell-sticky-bottom.js +54 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -0
- package/components/tables/client/phi-table-binding.js +22 -3
- package/components/trees/client/phi-tree-binding.d.ts +1 -0
- package/components/trees/client/phi-tree-binding.js +11 -2
- package/components/widgets/client/shared/phi-collection-provider.js +4 -3
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-collection-view-binding.js +16 -2
- package/components/widgets/client/shared/phi-command-buttons.js +6 -2
- package/components/widgets/config/background.d.ts +20 -0
- package/components/widgets/config/background.js +44 -2
- package/components/widgets/config/button-variant.d.ts +22 -4
- package/components/widgets/config/button-variant.js +24 -5
- package/components/widgets/config/common-action-field.d.ts +1 -1
- package/components/widgets/config/parser-primitives.js +4 -2
- package/components/widgets/config/theme-gradient.d.ts +11 -0
- package/components/widgets/config/theme-gradient.js +12 -0
- package/components/widgets/label-sets/background.js +2 -0
- package/components/widgets/label-sets/geometry.js +2 -0
- package/components/widgets/label-sets/inspector.js +4 -0
- package/components/widgets/label-types/background.d.ts +1 -0
- package/components/widgets/label-types/background.js +1 -0
- package/components/widgets/label-types/common-controls.js +2 -2
- package/components/widgets/label-types/geometry.d.ts +1 -0
- package/components/widgets/label-types/geometry.js +1 -0
- package/components/widgets/label-types/inspector.d.ts +4 -0
- package/components/widgets/label-types/inspector.js +2 -0
- package/components/widgets/shared/card-body-client.d.ts +11 -0
- package/components/widgets/shared/card-body-client.js +32 -4
- package/components/widgets/shared/collection-source-failure.d.ts +26 -0
- package/components/widgets/shared/collection-source-failure.js +42 -0
- package/components/widgets/shared/markdown-render.js +16 -3
- package/components/widgets/shared/widget-failure-client.d.ts +10 -0
- package/components/widgets/shared/widget-failure-client.js +20 -0
- package/components/widgets/shared/widget-failure.d.ts +31 -0
- package/components/widgets/shared/widget-failure.js +20 -0
- package/components/widgets/shared/widget-failure.server.d.ts +9 -0
- package/components/widgets/shared/widget-failure.server.js +12 -0
- package/gateway/dashboard-card-memo.d.ts +3 -0
- package/gateway/dashboard-card-memo.js +25 -0
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/layout-style.d.ts +8 -4
- package/helpers/layout-style.js +3 -2
- package/helpers/mode-paint.d.ts +4 -0
- package/helpers/mode-paint.js +47 -0
- package/helpers/surface-style.js +33 -11
- package/module-dashboard-cards.d.ts +1 -0
- package/module-dashboard-cards.js +1 -0
- package/module-records.d.ts +7 -0
- package/module-records.js +6 -0
- package/package.json +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-surface-labels.js +1 -0
- package/plugins/runtime-modules/builder/clients/region-inspector.js +47 -2
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +7 -4
- package/plugins/runtime-modules/builder/controller/page-controller.js +7 -0
- package/plugins/runtime-modules/builder/persistence.d.ts +3 -0
- package/plugins/runtime-modules/builder/persistence.js +9 -1
- package/plugins/runtime-modules/core/content-entries/record-source.server.d.ts +3 -1
- package/plugins/runtime-modules/core/content-entries/record-source.server.js +7 -4
- package/plugins/runtime-modules/core/widgets/button/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +40 -4
- package/plugins/runtime-modules/core/widgets/button/config.js +12 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +94 -0
- package/plugins/runtime-modules/core/widgets/card/config.js +38 -0
- package/plugins/runtime-modules/core/widgets/card/editor.js +8 -1
- package/plugins/runtime-modules/core/widgets/card/server.js +4 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -3
- package/plugins/runtime-modules/core/widgets/collection-view/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +47 -11
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
- package/plugins/runtime-modules/core/widgets/collection-view/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +6 -1
- package/plugins/runtime-modules/core/widgets/collection-view/server.js +21 -3
- package/plugins/runtime-modules/core/widgets/entry-detail/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-detail/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/entry-detail/server.js +5 -2
- package/plugins/runtime-modules/core/widgets/entry-header/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-header/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/entry-header/server.js +5 -2
- package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +6 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.js +13 -6
- package/plugins/runtime-modules/core/widgets/gallery/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -3
- package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -6
- package/plugins/runtime-modules/core/widgets/record/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/record/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/record/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/record/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/segmented/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +21 -1
- package/plugins/runtime-modules/core/widgets/segmented/config.js +11 -1
- package/plugins/runtime-modules/core/widgets/switch/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/switch/config.d.ts +19 -0
- package/plugins/runtime-modules/core/widgets/switch/config.js +11 -0
- package/plugins/runtime-modules/core/widgets/table/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +16 -3
- package/plugins/runtime-modules/core/widgets/table/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/table/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/table/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/table/static-resource-editor.js +2 -1
- package/plugins/runtime-modules/core/widgets/timeline/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/timeline/client.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/timeline/client.js +14 -4
- package/plugins/runtime-modules/core/widgets/tree/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/tree/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/tree/client.js +13 -2
- package/plugins/runtime-modules/core/widgets/tree/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/tree/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/tree/server.js +2 -2
- package/plugins/runtime-modules/theme/presets.d.ts +9 -1
- package/plugins/runtime-modules/theme/tour.d.ts +9 -1
- package/plugins/runtime-modules/theme/tour.js +10 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +138 -7
- package/runtime-data-provider-client.d.ts +2 -0
- package/runtime-data-provider-client.js +7 -0
- package/styles/controls.css +10 -5
- package/styles/gradients.css +101 -0
- package/styles/root.css +18 -0
- package/styles/shell.css +64 -0
- package/theme/phi-button-shadow.d.ts +6 -0
- package/theme/phi-theme-gradients.d.ts +96 -0
- package/theme/phi-theme-gradients.js +245 -0
- package/theme/phi-theme-presets.d.ts +3 -0
- package/theme/phi-theme-presets.js +3 -0
- package/theme/phi-theme-tokens.d.ts +5 -1
- package/theme/phi-theme-tokens.js +14 -0
- package/types/cms-presets.d.ts +7 -0
- package/types/core-widget-placements.d.ts +3 -0
- package/types/layout-style.d.ts +9 -8
- package/types/layout-style.js +9 -8
- package/types/surface.d.ts +4 -0
- package/types/surface.js +4 -0
- package/types.d.ts +1 -1
- package/types.js +1 -1
|
@@ -88,6 +88,15 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
88
88
|
const [queryLoading, setQueryLoading] = useState(Boolean(source));
|
|
89
89
|
const [pendingMutationTargets, setPendingMutationTargets] = useState(() => new Set());
|
|
90
90
|
const [error, setError] = useState(null);
|
|
91
|
+
/*
|
|
92
|
+
* What the last read of the source failed with, apart from `error`.
|
|
93
|
+
*
|
|
94
|
+
* `error` is also where a mutation's refusal lands, and that one the person who edited has to read. A
|
|
95
|
+
* read that failed -- or answered rows the resource cannot stand behind -- is the source's failure,
|
|
96
|
+
* which the Widget leaves to `PhiWidgetFailure`. Only the query writes it, so an edit can never make
|
|
97
|
+
* the Table disappear.
|
|
98
|
+
*/
|
|
99
|
+
const [queryFailure, setQueryFailure] = useState(null);
|
|
91
100
|
const [selectedRowIdentities, setSelectedRowIdentities] = useState([]);
|
|
92
101
|
const [expandedRowIdentities, setExpandedRowIdentities] = useState(initialExpandedRowIdentities);
|
|
93
102
|
const [refreshRequest, setRefreshRequest] = useState({ revision: 0, background: false });
|
|
@@ -131,6 +140,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
131
140
|
setQuery((current) => ({ ...current, page: 1, cursor: null }));
|
|
132
141
|
setQueryLoading(sourceKey !== "null");
|
|
133
142
|
setError(null);
|
|
143
|
+
setQueryFailure(null);
|
|
134
144
|
}
|
|
135
145
|
// What a render cannot reset: requests in flight and the bookkeeping kept beside state.
|
|
136
146
|
useEffect(() => {
|
|
@@ -178,7 +188,9 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
178
188
|
setHasMore(false);
|
|
179
189
|
setSummary({});
|
|
180
190
|
setQueryLoading(false);
|
|
181
|
-
|
|
191
|
+
const failure = new PhiTableProviderError("missing-row-identity", `Table Provider row is missing identity field "${resource.rowIdentityPath}".`);
|
|
192
|
+
setError(failure);
|
|
193
|
+
setQueryFailure(failure);
|
|
182
194
|
return;
|
|
183
195
|
}
|
|
184
196
|
const summaryError = validateProviderSummary(resource, data.summary);
|
|
@@ -189,7 +201,9 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
189
201
|
setHasMore(false);
|
|
190
202
|
setSummary({});
|
|
191
203
|
setQueryLoading(false);
|
|
192
|
-
|
|
204
|
+
const failure = new PhiTableProviderError("invalid-summary", summaryError);
|
|
205
|
+
setError(failure);
|
|
206
|
+
setQueryFailure(failure);
|
|
193
207
|
return;
|
|
194
208
|
}
|
|
195
209
|
rowsRef.current = data.rows;
|
|
@@ -202,6 +216,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
202
216
|
setSummary(data.summary ?? {});
|
|
203
217
|
setQueryLoading(false);
|
|
204
218
|
setError(null);
|
|
219
|
+
setQueryFailure(null);
|
|
205
220
|
if (!preserveSelectedRowIdentities) {
|
|
206
221
|
const available = new Set(data.rows.flatMap((row) => {
|
|
207
222
|
const identity = readPhiTableRowIdentity(row, resource.rowIdentityPath);
|
|
@@ -243,6 +258,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
243
258
|
if (!background)
|
|
244
259
|
setQueryLoading(true);
|
|
245
260
|
setError(null);
|
|
261
|
+
setQueryFailure(null);
|
|
246
262
|
}
|
|
247
263
|
});
|
|
248
264
|
void provider.query({
|
|
@@ -281,7 +297,9 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
281
297
|
setSummary({});
|
|
282
298
|
}
|
|
283
299
|
setQueryLoading(false);
|
|
284
|
-
|
|
300
|
+
const failure = readPhiTableProviderError(queryError);
|
|
301
|
+
setError(failure);
|
|
302
|
+
setQueryFailure(failure);
|
|
285
303
|
}
|
|
286
304
|
});
|
|
287
305
|
return () => abortController.abort();
|
|
@@ -533,6 +551,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
|
|
|
533
551
|
contractError: resourceError,
|
|
534
552
|
loading: queryLoading && !bindingError && !resourceError,
|
|
535
553
|
error,
|
|
554
|
+
queryError: queryFailure,
|
|
536
555
|
query,
|
|
537
556
|
resolvedQuery,
|
|
538
557
|
setQuery,
|
|
@@ -16,6 +16,7 @@ export declare function usePhiTreeBinding({ source, initialQuery, defaultExpande
|
|
|
16
16
|
nodes: readonly TreeNode[];
|
|
17
17
|
loading: boolean;
|
|
18
18
|
error: PhiTreeProviderError | null;
|
|
19
|
+
queryError: PhiTreeProviderError | null;
|
|
19
20
|
selectedNodeIdentities: readonly PhiTreeNodeIdentity[];
|
|
20
21
|
setSelectedNodeIdentities: import("react").Dispatch<import("react").SetStateAction<readonly PhiTreeNodeIdentity[]>>;
|
|
21
22
|
checkedNodeIdentities: readonly PhiTreeNodeIdentity[];
|
|
@@ -86,6 +86,12 @@ export function usePhiTreeBinding({ source, initialQuery = PHI_TREE_DEFAULT_INIT
|
|
|
86
86
|
const nodesRef = useRef(nodes);
|
|
87
87
|
const [loading, setLoading] = useState(Boolean(source));
|
|
88
88
|
const [error, setError] = useState(null);
|
|
89
|
+
/*
|
|
90
|
+
* What the last read of the source failed with, apart from `error`, which also holds a refused change
|
|
91
|
+
* -- that one the person who made it has to read. A failed read is the source's failure, which the
|
|
92
|
+
* Widget leaves to `PhiWidgetFailure`; only the query writes it, so an edit cannot hide the Tree.
|
|
93
|
+
*/
|
|
94
|
+
const [queryFailure, setQueryFailure] = useState(null);
|
|
89
95
|
const [selectedNodeIdentities, setSelectedNodeIdentities] = useState([]);
|
|
90
96
|
const [checkedNodeIdentities, setCheckedNodeIdentities] = useState([]);
|
|
91
97
|
const [expandedNodeIdentities, setExpandedNodeIdentities] = useState(defaultExpandedNodeIdentities);
|
|
@@ -134,6 +140,7 @@ export function usePhiTreeBinding({ source, initialQuery = PHI_TREE_DEFAULT_INIT
|
|
|
134
140
|
if (!controller.signal.aborted) {
|
|
135
141
|
setLoading(true);
|
|
136
142
|
setError(null);
|
|
143
|
+
setQueryFailure(null);
|
|
137
144
|
}
|
|
138
145
|
});
|
|
139
146
|
void provider.query({ resourceKey: source.resourceKey, query, params: source.params, signal: controller.signal })
|
|
@@ -161,7 +168,9 @@ export function usePhiTreeBinding({ source, initialQuery = PHI_TREE_DEFAULT_INIT
|
|
|
161
168
|
if (!controller.signal.aborted) {
|
|
162
169
|
setNodes([]);
|
|
163
170
|
setLoading(false);
|
|
164
|
-
|
|
171
|
+
const failure = readPhiTreeProviderError(queryError);
|
|
172
|
+
setError(failure);
|
|
173
|
+
setQueryFailure(failure);
|
|
165
174
|
}
|
|
166
175
|
});
|
|
167
176
|
return () => controller.abort();
|
|
@@ -285,7 +294,7 @@ export function usePhiTreeBinding({ source, initialQuery = PHI_TREE_DEFAULT_INIT
|
|
|
285
294
|
return {
|
|
286
295
|
provider, resource, bindingError,
|
|
287
296
|
query, setQuery,
|
|
288
|
-
nodes, loading, error,
|
|
297
|
+
nodes, loading, error, queryError: queryFailure,
|
|
289
298
|
selectedNodeIdentities, setSelectedNodeIdentities,
|
|
290
299
|
checkedNodeIdentities, setCheckedNodeIdentities,
|
|
291
300
|
expandedNodeIdentities, setExpandedNodeIdentities,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useCallback, useContext, useMemo, } from "react";
|
|
4
4
|
import { isPhiNamespacedRuntimeKey, isPhiRuntimeDataProviderKey, } from "../../../../types/runtime-data-provider";
|
|
5
|
+
import { PhiCollectionSourceFailureText } from "../../shared/collection-source-failure";
|
|
5
6
|
const EMPTY_COLLECTION_PROVIDER_REGISTRY = new Map();
|
|
6
7
|
const PhiCollectionProviderRegistryContext = createContext(EMPTY_COLLECTION_PROVIDER_REGISTRY);
|
|
7
8
|
export function createPhiCollectionProviderClient(registration) {
|
|
@@ -45,11 +46,11 @@ export function usePhiCollectionProvider(source) {
|
|
|
45
46
|
provider,
|
|
46
47
|
resource,
|
|
47
48
|
bindingError: !source
|
|
48
|
-
?
|
|
49
|
+
? PhiCollectionSourceFailureText.notConfigured()
|
|
49
50
|
: !provider
|
|
50
|
-
?
|
|
51
|
+
? PhiCollectionSourceFailureText.providerUnavailable(source.providerKey)
|
|
51
52
|
: !resource
|
|
52
|
-
?
|
|
53
|
+
? PhiCollectionSourceFailureText.resourceUnavailable(source.resourceKey, source.providerKey)
|
|
53
54
|
: null,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
@@ -15,6 +15,15 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
15
15
|
const [data, setData] = useState(null);
|
|
16
16
|
const [loading, setLoading] = useState(false);
|
|
17
17
|
const [error, setError] = useState(null);
|
|
18
|
+
/*
|
|
19
|
+
* What the last read of the source failed with, apart from `error`.
|
|
20
|
+
*
|
|
21
|
+
* `error` is also where an action's refusal lands -- a delete the Provider turned down -- and that is
|
|
22
|
+
* the reader's to see. A read that failed is the source's failure, which the Widget hands to
|
|
23
|
+
* `PhiWidgetFailure` instead: nothing on a live page, the cause in the Builder. Only the query writes
|
|
24
|
+
* it, so an action can never make the Widget disappear.
|
|
25
|
+
*/
|
|
26
|
+
const [queryError, setQueryError] = useState(null);
|
|
18
27
|
const [refreshToken, setRefreshToken] = useState(0);
|
|
19
28
|
const [openPanelKey, setOpenPanelKey] = useState(null);
|
|
20
29
|
/*
|
|
@@ -39,6 +48,7 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
39
48
|
setQuery((current) => JSON.stringify(current) === JSON.stringify(nextQuery) ? current : nextQuery);
|
|
40
49
|
setData(null);
|
|
41
50
|
setError(null);
|
|
51
|
+
setQueryError(null);
|
|
42
52
|
setOpenPanelKey(null);
|
|
43
53
|
}, 0);
|
|
44
54
|
return () => window.clearTimeout(timer);
|
|
@@ -54,6 +64,7 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
54
64
|
return;
|
|
55
65
|
setLoading(true);
|
|
56
66
|
setError(null);
|
|
67
|
+
setQueryError(null);
|
|
57
68
|
}, 0);
|
|
58
69
|
void provider.query({
|
|
59
70
|
resourceKey: source.resourceKey,
|
|
@@ -65,9 +76,12 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
65
76
|
return;
|
|
66
77
|
setData(nextData);
|
|
67
78
|
setError(nextData.error);
|
|
79
|
+
setQueryError(nextData.error);
|
|
68
80
|
}).catch((nextError) => {
|
|
69
81
|
if (isCurrent()) {
|
|
70
|
-
|
|
82
|
+
const message = nextError instanceof Error ? nextError.message : "Collection request failed.";
|
|
83
|
+
setError(message);
|
|
84
|
+
setQueryError(message);
|
|
71
85
|
}
|
|
72
86
|
}).finally(() => {
|
|
73
87
|
// Superseded by an action is still finished loading; only a newer query takes the flag over.
|
|
@@ -114,5 +128,5 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
114
128
|
reload,
|
|
115
129
|
activate,
|
|
116
130
|
}), [activate, data, error, loading, openPanelKey, query, reload]);
|
|
117
|
-
return { provider, resource, bindingError, binding };
|
|
131
|
+
return { provider, resource, bindingError, queryError, binding };
|
|
118
132
|
}
|
|
@@ -5,7 +5,7 @@ import { usePhiSignalListener } from "../../../runtime/runtime-signal-bus";
|
|
|
5
5
|
import { usePhiSignalEmitter, usePhiSignalIdentity } from "../../../runtime/runtime-signal-identity";
|
|
6
6
|
import { registerPhiSignalInstance } from "../../../runtime/runtime-signal-registry";
|
|
7
7
|
import { usePhiSignalRuntimePartition } from "../../../runtime/runtime-signal-partition";
|
|
8
|
-
import {
|
|
8
|
+
import { resolvePhiButtonVariantPresentation } from "../../config/button-variant";
|
|
9
9
|
import { resolvePhiCommonControlAction } from "./phi-common-controls";
|
|
10
10
|
import { resolvePhiButtonIcon } from "./phi-button-icons";
|
|
11
11
|
function resolveButtonSubcontrolAddress(blockId, key) {
|
|
@@ -272,7 +272,11 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
|
|
|
272
272
|
label,
|
|
273
273
|
tooltip: buttonState.tooltip ?? button.tooltip,
|
|
274
274
|
showLabel: button.display == null ? undefined : button.display !== "icon",
|
|
275
|
-
|
|
275
|
+
/*
|
|
276
|
+
* A toolbar draws its buttons by primitive type alone, so a `gradient` command button stands as the
|
|
277
|
+
* primary one it is underneath and a `glass` one as the plain one.
|
|
278
|
+
*/
|
|
279
|
+
type: resolvePhiButtonVariantPresentation(action ? action.variant : button.variant).type ?? "default",
|
|
276
280
|
danger: action ? action.danger === true : button.danger === true,
|
|
277
281
|
disabled: button.disabled === true || buttonState.enabled === false,
|
|
278
282
|
readOnly: button.readOnly === true,
|
|
@@ -35,6 +35,26 @@ export type PhiBackgroundBaseGradient = {
|
|
|
35
35
|
kind: "gradient";
|
|
36
36
|
direction: PhiBackgroundDirection;
|
|
37
37
|
stops: PhiBackgroundGradientStop[];
|
|
38
|
+
/**
|
|
39
|
+
* Soft radial fields of light laid over the linear gradient, first on top: an ember in a corner, a
|
|
40
|
+
* wash of colour on one side. Stated by a Preset or an agent; the Background Control does not offer
|
|
41
|
+
* them yet, and keeps them through its edits because it changes the Base by spreading it.
|
|
42
|
+
*/
|
|
43
|
+
glows?: PhiBackgroundGradientGlow[];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* One field of light: `color` at `opacity` in its centre (`x`, `y` from the box's top left), fading to
|
|
47
|
+
* nothing at `fade` percent of its radii (`width`, `height`). Lengths are CSS lengths, mostly percentages
|
|
48
|
+
* of the box.
|
|
49
|
+
*/
|
|
50
|
+
export type PhiBackgroundGradientGlow = {
|
|
51
|
+
color: string;
|
|
52
|
+
opacity?: number;
|
|
53
|
+
x: string;
|
|
54
|
+
y: string;
|
|
55
|
+
width: string;
|
|
56
|
+
height?: string;
|
|
57
|
+
fade?: number;
|
|
38
58
|
};
|
|
39
59
|
export type PhiBackgroundBaseImage = {
|
|
40
60
|
kind: "image";
|
|
@@ -97,6 +97,46 @@ function readBackgroundDirection(value) {
|
|
|
97
97
|
}
|
|
98
98
|
return direction && /^-?\d+(\.\d+)?deg$/.test(direction) ? direction : "to right";
|
|
99
99
|
}
|
|
100
|
+
const PHI_BACKGROUND_GLOW_LENGTH = /^-?\d+(\.\d+)?(%|px|rem|em|vw|vh)$/;
|
|
101
|
+
function readBackgroundGlowLength(value) {
|
|
102
|
+
const length = typeof value === "number" && Number.isFinite(value) ? `${value}%` : readString(value)?.trim();
|
|
103
|
+
return length && PHI_BACKGROUND_GLOW_LENGTH.test(length) ? length : undefined;
|
|
104
|
+
}
|
|
105
|
+
/** The fields of light a gradient states; one that cannot be read is left out, the rest still paint. */
|
|
106
|
+
function readBackgroundGlows(value) {
|
|
107
|
+
if (!Array.isArray(value)) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const glows = value.flatMap((entry) => {
|
|
111
|
+
if (!isPhiRecord(entry))
|
|
112
|
+
return [];
|
|
113
|
+
const raw = entry;
|
|
114
|
+
const color = readString(raw.color)?.trim();
|
|
115
|
+
const x = readBackgroundGlowLength(raw.x);
|
|
116
|
+
const y = readBackgroundGlowLength(raw.y);
|
|
117
|
+
const width = readBackgroundGlowLength(raw.width);
|
|
118
|
+
if (!color || !x || !y || !width)
|
|
119
|
+
return [];
|
|
120
|
+
const height = readBackgroundGlowLength(raw.height);
|
|
121
|
+
const opacity = readNumber(raw.opacity);
|
|
122
|
+
const fade = readNumber(raw.fade);
|
|
123
|
+
return [{
|
|
124
|
+
color,
|
|
125
|
+
x,
|
|
126
|
+
y,
|
|
127
|
+
width,
|
|
128
|
+
...(height ? { height } : {}),
|
|
129
|
+
...(opacity == null ? {} : { opacity: Math.max(0, Math.min(1, opacity)) }),
|
|
130
|
+
...(fade == null ? {} : { fade: Math.max(1, Math.min(100, fade)) }),
|
|
131
|
+
}];
|
|
132
|
+
});
|
|
133
|
+
return glows.length > 0 ? glows : undefined;
|
|
134
|
+
}
|
|
135
|
+
function serializePhiBackgroundGlow(glow) {
|
|
136
|
+
const opacity = Math.round((glow.opacity ?? 1) * 1000) / 10;
|
|
137
|
+
const color = opacity >= 100 ? glow.color : `color-mix(in srgb, ${glow.color} ${opacity}%, transparent)`;
|
|
138
|
+
return `radial-gradient(${glow.width} ${glow.height ?? glow.width} at ${glow.x} ${glow.y}, ${color} 0%, transparent ${glow.fade ?? 70}%)`;
|
|
139
|
+
}
|
|
100
140
|
function readBackgroundStops(value) {
|
|
101
141
|
if (!Array.isArray(value)) {
|
|
102
142
|
return undefined;
|
|
@@ -154,7 +194,8 @@ function normalizePhiBackgroundBase(value) {
|
|
|
154
194
|
// Stops or nothing: a gradient without them has nothing to paint, and inventing white to black
|
|
155
195
|
// would put a Background on screen that nobody authored.
|
|
156
196
|
const stops = readBackgroundStops(raw.stops);
|
|
157
|
-
|
|
197
|
+
const glows = readBackgroundGlows(raw.glows);
|
|
198
|
+
return stops ? { kind, direction: readBackgroundDirection(raw.direction), stops, ...(glows ? { glows } : {}) } : null;
|
|
158
199
|
}
|
|
159
200
|
if (kind === "image") {
|
|
160
201
|
const source = readPhiMediaImageSourceConfig(raw);
|
|
@@ -316,7 +357,8 @@ export function serializePhiBackgroundBaseCss(base) {
|
|
|
316
357
|
if (base.kind === "color")
|
|
317
358
|
return base.color;
|
|
318
359
|
if (base.kind === "gradient") {
|
|
319
|
-
|
|
360
|
+
const linear = `linear-gradient(${base.direction}, ${base.stops.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
|
|
361
|
+
return [...(base.glows ?? []).map(serializePhiBackgroundGlow), linear].join(", ");
|
|
320
362
|
}
|
|
321
363
|
const presentation = resolvePhiBackgroundImagePresentation(base);
|
|
322
364
|
return presentation.url
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { PhiButtonType } from "../../controls/phi-button-types";
|
|
2
|
+
import type { PhiThemeGradientKey } from "../../../theme/phi-theme-gradients";
|
|
2
3
|
/**
|
|
3
4
|
* How a button in a Widget's config stands out, in words that belong to this package.
|
|
4
5
|
*
|
|
5
6
|
* `normal` is the plain button, `primary` the one a surface leads with, `dashed` an outlined one for an
|
|
6
|
-
* optional step, `subtle` a button without a frame, `link` one that reads as a link.
|
|
7
|
-
*
|
|
7
|
+
* optional step, `subtle` a button without a frame, `link` one that reads as a link. `gradient` is filled
|
|
8
|
+
* with one of the Theme's gradient slots, `glass` a frosted pane for a button over a picture or a run.
|
|
9
|
+
* The Button Control maps them onto its primitive; a config never names the primitive's own vocabulary.
|
|
8
10
|
*/
|
|
9
|
-
export declare const PHI_BUTTON_VARIANTS: readonly ["normal", "primary", "dashed", "subtle", "link"];
|
|
11
|
+
export declare const PHI_BUTTON_VARIANTS: readonly ["normal", "primary", "dashed", "subtle", "link", "gradient", "glass"];
|
|
10
12
|
export type PhiButtonVariant = (typeof PHI_BUTTON_VARIANTS)[number];
|
|
11
13
|
export declare function readPhiButtonVariant(value: unknown): PhiButtonVariant | undefined;
|
|
12
|
-
|
|
14
|
+
/** What the Button Control is handed for a variant: its primitive type, and the run or the pane. */
|
|
15
|
+
export type PhiButtonVariantPresentation = {
|
|
16
|
+
type?: PhiButtonType;
|
|
17
|
+
gradient?: PhiThemeGradientKey;
|
|
18
|
+
glass?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A variant as the Button Control's props. The `gradient` variant takes the slot it names, the Theme's
|
|
22
|
+
* first where it names none, so choosing the variant alone already draws a run.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolvePhiButtonVariantPresentation(variant: PhiButtonVariant | undefined, gradient?: PhiThemeGradientKey): PhiButtonVariantPresentation;
|
|
13
25
|
export declare const PHI_BUTTON_VARIANT_FIELD_OPTIONS: readonly [{
|
|
14
26
|
readonly value: "normal";
|
|
15
27
|
readonly label: "Normal";
|
|
@@ -25,4 +37,10 @@ export declare const PHI_BUTTON_VARIANT_FIELD_OPTIONS: readonly [{
|
|
|
25
37
|
}, {
|
|
26
38
|
readonly value: "link";
|
|
27
39
|
readonly label: "Link";
|
|
40
|
+
}, {
|
|
41
|
+
readonly value: "gradient";
|
|
42
|
+
readonly label: "Gradient";
|
|
43
|
+
}, {
|
|
44
|
+
readonly value: "glass";
|
|
45
|
+
readonly label: "Glass";
|
|
28
46
|
}];
|
|
@@ -3,25 +3,42 @@ import { readString } from "./parser-primitives";
|
|
|
3
3
|
* How a button in a Widget's config stands out, in words that belong to this package.
|
|
4
4
|
*
|
|
5
5
|
* `normal` is the plain button, `primary` the one a surface leads with, `dashed` an outlined one for an
|
|
6
|
-
* optional step, `subtle` a button without a frame, `link` one that reads as a link.
|
|
7
|
-
*
|
|
6
|
+
* optional step, `subtle` a button without a frame, `link` one that reads as a link. `gradient` is filled
|
|
7
|
+
* with one of the Theme's gradient slots, `glass` a frosted pane for a button over a picture or a run.
|
|
8
|
+
* The Button Control maps them onto its primitive; a config never names the primitive's own vocabulary.
|
|
8
9
|
*/
|
|
9
|
-
export const PHI_BUTTON_VARIANTS = ["normal", "primary", "dashed", "subtle", "link"];
|
|
10
|
+
export const PHI_BUTTON_VARIANTS = ["normal", "primary", "dashed", "subtle", "link", "gradient", "glass"];
|
|
10
11
|
export function readPhiButtonVariant(value) {
|
|
11
12
|
const variant = readString(value);
|
|
12
13
|
return PHI_BUTTON_VARIANTS.includes(variant ?? "")
|
|
13
14
|
? variant
|
|
14
15
|
: undefined;
|
|
15
16
|
}
|
|
17
|
+
/*
|
|
18
|
+
* A gradient Button is a primary one underneath -- its colour is the edge and the fallback where the
|
|
19
|
+
* run is not drawn -- and a glass one is the plain one with a pane over it.
|
|
20
|
+
*/
|
|
16
21
|
const PHI_BUTTON_TYPE_BY_VARIANT = {
|
|
17
22
|
normal: "default",
|
|
18
23
|
primary: "primary",
|
|
19
24
|
dashed: "dashed",
|
|
20
25
|
subtle: "text",
|
|
21
26
|
link: "link",
|
|
27
|
+
gradient: "primary",
|
|
28
|
+
glass: "default",
|
|
22
29
|
};
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
/**
|
|
31
|
+
* A variant as the Button Control's props. The `gradient` variant takes the slot it names, the Theme's
|
|
32
|
+
* first where it names none, so choosing the variant alone already draws a run.
|
|
33
|
+
*/
|
|
34
|
+
export function resolvePhiButtonVariantPresentation(variant, gradient) {
|
|
35
|
+
if (!variant)
|
|
36
|
+
return {};
|
|
37
|
+
return {
|
|
38
|
+
type: PHI_BUTTON_TYPE_BY_VARIANT[variant],
|
|
39
|
+
...(variant === "gradient" ? { gradient: gradient ?? "gradient1" } : {}),
|
|
40
|
+
...(variant === "glass" ? { glass: true } : {}),
|
|
41
|
+
};
|
|
25
42
|
}
|
|
26
43
|
export const PHI_BUTTON_VARIANT_FIELD_OPTIONS = [
|
|
27
44
|
{ value: "normal", label: "Normal" },
|
|
@@ -29,4 +46,6 @@ export const PHI_BUTTON_VARIANT_FIELD_OPTIONS = [
|
|
|
29
46
|
{ value: "dashed", label: "Dashed" },
|
|
30
47
|
{ value: "subtle", label: "Subtle" },
|
|
31
48
|
{ value: "link", label: "Link" },
|
|
49
|
+
{ value: "gradient", label: "Gradient" },
|
|
50
|
+
{ value: "glass", label: "Glass" },
|
|
32
51
|
];
|
|
@@ -41,7 +41,7 @@ export declare function createPhiCommonActionField({ signalValuePath, heading, }
|
|
|
41
41
|
[signalValuePath]: PhiCommonControlActionKey;
|
|
42
42
|
label: string;
|
|
43
43
|
icon: string;
|
|
44
|
-
variant: "normal" | "subtle" | "link" | "dashed" | "primary";
|
|
44
|
+
variant: "normal" | "glass" | "subtle" | "gradient" | "link" | "dashed" | "primary";
|
|
45
45
|
danger: boolean;
|
|
46
46
|
};
|
|
47
47
|
};
|
|
@@ -43,7 +43,7 @@ export function readCssSize(value) {
|
|
|
43
43
|
*/
|
|
44
44
|
function assertPhiSurfaceConfig(surface) {
|
|
45
45
|
const cssSize = (value) => (typeof value === "number" && Number.isFinite(value)) || typeof value === "string" ? value : undefined;
|
|
46
|
-
|
|
46
|
+
const readBackground = (background) => {
|
|
47
47
|
background.value("base", "a background base: a CSS value or an object with a kind", (value) => typeof value === "string" ||
|
|
48
48
|
(isPhiRecord(value) && ["color", "gradient", "image", "none"].includes(String(value.kind)))
|
|
49
49
|
? value
|
|
@@ -51,7 +51,9 @@ function assertPhiSurfaceConfig(surface) {
|
|
|
51
51
|
background.value("overlay", "a background overlay", (value) => (isPhiRecord(value) ? value : undefined));
|
|
52
52
|
background.oneOf("filter", PHI_BACKGROUND_FILTERS);
|
|
53
53
|
background.value("motion", "a background motion", (value) => (isPhiRecord(value) ? value : undefined));
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
|
+
surface.object("background", readBackground);
|
|
56
|
+
surface.object("backgroundDark", readBackground);
|
|
55
57
|
surface.oneOf("borderSource", PHI_CMS_BORDER_SOURCES);
|
|
56
58
|
surface.object("border", (border) => {
|
|
57
59
|
border.number("borderWidth");
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Theme's gradient slots as a choice a Widget field offers (theme/phi-theme-gradients.ts).
|
|
3
|
+
*
|
|
4
|
+
* Named by slot and not by look, because the look is the Theme's: "Gradient 1" is burgundy on one Site
|
|
5
|
+
* and teal on the next, and gold in the dark mode of the first. A field that stores the slot keeps
|
|
6
|
+
* following whatever the Theme draws there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PHI_THEME_GRADIENT_FIELD_OPTIONS: {
|
|
9
|
+
value: "gradient1" | "gradient2" | "gradient3";
|
|
10
|
+
label: string;
|
|
11
|
+
}[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PHI_THEME_GRADIENT_KEYS } from "../../../theme/phi-theme-gradients";
|
|
2
|
+
/**
|
|
3
|
+
* The Theme's gradient slots as a choice a Widget field offers (theme/phi-theme-gradients.ts).
|
|
4
|
+
*
|
|
5
|
+
* Named by slot and not by look, because the look is the Theme's: "Gradient 1" is burgundy on one Site
|
|
6
|
+
* and teal on the next, and gold in the dark mode of the first. A field that stores the slot keeps
|
|
7
|
+
* following whatever the Theme draws there.
|
|
8
|
+
*/
|
|
9
|
+
export const PHI_THEME_GRADIENT_FIELD_OPTIONS = PHI_THEME_GRADIENT_KEYS.map((key, index) => ({
|
|
10
|
+
value: key,
|
|
11
|
+
label: `Gradient ${index + 1}`,
|
|
12
|
+
}));
|
|
@@ -58,6 +58,7 @@ const PHI_BACKGROUND_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
58
58
|
filter_none: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.filter.none,
|
|
59
59
|
filter_glass: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.filter.glass,
|
|
60
60
|
filter_haze: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.filter.haze,
|
|
61
|
+
filter_clear: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.filter.clear,
|
|
61
62
|
filter_blur: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.filter.blur,
|
|
62
63
|
direction_up: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.direction.up,
|
|
63
64
|
direction_right: PHI_BACKGROUND_WIDGET_DEFAULT_LABELS.direction.right,
|
|
@@ -159,6 +160,7 @@ export async function getPhiBackgroundWidgetLabels(options) {
|
|
|
159
160
|
none: labels.filter_none,
|
|
160
161
|
glass: labels.filter_glass,
|
|
161
162
|
haze: labels.filter_haze,
|
|
163
|
+
clear: labels.filter_clear,
|
|
162
164
|
blur: labels.filter_blur,
|
|
163
165
|
},
|
|
164
166
|
direction: {
|
|
@@ -14,6 +14,7 @@ const PHI_GEOMETRY_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
14
14
|
section_stacking: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.sections.stacking,
|
|
15
15
|
field_sticky: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.sticky,
|
|
16
16
|
field_offset_top: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.offsetTop,
|
|
17
|
+
field_offset_bottom: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.offsetBottom,
|
|
17
18
|
field_size: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.size,
|
|
18
19
|
field_min_size: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.minSize,
|
|
19
20
|
field_max_size: PHI_GEOMETRY_WIDGET_DEFAULT_LABELS.fields.maxSize,
|
|
@@ -39,6 +40,7 @@ export async function getPhiGeometryWidgetLabels(options) {
|
|
|
39
40
|
fields: {
|
|
40
41
|
sticky: labels.field_sticky,
|
|
41
42
|
offsetTop: labels.field_offset_top,
|
|
43
|
+
offsetBottom: labels.field_offset_bottom,
|
|
42
44
|
size: labels.field_size,
|
|
43
45
|
minSize: labels.field_min_size,
|
|
44
46
|
maxSize: labels.field_max_size,
|
|
@@ -31,6 +31,7 @@ const PHI_INSPECTOR_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
31
31
|
region_visibility_reveal: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.reveal,
|
|
32
32
|
region_visibility_always: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.always,
|
|
33
33
|
region_visibility_hover: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.hover,
|
|
34
|
+
region_hero_overlap: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.heroOverlap,
|
|
34
35
|
region_visibility_scroll_up: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.scrollUp,
|
|
35
36
|
region_visibility_page_owned: definePhiMessageLabel(PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.regionVisibility.pageOwned),
|
|
36
37
|
surface_style_title: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.surfaceStyle.title,
|
|
@@ -43,6 +44,7 @@ const PHI_INSPECTOR_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
43
44
|
tone_light: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.tone.light,
|
|
44
45
|
tone_dark: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.tone.dark,
|
|
45
46
|
tone_inverse: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.tone.inverse,
|
|
47
|
+
tone_background_per_mode: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.tone.backgroundPerMode,
|
|
46
48
|
grid_columns: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.grid.columns,
|
|
47
49
|
grid_masonry_columns: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.grid.masonryColumns,
|
|
48
50
|
grid_distribution: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.grid.distribution,
|
|
@@ -109,6 +111,7 @@ export async function getPhiInspectorWidgetLabels(options) {
|
|
|
109
111
|
hover: labels.region_visibility_hover,
|
|
110
112
|
scrollUp: labels.region_visibility_scroll_up,
|
|
111
113
|
pageOwned: labels.region_visibility_page_owned,
|
|
114
|
+
heroOverlap: labels.region_hero_overlap,
|
|
112
115
|
},
|
|
113
116
|
surfaceStyle: {
|
|
114
117
|
title: labels.surface_style_title,
|
|
@@ -123,6 +126,7 @@ export async function getPhiInspectorWidgetLabels(options) {
|
|
|
123
126
|
light: labels.tone_light,
|
|
124
127
|
dark: labels.tone_dark,
|
|
125
128
|
inverse: labels.tone_inverse,
|
|
129
|
+
backgroundPerMode: labels.tone_background_per_mode,
|
|
126
130
|
},
|
|
127
131
|
grid: {
|
|
128
132
|
columns: labels.grid_columns,
|
|
@@ -11,12 +11,12 @@ export const PHI_COMMON_CONTROL_DEFAULT_LABELS = {
|
|
|
11
11
|
meta: { label: "Meta", tooltip: "Meta", icon: "meta" },
|
|
12
12
|
new: { label: "New", tooltip: "New", icon: "new" },
|
|
13
13
|
pageMeta: { label: "Meta", tooltip: "Page meta", icon: "meta" },
|
|
14
|
-
publish: { label: "Publish", tooltip: "Publish", icon: "publish"
|
|
14
|
+
publish: { label: "Publish", tooltip: "Publish", icon: "publish" },
|
|
15
15
|
reload: { label: "Reload", tooltip: "Reload", icon: "reload" },
|
|
16
16
|
reset: { label: "Reset", tooltip: "Reset", icon: "reset", danger: true },
|
|
17
17
|
restore: { label: "Restore", tooltip: "Restore", icon: "restore" },
|
|
18
18
|
review: { label: "Review", tooltip: "Review", icon: "preview" },
|
|
19
|
-
save: { label: "Save", tooltip: "Save", icon: "save"
|
|
19
|
+
save: { label: "Save", tooltip: "Save", icon: "save" },
|
|
20
20
|
search: { label: "Search", tooltip: "Search", icon: "search" },
|
|
21
21
|
undo: { label: "Undo", tooltip: "Undo", icon: "undo" },
|
|
22
22
|
redo: { label: "Redo", tooltip: "Redo", icon: "redo" },
|
|
@@ -33,6 +33,8 @@ export type PhiInspectorWidgetLabels = {
|
|
|
33
33
|
light: string;
|
|
34
34
|
dark: string;
|
|
35
35
|
inverse: string;
|
|
36
|
+
/** The switch that gives a Surface a ground of its own in dark mode (`PhiSurface.backgroundDark`). */
|
|
37
|
+
backgroundPerMode: string;
|
|
36
38
|
};
|
|
37
39
|
/**
|
|
38
40
|
* A Grid's columns -- how many slots a row holds at each width, and where one slot stands -- and a
|
|
@@ -70,6 +72,8 @@ export type PhiInspectorRegionVisibilityLabels = {
|
|
|
70
72
|
hover: string;
|
|
71
73
|
scrollUp: string;
|
|
72
74
|
pageOwned: string;
|
|
75
|
+
/** How far the Page's `content` reaches up into its Hero (`PhiCmsRegionConfig.heroOverlap`). */
|
|
76
|
+
heroOverlap: string;
|
|
73
77
|
};
|
|
74
78
|
export type PhiInspectorLinkTargetLabels = {
|
|
75
79
|
none: string;
|
|
@@ -30,6 +30,7 @@ export const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS = {
|
|
|
30
30
|
hover: "At the top edge",
|
|
31
31
|
scrollUp: "When scrolling up",
|
|
32
32
|
pageOwned: "This Region belongs to its Page and stands on that Page alone.",
|
|
33
|
+
heroOverlap: "Reaches into the Hero",
|
|
33
34
|
},
|
|
34
35
|
surfaceStyle: {
|
|
35
36
|
title: "Style",
|
|
@@ -44,6 +45,7 @@ export const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS = {
|
|
|
44
45
|
light: "Light",
|
|
45
46
|
dark: "Dark",
|
|
46
47
|
inverse: "Inverse",
|
|
48
|
+
backgroundPerMode: "Own background in dark mode",
|
|
47
49
|
},
|
|
48
50
|
grid: {
|
|
49
51
|
columns: "Slots per row",
|