@folienbaukasten/extension-toolkit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +109 -0
  2. package/abi/README.md +20 -0
  3. package/abi/abi.json +151 -0
  4. package/abi/pack.d.ts +196 -0
  5. package/abi/pack.js +126 -0
  6. package/abi/provenance.json +5 -0
  7. package/abi/shims/jsx-runtime.js +13 -0
  8. package/abi/shims/platform.js +48 -0
  9. package/abi/shims/react.js +18 -0
  10. package/abi/types/charts/geometry.d.ts +43 -0
  11. package/abi/types/charts/option.d.ts +15 -0
  12. package/abi/types/charts/scale.d.ts +14 -0
  13. package/abi/types/charts/theme.d.ts +16 -0
  14. package/abi/types/charts/waterfall.d.ts +35 -0
  15. package/abi/types/components/Block.d.ts +31 -0
  16. package/abi/types/components/BlockArrow.d.ts +16 -0
  17. package/abi/types/components/Card.d.ts +25 -0
  18. package/abi/types/components/ChartView.d.ts +4 -0
  19. package/abi/types/components/DriverTree.d.ts +9 -0
  20. package/abi/types/components/FindingsBanner.d.ts +21 -0
  21. package/abi/types/components/HarveyBall.d.ts +12 -0
  22. package/abi/types/components/HeaderTitle.d.ts +19 -0
  23. package/abi/types/components/InsightRail.d.ts +13 -0
  24. package/abi/types/components/KpiTile.d.ts +5 -0
  25. package/abi/types/components/Matrix.d.ts +5 -0
  26. package/abi/types/components/QuoteColumn.d.ts +5 -0
  27. package/abi/types/components/SourceLine.d.ts +6 -0
  28. package/abi/types/components/Table.d.ts +5 -0
  29. package/abi/types/components/Timeline.d.ts +5 -0
  30. package/abi/types/components/slide/ContentSlide.d.ts +29 -0
  31. package/abi/types/components/slide/MissingComponent.d.ts +26 -0
  32. package/abi/types/components/slide/SlideFrame.d.ts +20 -0
  33. package/abi/types/components/slide/SlotView.d.ts +30 -0
  34. package/abi/types/components/slide/registry.d.ts +27 -0
  35. package/abi/types/components/slide/views/AgendaSlideView.d.ts +8 -0
  36. package/abi/types/components/slide/views/CardsSlideView.d.ts +12 -0
  37. package/abi/types/components/slide/views/ChaptersSlideView.d.ts +11 -0
  38. package/abi/types/components/slide/views/ChartSlideView.d.ts +3 -0
  39. package/abi/types/components/slide/views/ComponentSlideView.d.ts +19 -0
  40. package/abi/types/components/slide/views/DriverTreeSlideView.d.ts +3 -0
  41. package/abi/types/components/slide/views/FreeformSlideView.d.ts +3 -0
  42. package/abi/types/components/slide/views/KpiSlideView.d.ts +3 -0
  43. package/abi/types/components/slide/views/MatrixSlideView.d.ts +3 -0
  44. package/abi/types/components/slide/views/QuoteSlideView.d.ts +3 -0
  45. package/abi/types/components/slide/views/QuotesSlideView.d.ts +5 -0
  46. package/abi/types/components/slide/views/SplitSlideView.d.ts +3 -0
  47. package/abi/types/components/slide/views/TableSlideView.d.ts +3 -0
  48. package/abi/types/components/slide/views/TimelineSlideView.d.ts +3 -0
  49. package/abi/types/components/slide/views/TitleSlideView.d.ts +7 -0
  50. package/abi/types/components/slide/views/TwoBlockSlideView.d.ts +3 -0
  51. package/abi/types/components/slide/views/WebSlideView.d.ts +23 -0
  52. package/abi/types/components/slide/views/WhileArrowSlideView.d.ts +14 -0
  53. package/abi/types/deck/data.d.ts +127 -0
  54. package/abi/types/deck/host.d.ts +9 -0
  55. package/abi/types/deck/layouts.d.ts +685 -0
  56. package/abi/types/deck/schema.d.ts +437 -0
  57. package/abi/types/deck/web-body.d.ts +47 -0
  58. package/abi/types/lib/format.d.ts +12 -0
  59. package/abi/types/sets/platform.d.ts +45 -0
  60. package/abi/types/sets/types.d.ts +128 -0
  61. package/dist/fbk-pack.js +756 -0
  62. package/package.json +49 -0
  63. package/tsconfig.extension.json +17 -0
@@ -0,0 +1,23 @@
1
+ import type { SlideViewProps } from '../../../sets/types';
2
+ import type { WebSlideSpec } from '../../../deck/layouts';
3
+ /**
4
+ * A slide body the model wrote as HTML and CSS.
5
+ *
6
+ * Tier A: the markup is sanitized and rendered INLINE, in the slide's own
7
+ * document. That is the whole design — a body that never leaves the document
8
+ * keeps every affordance the platform has for free. The theme's tokens reach
9
+ * it through the ordinary cascade, so a theme swap restyles it; `data-edit`
10
+ * text editing, the picker and the overflow check are the same code paths
11
+ * that serve every other layout, because to them this is just DOM inside
12
+ * `.slide-body`.
13
+ *
14
+ * Two things are the view's own work. The stylesheet is scoped to this one
15
+ * slide, so a rule written for this body cannot restyle the deck around it;
16
+ * and a body that tagged nothing gets a `data-pptx` on its wrapper, so a
17
+ * click still selects *something* the chat can be told about.
18
+ *
19
+ * The `data-web-body` marker is what stops a PPTX export dead
20
+ * (src/export/measure-dom.ts) — Web Mode already refuses the export
21
+ * upstream, and this is the belt to that pair of braces.
22
+ */
23
+ export declare function WebSlideView({ slide, meta, slideNumber, chrome }: SlideViewProps<WebSlideSpec>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { SlideViewProps } from '../../../sets/types';
2
+ import type { WhileArrowSlideSpec } from '../../../deck/layouts';
3
+ /**
4
+ * "While a … we need to consider b" — two blocks joined by a slim triangular
5
+ * blade spanning ~90% of the block height, pointing left → right.
6
+ *
7
+ * Both sides always render as the SAME block variant. The layout is one
8
+ * sentence split across an arrow, and giving the halves different fills
9
+ * breaks the parallel it exists to draw — the eye reads two unrelated boxes
10
+ * instead of a claim and its consequence. The variant comes from `left`;
11
+ * a differing `right.variant` is ignored rather than honoured, because
12
+ * there is no correct way to render a mismatch here.
13
+ */
14
+ export declare function WhileArrowSlideView({ slide, meta, slideNumber, chrome, }: SlideViewProps<WhileArrowSlideSpec>): import("react").JSX.Element;
@@ -0,0 +1,127 @@
1
+ /** What a spreadsheet cell can hold once read. `null` is an empty cell. */
2
+ export type CellValue = string | number | boolean | null;
3
+ /** One sheet's used range, row-major. Rows may be ragged; readers pad. */
4
+ export interface DataSheet {
5
+ /** Sheet name as the workbook spells it — the middle part of a `$ref`. */
6
+ name: string;
7
+ cells: CellValue[][];
8
+ }
9
+ /** One imported workbook, snapshotted into the deck. */
10
+ export interface DataSource {
11
+ /**
12
+ * Short slug the refs name it by, unique within the deck (`plan`,
13
+ * `fy28-actuals`). Stable across refreshes — renaming a source would
14
+ * silently break every ref that points at it.
15
+ */
16
+ id: string;
17
+ /** What to call it in the UI, e.g. "FY28 Plan". */
18
+ name: string;
19
+ /** Original file name, kept for the UI and for re-import. */
20
+ fileName: string;
21
+ /**
22
+ * Absolute path of the file this came from, for Refresh. Absent when the
23
+ * source was pasted, or when the deck arrived from another machine and the
24
+ * path was deliberately dropped.
25
+ */
26
+ path?: string;
27
+ /** ISO timestamp of the last import or refresh. */
28
+ importedAt: string;
29
+ sheets: DataSheet[];
30
+ }
31
+ /**
32
+ * A pointer to a range in a `DataSource`, in place of a literal prop value.
33
+ *
34
+ * The one-key object shape is deliberate: it is unambiguous inside arbitrary
35
+ * JSON (no string prop can be mistaken for one), it survives every deck patch
36
+ * path unchanged, and a deck that reaches a machine with an older build shows
37
+ * up as a validation error naming the ref rather than as a silently empty
38
+ * chart.
39
+ */
40
+ export interface DataRef {
41
+ $ref: string;
42
+ }
43
+ export declare function isDataRef(value: unknown): value is DataRef;
44
+ /** Zero-based row/column bounds of a rectangular range, inclusive. */
45
+ interface RangeBounds {
46
+ r0: number;
47
+ c0: number;
48
+ r1: number;
49
+ c1: number;
50
+ }
51
+ /** 0 → "A", 26 → "AA". The inverse, for the UI's range hints. */
52
+ export declare function columnName(index: number): string;
53
+ /** How a ref reshapes the rectangle it read. See `ParsedRef`. */
54
+ export interface RefOptions {
55
+ /** `cols` transposes before anything else, so a metric down a column
56
+ * reads as a row. Default `rows`. */
57
+ orient: 'rows' | 'cols';
58
+ /** First row (after `orient`) is a header: yield objects keyed by it. */
59
+ header: boolean;
60
+ /**
61
+ * Collapse a degenerate rectangle: 1×1 becomes a scalar and 1×N or N×1 a
62
+ * flat array. Default true — it is what makes `{"$ref":"…!B2"}` usable as
63
+ * a KPI value. `collapse=none` keeps the 2-D array.
64
+ */
65
+ collapse: boolean;
66
+ }
67
+ export interface ParsedRef {
68
+ sourceId: string;
69
+ /** Absent = the source's first sheet. */
70
+ sheet?: string;
71
+ /** Absent = the sheet's whole used range. */
72
+ range?: RangeBounds;
73
+ options: RefOptions;
74
+ }
75
+ /**
76
+ * `"<source>[!<sheet>][!<range>]"` with an optional `?opt=value&…` tail.
77
+ *
78
+ * The sheet is optional and the range is optional, which leaves `a!b`
79
+ * ambiguous — it is read as a range when it looks like A1 notation and as a
80
+ * sheet name otherwise. A sheet genuinely called "B2" therefore needs its
81
+ * range spelled out (`plan!B2!A1:D9`); that is the whole cost of letting the
82
+ * common forms stay short.
83
+ */
84
+ export declare function parseRef(ref: string): ParsedRef | {
85
+ error: string;
86
+ };
87
+ /**
88
+ * A deep copy of `value` with every `{ $ref }` replaced by what it points at.
89
+ *
90
+ * A ref that cannot be resolved is left in place, and its reason is pushed
91
+ * onto `errors`. Leaving it is what lets the two callers differ: validation
92
+ * reports the errors and refuses, while rendering shows the rest of the slide
93
+ * — a deck with one dead ref should still open.
94
+ */
95
+ export declare function resolveValue(value: unknown, sources: DataSource[], errors?: string[], path?: string): unknown;
96
+ /** What `resolveDeck` hands back: the deck to render, and what went wrong. */
97
+ export interface ResolvedDeck<T> {
98
+ deck: T;
99
+ errors: string[];
100
+ }
101
+ /**
102
+ * Resolve every ref in a deck's slides.
103
+ *
104
+ * `meta` and `data` are copied through untouched: a ref in the header of the
105
+ * deck's own metadata would be resolvable but is not a thing anyone needs,
106
+ * and refs *inside* the snapshot would be a loop.
107
+ *
108
+ * A deck with no `data` and no refs short-circuits to the identical object,
109
+ * so the common case costs one property read — this runs on every render.
110
+ */
111
+ export declare function resolveDeck<T extends {
112
+ meta: unknown;
113
+ slides: unknown[];
114
+ data?: DataSource[];
115
+ }>(deck: T): ResolvedDeck<T>;
116
+ /** Whether anything in `value` is a ref — the render-path fast exit. */
117
+ export declare function hasRef(value: unknown): boolean;
118
+ /**
119
+ * Structural check on `deck.data` itself, before anything tries to read it.
120
+ * Kept separate from ref resolution because the two fail for opposite
121
+ * reasons: this catches a malformed *import*, that catches a bad *pointer*.
122
+ */
123
+ export declare function validateDataSources(value: unknown): string[];
124
+ /** Every ref string in a deck, in document order — the UI's "what uses this
125
+ * source" answer, and what a source cannot be removed out from under. */
126
+ export declare function collectRefs(value: unknown, out?: string[]): string[];
127
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Called by the preview app in `?embed=1` mode, before the first render. */
2
+ export declare function setEmbeddedHost(value: boolean): void;
3
+ export declare function isEmbeddedHost(): boolean;
4
+ /**
5
+ * "Install this extension" from inside a slide. The editor owns the
6
+ * Extensions dialog; the preview only says which extension the user asked
7
+ * for (src/editor/preview-bridge.ts).
8
+ */
9
+ export declare function requestInstallExtension(extensionId: string): void;