@phis/ui 0.8.1 → 0.8.3
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 -2
- package/components/calendar/gregory-calendar-adapter-client.js +1 -0
- package/components/controls/phi-accordion-control.d.ts +6 -0
- package/components/controls/phi-accordion-control.js +8 -13
- package/components/controls/phi-background-control.js +2 -5
- package/components/controls/phi-builder-insert-picker-control-labels.d.ts +2 -0
- package/components/controls/phi-builder-insert-picker-control-labels.js +1 -0
- package/components/controls/phi-builder-insert-picker-control.js +10 -11
- package/components/controls/phi-cascader-control.d.ts +9 -3
- package/components/controls/phi-cascader-control.js +38 -10
- package/components/controls/phi-checkbox-group-control.d.ts +3 -1
- package/components/controls/phi-checkbox-group-control.js +2 -2
- package/components/controls/phi-collapse-control.d.ts +9 -2
- package/components/controls/phi-collapse-control.js +14 -2
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-color-field-control.d.ts +6 -1
- package/components/controls/phi-color-field-control.js +2 -2
- package/components/controls/phi-confirm-control.d.ts +1 -1
- package/components/controls/phi-confirm-control.js +71 -2
- package/components/controls/phi-confirm-dialog.js +2 -1
- package/components/controls/phi-date-picker-control.js +1 -1
- package/components/controls/phi-dimension-control.d.ts +3 -1
- package/components/controls/phi-dimension-control.js +2 -2
- package/components/controls/phi-geometry-control.js +1 -1
- package/components/controls/phi-length-control.d.ts +6 -1
- package/components/controls/phi-length-control.js +3 -2
- package/components/controls/phi-multi-select-control.d.ts +6 -1
- package/components/controls/phi-multi-select-control.js +3 -3
- package/components/controls/phi-segmented-control.d.ts +6 -1
- package/components/controls/phi-segmented-control.js +3 -3
- package/components/controls/phi-switch-control.d.ts +3 -1
- package/components/controls/phi-switch-control.js +3 -3
- package/components/controls/phi-table-control.d.ts +8 -1
- package/components/controls/phi-table-control.js +11 -5
- package/components/forms/compound-form-controls.js +16 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/media-widget-labels.d.ts +2 -0
- package/components/media/media-widget-labels.js +2 -0
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-asset-inspector-section.js +19 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
- package/components/shell/phi-builder-icon.js +9 -1
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/phi-table-surface.d.ts +25 -0
- package/components/tables/phi-table-surface.js +25 -0
- package/components/widgets/builder/phi-static-rows-editor.js +4 -1
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-choice-controller.d.ts +8 -1
- package/components/widgets/client/shared/phi-choice-controller.js +16 -1
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/config/choice-shared.d.ts +2 -0
- package/components/widgets/config/choice-shared.js +1 -0
- package/components/widgets/config/image-variant-options.d.ts +4 -1
- package/components/widgets/config/image-variant-options.js +27 -14
- package/components/widgets/inspector-field-row.d.ts +14 -1
- package/components/widgets/inspector-field-row.js +21 -1
- package/components/widgets/label-sets/builder-chrome.js +2 -0
- package/components/widgets/label-sets/inspector.js +10 -0
- package/components/widgets/label-sets/security.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +5 -0
- package/components/widgets/label-types/inspector.js +5 -0
- package/components/widgets/label-types/security.d.ts +2 -0
- package/components/widgets/signals/signal-endpoint-list.js +4 -1
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/runtime-module-ownership.js +1 -0
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/cms-inspector-drawer.d.ts +15 -0
- package/helpers/cms-inspector-drawer.js +37 -0
- package/helpers/cms-layout-defaults.js +1 -1
- package/helpers/preset-tree-contract-check.js +56 -0
- package/helpers/text-source.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/definition.d.ts +1 -1
- package/plugins/runtime-modules/accounting/definition.js +0 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +4 -4
- package/plugins/runtime-modules/accounting/ids.js +4 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +2 -1
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +5 -4
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +80 -38
- package/plugins/runtime-modules/admin/definition.d.ts +1 -1
- package/plugins/runtime-modules/admin/definition.js +0 -1
- package/plugins/runtime-modules/admin/module.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.js +0 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -1
- package/plugins/runtime-modules/area-base-definition.d.ts +19 -1
- package/plugins/runtime-modules/area-base-definition.js +18 -0
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/area-definitions.d.ts +8 -8
- package/plugins/runtime-modules/area-definitions.js +4 -3
- package/plugins/runtime-modules/area-root-route.d.ts +8 -0
- package/plugins/runtime-modules/area-root-route.js +11 -1
- package/plugins/runtime-modules/asset/labels.js +4 -0
- package/plugins/runtime-modules/asset/metadata-form.d.ts +0 -28
- package/plugins/runtime-modules/asset/metadata-form.js +6 -10
- package/plugins/runtime-modules/asset/services/options.d.ts +3 -2
- package/plugins/runtime-modules/asset/services/options.js +4 -3
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -1
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +3 -3
- package/plugins/runtime-modules/auth/widgets/security/client.js +2 -2
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.js +1 -1
- package/plugins/runtime-modules/builder/area-settings-form.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.d.ts +16 -0
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.js +9 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +97 -10
- package/plugins/runtime-modules/builder/clients/pages-header.js +7 -6
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +7 -4
- package/plugins/runtime-modules/builder/definition.d.ts +1 -1
- package/plugins/runtime-modules/builder/definition.js +0 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +10 -4
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -8
- package/plugins/runtime-modules/builder/page-meta-form.js +5 -2
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +20 -13
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +8 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +491 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/core/authoring-widgets.js +2 -1
- package/plugins/runtime-modules/core/messaging/label-defaults.d.ts +49 -0
- package/plugins/runtime-modules/core/messaging/label-defaults.js +48 -0
- package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -28
- package/plugins/runtime-modules/core/messaging/labels.js +52 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +3 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/select-box/client.js +13 -4
- package/plugins/runtime-modules/core/widgets/select-box/config.js +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/table/client.js +17 -8
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +1 -1143
- package/plugins/runtime-modules/core/widgets/table/config.js +144 -125
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +2 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +76 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +44 -1
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +28 -13
- package/plugins/runtime-modules/editor/definition.d.ts +1 -1
- package/plugins/runtime-modules/editor/definition.js +0 -1
- package/plugins/runtime-modules/editor/module.d.ts +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +16 -8
- package/plugins/runtime-modules/public/definition.d.ts +1 -1
- package/plugins/runtime-modules/public/definition.js +0 -1
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +109 -86
- package/plugins/runtime-modules/threads/controller/client.js +10 -12
- package/plugins/runtime-modules/threads/controller/definition.d.ts +6 -0
- package/plugins/runtime-modules/threads/controller/definition.js +17 -6
- package/styles/controls.css +49 -1
- package/styles/layout.css +3 -2
- package/types/calendar.d.ts +5 -0
- package/types/cms-plugins.d.ts +30 -10
- package/types/table-widget.d.ts +8 -2
|
@@ -31,6 +31,11 @@ export declare function resolvePhiBuilderAreaRootApplicants(state: PhiBuilderOff
|
|
|
31
31
|
* entry, no revision, no contradiction. It comes back with whatever it had when the Area is set to a
|
|
32
32
|
* landing again, because nothing is cleaned up here either.
|
|
33
33
|
*
|
|
34
|
+
* `/` forwards when the Area stored a redirect, or when it stored nothing and the applicant that stands
|
|
35
|
+
* there is the base Module's forward. Nothing stored is not a forward by itself: Public's root is its
|
|
36
|
+
* Welcome Page then, or the landing a Site package offers, and reading the absent answer as a forward
|
|
37
|
+
* kept the one Page every Site starts with out of its own Page list.
|
|
38
|
+
*
|
|
34
39
|
* Otherwise exactly the one root that is served. Every other applicant leaves the list either way --
|
|
35
40
|
* an entry that cannot be reached is worse than a missing one, and two entries both reading `/` would
|
|
36
41
|
* ask an author to guess which of them the visitor gets.
|
|
@@ -50,10 +55,11 @@ export declare function resolvePhiBuilderOfferedPageKeyFromCatalogPath(state: Ph
|
|
|
50
55
|
/**
|
|
51
56
|
* The Page the Builder should be on, given the one it asked for.
|
|
52
57
|
*
|
|
53
|
-
* The asked-for Page when the Area offers it. Otherwise
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
58
|
+
* The asked-for Page when the Area offers it. Otherwise the Area's landing, the Page at `/`, wherever
|
|
59
|
+
* it is on offer: it is the front door, and the one Page every Area has. Otherwise where the front door
|
|
60
|
+
* leads, because that is the answer to the question whoever set the forward just asked: `/` goes there,
|
|
61
|
+
* so that is the Page they mean. Otherwise the first Page on offer, which without the steps before it
|
|
62
|
+
* is an error Page -- whatever sorts first in a catalog is nobody's idea of a starting point.
|
|
57
63
|
*
|
|
58
64
|
* One order, one place. The workspace moves the Builder by it and the Page Select displays by it, and
|
|
59
65
|
* if they each kept their own the Select would name one Page while the canvas edited another.
|
|
@@ -6,7 +6,7 @@ import { findPhiBuilderPageKeyFromStoragePath, findPhiPageNodePath, normalizePhi
|
|
|
6
6
|
import { findFirstPhiCmsNavigationLinkPath } from "../../../components/regions/presets/navigation-redirect";
|
|
7
7
|
import { canPhiViewerAccess } from "../../../types/access";
|
|
8
8
|
import { resolvePhiRuntimeAreaDefinition } from "../area-definitions";
|
|
9
|
-
import { resolvePhiAreaRootRouteNavKey } from "../area-root-route";
|
|
9
|
+
import { resolvePhiAreaRootRouteNavKey, resolvePhiAreaRootRoutePresetKey } from "../area-root-route";
|
|
10
10
|
import { listPhiAlwaysActiveRuntimeModuleIds } from "../settings";
|
|
11
11
|
import { readPhiBuilderStoredAreaRootRoute } from "./developer-workspace-store";
|
|
12
12
|
/**
|
|
@@ -148,6 +148,19 @@ function removePhiBuilderUnansweredPresetPages(nodes, baseModuleId, isActive) {
|
|
|
148
148
|
});
|
|
149
149
|
return uncover(active);
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Whether the Page standing at `/` is the Area's own forward rather than a landing.
|
|
153
|
+
*
|
|
154
|
+
* The base Module of every Area behind a sign-in stands a forward there (`buildPhiAreaRootRoutePresetDescriptor`);
|
|
155
|
+
* Public's base stands its Welcome Page, and a Site package offers a landing of its own. Which of them
|
|
156
|
+
* answers an Area that stored nothing is the applicant chain's, so whether that Area forwards is a fact
|
|
157
|
+
* about the applicant, not about the absent answer.
|
|
158
|
+
*/
|
|
159
|
+
function isPhiBuilderAreaRootForward(node, area, baseModuleId) {
|
|
160
|
+
return node.sourcePreset != null &&
|
|
161
|
+
node.sourcePreset.ownerModuleId === baseModuleId &&
|
|
162
|
+
node.sourcePreset.presetKey === resolvePhiAreaRootRoutePresetKey(resolvePhiBuilderAreaAsCmsArea(area));
|
|
163
|
+
}
|
|
151
164
|
/**
|
|
152
165
|
* The Pages of an Area that may actually be opened, which is not the same as the Pages it has.
|
|
153
166
|
*
|
|
@@ -157,6 +170,11 @@ function removePhiBuilderUnansweredPresetPages(nodes, baseModuleId, isActive) {
|
|
|
157
170
|
* entry, no revision, no contradiction. It comes back with whatever it had when the Area is set to a
|
|
158
171
|
* landing again, because nothing is cleaned up here either.
|
|
159
172
|
*
|
|
173
|
+
* `/` forwards when the Area stored a redirect, or when it stored nothing and the applicant that stands
|
|
174
|
+
* there is the base Module's forward. Nothing stored is not a forward by itself: Public's root is its
|
|
175
|
+
* Welcome Page then, or the landing a Site package offers, and reading the absent answer as a forward
|
|
176
|
+
* kept the one Page every Site starts with out of its own Page list.
|
|
177
|
+
*
|
|
160
178
|
* Otherwise exactly the one root that is served. Every other applicant leaves the list either way --
|
|
161
179
|
* an entry that cannot be reached is worse than a missing one, and two entries both reading `/` would
|
|
162
180
|
* ask an author to guess which of them the visitor gets.
|
|
@@ -165,8 +183,14 @@ export function resolvePhiBuilderOfferedPageCatalog(state, area) {
|
|
|
165
183
|
const catalog = resolvePhiBuilderActivePageCatalog(area, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
|
|
166
184
|
const { baseModuleId, isActive } = resolvePhiBuilderAreaModuleActivation(state, area);
|
|
167
185
|
const answered = removePhiBuilderUnansweredPresetPages(catalog, baseModuleId, isActive);
|
|
168
|
-
const
|
|
169
|
-
const
|
|
186
|
+
const storedRootRoute = readPhiBuilderStoredAreaRootRoute(state, area);
|
|
187
|
+
const rootApplicant = storedRootRoute?.mode === "redirect"
|
|
188
|
+
? null
|
|
189
|
+
: resolvePhiBuilderAreaRootPageNode(state, area, answered);
|
|
190
|
+
const rootPageNode = rootApplicant != null &&
|
|
191
|
+
(storedRootRoute?.mode === "landing" || !isPhiBuilderAreaRootForward(rootApplicant, area, baseModuleId))
|
|
192
|
+
? rootApplicant
|
|
193
|
+
: null;
|
|
170
194
|
return answered.filter((node) => node.storagePath !== "/" || (rootPageNode != null && node === rootPageNode));
|
|
171
195
|
}
|
|
172
196
|
/**
|
|
@@ -198,10 +222,11 @@ function findPageKeyByReference(nodes, reference) {
|
|
|
198
222
|
/**
|
|
199
223
|
* The Page the Builder should be on, given the one it asked for.
|
|
200
224
|
*
|
|
201
|
-
* The asked-for Page when the Area offers it. Otherwise
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
225
|
+
* The asked-for Page when the Area offers it. Otherwise the Area's landing, the Page at `/`, wherever
|
|
226
|
+
* it is on offer: it is the front door, and the one Page every Area has. Otherwise where the front door
|
|
227
|
+
* leads, because that is the answer to the question whoever set the forward just asked: `/` goes there,
|
|
228
|
+
* so that is the Page they mean. Otherwise the first Page on offer, which without the steps before it
|
|
229
|
+
* is an error Page -- whatever sorts first in a catalog is nobody's idea of a starting point.
|
|
205
230
|
*
|
|
206
231
|
* One order, one place. The workspace moves the Builder by it and the Page Select displays by it, and
|
|
207
232
|
* if they each kept their own the Select would name one Page while the canvas edited another.
|
|
@@ -214,7 +239,9 @@ export function resolvePhiBuilderOfferedPageKey(state, area, requestedPageKey) {
|
|
|
214
239
|
}
|
|
215
240
|
return {
|
|
216
241
|
pages,
|
|
217
|
-
|
|
242
|
+
// Only the root the Area serves is left on the list at `/`, and only while it does not forward.
|
|
243
|
+
pageKey: pages.find((node) => node.storagePath === "/")?.key
|
|
244
|
+
?? findAreaForwardTargetPageKey(state, area, pages)
|
|
218
245
|
?? findAreaNavigationEntryPageKey(state, area, pages)
|
|
219
246
|
?? resolvePhiBuilderActivePageKey(null, pages),
|
|
220
247
|
};
|
|
@@ -8,6 +8,7 @@ import { definePhiRuntimeModuleForm } from "../../../components/forms/form-regis
|
|
|
8
8
|
import { PHI_BUILDER_EFFECTS_SECTIONS } from "./effects-form-values";
|
|
9
9
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../components/widgets/label-sets/runtime-options";
|
|
10
10
|
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
11
|
+
import { PHI_INSPECTOR_TABLE_CONTROL_PROPS } from "../../../helpers/cms-inspector-drawer";
|
|
11
12
|
export const PHI_BUILDER_PAGE_META_FORM_ID = createPhiFormId(PHI_SHARED_PACKAGE_NAME, "builder/page-meta");
|
|
12
13
|
const PHI_BUILDER_PAGE_META_FORM_LABEL_SET_KEY = "@phis/ui/modules/builder/labels/page-meta";
|
|
13
14
|
const PHI_BUILDER_EFFECTS_FORM_LABEL_SET_KEY = "@phis/ui/modules/builder/labels/effects";
|
|
@@ -318,7 +319,8 @@ const effectsDescriptors = {
|
|
|
318
319
|
},
|
|
319
320
|
remove: { enabled: true, label: label("removeTransition", "Remove transition") },
|
|
320
321
|
reorder: true,
|
|
321
|
-
|
|
322
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
323
|
+
...PHI_INSPECTOR_TABLE_CONTROL_PROPS,
|
|
322
324
|
emptyText: label("table.emptyTransitions", "No transitions configured."),
|
|
323
325
|
layout: { mode: "auto", overflowX: "auto" },
|
|
324
326
|
},
|
|
@@ -450,7 +452,8 @@ const effectsDescriptors = {
|
|
|
450
452
|
},
|
|
451
453
|
remove: { enabled: true, label: label("removeViewportEffect", "Remove viewport effect") },
|
|
452
454
|
reorder: true,
|
|
453
|
-
|
|
455
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
456
|
+
...PHI_INSPECTOR_TABLE_CONTROL_PROPS,
|
|
454
457
|
emptyText: label("table.emptyViewportEffects", "No viewport effects configured."),
|
|
455
458
|
layout: { mode: "auto", overflowX: "auto" },
|
|
456
459
|
},
|
|
@@ -80,5 +80,13 @@ function mapPhiConfigFieldText(field, mapText) {
|
|
|
80
80
|
...(mapped.editLabel == null ? {} : { editLabel: mapOptionalText(mapped.editLabel, mapText) }),
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
if (mapped.type === "condition-group") {
|
|
84
|
+
return {
|
|
85
|
+
...mapped,
|
|
86
|
+
conditionFields: mapped.conditionFields.map((conditionField) => mapPhiConfigFieldText(conditionField, mapText)),
|
|
87
|
+
...(mapped.addLabel == null ? {} : { addLabel: mapOptionalText(mapped.addLabel, mapText) }),
|
|
88
|
+
...(mapped.emptyLabel == null ? {} : { emptyLabel: mapOptionalText(mapped.emptyLabel, mapText) }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
83
91
|
return mapped;
|
|
84
92
|
}
|
package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js
CHANGED
|
@@ -17,6 +17,7 @@ import { getPhiInspectorWidgetLabels } from "../../../../components/widgets/labe
|
|
|
17
17
|
import { getPhiSignalsWidgetLabels } from "../../../../components/widgets/label-sets/signals";
|
|
18
18
|
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
19
19
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
20
|
+
import { PHI_INSPECTOR_DRAWER_BODY_INSET, PHI_INSPECTOR_TABLE_PRESENTATION } from "../../../../helpers/cms-inspector-drawer";
|
|
20
21
|
const PHI_BUILDER_INSPECTOR_SECTIONS = {
|
|
21
22
|
region: [
|
|
22
23
|
[PHI_BUILDER_INSPECTOR_SECTION_WIDGET_IDS.regionGeometry, "builder-region-geometry-inspector", "geometry"],
|
|
@@ -254,8 +255,7 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
254
255
|
// one past the fold. Settings stays the section that opens with the Drawer, so it mounts
|
|
255
256
|
// and can hide its own slot when the layout declares nothing for it.
|
|
256
257
|
accordion: true,
|
|
257
|
-
|
|
258
|
-
innerPadding: PHI_SPACE.sm,
|
|
258
|
+
...PHI_INSPECTOR_DRAWER_BODY_INSET,
|
|
259
259
|
slotTitles: sections.map(([, , sectionKey]) => resolveBuilderInspectorSectionTitle(inspectorLabels, sectionKey)),
|
|
260
260
|
defaultOpenSlotKeys: ["slot_0"],
|
|
261
261
|
/*
|
|
@@ -546,6 +546,8 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
546
546
|
},
|
|
547
547
|
initialQuery: { page: 1, pageSize: 20, filters: { direction: "emit" } },
|
|
548
548
|
presentation: {
|
|
549
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
550
|
+
...PHI_INSPECTOR_TABLE_PRESENTATION,
|
|
549
551
|
layout: { mode: "auto", overflowX: "auto" },
|
|
550
552
|
columns: [
|
|
551
553
|
{ key: "capabilityId", fieldKey: "capabilityId", title: signalsLabels.routes.capability, renderer: "code", sizing: { mode: "content" } },
|
|
@@ -3,6 +3,7 @@ import { createPhiPresetCmsInstanceIdMap, } from "../../../../types/cms-instance
|
|
|
3
3
|
import { PHI_CMS_DEFAULT_SLOT_INDEX, PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS, PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX, } from "../../../../constants/cms-layout-types";
|
|
4
4
|
import { PhiCmsFlags, PhiCmsRegionType, PhiCmsStatus } from "../../../../constants/phi-cms";
|
|
5
5
|
import { PHI_CMS_AREA_KEYS } from "../../../../constants/cms-areas";
|
|
6
|
+
import { PHI_AREA_ICONS } from "../../area-base-definition";
|
|
6
7
|
import { buildPhiCmsLayoutNode } from "../../../../helpers/cms-node-factories";
|
|
7
8
|
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
8
9
|
import { buildPhiHeaderTopActionsLayoutNode } from "../../../../components/regions/presets/phi-header-top-actions-layout";
|
|
@@ -431,6 +432,8 @@ export async function buildPhiDefaultBuilderAreaPresetTree({ page, runtime, }) {
|
|
|
431
432
|
label: "dev header top three column",
|
|
432
433
|
config: {
|
|
433
434
|
balancedSides: true,
|
|
435
|
+
// Three equal columns: what stands in the middle never needs more than a third.
|
|
436
|
+
sideShare: 33,
|
|
434
437
|
contentAlign: "center",
|
|
435
438
|
},
|
|
436
439
|
}),
|
|
@@ -444,6 +447,8 @@ export async function buildPhiDefaultBuilderAreaPresetTree({ page, runtime, }) {
|
|
|
444
447
|
label: "dev header main three column",
|
|
445
448
|
config: {
|
|
446
449
|
balancedSides: true,
|
|
450
|
+
// Three equal columns: what stands in the middle never needs more than a third.
|
|
451
|
+
sideShare: 33,
|
|
447
452
|
contentAlign: "center",
|
|
448
453
|
},
|
|
449
454
|
}),
|
|
@@ -980,6 +985,8 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
980
985
|
label: isStructurePage ? "dev shells workspace header" : "dev pages workspace header",
|
|
981
986
|
config: {
|
|
982
987
|
balancedSides: true,
|
|
988
|
+
// Three equal columns above the canvas, like the Area headers.
|
|
989
|
+
sideShare: 33,
|
|
983
990
|
contentAlign: "center",
|
|
984
991
|
padding: PHI_SPACE.xs,
|
|
985
992
|
paddingLeft: 0,
|
|
@@ -1067,16 +1074,6 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1067
1074
|
...PHI_DIALOG_BODY_CONFIG,
|
|
1068
1075
|
},
|
|
1069
1076
|
}),
|
|
1070
|
-
nodes.layout({
|
|
1071
|
-
creationPreset: { layoutKind: "verticalflex", preset: "panel" },
|
|
1072
|
-
typeKey: "flex-vertical",
|
|
1073
|
-
id: PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS.areaSettingsFields,
|
|
1074
|
-
parentLayoutNodeId: PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS.areaSettingsBody,
|
|
1075
|
-
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
1076
|
-
sortOrder: 0,
|
|
1077
|
-
label: "Builder area settings fields",
|
|
1078
|
-
config: {},
|
|
1079
|
-
}),
|
|
1080
1077
|
nodes.layout({
|
|
1081
1078
|
creationPreset: { layoutKind: "flex", preset: "overlay-actions" },
|
|
1082
1079
|
typeKey: "flex",
|
|
@@ -1221,7 +1218,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1221
1218
|
*
|
|
1222
1219
|
* A Form rather than six Controls in a column, for the one thing a Form does that a stack
|
|
1223
1220
|
* cannot: it states the label column once -- `PHI_FORM_DEFAULT_LAYOUT` puts every caption
|
|
1224
|
-
* in tracks
|
|
1221
|
+
* in one range of tracks and every Control after it -- so the rows line up on an edge of their own
|
|
1225
1222
|
* instead of each being indented by the width of its own caption. None of the questions
|
|
1226
1223
|
* changed, and neither did what an answer is stored as.
|
|
1227
1224
|
*
|
|
@@ -1237,7 +1234,9 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1237
1234
|
nodes.widget({
|
|
1238
1235
|
typeKey: "form",
|
|
1239
1236
|
id: PHI_BUILDER_AREA_SETTINGS_WIDGET_IDS.areaSettingsForm,
|
|
1240
|
-
|
|
1237
|
+
// In the dialog's body itself, as every dialog's Form stands: a Layout of its own between
|
|
1238
|
+
// them was a second inset, which left the Form under 377px and its labels above the fields.
|
|
1239
|
+
parentLayoutNodeId: PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS.areaSettingsBody,
|
|
1241
1240
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[0].slotIndex,
|
|
1242
1241
|
sortOrder: 0,
|
|
1243
1242
|
// The Builder's Label Set, translated already.
|
|
@@ -1572,17 +1571,25 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1572
1571
|
disabledWhen: { source: "row", valuePath: "locked", operator: "truthy" },
|
|
1573
1572
|
},
|
|
1574
1573
|
},
|
|
1575
|
-
|
|
1574
|
+
// Next to the switch, so a scrolled row still says which Module it is.
|
|
1575
|
+
{ key: "title", fieldKey: "title", iconFieldKey: "icon", title: modulesLabels?.columns.title ?? "Module", sortable: true, sticky: "left" },
|
|
1576
1576
|
/*
|
|
1577
1577
|
* One checkbox column per Area: the switch is the Module everywhere, these are
|
|
1578
1578
|
* the per-Area refinement. A Module not eligible for an Area carries null there
|
|
1579
1579
|
* and the cell renders empty; the Area whose Base module the row is stays
|
|
1580
1580
|
* checked and disabled, and so does every Area of a Module that is always active.
|
|
1581
|
+
*
|
|
1582
|
+
* Headed by the Area's icon alone, its name the tooltip and the accessible name,
|
|
1583
|
+
* and all of one width: the names differ in length (App, Accounting) and set six
|
|
1584
|
+
* checkbox columns to six widths, while what is under each is the same checkbox.
|
|
1581
1585
|
*/
|
|
1582
1586
|
...PHI_CMS_AREA_KEYS.map((areaKey) => ({
|
|
1583
1587
|
key: `area_${areaKey}`,
|
|
1584
1588
|
fieldKey: `area_${areaKey}`,
|
|
1585
1589
|
title: modulesLabels?.areas[areaKey] ?? areaKey,
|
|
1590
|
+
titleIcon: PHI_AREA_ICONS[areaKey],
|
|
1591
|
+
titleDisplay: "icon",
|
|
1592
|
+
sizing: { mode: "fixed", width: 44 },
|
|
1586
1593
|
align: "center",
|
|
1587
1594
|
editor: {
|
|
1588
1595
|
control: "checkbox",
|
|
@@ -108,8 +108,15 @@ export function applyPhiWorkspaceCatalogPreload(preload) {
|
|
|
108
108
|
*/
|
|
109
109
|
const publicRoutePathsChanged = JSON.stringify(current.publicRoutePaths) !== preload.keys.publicRoutePaths;
|
|
110
110
|
const catalogHydrationChanged = !current.catalogHydrated;
|
|
111
|
+
/*
|
|
112
|
+
* The Area's landing, where it has one, rather than the first Page in the catalog -- which is an
|
|
113
|
+
* error Page as often as not. The Page list decides once the Area's root route is read: a root
|
|
114
|
+
* that forwards is not on offer there, and the workspace moves on to where it leads.
|
|
115
|
+
*/
|
|
116
|
+
const areaPages = preload.activeCatalogs.modulePresetPagesByArea[current.area] ?? [];
|
|
111
117
|
const initialPageKey = current.pageKey ||
|
|
112
|
-
|
|
118
|
+
areaPages.find((node) => node.storagePath === "/")?.key ||
|
|
119
|
+
resolvePhiBuilderActivePageKey(null, areaPages) || "";
|
|
113
120
|
const initialPageChanged = initialPageKey !== current.pageKey;
|
|
114
121
|
const nextModuleIdsByArea = { ...(current.runtimeModuleIdsByArea ?? {}) };
|
|
115
122
|
for (const [area, moduleIds] of Object.entries(preload.runtimeModuleIdsByArea)) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_CDN_UPLOAD_WIDGET_DEFINITION } from "./widgets/upload/config";
|
|
3
|
+
import { createPhiAuthoringWidgetModule, definePhiAuthoringWidgetModuleLoader, } from "../client-authoring-widget-module";
|
|
4
|
+
/** The upload has no settings and nothing to draw before a file is chosen, so its definition is all. */
|
|
5
|
+
export default createPhiAuthoringWidgetModule([
|
|
6
|
+
definePhiAuthoringWidgetModuleLoader(PHI_CDN_UPLOAD_WIDGET_DEFINITION, () => Promise.resolve(PHI_CDN_UPLOAD_WIDGET_DEFINITION)),
|
|
7
|
+
]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PhiCdnRuntimeModuleAuthoringClient: import("react").ComponentType<import("../contracts").PhiRuntimeModuleAuthoringClientProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import WidgetModule from "./authoring-widgets";
|
|
3
|
+
import { createPhiRuntimeModuleAuthoringClient } from "../client-authoring-module";
|
|
4
|
+
import { PHI_CDN_RUNTIME_MODULE_ID } from "./ids";
|
|
5
|
+
export const PhiCdnRuntimeModuleAuthoringClient = createPhiRuntimeModuleAuthoringClient({
|
|
6
|
+
moduleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
7
|
+
WidgetModule,
|
|
8
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A size as the CDN page says it: binary units, as the parts and the Media limits are counted, written
|
|
3
|
+
* with the reader's digits. Whole bytes below one KiB, one decimal above.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatPhiCdnBytes(bytes: number, locale: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const UNITS = ["B", "KiB", "MiB", "GiB", "TiB"];
|
|
2
|
+
/**
|
|
3
|
+
* A size as the CDN page says it: binary units, as the parts and the Media limits are counted, written
|
|
4
|
+
* with the reader's digits. Whole bytes below one KiB, one decimal above.
|
|
5
|
+
*/
|
|
6
|
+
export function formatPhiCdnBytes(bytes, locale) {
|
|
7
|
+
if (!Number.isFinite(bytes) || bytes < 0)
|
|
8
|
+
return "";
|
|
9
|
+
let value = bytes;
|
|
10
|
+
let unit = 0;
|
|
11
|
+
while (value >= 1024 && unit < UNITS.length - 1) {
|
|
12
|
+
value /= 1024;
|
|
13
|
+
unit += 1;
|
|
14
|
+
}
|
|
15
|
+
const digits = new Intl.NumberFormat(locale, { maximumFractionDigits: unit === 0 ? 0 : 1 }).format(value);
|
|
16
|
+
return `${digits} ${UNITS[unit]}`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS, PHI_CDN_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
export const PHI_CDN_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
|
|
4
|
+
{
|
|
5
|
+
key: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
6
|
+
ownerModuleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
7
|
+
loadLive: async () => (await import("./services/table")).PhiCdnTableProviderClient,
|
|
8
|
+
},
|
|
9
|
+
];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Site's CDN catalogue and the check of its bucket, over Core's Admin routes
|
|
3
|
+
* (`/api/site/admin/cdn`, phis-server; Admins and Maintainers). Every write is Core's to allow: the
|
|
4
|
+
* Page only offers it.
|
|
5
|
+
*
|
|
6
|
+
* `files` is the catalogue: every file offered under the Site's name, copied into the bucket (`cdn`) or
|
|
7
|
+
* linked where its source keeps it (`link`), with what became of it. A key is the file's whole identity
|
|
8
|
+
* and is never written twice, so withdrawing and deleting keep the row: the key stays taken.
|
|
9
|
+
*
|
|
10
|
+
* `check` is one run of the bucket against the catalogue, read when its dialog opens. Its rows are what
|
|
11
|
+
* it found -- an object the catalogue does not hold, a file the bucket does not hold, a size that differs
|
|
12
|
+
* -- and an unrecorded object Core can take into the catalogue offers `adopt`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
15
|
+
key: `${string}/${string}`;
|
|
16
|
+
ownerModuleId: "@phis/ui/modules/cdn";
|
|
17
|
+
kind: "table";
|
|
18
|
+
executionMode: "live";
|
|
19
|
+
authoringMode: "none";
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
resources: ({
|
|
23
|
+
resourceKey: "files";
|
|
24
|
+
title: string;
|
|
25
|
+
rowIdentityPath: string;
|
|
26
|
+
recordRead: true;
|
|
27
|
+
fields: ({
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
type: "string";
|
|
31
|
+
required: true;
|
|
32
|
+
} | {
|
|
33
|
+
key: string;
|
|
34
|
+
title: string;
|
|
35
|
+
type: "number";
|
|
36
|
+
required?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
key: string;
|
|
39
|
+
title: string;
|
|
40
|
+
type: "string";
|
|
41
|
+
required?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
key: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: "json";
|
|
46
|
+
required?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
key: string;
|
|
49
|
+
title: string;
|
|
50
|
+
type: "datetime";
|
|
51
|
+
required?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
key: string;
|
|
54
|
+
title: string;
|
|
55
|
+
type: "boolean";
|
|
56
|
+
required?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
query: {
|
|
59
|
+
search: true;
|
|
60
|
+
filterFields: string[];
|
|
61
|
+
sorting: "single";
|
|
62
|
+
pagination: "offset";
|
|
63
|
+
total: true;
|
|
64
|
+
};
|
|
65
|
+
actions: ({
|
|
66
|
+
key: string;
|
|
67
|
+
title: string;
|
|
68
|
+
scope: "row";
|
|
69
|
+
intent: "read";
|
|
70
|
+
confirmation?: undefined;
|
|
71
|
+
disabledWhen?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
key: string;
|
|
74
|
+
title: string;
|
|
75
|
+
scope: "row";
|
|
76
|
+
intent: "destructive";
|
|
77
|
+
confirmation: "required";
|
|
78
|
+
disabledWhen: {
|
|
79
|
+
source: "row";
|
|
80
|
+
valuePath: string;
|
|
81
|
+
operator: "truthy";
|
|
82
|
+
};
|
|
83
|
+
})[];
|
|
84
|
+
summaryFields?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
resourceKey: "check";
|
|
87
|
+
title: string;
|
|
88
|
+
rowIdentityPath: string;
|
|
89
|
+
fields: ({
|
|
90
|
+
key: string;
|
|
91
|
+
title: string;
|
|
92
|
+
type: "string";
|
|
93
|
+
required: true;
|
|
94
|
+
} | {
|
|
95
|
+
key: string;
|
|
96
|
+
title: string;
|
|
97
|
+
type: "string";
|
|
98
|
+
required?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
key: string;
|
|
101
|
+
title: string;
|
|
102
|
+
type: "boolean";
|
|
103
|
+
required?: undefined;
|
|
104
|
+
})[];
|
|
105
|
+
summaryFields: ({
|
|
106
|
+
key: string;
|
|
107
|
+
title: string;
|
|
108
|
+
type: "number";
|
|
109
|
+
} | {
|
|
110
|
+
key: string;
|
|
111
|
+
title: string;
|
|
112
|
+
type: "boolean";
|
|
113
|
+
})[];
|
|
114
|
+
query: {
|
|
115
|
+
search: false;
|
|
116
|
+
filterFields: never[];
|
|
117
|
+
sorting: "none";
|
|
118
|
+
pagination: "none";
|
|
119
|
+
total?: undefined;
|
|
120
|
+
};
|
|
121
|
+
actions: {
|
|
122
|
+
key: string;
|
|
123
|
+
title: string;
|
|
124
|
+
scope: "row";
|
|
125
|
+
intent: "write";
|
|
126
|
+
visibleWhen: {
|
|
127
|
+
source: "row";
|
|
128
|
+
valuePath: string;
|
|
129
|
+
operator: "truthy";
|
|
130
|
+
};
|
|
131
|
+
}[];
|
|
132
|
+
recordRead?: undefined;
|
|
133
|
+
})[];
|
|
134
|
+
}[];
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS, PHI_CDN_RUNTIME_MODULE_ID, PHI_CDN_TABLE_RESOURCE_KEYS, } from "./ids";
|
|
2
|
+
/**
|
|
3
|
+
* The Site's CDN catalogue and the check of its bucket, over Core's Admin routes
|
|
4
|
+
* (`/api/site/admin/cdn`, phis-server; Admins and Maintainers). Every write is Core's to allow: the
|
|
5
|
+
* Page only offers it.
|
|
6
|
+
*
|
|
7
|
+
* `files` is the catalogue: every file offered under the Site's name, copied into the bucket (`cdn`) or
|
|
8
|
+
* linked where its source keeps it (`link`), with what became of it. A key is the file's whole identity
|
|
9
|
+
* and is never written twice, so withdrawing and deleting keep the row: the key stays taken.
|
|
10
|
+
*
|
|
11
|
+
* `check` is one run of the bucket against the catalogue, read when its dialog opens. Its rows are what
|
|
12
|
+
* it found -- an object the catalogue does not hold, a file the bucket does not hold, a size that differs
|
|
13
|
+
* -- and an unrecorded object Core can take into the catalogue offers `adopt`.
|
|
14
|
+
*/
|
|
15
|
+
export const PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
16
|
+
{
|
|
17
|
+
key: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
18
|
+
ownerModuleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
19
|
+
kind: "table",
|
|
20
|
+
executionMode: "live",
|
|
21
|
+
authoringMode: "none",
|
|
22
|
+
title: "CDN",
|
|
23
|
+
description: "The Site's CDN catalogue and the check of its bucket.",
|
|
24
|
+
resources: [
|
|
25
|
+
{
|
|
26
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.files,
|
|
27
|
+
title: "CDN files",
|
|
28
|
+
rowIdentityPath: "key",
|
|
29
|
+
recordRead: true,
|
|
30
|
+
fields: [
|
|
31
|
+
{ key: "key", title: "Key", type: "string", required: true },
|
|
32
|
+
{ key: "name", title: "Name", type: "string", required: true },
|
|
33
|
+
{ key: "version", title: "Version", type: "string", required: true },
|
|
34
|
+
{ key: "fileName", title: "File", type: "string", required: true },
|
|
35
|
+
{ key: "sizeBytes", title: "Size in bytes", type: "number" },
|
|
36
|
+
{ key: "sizeLabel", title: "Size", type: "string" },
|
|
37
|
+
{ key: "storage", title: "Storage", type: "string" },
|
|
38
|
+
// `PhisCdnFileOs` and `PhisCdnFileArch` bits as one tag each: `macos`, `arm64`.
|
|
39
|
+
{ key: "platform", title: "Platform", type: "json" },
|
|
40
|
+
{ key: "sha256", title: "SHA-256", type: "string" },
|
|
41
|
+
{ key: "contentType", title: "Content type", type: "string" },
|
|
42
|
+
{ key: "publishedAt", title: "Published", type: "datetime" },
|
|
43
|
+
{ key: "url", title: "Address", type: "string" },
|
|
44
|
+
{ key: "state", title: "State", type: "string" },
|
|
45
|
+
// The kind (`cli`, `upload`) or, for an Add-on's file, the Add-on's id.
|
|
46
|
+
{ key: "origin", title: "Origin", type: "string" },
|
|
47
|
+
{ key: "addonId", title: "Add-on", type: "string" },
|
|
48
|
+
{ key: "actorUserId", title: "Uploaded by", type: "number" },
|
|
49
|
+
{ key: "sourceUrl", title: "Source address", type: "string" },
|
|
50
|
+
{ key: "withdrawDisabled", title: "Withdrawn already", type: "boolean" },
|
|
51
|
+
{ key: "deleteDisabled", title: "Deleted already", type: "boolean" },
|
|
52
|
+
],
|
|
53
|
+
query: {
|
|
54
|
+
search: true,
|
|
55
|
+
filterFields: ["state", "name"],
|
|
56
|
+
sorting: "single",
|
|
57
|
+
pagination: "offset",
|
|
58
|
+
total: true,
|
|
59
|
+
},
|
|
60
|
+
actions: [
|
|
61
|
+
{ key: "copy-url", title: "Copy address", scope: "row", intent: "read" },
|
|
62
|
+
{
|
|
63
|
+
key: "withdraw",
|
|
64
|
+
title: "Withdraw",
|
|
65
|
+
scope: "row",
|
|
66
|
+
intent: "destructive",
|
|
67
|
+
confirmation: "required",
|
|
68
|
+
disabledWhen: { source: "row", valuePath: "withdrawDisabled", operator: "truthy" },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "delete",
|
|
72
|
+
title: "Delete",
|
|
73
|
+
scope: "row",
|
|
74
|
+
intent: "destructive",
|
|
75
|
+
confirmation: "required",
|
|
76
|
+
disabledWhen: { source: "row", valuePath: "deleteDisabled", operator: "truthy" },
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.check,
|
|
82
|
+
title: "CDN check",
|
|
83
|
+
rowIdentityPath: "id",
|
|
84
|
+
fields: [
|
|
85
|
+
{ key: "id", title: "Finding", type: "string", required: true },
|
|
86
|
+
{ key: "key", title: "Key", type: "string", required: true },
|
|
87
|
+
// `unrecorded`, `missing` or `size-mismatch`.
|
|
88
|
+
{ key: "finding", title: "Finding", type: "string", required: true },
|
|
89
|
+
{ key: "sizeLabel", title: "Size", type: "string" },
|
|
90
|
+
{ key: "recordedLabel", title: "Recorded size", type: "string" },
|
|
91
|
+
{ key: "reason", title: "Reason", type: "string" },
|
|
92
|
+
{ key: "adoptable", title: "Can be adopted", type: "boolean" },
|
|
93
|
+
],
|
|
94
|
+
summaryFields: [
|
|
95
|
+
{ key: "objects", title: "Objects in the bucket", type: "number" },
|
|
96
|
+
{ key: "recorded", title: "Copied files in the catalogue", type: "number" },
|
|
97
|
+
{ key: "consistent", title: "Bucket and catalogue agree", type: "boolean" },
|
|
98
|
+
],
|
|
99
|
+
query: {
|
|
100
|
+
search: false,
|
|
101
|
+
filterFields: [],
|
|
102
|
+
sorting: "none",
|
|
103
|
+
pagination: "none",
|
|
104
|
+
},
|
|
105
|
+
actions: [
|
|
106
|
+
{
|
|
107
|
+
key: "adopt",
|
|
108
|
+
title: "Adopt",
|
|
109
|
+
scope: "row",
|
|
110
|
+
intent: "write",
|
|
111
|
+
visibleWhen: { source: "row", valuePath: "adoptable", operator: "truthy" },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
];
|