kritzel-stencil 0.1.76 → 0.1.78

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.
Files changed (128) hide show
  1. package/dist/cjs/{index-Dc7LOVhs.js → index-BRZ6e6oa.js} +1 -1
  2. package/dist/cjs/index.cjs.js +2 -330
  3. package/dist/cjs/kritzel-active-users_42.cjs.entry.js +88 -50
  4. package/dist/cjs/kritzel-brush-style.cjs.entry.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/stencil.cjs.js +2 -2
  7. package/dist/cjs/{workspace.migrations-DkmVO6dE.js → workspace.migrations-sUPrO23c.js} +378 -13
  8. package/dist/collection/classes/objects/selection-group.class.js +2 -0
  9. package/dist/collection/collection-manifest.json +1 -1
  10. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.css +6 -1
  11. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +5 -2
  12. package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +2 -0
  13. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +16 -6
  14. package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +21 -0
  15. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +24 -10
  16. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +3 -0
  17. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +1 -0
  18. package/dist/collection/configs/default-engine-config.js +1 -0
  19. package/dist/collection/constants/version.js +1 -1
  20. package/dist/components/index.js +1 -1
  21. package/dist/components/kritzel-active-users.js +1 -1
  22. package/dist/components/kritzel-avatar.js +1 -1
  23. package/dist/components/kritzel-awareness-cursors.js +1 -1
  24. package/dist/components/kritzel-back-to-content.js +1 -1
  25. package/dist/components/kritzel-brush-style.js +1 -1
  26. package/dist/components/kritzel-button.js +1 -1
  27. package/dist/components/kritzel-color-palette.js +1 -1
  28. package/dist/components/kritzel-color.js +1 -1
  29. package/dist/components/kritzel-context-menu.js +1 -1
  30. package/dist/components/kritzel-controls.js +1 -1
  31. package/dist/components/kritzel-current-user-dialog.js +1 -1
  32. package/dist/components/kritzel-current-user.js +1 -1
  33. package/dist/components/kritzel-cursor-trail.js +1 -1
  34. package/dist/components/kritzel-dialog.js +1 -1
  35. package/dist/components/kritzel-dropdown.js +1 -1
  36. package/dist/components/kritzel-editor.js +1 -1
  37. package/dist/components/kritzel-engine.js +1 -1
  38. package/dist/components/kritzel-export.js +1 -1
  39. package/dist/components/kritzel-font-family.js +1 -1
  40. package/dist/components/kritzel-font-size.js +1 -1
  41. package/dist/components/kritzel-font.js +1 -1
  42. package/dist/components/kritzel-icon.js +1 -1
  43. package/dist/components/kritzel-input.js +1 -1
  44. package/dist/components/kritzel-line-endings.js +1 -1
  45. package/dist/components/kritzel-login-dialog.js +1 -1
  46. package/dist/components/kritzel-master-detail.js +1 -1
  47. package/dist/components/kritzel-menu-item.js +1 -1
  48. package/dist/components/kritzel-menu.js +1 -1
  49. package/dist/components/kritzel-more-menu.js +1 -1
  50. package/dist/components/kritzel-numeric-input.js +1 -1
  51. package/dist/components/kritzel-opacity-slider.js +1 -1
  52. package/dist/components/kritzel-pill-tabs.js +1 -1
  53. package/dist/components/kritzel-portal.js +1 -1
  54. package/dist/components/kritzel-settings.js +1 -1
  55. package/dist/components/kritzel-shape-fill.js +1 -1
  56. package/dist/components/kritzel-share-dialog.js +1 -1
  57. package/dist/components/kritzel-slide-toggle.js +1 -1
  58. package/dist/components/kritzel-split-button.js +1 -1
  59. package/dist/components/kritzel-stroke-size.js +1 -1
  60. package/dist/components/kritzel-tool-config.js +1 -1
  61. package/dist/components/kritzel-tooltip.js +1 -1
  62. package/dist/components/kritzel-utility-panel.js +1 -1
  63. package/dist/components/kritzel-workspace-manager.js +1 -1
  64. package/dist/components/{p-Dt-J69xt.js → p-53di1Zko.js} +1 -1
  65. package/dist/components/{p-DS0xx1eT.js → p-6NFl6EB2.js} +1 -1
  66. package/dist/components/{p-DSzQ6H2j.js → p-76W5pG2O.js} +1 -1
  67. package/dist/components/{p-DRbG92F9.js → p-BLsH_Oi0.js} +1 -1
  68. package/dist/components/p-Ban3OlgZ.js +9 -0
  69. package/dist/components/{p-CUkKKbnu.js → p-BrZ_gL8Q.js} +1 -1
  70. package/dist/components/{p-kj9wbLY8.js → p-BuI6Gkzg.js} +1 -1
  71. package/dist/components/{p-BeFUNGEI.js → p-BueaqfA2.js} +1 -1
  72. package/dist/components/{p-BiByyU2C.js → p-C2l9mZ1P.js} +1 -1
  73. package/dist/components/{p-CsR4owzk.js → p-C4fKLlrd.js} +1 -1
  74. package/dist/components/{p-BA0ayKqO.js → p-CBslLN3-.js} +1 -1
  75. package/dist/components/p-CHY71o5B.js +1 -0
  76. package/dist/components/{p-KQzWumjB.js → p-CI9Nbh-x.js} +1 -1
  77. package/dist/components/{p-CsoDfhD5.js → p-CN8IxBlU.js} +1 -1
  78. package/dist/components/{p-2OYw6GJ7.js → p-CWMFGEe0.js} +1 -1
  79. package/dist/components/{p-Dj_Qjga5.js → p-CYh7yV-K.js} +1 -1
  80. package/dist/components/{p-xM-_OeRO.js → p-Ck1dhpUQ.js} +1 -1
  81. package/dist/components/{p-b4gyXoju.js → p-Cns7qSKS.js} +1 -1
  82. package/dist/components/{p-C69Stayh.js → p-D14QNK3X.js} +1 -1
  83. package/dist/components/{p-iRL0wQHQ.js → p-D3pNw-SV.js} +1 -1
  84. package/dist/components/{p-BEJQ2kP7.js → p-D5IhryUR.js} +1 -1
  85. package/dist/components/{p-CZhyKp-f.js → p-D7yzmu1l.js} +1 -1
  86. package/dist/components/{p-HLbqRJGs.js → p-DDKjsXCe.js} +1 -1
  87. package/dist/components/{p-TyR-YTXm.js → p-DV7Z_qfa.js} +1 -1
  88. package/dist/components/{p-ByR0VXeU.js → p-DWsCbu01.js} +1 -1
  89. package/dist/components/{p-31FVoNWR.js → p-DaGZEV0R.js} +1 -1
  90. package/dist/components/{p-Da46jw3N.js → p-DkWWzVg8.js} +1 -1
  91. package/dist/components/{p-D1O7DxL4.js → p-Dr3-pKVg.js} +1 -1
  92. package/dist/components/{p-JdNoaqqb.js → p-Dte67BWd.js} +1 -1
  93. package/dist/components/{p-CHmi1QWx.js → p-DxzDda_J.js} +1 -1
  94. package/dist/components/{p-CAIGuV2J.js → p-KJ4dHzrS.js} +1 -1
  95. package/dist/components/{p-BiouZo1q.js → p-Lhyh6KeB.js} +1 -1
  96. package/dist/components/{p-CFhp1W9F.js → p-Md9Y-b3d.js} +1 -1
  97. package/dist/components/{p-C1uR_ZNW.js → p-ZC5YELQJ.js} +1 -1
  98. package/dist/components/{p-C7SBI_0T.js → p-ZQ2bKafG.js} +1 -1
  99. package/dist/components/{p-0kShCfeb.js → p-_QEHfsIk.js} +1 -1
  100. package/dist/components/{p-DXjuuVq9.js → p-gtQlsorg.js} +1 -1
  101. package/dist/components/{p-GYI7sDxr.js → p-l_YGO7RB.js} +1 -1
  102. package/dist/components/{p-DvIEvoZu.js → p-m1nVDC3G.js} +1 -1
  103. package/dist/components/{p-7o2FWtFx.js → p-pCC6t6BH.js} +1 -1
  104. package/dist/components/p-pGzF7PUB.js +1 -0
  105. package/dist/esm/{index-MV-81ybv.js → index-BbOHefEf.js} +1 -1
  106. package/dist/esm/index.js +2 -331
  107. package/dist/esm/kritzel-active-users_42.entry.js +88 -50
  108. package/dist/esm/kritzel-brush-style.entry.js +1 -1
  109. package/dist/esm/loader.js +2 -2
  110. package/dist/esm/stencil.js +3 -3
  111. package/dist/esm/{workspace.migrations-D48_Bqvh.js → workspace.migrations-NhRgr2_H.js} +378 -12
  112. package/dist/stencil/index.esm.js +1 -1
  113. package/dist/stencil/p-4a4b38e4.entry.js +9 -0
  114. package/dist/stencil/{p-fc21e29c.entry.js → p-98238bf9.entry.js} +1 -1
  115. package/dist/stencil/p-NhRgr2_H.js +1 -0
  116. package/dist/stencil/stencil.esm.js +1 -1
  117. package/dist/types/classes/objects/selection-group.class.d.ts +1 -0
  118. package/dist/types/components.d.ts +4 -2
  119. package/dist/types/constants/version.d.ts +1 -1
  120. package/dist/types/interfaces/engine-state.interface.d.ts +1 -0
  121. package/package.json +2 -2
  122. package/dist/components/p-CJ2eHeoV.js +0 -1
  123. package/dist/components/p-jdYmu4SA.js +0 -9
  124. package/dist/components/p-xNwOWoiT.js +0 -1
  125. package/dist/stencil/p-775a7246.entry.js +0 -9
  126. package/dist/stencil/p-D48_Bqvh.js +0 -1
  127. /package/dist/components/{p-pebXO4LU.js → p-CGGiwvWZ.js} +0 -0
  128. /package/dist/stencil/{p-MV-81ybv.js → p-BbOHefEf.js} +0 -0
@@ -2,7 +2,7 @@ const NAMESPACE = 'stencil';
2
2
  const BUILD = /* stencil */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.43.2 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.43.3 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
 
8
8
 
package/dist/esm/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './workspace.migrations-D48_Bqvh.js';
2
- export { A as APP_STATE_MIGRATIONS, C as CURRENT_APP_STATE_SCHEMA_VERSION, w as CURRENT_WORKSPACE_SCHEMA_VERSION, D as DEFAULT_BRUSH_CONFIG, s as DEFAULT_LINE_TOOL_CONFIG, r as DEFAULT_TEXT_CONFIG, I as IndexedDBSyncProvider, v as KritzelAlignment, p as KritzelAnchorManager, g as KritzelBrushTool, m as KritzelCursorHelper, i as KritzelEraserTool, e as KritzelGroup, c as KritzelImage, j as KritzelImageTool, d as KritzelLine, h as KritzelLineTool, b as KritzelPath, n as KritzelSelectionTool, f as KritzelShape, l as KritzelShapeTool, K as KritzelText, k as KritzelTextTool, q as KritzelThemeManager, o as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, y as WORKSPACE_MIGRATIONS, u as darkTheme, t as lightTheme, x as runMigrations } from './workspace.migrations-D48_Bqvh.js';
1
+ export { A as APP_STATE_MIGRATIONS, C as CURRENT_APP_STATE_SCHEMA_VERSION, v as CURRENT_WORKSPACE_SCHEMA_VERSION, D as DEFAULT_BRUSH_CONFIG, r as DEFAULT_LINE_TOOL_CONFIG, q as DEFAULT_TEXT_CONFIG, H as HocuspocusSyncProvider, I as IndexedDBSyncProvider, u as KritzelAlignment, o as KritzelAnchorManager, f as KritzelBrushTool, l as KritzelCursorHelper, h as KritzelEraserTool, d as KritzelGroup, b as KritzelImage, i as KritzelImageTool, c as KritzelLine, g as KritzelLineTool, a as KritzelPath, m as KritzelSelectionTool, e as KritzelShape, k as KritzelShapeTool, K as KritzelText, j as KritzelTextTool, p as KritzelThemeManager, n as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, x as WORKSPACE_MIGRATIONS, t as darkTheme, s as lightTheme, w as runMigrations } from './workspace.migrations-NhRgr2_H.js';
3
2
  import * as Y from 'yjs';
4
3
  import { WebsocketProvider } from 'y-websocket';
5
4
  import 'y-indexeddb';
@@ -536,332 +535,4 @@ class WebSocketSyncProvider {
536
535
  }
537
536
  }
538
537
 
539
- /**
540
- * Hocuspocus sync provider for real-time collaboration
541
- * Supports multiplexing - multiple documents can share the same WebSocket connection
542
- */
543
- class HocuspocusSyncProvider {
544
- type = 'network';
545
- provider;
546
- isConnected = false;
547
- isSynced = false;
548
- usesSharedSocket = false;
549
- isDestroyed = false;
550
- connectTimeout = null;
551
- pendingConnectReject = null;
552
- connectionTimeoutMs;
553
- _connectionStatus = 'disconnected';
554
- visibilityHandler = null;
555
- onlineHandler = null;
556
- get awareness() {
557
- return this.provider.awareness;
558
- }
559
- get connectionStatus() {
560
- return this._connectionStatus;
561
- }
562
- // Static shared WebSocket instance for multiplexing
563
- static sharedWebSocketProvider = null;
564
- constructor(docName, doc, options) {
565
- const name = options?.name || docName;
566
- const url = options?.url || 'ws://localhost:1234';
567
- this.connectionTimeoutMs = options?.connectionTimeout ?? 10000;
568
- // Use provided websocketProvider or the static shared one
569
- const websocketProvider = options?.websocketProvider || HocuspocusSyncProvider.sharedWebSocketProvider;
570
- // Build reconnect config from options
571
- const reconnectConfig = {};
572
- if (options?.delay !== undefined)
573
- reconnectConfig.delay = options.delay;
574
- if (options?.factor !== undefined)
575
- reconnectConfig.factor = options.factor;
576
- if (options?.maxAttempts !== undefined)
577
- reconnectConfig.maxAttempts = options.maxAttempts;
578
- if (options?.minDelay !== undefined)
579
- reconnectConfig.minDelay = options.minDelay;
580
- if (options?.maxDelay !== undefined)
581
- reconnectConfig.maxDelay = options.maxDelay;
582
- const onConnect = () => {
583
- if (this.isDestroyed) {
584
- return;
585
- }
586
- this.isConnected = true;
587
- this._connectionStatus = 'connected';
588
- if (!options?.quiet) {
589
- console.info(`Hocuspocus connected: ${name}`);
590
- }
591
- if (options?.onConnect) {
592
- options.onConnect();
593
- }
594
- };
595
- const onDisconnect = () => {
596
- if (this.isDestroyed) {
597
- return;
598
- }
599
- this.isConnected = false;
600
- this.isSynced = false;
601
- this._connectionStatus = 'disconnected';
602
- if (!options?.quiet) {
603
- console.info(`Hocuspocus disconnected: ${name}`);
604
- }
605
- if (options?.onDisconnect) {
606
- options.onDisconnect();
607
- }
608
- };
609
- const onSynced = () => {
610
- if (this.isDestroyed) {
611
- return;
612
- }
613
- this.isSynced = true;
614
- this._connectionStatus = 'synced';
615
- if (!options?.quiet) {
616
- console.info(`Hocuspocus synced: ${name}`);
617
- }
618
- if (options?.onSynced) {
619
- options.onSynced();
620
- }
621
- };
622
- const onStatus = (data) => {
623
- if (this.isDestroyed) {
624
- return;
625
- }
626
- if (data.status === 'connecting') {
627
- this._connectionStatus = 'connecting';
628
- }
629
- if (options?.onStatus) {
630
- options.onStatus(data);
631
- }
632
- };
633
- if (websocketProvider) {
634
- // Multiplexing mode - use shared WebSocket connection
635
- this.usesSharedSocket = true;
636
- const config = {
637
- websocketProvider,
638
- name,
639
- document: doc,
640
- token: options?.token || null,
641
- onStatus,
642
- onConnect,
643
- onDisconnect,
644
- onSynced,
645
- ...reconnectConfig,
646
- };
647
- // Add optional settings
648
- if (options?.forceSyncInterval !== undefined) {
649
- config.forceSyncInterval = options.forceSyncInterval;
650
- }
651
- if (options?.onAuthenticationFailed) {
652
- config.onAuthenticationFailed = options.onAuthenticationFailed;
653
- }
654
- this.provider = new HocuspocusProvider(config);
655
- // Must call attach() explicitly when using shared socket
656
- this.provider.attach();
657
- if (!options?.quiet) {
658
- console.info(`Hocuspocus Provider initialized (multiplexed): ${name}`);
659
- }
660
- }
661
- else {
662
- // Standalone mode - create own WebSocket connection
663
- this.usesSharedSocket = false;
664
- const config = {
665
- url,
666
- name,
667
- document: doc,
668
- token: options?.token || null,
669
- autoConnect: false,
670
- onStatus,
671
- onConnect,
672
- onDisconnect,
673
- onSynced,
674
- ...reconnectConfig,
675
- };
676
- // Add optional settings
677
- if (options?.forceSyncInterval !== undefined) {
678
- config.forceSyncInterval = options.forceSyncInterval;
679
- }
680
- if (options?.onAuthenticationFailed) {
681
- config.onAuthenticationFailed = options.onAuthenticationFailed;
682
- }
683
- if (options?.WebSocketPolyfill) {
684
- config.WebSocketPolyfill = options.WebSocketPolyfill;
685
- }
686
- this.provider = new HocuspocusProvider(config);
687
- if (!options?.quiet) {
688
- console.info(`Hocuspocus Provider initialized: ${url}/${name}`);
689
- }
690
- }
691
- this.setupBrowserEventListeners();
692
- }
693
- setupBrowserEventListeners() {
694
- if (typeof document !== 'undefined') {
695
- this.visibilityHandler = () => {
696
- if (document.visibilityState === 'visible' && !this.isConnected && !this.isDestroyed) {
697
- this.provider.connect();
698
- }
699
- };
700
- document.addEventListener('visibilitychange', this.visibilityHandler);
701
- }
702
- if (typeof window !== 'undefined') {
703
- this.onlineHandler = () => {
704
- if (!this.isConnected && !this.isDestroyed) {
705
- this.provider.connect();
706
- }
707
- };
708
- window.addEventListener('online', this.onlineHandler);
709
- }
710
- }
711
- removeBrowserEventListeners() {
712
- if (this.visibilityHandler && typeof document !== 'undefined') {
713
- document.removeEventListener('visibilitychange', this.visibilityHandler);
714
- this.visibilityHandler = null;
715
- }
716
- if (this.onlineHandler && typeof window !== 'undefined') {
717
- window.removeEventListener('online', this.onlineHandler);
718
- this.onlineHandler = null;
719
- }
720
- }
721
- /**
722
- * Create a shared WebSocket connection for multiplexing
723
- * Call this once to create a shared connection that multiple providers can use
724
- */
725
- static createSharedWebSocket(options) {
726
- if (HocuspocusSyncProvider.sharedWebSocketProvider) {
727
- console.warn('Shared WebSocket already exists. Returning existing instance.');
728
- return HocuspocusSyncProvider.sharedWebSocketProvider;
729
- }
730
- const config = {
731
- url: options.url,
732
- };
733
- if (options.WebSocketPolyfill) {
734
- config.WebSocketPolyfill = options.WebSocketPolyfill;
735
- }
736
- if (options.onConnect) {
737
- config.onConnect = options.onConnect;
738
- }
739
- if (options.onDisconnect) {
740
- config.onDisconnect = options.onDisconnect;
741
- }
742
- if (options.onStatus) {
743
- config.onStatus = options.onStatus;
744
- }
745
- HocuspocusSyncProvider.sharedWebSocketProvider = new HocuspocusProviderWebsocket(config);
746
- console.info(`Shared Hocuspocus WebSocket created: ${options.url}`);
747
- return HocuspocusSyncProvider.sharedWebSocketProvider;
748
- }
749
- /**
750
- * Destroy the shared WebSocket connection
751
- * Call this when you're done with all multiplexed providers
752
- */
753
- static destroySharedWebSocket() {
754
- if (HocuspocusSyncProvider.sharedWebSocketProvider) {
755
- HocuspocusSyncProvider.sharedWebSocketProvider.destroy();
756
- HocuspocusSyncProvider.sharedWebSocketProvider = null;
757
- console.info('Shared Hocuspocus WebSocket destroyed');
758
- }
759
- }
760
- /**
761
- * Get the shared WebSocket provider instance (if it exists)
762
- */
763
- static getSharedWebSocket() {
764
- return HocuspocusSyncProvider.sharedWebSocketProvider;
765
- }
766
- /**
767
- * Static factory method for creating HocuspocusSyncProvider with configuration options
768
- * Returns a ProviderFactory that can be used in sync configuration
769
- */
770
- static with(options) {
771
- return {
772
- create: (docName, doc, runtimeOptions) => {
773
- const mergedOptions = runtimeOptions ? { ...options, ...runtimeOptions } : options;
774
- return new HocuspocusSyncProvider(docName, doc, mergedOptions);
775
- },
776
- };
777
- }
778
- async connect() {
779
- if (this.isSynced || this.isDestroyed) {
780
- return;
781
- }
782
- this._connectionStatus = 'connecting';
783
- return new Promise((resolve, reject) => {
784
- // Store reject function so we can cancel the connection if destroyed
785
- this.pendingConnectReject = reject;
786
- this.connectTimeout = setTimeout(() => {
787
- this.pendingConnectReject = null;
788
- this.connectTimeout = null;
789
- reject(new Error('Hocuspocus connection timeout'));
790
- }, this.connectionTimeoutMs);
791
- const syncHandler = () => {
792
- if (this.connectTimeout) {
793
- clearTimeout(this.connectTimeout);
794
- this.connectTimeout = null;
795
- }
796
- this.pendingConnectReject = null;
797
- this.provider.off('synced', syncHandler);
798
- if (!this.isDestroyed) {
799
- resolve();
800
- }
801
- };
802
- this.provider.on('synced', syncHandler);
803
- // If already synced, resolve immediately
804
- if (this.provider.isSynced) {
805
- if (this.connectTimeout) {
806
- clearTimeout(this.connectTimeout);
807
- this.connectTimeout = null;
808
- }
809
- this.pendingConnectReject = null;
810
- this.provider.off('synced', syncHandler);
811
- resolve();
812
- return;
813
- }
814
- // Connect if not already connected (standalone mode only)
815
- if (!this.isConnected && !this.usesSharedSocket) {
816
- this.provider.connect();
817
- }
818
- });
819
- }
820
- async reconnect() {
821
- this.disconnect();
822
- return this.connect();
823
- }
824
- disconnect() {
825
- // Cancel any pending connection attempt
826
- if (this.connectTimeout) {
827
- clearTimeout(this.connectTimeout);
828
- this.connectTimeout = null;
829
- }
830
- if (this.pendingConnectReject) {
831
- this.pendingConnectReject = null; // Don't reject, just abandon the promise
832
- }
833
- if (this.provider) {
834
- if (this.usesSharedSocket) {
835
- // Detach from shared socket instead of disconnecting
836
- this.provider.detach();
837
- }
838
- else {
839
- this.provider.disconnect();
840
- }
841
- }
842
- this.isConnected = false;
843
- this.isSynced = false;
844
- this._connectionStatus = 'disconnected';
845
- }
846
- destroy() {
847
- // Mark as destroyed first to prevent any callbacks from doing work
848
- this.isDestroyed = true;
849
- // Cancel any pending connection attempt
850
- if (this.connectTimeout) {
851
- clearTimeout(this.connectTimeout);
852
- this.connectTimeout = null;
853
- }
854
- if (this.pendingConnectReject) {
855
- this.pendingConnectReject = null; // Don't reject, just abandon the promise
856
- }
857
- this.removeBrowserEventListeners();
858
- if (this.provider) {
859
- this.provider.destroy();
860
- }
861
- this.isConnected = false;
862
- this.isSynced = false;
863
- this._connectionStatus = 'disconnected';
864
- }
865
- }
866
-
867
- export { BroadcastSyncProvider, HocuspocusSyncProvider, WebSocketSyncProvider };
538
+ export { BroadcastSyncProvider, WebSocketSyncProvider };