@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,2 +0,0 @@
1
- export const allTodos = (service) => service.state.observe.select(service.state.archetypes.Todo.components, { order: { order: true } });
2
- //# sourceMappingURL=all-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"all-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/dependent-state-service/dependent-state/all-todos.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAwB,EAAE,EAAE,CACnD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { TodoCoreService } from '../../main-service/todo-main-service.js';
2
- export declare const completeTodos: (service: TodoCoreService) => import("../../../../../observe/index.js").Observe<readonly number[]>;
@@ -1,2 +0,0 @@
1
- export const completeTodos = (service) => service.state.observe.select(service.state.archetypes.Todo.components, { where: { complete: true } });
2
- //# sourceMappingURL=complete-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complete-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/dependent-state-service/dependent-state/complete-todos.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAE,EAAE,CACxD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { TodoCoreService } from '../../main-service/todo-main-service.js';
2
- export declare const incompleteTodos: (service: TodoCoreService) => import("../../../../../observe/index.js").Observe<readonly number[]>;
@@ -1,2 +0,0 @@
1
- export const incompleteTodos = (service) => service.state.observe.select(service.state.archetypes.Todo.components, { where: { complete: false } });
2
- //# sourceMappingURL=incomplete-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"incomplete-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC1D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './all-todos.js';
2
- export * from './complete-todos.js';
3
- export * from './incomplete-todos.js';
@@ -1,5 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from './all-todos.js';
3
- export * from './complete-todos.js';
4
- export * from './incomplete-todos.js';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/dependent-state-service/dependent-state/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { createDependentStateService } from './create-dependent-state-service.js';
2
- export type DependentStateService = ReturnType<typeof createDependentStateService>;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=dependent-state-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependent-state-service.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/dependent-state-service/dependent-state-service.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { TodoMainService } from './todo-main-service.js';
2
- import { TodoStateService } from '../state-service/todo-state-service.js';
3
- /**
4
- * Initializes any core services and returns a new todo main service.
5
- */
6
- export declare function createMainService(services?: {
7
- state?: TodoStateService;
8
- }): Promise<TodoMainService>;
@@ -1,39 +0,0 @@
1
- import { createStoragePersistenceService, createUndoRedoService } from '../../../../ecs/index.js';
2
- import { createDependentStateService } from '../dependent-state-service/create-dependent-state-service.js';
3
- import { createTodoDatabase } from '../state-service/create-todo-database.js';
4
- import { todoStoreSchemaVersion } from '../state-service/create-todo-store.js';
5
- /**
6
- * Initializes any core services and returns a new todo main service.
7
- */
8
- export async function createMainService(services = {}) {
9
- {
10
- const { state = createTodoDatabase(), ...rest } = services;
11
- state.transactions.createTodo({ name: 'Buy groceries' });
12
- state.transactions.createTodo({ name: 'Pickup dry cleaning' });
13
- state.transactions.createTodo({ name: 'Buy flowers', complete: true });
14
- const persistence = await createStoragePersistenceService({
15
- database: state,
16
- storage: sessionStorage,
17
- defaultFileId: `todo-database-v${todoStoreSchemaVersion}`,
18
- autoSaveOnChange: true,
19
- autoLoadOnStart: true,
20
- });
21
- // Create the undo-redo actions
22
- const undoRedo = createUndoRedoService(state);
23
- // The core service is what we call the service without the dependent state service
24
- const coreService = {
25
- serviceName: 'todo-core-service',
26
- ...rest,
27
- state,
28
- undoRedo,
29
- persistence,
30
- };
31
- // We create the dependent state from the core service.
32
- const dependentState = createDependentStateService(coreService);
33
- return {
34
- ...coreService,
35
- dependentState,
36
- };
37
- }
38
- }
39
- //# sourceMappingURL=create-main-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-main-service.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/main-service/create-main-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAG/E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAEpC,EAAE;IACJ,CAAC;QACC,MAAM,EACJ,KAAK,GAAG,kBAAkB,EAAE,EAC5B,GAAG,IAAI,EACR,GAAG,QAAQ,CAAC;QAEb,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;QACzD,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAC/D,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAEvE,MAAM,WAAW,GAAG,MAAM,+BAA+B,CAAC;YACxD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,kBAAkB,sBAAsB,EAAE;YACzD,gBAAgB,EAAE,IAAI;YACtB,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;QAEH,+BAA+B;QAC/B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAE9C,mFAAmF;QACnF,MAAM,WAAW,GAAG;YAClB,WAAW,EAAE,mBAA4B;YACzC,GAAG,IAAI;YACP,KAAK;YACL,QAAQ;YACR,WAAW;SACc,CAAC;QAE5B,uDAAuD;QACvD,MAAM,cAAc,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;QAEhE,OAAO;YACL,GAAG,WAAW;YACd,cAAc;SACW,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -1,18 +0,0 @@
1
- import { PersistenceService, UndoRedoService } from '../../../../ecs/index.js';
2
- import { Service } from '../../../../service/index.js';
3
- import { DependentStateService } from '../dependent-state-service/dependent-state-service.js';
4
- import { TodoStateService } from '../state-service/todo-state-service.js';
5
- export interface TodoMainService extends Service {
6
- readonly serviceName: string;
7
- state: TodoStateService;
8
- dependentState: DependentStateService;
9
- undoRedo: UndoRedoService;
10
- persistence: PersistenceService;
11
- }
12
- export type TodoCoreService = Omit<TodoMainService, 'dependentState'>;
13
- /**
14
- * The main service as used by the UI. We only allow access to the observe and actions properties.
15
- */
16
- export type TodoUIMainService = Omit<TodoMainService, 'state'> & {
17
- state: Omit<TodoStateService, 'resources'>;
18
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=todo-main-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"todo-main-service.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/main-service/todo-main-service.ts"],"names":[],"mappings":""}
@@ -1,37 +0,0 @@
1
- import { Database } from '../../../../ecs/index.js';
2
- import * as actions from './transactions/index.js';
3
- export declare const createTodoDatabase: () => Database<import("../../../../schema/from-schemas.js").FromSchemas<{
4
- todo: {
5
- readonly type: "boolean";
6
- readonly const: true;
7
- readonly default: true;
8
- };
9
- complete: {
10
- type: "boolean";
11
- };
12
- name: {
13
- type: "string";
14
- };
15
- order: {
16
- readonly type: "number";
17
- readonly precision: 1;
18
- readonly default: number;
19
- };
20
- dragPosition: {
21
- oneOf: [{
22
- readonly type: "number";
23
- readonly precision: 1;
24
- readonly default: number;
25
- }, {
26
- type: "null";
27
- }];
28
- };
29
- }>, import("../../../../schema/from-schemas.js").FromSchemas<{
30
- displayCompleted: {
31
- type: "boolean";
32
- default: boolean;
33
- };
34
- }>, {
35
- Todo: ("todo" | "name" | "order" | "complete" | "dragPosition")[];
36
- }, import("../../../../ecs/index.js").ToTransactionFunctions<typeof actions>, never, {}>;
37
- export type TodoDatabase = ReturnType<typeof createTodoDatabase>;
@@ -1,10 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { createTodoStore } from './create-todo-store.js';
3
- import { Database } from '../../../../ecs/index.js';
4
- import * as actions from './transactions/index.js';
5
- export const createTodoDatabase = () => {
6
- const store = createTodoStore();
7
- const database = Database.create(store, actions);
8
- return database;
9
- };
10
- //# sourceMappingURL=create-todo-database.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-todo-database.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/state-service/create-todo-database.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
@@ -1,37 +0,0 @@
1
- import { Store } from '../../../../ecs/store/index.js';
2
- export declare const todoStoreSchemaVersion = 1;
3
- export declare const createTodoStore: () => Store<import("../../../../schema/from-schemas.js").FromSchemas<{
4
- todo: {
5
- readonly type: "boolean";
6
- readonly const: true;
7
- readonly default: true;
8
- };
9
- complete: {
10
- type: "boolean";
11
- };
12
- name: {
13
- type: "string";
14
- };
15
- order: {
16
- readonly type: "number";
17
- readonly precision: 1;
18
- readonly default: number;
19
- };
20
- dragPosition: {
21
- oneOf: [{
22
- readonly type: "number";
23
- readonly precision: 1;
24
- readonly default: number;
25
- }, {
26
- type: "null";
27
- }];
28
- };
29
- }>, import("../../../../schema/from-schemas.js").FromSchemas<{
30
- displayCompleted: {
31
- type: "boolean";
32
- default: boolean;
33
- };
34
- }>, {
35
- Todo: ("todo" | "name" | "order" | "complete" | "dragPosition")[];
36
- }>;
37
- export type TodoStore = ReturnType<typeof createTodoStore>;
@@ -1,24 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { Store } from '../../../../ecs/store/index.js';
3
- import { F32, True } from '../../../../schema/index.js';
4
- import { Schema } from '../../../../schema/index.js';
5
- // Increment this value if you change the schema in a non-backwards compatible way
6
- export const todoStoreSchemaVersion = 1;
7
- export const createTodoStore = () => {
8
- return Store.create({
9
- components: {
10
- todo: True.schema, // a tag that indicates an entity is a todo item.
11
- complete: { type: 'boolean' },
12
- name: { type: 'string' },
13
- order: F32.schema,
14
- dragPosition: Schema.Nullable(F32.schema), // null = not being dragged
15
- },
16
- resources: {
17
- displayCompleted: { type: 'boolean', default: false },
18
- },
19
- archetypes: {
20
- Todo: ['todo', 'complete', 'name', 'order', 'dragPosition'],
21
- }
22
- });
23
- };
24
- //# sourceMappingURL=create-todo-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-todo-store.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/state-service/create-todo-store.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,UAAU,EAAE;YACV,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,iDAAiD;YACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,GAAG,CAAC,MAAM;YACjB,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,2BAA2B;SACvE;QACD,SAAS,EAAE;YACT,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;SACtD;QACD,UAAU,EAAE;YACV,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC;SAC5D;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type TodoDatabase } from './create-todo-database.js';
2
- import { FromArchetype } from '../../../../ecs/index.js';
3
- export type TodoStateService = TodoDatabase;
4
- export type Todo = FromArchetype<TodoDatabase['archetypes']['Todo']>;
5
- export type DragTodoFunction = TodoStateService['transactions']['dragTodo'];
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=todo-state-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"todo-state-service.js","sourceRoot":"","sources":["../../../../../src/samples/todo/services/state-service/todo-state-service.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { type TodoStore } from '../create-todo-store.js';
2
- export declare const createBulkTodos: (t: TodoStore, count: number) => void;
@@ -1,10 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { createTodo } from './create-todo.js';
3
- export const createBulkTodos = (t, count) => {
4
- t.undoable = { coalesce: false };
5
- const currentCount = t.archetypes.Todo.rowCount;
6
- for (let i = 0; i < count; i++) {
7
- createTodo(t, { name: `Todo ${currentCount + i}`, complete: false });
8
- }
9
- };
10
- //# sourceMappingURL=create-bulk-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-bulk-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/create-bulk-todos.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAY,EAAE,KAAa,EAAE,EAAE;IAC7D,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;IAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,YAAY,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type TodoStore } from '../create-todo-store.js';
2
- export declare const createTodo: (t: TodoStore, props: {
3
- name: string;
4
- complete?: boolean;
5
- }) => number;
@@ -1,13 +0,0 @@
1
- export const createTodo = (t, props) => {
2
- t.undoable = { coalesce: false };
3
- const order = t.archetypes.Todo.rowCount;
4
- // TODO: Figure out why the order seems to be zero on each added row.
5
- return t.archetypes.Todo.insert({
6
- ...props,
7
- complete: props.complete ?? false,
8
- todo: true,
9
- order,
10
- dragPosition: null,
11
- });
12
- };
13
- //# sourceMappingURL=create-todo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-todo.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/create-todo.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAY,EAAE,KAA2C,EAAE,EAAE;IACtF,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;IACzC,qEAAqE;IACrE,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B,GAAG,KAAK;QACR,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK;QACjC,IAAI,EAAE,IAAI;QACV,KAAK;QACL,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { createTodo } from './create-todo.js';
3
- import { describe, expect, it } from 'vitest';
4
- import { createTodoStore } from '../create-todo-store.js';
5
- describe('createTodo', () => {
6
- describe('when creating a new todo', () => {
7
- it('should return the created todo entity id and create the todo', () => {
8
- const t = createTodoStore();
9
- const todoId = createTodo(t, { name: 'Buy groceries' });
10
- expect(todoId).toBeGreaterThanOrEqual(0);
11
- const values = t.read(todoId);
12
- expect(values).toEqual({ id: todoId, name: 'Buy groceries', dragPosition: null, complete: false, todo: true, order: 0 });
13
- });
14
- });
15
- });
16
- //# sourceMappingURL=create-todo.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-todo.test.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/create-todo.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;YACtE,MAAM,CAAC,GAAG,eAAe,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;YACxD,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9B,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3H,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type TodoStore } from '../create-todo-store.js';
2
- export declare const deleteAllTodos: (t: TodoStore) => void;
@@ -1,16 +0,0 @@
1
- export const deleteAllTodos = (t) => {
2
- t.undoable = { coalesce: false };
3
- // query for all specific archetypes which satisfy the general todo archetype
4
- for (const archetype of t.queryArchetypes(t.archetypes.Todo.components)) {
5
- // traverse each row in reverse order
6
- // it's slightly more efficient to delete in this order
7
- // since we don't need to swap the final row to fill in the hole on delete.
8
- for (let row = archetype.rowCount - 1; row >= 0; row--) {
9
- // get the id for this row from the id column
10
- const entityId = archetype.columns.id.get(row);
11
- // delete the entity
12
- t.delete(entityId);
13
- }
14
- }
15
- };
16
- //# sourceMappingURL=delete-all-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-all-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/delete-all-todos.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAY,EAAE,EAAE;IAC7C,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,6EAA6E;IAC7E,KAAK,MAAM,SAAS,IAAI,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACxE,qCAAqC;QACrC,uDAAuD;QACvD,2EAA2E;QAC3E,KAAK,IAAI,GAAG,GAAG,SAAS,CAAC,QAAQ,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;YACvD,6CAA6C;YAC7C,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/C,oBAAoB;YACpB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type Entity } from '../../../../../ecs/index.js';
2
- import { type TodoStore } from '../create-todo-store.js';
3
- export declare const deleteTodo: (t: TodoStore, id: Entity) => void;
@@ -1,8 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { reorderTodos } from './reorder-todos.js';
3
- export const deleteTodo = (t, id) => {
4
- t.undoable = { coalesce: false };
5
- t.delete(id);
6
- reorderTodos(t);
7
- };
8
- //# sourceMappingURL=delete-todo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-todo.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/delete-todo.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAY,EAAE,EAAU,EAAE,EAAE;IACrD,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACb,YAAY,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC"}
@@ -1,24 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { createTodo } from './create-todo.js';
3
- import { deleteTodo } from './delete-todo.js';
4
- import { describe, expect, it } from 'vitest';
5
- import { createTodoStore } from '../create-todo-store.js';
6
- describe('deleteTodo', () => {
7
- describe('when deleting a todo', () => {
8
- it('should remove it from the archetype', () => {
9
- const t = createTodoStore();
10
- const todoA = createTodo(t, { name: 'A' });
11
- const todoB = createTodo(t, { name: 'B' });
12
- const todoC = createTodo(t, { name: 'C' });
13
- deleteTodo(t, todoA);
14
- const values = t.read(todoA);
15
- expect(values).toBeNull();
16
- const valuesB = t.read(todoB);
17
- expect(valuesB).toBeDefined();
18
- const valuesC = t.read(todoC);
19
- expect(valuesC).toBeDefined();
20
- expect(t.archetypes.Todo.rowCount).toBe(2);
21
- });
22
- });
23
- });
24
- //# sourceMappingURL=delete-todo.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-todo.test.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/delete-todo.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,CAAC,GAAG,eAAe,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC3C,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YACrB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;YAC9B,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Entity } from '../../../../../ecs/index.js';
2
- import { type TodoStore } from '../create-todo-store.js';
3
- export declare const dragTodo: (t: TodoStore, props: {
4
- todo: Entity;
5
- dragPosition: number;
6
- finalIndex?: number;
7
- }) => void;
@@ -1,17 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { reorderTodos } from './reorder-todos.js';
3
- export const dragTodo = (t, props) => {
4
- t.undoable = { coalesce: false };
5
- const { todo, dragPosition, finalIndex } = props;
6
- const completed = finalIndex !== undefined;
7
- if (!completed) {
8
- t.update(todo, { dragPosition });
9
- }
10
- else {
11
- // insert it with an order value 0.5 less than the final index
12
- t.update(todo, { dragPosition: null, order: finalIndex - 0.5 });
13
- // then we call reorderTodos which will reorder everything to integer order values
14
- reorderTodos(t); // this is an example of calling another transaction from a transaction
15
- }
16
- };
17
- //# sourceMappingURL=drag-todo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drag-todo.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/drag-todo.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAY,EAAE,KAAkE,EAAE,EAAE;IAC3G,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,SAAS,GAAG,UAAU,KAAK,SAAS,CAAC;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,8DAA8D;QAC9D,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC;QAChE,kFAAkF;QAClF,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,uEAAuE;IAC1F,CAAC;AACH,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from './create-todo.js';
2
- export * from './delete-todo.js';
3
- export * from './toggle-complete.js';
4
- export * from './create-bulk-todos.js';
5
- export * from './drag-todo.js';
6
- export { applyOperations } from '../../../../../ecs/index.js';
@@ -1,9 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export * from './create-todo.js';
3
- export * from './delete-todo.js';
4
- export * from './toggle-complete.js';
5
- export * from './create-bulk-todos.js';
6
- export * from './drag-todo.js';
7
- // This is used by the undo-redo actions, the implementation is in the data package.
8
- export { applyOperations } from '../../../../../ecs/index.js';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { TodoStore } from '../create-todo-store.js';
2
- /**
3
- * Ensures each todo has an monotonically increasing integer order value.
4
- * You might call this after inserting a todo with a floating point order value for insertion.
5
- */
6
- export declare const reorderTodos: (t: TodoStore) => void;
@@ -1,11 +0,0 @@
1
- /**
2
- * Ensures each todo has an monotonically increasing integer order value.
3
- * You might call this after inserting a todo with a floating point order value for insertion.
4
- */
5
- export const reorderTodos = (t) => {
6
- const todos = t.select(t.archetypes.Todo.components, { order: { order: true } });
7
- for (let i = 0; i < todos.length; i++) {
8
- t.update(todos[i], { order: i });
9
- }
10
- };
11
- //# sourceMappingURL=reorder-todos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reorder-todos.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/reorder-todos.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAY,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACjF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;AACH,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type Entity } from '../../../../../ecs/index.js';
2
- import { type TodoStore } from '../create-todo-store.js';
3
- export declare const toggleComplete: (t: TodoStore, id: Entity) => void;
@@ -1,11 +0,0 @@
1
- export const toggleComplete = (t, id) => {
2
- t.undoable = { coalesce: false };
3
- const todo = t.read(id);
4
- // actions must never throw errors.
5
- // if state is invalid they must no op.
6
- // this is important for resolving concurrency conflicts.
7
- if (todo) {
8
- t.update(id, { complete: !todo.complete });
9
- }
10
- };
11
- //# sourceMappingURL=toggle-complete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle-complete.js","sourceRoot":"","sources":["../../../../../../src/samples/todo/services/state-service/transactions/toggle-complete.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAY,EAAE,EAAU,EAAE,EAAE;IACzD,CAAC,CAAC,QAAQ,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,mCAAmC;IACnC,uCAAuC;IACvC,yDAAyD;IACzD,IAAI,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC"}
@@ -1,65 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { createTodo } from './create-todo.js';
3
- import { toggleComplete } from './toggle-complete.js';
4
- import { describe, expect, it } from 'vitest';
5
- import { createTodoStore } from '../create-todo-store.js';
6
- describe('toggleComplete', () => {
7
- describe('when toggling a complete todo', () => {
8
- it('should mark it as incomplete', () => {
9
- const t = createTodoStore();
10
- const todoId = createTodo(t, { name: 'Test todo' });
11
- // First mark as complete
12
- t.update(todoId, { complete: true });
13
- expect(t.read(todoId)?.complete).toBe(true);
14
- // Then toggle it
15
- toggleComplete(t, todoId);
16
- expect(t.read(todoId)?.complete).toBe(false);
17
- });
18
- });
19
- describe('when toggling an incomplete todo', () => {
20
- it('should mark it as complete', () => {
21
- const t = createTodoStore();
22
- const todoId = createTodo(t, { name: 'Test todo' });
23
- expect(t.read(todoId)?.complete).toBe(false);
24
- toggleComplete(t, todoId);
25
- expect(t.read(todoId)?.complete).toBe(true);
26
- });
27
- });
28
- describe('when toggling multiple times', () => {
29
- it('should alternate between complete and incomplete', () => {
30
- const t = createTodoStore();
31
- const todoId = createTodo(t, { name: 'Test todo' });
32
- expect(t.read(todoId)?.complete).toBe(false);
33
- // First toggle
34
- toggleComplete(t, todoId);
35
- expect(t.read(todoId)?.complete).toBe(true);
36
- // Second toggle
37
- toggleComplete(t, todoId);
38
- expect(t.read(todoId)?.complete).toBe(false);
39
- // Third toggle
40
- toggleComplete(t, todoId);
41
- expect(t.read(todoId)?.complete).toBe(true);
42
- });
43
- });
44
- describe('when toggling a non-existent todo', () => {
45
- it('should not throw an error and should no-op', () => {
46
- const t = createTodoStore();
47
- const nonExistentId = 999;
48
- expect(t.read(nonExistentId)).toBeNull();
49
- // Should not throw
50
- expect(() => toggleComplete(t, nonExistentId)).not.toThrow();
51
- // Should still be null
52
- expect(t.read(nonExistentId)).toBeNull();
53
- });
54
- });
55
- describe('when toggling with invalid entity id', () => {
56
- it('should not throw an error and should no-op', () => {
57
- const t = createTodoStore();
58
- const invalidId = -1;
59
- // Should not throw
60
- toggleComplete(t, invalidId);
61
- expect(() => toggleComplete(t, invalidId)).not.toThrow();
62
- });
63
- });
64
- });
65
- //# sourceMappingURL=toggle-complete.test.js.map