@adobe/data 0.9.7 → 0.9.16

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 (310) hide show
  1. package/data.d.ts +1 -1
  2. package/ecs/database/combine-plugins.d.ts +14 -7
  3. package/ecs/database/combine-plugins.js +6 -3
  4. package/ecs/database/combine-plugins.js.map +1 -1
  5. package/ecs/database/create-plugin.d.ts +37 -17
  6. package/ecs/database/create-plugin.js +3 -30
  7. package/ecs/database/create-plugin.js.map +1 -1
  8. package/ecs/database/create-plugin.test.js +55 -0
  9. package/ecs/database/create-plugin.test.js.map +1 -1
  10. package/ecs/database/create-plugin.type-test.js +157 -0
  11. package/ecs/database/create-plugin.type-test.js.map +1 -1
  12. package/ecs/database/database-schema/create-database-schema.js +3 -3
  13. package/ecs/database/database-schema/create-database-schema.js.map +1 -1
  14. package/ecs/database/database.d.ts +43 -5
  15. package/ecs/database/database.js.map +1 -1
  16. package/ecs/database/observe-dependent-value.test.js +39 -31
  17. package/ecs/database/observe-dependent-value.test.js.map +1 -1
  18. package/ecs/database/observe-select-entities.performance.test.js +30 -31
  19. package/ecs/database/observe-select-entities.performance.test.js.map +1 -1
  20. package/ecs/database/observe-select-entities.test.js +30 -31
  21. package/ecs/database/observe-select-entities.test.js.map +1 -1
  22. package/ecs/database/observed/create-observed-database.js +7 -0
  23. package/ecs/database/observed/create-observed-database.js.map +1 -1
  24. package/ecs/database/public/create-database.d.ts +5 -34
  25. package/ecs/database/public/create-database.js +68 -131
  26. package/ecs/database/public/create-database.js.map +1 -1
  27. package/ecs/database/public/create-database.test.js +324 -62
  28. package/ecs/database/public/create-database.test.js.map +1 -1
  29. package/ecs/database/transactional-store/create-transactional-store.js +16 -1
  30. package/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
  31. package/ecs/plugins/scheduler/scheduler.d.ts +2 -2
  32. package/ecs/plugins/scheduler/scheduler.js +2 -2
  33. package/ecs/plugins/scheduler/scheduler.js.map +1 -1
  34. package/ecs/undo-redo-service/create-undo-redo-service.test.js +22 -23
  35. package/ecs/undo-redo-service/create-undo-redo-service.test.js.map +1 -1
  36. package/package.json +6 -24
  37. package/service/async-data-service/create-lazy.d.ts +40 -0
  38. package/service/async-data-service/create-lazy.js +194 -0
  39. package/service/async-data-service/create-lazy.js.map +1 -0
  40. package/service/async-data-service/create-lazy.test.js +477 -0
  41. package/service/async-data-service/create-lazy.test.js.map +1 -0
  42. package/service/async-data-service/example.d.ts +60 -0
  43. package/service/async-data-service/example.js +35 -0
  44. package/service/async-data-service/example.js.map +1 -0
  45. package/service/async-data-service/index.d.ts +1 -0
  46. package/service/async-data-service/index.js +3 -0
  47. package/service/async-data-service/index.js.map +1 -0
  48. package/service/{is-data-service.d.ts → async-data-service/is-valid.d.ts} +4 -4
  49. package/{lit/hooks/component/component.js → service/async-data-service/is-valid.js} +1 -1
  50. package/service/async-data-service/is-valid.js.map +1 -0
  51. package/service/async-data-service/public.d.ts +2 -0
  52. package/service/async-data-service/public.js +4 -0
  53. package/service/async-data-service/public.js.map +1 -0
  54. package/service/index.d.ts +1 -1
  55. package/service/index.js +1 -0
  56. package/service/index.js.map +1 -1
  57. package/tsconfig.tsbuildinfo +1 -1
  58. package/ecs/database/combine-plugins-test.d.ts +0 -39
  59. package/ecs/database/combine-plugins-test.js +0 -3
  60. package/ecs/database/combine-plugins-test.js.map +0 -1
  61. package/ecs/database/create-plugin-cryos-pattern.test.d.ts +0 -3
  62. package/ecs/database/create-plugin-cryos-pattern.test.js +0 -83
  63. package/ecs/database/create-plugin-cryos-pattern.test.js.map +0 -1
  64. package/ecs/database/create-plugin-graphics.test.d.ts +0 -93
  65. package/ecs/database/create-plugin-graphics.test.js +0 -135
  66. package/ecs/database/create-plugin-graphics.test.js.map +0 -1
  67. package/ecs/database/create-plugin-type.type-test.js +0 -563
  68. package/ecs/database/create-plugin-type.type-test.js.map +0 -1
  69. package/ecs/database/create-plugin-type.type.test.d.ts +0 -1
  70. package/ecs/database/create-plugin-type.type.test.js +0 -563
  71. package/ecs/database/create-plugin-type.type.test.js.map +0 -1
  72. package/ecs/database/experimental-action-types.d.ts +0 -1
  73. package/ecs/database/experimental-action-types.js +0 -275
  74. package/ecs/database/experimental-action-types.js.map +0 -1
  75. package/ecs/database/from-plugin.type-test.d.ts +0 -1
  76. package/ecs/database/from-plugin.type-test.js +0 -180
  77. package/ecs/database/from-plugin.type-test.js.map +0 -1
  78. package/ecs/database/plugin-types.d.ts +0 -1
  79. package/ecs/database/plugin-types.js +0 -5
  80. package/ecs/database/plugin-types.js.map +0 -1
  81. package/ecs/database/type-investigation.test.d.ts +0 -1
  82. package/ecs/database/type-investigation.test.js +0 -54
  83. package/ecs/database/type-investigation.test.js.map +0 -1
  84. package/lit/decorators/apply-decorator.d.ts +0 -1
  85. package/lit/decorators/apply-decorator.js +0 -19
  86. package/lit/decorators/apply-decorator.js.map +0 -1
  87. package/lit/decorators/apply-service-decorators.d.ts +0 -1
  88. package/lit/decorators/apply-service-decorators.js +0 -13
  89. package/lit/decorators/apply-service-decorators.js.map +0 -1
  90. package/lit/decorators/index.d.ts +0 -3
  91. package/lit/decorators/index.js +0 -5
  92. package/lit/decorators/index.js.map +0 -1
  93. package/lit/decorators/require-service.d.ts +0 -1
  94. package/lit/decorators/require-service.js +0 -14
  95. package/lit/decorators/require-service.js.map +0 -1
  96. package/lit/elements/application-element.d.ts +0 -9
  97. package/lit/elements/application-element.js +0 -42
  98. package/lit/elements/application-element.js.map +0 -1
  99. package/lit/elements/application-host.d.ts +0 -16
  100. package/lit/elements/application-host.js +0 -39
  101. package/lit/elements/application-host.js.map +0 -1
  102. package/lit/elements/database-element.d.ts +0 -10
  103. package/lit/elements/database-element.js +0 -40
  104. package/lit/elements/database-element.js.map +0 -1
  105. package/lit/elements/index.d.ts +0 -3
  106. package/lit/elements/index.js +0 -5
  107. package/lit/elements/index.js.map +0 -1
  108. package/lit/functions/index.d.ts +0 -1
  109. package/lit/functions/index.js +0 -3
  110. package/lit/functions/index.js.map +0 -1
  111. package/lit/functions/iterate-self-and-ancestors.d.ts +0 -1
  112. package/lit/functions/iterate-self-and-ancestors.js +0 -24
  113. package/lit/functions/iterate-self-and-ancestors.js.map +0 -1
  114. package/lit/hooks/attach-decorator.d.ts +0 -4
  115. package/lit/hooks/attach-decorator.js +0 -26
  116. package/lit/hooks/attach-decorator.js.map +0 -1
  117. package/lit/hooks/component/component.d.ts +0 -10
  118. package/lit/hooks/component/component.js.map +0 -1
  119. package/lit/hooks/component/stack.d.ts +0 -6
  120. package/lit/hooks/component/stack.js +0 -16
  121. package/lit/hooks/component/stack.js.map +0 -1
  122. package/lit/hooks/index.d.ts +0 -19
  123. package/lit/hooks/index.js +0 -21
  124. package/lit/hooks/index.js.map +0 -1
  125. package/lit/hooks/use-connected.d.ts +0 -2
  126. package/lit/hooks/use-connected.js +0 -32
  127. package/lit/hooks/use-connected.js.map +0 -1
  128. package/lit/hooks/use-debounce.d.ts +0 -8
  129. package/lit/hooks/use-debounce.js +0 -21
  130. package/lit/hooks/use-debounce.js.map +0 -1
  131. package/lit/hooks/use-drag-observe.d.ts +0 -25
  132. package/lit/hooks/use-drag-observe.js +0 -35
  133. package/lit/hooks/use-drag-observe.js.map +0 -1
  134. package/lit/hooks/use-drag-transaction.d.ts +0 -7
  135. package/lit/hooks/use-drag-transaction.js +0 -35
  136. package/lit/hooks/use-drag-transaction.js.map +0 -1
  137. package/lit/hooks/use-draggable.d.ts +0 -15
  138. package/lit/hooks/use-draggable.js +0 -96
  139. package/lit/hooks/use-draggable.js.map +0 -1
  140. package/lit/hooks/use-effect.d.ts +0 -3
  141. package/lit/hooks/use-effect.js +0 -14
  142. package/lit/hooks/use-effect.js.map +0 -1
  143. package/lit/hooks/use-element.d.ts +0 -7
  144. package/lit/hooks/use-element.js +0 -67
  145. package/lit/hooks/use-element.js.map +0 -1
  146. package/lit/hooks/use-memo.d.ts +0 -1
  147. package/lit/hooks/use-memo.js +0 -13
  148. package/lit/hooks/use-memo.js.map +0 -1
  149. package/lit/hooks/use-observable-values.d.ts +0 -4
  150. package/lit/hooks/use-observable-values.js +0 -9
  151. package/lit/hooks/use-observable-values.js.map +0 -1
  152. package/lit/hooks/use-observable.d.ts +0 -2
  153. package/lit/hooks/use-observable.js +0 -13
  154. package/lit/hooks/use-observable.js.map +0 -1
  155. package/lit/hooks/use-ref.d.ts +0 -3
  156. package/lit/hooks/use-ref.js +0 -7
  157. package/lit/hooks/use-ref.js.map +0 -1
  158. package/lit/hooks/use-resize-observer.d.ts +0 -12
  159. package/lit/hooks/use-resize-observer.js +0 -23
  160. package/lit/hooks/use-resize-observer.js.map +0 -1
  161. package/lit/hooks/use-state.d.ts +0 -2
  162. package/lit/hooks/use-state.js +0 -15
  163. package/lit/hooks/use-state.js.map +0 -1
  164. package/lit/hooks/use-updated.d.ts +0 -4
  165. package/lit/hooks/use-updated.js +0 -40
  166. package/lit/hooks/use-updated.js.map +0 -1
  167. package/lit/hooks/use-window-event.d.ts +0 -1
  168. package/lit/hooks/use-window-event.js +0 -11
  169. package/lit/hooks/use-window-event.js.map +0 -1
  170. package/lit/hooks/with-hooks.d.ts +0 -2
  171. package/lit/hooks/with-hooks.js +0 -16
  172. package/lit/hooks/with-hooks.js.map +0 -1
  173. package/lit/index.d.ts +0 -4
  174. package/lit/index.js +0 -5
  175. package/lit/index.js.map +0 -1
  176. package/normalize.test.d.ts +0 -1
  177. package/normalize.test.js +0 -28
  178. package/normalize.test.js.map +0 -1
  179. package/samples/index.d.ts +0 -13
  180. package/samples/index.js +0 -7
  181. package/samples/index.js.map +0 -1
  182. package/samples/todo/elements/todo-list/todo-list-presentation.d.ts +0 -8
  183. package/samples/todo/elements/todo-list/todo-list-presentation.js +0 -12
  184. package/samples/todo/elements/todo-list/todo-list-presentation.js.map +0 -1
  185. package/samples/todo/elements/todo-list/todo-list.css.d.ts +0 -1
  186. package/samples/todo/elements/todo-list/todo-list.css.js +0 -11
  187. package/samples/todo/elements/todo-list/todo-list.css.js.map +0 -1
  188. package/samples/todo/elements/todo-list/todo-list.d.ts +0 -12
  189. package/samples/todo/elements/todo-list/todo-list.js +0 -44
  190. package/samples/todo/elements/todo-list/todo-list.js.map +0 -1
  191. package/samples/todo/elements/todo-row/index.d.ts +0 -1
  192. package/samples/todo/elements/todo-row/index.js +0 -3
  193. package/samples/todo/elements/todo-row/index.js.map +0 -1
  194. package/samples/todo/elements/todo-row/todo-row-presentation.d.ts +0 -18
  195. package/samples/todo/elements/todo-row/todo-row-presentation.js +0 -50
  196. package/samples/todo/elements/todo-row/todo-row-presentation.js.map +0 -1
  197. package/samples/todo/elements/todo-row/todo-row.css.d.ts +0 -1
  198. package/samples/todo/elements/todo-row/todo-row.css.js +0 -49
  199. package/samples/todo/elements/todo-row/todo-row.css.js.map +0 -1
  200. package/samples/todo/elements/todo-row/todo-row.d.ts +0 -14
  201. package/samples/todo/elements/todo-row/todo-row.js +0 -44
  202. package/samples/todo/elements/todo-row/todo-row.js.map +0 -1
  203. package/samples/todo/elements/todo-toolbar/index.d.ts +0 -1
  204. package/samples/todo/elements/todo-toolbar/index.js +0 -3
  205. package/samples/todo/elements/todo-toolbar/index.js.map +0 -1
  206. package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.d.ts +0 -22
  207. package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +0 -41
  208. package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +0 -1
  209. package/samples/todo/elements/todo-toolbar/todo-toolbar.css.d.ts +0 -1
  210. package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +0 -34
  211. package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +0 -1
  212. package/samples/todo/elements/todo-toolbar/todo-toolbar.d.ts +0 -11
  213. package/samples/todo/elements/todo-toolbar/todo-toolbar.js +0 -61
  214. package/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +0 -1
  215. package/samples/todo/elements/todo-undo-redo/index.d.ts +0 -1
  216. package/samples/todo/elements/todo-undo-redo/index.js +0 -3
  217. package/samples/todo/elements/todo-undo-redo/index.js.map +0 -1
  218. package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.d.ts +0 -17
  219. package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +0 -29
  220. package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +0 -1
  221. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.d.ts +0 -1
  222. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +0 -12
  223. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +0 -1
  224. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.d.ts +0 -11
  225. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +0 -36
  226. package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +0 -1
  227. package/samples/todo/services/dependent-state-service/create-dependent-state-service.d.ts +0 -6
  228. package/samples/todo/services/dependent-state-service/create-dependent-state-service.js +0 -5
  229. package/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +0 -1
  230. package/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +0 -2
  231. package/samples/todo/services/dependent-state-service/dependent-state/all-todos.js +0 -2
  232. package/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +0 -1
  233. package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +0 -2
  234. package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js +0 -2
  235. package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +0 -1
  236. package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +0 -2
  237. package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js +0 -2
  238. package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +0 -1
  239. package/samples/todo/services/dependent-state-service/dependent-state/index.d.ts +0 -3
  240. package/samples/todo/services/dependent-state-service/dependent-state/index.js +0 -5
  241. package/samples/todo/services/dependent-state-service/dependent-state/index.js.map +0 -1
  242. package/samples/todo/services/dependent-state-service/dependent-state-service.d.ts +0 -2
  243. package/samples/todo/services/dependent-state-service/dependent-state-service.js +0 -2
  244. package/samples/todo/services/dependent-state-service/dependent-state-service.js.map +0 -1
  245. package/samples/todo/services/main-service/create-main-service.d.ts +0 -8
  246. package/samples/todo/services/main-service/create-main-service.js +0 -39
  247. package/samples/todo/services/main-service/create-main-service.js.map +0 -1
  248. package/samples/todo/services/main-service/todo-main-service.d.ts +0 -18
  249. package/samples/todo/services/main-service/todo-main-service.js +0 -2
  250. package/samples/todo/services/main-service/todo-main-service.js.map +0 -1
  251. package/samples/todo/services/state-service/create-todo-database.d.ts +0 -37
  252. package/samples/todo/services/state-service/create-todo-database.js +0 -10
  253. package/samples/todo/services/state-service/create-todo-database.js.map +0 -1
  254. package/samples/todo/services/state-service/create-todo-store.d.ts +0 -37
  255. package/samples/todo/services/state-service/create-todo-store.js +0 -24
  256. package/samples/todo/services/state-service/create-todo-store.js.map +0 -1
  257. package/samples/todo/services/state-service/todo-state-service.d.ts +0 -5
  258. package/samples/todo/services/state-service/todo-state-service.js +0 -2
  259. package/samples/todo/services/state-service/todo-state-service.js.map +0 -1
  260. package/samples/todo/services/state-service/transactions/create-bulk-todos.d.ts +0 -2
  261. package/samples/todo/services/state-service/transactions/create-bulk-todos.js +0 -10
  262. package/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +0 -1
  263. package/samples/todo/services/state-service/transactions/create-todo.d.ts +0 -5
  264. package/samples/todo/services/state-service/transactions/create-todo.js +0 -13
  265. package/samples/todo/services/state-service/transactions/create-todo.js.map +0 -1
  266. package/samples/todo/services/state-service/transactions/create-todo.test.d.ts +0 -1
  267. package/samples/todo/services/state-service/transactions/create-todo.test.js +0 -16
  268. package/samples/todo/services/state-service/transactions/create-todo.test.js.map +0 -1
  269. package/samples/todo/services/state-service/transactions/delete-all-todos.d.ts +0 -2
  270. package/samples/todo/services/state-service/transactions/delete-all-todos.js +0 -16
  271. package/samples/todo/services/state-service/transactions/delete-all-todos.js.map +0 -1
  272. package/samples/todo/services/state-service/transactions/delete-todo.d.ts +0 -3
  273. package/samples/todo/services/state-service/transactions/delete-todo.js +0 -8
  274. package/samples/todo/services/state-service/transactions/delete-todo.js.map +0 -1
  275. package/samples/todo/services/state-service/transactions/delete-todo.test.d.ts +0 -1
  276. package/samples/todo/services/state-service/transactions/delete-todo.test.js +0 -24
  277. package/samples/todo/services/state-service/transactions/delete-todo.test.js.map +0 -1
  278. package/samples/todo/services/state-service/transactions/drag-todo.d.ts +0 -7
  279. package/samples/todo/services/state-service/transactions/drag-todo.js +0 -17
  280. package/samples/todo/services/state-service/transactions/drag-todo.js.map +0 -1
  281. package/samples/todo/services/state-service/transactions/index.d.ts +0 -6
  282. package/samples/todo/services/state-service/transactions/index.js +0 -9
  283. package/samples/todo/services/state-service/transactions/index.js.map +0 -1
  284. package/samples/todo/services/state-service/transactions/reorder-todos.d.ts +0 -6
  285. package/samples/todo/services/state-service/transactions/reorder-todos.js +0 -11
  286. package/samples/todo/services/state-service/transactions/reorder-todos.js.map +0 -1
  287. package/samples/todo/services/state-service/transactions/toggle-complete.d.ts +0 -3
  288. package/samples/todo/services/state-service/transactions/toggle-complete.js +0 -11
  289. package/samples/todo/services/state-service/transactions/toggle-complete.js.map +0 -1
  290. package/samples/todo/services/state-service/transactions/toggle-complete.test.d.ts +0 -1
  291. package/samples/todo/services/state-service/transactions/toggle-complete.test.js +0 -65
  292. package/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +0 -1
  293. package/samples/todo/todo-element.d.ts +0 -4
  294. package/samples/todo/todo-element.js +0 -4
  295. package/samples/todo/todo-element.js.map +0 -1
  296. package/samples/todo/todo-host.d.ts +0 -8
  297. package/samples/todo/todo-host.js +0 -35
  298. package/samples/todo/todo-host.js.map +0 -1
  299. package/samples/todo/todo-main-element.d.ts +0 -10
  300. package/samples/todo/todo-main-element.js +0 -47
  301. package/samples/todo/todo-main-element.js.map +0 -1
  302. package/samples/todo/todo-sample.d.ts +0 -3
  303. package/samples/todo/todo-sample.js +0 -19
  304. package/samples/todo/todo-sample.js.map +0 -1
  305. package/service/is-data-service.js +0 -2
  306. package/service/is-data-service.js.map +0 -1
  307. package/typed-buffer/public.d.ts +0 -2
  308. package/typed-buffer/public.js +0 -4
  309. package/typed-buffer/public.js.map +0 -1
  310. /package/{ecs/database/create-plugin-type.type-test.d.ts → service/async-data-service/create-lazy.test.d.ts} +0 -0
@@ -1,42 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- import { LitElement } from 'lit';
9
- import { property } from 'lit/decorators.js';
10
- import { attachDecorator, withHooks } from '../hooks/index.js';
11
- import { iterateSelfAndAncestors } from '../functions/index.js';
12
- import { isService } from '../../service/index.js';
13
- export class ApplicationElement extends LitElement {
14
- constructor() {
15
- super();
16
- attachDecorator(this, 'render', withHooks);
17
- }
18
- connectedCallback() {
19
- super.connectedCallback();
20
- if (!this.service) {
21
- const service = this.findAncestorService();
22
- if (service) {
23
- this.service = service;
24
- }
25
- }
26
- }
27
- findAncestorService() {
28
- for (const element of iterateSelfAndAncestors(this)) {
29
- const { service } = element;
30
- if (isService(service)) {
31
- return service;
32
- }
33
- }
34
- }
35
- render() {
36
- throw new Error('render function must be overridden');
37
- }
38
- }
39
- __decorate([
40
- property({ type: Object, reflect: false })
41
- ], ApplicationElement.prototype, "service", void 0);
42
- //# sourceMappingURL=application-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"application-element.js","sourceRoot":"","sources":["../../../src/lit/elements/application-element.ts"],"names":[],"mappings":"AAAA,uDAAuD;;;;;;;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAW,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,OAAO,kBAAgD,SAAQ,UAAU;IAI7E;QACE,KAAK,EAAE,CAAC;QACR,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3C,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAES,mBAAmB;QAC3B,KAAK,MAAM,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAmD,CAAC;YACxE,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBACvB,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAEe,MAAM;QACpB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;CAEF;AA/BC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;mDACrB"}
@@ -1,16 +0,0 @@
1
- import { LitElement, nothing, TemplateResult } from 'lit';
2
- import { Service } from '../../service/index.js';
3
- import { ApplicationElement } from './application-element.js';
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'application-element': ApplicationElement<Service>;
7
- }
8
- }
9
- export declare class ApplicationHost<MainService extends Service = Service> extends LitElement {
10
- static styles: import("lit").CSSResult;
11
- createService: () => Promise<MainService>;
12
- renderElement: () => TemplateResult;
13
- service: MainService;
14
- connectedCallback(): Promise<void>;
15
- render(): TemplateResult | typeof nothing;
16
- }
@@ -1,39 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- import { LitElement, nothing, css } from 'lit';
9
- import { customElement, property } from 'lit/decorators.js';
10
- const tagName = "application-host";
11
- let ApplicationHost = class ApplicationHost extends LitElement {
12
- static { this.styles = css `
13
- :host {
14
- display: flex;
15
- flex: 1 1 auto;
16
- }
17
- `; }
18
- async connectedCallback() {
19
- super.connectedCallback();
20
- this.service = await this.createService();
21
- }
22
- render() {
23
- return this.service ? this.renderElement() : nothing;
24
- }
25
- };
26
- __decorate([
27
- property()
28
- ], ApplicationHost.prototype, "createService", void 0);
29
- __decorate([
30
- property({})
31
- ], ApplicationHost.prototype, "renderElement", void 0);
32
- __decorate([
33
- property({ attribute: false })
34
- ], ApplicationHost.prototype, "service", void 0);
35
- ApplicationHost = __decorate([
36
- customElement(tagName)
37
- ], ApplicationHost);
38
- export { ApplicationHost };
39
- //# sourceMappingURL=application-host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"application-host.js","sourceRoot":"","sources":["../../../src/lit/elements/application-host.ts"],"names":[],"mappings":"AAAA,uDAAuD;;;;;;;AAEvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAkB,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI5D,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAS5B,IAAM,eAAe,GAArB,MAAM,eAAuD,SAAQ,UAAU;aAC5E,WAAM,GAAG,GAAG,CAAA;;;;;KAKjB,AALW,CAKV;IAWM,KAAK,CAAC,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7C,CAAC;IAEQ,MAAM;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACxD,CAAC;;AAfD;IADC,QAAQ,EAAE;sDACgC;AAG3C;IADC,QAAQ,CAAC,EAAE,CAAC;sDACwB;AAG9B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACF;AAfnB,eAAe;IAD3B,aAAa,CAAC,OAAO,CAAC;GACV,eAAe,CA0B3B"}
@@ -1,10 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import { Database } from '../../ecs/index.js';
3
- export declare abstract class DatabaseElement<P extends Database.Plugin> extends LitElement {
4
- service: Database.Plugin.ToDatabase<P>;
5
- constructor();
6
- abstract get plugin(): P;
7
- connectedCallback(): void;
8
- protected findAncestorDatabase(): Database | void;
9
- render(): void;
10
- }
@@ -1,40 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- import { LitElement } from 'lit';
9
- import { property } from 'lit/decorators.js';
10
- import { iterateSelfAndAncestors } from '../functions/index.js';
11
- import { Database } from '../../ecs/index.js';
12
- import { attachDecorator, withHooks } from '../index.js';
13
- export class DatabaseElement extends LitElement {
14
- constructor() {
15
- super();
16
- attachDecorator(this, 'render', withHooks);
17
- }
18
- connectedCallback() {
19
- super.connectedCallback();
20
- if (!this.service) {
21
- const service = this.findAncestorDatabase();
22
- this.service = (service?.extend(this.plugin) ?? Database.create(this.plugin));
23
- }
24
- }
25
- findAncestorDatabase() {
26
- for (const element of iterateSelfAndAncestors(this)) {
27
- const { service } = element;
28
- if (Database.is(service)) {
29
- return service;
30
- }
31
- }
32
- }
33
- render() {
34
- throw new Error('render function must be overridden');
35
- }
36
- }
37
- __decorate([
38
- property({ type: Object, reflect: false })
39
- ], DatabaseElement.prototype, "service", void 0);
40
- //# sourceMappingURL=database-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database-element.js","sourceRoot":"","sources":["../../../src/lit/elements/database-element.ts"],"names":[],"mappings":"AAAA,uDAAuD;;;;;;;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,OAAgB,eAA2C,SAAQ,UAAU;IAKjF;QACE,KAAK,EAAE,CAAC;QACR,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;IAID,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAA6C,CAAC;QAC5H,CAAC;IACH,CAAC;IAES,oBAAoB;QAC5B,KAAK,MAAM,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAwC,CAAC;YAC7D,IAAI,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;gBACzB,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAEe,MAAM;QACpB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;CAEF;AA/BC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gDACH"}
@@ -1,3 +0,0 @@
1
- export * from "./application-host.js";
2
- export * from "./application-element.js";
3
- export * from "./database-element.js";
@@ -1,5 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from "./application-host.js";
3
- export * from "./application-element.js";
4
- export * from "./database-element.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/elements/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./iterate-self-and-ancestors.js";
@@ -1,3 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from "./iterate-self-and-ancestors.js";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/functions/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,iCAAiC,CAAC"}
@@ -1 +0,0 @@
1
- export declare function iterateSelfAndAncestors(element: Element): IterableIterator<Element>;
@@ -1,24 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export function* iterateSelfAndAncestors(element) {
3
- let current = element;
4
- while (current) {
5
- yield current;
6
- if (current instanceof HTMLSlotElement && current.assignedSlot) {
7
- // Move to the slot's parent if the current element is assigned to a slot
8
- current = current.assignedSlot;
9
- }
10
- else if (current.parentNode instanceof Element) {
11
- // Move up to the parent node if it is an element
12
- current = current.parentNode;
13
- }
14
- else if (current.getRootNode().host) {
15
- // Move to the host element if we're at a shadow root
16
- current = current.getRootNode().host;
17
- }
18
- else {
19
- // If no more ancestors, stop the iteration
20
- current = null;
21
- }
22
- }
23
- }
24
- //# sourceMappingURL=iterate-self-and-ancestors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iterate-self-and-ancestors.js","sourceRoot":"","sources":["../../../src/lit/functions/iterate-self-and-ancestors.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,MAAM,SAAS,CAAC,CAAC,uBAAuB,CAAC,OAAgB;IACrD,IAAI,OAAO,GAAmB,OAAO,CAAC;IAEtC,OAAO,OAAO,EAAE,CAAC;QACb,MAAM,OAAO,CAAC;QAEd,IAAI,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YAC7D,yEAAyE;YACzE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;QACnC,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,YAAY,OAAO,EAAE,CAAC;YAC/C,iDAAiD;YACjD,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;QACjC,CAAC;aAAM,IAAK,OAAO,CAAC,WAAW,EAAiB,CAAC,IAAI,EAAE,CAAC;YACpD,qDAAqD;YACrD,OAAO,GAAI,OAAO,CAAC,WAAW,EAAiB,CAAC,IAAI,CAAC;QACzD,CAAC;aAAM,CAAC;YACJ,2CAA2C;YAC3C,OAAO,GAAG,IAAI,CAAC;QACnB,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Attacheds a decorator to a method on an object and reassigns the resulting value back to the object.
3
- */
4
- export declare function attachDecorator<T, K extends keyof T>(obj: T, property: K, decorator: (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T[K]>) => PropertyDescriptor): void;
@@ -1,26 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- /**
3
- * Attacheds a decorator to a method on an object and reassigns the resulting value back to the object.
4
- */
5
- export function attachDecorator(obj, property,
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
7
- decorator) {
8
- // Get the descriptor of the property
9
- let descriptor = Object.getOwnPropertyDescriptor(obj, property);
10
- if (!descriptor) {
11
- if (!obj[property]) {
12
- throw new Error(`Property ${property.toString()} does not exist on object`);
13
- }
14
- descriptor = {
15
- value: obj[property],
16
- writable: true,
17
- enumerable: true,
18
- configurable: true,
19
- };
20
- }
21
- // Apply the decorator to the descriptor
22
- const decoratedDescriptor = decorator(obj, String(property), descriptor);
23
- // Reassign the decorated method back to the object
24
- obj[property] = decoratedDescriptor.value;
25
- }
26
- //# sourceMappingURL=attach-decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attach-decorator.js","sourceRoot":"","sources":["../../../src/lit/hooks/attach-decorator.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,GAAM,EACN,QAAW;AACX,wFAAwF;AACxF,SAA8G;IAE9G,qCAAqC;IACrC,IAAI,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEhE,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;QAChF,CAAC;QACD,UAAU,GAAG;YACT,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC;YACpB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACrB,CAAC;IACN,CAAC;IAED,wCAAwC;IACxC,MAAM,mBAAmB,GAAG,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAEzE,mDAAmD;IACnD,GAAG,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC;AAC9C,CAAC"}
@@ -1,10 +0,0 @@
1
- export interface Component extends EventTarget {
2
- /**
3
- * Is this component active and connected to the containing dom?
4
- */
5
- readonly isConnected: boolean;
6
- hookIndex: number;
7
- hooks: any[];
8
- updatedListeners: Set<() => void>;
9
- requestUpdate(): void;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/lit/hooks/component/component.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
@@ -1,6 +0,0 @@
1
- import type { Component } from "./component.js";
2
- export declare const Component_stack: {
3
- readonly active: () => Component;
4
- readonly push: (component: Component) => void;
5
- readonly pop: () => void;
6
- };
@@ -1,16 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- const activeComponentStack = [];
3
- export const Component_stack = {
4
- active() {
5
- return activeComponentStack[activeComponentStack.length - 1];
6
- },
7
- push(component) {
8
- component.hookIndex = 0;
9
- component.hooks ??= [];
10
- activeComponentStack.push(component);
11
- },
12
- pop() {
13
- activeComponentStack.pop();
14
- }
15
- };
16
- //# sourceMappingURL=stack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../src/lit/hooks/component/stack.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAIvD,MAAM,oBAAoB,GAAgB,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,MAAM;QACF,OAAO,oBAAoB,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;IAClE,CAAC;IACD,IAAI,CAAC,SAAoB;QACrB,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC;QACxB,SAAS,CAAC,KAAK,KAAK,EAAE,CAAC;QACvB,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACxC,CAAC;IACD,GAAG;QACC,oBAAoB,CAAC,GAAG,EAAE,CAAA;IAC9B,CAAC;CACK,CAAC"}
@@ -1,19 +0,0 @@
1
- export * from "./component/component.js";
2
- export * from "./component/stack.js";
3
- export * from "./use-state.js";
4
- export * from "./use-effect.js";
5
- export * from "./use-connected.js";
6
- export * from "./use-memo.js";
7
- export * from "./use-ref.js";
8
- export * from "./use-observable-values.js";
9
- export * from "./use-observable.js";
10
- export * from "./use-window-event.js";
11
- export * from "./use-resize-observer.js";
12
- export * from "./use-debounce.js";
13
- export * from "./use-element.js";
14
- export * from "./with-hooks.js";
15
- export * from "./attach-decorator.js";
16
- export * from "./use-drag-transaction.js";
17
- export * from "./use-drag-observe.js";
18
- export * from "./use-draggable.js";
19
- export * from "./use-updated.js";
@@ -1,21 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from "./component/component.js";
3
- export * from "./component/stack.js";
4
- export * from "./use-state.js";
5
- export * from "./use-effect.js";
6
- export * from "./use-connected.js";
7
- export * from "./use-memo.js";
8
- export * from "./use-ref.js";
9
- export * from "./use-observable-values.js";
10
- export * from "./use-observable.js";
11
- export * from "./use-window-event.js";
12
- export * from "./use-resize-observer.js";
13
- export * from "./use-debounce.js";
14
- export * from "./use-element.js";
15
- export * from "./with-hooks.js";
16
- export * from "./attach-decorator.js";
17
- export * from "./use-drag-transaction.js";
18
- export * from "./use-drag-observe.js";
19
- export * from "./use-draggable.js";
20
- export * from "./use-updated.js";
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/hooks/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { EffectCallback } from "./use-effect.js";
2
- export declare function useConnected(callback: EffectCallback, dependencies?: unknown[]): void;
@@ -1,32 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { useEffect } from "./use-effect.js";
3
- import { Component_stack } from "./component/stack.js";
4
- export function useConnected(callback, dependencies) {
5
- const component = Component_stack.active();
6
- let disconnect;
7
- function onConnect() {
8
- if (!disconnect) {
9
- disconnect = callback();
10
- }
11
- }
12
- function onDisconnect() {
13
- if (disconnect) {
14
- disconnect?.();
15
- disconnect = undefined;
16
- }
17
- }
18
- // TODO
19
- if (component.isConnected) {
20
- onConnect();
21
- }
22
- useEffect(() => {
23
- component.addEventListener("connected", onConnect);
24
- component.addEventListener("disconnected", onDisconnect);
25
- return () => {
26
- component.removeEventListener("connected", onConnect);
27
- component.removeEventListener("disconnected", onDisconnect);
28
- onDisconnect();
29
- };
30
- }, dependencies);
31
- }
32
- //# sourceMappingURL=use-connected.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-connected.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-connected.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,UAAU,YAAY,CAAC,QAAwB,EAAE,YAAwB;IAC3E,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;IAE3C,IAAI,UAA+B,CAAC;IACpC,SAAS,SAAS;QACd,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,UAAU,GAAG,QAAQ,EAAE,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,SAAS,YAAY;QACjB,IAAI,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,EAAE,CAAC;YACf,UAAU,GAAG,SAAS,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,QAAQ;IACR,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QACxB,SAAS,EAAE,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACX,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACnD,SAAS,CAAC,gBAAgB,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;QAEzD,OAAO,GAAG,EAAE;YACR,SAAS,CAAC,mBAAmB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YACtD,SAAS,CAAC,mBAAmB,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAE5D,YAAY,EAAE,CAAC;QACnB,CAAC,CAAA;IAEL,CAAC,EAAE,YAAY,CAAC,CAAC;AACrB,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Hook to debounce a value. Returns the debounced value after the specified delay.
3
- *
4
- * @param value - The value to debounce
5
- * @param delay - Delay in milliseconds before updating the debounced value
6
- * @returns The debounced value
7
- */
8
- export declare function useDebounce<T>(value: T, delay: number): T;
@@ -1,21 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { useEffect } from "./use-effect.js";
3
- import { useState } from "./use-state.js";
4
- /**
5
- * Hook to debounce a value. Returns the debounced value after the specified delay.
6
- *
7
- * @param value - The value to debounce
8
- * @param delay - Delay in milliseconds before updating the debounced value
9
- * @returns The debounced value
10
- */
11
- export function useDebounce(value, delay) {
12
- const [debouncedValue, setDebouncedValue] = useState(value);
13
- useEffect(() => {
14
- const timeoutId = window.setTimeout(() => {
15
- setDebouncedValue(value);
16
- }, delay);
17
- return () => clearTimeout(timeoutId);
18
- }, [value, delay]);
19
- return debouncedValue;
20
- }
21
- //# sourceMappingURL=use-debounce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-debounce.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-debounce.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAI,KAAQ,EAAE,KAAa;IAClD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YACrC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnB,OAAO,cAAc,CAAC;AAC1B,CAAC"}
@@ -1,25 +0,0 @@
1
- import { DraggableProps } from './use-draggable.js';
2
- import { Observe } from '../../observe/index.js';
3
- import { Vec2 } from '../../math/index.js';
4
- export type DragObserveProps = Pick<DraggableProps, 'minDragDistance' | 'dragCursor' | 'addPlaceholder' | 'stopPropagation'>;
5
- export type DragStart = {
6
- readonly type: 'start' | 'cancel';
7
- };
8
- export type DragMove = {
9
- readonly type: 'move';
10
- readonly delta: Vec2;
11
- readonly position: Vec2;
12
- };
13
- export type DragEnd = {
14
- readonly type: 'end';
15
- readonly delta: Vec2;
16
- readonly position: Vec2;
17
- };
18
- export type DragState = DragStart | DragMove | DragEnd;
19
- /**
20
- * This hook creates a drag observe function that can be used to observe the drag state of an element.
21
- * This is normally not used directly, but rather through the `useDragTransaction` hook.
22
- * @param props
23
- * @returns
24
- */
25
- export declare function useDragObserve(props: DragObserveProps, dependencies: unknown[]): Observe<DragState>;
@@ -1,35 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { useDraggable } from './use-draggable.js';
3
- import { useElement } from './use-element.js';
4
- import { Observe } from '../../observe/index.js';
5
- /**
6
- * This hook creates a drag observe function that can be used to observe the drag state of an element.
7
- * This is normally not used directly, but rather through the `useDragTransaction` hook.
8
- * @param props
9
- * @returns
10
- */
11
- export function useDragObserve(props, dependencies) {
12
- const [dragState, setDragState] = Observe.createEvent();
13
- const element = useElement();
14
- useDraggable(element, {
15
- ...props,
16
- onDragStart: _e => {
17
- setDragState({ type: 'start' });
18
- },
19
- onDrag: (_e, position, delta) => {
20
- setDragState({
21
- type: 'move',
22
- position,
23
- delta,
24
- });
25
- },
26
- onDragEnd: (_e, position, delta) => {
27
- setDragState({ type: 'end', position, delta });
28
- },
29
- onDragCancel: () => {
30
- setDragState({ type: 'cancel' });
31
- },
32
- }, dependencies);
33
- return dragState;
34
- }
35
- //# sourceMappingURL=use-drag-observe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-drag-observe.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-drag-observe.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAsBjD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuB,EAAE,YAAuB;IAC3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,WAAW,EAAa,CAAC;IACnE,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,YAAY,CAAC,OAAO,EAChB;QACI,GAAG,KAAK;QACR,WAAW,EAAE,EAAE,CAAC,EAAE;YACd,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;YAC5B,YAAY,CAAC;gBACT,IAAI,EAAE,MAAM;gBACZ,QAAQ;gBACR,KAAK;aACR,CAAC,CAAC;QACP,CAAC;QACD,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;YAC/B,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACf,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;KACJ,EACD,YAAY,CACf,CAAC;IACF,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { DragEnd, DragMove, DragObserveProps } from './use-drag-observe.js';
2
- import type { AsyncArgsProvider } from '../../ecs/store/transaction-functions.js';
3
- export type DragTransactionProps<T> = DragObserveProps & {
4
- transaction: (asyncArgs: AsyncArgsProvider<T>) => void;
5
- update: (drag: DragMove | DragEnd) => T | void;
6
- };
7
- export declare function useDragTransaction<T>(props: DragTransactionProps<T>, dependencies: unknown[]): void;
@@ -1,35 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { useDragObserve } from './use-drag-observe.js';
3
- import { useEffect } from "./use-effect.js";
4
- import { Observe } from '../../observe/index.js';
5
- export function useDragTransaction(props, dependencies) {
6
- const { transaction, update } = props;
7
- const dragObserve = useDragObserve(props, dependencies);
8
- const startDragTransaction = () => {
9
- let done = false;
10
- // we start the transaction by calling it with an async generator that will yield the args asynchronously
11
- transaction(
12
- // we create the async generator by mapping the dragObserve state changes to transaction args
13
- () => Observe.toAsyncGenerator(
14
- // this uses the withMap function and the provided update and finish functions
15
- // any type 'start' will just be ignored and filtered out
16
- Observe.withFilter(dragObserve, value => {
17
- if (value.type === 'end') {
18
- done = true;
19
- return update(value);
20
- }
21
- if (value.type === 'move') {
22
- return update(value);
23
- }
24
- }), _value => done));
25
- };
26
- // now we will observe the drag state and start a new transaction whenever a drag starts
27
- useEffect(() => {
28
- return dragObserve(value => {
29
- if (value.type === 'start') {
30
- startDragTransaction();
31
- }
32
- });
33
- }, dependencies);
34
- }
35
- //# sourceMappingURL=use-drag-transaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-drag-transaction.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-drag-transaction.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAuC,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAOjD,MAAM,UAAU,kBAAkB,CAAI,KAA8B,EAAE,YAAuB;IACzF,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACxD,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAC9B,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,yGAAyG;QACzG,WAAW;QACP,6FAA6F;QAC7F,GAAG,EAAE,CACD,OAAO,CAAC,gBAAgB;QACpB,8EAA8E;QAC9E,yDAAyD;QACzD,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YACpC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACvB,IAAI,GAAG,IAAI,CAAC;gBACZ,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACxB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;QACL,CAAC,CAAC,EACF,MAAM,CAAC,EAAE,CAAC,IAAI,CACjB,CACR,CAAC;IACN,CAAC,CAAC;IACF,wFAAwF;IACxF,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,WAAW,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACzB,oBAAoB,EAAE,CAAC;YAC3B,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,YAAY,CAAC,CAAC;AACrB,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Vec2 } from '../../math/vec2/index.js';
2
- export interface DraggableProps {
3
- onDragStart: (e: PointerEvent) => Vec2 | void;
4
- onDrag: (e: PointerEvent, newPosition: Vec2, delta: Vec2) => void;
5
- onDragEnd?: (e: PointerEvent, newPosition: Vec2, delta: Vec2) => void;
6
- /**
7
- * Called if this hook is destroyed before the drag is completed.
8
- */
9
- onDragCancel?: () => void;
10
- minDragDistance?: number;
11
- dragCursor?: string;
12
- addPlaceholder?: boolean;
13
- stopPropagation?: boolean;
14
- }
15
- export declare function useDraggable(element: HTMLElement, props: DraggableProps, dependencies: unknown[]): void;