@woven-canvas/core 0.1.4 → 1.0.1
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/build/_tsup-dts-rollup.d.cts +55 -4
- package/build/_tsup-dts-rollup.d.ts +55 -4
- package/build/index.cjs +533 -277
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +6 -0
- package/build/index.d.ts +6 -0
- package/build/index.js +405 -155
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -132,6 +132,7 @@ declare const BlockDef: z.ZodObject<{
|
|
|
132
132
|
}>>;
|
|
133
133
|
canRotate: z.ZodDefault<z.ZodBoolean>;
|
|
134
134
|
canScale: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
selectable: z.ZodDefault<z.ZodBoolean>;
|
|
135
136
|
connectors: z.ZodDefault<z.ZodObject<{
|
|
136
137
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
137
138
|
terminals: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
@@ -215,6 +216,11 @@ declare function canBlockScale(ctx: Context, tag: string): boolean;
|
|
|
215
216
|
export { canBlockScale }
|
|
216
217
|
export { canBlockScale as canBlockScale_alias_1 }
|
|
217
218
|
|
|
219
|
+
declare function canBlockSelect(ctx: Context, tag: string): boolean;
|
|
220
|
+
export { canBlockSelect }
|
|
221
|
+
export { canBlockSelect as canBlockSelect_alias_1 }
|
|
222
|
+
export { canBlockSelect as canBlockSelect_alias_2 }
|
|
223
|
+
|
|
218
224
|
declare const canSeeBlocksSystem: EditorSystem;
|
|
219
225
|
export { canSeeBlocksSystem }
|
|
220
226
|
export { canSeeBlocksSystem as canSeeBlocksSystem_alias_1 }
|
|
@@ -336,6 +342,8 @@ declare const ControlsSchema: {
|
|
|
336
342
|
heldSnapshot: StringFieldBuilder;
|
|
337
343
|
};
|
|
338
344
|
|
|
345
|
+
export declare const CORE_PLUGIN_NAME = "core";
|
|
346
|
+
|
|
339
347
|
declare const CorePlugin: EditorPlugin;
|
|
340
348
|
export { CorePlugin }
|
|
341
349
|
export { CorePlugin as CorePlugin_alias_1 }
|
|
@@ -421,6 +429,11 @@ declare function detachScreenObserver(domElement: HTMLElement): void;
|
|
|
421
429
|
export { detachScreenObserver }
|
|
422
430
|
export { detachScreenObserver as detachScreenObserver_alias_1 }
|
|
423
431
|
|
|
432
|
+
declare function detectEmbedProvider(url: string): EmbedProvider;
|
|
433
|
+
export { detectEmbedProvider }
|
|
434
|
+
export { detectEmbedProvider as detectEmbedProvider_alias_1 }
|
|
435
|
+
export { detectEmbedProvider as detectEmbedProvider_alias_2 }
|
|
436
|
+
|
|
424
437
|
declare const Edited: CanvasComponentDef< {}, "edited">;
|
|
425
438
|
export { Edited }
|
|
426
439
|
export { Edited as Edited_alias_1 }
|
|
@@ -440,7 +453,7 @@ declare class Editor {
|
|
|
440
453
|
private userData;
|
|
441
454
|
private gridOptions;
|
|
442
455
|
private controlsOptions;
|
|
443
|
-
constructor(domElement: HTMLElement, optionsInput?: EditorOptionsInput);
|
|
456
|
+
constructor(domElement: HTMLElement | null, optionsInput?: EditorOptionsInput);
|
|
444
457
|
private get ctx();
|
|
445
458
|
initialize(): Promise<void>;
|
|
446
459
|
tick(): Promise<void>;
|
|
@@ -448,6 +461,8 @@ declare class Editor {
|
|
|
448
461
|
command<T>(def: CommandDef<T>, ...args: T extends void ? [] : [T]): void;
|
|
449
462
|
subscribe(query: QueryDef, callback: QueryCallback): () => void;
|
|
450
463
|
_getContext(): Context;
|
|
464
|
+
attachDom(domElement: HTMLElement): void;
|
|
465
|
+
detachDom(): void;
|
|
451
466
|
dispose(): void;
|
|
452
467
|
}
|
|
453
468
|
export { Editor }
|
|
@@ -501,6 +516,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
501
516
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
502
517
|
canRotate?: boolean | undefined;
|
|
503
518
|
canScale?: boolean | undefined;
|
|
519
|
+
selectable?: boolean | undefined;
|
|
504
520
|
connectors?: {
|
|
505
521
|
enabled?: boolean | undefined;
|
|
506
522
|
terminals?: [number, number][] | undefined;
|
|
@@ -516,6 +532,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
516
532
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
517
533
|
canRotate?: boolean | undefined;
|
|
518
534
|
canScale?: boolean | undefined;
|
|
535
|
+
selectable?: boolean | undefined;
|
|
519
536
|
connectors?: {
|
|
520
537
|
enabled?: boolean | undefined;
|
|
521
538
|
terminals?: [number, number][] | undefined;
|
|
@@ -605,7 +622,7 @@ export { EditorPluginInput }
|
|
|
605
622
|
export { EditorPluginInput as EditorPluginInput_alias_1 }
|
|
606
623
|
|
|
607
624
|
declare interface EditorResources {
|
|
608
|
-
domElement: HTMLElement;
|
|
625
|
+
domElement: HTMLElement | null;
|
|
609
626
|
editor: Editor;
|
|
610
627
|
userId: string;
|
|
611
628
|
sessionId: string;
|
|
@@ -653,6 +670,30 @@ declare interface EditorSystemOptions {
|
|
|
653
670
|
export { EditorSystemOptions }
|
|
654
671
|
export { EditorSystemOptions as EditorSystemOptions_alias_1 }
|
|
655
672
|
|
|
673
|
+
declare const Embed: CanvasComponentDef< {
|
|
674
|
+
url: StringFieldBuilder;
|
|
675
|
+
embedUrl: StringFieldBuilder;
|
|
676
|
+
provider: EnumFieldBuilder<EmbedProvider>;
|
|
677
|
+
}, "embed">;
|
|
678
|
+
export { Embed }
|
|
679
|
+
export { Embed as Embed_alias_1 }
|
|
680
|
+
export { Embed as Embed_alias_2 }
|
|
681
|
+
|
|
682
|
+
declare enum EmbedProvider {
|
|
683
|
+
GoogleMaps = "google-maps",
|
|
684
|
+
GoogleCalendar = "google-calendar",
|
|
685
|
+
GoogleSlides = "google-slides",
|
|
686
|
+
Tldraw = "tldraw",
|
|
687
|
+
Figma = "figma",
|
|
688
|
+
GithubGist = "github-gist",
|
|
689
|
+
Youtube = "youtube",
|
|
690
|
+
Spotify = "spotify",
|
|
691
|
+
Unknown = "unknown"
|
|
692
|
+
}
|
|
693
|
+
export { EmbedProvider }
|
|
694
|
+
export { EmbedProvider as EmbedProvider_alias_1 }
|
|
695
|
+
export { EmbedProvider as EmbedProvider_alias_2 }
|
|
696
|
+
|
|
656
697
|
export { EntityId }
|
|
657
698
|
export { EntityId as EntityId_alias_1 }
|
|
658
699
|
|
|
@@ -1113,6 +1154,7 @@ declare class MouseDef extends CanvasSingletonDef<typeof MouseSchema> {
|
|
|
1113
1154
|
didLeave(ctx: Context): boolean;
|
|
1114
1155
|
getPosition(ctx: Context): Vec2;
|
|
1115
1156
|
getWheelDelta(ctx: Context): Vec2;
|
|
1157
|
+
isObscured(ctx: Context): boolean;
|
|
1116
1158
|
}
|
|
1117
1159
|
|
|
1118
1160
|
declare interface MouseInput {
|
|
@@ -1140,6 +1182,7 @@ declare const MouseSchema: {
|
|
|
1140
1182
|
wheelTrigger: BooleanFieldBuilder;
|
|
1141
1183
|
enterTrigger: BooleanFieldBuilder;
|
|
1142
1184
|
leaveTrigger: BooleanFieldBuilder;
|
|
1185
|
+
obscured: BooleanFieldBuilder;
|
|
1143
1186
|
};
|
|
1144
1187
|
|
|
1145
1188
|
declare const mouseSystem: EditorSystem;
|
|
@@ -1161,8 +1204,6 @@ declare function parsePlugin(input: EditorPluginInput): EditorPlugin;
|
|
|
1161
1204
|
export { parsePlugin }
|
|
1162
1205
|
export { parsePlugin as parsePlugin_alias_1 }
|
|
1163
1206
|
|
|
1164
|
-
export declare const PLUGIN_NAME = "core";
|
|
1165
|
-
|
|
1166
1207
|
declare const Pointer: PointerDef;
|
|
1167
1208
|
export { Pointer }
|
|
1168
1209
|
export { Pointer as Pointer_alias_1 }
|
|
@@ -1316,6 +1357,11 @@ declare type ResizeMode = (typeof ResizeMode)[keyof typeof ResizeMode];
|
|
|
1316
1357
|
export { ResizeMode }
|
|
1317
1358
|
export { ResizeMode as ResizeMode_alias_1 }
|
|
1318
1359
|
|
|
1360
|
+
declare function resolveEmbedUrl(url: string, provider?: EmbedProvider): string;
|
|
1361
|
+
export { resolveEmbedUrl }
|
|
1362
|
+
export { resolveEmbedUrl as resolveEmbedUrl_alias_1 }
|
|
1363
|
+
export { resolveEmbedUrl as resolveEmbedUrl_alias_2 }
|
|
1364
|
+
|
|
1319
1365
|
declare function runMachine<TState extends string, TContext extends object>(machine: AnyStateMachine, currentState: TState, context: TContext, events: Array<{
|
|
1320
1366
|
type: string;
|
|
1321
1367
|
[key: string]: unknown;
|
|
@@ -1508,6 +1554,11 @@ declare type UserDataInput = z.input<typeof UserData>;
|
|
|
1508
1554
|
export { UserDataInput }
|
|
1509
1555
|
export { UserDataInput as UserDataInput_alias_1 }
|
|
1510
1556
|
|
|
1557
|
+
declare function validateEmbedUrl(url: string, provider: EmbedProvider): string | null;
|
|
1558
|
+
export { validateEmbedUrl }
|
|
1559
|
+
export { validateEmbedUrl as validateEmbedUrl_alias_1 }
|
|
1560
|
+
export { validateEmbedUrl as validateEmbedUrl_alias_2 }
|
|
1561
|
+
|
|
1511
1562
|
export { Vec2 }
|
|
1512
1563
|
|
|
1513
1564
|
declare const VerticalAlign: CanvasComponentDef< {
|
|
@@ -132,6 +132,7 @@ declare const BlockDef: z.ZodObject<{
|
|
|
132
132
|
}>>;
|
|
133
133
|
canRotate: z.ZodDefault<z.ZodBoolean>;
|
|
134
134
|
canScale: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
selectable: z.ZodDefault<z.ZodBoolean>;
|
|
135
136
|
connectors: z.ZodDefault<z.ZodObject<{
|
|
136
137
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
137
138
|
terminals: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
@@ -215,6 +216,11 @@ declare function canBlockScale(ctx: Context, tag: string): boolean;
|
|
|
215
216
|
export { canBlockScale }
|
|
216
217
|
export { canBlockScale as canBlockScale_alias_1 }
|
|
217
218
|
|
|
219
|
+
declare function canBlockSelect(ctx: Context, tag: string): boolean;
|
|
220
|
+
export { canBlockSelect }
|
|
221
|
+
export { canBlockSelect as canBlockSelect_alias_1 }
|
|
222
|
+
export { canBlockSelect as canBlockSelect_alias_2 }
|
|
223
|
+
|
|
218
224
|
declare const canSeeBlocksSystem: EditorSystem;
|
|
219
225
|
export { canSeeBlocksSystem }
|
|
220
226
|
export { canSeeBlocksSystem as canSeeBlocksSystem_alias_1 }
|
|
@@ -336,6 +342,8 @@ declare const ControlsSchema: {
|
|
|
336
342
|
heldSnapshot: StringFieldBuilder;
|
|
337
343
|
};
|
|
338
344
|
|
|
345
|
+
export declare const CORE_PLUGIN_NAME = "core";
|
|
346
|
+
|
|
339
347
|
declare const CorePlugin: EditorPlugin;
|
|
340
348
|
export { CorePlugin }
|
|
341
349
|
export { CorePlugin as CorePlugin_alias_1 }
|
|
@@ -421,6 +429,11 @@ declare function detachScreenObserver(domElement: HTMLElement): void;
|
|
|
421
429
|
export { detachScreenObserver }
|
|
422
430
|
export { detachScreenObserver as detachScreenObserver_alias_1 }
|
|
423
431
|
|
|
432
|
+
declare function detectEmbedProvider(url: string): EmbedProvider;
|
|
433
|
+
export { detectEmbedProvider }
|
|
434
|
+
export { detectEmbedProvider as detectEmbedProvider_alias_1 }
|
|
435
|
+
export { detectEmbedProvider as detectEmbedProvider_alias_2 }
|
|
436
|
+
|
|
424
437
|
declare const Edited: CanvasComponentDef< {}, "edited">;
|
|
425
438
|
export { Edited }
|
|
426
439
|
export { Edited as Edited_alias_1 }
|
|
@@ -440,7 +453,7 @@ declare class Editor {
|
|
|
440
453
|
private userData;
|
|
441
454
|
private gridOptions;
|
|
442
455
|
private controlsOptions;
|
|
443
|
-
constructor(domElement: HTMLElement, optionsInput?: EditorOptionsInput);
|
|
456
|
+
constructor(domElement: HTMLElement | null, optionsInput?: EditorOptionsInput);
|
|
444
457
|
private get ctx();
|
|
445
458
|
initialize(): Promise<void>;
|
|
446
459
|
tick(): Promise<void>;
|
|
@@ -448,6 +461,8 @@ declare class Editor {
|
|
|
448
461
|
command<T>(def: CommandDef<T>, ...args: T extends void ? [] : [T]): void;
|
|
449
462
|
subscribe(query: QueryDef, callback: QueryCallback): () => void;
|
|
450
463
|
_getContext(): Context;
|
|
464
|
+
attachDom(domElement: HTMLElement): void;
|
|
465
|
+
detachDom(): void;
|
|
451
466
|
dispose(): void;
|
|
452
467
|
}
|
|
453
468
|
export { Editor }
|
|
@@ -501,6 +516,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
501
516
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
502
517
|
canRotate?: boolean | undefined;
|
|
503
518
|
canScale?: boolean | undefined;
|
|
519
|
+
selectable?: boolean | undefined;
|
|
504
520
|
connectors?: {
|
|
505
521
|
enabled?: boolean | undefined;
|
|
506
522
|
terminals?: [number, number][] | undefined;
|
|
@@ -516,6 +532,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
516
532
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
517
533
|
canRotate?: boolean | undefined;
|
|
518
534
|
canScale?: boolean | undefined;
|
|
535
|
+
selectable?: boolean | undefined;
|
|
519
536
|
connectors?: {
|
|
520
537
|
enabled?: boolean | undefined;
|
|
521
538
|
terminals?: [number, number][] | undefined;
|
|
@@ -605,7 +622,7 @@ export { EditorPluginInput }
|
|
|
605
622
|
export { EditorPluginInput as EditorPluginInput_alias_1 }
|
|
606
623
|
|
|
607
624
|
declare interface EditorResources {
|
|
608
|
-
domElement: HTMLElement;
|
|
625
|
+
domElement: HTMLElement | null;
|
|
609
626
|
editor: Editor;
|
|
610
627
|
userId: string;
|
|
611
628
|
sessionId: string;
|
|
@@ -653,6 +670,30 @@ declare interface EditorSystemOptions {
|
|
|
653
670
|
export { EditorSystemOptions }
|
|
654
671
|
export { EditorSystemOptions as EditorSystemOptions_alias_1 }
|
|
655
672
|
|
|
673
|
+
declare const Embed: CanvasComponentDef< {
|
|
674
|
+
url: StringFieldBuilder;
|
|
675
|
+
embedUrl: StringFieldBuilder;
|
|
676
|
+
provider: EnumFieldBuilder<EmbedProvider>;
|
|
677
|
+
}, "embed">;
|
|
678
|
+
export { Embed }
|
|
679
|
+
export { Embed as Embed_alias_1 }
|
|
680
|
+
export { Embed as Embed_alias_2 }
|
|
681
|
+
|
|
682
|
+
declare enum EmbedProvider {
|
|
683
|
+
GoogleMaps = "google-maps",
|
|
684
|
+
GoogleCalendar = "google-calendar",
|
|
685
|
+
GoogleSlides = "google-slides",
|
|
686
|
+
Tldraw = "tldraw",
|
|
687
|
+
Figma = "figma",
|
|
688
|
+
GithubGist = "github-gist",
|
|
689
|
+
Youtube = "youtube",
|
|
690
|
+
Spotify = "spotify",
|
|
691
|
+
Unknown = "unknown"
|
|
692
|
+
}
|
|
693
|
+
export { EmbedProvider }
|
|
694
|
+
export { EmbedProvider as EmbedProvider_alias_1 }
|
|
695
|
+
export { EmbedProvider as EmbedProvider_alias_2 }
|
|
696
|
+
|
|
656
697
|
export { EntityId }
|
|
657
698
|
export { EntityId as EntityId_alias_1 }
|
|
658
699
|
|
|
@@ -1113,6 +1154,7 @@ declare class MouseDef extends CanvasSingletonDef<typeof MouseSchema> {
|
|
|
1113
1154
|
didLeave(ctx: Context): boolean;
|
|
1114
1155
|
getPosition(ctx: Context): Vec2;
|
|
1115
1156
|
getWheelDelta(ctx: Context): Vec2;
|
|
1157
|
+
isObscured(ctx: Context): boolean;
|
|
1116
1158
|
}
|
|
1117
1159
|
|
|
1118
1160
|
declare interface MouseInput {
|
|
@@ -1140,6 +1182,7 @@ declare const MouseSchema: {
|
|
|
1140
1182
|
wheelTrigger: BooleanFieldBuilder;
|
|
1141
1183
|
enterTrigger: BooleanFieldBuilder;
|
|
1142
1184
|
leaveTrigger: BooleanFieldBuilder;
|
|
1185
|
+
obscured: BooleanFieldBuilder;
|
|
1143
1186
|
};
|
|
1144
1187
|
|
|
1145
1188
|
declare const mouseSystem: EditorSystem;
|
|
@@ -1161,8 +1204,6 @@ declare function parsePlugin(input: EditorPluginInput): EditorPlugin;
|
|
|
1161
1204
|
export { parsePlugin }
|
|
1162
1205
|
export { parsePlugin as parsePlugin_alias_1 }
|
|
1163
1206
|
|
|
1164
|
-
export declare const PLUGIN_NAME = "core";
|
|
1165
|
-
|
|
1166
1207
|
declare const Pointer: PointerDef;
|
|
1167
1208
|
export { Pointer }
|
|
1168
1209
|
export { Pointer as Pointer_alias_1 }
|
|
@@ -1316,6 +1357,11 @@ declare type ResizeMode = (typeof ResizeMode)[keyof typeof ResizeMode];
|
|
|
1316
1357
|
export { ResizeMode }
|
|
1317
1358
|
export { ResizeMode as ResizeMode_alias_1 }
|
|
1318
1359
|
|
|
1360
|
+
declare function resolveEmbedUrl(url: string, provider?: EmbedProvider): string;
|
|
1361
|
+
export { resolveEmbedUrl }
|
|
1362
|
+
export { resolveEmbedUrl as resolveEmbedUrl_alias_1 }
|
|
1363
|
+
export { resolveEmbedUrl as resolveEmbedUrl_alias_2 }
|
|
1364
|
+
|
|
1319
1365
|
declare function runMachine<TState extends string, TContext extends object>(machine: AnyStateMachine, currentState: TState, context: TContext, events: Array<{
|
|
1320
1366
|
type: string;
|
|
1321
1367
|
[key: string]: unknown;
|
|
@@ -1508,6 +1554,11 @@ declare type UserDataInput = z.input<typeof UserData>;
|
|
|
1508
1554
|
export { UserDataInput }
|
|
1509
1555
|
export { UserDataInput as UserDataInput_alias_1 }
|
|
1510
1556
|
|
|
1557
|
+
declare function validateEmbedUrl(url: string, provider: EmbedProvider): string | null;
|
|
1558
|
+
export { validateEmbedUrl }
|
|
1559
|
+
export { validateEmbedUrl as validateEmbedUrl_alias_1 }
|
|
1560
|
+
export { validateEmbedUrl as validateEmbedUrl_alias_2 }
|
|
1561
|
+
|
|
1511
1562
|
export { Vec2 }
|
|
1512
1563
|
|
|
1513
1564
|
declare const VerticalAlign: CanvasComponentDef< {
|