@phis/ui 0.4.8 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cms/phi-cms-area-access-guard.js +9 -1
- package/components/cms/phi-cms-area-render-scope.d.ts +8 -4
- package/components/cms/phi-cms-area-render-scope.js +26 -11
- package/components/cms/phi-cms-root-layout.js +4 -2
- package/components/cms/phi-cms-runtime-registry.d.ts +2 -1
- package/components/cms/phi-cms-runtime-registry.js +1 -1
- package/components/controls/phi-color-control.js +2 -1
- package/components/controls/phi-drawer-control-adapter.js +2 -3
- package/components/controls/phi-drawer-control.js +3 -3
- package/components/controls/phi-dropdown-control.js +2 -1
- package/components/controls/phi-float-button-control.js +3 -3
- package/components/controls/phi-modal-control-adapter.js +2 -2
- package/components/controls/phi-modal-control.js +3 -3
- package/components/controls/phi-ribbon-wrap-control.js +2 -1
- package/components/controls/phi-zoom-image-overlay.js +11 -5
- package/components/forms/auth-admin-settings-labels.d.ts +35 -0
- package/components/forms/auth-admin-settings-labels.js +27 -0
- package/components/forms/content-entry-forms.js +1 -5
- package/components/forms/form-descriptor-runtime-client.js +2 -1
- package/components/forms/form-descriptor-text.d.ts +17 -0
- package/components/forms/form-descriptor-text.js +14 -0
- package/components/forms/runtime-form-controller-plugin.d.ts +0 -115
- package/components/forms/runtime-form-controller-plugin.js +1 -1
- package/components/forms/upload-form-control.d.ts +0 -7
- package/components/forms/upload-form-control.js +1 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -1
- package/components/layouts/clients/phi-flex-layout-client.js +7 -1
- package/components/layouts/clients/phi-sequence-slot-editor.js +2 -1
- package/components/layouts/clients/phi-split-card-half.js +2 -1
- package/components/layouts/phi-base-layout.js +2 -1
- package/components/layouts/phi-layout-surface-box.js +2 -1
- package/components/media/phi-media-picker-server.js +3 -11
- package/components/navigation/use-phi-protected-mail.js +1 -9
- package/components/regions/presets/clients/sider-context.js +4 -2
- package/components/root/phi-config-provider.js +2 -1
- package/components/root/phi-dayjs-locale.d.ts +4 -1
- package/components/root/phi-dayjs-locale.js +2 -2
- package/components/root/phi-intl-locale.d.ts +7 -1
- package/components/root/phi-intl-locale.js +20 -15
- package/components/root/phi-root-layout.js +2 -1
- package/components/runtime/core-runtime-controller-plugin.d.ts +0 -84
- package/components/runtime/core-runtime-controller-plugin.js +1 -1
- package/components/runtime/runtime-controller-server-host.js +20 -9
- package/components/runtime/runtime-signal-bus.js +39 -4
- package/components/shell/phi-antd-icon.d.ts +3 -0
- package/components/shell/phi-antd-icon.js +9 -0
- package/components/state/use-phi-hydrated.d.ts +6 -0
- package/components/state/use-phi-hydrated.js +11 -0
- package/components/tables/phi-plain-table.d.ts +4 -0
- package/components/tables/phi-plain-table.js +1 -1
- package/components/widgets/client/shared/phi-rendered-value.js +4 -3
- package/components/widgets/config/parser-primitives.d.ts +5 -0
- package/components/widgets/config/parser-primitives.js +11 -0
- package/components/widgets/label-sets/runtime-options.d.ts +1 -1
- package/components/widgets/server/builder-chrome.js +2 -6
- package/components/widgets/server/search.js +2 -6
- package/components/widgets/shared/markdown-body-client.d.ts +7 -0
- package/components/widgets/shared/markdown-body-client.js +2 -0
- package/components/widgets/shared/markdown-render.js +48 -1
- package/controls.d.ts +2 -0
- package/controls.js +3 -0
- package/gateway/dashboard-cards-route.js +5 -7
- package/gateway/navigation-target-route.js +7 -9
- package/gateway/page-references-route.js +6 -8
- package/gateway/site-config.js +3 -0
- package/gateway/site-proxy.js +13 -2
- package/helpers/class-names.d.ts +7 -0
- package/helpers/class-names.js +10 -0
- package/helpers/cms-navigation-catalog.js +4 -2
- package/helpers/cms-page-catalog.js +35 -6
- package/helpers/cms-region-keys.d.ts +0 -1
- package/helpers/cms-region-keys.js +1 -1
- package/helpers/format-date-time.d.ts +14 -3
- package/helpers/format-date-time.js +27 -11
- package/helpers/region-page-scope.d.ts +1 -3
- package/helpers/region-page-scope.js +0 -4
- package/helpers/translation-format.d.ts +6 -0
- package/helpers/translation-format.js +15 -8
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-frame-view.js +2 -1
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +1 -1
- package/plugins/runtime-modules/admin/forms.js +1 -1
- package/plugins/runtime-modules/admin/trees/phi-default-admin-settings-page-tree.js +2 -5
- package/plugins/runtime-modules/app/forms.js +1 -1
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +2 -6
- package/plugins/runtime-modules/asset/metadata-form.js +2 -6
- package/plugins/runtime-modules/asset/settings-forms.js +1 -1
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -5
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -6
- package/plugins/runtime-modules/asset/widgets/area-upload/server.js +2 -6
- package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.js +1 -3
- package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -6
- package/plugins/runtime-modules/asset/widgets.js +5 -7
- package/plugins/runtime-modules/auth/admin-settings-forms.js +1 -1
- package/plugins/runtime-modules/auth/data-providers.d.ts +5 -0
- package/plugins/runtime-modules/auth/data-providers.js +3 -0
- package/plugins/runtime-modules/auth/definition.d.ts +5 -0
- package/plugins/runtime-modules/auth/ids.d.ts +7 -7
- package/plugins/runtime-modules/auth/ids.js +7 -7
- package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +26 -14
- package/plugins/runtime-modules/auth/widgets/security/client.js +5 -1
- package/plugins/runtime-modules/auth/widgets.d.ts +1 -2
- package/plugins/runtime-modules/auth/widgets.js +5 -7
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets/account-avatar/server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/server.js +2 -6
- package/plugins/runtime-modules/avatar/widgets.js +3 -5
- package/plugins/runtime-modules/builder/clients/pages-workspace.d.ts +2 -3
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +5 -18
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +1 -0
- package/plugins/runtime-modules/builder/controller/page-controller.js +1 -1
- package/plugins/runtime-modules/builder/controller/server-definition.js +3 -11
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +2 -6
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +2 -8
- package/plugins/runtime-modules/builder/developer-workspace-store.js +24 -44
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +0 -5
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +2 -1
- package/plugins/runtime-modules/builder/inspector-section-widget.js +6 -31
- package/plugins/runtime-modules/builder/navigation-persistence.js +12 -3
- package/plugins/runtime-modules/builder/page-meta-form.js +4 -12
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +0 -1
- package/plugins/runtime-modules/builder/page-presets.server.js +0 -24
- package/plugins/runtime-modules/builder/pages-workspace.js +6 -16
- package/plugins/runtime-modules/builder/persistence.d.ts +6 -4
- package/plugins/runtime-modules/builder/persistence.js +6 -7
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +0 -1
- package/plugins/runtime-modules/builder/shells-workspace.js +3 -11
- package/plugins/runtime-modules/builder/signal-wiring-form.js +3 -7
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +2 -6
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +6 -26
- package/plugins/runtime-modules/builder/trees/phi-default-builder-settings-page-tree.js +2 -6
- package/plugins/runtime-modules/builder/widgets/developer-builder-pages-header/plugin.js +2 -6
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.js +2 -6
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +3 -2
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +1 -6
- package/plugins/runtime-modules/builder/widgets.js +10 -12
- package/plugins/runtime-modules/client-authoring-module.js +18 -1
- package/plugins/runtime-modules/contracts.d.ts +15 -1
- package/plugins/runtime-modules/contracts.js +10 -0
- package/plugins/runtime-modules/core/messaging/forms.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/description/server.js +12 -9
- package/plugins/runtime-modules/core/widgets/dimension/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/draft-status/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/entry-list/config.js +2 -9
- package/plugins/runtime-modules/core/widgets/entry-list/view.server.js +1 -1
- package/plugins/runtime-modules/core/widgets/form-preview/client.js +2 -15
- package/plugins/runtime-modules/core/widgets/gallery/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/image/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/length/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/markdown-toc/plugin.js +2 -6
- package/plugins/runtime-modules/core/widgets/page-title/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/pagination/config.js +4 -8
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/result/config.js +15 -10
- package/plugins/runtime-modules/core/widgets/result/server.js +1 -1
- package/plugins/runtime-modules/core/widgets/search-results/config.js +2 -8
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/server.js +8 -13
- package/plugins/runtime-modules/core/widgets/table/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/theme-mode-switch/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +16 -31
- package/plugins/runtime-modules/core/widgets/timeline/client.js +9 -4
- package/plugins/runtime-modules/core/widgets/tour-button/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
- package/plugins/runtime-modules/core/widgets.js +59 -61
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +7 -5
- package/plugins/runtime-modules/dashboard/trees/phi-default-admin-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/dashboard/trees/phi-default-area-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +2 -6
- package/plugins/runtime-modules/descriptor-compiler.js +6 -6
- package/plugins/runtime-modules/groups/controller/client.d.ts +0 -56
- package/plugins/runtime-modules/groups/controller/client.js +1 -1
- package/plugins/runtime-modules/groups/forms.js +1 -5
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +2 -6
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -6
- package/plugins/runtime-modules/localization/forms.js +2 -6
- package/plugins/runtime-modules/localization/services/options.js +19 -9
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -11
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +3 -11
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +3 -11
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -109
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +2 -2
- package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -4
- package/plugins/runtime-modules/pub-area-preset.js +0 -20
- package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +5 -5
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/services/table.js +6 -2
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
- package/plugins/runtime-modules/theme/controller/server-definition.js +2 -6
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +2 -6
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -21
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +0 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +0 -8
- package/plugins/runtime-modules/theme/widgets.js +6 -8
- package/plugins/runtime-modules/threads/controller/client.d.ts +0 -78
- package/plugins/runtime-modules/threads/controller/client.js +1 -1
- package/plugins/runtime-modules/threads/forms.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +0 -1
- package/plugins/runtime-modules/threads/ids.js +0 -2
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +8 -6
- package/plugins/runtime-modules/user-management/controller/client.d.ts +0 -73
- package/plugins/runtime-modules/user-management/controller/client.js +1 -1
- package/plugins/runtime-modules/user-management/forms.js +1 -5
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -7
- package/plugins/runtime-modules/video/widgets.js +2 -4
- package/server-helpers/cms-request.d.ts +19 -0
- package/server-helpers/cms-request.js +26 -8
- package/server-helpers/cms-root.js +27 -21
- package/server-helpers/public-login-route.js +6 -8
- package/server-helpers/runtime.js +1 -1
- package/server-helpers/search-index.js +34 -14
- package/styles/controls.css +11 -0
- package/styles/shell.css +11 -1
- package/types/length.js +8 -3
- package/types/site-config.d.ts +6 -4
- package/types/widget-runtime.d.ts +2 -3
- package/types.d.ts +5 -3
- package/types.js +3 -0
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export type PhiTranslationParamValue = string | number;
|
|
2
2
|
export type PhiTranslationParams = Record<string, PhiTranslationParamValue> | PhiTranslationParamValue[] | PhiTranslationParamValue | 0 | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Read in one pass rather than token by token, as `resolvePhiTextPlaceholders` reads: `%1` is the start
|
|
5
|
+
* of `%10`, so replacing one token after another ate the tenth value's token with the first's, and a
|
|
6
|
+
* value that itself contained `%2` was replaced again by the next step. A token nothing answers stays
|
|
7
|
+
* as it is.
|
|
8
|
+
*/
|
|
3
9
|
export declare function formatPhiTranslation(input: string, params?: PhiTranslationParams): string;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
+
/** `%1`, `%2`, … (one-based) and `{0}`, `{1}`, … (zero-based) name a position; `{key}` names a key. */
|
|
2
|
+
const INDEXED_TOKEN_PATTERN = /%(\d+)|\{(\d+)\}/g;
|
|
3
|
+
const NAMED_TOKEN_PATTERN = /\{([^{}]+)\}/g;
|
|
4
|
+
/**
|
|
5
|
+
* Read in one pass rather than token by token, as `resolvePhiTextPlaceholders` reads: `%1` is the start
|
|
6
|
+
* of `%10`, so replacing one token after another ate the tenth value's token with the first's, and a
|
|
7
|
+
* value that itself contained `%2` was replaced again by the next step. A token nothing answers stays
|
|
8
|
+
* as it is.
|
|
9
|
+
*/
|
|
1
10
|
export function formatPhiTranslation(input, params = 0) {
|
|
2
11
|
if (!params) {
|
|
3
12
|
return input;
|
|
4
13
|
}
|
|
5
14
|
const text = String(input);
|
|
6
15
|
if (Array.isArray(params)) {
|
|
7
|
-
return
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
.replaceAll(`{${index}}`, String(value));
|
|
12
|
-
}, text);
|
|
16
|
+
return text.replace(INDEXED_TOKEN_PATTERN, (token, position, index) => {
|
|
17
|
+
const at = position !== undefined ? Number(position) - 1 : Number(index);
|
|
18
|
+
return at >= 0 && at < params.length ? String(params[at]) : token;
|
|
19
|
+
});
|
|
13
20
|
}
|
|
14
21
|
if (typeof params === "object") {
|
|
15
|
-
return
|
|
22
|
+
return text.replace(NAMED_TOKEN_PATTERN, (token, key) => Object.prototype.hasOwnProperty.call(params, key) ? String(params[key]) : token);
|
|
16
23
|
}
|
|
17
|
-
return text.
|
|
24
|
+
return text.replace(INDEXED_TOKEN_PATTERN, (token, position, index) => position === "1" || index === "0" ? String(params) : token);
|
|
18
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
"@lexical/rich-text": "0.50.0",
|
|
504
504
|
"@lexical/selection": "0.50.0",
|
|
505
505
|
"@lexical/utils": "0.50.0",
|
|
506
|
-
"@phis/contracts": "^0.7.
|
|
506
|
+
"@phis/contracts": "^0.7.6",
|
|
507
507
|
"dayjs": "^1.11.23",
|
|
508
508
|
"dom-serializer": "^2.0.0",
|
|
509
509
|
"htmlparser2": "^10.1.0",
|
|
@@ -6,6 +6,7 @@ import { PhiSurfaceGroundLayer } from "../../components/surface/phi-surface-grou
|
|
|
6
6
|
import { PhiSurfaceTone } from "../../components/surface/phi-surface-tone";
|
|
7
7
|
import { buildPhiSlotChildClassName, buildPhiSlotChildDataAttributes, resolvePhiEffectiveSlotSizePolicy, resolvePhiSlotChildBaseStyle, resolvePhiSlotChildExplicitAxes, resolvePhiSlotChildSizeConstraints, resolvePhiSlotChildSizeStyle, resolvePhiSlotSizePolicy, } from "./slot-size-policy";
|
|
8
8
|
import { resolvePhiRenderableBlockGeometry } from "../../types/renderable-block-geometry";
|
|
9
|
+
import { joinPhiClassNames } from "../../helpers/class-names";
|
|
9
10
|
export function requiresPhiSlotChildEffectsObserver(config, disableEffects = false) {
|
|
10
11
|
if (disableEffects) {
|
|
11
12
|
return false;
|
|
@@ -42,7 +43,7 @@ export function PhiSlotChildFrameView({ kind, slotSizePolicy, surfacePolicy, blo
|
|
|
42
43
|
const surface = kind === "widget" && surfacePolicy === "frame"
|
|
43
44
|
? resolvePhiSurfaceStyle(resolvedConfig.surface, { cornerFallback: PHI_LAYOUT_SURFACE_RADIUS })
|
|
44
45
|
: null;
|
|
45
|
-
return (_jsxs("div", { ref: anchorRef, hidden: resolvedVisibility === "hidden", className:
|
|
46
|
+
return (_jsxs("div", { ref: anchorRef, hidden: resolvedVisibility === "hidden", className: joinPhiClassNames(buildPhiSlotChildClassName(policy), className, resolvedConfig.className, surface?.className), "data-phi-slot-child-frame": "true", "data-phi-renderable-block": "true", "data-phi-slot-child-kind": kind, "data-phi-block-id": blockId ?? undefined, "data-phi-signal-receiver": receiver ?? undefined, "data-phi-block-render-mode": resolvedConfig.renderMode, "data-phi-block-visibility": resolvedVisibility, "data-phi-viewport-flags": resolvedConfig.viewportFlags || undefined, "data-phi-block-enabled": resolvedEnabled ? "true" : "false", "data-phi-debug-scaffold": resolvedConfig.debugMode ? "on" : undefined, "data-phi-builder-widget-title": builderWidgetTitle?.trim() || undefined, "data-phi-builder-widget-selected": builderWidgetSelected ? "true" : undefined, "data-phi-builder-popup-open": builderWidgetPopupOpen ? "true" : undefined, ...effectsAttributes, "data-phi-effects-state": effectsState ?? effectsAttributes?.["data-phi-effects-state"], ...buildPhiSlotChildDataAttributes(policy, {
|
|
46
47
|
explicitInlineSize: resolvedExplicitInlineSize,
|
|
47
48
|
explicitBlockSize: resolvedExplicitBlockSize,
|
|
48
49
|
...resolvePhiSlotChildSizeConstraints(geometry),
|
|
@@ -153,7 +153,7 @@ export function PhiSlotChildViewportEffectsObserver({ effects, }) {
|
|
|
153
153
|
}
|
|
154
154
|
}, { rootMargin: "50% 50% 50% 50%", threshold: 0 });
|
|
155
155
|
const handleScrollOrResize = () => scheduleUpdate();
|
|
156
|
-
target.style.setProperty("--phi-
|
|
156
|
+
target.style.setProperty("--phi-effects-viewport-scale", "1");
|
|
157
157
|
observer.observe(target);
|
|
158
158
|
window.addEventListener("scroll", handleScrollOrResize, { passive: true });
|
|
159
159
|
window.addEventListener("resize", handleScrollOrResize);
|
|
@@ -4,6 +4,7 @@ import { createPhiFormId } from "../../../types/form-id";
|
|
|
4
4
|
import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
|
|
5
5
|
import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../components/forms/form-provider-contract";
|
|
6
6
|
import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
|
|
7
|
+
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
7
8
|
export const PHI_ADMIN_SETTINGS_FORM_IDS = {
|
|
8
9
|
general: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "admin/settings-general"),
|
|
9
10
|
};
|
|
@@ -11,7 +12,6 @@ const PHI_ADMIN_SETTINGS_FORM_HANDLER_KEYS = {
|
|
|
11
12
|
general: "site.admin.settings",
|
|
12
13
|
};
|
|
13
14
|
const LABEL_SET_KEY = "@phis/ui/modules/admin/labels/settings";
|
|
14
|
-
const label = (key, fallback) => ({ kind: "label", key, fallback });
|
|
15
15
|
const required = (key, fallback) => ({
|
|
16
16
|
providerKey: PHI_FORM_VALIDATION_PROVIDER_KEYS.required,
|
|
17
17
|
message: label(key, fallback),
|
|
@@ -5,15 +5,12 @@ import { getPhiAdminSettingsWidgetLabels } from "../../../../components/widgets/
|
|
|
5
5
|
import { getPhiAdminSettingsPageLabels } from "./admin-settings-label-set";
|
|
6
6
|
import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
|
|
7
7
|
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
8
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
8
9
|
const SYNTHETIC_ADMIN_SETTINGS_REGION_IDS = {
|
|
9
10
|
regionContent: -471,
|
|
10
11
|
};
|
|
11
12
|
export async function buildPhiDefaultAdminSettingsPageTree({ page, runtime, }) {
|
|
12
|
-
const labelOptions =
|
|
13
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
14
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
15
|
-
locale: runtime.locale.current,
|
|
16
|
-
};
|
|
13
|
+
const labelOptions = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
17
14
|
const [pageLabels, labels, settings] = await Promise.all([
|
|
18
15
|
getPhiAdminSettingsPageLabels(labelOptions),
|
|
19
16
|
getPhiAdminSettingsWidgetLabels(labelOptions),
|
|
@@ -5,6 +5,7 @@ import { PHI_FORM_FIELD_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from ".
|
|
|
5
5
|
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
|
|
6
6
|
import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
|
|
7
7
|
import { PHI_APP_RUNTIME_MODULE_ID } from "./ids";
|
|
8
|
+
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
8
9
|
/**
|
|
9
10
|
* What a signed-in person can settle about their own account, as Forms rather than as Widgets.
|
|
10
11
|
*
|
|
@@ -33,7 +34,6 @@ const NAME_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-name";
|
|
|
33
34
|
const NEWSLETTER_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-newsletter";
|
|
34
35
|
const LOCALE_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-locale";
|
|
35
36
|
const THEME_LABEL_SET_KEY = "@phis/ui/modules/app/labels/profile-theme";
|
|
36
|
-
const label = (key, fallback) => ({ kind: "label", key, fallback });
|
|
37
37
|
const nameDescriptor = {
|
|
38
38
|
schemaVersion: 1,
|
|
39
39
|
key: PHI_APP_FORM_IDS.profileName,
|
|
@@ -5,7 +5,7 @@ import { getPhiProfilePageLabels } from "./profile-label-set";
|
|
|
5
5
|
import { getPhiProfileLocaleWidgetLabels, getPhiProfileThemeWidgetLabels, } from "../../../../components/widgets/label-sets/profile";
|
|
6
6
|
import { PHI_SITE_LOCALES_CONFIG_KEY } from "../../../../components/forms/site-locales-config";
|
|
7
7
|
import { createPhiCoreRuntimeControllerAddress } from "../../../../components/runtime/core-runtime-controller-address";
|
|
8
|
-
import {
|
|
8
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
9
9
|
const REGION_CONTENT_ID = -286;
|
|
10
10
|
/**
|
|
11
11
|
* What the account says about itself, as Settings panels rather than as a page of Widgets.
|
|
@@ -24,11 +24,7 @@ const REGION_CONTENT_ID = -286;
|
|
|
24
24
|
* the third answer lives -- "System", which no switch can state.
|
|
25
25
|
*/
|
|
26
26
|
export async function buildPhiDefaultAppProfilePageTree({ page, runtime, }) {
|
|
27
|
-
const labelOptions =
|
|
28
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
29
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
30
|
-
locale: runtime.locale.current,
|
|
31
|
-
};
|
|
27
|
+
const labelOptions = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
32
28
|
const [labels, localeLabels, themeLabels] = await Promise.all([
|
|
33
29
|
getPhiProfilePageLabels(labelOptions),
|
|
34
30
|
getPhiProfileLocaleWidgetLabels(labelOptions),
|
|
@@ -3,21 +3,17 @@ import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "./ids";
|
|
|
3
3
|
import { PHI_ASSET_RUNTIME_MODULE_ID } from "./ids";
|
|
4
4
|
import { createPhiFormId } from "../../../types/form-id";
|
|
5
5
|
import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
|
|
6
|
-
import { PHI_FORM_FIELD_PROVIDER_KEYS,
|
|
6
|
+
import { PHI_FORM_FIELD_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../components/forms/form-provider-contract";
|
|
7
7
|
import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
|
|
8
8
|
import { flattenPhiFormLabels } from "../../../components/forms/form-labels";
|
|
9
9
|
import { PHI_ASSET_FOCAL_RECT_FORM_PROVIDER_KEY } from "./form-providers";
|
|
10
10
|
import { readPhiServerApiCredentials } from "../../../helpers/phis-server-credentials";
|
|
11
|
+
import { phiFormLabel as label, phiFormRequired as required } from "../../../components/forms/form-descriptor-text";
|
|
11
12
|
export const PHI_ASSET_METADATA_FORM_ID = createPhiFormId(PHI_SHARED_PACKAGE_NAME, "asset/metadata");
|
|
12
13
|
export const PHI_ASSET_FOLDER_FORM_ID = createPhiFormId(PHI_SHARED_PACKAGE_NAME, "asset/folder-create");
|
|
13
14
|
const PHI_ASSET_METADATA_FORM_HANDLER_KEY = "site.asset.metadata.update";
|
|
14
15
|
const PHI_ASSET_FOLDER_FORM_HANDLER_KEY = "site.asset.folder.create";
|
|
15
16
|
const PHI_ASSET_FORM_LABEL_SET_KEY = "@phis/ui/modules/asset/labels/metadata";
|
|
16
|
-
const label = (key, fallback) => ({ kind: "label", key, fallback });
|
|
17
|
-
const required = (key, fallback) => [{
|
|
18
|
-
providerKey: PHI_FORM_VALIDATION_PROVIDER_KEYS.required,
|
|
19
|
-
message: label(key, fallback),
|
|
20
|
-
}];
|
|
21
17
|
const flagOptions = [
|
|
22
18
|
[PhiMediaAssetFlags.Featured, "featuredFlagLabel", "Featured"],
|
|
23
19
|
[PhiMediaAssetFlags.Locked, "lockedFlagLabel", "Locked"],
|
|
@@ -6,6 +6,7 @@ import { flattenPhiFormLabels } from "../../../components/forms/form-labels";
|
|
|
6
6
|
import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, createPhiSharedFormProviderKey, } from "../../../components/forms/form-provider-contract";
|
|
7
7
|
import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
|
|
8
8
|
import { readPhiServerApiCredentials } from "../../../helpers/phis-server-credentials";
|
|
9
|
+
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
9
10
|
export const PHI_MEDIA_SETTINGS_FORM_IDS = {
|
|
10
11
|
general: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "asset/media-settings"),
|
|
11
12
|
};
|
|
@@ -13,7 +14,6 @@ const PHI_MEDIA_SETTINGS_FORM_HANDLER_KEYS = {
|
|
|
13
14
|
general: "site.admin.media-settings",
|
|
14
15
|
};
|
|
15
16
|
const LABEL_SET_KEY = "@phis/ui/modules/asset/labels/settings";
|
|
16
|
-
const label = (key, fallback) => ({ kind: "label", key, fallback });
|
|
17
17
|
const PHI_MEDIA_SETTINGS_FORM_DESCRIPTOR = {
|
|
18
18
|
schemaVersion: 1,
|
|
19
19
|
key: PHI_MEDIA_SETTINGS_FORM_IDS.general,
|
|
@@ -5,6 +5,7 @@ import { getResolvedSiteMediaSettings } from "../../../../gateway/site-media-set
|
|
|
5
5
|
import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
|
|
6
6
|
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
7
7
|
import { PHI_STORAGE_SIZE_UNIT_LABEL, phiBytesToStorageSize } from "../../../../components/forms/storage-size";
|
|
8
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
8
9
|
function formatMegabytes(bytes) {
|
|
9
10
|
const size = phiBytesToStorageSize(bytes);
|
|
10
11
|
return size == null ? "—" : `${size} ${PHI_STORAGE_SIZE_UNIT_LABEL}`;
|
|
@@ -14,11 +15,7 @@ const SYNTHETIC_MEDIA_SETTINGS_REGION_IDS = {
|
|
|
14
15
|
};
|
|
15
16
|
export async function buildPhiDefaultAdminMediaSettingsPageTree({ page, runtime, }) {
|
|
16
17
|
const [labels, settings] = await Promise.all([
|
|
17
|
-
getPhiMediaSettingsPageLabels(
|
|
18
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
19
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
20
|
-
locale: runtime.locale.current,
|
|
21
|
-
}),
|
|
18
|
+
getPhiMediaSettingsPageLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
|
|
22
19
|
getResolvedSiteMediaSettings({
|
|
23
20
|
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
24
21
|
internalToken: readPhiServerApiCredentials().internalToken,
|
|
@@ -3,7 +3,6 @@ import { PhiCmsFlags, PhiCmsRegionType, PhiCmsStatus } from "../../../../constan
|
|
|
3
3
|
import { PhiMediaKind } from "../../../../constants/media";
|
|
4
4
|
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
5
5
|
import { resolvePhiShellHeaderHeight } from "../../../../helpers/shell-region-style";
|
|
6
|
-
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
7
6
|
import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress, createPhiSignalSubcontrolAddress, } from "../../../../types";
|
|
8
7
|
import { PHI_SPACE } from "../../../../theme/antd-css-var-contract";
|
|
9
8
|
import { getPhiBuilderChromeWidgetLabels } from "../../../../components/widgets/label-sets/builder-chrome";
|
|
@@ -14,6 +13,7 @@ import { PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
|
14
13
|
import { PHI_ASSET_FOLDER_FORM_ID, PHI_ASSET_METADATA_FORM_ID } from "../metadata-form";
|
|
15
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";
|
|
16
15
|
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
16
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
17
17
|
const PHI_ASSET_MEDIA_PAGE_REGION_IDS = {
|
|
18
18
|
regionHeaderBottom: -511,
|
|
19
19
|
regionContent: -513,
|
|
@@ -29,11 +29,7 @@ const PHI_ASSET_MEDIA_PAGE_REGION_IDS = {
|
|
|
29
29
|
*/
|
|
30
30
|
export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
31
31
|
const nodes = createPhiCmsPresetNodes(page);
|
|
32
|
-
const credentials =
|
|
33
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
34
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
35
|
-
locale: runtime.locale.current,
|
|
36
|
-
};
|
|
32
|
+
const credentials = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
37
33
|
const [chromeLabels, mediaLabels] = await Promise.all([
|
|
38
34
|
getPhiBuilderChromeWidgetLabels(credentials),
|
|
39
35
|
getPhiMediaWidgetLabels(credentials),
|
|
@@ -2,12 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
|
|
3
3
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
4
4
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
5
|
-
import {
|
|
5
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
6
6
|
export async function PhiAreaUploadWidgetServer({ runtime, config, }) {
|
|
7
|
-
const labels = await getPhiMediaWidgetLabels(
|
|
8
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
9
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
10
|
-
locale: runtime.locale.current,
|
|
11
|
-
});
|
|
7
|
+
const labels = await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
12
8
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.AreaUpload, componentProps: { labels: labels.upload, config } }));
|
|
13
9
|
}
|
|
@@ -3,6 +3,4 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { createPhiCmsBuilderWidgetPlugin } from "../../../../../plugins/factories/widget-builder-plugin";
|
|
4
4
|
import { PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION } from "../../../../../plugins/runtime-modules/asset/widgets/image-inspector/config";
|
|
5
5
|
import { PhiWidgetEditorPlaceholder } from "../../../../../components/widgets/builder/widget-editor-placeholder";
|
|
6
|
-
export const PHI_IMAGE_INSPECTOR_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION, ({ widget
|
|
7
|
-
? `Scope: ${config.scopeKey}`
|
|
8
|
-
: "Builder preview for the asset inspector." })));
|
|
6
|
+
export const PHI_IMAGE_INSPECTOR_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION, ({ widget }) => (_jsx(PhiWidgetEditorPlaceholder, { widget: widget, pluginTitle: PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION.title, summary: "Builder preview for the asset inspector." })));
|
|
@@ -2,13 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPhiMediaWidgetLabels } from "../../../../../components/media/label-sets/media";
|
|
3
3
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
4
4
|
import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
|
|
5
|
-
import {
|
|
5
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../../components/widgets/label-sets/runtime-options";
|
|
6
6
|
export async function PhiAssetConfigWidgetServer({ runtime, config, }) {
|
|
7
|
-
const labels = await getPhiMediaWidgetLabels(
|
|
8
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
9
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
10
|
-
locale: runtime.locale.current,
|
|
11
|
-
});
|
|
7
|
+
const labels = await getPhiMediaWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
12
8
|
return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.ImageInspector, componentProps: {
|
|
13
9
|
labels: { inspector: labels.inspector, editor: labels.editor },
|
|
14
10
|
config,
|
|
@@ -3,32 +3,30 @@ import { PHI_AREA_UPLOAD_WIDGET_DEFINITION, } from "./widgets/area-upload/config
|
|
|
3
3
|
import { PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION, } from "./widgets/image-inspector/config";
|
|
4
4
|
import { PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION, } from "./widgets/asset-focal-rect/config";
|
|
5
5
|
import { PHI_MEDIA_PICKER_WIDGET_DEFINITION, } from "./widgets/media-picker/config";
|
|
6
|
-
|
|
7
|
-
return options;
|
|
8
|
-
}
|
|
6
|
+
import { definePhiFirstPartyWidget } from "../contracts";
|
|
9
7
|
export const PHI_RUNTIME_MODULE_WIDGETS = [
|
|
10
|
-
|
|
8
|
+
definePhiFirstPartyWidget({
|
|
11
9
|
definition: PHI_AREA_UPLOAD_WIDGET_DEFINITION,
|
|
12
10
|
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
13
11
|
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
14
12
|
loadRuntime: () => import("./widgets/area-upload/plugin").then((module) => module.PHI_AREA_UPLOAD_WIDGET_PLUGIN),
|
|
15
13
|
loadPreview: () => import("./widgets/area-upload/plugin").then((module) => module.PHI_AREA_UPLOAD_WIDGET_PLUGIN),
|
|
16
14
|
}),
|
|
17
|
-
|
|
15
|
+
definePhiFirstPartyWidget({
|
|
18
16
|
definition: PHI_IMAGE_INSPECTOR_WIDGET_DEFINITION,
|
|
19
17
|
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
20
18
|
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
21
19
|
loadRuntime: () => import("./widgets/image-inspector/plugin").then((module) => module.PHI_IMAGE_INSPECTOR_WIDGET_PLUGIN),
|
|
22
20
|
loadPreview: () => import("./widgets/image-inspector/plugin").then((module) => module.PHI_IMAGE_INSPECTOR_WIDGET_PLUGIN),
|
|
23
21
|
}),
|
|
24
|
-
|
|
22
|
+
definePhiFirstPartyWidget({
|
|
25
23
|
definition: PHI_ASSET_FOCAL_RECT_WIDGET_DEFINITION,
|
|
26
24
|
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
27
25
|
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
28
26
|
loadRuntime: () => import("./widgets/asset-focal-rect/plugin").then((module) => module.PHI_ASSET_FOCAL_RECT_WIDGET_PLUGIN),
|
|
29
27
|
loadPreview: () => import("./widgets/asset-focal-rect/plugin").then((module) => module.PHI_ASSET_FOCAL_RECT_WIDGET_PLUGIN),
|
|
30
28
|
}),
|
|
31
|
-
|
|
29
|
+
definePhiFirstPartyWidget({
|
|
32
30
|
definition: PHI_MEDIA_PICKER_WIDGET_DEFINITION,
|
|
33
31
|
ownerModuleId: PHI_ASSET_RUNTIME_MODULE_ID,
|
|
34
32
|
renderPolicies: { "runtime": "custom", "preview": "custom", "authoring": "custom" },
|
|
@@ -6,6 +6,7 @@ import { flattenPhiFormLabels } from "../../../components/forms/form-labels";
|
|
|
6
6
|
import { PHI_FORM_FIELD_PROVIDER_KEYS, PHI_FORM_VALIDATION_PROVIDER_KEYS, } from "../../../components/forms/form-provider-contract";
|
|
7
7
|
import { definePhiRuntimeModuleForm } from "../../../components/forms/form-registry";
|
|
8
8
|
import { readPhiServerApiCredentials } from "../../../helpers/phis-server-credentials";
|
|
9
|
+
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
9
10
|
export const PHI_AUTH_ADMIN_SETTINGS_FORM_IDS = {
|
|
10
11
|
policy: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "auth/admin-policy"),
|
|
11
12
|
passwordMethod: createPhiFormId(PHI_SHARED_PACKAGE_NAME, "auth/admin-password-method"),
|
|
@@ -21,7 +22,6 @@ const PHI_AUTH_ADMIN_SETTINGS_FORM_HANDLER_KEYS = {
|
|
|
21
22
|
installationUpdate: "auth.admin.installation-update",
|
|
22
23
|
};
|
|
23
24
|
const LABEL_SET_KEY = "@phis/ui/modules/auth/labels/admin-settings";
|
|
24
|
-
const label = (key, fallback) => ({ kind: "label", key, fallback });
|
|
25
25
|
const FORM_LAYOUT = {
|
|
26
26
|
columns: { compact: 1, medium: 1, wide: 1 },
|
|
27
27
|
gap: { compact: "sm", medium: "base" },
|
|
@@ -11,6 +11,11 @@ export declare const PHI_AUTH_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
|
11
11
|
title: string;
|
|
12
12
|
rowIdentityPath: string;
|
|
13
13
|
recordRead: true;
|
|
14
|
+
summaryFields: {
|
|
15
|
+
key: string;
|
|
16
|
+
title: string;
|
|
17
|
+
type: "number";
|
|
18
|
+
}[];
|
|
14
19
|
fields: ({
|
|
15
20
|
key: string;
|
|
16
21
|
title: string;
|
|
@@ -15,6 +15,9 @@ export const PHI_AUTH_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
15
15
|
title: "Provider installations",
|
|
16
16
|
rowIdentityPath: "installationKey",
|
|
17
17
|
recordRead: true,
|
|
18
|
+
summaryFields: [
|
|
19
|
+
{ key: "loginEnabledCount", title: "Offered on login", type: "number" },
|
|
20
|
+
],
|
|
18
21
|
fields: [
|
|
19
22
|
{ key: "installationKey", title: "Installation", type: "string", required: true },
|
|
20
23
|
{ key: "providerKey", title: "Provider", type: "string", required: true },
|
|
@@ -269,6 +269,11 @@ export declare const PHI_AUTH_RUNTIME_MODULE_DEFINITION: {
|
|
|
269
269
|
title: string;
|
|
270
270
|
rowIdentityPath: string;
|
|
271
271
|
recordRead: true;
|
|
272
|
+
summaryFields: {
|
|
273
|
+
key: string;
|
|
274
|
+
title: string;
|
|
275
|
+
type: "number";
|
|
276
|
+
}[];
|
|
272
277
|
fields: ({
|
|
273
278
|
key: string;
|
|
274
279
|
title: string;
|
|
@@ -8,13 +8,6 @@ export declare const PHI_AUTH_RUNTIME_MODULE_ID: "@phis/ui/modules/auth";
|
|
|
8
8
|
export declare const PHI_AUTH_RUNTIME_MODULE_IDENTITY: {
|
|
9
9
|
readonly moduleId: "@phis/ui/modules/auth";
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* The route preset the Public login Page is: what the Area access guard looks up in the active route
|
|
13
|
-
* table to learn where signing in is answered on this Site. The identity lives in the Foundation
|
|
14
|
-
* (`constants/public-login-route.ts`) because the guard may not import this Module; the key is read from
|
|
15
|
-
* there so the Module's route and the guard's lookup are one statement. The path is the Site's to assign.
|
|
16
|
-
*/
|
|
17
|
-
export declare const PHI_AUTH_PUBLIC_LOGIN_ROUTE_PRESET_KEY: "public-login-page";
|
|
18
11
|
export declare const PHI_AUTH_RUNTIME_DATA_PROVIDER_KEYS: {
|
|
19
12
|
readonly installations: `${string}/${string}`;
|
|
20
13
|
};
|
|
@@ -25,3 +18,10 @@ export declare const PHI_AUTH_RUNTIME_DATA_PROVIDER_KEYS: {
|
|
|
25
18
|
* namespace on every render and loads the resolver only where a page asks about it.
|
|
26
19
|
*/
|
|
27
20
|
export declare const PHI_AUTH_RUNTIME_MODULE_FEATURE_NAMESPACE = "auth";
|
|
21
|
+
/**
|
|
22
|
+
* The route preset the Public login Page is: what the Area access guard looks up in the active route
|
|
23
|
+
* table to learn where signing in is answered on this Site. The identity lives in the Foundation
|
|
24
|
+
* (`constants/public-login-route.ts`) because the guard may not import this Module; the key is read from
|
|
25
|
+
* there so the Module's route and the guard's lookup are one statement. The path is the Site's to assign.
|
|
26
|
+
*/
|
|
27
|
+
export declare const PHI_AUTH_PUBLIC_LOGIN_ROUTE_PRESET_KEY: "public-login-page";
|
|
@@ -11,13 +11,6 @@ export const PHI_AUTH_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/au
|
|
|
11
11
|
export const PHI_AUTH_RUNTIME_MODULE_IDENTITY = {
|
|
12
12
|
moduleId: PHI_AUTH_RUNTIME_MODULE_ID,
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
15
|
-
* The route preset the Public login Page is: what the Area access guard looks up in the active route
|
|
16
|
-
* table to learn where signing in is answered on this Site. The identity lives in the Foundation
|
|
17
|
-
* (`constants/public-login-route.ts`) because the guard may not import this Module; the key is read from
|
|
18
|
-
* there so the Module's route and the guard's lookup are one statement. The path is the Site's to assign.
|
|
19
|
-
*/
|
|
20
|
-
export const PHI_AUTH_PUBLIC_LOGIN_ROUTE_PRESET_KEY = PHI_PUBLIC_LOGIN_ROUTE_IDENTITY.presetKey;
|
|
21
14
|
export const PHI_AUTH_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
22
15
|
installations: createPhiSharedRuntimeDataProviderKey("tables", "auth-installations"),
|
|
23
16
|
};
|
|
@@ -28,3 +21,10 @@ export const PHI_AUTH_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
|
28
21
|
* namespace on every render and loads the resolver only where a page asks about it.
|
|
29
22
|
*/
|
|
30
23
|
export const PHI_AUTH_RUNTIME_MODULE_FEATURE_NAMESPACE = "auth";
|
|
24
|
+
/**
|
|
25
|
+
* The route preset the Public login Page is: what the Area access guard looks up in the active route
|
|
26
|
+
* table to learn where signing in is answered on this Site. The identity lives in the Foundation
|
|
27
|
+
* (`constants/public-login-route.ts`) because the guard may not import this Module; the key is read from
|
|
28
|
+
* there so the Module's route and the guard's lookup are one statement. The path is the Site's to assign.
|
|
29
|
+
*/
|
|
30
|
+
export const PHI_AUTH_PUBLIC_LOGIN_ROUTE_PRESET_KEY = PHI_PUBLIC_LOGIN_ROUTE_IDENTITY.presetKey;
|
|
@@ -44,7 +44,9 @@ async function queryInstallations({ resourceKey, signal, }) {
|
|
|
44
44
|
throw new PhiTableProviderError("resource-not-found", `Unknown Auth resource "${resourceKey}".`);
|
|
45
45
|
}
|
|
46
46
|
const rows = await loadInstallations(signal);
|
|
47
|
-
|
|
47
|
+
// What the footer counts beside the rows: the installations the sign-in page actually offers.
|
|
48
|
+
const loginEnabledCount = rows.filter((row) => row.loginEnabled === true).length;
|
|
49
|
+
return { rows, total: rows.length, summary: { loginEnabledCount } };
|
|
48
50
|
}
|
|
49
51
|
async function readInstallationRecord({ rowIdentity, signal }) {
|
|
50
52
|
const installationKey = typeof rowIdentity === "string" ? rowIdentity.trim() : "";
|
|
@@ -6,8 +6,8 @@ import { getPhiLoginFormLabels } from "../../../../components/widgets/label-sets
|
|
|
6
6
|
import { createPhiAuthControllerAddress, PHI_AUTH_CONTROLLER_TYPE } from "../controller/address";
|
|
7
7
|
import { createPhiRuntimeFormControllerAddress } from "../../../../components/forms/runtime-form-controller-address";
|
|
8
8
|
import { PHI_AUTH_LOGIN_OVERLAY_IDS, } from "../overlay-ids";
|
|
9
|
-
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
10
9
|
import { PHI_DIALOG_BODY_CONFIG } from "../../../../helpers/cms-dialog";
|
|
10
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
11
11
|
export async function buildPhiAuthAreaLoginOverlayTree({ page, runtime, area, }) {
|
|
12
12
|
const ids = PHI_AUTH_LOGIN_OVERLAY_IDS[area];
|
|
13
13
|
const login = buildPhiLoginNodes({
|
|
@@ -18,11 +18,7 @@ export async function buildPhiAuthAreaLoginOverlayTree({ page, runtime, area, })
|
|
|
18
18
|
locale: runtime.locale.current,
|
|
19
19
|
authControllerAddress: createPhiAuthControllerAddress(),
|
|
20
20
|
});
|
|
21
|
-
const labels = await getPhiLoginFormLabels(
|
|
22
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
23
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
24
|
-
locale: runtime.locale.current,
|
|
25
|
-
});
|
|
21
|
+
const labels = await getPhiLoginFormLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
|
|
26
22
|
const nodes = createPhiCmsPresetNodes(page);
|
|
27
23
|
const overlayAddress = createPhiSignalAddress("cms", ids.overlayLogin);
|
|
28
24
|
return {
|
|
@@ -7,16 +7,13 @@ import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-
|
|
|
7
7
|
import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress } from "../../../../types/signals";
|
|
8
8
|
import { buildPhiSettingsPageShellTree } from "../../../../components/regions/presets/phi-settings-page-shell-tree";
|
|
9
9
|
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
10
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
10
11
|
const SYNTHETIC_AUTH_SETTINGS_REGION_IDS = {
|
|
11
12
|
regionContent: -482,
|
|
12
13
|
};
|
|
13
14
|
export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime, }) {
|
|
14
15
|
const [labels, settings] = await Promise.all([
|
|
15
|
-
getPhiAuthAdminSettingsLabels(
|
|
16
|
-
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
17
|
-
internalToken: readPhiServerApiCredentials().internalToken,
|
|
18
|
-
locale: runtime.locale.current,
|
|
19
|
-
}),
|
|
16
|
+
getPhiAuthAdminSettingsLabels(buildPhiWidgetLabelTranslatorOptions(runtime)),
|
|
20
17
|
getResolvedSiteAuthAdminSettings({
|
|
21
18
|
apiBaseUrl: readPhiServerApiCredentials().apiBaseUrl,
|
|
22
19
|
internalToken: readPhiServerApiCredentials().internalToken,
|
|
@@ -36,6 +33,7 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
36
33
|
"overlayInstallationEdit",
|
|
37
34
|
"overlayInstallationEditForm",
|
|
38
35
|
]);
|
|
36
|
+
const columns = labels.installations.columns;
|
|
39
37
|
const tableAddress = createPhiSignalAddress("cms", widgetIds.widgetInstallationsTable);
|
|
40
38
|
const editFormAddress = createPhiSignalAddress("cms", widgetIds.overlayInstallationEditForm);
|
|
41
39
|
const createOverlayAddress = createPhiSignalAddress("cms", widgetIds.overlayInstallationCreate);
|
|
@@ -112,8 +110,12 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
112
110
|
controlSize: "small",
|
|
113
111
|
borders: true,
|
|
114
112
|
layout: { mode: "auto", overflowX: "auto" },
|
|
113
|
+
/*
|
|
114
|
+
* Short heads, the explanation in each head's hint: nine columns under their full names were
|
|
115
|
+
* wider than the panel and were cut at the top.
|
|
116
|
+
*/
|
|
115
117
|
columns: [
|
|
116
|
-
{ key: "installationKey", fieldKey: "installationKey", title:
|
|
118
|
+
{ key: "installationKey", fieldKey: "installationKey", title: columns.key.title, description: columns.key.hint, sizing: { mode: "content" }, sticky: "left" },
|
|
117
119
|
{
|
|
118
120
|
key: "providerKey",
|
|
119
121
|
fieldKey: "providerKey",
|
|
@@ -122,13 +124,14 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
122
124
|
sizing: { mode: "content" },
|
|
123
125
|
tagColorMap: { google: "processing", apple: "default", github: "default", microsoft: "processing" },
|
|
124
126
|
},
|
|
125
|
-
{ key: "enabled", fieldKey: "enabled", title:
|
|
126
|
-
{ key: "loginEnabled", fieldKey: "loginEnabled", title:
|
|
127
|
-
{ key: "sortOrder", fieldKey: "sortOrder", title:
|
|
127
|
+
{ key: "enabled", fieldKey: "enabled", title: columns.enabled.title, description: columns.enabled.hint, renderer: "switch", editor: { control: "switch" }, sizing: { mode: "content" } },
|
|
128
|
+
{ key: "loginEnabled", fieldKey: "loginEnabled", title: columns.login.title, description: columns.login.hint, renderer: "switch", editor: { control: "switch" }, sizing: { mode: "content" } },
|
|
129
|
+
{ key: "sortOrder", fieldKey: "sortOrder", title: columns.order.title, description: columns.order.hint, sizing: { mode: "content" } },
|
|
128
130
|
{
|
|
129
131
|
key: "secretStatus",
|
|
130
132
|
fieldKey: "secretStatus",
|
|
131
|
-
title:
|
|
133
|
+
title: columns.secret.title,
|
|
134
|
+
description: columns.secret.hint,
|
|
132
135
|
renderer: "badge",
|
|
133
136
|
sizing: { mode: "content" },
|
|
134
137
|
tagColorMap: { configured: "success", missing: "error" },
|
|
@@ -136,15 +139,24 @@ export async function buildPhiDefaultAdminAuthSettingsPageTree({ page, runtime,
|
|
|
136
139
|
{
|
|
137
140
|
key: "validationStatus",
|
|
138
141
|
fieldKey: "validationStatus",
|
|
139
|
-
title:
|
|
142
|
+
title: columns.validation.title,
|
|
143
|
+
description: columns.validation.hint,
|
|
140
144
|
renderer: "badge",
|
|
141
145
|
sizing: { mode: "content" },
|
|
142
146
|
tagColorMap: { ok: "success", failed: "error", "not-testable": "default", untested: "warning" },
|
|
143
147
|
},
|
|
144
|
-
{ key: "linkedIdentities", fieldKey: "linkedIdentities", title:
|
|
145
|
-
{ key: "callbackUri", fieldKey: "callbackUri", title:
|
|
148
|
+
{ key: "linkedIdentities", fieldKey: "linkedIdentities", title: columns.linked.title, description: columns.linked.hint, sizing: { mode: "content" } },
|
|
149
|
+
{ key: "callbackUri", fieldKey: "callbackUri", title: columns.callback.title, description: columns.callback.hint, sizing: { mode: "fill" } },
|
|
146
150
|
],
|
|
147
|
-
emptyState: labels.installations.empty,
|
|
151
|
+
emptyState: { title: labels.installations.empty },
|
|
152
|
+
footer: {
|
|
153
|
+
template: labels.installations.footer,
|
|
154
|
+
values: [
|
|
155
|
+
{ key: "installations", value: { source: "core", fieldKey: "totalRows" } },
|
|
156
|
+
{ key: "loginEnabled", value: { source: "provider", fieldKey: "loginEnabledCount" } },
|
|
157
|
+
],
|
|
158
|
+
align: "start",
|
|
159
|
+
},
|
|
148
160
|
},
|
|
149
161
|
features: {
|
|
150
162
|
pagination: { enabled: false },
|
|
@@ -28,7 +28,11 @@ export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/secur
|
|
|
28
28
|
setLoading(true);
|
|
29
29
|
try {
|
|
30
30
|
const { ok, payload: next } = await requestPhiJson(apiPath, { signal });
|
|
31
|
-
|
|
31
|
+
/*
|
|
32
|
+
* The HTTP status is the answer. The body is the account's state and carries no `ok` of its own:
|
|
33
|
+
* asking it for one refused every answer, and the panel said "could not be loaded" to everybody.
|
|
34
|
+
*/
|
|
35
|
+
if (!ok || !next || !Array.isArray(next.sessions))
|
|
32
36
|
throw new Error(labels.errors.loadFailed);
|
|
33
37
|
setPayload(next);
|
|
34
38
|
setError(null);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PHI_AUTH_RUNTIME_MODULE_WIDGETS: readonly [PhiRuntimeModuleWidgetDefinition, PhiRuntimeModuleWidgetDefinition, PhiRuntimeModuleWidgetDefinition, PhiRuntimeModuleWidgetDefinition];
|
|
1
|
+
export declare const PHI_AUTH_RUNTIME_MODULE_WIDGETS: readonly [import("../contracts").PhiRuntimeModuleWidgetDefinition, import("../contracts").PhiRuntimeModuleWidgetDefinition, import("../contracts").PhiRuntimeModuleWidgetDefinition, import("../contracts").PhiRuntimeModuleWidgetDefinition];
|