rimecms 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-sqlite/area.server.d.ts +2 -3
- package/dist/adapter-sqlite/area.server.js +2 -3
- package/dist/adapter-sqlite/auth.server.d.ts +2 -8
- package/dist/adapter-sqlite/auth.server.js +2 -8
- package/dist/adapter-sqlite/blocks.server.d.ts +2 -23
- package/dist/adapter-sqlite/blocks.server.js +15 -93
- package/dist/adapter-sqlite/collection.server.d.ts +2 -5
- package/dist/adapter-sqlite/collection.server.js +2 -5
- package/dist/adapter-sqlite/columns.server.d.ts +9 -9
- package/dist/adapter-sqlite/columns.server.js +41 -39
- package/dist/adapter-sqlite/connect.server.js +1 -1
- package/dist/adapter-sqlite/constant.d.ts +16 -0
- package/dist/adapter-sqlite/constant.js +16 -0
- package/dist/adapter-sqlite/db-move.server.d.ts +31 -0
- package/dist/adapter-sqlite/db-move.server.js +102 -0
- package/dist/adapter-sqlite/drizzle-config.server.d.ts +9 -0
- package/dist/adapter-sqlite/drizzle-config.server.js +39 -0
- package/dist/adapter-sqlite/generate-schema/column.server.js +37 -45
- package/dist/adapter-sqlite/generate-schema/index.server.d.ts +0 -1
- package/dist/adapter-sqlite/generate-schema/index.server.js +11 -20
- package/dist/adapter-sqlite/generate-schema/relations/junction.server.d.ts +7 -7
- package/dist/adapter-sqlite/generate-schema/relations/junction.server.js +9 -11
- package/dist/adapter-sqlite/generate-schema/root.server.d.ts +8 -11
- package/dist/adapter-sqlite/generate-schema/root.server.js +7 -14
- package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +16 -26
- package/dist/adapter-sqlite/generate-schema/templates.server.js +25 -25
- package/dist/adapter-sqlite/generate-schema/write.server.d.ts +31 -0
- package/dist/adapter-sqlite/generate-schema/write.server.js +120 -28
- package/dist/adapter-sqlite/hooks.server.d.ts +3 -0
- package/dist/adapter-sqlite/hooks.server.js +64 -0
- package/dist/adapter-sqlite/index.server.d.ts +14 -6
- package/dist/adapter-sqlite/index.server.js +23 -8
- package/dist/adapter-sqlite/index.server.test-d.d.ts +1 -0
- package/dist/adapter-sqlite/index.server.test-d.js +8 -0
- package/dist/adapter-sqlite/locales.server.js +2 -3
- package/dist/adapter-sqlite/naming.server.d.ts +14 -10
- package/dist/adapter-sqlite/naming.server.js +11 -13
- package/dist/adapter-sqlite/order-by.server.d.ts +7 -1
- package/dist/adapter-sqlite/order-by.server.js +14 -16
- package/dist/adapter-sqlite/paths.server.d.ts +1 -1
- package/dist/adapter-sqlite/paths.server.js +15 -24
- package/dist/adapter-sqlite/read.server.d.ts +10 -13
- package/dist/adapter-sqlite/read.server.js +31 -14
- package/dist/adapter-sqlite/relations.server.d.ts +5 -0
- package/dist/adapter-sqlite/relations.server.js +36 -15
- package/dist/adapter-sqlite/repeatable.server.d.ts +9 -0
- package/dist/adapter-sqlite/repeatable.server.js +79 -0
- package/dist/adapter-sqlite/rows.server.d.ts +2 -3
- package/dist/adapter-sqlite/select.server.d.ts +2 -2
- package/dist/adapter-sqlite/select.server.js +21 -32
- package/dist/adapter-sqlite/table.server.d.ts +2 -2
- package/dist/adapter-sqlite/table.server.js +12 -10
- package/dist/adapter-sqlite/transaction.server.d.ts +21 -0
- package/dist/adapter-sqlite/transaction.server.js +26 -0
- package/dist/adapter-sqlite/transform.server.d.ts +9 -0
- package/dist/adapter-sqlite/transform.server.js +21 -16
- package/dist/adapter-sqlite/tree.server.d.ts +2 -23
- package/dist/adapter-sqlite/tree.server.js +12 -93
- package/dist/adapter-sqlite/types.server.d.ts +5 -4
- package/dist/adapter-sqlite/where.server.js +117 -78
- package/dist/adapter-sqlite/write.server.d.ts +6 -51
- package/dist/adapter-sqlite/write.server.js +30 -45
- package/dist/core/adapter.d.ts +53 -28
- package/dist/core/auth/access.d.ts +11 -26
- package/dist/core/auth/access.js +13 -23
- package/dist/core/auth/augment.d.ts +4 -5
- package/dist/core/auth/augment.js +11 -21
- package/dist/core/auth/augment.server.js +2 -1
- package/dist/core/auth/better-auth/config.server.d.ts +8 -11
- package/dist/core/auth/better-auth/config.server.js +39 -11
- package/dist/core/auth/better-auth/hooks.server.js +33 -24
- package/dist/core/auth/better-auth/instance.server.d.ts +15 -26
- package/dist/core/auth/better-auth/instance.server.js +2 -11
- package/dist/core/auth/better-auth/permissions.d.ts +8 -1
- package/dist/core/auth/better-auth/permissions.js +7 -3
- package/dist/core/auth/better-auth-tables.server.d.ts +18 -5
- package/dist/core/auth/better-auth-tables.server.js +29 -10
- package/dist/core/auth/configure.d.ts +2 -2
- package/dist/core/auth/configure.js +2 -2
- package/dist/core/auth/constant.d.ts +15 -0
- package/dist/core/auth/constant.js +15 -0
- package/dist/core/auth/constant.server.d.ts +4 -8
- package/dist/core/auth/constant.server.js +4 -8
- package/dist/core/auth/enabled.js +1 -1
- package/dist/core/auth/handler/index.server.d.ts +2 -2
- package/dist/core/auth/handler/index.server.js +78 -58
- package/dist/core/auth/hooks/augment-fields-password.server.d.ts +3 -18
- package/dist/core/auth/hooks/augment-fields-password.server.js +4 -19
- package/dist/core/auth/hooks/create-better-auth-user.server.js +44 -46
- package/dist/core/auth/hooks/delete-better-auth-user.server.d.ts +5 -1
- package/dist/core/auth/hooks/delete-better-auth-user.server.js +15 -16
- package/dist/core/auth/hooks/forward-roles.server.d.ts +12 -8
- package/dist/core/auth/hooks/forward-roles.server.js +54 -39
- package/dist/core/auth/hooks/index.server.d.ts +3 -3
- package/dist/core/auth/hooks/index.server.js +3 -3
- package/dist/core/auth/hooks/prevent-superadmin-deletion.server.d.ts +2 -3
- package/dist/core/auth/hooks/prevent-superadmin-deletion.server.js +2 -3
- package/dist/core/auth/hooks/prevent-superadmin-mutation.server.d.ts +3 -2
- package/dist/core/auth/hooks/prevent-superadmin-mutation.server.js +8 -6
- package/dist/core/auth/hooks/sign-in-new-user.server.d.ts +5 -7
- package/dist/core/auth/hooks/sign-in-new-user.server.js +6 -10
- package/dist/core/auth/staff/configure.js +5 -3
- package/dist/core/auth/staff/configure.server.js +6 -6
- package/dist/core/auth/staff/derive.d.ts +2 -21
- package/dist/core/auth/staff/derive.js +19 -19
- package/dist/core/auth/tables.d.ts +0 -20
- package/dist/core/auth/tables.js +4 -21
- package/dist/core/auth/types.d.ts +2 -4
- package/dist/core/auth/user.server.d.ts +30 -16
- package/dist/core/auth/user.server.js +43 -17
- package/dist/core/boot.server.d.ts +15 -17
- package/dist/core/boot.server.js +23 -9
- package/dist/core/codegen.server.d.ts +4 -6
- package/dist/core/codegen.server.js +44 -19
- package/dist/core/config/build.d.ts +5 -7
- package/dist/core/config/build.js +4 -6
- package/dist/core/config/build.server.d.ts +2 -15
- package/dist/core/config/build.server.js +2 -3
- package/dist/core/config/client.test-d.d.ts +1 -0
- package/dist/core/config/client.test-d.js +13 -0
- package/dist/core/config/configure.d.ts +4 -8
- package/dist/core/config/configure.js +4 -8
- package/dist/core/config/context.server.d.ts +1 -5
- package/dist/core/config/context.server.js +5 -15
- package/dist/core/config/hooks.test-d.d.ts +1 -0
- package/dist/core/config/hooks.test-d.js +9 -0
- package/dist/core/config/index.server.d.ts +5 -1
- package/dist/core/config/index.server.js +5 -1
- package/dist/core/config/inference.spec-d.d.ts +1 -0
- package/dist/core/config/inference.spec-d.js +21 -0
- package/dist/core/config/types.d.ts +30 -46
- package/dist/core/config/validate.server.d.ts +2 -2
- package/dist/core/config/validate.server.js +43 -66
- package/dist/core/constants.d.ts +11 -4
- package/dist/core/constants.js +11 -4
- package/dist/core/constants.server.d.ts +1 -1
- package/dist/core/constants.server.js +1 -1
- package/dist/core/cors/configure.server.d.ts +6 -4
- package/dist/core/cors/configure.server.js +9 -8
- package/dist/core/cors/handler.server.d.ts +5 -5
- package/dist/core/cors/handler.server.js +24 -18
- package/dist/core/cors/module.server.js +2 -2
- package/dist/core/dev/cache.server.d.ts +17 -0
- package/dist/core/dev/cache.server.js +7 -6
- package/dist/core/dev/cli/commands/build.d.ts +2 -3
- package/dist/core/dev/cli/commands/build.js +35 -18
- package/dist/core/dev/cli/commands/clear.server.d.ts +5 -0
- package/dist/core/dev/cli/commands/clear.server.js +23 -8
- package/dist/core/dev/cli/commands/generate-exports.server.d.ts +3 -5
- package/dist/core/dev/cli/commands/generate-exports.server.js +9 -15
- package/dist/core/dev/cli/commands/generate.server.js +14 -7
- package/dist/core/dev/cli/commands/init.server.d.ts +3 -1
- package/dist/core/dev/cli/commands/init.server.js +78 -123
- package/dist/core/dev/cli/commands/uploads-move.server.d.ts +33 -0
- package/dist/core/dev/cli/commands/uploads-move.server.js +122 -0
- package/dist/core/dev/cli/index.js +40 -7
- package/dist/core/dev/cli/templates/build.d.ts +1 -1
- package/dist/core/dev/cli/templates/build.js +16 -32
- package/dist/core/dev/cli/templates/env.d.ts +19 -0
- package/dist/core/dev/cli/templates/env.js +92 -0
- package/dist/core/dev/cli/templates/init.d.ts +35 -19
- package/dist/core/dev/cli/templates/init.js +97 -79
- package/dist/core/dev/cli/util/adapter-hooks.server.d.ts +15 -0
- package/dist/core/dev/cli/util/adapter-hooks.server.js +17 -0
- package/dist/core/dev/cli/util/package-manager.server.d.ts +7 -2
- package/dist/core/dev/cli/util/package-manager.server.js +14 -32
- package/dist/core/dev/cli/util/project-name.d.ts +15 -0
- package/dist/core/dev/cli/util/project-name.js +28 -0
- package/dist/core/dev/codegen/routes/common.server.d.ts +41 -20
- package/dist/core/dev/codegen/routes/common.server.js +96 -74
- package/dist/core/dev/codegen/routes/custom-css.server.d.ts +0 -10
- package/dist/core/dev/codegen/routes/custom-css.server.js +9 -55
- package/dist/core/dev/codegen/routes/index.server.d.ts +21 -6
- package/dist/core/dev/codegen/routes/index.server.js +59 -38
- package/dist/core/dev/codegen/routes/util.server.d.ts +12 -8
- package/dist/core/dev/codegen/routes/util.server.js +12 -14
- package/dist/core/dev/codegen/runtime/index.server.d.ts +9 -25
- package/dist/core/dev/codegen/runtime/index.server.js +5 -35
- package/dist/core/dev/codegen/runtime/parse-exports.server.d.ts +2 -2
- package/dist/core/dev/codegen/runtime/parse-exports.server.js +2 -2
- package/dist/core/dev/codegen/sanitize/index.server.d.ts +21 -0
- package/dist/core/dev/codegen/sanitize/index.server.js +307 -408
- package/dist/core/dev/codegen/types/contributions.server.d.ts +1 -6
- package/dist/core/dev/codegen/types/contributions.server.js +1 -2
- package/dist/core/dev/codegen/types/index.server.d.ts +29 -3
- package/dist/core/dev/codegen/types/index.server.js +50 -59
- package/dist/core/dev/codegen/types/templates.server.d.ts +3 -1
- package/dist/core/dev/codegen/types/templates.server.js +20 -29
- package/dist/core/dev/config-memo.server.d.ts +17 -2
- package/dist/core/dev/config-memo.server.js +50 -23
- package/dist/core/dev/constants.server.d.ts +23 -2
- package/dist/core/dev/constants.server.js +38 -13
- package/dist/core/dev/deny-storage.server.d.ts +18 -0
- package/dist/core/dev/deny-storage.server.js +29 -0
- package/dist/core/dev/ensure.server.d.ts +1 -22
- package/dist/core/dev/ensure.server.js +6 -25
- package/dist/core/dev/env.server.d.ts +17 -0
- package/dist/core/dev/env.server.js +18 -0
- package/dist/core/dev/version.server.d.ts +2 -2
- package/dist/core/dev/version.server.js +21 -3
- package/dist/core/dev/vite.server.d.ts +11 -0
- package/dist/core/dev/vite.server.js +36 -23
- package/dist/core/errors/handler.server.d.ts +20 -56
- package/dist/core/errors/handler.server.js +50 -80
- package/dist/core/errors/index.d.ts +15 -4
- package/dist/core/errors/index.js +38 -27
- package/dist/core/fields/builders/boolean-builder.d.ts +1 -8
- package/dist/core/fields/builders/boolean-builder.js +3 -14
- package/dist/core/fields/builders/field-builder.d.ts +6 -7
- package/dist/core/fields/builders/field-builder.js +3 -4
- package/dist/core/fields/builders/form-field-builder.d.ts +40 -9
- package/dist/core/fields/builders/form-field-builder.js +59 -11
- package/dist/core/fields/builders/select-builder.d.ts +3 -6
- package/dist/core/fields/builders/select-builder.js +19 -28
- package/dist/core/fields/complete.d.ts +2 -2
- package/dist/core/fields/complete.js +4 -4
- package/dist/core/fields/empty.d.ts +9 -4
- package/dist/core/fields/empty.js +29 -5
- package/dist/core/fields/initial.d.ts +2 -1
- package/dist/core/fields/initial.js +9 -1
- package/dist/core/fields/localize.d.ts +12 -0
- package/dist/core/fields/localize.js +14 -0
- package/dist/core/fields/types.d.ts +8 -7
- package/dist/core/fields/types.test-d.js +2 -1
- package/dist/core/fields/unique.server.d.ts +13 -0
- package/dist/core/fields/unique.server.js +37 -0
- package/dist/core/fields/util.d.ts +12 -30
- package/dist/core/fields/util.js +18 -48
- package/dist/core/fields/validate.d.ts +20 -7
- package/dist/core/fields/validate.js +21 -14
- package/dist/core/fields/walk.d.ts +5 -9
- package/dist/core/fields/walk.js +9 -9
- package/dist/core/handler.server.d.ts +1 -1
- package/dist/core/handler.server.js +18 -5
- package/dist/core/i18n/en/common.d.ts +1 -15
- package/dist/core/i18n/en/common.js +5 -19
- package/dist/core/i18n/en/errors.d.ts +25 -8
- package/dist/core/i18n/en/errors.js +25 -9
- package/dist/core/i18n/en/fields.d.ts +2 -7
- package/dist/core/i18n/en/fields.js +4 -8
- package/dist/core/i18n/fr/common.d.ts +1 -16
- package/dist/core/i18n/fr/common.js +5 -20
- package/dist/core/i18n/fr/errors.d.ts +25 -7
- package/dist/core/i18n/fr/errors.js +25 -7
- package/dist/core/i18n/fr/fields.d.ts +2 -7
- package/dist/core/i18n/fr/fields.js +4 -8
- package/dist/core/i18n/index.d.ts +2 -6
- package/dist/core/i18n/index.js +2 -2
- package/dist/core/i18n/register.server.d.ts +4 -0
- package/dist/core/i18n/register.server.js +14 -27
- package/dist/core/locale/copy.server.d.ts +12 -6
- package/dist/core/locale/copy.server.js +94 -44
- package/dist/core/locale/request.server.d.ts +14 -0
- package/dist/core/locale/request.server.js +34 -0
- package/dist/core/locale/types.d.ts +2 -2
- package/dist/core/logger.server.d.ts +10 -0
- package/dist/core/logger.server.js +138 -126
- package/dist/core/panel/configure.d.ts +10 -9
- package/dist/core/panel/configure.js +11 -13
- package/dist/core/panel/types.d.ts +2 -2
- package/dist/core/pipeline/build-document.server.d.ts +2 -3
- package/dist/core/pipeline/build-document.server.js +11 -8
- package/dist/core/pipeline/build.server.d.ts +3 -17
- package/dist/core/pipeline/build.server.js +10 -21
- package/dist/core/pipeline/define-hook.d.ts +12 -12
- package/dist/core/pipeline/define-hook.js +12 -12
- package/dist/core/pipeline/extract-data.server.d.ts +4 -12
- package/dist/core/pipeline/extract-data.server.js +29 -46
- package/dist/core/pipeline/hooks/authorize.server.js +1 -4
- package/dist/core/pipeline/hooks/complete-new-rows.server.d.ts +17 -0
- package/dist/core/pipeline/hooks/complete-new-rows.server.js +35 -0
- package/dist/core/pipeline/hooks/get-original-document.server.d.ts +4 -1
- package/dist/core/pipeline/hooks/get-original-document.server.js +9 -4
- package/dist/core/pipeline/hooks/normalize-resolved-references.server.d.ts +14 -3
- package/dist/core/pipeline/hooks/normalize-resolved-references.server.js +29 -19
- package/dist/core/pipeline/hooks/original-config-map.server.js +1 -1
- package/dist/core/pipeline/hooks/process-document-fields.server.d.ts +15 -2
- package/dist/core/pipeline/hooks/process-document-fields.server.js +39 -16
- package/dist/core/pipeline/hooks/resolve-content-owner.server.d.ts +1 -9
- package/dist/core/pipeline/hooks/resolve-content-owner.server.js +1 -9
- package/dist/core/pipeline/hooks/set-default-values.server.d.ts +1 -11
- package/dist/core/pipeline/hooks/set-default-values.server.js +8 -5
- package/dist/core/pipeline/hooks/set-document-locale.server.d.ts +2 -2
- package/dist/core/pipeline/hooks/set-document-locale.server.js +3 -7
- package/dist/core/pipeline/hooks/set-document-type.server.d.ts +2 -1
- package/dist/core/pipeline/hooks/set-document-type.server.js +2 -1
- package/dist/core/pipeline/hooks/sort-document-props.server.js +2 -2
- package/dist/core/pipeline/hooks/validate-fields.server.d.ts +13 -8
- package/dist/core/pipeline/hooks/validate-fields.server.js +126 -91
- package/dist/core/pipeline/persist/blocks/extract.server.js +7 -4
- package/dist/core/pipeline/persist/blocks/index.server.d.ts +2 -7
- package/dist/core/pipeline/persist/blocks/index.server.js +5 -15
- package/dist/core/pipeline/persist/relations/diff.server.d.ts +10 -2
- package/dist/core/pipeline/persist/relations/diff.server.js +45 -38
- package/dist/core/pipeline/persist/relations/index.server.d.ts +6 -15
- package/dist/core/pipeline/persist/relations/index.server.js +2 -8
- package/dist/core/pipeline/persist/repeatable.server.d.ts +46 -0
- package/dist/core/pipeline/persist/repeatable.server.js +48 -0
- package/dist/core/pipeline/persist/tree/extract.server.js +2 -2
- package/dist/core/pipeline/persist/tree/index.server.d.ts +4 -5
- package/dist/core/pipeline/persist/tree/index.server.js +5 -12
- package/dist/core/pipeline/populate-relations.server.d.ts +5 -2
- package/dist/core/pipeline/populate-relations.server.js +13 -4
- package/dist/core/pipeline/query.d.ts +31 -6
- package/dist/core/pipeline/query.js +90 -9
- package/dist/core/pipeline/run.server.d.ts +7 -8
- package/dist/core/pipeline/run.server.js +29 -27
- package/dist/core/pipeline/seen-by.server.d.ts +19 -0
- package/dist/core/pipeline/seen-by.server.js +19 -0
- package/dist/core/pipeline/types.d.ts +10 -19
- package/dist/core/pipeline/types.js +0 -9
- package/dist/core/pipeline/without-denied-fields.d.ts +43 -0
- package/dist/core/pipeline/without-denied-fields.js +114 -0
- package/dist/core/pipeline/without-row-keys.d.ts +18 -0
- package/dist/core/pipeline/without-row-keys.js +26 -0
- package/dist/core/plugins/api-init/index.server.d.ts +5 -0
- package/dist/core/plugins/api-init/index.server.js +18 -31
- package/dist/core/plugins/cache/HeaderButton.svelte +1 -1
- package/dist/core/plugins/cache/cache.server.d.ts +0 -1
- package/dist/core/plugins/cache/cache.server.js +18 -33
- package/dist/core/plugins/cache/handler.server.d.ts +1 -1
- package/dist/core/plugins/cache/handler.server.js +13 -5
- package/dist/core/plugins/cache/index.js +2 -2
- package/dist/core/plugins/cache/module.js +2 -2
- package/dist/core/plugins/cache/module.server.d.ts +3 -3
- package/dist/core/plugins/cache/module.server.js +4 -4
- package/dist/core/plugins/configure.d.ts +2 -2
- package/dist/core/plugins/configure.js +7 -3
- package/dist/core/plugins/defaults/module.d.ts +3 -4
- package/dist/core/plugins/defaults/module.js +3 -6
- package/dist/core/plugins/defaults/module.server.js +1 -1
- package/dist/core/plugins/index.d.ts +1 -1
- package/dist/core/plugins/mailer/index.server.d.ts +5 -0
- package/dist/core/plugins/mailer/index.server.js +9 -3
- package/dist/core/plugins/plugins.server.d.ts +1 -1
- package/dist/core/plugins/plugins.server.js +0 -1
- package/dist/core/plugins/sse/bus.server.js +25 -14
- package/dist/core/plugins/sse/client.js +21 -5
- package/dist/core/prototype/area/api.server.d.ts +3 -4
- package/dist/core/prototype/area/api.server.js +11 -23
- package/dist/core/prototype/area/augment-label.d.ts +1 -2
- package/dist/core/prototype/area/augment-label.js +1 -2
- package/dist/core/prototype/area/definition.d.ts +1 -1
- package/dist/core/prototype/area/definition.js +2 -2
- package/dist/core/prototype/area/definition.server.js +0 -15
- package/dist/core/prototype/area/hooks.server.d.ts +6 -9
- package/dist/core/prototype/area/hooks.server.js +13 -13
- package/dist/core/prototype/area/operations/find.d.ts +2 -10
- package/dist/core/prototype/area/operations/find.js +2 -9
- package/dist/core/prototype/area/operations/update.d.ts +5 -19
- package/dist/core/prototype/area/operations/update.js +7 -6
- package/dist/core/prototype/area/rest/endpoint.server.d.ts +1 -1
- package/dist/core/prototype/area/rest/endpoint.server.js +3 -5
- package/dist/core/prototype/area/rest/get.server.js +3 -25
- package/dist/core/prototype/area/rest/index.server.d.ts +1 -1
- package/dist/core/prototype/area/rest/index.server.js +1 -1
- package/dist/core/prototype/area/rest/lock.server.js +11 -28
- package/dist/core/prototype/area/rest/update.server.js +4 -32
- package/dist/core/prototype/collection/api.server.d.ts +6 -18
- package/dist/core/prototype/collection/api.server.js +20 -40
- package/dist/core/prototype/collection/augment-label.d.ts +2 -1
- package/dist/core/prototype/collection/can-duplicate.d.ts +15 -0
- package/dist/core/prototype/collection/can-duplicate.js +11 -0
- package/dist/core/prototype/collection/definition.d.ts +6 -8
- package/dist/core/prototype/collection/definition.js +14 -18
- package/dist/core/prototype/collection/definition.server.d.ts +1 -2
- package/dist/core/prototype/collection/definition.server.js +2 -14
- package/dist/core/prototype/collection/hooks.server.d.ts +5 -6
- package/dist/core/prototype/collection/hooks.server.js +23 -14
- package/dist/core/prototype/collection/nested/hooks/add-children.server.js +10 -17
- package/dist/core/prototype/collection/nested/hooks/index.server.d.ts +3 -2
- package/dist/core/prototype/collection/nested/hooks/index.server.js +3 -2
- package/dist/core/prototype/collection/nested/hooks/refuse-cyclic-parent.server.d.ts +10 -0
- package/dist/core/prototype/collection/nested/hooks/refuse-cyclic-parent.server.js +30 -0
- package/dist/core/prototype/collection/nested/module.d.ts +3 -2
- package/dist/core/prototype/collection/nested/module.js +3 -2
- package/dist/core/prototype/collection/nested/module.server.d.ts +1 -2
- package/dist/core/prototype/collection/nested/module.server.js +1 -2
- package/dist/core/prototype/collection/nested/tree.d.ts +3 -2
- package/dist/core/prototype/collection/nested/tree.js +3 -6
- package/dist/core/prototype/collection/operations/create.js +6 -3
- package/dist/core/prototype/collection/operations/delete-by-id.js +2 -4
- package/dist/core/prototype/collection/operations/delete.js +16 -2
- package/dist/core/prototype/collection/operations/duplicate.d.ts +25 -0
- package/dist/core/prototype/collection/operations/duplicate.js +98 -73
- package/dist/core/prototype/collection/operations/find-by-id.d.ts +2 -12
- package/dist/core/prototype/collection/operations/find-by-id.js +4 -10
- package/dist/core/prototype/collection/operations/find-by-ids.d.ts +2 -0
- package/dist/core/prototype/collection/operations/find-by-ids.js +16 -9
- package/dist/core/prototype/collection/operations/find.js +4 -1
- package/dist/core/prototype/collection/operations/update-by-id.d.ts +5 -17
- package/dist/core/prototype/collection/operations/update-by-id.js +6 -8
- package/dist/core/prototype/collection/operations/update-slug-by-id.d.ts +4 -2
- package/dist/core/prototype/collection/operations/update-slug-by-id.js +24 -5
- package/dist/core/prototype/collection/rest/create.server.js +4 -20
- package/dist/core/prototype/collection/rest/delete-by-id.server.js +2 -9
- package/dist/core/prototype/collection/rest/delete.server.d.ts +3 -1
- package/dist/core/prototype/collection/rest/delete.server.js +10 -27
- package/dist/core/prototype/collection/rest/duplicate.server.d.ts +1 -0
- package/dist/core/prototype/collection/rest/duplicate.server.js +8 -13
- package/dist/core/prototype/collection/rest/endpoint.server.d.ts +10 -14
- package/dist/core/prototype/collection/rest/endpoint.server.js +10 -15
- package/dist/core/prototype/collection/rest/get-by-id.server.js +5 -32
- package/dist/core/prototype/collection/rest/get.server.js +5 -32
- package/dist/core/prototype/collection/rest/index.server.d.ts +3 -3
- package/dist/core/prototype/collection/rest/index.server.js +3 -3
- package/dist/core/prototype/collection/rest/lock.server.js +11 -31
- package/dist/core/prototype/collection/rest/update-by-id.server.js +6 -36
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.d.ts +4 -1
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.js +10 -14
- package/dist/core/prototype/collection/thumbnail/augment.js +1 -5
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.d.ts +3 -9
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.js +4 -4
- package/dist/core/prototype/collection/thumbnail/hooks/index.server.d.ts +1 -2
- package/dist/core/prototype/collection/thumbnail/hooks/index.server.js +1 -2
- package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +12 -5
- package/dist/core/prototype/collection/upload/boot/index.server.d.ts +4 -5
- package/dist/core/prototype/collection/upload/boot/index.server.js +4 -5
- package/dist/core/prototype/collection/upload/constant.d.ts +14 -2
- package/dist/core/prototype/collection/upload/constant.js +14 -2
- package/dist/core/prototype/collection/upload/directories/configure.d.ts +2 -4
- package/dist/core/prototype/collection/upload/directories/configure.js +2 -4
- package/dist/core/prototype/collection/upload/directories/configure.server.d.ts +2 -2
- package/dist/core/prototype/collection/upload/directories/configure.server.js +2 -9
- package/dist/core/prototype/collection/upload/directories/derive.d.ts +1 -2
- package/dist/core/prototype/collection/upload/directories/derive.js +1 -3
- package/dist/core/prototype/collection/upload/directories/pipeline.server.d.ts +3 -3
- package/dist/core/prototype/collection/upload/directories/pipeline.server.js +3 -3
- package/dist/core/prototype/collection/upload/disk/delete.server.d.ts +26 -6
- package/dist/core/prototype/collection/upload/disk/delete.server.js +64 -57
- package/dist/core/prototype/collection/upload/disk/medias.server.d.ts +56 -0
- package/dist/core/prototype/collection/upload/disk/medias.server.js +54 -0
- package/dist/core/prototype/collection/upload/disk/save.server.d.ts +26 -24
- package/dist/core/prototype/collection/upload/disk/save.server.js +44 -30
- package/dist/core/prototype/collection/upload/doc-type.d.ts +2 -2
- package/dist/core/prototype/collection/upload/doc-type.js +3 -3
- package/dist/core/prototype/collection/upload/ensure.server.d.ts +4 -3
- package/dist/core/prototype/collection/upload/ensure.server.js +11 -9
- package/dist/core/prototype/collection/upload/handler.server.d.ts +34 -0
- package/dist/core/prototype/collection/upload/handler.server.js +143 -0
- package/dist/core/prototype/collection/upload/hooks/clean-up-files.server.d.ts +13 -8
- package/dist/core/prototype/collection/upload/hooks/clean-up-files.server.js +32 -11
- package/dist/core/prototype/collection/upload/hooks/convert-base64.server.js +2 -0
- package/dist/core/prototype/collection/upload/hooks/extract-path.server.d.ts +2 -3
- package/dist/core/prototype/collection/upload/hooks/extract-path.server.js +2 -3
- package/dist/core/prototype/collection/upload/hooks/handle-path-creation.server.d.ts +2 -3
- package/dist/core/prototype/collection/upload/hooks/handle-path-creation.server.js +12 -20
- package/dist/core/prototype/collection/upload/hooks/index.server.d.ts +2 -3
- package/dist/core/prototype/collection/upload/hooks/index.server.js +2 -3
- package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.d.ts +7 -1
- package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.js +16 -6
- package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.d.ts +9 -15
- package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.js +24 -36
- package/dist/core/prototype/collection/upload/hooks/update-directory-children.server.d.ts +8 -4
- package/dist/core/prototype/collection/upload/hooks/update-directory-children.server.js +22 -9
- package/dist/core/prototype/collection/upload/module.js +34 -34
- package/dist/core/prototype/collection/upload/module.server.d.ts +1 -2
- package/dist/core/prototype/collection/upload/module.server.js +1 -2
- package/dist/core/prototype/collection/upload/naming.d.ts +2 -5
- package/dist/core/prototype/collection/upload/naming.js +4 -8
- package/dist/core/prototype/collection/upload/types.d.ts +11 -4
- package/dist/core/prototype/collection/upload/util/converter.server.d.ts +5 -12
- package/dist/core/prototype/collection/upload/util/converter.server.js +14 -11
- package/dist/core/prototype/collection/upload/util/mime.js +0 -2
- package/dist/core/prototype/collection/upload/util/path.d.ts +1 -12
- package/dist/core/prototype/collection/upload/util/path.js +6 -20
- package/dist/core/prototype/collection/upload/validate-config.server.d.ts +11 -0
- package/dist/core/prototype/collection/upload/validate-config.server.js +30 -0
- package/dist/core/prototype/define.d.ts +16 -24
- package/dist/core/prototype/define.js +9 -8
- package/dist/core/prototype/naming.d.ts +13 -5
- package/dist/core/prototype/naming.js +14 -6
- package/dist/core/prototype/shared/api.server.d.ts +12 -0
- package/dist/core/prototype/shared/api.server.js +22 -0
- package/dist/core/prototype/shared/metas/fields.js +1 -0
- package/dist/core/prototype/shared/metas/hooks/delete-panel-lock-metas.server.js +1 -1
- package/dist/core/prototype/shared/metas/hooks/index.server.d.ts +2 -1
- package/dist/core/prototype/shared/metas/hooks/index.server.js +2 -1
- package/dist/core/prototype/shared/metas/hooks/stamp-authorship.server.js +11 -7
- package/dist/core/prototype/shared/metas/lock-answer.server.d.ts +16 -0
- package/dist/core/prototype/shared/metas/lock-answer.server.js +24 -0
- package/dist/core/prototype/shared/metas/lock.server.d.ts +1 -2
- package/dist/core/prototype/shared/metas/lock.server.js +9 -9
- package/dist/core/prototype/shared/metas/module.d.ts +2 -10
- package/dist/core/prototype/shared/metas/module.js +2 -10
- package/dist/core/prototype/shared/metas/module.server.d.ts +0 -3
- package/dist/core/prototype/shared/metas/module.server.js +1 -4
- package/dist/core/prototype/shared/operations/read-args.d.ts +14 -0
- package/dist/core/prototype/shared/operations/read-args.js +1 -0
- package/dist/core/prototype/shared/operations/row-query.d.ts +13 -0
- package/dist/core/prototype/shared/operations/row-query.js +16 -0
- package/dist/core/prototype/shared/operations/update-args.d.ts +16 -0
- package/dist/core/prototype/shared/operations/update-args.js +1 -0
- package/dist/core/prototype/shared/rest/params.server.d.ts +52 -0
- package/dist/core/prototype/shared/rest/params.server.js +87 -0
- package/dist/core/prototype/shared/title/augment.d.ts +2 -2
- package/dist/core/prototype/shared/title/augment.js +4 -4
- package/dist/core/prototype/shared/title/find-title.d.ts +3 -14
- package/dist/core/prototype/shared/title/find-title.js +5 -5
- package/dist/core/prototype/shared/title/hooks/index.server.d.ts +2 -4
- package/dist/core/prototype/shared/title/hooks/index.server.js +2 -4
- package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +23 -18
- package/dist/core/prototype/shared/title/select.d.ts +2 -2
- package/dist/core/prototype/shared/title/select.js +7 -3
- package/dist/core/prototype/shared/url/addresses.server.d.ts +3 -5
- package/dist/core/prototype/shared/url/addresses.server.js +14 -8
- package/dist/core/prototype/shared/url/area.server.d.ts +19 -0
- package/dist/core/prototype/shared/url/area.server.js +33 -0
- package/dist/core/prototype/shared/url/enabled.d.ts +1 -2
- package/dist/core/prototype/shared/url/enabled.js +1 -2
- package/dist/core/prototype/shared/url/format.server.d.ts +1 -1
- package/dist/core/prototype/shared/url/format.server.js +3 -3
- package/dist/core/prototype/shared/url/hooks/index.server.d.ts +3 -5
- package/dist/core/prototype/shared/url/hooks/index.server.js +3 -5
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.d.ts +5 -1
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.js +12 -5
- package/dist/core/prototype/shared/url/hooks/sync-area-url.server.d.ts +5 -0
- package/dist/core/prototype/shared/url/hooks/sync-area-url.server.js +15 -0
- package/dist/core/prototype/shared/url/locales.server.d.ts +3 -0
- package/dist/core/prototype/shared/url/locales.server.js +5 -0
- package/dist/core/prototype/shared/versions/augment.d.ts +3 -3
- package/dist/core/prototype/shared/versions/augment.js +4 -7
- package/dist/core/prototype/shared/versions/auto-saves.server.js +2 -3
- package/dist/core/prototype/shared/versions/configure.server.js +17 -11
- package/dist/core/prototype/shared/versions/constant.d.ts +1 -7
- package/dist/core/prototype/shared/versions/constant.js +1 -7
- package/dist/core/prototype/shared/versions/doc-type.d.ts +1 -2
- package/dist/core/prototype/shared/versions/doc-type.js +1 -2
- package/dist/core/prototype/shared/versions/enabled.d.ts +1 -2
- package/dist/core/prototype/shared/versions/enabled.js +1 -2
- package/dist/core/prototype/shared/versions/hooks/demote-other-versions.d.ts +1 -1
- package/dist/core/prototype/shared/versions/hooks/demote-other-versions.js +1 -1
- package/dist/core/prototype/shared/versions/hooks/handle-new-version.server.d.ts +1 -1
- package/dist/core/prototype/shared/versions/hooks/handle-new-version.server.js +59 -31
- package/dist/core/prototype/shared/versions/hooks/index.server.d.ts +2 -4
- package/dist/core/prototype/shared/versions/hooks/index.server.js +2 -4
- package/dist/core/prototype/shared/versions/hooks/prevent-last-version-deletion.server.d.ts +4 -3
- package/dist/core/prototype/shared/versions/hooks/prevent-last-version-deletion.server.js +10 -4
- package/dist/core/prototype/shared/versions/module.server.js +2 -3
- package/dist/core/prototype/shared/versions/naming.d.ts +0 -4
- package/dist/core/prototype/shared/versions/naming.js +1 -5
- package/dist/core/prototype/shared/versions/retire-auto-saves.server.js +2 -3
- package/dist/core/prototype/shared/versions/strategy.d.ts +0 -2
- package/dist/core/prototype/shared/versions/strategy.js +1 -3
- package/dist/core/prototype/shared/versions/types.d.ts +3 -11
- package/dist/core/prototype/shared/versions/write-plan.d.ts +4 -6
- package/dist/core/prototype/shared/versions/write-plan.js +4 -6
- package/dist/core/prototype/types.d.ts +5 -9
- package/dist/core/prototype/when.js +3 -4
- package/dist/core/rime.server.d.ts +4 -13
- package/dist/core/rime.server.js +10 -46
- package/dist/core/routes/constants.d.ts +0 -4
- package/dist/core/routes/constants.js +4 -4
- package/dist/core/routes/context.server.d.ts +15 -3
- package/dist/core/routes/context.server.js +24 -6
- package/dist/core/routes/handler.server.d.ts +4 -5
- package/dist/core/routes/handler.server.js +14 -36
- package/dist/core/routes/panel-navigation.d.ts +5 -9
- package/dist/core/routes/panel-navigation.js +13 -21
- package/dist/core/routes/util.d.ts +3 -2
- package/dist/core/routes/util.js +6 -7
- package/dist/fields/blocks/component/AddBlockButton.svelte +1 -1
- package/dist/fields/blocks/component/Block.svelte +24 -17
- package/dist/fields/blocks/component/Block.svelte.d.ts +1 -1
- package/dist/fields/blocks/component/Blocks.svelte +11 -19
- package/dist/fields/blocks/component/Cell.svelte +4 -10
- package/dist/fields/blocks/component/Cell.svelte.d.ts +3 -4
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +12 -6
- package/dist/fields/blocks/component/focus/DefaultRender.svelte +1 -1
- package/dist/fields/blocks/component/focus/Inspector.svelte +3 -1
- package/dist/fields/blocks/component/focus/Layers.svelte +12 -26
- package/dist/fields/blocks/component/focus/Layers.svelte.d.ts +0 -2
- package/dist/fields/blocks/component/focus/LayersList.svelte +5 -1
- package/dist/fields/blocks/component/focus/Palette.svelte +5 -33
- package/dist/fields/blocks/component/focus/Palette.svelte.d.ts +0 -2
- package/dist/fields/blocks/component/focus/Renders.svelte +12 -4
- package/dist/fields/blocks/component/focus/StageAdd.svelte +1 -1
- package/dist/fields/blocks/component/focus/focus.svelte.d.ts +2 -13
- package/dist/fields/blocks/component/focus/focus.svelte.js +13 -23
- package/dist/fields/blocks/component/picker/BlockTile.svelte +2 -2
- package/dist/fields/blocks/component/picker/BlockTile.svelte.d.ts +1 -1
- package/dist/fields/blocks/index.d.ts +20 -28
- package/dist/fields/blocks/index.js +39 -41
- package/dist/fields/blocks/render.test-d.d.ts +1 -0
- package/dist/fields/blocks/render.test-d.js +6 -0
- package/dist/fields/checkbox/index.js +1 -1
- package/dist/fields/combobox/component/ComboBox.svelte +4 -2
- package/dist/fields/combobox/index.d.ts +1 -3
- package/dist/fields/combobox/index.js +1 -7
- package/dist/fields/component/index.d.ts +17 -0
- package/dist/fields/component/index.js +20 -1
- package/dist/fields/date/component/Cell.svelte +1 -1
- package/dist/fields/date/component/Date.svelte +3 -10
- package/dist/fields/date/index.d.ts +1 -3
- package/dist/fields/date/index.js +8 -7
- package/dist/fields/email/component/Email.svelte +1 -2
- package/dist/fields/email/component/props.d.ts +0 -1
- package/dist/fields/email/index.d.ts +2 -2
- package/dist/fields/email/index.js +4 -9
- package/dist/fields/group/component/Group.svelte +4 -6
- package/dist/fields/group/index.d.ts +3 -15
- package/dist/fields/group/index.js +4 -15
- package/dist/fields/link/component/Cell.svelte +1 -1
- package/dist/fields/link/component/Link.svelte +10 -6
- package/dist/fields/link/component/RessourceInput.svelte +5 -5
- package/dist/fields/link/component/RessourceInput.svelte.d.ts +1 -1
- package/dist/fields/link/index.d.ts +2 -54
- package/dist/fields/link/index.js +17 -20
- package/dist/fields/link/module.js +1 -0
- package/dist/fields/link/module.server.d.ts +12 -0
- package/dist/fields/link/module.server.js +44 -41
- package/dist/fields/link/types.d.ts +5 -0
- package/dist/fields/link/util.d.ts +12 -0
- package/dist/fields/link/util.js +16 -0
- package/dist/fields/number/component/Number.svelte +2 -2
- package/dist/fields/number/component/Number.svelte.d.ts +0 -1
- package/dist/fields/number/index.d.ts +1 -48
- package/dist/fields/number/index.js +13 -15
- package/dist/fields/radio/index.d.ts +1 -1
- package/dist/fields/radio/index.js +9 -8
- package/dist/fields/relation/component/Cell.svelte +3 -3
- package/dist/fields/relation/component/Relation.svelte +7 -10
- package/dist/fields/relation/component/RelationInline.svelte +30 -31
- package/dist/fields/relation/component/default/Default.svelte +2 -2
- package/dist/fields/relation/component/types.d.ts +0 -1
- package/dist/fields/relation/component/upload/Browse.svelte +38 -50
- package/dist/fields/relation/component/upload/Browse.svelte.d.ts +1 -1
- package/dist/fields/relation/component/upload/Upload.svelte +22 -39
- package/dist/fields/relation/component/upload/Upload.svelte.d.ts +1 -1
- package/dist/fields/relation/exists.server.d.ts +12 -0
- package/dist/fields/relation/exists.server.js +24 -0
- package/dist/fields/relation/fetch.d.ts +6 -4
- package/dist/fields/relation/fetch.js +13 -6
- package/dist/fields/relation/index.d.ts +6 -7
- package/dist/fields/relation/index.js +7 -11
- package/dist/fields/relation/populate.d.ts +4 -3
- package/dist/fields/relation/populate.js +8 -7
- package/dist/fields/relation/relation.d.ts +6 -2
- package/dist/fields/relation/relation.js +5 -3
- package/dist/fields/relation/value.d.ts +2 -1
- package/dist/fields/repeatable/DefaultLocaleButton.svelte +18 -0
- package/dist/fields/repeatable/DefaultLocaleButton.svelte.d.ts +7 -0
- package/dist/fields/repeatable/RepeatableActions.svelte +111 -0
- package/dist/fields/repeatable/RepeatableActions.svelte.d.ts +15 -0
- package/dist/fields/repeatable.d.ts +19 -0
- package/dist/fields/repeatable.js +56 -0
- package/dist/fields/rich-text/component/Cell.svelte +6 -3
- package/dist/fields/rich-text/component/RichText.svelte +1 -9
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +3 -1
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.svelte +9 -11
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.svelte +5 -9
- package/dist/fields/rich-text/component/context.svelte.d.ts +2 -10
- package/dist/fields/rich-text/component/context.svelte.js +1 -23
- package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte +10 -9
- package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte.d.ts +1 -4
- package/dist/fields/rich-text/component/styles/editor.css +5 -5
- package/dist/fields/rich-text/component/suggestion/suggestion.svelte +3 -11
- package/dist/fields/rich-text/core/build-editor-config.js +0 -1
- package/dist/fields/rich-text/core/content.d.ts +20 -0
- package/dist/fields/rich-text/core/content.js +29 -0
- package/dist/fields/rich-text/core/extensions/current-node/current-node.js +1 -3
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.d.ts +4 -16
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.js +18 -98
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.d.ts +1 -49
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +0 -50
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/dragHandler.js +1 -8
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/findNextElementFromCursor.js +2 -2
- package/dist/fields/rich-text/core/extensions/drag-handle/index.d.ts +0 -2
- package/dist/fields/rich-text/core/extensions/drag-handle/index.js +0 -2
- package/dist/fields/rich-text/core/features/blockquote.js +1 -1
- package/dist/fields/rich-text/core/features/bold.js +1 -2
- package/dist/fields/rich-text/core/features/bullet-list.js +1 -1
- package/dist/fields/rich-text/core/features/fields/extension.d.ts +0 -8
- package/dist/fields/rich-text/core/features/fields/extension.js +2 -14
- package/dist/fields/rich-text/core/features/fields/fields.svelte +5 -5
- package/dist/fields/rich-text/core/features/fields/fields.svelte.d.ts +2 -2
- package/dist/fields/rich-text/core/features/fields/index.js +7 -2
- package/dist/fields/rich-text/core/features/heading.d.ts +1 -0
- package/dist/fields/rich-text/core/features/heading.js +16 -9
- package/dist/fields/rich-text/core/features/hr/hr.js +2 -1
- package/dist/fields/rich-text/core/features/index.d.ts +0 -15
- package/dist/fields/rich-text/core/features/index.js +0 -12
- package/dist/fields/rich-text/core/features/italic.js +1 -1
- package/dist/fields/rich-text/core/features/json-attribute.d.ts +11 -0
- package/dist/fields/rich-text/core/features/json-attribute.js +29 -0
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +36 -58
- package/dist/fields/rich-text/core/features/link/index.js +2 -2
- package/dist/fields/rich-text/core/features/ordered-list.js +1 -1
- package/dist/fields/rich-text/core/features/paragraph.js +1 -1
- package/dist/fields/rich-text/core/features/pick-dialog.svelte +41 -0
- package/dist/fields/rich-text/core/features/pick-dialog.svelte.d.ts +33 -0
- package/dist/fields/rich-text/core/features/resource/index.js +1 -1
- package/dist/fields/rich-text/core/features/resource/resource.svelte +8 -23
- package/dist/fields/rich-text/core/features/upload/index.js +7 -2
- package/dist/fields/rich-text/core/features/upload/upload-extension.d.ts +0 -8
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +13 -16
- package/dist/fields/rich-text/core/features/upload/upload.svelte +10 -28
- package/dist/fields/rich-text/core/render-rich-text.svelte +18 -5
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte +38 -17
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte.d.ts +1 -1
- package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.d.ts +0 -1
- package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.js +1 -1
- package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte +1 -0
- package/dist/fields/rich-text/core/svelte/renderer.d.ts +5 -0
- package/dist/fields/rich-text/core/svelte/renderer.js +14 -3
- package/dist/fields/rich-text/core/types.d.ts +14 -12
- package/dist/fields/rich-text/index.d.ts +22 -15
- package/dist/fields/rich-text/index.js +81 -52
- package/dist/fields/rich-text/json.d.ts +2 -1
- package/dist/fields/rich-text/json.js +55 -23
- package/dist/fields/rich-text/module.d.ts +9 -0
- package/dist/fields/rich-text/module.js +7 -0
- package/dist/fields/rich-text/module.server.d.ts +28 -0
- package/dist/fields/rich-text/module.server.js +90 -0
- package/dist/fields/rich-text/reference-nodes.d.ts +55 -0
- package/dist/fields/rich-text/reference-nodes.js +68 -0
- package/dist/fields/rich-text/sanitize.d.ts +9 -1
- package/dist/fields/rich-text/sanitize.js +25 -25
- package/dist/fields/select/component/Select.svelte +2 -1
- package/dist/fields/select/index.d.ts +1 -5
- package/dist/fields/select/index.js +1 -6
- package/dist/fields/slug/component/Slug.svelte +2 -2
- package/dist/fields/slug/index.d.ts +3 -53
- package/dist/fields/slug/index.js +2 -15
- package/dist/fields/slug/module.d.ts +4 -0
- package/dist/fields/slug/module.js +2 -0
- package/dist/fields/slug/module.server.d.ts +12 -0
- package/dist/fields/slug/module.server.js +19 -0
- package/dist/fields/tabs/component/Tabs.svelte +12 -18
- package/dist/fields/tabs/index.d.ts +6 -0
- package/dist/fields/tabs/index.js +22 -2
- package/dist/fields/text/component/Text.svelte +1 -8
- package/dist/fields/text/component/TextInline.svelte +2 -3
- package/dist/fields/text/index.d.ts +2 -51
- package/dist/fields/text/index.js +4 -20
- package/dist/fields/text/module.d.ts +4 -0
- package/dist/fields/text/module.js +2 -0
- package/dist/fields/text/module.server.d.ts +12 -0
- package/dist/fields/text/module.server.js +19 -0
- package/dist/fields/textarea/component/TextArea.svelte +5 -6
- package/dist/fields/textarea/component/props.d.ts +1 -2
- package/dist/fields/textarea/index.d.ts +2 -49
- package/dist/fields/textarea/index.js +2 -20
- package/dist/fields/time/component/Time.svelte +1 -1
- package/dist/fields/time/index.d.ts +1 -3
- package/dist/fields/time/index.js +1 -6
- package/dist/fields/toggle/index.d.ts +1 -46
- package/dist/fields/toggle/index.js +0 -13
- package/dist/fields/tree/component/AddItemButton.svelte +3 -3
- package/dist/fields/tree/component/AddItemButton.svelte.d.ts +2 -2
- package/dist/fields/tree/component/Cell.svelte +10 -12
- package/dist/fields/tree/component/Cell.svelte.d.ts +6 -4
- package/dist/fields/tree/component/Tree.svelte +15 -17
- package/dist/fields/tree/component/TreeBlock.svelte +22 -21
- package/dist/fields/tree/index.js +12 -28
- package/dist/fields/tree/util.d.ts +23 -0
- package/dist/fields/tree/util.js +19 -0
- package/dist/fields/types.d.ts +15 -0
- package/dist/live/Consumer.svelte +9 -13
- package/dist/live/LiveEdit.svelte +2 -2
- package/dist/live/LiveEdit.svelte.d.ts +1 -1
- package/dist/live/context.svelte.d.ts +12 -11
- package/dist/live/context.svelte.js +51 -49
- package/dist/panel/components/Root.svelte +5 -5
- package/dist/panel/components/fields/Error.svelte +2 -17
- package/dist/panel/components/fields/FieldsPreview.svelte +2 -2
- package/dist/panel/components/fields/FieldsPreview.svelte.d.ts +1 -1
- package/dist/panel/components/fields/Hint.svelte +1 -1
- package/dist/panel/components/fields/Hint.svelte.d.ts +1 -1
- package/dist/panel/components/fields/Label.svelte +6 -8
- package/dist/panel/components/fields/RenderFields.svelte +18 -17
- package/dist/panel/components/fields/RenderFields.svelte.d.ts +3 -3
- package/dist/panel/components/fields/index.d.ts +3 -3
- package/dist/panel/components/sections/auth/AuthForm.svelte +2 -10
- package/dist/panel/components/sections/collection/Empty.svelte +1 -1
- package/dist/panel/components/sections/collection/Empty.svelte.d.ts +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +2 -1
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +2 -2
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte.d.ts +2 -2
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +13 -9
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +1 -1
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +3 -4
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +12 -8
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte.d.ts +2 -2
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +6 -12
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +1 -1
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte +3 -1
- package/dist/panel/components/sections/collection/header/FilterMenu.svelte +1 -1
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +1 -1
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +3 -1
- package/dist/panel/components/sections/collection/list/header/Header.svelte +4 -6
- package/dist/panel/components/sections/collection/list/header/Header.svelte.d.ts +17 -2
- package/dist/panel/components/sections/collection/list/row/Row.svelte +3 -2
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +6 -10
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte.d.ts +1 -1
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +10 -4
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +2 -2
- package/dist/panel/components/sections/commands/CommandButton.svelte +1 -1
- package/dist/panel/components/sections/commands/CommandPalette.svelte +8 -8
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +15 -9
- package/dist/panel/components/sections/document/AuthFooter.svelte +15 -22
- package/dist/panel/components/sections/document/AutoSaveBanner.svelte +4 -6
- package/dist/panel/components/sections/document/ButtonSave.svelte +5 -19
- package/dist/panel/components/sections/document/ButtonStatus.svelte +12 -15
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +2 -2
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/Document.svelte +16 -28
- package/dist/panel/components/sections/document/Document.svelte.d.ts +1 -2
- package/dist/panel/components/sections/document/DocumentChildren.svelte +4 -3
- package/dist/panel/components/sections/document/DocumentChildren.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/DocumentUrl.svelte +5 -3
- package/dist/panel/components/sections/document/DocumentUrl.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/Header.svelte +11 -9
- package/dist/panel/components/sections/document/Header.svelte.d.ts +3 -3
- package/dist/panel/components/sections/document/Settings.svelte +40 -24
- package/dist/panel/components/sections/document/Versions.svelte +8 -5
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +13 -21
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +6 -7
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte.d.ts +2 -2
- package/dist/panel/components/sections/document/versions-list.d.ts +3 -2
- package/dist/panel/components/sections/document/versions-list.js +3 -2
- package/dist/panel/components/sections/live/LiveEditPanel.svelte +1 -1
- package/dist/panel/components/sections/live/LiveEditPanel.svelte.d.ts +1 -1
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte +7 -2
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte.d.ts +1 -1
- package/dist/panel/components/sections/page-layout/Page.svelte +2 -14
- package/dist/panel/components/sections/page-layout/Page.svelte.d.ts +0 -1
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +7 -4
- package/dist/panel/components/ui/button/button.svelte +8 -2
- package/dist/panel/components/ui/button/index.d.ts +1 -1
- package/dist/panel/components/ui/button/index.js +1 -1
- package/dist/panel/components/ui/calendar/calendar-months.svelte +0 -6
- package/dist/panel/components/ui/calendar/calendar-next-button.svelte +2 -2
- package/dist/panel/components/ui/calendar/calendar-prev-button.svelte +2 -2
- package/dist/panel/components/ui/calendar/calendar.css +0 -3
- package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/panel/components/ui/card-resource/card-resource.svelte +11 -7
- package/dist/panel/components/ui/checkbox/checkbox.svelte +1 -1
- package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/panel/components/ui/checkbox/index.d.ts +1 -1
- package/dist/panel/components/ui/checkbox/index.js +1 -1
- package/dist/panel/components/ui/command/command-dialog.css +0 -38
- package/dist/panel/components/ui/command/command-empty.svelte +1 -1
- package/dist/panel/components/ui/command/command-group.css +0 -10
- package/dist/panel/components/ui/command/command-input-select.svelte +2 -2
- package/dist/panel/components/ui/command/command-input.svelte +2 -14
- package/dist/panel/components/ui/command/index.d.ts +1 -4
- package/dist/panel/components/ui/command/index.js +1 -16
- package/dist/panel/components/ui/context-menu/ContextMenu.svelte +4 -17
- package/dist/panel/components/ui/context-menu/ContextMenu.svelte.d.ts +2 -3
- package/dist/panel/components/ui/context-menu/context-menu.css +1 -1
- package/dist/panel/components/ui/dialog/dialog-content.css +0 -9
- package/dist/panel/components/ui/dialog/dialog-content.svelte +3 -3
- package/dist/panel/components/ui/dialog/dialog-content.svelte.d.ts +1 -1
- package/dist/panel/components/ui/dialog/index.d.ts +1 -3
- package/dist/panel/components/ui/dialog/index.js +1 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -3
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +1 -4
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/dist/panel/components/ui/dropdown-menu/index.js +1 -7
- package/dist/panel/components/ui/input/index.d.ts +1 -20
- package/dist/panel/components/ui/input/index.js +1 -1
- package/dist/panel/components/ui/input/input.svelte +0 -1
- package/dist/panel/components/ui/kbd/Kbd.svelte +9 -11
- package/dist/panel/components/ui/label/index.d.ts +1 -1
- package/dist/panel/components/ui/label/index.js +1 -1
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +9 -16
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte.d.ts +1 -0
- package/dist/panel/components/ui/nav/Nav.svelte +3 -2
- package/dist/panel/components/ui/nav/Nav.svelte.d.ts +1 -1
- package/dist/panel/components/ui/nav/NavGroup.svelte +8 -2
- package/dist/panel/components/ui/nav/NavGroup.svelte.d.ts +1 -1
- package/dist/panel/components/ui/nav/NavItem.svelte +3 -3
- package/dist/panel/components/ui/nav/NavItem.svelte.d.ts +1 -1
- package/dist/panel/components/ui/nav/UserButton.svelte +5 -2
- package/dist/panel/components/ui/page-header/PageHeader.svelte +36 -72
- package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +0 -4
- package/dist/panel/components/ui/popover/index.d.ts +1 -2
- package/dist/panel/components/ui/popover/index.js +1 -4
- package/dist/panel/components/ui/radio-group/index.d.ts +1 -1
- package/dist/panel/components/ui/radio-group/index.js +1 -3
- package/dist/panel/components/ui/radio-row-group/index.d.ts +1 -1
- package/dist/panel/components/ui/radio-row-group/index.js +1 -3
- package/dist/panel/components/ui/scroll-area/scroll-area-scrollbar.svelte +0 -2
- package/dist/panel/components/ui/scroll-area/scroll-area.svelte +3 -15
- package/dist/panel/components/ui/scroll-area/scroll-area.svelte.d.ts +2 -7
- package/dist/panel/components/ui/sheet/index.d.ts +1 -58
- package/dist/panel/components/ui/sheet/index.js +2 -59
- package/dist/panel/components/ui/sheet/sheet-content.svelte +1 -1
- package/dist/panel/components/ui/sheet/sheet-overlay.svelte +0 -2
- package/dist/panel/components/ui/sheet/sheet-overlay.svelte.d.ts +1 -3
- package/dist/panel/components/ui/sheet/sheet.css +0 -56
- package/dist/panel/components/ui/sonner/sonner.css +1 -0
- package/dist/panel/components/ui/spin-loader/SpinLoader.svelte +1 -1
- package/dist/panel/components/ui/switch/index.d.ts +1 -1
- package/dist/panel/components/ui/switch/index.js +1 -1
- package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
- package/dist/panel/components/ui/tabs/index.d.ts +1 -1
- package/dist/panel/components/ui/tabs/index.js +1 -5
- package/dist/panel/components/ui/tag/tag.svelte +5 -9
- package/dist/panel/components/ui/tooltip/index.js +1 -3
- package/dist/panel/components/ui/tooltip/tooltip-content.svelte +1 -0
- package/dist/panel/context/api-proxy.svelte.d.ts +1 -5
- package/dist/panel/context/api-proxy.svelte.js +13 -21
- package/dist/panel/context/blocks-ops.d.ts +53 -10
- package/dist/panel/context/blocks-ops.js +133 -21
- package/dist/panel/context/bulk-delete.d.ts +15 -0
- package/dist/panel/context/bulk-delete.js +14 -0
- package/dist/panel/context/collection.svelte.d.ts +9 -20
- package/dist/panel/context/collection.svelte.js +50 -101
- package/dist/panel/context/config.svelte.d.ts +1 -3
- package/dist/panel/context/config.svelte.js +0 -2
- package/dist/panel/context/documentForm.svelte.d.ts +4 -90
- package/dist/panel/context/documentForm.svelte.js +120 -156
- package/dist/panel/context/errors.svelte.d.ts +1 -14
- package/dist/panel/context/errors.svelte.js +2 -15
- package/dist/panel/context/form.svelte.d.ts +3 -56
- package/dist/panel/context/form.svelte.js +3 -23
- package/dist/panel/context/livePanel.svelte.d.ts +0 -1
- package/dist/panel/context/locale.svelte.js +6 -19
- package/dist/panel/context/nav.svelte.d.ts +0 -2
- package/dist/panel/context/nav.svelte.js +1 -1
- package/dist/panel/index.d.ts +0 -5
- package/dist/panel/pages/area/Area.svelte +2 -19
- package/dist/panel/pages/area/actions.server.js +12 -46
- package/dist/panel/pages/area/load.server.js +8 -12
- package/dist/panel/pages/aria.server.d.ts +7 -0
- package/dist/panel/pages/aria.server.js +6 -0
- package/dist/panel/pages/auth/fields.d.ts +7 -4
- package/dist/panel/pages/auth/fields.js +12 -5
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +4 -11
- package/dist/panel/pages/auth/forgot-password/load.server.d.ts +0 -1
- package/dist/panel/pages/auth/forgot-password/load.server.js +0 -1
- package/dist/panel/pages/auth/reset-password/ResetPassword.svelte +13 -14
- package/dist/panel/pages/auth/reset-password/load.server.d.ts +0 -1
- package/dist/panel/pages/auth/reset-password/load.server.js +1 -2
- package/dist/panel/pages/auth/sign-in/SignIn.svelte +23 -27
- package/dist/panel/pages/auth/sign-in/actions.server.js +4 -6
- package/dist/panel/pages/collection/Collection.svelte.d.ts +2 -3
- package/dist/panel/pages/collection/CollectionPage.svelte +94 -103
- package/dist/panel/pages/collection/CollectionPage.svelte.d.ts +3 -3
- package/dist/panel/pages/collection/load.server.d.ts +0 -3
- package/dist/panel/pages/collection/load.server.js +9 -23
- package/dist/panel/pages/collection-document/CollectionDocument.svelte +2 -24
- package/dist/panel/pages/collection-document/actions.server.js +23 -65
- package/dist/panel/pages/collection-document/load.server.d.ts +0 -3
- package/dist/panel/pages/collection-document/load.server.js +13 -28
- package/dist/panel/pages/dashboard/Dashboard.svelte +3 -3
- package/dist/panel/pages/dashboard/DashboardCollection.svelte +7 -11
- package/dist/panel/pages/dashboard/DashboardRow.svelte +13 -0
- package/dist/panel/pages/dashboard/load.server.js +2 -2
- package/dist/panel/pages/dashboard/types.d.ts +0 -2
- package/dist/panel/pages/live/Live.svelte +34 -65
- package/dist/panel/pages/live/Live.svelte.d.ts +2 -2
- package/dist/panel/pages/live/load.server.js +3 -4
- package/dist/panel/pages/shared/DocumentPage.svelte +26 -0
- package/dist/panel/pages/shared/DocumentPage.svelte.d.ts +9 -0
- package/dist/panel/pages/shared/save.server.d.ts +33 -0
- package/dist/panel/pages/shared/save.server.js +41 -0
- package/dist/panel/style/font.css +2 -2
- package/dist/panel/style/index.css +2 -2
- package/dist/panel/types.d.ts +0 -2
- package/dist/panel/util/Sortable.js +1 -2
- package/dist/panel/util/auth.js +2 -4
- package/dist/panel/util/dataError.js +0 -1
- package/dist/panel/util/dataFocused.js +0 -1
- package/dist/panel/util/error-text.d.ts +1 -0
- package/dist/panel/util/error-text.js +1 -0
- package/dist/panel/util/live.server.d.ts +3 -2
- package/dist/panel/util/live.server.js +3 -2
- package/dist/panel/util/locale-cookie.d.ts +10 -0
- package/dist/panel/util/locale-cookie.js +20 -0
- package/dist/panel/util/title.d.ts +12 -0
- package/dist/panel/util/title.js +18 -0
- package/dist/panel/util/upload-file.d.ts +0 -9
- package/dist/panel/util/upload-file.js +3 -2
- package/dist/panel/util/upload.js +4 -1
- package/dist/panel/util/uploader.svelte.d.ts +19 -0
- package/dist/panel/util/uploader.svelte.js +40 -0
- package/dist/panel/util/url.d.ts +38 -0
- package/dist/panel/util/url.js +44 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +2 -1
- package/dist/types.d.ts +1 -0
- package/dist/util/file.d.ts +18 -7
- package/dist/util/file.js +32 -20
- package/dist/util/form-data.d.ts +21 -0
- package/dist/util/form-data.js +38 -0
- package/dist/util/function.d.ts +1 -1
- package/dist/util/function.js +1 -1
- package/dist/util/index.d.ts +5 -5
- package/dist/util/index.js +5 -5
- package/dist/util/object.d.ts +1 -1
- package/dist/util/object.js +11 -15
- package/dist/util/random.d.ts +6 -3
- package/dist/util/random.js +9 -4
- package/dist/util/state.d.ts +4 -5
- package/dist/util/state.js +17 -42
- package/dist/util/string.d.ts +54 -18
- package/dist/util/string.js +75 -40
- package/dist/util/types.d.ts +1 -13
- package/dist/util/types.js +2 -36
- package/dist/util/url.d.ts +12 -0
- package/dist/util/url.js +13 -0
- package/package.json +36 -18
- package/dist/core/pipeline/hook-name.server.d.ts +0 -11
- package/dist/core/pipeline/hook-name.server.js +0 -14
- package/dist/core/pipeline/persist/blocks/diff.server.d.ts +0 -15
- package/dist/core/pipeline/persist/blocks/diff.server.js +0 -69
- package/dist/core/pipeline/persist/tree/diff.server.d.ts +0 -20
- package/dist/core/pipeline/persist/tree/diff.server.js +0 -51
- package/dist/core/prototype/index.d.ts +0 -14
- package/dist/core/prototype/index.js +0 -14
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.d.ts +0 -2
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.js +0 -8
- package/dist/core/routes/constants.server.d.ts +0 -5
- package/dist/core/routes/constants.server.js +0 -9
- package/dist/fields/blocks/component/BlockActions.svelte +0 -98
- package/dist/fields/blocks/component/BlockActions.svelte.d.ts +0 -10
- package/dist/fields/blocks/component/ToggleBlockButton.svelte +0 -20
- package/dist/fields/blocks/component/ToggleBlockButton.svelte.d.ts +0 -7
- package/dist/fields/number/component/number.css +0 -92
- package/dist/fields/relation/module.d.ts +0 -5
- package/dist/fields/relation/module.js +0 -4
- package/dist/fields/relation/module.server.d.ts +0 -5
- package/dist/fields/relation/module.server.js +0 -44
- package/dist/fields/tree/component/ToggleBlockButton.svelte +0 -20
- package/dist/fields/tree/component/ToggleBlockButton.svelte.d.ts +0 -7
- package/dist/fields/tree/component/TreeBlockActions.svelte +0 -87
- package/dist/fields/tree/component/TreeBlockActions.svelte.d.ts +0 -10
- package/dist/fields/tree/index.d.ts +0 -119
- package/dist/panel/components/sections/collection/folder/Folder.svelte +0 -73
- package/dist/panel/components/sections/collection/folder/Folder.svelte.d.ts +0 -7
- package/dist/panel/components/sections/unauthorized/Unauthorized.svelte +0 -30
- package/dist/panel/components/sections/unauthorized/Unauthorized.svelte.d.ts +0 -26
- package/dist/panel/components/ui/card/card-content.svelte +0 -26
- package/dist/panel/components/ui/card/card-content.svelte.d.ts +0 -6
- package/dist/panel/components/ui/card/card-description.svelte +0 -23
- package/dist/panel/components/ui/card/card-description.svelte.d.ts +0 -6
- package/dist/panel/components/ui/card/card-footer.svelte +0 -26
- package/dist/panel/components/ui/card/card-footer.svelte.d.ts +0 -6
- package/dist/panel/components/ui/card/card-header.svelte +0 -24
- package/dist/panel/components/ui/card/card-header.svelte.d.ts +0 -6
- package/dist/panel/components/ui/card/card-title.svelte +0 -33
- package/dist/panel/components/ui/card/card-title.svelte.d.ts +0 -10
- package/dist/panel/components/ui/card/card.svelte +0 -46
- package/dist/panel/components/ui/card/card.svelte.d.ts +0 -6
- package/dist/panel/components/ui/card/index.d.ts +0 -8
- package/dist/panel/components/ui/card/index.js +0 -9
- package/dist/panel/components/ui/card-document/card-document.svelte +0 -111
- package/dist/panel/components/ui/card-document/card-document.svelte.d.ts +0 -7
- package/dist/panel/components/ui/command/command-separator.css +0 -6
- package/dist/panel/components/ui/command/command-separator.svelte +0 -12
- package/dist/panel/components/ui/command/command-separator.svelte.d.ts +0 -5
- package/dist/panel/components/ui/dialog/dialog-description.css +0 -4
- package/dist/panel/components/ui/dialog/dialog-description.svelte +0 -12
- package/dist/panel/components/ui/dialog/dialog-description.svelte.d.ts +0 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -81
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +0 -8
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.css +0 -10
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -18
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +0 -8
- package/dist/panel/components/ui/kbd/index.d.ts +0 -1
- package/dist/panel/components/ui/kbd/index.js +0 -1
- package/dist/panel/components/ui/scroll-area/index.d.ts +0 -3
- package/dist/panel/components/ui/scroll-area/index.js +0 -5
- package/dist/panel/components/ui/separator/index.d.ts +0 -2
- package/dist/panel/components/ui/separator/index.js +0 -4
- package/dist/panel/components/ui/separator/separator.svelte +0 -34
- package/dist/panel/components/ui/separator/separator.svelte.d.ts +0 -4
- package/dist/panel/components/ui/sheet/sheet-description.svelte +0 -11
- package/dist/panel/components/ui/sheet/sheet-description.svelte.d.ts +0 -4
- package/dist/panel/components/ui/sheet/sheet-footer.svelte +0 -17
- package/dist/panel/components/ui/sheet/sheet-footer.svelte.d.ts +0 -6
- package/dist/panel/components/ui/sheet/sheet-header.svelte +0 -17
- package/dist/panel/components/ui/sheet/sheet-header.svelte.d.ts +0 -6
- package/dist/panel/components/ui/sheet/sheet-title.svelte +0 -11
- package/dist/panel/components/ui/sheet/sheet-title.svelte.d.ts +0 -4
- package/dist/panel/util/dataVisible.d.ts +0 -3
- package/dist/panel/util/dataVisible.js +0 -15
- package/dist/panel/util/disabled.d.ts +0 -3
- package/dist/panel/util/disabled.js +0 -15
- package/dist/util/coerce.d.ts +0 -12
- package/dist/util/coerce.js +0 -38
|
@@ -3,37 +3,6 @@ import type { OperationQuery } from '../core/pipeline/types.js';
|
|
|
3
3
|
import type { PrototypeSlug } from '../core/prototype/types.js';
|
|
4
4
|
import type { ConfigContext } from '../core/rime.server.js';
|
|
5
5
|
import type { Dic } from '../util/types.js';
|
|
6
|
-
import { type TableName } from './naming.server.js';
|
|
7
|
-
/**
|
|
8
|
-
* Writing a prototype's rows — insert, update, delete, and the bootstrap a singleton needs.
|
|
9
|
-
*
|
|
10
|
-
* The other half of `read.server.ts`; the vocabulary is written down there. `singleton` decides
|
|
11
|
-
* what `insert` and `delete` refuse outright, and which row an update resolves when it was handed
|
|
12
|
-
* no id.
|
|
13
|
-
*
|
|
14
|
-
* Two apparent differences between the collection and area facades this replaces turned out to be
|
|
15
|
-
* nothing: an area's update reset every content row's status with no `where` while a collection
|
|
16
|
-
* scoped it to `ownerId = id` — the same set for a single row; and a collection split off its
|
|
17
|
-
* `$root()` fields before writing while an area did not — `splitRootData` returns an empty half
|
|
18
|
-
* when a config marks none. Both are core's now, and this is handed both halves.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Writes a row and, when it has localized columns, its `__$$locales` half.
|
|
22
|
-
*
|
|
23
|
-
* Every insert goes through here, a document's and a singleton's bootstrap alike.
|
|
24
|
-
*
|
|
25
|
-
* Returns the id actually written, which insertTableRecord derives from `row.id` or generates.
|
|
26
|
-
*/
|
|
27
|
-
export declare const insertRowWithLocales: ({ db, tables }: Deps, args: {
|
|
28
|
-
table: TableName;
|
|
29
|
-
row: Dic;
|
|
30
|
-
now: Date;
|
|
31
|
-
localized: {
|
|
32
|
-
data: Dic;
|
|
33
|
-
isLocalized: boolean;
|
|
34
|
-
locale?: string;
|
|
35
|
-
};
|
|
36
|
-
}) => Promise<string>;
|
|
37
6
|
type UpdateArgs = {
|
|
38
7
|
slug: string;
|
|
39
8
|
versions?: VersionsTable;
|
|
@@ -60,21 +29,20 @@ type Deps = {
|
|
|
60
29
|
* The content row's *table* is still the adapter's to know: registration carries the versions table, and
|
|
61
30
|
* where rows live is storage. Which row, and whether to touch it, is the caller's.
|
|
62
31
|
*
|
|
63
|
-
* Returns `{ id
|
|
64
|
-
*
|
|
65
|
-
* of silently picking the id of the row that was written.
|
|
32
|
+
* Returns `{ id }`, the row it wrote. An `id` in `data` neither moves that row nor changes the
|
|
33
|
+
* answer.
|
|
66
34
|
*/
|
|
67
35
|
export declare const updatePrototype: ({ db, tables }: Deps, { slug, id, data, content, locale, versions }: UpdateArgs) => Promise<{
|
|
68
|
-
id:
|
|
36
|
+
id: string;
|
|
69
37
|
}>;
|
|
70
38
|
/**
|
|
71
39
|
* Sets columns on every row of this prototype's own table that `query` matches.
|
|
72
40
|
*
|
|
73
41
|
* A primitive: a table, a filter, a patch. It writes exactly the columns it is given — no
|
|
74
42
|
* `updatedAt`, no children — because the callers that want a bulk column write want the rows left
|
|
75
|
-
* otherwise alone. Its
|
|
76
|
-
* and
|
|
77
|
-
* would
|
|
43
|
+
* otherwise alone. Its callers demote a document's other content rows, flag an autosave and
|
|
44
|
+
* write the edit lock, and none may move `updatedAt`: versions are pruned by it, so touching it
|
|
45
|
+
* here would re-order which rows survive.
|
|
78
46
|
*
|
|
79
47
|
* With `locale`, a localized column lands on the `__$$locales` branch instead — resolved by
|
|
80
48
|
* `prepareSchemaData`, the same split every other write goes through, so a caller says "set this
|
|
@@ -103,23 +71,10 @@ export declare const insertPrototype: ({ db, tables }: Deps, { slug, data, conte
|
|
|
103
71
|
id: string;
|
|
104
72
|
contentId: string;
|
|
105
73
|
}>;
|
|
106
|
-
/**
|
|
107
|
-
* Reads many documents, merged with the content row each should show.
|
|
108
|
-
*
|
|
109
|
-
* The versioned branch queries the base table and pulls one content row per document, because
|
|
110
|
-
* pagination and ordering are properties of the document rather than of one of its rows.
|
|
111
|
-
*/
|
|
112
74
|
export declare const deletePrototype: ({ db, tables }: Deps, { slug, id }: {
|
|
113
75
|
slug: string;
|
|
114
76
|
id: string;
|
|
115
77
|
}) => Promise<string | undefined>;
|
|
116
|
-
/**
|
|
117
|
-
* The ids of the documents whose `_parent` is `parentId`, in `_position` order.
|
|
118
|
-
*
|
|
119
|
-
* Cannot go through `findMany`: hierarchy lives on the base table while a versioned prototype's
|
|
120
|
-
* `where` resolves against the content table. `_parent` and `_position` are columns the adapter
|
|
121
|
-
* writes itself, so answering this is its job.
|
|
122
|
-
*/
|
|
123
78
|
/**
|
|
124
79
|
* Brings a singleton's row into being if it is not already there. Boot only.
|
|
125
80
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeQuery } from '../core/pipeline/query.js';
|
|
2
|
+
import { omit } from '../util/object.js';
|
|
2
3
|
import { and, eq, inArray } from 'drizzle-orm';
|
|
3
4
|
import { RimeError } from '../core/errors/index.js';
|
|
4
5
|
import { baseTableName, tableName } from './naming.server.js';
|
|
@@ -7,24 +8,17 @@ import { buildWhereParam } from './where.server.js';
|
|
|
7
8
|
/**
|
|
8
9
|
* Writing a prototype's rows — insert, update, delete, and the bootstrap a singleton needs.
|
|
9
10
|
*
|
|
10
|
-
* The other half of `read.server.ts`; the vocabulary is written down there.
|
|
11
|
-
* what `insert` and `delete` refuse outright, and which row an update resolves when it was handed
|
|
12
|
-
* no id.
|
|
13
|
-
*
|
|
14
|
-
* Two apparent differences between the collection and area facades this replaces turned out to be
|
|
15
|
-
* nothing: an area's update reset every content row's status with no `where` while a collection
|
|
16
|
-
* scoped it to `ownerId = id` — the same set for a single row; and a collection split off its
|
|
17
|
-
* `$root()` fields before writing while an area did not — `splitRootData` returns an empty half
|
|
18
|
-
* when a config marks none. Both are core's now, and this is handed both halves.
|
|
11
|
+
* The other half of `read.server.ts`; the vocabulary is written down there.
|
|
19
12
|
*/
|
|
20
13
|
/**
|
|
21
14
|
* Writes a row and, when it has localized columns, its `__$$locales` half.
|
|
22
15
|
*
|
|
23
|
-
* Every
|
|
16
|
+
* Every content row goes through here. A versioned config's base row is written with
|
|
17
|
+
* `insertTableRecord` directly.
|
|
24
18
|
*
|
|
25
19
|
* Returns the id actually written, which insertTableRecord derives from `row.id` or generates.
|
|
26
20
|
*/
|
|
27
|
-
|
|
21
|
+
const insertRowWithLocales = async ({ db, tables }, args) => {
|
|
28
22
|
const id = await adapterUtil.insertTableRecord(db, tables, args.table, {
|
|
29
23
|
...args.row,
|
|
30
24
|
createdAt: args.now,
|
|
@@ -37,7 +31,7 @@ export const insertRowWithLocales = async ({ db, tables }, args) => {
|
|
|
37
31
|
const written = Object.entries(data).some(([key, value]) => key !== 'id' && value !== null && value !== undefined);
|
|
38
32
|
if (isLocalized && written) {
|
|
39
33
|
await adapterUtil.insertTableRecord(db, tables, tableName({ owner: args.table, branch: 'locales' }), {
|
|
40
|
-
...data,
|
|
34
|
+
...omit(['id'], data),
|
|
41
35
|
ownerId: id,
|
|
42
36
|
locale: locale
|
|
43
37
|
});
|
|
@@ -52,9 +46,8 @@ export const insertRowWithLocales = async ({ db, tables }, args) => {
|
|
|
52
46
|
* The content row's *table* is still the adapter's to know: registration carries the versions table, and
|
|
53
47
|
* where rows live is storage. Which row, and whether to touch it, is the caller's.
|
|
54
48
|
*
|
|
55
|
-
* Returns `{ id
|
|
56
|
-
*
|
|
57
|
-
* of silently picking the id of the row that was written.
|
|
49
|
+
* Returns `{ id }`, the row it wrote. An `id` in `data` neither moves that row nor changes the
|
|
50
|
+
* answer.
|
|
58
51
|
*/
|
|
59
52
|
export const updatePrototype = async ({ db, tables }, { slug, id, data, content, locale, versions }) => {
|
|
60
53
|
const now = new Date();
|
|
@@ -70,18 +63,14 @@ export const updatePrototype = async ({ db, tables }, { slug, id, data, content,
|
|
|
70
63
|
now
|
|
71
64
|
});
|
|
72
65
|
}
|
|
73
|
-
return { id
|
|
66
|
+
return { id };
|
|
74
67
|
};
|
|
75
68
|
/** One row and its locales, which is what both halves of an update come down to. */
|
|
76
69
|
const writeRow = async ({ db, tables }, args) => {
|
|
77
70
|
const { table, recordId, data, locale, now } = args;
|
|
78
71
|
const localesTable = tableName({ owner: table, branch: 'locales' });
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
mainTableName: table,
|
|
82
|
-
localesTableName: localesTable,
|
|
83
|
-
locale
|
|
84
|
-
});
|
|
72
|
+
// The row is addressed by `recordId`: an `id` or `ownerId` in the data would move it.
|
|
73
|
+
const { mainData, localizedData, isLocalized } = adapterUtil.prepareSchemaData(omit(['id', 'ownerId'], data), { tables, mainTableName: table, localesTableName: localesTable, locale });
|
|
85
74
|
await adapterUtil.updateTableRecord(db, tables, table, {
|
|
86
75
|
recordId,
|
|
87
76
|
data: { ...mainData, updatedAt: now }
|
|
@@ -99,9 +88,9 @@ const writeRow = async ({ db, tables }, args) => {
|
|
|
99
88
|
*
|
|
100
89
|
* A primitive: a table, a filter, a patch. It writes exactly the columns it is given — no
|
|
101
90
|
* `updatedAt`, no children — because the callers that want a bulk column write want the rows left
|
|
102
|
-
* otherwise alone. Its
|
|
103
|
-
* and
|
|
104
|
-
* would
|
|
91
|
+
* otherwise alone. Its callers demote a document's other content rows, flag an autosave and
|
|
92
|
+
* write the edit lock, and none may move `updatedAt`: versions are pruned by it, so touching it
|
|
93
|
+
* here would re-order which rows survive.
|
|
105
94
|
*
|
|
106
95
|
* With `locale`, a localized column lands on the `__$$locales` branch instead — resolved by
|
|
107
96
|
* `prepareSchemaData`, the same split every other write goes through, so a caller says "set this
|
|
@@ -113,7 +102,18 @@ const writeRow = async ({ db, tables }, args) => {
|
|
|
113
102
|
export const updateWherePrototype = async ({ db, tables, configCtx }, { slug, query, data, locale }) => {
|
|
114
103
|
const table = baseTableName(slug);
|
|
115
104
|
const localesTable = tableName({ owner: table, branch: 'locales' });
|
|
116
|
-
const where = buildWhereParam({
|
|
105
|
+
const where = buildWhereParam({
|
|
106
|
+
query: normalizeQuery(query),
|
|
107
|
+
slug,
|
|
108
|
+
locale,
|
|
109
|
+
db,
|
|
110
|
+
tables,
|
|
111
|
+
configCtx
|
|
112
|
+
});
|
|
113
|
+
// `false` (an empty and/or) or nothing at all would reach drizzle as "no WHERE": every row
|
|
114
|
+
if (!where) {
|
|
115
|
+
throw new RimeError(RimeError.OPERATION_ERROR, `refusing to update every row of "${slug}"`);
|
|
116
|
+
}
|
|
117
117
|
const { mainData, localizedData, isLocalized } = adapterUtil.prepareSchemaData(data, {
|
|
118
118
|
tables,
|
|
119
119
|
mainTableName: table,
|
|
@@ -126,10 +126,8 @@ export const updateWherePrototype = async ({ db, tables, configCtx }, { slug, qu
|
|
|
126
126
|
if (isLocalized && Object.keys(localizedData).length) {
|
|
127
127
|
// The branch is keyed by its owner, so the rows to touch are the ones this filter matched.
|
|
128
128
|
//
|
|
129
|
-
// An update, never an upsert
|
|
130
|
-
//
|
|
131
|
-
// locales row written ahead of the real one is how the multilingual duplicate tests started
|
|
132
|
-
// failing when this was first written as an upsert.
|
|
129
|
+
// An update, never an upsert: `upsertLocalizedData` would insert a locales row for a document
|
|
130
|
+
// that has none yet, and a caller runs during reads.
|
|
133
131
|
const owners = await db.select({ id: tables[table].id }).from(tables[table]).where(where);
|
|
134
132
|
const ownerIds = owners.map((owner) => owner.id);
|
|
135
133
|
if (ownerIds.length) {
|
|
@@ -173,7 +171,7 @@ export const insertPrototype = async ({ db, tables }, { slug, data, content, loc
|
|
|
173
171
|
});
|
|
174
172
|
const contentId = await insertRowWithLocales({ db, tables }, {
|
|
175
173
|
table: contentTable,
|
|
176
|
-
row: { id: adapterUtil.generatePK(), ownerId: docId
|
|
174
|
+
row: { ...mainData, id: adapterUtil.generatePK(), ownerId: docId },
|
|
177
175
|
now,
|
|
178
176
|
localized: { data: localizedData, isLocalized, locale }
|
|
179
177
|
});
|
|
@@ -197,12 +195,6 @@ export const insertPrototype = async ({ db, tables }, { slug, data, content, loc
|
|
|
197
195
|
// No versions: the content is on the base row, so that is the row children hang off.
|
|
198
196
|
return { id: docId, contentId: docId };
|
|
199
197
|
};
|
|
200
|
-
/**
|
|
201
|
-
* Reads many documents, merged with the content row each should show.
|
|
202
|
-
*
|
|
203
|
-
* The versioned branch queries the base table and pulls one content row per document, because
|
|
204
|
-
* pagination and ordering are properties of the document rather than of one of its rows.
|
|
205
|
-
*/
|
|
206
198
|
export const deletePrototype = async ({ db, tables }, { slug, id }) => {
|
|
207
199
|
const table = tables[baseTableName(slug)];
|
|
208
200
|
const docs = await db.delete(table).where(eq(table.id, id)).returning();
|
|
@@ -210,13 +202,6 @@ export const deletePrototype = async ({ db, tables }, { slug, id }) => {
|
|
|
210
202
|
throw new RimeError(RimeError.NOT_FOUND);
|
|
211
203
|
return docs[0].id;
|
|
212
204
|
};
|
|
213
|
-
/**
|
|
214
|
-
* The ids of the documents whose `_parent` is `parentId`, in `_position` order.
|
|
215
|
-
*
|
|
216
|
-
* Cannot go through `findMany`: hierarchy lives on the base table while a versioned prototype's
|
|
217
|
-
* `where` resolves against the content table. `_parent` and `_position` are columns the adapter
|
|
218
|
-
* writes itself, so answering this is its job.
|
|
219
|
-
*/
|
|
220
205
|
/**
|
|
221
206
|
* Brings a singleton's row into being if it is not already there. Boot only.
|
|
222
207
|
*
|
|
@@ -246,7 +231,7 @@ export const ensurePrototypeExists = async ({ db, tables }, { slug, initial, loc
|
|
|
246
231
|
});
|
|
247
232
|
const contentId = await insertRowWithLocales({ db, tables }, {
|
|
248
233
|
table: contentTable,
|
|
249
|
-
row: { ownerId: docId
|
|
234
|
+
row: { ...mainData, ownerId: docId },
|
|
250
235
|
now,
|
|
251
236
|
localized: { data: localizedData, isLocalized, locale }
|
|
252
237
|
});
|
package/dist/core/adapter.d.ts
CHANGED
|
@@ -3,19 +3,43 @@ import type { OperationQuery } from './pipeline/types.js';
|
|
|
3
3
|
import type { GenericBlock, PrototypeSlug, RawDoc, TreeBlock } from './prototype/types.js';
|
|
4
4
|
import type { BeforeOperationRelation, RelationRow } from '../fields/relation/index.js';
|
|
5
5
|
import type { Dic, WithOptional, WithRequired } from '../util/types.js';
|
|
6
|
+
/**
|
|
7
|
+
* What an adapter does to a project outside a request. `$adapter.hooks` carries them; `rime init`,
|
|
8
|
+
* which runs before a config exists, and `rime clear`, which loads none, import them from `module`.
|
|
9
|
+
*/
|
|
10
|
+
export type AdapterHooks = {
|
|
11
|
+
/** The module these hooks are imported from: `'rimecms/adapter-sqlite/hooks'`. */
|
|
12
|
+
module: string;
|
|
13
|
+
/** `rime init`: writes the adapter's files, and answers what the starter config and the install need. */
|
|
14
|
+
init(args: {
|
|
15
|
+
name: string;
|
|
16
|
+
bun: boolean;
|
|
17
|
+
}): Promise<AdapterInit>;
|
|
18
|
+
/** Dev boot, before codegen: the adapter's files are in place, or it throws saying what to run. */
|
|
19
|
+
boot(): Promise<void>;
|
|
20
|
+
/** `rime clear`: removes the adapter's files, and answers which it removed. */
|
|
21
|
+
clear(): Promise<string[]>;
|
|
22
|
+
};
|
|
23
|
+
export type AdapterInit = {
|
|
24
|
+
/** The `$adapter` of the starter config `rime init` writes when there is none. */
|
|
25
|
+
config: {
|
|
26
|
+
import: string;
|
|
27
|
+
call: string;
|
|
28
|
+
};
|
|
29
|
+
/** Installed with rime's own packages, unless `--skip-install`. */
|
|
30
|
+
dependencies: string[];
|
|
31
|
+
devDependencies: string[];
|
|
32
|
+
};
|
|
6
33
|
/**
|
|
7
34
|
* What core requires of a database adapter.
|
|
8
35
|
*
|
|
9
|
-
* Written here, in core's vocabulary, rather than read off an implementation: an interface
|
|
10
|
-
* inferred from what one adapter returns is not something a second adapter can conform to.
|
|
11
|
-
*
|
|
12
36
|
* The rule that decides what may appear below: **every argument and return type is something core
|
|
13
37
|
* can name**. Slugs, documents, blocks, relations, queries, locales. No tables, no columns, no
|
|
14
38
|
* drizzle. A method that cannot be phrased that way is work on the wrong side of the line — a
|
|
15
39
|
* parameter like `parentSlug: TableName`, naming a slug and carrying a table, is the tell.
|
|
16
40
|
*
|
|
17
|
-
* The escape hatch is deliberately **not** here. `rime.adapter.db` is
|
|
18
|
-
*
|
|
41
|
+
* The escape hatch is deliberately **not** here. `rime.adapter.db` is for consumers who need to
|
|
42
|
+
* drop to SQL; core must not use it.
|
|
19
43
|
* See `SqliteAdapter` in adapter-sqlite/index.server.ts for the full concrete surface.
|
|
20
44
|
*/
|
|
21
45
|
export interface Adapter {
|
|
@@ -132,9 +156,7 @@ export interface CollectionHandle extends BaseHandle {
|
|
|
132
156
|
* Narrows which content row this read means, for a config that has one. The newest when
|
|
133
157
|
* omitted, which is what "the content of this document" means with nothing else said.
|
|
134
158
|
*
|
|
135
|
-
*
|
|
136
|
-
* against `config.versions.draft`; the caller decodes them now (`versionsReadQuery`) and hands
|
|
137
|
-
* down a filter, so the adapter applies one rather than choosing one.
|
|
159
|
+
* The caller builds this filter (`versionsReadQuery`); the adapter applies it.
|
|
138
160
|
*/
|
|
139
161
|
content?: OperationQuery;
|
|
140
162
|
}): Promise<RawDoc | undefined>;
|
|
@@ -165,10 +187,8 @@ export interface CollectionHandle extends BaseHandle {
|
|
|
165
187
|
* Writes the rows a write plan names: the document's own row always, and the content row when
|
|
166
188
|
* the caller names one.
|
|
167
189
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* `versionsWritePlan` refines it — so the adapter executes a plan rather than decoding an enum
|
|
171
|
-
* into three branches.
|
|
190
|
+
* The caller decides which rows this write touches: `pipeline/run.server.ts` builds the plan and
|
|
191
|
+
* `versionsWritePlan` refines it. The adapter executes the plan.
|
|
172
192
|
*/
|
|
173
193
|
update(args: {
|
|
174
194
|
id: string;
|
|
@@ -227,9 +247,9 @@ export interface AreaHandle extends BaseHandle {
|
|
|
227
247
|
} | null>;
|
|
228
248
|
}
|
|
229
249
|
/**
|
|
230
|
-
* `parentSlug` is the slug that owns the children
|
|
231
|
-
*
|
|
232
|
-
*
|
|
250
|
+
* `parentSlug` is the slug that owns the children: the prototype's versions slug
|
|
251
|
+
* (`config._versions.slug`) when it has one, its own slug otherwise. `pipeline/run.server.ts`
|
|
252
|
+
* resolves it.
|
|
233
253
|
*/
|
|
234
254
|
export interface BlocksHandle {
|
|
235
255
|
create(args: {
|
|
@@ -290,12 +310,19 @@ export interface RelationsHandle {
|
|
|
290
310
|
ownerId: string;
|
|
291
311
|
locale?: string;
|
|
292
312
|
}): Promise<RelationRow[]>;
|
|
313
|
+
/** The ids, among these, that name no document of `relationTo`. */
|
|
314
|
+
missing(args: {
|
|
315
|
+
relationTo: PrototypeSlug;
|
|
316
|
+
ids: string[];
|
|
317
|
+
}): Promise<string[]>;
|
|
293
318
|
}
|
|
294
319
|
/**
|
|
295
|
-
* A page's address in one locale, as a
|
|
320
|
+
* A page's address in one locale, as a config with `$url` stores it. An area's row holds its slug,
|
|
321
|
+
* with no parent.
|
|
296
322
|
*
|
|
297
323
|
* ```
|
|
298
324
|
* { ownerId: 'web', locale: 'en', slug: 'web', path: 'services/web', url: 'https://site.test/en/services/web' }
|
|
325
|
+
* { ownerId: 'i1', locale: 'en', slug: 'infos', path: 'infos', url: 'https://site.test/en/about' }
|
|
299
326
|
* ```
|
|
300
327
|
*
|
|
301
328
|
* `locale` is `''` when the config has no localization. `path` is the slugs from the top page down
|
|
@@ -309,7 +336,8 @@ export type PathRow = {
|
|
|
309
336
|
url: string | null;
|
|
310
337
|
};
|
|
311
338
|
/**
|
|
312
|
-
* The addresses of a collection's pages. Every verb names one page; the pages
|
|
339
|
+
* The addresses of a collection's pages, and of an area. Every verb names one page; the pages
|
|
340
|
+
* under it follow.
|
|
313
341
|
*/
|
|
314
342
|
export interface PathsHandle {
|
|
315
343
|
/** One row per locale for a new page, under its parent's row in each locale. */
|
|
@@ -456,7 +484,8 @@ export interface TableHandle {
|
|
|
456
484
|
* `removeUser` all sit behind `adminMiddleware`, and every caller runs where no admin session
|
|
457
485
|
* exists: `hasAuthUser` gates the init route, which only runs when there is no user at all;
|
|
458
486
|
* `setAuthUserRole` promotes the first signup; and `deleteAuthUser` rolls back a failed one,
|
|
459
|
-
* which `removeUser` refuses outright with `YOU_CANNOT_REMOVE_YOURSELF`.
|
|
487
|
+
* which `removeUser` refuses outright with `YOU_CANNOT_REMOVE_YOURSELF`. After an auth document
|
|
488
|
+
* is deleted, `deleteAuthUser` and `deleteAuthApiKey` remove its twin whoever the caller is.
|
|
460
489
|
*/
|
|
461
490
|
export interface AuthHandle {
|
|
462
491
|
/** The Better-auth database adapter. Opaque to core, which only hands it to Better-auth. */
|
|
@@ -479,13 +508,11 @@ export type WritePlan = {
|
|
|
479
508
|
/**
|
|
480
509
|
* A versions table, as the feature that owns it describes it.
|
|
481
510
|
*
|
|
482
|
-
* Only `slug
|
|
483
|
-
* exactly the mistake this declaration replaces. The read selector and the owner column join it
|
|
484
|
-
* when there is something reading them.
|
|
511
|
+
* Only `slug`: it is what the schema needs.
|
|
485
512
|
*/
|
|
486
513
|
export type VersionsTable = {
|
|
487
514
|
/**
|
|
488
|
-
* The versions's own slug — `$pages__versions`. In slug space, never a table name: what a slug
|
|
515
|
+
* The versions table's own slug — `$pages__versions`. In slug space, never a table name: what a slug
|
|
489
516
|
* is called in the database is the adapter's business, and it maps.
|
|
490
517
|
*/
|
|
491
518
|
slug: string;
|
|
@@ -493,10 +520,8 @@ export type VersionsTable = {
|
|
|
493
520
|
/**
|
|
494
521
|
* What a column holds.
|
|
495
522
|
*
|
|
496
|
-
* Six values
|
|
497
|
-
*
|
|
498
|
-
* rather than one because they are two storage formats — epoch seconds and epoch milliseconds —
|
|
499
|
-
* and better-auth's own tables use both.
|
|
523
|
+
* Six values. `timestamp` and `timestampMs` are two entries because they are two storage formats,
|
|
524
|
+
* epoch seconds and epoch milliseconds, and better-auth's own tables use both.
|
|
500
525
|
*/
|
|
501
526
|
export type ColumnType = 'text' | 'integer' | 'real' | 'boolean' | 'timestamp' | 'timestampMs' | 'json';
|
|
502
527
|
export type ColumnDeclaration = {
|
|
@@ -509,9 +534,9 @@ export type ColumnDeclaration = {
|
|
|
509
534
|
/** Written into the schema as the column's `DEFAULT`, so only a literal. */
|
|
510
535
|
defaultValue?: string | number | boolean;
|
|
511
536
|
/**
|
|
512
|
-
* A foreign key
|
|
537
|
+
* A foreign key onto a declared table, named by its slug (`$authUsers`).
|
|
513
538
|
*
|
|
514
|
-
* `column` defaults to `id` and `onDelete` to `cascade
|
|
539
|
+
* `column` defaults to `id` and `onDelete` to `cascade`.
|
|
515
540
|
* A declaration may point at its own `table`: a directory's parent is a directory, which is the
|
|
516
541
|
* one shape a prototype's own fields never produce.
|
|
517
542
|
*/
|
|
@@ -13,12 +13,7 @@ export declare const isAdmin: (user?: User) => boolean;
|
|
|
13
13
|
* Checks if a user is from the staff collection.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
*
|
|
17
|
-
* // isStaff: true
|
|
18
|
-
* // ...
|
|
19
|
-
* // }
|
|
20
|
-
* isStaff(user) // true
|
|
21
|
-
*
|
|
16
|
+
* isStaff({ isStaff: true, ... }) // true
|
|
22
17
|
*/
|
|
23
18
|
export declare const isStaff: (user?: User) => boolean;
|
|
24
19
|
/**
|
|
@@ -31,17 +26,6 @@ export declare const isStaff: (user?: User) => boolean;
|
|
|
31
26
|
* }
|
|
32
27
|
*/
|
|
33
28
|
export declare const hasRoles: (user?: User, ...roles: string[]) => boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Checks if a user is an admin or matches the specified ID.
|
|
36
|
-
* Useful for operations that should be allowed for admins or the user themselves.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Check if user can edit a profile (either as admin or as the profile owner)
|
|
40
|
-
* if (isAdminOrMe(currentUser, profileId)) {
|
|
41
|
-
* // Allow profile editing
|
|
42
|
-
* }
|
|
43
|
-
*/
|
|
44
|
-
export declare const isAdminOrMe: (user?: User, id?: string) => boolean;
|
|
45
29
|
/**
|
|
46
30
|
* Checks if a user's ID matches the specified ID.
|
|
47
31
|
* Used for operations that should only be allowed for the user themselves.
|
|
@@ -54,9 +38,17 @@ export declare const isAdminOrMe: (user?: User, id?: string) => boolean;
|
|
|
54
38
|
*/
|
|
55
39
|
export declare const isMe: (user?: User, id?: string) => boolean;
|
|
56
40
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
41
|
+
* Checks if a user is an admin or matches the specified ID.
|
|
42
|
+
* Useful for operations that should be allowed for admins or the user themselves.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Check if user can edit a profile (either as admin or as the profile owner)
|
|
46
|
+
* if (isAdminOrMe(currentUser, profileId)) {
|
|
47
|
+
* // Allow profile editing
|
|
48
|
+
* }
|
|
59
49
|
*/
|
|
50
|
+
export declare const isAdminOrMe: (user?: User, id?: string) => boolean;
|
|
51
|
+
/** The access helpers, as `rimecms/util` publishes them. */
|
|
60
52
|
export declare const access: {
|
|
61
53
|
isAdmin: (user?: User) => boolean;
|
|
62
54
|
hasRoles: (user?: User, ...roles: string[]) => boolean;
|
|
@@ -64,10 +56,3 @@ export declare const access: {
|
|
|
64
56
|
isMe: (user?: User, id?: string) => boolean;
|
|
65
57
|
isStaff: (user?: User) => boolean;
|
|
66
58
|
};
|
|
67
|
-
declare const _default: {
|
|
68
|
-
isAdmin: (user?: User) => boolean;
|
|
69
|
-
hasRoles: (user?: User, ...roles: string[]) => boolean;
|
|
70
|
-
isAdminOrMe: (user?: User, id?: string) => boolean;
|
|
71
|
-
isMe: (user?: User, id?: string) => boolean;
|
|
72
|
-
};
|
|
73
|
-
export default _default;
|
package/dist/core/auth/access.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ROLES } from './constant.js';
|
|
1
2
|
/**
|
|
2
3
|
* Checks if a user has admin privileges.
|
|
3
4
|
*
|
|
@@ -7,17 +8,12 @@
|
|
|
7
8
|
* // Perform admin-only operations
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
|
-
export const isAdmin = (user) => !!user && hasRoles(user,
|
|
11
|
+
export const isAdmin = (user) => !!user && hasRoles(user, ROLES.ADMIN);
|
|
11
12
|
/**
|
|
12
13
|
* Checks if a user is from the staff collection.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
|
-
*
|
|
16
|
-
* // isStaff: true
|
|
17
|
-
* // ...
|
|
18
|
-
* // }
|
|
19
|
-
* isStaff(user) // true
|
|
20
|
-
*
|
|
16
|
+
* isStaff({ isStaff: true, ... }) // true
|
|
21
17
|
*/
|
|
22
18
|
export const isStaff = (user) => !!user && !!user.isStaff;
|
|
23
19
|
/**
|
|
@@ -30,19 +26,6 @@ export const isStaff = (user) => !!user && !!user.isStaff;
|
|
|
30
26
|
* }
|
|
31
27
|
*/
|
|
32
28
|
export const hasRoles = (user, ...roles) => !!user && user.roles.some((role) => roles.includes(role));
|
|
33
|
-
/**
|
|
34
|
-
* Checks if a user is an admin or matches the specified ID.
|
|
35
|
-
* Useful for operations that should be allowed for admins or the user themselves.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* // Check if user can edit a profile (either as admin or as the profile owner)
|
|
39
|
-
* if (isAdminOrMe(currentUser, profileId)) {
|
|
40
|
-
* // Allow profile editing
|
|
41
|
-
* }
|
|
42
|
-
*/
|
|
43
|
-
export const isAdminOrMe = (user, id) => {
|
|
44
|
-
return isAdmin(user) || user?.id === id;
|
|
45
|
-
};
|
|
46
29
|
/**
|
|
47
30
|
* Checks if a user's ID matches the specified ID.
|
|
48
31
|
* Used for operations that should only be allowed for the user themselves.
|
|
@@ -57,8 +40,15 @@ export const isMe = (user, id) => {
|
|
|
57
40
|
return !!(user && id === user.id);
|
|
58
41
|
};
|
|
59
42
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
43
|
+
* Checks if a user is an admin or matches the specified ID.
|
|
44
|
+
* Useful for operations that should be allowed for admins or the user themselves.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Check if user can edit a profile (either as admin or as the profile owner)
|
|
48
|
+
* if (isAdminOrMe(currentUser, profileId)) {
|
|
49
|
+
* // Allow profile editing
|
|
50
|
+
* }
|
|
62
51
|
*/
|
|
52
|
+
export const isAdminOrMe = (user, id) => isAdmin(user) || isMe(user, id);
|
|
53
|
+
/** The access helpers, as `rimecms/util` publishes them. */
|
|
63
54
|
export const access = { isAdmin, hasRoles, isAdminOrMe, isMe, isStaff };
|
|
64
|
-
export default { isAdmin, hasRoles, isAdminOrMe, isMe };
|
|
@@ -9,10 +9,9 @@ export type WithNormalizedAuth<T> = Omit<T, 'auth'> & {
|
|
|
9
9
|
auth?: CollectionAuthConfig;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
15
|
-
* - check roles fields
|
|
12
|
+
* Augments an auth collection: normalizes `config.auth`, adds the `name`, `email` and `roles`
|
|
13
|
+
* fields (`apiKeyId` and `ownerId` instead of `email` for api-key auth), and sets
|
|
14
|
+
* `_titleFallback`. Throws when no default role remains.
|
|
16
15
|
*/
|
|
17
16
|
export declare const augmentAuth: <T extends Input>(config: T) => WithNormalizedAuth<T>;
|
|
18
|
-
export {
|
|
17
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ROLES, STAFF_SLUG } from './constant.js';
|
|
1
2
|
import { access } from './access.js';
|
|
2
3
|
import { email } from '../../fields/email/index.js';
|
|
3
4
|
import { select } from '../../fields/select/index.js';
|
|
@@ -35,26 +36,19 @@ const withNormalizedAuth = (config) => {
|
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
-
* -
|
|
40
|
-
*
|
|
41
|
-
* - check roles fields
|
|
39
|
+
* Augments an auth collection: normalizes `config.auth`, adds the `name`, `email` and `roles`
|
|
40
|
+
* fields (`apiKeyId` and `ownerId` instead of `email` for api-key auth), and sets
|
|
41
|
+
* `_titleFallback`. Throws when no default role remains.
|
|
42
42
|
*/
|
|
43
43
|
export const augmentAuth = (config) => {
|
|
44
44
|
const normalizedAuthConfig = withNormalizedAuth(config);
|
|
45
|
-
if (!normalizedAuthConfig.auth)
|
|
46
|
-
return normalizedAuthConfig;
|
|
47
45
|
// Augment Fields
|
|
48
|
-
const IS_STAFF_COLLECTION = normalizedAuthConfig.slug ===
|
|
46
|
+
const IS_STAFF_COLLECTION = normalizedAuthConfig.slug === STAFF_SLUG;
|
|
49
47
|
const IS_GENERIC_COLLECTION = !IS_STAFF_COLLECTION;
|
|
50
48
|
const IS_API_AUTH = normalizedAuthConfig.auth.type === 'apiKey';
|
|
51
|
-
const roles = [...(normalizedAuthConfig.auth.roles || [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
normalizedRoles = IS_GENERIC_COLLECTION
|
|
55
|
-
? normalizedRoles.filter((role) => role.value !== 'admin')
|
|
56
|
-
: normalizedRoles;
|
|
57
|
-
const defaultRole = normalizedRoles.filter((r) => r.value !== 'admin')[0];
|
|
49
|
+
const roles = [...(normalizedAuthConfig.auth.roles || [ROLES.USER])];
|
|
50
|
+
const normalizedRoles = roles.map((r) => (typeof r === 'string' ? { value: r } : r));
|
|
51
|
+
const defaultRole = normalizedRoles.filter((r) => r.value !== ROLES.ADMIN)[0];
|
|
58
52
|
if (!defaultRole) {
|
|
59
53
|
throw Error('Missing default role');
|
|
60
54
|
}
|
|
@@ -69,7 +63,7 @@ export const augmentAuth = (config) => {
|
|
|
69
63
|
rolesField.access({
|
|
70
64
|
create: () => true,
|
|
71
65
|
read: (user) => !!user,
|
|
72
|
-
update: (user) =>
|
|
66
|
+
update: (user) => access.isStaff(user)
|
|
73
67
|
});
|
|
74
68
|
}
|
|
75
69
|
else {
|
|
@@ -100,12 +94,8 @@ export const augmentAuth = (config) => {
|
|
|
100
94
|
.access({ update: () => false });
|
|
101
95
|
fields.push(ownerIdField);
|
|
102
96
|
}
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
// precedence registry order gives: upload is listed after auth.
|
|
97
|
+
// Names an auth document by `email`, or by `name` for api-key auth. `augmentUpload` runs later
|
|
98
|
+
// and overrides it.
|
|
106
99
|
const _titleFallback = IS_API_AUTH ? 'name' : 'email';
|
|
107
100
|
return { ...normalizedAuthConfig, fields, _titleFallback };
|
|
108
101
|
};
|
|
109
|
-
// The staff collection every config gets. Client-side it goes first (the panel lists it
|
|
110
|
-
// first), server-side last — the one thing the two halves genuinely disagree on.
|
|
111
|
-
export { configureStaff } from './staff/configure.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { STAFF_SLUG } from './constant.js';
|
|
1
2
|
import { FormFieldBuilder } from '../fields/builders/form-field-builder.js';
|
|
2
3
|
import { augmentAuth as augmentAuthBase } from './augment.js';
|
|
3
4
|
export const augmentAuth = (config) => {
|
|
@@ -11,7 +12,7 @@ export const augmentAuth = (config) => {
|
|
|
11
12
|
function addSchemaStaffReferenceForAPIKeys() {
|
|
12
13
|
(collection.fields || []).forEach((field) => {
|
|
13
14
|
if (field instanceof FormFieldBuilder && field.name === 'ownerId') {
|
|
14
|
-
field.$references(
|
|
15
|
+
field.$references(STAFF_SLUG, { onDelete: 'cascade' });
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
return collection;
|