@homepages/concrete 10.0.0 → 12.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 +48 -0
- package/codemods/manifest.json +7 -154
- package/dist/artifact/playground/client/assets/index-BcLGpWLR.js +1266 -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 +39 -40
- package/dist/base.css +18 -65
- package/dist/cli/build/artifact.js +1 -1
- package/dist/cli/build/fixtures.js +3 -2
- package/dist/cli/capture/capture.js +8 -6
- package/dist/cli/check/stages/sections.js +1 -1
- package/dist/cli/dev/workspace-reader.js +4 -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-bake/dist/compute-reads.js +1 -1
- package/dist/packages/internal/fill-bake/dist/held-rows.js +2 -0
- package/dist/packages/internal/fill-bake/dist/index.js +1 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +3 -14
- package/dist/packages/internal/format-geometry/dist/capture.js +3 -11
- package/dist/packages/internal/format-geometry/dist/format.d.ts +2 -8
- package/dist/packages/internal/format-geometry/dist/geometry.js +2 -13
- 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/fact-registry.js +1 -1
- 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/FrameShell.d.ts +5 -2
- package/dist/primitives/FrameShell.js +2 -1
- 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 +1 -7
- package/dist/schema/format-presets.d.ts +1 -1
- package/dist/schema/format.d.ts +0 -1
- package/dist/schema/format.js +1 -2
- package/dist/schema/manifest.js +18 -24
- package/dist/schema/section-schema.d.ts +5 -5
- package/dist/site-analytics.js +6 -1
- package/dist/site-runtime/window-height.js +19 -0
- package/dist/styles.css +4 -4
- package/dist/template/define-template.d.ts +11 -0
- package/dist/template/define-template.js +1 -1
- package/dist/template/materialize.js +2 -0
- 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 +2 -3
- 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
|
@@ -7,7 +7,7 @@ type Props = Omit<VideoHTMLAttributes<HTMLVideoElement>, "src" | "poster" | "aut
|
|
|
7
7
|
value: VideoValue | null | undefined;
|
|
8
8
|
/** Overrides the value's own alt. Pass `""` for a purely decorative loop. */
|
|
9
9
|
alt?: string;
|
|
10
|
-
/** Render inside
|
|
10
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the player
|
|
11
11
|
* fills edge to edge, tinted while there is nothing to show. It has NO geometry of its
|
|
12
12
|
* own: `className` lands on it and your classes are its whole box. `false` renders a
|
|
13
13
|
* bare `<video>` (or iframe) instead. Default `true`. */
|
|
@@ -33,7 +33,7 @@ type Props = Omit<VideoHTMLAttributes<HTMLVideoElement>, "src" | "poster" | "aut
|
|
|
33
33
|
* one frame container, one poster-only fallback, and one marker spread.
|
|
34
34
|
*
|
|
35
35
|
* **Framed** (default): a wrapper — `relative`, clipped, tinted via `.concrete-image-frame` —
|
|
36
|
-
* that your `className` lands on and the player absolutely fills.
|
|
36
|
+
* that your `className` lands on and the player absolutely fills. Concrete paints no
|
|
37
37
|
* geometry: size the wrapper with your own classes (an aspect utility, a height) and the
|
|
38
38
|
* player covers it. `frame={false}` hands your classes to the media element itself.
|
|
39
39
|
* Framed, `className` is the only prop that lands on the wrapper — the rest of the bag
|
|
@@ -3,13 +3,13 @@ import { OBJECT_BINDING_OWN_KEYS, acceptsLink, declaredKinds, isEmailValue, isIs
|
|
|
3
3
|
|
|
4
4
|
//#region src/primitives/slot-bindings.ts
|
|
5
5
|
const blankVideo = () => ({
|
|
6
|
-
|
|
6
|
+
id: "",
|
|
7
7
|
url: "",
|
|
8
8
|
poster: "",
|
|
9
9
|
alt: ""
|
|
10
10
|
});
|
|
11
11
|
const blankTour = () => ({
|
|
12
|
-
|
|
12
|
+
id: "",
|
|
13
13
|
url: "",
|
|
14
14
|
poster: "",
|
|
15
15
|
alt: ""
|
|
@@ -42,17 +42,13 @@ function normalizeImage(value) {
|
|
|
42
42
|
return isRecord(value) && typeof value.url === "string" && value.url !== "" ? value : null;
|
|
43
43
|
}
|
|
44
44
|
function normalizeDocument(value) {
|
|
45
|
-
|
|
46
|
-
return typeof value.poster === "string" ? value : {
|
|
47
|
-
...value,
|
|
48
|
-
poster: ""
|
|
49
|
-
};
|
|
45
|
+
return isRecord(value) && typeof value.url === "string" && value.url !== "" ? value : null;
|
|
50
46
|
}
|
|
51
47
|
function normalizeVideo(value) {
|
|
52
48
|
if (!isRecord(value)) return blankVideo();
|
|
53
49
|
return {
|
|
54
50
|
...value,
|
|
55
|
-
|
|
51
|
+
id: stringField(value.id),
|
|
56
52
|
url: stringField(value.url),
|
|
57
53
|
poster: stringField(value.poster),
|
|
58
54
|
alt: stringField(value.alt)
|
|
@@ -62,7 +58,7 @@ function normalizeTour(value) {
|
|
|
62
58
|
if (!isRecord(value)) return blankTour();
|
|
63
59
|
return {
|
|
64
60
|
...value,
|
|
65
|
-
|
|
61
|
+
id: stringField(value.id),
|
|
66
62
|
url: stringField(value.url),
|
|
67
63
|
poster: stringField(value.poster),
|
|
68
64
|
alt: stringField(value.alt)
|
|
@@ -93,13 +89,10 @@ function normalizeMedia(slot, value) {
|
|
|
93
89
|
default: return null;
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
|
-
const IDENTITY_KEYS = ["id"];
|
|
97
92
|
function normalizeFields(fields, value, identity) {
|
|
98
93
|
const source = isRecord(value) ? value : {};
|
|
99
94
|
const normalized = {};
|
|
100
|
-
if (identity)
|
|
101
|
-
for (const key of IDENTITY_KEYS) if (typeof source[key] === "string") normalized[key] = source[key];
|
|
102
|
-
}
|
|
95
|
+
if (identity && typeof source["id"] === "string") normalized["id"] = source["id"];
|
|
103
96
|
for (const [field, def] of Object.entries(fields)) normalized[field] = normalizeValue(def, source[field]);
|
|
104
97
|
return normalized;
|
|
105
98
|
}
|
|
@@ -8,7 +8,7 @@ type DocumentProps<D> = Omit<HTMLAttributes<HTMLElement>, "title" | "slot"> & {
|
|
|
8
8
|
};
|
|
9
9
|
/** Titles the `<iframe>` for assistive technology. Defaults to the file's name. */
|
|
10
10
|
title?: string;
|
|
11
|
-
/** Render inside
|
|
11
|
+
/** Render inside Concrete's frame — a clipped, relatively positioned wrapper the viewer
|
|
12
12
|
* fills edge to edge, tinted when there is nothing to show. It has NO geometry of its
|
|
13
13
|
* own: `className` lands on it and your classes are its whole box. `false` renders a
|
|
14
14
|
* bare `<iframe>` instead. Default `true`. */
|
|
@@ -6,7 +6,9 @@ import { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
|
|
|
6
6
|
//#region src/primitives/slot-download.d.ts
|
|
7
7
|
type DownloadOwnProps<D> = {
|
|
8
8
|
slot: ValueBinding<D> & {
|
|
9
|
-
value: ImageValue | VideoValue | DocumentValue
|
|
9
|
+
value: ((ImageValue | VideoValue | DocumentValue) & {
|
|
10
|
+
kind?: "image" | "video" | "document";
|
|
11
|
+
}) | null | undefined;
|
|
10
12
|
};
|
|
11
13
|
/** Author markup inside the marked element (an icon, the filename, a size
|
|
12
14
|
* line) — rendered in every branch, absent value included. */
|
|
@@ -43,9 +43,12 @@ type SlotImageProps<D> = Omit<ComponentProps<typeof Image>, "value" | "slot" | "
|
|
|
43
43
|
declare function SlotImage<D extends {
|
|
44
44
|
type: "image" | "video" | "tour" | "document" | "media";
|
|
45
45
|
}>(props: SlotImageProps<D>): ReactNode;
|
|
46
|
+
type OfKind<V, K extends MediaValue["kind"]> = V & {
|
|
47
|
+
kind?: K;
|
|
48
|
+
};
|
|
46
49
|
type SlotVideoProps<D> = Omit<ComponentProps<typeof Video>, "value" | "playback" | "slot"> & {
|
|
47
50
|
slot: ValueBinding<D> & {
|
|
48
|
-
value: VideoValue | null | undefined;
|
|
51
|
+
value: OfKind<VideoValue, "video"> | null | undefined;
|
|
49
52
|
};
|
|
50
53
|
/** `false` declines selection on THIS copy (a carousel clone, a responsive mirror) —
|
|
51
54
|
* full identity stays, and the copy is still patched live. */
|
|
@@ -67,7 +70,7 @@ declare function SlotVideo<D extends {
|
|
|
67
70
|
}>(props: SlotVideoProps<D>): ReactNode;
|
|
68
71
|
type SlotTourProps<D> = Omit<ComponentProps<typeof Tour>, "value" | "slot"> & {
|
|
69
72
|
slot: ValueBinding<D> & {
|
|
70
|
-
value: TourValue | null | undefined;
|
|
73
|
+
value: OfKind<TourValue, "tour"> | null | undefined;
|
|
71
74
|
};
|
|
72
75
|
/** `false` declines selection on THIS copy (a carousel clone, a responsive mirror) —
|
|
73
76
|
* full identity stays, and the copy is still patched live. */
|
package/dist/rules/registry.js
CHANGED
|
@@ -267,7 +267,7 @@ const AUTHORED_RULES = [
|
|
|
267
267
|
id: "pages/composition-invalid",
|
|
268
268
|
venue: "probe",
|
|
269
269
|
stage: "composition",
|
|
270
|
-
summary: "The composition the pages place breaks a page, canvas
|
|
270
|
+
summary: "The composition the pages place breaks a page, canvas or instance rule."
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
id: "relations/section-cycle",
|
|
@@ -473,12 +473,6 @@ const AUTHORED_RULES = [
|
|
|
473
473
|
venue: "tree",
|
|
474
474
|
stage: "stylesheet",
|
|
475
475
|
summary: "A stylesheet reachable from template.ts fails to resolve or compile, so no stylesheet rule could grade it."
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
id: "css/retired-layer",
|
|
479
|
-
venue: "tree",
|
|
480
|
-
stage: "stylesheet",
|
|
481
|
-
summary: "A stylesheet declares `@layer sections` or `@layer template`, the layers the framework retired; author CSS is unlayered."
|
|
482
476
|
}
|
|
483
477
|
];
|
|
484
478
|
function contractRuleId(id) {
|
|
@@ -2,7 +2,7 @@ import { DocumentFormat, ImageFormat } from "../packages/internal/format-geometr
|
|
|
2
2
|
import { WebsiteFormat } from "./format.js";
|
|
3
3
|
//#region src/schema/format-presets.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* The v1 preset library, exported from the
|
|
5
|
+
* The v1 preset library, exported from the package root. `presets.website` is the
|
|
6
6
|
* geometry-less singleton every website template's format set holds; the rest
|
|
7
7
|
* are the known social/print/deck sizes the picker renders as branded.
|
|
8
8
|
*/
|
package/dist/schema/format.d.ts
CHANGED
package/dist/schema/format.js
CHANGED
|
@@ -25,8 +25,7 @@ const DocumentFormatSchema = z.union([z.object({
|
|
|
25
25
|
width: physicalLength("positive"),
|
|
26
26
|
height: physicalLength("positive"),
|
|
27
27
|
dpi: z.number().min(72).max(600),
|
|
28
|
-
bleed: physicalLength("non-negative").optional()
|
|
29
|
-
panels: z.number().int().min(2).optional()
|
|
28
|
+
bleed: physicalLength("non-negative").optional()
|
|
30
29
|
}).strict()]);
|
|
31
30
|
const WebsiteFormatSchema = z.object(identityFields).omit({ preset: true }).strict();
|
|
32
31
|
|
package/dist/schema/manifest.js
CHANGED
|
@@ -32,6 +32,7 @@ const RenderedPage = z.object({
|
|
|
32
32
|
id: z.string().min(1),
|
|
33
33
|
label: z.string().min(1),
|
|
34
34
|
optional: z.boolean().default(false),
|
|
35
|
+
direction: z.enum(["column", "row"]).default("column"),
|
|
35
36
|
sections: z.array(SectionInstance).min(1)
|
|
36
37
|
}).strict();
|
|
37
38
|
const TemplateCanvas = z.object({
|
|
@@ -213,6 +214,23 @@ function refineRenderedRules(manifest, ctx) {
|
|
|
213
214
|
path: ["pages"],
|
|
214
215
|
message: `A rendered template needs at least one non-optional page; every page of "${manifest.key}" is optional.`
|
|
215
216
|
});
|
|
217
|
+
manifest.pages.forEach((page, pageIdx) => {
|
|
218
|
+
if (page.direction !== "row") return;
|
|
219
|
+
page.sections.forEach((instance, sectionIdx) => {
|
|
220
|
+
if (instance.required) return;
|
|
221
|
+
ctx.addIssue({
|
|
222
|
+
code: z.ZodIssueCode.custom,
|
|
223
|
+
path: [
|
|
224
|
+
"pages",
|
|
225
|
+
pageIdx,
|
|
226
|
+
"sections",
|
|
227
|
+
sectionIdx,
|
|
228
|
+
"required"
|
|
229
|
+
],
|
|
230
|
+
message: `Page "${page.id}" lays its sections out in a row, but section "${instance.section}" is not required: a row page's sections are its panels and every one prints, so declare the section \`required: true\`.`
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
216
234
|
const seenFormatIds = /* @__PURE__ */ new Set();
|
|
217
235
|
manifest.formats.forEach((format, formatIdx) => {
|
|
218
236
|
const variantError = formatVariantNameError(format.id);
|
|
@@ -235,30 +253,6 @@ function refineRenderedRules(manifest, ctx) {
|
|
|
235
253
|
message: `Duplicate format id "${format.id}".`
|
|
236
254
|
});
|
|
237
255
|
seenFormatIds.add(format.id);
|
|
238
|
-
const panels = "panels" in format ? format.panels : void 0;
|
|
239
|
-
if (panels !== void 0) {
|
|
240
|
-
if (manifest.pages.length % panels !== 0) ctx.addIssue({
|
|
241
|
-
code: z.ZodIssueCode.custom,
|
|
242
|
-
path: [
|
|
243
|
-
"formats",
|
|
244
|
-
formatIdx,
|
|
245
|
-
"panels"
|
|
246
|
-
],
|
|
247
|
-
message: `Format "${format.id}" folds ${panels} panels to a sheet, so the template's page count must be a multiple of ${panels}; "${manifest.key}" declares ${manifest.pages.length}. Each page is one panel, listed in the order the sheets print.`
|
|
248
|
-
});
|
|
249
|
-
manifest.pages.forEach((page, pageIdx) => {
|
|
250
|
-
if (!page.optional) return;
|
|
251
|
-
ctx.addIssue({
|
|
252
|
-
code: z.ZodIssueCode.custom,
|
|
253
|
-
path: [
|
|
254
|
-
"pages",
|
|
255
|
-
pageIdx,
|
|
256
|
-
"optional"
|
|
257
|
-
],
|
|
258
|
-
message: `Page "${page.id}" is optional, but format "${format.id}" folds ${panels} panels to a sheet: every panel prints, so no page of a folded format may be optional.`
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
256
|
if (!presetGeometryMatches(format)) ctx.addIssue({
|
|
263
257
|
code: z.ZodIssueCode.custom,
|
|
264
258
|
path: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AddressValue } from "../packages/internal/template-contracts/dist/address-value.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DocumentValue } from "../packages/internal/template-contracts/dist/document-value.js";
|
|
3
|
+
import { TourValue } from "../packages/internal/template-contracts/dist/tour-value.js";
|
|
4
|
+
import { VideoValue } from "../packages/internal/template-contracts/dist/video-value.js";
|
|
5
5
|
import { PoiPhoto, PoiRow } from "../packages/internal/template-contracts/dist/poi-row.js";
|
|
6
|
-
import { AuthorImage,
|
|
6
|
+
import { AuthorImage, ImageValue, MediaValue, PlaybackConfig } from "../packages/internal/template-contracts/dist/runtime-values.js";
|
|
7
7
|
import { ItemIdentity, ObjectValue, SlotValue } from "../packages/internal/template-contracts/dist/slot-value.js";
|
|
8
8
|
import { Slot } from "../packages/internal/template-contracts/dist/slot-types.js";
|
|
9
9
|
import { Coordinates } from "./property-facts.js";
|
|
@@ -46,4 +46,4 @@ declare const SectionSchema: z.ZodObject<{
|
|
|
46
46
|
/** The authored input shape of `SectionSchema` — what `as const satisfies SectionSchemaShape` checks a section's `schema.ts` against. */
|
|
47
47
|
type SectionSchemaShape = z.input<typeof SectionSchema>;
|
|
48
48
|
//#endregion
|
|
49
|
-
export { type AddressValue, type AuthorImage, type Coordinates, DisplayEntryShape, DisplayShape, type
|
|
49
|
+
export { type AddressValue, type AuthorImage, type Coordinates, DisplayEntryShape, DisplayShape, type DocumentValue, type ImageValue, type ItemIdentity, type MediaValue, type ObjectValue, type PlaybackConfig, type PoiPhoto, type PoiRow, SectionSchema, SectionSchemaShape, type Slot, type SlotValue, type TourValue, type VideoValue };
|
package/dist/site-analytics.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { initAnalytics } from "./site-runtime/analytics.js";
|
|
2
2
|
import { initSiteIntegrations } from "./site-runtime/site-integrations.js";
|
|
3
|
+
import { initWindowHeight } from "./site-runtime/window-height.js";
|
|
3
4
|
|
|
4
5
|
//#region src/site-runtime/analytics-entry.ts
|
|
5
6
|
if (typeof window !== "undefined") {
|
|
6
7
|
const run = () => {
|
|
7
|
-
for (const init of [
|
|
8
|
+
for (const init of [
|
|
9
|
+
initWindowHeight,
|
|
10
|
+
initAnalytics,
|
|
11
|
+
initSiteIntegrations
|
|
12
|
+
]) try {
|
|
8
13
|
init();
|
|
9
14
|
} catch {}
|
|
10
15
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/site-runtime/window-height.ts
|
|
2
|
+
const WINDOW_HEIGHT_PROPERTY = "--concrete-window-h";
|
|
3
|
+
function initWindowHeight() {
|
|
4
|
+
const root = document.documentElement;
|
|
5
|
+
let pinnedWidth = window.innerWidth;
|
|
6
|
+
const pin = () => {
|
|
7
|
+
const height = window.innerHeight;
|
|
8
|
+
if (height > 0) root.style.setProperty(WINDOW_HEIGHT_PROPERTY, `${String(height)}px`);
|
|
9
|
+
};
|
|
10
|
+
pin();
|
|
11
|
+
window.addEventListener("resize", () => {
|
|
12
|
+
if (window.innerWidth === pinnedWidth) return;
|
|
13
|
+
pinnedWidth = window.innerWidth;
|
|
14
|
+
pin();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { WINDOW_HEIGHT_PROPERTY, initWindowHeight };
|
package/dist/styles.css
CHANGED
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* token of yours usable.
|
|
23
23
|
*
|
|
24
24
|
* The @source below resolves relative to THIS FILE'S SHIPPED LOCATION (dist/styles.css),
|
|
25
|
-
* registering
|
|
26
|
-
* baked into
|
|
25
|
+
* registering Concrete's compiled JS for class scanning — that is how the utility classes
|
|
26
|
+
* baked into Concrete's primitives reach your compiled CSS. It also overrides Tailwind's
|
|
27
27
|
* default exclusion of node_modules.
|
|
28
28
|
*
|
|
29
29
|
* It is scoped to `primitives/` because those are the ONLY shipped modules that emit
|
|
30
30
|
* markup. Tailwind's scanner is a plain candidate-extractor — it cannot tell code from a
|
|
31
|
-
* comment — and
|
|
31
|
+
* comment — and Concrete ships unminified (deliberately: it keeps these class-name string
|
|
32
32
|
* literals scannable). Pointed at all of dist/, it therefore compiled prose out of the
|
|
33
33
|
* CLI's and the ESLint preset's doc comments into every consumer's stylesheet: 8 dead
|
|
34
34
|
* utilities and 19 stray @property registrations, ~2.5 KB. If a primitive ever moves out
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* per-page-overridable tokens, so inlining is both correct and what keeps the compiled
|
|
49
49
|
* output stable. Nothing here may reference a token a template's own CSS defines.
|
|
50
50
|
*
|
|
51
|
-
* NO BREAKPOINTS.
|
|
51
|
+
* NO BREAKPOINTS. Concrete declares none and resets none, so Tailwind's own
|
|
52
52
|
* `sm`/`md`/`lg`/`xl`/`2xl` reach a template untouched. Where a design swaps is the
|
|
53
53
|
* template's call, not the platform's: declare your own `--breakpoint-*` tokens in
|
|
54
54
|
* `@theme` (each becomes a variant prefix), or write an arbitrary variant inline. The
|
|
@@ -35,10 +35,19 @@ interface PageBase {
|
|
|
35
35
|
/** A website page: addressed by a URL path — `"/"` for the root, else one lowercase-kebab segment. */
|
|
36
36
|
interface WebsitePage extends PageBase {
|
|
37
37
|
readonly path: string;
|
|
38
|
+
readonly direction?: never;
|
|
38
39
|
}
|
|
39
40
|
/** A rendered class's page — a sheet, a slide, a frame — is not addressed by URL. */
|
|
40
41
|
interface RenderedPage extends PageBase {
|
|
41
42
|
readonly path?: never;
|
|
43
|
+
/**
|
|
44
|
+
* How the page's frame lays its sections out: `"column"` (the default) stacks them,
|
|
45
|
+
* `"row"` sets them side by side, each section setting its own width. A folded print
|
|
46
|
+
* piece declares one row page per printed side, one section per panel; every section
|
|
47
|
+
* of a row page must be `required` and declare no `visibility` rule, since a panel
|
|
48
|
+
* that dropped out would shift every later one onto the wrong fold.
|
|
49
|
+
*/
|
|
50
|
+
readonly direction?: "column" | "row";
|
|
42
51
|
}
|
|
43
52
|
/** One editing canvas: its canvas-bar label and the page ids it presents, in display order. */
|
|
44
53
|
interface CanvasInput<PageId extends string> {
|
|
@@ -93,6 +102,8 @@ interface TemplatePage {
|
|
|
93
102
|
readonly label: string;
|
|
94
103
|
readonly path?: string;
|
|
95
104
|
readonly optional: boolean;
|
|
105
|
+
/** Rendered pages only, as authored; absent is a column. */
|
|
106
|
+
readonly direction?: "column" | "row";
|
|
96
107
|
readonly page: PageComponent;
|
|
97
108
|
}
|
|
98
109
|
/** One canvas as the template value carries it — declared, or the stamped class default. */
|
|
@@ -10,7 +10,6 @@ const CLASS_BY_CATEGORY = {
|
|
|
10
10
|
presentation: "document"
|
|
11
11
|
};
|
|
12
12
|
function defineTemplate(input) {
|
|
13
|
-
if ("reconcile" in input) throw new Error(`Template "${input.key}" passes \`reconcile\`, which defineTemplate no longer takes. A slot that depends on another section reads it on its own \`source:\` — a slot ref (\`source: Hero.slots.title\`) or \`compute({ reads }, fn)\`. \`concrete upgrade\` removes an empty \`reconcile: []\` and lists every rule left to move by hand.`);
|
|
14
13
|
assertScope(input.scope);
|
|
15
14
|
const formats = Array.isArray(input.format) ? [...input.format] : [input.format];
|
|
16
15
|
const output = outputClassOf(input.key, formats);
|
|
@@ -20,6 +19,7 @@ function defineTemplate(input) {
|
|
|
20
19
|
label: page.label,
|
|
21
20
|
...page.path === void 0 ? {} : { path: page.path },
|
|
22
21
|
optional: page.optional ?? false,
|
|
22
|
+
...page.direction === void 0 ? {} : { direction: page.direction },
|
|
23
23
|
page: page.page
|
|
24
24
|
}));
|
|
25
25
|
if (pages.length === 0) throw new Error(`Template "${input.key}" declares no pages. \`pages\` is the site map — declare at least one.`);
|
|
@@ -17,6 +17,7 @@ function materializeTemplate(template, options = {}) {
|
|
|
17
17
|
throw new Error(`Page "${page.id}"${where === "" ? "" : ` (${where})`} emits markup that is not a section: ${excerpt(recorded.markup)}. A page may contain only sections and components that contain only sections — the platform has nowhere to put page markup.`);
|
|
18
18
|
}
|
|
19
19
|
for (const placement of recorded.placements) {
|
|
20
|
+
if (page.direction === "row" && "visibility" in placement.section.display) throw new Error(`Page "${page.id}" lays its sections out in a row, but section "${placement.key}" declares a \`display.visibility\` rule: a row page's sections are its panels and every one prints, so a section placed on one may not switch itself off. Draw an empty panel instead of hiding it.`);
|
|
20
21
|
placements.push(placement);
|
|
21
22
|
const prior = sectionOfInstance.get(placement.instance);
|
|
22
23
|
if (prior !== void 0 && prior !== placement.key) throw new Error(`Instance "${placement.instance}" names two sections: "${prior}" and "${placement.key}" (on page "${page.id}"). An instance id is one section's; name the second placement with \`instance\`.`);
|
|
@@ -34,6 +35,7 @@ function materializeTemplate(template, options = {}) {
|
|
|
34
35
|
label: page.label,
|
|
35
36
|
...page.path === void 0 ? {} : { path: page.path },
|
|
36
37
|
optional: page.optional,
|
|
38
|
+
...page.direction === void 0 ? {} : { direction: page.direction },
|
|
37
39
|
sections: recorded.placements.map((placement) => ({
|
|
38
40
|
section: placement.key,
|
|
39
41
|
instance_id: placement.instance,
|
|
@@ -3,7 +3,7 @@ purpose: Every `concrete` command, with its full flag surface, exit codes and co
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# Command reference
|
|
@@ -79,7 +79,7 @@ of its flags.
|
|
|
79
79
|
|
|
80
80
|
## Versions
|
|
81
81
|
|
|
82
|
-
These pages describe `@homepages/concrete` **>=
|
|
82
|
+
These pages describe `@homepages/concrete` **>=12.0.0 <13.0.0**. The range, rather than
|
|
83
83
|
the exact version they were generated from: this reference is committed build output,
|
|
84
84
|
so a page stamped with a patch version would be stale the day it shipped.
|
|
85
85
|
`concrete --version` prints the installed one.
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete build` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete build
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete check` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete check
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete dev` command — its flags, exit codes and constraints.
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete dev
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete property add` command — its flags, exit codes and const
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete property add
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete property list` command — its flags, exit codes and cons
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete property list
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete publish` command — its flags, exit codes and constraint
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete publish
|
|
@@ -3,7 +3,7 @@ purpose: The `concrete upgrade` command — its flags, exit codes and constraint
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete command table
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/INDEX.md]
|
|
8
8
|
---
|
|
9
9
|
# concrete upgrade
|
|
@@ -3,7 +3,7 @@ purpose: Every rule `concrete check` grades, by the stage that grades it, in the
|
|
|
3
3
|
mode: reference
|
|
4
4
|
status: generated
|
|
5
5
|
generated_from: the concrete rule registry
|
|
6
|
-
applies_to: "@homepages/concrete >=
|
|
6
|
+
applies_to: "@homepages/concrete >=12.0.0 <13.0.0"
|
|
7
7
|
related: [reference/cli/check.md]
|
|
8
8
|
---
|
|
9
9
|
# Rule reference
|
|
@@ -78,7 +78,7 @@ Each page is rendered once under the page probe, and the composition it places p
|
|
|
78
78
|
|---|---|---|
|
|
79
79
|
| `concrete/pages/non-section-markup` | probe | A page emits markup that is not a section; a page may contain only sections. |
|
|
80
80
|
| `concrete/pages/section-not-exported` | probe | A page places a section no module exports, so the build cannot bundle it alone. |
|
|
81
|
-
| `concrete/pages/composition-invalid` | probe | The composition the pages place breaks a page, canvas
|
|
81
|
+
| `concrete/pages/composition-invalid` | probe | The composition the pages place breaks a page, canvas or instance rule. |
|
|
82
82
|
|
|
83
83
|
## relations
|
|
84
84
|
|
|
@@ -100,7 +100,6 @@ The CSS import graph of `template.ts` compiles into the template stylesheet exac
|
|
|
100
100
|
| `concrete/css/tailwind-import` | tree | The CSS import graph of template.ts carries no `@import "tailwindcss"`, or more than one. |
|
|
101
101
|
| `concrete/css/external-url` | tree | A rendered template's compiled stylesheet references an external URL, which the renderer cannot reach. |
|
|
102
102
|
| `concrete/css/compile-failed` | tree | A stylesheet reachable from template.ts fails to resolve or compile, so no stylesheet rule could grade it. |
|
|
103
|
-
| `concrete/css/retired-layer` | tree | A stylesheet declares `@layer sections` or `@layer template`, the layers the framework retired; author CSS is unlayered. |
|
|
104
103
|
|
|
105
104
|
## logic
|
|
106
105
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homepages/concrete",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Concrete, the HomePages template framework: the authoring API, the contract primitives, the styles, the lint preset and the `concrete` command in one package that owns its whole toolchain.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"optionalDependencies": {
|
|
89
89
|
"sharp": "^0.35.3"
|
|
90
90
|
},
|
|
91
|
-
"$comment:devDependencies": "Every `@homepages/*` entry is a private workspace package compiled INTO dist by tsdown, which externalizes only dependencies, peerDependencies and optionalDependencies: nothing about them survives into a consumer's dependency graph, and the packed tarball declares no `workspace:*` edge in any block a consumer installs (src/package-boundary.test.ts). The set is every internal package
|
|
91
|
+
"$comment:devDependencies": "Every `@homepages/*` entry is a private workspace package compiled INTO dist by tsdown, which externalizes only dependencies, peerDependencies and optionalDependencies: nothing about them survives into a consumer's dependency graph, and the packed tarball declares no `workspace:*` edge in any block a consumer installs (src/package-boundary.test.ts). The set is every internal package Concrete inlines, declared here once so the command, check, dev and build modules that follow reach them without a manifest change; a module the shipped entries do not reach today is simply not in dist yet. One entry is never inlined: `@homepages/portability-lint` is imported by eslint.config.mjs alone, the lint rules that grade this package's own source.",
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
94
94
|
"@eslint/js": "^10.0.1",
|