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

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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @motionscript/code
2
2
 
3
+ ## 0.1.0-alpha.7
4
+
3
5
  ## 0.1.0-alpha.6
4
6
 
5
7
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/code",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.7",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js"
6
6
  },
package/dist/node.d.ts CHANGED
@@ -116,7 +116,51 @@ export declare function defineCode(strategies?: CodeStrategies): import("@motion
116
116
  readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
117
117
  readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
118
118
  readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
119
- }>, readonly []>>;
119
+ }>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
120
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
121
+ readonly language: "typescript";
122
+ readonly fontFamily: "Fira Mono";
123
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
124
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
125
+ readonly fontSize: 16;
126
+ readonly lineHeight: 1.6;
127
+ readonly letterSpacing: 1.1;
128
+ readonly showLineNumbers: false;
129
+ readonly lineNumberGap: 2;
130
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
131
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
132
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
133
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
134
+ }>, {
135
+ readonly append: {
136
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
137
+ };
138
+ readonly prepend: {
139
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
140
+ };
141
+ readonly insert: {
142
+ readonly position: import("@motionscript/sdk").Type<[number, number] | undefined, [number, number] | undefined, false>;
143
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
144
+ };
145
+ readonly remove: {
146
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
147
+ };
148
+ readonly replace: {
149
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
150
+ readonly replacement: import("@motionscript/sdk").Type<string, string, false>;
151
+ };
152
+ readonly highlight: {
153
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
154
+ readonly dim: import("@motionscript/sdk").Type<number, number, false>;
155
+ };
156
+ readonly resetHighlight: unknown;
157
+ readonly highlightRows: {
158
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
159
+ readonly color: import("@motionscript/sdk").Type<_Color, NormalizedColor, false>;
160
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
161
+ };
162
+ readonly resetRowHighlight: unknown;
163
+ }, _Node2D<_Node2DProps>>>>;
120
164
  /**
121
165
  * A syntax-highlighted listing whose edits animate token by token: each edit
122
166
  * is diffed against what is on screen, so a token that survives travels to
@@ -181,7 +225,51 @@ export declare const Code: import("@motionscript/sdk").Component<"code", import(
181
225
  readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
182
226
  readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
183
227
  readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
184
- }>, readonly []>>;
228
+ }>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
229
+ readonly code: import("@motionscript/sdk").Type<string, CodeSource, false>;
230
+ readonly language: "typescript";
231
+ readonly fontFamily: "Fira Mono";
232
+ /** A built-in or registered theme name (e.g. `'github-dark'`), or a `CodeHighlightStyle` object. */
233
+ readonly theme: import("@motionscript/sdk").Type<CodeTheme, CodeTheme, false>;
234
+ readonly fontSize: 16;
235
+ readonly lineHeight: 1.6;
236
+ readonly letterSpacing: 1.1;
237
+ readonly showLineNumbers: false;
238
+ readonly lineNumberGap: 2;
239
+ readonly listing: import("@motionscript/sdk").Type<CodeListing | null, CodeListing | null, true>;
240
+ readonly edit: import("@motionscript/sdk").Type<CodeEditFrame | null, CodeEditFrame | null, true>;
241
+ readonly focus: import("@motionscript/sdk").Type<CodeFocus, CodeFocus, true>;
242
+ readonly banding: import("@motionscript/sdk").Type<CodeBanding, CodeBanding, true>;
243
+ }>, {
244
+ readonly append: {
245
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
246
+ };
247
+ readonly prepend: {
248
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
249
+ };
250
+ readonly insert: {
251
+ readonly position: import("@motionscript/sdk").Type<[number, number] | undefined, [number, number] | undefined, false>;
252
+ readonly code: import("@motionscript/sdk").Type<string, string, false>;
253
+ };
254
+ readonly remove: {
255
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
256
+ };
257
+ readonly replace: {
258
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
259
+ readonly replacement: import("@motionscript/sdk").Type<string, string, false>;
260
+ };
261
+ readonly highlight: {
262
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
263
+ readonly dim: import("@motionscript/sdk").Type<number, number, false>;
264
+ };
265
+ readonly resetHighlight: unknown;
266
+ readonly highlightRows: {
267
+ readonly target: import("@motionscript/sdk").Type<CodeTarget | undefined, CodeTarget | undefined, false>;
268
+ readonly color: import("@motionscript/sdk").Type<_Color, NormalizedColor, false>;
269
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
270
+ };
271
+ readonly resetRowHighlight: unknown;
272
+ }, _Node2D<_Node2DProps>>>>;
185
273
  export type Code = NodeOf<typeof Code>;
186
274
  export type CodeProps = NonNullable<Parameters<typeof Code>[0]>;
187
275
  /** What a listing shows now: its source, its token rows, and the edit in flight, if any. */
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EASH,KAAK,MAAM,EACX,KAAK,eAAe,EAKpB,KAAK,KAAK,IAAI,MAAM,EACpB,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAkBH,KAAK,gBAAgB,EAGrB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC5B,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,sFAAsF;IACtF,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,kHAAkH;IAClH,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,2HAA2H;AAC3H,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,uFAAuF;AACvF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI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MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAEjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/code",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.7",
4
4
  "type": "module",
5
5
  "description": "Animated, syntax-highlighted code blocks for Motion Script, with token-level append, insert, remove, replace, and highlight transitions.",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  ],
46
46
  "license": "Apache-2.0",
47
47
  "peerDependencies": {
48
- "@motionscript/sdk": "^0.1.0-alpha.6"
48
+ "@motionscript/sdk": "^0.1.0-alpha.7"
49
49
  },
50
50
  "dependencies": {
51
51
  "@lezer/common": "^1.5.2",
@@ -73,8 +73,8 @@
73
73
  "typescript": "^6.0.3",
74
74
  "typescript-eslint": "^8.48.0",
75
75
  "vitest": "^4.1.5",
76
- "@motionscript/core": "0.1.0-alpha.6",
77
- "@motionscript/sdk": "0.1.0-alpha.6"
76
+ "@motionscript/core": "0.1.0-alpha.7",
77
+ "@motionscript/sdk": "0.1.0-alpha.7"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && node ../../../scripts/build-browser.mjs",