@nersh/render 0.3.0 → 0.4.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/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/index.cjs +19040 -4182
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +36 -7
- package/dist/index.d.ts +36 -7
- package/dist/index.mjs +19208 -4350
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -470,6 +470,10 @@ type SiteBrief = {
|
|
|
470
470
|
location?: string;
|
|
471
471
|
primaryGoal?: SiteGoalId;
|
|
472
472
|
referenceUrls?: string[];
|
|
473
|
+
/** Plan names in the order the person gave them ("Free, Pro and Team"). */
|
|
474
|
+
plans?: string[];
|
|
475
|
+
/** Product names the person sells ("cast iron skillet"). */
|
|
476
|
+
products?: string[];
|
|
473
477
|
freeformNotes?: string;
|
|
474
478
|
/** Prompt-template catalog id when the site started from a template; its kitSeed steers Stage 1. */
|
|
475
479
|
templateId?: string;
|
|
@@ -514,8 +518,8 @@ type Complete = {
|
|
|
514
518
|
/** Taxonomy-correlated copy per DesignSpec section — display/count only, never persisted as-is. */
|
|
515
519
|
sections: CompleteSection[];
|
|
516
520
|
/**
|
|
517
|
-
* The real, pattern-aware tree to persist (
|
|
518
|
-
*
|
|
521
|
+
* The real, pattern-aware tree to persist, expanded when the Complete was stored (nothing
|
|
522
|
+
* writes a new one) — a literal section's own copy lands here under its
|
|
519
523
|
* unchanged sectionId/instanceId; a taxonomy section's copy is translated first.
|
|
520
524
|
*/
|
|
521
525
|
structure: SectionInstance[];
|
|
@@ -745,6 +749,11 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
745
749
|
pin: "pin";
|
|
746
750
|
hide: "hide";
|
|
747
751
|
}>>;
|
|
752
|
+
system: z.ZodOptional<z.ZodEnum<{
|
|
753
|
+
cart: "cart";
|
|
754
|
+
product: "product";
|
|
755
|
+
order: "order";
|
|
756
|
+
}>>;
|
|
748
757
|
}, z.core.$strip>>>;
|
|
749
758
|
brandColor: z.ZodOptional<z.ZodString>;
|
|
750
759
|
theme: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -754,18 +763,18 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
754
763
|
}>;
|
|
755
764
|
accent: z.ZodString;
|
|
756
765
|
typeCategory: z.ZodEnum<{
|
|
757
|
-
sans: "sans";
|
|
758
|
-
serif: "serif";
|
|
759
766
|
mono: "mono";
|
|
760
767
|
display: "display";
|
|
768
|
+
sans: "sans";
|
|
769
|
+
serif: "serif";
|
|
761
770
|
handwriting: "handwriting";
|
|
762
771
|
}>;
|
|
763
772
|
}, z.core.$strip>]>>;
|
|
764
773
|
designSystemId: z.ZodOptional<z.ZodString>;
|
|
765
774
|
skinId: z.ZodOptional<z.ZodString>;
|
|
766
775
|
surfaceKind: z.ZodOptional<z.ZodEnum<{
|
|
767
|
-
marketing: "marketing";
|
|
768
776
|
store: "store";
|
|
777
|
+
marketing: "marketing";
|
|
769
778
|
}>>;
|
|
770
779
|
seo: z.ZodOptional<z.ZodObject<{
|
|
771
780
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -883,6 +892,7 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
883
892
|
}>>;
|
|
884
893
|
footerAttributionText: z.ZodOptional<z.ZodString>;
|
|
885
894
|
footerCopyrightText: z.ZodOptional<z.ZodString>;
|
|
895
|
+
footerCopyrightHidden: z.ZodOptional<z.ZodBoolean>;
|
|
886
896
|
footerDonateEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
887
897
|
footerDonateWhenHidden: z.ZodOptional<z.ZodBoolean>;
|
|
888
898
|
customDomain: z.ZodOptional<z.ZodString>;
|
|
@@ -914,6 +924,7 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
914
924
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
915
925
|
currency: z.ZodDefault<z.ZodString>;
|
|
916
926
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
927
|
+
site: "site";
|
|
917
928
|
printful: "printful";
|
|
918
929
|
}>>;
|
|
919
930
|
cartPath: z.ZodOptional<z.ZodString>;
|
|
@@ -935,8 +946,8 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
935
946
|
brief: z.ZodOptional<z.ZodObject<{
|
|
936
947
|
name: z.ZodString;
|
|
937
948
|
category: z.ZodEnum<{
|
|
938
|
-
"local-service": "local-service";
|
|
939
949
|
portfolio: "portfolio";
|
|
950
|
+
"local-service": "local-service";
|
|
940
951
|
"link-in-bio": "link-in-bio";
|
|
941
952
|
creator: "creator";
|
|
942
953
|
hospitality: "hospitality";
|
|
@@ -970,6 +981,8 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
970
981
|
donate: "donate";
|
|
971
982
|
}>>;
|
|
972
983
|
referenceUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
984
|
+
plans: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
985
|
+
products: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
973
986
|
freeformNotes: z.ZodOptional<z.ZodString>;
|
|
974
987
|
templateId: z.ZodOptional<z.ZodString>;
|
|
975
988
|
remix: z.ZodOptional<z.ZodObject<{
|
|
@@ -1180,6 +1193,13 @@ interface SectionProps {
|
|
|
1180
1193
|
* drops its preset classes for `grid-cols-12`; absent means nothing changes.
|
|
1181
1194
|
*/
|
|
1182
1195
|
childSpans?: number[];
|
|
1196
|
+
/**
|
|
1197
|
+
* The section ids of the children in `slotContent`, in order, hidden ones left out. Set by
|
|
1198
|
+
* the renderers on any node that holds children, so a frame can lay its own copy out around
|
|
1199
|
+
* what it holds (block-card: a leading picture tops the card, a nested heading takes over
|
|
1200
|
+
* the card's title).
|
|
1201
|
+
*/
|
|
1202
|
+
childIds?: string[];
|
|
1183
1203
|
/** `layout-container` only. Cross-child gap step, from the node's `gap` field. */
|
|
1184
1204
|
gap?: 'flush' | 'tight' | 'default' | 'wide';
|
|
1185
1205
|
/** `layout-container` only. Cross-axis alignment, from the node's `align` field. */
|
|
@@ -1203,6 +1223,13 @@ interface SectionProps {
|
|
|
1203
1223
|
* (`imageSlotProps`), so a Media drag can land on it. Hosted renders never set it.
|
|
1204
1224
|
*/
|
|
1205
1225
|
editorMarkers?: boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* `layout-section` only. The Code Embed child the renderer lifted out of the flow
|
|
1228
|
+
* (`splitBackground`), drawn behind the band's content.
|
|
1229
|
+
*/
|
|
1230
|
+
backgroundSlot?: ReactNode;
|
|
1231
|
+
/** Set by a renderer on the one child it renders into `backgroundSlot`. */
|
|
1232
|
+
asBackground?: boolean;
|
|
1206
1233
|
/** Builder-only — open insert drawer on a tab (layout shells). */
|
|
1207
1234
|
builderInsert?: {
|
|
1208
1235
|
openTab: (tab: 'structure' | 'components') => void;
|
|
@@ -1217,13 +1244,15 @@ interface SiteRendererProps {
|
|
|
1217
1244
|
scope?: string;
|
|
1218
1245
|
/** Layer 2 structural styles. Omit for pure CSS-var tokens (Layer 1). */
|
|
1219
1246
|
compiledSkin?: CompiledSkin;
|
|
1247
|
+
/** `'run'` lets Code Embed blocks run the author's code in their sealed frame; absent or `'off'`, they show their fallback. */
|
|
1248
|
+
codeEmbed?: "run" | "off";
|
|
1220
1249
|
}
|
|
1221
1250
|
/**
|
|
1222
1251
|
* Framework-agnostic, synchronous composition renderer.
|
|
1223
1252
|
* Mirrors the hosted CompositionRenderer loop without RSC/async/Firebase:
|
|
1224
1253
|
* sections are supplied via `registry` rather than the global getSection.
|
|
1225
1254
|
*/
|
|
1226
|
-
declare function SiteRenderer({ site, registry, scope, compiledSkin }: SiteRendererProps): React.JSX.Element;
|
|
1255
|
+
declare function SiteRenderer({ site, registry, scope, compiledSkin, codeEmbed }: SiteRendererProps): React.JSX.Element;
|
|
1227
1256
|
|
|
1228
1257
|
/** Render a composition to a static HTML string (no React runtime needed). */
|
|
1229
1258
|
declare function renderSiteToHtml(site: CompositionSite, registry: SectionRegistry, scope?: string, compiledSkin?: CompiledSkin): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -470,6 +470,10 @@ type SiteBrief = {
|
|
|
470
470
|
location?: string;
|
|
471
471
|
primaryGoal?: SiteGoalId;
|
|
472
472
|
referenceUrls?: string[];
|
|
473
|
+
/** Plan names in the order the person gave them ("Free, Pro and Team"). */
|
|
474
|
+
plans?: string[];
|
|
475
|
+
/** Product names the person sells ("cast iron skillet"). */
|
|
476
|
+
products?: string[];
|
|
473
477
|
freeformNotes?: string;
|
|
474
478
|
/** Prompt-template catalog id when the site started from a template; its kitSeed steers Stage 1. */
|
|
475
479
|
templateId?: string;
|
|
@@ -514,8 +518,8 @@ type Complete = {
|
|
|
514
518
|
/** Taxonomy-correlated copy per DesignSpec section — display/count only, never persisted as-is. */
|
|
515
519
|
sections: CompleteSection[];
|
|
516
520
|
/**
|
|
517
|
-
* The real, pattern-aware tree to persist (
|
|
518
|
-
*
|
|
521
|
+
* The real, pattern-aware tree to persist, expanded when the Complete was stored (nothing
|
|
522
|
+
* writes a new one) — a literal section's own copy lands here under its
|
|
519
523
|
* unchanged sectionId/instanceId; a taxonomy section's copy is translated first.
|
|
520
524
|
*/
|
|
521
525
|
structure: SectionInstance[];
|
|
@@ -745,6 +749,11 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
745
749
|
pin: "pin";
|
|
746
750
|
hide: "hide";
|
|
747
751
|
}>>;
|
|
752
|
+
system: z.ZodOptional<z.ZodEnum<{
|
|
753
|
+
cart: "cart";
|
|
754
|
+
product: "product";
|
|
755
|
+
order: "order";
|
|
756
|
+
}>>;
|
|
748
757
|
}, z.core.$strip>>>;
|
|
749
758
|
brandColor: z.ZodOptional<z.ZodString>;
|
|
750
759
|
theme: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -754,18 +763,18 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
754
763
|
}>;
|
|
755
764
|
accent: z.ZodString;
|
|
756
765
|
typeCategory: z.ZodEnum<{
|
|
757
|
-
sans: "sans";
|
|
758
|
-
serif: "serif";
|
|
759
766
|
mono: "mono";
|
|
760
767
|
display: "display";
|
|
768
|
+
sans: "sans";
|
|
769
|
+
serif: "serif";
|
|
761
770
|
handwriting: "handwriting";
|
|
762
771
|
}>;
|
|
763
772
|
}, z.core.$strip>]>>;
|
|
764
773
|
designSystemId: z.ZodOptional<z.ZodString>;
|
|
765
774
|
skinId: z.ZodOptional<z.ZodString>;
|
|
766
775
|
surfaceKind: z.ZodOptional<z.ZodEnum<{
|
|
767
|
-
marketing: "marketing";
|
|
768
776
|
store: "store";
|
|
777
|
+
marketing: "marketing";
|
|
769
778
|
}>>;
|
|
770
779
|
seo: z.ZodOptional<z.ZodObject<{
|
|
771
780
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -883,6 +892,7 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
883
892
|
}>>;
|
|
884
893
|
footerAttributionText: z.ZodOptional<z.ZodString>;
|
|
885
894
|
footerCopyrightText: z.ZodOptional<z.ZodString>;
|
|
895
|
+
footerCopyrightHidden: z.ZodOptional<z.ZodBoolean>;
|
|
886
896
|
footerDonateEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
887
897
|
footerDonateWhenHidden: z.ZodOptional<z.ZodBoolean>;
|
|
888
898
|
customDomain: z.ZodOptional<z.ZodString>;
|
|
@@ -914,6 +924,7 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
914
924
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
915
925
|
currency: z.ZodDefault<z.ZodString>;
|
|
916
926
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
927
|
+
site: "site";
|
|
917
928
|
printful: "printful";
|
|
918
929
|
}>>;
|
|
919
930
|
cartPath: z.ZodOptional<z.ZodString>;
|
|
@@ -935,8 +946,8 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
935
946
|
brief: z.ZodOptional<z.ZodObject<{
|
|
936
947
|
name: z.ZodString;
|
|
937
948
|
category: z.ZodEnum<{
|
|
938
|
-
"local-service": "local-service";
|
|
939
949
|
portfolio: "portfolio";
|
|
950
|
+
"local-service": "local-service";
|
|
940
951
|
"link-in-bio": "link-in-bio";
|
|
941
952
|
creator: "creator";
|
|
942
953
|
hospitality: "hospitality";
|
|
@@ -970,6 +981,8 @@ declare const CompositionSiteSchema: z.ZodObject<{
|
|
|
970
981
|
donate: "donate";
|
|
971
982
|
}>>;
|
|
972
983
|
referenceUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
984
|
+
plans: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
985
|
+
products: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
973
986
|
freeformNotes: z.ZodOptional<z.ZodString>;
|
|
974
987
|
templateId: z.ZodOptional<z.ZodString>;
|
|
975
988
|
remix: z.ZodOptional<z.ZodObject<{
|
|
@@ -1180,6 +1193,13 @@ interface SectionProps {
|
|
|
1180
1193
|
* drops its preset classes for `grid-cols-12`; absent means nothing changes.
|
|
1181
1194
|
*/
|
|
1182
1195
|
childSpans?: number[];
|
|
1196
|
+
/**
|
|
1197
|
+
* The section ids of the children in `slotContent`, in order, hidden ones left out. Set by
|
|
1198
|
+
* the renderers on any node that holds children, so a frame can lay its own copy out around
|
|
1199
|
+
* what it holds (block-card: a leading picture tops the card, a nested heading takes over
|
|
1200
|
+
* the card's title).
|
|
1201
|
+
*/
|
|
1202
|
+
childIds?: string[];
|
|
1183
1203
|
/** `layout-container` only. Cross-child gap step, from the node's `gap` field. */
|
|
1184
1204
|
gap?: 'flush' | 'tight' | 'default' | 'wide';
|
|
1185
1205
|
/** `layout-container` only. Cross-axis alignment, from the node's `align` field. */
|
|
@@ -1203,6 +1223,13 @@ interface SectionProps {
|
|
|
1203
1223
|
* (`imageSlotProps`), so a Media drag can land on it. Hosted renders never set it.
|
|
1204
1224
|
*/
|
|
1205
1225
|
editorMarkers?: boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* `layout-section` only. The Code Embed child the renderer lifted out of the flow
|
|
1228
|
+
* (`splitBackground`), drawn behind the band's content.
|
|
1229
|
+
*/
|
|
1230
|
+
backgroundSlot?: ReactNode;
|
|
1231
|
+
/** Set by a renderer on the one child it renders into `backgroundSlot`. */
|
|
1232
|
+
asBackground?: boolean;
|
|
1206
1233
|
/** Builder-only — open insert drawer on a tab (layout shells). */
|
|
1207
1234
|
builderInsert?: {
|
|
1208
1235
|
openTab: (tab: 'structure' | 'components') => void;
|
|
@@ -1217,13 +1244,15 @@ interface SiteRendererProps {
|
|
|
1217
1244
|
scope?: string;
|
|
1218
1245
|
/** Layer 2 structural styles. Omit for pure CSS-var tokens (Layer 1). */
|
|
1219
1246
|
compiledSkin?: CompiledSkin;
|
|
1247
|
+
/** `'run'` lets Code Embed blocks run the author's code in their sealed frame; absent or `'off'`, they show their fallback. */
|
|
1248
|
+
codeEmbed?: "run" | "off";
|
|
1220
1249
|
}
|
|
1221
1250
|
/**
|
|
1222
1251
|
* Framework-agnostic, synchronous composition renderer.
|
|
1223
1252
|
* Mirrors the hosted CompositionRenderer loop without RSC/async/Firebase:
|
|
1224
1253
|
* sections are supplied via `registry` rather than the global getSection.
|
|
1225
1254
|
*/
|
|
1226
|
-
declare function SiteRenderer({ site, registry, scope, compiledSkin }: SiteRendererProps): React.JSX.Element;
|
|
1255
|
+
declare function SiteRenderer({ site, registry, scope, compiledSkin, codeEmbed }: SiteRendererProps): React.JSX.Element;
|
|
1227
1256
|
|
|
1228
1257
|
/** Render a composition to a static HTML string (no React runtime needed). */
|
|
1229
1258
|
declare function renderSiteToHtml(site: CompositionSite, registry: SectionRegistry, scope?: string, compiledSkin?: CompiledSkin): string;
|