@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { isPhiRecord } from "../helpers/is-record";
|
|
3
|
+
import { readPhiServerApiCredentials } from "../helpers/phis-server-credentials";
|
|
4
|
+
import { PHI_EMPTY_MODULE_MEDIA_MAPPING, } from "../types/module-media";
|
|
5
|
+
import { fetchPhiSiteApi } from "./site-api-request";
|
|
6
|
+
import { readPhiSiteReadCache } from "./site-read-cache";
|
|
7
|
+
const PACKAGE_NAME_PATTERN = /^@[^/]+\/[^/]+$/;
|
|
8
|
+
const KEY_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
9
|
+
function parseIds(value, what) {
|
|
10
|
+
if (!isPhiRecord(value)) {
|
|
11
|
+
throw new Error(`Invalid module media ${what}.`);
|
|
12
|
+
}
|
|
13
|
+
const result = {};
|
|
14
|
+
for (const [packageName, keys] of Object.entries(value)) {
|
|
15
|
+
if (!PACKAGE_NAME_PATTERN.test(packageName) || !isPhiRecord(keys)) {
|
|
16
|
+
throw new Error(`Invalid module media ${what}.`);
|
|
17
|
+
}
|
|
18
|
+
const ids = {};
|
|
19
|
+
for (const [key, id] of Object.entries(keys)) {
|
|
20
|
+
if (!KEY_PATTERN.test(key) || typeof id !== "number" || !Number.isSafeInteger(id) || id <= 0) {
|
|
21
|
+
throw new Error(`Invalid module media ${what}.`);
|
|
22
|
+
}
|
|
23
|
+
ids[key] = id;
|
|
24
|
+
}
|
|
25
|
+
result[packageName] = ids;
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
export function parsePhiModuleMediaMapping(value) {
|
|
30
|
+
if (!isPhiRecord(value)) {
|
|
31
|
+
throw new Error("Invalid module media mapping.");
|
|
32
|
+
}
|
|
33
|
+
return { assets: parseIds(value.assets, "assets"), folders: parseIds(value.folders, "folders") };
|
|
34
|
+
}
|
|
35
|
+
let unavailableLogged = false;
|
|
36
|
+
/** Re-arms the once-per-process log; for tests. */
|
|
37
|
+
export function resetPhiModuleMediaUnavailableLog() {
|
|
38
|
+
unavailableLogged = false;
|
|
39
|
+
}
|
|
40
|
+
export async function getPhiModuleMediaMapping(options) {
|
|
41
|
+
/*
|
|
42
|
+
* Kept in the read cache outside development, with the capability snapshot's reasoning and lifetime
|
|
43
|
+
* (60 s): the mapping is the same for every viewer and changes only on `phis module media sync` or a
|
|
44
|
+
* rebind, which no read marker sees, so the TTL is what lets a hand binding reach a running Site.
|
|
45
|
+
*/
|
|
46
|
+
if (process.env.NODE_ENV === "development") {
|
|
47
|
+
return loadPhiModuleMediaMapping(options);
|
|
48
|
+
}
|
|
49
|
+
return readPhiSiteReadCache(`module-media:${options.siteKey.trim().toLowerCase()}`, () => loadPhiModuleMediaMapping(options));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Unlike the capability snapshot, a Core that cannot answer is not an error here: a missing route (`404`,
|
|
53
|
+
* a Core older than the route), a refusal or an unreachable Core give the empty mapping, and the first
|
|
54
|
+
* time per process is logged. A missing picture must not take a page down, and `@phis/ui` may be rolled
|
|
55
|
+
* out before the Core that knows the route. An answer that arrives but is malformed still throws.
|
|
56
|
+
*/
|
|
57
|
+
async function loadPhiModuleMediaMapping({ apiBaseUrl, internalToken, siteKey, }) {
|
|
58
|
+
let answer;
|
|
59
|
+
try {
|
|
60
|
+
answer = await fetchPhiSiteApi({
|
|
61
|
+
context: "getPhiModuleMediaMapping",
|
|
62
|
+
apiBaseUrl,
|
|
63
|
+
internalToken,
|
|
64
|
+
siteKey,
|
|
65
|
+
path: "/api/v1/site/module-media",
|
|
66
|
+
failure: "Failed to read module media",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (!unavailableLogged) {
|
|
71
|
+
unavailableLogged = true;
|
|
72
|
+
console.warn("[phi-module-media] The Site's module media could not be read; presets leave their pictures out.", {
|
|
73
|
+
error,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return PHI_EMPTY_MODULE_MEDIA_MAPPING;
|
|
77
|
+
}
|
|
78
|
+
return parsePhiModuleMediaMapping(answer);
|
|
79
|
+
}
|
|
80
|
+
/** The loader a server caller hands to the descriptor compiler for this Site. */
|
|
81
|
+
export function createPhiModuleMediaLoader(siteKey) {
|
|
82
|
+
return () => getPhiModuleMediaMapping({ ...readPhiServerApiCredentials(), siteKey });
|
|
83
|
+
}
|
|
@@ -51,7 +51,10 @@ function materializeNavigationItem(item, tombstones, customItems, overrides) {
|
|
|
51
51
|
const customTarget = customItem?.target;
|
|
52
52
|
// A Site's stored external link and a Module's external entry resolve to the same target.
|
|
53
53
|
const externalTarget = item.target?.kind === "custom" && item.target.external === true ? item.target : null;
|
|
54
|
-
|
|
54
|
+
// A Site's own choice first; a Module container's descriptor names its default (`folderTarget`).
|
|
55
|
+
const folder = item.kind === "container"
|
|
56
|
+
? customItem?.folder ?? overrides.get(item.id)?.folder ?? item.folder
|
|
57
|
+
: undefined;
|
|
55
58
|
return {
|
|
56
59
|
id: item.id,
|
|
57
60
|
source: item.ownerModuleId === null ? "custom" : "module",
|
|
@@ -43,6 +43,13 @@ export type PhiPresetPageNode = {
|
|
|
43
43
|
pendingPath?: string | null;
|
|
44
44
|
pathLocked?: boolean;
|
|
45
45
|
pathOwnershipReason?: string;
|
|
46
|
+
/**
|
|
47
|
+
* A route that answers a family of Pages, by its parameter's name: `slug` for `/blog/:slug`. Every
|
|
48
|
+
* entry of a list answers on it, so it is shown as their kind ("Slug") rather than as one Page, and
|
|
49
|
+
* nothing links to it -- a link names one entry. It stands beneath its list's Page where there is one
|
|
50
|
+
* (`helpers/cms-preset-page-tree.ts`).
|
|
51
|
+
*/
|
|
52
|
+
routeParameter?: string;
|
|
46
53
|
children?: PhiPresetPageNode[];
|
|
47
54
|
};
|
|
48
55
|
/** A Page's address as the Builder shows it: the current one, and where a pending rename moves it. */
|
|
@@ -47,9 +47,19 @@ export function insertPhiPresetPageTarget(roots, target) {
|
|
|
47
47
|
});
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
+
/*
|
|
51
|
+
* A segment is one node, whether a Page answers on it or it only holds what lies beneath: a folder
|
|
52
|
+
* and a Page of the same address side by side read as two entries for one place. The one nesting
|
|
53
|
+
* routes may have is a list's entries beneath the list (`/blog/:slug` under `/blog`,
|
|
54
|
+
* `helpers/route-address-check.ts`), so they hang beneath the list's Page; whichever route comes
|
|
55
|
+
* first, the Page takes the folder's place and keeps what it held.
|
|
56
|
+
*/
|
|
50
57
|
let siblings = roots;
|
|
58
|
+
let folderPath = "";
|
|
51
59
|
for (const segment of segments.slice(0, -1)) {
|
|
52
|
-
|
|
60
|
+
folderPath = `${folderPath}/${segment}`;
|
|
61
|
+
let group = siblings.find((node) => node.catalogPath === folderPath)
|
|
62
|
+
?? siblings.find((node) => node.key === segment && !node.storagePath);
|
|
53
63
|
if (!group) {
|
|
54
64
|
group = { key: segment, title: humanizePageKey(segment), children: [] };
|
|
55
65
|
siblings.push(group);
|
|
@@ -57,6 +67,9 @@ export function insertPhiPresetPageTarget(roots, target) {
|
|
|
57
67
|
group.children ??= [];
|
|
58
68
|
siblings = group.children;
|
|
59
69
|
}
|
|
70
|
+
const last = segments[segments.length - 1];
|
|
71
|
+
const folderIndex = siblings.findIndex((node) => node.key === last && !node.storagePath);
|
|
72
|
+
const held = folderIndex >= 0 ? siblings.splice(folderIndex, 1)[0].children ?? [] : [];
|
|
60
73
|
siblings.push({
|
|
61
74
|
key: pageId,
|
|
62
75
|
title: target.title,
|
|
@@ -66,6 +79,8 @@ export function insertPhiPresetPageTarget(roots, target) {
|
|
|
66
79
|
...(target.defaultPageFlags ? { defaultPageFlags: target.defaultPageFlags } : {}),
|
|
67
80
|
...(target.landingPage ? { landingPage: true } : {}),
|
|
68
81
|
...(target.pageRecord ? { pageRecord: { providerKey: target.pageRecord.providerKey } } : {}),
|
|
82
|
+
...(last.startsWith(":") ? { routeParameter: last.slice(1) } : {}),
|
|
83
|
+
...(held.length > 0 ? { children: held } : {}),
|
|
69
84
|
});
|
|
70
85
|
}
|
|
71
86
|
/**
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { PhiCmsConfigField, PhiCmsWidgetConfigText } from "../types/cms-plugins";
|
|
2
|
+
/**
|
|
3
|
+
* Which of a Widget's config fields are words a reader reads, and so are translated.
|
|
4
|
+
*
|
|
5
|
+
* The name answers it: a field called `label`, `title` or `placeholder` -- or one that ends in `Label`,
|
|
6
|
+
* `Title`, `Placeholder` or `Description` -- holds text, and nothing else does. `key`, `value`, `format`
|
|
7
|
+
* or `timeZone` are what the Widget works with, and translating them would break it. A Widget does not
|
|
8
|
+
* declare its texts one by one, so a new Widget whose label is called `label` is translated without
|
|
9
|
+
* anybody remembering to say so; the few fields the name gets wrong say otherwise on the field (`text`).
|
|
10
|
+
*
|
|
11
|
+
* The register is the translator's context: a label is a noun phrase on a control (`Web UI label`), a
|
|
12
|
+
* description a sentence (`Web UI message`), so a translator neither clips the one nor pads the other.
|
|
13
|
+
*/
|
|
14
|
+
export type PhiConfigTextRegister = "label" | "message";
|
|
15
|
+
/** The register a field's name gives it, or null where the name says it is not text. */
|
|
16
|
+
export declare function readPhiConfigTextRegisterByName(key: string): PhiConfigTextRegister | null;
|
|
17
|
+
/**
|
|
18
|
+
* The register of one config field, or null where it is not translated: a `string` field by its name
|
|
19
|
+
* unless the field states `text`, every other type never -- a link, an icon or a choice stores what it
|
|
20
|
+
* means, not what it says.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readPhiConfigFieldTextRegister(field: PhiCmsConfigField): PhiConfigTextRegister | null;
|
|
23
|
+
/** One text a config holds: where it stands, and how a translator is told to read it. */
|
|
24
|
+
export type PhiConfigTextLocation = {
|
|
25
|
+
/** Keys and list positions from the config's root, ending at the text. */
|
|
26
|
+
path: readonly (string | number)[];
|
|
27
|
+
register: PhiConfigTextRegister;
|
|
28
|
+
text: string;
|
|
29
|
+
/** What stands in the text as `%1` onwards, filled after the translation. */
|
|
30
|
+
values?: readonly string[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Every non-empty text a config holds, in field order: the fields themselves and, inside a
|
|
34
|
+
* `collection`, each entry's -- a select's options are its `options[].label`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectPhiConfigTexts(fields: readonly PhiCmsConfigField[], config: Readonly<Record<string, unknown>>, prefix?: readonly (string | number)[]): PhiConfigTextLocation[];
|
|
37
|
+
/**
|
|
38
|
+
* The texts a Widget declares beyond its fields (`configTexts`): a key's text, or each list entry's, with
|
|
39
|
+
* the entry's values beside it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function collectPhiDeclaredConfigTexts(declarations: readonly PhiCmsWidgetConfigText[], config: Readonly<Record<string, unknown>>): PhiConfigTextLocation[];
|
|
42
|
+
/**
|
|
43
|
+
* The config with each located text replaced by its answer, copied only along the paths written; an
|
|
44
|
+
* empty answer keeps the text as written.
|
|
45
|
+
*/
|
|
46
|
+
export declare function writePhiConfigTexts(config: Readonly<Record<string, unknown>>, answers: ReadonlyArray<{
|
|
47
|
+
path: readonly (string | number)[];
|
|
48
|
+
text: string;
|
|
49
|
+
}>): Record<string, unknown>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { isPhiRecord } from "./is-record";
|
|
2
|
+
const TEXT_FIELD_NAMES = {
|
|
3
|
+
label: "label",
|
|
4
|
+
title: "label",
|
|
5
|
+
subtitle: "label",
|
|
6
|
+
placeholder: "label",
|
|
7
|
+
tooltip: "label",
|
|
8
|
+
eyebrow: "label",
|
|
9
|
+
footer: "label",
|
|
10
|
+
alt: "label",
|
|
11
|
+
description: "message",
|
|
12
|
+
};
|
|
13
|
+
const TEXT_FIELD_SUFFIXES = [
|
|
14
|
+
["Label", "label"],
|
|
15
|
+
["Title", "label"],
|
|
16
|
+
["Placeholder", "label"],
|
|
17
|
+
["Description", "message"],
|
|
18
|
+
];
|
|
19
|
+
/** The register a field's name gives it, or null where the name says it is not text. */
|
|
20
|
+
export function readPhiConfigTextRegisterByName(key) {
|
|
21
|
+
const exact = TEXT_FIELD_NAMES[key];
|
|
22
|
+
if (exact)
|
|
23
|
+
return exact;
|
|
24
|
+
for (const [suffix, register] of TEXT_FIELD_SUFFIXES) {
|
|
25
|
+
if (key.length > suffix.length && key.endsWith(suffix))
|
|
26
|
+
return register;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The register of one config field, or null where it is not translated: a `string` field by its name
|
|
32
|
+
* unless the field states `text`, every other type never -- a link, an icon or a choice stores what it
|
|
33
|
+
* means, not what it says.
|
|
34
|
+
*/
|
|
35
|
+
export function readPhiConfigFieldTextRegister(field) {
|
|
36
|
+
if (field.type !== "string")
|
|
37
|
+
return null;
|
|
38
|
+
if (field.text !== undefined)
|
|
39
|
+
return field.text === false ? null : field.text;
|
|
40
|
+
return readPhiConfigTextRegisterByName(field.key);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Every non-empty text a config holds, in field order: the fields themselves and, inside a
|
|
44
|
+
* `collection`, each entry's -- a select's options are its `options[].label`.
|
|
45
|
+
*/
|
|
46
|
+
export function collectPhiConfigTexts(fields, config, prefix = []) {
|
|
47
|
+
const found = [];
|
|
48
|
+
for (const field of fields) {
|
|
49
|
+
const value = config[field.key];
|
|
50
|
+
if (field.type === "collection") {
|
|
51
|
+
if (!Array.isArray(value))
|
|
52
|
+
continue;
|
|
53
|
+
value.forEach((item, index) => {
|
|
54
|
+
if (isPhiRecord(item)) {
|
|
55
|
+
found.push(...collectPhiConfigTexts(field.itemFields, item, [...prefix, field.key, index]));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const register = readPhiConfigFieldTextRegister(field);
|
|
61
|
+
if (register && typeof value === "string" && value.trim()) {
|
|
62
|
+
found.push({ path: [...prefix, field.key], register, text: value });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return found;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The texts a Widget declares beyond its fields (`configTexts`): a key's text, or each list entry's, with
|
|
69
|
+
* the entry's values beside it.
|
|
70
|
+
*/
|
|
71
|
+
export function collectPhiDeclaredConfigTexts(declarations, config) {
|
|
72
|
+
const found = [];
|
|
73
|
+
for (const declaration of declarations) {
|
|
74
|
+
const value = config[declaration.key];
|
|
75
|
+
if (declaration.item === undefined) {
|
|
76
|
+
if (typeof value === "string" && value.trim()) {
|
|
77
|
+
found.push({ path: [declaration.key], register: declaration.register, text: value });
|
|
78
|
+
}
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (!Array.isArray(value))
|
|
82
|
+
continue;
|
|
83
|
+
value.forEach((entry, index) => {
|
|
84
|
+
if (!isPhiRecord(entry))
|
|
85
|
+
return;
|
|
86
|
+
const text = entry[declaration.item];
|
|
87
|
+
if (typeof text !== "string" || !text.trim())
|
|
88
|
+
return;
|
|
89
|
+
const values = declaration.values ? entry[declaration.values] : undefined;
|
|
90
|
+
found.push({
|
|
91
|
+
path: [declaration.key, index, declaration.item],
|
|
92
|
+
register: declaration.register,
|
|
93
|
+
text,
|
|
94
|
+
...(Array.isArray(values) ? { values: values.map((entry) => String(entry)) } : {}),
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return found;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The config with each located text replaced by its answer, copied only along the paths written; an
|
|
102
|
+
* empty answer keeps the text as written.
|
|
103
|
+
*/
|
|
104
|
+
export function writePhiConfigTexts(config, answers) {
|
|
105
|
+
const root = { ...config };
|
|
106
|
+
for (const { path, text } of answers) {
|
|
107
|
+
if (!text.trim())
|
|
108
|
+
continue;
|
|
109
|
+
let target = root;
|
|
110
|
+
for (let index = 0; index < path.length - 1; index += 1) {
|
|
111
|
+
const step = path[index];
|
|
112
|
+
const current = target[step];
|
|
113
|
+
const copy = Array.isArray(current)
|
|
114
|
+
? [...current]
|
|
115
|
+
: { ...current };
|
|
116
|
+
target[step] = copy;
|
|
117
|
+
target = copy;
|
|
118
|
+
}
|
|
119
|
+
target[path[path.length - 1]] = text;
|
|
120
|
+
}
|
|
121
|
+
return root;
|
|
122
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PhiModuleMediaResolver } from "../types/module-media";
|
|
2
|
+
/** A name a preset asked for that the package does not declare in `phis.media`. */
|
|
3
|
+
export type PhiModuleMediaFinding = {
|
|
4
|
+
kind: "asset" | "folder";
|
|
5
|
+
key: string;
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The resolver a Module package hands its own `loadTree` in its verify step, where there is no Core
|
|
10
|
+
* (THIRD_PARTY_MODULES.md, "Checking a Page preset").
|
|
11
|
+
*
|
|
12
|
+
* `assets` and `folders` are the keys the package declares in `phis.media`. A declared key answers a
|
|
13
|
+
* placeholder id -- a stable positive integer, distinct from every other key's -- so the tree is built
|
|
14
|
+
* as on a Site that has imported everything. An undeclared key answers `null` and is recorded: on a
|
|
15
|
+
* real Site it would never resolve. Verify-time only, from `@phis/ui/module/page-check`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createPhiDeclaredMediaResolver(declared?: {
|
|
18
|
+
assets?: readonly string[];
|
|
19
|
+
folders?: readonly string[];
|
|
20
|
+
}): {
|
|
21
|
+
media: PhiModuleMediaResolver;
|
|
22
|
+
findings(): PhiModuleMediaFinding[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolver a Module package hands its own `loadTree` in its verify step, where there is no Core
|
|
3
|
+
* (THIRD_PARTY_MODULES.md, "Checking a Page preset").
|
|
4
|
+
*
|
|
5
|
+
* `assets` and `folders` are the keys the package declares in `phis.media`. A declared key answers a
|
|
6
|
+
* placeholder id -- a stable positive integer, distinct from every other key's -- so the tree is built
|
|
7
|
+
* as on a Site that has imported everything. An undeclared key answers `null` and is recorded: on a
|
|
8
|
+
* real Site it would never resolve. Verify-time only, from `@phis/ui/module/page-check`.
|
|
9
|
+
*/
|
|
10
|
+
export function createPhiDeclaredMediaResolver(declared = {}) {
|
|
11
|
+
const ids = new Map();
|
|
12
|
+
const found = [];
|
|
13
|
+
const answer = (kind, declaredKeys, key) => {
|
|
14
|
+
if (!declaredKeys?.includes(key)) {
|
|
15
|
+
if (!found.some((finding) => finding.kind === kind && finding.key === key)) {
|
|
16
|
+
found.push({ kind, key, message: `${kind} \`${key}\` is not declared in the package's \`phis.media\`.` });
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const id = `${kind}:${key}`;
|
|
21
|
+
if (!ids.has(id))
|
|
22
|
+
ids.set(id, ids.size + 1);
|
|
23
|
+
return ids.get(id);
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
media: {
|
|
27
|
+
asset: async (key) => answer("asset", declared.assets, key),
|
|
28
|
+
folder: async (key) => answer("folder", declared.folders, key),
|
|
29
|
+
},
|
|
30
|
+
findings: () => [...found],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PhiModuleMediaLoader, PhiModuleMediaResolver } from "../types/module-media";
|
|
2
|
+
/**
|
|
3
|
+
* The resolver a preset of `ownerModuleId` is handed: the names of that Module's own package, answered
|
|
4
|
+
* from `load`. `load` runs on the first question only and its promise is kept, so one instantiation asks
|
|
5
|
+
* Core at most once and a preset that asks nothing costs nothing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPhiModuleMediaResolver(ownerModuleId: string, load: PhiModuleMediaLoader): PhiModuleMediaResolver;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readPhiRuntimeModulePackageName } from "../constants/module-identity";
|
|
2
|
+
/**
|
|
3
|
+
* The resolver a preset of `ownerModuleId` is handed: the names of that Module's own package, answered
|
|
4
|
+
* from `load`. `load` runs on the first question only and its promise is kept, so one instantiation asks
|
|
5
|
+
* Core at most once and a preset that asks nothing costs nothing.
|
|
6
|
+
*/
|
|
7
|
+
export function createPhiModuleMediaResolver(ownerModuleId, load) {
|
|
8
|
+
const packageName = readPhiRuntimeModulePackageName(ownerModuleId);
|
|
9
|
+
let mapping = null;
|
|
10
|
+
const read = () => (mapping ??= load());
|
|
11
|
+
return {
|
|
12
|
+
asset: async (key) => (await read()).assets[packageName]?.[key] ?? null,
|
|
13
|
+
folder: async (key) => (await read()).folders[packageName]?.[key] ?? null,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PhiResolvedCmsPageTree } from "../types/cms";
|
|
2
|
+
/**
|
|
3
|
+
* Whose words a Module's Preset writes, as a check (`helpers/text-source.ts`).
|
|
4
|
+
*
|
|
5
|
+
* A Module's Preset says, of every Widget it fills with text, whose words they are: `textSource:
|
|
6
|
+
* "preset"` for the Module's own -- translated once, in the platform's store, on every installation --
|
|
7
|
+
* or `"site"` for what the Site configured and the Preset only places, such as its contact address.
|
|
8
|
+
* Left unsaid, the words would be translated per Site as if an author had written them, and nobody would
|
|
9
|
+
* notice; that is how the Builder's own Area select came to read "Accounting" in German.
|
|
10
|
+
*
|
|
11
|
+
* Run by a Module over the trees its presets build, in its own verify step, beside the Page rule. A Site's
|
|
12
|
+
* own package does not run it: every word in its Pages is the Site's, which is what no marker means.
|
|
13
|
+
*
|
|
14
|
+
* It reads the config as stated, by the field names alone (`helpers/config-text-fields.ts`), so it needs
|
|
15
|
+
* no Widget definition: a text under a text's name, at the top or inside a list's entries.
|
|
16
|
+
*/
|
|
17
|
+
export type PhiPresetTextSourceFinding = {
|
|
18
|
+
/** The node's label, or its id where it has none. */
|
|
19
|
+
node: string;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function checkPhiPresetTextSources(tree: Pick<PhiResolvedCmsPageTree, "contentWidgets">): PhiPresetTextSourceFinding[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readPhiConfigTextRegisterByName } from "./config-text-fields";
|
|
2
|
+
import { readPhiTextSource } from "./text-source";
|
|
3
|
+
import { PhiCmsFlags } from "../constants/phi-cms";
|
|
4
|
+
import { hasPhiFlag } from "./flags";
|
|
5
|
+
function findTextKey(value, depth = 0) {
|
|
6
|
+
if (depth > 4 || value == null || typeof value !== "object")
|
|
7
|
+
return null;
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
for (const item of value) {
|
|
10
|
+
const found = findTextKey(item, depth + 1);
|
|
11
|
+
if (found)
|
|
12
|
+
return found;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
17
|
+
if (typeof entry === "string" && entry.trim() && readPhiConfigTextRegisterByName(key))
|
|
18
|
+
return key;
|
|
19
|
+
if (Array.isArray(entry)) {
|
|
20
|
+
const found = findTextKey(entry, depth + 1);
|
|
21
|
+
if (found)
|
|
22
|
+
return `${key}[].${found}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
export function checkPhiPresetTextSources(tree) {
|
|
28
|
+
const findings = [];
|
|
29
|
+
for (const widget of tree.contentWidgets) {
|
|
30
|
+
if (readPhiTextSource(widget.config.textSource))
|
|
31
|
+
continue;
|
|
32
|
+
// Already in the reader's language, read from a Label Set: nobody translates it.
|
|
33
|
+
if (hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate))
|
|
34
|
+
continue;
|
|
35
|
+
const key = findTextKey(widget.config);
|
|
36
|
+
if (!key)
|
|
37
|
+
continue;
|
|
38
|
+
findings.push({
|
|
39
|
+
node: widget.label?.trim() || String(widget.id),
|
|
40
|
+
message: `writes text ("${key}") without saying whose words it is: state textSource "preset" for the ` +
|
|
41
|
+
`Module's own words or "site" for what the Site configured.`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return findings;
|
|
45
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PhiCmsAreaKey } from "../constants/cms-areas";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a Module's routes keep the rule that a Page is never a folder (THIRD_PARTY_MODULES.md,
|
|
4
|
+
* "Addresses and folders"; phis-server REFERENCES.md, "A Page is never a folder").
|
|
5
|
+
*
|
|
6
|
+
* A route whose path lies beneath another route's path in the same Area makes the upper one a Page and
|
|
7
|
+
* a folder at once: the Builder lists it twice -- the Page, and a folder of the same name beside it --
|
|
8
|
+
* and a Navigation container of the lower Pages gets a folder address that the upper Page shadows. An
|
|
9
|
+
* overview belongs beside the Pages it leads to (`/faq/overview` next to `/faq/hosting`), and the
|
|
10
|
+
* container's `folderTarget` sends `/faq` to it.
|
|
11
|
+
*
|
|
12
|
+
* One nesting is allowed: a list's entries directly beneath the list, `/blog` and `/blog/:slug`. The
|
|
13
|
+
* entries are not Pages of their own in a Navigation -- one route answers every entry -- so no
|
|
14
|
+
* container is built of them and no folder address is shadowed. Anything further down is a Page beneath
|
|
15
|
+
* a Page again: `/blog/:slug/edit` beneath `/blog`, `/blog/archive` beside `/blog/:slug`.
|
|
16
|
+
*
|
|
17
|
+
* Compared by segment, a parameter by its name like any other segment: `/shop/:slug` and `/shop/cart`
|
|
18
|
+
* are siblings. `/` is the Area's root slot and no folder.
|
|
19
|
+
*
|
|
20
|
+
* Verify-time only, from `@phis/ui/module/page-check`: a package runs it over its own routes, and
|
|
21
|
+
* phis-ui over the first-party ones. The Site's own Pages are refused by phis-server when written.
|
|
22
|
+
*/
|
|
23
|
+
export type PhiRouteAddressSubject = {
|
|
24
|
+
area: PhiCmsAreaKey;
|
|
25
|
+
path: string;
|
|
26
|
+
presetKey: string;
|
|
27
|
+
};
|
|
28
|
+
export type PhiRouteAddressFinding = {
|
|
29
|
+
/** The route beneath, by its preset key. */
|
|
30
|
+
route: string;
|
|
31
|
+
/** The route above it, which would be a Page and a folder at once. */
|
|
32
|
+
above: string;
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function checkPhiRouteAddresses(routes: readonly PhiRouteAddressSubject[]): PhiRouteAddressFinding[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function segments(path) {
|
|
2
|
+
return path.split("/").filter(Boolean);
|
|
3
|
+
}
|
|
4
|
+
export function checkPhiRouteAddresses(routes) {
|
|
5
|
+
const findings = [];
|
|
6
|
+
for (const route of routes) {
|
|
7
|
+
const own = segments(route.path);
|
|
8
|
+
for (const other of routes) {
|
|
9
|
+
if (other === route || other.area !== route.area)
|
|
10
|
+
continue;
|
|
11
|
+
const upper = segments(other.path);
|
|
12
|
+
if (upper.length === 0 || upper.length >= own.length)
|
|
13
|
+
continue;
|
|
14
|
+
if (!upper.every((segment, index) => segment === own[index]))
|
|
15
|
+
continue;
|
|
16
|
+
// A list's entries, one parameter directly beneath it.
|
|
17
|
+
if (own.length === upper.length + 1 && own[own.length - 1].startsWith(":"))
|
|
18
|
+
continue;
|
|
19
|
+
findings.push({
|
|
20
|
+
route: route.presetKey,
|
|
21
|
+
above: other.presetKey,
|
|
22
|
+
message: `"${route.path}" lies beneath "${other.path}" (${other.presetKey}) in Area "${route.area}": `
|
|
23
|
+
+ "a Page is never a folder. Put the upper Page beside the others and name it the container's folderTarget.",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return findings;
|
|
28
|
+
}
|
package/helpers/text-source.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PhiCmsConfigField } from "../types/cms-plugins";
|
|
1
2
|
/**
|
|
2
3
|
* Whose words a text Widget holds, which decides the store that translates them.
|
|
3
4
|
*
|
|
@@ -11,9 +12,17 @@
|
|
|
11
12
|
* built, so a Preset that translated its words would freeze one locale into the Site's copy.
|
|
12
13
|
*/
|
|
13
14
|
export declare const PHI_TEXT_SOURCE_PRESET: "preset";
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The Site's words written by a Preset: what the Site configured -- its contact address, its name --
|
|
17
|
+
* placed into a Widget by a Module's Preset. Stated, not left out, so that a Module's Preset says of
|
|
18
|
+
* every Widget with text whose words it holds (`helpers/preset-text-source-check.ts`); it is read like
|
|
19
|
+
* no marker at all, and the Site's store translates them.
|
|
20
|
+
*/
|
|
21
|
+
export declare const PHI_TEXT_SOURCE_SITE: "site";
|
|
22
|
+
export type PhiTextSource = typeof PHI_TEXT_SOURCE_PRESET | typeof PHI_TEXT_SOURCE_SITE;
|
|
15
23
|
export declare function readPhiTextSource(value: unknown): PhiTextSource | undefined;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether a Builder edit of this field ends the Preset's ownership of the Widget's words: a text
|
|
26
|
+
* field's, or a list's whose entries hold text -- a select's options.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isPhiAuthoredTextField(field: PhiCmsConfigField): boolean;
|
package/helpers/text-source.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readPhiConfigFieldTextRegister } from "./config-text-fields";
|
|
1
2
|
/**
|
|
2
3
|
* Whose words a text Widget holds, which decides the store that translates them.
|
|
3
4
|
*
|
|
@@ -11,10 +12,22 @@
|
|
|
11
12
|
* built, so a Preset that translated its words would freeze one locale into the Site's copy.
|
|
12
13
|
*/
|
|
13
14
|
export const PHI_TEXT_SOURCE_PRESET = "preset";
|
|
15
|
+
/**
|
|
16
|
+
* The Site's words written by a Preset: what the Site configured -- its contact address, its name --
|
|
17
|
+
* placed into a Widget by a Module's Preset. Stated, not left out, so that a Module's Preset says of
|
|
18
|
+
* every Widget with text whose words it holds (`helpers/preset-text-source-check.ts`); it is read like
|
|
19
|
+
* no marker at all, and the Site's store translates them.
|
|
20
|
+
*/
|
|
21
|
+
export const PHI_TEXT_SOURCE_SITE = "site";
|
|
14
22
|
export function readPhiTextSource(value) {
|
|
15
|
-
return value === PHI_TEXT_SOURCE_PRESET ? value : undefined;
|
|
23
|
+
return value === PHI_TEXT_SOURCE_PRESET || value === PHI_TEXT_SOURCE_SITE ? value : undefined;
|
|
16
24
|
}
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Whether a Builder edit of this field ends the Preset's ownership of the Widget's words: a text
|
|
27
|
+
* field's, or a list's whose entries hold text -- a select's options.
|
|
28
|
+
*/
|
|
18
29
|
export function isPhiAuthoredTextField(field) {
|
|
19
|
-
|
|
30
|
+
if (field.type === "collection")
|
|
31
|
+
return field.itemFields.some(isPhiAuthoredTextField);
|
|
32
|
+
return readPhiConfigFieldTextRegister(field) != null;
|
|
20
33
|
}
|
package/module-page-check.d.ts
CHANGED
|
@@ -9,4 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* No `server-only` here, on purpose: a test in a package loads this door without a mock.
|
|
11
11
|
*/
|
|
12
|
+
export { createPhiDeclaredMediaResolver, type PhiModuleMediaFinding } from "./helpers/module-media-check";
|
|
12
13
|
export { checkPhiPagePresetLayout, type PhiPageLayoutFinding } from "./helpers/page-layout-check";
|
|
14
|
+
export { checkPhiPresetTextSources, type PhiPresetTextSourceFinding } from "./helpers/preset-text-source-check";
|
|
15
|
+
export { checkPhiRouteAddresses, type PhiRouteAddressFinding, type PhiRouteAddressSubject } from "./helpers/route-address-check";
|
package/module-page-check.js
CHANGED
|
@@ -9,4 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* No `server-only` here, on purpose: a test in a package loads this door without a mock.
|
|
11
11
|
*/
|
|
12
|
+
export { createPhiDeclaredMediaResolver } from "./helpers/module-media-check";
|
|
12
13
|
export { checkPhiPagePresetLayout } from "./helpers/page-layout-check";
|
|
14
|
+
export { checkPhiPresetTextSources } from "./helpers/preset-text-source-check";
|
|
15
|
+
export { checkPhiRouteAddresses } from "./helpers/route-address-check";
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export function PhiSlotChildFrameView({ kind, slotSizePolicy, surfacePolicy, blo
|
|
|
31
31
|
* whatever reads its attributes, and a frame carrying a width of its own while announcing "fill"
|
|
32
32
|
* makes every reader below it wrong in the same way at once.
|
|
33
33
|
*/
|
|
34
|
-
const policy = resolvePhiEffectiveSlotSizePolicy(resolvePhiSlotSizePolicy(slotSizePolicy, kind), {
|
|
34
|
+
const policy = resolvePhiEffectiveSlotSizePolicy(resolvePhiSlotSizePolicy(slotSizePolicy, kind, config), {
|
|
35
35
|
explicitInlineSize: resolvedExplicitInlineSize,
|
|
36
36
|
explicitBlockSize: resolvedExplicitBlockSize,
|
|
37
37
|
});
|