@phis/ui 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/components/cms/phi-cms-layout-renderer.js +15 -7
- package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
- package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
- package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
- package/components/cms/phi-cms-render-diagnostic.js +12 -2
- package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
- package/components/cms/phi-cms-render-error-boundary.js +1 -1
- package/components/cms/phi-cms-root-layout.js +3 -1
- package/components/controls/phi-media-picker-control.d.ts +9 -0
- package/components/controls/phi-media-picker-control.js +1 -1
- package/components/controls/phi-popover-control.js +4 -1
- package/components/controls/phi-table-control.d.ts +7 -1
- package/components/controls/phi-table-control.js +26 -11
- package/components/forms/form-descriptor-field-check.d.ts +18 -0
- package/components/forms/form-descriptor-field-check.js +41 -0
- package/components/forms/form-descriptor-runtime-client.js +11 -10
- package/components/forms/form-record-source.d.ts +38 -0
- package/components/forms/form-record-source.js +48 -0
- package/components/forms/shared-form-descriptors.d.ts +0 -34
- package/components/forms/shared-form-descriptors.js +0 -6
- package/components/forms/shared-form-ids.d.ts +1 -1
- package/components/forms/shared-form-ids.js +1 -1
- package/components/media/media-settings-labels.d.ts +1 -0
- package/components/media/media-settings-labels.js +2 -0
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-media-picker-binding.d.ts +41 -33
- package/components/media/phi-media-picker-binding.js +2 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/media/use-media-library-add-picker.d.ts +33 -32
- package/components/overlays/phi-overlay-container-client.js +11 -9
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
- package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
- package/components/shell/phi-icon-names.d.ts +3 -0
- package/components/shell/phi-icon-names.js +3 -0
- package/components/shell/phi-icon.d.ts +5 -7
- package/components/shell/phi-icon.js +8 -21
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/client/phi-table-binding-params.d.ts +24 -0
- package/components/tables/client/phi-table-binding-params.js +39 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -3
- package/components/tables/client/phi-table-binding.js +5 -9
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
- package/components/widgets/client/shared/phi-button-icons.js +8 -12
- package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
- package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
- package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
- package/components/widgets/client/shared/phi-collection-provider.js +5 -0
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
- package/components/widgets/client/shared/phi-command-buttons.js +9 -1
- package/components/widgets/label-sets/admin-users.d.ts +1 -0
- package/components/widgets/label-sets/admin-users.js +2 -0
- package/components/widgets/label-sets/builder-modules.js +4 -0
- package/components/widgets/label-sets/profile.d.ts +0 -16
- package/components/widgets/label-sets/profile.js +0 -37
- package/components/widgets/label-sets/registration.d.ts +0 -1
- package/components/widgets/label-sets/registration.js +0 -2
- package/components/widgets/label-sets/revisions.js +2 -0
- package/components/widgets/label-sets/signals.js +2 -0
- package/components/widgets/label-types/builder-modules.d.ts +4 -0
- package/components/widgets/label-types/builder-modules.js +2 -0
- package/components/widgets/label-types/revisions.d.ts +2 -0
- package/components/widgets/label-types/revisions.js +2 -1
- package/components/widgets/label-types/signals.d.ts +2 -0
- package/components/widgets/label-types/signals.js +1 -0
- package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
- package/components/widgets/shared/widget-failure-audience.js +21 -0
- package/components/widgets/shared/widget-failure-client.js +5 -2
- package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice-client.js +10 -0
- package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice.js +17 -0
- package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
- package/components/widgets/shared/widget-failure-staff.js +18 -0
- package/components/widgets/shared/widget-failure.d.ts +9 -6
- package/components/widgets/shared/widget-failure.js +0 -9
- package/components/widgets/shared/widget-failure.server.d.ts +4 -2
- package/components/widgets/shared/widget-failure.server.js +8 -3
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/customer-file.d.ts +12 -3
- package/constants/customer-file.js +12 -3
- package/constants/runtime-module-ownership.js +5 -3
- package/constants/site-address.d.ts +9 -0
- package/constants/site-address.js +10 -0
- package/constants/table-loading.d.ts +14 -0
- package/constants/table-loading.js +14 -0
- package/constants.d.ts +2 -1
- package/constants.js +3 -1
- package/gateway/site-cms-write-validation.js +19 -3
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/announced-action.d.ts +17 -0
- package/helpers/announced-action.js +29 -0
- package/helpers/phi-metadata.d.ts +0 -8
- package/helpers/phi-metadata.js +1 -10
- package/helpers/phi-site-description.d.ts +11 -0
- package/helpers/phi-site-description.js +13 -0
- package/helpers/preset-form-check.d.ts +14 -0
- package/helpers/preset-form-check.js +12 -0
- package/helpers/preset-table-check.d.ts +19 -15
- package/helpers/preset-table-check.js +33 -39
- package/helpers/record-widget-binding.d.ts +10 -0
- package/helpers/record-widget-binding.js +35 -0
- package/helpers/record-widget.d.ts +1 -10
- package/helpers/record-widget.js +4 -33
- package/helpers/table-widget-binding.d.ts +12 -0
- package/helpers/table-widget-binding.js +296 -0
- package/helpers/tree-widget-binding.d.ts +19 -0
- package/helpers/tree-widget-binding.js +72 -0
- package/helpers/typed-confirmation.d.ts +9 -0
- package/helpers/typed-confirmation.js +13 -0
- package/helpers/widget-binding-check.d.ts +22 -0
- package/helpers/widget-binding-check.js +91 -0
- package/module-page-check.d.ts +2 -0
- package/module-page-check.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/next/root-route.js +2 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
- package/plugins/runtime-modules/accounting/ids.js +14 -3
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
- package/plugins/runtime-modules/app/client-data-providers.js +1 -1
- package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
- package/plugins/runtime-modules/app/data-providers.js +19 -54
- package/plugins/runtime-modules/app/definition.d.ts +8 -80
- package/plugins/runtime-modules/app/forms.d.ts +1 -16
- package/plugins/runtime-modules/app/forms.js +0 -59
- package/plugins/runtime-modules/app/ids.d.ts +2 -1
- package/plugins/runtime-modules/app/ids.js +3 -2
- package/plugins/runtime-modules/app/module.d.ts +8 -80
- package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
- package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
- package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/client-manifests/common.js +6 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +175 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +36 -52
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
- package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
- package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
- package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
- package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
- package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/client.js +74 -50
- package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
- package/plugins/runtime-modules/revisions/page-ids.js +4 -1
- package/plugins/runtime-modules/revisions/services/options.js +14 -4
- package/plugins/runtime-modules/revisions/services/table.js +41 -21
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
- package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/client.js +62 -2
- package/plugins/runtime-modules/threads/controller/definition.js +48 -0
- package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
- package/plugins/runtime-modules/threads/data-providers.js +35 -24
- package/plugins/runtime-modules/threads/definition.d.ts +22 -37
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +2 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
- package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
- package/server-helpers/runtime.js +0 -1
- package/styles/controls.css +4 -2
- package/styles/layout.css +7 -0
- package/theme/phi-antd-token-resolver.d.ts +8 -0
- package/theme/phi-antd-token-resolver.js +10 -0
- package/theme/phi-theme-color.d.ts +19 -0
- package/theme/phi-theme-color.js +42 -0
- package/theme/phi-theme-gradients.js +4 -22
- package/theme/phi-theme-palette-defaults.d.ts +16 -0
- package/theme/phi-theme-palette-defaults.js +103 -0
- package/types/cms-plugins.d.ts +6 -1
- package/types/collection-provider.d.ts +27 -0
- package/types/collection-signal-values.d.ts +2 -0
- package/types/collection-signal-values.js +23 -0
- package/types/collection-view-widget.d.ts +9 -0
- package/types/core-widget-placements.d.ts +6 -0
- package/types/signals.d.ts +2 -0
- package/types/signals.js +2 -0
- package/types/table-widget.d.ts +17 -3
- package/types/table-widget.js +0 -282
- package/types/tree-widget.d.ts +0 -1
- package/types/tree-widget.js +0 -60
- package/types/widget-runtime.d.ts +0 -1
- package/types.d.ts +1 -1
- package/types.js +1 -1
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useEffectEvent, useId, useMemo, useRef, } from "react";
|
|
4
|
-
import { $createParagraphNode, $getRoot, $getSelection, $isElementNode, $isRangeSelection, $isRootOrShadowRoot, $insertNodes, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_LOW, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, REDO_COMMAND,
|
|
4
|
+
import { $createParagraphNode, $getRoot, $getSelection, $isElementNode, $isRangeSelection, $isRootOrShadowRoot, $insertNodes, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_LOW, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, REDO_COMMAND, UNDO_COMMAND, getStyleObjectFromCSS, configExtension, defineExtension, } from "lexical";
|
|
5
5
|
import { $generateHtmlFromNodes, $generateNodesFromDOM } from "@lexical/html";
|
|
6
6
|
import { TOGGLE_LINK_COMMAND, $isLinkNode } from "@lexical/link";
|
|
7
7
|
import { $removeList, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, ListNode } from "@lexical/list";
|
|
@@ -23,6 +23,7 @@ import { resolvePhiWidgetFontSize } from "../helpers/font-size";
|
|
|
23
23
|
import { sanitizePhiHtmlWidgetMarkup } from "../helpers/html-content";
|
|
24
24
|
import { PHI_HTML_WIDGET_EDITOR_EMPTY_STATE, registerPhiHtmlWidgetEditorBridge, } from "../client/html-editor-bridge";
|
|
25
25
|
import { $createPhiHtmlImageNode, PhiHtmlImageNode } from "./html-editor-image-node";
|
|
26
|
+
import { PhiHtmlLinkNode, PHI_HTML_LINK_NODE_REPLACEMENT } from "./html-editor-link-node";
|
|
26
27
|
const PHI_HTML_WIDGET_PLACEHOLDER = "Write rich text...";
|
|
27
28
|
const PHI_HTML_WIDGET_EDITOR_LINE_HEIGHT = 1.7;
|
|
28
29
|
const PHI_HTML_WIDGET_EDITOR_MIN_CONTENT_HEIGHT = `${PHI_HTML_WIDGET_EDITOR_LINE_HEIGHT}em`;
|
|
@@ -356,12 +357,15 @@ function PhiHtmlWidgetEditorBridgePlugin({ blockId, }) {
|
|
|
356
357
|
editor.dispatchCommand(REDO_COMMAND, undefined);
|
|
357
358
|
},
|
|
358
359
|
});
|
|
360
|
+
/*
|
|
361
|
+
* Every commit reaches the update listener, a selection-only one included, and it reads the state
|
|
362
|
+
* just committed. `SELECTION_CHANGE_COMMAND` is no place for this: since Lexical 0.52 it runs inside
|
|
363
|
+
* the pending update, before reconciliation, where `editor.getEditorState()` is still the previous
|
|
364
|
+
* commit -- the toolbar would show the formats of the caret's last position, one move behind.
|
|
365
|
+
*/
|
|
359
366
|
return mergeRegister(editor.registerUpdateListener(() => {
|
|
360
367
|
refreshBridgeState();
|
|
361
|
-
}), editor.registerCommand(
|
|
362
|
-
refreshBridgeState();
|
|
363
|
-
return false;
|
|
364
|
-
}, COMMAND_PRIORITY_LOW), editor.registerCommand(CAN_UNDO_COMMAND, (canUndo) => {
|
|
368
|
+
}), editor.registerCommand(CAN_UNDO_COMMAND, (canUndo) => {
|
|
365
369
|
stateRef.current = {
|
|
366
370
|
...stateRef.current,
|
|
367
371
|
canUndo,
|
|
@@ -403,7 +407,7 @@ export function PhiHtmlWidgetEditor({ blockId, html, fontFamily, fontSize, onCha
|
|
|
403
407
|
LinkExtension,
|
|
404
408
|
ListExtension,
|
|
405
409
|
],
|
|
406
|
-
nodes: [PhiHtmlImageNode],
|
|
410
|
+
nodes: [PhiHtmlImageNode, PhiHtmlLinkNode, PHI_HTML_LINK_NODE_REPLACEMENT],
|
|
407
411
|
init(editorConfig) {
|
|
408
412
|
editorConfig.namespace = `PhiHtmlWidgetEditor:${editorId}`;
|
|
409
413
|
editorConfig.onError = (error) => {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* The icon a Button, a Table action or a Command Toolbar names, or null where
|
|
3
|
+
* The icon a Button, a Table action or a Command Toolbar names, as an element, or null where it names
|
|
4
|
+
* none.
|
|
4
5
|
*
|
|
5
|
-
* The same
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The same names as `PhiIcon`: a short name is the Ant Design icon of that name, one name per icon. The
|
|
7
|
+
* name is not looked up here: a preset's is checked by its tests and the Builder's by its save
|
|
8
|
+
* (`isPhiIconNameKnown`), so a live page draws what it was handed, and a name that names nothing draws
|
|
9
|
+
* nothing.
|
|
8
10
|
*/
|
|
9
11
|
export declare function resolvePhiButtonIcon(icon: string | null | undefined): ReactNode;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { PhiIcon } from "../../../shell/phi-icon";
|
|
4
4
|
/**
|
|
5
|
-
* The icon a Button, a Table action or a Command Toolbar names, or null where
|
|
5
|
+
* The icon a Button, a Table action or a Command Toolbar names, as an element, or null where it names
|
|
6
|
+
* none.
|
|
6
7
|
*
|
|
7
|
-
* The same
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* The same names as `PhiIcon`: a short name is the Ant Design icon of that name, one name per icon. The
|
|
9
|
+
* name is not looked up here: a preset's is checked by its tests and the Builder's by its save
|
|
10
|
+
* (`isPhiIconNameKnown`), so a live page draws what it was handed, and a name that names nothing draws
|
|
11
|
+
* nothing.
|
|
10
12
|
*/
|
|
11
13
|
export function resolvePhiButtonIcon(icon) {
|
|
12
14
|
const name = icon?.trim();
|
|
13
|
-
|
|
14
|
-
return null;
|
|
15
|
-
if (!isPhiIconNameKnown(name)) {
|
|
16
|
-
reportPhiUnknownIconName(name);
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return _jsx(PhiIcon, { name: name, size: "1em" });
|
|
15
|
+
return name ? _jsx(PhiIcon, { name: name, size: "1em" }) : null;
|
|
20
16
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Collection View's binding params after a `bindingParamsChange` (`{ params }`): the received ones laid
|
|
3
|
+
* over the ones it has, or `null` where that changes nothing -- the same set again is no new set, so it
|
|
4
|
+
* neither starts the list over nor asks the Provider again. This is what lets another Widget's choice
|
|
5
|
+
* filter a Collection through a Controller that forwards it on every change of the choice
|
|
6
|
+
* (COLLECTIONS.md, "Filtered by another Widget's choice"). Imports nothing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function layPhiCollectionBindingParams(current: Readonly<Record<string, unknown>>, received: Readonly<Record<string, unknown>>): Record<string, unknown> | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Collection View's binding params after a `bindingParamsChange` (`{ params }`): the received ones laid
|
|
3
|
+
* over the ones it has, or `null` where that changes nothing -- the same set again is no new set, so it
|
|
4
|
+
* neither starts the list over nor asks the Provider again. This is what lets another Widget's choice
|
|
5
|
+
* filter a Collection through a Controller that forwards it on every change of the choice
|
|
6
|
+
* (COLLECTIONS.md, "Filtered by another Widget's choice"). Imports nothing.
|
|
7
|
+
*/
|
|
8
|
+
export function layPhiCollectionBindingParams(current, received) {
|
|
9
|
+
const next = { ...current, ...received };
|
|
10
|
+
const unchanged = Object.keys(next).length === Object.keys(current).length &&
|
|
11
|
+
Object.entries(next).every(([key, value]) => JSON.stringify(value) === JSON.stringify(current[key]));
|
|
12
|
+
return unchanged ? null : next;
|
|
13
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import { type PhiRuntimeDataProviderKey } from "../../../../types/runtime-data-provider";
|
|
3
|
-
import type { PhiCollectionProviderActionRequest, PhiCollectionProviderData, PhiCollectionProviderQueryRequest } from "../../../../types/collection-provider";
|
|
3
|
+
import type { PhiCollectionProviderActionRequest, PhiCollectionProviderData, PhiCollectionProviderQueryRequest, PhiCollectionProviderRecordRequest } from "../../../../types/collection-provider";
|
|
4
4
|
import type { PhiProviderResourceSource } from "../../../../types/runtime-data-provider";
|
|
5
5
|
export type PhiCollectionProviderRegistration = {
|
|
6
6
|
key: PhiRuntimeDataProviderKey;
|
|
7
7
|
query: (request: PhiCollectionProviderQueryRequest) => Promise<PhiCollectionProviderData>;
|
|
8
8
|
action?: (request: PhiCollectionProviderActionRequest) => Promise<PhiCollectionProviderData>;
|
|
9
|
+
/**
|
|
10
|
+
* One item by its key, for a record-bound Form opened from one of the View's items (FORMS.md, "A
|
|
11
|
+
* record opened from a Collection View"): the Table Provider's `readRecord`, in its request shape. Only
|
|
12
|
+
* for a resource that declares `recordRead: true`, and required by one.
|
|
13
|
+
*/
|
|
14
|
+
readRecord?: (request: PhiCollectionProviderRecordRequest) => Promise<Record<string, unknown>>;
|
|
9
15
|
resources: readonly {
|
|
10
16
|
resourceKey: string;
|
|
11
17
|
/**
|
|
@@ -17,6 +23,8 @@ export type PhiCollectionProviderRegistration = {
|
|
|
17
23
|
* ships; `PhiCmsCollectionViewWidgetConfig.itemRendererKey` names a different one.
|
|
18
24
|
*/
|
|
19
25
|
itemRendererKey: `${string}/${string}`;
|
|
26
|
+
/** As the resource's declaration says it (`PhiCollectionProviderResourceDescriptor.recordRead`). */
|
|
27
|
+
recordRead?: boolean;
|
|
20
28
|
}[];
|
|
21
29
|
};
|
|
22
30
|
export declare function createPhiCollectionProviderClient(registration: PhiCollectionProviderRegistration): ComponentType<{
|
|
@@ -42,6 +50,8 @@ export declare function usePhiCollectionProvider(source: PhiProviderResourceSour
|
|
|
42
50
|
* ships; `PhiCmsCollectionViewWidgetConfig.itemRendererKey` names a different one.
|
|
43
51
|
*/
|
|
44
52
|
itemRendererKey: `${string}/${string}`;
|
|
53
|
+
/** As the resource's declaration says it (`PhiCollectionProviderResourceDescriptor.recordRead`). */
|
|
54
|
+
recordRead?: boolean;
|
|
45
55
|
} | null;
|
|
46
56
|
bindingError: string | null;
|
|
47
57
|
};
|
|
@@ -14,6 +14,11 @@ export function createPhiCollectionProviderClient(registration) {
|
|
|
14
14
|
registration.resources.some((resource) => !resource.resourceKey.trim() || !isPhiNamespacedRuntimeKey(resource.itemRendererKey))) {
|
|
15
15
|
throw new Error(`Collection provider "${registration.key}" has invalid Client resources.`);
|
|
16
16
|
}
|
|
17
|
+
// As a Table Provider's: a record read declared and not served is worse than one never offered.
|
|
18
|
+
const unserved = registration.resources.find((resource) => resource.recordRead === true);
|
|
19
|
+
if (unserved && !registration.readRecord) {
|
|
20
|
+
throw new Error(`Collection provider "${registration.key}" declares recordRead on resource "${unserved.resourceKey}" but has no readRecord.`);
|
|
21
|
+
}
|
|
17
22
|
return function PhiBoundCollectionProviderClient({ children }) {
|
|
18
23
|
return (_jsx(PhiCollectionProviderClient, { registration: registration, children: children }));
|
|
19
24
|
};
|
|
@@ -66,38 +66,45 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
66
66
|
const abortController = new AbortController();
|
|
67
67
|
const requestId = ++latestRequestRef.current;
|
|
68
68
|
const isCurrent = () => !abortController.signal.aborted && requestId === latestRequestRef.current;
|
|
69
|
-
|
|
69
|
+
let loadingTimer;
|
|
70
|
+
const queryTimer = window.setTimeout(() => {
|
|
70
71
|
if (abortController.signal.aborted)
|
|
71
72
|
return;
|
|
72
|
-
setLoading(true);
|
|
73
73
|
setError(null);
|
|
74
74
|
setQueryError(null);
|
|
75
|
+
// Reset the source first, and only show loading if its answer actually remains pending.
|
|
76
|
+
loadingTimer = window.setTimeout(() => {
|
|
77
|
+
if (isCurrent())
|
|
78
|
+
setLoading(true);
|
|
79
|
+
}, 0);
|
|
80
|
+
void Promise.resolve().then(() => provider.query({
|
|
81
|
+
resourceKey: source.resourceKey,
|
|
82
|
+
query,
|
|
83
|
+
params: source.params,
|
|
84
|
+
locale,
|
|
85
|
+
timeZone,
|
|
86
|
+
signal: abortController.signal,
|
|
87
|
+
})).then((nextData) => {
|
|
88
|
+
if (!isCurrent())
|
|
89
|
+
return;
|
|
90
|
+
setData(nextData);
|
|
91
|
+
setError(nextData.error);
|
|
92
|
+
setQueryError(nextData.error);
|
|
93
|
+
}).catch((nextError) => {
|
|
94
|
+
if (isCurrent()) {
|
|
95
|
+
const message = nextError instanceof Error ? nextError.message : "Collection request failed.";
|
|
96
|
+
setError(message);
|
|
97
|
+
setQueryError(message);
|
|
98
|
+
}
|
|
99
|
+
}).finally(() => {
|
|
100
|
+
window.clearTimeout(loadingTimer);
|
|
101
|
+
// Superseded by an action is still finished loading; only a newer query takes the flag over.
|
|
102
|
+
if (!abortController.signal.aborted)
|
|
103
|
+
setLoading(false);
|
|
104
|
+
});
|
|
75
105
|
}, 0);
|
|
76
|
-
void provider.query({
|
|
77
|
-
resourceKey: source.resourceKey,
|
|
78
|
-
query,
|
|
79
|
-
params: source.params,
|
|
80
|
-
locale,
|
|
81
|
-
timeZone,
|
|
82
|
-
signal: abortController.signal,
|
|
83
|
-
}).then((nextData) => {
|
|
84
|
-
if (!isCurrent())
|
|
85
|
-
return;
|
|
86
|
-
setData(nextData);
|
|
87
|
-
setError(nextData.error);
|
|
88
|
-
setQueryError(nextData.error);
|
|
89
|
-
}).catch((nextError) => {
|
|
90
|
-
if (isCurrent()) {
|
|
91
|
-
const message = nextError instanceof Error ? nextError.message : "Collection request failed.";
|
|
92
|
-
setError(message);
|
|
93
|
-
setQueryError(message);
|
|
94
|
-
}
|
|
95
|
-
}).finally(() => {
|
|
96
|
-
// Superseded by an action is still finished loading; only a newer query takes the flag over.
|
|
97
|
-
if (!abortController.signal.aborted)
|
|
98
|
-
setLoading(false);
|
|
99
|
-
});
|
|
100
106
|
return () => {
|
|
107
|
+
window.clearTimeout(queryTimer);
|
|
101
108
|
window.clearTimeout(loadingTimer);
|
|
102
109
|
abortController.abort();
|
|
103
110
|
};
|
|
@@ -4,6 +4,15 @@ import { type PhiSignalRouteSet } from "../../../../types/signals";
|
|
|
4
4
|
import type { PhiToolbarControlItem } from "../../../controls/phi-toolbar-control";
|
|
5
5
|
import { type PhiButtonVariant } from "../../config/button-variant";
|
|
6
6
|
import type { PhiCommonControlLabels } from "../../label-types/common-controls";
|
|
7
|
+
type PhiCommandButtonRuntimeState = {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
badge?: string | number | null;
|
|
12
|
+
icon?: string | null;
|
|
13
|
+
label?: string | null;
|
|
14
|
+
tooltip?: string | null;
|
|
15
|
+
};
|
|
7
16
|
export type PhiCommandButtonsOptions = {
|
|
8
17
|
buttons: readonly PhiCommandButtonConfig[];
|
|
9
18
|
/** The Widget's control key, as every Control states one (`parsePhiControlConfig`). */
|
|
@@ -40,4 +49,11 @@ export type PhiCommandButtonsResult = {
|
|
|
40
49
|
export declare function resolvePhiCommandButtonVariant(button: Pick<PhiCommandButtonConfig, "variant">, action: {
|
|
41
50
|
variant?: PhiButtonVariant;
|
|
42
51
|
} | null | undefined): PhiButtonVariant | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Whether a button is greyed out: its stated Disabled until `enabled/change` says otherwise, as the
|
|
54
|
+
* toolbar's own Disabled is (`resolvedDisabled`). A confirm button placed greyed out and woken by a
|
|
55
|
+
* Controller stayed grey, since the signal could only ever switch a button off.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolvePhiCommandButtonDisabled(button: Pick<PhiCommandButtonConfig, "disabled">, state: Pick<PhiCommandButtonRuntimeState, "enabled">): boolean;
|
|
43
58
|
export declare function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labels, disabled, initialDisabled, initialReadOnly, signalsEnabled, }: PhiCommandButtonsOptions): PhiCommandButtonsResult;
|
|
59
|
+
export {};
|
|
@@ -74,6 +74,14 @@ function colorPhiCommandButtonIcon(icon, color) {
|
|
|
74
74
|
return icon;
|
|
75
75
|
return createElement("span", { style: { display: "inline-flex", color } }, icon);
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Whether a button is greyed out: its stated Disabled until `enabled/change` says otherwise, as the
|
|
79
|
+
* toolbar's own Disabled is (`resolvedDisabled`). A confirm button placed greyed out and woken by a
|
|
80
|
+
* Controller stayed grey, since the signal could only ever switch a button off.
|
|
81
|
+
*/
|
|
82
|
+
export function resolvePhiCommandButtonDisabled(button, state) {
|
|
83
|
+
return state.enabled === undefined ? button.disabled === true : !state.enabled;
|
|
84
|
+
}
|
|
77
85
|
export function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labels, disabled, initialDisabled = false, initialReadOnly = false, signalsEnabled = true, }) {
|
|
78
86
|
const resolvedKey = key?.trim() || "command";
|
|
79
87
|
const signalIdentity = usePhiSignalIdentity();
|
|
@@ -304,7 +312,7 @@ export function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labe
|
|
|
304
312
|
*/
|
|
305
313
|
type: resolvePhiButtonVariantPresentation(resolvePhiCommandButtonVariant(button, action)).type ?? "default",
|
|
306
314
|
danger: action ? action.danger === true : button.danger === true,
|
|
307
|
-
disabled: button
|
|
315
|
+
disabled: resolvePhiCommandButtonDisabled(button, buttonState),
|
|
308
316
|
readOnly: button.readOnly === true,
|
|
309
317
|
loading: buttonState.loading,
|
|
310
318
|
icon: button.display === "label" ? null : colorPhiCommandButtonIcon(resolvedIcon, button.iconColor),
|
|
@@ -80,6 +80,7 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
80
80
|
history_title_with_name: "Login history for %1",
|
|
81
81
|
history_loading: "Loading login history...",
|
|
82
82
|
history_empty: definePhiMessageLabel("No logins found."),
|
|
83
|
+
history_footer: "%1 logins",
|
|
83
84
|
history_error_title: "Login history failed",
|
|
84
85
|
delete_confirm_title: definePhiMessageLabel("Delete user?"),
|
|
85
86
|
delete_confirm_self: definePhiMessageLabel("You cannot delete your own account here."),
|
|
@@ -203,6 +204,7 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
|
|
|
203
204
|
loading: labels.history_loading,
|
|
204
205
|
empty: labels.history_empty,
|
|
205
206
|
errorTitle: labels.history_error_title,
|
|
207
|
+
footer: labels.history_footer,
|
|
206
208
|
},
|
|
207
209
|
actions: {
|
|
208
210
|
edit: labels.action_edit_label,
|
|
@@ -55,6 +55,7 @@ const PHI_BUILDER_MODULES_PAGE_LABEL_SET = definePhiLabelSet({
|
|
|
55
55
|
usage_sign_in: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.usage.signIn,
|
|
56
56
|
usage_confirm: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.usage.confirm,
|
|
57
57
|
usage_cancel: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.usage.cancel,
|
|
58
|
+
usage_footer: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.usage.footer,
|
|
58
59
|
public_routes_title: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.title,
|
|
59
60
|
public_routes_intro: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.intro,
|
|
60
61
|
public_routes_page: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.page,
|
|
@@ -66,6 +67,7 @@ const PHI_BUILDER_MODULES_PAGE_LABEL_SET = definePhiLabelSet({
|
|
|
66
67
|
public_routes_address: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.address,
|
|
67
68
|
public_routes_assign: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.assign,
|
|
68
69
|
public_routes_cancel: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.cancel,
|
|
70
|
+
public_routes_footer: PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS.publicRoutes.footer,
|
|
69
71
|
},
|
|
70
72
|
});
|
|
71
73
|
export async function getPhiBuilderModulesPageLabels(options) {
|
|
@@ -139,6 +141,7 @@ export async function getPhiBuilderModulesPageLabels(options) {
|
|
|
139
141
|
signIn: labels.usage_sign_in,
|
|
140
142
|
confirm: labels.usage_confirm,
|
|
141
143
|
cancel: labels.usage_cancel,
|
|
144
|
+
footer: labels.usage_footer,
|
|
142
145
|
},
|
|
143
146
|
publicRoutes: {
|
|
144
147
|
title: labels.public_routes_title,
|
|
@@ -152,6 +155,7 @@ export async function getPhiBuilderModulesPageLabels(options) {
|
|
|
152
155
|
address: labels.public_routes_address,
|
|
153
156
|
assign: labels.public_routes_assign,
|
|
154
157
|
cancel: labels.public_routes_cancel,
|
|
158
|
+
footer: labels.public_routes_footer,
|
|
155
159
|
},
|
|
156
160
|
};
|
|
157
161
|
}
|
|
@@ -32,22 +32,6 @@ export declare function getPhiProfileNameWidgetLabels(options: PhiGlobalTranslat
|
|
|
32
32
|
successText: string;
|
|
33
33
|
};
|
|
34
34
|
}>;
|
|
35
|
-
export declare function getPhiProfileOverviewWidgetLabels(options: PhiGlobalTranslatorOptions): Promise<{
|
|
36
|
-
title: string;
|
|
37
|
-
description: string;
|
|
38
|
-
accountLabel: string;
|
|
39
|
-
newsletterLabel: string;
|
|
40
|
-
newsletterDescription: string;
|
|
41
|
-
newsletterOn: string;
|
|
42
|
-
newsletterOff: string;
|
|
43
|
-
feedback: {
|
|
44
|
-
errorTitle: string;
|
|
45
|
-
errorNetwork: string;
|
|
46
|
-
errorGeneric: string;
|
|
47
|
-
successTitle: string;
|
|
48
|
-
successText: string;
|
|
49
|
-
};
|
|
50
|
-
}>;
|
|
51
35
|
export declare function getPhiProfileEmailWidgetLabels(options: PhiGlobalTranslatorOptions): Promise<{
|
|
52
36
|
description: string;
|
|
53
37
|
currentLabel: string;
|
|
@@ -62,24 +62,6 @@ const PHI_PROFILE_PHONE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
62
62
|
success_text: definePhiMessageLabel("Your telephone numbers have been saved."),
|
|
63
63
|
},
|
|
64
64
|
});
|
|
65
|
-
const PHI_PROFILE_OVERVIEW_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
66
|
-
key: "widget:profile-overview",
|
|
67
|
-
ctx: PHI_TR_CTX_WEB_UI_LABEL,
|
|
68
|
-
labels: {
|
|
69
|
-
title: "Overview",
|
|
70
|
-
description: definePhiMessageLabel("Manage your account details and site preferences from one place."),
|
|
71
|
-
account_label: "Account",
|
|
72
|
-
newsletter_label: "Newsletter",
|
|
73
|
-
newsletter_description: definePhiMessageLabel("Receive product and platform updates for this site."),
|
|
74
|
-
newsletter_on: "Enabled",
|
|
75
|
-
newsletter_off: "Disabled",
|
|
76
|
-
error_title: "Newsletter update failed",
|
|
77
|
-
error_network: definePhiMessageLabel("Network error while updating your newsletter preference."),
|
|
78
|
-
error_generic: definePhiMessageLabel("The newsletter preference could not be updated."),
|
|
79
|
-
success_title: "Newsletter updated",
|
|
80
|
-
success_text: definePhiMessageLabel("Your newsletter preference has been saved."),
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
65
|
export async function getPhiProfileLocaleWidgetLabels(options) {
|
|
84
66
|
const labels = await getPhiLabelSet(options, PHI_PROFILE_LOCALE_WIDGET_LABEL_SET);
|
|
85
67
|
return {
|
|
@@ -121,25 +103,6 @@ export async function getPhiProfileNameWidgetLabels(options) {
|
|
|
121
103
|
},
|
|
122
104
|
};
|
|
123
105
|
}
|
|
124
|
-
export async function getPhiProfileOverviewWidgetLabels(options) {
|
|
125
|
-
const labels = await getPhiLabelSet(options, PHI_PROFILE_OVERVIEW_WIDGET_LABEL_SET);
|
|
126
|
-
return {
|
|
127
|
-
title: labels.title,
|
|
128
|
-
description: labels.description,
|
|
129
|
-
accountLabel: labels.account_label,
|
|
130
|
-
newsletterLabel: labels.newsletter_label,
|
|
131
|
-
newsletterDescription: labels.newsletter_description,
|
|
132
|
-
newsletterOn: labels.newsletter_on,
|
|
133
|
-
newsletterOff: labels.newsletter_off,
|
|
134
|
-
feedback: {
|
|
135
|
-
errorTitle: labels.error_title,
|
|
136
|
-
errorNetwork: labels.error_network,
|
|
137
|
-
errorGeneric: labels.error_generic,
|
|
138
|
-
successTitle: labels.success_title,
|
|
139
|
-
successText: labels.success_text,
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
106
|
const PHI_PROFILE_EMAIL_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
144
107
|
key: "widget:profile-email",
|
|
145
108
|
ctx: PHI_TR_CTX_WEB_UI_LABEL,
|
|
@@ -30,7 +30,6 @@ const PHI_REGISTRATION_FORM_LABEL_SET = definePhiLabelSet({
|
|
|
30
30
|
terms_text: "I agree to the %1",
|
|
31
31
|
terms_link_label: "Terms & Conditions",
|
|
32
32
|
terms_required: definePhiMessageLabel("You must accept the terms to continue."),
|
|
33
|
-
newsletter: definePhiMessageLabel("Send me product and platform updates."),
|
|
34
33
|
notice: definePhiMessageLabel("This form sends a verification email first. The live customer account is created only after confirmation."),
|
|
35
34
|
generic_error: definePhiMessageLabel("The registration request could not be completed."),
|
|
36
35
|
account_exists_error: definePhiMessageLabel("Account already exists."),
|
|
@@ -86,7 +85,6 @@ export async function getPhiRegistrationFormLabels(options) {
|
|
|
86
85
|
termsLinkLabel: labels.terms_link_label,
|
|
87
86
|
terms: labels.terms_text,
|
|
88
87
|
termsRequired: labels.terms_required,
|
|
89
|
-
newsletter: labels.newsletter,
|
|
90
88
|
},
|
|
91
89
|
actions: {
|
|
92
90
|
submitLabel: labels.submit_label,
|
|
@@ -58,6 +58,7 @@ const PHI_BUILDER_REVISIONS_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
58
58
|
delete_area_title: PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.title,
|
|
59
59
|
delete_area_warning: definePhiMessageLabel(PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.warning),
|
|
60
60
|
delete_area_survives: definePhiMessageLabel(PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.survives),
|
|
61
|
+
delete_area_type_to_confirm: PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.typeToConfirm,
|
|
61
62
|
delete_area_field: PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.field,
|
|
62
63
|
delete_area_field_required: definePhiMessageLabel(PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.fieldRequired),
|
|
63
64
|
delete_area_confirm: PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS.deleteArea.confirm,
|
|
@@ -136,6 +137,7 @@ export async function getPhiBuilderRevisionsWidgetLabels(options) {
|
|
|
136
137
|
title: labels.delete_area_title,
|
|
137
138
|
warning: labels.delete_area_warning,
|
|
138
139
|
survives: labels.delete_area_survives,
|
|
140
|
+
typeToConfirm: labels.delete_area_type_to_confirm,
|
|
139
141
|
field: labels.delete_area_field,
|
|
140
142
|
fieldRequired: labels.delete_area_field_required,
|
|
141
143
|
confirm: labels.delete_area_confirm,
|
|
@@ -41,6 +41,7 @@ const PHI_SIGNALS_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
41
41
|
routes_update: PHI_SIGNALS_WIDGET_DEFAULT_LABELS.routes.update,
|
|
42
42
|
routes_edit: PHI_SIGNALS_WIDGET_DEFAULT_LABELS.routes.edit,
|
|
43
43
|
routes_delete: PHI_SIGNALS_WIDGET_DEFAULT_LABELS.routes.delete,
|
|
44
|
+
routes_footer: PHI_SIGNALS_WIDGET_DEFAULT_LABELS.routes.footer,
|
|
44
45
|
},
|
|
45
46
|
});
|
|
46
47
|
export async function getPhiSignalsWidgetLabels(options) {
|
|
@@ -84,6 +85,7 @@ export async function getPhiSignalsWidgetLabels(options) {
|
|
|
84
85
|
update: labels.routes_update,
|
|
85
86
|
edit: labels.routes_edit,
|
|
86
87
|
delete: labels.routes_delete,
|
|
88
|
+
footer: labels.routes_footer,
|
|
87
89
|
},
|
|
88
90
|
};
|
|
89
91
|
}
|
|
@@ -59,6 +59,8 @@ export type PhiBuilderModulesPageLabels = {
|
|
|
59
59
|
signIn: string;
|
|
60
60
|
confirm: string;
|
|
61
61
|
cancel: string;
|
|
62
|
+
/** The Table's footer; %1 the places listed. */
|
|
63
|
+
footer: string;
|
|
62
64
|
};
|
|
63
65
|
/** The one question enabling a Module can ask: a Public address it wants is taken. */
|
|
64
66
|
publicRoutes: {
|
|
@@ -74,6 +76,8 @@ export type PhiBuilderModulesPageLabels = {
|
|
|
74
76
|
address: string;
|
|
75
77
|
assign: string;
|
|
76
78
|
cancel: string;
|
|
79
|
+
/** The Table's footer; %1 the addresses listed. */
|
|
80
|
+
footer: string;
|
|
77
81
|
};
|
|
78
82
|
};
|
|
79
83
|
export declare const PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS: PhiBuilderModulesPageLabels;
|
|
@@ -68,6 +68,7 @@ export const PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS = {
|
|
|
68
68
|
"Run phis auth restore-preset --site <site key> on the server to bring it back.",
|
|
69
69
|
confirm: "Switch off anyway",
|
|
70
70
|
cancel: "Keep it on",
|
|
71
|
+
footer: "%1 places draw it",
|
|
71
72
|
},
|
|
72
73
|
publicRoutes: {
|
|
73
74
|
title: "Public addresses are taken",
|
|
@@ -81,5 +82,6 @@ export const PHI_BUILDER_MODULES_PAGE_DEFAULT_LABELS = {
|
|
|
81
82
|
address: "Address",
|
|
82
83
|
assign: "Enable with these addresses",
|
|
83
84
|
cancel: "Cancel",
|
|
85
|
+
footer: "%1 addresses taken",
|
|
84
86
|
},
|
|
85
87
|
};
|
|
@@ -68,6 +68,8 @@ export type PhiBuilderRevisionsWidgetLabels = {
|
|
|
68
68
|
/** What is lost, until the Controller names the Area in it when the dialog opens. */
|
|
69
69
|
warning: string;
|
|
70
70
|
survives: string;
|
|
71
|
+
/** Above the Area key the dialog shows to be typed, which the Controller writes in as it opens. */
|
|
72
|
+
typeToConfirm: string;
|
|
71
73
|
field: string;
|
|
72
74
|
fieldRequired: string;
|
|
73
75
|
confirm: string;
|
|
@@ -60,7 +60,8 @@ export const PHI_BUILDER_REVISIONS_WIDGET_DEFAULT_LABELS = {
|
|
|
60
60
|
title: "Clear this Area back to its preset?",
|
|
61
61
|
warning: "The structure this Site stored for the Area is cleared -- its Shell, drafts and published alike. What is live changes at once, the shell's preset takes the Area back, and no revision is left to restore it from. It cannot be undone. The Module selection is kept.",
|
|
62
62
|
survives: "The Area keeps its Module selection, its Pages, its Navigation and its Theme. Only its Shell goes back to the preset.",
|
|
63
|
-
|
|
63
|
+
typeToConfirm: "Type this Area key to confirm:",
|
|
64
|
+
field: "Area key",
|
|
64
65
|
fieldRequired: "Write the Area key out to confirm.",
|
|
65
66
|
confirm: "Clear Area",
|
|
66
67
|
cancel: "Cancel",
|
|
@@ -37,6 +37,8 @@ export type PhiSignalsWidgetLabels = {
|
|
|
37
37
|
update: string;
|
|
38
38
|
edit: string;
|
|
39
39
|
delete: string;
|
|
40
|
+
/** The routes Table's footer; %1 the routes listed. */
|
|
41
|
+
footer: string;
|
|
40
42
|
};
|
|
41
43
|
};
|
|
42
44
|
export declare const PHI_SIGNALS_WIDGET_DEFAULT_LABELS: PhiSignalsWidgetLabels;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function PhiWidgetFailureAudienceProvider({ staff, children }: {
|
|
3
|
+
staff: boolean;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
/** That the viewer is Staff, who read a Widget's failure on a live page too. */
|
|
7
|
+
export declare function usePhiWidgetFailureStaff(): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
/*
|
|
5
|
+
* Whether the person looking at a live page is Staff, for the one question a live page asks it: does a
|
|
6
|
+
* Widget that failed say so (`widget-failure.tsx`)?
|
|
7
|
+
*
|
|
8
|
+
* Decided once, on the server, by the Area's boundary from the viewer it already resolved
|
|
9
|
+
* (`canPhiViewerReadWidgetFailures`), and handed down here: no request asks for it, and a Widget does
|
|
10
|
+
* not have to carry the viewer to know. Absent -- a page outside an Area boundary, a test -- it is a
|
|
11
|
+
* visitor, who is shown nothing. A Public page rendered once for everybody is rendered for a visitor; a
|
|
12
|
+
* signed-in viewer is never served that render (STATIC_RENDERING.md), so Staff get theirs.
|
|
13
|
+
*/
|
|
14
|
+
const PhiWidgetFailureStaffContext = createContext(false);
|
|
15
|
+
export function PhiWidgetFailureAudienceProvider({ staff, children }) {
|
|
16
|
+
return _jsx(PhiWidgetFailureStaffContext.Provider, { value: staff, children: children });
|
|
17
|
+
}
|
|
18
|
+
/** That the viewer is Staff, who read a Widget's failure on a live page too. */
|
|
19
|
+
export function usePhiWidgetFailureStaff() {
|
|
20
|
+
return useContext(PhiWidgetFailureStaffContext);
|
|
21
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect, useEffectEvent } from "react";
|
|
3
|
-
import { logPhiWidgetFailure
|
|
3
|
+
import { logPhiWidgetFailure } from "./widget-failure";
|
|
4
|
+
import { usePhiWidgetFailureStaff } from "./widget-failure-audience";
|
|
5
|
+
import { renderPhiWidgetFailureNotice } from "./widget-failure-notice";
|
|
4
6
|
/**
|
|
5
7
|
* A Widget's data or configuration failure, found in the browser -- a Provider the Area does not offer,
|
|
6
8
|
* a read that failed after hydration.
|
|
@@ -11,10 +13,11 @@ import { logPhiWidgetFailure, renderPhiWidgetFailureNotice } from "./widget-fail
|
|
|
11
13
|
*/
|
|
12
14
|
export function PhiWidgetFailure(props) {
|
|
13
15
|
const { renderMode, widgetType, widgetId, title, description } = props;
|
|
16
|
+
const staff = usePhiWidgetFailureStaff();
|
|
14
17
|
// `error` is read, not watched: it is a new object whenever the same failure is raised again.
|
|
15
18
|
const log = useEffectEvent(() => logPhiWidgetFailure(props));
|
|
16
19
|
useEffect(() => {
|
|
17
20
|
log();
|
|
18
21
|
}, [description, renderMode, title, widgetId, widgetType]);
|
|
19
|
-
return renderPhiWidgetFailureNotice(props);
|
|
22
|
+
return renderPhiWidgetFailureNotice(props, staff);
|
|
20
23
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PhiWidgetFailureProps } from "./widget-failure";
|
|
2
|
+
/**
|
|
3
|
+
* The card for a failure the server decided and has already written down (`PhiWidgetFailureServer`):
|
|
4
|
+
* drawn here because only the browser's side of the page knows whether the viewer is Staff.
|
|
5
|
+
*/
|
|
6
|
+
export declare function PhiWidgetFailureNotice(props: Omit<PhiWidgetFailureProps, "error">): import("react").JSX.Element | null;
|