@phis/ui 0.7.8 → 0.8.0
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/controls/phi-address-control.d.ts +23 -0
- package/components/controls/phi-address-control.js +43 -0
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-country-select-control.d.ts +22 -0
- package/components/controls/phi-country-select-control.js +16 -0
- package/components/controls/phi-dialog-control.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +5 -3
- package/components/controls/phi-drawer-control.d.ts +7 -5
- package/components/controls/phi-float-button-control.d.ts +8 -1
- package/components/controls/phi-float-button-control.js +19 -3
- package/components/controls/phi-form-control.js +52 -8
- package/components/controls/phi-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +14 -37
- package/components/controls/phi-modal-control.d.ts +5 -5
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-overlay-control-contract.d.ts +52 -17
- package/components/controls/phi-overlay-control-contract.js +55 -30
- package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
- package/components/controls/phi-reveal-once-dialog-control.js +52 -0
- package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
- package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- package/components/forms/form-option-flags.d.ts +20 -0
- package/components/forms/form-option-flags.js +38 -0
- package/components/forms/form-provider-contract.d.ts +23 -0
- package/components/forms/form-provider-contract.js +36 -0
- package/components/forms/form-provider-registry.d.ts +5 -1
- package/components/forms/shared-form-provider-registry.js +13 -0
- package/components/forms/structured-field-labels.d.ts +24 -0
- package/components/forms/structured-field-labels.js +43 -0
- package/components/forms/structured-form-field-controls.d.ts +12 -0
- package/components/forms/structured-form-field-controls.js +65 -0
- package/components/overlays/phi-overlay-container-client.js +2 -2
- package/components/regions/phi-cms-region-shell.js +2 -2
- package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/shell/phi-antd-icon.d.ts +1 -8
- package/components/shell/phi-antd-icon.js +1 -227
- package/components/shell/phi-icon-names.d.ts +19 -0
- package/components/shell/phi-icon-names.js +264 -0
- package/components/shell/phi-icon.d.ts +2 -11
- package/components/shell/phi-icon.js +4 -32
- package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
- package/components/widgets/client/shared/phi-command-buttons.js +10 -4
- package/components/widgets/client/shared/phi-rendered-value.js +27 -3
- package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
- package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
- package/components/widgets/config/background.d.ts +3 -2
- package/components/widgets/config/choice-shared.d.ts +10 -1
- package/components/widgets/config/choice-shared.js +8 -2
- package/components/widgets/label-sets/admin-locales.js +1 -1
- package/components/widgets/label-sets/admin-users.d.ts +2 -5
- package/components/widgets/label-sets/admin-users.js +4 -10
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -0
- package/components/widgets/label-sets/profile.js +28 -0
- package/components/widgets/label-sets/search-results.js +2 -4
- package/components/widgets/label-sets/table.js +9 -0
- package/components/widgets/label-types/effects.d.ts +3 -2
- package/components/widgets/label-types/effects.js +1 -2
- package/components/widgets/label-types/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/server/builder-chrome.d.ts +4 -1
- package/components/widgets/server/builder-chrome.js +2 -2
- package/components/widgets/shared/markdown-body-client.d.ts +26 -0
- package/components/widgets/shared/markdown-body-client.js +31 -1
- package/components/widgets/shared/markdown-render.d.ts +10 -2
- package/components/widgets/shared/markdown-render.js +35 -13
- package/constants/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +25 -0
- package/constants/customer-file.js +26 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +12 -0
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +1 -0
- package/constants.js +2 -0
- package/gateway/form-handler-request.d.ts +22 -0
- package/gateway/form-handler-request.js +40 -0
- package/gateway/label-set.d.ts +15 -2
- package/gateway/label-set.js +60 -22
- package/gateway/site-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -0
- package/helpers/cms-dialog.d.ts +5 -20
- package/helpers/cms-dialog.js +8 -13
- package/helpers/cms-page-catalog.d.ts +10 -0
- package/helpers/cms-page-catalog.js +19 -0
- package/helpers/cms-preset-nodes.d.ts +4 -4
- package/helpers/cms-preset-nodes.js +1 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/country-names.d.ts +12 -0
- package/helpers/country-names.js +14 -0
- package/helpers/phi-metadata.d.ts +33 -1
- package/helpers/phi-metadata.js +62 -1
- package/helpers/preset-table-check.d.ts +34 -0
- package/helpers/preset-table-check.js +124 -0
- package/helpers/preset-text-source-check.d.ts +4 -1
- package/helpers/preset-text-source-check.js +6 -1
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +30 -5
- package/helpers/public-route-claims.d.ts +9 -1
- package/helpers/public-route-claims.js +23 -3
- package/helpers/record-fields.d.ts +1 -5
- package/helpers/record-fields.js +15 -6
- package/helpers/route-address-check.d.ts +22 -2
- package/helpers/route-address-check.js +29 -8
- package/helpers/site-address-row.d.ts +23 -0
- package/helpers/site-address-row.js +36 -0
- package/helpers/surface-style.d.ts +8 -1
- package/helpers/surface-style.js +12 -2
- package/helpers/thread-inbox-row.d.ts +20 -0
- package/helpers/thread-inbox-row.js +26 -0
- package/helpers/translation-format.d.ts +26 -0
- package/helpers/translation-format.js +31 -0
- package/module-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +1 -0
- package/module-page-check.js +1 -0
- package/module-records.d.ts +2 -2
- package/module-records.js +1 -0
- package/next/area-route.js +34 -1
- package/next/root-route.js +4 -5
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
- package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
- package/plugins/runtime-modules/accounting/data-providers.js +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
- package/plugins/runtime-modules/accounting/ids.js +23 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
- package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/app/client-data-providers.js +9 -0
- package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
- package/plugins/runtime-modules/app/data-providers.js +80 -0
- package/plugins/runtime-modules/app/definition.d.ts +131 -0
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +46 -1
- package/plugins/runtime-modules/app/forms.js +195 -1
- package/plugins/runtime-modules/app/ids.d.ts +7 -0
- package/plugins/runtime-modules/app/ids.js +8 -0
- package/plugins/runtime-modules/app/module.d.ts +131 -0
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
- package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
- package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
- package/plugins/runtime-modules/asset/presets.d.ts +4 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
- package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
- package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
- package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
- package/plugins/runtime-modules/blog/presets.d.ts +4 -0
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
- package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
- package/plugins/runtime-modules/builder/persistence.js +4 -0
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
- package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
- package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
- package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
- package/plugins/runtime-modules/client-manifests/app.js +3 -0
- package/plugins/runtime-modules/client-manifests/builder.js +10 -0
- package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +23 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
- package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
- package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
- package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
- package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
- package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
- package/plugins/runtime-modules/descriptor-compiler.js +44 -16
- package/plugins/runtime-modules/editor/presets.d.ts +4 -0
- package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/localization/presets.d.ts +4 -0
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
- package/plugins/runtime-modules/news/presets.d.ts +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
- package/plugins/runtime-modules/resolver.js +17 -0
- package/plugins/runtime-modules/revisions/controller/client.js +13 -11
- package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/table.js +13 -4
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/definition.js +1 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
- package/plugins/runtime-modules/threads/data-providers.js +85 -0
- package/plugins/runtime-modules/threads/definition.d.ts +115 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +3 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
- package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
- package/plugins/runtime-modules/user-management/data-providers.js +101 -3
- package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
- package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
- package/plugins/runtime-modules/user-management/ids.js +9 -0
- package/plugins/runtime-modules/user-management/presets.js +17 -1
- package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
- package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
- package/server-helpers/cms-page-record.d.ts +9 -1
- package/server-helpers/cms-page-record.js +11 -1
- package/server-helpers/cms-request.js +8 -5
- package/server-helpers/link-preview-image.d.ts +30 -0
- package/server-helpers/link-preview-image.js +57 -0
- package/server-helpers/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/shell.css +30 -6
- package/theme/phi-theme-composition.js +9 -0
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.js +103 -0
- package/theme/phi-theme-tokens.d.ts +2 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/cms-module-descriptors.d.ts +14 -0
- package/types/cms-overlay.d.ts +13 -6
- package/types/cms-overlay.js +6 -22
- package/types/cms-plugins.d.ts +14 -2
- package/types/cms.d.ts +10 -0
- package/types/core-widget-placements.d.ts +3 -3
- package/types/link-preview.d.ts +19 -0
- package/types/link-preview.js +19 -0
- package/types/record-provider.d.ts +22 -1
- package/types/site-theme.d.ts +27 -0
- package/types/table-embed.d.ts +48 -0
- package/types/table-embed.js +1 -0
- package/types/table-widget.d.ts +14 -0
- package/types/widget-runtime.d.ts +3 -0
- package/types.d.ts +1 -0
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The house's icon names, apart from the components that draw them: no React, no Ant Design, nothing a
|
|
3
|
+
* Server Component or a package's verify step cannot load. `phi-antd-icon.tsx` draws them and
|
|
4
|
+
* `phi-icon.tsx` decides with the rule below; `checkPhiPresetTreeContract` asks the same rule of every
|
|
5
|
+
* icon a preset's Tables name (`@phis/ui/module/page-check`).
|
|
6
|
+
*/
|
|
7
|
+
import { PHI_MODULE_ICON_NAMESPACE } from "../../constants/module-identity";
|
|
8
|
+
/**
|
|
9
|
+
* The names `PhiIcon` resolves to an Ant Design icon, bare or after `antd:`.
|
|
10
|
+
*
|
|
11
|
+
* The navigation and management names (`dashboard`, `team`, `translation`, ...) used to sit in a second,
|
|
12
|
+
* separately loaded registry; with every icon its own chunk there is nothing left to keep apart.
|
|
13
|
+
*/
|
|
14
|
+
export const PHI_ANTD_ICON_NAMES = {
|
|
15
|
+
block: "BlockOutlined",
|
|
16
|
+
"block-outlined": "BlockOutlined",
|
|
17
|
+
cluster: "ClusterOutlined",
|
|
18
|
+
"cluster-outlined": "ClusterOutlined",
|
|
19
|
+
send: "SendOutlined",
|
|
20
|
+
"send-outlined": "SendOutlined",
|
|
21
|
+
home: "HomeOutlined",
|
|
22
|
+
"home-outlined": "HomeOutlined",
|
|
23
|
+
mail: "MailOutlined",
|
|
24
|
+
"mail-outlined": "MailOutlined",
|
|
25
|
+
location: "EnvironmentOutlined",
|
|
26
|
+
environment: "EnvironmentOutlined",
|
|
27
|
+
"environment-outlined": "EnvironmentOutlined",
|
|
28
|
+
global: "GlobalOutlined",
|
|
29
|
+
"global-outlined": "GlobalOutlined",
|
|
30
|
+
shopping: "ShoppingOutlined",
|
|
31
|
+
"shopping-outlined": "ShoppingOutlined",
|
|
32
|
+
"shopping-cart": "ShoppingCartOutlined",
|
|
33
|
+
"shopping-cart-outlined": "ShoppingCartOutlined",
|
|
34
|
+
star: "StarOutlined",
|
|
35
|
+
"star-outlined": "StarOutlined",
|
|
36
|
+
question: "QuestionCircleOutlined",
|
|
37
|
+
"question-circle": "QuestionCircleOutlined",
|
|
38
|
+
"question-circle-outlined": "QuestionCircleOutlined",
|
|
39
|
+
info: "InfoCircleOutlined",
|
|
40
|
+
"info-circle": "InfoCircleOutlined",
|
|
41
|
+
"info-circle-outlined": "InfoCircleOutlined",
|
|
42
|
+
logout: "LogoutOutlined",
|
|
43
|
+
"logout-outlined": "LogoutOutlined",
|
|
44
|
+
user: "UserOutlined",
|
|
45
|
+
"user-outlined": "UserOutlined",
|
|
46
|
+
google: "GoogleOutlined",
|
|
47
|
+
"google-outlined": "GoogleOutlined",
|
|
48
|
+
apple: "AppleOutlined",
|
|
49
|
+
"apple-outlined": "AppleOutlined",
|
|
50
|
+
github: "GithubOutlined",
|
|
51
|
+
"github-outlined": "GithubOutlined",
|
|
52
|
+
windows: "WindowsOutlined",
|
|
53
|
+
"windows-outlined": "WindowsOutlined",
|
|
54
|
+
apartment: "ApartmentOutlined",
|
|
55
|
+
"apartment-outlined": "ApartmentOutlined",
|
|
56
|
+
api: "ApiOutlined",
|
|
57
|
+
"api-outlined": "ApiOutlined",
|
|
58
|
+
appstore: "AppstoreOutlined",
|
|
59
|
+
"appstore-outlined": "AppstoreOutlined",
|
|
60
|
+
branches: "BranchesOutlined",
|
|
61
|
+
"branches-outlined": "BranchesOutlined",
|
|
62
|
+
check: "CheckOutlined",
|
|
63
|
+
"check-outlined": "CheckOutlined",
|
|
64
|
+
// Only the long name: a bare `clear` already means the close mark on a Button (phi-button-icons.tsx).
|
|
65
|
+
"clear-outlined": "ClearOutlined",
|
|
66
|
+
close: "CloseOutlined",
|
|
67
|
+
"close-outlined": "CloseOutlined",
|
|
68
|
+
code: "CodeOutlined",
|
|
69
|
+
"code-outlined": "CodeOutlined",
|
|
70
|
+
"column-width": "ColumnWidthOutlined",
|
|
71
|
+
"column-width-outlined": "ColumnWidthOutlined",
|
|
72
|
+
"customer-service": "CustomerServiceOutlined",
|
|
73
|
+
"customer-service-outlined": "CustomerServiceOutlined",
|
|
74
|
+
dash: "DashOutlined",
|
|
75
|
+
"dash-outlined": "DashOutlined",
|
|
76
|
+
dashboard: "DashboardOutlined",
|
|
77
|
+
"dashboard-outlined": "DashboardOutlined",
|
|
78
|
+
delete: "DeleteOutlined",
|
|
79
|
+
"delete-outlined": "DeleteOutlined",
|
|
80
|
+
edit: "EditOutlined",
|
|
81
|
+
"edit-outlined": "EditOutlined",
|
|
82
|
+
download: "DownloadOutlined",
|
|
83
|
+
"download-outlined": "DownloadOutlined",
|
|
84
|
+
experiment: "ExperimentOutlined",
|
|
85
|
+
"experiment-outlined": "ExperimentOutlined",
|
|
86
|
+
file: "FileTextOutlined",
|
|
87
|
+
"file-text": "FileTextOutlined",
|
|
88
|
+
"file-search": "FileTextOutlined",
|
|
89
|
+
"file-text-outlined": "FileTextOutlined",
|
|
90
|
+
history: "HistoryOutlined",
|
|
91
|
+
"history-outlined": "HistoryOutlined",
|
|
92
|
+
menu: "MenuOutlined",
|
|
93
|
+
"menu-outlined": "MenuOutlined",
|
|
94
|
+
message: "MessageOutlined",
|
|
95
|
+
"message-outlined": "MessageOutlined",
|
|
96
|
+
notification: "NotificationOutlined",
|
|
97
|
+
"notification-outlined": "NotificationOutlined",
|
|
98
|
+
picture: "PictureOutlined",
|
|
99
|
+
"picture-outlined": "PictureOutlined",
|
|
100
|
+
plus: "PlusOutlined",
|
|
101
|
+
"plus-outlined": "PlusOutlined",
|
|
102
|
+
profile: "ProfileOutlined",
|
|
103
|
+
"profile-outlined": "ProfileOutlined",
|
|
104
|
+
calendar: "CalendarOutlined",
|
|
105
|
+
"calendar-outlined": "CalendarOutlined",
|
|
106
|
+
form: "FormOutlined",
|
|
107
|
+
"form-outlined": "FormOutlined",
|
|
108
|
+
read: "ReadOutlined",
|
|
109
|
+
"read-outlined": "ReadOutlined",
|
|
110
|
+
"safety-certificate": "SafetyCertificateOutlined",
|
|
111
|
+
"safety-certificate-outlined": "SafetyCertificateOutlined",
|
|
112
|
+
setting: "SettingOutlined",
|
|
113
|
+
"setting-outlined": "SettingOutlined",
|
|
114
|
+
skin: "SkinOutlined",
|
|
115
|
+
"skin-outlined": "SkinOutlined",
|
|
116
|
+
table: "TableOutlined",
|
|
117
|
+
"table-outlined": "TableOutlined",
|
|
118
|
+
team: "TeamOutlined",
|
|
119
|
+
"team-outlined": "TeamOutlined",
|
|
120
|
+
translation: "TranslationOutlined",
|
|
121
|
+
"translation-outlined": "TranslationOutlined",
|
|
122
|
+
"user-add": "UserAddOutlined",
|
|
123
|
+
"user-add-outlined": "UserAddOutlined",
|
|
124
|
+
"align-center": "AlignCenterOutlined",
|
|
125
|
+
"align-center-outlined": "AlignCenterOutlined",
|
|
126
|
+
"align-left": "AlignLeftOutlined",
|
|
127
|
+
"align-left-outlined": "AlignLeftOutlined",
|
|
128
|
+
"align-right": "AlignRightOutlined",
|
|
129
|
+
"align-right-outlined": "AlignRightOutlined",
|
|
130
|
+
"arrow-down": "ArrowDownOutlined",
|
|
131
|
+
"arrow-down-outlined": "ArrowDownOutlined",
|
|
132
|
+
"arrow-up": "ArrowUpOutlined",
|
|
133
|
+
"arrow-up-outlined": "ArrowUpOutlined",
|
|
134
|
+
"audit": "AuditOutlined",
|
|
135
|
+
"audio-two-tone": "AudioTwoTone",
|
|
136
|
+
"bg-colors": "BgColorsOutlined",
|
|
137
|
+
"bg-colors-outlined": "BgColorsOutlined",
|
|
138
|
+
build: "BuildOutlined",
|
|
139
|
+
"build-outlined": "BuildOutlined",
|
|
140
|
+
idcard: "IdcardOutlined",
|
|
141
|
+
"idcard-outlined": "IdcardOutlined",
|
|
142
|
+
"font-colors": "FontColorsOutlined",
|
|
143
|
+
"font-colors-outlined": "FontColorsOutlined",
|
|
144
|
+
copy: "CopyOutlined",
|
|
145
|
+
"copy-outlined": "CopyOutlined",
|
|
146
|
+
down: "DownOutlined",
|
|
147
|
+
"down-outlined": "DownOutlined",
|
|
148
|
+
"file-image-two-tone": "FileImageTwoTone",
|
|
149
|
+
"file-pdf-two-tone": "FilePdfTwoTone",
|
|
150
|
+
"file-text-two-tone": "FileTextTwoTone",
|
|
151
|
+
"file-unknown-two-tone": "FileUnknownTwoTone",
|
|
152
|
+
"file-zip-two-tone": "FileZipTwoTone",
|
|
153
|
+
"font-size": "FontSizeOutlined",
|
|
154
|
+
"font-size-outlined": "FontSizeOutlined",
|
|
155
|
+
"format-painter": "FormatPainterOutlined",
|
|
156
|
+
"format-painter-outlined": "FormatPainterOutlined",
|
|
157
|
+
"hdd-two-tone": "HddTwoTone",
|
|
158
|
+
"highlight-two-tone": "HighlightTwoTone",
|
|
159
|
+
holder: "HolderOutlined",
|
|
160
|
+
"holder-outlined": "HolderOutlined",
|
|
161
|
+
layout: "LayoutOutlined",
|
|
162
|
+
"layout-outlined": "LayoutOutlined",
|
|
163
|
+
left: "LeftOutlined",
|
|
164
|
+
"left-outlined": "LeftOutlined",
|
|
165
|
+
"menu-fold": "MenuFoldOutlined",
|
|
166
|
+
"menu-fold-outlined": "MenuFoldOutlined",
|
|
167
|
+
"menu-unfold": "MenuUnfoldOutlined",
|
|
168
|
+
"menu-unfold-outlined": "MenuUnfoldOutlined",
|
|
169
|
+
monitor: "MonitorOutlined",
|
|
170
|
+
"monitor-outlined": "MonitorOutlined",
|
|
171
|
+
moon: "MoonOutlined",
|
|
172
|
+
"moon-outlined": "MoonOutlined",
|
|
173
|
+
"node-index": "NodeIndexOutlined",
|
|
174
|
+
"node-index-outlined": "NodeIndexOutlined",
|
|
175
|
+
"pause-circle": "PauseCircleOutlined",
|
|
176
|
+
"pause-circle-outlined": "PauseCircleOutlined",
|
|
177
|
+
"play-circle": "PlayCircleOutlined",
|
|
178
|
+
"play-circle-filled": "PlayCircleFilled",
|
|
179
|
+
"play-circle-outlined": "PlayCircleOutlined",
|
|
180
|
+
right: "RightOutlined",
|
|
181
|
+
"right-outlined": "RightOutlined",
|
|
182
|
+
"share-alt": "ShareAltOutlined",
|
|
183
|
+
"share-alt-outlined": "ShareAltOutlined",
|
|
184
|
+
sun: "SunOutlined",
|
|
185
|
+
"sun-outlined": "SunOutlined",
|
|
186
|
+
"ordered-list-outlined": "OrderedListOutlined",
|
|
187
|
+
"login": "LoginOutlined",
|
|
188
|
+
"plus-circle-outlined": "PlusCircleOutlined",
|
|
189
|
+
"unordered-list": "UnorderedListOutlined",
|
|
190
|
+
"unordered-list-outlined": "UnorderedListOutlined",
|
|
191
|
+
up: "UpOutlined",
|
|
192
|
+
"up-outlined": "UpOutlined",
|
|
193
|
+
upload: "UploadOutlined",
|
|
194
|
+
"upload-outlined": "UploadOutlined",
|
|
195
|
+
"video-camera-two-tone": "VideoCameraTwoTone",
|
|
196
|
+
warning: "WarningOutlined",
|
|
197
|
+
"warning-outlined": "WarningOutlined",
|
|
198
|
+
"cloud-download": "CloudDownloadOutlined",
|
|
199
|
+
"cloud-download-outlined": "CloudDownloadOutlined",
|
|
200
|
+
"cloud-upload": "CloudUploadOutlined",
|
|
201
|
+
"cloud-upload-outlined": "CloudUploadOutlined",
|
|
202
|
+
"eye-invisible": "EyeInvisibleOutlined",
|
|
203
|
+
"eye-invisible-outlined": "EyeInvisibleOutlined",
|
|
204
|
+
eye: "EyeOutlined",
|
|
205
|
+
"eye-outlined": "EyeOutlined",
|
|
206
|
+
"folder-add": "FolderAddOutlined",
|
|
207
|
+
"folder-add-outlined": "FolderAddOutlined",
|
|
208
|
+
folder: "FolderOutlined",
|
|
209
|
+
"folder-outlined": "FolderOutlined",
|
|
210
|
+
link: "LinkOutlined",
|
|
211
|
+
"link-outlined": "LinkOutlined",
|
|
212
|
+
lock: "LockOutlined",
|
|
213
|
+
"lock-outlined": "LockOutlined",
|
|
214
|
+
minus: "MinusOutlined",
|
|
215
|
+
"minus-outlined": "MinusOutlined",
|
|
216
|
+
inbox: "InboxOutlined",
|
|
217
|
+
"inbox-outlined": "InboxOutlined",
|
|
218
|
+
redo: "RedoOutlined",
|
|
219
|
+
"redo-outlined": "RedoOutlined",
|
|
220
|
+
reload: "ReloadOutlined",
|
|
221
|
+
"reload-outlined": "ReloadOutlined",
|
|
222
|
+
rollback: "RollbackOutlined",
|
|
223
|
+
"rollback-outlined": "RollbackOutlined",
|
|
224
|
+
save: "SaveOutlined",
|
|
225
|
+
"save-outlined": "SaveOutlined",
|
|
226
|
+
search: "SearchOutlined",
|
|
227
|
+
"search-outlined": "SearchOutlined",
|
|
228
|
+
stop: "StopOutlined",
|
|
229
|
+
"stop-outlined": "StopOutlined",
|
|
230
|
+
undo: "UndoOutlined",
|
|
231
|
+
"undo-outlined": "UndoOutlined",
|
|
232
|
+
unlock: "UnlockOutlined",
|
|
233
|
+
"unlock-outlined": "UnlockOutlined",
|
|
234
|
+
};
|
|
235
|
+
export function isPhiBuilderIconNamespace(namespace) {
|
|
236
|
+
return namespace.endsWith("/layouts") || namespace.endsWith("/widgets");
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Whether `PhiIcon` draws something for `name`: the one rule every icon name in this house follows.
|
|
240
|
+
*
|
|
241
|
+
* A name without a prefix is an Ant Design icon from `PHI_ANTD_ICON_NAMES` and means the same as
|
|
242
|
+
* `antd:<name>`. One name per icon, and the same name in a Button, a Table action, a Command Toolbar and a
|
|
243
|
+
* preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
|
|
244
|
+
* `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
|
|
245
|
+
* themselves whether the name exists, so here they count as known.
|
|
246
|
+
*/
|
|
247
|
+
export function isPhiIconNameKnown(name) {
|
|
248
|
+
const [namespace, ...rest] = name.split(":");
|
|
249
|
+
const value = rest.join(":");
|
|
250
|
+
if (!value)
|
|
251
|
+
return Object.hasOwn(PHI_ANTD_ICON_NAMES, name);
|
|
252
|
+
if (isPhiBuilderIconNamespace(namespace))
|
|
253
|
+
return true;
|
|
254
|
+
switch (namespace) {
|
|
255
|
+
case PHI_MODULE_ICON_NAMESPACE:
|
|
256
|
+
case "iconify":
|
|
257
|
+
case "asset":
|
|
258
|
+
return true;
|
|
259
|
+
case "antd":
|
|
260
|
+
return Object.hasOwn(PHI_ANTD_ICON_NAMES, value);
|
|
261
|
+
default:
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type PhiAntdIconPresentation } from "./phi-antd-icon";
|
|
2
|
+
import { isPhiIconNameKnown } from "./phi-icon-names";
|
|
3
|
+
export { isPhiIconNameKnown };
|
|
2
4
|
/**
|
|
3
5
|
* `style`, `className`, `title`, `ariaLabel` and `twoToneColor` reach the Ant Design icons, which is
|
|
4
6
|
* where the house draws its interface icons, and all but `twoToneColor` a Module's own icon
|
|
@@ -8,16 +10,6 @@ type PhiIconProps = {
|
|
|
8
10
|
name?: string;
|
|
9
11
|
size?: number | string;
|
|
10
12
|
} & PhiAntdIconPresentation;
|
|
11
|
-
/**
|
|
12
|
-
* Whether `PhiIcon` draws something for `name`: the one rule every icon name in this house follows.
|
|
13
|
-
*
|
|
14
|
-
* A name without a prefix is an Ant Design icon from `PHI_ANTD_ICON_NAMES` and means the same as
|
|
15
|
-
* `antd:<name>`. One name per icon, and the same name in a Button, a Table action, a Command Toolbar and a
|
|
16
|
-
* preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
|
|
17
|
-
* `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
|
|
18
|
-
* themselves whether the name exists, so here they count as known.
|
|
19
|
-
*/
|
|
20
|
-
export declare function isPhiIconNameKnown(name: string): boolean;
|
|
21
13
|
/**
|
|
22
14
|
* Says once per name that it names no icon, where somebody reads it.
|
|
23
15
|
*
|
|
@@ -27,4 +19,3 @@ export declare function isPhiIconNameKnown(name: string): boolean;
|
|
|
27
19
|
*/
|
|
28
20
|
export declare function reportPhiUnknownIconName(name: string): void;
|
|
29
21
|
export declare function PhiIcon({ name, size, ...presentation }: PhiIconProps): import("react").JSX.Element | null;
|
|
30
|
-
export {};
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { lazy, Suspense, useEffect, useState, } from "react";
|
|
4
4
|
import { PHI_MODULE_ICON_NAMESPACE } from "../../constants/module-identity";
|
|
5
|
-
import {
|
|
5
|
+
import { PhiAntdIcon } from "./phi-antd-icon";
|
|
6
|
+
import { isPhiBuilderIconNamespace, isPhiIconNameKnown, PHI_ANTD_ICON_NAMES } from "./phi-icon-names";
|
|
7
|
+
export { isPhiIconNameKnown };
|
|
6
8
|
import { PhiModuleIcon } from "./phi-module-icons";
|
|
7
9
|
let iconifyComponentLoader = null;
|
|
8
10
|
function loadIconifyComponent() {
|
|
@@ -28,36 +30,6 @@ function renderIconFallback(size) {
|
|
|
28
30
|
height: size,
|
|
29
31
|
} }));
|
|
30
32
|
}
|
|
31
|
-
function isPhiBuilderIconNamespace(namespace) {
|
|
32
|
-
return namespace.endsWith("/layouts") || namespace.endsWith("/widgets");
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Whether `PhiIcon` draws something for `name`: the one rule every icon name in this house follows.
|
|
36
|
-
*
|
|
37
|
-
* A name without a prefix is an Ant Design icon from `PHI_ANTD_ICON_NAMES` and means the same as
|
|
38
|
-
* `antd:<name>`. One name per icon, and the same name in a Button, a Table action, a Command Toolbar and a
|
|
39
|
-
* preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
|
|
40
|
-
* `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
|
|
41
|
-
* themselves whether the name exists, so here they count as known.
|
|
42
|
-
*/
|
|
43
|
-
export function isPhiIconNameKnown(name) {
|
|
44
|
-
const [namespace, ...rest] = name.split(":");
|
|
45
|
-
const value = rest.join(":");
|
|
46
|
-
if (!value)
|
|
47
|
-
return Object.hasOwn(PHI_ANTD_ICON_NAMES, name);
|
|
48
|
-
if (isPhiBuilderIconNamespace(namespace))
|
|
49
|
-
return true;
|
|
50
|
-
switch (namespace) {
|
|
51
|
-
case PHI_MODULE_ICON_NAMESPACE:
|
|
52
|
-
case "iconify":
|
|
53
|
-
case "asset":
|
|
54
|
-
return true;
|
|
55
|
-
case "antd":
|
|
56
|
-
return Object.hasOwn(PHI_ANTD_ICON_NAMES, value);
|
|
57
|
-
default:
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
33
|
const reportedUnknownIconNames = new Set();
|
|
62
34
|
/**
|
|
63
35
|
* Says once per name that it names no icon, where somebody reads it.
|
|
@@ -71,7 +43,7 @@ export function reportPhiUnknownIconName(name) {
|
|
|
71
43
|
return;
|
|
72
44
|
reportedUnknownIconNames.add(name);
|
|
73
45
|
console.warn(`[phi-icon] "${name}" names no icon and draws nothing. Use a name from PHI_ANTD_ICON_NAMES `
|
|
74
|
-
+ "(components/shell/phi-
|
|
46
|
+
+ "(components/shell/phi-icon-names.ts), with or without `antd:`, or a `module:`, `iconify:` or `asset:` name.");
|
|
75
47
|
}
|
|
76
48
|
function renderAntdIcon(key, size, presentation) {
|
|
77
49
|
const icon = PHI_ANTD_ICON_NAMES[key];
|
|
@@ -6,15 +6,26 @@ import { type PhiButtonVariant } from "../../config/button-variant";
|
|
|
6
6
|
import type { PhiCommonControlLabels } from "../../label-types/common-controls";
|
|
7
7
|
export type PhiCommandButtonsOptions = {
|
|
8
8
|
buttons: readonly PhiCommandButtonConfig[];
|
|
9
|
+
/** The Widget's control key, as every Control states one (`parsePhiControlConfig`). */
|
|
10
|
+
key?: string | null;
|
|
9
11
|
signalRoutes?: PhiSignalRouteSet | null;
|
|
10
12
|
blockId?: PhiCmsInstanceId | null;
|
|
11
13
|
labels?: PhiCommonControlLabels | null;
|
|
12
14
|
disabled?: boolean;
|
|
15
|
+
/** The Widget's own Disabled, until `enabled/change` says otherwise -- as on the Button Widget. */
|
|
16
|
+
initialDisabled?: boolean;
|
|
17
|
+
/** The Widget's own Read only: every button shows, inert, and none of them sends. */
|
|
18
|
+
initialReadOnly?: boolean;
|
|
13
19
|
signalsEnabled?: boolean;
|
|
14
20
|
};
|
|
15
21
|
export type PhiCommandButtonsResult = {
|
|
22
|
+
/** The control key, `command` where none is stated -- what the signal controller of a Control answers. */
|
|
23
|
+
key: string;
|
|
16
24
|
items: PhiToolbarControlItem[];
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The whole Widget's answer: disabled from outside, by its own Disabled or Read only, or switched off
|
|
27
|
+
* by `enabled/change`.
|
|
28
|
+
*/
|
|
18
29
|
disabled: boolean;
|
|
19
30
|
activate: (buttonKey: string) => void;
|
|
20
31
|
};
|
|
@@ -29,4 +40,4 @@ export type PhiCommandButtonsResult = {
|
|
|
29
40
|
export declare function resolvePhiCommandButtonVariant(button: Pick<PhiCommandButtonConfig, "variant">, action: {
|
|
30
41
|
variant?: PhiButtonVariant;
|
|
31
42
|
} | null | undefined): PhiButtonVariant | undefined;
|
|
32
|
-
export declare function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, disabled, signalsEnabled, }: PhiCommandButtonsOptions): PhiCommandButtonsResult;
|
|
43
|
+
export declare function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labels, disabled, initialDisabled, initialReadOnly, signalsEnabled, }: PhiCommandButtonsOptions): PhiCommandButtonsResult;
|
|
@@ -74,7 +74,8 @@ function colorPhiCommandButtonIcon(icon, color) {
|
|
|
74
74
|
return icon;
|
|
75
75
|
return createElement("span", { style: { display: "inline-flex", color } }, icon);
|
|
76
76
|
}
|
|
77
|
-
export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, disabled, signalsEnabled = true, }) {
|
|
77
|
+
export function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labels, disabled, initialDisabled = false, initialReadOnly = false, signalsEnabled = true, }) {
|
|
78
|
+
const resolvedKey = key?.trim() || "command";
|
|
78
79
|
const signalIdentity = usePhiSignalIdentity();
|
|
79
80
|
const signalPartition = usePhiSignalRuntimePartition();
|
|
80
81
|
const emitSignal = usePhiSignalEmitter(null);
|
|
@@ -82,7 +83,12 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
|
|
|
82
83
|
const listenRoutes = useMemo(() => signalRoutes?.listens ?? [], [signalRoutes?.listens]);
|
|
83
84
|
const [commandDisabled, setCommandDisabled] = useState(null);
|
|
84
85
|
const [buttonStateByKey, setButtonStateByKey] = useState({});
|
|
85
|
-
|
|
86
|
+
/*
|
|
87
|
+
* A signal's `enabled/change` overrides the stated Disabled, as `usePhiControlSignalController` does.
|
|
88
|
+
* Read only is drawn as disabled, as on the Button Widget: a button that shows alive and does nothing
|
|
89
|
+
* when pressed cannot be told from one that has nothing wired.
|
|
90
|
+
*/
|
|
91
|
+
const resolvedDisabled = disabled === true || (commandDisabled ?? initialDisabled) || initialReadOnly;
|
|
86
92
|
const widgetReceiver = signalIdentity.sender;
|
|
87
93
|
const buttonAddresses = useMemo(() => new Map(buttons.map((button) => [button.key, resolveButtonSubcontrolAddress(blockId, button.key)])), [blockId, buttons]);
|
|
88
94
|
useEffect(() => {
|
|
@@ -126,7 +132,7 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
|
|
|
126
132
|
return null;
|
|
127
133
|
}, [buttonAddresses]);
|
|
128
134
|
function activate(buttonKey) {
|
|
129
|
-
if (!signalsEnabled) {
|
|
135
|
+
if (!signalsEnabled || initialReadOnly) {
|
|
130
136
|
return;
|
|
131
137
|
}
|
|
132
138
|
const button = buttons.find((candidate) => candidate.key === buttonKey);
|
|
@@ -306,5 +312,5 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
|
|
|
306
312
|
badge: resolveButtonBadge(button, buttonState.badge),
|
|
307
313
|
};
|
|
308
314
|
});
|
|
309
|
-
return { items, disabled: resolvedDisabled, activate };
|
|
315
|
+
return { key: resolvedKey, items, disabled: resolvedDisabled, activate };
|
|
310
316
|
}
|
|
@@ -8,6 +8,7 @@ import { formatPhiInterval, readPhiIntervalValue } from "../../label-types/inter
|
|
|
8
8
|
import { usePhiIntlLocale, usePhiIntlTimeZone } from "../../../root/phi-intl-locale";
|
|
9
9
|
import { PhiFlexControl } from "../../../controls/phi-flex-control";
|
|
10
10
|
import { PhiTagControl } from "../../../controls/phi-tag-control";
|
|
11
|
+
import { PhiTruncatedHoverText } from "../../../controls/phi-truncated-hover-text";
|
|
11
12
|
import { PhiTypographyControl } from "../../../controls/phi-typography-control";
|
|
12
13
|
import { PhiLink } from "../../../navigation/phi-link";
|
|
13
14
|
import { PhiIcon } from "../../../shell/phi-icon";
|
|
@@ -38,6 +39,29 @@ function normalizePhiRenderedText(value) {
|
|
|
38
39
|
function resolveTagColor(color) {
|
|
39
40
|
return typeof color === "object" ? color.value : color;
|
|
40
41
|
}
|
|
42
|
+
const PHI_RENDERED_TAG_STYLE = { maxWidth: "100%", minWidth: 0 };
|
|
43
|
+
const PHI_RENDERED_TAG_TEXT_STYLE = {
|
|
44
|
+
display: "inline-block",
|
|
45
|
+
maxWidth: "100%",
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
textOverflow: "ellipsis",
|
|
48
|
+
whiteSpace: "nowrap",
|
|
49
|
+
// Top, not baseline: a box that hides its overflow sits on its bottom edge and would make the row taller.
|
|
50
|
+
verticalAlign: "top",
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* One Tag of a `badge` or `tags` value, never wider than the place it stands in.
|
|
54
|
+
*
|
|
55
|
+
* A Tag does not wrap: it is one unbreakable box as wide as its word. Where the place is narrower -- a
|
|
56
|
+
* `fixed` column, a `maxWidth`, a cell with `ellipsis`, a narrow record -- the box ran past it: over the
|
|
57
|
+
* next cell, or clipped mid-letter by a cell that hides its overflow. The box now ends at the place's edge
|
|
58
|
+
* and the word ends in an ellipsis, said whole in the house tooltip when pointed at. Where nothing narrows
|
|
59
|
+
* it, as in a `content` column, the Tag is exactly as wide as before: a percentage cap adds nothing to the
|
|
60
|
+
* width a column measures.
|
|
61
|
+
*/
|
|
62
|
+
function PhiRenderedTag({ text, color, variant }) {
|
|
63
|
+
return (_jsx(PhiTagControl, { color: color, variant: variant, style: PHI_RENDERED_TAG_STYLE, children: _jsx(PhiTruncatedHoverText, { title: text, children: _jsx("span", { style: PHI_RENDERED_TAG_TEXT_STYLE, children: text }) }) }));
|
|
64
|
+
}
|
|
41
65
|
/** A component rather than a call, because the page's locale and the Site's zone are read from context. */
|
|
42
66
|
function PhiRenderedDate({ value, withTime }) {
|
|
43
67
|
const locale = usePhiIntlLocale();
|
|
@@ -119,9 +143,9 @@ export function renderPhiValueContent(value, definition, labels, presentation =
|
|
|
119
143
|
}
|
|
120
144
|
if (definition.renderer === "tags") {
|
|
121
145
|
const values = Array.isArray(value) ? value : [value];
|
|
122
|
-
return (_jsx(PhiFlexControl, { align: "center", gap: 4, wrap: true, style: { display: "inline-flex" }, children: values.map((entry, index) => {
|
|
146
|
+
return (_jsx(PhiFlexControl, { align: "center", gap: 4, wrap: true, style: { display: "inline-flex", maxWidth: "100%" }, children: values.map((entry, index) => {
|
|
123
147
|
const normalizedEntry = normalizePhiRenderedText(entry);
|
|
124
|
-
return (_jsx(
|
|
148
|
+
return (_jsx(PhiRenderedTag, { color: resolveTagColor(definition.tagColorMap?.[normalizedEntry]), variant: definition.tagVariant ?? "outlined", text: definition.valueMap?.[normalizedEntry] ?? normalizedEntry }, `${normalizedEntry}:${index}`));
|
|
125
149
|
}) }));
|
|
126
150
|
}
|
|
127
151
|
if (definition.renderer === "date" || definition.renderer === "datetime") {
|
|
@@ -134,7 +158,7 @@ export function renderPhiValueContent(value, definition, labels, presentation =
|
|
|
134
158
|
return _jsx(PhiTypographyControl, { code: true, children: displayValue });
|
|
135
159
|
}
|
|
136
160
|
if (definition.renderer === "badge") {
|
|
137
|
-
return (_jsx(
|
|
161
|
+
return (_jsx(PhiRenderedTag, { color: resolveTagColor(definition.tagColorMap?.[normalizedValue]), variant: definition.tagVariant ?? "outlined", text: displayValue }));
|
|
138
162
|
}
|
|
139
163
|
if (definition.renderer === "switch" || definition.renderer === "checkbox") {
|
|
140
164
|
return _jsx(PhiIcon, { name: value === true ? "check" : "close" });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code of a read the Provider refuses for this reader, on purpose and for a reason the reader may be
|
|
3
|
+
* told -- their own customer file, which nobody opens. A Provider throws `PhiTableProviderError` with it
|
|
4
|
+
* and the sentence; the Table draws itself with the sentence where its rows would be, live as in the
|
|
5
|
+
* Builder, and keeps its tools, so the reader can ask for something else. Any other failed read is the
|
|
6
|
+
* source's fault and ends the Table (TABLES.md, "A refused read").
|
|
7
|
+
*
|
|
8
|
+
* Nothing is imported here: the Markdown body reads the code in every Area's Public chunk.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PHI_TABLE_PROVIDER_REFUSED_CODE = "refused";
|
|
11
|
+
export declare function isPhiTableProviderRefusal(error: {
|
|
12
|
+
code: string;
|
|
13
|
+
} | null | undefined): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code of a read the Provider refuses for this reader, on purpose and for a reason the reader may be
|
|
3
|
+
* told -- their own customer file, which nobody opens. A Provider throws `PhiTableProviderError` with it
|
|
4
|
+
* and the sentence; the Table draws itself with the sentence where its rows would be, live as in the
|
|
5
|
+
* Builder, and keeps its tools, so the reader can ask for something else. Any other failed read is the
|
|
6
|
+
* source's fault and ends the Table (TABLES.md, "A refused read").
|
|
7
|
+
*
|
|
8
|
+
* Nothing is imported here: the Markdown body reads the code in every Area's Public chunk.
|
|
9
|
+
*/
|
|
10
|
+
export const PHI_TABLE_PROVIDER_REFUSED_CODE = "refused";
|
|
11
|
+
export function isPhiTableProviderRefusal(error) {
|
|
12
|
+
return error?.code === PHI_TABLE_PROVIDER_REFUSED_CODE;
|
|
13
|
+
}
|
|
@@ -24,8 +24,9 @@ export type PhiBackgroundBaseNone = {
|
|
|
24
24
|
*
|
|
25
25
|
* The box paints what the Theme workspace calls the Chrome Overlay -- its colour or picture and its glass
|
|
26
26
|
* pane -- instead of a ground of its own. It carries nothing else: the Overlay is the Theme's, per mode
|
|
27
|
-
* (`root.chrome[mode]`), and the box reads the mode it stands in. A Surface `tone` is that mode
|
|
28
|
-
* `inverse` Footer
|
|
27
|
+
* (`root.chrome[mode]`), and the box reads the mode it stands in. A Surface `tone` is that mode; an
|
|
28
|
+
* `inverse` Footer stands on the Theme's opaque Inverse Ground (`root.inverse[mode]`) with the other mode's
|
|
29
|
+
* Chrome picture over it, since that mode's Chrome colour may be glass. It is a stated
|
|
29
30
|
* ground: a tone does not paint its own container ground beneath it.
|
|
30
31
|
*/
|
|
31
32
|
export type PhiBackgroundBaseTheme = {
|
|
@@ -13,7 +13,16 @@ export type PhiChoiceControlConfig = PhiControlConfig & PhiChoiceOptionsConfig &
|
|
|
13
13
|
presentation?: "select" | "autocomplete";
|
|
14
14
|
allowCustom?: boolean;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The choice Controls that switch a stack -- Segmented, Steps, Tab Bar: options, a value and the Control's
|
|
18
|
+
* state, and none of the select's text entry. `label`, `description` and `presentation` are prepared for
|
|
19
|
+
* presentation variants of their own and drawn by none of them yet.
|
|
20
|
+
*/
|
|
21
|
+
export type PhiStackChoiceControlConfig = PhiControlConfig & PhiChoiceOptionsConfig & {
|
|
22
|
+
label?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
value?: string;
|
|
25
|
+
presentation?: "select" | "autocomplete";
|
|
17
26
|
valueMode?: PhiChoiceValueMode;
|
|
18
27
|
};
|
|
19
28
|
export declare function buildPhiChoiceControlOptionFields(editorPlacement?: "inspector" | "toolbar"): ({
|
|
@@ -63,8 +63,14 @@ export function parsePhiChoiceControlConfig(config) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
export function parsePhiStackChoiceControlConfig(config) {
|
|
66
|
+
const reader = createPhiConfigReader(config);
|
|
66
67
|
return {
|
|
67
|
-
...
|
|
68
|
-
|
|
68
|
+
...parsePhiControlConfig(config, { key: "choice" }),
|
|
69
|
+
label: reader.string("label"),
|
|
70
|
+
description: reader.string("description"),
|
|
71
|
+
value: reader.string("value"),
|
|
72
|
+
presentation: reader.oneOf("presentation", ["select", "autocomplete"]) ?? "select",
|
|
73
|
+
...parsePhiChoiceOptionsConfig(config),
|
|
74
|
+
valueMode: reader.oneOf("valueMode", ["raw", "stack-slot-index"]) ?? "raw",
|
|
69
75
|
};
|
|
70
76
|
}
|
|
@@ -40,7 +40,7 @@ const PHI_ADMIN_LOCALES_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
40
40
|
delete_selected_title: definePhiMessageLabel("Delete %1 selected translations?"),
|
|
41
41
|
delete_selected_description: definePhiMessageLabel("The selected translated variants will be deleted permanently."),
|
|
42
42
|
empty_title: definePhiMessageLabel("No translations found."),
|
|
43
|
-
empty_text: definePhiMessageLabel("No site translations exist for this language yet."),
|
|
43
|
+
empty_text: definePhiMessageLabel("No site translations exist for this language yet. New translations are entered in Editor > Translations."),
|
|
44
44
|
load_error: definePhiMessageLabel("Failed to load locale data."),
|
|
45
45
|
save_error: definePhiMessageLabel("Failed to save locale data."),
|
|
46
46
|
required_available_locales: definePhiMessageLabel("Select at least one language."),
|
|
@@ -9,9 +9,8 @@ export declare function getPhiAdminUsersTableWidgetLabels(options: PhiGlobalTran
|
|
|
9
9
|
footer: string;
|
|
10
10
|
accountTypes: {
|
|
11
11
|
all: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
auth: string;
|
|
12
|
+
staff: string;
|
|
13
|
+
customer: string;
|
|
15
14
|
};
|
|
16
15
|
addonRoles: {
|
|
17
16
|
all: string;
|
|
@@ -100,14 +99,12 @@ export declare function getPhiAdminUsersTableWidgetLabels(options: PhiGlobalTran
|
|
|
100
99
|
};
|
|
101
100
|
actions: {
|
|
102
101
|
edit: string;
|
|
103
|
-
editDisabled: string;
|
|
104
102
|
history: string;
|
|
105
103
|
delete: string;
|
|
106
104
|
};
|
|
107
105
|
confirm: {
|
|
108
106
|
deleteTitle: string;
|
|
109
107
|
deleteSelf: string;
|
|
110
|
-
deleteMedusa: string;
|
|
111
108
|
deleteShared: string;
|
|
112
109
|
deleteIrreversible: string;
|
|
113
110
|
ok: string;
|
|
@@ -12,9 +12,8 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
12
12
|
add_label: "Add user",
|
|
13
13
|
footer_count: "%1 users of %2 total",
|
|
14
14
|
account_type_all: "All",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
account_type_auth: "Auth",
|
|
15
|
+
account_type_staff: "Staff",
|
|
16
|
+
account_type_customer: "Customer",
|
|
18
17
|
enabled_all: "All",
|
|
19
18
|
enabled_enabled: "Enabled",
|
|
20
19
|
enabled_disabled: "Disabled",
|
|
@@ -84,13 +83,11 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
84
83
|
history_error_title: "Login history failed",
|
|
85
84
|
delete_confirm_title: definePhiMessageLabel("Delete user?"),
|
|
86
85
|
delete_confirm_self: definePhiMessageLabel("You cannot delete your own account here."),
|
|
87
|
-
delete_confirm_medusa: definePhiMessageLabel("Medusa-managed accounts cannot be deleted here."),
|
|
88
86
|
delete_confirm_shared: definePhiMessageLabel("This removes the user from the current site. Other site memberships stay intact."),
|
|
89
87
|
delete_confirm_irreversible: definePhiMessageLabel("Without a backup, this action cannot be undone."),
|
|
90
88
|
delete_ok_label: "Delete",
|
|
91
89
|
delete_cancel_label: "Cancel",
|
|
92
90
|
action_edit_label: "Edit user",
|
|
93
|
-
action_edit_disabled_label: definePhiMessageLabel("Medusa-managed accounts cannot be edited here."),
|
|
94
91
|
action_history_label: "Show login history",
|
|
95
92
|
action_delete_label: "Delete user",
|
|
96
93
|
feedback_load_users: definePhiMessageLabel("Failed to load users."),
|
|
@@ -114,9 +111,8 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
|
|
|
114
111
|
footer: labels.footer_count,
|
|
115
112
|
accountTypes: {
|
|
116
113
|
all: labels.account_type_all,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
auth: labels.account_type_auth,
|
|
114
|
+
staff: labels.account_type_staff,
|
|
115
|
+
customer: labels.account_type_customer,
|
|
120
116
|
},
|
|
121
117
|
addonRoles: {
|
|
122
118
|
all: labels.addon_roles_all,
|
|
@@ -210,14 +206,12 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
|
|
|
210
206
|
},
|
|
211
207
|
actions: {
|
|
212
208
|
edit: labels.action_edit_label,
|
|
213
|
-
editDisabled: labels.action_edit_disabled_label,
|
|
214
209
|
history: labels.action_history_label,
|
|
215
210
|
delete: labels.action_delete_label,
|
|
216
211
|
},
|
|
217
212
|
confirm: {
|
|
218
213
|
deleteTitle: labels.delete_confirm_title,
|
|
219
214
|
deleteSelf: labels.delete_confirm_self,
|
|
220
|
-
deleteMedusa: labels.delete_confirm_medusa,
|
|
221
215
|
deleteShared: labels.delete_confirm_shared,
|
|
222
216
|
deleteIrreversible: labels.delete_confirm_irreversible,
|
|
223
217
|
ok: labels.delete_ok_label,
|