rimecms 1.3.0 → 1.4.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/collection.server.js +2 -1
- package/dist/adapter-sqlite/columns.server.d.ts +42 -61
- package/dist/adapter-sqlite/columns.server.js +50 -111
- package/dist/adapter-sqlite/generate-schema/column.server.d.ts +8 -6
- package/dist/adapter-sqlite/generate-schema/column.server.js +13 -49
- package/dist/adapter-sqlite/generate-schema/index.server.d.ts +1 -0
- package/dist/adapter-sqlite/generate-schema/index.server.js +6 -0
- package/dist/adapter-sqlite/generate-schema/relations/junction.server.d.ts +3 -3
- package/dist/adapter-sqlite/generate-schema/relations/junction.server.js +3 -3
- package/dist/adapter-sqlite/generate-schema/root.server.d.ts +4 -0
- package/dist/adapter-sqlite/generate-schema/root.server.js +26 -33
- package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +0 -22
- package/dist/adapter-sqlite/generate-schema/templates.server.js +0 -33
- package/dist/adapter-sqlite/generate-schema/write.server.d.ts +6 -0
- package/dist/adapter-sqlite/generate-schema/write.server.js +6 -0
- package/dist/adapter-sqlite/index.server.js +5 -0
- package/dist/adapter-sqlite/locales.server.js +1 -4
- package/dist/adapter-sqlite/order-by.server.d.ts +6 -0
- package/dist/adapter-sqlite/order-by.server.js +6 -0
- package/dist/adapter-sqlite/read.server.d.ts +12 -1
- package/dist/adapter-sqlite/read.server.js +94 -38
- package/dist/adapter-sqlite/registry.server.d.ts +2 -2
- package/dist/adapter-sqlite/registry.server.js +2 -2
- package/dist/adapter-sqlite/relations.server.d.ts +5 -0
- package/dist/adapter-sqlite/relations.server.js +27 -7
- package/dist/adapter-sqlite/repeatable.server.d.ts +4 -1
- package/dist/adapter-sqlite/repeatable.server.js +4 -1
- package/dist/adapter-sqlite/select.server.d.ts +6 -0
- package/dist/adapter-sqlite/select.server.js +56 -113
- package/dist/adapter-sqlite/table.server.js +7 -0
- package/dist/adapter-sqlite/transform.server.js +8 -2
- package/dist/adapter-sqlite/where.server.d.ts +11 -0
- package/dist/adapter-sqlite/where.server.js +237 -236
- package/dist/adapter-sqlite/write.server.d.ts +5 -0
- package/dist/adapter-sqlite/write.server.js +9 -7
- package/dist/core/adapter.d.ts +36 -12
- package/dist/core/auth/access.d.ts +3 -5
- package/dist/core/auth/access.js +3 -5
- package/dist/core/auth/augment.js +3 -4
- package/dist/core/auth/augment.server.d.ts +4 -0
- package/dist/core/auth/augment.server.js +4 -0
- package/dist/core/auth/better-auth/config.server.d.ts +24 -16
- package/dist/core/auth/better-auth/config.server.js +6 -0
- package/dist/core/auth/better-auth/hooks.server.js +17 -5
- package/dist/core/auth/better-auth/instance.server.d.ts +38 -32
- package/dist/core/auth/better-auth/permissions.d.ts +8 -7
- package/dist/core/auth/better-auth/permissions.js +1 -0
- package/dist/core/auth/better-auth-tables.server.d.ts +5 -6
- package/dist/core/auth/better-auth-tables.server.js +5 -6
- package/dist/core/auth/constant.d.ts +3 -3
- package/dist/core/auth/constant.js +3 -3
- package/dist/core/auth/constant.server.d.ts +3 -3
- package/dist/core/auth/constant.server.js +3 -3
- package/dist/core/auth/handler/index.server.js +2 -6
- package/dist/core/auth/hooks/create-better-auth-user.server.d.ts +4 -2
- package/dist/core/auth/hooks/create-better-auth-user.server.js +132 -185
- package/dist/core/auth/hooks/forward-roles.server.d.ts +2 -1
- package/dist/core/auth/hooks/forward-roles.server.js +3 -3
- package/dist/core/auth/hooks/populate-api-key.server.d.ts +2 -2
- package/dist/core/auth/hooks/populate-api-key.server.js +11 -3
- package/dist/core/auth/hooks/prevent-user-mutations.server.d.ts +2 -2
- package/dist/core/auth/hooks/prevent-user-mutations.server.js +5 -4
- package/dist/core/auth/hooks/sign-in-new-user.server.d.ts +5 -6
- package/dist/core/auth/hooks/sign-in-new-user.server.js +5 -6
- package/dist/core/auth/staff/derive.d.ts +10 -0
- package/dist/core/auth/staff/derive.js +10 -0
- package/dist/core/auth/tables.d.ts +4 -0
- package/dist/core/auth/tables.js +4 -0
- package/dist/core/auth/types.d.ts +10 -5
- package/dist/core/auth/validate-config.d.ts +1 -3
- package/dist/core/auth/validate-config.js +2 -4
- package/dist/core/boot.server.d.ts +38 -32
- package/dist/core/codegen.server.js +8 -2
- package/dist/core/config/build.d.ts +1 -1
- package/dist/core/config/build.server.d.ts +2 -1
- package/dist/core/config/build.server.js +1 -0
- package/dist/core/config/context.server.d.ts +3 -9
- package/dist/core/config/context.server.js +3 -9
- package/dist/core/config/index.server.d.ts +4 -2
- package/dist/core/config/index.server.js +4 -2
- package/dist/core/config/types.d.ts +13 -4
- package/dist/core/config/validate.server.d.ts +4 -0
- package/dist/core/config/validate.server.js +100 -90
- package/dist/core/constants.d.ts +13 -5
- package/dist/core/constants.js +13 -5
- package/dist/core/constants.server.d.ts +7 -0
- package/dist/core/constants.server.js +7 -0
- package/dist/core/dev/cache.server.d.ts +10 -7
- package/dist/core/dev/cache.server.js +10 -11
- package/dist/core/dev/cli/commands/build.d.ts +5 -0
- package/dist/core/dev/cli/commands/build.js +17 -2
- package/dist/core/dev/cli/commands/clear.server.d.ts +1 -0
- package/dist/core/dev/cli/commands/clear.server.js +3 -2
- package/dist/core/dev/cli/commands/generate-exports.server.js +25 -4
- package/dist/core/dev/cli/commands/generate.server.d.ts +5 -0
- package/dist/core/dev/cli/commands/generate.server.js +7 -8
- package/dist/core/dev/cli/commands/init.server.d.ts +7 -0
- package/dist/core/dev/cli/commands/init.server.js +34 -7
- package/dist/core/dev/cli/index.js +16 -14
- package/dist/core/dev/cli/templates/build.d.ts +4 -0
- package/dist/core/dev/cli/templates/build.js +4 -0
- package/dist/core/dev/cli/templates/init.d.ts +2 -1
- package/dist/core/dev/cli/templates/init.js +17 -9
- package/dist/core/dev/cli/util/package-manager.server.d.ts +6 -1
- package/dist/core/dev/cli/util/package-manager.server.js +14 -10
- package/dist/core/dev/cli/util/package.server.d.ts +1 -0
- package/dist/core/dev/cli/util/package.server.js +2 -2
- package/dist/core/dev/cli/util/project-name.d.ts +2 -1
- package/dist/core/dev/cli/util/project-name.js +6 -4
- package/dist/core/dev/cli/util/prompt.server.d.ts +2 -1
- package/dist/core/dev/cli/util/prompt.server.js +2 -1
- package/dist/core/dev/codegen/routes/common.server.d.ts +12 -0
- package/dist/core/dev/codegen/routes/common.server.js +9 -17
- package/dist/core/dev/codegen/routes/custom-css.server.d.ts +3 -9
- package/dist/core/dev/codegen/routes/custom-css.server.js +8 -34
- package/dist/core/dev/codegen/routes/index.server.d.ts +4 -5
- package/dist/core/dev/codegen/routes/index.server.js +33 -17
- package/dist/core/dev/codegen/routes/util.server.d.ts +13 -23
- package/dist/core/dev/codegen/routes/util.server.js +15 -25
- package/dist/core/dev/codegen/runtime/index.server.d.ts +2 -3
- package/dist/core/dev/codegen/runtime/index.server.js +2 -3
- package/dist/core/dev/codegen/runtime/parse-exports.server.js +10 -3
- package/dist/core/dev/codegen/sanitize/index.server.d.ts +11 -1
- package/dist/core/dev/codegen/sanitize/index.server.js +81 -50
- package/dist/core/dev/codegen/types/index.server.d.ts +2 -4
- package/dist/core/dev/codegen/types/index.server.js +6 -10
- package/dist/core/dev/codegen/types/templates.server.d.ts +4 -2
- package/dist/core/dev/codegen/types/templates.server.js +13 -26
- package/dist/core/dev/config-memo.server.js +6 -7
- package/dist/core/dev/constants.server.d.ts +4 -2
- package/dist/core/dev/constants.server.js +7 -4
- package/dist/core/dev/ensure.server.d.ts +5 -0
- package/dist/core/dev/ensure.server.js +11 -6
- package/dist/core/dev/env.server.d.ts +3 -1
- package/dist/core/dev/env.server.js +3 -1
- package/dist/core/dev/vite.server.d.ts +10 -0
- package/dist/core/dev/vite.server.js +13 -1
- package/dist/core/errors/handler.server.d.ts +9 -3
- package/dist/core/errors/handler.server.js +11 -6
- package/dist/core/errors/index.d.ts +21 -1
- package/dist/core/errors/index.js +23 -3
- package/dist/core/fields/builders/boolean-builder.d.ts +4 -0
- package/dist/core/fields/builders/boolean-builder.js +6 -1
- package/dist/core/fields/builders/field-builder.d.ts +16 -4
- package/dist/core/fields/builders/field-builder.js +11 -0
- package/dist/core/fields/builders/form-field-builder.d.ts +46 -2
- package/dist/core/fields/builders/form-field-builder.js +47 -2
- package/dist/core/fields/builders/index.d.ts +0 -2
- package/dist/core/fields/builders/index.js +0 -2
- package/dist/core/fields/builders/select-builder.d.ts +13 -2
- package/dist/core/fields/builders/select-builder.js +13 -1
- package/dist/core/fields/initial.d.ts +4 -1
- package/dist/core/fields/types.d.ts +5 -6
- package/dist/core/fields/util.d.ts +9 -14
- package/dist/core/fields/util.js +10 -15
- package/dist/core/fields/validate.d.ts +3 -0
- package/dist/core/fields/validate.js +3 -0
- package/dist/core/fields/walk.d.ts +4 -1
- package/dist/core/fields/walk.js +1 -2
- package/dist/core/handler.server.d.ts +5 -0
- package/dist/core/handler.server.js +15 -1
- package/dist/core/i18n/en/common.d.ts +28 -0
- package/dist/core/i18n/en/common.js +28 -0
- package/dist/core/i18n/en/errors.d.ts +6 -0
- package/dist/core/i18n/en/errors.js +6 -0
- package/dist/core/i18n/en/fields.d.ts +11 -0
- package/dist/core/i18n/en/fields.js +12 -1
- package/dist/core/i18n/fr/common.d.ts +28 -0
- package/dist/core/i18n/fr/common.js +29 -0
- package/dist/core/i18n/fr/errors.d.ts +6 -0
- package/dist/core/i18n/fr/errors.js +6 -0
- package/dist/core/i18n/fr/fields.d.ts +11 -0
- package/dist/core/i18n/fr/fields.js +12 -1
- package/dist/core/i18n/index.d.ts +1 -0
- package/dist/core/i18n/index.js +7 -0
- package/dist/core/i18n/register.server.js +1 -1
- package/dist/core/locale/types.d.ts +2 -6
- package/dist/core/logger.server.js +8 -2
- package/dist/core/panel/configure.js +2 -2
- package/dist/core/panel/types.d.ts +4 -2
- package/dist/core/pipeline/build-document.server.d.ts +2 -2
- package/dist/core/pipeline/build-document.server.js +2 -2
- package/dist/core/pipeline/build.server.js +2 -12
- package/dist/core/{prototype/shared/versions/hooks → pipeline}/fallback-data-from-original.d.ts +6 -6
- package/dist/core/{prototype/shared/versions/hooks → pipeline}/fallback-data-from-original.js +5 -5
- package/dist/core/pipeline/hooks/original-config-map.server.d.ts +3 -2
- package/dist/core/pipeline/hooks/original-config-map.server.js +3 -2
- package/dist/core/pipeline/hooks/process-document-fields.server.d.ts +2 -1
- package/dist/core/pipeline/hooks/process-document-fields.server.js +4 -9
- package/dist/core/pipeline/hooks/sort-document-props.server.js +4 -3
- package/dist/core/pipeline/hooks/validate-fields.server.d.ts +15 -1
- package/dist/core/pipeline/hooks/validate-fields.server.js +142 -47
- package/dist/core/pipeline/persist/blocks/extract.server.d.ts +5 -0
- package/dist/core/pipeline/persist/blocks/extract.server.js +5 -0
- package/dist/core/pipeline/persist/blocks/index.server.d.ts +3 -7
- package/dist/core/pipeline/persist/blocks/index.server.js +3 -8
- package/dist/core/pipeline/persist/relations/diff.server.js +1 -0
- package/dist/core/pipeline/persist/relations/extract.server.d.ts +1 -0
- package/dist/core/pipeline/persist/relations/extract.server.js +2 -0
- package/dist/core/pipeline/persist/relations/index.server.d.ts +6 -0
- package/dist/core/pipeline/persist/relations/index.server.js +31 -8
- package/dist/core/pipeline/persist/repeatable.server.d.ts +21 -12
- package/dist/core/pipeline/persist/repeatable.server.js +28 -4
- package/dist/core/pipeline/persist/tree/extract.server.d.ts +5 -0
- package/dist/core/pipeline/persist/tree/extract.server.js +6 -8
- package/dist/core/pipeline/persist/tree/index.server.d.ts +5 -0
- package/dist/core/pipeline/persist/tree/index.server.js +5 -0
- package/dist/core/pipeline/populate-relations.server.d.ts +1 -0
- package/dist/core/pipeline/populate-relations.server.js +1 -0
- package/dist/core/pipeline/run.server.d.ts +26 -17
- package/dist/core/pipeline/run.server.js +51 -9
- package/dist/core/pipeline/types.d.ts +30 -7
- package/dist/core/pipeline/without-denied-fields.d.ts +15 -0
- package/dist/core/pipeline/without-denied-fields.js +53 -2
- package/dist/core/plugins/api-init/index.server.d.ts +8 -0
- package/dist/core/plugins/api-init/index.server.js +8 -0
- package/dist/core/plugins/cache/HeaderButton.svelte +15 -6
- package/dist/core/plugins/cache/cache.server.d.ts +9 -0
- package/dist/core/plugins/cache/cache.server.js +9 -0
- package/dist/core/plugins/cache/handler.server.d.ts +5 -0
- package/dist/core/plugins/cache/handler.server.js +5 -0
- package/dist/core/plugins/cache/module.server.d.ts +4 -19
- package/dist/core/plugins/cache/module.server.js +5 -1
- package/dist/core/plugins/cache/types.d.ts +6 -0
- package/dist/core/plugins/index.d.ts +1 -0
- package/dist/core/plugins/index.js +1 -0
- package/dist/core/plugins/mailer/index.server.d.ts +5 -2
- package/dist/core/plugins/mailer/index.server.js +4 -0
- package/dist/core/plugins/plugins.server.d.ts +1 -0
- package/dist/core/plugins/plugins.server.js +1 -0
- package/dist/core/plugins/sse/client.js +4 -0
- package/dist/core/prototype/area/definition.server.d.ts +2 -3
- package/dist/core/prototype/area/definition.server.js +2 -3
- package/dist/core/prototype/area/operations/find.d.ts +5 -0
- package/dist/core/prototype/area/operations/find.js +5 -0
- package/dist/core/prototype/area/rest/endpoint.server.d.ts +3 -3
- package/dist/core/prototype/area/rest/endpoint.server.js +3 -3
- package/dist/core/prototype/area/rest/get.server.d.ts +2 -1
- package/dist/core/prototype/area/rest/get.server.js +2 -1
- package/dist/core/prototype/area/rest/update.server.d.ts +2 -1
- package/dist/core/prototype/area/rest/update.server.js +2 -1
- package/dist/core/prototype/collection/api.server.d.ts +15 -1
- package/dist/core/prototype/collection/api.server.js +16 -0
- package/dist/core/prototype/collection/augment-label.d.ts +9 -0
- package/dist/core/prototype/collection/augment-label.js +9 -0
- package/dist/core/prototype/collection/definition.d.ts +1 -1
- package/dist/core/prototype/collection/definition.js +1 -1
- package/dist/core/prototype/collection/hooks/merge-with-initial.server.d.ts +3 -3
- package/dist/core/prototype/collection/hooks/merge-with-initial.server.js +3 -3
- package/dist/core/prototype/collection/hooks.server.d.ts +2 -6
- package/dist/core/prototype/collection/hooks.server.js +8 -9
- package/dist/core/prototype/collection/nested/hooks/add-children.server.d.ts +3 -1
- package/dist/core/prototype/collection/nested/hooks/add-children.server.js +19 -11
- package/dist/core/prototype/collection/nested/hooks/index.server.d.ts +1 -0
- package/dist/core/prototype/collection/nested/hooks/index.server.js +1 -0
- package/dist/core/prototype/collection/nested/hooks/place-at-end.server.d.ts +10 -0
- package/dist/core/prototype/collection/nested/hooks/place-at-end.server.js +24 -0
- package/dist/core/prototype/collection/nested/move.server.d.ts +35 -0
- package/dist/core/prototype/collection/nested/move.server.js +74 -0
- package/dist/core/prototype/collection/operations/count.d.ts +19 -0
- package/dist/core/prototype/collection/operations/count.js +23 -0
- package/dist/core/prototype/collection/operations/create.d.ts +16 -0
- package/dist/core/prototype/collection/operations/create.js +46 -26
- package/dist/core/prototype/collection/operations/delete-by-id.d.ts +5 -0
- package/dist/core/prototype/collection/operations/delete-by-id.js +5 -0
- package/dist/core/prototype/collection/operations/delete.d.ts +8 -0
- package/dist/core/prototype/collection/operations/delete.js +8 -0
- package/dist/core/prototype/collection/operations/duplicate.d.ts +8 -0
- package/dist/core/prototype/collection/operations/duplicate.js +12 -0
- package/dist/core/prototype/collection/operations/find-by-id.d.ts +5 -0
- package/dist/core/prototype/collection/operations/find-by-id.js +5 -0
- package/dist/core/prototype/collection/operations/find.d.ts +6 -1
- package/dist/core/prototype/collection/operations/find.js +7 -2
- package/dist/core/prototype/collection/rest/count.server.d.ts +5 -0
- package/dist/core/prototype/collection/rest/count.server.js +12 -0
- package/dist/core/prototype/collection/rest/create.server.d.ts +2 -1
- package/dist/core/prototype/collection/rest/create.server.js +2 -1
- package/dist/core/prototype/collection/rest/delete-by-id.server.d.ts +1 -3
- package/dist/core/prototype/collection/rest/delete-by-id.server.js +1 -3
- package/dist/core/prototype/collection/rest/get-by-id.server.d.ts +2 -1
- package/dist/core/prototype/collection/rest/get-by-id.server.js +2 -1
- package/dist/core/prototype/collection/rest/get.server.d.ts +2 -1
- package/dist/core/prototype/collection/rest/get.server.js +2 -1
- package/dist/core/prototype/collection/rest/index.server.js +5 -0
- package/dist/core/prototype/collection/rest/lock.server.js +0 -5
- package/dist/core/prototype/collection/rest/move.server.d.ts +11 -0
- package/dist/core/prototype/collection/rest/move.server.js +34 -0
- package/dist/core/prototype/collection/rest/update-by-id.server.d.ts +3 -1
- package/dist/core/prototype/collection/rest/update-by-id.server.js +3 -1
- package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +17 -9
- package/dist/core/prototype/collection/upload/boot/index.server.d.ts +3 -5
- package/dist/core/prototype/collection/upload/boot/index.server.js +3 -5
- package/dist/core/prototype/collection/upload/directories/configure.server.js +1 -2
- package/dist/core/prototype/collection/upload/directories/create.server.d.ts +15 -0
- package/dist/core/prototype/collection/upload/directories/create.server.js +19 -0
- package/dist/core/prototype/collection/upload/directories/derive.js +2 -2
- package/dist/core/prototype/collection/upload/directories/pipeline.server.js +5 -4
- package/dist/core/prototype/collection/upload/disk/save.server.d.ts +9 -5
- package/dist/core/prototype/collection/upload/disk/save.server.js +19 -6
- package/dist/core/prototype/collection/upload/ensure.server.d.ts +2 -7
- package/dist/core/prototype/collection/upload/ensure.server.js +2 -7
- package/dist/core/prototype/collection/upload/handler.server.d.ts +4 -0
- package/dist/core/prototype/collection/upload/handler.server.js +13 -4
- package/dist/core/prototype/collection/upload/hooks/convert-base64.server.d.ts +3 -10
- package/dist/core/prototype/collection/upload/hooks/convert-base64.server.js +5 -18
- package/dist/core/prototype/collection/upload/hooks/delete-folder-contents.server.d.ts +10 -0
- package/dist/core/prototype/collection/upload/hooks/delete-folder-contents.server.js +30 -0
- package/dist/core/prototype/collection/upload/hooks/extract-path.server.d.ts +1 -1
- package/dist/core/prototype/collection/upload/hooks/extract-path.server.js +1 -1
- package/dist/core/prototype/collection/upload/hooks/handle-path-creation.server.js +8 -20
- package/dist/core/prototype/collection/upload/hooks/index.server.d.ts +2 -5
- package/dist/core/prototype/collection/upload/hooks/index.server.js +2 -5
- package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.d.ts +4 -2
- package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.js +18 -19
- package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.d.ts +3 -1
- package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.js +16 -3
- package/dist/core/prototype/collection/upload/hooks/update-directory-children.server.js +3 -2
- package/dist/core/prototype/collection/upload/module.d.ts +4 -2
- package/dist/core/prototype/collection/upload/module.js +12 -17
- package/dist/core/prototype/collection/upload/module.server.d.ts +3 -4
- package/dist/core/prototype/collection/upload/module.server.js +3 -4
- package/dist/core/prototype/collection/upload/types.d.ts +21 -6
- package/dist/core/prototype/collection/upload/util/client.d.ts +2 -2
- package/dist/core/prototype/collection/upload/util/client.js +2 -2
- package/dist/core/prototype/collection/upload/util/config.d.ts +1 -0
- package/dist/core/prototype/collection/upload/util/converter.server.d.ts +5 -0
- package/dist/core/prototype/collection/upload/util/converter.server.js +16 -24
- package/dist/core/prototype/collection/upload/util/mime.d.ts +60 -0
- package/dist/core/prototype/collection/upload/util/mime.js +94 -4
- package/dist/core/prototype/collection/upload/util/path.d.ts +5 -1
- package/dist/core/prototype/collection/upload/util/path.js +9 -12
- package/dist/core/prototype/define.d.ts +14 -0
- package/dist/core/prototype/define.js +14 -0
- package/dist/core/prototype/shared/title/find-title.js +1 -0
- package/dist/core/prototype/shared/title/select.d.ts +2 -2
- package/dist/core/prototype/shared/title/select.js +2 -2
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.js +2 -3
- package/dist/core/prototype/shared/versions/augment.js +8 -4
- package/dist/core/prototype/shared/versions/hooks/handle-new-version.server.js +6 -2
- package/dist/core/prototype/shared/versions/validate-config.server.js +1 -2
- package/dist/core/prototype/types.d.ts +0 -5
- package/dist/core/rime.server.d.ts +3 -2
- package/dist/core/rime.server.js +3 -2
- package/dist/core/routes/context.server.d.ts +11 -0
- package/dist/core/routes/context.server.js +11 -0
- package/dist/core/routes/handler.server.d.ts +4 -3
- package/dist/core/routes/handler.server.js +4 -3
- package/dist/core/routes/panel-navigation.d.ts +4 -5
- package/dist/core/routes/panel-navigation.js +4 -8
- package/dist/core/routes/util.d.ts +8 -2
- package/dist/core/routes/util.js +10 -4
- package/dist/fields/blocks/component/AddBlockButton.svelte +1 -0
- package/dist/fields/blocks/component/Blocks.svelte +15 -11
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +22 -10
- package/dist/fields/blocks/component/focus/LayersList.svelte +5 -0
- package/dist/fields/blocks/component/focus/Palette.svelte +0 -1
- package/dist/fields/blocks/component/focus/Renders.svelte +5 -4
- package/dist/fields/blocks/component/focus/Renders.svelte.d.ts +2 -1
- package/dist/fields/blocks/component/focus/focus.svelte.js +42 -13
- package/dist/fields/blocks/component/picker/BlockPicker.svelte +2 -2
- package/dist/fields/blocks/index.d.ts +16 -0
- package/dist/fields/blocks/index.js +15 -2
- package/dist/fields/checkbox/component/Checkbox.svelte +1 -0
- package/dist/fields/combobox/component/ComboBox.svelte +3 -2
- package/dist/fields/combobox/index.d.ts +1 -0
- package/dist/fields/combobox/index.js +1 -0
- package/dist/fields/component/index.d.ts +3 -0
- package/dist/fields/component/index.js +3 -0
- package/dist/fields/date/component/Date.svelte +8 -5
- package/dist/fields/date/index.d.ts +1 -0
- package/dist/fields/date/index.js +1 -0
- package/dist/fields/email/component/Email.svelte +8 -5
- package/dist/fields/email/index.d.ts +1 -0
- package/dist/fields/email/index.js +1 -0
- package/dist/fields/group/component/Group.svelte +8 -15
- package/dist/fields/group/index.d.ts +7 -1
- package/dist/fields/group/index.js +5 -4
- package/dist/fields/link/component/Link.svelte +19 -8
- package/dist/fields/link/component/RessourceInput.svelte +68 -47
- package/dist/fields/link/index.d.ts +12 -0
- package/dist/fields/link/index.js +14 -1
- package/dist/fields/number/component/Number.svelte +1 -0
- package/dist/fields/number/index.js +5 -3
- package/dist/fields/radio/component/Radio.svelte +12 -3
- package/dist/fields/radio/index.d.ts +1 -0
- package/dist/fields/radio/index.js +1 -0
- package/dist/fields/relation/component/Cell.svelte +4 -4
- package/dist/fields/relation/component/Relation.svelte +92 -131
- package/dist/fields/relation/component/Relation.svelte.d.ts +0 -1
- package/dist/fields/relation/component/RelationInline.svelte +22 -27
- package/dist/fields/relation/component/default/Default.svelte +50 -19
- package/dist/fields/relation/component/default/Default.svelte.d.ts +12 -1
- package/dist/fields/relation/component/types.d.ts +5 -3
- package/dist/fields/relation/component/upload/Browse.svelte +50 -41
- package/dist/fields/relation/component/upload/Browse.svelte.d.ts +6 -1
- package/dist/fields/relation/component/upload/Upload.svelte +8 -3
- package/dist/fields/relation/component/upload/Upload.svelte.d.ts +0 -1
- package/dist/fields/relation/index.d.ts +27 -10
- package/dist/fields/relation/index.js +16 -0
- package/dist/fields/relation/populate.js +1 -0
- package/dist/fields/relation/query.d.ts +22 -0
- package/dist/fields/relation/query.js +29 -0
- package/dist/fields/relation/relation.test-d.js +11 -0
- package/dist/fields/repeatable/RepeatableActions.svelte +4 -0
- package/dist/fields/repeatable/RepeatableActions.svelte.d.ts +4 -0
- package/dist/fields/repeatable.js +3 -21
- package/dist/fields/rich-text/client.d.ts +26 -0
- package/dist/fields/rich-text/client.js +26 -0
- package/dist/fields/rich-text/component/RichTextInline.svelte +2 -9
- package/dist/fields/rich-text/component/RichTextInline.svelte.d.ts +2 -9
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +2 -0
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.css +0 -1
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.svelte +1 -2
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +0 -1
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.svelte +9 -6
- package/dist/fields/rich-text/component/context.svelte.d.ts +1 -0
- package/dist/fields/rich-text/component/context.svelte.js +1 -0
- package/dist/fields/rich-text/component/drag-handle/drag-handle.css +0 -1
- package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte +1 -0
- package/dist/fields/rich-text/component/styles/editor.css +0 -1
- package/dist/fields/rich-text/component/styles/field.css +10 -11
- package/dist/fields/rich-text/core/build-editor-config.d.ts +15 -6
- package/dist/fields/rich-text/core/build-editor-config.js +47 -66
- package/dist/fields/rich-text/core/extensions/current-node/current-node.css +1 -0
- package/dist/fields/rich-text/core/extensions/current-node/current-node.d.ts +2 -2
- package/dist/fields/rich-text/core/extensions/current-node/current-node.js +3 -4
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.d.ts +5 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.js +40 -77
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.d.ts +1 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +1 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/cloneElement.d.ts +4 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/cloneElement.js +5 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/dragHandler.d.ts +5 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/dragHandler.js +11 -13
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/findNextElementFromCursor.d.ts +6 -8
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/findNextElementFromCursor.js +9 -14
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getInnerCoords.d.ts +1 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getInnerCoords.js +6 -5
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getOuterNode.d.ts +3 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getOuterNode.js +8 -21
- package/dist/fields/rich-text/core/features/blockquote.js +5 -1
- package/dist/fields/rich-text/core/features/bold.js +0 -3
- package/dist/fields/rich-text/core/features/bullet-list.js +5 -1
- package/dist/fields/rich-text/core/features/fields/extension.d.ts +1 -0
- package/dist/fields/rich-text/core/features/fields/extension.js +1 -0
- package/dist/fields/rich-text/core/features/fields/fields-form.svelte +54 -0
- package/dist/fields/rich-text/core/features/fields/fields-form.svelte.d.ts +14 -0
- package/dist/fields/rich-text/core/features/fields/fields.svelte +30 -35
- package/dist/fields/rich-text/core/features/fields/index.d.ts +2 -0
- package/dist/fields/rich-text/core/features/fields/index.js +1 -0
- package/dist/fields/rich-text/core/features/heading.js +19 -68
- package/dist/fields/rich-text/core/features/hr/hr.css +1 -2
- package/dist/fields/rich-text/core/features/hr/hr.js +5 -1
- package/dist/fields/rich-text/core/features/index.d.ts +1 -0
- package/dist/fields/rich-text/core/features/index.js +1 -0
- package/dist/fields/rich-text/core/features/json-attribute.d.ts +1 -1
- package/dist/fields/rich-text/core/features/json-attribute.js +1 -1
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +61 -58
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte.d.ts +3 -1
- package/dist/fields/rich-text/core/features/link/index.d.ts +5 -0
- package/dist/fields/rich-text/core/features/link/index.js +2 -14
- package/dist/fields/rich-text/core/features/ordered-list.js +5 -1
- package/dist/fields/rich-text/core/features/paragraph.js +5 -1
- package/dist/fields/rich-text/core/features/pick-dialog.svelte +16 -4
- package/dist/fields/rich-text/core/features/pick-dialog.svelte.d.ts +7 -3
- package/dist/fields/rich-text/core/features/resource/index.d.ts +1 -0
- package/dist/fields/rich-text/core/features/resource/index.js +1 -0
- package/dist/fields/rich-text/core/features/resource/resource-extension.d.ts +1 -0
- package/dist/fields/rich-text/core/features/resource/resource-extension.js +8 -6
- package/dist/fields/rich-text/core/features/resource/resource.svelte +38 -49
- package/dist/fields/rich-text/core/features/resource/types.d.ts +1 -0
- package/dist/fields/rich-text/core/features/upload/index.d.ts +1 -0
- package/dist/fields/rich-text/core/features/upload/index.js +2 -1
- package/dist/fields/rich-text/core/features/upload/upload-extension.d.ts +6 -0
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +2 -2
- package/dist/fields/{relation/component → rich-text/core/features}/upload/upload.css +1 -2
- package/dist/fields/rich-text/core/features/upload/upload.svelte +47 -73
- package/dist/fields/rich-text/core/features/upload/upload.svelte.d.ts +1 -0
- package/dist/fields/rich-text/core/render-rich-text.svelte +30 -16
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte +8 -3
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte.d.ts +1 -0
- package/dist/fields/rich-text/core/svelte/constant.d.ts +1 -0
- package/dist/fields/rich-text/core/svelte/constant.js +1 -0
- package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.d.ts +10 -0
- package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.js +23 -6
- package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte +6 -2
- package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte.d.ts +1 -0
- package/dist/fields/rich-text/core/svelte/renderer.d.ts +1 -0
- package/dist/fields/rich-text/core/svelte/renderer.js +1 -0
- package/dist/fields/rich-text/core/types.d.ts +11 -0
- package/dist/fields/rich-text/index.d.ts +2 -0
- package/dist/fields/rich-text/index.js +12 -7
- package/dist/fields/rich-text/json.d.ts +6 -4
- package/dist/fields/rich-text/json.js +6 -4
- package/dist/fields/select/component/Select.svelte +37 -12
- package/dist/fields/select/index.d.ts +2 -1
- package/dist/fields/select/index.js +1 -0
- package/dist/fields/separator/index.d.ts +1 -0
- package/dist/fields/separator/index.js +1 -0
- package/dist/fields/slug/component/Slug.svelte +14 -13
- package/dist/fields/slug/index.d.ts +11 -0
- package/dist/fields/slug/index.js +11 -0
- package/dist/fields/tabs/component/Tabs.svelte +4 -7
- package/dist/fields/tabs/index.d.ts +10 -0
- package/dist/fields/tabs/index.js +10 -0
- package/dist/fields/text/component/TextInline.svelte +12 -10
- package/dist/fields/text/index.d.ts +7 -0
- package/dist/fields/text/index.js +9 -2
- package/dist/fields/textarea/index.d.ts +3 -0
- package/dist/fields/textarea/index.js +5 -2
- package/dist/fields/time/index.d.ts +1 -0
- package/dist/fields/time/index.js +4 -6
- package/dist/fields/toggle/component/Toggle.svelte +1 -0
- package/dist/fields/toggle/index.d.ts +1 -0
- package/dist/fields/toggle/index.js +1 -0
- package/dist/fields/tree/component/AddItemButton.svelte +3 -2
- package/dist/fields/tree/component/AddItemButton.svelte.d.ts +1 -1
- package/dist/fields/tree/component/Tree.svelte +16 -57
- package/dist/fields/tree/component/TreeBlock.svelte +26 -40
- package/dist/fields/tree/component/props.d.ts +3 -2
- package/dist/fields/tree/index.js +14 -2
- package/dist/fields/tree/util.js +0 -3
- package/dist/fields/types.d.ts +23 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/live/Consumer.svelte +6 -0
- package/dist/live/LiveEdit.svelte +23 -5
- package/dist/live/LiveEdit.svelte.d.ts +2 -1
- package/dist/live/Provider.svelte +5 -1
- package/dist/live/context.svelte.d.ts +3 -4
- package/dist/live/context.svelte.js +9 -6
- package/dist/panel/components/Root.svelte +7 -1
- package/dist/panel/components/fields/FieldsPreview.svelte +15 -1
- package/dist/panel/components/fields/Label.svelte +2 -0
- package/dist/panel/components/fields/RenderFields.svelte +12 -1
- package/dist/panel/components/fields/fieldset.svelte.d.ts +7 -1
- package/dist/panel/components/fields/fieldset.svelte.js +7 -1
- package/dist/panel/components/fields/setting.css +7 -0
- package/dist/panel/components/sections/auth/AuthForm.svelte +4 -1
- package/dist/panel/components/sections/collection/Avatar.svelte +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte +3 -0
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +11 -1
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +10 -1
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +45 -34
- package/dist/panel/components/sections/collection/folder/Folders.svelte +1 -0
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +8 -3
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte.d.ts +2 -1
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +3 -1
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +4 -0
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +1 -5
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +2 -0
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +25 -5
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +4 -1
- package/dist/panel/components/sections/collection/list/row/Row.svelte +16 -16
- package/dist/panel/components/sections/collection/list/row/Row.svelte.d.ts +4 -4
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +4 -80
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +18 -8
- package/dist/panel/components/sections/collection/tree/sortable.d.ts +11 -0
- package/dist/panel/components/sections/collection/tree/sortable.js +45 -0
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +5 -3
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte.d.ts +0 -1
- package/dist/panel/components/sections/commands/CommandPalette.svelte +5 -0
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +14 -4
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte.d.ts +2 -0
- package/dist/panel/components/sections/document/AuthFooter.svelte +37 -31
- package/dist/panel/components/sections/document/AuthFooter.svelte.d.ts +0 -2
- package/dist/panel/components/sections/document/ButtonSave.svelte +2 -6
- package/dist/panel/components/sections/document/ButtonSave.svelte.d.ts +1 -3
- package/dist/panel/components/sections/document/ButtonStatus.svelte +24 -11
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +16 -0
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte +5 -3
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte.d.ts +1 -0
- package/dist/panel/components/sections/document/Document.svelte +29 -18
- package/dist/panel/components/sections/document/DocumentChildren.svelte +48 -41
- package/dist/panel/components/sections/document/Header.svelte +13 -11
- package/dist/panel/components/sections/document/Settings.svelte +127 -157
- package/dist/panel/components/sections/document/Versions.svelte +11 -2
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +32 -13
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte.d.ts +2 -0
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +24 -10
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte.d.ts +3 -0
- package/dist/panel/components/sections/live/LiveEditPanel.svelte +11 -5
- package/dist/panel/components/sections/live/LiveEditPanel.svelte.d.ts +10 -3
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte +18 -2
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte.d.ts +3 -0
- package/dist/panel/components/ui/button/button.svelte +0 -3
- package/dist/panel/components/ui/calendar/calendar.css +0 -1
- package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/panel/components/ui/card-resource/card-resource.svelte +17 -3
- package/dist/panel/components/ui/card-resource/card-resource.svelte.d.ts +2 -0
- package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/panel/components/ui/command/command-count.css +6 -0
- package/dist/panel/components/ui/command/command-count.svelte +15 -0
- package/dist/panel/components/ui/command/command-count.svelte.d.ts +9 -0
- package/dist/panel/components/ui/command/command-dialog.css +2 -0
- package/dist/panel/components/ui/command/command-input-select.svelte +5 -0
- package/dist/panel/components/ui/command/filter.d.ts +10 -0
- package/dist/panel/components/ui/command/filter.js +11 -0
- package/dist/panel/components/ui/command/index.d.ts +2 -1
- package/dist/panel/components/ui/command/index.js +2 -1
- package/dist/panel/components/ui/context-menu/context-menu.css +2 -2
- package/dist/panel/components/ui/dialog/dialog-content.css +4 -1
- package/dist/panel/components/ui/dialog/dialog-content.svelte +8 -1
- package/dist/panel/components/ui/dialog/dialog-overlay.css +2 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +2 -2
- package/dist/panel/components/ui/input/input.svelte +3 -0
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +1 -1
- package/dist/panel/components/ui/layer/layer.svelte.d.ts +22 -0
- package/dist/panel/components/ui/layer/layer.svelte.js +37 -0
- package/dist/panel/components/ui/nav/Nav.svelte +4 -9
- package/dist/panel/components/ui/nav/NavGroup.svelte +6 -6
- package/dist/panel/components/ui/nav/NavItem.svelte +1 -0
- package/dist/panel/components/ui/nav/NavItem.svelte.d.ts +1 -0
- package/dist/panel/components/ui/nav/UserButton.svelte +4 -4
- package/dist/panel/components/ui/page-header/PageHeader.svelte +1 -5
- package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +1 -0
- package/dist/panel/components/ui/popover/popover-content.css +2 -1
- package/dist/panel/components/ui/radio-row-group/radio-row-group.css +0 -1
- package/dist/panel/components/ui/scroll-area/scroll-area-scrollbar.svelte +3 -4
- package/dist/panel/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +1 -1
- package/dist/panel/components/ui/scroll-area/scroll-area.css +0 -6
- package/dist/panel/components/ui/scroll-area/scroll-area.svelte +4 -1
- package/dist/panel/components/ui/sheet/index.d.ts +1 -1
- package/dist/panel/components/ui/sheet/sheet-content.svelte +13 -2
- package/dist/panel/components/ui/sheet/sheet-content.svelte.d.ts +3 -0
- package/dist/panel/components/ui/sheet/sheet.css +11 -43
- package/dist/panel/components/ui/sonner/sonner.css +5 -0
- package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
- package/dist/panel/components/ui/tag/tag.svelte +8 -1
- package/dist/panel/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/panel/components/ui/tree/tree-rows.css +1 -8
- package/dist/panel/context/api-proxy.svelte.d.ts +2 -0
- package/dist/panel/context/api-proxy.svelte.js +30 -4
- package/dist/panel/context/blocks-ops.d.ts +6 -0
- package/dist/panel/context/blocks-ops.js +6 -0
- package/dist/panel/context/bulk-delete.d.ts +4 -3
- package/dist/panel/context/bulk-delete.js +13 -7
- package/dist/panel/context/collection.svelte.d.ts +10 -22
- package/dist/panel/context/collection.svelte.js +73 -115
- package/dist/panel/context/commands.svelte.js +5 -0
- package/dist/panel/context/config.svelte.js +2 -0
- package/dist/panel/context/createContext.svelte.d.ts +1 -0
- package/dist/panel/context/createContext.svelte.js +1 -0
- package/dist/panel/context/documentForm.svelte.d.ts +4 -2
- package/dist/panel/context/documentForm.svelte.js +87 -159
- package/dist/panel/context/errors.svelte.d.ts +8 -0
- package/dist/panel/context/errors.svelte.js +8 -0
- package/dist/panel/context/form.svelte.d.ts +8 -1
- package/dist/panel/context/form.svelte.js +37 -40
- package/dist/panel/context/livePanel.svelte.d.ts +3 -0
- package/dist/panel/context/locale.svelte.js +3 -0
- package/dist/panel/context/nav.svelte.js +9 -21
- package/dist/panel/context/tree-ops.d.ts +14 -0
- package/dist/panel/context/tree-ops.js +70 -0
- package/dist/panel/context/versions.svelte.d.ts +6 -0
- package/dist/panel/context/versions.svelte.js +18 -0
- package/dist/panel/index.d.ts +1 -10
- package/dist/panel/pages/area/Area.svelte +1 -1
- package/dist/panel/pages/area/actions.server.js +1 -0
- package/dist/panel/pages/area/load.server.d.ts +1 -0
- package/dist/panel/pages/area/load.server.js +1 -1
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +23 -16
- package/dist/panel/pages/auth/forgot-password/load.server.d.ts +1 -0
- package/dist/panel/pages/auth/forgot-password/load.server.js +3 -5
- package/dist/panel/pages/auth/image.server.d.ts +6 -0
- package/dist/panel/pages/auth/image.server.js +19 -0
- package/dist/panel/pages/auth/reset-password/ResetPassword.svelte +22 -15
- package/dist/panel/pages/auth/reset-password/load.server.d.ts +3 -0
- package/dist/panel/pages/auth/reset-password/load.server.js +5 -5
- package/dist/panel/pages/auth/sign-in/actions.server.js +33 -25
- package/dist/panel/pages/auth/sign-in/load.server.d.ts +4 -0
- package/dist/panel/pages/auth/sign-in/load.server.js +6 -5
- package/dist/panel/pages/collection/Collection.svelte.d.ts +1 -1
- package/dist/panel/pages/collection/CollectionPage.svelte +31 -27
- package/dist/panel/pages/collection/CollectionPage.svelte.d.ts +1 -1
- package/dist/panel/pages/collection/load.server.d.ts +5 -2
- package/dist/panel/pages/collection/load.server.js +53 -54
- package/dist/panel/pages/collection-document/CollectionDocument.svelte +1 -1
- package/dist/panel/pages/collection-document/actions.server.js +3 -11
- package/dist/panel/pages/collection-document/load.server.d.ts +5 -0
- package/dist/panel/pages/collection-document/load.server.js +10 -3
- package/dist/panel/pages/dashboard/load.server.d.ts +3 -0
- package/dist/panel/pages/dashboard/load.server.js +19 -8
- package/dist/panel/pages/live/Live.svelte +45 -45
- package/dist/panel/pages/live/load.server.d.ts +5 -0
- package/dist/panel/pages/live/load.server.js +5 -0
- package/dist/panel/pages/shared/DocumentPage.svelte +9 -5
- package/dist/panel/pages/shared/DocumentPage.svelte.d.ts +0 -1
- package/dist/panel/style/font.css +1 -1
- package/dist/panel/style/index.css +21 -6
- package/dist/panel/style/palette.css +1 -1
- package/dist/panel/style/size.css +1 -0
- package/dist/panel/style/z-index.css +18 -0
- package/dist/panel/types.d.ts +0 -1
- package/dist/panel/util/Sortable.d.ts +6 -1
- package/dist/panel/util/Sortable.js +6 -1
- package/dist/panel/util/auth.d.ts +18 -0
- package/dist/panel/util/auth.js +25 -0
- package/dist/panel/util/candidates.svelte.d.ts +118 -0
- package/dist/panel/util/candidates.svelte.js +176 -0
- package/dist/panel/util/count.d.ts +19 -0
- package/dist/panel/util/count.js +20 -0
- package/dist/panel/util/dataError.d.ts +1 -0
- package/dist/panel/util/dataError.js +1 -0
- package/dist/panel/util/storage.d.ts +13 -0
- package/dist/panel/util/storage.js +37 -0
- package/dist/panel/util/time.d.ts +7 -1
- package/dist/panel/util/time.js +19 -5
- package/dist/panel/util/upload-file.d.ts +0 -8
- package/dist/panel/util/upload-file.js +6 -12
- package/dist/server.js +3 -0
- package/dist/util/form-data.d.ts +3 -3
- package/dist/util/form-data.js +4 -2
- package/dist/util/function.d.ts +7 -6
- package/dist/util/function.js +7 -6
- package/dist/util/object.d.ts +10 -11
- package/dist/util/object.js +21 -55
- package/dist/util/random.d.ts +8 -12
- package/dist/util/random.js +34 -88
- package/dist/util/string.js +76 -114
- package/dist/util/types.d.ts +2 -0
- package/package.json +12 -15
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getComputedStyle.d.ts +0 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getComputedStyle.js +0 -4
- package/dist/fields/rich-text/core/features/link/component/link-selector.css +0 -0
- package/dist/fields/rich-text/core/features/resource/resource.css +0 -0
- package/dist/panel/style/util.css +0 -3
- package/dist/panel/util/once.svelte.d.ts +0 -3
- package/dist/panel/util/once.svelte.js +0 -12
|
@@ -49,10 +49,16 @@ export type FieldReferenceOptions = {
|
|
|
49
49
|
export type FieldReference = FieldReferenceOptions & {
|
|
50
50
|
table: string;
|
|
51
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* A field that holds a value: a name, a column, write and read access, hooks and a check.
|
|
54
|
+
* A new one may be created and updated by any signed-in user and read by everyone, until
|
|
55
|
+
* `access()` says otherwise.
|
|
56
|
+
*/
|
|
52
57
|
export declare class FormFieldBuilder<T extends FormField = FormField> extends FieldBuilder<T> {
|
|
53
58
|
/** Column storage type, used to generate the DB schema. Every field
|
|
54
59
|
* builder that stores data must define its own. */
|
|
55
60
|
get dataType(): DataType;
|
|
61
|
+
/** The table this field's column points at, set by `$references`; `null` for a plain column. */
|
|
56
62
|
_references: FieldReference | null;
|
|
57
63
|
constructor(name: string, type: string);
|
|
58
64
|
label(label: string): this;
|
|
@@ -70,11 +76,22 @@ export declare class FormFieldBuilder<T extends FormField = FormField> extends F
|
|
|
70
76
|
*
|
|
71
77
|
* ```ts
|
|
72
78
|
* number('age').min(0).validate((value) => Number.isInteger(value) || 'Whole years');
|
|
73
|
-
* // -5 -> '
|
|
79
|
+
* // -5 -> 'number_too_small' 2.5 -> 'Whole years' 7 -> true
|
|
74
80
|
* ```
|
|
75
81
|
*/
|
|
76
82
|
validate(rule: FieldValidationFunc<T>): this;
|
|
83
|
+
/**
|
|
84
|
+
* Shown when `doc` (the whole document) and `siblings` (the values next to the field: the
|
|
85
|
+
* group's, the block's) make it answer `true`; a condition that throws hides the field.
|
|
86
|
+
*/
|
|
77
87
|
condition(conditionFunction: (doc: Dic, siblings: Dic) => boolean): this;
|
|
88
|
+
/**
|
|
89
|
+
* A column in the panel's list. A number is its position; no argument puts it last (99).
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* text('title').table(1) date('publishedAt').table({ position: 2, sort: true })
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
78
95
|
table(params?: FieldPanelTableConfig | number): this;
|
|
79
96
|
width(value: FieldWidth): this;
|
|
80
97
|
required(bool?: boolean): this;
|
|
@@ -91,6 +108,18 @@ export declare class FormFieldBuilder<T extends FormField = FormField> extends F
|
|
|
91
108
|
* ```
|
|
92
109
|
*/
|
|
93
110
|
$index(): this;
|
|
111
|
+
/**
|
|
112
|
+
* Makes the field's column `NOT NULL`, with `default` as its `DEFAULT`: a migration that adds
|
|
113
|
+
* the column writes it into every row already there.
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* toggle('isAutoSave').$notNull({ default: false })
|
|
117
|
+
* // isAutoSave: integer('is_auto_save', { mode: 'boolean' }).notNull().default(false)
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
$notNull(options: {
|
|
121
|
+
default: string | number | boolean;
|
|
122
|
+
}): this;
|
|
94
123
|
/** `label`/`localized`/`root`/`required` are the only properties that need
|
|
95
124
|
* anything beyond a plain `this.field` read (a fallback default, or a
|
|
96
125
|
* boolean coercion) — everything else a concrete field type adds
|
|
@@ -102,11 +131,13 @@ export declare class FormFieldBuilder<T extends FormField = FormField> extends F
|
|
|
102
131
|
label: string;
|
|
103
132
|
required: boolean;
|
|
104
133
|
};
|
|
134
|
+
/** Who may create, read and update this field, over the defaults: only the keys given change. */
|
|
105
135
|
access(access: {
|
|
106
136
|
create?: FieldAccess;
|
|
107
137
|
read?: FieldAccess;
|
|
108
138
|
update?: FieldAccess;
|
|
109
139
|
}): this;
|
|
140
|
+
/** Runs in the panel after each change the field accepts: after `beforeValidate`, once valid. */
|
|
110
141
|
onChange(hook: FieldHookClient): this;
|
|
111
142
|
/** Behavior the builder runs on your behalf — invoking a stored function or
|
|
112
143
|
* hook list, not a data read (see `.get` for that). */
|
|
@@ -114,15 +145,28 @@ export declare class FormFieldBuilder<T extends FormField = FormField> extends F
|
|
|
114
145
|
/** The document a resolved reference reads as, whatever the field's own type says. */
|
|
115
146
|
private resolvedReferenceType;
|
|
116
147
|
hint(hint: string): this;
|
|
117
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* A copy of the builder: its field, with every plain object and list copied, and its
|
|
150
|
+
* `$references`. Builders held in the field (a group's fields, a blocks list's blocks) are the
|
|
151
|
+
* same builders: a container that changes them overrides `clone` (tabs does).
|
|
152
|
+
*/
|
|
118
153
|
clone(): typeof this;
|
|
119
154
|
/**
|
|
120
155
|
* Makes this field a foreign key to the prototype `table` names (a slug). With `resolve`, a read
|
|
121
156
|
* joins the referenced document.
|
|
122
157
|
*/
|
|
123
158
|
$references(table: string, options?: FieldReferenceOptions): this;
|
|
159
|
+
/**
|
|
160
|
+
* Turns the value on the server as a read hands it back. Hooks run in the order they are
|
|
161
|
+
* added.
|
|
162
|
+
*/
|
|
124
163
|
$beforeRead(hook: FieldHook<T>): this;
|
|
164
|
+
/**
|
|
165
|
+
* Turns the value on the server before it is written, after `validate`. Hooks run in the order
|
|
166
|
+
* they are added.
|
|
167
|
+
*/
|
|
125
168
|
$beforeSave(hook: FieldHook<T>): this;
|
|
169
|
+
/** Turns the value before `validate`, in the panel as the value changes and on the server. */
|
|
126
170
|
beforeValidate(hook: FieldHookShared): this;
|
|
127
171
|
/**
|
|
128
172
|
* The value this field takes on a copy of its document. It runs after the field's own copy and
|
|
@@ -2,12 +2,18 @@ import { makeDocTypeName } from '../../prototype/naming.js';
|
|
|
2
2
|
import { capitalize } from '../../../util/string.js';
|
|
3
3
|
import cloneDeep from 'clone-deep';
|
|
4
4
|
import { FieldBuilder } from './field-builder.js';
|
|
5
|
+
/**
|
|
6
|
+
* A field that holds a value: a name, a column, write and read access, hooks and a check.
|
|
7
|
+
* A new one may be created and updated by any signed-in user and read by everyone, until
|
|
8
|
+
* `access()` says otherwise.
|
|
9
|
+
*/
|
|
5
10
|
export class FormFieldBuilder extends FieldBuilder {
|
|
6
11
|
/** Column storage type, used to generate the DB schema. Every field
|
|
7
12
|
* builder that stores data must define its own. */
|
|
8
13
|
get dataType() {
|
|
9
14
|
throw new Error(`${this.constructor.name} does not implement dataType`);
|
|
10
15
|
}
|
|
16
|
+
/** The table this field's column points at, set by `$references`; `null` for a plain column. */
|
|
11
17
|
_references = null;
|
|
12
18
|
constructor(name, type) {
|
|
13
19
|
super(type);
|
|
@@ -50,7 +56,7 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
50
56
|
*
|
|
51
57
|
* ```ts
|
|
52
58
|
* number('age').min(0).validate((value) => Number.isInteger(value) || 'Whole years');
|
|
53
|
-
* // -5 -> '
|
|
59
|
+
* // -5 -> 'number_too_small' 2.5 -> 'Whole years' 7 -> true
|
|
54
60
|
* ```
|
|
55
61
|
*/
|
|
56
62
|
validate(rule) {
|
|
@@ -61,10 +67,21 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
61
67
|
});
|
|
62
68
|
return this;
|
|
63
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Shown when `doc` (the whole document) and `siblings` (the values next to the field: the
|
|
72
|
+
* group's, the block's) make it answer `true`; a condition that throws hides the field.
|
|
73
|
+
*/
|
|
64
74
|
condition(conditionFunction) {
|
|
65
75
|
this.field.condition = conditionFunction;
|
|
66
76
|
return this;
|
|
67
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* A column in the panel's list. A number is its position; no argument puts it last (99).
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* text('title').table(1) date('publishedAt').table({ position: 2, sort: true })
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
68
85
|
table(params) {
|
|
69
86
|
if (params === undefined) {
|
|
70
87
|
this.field.table = { position: 99 };
|
|
@@ -104,6 +121,19 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
104
121
|
this.field.index = true;
|
|
105
122
|
return this;
|
|
106
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Makes the field's column `NOT NULL`, with `default` as its `DEFAULT`: a migration that adds
|
|
126
|
+
* the column writes it into every row already there.
|
|
127
|
+
*
|
|
128
|
+
* ```ts
|
|
129
|
+
* toggle('isAutoSave').$notNull({ default: false })
|
|
130
|
+
* // isAutoSave: integer('is_auto_save', { mode: 'boolean' }).notNull().default(false)
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
$notNull(options) {
|
|
134
|
+
this.field.notNull = { default: options.default };
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
107
137
|
/** `label`/`localized`/`root`/`required` are the only properties that need
|
|
108
138
|
* anything beyond a plain `this.field` read (a fallback default, or a
|
|
109
139
|
* boolean coercion) — everything else a concrete field type adds
|
|
@@ -118,10 +148,12 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
118
148
|
required: !!this.field.required
|
|
119
149
|
};
|
|
120
150
|
}
|
|
151
|
+
/** Who may create, read and update this field, over the defaults: only the keys given change. */
|
|
121
152
|
access(access) {
|
|
122
153
|
this.field.access = { ...this.field.access, ...access };
|
|
123
154
|
return this;
|
|
124
155
|
}
|
|
156
|
+
/** Runs in the panel after each change the field accepts: after `beforeValidate`, once valid. */
|
|
125
157
|
onChange(hook) {
|
|
126
158
|
this.field.hooks.onChange ??= [];
|
|
127
159
|
this.field.hooks.onChange.push(hook);
|
|
@@ -215,7 +247,11 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
215
247
|
this.field.hint = hint;
|
|
216
248
|
return this;
|
|
217
249
|
}
|
|
218
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* A copy of the builder: its field, with every plain object and list copied, and its
|
|
252
|
+
* `$references`. Builders held in the field (a group's fields, a blocks list's blocks) are the
|
|
253
|
+
* same builders: a container that changes them overrides `clone` (tabs does).
|
|
254
|
+
*/
|
|
219
255
|
clone() {
|
|
220
256
|
const Constructor = this.constructor;
|
|
221
257
|
const clone = new Constructor(this.field.name, this.field.type);
|
|
@@ -231,16 +267,25 @@ export class FormFieldBuilder extends FieldBuilder {
|
|
|
231
267
|
this._references = { table, ...options };
|
|
232
268
|
return this;
|
|
233
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Turns the value on the server as a read hands it back. Hooks run in the order they are
|
|
272
|
+
* added.
|
|
273
|
+
*/
|
|
234
274
|
$beforeRead(hook) {
|
|
235
275
|
this.field.hooks.beforeRead ??= [];
|
|
236
276
|
this.field.hooks.beforeRead.push(hook);
|
|
237
277
|
return this;
|
|
238
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Turns the value on the server before it is written, after `validate`. Hooks run in the order
|
|
281
|
+
* they are added.
|
|
282
|
+
*/
|
|
239
283
|
$beforeSave(hook) {
|
|
240
284
|
this.field.hooks.beforeSave ??= [];
|
|
241
285
|
this.field.hooks.beforeSave.push(hook);
|
|
242
286
|
return this;
|
|
243
287
|
}
|
|
288
|
+
/** Turns the value before `validate`, in the panel as the value changes and on the server. */
|
|
244
289
|
beforeValidate(hook) {
|
|
245
290
|
this.field.hooks.beforeValidate ??= [];
|
|
246
291
|
this.field.hooks.beforeValidate.push(hook);
|
|
@@ -3,23 +3,34 @@ import { FormFieldBuilder } from './form-field-builder.js';
|
|
|
3
3
|
import type { DefaultOptions, DefaultValueFn, FieldValidationFunc, FormField, Option } from '../../../fields/types.js';
|
|
4
4
|
type FieldWithOptions = FormField & {
|
|
5
5
|
options: Option[];
|
|
6
|
-
defaultValue?:
|
|
6
|
+
defaultValue?: string | string[] | DefaultValueFn<string | string[]>;
|
|
7
7
|
many?: boolean;
|
|
8
8
|
validate?: FieldValidationFunc<FieldWithOptions>;
|
|
9
9
|
};
|
|
10
10
|
declare class PickFieldBuilder<T extends FieldWithOptions = FieldWithOptions> extends FormFieldBuilder<T> {
|
|
11
11
|
constructor(name: string, type: string);
|
|
12
|
+
/**
|
|
13
|
+
* The options to pick from. A string is its own value, its label capitalized; an object without
|
|
14
|
+
* a label gets one the same way.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* select('size').options('small', { value: 'xl', label: 'Extra large' })
|
|
18
|
+
* // [{ value: 'small', label: 'Small' }, { value: 'xl', label: 'Extra large' }]
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
12
21
|
options(...options: (Option | string)[]): this;
|
|
13
22
|
/** The options as a TypeScript union of string literals: `"a" | "l'été"`. */
|
|
14
23
|
protected optionsType(): string;
|
|
15
24
|
}
|
|
25
|
+
/** A field that holds one option: radio, combobox. Stored as text. */
|
|
16
26
|
export declare class PickOneFieldBuilder<T extends FieldWithOptions = FieldWithOptions> extends PickFieldBuilder<T> {
|
|
17
27
|
defaultValue(value: string | DefaultValueFn<string>, options?: DefaultOptions): this;
|
|
18
28
|
get dataType(): DataType;
|
|
19
29
|
}
|
|
30
|
+
/** A field that holds one option, or a list of them after `many()`: select. */
|
|
20
31
|
export declare class PickManyFieldBuilder<T extends FieldWithOptions = FieldWithOptions> extends PickFieldBuilder<T> {
|
|
21
32
|
constructor(name: string, type: string);
|
|
22
|
-
defaultValue(value: string[] | DefaultValueFn<string[]>, options?: DefaultOptions): this;
|
|
33
|
+
defaultValue(value: string | string[] | DefaultValueFn<string | string[]>, options?: DefaultOptions): this;
|
|
23
34
|
many(): this;
|
|
24
35
|
}
|
|
25
36
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RimeFormError } from '../../errors/index.js';
|
|
1
2
|
import { FormFieldBuilder } from './form-field-builder.js';
|
|
2
3
|
import { capitalize } from '../../../util/string.js';
|
|
3
4
|
/** A select's value is one of its options, or a list of distinct options when it takes `many`. */
|
|
@@ -9,13 +10,22 @@ const ensureSelectIsOption = (value, { config }) => {
|
|
|
9
10
|
candidate.every(isOption) &&
|
|
10
11
|
new Set(candidate).size === candidate.length;
|
|
11
12
|
const valid = config.many ? isOptionList(value) : isOption(value);
|
|
12
|
-
return valid ||
|
|
13
|
+
return valid || RimeFormError.NOT_AN_OPTION;
|
|
13
14
|
};
|
|
14
15
|
class PickFieldBuilder extends FormFieldBuilder {
|
|
15
16
|
constructor(name, type) {
|
|
16
17
|
super(name, type);
|
|
17
18
|
this.field.validate = ensureSelectIsOption;
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The options to pick from. A string is its own value, its label capitalized; an object without
|
|
22
|
+
* a label gets one the same way.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* select('size').options('small', { value: 'xl', label: 'Extra large' })
|
|
26
|
+
* // [{ value: 'small', label: 'Small' }, { value: 'xl', label: 'Extra large' }]
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
19
29
|
options(...options) {
|
|
20
30
|
this.field.options = options.map((option) => {
|
|
21
31
|
if (typeof option === 'string') {
|
|
@@ -40,6 +50,7 @@ class PickFieldBuilder extends FormFieldBuilder {
|
|
|
40
50
|
return this.field.options.map((option) => JSON.stringify(option.value)).join(' | ');
|
|
41
51
|
}
|
|
42
52
|
}
|
|
53
|
+
/** A field that holds one option: radio, combobox. Stored as text. */
|
|
43
54
|
export class PickOneFieldBuilder extends PickFieldBuilder {
|
|
44
55
|
defaultValue(value, options) {
|
|
45
56
|
this.field.defaultValue = value;
|
|
@@ -50,6 +61,7 @@ export class PickOneFieldBuilder extends PickFieldBuilder {
|
|
|
50
61
|
return 'text';
|
|
51
62
|
}
|
|
52
63
|
}
|
|
64
|
+
/** A field that holds one option, or a list of them after `many()`: select. */
|
|
53
65
|
export class PickManyFieldBuilder extends PickFieldBuilder {
|
|
54
66
|
constructor(name, type) {
|
|
55
67
|
super(name, type);
|
|
@@ -3,7 +3,10 @@ import type { FormFieldBuilder } from './builders/form-field-builder.js';
|
|
|
3
3
|
import type { Field, FormField } from '../../fields/types.js';
|
|
4
4
|
import type { Dic } from '../../util/types.js';
|
|
5
5
|
import type { RequestEvent } from '@sveltejs/kit';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The request a default function is called with. A call outside a request (boot, the panel)
|
|
8
|
+
* passes none.
|
|
9
|
+
*/
|
|
7
10
|
type InitialContext = {
|
|
8
11
|
event?: RequestEvent;
|
|
9
12
|
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { RelationInput, RelationRef, RelationValue } from '../../fields/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Type utilities that know about fields.
|
|
4
|
-
*
|
|
5
|
-
* They name rime types (relation values, field builders), so they live with the concept rather
|
|
6
|
-
* than in util/types.ts.
|
|
7
|
-
*/
|
|
2
|
+
/** Document types as reads and writes see them, relation by relation. */
|
|
8
3
|
/**
|
|
9
4
|
* The depths a read resolves, up to `MAX_DEPTH`, each mapped to the one its related documents are
|
|
10
5
|
* read at.
|
|
@@ -26,6 +21,10 @@ type LessDepth = {
|
|
|
26
21
|
* ```
|
|
27
22
|
*/
|
|
28
23
|
export type WithRelationResolved<T, D extends number = 1> = D extends keyof LessDepth ? Resolved<T, D> : T;
|
|
24
|
+
/**
|
|
25
|
+
* `T` with each relation holding its documents, read at one depth less. Objects and lists — a
|
|
26
|
+
* group, blocks, tree items — are walked at the same depth.
|
|
27
|
+
*/
|
|
29
28
|
type Resolved<T, D extends keyof LessDepth> = {
|
|
30
29
|
[K in keyof T]: Required<T>[K] extends string | number | boolean | null ? T[K] : T[K] extends undefined ? undefined : T[K] extends Date | ((...args: any[]) => unknown) ? T[K] : IsRelation<NonNullable<T[K]>> extends true ? NonNullable<T[K]> extends RelationValue<infer U> ? WithRelationResolved<U, LessDepth[D]>[] : T[K] : T[K] extends Array<infer E> ? Array<Resolved<E, D>> : T[K] extends object ? Resolved<T[K], D> : T[K];
|
|
31
30
|
};
|
|
@@ -3,7 +3,7 @@ import type { Dic } from '../../util/types.js';
|
|
|
3
3
|
import type { FormFieldBuilder } from './builders/form-field-builder.js';
|
|
4
4
|
import type { FieldBuilder } from './builders/index.js';
|
|
5
5
|
/**
|
|
6
|
-
* Checks if a field is a presentative field (
|
|
6
|
+
* Checks if a field is a presentative field (separator fields).
|
|
7
7
|
* Presentative fields are used for UI organization and don't store data.
|
|
8
8
|
*/
|
|
9
9
|
export declare const isPresentative: (field: Field) => field is SeparatorField;
|
|
@@ -21,23 +21,18 @@ export declare const isNotHidden: <T extends FormField>(field: FormFieldBuilder<
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const isLiveField: (field: Field) => boolean | undefined;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* // Get the title field in the attributes group
|
|
27
|
-
* const titleField = getFieldAtPath('attributes.title', collection.fields);
|
|
28
|
-
*
|
|
29
|
-
* // Get the title field in a specific block
|
|
30
|
-
* const titleField = getFieldAtPath('attributes.layout.2:blockType.title', collection.fields);
|
|
24
|
+
* The form field at a document path, or `undefined`. A block's segment names its type, as the
|
|
25
|
+
* walk writes it: `layout.0:hero.title`; `layout.0.title` finds nothing.
|
|
31
26
|
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* getFieldAtPath('attributes.title', fields) // the `title` builder
|
|
29
|
+
* ```
|
|
32
30
|
*/
|
|
33
31
|
export declare const getFieldAtPath: (path: string, fields: FieldBuilder[]) => FormFieldBuilder<FormField> | undefined;
|
|
34
32
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Containers (tabs, groups) are treated as transparent navigation layers.
|
|
39
|
-
* Blocks are treated as endpoints — the blocks builder itself is returned
|
|
40
|
-
* regardless of any index:blockType suffix in the path.
|
|
33
|
+
* The fields to render at `fieldPath`, and the path to render them at. Tabs and groups are passed
|
|
34
|
+
* through; a block segment with its type (`layout.0:slider`) answers that block's fields, a path
|
|
35
|
+
* ending at a blocks field answers the blocks field itself.
|
|
41
36
|
*/
|
|
42
37
|
export declare function getFieldListAtPath(fieldPath: string, fields: FieldBuilder[], parentPath?: string): {
|
|
43
38
|
fields: FieldBuilder[];
|
package/dist/core/fields/util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeFieldPath } from '../../util/string.js';
|
|
2
2
|
import { matchesSegment, walkFields } from './walk.js';
|
|
3
3
|
/**
|
|
4
|
-
* Checks if a field is a presentative field (
|
|
4
|
+
* Checks if a field is a presentative field (separator fields).
|
|
5
5
|
* Presentative fields are used for UI organization and don't store data.
|
|
6
6
|
*/
|
|
7
7
|
export const isPresentative = (field) => ['separator'].includes(field.type);
|
|
@@ -19,14 +19,12 @@ export const isNotHidden = (field) => !field.get.hidden;
|
|
|
19
19
|
*/
|
|
20
20
|
export const isLiveField = (field) => field.live;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* // Get the title field in the attributes group
|
|
25
|
-
* const titleField = getFieldAtPath('attributes.title', collection.fields);
|
|
26
|
-
*
|
|
27
|
-
* // Get the title field in a specific block
|
|
28
|
-
* const titleField = getFieldAtPath('attributes.layout.2:blockType.title', collection.fields);
|
|
22
|
+
* The form field at a document path, or `undefined`. A block's segment names its type, as the
|
|
23
|
+
* walk writes it: `layout.0:hero.title`; `layout.0.title` finds nothing.
|
|
29
24
|
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* getFieldAtPath('attributes.title', fields) // the `title` builder
|
|
27
|
+
* ```
|
|
30
28
|
*/
|
|
31
29
|
export const getFieldAtPath = (path, fields) => {
|
|
32
30
|
const findInFields = (currentFields, parts) => {
|
|
@@ -78,12 +76,9 @@ export const getFieldAtPath = (path, fields) => {
|
|
|
78
76
|
return findInFields(fields, path.split('.'));
|
|
79
77
|
};
|
|
80
78
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Containers (tabs, groups) are treated as transparent navigation layers.
|
|
85
|
-
* Blocks are treated as endpoints — the blocks builder itself is returned
|
|
86
|
-
* regardless of any index:blockType suffix in the path.
|
|
79
|
+
* The fields to render at `fieldPath`, and the path to render them at. Tabs and groups are passed
|
|
80
|
+
* through; a block segment with its type (`layout.0:slider`) answers that block's fields, a path
|
|
81
|
+
* ending at a blocks field answers the blocks field itself.
|
|
87
82
|
*/
|
|
88
83
|
export function getFieldListAtPath(fieldPath, fields, parentPath = '') {
|
|
89
84
|
if (!fieldPath)
|
|
@@ -139,7 +134,7 @@ export function getFieldListAtPath(fieldPath, fields, parentPath = '') {
|
|
|
139
134
|
? getFieldListAtPath(rest.join('.'), node.fields, path)
|
|
140
135
|
: { fields: node.fields, path };
|
|
141
136
|
}
|
|
142
|
-
console.warn(`[
|
|
137
|
+
console.warn(`[getFieldListAtPath] fieldPath "${fieldPath}" not found in config fields`);
|
|
143
138
|
return { fields, path: parentPath };
|
|
144
139
|
}
|
|
145
140
|
/**
|
|
@@ -59,6 +59,8 @@ export declare const url: (value: unknown) => string | true;
|
|
|
59
59
|
* slug("Invalid Slug!"); // Returns RimeFormError.INVALID_SLUG
|
|
60
60
|
*/
|
|
61
61
|
export declare const slug: (value: unknown) => string | true;
|
|
62
|
+
/** A string, or the `not_a_string` error. */
|
|
63
|
+
export declare const string: (value: unknown) => string | true;
|
|
62
64
|
/**
|
|
63
65
|
* Validates a link object with different validation based on link type.
|
|
64
66
|
* Supports tel, email, url, and anchor link types. A value that is not an object is refused, and
|
|
@@ -87,6 +89,7 @@ declare const validate: {
|
|
|
87
89
|
password: (value: unknown) => string | true;
|
|
88
90
|
email: (value: unknown) => string | true;
|
|
89
91
|
slug: (value: unknown) => string | true;
|
|
92
|
+
string: (value: unknown) => string | true;
|
|
90
93
|
url: (value: unknown) => string | true;
|
|
91
94
|
tel: (value: unknown) => string | true;
|
|
92
95
|
link: (link: unknown, context?: {
|
|
@@ -121,6 +121,8 @@ export const slug = (value) => {
|
|
|
121
121
|
}
|
|
122
122
|
return true;
|
|
123
123
|
};
|
|
124
|
+
/** A string, or the `not_a_string` error. */
|
|
125
|
+
export const string = (value) => typeof value === 'string' || RimeFormError.NOT_A_STRING;
|
|
124
126
|
/**
|
|
125
127
|
* Validates a link object with different validation based on link type.
|
|
126
128
|
* Supports tel, email, url, and anchor link types. A value that is not an object is refused, and
|
|
@@ -171,6 +173,7 @@ const validate = {
|
|
|
171
173
|
password,
|
|
172
174
|
email,
|
|
173
175
|
slug,
|
|
176
|
+
string,
|
|
174
177
|
url,
|
|
175
178
|
tel,
|
|
176
179
|
link
|
|
@@ -6,6 +6,7 @@ type Visit = {
|
|
|
6
6
|
value: unknown;
|
|
7
7
|
};
|
|
8
8
|
type WalkOptions = {
|
|
9
|
+
/** The path the fields sit under: '' at the root. */
|
|
9
10
|
path?: string;
|
|
10
11
|
/** Skip branches whose segment holds a `#` — a path no config alone can name. */
|
|
11
12
|
determinate?: boolean;
|
|
@@ -28,7 +29,9 @@ export declare function walkFields(fields: FieldBuilder[], { path, determinate }
|
|
|
28
29
|
* { layout: [ { type: 'hero', title: 'x' } ] } -> layout · layout.0:hero.title
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
export declare function walkValues(fields: FieldBuilder[], data: unknown, { path }?:
|
|
32
|
+
export declare function walkValues(fields: FieldBuilder[], data: unknown, { path }?: {
|
|
33
|
+
path?: string;
|
|
34
|
+
}): Generator<Visit>;
|
|
32
35
|
/**
|
|
33
36
|
* Whether one concrete segment is the branch a declared segment stands for.
|
|
34
37
|
*
|
package/dist/core/fields/walk.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isObjectLiteral } from '../../util/object.js';
|
|
2
|
-
/**
|
|
3
|
-
* contributes no segment keeps its parent's path — so it only guards the empty parent. */
|
|
2
|
+
/** Joins a parent path and a segment with a dot; a field at the root has no parent to join. */
|
|
4
3
|
const joinPath = (parent, part) => (parent ? `${parent}.${part}` : part);
|
|
5
4
|
/**
|
|
6
5
|
* Every field the config declares, parents before children, siblings in declaration order.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Handle } from '@sveltejs/kit/hooks';
|
|
2
2
|
import type { Config } from './config/types.js';
|
|
3
3
|
import type { Rime } from './rime.server.js';
|
|
4
|
+
/**
|
|
5
|
+
* The handle list an app spreads into `sequence()` in `src/hooks.server.ts`. The order matters:
|
|
6
|
+
* CORS before better-auth and auth, so `/api/auth/*` gets the same CORS as the rest of the API;
|
|
7
|
+
* auth before the uploads, the plugins and the routes that read `event.locals.user`.
|
|
8
|
+
*/
|
|
4
9
|
export default function <const C extends Config>(rime: Promise<Rime<C>>): Promise<Handle[]>;
|
|
@@ -13,13 +13,17 @@ function logResponse(event, status) {
|
|
|
13
13
|
const { pathname, search } = event.url;
|
|
14
14
|
logger.response(status, `${event.request.method} ${pathname}${search}`, { console: !dev });
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* The first handle: puts the request's `rime` on `event.locals`, gives every `$url` page its
|
|
18
|
+
* address once per process, and logs the status of every response.
|
|
19
|
+
*/
|
|
16
20
|
function createCMSHandler(rime) {
|
|
17
21
|
const handleCMS = async ({ event, resolve }) => {
|
|
18
22
|
event.locals.rime = rime.createRimeContext(event);
|
|
19
23
|
// Once per process: every `$url` page missing an address gets one.
|
|
20
24
|
if (!building)
|
|
21
25
|
await ensureAddresses(event);
|
|
22
|
-
const response = await
|
|
26
|
+
const response = await resolve(event).catch((err) => {
|
|
23
27
|
// Thrown by a later handle step, as handleAuth does: SvelteKit answers it
|
|
24
28
|
logResponse(event, isHttpError(err) || isRedirect(err) ? err.status : 500);
|
|
25
29
|
throw err;
|
|
@@ -29,10 +33,20 @@ function createCMSHandler(rime) {
|
|
|
29
33
|
};
|
|
30
34
|
return handleCMS;
|
|
31
35
|
}
|
|
36
|
+
/** Lets better-auth answer its own routes, `/api/auth/*`. Every other request goes on. */
|
|
37
|
+
function createBetterAuthHandler(rime) {
|
|
38
|
+
return ({ event, resolve }) => svelteKitHandler({ event, resolve, auth: rime.auth, building });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The handle list an app spreads into `sequence()` in `src/hooks.server.ts`. The order matters:
|
|
42
|
+
* CORS before better-auth and auth, so `/api/auth/*` gets the same CORS as the rest of the API;
|
|
43
|
+
* auth before the uploads, the plugins and the routes that read `event.locals.user`.
|
|
44
|
+
*/
|
|
32
45
|
export default async function (rime) {
|
|
33
46
|
return [
|
|
34
47
|
createCMSHandler(await rime),
|
|
35
48
|
handleCORS,
|
|
49
|
+
createBetterAuthHandler(await rime),
|
|
36
50
|
handleAuth,
|
|
37
51
|
// After the user is known: a private collection's file goes to its readers only
|
|
38
52
|
handleUploads,
|
|
@@ -9,49 +9,74 @@ declare namespace _default {
|
|
|
9
9
|
export let auto_save_paused: string;
|
|
10
10
|
export let auto_save_resume: string;
|
|
11
11
|
export let auto_saved_at: string;
|
|
12
|
+
export let back: string;
|
|
12
13
|
export let browse: string;
|
|
14
|
+
export let cache_clear_failed: string;
|
|
15
|
+
export let cache_cleared: string;
|
|
13
16
|
export let cancel: string;
|
|
17
|
+
export let clear_cache: string;
|
|
14
18
|
export let close: string;
|
|
15
19
|
export let confirm: string;
|
|
16
20
|
export let confirmPassword: string;
|
|
21
|
+
export let copy_api_key: string;
|
|
17
22
|
export let create_new: string;
|
|
18
23
|
export let create_folder: string;
|
|
19
24
|
export let create: string;
|
|
20
25
|
let _delete: string;
|
|
21
26
|
export { _delete as delete };
|
|
27
|
+
export let delete_confirm: string;
|
|
22
28
|
export let delete_dialog_title: string;
|
|
23
29
|
export let delete_dialog_text: string;
|
|
24
30
|
export let delete_document: string;
|
|
25
31
|
export let delete_version: string;
|
|
26
32
|
export let delete_version_dialog_title: string;
|
|
27
33
|
export let delete_version_dialog_text: string;
|
|
34
|
+
export let document_form: string;
|
|
35
|
+
export let document_move_error: string;
|
|
36
|
+
export let document_moved: string;
|
|
28
37
|
export let duplicate: string;
|
|
29
38
|
export let duplicate_success: string;
|
|
30
39
|
export let doc_deleted: string;
|
|
40
|
+
export let docs_deleted: string;
|
|
41
|
+
export let docs_not_deleted: string;
|
|
31
42
|
export let doc_created: string;
|
|
32
43
|
export let doc_updated: string;
|
|
33
44
|
export let draft_infos: string;
|
|
34
45
|
export let draft: string;
|
|
35
46
|
export let drop_file: string;
|
|
36
47
|
export let drop_files: string;
|
|
48
|
+
export let edit: string;
|
|
49
|
+
export let edit_item: string;
|
|
50
|
+
export let file_read_error: string;
|
|
51
|
+
export let folder_delete_error: string;
|
|
37
52
|
export let folder_deleted: string;
|
|
53
|
+
export let folder_holds: string;
|
|
54
|
+
export let folder_move_error: string;
|
|
55
|
+
export let folder_moved: string;
|
|
38
56
|
export let forgotPassword: string;
|
|
39
57
|
export let generatingPreview: string;
|
|
40
58
|
export let generic_error: string;
|
|
41
59
|
export let generic_success: string;
|
|
42
60
|
export let import_default_locale: string;
|
|
61
|
+
export let is_editing: string;
|
|
43
62
|
export let leave_confirm_title: string;
|
|
44
63
|
export let leave_confirm_text: string;
|
|
64
|
+
export let live_edit: string;
|
|
45
65
|
export let live_in_sync: string;
|
|
66
|
+
export let load_more: string;
|
|
46
67
|
export let newPassword: string;
|
|
47
68
|
export let no_document: string;
|
|
48
69
|
export let or: string;
|
|
70
|
+
export let order_updated: string;
|
|
49
71
|
export let passwordResetLinkSent: string;
|
|
72
|
+
export let preview_desktop: string;
|
|
73
|
+
export let preview_mobile: string;
|
|
50
74
|
export let published_infos: string;
|
|
51
75
|
export let published: string;
|
|
52
76
|
export let requestPasswordReset: string;
|
|
53
77
|
export let resetPassword: string;
|
|
54
78
|
export let reset_password_success: string;
|
|
79
|
+
export let reset_link_invalid: string;
|
|
55
80
|
export let save_new_draft: string;
|
|
56
81
|
export let save: string;
|
|
57
82
|
export let search_a: string;
|
|
@@ -63,6 +88,7 @@ declare namespace _default {
|
|
|
63
88
|
export let show_as_list: string;
|
|
64
89
|
export let show_as_grid: string;
|
|
65
90
|
export let show_as_tree: string;
|
|
91
|
+
export let shown_of: string;
|
|
66
92
|
export let mark_as: string;
|
|
67
93
|
export let type_a_command: string;
|
|
68
94
|
export let nothing_found: string;
|
|
@@ -84,8 +110,10 @@ declare namespace _default {
|
|
|
84
110
|
export let sendPasswordResetLink: string;
|
|
85
111
|
export let signin: string;
|
|
86
112
|
export let someone: string;
|
|
113
|
+
export let take_control: string;
|
|
87
114
|
export let unsaved_dialog_title: string;
|
|
88
115
|
export let unsaved_dialog_text: string;
|
|
116
|
+
export let validate: string;
|
|
89
117
|
export let version_created: string;
|
|
90
118
|
export let version_deleted: string;
|
|
91
119
|
export let versions_history: string;
|