@woven-canvas/core 1.0.0 → 1.0.2
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 +51 -10
- package/build/_tsup-dts-rollup.d.ts +51 -10
- package/build/index.cjs +535 -286
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +6 -1
- package/build/index.d.ts +6 -1
- package/build/index.js +400 -156
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -132,7 +132,7 @@ declare const BlockDef: z.ZodObject<{
|
|
|
132
132
|
}>>;
|
|
133
133
|
canRotate: z.ZodDefault<z.ZodBoolean>;
|
|
134
134
|
canScale: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
-
|
|
135
|
+
interactable: z.ZodDefault<z.ZodBoolean>;
|
|
136
136
|
connectors: z.ZodDefault<z.ZodObject<{
|
|
137
137
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
138
138
|
terminals: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
@@ -208,6 +208,11 @@ export { canBlockEdit }
|
|
|
208
208
|
export { canBlockEdit as canBlockEdit_alias_1 }
|
|
209
209
|
export { canBlockEdit as canBlockEdit_alias_2 }
|
|
210
210
|
|
|
211
|
+
declare function canBlockInteract(ctx: Context, tag: string): boolean;
|
|
212
|
+
export { canBlockInteract }
|
|
213
|
+
export { canBlockInteract as canBlockInteract_alias_1 }
|
|
214
|
+
export { canBlockInteract as canBlockInteract_alias_2 }
|
|
215
|
+
|
|
211
216
|
declare function canBlockRotate(ctx: Context, tag: string): boolean;
|
|
212
217
|
export { canBlockRotate }
|
|
213
218
|
export { canBlockRotate as canBlockRotate_alias_1 }
|
|
@@ -216,11 +221,6 @@ declare function canBlockScale(ctx: Context, tag: string): boolean;
|
|
|
216
221
|
export { canBlockScale }
|
|
217
222
|
export { canBlockScale as canBlockScale_alias_1 }
|
|
218
223
|
|
|
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
|
-
|
|
224
224
|
declare const canSeeBlocksSystem: EditorSystem;
|
|
225
225
|
export { canSeeBlocksSystem }
|
|
226
226
|
export { canSeeBlocksSystem as canSeeBlocksSystem_alias_1 }
|
|
@@ -429,6 +429,11 @@ declare function detachScreenObserver(domElement: HTMLElement): void;
|
|
|
429
429
|
export { detachScreenObserver }
|
|
430
430
|
export { detachScreenObserver as detachScreenObserver_alias_1 }
|
|
431
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
|
+
|
|
432
437
|
declare const Edited: CanvasComponentDef< {}, "edited">;
|
|
433
438
|
export { Edited }
|
|
434
439
|
export { Edited as Edited_alias_1 }
|
|
@@ -448,7 +453,7 @@ declare class Editor {
|
|
|
448
453
|
private userData;
|
|
449
454
|
private gridOptions;
|
|
450
455
|
private controlsOptions;
|
|
451
|
-
constructor(domElement: HTMLElement, optionsInput?: EditorOptionsInput);
|
|
456
|
+
constructor(domElement: HTMLElement | null, optionsInput?: EditorOptionsInput);
|
|
452
457
|
private get ctx();
|
|
453
458
|
initialize(): Promise<void>;
|
|
454
459
|
tick(): Promise<void>;
|
|
@@ -456,6 +461,8 @@ declare class Editor {
|
|
|
456
461
|
command<T>(def: CommandDef<T>, ...args: T extends void ? [] : [T]): void;
|
|
457
462
|
subscribe(query: QueryDef, callback: QueryCallback): () => void;
|
|
458
463
|
_getContext(): Context;
|
|
464
|
+
attachDom(domElement: HTMLElement): void;
|
|
465
|
+
detachDom(): void;
|
|
459
466
|
dispose(): void;
|
|
460
467
|
}
|
|
461
468
|
export { Editor }
|
|
@@ -509,7 +516,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
509
516
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
510
517
|
canRotate?: boolean | undefined;
|
|
511
518
|
canScale?: boolean | undefined;
|
|
512
|
-
|
|
519
|
+
interactable?: boolean | undefined;
|
|
513
520
|
connectors?: {
|
|
514
521
|
enabled?: boolean | undefined;
|
|
515
522
|
terminals?: [number, number][] | undefined;
|
|
@@ -525,7 +532,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
525
532
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
526
533
|
canRotate?: boolean | undefined;
|
|
527
534
|
canScale?: boolean | undefined;
|
|
528
|
-
|
|
535
|
+
interactable?: boolean | undefined;
|
|
529
536
|
connectors?: {
|
|
530
537
|
enabled?: boolean | undefined;
|
|
531
538
|
terminals?: [number, number][] | undefined;
|
|
@@ -615,7 +622,7 @@ export { EditorPluginInput }
|
|
|
615
622
|
export { EditorPluginInput as EditorPluginInput_alias_1 }
|
|
616
623
|
|
|
617
624
|
declare interface EditorResources {
|
|
618
|
-
domElement: HTMLElement;
|
|
625
|
+
domElement: HTMLElement | null;
|
|
619
626
|
editor: Editor;
|
|
620
627
|
userId: string;
|
|
621
628
|
sessionId: string;
|
|
@@ -663,6 +670,30 @@ declare interface EditorSystemOptions {
|
|
|
663
670
|
export { EditorSystemOptions }
|
|
664
671
|
export { EditorSystemOptions as EditorSystemOptions_alias_1 }
|
|
665
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
|
+
|
|
666
697
|
export { EntityId }
|
|
667
698
|
export { EntityId as EntityId_alias_1 }
|
|
668
699
|
|
|
@@ -1326,6 +1357,11 @@ declare type ResizeMode = (typeof ResizeMode)[keyof typeof ResizeMode];
|
|
|
1326
1357
|
export { ResizeMode }
|
|
1327
1358
|
export { ResizeMode as ResizeMode_alias_1 }
|
|
1328
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
|
+
|
|
1329
1365
|
declare function runMachine<TState extends string, TContext extends object>(machine: AnyStateMachine, currentState: TState, context: TContext, events: Array<{
|
|
1330
1366
|
type: string;
|
|
1331
1367
|
[key: string]: unknown;
|
|
@@ -1518,6 +1554,11 @@ declare type UserDataInput = z.input<typeof UserData>;
|
|
|
1518
1554
|
export { UserDataInput }
|
|
1519
1555
|
export { UserDataInput as UserDataInput_alias_1 }
|
|
1520
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
|
+
|
|
1521
1562
|
export { Vec2 }
|
|
1522
1563
|
|
|
1523
1564
|
declare const VerticalAlign: CanvasComponentDef< {
|
|
@@ -132,7 +132,7 @@ declare const BlockDef: z.ZodObject<{
|
|
|
132
132
|
}>>;
|
|
133
133
|
canRotate: z.ZodDefault<z.ZodBoolean>;
|
|
134
134
|
canScale: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
-
|
|
135
|
+
interactable: z.ZodDefault<z.ZodBoolean>;
|
|
136
136
|
connectors: z.ZodDefault<z.ZodObject<{
|
|
137
137
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
138
138
|
terminals: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
@@ -208,6 +208,11 @@ export { canBlockEdit }
|
|
|
208
208
|
export { canBlockEdit as canBlockEdit_alias_1 }
|
|
209
209
|
export { canBlockEdit as canBlockEdit_alias_2 }
|
|
210
210
|
|
|
211
|
+
declare function canBlockInteract(ctx: Context, tag: string): boolean;
|
|
212
|
+
export { canBlockInteract }
|
|
213
|
+
export { canBlockInteract as canBlockInteract_alias_1 }
|
|
214
|
+
export { canBlockInteract as canBlockInteract_alias_2 }
|
|
215
|
+
|
|
211
216
|
declare function canBlockRotate(ctx: Context, tag: string): boolean;
|
|
212
217
|
export { canBlockRotate }
|
|
213
218
|
export { canBlockRotate as canBlockRotate_alias_1 }
|
|
@@ -216,11 +221,6 @@ declare function canBlockScale(ctx: Context, tag: string): boolean;
|
|
|
216
221
|
export { canBlockScale }
|
|
217
222
|
export { canBlockScale as canBlockScale_alias_1 }
|
|
218
223
|
|
|
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
|
-
|
|
224
224
|
declare const canSeeBlocksSystem: EditorSystem;
|
|
225
225
|
export { canSeeBlocksSystem }
|
|
226
226
|
export { canSeeBlocksSystem as canSeeBlocksSystem_alias_1 }
|
|
@@ -429,6 +429,11 @@ declare function detachScreenObserver(domElement: HTMLElement): void;
|
|
|
429
429
|
export { detachScreenObserver }
|
|
430
430
|
export { detachScreenObserver as detachScreenObserver_alias_1 }
|
|
431
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
|
+
|
|
432
437
|
declare const Edited: CanvasComponentDef< {}, "edited">;
|
|
433
438
|
export { Edited }
|
|
434
439
|
export { Edited as Edited_alias_1 }
|
|
@@ -448,7 +453,7 @@ declare class Editor {
|
|
|
448
453
|
private userData;
|
|
449
454
|
private gridOptions;
|
|
450
455
|
private controlsOptions;
|
|
451
|
-
constructor(domElement: HTMLElement, optionsInput?: EditorOptionsInput);
|
|
456
|
+
constructor(domElement: HTMLElement | null, optionsInput?: EditorOptionsInput);
|
|
452
457
|
private get ctx();
|
|
453
458
|
initialize(): Promise<void>;
|
|
454
459
|
tick(): Promise<void>;
|
|
@@ -456,6 +461,8 @@ declare class Editor {
|
|
|
456
461
|
command<T>(def: CommandDef<T>, ...args: T extends void ? [] : [T]): void;
|
|
457
462
|
subscribe(query: QueryDef, callback: QueryCallback): () => void;
|
|
458
463
|
_getContext(): Context;
|
|
464
|
+
attachDom(domElement: HTMLElement): void;
|
|
465
|
+
detachDom(): void;
|
|
459
466
|
dispose(): void;
|
|
460
467
|
}
|
|
461
468
|
export { Editor }
|
|
@@ -509,7 +516,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
509
516
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
510
517
|
canRotate?: boolean | undefined;
|
|
511
518
|
canScale?: boolean | undefined;
|
|
512
|
-
|
|
519
|
+
interactable?: boolean | undefined;
|
|
513
520
|
connectors?: {
|
|
514
521
|
enabled?: boolean | undefined;
|
|
515
522
|
terminals?: [number, number][] | undefined;
|
|
@@ -525,7 +532,7 @@ export declare const EditorOptionsSchema: z.ZodObject<{
|
|
|
525
532
|
resizeMode?: "scale" | "text" | "free" | "groupOnly" | undefined;
|
|
526
533
|
canRotate?: boolean | undefined;
|
|
527
534
|
canScale?: boolean | undefined;
|
|
528
|
-
|
|
535
|
+
interactable?: boolean | undefined;
|
|
529
536
|
connectors?: {
|
|
530
537
|
enabled?: boolean | undefined;
|
|
531
538
|
terminals?: [number, number][] | undefined;
|
|
@@ -615,7 +622,7 @@ export { EditorPluginInput }
|
|
|
615
622
|
export { EditorPluginInput as EditorPluginInput_alias_1 }
|
|
616
623
|
|
|
617
624
|
declare interface EditorResources {
|
|
618
|
-
domElement: HTMLElement;
|
|
625
|
+
domElement: HTMLElement | null;
|
|
619
626
|
editor: Editor;
|
|
620
627
|
userId: string;
|
|
621
628
|
sessionId: string;
|
|
@@ -663,6 +670,30 @@ declare interface EditorSystemOptions {
|
|
|
663
670
|
export { EditorSystemOptions }
|
|
664
671
|
export { EditorSystemOptions as EditorSystemOptions_alias_1 }
|
|
665
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
|
+
|
|
666
697
|
export { EntityId }
|
|
667
698
|
export { EntityId as EntityId_alias_1 }
|
|
668
699
|
|
|
@@ -1326,6 +1357,11 @@ declare type ResizeMode = (typeof ResizeMode)[keyof typeof ResizeMode];
|
|
|
1326
1357
|
export { ResizeMode }
|
|
1327
1358
|
export { ResizeMode as ResizeMode_alias_1 }
|
|
1328
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
|
+
|
|
1329
1365
|
declare function runMachine<TState extends string, TContext extends object>(machine: AnyStateMachine, currentState: TState, context: TContext, events: Array<{
|
|
1330
1366
|
type: string;
|
|
1331
1367
|
[key: string]: unknown;
|
|
@@ -1518,6 +1554,11 @@ declare type UserDataInput = z.input<typeof UserData>;
|
|
|
1518
1554
|
export { UserDataInput }
|
|
1519
1555
|
export { UserDataInput as UserDataInput_alias_1 }
|
|
1520
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
|
+
|
|
1521
1562
|
export { Vec2 }
|
|
1522
1563
|
|
|
1523
1564
|
declare const VerticalAlign: CanvasComponentDef< {
|