@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,12 @@
|
|
|
1
|
+
import { type ComponentType } from "react";
|
|
2
|
+
import type { PhiFormFieldProviderProps } from "./form-provider-registry";
|
|
3
|
+
export declare const PhiCountryFormControl: ComponentType<PhiFormFieldProviderProps>;
|
|
4
|
+
/**
|
|
5
|
+
* One address, `PhisSiteAddressInput`, as one value. Each part is held to what Core takes -- the four
|
|
6
|
+
* required parts, the column widths, a country of the list -- and while one is not, the field holds the
|
|
7
|
+
* Form's submit with the first sentence (`formContext.holdSubmit`); a part says what is wrong with it once
|
|
8
|
+
* it has been left.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PhiAddressFormControl: ComponentType<PhiFormFieldProviderProps>;
|
|
11
|
+
/** Several yes-or-no answers as one bit-flag number (`flags-field.ts`). */
|
|
12
|
+
export declare const PhiFlagsFormControl: ComponentType<PhiFormFieldProviderProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { PhiAddressControl } from "../controls/phi-address-control";
|
|
5
|
+
import { PhiCheckboxGroupControl } from "../controls/phi-checkbox-group-control";
|
|
6
|
+
import { PhiCountrySelectControl } from "../controls/phi-country-select-control";
|
|
7
|
+
import { PHI_ADDRESS_PARTS, findPhiAddressProblems, readPhiAddressFieldValue, } from "../../helpers/address-field";
|
|
8
|
+
import { readPhiFlagsFieldConfig, readPhiFlagsFieldValue, writePhiFlagsFieldValue } from "./flags-field";
|
|
9
|
+
import { readPhiFormAddressLabels } from "./structured-field-labels";
|
|
10
|
+
/*
|
|
11
|
+
* The fields whose value has a shape of its own -- a country code, an address, a bit-flag number --
|
|
12
|
+
* loaded only where one is rendered.
|
|
13
|
+
*/
|
|
14
|
+
export const PhiCountryFormControl = ({ id, field, value, onChange, placeholder, disabled, readOnly, }) => (_jsx(PhiCountrySelectControl, { id: id, value: typeof value === "string" ? value : null, placeholder: placeholder, allowClear: field.config?.allowClear === true, disabled: disabled, readOnly: readOnly, onChange: (code) => onChange?.(code ?? undefined) }));
|
|
15
|
+
function describeProblem(problem, labels) {
|
|
16
|
+
if (problem.kind === "tooLong") {
|
|
17
|
+
return labels.tooLong.replace("%1", labels[problem.part]).replace("%2", String(problem.max));
|
|
18
|
+
}
|
|
19
|
+
switch (problem.part) {
|
|
20
|
+
case "name": return labels.nameRequired;
|
|
21
|
+
case "line1": return labels.line1Required;
|
|
22
|
+
case "city": return labels.cityRequired;
|
|
23
|
+
default: return labels.countryRequired;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One address, `PhisSiteAddressInput`, as one value. Each part is held to what Core takes -- the four
|
|
28
|
+
* required parts, the column widths, a country of the list -- and while one is not, the field holds the
|
|
29
|
+
* Form's submit with the first sentence (`formContext.holdSubmit`); a part says what is wrong with it once
|
|
30
|
+
* it has been left.
|
|
31
|
+
*/
|
|
32
|
+
export const PhiAddressFormControl = ({ id, field, value, onChange, labels, disabled, readOnly, formContext, }) => {
|
|
33
|
+
const address = readPhiAddressFieldValue(value);
|
|
34
|
+
const words = useMemo(() => readPhiFormAddressLabels(labels), [labels]);
|
|
35
|
+
const problems = findPhiAddressProblems(address);
|
|
36
|
+
const [left, setLeft] = useState(() => new Set());
|
|
37
|
+
const hold = problems[0] ? describeProblem(problems[0], words) : null;
|
|
38
|
+
const holdSubmit = formContext?.holdSubmit;
|
|
39
|
+
/*
|
|
40
|
+
* A refused submit leaves every part, so each wrong part says its own sentence under itself. Written
|
|
41
|
+
* under the whole field as well, the first sentence stood a second time below the country.
|
|
42
|
+
*/
|
|
43
|
+
const showEveryPart = useCallback(() => setLeft(new Set(PHI_ADDRESS_PARTS)), [setLeft]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
holdSubmit?.(field.key, hold, showEveryPart);
|
|
46
|
+
}, [field.key, hold, holdSubmit, showEveryPart]);
|
|
47
|
+
useEffect(() => () => holdSubmit?.(field.key, null), [field.key, holdSubmit]);
|
|
48
|
+
const errors = {};
|
|
49
|
+
for (const problem of problems) {
|
|
50
|
+
if (left.has(problem.part) && !errors[problem.part])
|
|
51
|
+
errors[problem.part] = describeProblem(problem, words);
|
|
52
|
+
}
|
|
53
|
+
return (_jsx(PhiAddressControl, { id: id, value: address, labels: Object.fromEntries(PHI_ADDRESS_PARTS.map((part) => [part, words[part]])), errors: errors, disabled: disabled, readOnly: readOnly, onChange: (next) => onChange?.(next), onPartBlur: (part) => setLeft((current) => (current.has(part) ? current : new Set([...current, part]))) }));
|
|
54
|
+
};
|
|
55
|
+
/** Several yes-or-no answers as one bit-flag number (`flags-field.ts`). */
|
|
56
|
+
export const PhiFlagsFormControl = ({ field, value, onChange, options, disabled, readOnly, }) => {
|
|
57
|
+
const offered = useMemo(() => options ?? [], [options]);
|
|
58
|
+
const config = useMemo(() => readPhiFlagsFieldConfig(field.config, offered), [field.config, offered]);
|
|
59
|
+
const mask = readPhiFlagsFieldValue(value);
|
|
60
|
+
const checked = offered.filter((option) => (mask & (config.bits.get(option.value) ?? 0)) !== 0).map((option) => option.value);
|
|
61
|
+
return (_jsx(PhiCheckboxGroupControl, { vertical: true, value: checked, disabled: disabled, readOnly: readOnly, options: offered.map((option) => {
|
|
62
|
+
const needed = config.requires.get(config.bits.get(option.value) ?? 0);
|
|
63
|
+
return needed !== undefined && (mask & needed) === 0 ? { ...option, disabled: true } : option;
|
|
64
|
+
}), onChange: (next) => onChange?.(writePhiFlagsFieldValue(config, mask, next)) }));
|
|
65
|
+
};
|
|
@@ -279,7 +279,7 @@ export function PhiOverlayContainerClient({ overlayId, overlayType, config: rawC
|
|
|
279
279
|
*/
|
|
280
280
|
const surfaceStyle = { ...resolvePhiCmsContainerSurface(config).style, padding: 0 };
|
|
281
281
|
if (overlayType === "drawer") {
|
|
282
|
-
return (_jsxs(_Fragment, { children: [zoneControllers, _jsx(PhiDrawerControl, { open: open, title: runtimeTitle, header: renderZone(zones?.header), body: renderZone(zones?.body), footer: renderZone(zones?.footer), closable: behaviour.closable, keyboard: behaviour.keyboard, mask: behaviour.mask, mountPolicy: config.mountPolicy, placement: config.placement, size: config.size, maxSize: config.maxSize, resizable: behaviour.resizable, push: behaviour.push, containerStyle: surfaceStyle, onDismiss: requestClose, panelRef: panelRef })] }));
|
|
282
|
+
return (_jsxs(_Fragment, { children: [zoneControllers, _jsx(PhiDrawerControl, { open: open, title: runtimeTitle, header: renderZone(zones?.header), body: renderZone(zones?.body), footer: renderZone(zones?.footer), closable: behaviour.closable, keyboard: behaviour.keyboard, mask: behaviour.mask, mountPolicy: config.mountPolicy, placement: config.placement, size: config.size, minSize: config.minSize, maxSize: config.maxSize, resizable: behaviour.resizable, push: behaviour.push, containerStyle: surfaceStyle, onDismiss: requestClose, panelRef: panelRef })] }));
|
|
283
283
|
}
|
|
284
|
-
return (_jsxs(_Fragment, { children: [zoneControllers, _jsx(PhiModalControl, { open: open, title: runtimeTitle, header: renderZone(zones?.header), body: renderZone(zones?.body == null ? null : _jsx(PhiDialogBodyProvider, { children: zones.body })), footer: renderZone(zones?.footer), closable: behaviour.closable, keyboard: behaviour.keyboard, mask: behaviour.mask, mountPolicy: config.mountPolicy, centered: behaviour.centered, controlSize: runtimeControlSize ?? config.controlSize, size:
|
|
284
|
+
return (_jsxs(_Fragment, { children: [zoneControllers, _jsx(PhiModalControl, { open: open, title: runtimeTitle, header: renderZone(zones?.header), body: renderZone(zones?.body == null ? null : _jsx(PhiDialogBodyProvider, { children: zones.body })), footer: renderZone(zones?.footer), closable: behaviour.closable, keyboard: behaviour.keyboard, mask: behaviour.mask, mountPolicy: config.mountPolicy, centered: behaviour.centered, controlSize: runtimeControlSize ?? config.controlSize, size: config.size, minSize: config.minSize, maxSize: config.maxSize, toldSize: runtimeSize, containerStyle: surfaceStyle, onDismiss: requestClose, panelRef: panelRef })] }));
|
|
285
285
|
}
|
|
@@ -7,7 +7,7 @@ import { resolveRenderableBlockEffectsAttributes, resolveRenderableBlockEffectsS
|
|
|
7
7
|
import { resolvePhiShellRegionChrome, resolvePhiShellRegionGroundStyle, resolvePhiShellRegionTypography, resolvePhiShellRegionZIndex, resolvePhiShellSiderCollapsedWidth, resolvePhiShellSiderWidth, } from "../../helpers/shell-region-style";
|
|
8
8
|
import { PhiCmsFlags } from "../../constants/phi-cms";
|
|
9
9
|
import { resolvePhiCmsBorderSource } from "../../types/cms-border-source";
|
|
10
|
-
import {
|
|
10
|
+
import { resolvePhiSurfaceToneGround, phiSurfaceTakesToneGround, } from "../../helpers/surface-style";
|
|
11
11
|
import { resolvePhiRenderableBlockGeometry } from "../../types/renderable-block-geometry";
|
|
12
12
|
import { createPhiSignalAddress } from "../../types/signals";
|
|
13
13
|
import { readPhiCmsRegionReveal } from "../../helpers/region-page-scope";
|
|
@@ -280,7 +280,7 @@ export function resolvePhiCmsRegionShell({ regionKey, config, shellTheme, paint,
|
|
|
280
280
|
: toneGround
|
|
281
281
|
? {
|
|
282
282
|
...(surfaceBackground ? resolvePhiBackgroundWidgetStyle(surfaceBackground) : {}),
|
|
283
|
-
backgroundColor:
|
|
283
|
+
backgroundColor: resolvePhiSurfaceToneGround(surface?.tone),
|
|
284
284
|
}
|
|
285
285
|
: backgroundConfig == null || ground != null
|
|
286
286
|
? null
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PHI_TEXT_SOURCE_PRESET } from "../../../helpers/text-source";
|
|
1
|
+
import { PHI_TEXT_SOURCE_PRESET, PHI_TEXT_SOURCE_SITE } from "../../../helpers/text-source";
|
|
2
2
|
import { PHI_CMS_DEFAULT_SLOT_INDEX, PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS, } from "../../../constants/cms-layout-types";
|
|
3
3
|
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
|
|
4
4
|
import { canPhiViewerAccess, PHI_VIEWER_ACCESS_PUBLISHING } from "../../../types/access";
|
|
5
|
-
import { PhiCmsPageType } from "../../../constants/phi-cms";
|
|
5
|
+
import { PhiCmsFlags, PhiCmsPageType } from "../../../constants/phi-cms";
|
|
6
6
|
import { createPhiCmsPresetNodes } from "../../../helpers/cms-preset-nodes";
|
|
7
7
|
import { readPhiServerApiCredentials } from "../../../helpers/phis-server-credentials";
|
|
8
8
|
import { createPhiPresetCmsInstanceIdMap } from "../../../types/cms-instance-id";
|
|
@@ -90,7 +90,7 @@ function buildEntryDialogNodes(nodes, input) {
|
|
|
90
90
|
config: {
|
|
91
91
|
title: input.title,
|
|
92
92
|
// Every Form of an entry is one column (helpers/cms-dialog.ts).
|
|
93
|
-
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
93
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
94
94
|
mountPolicy: "remount",
|
|
95
95
|
/*
|
|
96
96
|
* `immediate`: there is nobody to ask. `request` exists so a Controller can refuse while a save
|
|
@@ -141,9 +141,11 @@ function buildEntryDialogNodes(nodes, input) {
|
|
|
141
141
|
typeKey: "form",
|
|
142
142
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
143
143
|
sortOrder: 10,
|
|
144
|
+
...(input.formConfigWords === "label-set" ? { flags: PhiCmsFlags.NoTranslate } : {}),
|
|
144
145
|
label: `${input.routePrefix} ${input.key} form`,
|
|
145
146
|
config: {
|
|
146
147
|
formId: input.formId,
|
|
148
|
+
...(input.formConfigWords === "site" ? { textSource: PHI_TEXT_SOURCE_SITE } : {}),
|
|
147
149
|
/*
|
|
148
150
|
* The Table's own resource, so the Form reads the row that was pressed rather than asking Core a
|
|
149
151
|
* second time, and `openActionKey` decides which action it reads for. A Form with no source has
|
|
@@ -315,6 +317,7 @@ export async function buildPhiContentEntryEditorPageTree({ page, runtime, kind,
|
|
|
315
317
|
openActionKey: "new",
|
|
316
318
|
bindsRecord: false,
|
|
317
319
|
formConfig: entryFormConfig,
|
|
320
|
+
formConfigWords: "site",
|
|
318
321
|
saveLabel: widgetLabels.form.save,
|
|
319
322
|
cancelLabel: widgetLabels.form.cancel,
|
|
320
323
|
ids: {
|
|
@@ -333,6 +336,7 @@ export async function buildPhiContentEntryEditorPageTree({ page, runtime, kind,
|
|
|
333
336
|
openActionKey: "edit",
|
|
334
337
|
bindsRecord: true,
|
|
335
338
|
formConfig: entryFormConfig,
|
|
339
|
+
formConfigWords: "site",
|
|
336
340
|
saveLabel: widgetLabels.form.save,
|
|
337
341
|
cancelLabel: widgetLabels.form.cancel,
|
|
338
342
|
ids: {
|
|
@@ -386,6 +390,8 @@ export async function buildPhiContentEntryEditorPageTree({ page, runtime, kind,
|
|
|
386
390
|
typeKey: "table",
|
|
387
391
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[1].slotIndex,
|
|
388
392
|
sortOrder: 10,
|
|
393
|
+
// The kind's Label Set, translated already.
|
|
394
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
389
395
|
label: kindLabels.widgetLabel,
|
|
390
396
|
config: {
|
|
391
397
|
source,
|
|
@@ -620,6 +626,7 @@ function buildPublisherParts({ nodes, ids, kind, routePrefix, entryShared, widge
|
|
|
620
626
|
[PHI_CONTENT_ENTRY_CURATION_NONE_CONFIG_KEYS.author]: widgetLabels.curation.authorNone,
|
|
621
627
|
[PHI_CONTENT_ENTRY_CURATION_NONE_CONFIG_KEYS.category]: widgetLabels.curation.categoryNone,
|
|
622
628
|
},
|
|
629
|
+
formConfigWords: "label-set",
|
|
623
630
|
saveLabel: widgetLabels.form.save,
|
|
624
631
|
cancelLabel: widgetLabels.form.cancel,
|
|
625
632
|
ids: {
|
|
@@ -670,6 +677,8 @@ function buildPublisherParts({ nodes, ids, kind, routePrefix, entryShared, widge
|
|
|
670
677
|
typeKey: "table",
|
|
671
678
|
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[2].slotIndex,
|
|
672
679
|
sortOrder: 20,
|
|
680
|
+
// The kind's Label Set, translated already.
|
|
681
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
673
682
|
label: labels.widgetLabel,
|
|
674
683
|
config: {
|
|
675
684
|
source: categoriesSource,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../../../types/cms";
|
|
2
2
|
import type { PhiRuntimeModuleId } from "../../../types/cms-module-descriptors";
|
|
3
|
+
import type { PhiRenderableBlockSize } from "../../../types/renderable-block";
|
|
3
4
|
import type { PhiFormWidgetPlacement, PhiWidgetPlacementSignalRoutes } from "../../../types/core-widget-placements";
|
|
4
5
|
import type { PhiFormId } from "../../../types/form-id";
|
|
5
6
|
export type PhiSettingsPageShellWidgetSection = {
|
|
@@ -117,8 +118,11 @@ export type PhiSettingsPageShellOverlay = {
|
|
|
117
118
|
*/
|
|
118
119
|
submitLabel?: string;
|
|
119
120
|
cancelLabel?: string;
|
|
120
|
-
/**
|
|
121
|
-
|
|
121
|
+
/**
|
|
122
|
+
* The Modal's `size`, for a Form that needs more or less than the Modal's own default: a block's pair,
|
|
123
|
+
* a dialog's width as `{ width: PHI_DIALOG_WIDTH_SINGLE_COLUMN }` (OVERLAYS.md, "Presentation config").
|
|
124
|
+
*/
|
|
125
|
+
size?: PhiRenderableBlockSize;
|
|
122
126
|
};
|
|
123
127
|
/**
|
|
124
128
|
* One Collapsible panel of a Settings page: the panel title becomes the Collapsible slot title, the
|
|
@@ -369,7 +369,7 @@ export function buildPhiSettingsPageShellTree({ page, ownerModuleId, presetKey,
|
|
|
369
369
|
label: overlay.title,
|
|
370
370
|
config: {
|
|
371
371
|
title: overlay.title,
|
|
372
|
-
...(overlay.
|
|
372
|
+
...(overlay.size === undefined ? {} : { size: overlay.size }),
|
|
373
373
|
/*
|
|
374
374
|
* `remount` rather than `lazy-keep`: a dialog that creates a record and one that edits a row
|
|
375
375
|
* both start from what they were given, and a body kept from the last time would open showing
|
|
@@ -8,6 +8,7 @@ import { applyPhiButtonShadowComponentTokens } from "../../theme/phi-button-shad
|
|
|
8
8
|
import { buildPhiThemeGradientTokens, readPhiThemeGradientKey } from "../../theme/phi-theme-gradients";
|
|
9
9
|
import { buildPhiThemeLinkTokens } from "../../theme/phi-link-mark";
|
|
10
10
|
import { buildPhiSurfaceShadowTokens } from "../../theme/phi-surface-shadow";
|
|
11
|
+
import { buildPhiThemeInverseGroundTokens } from "../../theme/phi-theme-inverse-ground";
|
|
11
12
|
import { buildPhiThemeCustomColorTokens } from "../../theme/phi-theme-palette";
|
|
12
13
|
import { applyPhiControlShapeComponentTokens, applyPhiSurfaceShapeComponentTokens, resolvePhiControlShape, } from "../../theme/phi-control-shape";
|
|
13
14
|
const PHI_DEFAULT_DARK_NAV_BACKGROUND = "#001529";
|
|
@@ -100,6 +101,8 @@ export function resolvePhiRootTheme({ siteTheme, mode, fonts, presets, }) {
|
|
|
100
101
|
}),
|
|
101
102
|
...buildPhiThemeLinkTokens(siteTheme?.links),
|
|
102
103
|
...buildPhiSurfaceShadowTokens(siteTheme?.shadows, mode),
|
|
104
|
+
// What an inverse box stands on in this mode: the Theme's stated colour, else this mode's container ground.
|
|
105
|
+
...buildPhiThemeInverseGroundTokens(siteTheme?.root?.inverse, mode, effectiveThemeTokens),
|
|
103
106
|
};
|
|
104
107
|
return {
|
|
105
108
|
mode,
|
|
@@ -127,15 +127,8 @@ export type PhiAntdIconPresentation = {
|
|
|
127
127
|
ariaLabel?: string;
|
|
128
128
|
twoToneColor?: string;
|
|
129
129
|
};
|
|
130
|
-
|
|
131
|
-
* The names `PhiIcon` resolves to an Ant Design icon, bare or after `antd:`.
|
|
132
|
-
*
|
|
133
|
-
* The navigation and management names (`dashboard`, `team`, `translation`, ...) used to sit in a second,
|
|
134
|
-
* separately loaded registry; with every icon its own chunk there is nothing left to keep apart.
|
|
135
|
-
*/
|
|
136
|
-
export declare const PHI_ANTD_ICON_NAMES: Readonly<Record<string, PhiAntdIconKey>>;
|
|
130
|
+
export { PHI_ANTD_ICON_NAMES } from "./phi-icon-names";
|
|
137
131
|
export declare function PhiAntdIcon({ icon, size, style, className, title, ariaLabel, twoToneColor, }: {
|
|
138
132
|
icon: PhiAntdIconKey;
|
|
139
133
|
size?: number | string;
|
|
140
134
|
} & PhiAntdIconPresentation): import("react").JSX.Element;
|
|
141
|
-
export {};
|
|
@@ -154,233 +154,7 @@ function readLazyIcon(icon) {
|
|
|
154
154
|
}
|
|
155
155
|
return Icon;
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
* The names `PhiIcon` resolves to an Ant Design icon, bare or after `antd:`.
|
|
159
|
-
*
|
|
160
|
-
* The navigation and management names (`dashboard`, `team`, `translation`, ...) used to sit in a second,
|
|
161
|
-
* separately loaded registry; with every icon its own chunk there is nothing left to keep apart.
|
|
162
|
-
*/
|
|
163
|
-
export const PHI_ANTD_ICON_NAMES = {
|
|
164
|
-
block: "BlockOutlined",
|
|
165
|
-
"block-outlined": "BlockOutlined",
|
|
166
|
-
cluster: "ClusterOutlined",
|
|
167
|
-
"cluster-outlined": "ClusterOutlined",
|
|
168
|
-
send: "SendOutlined",
|
|
169
|
-
"send-outlined": "SendOutlined",
|
|
170
|
-
home: "HomeOutlined",
|
|
171
|
-
"home-outlined": "HomeOutlined",
|
|
172
|
-
mail: "MailOutlined",
|
|
173
|
-
"mail-outlined": "MailOutlined",
|
|
174
|
-
location: "EnvironmentOutlined",
|
|
175
|
-
environment: "EnvironmentOutlined",
|
|
176
|
-
"environment-outlined": "EnvironmentOutlined",
|
|
177
|
-
global: "GlobalOutlined",
|
|
178
|
-
"global-outlined": "GlobalOutlined",
|
|
179
|
-
shopping: "ShoppingOutlined",
|
|
180
|
-
"shopping-outlined": "ShoppingOutlined",
|
|
181
|
-
"shopping-cart": "ShoppingCartOutlined",
|
|
182
|
-
"shopping-cart-outlined": "ShoppingCartOutlined",
|
|
183
|
-
star: "StarOutlined",
|
|
184
|
-
"star-outlined": "StarOutlined",
|
|
185
|
-
question: "QuestionCircleOutlined",
|
|
186
|
-
"question-circle": "QuestionCircleOutlined",
|
|
187
|
-
"question-circle-outlined": "QuestionCircleOutlined",
|
|
188
|
-
info: "InfoCircleOutlined",
|
|
189
|
-
"info-circle": "InfoCircleOutlined",
|
|
190
|
-
"info-circle-outlined": "InfoCircleOutlined",
|
|
191
|
-
logout: "LogoutOutlined",
|
|
192
|
-
"logout-outlined": "LogoutOutlined",
|
|
193
|
-
user: "UserOutlined",
|
|
194
|
-
"user-outlined": "UserOutlined",
|
|
195
|
-
google: "GoogleOutlined",
|
|
196
|
-
"google-outlined": "GoogleOutlined",
|
|
197
|
-
apple: "AppleOutlined",
|
|
198
|
-
"apple-outlined": "AppleOutlined",
|
|
199
|
-
github: "GithubOutlined",
|
|
200
|
-
"github-outlined": "GithubOutlined",
|
|
201
|
-
windows: "WindowsOutlined",
|
|
202
|
-
"windows-outlined": "WindowsOutlined",
|
|
203
|
-
apartment: "ApartmentOutlined",
|
|
204
|
-
"apartment-outlined": "ApartmentOutlined",
|
|
205
|
-
api: "ApiOutlined",
|
|
206
|
-
"api-outlined": "ApiOutlined",
|
|
207
|
-
appstore: "AppstoreOutlined",
|
|
208
|
-
"appstore-outlined": "AppstoreOutlined",
|
|
209
|
-
branches: "BranchesOutlined",
|
|
210
|
-
"branches-outlined": "BranchesOutlined",
|
|
211
|
-
check: "CheckOutlined",
|
|
212
|
-
"check-outlined": "CheckOutlined",
|
|
213
|
-
// Only the long name: a bare `clear` already means the close mark on a Button (phi-button-icons.tsx).
|
|
214
|
-
"clear-outlined": "ClearOutlined",
|
|
215
|
-
close: "CloseOutlined",
|
|
216
|
-
"close-outlined": "CloseOutlined",
|
|
217
|
-
code: "CodeOutlined",
|
|
218
|
-
"code-outlined": "CodeOutlined",
|
|
219
|
-
"column-width": "ColumnWidthOutlined",
|
|
220
|
-
"column-width-outlined": "ColumnWidthOutlined",
|
|
221
|
-
"customer-service": "CustomerServiceOutlined",
|
|
222
|
-
"customer-service-outlined": "CustomerServiceOutlined",
|
|
223
|
-
dash: "DashOutlined",
|
|
224
|
-
"dash-outlined": "DashOutlined",
|
|
225
|
-
dashboard: "DashboardOutlined",
|
|
226
|
-
"dashboard-outlined": "DashboardOutlined",
|
|
227
|
-
delete: "DeleteOutlined",
|
|
228
|
-
"delete-outlined": "DeleteOutlined",
|
|
229
|
-
edit: "EditOutlined",
|
|
230
|
-
"edit-outlined": "EditOutlined",
|
|
231
|
-
download: "DownloadOutlined",
|
|
232
|
-
"download-outlined": "DownloadOutlined",
|
|
233
|
-
experiment: "ExperimentOutlined",
|
|
234
|
-
"experiment-outlined": "ExperimentOutlined",
|
|
235
|
-
file: "FileTextOutlined",
|
|
236
|
-
"file-text": "FileTextOutlined",
|
|
237
|
-
"file-search": "FileTextOutlined",
|
|
238
|
-
"file-text-outlined": "FileTextOutlined",
|
|
239
|
-
history: "HistoryOutlined",
|
|
240
|
-
"history-outlined": "HistoryOutlined",
|
|
241
|
-
menu: "MenuOutlined",
|
|
242
|
-
"menu-outlined": "MenuOutlined",
|
|
243
|
-
message: "MessageOutlined",
|
|
244
|
-
"message-outlined": "MessageOutlined",
|
|
245
|
-
notification: "NotificationOutlined",
|
|
246
|
-
"notification-outlined": "NotificationOutlined",
|
|
247
|
-
picture: "PictureOutlined",
|
|
248
|
-
"picture-outlined": "PictureOutlined",
|
|
249
|
-
plus: "PlusOutlined",
|
|
250
|
-
"plus-outlined": "PlusOutlined",
|
|
251
|
-
profile: "ProfileOutlined",
|
|
252
|
-
"profile-outlined": "ProfileOutlined",
|
|
253
|
-
calendar: "CalendarOutlined",
|
|
254
|
-
"calendar-outlined": "CalendarOutlined",
|
|
255
|
-
form: "FormOutlined",
|
|
256
|
-
"form-outlined": "FormOutlined",
|
|
257
|
-
read: "ReadOutlined",
|
|
258
|
-
"read-outlined": "ReadOutlined",
|
|
259
|
-
"safety-certificate": "SafetyCertificateOutlined",
|
|
260
|
-
"safety-certificate-outlined": "SafetyCertificateOutlined",
|
|
261
|
-
setting: "SettingOutlined",
|
|
262
|
-
"setting-outlined": "SettingOutlined",
|
|
263
|
-
skin: "SkinOutlined",
|
|
264
|
-
"skin-outlined": "SkinOutlined",
|
|
265
|
-
table: "TableOutlined",
|
|
266
|
-
"table-outlined": "TableOutlined",
|
|
267
|
-
team: "TeamOutlined",
|
|
268
|
-
"team-outlined": "TeamOutlined",
|
|
269
|
-
translation: "TranslationOutlined",
|
|
270
|
-
"translation-outlined": "TranslationOutlined",
|
|
271
|
-
"user-add": "UserAddOutlined",
|
|
272
|
-
"user-add-outlined": "UserAddOutlined",
|
|
273
|
-
"align-center": "AlignCenterOutlined",
|
|
274
|
-
"align-center-outlined": "AlignCenterOutlined",
|
|
275
|
-
"align-left": "AlignLeftOutlined",
|
|
276
|
-
"align-left-outlined": "AlignLeftOutlined",
|
|
277
|
-
"align-right": "AlignRightOutlined",
|
|
278
|
-
"align-right-outlined": "AlignRightOutlined",
|
|
279
|
-
"arrow-down": "ArrowDownOutlined",
|
|
280
|
-
"arrow-down-outlined": "ArrowDownOutlined",
|
|
281
|
-
"arrow-up": "ArrowUpOutlined",
|
|
282
|
-
"arrow-up-outlined": "ArrowUpOutlined",
|
|
283
|
-
"audit": "AuditOutlined",
|
|
284
|
-
"audio-two-tone": "AudioTwoTone",
|
|
285
|
-
"bg-colors": "BgColorsOutlined",
|
|
286
|
-
"bg-colors-outlined": "BgColorsOutlined",
|
|
287
|
-
build: "BuildOutlined",
|
|
288
|
-
"build-outlined": "BuildOutlined",
|
|
289
|
-
idcard: "IdcardOutlined",
|
|
290
|
-
"idcard-outlined": "IdcardOutlined",
|
|
291
|
-
"font-colors": "FontColorsOutlined",
|
|
292
|
-
"font-colors-outlined": "FontColorsOutlined",
|
|
293
|
-
copy: "CopyOutlined",
|
|
294
|
-
"copy-outlined": "CopyOutlined",
|
|
295
|
-
down: "DownOutlined",
|
|
296
|
-
"down-outlined": "DownOutlined",
|
|
297
|
-
"file-image-two-tone": "FileImageTwoTone",
|
|
298
|
-
"file-pdf-two-tone": "FilePdfTwoTone",
|
|
299
|
-
"file-text-two-tone": "FileTextTwoTone",
|
|
300
|
-
"file-unknown-two-tone": "FileUnknownTwoTone",
|
|
301
|
-
"file-zip-two-tone": "FileZipTwoTone",
|
|
302
|
-
"font-size": "FontSizeOutlined",
|
|
303
|
-
"font-size-outlined": "FontSizeOutlined",
|
|
304
|
-
"format-painter": "FormatPainterOutlined",
|
|
305
|
-
"format-painter-outlined": "FormatPainterOutlined",
|
|
306
|
-
"hdd-two-tone": "HddTwoTone",
|
|
307
|
-
"highlight-two-tone": "HighlightTwoTone",
|
|
308
|
-
holder: "HolderOutlined",
|
|
309
|
-
"holder-outlined": "HolderOutlined",
|
|
310
|
-
layout: "LayoutOutlined",
|
|
311
|
-
"layout-outlined": "LayoutOutlined",
|
|
312
|
-
left: "LeftOutlined",
|
|
313
|
-
"left-outlined": "LeftOutlined",
|
|
314
|
-
"menu-fold": "MenuFoldOutlined",
|
|
315
|
-
"menu-fold-outlined": "MenuFoldOutlined",
|
|
316
|
-
"menu-unfold": "MenuUnfoldOutlined",
|
|
317
|
-
"menu-unfold-outlined": "MenuUnfoldOutlined",
|
|
318
|
-
monitor: "MonitorOutlined",
|
|
319
|
-
"monitor-outlined": "MonitorOutlined",
|
|
320
|
-
moon: "MoonOutlined",
|
|
321
|
-
"moon-outlined": "MoonOutlined",
|
|
322
|
-
"node-index": "NodeIndexOutlined",
|
|
323
|
-
"node-index-outlined": "NodeIndexOutlined",
|
|
324
|
-
"pause-circle": "PauseCircleOutlined",
|
|
325
|
-
"pause-circle-outlined": "PauseCircleOutlined",
|
|
326
|
-
"play-circle": "PlayCircleOutlined",
|
|
327
|
-
"play-circle-filled": "PlayCircleFilled",
|
|
328
|
-
"play-circle-outlined": "PlayCircleOutlined",
|
|
329
|
-
right: "RightOutlined",
|
|
330
|
-
"right-outlined": "RightOutlined",
|
|
331
|
-
"share-alt": "ShareAltOutlined",
|
|
332
|
-
"share-alt-outlined": "ShareAltOutlined",
|
|
333
|
-
sun: "SunOutlined",
|
|
334
|
-
"sun-outlined": "SunOutlined",
|
|
335
|
-
"ordered-list-outlined": "OrderedListOutlined",
|
|
336
|
-
"login": "LoginOutlined",
|
|
337
|
-
"plus-circle-outlined": "PlusCircleOutlined",
|
|
338
|
-
"unordered-list": "UnorderedListOutlined",
|
|
339
|
-
"unordered-list-outlined": "UnorderedListOutlined",
|
|
340
|
-
up: "UpOutlined",
|
|
341
|
-
"up-outlined": "UpOutlined",
|
|
342
|
-
upload: "UploadOutlined",
|
|
343
|
-
"upload-outlined": "UploadOutlined",
|
|
344
|
-
"video-camera-two-tone": "VideoCameraTwoTone",
|
|
345
|
-
warning: "WarningOutlined",
|
|
346
|
-
"warning-outlined": "WarningOutlined",
|
|
347
|
-
"cloud-download": "CloudDownloadOutlined",
|
|
348
|
-
"cloud-download-outlined": "CloudDownloadOutlined",
|
|
349
|
-
"cloud-upload": "CloudUploadOutlined",
|
|
350
|
-
"cloud-upload-outlined": "CloudUploadOutlined",
|
|
351
|
-
"eye-invisible": "EyeInvisibleOutlined",
|
|
352
|
-
"eye-invisible-outlined": "EyeInvisibleOutlined",
|
|
353
|
-
eye: "EyeOutlined",
|
|
354
|
-
"eye-outlined": "EyeOutlined",
|
|
355
|
-
"folder-add": "FolderAddOutlined",
|
|
356
|
-
"folder-add-outlined": "FolderAddOutlined",
|
|
357
|
-
folder: "FolderOutlined",
|
|
358
|
-
"folder-outlined": "FolderOutlined",
|
|
359
|
-
link: "LinkOutlined",
|
|
360
|
-
"link-outlined": "LinkOutlined",
|
|
361
|
-
lock: "LockOutlined",
|
|
362
|
-
"lock-outlined": "LockOutlined",
|
|
363
|
-
minus: "MinusOutlined",
|
|
364
|
-
"minus-outlined": "MinusOutlined",
|
|
365
|
-
inbox: "InboxOutlined",
|
|
366
|
-
"inbox-outlined": "InboxOutlined",
|
|
367
|
-
redo: "RedoOutlined",
|
|
368
|
-
"redo-outlined": "RedoOutlined",
|
|
369
|
-
reload: "ReloadOutlined",
|
|
370
|
-
"reload-outlined": "ReloadOutlined",
|
|
371
|
-
rollback: "RollbackOutlined",
|
|
372
|
-
"rollback-outlined": "RollbackOutlined",
|
|
373
|
-
save: "SaveOutlined",
|
|
374
|
-
"save-outlined": "SaveOutlined",
|
|
375
|
-
search: "SearchOutlined",
|
|
376
|
-
"search-outlined": "SearchOutlined",
|
|
377
|
-
stop: "StopOutlined",
|
|
378
|
-
"stop-outlined": "StopOutlined",
|
|
379
|
-
undo: "UndoOutlined",
|
|
380
|
-
"undo-outlined": "UndoOutlined",
|
|
381
|
-
unlock: "UnlockOutlined",
|
|
382
|
-
"unlock-outlined": "UnlockOutlined",
|
|
383
|
-
};
|
|
157
|
+
export { PHI_ANTD_ICON_NAMES } from "./phi-icon-names";
|
|
384
158
|
export function PhiAntdIcon({ icon, size = "1em", style, className, title, ariaLabel, twoToneColor, }) {
|
|
385
159
|
const sizeStyle = size === "1em" ? undefined : { fontSize: size };
|
|
386
160
|
const resolvedStyle = sizeStyle || style ? { ...sizeStyle, ...style } : undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PhiAntdIconKey } from "./phi-antd-icon";
|
|
2
|
+
/**
|
|
3
|
+
* The names `PhiIcon` resolves to an Ant Design icon, bare or after `antd:`.
|
|
4
|
+
*
|
|
5
|
+
* The navigation and management names (`dashboard`, `team`, `translation`, ...) used to sit in a second,
|
|
6
|
+
* separately loaded registry; with every icon its own chunk there is nothing left to keep apart.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PHI_ANTD_ICON_NAMES: Readonly<Record<string, PhiAntdIconKey>>;
|
|
9
|
+
export declare function isPhiBuilderIconNamespace(namespace: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether `PhiIcon` draws something for `name`: the one rule every icon name in this house follows.
|
|
12
|
+
*
|
|
13
|
+
* A name without a prefix is an Ant Design icon from `PHI_ANTD_ICON_NAMES` and means the same as
|
|
14
|
+
* `antd:<name>`. One name per icon, and the same name in a Button, a Table action, a Command Toolbar and a
|
|
15
|
+
* preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
|
|
16
|
+
* `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
|
|
17
|
+
* themselves whether the name exists, so here they count as known.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isPhiIconNameKnown(name: string): boolean;
|