@motionscript/code 0.1.0-alpha.5 → 0.1.0-alpha.6

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/code",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.6",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js"
6
6
  },
package/dist/engine.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './transitions.js';
2
2
  export * from './layout.js';
3
3
  export { drawCode } from './render.js';
4
- export type { DrawCodeState } from './render.js';
4
+ export type { CodeCanvas, DrawCodeState } from './render.js';
5
5
  export { diffCode as defaultCodeDiff } from './diff.js';
6
6
  export type { CodeDiffStrategy, CodeEdit } from './diff.js';
7
7
  export { loadCodeLanguage, initSyntaxHighlighter, ensureHighlighter, registerCodeTheme, resolveTheme, canHighlight, normalizeSource } from './highlight.js';
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAOA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,eA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BAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/G,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,4DAA4D;AAC5D,kEAAkE;AAClE,yEAAyE;AACzE,qEAAqE;AACrE,sEAAsE;AACtE,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC","sourcesContent":["// The Code \"engine\": syntax highlighting, tokenizing, layout, diffing, and\r\n// transition/phase scheduling — kept separate from node.ts so `ms add code`\r\n// can copy just the node declaration and import this behind\r\n// `@motionscript/code` instead. What gets copied is whatever this\r\n// package's registry.json declares, which for this component is node.ts;\r\n// packages/site/scripts/build-registry.mjs enforces that anything it\r\n// reaches for is either copied alongside it or re-exported from here.\r\nexport * from './transitions';\r\nexport * from './layout';\r\nexport { drawCode } from './render';\r\nexport type { DrawCodeState } from './render';\r\nexport { diffCode as defaultCodeDiff } from './diff';\r\nexport type { CodeDiffStrategy, CodeEdit } from './diff';\r\nexport { loadCodeLanguage, initSyntaxHighlighter, ensureHighlighter, registerCodeTheme, resolveTheme, canHighlight, normalizeSource } from './highlight';\r\nexport { tokenizeCodeToIdLines } from './tokens';\r\nexport type { IdLine, IdToken } from './tokens';\r\nexport { DefaultHighlightStyle, GithubDarkStyle, GithubLightStyle, VscodeDarkStyle, VscodeLightStyle, BUILTIN_THEMES, compileStyle } from './style';\r\nexport type { CodeHighlightStyle, CodeStyleRule, CodeTheme, CodeThemeName } from './style';\r\nexport { TokenAdvanceCache } from './measure-cache';\r\nexport { word, lines, rangeToCharOffsets, charOffsetsToRange, CodeRanges, CodeRangeChain } from './code-range';\r\nexport type { CodeRange } from './code-range';\r\n"]}
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,4DAA4D;AAC5D,kEAAkE;AAClE,yEAAyE;AACzE,qEAAqE;AACrE,sEAAsE;AACtE,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC","sourcesContent":["// The Code \"engine\": syntax highlighting, tokenizing, layout, diffing, and\r\n// transition/phase scheduling — kept separate from node.ts so `ms add code`\r\n// can copy just the node declaration and import this behind\r\n// `@motionscript/code` instead. What gets copied is whatever this\r\n// package's registry.json declares, which for this component is node.ts;\r\n// packages/site/scripts/build-registry.mjs enforces that anything it\r\n// reaches for is either copied alongside it or re-exported from here.\r\nexport * from './transitions';\r\nexport * from './layout';\r\nexport { drawCode } from './render';\r\nexport type { CodeCanvas, DrawCodeState } from './render';\r\nexport { diffCode as defaultCodeDiff } from './diff';\r\nexport type { CodeDiffStrategy, CodeEdit } from './diff';\r\nexport { loadCodeLanguage, initSyntaxHighlighter, ensureHighlighter, registerCodeTheme, resolveTheme, canHighlight, normalizeSource } from './highlight';\r\nexport { tokenizeCodeToIdLines } from './tokens';\r\nexport type { IdLine, IdToken } from './tokens';\r\nexport { DefaultHighlightStyle, GithubDarkStyle, GithubLightStyle, VscodeDarkStyle, VscodeLightStyle, BUILTIN_THEMES, compileStyle } from './style';\r\nexport type { CodeHighlightStyle, CodeStyleRule, CodeTheme, CodeThemeName } from './style';\r\nexport { TokenAdvanceCache } from './measure-cache';\r\nexport { word, lines, rangeToCharOffsets, charOffsetsToRange, CodeRanges, CodeRangeChain } from './code-range';\r\nexport type { CodeRange } from './code-range';\r\n"]}
package/dist/node.d.ts CHANGED
@@ -1,37 +1,9 @@
1
- import { RenderContext2D, RenderPass2D, Clip, EasingFunction, NodeConfig, Size2D, SizeConstraints, Node2D, Node2DProps, MeasureContext2D, InsetsResolved, InsetsProps, type Color, type AssetScope, type Command, type CommandArgs, type Node, type TweenStepper, type Vector2 } from "@motionscript/sdk";
2
- import { CodeRange, type CodeDiffStrategy, type CodePhaseStrategy, CodeTheme } from "./engine.js";
1
+ import { type NodeOf, type NormalizedColor, type Color as _Color, type Node2D as _Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
2
+ import { type CodeDiffStrategy, type CodePhaseStrategy, type CodeRange, type CodeTheme, type DimTransition, type IdLine, type RowBand, type RowsTransition, type StructuralTransition } from "./engine.js";
3
3
  /**
4
- * A listing and nothing else — no paint slots, and no box behind the tokens.
5
- *
6
- * It did carry a `fill`/`overlay`/`stroke`/`shadow` set and the corner radius
7
- * that shaped them, so a block could draw its own panel. That was one node doing
8
- * two jobs, and the second one is a `Rect`'s: a listing set on a card is a `Code`
9
- * inside a hugging `Rect`, which tracks the block's size for the same reason
10
- * every other hugging container tracks its child's. What is left here is the
11
- * listing — its source, how it is coloured, the face it is set in, and the space
12
- * it keeps around itself.
13
- */
14
- export interface CodeProps extends Node2DProps {
15
- code: string;
16
- language: string;
17
- fontSize: number;
18
- fontFamily: string;
19
- /** A built-in/registered theme name (e.g. `'github-dark'`), or a {@link CodeHighlightStyle} object. */
20
- theme: CodeTheme;
21
- lineHeight: number;
22
- letterSpacing: number;
23
- showLineNumbers: boolean;
24
- lineNumberGap: number;
25
- padding: InsetsProps;
26
- }
27
- /**
28
- * Construction-time-only options: pluggable engine behavior, set once when
29
- * the node is created. Deliberately *not* part of {@link CodeProps} — every
30
- * `@property` field accepts either a value or a zero-arg reactive binding
31
- * (`value | (() => value)`, see `PropInputs`), and the node's own reactive
32
- * write path (`_writeProp`) treats any function value as the latter. A
33
- * strategy *is* a function, so it can't be told apart from a binding that
34
- * computes one — it has to stay outside the reactive prop system entirely.
4
+ * Which token became which across an edit, and when each part of it happens.
5
+ * Arguments of {@link defineCode}: a strategy is a function, which a prop would
6
+ * take for a binding, so it is part of the component's definition instead.
35
7
  */
36
8
  export interface CodeStrategies {
37
9
  /** Decides which token became which across an edit. Defaults to `defaultCodeDiff`. */
@@ -39,310 +11,189 @@ export interface CodeStrategies {
39
11
  /** Decides when (in normalized transition time) each part of an edit happens. Defaults to `defaultCodePhases`. */
40
12
  phaseStrategy?: CodePhaseStrategy;
41
13
  }
42
- export declare class Code extends Node2D<CodeProps> {
43
- readonly code: string;
14
+ /** `code` part-way through a `to({ code })`: the source it leaves, the one it lands on, and how far along it is, eased. */
15
+ export interface CodeBlend {
16
+ readonly from: string;
17
+ readonly to: string;
18
+ readonly t: number;
19
+ }
20
+ /** What `code` holds: a source, or a {@link CodeBlend} while a `to({ code })` runs. */
21
+ export type CodeSource = string | CodeBlend;
22
+ /** A range argument: one range, several, or a chain that went through JSON as `{ list }`. */
23
+ export type CodeTarget = CodeRange | Iterable<CodeRange> | {
24
+ readonly list: CodeRange[];
25
+ };
26
+ /** What a structure was tokenized with: the grammar, the theme and whether the grammar had landed. */
27
+ export interface CodeTokenBasis {
44
28
  readonly language: string;
45
- readonly fontFamily: string;
46
29
  readonly theme: CodeTheme;
47
- readonly fontSize: number;
48
- readonly lineHeight: number;
49
- readonly letterSpacing: number;
50
- readonly showLineNumbers: boolean;
51
- readonly lineNumberGap: number;
52
- readonly padding: InsetsResolved;
53
- /** The settled structure. During an edit, the structure the edit lands on. */
54
- private tokenLines;
55
- /** The source `tokenLines` spells, so a frame compares it with `code` without joining every token. */
56
- private _linesSource;
57
- /** What `tokenLines` were coloured and split with, so a frame notices a `language` or `theme` that has moved since. */
58
- private _linesBasis;
59
- /** The last `code` seen and its normalised form, so a frame that finds it unchanged does not scan it. */
60
- private _rawCode;
61
- private _normalCode;
62
- private transitions;
63
- private advanceCache;
64
- private structureVersion;
65
- private layoutCacheKey;
66
- private layoutCache;
67
- private highlightDimOpacity;
68
- private highlightedIds;
69
- private rowBands;
70
- /**
71
- * Which token became which across an edit, and when each part of that
72
- * edit happens. Construction-time-only (see {@link CodeStrategies}) —
73
- * resolved once here rather than left as `?? defaultX` at every call site.
74
- */
75
- private readonly diffStrategy;
76
- private readonly phaseStrategy;
77
- constructor(props?: NodeConfig<Code, CodeProps> & CodeStrategies);
78
- /**
79
- * Swap in a new settled structure, invalidating the layout cache.
80
- *
81
- * The one place `tokenLines` is written, because the cache key is a version
82
- * counter rather than a hash of the content — a write that skipped the bump
83
- * would keep serving the previous frame's geometry for the new listing.
84
- */
85
- private setLines;
86
- /**
87
- * The monospaced face this block measures and draws with, and the syntax
88
- * grammar it tokenizes with.
89
- *
90
- * Both belong to *layout*: token x positions are measured against the face,
91
- * and how many tokens there are depends on the grammar. Declared here, the
92
- * grammar goes on the timeline as an ordinary asset: `AssetManager.loadAt`
93
- * waits for it before the frame is laid out, so the first measurement is the
94
- * right one. Nothing is freed on eviction — parsers are cheap to keep
95
- * resident. The loader touches no node: `renderContent` re-tokenizes once
96
- * the grammar is there.
97
- */
98
- declareAssets(assets: AssetScope): void;
99
- private metrics;
100
- /** The structural edit currently in flight, if any. */
101
- private activeEdit;
102
- /** The row-band change in flight, if any; the latest wins. */
103
- private activeRows;
104
- private settledLayout;
105
- /**
106
- * The one or two layouts this frame is drawn from.
107
- *
108
- * A settled frame has one. A frame inside an edit has two — where every
109
- * token was, and where it is going — and the frame is a point between them.
110
- * That is the whole reason an insert no longer piles its glyphs at the left
111
- * margin: a token's destination is *computed*, not approximated by collapsing
112
- * the advance of everything around it.
113
- *
114
- * Both endpoints are fixed for the edit's duration, so they are built once
115
- * and cached on the transition rather than rebuilt per frame.
116
- */
117
- private frameLayout;
118
- measure(constraints: SizeConstraints, scope: MeasureContext2D): Partial<Size2D>;
119
- protected renderContent(ctx: RenderPass2D): void;
120
- protected renderSelf(ctx: RenderContext2D): void;
121
- /** A listing holds a listing — `append`/`insert`/`erase` are how it grows. */
122
- protected acceptsChild(_child: Node): boolean;
123
- /**
124
- * The node's laid-out rect as a clip outline, so `clip` and any backdrop
125
- * effect are confined to the block rather than to nothing — a listing set on
126
- * a card is exactly where a backdrop blur is asked for.
127
- */
128
- protected clipSelf(): Clip;
129
- /**
130
- * A listing is grabbed by its **text**, line by ragged line, rather than by
131
- * the rectangle the lines were laid out in.
132
- *
133
- * The default narrows a node's grab region to the outline it declares, and
134
- * this node's outline is a box it no longer paints anything into. Code is
135
- * mostly whitespace: a ten-line snippet with one long line is a rectangle
136
- * that is largely empty, and in an editor every one of those empty pixels
137
- * swallows a click meant for whatever sits behind or beneath it. Short of the
138
- * text itself there is nothing there to have clicked.
139
- *
140
- * So the region is the union of the lines' own extents — each a line-height
141
- * slot as wide as that line's ink — plus the gutter where line numbers are
142
- * showing, since those are drawn glyphs too.
143
- *
144
- * Answered from the **cached** layout, which is what the last frame drew
145
- * from, because a hit test arrives with no measurement scope and text cannot
146
- * be measured without one. Where there is no usable cache — before the first
147
- * frame, or mid-edit, when the geometry is an interpolation of two structures
148
- * held on the transition — the box is the honest answer rather than a
149
- * silhouette measured against stale metrics.
150
- */
151
- protected hitTestSelf(local: Vector2, tolerance: number): boolean;
152
- /**
153
- * The layout a hit test may be answered from: the settled cache, and only
154
- * while it still matches the node's current metrics.
155
- *
156
- * The key is the one {@link settledLayout} writes minus its scope-dependent
157
- * half — every input to it (`metricsSignature`, the advance cache's own
158
- * signature) is readable without a measurer, which is precisely what makes
159
- * the check possible here.
160
- */
161
- private hitLayout;
162
- /**
163
- * Append `code` to the end of the listing.
164
- *
165
- * Stated as *what the source becomes*; {@link editTo} works out the rest —
166
- * which is why appending a line that closes a block re-highlights the lines
167
- * above it, instead of colouring the new text as its own program.
168
- */
169
- append(args: CommandArgs<{
170
- code: string;
171
- }> & {
172
- duration: number;
173
- }): Command<Record<string, never>>;
174
- /** Insert `code` above the listing. */
175
- prepend(args: CommandArgs<{
176
- code: string;
177
- }> & {
178
- duration: number;
179
- }): Command<Record<string, never>>;
180
- /**
181
- * Insert `code` at the given (line, col). Both are 1-indexed; col is the
182
- * column BEFORE which the new content is inserted (col=1 means start of
183
- * line). If `code` contains newlines, new lines are created in the middle
184
- * of the existing line.
185
- */
186
- insert(args: CommandArgs<{
187
- position: [number, number];
188
- code: string;
189
- }> & {
190
- duration: number;
191
- }): Command<Record<string, never>>;
192
- /**
193
- * Erase the code in `codeRange`.
194
- *
195
- * Named `erase` rather than `remove` because a `Code` is also a node, and
196
- * `Node.remove(child)` takes a child out of the tree. Two methods spelled
197
- * the same on one object, doing entirely different things, is worse than one
198
- * of them having a slightly less obvious name.
199
- *
200
- * A range that covers whole lines takes their line breaks with it, so the
201
- * rows below close up; a range inside a line takes only the characters, and
202
- * the rest of the line reflows around the hole.
203
- */
204
- erase(args: CommandArgs<{
205
- target: CodeRange;
206
- }> & {
207
- duration: number;
208
- }): Command<Record<string, never>>;
209
- /** Replace the code in `codeRange` with `replacement`. */
210
- replace(args: CommandArgs<{
211
- target: CodeRange;
212
- replacement: string;
213
- }> & {
214
- duration: number;
215
- }): Command<Record<string, never>>;
216
- /**
217
- * Highlight a range of code — or several at once (e.g.
218
- * `CodeRanges.lines(2).word(5, 1, 3)`) — highlighted as one set: tokens
219
- * within any of the ranges stay at opacity 1, tokens outside dim to
220
- * `dim`. Persistent — call resetHighlight() to undo, or call highlight()
221
- * again with a different range to cross-fade.
222
- */
223
- highlight(args: CommandArgs<{
224
- target: CodeRange | Iterable<CodeRange>;
225
- dim?: number;
226
- }> & {
227
- duration: number;
228
- }): Command<Record<string, never>>;
229
- /**
230
- * Fade all dimmed tokens back to opacity 1 and clear the persistent
231
- * highlight state.
232
- */
233
- resetHighlight(args: CommandArgs<Record<string, never>> & {
234
- duration: number;
235
- }): Command<Record<string, never>>;
236
- /**
237
- * Lay a band of `color` behind whole rows: every line a range touches, across
238
- * the block. Persistent, and independent of {@link highlight}'s dimming. A
239
- * second call slides and resizes the bands onto their new rows, pairing them
240
- * in the order given; `resetRowHighlight()` fades them out. A band keeps to
241
- * its lines when an edit moves them.
242
- */
243
- highlightRows(args: CommandArgs<{
244
- target: CodeRange | Iterable<CodeRange>;
245
- color?: Color;
246
- radius?: number;
247
- }> & {
248
- duration: number;
249
- }): Command<Record<string, never>>;
250
- /** Fade every row band out and clear them. */
251
- resetRowHighlight(args: CommandArgs<Record<string, never>> & {
252
- duration: number;
253
- }): Command<Record<string, never>>;
254
- /**
255
- * Animate the listing to a new source.
256
- *
257
- * The engine behind every editing command, and behind `to({ code })`. Every
258
- * edit is expressed as the source it produces, tokenized, and then *diffed*
259
- * against what is on screen — so a token that survived the edit keeps its
260
- * identity and simply travels to its new column, and only what genuinely
261
- * changed is faded.
262
- *
263
- * The result runs in three phases (see `phaseStrategy`): what is leaving
264
- * fades out, what stays reflows, and only then does what is new arrive.
265
- * Playing them together is what made a replacement read as a cross-dissolve
266
- * of two unrelated listings rather than as an edit being made.
267
- */
268
- private editTo;
269
- /**
270
- * Put a dim transition on the stack, drive its progress, take it off and
271
- * commit at the end.
272
- *
273
- * A {@link Command} rather than a generator, which is what makes a listing
274
- * scrubbable: membership is a function of `t` (on the stack for `0 < t < 1`,
275
- * off it outside), `settle(done)` replaces the `finally` and takes *which
276
- * way*, and `progress` is assigned from `t` rather than accumulated.
277
- */
278
- private runDim;
279
- /** The same membership rule as {@link runDim}: on the stack strictly inside the run, settled at either end. */
280
- private runRows;
281
- /**
282
- * Route a tweened `code` through the diff engine.
283
- *
284
- * `to({ code })` is the form an author reaches for first — it is how every
285
- * other prop is animated — and a bare string prop would otherwise land in the
286
- * generic tween's discrete-snap bucket and simply cut at the end. Intercepted
287
- * here it becomes the same three-phase edit the named commands produce, while
288
- * the rest of the step's props tween alongside it untouched.
289
- */
290
- _prepareStep(to: Partial<CodeProps>, duration: number, easing?: EasingFunction): TweenStepper;
291
- /**
292
- * Find every range matching the literal string `text` in the current
293
- * source. Multi-line matches are supported.
294
- */
295
- findAllRanges(text: string): CodeRange[];
296
- /** Find the `index`th range matching `text`. Returns null if not found. */
297
- findRangeAt(text: string, index: number): CodeRange | null;
298
- /** Find the first range matching `text`. Returns null if not found. */
299
- findFirstRange(text: string): CodeRange | null;
300
- private joinedSource;
301
- private lineLengths;
302
- /** Character offset of a 1-indexed (line, col), clamped into the document. */
303
- private offsetAt;
304
- /**
305
- * Resolve one or more CodeRanges to the set of token ids whose content
306
- * overlaps any of them. Tokens that partially overlap are included.
307
- */
308
- private tokenIdsInRanges;
309
- /** One band per range, over every line it touches; a range past the end of the listing gives none. */
310
- private rowBandsIn;
311
- /**
312
- * Thin delegator: everything about *how* a frame is painted (settled or
313
- * mid structural-edit, entry/exit motion, colour cross-fade) lives in
314
- * `drawCode` (the engine's `render.ts`) as a pure function over plain
315
- * state — this just gathers that state from the node's own instance
316
- * fields and caches.
317
- */
318
- protected drawSelf(draw: RenderContext2D): void;
319
- /**
320
- * Whether a listing command has applied since the timeline last restored the
321
- * props.
322
- *
323
- * A slot rather than a field because slots are all a restore puts back. The
324
- * structure, highlight and transitions live outside the props, and only a
325
- * command that has started writes them, so before the first one starts (or
326
- * after a seek back past it) they still hold whatever the last evaluation
327
- * left — the end of every command, after compile. This reads false again
328
- * there, and `_sync` derives them from the props instead.
329
- */
330
- private readonly _driven;
331
- /** Each source the props have named, tokenized once, so a listing derived again keeps the ids a highlight selected. */
332
- private readonly _derived;
333
- /** The first command to apply after a restore starts from the props' listing. */
334
- private _drive;
335
- /**
336
- * Bring the settled structure up to the props it is derived from.
337
- *
338
- * Pulled from every reader rather than pushed from a prop write, because
339
- * `code`, `language` and `theme` can each be tweened or bound, and neither
340
- * has a write to hang a subscription on. Never mid-edit: re-tokenizing mints
341
- * fresh ids, and an in-flight transition is keyed by the ones it captured.
342
- */
343
- private _sync;
344
- private _normalised;
345
- private _basis;
346
- private _structureFor;
30
+ readonly highlighted: boolean;
31
+ }
32
+ /** A listing a command left behind: its source, its tokens, and the basis they were made on. */
33
+ export interface CodeListing {
34
+ readonly source: string;
35
+ readonly lines: IdLine[];
36
+ readonly basis: CodeTokenBasis;
37
+ }
38
+ export interface CodeEditFrame {
39
+ readonly transition: StructuralTransition;
40
+ readonly progress: number;
347
41
  }
42
+ /** The dim `highlight` leaves: what stays bright, what the rest dims to, and the cross-fade in flight. */
43
+ export interface CodeFocus {
44
+ readonly dim: number | null;
45
+ readonly ids: Set<number>;
46
+ readonly fade: DimTransition | null;
47
+ }
48
+ export interface CodeBanding {
49
+ readonly bands: RowBand[];
50
+ readonly fade: RowsTransition | null;
51
+ }
52
+ /**
53
+ * A `Code` whose edits are paired and timed by `strategies`. {@link Code} is
54
+ * the one with the defaults; a project wanting another hands its own to the
55
+ * engine in its place (the key is the same).
56
+ *
57
+ * A listing and nothing else: no paint slots, and no box behind the tokens. A
58
+ * listing set on a card is a `Code` inside a hugging `Rect`.
59
+ */
60
+ export declare function defineCode(strategies?: CodeStrategies): import("@motionscript/sdk").Component<"code", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
61
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
62
+ readonly language: "typescript";
63
+ readonly fontFamily: "Fira Mono";
64
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
65
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
66
+ readonly fontSize: 16;
67
+ readonly lineHeight: 1.6;
68
+ readonly letterSpacing: 1.1;
69
+ readonly showLineNumbers: false;
70
+ readonly lineNumberGap: 2;
71
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
72
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
73
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
74
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
75
+ }>, {
76
+ readonly append: {
77
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
78
+ };
79
+ readonly prepend: {
80
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
81
+ };
82
+ readonly insert: {
83
+ readonly position: import("@motionscript/sdk").Type<[number, number] | undefined, [number, number] | undefined, false>;
84
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
85
+ };
86
+ readonly remove: {
87
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
88
+ };
89
+ readonly replace: {
90
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
91
+ readonly replacement: import("@motionscript/sdk").Type<string, string, false>;
92
+ };
93
+ readonly highlight: {
94
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
95
+ readonly dim: import("@motionscript/sdk").Type<number, number, false>;
96
+ };
97
+ readonly resetHighlight: unknown;
98
+ readonly highlightRows: {
99
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
100
+ readonly color: import("@motionscript/sdk").Type<_Color, NormalizedColor, false>;
101
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
102
+ };
103
+ readonly resetRowHighlight: unknown;
104
+ }, readonly [], _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
105
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
106
+ readonly language: "typescript";
107
+ readonly fontFamily: "Fira Mono";
108
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
109
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
110
+ readonly fontSize: 16;
111
+ readonly lineHeight: 1.6;
112
+ readonly letterSpacing: 1.1;
113
+ readonly showLineNumbers: false;
114
+ readonly lineNumberGap: 2;
115
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
116
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
117
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
118
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
119
+ }>, readonly []>>;
120
+ /**
121
+ * A syntax-highlighted listing whose edits animate token by token: each edit
122
+ * is diffed against what is on screen, so a token that survives travels to
123
+ * its new column and only what changed fades.
124
+ */
125
+ export declare const Code: import("@motionscript/sdk").Component<"code", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
126
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
127
+ readonly language: "typescript";
128
+ readonly fontFamily: "Fira Mono";
129
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
130
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
131
+ readonly fontSize: 16;
132
+ readonly lineHeight: 1.6;
133
+ readonly letterSpacing: 1.1;
134
+ readonly showLineNumbers: false;
135
+ readonly lineNumberGap: 2;
136
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
137
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
138
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
139
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
140
+ }>, {
141
+ readonly append: {
142
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
143
+ };
144
+ readonly prepend: {
145
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
146
+ };
147
+ readonly insert: {
148
+ readonly position: import("@motionscript/sdk").Type<[number, number] | undefined, [number, number] | undefined, false>;
149
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
150
+ };
151
+ readonly remove: {
152
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
153
+ };
154
+ readonly replace: {
155
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
156
+ readonly replacement: import("@motionscript/sdk").Type<string, string, false>;
157
+ };
158
+ readonly highlight: {
159
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
160
+ readonly dim: import("@motionscript/sdk").Type<number, number, false>;
161
+ };
162
+ readonly resetHighlight: unknown;
163
+ readonly highlightRows: {
164
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
165
+ readonly color: import("@motionscript/sdk").Type<_Color, NormalizedColor, false>;
166
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
167
+ };
168
+ readonly resetRowHighlight: unknown;
169
+ }, readonly [], _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
170
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
171
+ readonly language: "typescript";
172
+ readonly fontFamily: "Fira Mono";
173
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
174
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
175
+ readonly fontSize: 16;
176
+ readonly lineHeight: 1.6;
177
+ readonly letterSpacing: 1.1;
178
+ readonly showLineNumbers: false;
179
+ readonly lineNumberGap: 2;
180
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
181
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
182
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
183
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
184
+ }>, readonly []>>;
185
+ export type Code = NodeOf<typeof Code>;
186
+ export type CodeProps = NonNullable<Parameters<typeof Code>[0]>;
187
+ /** What a listing shows now: its source, its token rows, and the edit in flight, if any. */
188
+ export declare function listingOf(code: Code): {
189
+ readonly source: string;
190
+ readonly lines: readonly IdLine[];
191
+ readonly edit: StructuralTransition | null;
192
+ };
193
+ /** Every range matching the literal `text` in `source`, in order and not overlapping. Multi-line matches are found too. */
194
+ export declare function findAllRanges(source: CodeSource, text: string): CodeRange[];
195
+ /** The `index`th range matching `text`, or `null`. */
196
+ export declare function findRangeAt(source: CodeSource, text: string, index: number): CodeRange | null;
197
+ /** The first range matching `text`, or `null`. */
198
+ export declare function findFirstRange(source: CodeSource, text: string): CodeRange | null;
348
199
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EACxF,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAClB,KAAK,KAAK,EACnC,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EACrH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,SAAS,EAOT,KAAK,gBAAgB,EAYrB,KAAK,iBAAiB,EAMtB,SAAS,EAGZ,MAAM,UAAU,CAAC;AAMlB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B,sFAAsF;IACtF,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,kHAAkH;IAClH,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,qBAUa,IAAK,SAAQ,MAAM,CAAC,SAAS,CAAC;IAEvC,SAA4C,IAAI,EAAE,MAAM,CAAC;IACzD,SAAsD,QAAQ,EAAE,MAAM,CAAC;IACvE,SAAqD,UAAU,EAAE,MA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