@phis/ui 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cms/phi-cms-root-layout.js +2 -0
- package/components/controls/phi-mask-picker-control.d.ts +7 -1
- package/components/controls/phi-mask-picker-control.js +18 -16
- package/components/controls/phi-media-picker-control.d.ts +30 -1
- package/components/controls/phi-media-picker-control.js +15 -2
- package/components/controls/phi-media-source-item-tile-control.d.ts +22 -0
- package/components/controls/phi-media-source-item-tile-control.js +65 -0
- package/components/forms/form-field-labels.d.ts +19 -0
- package/components/forms/form-field-labels.js +78 -0
- package/components/forms/form-provider-contract.d.ts +1 -17
- package/components/forms/form-provider-contract.js +4 -18
- package/components/forms/media-asset-field-keys.d.ts +27 -0
- package/components/forms/media-asset-field-keys.js +27 -0
- package/components/forms/phi-form-widget.js +5 -1
- package/components/forms/upload-field-keys.d.ts +27 -0
- package/components/forms/upload-field-keys.js +27 -0
- package/components/forms/upload-form-control.js +11 -5
- package/components/media/asset-controller-requirement.d.ts +9 -0
- package/components/media/asset-controller-requirement.js +42 -0
- package/components/media/label-sets/media-upload.d.ts +10 -0
- package/components/media/label-sets/media-upload.js +85 -0
- package/components/media/label-sets/media.js +31 -135
- package/components/media/media-upload-labels.d.ts +43 -0
- package/components/media/media-upload-labels.js +23 -0
- package/components/media/media-upload-refusals.d.ts +12 -0
- package/components/media/media-upload-refusals.js +28 -0
- package/components/media/media-widget-labels.d.ts +33 -26
- package/components/media/media-widget-labels.js +27 -36
- package/components/media/phi-area-upload-widget.js +3 -4
- package/components/media/phi-asset-inspector-section.d.ts +2 -2
- package/components/media/phi-image-inspector-widget.d.ts +2 -5
- package/components/media/phi-media-picker-binding.d.ts +17 -0
- package/components/media/phi-media-picker-binding.js +199 -4
- package/components/media/phi-media-picker-labels.d.ts +7 -0
- package/components/media/phi-media-picker-labels.js +25 -0
- package/components/media/phi-media-sources.d.ts +69 -0
- package/components/media/phi-media-sources.js +254 -0
- package/components/media/phi-media-upload.d.ts +1 -27
- package/components/media/phi-media-upload.js +4 -48
- package/components/runtime/runtime-controller-materialization.d.ts +5 -4
- package/components/runtime/runtime-controller-materialization.js +5 -4
- package/components/runtime/runtime-module-context.d.ts +5 -1
- package/components/runtime/runtime-module-context.js +4 -1
- package/components/runtime/runtime-module-media-source-client-manifest.d.ts +17 -0
- package/components/runtime/runtime-module-media-source-client-manifest.js +53 -0
- package/components/widgets/client/shared/phi-mask-picker.js +23 -13
- package/components/widgets/client/shared/phi-widget-image-tool-button.d.ts +7 -5
- package/components/widgets/client/shared/phi-widget-image-tool-button.js +11 -7
- package/components/widgets/client/shared/phi-widget-tool-buttons.js +2 -2
- package/components/widgets/config/mask.d.ts +6 -8
- package/components/widgets/config/mask.js +14 -12
- package/components/widgets/label-sets/authoring-tools.js +55 -1
- package/components/widgets/label-sets/history.js +0 -2
- package/components/widgets/label-sets/slot-upload.js +4 -4
- package/components/widgets/label-types/authoring-tools.d.ts +10 -0
- package/components/widgets/label-types/authoring-tools.js +6 -0
- package/components/widgets/label-types/history.d.ts +1 -1
- package/components/widgets/label-types/history.js +0 -1
- package/components/widgets/label-types/mask-picker.d.ts +31 -0
- package/components/widgets/label-types/mask-picker.js +30 -0
- package/components/widgets/label-types/slot-upload.d.ts +2 -2
- package/controls.d.ts +2 -0
- package/controls.js +1 -0
- package/helpers/cms-region-keys.d.ts +1 -1
- package/module-client.d.ts +5 -1
- package/module-projection-client.js +1 -0
- package/next/areas/accounting-client.js +3 -2
- package/next/areas/admin-client.js +3 -2
- package/next/areas/app-client.js +3 -2
- package/next/areas/builder-client.js +3 -2
- package/next/areas/editor-client.js +3 -2
- package/next/areas/public-client.js +3 -2
- package/next/runtime-module-client-boundary.d.ts +3 -1
- package/next/runtime-module-client-boundary.js +3 -2
- package/package.json +7 -2
- package/plugins/runtime-modules/area-module-defaults.js +4 -3
- package/plugins/runtime-modules/asset/controller/definition.d.ts +2 -2
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/definition.d.ts +3 -2
- package/plugins/runtime-modules/asset/definition.js +11 -3
- package/plugins/runtime-modules/asset/ids.d.ts +8 -0
- package/plugins/runtime-modules/asset/ids.js +8 -0
- package/plugins/runtime-modules/asset/labels.d.ts +4 -0
- package/plugins/runtime-modules/asset/labels.js +94 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.js +32 -7
- package/plugins/runtime-modules/asset/metadata-form.js +27 -18
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +14 -11
- package/plugins/runtime-modules/asset/widgets/area-upload/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/area-upload/server.js +3 -3
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/asset-focal-rect/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.d.ts +2 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/config.js +3 -0
- package/plugins/runtime-modules/asset/widgets/image-inspector/server.js +2 -2
- package/plugins/runtime-modules/asset/widgets/media-picker/config.d.ts +1 -0
- package/plugins/runtime-modules/asset/widgets/media-picker/config.js +3 -0
- package/plugins/runtime-modules/auth/presets.d.ts +11 -0
- package/plugins/runtime-modules/auth/presets.js +17 -8
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -4
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +2 -2
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +1 -3
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +4 -5
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -8
- package/plugins/runtime-modules/builder/clients/pages-header.js +2 -0
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +4 -4
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +0 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -2
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -1
- package/plugins/runtime-modules/builder/controller/page-controller.js +8 -8
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +4 -1
- package/plugins/runtime-modules/builder/inspector-section-widget.js +5 -2
- package/plugins/runtime-modules/builder/module-authoring-catalog.server.js +3 -1
- package/plugins/runtime-modules/builder/navigation-catalog.server.js +3 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +1 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.js +8 -3
- package/plugins/runtime-modules/builder/options-providers.js +2 -2
- package/plugins/runtime-modules/builder/page-address-rule.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-address-rule.js +12 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +4 -0
- package/plugins/runtime-modules/builder/persistence.js +6 -7
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +1 -1
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -1
- package/plugins/runtime-modules/builder/region-keys.d.ts +10 -0
- package/plugins/runtime-modules/builder/region-keys.js +10 -0
- package/plugins/runtime-modules/builder/runtime-module-sandbox.server.js +8 -1
- package/plugins/runtime-modules/builder/runtime-module-selection.js +5 -5
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +24 -6
- package/plugins/runtime-modules/builder/signal-endpoints.js +2 -1
- package/plugins/runtime-modules/builder/use-offered-page-catalog.d.ts +2 -2
- package/plugins/runtime-modules/builder/use-offered-page-catalog.js +5 -3
- package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +19 -12
- package/plugins/runtime-modules/client-manifests/accounting.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/accounting.js +1 -0
- package/plugins/runtime-modules/client-manifests/admin.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/admin.js +1 -0
- package/plugins/runtime-modules/client-manifests/app.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/app.js +1 -0
- package/plugins/runtime-modules/client-manifests/builder.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/builder.js +1 -0
- package/plugins/runtime-modules/client-manifests/common.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/common.js +3 -0
- package/plugins/runtime-modules/client-manifests/editor.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/editor.js +1 -0
- package/plugins/runtime-modules/client-manifests/public.d.ts +1 -0
- package/plugins/runtime-modules/client-manifests/public.js +1 -0
- package/plugins/runtime-modules/contracts.js +61 -0
- package/plugins/runtime-modules/core/client-media-sources.d.ts +5 -0
- package/plugins/runtime-modules/core/client-media-sources.js +6 -0
- package/plugins/runtime-modules/core/messaging/forms.js +2 -15
- package/plugins/runtime-modules/core/messaging/labels.d.ts +0 -12
- package/plugins/runtime-modules/core/messaging/labels.js +0 -24
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +7 -0
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +8 -2
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
- package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/server.js +14 -2
- package/plugins/runtime-modules/core/widgets/image/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/editor.d.ts +1 -4
- package/plugins/runtime-modules/core/widgets/image/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +2 -3
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -25
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -1
- package/plugins/runtime-modules/resolver.js +27 -1
- package/plugins/runtime-modules/settings.d.ts +20 -3
- package/plugins/runtime-modules/settings.js +35 -5
- package/plugins/runtime-modules/site-module-client-manifests.d.ts +2 -0
- package/plugins/runtime-modules/site-module-client-manifests.js +2 -0
- package/plugins/runtime-modules/site-modules-client.d.ts +5 -0
- package/plugins/runtime-modules/site-modules-client.js +1 -0
- package/plugins/runtime-modules/theme/brand-theme-model.js +0 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +97 -192
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +6 -2
- package/runtime-client-manifests-accounting.d.ts +1 -1
- package/runtime-client-manifests-accounting.js +1 -1
- package/runtime-client-manifests-admin.d.ts +1 -1
- package/runtime-client-manifests-admin.js +1 -1
- package/runtime-client-manifests-app.d.ts +1 -1
- package/runtime-client-manifests-app.js +1 -1
- package/runtime-client-manifests-builder.d.ts +1 -1
- package/runtime-client-manifests-builder.js +1 -1
- package/runtime-client-manifests-editor.d.ts +1 -1
- package/runtime-client-manifests-editor.js +1 -1
- package/runtime-client-manifests-public.d.ts +2 -1
- package/runtime-client-manifests-public.js +1 -1
- package/runtime-media-source-client.d.ts +3 -0
- package/runtime-media-source-client.js +2 -0
- package/server-helpers/cms-request.js +10 -4
- package/server-helpers/search-index.js +7 -6
- package/server-helpers/site-build-id.d.ts +25 -0
- package/server-helpers/site-build-id.js +27 -0
- package/theme/phi-theme-presets.d.ts +13 -3
- package/theme/phi-theme-presets.js +20 -3
- package/theme/phi-theme-seed-derivation.d.ts +240 -0
- package/theme/phi-theme-seed-derivation.js +126 -0
- package/types/cms-plugins.d.ts +29 -0
- package/types/media-source.d.ts +48 -0
- package/types/media-source.js +1 -0
- package/types/site-config.d.ts +1 -2
- package/types/site-theme.d.ts +0 -6
- package/types.d.ts +1 -0
- package/components/media/asset-controller-routes.d.ts +0 -8
- package/components/media/asset-controller-routes.js +0 -31
- package/helpers/brand-contact.d.ts +0 -14
- package/helpers/brand-contact.js +0 -26
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
export function readPhiSiteBuildId(options = {}) {
|
|
6
|
+
const directory = options.directory ?? path.join(process.cwd(), ".next");
|
|
7
|
+
const readFile = options.readFile ?? ((filePath) => readFileSync(filePath, "utf8"));
|
|
8
|
+
const filePath = path.join(directory, "BUILD_ID");
|
|
9
|
+
try {
|
|
10
|
+
const id = readFile(filePath).trim();
|
|
11
|
+
if (id)
|
|
12
|
+
return id;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error?.code !== "ENOENT") {
|
|
16
|
+
console.error(`[phis-ui] The Site's build id could not be read from ${filePath}.`, error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return `process-${randomUUID()}`;
|
|
20
|
+
}
|
|
21
|
+
const BUILD_ID_KEY = Symbol.for("phis-ui.site-build-id");
|
|
22
|
+
/** The build id of this process, read on first use and kept (also across duplicate module instances). */
|
|
23
|
+
export function getPhiSiteBuildId() {
|
|
24
|
+
const holder = globalThis;
|
|
25
|
+
holder[BUILD_ID_KEY] ??= readPhiSiteBuildId();
|
|
26
|
+
return holder[BUILD_ID_KEY];
|
|
27
|
+
}
|
|
@@ -98,8 +98,9 @@ export declare function resolvePhiThemePresetPlugin(plugins: readonly PhiThemePr
|
|
|
98
98
|
*
|
|
99
99
|
* This is the whole authoring model for colour: the block a Site follows is the base, what the Site
|
|
100
100
|
* owns -- a palette it took over from a Module, or the seeds its author changed -- lies on top. A key
|
|
101
|
-
* the upper palette states wins; everything else shows through.
|
|
102
|
-
* a Site's
|
|
101
|
+
* the upper palette states wins; everything else shows through. The colour tokens are not resolved from
|
|
102
|
+
* this merge: there a Site's value must win across levels too (`resolvePhiThemeColorTokens`). It serves
|
|
103
|
+
* what is matched slot by slot -- custom colours, gradients -- and a palette taken over from a Module.
|
|
103
104
|
*/
|
|
104
105
|
export declare function mergePhiThemePalettes(base: PhiThemePalette | null | undefined, own: PhiThemePalette | null | undefined): PhiThemePalette;
|
|
105
106
|
/** The Ant Design token input one palette contributes in one mode: shared seeds, mode seeds, mode overrides. */
|
|
@@ -108,5 +109,14 @@ export declare function resolvePhiThemePaletteTokens(palette: PhiThemePalette |
|
|
|
108
109
|
* The token input of a Site in one mode: the palette block it follows, with the Site's own palette on
|
|
109
110
|
* top. Every colour consumer -- root layout, server snapshot, workspace preview -- resolves through this
|
|
110
111
|
* one function so the two can never disagree.
|
|
112
|
+
*
|
|
113
|
+
* The block only proposes. Each side is resolved on its own (shared seeds, mode seeds, mode overrides)
|
|
114
|
+
* and everything the Site states lies over everything the block states, whatever level either put it on:
|
|
115
|
+
* a Site's shared `colorPrimary` wins over a dark `colorPrimary` the block states for its own dark mode.
|
|
116
|
+
* And a seed the Site states takes the block's derived colours of that seed with it
|
|
117
|
+
* (`PHI_THEME_COLOR_SEED_DERIVATIONS`): a hover tone the block tuned to its own primary would not suit
|
|
118
|
+
* the Site's, so Ant Design derives it from the Site's seed. Derived colours the Site states itself stay.
|
|
111
119
|
*/
|
|
112
|
-
export declare function resolvePhiThemeColorTokens(preset: PhiThemePresetPlugin, sitePalette: PhiThemePalette | null | undefined, mode: PhiThemeMode):
|
|
120
|
+
export declare function resolvePhiThemeColorTokens(preset: PhiThemePresetPlugin, sitePalette: PhiThemePalette | null | undefined, mode: PhiThemeMode): {
|
|
121
|
+
[x: string]: string;
|
|
122
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PHI_THEME_COLOR_SEED_DERIVATIONS } from "./phi-theme-seed-derivation";
|
|
1
2
|
import { assertPhiThemeVocabulary } from "./phi-theme-tokens";
|
|
2
3
|
/**
|
|
3
4
|
* The seeds that belong to a mode rather than to the palette as a whole.
|
|
@@ -117,8 +118,9 @@ function mergePhiThemePaletteModes(base, own) {
|
|
|
117
118
|
*
|
|
118
119
|
* This is the whole authoring model for colour: the block a Site follows is the base, what the Site
|
|
119
120
|
* owns -- a palette it took over from a Module, or the seeds its author changed -- lies on top. A key
|
|
120
|
-
* the upper palette states wins; everything else shows through.
|
|
121
|
-
* a Site's
|
|
121
|
+
* the upper palette states wins; everything else shows through. The colour tokens are not resolved from
|
|
122
|
+
* this merge: there a Site's value must win across levels too (`resolvePhiThemeColorTokens`). It serves
|
|
123
|
+
* what is matched slot by slot -- custom colours, gradients -- and a palette taken over from a Module.
|
|
122
124
|
*/
|
|
123
125
|
export function mergePhiThemePalettes(base, own) {
|
|
124
126
|
const modes = {};
|
|
@@ -145,6 +147,13 @@ export function resolvePhiThemePaletteTokens(palette, mode) {
|
|
|
145
147
|
* The token input of a Site in one mode: the palette block it follows, with the Site's own palette on
|
|
146
148
|
* top. Every colour consumer -- root layout, server snapshot, workspace preview -- resolves through this
|
|
147
149
|
* one function so the two can never disagree.
|
|
150
|
+
*
|
|
151
|
+
* The block only proposes. Each side is resolved on its own (shared seeds, mode seeds, mode overrides)
|
|
152
|
+
* and everything the Site states lies over everything the block states, whatever level either put it on:
|
|
153
|
+
* a Site's shared `colorPrimary` wins over a dark `colorPrimary` the block states for its own dark mode.
|
|
154
|
+
* And a seed the Site states takes the block's derived colours of that seed with it
|
|
155
|
+
* (`PHI_THEME_COLOR_SEED_DERIVATIONS`): a hover tone the block tuned to its own primary would not suit
|
|
156
|
+
* the Site's, so Ant Design derives it from the Site's seed. Derived colours the Site states itself stay.
|
|
148
157
|
*/
|
|
149
158
|
export function resolvePhiThemeColorTokens(preset, sitePalette, mode) {
|
|
150
159
|
/*
|
|
@@ -162,5 +171,13 @@ export function resolvePhiThemeColorTokens(preset, sitePalette, mode) {
|
|
|
162
171
|
modeSeedKeys: PHI_THEME_PALETTE_MODE_SEED_KEYS,
|
|
163
172
|
source: "The Site's own Theme",
|
|
164
173
|
});
|
|
165
|
-
|
|
174
|
+
const blockTokens = resolvePhiThemePaletteTokens(preset.palette, mode);
|
|
175
|
+
const siteTokens = resolvePhiThemePaletteTokens(sitePalette, mode);
|
|
176
|
+
for (const seed of PHI_THEME_COLOR_SEED_DERIVATIONS) {
|
|
177
|
+
if (!Object.prototype.hasOwnProperty.call(siteTokens, seed.key))
|
|
178
|
+
continue;
|
|
179
|
+
for (const item of seed.derived)
|
|
180
|
+
delete blockTokens[item.key];
|
|
181
|
+
}
|
|
182
|
+
return { ...blockTokens, ...siteTokens };
|
|
166
183
|
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
export declare const PHI_THEME_COLOR_SEED_DERIVATIONS: readonly [{
|
|
2
|
+
readonly key: "colorPrimary";
|
|
3
|
+
readonly derived: readonly [{
|
|
4
|
+
readonly key: "colorPrimaryBg";
|
|
5
|
+
readonly label: "Bg";
|
|
6
|
+
}, {
|
|
7
|
+
readonly key: "colorPrimaryBgHover";
|
|
8
|
+
readonly label: "Bg Hover";
|
|
9
|
+
}, {
|
|
10
|
+
readonly key: "colorPrimaryBorder";
|
|
11
|
+
readonly label: "Border";
|
|
12
|
+
}, {
|
|
13
|
+
readonly key: "colorPrimaryBorderHover";
|
|
14
|
+
readonly label: "Border Hover";
|
|
15
|
+
}, {
|
|
16
|
+
readonly key: "colorPrimaryHover";
|
|
17
|
+
readonly label: "Hover";
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: "colorPrimaryActive";
|
|
20
|
+
readonly label: "Active";
|
|
21
|
+
}, {
|
|
22
|
+
readonly key: "colorPrimaryText";
|
|
23
|
+
readonly label: "Text";
|
|
24
|
+
}, {
|
|
25
|
+
readonly key: "colorPrimaryTextHover";
|
|
26
|
+
readonly label: "Text Hover";
|
|
27
|
+
}, {
|
|
28
|
+
readonly key: "colorPrimaryTextActive";
|
|
29
|
+
readonly label: "Text Active";
|
|
30
|
+
}];
|
|
31
|
+
}, {
|
|
32
|
+
readonly key: "colorInfo";
|
|
33
|
+
readonly derived: readonly [{
|
|
34
|
+
readonly key: "colorInfoBg";
|
|
35
|
+
readonly label: "Bg";
|
|
36
|
+
}, {
|
|
37
|
+
readonly key: "colorInfoBgHover";
|
|
38
|
+
readonly label: "Bg Hover";
|
|
39
|
+
}, {
|
|
40
|
+
readonly key: "colorInfoBorder";
|
|
41
|
+
readonly label: "Border";
|
|
42
|
+
}, {
|
|
43
|
+
readonly key: "colorInfoBorderHover";
|
|
44
|
+
readonly label: "Border Hover";
|
|
45
|
+
}, {
|
|
46
|
+
readonly key: "colorInfoHover";
|
|
47
|
+
readonly label: "Hover";
|
|
48
|
+
}, {
|
|
49
|
+
readonly key: "colorInfoActive";
|
|
50
|
+
readonly label: "Active";
|
|
51
|
+
}, {
|
|
52
|
+
readonly key: "colorInfoText";
|
|
53
|
+
readonly label: "Text";
|
|
54
|
+
}, {
|
|
55
|
+
readonly key: "colorInfoTextHover";
|
|
56
|
+
readonly label: "Text Hover";
|
|
57
|
+
}, {
|
|
58
|
+
readonly key: "colorInfoTextActive";
|
|
59
|
+
readonly label: "Text Active";
|
|
60
|
+
}];
|
|
61
|
+
}, {
|
|
62
|
+
readonly key: "colorSuccess";
|
|
63
|
+
readonly derived: readonly [{
|
|
64
|
+
readonly key: "colorSuccessBg";
|
|
65
|
+
readonly label: "Bg";
|
|
66
|
+
}, {
|
|
67
|
+
readonly key: "colorSuccessBgHover";
|
|
68
|
+
readonly label: "Bg Hover";
|
|
69
|
+
}, {
|
|
70
|
+
readonly key: "colorSuccessBorder";
|
|
71
|
+
readonly label: "Border";
|
|
72
|
+
}, {
|
|
73
|
+
readonly key: "colorSuccessBorderHover";
|
|
74
|
+
readonly label: "Border Hover";
|
|
75
|
+
}, {
|
|
76
|
+
readonly key: "colorSuccessHover";
|
|
77
|
+
readonly label: "Hover";
|
|
78
|
+
}, {
|
|
79
|
+
readonly key: "colorSuccessActive";
|
|
80
|
+
readonly label: "Active";
|
|
81
|
+
}, {
|
|
82
|
+
readonly key: "colorSuccessText";
|
|
83
|
+
readonly label: "Text";
|
|
84
|
+
}, {
|
|
85
|
+
readonly key: "colorSuccessTextHover";
|
|
86
|
+
readonly label: "Text Hover";
|
|
87
|
+
}, {
|
|
88
|
+
readonly key: "colorSuccessTextActive";
|
|
89
|
+
readonly label: "Text Active";
|
|
90
|
+
}];
|
|
91
|
+
}, {
|
|
92
|
+
readonly key: "colorWarning";
|
|
93
|
+
readonly derived: readonly [{
|
|
94
|
+
readonly key: "colorWarningBg";
|
|
95
|
+
readonly label: "Bg";
|
|
96
|
+
}, {
|
|
97
|
+
readonly key: "colorWarningBgHover";
|
|
98
|
+
readonly label: "Bg Hover";
|
|
99
|
+
}, {
|
|
100
|
+
readonly key: "colorWarningBorder";
|
|
101
|
+
readonly label: "Border";
|
|
102
|
+
}, {
|
|
103
|
+
readonly key: "colorWarningBorderHover";
|
|
104
|
+
readonly label: "Border Hover";
|
|
105
|
+
}, {
|
|
106
|
+
readonly key: "colorWarningHover";
|
|
107
|
+
readonly label: "Hover";
|
|
108
|
+
}, {
|
|
109
|
+
readonly key: "colorWarningActive";
|
|
110
|
+
readonly label: "Active";
|
|
111
|
+
}, {
|
|
112
|
+
readonly key: "colorWarningText";
|
|
113
|
+
readonly label: "Text";
|
|
114
|
+
}, {
|
|
115
|
+
readonly key: "colorWarningTextHover";
|
|
116
|
+
readonly label: "Text Hover";
|
|
117
|
+
}, {
|
|
118
|
+
readonly key: "colorWarningTextActive";
|
|
119
|
+
readonly label: "Text Active";
|
|
120
|
+
}];
|
|
121
|
+
}, {
|
|
122
|
+
readonly key: "colorError";
|
|
123
|
+
readonly derived: readonly [{
|
|
124
|
+
readonly key: "colorErrorBg";
|
|
125
|
+
readonly label: "Bg";
|
|
126
|
+
}, {
|
|
127
|
+
readonly key: "colorErrorBgHover";
|
|
128
|
+
readonly label: "Bg Hover";
|
|
129
|
+
}, {
|
|
130
|
+
readonly key: "colorErrorBgFilledHover";
|
|
131
|
+
readonly label: "Bg Filled Hover";
|
|
132
|
+
}, {
|
|
133
|
+
readonly key: "colorErrorBgActive";
|
|
134
|
+
readonly label: "Bg Active";
|
|
135
|
+
}, {
|
|
136
|
+
readonly key: "colorErrorBorder";
|
|
137
|
+
readonly label: "Border";
|
|
138
|
+
}, {
|
|
139
|
+
readonly key: "colorErrorBorderHover";
|
|
140
|
+
readonly label: "Border Hover";
|
|
141
|
+
}, {
|
|
142
|
+
readonly key: "colorErrorHover";
|
|
143
|
+
readonly label: "Hover";
|
|
144
|
+
}, {
|
|
145
|
+
readonly key: "colorErrorActive";
|
|
146
|
+
readonly label: "Active";
|
|
147
|
+
}, {
|
|
148
|
+
readonly key: "colorErrorText";
|
|
149
|
+
readonly label: "Text";
|
|
150
|
+
}, {
|
|
151
|
+
readonly key: "colorErrorTextHover";
|
|
152
|
+
readonly label: "Text Hover";
|
|
153
|
+
}, {
|
|
154
|
+
readonly key: "colorErrorTextActive";
|
|
155
|
+
readonly label: "Text Active";
|
|
156
|
+
}];
|
|
157
|
+
}, {
|
|
158
|
+
readonly key: "colorLink";
|
|
159
|
+
readonly derived: readonly [{
|
|
160
|
+
readonly key: "colorLinkHover";
|
|
161
|
+
readonly label: "Hover";
|
|
162
|
+
}, {
|
|
163
|
+
readonly key: "colorLinkActive";
|
|
164
|
+
readonly label: "Active";
|
|
165
|
+
}];
|
|
166
|
+
}, {
|
|
167
|
+
readonly key: "colorTextBase";
|
|
168
|
+
readonly derived: readonly [{
|
|
169
|
+
readonly key: "colorText";
|
|
170
|
+
readonly label: "Text";
|
|
171
|
+
}, {
|
|
172
|
+
readonly key: "colorTextSecondary";
|
|
173
|
+
readonly label: "Secondary";
|
|
174
|
+
}, {
|
|
175
|
+
readonly key: "colorTextTertiary";
|
|
176
|
+
readonly label: "Tertiary";
|
|
177
|
+
}, {
|
|
178
|
+
readonly key: "colorTextQuaternary";
|
|
179
|
+
readonly label: "Quaternary";
|
|
180
|
+
}, {
|
|
181
|
+
readonly key: "colorTextHeading";
|
|
182
|
+
readonly label: "Heading";
|
|
183
|
+
}, {
|
|
184
|
+
readonly key: "colorTextLabel";
|
|
185
|
+
readonly label: "Label";
|
|
186
|
+
}, {
|
|
187
|
+
readonly key: "colorTextDescription";
|
|
188
|
+
readonly label: "Description";
|
|
189
|
+
}, {
|
|
190
|
+
readonly key: "colorTextDisabled";
|
|
191
|
+
readonly label: "Disabled";
|
|
192
|
+
}, {
|
|
193
|
+
readonly key: "colorTextPlaceholder";
|
|
194
|
+
readonly label: "Placeholder";
|
|
195
|
+
}, {
|
|
196
|
+
readonly key: "colorTextLightSolid";
|
|
197
|
+
readonly label: "Light Solid";
|
|
198
|
+
}];
|
|
199
|
+
}, {
|
|
200
|
+
readonly key: "colorBgBase";
|
|
201
|
+
readonly derived: readonly [{
|
|
202
|
+
readonly key: "colorBgLayout";
|
|
203
|
+
readonly label: "Layout";
|
|
204
|
+
}, {
|
|
205
|
+
readonly key: "colorBgContainer";
|
|
206
|
+
readonly label: "Container";
|
|
207
|
+
}, {
|
|
208
|
+
readonly key: "colorBgElevated";
|
|
209
|
+
readonly label: "Elevated";
|
|
210
|
+
}, {
|
|
211
|
+
readonly key: "colorBgSpotlight";
|
|
212
|
+
readonly label: "Spotlight";
|
|
213
|
+
}, {
|
|
214
|
+
readonly key: "colorBgContainerDisabled";
|
|
215
|
+
readonly label: "Container Disabled";
|
|
216
|
+
}, {
|
|
217
|
+
readonly key: "colorFill";
|
|
218
|
+
readonly label: "Fill";
|
|
219
|
+
}, {
|
|
220
|
+
readonly key: "colorFillSecondary";
|
|
221
|
+
readonly label: "Fill Secondary";
|
|
222
|
+
}, {
|
|
223
|
+
readonly key: "colorFillTertiary";
|
|
224
|
+
readonly label: "Fill Tertiary";
|
|
225
|
+
}, {
|
|
226
|
+
readonly key: "colorFillQuaternary";
|
|
227
|
+
readonly label: "Fill Quaternary";
|
|
228
|
+
}, {
|
|
229
|
+
readonly key: "colorBorder";
|
|
230
|
+
readonly label: "Border";
|
|
231
|
+
}, {
|
|
232
|
+
readonly key: "colorBorderSecondary";
|
|
233
|
+
readonly label: "Border Secondary";
|
|
234
|
+
}, {
|
|
235
|
+
readonly key: "colorBorderDisabled";
|
|
236
|
+
readonly label: "Border Disabled";
|
|
237
|
+
}];
|
|
238
|
+
}];
|
|
239
|
+
/** Every derived token of the table, whichever seed it belongs to. */
|
|
240
|
+
export declare const PHI_THEME_COLOR_DERIVED_TOKEN_KEYS: ReadonlySet<string>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Which colour tokens Ant Design derives from which seed, as far as an author edits them: the seed the
|
|
3
|
+
* Brand tab shows as a section, and the derived tokens it shows below it.
|
|
4
|
+
*
|
|
5
|
+
* The palette resolver reads it to decide what a seed the Site states takes over: a Theme's palette
|
|
6
|
+
* block may state a derived colour outright (a hover tone, a container background) because it suits the
|
|
7
|
+
* block's own seed. Once the Site states that seed, the block's derived colours of it no longer apply and
|
|
8
|
+
* Ant Design derives them from the Site's seed instead (`resolvePhiThemeColorTokens`). The Brand tab
|
|
9
|
+
* builds its sections from the same table, so what it offers below a seed is exactly what that seed
|
|
10
|
+
* takes over.
|
|
11
|
+
*/
|
|
12
|
+
export const PHI_THEME_COLOR_SEED_DERIVATIONS = [
|
|
13
|
+
{
|
|
14
|
+
key: "colorPrimary",
|
|
15
|
+
derived: [
|
|
16
|
+
{ key: "colorPrimaryBg", label: "Bg" },
|
|
17
|
+
{ key: "colorPrimaryBgHover", label: "Bg Hover" },
|
|
18
|
+
{ key: "colorPrimaryBorder", label: "Border" },
|
|
19
|
+
{ key: "colorPrimaryBorderHover", label: "Border Hover" },
|
|
20
|
+
{ key: "colorPrimaryHover", label: "Hover" },
|
|
21
|
+
{ key: "colorPrimaryActive", label: "Active" },
|
|
22
|
+
{ key: "colorPrimaryText", label: "Text" },
|
|
23
|
+
{ key: "colorPrimaryTextHover", label: "Text Hover" },
|
|
24
|
+
{ key: "colorPrimaryTextActive", label: "Text Active" },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "colorInfo",
|
|
29
|
+
derived: [
|
|
30
|
+
{ key: "colorInfoBg", label: "Bg" },
|
|
31
|
+
{ key: "colorInfoBgHover", label: "Bg Hover" },
|
|
32
|
+
{ key: "colorInfoBorder", label: "Border" },
|
|
33
|
+
{ key: "colorInfoBorderHover", label: "Border Hover" },
|
|
34
|
+
{ key: "colorInfoHover", label: "Hover" },
|
|
35
|
+
{ key: "colorInfoActive", label: "Active" },
|
|
36
|
+
{ key: "colorInfoText", label: "Text" },
|
|
37
|
+
{ key: "colorInfoTextHover", label: "Text Hover" },
|
|
38
|
+
{ key: "colorInfoTextActive", label: "Text Active" },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "colorSuccess",
|
|
43
|
+
derived: [
|
|
44
|
+
{ key: "colorSuccessBg", label: "Bg" },
|
|
45
|
+
{ key: "colorSuccessBgHover", label: "Bg Hover" },
|
|
46
|
+
{ key: "colorSuccessBorder", label: "Border" },
|
|
47
|
+
{ key: "colorSuccessBorderHover", label: "Border Hover" },
|
|
48
|
+
{ key: "colorSuccessHover", label: "Hover" },
|
|
49
|
+
{ key: "colorSuccessActive", label: "Active" },
|
|
50
|
+
{ key: "colorSuccessText", label: "Text" },
|
|
51
|
+
{ key: "colorSuccessTextHover", label: "Text Hover" },
|
|
52
|
+
{ key: "colorSuccessTextActive", label: "Text Active" },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "colorWarning",
|
|
57
|
+
derived: [
|
|
58
|
+
{ key: "colorWarningBg", label: "Bg" },
|
|
59
|
+
{ key: "colorWarningBgHover", label: "Bg Hover" },
|
|
60
|
+
{ key: "colorWarningBorder", label: "Border" },
|
|
61
|
+
{ key: "colorWarningBorderHover", label: "Border Hover" },
|
|
62
|
+
{ key: "colorWarningHover", label: "Hover" },
|
|
63
|
+
{ key: "colorWarningActive", label: "Active" },
|
|
64
|
+
{ key: "colorWarningText", label: "Text" },
|
|
65
|
+
{ key: "colorWarningTextHover", label: "Text Hover" },
|
|
66
|
+
{ key: "colorWarningTextActive", label: "Text Active" },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "colorError",
|
|
71
|
+
derived: [
|
|
72
|
+
{ key: "colorErrorBg", label: "Bg" },
|
|
73
|
+
{ key: "colorErrorBgHover", label: "Bg Hover" },
|
|
74
|
+
{ key: "colorErrorBgFilledHover", label: "Bg Filled Hover" },
|
|
75
|
+
{ key: "colorErrorBgActive", label: "Bg Active" },
|
|
76
|
+
{ key: "colorErrorBorder", label: "Border" },
|
|
77
|
+
{ key: "colorErrorBorderHover", label: "Border Hover" },
|
|
78
|
+
{ key: "colorErrorHover", label: "Hover" },
|
|
79
|
+
{ key: "colorErrorActive", label: "Active" },
|
|
80
|
+
{ key: "colorErrorText", label: "Text" },
|
|
81
|
+
{ key: "colorErrorTextHover", label: "Text Hover" },
|
|
82
|
+
{ key: "colorErrorTextActive", label: "Text Active" },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "colorLink",
|
|
87
|
+
derived: [
|
|
88
|
+
{ key: "colorLinkHover", label: "Hover" },
|
|
89
|
+
{ key: "colorLinkActive", label: "Active" },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "colorTextBase",
|
|
94
|
+
derived: [
|
|
95
|
+
{ key: "colorText", label: "Text" },
|
|
96
|
+
{ key: "colorTextSecondary", label: "Secondary" },
|
|
97
|
+
{ key: "colorTextTertiary", label: "Tertiary" },
|
|
98
|
+
{ key: "colorTextQuaternary", label: "Quaternary" },
|
|
99
|
+
{ key: "colorTextHeading", label: "Heading" },
|
|
100
|
+
{ key: "colorTextLabel", label: "Label" },
|
|
101
|
+
{ key: "colorTextDescription", label: "Description" },
|
|
102
|
+
{ key: "colorTextDisabled", label: "Disabled" },
|
|
103
|
+
{ key: "colorTextPlaceholder", label: "Placeholder" },
|
|
104
|
+
{ key: "colorTextLightSolid", label: "Light Solid" },
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "colorBgBase",
|
|
109
|
+
derived: [
|
|
110
|
+
{ key: "colorBgLayout", label: "Layout" },
|
|
111
|
+
{ key: "colorBgContainer", label: "Container" },
|
|
112
|
+
{ key: "colorBgElevated", label: "Elevated" },
|
|
113
|
+
{ key: "colorBgSpotlight", label: "Spotlight" },
|
|
114
|
+
{ key: "colorBgContainerDisabled", label: "Container Disabled" },
|
|
115
|
+
{ key: "colorFill", label: "Fill" },
|
|
116
|
+
{ key: "colorFillSecondary", label: "Fill Secondary" },
|
|
117
|
+
{ key: "colorFillTertiary", label: "Fill Tertiary" },
|
|
118
|
+
{ key: "colorFillQuaternary", label: "Fill Quaternary" },
|
|
119
|
+
{ key: "colorBorder", label: "Border" },
|
|
120
|
+
{ key: "colorBorderSecondary", label: "Border Secondary" },
|
|
121
|
+
{ key: "colorBorderDisabled", label: "Border Disabled" },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
/** Every derived token of the table, whichever seed it belongs to. */
|
|
126
|
+
export const PHI_THEME_COLOR_DERIVED_TOKEN_KEYS = new Set(PHI_THEME_COLOR_SEED_DERIVATIONS.flatMap((seed) => seed.derived.map((item) => item.key)));
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type { PhiFormFieldTypeProviderDescriptor, PhiFormHandlerProviderDescript
|
|
|
19
19
|
import type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
|
|
20
20
|
import type { PhiCalendarAdapterClientDefinition, PhiCalendarAdapterDescriptor, PhiCalendarAdapterKey } from "./calendar";
|
|
21
21
|
export type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
|
|
22
|
+
import type { PhiMediaSourceDescriptor, PhiMediaSourceKey } from "./media-source";
|
|
22
23
|
import type { PhiBuilderAreaKey } from "../constants/cms-areas";
|
|
23
24
|
import type { PhiBuilderNavigationTree } from "../helpers/cms-navigation-catalog";
|
|
24
25
|
import type { PhiBuilderActivePageCatalog } from "../helpers/cms-page-catalog";
|
|
@@ -845,6 +846,27 @@ type PhiRuntimeModuleIconMetadata = {
|
|
|
845
846
|
export type PhiRuntimeModuleDefinition = {
|
|
846
847
|
moduleId: PhiRuntimeModuleId;
|
|
847
848
|
kind: "platform" | "module";
|
|
849
|
+
/**
|
|
850
|
+
* Whether a Site chooses this Module, or has it.
|
|
851
|
+
*
|
|
852
|
+
* Absent, a Module is selected per Area: its id is stored in the Area's `runtimeModules`, and a Site
|
|
853
|
+
* switches it on and off in the Builder. `"always"` takes the choice away. The Module is active in
|
|
854
|
+
* every Area it is eligible for (`eligibleAreas`), the Builder shows it switched on and locked the way
|
|
855
|
+
* it shows an Area's Base Module, and its id is never part of a stored selection -- a write that names
|
|
856
|
+
* it is refused, and a stored list that still does is read past and logged.
|
|
857
|
+
*
|
|
858
|
+
* It is for what the platform cannot work without and no Site would ever switch off: the Media library
|
|
859
|
+
* is what every image picker opens, in every Area. Only a Module of this package may declare it.
|
|
860
|
+
* Installing a third-party package enables nothing (THIRD_PARTY_MODULES.md), and a package that could
|
|
861
|
+
* mark itself always active would be switched on by its installation.
|
|
862
|
+
*
|
|
863
|
+
* An always-active Module declares none of `mediaSpaces`, `threadKinds`, `seed`, `userState` and
|
|
864
|
+
* `authUiProvider`. All five are derived from the stored selection -- here when the selection is
|
|
865
|
+
* saved, and by phi-server for `userState`, which reads `runtimeModules` of the published Areas -- and
|
|
866
|
+
* an always-active Module is not in it. The catalog refuses the combination rather than letting the
|
|
867
|
+
* declaration be dropped without a word.
|
|
868
|
+
*/
|
|
869
|
+
activation?: "always";
|
|
848
870
|
eligibleAreas: readonly PhiCmsAreaKey[];
|
|
849
871
|
serverBinding: import("./server-capabilities").PhiRuntimeModuleServerBinding;
|
|
850
872
|
controllerType?: `${string}/${string}`;
|
|
@@ -938,6 +960,12 @@ export type PhiRuntimeModuleDefinition = {
|
|
|
938
960
|
*/
|
|
939
961
|
collectionItemRenderers?: readonly import("./collection-provider").PhiCollectionItemRendererDescriptor[];
|
|
940
962
|
calendarAdapters?: readonly PhiCalendarAdapterDescriptor[];
|
|
963
|
+
/**
|
|
964
|
+
* Media sources this Module offers the Media picker: somewhere else a file can be taken from. The
|
|
965
|
+
* picker lists them beside the Site's library when the Module is active in the Area, and imports what
|
|
966
|
+
* is chosen as an ordinary Asset. The Client half is `mediaSources` of `phiModuleClientContributions`.
|
|
967
|
+
*/
|
|
968
|
+
mediaSources?: readonly PhiMediaSourceDescriptor[];
|
|
941
969
|
/**
|
|
942
970
|
* Places a video may be fetched from, once somebody has asked for it.
|
|
943
971
|
*
|
|
@@ -1126,6 +1154,7 @@ export type PhiResolvedRuntimeModuleSet = {
|
|
|
1126
1154
|
layoutDefinitionsByType: ReadonlyMap<string, PhiRuntimeModuleLayoutDefinition>;
|
|
1127
1155
|
dataProviderDescriptorsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, PhiRuntimeModuleDataProviderDescriptor>;
|
|
1128
1156
|
calendarAdapterDescriptorsByKey: ReadonlyMap<PhiCalendarAdapterKey, PhiCalendarAdapterDescriptor>;
|
|
1157
|
+
mediaSourceDescriptorsByKey: ReadonlyMap<PhiMediaSourceKey, PhiMediaSourceDescriptor>;
|
|
1129
1158
|
videoProviderDescriptorsByKey: ReadonlyMap<import("./video").PhiVideoProviderKey, import("./video").PhiVideoProviderDescriptor>;
|
|
1130
1159
|
formFieldTypeProviderDescriptorsByKey: ReadonlyMap<PhiFormProviderKey, PhiFormFieldTypeProviderDescriptor>;
|
|
1131
1160
|
formValidationProviderDescriptorsByKey: ReadonlyMap<PhiFormProviderKey, PhiFormValidationProviderDescriptor>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PhisMediaSourceListInput, PhisMediaSourcePage } from "@phis/contracts/media-source";
|
|
2
|
+
import type { PhiRuntimeModuleId } from "./cms-module-descriptors";
|
|
3
|
+
/**
|
|
4
|
+
* A media source a Module offers: somewhere other than the Site's library a file can be taken from. The
|
|
5
|
+
* list contract is `@phis/contracts/media-source`; what is chosen is imported into the library as an
|
|
6
|
+
* ordinary Asset, and nothing ever stores a reference into the source (THIRD_PARTY_MODULES.md, "Offering a
|
|
7
|
+
* media source").
|
|
8
|
+
*/
|
|
9
|
+
/** Namespaced like a data provider key: `<owner>/<name>`. */
|
|
10
|
+
export type PhiMediaSourceKey = `${string}/${string}`;
|
|
11
|
+
/** What the Server half declares: the catalog validates the key and that the declaring Module owns it. */
|
|
12
|
+
export type PhiMediaSourceDescriptor = {
|
|
13
|
+
key: PhiMediaSourceKey;
|
|
14
|
+
ownerModuleId: PhiRuntimeModuleId;
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* An item, taken: the bytes in the browser and what is known about them. The picker uploads the file
|
|
20
|
+
* into the Site's library; the Module never writes an Asset itself.
|
|
21
|
+
*/
|
|
22
|
+
export type PhiMediaSourceTakenFile = {
|
|
23
|
+
file: Blob;
|
|
24
|
+
fileName: string;
|
|
25
|
+
title: string;
|
|
26
|
+
altText?: string | null;
|
|
27
|
+
credit?: string | null;
|
|
28
|
+
};
|
|
29
|
+
export type PhiMediaSourceClient = {
|
|
30
|
+
/** What the picker's source switch says, in the reader's language; the Module translates its own words. */
|
|
31
|
+
describe(input: {
|
|
32
|
+
locale: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
label: string;
|
|
35
|
+
}>;
|
|
36
|
+
list(input: PhisMediaSourceListInput & {
|
|
37
|
+
signal: AbortSignal;
|
|
38
|
+
}): Promise<PhisMediaSourcePage>;
|
|
39
|
+
take(input: {
|
|
40
|
+
itemId: string;
|
|
41
|
+
signal: AbortSignal;
|
|
42
|
+
}): Promise<PhiMediaSourceTakenFile>;
|
|
43
|
+
};
|
|
44
|
+
export type PhiMediaSourceClientDefinition = {
|
|
45
|
+
key: PhiMediaSourceKey;
|
|
46
|
+
ownerModuleId: PhiRuntimeModuleId;
|
|
47
|
+
load: () => Promise<PhiMediaSourceClient>;
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/site-config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PhiShellTheme } from "../components/shell/shell-types";
|
|
2
|
-
import type { PhiSiteFontSlots, PhiSiteThemeBrand,
|
|
2
|
+
import type { PhiSiteFontSlots, PhiSiteThemeBrand, PhiSiteThemeRoot } from "./site-theme";
|
|
3
3
|
import type { PhiLocaleCapability } from "../helpers/site-locale-config";
|
|
4
4
|
import type { PhiThemePalette } from "../theme/phi-theme-presets";
|
|
5
5
|
import type { PhiThemeBlockSelection } from "../theme/phi-theme-composition";
|
|
@@ -22,7 +22,6 @@ export type PhiSiteTheme = {
|
|
|
22
22
|
controls?: PhiControlShapeCorners | null;
|
|
23
23
|
} | null;
|
|
24
24
|
fonts?: PhiSiteFontSlots;
|
|
25
|
-
contact?: PhiSiteThemeContact | null;
|
|
26
25
|
brand?: PhiSiteThemeBrand | null;
|
|
27
26
|
widgets?: {
|
|
28
27
|
locale?: {
|
package/types/site-theme.d.ts
CHANGED
|
@@ -178,12 +178,6 @@ export type PhiSiteThemeBrand = {
|
|
|
178
178
|
location?: PhiSiteThemeBrandLine | null;
|
|
179
179
|
wordmark?: PhiSiteThemeWordmark | null;
|
|
180
180
|
};
|
|
181
|
-
/** The one way to reach whoever runs this Site, as the frame offers it. */
|
|
182
|
-
export type PhiSiteThemeContact = {
|
|
183
|
-
label?: string | null;
|
|
184
|
-
href?: string | null;
|
|
185
|
-
icon?: string | null;
|
|
186
|
-
};
|
|
187
181
|
export type PhiWidgetFontFamilyKey = "inherit" | "system" | "body" | "mono" | "serif" | "accent" | "display";
|
|
188
182
|
export type PhiWidgetFontSizeKey = "inherit" | "xs" | "sm" | "base" | "lg" | "xl" | "xxl";
|
|
189
183
|
export type PhiSiteFontSlots = {
|
package/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./types/layout-style";
|
|
|
14
14
|
export * from "./types/control";
|
|
15
15
|
export * from "./types/calendar";
|
|
16
16
|
export * from "./types/calendar-keys";
|
|
17
|
+
export type * from "./types/media-source";
|
|
17
18
|
export * from "./types/dimension";
|
|
18
19
|
export * from "./types/length";
|
|
19
20
|
export * from "./types/responsive";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type PhiSignalRouteSet, type PhiSignalScope } from "../../types/signals";
|
|
2
|
-
/**
|
|
3
|
-
* The signal routes a media picker emits towards the asset controller.
|
|
4
|
-
*
|
|
5
|
-
* It sits beside the address and the channels it builds on, because it is used by the asset Module,
|
|
6
|
-
* by the builder Module and by two shared widget components -- so no single Module can own it.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createPhiMediaPickerAssetControllerRoutes(routeKeyPrefix: string, scope: Extract<PhiSignalScope, "area" | "page">): PhiSignalRouteSet;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PHI_SIGNAL_VALUE_SCHEMAS, } from "../../types/signals";
|
|
2
|
-
import { createPhiAssetControllerAddress } from "./asset-controller-address";
|
|
3
|
-
import { PHI_ASSET_SIGNAL_CHANNELS } from "./asset-controller-signals";
|
|
4
|
-
/**
|
|
5
|
-
* The signal routes a media picker emits towards the asset controller.
|
|
6
|
-
*
|
|
7
|
-
* It sits beside the address and the channels it builds on, because it is used by the asset Module,
|
|
8
|
-
* by the builder Module and by two shared widget components -- so no single Module can own it.
|
|
9
|
-
*/
|
|
10
|
-
export function createPhiMediaPickerAssetControllerRoutes(routeKeyPrefix, scope) {
|
|
11
|
-
const receiver = createPhiAssetControllerAddress();
|
|
12
|
-
return {
|
|
13
|
-
emits: [
|
|
14
|
-
{ routeKey: `${routeKeyPrefix}-kind`, capabilityId: "kind", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.kind, action: "change", valueType: "string", receiver },
|
|
15
|
-
{ routeKey: `${routeKeyPrefix}-presentationFlags`, capabilityId: "presentationFlags", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.presentationFlags, action: "change", valueType: "number[]", receiver },
|
|
16
|
-
{ routeKey: `${routeKeyPrefix}-query`, capabilityId: "query", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.query, action: "change", valueType: "string", receiver },
|
|
17
|
-
{ routeKey: `${routeKeyPrefix}-path`, capabilityId: "path", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.path, action: "change", valueType: "path", receiver },
|
|
18
|
-
{ routeKey: `${routeKeyPrefix}-reload`, capabilityId: "reload", scope, channel: PHI_ASSET_SIGNAL_CHANNELS.reload, action: "activate", valueType: "none", receiver },
|
|
19
|
-
{
|
|
20
|
-
routeKey: `${routeKeyPrefix}-pagination`,
|
|
21
|
-
capabilityId: "pagination",
|
|
22
|
-
scope,
|
|
23
|
-
channel: PHI_ASSET_SIGNAL_CHANNELS.pagination,
|
|
24
|
-
action: "change",
|
|
25
|
-
valueType: "json",
|
|
26
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.pagination,
|
|
27
|
-
receiver,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
};
|
|
31
|
-
}
|