@phis/ui 0.5.2 → 0.5.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/README.md +1 -1
- package/components/controls/phi-border-control.js +1 -1
- package/components/controls/phi-bound-radius-control.js +9 -9
- package/components/controls/phi-brand-control.js +1 -1
- package/components/controls/phi-cascader-control.d.ts +9 -1
- package/components/controls/phi-cascader-control.js +25 -3
- package/components/controls/phi-drawer-control-adapter.js +4 -4
- package/components/controls/phi-dropdown-control.js +2 -2
- package/components/controls/phi-form-control.js +1 -1
- package/components/controls/phi-image-control.js +1 -1
- package/components/controls/phi-mask-picker-control.js +6 -6
- package/components/controls/phi-money-control.d.ts +39 -0
- package/components/controls/phi-money-control.js +34 -0
- package/components/controls/phi-number-control.d.ts +6 -1
- package/components/controls/phi-number-control.js +3 -3
- package/components/controls/phi-options-provider.d.ts +7 -0
- package/components/controls/phi-options-provider.js +11 -0
- package/components/controls/phi-select-control.js +1 -1
- package/components/controls/phi-theme-scope-control.js +1 -1
- package/components/controls/use-phi-color-control-presets.js +2 -2
- package/components/forms/compound-form-controls.js +2 -2
- package/components/forms/extended-form-field-controls.d.ts +1 -0
- package/components/forms/extended-form-field-controls.js +24 -2
- package/components/forms/form-descriptor-runtime-client.js +13 -0
- package/components/forms/form-provider-contract.d.ts +43 -0
- package/components/forms/form-provider-contract.js +40 -0
- package/components/forms/money-field.d.ts +27 -0
- package/components/forms/money-field.js +78 -0
- package/components/forms/shared-form-provider-registry.js +6 -2
- package/components/layouts/clients/phi-flex-layout-client.js +4 -4
- package/components/layouts/clients/phi-grid-layout-client.js +3 -3
- package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
- package/components/layouts/layout-definitions.d.ts +4 -4
- package/components/layouts/phi-page-region-layout.js +1 -1
- package/components/layouts/phi-structure-region-layout.js +3 -3
- package/components/media/phi-asset-focal-rect-widget.js +4 -4
- package/components/media/phi-asset-inspector-section.js +1 -1
- package/components/media/phi-media-kind-icon.js +2 -2
- package/components/media/phi-media-picker-binding.js +6 -1
- package/components/media/phi-media-restricted-icon.js +1 -1
- package/components/media/phi-site-font-assets.js +6 -1
- package/components/motion/phi-sequence-run.d.ts +14 -1
- package/components/motion/phi-sequence-run.js +22 -3
- package/components/motion/phi-sequence-viewport.js +3 -1
- package/components/overlays/phi-overlay-container-client.js +1 -1
- package/components/regions/presets/content-entry-editor-page-tree.js +3 -1
- package/components/regions/presets/phi-base-page-column.js +6 -2
- package/components/root/phi-config-provider.js +1 -1
- package/components/root/phi-root-background.js +1 -1
- package/components/root/phi-root-theme-resolver.js +1 -1
- package/components/shell/phi-module-icons.js +1 -1
- package/components/tables/client/phi-table-binding.js +16 -3
- package/components/trees/client/phi-tree-binding.js +6 -2
- package/components/widgets/built-in/builder-workspace-preview.js +8 -8
- package/components/widgets/client/bullet-list-entries-editor.js +2 -2
- package/components/widgets/client/external-document-editor.js +1 -1
- package/components/widgets/client/html-editor.js +3 -3
- package/components/widgets/client/shared/phi-collection-view-binding.js +10 -2
- package/components/widgets/client/shared/phi-rendered-value.d.ts +9 -1
- package/components/widgets/client/shared/phi-rendered-value.js +20 -1
- package/components/widgets/config/background.d.ts +1 -1
- package/components/widgets/config/background.js +1 -1
- package/components/widgets/config/choice-shared.d.ts +2 -2
- package/components/widgets/inspector-field-row.js +1 -1
- package/components/widgets/label-sets/gallery.js +6 -0
- package/components/widgets/label-sets/inspector.js +2 -0
- package/components/widgets/label-sets/interval.d.ts +4 -0
- package/components/widgets/label-sets/interval.js +31 -0
- package/components/widgets/label-sets/record.js +6 -1
- package/components/widgets/label-sets/slot-upload.d.ts +4 -0
- package/components/widgets/label-sets/slot-upload.js +36 -0
- package/components/widgets/label-sets/table.js +6 -1
- package/components/widgets/label-types/gallery.d.ts +7 -0
- package/components/widgets/label-types/gallery.js +6 -0
- package/components/widgets/label-types/inspector.d.ts +1 -0
- package/components/widgets/label-types/inspector.js +1 -0
- package/components/widgets/label-types/interval.d.ts +16 -0
- package/components/widgets/label-types/interval.js +21 -0
- package/components/widgets/label-types/record.d.ts +3 -0
- package/components/widgets/label-types/record.js +2 -0
- package/components/widgets/label-types/slot-upload.d.ts +24 -0
- package/components/widgets/label-types/slot-upload.js +16 -0
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/shared/card-body-client.js +1 -1
- package/components/widgets/shared/result-body-client.js +1 -1
- package/constants/media-library-provider-keys.d.ts +8 -1
- package/constants/media-library-provider-keys.js +8 -1
- package/constants/record-field-kinds.d.ts +6 -0
- package/constants/record-field-kinds.js +7 -0
- package/constants/runtime-module-ownership.js +2 -1
- package/controls.d.ts +7 -0
- package/controls.js +4 -0
- package/helpers/border-widget-style.d.ts +2 -2
- package/helpers/border-widget-style.js +2 -2
- package/helpers/cms-dialog.d.ts +43 -7
- package/helpers/cms-dialog.js +46 -4
- package/helpers/cms-layout-defaults.d.ts +2 -2
- package/helpers/cms-page-catalog.d.ts +13 -0
- package/helpers/cms-page-catalog.js +18 -2
- package/helpers/cms-preset-nodes.d.ts +13 -3
- package/helpers/cms-preset-nodes.js +3 -2
- package/helpers/cms-preset-page-tree.d.ts +4 -0
- package/helpers/cms-preset-page-tree.js +2 -0
- package/helpers/layout-style.d.ts +2 -2
- package/helpers/money-amount.d.ts +48 -0
- package/helpers/money-amount.js +131 -0
- package/helpers/page-layout-check.d.ts +4 -1
- package/helpers/page-layout-check.js +41 -2
- package/helpers/record-fields.d.ts +22 -0
- package/helpers/record-fields.js +109 -0
- package/helpers/surface-presets.d.ts +6 -6
- package/helpers/surface-style.d.ts +1 -1
- package/helpers.d.ts +0 -1
- package/helpers.js +0 -2
- package/module-page-check.d.ts +12 -0
- package/module-page-check.js +12 -0
- package/module-records.d.ts +7 -2
- package/module-records.js +5 -1
- package/next/antd-form-context-loader.mjs +31 -0
- package/next/config.d.mts +2 -0
- package/next/config.mjs +36 -3
- package/package.json +11 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -1
- package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
- package/plugins/runtime-modules/asset/data-providers.js +0 -40
- package/plugins/runtime-modules/asset/definition.d.ts +0 -60
- package/plugins/runtime-modules/asset/ids.d.ts +0 -1
- package/plugins/runtime-modules/asset/ids.js +1 -2
- package/plugins/runtime-modules/asset/presets.d.ts +1 -0
- package/plugins/runtime-modules/asset/server.js +0 -5
- package/plugins/runtime-modules/asset/services/collection.js +1 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +3 -0
- package/plugins/runtime-modules/blog/presets.d.ts +1 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
- package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
- package/plugins/runtime-modules/builder/offered-page-catalog.js +3 -3
- package/plugins/runtime-modules/builder/options-providers.js +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
- package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
- package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +6 -3
- package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
- package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
- package/plugins/runtime-modules/contracts.js +41 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
- package/plugins/runtime-modules/core/data-providers.js +41 -0
- package/plugins/runtime-modules/core/definition.d.ts +98 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +43 -0
- package/plugins/runtime-modules/core/server.js +5 -0
- package/plugins/runtime-modules/core/widgets/breadcrumb/client.d.ts +6 -3
- package/plugins/runtime-modules/core/widgets/breadcrumb/client.js +6 -5
- package/plugins/runtime-modules/core/widgets/breadcrumb/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.d.ts +9 -1
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +29 -3
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
- package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
- package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/cascader/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/cascader/config.d.ts +8 -2
- package/plugins/runtime-modules/core/widgets/cascader/config.js +22 -0
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/gallery/authoring.js +12 -3
- package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/gallery/client.js +38 -21
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +18 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.js +24 -0
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
- package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
- package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
- package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/multi-select/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +8 -2
- package/plugins/runtime-modules/core/widgets/record/config.js +4 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/select-box/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/authoring.js +2 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/client.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +45 -24
- package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +12 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/config.js +18 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +4 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +9 -3
- package/plugins/runtime-modules/core/widgets/slot-upload/server.js +17 -3
- package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/steps/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
- package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
- package/plugins/runtime-modules/descriptor-compiler.d.ts +11 -1
- package/plugins/runtime-modules/descriptor-compiler.js +57 -8
- package/plugins/runtime-modules/editor/presets.d.ts +1 -0
- package/plugins/runtime-modules/groups/definition.d.ts +1 -1
- package/plugins/runtime-modules/groups/forms.d.ts +18 -0
- package/plugins/runtime-modules/groups/forms.js +2 -2
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +6 -4
- package/plugins/runtime-modules/localization/presets.d.ts +1 -0
- package/plugins/runtime-modules/news/presets.d.ts +1 -0
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/resolver.js +7 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
- package/plugins/runtime-modules/theme/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +4 -2
- package/plugins/runtime-modules/user-management/controller/client.js +6 -1
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -3
- package/runtime-render-client.d.ts +1 -1
- package/runtime-render-client.js +2 -1
- package/server-helpers/cms-page-record.d.ts +26 -0
- package/server-helpers/cms-page-record.js +52 -0
- package/server-helpers/cms-request.js +48 -4
- package/server-helpers/record-fields.d.ts +62 -0
- package/server-helpers/record-fields.js +86 -0
- package/server-helpers/record-samples.d.ts +21 -0
- package/server-helpers/record-samples.js +49 -0
- package/styles/builder-scaffold.css +19 -19
- package/styles/controls.css +109 -109
- package/styles/gradients.css +23 -23
- package/styles/layout-affordances.css +15 -15
- package/styles/layout-authoring-scaffold.css +20 -20
- package/styles/layout.css +9 -9
- package/styles/root.css +4 -4
- package/styles/shell.css +48 -17
- package/theme/antd-css-var-contract.d.ts +86 -80
- package/theme/antd-css-var-contract.js +92 -81
- package/theme/phi-control-shape.d.ts +1 -1
- package/theme/phi-theme-gradients.d.ts +2 -2
- package/theme/phi-theme-gradients.js +14 -14
- package/theme/phi-theme-palette.d.ts +1 -1
- package/theme/phi-theme-palette.js +2 -2
- package/theme/phi-theme-tokens.d.ts +8 -5
- package/theme/phi-theme-tokens.js +59 -28
- package/theme/phi-theme.d.ts +14 -2
- package/theme/phi-theme.js +14 -1
- package/theme/phi-tokens.d.ts +5 -0
- package/theme/phi-tokens.js +9 -0
- package/types/cms-module-descriptors.d.ts +9 -0
- package/types/cms-plugins.d.ts +27 -1
- package/types/collection-provider.d.ts +7 -0
- package/types/core-widget-placements.d.ts +42 -0
- package/types/record-provider.d.ts +109 -1
- package/types/table-widget.d.ts +33 -1
- package/types/table-widget.js +1 -0
- package/types/tree-widget.d.ts +7 -0
- package/types/widget-runtime.d.ts +5 -0
- package/types.d.ts +1 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
package/next/config.mjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* What a Site's `next.config` takes from this package: the structural CSS of every Ant Design component,
|
|
3
3
|
* generated from the Ant Design the Site has installed.
|
|
4
4
|
*
|
|
5
|
-
* Ant Design emits two kinds of CSS. The structure -- `.ant-btn{padding:...;color:var(--
|
|
5
|
+
* Ant Design emits two kinds of CSS. The structure -- `.ant-btn{padding:...;color:var(--phi-color-text)}`
|
|
6
6
|
* -- reads every Theme value through a custom property, so it is the same for every Site, Theme and mode.
|
|
7
|
-
* The custom properties themselves -- `.phi-root-...{--
|
|
7
|
+
* The custom properties themselves -- `.phi-root-...{--phi-color-primary:...}` -- are what a Theme
|
|
8
8
|
* decides. The root runs Ant Design with `zeroRuntime`, which drops the structure from rendering and
|
|
9
9
|
* keeps the properties; this file is where the structure comes from instead. Generating it at runtime
|
|
10
10
|
* cost about 10 ms of CPU per page view and 40-140 KB of inline CSS per page (measured 04.10.2026).
|
|
@@ -189,7 +189,7 @@ export function generatePhiAntdStaticCss(projectDir = process.cwd()) {
|
|
|
189
189
|
const h = react.createElement;
|
|
190
190
|
const { createCache, extractStyle, px2remTransformer, StyleProvider } = site.cssinjs;
|
|
191
191
|
const cache = createCache();
|
|
192
|
-
const theme = { hashed: false, cssVar: { prefix: "
|
|
192
|
+
const theme = { hashed: false, cssVar: { prefix: "phi", key: "phi-static" } };
|
|
193
193
|
withoutDeprecationNotices(() => site.renderToString(
|
|
194
194
|
h(StyleProvider, {
|
|
195
195
|
cache,
|
|
@@ -277,6 +277,35 @@ export function readPhiSitePublicHost(dir = process.cwd()) {
|
|
|
277
277
|
return new URL(publicUrl).hostname;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
/**
|
|
281
|
+
* The Turbopack rule that patches Ant Design 6.7's Form context import (next/antd-form-context-loader.mjs),
|
|
282
|
+
* or none for any other Ant Design: the patch is for 6.7 only, and a newer release is to be checked and the
|
|
283
|
+
* patch removed rather than carried along by default.
|
|
284
|
+
*/
|
|
285
|
+
export function readPhiAntdFormContextPatchRule(dir = process.cwd()) {
|
|
286
|
+
let version;
|
|
287
|
+
try {
|
|
288
|
+
version = JSON.parse(readFileSync(createRequire(path.join(dir, "package.json")).resolve("antd/package.json"), "utf8")).version;
|
|
289
|
+
} catch {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
if (!/^6\.7\./u.test(version)) {
|
|
293
|
+
if (/^6\.(?:[89]|\d{2,})\./u.test(version) || /^(?:[7-9]|\d{2,})\./u.test(version)) {
|
|
294
|
+
console.warn(
|
|
295
|
+
`@phis/ui: Ant Design ${version} is past 6.7; check whether antd/es/form/context.js still imports `
|
|
296
|
+
+ "@rc-component/form whole, and remove the Form provider patch if it does not (TODOS.md).",
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
"context.js": {
|
|
303
|
+
condition: { path: /[\\/]antd[\\/]es[\\/]form[\\/]context\.js$/u },
|
|
304
|
+
loaders: ["@phis/ui/next/antd-form-context-loader"],
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
280
309
|
/**
|
|
281
310
|
* A Site's `next.config`, with `@phis/ui/antd-static.css` resolved to the structure generated for its
|
|
282
311
|
* Ant Design, and the Site's own public host allowed to reach the dev server. `dir` is the Site's root,
|
|
@@ -295,6 +324,10 @@ export function withPhiNextConfig(nextConfig, { dir = process.cwd() } = {}) {
|
|
|
295
324
|
...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
|
|
296
325
|
turbopack: {
|
|
297
326
|
...nextConfig.turbopack,
|
|
327
|
+
rules: {
|
|
328
|
+
...nextConfig.turbopack?.rules,
|
|
329
|
+
...readPhiAntdFormContextPatchRule(dir),
|
|
330
|
+
},
|
|
298
331
|
resolveAlias: {
|
|
299
332
|
...nextConfig.turbopack?.resolveAlias,
|
|
300
333
|
[PHI_ANTD_STATIC_CSS]: file,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -117,6 +117,10 @@
|
|
|
117
117
|
"import": "./next/config.mjs",
|
|
118
118
|
"default": "./next/config.mjs"
|
|
119
119
|
},
|
|
120
|
+
"./next/antd-form-context-loader": {
|
|
121
|
+
"import": "./next/antd-form-context-loader.mjs",
|
|
122
|
+
"default": "./next/antd-form-context-loader.mjs"
|
|
123
|
+
},
|
|
120
124
|
"./next/overlay-zones-client": {
|
|
121
125
|
"types": "./components/overlays/phi-overlay-zones-loader.d.ts",
|
|
122
126
|
"import": "./components/overlays/phi-overlay-zones-loader.js",
|
|
@@ -282,6 +286,11 @@
|
|
|
282
286
|
"import": "./module-records.js",
|
|
283
287
|
"default": "./module-records.js"
|
|
284
288
|
},
|
|
289
|
+
"./module/page-check": {
|
|
290
|
+
"types": "./module-page-check.d.ts",
|
|
291
|
+
"import": "./module-page-check.js",
|
|
292
|
+
"default": "./module-page-check.js"
|
|
293
|
+
},
|
|
285
294
|
"./module/references": {
|
|
286
295
|
"types": "./module-references.d.ts",
|
|
287
296
|
"import": "./module-references.js",
|
|
@@ -507,7 +516,7 @@
|
|
|
507
516
|
"@lexical/rich-text": "0.50.0",
|
|
508
517
|
"@lexical/selection": "0.50.0",
|
|
509
518
|
"@lexical/utils": "0.50.0",
|
|
510
|
-
"@phis/contracts": "^0.7.
|
|
519
|
+
"@phis/contracts": "^0.7.9",
|
|
511
520
|
"dayjs": "^1.11.23",
|
|
512
521
|
"dom-serializer": "^2.0.0",
|
|
513
522
|
"htmlparser2": "^10.1.0",
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* to the Core Runtime Controller; a Module's own goes into that Module's Controller, mounted on demand.
|
|
5
5
|
*/
|
|
6
6
|
export declare const PHI_ACCOUNTING_RUNTIME_MODULE: {
|
|
7
|
-
icon: string;
|
|
8
7
|
moduleId: "@phis/ui/modules/accounting";
|
|
9
8
|
category: "foundation";
|
|
10
9
|
description: string;
|
|
10
|
+
icon: string;
|
|
11
11
|
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
12
12
|
kind: "module";
|
|
13
13
|
eligibleAreas: readonly ["public" | "app" | "admin" | "builder" | "editor" | "accounting"];
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* to the Core Runtime Controller; a Module's own goes into that Module's Controller, mounted on demand.
|
|
5
5
|
*/
|
|
6
6
|
export declare const PHI_APP_RUNTIME_MODULE: {
|
|
7
|
-
icon: string;
|
|
8
7
|
moduleId: "@phis/ui/modules/app";
|
|
9
8
|
category: "foundation";
|
|
10
9
|
description: string;
|
|
10
|
+
icon: string;
|
|
11
11
|
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
12
12
|
formProviders: {
|
|
13
13
|
handlers: ({
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { PhiTableProviderResourceDescriptor } from "../../../types/table-widget";
|
|
2
|
-
/** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
|
|
3
|
-
export declare const PHI_MEDIA_FOLDER_IMAGES_SORTS: readonly ["name_asc", "created_at_desc"];
|
|
4
|
-
export declare const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
|
|
5
|
-
/** What the server hands out at most (`/api/v1/site/media/folder-images`). */
|
|
6
|
-
export declare const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
|
|
7
2
|
/** The existing User and Group Spaces, one resource per kind, for the Admin storage table. */
|
|
8
3
|
export declare const PHI_ASSET_STORAGE_SPACES_RESOURCES: readonly PhiTableProviderResourceDescriptor[];
|
|
9
4
|
export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
@@ -16,7 +11,6 @@ export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
16
11
|
description: string;
|
|
17
12
|
resources: readonly PhiTableProviderResourceDescriptor[];
|
|
18
13
|
availableToAuthoringChrome?: undefined;
|
|
19
|
-
settingsFields?: undefined;
|
|
20
14
|
} | {
|
|
21
15
|
key: `${string}/${string}`;
|
|
22
16
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -27,7 +21,6 @@ export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
27
21
|
description: string;
|
|
28
22
|
resources?: undefined;
|
|
29
23
|
availableToAuthoringChrome?: undefined;
|
|
30
|
-
settingsFields?: undefined;
|
|
31
24
|
} | {
|
|
32
25
|
key: `${string}/${string}`;
|
|
33
26
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -38,63 +31,6 @@ export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
38
31
|
description: string;
|
|
39
32
|
availableToAuthoringChrome: true;
|
|
40
33
|
resources?: undefined;
|
|
41
|
-
settingsFields?: undefined;
|
|
42
|
-
} | {
|
|
43
|
-
key: `${string}/${string}`;
|
|
44
|
-
ownerModuleId: "@phis/ui/modules/asset";
|
|
45
|
-
kind: "record";
|
|
46
|
-
executionMode: "live";
|
|
47
|
-
authoringMode: "none";
|
|
48
|
-
title: string;
|
|
49
|
-
description: string;
|
|
50
|
-
settingsFields: ({
|
|
51
|
-
key: string;
|
|
52
|
-
type: "choice";
|
|
53
|
-
heading: string;
|
|
54
|
-
label: string;
|
|
55
|
-
optionsProvider: {
|
|
56
|
-
providerKey: `${string}/${string}`;
|
|
57
|
-
};
|
|
58
|
-
description?: undefined;
|
|
59
|
-
options?: undefined;
|
|
60
|
-
min?: undefined;
|
|
61
|
-
max?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
key: string;
|
|
64
|
-
type: "boolean";
|
|
65
|
-
label: string;
|
|
66
|
-
description: string;
|
|
67
|
-
heading?: undefined;
|
|
68
|
-
optionsProvider?: undefined;
|
|
69
|
-
options?: undefined;
|
|
70
|
-
min?: undefined;
|
|
71
|
-
max?: undefined;
|
|
72
|
-
} | {
|
|
73
|
-
key: string;
|
|
74
|
-
type: "choice";
|
|
75
|
-
label: string;
|
|
76
|
-
options: {
|
|
77
|
-
value: string;
|
|
78
|
-
label: string;
|
|
79
|
-
}[];
|
|
80
|
-
heading?: undefined;
|
|
81
|
-
optionsProvider?: undefined;
|
|
82
|
-
description?: undefined;
|
|
83
|
-
min?: undefined;
|
|
84
|
-
max?: undefined;
|
|
85
|
-
} | {
|
|
86
|
-
key: string;
|
|
87
|
-
type: "number";
|
|
88
|
-
label: string;
|
|
89
|
-
min: number;
|
|
90
|
-
max: number;
|
|
91
|
-
heading?: undefined;
|
|
92
|
-
optionsProvider?: undefined;
|
|
93
|
-
description?: undefined;
|
|
94
|
-
options?: undefined;
|
|
95
|
-
})[];
|
|
96
|
-
resources?: undefined;
|
|
97
|
-
availableToAuthoringChrome?: undefined;
|
|
98
34
|
} | {
|
|
99
35
|
key: `${string}/${string}`;
|
|
100
36
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -145,5 +81,4 @@ export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
145
81
|
title: string;
|
|
146
82
|
}[];
|
|
147
83
|
}[];
|
|
148
|
-
settingsFields?: undefined;
|
|
149
84
|
})[];
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../types/signals";
|
|
2
2
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS, PHI_ASSET_RUNTIME_ITEM_RENDERER_KEY } from "./ids";
|
|
3
3
|
import { PHI_ASSET_RUNTIME_MODULE_ID } from "./ids";
|
|
4
|
-
/** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
|
|
5
|
-
export const PHI_MEDIA_FOLDER_IMAGES_SORTS = ["name_asc", "created_at_desc"];
|
|
6
|
-
export const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
|
|
7
|
-
/** What the server hands out at most (`/api/v1/site/media/folder-images`). */
|
|
8
|
-
export const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
|
|
9
4
|
/** The existing User and Group Spaces, one resource per kind, for the Admin storage table. */
|
|
10
5
|
export const PHI_ASSET_STORAGE_SPACES_RESOURCES = [
|
|
11
6
|
{
|
|
@@ -74,41 +69,6 @@ export const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
74
69
|
// Named in a record binding's parameters, which the Builder edits on any page.
|
|
75
70
|
availableToAuthoringChrome: true,
|
|
76
71
|
},
|
|
77
|
-
/*
|
|
78
|
-
* The pictures of a Folder, read on the server while the page is drawn (`types/record-provider.ts`).
|
|
79
|
-
* A Folder is a thing somebody keeps filling, so the page reads it rather than naming each picture:
|
|
80
|
-
* what is public in the branch at render time is what the Gallery shows.
|
|
81
|
-
*/
|
|
82
|
-
{
|
|
83
|
-
key: PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS.mediaFolderImages,
|
|
84
|
-
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
85
|
-
kind: "record",
|
|
86
|
-
executionMode: "live",
|
|
87
|
-
// The Builder draws a placeholder for a Gallery and reads nothing.
|
|
88
|
-
authoringMode: "none",
|
|
89
|
-
title: "Media folder pictures",
|
|
90
|
-
description: "The public pictures of one media folder, with its subfolders unless told otherwise.",
|
|
91
|
-
settingsFields: [
|
|
92
|
-
{
|
|
93
|
-
key: "folderId",
|
|
94
|
-
type: "choice",
|
|
95
|
-
heading: "Folder",
|
|
96
|
-
label: "Folder",
|
|
97
|
-
optionsProvider: { providerKey: PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS.mediaFolderChoices },
|
|
98
|
-
},
|
|
99
|
-
{ key: "topLevelOnly", type: "boolean", label: "This folder only", description: "Leave the pictures in its subfolders out." },
|
|
100
|
-
{
|
|
101
|
-
key: "sort",
|
|
102
|
-
type: "choice",
|
|
103
|
-
label: "Order",
|
|
104
|
-
options: [
|
|
105
|
-
{ value: "name_asc", label: "By file name" },
|
|
106
|
-
{ value: "created_at_desc", label: "Newest first" },
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
{ key: "limit", type: "number", label: "At most", min: 1, max: PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT },
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
72
|
{
|
|
113
73
|
key: PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS.mediaFolders,
|
|
114
74
|
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
@@ -20,7 +20,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
|
|
|
20
20
|
description: string;
|
|
21
21
|
resources: readonly import("../../../types").PhiTableProviderResourceDescriptor[];
|
|
22
22
|
availableToAuthoringChrome?: undefined;
|
|
23
|
-
settingsFields?: undefined;
|
|
24
23
|
} | {
|
|
25
24
|
key: `${string}/${string}`;
|
|
26
25
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -31,7 +30,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
|
|
|
31
30
|
description: string;
|
|
32
31
|
resources?: undefined;
|
|
33
32
|
availableToAuthoringChrome?: undefined;
|
|
34
|
-
settingsFields?: undefined;
|
|
35
33
|
} | {
|
|
36
34
|
key: `${string}/${string}`;
|
|
37
35
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -42,63 +40,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
|
|
|
42
40
|
description: string;
|
|
43
41
|
availableToAuthoringChrome: true;
|
|
44
42
|
resources?: undefined;
|
|
45
|
-
settingsFields?: undefined;
|
|
46
|
-
} | {
|
|
47
|
-
key: `${string}/${string}`;
|
|
48
|
-
ownerModuleId: "@phis/ui/modules/asset";
|
|
49
|
-
kind: "record";
|
|
50
|
-
executionMode: "live";
|
|
51
|
-
authoringMode: "none";
|
|
52
|
-
title: string;
|
|
53
|
-
description: string;
|
|
54
|
-
settingsFields: ({
|
|
55
|
-
key: string;
|
|
56
|
-
type: "choice";
|
|
57
|
-
heading: string;
|
|
58
|
-
label: string;
|
|
59
|
-
optionsProvider: {
|
|
60
|
-
providerKey: `${string}/${string}`;
|
|
61
|
-
};
|
|
62
|
-
description?: undefined;
|
|
63
|
-
options?: undefined;
|
|
64
|
-
min?: undefined;
|
|
65
|
-
max?: undefined;
|
|
66
|
-
} | {
|
|
67
|
-
key: string;
|
|
68
|
-
type: "boolean";
|
|
69
|
-
label: string;
|
|
70
|
-
description: string;
|
|
71
|
-
heading?: undefined;
|
|
72
|
-
optionsProvider?: undefined;
|
|
73
|
-
options?: undefined;
|
|
74
|
-
min?: undefined;
|
|
75
|
-
max?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
key: string;
|
|
78
|
-
type: "choice";
|
|
79
|
-
label: string;
|
|
80
|
-
options: {
|
|
81
|
-
value: string;
|
|
82
|
-
label: string;
|
|
83
|
-
}[];
|
|
84
|
-
heading?: undefined;
|
|
85
|
-
optionsProvider?: undefined;
|
|
86
|
-
description?: undefined;
|
|
87
|
-
min?: undefined;
|
|
88
|
-
max?: undefined;
|
|
89
|
-
} | {
|
|
90
|
-
key: string;
|
|
91
|
-
type: "number";
|
|
92
|
-
label: string;
|
|
93
|
-
min: number;
|
|
94
|
-
max: number;
|
|
95
|
-
heading?: undefined;
|
|
96
|
-
optionsProvider?: undefined;
|
|
97
|
-
description?: undefined;
|
|
98
|
-
options?: undefined;
|
|
99
|
-
})[];
|
|
100
|
-
resources?: undefined;
|
|
101
|
-
availableToAuthoringChrome?: undefined;
|
|
102
43
|
} | {
|
|
103
44
|
key: `${string}/${string}`;
|
|
104
45
|
ownerModuleId: "@phis/ui/modules/asset";
|
|
@@ -149,7 +90,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_DEFINITION: {
|
|
|
149
90
|
title: string;
|
|
150
91
|
}[];
|
|
151
92
|
}[];
|
|
152
|
-
settingsFields?: undefined;
|
|
153
93
|
})[];
|
|
154
94
|
collectionItemRenderers: {
|
|
155
95
|
key: `${string}/${string}`;
|
|
@@ -7,7 +7,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_ID: "@phis/ui/modules/asset";
|
|
|
7
7
|
export declare const PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS: {
|
|
8
8
|
readonly mediaFolders: `${string}/${string}`;
|
|
9
9
|
readonly mediaCollection: `${string}/${string}`;
|
|
10
|
-
readonly mediaFolderImages: `${string}/${string}`;
|
|
11
10
|
/**
|
|
12
11
|
* Every Folder of the Site Space as a choice, loaded by the choice itself. `mediaFolders` reads the
|
|
13
12
|
* Media page's store, which is not there when a Gallery is configured on some other page.
|
|
@@ -10,12 +10,11 @@ export const PHI_ASSET_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/a
|
|
|
10
10
|
export const PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
11
11
|
mediaFolders: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folders,
|
|
12
12
|
mediaCollection: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection,
|
|
13
|
-
mediaFolderImages: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderImages,
|
|
14
13
|
/**
|
|
15
14
|
* Every Folder of the Site Space as a choice, loaded by the choice itself. `mediaFolders` reads the
|
|
16
15
|
* Media page's store, which is not there when a Gallery is configured on some other page.
|
|
17
16
|
*/
|
|
18
|
-
mediaFolderChoices:
|
|
17
|
+
mediaFolderChoices: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderChoices,
|
|
19
18
|
/** The Site's Storage Profiles, for the Admin storage settings that point Spaces at one. */
|
|
20
19
|
mediaStorageProfiles: createPhiSharedRuntimeDataProviderKey("options", "media-storage-profiles"),
|
|
21
20
|
/** The existing User and Group Spaces with their Profile and quota, for the Admin storage table. */
|
|
@@ -50,5 +50,6 @@ export declare const PHI_ASSET_RUNTIME_MODULE_ROUTES: (PhiCmsRoutePresetDescript
|
|
|
50
50
|
activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
|
|
51
51
|
params: Readonly<Record<string, string>>;
|
|
52
52
|
}) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
53
|
+
pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
|
|
53
54
|
navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
|
|
54
55
|
})[];
|
|
@@ -2,7 +2,6 @@ import { PHI_ASSET_FOLDER_RUNTIME_MODULE_FORM, PHI_ASSET_METADATA_RUNTIME_MODULE
|
|
|
2
2
|
import { PHI_MEDIA_SETTINGS_RUNTIME_MODULE_FORM, PHI_MEDIA_STORAGE_SETTINGS_RUNTIME_MODULE_FORM } from "./settings-forms";
|
|
3
3
|
import { definePhiRuntimeModuleServerAreaContribution } from "../area-contributions";
|
|
4
4
|
import { PHI_ASSET_RUNTIME_MODULE_DEFINITION } from "./definition";
|
|
5
|
-
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "./ids";
|
|
6
5
|
import { PHI_ASSET_RUNTIME_MODULE_ROUTES } from "./presets";
|
|
7
6
|
import { PHI_RUNTIME_MODULE_WIDGETS as PHI_ASSET_WIDGETS } from "./widgets";
|
|
8
7
|
/**
|
|
@@ -24,10 +23,6 @@ export function createPhiAssetRuntimeModuleServerAreaContribution() {
|
|
|
24
23
|
],
|
|
25
24
|
routes: PHI_ASSET_RUNTIME_MODULE_ROUTES,
|
|
26
25
|
uiProvider: true,
|
|
27
|
-
recordProviders: [{
|
|
28
|
-
key: PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS.mediaFolderImages,
|
|
29
|
-
load: () => import("./services/folder-images.server").then((module) => module.resolvePhiMediaFolderImagesRecord),
|
|
30
|
-
}],
|
|
31
26
|
load: () => import("./module").then((module) => module.PHI_ASSET_RUNTIME_MODULE),
|
|
32
27
|
},
|
|
33
28
|
});
|
|
@@ -48,6 +48,7 @@ function buildMediaQuery(query) {
|
|
|
48
48
|
search.set("until", until);
|
|
49
49
|
return search;
|
|
50
50
|
}
|
|
51
|
+
/** The Media library answers file names and sizes, nothing in a language, so it reads neither `locale` nor `timeZone`. */
|
|
51
52
|
async function queryMediaCollection(request) {
|
|
52
53
|
if (request.resourceKey !== "assets") {
|
|
53
54
|
throw new Error(`Unknown Asset collection "${request.resourceKey}".`);
|
|
@@ -12,7 +12,7 @@ import { createPhiRuntimeFormControllerAddress } from "../../../../components/fo
|
|
|
12
12
|
import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
13
13
|
import { PHI_ASSET_FOLDER_FORM_ID, PHI_ASSET_METADATA_FORM_ID } from "../metadata-form";
|
|
14
14
|
import { PHI_ASSET_INSPECTOR_LAYOUT_IDS, PHI_ASSET_INSPECTOR_OVERLAY_IDS, PHI_ASSET_INSPECTOR_WIDGET_IDS, PHI_ASSET_MEDIA_PAGE_LAYOUT_IDS, PHI_ASSET_MEDIA_PAGE_WIDGET_IDS, } from "../media-page-ids";
|
|
15
|
-
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
15
|
+
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
|
|
16
16
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
17
17
|
const PHI_ASSET_MEDIA_PAGE_REGION_IDS = {
|
|
18
18
|
regionHeaderBottom: -511,
|
|
@@ -209,7 +209,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
209
209
|
config: {
|
|
210
210
|
title: mediaLabels?.editor.createFolderTitle ?? "Create folder",
|
|
211
211
|
controlSize: "medium",
|
|
212
|
-
width:
|
|
212
|
+
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
213
213
|
flags: PhiCmsFlags.Centered,
|
|
214
214
|
mountPolicy: "remount",
|
|
215
215
|
closeMode: "immediate",
|
|
@@ -8,6 +8,7 @@ import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress } from "../../../../ty
|
|
|
8
8
|
import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
|
|
9
9
|
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
10
10
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
11
|
+
import { PHI_DIALOG_WIDTH_SINGLE_COLUMN } from "../../../../helpers/cms-dialog";
|
|
11
12
|
const SYNTHETIC_AUTH_SETTINGS_REGION_IDS = {
|
|
12
13
|
regionContent: -482,
|
|
13
14
|
};
|
|
@@ -272,6 +273,7 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
272
273
|
title: labels.installations.createTitle,
|
|
273
274
|
openActionKey: "create",
|
|
274
275
|
formId: PHI_AUTH_ADMIN_SETTINGS_FORM_IDS.installationCreate,
|
|
276
|
+
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
275
277
|
label: labels.installations.createTitle,
|
|
276
278
|
submitLabel: labels.submitLabel,
|
|
277
279
|
cancelLabel: labels.installations.confirmCancel,
|
|
@@ -296,6 +298,7 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
296
298
|
title: labels.installations.editTitle,
|
|
297
299
|
openActionKey: "edit",
|
|
298
300
|
formId: PHI_AUTH_ADMIN_SETTINGS_FORM_IDS.installationEdit,
|
|
301
|
+
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
299
302
|
label: labels.installations.editTitle,
|
|
300
303
|
submitLabel: labels.submitLabel,
|
|
301
304
|
cancelLabel: labels.installations.confirmCancel,
|
|
@@ -49,5 +49,6 @@ export declare const PHI_BLOG_RUNTIME_MODULE_ROUTES: ({
|
|
|
49
49
|
activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
|
|
50
50
|
params: Readonly<Record<string, string>>;
|
|
51
51
|
}) => import("../../../types").PhiResolvedCmsPageTree | Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
52
|
+
pageRecord?: import("../../../types/record-provider").PhiCmsPageRecordDescriptor;
|
|
52
53
|
navigation?: readonly import("../../../types").PhiCmsNavigationInjectionDescriptor[];
|
|
53
54
|
})[];
|
|
@@ -3,6 +3,7 @@ import type { PhiBackgroundControlProps } from "../../../../components/controls/
|
|
|
3
3
|
import type { PhiCmsConfigField, PhiRuntimeModuleDataProviderDescriptor } from "../../../../types/cms-plugins";
|
|
4
4
|
import type { PhiCalendarAdapterDescriptor } from "../../../../types/calendar";
|
|
5
5
|
import type { PhiVideoProviderDescriptor } from "../../../../types/video";
|
|
6
|
+
import type { PhiRecordFieldDescriptor } from "../../../../types/record-provider";
|
|
6
7
|
import { type PhiRenderableBlockSize } from "../../../../types";
|
|
7
8
|
import { type PhiCmsPaddingWidgetConfig } from "../../../../types/cms-config";
|
|
8
9
|
import type { PhiColorPickerLabels } from "../../../../components/widgets/label-types/color-picker";
|
|
@@ -70,7 +71,7 @@ export declare function renderPhiInspectorPaddingConfigControl({ field, config,
|
|
|
70
71
|
onChange?: (nextPadding: PhiCmsPaddingWidgetConfig | null, patch: Record<string, unknown>) => void;
|
|
71
72
|
}): import("react").JSX.Element;
|
|
72
73
|
export declare function renderPhiInspectorConfigField(args: Parameters<typeof renderPhiInspectorConfigFieldBody>[0]): import("react").JSX.Element | null;
|
|
73
|
-
declare function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, blockId, }: {
|
|
74
|
+
declare function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, pageRecordFields, blockId, }: {
|
|
74
75
|
field: PhiCmsConfigField;
|
|
75
76
|
value: unknown;
|
|
76
77
|
defaultValue: unknown;
|
|
@@ -92,6 +93,8 @@ declare function renderPhiInspectorConfigFieldBody({ field, value, defaultValue,
|
|
|
92
93
|
dataProviderDescriptors?: readonly PhiRuntimeModuleDataProviderDescriptor[];
|
|
93
94
|
calendarAdapterDescriptors?: readonly PhiCalendarAdapterDescriptor[];
|
|
94
95
|
videoProviderDescriptors?: readonly PhiVideoProviderDescriptor[];
|
|
96
|
+
/** The declared fields of the record the edited Page is about; empty on a Page that is about none. */
|
|
97
|
+
pageRecordFields?: readonly PhiRecordFieldDescriptor[];
|
|
95
98
|
onChange?: (next: Record<string, unknown>) => void;
|
|
96
99
|
}): import("react").JSX.Element | null;
|
|
97
100
|
export {};
|
|
@@ -58,14 +58,14 @@ export function renderPhiInspectorSettingsRow(label, control, key) {
|
|
|
58
58
|
*/
|
|
59
59
|
function PhiInspectorSliderField({ value, min, max, step, suffix, disabled, onCommit, }) {
|
|
60
60
|
const [dragged, setDragged] = useState(null);
|
|
61
|
-
return (_jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--
|
|
61
|
+
return (_jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--phi-control-height)", width: "100%" }, children: _jsx(PhiSliderControl, { value: dragged ?? value, min: min, max: max, step: step, ...(suffix ? { tooltipSuffix: suffix } : {}), disabled: disabled, style: { width: "100%", marginInline: 6 }, onChange: setDragged, onChangeComplete: (next) => {
|
|
62
62
|
setDragged(null);
|
|
63
63
|
if (next !== value)
|
|
64
64
|
onCommit(next);
|
|
65
65
|
} }) }));
|
|
66
66
|
}
|
|
67
67
|
export function renderPhiInspectorSwitchRow({ key, label, checked, disabled, onChange, }) {
|
|
68
|
-
return renderPhiInspectorSettingsRow(label, _jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--
|
|
68
|
+
return renderPhiInspectorSettingsRow(label, _jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--phi-control-height)" }, children: _jsx(PhiSwitchControl, { checked: checked, disabled: disabled || !onChange, ...(onChange ? { onChange } : {}) }) }), key);
|
|
69
69
|
}
|
|
70
70
|
function renderPhiInspectorSettingsBlock(label, control, key) {
|
|
71
71
|
return (_jsxs(PhiFlexControl, { vertical: true, gap: 8, style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTypographyControl, { children: label }), control] }, key));
|
|
@@ -453,7 +453,7 @@ function PhiInspectorCollectionFieldControl({ field, config, labels, value, defa
|
|
|
453
453
|
return (_jsxs(PhiFlexControl, { vertical: true, gap: 8, style: {
|
|
454
454
|
width: "100%",
|
|
455
455
|
minWidth: 0,
|
|
456
|
-
padding: "var(--
|
|
456
|
+
padding: "var(--phi-padding-xs)",
|
|
457
457
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
458
458
|
borderRadius: token.borderRadius,
|
|
459
459
|
background: token.colorBgContainer,
|
|
@@ -512,7 +512,7 @@ export function renderPhiInspectorConfigField(args) {
|
|
|
512
512
|
return body;
|
|
513
513
|
return (_jsxs(Fragment, { children: [_jsx(PhiDividerControl, { titlePlacement: "start", style: { marginBlock: 0 }, children: args.field.heading }), body] }, args.field.key));
|
|
514
514
|
}
|
|
515
|
-
function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels = PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], blockId, }) {
|
|
515
|
+
function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config, defaultConfig, disabled, onChange, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, fieldLabels = PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], pageRecordFields = [], blockId, }) {
|
|
516
516
|
if (field.type === "readonly") {
|
|
517
517
|
const displayValue = value ?? defaultValue;
|
|
518
518
|
return renderPhiInspectorConfigFieldControl(field, _jsx(PhiTextControl, { value: displayValue == null ? "" : String(displayValue), readOnly: true, allowClear: false, style: { width: "100%" } }));
|
|
@@ -611,6 +611,15 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
611
611
|
description: descriptor.description,
|
|
612
612
|
})), placeholder: fieldLabels.selectCalendar, value: typeof value === "string" ? value : typeof defaultValue === "string" ? defaultValue : undefined, disabled: disabled || !onChange, style: { width: "100%" }, onChange: (calendarAdapterKey) => onChange?.({ [field.key]: calendarAdapterKey }) }));
|
|
613
613
|
}
|
|
614
|
+
if (field.type === "record-field") {
|
|
615
|
+
// A Page that is about no record has no field to name; the row is for the Pages that are.
|
|
616
|
+
if (pageRecordFields.length === 0 && typeof value !== "string") {
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
619
|
+
return renderPhiInspectorConfigFieldControl(field, _jsx(PhiSelectControl, { allowClear: true, options: pageRecordFields
|
|
620
|
+
.filter((recordField) => field.kinds.includes(recordField.kind))
|
|
621
|
+
.map((recordField) => ({ value: recordField.key, label: recordField.label, description: recordField.description })), placeholder: fieldLabels.selectRecordField, value: typeof value === "string" ? value : undefined, disabled: disabled || !onChange, style: { width: "100%" }, onChange: (recordFieldKey) => onChange?.({ [field.key]: typeof recordFieldKey === "string" ? recordFieldKey : undefined }) }));
|
|
622
|
+
}
|
|
614
623
|
if (field.type === "video-provider") {
|
|
615
624
|
return renderPhiInspectorConfigFieldControl(field, _jsx(PhiSelectControl
|
|
616
625
|
/*
|
|
@@ -18,5 +18,5 @@ export function PhiInspectorLinkTargetFieldControl({ value, disabled, labels = P
|
|
|
18
18
|
const options = useMemo(() => buildPhiBuilderPageReferenceTree(state.area, pages, pages, { landing: labels.landingPage }), [labels.landingPage, pages, state.area]);
|
|
19
19
|
return (_jsx(PhiLinkTargetControl, { value: value, options: options, labels: labels, disabled: disabled, onChange: onChange,
|
|
20
20
|
// A row like every switch in the Inspector: its words on the left, the switch in the control column.
|
|
21
|
-
newTabRow: (control) => (_jsx(PhiInspectorFieldRow, { label: labels.newTab, children: _jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--
|
|
21
|
+
newTabRow: (control) => (_jsx(PhiInspectorFieldRow, { label: labels.newTab, children: _jsx(PhiFlexControl, { align: "center", style: { minHeight: "var(--phi-control-height)" }, children: control }) })) }));
|
|
22
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { findPhiPageNodePath } from "../../../../helpers/cms-page-catalog";
|
|
4
5
|
import { PhiMediaPickerBinding } from "../../../../components/media/phi-media-picker-binding";
|
|
5
6
|
import { PHI_MEDIA_WIDGET_DEFAULT_LABELS } from "../../../../components/media/media-widget-labels";
|
|
6
7
|
import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/search";
|
|
@@ -90,6 +91,17 @@ function usePhiBuilderInspectorSectionState(signalRoutes) {
|
|
|
90
91
|
const activeDataProviderDescriptors = activeModuleMetas.dataProviders;
|
|
91
92
|
const activeCalendarAdapterDescriptors = activeModuleMetas.calendarAdapters;
|
|
92
93
|
const activeVideoProviderDescriptors = activeModuleMetas.videoProviders;
|
|
94
|
+
/*
|
|
95
|
+
* The record the edited Page is about, where its route names one: the catalog carries the Provider's
|
|
96
|
+
* key, the Provider's descriptor the fields a Widget may bind to.
|
|
97
|
+
*/
|
|
98
|
+
const pageRecordProviderKey = usePhiDeveloperBuilderStateValue((state) => findPhiPageNodePath(state.modulePresetPagesByArea[state.area] ?? [], state.pageKey)?.at(-1)?.pageRecord?.providerKey ?? null);
|
|
99
|
+
const pageRecordFields = useMemo(() => {
|
|
100
|
+
const descriptor = pageRecordProviderKey
|
|
101
|
+
? activeDataProviderDescriptors.find((candidate) => candidate.key === pageRecordProviderKey)
|
|
102
|
+
: null;
|
|
103
|
+
return descriptor?.kind === "record" ? descriptor.record?.fields ?? [] : [];
|
|
104
|
+
}, [activeDataProviderDescriptors, pageRecordProviderKey]);
|
|
93
105
|
const activeModuleIcons = activeModuleMetas.icons;
|
|
94
106
|
/*
|
|
95
107
|
* Every Inspector section runs this hook, so what it works out per render is worked out fifteen
|
|
@@ -161,6 +173,7 @@ function usePhiBuilderInspectorSectionState(signalRoutes) {
|
|
|
161
173
|
activeCalendarAdapterDescriptors,
|
|
162
174
|
activeVideoProviderDescriptors,
|
|
163
175
|
activeDataProviderDescriptors,
|
|
176
|
+
pageRecordFields,
|
|
164
177
|
builderMode,
|
|
165
178
|
currentRegionDraft,
|
|
166
179
|
emitInspectorControllerAction,
|
|
@@ -197,5 +210,5 @@ export function PhiBuilderLayoutInspectorSectionWidgetClient({ section, signalRo
|
|
|
197
210
|
}
|
|
198
211
|
export function PhiBuilderWidgetInspectorSectionWidgetClient({ section, signalRoutes, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, signalsLabels, fieldLabels, colorPickerLabels, iconPickerLabels, }) {
|
|
199
212
|
const state = usePhiBuilderInspectorSectionState(signalRoutes);
|
|
200
|
-
return _jsx(PhiBuilderInspectorModuleIcons, { sets: state.activeModuleIcons, children: _jsx(PhiDeveloperBuilderWidgetInspectorWidgetClient, { surfaceLabels: surfaceLabels, fieldLabels: fieldLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, renderMediaPicker: state.renderBackgroundMediaPicker, onSurfaceChange: (surface) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetSurface", surface }), section: section, builderMode: state.builderMode, selectedStructureNodeKey: state.nodeKey, selectedStructureNodeKind: state.nodeKind, selectedStructureNodeTitle: state.selectedStructureNodeTitle, selectedStructureWidgetMeta: state.selectedStructurePlugin?.kind === "widget" ? state.selectedStructurePlugin : null, currentDraft: state.selectedWidgetNode, widgetReferenceOptions: state.widgetReferenceOptions, signalRouteScope: state.selectedSignalRouteScope, onConfigChange: (nextConfig) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetConfig", patch: nextConfig }), geometryLabels: geometryLabels, signalsLabels: signalsLabels, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, dataProviderDescriptors: state.activeDataProviderDescriptors, calendarAdapterDescriptors: state.activeCalendarAdapterDescriptors, videoProviderDescriptors: state.activeVideoProviderDescriptors, onGeometryChange: (geometry) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetGeometry", geometry }), onTranslateChange: (translate) => state.emitInspectorControllerAction({ kind: "setSelectedWidgetTranslate", translate }) }) });
|
|
213
|
+
return _jsx(PhiBuilderInspectorModuleIcons, { sets: state.activeModuleIcons, children: _jsx(PhiDeveloperBuilderWidgetInspectorWidgetClient, { surfaceLabels: surfaceLabels, fieldLabels: fieldLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, renderMediaPicker: state.renderBackgroundMediaPicker, onSurfaceChange: (surface) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetSurface", surface }), section: section, builderMode: state.builderMode, selectedStructureNodeKey: state.nodeKey, selectedStructureNodeKind: state.nodeKind, selectedStructureNodeTitle: state.selectedStructureNodeTitle, selectedStructureWidgetMeta: state.selectedStructurePlugin?.kind === "widget" ? state.selectedStructurePlugin : null, currentDraft: state.selectedWidgetNode, widgetReferenceOptions: state.widgetReferenceOptions, signalRouteScope: state.selectedSignalRouteScope, onConfigChange: (nextConfig) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetConfig", patch: nextConfig }), geometryLabels: geometryLabels, signalsLabels: signalsLabels, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, dataProviderDescriptors: state.activeDataProviderDescriptors, calendarAdapterDescriptors: state.activeCalendarAdapterDescriptors, videoProviderDescriptors: state.activeVideoProviderDescriptors, pageRecordFields: state.pageRecordFields, onGeometryChange: (geometry) => state.emitInspectorControllerAction({ kind: "patchSelectedWidgetGeometry", geometry }), onTranslateChange: (translate) => state.emitInspectorControllerAction({ kind: "setSelectedWidgetTranslate", translate }) }) });
|
|
201
214
|
}
|
|
@@ -7,7 +7,7 @@ import { PHI_RENDERABLE_BLOCK_RECEIVE_CHANNELS } from "../../../../components/wi
|
|
|
7
7
|
import { PhiFlexControl } from "../../../../components/controls/phi-flex-control";
|
|
8
8
|
import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
|
|
9
9
|
function renderSignalBlock(label, content, key, action) {
|
|
10
|
-
return (_jsxs(PhiFlexControl, { vertical: true, gap: 4, style: { width: "100%" }, children: [action ? (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: 8, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { lineHeight: "var(--
|
|
10
|
+
return (_jsxs(PhiFlexControl, { vertical: true, gap: 4, style: { width: "100%" }, children: [action ? (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: 8, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { lineHeight: "var(--phi-control-height)" }, children: label }), action] })) : (_jsx(PhiTypographyControl, { style: { lineHeight: "var(--phi-control-height)" }, children: label })), content] }, key));
|
|
11
11
|
}
|
|
12
12
|
function renderSignalCapabilities(capabilities, emptyLabel, options) {
|
|
13
13
|
return _jsx(PhiSignalCapabilityList, { capabilities: capabilities, emptyLabel: emptyLabel, ...options });
|
|
@@ -19,7 +19,7 @@ export function PhiInspectorSignalSection({ labels, emits, listens, }) {
|
|
|
19
19
|
: listens.filter((capability) => !PHI_RENDERABLE_BLOCK_RECEIVE_CHANNELS.has(capability.channel));
|
|
20
20
|
return (_jsxs("div", { style: {
|
|
21
21
|
display: "grid",
|
|
22
|
-
gap: "var(--
|
|
22
|
+
gap: "var(--phi-padding-sm)",
|
|
23
23
|
width: "100%",
|
|
24
24
|
}, children: [_jsx("div", { children: renderSignalBlock(labels?.blocks.emits ?? "Emits", renderSignalCapabilities(emits, labels?.blocks.none ?? "none", {
|
|
25
25
|
showCapability: true,
|