@adobe/data 0.5.2 → 0.5.4
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/dist/blob/blob-handle.d.ts +29 -0
- package/dist/blob/blob-handle.js +11 -0
- package/dist/blob/blob-handle.js.map +1 -0
- package/dist/blob/blob-meta.d.ts +23 -0
- package/dist/blob/blob-meta.js +12 -0
- package/dist/blob/blob-meta.js.map +1 -0
- package/dist/blob/download-handle.d.ts +4 -0
- package/dist/blob/download-handle.js +2 -0
- package/dist/blob/download-handle.js.map +1 -0
- package/dist/blob/index.d.ts +4 -0
- package/dist/blob/index.js +5 -0
- package/dist/blob/index.js.map +1 -0
- package/dist/blob/upload-handle.d.ts +4 -0
- package/dist/blob/upload-handle.js +2 -0
- package/dist/blob/upload-handle.js.map +1 -0
- package/dist/lit/elements/application-element.d.ts +9 -0
- package/dist/lit/elements/application-element.js +62 -0
- package/dist/lit/elements/application-element.js.map +1 -0
- package/dist/lit/elements/service-application.js +4 -1
- package/dist/lit/elements/service-application.js.map +1 -1
- package/dist/lit/functions/index.d.ts +1 -0
- package/dist/{ecs/action-ecs → lit/functions}/index.js +1 -1
- package/dist/lit/functions/index.js.map +1 -0
- package/dist/lit/functions/iterate-self-and-ancestors.d.ts +1 -0
- package/dist/{core/functions/array-equals.js → lit/functions/iterate-self-and-ancestors.js} +20 -10
- package/dist/lit/functions/iterate-self-and-ancestors.js.map +1 -0
- package/dist/lit/hooks/attach-decorator.d.ts +4 -0
- package/dist/{service/sequential-action.js → lit/hooks/attach-decorator.js} +20 -19
- package/dist/lit/hooks/attach-decorator.js.map +1 -0
- package/dist/lit/hooks/index.d.ts +1 -0
- package/dist/lit/hooks/index.js +1 -0
- package/dist/lit/hooks/index.js.map +1 -1
- package/dist/lit/hooks/use-drag-observe.d.ts +22 -0
- package/dist/{ecs/entity-location-table/register-entity-location-table-codec.js → lit/hooks/use-drag-observe.js} +30 -17
- package/dist/lit/hooks/use-drag-observe.js.map +1 -0
- package/dist/lit/hooks/use-drag-transaction.d.ts +8 -0
- package/dist/lit/hooks/use-drag-transaction.js +56 -0
- package/dist/lit/hooks/use-drag-transaction.js.map +1 -0
- package/dist/lit/hooks/use-draggable.d.ts +16 -0
- package/dist/lit/hooks/use-draggable.js +122 -0
- package/dist/lit/hooks/use-draggable.js.map +1 -0
- package/dist/schema/schema.d.ts +8 -12
- package/dist/schema/schema.js.map +1 -1
- package/dist/service/disposable.d.ts +4 -0
- package/dist/{core/functions/is-async-generator.js → service/disposable.js} +3 -3
- package/dist/service/disposable.js.map +1 -0
- package/dist/service/is-service.js +1 -2
- package/dist/service/is-service.js.map +1 -1
- package/dist/service/progressive-result.d.ts +7 -11
- package/dist/service/progressive-result.js +0 -6
- package/dist/service/progressive-result.js.map +1 -1
- package/dist/service/service.d.ts +11 -1
- package/dist/service/to-frontend-service.d.ts +12 -0
- package/dist/service/to-frontend-service.js +5 -0
- package/dist/service/to-frontend-service.js.map +1 -0
- package/dist/services/add-observable-actions.d.ts +29 -0
- package/dist/services/add-observable-actions.js +108 -0
- package/dist/services/add-observable-actions.js.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/{core → services}/index.js +3 -3
- package/dist/services/index.js.map +1 -0
- package/dist/services/is-service.d.ts +2 -0
- package/dist/{cache/functions/omit.js → services/is-service.js} +3 -7
- package/dist/services/is-service.js.map +1 -0
- package/dist/services/progressive-result.d.ts +96 -0
- package/dist/services/progressive-result.js +99 -0
- package/dist/services/progressive-result.js.map +1 -0
- package/dist/services/service.d.ts +4 -0
- package/dist/{cache/functions/types.js → services/service.js} +1 -1
- package/dist/services/service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/replace.d.ts +7 -0
- package/dist/types/replace.js +5 -0
- package/dist/types/replace.js.map +1 -0
- package/package.json +8 -1
- package/dist/README.md +0 -310
- package/dist/cache/functions/bind-functions.d.ts +0 -6
- package/dist/cache/functions/bind-functions.js +0 -33
- package/dist/cache/functions/bind-functions.js.map +0 -1
- package/dist/cache/functions/hashing/arrayBufferToHex.d.ts +0 -1
- package/dist/cache/functions/hashing/arrayBufferToHex.js +0 -27
- package/dist/cache/functions/hashing/arrayBufferToHex.js.map +0 -1
- package/dist/cache/functions/omit.d.ts +0 -1
- package/dist/cache/functions/omit.js.map +0 -1
- package/dist/cache/functions/types.d.ts +0 -1
- package/dist/cache/functions/types.js.map +0 -1
- package/dist/core/data.d.ts +0 -22
- package/dist/core/data.js +0 -52
- package/dist/core/data.js.map +0 -1
- package/dist/core/data.test.d.ts +0 -1
- package/dist/core/data.test.js +0 -48
- package/dist/core/data.test.js.map +0 -1
- package/dist/core/functions/array-equals.d.ts +0 -1
- package/dist/core/functions/array-equals.js.map +0 -1
- package/dist/core/functions/deep-merge.d.ts +0 -32
- package/dist/core/functions/deep-merge.js +0 -54
- package/dist/core/functions/deep-merge.js.map +0 -1
- package/dist/core/functions/deep-merge.test.d.ts +0 -1
- package/dist/core/functions/deep-merge.test.js +0 -94
- package/dist/core/functions/deep-merge.test.js.map +0 -1
- package/dist/core/functions/index.d.ts +0 -3
- package/dist/core/functions/index.js +0 -25
- package/dist/core/functions/index.js.map +0 -1
- package/dist/core/functions/is-async-generator.d.ts +0 -1
- package/dist/core/functions/is-async-generator.js.map +0 -1
- package/dist/core/functions/is-promise.d.ts +0 -1
- package/dist/core/functions/is-promise.js +0 -26
- package/dist/core/functions/is-promise.js.map +0 -1
- package/dist/core/functions/with-validation.d.ts +0 -5
- package/dist/core/functions/with-validation.js +0 -38
- package/dist/core/functions/with-validation.js.map +0 -1
- package/dist/core/functions/with-validation.test.d.ts +0 -1
- package/dist/core/functions/with-validation.test.js +0 -96
- package/dist/core/functions/with-validation.test.js.map +0 -1
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
- package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
- package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
- package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
- package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
- package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
- package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.test.d.ts +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
- package/dist/core/schema/dynamic/index.d.ts +0 -1
- package/dist/core/schema/dynamic/index.js +0 -2
- package/dist/core/schema/dynamic/index.js.map +0 -1
- package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
- package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
- package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
- package/dist/core/schema/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic-schema.js.map +0 -1
- package/dist/core/schema/index.d.ts +0 -4
- package/dist/core/schema/index.js +0 -26
- package/dist/core/schema/index.js.map +0 -1
- package/dist/core/schema/schema.d.ts +0 -122
- package/dist/core/schema/schema.js +0 -34
- package/dist/core/schema/schema.js.map +0 -1
- package/dist/core/schema/schemas.d.ts +0 -45
- package/dist/core/schema/schemas.js +0 -39
- package/dist/core/schema/schemas.js.map +0 -1
- package/dist/core/schema/ui-schema.d.ts +0 -25
- package/dist/core/schema/ui-schema.js +0 -2
- package/dist/core/schema/ui-schema.js.map +0 -1
- package/dist/core/schema/validation/is-valid.d.ts +0 -2
- package/dist/core/schema/validation/is-valid.js +0 -14
- package/dist/core/schema/validation/is-valid.js.map +0 -1
- package/dist/core/schema/validation/is-valid.test.d.ts +0 -1
- package/dist/core/schema/validation/is-valid.test.js +0 -40
- package/dist/core/schema/validation/is-valid.test.js.map +0 -1
- package/dist/core/schema/validation/validate.d.ts +0 -2
- package/dist/core/schema/validation/validate.js +0 -38
- package/dist/core/schema/validation/validate.js.map +0 -1
- package/dist/core/schema/validation/validate.test.d.ts +0 -1
- package/dist/core/schema/validation/validate.test.js +0 -106
- package/dist/core/schema/validation/validate.test.js.map +0 -1
- package/dist/core/schema/validation/with-validation.d.ts +0 -5
- package/dist/core/schema/validation/with-validation.js +0 -16
- package/dist/core/schema/validation/with-validation.js.map +0 -1
- package/dist/core/schema/validation/with-validation.test.d.ts +0 -1
- package/dist/core/schema/validation/with-validation.test.js +0 -96
- package/dist/core/schema/validation/with-validation.test.js.map +0 -1
- package/dist/core/schema.d.ts +0 -86
- package/dist/core/schema.js +0 -33
- package/dist/core/schema.js.map +0 -1
- package/dist/core/schema.test.d.ts +0 -1
- package/dist/core/schema.test.js +0 -16
- package/dist/core/schema.test.js.map +0 -1
- package/dist/core/schemas.d.ts +0 -45
- package/dist/core/schemas.js +0 -39
- package/dist/core/schemas.js.map +0 -1
- package/dist/ecs/action-ecs/action-ecs.d.ts +0 -19
- package/dist/ecs/action-ecs/action-ecs.js +0 -203
- package/dist/ecs/action-ecs/action-ecs.js.map +0 -1
- package/dist/ecs/action-ecs/action-ecs.test.d.ts +0 -1
- package/dist/ecs/action-ecs/action-ecs.test.js +0 -362
- package/dist/ecs/action-ecs/action-ecs.test.js.map +0 -1
- package/dist/ecs/action-ecs/action-types.d.ts +0 -106
- package/dist/ecs/action-ecs/action-types.js +0 -19
- package/dist/ecs/action-ecs/action-types.js.map +0 -1
- package/dist/ecs/action-ecs/index.d.ts +0 -2
- package/dist/ecs/action-ecs/index.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js +0 -230
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs-types.d.ts +0 -141
- package/dist/ecs/core-ecs/core-ecs-types.js +0 -23
- package/dist/ecs/core-ecs/core-ecs-types.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs.d.ts +0 -7
- package/dist/ecs/core-ecs/core-ecs.js +0 -492
- package/dist/ecs/core-ecs/core-ecs.js.map +0 -1
- package/dist/ecs/core-ecs/core-ecs.test.d.ts +0 -1
- package/dist/ecs/core-ecs/core-ecs.test.js +0 -425
- package/dist/ecs/core-ecs/core-ecs.test.js.map +0 -1
- package/dist/ecs/core-ecs/index.d.ts +0 -1
- package/dist/ecs/core-ecs/index.js +0 -2
- package/dist/ecs/core-ecs/index.js.map +0 -1
- package/dist/ecs/database/database-schema/create-database-schema-test.d.ts +0 -1
- package/dist/ecs/database/database-schema/create-database-schema-test.js +0 -42
- package/dist/ecs/database/database-schema/create-database-schema-test.js.map +0 -1
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +0 -12
- package/dist/ecs/database/database-schema/create-database-schema.js +0 -26
- package/dist/ecs/database/database-schema/create-database-schema.js.map +0 -1
- package/dist/ecs/database/database-schema/database-schema.d.ts +0 -15
- package/dist/ecs/database/database-schema/database-schema.js +0 -23
- package/dist/ecs/database/database-schema/database-schema.js.map +0 -1
- package/dist/ecs/database/database-schema/index.d.ts +0 -2
- package/dist/ecs/database/database-schema/index.js +0 -24
- package/dist/ecs/database/database-schema/index.js.map +0 -1
- package/dist/ecs/database/register-database-codec.d.ts +0 -1
- package/dist/ecs/database/register-database-codec.js +0 -35
- package/dist/ecs/database/register-database-codec.js.map +0 -1
- package/dist/ecs/database/register-database-codecs.d.ts +0 -1
- package/dist/ecs/database/register-database-codecs.js +0 -35
- package/dist/ecs/database/register-database-codecs.js.map +0 -1
- package/dist/ecs/database/register-store-codec.d.ts +0 -1
- package/dist/ecs/database/register-store-codec.js +0 -35
- package/dist/ecs/database/register-store-codec.js.map +0 -1
- package/dist/ecs/database/register-typed-buffer-codecs.d.ts +0 -1
- package/dist/ecs/database/register-typed-buffer-codecs.js +0 -80
- package/dist/ecs/database/register-typed-buffer-codecs.js.map +0 -1
- package/dist/ecs/database/transactional-store/apply-write-operations.d.ts +0 -7
- package/dist/ecs/database/transactional-store/apply-write-operations.js +0 -20
- package/dist/ecs/database/transactional-store/apply-write-operations.js.map +0 -1
- package/dist/ecs/database/transactional-store/applyWriteOperations.d.ts +0 -7
- package/dist/ecs/database/transactional-store/applyWriteOperations.js +0 -20
- package/dist/ecs/database/transactional-store/applyWriteOperations.js.map +0 -1
- package/dist/ecs/database/transactional-store/create-test-transaction.d.ts +0 -7
- package/dist/ecs/database/transactional-store/create-test-transaction.js +0 -7
- package/dist/ecs/database/transactional-store/create-test-transaction.js.map +0 -1
- package/dist/ecs/database/transactional-store/patch.d.ts +0 -3
- package/dist/ecs/database/transactional-store/patch.js +0 -7
- package/dist/ecs/database/transactional-store/patch.js.map +0 -1
- package/dist/ecs/database/transactional-store/undoable.d.ts +0 -13
- package/dist/ecs/database/transactional-store/undoable.js +0 -23
- package/dist/ecs/database/transactional-store/undoable.js.map +0 -1
- package/dist/ecs/database/transactional-store/with-undoable.d.ts +0 -10
- package/dist/ecs/database/transactional-store/with-undoable.js +0 -13
- package/dist/ecs/database/transactional-store/with-undoable.js.map +0 -1
- package/dist/ecs/database/with-undoable.d.ts +0 -10
- package/dist/ecs/database/with-undoable.js +0 -13
- package/dist/ecs/database/with-undoable.js.map +0 -1
- package/dist/ecs/ecs/ecs-types.d.ts +0 -132
- package/dist/ecs/ecs/ecs-types.js +0 -23
- package/dist/ecs/ecs/ecs-types.js.map +0 -1
- package/dist/ecs/ecs/ecs-where-functions.d.ts +0 -6
- package/dist/ecs/ecs/ecs-where-functions.js +0 -91
- package/dist/ecs/ecs/ecs-where-functions.js.map +0 -1
- package/dist/ecs/ecs/ecs.d.ts +0 -13
- package/dist/ecs/ecs/ecs.js +0 -177
- package/dist/ecs/ecs/ecs.js.map +0 -1
- package/dist/ecs/ecs/ecs.test.d.ts +0 -1
- package/dist/ecs/ecs/ecs.test.js +0 -399
- package/dist/ecs/ecs/ecs.test.js.map +0 -1
- package/dist/ecs/ecs/index.d.ts +0 -3
- package/dist/ecs/ecs/index.js +0 -3
- package/dist/ecs/ecs/index.js.map +0 -1
- package/dist/ecs/entity-location-table/register-database-codec.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-database-codec.js +0 -35
- package/dist/ecs/entity-location-table/register-database-codec.js.map +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.js.map +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.d.ts +0 -1
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js +0 -70
- package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js.map +0 -1
- package/dist/ecs/persistence-service/create-persistence-service.d.ts +0 -6
- package/dist/ecs/persistence-service/create-persistence-service.js +0 -24
- package/dist/ecs/persistence-service/create-persistence-service.js.map +0 -1
- package/dist/ecs/persistence-service/create-session-persistence-service.d.ts +0 -8
- package/dist/ecs/persistence-service/create-session-persistence-service.js +0 -49
- package/dist/ecs/persistence-service/create-session-persistence-service.js.map +0 -1
- package/dist/ecs/persistence-service/persistence-service copy.d.ts +0 -5
- package/dist/ecs/persistence-service/persistence-service copy.js +0 -2
- package/dist/ecs/persistence-service/persistence-service copy.js.map +0 -1
- package/dist/ecs/persistence-service/to-blob-refs.d.ts +0 -2
- package/dist/ecs/persistence-service/to-blob-refs.js +0 -3
- package/dist/ecs/persistence-service/to-blob-refs.js.map +0 -1
- package/dist/ecs/persistence-service/undo-redo-service.d.ts +0 -11
- package/dist/ecs/persistence-service/undo-redo-service.js +0 -23
- package/dist/ecs/persistence-service/undo-redo-service.js.map +0 -1
- package/dist/ecs/store/core/register-core-codec.d.ts +0 -1
- package/dist/ecs/store/core/register-core-codec.js +0 -45
- package/dist/ecs/store/core/register-core-codec.js.map +0 -1
- package/dist/ecs/store/core/register-core-codec.test.d.ts +0 -1
- package/dist/ecs/store/core/register-core-codec.test.js +0 -136
- package/dist/ecs/store/core/register-core-codec.test.js.map +0 -1
- package/dist/ecs/store/query.d.ts +0 -47
- package/dist/ecs/store/query.js +0 -2
- package/dist/ecs/store/query.js.map +0 -1
- package/dist/ecs/store/register-core-codec.d.ts +0 -1
- package/dist/ecs/store/register-core-codec.js +0 -38
- package/dist/ecs/store/register-core-codec.js.map +0 -1
- package/dist/ecs/store/register-store-codec.d.ts +0 -1
- package/dist/ecs/store/register-store-codec.js +0 -38
- package/dist/ecs/store/register-store-codec.js.map +0 -1
- package/dist/ecs/store/restore-store.d.ts +0 -12
- package/dist/ecs/store/restore-store.js +0 -91
- package/dist/ecs/store/restore-store.js.map +0 -1
- package/dist/ecs/store/select-options.d.ts +0 -1
- package/dist/ecs/store/select-options.js +0 -16
- package/dist/ecs/store/select-options.js.map +0 -1
- package/dist/ecs/store/select.d.ts +0 -44
- package/dist/ecs/store/select.js +0 -2
- package/dist/ecs/store/select.js.map +0 -1
- package/dist/ecs/transaction-ecs/index.d.ts +0 -2
- package/dist/ecs/transaction-ecs/index.js +0 -24
- package/dist/ecs/transaction-ecs/index.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
- package/dist/ecs/transaction-ecs/transaction-ecs.js +0 -184
- package/dist/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
- package/dist/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
- package/dist/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
- package/dist/ecs/transaction-ecs/transaction-types.d.ts +0 -135
- package/dist/ecs/transaction-ecs/transaction-types.js +0 -2
- package/dist/ecs/transaction-ecs/transaction-types.js.map +0 -1
- package/dist/ecs/transaction-ecs/transactions.d.ts +0 -5
- package/dist/ecs/transaction-ecs/transactions.js +0 -158
- package/dist/ecs/transaction-ecs/transactions.js.map +0 -1
- package/dist/ecs/undo-redo/create-undo-redo-actions.d.ts +0 -10
- package/dist/ecs/undo-redo/create-undo-redo-actions.js +0 -69
- package/dist/ecs/undo-redo/create-undo-redo-actions.js.map +0 -1
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.d.ts +0 -1
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.js +0 -295
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.js.map +0 -1
- package/dist/ecs/undo-redo/do.d.ts +0 -3
- package/dist/ecs/undo-redo/do.js +0 -3
- package/dist/ecs/undo-redo/do.js.map +0 -1
- package/dist/ecs/undo-redo/index.d.ts +0 -1
- package/dist/ecs/undo-redo/index.js +0 -23
- package/dist/ecs/undo-redo/index.js.map +0 -1
- package/dist/functions/serialization/deserialize.d.ts +0 -1
- package/dist/functions/serialization/deserialize.js +0 -2
- package/dist/functions/serialization/deserialize.js.map +0 -1
- package/dist/functions/serialization/register-typed-array-codecs copy.d.ts +0 -1
- package/dist/functions/serialization/register-typed-array-codecs copy.js +0 -13
- package/dist/functions/serialization/register-typed-array-codecs copy.js.map +0 -1
- package/dist/functions/serialization/serialize-to-blobs copy.d.ts +0 -8
- package/dist/functions/serialization/serialize-to-blobs copy.js +0 -21
- package/dist/functions/serialization/serialize-to-blobs copy.js.map +0 -1
- package/dist/internal/typed-array/typed-array-constructer.d.ts +0 -7
- package/dist/internal/typed-array/typed-array-constructer.js +0 -2
- package/dist/internal/typed-array/typed-array-constructer.js.map +0 -1
- package/dist/internal/typed-array/typed-array.d.ts +0 -1
- package/dist/internal/typed-array/typed-array.js +0 -23
- package/dist/internal/typed-array/typed-array.js.map +0 -1
- package/dist/observe/with-map copy.d.ts +0 -5
- package/dist/observe/with-map copy.js +0 -14
- package/dist/observe/with-map copy.js.map +0 -1
- package/dist/package.json +0 -129
- package/dist/schema/f32 copy.d.ts +0 -6
- package/dist/schema/f32 copy.js +0 -6
- package/dist/schema/f32 copy.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.js +0 -23
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/schemas.d.ts +0 -45
- package/dist/schemas/schemas.js +0 -39
- package/dist/schemas/schemas.js.map +0 -1
- package/dist/service/sequential-action.d.ts +0 -18
- package/dist/service/sequential-action.js.map +0 -1
- package/dist/table/ensure-capacity copy.d.ts +0 -2
- package/dist/table/ensure-capacity copy.js +0 -15
- package/dist/table/ensure-capacity copy.js.map +0 -1
- package/dist/table/filter-rows.d.ts +0 -2
- package/dist/table/filter-rows.js +0 -15
- package/dist/table/filter-rows.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FromSchema } from "../schema/schema.js";
|
|
2
|
+
export declare const BlobHandleSchema: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly handle: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
};
|
|
8
|
+
readonly expires: {
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
};
|
|
11
|
+
readonly type: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
};
|
|
14
|
+
readonly size: {
|
|
15
|
+
readonly type: "number";
|
|
16
|
+
};
|
|
17
|
+
readonly width: {
|
|
18
|
+
readonly type: "number";
|
|
19
|
+
};
|
|
20
|
+
readonly height: {
|
|
21
|
+
readonly type: "number";
|
|
22
|
+
};
|
|
23
|
+
readonly duration: {
|
|
24
|
+
readonly type: "number";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly required: readonly ["type", "size", "handle"];
|
|
28
|
+
};
|
|
29
|
+
export type BlobHandle = FromSchema<typeof BlobHandleSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlobMetaSchema } from "./blob-meta.js";
|
|
2
|
+
export const BlobHandleSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
properties: {
|
|
5
|
+
...BlobMetaSchema.properties,
|
|
6
|
+
handle: { type: 'string' },
|
|
7
|
+
expires: { type: 'string' },
|
|
8
|
+
},
|
|
9
|
+
required: [...BlobMetaSchema.required, 'handle'],
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=blob-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob-handle.js","sourceRoot":"","sources":["../../src/blob/blob-handle.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI1D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,GAAG,cAAc,CAAC,UAAU;QAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC9B;IACD,QAAQ,EAAE,CAAC,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FromSchema } from "../schema/schema.js";
|
|
2
|
+
export declare const BlobMetaSchema: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly type: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
};
|
|
8
|
+
readonly size: {
|
|
9
|
+
readonly type: "number";
|
|
10
|
+
};
|
|
11
|
+
readonly width: {
|
|
12
|
+
readonly type: "number";
|
|
13
|
+
};
|
|
14
|
+
readonly height: {
|
|
15
|
+
readonly type: "number";
|
|
16
|
+
};
|
|
17
|
+
readonly duration: {
|
|
18
|
+
readonly type: "number";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly required: readonly ["type", "size"];
|
|
22
|
+
};
|
|
23
|
+
export type BlobMeta = FromSchema<typeof BlobMetaSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const BlobMetaSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
properties: {
|
|
4
|
+
type: { type: 'string' },
|
|
5
|
+
size: { type: 'number' },
|
|
6
|
+
width: { type: 'number' },
|
|
7
|
+
height: { type: 'number' },
|
|
8
|
+
duration: { type: 'number' },
|
|
9
|
+
},
|
|
10
|
+
required: ['type', 'size'],
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=blob-meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob-meta.js","sourceRoot":"","sources":["../../src/blob/blob-meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-handle.js","sourceRoot":"","sources":["../../src/blob/download-handle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-handle.js","sourceRoot":"","sources":["../../src/blob/upload-handle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Service } from '../../service/index.js';
|
|
3
|
+
export declare class ApplicationElement<MainService extends Service> extends LitElement {
|
|
4
|
+
service: MainService;
|
|
5
|
+
constructor();
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
protected findAncestorService(): MainService | void;
|
|
8
|
+
render(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
+
};
|
|
28
|
+
import { LitElement } from 'lit';
|
|
29
|
+
import { property } from 'lit/decorators.js';
|
|
30
|
+
import { attachDecorator, withHooks } from '../hooks/index.js';
|
|
31
|
+
import { iterateSelfAndAncestors } from '../functions/index.js';
|
|
32
|
+
import { isService } from '../../service/index.js';
|
|
33
|
+
export class ApplicationElement extends LitElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
attachDecorator(this, 'render', withHooks);
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
if (!this.service) {
|
|
41
|
+
const service = this.findAncestorService();
|
|
42
|
+
if (service) {
|
|
43
|
+
this.service = service;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
findAncestorService() {
|
|
48
|
+
for (const element of iterateSelfAndAncestors(this)) {
|
|
49
|
+
const { service } = element;
|
|
50
|
+
if (isService(service)) {
|
|
51
|
+
return service;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
throw new Error('render function must be overridden');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: Object, reflect: false })
|
|
61
|
+
], ApplicationElement.prototype, "service", void 0);
|
|
62
|
+
//# sourceMappingURL=application-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-element.js","sourceRoot":"","sources":["../../../src/lit/elements/application-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;;;;;;;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAW,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,OAAO,kBAAgD,SAAQ,UAAU;IAI7E;QACE,KAAK,EAAE,CAAC;QACR,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3C,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAES,mBAAmB;QAC3B,KAAK,MAAM,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAmD,CAAC;YACxE,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBACvB,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;CAEF;AA/BC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;mDACrB"}
|
|
@@ -29,6 +29,7 @@ import { html, LitElement } from "lit";
|
|
|
29
29
|
import { property } from "lit/decorators.js";
|
|
30
30
|
import { provide } from "@lit/context";
|
|
31
31
|
import { serviceContext } from "./service-context.js";
|
|
32
|
+
import { isDisposable } from "../../service/disposable.js";
|
|
32
33
|
export class ServiceApplication extends LitElement {
|
|
33
34
|
async updated(changedProperties) {
|
|
34
35
|
super.updated(changedProperties);
|
|
@@ -36,7 +37,9 @@ export class ServiceApplication extends LitElement {
|
|
|
36
37
|
}
|
|
37
38
|
disconnectedCallback() {
|
|
38
39
|
super.disconnectedCallback();
|
|
39
|
-
this.service
|
|
40
|
+
if (isDisposable(this.service)) {
|
|
41
|
+
this.service.dispose();
|
|
42
|
+
}
|
|
40
43
|
this.service = null;
|
|
41
44
|
}
|
|
42
45
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-application.js","sourceRoot":"","sources":["../../../src/lit/elements/service-application.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;;;;;;;AAEX,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"service-application.js","sourceRoot":"","sources":["../../../src/lit/elements/service-application.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;;;;;;;AAEX,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,OAAgB,kBAAsC,SAAQ,UAAU;IAQjE,KAAK,CAAC,OAAO,CAAC,iBAAiC;QACpD,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAEQ,oBAAoB;QACzB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAW,CAAC;IAC/B,CAAC;IAEQ,MAAM;QACX,OAAO,IAAI,CAAA;;SAEV,CAAC;IACN,CAAC;CACJ;AAtBa;IAFT,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./iterate-self-and-ancestors.js";
|
|
@@ -19,5 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export * from "./
|
|
22
|
+
export * from "./iterate-self-and-ancestors.js";
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/functions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function iterateSelfAndAncestors(element: Element): IterableIterator<Element>;
|
|
@@ -19,16 +19,26 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
export function* iterateSelfAndAncestors(element) {
|
|
23
|
+
let current = element;
|
|
24
|
+
while (current) {
|
|
25
|
+
yield current;
|
|
26
|
+
if (current instanceof HTMLSlotElement && current.assignedSlot) {
|
|
27
|
+
// Move to the slot's parent if the current element is assigned to a slot
|
|
28
|
+
current = current.assignedSlot;
|
|
29
|
+
}
|
|
30
|
+
else if (current.parentNode instanceof Element) {
|
|
31
|
+
// Move up to the parent node if it is an element
|
|
32
|
+
current = current.parentNode;
|
|
33
|
+
}
|
|
34
|
+
else if (current.getRootNode().host) {
|
|
35
|
+
// Move to the host element if we're at a shadow root
|
|
36
|
+
current = current.getRootNode().host;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// If no more ancestors, stop the iteration
|
|
40
|
+
current = null;
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
|
-
return true;
|
|
33
43
|
}
|
|
34
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=iterate-self-and-ancestors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterate-self-and-ancestors.js","sourceRoot":"","sources":["../../../src/lit/functions/iterate-self-and-ancestors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,MAAM,SAAS,CAAC,CAAC,uBAAuB,CAAC,OAAgB;IACrD,IAAI,OAAO,GAAmB,OAAO,CAAC;IAEtC,OAAO,OAAO,EAAE,CAAC;QACb,MAAM,OAAO,CAAC;QAEd,IAAI,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YAC7D,yEAAyE;YACzE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;QACnC,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,YAAY,OAAO,EAAE,CAAC;YAC/C,iDAAiD;YACjD,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;QACjC,CAAC;aAAM,IAAK,OAAO,CAAC,WAAW,EAAiB,CAAC,IAAI,EAAE,CAAC;YACpD,qDAAqD;YACrD,OAAO,GAAI,OAAO,CAAC,WAAW,EAAiB,CAAC,IAAI,CAAC;QACzD,CAAC;aAAM,CAAC;YACJ,2CAA2C;YAC3C,OAAO,GAAG,IAAI,CAAC;QACnB,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attacheds a decorator to a method on an object and reassigns the resulting value back to the object.
|
|
3
|
+
*/
|
|
4
|
+
export declare function attachDecorator<T, K extends keyof T>(obj: T, property: K, decorator: (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T[K]>) => PropertyDescriptor): void;
|
|
@@ -20,26 +20,27 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @param action - The action to execute.
|
|
25
|
-
* @param argProvider - An async iterable iterator of arguments to pass to the action.
|
|
23
|
+
* Attacheds a decorator to a method on an object and reassigns the resulting value back to the object.
|
|
26
24
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
export function attachDecorator(obj, property,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
27
|
+
decorator) {
|
|
28
|
+
// Get the descriptor of the property
|
|
29
|
+
let descriptor = Object.getOwnPropertyDescriptor(obj, property);
|
|
30
|
+
if (!descriptor) {
|
|
31
|
+
if (!obj[property]) {
|
|
32
|
+
throw new Error(`Property ${property.toString()} does not exist on object`);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// allow the async iterable iterator to finalize and close any open resources
|
|
42
|
-
argProvider.throw?.(e);
|
|
34
|
+
descriptor = {
|
|
35
|
+
value: obj[property],
|
|
36
|
+
writable: true,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
};
|
|
43
40
|
}
|
|
41
|
+
// Apply the decorator to the descriptor
|
|
42
|
+
const decoratedDescriptor = decorator(obj, String(property), descriptor);
|
|
43
|
+
// Reassign the decorated method back to the object
|
|
44
|
+
obj[property] = decoratedDescriptor.value;
|
|
44
45
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=attach-decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach-decorator.js","sourceRoot":"","sources":["../../../src/lit/hooks/attach-decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,GAAM,EACN,QAAW;AACX,wFAAwF;AACxF,SAA8G;IAE9G,qCAAqC;IACrC,IAAI,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEhE,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;QAChF,CAAC;QACD,UAAU,GAAG;YACT,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC;YACpB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACrB,CAAC;IACN,CAAC;IAED,wCAAwC;IACxC,MAAM,mBAAmB,GAAG,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAEzE,mDAAmD;IACnD,GAAG,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC;AAC9C,CAAC"}
|
package/dist/lit/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lit/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DraggableProps, Vector2 } from './use-draggable.js';
|
|
2
|
+
export type DragObserveProps = Pick<DraggableProps, 'minDragDistance' | 'dragCursor' | 'addPlaceholder' | 'stopPropagation'>;
|
|
3
|
+
export type DragStart = {
|
|
4
|
+
readonly type: 'start' | 'cancel';
|
|
5
|
+
};
|
|
6
|
+
export type DragMove = {
|
|
7
|
+
readonly type: 'move';
|
|
8
|
+
readonly delta: Vector2;
|
|
9
|
+
readonly position: Vector2;
|
|
10
|
+
};
|
|
11
|
+
export type DragEnd = {
|
|
12
|
+
readonly type: 'end';
|
|
13
|
+
readonly position: Vector2;
|
|
14
|
+
};
|
|
15
|
+
export type DragState = DragStart | DragMove | DragEnd;
|
|
16
|
+
/**
|
|
17
|
+
* This hook creates a drag observe function that can be used to observe the drag state of an element.
|
|
18
|
+
* This is normally not used directly, but rather through the `useDragTransaction` hook.
|
|
19
|
+
* @param props
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDragObserve(props: DragObserveProps, dependencies: unknown[]): import("@adobe/data/observe").Observe<DragState>;
|
|
@@ -19,24 +19,37 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
import { useDraggable } from './use-draggable.js';
|
|
23
|
+
import { useElement } from './use-element.js';
|
|
24
|
+
import { createObservableEvent } from '@adobe/data/observe';
|
|
25
|
+
/**
|
|
26
|
+
* This hook creates a drag observe function that can be used to observe the drag state of an element.
|
|
27
|
+
* This is normally not used directly, but rather through the `useDragTransaction` hook.
|
|
28
|
+
* @param props
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export function useDragObserve(props, dependencies) {
|
|
32
|
+
const [dragState, setDragState] = createObservableEvent();
|
|
33
|
+
const element = useElement();
|
|
34
|
+
useDraggable(element, () => ({
|
|
35
|
+
...props,
|
|
36
|
+
onDragStart: _e => {
|
|
37
|
+
setDragState({ type: 'start' });
|
|
33
38
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
onDrag: (_e, position, delta) => {
|
|
40
|
+
setDragState({
|
|
41
|
+
type: 'move',
|
|
42
|
+
position,
|
|
43
|
+
delta,
|
|
38
44
|
});
|
|
39
45
|
},
|
|
40
|
-
|
|
46
|
+
onDragEnd: (_e, position) => {
|
|
47
|
+
setDragState({ type: 'end', position });
|
|
48
|
+
},
|
|
49
|
+
onDragCancel: () => {
|
|
50
|
+
setDragState({ type: 'cancel' });
|
|
51
|
+
},
|
|
52
|
+
}), dependencies);
|
|
53
|
+
return dragState;
|
|
41
54
|
}
|
|
42
|
-
//# sourceMappingURL=
|
|
55
|
+
//# sourceMappingURL=use-drag-observe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-drag-observe.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-drag-observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAA2B,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAoB5D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuB,EAAE,YAAuB;IAC3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,qBAAqB,EAAa,CAAC;IACrE,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,YAAY,CAAC,OAAO,EAChB,GAAG,EAAE,CAAC,CAAC;QACH,GAAG,KAAK;QACR,WAAW,EAAE,EAAE,CAAC,EAAE;YACd,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;YAC5B,YAAY,CAAC;gBACT,IAAI,EAAE,MAAM;gBACZ,QAAQ;gBACR,KAAK;aACR,CAAC,CAAC;QACP,CAAC;QACD,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE;YACxB,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACf,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;KACJ,CAAC,EACF,YAAY,CACf,CAAC;IACF,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DragEnd, DragMove, DragObserveProps } from './use-drag-observe.js';
|
|
2
|
+
import { AsyncArgsProvider } from '@adobe/data/ecs';
|
|
3
|
+
export type DragTransactionProps<T> = DragObserveProps & {
|
|
4
|
+
transaction: (asyncArgs: AsyncArgsProvider<T>) => void;
|
|
5
|
+
update: (drag: DragMove) => T;
|
|
6
|
+
finish: (drag: DragEnd) => T;
|
|
7
|
+
};
|
|
8
|
+
export declare function useDragTransaction<T>(propsFactory: () => DragTransactionProps<T>, dependencies: unknown[]): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { useDragObserve } from './use-drag-observe.js';
|
|
23
|
+
import { useEffect } from "./use-effect.js";
|
|
24
|
+
import { toAsyncGenerator, withFilter } from '@adobe/data/observe';
|
|
25
|
+
export function useDragTransaction(propsFactory, dependencies) {
|
|
26
|
+
const props = propsFactory();
|
|
27
|
+
const { transaction, update, finish } = props;
|
|
28
|
+
const dragObserve = useDragObserve(props, dependencies);
|
|
29
|
+
const startDragTransaction = () => {
|
|
30
|
+
let done = false;
|
|
31
|
+
// we start the transaction by calling it with an async generator that will yield the args asynchronously
|
|
32
|
+
transaction(
|
|
33
|
+
// we create the async generator by mapping the dragObserve state changes to transaction args
|
|
34
|
+
() => toAsyncGenerator(
|
|
35
|
+
// this uses the withMap function and the provided update and finish functions
|
|
36
|
+
// any type 'start' will just be ignored and filtered out
|
|
37
|
+
withFilter(dragObserve, value => {
|
|
38
|
+
if (value.type === 'end') {
|
|
39
|
+
done = true;
|
|
40
|
+
return finish(value);
|
|
41
|
+
}
|
|
42
|
+
if (value.type === 'move') {
|
|
43
|
+
return update(value);
|
|
44
|
+
}
|
|
45
|
+
}), _value => done));
|
|
46
|
+
};
|
|
47
|
+
// now we will observe the drag state and start a new transaction whenever a drag starts
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
return dragObserve(value => {
|
|
50
|
+
if (value.type === 'start') {
|
|
51
|
+
startDragTransaction();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}, dependencies);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=use-drag-transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-drag-transaction.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-drag-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAuC,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAQnE,MAAM,UAAU,kBAAkB,CAAI,YAA2C,EAAE,YAAuB;IACtG,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC9C,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACxD,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAC9B,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,yGAAyG;QACzG,WAAW;QACP,6FAA6F;QAC7F,GAAG,EAAE,CACD,gBAAgB;QACZ,8EAA8E;QAC9E,yDAAyD;QACzD,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACvB,IAAI,GAAG,IAAI,CAAC;gBACZ,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACxB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;QACL,CAAC,CAAC,EACF,MAAM,CAAC,EAAE,CAAC,IAAI,CACjB,CACR,CAAC;IACN,CAAC,CAAC;IACF,wFAAwF;IACxF,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,WAAW,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACzB,oBAAoB,EAAE,CAAC;YAC3B,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,YAAY,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Vector2 = readonly [number, number];
|
|
2
|
+
export interface DraggableProps {
|
|
3
|
+
onDragStart: (e: PointerEvent) => Vector2 | void;
|
|
4
|
+
onDrag: (e: PointerEvent, newPosition: Vector2, delta: Vector2) => void;
|
|
5
|
+
onDragEnd?: (e: PointerEvent, newPosition: Vector2) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Called if this hook is destroyed before the drag is completed.
|
|
8
|
+
*/
|
|
9
|
+
onDragCancel?: () => void;
|
|
10
|
+
initialDownPosition?: Vector2;
|
|
11
|
+
minDragDistance?: number;
|
|
12
|
+
dragCursor?: string;
|
|
13
|
+
addPlaceholder?: boolean;
|
|
14
|
+
stopPropagation?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function useDraggable(element: HTMLElement, propsFunction: () => DraggableProps, dependencies: unknown[]): void;
|