@homepages/concrete 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/codemods/manifest.json +5 -158
- package/dist/artifact/playground/client/assets/index-ByeGGedv.js +1259 -0
- package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +1 -0
- package/dist/artifact/playground/client/index.html +2 -2
- package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
- package/dist/artifact/playground/host.mjs +26 -26
- package/dist/base.css +1 -8
- package/dist/cli/build/artifact.js +1 -1
- package/dist/cli/build/fixtures.js +3 -2
- package/dist/cli/check/stages/sections.js +1 -1
- package/dist/cli/dev/workspace-reader.js +3 -2
- package/dist/css/compile.js +3 -6
- package/dist/css/rules.js +1 -51
- package/dist/design-system/format-variants.js +1 -1
- package/dist/fixtures/resolve.js +5 -1
- package/dist/fixtures/rows.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +3 -14
- package/dist/packages/internal/media-resolution/dist/document.js +3 -3
- package/dist/packages/internal/media-resolution/dist/image.js +3 -3
- package/dist/packages/internal/media-resolution/dist/tour.js +6 -6
- package/dist/packages/internal/media-resolution/dist/video.js +9 -9
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +1 -3
- package/dist/packages/internal/section-contracts/dist/source-contract.js +3 -3
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +0 -2
- package/dist/packages/internal/template-artifact/dist/index.js +2 -2
- package/dist/packages/internal/template-artifact/dist/layout.js +11 -11
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +13 -17
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +3 -5
- package/dist/packages/internal/template-contracts/dist/fill-builders.js +2 -6
- package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +4 -1
- package/dist/packages/internal/template-contracts/dist/list.js +0 -14
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +1 -1
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +6 -7
- package/dist/packages/internal/template-contracts/dist/slot-builders.js +0 -2
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +6 -1
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +2 -4
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +3 -4
- package/dist/primitives/Image.d.ts +2 -2
- package/dist/primitives/Tour.d.ts +2 -2
- package/dist/primitives/Video.d.ts +2 -2
- package/dist/primitives/slot-bindings.js +6 -13
- package/dist/primitives/slot-document.d.ts +1 -1
- package/dist/primitives/slot-download.d.ts +3 -1
- package/dist/primitives/slot-media.d.ts +5 -2
- package/dist/primitives/slot-media.js +1 -1
- package/dist/rules/registry.js +0 -6
- package/dist/schema/format-presets.d.ts +1 -1
- package/dist/schema/section-schema.d.ts +5 -5
- package/dist/styles.css +4 -4
- package/dist/template/define-template.js +0 -1
- package/guide/reference/cli/INDEX.md +2 -2
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +1 -1
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +1 -1
- package/guide/reference/cli/publish.md +1 -1
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +1 -2
- package/package.json +2 -2
- package/codemods/fill-is-a-source.mjs +0 -533
- package/codemods/framework-namespace.mjs +0 -107
- package/codemods/list-grammar.mjs +0 -923
- package/codemods/object-form-only.mjs +0 -39
- package/codemods/platform-namespace.mjs +0 -83
- package/codemods/process-builders.mjs +0 -198
- package/codemods/reads-replace-reconcile.mjs +0 -285
- package/codemods/registry-keys-only.mjs +0 -113
- package/codemods/slot-object.mjs +0 -1097
- package/codemods/steps/content-object-fields.mjs +0 -324
- package/codemods/steps/list-object-form.mjs +0 -686
- package/codemods/steps/registry-key-reads.mjs +0 -276
- package/codemods/steps/select-object-form.mjs +0 -210
- package/codemods/table-rows.mjs +0 -568
- package/codemods/theme-collapse.mjs +0 -396
- package/codemods/unlayer-author-css.mjs +0 -194
- package/codemods/unwrap-object-fields.mjs +0 -310
- package/codemods/viewer-slot-document.mjs +0 -131
- package/codemods/write-property-as-facts-document.mjs +0 -716
- package/codemods/write-the-address-line.mjs +0 -255
- package/codemods/write-the-registry-members.mjs +0 -653
- package/codemods/write-the-select-from.mjs +0 -141
- package/codemods/write-the-sole-from.mjs +0 -369
- package/codemods/write-the-table-from.mjs +0 -267
- package/codemods/write-the-whole-item.mjs +0 -512
- package/codemods/writeback-drop.mjs +0 -168
- package/codemods/written-contact-address.mjs +0 -162
- package/codemods/written-media-category.mjs +0 -227
- package/codemods/written-ref-kinds-name-the-layer.mjs +0 -172
- package/codemods/written-uploads-replace-pool-reads.mjs +0 -454
- package/codemods/written-uploads-sort-into-lists.mjs +0 -405
- package/codemods/written-uploads-stated-in-sorted-lists.mjs +0 -295
- package/codemods/written-video-sources-drop.mjs +0 -144
- package/codemods/written-without-pick-none.mjs +0 -146
- package/codemods/written-without-retired-knowledge.mjs +0 -223
- package/codemods/written-without-the-media-key.mjs +0 -202
- package/codemods/written-without-the-property-type.mjs +0 -249
- package/dist/artifact/playground/client/assets/index-BFNHB7VM.css +0 -1
- package/dist/artifact/playground/client/assets/index-Div1yo6s.js +0 -1259
package/dist/base.css
CHANGED
|
@@ -13,14 +13,7 @@
|
|
|
13
13
|
* layered outright. That is stock Tailwind v4 and it is the whole model —
|
|
14
14
|
* what you write is what applies. If you want a utility to win over a rule of
|
|
15
15
|
* yours, put that rule in Tailwind's own `@layer components`.
|
|
16
|
-
|
|
17
|
-
* `sections` and `template` used to sit here, between `components` and
|
|
18
|
-
* `utilities`, and the old kit's build folded every section's hand-CSS into
|
|
19
|
-
* them. A declaration there lost to any utility setting the same property on
|
|
20
|
-
* the same element, however specific its selector — silently, and only on the
|
|
21
|
-
* published page, because the dev server served the same CSS unlayered. That
|
|
22
|
-
* shipped defects to live customers twice before anyone went looking. The
|
|
23
|
-
* layers are gone; `check` refuses author CSS that declares them.
|
|
16
|
+
|
|
24
17
|
* - The three reset gaps Tailwind's preflight leaves (below)
|
|
25
18
|
* - The section box model (.concrete-section, emitted by the <Section> primitive)
|
|
26
19
|
* - The frame shell's static half (.concrete-frame, emitted by the <FrameShell> primitive)
|
|
@@ -175,7 +175,7 @@ async function buildArtifact(options) {
|
|
|
175
175
|
for (const key of builtByKey.keys()) sectionHashes.set(key, sectionContentHash(files, key));
|
|
176
176
|
const sourceFiles = await collectSourceFiles(root, [out]);
|
|
177
177
|
const artifactManifest = ArtifactManifest.parse({
|
|
178
|
-
artifact_schema:
|
|
178
|
+
artifact_schema: 4,
|
|
179
179
|
framework_version: CONCRETE_CLI_VERSION,
|
|
180
180
|
key: template.key,
|
|
181
181
|
display_name: template.name,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ASSET_URL_PREFIX, FIXTURE_FILES,
|
|
1
|
+
import { ASSET_URL_PREFIX, FIXTURE_FILES, fixturePath, isFixtureId } from "../../packages/internal/template-artifact/dist/layout.js";
|
|
2
2
|
import "../../packages/internal/template-artifact/dist/index.js";
|
|
3
3
|
import { assetContentType } from "../../packages/internal/template-artifact/dist/asset-mime.js";
|
|
4
4
|
import { mediaUrl } from "../../fixtures/property.js";
|
|
5
|
+
import { authoredSettled } from "../../fixtures/resolve.js";
|
|
5
6
|
import { basename } from "node:path";
|
|
6
7
|
import { readFile } from "node:fs/promises";
|
|
7
8
|
|
|
@@ -70,7 +71,7 @@ async function fixtureFiles(input) {
|
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
files.set(fixturePath(fixture.id, FIXTURE_FILES.contentDoc), json(fixture.contentDoc));
|
|
73
|
-
|
|
74
|
+
files.set(fixturePath(fixture.id, FIXTURE_FILES.settledDoc), json({ instances: authoredSettled(fixture) }));
|
|
74
75
|
files.set(fixturePath(fixture.id, FIXTURE_FILES.property), json({
|
|
75
76
|
facts: rewriteUrls(fixture.facts, urls),
|
|
76
77
|
media
|
|
@@ -16,6 +16,7 @@ function flatten(parsed, key) {
|
|
|
16
16
|
const { meta, ...rest } = parsed;
|
|
17
17
|
return {
|
|
18
18
|
...rest,
|
|
19
|
+
slot_order: Object.keys(rest.slots),
|
|
19
20
|
anchor: meta.anchor ?? key,
|
|
20
21
|
...meta.display ? { display: meta.display } : {}
|
|
21
22
|
};
|
|
@@ -92,7 +93,6 @@ function sectionsStage(ctx) {
|
|
|
92
93
|
const materialized = materializeSection(section);
|
|
93
94
|
try {
|
|
94
95
|
const parsed = SectionSchema.parse(materialized);
|
|
95
|
-
parsed.slot_order = Object.keys(parsed.slots);
|
|
96
96
|
for (const slot of Object.values(parsed.slots)) {
|
|
97
97
|
if (slot.type === "object") stampItemOrder(slot);
|
|
98
98
|
if (slot.type === "list" && slot.element?.type === "object") stampItemOrder(slot.element);
|
|
@@ -4,7 +4,7 @@ import "../../packages/internal/template-contracts/dist/table-members.js";
|
|
|
4
4
|
import { compileTemplateCss } from "../../css/compile.js";
|
|
5
5
|
import { materializeTemplate } from "../../template/materialize.js";
|
|
6
6
|
import { loadFixtures } from "../../fixtures/load.js";
|
|
7
|
-
import { computeReadsSectionOf, resolveFixture } from "../../fixtures/resolve.js";
|
|
7
|
+
import { authoredSettled, computeReadsSectionOf, resolveFixture } from "../../fixtures/resolve.js";
|
|
8
8
|
import { materializeSection } from "../../section/materialize.js";
|
|
9
9
|
import { loadTemplateModule } from "./load-template.js";
|
|
10
10
|
import { createElement } from "react";
|
|
@@ -52,7 +52,7 @@ function hostFixture(fixture, sizeOf) {
|
|
|
52
52
|
facts: fixture.facts,
|
|
53
53
|
media,
|
|
54
54
|
instances: fixture.contentDoc.instances,
|
|
55
|
-
|
|
55
|
+
settled: authoredSettled(fixture),
|
|
56
56
|
provenance: fixture.provenance
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -183,6 +183,7 @@ var DevWorkspace = class {
|
|
|
183
183
|
return Promise.resolve({
|
|
184
184
|
map: islands.map,
|
|
185
185
|
canvasHost: islands.canvasHost,
|
|
186
|
+
importMap: {},
|
|
186
187
|
documentLoader: islands.previewHost === null || Object.keys(islands.map).length === 0 ? { kind: "none" } : {
|
|
187
188
|
kind: "viteModules",
|
|
188
189
|
islandMap: islands.map,
|
package/dist/css/compile.js
CHANGED
|
@@ -3,7 +3,7 @@ import { NON_SOURCE_DIRS } from "../cli/workspace.js";
|
|
|
3
3
|
import { compileFormatVariantsToCss } from "../design-system/format-variants.js";
|
|
4
4
|
import { collectCssGraph } from "./graph.js";
|
|
5
5
|
import { inlineCssGraph } from "./inline.js";
|
|
6
|
-
import { externalUrlViolations,
|
|
6
|
+
import { externalUrlViolations, tailwindImportViolations } from "./rules.js";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join } from "node:path";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -69,15 +69,12 @@ async function compileTemplateCss(input) {
|
|
|
69
69
|
violations: importViolations
|
|
70
70
|
};
|
|
71
71
|
const css = await compileTailwind(input.root, buildTailwindEntry(inlined.css, input.template), input.exclude ?? []);
|
|
72
|
-
const violations = [
|
|
73
|
-
root: input.root,
|
|
74
|
-
sources: graph
|
|
75
|
-
}), ...input.template.output === "website" ? [] : await externalUrlViolations({
|
|
72
|
+
const violations = input.template.output === "website" ? [] : await externalUrlViolations({
|
|
76
73
|
root: input.root,
|
|
77
74
|
templateFile: input.templateFile,
|
|
78
75
|
css,
|
|
79
76
|
sources: graph
|
|
80
|
-
})
|
|
77
|
+
});
|
|
81
78
|
const bytes = new TextEncoder().encode(css);
|
|
82
79
|
const contentHash = createHash("sha256").update(bytes).digest("hex");
|
|
83
80
|
return {
|
package/dist/css/rules.js
CHANGED
|
@@ -15,56 +15,6 @@ function tailwindImportViolations(input) {
|
|
|
15
15
|
message: `a second @import "tailwindcss" (the first is in ${first}). The import graph owns exactly one; remove this one.`
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
-
const RETIRED_LAYERS = /* @__PURE__ */ new Set(["sections", "template"]);
|
|
19
|
-
function maskNonCode(css) {
|
|
20
|
-
const out = [...css];
|
|
21
|
-
const blank = (from, to) => {
|
|
22
|
-
for (let k = from; k < Math.min(to, css.length); k += 1) if (out[k] !== "\n") out[k] = " ";
|
|
23
|
-
};
|
|
24
|
-
for (let i = 0; i < css.length;) if (css[i] === "/" && css[i + 1] === "*") {
|
|
25
|
-
const end = css.indexOf("*/", i + 2);
|
|
26
|
-
const stop = end === -1 ? css.length : end + 2;
|
|
27
|
-
blank(i, stop);
|
|
28
|
-
i = stop;
|
|
29
|
-
} else if (css[i] === "\"" || css[i] === "'") {
|
|
30
|
-
const quote = css[i];
|
|
31
|
-
let k = i + 1;
|
|
32
|
-
while (k < css.length && css[k] !== quote) k += css[k] === "\\" ? 2 : 1;
|
|
33
|
-
blank(i, k + 1);
|
|
34
|
-
i = k + 1;
|
|
35
|
-
} else i += 1;
|
|
36
|
-
return out.join("");
|
|
37
|
-
}
|
|
38
|
-
const AT_LAYER_RE = /@layer\s+([^;{]+)[;{]/gi;
|
|
39
|
-
const LAYER_FN_RE = /\blayer\(\s*([^)]*?)\s*\)/gi;
|
|
40
|
-
function declaredLayerRoots(css) {
|
|
41
|
-
const source = maskNonCode(css);
|
|
42
|
-
const roots = [];
|
|
43
|
-
for (const re of [AT_LAYER_RE, LAYER_FN_RE]) {
|
|
44
|
-
re.lastIndex = 0;
|
|
45
|
-
for (let m = re.exec(source); m !== null; m = re.exec(source)) for (const name of (m[1] ?? "").split(",")) {
|
|
46
|
-
const root = name.trim().split(".")[0]?.trim();
|
|
47
|
-
if (root !== void 0 && root !== "") roots.push(root);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return roots;
|
|
51
|
-
}
|
|
52
|
-
async function retiredLayerViolations(input) {
|
|
53
|
-
const violations = [];
|
|
54
|
-
for (const file of input.sources) {
|
|
55
|
-
const seen = /* @__PURE__ */ new Set();
|
|
56
|
-
for (const layer of declaredLayerRoots(await readFile(file, "utf8"))) {
|
|
57
|
-
if (!RETIRED_LAYERS.has(layer) || seen.has(layer)) continue;
|
|
58
|
-
seen.add(layer);
|
|
59
|
-
violations.push({
|
|
60
|
-
rule: "css/retired-layer",
|
|
61
|
-
file: workspacePath(input.root, file),
|
|
62
|
-
message: `declares @layer ${layer}, which @homepages/concrete retired. Your CSS is not layered: delete the wrapper and a plain rule outranks every utility setting the same property. To demote someone else's stylesheet instead, import it into a layer of your own naming — @import "pkg/x.css" layer(components).`
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return violations;
|
|
67
|
-
}
|
|
68
18
|
const EXTERNAL_RE = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
69
19
|
const INLINE_RE = /^data:/i;
|
|
70
20
|
const URL_FUNCTION_RE = /url\(\s*(['"]?)([^'")\s]+)\1\s*\)/gi;
|
|
@@ -96,4 +46,4 @@ async function externalUrlViolations(input) {
|
|
|
96
46
|
}
|
|
97
47
|
|
|
98
48
|
//#endregion
|
|
99
|
-
export {
|
|
49
|
+
export { externalUrlViolations, findExternalUrls, tailwindImportViolations };
|
|
@@ -89,7 +89,7 @@ const RESERVED_FORMAT_VARIANT_NAMES = /* @__PURE__ */ new Set([
|
|
|
89
89
|
]);
|
|
90
90
|
function formatVariantNameError(id) {
|
|
91
91
|
if (!VARIANT_NAME_RE.test(id)) return `Format id "${id}" cannot become a Tailwind variant: ids are kebab-case — [a-z0-9] groups separated by single hyphens.`;
|
|
92
|
-
if (RESERVED_FORMAT_VARIANT_NAMES.has(id)) return `Format id "${id}" shadows a reserved Tailwind variant name; pick an id that is not a
|
|
92
|
+
if (RESERVED_FORMAT_VARIANT_NAMES.has(id)) return `Format id "${id}" shadows a reserved Tailwind variant name; pick an id that is not a Concrete breakpoint or Tailwind built-in.`;
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
function compileFormatVariantsToCss(formats) {
|
package/dist/fixtures/resolve.js
CHANGED
|
@@ -15,6 +15,10 @@ import { canonicalizeProperty, contactImageId } from "./property.js";
|
|
|
15
15
|
import { blankForField } from "./rows.js";
|
|
16
16
|
|
|
17
17
|
//#region src/fixtures/resolve.ts
|
|
18
|
+
function authoredSettled(fixture) {
|
|
19
|
+
if (fixture.settled === void 0) throw new Error(`Fixture "${fixture.id}" is synthesized: it carries no settled doc, and no playground serves it.`);
|
|
20
|
+
return fixture.settled;
|
|
21
|
+
}
|
|
18
22
|
const VALIDATED_KINDS = {
|
|
19
23
|
date: {
|
|
20
24
|
admits: (value) => value === null || isIsoDateValue(value),
|
|
@@ -385,4 +389,4 @@ function mediaRef(def, value, ctx) {
|
|
|
385
389
|
}
|
|
386
390
|
|
|
387
391
|
//#endregion
|
|
388
|
-
export { computeReadsSectionOf, emptyValueFor, isEmptyValue, resolveFixture, uniquePlacements };
|
|
392
|
+
export { authoredSettled, computeReadsSectionOf, emptyValueFor, isEmptyValue, resolveFixture, uniquePlacements };
|
package/dist/fixtures/rows.js
CHANGED
|
@@ -7,13 +7,13 @@ function blankForField(def) {
|
|
|
7
7
|
case "email":
|
|
8
8
|
case "phone": return "";
|
|
9
9
|
case "video": return {
|
|
10
|
-
|
|
10
|
+
id: "",
|
|
11
11
|
url: "",
|
|
12
12
|
poster: "",
|
|
13
13
|
alt: ""
|
|
14
14
|
};
|
|
15
15
|
case "tour": return {
|
|
16
|
-
|
|
16
|
+
id: "",
|
|
17
17
|
url: "",
|
|
18
18
|
poster: "",
|
|
19
19
|
alt: ""
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { ATTR_ISLAND_FRAMELESS, ATTR_ISLAND_ID, ATTR_ISLAND_PROPS, EDITOR_BRIDGE
|
|
|
3
3
|
import "./asset-modules.js";
|
|
4
4
|
import { AddressValue } from "./packages/internal/template-contracts/dist/address-value.js";
|
|
5
5
|
import { ResponsiveImage, ResponsiveSource } from "./packages/internal/template-contracts/dist/responsive-image.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { DocumentValue } from "./packages/internal/template-contracts/dist/document-value.js";
|
|
7
|
+
import { TourValue } from "./packages/internal/template-contracts/dist/tour-value.js";
|
|
8
|
+
import { VideoValue } from "./packages/internal/template-contracts/dist/video-value.js";
|
|
9
9
|
import { PoiPhoto, PoiRow } from "./packages/internal/template-contracts/dist/poi-row.js";
|
|
10
|
-
import { AuthorImage,
|
|
10
|
+
import { AuthorImage, ImageValue, MediaValue, PlaybackConfig } from "./packages/internal/template-contracts/dist/runtime-values.js";
|
|
11
11
|
import { ComputeBinding, compute } from "./packages/internal/template-contracts/dist/compute.js";
|
|
12
12
|
import { AddressMembers, ElementOf, RowId, TableRow } from "./packages/internal/template-contracts/dist/row-ref.js";
|
|
13
13
|
import { ItemIdentity, ObjectValue, SlotValue } from "./packages/internal/template-contracts/dist/slot-value.js";
|
|
@@ -58,4 +58,4 @@ import { a4Landscape, a4Portrait, deck16x9, facebookPost, halfLetterFlyer, insta
|
|
|
58
58
|
*/
|
|
59
59
|
declare const CONCRETE_VERSION: string;
|
|
60
60
|
//#endregion
|
|
61
|
-
export { ATTR_ISLAND_FRAMELESS, ATTR_ISLAND_ID, ATTR_ISLAND_KEY, ATTR_ISLAND_PROPS, ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE, type AddressMembers, type AddressSlot, type AddressSlotDef, type AddressValue, type AuthorImage, type AutocropInput, type AutocropProcess, type BoundSlotValue, CONCRETE_VERSION, type CanvasInput, type CanvasesInput, type ComputeBinding, type Coordinates, type CropConfig, type CutoutProcess, type DateSlot, type DateSlotDef, type DefineTemplateInput, type DerivedFactRef, type DisplayEntryInput, type DisplayFill, type
|
|
61
|
+
export { ATTR_ISLAND_FRAMELESS, ATTR_ISLAND_ID, ATTR_ISLAND_KEY, ATTR_ISLAND_PROPS, ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE, type AddressMembers, type AddressSlot, type AddressSlotDef, type AddressValue, type AuthorImage, type AutocropInput, type AutocropProcess, type BoundSlotValue, CONCRETE_VERSION, type CanvasInput, type CanvasesInput, type ComputeBinding, type Coordinates, type CropConfig, type CutoutProcess, type DateSlot, type DateSlotDef, type DefineTemplateInput, type DerivedFactRef, type DisplayEntryInput, type DisplayFill, type DocumentFormat, type DocumentMedia, type DocumentSlot, type DocumentSlotDef, type DocumentValue, EDITOR_BRIDGE_PROP, EDITOR_BRIDGE_PROTOCOL, EditorBridge, EditorBridgeSelection, EditorSelection, type ElementOf, type ElementRef, type EmailSlot, type EmailSlotDef, type FactNamespace, type FactsCommercialSpace, type FactsComparable, type FactsContact, type FactsUnit, type FieldBinding, type FieldBindings, type FillBinding, type FillVerb, type FindFill, type FindInput, type FormatIdentity, FrameShell, type HolderProcess, ISLAND_CAPTURE_HOLDS_GLOBAL, ISLAND_ELEMENT, type IconName, Image, type ImageFormat, type ImageMedia, type ImageSlot, type ImageSlotDef, type ImageValue, IslandComponent, IslandEditor, IslandEditorOptions, IslandMarker, type IslandMarkerProps, IslandModule, IslandProps, IslandPropsError, IslandServerFrame, type ItemBinding, type ItemIdentity, type ListFill, type ListItemSlot, type ListSlot, type ListSlotDef, type ListSourceInput, type Media, type MediaSlot, type MediaSlotDef, type MediaValue, type NumberSlot, type NumberSlotDef, type ObjectBinding, type ObjectFieldSlot, type ObjectLabelField, type ObjectLabelSource, type ObjectSlot, type ObjectSlotDef, type ObjectValue, type OutputClass, type PageComponent, type PhoneSlot, type PhoneSlotDef, type PhysicalLength, type PickFill, type PickInput, type PicturePlan, type PictureSourceSpec, type PlaybackConfig, type PoiPhoto, type PoiRow, type PoiSlot, type PoiSlotDef, type RegistryFactRef, type RenderedPage, type ResponsiveImage, type ResponsiveSource, type RowFill, type RowId, type RowRef, type RowSlot, type RowSlotDef, type RowSourceInput, Section, type SectionContractProps, type SectionOptions, type SectionPlacementProps, type SectionRenderBindings, type SectionValue, type SelectOptionInput, type SelectOptionObject, type SelectSlot, type SelectSlotDef, Slot, type SlotBinding, type SlotBindingMap, type SlotRef, type SlotSource, type SlotValue, type TableRow, type TableSource, type TemplateCanvas, type TemplatePage, type TemplatePreview, type TemplateScope, type TemplateValue, type TextSlot, type TextSlotDef, Tour, type TourMedia, type TourSlot, type TourSlotDef, type TourValue, type UrlSlot, type UrlSlotDef, type UseEditorResult, type ValueBinding, type ValueSlot, Video, type VideoMedia, type VideoSlot, type VideoSlotDef, type VideoValue, type WebsiteFormat, type WebsitePage, type WriteFill, type WriteInput, a4Landscape, a4Portrait, address, bindItems, compute, date, deck16x9, defineTemplate, deserializeIslandProps, document, email, facebookPost, fact, fill, halfLetterFlyer, image, instagramPortrait, instagramSquare, instagramStory, islandId, letterLandscape, letterPortrait, linkedinPost, list, media, number, object, phone, poi, postcard6x4, postcard7x5, presets, holderProcess as process, row, section, select, serializeIslandProps, text, tour, url, useCaptureReady, useEditor, useIslandId, video, website, xPost };
|
|
@@ -3,17 +3,6 @@ import { listItemFieldsOf } from "../../template-contracts/dist/row-sources.js";
|
|
|
3
3
|
import "./row-planners.js";
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/fill-vocabulary/dist/holder.js
|
|
6
|
-
const LEGACY_COLLECTION_ITEM = {
|
|
7
|
-
image_collection: "image",
|
|
8
|
-
video_collection: "video",
|
|
9
|
-
poi_list: "poi"
|
|
10
|
-
};
|
|
11
|
-
function isListSlot(slot) {
|
|
12
|
-
return slot.type === "list" || slot.type !== void 0 && slot.type in LEGACY_COLLECTION_ITEM;
|
|
13
|
-
}
|
|
14
|
-
function listItemTypeOf(slot) {
|
|
15
|
-
return slot.element?.type ?? LEGACY_COLLECTION_ITEM[slot.type ?? ""];
|
|
16
|
-
}
|
|
17
6
|
function poolOfKind(kind) {
|
|
18
7
|
return kind === void 0 ? void 0 : poolingPrimitiveOf({ type: kind });
|
|
19
8
|
}
|
|
@@ -22,14 +11,14 @@ function bindsElement(field) {
|
|
|
22
11
|
return field.type !== "row" && source?.kind === "element";
|
|
23
12
|
}
|
|
24
13
|
function holderOf(slot) {
|
|
25
|
-
if (
|
|
14
|
+
if (slot.type !== "list") return {
|
|
26
15
|
shape: "one",
|
|
27
16
|
type: slot.type
|
|
28
17
|
};
|
|
29
18
|
const fields = listItemFieldsOf(slot);
|
|
30
19
|
if (fields === void 0) return {
|
|
31
20
|
shape: "list",
|
|
32
|
-
item:
|
|
21
|
+
item: slot.element?.type
|
|
33
22
|
};
|
|
34
23
|
const bound = slot.source?.kind === "home" ? slot.source.key : void 0;
|
|
35
24
|
return {
|
|
@@ -48,4 +37,4 @@ function holderLabel(holder) {
|
|
|
48
37
|
}
|
|
49
38
|
|
|
50
39
|
//#endregion
|
|
51
|
-
export { bindsElement, holderLabel, holderOf, isFactBound,
|
|
40
|
+
export { bindsElement, holderLabel, holderOf, isFactBound, poolOfKind };
|
|
@@ -3,7 +3,7 @@ import { readLadder } from "./store.js";
|
|
|
3
3
|
|
|
4
4
|
//#region ../../internal/media-resolution/dist/document.js
|
|
5
5
|
const DEFAULT = {
|
|
6
|
-
|
|
6
|
+
id: "",
|
|
7
7
|
url: "",
|
|
8
8
|
filename: "",
|
|
9
9
|
content_type: "",
|
|
@@ -16,7 +16,7 @@ async function withPreview(out, previewKey, store) {
|
|
|
16
16
|
out.poster = await store.fileUrl(previewKey);
|
|
17
17
|
} catch (err) {
|
|
18
18
|
store.log?.warn({
|
|
19
|
-
media_id: out.
|
|
19
|
+
media_id: out.id,
|
|
20
20
|
err: err.message
|
|
21
21
|
}, "resolve-document-slot: preview presign failed; no poster");
|
|
22
22
|
return out;
|
|
@@ -44,7 +44,7 @@ async function resolveDocumentSlot(value, records, store) {
|
|
|
44
44
|
try {
|
|
45
45
|
const filename = (v.picked === null && typeof v.name === "string" && v.name !== "" ? v.name : null) ?? record.name;
|
|
46
46
|
return await withPreview({
|
|
47
|
-
|
|
47
|
+
id: mediaId,
|
|
48
48
|
url: store.namedFileUrl ? await store.namedFileUrl(key, filename) : await store.fileUrl(key),
|
|
49
49
|
filename,
|
|
50
50
|
content_type: record.mime ?? "",
|
|
@@ -6,7 +6,7 @@ import { placeCrop, storedCrop } from "../../template-contracts/dist/content-pic
|
|
|
6
6
|
//#region ../../internal/media-resolution/dist/image.js
|
|
7
7
|
function emptyImage() {
|
|
8
8
|
return {
|
|
9
|
-
|
|
9
|
+
id: "",
|
|
10
10
|
url: "",
|
|
11
11
|
alt: ""
|
|
12
12
|
};
|
|
@@ -109,7 +109,7 @@ async function resolveImageValue(value, records, store, aspects) {
|
|
|
109
109
|
let desktopKey;
|
|
110
110
|
if (placedKey) {
|
|
111
111
|
base = {
|
|
112
|
-
|
|
112
|
+
id: photoId,
|
|
113
113
|
url: await store.servedUrl(placedKey),
|
|
114
114
|
alt
|
|
115
115
|
};
|
|
@@ -124,7 +124,7 @@ async function resolveImageValue(value, records, store, aspects) {
|
|
|
124
124
|
mobileKey
|
|
125
125
|
};
|
|
126
126
|
base = {
|
|
127
|
-
|
|
127
|
+
id: photoId,
|
|
128
128
|
url: served.url,
|
|
129
129
|
alt
|
|
130
130
|
};
|
|
@@ -4,7 +4,7 @@ import { readLadder } from "./store.js";
|
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/media-resolution/dist/tour.js
|
|
6
6
|
const DEFAULT = {
|
|
7
|
-
|
|
7
|
+
id: "",
|
|
8
8
|
url: "",
|
|
9
9
|
poster: "",
|
|
10
10
|
alt: ""
|
|
@@ -23,12 +23,12 @@ async function resolveTourSlot(value, records, store) {
|
|
|
23
23
|
if (!tourId) return DEFAULT;
|
|
24
24
|
const record = records.get(tourId);
|
|
25
25
|
if (record === void 0) {
|
|
26
|
-
store.log?.warn({
|
|
26
|
+
store.log?.warn({ media_id: tourId }, "resolve-tour-slot: no tour media the render may reach");
|
|
27
27
|
return DEFAULT;
|
|
28
28
|
}
|
|
29
29
|
if (record.kind !== "tour") {
|
|
30
30
|
store.log?.warn({
|
|
31
|
-
|
|
31
|
+
media_id: tourId,
|
|
32
32
|
kind: record.kind
|
|
33
33
|
}, "resolve-tour-slot: media is not a tour");
|
|
34
34
|
return DEFAULT;
|
|
@@ -36,12 +36,12 @@ async function resolveTourSlot(value, records, store) {
|
|
|
36
36
|
try {
|
|
37
37
|
const embed = tourEmbedUrl(record.url);
|
|
38
38
|
if (embed === null) {
|
|
39
|
-
store.log?.warn({
|
|
39
|
+
store.log?.warn({ media_id: tourId }, "resolve-tour-slot: tour link embeds nowhere");
|
|
40
40
|
return DEFAULT;
|
|
41
41
|
}
|
|
42
42
|
const posterKey = record.renditions.poster?.key ?? null;
|
|
43
43
|
return attachPosterResponsive({
|
|
44
|
-
|
|
44
|
+
id: tourId,
|
|
45
45
|
url: embed,
|
|
46
46
|
poster: posterKey ? await store.fileUrl(posterKey) : "",
|
|
47
47
|
alt: typeof v.alt === "string" ? v.alt : "",
|
|
@@ -49,7 +49,7 @@ async function resolveTourSlot(value, records, store) {
|
|
|
49
49
|
}, posterKey, store);
|
|
50
50
|
} catch (err) {
|
|
51
51
|
store.log?.error({
|
|
52
|
-
|
|
52
|
+
media_id: tourId,
|
|
53
53
|
err: err.message
|
|
54
54
|
}, "resolve-tour-slot: presign failed; soft-empty tour");
|
|
55
55
|
return DEFAULT;
|
|
@@ -4,7 +4,7 @@ import { readLadder } from "./store.js";
|
|
|
4
4
|
|
|
5
5
|
//#region ../../internal/media-resolution/dist/video.js
|
|
6
6
|
const DEFAULT = {
|
|
7
|
-
|
|
7
|
+
id: "",
|
|
8
8
|
url: "",
|
|
9
9
|
poster: "",
|
|
10
10
|
alt: ""
|
|
@@ -23,12 +23,12 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
23
23
|
if (!videoId) return DEFAULT;
|
|
24
24
|
const record = records.get(videoId);
|
|
25
25
|
if (record === void 0) {
|
|
26
|
-
store.log?.warn({
|
|
26
|
+
store.log?.warn({ media_id: videoId }, "resolve-video-slot: no video media the render may reach");
|
|
27
27
|
return DEFAULT;
|
|
28
28
|
}
|
|
29
29
|
if (record.kind !== "video") {
|
|
30
30
|
store.log?.warn({
|
|
31
|
-
|
|
31
|
+
media_id: videoId,
|
|
32
32
|
kind: record.kind
|
|
33
33
|
}, "resolve-video-slot: media is not a video");
|
|
34
34
|
return DEFAULT;
|
|
@@ -40,11 +40,11 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
40
40
|
const url = record.url;
|
|
41
41
|
const embed = videoEmbedUrl(url);
|
|
42
42
|
if (!embed) {
|
|
43
|
-
store.log?.warn({
|
|
43
|
+
store.log?.warn({ media_id: videoId }, "resolve-video-slot: link upload embeds nowhere");
|
|
44
44
|
return DEFAULT;
|
|
45
45
|
}
|
|
46
46
|
const out = {
|
|
47
|
-
|
|
47
|
+
id: videoId,
|
|
48
48
|
url: embed,
|
|
49
49
|
poster: posterKey ? await store.fileUrl(posterKey) : "",
|
|
50
50
|
alt,
|
|
@@ -57,7 +57,7 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
57
57
|
const encode = record.renditions.encode;
|
|
58
58
|
if (encode === null) {
|
|
59
59
|
store.log?.warn({
|
|
60
|
-
|
|
60
|
+
media_id: videoId,
|
|
61
61
|
state: record.state
|
|
62
62
|
}, "resolve-video-slot: no encode; poster-only");
|
|
63
63
|
if (record.state !== "failed") store.notePending?.({
|
|
@@ -65,14 +65,14 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
65
65
|
id: videoId
|
|
66
66
|
});
|
|
67
67
|
return attachPosterResponsive({
|
|
68
|
-
|
|
68
|
+
id: videoId,
|
|
69
69
|
url: "",
|
|
70
70
|
poster,
|
|
71
71
|
alt
|
|
72
72
|
}, posterKey, store);
|
|
73
73
|
}
|
|
74
74
|
const out = {
|
|
75
|
-
|
|
75
|
+
id: videoId,
|
|
76
76
|
url: await store.fileUrl(encode.key),
|
|
77
77
|
poster,
|
|
78
78
|
alt
|
|
@@ -82,7 +82,7 @@ async function resolveVideoSlot(value, records, store) {
|
|
|
82
82
|
return attachPosterResponsive(out, posterKey, store);
|
|
83
83
|
} catch (err) {
|
|
84
84
|
store.log?.error({
|
|
85
|
-
|
|
85
|
+
media_id: videoId,
|
|
86
86
|
err: err.message
|
|
87
87
|
}, "resolve-video-slot: presign failed; soft-empty video");
|
|
88
88
|
return DEFAULT;
|
|
@@ -42,6 +42,7 @@ function checkNode(node, where) {
|
|
|
42
42
|
if (typeof node["brief"] !== "string" || node["brief"] === "") throw new Error(`${where} declares no \`brief\` — the brief is the whole instruction.`);
|
|
43
43
|
if (verb === "pick") {
|
|
44
44
|
if (node["of"] === void 0) throw new Error(`${where} picks with no \`of\` — a pick names its candidates on every holder.`);
|
|
45
|
+
if (node["none"] !== void 0) throw new Error(`${where} picks with \`none\` — a pick's verdict may always select nothing, so it states no \`none\`.`);
|
|
45
46
|
checkCandidates(node["of"], where);
|
|
46
47
|
} else if (node["of"] !== void 0) throw new Error(verb === "write" ? `${where} writes \`of\` something — the kind a write produces is its holder's (a text slot's own, a list's \`item\`), so a write takes no \`of\`.` : `${where} finds \`of\` something — the platform's lookup supplies what a find yields, so it takes no \`of\`.`);
|
|
47
48
|
return verb;
|
|
@@ -59,10 +59,8 @@ const CONTRACTS = {
|
|
|
59
59
|
"decision-kind": {
|
|
60
60
|
implementation: byDecision(({ key }, d) => {
|
|
61
61
|
if (d.kind !== void 0 && DECISION_KINDS.includes(d.kind)) return;
|
|
62
|
-
const { type } = d;
|
|
63
62
|
const found = d.kind === void 0 ? "declares no `kind`" : `declares kind "${d.kind}"`;
|
|
64
|
-
|
|
65
|
-
throw new Error(`Section "${key}": fill-spec decision "${d.id}" ${found}${retired}. A decision's kind is one of ${DECISION_KINDS.map((k) => `"${k}"`).join(", ")}; rebuild the section with the current Concrete.`);
|
|
63
|
+
throw new Error(`Section "${key}": fill-spec decision "${d.id}" ${found}. A decision's kind is one of ${DECISION_KINDS.map((k) => `"${k}"`).join(", ")}; rebuild the section with the current Concrete.`);
|
|
66
64
|
}),
|
|
67
65
|
assertions: []
|
|
68
66
|
},
|
|
@@ -24,11 +24,11 @@ function assertOne(path, key, slot, section) {
|
|
|
24
24
|
if (!isRegistryFactKey(field)) throw new Error(`${path}: unknown fact "${String(src.key)}"`);
|
|
25
25
|
const valueType = registryFactValueType(field);
|
|
26
26
|
if (valueType === "image" && slot.type !== "image") throw new Error(`${path}: image source field "${src.key}" must sit on an image slot`);
|
|
27
|
-
if (valueType === "address" && slot.type !== "address") throw new Error(`${path}: "${field}" is a whole address, which only an \`address\` slot holds — bind it to an \`address()\`, or show the line you want with a \`compute()\` reading it
|
|
27
|
+
if (valueType === "address" && slot.type !== "address") throw new Error(`${path}: "${field}" is a whole address, which only an \`address\` slot holds — bind it to an \`address()\`, or show the line you want with a \`compute()\` reading it.`);
|
|
28
28
|
if (slot.type === "address" && valueType !== "address") throw new Error(`${path}: an \`address\` slot bound to "${field}", which is not an address — bind it to the property's address, or compute the value.`);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (typeof src.kind !== "string") throw new Error(`${path} is sourced by a ref without a "kind" —
|
|
31
|
+
if (typeof src.kind !== "string") throw new Error(`${path} is sourced by a ref without a "kind" — every ref names its kind.`);
|
|
32
32
|
if (src.kind === "item") throw new Error(`${path} is sourced by a field of its own item ({ kind: "item" }) — a section's item fields do not read one another; read the element, or a member through a row.`);
|
|
33
33
|
if (src.kind !== "derived") return;
|
|
34
34
|
if (src.transform !== key) throw new Error(`${path}: unknown transform "${String(src.transform)}". A "derived" source is a compute() binding, and its transform must equal its own slot key ("${key}") — it does not, which means the schema was hand-authored with a mismatched transform rather than produced by defineSchema's compute() path. Author a derived value with compute() ("slot({ source: compute({ reads }, fn) })").`);
|
|
@@ -62,7 +62,7 @@ function assertDeclaredRefs(path, reads) {
|
|
|
62
62
|
if (kind === "section" && typeof section === "string" && typeof slot === "string") return;
|
|
63
63
|
refuseIndexedRow(`${path}: reads[${String(i)}]`, record);
|
|
64
64
|
if (kind === "row" && "slot" in record || kind === "element") return;
|
|
65
|
-
throw new Error(kind ===
|
|
65
|
+
throw new Error(kind === "item" ? `${path}: reads[${String(i)}] reads a field of its own item ({ kind: "item" }) — a section's item fields do not read one another; read the element, or a member through a row.` : kind === "row" ? `${path}: reads[${String(i)}] reads the row member "${String(field)}" without naming its row slot — read it through a row: \`{ kind: "row", slot, field }\`.` : `${path}: reads[${String(i)}] is not a home ref ({ kind: "home", key }) or a section ref ({ kind: "section", section, slot }).`);
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function assertSourceContract(schema) {
|
|
@@ -16,7 +16,6 @@ function isBound(slot) {
|
|
|
16
16
|
return kind !== void 0 && BINDING_KINDS.has(kind);
|
|
17
17
|
}
|
|
18
18
|
function check(slot, sectionKey, path, inherited, picked = false) {
|
|
19
|
-
if (slot.sources !== void 0) throw new Error(`Section "${sectionKey}": slot "${path}" declares \`sources\`. A media slot takes a pasted link wherever a link provider claims its kind (a video, a tour) and declares nothing for it — \`concrete upgrade\` removes it.`);
|
|
20
19
|
const holdsPick = picked && slot.source?.kind === "element" && isMediaType(slot.type ?? "");
|
|
21
20
|
checkMediaFilter(slot, sectionKey, path, inherited || isBound(slot) && !holdsPick);
|
|
22
21
|
if (slot.element) {
|
|
@@ -27,7 +26,6 @@ function check(slot, sectionKey, path, inherited, picked = false) {
|
|
|
27
26
|
}
|
|
28
27
|
function checkMediaFilter(slot, sectionKey, path, bound) {
|
|
29
28
|
const kind = slot.type ?? "";
|
|
30
|
-
if ("category" in slot) throw new Error(`Section "${sectionKey}": slot "${path}" declares \`category\`. A media slot names the list it picks from in \`from\` (${mediaListKeys().map((key) => `"${key}"`).join(", ")}), or owns its media without one.`);
|
|
31
29
|
if (!isMediaType(kind)) {
|
|
32
30
|
if (slot.from !== void 0 && kind !== "row") throw new Error(`Section "${sectionKey}": slot "${path}" declares \`from\`, but a section's ${kind === "select" ? "select states its values" : "slot names no candidates of its own"} — a media slot picks \`from\` a media list, a row from its table.`);
|
|
33
31
|
if (slot.process !== void 0) throw new Error(`Section "${sectionKey}": slot "${path}" declares \`process\`, which only a media slot (image, video, tour, document, media) carries.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
1
|
+
import { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath } from "./layout.js";
|
|
2
2
|
import { sha256Hex } from "./sha256.js";
|
|
3
3
|
import { listingDigest, sectionContentHash, sourceDigest, templateContentHash } from "./hash.js";
|
|
4
4
|
import { ArtifactManifest, ArtifactScope, ArtifactSection, readArtifactSchema } from "./manifest.js";
|
|
5
5
|
import { verifyArtifact } from "./verify.js";
|
|
6
6
|
|
|
7
|
-
export { ASSET_URL_PREFIX, ArtifactManifest, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
7
|
+
export { ASSET_URL_PREFIX, ArtifactManifest, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTION_FILES, TEMPLATE_FILES, assetPath, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionContentHash, sectionDir, sectionPath, sourceDigest, staticPath, templateContentHash, templatePath, verifyArtifact };
|
|
@@ -17,18 +17,20 @@ const UNHASHED_DIRS = [
|
|
|
17
17
|
const STORED_DIRS = [ASSETS_DIR, CAPTURES_DIR];
|
|
18
18
|
const FIXTURE_FILES = {
|
|
19
19
|
contentDoc: "content-doc.json",
|
|
20
|
+
settledDoc: "settled-doc.json",
|
|
20
21
|
property: "property.json",
|
|
21
22
|
meta: "meta.json"
|
|
22
23
|
};
|
|
23
|
-
const FIXTURE_OPTIONAL_FILES = { settledDoc: "settled-doc.json" };
|
|
24
24
|
const CAPTURE_FILES = {
|
|
25
25
|
bundle: "bundle.zip",
|
|
26
26
|
document: "document.pdf"
|
|
27
27
|
};
|
|
28
28
|
const ASSET_URL_PREFIX = "/section-assets/";
|
|
29
|
+
const PLAYGROUND_CANVAS_ISLAND_HOST = "island-canvas-host.mjs";
|
|
29
30
|
const PLAYGROUND_FILES = {
|
|
30
31
|
host: "host.mjs",
|
|
31
|
-
clientShell: `${PLAYGROUND_CLIENT_DIR}/index.html
|
|
32
|
+
clientShell: `${PLAYGROUND_CLIENT_DIR}/index.html`,
|
|
33
|
+
canvasIslandHost: `${PLAYGROUND_CLIENT_DIR}/${PLAYGROUND_CANVAS_ISLAND_HOST}`
|
|
32
34
|
};
|
|
33
35
|
function playgroundPath(file) {
|
|
34
36
|
return `${PLAYGROUND_DIR}/${file}`;
|
|
@@ -109,19 +111,17 @@ function boundFiles(binding) {
|
|
|
109
111
|
for (const facade of Object.values(binding.react_vendor ?? {})) ref(staticPath(facade.filename), facade);
|
|
110
112
|
if (binding.react_vendor_core !== null) ref(staticPath(binding.react_vendor_core.filename), binding.react_vendor_core);
|
|
111
113
|
if (binding.analytics !== null) ref(staticPath(binding.analytics.filename), binding.analytics);
|
|
112
|
-
for (const filename of Object.values(binding.masters
|
|
114
|
+
for (const filename of Object.values(binding.masters)) out.push({
|
|
113
115
|
path: assetPath(filename),
|
|
114
116
|
filename
|
|
115
117
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ref(assetPath(apple_touch.filename), apple_touch);
|
|
122
|
-
}
|
|
118
|
+
const { ico, svg, png, apple_touch } = binding.icons;
|
|
119
|
+
ref(assetPath(ico.filename), ico);
|
|
120
|
+
if (svg !== null) ref(assetPath(svg.filename), svg);
|
|
121
|
+
for (const size of Object.values(png)) ref(assetPath(size.filename), size);
|
|
122
|
+
ref(assetPath(apple_touch.filename), apple_touch);
|
|
123
123
|
return out;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
//#endregion
|
|
127
|
-
export { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES,
|
|
127
|
+
export { ASSETS_DIR, ASSET_URL_PREFIX, CAPTURES_DIR, CAPTURE_FILES, FIXTURES_DIR, FIXTURE_FILES, MANIFEST_FILE, PLAYGROUND_CANVAS_ISLAND_HOST, PLAYGROUND_CLIENT_DIR, PLAYGROUND_DIR, PLAYGROUND_FILES, SECTIONS_DIR, SECTION_FILES, SECTION_ISLANDS_DIR, STATIC_DIR, STORED_DIRS, TEMPLATE_DIR, TEMPLATE_FILES, UNHASHED_DIRS, assetPath, boundFiles, capturePath, fixturePath, isFixtureId, isSectionKey, isTemplateKey, islandPath, playgroundPath, publishedSectionKey, sectionDir, sectionOfIslandKey, sectionPath, staticPath, templatePath };
|
|
@@ -11,7 +11,7 @@ const ArtifactSection = z.object({
|
|
|
11
11
|
content_hash: Sha256
|
|
12
12
|
}).strict();
|
|
13
13
|
const ArtifactManifest = z.object({
|
|
14
|
-
artifact_schema: z.literal(
|
|
14
|
+
artifact_schema: z.literal(4),
|
|
15
15
|
framework_version: z.string().min(1),
|
|
16
16
|
key: z.string().refine(isTemplateKey, "a template key: one path segment"),
|
|
17
17
|
display_name: z.string().min(1),
|