@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.
- package/data.d.ts +1 -1
- package/ecs/database/combine-plugins.d.ts +14 -7
- package/ecs/database/combine-plugins.js +6 -3
- package/ecs/database/combine-plugins.js.map +1 -1
- package/ecs/database/create-plugin.d.ts +37 -17
- package/ecs/database/create-plugin.js +3 -30
- package/ecs/database/create-plugin.js.map +1 -1
- package/ecs/database/create-plugin.test.js +55 -0
- package/ecs/database/create-plugin.test.js.map +1 -1
- package/ecs/database/create-plugin.type-test.js +157 -0
- package/ecs/database/create-plugin.type-test.js.map +1 -1
- package/ecs/database/database-schema/create-database-schema.js +3 -3
- package/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/ecs/database/database.d.ts +43 -5
- package/ecs/database/database.js.map +1 -1
- package/ecs/database/observe-dependent-value.test.js +39 -31
- package/ecs/database/observe-dependent-value.test.js.map +1 -1
- package/ecs/database/observe-select-entities.performance.test.js +30 -31
- package/ecs/database/observe-select-entities.performance.test.js.map +1 -1
- package/ecs/database/observe-select-entities.test.js +30 -31
- package/ecs/database/observe-select-entities.test.js.map +1 -1
- package/ecs/database/observed/create-observed-database.js +7 -0
- package/ecs/database/observed/create-observed-database.js.map +1 -1
- package/ecs/database/public/create-database.d.ts +5 -34
- package/ecs/database/public/create-database.js +68 -131
- package/ecs/database/public/create-database.js.map +1 -1
- package/ecs/database/public/create-database.test.js +324 -62
- package/ecs/database/public/create-database.test.js.map +1 -1
- package/ecs/database/transactional-store/create-transactional-store.js +16 -1
- package/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/ecs/plugins/scheduler/scheduler.d.ts +2 -2
- package/ecs/plugins/scheduler/scheduler.js +2 -2
- package/ecs/plugins/scheduler/scheduler.js.map +1 -1
- package/ecs/undo-redo-service/create-undo-redo-service.test.js +22 -23
- package/ecs/undo-redo-service/create-undo-redo-service.test.js.map +1 -1
- package/package.json +6 -24
- package/service/async-data-service/create-lazy.d.ts +40 -0
- package/service/async-data-service/create-lazy.js +194 -0
- package/service/async-data-service/create-lazy.js.map +1 -0
- package/service/async-data-service/create-lazy.test.js +477 -0
- package/service/async-data-service/create-lazy.test.js.map +1 -0
- package/service/async-data-service/example.d.ts +60 -0
- package/service/async-data-service/example.js +35 -0
- package/service/async-data-service/example.js.map +1 -0
- package/service/async-data-service/index.d.ts +1 -0
- package/service/async-data-service/index.js +3 -0
- package/service/async-data-service/index.js.map +1 -0
- package/service/{is-data-service.d.ts → async-data-service/is-valid.d.ts} +4 -4
- package/{lit/hooks/component/component.js → service/async-data-service/is-valid.js} +1 -1
- package/service/async-data-service/is-valid.js.map +1 -0
- package/service/async-data-service/public.d.ts +2 -0
- package/service/async-data-service/public.js +4 -0
- package/service/async-data-service/public.js.map +1 -0
- package/service/index.d.ts +1 -1
- package/service/index.js +1 -0
- package/service/index.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ecs/database/combine-plugins-test.d.ts +0 -39
- package/ecs/database/combine-plugins-test.js +0 -3
- package/ecs/database/combine-plugins-test.js.map +0 -1
- package/ecs/database/create-plugin-cryos-pattern.test.d.ts +0 -3
- package/ecs/database/create-plugin-cryos-pattern.test.js +0 -83
- package/ecs/database/create-plugin-cryos-pattern.test.js.map +0 -1
- package/ecs/database/create-plugin-graphics.test.d.ts +0 -93
- package/ecs/database/create-plugin-graphics.test.js +0 -135
- package/ecs/database/create-plugin-graphics.test.js.map +0 -1
- package/ecs/database/create-plugin-type.type-test.js +0 -563
- package/ecs/database/create-plugin-type.type-test.js.map +0 -1
- package/ecs/database/create-plugin-type.type.test.d.ts +0 -1
- package/ecs/database/create-plugin-type.type.test.js +0 -563
- package/ecs/database/create-plugin-type.type.test.js.map +0 -1
- package/ecs/database/experimental-action-types.d.ts +0 -1
- package/ecs/database/experimental-action-types.js +0 -275
- package/ecs/database/experimental-action-types.js.map +0 -1
- package/ecs/database/from-plugin.type-test.d.ts +0 -1
- package/ecs/database/from-plugin.type-test.js +0 -180
- package/ecs/database/from-plugin.type-test.js.map +0 -1
- package/ecs/database/plugin-types.d.ts +0 -1
- package/ecs/database/plugin-types.js +0 -5
- package/ecs/database/plugin-types.js.map +0 -1
- package/ecs/database/type-investigation.test.d.ts +0 -1
- package/ecs/database/type-investigation.test.js +0 -54
- package/ecs/database/type-investigation.test.js.map +0 -1
- package/lit/decorators/apply-decorator.d.ts +0 -1
- package/lit/decorators/apply-decorator.js +0 -19
- package/lit/decorators/apply-decorator.js.map +0 -1
- package/lit/decorators/apply-service-decorators.d.ts +0 -1
- package/lit/decorators/apply-service-decorators.js +0 -13
- package/lit/decorators/apply-service-decorators.js.map +0 -1
- package/lit/decorators/index.d.ts +0 -3
- package/lit/decorators/index.js +0 -5
- package/lit/decorators/index.js.map +0 -1
- package/lit/decorators/require-service.d.ts +0 -1
- package/lit/decorators/require-service.js +0 -14
- package/lit/decorators/require-service.js.map +0 -1
- package/lit/elements/application-element.d.ts +0 -9
- package/lit/elements/application-element.js +0 -42
- package/lit/elements/application-element.js.map +0 -1
- package/lit/elements/application-host.d.ts +0 -16
- package/lit/elements/application-host.js +0 -39
- package/lit/elements/application-host.js.map +0 -1
- package/lit/elements/database-element.d.ts +0 -10
- package/lit/elements/database-element.js +0 -40
- package/lit/elements/database-element.js.map +0 -1
- package/lit/elements/index.d.ts +0 -3
- package/lit/elements/index.js +0 -5
- package/lit/elements/index.js.map +0 -1
- package/lit/functions/index.d.ts +0 -1
- package/lit/functions/index.js +0 -3
- package/lit/functions/index.js.map +0 -1
- package/lit/functions/iterate-self-and-ancestors.d.ts +0 -1
- package/lit/functions/iterate-self-and-ancestors.js +0 -24
- package/lit/functions/iterate-self-and-ancestors.js.map +0 -1
- package/lit/hooks/attach-decorator.d.ts +0 -4
- package/lit/hooks/attach-decorator.js +0 -26
- package/lit/hooks/attach-decorator.js.map +0 -1
- package/lit/hooks/component/component.d.ts +0 -10
- package/lit/hooks/component/component.js.map +0 -1
- package/lit/hooks/component/stack.d.ts +0 -6
- package/lit/hooks/component/stack.js +0 -16
- package/lit/hooks/component/stack.js.map +0 -1
- package/lit/hooks/index.d.ts +0 -19
- package/lit/hooks/index.js +0 -21
- package/lit/hooks/index.js.map +0 -1
- package/lit/hooks/use-connected.d.ts +0 -2
- package/lit/hooks/use-connected.js +0 -32
- package/lit/hooks/use-connected.js.map +0 -1
- package/lit/hooks/use-debounce.d.ts +0 -8
- package/lit/hooks/use-debounce.js +0 -21
- package/lit/hooks/use-debounce.js.map +0 -1
- package/lit/hooks/use-drag-observe.d.ts +0 -25
- package/lit/hooks/use-drag-observe.js +0 -35
- package/lit/hooks/use-drag-observe.js.map +0 -1
- package/lit/hooks/use-drag-transaction.d.ts +0 -7
- package/lit/hooks/use-drag-transaction.js +0 -35
- package/lit/hooks/use-drag-transaction.js.map +0 -1
- package/lit/hooks/use-draggable.d.ts +0 -15
- package/lit/hooks/use-draggable.js +0 -96
- package/lit/hooks/use-draggable.js.map +0 -1
- package/lit/hooks/use-effect.d.ts +0 -3
- package/lit/hooks/use-effect.js +0 -14
- package/lit/hooks/use-effect.js.map +0 -1
- package/lit/hooks/use-element.d.ts +0 -7
- package/lit/hooks/use-element.js +0 -67
- package/lit/hooks/use-element.js.map +0 -1
- package/lit/hooks/use-memo.d.ts +0 -1
- package/lit/hooks/use-memo.js +0 -13
- package/lit/hooks/use-memo.js.map +0 -1
- package/lit/hooks/use-observable-values.d.ts +0 -4
- package/lit/hooks/use-observable-values.js +0 -9
- package/lit/hooks/use-observable-values.js.map +0 -1
- package/lit/hooks/use-observable.d.ts +0 -2
- package/lit/hooks/use-observable.js +0 -13
- package/lit/hooks/use-observable.js.map +0 -1
- package/lit/hooks/use-ref.d.ts +0 -3
- package/lit/hooks/use-ref.js +0 -7
- package/lit/hooks/use-ref.js.map +0 -1
- package/lit/hooks/use-resize-observer.d.ts +0 -12
- package/lit/hooks/use-resize-observer.js +0 -23
- package/lit/hooks/use-resize-observer.js.map +0 -1
- package/lit/hooks/use-state.d.ts +0 -2
- package/lit/hooks/use-state.js +0 -15
- package/lit/hooks/use-state.js.map +0 -1
- package/lit/hooks/use-updated.d.ts +0 -4
- package/lit/hooks/use-updated.js +0 -40
- package/lit/hooks/use-updated.js.map +0 -1
- package/lit/hooks/use-window-event.d.ts +0 -1
- package/lit/hooks/use-window-event.js +0 -11
- package/lit/hooks/use-window-event.js.map +0 -1
- package/lit/hooks/with-hooks.d.ts +0 -2
- package/lit/hooks/with-hooks.js +0 -16
- package/lit/hooks/with-hooks.js.map +0 -1
- package/lit/index.d.ts +0 -4
- package/lit/index.js +0 -5
- package/lit/index.js.map +0 -1
- package/normalize.test.d.ts +0 -1
- package/normalize.test.js +0 -28
- package/normalize.test.js.map +0 -1
- package/samples/index.d.ts +0 -13
- package/samples/index.js +0 -7
- package/samples/index.js.map +0 -1
- package/samples/todo/elements/todo-list/todo-list-presentation.d.ts +0 -8
- package/samples/todo/elements/todo-list/todo-list-presentation.js +0 -12
- package/samples/todo/elements/todo-list/todo-list-presentation.js.map +0 -1
- package/samples/todo/elements/todo-list/todo-list.css.d.ts +0 -1
- package/samples/todo/elements/todo-list/todo-list.css.js +0 -11
- package/samples/todo/elements/todo-list/todo-list.css.js.map +0 -1
- package/samples/todo/elements/todo-list/todo-list.d.ts +0 -12
- package/samples/todo/elements/todo-list/todo-list.js +0 -44
- package/samples/todo/elements/todo-list/todo-list.js.map +0 -1
- package/samples/todo/elements/todo-row/index.d.ts +0 -1
- package/samples/todo/elements/todo-row/index.js +0 -3
- package/samples/todo/elements/todo-row/index.js.map +0 -1
- package/samples/todo/elements/todo-row/todo-row-presentation.d.ts +0 -18
- package/samples/todo/elements/todo-row/todo-row-presentation.js +0 -50
- package/samples/todo/elements/todo-row/todo-row-presentation.js.map +0 -1
- package/samples/todo/elements/todo-row/todo-row.css.d.ts +0 -1
- package/samples/todo/elements/todo-row/todo-row.css.js +0 -49
- package/samples/todo/elements/todo-row/todo-row.css.js.map +0 -1
- package/samples/todo/elements/todo-row/todo-row.d.ts +0 -14
- package/samples/todo/elements/todo-row/todo-row.js +0 -44
- package/samples/todo/elements/todo-row/todo-row.js.map +0 -1
- package/samples/todo/elements/todo-toolbar/index.d.ts +0 -1
- package/samples/todo/elements/todo-toolbar/index.js +0 -3
- package/samples/todo/elements/todo-toolbar/index.js.map +0 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.d.ts +0 -22
- package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +0 -41
- package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +0 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar.css.d.ts +0 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +0 -34
- package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +0 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar.d.ts +0 -11
- package/samples/todo/elements/todo-toolbar/todo-toolbar.js +0 -61
- package/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +0 -1
- package/samples/todo/elements/todo-undo-redo/index.d.ts +0 -1
- package/samples/todo/elements/todo-undo-redo/index.js +0 -3
- package/samples/todo/elements/todo-undo-redo/index.js.map +0 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.d.ts +0 -17
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +0 -29
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +0 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.d.ts +0 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +0 -12
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +0 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.d.ts +0 -11
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +0 -36
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +0 -1
- package/samples/todo/services/dependent-state-service/create-dependent-state-service.d.ts +0 -6
- package/samples/todo/services/dependent-state-service/create-dependent-state-service.js +0 -5
- package/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +0 -1
- package/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/all-todos.js +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +0 -1
- package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +0 -1
- package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +0 -1
- package/samples/todo/services/dependent-state-service/dependent-state/index.d.ts +0 -3
- package/samples/todo/services/dependent-state-service/dependent-state/index.js +0 -5
- package/samples/todo/services/dependent-state-service/dependent-state/index.js.map +0 -1
- package/samples/todo/services/dependent-state-service/dependent-state-service.d.ts +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state-service.js +0 -2
- package/samples/todo/services/dependent-state-service/dependent-state-service.js.map +0 -1
- package/samples/todo/services/main-service/create-main-service.d.ts +0 -8
- package/samples/todo/services/main-service/create-main-service.js +0 -39
- package/samples/todo/services/main-service/create-main-service.js.map +0 -1
- package/samples/todo/services/main-service/todo-main-service.d.ts +0 -18
- package/samples/todo/services/main-service/todo-main-service.js +0 -2
- package/samples/todo/services/main-service/todo-main-service.js.map +0 -1
- package/samples/todo/services/state-service/create-todo-database.d.ts +0 -37
- package/samples/todo/services/state-service/create-todo-database.js +0 -10
- package/samples/todo/services/state-service/create-todo-database.js.map +0 -1
- package/samples/todo/services/state-service/create-todo-store.d.ts +0 -37
- package/samples/todo/services/state-service/create-todo-store.js +0 -24
- package/samples/todo/services/state-service/create-todo-store.js.map +0 -1
- package/samples/todo/services/state-service/todo-state-service.d.ts +0 -5
- package/samples/todo/services/state-service/todo-state-service.js +0 -2
- package/samples/todo/services/state-service/todo-state-service.js.map +0 -1
- package/samples/todo/services/state-service/transactions/create-bulk-todos.d.ts +0 -2
- package/samples/todo/services/state-service/transactions/create-bulk-todos.js +0 -10
- package/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +0 -1
- package/samples/todo/services/state-service/transactions/create-todo.d.ts +0 -5
- package/samples/todo/services/state-service/transactions/create-todo.js +0 -13
- package/samples/todo/services/state-service/transactions/create-todo.js.map +0 -1
- package/samples/todo/services/state-service/transactions/create-todo.test.d.ts +0 -1
- package/samples/todo/services/state-service/transactions/create-todo.test.js +0 -16
- package/samples/todo/services/state-service/transactions/create-todo.test.js.map +0 -1
- package/samples/todo/services/state-service/transactions/delete-all-todos.d.ts +0 -2
- package/samples/todo/services/state-service/transactions/delete-all-todos.js +0 -16
- package/samples/todo/services/state-service/transactions/delete-all-todos.js.map +0 -1
- package/samples/todo/services/state-service/transactions/delete-todo.d.ts +0 -3
- package/samples/todo/services/state-service/transactions/delete-todo.js +0 -8
- package/samples/todo/services/state-service/transactions/delete-todo.js.map +0 -1
- package/samples/todo/services/state-service/transactions/delete-todo.test.d.ts +0 -1
- package/samples/todo/services/state-service/transactions/delete-todo.test.js +0 -24
- package/samples/todo/services/state-service/transactions/delete-todo.test.js.map +0 -1
- package/samples/todo/services/state-service/transactions/drag-todo.d.ts +0 -7
- package/samples/todo/services/state-service/transactions/drag-todo.js +0 -17
- package/samples/todo/services/state-service/transactions/drag-todo.js.map +0 -1
- package/samples/todo/services/state-service/transactions/index.d.ts +0 -6
- package/samples/todo/services/state-service/transactions/index.js +0 -9
- package/samples/todo/services/state-service/transactions/index.js.map +0 -1
- package/samples/todo/services/state-service/transactions/reorder-todos.d.ts +0 -6
- package/samples/todo/services/state-service/transactions/reorder-todos.js +0 -11
- package/samples/todo/services/state-service/transactions/reorder-todos.js.map +0 -1
- package/samples/todo/services/state-service/transactions/toggle-complete.d.ts +0 -3
- package/samples/todo/services/state-service/transactions/toggle-complete.js +0 -11
- package/samples/todo/services/state-service/transactions/toggle-complete.js.map +0 -1
- package/samples/todo/services/state-service/transactions/toggle-complete.test.d.ts +0 -1
- package/samples/todo/services/state-service/transactions/toggle-complete.test.js +0 -65
- package/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +0 -1
- package/samples/todo/todo-element.d.ts +0 -4
- package/samples/todo/todo-element.js +0 -4
- package/samples/todo/todo-element.js.map +0 -1
- package/samples/todo/todo-host.d.ts +0 -8
- package/samples/todo/todo-host.js +0 -35
- package/samples/todo/todo-host.js.map +0 -1
- package/samples/todo/todo-main-element.d.ts +0 -10
- package/samples/todo/todo-main-element.js +0 -47
- package/samples/todo/todo-main-element.js.map +0 -1
- package/samples/todo/todo-sample.d.ts +0 -3
- package/samples/todo/todo-sample.js +0 -19
- package/samples/todo/todo-sample.js.map +0 -1
- package/service/is-data-service.js +0 -2
- package/service/is-data-service.js.map +0 -1
- package/typed-buffer/public.d.ts +0 -2
- package/typed-buffer/public.js +0 -4
- package/typed-buffer/public.js.map +0 -1
- /package/{ecs/database/create-plugin-type.type-test.d.ts → service/async-data-service/create-lazy.test.d.ts} +0 -0
|
@@ -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 +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"}
|
package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map
DELETED
|
@@ -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 +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 +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 +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 +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,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,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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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,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,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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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,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,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,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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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
|