@aglyn/aglyn 1.0.0-beta.219 → 1.0.0-beta.221
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/package.json +12 -12
- package/src/lib/app-utils/actions.d.ts +1 -59
- package/src/lib/app-utils/actions.js +7 -72
- package/src/lib/app-utils/actions.js.map +1 -1
- package/src/lib/app-utils/consent-groups.d.ts +1 -1
- package/src/lib/app-utils/consent-groups.js.map +1 -1
- package/src/lib/app-utils/console-routes.d.ts +0 -36
- package/src/lib/app-utils/console-routes.js +2 -37
- package/src/lib/app-utils/console-routes.js.map +1 -1
- package/src/lib/app-utils/contacts.d.ts +1 -1
- package/src/lib/app-utils/contacts.js.map +1 -1
- package/src/lib/app-utils/container-membership.d.ts +93 -0
- package/src/lib/app-utils/container-membership.js +165 -0
- package/src/lib/app-utils/container-membership.js.map +1 -0
- package/src/lib/app-utils/crm-task-reminders.d.ts +23 -6
- package/src/lib/app-utils/crm-task-reminders.js +32 -11
- package/src/lib/app-utils/crm-task-reminders.js.map +1 -1
- package/src/lib/app-utils/crm.d.ts +24 -4
- package/src/lib/app-utils/crm.js +23 -0
- package/src/lib/app-utils/crm.js.map +1 -1
- package/src/lib/app-utils/csv-upload.d.ts +1 -1
- package/src/lib/app-utils/csv-upload.js +1 -1
- package/src/lib/app-utils/csv-upload.js.map +1 -1
- package/src/lib/app-utils/{dataset-csv.d.ts → csv.d.ts} +10 -43
- package/src/lib/app-utils/{dataset-csv.js → csv.js} +10 -81
- package/src/lib/app-utils/csv.js.map +1 -0
- package/src/lib/app-utils/datasets.d.ts +0 -19
- package/src/lib/app-utils/datasets.js +0 -13
- package/src/lib/app-utils/datasets.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +4 -4
- package/src/lib/app-utils/docs-help.generated.js +5 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +71 -36
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/dynamic-list-rule.js +3 -3
- package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
- package/src/lib/app-utils/email-text.d.ts +80 -0
- package/src/lib/app-utils/email-text.js +189 -0
- package/src/lib/app-utils/email-text.js.map +1 -0
- package/src/lib/app-utils/{list-assignment-policy.d.ts → enrollment-basis.d.ts} +4 -0
- package/src/lib/app-utils/{list-assignment-policy.js → enrollment-basis.js} +5 -1
- package/src/lib/app-utils/enrollment-basis.js.map +1 -0
- package/src/lib/app-utils/expand-repeatables.js +4 -4
- package/src/lib/app-utils/expand-repeatables.js.map +1 -1
- package/src/lib/app-utils/forms.js +2 -2
- package/src/lib/app-utils/forms.js.map +1 -1
- package/src/lib/app-utils/health-report.d.ts +2 -3
- package/src/lib/app-utils/health-report.js +30 -6
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/inbound-mail-domain.d.ts +27 -0
- package/src/lib/app-utils/inbound-mail-domain.js +31 -0
- package/src/lib/app-utils/inbound-mail-domain.js.map +1 -0
- package/src/lib/app-utils/leaving-notice.d.ts +96 -0
- package/src/lib/app-utils/leaving-notice.js +157 -0
- package/src/lib/app-utils/leaving-notice.js.map +1 -0
- package/src/lib/app-utils/lockdown.d.ts +11 -0
- package/src/lib/app-utils/lockdown.js +33 -3
- package/src/lib/app-utils/lockdown.js.map +1 -1
- package/src/lib/app-utils/member-email-aliases.d.ts +25 -0
- package/src/lib/app-utils/member-email-aliases.js +29 -0
- package/src/lib/app-utils/member-email-aliases.js.map +1 -1
- package/src/lib/app-utils/notifications.d.ts +69 -0
- package/src/lib/app-utils/notifications.js +119 -0
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/app-utils/operator-alerts.d.ts +15 -1
- package/src/lib/app-utils/operator-alerts.js +64 -10
- package/src/lib/app-utils/operator-alerts.js.map +1 -1
- package/src/lib/app-utils/plan-entitlements.d.ts +164 -178
- package/src/lib/app-utils/plan-entitlements.js +200 -224
- package/src/lib/app-utils/plan-entitlements.js.map +1 -1
- package/src/lib/app-utils/platform-marketing-consent.d.ts +56 -2
- package/src/lib/app-utils/platform-marketing-consent.js +6 -5
- package/src/lib/app-utils/platform-marketing-consent.js.map +1 -1
- package/src/lib/app-utils/plugin-starter-templates.generated.d.ts +12 -0
- package/src/lib/app-utils/plugin-starter-templates.generated.js +711 -0
- package/src/lib/app-utils/plugin-starter-templates.generated.js.map +1 -0
- package/src/lib/app-utils/repeat-query.d.ts +56 -0
- package/src/lib/app-utils/{dataset-query.js → repeat-query.js} +16 -16
- package/src/lib/app-utils/repeat-query.js.map +1 -0
- package/src/lib/app-utils/screen-link-context-value.d.ts +7 -0
- package/src/lib/app-utils/screen-link-context-value.js.map +1 -1
- package/src/lib/app-utils/screen-link-context.js +14 -2
- package/src/lib/app-utils/screen-link-context.js.map +1 -1
- package/src/lib/app-utils/screen-route.d.ts +3 -0
- package/src/lib/app-utils/screen-route.js +6 -1
- package/src/lib/app-utils/screen-route.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +7 -9
- package/src/lib/app-utils/server.js +18 -26
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/starter-template-nodes.d.ts +137 -0
- package/src/lib/app-utils/starter-template-nodes.js +129 -0
- package/src/lib/app-utils/starter-template-nodes.js.map +1 -0
- package/src/lib/app-utils/starter-templates.d.ts +11 -34
- package/src/lib/app-utils/starter-templates.js +19 -230
- package/src/lib/app-utils/starter-templates.js.map +1 -1
- package/src/lib/app-utils/{email-topics.d.ts → subscription-topics.d.ts} +64 -48
- package/src/lib/app-utils/{email-topics.js → subscription-topics.js} +39 -109
- package/src/lib/app-utils/subscription-topics.js.map +1 -0
- package/src/lib/app-utils/usage-budget.d.ts +73 -188
- package/src/lib/app-utils/usage-budget.js +58 -194
- package/src/lib/app-utils/usage-budget.js.map +1 -1
- package/src/lib/app-utils/utm-attribution.d.ts +1 -1
- package/src/lib/app-utils/utm-attribution.js +1 -1
- package/src/lib/app-utils/utm-attribution.js.map +1 -1
- package/src/lib/app-utils/{campaign-touch.d.ts → utm-touch.d.ts} +21 -13
- package/src/lib/app-utils/{campaign-touch.js → utm-touch.js} +30 -22
- package/src/lib/app-utils/utm-touch.js.map +1 -0
- package/src/lib/app-utils/variables.d.ts +9 -9
- package/src/lib/app-utils/variables.js.map +1 -1
- package/src/lib/app-utils/visitor-record-ceiling.d.ts +32 -0
- package/src/lib/app-utils/visitor-record-ceiling.js +39 -0
- package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
- package/src/lib/foundation/definitions/org-billing.types.d.ts +2 -2
- package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +80 -79
- package/src/lib/plugin-manager/feature-plugins.js +22 -35
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +18 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.js +62 -2
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/index.d.ts +0 -1
- package/src/lib/plugin-manager/index.js +0 -1
- package/src/lib/plugin-manager/index.js.map +1 -1
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +9 -4
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
- package/src/lib/plugin-manager/plugin-containers.d.ts +68 -0
- package/src/lib/plugin-manager/plugin-containers.generated.d.ts +10 -0
- package/src/lib/plugin-manager/plugin-containers.generated.js +20 -0
- package/src/lib/plugin-manager/plugin-containers.generated.js.map +1 -0
- package/src/lib/plugin-manager/plugin-containers.js +27 -0
- package/src/lib/plugin-manager/plugin-containers.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlements.d.ts +8 -0
- package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
- package/src/lib/plugin-manager/plugin-membership-detach.js +1 -1
- package/src/lib/plugin-manager/plugin-membership-detach.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-email-state.d.ts +69 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js +32 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-lists.d.ts +115 -0
- package/src/lib/plugin-manager/plugin-record-lists.js +75 -0
- package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-timeline.d.ts +42 -8
- package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
- package/src/lib/plugin-manager/plugin-server-steps.d.ts +170 -0
- package/src/lib/plugin-manager/plugin-server-steps.js +116 -0
- package/src/lib/plugin-manager/plugin-server-steps.js.map +1 -0
- package/src/lib/plugin-manager/plugin-site-beacons.d.ts +71 -0
- package/src/lib/plugin-manager/plugin-site-beacons.js +54 -0
- package/src/lib/plugin-manager/plugin-site-beacons.js.map +1 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.d.ts +11 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.js +41 -0
- package/src/lib/plugin-manager/plugin-subscription-topics.generated.js.map +1 -0
- package/src/lib/plugin-manager/plugin-usage-axes.d.ts +212 -0
- package/src/lib/plugin-manager/plugin-usage-axes.js +82 -3
- package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -1
- package/src/lib/plugin-manager/plugin-usage-meters.d.ts +108 -0
- package/src/lib/plugin-manager/plugin-usage-meters.js +105 -0
- package/src/lib/plugin-manager/plugin-usage-meters.js.map +1 -0
- package/src/lib/plugin-manager/usage-alert-contributors.d.ts +76 -6
- package/src/lib/plugin-manager/usage-alert-contributors.js +23 -10
- package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -1
- package/src/lib/app-utils/assist-credits.d.ts +0 -482
- package/src/lib/app-utils/assist-credits.js +0 -510
- package/src/lib/app-utils/assist-credits.js.map +0 -1
- package/src/lib/app-utils/campaign-membership.d.ts +0 -121
- package/src/lib/app-utils/campaign-membership.js +0 -189
- package/src/lib/app-utils/campaign-membership.js.map +0 -1
- package/src/lib/app-utils/campaign-touch.js.map +0 -1
- package/src/lib/app-utils/console-record-links.d.ts +0 -84
- package/src/lib/app-utils/console-record-links.js +0 -76
- package/src/lib/app-utils/console-record-links.js.map +0 -1
- package/src/lib/app-utils/crm-booking.d.ts +0 -75
- package/src/lib/app-utils/crm-booking.js +0 -133
- package/src/lib/app-utils/crm-booking.js.map +0 -1
- package/src/lib/app-utils/crm-inbound.d.ts +0 -245
- package/src/lib/app-utils/crm-inbound.js +0 -407
- package/src/lib/app-utils/crm-inbound.js.map +0 -1
- package/src/lib/app-utils/crm-reports.d.ts +0 -479
- package/src/lib/app-utils/crm-reports.js +0 -680
- package/src/lib/app-utils/crm-reports.js.map +0 -1
- package/src/lib/app-utils/dataset-csv.js.map +0 -1
- package/src/lib/app-utils/dataset-query.d.ts +0 -57
- package/src/lib/app-utils/dataset-query.js.map +0 -1
- package/src/lib/app-utils/email-topics.js.map +0 -1
- package/src/lib/app-utils/list-assignment-policy.js.map +0 -1
- package/src/lib/plugin-manager/plugin-metered-lines.d.ts +0 -97
- package/src/lib/plugin-manager/plugin-metered-lines.js +0 -123
- package/src/lib/plugin-manager/plugin-metered-lines.js.map +0 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* What a starter site is, and the kit its pages are built with (AGL-687,
|
|
19
|
+
* AGL-3080).
|
|
20
|
+
*
|
|
21
|
+
* A starter is a bundle of page templates the template gallery offers and
|
|
22
|
+
* the seed route copies into a site's library on first use. The platform's
|
|
23
|
+
* own starters live in `starter-templates.ts`; a plugin whose elements a
|
|
24
|
+
* starter is built around declares its own, built with this same kit, and
|
|
25
|
+
* the manifest generator compiles them into
|
|
26
|
+
* `plugin-starter-templates.generated.ts`.
|
|
27
|
+
*
|
|
28
|
+
* Leaf imports only, for the reason `starter-templates.ts` states: this is
|
|
29
|
+
* read from the console's client gallery, its seed route and a plugin's
|
|
30
|
+
* server alike, so it imports a canvas constant and nothing that drags in
|
|
31
|
+
* either barrel.
|
|
32
|
+
*
|
|
33
|
+
* PERSISTED IDENTIFIERS: `StarterTemplate.id`, `StarterTemplateScreen.key`
|
|
34
|
+
* and every node id a starter builds appear in stored documents (seeded
|
|
35
|
+
* template doc ids are derived from the first two). They must never be
|
|
36
|
+
* renamed.
|
|
37
|
+
*/
|
|
38
|
+
export interface StarterTemplateScreen {
|
|
39
|
+
/**
|
|
40
|
+
* Stable, starter-local key. Part of the seeded document id, so it is a
|
|
41
|
+
* persisted identifier — never rename one.
|
|
42
|
+
*/
|
|
43
|
+
key: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Routing-map slug. `SCREEN_ROOT_PATH` (`'/'`) asks for the site root — the
|
|
48
|
+
* home page — and anything else is a single path segment.
|
|
49
|
+
*
|
|
50
|
+
* It used to be `''` that meant home, which no normalizer agreed with: both
|
|
51
|
+
* the apply path and the seed below read an empty string as "no address
|
|
52
|
+
* authored" and derived one from the display name, so the shop starters'
|
|
53
|
+
* home page was published at `/home` and the site 404'd at its own URL
|
|
54
|
+
* (AGL-1575).
|
|
55
|
+
*/
|
|
56
|
+
slug: string;
|
|
57
|
+
seo?: {
|
|
58
|
+
title?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
};
|
|
61
|
+
/** Flat node map including the canvas root. */
|
|
62
|
+
nodes: Record<string, any>;
|
|
63
|
+
}
|
|
64
|
+
export interface StarterTemplate {
|
|
65
|
+
id: string;
|
|
66
|
+
displayName: string;
|
|
67
|
+
description: string;
|
|
68
|
+
category: string;
|
|
69
|
+
screens: StarterTemplateScreen[];
|
|
70
|
+
}
|
|
71
|
+
/** A materialized starter template document, keyed by its deterministic id. */
|
|
72
|
+
export type StarterNodeSpec = {
|
|
73
|
+
id: string;
|
|
74
|
+
componentId: string;
|
|
75
|
+
/** Bundle owning the component; defaults to 'mui' (AGL-300). */
|
|
76
|
+
pluginId?: string;
|
|
77
|
+
props?: Record<string, unknown>;
|
|
78
|
+
/**
|
|
79
|
+
* Node-level styles — a SIBLING of props, never `props.sx` (AGL-1346).
|
|
80
|
+
*
|
|
81
|
+
* Both records render (`Leaf` composes `(sx, props.sx, node.sx)`, later
|
|
82
|
+
* wins), but the Styles panel edits `node.sx`. A starter that seeded its
|
|
83
|
+
* styling into `props.sx` handed the author a document full of values
|
|
84
|
+
* the panel could show but no click could change or clear.
|
|
85
|
+
*/
|
|
86
|
+
sx?: Record<string, unknown>;
|
|
87
|
+
children?: StarterNodeSpec[];
|
|
88
|
+
};
|
|
89
|
+
/** Builds the flat, persisted node map from a nested spec. */
|
|
90
|
+
export declare function buildStarterNodes(children: StarterNodeSpec[]): Record<string, any>;
|
|
91
|
+
/** One line of a starter's copy: a `muiTypography` of the given variant. */
|
|
92
|
+
export declare const starterText: (id: string, variant: string, children: string, extra?: Record<string, unknown>) => StarterNodeSpec;
|
|
93
|
+
/**
|
|
94
|
+
* The stock widths a starter band may be (AGL-1932, AGL-1298).
|
|
95
|
+
*
|
|
96
|
+
* Three cases, and only three, because the standard has three. There is no
|
|
97
|
+
* pixel case: `1328` is a CONTENT width, not a breakpoint, and the ban on
|
|
98
|
+
* bespoke numbers is the half of AGL-1298 these templates used to violate
|
|
99
|
+
* four times over.
|
|
100
|
+
*/
|
|
101
|
+
export type StarterSectionWidth = 'md' | 'lg' | 'xl';
|
|
102
|
+
/**
|
|
103
|
+
* One page band: a `Container` at a stock width, carrying the band's own
|
|
104
|
+
* vertical rhythm (AGL-1932).
|
|
105
|
+
*
|
|
106
|
+
* The layout standard (AGL-1298): every section is a Container. Full-bleed is
|
|
107
|
+
* the Container's own full-width attribute, never the absence of a Container,
|
|
108
|
+
* and anything else is one of three stock widths. A template that seeds no
|
|
109
|
+
* Container hands every customer a site that starts outside the standard.
|
|
110
|
+
*
|
|
111
|
+
* How the three widths are chosen here, stated so the next audit does not
|
|
112
|
+
* have to guess:
|
|
113
|
+
*
|
|
114
|
+
* - `xl` — a marketing band: hero, feature row, product grid, gallery. The
|
|
115
|
+
* default width, and what an unremarkable page should be.
|
|
116
|
+
* - `lg` — the deliberate middle case: wide but text-led and interactive.
|
|
117
|
+
* Cart and account are the honest instances, not decoration.
|
|
118
|
+
* - `md` — long-form prose and narrow form columns, on READING grounds: at
|
|
119
|
+
* `xl` a paragraph runs 110–120 characters a line. This is the case the
|
|
120
|
+
* `Prose Container` preset exists for.
|
|
121
|
+
*
|
|
122
|
+
* Horizontal padding is the Container's own gutters, so bands no longer carry
|
|
123
|
+
* horizontal padding at all. Only the vertical rhythm rides here, which is
|
|
124
|
+
* rhythm rather than width.
|
|
125
|
+
*
|
|
126
|
+
* Written as the two longhands rather than MUI's `py` (AGL-2207/2208): the
|
|
127
|
+
* Styles panel's Padding control is named for the four sides, so a band
|
|
128
|
+
* seeded with `py` handed the customer a document whose padding the panel
|
|
129
|
+
* showed as empty and no click could clear.
|
|
130
|
+
*/
|
|
131
|
+
export declare const starterSection: (id: string, maxWidth: StarterSectionWidth, verticalPadding: number, children: StarterNodeSpec[]) => StarterNodeSpec;
|
|
132
|
+
/**
|
|
133
|
+
* The hero band a starter page opens with: a headline, a tagline and a call
|
|
134
|
+
* to action, centered in an `xl` band. Its node ids are `prefix` plus fixed
|
|
135
|
+
* names, so a starter's prefix keeps them its own.
|
|
136
|
+
*/
|
|
137
|
+
export declare const starterHeroSection: (prefix: string, headline: string, tagline: string) => StarterNodeSpec;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { CANVAS_ROOT_ELEMENT_ID } from "../foundation/constants/canvas.js";
|
|
18
|
+
/** Builds the flat, persisted node map from a nested spec. */ export function buildStarterNodes(children) {
|
|
19
|
+
const map = {
|
|
20
|
+
[CANVAS_ROOT_ELEMENT_ID]: {
|
|
21
|
+
$id: CANVAS_ROOT_ELEMENT_ID,
|
|
22
|
+
componentId: 'div',
|
|
23
|
+
nodes: children.map((child)=>child.id)
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const walk = (spec, parentId)=>{
|
|
27
|
+
var _spec_pluginId, _spec_props, _spec_children, _spec_children1;
|
|
28
|
+
map[spec.id] = _extends({
|
|
29
|
+
$id: spec.id,
|
|
30
|
+
componentId: spec.componentId,
|
|
31
|
+
pluginId: (_spec_pluginId = spec.pluginId) != null ? _spec_pluginId : 'mui',
|
|
32
|
+
parentId,
|
|
33
|
+
props: (_spec_props = spec.props) != null ? _spec_props : {}
|
|
34
|
+
}, spec.sx ? {
|
|
35
|
+
sx: spec.sx
|
|
36
|
+
} : {}, {
|
|
37
|
+
nodes: ((_spec_children = spec.children) != null ? _spec_children : []).map((child)=>child.id)
|
|
38
|
+
});
|
|
39
|
+
for (const child of (_spec_children1 = spec.children) != null ? _spec_children1 : [])walk(child, spec.id);
|
|
40
|
+
};
|
|
41
|
+
for (const child of children)walk(child, CANVAS_ROOT_ELEMENT_ID);
|
|
42
|
+
return map;
|
|
43
|
+
}
|
|
44
|
+
/** One line of a starter's copy: a `muiTypography` of the given variant. */ export const starterText = (id, variant, children, extra)=>({
|
|
45
|
+
id,
|
|
46
|
+
componentId: 'muiTypography',
|
|
47
|
+
props: _extends({
|
|
48
|
+
variant,
|
|
49
|
+
children
|
|
50
|
+
}, extra)
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* One page band: a `Container` at a stock width, carrying the band's own
|
|
54
|
+
* vertical rhythm (AGL-1932).
|
|
55
|
+
*
|
|
56
|
+
* The layout standard (AGL-1298): every section is a Container. Full-bleed is
|
|
57
|
+
* the Container's own full-width attribute, never the absence of a Container,
|
|
58
|
+
* and anything else is one of three stock widths. A template that seeds no
|
|
59
|
+
* Container hands every customer a site that starts outside the standard.
|
|
60
|
+
*
|
|
61
|
+
* How the three widths are chosen here, stated so the next audit does not
|
|
62
|
+
* have to guess:
|
|
63
|
+
*
|
|
64
|
+
* - `xl` — a marketing band: hero, feature row, product grid, gallery. The
|
|
65
|
+
* default width, and what an unremarkable page should be.
|
|
66
|
+
* - `lg` — the deliberate middle case: wide but text-led and interactive.
|
|
67
|
+
* Cart and account are the honest instances, not decoration.
|
|
68
|
+
* - `md` — long-form prose and narrow form columns, on READING grounds: at
|
|
69
|
+
* `xl` a paragraph runs 110–120 characters a line. This is the case the
|
|
70
|
+
* `Prose Container` preset exists for.
|
|
71
|
+
*
|
|
72
|
+
* Horizontal padding is the Container's own gutters, so bands no longer carry
|
|
73
|
+
* horizontal padding at all. Only the vertical rhythm rides here, which is
|
|
74
|
+
* rhythm rather than width.
|
|
75
|
+
*
|
|
76
|
+
* Written as the two longhands rather than MUI's `py` (AGL-2207/2208): the
|
|
77
|
+
* Styles panel's Padding control is named for the four sides, so a band
|
|
78
|
+
* seeded with `py` handed the customer a document whose padding the panel
|
|
79
|
+
* showed as empty and no click could clear.
|
|
80
|
+
*/ export const starterSection = (id, maxWidth, verticalPadding, children)=>({
|
|
81
|
+
id,
|
|
82
|
+
componentId: 'muiContainer',
|
|
83
|
+
props: {
|
|
84
|
+
maxWidth
|
|
85
|
+
},
|
|
86
|
+
sx: {
|
|
87
|
+
paddingTop: verticalPadding,
|
|
88
|
+
paddingBottom: verticalPadding
|
|
89
|
+
},
|
|
90
|
+
children
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* The hero band a starter page opens with: a headline, a tagline and a call
|
|
94
|
+
* to action, centered in an `xl` band. Its node ids are `prefix` plus fixed
|
|
95
|
+
* names, so a starter's prefix keeps them its own.
|
|
96
|
+
*/ export const starterHeroSection = (prefix, headline, tagline)=>// The Container is a NEW node (`…heroSection`); `…hero` keeps its id and
|
|
97
|
+
// stays the Stack. Node ids here are persisted identifiers, so bands are
|
|
98
|
+
// wrapped rather than re-pointed.
|
|
99
|
+
starterSection(`${prefix}heroSection`, 'xl', 10, [
|
|
100
|
+
{
|
|
101
|
+
id: `${prefix}hero`,
|
|
102
|
+
componentId: 'muiStack',
|
|
103
|
+
props: {
|
|
104
|
+
spacing: 2
|
|
105
|
+
},
|
|
106
|
+
sx: {
|
|
107
|
+
alignItems: 'center'
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
starterText(`${prefix}heroTitle`, 'h2', headline, {
|
|
111
|
+
align: 'center'
|
|
112
|
+
}),
|
|
113
|
+
starterText(`${prefix}heroSub`, 'h6', tagline, {
|
|
114
|
+
align: 'center'
|
|
115
|
+
}),
|
|
116
|
+
{
|
|
117
|
+
id: `${prefix}heroCta`,
|
|
118
|
+
componentId: 'muiButton',
|
|
119
|
+
props: {
|
|
120
|
+
variant: 'contained',
|
|
121
|
+
size: 'large',
|
|
122
|
+
children: 'Get in touch'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=starter-template-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/starter-template-nodes.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CANVAS_ROOT_ELEMENT_ID } from '../foundation/constants/canvas'\n\n/**\n * What a starter site is, and the kit its pages are built with (AGL-687,\n * AGL-3080).\n *\n * A starter is a bundle of page templates the template gallery offers and\n * the seed route copies into a site's library on first use. The platform's\n * own starters live in `starter-templates.ts`; a plugin whose elements a\n * starter is built around declares its own, built with this same kit, and\n * the manifest generator compiles them into\n * `plugin-starter-templates.generated.ts`.\n *\n * Leaf imports only, for the reason `starter-templates.ts` states: this is\n * read from the console's client gallery, its seed route and a plugin's\n * server alike, so it imports a canvas constant and nothing that drags in\n * either barrel.\n *\n * PERSISTED IDENTIFIERS: `StarterTemplate.id`, `StarterTemplateScreen.key`\n * and every node id a starter builds appear in stored documents (seeded\n * template doc ids are derived from the first two). They must never be\n * renamed.\n */\nexport interface StarterTemplateScreen {\n /**\n * Stable, starter-local key. Part of the seeded document id, so it is a\n * persisted identifier — never rename one.\n */\n key: string\n displayName: string\n description?: string\n /**\n * Routing-map slug. `SCREEN_ROOT_PATH` (`'/'`) asks for the site root — the\n * home page — and anything else is a single path segment.\n *\n * It used to be `''` that meant home, which no normalizer agreed with: both\n * the apply path and the seed below read an empty string as \"no address\n * authored\" and derived one from the display name, so the shop starters'\n * home page was published at `/home` and the site 404'd at its own URL\n * (AGL-1575).\n */\n slug: string\n seo?: { title?: string; description?: string }\n /** Flat node map including the canvas root. */\n nodes: Record<string, any>\n}\n\nexport interface StarterTemplate {\n id: string\n displayName: string\n description: string\n category: string\n screens: StarterTemplateScreen[]\n}\n\n/** A materialized starter template document, keyed by its deterministic id. */\n\nexport type StarterNodeSpec = {\n id: string\n componentId: string\n /** Bundle owning the component; defaults to 'mui' (AGL-300). */\n pluginId?: string\n props?: Record<string, unknown>\n /**\n * Node-level styles — a SIBLING of props, never `props.sx` (AGL-1346).\n *\n * Both records render (`Leaf` composes `(sx, props.sx, node.sx)`, later\n * wins), but the Styles panel edits `node.sx`. A starter that seeded its\n * styling into `props.sx` handed the author a document full of values\n * the panel could show but no click could change or clear.\n */\n sx?: Record<string, unknown>\n children?: StarterNodeSpec[]\n}\n\n/** Builds the flat, persisted node map from a nested spec. */\nexport function buildStarterNodes(children: StarterNodeSpec[]): Record<string, any> {\n const map: Record<string, any> = {\n [CANVAS_ROOT_ELEMENT_ID]: {\n $id: CANVAS_ROOT_ELEMENT_ID,\n componentId: 'div',\n nodes: children.map((child) => child.id),\n },\n }\n const walk = (spec: StarterNodeSpec, parentId: string) => {\n map[spec.id] = {\n $id: spec.id,\n componentId: spec.componentId,\n pluginId: spec.pluginId ?? 'mui',\n parentId,\n props: spec.props ?? {},\n ...(spec.sx ? { sx: spec.sx } : {}),\n nodes: (spec.children ?? []).map((child) => child.id),\n }\n for (const child of spec.children ?? []) walk(child, spec.id)\n }\n for (const child of children) walk(child, CANVAS_ROOT_ELEMENT_ID)\n return map\n}\n\n/** One line of a starter's copy: a `muiTypography` of the given variant. */\nexport const starterText = (\n id: string,\n variant: string,\n children: string,\n extra?: Record<string, unknown>,\n): StarterNodeSpec => ({\n id,\n componentId: 'muiTypography',\n props: { variant, children, ...extra },\n})\n\n/**\n * The stock widths a starter band may be (AGL-1932, AGL-1298).\n *\n * Three cases, and only three, because the standard has three. There is no\n * pixel case: `1328` is a CONTENT width, not a breakpoint, and the ban on\n * bespoke numbers is the half of AGL-1298 these templates used to violate\n * four times over.\n */\nexport type StarterSectionWidth = 'md' | 'lg' | 'xl'\n\n/**\n * One page band: a `Container` at a stock width, carrying the band's own\n * vertical rhythm (AGL-1932).\n *\n * The layout standard (AGL-1298): every section is a Container. Full-bleed is\n * the Container's own full-width attribute, never the absence of a Container,\n * and anything else is one of three stock widths. A template that seeds no\n * Container hands every customer a site that starts outside the standard.\n *\n * How the three widths are chosen here, stated so the next audit does not\n * have to guess:\n *\n * - `xl` — a marketing band: hero, feature row, product grid, gallery. The\n * default width, and what an unremarkable page should be.\n * - `lg` — the deliberate middle case: wide but text-led and interactive.\n * Cart and account are the honest instances, not decoration.\n * - `md` — long-form prose and narrow form columns, on READING grounds: at\n * `xl` a paragraph runs 110–120 characters a line. This is the case the\n * `Prose Container` preset exists for.\n *\n * Horizontal padding is the Container's own gutters, so bands no longer carry\n * horizontal padding at all. Only the vertical rhythm rides here, which is\n * rhythm rather than width.\n *\n * Written as the two longhands rather than MUI's `py` (AGL-2207/2208): the\n * Styles panel's Padding control is named for the four sides, so a band\n * seeded with `py` handed the customer a document whose padding the panel\n * showed as empty and no click could clear.\n */\nexport const starterSection = (\n id: string,\n maxWidth: StarterSectionWidth,\n verticalPadding: number,\n children: StarterNodeSpec[],\n): StarterNodeSpec => ({\n id,\n componentId: 'muiContainer',\n props: { maxWidth },\n sx: { paddingTop: verticalPadding, paddingBottom: verticalPadding },\n children,\n})\n\n/**\n * The hero band a starter page opens with: a headline, a tagline and a call\n * to action, centered in an `xl` band. Its node ids are `prefix` plus fixed\n * names, so a starter's prefix keeps them its own.\n */\nexport const starterHeroSection = (\n prefix: string,\n headline: string,\n tagline: string,\n): StarterNodeSpec =>\n // The Container is a NEW node (`…heroSection`); `…hero` keeps its id and\n // stays the Stack. Node ids here are persisted identifiers, so bands are\n // wrapped rather than re-pointed.\n starterSection(`${prefix}heroSection`, 'xl', 10, [\n {\n id: `${prefix}hero`,\n componentId: 'muiStack',\n props: { spacing: 2 },\n sx: { alignItems: 'center' },\n children: [\n starterText(`${prefix}heroTitle`, 'h2', headline, { align: 'center' }),\n starterText(`${prefix}heroSub`, 'h6', tagline, { align: 'center' }),\n {\n id: `${prefix}heroCta`,\n componentId: 'muiButton',\n props: {\n variant: 'contained',\n size: 'large',\n children: 'Get in touch',\n },\n },\n ],\n },\n ])\n"],"names":["CANVAS_ROOT_ELEMENT_ID","buildStarterNodes","children","map","$id","componentId","nodes","child","id","walk","spec","parentId","pluginId","props","sx","starterText","variant","extra","starterSection","maxWidth","verticalPadding","paddingTop","paddingBottom","starterHeroSection","prefix","headline","tagline","spacing","alignItems","align","size"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,QAAQ,oCAAgC;AA2EvE,4DAA4D,GAC5D,OAAO,SAASC,kBAAkBC,QAA2B;IAC3D,MAAMC,MAA2B;QAC/B,CAACH,uBAAuB,EAAE;YACxBI,KAAKJ;YACLK,aAAa;YACbC,OAAOJ,SAASC,GAAG,CAAC,CAACI,QAAUA,MAAMC,EAAE;QACzC;IACF;IACA,MAAMC,OAAO,CAACC,MAAuBC;YAIvBD,gBAEHA,aAECA,gBAEUA;QATpBP,GAAG,CAACO,KAAKF,EAAE,CAAC,GAAG;YACbJ,KAAKM,KAAKF,EAAE;YACZH,aAAaK,KAAKL,WAAW;YAC7BO,QAAQ,GAAEF,iBAAAA,KAAKE,QAAQ,YAAbF,iBAAiB;YAC3BC;YACAE,KAAK,GAAEH,cAAAA,KAAKG,KAAK,YAAVH,cAAc,CAAC;WAClBA,KAAKI,EAAE,GAAG;YAAEA,IAAIJ,KAAKI,EAAE;QAAC,IAAI,CAAC;YACjCR,OAAO,EAACI,iBAAAA,KAAKR,QAAQ,YAAbQ,iBAAiB,EAAE,EAAEP,GAAG,CAAC,CAACI,QAAUA,MAAMC,EAAE;;QAEtD,KAAK,MAAMD,UAASG,kBAAAA,KAAKR,QAAQ,YAAbQ,kBAAiB,EAAE,CAAED,KAAKF,OAAOG,KAAKF,EAAE;IAC9D;IACA,KAAK,MAAMD,SAASL,SAAUO,KAAKF,OAAOP;IAC1C,OAAOG;AACT;AAEA,0EAA0E,GAC1E,OAAO,MAAMY,cAAc,CACzBP,IACAQ,SACAd,UACAe,QACqB,CAAA;QACrBT;QACAH,aAAa;QACbQ,OAAO;YAAEG;YAASd;WAAae;IACjC,CAAA,EAAE;AAYF;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,MAAMC,iBAAiB,CAC5BV,IACAW,UACAC,iBACAlB,WACqB,CAAA;QACrBM;QACAH,aAAa;QACbQ,OAAO;YAAEM;QAAS;QAClBL,IAAI;YAAEO,YAAYD;YAAiBE,eAAeF;QAAgB;QAClElB;IACF,CAAA,EAAE;AAEF;;;;CAIC,GACD,OAAO,MAAMqB,qBAAqB,CAChCC,QACAC,UACAC,UAEA,yEAAyE;IACzE,yEAAyE;IACzE,kCAAkC;IAClCR,eAAe,GAAGM,OAAO,WAAW,CAAC,EAAE,MAAM,IAAI;QAC/C;YACEhB,IAAI,GAAGgB,OAAO,IAAI,CAAC;YACnBnB,aAAa;YACbQ,OAAO;gBAAEc,SAAS;YAAE;YACpBb,IAAI;gBAAEc,YAAY;YAAS;YAC3B1B,UAAU;gBACRa,YAAY,GAAGS,OAAO,SAAS,CAAC,EAAE,MAAMC,UAAU;oBAAEI,OAAO;gBAAS;gBACpEd,YAAY,GAAGS,OAAO,OAAO,CAAC,EAAE,MAAME,SAAS;oBAAEG,OAAO;gBAAS;gBACjE;oBACErB,IAAI,GAAGgB,OAAO,OAAO,CAAC;oBACtBnB,aAAa;oBACbQ,OAAO;wBACLG,SAAS;wBACTc,MAAM;wBACN5B,UAAU;oBACZ;gBACF;aACD;QACH;KACD,EAAC"}
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { type StarterTemplate, type StarterTemplateScreen } from './starter-template-nodes';
|
|
18
|
+
export type { StarterNodeSpec, StarterSectionWidth, StarterTemplate, StarterTemplateScreen, } from './starter-template-nodes';
|
|
19
|
+
export { buildStarterNodes, starterHeroSection, starterSection, starterText, } from './starter-template-nodes';
|
|
17
20
|
/**
|
|
18
21
|
* First-party starter definitions (AGL-78/79), SEED INPUT (AGL-687).
|
|
19
22
|
*
|
|
@@ -36,40 +39,6 @@
|
|
|
36
39
|
* and every node id below appear in stored documents (seeded template doc
|
|
37
40
|
* ids are derived from the first two). They must never be renamed.
|
|
38
41
|
*/
|
|
39
|
-
export interface StarterTemplateScreen {
|
|
40
|
-
/**
|
|
41
|
-
* Stable, starter-local key. Part of the seeded document id, so it is a
|
|
42
|
-
* persisted identifier — never rename one.
|
|
43
|
-
*/
|
|
44
|
-
key: string;
|
|
45
|
-
displayName: string;
|
|
46
|
-
description?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Routing-map slug. `SCREEN_ROOT_PATH` (`'/'`) asks for the site root — the
|
|
49
|
-
* home page — and anything else is a single path segment.
|
|
50
|
-
*
|
|
51
|
-
* It used to be `''` that meant home, which no normalizer agreed with: both
|
|
52
|
-
* the apply path and the seed below read an empty string as "no address
|
|
53
|
-
* authored" and derived one from the display name, so the shop starters'
|
|
54
|
-
* home page was published at `/home` and the site 404'd at its own URL
|
|
55
|
-
* (AGL-1575).
|
|
56
|
-
*/
|
|
57
|
-
slug: string;
|
|
58
|
-
seo?: {
|
|
59
|
-
title?: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
};
|
|
62
|
-
/** Flat node map including the canvas root. */
|
|
63
|
-
nodes: Record<string, any>;
|
|
64
|
-
}
|
|
65
|
-
export interface StarterTemplate {
|
|
66
|
-
id: string;
|
|
67
|
-
displayName: string;
|
|
68
|
-
description: string;
|
|
69
|
-
category: string;
|
|
70
|
-
screens: StarterTemplateScreen[];
|
|
71
|
-
}
|
|
72
|
-
/** A materialized starter template document, keyed by its deterministic id. */
|
|
73
42
|
export interface StarterTemplateDoc {
|
|
74
43
|
id: string;
|
|
75
44
|
/** Which starter this page belongs to — lets one starter be selected. */
|
|
@@ -116,4 +85,12 @@ export declare function buildAllStarterTemplateDocs(): StarterTemplateDoc[];
|
|
|
116
85
|
* PERSISTED IDENTIFIERS: every node id below is stored on every new site.
|
|
117
86
|
*/
|
|
118
87
|
export declare function buildDefaultHomeScreen(siteName: string): StarterTemplateScreen;
|
|
88
|
+
/**
|
|
89
|
+
* Every starter in this build, in gallery order: the platform's own, then
|
|
90
|
+
* each plugin's in config order (AGL-3080). A plugin whose elements a starter
|
|
91
|
+
* is built around — a storefront's product grid and cart — declares it under
|
|
92
|
+
* `starterTemplates` in plugins.config.json, and the manifest generator
|
|
93
|
+
* compiles what it returns, so the gallery, the seed route and a model
|
|
94
|
+
* shown examples all read one list without loading any plugin.
|
|
95
|
+
*/
|
|
119
96
|
export declare const STARTER_TEMPLATES: StarterTemplate[];
|
|
@@ -19,11 +19,14 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
19
19
|
// it, the console's seed route materializes them, and the AI plugin's server
|
|
20
20
|
// shows them to a model — and neither barrel works in both: the full
|
|
21
21
|
// `@aglyn/aglyn` barrel breaks the RSC/server-route graph, while the server
|
|
22
|
-
// entry drags `node:fs` into the client bundle. The
|
|
23
|
-
// leaf with no imports of their own
|
|
24
|
-
//
|
|
25
|
-
|
|
22
|
+
// entry drags `node:fs` into the client bundle. The starter kit imports only
|
|
23
|
+
// the canvas constants, a leaf with no imports of their own; the compiled
|
|
24
|
+
// plugin starters are data behind a type-only import; and `screen-route`
|
|
25
|
+
// imports only a TYPE from foundation — so all three are safe on either side.
|
|
26
|
+
import { PLUGIN_STARTER_TEMPLATES } from "./plugin-starter-templates.generated.js";
|
|
26
27
|
import { normalizeScreenSlug, SCREEN_ROOT_PATH } from "./screen-route.js";
|
|
28
|
+
import { buildStarterNodes as buildNodes, starterHeroSection as heroSection, starterSection as section, starterText as text } from "./starter-template-nodes.js";
|
|
29
|
+
export { buildStarterNodes, starterHeroSection, starterSection, starterText } from "./starter-template-nodes.js";
|
|
27
30
|
/**
|
|
28
31
|
* Deterministic document id for a seeded starter screen (AGL-687).
|
|
29
32
|
*
|
|
@@ -79,112 +82,6 @@ import { normalizeScreenSlug, SCREEN_ROOT_PATH } from "./screen-route.js";
|
|
|
79
82
|
/** Every document a starter COULD materialize as, in bundle order. */ export function buildAllStarterTemplateDocs() {
|
|
80
83
|
return STARTER_TEMPLATES.flatMap(buildStarterTemplateDocs);
|
|
81
84
|
}
|
|
82
|
-
/** Builds the flat, persisted node map from a nested spec. */ function buildNodes(children) {
|
|
83
|
-
const map = {
|
|
84
|
-
[CANVAS_ROOT_ELEMENT_ID]: {
|
|
85
|
-
$id: CANVAS_ROOT_ELEMENT_ID,
|
|
86
|
-
componentId: 'div',
|
|
87
|
-
nodes: children.map((child)=>child.id)
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const walk = (spec, parentId)=>{
|
|
91
|
-
var _spec_pluginId, _spec_props, _spec_children, _spec_children1;
|
|
92
|
-
map[spec.id] = _extends({
|
|
93
|
-
$id: spec.id,
|
|
94
|
-
componentId: spec.componentId,
|
|
95
|
-
pluginId: (_spec_pluginId = spec.pluginId) != null ? _spec_pluginId : 'mui',
|
|
96
|
-
parentId,
|
|
97
|
-
props: (_spec_props = spec.props) != null ? _spec_props : {}
|
|
98
|
-
}, spec.sx ? {
|
|
99
|
-
sx: spec.sx
|
|
100
|
-
} : {}, {
|
|
101
|
-
nodes: ((_spec_children = spec.children) != null ? _spec_children : []).map((child)=>child.id)
|
|
102
|
-
});
|
|
103
|
-
for (const child of (_spec_children1 = spec.children) != null ? _spec_children1 : [])walk(child, spec.id);
|
|
104
|
-
};
|
|
105
|
-
for (const child of children)walk(child, CANVAS_ROOT_ELEMENT_ID);
|
|
106
|
-
return map;
|
|
107
|
-
}
|
|
108
|
-
const text = (id, variant, children, extra)=>({
|
|
109
|
-
id,
|
|
110
|
-
componentId: 'muiTypography',
|
|
111
|
-
props: _extends({
|
|
112
|
-
variant,
|
|
113
|
-
children
|
|
114
|
-
}, extra)
|
|
115
|
-
});
|
|
116
|
-
/**
|
|
117
|
-
* One page band: a `Container` at a stock width, carrying the band's own
|
|
118
|
-
* vertical rhythm (AGL-1932).
|
|
119
|
-
*
|
|
120
|
-
* The layout standard (AGL-1298): every section is a Container. Full-bleed is
|
|
121
|
-
* the Container's own full-width attribute, never the absence of a Container,
|
|
122
|
-
* and anything else is one of three stock widths. A template that seeds no
|
|
123
|
-
* Container hands every customer a site that starts outside the standard.
|
|
124
|
-
*
|
|
125
|
-
* How the three widths are chosen here, stated so the next audit does not
|
|
126
|
-
* have to guess:
|
|
127
|
-
*
|
|
128
|
-
* - `xl` — a marketing band: hero, feature row, product grid, gallery. The
|
|
129
|
-
* default width, and what an unremarkable page should be.
|
|
130
|
-
* - `lg` — the deliberate middle case: wide but text-led and interactive.
|
|
131
|
-
* Cart and account are the honest instances, not decoration.
|
|
132
|
-
* - `md` — long-form prose and narrow form columns, on READING grounds: at
|
|
133
|
-
* `xl` a paragraph runs 110–120 characters a line. This is the case the
|
|
134
|
-
* `Prose Container` preset exists for.
|
|
135
|
-
*
|
|
136
|
-
* Horizontal padding is the Container's own gutters, so bands no longer carry
|
|
137
|
-
* horizontal padding at all. Only the vertical rhythm rides here, which is
|
|
138
|
-
* rhythm rather than width.
|
|
139
|
-
*
|
|
140
|
-
* Written as the two longhands rather than MUI's `py` (AGL-2207/2208): the
|
|
141
|
-
* Styles panel's Padding control is named for the four sides, so a band
|
|
142
|
-
* seeded with `py` handed the customer a document whose padding the panel
|
|
143
|
-
* showed as empty and no click could clear.
|
|
144
|
-
*/ const section = (id, maxWidth, verticalPadding, children)=>({
|
|
145
|
-
id,
|
|
146
|
-
componentId: 'muiContainer',
|
|
147
|
-
props: {
|
|
148
|
-
maxWidth
|
|
149
|
-
},
|
|
150
|
-
sx: {
|
|
151
|
-
paddingTop: verticalPadding,
|
|
152
|
-
paddingBottom: verticalPadding
|
|
153
|
-
},
|
|
154
|
-
children
|
|
155
|
-
});
|
|
156
|
-
const heroSection = (prefix, headline, tagline)=>// The Container is a NEW node (`…heroSection`); `…hero` keeps its id and
|
|
157
|
-
// stays the Stack. Node ids here are persisted identifiers, so bands are
|
|
158
|
-
// wrapped rather than re-pointed.
|
|
159
|
-
section(`${prefix}heroSection`, 'xl', 10, [
|
|
160
|
-
{
|
|
161
|
-
id: `${prefix}hero`,
|
|
162
|
-
componentId: 'muiStack',
|
|
163
|
-
props: {
|
|
164
|
-
spacing: 2
|
|
165
|
-
},
|
|
166
|
-
sx: {
|
|
167
|
-
alignItems: 'center'
|
|
168
|
-
},
|
|
169
|
-
children: [
|
|
170
|
-
text(`${prefix}heroTitle`, 'h2', headline, {
|
|
171
|
-
align: 'center'
|
|
172
|
-
}),
|
|
173
|
-
text(`${prefix}heroSub`, 'h6', tagline, {
|
|
174
|
-
align: 'center'
|
|
175
|
-
}),
|
|
176
|
-
{
|
|
177
|
-
id: `${prefix}heroCta`,
|
|
178
|
-
componentId: 'muiButton',
|
|
179
|
-
props: {
|
|
180
|
-
variant: 'contained',
|
|
181
|
-
size: 'large',
|
|
182
|
-
children: 'Get in touch'
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
]);
|
|
188
85
|
const featureColumn = (id, title, body)=>({
|
|
189
86
|
id,
|
|
190
87
|
componentId: 'muiStack',
|
|
@@ -245,111 +142,6 @@ const contactForm = (prefix)=>({
|
|
|
245
142
|
}
|
|
246
143
|
]
|
|
247
144
|
});
|
|
248
|
-
const commerceBlock = (id, componentId, props)=>({
|
|
249
|
-
id,
|
|
250
|
-
componentId,
|
|
251
|
-
pluginId: 'commerce',
|
|
252
|
-
props
|
|
253
|
-
});
|
|
254
|
-
/** Shared screens for the shop starters (AGL-300). */ function shopScreens(prefix, digital) {
|
|
255
|
-
return [
|
|
256
|
-
{
|
|
257
|
-
key: 'home',
|
|
258
|
-
displayName: 'Home',
|
|
259
|
-
// The site root, spelled the way the routing map spells it. `''` here
|
|
260
|
-
// read as "no address" everywhere downstream and put the shop's home
|
|
261
|
-
// page at `/home` (AGL-1575).
|
|
262
|
-
slug: SCREEN_ROOT_PATH,
|
|
263
|
-
seo: {
|
|
264
|
-
title: digital ? 'Digital shop' : 'Shop',
|
|
265
|
-
description: 'Browse our products.'
|
|
266
|
-
},
|
|
267
|
-
nodes: buildNodes([
|
|
268
|
-
heroSection(`${prefix}h_`, digital ? 'Downloads that level you up' : 'Gear you can trust', digital ? 'Instant delivery. Lifetime updates.' : 'Quality parts, shipped fast.'),
|
|
269
|
-
section(`${prefix}h_gridSection`, 'xl', 6, [
|
|
270
|
-
commerceBlock(`${prefix}h_grid`, 'product-grid', {
|
|
271
|
-
source: 'all',
|
|
272
|
-
sort: 'newest',
|
|
273
|
-
columns: 3,
|
|
274
|
-
maxItems: 6
|
|
275
|
-
})
|
|
276
|
-
]),
|
|
277
|
-
// A newsletter capture is a short text-led band, not a gallery.
|
|
278
|
-
section(`${prefix}h_newsSection`, 'md', 6, [
|
|
279
|
-
commerceBlock(`${prefix}h_news`, 'newsletter-signup', {
|
|
280
|
-
heading: 'Get updates and offers'
|
|
281
|
-
})
|
|
282
|
-
])
|
|
283
|
-
])
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
key: 'shop',
|
|
287
|
-
displayName: 'Shop',
|
|
288
|
-
slug: 'shop',
|
|
289
|
-
seo: {
|
|
290
|
-
title: 'All products'
|
|
291
|
-
},
|
|
292
|
-
nodes: buildNodes([
|
|
293
|
-
section(`${prefix}s_section`, 'xl', 6, [
|
|
294
|
-
text(`${prefix}s_title`, 'h3', 'All products'),
|
|
295
|
-
commerceBlock(`${prefix}s_grid`, 'product-grid', {
|
|
296
|
-
source: 'all',
|
|
297
|
-
columns: 4,
|
|
298
|
-
showFilters: true
|
|
299
|
-
})
|
|
300
|
-
])
|
|
301
|
-
])
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
key: 'product',
|
|
305
|
-
displayName: 'Product page',
|
|
306
|
-
slug: 'product',
|
|
307
|
-
seo: {
|
|
308
|
-
title: 'Product'
|
|
309
|
-
},
|
|
310
|
-
nodes: buildNodes([
|
|
311
|
-
section(`${prefix}p_section`, 'xl', 6, [
|
|
312
|
-
commerceBlock(`${prefix}p_detail`, 'product-detail', {})
|
|
313
|
-
])
|
|
314
|
-
])
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
key: 'cart',
|
|
318
|
-
displayName: 'Cart',
|
|
319
|
-
slug: 'cart',
|
|
320
|
-
seo: {
|
|
321
|
-
title: 'Your cart'
|
|
322
|
-
},
|
|
323
|
-
// LG, the deliberate middle case: a cart is a wide table but it is read
|
|
324
|
-
// line by line, so a full XL band spreads it further than the eye
|
|
325
|
-
// tracks. Same for the account screen below.
|
|
326
|
-
nodes: buildNodes([
|
|
327
|
-
section(`${prefix}c_section`, 'lg', 6, [
|
|
328
|
-
text(`${prefix}c_title`, 'h3', 'Your cart'),
|
|
329
|
-
commerceBlock(`${prefix}c_cart`, 'cart', {
|
|
330
|
-
variant: 'inline',
|
|
331
|
-
showCoupon: true
|
|
332
|
-
})
|
|
333
|
-
])
|
|
334
|
-
])
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
key: 'account',
|
|
338
|
-
displayName: 'Account',
|
|
339
|
-
slug: 'account',
|
|
340
|
-
seo: {
|
|
341
|
-
title: 'Your account'
|
|
342
|
-
},
|
|
343
|
-
nodes: buildNodes([
|
|
344
|
-
section(`${prefix}a_section`, 'lg', 6, [
|
|
345
|
-
commerceBlock(`${prefix}a_account`, 'customer-account', {
|
|
346
|
-
signedOutHeading: 'Your account'
|
|
347
|
-
})
|
|
348
|
-
])
|
|
349
|
-
])
|
|
350
|
-
}
|
|
351
|
-
];
|
|
352
|
-
}
|
|
353
145
|
/**
|
|
354
146
|
* The home page every new site is born with (AGL-3408).
|
|
355
147
|
*
|
|
@@ -399,7 +191,7 @@ const commerceBlock = (id, componentId, props)=>({
|
|
|
399
191
|
])
|
|
400
192
|
};
|
|
401
193
|
}
|
|
402
|
-
|
|
194
|
+
/** The platform's own starters, which name no plugin's elements. */ const PLATFORM_STARTER_TEMPLATES = [
|
|
403
195
|
{
|
|
404
196
|
id: 'landing',
|
|
405
197
|
displayName: 'Landing Page',
|
|
@@ -608,21 +400,18 @@ export const STARTER_TEMPLATES = [
|
|
|
608
400
|
])
|
|
609
401
|
}
|
|
610
402
|
]
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
id: 'physical-shop',
|
|
614
|
-
displayName: 'Shop (physical products)',
|
|
615
|
-
description: 'Storefront starter: home with featured products, filterable shop, ' + 'product page, cart, and customer accounts. After applying, set the ' + 'Product page as the product template in Store settings.',
|
|
616
|
-
category: 'Commerce',
|
|
617
|
-
screens: shopScreens('ps_', false)
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
id: 'digital-shop',
|
|
621
|
-
displayName: 'Shop (digital products)',
|
|
622
|
-
description: 'Digital storefront starter: downloads-focused home, shop, product ' + 'page, cart, and accounts with a newsletter capture. Set the Product ' + 'page as the product template in Store settings after applying.',
|
|
623
|
-
category: 'Commerce',
|
|
624
|
-
screens: shopScreens('ds_', true)
|
|
625
403
|
}
|
|
626
404
|
];
|
|
405
|
+
/**
|
|
406
|
+
* Every starter in this build, in gallery order: the platform's own, then
|
|
407
|
+
* each plugin's in config order (AGL-3080). A plugin whose elements a starter
|
|
408
|
+
* is built around — a storefront's product grid and cart — declares it under
|
|
409
|
+
* `starterTemplates` in plugins.config.json, and the manifest generator
|
|
410
|
+
* compiles what it returns, so the gallery, the seed route and a model
|
|
411
|
+
* shown examples all read one list without loading any plugin.
|
|
412
|
+
*/ export const STARTER_TEMPLATES = [
|
|
413
|
+
...PLATFORM_STARTER_TEMPLATES,
|
|
414
|
+
...PLUGIN_STARTER_TEMPLATES
|
|
415
|
+
];
|
|
627
416
|
|
|
628
417
|
//# sourceMappingURL=starter-templates.js.map
|