@opentiny/fluent-editor 4.0.0-alpha.5 → 4.0.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.
Files changed (270) hide show
  1. package/README.md +1 -1
  2. package/es/_virtual/_commonjs-dynamic-modules.es.js +7 -0
  3. package/es/_virtual/_commonjs-dynamic-modules.es.js.map +1 -0
  4. package/es/_virtual/_commonjsHelpers.es.js +42 -0
  5. package/es/_virtual/_commonjsHelpers.es.js.map +1 -0
  6. package/es/_virtual/quill-cursors.es.js +5 -0
  7. package/es/_virtual/quill-cursors.es.js.map +1 -0
  8. package/es/_virtual/simplepeer.min.es.js +5 -0
  9. package/es/_virtual/simplepeer.min.es.js.map +1 -0
  10. package/es/index.es.js +2 -0
  11. package/es/index.es.js.map +1 -1
  12. package/es/modules/collaborative-editing/awareness/awareness.es.js +93 -0
  13. package/es/modules/collaborative-editing/awareness/awareness.es.js.map +1 -0
  14. package/es/modules/collaborative-editing/awareness/index.es.js +8 -0
  15. package/es/modules/collaborative-editing/awareness/index.es.js.map +1 -0
  16. package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js +12 -0
  17. package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js.map +1 -0
  18. package/es/modules/collaborative-editing/collaborative-editing.es.js +105 -0
  19. package/es/modules/collaborative-editing/collaborative-editing.es.js.map +1 -0
  20. package/es/modules/collaborative-editing/index.es.js +6 -0
  21. package/es/modules/collaborative-editing/index.es.js.map +1 -0
  22. package/es/modules/collaborative-editing/module.es.js +35 -0
  23. package/es/modules/collaborative-editing/module.es.js.map +1 -0
  24. package/es/modules/collaborative-editing/provider/providerRegistry.es.js +28 -0
  25. package/es/modules/collaborative-editing/provider/providerRegistry.es.js.map +1 -0
  26. package/es/modules/collaborative-editing/provider/webrtc.es.js +99 -0
  27. package/es/modules/collaborative-editing/provider/webrtc.es.js.map +1 -0
  28. package/es/modules/collaborative-editing/provider/websocket.es.js +111 -0
  29. package/es/modules/collaborative-editing/provider/websocket.es.js.map +1 -0
  30. package/es/modules/collaborative-editing/types.es.js +2 -0
  31. package/es/modules/collaborative-editing/types.es.js.map +1 -0
  32. package/es/modules/custom-image/options.es.js +1 -1
  33. package/es/modules/custom-image/options.es.js.map +1 -1
  34. package/es/modules/index.es.js +1 -0
  35. package/es/modules/index.es.js.map +1 -1
  36. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/array.es.js +112 -0
  37. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/array.es.js.map +1 -0
  38. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/binary.es.js +133 -0
  39. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/binary.es.js.map +1 -0
  40. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/broadcastchannel.es.js +59 -0
  41. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/broadcastchannel.es.js.map +1 -0
  42. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/buffer.es.js +75 -0
  43. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/buffer.es.js.map +1 -0
  44. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/conditions.es.js +5 -0
  45. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/conditions.es.js.map +1 -0
  46. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/decoding.es.js +422 -0
  47. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/decoding.es.js.map +1 -0
  48. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/dom.es.js +142 -0
  49. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/dom.es.js.map +1 -0
  50. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/encoding.es.js +484 -0
  51. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/encoding.es.js.map +1 -0
  52. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/environment.es.js +79 -0
  53. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/environment.es.js.map +1 -0
  54. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/error.es.js +13 -0
  55. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/error.es.js.map +1 -0
  56. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/eventloop.es.js +69 -0
  57. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/eventloop.es.js.map +1 -0
  58. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/function.es.js +124 -0
  59. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/function.es.js.map +1 -0
  60. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/indexeddb.es.js +92 -0
  61. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/indexeddb.es.js.map +1 -0
  62. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/iterator.es.js +38 -0
  63. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/iterator.es.js.map +1 -0
  64. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/json.es.js +7 -0
  65. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/json.es.js.map +1 -0
  66. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.common.es.js +99 -0
  67. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.common.es.js.map +1 -0
  68. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.es.js +288 -0
  69. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.es.js.map +1 -0
  70. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/map.es.js +47 -0
  71. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/map.es.js.map +1 -0
  72. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/math.es.js +37 -0
  73. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/math.es.js.map +1 -0
  74. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/metric.es.js +64 -0
  75. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/metric.es.js.map +1 -0
  76. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/mutex.es.js +19 -0
  77. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/mutex.es.js.map +1 -0
  78. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/number.es.js +31 -0
  79. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/number.es.js.map +1 -0
  80. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/object.es.js +72 -0
  81. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/object.es.js.map +1 -0
  82. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/observable.es.js +128 -0
  83. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/observable.es.js.map +1 -0
  84. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/pair.es.js +22 -0
  85. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/pair.es.js.map +1 -0
  86. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/promise.es.js +50 -0
  87. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/promise.es.js.map +1 -0
  88. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/random.es.js +24 -0
  89. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/random.es.js.map +1 -0
  90. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/set.es.js +11 -0
  91. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/set.es.js.map +1 -0
  92. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/storage.es.js +44 -0
  93. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/storage.es.js.map +1 -0
  94. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/string.es.js +95 -0
  95. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/string.es.js.map +1 -0
  96. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/symbol.es.js +7 -0
  97. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/symbol.es.js.map +1 -0
  98. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/time.es.js +28 -0
  99. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/time.es.js.map +1 -0
  100. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/traits.es.js +5 -0
  101. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/traits.es.js.map +1 -0
  102. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/url.es.js +20 -0
  103. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/url.es.js.map +1 -0
  104. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/webcrypto.es.js +7 -0
  105. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/webcrypto.es.js.map +1 -0
  106. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/websocket.es.js +113 -0
  107. package/es/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/websocket.es.js.map +1 -0
  108. package/es/node_modules/.pnpm/quill-cursors@4.0.4/node_modules/quill-cursors/dist/quill-cursors.es.js +1796 -0
  109. package/es/node_modules/.pnpm/quill-cursors@4.0.4/node_modules/quill-cursors/dist/quill-cursors.es.js.map +1 -0
  110. package/es/node_modules/.pnpm/simple-peer@9.11.1/node_modules/simple-peer/simplepeer.min.es.js +2620 -0
  111. package/es/node_modules/.pnpm/simple-peer@9.11.1/node_modules/simple-peer/simplepeer.min.es.js.map +1 -0
  112. package/es/node_modules/.pnpm/y-indexeddb@9.0.12_yjs@13.6.27/node_modules/y-indexeddb/src/y-indexeddb.es.js +155 -0
  113. package/es/node_modules/.pnpm/y-indexeddb@9.0.12_yjs@13.6.27/node_modules/y-indexeddb/src/y-indexeddb.es.js.map +1 -0
  114. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/auth.es.js +20 -0
  115. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/auth.es.js.map +1 -0
  116. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/awareness.es.js +232 -0
  117. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/awareness.es.js.map +1 -0
  118. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/sync.es.js +58 -0
  119. package/es/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/sync.es.js.map +1 -0
  120. package/es/node_modules/.pnpm/y-quill@1.0.0_quill-cursors@4.0.4_quill@2.0.3_patch_hash_dnirvjhpzdmsvdidsclwslxxji__yjs@13.6.27/node_modules/y-quill/src/y-quill.es.js +157 -0
  121. package/es/node_modules/.pnpm/y-quill@1.0.0_quill-cursors@4.0.4_quill@2.0.3_patch_hash_dnirvjhpzdmsvdidsclwslxxji__yjs@13.6.27/node_modules/y-quill/src/y-quill.es.js.map +1 -0
  122. package/es/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/crypto.es.js +94 -0
  123. package/es/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/crypto.es.js.map +1 -0
  124. package/es/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/y-webrtc.es.js +537 -0
  125. package/es/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/y-webrtc.es.js.map +1 -0
  126. package/es/node_modules/.pnpm/y-websocket@3.0.0_yjs@13.6.27/node_modules/y-websocket/src/y-websocket.es.js +380 -0
  127. package/es/node_modules/.pnpm/y-websocket@3.0.0_yjs@13.6.27/node_modules/y-websocket/src/y-websocket.es.js.map +1 -0
  128. package/es/node_modules/.pnpm/yjs@13.6.27/node_modules/yjs/dist/yjs.es.js +7653 -0
  129. package/es/node_modules/.pnpm/yjs@13.6.27/node_modules/yjs/dist/yjs.es.js.map +1 -0
  130. package/lib/_virtual/_commonjs-dynamic-modules.cjs.js +7 -0
  131. package/lib/_virtual/_commonjs-dynamic-modules.cjs.js.map +1 -0
  132. package/lib/_virtual/_commonjsHelpers.cjs.js +42 -0
  133. package/lib/_virtual/_commonjsHelpers.cjs.js.map +1 -0
  134. package/lib/_virtual/quill-cursors.cjs.js +5 -0
  135. package/lib/_virtual/quill-cursors.cjs.js.map +1 -0
  136. package/lib/_virtual/simplepeer.min.cjs.js +5 -0
  137. package/lib/_virtual/simplepeer.min.cjs.js.map +1 -0
  138. package/lib/index.cjs.js +4 -2
  139. package/lib/index.cjs.js.map +1 -1
  140. package/lib/modules/collaborative-editing/awareness/awareness.cjs.js +93 -0
  141. package/lib/modules/collaborative-editing/awareness/awareness.cjs.js.map +1 -0
  142. package/lib/modules/collaborative-editing/awareness/index.cjs.js +8 -0
  143. package/lib/modules/collaborative-editing/awareness/index.cjs.js.map +1 -0
  144. package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js +12 -0
  145. package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js.map +1 -0
  146. package/lib/modules/collaborative-editing/collaborative-editing.cjs.js +105 -0
  147. package/lib/modules/collaborative-editing/collaborative-editing.cjs.js.map +1 -0
  148. package/lib/modules/collaborative-editing/index.cjs.js +6 -0
  149. package/lib/modules/collaborative-editing/index.cjs.js.map +1 -0
  150. package/lib/modules/collaborative-editing/module.cjs.js +35 -0
  151. package/lib/modules/collaborative-editing/module.cjs.js.map +1 -0
  152. package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js +28 -0
  153. package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js.map +1 -0
  154. package/lib/modules/collaborative-editing/provider/webrtc.cjs.js +99 -0
  155. package/lib/modules/collaborative-editing/provider/webrtc.cjs.js.map +1 -0
  156. package/lib/modules/collaborative-editing/provider/websocket.cjs.js +111 -0
  157. package/lib/modules/collaborative-editing/provider/websocket.cjs.js.map +1 -0
  158. package/lib/modules/collaborative-editing/types.cjs.js +2 -0
  159. package/lib/modules/collaborative-editing/types.cjs.js.map +1 -0
  160. package/lib/modules/custom-image/options.cjs.js +1 -1
  161. package/lib/modules/custom-image/options.cjs.js.map +1 -1
  162. package/lib/modules/index.cjs.js +1 -0
  163. package/lib/modules/index.cjs.js.map +1 -1
  164. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/array.cjs.js +112 -0
  165. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/array.cjs.js.map +1 -0
  166. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/binary.cjs.js +133 -0
  167. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/binary.cjs.js.map +1 -0
  168. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/broadcastchannel.cjs.js +59 -0
  169. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/broadcastchannel.cjs.js.map +1 -0
  170. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/buffer.cjs.js +75 -0
  171. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/buffer.cjs.js.map +1 -0
  172. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/conditions.cjs.js +5 -0
  173. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/conditions.cjs.js.map +1 -0
  174. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/decoding.cjs.js +422 -0
  175. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/decoding.cjs.js.map +1 -0
  176. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/dom.cjs.js +142 -0
  177. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/dom.cjs.js.map +1 -0
  178. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/encoding.cjs.js +484 -0
  179. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/encoding.cjs.js.map +1 -0
  180. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/environment.cjs.js +79 -0
  181. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/environment.cjs.js.map +1 -0
  182. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/error.cjs.js +13 -0
  183. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/error.cjs.js.map +1 -0
  184. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/eventloop.cjs.js +69 -0
  185. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/eventloop.cjs.js.map +1 -0
  186. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/function.cjs.js +124 -0
  187. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/function.cjs.js.map +1 -0
  188. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/indexeddb.cjs.js +92 -0
  189. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/indexeddb.cjs.js.map +1 -0
  190. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/iterator.cjs.js +38 -0
  191. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/iterator.cjs.js.map +1 -0
  192. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/json.cjs.js +7 -0
  193. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/json.cjs.js.map +1 -0
  194. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.cjs.js +288 -0
  195. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.cjs.js.map +1 -0
  196. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.common.cjs.js +99 -0
  197. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/logging.common.cjs.js.map +1 -0
  198. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/map.cjs.js +47 -0
  199. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/map.cjs.js.map +1 -0
  200. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/math.cjs.js +37 -0
  201. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/math.cjs.js.map +1 -0
  202. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/metric.cjs.js +64 -0
  203. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/metric.cjs.js.map +1 -0
  204. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/mutex.cjs.js +19 -0
  205. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/mutex.cjs.js.map +1 -0
  206. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/number.cjs.js +31 -0
  207. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/number.cjs.js.map +1 -0
  208. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/object.cjs.js +72 -0
  209. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/object.cjs.js.map +1 -0
  210. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/observable.cjs.js +128 -0
  211. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/observable.cjs.js.map +1 -0
  212. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/pair.cjs.js +22 -0
  213. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/pair.cjs.js.map +1 -0
  214. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/promise.cjs.js +50 -0
  215. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/promise.cjs.js.map +1 -0
  216. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/random.cjs.js +24 -0
  217. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/random.cjs.js.map +1 -0
  218. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/set.cjs.js +11 -0
  219. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/set.cjs.js.map +1 -0
  220. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/storage.cjs.js +44 -0
  221. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/storage.cjs.js.map +1 -0
  222. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/string.cjs.js +94 -0
  223. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/string.cjs.js.map +1 -0
  224. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/symbol.cjs.js +7 -0
  225. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/symbol.cjs.js.map +1 -0
  226. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/time.cjs.js +28 -0
  227. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/time.cjs.js.map +1 -0
  228. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/traits.cjs.js +5 -0
  229. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/traits.cjs.js.map +1 -0
  230. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/url.cjs.js +20 -0
  231. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/url.cjs.js.map +1 -0
  232. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/webcrypto.cjs.js +7 -0
  233. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/webcrypto.cjs.js.map +1 -0
  234. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/websocket.cjs.js +113 -0
  235. package/lib/node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/websocket.cjs.js.map +1 -0
  236. package/lib/node_modules/.pnpm/quill-cursors@4.0.4/node_modules/quill-cursors/dist/quill-cursors.cjs.js +1796 -0
  237. package/lib/node_modules/.pnpm/quill-cursors@4.0.4/node_modules/quill-cursors/dist/quill-cursors.cjs.js.map +1 -0
  238. package/lib/node_modules/.pnpm/simple-peer@9.11.1/node_modules/simple-peer/simplepeer.min.cjs.js +2620 -0
  239. package/lib/node_modules/.pnpm/simple-peer@9.11.1/node_modules/simple-peer/simplepeer.min.cjs.js.map +1 -0
  240. package/lib/node_modules/.pnpm/y-indexeddb@9.0.12_yjs@13.6.27/node_modules/y-indexeddb/src/y-indexeddb.cjs.js +155 -0
  241. package/lib/node_modules/.pnpm/y-indexeddb@9.0.12_yjs@13.6.27/node_modules/y-indexeddb/src/y-indexeddb.cjs.js.map +1 -0
  242. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/auth.cjs.js +20 -0
  243. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/auth.cjs.js.map +1 -0
  244. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/awareness.cjs.js +232 -0
  245. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/awareness.cjs.js.map +1 -0
  246. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/sync.cjs.js +58 -0
  247. package/lib/node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/sync.cjs.js.map +1 -0
  248. package/lib/node_modules/.pnpm/y-quill@1.0.0_quill-cursors@4.0.4_quill@2.0.3_patch_hash_dnirvjhpzdmsvdidsclwslxxji__yjs@13.6.27/node_modules/y-quill/src/y-quill.cjs.js +157 -0
  249. package/lib/node_modules/.pnpm/y-quill@1.0.0_quill-cursors@4.0.4_quill@2.0.3_patch_hash_dnirvjhpzdmsvdidsclwslxxji__yjs@13.6.27/node_modules/y-quill/src/y-quill.cjs.js.map +1 -0
  250. package/lib/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/crypto.cjs.js +94 -0
  251. package/lib/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/crypto.cjs.js.map +1 -0
  252. package/lib/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/y-webrtc.cjs.js +537 -0
  253. package/lib/node_modules/.pnpm/y-webrtc@10.3.0_yjs@13.6.27/node_modules/y-webrtc/src/y-webrtc.cjs.js.map +1 -0
  254. package/lib/node_modules/.pnpm/y-websocket@3.0.0_yjs@13.6.27/node_modules/y-websocket/src/y-websocket.cjs.js +380 -0
  255. package/lib/node_modules/.pnpm/y-websocket@3.0.0_yjs@13.6.27/node_modules/y-websocket/src/y-websocket.cjs.js.map +1 -0
  256. package/lib/node_modules/.pnpm/yjs@13.6.27/node_modules/yjs/dist/yjs.cjs.js +7653 -0
  257. package/lib/node_modules/.pnpm/yjs@13.6.27/node_modules/yjs/dist/yjs.cjs.js.map +1 -0
  258. package/package.json +9 -2
  259. package/types/modules/collaborative-editing/awareness/awareness.d.ts +29 -0
  260. package/types/modules/collaborative-editing/awareness/index.d.ts +2 -0
  261. package/types/modules/collaborative-editing/awareness/y-indexeddb.d.ts +3 -0
  262. package/types/modules/collaborative-editing/collaborative-editing.d.ts +25 -0
  263. package/types/modules/collaborative-editing/index.d.ts +2 -0
  264. package/types/modules/collaborative-editing/module.d.ts +12 -0
  265. package/types/modules/collaborative-editing/provider/index.d.ts +3 -0
  266. package/types/modules/collaborative-editing/provider/providerRegistry.d.ts +26 -0
  267. package/types/modules/collaborative-editing/provider/webrtc.d.ts +37 -0
  268. package/types/modules/collaborative-editing/provider/websocket.d.ts +41 -0
  269. package/types/modules/collaborative-editing/types.d.ts +37 -0
  270. package/types/modules/index.d.ts +1 -0
@@ -0,0 +1,111 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { Awareness } from "../../../node_modules/.pnpm/y-protocols@1.0.6_yjs@13.6.27/node_modules/y-protocols/awareness.es.js";
5
+ import { WebsocketProvider } from "../../../node_modules/.pnpm/y-websocket@3.0.0_yjs@13.6.27/node_modules/y-websocket/src/y-websocket.es.js";
6
+ import { Doc } from "../../../node_modules/.pnpm/yjs@13.6.27/node_modules/yjs/dist/yjs.es.js";
7
+ class WebsocketProviderWrapper {
8
+ constructor({
9
+ awareness,
10
+ doc,
11
+ options,
12
+ onConnect,
13
+ onDisconnect,
14
+ onError,
15
+ onSyncChange
16
+ }) {
17
+ __publicField(this, "provider");
18
+ __publicField(this, "_isConnected", false);
19
+ __publicField(this, "_isSynced", false);
20
+ __publicField(this, "onConnect");
21
+ __publicField(this, "onDisconnect");
22
+ __publicField(this, "onError");
23
+ __publicField(this, "onSyncChange");
24
+ __publicField(this, "document");
25
+ __publicField(this, "awareness");
26
+ __publicField(this, "type");
27
+ __publicField(this, "connect", () => {
28
+ try {
29
+ this.provider.connect();
30
+ } catch (error) {
31
+ console.warn("[yjs] Error connecting WebSocket provider:", error);
32
+ }
33
+ });
34
+ __publicField(this, "destroy", () => {
35
+ try {
36
+ this.provider.destroy();
37
+ } catch (error) {
38
+ console.warn("[yjs] Error destroying WebSocket provider:", error);
39
+ }
40
+ });
41
+ __publicField(this, "disconnect", () => {
42
+ var _a;
43
+ try {
44
+ this.provider.disconnect();
45
+ const wasSynced = this._isSynced;
46
+ this._isConnected = false;
47
+ this._isSynced = false;
48
+ if (wasSynced) {
49
+ (_a = this.onSyncChange) == null ? void 0 : _a.call(this, false);
50
+ }
51
+ } catch (error) {
52
+ console.warn("[yjs] Error disconnecting WebSocket provider:", error);
53
+ }
54
+ });
55
+ this.onConnect = onConnect;
56
+ this.onDisconnect = onDisconnect;
57
+ this.onError = onError;
58
+ this.onSyncChange = onSyncChange;
59
+ this.document = doc || new Doc();
60
+ this.awareness = awareness ?? new Awareness(this.document);
61
+ try {
62
+ this.provider = new WebsocketProvider(
63
+ options.serverUrl,
64
+ options.roomName,
65
+ this.document,
66
+ {
67
+ awareness: this.awareness,
68
+ ...options
69
+ }
70
+ );
71
+ this.provider.on("status", (event) => {
72
+ var _a, _b, _c, _d;
73
+ const wasConnected = this._isConnected;
74
+ this._isConnected = event.status === "connected";
75
+ if (event.status === "connected") {
76
+ if (!wasConnected) {
77
+ (_a = this.onConnect) == null ? void 0 : _a.call(this);
78
+ }
79
+ if (!this._isSynced) {
80
+ this._isSynced = true;
81
+ (_b = this.onSyncChange) == null ? void 0 : _b.call(this, true);
82
+ }
83
+ } else if (event.status === "disconnected") {
84
+ if (wasConnected) {
85
+ (_c = this.onDisconnect) == null ? void 0 : _c.call(this);
86
+ if (this._isSynced) {
87
+ this._isSynced = false;
88
+ (_d = this.onSyncChange) == null ? void 0 : _d.call(this, false);
89
+ }
90
+ }
91
+ }
92
+ });
93
+ } catch (error) {
94
+ console.warn("[yjs] Error creating WebSocket provider:", error);
95
+ onError == null ? void 0 : onError(error instanceof Error ? error : new Error(String(error)));
96
+ }
97
+ }
98
+ get isConnected() {
99
+ return this._isConnected;
100
+ }
101
+ get isSynced() {
102
+ return this._isSynced;
103
+ }
104
+ getProvider() {
105
+ return this.provider;
106
+ }
107
+ }
108
+ export {
109
+ WebsocketProviderWrapper
110
+ };
111
+ //# sourceMappingURL=websocket.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.es.js","sources":["../../../../../src/modules/collaborative-editing/provider/websocket.ts"],"sourcesContent":["import type { ProviderEventHandlers } from '../types'\r\nimport type { UnifiedProvider } from './providerRegistry'\r\nimport { Awareness } from 'y-protocols/awareness'\r\nimport { WebsocketProvider } from 'y-websocket'\r\nimport * as Y from 'yjs'\r\n\r\nexport interface WebsocketProviderOptions {\r\n serverUrl: string\r\n roomName: string\r\n connect?: boolean\r\n awareness?: any\r\n params?: Record<string, string>\r\n protocols?: string[]\r\n WebSocketPolyfill?: typeof WebSocket\r\n resyncInterval?: number\r\n maxBackoffTime?: number\r\n disableBc?: boolean\r\n}\r\n\r\nexport class WebsocketProviderWrapper implements UnifiedProvider {\r\n private provider: WebsocketProvider\r\n\r\n private _isConnected = false\r\n private _isSynced = false\r\n\r\n onConnect?: () => void\r\n onDisconnect?: () => void\r\n onError?: (error: Error) => void\r\n onSyncChange?: (isSynced: boolean) => void\r\n\r\n document: Y.Doc\r\n awareness: Awareness\r\n type: 'websocket'\r\n\r\n connect = () => {\r\n try {\r\n this.provider.connect()\r\n }\r\n catch (error) {\r\n console.warn('[yjs] Error connecting WebSocket provider:', error)\r\n }\r\n }\r\n\r\n destroy = () => {\r\n try {\r\n this.provider.destroy()\r\n }\r\n catch (error) {\r\n console.warn('[yjs] Error destroying WebSocket provider:', error)\r\n }\r\n }\r\n\r\n disconnect = () => {\r\n try {\r\n this.provider.disconnect()\r\n const wasSynced = this._isSynced\r\n\r\n this._isConnected = false\r\n this._isSynced = false\r\n\r\n if (wasSynced) {\r\n this.onSyncChange?.(false)\r\n }\r\n }\r\n catch (error) {\r\n console.warn('[yjs] Error disconnecting WebSocket provider:', error)\r\n }\r\n }\r\n\r\n constructor({\r\n awareness,\r\n doc,\r\n options,\r\n onConnect,\r\n onDisconnect,\r\n onError,\r\n onSyncChange,\r\n }: {\r\n options: WebsocketProviderOptions\r\n awareness?: Awareness\r\n doc?: Y.Doc\r\n } & ProviderEventHandlers) {\r\n this.onConnect = onConnect\r\n this.onDisconnect = onDisconnect\r\n this.onError = onError\r\n this.onSyncChange = onSyncChange\r\n\r\n this.document = doc || new Y.Doc()\r\n this.awareness = awareness ?? new Awareness(this.document)\r\n try {\r\n this.provider = new WebsocketProvider(\r\n options.serverUrl,\r\n options.roomName,\r\n this.document,\r\n {\r\n awareness: this.awareness,\r\n ...options,\r\n },\r\n )\r\n\r\n this.provider.on('status', (event: { status: 'connected' | 'disconnected' | 'connecting' }) => {\r\n const wasConnected = this._isConnected\r\n this._isConnected = event.status === 'connected'\r\n\r\n if (event.status === 'connected') {\r\n if (!wasConnected) {\r\n this.onConnect?.()\r\n }\r\n if (!this._isSynced) {\r\n this._isSynced = true\r\n this.onSyncChange?.(true)\r\n }\r\n }\r\n else if (event.status === 'disconnected') {\r\n if (wasConnected) {\r\n this.onDisconnect?.()\r\n if (this._isSynced) {\r\n this._isSynced = false\r\n this.onSyncChange?.(false)\r\n }\r\n }\r\n }\r\n })\r\n }\r\n catch (error) {\r\n console.warn('[yjs] Error creating WebSocket provider:', error)\r\n onError?.(error instanceof Error ? error : new Error(String(error)))\r\n }\r\n }\r\n\r\n get isConnected() {\r\n return this._isConnected\r\n }\r\n\r\n get isSynced() {\r\n return this._isSynced\r\n }\r\n\r\n getProvider() {\r\n return this.provider\r\n }\r\n}\r\n"],"names":["Y.Doc"],"mappings":";;;;;;AAmBO,MAAM,yBAAoD;AAAA,EAkD/D,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAKyB;AA7DnB;AAEA,wCAAe;AACf,qCAAY;AAEpB;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA,mCAAU,MAAM;AACV,UAAA;AACF,aAAK,SAAS,QAAQ;AAAA,eAEjB,OAAO;AACJ,gBAAA,KAAK,8CAA8C,KAAK;AAAA,MAAA;AAAA,IAEpE;AAEA,mCAAU,MAAM;AACV,UAAA;AACF,aAAK,SAAS,QAAQ;AAAA,eAEjB,OAAO;AACJ,gBAAA,KAAK,8CAA8C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AA,EAGF,IAAI,cAAc;AAChB,WAAO,KAAK;AAAA,EAAA;AAAA,EAGd,IAAI,WAAW;AACb,WAAO,KAAK;AAAA,EAAA;AAAA,EAGd,cAAc;AACZ,WAAO,KAAK;AAAA,EAAA;AAEhB;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -7,7 +7,7 @@ const COPY = "copy";
7
7
  const DOWNLOAD = "download";
8
8
  const DefaultOptions = {
9
9
  // 默认情况下,`file://` 格式的本地文件路径在浏览器环境无法读取,因此会被转换成 `//:0`,但是在一些特殊的场景下(比如:Electron),需要获取到图片的原始路径,进行后续的上传处理
10
- // 注意:该选项一旦设置为 true,本次磁盘路径会暴露出去,这可能会带来安全风险,请确保你了解相关的安全隐患
10
+ // 注意:该选项一旦设置为 true,本地磁盘路径会暴露出去,这可能会带来安全风险,请确保你了解相关的安全隐患
11
11
  allowInvalidUrl: false,
12
12
  specs: [
13
13
  ImageSpec
@@ -1 +1 @@
1
- {"version":3,"file":"options.es.js","sources":["../../../../src/modules/custom-image/options.ts"],"sourcesContent":["import type { ImageToolbar, ImageToolbarButtons } from './actions'\r\nimport type { BlotSpec } from './specs'\r\nimport { ImageSpec } from './specs'\r\n\r\nexport interface OverlayOptions {\r\n // classname applied to the overlay element\r\n className: string\r\n // style applied to overlay element, or null to prevent styles\r\n style: Record<string, string>\r\n}\r\n\r\nexport interface ResizeOptions {\r\n // class name applied to the resize handles\r\n handleClassName: string\r\n // style applied to resize handles, or null to prevent styles\r\n handleStyle: Record<string, string>\r\n}\r\n\r\nexport interface ToolButtonOption {\r\n name: string\r\n icon: string\r\n isActive?: (el: HTMLElement) => boolean\r\n apply: (this: ImageToolbar, el: HTMLImageElement, toolbarButtons: ImageToolbarButtons) => void\r\n}\r\n\r\nexport interface ToolbarButtonOptions {\r\n buttons: Record<string, ToolButtonOption | boolean>\r\n}\r\n\r\nexport interface ToolbarOptions extends ToolbarButtonOptions {\r\n // class name applied to the root toolbar element\r\n mainClassName: string\r\n // style applied to root toolbar element, or null to prevent styles\r\n mainStyle: Record<string, unknown>\r\n // class name applied to each button in the toolbar\r\n buttonClassName: string\r\n /* whether or not to add the selected style to the buttons.\r\n they'll always get the is-selected class */\r\n addButtonSelectStyle: boolean\r\n // style applied to buttons, or null to prevent styles\r\n buttonStyle: Record<string, unknown>\r\n // style applied to the svgs in the buttons\r\n svgStyle: Record<string, unknown>\r\n}\r\n\r\nexport interface BlotFormatterOptionsInput {\r\n specs: typeof BlotSpec[]\r\n overlay: Partial<OverlayOptions>\r\n resize: Partial<ResizeOptions>\r\n toolbar: Partial<ToolbarOptions>\r\n}\r\nexport interface BlotFormatterOptions {\r\n specs: typeof BlotSpec[]\r\n overlay: OverlayOptions\r\n resize: ResizeOptions\r\n toolbar: ToolbarOptions\r\n allowInvalidUrl: boolean\r\n}\r\n\r\nexport const LEFT_ALIGN = 'align-left'\r\nexport const CENTER_ALIGN = 'align-center'\r\nexport const RIGHT_ALIGN = 'align-right'\r\nexport const COPY = 'copy'\r\nexport const DOWNLOAD = 'download'\r\nconst DefaultOptions: BlotFormatterOptions = {\r\n // 默认情况下,`file://` 格式的本地文件路径在浏览器环境无法读取,因此会被转换成 `//:0`,但是在一些特殊的场景下(比如:Electron),需要获取到图片的原始路径,进行后续的上传处理\r\n // 注意:该选项一旦设置为 true,本次磁盘路径会暴露出去,这可能会带来安全风险,请确保你了解相关的安全隐患\r\n allowInvalidUrl: false,\r\n\r\n specs: [\r\n ImageSpec,\r\n ],\r\n overlay: {\r\n className: 'blot-formatter__overlay',\r\n style: {\r\n position: 'absolute',\r\n boxSizing: 'border-box',\r\n border: '1px dashed #444',\r\n },\r\n },\r\n toolbar: {\r\n mainClassName: 'blot-formatter__toolbar',\r\n mainStyle: {\r\n position: 'absolute',\r\n top: '-12px',\r\n right: '0',\r\n left: '0',\r\n height: '0',\r\n minWidth: '120px',\r\n font: '12px/1.0 Arial, Helvetica, sans-serif',\r\n textAlign: 'center',\r\n color: '#333',\r\n boxSizing: 'border-box',\r\n cursor: 'default',\r\n zIndex: '1',\r\n },\r\n buttonClassName: 'blot-formatter__toolbar-button',\r\n addButtonSelectStyle: true,\r\n buttonStyle: {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n width: '24px',\r\n height: '24px',\r\n background: 'white',\r\n border: '1px solid #999',\r\n verticalAlign: 'middle',\r\n cursor: 'pointer',\r\n },\r\n svgStyle: {\r\n display: 'inline-block',\r\n width: '16px',\r\n height: '16px',\r\n background: 'white',\r\n verticalAlign: 'middle',\r\n },\r\n buttons: {\r\n [LEFT_ALIGN]: true,\r\n [CENTER_ALIGN]: true,\r\n [RIGHT_ALIGN]: true,\r\n [COPY]: true,\r\n [DOWNLOAD]: true,\r\n },\r\n },\r\n resize: {\r\n handleClassName: 'blot-formatter__resize-handle',\r\n handleStyle: {\r\n position: 'absolute',\r\n height: '12px',\r\n width: '12px',\r\n backgroundColor: 'white',\r\n border: '1px solid #777',\r\n boxSizing: 'border-box',\r\n opacity: '0.80',\r\n },\r\n },\r\n}\r\n\r\nexport default DefaultOptions\r\n"],"names":[],"mappings":";;AA2DO,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,OAAO;AACb,MAAM,WAAW;AACxB,MAAM,iBAAuC;AAAA;AAAA;AAAA,EAG3C,iBAAiB;AAAA,EAEjB,OAAO;AAAA,IACL;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,OAAO;AAAA,MACL,UAAU;AAAA,MACV,WAAW;AAAA,MACX,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,SAAS;AAAA,IACP,eAAe;AAAA,IACf,WAAW;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,IACA,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,aAAa;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,QAAQ;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,eAAe;AAAA,IACjB;AAAA,IACA,SAAS;AAAA,MACP,CAAC,UAAU,GAAG;AAAA,MACd,CAAC,YAAY,GAAG;AAAA,MAChB,CAAC,WAAW,GAAG;AAAA,MACf,CAAC,IAAI,GAAG;AAAA,MACR,CAAC,QAAQ,GAAG;AAAA,IAAA;AAAA,EAEhB;AAAA,EACA,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAa;AAAA,MACX,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
1
+ {"version":3,"file":"options.es.js","sources":["../../../../src/modules/custom-image/options.ts"],"sourcesContent":["import type { ImageToolbar, ImageToolbarButtons } from './actions'\r\nimport type { BlotSpec } from './specs'\r\nimport { ImageSpec } from './specs'\r\n\r\nexport interface OverlayOptions {\r\n // classname applied to the overlay element\r\n className: string\r\n // style applied to overlay element, or null to prevent styles\r\n style: Record<string, string>\r\n}\r\n\r\nexport interface ResizeOptions {\r\n // class name applied to the resize handles\r\n handleClassName: string\r\n // style applied to resize handles, or null to prevent styles\r\n handleStyle: Record<string, string>\r\n}\r\n\r\nexport interface ToolButtonOption {\r\n name: string\r\n icon: string\r\n isActive?: (el: HTMLElement) => boolean\r\n apply: (this: ImageToolbar, el: HTMLImageElement, toolbarButtons: ImageToolbarButtons) => void\r\n}\r\n\r\nexport interface ToolbarButtonOptions {\r\n buttons: Record<string, ToolButtonOption | boolean>\r\n}\r\n\r\nexport interface ToolbarOptions extends ToolbarButtonOptions {\r\n // class name applied to the root toolbar element\r\n mainClassName: string\r\n // style applied to root toolbar element, or null to prevent styles\r\n mainStyle: Record<string, unknown>\r\n // class name applied to each button in the toolbar\r\n buttonClassName: string\r\n /* whether or not to add the selected style to the buttons.\r\n they'll always get the is-selected class */\r\n addButtonSelectStyle: boolean\r\n // style applied to buttons, or null to prevent styles\r\n buttonStyle: Record<string, unknown>\r\n // style applied to the svgs in the buttons\r\n svgStyle: Record<string, unknown>\r\n}\r\n\r\nexport interface BlotFormatterOptionsInput {\r\n specs: typeof BlotSpec[]\r\n overlay: Partial<OverlayOptions>\r\n resize: Partial<ResizeOptions>\r\n toolbar: Partial<ToolbarOptions>\r\n}\r\nexport interface BlotFormatterOptions {\r\n specs: typeof BlotSpec[]\r\n overlay: OverlayOptions\r\n resize: ResizeOptions\r\n toolbar: ToolbarOptions\r\n allowInvalidUrl: boolean\r\n}\r\n\r\nexport const LEFT_ALIGN = 'align-left'\r\nexport const CENTER_ALIGN = 'align-center'\r\nexport const RIGHT_ALIGN = 'align-right'\r\nexport const COPY = 'copy'\r\nexport const DOWNLOAD = 'download'\r\nconst DefaultOptions: BlotFormatterOptions = {\r\n // 默认情况下,`file://` 格式的本地文件路径在浏览器环境无法读取,因此会被转换成 `//:0`,但是在一些特殊的场景下(比如:Electron),需要获取到图片的原始路径,进行后续的上传处理\r\n // 注意:该选项一旦设置为 true,本地磁盘路径会暴露出去,这可能会带来安全风险,请确保你了解相关的安全隐患\r\n allowInvalidUrl: false,\r\n\r\n specs: [\r\n ImageSpec,\r\n ],\r\n overlay: {\r\n className: 'blot-formatter__overlay',\r\n style: {\r\n position: 'absolute',\r\n boxSizing: 'border-box',\r\n border: '1px dashed #444',\r\n },\r\n },\r\n toolbar: {\r\n mainClassName: 'blot-formatter__toolbar',\r\n mainStyle: {\r\n position: 'absolute',\r\n top: '-12px',\r\n right: '0',\r\n left: '0',\r\n height: '0',\r\n minWidth: '120px',\r\n font: '12px/1.0 Arial, Helvetica, sans-serif',\r\n textAlign: 'center',\r\n color: '#333',\r\n boxSizing: 'border-box',\r\n cursor: 'default',\r\n zIndex: '1',\r\n },\r\n buttonClassName: 'blot-formatter__toolbar-button',\r\n addButtonSelectStyle: true,\r\n buttonStyle: {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n width: '24px',\r\n height: '24px',\r\n background: 'white',\r\n border: '1px solid #999',\r\n verticalAlign: 'middle',\r\n cursor: 'pointer',\r\n },\r\n svgStyle: {\r\n display: 'inline-block',\r\n width: '16px',\r\n height: '16px',\r\n background: 'white',\r\n verticalAlign: 'middle',\r\n },\r\n buttons: {\r\n [LEFT_ALIGN]: true,\r\n [CENTER_ALIGN]: true,\r\n [RIGHT_ALIGN]: true,\r\n [COPY]: true,\r\n [DOWNLOAD]: true,\r\n },\r\n },\r\n resize: {\r\n handleClassName: 'blot-formatter__resize-handle',\r\n handleStyle: {\r\n position: 'absolute',\r\n height: '12px',\r\n width: '12px',\r\n backgroundColor: 'white',\r\n border: '1px solid #777',\r\n boxSizing: 'border-box',\r\n opacity: '0.80',\r\n },\r\n },\r\n}\r\n\r\nexport default DefaultOptions\r\n"],"names":[],"mappings":";;AA2DO,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,OAAO;AACb,MAAM,WAAW;AACxB,MAAM,iBAAuC;AAAA;AAAA;AAAA,EAG3C,iBAAiB;AAAA,EAEjB,OAAO;AAAA,IACL;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,OAAO;AAAA,MACL,UAAU;AAAA,MACV,WAAW;AAAA,MACX,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,SAAS;AAAA,IACP,eAAe;AAAA,IACf,WAAW;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,IACA,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,aAAa;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,QAAQ;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,eAAe;AAAA,IACjB;AAAA,IACA,SAAS;AAAA,MACP,CAAC,UAAU,GAAG;AAAA,MACd,CAAC,YAAY,GAAG;AAAA,MAChB,CAAC,WAAW,GAAG;AAAA,MACf,CAAC,IAAI,GAAG;AAAA,MACR,CAAC,QAAQ,GAAG;AAAA,IAAA;AAAA,EAEhB;AAAA,EACA,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAa;AAAA,MACX,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
@@ -1,3 +1,4 @@
1
+ import "./collaborative-editing/index.es.js";
1
2
  import "./counter.es.js";
2
3
  import { CustomClipboard } from "./custom-clipboard.es.js";
3
4
  import "./custom-image/index.es.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,112 @@
1
+ import { from as from$1, create as create$1 } from "./set.es.js";
2
+ const last = (arr) => arr[arr.length - 1];
3
+ const create = () => (
4
+ /** @type {Array<C>} */
5
+ []
6
+ );
7
+ const copy = (a) => (
8
+ /** @type {Array<D>} */
9
+ a.slice()
10
+ );
11
+ const appendTo = (dest, src) => {
12
+ for (let i = 0; i < src.length; i++) {
13
+ dest.push(src[i]);
14
+ }
15
+ };
16
+ const from = Array.from;
17
+ const every = (arr, f) => {
18
+ for (let i = 0; i < arr.length; i++) {
19
+ if (!f(arr[i], i, arr)) {
20
+ return false;
21
+ }
22
+ }
23
+ return true;
24
+ };
25
+ const some = (arr, f) => {
26
+ for (let i = 0; i < arr.length; i++) {
27
+ if (f(arr[i], i, arr)) {
28
+ return true;
29
+ }
30
+ }
31
+ return false;
32
+ };
33
+ const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index]);
34
+ const flatten = (arr) => fold(
35
+ arr,
36
+ /** @type {Array<ELEM>} */
37
+ [],
38
+ (acc, val) => acc.concat(val)
39
+ );
40
+ const unfold = (len, f) => {
41
+ const array = new Array(len);
42
+ for (let i = 0; i < len; i++) {
43
+ array[i] = f(i, array);
44
+ }
45
+ return array;
46
+ };
47
+ const fold = (arr, seed, folder) => arr.reduce(folder, seed);
48
+ const isArray = Array.isArray;
49
+ const unique = (arr) => from(from$1(arr));
50
+ const uniqueBy = (arr, mapper) => {
51
+ const happened = create$1();
52
+ const result = [];
53
+ for (let i = 0; i < arr.length; i++) {
54
+ const el = arr[i];
55
+ const mapped = mapper(el);
56
+ if (!happened.has(mapped)) {
57
+ happened.add(mapped);
58
+ result.push(el);
59
+ }
60
+ }
61
+ return result;
62
+ };
63
+ const map = (arr, mapper) => {
64
+ const res = Array(arr.length);
65
+ for (let i = 0; i < arr.length; i++) {
66
+ res[i] = mapper(
67
+ /** @type {any} */
68
+ arr[i],
69
+ i,
70
+ /** @type {any} */
71
+ arr
72
+ );
73
+ }
74
+ return (
75
+ /** @type {any} */
76
+ res
77
+ );
78
+ };
79
+ const bubblesortItem = (arr, i, compareFn) => {
80
+ const n = arr[i];
81
+ let j = i;
82
+ while (j + 1 < arr.length && compareFn(n, arr[j + 1]) > 0) {
83
+ arr[j] = arr[j + 1];
84
+ arr[++j] = n;
85
+ }
86
+ if (i === j && j > 0) {
87
+ while (j > 0 && compareFn(arr[j - 1], n) > 0) {
88
+ arr[j] = arr[j - 1];
89
+ arr[--j] = n;
90
+ }
91
+ }
92
+ return j;
93
+ };
94
+ export {
95
+ appendTo,
96
+ bubblesortItem,
97
+ copy,
98
+ create,
99
+ equalFlat,
100
+ every,
101
+ flatten,
102
+ fold,
103
+ from,
104
+ isArray,
105
+ last,
106
+ map,
107
+ some,
108
+ unfold,
109
+ unique,
110
+ uniqueBy
111
+ };
112
+ //# sourceMappingURL=array.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.es.js","sources":["../../../../../../../../../node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/array.js"],"sourcesContent":["/**\n * Utility module to work with Arrays.\n *\n * @module array\n */\n\nimport * as set from './set.js'\n\n/**\n * Return the last element of an array. The element must exist\n *\n * @template L\n * @param {ArrayLike<L>} arr\n * @return {L}\n */\nexport const last = arr => arr[arr.length - 1]\n\n/**\n * @template C\n * @return {Array<C>}\n */\nexport const create = () => /** @type {Array<C>} */ ([])\n\n/**\n * @template D\n * @param {Array<D>} a\n * @return {Array<D>}\n */\nexport const copy = a => /** @type {Array<D>} */ (a.slice())\n\n/**\n * Append elements from src to dest\n *\n * @template M\n * @param {Array<M>} dest\n * @param {Array<M>} src\n */\nexport const appendTo = (dest, src) => {\n for (let i = 0; i < src.length; i++) {\n dest.push(src[i])\n }\n}\n\n/**\n * Transforms something array-like to an actual Array.\n *\n * @function\n * @template T\n * @param {ArrayLike<T>|Iterable<T>} arraylike\n * @return {T}\n */\nexport const from = Array.from\n\n/**\n * True iff condition holds on every element in the Array.\n *\n * @function\n * @template {ArrayLike<any>} ARR\n *\n * @param {ARR} arr\n * @param {ARR extends ArrayLike<infer S> ? ((value:S, index:number, arr:ARR) => boolean) : any} f\n * @return {boolean}\n */\nexport const every = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (!f(arr[i], i, arr)) {\n return false\n }\n }\n return true\n}\n\n/**\n * True iff condition holds on some element in the Array.\n *\n * @function\n * @template {ArrayLike<any>} ARR\n *\n * @param {ARR} arr\n * @param {ARR extends ArrayLike<infer S> ? ((value:S, index:number, arr:ARR) => boolean) : never} f\n * @return {boolean}\n */\nexport const some = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (f(arr[i], i, arr)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @template ELEM\n *\n * @param {ArrayLike<ELEM>} a\n * @param {ArrayLike<ELEM>} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index])\n\n/**\n * @template ELEM\n * @param {Array<Array<ELEM>>} arr\n * @return {Array<ELEM>}\n */\nexport const flatten = arr => fold(arr, /** @type {Array<ELEM>} */ ([]), (acc, val) => acc.concat(val))\n\n/**\n * @template T\n * @param {number} len\n * @param {function(number, Array<T>):T} f\n * @return {Array<T>}\n */\nexport const unfold = (len, f) => {\n const array = new Array(len)\n for (let i = 0; i < len; i++) {\n array[i] = f(i, array)\n }\n return array\n}\n\n/**\n * @template T\n * @template RESULT\n * @param {Array<T>} arr\n * @param {RESULT} seed\n * @param {function(RESULT, T, number):RESULT} folder\n */\nexport const fold = (arr, seed, folder) => arr.reduce(folder, seed)\n\nexport const isArray = Array.isArray\n\n/**\n * @template T\n * @param {Array<T>} arr\n * @return {Array<T>}\n */\nexport const unique = arr => from(set.from(arr))\n\n/**\n * @template T\n * @template M\n * @param {ArrayLike<T>} arr\n * @param {function(T):M} mapper\n * @return {Array<T>}\n */\nexport const uniqueBy = (arr, mapper) => {\n /**\n * @type {Set<M>}\n */\n const happened = set.create()\n /**\n * @type {Array<T>}\n */\n const result = []\n for (let i = 0; i < arr.length; i++) {\n const el = arr[i]\n const mapped = mapper(el)\n if (!happened.has(mapped)) {\n happened.add(mapped)\n result.push(el)\n }\n }\n return result\n}\n\n/**\n * @template {ArrayLike<any>} ARR\n * @template {function(ARR extends ArrayLike<infer T> ? T : never, number, ARR):any} MAPPER\n * @param {ARR} arr\n * @param {MAPPER} mapper\n * @return {Array<MAPPER extends function(...any): infer M ? M : never>}\n */\nexport const map = (arr, mapper) => {\n /**\n * @type {Array<any>}\n */\n const res = Array(arr.length)\n for (let i = 0; i < arr.length; i++) {\n res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr))\n }\n return /** @type {any} */ (res)\n}\n\n/**\n * This function bubble-sorts a single item to the correct position. The sort happens in-place and\n * might be useful to ensure that a single item is at the correct position in an otherwise sorted\n * array.\n *\n * @example\n * const arr = [3, 2, 5]\n * arr.sort((a, b) => a - b)\n * arr // => [2, 3, 5]\n * arr.splice(1, 0, 7)\n * array.bubbleSortItem(arr, 1, (a, b) => a - b)\n * arr // => [2, 3, 5, 7]\n *\n * @template T\n * @param {Array<T>} arr\n * @param {number} i\n * @param {(a:T,b:T) => number} compareFn\n */\nexport const bubblesortItem = (arr, i, compareFn) => {\n const n = arr[i]\n let j = i\n // try to sort to the right\n while (j + 1 < arr.length && compareFn(n, arr[j + 1]) > 0) {\n arr[j] = arr[j + 1]\n arr[++j] = n\n }\n if (i === j && j > 0) { // no change yet\n // sort to the left\n while (j > 0 && compareFn(arr[j - 1], n) > 0) {\n arr[j] = arr[j - 1]\n arr[--j] = n\n }\n }\n return j\n}\n"],"names":["set.from","set.create"],"mappings":";AAeY,MAAC,OAAO,SAAO,IAAI,IAAI,SAAS,CAAC;AAMjC,MAAC,SAAS;AAAA;AAAA,EAA+B,CAAE;AAAA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512;
11
+ const BIT11 = 1024;
12
+ const BIT12 = 2048;
13
+ const BIT13 = 4096;
14
+ const BIT14 = 8192;
15
+ const BIT15 = 16384;
16
+ const BIT16 = 32768;
17
+ const BIT17 = 65536;
18
+ const BIT18 = 1 << 17;
19
+ const BIT19 = 1 << 18;
20
+ const BIT20 = 1 << 19;
21
+ const BIT21 = 1 << 20;
22
+ const BIT22 = 1 << 21;
23
+ const BIT23 = 1 << 22;
24
+ const BIT24 = 1 << 23;
25
+ const BIT25 = 1 << 24;
26
+ const BIT26 = 1 << 25;
27
+ const BIT27 = 1 << 26;
28
+ const BIT28 = 1 << 27;
29
+ const BIT29 = 1 << 28;
30
+ const BIT30 = 1 << 29;
31
+ const BIT31 = 1 << 30;
32
+ const BIT32 = 1 << 31;
33
+ const BITS0 = 0;
34
+ const BITS1 = 1;
35
+ const BITS2 = 3;
36
+ const BITS3 = 7;
37
+ const BITS4 = 15;
38
+ const BITS5 = 31;
39
+ const BITS6 = 63;
40
+ const BITS7 = 127;
41
+ const BITS8 = 255;
42
+ const BITS9 = 511;
43
+ const BITS10 = 1023;
44
+ const BITS11 = 2047;
45
+ const BITS12 = 4095;
46
+ const BITS13 = 8191;
47
+ const BITS14 = 16383;
48
+ const BITS15 = 32767;
49
+ const BITS16 = 65535;
50
+ const BITS17 = BIT18 - 1;
51
+ const BITS18 = BIT19 - 1;
52
+ const BITS19 = BIT20 - 1;
53
+ const BITS20 = BIT21 - 1;
54
+ const BITS21 = BIT22 - 1;
55
+ const BITS22 = BIT23 - 1;
56
+ const BITS23 = BIT24 - 1;
57
+ const BITS24 = BIT25 - 1;
58
+ const BITS25 = BIT26 - 1;
59
+ const BITS26 = BIT27 - 1;
60
+ const BITS27 = BIT28 - 1;
61
+ const BITS28 = BIT29 - 1;
62
+ const BITS29 = BIT30 - 1;
63
+ const BITS30 = BIT31 - 1;
64
+ const BITS31 = 2147483647;
65
+ const BITS32 = 4294967295;
66
+ export {
67
+ BIT1,
68
+ BIT10,
69
+ BIT11,
70
+ BIT12,
71
+ BIT13,
72
+ BIT14,
73
+ BIT15,
74
+ BIT16,
75
+ BIT17,
76
+ BIT18,
77
+ BIT19,
78
+ BIT2,
79
+ BIT20,
80
+ BIT21,
81
+ BIT22,
82
+ BIT23,
83
+ BIT24,
84
+ BIT25,
85
+ BIT26,
86
+ BIT27,
87
+ BIT28,
88
+ BIT29,
89
+ BIT3,
90
+ BIT30,
91
+ BIT31,
92
+ BIT32,
93
+ BIT4,
94
+ BIT5,
95
+ BIT6,
96
+ BIT7,
97
+ BIT8,
98
+ BIT9,
99
+ BITS0,
100
+ BITS1,
101
+ BITS10,
102
+ BITS11,
103
+ BITS12,
104
+ BITS13,
105
+ BITS14,
106
+ BITS15,
107
+ BITS16,
108
+ BITS17,
109
+ BITS18,
110
+ BITS19,
111
+ BITS2,
112
+ BITS20,
113
+ BITS21,
114
+ BITS22,
115
+ BITS23,
116
+ BITS24,
117
+ BITS25,
118
+ BITS26,
119
+ BITS27,
120
+ BITS28,
121
+ BITS29,
122
+ BITS3,
123
+ BITS30,
124
+ BITS31,
125
+ BITS32,
126
+ BITS4,
127
+ BITS5,
128
+ BITS6,
129
+ BITS7,
130
+ BITS8,
131
+ BITS9
132
+ };
133
+ //# sourceMappingURL=binary.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary.es.js","sources":["../../../../../../../../../node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/binary.js"],"sourcesContent":["/* eslint-env browser */\n\n/**\n * Binary data constants.\n *\n * @module binary\n */\n\n/**\n * n-th bit activated.\n *\n * @type {number}\n */\nexport const BIT1 = 1\nexport const BIT2 = 2\nexport const BIT3 = 4\nexport const BIT4 = 8\nexport const BIT5 = 16\nexport const BIT6 = 32\nexport const BIT7 = 64\nexport const BIT8 = 128\nexport const BIT9 = 256\nexport const BIT10 = 512\nexport const BIT11 = 1024\nexport const BIT12 = 2048\nexport const BIT13 = 4096\nexport const BIT14 = 8192\nexport const BIT15 = 16384\nexport const BIT16 = 32768\nexport const BIT17 = 65536\nexport const BIT18 = 1 << 17\nexport const BIT19 = 1 << 18\nexport const BIT20 = 1 << 19\nexport const BIT21 = 1 << 20\nexport const BIT22 = 1 << 21\nexport const BIT23 = 1 << 22\nexport const BIT24 = 1 << 23\nexport const BIT25 = 1 << 24\nexport const BIT26 = 1 << 25\nexport const BIT27 = 1 << 26\nexport const BIT28 = 1 << 27\nexport const BIT29 = 1 << 28\nexport const BIT30 = 1 << 29\nexport const BIT31 = 1 << 30\nexport const BIT32 = 1 << 31\n\n/**\n * First n bits activated.\n *\n * @type {number}\n */\nexport const BITS0 = 0\nexport const BITS1 = 1\nexport const BITS2 = 3\nexport const BITS3 = 7\nexport const BITS4 = 15\nexport const BITS5 = 31\nexport const BITS6 = 63\nexport const BITS7 = 127\nexport const BITS8 = 255\nexport const BITS9 = 511\nexport const BITS10 = 1023\nexport const BITS11 = 2047\nexport const BITS12 = 4095\nexport const BITS13 = 8191\nexport const BITS14 = 16383\nexport const BITS15 = 32767\nexport const BITS16 = 65535\nexport const BITS17 = BIT18 - 1\nexport const BITS18 = BIT19 - 1\nexport const BITS19 = BIT20 - 1\nexport const BITS20 = BIT21 - 1\nexport const BITS21 = BIT22 - 1\nexport const BITS22 = BIT23 - 1\nexport const BITS23 = BIT24 - 1\nexport const BITS24 = BIT25 - 1\nexport const BITS25 = BIT26 - 1\nexport const BITS26 = BIT27 - 1\nexport const BITS27 = BIT28 - 1\nexport const BITS28 = BIT29 - 1\nexport const BITS29 = BIT30 - 1\nexport const BITS30 = BIT31 - 1\n/**\n * @type {number}\n */\nexport const BITS31 = 0x7FFFFFFF\n/**\n * @type {number}\n */\nexport const BITS32 = 0xFFFFFFFF\n"],"names":[],"mappings":"AAaY,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC,OAAO;AACR,MAAC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IfUndefined } from "./map.es.js";
2
+ import { create } from "./set.es.js";
3
+ import { fromBase64, toBase64, createUint8ArrayFromArrayBuffer } from "./buffer.es.js";
4
+ import { onChange, varStorage, offChange } from "./storage.es.js";
5
+ const channels = /* @__PURE__ */ new Map();
6
+ class LocalStoragePolyfill {
7
+ /**
8
+ * @param {string} room
9
+ */
10
+ constructor(room) {
11
+ this.room = room;
12
+ this.onmessage = null;
13
+ this._onChange = (e) => e.key === room && this.onmessage !== null && this.onmessage({ data: fromBase64(e.newValue || "") });
14
+ onChange(this._onChange);
15
+ }
16
+ /**
17
+ * @param {ArrayBuffer} buf
18
+ */
19
+ postMessage(buf) {
20
+ varStorage.setItem(this.room, toBase64(createUint8ArrayFromArrayBuffer(buf)));
21
+ }
22
+ close() {
23
+ offChange(this._onChange);
24
+ }
25
+ }
26
+ const BC = typeof BroadcastChannel === "undefined" ? LocalStoragePolyfill : BroadcastChannel;
27
+ const getChannel = (room) => setIfUndefined(channels, room, () => {
28
+ const subs = create();
29
+ const bc = new BC(room);
30
+ bc.onmessage = (e) => subs.forEach((sub) => sub(e.data, "broadcastchannel"));
31
+ return {
32
+ bc,
33
+ subs
34
+ };
35
+ });
36
+ const subscribe = (room, f) => {
37
+ getChannel(room).subs.add(f);
38
+ return f;
39
+ };
40
+ const unsubscribe = (room, f) => {
41
+ const channel = getChannel(room);
42
+ const unsubscribed = channel.subs.delete(f);
43
+ if (unsubscribed && channel.subs.size === 0) {
44
+ channel.bc.close();
45
+ channels.delete(room);
46
+ }
47
+ return unsubscribed;
48
+ };
49
+ const publish = (room, data, origin = null) => {
50
+ const c = getChannel(room);
51
+ c.bc.postMessage(data);
52
+ c.subs.forEach((sub) => sub(data, origin));
53
+ };
54
+ export {
55
+ publish,
56
+ subscribe,
57
+ unsubscribe
58
+ };
59
+ //# sourceMappingURL=broadcastchannel.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcastchannel.es.js","sources":["../../../../../../../../../node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/broadcastchannel.js"],"sourcesContent":["/* eslint-env browser */\n\n/**\n * Helpers for cross-tab communication using broadcastchannel with LocalStorage fallback.\n *\n * ```js\n * // In browser window A:\n * broadcastchannel.subscribe('my events', data => console.log(data))\n * broadcastchannel.publish('my events', 'Hello world!') // => A: 'Hello world!' fires synchronously in same tab\n *\n * // In browser window B:\n * broadcastchannel.publish('my events', 'hello from tab B') // => A: 'hello from tab B'\n * ```\n *\n * @module broadcastchannel\n */\n\n// @todo before next major: use Uint8Array instead as buffer object\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as buffer from './buffer.js'\nimport * as storage from './storage.js'\n\n/**\n * @typedef {Object} Channel\n * @property {Set<function(any, any):any>} Channel.subs\n * @property {any} Channel.bc\n */\n\n/**\n * @type {Map<string, Channel>}\n */\nconst channels = new Map()\n\n/* c8 ignore start */\nclass LocalStoragePolyfill {\n /**\n * @param {string} room\n */\n constructor (room) {\n this.room = room\n /**\n * @type {null|function({data:ArrayBuffer}):void}\n */\n this.onmessage = null\n /**\n * @param {any} e\n */\n this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') })\n storage.onChange(this._onChange)\n }\n\n /**\n * @param {ArrayBuffer} buf\n */\n postMessage (buf) {\n storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)))\n }\n\n close () {\n storage.offChange(this._onChange)\n }\n}\n/* c8 ignore stop */\n\n// Use BroadcastChannel or Polyfill\n/* c8 ignore next */\nconst BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel\n\n/**\n * @param {string} room\n * @return {Channel}\n */\nconst getChannel = room =>\n map.setIfUndefined(channels, room, () => {\n const subs = set.create()\n const bc = new BC(room)\n /**\n * @param {{data:ArrayBuffer}} e\n */\n /* c8 ignore next */\n bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'))\n return {\n bc, subs\n }\n })\n\n/**\n * Subscribe to global `publish` events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const subscribe = (room, f) => {\n getChannel(room).subs.add(f)\n return f\n}\n\n/**\n * Unsubscribe from `publish` global events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const unsubscribe = (room, f) => {\n const channel = getChannel(room)\n const unsubscribed = channel.subs.delete(f)\n if (unsubscribed && channel.subs.size === 0) {\n channel.bc.close()\n channels.delete(room)\n }\n return unsubscribed\n}\n\n/**\n * Publish data to all subscribers (including subscribers on this tab)\n *\n * @function\n * @param {string} room\n * @param {any} data\n * @param {any} [origin]\n */\nexport const publish = (room, data, origin = null) => {\n const c = getChannel(room)\n c.bc.postMessage(data)\n c.subs.forEach(sub => sub(data, origin))\n}\n"],"names":["buffer.fromBase64","storage.onChange","storage.varStorage","buffer.toBase64","buffer.createUint8ArrayFromArrayBuffer","storage.offChange","map.setIfUndefined","set.create"],"mappings":";;;;AAiCA,MAAM,WAAW,oBAAI,IAAG;AAGxB,MAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA,EAIzB,YAAa,MAAM;AACjB,SAAK,OAAO;AAIZ,SAAK,YAAY;AAIjB,SAAK,YAAY,OAAK,EAAE,QAAQ,QAAQ,KAAK,cAAc,QAAQ,KAAK,UAAU,EAAE,MAAMA,WAAkB,EAAE,YAAY,EAAE,EAAG,CAAA;AAC/HC,aAAiB,KAAK,SAAS;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA,EAKE,YAAa,KAAK;AAChBC,eAAmB,QAAQ,KAAK,MAAMC,SAAgBC,gCAAuC,GAAG,CAAC,CAAC;AAAA,EACtG;AAAA,EAEE,QAAS;AACPC,cAAkB,KAAK,SAAS;AAAA,EACpC;AACA;AAKA,MAAM,KAAK,OAAO,qBAAqB,cAAc,uBAAuB;AAM5E,MAAM,aAAa,UACjBC,eAAmB,UAAU,MAAM,MAAM;AACvC,QAAM,OAAOC,OAAU;AACvB,QAAM,KAAK,IAAI,GAAG,IAAI;AAKtB,KAAG,YAAY,OAAK,KAAK,QAAQ,SAAO,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACvE,SAAO;AAAA,IACL;AAAA,IAAI;AAAA,EACV;AACG,CAAA;AASS,MAAC,YAAY,CAAC,MAAM,MAAM;AACpC,aAAW,IAAI,EAAE,KAAK,IAAI,CAAC;AAC3B,SAAO;AACT;AASY,MAAC,cAAc,CAAC,MAAM,MAAM;AACtC,QAAM,UAAU,WAAW,IAAI;AAC/B,QAAM,eAAe,QAAQ,KAAK,OAAO,CAAC;AAC1C,MAAI,gBAAgB,QAAQ,KAAK,SAAS,GAAG;AAC3C,YAAQ,GAAG,MAAK;AAChB,aAAS,OAAO,IAAI;AAAA,EACxB;AACE,SAAO;AACT;AAUY,MAAC,UAAU,CAAC,MAAM,MAAM,SAAS,SAAS;AACpD,QAAM,IAAI,WAAW,IAAI;AACzB,IAAE,GAAG,YAAY,IAAI;AACrB,IAAE,KAAK,QAAQ,SAAO,IAAI,MAAM,MAAM,CAAC;AACzC;","x_google_ignoreList":[0]}
@@ -0,0 +1,75 @@
1
+ import { fromCharCode } from "./string.es.js";
2
+ import { isBrowser } from "./environment.es.js";
3
+ import { map } from "./array.es.js";
4
+ import { ceil } from "./math.es.js";
5
+ import { encode, writeAny } from "./encoding.es.js";
6
+ import { readAny, createDecoder } from "./decoding.es.js";
7
+ const createUint8ArrayFromLen = (len) => new Uint8Array(len);
8
+ const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length);
9
+ const createUint8ArrayFromArrayBuffer = (buffer) => new Uint8Array(buffer);
10
+ const toBase64Browser = (bytes) => {
11
+ let s = "";
12
+ for (let i = 0; i < bytes.byteLength; i++) {
13
+ s += fromCharCode(bytes[i]);
14
+ }
15
+ return btoa(s);
16
+ };
17
+ const toBase64Node = (bytes) => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
18
+ const fromBase64Browser = (s) => {
19
+ const a = atob(s);
20
+ const bytes = createUint8ArrayFromLen(a.length);
21
+ for (let i = 0; i < a.length; i++) {
22
+ bytes[i] = a.charCodeAt(i);
23
+ }
24
+ return bytes;
25
+ };
26
+ const fromBase64Node = (s) => {
27
+ const buf = Buffer.from(s, "base64");
28
+ return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength);
29
+ };
30
+ const toBase64 = isBrowser ? toBase64Browser : toBase64Node;
31
+ const fromBase64 = isBrowser ? fromBase64Browser : fromBase64Node;
32
+ const toBase64UrlEncoded = (buf) => toBase64(buf).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
33
+ const fromBase64UrlEncoded = (base64) => fromBase64(base64.replaceAll("-", "+").replaceAll("_", "/"));
34
+ const toHexString = (buf) => map(buf, (b) => b.toString(16).padStart(2, "0")).join("");
35
+ const fromHexString = (hex) => {
36
+ const hlen = hex.length;
37
+ const buf = new Uint8Array(ceil(hlen / 2));
38
+ for (let i = 0; i < hlen; i += 2) {
39
+ buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16);
40
+ }
41
+ return buf;
42
+ };
43
+ const copyUint8Array = (uint8Array) => {
44
+ const newBuf = createUint8ArrayFromLen(uint8Array.byteLength);
45
+ newBuf.set(uint8Array);
46
+ return newBuf;
47
+ };
48
+ const encodeAny = (data) => encode((encoder) => writeAny(encoder, data));
49
+ const decodeAny = (buf) => readAny(createDecoder(buf));
50
+ const shiftNBitsLeft = (bs, N) => {
51
+ if (N === 0) return bs;
52
+ bs = new Uint8Array(bs);
53
+ bs[0] <<= N;
54
+ for (let i = 1; i < bs.length; i++) {
55
+ bs[i - 1] |= bs[i] >>> 8 - N;
56
+ bs[i] <<= N;
57
+ }
58
+ return bs;
59
+ };
60
+ export {
61
+ copyUint8Array,
62
+ createUint8ArrayFromArrayBuffer,
63
+ createUint8ArrayFromLen,
64
+ createUint8ArrayViewFromArrayBuffer,
65
+ decodeAny,
66
+ encodeAny,
67
+ fromBase64,
68
+ fromBase64UrlEncoded,
69
+ fromHexString,
70
+ shiftNBitsLeft,
71
+ toBase64,
72
+ toBase64UrlEncoded,
73
+ toHexString
74
+ };
75
+ //# sourceMappingURL=buffer.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.es.js","sources":["../../../../../../../../../node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/buffer.js"],"sourcesContent":["/**\n * Utility functions to work with buffers (Uint8Array).\n *\n * @module buffer\n */\n\nimport * as string from './string.js'\nimport * as env from './environment.js'\nimport * as array from './array.js'\nimport * as math from './math.js'\nimport * as encoding from './encoding.js'\nimport * as decoding from './decoding.js'\n\n/**\n * @param {number} len\n */\nexport const createUint8ArrayFromLen = len => new Uint8Array(len)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n * @param {number} byteOffset\n * @param {number} length\n */\nexport const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n */\nexport const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer)\n\n/* c8 ignore start */\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Browser = bytes => {\n let s = ''\n for (let i = 0; i < bytes.byteLength; i++) {\n s += string.fromCharCode(bytes[i])\n }\n // eslint-disable-next-line no-undef\n return btoa(s)\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64')\n\n/* c8 ignore start */\n/**\n * @param {string} s\n * @return {Uint8Array}\n */\nconst fromBase64Browser = s => {\n // eslint-disable-next-line no-undef\n const a = atob(s)\n const bytes = createUint8ArrayFromLen(a.length)\n for (let i = 0; i < a.length; i++) {\n bytes[i] = a.charCodeAt(i)\n }\n return bytes\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} s\n */\nconst fromBase64Node = s => {\n const buf = Buffer.from(s, 'base64')\n return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)\n}\n\n/* c8 ignore next */\nexport const toBase64 = env.isBrowser ? toBase64Browser : toBase64Node\n\n/* c8 ignore next */\nexport const fromBase64 = env.isBrowser ? fromBase64Browser : fromBase64Node\n\n/**\n * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5\n * @param {Uint8Array} buf\n */\nexport const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')\n\n/**\n * @param {string} base64\n */\nexport const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'))\n\n/**\n * Base64 is always a more efficient choice. This exists for utility purposes only.\n *\n * @param {Uint8Array} buf\n */\nexport const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('')\n\n/**\n * Note: This function expects that the hex doesn't start with 0x..\n *\n * @param {string} hex\n */\nexport const fromHexString = hex => {\n const hlen = hex.length\n const buf = new Uint8Array(math.ceil(hlen / 2))\n for (let i = 0; i < hlen; i += 2) {\n buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16)\n }\n return buf\n}\n\n/**\n * Copy the content of an Uint8Array view to a new ArrayBuffer.\n *\n * @param {Uint8Array} uint8Array\n * @return {Uint8Array}\n */\nexport const copyUint8Array = uint8Array => {\n const newBuf = createUint8ArrayFromLen(uint8Array.byteLength)\n newBuf.set(uint8Array)\n return newBuf\n}\n\n/**\n * Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.\n * See encoding.writeAny for more information.\n *\n * @param {any} data\n * @return {Uint8Array}\n */\nexport const encodeAny = data =>\n encoding.encode(encoder => encoding.writeAny(encoder, data))\n\n/**\n * Decode an any-encoded value.\n *\n * @param {Uint8Array} buf\n * @return {any}\n */\nexport const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf))\n\n/**\n * Shift Byte Array {N} bits to the left. Does not expand byte array.\n *\n * @param {Uint8Array} bs\n * @param {number} N should be in the range of [0-7]\n */\nexport const shiftNBitsLeft = (bs, N) => {\n if (N === 0) return bs\n bs = new Uint8Array(bs)\n bs[0] <<= N\n for (let i = 1; i < bs.length; i++) {\n bs[i - 1] |= bs[i] >>> (8 - N)\n bs[i] <<= N\n }\n return bs\n}\n"],"names":["string.fromCharCode","env.isBrowser","array.map","math.ceil","encoding.encode","encoding.writeAny","decoding.readAny","decoding.createDecoder"],"mappings":";;;;;;AAgBY,MAAC,0BAA0B,SAAO,IAAI,WAAW,GAAG;AASpD,MAAC,sCAAsC,CAAC,QAAQ,YAAY,WAAW,IAAI,WAAW,QAAQ,YAAY,MAAM;AAOhH,MAAC,kCAAkC,YAAU,IAAI,WAAW,MAAM;AAO9E,MAAM,kBAAkB,WAAS;AAC/B,MAAI,IAAI;AACR,WAAS,IAAI,GAAG,IAAI,MAAM,YAAY,KAAK;AACzC,SAAKA,aAAoB,MAAM,CAAC,CAAC;AAAA,EACrC;AAEE,SAAO,KAAK,CAAC;AACf;AAOA,MAAM,eAAe,WAAS,OAAO,KAAK,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU,EAAE,SAAS,QAAQ;AAO7G,MAAM,oBAAoB,OAAK;AAE7B,QAAM,IAAI,KAAK,CAAC;AAChB,QAAM,QAAQ,wBAAwB,EAAE,MAAM;AAC9C,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,UAAM,CAAC,IAAI,EAAE,WAAW,CAAC;AAAA,EAC7B;AACE,SAAO;AACT;AAMA,MAAM,iBAAiB,OAAK;AAC1B,QAAM,MAAM,OAAO,KAAK,GAAG,QAAQ;AACnC,SAAO,oCAAoC,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AACvF;AAGY,MAAC,WAAWC,YAAgB,kBAAkB;AAG9C,MAAC,aAAaA,YAA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
+ //# sourceMappingURL=conditions.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.es.js","sources":["../../../../../../../../../node_modules/.pnpm/lib0@0.2.114/node_modules/lib0/conditions.js"],"sourcesContent":["/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n"],"names":[],"mappings":"AAYY,MAAC,kBAAkB,OAAK,MAAM,SAAY,OAAO;","x_google_ignoreList":[0]}