@shapesos/clay 0.16.0 → 0.18.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.
Files changed (83) hide show
  1. package/dist/ai-elements.cjs +3 -1
  2. package/dist/ai-elements.cjs.map +1 -1
  3. package/dist/ai-elements.js +4 -4
  4. package/dist/artifacts.cjs +976 -69
  5. package/dist/artifacts.cjs.map +1 -1
  6. package/dist/artifacts.d.cts +20 -3
  7. package/dist/artifacts.d.ts +20 -3
  8. package/dist/artifacts.js +13 -5
  9. package/dist/blocks.cjs +690 -85
  10. package/dist/blocks.cjs.map +1 -1
  11. package/dist/blocks.css +1 -1
  12. package/dist/blocks.d.cts +3 -3
  13. package/dist/blocks.d.ts +3 -3
  14. package/dist/blocks.js +5 -5
  15. package/dist/button.cjs +3 -1
  16. package/dist/button.cjs.map +1 -1
  17. package/dist/button.js +2 -2
  18. package/dist/capture.cjs +3 -1
  19. package/dist/capture.cjs.map +1 -1
  20. package/dist/capture.js +2 -2
  21. package/dist/chart.cjs +16 -36
  22. package/dist/chart.cjs.map +1 -1
  23. package/dist/chart.d.cts +3 -11
  24. package/dist/chart.d.ts +3 -11
  25. package/dist/chart.js +2 -2
  26. package/dist/chat.cjs +714 -109
  27. package/dist/chat.cjs.map +1 -1
  28. package/dist/chat.d.cts +2 -2
  29. package/dist/chat.d.ts +2 -2
  30. package/dist/chat.js +6 -6
  31. package/dist/{chunk-UZKNSAAD.js → chunk-7MY4X4YL.js} +3 -3
  32. package/dist/chunk-BHHJOG5X.js +1 -0
  33. package/dist/{chunk-GAZRZZRF.js → chunk-CATIRDZP.js} +5 -5
  34. package/dist/{chunk-B4U37WIH.js → chunk-CFCLVJIO.js} +2 -2
  35. package/dist/{chunk-PYDVANWI.js → chunk-E36VI2HA.js} +2 -2
  36. package/dist/{chunk-U3IXCSV6.js → chunk-G4NXVFXU.js} +18 -40
  37. package/dist/chunk-G4NXVFXU.js.map +1 -0
  38. package/dist/{chunk-JAGNXEWK.js → chunk-GK4XW4BC.js} +2 -2
  39. package/dist/{chunk-4VE6ZXXW.js → chunk-MQP57DOP.js} +3 -3
  40. package/dist/{chunk-2YCBDSPK.js → chunk-QR4VBGK4.js} +673 -42
  41. package/dist/chunk-QR4VBGK4.js.map +1 -0
  42. package/dist/{chunk-JF3P66JF.js → chunk-SN3ORQSJ.js} +4 -2
  43. package/dist/{chunk-JF3P66JF.js.map → chunk-SN3ORQSJ.js.map} +1 -1
  44. package/dist/{chunk-PGR2MDDU.js → chunk-W66OJM55.js} +2 -2
  45. package/dist/{chunk-7OYIDM42.js → chunk-XKURJ72I.js} +2 -2
  46. package/dist/{dom-to-image-NATF3446.js → dom-to-image-QB7KMTAE.js} +3 -3
  47. package/dist/icon.cjs +3 -1
  48. package/dist/icon.cjs.map +1 -1
  49. package/dist/icon.js +2 -2
  50. package/dist/index.cjs +780 -167
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +3 -3
  53. package/dist/index.d.ts +3 -3
  54. package/dist/index.js +19 -11
  55. package/dist/keyboard-shortcut.cjs +3 -1
  56. package/dist/keyboard-shortcut.cjs.map +1 -1
  57. package/dist/keyboard-shortcut.js +2 -2
  58. package/dist/text-area.cjs +3 -1
  59. package/dist/text-area.cjs.map +1 -1
  60. package/dist/text-area.js +2 -2
  61. package/dist/tokens.cjs +3 -1
  62. package/dist/tokens.cjs.map +1 -1
  63. package/dist/tokens.d.cts +1 -0
  64. package/dist/tokens.d.ts +1 -0
  65. package/dist/tokens.js +1 -1
  66. package/dist/{types-CW45GBXl.d.cts → types-BDYPVP2N.d.cts} +1 -1
  67. package/dist/{types-D1b8v7EY.d.ts → types-BMwa4bPW.d.ts} +1 -1
  68. package/dist/{types-GCkXbyFm.d.ts → types-C8JtnwNY.d.ts} +200 -4
  69. package/dist/{types-BzXPBy6s.d.cts → types-DTdDFU3O.d.cts} +200 -4
  70. package/package.json +1 -1
  71. package/dist/chunk-2YCBDSPK.js.map +0 -1
  72. package/dist/chunk-RSRNSWJN.js +0 -1
  73. package/dist/chunk-U3IXCSV6.js.map +0 -1
  74. /package/dist/{chunk-UZKNSAAD.js.map → chunk-7MY4X4YL.js.map} +0 -0
  75. /package/dist/{chunk-RSRNSWJN.js.map → chunk-BHHJOG5X.js.map} +0 -0
  76. /package/dist/{chunk-GAZRZZRF.js.map → chunk-CATIRDZP.js.map} +0 -0
  77. /package/dist/{chunk-B4U37WIH.js.map → chunk-CFCLVJIO.js.map} +0 -0
  78. /package/dist/{chunk-PYDVANWI.js.map → chunk-E36VI2HA.js.map} +0 -0
  79. /package/dist/{chunk-JAGNXEWK.js.map → chunk-GK4XW4BC.js.map} +0 -0
  80. /package/dist/{chunk-4VE6ZXXW.js.map → chunk-MQP57DOP.js.map} +0 -0
  81. /package/dist/{chunk-PGR2MDDU.js.map → chunk-W66OJM55.js.map} +0 -0
  82. /package/dist/{chunk-7OYIDM42.js.map → chunk-XKURJ72I.js.map} +0 -0
  83. /package/dist/{dom-to-image-NATF3446.js.map → dom-to-image-QB7KMTAE.js.map} +0 -0
@@ -16,6 +16,7 @@ import { C as ChartSeries } from './types-B2aYk82c.js';
16
16
  declare const artifactTypes: {
17
17
  readonly TABLE: "TABLE";
18
18
  readonly CHART: "CHART";
19
+ readonly DECK: "DECK";
19
20
  };
20
21
  /** Discriminator for artifact types. Additive — new types extend this union. */
21
22
  type ArtifactType = (typeof artifactTypes)[keyof typeof artifactTypes];
@@ -255,6 +256,201 @@ interface TableArtifactCallbacks {
255
256
  onDownload?: (artifact: TableArtifactRecord) => void;
256
257
  }
257
258
 
259
+ /**
260
+ * Block-type discriminator constants for `DeckBlock`. Uppercase to match the GraphQL
261
+ * `DeckBlockType` enum (which serializes as `TEXT` / `CHART` / `TABLE`) and the existing CHART
262
+ * `variant` precedent — the discriminator is identical end-to-end (agent → io-server → clay) with
263
+ * no case mapping at any boundary. Use these instead of string literals so a typo is a
264
+ * compile-time error rather than a silent wrong-branch at runtime.
265
+ */
266
+ declare const deckBlockTypes: {
267
+ readonly TEXT: "TEXT";
268
+ readonly CHART: "CHART";
269
+ readonly TABLE: "TABLE";
270
+ };
271
+ /**
272
+ * Slide-template kind discriminator constants for `DeckSlide`. Uppercase, end-to-end (agent →
273
+ * io-server → clay), mirroring `deckBlockTypes`. Use these instead of string literals so a typo
274
+ * is a compile-time error rather than a silent wrong-branch at runtime.
275
+ */
276
+ declare const deckSlideKinds: {
277
+ readonly TITLE: "TITLE";
278
+ readonly AGENDA: "AGENDA";
279
+ readonly SECTION: "SECTION";
280
+ readonly CONTENT: "CONTENT";
281
+ readonly CLOSING: "CLOSING";
282
+ };
283
+ /** Discriminator for the visual template a slide renders with. */
284
+ type DeckSlideKind = (typeof deckSlideKinds)[keyof typeof deckSlideKinds];
285
+ /**
286
+ * A markdown text block on a slide. Rendered with the same react-markdown pipeline as chat text
287
+ * blocks (GFM + single-newline breaks), so `**bold**`, lists, and headings render as formatted
288
+ * output rather than literal syntax.
289
+ */
290
+ interface DeckTextBlock {
291
+ /** Discriminator. */
292
+ type: typeof deckBlockTypes.TEXT;
293
+ /** Markdown source for the block body. */
294
+ markdown: string;
295
+ }
296
+ /**
297
+ * A chart block on a slide. Carries its data inline (`rows`) alongside the same `ChartConfig` the
298
+ * standalone `CHART` artifact uses — the deck renderer feeds both straight into
299
+ * `ChartArtifactContent` with no fetch (decks have no presigned data payload).
300
+ */
301
+ interface DeckChartBlock {
302
+ /** Discriminator. */
303
+ type: typeof deckBlockTypes.CHART;
304
+ /** Chart rendering config — reused verbatim from the `CHART` artifact. */
305
+ config: ChartConfig;
306
+ /** Inline data rows the chart plots. Each cell is a raw string (or `null`), matching the CSV wire. */
307
+ rows: ArtifactDataRow[];
308
+ }
309
+ /**
310
+ * A table block on a slide. Carries its data inline (`rows`) alongside the same `TableConfig` the
311
+ * standalone `TABLE` artifact uses — the deck renderer feeds both into `TableArtifactContent`
312
+ * (wrapping `rows` in a synthetic `"ready"` data state) with no fetch.
313
+ */
314
+ interface DeckTableBlock {
315
+ /** Discriminator. */
316
+ type: typeof deckBlockTypes.TABLE;
317
+ /** Table rendering config — reused verbatim from the `TABLE` artifact. */
318
+ config: TableConfig;
319
+ /** Inline data rows. Each cell is a raw string (or `null`), matching the CSV wire. */
320
+ rows: ArtifactDataRow[];
321
+ }
322
+ /**
323
+ * Discriminated union of the content blocks a slide can render. Discriminated by `type`; data is
324
+ * inline (no presigned-asset fetch). Older clay versions encountering a future block kind render
325
+ * it as the unavailable-state rather than crashing — see `DeckArtifactContent`.
326
+ */
327
+ type DeckBlock = DeckTextBlock | DeckChartBlock | DeckTableBlock;
328
+ /**
329
+ * A single slide inside a `DeckArtifact`. Unlike `TABLE` / `CHART`, a deck carries NO underlying
330
+ * CSV / protected-asset payload for rendering — its content lives entirely inline in
331
+ * `config.slides[*].content`, so the renderer reads slides straight from `artifact.config` and
332
+ * never fetches a presigned URL to draw them. (The presigned URL, when present, points at a
333
+ * downloadable `.pptx` export — a separate path from rendering.)
334
+ */
335
+ interface DeckSlide {
336
+ /** Slide heading, rendered prominently at the top of the slide. Required. */
337
+ title: string;
338
+ /** Ordered content blocks (text / chart / table) rendered top-to-bottom. May be empty. */
339
+ content: DeckBlock[];
340
+ /**
341
+ * Visual template kind. Absent / unknown → treated as `"CONTENT"` (backward-compatible).
342
+ * Use `deckSlideKinds` constants to avoid typos.
343
+ */
344
+ kind?: DeckSlideKind;
345
+ /** Subtitle line shown below the main title. Used on TITLE slides; ignored by other kinds. */
346
+ subtitle?: string;
347
+ /** Short description paragraph. Used on TITLE slides below the subtitle. */
348
+ description?: string;
349
+ /**
350
+ * Agenda items (AGENDA kind). Each string is one line item rendered with an ordinal
351
+ * prefix (`01`, `02`, …) in Crimson Pro italic accent. Ignored by non-AGENDA kinds.
352
+ */
353
+ items?: string[];
354
+ }
355
+ /**
356
+ * Optional stats embedded in `DeckConfig`. Mirrors `TableStats` / `ChartStats` — lets a consumer
357
+ * render deck chrome (e.g. "Slide 1 / N") before deeply inspecting the slide array.
358
+ *
359
+ * Backward-compat: optional everywhere; the renderer derives the count from `slides.length` when
360
+ * absent.
361
+ */
362
+ interface DeckStats {
363
+ /** Total number of slides in the deck. */
364
+ slideCount: number;
365
+ }
366
+ /**
367
+ * Optional deck-level metadata embedded in `DeckConfig`. Injected by the client at render time;
368
+ * clay renders each field if present and ignores it when absent.
369
+ */
370
+ interface DeckMeta {
371
+ /** Short eyebrow / running header text shown at top-left of every slide (e.g. org name). */
372
+ eyebrow?: string;
373
+ /** Date string shown on the TITLE slide (e.g. "Q2 2026"). No formatting is applied — rendered as-is. */
374
+ date?: string;
375
+ /**
376
+ * Theme identifier. Defaults to `"shapes-light"` when absent.
377
+ * Currently only `"shapes-light"` is implemented; unknown values fall back to the default.
378
+ */
379
+ theme?: string;
380
+ /**
381
+ * Account logo URL injected by the client at render time. Clay renders `<img src={logoUrl}>`
382
+ * (capped height, object-contain) at top-right of every slide when present. Omitted → no logo.
383
+ *
384
+ * CROSS-REPO DEVIATION: this field exists ONLY on clay's `DeckMeta`. io-server's `DeckMeta`
385
+ * (and the GraphQL SDL) deliberately omit `logoUrl` — it is client-injected from the account's
386
+ * branding and must NOT round-trip through the server. Keep the two `DeckMeta` shapes in sync on
387
+ * every field EXCEPT this one. The renderer validates it against an http(s) allowlist before use.
388
+ */
389
+ logoUrl?: string;
390
+ }
391
+ /** Rendering config for a deck artifact, stored at `artifact.config` (JSONB on the server). */
392
+ interface DeckConfig {
393
+ /** Ordered slides. At least one; the renderer guards against an empty array. */
394
+ slides: DeckSlide[];
395
+ /** Optional metadata describing the deck — used for chrome before slide inspection. */
396
+ stats?: DeckStats;
397
+ /** Optional deck-level metadata (eyebrow, date, theme, logo). */
398
+ meta?: DeckMeta;
399
+ }
400
+ /** Concrete deck artifact record. */
401
+ type DeckArtifactRecord = ArtifactBase<typeof artifactTypes.DECK, DeckConfig>;
402
+ /**
403
+ * Localized labels for the `DECK` artifact's user-facing strings. Covers navigation controls,
404
+ * the download action, and status messages. Consumer passes the bag from their i18n layer; clay
405
+ * falls back to English defaults when omitted (per-key Partial merge).
406
+ *
407
+ * `chart` / `table` are nested bags forwarded to embedded chart / table blocks' renderers so
408
+ * those inherit the consumer's translations (status / empty / loading strings). Both are optional;
409
+ * the orchestrator defaults them to `DEFAULT_CHART_ARTIFACT_LABELS` / `DEFAULT_TABLE_ARTIFACT_LABELS`.
410
+ */
411
+ interface DeckArtifactLabels {
412
+ /** aria-label on the "previous slide" navigation button. */
413
+ previous: string;
414
+ /** aria-label on the "next slide" navigation button. */
415
+ next: string;
416
+ /**
417
+ * Slide-position indicator template. `{current}` and `{total}` are substituted at render time
418
+ * (e.g. "Slide {current} of {total}" → "Slide 2 of 5").
419
+ */
420
+ position: string;
421
+ /** Tooltip + aria-label on the Download (`.pptx`) button in the deck artifact header. */
422
+ download: string;
423
+ /** Status message shown when the deck config is malformed or has no slides. */
424
+ unavailable: string;
425
+ /** aria-label on the expand / enter-fullscreen button in the artifact header. */
426
+ enterFullscreen: string;
427
+ /** aria-label on the collapse / exit-fullscreen button in the fullscreen overlay. */
428
+ exitFullscreen: string;
429
+ /** "Thank you" closing message shown on the CLOSING slide. */
430
+ thankYou: string;
431
+ /** "Questions?" prompt shown on the CLOSING slide below the thank-you message. */
432
+ questions: string;
433
+ /** Fallback title for the AGENDA slide when the slide's `title` is empty. */
434
+ agenda: string;
435
+ /** Label bag forwarded to embedded chart blocks. Defaults to `DEFAULT_CHART_ARTIFACT_LABELS`. */
436
+ chart?: ChartArtifactLabels;
437
+ /** Label bag forwarded to embedded table blocks. Defaults to `DEFAULT_TABLE_ARTIFACT_LABELS`. */
438
+ table?: TableArtifactLabels;
439
+ }
440
+ /** English fallback for `DeckArtifactLabels`. Used when the consumer hasn't passed `labels`. */
441
+ declare const DEFAULT_DECK_ARTIFACT_LABELS: DeckArtifactLabels;
442
+ /**
443
+ * Consumer-supplied side-effect callbacks for actions on the deck artifact. Mirrors
444
+ * `TableArtifactCallbacks` — every callback is optional and receives the `DeckArtifactRecord` so
445
+ * consumers can derive analytics context without a per-block closure at every render site.
446
+ */
447
+ interface DeckArtifactCallbacks {
448
+ /** Fires when the user navigates to a different slide. `slideIndex` is zero-based. */
449
+ onNavigate?: (artifact: DeckArtifactRecord, slideIndex: number) => void;
450
+ /** Fires when the Download (`.pptx`) button is clicked. Browser-native download still happens. */
451
+ onDownload?: (artifact: DeckArtifactRecord) => void;
452
+ }
453
+
258
454
  /**
259
455
  * Artifact-domain types — wire-protocol shapes shared between artifact components, block-services,
260
456
  * and consumers. Splits responsibilities across three layers so each artifact kind owns its own
@@ -278,16 +474,16 @@ interface TableArtifactCallbacks {
278
474
  * clay versions that don't know about a new type silently render nothing — see `ArtifactRefBlock`
279
475
  * guard.
280
476
  */
281
- type ArtifactRecord = TableArtifactRecord | ChartArtifactRecord;
477
+ type ArtifactRecord = TableArtifactRecord | ChartArtifactRecord | DeckArtifactRecord;
282
478
  /**
283
479
  * Type-level lookup from an `ArtifactRecord` branch to its labels / callbacks slice. The block
284
480
  * layer already carries the discriminator on `artifact.type`, so the renderer-side `labels` and
285
481
  * `callbacks` props expose exactly one type's slice — never a union-bag keyed by type. Consumers
286
482
  * emit a flat object; the dispatcher narrows it implicitly via `TArtifact`.
287
483
  */
288
- type ArtifactLabelsOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactLabels : TArtifact extends TableArtifactRecord ? TableArtifactLabels : never;
484
+ type ArtifactLabelsOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactLabels : TArtifact extends TableArtifactRecord ? TableArtifactLabels : TArtifact extends DeckArtifactRecord ? DeckArtifactLabels : never;
289
485
  /** Sibling to `ArtifactLabelsOf` — callbacks slice matching the artifact branch. */
290
- type ArtifactCallbacksOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactCallbacks : TArtifact extends TableArtifactRecord ? TableArtifactCallbacks : never;
486
+ type ArtifactCallbacksOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactCallbacks : TArtifact extends TableArtifactRecord ? TableArtifactCallbacks : TArtifact extends DeckArtifactRecord ? DeckArtifactCallbacks : never;
291
487
  /**
292
488
  * Props every concrete artifact component receives from the dispatcher.
293
489
  *
@@ -327,4 +523,4 @@ interface ArtifactService<TArtifact extends ArtifactRecord = ArtifactRecord> {
327
523
  toClipboardText: (artifact: TArtifact) => string;
328
524
  }
329
525
 
330
- export { type ArtifactCallbacksOf as A, type BarChartConfig as B, type ChartArtifactLabels as C, DEFAULT_CHART_ARTIFACT_LABELS as D, type LineChartConfig as L, type PieChartConfig as P, type TableArtifactLabels as T, type ArtifactDataRow as a, type ArtifactLabelsOf as b, type ArtifactRecord as c, type ArtifactService as d, type ArtifactServiceProps as e, type ArtifactType as f, type ChartArtifactRecord as g, type ChartConfig as h, type ChartStats as i, DEFAULT_TABLE_ARTIFACT_LABELS as j, type TableArtifactRecord as k, type TableColumn as l, type TableConfig as m, type TableRow as n, type TableStats as o, artifactTypes as p };
526
+ export { type ArtifactCallbacksOf as A, type BarChartConfig as B, type ChartArtifactLabels as C, DEFAULT_CHART_ARTIFACT_LABELS as D, type TableRow as E, type TableStats as F, artifactTypes as G, deckBlockTypes as H, deckSlideKinds as I, type LineChartConfig as L, type PieChartConfig as P, type TableArtifactLabels as T, type ArtifactDataRow as a, type ArtifactLabelsOf as b, type ArtifactRecord as c, type ArtifactService as d, type ArtifactServiceProps as e, type ArtifactType as f, type ChartArtifactRecord as g, type ChartConfig as h, type ChartStats as i, DEFAULT_DECK_ARTIFACT_LABELS as j, DEFAULT_TABLE_ARTIFACT_LABELS as k, type DeckArtifactCallbacks as l, type DeckArtifactLabels as m, type DeckArtifactRecord as n, type DeckBlock as o, type DeckChartBlock as p, type DeckConfig as q, type DeckMeta as r, type DeckSlide as s, type DeckSlideKind as t, type DeckStats as u, type DeckTableBlock as v, type DeckTextBlock as w, type TableArtifactRecord as x, type TableColumn as y, type TableConfig as z };
@@ -16,6 +16,7 @@ import { C as ChartSeries } from './types-B2aYk82c.cjs';
16
16
  declare const artifactTypes: {
17
17
  readonly TABLE: "TABLE";
18
18
  readonly CHART: "CHART";
19
+ readonly DECK: "DECK";
19
20
  };
20
21
  /** Discriminator for artifact types. Additive — new types extend this union. */
21
22
  type ArtifactType = (typeof artifactTypes)[keyof typeof artifactTypes];
@@ -255,6 +256,201 @@ interface TableArtifactCallbacks {
255
256
  onDownload?: (artifact: TableArtifactRecord) => void;
256
257
  }
257
258
 
259
+ /**
260
+ * Block-type discriminator constants for `DeckBlock`. Uppercase to match the GraphQL
261
+ * `DeckBlockType` enum (which serializes as `TEXT` / `CHART` / `TABLE`) and the existing CHART
262
+ * `variant` precedent — the discriminator is identical end-to-end (agent → io-server → clay) with
263
+ * no case mapping at any boundary. Use these instead of string literals so a typo is a
264
+ * compile-time error rather than a silent wrong-branch at runtime.
265
+ */
266
+ declare const deckBlockTypes: {
267
+ readonly TEXT: "TEXT";
268
+ readonly CHART: "CHART";
269
+ readonly TABLE: "TABLE";
270
+ };
271
+ /**
272
+ * Slide-template kind discriminator constants for `DeckSlide`. Uppercase, end-to-end (agent →
273
+ * io-server → clay), mirroring `deckBlockTypes`. Use these instead of string literals so a typo
274
+ * is a compile-time error rather than a silent wrong-branch at runtime.
275
+ */
276
+ declare const deckSlideKinds: {
277
+ readonly TITLE: "TITLE";
278
+ readonly AGENDA: "AGENDA";
279
+ readonly SECTION: "SECTION";
280
+ readonly CONTENT: "CONTENT";
281
+ readonly CLOSING: "CLOSING";
282
+ };
283
+ /** Discriminator for the visual template a slide renders with. */
284
+ type DeckSlideKind = (typeof deckSlideKinds)[keyof typeof deckSlideKinds];
285
+ /**
286
+ * A markdown text block on a slide. Rendered with the same react-markdown pipeline as chat text
287
+ * blocks (GFM + single-newline breaks), so `**bold**`, lists, and headings render as formatted
288
+ * output rather than literal syntax.
289
+ */
290
+ interface DeckTextBlock {
291
+ /** Discriminator. */
292
+ type: typeof deckBlockTypes.TEXT;
293
+ /** Markdown source for the block body. */
294
+ markdown: string;
295
+ }
296
+ /**
297
+ * A chart block on a slide. Carries its data inline (`rows`) alongside the same `ChartConfig` the
298
+ * standalone `CHART` artifact uses — the deck renderer feeds both straight into
299
+ * `ChartArtifactContent` with no fetch (decks have no presigned data payload).
300
+ */
301
+ interface DeckChartBlock {
302
+ /** Discriminator. */
303
+ type: typeof deckBlockTypes.CHART;
304
+ /** Chart rendering config — reused verbatim from the `CHART` artifact. */
305
+ config: ChartConfig;
306
+ /** Inline data rows the chart plots. Each cell is a raw string (or `null`), matching the CSV wire. */
307
+ rows: ArtifactDataRow[];
308
+ }
309
+ /**
310
+ * A table block on a slide. Carries its data inline (`rows`) alongside the same `TableConfig` the
311
+ * standalone `TABLE` artifact uses — the deck renderer feeds both into `TableArtifactContent`
312
+ * (wrapping `rows` in a synthetic `"ready"` data state) with no fetch.
313
+ */
314
+ interface DeckTableBlock {
315
+ /** Discriminator. */
316
+ type: typeof deckBlockTypes.TABLE;
317
+ /** Table rendering config — reused verbatim from the `TABLE` artifact. */
318
+ config: TableConfig;
319
+ /** Inline data rows. Each cell is a raw string (or `null`), matching the CSV wire. */
320
+ rows: ArtifactDataRow[];
321
+ }
322
+ /**
323
+ * Discriminated union of the content blocks a slide can render. Discriminated by `type`; data is
324
+ * inline (no presigned-asset fetch). Older clay versions encountering a future block kind render
325
+ * it as the unavailable-state rather than crashing — see `DeckArtifactContent`.
326
+ */
327
+ type DeckBlock = DeckTextBlock | DeckChartBlock | DeckTableBlock;
328
+ /**
329
+ * A single slide inside a `DeckArtifact`. Unlike `TABLE` / `CHART`, a deck carries NO underlying
330
+ * CSV / protected-asset payload for rendering — its content lives entirely inline in
331
+ * `config.slides[*].content`, so the renderer reads slides straight from `artifact.config` and
332
+ * never fetches a presigned URL to draw them. (The presigned URL, when present, points at a
333
+ * downloadable `.pptx` export — a separate path from rendering.)
334
+ */
335
+ interface DeckSlide {
336
+ /** Slide heading, rendered prominently at the top of the slide. Required. */
337
+ title: string;
338
+ /** Ordered content blocks (text / chart / table) rendered top-to-bottom. May be empty. */
339
+ content: DeckBlock[];
340
+ /**
341
+ * Visual template kind. Absent / unknown → treated as `"CONTENT"` (backward-compatible).
342
+ * Use `deckSlideKinds` constants to avoid typos.
343
+ */
344
+ kind?: DeckSlideKind;
345
+ /** Subtitle line shown below the main title. Used on TITLE slides; ignored by other kinds. */
346
+ subtitle?: string;
347
+ /** Short description paragraph. Used on TITLE slides below the subtitle. */
348
+ description?: string;
349
+ /**
350
+ * Agenda items (AGENDA kind). Each string is one line item rendered with an ordinal
351
+ * prefix (`01`, `02`, …) in Crimson Pro italic accent. Ignored by non-AGENDA kinds.
352
+ */
353
+ items?: string[];
354
+ }
355
+ /**
356
+ * Optional stats embedded in `DeckConfig`. Mirrors `TableStats` / `ChartStats` — lets a consumer
357
+ * render deck chrome (e.g. "Slide 1 / N") before deeply inspecting the slide array.
358
+ *
359
+ * Backward-compat: optional everywhere; the renderer derives the count from `slides.length` when
360
+ * absent.
361
+ */
362
+ interface DeckStats {
363
+ /** Total number of slides in the deck. */
364
+ slideCount: number;
365
+ }
366
+ /**
367
+ * Optional deck-level metadata embedded in `DeckConfig`. Injected by the client at render time;
368
+ * clay renders each field if present and ignores it when absent.
369
+ */
370
+ interface DeckMeta {
371
+ /** Short eyebrow / running header text shown at top-left of every slide (e.g. org name). */
372
+ eyebrow?: string;
373
+ /** Date string shown on the TITLE slide (e.g. "Q2 2026"). No formatting is applied — rendered as-is. */
374
+ date?: string;
375
+ /**
376
+ * Theme identifier. Defaults to `"shapes-light"` when absent.
377
+ * Currently only `"shapes-light"` is implemented; unknown values fall back to the default.
378
+ */
379
+ theme?: string;
380
+ /**
381
+ * Account logo URL injected by the client at render time. Clay renders `<img src={logoUrl}>`
382
+ * (capped height, object-contain) at top-right of every slide when present. Omitted → no logo.
383
+ *
384
+ * CROSS-REPO DEVIATION: this field exists ONLY on clay's `DeckMeta`. io-server's `DeckMeta`
385
+ * (and the GraphQL SDL) deliberately omit `logoUrl` — it is client-injected from the account's
386
+ * branding and must NOT round-trip through the server. Keep the two `DeckMeta` shapes in sync on
387
+ * every field EXCEPT this one. The renderer validates it against an http(s) allowlist before use.
388
+ */
389
+ logoUrl?: string;
390
+ }
391
+ /** Rendering config for a deck artifact, stored at `artifact.config` (JSONB on the server). */
392
+ interface DeckConfig {
393
+ /** Ordered slides. At least one; the renderer guards against an empty array. */
394
+ slides: DeckSlide[];
395
+ /** Optional metadata describing the deck — used for chrome before slide inspection. */
396
+ stats?: DeckStats;
397
+ /** Optional deck-level metadata (eyebrow, date, theme, logo). */
398
+ meta?: DeckMeta;
399
+ }
400
+ /** Concrete deck artifact record. */
401
+ type DeckArtifactRecord = ArtifactBase<typeof artifactTypes.DECK, DeckConfig>;
402
+ /**
403
+ * Localized labels for the `DECK` artifact's user-facing strings. Covers navigation controls,
404
+ * the download action, and status messages. Consumer passes the bag from their i18n layer; clay
405
+ * falls back to English defaults when omitted (per-key Partial merge).
406
+ *
407
+ * `chart` / `table` are nested bags forwarded to embedded chart / table blocks' renderers so
408
+ * those inherit the consumer's translations (status / empty / loading strings). Both are optional;
409
+ * the orchestrator defaults them to `DEFAULT_CHART_ARTIFACT_LABELS` / `DEFAULT_TABLE_ARTIFACT_LABELS`.
410
+ */
411
+ interface DeckArtifactLabels {
412
+ /** aria-label on the "previous slide" navigation button. */
413
+ previous: string;
414
+ /** aria-label on the "next slide" navigation button. */
415
+ next: string;
416
+ /**
417
+ * Slide-position indicator template. `{current}` and `{total}` are substituted at render time
418
+ * (e.g. "Slide {current} of {total}" → "Slide 2 of 5").
419
+ */
420
+ position: string;
421
+ /** Tooltip + aria-label on the Download (`.pptx`) button in the deck artifact header. */
422
+ download: string;
423
+ /** Status message shown when the deck config is malformed or has no slides. */
424
+ unavailable: string;
425
+ /** aria-label on the expand / enter-fullscreen button in the artifact header. */
426
+ enterFullscreen: string;
427
+ /** aria-label on the collapse / exit-fullscreen button in the fullscreen overlay. */
428
+ exitFullscreen: string;
429
+ /** "Thank you" closing message shown on the CLOSING slide. */
430
+ thankYou: string;
431
+ /** "Questions?" prompt shown on the CLOSING slide below the thank-you message. */
432
+ questions: string;
433
+ /** Fallback title for the AGENDA slide when the slide's `title` is empty. */
434
+ agenda: string;
435
+ /** Label bag forwarded to embedded chart blocks. Defaults to `DEFAULT_CHART_ARTIFACT_LABELS`. */
436
+ chart?: ChartArtifactLabels;
437
+ /** Label bag forwarded to embedded table blocks. Defaults to `DEFAULT_TABLE_ARTIFACT_LABELS`. */
438
+ table?: TableArtifactLabels;
439
+ }
440
+ /** English fallback for `DeckArtifactLabels`. Used when the consumer hasn't passed `labels`. */
441
+ declare const DEFAULT_DECK_ARTIFACT_LABELS: DeckArtifactLabels;
442
+ /**
443
+ * Consumer-supplied side-effect callbacks for actions on the deck artifact. Mirrors
444
+ * `TableArtifactCallbacks` — every callback is optional and receives the `DeckArtifactRecord` so
445
+ * consumers can derive analytics context without a per-block closure at every render site.
446
+ */
447
+ interface DeckArtifactCallbacks {
448
+ /** Fires when the user navigates to a different slide. `slideIndex` is zero-based. */
449
+ onNavigate?: (artifact: DeckArtifactRecord, slideIndex: number) => void;
450
+ /** Fires when the Download (`.pptx`) button is clicked. Browser-native download still happens. */
451
+ onDownload?: (artifact: DeckArtifactRecord) => void;
452
+ }
453
+
258
454
  /**
259
455
  * Artifact-domain types — wire-protocol shapes shared between artifact components, block-services,
260
456
  * and consumers. Splits responsibilities across three layers so each artifact kind owns its own
@@ -278,16 +474,16 @@ interface TableArtifactCallbacks {
278
474
  * clay versions that don't know about a new type silently render nothing — see `ArtifactRefBlock`
279
475
  * guard.
280
476
  */
281
- type ArtifactRecord = TableArtifactRecord | ChartArtifactRecord;
477
+ type ArtifactRecord = TableArtifactRecord | ChartArtifactRecord | DeckArtifactRecord;
282
478
  /**
283
479
  * Type-level lookup from an `ArtifactRecord` branch to its labels / callbacks slice. The block
284
480
  * layer already carries the discriminator on `artifact.type`, so the renderer-side `labels` and
285
481
  * `callbacks` props expose exactly one type's slice — never a union-bag keyed by type. Consumers
286
482
  * emit a flat object; the dispatcher narrows it implicitly via `TArtifact`.
287
483
  */
288
- type ArtifactLabelsOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactLabels : TArtifact extends TableArtifactRecord ? TableArtifactLabels : never;
484
+ type ArtifactLabelsOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactLabels : TArtifact extends TableArtifactRecord ? TableArtifactLabels : TArtifact extends DeckArtifactRecord ? DeckArtifactLabels : never;
289
485
  /** Sibling to `ArtifactLabelsOf` — callbacks slice matching the artifact branch. */
290
- type ArtifactCallbacksOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactCallbacks : TArtifact extends TableArtifactRecord ? TableArtifactCallbacks : never;
486
+ type ArtifactCallbacksOf<TArtifact extends ArtifactRecord> = TArtifact extends ChartArtifactRecord ? ChartArtifactCallbacks : TArtifact extends TableArtifactRecord ? TableArtifactCallbacks : TArtifact extends DeckArtifactRecord ? DeckArtifactCallbacks : never;
291
487
  /**
292
488
  * Props every concrete artifact component receives from the dispatcher.
293
489
  *
@@ -327,4 +523,4 @@ interface ArtifactService<TArtifact extends ArtifactRecord = ArtifactRecord> {
327
523
  toClipboardText: (artifact: TArtifact) => string;
328
524
  }
329
525
 
330
- export { type ArtifactCallbacksOf as A, type BarChartConfig as B, type ChartArtifactLabels as C, DEFAULT_CHART_ARTIFACT_LABELS as D, type LineChartConfig as L, type PieChartConfig as P, type TableArtifactLabels as T, type ArtifactDataRow as a, type ArtifactLabelsOf as b, type ArtifactRecord as c, type ArtifactService as d, type ArtifactServiceProps as e, type ArtifactType as f, type ChartArtifactRecord as g, type ChartConfig as h, type ChartStats as i, DEFAULT_TABLE_ARTIFACT_LABELS as j, type TableArtifactRecord as k, type TableColumn as l, type TableConfig as m, type TableRow as n, type TableStats as o, artifactTypes as p };
526
+ export { type ArtifactCallbacksOf as A, type BarChartConfig as B, type ChartArtifactLabels as C, DEFAULT_CHART_ARTIFACT_LABELS as D, type TableRow as E, type TableStats as F, artifactTypes as G, deckBlockTypes as H, deckSlideKinds as I, type LineChartConfig as L, type PieChartConfig as P, type TableArtifactLabels as T, type ArtifactDataRow as a, type ArtifactLabelsOf as b, type ArtifactRecord as c, type ArtifactService as d, type ArtifactServiceProps as e, type ArtifactType as f, type ChartArtifactRecord as g, type ChartConfig as h, type ChartStats as i, DEFAULT_DECK_ARTIFACT_LABELS as j, DEFAULT_TABLE_ARTIFACT_LABELS as k, type DeckArtifactCallbacks as l, type DeckArtifactLabels as m, type DeckArtifactRecord as n, type DeckBlock as o, type DeckChartBlock as p, type DeckConfig as q, type DeckMeta as r, type DeckSlide as s, type DeckSlideKind as t, type DeckStats as u, type DeckTableBlock as v, type DeckTextBlock as w, type TableArtifactRecord as x, type TableColumn as y, type TableConfig as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapesos/clay",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "devDependencies": {