@classic-homes/slides 0.5.12 → 0.6.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/README.md +1 -1
- package/dist/{chunk-42YDHMNB.js → chunk-7NSNE5ED.js} +18 -5
- package/dist/{chunk-42YDHMNB.js.map → chunk-7NSNE5ED.js.map} +1 -1
- package/dist/{chunk-6CYZI27I.js → chunk-B3MBJRHZ.js} +2 -2
- package/dist/{chunk-25NZMEQG.js → chunk-KQXT376T.js} +564 -34
- package/dist/chunk-KQXT376T.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/{echarts-render-2QVSBZ6V.js → echarts-render-GDCT5QAF.js} +17 -3
- package/dist/echarts-render-GDCT5QAF.js.map +1 -0
- package/dist/{images-8N30SsCW.d.ts → images-DCwWhenK.d.ts} +2 -2
- package/dist/index.d.ts +29 -8
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{mcp-P3CPIO3H.js → mcp-VBUAVGHS.js} +4 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-25NZMEQG.js.map +0 -1
- package/dist/echarts-render-2QVSBZ6V.js.map +0 -1
- /package/dist/{chunk-6CYZI27I.js.map → chunk-B3MBJRHZ.js.map} +0 -0
- /package/dist/{mcp-P3CPIO3H.js.map → mcp-VBUAVGHS.js.map} +0 -0
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Every slide also accepts `track` (value/red, build/teal, neutral/navy),
|
|
|
85
85
|
- layout: chart
|
|
86
86
|
title: Closings *doubled* since spring
|
|
87
87
|
chart:
|
|
88
|
-
type: column # bar, stacked
|
|
88
|
+
type: column # bar, stacked-*, percent-*, line, area, combo, pie, donut, treemap, funnel, waterfall, gauge, ring, bullet, dumbbell, heatmap, sankey, pictogram, scatter, radar
|
|
89
89
|
labels: [Q1, Q2, Q3, Q4]
|
|
90
90
|
series: [{ name: Closings, values: [42, 61, 88, 94] }]
|
|
91
91
|
unit: homes
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
LAYOUT_CATEGORIES,
|
|
7
7
|
baseSlide,
|
|
8
8
|
getLayout
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KQXT376T.js";
|
|
10
10
|
|
|
11
11
|
// src/catalog.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -89,9 +89,22 @@ set colours, fonts or sizes directly, which is what keeps every deck on-brand.
|
|
|
89
89
|
- **Wrap-up:** \`qr\` (send people somewhere), \`contacts\`, closing \`statement\`.
|
|
90
90
|
|
|
91
91
|
## Charts
|
|
92
|
-
\`chart.labels\` are the categories; each series has one value per label.
|
|
93
|
-
|
|
94
|
-
\`
|
|
92
|
+
\`chart.labels\` are the categories; each series has one value per label. Use \`highlight\` to
|
|
93
|
+
emphasise one category and \`format\`/\`unit\` instead of typing symbols into numbers.
|
|
94
|
+
- **Compare:** \`column\`/\`bar\`; \`dumbbell\` (2+ series as dots per row, e.g. last year vs this
|
|
95
|
+
year); \`bullet\` (series 1 actual, series 2 target; \`max\` sets the track).
|
|
96
|
+
- **Part of whole:** \`stacked-*\` (absolute), \`percent-column\`/\`percent-bar\` (each row = 100%),
|
|
97
|
+
\`pie\`/\`donut\` (\u2264 7 slices), \`treemap\` (many categories).
|
|
98
|
+
- **Change:** \`line\`/\`area\`; \`combo\` (series 1 bars, the rest lines; set a series' \`as\` to
|
|
99
|
+
override and \`axis: secondary\` + \`secondaryFormat\` for a second scale, e.g. closings and average
|
|
100
|
+
price); \`waterfall\` (series 1 is signed changes; list running-total rows in \`totals\`).
|
|
101
|
+
- **Single value:** \`gauge\` (one value, needs \`max\`); \`ring\` (up to 4 progress rings, one per label;
|
|
102
|
+
\`max\`, or \`format: percent\` for 100); \`pictogram\` (house icons per row; \`perIcon\` sets the step).
|
|
103
|
+
- **Grid & flow:** \`heatmap\` (labels are rows, series names are columns); \`sankey\` (labels are
|
|
104
|
+
sources, series names are destinations, each cell a flow; a destination that is also a label chains
|
|
105
|
+
stages; no loops).
|
|
106
|
+
- **Other:** \`funnel\` (drop-off, first series), \`scatter\` (two series as x and y), \`radar\`.
|
|
107
|
+
Pie, donut, funnel, gauge, ring, treemap, waterfall and pictogram read the first series only.
|
|
95
108
|
|
|
96
109
|
## Video & embeds
|
|
97
110
|
They need internet while presenting. Offline, in print and in PDF they show a poster (or
|
|
@@ -130,4 +143,4 @@ export {
|
|
|
130
143
|
deckJsonSchema,
|
|
131
144
|
AUTHORING_GUIDE
|
|
132
145
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-7NSNE5ED.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["import { z } from 'zod';\nimport { ignoreOverride, zodToJsonSchema } from 'zod-to-json-schema';\nimport {\n LAYOUT_CATEGORIES,\n LAYOUTS,\n getLayout,\n type LayoutCategory,\n type LayoutName,\n} from './layouts/index.js';\nimport { baseSlide, Image, Item } from './schema/common.js';\nimport { DeckSchema } from './schema/deck.js';\n\n/**\n * Item and Image accept a bare string as shorthand (\"Q4 best\" → { text }, \"a.jpg\" → { src }).\n * zod-to-json-schema only sees the object behind the preprocess, so advertise both forms\n * or agents reading the schema think the shorthand in our own examples is invalid.\n */\nconst SHORTHAND = new Map<unknown, string>([\n [(Item._def as { schema: unknown }).schema, 'Shorthand for { text }.'],\n [(Image._def as { schema: unknown }).schema, 'Shorthand for { src }.'],\n]);\n\nfunction toJsonSchema(schema: z.ZodTypeAny, name?: string) {\n return zodToJsonSchema(schema, {\n ...(name ? { name } : {}),\n $refStrategy: 'none',\n override: (def) => {\n const inner = (def as { schema?: unknown }).schema;\n const isEffects = (def as { typeName?: string }).typeName === 'ZodEffects';\n const hint = isEffects ? SHORTHAND.get(inner) : undefined;\n if (!hint) return ignoreOverride;\n const object = zodToJsonSchema(inner as z.ZodTypeAny, {\n $refStrategy: 'none',\n }) as Record<string, unknown>;\n delete object.$schema;\n return {\n anyOf: [{ type: 'string', description: hint }, object],\n ...((def as { description?: string }).description\n ? { description: (def as { description?: string }).description }\n : {}),\n };\n },\n });\n}\n\nexport interface LayoutSummary {\n name: string;\n category: LayoutCategory;\n description: string;\n whenToUse: string;\n}\n\nexport function listLayouts(): LayoutSummary[] {\n return LAYOUTS.map((l) => ({\n name: l.name,\n category: LAYOUT_CATEGORIES[l.name as LayoutName],\n description: l.description,\n whenToUse: l.whenToUse,\n }));\n}\n\n/** Full description of one layout: fields as JSON Schema plus a working example. */\nexport function describeLayout(name: string) {\n const layout = getLayout(name);\n if (!layout) return undefined;\n const schema = z.object({ layout: z.literal(layout.name), ...layout.shape, ...baseSlide });\n return {\n name: layout.name,\n description: layout.description,\n whenToUse: layout.whenToUse,\n defaults: layout.defaults ?? {},\n schema: toJsonSchema(schema),\n example: layout.example,\n };\n}\n\n/** JSON Schema for a whole deck (editor tooling, `$schema` in deck files). */\nexport function deckJsonSchema() {\n return toJsonSchema(DeckSchema, 'ClassicDeck');\n}\n\n/** Authoring guidance shared by the CLI, MCP server and docs. */\nexport const AUTHORING_GUIDE = `# Writing a Classic Homes deck\n\nA deck is a YAML (or JSON) file: deck-level fields plus a list of slides. Each slide\npicks a **layout** and fills its fields. Layouts own all styling — there is no way to\nset colours, fonts or sizes directly, which is what keeps every deck on-brand.\n\n## Principles\n- **One idea per slide.** The headline states the point. Detail goes in \\`notes\\`.\n- **Short copy.** Titles under ~70 characters, bullets a few words, at most 6 bullets.\n \\`validate\\` warns when a slide gets crowded — split it rather than shrinking text.\n- **Speaker notes on every content slide.** Presenters press N (or P for presenter view).\n- **Real photos over decoration.** Every image needs \\`alt\\` text.\n- **Tracks** colour the accent: \\`value\\` (red, default) for the homeowner/value story,\n \\`build\\` (teal) for construction/process, \\`neutral\\` (navy) for framing slides.\n- **Backgrounds**: \\`paper\\` (default) for content; solid \\`navy\\`/\\`red\\`/\\`teal\\`/\\`plum\\`/\\`grey\\`/\\`stone\\`\n for dividers. \\`backgroundImage\\` + \\`overlay\\` puts a photo behind title/section/statement slides.\n\n## Picking a layout\n- **Numbers:** \\`stats\\` (2–6 headline figures, optional trend + sparkline), \\`chart\\` (a real chart —\n put the takeaway in the title), \\`table\\` (exact figures people compare).\n- **Processes & structure:** \\`flow\\` (ordered steps with arrows), \\`timeline\\` (dated milestones, phases),\n \\`cycle\\` (things that repeat), \\`hierarchy\\` (org chart / tree), \\`matrix\\` (2×2), \\`tiers\\`\n (funnel or pyramid), \\`walkthrough\\` (photo per stage), \\`journey\\` (deck agenda).\n- **Media:** \\`split\\` (text + photos), \\`photos\\`, \\`image\\` (with numbered \\`hotspots\\` for floor plans\n and site maps), \\`compare\\` (before/after slider), \\`video\\` (YouTube/Vimeo), \\`embed\\` (any https page:\n maps, dashboards, 3D tours, forms).\n- **Words:** \\`statement\\`, \\`bullets\\`, \\`cards\\`, \\`comparison\\`, \\`quote\\`.\n- **Wrap-up:** \\`qr\\` (send people somewhere), \\`contacts\\`, closing \\`statement\\`.\n\n## Charts\n\\`chart.labels\\` are the categories; each series has one value per label.
|
|
1
|
+
{"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["import { z } from 'zod';\nimport { ignoreOverride, zodToJsonSchema } from 'zod-to-json-schema';\nimport {\n LAYOUT_CATEGORIES,\n LAYOUTS,\n getLayout,\n type LayoutCategory,\n type LayoutName,\n} from './layouts/index.js';\nimport { baseSlide, Image, Item } from './schema/common.js';\nimport { DeckSchema } from './schema/deck.js';\n\n/**\n * Item and Image accept a bare string as shorthand (\"Q4 best\" → { text }, \"a.jpg\" → { src }).\n * zod-to-json-schema only sees the object behind the preprocess, so advertise both forms\n * or agents reading the schema think the shorthand in our own examples is invalid.\n */\nconst SHORTHAND = new Map<unknown, string>([\n [(Item._def as { schema: unknown }).schema, 'Shorthand for { text }.'],\n [(Image._def as { schema: unknown }).schema, 'Shorthand for { src }.'],\n]);\n\nfunction toJsonSchema(schema: z.ZodTypeAny, name?: string) {\n return zodToJsonSchema(schema, {\n ...(name ? { name } : {}),\n $refStrategy: 'none',\n override: (def) => {\n const inner = (def as { schema?: unknown }).schema;\n const isEffects = (def as { typeName?: string }).typeName === 'ZodEffects';\n const hint = isEffects ? SHORTHAND.get(inner) : undefined;\n if (!hint) return ignoreOverride;\n const object = zodToJsonSchema(inner as z.ZodTypeAny, {\n $refStrategy: 'none',\n }) as Record<string, unknown>;\n delete object.$schema;\n return {\n anyOf: [{ type: 'string', description: hint }, object],\n ...((def as { description?: string }).description\n ? { description: (def as { description?: string }).description }\n : {}),\n };\n },\n });\n}\n\nexport interface LayoutSummary {\n name: string;\n category: LayoutCategory;\n description: string;\n whenToUse: string;\n}\n\nexport function listLayouts(): LayoutSummary[] {\n return LAYOUTS.map((l) => ({\n name: l.name,\n category: LAYOUT_CATEGORIES[l.name as LayoutName],\n description: l.description,\n whenToUse: l.whenToUse,\n }));\n}\n\n/** Full description of one layout: fields as JSON Schema plus a working example. */\nexport function describeLayout(name: string) {\n const layout = getLayout(name);\n if (!layout) return undefined;\n const schema = z.object({ layout: z.literal(layout.name), ...layout.shape, ...baseSlide });\n return {\n name: layout.name,\n description: layout.description,\n whenToUse: layout.whenToUse,\n defaults: layout.defaults ?? {},\n schema: toJsonSchema(schema),\n example: layout.example,\n };\n}\n\n/** JSON Schema for a whole deck (editor tooling, `$schema` in deck files). */\nexport function deckJsonSchema() {\n return toJsonSchema(DeckSchema, 'ClassicDeck');\n}\n\n/** Authoring guidance shared by the CLI, MCP server and docs. */\nexport const AUTHORING_GUIDE = `# Writing a Classic Homes deck\n\nA deck is a YAML (or JSON) file: deck-level fields plus a list of slides. Each slide\npicks a **layout** and fills its fields. Layouts own all styling — there is no way to\nset colours, fonts or sizes directly, which is what keeps every deck on-brand.\n\n## Principles\n- **One idea per slide.** The headline states the point. Detail goes in \\`notes\\`.\n- **Short copy.** Titles under ~70 characters, bullets a few words, at most 6 bullets.\n \\`validate\\` warns when a slide gets crowded — split it rather than shrinking text.\n- **Speaker notes on every content slide.** Presenters press N (or P for presenter view).\n- **Real photos over decoration.** Every image needs \\`alt\\` text.\n- **Tracks** colour the accent: \\`value\\` (red, default) for the homeowner/value story,\n \\`build\\` (teal) for construction/process, \\`neutral\\` (navy) for framing slides.\n- **Backgrounds**: \\`paper\\` (default) for content; solid \\`navy\\`/\\`red\\`/\\`teal\\`/\\`plum\\`/\\`grey\\`/\\`stone\\`\n for dividers. \\`backgroundImage\\` + \\`overlay\\` puts a photo behind title/section/statement slides.\n\n## Picking a layout\n- **Numbers:** \\`stats\\` (2–6 headline figures, optional trend + sparkline), \\`chart\\` (a real chart —\n put the takeaway in the title), \\`table\\` (exact figures people compare).\n- **Processes & structure:** \\`flow\\` (ordered steps with arrows), \\`timeline\\` (dated milestones, phases),\n \\`cycle\\` (things that repeat), \\`hierarchy\\` (org chart / tree), \\`matrix\\` (2×2), \\`tiers\\`\n (funnel or pyramid), \\`walkthrough\\` (photo per stage), \\`journey\\` (deck agenda).\n- **Media:** \\`split\\` (text + photos), \\`photos\\`, \\`image\\` (with numbered \\`hotspots\\` for floor plans\n and site maps), \\`compare\\` (before/after slider), \\`video\\` (YouTube/Vimeo), \\`embed\\` (any https page:\n maps, dashboards, 3D tours, forms).\n- **Words:** \\`statement\\`, \\`bullets\\`, \\`cards\\`, \\`comparison\\`, \\`quote\\`.\n- **Wrap-up:** \\`qr\\` (send people somewhere), \\`contacts\\`, closing \\`statement\\`.\n\n## Charts\n\\`chart.labels\\` are the categories; each series has one value per label. Use \\`highlight\\` to\nemphasise one category and \\`format\\`/\\`unit\\` instead of typing symbols into numbers.\n- **Compare:** \\`column\\`/\\`bar\\`; \\`dumbbell\\` (2+ series as dots per row, e.g. last year vs this\n year); \\`bullet\\` (series 1 actual, series 2 target; \\`max\\` sets the track).\n- **Part of whole:** \\`stacked-*\\` (absolute), \\`percent-column\\`/\\`percent-bar\\` (each row = 100%),\n \\`pie\\`/\\`donut\\` (≤ 7 slices), \\`treemap\\` (many categories).\n- **Change:** \\`line\\`/\\`area\\`; \\`combo\\` (series 1 bars, the rest lines; set a series' \\`as\\` to\n override and \\`axis: secondary\\` + \\`secondaryFormat\\` for a second scale, e.g. closings and average\n price); \\`waterfall\\` (series 1 is signed changes; list running-total rows in \\`totals\\`).\n- **Single value:** \\`gauge\\` (one value, needs \\`max\\`); \\`ring\\` (up to 4 progress rings, one per label;\n \\`max\\`, or \\`format: percent\\` for 100); \\`pictogram\\` (house icons per row; \\`perIcon\\` sets the step).\n- **Grid & flow:** \\`heatmap\\` (labels are rows, series names are columns); \\`sankey\\` (labels are\n sources, series names are destinations, each cell a flow; a destination that is also a label chains\n stages; no loops).\n- **Other:** \\`funnel\\` (drop-off, first series), \\`scatter\\` (two series as x and y), \\`radar\\`.\nPie, donut, funnel, gauge, ring, treemap, waterfall and pictogram read the first series only.\n\n## Video & embeds\nThey need internet while presenting. Offline, in print and in PDF they show a poster (or\n\\`fallback\\` screenshot) with a QR code. Some sites refuse to be framed — the \"Open ↗\" link\nalways works; add a \\`fallback\\` image for anything critical.\n\n## Brand\n\\`brand.profile\\` picks who the deck speaks for (default \\`classic-homes\\`). You may override\n\\`name\\`, \\`tagline\\`, \\`logo\\`, \\`logoOnDark\\`, \\`favicon\\` and \\`footer\\`; colours come from the profile.\n\\`settings\\` controls slide numbers, logo placement, a confidential label and kiosk auto-advance.\n\n## Presenting\nArrow keys / Space advance (and step through \\`build: true\\` reveals). N notes · P presenter window\n(current + next slide, notes, timer) · O overview · F fullscreen · \\`?kiosk=15\\` on the URL loops\nunattended. \\`hidden: true\\` skips a slide without deleting it.\n\n## Inline text\n\\`**bold**\\`, \\`*highlight*\\` (accent colour), \\`\\\\\\`code\\\\\\`\\`, \\`[label](https://…)\\`. No HTML.\n\n## Journey decks\nSet \\`journey.steps\\` at deck level to get a numbered agenda. Then:\n- a \\`journey\\` slide shows the full map,\n- \\`step: 3\\` on any slide draws the vertical STEP rail,\n- \\`showJourney: true\\` adds the compact \"you are here\" strip (great on \\`section\\` slides).\n\n## Typical shape\n1. \\`title\\`\n2. \\`statement\\` or \\`journey\\` (why we're here / the agenda)\n3. per part: \\`section\\` → 2–5 content slides\n4. \\`qr\\` (where to go next) → \\`contacts\\` → closing \\`statement\\`\n`;\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,SAAS;AAClB,SAAS,gBAAgB,uBAAuB;AAgBhD,IAAM,YAAY,oBAAI,IAAqB;AAAA,EACzC,CAAE,KAAK,KAA6B,QAAQ,yBAAyB;AAAA,EACrE,CAAE,MAAM,KAA6B,QAAQ,wBAAwB;AACvE,CAAC;AAED,SAAS,aAAa,QAAsB,MAAe;AACzD,SAAO,gBAAgB,QAAQ;AAAA,IAC7B,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;AAAA,IACvB,cAAc;AAAA,IACd,UAAU,CAAC,QAAQ;AACjB,YAAM,QAAS,IAA6B;AAC5C,YAAM,YAAa,IAA8B,aAAa;AAC9D,YAAM,OAAO,YAAY,UAAU,IAAI,KAAK,IAAI;AAChD,UAAI,CAAC,KAAM,QAAO;AAClB,YAAM,SAAS,gBAAgB,OAAuB;AAAA,QACpD,cAAc;AAAA,MAChB,CAAC;AACD,aAAO,OAAO;AACd,aAAO;AAAA,QACL,OAAO,CAAC,EAAE,MAAM,UAAU,aAAa,KAAK,GAAG,MAAM;AAAA,QACrD,GAAK,IAAiC,cAClC,EAAE,aAAc,IAAiC,YAAY,IAC7D,CAAC;AAAA,MACP;AAAA,IACF;AAAA,EACF,CAAC;AACH;AASO,SAAS,cAA+B;AAC7C,SAAO,QAAQ,IAAI,CAAC,OAAO;AAAA,IACzB,MAAM,EAAE;AAAA,IACR,UAAU,kBAAkB,EAAE,IAAkB;AAAA,IAChD,aAAa,EAAE;AAAA,IACf,WAAW,EAAE;AAAA,EACf,EAAE;AACJ;AAGO,SAAS,eAAe,MAAc;AAC3C,QAAM,SAAS,UAAU,IAAI;AAC7B,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,OAAO,IAAI,GAAG,GAAG,OAAO,OAAO,GAAG,UAAU,CAAC;AACzF,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,UAAU,OAAO,YAAY,CAAC;AAAA,IAC9B,QAAQ,aAAa,MAAM;AAAA,IAC3B,SAAS,OAAO;AAAA,EAClB;AACF;AAGO,SAAS,iBAAiB;AAC/B,SAAO,aAAa,YAAY,aAAa;AAC/C;AAGO,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
parseDeckSource,
|
|
4
4
|
renderDeck,
|
|
5
5
|
stringifyDeck
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KQXT376T.js";
|
|
7
7
|
|
|
8
8
|
// src/node/index.ts
|
|
9
9
|
import { readFile, stat, writeFile } from "fs/promises";
|
|
@@ -181,4 +181,4 @@ export {
|
|
|
181
181
|
buildDeckFile,
|
|
182
182
|
exportDeckFile
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-B3MBJRHZ.js.map
|