@01.software/sdk 0.19.0 → 0.21.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.
@@ -99,6 +99,7 @@ interface Config {
99
99
  'community-bans': CommunityBan;
100
100
  'event-calendars': EventCalendar;
101
101
  events: Event;
102
+ 'event-categories': EventCategory;
102
103
  'event-tags': EventTag;
103
104
  'event-occurrences': EventOccurrence;
104
105
  'event-registrations': EventRegistration;
@@ -245,6 +246,7 @@ interface Config {
245
246
  'community-bans': CommunityBansSelect<false> | CommunityBansSelect<true>;
246
247
  'event-calendars': EventCalendarsSelect<false> | EventCalendarsSelect<true>;
247
248
  events: EventsSelect<false> | EventsSelect<true>;
249
+ 'event-categories': EventCategoriesSelect<false> | EventCategoriesSelect<true>;
248
250
  'event-tags': EventTagsSelect<false> | EventTagsSelect<true>;
249
251
  'event-occurrences': EventOccurrencesSelect<false> | EventOccurrencesSelect<true>;
250
252
  'event-registrations': EventRegistrationsSelect<false> | EventRegistrationsSelect<true>;
@@ -420,17 +422,10 @@ interface Tenant {
420
422
  */
421
423
  owner: string | User;
422
424
  /**
423
- * Features available to this tenant. Determined automatically by the plan.
425
+ * Only features checked above will be enabled for this tenant.
424
426
  */
425
- features?: {
426
- feature: 'ecommerce' | 'customers' | 'playlists' | 'galleries' | 'links' | 'forms' | 'articles' | 'documents' | 'canvas' | 'videos' | 'live-streaming' | 'community' | 'events';
427
- provenance: string;
428
- id?: string | null;
429
- }[] | null;
430
- /**
431
- * Features this tenant has opted out of. Only effective for features granted by the plan.
432
- */
433
- disabledFeatures?: ('ecommerce' | 'customers' | 'playlists' | 'galleries' | 'links' | 'forms' | 'articles' | 'documents' | 'canvas' | 'videos' | 'live-streaming' | 'community' | 'events')[] | null;
427
+ enabledFeatures?: ('ecommerce' | 'customers' | 'playlists' | 'galleries' | 'links' | 'forms' | 'articles' | 'documents' | 'canvas' | 'videos' | 'live-streaming' | 'community' | 'events')[] | null;
428
+ featureVersion?: number | null;
434
429
  /**
435
430
  * Dev mode shows configuration tools like the field settings panel. Turn off after setup for a clean production UI.
436
431
  */
@@ -585,7 +580,7 @@ interface Image {
585
580
  interface FieldConfig {
586
581
  id: string;
587
582
  tenant?: (string | null) | Tenant;
588
- collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'event-calendars' | 'events' | 'event-tags' | 'event-occurrences' | 'event-registrations';
583
+ collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
589
584
  isHidden?: boolean | null;
590
585
  hiddenFields?: {
591
586
  [k: string]: unknown;
@@ -1280,7 +1275,7 @@ interface TenantEntitlement {
1280
1275
  * Lifecycle status for the entitlement. Only active rows participate in current plan resolution.
1281
1276
  */
1282
1277
  status: 'active' | 'scheduled' | 'expired' | 'revoked';
1283
- sourceType: 'subscription' | 'manual' | 'support' | 'promo' | 'trial' | 'legacy_migration' | 'enterprise_contract';
1278
+ sourceType: 'subscription' | 'manual' | 'support' | 'promo' | 'trial' | 'enterprise_contract';
1284
1279
  sourceSubscription?: (string | null) | Subscription;
1285
1280
  /**
1286
1281
  * Tie-breaker for overlapping entitlements. Higher values win within the same source precedence.
@@ -1288,7 +1283,7 @@ interface TenantEntitlement {
1288
1283
  priority: number;
1289
1284
  startsAt: string;
1290
1285
  /**
1291
- * Entitlement end date. Required by hook validation for promo / trial / legacy_migration sources and excluded from current plan resolution after expiry.
1286
+ * Entitlement end date. Required by hook validation for promo / trial sources and excluded from current plan resolution after expiry.
1292
1287
  */
1293
1288
  endsAt?: string | null;
1294
1289
  reason?: string | null;
@@ -1612,6 +1607,9 @@ interface Product {
1612
1607
  * Product weight (g)
1613
1608
  */
1614
1609
  weight?: number | null;
1610
+ /**
1611
+ * Product collections that include this product. Managed from the collection edit view.
1612
+ */
1615
1613
  collections?: {
1616
1614
  docs?: (string | ProductCollection)[];
1617
1615
  hasNextPage?: boolean;
@@ -1696,6 +1694,7 @@ interface Product {
1696
1694
  updatedAt: string;
1697
1695
  createdAt: string;
1698
1696
  deletedAt?: string | null;
1697
+ _status?: ('draft' | 'published') | null;
1699
1698
  }
1700
1699
  /**
1701
1700
  * This interface was referenced by `Config`'s JSON-Schema
@@ -1728,6 +1727,9 @@ interface Video {
1728
1727
  sourceLiveStream?: (string | null) | LiveStream;
1729
1728
  categories?: (string | VideoCategory)[] | null;
1730
1729
  tags?: (string | VideoTag)[] | null;
1730
+ /**
1731
+ * Mux processing status. Updated by upload/encoding jobs and not edited directly.
1732
+ */
1731
1733
  muxStatus?: ('waiting' | 'preparing' | 'ready' | 'errored') | null;
1732
1734
  durationSeconds?: number | null;
1733
1735
  muxAspectRatio?: string | null;
@@ -1818,6 +1820,9 @@ interface LiveStream {
1818
1820
  * Reconnect window (seconds)
1819
1821
  */
1820
1822
  reconnectWindowSeconds?: number | null;
1823
+ /**
1824
+ * Mux live stream status. Updated by stream create/disable jobs and not edited directly.
1825
+ */
1821
1826
  muxStatus?: ('idle' | 'active' | 'disabled') | null;
1822
1827
  muxLiveStreamId?: string | null;
1823
1828
  muxPlaybackId?: string | null;
@@ -2181,6 +2186,7 @@ interface Brand {
2181
2186
  updatedAt: string;
2182
2187
  createdAt: string;
2183
2188
  deletedAt?: string | null;
2189
+ _status?: ('draft' | 'published') | null;
2184
2190
  }
2185
2191
  /**
2186
2192
  * This interface was referenced by `Config`'s JSON-Schema
@@ -2310,6 +2316,7 @@ interface ProductCollection {
2310
2316
  updatedAt: string;
2311
2317
  createdAt: string;
2312
2318
  deletedAt?: string | null;
2319
+ _status?: ('draft' | 'published') | null;
2313
2320
  }
2314
2321
  /**
2315
2322
  * This interface was referenced by `Config`'s JSON-Schema
@@ -2606,7 +2613,7 @@ interface CustomerAddress {
2606
2613
  */
2607
2614
  address2?: string | null;
2608
2615
  /**
2609
- * Jibun (legacy lot-based) address. Stored alongside the road-name `address1` so we can fall back when 도로명 is missing or for delivery providers that require 지번.
2616
+ * Jibun lot-based address. Stored alongside the road-name `address1` so we can fall back when 도로명 is missing or for delivery providers that require 지번.
2610
2617
  */
2611
2618
  jibunAddress?: string | null;
2612
2619
  /**
@@ -2913,7 +2920,6 @@ interface OrderStatusLog {
2913
2920
  } | unknown[] | string | number | boolean | null;
2914
2921
  updatedAt: string;
2915
2922
  createdAt: string;
2916
- deletedAt?: string | null;
2917
2923
  }
2918
2924
  /**
2919
2925
  * This interface was referenced by `Config`'s JSON-Schema
@@ -3235,6 +3241,9 @@ interface ArticleAuthor {
3235
3241
  avatar?: (string | null) | Image;
3236
3242
  bio?: string | null;
3237
3243
  email?: string | null;
3244
+ /**
3245
+ * Articles linked to this author. Managed from the authors relationship on each article.
3246
+ */
3238
3247
  articles?: {
3239
3248
  docs?: (string | Article)[];
3240
3249
  hasNextPage?: boolean;
@@ -3479,6 +3488,9 @@ interface Playlist {
3479
3488
  videos?: (string | Video)[] | null;
3480
3489
  categories?: (string | PlaylistCategory)[] | null;
3481
3490
  tags?: (string | PlaylistTag)[] | null;
3491
+ /**
3492
+ * Tracks included in this playlist. Drag to adjust playback order.
3493
+ */
3482
3494
  tracks?: (string | Track)[] | null;
3483
3495
  seo?: {
3484
3496
  /**
@@ -3529,6 +3541,7 @@ interface Playlist {
3529
3541
  updatedAt: string;
3530
3542
  createdAt: string;
3531
3543
  deletedAt?: string | null;
3544
+ _status?: ('draft' | 'published') | null;
3532
3545
  }
3533
3546
  /**
3534
3547
  * This interface was referenced by `Config`'s JSON-Schema
@@ -3646,6 +3659,7 @@ interface Track {
3646
3659
  updatedAt: string;
3647
3660
  createdAt: string;
3648
3661
  deletedAt?: string | null;
3662
+ _status?: ('draft' | 'published') | null;
3649
3663
  }
3650
3664
  /**
3651
3665
  * This interface was referenced by `Config`'s JSON-Schema
@@ -3738,6 +3752,9 @@ interface Gallery {
3738
3752
  videos?: (string | Video)[] | null;
3739
3753
  categories?: (string | GalleryCategory)[] | null;
3740
3754
  tags?: (string | GalleryTag)[] | null;
3755
+ /**
3756
+ * Image items shown in this gallery. Their order controls gallery display order.
3757
+ */
3741
3758
  items?: {
3742
3759
  docs?: (string | GalleryItem)[];
3743
3760
  hasNextPage?: boolean;
@@ -3791,6 +3808,7 @@ interface Gallery {
3791
3808
  updatedAt: string;
3792
3809
  createdAt: string;
3793
3810
  deletedAt?: string | null;
3811
+ _status?: ('draft' | 'published') | null;
3794
3812
  }
3795
3813
  /**
3796
3814
  * This interface was referenced by `Config`'s JSON-Schema
@@ -3879,6 +3897,7 @@ interface GalleryItem {
3879
3897
  updatedAt: string;
3880
3898
  createdAt: string;
3881
3899
  deletedAt?: string | null;
3900
+ _status?: ('draft' | 'published') | null;
3882
3901
  }
3883
3902
  /**
3884
3903
  * This interface was referenced by `Config`'s JSON-Schema
@@ -3937,6 +3956,7 @@ interface Link {
3937
3956
  updatedAt: string;
3938
3957
  createdAt: string;
3939
3958
  deletedAt?: string | null;
3959
+ _status?: ('draft' | 'published') | null;
3940
3960
  }
3941
3961
  /**
3942
3962
  * This interface was referenced by `Config`'s JSON-Schema
@@ -4300,6 +4320,9 @@ interface Post {
4300
4320
  [k: string]: unknown;
4301
4321
  } | null;
4302
4322
  categories?: (string | PostCategory)[] | null;
4323
+ /**
4324
+ * Comments on this post. Author and status are managed in the comments collection.
4325
+ */
4303
4326
  comments?: {
4304
4327
  docs?: (string | Comment)[];
4305
4328
  hasNextPage?: boolean;
@@ -4403,6 +4426,7 @@ interface Comment {
4403
4426
  avatar?: (string | null) | Image;
4404
4427
  avatarUrl?: string | null;
4405
4428
  };
4429
+ displayLabel?: string | null;
4406
4430
  body?: string | null;
4407
4431
  parent?: (string | null) | Comment;
4408
4432
  /**
@@ -4579,15 +4603,6 @@ interface EventCalendar {
4579
4603
  showPastOccurrences?: boolean | null;
4580
4604
  defaultRangeMonths?: number | null;
4581
4605
  };
4582
- defaultLocation?: {
4583
- name?: string | null;
4584
- address?: string | null;
4585
- onlineUrl?: string | null;
4586
- };
4587
- defaultRegistration?: {
4588
- policy?: ('none' | 'rsvp' | 'approval' | 'external') | null;
4589
- capacity?: number | null;
4590
- };
4591
4606
  seo?: {
4592
4607
  /**
4593
4608
  * Search result title (falls back to document title)
@@ -4665,7 +4680,7 @@ interface Event {
4665
4680
  };
4666
4681
  [k: string]: unknown;
4667
4682
  } | null;
4668
- eventCalendars: (string | EventCalendar)[];
4683
+ categories?: (string | EventCategory)[] | null;
4669
4684
  tags?: (string | EventTag)[] | null;
4670
4685
  organizer?: {
4671
4686
  name?: string | null;
@@ -4757,6 +4772,31 @@ interface Event {
4757
4772
  deletedAt?: string | null;
4758
4773
  _status?: ('draft' | 'published') | null;
4759
4774
  }
4775
+ /**
4776
+ * This interface was referenced by `Config`'s JSON-Schema
4777
+ * via the `definition` "event-categories".
4778
+ */
4779
+ interface EventCategory {
4780
+ id: string;
4781
+ _order?: string | null;
4782
+ tenant?: (string | null) | Tenant;
4783
+ title: string;
4784
+ /**
4785
+ * When enabled, the slug will auto-generate from the title field on save and autosave.
4786
+ */
4787
+ generateSlug?: boolean | null;
4788
+ slug?: string | null;
4789
+ /**
4790
+ * Short summary for listing/cards
4791
+ */
4792
+ description?: string | null;
4793
+ image?: (string | null) | Image;
4794
+ parent?: (string | null) | EventCategory;
4795
+ color?: string | null;
4796
+ updatedAt: string;
4797
+ createdAt: string;
4798
+ deletedAt?: string | null;
4799
+ }
4760
4800
  /**
4761
4801
  * This interface was referenced by `Config`'s JSON-Schema
4762
4802
  * via the `definition` "event-tags".
@@ -5381,6 +5421,9 @@ interface PayloadLockedDocument {
5381
5421
  } | null) | ({
5382
5422
  relationTo: 'events';
5383
5423
  value: string | Event;
5424
+ } | null) | ({
5425
+ relationTo: 'event-categories';
5426
+ value: string | EventCategory;
5384
5427
  } | null) | ({
5385
5428
  relationTo: 'event-tags';
5386
5429
  value: string | EventTag;
@@ -5721,12 +5764,8 @@ interface TenantsSelect<T extends boolean = true> {
5721
5764
  name?: T;
5722
5765
  slug?: T;
5723
5766
  owner?: T;
5724
- features?: T | {
5725
- feature?: T;
5726
- provenance?: T;
5727
- id?: T;
5728
- };
5729
- disabledFeatures?: T;
5767
+ enabledFeatures?: T;
5768
+ featureVersion?: T;
5730
5769
  isDevMode?: T;
5731
5770
  status?: T;
5732
5771
  publishableKey?: T;
@@ -6191,6 +6230,7 @@ interface ProductsSelect<T extends boolean = true> {
6191
6230
  updatedAt?: T;
6192
6231
  createdAt?: T;
6193
6232
  deletedAt?: T;
6233
+ _status?: T;
6194
6234
  }
6195
6235
  /**
6196
6236
  * This interface was referenced by `Config`'s JSON-Schema
@@ -6324,6 +6364,7 @@ interface ProductCollectionsSelect<T extends boolean = true> {
6324
6364
  updatedAt?: T;
6325
6365
  createdAt?: T;
6326
6366
  deletedAt?: T;
6367
+ _status?: T;
6327
6368
  }
6328
6369
  /**
6329
6370
  * This interface was referenced by `Config`'s JSON-Schema
@@ -6359,6 +6400,7 @@ interface BrandsSelect<T extends boolean = true> {
6359
6400
  updatedAt?: T;
6360
6401
  createdAt?: T;
6361
6402
  deletedAt?: T;
6403
+ _status?: T;
6362
6404
  }
6363
6405
  /**
6364
6406
  * This interface was referenced by `Config`'s JSON-Schema
@@ -6583,7 +6625,6 @@ interface OrderStatusLogsSelect<T extends boolean = true> {
6583
6625
  metadata?: T;
6584
6626
  updatedAt?: T;
6585
6627
  createdAt?: T;
6586
- deletedAt?: T;
6587
6628
  }
6588
6629
  /**
6589
6630
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7154,6 +7195,7 @@ interface PlaylistsSelect<T extends boolean = true> {
7154
7195
  updatedAt?: T;
7155
7196
  createdAt?: T;
7156
7197
  deletedAt?: T;
7198
+ _status?: T;
7157
7199
  }
7158
7200
  /**
7159
7201
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7225,6 +7267,7 @@ interface TracksSelect<T extends boolean = true> {
7225
7267
  updatedAt?: T;
7226
7268
  createdAt?: T;
7227
7269
  deletedAt?: T;
7270
+ _status?: T;
7228
7271
  }
7229
7272
  /**
7230
7273
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7319,6 +7362,7 @@ interface GalleriesSelect<T extends boolean = true> {
7319
7362
  updatedAt?: T;
7320
7363
  createdAt?: T;
7321
7364
  deletedAt?: T;
7365
+ _status?: T;
7322
7366
  }
7323
7367
  /**
7324
7368
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7373,6 +7417,7 @@ interface GalleryItemsSelect<T extends boolean = true> {
7373
7417
  updatedAt?: T;
7374
7418
  createdAt?: T;
7375
7419
  deletedAt?: T;
7420
+ _status?: T;
7376
7421
  }
7377
7422
  /**
7378
7423
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7404,6 +7449,7 @@ interface LinksSelect<T extends boolean = true> {
7404
7449
  updatedAt?: T;
7405
7450
  createdAt?: T;
7406
7451
  deletedAt?: T;
7452
+ _status?: T;
7407
7453
  }
7408
7454
  /**
7409
7455
  * This interface was referenced by `Config`'s JSON-Schema
@@ -7793,6 +7839,7 @@ interface CommentsSelect<T extends boolean = true> {
7793
7839
  avatar?: T;
7794
7840
  avatarUrl?: T;
7795
7841
  };
7842
+ displayLabel?: T;
7796
7843
  body?: T;
7797
7844
  parent?: T;
7798
7845
  depth?: T;
@@ -7917,15 +7964,6 @@ interface EventCalendarsSelect<T extends boolean = true> {
7917
7964
  showPastOccurrences?: T;
7918
7965
  defaultRangeMonths?: T;
7919
7966
  };
7920
- defaultLocation?: T | {
7921
- name?: T;
7922
- address?: T;
7923
- onlineUrl?: T;
7924
- };
7925
- defaultRegistration?: T | {
7926
- policy?: T;
7927
- capacity?: T;
7928
- };
7929
7967
  seo?: T | {
7930
7968
  title?: T;
7931
7969
  description?: T;
@@ -7959,7 +7997,7 @@ interface EventsSelect<T extends boolean = true> {
7959
7997
  title?: T;
7960
7998
  description?: T;
7961
7999
  content?: T;
7962
- eventCalendars?: T;
8000
+ categories?: T;
7963
8001
  tags?: T;
7964
8002
  organizer?: T | {
7965
8003
  name?: T;
@@ -8022,6 +8060,24 @@ interface EventsSelect<T extends boolean = true> {
8022
8060
  deletedAt?: T;
8023
8061
  _status?: T;
8024
8062
  }
8063
+ /**
8064
+ * This interface was referenced by `Config`'s JSON-Schema
8065
+ * via the `definition` "event-categories_select".
8066
+ */
8067
+ interface EventCategoriesSelect<T extends boolean = true> {
8068
+ _order?: T;
8069
+ tenant?: T;
8070
+ title?: T;
8071
+ generateSlug?: T;
8072
+ slug?: T;
8073
+ description?: T;
8074
+ image?: T;
8075
+ parent?: T;
8076
+ color?: T;
8077
+ updatedAt?: T;
8078
+ createdAt?: T;
8079
+ deletedAt?: T;
8080
+ }
8025
8081
  /**
8026
8082
  * This interface was referenced by `Config`'s JSON-Schema
8027
8083
  * via the `definition` "event-tags_select".
@@ -1,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.cjs';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
3
- import { P as PublicCollection } from './const-CkhnGqnb.cjs';
4
- import './payload-types-DfQct8Dj.cjs';
3
+ import { P as PublicCollection } from './const-BApEF1Hu.cjs';
4
+ import './payload-types-D7lnu9By.cjs';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
@@ -1,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.js';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.js';
3
- import { P as PublicCollection } from './const-B9oeZoDy.js';
4
- import './payload-types-DfQct8Dj.js';
3
+ import { P as PublicCollection } from './const-BNJRuk3V.js';
4
+ import './payload-types-D7lnu9By.js';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
@@ -50,7 +50,8 @@ __export(Canvas_exports, {
50
50
  renderFieldValue: () => renderFieldValue,
51
51
  sanitizeCSS: () => sanitizeCSS,
52
52
  useCanvas: () => useCanvas,
53
- useCanvasData: () => useCanvasData
53
+ useCanvasData: () => useCanvasData,
54
+ useQuickJS: () => useQuickJS
54
55
  });
55
56
  module.exports = __toCommonJS(Canvas_exports);
56
57
 
@@ -265,6 +266,37 @@ function useCanvasData(options) {
265
266
  };
266
267
  }
267
268
 
269
+ // src/ui/Canvas/quickjs-loader.ts
270
+ var import_react3 = require("react");
271
+ var _state = { status: "idle", module: null };
272
+ var _listeners = /* @__PURE__ */ new Set();
273
+ function _notify() {
274
+ _listeners.forEach((fn) => fn());
275
+ }
276
+ function subscribeQuickJS(cb) {
277
+ _listeners.add(cb);
278
+ return () => _listeners.delete(cb);
279
+ }
280
+ function getQuickJSSnapshot() {
281
+ return _state.module;
282
+ }
283
+ function ensureQuickJSLoaded() {
284
+ if (_state.status !== "idle") return;
285
+ _state = { status: "loading", module: null };
286
+ import("quickjs-emscripten").then(
287
+ (mod) => mod.getQuickJS()
288
+ ).then((module2) => {
289
+ _state = { status: "ready", module: module2 };
290
+ _notify();
291
+ }).catch(() => {
292
+ _state = { status: "failed", module: null };
293
+ _notify();
294
+ });
295
+ }
296
+ function useQuickJS() {
297
+ return (0, import_react3.useSyncExternalStore)(subscribeQuickJS, getQuickJSSnapshot, () => null);
298
+ }
299
+
268
300
  // src/ui/Canvas/utils.ts
269
301
  function getNodeSize(node) {
270
302
  return {
@@ -384,39 +416,6 @@ function getFrameData(data, frameId) {
384
416
  // src/ui/Canvas/template-compiler.ts
385
417
  var import_react4 = __toESM(require("react"), 1);
386
418
  var import_sucrase = require("sucrase");
387
-
388
- // src/ui/Canvas/quickjs-loader.ts
389
- var import_react3 = require("react");
390
- var _state = { status: "idle", module: null };
391
- var _listeners = /* @__PURE__ */ new Set();
392
- function _notify() {
393
- _listeners.forEach((fn) => fn());
394
- }
395
- function subscribeQuickJS(cb) {
396
- _listeners.add(cb);
397
- return () => _listeners.delete(cb);
398
- }
399
- function getQuickJSSnapshot() {
400
- return _state.module;
401
- }
402
- function ensureQuickJSLoaded() {
403
- if (_state.status !== "idle") return;
404
- _state = { status: "loading", module: null };
405
- import("quickjs-emscripten").then(
406
- (mod) => mod.getQuickJS()
407
- ).then((module2) => {
408
- _state = { status: "ready", module: module2 };
409
- _notify();
410
- }).catch(() => {
411
- _state = { status: "failed", module: null };
412
- _notify();
413
- });
414
- }
415
- function useQuickJS() {
416
- return (0, import_react3.useSyncExternalStore)(subscribeQuickJS, getQuickJSSnapshot, () => null);
417
- }
418
-
419
- // src/ui/Canvas/template-compiler.ts
420
419
  var WIRE_FORMAT_VERSION = 1;
421
420
  var MAX_CACHE_SIZE = 100;
422
421
  var MAX_MATERIALIZE_DEPTH = 20;