@synnaxlabs/x 0.16.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (511) hide show
  1. package/.turbo/turbo-build.log +99 -7
  2. package/.vscode/settings.json +5 -1
  3. package/dist/base-Cz4DfmJf.js +37 -0
  4. package/dist/base-D3FrPu8C.cjs +1 -0
  5. package/dist/binary.cjs +1 -0
  6. package/dist/binary.js +37 -0
  7. package/dist/bounds-1ouRnRJS.cjs +1 -0
  8. package/dist/bounds-BYz3mV9U.js +129 -0
  9. package/dist/bounds.cjs +1 -0
  10. package/dist/bounds.js +4 -0
  11. package/dist/box-CHDDKvN3.cjs +1 -0
  12. package/dist/box-Q7p9JFnX.js +204 -0
  13. package/dist/box.cjs +1 -0
  14. package/dist/box.js +4 -0
  15. package/dist/caseconv.cjs +1 -0
  16. package/dist/caseconv.js +4 -0
  17. package/dist/change-C-YELKx6.cjs +1 -0
  18. package/dist/change-DLl6DccR.js +12 -0
  19. package/dist/change.cjs +1 -0
  20. package/dist/change.js +4 -0
  21. package/dist/compare.cjs +1 -0
  22. package/dist/compare.js +4 -0
  23. package/dist/debounce.cjs +1 -0
  24. package/dist/debounce.js +17 -0
  25. package/dist/deep.cjs +1 -0
  26. package/dist/deep.js +119 -0
  27. package/dist/destructor.cjs +1 -0
  28. package/dist/destructor.js +1 -0
  29. package/dist/dimensions-9gLSFjFx.js +44 -0
  30. package/dist/dimensions-Fe8DhhXU.cjs +1 -0
  31. package/dist/dimensions.cjs +1 -0
  32. package/dist/dimensions.js +4 -0
  33. package/dist/direction-dXjlmg4_.cjs +1 -0
  34. package/dist/direction-wsPTe9a1.js +15 -0
  35. package/dist/direction.cjs +1 -0
  36. package/dist/direction.js +4 -0
  37. package/dist/external-B-DoBvh7.cjs +1 -0
  38. package/dist/external-DI9122wF.js +27 -0
  39. package/dist/identity.cjs +1 -0
  40. package/dist/identity.js +4 -0
  41. package/dist/index-Bcm6lEr8.js +73 -0
  42. package/dist/index-CnZb0cyW.cjs +1 -0
  43. package/dist/index-POWYBOZm.js +356 -0
  44. package/dist/index-xjptNL6Z.cjs +1 -0
  45. package/dist/index.cjs +1 -0
  46. package/dist/index.js +136 -0
  47. package/dist/kv.cjs +1 -0
  48. package/dist/kv.js +6 -0
  49. package/dist/location-C4YaXxjI.js +94 -0
  50. package/dist/location-CZOgJmu5.cjs +1 -0
  51. package/dist/location.cjs +1 -0
  52. package/dist/location.js +4 -0
  53. package/dist/observe.cjs +1 -0
  54. package/dist/observe.js +43 -0
  55. package/dist/path-BfHj5x9k.js +62 -0
  56. package/dist/path-By98WcWm.cjs +1 -0
  57. package/dist/position-BjhXUSEO.cjs +1 -0
  58. package/dist/position-PSYLZzqw.js +87 -0
  59. package/dist/position.cjs +1 -0
  60. package/dist/position.js +4 -0
  61. package/dist/record.cjs +1 -0
  62. package/dist/record.js +9 -0
  63. package/dist/runtime.cjs +1 -0
  64. package/dist/runtime.js +4 -0
  65. package/dist/scale-DCbi48di.js +205 -0
  66. package/dist/scale-DUBO0Q4s.cjs +1 -0
  67. package/dist/scale.cjs +1 -0
  68. package/dist/scale.js +4 -0
  69. package/dist/search.cjs +1 -0
  70. package/dist/search.js +15 -0
  71. package/dist/series-CSutMOtt.cjs +11 -0
  72. package/dist/series-DCv8f29w.js +1629 -0
  73. package/dist/spatial-6OGCmDve.js +11 -0
  74. package/dist/spatial-R5OeJgR6.cjs +1 -0
  75. package/dist/spatial.cjs +1 -0
  76. package/dist/spatial.js +20 -0
  77. package/dist/{binary → src/binary}/encoder.d.ts +7 -2
  78. package/dist/src/binary/encoder.d.ts.map +1 -0
  79. package/dist/src/binary/encoder.spec.d.ts.map +1 -0
  80. package/dist/src/binary/index.d.ts.map +1 -0
  81. package/dist/src/caseconv/caseconv.d.ts +4 -0
  82. package/dist/src/caseconv/caseconv.d.ts.map +1 -0
  83. package/dist/src/caseconv/index.d.ts +2 -0
  84. package/dist/src/caseconv/index.d.ts.map +1 -0
  85. package/dist/{change → src/change}/change.d.ts +10 -9
  86. package/dist/src/change/change.d.ts.map +1 -0
  87. package/dist/src/change/index.d.ts.map +1 -0
  88. package/dist/src/clamp/clamp.d.ts.map +1 -0
  89. package/dist/src/clamp/index.d.ts +2 -0
  90. package/dist/src/clamp/index.d.ts.map +1 -0
  91. package/dist/{compare → src/compare}/compare.d.ts +5 -4
  92. package/dist/src/compare/compare.d.ts.map +1 -0
  93. package/dist/src/compare/index.d.ts.map +1 -0
  94. package/dist/src/control/control.d.ts +107 -0
  95. package/dist/src/control/control.d.ts.map +1 -0
  96. package/dist/src/control/index.d.ts +2 -0
  97. package/dist/src/control/index.d.ts.map +1 -0
  98. package/dist/src/debounce/debounce.d.ts.map +1 -0
  99. package/dist/src/debounce/debounce.spec.d.ts +2 -0
  100. package/dist/src/debounce/debounce.spec.d.ts.map +1 -0
  101. package/dist/src/debounce/index.d.ts +2 -0
  102. package/dist/src/debounce/index.d.ts.map +1 -0
  103. package/dist/src/deep/copy.d.ts.map +1 -0
  104. package/dist/{deep → src/deep}/delete.d.ts +2 -1
  105. package/dist/src/deep/delete.d.ts.map +1 -0
  106. package/dist/{deep → src/deep}/delete.spec.d.ts.map +1 -1
  107. package/dist/src/deep/difference.d.ts.map +1 -0
  108. package/dist/src/deep/difference.spec.d.ts.map +1 -0
  109. package/dist/src/deep/equal.d.ts.map +1 -0
  110. package/dist/{deep → src/deep}/equal.spec.d.ts.map +1 -1
  111. package/dist/{deep → src/deep}/external.d.ts +3 -4
  112. package/dist/src/deep/external.d.ts.map +1 -0
  113. package/dist/src/deep/index.d.ts.map +1 -0
  114. package/dist/src/deep/merge.d.ts +12 -0
  115. package/dist/src/deep/merge.d.ts.map +1 -0
  116. package/dist/{deep → src/deep}/merge.spec.d.ts.map +1 -1
  117. package/dist/src/deep/partial.d.ts.map +1 -0
  118. package/dist/src/deep/path.d.ts +45 -0
  119. package/dist/src/deep/path.d.ts.map +1 -0
  120. package/dist/{deep → src/deep}/path.spec.d.ts.map +1 -1
  121. package/dist/src/destructor.d.ts.map +1 -0
  122. package/dist/{identity.d.ts → src/identity.d.ts} +2 -1
  123. package/dist/src/identity.d.ts.map +1 -0
  124. package/dist/{index.d.ts → src/index.d.ts} +22 -20
  125. package/dist/src/index.d.ts.map +1 -0
  126. package/dist/src/invert.d.ts.map +1 -0
  127. package/dist/src/join.d.ts.map +1 -0
  128. package/dist/src/kv/index.d.ts.map +1 -0
  129. package/dist/src/kv/types.d.ts.map +1 -0
  130. package/dist/src/math/index.d.ts +2 -0
  131. package/dist/src/math/index.d.ts.map +1 -0
  132. package/dist/src/math/math.d.ts +11 -0
  133. package/dist/src/math/math.d.ts.map +1 -0
  134. package/dist/src/migrate/index.d.ts.map +1 -0
  135. package/dist/{migrate → src/migrate}/migrate.d.ts +2 -1
  136. package/dist/src/migrate/migrate.d.ts.map +1 -0
  137. package/dist/src/migrate/migrate.spec.d.ts.map +1 -0
  138. package/dist/{mock → src/mock}/MockGLBufferController.d.ts +2 -1
  139. package/dist/src/mock/MockGLBufferController.d.ts.map +1 -0
  140. package/dist/src/mock/index.d.ts.map +1 -0
  141. package/dist/src/observe/index.d.ts.map +1 -0
  142. package/dist/src/observe/observe.d.ts +24 -0
  143. package/dist/src/observe/observe.d.ts.map +1 -0
  144. package/dist/src/observe/obsever.spec.d.ts +2 -0
  145. package/dist/src/observe/obsever.spec.d.ts.map +1 -0
  146. package/dist/src/optional.d.ts.map +1 -0
  147. package/dist/{primitive.d.ts → src/primitive.d.ts} +2 -1
  148. package/dist/src/primitive.d.ts.map +1 -0
  149. package/dist/{record.d.ts → src/record.d.ts} +7 -8
  150. package/dist/src/record.d.ts.map +1 -0
  151. package/dist/{renderable.d.ts → src/renderable.d.ts} +2 -1
  152. package/dist/src/renderable.d.ts.map +1 -0
  153. package/dist/src/runtime/detect.d.ts.map +1 -0
  154. package/dist/src/runtime/external.d.ts.map +1 -0
  155. package/dist/src/runtime/index.d.ts.map +1 -0
  156. package/dist/src/runtime/os.d.ts +20 -0
  157. package/dist/src/runtime/os.d.ts.map +1 -0
  158. package/dist/{search.d.ts → src/search.d.ts} +5 -2
  159. package/dist/src/search.d.ts.map +1 -0
  160. package/dist/src/shallowCopy.d.ts +2 -0
  161. package/dist/src/shallowCopy.d.ts.map +1 -0
  162. package/dist/{spatial → src/spatial}/base.d.ts +30 -5
  163. package/dist/src/spatial/base.d.ts.map +1 -0
  164. package/dist/src/spatial/bounds/bounds.d.ts +148 -0
  165. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -0
  166. package/dist/src/spatial/bounds/bounds.spec.d.ts.map +1 -0
  167. package/dist/src/spatial/bounds/index.d.ts.map +1 -0
  168. package/dist/{spatial → src/spatial}/box/box.d.ts +69 -22
  169. package/dist/src/spatial/box/box.d.ts.map +1 -0
  170. package/dist/src/spatial/box/box.spec.d.ts.map +1 -0
  171. package/dist/src/spatial/box/index.d.ts.map +1 -0
  172. package/dist/{spatial → src/spatial}/dimensions/dimensions.d.ts +4 -3
  173. package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -0
  174. package/dist/src/spatial/dimensions/dimensions.spec.d.ts.map +1 -0
  175. package/dist/src/spatial/dimensions/index.d.ts.map +1 -0
  176. package/dist/{spatial → src/spatial}/direction/direction.d.ts +3 -2
  177. package/dist/src/spatial/direction/direction.d.ts.map +1 -0
  178. package/dist/src/spatial/direction/direction.spec.d.ts.map +1 -0
  179. package/dist/src/spatial/direction/index.d.ts.map +1 -0
  180. package/dist/{spatial → src/spatial}/external.d.ts +2 -2
  181. package/dist/src/spatial/external.d.ts.map +1 -0
  182. package/dist/src/spatial/index.d.ts.map +1 -0
  183. package/dist/src/spatial/location/index.d.ts.map +1 -0
  184. package/dist/{spatial → src/spatial}/location/location.d.ts +4 -3
  185. package/dist/src/spatial/location/location.d.ts.map +1 -0
  186. package/dist/src/spatial/location/location.spec.d.ts.map +1 -0
  187. package/dist/src/spatial/position/index.d.ts.map +1 -0
  188. package/dist/{spatial → src/spatial}/position/position.d.ts +4 -4
  189. package/dist/src/spatial/position/position.d.ts.map +1 -0
  190. package/dist/src/spatial/position/position.spec.d.ts.map +1 -0
  191. package/dist/src/spatial/scale/index.d.ts.map +1 -0
  192. package/dist/{spatial → src/spatial}/scale/scale.d.ts +15 -62
  193. package/dist/src/spatial/scale/scale.d.ts.map +1 -0
  194. package/dist/src/spatial/scale/scale.spec.d.ts.map +1 -0
  195. package/dist/src/spatial/spatial.d.ts +2 -0
  196. package/dist/src/spatial/spatial.d.ts.map +1 -0
  197. package/dist/src/spatial/xy/index.d.ts.map +1 -0
  198. package/dist/{spatial → src/spatial}/xy/xy.d.ts +15 -24
  199. package/dist/src/spatial/xy/xy.d.ts.map +1 -0
  200. package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts.map +1 -1
  201. package/dist/src/telem/generate.d.ts +4 -0
  202. package/dist/src/telem/generate.d.ts.map +1 -0
  203. package/dist/src/telem/gl.d.ts.map +1 -0
  204. package/dist/{telem → src/telem}/index.d.ts +1 -1
  205. package/dist/src/telem/index.d.ts.map +1 -0
  206. package/dist/{telem → src/telem}/series.d.ts +10 -8
  207. package/dist/src/telem/series.d.ts.map +1 -0
  208. package/dist/{telem → src/telem}/series.spec.d.ts.map +1 -1
  209. package/dist/{telem → src/telem}/telem.d.ts +19 -21
  210. package/dist/src/telem/telem.d.ts.map +1 -0
  211. package/dist/{telem → src/telem}/telem.spec.d.ts.map +1 -1
  212. package/dist/src/toArray.d.ts.map +1 -0
  213. package/dist/src/transform.d.ts +6 -0
  214. package/dist/src/transform.d.ts.map +1 -0
  215. package/dist/src/unique.d.ts.map +1 -0
  216. package/dist/src/url/index.d.ts +2 -0
  217. package/dist/src/url/index.d.ts.map +1 -0
  218. package/dist/src/url/url.d.ts.map +1 -0
  219. package/dist/{url → src/url}/url.spec.d.ts.map +1 -1
  220. package/dist/src/worker/index.d.ts +2 -0
  221. package/dist/src/worker/index.d.ts.map +1 -0
  222. package/dist/{worker → src/worker}/worker.d.ts +4 -4
  223. package/dist/src/worker/worker.d.ts.map +1 -0
  224. package/dist/src/worker/worker.spec.d.ts.map +1 -0
  225. package/dist/src/zodutil/index.d.ts +2 -0
  226. package/dist/src/zodutil/index.d.ts.map +1 -0
  227. package/dist/src/zodutil/zodutil.d.ts +6 -0
  228. package/dist/src/zodutil/zodutil.d.ts.map +1 -0
  229. package/dist/src/zodutil/zodutil.spec.d.ts +2 -0
  230. package/dist/src/zodutil/zodutil.spec.d.ts.map +1 -0
  231. package/dist/telem.cjs +1 -0
  232. package/dist/telem.js +17 -0
  233. package/dist/toArray.cjs +1 -0
  234. package/dist/toArray.js +5 -0
  235. package/dist/unique.cjs +1 -0
  236. package/dist/unique.js +4 -0
  237. package/dist/url.cjs +1 -0
  238. package/dist/url.js +54 -0
  239. package/dist/worker.cjs +1 -0
  240. package/dist/worker.js +47 -0
  241. package/dist/xy-B4SvvNaG.cjs +1 -0
  242. package/dist/xy-H8aUVW_X.js +90 -0
  243. package/dist/xy.cjs +1 -0
  244. package/dist/xy.js +4 -0
  245. package/dist/zodutil.cjs +1 -0
  246. package/dist/zodutil.js +22 -0
  247. package/eslint.config.js +12 -0
  248. package/package.json +158 -14
  249. package/src/binary/encoder.spec.ts +31 -6
  250. package/src/binary/encoder.ts +26 -15
  251. package/src/binary/index.ts +1 -1
  252. package/src/{case.ts → caseconv/caseconv.ts} +4 -9
  253. package/src/caseconv/index.ts +10 -0
  254. package/src/change/change.ts +7 -6
  255. package/src/change/index.ts +1 -1
  256. package/src/{clamp.ts → clamp/clamp.ts} +1 -1
  257. package/src/clamp/index.ts +10 -0
  258. package/src/compare/compare.ts +6 -9
  259. package/src/compare/index.ts +1 -1
  260. package/src/control/control.ts +77 -0
  261. package/src/control/index.ts +1 -0
  262. package/src/debounce/debounce.spec.ts +52 -0
  263. package/src/{debounce.ts → debounce/debounce.ts} +4 -4
  264. package/src/debounce/index.ts +10 -0
  265. package/src/deep/copy.ts +2 -3
  266. package/src/deep/delete.spec.ts +2 -2
  267. package/src/deep/delete.ts +3 -2
  268. package/src/deep/difference.spec.ts +28 -27
  269. package/src/deep/difference.ts +13 -11
  270. package/src/deep/equal.spec.ts +4 -4
  271. package/src/deep/equal.ts +16 -12
  272. package/src/deep/external.ts +4 -5
  273. package/src/deep/index.ts +1 -1
  274. package/src/deep/merge.spec.ts +120 -4
  275. package/src/deep/merge.ts +50 -9
  276. package/src/deep/partial.ts +1 -1
  277. package/src/deep/path.spec.ts +90 -39
  278. package/src/deep/path.ts +105 -46
  279. package/src/destructor.ts +2 -2
  280. package/src/identity.ts +1 -1
  281. package/src/index.ts +23 -21
  282. package/src/invert.ts +9 -0
  283. package/src/join.ts +1 -1
  284. package/src/kv/index.ts +1 -1
  285. package/src/kv/types.ts +1 -1
  286. package/src/math/index.ts +10 -0
  287. package/src/math/math.ts +33 -0
  288. package/src/migrate/index.ts +9 -0
  289. package/src/migrate/migrate.spec.ts +12 -2
  290. package/src/migrate/migrate.ts +9 -0
  291. package/src/mock/MockGLBufferController.ts +6 -6
  292. package/src/mock/index.ts +1 -1
  293. package/src/observe/index.ts +1 -1
  294. package/src/observe/observe.ts +37 -6
  295. package/src/observe/obsever.spec.ts +56 -0
  296. package/src/optional.ts +3 -4
  297. package/src/primitive.ts +1 -1
  298. package/src/record.ts +10 -6
  299. package/src/renderable.ts +1 -1
  300. package/src/runtime/detect.ts +3 -3
  301. package/src/runtime/external.ts +1 -1
  302. package/src/runtime/index.ts +1 -1
  303. package/src/runtime/os.ts +17 -5
  304. package/src/search.ts +3 -1
  305. package/src/shallowCopy.ts +5 -6
  306. package/src/spatial/base.ts +13 -5
  307. package/src/spatial/bounds/bounds.spec.ts +259 -180
  308. package/src/spatial/bounds/bounds.ts +200 -85
  309. package/src/spatial/bounds/index.ts +2 -2
  310. package/src/spatial/box/box.spec.ts +163 -2
  311. package/src/spatial/box/box.ts +82 -38
  312. package/src/spatial/box/index.ts +2 -2
  313. package/src/spatial/dimensions/dimensions.spec.ts +1 -1
  314. package/src/spatial/dimensions/dimensions.ts +4 -4
  315. package/src/spatial/dimensions/index.ts +2 -2
  316. package/src/spatial/direction/direction.spec.ts +1 -1
  317. package/src/spatial/direction/direction.ts +5 -5
  318. package/src/spatial/direction/index.ts +2 -2
  319. package/src/spatial/external.ts +3 -3
  320. package/src/spatial/index.ts +1 -1
  321. package/src/spatial/location/index.ts +2 -2
  322. package/src/spatial/location/location.spec.ts +1 -1
  323. package/src/spatial/location/location.ts +21 -21
  324. package/src/spatial/position/index.ts +1 -1
  325. package/src/spatial/position/position.spec.ts +1 -1
  326. package/src/spatial/position/position.ts +3 -20
  327. package/src/spatial/scale/index.ts +2 -2
  328. package/src/spatial/scale/scale.spec.ts +3 -3
  329. package/src/spatial/scale/scale.ts +3 -3
  330. package/src/spatial/spatial.ts +5 -5
  331. package/src/spatial/xy/index.ts +2 -2
  332. package/src/spatial/xy/xy.spec.ts +93 -44
  333. package/src/spatial/xy/xy.ts +17 -25
  334. package/src/telem/generate.ts +1 -1
  335. package/src/telem/gl.ts +1 -1
  336. package/src/telem/index.ts +2 -2
  337. package/src/telem/series.spec.ts +64 -5
  338. package/src/telem/series.ts +47 -35
  339. package/src/telem/telem.spec.ts +105 -2
  340. package/src/telem/telem.ts +63 -23
  341. package/src/toArray.ts +2 -2
  342. package/src/transform.ts +9 -2
  343. package/src/unique.ts +1 -1
  344. package/src/url/index.ts +2 -2
  345. package/src/url/url.spec.ts +2 -2
  346. package/src/url/url.ts +4 -4
  347. package/src/worker/index.ts +10 -0
  348. package/src/worker/worker.spec.ts +2 -2
  349. package/src/worker/worker.ts +13 -13
  350. package/src/zodutil/index.ts +10 -0
  351. package/src/zodutil/zodutil.spec.ts +103 -0
  352. package/src/zodutil/zodutil.ts +45 -0
  353. package/tsconfig.json +1 -0
  354. package/tsconfig.tsbuildinfo +1 -0
  355. package/vite.config.ts +39 -3
  356. package/.eslintrc.cjs +0 -18
  357. package/dist/binary/encoder.d.ts.map +0 -1
  358. package/dist/binary/encoder.spec.d.ts.map +0 -1
  359. package/dist/binary/index.d.ts.map +0 -1
  360. package/dist/case.d.ts +0 -6
  361. package/dist/case.d.ts.map +0 -1
  362. package/dist/change/change.d.ts.map +0 -1
  363. package/dist/change/index.d.ts.map +0 -1
  364. package/dist/clamp.d.ts.map +0 -1
  365. package/dist/compare/compare.d.ts.map +0 -1
  366. package/dist/compare/index.d.ts.map +0 -1
  367. package/dist/debounce.d.ts.map +0 -1
  368. package/dist/deep/copy.d.ts.map +0 -1
  369. package/dist/deep/delete.d.ts.map +0 -1
  370. package/dist/deep/difference.d.ts.map +0 -1
  371. package/dist/deep/difference.spec.d.ts.map +0 -1
  372. package/dist/deep/equal.d.ts.map +0 -1
  373. package/dist/deep/external.d.ts.map +0 -1
  374. package/dist/deep/index.d.ts.map +0 -1
  375. package/dist/deep/memo.d.ts +0 -2
  376. package/dist/deep/memo.d.ts.map +0 -1
  377. package/dist/deep/merge.d.ts +0 -3
  378. package/dist/deep/merge.d.ts.map +0 -1
  379. package/dist/deep/partial.d.ts.map +0 -1
  380. package/dist/deep/path.d.ts +0 -37
  381. package/dist/deep/path.d.ts.map +0 -1
  382. package/dist/destructor.d.ts.map +0 -1
  383. package/dist/identity.d.ts.map +0 -1
  384. package/dist/index.d.ts.map +0 -1
  385. package/dist/invert.d.ts.map +0 -1
  386. package/dist/join.d.ts.map +0 -1
  387. package/dist/kv/index.d.ts.map +0 -1
  388. package/dist/kv/types.d.ts.map +0 -1
  389. package/dist/migrate/index.d.ts.map +0 -1
  390. package/dist/migrate/migrate.d.ts.map +0 -1
  391. package/dist/migrate/migrate.spec.d.ts.map +0 -1
  392. package/dist/mock/MockGLBufferController.d.ts.map +0 -1
  393. package/dist/mock/index.d.ts.map +0 -1
  394. package/dist/observe/index.d.ts.map +0 -1
  395. package/dist/observe/observe.d.ts +0 -12
  396. package/dist/observe/observe.d.ts.map +0 -1
  397. package/dist/optional.d.ts.map +0 -1
  398. package/dist/primitive.d.ts.map +0 -1
  399. package/dist/record.d.ts.map +0 -1
  400. package/dist/renderable.d.ts.map +0 -1
  401. package/dist/runtime/detect.d.ts.map +0 -1
  402. package/dist/runtime/external.d.ts.map +0 -1
  403. package/dist/runtime/index.d.ts.map +0 -1
  404. package/dist/runtime/os.d.ts +0 -10
  405. package/dist/runtime/os.d.ts.map +0 -1
  406. package/dist/search.d.ts.map +0 -1
  407. package/dist/shallowCopy.d.ts +0 -2
  408. package/dist/shallowCopy.d.ts.map +0 -1
  409. package/dist/spatial/base.d.ts.map +0 -1
  410. package/dist/spatial/bounds/bounds.d.ts +0 -71
  411. package/dist/spatial/bounds/bounds.d.ts.map +0 -1
  412. package/dist/spatial/bounds/bounds.spec.d.ts.map +0 -1
  413. package/dist/spatial/bounds/index.d.ts.map +0 -1
  414. package/dist/spatial/box/box.d.ts.map +0 -1
  415. package/dist/spatial/box/box.spec.d.ts.map +0 -1
  416. package/dist/spatial/box/index.d.ts.map +0 -1
  417. package/dist/spatial/dimensions/dimensions.d.ts.map +0 -1
  418. package/dist/spatial/dimensions/dimensions.spec.d.ts.map +0 -1
  419. package/dist/spatial/dimensions/index.d.ts.map +0 -1
  420. package/dist/spatial/direction/direction.d.ts.map +0 -1
  421. package/dist/spatial/direction/direction.spec.d.ts.map +0 -1
  422. package/dist/spatial/direction/index.d.ts.map +0 -1
  423. package/dist/spatial/external.d.ts.map +0 -1
  424. package/dist/spatial/index.d.ts.map +0 -1
  425. package/dist/spatial/location/index.d.ts.map +0 -1
  426. package/dist/spatial/location/location.d.ts.map +0 -1
  427. package/dist/spatial/location/location.spec.d.ts.map +0 -1
  428. package/dist/spatial/position/index.d.ts.map +0 -1
  429. package/dist/spatial/position/position.d.ts.map +0 -1
  430. package/dist/spatial/position/position.spec.d.ts.map +0 -1
  431. package/dist/spatial/scale/index.d.ts.map +0 -1
  432. package/dist/spatial/scale/scale.d.ts.map +0 -1
  433. package/dist/spatial/scale/scale.spec.d.ts.map +0 -1
  434. package/dist/spatial/spatial.d.ts +0 -2
  435. package/dist/spatial/spatial.d.ts.map +0 -1
  436. package/dist/spatial/xy/index.d.ts.map +0 -1
  437. package/dist/spatial/xy/xy.d.ts.map +0 -1
  438. package/dist/telem/generate.d.ts +0 -3
  439. package/dist/telem/generate.d.ts.map +0 -1
  440. package/dist/telem/gl.d.ts.map +0 -1
  441. package/dist/telem/index.d.ts.map +0 -1
  442. package/dist/telem/series.d.ts.map +0 -1
  443. package/dist/telem/telem.d.ts.map +0 -1
  444. package/dist/toArray.d.ts.map +0 -1
  445. package/dist/transform.d.ts +0 -2
  446. package/dist/transform.d.ts.map +0 -1
  447. package/dist/unique.d.ts.map +0 -1
  448. package/dist/url/index.d.ts +0 -2
  449. package/dist/url/index.d.ts.map +0 -1
  450. package/dist/url/url.d.ts.map +0 -1
  451. package/dist/worker/worker.d.ts.map +0 -1
  452. package/dist/worker/worker.spec.d.ts.map +0 -1
  453. package/dist/x.cjs +0 -12
  454. package/dist/x.cjs.map +0 -1
  455. package/dist/x.js +0 -5935
  456. package/dist/x.js.map +0 -1
  457. package/src/deep/memo.ts +0 -24
  458. /package/dist/{binary → src/binary}/encoder.spec.d.ts +0 -0
  459. /package/dist/{binary → src/binary}/index.d.ts +0 -0
  460. /package/dist/{change → src/change}/index.d.ts +0 -0
  461. /package/dist/{clamp.d.ts → src/clamp/clamp.d.ts} +0 -0
  462. /package/dist/{compare → src/compare}/index.d.ts +0 -0
  463. /package/dist/{debounce.d.ts → src/debounce/debounce.d.ts} +0 -0
  464. /package/dist/{deep → src/deep}/copy.d.ts +0 -0
  465. /package/dist/{deep → src/deep}/delete.spec.d.ts +0 -0
  466. /package/dist/{deep → src/deep}/difference.d.ts +0 -0
  467. /package/dist/{deep → src/deep}/difference.spec.d.ts +0 -0
  468. /package/dist/{deep → src/deep}/equal.d.ts +0 -0
  469. /package/dist/{deep → src/deep}/equal.spec.d.ts +0 -0
  470. /package/dist/{deep → src/deep}/index.d.ts +0 -0
  471. /package/dist/{deep → src/deep}/merge.spec.d.ts +0 -0
  472. /package/dist/{deep → src/deep}/partial.d.ts +0 -0
  473. /package/dist/{deep → src/deep}/path.spec.d.ts +0 -0
  474. /package/dist/{destructor.d.ts → src/destructor.d.ts} +0 -0
  475. /package/dist/{invert.d.ts → src/invert.d.ts} +0 -0
  476. /package/dist/{join.d.ts → src/join.d.ts} +0 -0
  477. /package/dist/{kv → src/kv}/index.d.ts +0 -0
  478. /package/dist/{kv → src/kv}/types.d.ts +0 -0
  479. /package/dist/{migrate → src/migrate}/index.d.ts +0 -0
  480. /package/dist/{migrate → src/migrate}/migrate.spec.d.ts +0 -0
  481. /package/dist/{mock → src/mock}/index.d.ts +0 -0
  482. /package/dist/{observe → src/observe}/index.d.ts +0 -0
  483. /package/dist/{optional.d.ts → src/optional.d.ts} +0 -0
  484. /package/dist/{runtime → src/runtime}/detect.d.ts +0 -0
  485. /package/dist/{runtime → src/runtime}/external.d.ts +0 -0
  486. /package/dist/{runtime → src/runtime}/index.d.ts +0 -0
  487. /package/dist/{spatial → src/spatial}/bounds/bounds.spec.d.ts +0 -0
  488. /package/dist/{spatial → src/spatial}/bounds/index.d.ts +0 -0
  489. /package/dist/{spatial → src/spatial}/box/box.spec.d.ts +0 -0
  490. /package/dist/{spatial → src/spatial}/box/index.d.ts +0 -0
  491. /package/dist/{spatial → src/spatial}/dimensions/dimensions.spec.d.ts +0 -0
  492. /package/dist/{spatial → src/spatial}/dimensions/index.d.ts +0 -0
  493. /package/dist/{spatial → src/spatial}/direction/direction.spec.d.ts +0 -0
  494. /package/dist/{spatial → src/spatial}/direction/index.d.ts +0 -0
  495. /package/dist/{spatial → src/spatial}/index.d.ts +0 -0
  496. /package/dist/{spatial → src/spatial}/location/index.d.ts +0 -0
  497. /package/dist/{spatial → src/spatial}/location/location.spec.d.ts +0 -0
  498. /package/dist/{spatial → src/spatial}/position/index.d.ts +0 -0
  499. /package/dist/{spatial → src/spatial}/position/position.spec.d.ts +0 -0
  500. /package/dist/{spatial → src/spatial}/scale/index.d.ts +0 -0
  501. /package/dist/{spatial → src/spatial}/scale/scale.spec.d.ts +0 -0
  502. /package/dist/{spatial → src/spatial}/xy/index.d.ts +0 -0
  503. /package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts +0 -0
  504. /package/dist/{telem → src/telem}/gl.d.ts +0 -0
  505. /package/dist/{telem → src/telem}/series.spec.d.ts +0 -0
  506. /package/dist/{telem → src/telem}/telem.spec.d.ts +0 -0
  507. /package/dist/{toArray.d.ts → src/toArray.d.ts} +0 -0
  508. /package/dist/{unique.d.ts → src/unique.d.ts} +0 -0
  509. /package/dist/{url → src/url}/url.d.ts +0 -0
  510. /package/dist/{url → src/url}/url.spec.d.ts +0 -0
  511. /package/dist/{worker → src/worker}/worker.spec.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,7 +7,7 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { unknown, z } from "zod";
10
+ import { z } from "zod";
11
11
 
12
12
  import type * as bounds from "@/spatial/bounds/bounds";
13
13
  import type * as dimensions from "@/spatial/dimensions/dimensions";
@@ -116,22 +116,22 @@ export const construct = (
116
116
  };
117
117
 
118
118
  export interface Resize {
119
- /**
119
+ /**
120
120
  * Sets the dimensions of the box to the given dimensions.
121
121
  * @example resize(b, { width: 10, height: 10 }) // Sets the box to a 10x10 box.
122
122
  */
123
123
  (b: Crude, dims: dimensions.Dimensions | dimensions.Signed): Box;
124
- /**
125
- * Sets the dimension along the given direction to the given amount.
124
+ /**
125
+ * Sets the dimension along the given direction to the given amount.
126
126
  * @example resize(b, "x", 10) // Sets the width of the box to 10.
127
127
  * @example resize(b, "y", 10) // Sets the height of the box to 10.
128
- */
128
+ */
129
129
  (b: Crude, direction: direction.Direction, amount: number): Box;
130
130
  }
131
131
 
132
132
  export const resize: Resize = (
133
- b: Crude,
134
- dims: dimensions.Dimensions | dimensions.Signed | direction.Direction,
133
+ b: Crude,
134
+ dims: dimensions.Dimensions | dimensions.Signed | direction.Direction,
135
135
  amount?: number,
136
136
  ): Box => {
137
137
  const b_ = construct(b);
@@ -147,7 +147,7 @@ export const resize: Resize = (
147
147
  );
148
148
  }
149
149
  return construct(b_.one, dims, undefined, undefined, b_.root);
150
- }
150
+ };
151
151
 
152
152
  /**
153
153
  * Checks if a box contains a point or another box.
@@ -240,26 +240,30 @@ export const loc = (b: Crude, loc: location.Location): number => {
240
240
  : f(b_.one.y, b_.two.y);
241
241
  };
242
242
 
243
- export const locPoint = (b: Box, loc_: location.Location): xy.XY => {
244
- const l = loc(b, loc_);
245
- if (location.X_LOCATIONS.includes(loc_ as location.X))
246
- return { x: l, y: center(b).y };
247
- return { x: center(b).x, y: l };
248
- };
249
-
250
- export const isZero = (b: Box): boolean => {
243
+ /** @returns true if the area of the box is 0 and false otherwise. */
244
+ export const areaIsZero = (b: Box): boolean => {
251
245
  return b.one.x === b.two.x && b.one.y === b.two.y;
252
246
  };
253
247
 
248
+ /** @returns the width of the box. */
254
249
  export const width = (b: Crude): number => dim(b, "x");
255
250
 
251
+ /** @returns the height of the box. */
256
252
  export const height = (b: Crude): number => dim(b, "y");
257
253
 
254
+ /**
255
+ * @returns the signed width of the box, which will be negative if the x value of the
256
+ * first coordinate is less than the x value of the second coordinate.
257
+ */
258
258
  export const signedWidth = (b: Crude): number => {
259
259
  const b_ = construct(b);
260
260
  return b_.two.x - b_.one.x;
261
261
  };
262
262
 
263
+ /**
264
+ * @returns the signed height of the box, which will be negative if the y value of the
265
+ * first coordinate is less than the y value of the second coordinate.
266
+ */
263
267
  export const signedHeight = (b: Crude): number => {
264
268
  const b_ = construct(b);
265
269
  return b_.two.y - b_.one.y;
@@ -299,11 +303,23 @@ export const y = (b: Crude): number => {
299
303
 
300
304
  export const root = (b: Crude): xy.XY => ({ x: x(b), y: y(b) });
301
305
 
306
+ /**
307
+ * @returns the bounds of the box along the x axis i.e. if the box root is top left,
308
+ * the lower bound is the x coordinate of the left side of the box and the upper bound
309
+ * is the x coordinate of the right side of the box.
310
+ * @param b - The box to get the bounds of.
311
+ */
302
312
  export const xBounds = (b: Crude): bounds.Bounds => {
303
313
  const b_ = construct(b);
304
314
  return { lower: b_.one.x, upper: b_.two.x };
305
315
  };
306
316
 
317
+ /**
318
+ * @returns the bounds of the box along the y axis i.e. if the box root is top left,
319
+ * the lower bound is the y coordinate of the top side of the box and the upper bound
320
+ * is the y coordinate of the bottom side of the box.
321
+ * @param b - The box to get the bounds of.
322
+ */
307
323
  export const yBounds = (b: Crude): bounds.Bounds => {
308
324
  const b_ = construct(b);
309
325
  return { lower: b_.one.y, upper: b_.two.y };
@@ -311,24 +327,20 @@ export const yBounds = (b: Crude): bounds.Bounds => {
311
327
 
312
328
  export const reRoot = (b: Box, corner: location.CornerXY): Box => copy(b, corner);
313
329
 
314
- /**
315
- * Reposition a box so that it is visible within a given bound.
316
- *
317
- * @param target The box to reposition - Only works if the root is topLeft
318
- * @param bound The box to reposition within - Only works if the root is topLeft
319
- *
320
- * @returns the repsoitioned box and a boolean indicating if the box was repositioned
321
- * or not.
322
- */
323
- export const positionSoVisible = (target_: Crude, bound_: Crude): [Box, boolean] => {
324
- const target = construct(target_);
325
- const bound = construct(bound_);
326
- if (contains(bound, target)) return [target, false];
327
- let nextPos: xy.XY;
328
- if (right(target) > width(target))
329
- nextPos = xy.construct({ x: x(target) - width(target), y: y(target) });
330
- else nextPos = xy.construct({ x: x(target), y: y(target) - height(target) });
331
- return [construct(nextPos, dims(target)), true];
330
+ export const edgePoints = (b: Crude, loc: location.Location): [xy.XY, xy.XY] => {
331
+ const b_ = construct(b);
332
+ const x = location.X_LOCATIONS.includes(loc as location.X)
333
+ ? "x"
334
+ : location.Y_LOCATIONS.includes(loc as location.Y)
335
+ ? "y"
336
+ : null;
337
+ if (x === null) throw new Error(`Invalid location: ${location}`);
338
+ const f = loc === "top" || loc === "left" ? Math.min : Math.max;
339
+ const one = { ...b_.one };
340
+ const two = { ...b_.two };
341
+ one[x] = f(b_.one[x], b_.two[x]);
342
+ two[x] = f(b_.one[x], b_.two[x]);
343
+ return [one, two];
332
344
  };
333
345
 
334
346
  /**
@@ -346,6 +358,7 @@ export const positionInCenter = (target_: Crude, bound_: Crude): Box => {
346
358
  return construct({ x: x_, y: y_ }, dims(target));
347
359
  };
348
360
 
361
+ /** */
349
362
  export const isBox = (value: unknown): value is Box => {
350
363
  if (typeof value !== "object" || value == null) return false;
351
364
  return "one" in value && "two" in value && "root" in value;
@@ -360,7 +373,11 @@ interface Translate {
360
373
  (b: Crude, direction: direction.Direction, amount: number): Box;
361
374
  }
362
375
 
363
- export const translate = (b: Crude, t: xy.XY | direction.Direction, amount?: number): Box => {
376
+ export const translate: Translate = (
377
+ b: Crude,
378
+ t: xy.Crude | direction.Direction,
379
+ amount?: number,
380
+ ): Box => {
364
381
  if (typeof t === "string") {
365
382
  if (amount == null) throw new Error(`Undefined amount passed into box.translate`);
366
383
  const dir = direction.construct(t);
@@ -376,17 +393,26 @@ export const translate = (b: Crude, t: xy.XY | direction.Direction, amount?: num
376
393
  );
377
394
  };
378
395
 
379
- export const intersect = (a: Box, b: Box): Box => {
396
+ /** @returns a box representing the intersection of the two given boxes. */
397
+ export const intersection = (a: Box, b: Box): Box => {
380
398
  const x = Math.max(left(a), left(b));
381
399
  const y = Math.max(top(a), top(b));
382
400
  const x2 = Math.min(right(a), right(b));
383
401
  const y2 = Math.min(bottom(a), bottom(b));
402
+ if (x > x2 || y > y2) return ZERO;
384
403
  return construct({ x, y }, { x: x2, y: y2 }, undefined, undefined, a.root);
385
404
  };
386
405
 
406
+ /** @returns the area of the box. */
387
407
  export const area = (b: Box): number => width(b) * height(b);
388
408
 
389
- export const truncate = (b: Box, precision: number = 0): Box => {
409
+ /**
410
+ * Truncates the coordinates of the box to the given precision.
411
+ * @param b - The box to truncate.
412
+ * @param precision - The number of decimal places to truncate to.
413
+ * @returns the truncated box.
414
+ */
415
+ export const truncate = (b: Crude, precision: number): Box => {
390
416
  const b_ = construct(b);
391
417
  return construct(
392
418
  xy.truncate(b_.one, precision),
@@ -397,6 +423,24 @@ export const truncate = (b: Box, precision: number = 0): Box => {
397
423
  );
398
424
  };
399
425
 
426
+ /**
427
+ * Constructs a box from a particular corner, and then reinterprets the box in order
428
+ * to define it from a different corner.
429
+ *
430
+ * @example
431
+ * const b = box.construct(0, 0, 10, 10, location.BOTTOM_LEFT, location.TOP_LEFT);
432
+ * // b is now a box rooted in the top left corner with it's first coordinate at
433
+ * // (0, 10) and it's second coordinate at (10, 0).
434
+ *
435
+ * @param x - The x coordinate of the first point.
436
+ * @param y - The y coordinate of the first point.
437
+ * @param width - The width of the box.
438
+ * @param height - The height of the box.
439
+ * @param currRoot - The current root of the box i.e. the corner that x and y represent.
440
+ * @param newRoot - The new root of the box i.e. the corner that the box should be
441
+ * reinterpreted from.
442
+ * @returns the box reinterpreted from the new root.
443
+ */
400
444
  export const constructWithAlternateRoot = (
401
445
  x: number,
402
446
  y: number,
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as box from "@/spatial/box/box"
10
+ export * as box from "@/spatial/box/box";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -9,9 +9,9 @@
9
9
 
10
10
  import { z } from "zod";
11
11
 
12
- import { dimensions, xy, type Dimensions, numberCouple } from "@/spatial/base";
12
+ import { type Dimensions, dimensions, numberCouple,xy } from "@/spatial/base";
13
13
 
14
- export { dimensions, type Dimensions };
14
+ export { type Dimensions,dimensions };
15
15
 
16
16
  export const signed = z.object({ signedWidth: z.number(), signedHeight: z.number() });
17
17
  export const crude = z.union([dimensions, signed, xy, numberCouple]);
@@ -66,4 +66,4 @@ export const min = (crude: Crude[]): Dimensions => ({
66
66
  export const scale = (ca: Crude, factor: number): Dimensions => {
67
67
  const a = construct(ca);
68
68
  return { width: a.width * factor, height: a.height * factor };
69
- }
69
+ };
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as dimensions from "@/spatial/dimensions/dimensions";
10
+ export * as dimensions from "@/spatial/dimensions/dimensions";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -8,16 +8,16 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  import {
11
+ type CrudeDirection,
12
+ crudeDirection,
11
13
  type Dimension,
12
14
  type Direction,
13
- type Location,
14
15
  type direction,
15
16
  DIRECTIONS,
17
+ type Location,
18
+ type SignedDimension,
16
19
  Y_LOCATIONS,
17
20
  type YLocation,
18
- type SignedDimension,
19
- crudeDirection,
20
- type CrudeDirection,
21
21
  } from "@/spatial/base";
22
22
 
23
23
  export type { Direction, direction };
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as direction from "@/spatial/direction/direction";
10
+ export * as direction from "@/spatial/direction/direction";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -12,7 +12,7 @@ export { box } from "@/spatial/box";
12
12
  export * from "@/spatial/dimensions";
13
13
  export * from "@/spatial/direction";
14
14
  export * from "@/spatial/location";
15
- export * from "@/spatial/xy";
16
- export * from "@/spatial/scale";
17
15
  export * from "@/spatial/position";
16
+ export * from "@/spatial/scale";
18
17
  export * as spatial from "@/spatial/spatial";
18
+ export * from "@/spatial/xy";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as location from "@/spatial/location/location";
10
+ export * as location from "@/spatial/location/location";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -9,34 +9,34 @@
9
9
 
10
10
  import { z } from "zod";
11
11
 
12
- import { Case } from "@/case";
12
+ import { caseconv } from "@/caseconv";
13
13
  import {
14
- location,
15
- type Location,
16
- xLocation,
17
- yLocation,
14
+ CENTER_LOCATIONS,
15
+ type CenterLocation,
16
+ centerLocation,
17
+ type CrudeLocation,
18
+ crudeLocation,
19
+ type Direction,
18
20
  DIRECTIONS,
21
+ type Location,
22
+ location,
23
+ type OuterLocation,
24
+ outerLocation,
19
25
  X_LOCATIONS,
20
- Y_LOCATIONS,
21
- CENTER_LOCATIONS,
22
26
  type XLocation,
23
- type OuterLocation,
27
+ xLocation,
28
+ Y_LOCATIONS,
24
29
  type YLocation,
25
- outerLocation,
26
- type Direction,
27
- crudeLocation,
28
- type CrudeLocation,
29
- centerlocation,
30
- type CenterLocation,
30
+ yLocation,
31
31
  } from "@/spatial/base";
32
32
 
33
33
  export {
34
- location,
34
+ CENTER_LOCATIONS,
35
35
  type Location,
36
+ location,
37
+ outerLocation as outer,
36
38
  X_LOCATIONS,
37
39
  Y_LOCATIONS,
38
- CENTER_LOCATIONS,
39
- outerLocation as outer,
40
40
  };
41
41
 
42
42
  export const x = xLocation;
@@ -85,8 +85,8 @@ export const direction = (cl: Crude): Direction => {
85
85
  };
86
86
 
87
87
  export const xy = z.object({
88
- x: xLocation.or(centerlocation),
89
- y: yLocation.or(centerlocation),
88
+ x: xLocation.or(centerLocation),
89
+ y: yLocation.or(centerLocation),
90
90
  });
91
91
  export const corner = z.object({ x: xLocation, y: yLocation });
92
92
 
@@ -140,7 +140,7 @@ export const isX = (a: Crude): a is XLocation | CenterLocation =>
140
140
 
141
141
  export const isY = (a: Crude): a is YLocation => direction(construct(a)) === "y";
142
142
 
143
- export const xyToString = (a: XY): string => `${a.x}${Case.capitalize(a.y)}`;
143
+ export const xyToString = (a: XY): string => `${a.x}${caseconv.capitalize(a.y)}`;
144
144
 
145
145
  export const constructXY = (x: Crude | XY, y?: Crude): XY => {
146
146
  let parsedX: Location;
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -11,23 +11,6 @@ import { type Alignment, type XLocation, type YLocation } from "@/spatial/base";
11
11
  import { box } from "@/spatial/box";
12
12
  import { direction } from "@/spatial/direction";
13
13
  import { location } from "@/spatial/location";
14
- import { xy } from "@/spatial/xy";
15
-
16
- export const posititonSoVisible = (target: HTMLElement, p: xy.XY): [xy.XY, boolean] => {
17
- const { width, height } = target.getBoundingClientRect();
18
- const { innerWidth, innerHeight } = window;
19
- let changed = false;
20
- let nextXY = xy.construct(p);
21
- if (p.x + width > innerWidth) {
22
- nextXY = xy.translateX(nextXY, -width);
23
- changed = true;
24
- }
25
- if (p.y + height > innerHeight) {
26
- nextXY = xy.translateY(nextXY, -height);
27
- changed = true;
28
- }
29
- return [nextXY, changed];
30
- };
31
14
 
32
15
  export interface DialogProps {
33
16
  container: box.Crude;
@@ -39,7 +22,7 @@ export interface DialogProps {
39
22
  disable?: Array<location.Location | Partial<location.XY>>;
40
23
  }
41
24
 
42
- const parseLocationOptions = (
25
+ export const parseLocationOptions = (
43
26
  initial?: location.Outer | Partial<location.XY> | location.XY,
44
27
  ): Partial<location.XY> => {
45
28
  if (initial == null) return { x: undefined, y: undefined };
@@ -144,7 +127,7 @@ const evaluateOption = ({
144
127
  root,
145
128
  location.TOP_LEFT,
146
129
  );
147
- const area = box.area(box.intersect(dialogBox, container));
130
+ const area = box.area(box.intersection(dialogBox, container));
148
131
  return [dialogBox, area];
149
132
  };
150
133
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as scale from "@/spatial/scale/scale";
10
+ export * as scale from "@/spatial/scale/scale";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,10 +7,10 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { describe, it, expect, test } from "vitest";
10
+ import { describe, expect, it, test } from "vitest";
11
11
 
12
12
  import * as box from "@/spatial/box/box";
13
- import { XY, Scale } from "@/spatial/scale/scale";
13
+ import { Scale,XY } from "@/spatial/scale/scale";
14
14
 
15
15
  type ScaleSpec = [name: string, scale: Scale, i: number, o: number];
16
16
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { z } from "zod";
11
11
 
12
- import { clamp } from "@/clamp";
12
+ import { clamp } from "@/clamp/clamp";
13
13
  import * as bounds from "@/spatial/bounds/bounds";
14
14
  import { type Box, isBox } from "@/spatial/box/box";
15
15
  import * as box from "@/spatial/box/box";
@@ -64,7 +64,7 @@ const curriedScale =
64
64
 
65
65
  const curriedReBound =
66
66
  (bound: bounds.Bounds): Operation =>
67
- (currScale, type, v) => [bound, v];
67
+ (_, __, v) => [bound, v];
68
68
 
69
69
  const curriedInvert = (): Operation => (currScale, type, v) => {
70
70
  if (currScale === null) throw new Error("cannot invert without bounds");
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -8,10 +8,10 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  export {
11
- ALIGNMENTS,
12
- alignment,
13
11
  type Alignment,
14
- ORDERS,
15
- order,
12
+ alignment,
13
+ ALIGNMENTS,
16
14
  type Order,
15
+ order,
16
+ ORDERS,
17
17
  } from "@/spatial/base";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,4 +7,4 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * as xy from "@/spatial/xy/xy";
10
+ export * as xy from "@/spatial/xy/xy";