@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
package/styles/shell.css
CHANGED
|
@@ -352,13 +352,11 @@
|
|
|
352
352
|
|
|
353
353
|
/* The Overlay in a tone's mode (LAYOUTING.md "Surface tone"), for a box whose Background is the Theme's
|
|
354
354
|
(`PHI_BACKGROUND_THEME_STYLE`). The tone's class publishes the Overlay of the mode it asks for, so the
|
|
355
|
-
box -- and an untoned box inside it -- reads that mode's variables
|
|
356
|
-
mode, as the tone scope reads it, and turns with the mode switch. Inside the Root Layout only: a Modal
|
|
355
|
+
box -- and an untoned box inside it -- reads that mode's variables. Inside the Root Layout only: a Modal
|
|
357
356
|
or Drawer portalled to `<body>` has no Overlay published, and its box falls back to the container
|
|
358
357
|
ground of the tone's mode. The Root Layout's own values above stay what the Chrome Regions and panes
|
|
359
358
|
read; those are computed on the Root Layout and inherited, so a tone below cannot touch them. */
|
|
360
|
-
:where([data-phi-root-layout="true"]) :where(.phi-tone-light)
|
|
361
|
-
:where([data-phi-root-layout="true"][data-phi-theme-mode="dark"]) :where(.phi-tone-inverse) {
|
|
359
|
+
:where([data-phi-root-layout="true"]) :where(.phi-tone-light) {
|
|
362
360
|
--phi-shell-chrome-image: var(--phi-shell-chrome-image-light, none);
|
|
363
361
|
--phi-shell-chrome-size: var(--phi-shell-chrome-size-light, auto);
|
|
364
362
|
--phi-shell-chrome-position: var(--phi-shell-chrome-position-light, 0 0);
|
|
@@ -367,8 +365,7 @@
|
|
|
367
365
|
--phi-shell-chrome-filter: var(--phi-shell-chrome-filter-light, none);
|
|
368
366
|
}
|
|
369
367
|
|
|
370
|
-
:where([data-phi-root-layout="true"]) :where(.phi-tone-dark)
|
|
371
|
-
:where([data-phi-root-layout="true"]:not([data-phi-theme-mode="dark"])) :where(.phi-tone-inverse) {
|
|
368
|
+
:where([data-phi-root-layout="true"]) :where(.phi-tone-dark) {
|
|
372
369
|
--phi-shell-chrome-image: var(--phi-shell-chrome-image-dark, none);
|
|
373
370
|
--phi-shell-chrome-size: var(--phi-shell-chrome-size-dark, auto);
|
|
374
371
|
--phi-shell-chrome-position: var(--phi-shell-chrome-position-dark, 0 0);
|
|
@@ -377,6 +374,33 @@
|
|
|
377
374
|
--phi-shell-chrome-filter: var(--phi-shell-chrome-filter-dark, none);
|
|
378
375
|
}
|
|
379
376
|
|
|
377
|
+
/* `inverse` stands on the Theme's Inverse Ground (THEME.md "Ground"), not on the other mode's Chrome
|
|
378
|
+
colour: the Chrome is the frame's and may be glass, and a glass pane over the page's own ground put
|
|
379
|
+
the inverted words on a ground of the page's mode. The other mode's picture -- read against the page's
|
|
380
|
+
mode, as the tone scope reads it, so it turns with the mode switch -- still lies over the ground; the
|
|
381
|
+
pane's filter does not, since an opaque box has nothing behind it to frost. */
|
|
382
|
+
:where([data-phi-root-layout="true"][data-phi-theme-mode="dark"]) :where(.phi-tone-inverse) {
|
|
383
|
+
--phi-shell-chrome-image: var(--phi-shell-chrome-image-light, none);
|
|
384
|
+
--phi-shell-chrome-size: var(--phi-shell-chrome-size-light, auto);
|
|
385
|
+
--phi-shell-chrome-position: var(--phi-shell-chrome-position-light, 0 0);
|
|
386
|
+
--phi-shell-chrome-repeat: var(--phi-shell-chrome-repeat-light, repeat);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
:where([data-phi-root-layout="true"]:not([data-phi-theme-mode="dark"])) :where(.phi-tone-inverse) {
|
|
390
|
+
--phi-shell-chrome-image: var(--phi-shell-chrome-image-dark, none);
|
|
391
|
+
--phi-shell-chrome-size: var(--phi-shell-chrome-size-dark, auto);
|
|
392
|
+
--phi-shell-chrome-position: var(--phi-shell-chrome-position-dark, 0 0);
|
|
393
|
+
--phi-shell-chrome-repeat: var(--phi-shell-chrome-repeat-dark, repeat);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* The ground itself holds everywhere, a portalled Overlay included: `--phi-inverse-ground` is a Theme
|
|
397
|
+
token, written under the tone's class in the other mode, so it is that mode's ground wherever the box
|
|
398
|
+
stands. */
|
|
399
|
+
:where(.phi-tone-inverse) {
|
|
400
|
+
--phi-shell-chrome-color: var(--phi-inverse-ground);
|
|
401
|
+
--phi-shell-chrome-filter: none;
|
|
402
|
+
}
|
|
403
|
+
|
|
380
404
|
/* A Chrome Region carries the marker only while it authored no ground of its own, so there is nothing
|
|
381
405
|
left to fall back through here: the shared colour is the ground. It needs no light and dark pair
|
|
382
406
|
either, because the pair above has already resolved the mode. This rule follows the two that set the
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PHI_CORE_THEME_FONTS_BLOCKS, PHI_CORE_THEME_FONTS_BLOCK_KEY, PHI_CORE_THEME_GROUND_BLOCKS, PHI_CORE_THEME_GROUND_BLOCK_KEY, PHI_CORE_THEME_PALETTE_BLOCKS, PHI_CORE_THEME_PALETTE_BLOCK_KEY, PHI_CORE_THEME_SETS, PHI_CORE_THEME_STYLE_BLOCKS, PHI_CORE_THEME_STYLE_BLOCK_KEY, resolvePhiThemeBlockSelection, resolvePhiThemeSetSelection, } from "./phi-theme-blocks";
|
|
2
2
|
import { readPhiThemeSiteSignet } from "./phi-theme-signet";
|
|
3
|
+
import { readPhiThemeInverseGround } from "./phi-theme-inverse-ground";
|
|
3
4
|
export const PHI_CORE_THEME_BLOCK_CATALOG = {
|
|
4
5
|
palettes: PHI_CORE_THEME_PALETTE_BLOCKS,
|
|
5
6
|
styles: PHI_CORE_THEME_STYLE_BLOCKS,
|
|
@@ -128,10 +129,18 @@ export function resolvePhiThemeEffectiveRoot(authored, ground) {
|
|
|
128
129
|
dark: authored?.chrome?.dark ?? base.chrome?.dark ?? null,
|
|
129
130
|
...(shadow.header || shadow.sider || shadow.footer ? { shadow } : {}),
|
|
130
131
|
};
|
|
132
|
+
// Read strictly: a stored Inverse Ground of the wrong shape is an error, not a ground quietly dropped.
|
|
133
|
+
const authoredInverse = readPhiThemeInverseGround(authored?.inverse);
|
|
134
|
+
const baseInverse = readPhiThemeInverseGround(base.inverse);
|
|
135
|
+
const inverse = {
|
|
136
|
+
light: authoredInverse?.light ?? baseInverse?.light ?? null,
|
|
137
|
+
dark: authoredInverse?.dark ?? baseInverse?.dark ?? null,
|
|
138
|
+
};
|
|
131
139
|
return {
|
|
132
140
|
...base,
|
|
133
141
|
...(authored ?? {}),
|
|
134
142
|
background,
|
|
135
143
|
chrome,
|
|
144
|
+
inverse,
|
|
136
145
|
};
|
|
137
146
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PhiSiteThemeInverseGround } from "../types/site-theme";
|
|
2
|
+
import type { PhiThemeMode } from "./phi-theme-presets";
|
|
3
|
+
/**
|
|
4
|
+
* The Inverse Ground (THEME.md "Ground"): what a Surface toned `inverse` stands on.
|
|
5
|
+
*
|
|
6
|
+
* An inverse box is drawn in the other mode than the page's (LAYOUTING.md "Surface tone"). It used to
|
|
7
|
+
* stand on that mode's Chrome Overlay where it took the Theme's ground, and the Chrome is the frame's: a
|
|
8
|
+
* glass frame -- phis.dev's is 55 % white or ink -- gave the inverted words the page's own ground beneath
|
|
9
|
+
* a thin pane, light text on a light page. So the Theme states, per mode, one opaque colour an inverse box
|
|
10
|
+
* stands on, and a mode that states none stands on that mode's container ground (`colorBgContainer`), the
|
|
11
|
+
* ground an inverse box without a Background of its own always painted.
|
|
12
|
+
*
|
|
13
|
+
* It rides as a token of this package's own (`inverseGround`), so Ant Design writes it as
|
|
14
|
+
* `--phi-inverse-ground` per mode and per Surface tone like every other token: inside an inverse box the
|
|
15
|
+
* tone's class carries the other mode's tokens, and the variable there is that mode's ground.
|
|
16
|
+
*/
|
|
17
|
+
/** What an inverse box paints as its ground, as the variable the stylesheet and every resolver read. */
|
|
18
|
+
export declare const PHI_INVERSE_GROUND = "var(--phi-inverse-ground)";
|
|
19
|
+
/**
|
|
20
|
+
* Whether a CSS colour is a stated, opaque value: a hex colour or a colour function with no alpha below
|
|
21
|
+
* one. A name, a variable or anything the server cannot read as a colour is not: an unreadable value
|
|
22
|
+
* would make the box's ground fall away in the browser, which is the very thing this ground exists to
|
|
23
|
+
* prevent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isPhiOpaqueCssColor(value: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The stored Inverse Ground, read strictly: absent is none stated; anything else must be a record of the
|
|
28
|
+
* two modes, each absent or an opaque colour. A wrong shape is an error, not a ground quietly dropped.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readPhiThemeInverseGround(value: unknown): PhiSiteThemeInverseGround | null;
|
|
31
|
+
/**
|
|
32
|
+
* The ground an inverse box in `mode` stands on: the Theme's stated colour, else the mode's own container
|
|
33
|
+
* ground. `token` is the mode's resolved Ant Design tokens, which every Theme has.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolvePhiThemeInverseGround(inverse: PhiSiteThemeInverseGround | null | undefined, mode: PhiThemeMode, token: Record<string, unknown>): string;
|
|
36
|
+
/** The token one mode writes (`--phi-inverse-ground`). */
|
|
37
|
+
export declare function buildPhiThemeInverseGroundTokens(inverse: PhiSiteThemeInverseGround | null | undefined, mode: PhiThemeMode, token: Record<string, unknown>): {
|
|
38
|
+
inverseGround: string;
|
|
39
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { isPhiRecord } from "../helpers/is-record";
|
|
2
|
+
/**
|
|
3
|
+
* The Inverse Ground (THEME.md "Ground"): what a Surface toned `inverse` stands on.
|
|
4
|
+
*
|
|
5
|
+
* An inverse box is drawn in the other mode than the page's (LAYOUTING.md "Surface tone"). It used to
|
|
6
|
+
* stand on that mode's Chrome Overlay where it took the Theme's ground, and the Chrome is the frame's: a
|
|
7
|
+
* glass frame -- phis.dev's is 55 % white or ink -- gave the inverted words the page's own ground beneath
|
|
8
|
+
* a thin pane, light text on a light page. So the Theme states, per mode, one opaque colour an inverse box
|
|
9
|
+
* stands on, and a mode that states none stands on that mode's container ground (`colorBgContainer`), the
|
|
10
|
+
* ground an inverse box without a Background of its own always painted.
|
|
11
|
+
*
|
|
12
|
+
* It rides as a token of this package's own (`inverseGround`), so Ant Design writes it as
|
|
13
|
+
* `--phi-inverse-ground` per mode and per Surface tone like every other token: inside an inverse box the
|
|
14
|
+
* tone's class carries the other mode's tokens, and the variable there is that mode's ground.
|
|
15
|
+
*/
|
|
16
|
+
/** What an inverse box paints as its ground, as the variable the stylesheet and every resolver read. */
|
|
17
|
+
export const PHI_INVERSE_GROUND = "var(--phi-inverse-ground)";
|
|
18
|
+
const PHI_THEME_INVERSE_GROUND_MODES = ["light", "dark"];
|
|
19
|
+
const PHI_CSS_HEX_COLOR = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/iu;
|
|
20
|
+
const PHI_CSS_COLOR_FUNCTION = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\(([^()]*)\)$/iu;
|
|
21
|
+
const PHI_CSS_ALPHA = /^(\d*\.?\d+)(%?)$/u;
|
|
22
|
+
function isPhiOpaqueAlpha(alpha) {
|
|
23
|
+
const match = PHI_CSS_ALPHA.exec(alpha.trim());
|
|
24
|
+
if (!match)
|
|
25
|
+
return false;
|
|
26
|
+
const value = Number.parseFloat(match[1]);
|
|
27
|
+
return match[2] === "%" ? value >= 100 : value >= 1;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Whether a CSS colour is a stated, opaque value: a hex colour or a colour function with no alpha below
|
|
31
|
+
* one. A name, a variable or anything the server cannot read as a colour is not: an unreadable value
|
|
32
|
+
* would make the box's ground fall away in the browser, which is the very thing this ground exists to
|
|
33
|
+
* prevent.
|
|
34
|
+
*/
|
|
35
|
+
export function isPhiOpaqueCssColor(value) {
|
|
36
|
+
const color = value.trim();
|
|
37
|
+
if (PHI_CSS_HEX_COLOR.test(color)) {
|
|
38
|
+
const digits = color.slice(1);
|
|
39
|
+
if (digits.length === 4)
|
|
40
|
+
return digits[3].toLowerCase() === "f";
|
|
41
|
+
if (digits.length === 8)
|
|
42
|
+
return digits.slice(6).toLowerCase() === "ff";
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
const call = PHI_CSS_COLOR_FUNCTION.exec(color);
|
|
46
|
+
if (!call)
|
|
47
|
+
return false;
|
|
48
|
+
const args = call[1];
|
|
49
|
+
const slash = args.split("/");
|
|
50
|
+
if (slash.length > 2)
|
|
51
|
+
return false;
|
|
52
|
+
if (slash.length === 2)
|
|
53
|
+
return isPhiOpaqueAlpha(slash[1]);
|
|
54
|
+
const commas = args.split(",");
|
|
55
|
+
if (commas.length === 4)
|
|
56
|
+
return isPhiOpaqueAlpha(commas[3]);
|
|
57
|
+
return commas.length === 1 || commas.length === 3;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The stored Inverse Ground, read strictly: absent is none stated; anything else must be a record of the
|
|
61
|
+
* two modes, each absent or an opaque colour. A wrong shape is an error, not a ground quietly dropped.
|
|
62
|
+
*/
|
|
63
|
+
export function readPhiThemeInverseGround(value) {
|
|
64
|
+
if (value === undefined || value === null) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
if (!isPhiRecord(value)) {
|
|
68
|
+
throw new Error(`The Inverse Ground must state its colours per mode, got ${JSON.stringify(value)}.`);
|
|
69
|
+
}
|
|
70
|
+
const unknownKeys = Object.keys(value).filter((key) => !PHI_THEME_INVERSE_GROUND_MODES.includes(key));
|
|
71
|
+
if (unknownKeys.length > 0) {
|
|
72
|
+
throw new Error(`The Inverse Ground has unknown modes: ${unknownKeys.join(", ")}.`);
|
|
73
|
+
}
|
|
74
|
+
const ground = {};
|
|
75
|
+
for (const mode of PHI_THEME_INVERSE_GROUND_MODES) {
|
|
76
|
+
const color = value[mode];
|
|
77
|
+
if (color === undefined || color === null)
|
|
78
|
+
continue;
|
|
79
|
+
if (typeof color !== "string" || !isPhiOpaqueCssColor(color)) {
|
|
80
|
+
throw new Error(`The Inverse Ground's ${mode} colour must be an opaque CSS colour, got ${JSON.stringify(color)}.`);
|
|
81
|
+
}
|
|
82
|
+
ground[mode] = color.trim();
|
|
83
|
+
}
|
|
84
|
+
return ground;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The ground an inverse box in `mode` stands on: the Theme's stated colour, else the mode's own container
|
|
88
|
+
* ground. `token` is the mode's resolved Ant Design tokens, which every Theme has.
|
|
89
|
+
*/
|
|
90
|
+
export function resolvePhiThemeInverseGround(inverse, mode, token) {
|
|
91
|
+
const stated = readPhiThemeInverseGround(inverse)?.[mode];
|
|
92
|
+
if (stated)
|
|
93
|
+
return stated;
|
|
94
|
+
const container = token.colorBgContainer;
|
|
95
|
+
if (typeof container !== "string" || !container.trim()) {
|
|
96
|
+
throw new Error(`The resolved ${mode} Theme has no colorBgContainer to stand an inverse box on.`);
|
|
97
|
+
}
|
|
98
|
+
return container;
|
|
99
|
+
}
|
|
100
|
+
/** The token one mode writes (`--phi-inverse-ground`). */
|
|
101
|
+
export function buildPhiThemeInverseGroundTokens(inverse, mode, token) {
|
|
102
|
+
return { inverseGround: resolvePhiThemeInverseGround(inverse, mode, token) };
|
|
103
|
+
}
|
|
@@ -45,8 +45,9 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
45
45
|
* palette's custom colours, laid over the same way (theme/phi-theme-palette.ts). `linkExternalMark` is
|
|
46
46
|
* the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts). The
|
|
47
47
|
* `surfaceShadow*` names are what a Surface's `soft` and `strong` steps draw (theme/phi-surface-shadow.ts).
|
|
48
|
+
* `inverseGround` is what a Surface toned `inverse` stands on (theme/phi-theme-inverse-ground.ts).
|
|
48
49
|
*/
|
|
49
|
-
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "signedInPagePaddingTopPhone", "signedInPagePaddingRightPhone", "signedInPagePaddingBottomPhone", "signedInPagePaddingLeftPhone", "signedInPagePaddingTopTablet", "signedInPagePaddingRightTablet", "signedInPagePaddingBottomTablet", "signedInPagePaddingLeftTablet", "signedInPagePaddingTopDesktop", "signedInPagePaddingRightDesktop", "signedInPagePaddingBottomDesktop", "signedInPagePaddingLeftDesktop", "layoutGap", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
50
|
+
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "signedInPagePaddingTopPhone", "signedInPagePaddingRightPhone", "signedInPagePaddingBottomPhone", "signedInPagePaddingLeftPhone", "signedInPagePaddingTopTablet", "signedInPagePaddingRightTablet", "signedInPagePaddingBottomTablet", "signedInPagePaddingLeftTablet", "signedInPagePaddingTopDesktop", "signedInPagePaddingRightDesktop", "signedInPagePaddingBottomDesktop", "signedInPagePaddingLeftDesktop", "layoutGap", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "inverseGround", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
50
51
|
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
51
52
|
export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
|
|
52
53
|
export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
|
|
@@ -177,6 +177,7 @@ export const PHI_THEME_TOKEN_KEYS = [
|
|
|
177
177
|
* palette's custom colours, laid over the same way (theme/phi-theme-palette.ts). `linkExternalMark` is
|
|
178
178
|
* the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts). The
|
|
179
179
|
* `surfaceShadow*` names are what a Surface's `soft` and `strong` steps draw (theme/phi-surface-shadow.ts).
|
|
180
|
+
* `inverseGround` is what a Surface toned `inverse` stands on (theme/phi-theme-inverse-ground.ts).
|
|
180
181
|
*/
|
|
181
182
|
export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
182
183
|
"paddingXXL",
|
|
@@ -219,6 +220,7 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
|
219
220
|
"linkExternalMark",
|
|
220
221
|
"surfaceShadowSoft",
|
|
221
222
|
"surfaceShadowStrong",
|
|
223
|
+
"inverseGround",
|
|
222
224
|
"custom1",
|
|
223
225
|
"custom2",
|
|
224
226
|
"custom3",
|
|
@@ -87,6 +87,20 @@ export type PhiCmsRoutePresetDescriptor = PhiCmsPresetIdentity & {
|
|
|
87
87
|
*/
|
|
88
88
|
landingPage?: true;
|
|
89
89
|
title: string;
|
|
90
|
+
/**
|
|
91
|
+
* The Page's description where the tree's `pageMeta` names none: what the document head and a link
|
|
92
|
+
* preview say of it, translated through the Site-scoped path as `title` is.
|
|
93
|
+
*/
|
|
94
|
+
description?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The picture a link to the Page shows, by the key of one of the package's own pictures (`phis.media`,
|
|
97
|
+
* THIRD_PARTY_MODULES.md "Pictures a Module ships"). Written into the Page's config as its `shareImage`
|
|
98
|
+
* where the tree states none; a key the Site has not imported states nothing. The Asset's alt text is
|
|
99
|
+
* what the picture says.
|
|
100
|
+
*/
|
|
101
|
+
shareImage?: {
|
|
102
|
+
asset: string;
|
|
103
|
+
};
|
|
90
104
|
/**
|
|
91
105
|
* The `PhiCmsFlags` a Page of this route starts out with.
|
|
92
106
|
*
|
package/types/cms-overlay.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PhiCmsContainerChromeConfig } from "./cms-container";
|
|
2
2
|
import { type PhiSignalRouteSet } from "./signals";
|
|
3
3
|
import { type PhiCmsMountPolicy } from "./cms-mount-policy";
|
|
4
|
-
import type {
|
|
4
|
+
import type { PhiRenderableBlockSize } from "./renderable-block";
|
|
5
5
|
import { type PhiControlSize } from "./control";
|
|
6
6
|
export declare const PHI_CMS_OVERLAY_TYPES: readonly ["modal", "drawer"];
|
|
7
7
|
export type PhiCmsOverlayType = (typeof PHI_CMS_OVERLAY_TYPES)[number];
|
|
@@ -26,9 +26,8 @@ export type PhiOverlayMaskBehaviour = PhiCmsOverlayMaskConfig & {
|
|
|
26
26
|
export type PhiOverlayPushBehaviour = boolean | {
|
|
27
27
|
distance: PhiCmsOverlaySize;
|
|
28
28
|
};
|
|
29
|
+
/** One length, a bare number in pixels: how far a pushing Drawer moves the one beneath. */
|
|
29
30
|
export type PhiCmsOverlaySize = string | number;
|
|
30
|
-
/** A Modal width per responsive mode; unset modes cascade from the nearest smaller one that is set. */
|
|
31
|
-
export type PhiCmsOverlayResponsiveSize = PhiResponsiveValue<PhiCmsOverlaySize>;
|
|
32
31
|
export declare const PHI_OVERLAY_CLOSE_SOURCES: readonly ["close-button", "mask", "escape"];
|
|
33
32
|
export type PhiOverlayCloseSource = (typeof PHI_OVERLAY_CLOSE_SOURCES)[number];
|
|
34
33
|
export type PhiOverlayCloseRequest = {
|
|
@@ -46,10 +45,18 @@ export type PhiCmsOverlayConfig = PhiOverlayChromeConfig & {
|
|
|
46
45
|
flags: number;
|
|
47
46
|
mountPolicy: PhiCmsMountPolicy;
|
|
48
47
|
mask: PhiCmsOverlayMaskConfig;
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The Overlay's geometry, stated as a block states it (`size`, `minSize`, `maxSize`, each a
|
|
50
|
+
* `{ width?, height? }` pair read by `normalizePhiRenderableBlockSize`) and drawn through
|
|
51
|
+
* `resolvePhiRenderableBlockGeometry`. One value per axis, as a Region's own geometry: the room an
|
|
52
|
+
* Overlay is offered is the viewport, and a Modal that hangs on the window says so with a `maxSize` in
|
|
53
|
+
* `vw`, not with a profile. A Modal reads both axes; a Drawer the one it opens along -- `width` at
|
|
54
|
+
* `left`/`right`, `height` at `top`/`bottom` (OVERLAYS.md, "Presentation config").
|
|
55
|
+
*/
|
|
56
|
+
size?: PhiRenderableBlockSize;
|
|
57
|
+
minSize?: PhiRenderableBlockSize;
|
|
58
|
+
maxSize?: PhiRenderableBlockSize;
|
|
51
59
|
placement: "top" | "right" | "bottom" | "left";
|
|
52
|
-
maxSize?: number;
|
|
53
60
|
/** How far a pushing Drawer (`Push`) moves the one beneath; unset leaves it the Control's distance. */
|
|
54
61
|
pushDistance?: PhiCmsOverlaySize;
|
|
55
62
|
closeMode: "immediate" | "request";
|
package/types/cms-overlay.js
CHANGED
|
@@ -2,6 +2,7 @@ import { isPhiRecord } from "../helpers/is-record";
|
|
|
2
2
|
import { readPhiSurface } from "./surface";
|
|
3
3
|
import { readPhiSignalRouteSet } from "./signals";
|
|
4
4
|
import { readPhiCmsMountPolicy, } from "./cms-mount-policy";
|
|
5
|
+
import { normalizePhiRenderableBlockSize } from "../helpers/renderable-block-normalizers";
|
|
5
6
|
import { readPhiControlSize } from "./control";
|
|
6
7
|
import { PhiCmsFlags } from "@phis/contracts/cms";
|
|
7
8
|
import { hasPhiFlag, readPhiFlags } from "../helpers/flags";
|
|
@@ -16,19 +17,6 @@ function readSize(value) {
|
|
|
16
17
|
? value.trim()
|
|
17
18
|
: undefined;
|
|
18
19
|
}
|
|
19
|
-
function readResponsiveSize(value) {
|
|
20
|
-
if (!isPhiRecord(value))
|
|
21
|
-
return undefined;
|
|
22
|
-
const record = value;
|
|
23
|
-
const size = {
|
|
24
|
-
compact: readSize(record.compact),
|
|
25
|
-
medium: readSize(record.medium),
|
|
26
|
-
wide: readSize(record.wide),
|
|
27
|
-
};
|
|
28
|
-
return size.compact === undefined && size.medium === undefined && size.wide === undefined
|
|
29
|
-
? undefined
|
|
30
|
-
: size;
|
|
31
|
-
}
|
|
32
20
|
function readMask(value) {
|
|
33
21
|
const record = isPhiRecord(value)
|
|
34
22
|
? value
|
|
@@ -78,24 +66,20 @@ export function readPhiOverlayCloseRequest(value) {
|
|
|
78
66
|
}
|
|
79
67
|
export function parsePhiCmsOverlayConfig(rawConfig, overlayType = "modal") {
|
|
80
68
|
const placement = rawConfig.placement;
|
|
81
|
-
const maxSize = typeof rawConfig.maxSize === "number" && Number.isFinite(rawConfig.maxSize)
|
|
82
|
-
? rawConfig.maxSize
|
|
83
|
-
: undefined;
|
|
84
69
|
return {
|
|
85
70
|
title: typeof rawConfig.title === "string" && rawConfig.title.trim() ? rawConfig.title.trim() : null,
|
|
86
|
-
|
|
71
|
+
// The Modal's width step; a Drawer is sized by `size` alone.
|
|
72
|
+
controlSize: overlayType === "modal" ? readPhiControlSize(rawConfig.controlSize) : undefined,
|
|
87
73
|
flags: readPhiFlags(rawConfig.flags),
|
|
88
74
|
// An Overlay is shut far more often than it is open, so the cheap end is the right default.
|
|
89
75
|
mountPolicy: readPhiCmsMountPolicy(rawConfig.mountPolicy, "remount"),
|
|
90
76
|
mask: readMask(rawConfig.mask),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
size: overlayType === "drawer" ? readSize(rawConfig.size) : undefined,
|
|
77
|
+
size: normalizePhiRenderableBlockSize(rawConfig.size),
|
|
78
|
+
minSize: normalizePhiRenderableBlockSize(rawConfig.minSize),
|
|
79
|
+
maxSize: normalizePhiRenderableBlockSize(rawConfig.maxSize),
|
|
95
80
|
placement: placement === "top" || placement === "bottom" || placement === "left" || placement === "right"
|
|
96
81
|
? placement
|
|
97
82
|
: "right",
|
|
98
|
-
maxSize,
|
|
99
83
|
pushDistance: readSize(rawConfig.pushDistance),
|
|
100
84
|
closeMode: rawConfig.closeMode === "request" ? "request" : "immediate",
|
|
101
85
|
openActionKey: typeof rawConfig.openActionKey === "string" && rawConfig.openActionKey.trim()
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -217,8 +217,9 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
217
217
|
}) | (PhiCmsConfigFieldBase & {
|
|
218
218
|
/**
|
|
219
219
|
* A picture: an Asset from the media library in a chosen rendition, or an address, with its alt
|
|
220
|
-
* text. Writes the image source keys (`sourceKind`, `assetId`, `variantKey`, `
|
|
221
|
-
*
|
|
220
|
+
* text. Writes the image source keys (`sourceKind`, `assetId`, `variantKey`, `sourceUrl`) and `alt`,
|
|
221
|
+
* not a key of its own; `key` only names the field. No `variantVersion`: the Widget draws the
|
|
222
|
+
* resolved Asset's own.
|
|
222
223
|
*/
|
|
223
224
|
type: "image";
|
|
224
225
|
}) | (PhiCmsConfigFieldBase & {
|
|
@@ -908,6 +909,17 @@ export type PhiRuntimeModuleDefinition = {
|
|
|
908
909
|
category: PhiRuntimeModuleCategory;
|
|
909
910
|
controllerMountPolicy?: PhiRuntimeModuleControllerMountPolicy;
|
|
910
911
|
dataProviders?: readonly PhiRuntimeModuleDataProviderDescriptor[];
|
|
912
|
+
/**
|
|
913
|
+
* Tables this Module offers to Markdown: `` in a paragraph of
|
|
914
|
+
* its own draws one (TABLES.md, "Tables in Markdown").
|
|
915
|
+
*
|
|
916
|
+
* Each reads a `table` Provider this Module declares in `dataProviders`; the catalog refuses a key,
|
|
917
|
+
* Provider or resource that is not the Module's, and `checkPhiEmbeddableTables` (`@phis/ui/module/page-check`)
|
|
918
|
+
* checks the columns and parameters where a Preset's Tables are checked. Markdown sets the caption and the
|
|
919
|
+
* declared `params` and nothing more; the key is the Module's (`<package>[/modules/<module>]/table-embeds/
|
|
920
|
+
* <name>`), and an Area where the Module is not active draws the caption alone.
|
|
921
|
+
*/
|
|
922
|
+
embeddableTables?: readonly import("./table-embed").PhiEmbeddableTableDescriptor[];
|
|
911
923
|
/**
|
|
912
924
|
* The Media Spaces this Module needs, and what it needs to put in them.
|
|
913
925
|
*
|
package/types/cms.d.ts
CHANGED
|
@@ -91,6 +91,16 @@ export type PhiCmsResolvedPageMetaField = {
|
|
|
91
91
|
export type PhiCmsResolvedPageMeta = {
|
|
92
92
|
title: PhiCmsResolvedPageMetaField | null;
|
|
93
93
|
description: PhiCmsResolvedPageMetaField | null;
|
|
94
|
+
/**
|
|
95
|
+
* What a link to a Page about a record shows of that record, from the fields its Provider marks
|
|
96
|
+
* (`record.share`, NEXT_INTEGRATION.md "Link previews"). Set by the render, never stored: absent on a
|
|
97
|
+
* Page about no record.
|
|
98
|
+
*/
|
|
99
|
+
preview?: {
|
|
100
|
+
title: string | null;
|
|
101
|
+
description: string | null;
|
|
102
|
+
image: import("./record-provider").PhiRecordPicture | null;
|
|
103
|
+
} | null;
|
|
94
104
|
};
|
|
95
105
|
export type PhiCmsResolvedContent = {
|
|
96
106
|
id: number;
|
|
@@ -449,10 +449,10 @@ export type PhiCommandButtonConfig = PhiControlBadgeConfig & {
|
|
|
449
449
|
variant?: PhiButtonVariant;
|
|
450
450
|
};
|
|
451
451
|
/**
|
|
452
|
-
*
|
|
453
|
-
* switched by `enabled/change`, which every renderable block receives.
|
|
452
|
+
* The Control's own Read only and Disabled hold for every button, beside each button's own; the whole
|
|
453
|
+
* toolbar is also switched by `enabled/change`, which every renderable block receives.
|
|
454
454
|
*/
|
|
455
|
-
export type PhiCommandToolbarWidgetPlacement = PhiWidgetPlacementBase &
|
|
455
|
+
export type PhiCommandToolbarWidgetPlacement = PhiWidgetPlacementBase & PhiControlPlacement & {
|
|
456
456
|
compact?: boolean;
|
|
457
457
|
wrap?: boolean;
|
|
458
458
|
showLabels?: boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The picture of a link preview: a Media Asset of the Site's own Space, by id, and what it shows.
|
|
3
|
+
*
|
|
4
|
+
* One shape wherever a preview picture is stated -- a Page's config (`page.layoutConfig.shareImage`) and
|
|
5
|
+
* the Theme's Brand (`brand.shareImage`). The id sits under `assetId`, which is how persisted config names
|
|
6
|
+
* an Asset, so phi-server indexes it and refuses to delete the picture while it is stated. `alt` falls
|
|
7
|
+
* back to the Asset's own alt text. Only a publicly delivered image is ever shown: any other answers as no
|
|
8
|
+
* picture.
|
|
9
|
+
*/
|
|
10
|
+
export type PhiShareImage = {
|
|
11
|
+
assetId: number;
|
|
12
|
+
alt?: string | null;
|
|
13
|
+
};
|
|
14
|
+
/** `value` as a share image, or `null` where it is none: a live page leaves out what it cannot read. */
|
|
15
|
+
export declare function readPhiShareImage(value: unknown): PhiShareImage | null;
|
|
16
|
+
/** The key of a Page's config the share image is stated under. */
|
|
17
|
+
export declare const PHI_PAGE_SHARE_IMAGE_CONFIG_KEY = "shareImage";
|
|
18
|
+
/** `value` where it is an X account name, `@` included (`@phisys`); anything else is no account. */
|
|
19
|
+
export declare function readPhiXAccount(value: string | null | undefined): string | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isPhiRecord } from "../helpers/is-record";
|
|
2
|
+
/** `value` as a share image, or `null` where it is none: a live page leaves out what it cannot read. */
|
|
3
|
+
export function readPhiShareImage(value) {
|
|
4
|
+
if (!isPhiRecord(value))
|
|
5
|
+
return null;
|
|
6
|
+
const { assetId, alt } = value;
|
|
7
|
+
if (typeof assetId !== "number" || !Number.isSafeInteger(assetId) || assetId <= 0)
|
|
8
|
+
return null;
|
|
9
|
+
const text = typeof alt === "string" ? alt.trim() : "";
|
|
10
|
+
return text ? { assetId, alt: text } : { assetId };
|
|
11
|
+
}
|
|
12
|
+
/** The key of a Page's config the share image is stated under. */
|
|
13
|
+
export const PHI_PAGE_SHARE_IMAGE_CONFIG_KEY = "shareImage";
|
|
14
|
+
const PHI_X_ACCOUNT_PATTERN = /^@[A-Za-z0-9_]{1,15}$/u;
|
|
15
|
+
/** `value` where it is an X account name, `@` included (`@phisys`); anything else is no account. */
|
|
16
|
+
export function readPhiXAccount(value) {
|
|
17
|
+
const trimmed = value?.trim() ?? "";
|
|
18
|
+
return PHI_X_ACCOUNT_PATTERN.test(trimmed) ? trimmed : null;
|
|
19
|
+
}
|
|
@@ -51,6 +51,15 @@ export type PhiRecordTag = {
|
|
|
51
51
|
label: string;
|
|
52
52
|
tone?: "default" | "success" | "warning" | "error";
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* A Markdown field as a record answers it: the text, the language it is written in (a locale key, `fr`,
|
|
56
|
+
* `pt-BR`), and what it is (`PhiRecordMarkdownFlag` bits, `constants/record-field-kinds.ts`).
|
|
57
|
+
*/
|
|
58
|
+
export type PhiRecordMarkdown = {
|
|
59
|
+
text: string;
|
|
60
|
+
sourceLocale: string;
|
|
61
|
+
flags: number;
|
|
62
|
+
};
|
|
54
63
|
/** Somewhere a record leads: an address, Site-relative or absolute, and the words for it. */
|
|
55
64
|
export type PhiRecordLink = {
|
|
56
65
|
href: string;
|
|
@@ -64,7 +73,7 @@ export type PhiRecordLink = {
|
|
|
64
73
|
*/
|
|
65
74
|
export type PhiRecordFieldValueByKind = {
|
|
66
75
|
text: string;
|
|
67
|
-
markdown:
|
|
76
|
+
markdown: PhiRecordMarkdown;
|
|
68
77
|
picture: PhiRecordPicture;
|
|
69
78
|
pictures: readonly PhiRecordPicture[];
|
|
70
79
|
list: readonly string[];
|
|
@@ -87,10 +96,22 @@ export type PhiRecordFieldDescriptor = {
|
|
|
87
96
|
* `viewer` is the signed-in account's own and is read for each request.
|
|
88
97
|
*/
|
|
89
98
|
export type PhiRecordAudience = "public" | "viewer";
|
|
99
|
+
/**
|
|
100
|
+
* Which declared fields a link to a Page about the record shows (NEXT_INTEGRATION.md, "Link previews"):
|
|
101
|
+
* `titleField` and `descriptionField` name `text` fields, `imageField` a `picture`. Each is optional, and
|
|
102
|
+
* a field the record lacks leaves the Page's own answer standing. The picture is shown only where it is a
|
|
103
|
+
* publicly delivered image of the Site Space (`/api/site/media/<id>/...`), as its share variant.
|
|
104
|
+
*/
|
|
105
|
+
export type PhiRecordShareDeclaration = {
|
|
106
|
+
titleField?: string;
|
|
107
|
+
descriptionField?: string;
|
|
108
|
+
imageField?: string;
|
|
109
|
+
};
|
|
90
110
|
/** What a `record` descriptor declares about its record. */
|
|
91
111
|
export type PhiRecordDeclaration = {
|
|
92
112
|
audience: PhiRecordAudience;
|
|
93
113
|
fields: readonly PhiRecordFieldDescriptor[];
|
|
114
|
+
share?: PhiRecordShareDeclaration;
|
|
94
115
|
};
|
|
95
116
|
/**
|
|
96
117
|
* From the record a resolver answered to its declared fields' values, by field key. A field the record
|
package/types/site-theme.d.ts
CHANGED
|
@@ -40,6 +40,22 @@ export type PhiSiteThemeRoot = {
|
|
|
40
40
|
footer?: PhiShadow | null;
|
|
41
41
|
} | null;
|
|
42
42
|
} | null;
|
|
43
|
+
/**
|
|
44
|
+
* The Inverse Ground (THEME.md "Ground", LAYOUTING.md "Surface tone"): what a Surface toned `inverse`
|
|
45
|
+
* stands on, one opaque colour per mode the inverse box is drawn in -- `dark` is the ground of an
|
|
46
|
+
* inverse box on a light page, `light` the one on a dark page.
|
|
47
|
+
*
|
|
48
|
+
* A ground of its own because the Chrome Overlay it read before is the frame's, and a frame may be
|
|
49
|
+
* glass: a 55 % ink pane over a light page gave light words a near-white ground. A mode that states
|
|
50
|
+
* none stands on that mode's container ground (`colorBgContainer`), derived per mode
|
|
51
|
+
* (`theme/phi-theme-inverse-ground.ts`), so a Theme that never states it is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
inverse?: PhiSiteThemeInverseGround | null;
|
|
54
|
+
};
|
|
55
|
+
/** One opaque colour per mode for the Inverse Ground. A colour with any transparency is refused. */
|
|
56
|
+
export type PhiSiteThemeInverseGround = {
|
|
57
|
+
light?: string | null;
|
|
58
|
+
dark?: string | null;
|
|
43
59
|
};
|
|
44
60
|
/**
|
|
45
61
|
* One piece of the Wordmark.
|
|
@@ -177,6 +193,17 @@ export type PhiSiteThemeBrand = {
|
|
|
177
193
|
slogan?: PhiSiteThemeBrandLine | null;
|
|
178
194
|
location?: PhiSiteThemeBrandLine | null;
|
|
179
195
|
wordmark?: PhiSiteThemeWordmark | null;
|
|
196
|
+
/**
|
|
197
|
+
* The picture a link to this Site shows where the Page says nothing of its own (NEXT_INTEGRATION.md,
|
|
198
|
+
* "Link previews"): a publicly delivered image of the Site Space, drawn as its 1200 x 630 share variant.
|
|
199
|
+
* Absent is no picture.
|
|
200
|
+
*/
|
|
201
|
+
shareImage?: import("./link-preview").PhiShareImage | null;
|
|
202
|
+
/**
|
|
203
|
+
* The Site's account on X, `@` and the name (`@phisys`), stated as `twitter:site` beside every link
|
|
204
|
+
* preview. Absent, or not an X account name, states nothing.
|
|
205
|
+
*/
|
|
206
|
+
xAccount?: string | null;
|
|
180
207
|
};
|
|
181
208
|
export type PhiWidgetFontFamilyKey = "inherit" | "system" | "body" | "mono" | "serif" | "accent" | "display";
|
|
182
209
|
export type PhiWidgetFontSizeKey = "inherit" | "xs" | "sm" | "base" | "lg" | "xl" | "xxl";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PhiViewerAccessPolicy } from "./access";
|
|
2
|
+
import type { PhiProviderResourceSource } from "./runtime-data-provider";
|
|
3
|
+
import type { PhiTableQueryValue, PhiTableSortingConfig, PhiTableWidgetPresentation } from "./table-widget";
|
|
4
|
+
/**
|
|
5
|
+
* A Table a Module offers to Markdown (TABLES.md, "Tables in Markdown").
|
|
6
|
+
*
|
|
7
|
+
* Markdown names it in a paragraph of its own -- `` -- and sets
|
|
8
|
+
* nothing but the caption and the parameters declared here. Everything else is the Module's: the Provider
|
|
9
|
+
* resource, the columns, the order, the filters that make it the table it is. It is drawn by the Table
|
|
10
|
+
* Widget's own path, read-only.
|
|
11
|
+
*
|
|
12
|
+
* Types only, so that what declares or names one carries none of the code that reads it
|
|
13
|
+
* (`helpers/table-embed.ts`; the Markdown Widget's `table-embeds.server.ts`).
|
|
14
|
+
*/
|
|
15
|
+
export type PhiEmbeddableTableDescriptor = {
|
|
16
|
+
/** `<package>[/modules/<module>]/table-embeds/<name>`, under the declaring Module's own id or package. */
|
|
17
|
+
key: PhiTableEmbedKey;
|
|
18
|
+
/** What the Table is, for an author; not drawn. The caption is what a reader sees above it. */
|
|
19
|
+
title: string;
|
|
20
|
+
/** A `table` Provider this Module declares, and one of its resources; `params` are fixed binding values. */
|
|
21
|
+
source: PhiProviderResourceSource;
|
|
22
|
+
/** The Table Widget's own presentation; its words are the Module's, translated as a Preset's. */
|
|
23
|
+
presentation: PhiTableWidgetPresentation;
|
|
24
|
+
sorting?: PhiTableSortingConfig;
|
|
25
|
+
/** Filters the Module pins, as the Table Widget's `fixedFilters`. */
|
|
26
|
+
fixedFilters?: Readonly<Record<string, PhiTableQueryValue>>;
|
|
27
|
+
/** The parameters Markdown may set, by the name it writes them under. */
|
|
28
|
+
params?: Readonly<Record<string, PhiTableEmbedParam>>;
|
|
29
|
+
/** The rows drawn at most: one page of this size, no pager. Absent, the Table pages as it does. */
|
|
30
|
+
maxRows?: number;
|
|
31
|
+
/** Who may see it, owned like a node's `accessPolicy`; the Table Widget's own policy applies as well. */
|
|
32
|
+
accessPolicy?: PhiViewerAccessPolicy;
|
|
33
|
+
};
|
|
34
|
+
export type PhiTableEmbedKey = `${string}/table-embeds/${string}`;
|
|
35
|
+
/**
|
|
36
|
+
* What one parameter sets: a binding field the resource declares (`bindingFields`), or a filter it can be
|
|
37
|
+
* asked by (`query.filterFields`), held like a `fixedFilters` entry. Nothing else is settable.
|
|
38
|
+
*/
|
|
39
|
+
export type PhiTableEmbedParam = {
|
|
40
|
+
readonly binding: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly filter: string;
|
|
43
|
+
};
|
|
44
|
+
/** An embed as Markdown wrote it: the key, and the parameters in order, as text. */
|
|
45
|
+
export type PhiTableEmbedReference = {
|
|
46
|
+
embedKey: string;
|
|
47
|
+
params: readonly (readonly [name: string, value: string])[];
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|