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
|
@@ -14,9 +14,8 @@ import { toKebabCase } from '../../../../../util/string.js';
|
|
|
14
14
|
* getSegments("root") // { name: "root", parent: null, path: "root" }
|
|
15
15
|
*/
|
|
16
16
|
export function getSegments(path) {
|
|
17
|
-
// Use nullish coalescing to handle both undefined and null
|
|
18
17
|
const safePath = path ?? UPLOAD_PATH.ROOT_NAME;
|
|
19
|
-
//
|
|
18
|
+
// Refuse an invalid path; the normalised path is built from the segments below
|
|
20
19
|
const isValid = validatePath(safePath);
|
|
21
20
|
if (typeof isValid === 'string') {
|
|
22
21
|
throw new RimeError(RimeError.BAD_REQUEST, isValid);
|
|
@@ -31,7 +30,6 @@ export function getSegments(path) {
|
|
|
31
30
|
}
|
|
32
31
|
const name = segments[segments.length - 1];
|
|
33
32
|
const parent = segments.slice(0, -1).join(UPLOAD_PATH.SEPARATOR);
|
|
34
|
-
// Reconstruct the normalized path from filtered segments
|
|
35
33
|
const normalizedPath = segments.join(UPLOAD_PATH.SEPARATOR);
|
|
36
34
|
return {
|
|
37
35
|
name,
|
|
@@ -81,6 +79,7 @@ export function buildUploadAria({ path, slug, panelSegment }) {
|
|
|
81
79
|
}
|
|
82
80
|
return result;
|
|
83
81
|
}
|
|
82
|
+
/** Drops the url of the last breadcrumb: the folder on screen is not a link. */
|
|
84
83
|
export function removePathFromLastAria(aria) {
|
|
85
84
|
return aria.map((route, index) => {
|
|
86
85
|
if (index === aria.length - 1) {
|
|
@@ -89,14 +88,17 @@ export function removePathFromLastAria(aria) {
|
|
|
89
88
|
return route;
|
|
90
89
|
});
|
|
91
90
|
}
|
|
91
|
+
/** A folder name: letters, digits, `-`, `_`, and spaces inside it — `my docs`, never ` docs `. */
|
|
92
|
+
export const FOLDER_NAME = '[a-zA-Z0-9\\-_](?:[a-zA-Z0-9\\-_ ]*[a-zA-Z0-9\\-_])?';
|
|
92
93
|
/**
|
|
93
94
|
* Validates that a path string follows the required format:
|
|
94
95
|
* - Must start with ROOT_NAME
|
|
95
|
-
* -
|
|
96
|
+
* - Each folder name follows `FOLDER_NAME`
|
|
96
97
|
* - Can only use the defined separator
|
|
97
98
|
* @example
|
|
98
99
|
* validatePath("root:folder:subfolder") // valid
|
|
99
100
|
* validatePath("root:folder with spaces:sub-folder_name") // valid
|
|
101
|
+
* validatePath("root: folder") // invalid
|
|
100
102
|
* validatePath("root/folder") // invalid
|
|
101
103
|
* validatePath("root:folder$") // invalid
|
|
102
104
|
*/
|
|
@@ -110,20 +112,15 @@ export const validatePath = (value) => {
|
|
|
110
112
|
if (!STARTS_WITH_ROOT) {
|
|
111
113
|
return `Path must start with "${UPLOAD_PATH.ROOT_NAME}"`;
|
|
112
114
|
}
|
|
113
|
-
// Create a mutable copy for normalization
|
|
114
115
|
let normalizedPath = value;
|
|
115
|
-
// Remove trailing separator if present
|
|
116
116
|
while (normalizedPath !== UPLOAD_PATH.ROOT_NAME &&
|
|
117
117
|
normalizedPath.endsWith(UPLOAD_PATH.SEPARATOR)) {
|
|
118
118
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
119
119
|
}
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
// 1. Starts with ROOT_NAME
|
|
123
|
-
// 2. Followed by zero or more segments (each segment starts with separator followed by valid chars)
|
|
124
|
-
const validPathRegex = new RegExp(`^${UPLOAD_PATH.ROOT_NAME}(${UPLOAD_PATH.SEPARATOR}[a-zA-Z0-9\\-_ ]+)*$`);
|
|
120
|
+
// ROOT_NAME, then zero or more `:<folder name>` segments
|
|
121
|
+
const validPathRegex = new RegExp(`^${UPLOAD_PATH.ROOT_NAME}(${UPLOAD_PATH.SEPARATOR}${FOLDER_NAME})*$`);
|
|
125
122
|
if (!validPathRegex.test(normalizedPath)) {
|
|
126
|
-
return 'Path contains invalid characters. Only alphanumeric characters, hyphens, underscores, and spaces are allowed.';
|
|
123
|
+
return 'Path contains invalid characters. Only alphanumeric characters, hyphens, underscores, and spaces inside a folder name are allowed.';
|
|
127
124
|
}
|
|
128
125
|
return true;
|
|
129
126
|
};
|
|
@@ -100,5 +100,19 @@ export type PrototypeApiContext<C extends BuiltPrototype = BuiltPrototype> = {
|
|
|
100
100
|
type PrototypeOptions<C extends BuiltPrototype> = Partial<Omit<PrototypeDefinition<C>, 'create' | 'name'>> & {
|
|
101
101
|
name: string;
|
|
102
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Builds a prototype definition from its name, augments, boot and REST surface. Its `create`
|
|
105
|
+
* turns an authored config into a built one: `_titleFallback: 'id'`, every augment in order,
|
|
106
|
+
* then `type`, `slug`, `initial`, `kebab`, `fields`, the icon, `live` and `access` defaulting
|
|
107
|
+
* each rule to staff.
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* export const area = definePrototype({
|
|
111
|
+
* name: 'area',
|
|
112
|
+
* augments: () => [augmentAreaLabel, augmentVersions, augmentTitle, augmentMetas]
|
|
113
|
+
* });
|
|
114
|
+
* area.create('settings', { fields: [...] });
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
103
117
|
export declare const definePrototype: <C extends BuiltPrototype = BuiltPrototype>(options: PrototypeOptions<C>) => PrototypeDefinition<C>;
|
|
104
118
|
export {};
|
|
@@ -4,6 +4,20 @@ import { initial } from './initial.js';
|
|
|
4
4
|
import { prototypeKebab } from './naming.js';
|
|
5
5
|
/** The rules an author wrote, without the ones written as `undefined`. */
|
|
6
6
|
const writtenRules = (access = {}) => Object.fromEntries(Object.entries(access).filter(([, rule]) => rule !== undefined));
|
|
7
|
+
/**
|
|
8
|
+
* Builds a prototype definition from its name, augments, boot and REST surface. Its `create`
|
|
9
|
+
* turns an authored config into a built one: `_titleFallback: 'id'`, every augment in order,
|
|
10
|
+
* then `type`, `slug`, `initial`, `kebab`, `fields`, the icon, `live` and `access` defaulting
|
|
11
|
+
* each rule to staff.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* export const area = definePrototype({
|
|
15
|
+
* name: 'area',
|
|
16
|
+
* augments: () => [augmentAreaLabel, augmentVersions, augmentTitle, augmentMetas]
|
|
17
|
+
* });
|
|
18
|
+
* area.create('settings', { fields: [...] });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
7
21
|
export const definePrototype = (options) => {
|
|
8
22
|
const name = options.name;
|
|
9
23
|
// Defaulted, so `create` calls it unconditionally.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isFormField } from '../../../fields/util.js';
|
|
2
2
|
import { walkFields } from '../../../fields/walk.js';
|
|
3
|
+
/** The field types a title can be read from: text, date, slug, email and rich text. */
|
|
3
4
|
const hasMaybeTitle = (field) => ['text', 'date', 'slug', 'email', 'richText'].includes(field.type);
|
|
4
5
|
/** The path of the first field marked `isTitle()`, a path a config alone can name. */
|
|
5
6
|
export function findTitleField(fields = []) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Every read endpoint goes through here, so `?select=title` means the same thing on `/pages` and
|
|
11
11
|
* on `/pages/<id>`.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* `raw` is the `select` search param as sent, comma separated, or null when absent; `asTitle` is
|
|
14
|
+
* the config's resolved title path.
|
|
15
15
|
*/
|
|
16
16
|
export declare const selectWithTitle: (raw: string | null, asTitle: string) => string[] | undefined;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Every read endpoint goes through here, so `?select=title` means the same thing on `/pages` and
|
|
11
11
|
* on `/pages/<id>`.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* `raw` is the `select` search param as sent, comma separated, or null when absent; `asTitle` is
|
|
14
|
+
* the config's resolved title path.
|
|
15
15
|
*/
|
|
16
16
|
export const selectWithTitle = (raw, asTitle) => {
|
|
17
17
|
if (!raw)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RIME_PANEL_ROUTE } from '$app/env/private';
|
|
2
|
-
import { SITE_URL } from '$app/env/public';
|
|
3
2
|
import { PARAMS } from '../../../../constants.js';
|
|
4
3
|
import { Hooks } from '../../../../pipeline/define-hook.js';
|
|
4
|
+
import { absolute } from '../../../../routes/util.js';
|
|
5
5
|
/**
|
|
6
6
|
* The live edit link, for staff, from the document's url: the panel opens the page there and
|
|
7
7
|
* sends it the edited version's content.
|
|
@@ -20,7 +20,6 @@ export const setLiveUrl = Hooks.beforeRead(async function setLiveUrl(args) {
|
|
|
20
20
|
params.set(PARAMS.VERSION_ID, doc.contentId);
|
|
21
21
|
if (context.params.locale)
|
|
22
22
|
params.set(PARAMS.LOCALE, context.params.locale);
|
|
23
|
-
|
|
24
|
-
const live = `${SITE_URL.replace(/\/$/, '')}/${RIME_PANEL_ROUTE}/live-edit?${params}`;
|
|
23
|
+
const live = absolute(`/${RIME_PANEL_ROUTE}/live-edit?${params}`);
|
|
25
24
|
return { ...args, doc: { ...doc, _live: live } };
|
|
26
25
|
});
|
|
@@ -22,11 +22,15 @@ export const augmentVersions = (config) => {
|
|
|
22
22
|
if (normalizedVersions.draft) {
|
|
23
23
|
fields.push(text('status').defaultValue(VERSIONS_STATUS.DRAFT, { fill: 'save' }).hidden());
|
|
24
24
|
}
|
|
25
|
-
//
|
|
26
|
-
// existing row as `false`. Reads filter on `isAutoSave != true`, and SQLite
|
|
27
|
-
// null row as passing that.
|
|
25
|
+
// `$notNull({ default: false })` makes the column not null with a default, so a migration
|
|
26
|
+
// backfills every existing row as `false`. Reads filter on `isAutoSave != true`, and SQLite
|
|
27
|
+
// does not count a null row as passing that.
|
|
28
28
|
if (normalizedVersions.draft && normalizedVersions.autoSave) {
|
|
29
|
-
fields.push(toggle('isAutoSave')
|
|
29
|
+
fields.push(toggle('isAutoSave')
|
|
30
|
+
.defaultValue(false, { fill: 'save' })
|
|
31
|
+
.required()
|
|
32
|
+
.hidden()
|
|
33
|
+
.$notNull({ default: false }));
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
else {
|
|
@@ -13,7 +13,7 @@ import { isRelationField } from '../../../../../fields/relation/index.js';
|
|
|
13
13
|
import { Relation } from '../../../../../fields/relation/relation.js';
|
|
14
14
|
import { getValueAtPath, isObjectLiteral, omit, setValueAtPath } from '../../../../../util/object.js';
|
|
15
15
|
import { retireAutoSaves } from '../retire-auto-saves.server.js';
|
|
16
|
-
import { fallbackDataFromOriginal } from '
|
|
16
|
+
import { fallbackDataFromOriginal } from '../../../../pipeline/fallback-data-from-original.js';
|
|
17
17
|
/**
|
|
18
18
|
* Where a versioned document's content lives for *this* update — overriding the default.
|
|
19
19
|
*
|
|
@@ -189,6 +189,11 @@ export const handleNewVersion = Hooks.beforeUpdate(async function handleNewVersi
|
|
|
189
189
|
// `resolveContentOwner` set stands.
|
|
190
190
|
return args;
|
|
191
191
|
});
|
|
192
|
+
/**
|
|
193
|
+
* The data of a new version row: the submission, with the upload's file read from disk when none
|
|
194
|
+
* was sent, every unsent field taken from the original, `status` defaulting to draft, relations
|
|
195
|
+
* read at depth 1 turned back into refs, no row ids, and `ownerId` naming the document.
|
|
196
|
+
*/
|
|
192
197
|
async function prepareDataForNewVersion(args) {
|
|
193
198
|
const { config, originalDoc, originalConfigMap } = args;
|
|
194
199
|
let data = { ...args.data };
|
|
@@ -213,7 +218,6 @@ async function prepareDataForNewVersion(args) {
|
|
|
213
218
|
configMap: originalConfigMap,
|
|
214
219
|
ignore: ['status']
|
|
215
220
|
});
|
|
216
|
-
// Set default status to "draft" if no data.status
|
|
217
221
|
if (!data.status) {
|
|
218
222
|
data.status = VERSIONS_STATUS.DRAFT;
|
|
219
223
|
}
|
|
@@ -12,8 +12,7 @@ export const validateVersions = (config) => {
|
|
|
12
12
|
if (config.versions.autoSave && !config.versions.draft) {
|
|
13
13
|
errors.push(`Versions autoSave requires draft: true (${config.slug})`);
|
|
14
14
|
}
|
|
15
|
-
//
|
|
16
|
-
// only an auto-saved row still names could be removed from disk.
|
|
15
|
+
// An upload collection does not auto-save.
|
|
17
16
|
if (config.versions.autoSave && 'upload' in config && config.upload) {
|
|
18
17
|
errors.push(`Versions autoSave is not supported on an upload collection (${config.slug})`);
|
|
19
18
|
}
|
|
@@ -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
|