@phis/ui 0.5.4 → 0.5.6
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-layout-renderer.js +17 -7
- package/components/controls/phi-anchor-nav-control.js +18 -1
- package/components/layouts/clients/phi-flex-layout-client.js +17 -2
- package/components/layouts/clients/phi-layout-anchored-overlay.d.ts +2 -0
- package/components/layouts/clients/phi-layout-anchored-overlay.js +2 -0
- package/components/regions/presets/content-entry-editor-page-tree.js +2 -0
- package/components/regions/presets/content-entry-public-page-trees.js +2 -0
- package/components/widgets/builder/stack-tabs.d.ts +2 -1
- package/components/widgets/builder/stack-tabs.js +18 -2
- package/components/widgets/config/choice-shared.d.ts +0 -48
- package/components/widgets/config/choice-shared.js +0 -1
- package/components/widgets/config/stack-tabs.js +4 -3
- package/components/widgets/shared/card-body-client.d.ts +6 -2
- package/components/widgets/shared/card-body-client.js +27 -20
- package/components/widgets/shared/card-vocabulary.d.ts +7 -0
- package/components/widgets/shared/card-vocabulary.js +6 -0
- package/components/widgets/shared/markdown-body-client.js +7 -2
- package/constants/module-identity.d.ts +8 -0
- package/constants/module-identity.js +13 -0
- package/gateway/server-module-media.d.ts +12 -0
- package/gateway/server-module-media.js +83 -0
- package/helpers/cms-navigation-catalog.js +4 -1
- package/helpers/cms-page-catalog.d.ts +7 -0
- package/helpers/cms-preset-page-tree.js +16 -1
- package/helpers/config-text-fields.d.ts +49 -0
- package/helpers/config-text-fields.js +122 -0
- package/helpers/module-media-check.d.ts +23 -0
- package/helpers/module-media-check.js +32 -0
- package/helpers/module-media.d.ts +7 -0
- package/helpers/module-media.js +15 -0
- package/helpers/preset-text-source-check.d.ts +22 -0
- package/helpers/preset-text-source-check.js +45 -0
- package/helpers/route-address-check.d.ts +35 -0
- package/helpers/route-address-check.js +28 -0
- package/helpers/text-source.d.ts +14 -5
- package/helpers/text-source.js +16 -3
- package/module-page-check.d.ts +3 -0
- package/module-page-check.js +3 -0
- package/package.json +1 -1
- package/plugins/runtime/phi-slot-child-frame-view.js +1 -1
- package/plugins/runtime/slot-size-policy.d.ts +8 -2
- package/plugins/runtime/slot-size-policy.js +51 -16
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-page-tree.js +2 -0
- package/plugins/runtime-modules/builder/area-shell-presets.server.js +2 -0
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +2 -2
- package/plugins/runtime-modules/builder/navigation-folder-drop.js +2 -1
- package/plugins/runtime-modules/builder/options-providers.js +7 -1
- package/plugins/runtime-modules/builder/page-presets.server.js +2 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -0
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +11 -0
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +9 -2
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/button/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/button/plugin.js +6 -25
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +24 -2
- package/plugins/runtime-modules/core/widgets/card/config.js +35 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +2 -0
- package/plugins/runtime-modules/core/widgets/card/plugin.js +8 -10
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +1 -2
- package/plugins/runtime-modules/core/widgets/card/server.js +18 -28
- package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +7 -1
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.js +3 -3
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/image/server.js +5 -9
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/server.js +3 -5
- package/plugins/runtime-modules/core/widgets/quick-links/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/quick-links/server.d.ts +2 -5
- package/plugins/runtime-modules/core/widgets/quick-links/server.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/result/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/result/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/result/server.d.ts +2 -3
- package/plugins/runtime-modules/core/widgets/result/server.js +11 -33
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/slider/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/slider/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/config.js +0 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +2 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +3 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/server.js +5 -13
- package/plugins/runtime-modules/core/widgets/spacer/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/spacer/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/steps/config.d.ts +7 -2
- package/plugins/runtime-modules/core/widgets/steps/config.js +1 -2
- package/plugins/runtime-modules/core/widgets/steps/plugin.js +6 -30
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/table/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/timeline/config.d.ts +8 -1
- package/plugins/runtime-modules/core/widgets/timeline/config.js +1 -2
- package/plugins/runtime-modules/core/widgets/timeline/plugin.js +6 -37
- package/plugins/runtime-modules/descriptor-compiler.d.ts +23 -3
- package/plugins/runtime-modules/descriptor-compiler.js +107 -12
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +2 -0
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +3 -0
- package/plugins/runtime-modules/page-preset-overlays.d.ts +18 -0
- package/plugins/runtime-modules/page-preset-overlays.js +70 -0
- package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +1 -0
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -0
- package/plugins/runtime-modules/search/widgets/search-box/server.js +3 -5
- package/plugins/runtime-modules/search/widgets/search-results/server.js +3 -5
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +4 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +2 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +2 -0
- package/server-helpers/cms-area.js +9 -1
- package/server-helpers/cms-request.js +49 -14
- package/server-helpers/cms-root.js +2 -0
- package/server-helpers/cms-widget-texts.d.ts +14 -0
- package/server-helpers/cms-widget-texts.js +117 -0
- package/server-helpers/module-folder-targets.d.ts +7 -0
- package/server-helpers/module-folder-targets.js +15 -0
- package/server-helpers/search-index.js +12 -3
- package/styles/root.css +6 -2
- package/types/cms-module-descriptors.d.ts +24 -0
- package/types/cms-plugins.d.ts +30 -5
- package/types/core-widget-placements.d.ts +5 -0
- package/types/module-media.d.ts +31 -0
- package/types/module-media.js +11 -0
- package/types/slot-size-policy.d.ts +19 -2
- package/types.d.ts +1 -0
package/styles/root.css
CHANGED
|
@@ -73,15 +73,19 @@ samp {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
:where(.phi-tab-bar.ant-tabs) {
|
|
76
|
-
height: 100%;
|
|
77
76
|
line-height: 1;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
:where(.phi-tab-bar.ant-tabs > .ant-tabs-nav) {
|
|
81
|
-
height: 100%;
|
|
82
80
|
margin: 0;
|
|
83
81
|
}
|
|
84
82
|
|
|
83
|
+
/* Left and right placement fill the block axis (the Tab bar's `slotSizePolicy`); top and bottom are as high as their content. */
|
|
84
|
+
:where(.phi-tab-bar.ant-tabs-left, .phi-tab-bar.ant-tabs-right),
|
|
85
|
+
:where(.phi-tab-bar.ant-tabs-left > .ant-tabs-nav, .phi-tab-bar.ant-tabs-right > .ant-tabs-nav) {
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
85
89
|
:where(.phi-tab-bar.ant-tabs > .ant-tabs-content-holder) {
|
|
86
90
|
flex: 0 0 0;
|
|
87
91
|
min-width: 0;
|
|
@@ -8,6 +8,7 @@ import type { PhiViewerAccessPolicy } from "./access";
|
|
|
8
8
|
import type { PhiSignalRoute } from "./signals";
|
|
9
9
|
import type { PhiCmsInstanceId } from "./cms-instance-id";
|
|
10
10
|
import type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
|
|
11
|
+
import type { PhiModuleMediaResolver } from "./module-media";
|
|
11
12
|
export type PhiRuntimeModuleId = `${string}/${string}`;
|
|
12
13
|
export type PhiCmsPresetIdentity = {
|
|
13
14
|
ownerModuleId: PhiRuntimeModuleId;
|
|
@@ -31,6 +32,12 @@ export type PhiCmsDescriptorBuildContext = {
|
|
|
31
32
|
page: PhiCmsPageNode;
|
|
32
33
|
runtime: PhiBlockRuntime;
|
|
33
34
|
catalog: PhiCmsCompiledDescriptorCatalog;
|
|
35
|
+
/**
|
|
36
|
+
* The ids the Site's Media library holds for the names the owning Module's own package declares
|
|
37
|
+
* (`phis.media`). Area shell, Area Overlay and route presets get it; a Theme preset or block loader has
|
|
38
|
+
* no context and does not.
|
|
39
|
+
*/
|
|
40
|
+
media: PhiModuleMediaResolver;
|
|
34
41
|
};
|
|
35
42
|
export type PhiCmsAreaShellPresetDescriptor = PhiCmsPresetIdentity & {
|
|
36
43
|
shellPresetVersion: number;
|
|
@@ -174,6 +181,15 @@ export type PhiCmsNavigationBaseItemDescriptor = {
|
|
|
174
181
|
signalRoutes?: {
|
|
175
182
|
emits?: readonly PhiSignalRoute[];
|
|
176
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* On an entry with children: where its folder address leads -- the itemKey of one direct child that
|
|
186
|
+
* goes to a route of the same Module, usually an overview. The folder address is the folder the
|
|
187
|
+
* children's paths share (`/faq` for `/faq/overview` and `/faq/hosting`); a request for it is
|
|
188
|
+
* forwarded to that child's Page. A Page is never a folder, so the overview is a child like the
|
|
189
|
+
* others and the container has no Page of its own. A Site's own choice in the Builder replaces it
|
|
190
|
+
* (phis-server REFERENCES.md, "Folder addresses"); THIRD_PARTY_MODULES.md, "Addresses and folders".
|
|
191
|
+
*/
|
|
192
|
+
folderTarget?: string;
|
|
177
193
|
children?: readonly PhiCmsNavigationBaseItemDescriptor[];
|
|
178
194
|
};
|
|
179
195
|
/**
|
|
@@ -263,6 +279,8 @@ export type PhiCmsNavigationInjectionItemDescriptor = {
|
|
|
263
279
|
signalRoutes?: {
|
|
264
280
|
emits?: readonly PhiSignalRoute[];
|
|
265
281
|
};
|
|
282
|
+
/** As on an Area's own entry: the direct child the folder address leads to. */
|
|
283
|
+
folderTarget?: string;
|
|
266
284
|
children?: readonly PhiCmsNavigationInjectionItemDescriptor[];
|
|
267
285
|
};
|
|
268
286
|
/**
|
|
@@ -338,6 +356,12 @@ export type PhiCmsResolvedNavigationItem = {
|
|
|
338
356
|
accessPolicy?: PhiViewerAccessPolicy;
|
|
339
357
|
/** The routes this entry sends on when it is chosen, carried through from its descriptor. */
|
|
340
358
|
emits?: readonly PhiSignalRoute[];
|
|
359
|
+
/**
|
|
360
|
+
* A Module container's folder, from its descriptor's `folderTarget`: the address its children share
|
|
361
|
+
* and the Page of the child it names. Absent where the children share no folder. A Site's override
|
|
362
|
+
* for the container replaces it.
|
|
363
|
+
*/
|
|
364
|
+
folder?: PhiCmsNavigationFolder;
|
|
341
365
|
children: readonly PhiCmsResolvedNavigationItem[];
|
|
342
366
|
};
|
|
343
367
|
export type PhiCmsResolvedNavigationSurface = {
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -116,6 +116,12 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
116
116
|
emptyValue?: "";
|
|
117
117
|
/** What an empty box shows: what an unset value means, such as `Auto`. Not stored. */
|
|
118
118
|
placeholder?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether the field holds words a reader reads, where its name answers wrongly: the name decides
|
|
121
|
+
* otherwise (`helpers/config-text-fields.ts`). `false` keeps a field called like a text from being
|
|
122
|
+
* translated; a register makes a field translated that is not called like one.
|
|
123
|
+
*/
|
|
124
|
+
text?: false | "label" | "message";
|
|
119
125
|
}) | (PhiCmsConfigFieldBase & {
|
|
120
126
|
/**
|
|
121
127
|
* One link, chosen rather than typed.
|
|
@@ -333,6 +339,17 @@ export type PhiCmsPluginLicenseState = {
|
|
|
333
339
|
features?: string[];
|
|
334
340
|
expiresAt?: string | null;
|
|
335
341
|
};
|
|
342
|
+
/**
|
|
343
|
+
* One text a Widget declares in its config beyond its fields: `config[key]`, or with `item` each entry's
|
|
344
|
+
* `config[key][].item`, whose `values` (`config[key][].<values>`) stand in its sentence as `%1` onwards
|
|
345
|
+
* and are filled after the translation, never sent with it.
|
|
346
|
+
*/
|
|
347
|
+
export type PhiCmsWidgetConfigText = {
|
|
348
|
+
key: string;
|
|
349
|
+
register: "label" | "message";
|
|
350
|
+
item?: string;
|
|
351
|
+
values?: string;
|
|
352
|
+
};
|
|
336
353
|
export type PhiCmsWidgetContentBinding = {
|
|
337
354
|
storage: "text" | "html" | "markdown" | "asset";
|
|
338
355
|
sourceField: string;
|
|
@@ -465,13 +482,21 @@ export type PhiCmsWidgetPlugin<TConfig> = {
|
|
|
465
482
|
requiredDataProviders?: readonly PhiRuntimeDataProviderKey[];
|
|
466
483
|
contentBinding?: PhiCmsWidgetContentBinding | null;
|
|
467
484
|
/**
|
|
468
|
-
* The Widget translates the text written into its own config
|
|
485
|
+
* The Widget translates the text written into its own config, and the renderer's pass
|
|
486
|
+
* (`server-helpers/cms-widget-texts.ts`) leaves it out: a content Widget, whose text is parsed before it
|
|
487
|
+
* is translated and which an author may want left as written.
|
|
469
488
|
*
|
|
470
|
-
* Turning that off is the node's `NoTranslate` flag, not a config field
|
|
471
|
-
*
|
|
472
|
-
*
|
|
489
|
+
* Turning that off is the node's `NoTranslate` flag, not a config field. A Widget that says so here
|
|
490
|
+
* gets the Inspector's switch for it; no other Widget does, for a Control's words are always
|
|
491
|
+
* translated.
|
|
473
492
|
*/
|
|
474
493
|
translatesOwnText?: true;
|
|
494
|
+
/**
|
|
495
|
+
* Texts in the config that no Inspector field edits -- a Card's title and its plan's lines are written
|
|
496
|
+
* on the canvas -- which the renderer translates beside the fields' (`server-helpers/cms-widget-texts.ts`).
|
|
497
|
+
* Fields need no entry here: their names answer it (`helpers/config-text-fields.ts`).
|
|
498
|
+
*/
|
|
499
|
+
configTexts?: readonly PhiCmsWidgetConfigText[];
|
|
475
500
|
slotSizePolicy: PhiSlotSizePolicy;
|
|
476
501
|
/**
|
|
477
502
|
* Who draws the node's Surface (`config.surface`).
|
|
@@ -538,7 +563,7 @@ export type PhiCmsWidgetSearchTextArgs<TConfig> = {
|
|
|
538
563
|
* `contentBinding` through an `"x" in plugin` branch, and a Module's `translatesOwnText` travelled on a
|
|
539
564
|
* plugin whose type did not know it.
|
|
540
565
|
*/
|
|
541
|
-
export type PhiCmsWidgetPluginDefinition<TConfig> = Pick<PhiCmsWidgetPlugin<TConfig>, "kind" | "pluginKey" | "typeKey" | "title" | "description" | "category" | "tags" | "icon" | "iconName" | "iconFamily" | "commercial" | "runtimeSignals" | "signalSubcontrols" | "requiredRuntimeControllers" | "requiredDataProviders" | "contentBinding" | "translatesOwnText" | "slotSizePolicy" | "surface" | "requiredRegionOwnership" | "defaultConfig" | "creationConfig" | "fields" | "parseConfig">;
|
|
566
|
+
export type PhiCmsWidgetPluginDefinition<TConfig> = Pick<PhiCmsWidgetPlugin<TConfig>, "kind" | "pluginKey" | "typeKey" | "title" | "description" | "category" | "tags" | "icon" | "iconName" | "iconFamily" | "commercial" | "runtimeSignals" | "signalSubcontrols" | "requiredRuntimeControllers" | "requiredDataProviders" | "contentBinding" | "translatesOwnText" | "configTexts" | "slotSizePolicy" | "surface" | "requiredRegionOwnership" | "defaultConfig" | "creationConfig" | "fields" | "parseConfig">;
|
|
542
567
|
export type PhiCmsBuilderWidgetEditorInteraction = "inert" | "authoring";
|
|
543
568
|
export type PhiCmsBuilderWidgetPlugin<TConfig> = PhiCmsWidgetPluginDefinition<TConfig> & {
|
|
544
569
|
editorInteraction?: PhiCmsBuilderWidgetEditorInteraction;
|
|
@@ -39,6 +39,11 @@ export type PhiWidgetPlacementBase = Omit<PhiRenderableBlockBase, "renderMode" |
|
|
|
39
39
|
/** Shows the Widget only while the condition holds; the renderer evaluates it for every Widget. */
|
|
40
40
|
visibleWhen?: PhiRuntimeConditionExpression;
|
|
41
41
|
signalRoutes?: PhiWidgetPlacementSignalRoutes | null;
|
|
42
|
+
/**
|
|
43
|
+
* Whose words the Widget's text is, which decides the store that translates it (`helpers/text-source.ts`):
|
|
44
|
+
* a Module's Preset states it on every Widget with text (TRANSLATIONS.md, "Widget config text").
|
|
45
|
+
*/
|
|
46
|
+
textSource?: PhiTextSource;
|
|
42
47
|
};
|
|
43
48
|
/** The routes a placement wires. Read-only lists, so a Preset can build them from shared constants. */
|
|
44
49
|
export type PhiWidgetPlacementSignalRoutes = {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pictures a Module's own package declares (`phis.media` in its `package.json`) as the Site's Media
|
|
3
|
+
* library holds them (design/MODULE_MEDIA.md in phis-server; THIRD_PARTY_MODULES.md, "Pictures a Module
|
|
4
|
+
* ships").
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* What a route, Area shell or Area Overlay preset asks for the ids of the names its own package declares.
|
|
8
|
+
*
|
|
9
|
+
* Bound to the package of the preset's owner: a Module cannot ask for another package's names. Each call
|
|
10
|
+
* answers the Asset id (`asset`) or the Media Folder id (`folder`) the Site holds for the name, or `null`
|
|
11
|
+
* where it has none -- the name is not imported yet, or its Asset or folder was deleted. A preset leaves
|
|
12
|
+
* the picture out then. Asynchronous because the Site reads the mapping from Core on first use only: a
|
|
13
|
+
* preset that never asks costs no request.
|
|
14
|
+
*/
|
|
15
|
+
export type PhiModuleMediaResolver = {
|
|
16
|
+
asset(key: string): Promise<number | null>;
|
|
17
|
+
folder(key: string): Promise<number | null>;
|
|
18
|
+
};
|
|
19
|
+
/** Package name -> declared key -> id, as `GET /api/v1/site/module-media` answers it. */
|
|
20
|
+
export type PhiModuleMediaMapping = {
|
|
21
|
+
assets: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
22
|
+
folders: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
23
|
+
};
|
|
24
|
+
/** Reads the Site's mapping. Called at most once per instantiation, on the first question. */
|
|
25
|
+
export type PhiModuleMediaLoader = () => Promise<PhiModuleMediaMapping>;
|
|
26
|
+
/** The mapping of a Site that holds nothing. */
|
|
27
|
+
export declare const PHI_EMPTY_MODULE_MEDIA_MAPPING: PhiModuleMediaMapping;
|
|
28
|
+
/**
|
|
29
|
+
* For a caller without a Core -- a contract script, a test: every name is answered `null`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PHI_EMPTY_MODULE_MEDIA_LOADER: PhiModuleMediaLoader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pictures a Module's own package declares (`phis.media` in its `package.json`) as the Site's Media
|
|
3
|
+
* library holds them (design/MODULE_MEDIA.md in phis-server; THIRD_PARTY_MODULES.md, "Pictures a Module
|
|
4
|
+
* ships").
|
|
5
|
+
*/
|
|
6
|
+
/** The mapping of a Site that holds nothing. */
|
|
7
|
+
export const PHI_EMPTY_MODULE_MEDIA_MAPPING = { assets: {}, folders: {} };
|
|
8
|
+
/**
|
|
9
|
+
* For a caller without a Core -- a contract script, a test: every name is answered `null`.
|
|
10
|
+
*/
|
|
11
|
+
export const PHI_EMPTY_MODULE_MEDIA_LOADER = async () => PHI_EMPTY_MODULE_MEDIA_MAPPING;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
export type PhiSlotAxisSizePolicy = "intrinsic" | "fill" | "fixed";
|
|
2
|
-
export type PhiSlotSizePolicyPreset = "intrinsic" | "fill-inline" | "fill-block" | "fill" | "fixed";
|
|
3
|
-
|
|
2
|
+
export type PhiSlotSizePolicyPreset = "intrinsic" | "fill-inline" | "fill-block" | "fill" | "rest" | "fixed";
|
|
3
|
+
/** A policy that holds whatever the config says. */
|
|
4
|
+
export type PhiSlotSizePolicyValue = PhiSlotSizePolicyPreset | {
|
|
4
5
|
inline?: PhiSlotAxisSizePolicy | null;
|
|
5
6
|
block?: PhiSlotAxisSizePolicy | null;
|
|
6
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* A policy one field of the block's own config decides: `byValue[config[configField]]`, else `otherwise`.
|
|
10
|
+
* A string field is read as it is, a boolean field as the key `"true"` or `"false"`; anything else is `otherwise`.
|
|
11
|
+
* Declarative on purpose: the policy travels to the Builder as data.
|
|
12
|
+
*/
|
|
13
|
+
export type PhiSlotSizePolicyByConfig = {
|
|
14
|
+
configField: string;
|
|
15
|
+
byValue: Readonly<Record<string, PhiSlotSizePolicyValue>>;
|
|
16
|
+
otherwise: PhiSlotSizePolicyValue;
|
|
17
|
+
};
|
|
18
|
+
export type PhiSlotSizePolicy = PhiSlotSizePolicyValue | PhiSlotSizePolicyByConfig;
|
|
7
19
|
export type PhiNormalizedSlotSizePolicy = {
|
|
8
20
|
inline: PhiSlotAxisSizePolicy;
|
|
9
21
|
block: PhiSlotAxisSizePolicy;
|
|
22
|
+
/**
|
|
23
|
+
* Set by `"rest"` alone, which is `fill` on both axes and this. Only a Flex Layout reads it: where a
|
|
24
|
+
* child that fills the Layout's main axis also states it, that child alone grows into the room left over.
|
|
25
|
+
*/
|
|
26
|
+
takesRest?: true;
|
|
10
27
|
};
|
package/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./types/cms-overlay";
|
|
|
3
3
|
export type * from "./types/cms-container";
|
|
4
4
|
export * from "./types/cms-instance-id";
|
|
5
5
|
export { type PhiCmsAreaDefinition, type PhiCmsAreaOverlayPresetDescriptor, type PhiCmsAreaShellCompositionSource, type PhiCmsAreaShellPresetBinding, type PhiCmsAreaShellPresetDescriptor, type PhiCmsDescriptorBuildContext, type PhiCmsNavigationAnchor, type PhiCmsNavigationAnchoredInjectionDescriptor, type PhiCmsNavigationAnchorPlacement, type PhiCmsNavigationAreaTarget, type PhiCmsNavigationBaseItemDescriptor, type PhiCmsNavigationCustomItem, type PhiCmsNavigationExternalTarget, type PhiCmsNavigationFolder, type PhiCmsNavigationFolderTarget, type PhiCmsNavigationInjectionDescriptor, type PhiCmsNavigationInjectionItemDescriptor, type PhiCmsNavigationItemOverride, type PhiCmsNavigationItemPlacement, type PhiCmsNavigationItemStanding, type PhiCmsNavigationKeyedInjectionDescriptor, type PhiCmsNavigationLabel, type PhiCmsNavigationSurfaceDescriptor, type PhiCmsPresetIdentity, type PhiCmsPresetSource, type PhiCmsRoutePresetBinding, type PhiCmsRoutePresetDescriptor, type PhiCmsThemeBlockBinding, type PhiCmsThemeBlockDescriptor, type PhiCmsThemeBlockKind, type PhiCmsThemeDescriptorContribution, type PhiCmsThemePresetBinding, type PhiCmsThemePresetDescriptor, type PhiRuntimeModuleId, } from "./types/cms-module-descriptors";
|
|
6
|
+
export type { PhiModuleMediaResolver } from "./types/module-media";
|
|
6
7
|
export { expandPhiBorderRadiusConfig, mergePhiBorderWidgetConfig, mergePhiCmsConfigValues, mergePhiPaddingWidgetConfig, normalizePhiPaddingWidgetConfig, } from "./types/cms-config";
|
|
7
8
|
export type { PhiCmsBorderWidgetConfig, PhiCmsPaddingWidgetConfig, PhiCmsPluginConfigBase, PhiCmsRenderableBlockConfigBase, } from "./types/cms-config";
|
|
8
9
|
export { readPhiCmsBorderWidgetConfig } from "./types/cms-border-config";
|