@getartisanflow/alpineflow 0.1.0-alpha

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 (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/dist/alpineflow-collab.esm.js +465 -0
  4. package/dist/alpineflow-collab.esm.js.map +1 -0
  5. package/dist/alpineflow-collab.js +247 -0
  6. package/dist/alpineflow-collab.js.map +1 -0
  7. package/dist/alpineflow-dagre.esm.js +1661 -0
  8. package/dist/alpineflow-dagre.esm.js.map +1 -0
  9. package/dist/alpineflow-dagre.js +1655 -0
  10. package/dist/alpineflow-dagre.js.map +1 -0
  11. package/dist/alpineflow-elk.esm.js +47378 -0
  12. package/dist/alpineflow-elk.esm.js.map +1 -0
  13. package/dist/alpineflow-elk.js +47373 -0
  14. package/dist/alpineflow-elk.js.map +1 -0
  15. package/dist/alpineflow-force.esm.js +599 -0
  16. package/dist/alpineflow-force.esm.js.map +1 -0
  17. package/dist/alpineflow-force.js +477 -0
  18. package/dist/alpineflow-force.js.map +1 -0
  19. package/dist/alpineflow-hierarchy.esm.js +398 -0
  20. package/dist/alpineflow-hierarchy.esm.js.map +1 -0
  21. package/dist/alpineflow-hierarchy.js +393 -0
  22. package/dist/alpineflow-hierarchy.js.map +1 -0
  23. package/dist/alpineflow-theme.css +473 -0
  24. package/dist/alpineflow-whiteboard.esm.js +922 -0
  25. package/dist/alpineflow-whiteboard.esm.js.map +1 -0
  26. package/dist/alpineflow-whiteboard.js +922 -0
  27. package/dist/alpineflow-whiteboard.js.map +1 -0
  28. package/dist/alpineflow.bundle.esm.js +12604 -0
  29. package/dist/alpineflow.bundle.esm.js.map +1 -0
  30. package/dist/alpineflow.css +1415 -0
  31. package/dist/alpineflow.esm.js +158 -0
  32. package/dist/alpineflow.esm.js.map +1 -0
  33. package/dist/alpineflow.js +5 -0
  34. package/dist/alpineflow.js.map +1 -0
  35. package/dist/export-DjmXOnKD.js +76 -0
  36. package/dist/export-DjmXOnKD.js.map +1 -0
  37. package/dist/geometry-DZSZoYHE.js +82 -0
  38. package/dist/geometry-DZSZoYHE.js.map +1 -0
  39. package/dist/index-C0N1DL3G.js +11728 -0
  40. package/dist/index-C0N1DL3G.js.map +1 -0
  41. package/dist/index-L3Zm-CoX.js +513 -0
  42. package/dist/index-L3Zm-CoX.js.map +1 -0
  43. package/dist/registry-CChkuoVJ.js +15 -0
  44. package/dist/registry-CChkuoVJ.js.map +1 -0
  45. package/dist/store-CaFAFEdD.js +9 -0
  46. package/dist/store-CaFAFEdD.js.map +1 -0
  47. package/dist/timer-B39XOBYL.js +124 -0
  48. package/dist/timer-B39XOBYL.js.map +1 -0
  49. package/dist/types/lib/collab.cdn.d.ts +1 -0
  50. package/dist/types/lib/collab.d.ts +2 -0
  51. package/dist/types/lib/core.cdn.d.ts +1 -0
  52. package/dist/types/lib/core.d.ts +2 -0
  53. package/dist/types/lib/dagre.cdn.d.ts +1 -0
  54. package/dist/types/lib/dagre.d.ts +1 -0
  55. package/dist/types/lib/elk.cdn.d.ts +1 -0
  56. package/dist/types/lib/elk.d.ts +1 -0
  57. package/dist/types/lib/force.cdn.d.ts +1 -0
  58. package/dist/types/lib/force.d.ts +1 -0
  59. package/dist/types/lib/hierarchy.cdn.d.ts +1 -0
  60. package/dist/types/lib/hierarchy.d.ts +1 -0
  61. package/dist/types/lib/whiteboard.cdn.d.ts +1 -0
  62. package/dist/types/lib/whiteboard.d.ts +1 -0
  63. package/dist/types/src/animate/animator.d.ts +57 -0
  64. package/dist/types/src/animate/easing.d.ts +4 -0
  65. package/dist/types/src/animate/edge-transitions.d.ts +22 -0
  66. package/dist/types/src/animate/engine.d.ts +37 -0
  67. package/dist/types/src/animate/index.d.ts +10 -0
  68. package/dist/types/src/animate/interpolators.d.ts +14 -0
  69. package/dist/types/src/animate/paths.d.ts +64 -0
  70. package/dist/types/src/animate/timeline.d.ts +149 -0
  71. package/dist/types/src/collab/awareness.d.ts +40 -0
  72. package/dist/types/src/collab/bridge.d.ts +36 -0
  73. package/dist/types/src/collab/directives/flow-cursors.d.ts +16 -0
  74. package/dist/types/src/collab/index.d.ts +19 -0
  75. package/dist/types/src/collab/providers/in-memory.d.ts +41 -0
  76. package/dist/types/src/collab/providers/reverb.d.ts +59 -0
  77. package/dist/types/src/collab/providers/websocket.d.ts +33 -0
  78. package/dist/types/src/collab/store.d.ts +22 -0
  79. package/dist/types/src/collab/types.d.ts +55 -0
  80. package/dist/types/src/core/__fixtures__/nodes.d.ts +42 -0
  81. package/dist/types/src/core/announcer.d.ts +21 -0
  82. package/dist/types/src/core/auto-pan.d.ts +37 -0
  83. package/dist/types/src/core/child-layout.d.ts +18 -0
  84. package/dist/types/src/core/child-validation.d.ts +23 -0
  85. package/dist/types/src/core/clipboard.d.ts +29 -0
  86. package/dist/types/src/core/collapse.d.ts +54 -0
  87. package/dist/types/src/core/color-mode.d.ts +11 -0
  88. package/dist/types/src/core/compute.d.ts +33 -0
  89. package/dist/types/src/core/connections.d.ts +32 -0
  90. package/dist/types/src/core/constants.d.ts +18 -0
  91. package/dist/types/src/core/controls-panel.d.ts +23 -0
  92. package/dist/types/src/core/debug.d.ts +10 -0
  93. package/dist/types/src/core/deep-merge.d.ts +10 -0
  94. package/dist/types/src/core/drag.d.ts +63 -0
  95. package/dist/types/src/core/edge-paths/avoidant.d.ts +25 -0
  96. package/dist/types/src/core/edge-paths/bezier.d.ts +26 -0
  97. package/dist/types/src/core/edge-paths/editable.d.ts +22 -0
  98. package/dist/types/src/core/edge-paths/index.d.ts +7 -0
  99. package/dist/types/src/core/edge-paths/orthogonal.d.ts +27 -0
  100. package/dist/types/src/core/edge-paths/smoothstep.d.ts +22 -0
  101. package/dist/types/src/core/edge-paths/straight.d.ts +12 -0
  102. package/dist/types/src/core/edge-paths/utils.d.ts +30 -0
  103. package/dist/types/src/core/edge-utils.d.ts +57 -0
  104. package/dist/types/src/core/export.d.ts +12 -0
  105. package/dist/types/src/core/floating-edge.d.ts +33 -0
  106. package/dist/types/src/core/geometry.d.ts +79 -0
  107. package/dist/types/src/core/gradients.d.ts +30 -0
  108. package/dist/types/src/core/graph.d.ts +38 -0
  109. package/dist/types/src/core/helper-lines.d.ts +32 -0
  110. package/dist/types/src/core/history.d.ts +19 -0
  111. package/dist/types/src/core/index.d.ts +17 -0
  112. package/dist/types/src/core/intersection.d.ts +30 -0
  113. package/dist/types/src/core/keyboard-shortcuts.d.ts +45 -0
  114. package/dist/types/src/core/lasso-hit-test.d.ts +25 -0
  115. package/dist/types/src/core/lasso.d.ts +10 -0
  116. package/dist/types/src/core/layout/dagre.d.ts +11 -0
  117. package/dist/types/src/core/layout/elk.d.ts +13 -0
  118. package/dist/types/src/core/layout/force.d.ts +15 -0
  119. package/dist/types/src/core/layout/hierarchy.d.ts +13 -0
  120. package/dist/types/src/core/long-press.d.ts +11 -0
  121. package/dist/types/src/core/markers.d.ts +49 -0
  122. package/dist/types/src/core/minimap.d.ts +18 -0
  123. package/dist/types/src/core/node-flags.d.ts +19 -0
  124. package/dist/types/src/core/pan-zoom.d.ts +62 -0
  125. package/dist/types/src/core/proximity-connect.d.ts +25 -0
  126. package/dist/types/src/core/registry.d.ts +16 -0
  127. package/dist/types/src/core/render-plan.d.ts +52 -0
  128. package/dist/types/src/core/resize.d.ts +31 -0
  129. package/dist/types/src/core/rotation.d.ts +8 -0
  130. package/dist/types/src/core/selection-box.d.ts +14 -0
  131. package/dist/types/src/core/shapes.d.ts +10 -0
  132. package/dist/types/src/core/sub-flow.d.ts +61 -0
  133. package/dist/types/src/core/svg-path.d.ts +5 -0
  134. package/dist/types/src/core/types.d.ts +1238 -0
  135. package/dist/types/src/core/wire-bridge.d.ts +36 -0
  136. package/dist/types/src/index.d.ts +43 -0
  137. package/dist/types/src/layout/dagre.d.ts +2 -0
  138. package/dist/types/src/layout/elk.d.ts +2 -0
  139. package/dist/types/src/layout/force.d.ts +2 -0
  140. package/dist/types/src/layout/hierarchy.d.ts +2 -0
  141. package/dist/types/src/plugin/connection-utils.d.ts +54 -0
  142. package/dist/types/src/plugin/data/__test-utils.d.ts +9 -0
  143. package/dist/types/src/plugin/data/canvas-animation.d.ts +62 -0
  144. package/dist/types/src/plugin/data/canvas-collapse.d.ts +35 -0
  145. package/dist/types/src/plugin/data/canvas-compute.d.ts +6 -0
  146. package/dist/types/src/plugin/data/canvas-condense.d.ts +19 -0
  147. package/dist/types/src/plugin/data/canvas-config.d.ts +4 -0
  148. package/dist/types/src/plugin/data/canvas-context.d.ts +570 -0
  149. package/dist/types/src/plugin/data/canvas-dom.d.ts +13 -0
  150. package/dist/types/src/plugin/data/canvas-edges.d.ts +37 -0
  151. package/dist/types/src/plugin/data/canvas-history.d.ts +53 -0
  152. package/dist/types/src/plugin/data/canvas-layout.d.ts +151 -0
  153. package/dist/types/src/plugin/data/canvas-nodes.d.ts +73 -0
  154. package/dist/types/src/plugin/data/canvas-rows.d.ts +13 -0
  155. package/dist/types/src/plugin/data/canvas-selection.d.ts +45 -0
  156. package/dist/types/src/plugin/data/canvas-validation.d.ts +21 -0
  157. package/dist/types/src/plugin/data/canvas-viewport.d.ts +111 -0
  158. package/dist/types/src/plugin/data/flow-canvas.d.ts +2 -0
  159. package/dist/types/src/plugin/directives/flow-action.d.ts +12 -0
  160. package/dist/types/src/plugin/directives/flow-animate.d.ts +2 -0
  161. package/dist/types/src/plugin/directives/flow-arrow-draw.d.ts +2 -0
  162. package/dist/types/src/plugin/directives/flow-circle-draw.d.ts +2 -0
  163. package/dist/types/src/plugin/directives/flow-collapse.d.ts +2 -0
  164. package/dist/types/src/plugin/directives/flow-condense.d.ts +2 -0
  165. package/dist/types/src/plugin/directives/flow-context-menu.d.ts +2 -0
  166. package/dist/types/src/plugin/directives/flow-detail.d.ts +2 -0
  167. package/dist/types/src/plugin/directives/flow-devtools.d.ts +2 -0
  168. package/dist/types/src/plugin/directives/flow-drag-handle.d.ts +2 -0
  169. package/dist/types/src/plugin/directives/flow-draggable.d.ts +2 -0
  170. package/dist/types/src/plugin/directives/flow-edge-toolbar.d.ts +2 -0
  171. package/dist/types/src/plugin/directives/flow-edge.d.ts +7 -0
  172. package/dist/types/src/plugin/directives/flow-eraser.d.ts +2 -0
  173. package/dist/types/src/plugin/directives/flow-filter.d.ts +9 -0
  174. package/dist/types/src/plugin/directives/flow-follow.d.ts +9 -0
  175. package/dist/types/src/plugin/directives/flow-freehand.d.ts +2 -0
  176. package/dist/types/src/plugin/directives/flow-handle-connectable.d.ts +12 -0
  177. package/dist/types/src/plugin/directives/flow-handle-limit.d.ts +9 -0
  178. package/dist/types/src/plugin/directives/flow-handle-validate.d.ts +10 -0
  179. package/dist/types/src/plugin/directives/flow-handle.d.ts +29 -0
  180. package/dist/types/src/plugin/directives/flow-highlighter.d.ts +2 -0
  181. package/dist/types/src/plugin/directives/flow-loading.d.ts +2 -0
  182. package/dist/types/src/plugin/directives/flow-node-toolbar.d.ts +2 -0
  183. package/dist/types/src/plugin/directives/flow-node.d.ts +10 -0
  184. package/dist/types/src/plugin/directives/flow-panel.d.ts +2 -0
  185. package/dist/types/src/plugin/directives/flow-rectangle-draw.d.ts +2 -0
  186. package/dist/types/src/plugin/directives/flow-resizer.d.ts +2 -0
  187. package/dist/types/src/plugin/directives/flow-rotate.d.ts +11 -0
  188. package/dist/types/src/plugin/directives/flow-row-select.d.ts +2 -0
  189. package/dist/types/src/plugin/directives/flow-snapshot.d.ts +14 -0
  190. package/dist/types/src/plugin/directives/flow-text-tool.d.ts +2 -0
  191. package/dist/types/src/plugin/directives/flow-timeline.d.ts +2 -0
  192. package/dist/types/src/plugin/directives/flow-viewport.d.ts +2 -0
  193. package/dist/types/src/plugin/magics/flow.d.ts +2 -0
  194. package/dist/types/src/plugin/store.d.ts +2 -0
  195. package/dist/types/src/whiteboard/index.d.ts +2 -0
  196. package/package.json +153 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-CChkuoVJ.js","sources":["../src/core/registry.ts"],"sourcesContent":["/**\n * Addon registry — singleton via window global.\n *\n * When AlpineFlow core is loaded from one bundle (e.g., WireFlow's\n * alpineflow.bundle.esm.js) and addons are loaded from separate ESM\n * files, each bundle gets its own module scope. A module-scoped Map\n * would create disconnected registries — addons would register on\n * their copy, but the core would check its own empty copy.\n *\n * Using a window global ensures all bundles share one registry,\n * regardless of how they're loaded (CDN, npm, Vite, WireFlow bundle).\n */\n\nconst REGISTRY_KEY = '__alpineflow_registry__';\n\nfunction getRegistry(): Map<string, any> {\n if (typeof globalThis !== 'undefined') {\n if (!(globalThis as any)[REGISTRY_KEY]) {\n (globalThis as any)[REGISTRY_KEY] = new Map<string, any>();\n }\n return (globalThis as any)[REGISTRY_KEY];\n }\n // Fallback for environments without globalThis (shouldn't happen in modern runtimes)\n return new Map<string, any>();\n}\n\nexport function registerAddon(name: string, value: any): void {\n getRegistry().set(name, value);\n}\n\nexport function getAddon<T = any>(name: string): T | undefined {\n return getRegistry().get(name);\n}\n\n/** Test-only: clear all registered addons. */\nexport function _resetRegistry(): void {\n getRegistry().clear();\n}\n"],"names":["REGISTRY_KEY","getRegistry","registerAddon","name","value","getAddon"],"mappings":"AAaA,MAAMA,IAAe;AAErB,SAASC,IAAgC;AACvC,SAAI,OAAO,aAAe,OAClB,WAAmBD,CAAY,MAClC,WAAmBA,CAAY,IAAI,oBAAI,IAAA,IAElC,WAAmBA,CAAY,yBAG9B,IAAA;AACb;AAEO,SAASE,EAAcC,GAAcC,GAAkB;AAC5D,EAAAH,IAAc,IAAIE,GAAMC,CAAK;AAC/B;AAEO,SAASC,EAAkBF,GAA6B;AAC7D,SAAOF,EAAA,EAAc,IAAIE,CAAI;AAC/B;"}
@@ -0,0 +1,9 @@
1
+ const l = "__alpineflow_collab_store__";
2
+ function o() {
3
+ return typeof globalThis < "u" ? (globalThis[l] || (globalThis[l] = /* @__PURE__ */ new WeakMap()), globalThis[l]) : /* @__PURE__ */ new WeakMap();
4
+ }
5
+ const e = o();
6
+ export {
7
+ e as c
8
+ };
9
+ //# sourceMappingURL=store-CaFAFEdD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-CaFAFEdD.js","sources":["../src/collab/store.ts"],"sourcesContent":["/**\n * Global store for collaboration instances.\n *\n * Collab objects (Yjs Doc, CollabBridge, CollabAwareness) contain circular\n * references that crash Alpine's deep-reactive proxy walker. Instead of\n * attaching them to the Alpine data object, they live here in a WeakMap\n * keyed by the canvas container element. Both flow-canvas.ts and the\n * x-flow-cursors directive import from this module.\n *\n * Uses globalThis to ensure a single shared instance across bundles —\n * when core loads from one bundle and the collab addon from another,\n * both must read/write the same WeakMap.\n */\nimport type { CollabBridge } from './bridge';\nimport type { CollabAwareness } from './awareness';\n\nexport interface CollabEntry {\n bridge: CollabBridge;\n awareness: CollabAwareness;\n doc: any;\n cursorCleanup?: () => void;\n}\n\nconst COLLAB_STORE_KEY = '__alpineflow_collab_store__';\n\nfunction getCollabStore(): WeakMap<HTMLElement, CollabEntry> {\n if (typeof globalThis !== 'undefined') {\n if (!(globalThis as any)[COLLAB_STORE_KEY]) {\n (globalThis as any)[COLLAB_STORE_KEY] = new WeakMap<HTMLElement, CollabEntry>();\n }\n return (globalThis as any)[COLLAB_STORE_KEY];\n }\n return new WeakMap<HTMLElement, CollabEntry>();\n}\n\nexport const collabStore = getCollabStore();\n"],"names":["COLLAB_STORE_KEY","getCollabStore","collabStore"],"mappings":"AAuBA,MAAMA,IAAmB;AAEzB,SAASC,IAAoD;AAC3D,SAAI,OAAO,aAAe,OAClB,WAAmBD,CAAgB,MACtC,WAAmBA,CAAgB,IAAI,oBAAI,QAAA,IAEtC,WAAmBA,CAAgB,yBAElC,QAAA;AACb;AAEO,MAAME,IAAcD,EAAA;"}
@@ -0,0 +1,124 @@
1
+ var E = { value: () => {
2
+ } };
3
+ function I() {
4
+ for (var n = 0, e = arguments.length, t = {}, r; n < e; ++n) {
5
+ if (!(r = arguments[n] + "") || r in t || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
6
+ t[r] = [];
7
+ }
8
+ return new h(t);
9
+ }
10
+ function h(n) {
11
+ this._ = n;
12
+ }
13
+ function F(n, e) {
14
+ return n.trim().split(/^|\s+/).map(function(t) {
15
+ var r = "", i = t.indexOf(".");
16
+ if (i >= 0 && (r = t.slice(i + 1), t = t.slice(0, i)), t && !e.hasOwnProperty(t)) throw new Error("unknown type: " + t);
17
+ return { type: t, name: r };
18
+ });
19
+ }
20
+ h.prototype = I.prototype = {
21
+ constructor: h,
22
+ on: function(n, e) {
23
+ var t = this._, r = F(n + "", t), i, o = -1, y = r.length;
24
+ if (arguments.length < 2) {
25
+ for (; ++o < y; ) if ((i = (n = r[o]).type) && (i = O(t[i], n.name))) return i;
26
+ return;
27
+ }
28
+ if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
29
+ for (; ++o < y; )
30
+ if (i = (n = r[o]).type) t[i] = g(t[i], n.name, e);
31
+ else if (e == null) for (i in t) t[i] = g(t[i], n.name, null);
32
+ return this;
33
+ },
34
+ copy: function() {
35
+ var n = {}, e = this._;
36
+ for (var t in e) n[t] = e[t].slice();
37
+ return new h(n);
38
+ },
39
+ call: function(n, e) {
40
+ if ((i = arguments.length - 2) > 0) for (var t = new Array(i), r = 0, i, o; r < i; ++r) t[r] = arguments[r + 2];
41
+ if (!this._.hasOwnProperty(n)) throw new Error("unknown type: " + n);
42
+ for (o = this._[n], r = 0, i = o.length; r < i; ++r) o[r].value.apply(e, t);
43
+ },
44
+ apply: function(n, e, t) {
45
+ if (!this._.hasOwnProperty(n)) throw new Error("unknown type: " + n);
46
+ for (var r = this._[n], i = 0, o = r.length; i < o; ++i) r[i].value.apply(e, t);
47
+ }
48
+ };
49
+ function O(n, e) {
50
+ for (var t = 0, r = n.length, i; t < r; ++t)
51
+ if ((i = n[t]).name === e)
52
+ return i.value;
53
+ }
54
+ function g(n, e, t) {
55
+ for (var r = 0, i = n.length; r < i; ++r)
56
+ if (n[r].name === e) {
57
+ n[r] = E, n = n.slice(0, r).concat(n.slice(r + 1));
58
+ break;
59
+ }
60
+ return t != null && n.push({ name: e, value: t }), n;
61
+ }
62
+ var a = 0, u = 0, f = 0, k = 1e3, w, s, p = 0, l = 0, m = 0, c = typeof performance == "object" && performance.now ? performance : Date, x = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(n) {
63
+ setTimeout(n, 17);
64
+ };
65
+ function T() {
66
+ return l || (x(A), l = c.now() + m);
67
+ }
68
+ function A() {
69
+ l = 0;
70
+ }
71
+ function _() {
72
+ this._call = this._time = this._next = null;
73
+ }
74
+ _.prototype = D.prototype = {
75
+ constructor: _,
76
+ restart: function(n, e, t) {
77
+ if (typeof n != "function") throw new TypeError("callback is not a function");
78
+ t = (t == null ? T() : +t) + (e == null ? 0 : +e), !this._next && s !== this && (s ? s._next = this : w = this, s = this), this._call = n, this._time = t, v();
79
+ },
80
+ stop: function() {
81
+ this._call && (this._call = null, this._time = 1 / 0, v());
82
+ }
83
+ };
84
+ function D(n, e, t) {
85
+ var r = new _();
86
+ return r.restart(n, e, t), r;
87
+ }
88
+ function P() {
89
+ T(), ++a;
90
+ for (var n = w, e; n; )
91
+ (e = l - n._time) >= 0 && n._call.call(void 0, e), n = n._next;
92
+ --a;
93
+ }
94
+ function d() {
95
+ l = (p = c.now()) + m, a = u = 0;
96
+ try {
97
+ P();
98
+ } finally {
99
+ a = 0, q(), l = 0;
100
+ }
101
+ }
102
+ function j() {
103
+ var n = c.now(), e = n - p;
104
+ e > k && (m -= e, p = n);
105
+ }
106
+ function q() {
107
+ for (var n, e = w, t, r = 1 / 0; e; )
108
+ e._call ? (r > e._time && (r = e._time), n = e, e = e._next) : (t = e._next, e._next = null, e = n ? n._next = t : w = t);
109
+ s = n, v(r);
110
+ }
111
+ function v(n) {
112
+ if (!a) {
113
+ u && (u = clearTimeout(u));
114
+ var e = n - l;
115
+ e > 24 ? (n < 1 / 0 && (u = setTimeout(d, n - c.now() - m)), f && (f = clearInterval(f))) : (f || (p = c.now(), f = setInterval(j, k)), a = 1, x(d));
116
+ }
117
+ }
118
+ export {
119
+ _ as T,
120
+ I as d,
121
+ T as n,
122
+ D as t
123
+ };
124
+ //# sourceMappingURL=timer-B39XOBYL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timer-B39XOBYL.js","sources":["../node_modules/d3-dispatch/src/dispatch.js","../node_modules/d3-timer/src/timer.js"],"sourcesContent":["var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n"],"names":["noop","dispatch","i","n","_","t","Dispatch","parseTypenames","typenames","types","name","typename","callback","T","get","set","copy","type","that","args","c","frame","timeout","interval","pokeDelay","taskHead","taskTail","clockLast","clockNow","clockSkew","clock","setFrame","f","now","clearNow","Timer","timer","delay","time","sleep","timerFlush","wake","nap","poke","t0","t1","t2"],"mappings":"AAAA,IAAIA,IAAO,EAAC,OAAO,MAAM;AAAC,EAAC;AAE3B,SAASC,IAAW;AAClB,WAASC,IAAI,GAAGC,IAAI,UAAU,QAAQC,IAAI,CAAA,GAAIC,GAAGH,IAAIC,GAAG,EAAED,GAAG;AAC3D,QAAI,EAAEG,IAAI,UAAU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QAAIe,IAAQC,IAAOV;AACnB,IAAIS,IAAQ,MACNC,IAAO,UAAUhB,IAAU,WAAWmB,GAAMH,IAAOR,EAAM,IAAG,IAAKD,CAAS,IAC1EN,MAAUA,IAAW,cAAcA,CAAQ,OAE1CA,MAAUI,IAAYG,EAAM,IAAG,GAAIP,IAAW,YAAYoB,GAAMnB,CAAS,IAC9EH,IAAQ,GAAGU,EAASU,CAAI;AAAA;AAE5B;","x_google_ignoreList":[0,1]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from '../src/collab/index';
2
+ export * from '../src/collab/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from '../src/index';
2
+ export * from '../src/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../src/layout/dagre';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../src/layout/elk';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../src/layout/force';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../src/layout/hierarchy';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../src/whiteboard/index';
@@ -0,0 +1,57 @@
1
+ import { AnimationEngine } from './engine';
2
+ import type { EasingName, EasingFn } from './easing';
3
+ /** A single property to animate. */
4
+ export interface PropertyEntry {
5
+ key: string;
6
+ from: number | string;
7
+ to: number | string;
8
+ apply: (value: number | string) => void;
9
+ }
10
+ /** Internal options for the `animate()` method. */
11
+ export interface AnimateInternalOptions {
12
+ duration: number;
13
+ easing?: EasingName | EasingFn;
14
+ delay?: number;
15
+ loop?: boolean | 'reverse';
16
+ onProgress?: (progress: number) => void;
17
+ onComplete?: () => void;
18
+ }
19
+ /** Handle returned by `animate()` — controls the animation lifecycle. */
20
+ export interface AnimationHandle {
21
+ pause(): void;
22
+ resume(): void;
23
+ stop(): void;
24
+ reverse(): void;
25
+ readonly finished: Promise<void>;
26
+ }
27
+ export declare class Animator {
28
+ private _engine;
29
+ /** Maps property key -> the ActiveGroup that currently owns it. */
30
+ private _ownership;
31
+ /** All active groups. */
32
+ private _groups;
33
+ private _nextGroupId;
34
+ constructor(engine: AnimationEngine);
35
+ /** Whether any animations are currently running. */
36
+ get active(): boolean;
37
+ /**
38
+ * Animate a set of property entries over the given duration.
39
+ *
40
+ * If any entry targets a key already being animated, the current in-flight
41
+ * value is captured as the new "from" and the property is removed from the
42
+ * old group (blend/compose).
43
+ */
44
+ animate(entries: PropertyEntry[], options: AnimateInternalOptions): AnimationHandle;
45
+ /** Stop all active animations. */
46
+ stopAll(): void;
47
+ /**
48
+ * Per-frame tick for an animation group.
49
+ * @returns `true` when the animation is complete (to unregister from engine).
50
+ */
51
+ private _tick;
52
+ private _pause;
53
+ private _resume;
54
+ private _stop;
55
+ private _reverse;
56
+ private _cleanup;
57
+ }
@@ -0,0 +1,4 @@
1
+ export type EasingName = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'easeBounce' | 'easeElastic' | 'easeBack';
2
+ export type EasingFn = (t: number) => number;
3
+ /** Resolve an easing name or custom function to a callable (t: number) => number. */
4
+ export declare function resolveEasing(easing?: EasingName | EasingFn): EasingFn;
@@ -0,0 +1,22 @@
1
+ /** Stroke-dashoffset for draw-in: totalLength → 0 as progress goes 0 → 1. */
2
+ export declare function drawInOffset(totalLength: number, progress: number): number;
3
+ /** Stroke-dashoffset for draw-out: 0 → totalLength as progress goes 0 → 1. */
4
+ export declare function drawOutOffset(totalLength: number, progress: number): number;
5
+ /** Opacity value for fade transitions. */
6
+ export declare function fadeOpacity(progress: number, direction: 'in' | 'out'): number;
7
+ /**
8
+ * Apply draw transition styles to an SVG path element.
9
+ * Re-reads getTotalLength() on each call so dynamic paths stay synchronized.
10
+ *
11
+ * Markers are hidden via inline CSS `marker-start/end: none` during draw-in
12
+ * (until progress reaches 1) and during draw-out. Inline styles override the
13
+ * SVG presentation attributes that Alpine's reactive effect may re-set at
14
+ * any time, so this is race-condition-free.
15
+ */
16
+ export declare function applyDrawTransition(pathEl: SVGPathElement, progress: number, direction: 'in' | 'out'): void;
17
+ /** Remove draw transition inline styles so the edge renders normally. */
18
+ export declare function cleanupDrawTransition(pathEl: SVGPathElement): void;
19
+ /** Apply fade transition opacity to an element. */
20
+ export declare function applyFadeTransition(el: SVGElement | HTMLElement, progress: number, direction: 'in' | 'out'): void;
21
+ /** Remove fade transition inline styles. */
22
+ export declare function cleanupFadeTransition(el: SVGElement | HTMLElement): void;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Callback invoked each animation frame.
3
+ * @param elapsed - Milliseconds since this callback was activated.
4
+ * @returns `true` to signal completion and unregister, or `void`/`false` to continue.
5
+ */
6
+ export type TickCallback = (elapsed: number) => boolean | void;
7
+ /** Handle returned by `register()` — call `stop()` to unregister the callback. */
8
+ export interface EngineHandle {
9
+ stop(): void;
10
+ }
11
+ /** Injectable frame scheduler — allows tests to swap in fake timers. */
12
+ export interface FrameScheduler {
13
+ request: (cb: FrameRequestCallback) => number;
14
+ cancel: (id: number) => void;
15
+ }
16
+ export declare class AnimationEngine {
17
+ private _scheduler;
18
+ private _entries;
19
+ private _frameId;
20
+ private _running;
21
+ /** True when the rAF loop is running. */
22
+ get active(): boolean;
23
+ /** Replace the frame scheduler (useful for tests with fake timers). */
24
+ setScheduler(scheduler: FrameScheduler): void;
25
+ /**
26
+ * Register a tick callback.
27
+ * @param callback - Called each frame with elapsed ms since activation.
28
+ * @param delay - Optional delay (ms) before first invocation, measured from rAF frames.
29
+ * @returns Handle with a `stop()` method to unregister.
30
+ */
31
+ register(callback: TickCallback, delay?: number): EngineHandle;
32
+ private _start;
33
+ private _stop;
34
+ private _scheduleFrame;
35
+ private _tick;
36
+ }
37
+ export declare const engine: AnimationEngine;
@@ -0,0 +1,10 @@
1
+ export type { EasingName } from './easing';
2
+ export type { StepContext, TimelineStep, TimelineEvent, TimelineState, TimelineCanvas, } from './timeline';
3
+ export { resolveEasing } from './easing';
4
+ export { lerpNumber, interpolateColor, parseStyle, interpolateStyle, lerpViewport } from './interpolators';
5
+ export { drawInOffset, drawOutOffset, fadeOpacity, applyDrawTransition, cleanupDrawTransition, applyFadeTransition, cleanupFadeTransition, } from './edge-transitions';
6
+ export type { PathFunction, OrbitConfig, WaveConfig, AlongConfig, PendulumConfig, DriftConfig } from './paths';
7
+ export { svgPathToFunction, orbit, wave, along, pendulum, drift, stagger } from './paths';
8
+ export { engine, AnimationEngine, type TickCallback, type EngineHandle } from './engine';
9
+ export { FlowTimeline } from './timeline';
10
+ export { Animator, type PropertyEntry, type AnimateInternalOptions, type AnimationHandle } from './animator';
@@ -0,0 +1,14 @@
1
+ import type { Viewport } from '../core/types';
2
+ /** Linear interpolation between two numbers. */
3
+ export declare function lerpNumber(a: number, b: number, t: number): number;
4
+ /** Interpolate between two CSS color strings using d3-interpolateRgb. */
5
+ export declare function interpolateColor(a: string, b: string, t: number): string;
6
+ /** Parse a style string ("key: value; ...") into a Record, or pass through a Record. */
7
+ export declare function parseStyle(style: string | Record<string, string>): Record<string, string>;
8
+ /** Interpolate between two parsed style records, per-property. */
9
+ export declare function interpolateStyle(from: Record<string, string>, to: Record<string, string>, t: number): Record<string, string>;
10
+ /** Interpolate between two viewports (x, y, zoom) with optional zoom clamping. */
11
+ export declare function lerpViewport(from: Viewport, to: Viewport, t: number, clamp?: {
12
+ minZoom?: number;
13
+ maxZoom?: number;
14
+ }): Viewport;
@@ -0,0 +1,64 @@
1
+ /** Full circle in radians. */
2
+ export declare const TAU: number;
3
+ /** A function that maps normalised progress (0-1) to flow-space coordinates. */
4
+ export type PathFunction = (t: number) => {
5
+ x: number;
6
+ y: number;
7
+ };
8
+ /**
9
+ * Convert an SVG path `d` attribute string into a PathFunction.
10
+ * Creates an off-screen <path> element for geometry calculations.
11
+ * Returns null in environments without SVG DOM support (e.g. Node/vitest).
12
+ */
13
+ export declare function svgPathToFunction(d: string): PathFunction | null;
14
+ export interface OrbitConfig {
15
+ cx: number;
16
+ cy: number;
17
+ radius?: number;
18
+ rx?: number;
19
+ ry?: number;
20
+ offset?: number;
21
+ clockwise?: boolean;
22
+ }
23
+ /** Circular/elliptical motion around a center point. */
24
+ export declare function orbit(config: OrbitConfig): PathFunction;
25
+ export interface WaveConfig {
26
+ startX: number;
27
+ startY: number;
28
+ endX: number;
29
+ endY: number;
30
+ amplitude?: number;
31
+ frequency?: number;
32
+ offset?: number;
33
+ }
34
+ /** Sinusoidal oscillation along a start-end axis with perpendicular displacement. */
35
+ export declare function wave(config: WaveConfig): PathFunction;
36
+ export interface AlongConfig {
37
+ reverse?: boolean;
38
+ startAt?: number;
39
+ endAt?: number;
40
+ }
41
+ /** Convenience wrapper around svgPathToFunction with reverse/startAt/endAt. */
42
+ export declare function along(path: string, config?: AlongConfig): PathFunction | null;
43
+ export interface PendulumConfig {
44
+ cx: number;
45
+ cy: number;
46
+ radius: number;
47
+ angle?: number;
48
+ offset?: number;
49
+ }
50
+ /** Swinging arc around a pivot. Node hangs down (positive y) from the pivot. */
51
+ export declare function pendulum(config: PendulumConfig): PathFunction;
52
+ export interface DriftConfig {
53
+ originX: number;
54
+ originY: number;
55
+ range?: number;
56
+ speed?: number;
57
+ seed?: number;
58
+ }
59
+ /** Smooth pseudo-random wandering using sine-sum noise. */
60
+ export declare function drift(config: DriftConfig): PathFunction;
61
+ /** Distributes offset values across items. */
62
+ export declare function stagger(amount: number, options?: {
63
+ from?: number;
64
+ }): (index: number, total: number) => number;
@@ -0,0 +1,149 @@
1
+ import { type EasingName } from './easing';
2
+ import { type PathFunction } from './paths';
3
+ import type { FlowNode, FlowEdge, XYPosition, Dimensions, Viewport, AnimateTargets, AnimateOptions, FlowAnimationHandle } from '../core/types';
4
+ import type { EdgeAnimationMode } from '../core/types';
5
+ export interface StepContext {
6
+ [key: string]: any;
7
+ stepIndex: number;
8
+ stepId?: string;
9
+ }
10
+ export interface TimelineStep {
11
+ id?: string;
12
+ nodes?: string[];
13
+ position?: Partial<XYPosition>;
14
+ class?: string;
15
+ dimensions?: Partial<Dimensions>;
16
+ style?: string | Record<string, string>;
17
+ data?: Record<string, any>;
18
+ selected?: boolean;
19
+ zIndex?: number;
20
+ /** Path function or SVG path string for curved motion. Overrides `position`. */
21
+ followPath?: PathFunction | string;
22
+ /** Optional visible guide path overlay for string-based followPath. */
23
+ guidePath?: {
24
+ visible?: boolean;
25
+ class?: string;
26
+ autoRemove?: boolean;
27
+ };
28
+ edges?: string[];
29
+ edgeAnimated?: boolean | EdgeAnimationMode;
30
+ edgeColor?: string;
31
+ edgeClass?: string;
32
+ edgeLabel?: string;
33
+ edgeStrokeWidth?: number;
34
+ addEdges?: FlowEdge[];
35
+ removeEdges?: string[];
36
+ edgeTransition?: 'none' | 'draw' | 'fade';
37
+ viewport?: Partial<Viewport>;
38
+ fitView?: boolean;
39
+ panTo?: string;
40
+ fitViewPadding?: number;
41
+ parallel?: TimelineStep[];
42
+ duration?: number;
43
+ easing?: EasingName | ((t: number) => number);
44
+ delay?: number;
45
+ lock?: boolean;
46
+ onStart?: (ctx: StepContext) => void;
47
+ onProgress?: (progress: number, ctx: StepContext) => void;
48
+ onComplete?: (ctx: StepContext) => void;
49
+ }
50
+ export type TimelineEvent = 'play' | 'step' | 'step-complete' | 'pause' | 'resume' | 'interrupt' | 'complete' | 'reverse' | 'loop' | 'stop' | 'reset';
51
+ export type TimelineState = 'idle' | 'playing' | 'paused' | 'stopped';
52
+ /** Minimal canvas interface the timeline needs — avoids coupling to the full canvas. */
53
+ export interface TimelineCanvas {
54
+ nodes: FlowNode[];
55
+ edges: FlowEdge[];
56
+ getNode: (id: string) => FlowNode | undefined;
57
+ getEdge: (id: string) => FlowEdge | undefined;
58
+ /** The unified animation API. */
59
+ animate: (targets: AnimateTargets, options?: AnimateOptions) => FlowAnimationHandle;
60
+ /** Find the SVG path element for an edge (for draw transitions). */
61
+ getEdgePathElement?: (id: string) => SVGPathElement | null;
62
+ /** Find the edge group/wrapper element (for fade transitions). */
63
+ getEdgeElement?: (id: string) => SVGElement | HTMLElement | null;
64
+ /** Reactive viewport state. */
65
+ viewport?: Viewport;
66
+ /** Container dimensions for fitView/panTo calculations. */
67
+ getContainerDimensions?: () => {
68
+ width: number;
69
+ height: number;
70
+ };
71
+ /** Zoom constraints. */
72
+ minZoom?: number;
73
+ maxZoom?: number;
74
+ /** The SVG element where guide paths should be inserted. */
75
+ getEdgeSvgElement?: () => SVGSVGElement | null;
76
+ /** When true, log warnings for missing targets. */
77
+ debug?: boolean;
78
+ /** Rebuild the edge lookup map after direct array mutations. */
79
+ _rebuildEdgeMap?: () => void;
80
+ }
81
+ export declare class FlowTimeline {
82
+ private _canvas;
83
+ private _engine;
84
+ private _entries;
85
+ private _state;
86
+ private _reversed;
87
+ private _loopCount;
88
+ private _lockEnabled;
89
+ private _locked;
90
+ private _respectReducedMotion;
91
+ private _listeners;
92
+ private _context;
93
+ private _activeHandles;
94
+ private _initialSnapshot;
95
+ private _initialEdgeSnapshot;
96
+ private _playResolve;
97
+ constructor(canvas: TimelineCanvas);
98
+ get state(): TimelineState;
99
+ get locked(): boolean;
100
+ step(config: TimelineStep | ((ctx: StepContext) => TimelineStep)): this;
101
+ parallel(steps: Array<TimelineStep | ((ctx: StepContext) => TimelineStep)>): this;
102
+ pause(callback?: (resume: (context?: Record<string, any>) => void) => void): this;
103
+ play(): Promise<void>;
104
+ stop(): void;
105
+ reset(replay?: boolean): Promise<void> | void;
106
+ reverse(): this;
107
+ loop(count?: number): this;
108
+ lock(enabled?: boolean): this;
109
+ respectReducedMotion(enabled?: boolean): this;
110
+ on(event: TimelineEvent, handler: Function): this;
111
+ /** Check if reduced motion is active (OS preference + not opted out). */
112
+ private _isReducedMotion;
113
+ private _emit;
114
+ private _captureInitialSnapshot;
115
+ private _captureEntryTargets;
116
+ private _captureStepTargets;
117
+ private _restoreInitialSnapshot;
118
+ private _stopAll;
119
+ private _runEntries;
120
+ private _makeContext;
121
+ private _executePause;
122
+ private _executeParallel;
123
+ private _executeParallelSteps;
124
+ private _executeStep;
125
+ /** Apply all properties of a step at their final values (for instant steps). */
126
+ private _applyStepFinal;
127
+ /** Apply instant-swap edge properties (not interpolated). */
128
+ private _applyStepInstant;
129
+ /** Add edges to the canvas edges array. */
130
+ private _addEdges;
131
+ /** Remove edges from the canvas edges array by ID. */
132
+ private _removeEdges;
133
+ /** Apply draw transition on each tick for added/removed edges. */
134
+ private _applyEdgeDrawTransition;
135
+ /** Clean up draw transition styles. */
136
+ private _cleanupEdgeDrawTransition;
137
+ /** Apply fade transition on each tick for added/removed edges. */
138
+ private _applyEdgeFadeTransition;
139
+ /** Clean up fade transition styles. */
140
+ private _cleanupEdgeFadeTransition;
141
+ /** Compute the target viewport for a step (viewport, fitView, or panTo). */
142
+ private _resolveTargetViewport;
143
+ /** Compute the viewport that fits all (or specified) nodes with padding. */
144
+ private _computeFitViewViewport;
145
+ /** Compute the viewport that centers on a given node. */
146
+ private _computePanToViewport;
147
+ /** Apply viewport at final values (for instant steps). */
148
+ private _applyViewportFinal;
149
+ }
@@ -0,0 +1,40 @@
1
+ import type { Awareness } from 'y-protocols/awareness';
2
+ import type { CollabUser, CollabAwarenessState, CollabInstance, CollabStatus } from './types';
3
+ /**
4
+ * CollabAwareness — Manages cursor positions, selections, and presence.
5
+ *
6
+ * Wraps the Yjs awareness protocol. Each user broadcasts their cursor position,
7
+ * selected nodes, and viewport. Remote awareness states are exposed as a
8
+ * reactive `users` array for rendering cursors and presence UI.
9
+ */
10
+ export declare class CollabAwareness implements CollabInstance {
11
+ private awareness;
12
+ private localUser;
13
+ private destroyed;
14
+ private _users;
15
+ private _remoteStates;
16
+ private changeHandler;
17
+ private _onChangeCallbacks;
18
+ status: CollabStatus;
19
+ constructor(awareness: Awareness, user: CollabUser);
20
+ get me(): CollabUser;
21
+ get users(): CollabUser[];
22
+ get userCount(): number;
23
+ get connected(): boolean;
24
+ /** Get all remote awareness states (for cursor rendering). */
25
+ getRemoteStates(): Map<number, CollabAwarenessState>;
26
+ /** Subscribe to awareness changes. Returns unsubscribe function. */
27
+ onChange(cb: () => void): () => void;
28
+ updateCursor(pos: {
29
+ x: number;
30
+ y: number;
31
+ } | null): void;
32
+ updateSelection(nodeIds: string[]): void;
33
+ updateViewport(viewport: {
34
+ x: number;
35
+ y: number;
36
+ zoom: number;
37
+ }): void;
38
+ private rebuildUsers;
39
+ destroy(): void;
40
+ }