rimecms 1.2.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/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.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 +13 -3
- 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 +9 -1
- package/dist/adapter-sqlite/index.server.js +23 -2
- 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 +63 -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 +9 -7
- package/dist/core/auth/better-auth-tables.server.js +9 -7
- 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 +37 -15
- 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/user.server.d.ts +8 -3
- package/dist/core/auth/user.server.js +8 -3
- 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/boot.server.js +7 -2
- package/dist/core/codegen.server.d.ts +2 -3
- package/dist/core/codegen.server.js +18 -16
- 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 +17 -6
- 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 +7 -2
- package/dist/core/dev/cli/commands/build.js +38 -12
- package/dist/core/dev/cli/commands/clear.server.d.ts +6 -0
- package/dist/core/dev/cli/commands/clear.server.js +20 -6
- 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 +10 -1
- package/dist/core/dev/cli/commands/init.server.js +45 -53
- package/dist/core/dev/cli/commands/uploads-move.server.js +3 -0
- package/dist/core/dev/cli/index.js +34 -16
- 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 +7 -10
- package/dist/core/dev/cli/templates/init.js +22 -47
- 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 +10 -1
- package/dist/core/dev/cli/util/package-manager.server.js +21 -19
- 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/deny-storage.server.d.ts +2 -2
- package/dist/core/dev/deny-storage.server.js +2 -2
- package/dist/core/dev/ensure.server.d.ts +5 -0
- package/dist/core/dev/ensure.server.js +9 -22
- 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 +21 -5
- 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/DashboardRow.svelte +13 -0
- 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 +3 -3
- package/dist/panel/style/index.css +23 -8
- 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 +17 -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
|
@@ -19,11 +19,6 @@ export type BaseDoc = {
|
|
|
19
19
|
_live?: string;
|
|
20
20
|
};
|
|
21
21
|
export type GenericDoc = BaseDoc & Dic;
|
|
22
|
-
export type GenericNestedDoc = BaseDoc & {
|
|
23
|
-
_children: string[];
|
|
24
|
-
_parent: string | null;
|
|
25
|
-
_position: number;
|
|
26
|
-
} & Dic;
|
|
27
22
|
export type TreeBlock = {
|
|
28
23
|
id: string;
|
|
29
24
|
ownerId?: string;
|
|
@@ -55,7 +55,8 @@ export type Rime<C extends Config = Config> = {
|
|
|
55
55
|
createRimeContext(event: RequestEvent): RimeContext<C>;
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
* Boots rime for one config — codegen in dev, the adapter, better-auth, the panel translations —
|
|
59
|
+
* and answers the process-wide object. Its `createRimeContext` builds `event.locals.rime` for each
|
|
60
|
+
* request.
|
|
60
61
|
*/
|
|
61
62
|
export declare function createRime<const C extends Config>(config: BuildConfig<C>): Promise<Rime<C>>;
|
package/dist/core/rime.server.js
CHANGED
|
@@ -5,8 +5,9 @@ import { areaApi } from './prototype/area/api.server.js';
|
|
|
5
5
|
import { collectionApi } from './prototype/collection/api.server.js';
|
|
6
6
|
import { createRoutesContext } from './routes/context.server.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Boots rime for one config — codegen in dev, the adapter, better-auth, the panel translations —
|
|
9
|
+
* and answers the process-wide object. Its `createRimeContext` builds `event.locals.rime` for each
|
|
10
|
+
* request.
|
|
10
11
|
*/
|
|
11
12
|
export async function createRime(config) {
|
|
12
13
|
// Phases 1 and 2 — codegen (dev only) then boot, in that order, written out in
|
|
@@ -20,10 +20,21 @@ export declare function slugOf(event: Pick<RequestEvent, 'params' | 'locals'>):
|
|
|
20
20
|
export declare function createRoutesContext(event: RequestEvent): {
|
|
21
21
|
/** The slug of the prototype the URL names. A load reads `slugOf(event)` instead. */
|
|
22
22
|
readonly slug: undefined;
|
|
23
|
+
/** Whether the request is under `/api`. */
|
|
23
24
|
readonly isAPI: boolean;
|
|
25
|
+
/** Whether the route is the panel's sign-in, forgot-password or reset-password page. */
|
|
24
26
|
readonly isPublicAuthRoute: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the request is a panel page that needs a session: a route with the `[panel]` param,
|
|
29
|
+
* sign-in, forgot-password and reset-password excepted. False on a URL no route matched.
|
|
30
|
+
*/
|
|
25
31
|
readonly isPanel: boolean;
|
|
32
|
+
/** The panel's path segment, `RIME_PANEL_ROUTE`. Private: never send it to the client. */
|
|
26
33
|
readonly panel: string;
|
|
34
|
+
/**
|
|
35
|
+
* A root-relative panel path, `/panel/pages/12`. Unlike `panelUrl` in `routes/util.ts`, which
|
|
36
|
+
* the browser uses, this is not an absolute URL.
|
|
37
|
+
*/
|
|
27
38
|
panelUrl(...args: string[]): ResolvedPathname;
|
|
28
39
|
apiUrl: typeof routes.apiUrl;
|
|
29
40
|
absolute: typeof routes.absolute;
|
|
@@ -26,18 +26,29 @@ export function createRoutesContext(event) {
|
|
|
26
26
|
get slug() {
|
|
27
27
|
return slugOf(event);
|
|
28
28
|
},
|
|
29
|
+
/** Whether the request is under `/api`. */
|
|
29
30
|
get isAPI() {
|
|
30
31
|
return routes.isApiPathname(event.url.pathname);
|
|
31
32
|
},
|
|
33
|
+
/** Whether the route is the panel's sign-in, forgot-password or reset-password page. */
|
|
32
34
|
get isPublicAuthRoute() {
|
|
33
35
|
return routes.isPublicPanelAuthRoute(event.route.id);
|
|
34
36
|
},
|
|
37
|
+
/**
|
|
38
|
+
* Whether the request is a panel page that needs a session: a route with the `[panel]` param,
|
|
39
|
+
* sign-in, forgot-password and reset-password excepted. False on a URL no route matched.
|
|
40
|
+
*/
|
|
35
41
|
get isPanel() {
|
|
36
42
|
return event.params.panel !== undefined && !routes.isPublicPanelAuthRoute(event.route.id);
|
|
37
43
|
},
|
|
44
|
+
/** The panel's path segment, `RIME_PANEL_ROUTE`. Private: never send it to the client. */
|
|
38
45
|
get panel() {
|
|
39
46
|
return RIME_PANEL_ROUTE;
|
|
40
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* A root-relative panel path, `/panel/pages/12`. Unlike `panelUrl` in `routes/util.ts`, which
|
|
50
|
+
* the browser uses, this is not an absolute URL.
|
|
51
|
+
*/
|
|
41
52
|
panelUrl(...args) {
|
|
42
53
|
return routes.joinPath(RIME_PANEL_ROUTE, ...args);
|
|
43
54
|
},
|
|
@@ -11,9 +11,6 @@ import type { Handle } from '@sveltejs/kit/hooks';
|
|
|
11
11
|
* Each generated file passes `event` straight through and imports nothing — slug and id are real
|
|
12
12
|
* route params, and the matchers rime generates into `+rime.generated/params.ts`, which the app's
|
|
13
13
|
* `src/params.ts` spreads, have already sorted out which prototype the URL names.
|
|
14
|
-
*
|
|
15
|
-
* Lives here rather than on `rime.server.ts`, because these handlers read `event.locals.rime`.
|
|
16
|
-
* Naming them there would make `RimeContext` depend on its own type.
|
|
17
14
|
*/
|
|
18
15
|
export declare const routeHandlers: {
|
|
19
16
|
checkLiveRedirect: typeof checkLiveRedirect;
|
|
@@ -53,5 +50,9 @@ export declare const routeHandlers: {
|
|
|
53
50
|
*/
|
|
54
51
|
rest: (name: string, path: string, event: RequestEvent) => Response | Promise<Response>;
|
|
55
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* The last handle: builds the panel sidebar for a panel GET, puts `routeHandlers` on
|
|
55
|
+
* `event.locals.routes`, and answers a `$routes` pathname before SvelteKit's own routing.
|
|
56
|
+
*/
|
|
56
57
|
export declare const handleRoutes: Handle;
|
|
57
58
|
export type RouteHandlers = typeof routeHandlers;
|
|
@@ -27,9 +27,6 @@ const restRoutes = {
|
|
|
27
27
|
* Each generated file passes `event` straight through and imports nothing — slug and id are real
|
|
28
28
|
* route params, and the matchers rime generates into `+rime.generated/params.ts`, which the app's
|
|
29
29
|
* `src/params.ts` spreads, have already sorted out which prototype the URL names.
|
|
30
|
-
*
|
|
31
|
-
* Lives here rather than on `rime.server.ts`, because these handlers read `event.locals.rime`.
|
|
32
|
-
* Naming them there would make `RimeContext` depend on its own type.
|
|
33
30
|
*/
|
|
34
31
|
export const routeHandlers = {
|
|
35
32
|
checkLiveRedirect,
|
|
@@ -66,6 +63,10 @@ export const routeHandlers = {
|
|
|
66
63
|
return handler(event);
|
|
67
64
|
}
|
|
68
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* The last handle: builds the panel sidebar for a panel GET, puts `routeHandlers` on
|
|
68
|
+
* `event.locals.routes`, and answers a `$routes` pathname before SvelteKit's own routing.
|
|
69
|
+
*/
|
|
69
70
|
export const handleRoutes = async ({ event, resolve }) => {
|
|
70
71
|
const { rime } = event.locals;
|
|
71
72
|
const { isPanel } = rime.routes;
|
|
@@ -3,11 +3,10 @@ import type { Config } from '../../types.js';
|
|
|
3
3
|
import type { Dic } from '../../util/types.js';
|
|
4
4
|
import type { RequestEvent } from '@sveltejs/kit';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @returns the routes, by group.
|
|
6
|
+
* The panel sidebar, by group: the collections and areas the request's user may read, then the
|
|
7
|
+
* custom panel routes. A collection goes to its `panel.group`, else `collections`; an area to its
|
|
8
|
+
* `panel.group`, else `areas`; a custom route without a group to `none`. A config with
|
|
9
|
+
* `panel: false` is left out.
|
|
11
10
|
*/
|
|
12
11
|
declare const buildNavigation: <C extends Config>(config: BuildConfig<C>, event: RequestEvent) => Dic;
|
|
13
12
|
export default buildNavigation;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @returns the routes, by group.
|
|
2
|
+
* The panel sidebar, by group: the collections and areas the request's user may read, then the
|
|
3
|
+
* custom panel routes. A collection goes to its `panel.group`, else `collections`; an area to its
|
|
4
|
+
* `panel.group`, else `areas`; a custom route without a group to `none`. A config with
|
|
5
|
+
* `panel: false` is left out.
|
|
7
6
|
*/
|
|
8
7
|
const buildNavigation = (config, event) => {
|
|
9
8
|
const groups = {};
|
|
@@ -16,7 +15,6 @@ const buildNavigation = (config, event) => {
|
|
|
16
15
|
groups[group] ??= [];
|
|
17
16
|
groups[group].push(route);
|
|
18
17
|
};
|
|
19
|
-
// Process collections
|
|
20
18
|
config.collections
|
|
21
19
|
.filter((collection) => collection.panel !== false)
|
|
22
20
|
.forEach((collection) => {
|
|
@@ -29,7 +27,6 @@ const buildNavigation = (config, event) => {
|
|
|
29
27
|
addRouteToGroup(route, (collection.panel && collection.panel?.group) || 'collections');
|
|
30
28
|
}
|
|
31
29
|
});
|
|
32
|
-
// Process areas
|
|
33
30
|
config.areas
|
|
34
31
|
.filter((area) => area.panel !== false)
|
|
35
32
|
.forEach((area) => {
|
|
@@ -42,7 +39,6 @@ const buildNavigation = (config, event) => {
|
|
|
42
39
|
addRouteToGroup(route, (area.panel && area.panel?.group) || 'areas');
|
|
43
40
|
}
|
|
44
41
|
});
|
|
45
|
-
// Process custom panel routes
|
|
46
42
|
Object.entries(config.panel.routes).forEach(([routePath, routeConfig]) => {
|
|
47
43
|
const route = {
|
|
48
44
|
title: routeConfig.label,
|
|
@@ -10,13 +10,19 @@ export declare function joinPath(...args: string[]): string;
|
|
|
10
10
|
* apiUrl('pages', '123') // -> /api/pages/123
|
|
11
11
|
*/
|
|
12
12
|
export declare function apiUrl(...args: string[]): string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Prefixes `SITE_URL` to a root-relative path, with or without its trailing slash.
|
|
15
|
+
* @example
|
|
16
|
+
* absolute('/panel') // SITE_URL https://site.com/ -> https://site.com/panel
|
|
17
|
+
*/
|
|
14
18
|
export declare function absolute(path: string): string;
|
|
15
19
|
/** `/api` and the paths under it: `/api/pages` is one, `/apiary` is not. */
|
|
16
20
|
export declare function isApiPathname(pathname: string): boolean;
|
|
21
|
+
/** Whether a route id is the panel's sign-in, forgot-password or reset-password page. */
|
|
17
22
|
export declare function isPublicPanelAuthRoute(routeId: string | null): boolean;
|
|
18
23
|
/**
|
|
19
|
-
* Panel-only
|
|
24
|
+
* Panel-only, inside a component: the panel path from `page.params.panel`. Throws on a route with
|
|
25
|
+
* no `[panel]` param.
|
|
20
26
|
*/
|
|
21
27
|
export declare function panelPath(...args: string[]): ResolvedPathname;
|
|
22
28
|
/**
|
package/dist/core/routes/util.js
CHANGED
|
@@ -16,23 +16,29 @@ export function joinPath(...args) {
|
|
|
16
16
|
export function apiUrl(...args) {
|
|
17
17
|
return `${API_PREFIX}/${args.join('/')}`;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Prefixes `SITE_URL` to a root-relative path, with or without its trailing slash.
|
|
21
|
+
* @example
|
|
22
|
+
* absolute('/panel') // SITE_URL https://site.com/ -> https://site.com/panel
|
|
23
|
+
*/
|
|
20
24
|
export function absolute(path) {
|
|
21
|
-
return `${SITE_URL}${path}`;
|
|
25
|
+
return `${SITE_URL.replace(/\/+$/, '')}${path}`;
|
|
22
26
|
}
|
|
23
27
|
/** `/api` and the paths under it: `/api/pages` is one, `/apiary` is not. */
|
|
24
28
|
export function isApiPathname(pathname) {
|
|
25
29
|
return pathname === API_PREFIX || pathname.startsWith(`${API_PREFIX}/`);
|
|
26
30
|
}
|
|
31
|
+
/** Whether a route id is the panel's sign-in, forgot-password or reset-password page. */
|
|
27
32
|
export function isPublicPanelAuthRoute(routeId) {
|
|
28
33
|
return !!routeId && PANEL_PUBLIC_AUTH_ROUTE_IDS.has(routeId);
|
|
29
34
|
}
|
|
30
35
|
/**
|
|
31
|
-
* Panel-only
|
|
36
|
+
* Panel-only, inside a component: the panel path from `page.params.panel`. Throws on a route with
|
|
37
|
+
* no `[panel]` param.
|
|
32
38
|
*/
|
|
33
39
|
export function panelPath(...args) {
|
|
34
40
|
if (!page.params.panel)
|
|
35
|
-
throw new Error('panelPath called
|
|
41
|
+
throw new Error('panelPath called on a route without a [panel] param');
|
|
36
42
|
return joinPath(page.params.panel, ...args);
|
|
37
43
|
}
|
|
38
44
|
/**
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
/** The one type of a list that has one: the button adds it without a menu. */
|
|
20
20
|
const single = $derived(config.get.blocks.length === 1 ? config.get.blocks[0].block : null);
|
|
21
21
|
|
|
22
|
+
/** Closes the picker and adds a block of this type, its fields at their initial values. */
|
|
22
23
|
const add = (block: BlocksFieldBlock) => {
|
|
23
24
|
open = false;
|
|
24
25
|
const empty = {
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { useSortable } from '../../../panel/util/Sortable.js';
|
|
9
9
|
import { normalizeFieldPath } from '../../../util/string.js';
|
|
10
10
|
import Maximize2 from '@lucide/svelte/icons/maximize-2';
|
|
11
|
-
import { onMount } from 'svelte';
|
|
12
11
|
import { SvelteSet } from 'svelte/reactivity';
|
|
13
12
|
import DefaultLocaleButton from '../../repeatable/DefaultLocaleButton.svelte';
|
|
14
13
|
import AddBlockButton from './AddBlockButton.svelte';
|
|
@@ -32,6 +31,7 @@
|
|
|
32
31
|
if (last === -1 || !form.blocks.builder(parts.slice(0, last).join('.'))) return list;
|
|
33
32
|
return parts.slice(0, last + 1).join('.');
|
|
34
33
|
});
|
|
34
|
+
/** The summary layout asks for focus mode: a nested form, which has none, keeps the list. */
|
|
35
35
|
const summary = $derived(config.get.layout === 'summary' && !!focus);
|
|
36
36
|
|
|
37
37
|
const field = $derived(form.useField(path, config));
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
const count = $derived(blockState.blocks.length);
|
|
40
40
|
let sorting = $state(false);
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* The blocks shown open, by id; the others are rows. The browser remembers a saved block open,
|
|
44
|
+
* by its id.
|
|
45
|
+
*/
|
|
46
|
+
// svelte-ignore state_referenced_locally
|
|
47
|
+
const opened = new SvelteSet<string>(
|
|
48
|
+
blockState.blocks.map((block) => block.id).filter(isRememberedOpen)
|
|
49
|
+
);
|
|
44
50
|
const anyOpen = $derived(blockState.blocks.some((block) => opened.has(block.id)));
|
|
45
51
|
|
|
46
|
-
onMount(() => {
|
|
47
|
-
for (const block of blockState.blocks) {
|
|
48
|
-
if (isRememberedOpen(block.id)) opened.add(block.id);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
52
|
function setOpen(id: string, open: boolean) {
|
|
53
53
|
if (open) {
|
|
54
54
|
opened.add(id);
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
rememberOpen(id, open);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/** Opens every block when none is open, else closes them all. */
|
|
61
62
|
function toggleAll() {
|
|
62
63
|
const open = !anyOpen;
|
|
63
64
|
for (const block of blockState.blocks) setOpen(block.id, open);
|
|
@@ -78,10 +79,11 @@
|
|
|
78
79
|
if (source && copy && opened.has(source.id)) setOpen(copy.id, true);
|
|
79
80
|
};
|
|
80
81
|
|
|
81
|
-
//
|
|
82
|
+
// Unique per list: a row drags within its own list only
|
|
83
|
+
const key = $props.id();
|
|
82
84
|
const { sortable } = useSortable({
|
|
83
85
|
handle: '.rz-block__grip',
|
|
84
|
-
group:
|
|
86
|
+
group: `rz-blocks-${key}`,
|
|
85
87
|
animation: 150,
|
|
86
88
|
onStart: () => (sorting = true),
|
|
87
89
|
onUnchoose: () => (sorting = false),
|
|
@@ -94,11 +96,13 @@
|
|
|
94
96
|
}
|
|
95
97
|
});
|
|
96
98
|
|
|
99
|
+
/** Makes the list's rows draggable by their grip, for as long as the list is on the page. */
|
|
97
100
|
function sortableList(node: HTMLElement) {
|
|
98
101
|
const instance = sortable(node);
|
|
99
102
|
return { destroy: () => instance.destroy() };
|
|
100
103
|
}
|
|
101
104
|
|
|
105
|
+
/** The block type a row's `type` names; a type the config lacks throws. */
|
|
102
106
|
function getConfigByBlockType(type: string): BlocksFieldBlock {
|
|
103
107
|
const blockConfig = config.get.blocks.find((b) => type === b.name);
|
|
104
108
|
if (!blockConfig) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as Dialog from '../../../../panel/components/ui/dialog/index.js';
|
|
7
7
|
import * as Sheet from '../../../../panel/components/ui/sheet/index.js';
|
|
8
8
|
import * as Tabs from '../../../../panel/components/ui/tabs/index.js';
|
|
9
|
+
import { parseBlockPath } from '../../../../panel/context/blocks-ops.js';
|
|
9
10
|
import { useCommands } from '../../../../panel/context/commands.svelte.js';
|
|
10
11
|
import type { DocumentFormContext } from '../../../../panel/context/documentForm.svelte.js';
|
|
11
12
|
import { getLocaleContext } from '../../../../panel/context/locale.svelte.js';
|
|
@@ -76,16 +77,17 @@
|
|
|
76
77
|
const narrow = $derived(width > 0 && width < 52 * remPx());
|
|
77
78
|
let panelOpen = $state(false);
|
|
78
79
|
|
|
80
|
+
/** The root font size in pixels: the breakpoint is in rem. */
|
|
79
81
|
function remPx() {
|
|
80
82
|
return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
// The selection
|
|
84
|
-
//
|
|
85
|
+
// The selection changed. With nothing selected, an Inspector tab turns to Add, or to Layers in a
|
|
86
|
+
// locked form; a pick from the Layers tab closes the sheet, so the block shows.
|
|
85
87
|
$effect(() => {
|
|
86
88
|
const picked = !!focus.current;
|
|
87
89
|
untrack(() => {
|
|
88
|
-
if (focus.tab === 'inspector' && !picked) focus.tab = 'add';
|
|
90
|
+
if (focus.tab === 'inspector' && !picked) focus.tab = focus.locked ? 'layers' : 'add';
|
|
89
91
|
if (focus.tab === 'layers') panelOpen = false;
|
|
90
92
|
});
|
|
91
93
|
});
|
|
@@ -106,7 +108,8 @@
|
|
|
106
108
|
});
|
|
107
109
|
});
|
|
108
110
|
|
|
109
|
-
// A focus session starts with fresh relations in the renders.
|
|
111
|
+
// A focus session starts with fresh relations in the renders. It runs on the server too,
|
|
112
|
+
// where the cache is empty.
|
|
110
113
|
populate.clear();
|
|
111
114
|
|
|
112
115
|
// The overlay owns the viewport while it is up; the document under it stays where it was.
|
|
@@ -118,15 +121,22 @@
|
|
|
118
121
|
};
|
|
119
122
|
});
|
|
120
123
|
|
|
124
|
+
/** A dialog is open: the arrow, copy and delete keys are its own then. */
|
|
121
125
|
const dialogOpen = () => !!document.querySelector('[role="dialog"][data-state="open"]');
|
|
122
126
|
|
|
123
|
-
/** Removes the selection, after asking when the
|
|
127
|
+
/** Removes the selection, after asking when one of the selected blocks holds blocks. */
|
|
124
128
|
function requestRemove() {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
if (!focus.selection.length || focus.locked) return;
|
|
130
|
+
const holdsBlocks = focus.selection.some((rowPath) => {
|
|
131
|
+
const at = parseBlockPath(rowPath);
|
|
132
|
+
const row = focus.rowsOf(at.list).find((candidate) => candidate.index === at.index);
|
|
133
|
+
return !!row?.children.some((child) => form.blocks.list(child.list).length > 0);
|
|
134
|
+
});
|
|
135
|
+
if (holdsBlocks) {
|
|
136
|
+
confirmRemove = true;
|
|
137
|
+
} else {
|
|
138
|
+
focus.removeSelection();
|
|
139
|
+
}
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
/** Escape goes back one step: the selection, then one level up. The sheet closes itself. */
|
|
@@ -135,6 +145,7 @@
|
|
|
135
145
|
else focus.up();
|
|
136
146
|
}
|
|
137
147
|
|
|
148
|
+
/** Pastes after the selection, and warns when nothing was copied or the list refuses its type. */
|
|
138
149
|
async function paste() {
|
|
139
150
|
const id = await focus.pasteAfterSelection();
|
|
140
151
|
if (!id) toast.warning(t__('fields.paste_refused'));
|
|
@@ -153,6 +164,7 @@
|
|
|
153
164
|
const types = addable;
|
|
154
165
|
const row = focus.currentRow;
|
|
155
166
|
const editing = !focus.locked;
|
|
167
|
+
/** No dialog open: the keys below act. */
|
|
156
168
|
const free = () => !dialogOpen();
|
|
157
169
|
return [
|
|
158
170
|
...(editing
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
const focus = getBlocksFocusContext()!;
|
|
20
20
|
const rows = $derived(focus.rowsOf(list, depth));
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* The row, or a field inside it, has an error: error keys are normalized paths,
|
|
24
|
+
* `sections.0.title`.
|
|
25
|
+
*/
|
|
22
26
|
const hasError = (rowPath: string) =>
|
|
23
27
|
Object.keys(form.errors.value).some((key) => key === rowPath || key.startsWith(`${rowPath}.`));
|
|
24
28
|
|
|
@@ -58,6 +62,7 @@
|
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
|
|
65
|
+
/** Makes this list of layers sortable, for as long as it is on the page. */
|
|
61
66
|
function sortableList(node: HTMLElement) {
|
|
62
67
|
const instance = sortable(node);
|
|
63
68
|
return { destroy: () => instance.destroy() };
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* `only` narrows the list to the block at that index, focus on one block: it does not move
|
|
21
21
|
* then, its own lists do. `onRemove` asks first when the block holds blocks of its own.
|
|
22
|
-
* `holder` is the block a nested list belongs to
|
|
22
|
+
* `holder` is the block a nested list belongs to; `class` is the class the parent's render gives
|
|
23
|
+
* this list through `children(name, { class })`.
|
|
23
24
|
*/
|
|
24
25
|
type Props = {
|
|
25
26
|
form: DocumentFormContext;
|
|
@@ -159,7 +160,7 @@
|
|
|
159
160
|
tabindex="0"
|
|
160
161
|
onclick={(event) => select(event, row.path)}
|
|
161
162
|
onkeydown={(event) => {
|
|
162
|
-
if (event.key === 'Enter' && event.target === event.currentTarget) {
|
|
163
|
+
if ((event.key === 'Enter' || event.key === ' ') && event.target === event.currentTarget) {
|
|
163
164
|
event.preventDefault();
|
|
164
165
|
focus.select(row.path);
|
|
165
166
|
}
|
|
@@ -275,8 +276,8 @@
|
|
|
275
276
|
min-height: var(--rz-size-8);
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
/* An empty
|
|
279
|
-
.rz-renders[data-empty]
|
|
279
|
+
/* An empty list: somewhere to drop a type. A nested one has its `+` inside. */
|
|
280
|
+
.rz-renders[data-empty] {
|
|
280
281
|
padding: var(--rz-size-2);
|
|
281
282
|
border: 1px dashed var(--rz-border-strong);
|
|
282
283
|
border-radius: var(--rz-radius-md);
|
|
@@ -3,7 +3,8 @@ import Renders from './Renders.svelte';
|
|
|
3
3
|
/**
|
|
4
4
|
* `only` narrows the list to the block at that index, focus on one block: it does not move
|
|
5
5
|
* then, its own lists do. `onRemove` asks first when the block holds blocks of its own.
|
|
6
|
-
* `holder` is the block a nested list belongs to
|
|
6
|
+
* `holder` is the block a nested list belongs to; `class` is the class the parent's render gives
|
|
7
|
+
* this list through `children(name, { class })`.
|
|
7
8
|
*/
|
|
8
9
|
type Props = {
|
|
9
10
|
form: DocumentFormContext;
|
|
@@ -30,7 +30,12 @@ const endsOnBlock = (target) => /\.\d+$/.test(target);
|
|
|
30
30
|
export function setBlocksFocusContext(form) {
|
|
31
31
|
const initial = page.url.searchParams.get(FOCUS_PARAM);
|
|
32
32
|
let fromUrl = $state(initial);
|
|
33
|
-
|
|
33
|
+
/** A blocks list, or one block of a list: anything else in the address opens nothing. */
|
|
34
|
+
const isTarget = (target) => !!form.blocks.builder(endsOnBlock(target) ? parseBlockPath(target).list : target);
|
|
35
|
+
const path = $derived.by(() => {
|
|
36
|
+
const target = page.state.blocksFocus ?? fromUrl;
|
|
37
|
+
return target && isTarget(target) ? target : null;
|
|
38
|
+
});
|
|
34
39
|
/** Narrowed by the address, the block is selected and its fields show. */
|
|
35
40
|
const narrowedFromUrl = !!initial && endsOnBlock(initial);
|
|
36
41
|
let selection = $state(narrowedFromUrl ? [initial] : []);
|
|
@@ -58,6 +63,7 @@ export function setBlocksFocusContext(form) {
|
|
|
58
63
|
const locked = $derived(form.isDisabled || form.readOnly);
|
|
59
64
|
/** The block the path ends on, the one the stage is narrowed to. */
|
|
60
65
|
const narrowed = $derived(path && endsOnBlock(path) ? parseBlockPath(path) : null);
|
|
66
|
+
/** The address on screen, with `?focus=` set to `list`, or without it for `null`. */
|
|
61
67
|
const urlWith = (list) => {
|
|
62
68
|
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- a copy handed to pushState, not state
|
|
63
69
|
const url = new URL(page.url.href);
|
|
@@ -108,7 +114,9 @@ export function setBlocksFocusContext(form) {
|
|
|
108
114
|
/* ---------------------------------------------------------------- rows */
|
|
109
115
|
const builderOf = (list) => form.blocks.builder(list);
|
|
110
116
|
const configOf = (list, block) => builderOf(list)?.get.blocks.find((candidate) => candidate.name === block.type)?.get;
|
|
117
|
+
/** A row's title: `renderTitle`, else the block's label, else its type capitalized. */
|
|
111
118
|
const titleOf = (config, block, index) => repeatableTitle(config?.renderTitle, { values: block, position: index }, config?.label || capitalize(block.type));
|
|
119
|
+
/** One list's rows, each with the `blocks` lists its block holds. `depth` is the layers' indent. */
|
|
112
120
|
function rowsOf(list, depth = 0) {
|
|
113
121
|
return form.blocks.list(list).map((block, index) => {
|
|
114
122
|
const config = configOf(list, block);
|
|
@@ -118,7 +126,7 @@ export function setBlocksFocusContext(form) {
|
|
|
118
126
|
.map((field) => ({
|
|
119
127
|
list: `${rowPath}.${field.name}`,
|
|
120
128
|
builder: field,
|
|
121
|
-
label: field.get.label
|
|
129
|
+
label: field.get.label
|
|
122
130
|
}));
|
|
123
131
|
return {
|
|
124
132
|
path: rowPath,
|
|
@@ -173,7 +181,7 @@ export function setBlocksFocusContext(form) {
|
|
|
173
181
|
if (narrowed)
|
|
174
182
|
return rootRows()[0]?.title ?? '';
|
|
175
183
|
const builder = builderOf(path);
|
|
176
|
-
const fieldLabel = builder?.get.label
|
|
184
|
+
const fieldLabel = builder?.get.label ?? '';
|
|
177
185
|
const crumbs = breadcrumb();
|
|
178
186
|
const parent = crumbs.length > 1 ? crumbs[crumbs.length - 2] : undefined;
|
|
179
187
|
if (!parent?.block)
|
|
@@ -197,19 +205,20 @@ export function setBlocksFocusContext(form) {
|
|
|
197
205
|
if (/^\d+$/.test(part)) {
|
|
198
206
|
const index = parseInt(part);
|
|
199
207
|
const block = form.blocks.list(list)[index];
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
208
|
+
if (block) {
|
|
209
|
+
crumbs.push({
|
|
210
|
+
label: titleOf(configOf(list, block), block, index),
|
|
211
|
+
list,
|
|
212
|
+
block: `${list}.${index}`
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
list = `${list}.${part}`;
|
|
207
216
|
continue;
|
|
208
217
|
}
|
|
209
218
|
list = list ? `${list}.${part}` : part;
|
|
210
219
|
const builder = builderOf(list);
|
|
211
220
|
if (builder)
|
|
212
|
-
crumbs.push({ label: builder.get.label
|
|
221
|
+
crumbs.push({ label: builder.get.label, list });
|
|
213
222
|
}
|
|
214
223
|
return crumbs;
|
|
215
224
|
}
|
|
@@ -227,7 +236,7 @@ export function setBlocksFocusContext(form) {
|
|
|
227
236
|
if (!narrowed && form.blocks.accepts(path, type) && current.list !== path) {
|
|
228
237
|
targets.push({
|
|
229
238
|
list: path,
|
|
230
|
-
label: rootBuilder?.get.label
|
|
239
|
+
label: rootBuilder?.get.label ?? ''
|
|
231
240
|
});
|
|
232
241
|
}
|
|
233
242
|
for (const row of allRows()) {
|
|
@@ -244,7 +253,11 @@ export function setBlocksFocusContext(form) {
|
|
|
244
253
|
return targets;
|
|
245
254
|
}
|
|
246
255
|
/* ----------------------------------------------------------- selection */
|
|
256
|
+
/** The first selected block, `{ list, index }`, or none. */
|
|
247
257
|
const currentAt = () => (selection[0] ? parseBlockPath(selection[0]) : null);
|
|
258
|
+
/**
|
|
259
|
+
* Selects a row. With `extend`, the row joins the selection first, or leaves it when it was in.
|
|
260
|
+
*/
|
|
248
261
|
function select(rowPath, options = {}) {
|
|
249
262
|
if (options.extend && selection.length) {
|
|
250
263
|
selection = selection.includes(rowPath)
|
|
@@ -255,7 +268,10 @@ export function setBlocksFocusContext(form) {
|
|
|
255
268
|
selection = [rowPath];
|
|
256
269
|
}
|
|
257
270
|
}
|
|
258
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Up from the first row lands on the root node, down from the root on the first row; down from
|
|
273
|
+
* the last stays. `extend` adds or drops the row as `select` does.
|
|
274
|
+
*/
|
|
259
275
|
function selectRelative(delta, extend = false) {
|
|
260
276
|
const rows = visibleRows();
|
|
261
277
|
if (!rows.length)
|
|
@@ -291,6 +307,10 @@ export function setBlocksFocusContext(form) {
|
|
|
291
307
|
return null;
|
|
292
308
|
return { list, index: form.blocks.list(list).length };
|
|
293
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Inserts a block of `type` at `at`, after the selection by default, and selects it. The new
|
|
312
|
+
* id, or `null` when the form is locked or the list does not take the type.
|
|
313
|
+
*/
|
|
294
314
|
function insertType(type, at = insertionPoint()) {
|
|
295
315
|
if (locked || !at)
|
|
296
316
|
return null;
|
|
@@ -328,6 +348,7 @@ export function setBlocksFocusContext(form) {
|
|
|
328
348
|
}
|
|
329
349
|
/** Adds the type picked where the picker was opened. */
|
|
330
350
|
const insertPicked = (type) => insertType(type, pickPoint());
|
|
351
|
+
/** Duplicates the selected block right after it, and selects the copy. */
|
|
331
352
|
function duplicateSelection() {
|
|
332
353
|
const current = movableAt();
|
|
333
354
|
if (locked || !current)
|
|
@@ -358,6 +379,7 @@ export function setBlocksFocusContext(form) {
|
|
|
358
379
|
}
|
|
359
380
|
select(blockPath({ list: first.list, index: Math.min(first.index, remaining.length - 1) }));
|
|
360
381
|
}
|
|
382
|
+
/** Moves the selected block `delta` places within its list; past either end, nothing moves. */
|
|
361
383
|
function moveSelection(delta) {
|
|
362
384
|
const current = movableAt();
|
|
363
385
|
if (locked || !current)
|
|
@@ -368,6 +390,7 @@ export function setBlocksFocusContext(form) {
|
|
|
368
390
|
form.blocks.move(blockPath(current), { list: current.list, index });
|
|
369
391
|
select(blockPath({ list: current.list, index }));
|
|
370
392
|
}
|
|
393
|
+
/** Moves the selected block to the end of `list`, and selects it where it lands. */
|
|
371
394
|
function moveSelectionInto(list) {
|
|
372
395
|
const current = movableAt();
|
|
373
396
|
if (locked || !current)
|
|
@@ -377,12 +400,17 @@ export function setBlocksFocusContext(form) {
|
|
|
377
400
|
const landed = shiftListPath(list, current);
|
|
378
401
|
select(blockPath({ list: landed, index }));
|
|
379
402
|
}
|
|
403
|
+
/** Copies the first selected block to the clipboard. */
|
|
380
404
|
function copySelection() {
|
|
381
405
|
const current = currentAt();
|
|
382
406
|
if (!current)
|
|
383
407
|
return Promise.resolve();
|
|
384
408
|
return form.blocks.copy(blockPath(current));
|
|
385
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* Pastes the copied block after the selection. The new id, or `null` when nothing was copied or
|
|
412
|
+
* the list refuses its type.
|
|
413
|
+
*/
|
|
386
414
|
async function pasteAfterSelection() {
|
|
387
415
|
const at = insertionPoint();
|
|
388
416
|
if (locked || !at)
|
|
@@ -408,6 +436,7 @@ export function setBlocksFocusContext(form) {
|
|
|
408
436
|
else
|
|
409
437
|
collapsed.delete(id);
|
|
410
438
|
};
|
|
439
|
+
/** Folds every row that holds a list. */
|
|
411
440
|
const collapseAll = () => {
|
|
412
441
|
for (const row of allRows())
|
|
413
442
|
if (row.children.length)
|