rimecms 0.32.1 → 1.0.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/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/column.server.js +1 -1
- 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 +27 -6
- package/dist/adapter-sqlite/generate-schema/templates.server.js +63 -11
- 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 +122 -0
- package/dist/adapter-sqlite/read.server.d.ts +10 -1
- package/dist/adapter-sqlite/read.server.js +22 -10
- 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 +94 -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 +6 -6
- package/dist/core/config/types.d.ts +53 -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/types/contributions.server.d.ts +3 -2
- package/dist/core/dev/codegen/types/contributions.server.js +10 -3
- 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/plugins/defaults/module.server.js +2 -2
- package/dist/core/plugins/defaults/types.d.ts +5 -3
- package/dist/core/plugins/sse/index.d.ts +1 -1
- package/dist/core/plugins/sse/index.server.d.ts +5 -6
- package/dist/core/plugins/sse/index.server.js +3 -2
- package/dist/core/plugins/sse/types.d.ts +5 -0
- 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/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/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/url/addresses.server.d.ts +26 -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 +5 -0
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.js +18 -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 +7 -0
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.js +37 -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 +1 -0
- 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/module.server.js +7 -1
- package/dist/fields/relation/value.d.ts +25 -0
- package/dist/fields/relation/value.js +27 -0
- 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.svelte +20 -6
- package/dist/fields/rich-text/core/features/upload/upload.svelte +20 -8
- 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/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 +4 -3
- package/dist/index.js +3 -2
- 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/document/upload-header/drop-zone/DropZone.svelte.d.ts +1 -1
- package/dist/panel/components/sections/live/LiveEdit.svelte +2 -2
- 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/calendar/calendar.svelte.d.ts +1 -1
- 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/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-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/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/documentForm.svelte.d.ts +34 -2
- package/dist/panel/context/documentForm.svelte.js +105 -102
- package/dist/panel/context/live.svelte.js +2 -73
- 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 -1
- package/dist/panel/index.js +10 -1
- 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/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/populate.d.ts +8 -0
- package/dist/panel/util/populate.js +49 -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/types.d.ts +1 -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 +1 -3
- 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/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
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
3
|
+
import CommandButton from '../../../../panel/components/sections/commands/CommandButton.svelte';
|
|
4
|
+
import ButtonSave from '../../../../panel/components/sections/document/ButtonSave.svelte';
|
|
5
|
+
import { Button } from '../../../../panel/components/ui/button/index.js';
|
|
6
|
+
import * as Dialog from '../../../../panel/components/ui/dialog/index.js';
|
|
7
|
+
import * as Sheet from '../../../../panel/components/ui/sheet/index.js';
|
|
8
|
+
import * as Tabs from '../../../../panel/components/ui/tabs/index.js';
|
|
9
|
+
import { useCommands } from '../../../../panel/context/commands.svelte.js';
|
|
10
|
+
import type { DocumentFormContext } from '../../../../panel/context/documentForm.svelte.js';
|
|
11
|
+
import { getLocaleContext } from '../../../../panel/context/locale.svelte.js';
|
|
12
|
+
import { getNavContext } from '../../../../panel/context/nav.svelte.js';
|
|
13
|
+
import { populate } from '../../../../panel/util/populate.js';
|
|
14
|
+
import { capitalize } from '../../../../util/string.js';
|
|
15
|
+
import { ChevronRight, PanelRight, ToyBrick, X } from '@lucide/svelte';
|
|
16
|
+
import { untrack } from 'svelte';
|
|
17
|
+
import { toast } from 'svelte-sonner';
|
|
18
|
+
import BlockPicker from '../picker/BlockPicker.svelte';
|
|
19
|
+
import { getBlocksFocusContext, type SidebarTab } from './focus.svelte.js';
|
|
20
|
+
import Layers from './Layers.svelte';
|
|
21
|
+
import Palette from './Palette.svelte';
|
|
22
|
+
import Renders from './Renders.svelte';
|
|
23
|
+
import Stage from './Stage.svelte';
|
|
24
|
+
import StagePlaceholder from './StagePlaceholder.svelte';
|
|
25
|
+
|
|
26
|
+
const { form }: { form: DocumentFormContext } = $props();
|
|
27
|
+
|
|
28
|
+
const focus = getBlocksFocusContext()!;
|
|
29
|
+
const locale = getLocaleContext();
|
|
30
|
+
/** The overlay starts where the navigation ends, folded or not. */
|
|
31
|
+
const nav = getNavContext();
|
|
32
|
+
|
|
33
|
+
const builder = $derived(focus.path ? form.blocks.builder(focus.path) : undefined);
|
|
34
|
+
/** The types of the list the next insert goes to: the selected block's, else the open one. */
|
|
35
|
+
const addable = $derived.by(() => {
|
|
36
|
+
const list = focus.current?.list ?? focus.path;
|
|
37
|
+
return list ? (form.blocks.builder(list)?.get.blocks ?? []) : [];
|
|
38
|
+
});
|
|
39
|
+
const crumbs = $derived(focus.breadcrumb());
|
|
40
|
+
const count = $derived(focus.path ? form.blocks.list(focus.path).length : 0);
|
|
41
|
+
const countLabel = $derived(
|
|
42
|
+
count === 1 ? t__('fields.blocks_count', '1') : t__('fields.blocks_count|m|p', String(count))
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
let confirmRemove = $state(false);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Under 52rem the panel leaves its column for a sheet, behind a button in the header. The
|
|
49
|
+
* width is the overlay's own, which starts after the nav; the stylesheet's container query
|
|
50
|
+
* reads the same one.
|
|
51
|
+
*/
|
|
52
|
+
let width = $state(0);
|
|
53
|
+
const narrow = $derived(width > 0 && width < 52 * remPx());
|
|
54
|
+
let panelOpen = $state(false);
|
|
55
|
+
|
|
56
|
+
function remPx() {
|
|
57
|
+
return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Fields to show: a render with nothing but fields of its own, beside the stack of renders. */
|
|
61
|
+
const inspectable = $derived(focus.hasRenders);
|
|
62
|
+
|
|
63
|
+
// The selection moved. Nothing left to inspect: the types to add. Picked from the layers in the
|
|
64
|
+
// sheet: put it away, to see the block.
|
|
65
|
+
$effect(() => {
|
|
66
|
+
const picked = !!focus.current;
|
|
67
|
+
untrack(() => {
|
|
68
|
+
if (focus.tab === 'inspector' && (!picked || !inspectable)) focus.tab = 'add';
|
|
69
|
+
if (focus.tab === 'layers') panelOpen = false;
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Arriving on an empty list: the types to add.
|
|
74
|
+
$effect(() => {
|
|
75
|
+
const list = focus.path;
|
|
76
|
+
untrack(() => {
|
|
77
|
+
if (list && !focus.locked && !form.blocks.list(list).length) focus.tab = 'add';
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Asked to show a block's fields: the sheet opens on them.
|
|
82
|
+
$effect(() => {
|
|
83
|
+
if (!focus.inspected) return;
|
|
84
|
+
untrack(() => {
|
|
85
|
+
if (narrow && inspectable) panelOpen = true;
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// A focus session starts with fresh relations in the renders.
|
|
90
|
+
populate.clear();
|
|
91
|
+
|
|
92
|
+
// The overlay owns the viewport while it is up; the document under it stays where it was.
|
|
93
|
+
$effect(() => {
|
|
94
|
+
const previous = document.body.style.overflow;
|
|
95
|
+
document.body.style.overflow = 'hidden';
|
|
96
|
+
return () => {
|
|
97
|
+
document.body.style.overflow = previous;
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const dialogOpen = () => !!document.querySelector('[role="dialog"][data-state="open"]');
|
|
102
|
+
|
|
103
|
+
/** Removes the selection, after asking when the block holds blocks of its own. */
|
|
104
|
+
function requestRemove() {
|
|
105
|
+
const row = focus.currentRow;
|
|
106
|
+
if (!row || focus.locked) return;
|
|
107
|
+
const holdsBlocks = row.children.some((child) => form.blocks.list(child.list).length > 0);
|
|
108
|
+
if (holdsBlocks) confirmRemove = true;
|
|
109
|
+
else focus.removeSelection();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Escape goes back one step: the selection, then focus mode. The sheet closes itself. */
|
|
113
|
+
function back() {
|
|
114
|
+
if (!focus.rootSelected) focus.selectRoot();
|
|
115
|
+
else focus.close();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function paste() {
|
|
119
|
+
const id = await focus.pasteAfterSelection();
|
|
120
|
+
if (!id) toast.warning(t__('fields.paste_refused'));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const ADD = t__('fields.add');
|
|
124
|
+
const BLOCK = t__('fields.block');
|
|
125
|
+
const GO_TO = t__('fields.go_to');
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* What focus mode offers: the types of the list the next insert goes to, what a selected block
|
|
129
|
+
* can do, every row to go to, and the keys that move around. A dialog open keeps the keys.
|
|
130
|
+
*/
|
|
131
|
+
useCommands(() => {
|
|
132
|
+
if (!focus.path) return [];
|
|
133
|
+
const list = focus.current?.list ?? focus.path;
|
|
134
|
+
const types = form.blocks.builder(list)?.get.blocks ?? [];
|
|
135
|
+
const row = focus.currentRow;
|
|
136
|
+
const editing = !focus.locked;
|
|
137
|
+
const free = () => !dialogOpen();
|
|
138
|
+
return [
|
|
139
|
+
...(editing
|
|
140
|
+
? types.map((builder) => ({
|
|
141
|
+
id: `blocks.add.${builder.name}`,
|
|
142
|
+
label: builder.block.label || capitalize(builder.name),
|
|
143
|
+
group: ADD,
|
|
144
|
+
icon: builder.block.icon ?? ToyBrick,
|
|
145
|
+
run: () => focus.insertType(builder.name)
|
|
146
|
+
}))
|
|
147
|
+
: []),
|
|
148
|
+
...(editing && row
|
|
149
|
+
? [
|
|
150
|
+
{
|
|
151
|
+
id: 'blocks.duplicate',
|
|
152
|
+
label: t__('common.duplicate'),
|
|
153
|
+
group: BLOCK,
|
|
154
|
+
keys: 'mod+d',
|
|
155
|
+
when: free,
|
|
156
|
+
run: focus.duplicateSelection
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'blocks.move_up',
|
|
160
|
+
label: t__('fields.move_up'),
|
|
161
|
+
group: BLOCK,
|
|
162
|
+
keys: 'alt+arrowup',
|
|
163
|
+
when: free,
|
|
164
|
+
run: () => focus.moveSelection(-1)
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'blocks.move_down',
|
|
168
|
+
label: t__('fields.move_down'),
|
|
169
|
+
group: BLOCK,
|
|
170
|
+
keys: 'alt+arrowdown',
|
|
171
|
+
when: free,
|
|
172
|
+
run: () => focus.moveSelection(1)
|
|
173
|
+
},
|
|
174
|
+
...focus.moveTargets().map((target) => ({
|
|
175
|
+
id: `blocks.move_into.${target.list}`,
|
|
176
|
+
label: t__('fields.move_into', target.label),
|
|
177
|
+
group: BLOCK,
|
|
178
|
+
run: () => focus.moveSelectionInto(target.list)
|
|
179
|
+
})),
|
|
180
|
+
{
|
|
181
|
+
id: 'blocks.copy',
|
|
182
|
+
label: t__('fields.copy_block'),
|
|
183
|
+
group: BLOCK,
|
|
184
|
+
keys: 'mod+c',
|
|
185
|
+
when: free,
|
|
186
|
+
run: focus.copySelection
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 'blocks.paste',
|
|
190
|
+
label: t__('fields.paste_after'),
|
|
191
|
+
group: BLOCK,
|
|
192
|
+
keys: 'mod+v',
|
|
193
|
+
when: free,
|
|
194
|
+
run: paste
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'blocks.remove',
|
|
198
|
+
label: t__('common.delete'),
|
|
199
|
+
group: BLOCK,
|
|
200
|
+
keys: 'backspace',
|
|
201
|
+
when: free,
|
|
202
|
+
run: requestRemove
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'blocks.remove.delete',
|
|
206
|
+
label: t__('common.delete'),
|
|
207
|
+
keys: 'delete',
|
|
208
|
+
hidden: true,
|
|
209
|
+
when: free,
|
|
210
|
+
run: requestRemove
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
: []),
|
|
214
|
+
{
|
|
215
|
+
id: 'blocks.collapse_all',
|
|
216
|
+
label: t__('fields.collapse_all'),
|
|
217
|
+
group: BLOCK,
|
|
218
|
+
run: focus.collapseAll
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: 'blocks.expand_all',
|
|
222
|
+
label: t__('fields.expand_all'),
|
|
223
|
+
group: BLOCK,
|
|
224
|
+
run: focus.expandAll
|
|
225
|
+
},
|
|
226
|
+
...focus.allRows().map((candidate) => ({
|
|
227
|
+
id: `blocks.go_to.${candidate.path}`,
|
|
228
|
+
label: candidate.title,
|
|
229
|
+
group: GO_TO,
|
|
230
|
+
icon: candidate.config?.icon ?? ToyBrick,
|
|
231
|
+
run: () => focus.select(candidate.path)
|
|
232
|
+
})),
|
|
233
|
+
// Keys only
|
|
234
|
+
{
|
|
235
|
+
id: 'blocks.next',
|
|
236
|
+
label: '',
|
|
237
|
+
keys: 'arrowdown',
|
|
238
|
+
hidden: true,
|
|
239
|
+
when: free,
|
|
240
|
+
run: () => focus.selectRelative(1)
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'blocks.next.extend',
|
|
244
|
+
label: '',
|
|
245
|
+
keys: 'shift+arrowdown',
|
|
246
|
+
hidden: true,
|
|
247
|
+
when: free,
|
|
248
|
+
run: () => focus.selectRelative(1, true)
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'blocks.previous',
|
|
252
|
+
label: '',
|
|
253
|
+
keys: 'arrowup',
|
|
254
|
+
hidden: true,
|
|
255
|
+
when: free,
|
|
256
|
+
run: () => focus.selectRelative(-1)
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: 'blocks.previous.extend',
|
|
260
|
+
label: '',
|
|
261
|
+
keys: 'shift+arrowup',
|
|
262
|
+
hidden: true,
|
|
263
|
+
when: free,
|
|
264
|
+
run: () => focus.selectRelative(-1, true)
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: 'blocks.expand',
|
|
268
|
+
label: '',
|
|
269
|
+
keys: 'arrowright',
|
|
270
|
+
hidden: true,
|
|
271
|
+
when: () => free() && !!row,
|
|
272
|
+
run: () => focus.setCollapsed(focus.selection[0], false)
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: 'blocks.collapse',
|
|
276
|
+
label: '',
|
|
277
|
+
keys: 'arrowleft',
|
|
278
|
+
hidden: true,
|
|
279
|
+
when: () => free() && !!row,
|
|
280
|
+
run: () => focus.setCollapsed(focus.selection[0], true)
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: 'blocks.add_palette',
|
|
284
|
+
label: '',
|
|
285
|
+
keys: '/',
|
|
286
|
+
hidden: true,
|
|
287
|
+
when: () => free() && editing,
|
|
288
|
+
run: focus.pick
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: 'blocks.back',
|
|
292
|
+
label: '',
|
|
293
|
+
keys: 'escape',
|
|
294
|
+
hidden: true,
|
|
295
|
+
when: free,
|
|
296
|
+
run: back
|
|
297
|
+
}
|
|
298
|
+
];
|
|
299
|
+
});
|
|
300
|
+
</script>
|
|
301
|
+
|
|
302
|
+
<div
|
|
303
|
+
class="rz-blocks-focus"
|
|
304
|
+
data-focus={focus.path}
|
|
305
|
+
data-layout={focus.hasRenders ? 'renders' : 'fields'}
|
|
306
|
+
style:left={nav?.width ?? '0'}
|
|
307
|
+
bind:clientWidth={width}
|
|
308
|
+
>
|
|
309
|
+
<header class="rz-blocks-focus__header">
|
|
310
|
+
<nav class="rz-blocks-focus__crumbs" aria-label="breadcrumb">
|
|
311
|
+
<button type="button" class="rz-blocks-focus__crumb" onclick={() => focus.close()}>
|
|
312
|
+
{form.title}
|
|
313
|
+
</button>
|
|
314
|
+
{#each crumbs as crumb, index (crumb.list + (crumb.block ?? ''))}
|
|
315
|
+
<span class="rz-blocks-focus__crumb-separator" aria-hidden="true">
|
|
316
|
+
<ChevronRight size={12} />
|
|
317
|
+
</span>
|
|
318
|
+
{#if index === crumbs.length - 1}
|
|
319
|
+
<span class="rz-blocks-focus__crumb rz-blocks-focus__crumb--current">
|
|
320
|
+
{crumb.label}
|
|
321
|
+
{#if builder?.get.localized}
|
|
322
|
+
<sup>{locale.code}</sup>
|
|
323
|
+
{/if}
|
|
324
|
+
</span>
|
|
325
|
+
{:else}
|
|
326
|
+
<button
|
|
327
|
+
type="button"
|
|
328
|
+
class="rz-blocks-focus__crumb"
|
|
329
|
+
onclick={() => focus.open(crumb.list, crumb.block)}
|
|
330
|
+
>
|
|
331
|
+
{crumb.label}
|
|
332
|
+
</button>
|
|
333
|
+
{/if}
|
|
334
|
+
{/each}
|
|
335
|
+
<span class="rz-blocks-focus__count">{countLabel}</span>
|
|
336
|
+
</nav>
|
|
337
|
+
|
|
338
|
+
<div class="rz-blocks-focus__header-actions">
|
|
339
|
+
{#if narrow}
|
|
340
|
+
<Button
|
|
341
|
+
class="rz-blocks-focus__panel-toggle"
|
|
342
|
+
variant="ghost"
|
|
343
|
+
size="icon-sm"
|
|
344
|
+
icon={PanelRight}
|
|
345
|
+
aria-label={t__('fields.layers')}
|
|
346
|
+
onclick={() => (panelOpen = true)}
|
|
347
|
+
/>
|
|
348
|
+
{/if}
|
|
349
|
+
<CommandButton />
|
|
350
|
+
<ButtonSave {form} size="sm" />
|
|
351
|
+
<Button
|
|
352
|
+
variant="ghost"
|
|
353
|
+
size="icon-sm"
|
|
354
|
+
icon={X}
|
|
355
|
+
title={t__('common.close')}
|
|
356
|
+
aria-label={t__('common.close')}
|
|
357
|
+
onclick={() => focus.close()}
|
|
358
|
+
/>
|
|
359
|
+
</div>
|
|
360
|
+
</header>
|
|
361
|
+
|
|
362
|
+
<!-- One panel, three tabs: the tree of blocks, the selected block's fields, the types to add. -->
|
|
363
|
+
{#snippet panel()}
|
|
364
|
+
<Tabs.Root
|
|
365
|
+
value={focus.tab}
|
|
366
|
+
onValueChange={(value) => (focus.tab = value as SidebarTab)}
|
|
367
|
+
class="rz-blocks-focus__panel-tabs"
|
|
368
|
+
>
|
|
369
|
+
<Tabs.List class="rz-blocks-focus__panel-list">
|
|
370
|
+
<Tabs.Trigger value="layers" data-label={t__('fields.layers')}>
|
|
371
|
+
{t__('fields.layers')}
|
|
372
|
+
</Tabs.Trigger>
|
|
373
|
+
{#if inspectable}
|
|
374
|
+
<Tabs.Trigger value="inspector" data-label={t__('fields.inspector')}>
|
|
375
|
+
{t__('fields.inspector')}
|
|
376
|
+
</Tabs.Trigger>
|
|
377
|
+
{/if}
|
|
378
|
+
{#if !focus.locked}
|
|
379
|
+
<Tabs.Trigger value="add" data-label={t__('fields.blocks')}>
|
|
380
|
+
{t__('fields.blocks')}
|
|
381
|
+
</Tabs.Trigger>
|
|
382
|
+
{/if}
|
|
383
|
+
</Tabs.List>
|
|
384
|
+
<Tabs.Content value="layers" class="rz-blocks-focus__panel-content">
|
|
385
|
+
<div class="rz-blocks-focus__panel-pad rz-blocks-focus__panel-pad--layers">
|
|
386
|
+
<Layers {form} heading={false} />
|
|
387
|
+
</div>
|
|
388
|
+
</Tabs.Content>
|
|
389
|
+
{#if inspectable}
|
|
390
|
+
<Tabs.Content value="inspector" class="rz-blocks-focus__panel-content">
|
|
391
|
+
{#if focus.current}
|
|
392
|
+
<Stage {form} onRemove={requestRemove} />
|
|
393
|
+
{:else}
|
|
394
|
+
<p class="rz-blocks-focus__panel-hint">{t__('fields.pick_a_block')}</p>
|
|
395
|
+
{/if}
|
|
396
|
+
</Tabs.Content>
|
|
397
|
+
{/if}
|
|
398
|
+
{#if !focus.locked}
|
|
399
|
+
<Tabs.Content value="add" class="rz-blocks-focus__panel-content">
|
|
400
|
+
<div class="rz-blocks-focus__panel-pad"><Palette {form} heading={false} /></div>
|
|
401
|
+
</Tabs.Content>
|
|
402
|
+
{/if}
|
|
403
|
+
</Tabs.Root>
|
|
404
|
+
{/snippet}
|
|
405
|
+
|
|
406
|
+
<div class="rz-blocks-focus__body">
|
|
407
|
+
{#if focus.hasRenders}
|
|
408
|
+
<!-- A click beside the blocks selects the root; the blocks stop their own clicks. -->
|
|
409
|
+
<section class="rz-blocks-focus__renders" role="presentation" onclick={focus.selectRoot}>
|
|
410
|
+
<Renders {form} list={focus.path ?? ''} onRemove={requestRemove} />
|
|
411
|
+
{#if count && !focus.locked}
|
|
412
|
+
<StagePlaceholder />
|
|
413
|
+
{/if}
|
|
414
|
+
</section>
|
|
415
|
+
{:else}
|
|
416
|
+
<section class="rz-blocks-focus__stage">
|
|
417
|
+
<Stage {form} onRemove={requestRemove} />
|
|
418
|
+
</section>
|
|
419
|
+
{/if}
|
|
420
|
+
|
|
421
|
+
{#if narrow}
|
|
422
|
+
<Sheet.Root bind:open={panelOpen}>
|
|
423
|
+
<Sheet.Content
|
|
424
|
+
showCloseButton={false}
|
|
425
|
+
side="right"
|
|
426
|
+
size="sm"
|
|
427
|
+
class="rz-blocks-focus__panel-sheet"
|
|
428
|
+
>
|
|
429
|
+
{@render panel()}
|
|
430
|
+
</Sheet.Content>
|
|
431
|
+
</Sheet.Root>
|
|
432
|
+
{:else}
|
|
433
|
+
<aside class="rz-blocks-focus__panel">{@render panel()}</aside>
|
|
434
|
+
{/if}
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<BlockPicker
|
|
438
|
+
bind:open={() => focus.picking, (open) => (focus.picking = open)}
|
|
439
|
+
types={addable}
|
|
440
|
+
onpick={(block) => focus.insertType(block.name)}
|
|
441
|
+
/>
|
|
442
|
+
|
|
443
|
+
<Dialog.Root bind:open={confirmRemove}>
|
|
444
|
+
<Dialog.Content>
|
|
445
|
+
<Dialog.Header>{t__('fields.remove_with_children_title')}</Dialog.Header>
|
|
446
|
+
<p>{t__('fields.remove_with_children_text')}</p>
|
|
447
|
+
<Dialog.Footer>
|
|
448
|
+
<Button
|
|
449
|
+
onclick={() => {
|
|
450
|
+
confirmRemove = false;
|
|
451
|
+
focus.removeSelection();
|
|
452
|
+
}}
|
|
453
|
+
kbd="enter"
|
|
454
|
+
>
|
|
455
|
+
{t__('common.confirm')}
|
|
456
|
+
</Button>
|
|
457
|
+
<Button onclick={() => (confirmRemove = false)} variant="secondary" kbd="escape">
|
|
458
|
+
{t__('common.cancel')}
|
|
459
|
+
</Button>
|
|
460
|
+
</Dialog.Footer>
|
|
461
|
+
</Dialog.Content>
|
|
462
|
+
</Dialog.Root>
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
466
|
+
|
|
467
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
468
|
+
|
|
469
|
+
/* The hover tint, laid over the element's own fill. */
|
|
470
|
+
|
|
471
|
+
/* The picked item of a segmented control. */
|
|
472
|
+
|
|
473
|
+
/* The primary button's face: black on light, white on dark. */
|
|
474
|
+
|
|
475
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
476
|
+
|
|
477
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
478
|
+
|
|
479
|
+
/* An input with an error. */
|
|
480
|
+
/* The viewport beside the navigation, over the page and its sticky header; each column scrolls
|
|
481
|
+
on its own. */
|
|
482
|
+
.rz-blocks-focus {
|
|
483
|
+
--rz-fields-padding: var(--rz-size-6);
|
|
484
|
+
container: rz-focus / inline-size;
|
|
485
|
+
position: fixed;
|
|
486
|
+
inset: 0;
|
|
487
|
+
z-index: 200;
|
|
488
|
+
display: grid;
|
|
489
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
490
|
+
background-color: var(--rz-bg-page);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.rz-blocks-focus__header {
|
|
494
|
+
display: flex;
|
|
495
|
+
align-items: center;
|
|
496
|
+
justify-content: space-between;
|
|
497
|
+
gap: var(--rz-size-4);
|
|
498
|
+
height: var(--rz-size-12);
|
|
499
|
+
padding-inline: var(--rz-size-5) var(--rz-size-2-5);
|
|
500
|
+
border-bottom: 1px solid var(--rz-border);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.rz-blocks-focus__crumbs {
|
|
504
|
+
display: flex;
|
|
505
|
+
align-items: center;
|
|
506
|
+
gap: var(--rz-size-1-5);
|
|
507
|
+
min-width: 0;
|
|
508
|
+
font-size: var(--rz-text-sm);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.rz-blocks-focus__crumb {
|
|
512
|
+
white-space: nowrap;
|
|
513
|
+
color: var(--rz-fg-subtle);
|
|
514
|
+
&:is(button):hover {
|
|
515
|
+
color: var(--rz-fg);
|
|
516
|
+
}
|
|
517
|
+
&.rz-blocks-focus__crumb:first-child {
|
|
518
|
+
max-width: 200px;
|
|
519
|
+
overflow: hidden;
|
|
520
|
+
display: -webkit-box;
|
|
521
|
+
-webkit-box-orient: vertical;
|
|
522
|
+
-webkit-line-clamp: 1;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.rz-blocks-focus__crumb--current {
|
|
527
|
+
font-variation-settings: 'wght' 500;
|
|
528
|
+
font-weight: 500;
|
|
529
|
+
color: var(--rz-fg);
|
|
530
|
+
sup {
|
|
531
|
+
font-size: var(--rz-text-2xs);
|
|
532
|
+
text-transform: uppercase;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.rz-blocks-focus__crumb-separator {
|
|
537
|
+
display: flex;
|
|
538
|
+
flex-shrink: 0;
|
|
539
|
+
color: var(--rz-fg-subtle);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.rz-blocks-focus__count {
|
|
543
|
+
margin-left: var(--rz-size-1);
|
|
544
|
+
font-size: var(--rz-text-xs);
|
|
545
|
+
color: var(--rz-fg-subtle);
|
|
546
|
+
white-space: nowrap;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/* The ghost icon buttons, the panel's and the close one, are quiet until hovered. */
|
|
550
|
+
.rz-blocks-focus__header-actions {
|
|
551
|
+
--rz-button-ghost-fg: var(--rz-fg-muted);
|
|
552
|
+
display: flex;
|
|
553
|
+
align-items: center;
|
|
554
|
+
gap: var(--rz-size-2);
|
|
555
|
+
flex-shrink: 0;
|
|
556
|
+
:global(.rz-button--ghost:hover) {
|
|
557
|
+
color: var(--rz-fg);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/*
|
|
562
|
+
* The stage, a canvas with the blocks centred on it as wide as the document's column at most,
|
|
563
|
+
* and the panel on the right.
|
|
564
|
+
*
|
|
565
|
+
* --rz-focus-side: the panel, growing with the room; wider beside renders, where it holds a
|
|
566
|
+
* block's fields
|
|
567
|
+
* --rz-document-width: the blocks' column, 60rem
|
|
568
|
+
*/
|
|
569
|
+
.rz-blocks-focus__body {
|
|
570
|
+
--rz-focus-side: clamp(20rem, 22cqi, 26rem);
|
|
571
|
+
position: relative;
|
|
572
|
+
display: grid;
|
|
573
|
+
grid-template-columns: minmax(0, 1fr) var(--rz-focus-side);
|
|
574
|
+
min-height: 0;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.rz-blocks-focus__renders > :global(.rz-renders),
|
|
578
|
+
.rz-blocks-focus__renders > :global(.rz-stage-placeholder),
|
|
579
|
+
.rz-blocks-focus__stage > :global(.rz-stage) {
|
|
580
|
+
max-width: var(--rz-document-width, 60rem);
|
|
581
|
+
margin-inline: auto;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/* Under the blocks, one gap further down. */
|
|
585
|
+
.rz-blocks-focus__renders > :global(.rz-stage-placeholder) {
|
|
586
|
+
display: block;
|
|
587
|
+
margin-top: var(--rz-size-3);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/* With renders the panel holds a block's fields, which want room. */
|
|
591
|
+
.rz-blocks-focus[data-layout='renders'] .rz-blocks-focus__body {
|
|
592
|
+
--rz-focus-side: clamp(24rem, 30cqi, 36rem);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.rz-blocks-focus__panel,
|
|
596
|
+
.rz-blocks-focus__stage,
|
|
597
|
+
.rz-blocks-focus__renders {
|
|
598
|
+
min-width: 0;
|
|
599
|
+
min-height: 0;
|
|
600
|
+
overflow: auto;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.rz-blocks-focus__panel {
|
|
604
|
+
background-color: var(--rz-bg-page);
|
|
605
|
+
border-left: 1px solid var(--rz-border);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.rz-blocks-focus__stage,
|
|
609
|
+
.rz-blocks-focus__renders {
|
|
610
|
+
background-color: var(--rz-bg-well);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/*
|
|
614
|
+
* Room around the blocks for the selected one's bar above, and below the last one so it does
|
|
615
|
+
* not sit on the window's edge.
|
|
616
|
+
*/
|
|
617
|
+
.rz-blocks-focus__renders {
|
|
618
|
+
padding: var(--rz-size-14) var(--rz-size-8) var(--rz-size-32);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.rz-blocks-focus__stage {
|
|
622
|
+
padding-bottom: var(--rz-size-16);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/* The tabs on the panel's top edge, the content scrolling under them; in a column or a sheet. */
|
|
626
|
+
/* In a column or in a sheet, which sits outside the overlay: the padding its fields read. */
|
|
627
|
+
:global(.rz-blocks-focus__panel-tabs.rz-tabs[data-tabs-root]) {
|
|
628
|
+
/* Room on the left for a rich text's drag handle, which sits outside its field. */
|
|
629
|
+
--rz-fields-padding: var(--rz-size-10);
|
|
630
|
+
display: grid;
|
|
631
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
632
|
+
height: 100%;
|
|
633
|
+
margin: 0;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/* A track across the panel, its tabs sharing the width. */
|
|
637
|
+
:global(.rz-blocks-focus__panel-list.rz-tabs-list) {
|
|
638
|
+
display: flex;
|
|
639
|
+
width: auto;
|
|
640
|
+
margin: var(--rz-size-2-5) var(--rz-size-3);
|
|
641
|
+
}
|
|
642
|
+
:global(.rz-blocks-focus__panel-list .rz-tabs-trigger) {
|
|
643
|
+
flex: 1;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/* A hairline between the tabs and what they show. */
|
|
647
|
+
:global(.rz-blocks-focus__panel-content.rz-tabs-content) {
|
|
648
|
+
min-height: 0;
|
|
649
|
+
margin: 0;
|
|
650
|
+
overflow: auto;
|
|
651
|
+
border-top: 1px solid var(--rz-border);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.rz-blocks-focus__panel-pad {
|
|
655
|
+
padding: var(--rz-size-3);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.rz-blocks-focus__panel-pad--layers {
|
|
659
|
+
padding: var(--rz-size-1-5);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.rz-blocks-focus__panel-hint {
|
|
663
|
+
padding: var(--rz-size-8) var(--rz-size-4);
|
|
664
|
+
text-align: center;
|
|
665
|
+
font-size: var(--rz-text-sm);
|
|
666
|
+
color: var(--rz-fg-subtle);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
:global(.rz-blocks-focus__panel-sheet) {
|
|
670
|
+
overflow: hidden;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* Narrow: the stage alone, the panel in a sheet from the right, behind the header's button. */
|
|
674
|
+
@container rz-focus (max-width: 52rem) {
|
|
675
|
+
.rz-blocks-focus__body,
|
|
676
|
+
.rz-blocks-focus[data-layout='renders'] .rz-blocks-focus__body {
|
|
677
|
+
grid-template-columns: minmax(0, 1fr);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DocumentFormContext } from '../../../../panel/context/documentForm.svelte.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
form: DocumentFormContext;
|
|
4
|
+
};
|
|
5
|
+
declare const BlocksFocus: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type BlocksFocus = ReturnType<typeof BlocksFocus>;
|
|
7
|
+
export default BlocksFocus;
|