rimecms 0.33.0 → 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/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 +52 -10
- 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 +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/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/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/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
|
@@ -49,18 +49,34 @@
|
|
|
49
49
|
icon={copied ? Check : Copy}
|
|
50
50
|
/>
|
|
51
51
|
</p>
|
|
52
|
-
<Dialog.Footer
|
|
52
|
+
<Dialog.Footer>
|
|
53
53
|
<Button onclick={() => (apiKey = null)}>{t__('common.close')}</Button>
|
|
54
54
|
</Dialog.Footer>
|
|
55
55
|
</Dialog.Content>
|
|
56
56
|
</Dialog.Root>
|
|
57
57
|
|
|
58
|
-
<style
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
59
|
+
|
|
60
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
61
|
+
|
|
62
|
+
/* The hover tint, laid over the element's own fill. */
|
|
63
|
+
|
|
64
|
+
/* The picked item of a segmented control. */
|
|
65
|
+
|
|
66
|
+
/* The primary button's face: black on light, white on dark. */
|
|
67
|
+
|
|
68
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
69
|
+
|
|
70
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
71
|
+
|
|
72
|
+
/* An input with an error. */
|
|
73
|
+
.rz-dialog-api__key {
|
|
61
74
|
position: relative;
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
background-color: var(--rz-bg-well);
|
|
76
|
+
border: 1px solid var(--rz-border);
|
|
77
|
+
&:hover {
|
|
78
|
+
border-color: var(--rz-border-strong);
|
|
79
|
+
}
|
|
64
80
|
min-height: var(--rz-input-height);
|
|
65
81
|
align-items: center;
|
|
66
82
|
display: flex;
|
|
@@ -73,7 +89,7 @@
|
|
|
73
89
|
right: var(--rz-size-1);
|
|
74
90
|
}
|
|
75
91
|
.rz-dialog-api--copied {
|
|
76
|
-
color:
|
|
92
|
+
color: var(--rz-success);
|
|
77
93
|
}
|
|
78
94
|
}
|
|
79
95
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
{:else if user.attributes.isStaff && page.data?.hasMailer}
|
|
69
69
|
{#if isAuthConfig(collection) && collection.auth.type === 'password'}
|
|
70
70
|
<div>
|
|
71
|
-
<Button onclick={sendPasswordResetLink} variant="
|
|
71
|
+
<Button onclick={sendPasswordResetLink} variant="secondary" size="sm">
|
|
72
72
|
{t__('common.sendPasswordResetLink')}
|
|
73
73
|
</Button>
|
|
74
74
|
</div>
|
|
@@ -77,18 +77,37 @@
|
|
|
77
77
|
</div>
|
|
78
78
|
{/if}
|
|
79
79
|
|
|
80
|
-
<style
|
|
80
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
81
|
+
|
|
82
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
83
|
+
|
|
84
|
+
/* The hover tint, laid over the element's own fill. */
|
|
85
|
+
|
|
86
|
+
/* The picked item of a segmented control. */
|
|
87
|
+
|
|
88
|
+
/* The primary button's face: black on light, white on dark. */
|
|
89
|
+
|
|
90
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
91
|
+
|
|
92
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
93
|
+
|
|
94
|
+
/* An input with an error. */
|
|
95
|
+
/* A card like a group's body: the password fields, 20px apart, 14px from its sides. */
|
|
81
96
|
.rz-document-auth {
|
|
97
|
+
background-color: var(--rz-bg-raised);
|
|
98
|
+
box-shadow:
|
|
99
|
+
0 0 0 1px var(--rz-border),
|
|
100
|
+
var(--rz-shadow-raised);
|
|
82
101
|
display: grid;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
gap: var(--rz-size-5);
|
|
103
|
+
padding: var(--rz-size-4) var(--rz-size-3-5);
|
|
104
|
+
border-radius: var(--rz-radius-xl);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Updating: the reset link alone, no card. */
|
|
108
|
+
.rz-document-auth:not(:has(fieldset)) {
|
|
109
|
+
padding: 0;
|
|
110
|
+
background-color: transparent;
|
|
111
|
+
box-shadow: none;
|
|
93
112
|
}
|
|
94
113
|
</style>
|
|
@@ -86,15 +86,30 @@
|
|
|
86
86
|
</div>
|
|
87
87
|
{/if}
|
|
88
88
|
|
|
89
|
-
<style
|
|
90
|
-
|
|
89
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
90
|
+
|
|
91
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
92
|
+
|
|
93
|
+
/* The hover tint, laid over the element's own fill. */
|
|
94
|
+
|
|
95
|
+
/* The picked item of a segmented control. */
|
|
96
|
+
|
|
97
|
+
/* The primary button's face: black on light, white on dark. */
|
|
98
|
+
|
|
99
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
100
|
+
|
|
101
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
102
|
+
|
|
103
|
+
/* An input with an error. */
|
|
104
|
+
.rz-auto-save-banners {
|
|
91
105
|
position: sticky;
|
|
92
106
|
bottom: 0;
|
|
93
107
|
z-index: 10;
|
|
94
108
|
display: grid;
|
|
95
109
|
gap: var(--rz-size-2);
|
|
96
|
-
padding: var(--rz-size-3)
|
|
97
|
-
|
|
110
|
+
padding-block: var(--rz-size-3);
|
|
111
|
+
padding-inline: max(var(--rz-page-gutter), calc((100% - var(--rz-page-width, 40rem)) / 2));
|
|
112
|
+
background-color: var(--rz-bg-page);
|
|
98
113
|
}
|
|
99
114
|
.rz-auto-save-banner {
|
|
100
115
|
display: flex;
|
|
@@ -102,10 +117,12 @@
|
|
|
102
117
|
justify-content: space-between;
|
|
103
118
|
gap: var(--rz-size-4);
|
|
104
119
|
padding: var(--rz-size-3) var(--rz-size-4);
|
|
105
|
-
border:
|
|
106
|
-
border-radius: var(--rz-radius-lg);
|
|
120
|
+
border-radius: var(--rz-radius-xl);
|
|
107
121
|
font-size: var(--rz-text-sm);
|
|
108
|
-
background-color:
|
|
122
|
+
background-color: var(--rz-bg-float);
|
|
123
|
+
box-shadow:
|
|
124
|
+
0 0 0 1px var(--rz-border),
|
|
125
|
+
var(--rz-shadow-float);
|
|
109
126
|
}
|
|
110
127
|
.rz-auto-save-banner__actions {
|
|
111
128
|
display: flex;
|
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
3
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
2
4
|
import Button from '../../ui/button/button.svelte';
|
|
3
|
-
import type {
|
|
5
|
+
import type { ButtonSize, ButtonVariant } from '../../ui/button/index.js';
|
|
4
6
|
import SpinLoader from '../../ui/spin-loader/SpinLoader.svelte';
|
|
5
|
-
import { Save } from '@lucide/svelte';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
9
|
+
form: DocumentFormContext;
|
|
8
10
|
variant?: ButtonVariant;
|
|
9
|
-
|
|
10
|
-
processing: boolean;
|
|
11
|
+
size?: ButtonSize;
|
|
11
12
|
class?: string;
|
|
12
|
-
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
const { form, variant = 'default', size = 'default', class: className }: Props = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const label = $derived(form.values.id ? t__('common.save') : t__('common.create'));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* What the save does, said on the button and read off the submitter by the form:
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
22
|
+
* no versions save in place
|
|
23
|
+
* versions, no draft data-fork: a version per save
|
|
24
|
+
* versions and draft, published data-status: the save keeps it published
|
|
25
|
+
* versions and draft, draft save the draft
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* `data-submit` is how ⌘S and the settings menu find the button.
|
|
29
|
+
*/
|
|
30
|
+
const versions = $derived(form.config.versions);
|
|
31
|
+
const fork = $derived(!!versions && !versions.draft);
|
|
32
|
+
const status = $derived(
|
|
33
|
+
versions && versions.draft && form.values.status === 'published' ? 'published' : undefined
|
|
34
|
+
);
|
|
24
35
|
</script>
|
|
25
36
|
|
|
26
37
|
<Button
|
|
27
38
|
{variant}
|
|
28
|
-
|
|
39
|
+
{size}
|
|
29
40
|
class={className || null}
|
|
30
41
|
type="submit"
|
|
31
|
-
{
|
|
32
|
-
|
|
42
|
+
disabled={!form.canSubmit}
|
|
43
|
+
data-submit
|
|
44
|
+
data-fork={fork ? '' : undefined}
|
|
45
|
+
data-status={status}
|
|
33
46
|
>
|
|
34
|
-
{#if processing}
|
|
47
|
+
{#if form.processing}
|
|
35
48
|
<SpinLoader />
|
|
36
|
-
{:else}
|
|
37
|
-
<Save size="13" />
|
|
38
49
|
{/if}
|
|
39
50
|
{label}
|
|
40
51
|
</Button>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
2
|
+
import type { ButtonSize, ButtonVariant } from '../../ui/button/index.js';
|
|
2
3
|
type Props = {
|
|
4
|
+
form: DocumentFormContext;
|
|
3
5
|
variant?: ButtonVariant;
|
|
4
|
-
|
|
5
|
-
processing: boolean;
|
|
6
|
+
size?: ButtonSize;
|
|
6
7
|
class?: string;
|
|
7
|
-
|
|
8
|
-
} & ButtonProps;
|
|
8
|
+
};
|
|
9
9
|
declare const ButtonSave: import("svelte").Component<Props, {}, "">;
|
|
10
10
|
type ButtonSave = ReturnType<typeof ButtonSave>;
|
|
11
11
|
export default ButtonSave;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as Dialog from '../../ui/dialog/index.js';
|
|
7
7
|
import * as Radio from '../../ui/radio-group/index.js';
|
|
8
8
|
import { getAPIProxyContext } from '../../../context/api-proxy.svelte.js';
|
|
9
|
+
import { useCommands } from '../../../context/commands.svelte.js';
|
|
9
10
|
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
10
11
|
import { toKebabCase } from '../../../../util/string';
|
|
11
12
|
import { toast } from 'svelte-sonner';
|
|
@@ -21,14 +22,14 @@
|
|
|
21
22
|
|
|
22
23
|
let dialogOpen = $state(false);
|
|
23
24
|
|
|
24
|
-
async function handleValidateStatus() {
|
|
25
|
+
async function handleValidateStatus(next: string = status) {
|
|
25
26
|
const urlId = form.values._prototype === 'collection' ? `/${form.values.id}` : '/';
|
|
26
27
|
await fetch(
|
|
27
28
|
`${apiUrl(toKebabCase(form.values._type))}${urlId}?${PARAMS.VERSION_ID}=${form.values.versionId}`,
|
|
28
29
|
{
|
|
29
30
|
method: 'PATCH',
|
|
30
31
|
body: JSON.stringify({
|
|
31
|
-
status:
|
|
32
|
+
status: next
|
|
32
33
|
})
|
|
33
34
|
}
|
|
34
35
|
)
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
toast.success(t__('common.doc_updated'));
|
|
38
39
|
// The server holds the new status already: the form takes it without getting dirty,
|
|
39
40
|
// so no auto-save follows a publish.
|
|
40
|
-
form.sync('status',
|
|
41
|
+
form.sync('status', next);
|
|
41
42
|
dialogOpen = false;
|
|
42
43
|
invalidateAll();
|
|
43
44
|
// The write went around the form: the version history re-reads its statuses.
|
|
@@ -52,14 +53,32 @@
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
let status = $derived(form.values.status);
|
|
56
|
+
|
|
57
|
+
/** The other statuses, one line each. */
|
|
58
|
+
useCommands(() =>
|
|
59
|
+
statusList
|
|
60
|
+
.filter((candidate) => candidate !== form.values.status)
|
|
61
|
+
.map((candidate) => ({
|
|
62
|
+
id: `document.status.${candidate}`,
|
|
63
|
+
label: t__('common.mark_as', t__(`common.${candidate}`)),
|
|
64
|
+
group: t__('common.document'),
|
|
65
|
+
run: () => handleValidateStatus(candidate)
|
|
66
|
+
}))
|
|
67
|
+
);
|
|
55
68
|
</script>
|
|
56
69
|
|
|
57
70
|
<Dialog.Root bind:open={dialogOpen}>
|
|
58
71
|
<Dialog.Trigger>
|
|
59
72
|
{#snippet child(props)}
|
|
60
|
-
<Button
|
|
73
|
+
<Button
|
|
74
|
+
size="sm"
|
|
75
|
+
variant="ghost"
|
|
76
|
+
class="rz-status__button"
|
|
77
|
+
onclick={() => (dialogOpen = true)}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
61
80
|
<StatusDot status={form.values.status} />
|
|
62
|
-
<
|
|
81
|
+
<span class="rz-status__text">{t__(`common.${form.values.status}`)}</span>
|
|
63
82
|
</Button>
|
|
64
83
|
{/snippet}
|
|
65
84
|
</Dialog.Trigger>
|
|
@@ -69,32 +88,61 @@
|
|
|
69
88
|
<div class="rz-radio__option">
|
|
70
89
|
<Radio.Item id="document.{status}" value={status} />
|
|
71
90
|
<Label for="document.{status}">
|
|
72
|
-
{t__(`common.${status}`)}
|
|
91
|
+
{t__(`common.${status}`)}
|
|
73
92
|
<p>{t__(`common.${status}_infos`)}</p>
|
|
74
93
|
</Label>
|
|
75
94
|
</div>
|
|
76
95
|
{/each}
|
|
77
96
|
</Radio.Root>
|
|
78
|
-
<Dialog.Footer
|
|
79
|
-
<Button onclick={handleValidateStatus} variant="outline">Validate</Button>
|
|
80
|
-
<Button onclick={() => (dialogOpen = false)} variant="secondary">
|
|
97
|
+
<Dialog.Footer>
|
|
98
|
+
<Button onclick={() => handleValidateStatus()} variant="outline" kbd="enter">Validate</Button>
|
|
99
|
+
<Button onclick={() => (dialogOpen = false)} variant="secondary" kbd="escape">
|
|
100
|
+
{t__('common.cancel')}
|
|
101
|
+
</Button>
|
|
81
102
|
</Dialog.Footer>
|
|
82
103
|
</Dialog.Content>
|
|
83
104
|
</Dialog.Root>
|
|
84
105
|
|
|
85
|
-
<style
|
|
106
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
107
|
+
|
|
108
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
109
|
+
|
|
110
|
+
/* The hover tint, laid over the element's own fill. */
|
|
111
|
+
|
|
112
|
+
/* The picked item of a segmented control. */
|
|
113
|
+
|
|
114
|
+
/* The primary button's face: black on light, white on dark. */
|
|
115
|
+
|
|
116
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
117
|
+
|
|
118
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
119
|
+
|
|
120
|
+
/* An input with an error. */
|
|
121
|
+
/* The status as a ghost button: a small dot, draft or published, then its name. */
|
|
122
|
+
:global(.rz-status__button) {
|
|
123
|
+
--rz-dot-size: var(--rz-size-1-5);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Each status a row: the radio, its name, a line on what it means. */
|
|
127
|
+
.rz-radio__option {
|
|
86
128
|
display: flex;
|
|
129
|
+
align-items: flex-start;
|
|
87
130
|
gap: var(--rz-size-3);
|
|
88
|
-
padding: var(--rz-size-3);
|
|
89
|
-
border: var(--rz-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.rz-
|
|
93
|
-
|
|
131
|
+
padding: var(--rz-size-3) var(--rz-size-3-5);
|
|
132
|
+
border-radius: var(--rz-radius-lg);
|
|
133
|
+
box-shadow: 0 0 0 1px var(--rz-border);
|
|
134
|
+
|
|
135
|
+
:global(.rz-label) {
|
|
136
|
+
color: var(--rz-fg);
|
|
137
|
+
font-size: var(--rz-text-md);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
p {
|
|
141
|
+
margin-top: var(--rz-size-0-5);
|
|
142
|
+
color: var(--rz-fg-subtle);
|
|
143
|
+
font-size: var(--rz-text-sm);
|
|
144
|
+
font-variation-settings: 'wght' 400;
|
|
145
|
+
font-weight: 400;
|
|
94
146
|
}
|
|
95
|
-
}
|
|
96
|
-
p {
|
|
97
|
-
font-variation-settings: 'wght' 400;
|
|
98
|
-
font-weight: 400;
|
|
99
147
|
}
|
|
100
148
|
</style>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { invalidateAll } from '$app/navigation';
|
|
3
|
+
import type { BuiltCollection } from '../../../../core/config/types';
|
|
4
|
+
import { PARAMS } from '../../../../core/constants.js';
|
|
5
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
6
|
+
import { apiUrl } from '../../../../core/routes/util.js';
|
|
7
|
+
import * as Dialog from '../../ui/dialog/index.js';
|
|
8
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
9
|
+
import { getLocaleContext } from '../../../context/locale.svelte.js';
|
|
10
|
+
import { slugify } from '../../../../util/string.js';
|
|
11
|
+
import { toast } from 'svelte-sonner';
|
|
12
|
+
import Button from '../../ui/button/button.svelte';
|
|
13
|
+
import Label from '../../ui/label/label.svelte';
|
|
14
|
+
|
|
15
|
+
type Props = { form: DocumentFormContext; config: BuiltCollection; open: boolean };
|
|
16
|
+
let { form, config, open = $bindable() }: Props = $props();
|
|
17
|
+
|
|
18
|
+
const locale = getLocaleContext();
|
|
19
|
+
|
|
20
|
+
const current = $derived(String(form.values._slug ?? ''));
|
|
21
|
+
const url = $derived(String(form.values.url ?? ''));
|
|
22
|
+
|
|
23
|
+
/** The address around the page's own slug: what the input sits between. */
|
|
24
|
+
const cut = $derived(url.lastIndexOf(current));
|
|
25
|
+
const before = $derived(cut >= 0 ? url.slice(0, cut).replace(/^https?:\/\//, '') : '');
|
|
26
|
+
const after = $derived(cut >= 0 ? url.slice(cut + current.length) : '');
|
|
27
|
+
|
|
28
|
+
let value = $state('');
|
|
29
|
+
let error = $state<string | null>(null);
|
|
30
|
+
let saving = $state(false);
|
|
31
|
+
|
|
32
|
+
$effect(() => {
|
|
33
|
+
if (!open) return;
|
|
34
|
+
value = current;
|
|
35
|
+
error = null;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** What the server will keep: lowercase, dashes, no dash at either end. */
|
|
39
|
+
const next = $derived(slugify(value).replace(/^-+|-+$/g, ''));
|
|
40
|
+
|
|
41
|
+
async function save() {
|
|
42
|
+
if (!next) {
|
|
43
|
+
error = t__('common.url_slug_required');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (next === current) {
|
|
47
|
+
open = false;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
saving = true;
|
|
52
|
+
const search = locale.code ? `?${PARAMS.LOCALE}=${locale.code}` : '';
|
|
53
|
+
const response = await fetch(`${apiUrl(config.kebab, String(form.values.id))}/slug${search}`, {
|
|
54
|
+
method: 'PATCH',
|
|
55
|
+
headers: { 'content-type': 'application/json' },
|
|
56
|
+
body: JSON.stringify({ slug: next })
|
|
57
|
+
}).catch(() => null);
|
|
58
|
+
saving = false;
|
|
59
|
+
|
|
60
|
+
if (response?.ok) {
|
|
61
|
+
toast.success(t__('common.url_changed'));
|
|
62
|
+
open = false;
|
|
63
|
+
invalidateAll();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// A slug the client already checked is refused for one reason: a sibling holds it.
|
|
67
|
+
error = response?.status === 400 ? t__('common.url_slug_taken') : t__('error.generic');
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<Dialog.Root bind:open>
|
|
72
|
+
<Dialog.Content size="sm">
|
|
73
|
+
<Dialog.Header>{t__('common.change_url')}</Dialog.Header>
|
|
74
|
+
|
|
75
|
+
<div class="rz-change-slug">
|
|
76
|
+
<Label for="rz-change-slug-input">{t__('common.url_address')}</Label>
|
|
77
|
+
<div class="rz-change-slug__field" data-invalid={error ? '' : null}>
|
|
78
|
+
<!-- Cut from the left when it is long: the end, next to the slug, is what matters. -->
|
|
79
|
+
{#if before}<span class="rz-change-slug__prefix"><bdi>{before}</bdi></span>{/if}
|
|
80
|
+
<input
|
|
81
|
+
id="rz-change-slug-input"
|
|
82
|
+
class="rz-change-slug__input"
|
|
83
|
+
bind:value
|
|
84
|
+
oninput={() => (error = null)}
|
|
85
|
+
autocomplete="off"
|
|
86
|
+
spellcheck="false"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
{#if error}
|
|
90
|
+
<p class="rz-change-slug__error">{error}</p>
|
|
91
|
+
{:else}
|
|
92
|
+
<p class="rz-change-slug__preview">
|
|
93
|
+
{before}<mark>{next || '…'}</mark>{after}
|
|
94
|
+
</p>
|
|
95
|
+
{/if}
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<Dialog.Footer>
|
|
99
|
+
<Button onclick={save} disabled={saving || !next || next === current} kbd="enter">
|
|
100
|
+
{t__('common.change_url')}
|
|
101
|
+
</Button>
|
|
102
|
+
<Button variant="secondary" onclick={() => (open = false)} kbd="escape">
|
|
103
|
+
{t__('common.cancel')}
|
|
104
|
+
</Button>
|
|
105
|
+
</Dialog.Footer>
|
|
106
|
+
</Dialog.Content>
|
|
107
|
+
</Dialog.Root>
|
|
108
|
+
|
|
109
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
110
|
+
|
|
111
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
112
|
+
|
|
113
|
+
/* The hover tint, laid over the element's own fill. */
|
|
114
|
+
|
|
115
|
+
/* The picked item of a segmented control. */
|
|
116
|
+
|
|
117
|
+
/* The primary button's face: black on light, white on dark. */
|
|
118
|
+
|
|
119
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
120
|
+
|
|
121
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
122
|
+
|
|
123
|
+
/* An input with an error. */
|
|
124
|
+
.rz-change-slug {
|
|
125
|
+
display: grid;
|
|
126
|
+
gap: var(--rz-size-2);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* One well: the fixed start of the address, then the slug to type. */
|
|
130
|
+
.rz-change-slug__field {
|
|
131
|
+
background-color: var(--rz-bg-well);
|
|
132
|
+
border: 1px solid var(--rz-border);
|
|
133
|
+
&:hover {
|
|
134
|
+
border-color: var(--rz-border-strong);
|
|
135
|
+
}
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
height: var(--rz-input-height);
|
|
140
|
+
border-radius: var(--rz-radius-md);
|
|
141
|
+
|
|
142
|
+
&:focus-within {
|
|
143
|
+
outline: none;
|
|
144
|
+
border-color: var(--rz-accent-border);
|
|
145
|
+
box-shadow: 0 0 0 3px var(--rz-ring);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&[data-invalid] {
|
|
149
|
+
outline: none;
|
|
150
|
+
border-color: var(--rz-danger);
|
|
151
|
+
box-shadow: 0 0 0 3px oklch(from var(--rz-danger) l c h / 0.15);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rz-change-slug__prefix {
|
|
156
|
+
flex: 0 1 auto;
|
|
157
|
+
min-width: 0;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
padding-left: var(--rz-size-3);
|
|
160
|
+
color: var(--rz-fg-subtle);
|
|
161
|
+
font-family: var(--rz-font-mono);
|
|
162
|
+
font-size: var(--rz-text-xs);
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
white-space: nowrap;
|
|
165
|
+
direction: rtl;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.rz-change-slug__input {
|
|
169
|
+
flex: 1 0 8rem;
|
|
170
|
+
min-width: 0;
|
|
171
|
+
height: 100%;
|
|
172
|
+
padding-inline: 1px var(--rz-size-3);
|
|
173
|
+
border: 0;
|
|
174
|
+
outline: none;
|
|
175
|
+
background: transparent;
|
|
176
|
+
color: var(--rz-fg);
|
|
177
|
+
font-family: var(--rz-font-mono);
|
|
178
|
+
font-size: var(--rz-text-xs);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.rz-change-slug__preview {
|
|
182
|
+
color: var(--rz-fg-muted);
|
|
183
|
+
font-family: var(--rz-font-mono);
|
|
184
|
+
font-size: var(--rz-text-xs);
|
|
185
|
+
overflow-wrap: anywhere;
|
|
186
|
+
|
|
187
|
+
mark {
|
|
188
|
+
padding-inline: 2px;
|
|
189
|
+
border-radius: 3px;
|
|
190
|
+
background: var(--rz-accent-tint);
|
|
191
|
+
color: var(--rz-accent-text);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.rz-change-slug__error {
|
|
196
|
+
color: var(--rz-danger);
|
|
197
|
+
font-size: var(--rz-text-xs);
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuiltCollection } from '../../../../core/config/types';
|
|
2
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
form: DocumentFormContext;
|
|
5
|
+
config: BuiltCollection;
|
|
6
|
+
open: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const ChangeSlugDialog: import("svelte").Component<Props, {}, "open">;
|
|
9
|
+
type ChangeSlugDialog = ReturnType<typeof ChangeSlugDialog>;
|
|
10
|
+
export default ChangeSlugDialog;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
position: fixed;
|
|
25
25
|
inset: 0;
|
|
26
26
|
z-index: 100;
|
|
27
|
-
background:
|
|
28
|
-
backdrop-filter: blur(
|
|
27
|
+
background: oklch(from var(--rz-bg-page) l c h / 0.8);
|
|
28
|
+
backdrop-filter: blur(var(--rz-overlay-blur));
|
|
29
29
|
}
|
|
30
30
|
</style>
|