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,109 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconProps } from '@lucide/svelte';
|
|
3
|
+
import type { Component, Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: Component<IconProps>;
|
|
8
|
+
/** How many documents the card stands for, after the title. */
|
|
9
|
+
count?: number | null;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
actions?: Snippet;
|
|
12
|
+
children: Snippet;
|
|
13
|
+
};
|
|
14
|
+
const { title, icon: Icon, count, description, actions, children }: Props = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<section class="rz-dashboard-card">
|
|
18
|
+
<header class="rz-dashboard-card__head">
|
|
19
|
+
<h2 class="rz-dashboard-card__title">
|
|
20
|
+
{#if Icon}
|
|
21
|
+
<Icon size={14} aria-hidden="true" />
|
|
22
|
+
{/if}
|
|
23
|
+
{title}
|
|
24
|
+
{#if typeof count === 'number'}
|
|
25
|
+
<span class="rz-dashboard-card__count">{count}</span>
|
|
26
|
+
{/if}
|
|
27
|
+
</h2>
|
|
28
|
+
{#if description}
|
|
29
|
+
<p class="rz-dashboard-card__description">{description}</p>
|
|
30
|
+
{/if}
|
|
31
|
+
{#if actions}
|
|
32
|
+
<div class="rz-dashboard-card__actions">
|
|
33
|
+
{@render actions()}
|
|
34
|
+
</div>
|
|
35
|
+
{/if}
|
|
36
|
+
</header>
|
|
37
|
+
|
|
38
|
+
{@render children()}
|
|
39
|
+
</section>
|
|
40
|
+
|
|
41
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
42
|
+
|
|
43
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
44
|
+
|
|
45
|
+
/* The hover tint, laid over the element's own fill. */
|
|
46
|
+
|
|
47
|
+
/* The picked item of a segmented control. */
|
|
48
|
+
|
|
49
|
+
/* The primary button's face: black on light, white on dark. */
|
|
50
|
+
|
|
51
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
52
|
+
|
|
53
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
54
|
+
|
|
55
|
+
/* An input with an error. */
|
|
56
|
+
.rz-dashboard-card {
|
|
57
|
+
container: rz-dashboard-card / inline-size;
|
|
58
|
+
background-color: var(--rz-bg-raised);
|
|
59
|
+
box-shadow:
|
|
60
|
+
0 0 0 1px var(--rz-border),
|
|
61
|
+
var(--rz-shadow-raised);
|
|
62
|
+
border-radius: var(--rz-radius-lg);
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.rz-dashboard-card__head {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: var(--rz-size-2);
|
|
70
|
+
min-height: calc(10.5 * var(--rz-unit));
|
|
71
|
+
padding: 0 var(--rz-size-1-5) 0 var(--rz-size-3-5);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rz-dashboard-card__title {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: var(--rz-size-2);
|
|
79
|
+
font-variation-settings: 'wght' 500;
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
|
|
82
|
+
:global(svg) {
|
|
83
|
+
color: var(--rz-fg-subtle);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.rz-dashboard-card__count {
|
|
88
|
+
color: var(--rz-fg-subtle);
|
|
89
|
+
font-size: var(--rz-text-sm);
|
|
90
|
+
font-variant-numeric: tabular-nums;
|
|
91
|
+
font-variation-settings: 'wght' 400;
|
|
92
|
+
font-weight: 400;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.rz-dashboard-card__description {
|
|
96
|
+
min-width: 0;
|
|
97
|
+
color: var(--rz-fg-subtle);
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.rz-dashboard-card__actions {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: var(--rz-size-0-5);
|
|
107
|
+
margin-left: auto;
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IconProps } from '@lucide/svelte';
|
|
2
|
+
import type { Component, Snippet } from 'svelte';
|
|
3
|
+
type Props = {
|
|
4
|
+
title: string;
|
|
5
|
+
icon?: Component<IconProps>;
|
|
6
|
+
/** How many documents the card stands for, after the title. */
|
|
7
|
+
count?: number | null;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
actions?: Snippet;
|
|
10
|
+
children: Snippet;
|
|
11
|
+
};
|
|
12
|
+
declare const DashboardCard: Component<Props, {}, "">;
|
|
13
|
+
type DashboardCard = ReturnType<typeof DashboardCard>;
|
|
14
|
+
export default DashboardCard;
|
|
@@ -1,91 +1,214 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { ResolvedPathname } from '$app/types';
|
|
3
|
+
import { PARAMS } from '../../../core/constants.js';
|
|
2
4
|
import { t__ } from '../../../core/i18n/index.js';
|
|
3
|
-
import
|
|
5
|
+
import { UPLOAD_PATH } from '../../../core/prototype/collection/upload/constant.js';
|
|
6
|
+
import type { GenericDoc } from '../../../core/prototype/types.js';
|
|
7
|
+
import { apiUrl, panelPath } from '../../../core/routes/util.js';
|
|
8
|
+
import Avatar from '../../components/sections/collection/Avatar.svelte';
|
|
9
|
+
import DocStatus from '../../components/sections/collection/DocStatus.svelte';
|
|
10
|
+
import When from '../../components/sections/collection/When.svelte';
|
|
11
|
+
import BulkUploadDialog from '../../components/sections/collection/bulk-upload/BulkUploadDialog.svelte';
|
|
4
12
|
import GridItem from '../../components/sections/collection/grid/grid-item/GridItem.svelte';
|
|
5
13
|
import ButtonCreate from '../../components/sections/collection/header/ButtonCreate.svelte';
|
|
6
|
-
import Row from '../../components/sections/collection/list/row/Row.svelte';
|
|
7
14
|
import Button from '../../components/ui/button/button.svelte';
|
|
8
15
|
import { getConfigContext } from '../../context/config.svelte.js';
|
|
9
|
-
import {
|
|
10
|
-
|
|
16
|
+
import { capitalize } from '../../../util/string.js';
|
|
17
|
+
import { ChevronRight, Upload } from '@lucide/svelte';
|
|
18
|
+
import DashboardCard from './DashboardCard.svelte';
|
|
19
|
+
import DashboardRow from './DashboardRow.svelte';
|
|
11
20
|
import type { DashboardEntry } from './types.js';
|
|
12
21
|
|
|
13
|
-
type Props = { entry: DashboardEntry & { prototype: 'collection' } };
|
|
14
|
-
const { entry }: Props = $props();
|
|
22
|
+
type Props = { entry: DashboardEntry & { prototype: 'collection' }; now: Date };
|
|
23
|
+
const { entry, now }: Props = $props();
|
|
15
24
|
|
|
16
25
|
const config = getConfigContext();
|
|
17
26
|
const collectionConfig = $derived(config.getCollection(entry.slug));
|
|
27
|
+
const docs = $derived(entry.lastEdited ?? []);
|
|
28
|
+
const hasDrafts = $derived(!!collectionConfig.versions?.draft);
|
|
29
|
+
const isUpload = $derived(!!collectionConfig.upload);
|
|
30
|
+
// The people of an auth collection show as avatars, their role after their name.
|
|
31
|
+
const isPeople = $derived(!!collectionConfig.auth);
|
|
32
|
+
let uploadOpen = $state(false);
|
|
33
|
+
|
|
34
|
+
// /panel/pages/create, and /panel/medias/create?uploadPath=root for an upload collection
|
|
35
|
+
const createHref = $derived.by((): ResolvedPathname => {
|
|
36
|
+
const createPath = panelPath(collectionConfig.kebab, 'create');
|
|
37
|
+
if (!isUpload) return createPath;
|
|
38
|
+
return `${createPath}?${PARAMS.UPLOAD_PATH}=${UPLOAD_PATH.ROOT_NAME}` as ResolvedPathname;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// The files uploaded from the dashboard land in the root folder.
|
|
42
|
+
const uploadTarget = $derived({
|
|
43
|
+
url: apiUrl(collectionConfig.kebab),
|
|
44
|
+
path: UPLOAD_PATH.ROOT_NAME,
|
|
45
|
+
accept: collectionConfig.upload?.accept
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const nameOf = (doc: GenericDoc): string => doc.name || doc.title || '[untitled]';
|
|
49
|
+
|
|
50
|
+
// ['editor'] -> 'Editor'
|
|
51
|
+
const roleOf = (doc: GenericDoc): string =>
|
|
52
|
+
Array.isArray(doc.roles) && typeof doc.roles[0] === 'string' ? capitalize(doc.roles[0]) : '';
|
|
18
53
|
</script>
|
|
19
54
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
<DashboardCard
|
|
56
|
+
title={entry.title}
|
|
57
|
+
icon={config.raw.icons[entry.slug]}
|
|
58
|
+
count={entry.count}
|
|
59
|
+
description={entry.description}
|
|
60
|
+
>
|
|
61
|
+
{#snippet actions()}
|
|
62
|
+
{#if entry.canCreate && isUpload}
|
|
63
|
+
<Button
|
|
64
|
+
variant="ghost"
|
|
65
|
+
size="icon-sm"
|
|
66
|
+
class="rz-dashboard-collection__upload"
|
|
67
|
+
icon={Upload}
|
|
68
|
+
aria-label={t__('common.collection_upload')}
|
|
69
|
+
title={t__('common.collection_upload')}
|
|
70
|
+
onclick={() => (uploadOpen = true)}
|
|
71
|
+
/>
|
|
72
|
+
{:else if entry.canCreate}
|
|
73
|
+
<ButtonCreate config={collectionConfig} size="sm" />
|
|
74
|
+
{/if}
|
|
75
|
+
<a class="rz-dashboard-collection__more" href={entry.link}>
|
|
76
|
+
{t__('common.view_all')}<span class="rz-sr-only"> {entry.title}</span>
|
|
77
|
+
<ChevronRight size={12} aria-hidden="true" />
|
|
78
|
+
</a>
|
|
79
|
+
{/snippet}
|
|
80
|
+
|
|
81
|
+
{#if docs.length === 0}
|
|
82
|
+
<p class="rz-dashboard-collection__empty">
|
|
83
|
+
{collectionConfig.label.none || t__('common.no_documents_yet', entry.title)}
|
|
24
84
|
{#if entry.canCreate}
|
|
25
|
-
<
|
|
85
|
+
<a href={createHref}>{t__('common.create_first_one')}</a>
|
|
26
86
|
{/if}
|
|
27
|
-
|
|
87
|
+
</p>
|
|
88
|
+
{:else if entry.layout === 'grid'}
|
|
89
|
+
<div class="rz-dashboard-collection__grid">
|
|
90
|
+
{#each docs as doc (doc.id)}
|
|
91
|
+
<GridItem isSelectMode={false} config={collectionConfig} {doc} checked={false} />
|
|
92
|
+
{/each}
|
|
28
93
|
</div>
|
|
29
|
-
<Button variant="text" href={entry.link}>
|
|
30
|
-
{t__('common.view_all')}
|
|
31
|
-
<ChevronRight size={12} />
|
|
32
|
-
</Button>
|
|
33
|
-
</header>
|
|
34
|
-
{#if entry.lastEdited?.length === 0}
|
|
35
|
-
<Empty config={collectionConfig} />
|
|
36
94
|
{:else}
|
|
37
|
-
<
|
|
38
|
-
{#each
|
|
39
|
-
{#if
|
|
40
|
-
<
|
|
95
|
+
<ul class="rz-dashboard-collection__rows">
|
|
96
|
+
{#each docs as doc (doc.id)}
|
|
97
|
+
{#if isPeople}
|
|
98
|
+
<DashboardRow href={panelPath(collectionConfig.kebab, doc.id)} title={nameOf(doc)}>
|
|
99
|
+
{#snippet lead()}
|
|
100
|
+
<Avatar name={nameOf(doc)} />
|
|
101
|
+
{/snippet}
|
|
102
|
+
{#if roleOf(doc)}
|
|
103
|
+
<span class="rz-dashboard-collection__role">{roleOf(doc)}</span>
|
|
104
|
+
{/if}
|
|
105
|
+
</DashboardRow>
|
|
41
106
|
{:else}
|
|
42
|
-
<
|
|
107
|
+
<DashboardRow
|
|
108
|
+
href={panelPath(collectionConfig.kebab, doc.id)}
|
|
109
|
+
title={doc.title || '[untitled]'}
|
|
110
|
+
>
|
|
111
|
+
{#if hasDrafts && doc.status}
|
|
112
|
+
<DocStatus status={doc.status} />
|
|
113
|
+
{/if}
|
|
114
|
+
{#if doc.updatedAt}
|
|
115
|
+
<When date={doc.updatedAt} {now} />
|
|
116
|
+
{/if}
|
|
117
|
+
</DashboardRow>
|
|
43
118
|
{/if}
|
|
44
119
|
{/each}
|
|
45
|
-
</
|
|
120
|
+
</ul>
|
|
46
121
|
{/if}
|
|
47
|
-
</
|
|
122
|
+
</DashboardCard>
|
|
123
|
+
|
|
124
|
+
{#if entry.canCreate && isUpload}
|
|
125
|
+
<BulkUploadDialog target={uploadTarget} bind:open={uploadOpen} />
|
|
126
|
+
{/if}
|
|
127
|
+
|
|
128
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
129
|
+
|
|
130
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
131
|
+
|
|
132
|
+
/* The hover tint, laid over the element's own fill. */
|
|
133
|
+
|
|
134
|
+
/* The picked item of a segmented control. */
|
|
135
|
+
|
|
136
|
+
/* The primary button's face: black on light, white on dark. */
|
|
137
|
+
|
|
138
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
139
|
+
|
|
140
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
48
141
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
142
|
+
/* An input with an error. */
|
|
143
|
+
/* A plain upload arrow, subtle until hovered, like the plus of the other cards. */
|
|
144
|
+
:global(.rz-button.rz-dashboard-collection__upload) {
|
|
145
|
+
width: var(--rz-size-7);
|
|
146
|
+
height: var(--rz-size-7);
|
|
147
|
+
border-radius: var(--rz-radius-md);
|
|
148
|
+
color: var(--rz-fg-subtle);
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
color: var(--rz-fg);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rz-dashboard-collection__more {
|
|
156
|
+
display: inline-flex;
|
|
52
157
|
align-items: center;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
158
|
+
gap: var(--rz-size-0-5);
|
|
159
|
+
height: var(--rz-size-7);
|
|
160
|
+
padding: 0 var(--rz-size-1-5) 0 var(--rz-size-2);
|
|
161
|
+
border-radius: var(--rz-radius-sm);
|
|
162
|
+
color: var(--rz-fg-muted);
|
|
163
|
+
font-size: var(--rz-text-sm);
|
|
164
|
+
white-space: nowrap;
|
|
165
|
+
|
|
166
|
+
&:hover {
|
|
167
|
+
background-color: var(--rz-bg-hover);
|
|
168
|
+
color: var(--rz-fg);
|
|
59
169
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-webkit-box-orient: vertical;
|
|
65
|
-
-webkit-line-clamp: 1;
|
|
170
|
+
|
|
171
|
+
&:focus-visible {
|
|
172
|
+
outline: 2px solid var(--rz-accent-border);
|
|
173
|
+
outline-offset: 2px;
|
|
66
174
|
}
|
|
67
175
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
176
|
+
|
|
177
|
+
.rz-dashboard-collection__empty {
|
|
178
|
+
padding: var(--rz-size-3) var(--rz-size-3-5) var(--rz-size-3-5);
|
|
179
|
+
box-shadow: inset 0 1px 0 var(--rz-border);
|
|
180
|
+
color: var(--rz-fg-subtle);
|
|
181
|
+
|
|
182
|
+
a {
|
|
183
|
+
color: var(--rz-accent-text);
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
text-decoration: underline;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:focus-visible {
|
|
190
|
+
outline: 2px solid var(--rz-accent-border);
|
|
191
|
+
outline-offset: 2px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
71
194
|
}
|
|
72
195
|
|
|
73
|
-
.rz-dashboard-
|
|
196
|
+
.rz-dashboard-collection__grid {
|
|
74
197
|
display: grid;
|
|
75
|
-
|
|
198
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
199
|
+
gap: var(--rz-size-3);
|
|
200
|
+
padding: var(--rz-size-0-5) var(--rz-size-3-5) var(--rz-size-3-5);
|
|
76
201
|
}
|
|
77
202
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
@media (min-width: 640px) {
|
|
82
|
-
--columns: 2;
|
|
83
|
-
}
|
|
84
|
-
@media (min-width: 1024px) {
|
|
85
|
-
--columns: 3;
|
|
86
|
-
}
|
|
87
|
-
@media (min-width: 1280px) {
|
|
88
|
-
--columns: 4;
|
|
203
|
+
@container rz-dashboard-card (min-width: 30rem) {
|
|
204
|
+
.rz-dashboard-collection__grid {
|
|
205
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
89
206
|
}
|
|
90
207
|
}
|
|
208
|
+
|
|
209
|
+
.rz-dashboard-collection__role {
|
|
210
|
+
color: var(--rz-fg-subtle);
|
|
211
|
+
font-size: var(--rz-text-sm);
|
|
212
|
+
white-space: nowrap;
|
|
213
|
+
}
|
|
91
214
|
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ResolvedPathname } from '$app/types';
|
|
3
|
+
import type { IconProps } from '@lucide/svelte';
|
|
4
|
+
import type { Component, Snippet } from 'svelte';
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
href: ResolvedPathname;
|
|
8
|
+
title: string;
|
|
9
|
+
icon?: Component<IconProps>;
|
|
10
|
+
/** Before the title, in place of an icon: an avatar. */
|
|
11
|
+
lead?: Snippet;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
/** After the title: a status, a role, a date. */
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
const { href, title, icon: Icon, lead, description, children }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<li>
|
|
20
|
+
<a class="rz-dashboard-row" {href}>
|
|
21
|
+
{#if lead}
|
|
22
|
+
{@render lead()}
|
|
23
|
+
{:else if Icon}
|
|
24
|
+
<Icon size={14} aria-hidden="true" />
|
|
25
|
+
{/if}
|
|
26
|
+
<span class="rz-dashboard-row__text">
|
|
27
|
+
<span class="rz-dashboard-row__title">{title}</span>
|
|
28
|
+
{#if description}
|
|
29
|
+
<span class="rz-dashboard-row__description">{description}</span>
|
|
30
|
+
{/if}
|
|
31
|
+
</span>
|
|
32
|
+
{@render children?.()}
|
|
33
|
+
</a>
|
|
34
|
+
</li>
|
|
35
|
+
|
|
36
|
+
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
37
|
+
|
|
38
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
39
|
+
|
|
40
|
+
/* The hover tint, laid over the element's own fill. */
|
|
41
|
+
|
|
42
|
+
/* The picked item of a segmented control. */
|
|
43
|
+
|
|
44
|
+
/* The primary button's face: black on light, white on dark. */
|
|
45
|
+
|
|
46
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
47
|
+
|
|
48
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
49
|
+
|
|
50
|
+
/* An input with an error. */
|
|
51
|
+
.rz-dashboard-row {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: var(--rz-size-2-5);
|
|
55
|
+
min-height: calc(9.5 * var(--rz-unit));
|
|
56
|
+
padding: var(--rz-size-1-5) var(--rz-size-3-5);
|
|
57
|
+
box-shadow: inset 0 1px 0 var(--rz-border);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: var(--rz-bg-hover);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:focus-visible {
|
|
64
|
+
outline: none;
|
|
65
|
+
box-shadow:
|
|
66
|
+
inset 0 1px 0 var(--rz-border),
|
|
67
|
+
inset 0 0 0 2px var(--rz-accent-border);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
> :global(svg) {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
color: var(--rz-fg-subtle);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.rz-dashboard-row__text {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex: 1;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.rz-dashboard-row__title,
|
|
84
|
+
.rz-dashboard-row__description {
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
text-overflow: ellipsis;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.rz-dashboard-row__description {
|
|
91
|
+
color: var(--rz-fg-subtle);
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedPathname } from '$app/types';
|
|
2
|
+
import type { IconProps } from '@lucide/svelte';
|
|
3
|
+
import type { Component, Snippet } from 'svelte';
|
|
4
|
+
type Props = {
|
|
5
|
+
href: ResolvedPathname;
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: Component<IconProps>;
|
|
8
|
+
/** Before the title, in place of an icon: an avatar. */
|
|
9
|
+
lead?: Snippet;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
/** After the title: a status, a role, a date. */
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
declare const DashboardRow: Component<Props, {}, "">;
|
|
15
|
+
type DashboardRow = ReturnType<typeof DashboardRow>;
|
|
16
|
+
export default DashboardRow;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VERSIONS_STATUS } from '../../../core/prototype/shared/versions/constant.js';
|
|
1
2
|
import { capitalize } from '../../../util/string.js';
|
|
2
3
|
export const dashboardLoad = async (event) => {
|
|
3
4
|
const { locale, user, rime } = event.locals;
|
|
@@ -8,20 +9,17 @@ export const dashboardLoad = async (event) => {
|
|
|
8
9
|
* `panel !== false` is already filtered below, so `c.panel` here is either what the author wrote
|
|
9
10
|
* or nothing at all. Layout precedence, widest to narrowest: what the author put on the
|
|
10
11
|
* collection, then what a feature offered through `_dashboardLayout` (`upload` asks for a grid),
|
|
11
|
-
* then rows.
|
|
12
|
-
*
|
|
13
|
-
* The collection prototype used to seed all of this in an `configurePanel`, which meant `panel`
|
|
14
|
-
* was always an object by the time it got here — so `panel: false` never survived to be read,
|
|
15
|
-
* and these defaults ran twice.
|
|
12
|
+
* then rows. The author's `maxEntries` wins, else 3 rows or 4 grid items.
|
|
16
13
|
*/
|
|
17
14
|
const normalizedPanelConfig = (c) => {
|
|
18
15
|
const incomingConfig = c.panel || {};
|
|
19
16
|
const incomingDashboardConfig = incomingConfig.dashboard || {};
|
|
17
|
+
const layout = incomingDashboardConfig.layout ?? c._dashboardLayout ?? 'rows';
|
|
20
18
|
return {
|
|
21
19
|
...incomingConfig,
|
|
22
20
|
dashboard: {
|
|
23
|
-
layout
|
|
24
|
-
maxEntries: incomingDashboardConfig.maxEntries ||
|
|
21
|
+
layout,
|
|
22
|
+
maxEntries: incomingDashboardConfig.maxEntries || (layout === 'grid' ? 4 : 3)
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
};
|
|
@@ -38,7 +36,7 @@ export const dashboardLoad = async (event) => {
|
|
|
38
36
|
layout: panelConfig.dashboard.layout
|
|
39
37
|
};
|
|
40
38
|
};
|
|
41
|
-
const getLastEdited = async (c, limit
|
|
39
|
+
const getLastEdited = async (c, limit) => {
|
|
42
40
|
try {
|
|
43
41
|
return await rime.collection(c.slug).find({
|
|
44
42
|
limit,
|
|
@@ -52,15 +50,42 @@ export const dashboardLoad = async (event) => {
|
|
|
52
50
|
return [];
|
|
53
51
|
}
|
|
54
52
|
};
|
|
53
|
+
/** How many documents a collection holds, and how many of them wait as drafts. */
|
|
54
|
+
const countDocuments = async (c) => {
|
|
55
|
+
try {
|
|
56
|
+
const docs = await rime.collection(c.slug).find({ locale, latest: true, select: ['status'] });
|
|
57
|
+
const drafts = c.versions?.draft
|
|
58
|
+
? docs.filter((doc) => doc.status === VERSIONS_STATUS.DRAFT).length
|
|
59
|
+
: 0;
|
|
60
|
+
return { count: docs.length, drafts };
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
console.error(`Error counting documents of collection ${c.slug}:`);
|
|
64
|
+
console.error(err);
|
|
65
|
+
return { count: null, drafts: 0 };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
55
68
|
const promiseEntries = rime.config.raw.collections
|
|
56
69
|
.filter((collection) => user && collection.access.read(user, {}))
|
|
57
70
|
.filter((collection) => collection.panel !== false && collection.panel?.dashboard !== false)
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
// Every collection left wants its latest documents listed, and counted.
|
|
72
|
+
.map(async (collection) => {
|
|
73
|
+
const [docs, counts] = await Promise.all([
|
|
74
|
+
getLastEdited(collection, normalizedPanelConfig(collection).dashboard.maxEntries),
|
|
75
|
+
countDocuments(collection)
|
|
76
|
+
]);
|
|
77
|
+
return { ...buildBaseEntry(collection), lastEdited: docs, ...counts };
|
|
78
|
+
});
|
|
79
|
+
/** When an area was last saved, or `null` when it cannot say. */
|
|
80
|
+
const lastUpdate = async (slug) => {
|
|
81
|
+
try {
|
|
82
|
+
const doc = await rime.area(slug).find({ locale, latest: true, select: ['updatedAt'] });
|
|
83
|
+
return doc?.updatedAt ?? null;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
64
89
|
try {
|
|
65
90
|
const collectionEntries = await Promise.all(promiseEntries);
|
|
66
91
|
entries.push(...collectionEntries);
|
|
@@ -69,17 +94,16 @@ export const dashboardLoad = async (event) => {
|
|
|
69
94
|
console.error('Error retrieving collection entries:');
|
|
70
95
|
console.error(err);
|
|
71
96
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
97
|
+
const areas = rime.config.raw.areas.filter((area) => area.panel !== false && user && area.access.read(user, {}));
|
|
98
|
+
const areaEntries = await Promise.all(areas.map(async (area) => ({
|
|
99
|
+
prototype: 'area',
|
|
100
|
+
description: (area.panel && area.panel?.description) || null,
|
|
101
|
+
slug: area.slug,
|
|
102
|
+
link: rime.routes.panelUrl(area.kebab),
|
|
103
|
+
title: area.label || capitalize(area.slug),
|
|
104
|
+
updatedAt: await lastUpdate(area.slug)
|
|
105
|
+
})));
|
|
106
|
+
entries.push(...areaEntries);
|
|
83
107
|
const aria = [{ title: 'Dashboard', icon: 'dashboard', url: rime.routes.panelUrl() }];
|
|
84
108
|
return { entries, aria };
|
|
85
109
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The greeting key for an hour of the day.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* greetingKey(9) // 'common.good_morning' 5 to 11
|
|
6
|
+
* greetingKey(15) // 'common.good_afternoon' 12 to 17
|
|
7
|
+
* greetingKey(22) // 'common.good_evening' 18 to 4
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare function greetingKey(hour: number): "common.good_morning" | "common.good_afternoon" | "common.good_evening";
|
|
11
|
+
/**
|
|
12
|
+
* The day, spelled out, capitalized.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* formatDay(now, 'en') // 'Saturday, September 26'
|
|
16
|
+
* formatDay(now, 'fr') // 'Samedi 26 septembre'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatDay(date: Date, lang: string): string;
|