@synnaxlabs/pluto 0.50.0 → 0.52.3

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 (268) hide show
  1. package/dist/{Animated-DxBr38YY.js → Animated-6qL1fRZx.js} +61 -60
  2. package/dist/Animated-Bn4jMc7c.js +29 -0
  3. package/dist/Animated-vGAs0qOH.cjs +1 -0
  4. package/dist/Animated-xK__WUQp.cjs +1 -0
  5. package/dist/{Box-DLO7l9hM.js → Box-Bi280MYh.js} +28 -27
  6. package/dist/Box-CNUz5BsV.cjs +1 -0
  7. package/dist/Copy-CzkBKGca.js +337 -0
  8. package/dist/Copy-DuC8dTK7.cjs +1 -0
  9. package/dist/Dialog-DNrgykEv.cjs +1 -0
  10. package/dist/{Dialog-CwTHvHHD.js → Dialog-Dos5l3K2.js} +13 -12
  11. package/dist/{Editable-DjQORuR1.js → Editable-4ZwvICC4.js} +46 -45
  12. package/dist/Editable-HUPqTaui.cjs +1 -0
  13. package/dist/{Haul-CofQrOeX.js → Haul-CxbMtSY4.js} +18 -18
  14. package/dist/Haul-V5NQI3MY.cjs +1 -0
  15. package/dist/{Items-B5aeU-Pt.js → Items-CNPUoiob.js} +25 -22
  16. package/dist/Items-DYYNNIjr.cjs +4 -0
  17. package/dist/Menu-C0scum-k.cjs +1 -0
  18. package/dist/{Menu-Bjfeoaln.js → Menu-CTuOX5DR.js} +42 -41
  19. package/dist/Provider-DSMJjyuY.cjs +1 -0
  20. package/dist/{Provider-BoQtgQtU.js → Provider-ZIy-UlnE.js} +113 -108
  21. package/dist/Tags-6OV0_eBz.cjs +1 -0
  22. package/dist/{Tags-C38F7I5z.js → Tags-BUDnOqms.js} +233 -227
  23. package/dist/{Text-TzKJ38En.js → Text-BSTMZRuo.js} +726 -679
  24. package/dist/Text-C2_VsLzw.cjs +1 -0
  25. package/dist/Video-Bew5_j16.js +10 -0
  26. package/dist/Video-BryrVNlH.cjs +1 -0
  27. package/dist/button.cjs +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/color.cjs +1 -1
  30. package/dist/color.js +1 -1
  31. package/dist/css-CloSmhZB.cjs +1 -0
  32. package/dist/css-D90kZTM8.js +63 -0
  33. package/dist/css.cjs +1 -1
  34. package/dist/css.js +2 -2
  35. package/dist/dialog.cjs +1 -1
  36. package/dist/dialog.js +1 -1
  37. package/dist/dimensions-CdFEW3oU.cjs +1 -0
  38. package/dist/{dimensions-qj2CkPTy.js → dimensions-DbMN4145.js} +8 -8
  39. package/dist/{eraser-Bd14L_5k.js → eraser-BShvqlBE.js} +52 -49
  40. package/dist/eraser-rFMFKqsg.cjs +11 -0
  41. package/dist/eslint.config.d.ts +2 -2
  42. package/dist/eslint.config.d.ts.map +1 -1
  43. package/dist/ether.cjs +1 -1
  44. package/dist/ether.js +65 -62
  45. package/dist/external--liXQuyF.cjs +1 -0
  46. package/dist/external-B3ipr7m2.cjs +1 -0
  47. package/dist/{external-DKc3PiyN.js → external-B7UnU0MW.js} +27 -26
  48. package/dist/{external-B0R_yw6F.cjs → external-BRxBwBtj.cjs} +44 -44
  49. package/dist/{external-MvcifV4O.js → external-Ba2qQp_c.js} +3 -3
  50. package/dist/{external-BsdKmL37.js → external-Bjd-DyWx.js} +22 -30
  51. package/dist/{external-B3o5P8Yw.cjs → external-BwbypKCk.cjs} +1 -1
  52. package/dist/external-C0rrTDhu.cjs +1 -0
  53. package/dist/{external-DqaHmzvp.js → external-CG70NZqY.js} +97 -96
  54. package/dist/external-Ci1Iy9ku.js +32 -0
  55. package/dist/external-CmYpRWry.cjs +1 -0
  56. package/dist/{external-6HkYP0wd.js → external-CoCI_tg5.js} +9 -8
  57. package/dist/{external-BKkDVUP_.js → external-Ctnukdzx.js} +10 -9
  58. package/dist/{external-gDa9Z0SY.js → external-CvYxFUrc.js} +17 -17
  59. package/dist/{external-Bl8zTvKt.js → external-Czkrdv2A.js} +73 -71
  60. package/dist/external-Czv2P05t.cjs +1 -0
  61. package/dist/{external-BoAcV4dI.js → external-DAotNquC.js} +3 -3
  62. package/dist/external-DFvPOUIQ.cjs +1 -0
  63. package/dist/{external-BU5fnKG8.cjs → external-DWEpl5aM.cjs} +1 -1
  64. package/dist/{external-DrcMI5oa.js → external-JwicH0Yv.js} +18 -17
  65. package/dist/external-N5bKB8Zx.cjs +1 -0
  66. package/dist/external-ZtJmVgiY.cjs +1 -0
  67. package/dist/external-ieDANY3X.cjs +28 -0
  68. package/dist/{external-DCZMzNZX.js → external-s6DOSL29.js} +16 -15
  69. package/dist/flex.cjs +1 -1
  70. package/dist/flex.js +1 -1
  71. package/dist/{fontString-BtjO8Met.js → fontString-76R2eWDd.js} +3 -3
  72. package/dist/fontString-BNnhiwug.cjs +1 -0
  73. package/dist/header.cjs +1 -1
  74. package/dist/header.js +1 -1
  75. package/dist/hooks-C4ji1BSZ.cjs +1 -0
  76. package/dist/{hooks-Ddqh5NVY.js → hooks-CWEfATTF.js} +16 -16
  77. package/dist/index.cjs +35 -18
  78. package/dist/index.js +15387 -14090
  79. package/dist/input.cjs +1 -1
  80. package/dist/input.js +1 -1
  81. package/dist/{jsx-runtime-BbD0H88J.js → jsx-runtime-tc70JA_2.js} +2 -2
  82. package/dist/list.cjs +1 -1
  83. package/dist/list.js +1 -1
  84. package/dist/menu.cjs +1 -1
  85. package/dist/menu.js +1 -1
  86. package/dist/pluto.css +1 -1
  87. package/dist/provider-Bt-E2O6g.js +810 -0
  88. package/dist/provider-DQkVj3tA.cjs +10 -0
  89. package/dist/src/access/policy/queries.d.ts +6 -6
  90. package/dist/src/button/Copy.d.ts +28 -0
  91. package/dist/src/button/Copy.d.ts.map +1 -0
  92. package/dist/src/button/Copy.spec.d.ts +2 -0
  93. package/dist/src/button/Copy.spec.d.ts.map +1 -0
  94. package/dist/src/button/external.d.ts +1 -0
  95. package/dist/src/button/external.d.ts.map +1 -1
  96. package/dist/src/channel/queries.d.ts +1 -1
  97. package/dist/src/channel/queries.d.ts.map +1 -1
  98. package/dist/src/color/Provider.d.ts +11 -1
  99. package/dist/src/color/Provider.d.ts.map +1 -1
  100. package/dist/src/device/queries.d.ts +122 -72
  101. package/dist/src/device/queries.d.ts.map +1 -1
  102. package/dist/src/errors/Fallback.d.ts.map +1 -1
  103. package/dist/src/flux/base/store.d.ts +2 -2
  104. package/dist/src/flux/base/store.d.ts.map +1 -1
  105. package/dist/src/flux/list.d.ts.map +1 -1
  106. package/dist/src/flux/retrieve.d.ts +1 -1
  107. package/dist/src/flux/retrieve.d.ts.map +1 -1
  108. package/dist/src/form/useField.d.ts.map +1 -1
  109. package/dist/src/icon/EtherCAT.d.ts +2 -0
  110. package/dist/src/icon/EtherCAT.d.ts.map +1 -0
  111. package/dist/src/icon/registry.d.ts +4 -0
  112. package/dist/src/icon/registry.d.ts.map +1 -1
  113. package/dist/src/index.d.ts +2 -0
  114. package/dist/src/index.d.ts.map +1 -1
  115. package/dist/src/input/Numeric.d.ts.map +1 -1
  116. package/dist/src/json/SelectType.d.ts +8 -0
  117. package/dist/src/json/SelectType.d.ts.map +1 -0
  118. package/dist/src/json/external.d.ts +3 -0
  119. package/dist/src/json/external.d.ts.map +1 -0
  120. package/dist/src/json/index.d.ts +2 -0
  121. package/dist/src/json/index.d.ts.map +1 -0
  122. package/dist/src/json/primitive.d.ts +7 -0
  123. package/dist/src/json/primitive.d.ts.map +1 -0
  124. package/dist/src/json/primitive.spec.d.ts +2 -0
  125. package/dist/src/json/primitive.spec.d.ts.map +1 -0
  126. package/dist/src/label/queries.d.ts +30 -2
  127. package/dist/src/label/queries.d.ts.map +1 -1
  128. package/dist/src/lineplot/aether/XAxis.d.ts +40 -0
  129. package/dist/src/lineplot/aether/XAxis.d.ts.map +1 -1
  130. package/dist/src/lineplot/aether/YAxis.d.ts +40 -0
  131. package/dist/src/lineplot/aether/YAxis.d.ts.map +1 -1
  132. package/dist/src/lineplot/aether/axis.d.ts +20 -0
  133. package/dist/src/lineplot/aether/axis.d.ts.map +1 -1
  134. package/dist/src/lineplot/range/aether/provider.d.ts +90 -6
  135. package/dist/src/lineplot/range/aether/provider.d.ts.map +1 -1
  136. package/dist/src/lineplot/tooltip/aether/tooltip.d.ts +80 -0
  137. package/dist/src/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  138. package/dist/src/list/Frame.d.ts.map +1 -1
  139. package/dist/src/log/aether/Log.d.ts +30 -0
  140. package/dist/src/log/aether/Log.d.ts.map +1 -1
  141. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  142. package/dist/src/ranger/queries.d.ts +33 -5
  143. package/dist/src/ranger/queries.d.ts.map +1 -1
  144. package/dist/src/schematic/symbol/Forms.d.ts +2 -0
  145. package/dist/src/schematic/symbol/Forms.d.ts.map +1 -1
  146. package/dist/src/schematic/symbol/Primitives.d.ts +23 -0
  147. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
  148. package/dist/src/schematic/symbol/Symbols.d.ts +14 -0
  149. package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
  150. package/dist/src/schematic/symbol/queries.d.ts +6 -6
  151. package/dist/src/schematic/symbol/registry.d.ts +2 -0
  152. package/dist/src/schematic/symbol/registry.d.ts.map +1 -1
  153. package/dist/src/select/Frame.d.ts.map +1 -1
  154. package/dist/src/status/aether/errorHandler.d.ts.map +1 -1
  155. package/dist/src/status/queries.d.ts +3 -2
  156. package/dist/src/status/queries.d.ts.map +1 -1
  157. package/dist/src/table/cells/Cells.d.ts +20 -0
  158. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  159. package/dist/src/telem/aether/static.d.ts +10 -0
  160. package/dist/src/telem/aether/static.d.ts.map +1 -1
  161. package/dist/src/telem/aether/transformers.d.ts +15 -0
  162. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  163. package/dist/src/telem/control/Controller.d.ts +1 -0
  164. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  165. package/dist/src/telem/control/Legend.d.ts +4 -2
  166. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  167. package/dist/src/telem/control/aether/controller.d.ts +10 -0
  168. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  169. package/dist/src/telem/control/aether/indicator.d.ts +50 -0
  170. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  171. package/dist/src/telem/control/aether/legend.d.ts +22 -0
  172. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  173. package/dist/src/telem/control/aether/state.d.ts +13 -0
  174. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  175. package/dist/src/theming/aether/provider.d.ts +1476 -3
  176. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  177. package/dist/src/theming/base/theme.d.ts +980 -1
  178. package/dist/src/theming/base/theme.d.ts.map +1 -1
  179. package/dist/src/theming/css.d.ts.map +1 -1
  180. package/dist/src/tree/external.d.ts +1 -0
  181. package/dist/src/tree/external.d.ts.map +1 -1
  182. package/dist/src/user/queries.d.ts +1 -1
  183. package/dist/src/vis/axis/axis.d.ts +20 -0
  184. package/dist/src/vis/axis/axis.d.ts.map +1 -1
  185. package/dist/src/vis/gauge/aether/gauge.d.ts +30 -0
  186. package/dist/src/vis/gauge/aether/gauge.d.ts.map +1 -1
  187. package/dist/src/vis/gauge/use.d.ts +10 -0
  188. package/dist/src/vis/gauge/use.d.ts.map +1 -1
  189. package/dist/src/vis/line/aether/line.d.ts +10 -0
  190. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  191. package/dist/src/vis/measure/aether/measure.d.ts +80 -0
  192. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  193. package/dist/src/vis/rule/aether/aether.d.ts +20 -0
  194. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  195. package/dist/src/vis/stateIndicator/aether/index.d.ts +2 -0
  196. package/dist/src/vis/stateIndicator/aether/index.d.ts.map +1 -0
  197. package/dist/src/vis/stateIndicator/aether/stateIndicator.d.ts +48 -0
  198. package/dist/src/vis/stateIndicator/aether/stateIndicator.d.ts.map +1 -0
  199. package/dist/src/vis/stateIndicator/index.d.ts +2 -0
  200. package/dist/src/vis/stateIndicator/index.d.ts.map +1 -0
  201. package/dist/src/vis/stateIndicator/use.d.ts +9 -0
  202. package/dist/src/vis/stateIndicator/use.d.ts.map +1 -0
  203. package/dist/src/vis/value/aether/value.d.ts +60 -0
  204. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  205. package/dist/src/vis/value/redline.d.ts +5 -0
  206. package/dist/src/vis/value/redline.d.ts.map +1 -1
  207. package/dist/src/vis/value/use.d.ts +20 -0
  208. package/dist/src/vis/value/use.d.ts.map +1 -1
  209. package/dist/src/workspace/queries.d.ts +1 -1
  210. package/dist/stylelint.config.d.ts +3 -0
  211. package/dist/stylelint.config.d.ts.map +1 -0
  212. package/dist/tabs.cjs +1 -1
  213. package/dist/tabs.js +1 -1
  214. package/dist/text.cjs +1 -1
  215. package/dist/text.js +2 -2
  216. package/dist/theme.css +135 -123
  217. package/dist/theming.cjs +1 -1
  218. package/dist/theming.js +2 -2
  219. package/dist/tree.cjs +1 -1
  220. package/dist/tree.js +1 -1
  221. package/dist/triggers.cjs +1 -1
  222. package/dist/triggers.js +1 -1
  223. package/dist/{types-B5-Tni3G.js → types-CGRCBVD4.js} +2 -2
  224. package/dist/{types-C0tUDfsz.cjs → types-DI2vtOGs.cjs} +1 -1
  225. package/dist/units-Bu36uC6z.cjs +1 -0
  226. package/dist/units-DMip-eZH.js +14 -0
  227. package/dist/value-Bfn0uQuG.cjs +53 -0
  228. package/dist/{value-C-e017qO.js → value-DimszMFu.js} +2108 -2057
  229. package/dist/video.cjs +1 -1
  230. package/dist/video.js +1 -1
  231. package/package.json +23 -19
  232. package/dist/Animated-Bm-WM4BW.cjs +0 -1
  233. package/dist/Animated-DpzwlYqX.cjs +0 -1
  234. package/dist/Animated-eavjaVoD.js +0 -28
  235. package/dist/Box-D27bV7QJ.cjs +0 -1
  236. package/dist/Button-Cj2hR9EM.cjs +0 -1
  237. package/dist/Button-DulIBpNI.js +0 -308
  238. package/dist/Dialog-DJJQBUgw.cjs +0 -1
  239. package/dist/Editable-C-z-stcD.cjs +0 -1
  240. package/dist/Haul-gTF4QDh3.cjs +0 -1
  241. package/dist/Items-DjAwxhhi.cjs +0 -4
  242. package/dist/Menu-BqfIul2o.cjs +0 -1
  243. package/dist/Provider-CKROy_xK.cjs +0 -1
  244. package/dist/Tags-B3m_Kzbp.cjs +0 -1
  245. package/dist/Text-IFQH97iK.cjs +0 -1
  246. package/dist/Video-C56z7qvH.js +0 -9
  247. package/dist/Video-CBPTBLTB.cjs +0 -1
  248. package/dist/css-BkBrZtKZ.js +0 -5328
  249. package/dist/css-D3NdC2sx.cjs +0 -8
  250. package/dist/dimensions-C7b02rFi.cjs +0 -1
  251. package/dist/eraser-DZxY0pWe.cjs +0 -11
  252. package/dist/external-BIW55htp.cjs +0 -1
  253. package/dist/external-BWI-FZRf.cjs +0 -1
  254. package/dist/external-CUHCzUJE.cjs +0 -1
  255. package/dist/external-CVzhqlPH.js +0 -31
  256. package/dist/external-CkwpcNCW.cjs +0 -1
  257. package/dist/external-D4rp1QBE.cjs +0 -28
  258. package/dist/external-D7qXEQQM.cjs +0 -1
  259. package/dist/external-DAmwuDsu.cjs +0 -1
  260. package/dist/external-DPow1FDR.cjs +0 -1
  261. package/dist/external-DlHNhR1y.cjs +0 -1
  262. package/dist/fontString-CeR_vHX_.cjs +0 -1
  263. package/dist/hooks-Dxvxse16.cjs +0 -1
  264. package/dist/provider-BmDwHwF4.cjs +0 -78
  265. package/dist/provider-CfFukcDe.js +0 -16227
  266. package/dist/units-Bd_mf9Ye.cjs +0 -1
  267. package/dist/units-CEfK1L7C.js +0 -14
  268. package/dist/value-0g5Cxim9.cjs +0 -53
@@ -1,21 +1,24 @@
1
- import { E as h, T as C, A as d, S as B, Z as y, b as U, C as q } from "./css-BkBrZtKZ.js";
2
- import { z as _ } from "zod";
3
- import { g as x, C as z, h as K, j as W, k as Z, L as H } from "./provider-CfFukcDe.js";
4
- import { a as G } from "./dimensions-qj2CkPTy.js";
5
- const V = _.object({
6
- include: _.string().array().optional(),
7
- exclude: _.string().array().optional(),
8
- level: _.enum(x.LOG_LEVELS).default("info")
1
+ import { box as h, scale as y, xy as d, dimensions as k, color as C, unique as X } from "@synnaxlabs/x";
2
+ import { z as x } from "zod";
3
+ import { C as q, e as z, g as K, L as W } from "./provider-Bt-E2O6g.js";
4
+ import { alamos as _ } from "@synnaxlabs/alamos";
5
+ import { C as H } from "./css-D90kZTM8.js";
6
+ import { a as G } from "./dimensions-DbMN4145.js";
7
+ import { UnexpectedError as V } from "@synnaxlabs/client";
8
+ const Z = x.object({
9
+ include: x.string().array().optional(),
10
+ exclude: x.string().array().optional(),
11
+ level: x.enum(_.LOG_LEVELS).default("info")
9
12
  }), L = "alamos-provider";
10
- class v extends z {
13
+ class v extends q {
11
14
  static TYPE = "alamos.Provider";
12
- schema = V;
15
+ schema = Z;
13
16
  afterUpdate(t) {
14
17
  if (t.getOptional(L) != null) return;
15
18
  const s = [], { include: i, exclude: r, level: a } = this.state;
16
- (i != null || r != null) && s.push(x.logLevelKeyFiler({ include: i, exclude: r })), a != null && s.push(x.logThresholdFilter(a)), s.length === 0 && s.push(() => !1), this.internal.ins = new x.Instrumentation({
19
+ (i != null || r != null) && s.push(_.logLevelKeyFiler({ include: i, exclude: r })), a != null && s.push(_.logThresholdFilter(a)), s.length === 0 && s.push(() => !1), this.internal.ins = new _.Instrumentation({
17
20
  key: "aether",
18
- logger: new x.Logger({ filters: s })
21
+ logger: new _.Logger({ filters: s })
19
22
  }), t.set(L, this.internal.ins);
20
23
  }
21
24
  }
@@ -23,7 +26,7 @@ const J = (l, t) => {
23
26
  const e = l.get(L);
24
27
  if (e == null) throw new Error("No instrumentation provider");
25
28
  return t == null ? e : e.child(t);
26
- }, pt = {
29
+ }, gt = {
27
30
  [v.TYPE]: v
28
31
  }, T = (l, t) => h.construct(
29
32
  h.left(l) - t.x,
@@ -31,7 +34,7 @@ const J = (l, t) => {
31
34
  h.width(l) + t.x * 2,
32
35
  h.height(l) + t.y * 2
33
36
  );
34
- class E {
37
+ class R {
35
38
  scale_;
36
39
  wrapped;
37
40
  atlasRegistry;
@@ -46,7 +49,7 @@ class E {
46
49
  cachedLineJoin = null;
47
50
  cachedMiterLimit = null;
48
51
  dpr;
49
- constructor(t, e, s, i = C.XY.IDENTITY) {
52
+ constructor(t, e, s, i = y.XY.IDENTITY) {
50
53
  this.wrapped = t, this.scale_ = i, this.atlasRegistry = e, this.dpr = s;
51
54
  }
52
55
  get fontStretch() {
@@ -91,7 +94,7 @@ class E {
91
94
  this.wrapped.reset();
92
95
  }
93
96
  applyScale(t) {
94
- return new E(
97
+ return new R(
95
98
  this,
96
99
  this.atlasRegistry,
97
100
  this.dpr,
@@ -438,7 +441,7 @@ class E {
438
441
  }
439
442
  scissor(t, e = d.ZERO) {
440
443
  const s = new $(this.scale_);
441
- return t = T(t, e), s.rect(...d.couple(h.topLeft(t)), ...B.couple(h.dims(t))), this.save(), this.clip(s.getPath()), () => this.restore();
444
+ return t = T(t, e), s.rect(...d.couple(h.topLeft(t)), ...k.couple(h.dims(t))), this.save(), this.clip(s.getPath()), () => this.restore();
442
445
  }
443
446
  setTransform(t, e, s, i, r, a) {
444
447
  this.wrapped.setTransform(t, e, s, i, r, a);
@@ -453,7 +456,7 @@ class E {
453
456
  class $ {
454
457
  scale_;
455
458
  path;
456
- constructor(t = C.XY.IDENTITY, e) {
459
+ constructor(t = y.XY.IDENTITY, e) {
457
460
  this.scale_ = t, e instanceof Path2D || typeof e == "string" ? this.path = new Path2D(e) : this.path = new Path2D();
458
461
  }
459
462
  addPath(t, e) {
@@ -603,7 +606,7 @@ let et = class {
603
606
  * @param value - The value to set.
604
607
  */
605
608
  uniformColor(t, e) {
606
- this.renderCtx.gl.uniform4fv(this.getUniformLoc(t), y.rgba1(e));
609
+ this.renderCtx.gl.uniform4fv(this.getUniformLoc(t), C.rgba1(e));
607
610
  }
608
611
  getUniformLoc(t) {
609
612
  const e = this.uniformLocCache.get(t);
@@ -632,7 +635,7 @@ class it extends et {
632
635
  constructor(t) {
633
636
  super(t, j, Q);
634
637
  const e = t.gl.createBuffer();
635
- if (e == null) throw new K("webgl: failed to create buffer");
638
+ if (e == null) throw new V("webgl: failed to create buffer");
636
639
  this.positionBuffer = e, t.gl.bindBuffer(t.gl.ARRAY_BUFFER, this.positionBuffer), t.gl.bufferData(t.gl.ARRAY_BUFFER, st, t.gl.STATIC_DRAW);
637
640
  }
638
641
  exec() {
@@ -656,7 +659,7 @@ class rt {
656
659
  handleError;
657
660
  constructor({
658
661
  afterRender: t,
659
- instrumentation: e = x.Instrumentation.NOOP,
662
+ instrumentation: e = _.Instrumentation.NOOP,
660
663
  handleError: s
661
664
  }) {
662
665
  this.afterRender = t, this.instrumentation = e, this.handleError = s, this.start();
@@ -728,19 +731,19 @@ class b {
728
731
  constructor(t) {
729
732
  const { font: e, characters: s = b.DEFAULT_CHARS, textColor: i } = t;
730
733
  this.charMap = /* @__PURE__ */ new Map();
731
- const r = U.unique(Array.from(s)), n = new OffscreenCanvas(1, 1).getContext("2d");
734
+ const r = X.unique(Array.from(s)), n = new OffscreenCanvas(1, 1).getContext("2d");
732
735
  n.font = e;
733
736
  const o = n.measureText("0");
734
737
  this.charDims = G(o), this.charDims.width += S, this.charDims.height += S;
735
- const p = r.length, u = this.charDims.width, m = this.charDims.height, c = Math.ceil(Math.sqrt(p)), R = Math.ceil(p / c);
738
+ const p = r.length, u = this.charDims.width, m = this.charDims.height, c = Math.ceil(Math.sqrt(p)), E = Math.ceil(p / c);
736
739
  this.atlas = new OffscreenCanvas(
737
740
  u * c * g,
738
- m * (R + 1) * g
741
+ m * (E + 1) * g
739
742
  );
740
743
  const f = this.atlas.getContext("2d");
741
- f.scale(g, g), f.font = e, f.textBaseline = "alphabetic", f.textAlign = "left", f.fillStyle = y.hex(i), f.clearRect(0, 0, this.atlas.width, this.atlas.height), r.forEach((O, A) => {
742
- const M = A % c, Y = Math.floor(A / c), N = M * u, X = (Y + 1) * m;
743
- f.fillText(O, N, X), this.charMap.set(O, A);
744
+ f.scale(g, g), f.font = e, f.textBaseline = "alphabetic", f.textAlign = "left", f.fillStyle = C.hex(i), f.clearRect(0, 0, this.atlas.width, this.atlas.height), r.forEach((O, A) => {
745
+ const M = A % c, Y = Math.floor(A / c), N = M * u, U = (Y + 1) * m;
746
+ f.fillText(O, N, U), this.charMap.set(O, A);
744
747
  });
745
748
  }
746
749
  fillText(t, e, s, i) {
@@ -777,7 +780,7 @@ class at {
777
780
  * atlas does not exist in the registry, it is created and added to the registry.
778
781
  */
779
782
  get(t) {
780
- const e = `${t.font}-${y.hex(t.textColor)}-${t.characters}`;
783
+ const e = `${t.font}-${C.hex(t.textColor)}-${t.characters}`;
781
784
  if (this.atlases.has(e)) return this.atlases.get(e);
782
785
  const s = new b(t);
783
786
  return this.atlases.set(e, s), s;
@@ -806,7 +809,7 @@ class w {
806
809
  /** See the @link{clear.Program} for why this is necessary. */
807
810
  clearProgram;
808
811
  os;
809
- static CONTEXT_KEY = q.B("render-context");
812
+ static CONTEXT_KEY = H.B("render-context");
810
813
  instrumentation;
811
814
  static create(t, e, s, i, r) {
812
815
  const a = J(t, "render_context"), n = new w(
@@ -815,8 +818,8 @@ class w {
815
818
  i,
816
819
  r,
817
820
  a,
818
- W(t),
819
- Z(t)
821
+ z(t),
822
+ K(t)
820
823
  );
821
824
  return t.set(w.CONTEXT_KEY, n), n;
822
825
  }
@@ -826,12 +829,12 @@ class w {
826
829
  if (o == null) throw new Error("Could not get 2D context");
827
830
  const p = new at();
828
831
  this.lower2d = F(
829
- new E(o, p, this.dpr)
832
+ new R(o, p, this.dpr)
830
833
  );
831
834
  const u = this.upper2dCanvas.getContext("2d");
832
835
  if (u == null) throw new Error("Could not get 2D context");
833
836
  this.upper2d = F(
834
- new E(u, p, this.dpr)
837
+ new R(u, p, this.dpr)
835
838
  );
836
839
  const m = {
837
840
  preserveDrawingBuffer: !0,
@@ -844,11 +847,11 @@ class w {
844
847
  variant: "error",
845
848
  message: "WebGL context lost"
846
849
  });
847
- const R = () => {
850
+ const E = () => {
848
851
  this.gl.flush(), this.gl.finish();
849
852
  };
850
853
  this.loop = new rt({
851
- afterRender: R,
854
+ afterRender: E,
852
855
  instrumentation: this.instrumentation,
853
856
  handleError: n
854
857
  }), this.region = h.ZERO, this.os === "Windows" && (this.clearProgram = new it(this));
@@ -882,11 +885,11 @@ class w {
882
885
  * in the canvas.
883
886
  */
884
887
  scaleRegion(t) {
885
- return new C.XY(
888
+ return new y.XY(
886
889
  // Accept a value in decimal.
887
- C.Scale.scale(0, 1).scale(h.width(t)).translate(h.left(t)).reBound(h.width(this.region)).scale(-1, 1),
890
+ y.Scale.scale(0, 1).scale(h.width(t)).translate(h.left(t)).reBound(h.width(this.region)).scale(-1, 1),
888
891
  // Accept a value in decimal.
889
- C.Scale.scale(0, 1).scale(h.height(t)).invert().translate(h.top(t)).reBound(h.height(this.region)).scale(-1, 1).invert()
892
+ y.Scale.scale(0, 1).scale(h.height(t)).invert().translate(h.top(t)).reBound(h.height(this.region)).scale(-1, 1).invert()
890
893
  );
891
894
  }
892
895
  scissor(t, e = d.ZERO, s) {
@@ -906,18 +909,18 @@ class w {
906
909
  }
907
910
  eraseGL(t, e = d.ZERO) {
908
911
  const { gl: s } = this, i = this.scissorGL(T(t, e));
909
- s.clearColor(...y.rgba1(y.ZERO)), s.clear(s.COLOR_BUFFER_BIT), this.os === "Windows" && this.clearProgram?.exec(), i();
912
+ s.clearColor(...C.rgba1(C.ZERO)), s.clear(s.COLOR_BUFFER_BIT), this.os === "Windows" && this.clearProgram?.exec(), i();
910
913
  }
911
914
  eraseCanvas(t, e, s = d.ZERO) {
912
915
  const i = T(e, s);
913
- t.clearRect(...d.couple(h.topLeft(i)), ...B.couple(h.dims(i)));
916
+ t.clearRect(...d.couple(h.topLeft(i)), ...k.couple(h.dims(i)));
914
917
  }
915
918
  }
916
- const ht = _.object({
919
+ const ht = x.object({
917
920
  region: h.box,
918
- enabled: _.boolean().default(!1)
921
+ enabled: x.boolean().default(!1)
919
922
  }), I = ["gl", "lower2d", "upper2d"];
920
- class k extends H {
923
+ class B extends W {
921
924
  static TYPE = "eraser";
922
925
  schema = ht;
923
926
  afterUpdate(t) {
@@ -938,18 +941,18 @@ class k extends H {
938
941
  this.deleted || !this.state.enabled || this.internal.renderCtx.erase(this.state.region, d.construct(0), ...I);
939
942
  }
940
943
  }
941
- const ut = {
942
- [k.TYPE]: k
944
+ const wt = {
945
+ [B.TYPE]: B
943
946
  };
944
947
  export {
945
948
  w as C,
946
- k as E,
949
+ B as E,
947
950
  et as G,
948
951
  rt as L,
949
952
  v as P,
950
- ut as R,
951
- pt as a,
953
+ wt as R,
954
+ gt as a,
952
955
  ht as e,
953
- V as p,
956
+ Z as p,
954
957
  J as u
955
958
  };
@@ -0,0 +1,11 @@
1
+ "use strict";const a=require("@synnaxlabs/x"),m=require("zod"),C=require("./provider-DQkVj3tA.cjs"),x=require("@synnaxlabs/alamos"),X=require("./css-CloSmhZB.cjs"),I=require("./dimensions-CdFEW3oU.cjs"),K=require("@synnaxlabs/client"),B=m.z.object({include:m.z.string().array().optional(),exclude:m.z.string().array().optional(),level:m.z.enum(x.alamos.LOG_LEVELS).default("info")}),E="alamos-provider";class b extends C.Composite{static TYPE="alamos.Provider";schema=B;afterUpdate(t){if(t.getOptional(E)!=null)return;const s=[],{include:i,exclude:r,level:n}=this.state;(i!=null||r!=null)&&s.push(x.alamos.logLevelKeyFiler({include:i,exclude:r})),n!=null&&s.push(x.alamos.logThresholdFilter(n)),s.length===0&&s.push(()=>!1),this.internal.ins=new x.alamos.Instrumentation({key:"aether",logger:new x.alamos.Logger({filters:s})}),t.set(E,this.internal.ins)}}const k=(l,t)=>{const e=l.get(E);if(e==null)throw new Error("No instrumentation provider");return t==null?e:e.child(t)},W={[b.TYPE]:b},_=(l,t)=>a.box.construct(a.box.left(l)-t.x,a.box.top(l)-t.y,a.box.width(l)+t.x*2,a.box.height(l)+t.y*2);class S{scale_;wrapped;atlasRegistry;cachedFont=null;cachedFillStyle=null;cachedStrokeStyle=null;cachedLineWidth=null;cachedGlobalAlpha=null;cachedTextAlign=null;cachedTextBaseline=null;cachedLineCap=null;cachedLineJoin=null;cachedMiterLimit=null;dpr;constructor(t,e,s,i=a.scale.XY.IDENTITY){this.wrapped=t,this.scale_=i,this.atlasRegistry=e,this.dpr=s}get fontStretch(){return this.wrapped.fontStretch}set fontStretch(t){this.wrapped.fontStretch=t}get fontVariantCaps(){return this.wrapped.fontVariantCaps}set fontVariantCaps(t){this.wrapped.fontVariantCaps=t}isContextLost(){return this.wrapped.isContextLost()}get wordSpacing(){return this.wrapped.wordSpacing}set wordSpacing(t){this.wrapped.wordSpacing=t}get letterSpacing(){return this.wrapped.letterSpacing}set letterSpacing(t){this.wrapped.letterSpacing=t}get textRendering(){return this.wrapped.textRendering}set textRendering(t){this.wrapped.textRendering=t}checkAtlasFillStyle(t=!1){return t&&typeof this.fillStyle=="string"?[!0,this.fillStyle]:(t&&console.warn("attempted to use a text atlas with a gradient fill style. This is not supported. Falling back to default canvas fill."),[!1,null])}reset(){this.wrapped.reset()}applyScale(t){return new S(this,this.atlasRegistry,this.dpr,t)}get canvas(){return this.wrapped.canvas}get miterLimit(){return this.cachedMiterLimit??this.wrapped.miterLimit}set miterLimit(t){const e=this.scale_.x.dim(t);e!==this.cachedMiterLimit&&(this.cachedMiterLimit=e,this.wrapped.miterLimit=e)}get globalAlpha(){return this.cachedGlobalAlpha??this.wrapped.globalAlpha}set globalAlpha(t){t!==this.cachedGlobalAlpha&&(this.cachedGlobalAlpha=t,this.wrapped.globalAlpha=t)}get globalCompositeOperation(){return this.wrapped.globalCompositeOperation}set globalCompositeOperation(t){this.wrapped.globalCompositeOperation=t}get fillStyle(){return this.cachedFillStyle??this.wrapped.fillStyle}set fillStyle(t){t!==this.cachedFillStyle&&(this.cachedFillStyle=t,this.wrapped.fillStyle=t)}get strokeStyle(){return this.cachedStrokeStyle??this.wrapped.strokeStyle}set strokeStyle(t){t!==this.cachedStrokeStyle&&(this.cachedStrokeStyle=t,this.wrapped.strokeStyle=t)}drawImage(t,e,s,i,r,n,h,o,p){this.wrapped.drawImage(t,e,s,i,r,n!=null?this.scale_.x.pos(n):n,h!=null?this.scale_.y.pos(h):h,o!=null?this.scale_.x.dim(o):o,p!=null?this.scale_.y.dim(p):p)}beginPath(){this.wrapped.beginPath()}clip(t,e){this.wrapped.clip(t,e)}fill(t,e){if(t==null)return this.wrapped.fill();this.wrapped.fill(t,e)}isPointInPath(t,e,s,i){return this.wrapped.isPointInPath(t,e,s,i)}isPointInStroke(t,e,s){return this.wrapped.isPointInStroke(t,e,s)}stroke(t){if(t==null)return this.wrapped.stroke();this.wrapped.stroke(t)}createConicGradient(t,e,s){return this.wrapped.createConicGradient(t,e,s)}createLinearGradient(t,e,s,i){return this.wrapped.createLinearGradient(t,e,s,i)}createPattern(t,e){return this.wrapped.createPattern(t,e)}createRadialGradient(t,e,s,i,r,n){return this.wrapped.createRadialGradient(t,e,s,i,r,n)}get filter(){return this.wrapped.filter}set filter(t){this.wrapped.filter=t}createImageData(t,e,s){return this.wrapped.createImageData(t,e,s)}getImageData(t,e,s,i,r){return this.wrapped.getImageData(t,e,s,i,r)}putImageData(t,e,s,i,r,n,h){this.wrapped.putImageData(t,e,s,i,r,n,h)}get imageSmoothingEnabled(){return this.wrapped.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.wrapped.imageSmoothingEnabled=t}get imageSmoothingQuality(){return this.wrapped.imageSmoothingQuality}set imageSmoothingQuality(t){this.wrapped.imageSmoothingQuality=t}arc(t,e,s,i,r,n){this.wrapped.arc(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),i,r,n)}arcTo(t,e,s,i,r){this.wrapped.arcTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.dim(r))}bezierCurveTo(t,e,s,i,r,n){this.wrapped.bezierCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.pos(r),this.scale_.y.pos(n))}closePath(){this.wrapped.closePath()}ellipse(t,e,s,i,r,n,h,o){this.wrapped.ellipse(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),r,n,h,o)}lineTo(t,e){this.wrapped.lineTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}moveTo(t,e){this.wrapped.moveTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}quadraticCurveTo(t,e,s,i){this.wrapped.quadraticCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i))}rect(t,e,s,i){this.wrapped.rect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}roundRect(t,e,s,i,r){this.wrapped.roundRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),typeof r=="number"?this.scale_.x.dim(r):r)}get lineCap(){return this.cachedLineCap??this.wrapped.lineCap}set lineCap(t){t!==this.cachedLineCap&&(this.cachedLineCap=t,this.wrapped.lineCap=t)}get lineDashOffset(){return this.wrapped.lineDashOffset}set lineDashOffset(t){this.wrapped.lineDashOffset=this.scale_.x.dim(t)}get lineJoin(){return this.cachedLineJoin??this.wrapped.lineJoin}set lineJoin(t){t!==this.cachedLineJoin&&(this.cachedLineJoin=t,this.wrapped.lineJoin=t)}get lineWidth(){return this.cachedLineWidth??this.wrapped.lineWidth}set lineWidth(t){const e=this.scale_.x.dim(t);e!==this.cachedLineWidth&&(this.cachedLineWidth=e,this.wrapped.lineWidth=e)}getLineDash(){return this.wrapped.getLineDash()}setLineDash(t){const e=Array.from(t).map(s=>this.scale_.x.dim(s));this.wrapped.setLineDash(e)}clearRect(t,e,s,i){this.wrapped.clearRect(t,e,s,i)}fillRect(t,e,s,i){this.wrapped.fillRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}strokeRect(t,e,s,i){this.wrapped.strokeRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}get shadowBlur(){return this.wrapped.shadowBlur}set shadowBlur(t){this.wrapped.shadowBlur=t}get shadowColor(){return this.wrapped.shadowColor}set shadowColor(t){this.wrapped.shadowColor=t}get shadowOffsetX(){return this.wrapped.shadowOffsetX}set shadowOffsetX(t){this.wrapped.shadowOffsetX=t}get shadowOffsetY(){return this.wrapped.shadowOffsetY}restore(){this.cachedFillStyle=null,this.cachedStrokeStyle=null,this.cachedLineWidth=null,this.cachedGlobalAlpha=null,this.cachedTextAlign=null,this.cachedTextBaseline=null,this.cachedLineCap=null,this.cachedLineJoin=null,this.cachedMiterLimit=null,this.cachedFont=null,this.wrapped.restore()}save(){this.wrapped.save()}fillText(t,e,s,i,r={}){const[n,h]=this.checkAtlasFillStyle(r.useAtlas);if(n){this.atlasRegistry.get({font:this.font,textColor:h}).fillText(this,t,e,s);return}this.wrapped.fillText(t,this.scale_.x.pos(e),this.scale_.y.pos(s),i!=null?this.scale_.x.dim(i):void 0)}measureText(t){return this.wrapped.measureText(t)}textDimensions(t,e={}){const[s,i]=this.checkAtlasFillStyle(e.useAtlas);return s?this.atlasRegistry.get({font:this.font,textColor:i}).measureText(t):I.dimensionsFromMetrics(this.measureText(t))}strokeText(t,e,s,i){this.wrapped.strokeText(t,this.scale_.x.pos(e),this.scale_.y.pos(s),i!=null?this.scale_.x.dim(i):void 0)}get direction(){return this.wrapped.direction}set direction(t){this.wrapped.direction=t}get font(){return this.cachedFont!=null?this.cachedFont:this.wrapped.font}set font(t){t!==this.cachedFont&&(this.cachedFont=t,this.wrapped.font=this.cachedFont)}get fontKerning(){return this.wrapped.fontKerning}set fontKerning(t){this.wrapped.fontKerning=t}get textAlign(){return this.cachedTextAlign??this.wrapped.textAlign}set textAlign(t){t!==this.cachedTextAlign&&(this.cachedTextAlign=t,this.wrapped.textAlign=t)}get textBaseline(){return this.cachedTextBaseline??this.wrapped.textBaseline}set textBaseline(t){t!==this.cachedTextBaseline&&(this.cachedTextBaseline=t,this.wrapped.textBaseline=t)}getTransform(){return this.wrapped.getTransform()}resetTransform(){this.wrapped.resetTransform()}rotate(t){this.wrapped.rotate(t)}scale(t,e){this.wrapped.scale(t,e),this.dpr=t}scissor(t,e=a.xy.ZERO){const s=new Z(this.scale_);return t=_(t,e),s.rect(...a.xy.couple(a.box.topLeft(t)),...a.dimensions.couple(a.box.dims(t))),this.save(),this.clip(s.getPath()),()=>this.restore()}setTransform(t,e,s,i,r,n){this.wrapped.setTransform(t,e,s,i,r,n)}transform(t,e,s,i,r,n){this.wrapped.transform(t,e,s,i,r,n)}translate(t,e){this.wrapped.translate(t,e)}}class Z{scale_;path;constructor(t=a.scale.XY.IDENTITY,e){this.scale_=t,e instanceof Path2D||typeof e=="string"?this.path=new Path2D(e):this.path=new Path2D}addPath(t,e){this.path.addPath(t,e)}arc(t,e,s,i,r,n){this.path.arc(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),i,r,n)}arcTo(t,e,s,i,r){this.path.arcTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.dim(r))}bezierCurveTo(t,e,s,i,r,n){this.path.bezierCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.pos(r),this.scale_.y.pos(n))}closePath(){this.path.closePath()}ellipse(t,e,s,i,r,n,h,o){this.path.ellipse(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),r,n,h,o)}lineTo(t,e){this.path.lineTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}moveTo(t,e){this.path.moveTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}quadraticCurveTo(t,e,s,i){this.path.quadraticCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i))}rect(t,e,s,i){this.path.rect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}roundRect(t,e,s,i,r){const n=this.scaleRadii(r);this.path.roundRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),n)}scaleRadii(t){return t==null?t:typeof t=="number"?this.scale_.x.dim(t):Array.isArray(t)?t.map(e=>this.scaleRadius(e)):this.scaleRadius(t)}scaleRadius(t){return typeof t=="number"?this.scale_.x.dim(t):{x:this.scale_.x.dim(t.x??0),y:this.scale_.y.dim(t.y??0)}}getPath(){return this.path}}const H=`precision mediump float;
2
+
3
+ void main(void) {
4
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
5
+ }
6
+ `,V=`attribute vec4 a_position;
7
+
8
+ void main(void) {
9
+ gl_Position = a_position;
10
+ }
11
+ `,v=l=>new Error(`failed to compile webgl program: ${l}`),J=new Error("null shader encountered");let G=class{renderCtx;prog;vertShader;fragShader;uniformLocCache=new Map;constructor(t,e,s){this.renderCtx=t;const i=t.gl.createProgram();if(i==null)throw v("failed to create program");this.prog=i,this.vertShader=e,this.fragShader=s,this.compile()}setAsActive(){return this.renderCtx.gl.useProgram(this.prog),()=>this.renderCtx.gl.useProgram(null)}uniformXY(t,e){this.renderCtx.gl.uniform2fv(this.getUniformLoc(t),a.xy.couple(e))}uniformColor(t,e){this.renderCtx.gl.uniform4fv(this.getUniformLoc(t),a.color.rgba1(e))}getUniformLoc(t){const e=this.uniformLocCache.get(t);if(e!=null)return e;const s=this.renderCtx.gl.getUniformLocation(this.prog,t);if(s==null)throw new Error(`unexpected missing uniform ${t}`);return this.uniformLocCache.set(t,s),s}compile(){const t=this.renderCtx.gl;this.compileShader(this.vertShader,t.VERTEX_SHADER),this.compileShader(this.fragShader,t.FRAGMENT_SHADER),t.linkProgram(this.prog)}compileShader(t,e){const s=this.renderCtx.gl,i=s.createShader(e);if(i==null)throw J;if(s.shaderSource(i,t),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS)){const n=s.getShaderInfoLog(i);throw s.deleteShader(i),v(n??"unknown")}s.attachShader(this.prog,i)}};const $=new Float32Array([0,0,0,0,0,0]);class Q extends G{positionBuffer;constructor(t){super(t,V,H);const e=t.gl.createBuffer();if(e==null)throw new K.UnexpectedError("webgl: failed to create buffer");this.positionBuffer=e,t.gl.bindBuffer(t.gl.ARRAY_BUFFER,this.positionBuffer),t.gl.bufferData(t.gl.ARRAY_BUFFER,$,t.gl.STATIC_DRAW)}exec(){const{gl:t}=this.renderCtx,e=t.getAttribLocation(this.prog,"a_position");t.bindBuffer(t.ARRAY_BUFFER,this.positionBuffer);const s=t.createVertexArray();t.bindVertexArray(s),t.enableVertexAttribArray(e),t.vertexAttribPointer(e,2,t.FLOAT,!1,0,0),this.setAsActive(),t.drawArrays(t.TRIANGLES,0,3)}}const D={high:1,low:0};class M{requests=new Map;cleanup=new Map;afterRender;instrumentation;handleError;constructor({afterRender:t,instrumentation:e=x.alamos.Instrumentation.NOOP,handleError:s}){this.afterRender=t,this.instrumentation=e,this.handleError=s,this.start()}set(t){const e=this.requests.get(t.key);if(e==null)this.requests.set(t.key,t);else{const s=D[t.priority]>=D[e.priority],i=t.canvases.length>=e.canvases.length;s&&i&&this.requests.set(t.key,t)}}render(){const{requests:t}=this;t.size!==0&&(this.runCleanupsSync(),this.renderSync(),this.requests.clear(),this.afterRender?.())}runCleanupsSync(){const{cleanup:t,requests:e}=this;t.forEach((s,i)=>{const r=e.get(i);r!=null&&(s(r),t.delete(i))})}renderSync(){const{requests:t}=this;t.forEach(e=>{try{const s=e.render();s!=null&&this.cleanup.set(e.key,s)}catch(s){this.handleError(s,"render loop failed")}})}start(){const t=()=>{try{this.render()}catch(e){this.handleError(e,"render loop failed")}requestAnimationFrame(t)};requestAnimationFrame(t)}}const y=2,u=2;class L{atlas;charDims;charMap;static DEFAULT_CHARS="0123456789.:-°µmsNa∞ᴇABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz%";constructor(t){const{font:e,characters:s=L.DEFAULT_CHARS,textColor:i}=t;this.charMap=new Map;const r=a.unique.unique(Array.from(s)),h=new OffscreenCanvas(1,1).getContext("2d");h.font=e;const o=h.measureText("0");this.charDims=I.dimensionsFromMetrics(o),this.charDims.width+=y,this.charDims.height+=y;const p=r.length,d=this.charDims.width,w=this.charDims.height,c=Math.ceil(Math.sqrt(p)),T=Math.ceil(p/c);this.atlas=new OffscreenCanvas(d*c*u,w*(T+1)*u);const f=this.atlas.getContext("2d");f.scale(u,u),f.font=e,f.textBaseline="alphabetic",f.textAlign="left",f.fillStyle=a.color.hex(i),f.clearRect(0,0,this.atlas.width,this.atlas.height),r.forEach((O,R)=>{const q=R%c,z=Math.floor(R/c),N=q*d,U=(z+1)*w;f.fillText(O,N,U),this.charMap.set(O,R)})}fillText(t,e,s,i){const{width:r,height:n}=this.charDims,h=Math.ceil(Math.sqrt(this.charMap.size));t.textAlign==="center"&&(s-=r*e.length/2),t.textBaseline==="middle"&&(i+=n/2);for(let o=0;o<e.length;o++){const p=e[o],d=this.charMap.get(p);if(d===void 0)continue;const w=d%h,c=Math.floor(d/h);t.drawImage(this.atlas,w*r*u,c*n*u+y,r*u,n*u,s+o*r,i-n-y/u,r,n)}}measureText(t){return{width:t.length*this.charDims.width,height:this.charDims.height}}}class j{atlases;constructor(){this.atlases=new Map}get(t){const e=`${t.font}-${a.color.hex(t.textColor)}-${t.characters}`;if(this.atlases.has(e))return this.atlases.get(e);const s=new L(t);return this.atlases.set(e,s),s}}const P=l=>(l.textRendering="optimizeSpeed",l.imageSmoothingEnabled=!1,l);class g{glCanvas;upper2dCanvas;lower2dCanvas;gl;lower2d;upper2d;region;dpr;loop;clearProgram;os;static CONTEXT_KEY=X.CSS.B("render-context");instrumentation;static create(t,e,s,i,r){const n=k(t,"render_context"),h=new g(e,s,i,r,n,C.useAdder(t),C.useErrorHandler(t));return t.set(g.CONTEXT_KEY,h),h}constructor(t,e,s,i,r,n,h){this.upper2dCanvas=s,this.lower2dCanvas=e,this.glCanvas=t,this.os=i,this.instrumentation=r,this.dpr=1;const o=this.lower2dCanvas.getContext("2d");if(o==null)throw new Error("Could not get 2D context");const p=new j;this.lower2d=P(new S(o,p,this.dpr));const d=this.upper2dCanvas.getContext("2d");if(d==null)throw new Error("Could not get 2D context");this.upper2d=P(new S(d,p,this.dpr));const w={preserveDrawingBuffer:!0,powerPreference:"high-performance",stencil:!1,depth:!1},c=this.glCanvas.getContext("webgl2",w);if(c==null)throw new Error("Could not get WebGL context");c.disable(c.DEPTH_TEST),c.disable(c.STENCIL_TEST),c.disable(c.CULL_FACE),c.disable(c.DITHER),this.gl=c,this.glCanvas.oncontextlost=()=>n({variant:"error",message:"WebGL context lost"});const T=()=>{this.gl.flush(),this.gl.finish()};this.loop=new M({afterRender:T,instrumentation:this.instrumentation,handleError:h}),this.region=a.box.ZERO,this.os==="Windows"&&(this.clearProgram=new Q(this))}static useOptional(t){return t.getOptional(g.CONTEXT_KEY)}static use(t){return t.get(g.CONTEXT_KEY)}update(t){t.set(g.CONTEXT_KEY,this)}resize(t,e){a.box.equals(this.region,t)&&this.dpr===e||(this.region=t,this.dpr=e,this.resizeCanvas(this.glCanvas),this.resizeCanvas(this.upper2dCanvas),this.resizeCanvas(this.lower2dCanvas),this.lower2d.scale(this.dpr,this.dpr),this.upper2d.scale(this.dpr,this.dpr),this.gl.viewport(0,0,a.box.width(t)*e,a.box.height(t)*e))}resizeCanvas(t){t.width=a.box.width(this.region)*this.dpr,t.height=a.box.height(this.region)*this.dpr}get aspect(){return a.box.aspect(this.region)}scaleRegion(t){return new a.scale.XY(a.scale.Scale.scale(0,1).scale(a.box.width(t)).translate(a.box.left(t)).reBound(a.box.width(this.region)).scale(-1,1),a.scale.Scale.scale(0,1).scale(a.box.height(t)).invert().translate(a.box.top(t)).reBound(a.box.height(this.region)).scale(-1,1).invert())}scissor(t,e=a.xy.ZERO,s){const i=[];return s.includes("upper2d")&&i.push(this.upper2d.scissor(t,e)),s.includes("lower2d")&&i.push(this.lower2d.scissor(t,e)),s.includes("gl")&&i.push(this.scissorGL(t,e)),()=>i.forEach(r=>r())}scissorGL(t,e=a.xy.ZERO){return this.gl.enable(this.gl.SCISSOR_TEST),t=_(t,e),this.gl.scissor(a.box.left(t)*this.dpr,(a.box.height(this.region)-a.box.bottom(t))*this.dpr,a.box.width(t)*this.dpr,a.box.height(t)*this.dpr),()=>this.gl.disable(this.gl.SCISSOR_TEST)}erase(t,e=a.xy.ZERO,...s){e=a.xy.construct(e),s.length===0&&(s=["upper2d","lower2d","gl"]),s.includes("upper2d")&&this.eraseCanvas(this.upper2d,t,e),s.includes("lower2d")&&this.eraseCanvas(this.lower2d,t,e),s.includes("gl")&&this.eraseGL(t,e)}eraseGL(t,e=a.xy.ZERO){const{gl:s}=this,i=this.scissorGL(_(t,e));s.clearColor(...a.color.rgba1(a.color.ZERO)),s.clear(s.COLOR_BUFFER_BIT),this.os==="Windows"&&this.clearProgram?.exec(),i()}eraseCanvas(t,e,s=a.xy.ZERO){const i=_(e,s);t.clearRect(...a.xy.couple(a.box.topLeft(i)),...a.dimensions.couple(a.box.dims(i)))}}const Y=m.z.object({region:a.box.box,enabled:m.z.boolean().default(!1)}),F=["gl","lower2d","upper2d"];class A extends C.Leaf{static TYPE="eraser";schema=Y;afterUpdate(t){this.deleted||(this.internal.renderCtx=g.use(t),this.renderOnLifecycleChange())}afterDelete(){this.renderOnLifecycleChange()}renderOnLifecycleChange(){this.internal.renderCtx.loop.set({key:`${this.type}-${this.key}`,render:this.render.bind(this),priority:"high",canvases:F})}render(){this.deleted||!this.state.enabled||this.internal.renderCtx.erase(this.state.region,a.xy.construct(0),...F)}}const tt={[A.TYPE]:A};exports.Context=g;exports.Eraser=A;exports.GLProgram=G;exports.Loop=M;exports.Provider=b;exports.REGISTRY=tt;exports.REGISTRY$1=W;exports.eraserStateZ=Y;exports.providerStateZ=B;exports.useInstrumentation=k;
@@ -1,3 +1,3 @@
1
- import { default as synnaxConfig } from 'eslint-config-synnaxlabs';
2
- export default synnaxConfig;
1
+ import { default as cfg } from '@synnaxlabs/eslint-config';
2
+ export default cfg;
3
3
  //# sourceMappingURL=eslint.config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":"AASA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":"AASA,OAAO,GAAG,MAAM,2BAA2B,CAAC;AAE5C,eAAe,GAAG,CAAC"}
package/dist/ether.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./provider-BmDwHwF4.cjs"),e=require("./value-0g5Cxim9.cjs"),i=require("./css-D3NdC2sx.cjs"),o=require("./eraser-DZxY0pWe.cjs");require("react");require("./types-C0tUDfsz.cjs");const s=require("./fontString-CeR_vHX_.cjs"),l=Object.freeze(Object.defineProperty({__proto__:null,Provider:t.Provider,REGISTRY:t.REGISTRY,SYNNAX_DARK:t.SYNNAX_DARK,SYNNAX_LIGHT:t.SYNNAX_LIGHT,SYNNAX_THEMES:t.SYNNAX_THEMES,fontSpecZ:t.fontSpecZ,fontString:s.fontString,themeZ:t.themeZ,use:t.use},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null,Context:o.Context,GLProgram:o.GLProgram,Loop:o.Loop,control:e.control,request:e.request,useOptionalRequestor:e.useOptionalRequestor,useRequestor:e.useRequestor},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,LinePlot:e.LinePlot,REGISTRY:e.REGISTRY,XAxis:e.XAxis,YAxis:e.YAxis,linePlotMethodsZ:e.linePlotMethodsZ,linePlotStateZ:e.linePlotStateZ,xAxisStateZ:e.xAxisStateZ,yAxisStateZ:e.yAxisStateZ},Symbol.toStringTag,{value:"Module"})),_={[e.FLUX_STORE_KEY$2]:e.FLUX_STORE_CONFIG$2,[e.RELATIONSHIPS_FLUX_STORE_KEY]:e.RELATIONSHIP_FLUX_STORE_CONFIG,[e.RESOURCES_FLUX_STORE_KEY]:e.RESOURCE_FLUX_STORE_CONFIG,[e.FLUX_STORE_KEY$1]:e.FLUX_STORE_CONFIG$1,[e.FLUX_STORE_KEY]:e.FLUX_STORE_CONFIG},a=()=>{const r=new i.fn((S,n)=>postMessage(S,n));onmessage=r.handle.bind(r);const R={...o.REGISTRY$1,...e.REGISTRY$19,...e.REGISTRY$18,...e.REGISTRY$17,...e.REGISTRY$16,...o.REGISTRY,...e.REGISTRY$15,...e.REGISTRY$14,...e.REGISTRY$13,...e.REGISTRY,...e.REGISTRY$12,...e.REGISTRY$11,...e.REGISTRY$10,...e.REGISTRY$9,...t.REGISTRY$1,...e.REGISTRY$8,...e.REGISTRY$7,...t.REGISTRY,...e.REGISTRY$6,...e.REGISTRY$5,...e.REGISTRY$4,...e.REGISTRY$3,...e.REGISTRY$2,...e.REGISTRY$1,...e.createRegistry({storeConfig:_})};t.render({comms:r.route("vis"),registry:R,instrumentation:new t.O({logger:new t._({filters:[t.be("info")]})})})},u=Object.freeze(Object.defineProperty({__proto__:null,render:a},Symbol.toStringTag,{value:"Module"}));exports.aether=t.aether;exports.canvas=e.canvas;exports.diagram=e.Diagram;exports.measure=e.measure;exports.rule=e.aether;exports.synnax=e.provider;exports.telem=e.external;exports.tooltip=e.tooltip;exports.value=e.value;exports.lineplot=T;exports.pluto=u;exports.render=E;exports.theming=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./provider-DQkVj3tA.cjs"),e=require("./value-Bfn0uQuG.cjs"),R=require("@synnaxlabs/alamos"),l=require("@synnaxlabs/x"),o=require("./eraser-rFMFKqsg.cjs");require("react");require("@synnaxlabs/client");require("./types-DI2vtOGs.cjs");const s=require("./fontString-BNnhiwug.cjs"),E=Object.freeze(Object.defineProperty({__proto__:null,Provider:t.Provider,REGISTRY:t.REGISTRY,SYNNAX_DARK:t.SYNNAX_DARK,SYNNAX_LIGHT:t.SYNNAX_LIGHT,SYNNAX_THEMES:t.SYNNAX_THEMES,fontSpecZ:t.fontSpecZ,fontString:s.fontString,themeZ:t.themeZ,use:t.use},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,Context:o.Context,GLProgram:o.GLProgram,Loop:o.Loop,control:e.control,request:e.request,useOptionalRequestor:e.useOptionalRequestor,useRequestor:e.useRequestor},Symbol.toStringTag,{value:"Module"})),a=Object.freeze(Object.defineProperty({__proto__:null,LinePlot:e.LinePlot,REGISTRY:e.REGISTRY,XAxis:e.XAxis,YAxis:e.YAxis,linePlotMethodsZ:e.linePlotMethodsZ,linePlotStateZ:e.linePlotStateZ,xAxisStateZ:e.xAxisStateZ,yAxisStateZ:e.yAxisStateZ},Symbol.toStringTag,{value:"Module"})),u={[e.FLUX_STORE_KEY$2]:e.FLUX_STORE_CONFIG$2,[e.RELATIONSHIPS_FLUX_STORE_KEY]:e.RELATIONSHIP_FLUX_STORE_CONFIG,[e.RESOURCES_FLUX_STORE_KEY]:e.RESOURCE_FLUX_STORE_CONFIG,[e.FLUX_STORE_KEY$1]:e.FLUX_STORE_CONFIG$1,[e.FLUX_STORE_KEY]:e.FLUX_STORE_CONFIG},_=()=>{const r=new l.RoutedWorker((n,i)=>postMessage(n,i));onmessage=r.handle.bind(r);const S={...o.REGISTRY$1,...e.REGISTRY$20,...e.REGISTRY$19,...e.REGISTRY$18,...e.REGISTRY$17,...o.REGISTRY,...e.REGISTRY$16,...e.REGISTRY$15,...e.REGISTRY$14,...e.REGISTRY,...e.REGISTRY$13,...e.REGISTRY$12,...e.REGISTRY$11,...e.REGISTRY$10,...e.REGISTRY$9,...t.REGISTRY$1,...e.REGISTRY$8,...e.REGISTRY$7,...t.REGISTRY,...e.REGISTRY$6,...e.REGISTRY$5,...e.REGISTRY$4,...e.REGISTRY$3,...e.REGISTRY$2,...e.REGISTRY$1,...e.createRegistry({storeConfig:u})};t.render({comms:r.route("vis"),registry:S,instrumentation:new R.Instrumentation({logger:new R.Logger({filters:[R.logThresholdFilter("info")]})})})},I=Object.freeze(Object.defineProperty({__proto__:null,render:_},Symbol.toStringTag,{value:"Module"}));exports.aether=t.aether;exports.canvas=e.canvas;exports.diagram=e.Diagram;exports.measure=e.measure;exports.rule=e.aether;exports.synnax=e.provider;exports.telem=e.external;exports.tooltip=e.tooltip;exports.value=e.value;exports.lineplot=a;exports.pluto=I;exports.render=T;exports.theming=E;
package/dist/ether.js CHANGED
@@ -1,101 +1,104 @@
1
- import { P as r, R as s, S, a as n, b as E, f as T, t as _, u as l, c as i, r as I, O as G, _ as Y, d as O } from "./provider-CfFukcDe.js";
2
- import { e as be } from "./provider-CfFukcDe.js";
3
- import { c as $, r as m, u as f, a as p, L as u, R as a, X as c, Y as g, l as d, b as L, x as b, y as F, d as N, e as X, f as x, g as P, h as y, i as U, j as C, k as A, m as j, n as v, o as M, p as h, q as K, s as Z, t as w, v as z, w as H, z as q, A as k, B as D, F as B, C as J, D as Q, E as V, G as W, H as ee, I as se, J as ae, K as te, M as oe } from "./value-C-e017qO.js";
4
- import { Q as Ne, S as Xe, T as xe, U as Pe, O as ye, P as Ue, N as Ce, V as Ae } from "./value-C-e017qO.js";
5
- import { f as Re } from "./css-BkBrZtKZ.js";
6
- import { C as re, G as Se, L as ne, R as Ee, a as Te } from "./eraser-Bd14L_5k.js";
1
+ import { P as R, R as s, S, a as n, b as E, f as T, t as i, u as l, c as _, r as I } from "./provider-Bt-E2O6g.js";
2
+ import { d as Xe } from "./provider-Bt-E2O6g.js";
3
+ import { c as G, r as Y, u as m, a as $, L as O, R as a, X as p, Y as u, l as f, b as g, x as c, y as d, d as L, e as F, f as b, g as N, h as X, i as x, j as P, k as y, m as U, n as C, o as A, p as j, q as v, s as h, t as M, v as K, w as Z, z as w, A as z, B as H, C as q, F as k, D, E as W, G as B, H as J, I as Q, J as V, K as ee, M as se, N as ae } from "./value-DimszMFu.js";
4
+ import { O as Pe, P as ye, Q as Ue, S as Ce, T as Ae, U as je, V as ve, W as he } from "./value-DimszMFu.js";
5
+ import { Instrumentation as te, Logger as oe, logThresholdFilter as re } from "@synnaxlabs/alamos";
6
+ import { RoutedWorker as Re } from "@synnaxlabs/x";
7
+ import { C as Se, G as ne, L as Ee, R as Te, a as ie } from "./eraser-BShvqlBE.js";
7
8
  import "react";
8
- import "./types-B5-Tni3G.js";
9
- import { f as _e } from "./fontString-BtjO8Met.js";
10
- const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9
+ import "@synnaxlabs/client";
10
+ import "./types-CGRCBVD4.js";
11
+ import { f as le } from "./fontString-76R2eWDd.js";
12
+ const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11
13
  __proto__: null,
12
- Provider: r,
14
+ Provider: R,
13
15
  REGISTRY: s,
14
16
  SYNNAX_DARK: S,
15
17
  SYNNAX_LIGHT: n,
16
18
  SYNNAX_THEMES: E,
17
19
  fontSpecZ: T,
18
- fontString: _e,
19
- themeZ: _,
20
+ fontString: le,
21
+ themeZ: i,
20
22
  use: l
21
- }, Symbol.toStringTag, { value: "Module" })), ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
23
+ }, Symbol.toStringTag, { value: "Module" })), de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22
24
  __proto__: null,
23
- Context: re,
24
- GLProgram: Se,
25
- Loop: ne,
26
- control: $,
27
- request: m,
28
- useOptionalRequestor: f,
29
- useRequestor: p
30
- }, Symbol.toStringTag, { value: "Module" })), ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
+ Context: Se,
26
+ GLProgram: ne,
27
+ Loop: Ee,
28
+ control: G,
29
+ request: Y,
30
+ useOptionalRequestor: m,
31
+ useRequestor: $
32
+ }, Symbol.toStringTag, { value: "Module" })), Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31
33
  __proto__: null,
32
- LinePlot: u,
34
+ LinePlot: O,
33
35
  REGISTRY: a,
34
- XAxis: c,
35
- YAxis: g,
36
- linePlotMethodsZ: d,
37
- linePlotStateZ: L,
38
- xAxisStateZ: b,
39
- yAxisStateZ: F
40
- }, Symbol.toStringTag, { value: "Module" })), le = {
41
- [oe]: W,
42
- [te]: V,
43
- [ae]: Q,
44
- [se]: J,
45
- [ee]: B
46
- }, ie = () => {
47
- const e = new Re((o, R) => postMessage(o, R));
36
+ XAxis: p,
37
+ YAxis: u,
38
+ linePlotMethodsZ: f,
39
+ linePlotStateZ: g,
40
+ xAxisStateZ: c,
41
+ yAxisStateZ: d
42
+ }, Symbol.toStringTag, { value: "Module" })), _e = {
43
+ [ae]: J,
44
+ [se]: B,
45
+ [ee]: W,
46
+ [V]: D,
47
+ [Q]: k
48
+ }, Ie = () => {
49
+ const e = new Re((o, r) => postMessage(o, r));
48
50
  onmessage = e.handle.bind(e);
49
51
  const t = {
50
- ...Te,
51
- ...k,
52
- ...q,
52
+ ...ie,
53
53
  ...H,
54
54
  ...z,
55
- ...Ee,
56
55
  ...w,
57
56
  ...Z,
57
+ ...Te,
58
58
  ...K,
59
- ...a,
60
- ...h,
61
59
  ...M,
60
+ ...h,
61
+ ...a,
62
62
  ...v,
63
63
  ...j,
64
- ...i,
65
64
  ...A,
66
65
  ...C,
67
- ...s,
68
66
  ...U,
67
+ ..._,
69
68
  ...y,
70
69
  ...P,
70
+ ...s,
71
71
  ...x,
72
72
  ...X,
73
73
  ...N,
74
- ...D({ storeConfig: le })
74
+ ...b,
75
+ ...F,
76
+ ...L,
77
+ ...q({ storeConfig: _e })
75
78
  };
76
79
  I({
77
80
  comms: e.route("vis"),
78
81
  registry: t,
79
- instrumentation: new G({
80
- logger: new Y({ filters: [O("info")] })
82
+ instrumentation: new te({
83
+ logger: new oe({ filters: [re("info")] })
81
84
  })
82
85
  });
83
- }, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
86
+ }, Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
84
87
  __proto__: null,
85
- render: ie
88
+ render: Ie
86
89
  }, Symbol.toStringTag, { value: "Module" }));
87
90
  export {
88
- be as aether,
89
- Ne as canvas,
90
- Xe as diagram,
91
- ce as lineplot,
92
- xe as measure,
93
- ge as pluto,
94
- ue as render,
95
- Pe as rule,
96
- ye as synnax,
97
- Ue as telem,
98
- pe as theming,
99
- Ce as tooltip,
100
- Ae as value
91
+ Xe as aether,
92
+ Pe as canvas,
93
+ ye as diagram,
94
+ Le as lineplot,
95
+ Ue as measure,
96
+ Fe as pluto,
97
+ de as render,
98
+ Ce as rule,
99
+ Ae as synnax,
100
+ je as telem,
101
+ ce as theming,
102
+ ve as tooltip,
103
+ he as value
101
104
  };
@@ -0,0 +1 @@
1
+ "use strict";const p=require("./Dialog-DNrgykEv.cjs"),e=require("./Animated-xK__WUQp.cjs"),r=require("./jsx-runtime-nZSsnGb7.cjs"),b=require("./Copy-DuC8dTK7.cjs"),C=require("./Animated-vGAs0qOH.cjs");require("@synnaxlabs/x");const i=require("./css-CloSmhZB.cjs"),s=({onClick:a,className:l,hideCaret:t=!1,children:u,variant:o,...c})=>{const{toggle:x,visible:d,variant:g}=e.useContext();let n;return o==="preview"&&(t=!0),g!=="modal"&&!t&&(n=r.jsxRuntimeExports.jsx(C.Animated,{enabled:d,enabledLoc:"bottom",disabledLoc:"left"})),r.jsxRuntimeExports.jsxs(b.Button,{className:i.CSS(i.CSS.BE("dialog","trigger"),l),onClick:m=>{a?.(m),x()},full:"x",variant:o,...c,children:[u,n]})},f=Object.freeze(Object.defineProperty({__proto__:null,Dialog:p.Dialog,Frame:e.Frame,Trigger:s,parseLocationOptions:e.parseLocationOptions,position:e.position,useContext:e.useContext,useInternalContext:e.useInternalContext},Symbol.toStringTag,{value:"Module"}));exports.Trigger=s;exports.external=f;
@@ -0,0 +1 @@
1
+ "use strict";const y=require("@synnaxlabs/x"),w=require("./Text-C2_VsLzw.cjs"),p=require("./jsx-runtime-nZSsnGb7.cjs"),z=require("./Animated-vGAs0qOH.cjs"),d=require("./css-CloSmhZB.cjs"),T=require("./Tags-6OV0_eBz.cjs");require("./Copy-DuC8dTK7.cjs");require("./Box-CNUz5BsV.cjs");const K=require("./Items-DYYNNIjr.cjs");require("./Animated-xK__WUQp.cjs");const S=require("react"),b=require("./Editable-HUPqTaui.cjs"),U=require("./types-DI2vtOGs.cjs");require("./Provider-DSMJjyuY.cjs");require("react-dom");require("./Haul-V5NQI3MY.cjs");require("./provider-DQkVj3tA.cjs");const Y=require("./hooks-C4ji1BSZ.cjs"),A=(e,n)=>n.includes(e.key),I=({nodes:e,expanded:n,sort:t,depth:s=0})=>{const r={keys:[],nodes:[]};return t!=null&&e.sort(t),e.forEach(o=>{const l=A(o,n);if(r.keys.push(o.key),r.nodes.push({depth:s,expanded:l,hasChildren:o.children!=null}),l&&o.children!=null){const{keys:c,nodes:f}=I({nodes:o.children,expanded:n,sort:t,depth:s+1});r.keys.push(...c),r.nodes.push(...f)}}),r},J=({tree:e,destination:n,keys:t})=>(t=y.array.toArray(t),n==null?[...P({tree:e,keys:t}),...e.filter(r=>!t.includes(r.key))]:(t.forEach(s=>{const r=a({tree:e,key:s});r!=null&&(M({tree:e,keys:s}),L({tree:e,destination:n,additions:r}))}),e)),M=({tree:e,keys:n,parent:t})=>{if(n=y.array.toArray(n),t!==void 0){if(t===null)return e.filter(r=>!n.includes(r.key));const s=a({tree:e,key:t});return s==null||(s.children=s.children?.filter(r=>!n.includes(r.key))),e}return n.forEach(s=>{const r=e.findIndex(o=>o.key===s);if(r!==-1)e.splice(r,1);else{const o=g({tree:e,key:s});o!=null&&(o.children=o.children?.filter(l=>l.key!==s))}}),e},L=({tree:e,destination:n,additions:t,throwOnMissing:s=!0})=>{t=y.array.toArray(t);const r=y.unique.by(t,c=>c.key,!1),o=r.map(c=>c.key);if(n==null)return[...r,...e.filter(c=>!o.includes(c.key))];const l=a({tree:e,key:n});if(l==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}return l.children??=[],l.children=[...r,...l.children.filter(c=>!o.includes(c.key))],e},Q=({tree:e,key:n,updater:t,throwOnMissing:s=!0})=>{const r=a({tree:e,key:n});if(r==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}const o=g({tree:e,key:n});if(o!=null){const l=o.children?.findIndex(c=>c.key===n);l!=null&&l!==-1&&o.children?.splice(l,1,t(r))}else e.splice(e.findIndex(l=>l.key===n),1,t(r));return e},V=({tree:e,parent:n,updater:t,throwOnMissing:s=!0})=>{const r=a({tree:e,key:n});if(r==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}return r.children=t(r.children??[]),e},a=({tree:e,key:n,depth:t=0})=>{for(let s=0;s<e.length;s++){const r=e[s];if(r.key===n)return r;if(r.children!=null){const o=a({tree:r.children,key:n,depth:t+1});if(o!=null)return o}}return null},P=({tree:e,keys:n})=>{const t=[];for(const s of n){const r=a({tree:e,key:s});r!=null&&t.push(r)}return t},g=({tree:e,key:n})=>{for(const t of e)if(t.children!=null){if(t.children.some(r=>r.key===n))return t;const s=g({tree:t.children,key:n});if(s!=null)return s}return null},D=e=>e.map(n=>({...n,children:n.children!=null?D(n.children):void 0})),H=(...e)=>{const n=[];return e.forEach(t=>{n.push(t),t.children!=null&&n.push(...H(...t.children))}),n},W=(e,n)=>{const t={keys:[],nodes:[]};return e.keys.forEach((s,r)=>{n(s,e.nodes[r].depth)&&(t.keys.push(s),t.nodes.push(e.nodes[r]))}),t},X=e=>{const n=Math.min(...e.nodes.map(t=>t.depth));return e.keys.filter((t,s)=>e.nodes[s].depth===n)},Z=(e,n)=>{const t=n.keys.findIndex(s=>s===e);return n.nodes[t].depth},O=(e,n)=>{const t=e.keys.findIndex(s=>s===n);return e.nodes[t]},[ee,$]=w.create({displayName:"Tree.Context",providerName:"Tree.Provider"}),ne=({children:e,style:n,className:t,loading:s,useMargin:r=!1,offsetMultiplier:o=2.5,...l})=>{const{index:c}=l,{expanded:f,depth:x,hasChildren:m}=$("Tree.Item")[c];return p.jsxRuntimeExports.jsxs(T.ListItem,{className:d.CSS(d.CSS.BE("tree","item"),x!==0&&d.CSS.M("show-rules"),r&&d.CSS.M("margin"),t),style:{[d.CSS.var("tree-item-offset")]:`${x*o+1.5}rem`,...n},gap:"small",align:"center",...l,children:[m&&p.jsxRuntimeExports.jsx(z.Animated,{className:d.CSS.BE("tree","expansion-indicator"),enabled:f,enabledLoc:"bottom",disabledLoc:"right"},"caret"),e,s&&p.jsxRuntimeExports.jsx(w.Loading,{})]})},te="tree-item",re=[["Shift"]],se=({onExpand:e,nodes:n,initialExpanded:t=[],selected:s,onSelectedChange:r,sort:o})=>{const[l,c,f]=b.useCombinedStateAndRef(t),[x,m]=U.usePassthrough({initial:[],value:s,onChange:r}),q=S.useMemo(()=>I({nodes:n,expanded:l,sort:o}),[n,l,o]),_=b.useSyncedRef(n),N=b.useSyncedRef(q),R=Y.useHeldRef({triggers:re}),j=S.useCallback((u,{clicked:i})=>{if(m(h=>u.length===0&&h.length>0?h.slice(0,1):u),i==null||R.current.held)return;const C=O(N.current,i);if(C==null||!C.hasChildren)return;const k=f.current,v=k.some(h=>h===i)?"contract":"expand";let E;v==="contract"?E=k.filter(h=>h!==i):E=[...k,i],c(E),e?.({current:E,action:v,clicked:i})},[e,_,c,m]),B=S.useCallback(u=>{c(i=>y.unique.unique([...i,u])),e?.({current:l,action:"expand",clicked:u})},[c]),F=S.useCallback((...u)=>{c(i=>i.filter(C=>!u.includes(C))),u.forEach(i=>{e?.({current:l,action:"contract",clicked:i})})},[c]),G=S.useCallback(()=>c([]),[c]);return{selected:x,expanded:l,contract:F,expand:B,clearExpanded:G,shape:q,onSelect:j}},oe=({shape:e,children:n,selected:t,onSelect:s,getItem:r,subscribe:o,className:l,contract:c,expand:f,expanded:x,className:m,clearExpanded:q,showRules:_=!1,virtual:N=!1,...R})=>{const{keys:j}=e;return p.jsxRuntimeExports.jsx(ee,{value:e.nodes,children:p.jsxRuntimeExports.jsx(T.Frame,{multiple:!0,value:t,replaceOnSingle:!0,data:j,onChange:s,getItem:r,subscribe:o,itemHeight:27,virtual:N,children:p.jsxRuntimeExports.jsx(K.Items,{full:"y",className:d.CSS(d.CSS.B("tree"),l,_&&d.CSS.M("show-rules")),...R,children:n})})})},le=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:te,Item:ne,Tree:oe,deepCopy:D,filterShape:W,findNode:a,findNodeParent:g,findNodes:P,flatten:I,getAllNodesOfMinDepth:X,getDepth:Z,getDescendants:H,getNodeShape:O,moveNode:J,removeNode:M,setNode:L,shouldExpand:A,updateNode:Q,updateNodeChildren:V,use:se,useContext:$},Symbol.toStringTag,{value:"Module"}));exports.external=le;
@@ -1,31 +1,32 @@
1
- import { B as A, F as E, I as M, a as _, c as D, u as w, b as F, d as G, e as S } from "./Items-B5aeU-Pt.js";
1
+ import { B as A, F as E, I as M, a as _, c as D, u as w, b as F, d as G, e as S } from "./Items-CNPUoiob.js";
2
2
  import { useCallback as u, useMemo as b } from "react";
3
- import { d } from "./css-BkBrZtKZ.js";
4
- import { b as h } from "./Editable-DjQORuR1.js";
5
- import "./Text-TzKJ38En.js";
6
- import "./jsx-runtime-BbD0H88J.js";
7
- import "./types-B5-Tni3G.js";
8
- import "./Box-DLO7l9hM.js";
9
- import "./Provider-BoQtgQtU.js";
3
+ import { array as h } from "@synnaxlabs/x";
4
+ import { b as d } from "./Editable-4ZwvICC4.js";
5
+ import "./Text-BSTMZRuo.js";
6
+ import "./jsx-runtime-tc70JA_2.js";
7
+ import "./types-CGRCBVD4.js";
8
+ import "./css-D90kZTM8.js";
9
+ import "./Box-Bi280MYh.js";
10
+ import "./Provider-ZIy-UlnE.js";
10
11
  import { u as U } from "./useStaticData-p8sk2VCJ.js";
11
- const p = 10, g = ({ offset: t, searchTerm: e = "", ...s }, a = p) => ({
12
+ const I = 10, y = ({ offset: t, searchTerm: e = "", ...s }, a = I) => ({
12
13
  ...s,
13
14
  offset: (t ?? -a) + a,
14
15
  limit: a,
15
16
  searchTerm: e
16
- }), y = (t, e, s = p) => ({
17
+ }), g = (t, e, s = I) => ({
17
18
  ...t,
18
19
  searchTerm: e,
19
20
  offset: 0,
20
21
  limit: s
21
22
  }), x = ({
22
23
  retrieve: t,
23
- pageSize: e = p
24
+ pageSize: e = I
24
25
  }) => {
25
26
  const s = u(() => {
26
- t((c) => g(c, e), { mode: "append" });
27
+ t((c) => y(c, e), { mode: "append" });
27
28
  }, [t, e]), a = u(
28
- (c) => t((n) => y(n, c, e)),
29
+ (c) => t((n) => g(n, c, e)),
29
30
  [t, e]
30
31
  );
31
32
  return b(
@@ -50,9 +51,9 @@ const p = 10, g = ({ offset: t, searchTerm: e = "", ...s }, a = p) => ({
50
51
  [t.getItem, e.getItem]
51
52
  ), c = u(
52
53
  (n, m) => {
53
- const i = t.subscribe?.(n, m), I = e.subscribe?.(n, m);
54
+ const i = t.subscribe?.(n, m), p = e.subscribe?.(n, m);
54
55
  return () => {
55
- i?.(), I?.();
56
+ i?.(), p?.();
56
57
  };
57
58
  },
58
59
  [t.subscribe, e.subscribe]
@@ -72,19 +73,19 @@ const p = 10, g = ({ offset: t, searchTerm: e = "", ...s }, a = p) => ({
72
73
  );
73
74
  return b(() => ({ data: t, getItem: e }), [t, e]);
74
75
  }, R = ({ initialData: t } = {}) => {
75
- const e = h(() => {
76
+ const e = d(() => {
76
77
  const r = /* @__PURE__ */ new Map();
77
78
  return t == null || t.forEach((o) => r.set(o.key, o)), r;
78
- }), s = h(() => /* @__PURE__ */ new Map()), a = u((r) => {
79
+ }), s = d(() => /* @__PURE__ */ new Map()), a = u((r) => {
79
80
  const o = new Set(r);
80
81
  s.current.forEach((l, f) => {
81
82
  o.has(l) && f();
82
83
  });
83
84
  }, []), c = u((r) => {
84
- const o = d.toArray(r), l = o.map((f) => f.key);
85
+ const o = h.toArray(r), l = o.map((f) => f.key);
85
86
  o.forEach((f) => e.current.set(f.key, f)), a(l);
86
87
  }, []), n = u((r) => {
87
- const o = d.toArray(r);
88
+ const o = h.toArray(r);
88
89
  o.forEach((l) => e.current.delete(l)), a(o);
89
90
  }, []), m = u(
90
91
  (r, o) => o == null ? () => {
@@ -98,20 +99,20 @@ const p = 10, g = ({ offset: t, searchTerm: e = "", ...s }, a = p) => ({
98
99
  return Array.isArray(r) ? r.map((o) => e.current.get(o)).filter((o) => o != null) : e.current.get(r);
99
100
  }),
100
101
  []
101
- ), I = u((r) => e.current.has(r), []);
102
+ ), p = u((r) => e.current.has(r), []);
102
103
  return b(
103
- () => ({ setItem: c, deleteItem: n, subscribe: m, getItem: i, hasItem: I }),
104
- [c, n, m, i, I]
104
+ () => ({ setItem: c, deleteItem: n, subscribe: m, getItem: i, hasItem: p }),
105
+ [c, n, m, i, p]
105
106
  );
106
- }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
107
+ }, Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
107
108
  __proto__: null,
108
109
  BaseFrame: A,
109
110
  Frame: E,
110
111
  Item: M,
111
112
  Items: _,
112
113
  createGetItem: D,
113
- page: g,
114
- search: y,
114
+ page: y,
115
+ search: g,
115
116
  useCombinedData: C,
116
117
  useData: w,
117
118
  useItem: F,
@@ -124,6 +125,6 @@ const p = 10, g = ({ offset: t, searchTerm: e = "", ...s }, a = p) => ({
124
125
  }, Symbol.toStringTag, { value: "Module" }));
125
126
  export {
126
127
  x as a,
127
- N as e,
128
+ Q as e,
128
129
  P as u
129
130
  };