rimecms 0.33.0 → 1.0.1
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/auth.server.d.ts +2 -2
- package/dist/adapter-sqlite/columns.server.js +2 -2
- package/dist/adapter-sqlite/connect.server.d.ts +12 -0
- package/dist/adapter-sqlite/connect.server.js +31 -0
- package/dist/adapter-sqlite/generate-schema/index.server.js +11 -3
- package/dist/adapter-sqlite/generate-schema/root.server.d.ts +13 -4
- package/dist/adapter-sqlite/generate-schema/root.server.js +75 -131
- package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +36 -15
- package/dist/adapter-sqlite/generate-schema/templates.server.js +60 -18
- package/dist/adapter-sqlite/index.server.d.ts +13 -5
- package/dist/adapter-sqlite/index.server.js +9 -6
- package/dist/adapter-sqlite/naming.server.d.ts +6 -8
- package/dist/adapter-sqlite/naming.server.js +22 -4
- package/dist/adapter-sqlite/paths.server.d.ts +10 -0
- package/dist/adapter-sqlite/paths.server.js +131 -0
- package/dist/adapter-sqlite/read.server.d.ts +10 -1
- package/dist/adapter-sqlite/read.server.js +22 -10
- package/dist/adapter-sqlite/rows.server.d.ts +1 -1
- package/dist/adapter-sqlite/select.server.d.ts +19 -0
- package/dist/adapter-sqlite/select.server.js +71 -63
- package/dist/adapter-sqlite/table.server.d.ts +2 -2
- package/dist/adapter-sqlite/transform.server.js +33 -3
- package/dist/adapter-sqlite/types.server.d.ts +10 -3
- package/dist/adapter-sqlite/where.server.d.ts +2 -3
- package/dist/adapter-sqlite/where.server.js +19 -1
- package/dist/core/adapter.d.ts +98 -0
- package/dist/core/auth/better-auth/config.server.d.ts +3 -3
- package/dist/core/auth/better-auth/instance.server.d.ts +6 -6
- package/dist/core/auth/handler/index.server.js +1 -1
- package/dist/core/auth/staff/derive.js +1 -1
- package/dist/core/auth/validate-config.js +3 -5
- package/dist/core/boot.server.d.ts +8 -8
- package/dist/core/config/context.server.d.ts +2 -2
- package/dist/core/config/types.d.ts +43 -5
- package/dist/core/config/validate.server.js +34 -51
- package/dist/core/dev/cli/commands/build.js +21 -6
- package/dist/core/dev/cli/commands/init.server.d.ts +2 -1
- package/dist/core/dev/cli/commands/init.server.js +32 -6
- package/dist/core/dev/cli/index.js +1 -0
- package/dist/core/dev/cli/templates/init.d.ts +6 -1
- package/dist/core/dev/cli/templates/init.js +30 -2
- package/dist/core/dev/cli/util/package-manager.server.d.ts +1 -0
- package/dist/core/dev/cli/util/package-manager.server.js +11 -8
- package/dist/core/dev/cli/util/package.server.d.ts +9 -0
- package/dist/core/dev/cli/util/package.server.js +43 -0
- package/dist/core/dev/codegen/routes/common.server.d.ts +2 -0
- package/dist/core/dev/codegen/routes/common.server.js +7 -3
- package/dist/core/dev/codegen/routes/util.server.d.ts +2 -1
- package/dist/core/dev/codegen/routes/util.server.js +4 -1
- package/dist/core/dev/codegen/types/contributions.server.d.ts +3 -2
- package/dist/core/dev/codegen/types/contributions.server.js +10 -3
- package/dist/core/dev/config-memo.server.js +4 -0
- package/dist/core/dev/vite.server.js +4 -3
- package/dist/core/fields/blank.d.ts +21 -0
- package/dist/core/fields/blank.js +37 -0
- package/dist/core/fields/builders/field-builder.d.ts +53 -0
- package/dist/core/fields/builders/field-builder.js +14 -1
- package/dist/core/fields/builders/form-field-builder.d.ts +8 -0
- package/dist/core/fields/builders/form-field-builder.js +14 -1
- package/dist/core/fields/util.d.ts +9 -2
- package/dist/core/fields/util.js +123 -135
- package/dist/core/fields/walk.d.ts +44 -0
- package/dist/core/fields/walk.js +55 -0
- package/dist/core/handler.server.js +4 -0
- package/dist/core/i18n/context.d.ts +5 -0
- package/dist/core/i18n/context.js +6 -0
- package/dist/core/i18n/en/common.d.ts +71 -0
- package/dist/core/i18n/en/common.js +72 -1
- package/dist/core/i18n/en/fields.d.ts +68 -0
- package/dist/core/i18n/en/fields.js +69 -1
- package/dist/core/i18n/fr/common.d.ts +71 -0
- package/dist/core/i18n/fr/common.js +72 -1
- package/dist/core/i18n/fr/fields.d.ts +68 -0
- package/dist/core/i18n/fr/fields.js +69 -1
- package/dist/core/i18n/index.d.ts +29 -3
- package/dist/core/i18n/index.js +55 -29
- package/dist/core/locale/copy.server.js +3 -3
- package/dist/core/logger.server.js +15 -6
- package/dist/core/pipeline/build-document.server.d.ts +3 -0
- package/dist/core/pipeline/build-document.server.js +10 -7
- package/dist/core/pipeline/config-map/index.d.ts +9 -0
- package/dist/core/pipeline/config-map/index.js +16 -50
- package/dist/core/pipeline/hooks/process-document-fields.server.d.ts +3 -0
- package/dist/core/pipeline/hooks/process-document-fields.server.js +48 -12
- package/dist/core/pipeline/hooks/set-default-values.server.d.ts +1 -0
- package/dist/core/pipeline/hooks/set-default-values.server.js +1 -0
- package/dist/core/pipeline/persist/blocks/extract.server.js +1 -1
- package/dist/core/pipeline/persist/relations/extract.server.js +2 -0
- package/dist/core/pipeline/populate-relations.server.d.ts +27 -0
- package/dist/core/pipeline/populate-relations.server.js +42 -0
- package/dist/core/pipeline/run.server.d.ts +17 -6
- package/dist/core/pipeline/run.server.js +44 -30
- package/dist/core/plugins/cache/module.server.d.ts +1 -1
- package/dist/core/plugins/cache/module.server.js +5 -5
- package/dist/core/prototype/area/api.server.js +1 -2
- package/dist/core/prototype/area/definition.js +1 -10
- package/dist/core/prototype/area/definition.server.js +4 -5
- package/dist/core/prototype/area/hooks.server.js +3 -2
- package/dist/core/prototype/area/operations/find.js +2 -0
- package/dist/core/prototype/blank.d.ts +26 -0
- package/dist/core/prototype/blank.js +22 -0
- package/dist/core/prototype/collection/api.server.d.ts +29 -3
- package/dist/core/prototype/collection/api.server.js +47 -4
- package/dist/core/prototype/collection/definition.js +0 -3
- package/dist/core/prototype/collection/hooks/merge-with-blank.server.d.ts +5 -1
- package/dist/core/prototype/collection/hooks/merge-with-blank.server.js +8 -22
- package/dist/core/prototype/collection/hooks.server.js +11 -5
- package/dist/core/prototype/collection/nested/module.server.js +3 -1
- package/dist/core/prototype/collection/nested/tree.d.ts +12 -0
- package/dist/core/prototype/collection/nested/tree.js +42 -0
- package/dist/core/prototype/collection/operations/duplicate.js +1 -1
- package/dist/core/prototype/collection/operations/find-by-id.js +2 -0
- package/dist/core/prototype/collection/operations/find-by-ids.d.ts +19 -0
- package/dist/core/prototype/collection/operations/find-by-ids.js +54 -0
- package/dist/core/prototype/collection/operations/find.js +21 -27
- package/dist/core/prototype/collection/operations/update-slug-by-id.d.ts +20 -0
- package/dist/core/prototype/collection/operations/update-slug-by-id.js +53 -0
- package/dist/core/prototype/collection/rest/index.server.js +3 -1
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.d.ts +2 -0
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.js +20 -0
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.d.ts +2 -1
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.js +4 -27
- package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +1 -1
- package/dist/core/prototype/collection/upload/directories/derive.js +3 -1
- package/dist/core/prototype/collection/upload/disk/delete.server.js +1 -2
- package/dist/core/prototype/define.js +2 -0
- package/dist/core/prototype/shared/metas/fields.js +2 -1
- package/dist/core/prototype/shared/title/find-title.d.ts +2 -1
- package/dist/core/prototype/shared/title/find-title.js +5 -28
- package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +1 -1
- package/dist/core/prototype/shared/url/addresses.server.d.ts +36 -0
- package/dist/core/prototype/shared/url/addresses.server.js +119 -0
- package/dist/core/prototype/shared/url/doc-type.d.ts +6 -0
- package/dist/core/prototype/shared/url/doc-type.js +9 -0
- package/dist/core/prototype/shared/url/format.server.d.ts +27 -0
- package/dist/core/prototype/shared/url/format.server.js +38 -0
- package/dist/core/prototype/shared/url/hooks/create-paths.server.d.ts +2 -0
- package/dist/core/prototype/shared/url/hooks/create-paths.server.js +9 -0
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.d.ts +6 -0
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.js +19 -0
- package/dist/core/prototype/shared/url/hooks/index.server.d.ts +5 -1
- package/dist/core/prototype/shared/url/hooks/index.server.js +5 -1
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.d.ts +2 -0
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.js +8 -0
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.d.ts +5 -0
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.js +19 -0
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.d.ts +8 -0
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.js +38 -0
- package/dist/core/prototype/shared/url/refresh.server.d.ts +36 -0
- package/dist/core/prototype/shared/url/refresh.server.js +58 -0
- package/dist/core/prototype/shared/versions/configure.server.js +3 -0
- package/dist/core/routes/context.server.d.ts +2 -1
- package/dist/fields/blocks/component/AddBlockButton.svelte +48 -137
- package/dist/fields/blocks/component/Block.svelte +153 -117
- package/dist/fields/blocks/component/Block.svelte.d.ts +11 -5
- package/dist/fields/blocks/component/BlockActions.svelte +76 -26
- package/dist/fields/blocks/component/BlockActions.svelte.d.ts +3 -0
- package/dist/fields/blocks/component/Blocks.svelte +248 -91
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +680 -0
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte.d.ts +7 -0
- package/dist/fields/blocks/component/focus/Layers.svelte +145 -0
- package/dist/fields/blocks/component/focus/Layers.svelte.d.ts +9 -0
- package/dist/fields/blocks/component/focus/LayersList.svelte +304 -0
- package/dist/fields/blocks/component/focus/LayersList.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/focus/Palette.svelte +135 -0
- package/dist/fields/blocks/component/focus/Palette.svelte.d.ts +9 -0
- package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte +77 -0
- package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/focus/Renders.svelte +302 -0
- package/dist/fields/blocks/component/focus/Renders.svelte.d.ts +11 -0
- package/dist/fields/blocks/component/focus/Stage.svelte +190 -0
- package/dist/fields/blocks/component/focus/Stage.svelte.d.ts +8 -0
- package/dist/fields/blocks/component/focus/StagePlaceholder.svelte +69 -0
- package/dist/fields/blocks/component/focus/StagePlaceholder.svelte.d.ts +3 -0
- package/dist/fields/blocks/component/focus/focus.svelte.d.ts +140 -0
- package/dist/fields/blocks/component/focus/focus.svelte.js +424 -0
- package/dist/fields/blocks/component/picker/BlockPicker.svelte +88 -0
- package/dist/fields/blocks/component/picker/BlockPicker.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/picker/BlockTile.svelte +121 -0
- package/dist/fields/blocks/component/picker/BlockTile.svelte.d.ts +12 -0
- package/dist/fields/blocks/index.d.ts +49 -7
- package/dist/fields/blocks/index.js +61 -12
- package/dist/fields/checkbox/component/Checkbox.svelte +11 -37
- package/dist/fields/checkbox/component/Checkbox.svelte.d.ts +1 -0
- package/dist/fields/combobox/component/ComboBox.svelte +37 -7
- package/dist/fields/combobox/component/combobox.css +26 -10
- package/dist/fields/date/component/Date.svelte +43 -12
- package/dist/fields/group/component/Group.svelte +110 -41
- package/dist/fields/group/index.d.ts +5 -1
- package/dist/fields/group/index.js +10 -2
- package/dist/fields/link/component/Link.svelte +184 -143
- package/dist/fields/link/component/RessourceInput.svelte +26 -24
- package/dist/fields/link/index.d.ts +2 -1
- package/dist/fields/link/module.server.js +2 -4
- package/dist/fields/number/component/Number.svelte +38 -20
- package/dist/fields/number/component/number.css +22 -20
- package/dist/fields/number/index.d.ts +1 -0
- package/dist/fields/radio/component/Radio.svelte +12 -0
- package/dist/fields/radio/index.js +1 -1
- package/dist/fields/relation/component/Relation.svelte +169 -40
- package/dist/fields/relation/component/RelationInline.svelte +258 -0
- package/dist/fields/relation/component/RelationInline.svelte.d.ts +26 -0
- package/dist/fields/relation/component/default/Default.svelte +210 -100
- package/dist/fields/relation/component/default/Default.svelte.d.ts +14 -1
- package/dist/fields/relation/component/types.d.ts +4 -0
- package/dist/fields/relation/component/upload/Browse.svelte +619 -88
- package/dist/fields/relation/component/upload/Browse.svelte.d.ts +10 -2
- package/dist/fields/relation/component/upload/Create.svelte +41 -0
- package/dist/fields/relation/component/upload/Create.svelte.d.ts +13 -0
- package/dist/fields/relation/component/upload/Upload.svelte +287 -101
- package/dist/fields/relation/component/upload/Upload.svelte.d.ts +6 -1
- package/dist/fields/relation/component/upload/upload.css +5 -81
- package/dist/fields/relation/index.d.ts +1 -41
- package/dist/fields/relation/index.js +0 -67
- package/dist/fields/relation/module.server.js +7 -1
- package/dist/fields/relation/populate.d.ts +8 -0
- package/dist/fields/relation/populate.js +49 -0
- package/dist/fields/relation/util.d.ts +69 -0
- package/dist/fields/relation/util.js +103 -0
- package/dist/fields/relation/value.d.ts +25 -0
- package/dist/fields/relation/value.js +27 -0
- package/dist/fields/rich-text/client.d.ts +2 -5
- package/dist/fields/rich-text/client.js +1 -3
- package/dist/fields/rich-text/component/Cell.svelte +1 -1
- package/dist/fields/rich-text/component/RichText.svelte +12 -80
- package/dist/fields/rich-text/component/RichText.svelte.d.ts +1 -1
- package/dist/fields/rich-text/component/RichTextInline.svelte +28 -0
- package/dist/fields/rich-text/component/RichTextInline.svelte.d.ts +11 -0
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.css +4 -3
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +3 -1
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.css +2 -2
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +7 -10
- package/dist/fields/rich-text/component/drag-handle/drag-handle.css +0 -2
- package/dist/fields/rich-text/component/styles/editor.css +111 -0
- package/dist/fields/rich-text/component/styles/field.css +71 -0
- package/dist/fields/rich-text/component/suggestion/suggestion.svelte +41 -56
- package/dist/fields/rich-text/core/build-editor-config.js +1 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.js +29 -3
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.d.ts +1 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +2 -1
- package/dist/fields/rich-text/core/features/fields/fields.css +2 -3
- package/dist/fields/rich-text/core/features/hr/hr.css +4 -4
- package/dist/fields/rich-text/core/features/link/component/link-selector.css +0 -4
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +24 -8
- package/dist/fields/rich-text/core/features/resource/resource-extension.js +3 -3
- package/dist/fields/rich-text/core/features/resource/resource.svelte +21 -7
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +3 -4
- package/dist/fields/rich-text/core/features/upload/upload.svelte +21 -9
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte +103 -0
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte.d.ts +15 -0
- package/dist/fields/rich-text/index.d.ts +0 -17
- package/dist/fields/rich-text/index.js +0 -44
- package/dist/fields/rich-text/json.d.ts +18 -0
- package/dist/fields/rich-text/json.js +44 -0
- package/dist/fields/select/component/Select.svelte +67 -28
- package/dist/fields/slug/component/Slug.svelte +26 -53
- package/dist/fields/slug/index.d.ts +1 -0
- package/dist/fields/slug/index.js +1 -1
- package/dist/fields/tabs/component/Tabs.svelte +28 -22
- package/dist/fields/tabs/index.d.ts +4 -1
- package/dist/fields/tabs/index.js +17 -5
- package/dist/fields/text/index.d.ts +1 -0
- package/dist/fields/textarea/component/TextArea.svelte +28 -13
- package/dist/fields/textarea/index.d.ts +1 -0
- package/dist/fields/time/component/Time.svelte +9 -2
- package/dist/fields/toggle/component/Toggle.svelte +8 -25
- package/dist/fields/toggle/component/Toggle.svelte.d.ts +1 -0
- package/dist/fields/toggle/index.d.ts +1 -0
- package/dist/fields/tree/component/AddItemButton.svelte +18 -5
- package/dist/fields/tree/component/Tree.svelte +48 -19
- package/dist/fields/tree/component/TreeBlock.svelte +318 -104
- package/dist/fields/tree/component/TreeBlockActions.svelte +71 -7
- package/dist/fields/tree/component/TreeBlockActions.svelte.d.ts +4 -0
- package/dist/fields/tree/component/props.d.ts +2 -1
- package/dist/fields/tree/index.d.ts +13 -1
- package/dist/fields/tree/index.js +35 -9
- package/dist/fields/types.d.ts +3 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -6
- package/dist/{panel/components/sections/live → live}/Consumer.svelte +2 -2
- package/dist/{panel/components/sections/live → live}/Consumer.svelte.d.ts +1 -1
- package/dist/{panel/components/sections/live → live}/LiveEdit.svelte +3 -3
- package/dist/{panel/components/sections/live → live}/Provider.svelte +1 -1
- package/dist/{panel/context/live.svelte.d.ts → live/context.svelte.d.ts} +1 -1
- package/dist/{panel/context/live.svelte.js → live/context.svelte.js} +3 -74
- package/dist/panel/components/Root.svelte +16 -44
- package/dist/panel/components/Root.svelte.d.ts +1 -1
- package/dist/panel/components/fields/Error.svelte +18 -3
- package/dist/panel/components/fields/FieldsPreview.svelte +30 -17
- package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +25 -3
- package/dist/panel/components/fields/Hint.svelte +51 -8
- package/dist/panel/components/fields/Hint.svelte.d.ts +11 -0
- package/dist/panel/components/fields/Label.svelte +2 -0
- package/dist/panel/components/fields/LabelFor.svelte +7 -2
- package/dist/panel/components/fields/RenderFields.svelte +10 -3
- package/dist/panel/components/fields/fieldset.svelte.d.ts +4 -1
- package/dist/panel/components/fields/fieldset.svelte.js +9 -2
- package/dist/panel/components/fields/index.d.ts +1 -0
- package/dist/panel/components/fields/setting.css +82 -0
- package/dist/panel/components/sections/auth/AuthForm.svelte +25 -26
- package/dist/panel/components/sections/collection/Avatar.svelte +61 -0
- package/dist/panel/components/sections/collection/Avatar.svelte.d.ts +9 -0
- package/dist/panel/components/sections/collection/DocStatus.svelte +28 -0
- package/dist/panel/components/sections/collection/DocStatus.svelte.d.ts +7 -0
- package/dist/panel/components/sections/collection/Empty.svelte +3 -3
- package/dist/panel/components/sections/collection/StatusDot.svelte +7 -5
- package/dist/panel/components/sections/collection/When.svelte +33 -0
- package/dist/panel/components/sections/collection/When.svelte.d.ts +8 -0
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte +65 -21
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte.d.ts +3 -2
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte +45 -162
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte.d.ts +3 -2
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte +151 -0
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte.d.ts +17 -0
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +177 -0
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte.d.ts +12 -0
- package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte +75 -0
- package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte.d.ts +8 -0
- package/dist/panel/components/sections/collection/folder/Folder.svelte +18 -3
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +26 -18
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +98 -58
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte.d.ts +0 -1
- package/dist/panel/components/sections/collection/folder/Folders.svelte +60 -0
- package/dist/panel/components/sections/collection/folder/Folders.svelte.d.ts +7 -0
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +31 -71
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte.d.ts +1 -0
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +5 -3
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +250 -37
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte.d.ts +2 -0
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +43 -18
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +6 -4
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte +69 -58
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte.d.ts +0 -1
- package/dist/panel/components/sections/collection/header/FilterMenu.svelte +60 -0
- package/dist/panel/components/sections/collection/header/FilterMenu.svelte.d.ts +14 -0
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +17 -26
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +19 -34
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +99 -68
- package/dist/panel/components/sections/collection/list/columns.d.ts +21 -0
- package/dist/panel/components/sections/collection/list/columns.js +23 -0
- package/dist/panel/components/sections/collection/list/header/Header.svelte +99 -51
- package/dist/panel/components/sections/collection/list/row/Row.svelte +165 -82
- package/dist/panel/components/sections/collection/list/row/Row.svelte.d.ts +4 -0
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +92 -44
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte.d.ts +1 -0
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +139 -43
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte.d.ts +2 -0
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +1 -1
- package/dist/panel/components/sections/commands/CommandButton.svelte +99 -0
- package/dist/panel/components/sections/commands/CommandButton.svelte.d.ts +10 -0
- package/dist/panel/components/sections/commands/CommandPalette.svelte +275 -0
- package/dist/panel/components/sections/commands/CommandPalette.svelte.d.ts +8 -0
- package/dist/panel/components/sections/commands/Commands.svelte +18 -0
- package/dist/panel/components/sections/commands/Commands.svelte.d.ts +9 -0
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +23 -7
- package/dist/panel/components/sections/document/AuthFooter.svelte +31 -12
- package/dist/panel/components/sections/document/AutoSaveBanner.svelte +24 -7
- package/dist/panel/components/sections/document/ButtonSave.svelte +32 -21
- package/dist/panel/components/sections/document/ButtonSave.svelte.d.ts +5 -5
- package/dist/panel/components/sections/document/ButtonStatus.svelte +68 -20
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +199 -0
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte.d.ts +10 -0
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte +2 -2
- package/dist/panel/components/sections/document/Document.svelte +96 -65
- package/dist/panel/components/sections/document/DocumentChildren.svelte +175 -0
- package/dist/panel/components/sections/document/DocumentChildren.svelte.d.ts +8 -0
- package/dist/panel/components/sections/document/DocumentUrl.svelte +119 -0
- package/dist/panel/components/sections/document/DocumentUrl.svelte.d.ts +9 -0
- package/dist/panel/components/sections/document/Header.svelte +171 -94
- package/dist/panel/components/sections/document/Settings.svelte +255 -110
- package/dist/panel/components/sections/document/Settings.svelte.d.ts +0 -1
- package/dist/panel/components/sections/document/Versions.svelte +5 -3
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +112 -53
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte.d.ts +2 -2
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +74 -41
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte +30 -11
- package/dist/panel/components/sections/live/live-edit-panel.css +2 -2
- package/dist/panel/components/sections/page-layout/Page.svelte +13 -1
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +55 -27
- package/dist/panel/components/ui/button/button.svelte +81 -54
- package/dist/panel/components/ui/button/index.d.ts +7 -3
- package/dist/panel/components/ui/button/index.js +2 -2
- package/dist/panel/components/ui/calendar/calendar.css +27 -27
- package/dist/panel/components/ui/card/card-description.svelte +1 -1
- package/dist/panel/components/ui/card/card.svelte +21 -4
- package/dist/panel/components/ui/card-document/card-document.svelte +24 -12
- package/dist/panel/components/ui/card-resource/card-resource.svelte +26 -8
- package/dist/panel/components/ui/checkbox/checkbox.css +8 -10
- package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/panel/components/ui/command/command-dialog.css +28 -4
- package/dist/panel/components/ui/command/command-dialog.svelte +4 -1
- package/dist/panel/components/ui/command/command-dialog.svelte.d.ts +2 -0
- package/dist/panel/components/ui/command/command-empty.css +1 -1
- package/dist/panel/components/ui/command/command-group.css +3 -3
- package/dist/panel/components/ui/command/command-input-select.svelte +3 -3
- package/dist/panel/components/ui/command/command-input.svelte +38 -14
- package/dist/panel/components/ui/command/command-input.svelte.d.ts +6 -1
- package/dist/panel/components/ui/command/command-item.css +2 -2
- package/dist/panel/components/ui/command/command-list.css +1 -1
- package/dist/panel/components/ui/command/command-separator.css +1 -1
- package/dist/panel/components/ui/context-menu/context-menu-item.css +2 -2
- package/dist/panel/components/ui/context-menu/context-menu.css +6 -7
- package/dist/panel/components/ui/dialog/dialog-content.css +8 -10
- package/dist/panel/components/ui/dialog/dialog-content.svelte +19 -0
- package/dist/panel/components/ui/dialog/dialog-description.css +1 -1
- package/dist/panel/components/ui/dialog/dialog-footer.svelte +5 -1
- package/dist/panel/components/ui/dialog/dialog-overlay.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +19 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +6 -4
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-separator.css +1 -1
- package/dist/panel/components/ui/input/input.svelte +57 -31
- package/dist/panel/components/ui/kbd/Kbd.svelte +90 -0
- package/dist/panel/components/ui/kbd/Kbd.svelte.d.ts +11 -0
- package/dist/panel/components/ui/kbd/index.d.ts +1 -0
- package/dist/panel/components/ui/kbd/index.js +1 -0
- package/dist/panel/components/ui/label/label.css +5 -3
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +27 -15
- package/dist/panel/components/ui/nav/Nav.svelte +180 -110
- package/dist/panel/components/ui/nav/Nav.svelte.d.ts +0 -2
- package/dist/panel/components/ui/nav/NavGroup.svelte +87 -73
- package/dist/panel/components/ui/nav/NavItemButton.svelte +69 -29
- package/dist/panel/components/ui/nav/UserButton.svelte +132 -71
- package/dist/panel/components/ui/page-header/PageHeader.svelte +140 -42
- package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +8 -1
- package/dist/panel/components/ui/popover/popover-content.css +4 -3
- package/dist/panel/components/ui/radio-group/radio-group.css +4 -6
- package/dist/panel/components/ui/radio-row-group/radio-row-group.css +19 -7
- package/dist/panel/components/ui/scroll-area/scroll-area.css +2 -2
- package/dist/panel/components/ui/separator/separator.svelte +1 -1
- package/dist/panel/components/ui/sheet/index.d.ts +4 -4
- package/dist/panel/components/ui/sheet/index.js +5 -5
- package/dist/panel/components/ui/sheet/sheet.css +50 -11
- package/dist/panel/components/ui/sonner/sonner.css +11 -8
- package/dist/panel/components/ui/switch/switch.css +13 -18
- package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
- package/dist/panel/components/ui/tabs/tabs.css +44 -35
- package/dist/panel/components/ui/tag/tag.svelte +20 -6
- package/dist/panel/components/ui/tooltip/tooltip-content.svelte +14 -4
- package/dist/panel/components/ui/tree/tree-rows.css +146 -0
- package/dist/panel/context/blocks-ops.d.ts +78 -0
- package/dist/panel/context/blocks-ops.js +170 -0
- package/dist/panel/context/collection.svelte.d.ts +28 -0
- package/dist/panel/context/collection.svelte.js +120 -65
- package/dist/panel/context/commands.svelte.d.ts +80 -0
- package/dist/panel/context/commands.svelte.js +108 -0
- package/dist/panel/context/config.svelte.d.ts +2 -2
- package/dist/panel/context/documentForm.svelte.d.ts +34 -2
- package/dist/panel/context/documentForm.svelte.js +106 -103
- package/dist/panel/context/nav.svelte.d.ts +23 -0
- package/dist/panel/context/nav.svelte.js +56 -0
- package/dist/panel/fonts/Geist-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/GeistMono-VariableFont_wght.ttf +0 -0
- package/dist/panel/index.d.ts +7 -4
- package/dist/panel/index.js +11 -5
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +16 -1
- package/dist/panel/pages/collection/CollectionPage.svelte +236 -61
- package/dist/panel/pages/collection/load.server.js +1 -1
- package/dist/panel/pages/dashboard/Dashboard.svelte +135 -90
- package/dist/panel/pages/dashboard/DashboardCard.svelte +109 -0
- package/dist/panel/pages/dashboard/DashboardCard.svelte.d.ts +14 -0
- package/dist/panel/pages/dashboard/DashboardCollection.svelte +180 -57
- package/dist/panel/pages/dashboard/DashboardCollection.svelte.d.ts +1 -0
- package/dist/panel/pages/dashboard/DashboardRow.svelte +93 -0
- package/dist/panel/pages/dashboard/DashboardRow.svelte.d.ts +16 -0
- package/dist/panel/pages/dashboard/load.server.js +49 -25
- package/dist/panel/pages/dashboard/time.d.ts +19 -0
- package/dist/panel/pages/dashboard/time.js +29 -0
- package/dist/panel/pages/dashboard/types.d.ts +9 -2
- package/dist/panel/pages/live/Live.svelte +53 -50
- package/dist/panel/public.d.ts +4 -0
- package/dist/panel/public.js +6 -0
- package/dist/panel/style/font.css +21 -32
- package/dist/panel/style/index.css +191 -122
- package/dist/panel/style/mixins/index.css +14 -0
- package/dist/panel/style/palette.css +35 -26
- package/dist/panel/style/postcss/size-function.d.ts +4 -0
- package/dist/panel/style/postcss/size-function.js +24 -0
- package/dist/panel/style/radius.css +4 -5
- package/dist/panel/style/scheme.css +111 -0
- package/dist/panel/style/size.css +3 -0
- package/dist/panel/util/Sortable.js +9 -4
- package/dist/panel/util/keys.d.ts +24 -0
- package/dist/panel/util/keys.js +63 -0
- package/dist/panel/util/time.d.ts +12 -0
- package/dist/panel/util/time.js +35 -0
- package/dist/panel/util/upload-file.d.ts +106 -0
- package/dist/panel/util/upload-file.js +165 -0
- package/dist/public.d.ts +13 -0
- package/dist/public.js +12 -0
- package/dist/util/index.d.ts +7 -10
- package/dist/util/index.js +7 -8
- package/dist/util/object.d.ts +10 -0
- package/dist/util/object.js +22 -1
- package/dist/util/string.d.ts +17 -0
- package/dist/util/string.js +23 -0
- package/package.json +12 -8
- package/dist/core/pipeline/config-map/build-tree-map.d.ts +0 -4
- package/dist/core/pipeline/config-map/build-tree-map.js +0 -30
- package/dist/core/prototype/doc.d.ts +0 -31
- package/dist/core/prototype/doc.js +0 -118
- package/dist/core/prototype/shared/url/augment.d.ts +0 -13
- package/dist/core/prototype/shared/url/augment.js +0 -11
- package/dist/core/prototype/shared/url/hooks/populate-url.server.d.ts +0 -4
- package/dist/core/prototype/shared/url/hooks/populate-url.server.js +0 -120
- package/dist/fields/relation/client.d.ts +0 -28
- package/dist/fields/relation/client.js +0 -37
- package/dist/fields/rich-text/component/styles/rich-text.css +0 -183
- package/dist/panel/components/sections/collection/header/Header.svelte +0 -17
- package/dist/panel/components/sections/collection/header/Header.svelte.d.ts +0 -3
- package/dist/panel/components/sections/collection/header/Separator.svelte +0 -8
- package/dist/panel/components/sections/collection/header/Separator.svelte.d.ts +0 -26
- package/dist/panel/components/sections/collection/tree/util.d.ts +0 -12
- package/dist/panel/components/sections/collection/tree/util.js +0 -22
- package/dist/panel/fonts/ChivoMono-Italic-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/ChivoMono-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/panel/fonts/Lora-Italic-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/Lora-VariableFont_wght.ttf +0 -0
- package/dist/panel/style/shadow.css +0 -10
- package/dist/util/path.d.ts +0 -16
- package/dist/util/path.js +0 -19
- /package/dist/{panel/components/sections/live → live}/LiveEdit.svelte.d.ts +0 -0
- /package/dist/{panel/components/sections/live → live}/Provider.svelte.d.ts +0 -0
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type { BuiltCollection } from '../../../../types';
|
|
1
|
+
import type { BuiltCollection, UploadDoc } from '../../../../types';
|
|
2
2
|
type Props = {
|
|
3
3
|
open: boolean;
|
|
4
|
-
addValue: (item: string) => void;
|
|
5
4
|
config: BuiltCollection;
|
|
5
|
+
many: boolean;
|
|
6
|
+
/** Document ids, in the order they were picked. */
|
|
7
|
+
selected: string[];
|
|
8
|
+
/** The whole selection once confirmed; `seen` are the docs the grid has shown. */
|
|
9
|
+
onChange: (ids: string[], seen: UploadDoc[]) => void;
|
|
10
|
+
/** The level of a document created from the picker. */
|
|
11
|
+
nestedLevel: number;
|
|
12
|
+
/** A document is being created, or no longer: the one underneath holds its saves meanwhile. */
|
|
13
|
+
onCreating?: (creating: boolean) => void;
|
|
6
14
|
};
|
|
7
15
|
declare const Browse: import("svelte").Component<Props, {}, "open">;
|
|
8
16
|
type Browse = ReturnType<typeof Browse>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { BuiltCollection } from '../../../../core/config/types.js';
|
|
3
|
+
import type { GenericDoc } from '../../../../core/prototype/types.js';
|
|
4
|
+
import Doc from '../../../../panel/components/sections/document/Document.svelte';
|
|
5
|
+
import * as Sheet from '../../../../panel/components/ui/sheet/index.js';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
open: boolean;
|
|
9
|
+
config: BuiltCollection;
|
|
10
|
+
/** The level of the new document's form: one above the document it is created for. */
|
|
11
|
+
nestedLevel: number;
|
|
12
|
+
onCreated: (doc: GenericDoc) => void;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
};
|
|
15
|
+
let { open = $bindable(), config, nestedLevel, onCreated, onCancel }: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<!-- A new document of the related collection, in a sheet from the right. -->
|
|
19
|
+
<Sheet.Root
|
|
20
|
+
bind:open
|
|
21
|
+
onOpenChange={(value) => {
|
|
22
|
+
if (!value) onCancel();
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Sheet.Content style="--rz-page-gutter:var(--rz-size-6)" showCloseButton={false} side="right">
|
|
26
|
+
<Doc
|
|
27
|
+
doc={config.blank()}
|
|
28
|
+
readOnly={false}
|
|
29
|
+
onClose={() => {
|
|
30
|
+
open = false;
|
|
31
|
+
onCancel();
|
|
32
|
+
}}
|
|
33
|
+
operation="create"
|
|
34
|
+
onNestedDocumentCreated={(doc: GenericDoc) => {
|
|
35
|
+
open = false;
|
|
36
|
+
onCreated(doc);
|
|
37
|
+
}}
|
|
38
|
+
{nestedLevel}
|
|
39
|
+
/>
|
|
40
|
+
</Sheet.Content>
|
|
41
|
+
</Sheet.Root>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BuiltCollection } from '../../../../core/config/types.js';
|
|
2
|
+
import type { GenericDoc } from '../../../../core/prototype/types.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
config: BuiltCollection;
|
|
6
|
+
/** The level of the new document's form: one above the document it is created for. */
|
|
7
|
+
nestedLevel: number;
|
|
8
|
+
onCreated: (doc: GenericDoc) => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const Create: import("svelte").Component<Props, {}, "open">;
|
|
12
|
+
type Create = ReturnType<typeof Create>;
|
|
13
|
+
export default Create;
|
|
@@ -1,140 +1,326 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
3
|
+
import { apiUrl, panelPath } from '../../../../core/routes/util.js';
|
|
4
|
+
import FileDrop from '../../../../panel/components/sections/collection/bulk-upload/FileDrop.svelte';
|
|
5
|
+
import SpinLoader from '../../../../panel/components/ui/spin-loader/SpinLoader.svelte';
|
|
6
|
+
import { getAPIProxyContext } from '../../../../panel/context/api-proxy.svelte.js';
|
|
7
|
+
import {
|
|
8
|
+
acceptLabel,
|
|
9
|
+
typeLabel,
|
|
10
|
+
uploadFiles,
|
|
11
|
+
type UploadProgress
|
|
12
|
+
} from '../../../../panel/util/upload-file.js';
|
|
13
|
+
import { Upload, X } from '@lucide/svelte';
|
|
10
14
|
import Sortable from 'sortablejs';
|
|
11
|
-
import {
|
|
12
|
-
import type { RelationComponentProps, RelationFieldItem } from '../types.js';
|
|
15
|
+
import type { RelationComponentProps } from '../types.js';
|
|
13
16
|
import Browse from './Browse.svelte';
|
|
14
17
|
import './upload.css';
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
type Props = RelationComponentProps & {
|
|
20
|
+
/** The library picker is open. */
|
|
21
|
+
browsing?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
let {
|
|
18
25
|
hasError,
|
|
19
|
-
|
|
26
|
+
readOnly,
|
|
27
|
+
setValue,
|
|
28
|
+
addUploaded,
|
|
20
29
|
many,
|
|
21
30
|
selectedItems,
|
|
22
31
|
removeValue,
|
|
23
|
-
availableItems,
|
|
24
32
|
relationConfig,
|
|
25
33
|
onOrderChange,
|
|
26
34
|
formNestedLevel,
|
|
27
35
|
onRelationCreation,
|
|
28
36
|
onRelationCreationCanceled,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}:
|
|
37
|
+
stamp,
|
|
38
|
+
browsing = $bindable(false)
|
|
39
|
+
}: Props = $props();
|
|
32
40
|
|
|
33
|
-
const
|
|
41
|
+
const APIProxy = getAPIProxyContext();
|
|
42
|
+
/** What the picker marks, in order. */
|
|
43
|
+
const selected = $derived(selectedItems.map((item) => item.documentId));
|
|
44
|
+
const accept = $derived(relationConfig.upload?.accept);
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
let create = $state(false);
|
|
37
|
-
let instance: ReturnType<typeof Sortable.create>;
|
|
46
|
+
/* ------------------------------------------------------------ uploading */
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
let progress = $state<UploadProgress | null>(null);
|
|
49
|
+
let failed = $state<string[]>([]);
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
/** Each file becomes a media of the library, then a pick of the field. */
|
|
52
|
+
async function upload(files: File[]) {
|
|
53
|
+
failed = [];
|
|
54
|
+
const target = { url: apiUrl(relationConfig.kebab), accept };
|
|
55
|
+
const result = await uploadFiles(files, target, (state) => (progress = state));
|
|
56
|
+
progress = null;
|
|
57
|
+
failed = result.failed;
|
|
58
|
+
if (!result.docs.length) return;
|
|
59
|
+
addUploaded(result.docs);
|
|
60
|
+
APIProxy.invalidate(apiUrl(relationConfig.kebab));
|
|
61
|
+
}
|
|
50
62
|
|
|
51
|
-
|
|
52
|
-
create = false;
|
|
53
|
-
onRelationCreated(doc);
|
|
54
|
-
};
|
|
63
|
+
/* ------------------------------------------------------------ ordering */
|
|
55
64
|
|
|
56
|
-
$
|
|
57
|
-
if (many) {
|
|
58
|
-
const list = document.querySelector(
|
|
59
|
-
`.rz-relation-upload__list[data-list="${stamp}"]`
|
|
60
|
-
) as HTMLDivElement;
|
|
61
|
-
instance = Sortable.create(list, sortableOptions);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
65
|
+
let list = $state<HTMLElement>();
|
|
64
66
|
|
|
65
67
|
$effect(() => {
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
if (!many || !list || readOnly) return;
|
|
69
|
+
const sortable = Sortable.create(list, {
|
|
70
|
+
animation: 150,
|
|
71
|
+
draggable: '.rz-relation-upload__thumb',
|
|
72
|
+
onEnd: ({ oldDraggableIndex, newDraggableIndex }) => {
|
|
73
|
+
if (oldDraggableIndex !== undefined && newDraggableIndex !== undefined) {
|
|
74
|
+
onOrderChange(oldDraggableIndex, newDraggableIndex);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return () => sortable.destroy();
|
|
69
79
|
});
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
/* ------------------------------------------------------------ slots */
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Empty squares after the picks, to the end of their row, five to a row.
|
|
85
|
+
*
|
|
86
|
+
* ```
|
|
87
|
+
* 3 picks ■ ■ ■ □ □
|
|
88
|
+
* 5 picks ■ ■ ■ ■ ■
|
|
89
|
+
* 6 picks ■ ■ ■ ■ ■ / ■ □ □ □ □
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
const SLOTS = 5;
|
|
93
|
+
const slots = $derived(many ? (SLOTS - (selectedItems.length % SLOTS)) % SLOTS : 0);
|
|
74
94
|
</script>
|
|
75
95
|
|
|
76
|
-
{#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
96
|
+
{#if !readOnly}
|
|
97
|
+
<FileDrop
|
|
98
|
+
class="rz-relation-upload__drop"
|
|
99
|
+
multiple={many}
|
|
100
|
+
{accept}
|
|
101
|
+
disabled={!!progress}
|
|
102
|
+
data-error={hasError ? '' : undefined}
|
|
103
|
+
onfiles={upload}
|
|
104
|
+
>
|
|
105
|
+
{#snippet children({ browse })}
|
|
106
|
+
{#if progress}
|
|
107
|
+
<SpinLoader />
|
|
108
|
+
<span aria-live="polite">
|
|
109
|
+
{t__(
|
|
110
|
+
'fields.uploading',
|
|
111
|
+
String(Math.min(progress.uploaded + progress.failed.length + 1, progress.total)),
|
|
112
|
+
String(progress.total)
|
|
113
|
+
)}
|
|
114
|
+
</span>
|
|
115
|
+
{:else}
|
|
116
|
+
<Upload size={18} />
|
|
117
|
+
<span>
|
|
118
|
+
{many ? t__('common.drop_files') : t__('common.drop_file')}
|
|
119
|
+
{t__('common.or')}
|
|
120
|
+
<button type="button" class="rz-file-drop__link" onclick={browse}>
|
|
121
|
+
{t__('common.browse')}
|
|
122
|
+
</button>
|
|
123
|
+
</span>
|
|
124
|
+
{#if accept?.length}
|
|
125
|
+
<small>{acceptLabel(accept, t__('common.or'))}</small>
|
|
126
|
+
{/if}
|
|
127
|
+
{/if}
|
|
128
|
+
{/snippet}
|
|
129
|
+
</FileDrop>
|
|
130
|
+
{#if failed.length}
|
|
131
|
+
<p class="rz-relation-upload__failed">{t__('fields.upload_failed', failed.join(', '))}</p>
|
|
132
|
+
{/if}
|
|
133
|
+
{/if}
|
|
80
134
|
|
|
81
135
|
{#key stamp}
|
|
82
136
|
<div
|
|
137
|
+
bind:this={list}
|
|
83
138
|
class="rz-relation-upload__list"
|
|
84
139
|
data-many={many ? '' : null}
|
|
85
|
-
data-list={stamp}
|
|
86
140
|
data-error={hasError ? '' : null}
|
|
87
141
|
>
|
|
88
142
|
{#each selectedItems as item (item.documentId)}
|
|
89
|
-
{
|
|
143
|
+
<div class="rz-relation-upload__thumb" title={item.title}>
|
|
144
|
+
<a
|
|
145
|
+
href={panelPath(relationConfig.kebab, item.documentId)}
|
|
146
|
+
aria-label={item.title}
|
|
147
|
+
draggable="false"
|
|
148
|
+
>
|
|
149
|
+
{#if item.isImage && item.url}
|
|
150
|
+
<img src={item.url} alt="" draggable="false" />
|
|
151
|
+
{:else}
|
|
152
|
+
<span class="rz-relation-upload__type">{typeLabel(item.mimeType)}</span>
|
|
153
|
+
{/if}
|
|
154
|
+
</a>
|
|
155
|
+
{#if !readOnly}
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
class="rz-relation-upload__remove"
|
|
159
|
+
aria-label={t__('fields.remove_item', item.title)}
|
|
160
|
+
onclick={() => removeValue(item.documentId)}
|
|
161
|
+
>
|
|
162
|
+
<X size={11} />
|
|
163
|
+
</button>
|
|
164
|
+
{/if}
|
|
165
|
+
</div>
|
|
166
|
+
{/each}
|
|
167
|
+
{#each { length: slots }, index (index)}
|
|
168
|
+
<div class="rz-relation-upload__slot" aria-hidden="true"></div>
|
|
90
169
|
{/each}
|
|
91
170
|
</div>
|
|
92
171
|
{/key}
|
|
93
172
|
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
173
|
+
<Browse
|
|
174
|
+
bind:open={browsing}
|
|
175
|
+
config={relationConfig}
|
|
176
|
+
{many}
|
|
177
|
+
{selected}
|
|
178
|
+
nestedLevel={formNestedLevel + 1}
|
|
179
|
+
onChange={setValue}
|
|
180
|
+
onCreating={(creating) => (creating ? onRelationCreation() : onRelationCreationCanceled())}
|
|
181
|
+
/>
|
|
182
|
+
|
|
183
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
184
|
+
|
|
185
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
186
|
+
|
|
187
|
+
/* The hover tint, laid over the element's own fill. */
|
|
188
|
+
|
|
189
|
+
/* The picked item of a segmented control. */
|
|
190
|
+
|
|
191
|
+
/* The primary button's face: black on light, white on dark. */
|
|
192
|
+
|
|
193
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
194
|
+
|
|
195
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
196
|
+
|
|
197
|
+
/* An input with an error. */
|
|
198
|
+
:global(.rz-relation-upload__drop[data-error]) {
|
|
199
|
+
border-color: var(--rz-danger);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Narrow, in a side panel: the zone on one line. */
|
|
203
|
+
@container rz-field-root (max-width: 20rem) {
|
|
204
|
+
:global(.rz-relation-upload__drop) {
|
|
205
|
+
flex-direction: row;
|
|
206
|
+
flex-wrap: wrap;
|
|
207
|
+
gap: var(--rz-size-2);
|
|
208
|
+
padding: var(--rz-size-3);
|
|
209
|
+
}
|
|
210
|
+
:global(.rz-relation-upload__drop > svg) {
|
|
211
|
+
margin: 0;
|
|
212
|
+
}
|
|
213
|
+
:global(.rz-relation-upload__drop small) {
|
|
214
|
+
flex-basis: 100%;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.rz-relation-upload__failed {
|
|
219
|
+
margin-top: var(--rz-size-1-5);
|
|
220
|
+
color: var(--rz-fg-subtle);
|
|
221
|
+
font-size: var(--rz-text-sm);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Five squares to a row, each up to 5rem, shrinking together on a narrow field. */
|
|
225
|
+
.rz-relation-upload__list {
|
|
226
|
+
display: grid;
|
|
227
|
+
grid-template-columns: repeat(5, minmax(0, var(--rz-size-20)));
|
|
228
|
+
gap: var(--rz-size-2);
|
|
229
|
+
margin-top: var(--rz-size-2);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.rz-relation-upload__list:not(:has(.rz-relation-upload__thumb)) {
|
|
233
|
+
display: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.rz-relation-upload__thumb,
|
|
237
|
+
.rz-relation-upload__slot {
|
|
238
|
+
aspect-ratio: 1;
|
|
239
|
+
border-radius: var(--rz-radius-lg);
|
|
240
|
+
background-color: var(--rz-bg-well);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.rz-relation-upload__thumb {
|
|
244
|
+
position: relative;
|
|
245
|
+
overflow: hidden;
|
|
246
|
+
|
|
247
|
+
/* A hairline over the image, so a light one keeps its edge. */
|
|
248
|
+
&::after {
|
|
249
|
+
content: '';
|
|
250
|
+
position: absolute;
|
|
251
|
+
inset: 0;
|
|
252
|
+
border-radius: inherit;
|
|
253
|
+
box-shadow: inset 0 0 0 1px var(--rz-border);
|
|
254
|
+
pointer-events: none;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
a {
|
|
258
|
+
display: grid;
|
|
259
|
+
place-items: center;
|
|
260
|
+
width: 100%;
|
|
261
|
+
height: 100%;
|
|
262
|
+
border-radius: inherit;
|
|
263
|
+
&:focus-visible {
|
|
264
|
+
outline: 2px solid var(--rz-accent-border);
|
|
265
|
+
outline-offset: 2px;
|
|
266
|
+
outline-offset: -2px;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
img {
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
-o-object-fit: cover;
|
|
274
|
+
object-fit: cover;
|
|
275
|
+
pointer-events: none;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.rz-relation-upload__list[data-many] .rz-relation-upload__thumb {
|
|
280
|
+
cursor: grab;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.rz-relation-upload__type {
|
|
284
|
+
color: var(--rz-fg-subtle);
|
|
285
|
+
font-family: var(--rz-font-mono);
|
|
286
|
+
font-size: var(--rz-text-xs);
|
|
287
|
+
letter-spacing: 0.04em;
|
|
288
|
+
font-variation-settings: 'wght' 600;
|
|
289
|
+
font-weight: 600;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.rz-relation-upload__remove {
|
|
293
|
+
background-color: var(--rz-bg-float);
|
|
294
|
+
box-shadow:
|
|
295
|
+
0 0 0 1px var(--rz-border),
|
|
296
|
+
var(--rz-shadow-float);
|
|
297
|
+
position: absolute;
|
|
298
|
+
z-index: 1;
|
|
299
|
+
top: var(--rz-size-1);
|
|
300
|
+
right: var(--rz-size-1);
|
|
301
|
+
display: grid;
|
|
302
|
+
place-items: center;
|
|
303
|
+
width: var(--rz-size-5);
|
|
304
|
+
height: var(--rz-size-5);
|
|
305
|
+
border-radius: var(--rz-radius-sm);
|
|
306
|
+
color: var(--rz-fg);
|
|
307
|
+
opacity: 0;
|
|
308
|
+
transition: opacity 0.15s;
|
|
309
|
+
|
|
310
|
+
&:focus-visible {
|
|
311
|
+
outline: 2px solid var(--rz-accent-border);
|
|
312
|
+
outline-offset: 2px;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.rz-relation-upload__thumb:hover .rz-relation-upload__remove,
|
|
317
|
+
.rz-relation-upload__thumb:focus-within .rz-relation-upload__remove {
|
|
318
|
+
opacity: 1;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@media (hover: none) {
|
|
322
|
+
.rz-relation-upload__remove {
|
|
323
|
+
opacity: 1;
|
|
127
324
|
}
|
|
128
|
-
}
|
|
129
|
-
>
|
|
130
|
-
<Sheet.Content style="--rz-page-gutter:var(--rz-size-6)" showCloseButton={false} side="right">
|
|
131
|
-
<Doc
|
|
132
|
-
doc={createBlankDocument(relationConfig)}
|
|
133
|
-
readOnly={false}
|
|
134
|
-
onClose={() => (create = false)}
|
|
135
|
-
operation="create"
|
|
136
|
-
{onNestedDocumentCreated}
|
|
137
|
-
nestedLevel={formNestedLevel + 1}
|
|
138
|
-
/>
|
|
139
|
-
</Sheet.Content>
|
|
140
|
-
</Sheet.Root>
|
|
325
|
+
}
|
|
326
|
+
</style>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Upload } from '@lucide/svelte';
|
|
1
2
|
import type { RelationComponentProps } from '../types.js';
|
|
2
3
|
import './upload.css';
|
|
3
|
-
|
|
4
|
+
type Props = RelationComponentProps & {
|
|
5
|
+
/** The library picker is open. */
|
|
6
|
+
browsing?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const Upload: import("svelte").Component<Props, {}, "browsing">;
|
|
4
9
|
type Upload = ReturnType<typeof Upload>;
|
|
5
10
|
export default Upload;
|
|
@@ -1,82 +1,4 @@
|
|
|
1
|
-
.
|
|
2
|
-
container: relation-upload-list / inline-size;
|
|
3
|
-
|
|
4
|
-
.rz-card-resource {
|
|
5
|
-
--rz-thumbnail-size: var(--rz-size-20);
|
|
6
|
-
--rz-card-padding: var(--rz-size-1);
|
|
7
|
-
width: calc(var(--rz-thumbnail-size) + 2.5 * var(--rz-card-padding));
|
|
8
|
-
|
|
9
|
-
@container relation-upload-list (min-width: 425px) {
|
|
10
|
-
--rz-thumbnail-size: var(--rz-size-28);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.rz-card-resource__info {
|
|
14
|
-
display: none;
|
|
15
|
-
}
|
|
16
|
-
.rz-card-resource__filesize,
|
|
17
|
-
.rz-card-resource__mimetype {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
.rz-relation-upload__list[data-many] {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-wrap: wrap;
|
|
25
|
-
gap: var(--rz-size-4);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.rz-relation-upload__list:not(.rz-relation-upload__list[data-many]) {
|
|
29
|
-
@container relation-upload-list (min-width: 285px) {
|
|
30
|
-
.rz-card-resource {
|
|
31
|
-
width: min(310px, 100%);
|
|
32
|
-
.rz-card-resource__info {
|
|
33
|
-
display: block;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
@container relation-upload-list (min-width: 425px) {
|
|
38
|
-
.rz-card-resource__filesize,
|
|
39
|
-
.rz-card-resource__mimetype {
|
|
40
|
-
display: block;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.rz-relation-upload__actions {
|
|
46
|
-
display: flex;
|
|
47
|
-
margin-top: var(--rz-size-3);
|
|
48
|
-
:first-child {
|
|
49
|
-
--rz-button-tr-radius: 0;
|
|
50
|
-
--rz-button-br-radius: 0;
|
|
51
|
-
--rz-button-outline-border-right-width: 0;
|
|
52
|
-
}
|
|
53
|
-
:last-child {
|
|
54
|
-
--rz-button-tl-radius: 0;
|
|
55
|
-
--rz-button-bl-radius: 0;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
.rz-relation-upload__actions.rz-relation-upload__actions--list-empty {
|
|
59
|
-
margin-top: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.rz-relation-upload__search {
|
|
63
|
-
height: var(--rz-size-10);
|
|
64
|
-
align-items: center;
|
|
65
|
-
border-top-left-radius: var(--rz-radius-xl);
|
|
66
|
-
border-top-right-radius: var(--rz-radius-xl);
|
|
67
|
-
border-bottom-left-radius: 0;
|
|
68
|
-
border-bottom-right-radius: 0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.rz-relation-upload__command-list {
|
|
72
|
-
padding: var(--rz-size-2);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.rz-relation-upload__command-item[aria-selected='true'] {
|
|
76
|
-
/* background-color: hsl(var(--rz-gray-5)); */
|
|
77
|
-
background-color: var(--rz-popover-high-light-bg);
|
|
78
|
-
}
|
|
79
|
-
|
|
1
|
+
/* A media as a row: its thumbnail, then its name, size and type. */
|
|
80
2
|
.rz-relation-upload__grid-item {
|
|
81
3
|
display: flex;
|
|
82
4
|
gap: var(--rz-size-4);
|
|
@@ -99,11 +21,13 @@
|
|
|
99
21
|
overflow: hidden;
|
|
100
22
|
word-break: break-all;
|
|
101
23
|
text-align: left;
|
|
102
|
-
font-variation-settings: 'wght'
|
|
103
|
-
font-weight:
|
|
24
|
+
font-variation-settings: 'wght' 500;
|
|
25
|
+
font-weight: 500;
|
|
104
26
|
}
|
|
105
27
|
|
|
106
28
|
.rz-relation-upload__grid-filesize,
|
|
107
29
|
.rz-relation-upload__grid-mimetype {
|
|
108
30
|
text-align: left;
|
|
31
|
+
color: var(--rz-fg-subtle);
|
|
32
|
+
font-size: var(--rz-text-sm);
|
|
109
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataType } from '../../core/fields/builders/form-field-builder.js';
|
|
2
2
|
import { FormFieldBuilder } from '../../core/fields/builders/form-field-builder.js';
|
|
3
3
|
import type { CollectionSlug, GenericDoc } from '../../core/prototype/types.js';
|
|
4
|
-
import type { DefaultValueFn, FormField
|
|
4
|
+
import type { DefaultValueFn, FormField } from '../types.js';
|
|
5
5
|
import type { RegisterCollection } from '../../index.js';
|
|
6
6
|
import type { WithOptional } from '../../util/types.js';
|
|
7
7
|
export declare class RelationFieldBuilder<Doc extends GenericDoc = GenericDoc> extends FormFieldBuilder<RelationField<Doc>> {
|
|
@@ -29,46 +29,6 @@ export declare class RelationFieldBuilder<Doc extends GenericDoc = GenericDoc> e
|
|
|
29
29
|
protected generateType(): string;
|
|
30
30
|
}
|
|
31
31
|
export declare const relation: (name: string) => RelationFieldBuilder<GenericDoc>;
|
|
32
|
-
/**
|
|
33
|
-
* Checks if a relation value is resolved (contains the actual referenced document).
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // Returns true for a resolved relation
|
|
37
|
-
* isRelationResolved({ title: 'Home Page', _prototype: 'collection', _type: 'pages' });
|
|
38
|
-
*/
|
|
39
|
-
export declare const isRelationResolved: <T>(value: any) => value is T;
|
|
40
|
-
/**
|
|
41
|
-
* Checks if a relation value is a reference (contains only the relationTo and documentId).
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Returns true for a relation reference
|
|
45
|
-
* isRelationRef({ relationTo: 'pages', documentId: '123' });
|
|
46
|
-
*/
|
|
47
|
-
export declare const isRelationRef: (value: unknown) => value is RelationRef;
|
|
48
|
-
/**
|
|
49
|
-
* Checks if a relation value is unresolved (contains only reference information).
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* // Returns true for an unresolved relation
|
|
53
|
-
* isRelationUnresolved({ relationTo: 'pages', documentId: '123' });
|
|
54
|
-
*/
|
|
55
|
-
export declare const isRelationUnresolved: (value: any) => value is Omit<Relation, "path" | "position" | "ownerId">;
|
|
56
|
-
/**
|
|
57
|
-
* Resolves a relation reference to the actual document it points to.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* // Resolves a relation reference to the actual document
|
|
61
|
-
* const doc = await resolveRelationRef({ relationTo: 'pages', documentId: '123' });
|
|
62
|
-
*/
|
|
63
|
-
export declare function resolveRelationRef<T>(item: T | RelationRef | string): Promise<T>;
|
|
64
|
-
/**
|
|
65
|
-
* Resolves a relation field value to the actual documents it points to.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* // Resolves a relation value to the actual documents
|
|
69
|
-
* const docs = await resolveRelation([{ relationTo: 'pages', documentId: '123' }]);
|
|
70
|
-
*/
|
|
71
|
-
export declare function resolveRelation<T>(value: RelationValue<T> | null | undefined): Promise<T[] | null | undefined>;
|
|
72
32
|
/****************************************************/
|
|
73
33
|
export type RelationField<Doc extends GenericDoc = GenericDoc> = FormField & {
|
|
74
34
|
type: 'relation';
|