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
|
@@ -1,30 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The palette: grays and an accent in OKLCH, set by four numbers. 0 is the darkest gray.
|
|
3
|
+
* Only scheme.css reads it; components read the scheme's tokens.
|
|
4
|
+
*/
|
|
1
5
|
:root {
|
|
2
|
-
--rz-gray-
|
|
3
|
-
--rz-gray-
|
|
4
|
-
--rz-gray-
|
|
5
|
-
--rz-gray-
|
|
6
|
-
--rz-gray-
|
|
7
|
-
--rz-gray-
|
|
8
|
-
--rz-gray-
|
|
9
|
-
--rz-gray-
|
|
10
|
-
--rz-gray-
|
|
11
|
-
--rz-gray-
|
|
12
|
-
--rz-gray-
|
|
13
|
-
--rz-gray-
|
|
14
|
-
--rz-gray-
|
|
15
|
-
--rz-gray-
|
|
16
|
-
--rz-gray-
|
|
17
|
-
--rz-gray-
|
|
18
|
-
--rz-gray-
|
|
19
|
-
--rz-gray-
|
|
20
|
-
--rz-gray-
|
|
21
|
-
--rz-gray-
|
|
6
|
+
--rz-gray-hue: 0;
|
|
7
|
+
--rz-gray-chroma: 0;
|
|
8
|
+
--rz-gray-0: oklch(0.13 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
9
|
+
--rz-gray-1: oklch(0.155 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
10
|
+
--rz-gray-2: oklch(0.178 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
11
|
+
--rz-gray-3: oklch(0.203 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
12
|
+
--rz-gray-4: oklch(0.232 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
13
|
+
--rz-gray-5: oklch(0.27 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
14
|
+
--rz-gray-6: oklch(0.33 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
15
|
+
--rz-gray-7: oklch(0.4 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
16
|
+
--rz-gray-8: oklch(0.48 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
17
|
+
--rz-gray-9: oklch(0.555 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
18
|
+
--rz-gray-10: oklch(0.625 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
19
|
+
--rz-gray-11: oklch(0.69 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
20
|
+
--rz-gray-12: oklch(0.755 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
21
|
+
--rz-gray-13: oklch(0.815 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
22
|
+
--rz-gray-14: oklch(0.865 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
23
|
+
--rz-gray-15: oklch(0.905 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
24
|
+
--rz-gray-16: oklch(0.94 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
25
|
+
--rz-gray-17: oklch(0.965 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
26
|
+
--rz-gray-18: oklch(0.982 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
27
|
+
--rz-gray-19: oklch(0.996 var(--rz-gray-chroma) var(--rz-gray-hue));
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
--rz-
|
|
25
|
-
--rz-
|
|
29
|
+
--rz-accent-hue: 268;
|
|
30
|
+
--rz-accent-chroma: 0.19;
|
|
31
|
+
--rz-accent-strong: oklch(0.5 var(--rz-accent-chroma) var(--rz-accent-hue));
|
|
32
|
+
--rz-accent-solid: oklch(0.585 var(--rz-accent-chroma) var(--rz-accent-hue));
|
|
33
|
+
--rz-accent-soft: oklch(0.76 calc(var(--rz-accent-chroma) * 0.8) var(--rz-accent-hue));
|
|
34
|
+
--rz-accent-contrast: oklch(0.99 0 0);
|
|
26
35
|
|
|
27
|
-
--rz-
|
|
28
|
-
--rz-
|
|
29
|
-
--rz-
|
|
36
|
+
--rz-success: oklch(0.64 0.14 155);
|
|
37
|
+
--rz-warn: oklch(0.76 0.15 70);
|
|
38
|
+
--rz-danger: oklch(0.62 0.19 25);
|
|
30
39
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--size(n)`: a length off the size scale, `n` steps of `--rz-unit` (0.25rem).
|
|
3
|
+
*
|
|
4
|
+
* The named sizes (`--rz-size-4`, `--rz-size-2-5`, …) cover the usual steps; this reaches the
|
|
5
|
+
* others without adding two of them together.
|
|
6
|
+
*
|
|
7
|
+
* ```css
|
|
8
|
+
* width: --size(5.5); -> width: calc(5.5 * var(--rz-unit));
|
|
9
|
+
* margin: --size(-2) --size(1); -> margin: calc(-2 * var(--rz-unit)) calc(1 * var(--rz-unit));
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @returns {import('postcss').Plugin}
|
|
13
|
+
*/
|
|
14
|
+
export const sizeFunction = () => ({
|
|
15
|
+
postcssPlugin: 'rz-size-function',
|
|
16
|
+
Declaration(decl) {
|
|
17
|
+
if (!decl.value.includes('--size(')) return;
|
|
18
|
+
decl.value = decl.value.replace(
|
|
19
|
+
/--size\(\s*(-?\d*\.?\d+)\s*\)/g,
|
|
20
|
+
(/** @type {string} */ _, /** @type {string} */ n) => `calc(${n} * var(--rz-unit))`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
sizeFunction.postcss = true;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--rz-radius-none: 0;
|
|
3
|
-
--rz-
|
|
4
|
-
--rz-radius-
|
|
5
|
-
--rz-radius-
|
|
6
|
-
--rz-radius-
|
|
7
|
-
--rz-radius-xl: calc(var(--rz-base-radius) * 4);
|
|
3
|
+
--rz-radius-sm: 0.25rem;
|
|
4
|
+
--rz-radius-md: 0.375rem;
|
|
5
|
+
--rz-radius-lg: 0.4375rem;
|
|
6
|
+
--rz-radius-xl: 0.625rem;
|
|
8
7
|
--rz-radius-full: 999999px;
|
|
9
8
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* What each token is, in light and in dark. Nothing else names a gray.
|
|
3
|
+
*
|
|
4
|
+
* base → page → raised → float: each level sits on the one before it.
|
|
5
|
+
* The tints are translucent, so they shade whatever level is under them.
|
|
6
|
+
*/
|
|
7
|
+
:root {
|
|
8
|
+
color-scheme: light dark;
|
|
9
|
+
|
|
10
|
+
/* levels */
|
|
11
|
+
--rz-bg-base: var(--rz-gray-17);
|
|
12
|
+
--rz-bg-page: var(--rz-gray-19);
|
|
13
|
+
--rz-bg-raised: var(--rz-gray-19);
|
|
14
|
+
--rz-bg-float: var(--rz-gray-19);
|
|
15
|
+
--rz-bg-knob: var(--rz-gray-19);
|
|
16
|
+
--rz-bg-inverse: var(--rz-gray-2);
|
|
17
|
+
|
|
18
|
+
/* tints */
|
|
19
|
+
--rz-bg-well: oklch(from var(--rz-gray-0) l c h / 0.035);
|
|
20
|
+
--rz-bg-hover: oklch(from var(--rz-gray-0) l c h / 0.035);
|
|
21
|
+
--rz-bg-active: oklch(from var(--rz-gray-0) l c h / 0.06);
|
|
22
|
+
--rz-bg-overlay: oklch(from var(--rz-gray-0) l c h / 0.2);
|
|
23
|
+
|
|
24
|
+
/* borders */
|
|
25
|
+
--rz-border: oklch(from var(--rz-gray-0) l c h / 0.075);
|
|
26
|
+
--rz-border-strong: oklch(from var(--rz-gray-0) l c h / 0.13);
|
|
27
|
+
|
|
28
|
+
/* text */
|
|
29
|
+
--rz-fg: var(--rz-gray-2);
|
|
30
|
+
--rz-fg-muted: var(--rz-gray-8);
|
|
31
|
+
--rz-fg-subtle: var(--rz-gray-10);
|
|
32
|
+
--rz-fg-inverse: var(--rz-gray-18);
|
|
33
|
+
|
|
34
|
+
/* accent: focus, a selection, a link */
|
|
35
|
+
--rz-accent: var(--rz-accent-solid);
|
|
36
|
+
--rz-accent-fg: var(--rz-accent-contrast);
|
|
37
|
+
--rz-accent-text: var(--rz-accent-strong);
|
|
38
|
+
--rz-accent-tint: oklch(from var(--rz-accent-solid) l c h / 0.07);
|
|
39
|
+
--rz-accent-border: oklch(from var(--rz-accent-solid) l c h / 0.5);
|
|
40
|
+
--rz-ring: oklch(from var(--rz-accent-solid) l c h / 0.16);
|
|
41
|
+
|
|
42
|
+
/* shadows: light mode lifts with a shadow, dark mode with a lit top edge */
|
|
43
|
+
--rz-shadow-raised: 0 1px 2px oklch(from var(--rz-gray-0) l c h / 0.035);
|
|
44
|
+
--rz-shadow-float:
|
|
45
|
+
0 4px 12px -2px oklch(from var(--rz-gray-0) l c h / 0.06),
|
|
46
|
+
0 16px 36px -12px oklch(from var(--rz-gray-0) l c h / 0.16);
|
|
47
|
+
--rz-shadow-knob:
|
|
48
|
+
0 0 0 1px oklch(from var(--rz-gray-0) l c h / 0.06),
|
|
49
|
+
0 1px 2px oklch(from var(--rz-gray-0) l c h / 0.08);
|
|
50
|
+
|
|
51
|
+
/* gradients */
|
|
52
|
+
--rz-gradient-primary: linear-gradient(
|
|
53
|
+
180deg,
|
|
54
|
+
oklch(from var(--rz-bg-inverse) calc(l + 0.08) c h),
|
|
55
|
+
var(--rz-bg-inverse)
|
|
56
|
+
);
|
|
57
|
+
--rz-shadow-primary:
|
|
58
|
+
inset 0 1px 0 oklch(from var(--rz-gray-19) l c h / 0.12),
|
|
59
|
+
0 1px 2px oklch(from var(--rz-gray-0) l c h / 0.18);
|
|
60
|
+
--rz-glow: radial-gradient(
|
|
61
|
+
70% 38% at 50% 0%,
|
|
62
|
+
oklch(from var(--rz-accent-solid) l c h / 0.035),
|
|
63
|
+
transparent
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media (prefers-color-scheme: dark) {
|
|
68
|
+
:root {
|
|
69
|
+
--rz-bg-base: var(--rz-gray-1);
|
|
70
|
+
--rz-bg-page: var(--rz-gray-2);
|
|
71
|
+
--rz-bg-raised: var(--rz-gray-3);
|
|
72
|
+
--rz-bg-float: var(--rz-gray-4);
|
|
73
|
+
--rz-bg-knob: var(--rz-gray-5);
|
|
74
|
+
--rz-bg-inverse: var(--rz-gray-17);
|
|
75
|
+
|
|
76
|
+
--rz-bg-well: oklch(from var(--rz-gray-19) l c h / 0.035);
|
|
77
|
+
--rz-bg-hover: oklch(from var(--rz-gray-19) l c h / 0.04);
|
|
78
|
+
--rz-bg-active: oklch(from var(--rz-gray-19) l c h / 0.07);
|
|
79
|
+
--rz-bg-overlay: oklch(from var(--rz-gray-0) l c h / 0.55);
|
|
80
|
+
|
|
81
|
+
--rz-border: oklch(from var(--rz-gray-19) l c h / 0.07);
|
|
82
|
+
--rz-border-strong: oklch(from var(--rz-gray-19) l c h / 0.12);
|
|
83
|
+
|
|
84
|
+
--rz-fg: var(--rz-gray-17);
|
|
85
|
+
--rz-fg-muted: var(--rz-gray-12);
|
|
86
|
+
--rz-fg-subtle: var(--rz-gray-9);
|
|
87
|
+
--rz-fg-inverse: var(--rz-gray-2);
|
|
88
|
+
|
|
89
|
+
--rz-accent-text: var(--rz-accent-soft);
|
|
90
|
+
--rz-accent-tint: oklch(from var(--rz-accent-solid) l c h / 0.13);
|
|
91
|
+
--rz-accent-border: oklch(from var(--rz-accent-soft) l c h / 0.45);
|
|
92
|
+
--rz-ring: oklch(from var(--rz-accent-soft) l c h / 0.2);
|
|
93
|
+
|
|
94
|
+
--rz-shadow-raised: inset 0 1px 0 oklch(from var(--rz-gray-19) l c h / 0.03);
|
|
95
|
+
--rz-shadow-float:
|
|
96
|
+
inset 0 1px 0 oklch(from var(--rz-gray-19) l c h / 0.05),
|
|
97
|
+
0 16px 40px -12px oklch(from var(--rz-gray-0) l c h / 0.6);
|
|
98
|
+
--rz-shadow-knob:
|
|
99
|
+
inset 0 1px 0 oklch(from var(--rz-gray-19) l c h / 0.07),
|
|
100
|
+
0 1px 2px oklch(from var(--rz-gray-0) l c h / 0.5);
|
|
101
|
+
|
|
102
|
+
--rz-shadow-primary:
|
|
103
|
+
inset 0 1px 0 oklch(from var(--rz-gray-19) l c h / 0.5),
|
|
104
|
+
0 1px 2px oklch(from var(--rz-gray-0) l c h / 0.4);
|
|
105
|
+
--rz-glow: radial-gradient(
|
|
106
|
+
70% 38% at 50% 0%,
|
|
107
|
+
oklch(from var(--rz-accent-solid) l c h / 0.07),
|
|
108
|
+
transparent
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -2,16 +2,20 @@ import Sortable from 'sortablejs';
|
|
|
2
2
|
export const useSortable = ({ ...sortableProps }) => {
|
|
3
3
|
const sortable = (el) => {
|
|
4
4
|
let childNodes = [];
|
|
5
|
+
let from = null;
|
|
5
6
|
const existing = Sortable.get(el);
|
|
6
7
|
if (existing) {
|
|
7
8
|
// Better safe than sorry. At least we know this ain't the case.
|
|
8
9
|
throw new Error('Instance exist. Should never happen.');
|
|
9
10
|
}
|
|
10
11
|
const sortableInstance = new Sortable(el, {
|
|
12
|
+
// No text in the drag: an editor under the pointer takes nothing from the drop.
|
|
13
|
+
setData: (dataTransfer) => dataTransfer.setData('application/x-rime-sortable', '1'),
|
|
11
14
|
...sortableProps,
|
|
12
15
|
onStart: function (e) {
|
|
13
16
|
const node = e.item;
|
|
14
|
-
// Remember the list
|
|
17
|
+
// Remember the list, and its child nodes, when drag started.
|
|
18
|
+
from = e.from;
|
|
15
19
|
childNodes = Array.prototype.slice.call(node.parentNode.childNodes);
|
|
16
20
|
// Filter out the 'sortable-fallback' element used on mobile/old browsers.
|
|
17
21
|
childNodes = childNodes.filter((node) => node.nodeType != Node.ELEMENT_NODE || !node.classList.contains('sortable-fallback'));
|
|
@@ -20,12 +24,13 @@ export const useSortable = ({ ...sortableProps }) => {
|
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
onEnd: function (e) {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
// Put the DOM back the way it was, in the list the drag started from — the item may have
|
|
28
|
+
// landed in another one — so the state change below is the only thing that reorders.
|
|
29
|
+
const parentNode = from ?? e.item.parentNode;
|
|
25
30
|
for (const childNode of childNodes) {
|
|
26
31
|
parentNode.appendChild(childNode);
|
|
27
32
|
}
|
|
28
|
-
if (e.oldIndex == e.newIndex)
|
|
33
|
+
if (e.from === e.to && e.oldIndex == e.newIndex)
|
|
29
34
|
return;
|
|
30
35
|
if (sortableProps.onEnd) {
|
|
31
36
|
sortableProps.onEnd(e);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A key chord: `mod` is ⌘ on a Mac, Ctrl elsewhere; `key` is `event.key` in lower case. */
|
|
2
|
+
export type Keys = {
|
|
3
|
+
mod: boolean;
|
|
4
|
+
shift: boolean;
|
|
5
|
+
alt: boolean;
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* `alt+arrowup` -> `{ alt: true, key: 'arrowup' }`. The last part is the key, the others the
|
|
10
|
+
* modifiers, in any order.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseKeys(keys: string): Keys;
|
|
13
|
+
/**
|
|
14
|
+
* The event is exactly this chord: every modifier named, no other one down. Shift does not count
|
|
15
|
+
* for a character with no case, since some keyboards need it to type one:
|
|
16
|
+
*
|
|
17
|
+
* `/` on a French keyboard is Shift + `:`
|
|
18
|
+
*/
|
|
19
|
+
export declare function matches(event: KeyboardEvent, keys: Keys): boolean;
|
|
20
|
+
export declare const isMac: () => boolean;
|
|
21
|
+
/** `mod+s` -> `⌘S` on a Mac, `Ctrl+S` elsewhere. */
|
|
22
|
+
export declare function formatKeys(keys: string, mac?: boolean): string;
|
|
23
|
+
/** The keyboard is a field's: an input, a textarea, a select, a contenteditable, an editor. */
|
|
24
|
+
export declare function isTyping(event: Event): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `alt+arrowup` -> `{ alt: true, key: 'arrowup' }`. The last part is the key, the others the
|
|
3
|
+
* modifiers, in any order.
|
|
4
|
+
*/
|
|
5
|
+
export function parseKeys(keys) {
|
|
6
|
+
const parts = keys.toLowerCase().split('+');
|
|
7
|
+
const key = parts.pop() ?? '';
|
|
8
|
+
return {
|
|
9
|
+
mod: parts.includes('mod'),
|
|
10
|
+
shift: parts.includes('shift'),
|
|
11
|
+
alt: parts.includes('alt'),
|
|
12
|
+
key
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The event is exactly this chord: every modifier named, no other one down. Shift does not count
|
|
17
|
+
* for a character with no case, since some keyboards need it to type one:
|
|
18
|
+
*
|
|
19
|
+
* `/` on a French keyboard is Shift + `:`
|
|
20
|
+
*/
|
|
21
|
+
export function matches(event, keys) {
|
|
22
|
+
const caseless = keys.key.length === 1 && keys.key.toUpperCase() === keys.key.toLowerCase();
|
|
23
|
+
return (keys.mod === (event.metaKey || event.ctrlKey) &&
|
|
24
|
+
(caseless || keys.shift === event.shiftKey) &&
|
|
25
|
+
keys.alt === event.altKey &&
|
|
26
|
+
keys.key === event.key.toLowerCase());
|
|
27
|
+
}
|
|
28
|
+
export const isMac = () => typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.platform);
|
|
29
|
+
const KEY_LABELS = {
|
|
30
|
+
arrowup: '↑',
|
|
31
|
+
arrowdown: '↓',
|
|
32
|
+
arrowleft: '←',
|
|
33
|
+
arrowright: '→',
|
|
34
|
+
backspace: '⌫',
|
|
35
|
+
delete: '⌦',
|
|
36
|
+
escape: 'Esc',
|
|
37
|
+
enter: '↵'
|
|
38
|
+
};
|
|
39
|
+
/** `mod+s` -> `⌘S` on a Mac, `Ctrl+S` elsewhere. */
|
|
40
|
+
export function formatKeys(keys, mac = isMac()) {
|
|
41
|
+
const parsed = parseKeys(keys);
|
|
42
|
+
const parts = [];
|
|
43
|
+
if (parsed.mod)
|
|
44
|
+
parts.push(mac ? '⌘' : 'Ctrl');
|
|
45
|
+
if (parsed.alt)
|
|
46
|
+
parts.push(mac ? '⌥' : 'Alt');
|
|
47
|
+
if (parsed.shift)
|
|
48
|
+
parts.push(mac ? '⇧' : 'Shift');
|
|
49
|
+
parts.push(KEY_LABELS[parsed.key] ?? parsed.key.toUpperCase());
|
|
50
|
+
return parts.join(mac ? '' : '+');
|
|
51
|
+
}
|
|
52
|
+
/** The keyboard is a field's: an input, a textarea, a select, a contenteditable, an editor. */
|
|
53
|
+
export function isTyping(event) {
|
|
54
|
+
const target = event.composedPath()[0];
|
|
55
|
+
if (!(target instanceof HTMLElement))
|
|
56
|
+
return false;
|
|
57
|
+
if (target instanceof HTMLInputElement ||
|
|
58
|
+
target instanceof HTMLTextAreaElement ||
|
|
59
|
+
target instanceof HTMLSelectElement) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return target.isContentEditable || !!target.closest('.ProseMirror');
|
|
63
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relations and resource links resolved at depth 1, the shape the API answers with.
|
|
3
|
+
* A resolved document is returned as is; a relation that cannot be fetched stays a reference.
|
|
4
|
+
*/
|
|
5
|
+
export declare function populate<T>(value: T): Promise<T>;
|
|
6
|
+
export declare namespace populate {
|
|
7
|
+
var clear: () => void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { API_PREFIX } from '../../core/routes/constants.js';
|
|
2
|
+
import { isObjectLiteral } from '../../util/object.js';
|
|
3
|
+
import { toKebabCase } from '../../util/string.js';
|
|
4
|
+
const cache = new Map();
|
|
5
|
+
/** One request per document for the page's life. */
|
|
6
|
+
function fetchDoc(slug, id) {
|
|
7
|
+
const key = `${slug}/${id}`;
|
|
8
|
+
if (!cache.has(key)) {
|
|
9
|
+
const url = `${API_PREFIX}/${toKebabCase(slug)}/${id}?depth=1`;
|
|
10
|
+
cache.set(key, fetch(url)
|
|
11
|
+
.then((response) => response.json())
|
|
12
|
+
.then((response) => response?.doc ?? null)
|
|
13
|
+
.catch((error) => {
|
|
14
|
+
console.error(error);
|
|
15
|
+
return null;
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
return cache.get(key);
|
|
19
|
+
}
|
|
20
|
+
const isLink = (value) => 'value' in value &&
|
|
21
|
+
'target' in value &&
|
|
22
|
+
'type' in value &&
|
|
23
|
+
!['url', 'email', 'tel', 'anchor'].includes(value.type);
|
|
24
|
+
const isRelation = (value) => 'documentId' in value && 'relationTo' in value;
|
|
25
|
+
/**
|
|
26
|
+
* Relations and resource links resolved at depth 1, the shape the API answers with.
|
|
27
|
+
* A resolved document is returned as is; a relation that cannot be fetched stays a reference.
|
|
28
|
+
*/
|
|
29
|
+
export async function populate(value) {
|
|
30
|
+
if (Array.isArray(value)) {
|
|
31
|
+
return Promise.all(value.map((item) => populate(item)));
|
|
32
|
+
}
|
|
33
|
+
if (!isObjectLiteral(value))
|
|
34
|
+
return value;
|
|
35
|
+
if (isLink(value)) {
|
|
36
|
+
if (!value.type || !value.value)
|
|
37
|
+
return value;
|
|
38
|
+
const doc = await fetchDoc(value.type, value.value);
|
|
39
|
+
return doc?.url ? { ...value, url: doc.url } : value;
|
|
40
|
+
}
|
|
41
|
+
if (isRelation(value)) {
|
|
42
|
+
if ('livePreview' in value)
|
|
43
|
+
return value.livePreview;
|
|
44
|
+
return ((await fetchDoc(value.relationTo, value.documentId)) ?? value);
|
|
45
|
+
}
|
|
46
|
+
const entries = await Promise.all(Object.entries(value).map(async ([key, item]) => [key, await populate(item)]));
|
|
47
|
+
return Object.fromEntries(entries);
|
|
48
|
+
}
|
|
49
|
+
populate.clear = () => cache.clear();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Translate } from '../../core/i18n/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* How long ago a date was, short: relative within a week, the date after.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* formatWhen(twoHoursAgo, now, 'en') // '2 h ago'
|
|
7
|
+
* formatWhen(yesterday, now, 'en') // 'Yesterday'
|
|
8
|
+
* formatWhen(lastMonth, now, 'en') // 'Aug 12'
|
|
9
|
+
* formatWhen(lastYear, now, 'en') // 'Aug 12, 2025'
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatWhen(date: Date | string, now: Date, lang: string, t?: Translate): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t__ } from '../../core/i18n/index.js';
|
|
2
|
+
const MINUTE = 60;
|
|
3
|
+
const HOUR = 60 * MINUTE;
|
|
4
|
+
const DAY = 24 * HOUR;
|
|
5
|
+
const WEEK = 7 * DAY;
|
|
6
|
+
/**
|
|
7
|
+
* How long ago a date was, short: relative within a week, the date after.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* formatWhen(twoHoursAgo, now, 'en') // '2 h ago'
|
|
11
|
+
* formatWhen(yesterday, now, 'en') // 'Yesterday'
|
|
12
|
+
* formatWhen(lastMonth, now, 'en') // 'Aug 12'
|
|
13
|
+
* formatWhen(lastYear, now, 'en') // 'Aug 12, 2025'
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export function formatWhen(date, now, lang, t = t__) {
|
|
17
|
+
const then = new Date(date);
|
|
18
|
+
const seconds = Math.max(0, (now.getTime() - then.getTime()) / 1000);
|
|
19
|
+
if (seconds < MINUTE)
|
|
20
|
+
return t('common.time_now');
|
|
21
|
+
if (seconds < HOUR)
|
|
22
|
+
return t('common.time_minutes_ago', String(Math.floor(seconds / MINUTE)));
|
|
23
|
+
if (seconds < DAY)
|
|
24
|
+
return t('common.time_hours_ago', String(Math.floor(seconds / HOUR)));
|
|
25
|
+
if (seconds < 2 * DAY)
|
|
26
|
+
return t('common.time_yesterday');
|
|
27
|
+
if (seconds < WEEK)
|
|
28
|
+
return t('common.time_days_ago', String(Math.floor(seconds / DAY)));
|
|
29
|
+
const sameYear = then.getFullYear() === now.getFullYear();
|
|
30
|
+
return new Intl.DateTimeFormat(lang, {
|
|
31
|
+
day: 'numeric',
|
|
32
|
+
month: 'short',
|
|
33
|
+
year: sameYear ? undefined : 'numeric'
|
|
34
|
+
}).format(then);
|
|
35
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { UploadDoc } from '../../core/prototype/collection/upload/types.js';
|
|
2
|
+
/** Where files go: the collection's API url, the folder, and the mime types it takes. */
|
|
3
|
+
export type UploadTarget = {
|
|
4
|
+
url: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
accept?: string[];
|
|
7
|
+
};
|
|
8
|
+
/** How a batch goes, after each file. */
|
|
9
|
+
export type UploadProgress = {
|
|
10
|
+
total: number;
|
|
11
|
+
uploaded: number;
|
|
12
|
+
/** The names of the files that did not make it. */
|
|
13
|
+
failed: string[];
|
|
14
|
+
/** The name of the file on its way, `null` once the last one is done. */
|
|
15
|
+
current: string | null;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Whether the collection takes this file. No `accept` takes anything.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* isAccepted(photo, ['image/jpeg', 'image/png']) // true for a .jpg
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const isAccepted: (file: Pick<File, "type">, accept?: string[]) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A mime type as people read it.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* typeLabel('image/jpeg') // 'JPG'
|
|
30
|
+
* typeLabel('application/pdf') // 'PDF'
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const typeLabel: (mimeType?: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* A file size in bytes, from a count of bytes or a stored size.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* fileSizeBytes('3.20MB') // 3200000
|
|
39
|
+
* fileSizeBytes('0.84KB') // 840
|
|
40
|
+
* fileSizeBytes(840) // 840
|
|
41
|
+
* fileSizeBytes('') // null
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const fileSizeBytes: (size?: string | number | null) => number | null;
|
|
45
|
+
/**
|
|
46
|
+
* A file size as people read it: whole kilobytes, then one decimal from a megabyte up.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* fileSizeLabel('3.20MB') // '3.2 MB'
|
|
50
|
+
* fileSizeLabel('840.12KB') // '840 KB'
|
|
51
|
+
* fileSizeLabel(1_240_000_000) // '1.2 GB'
|
|
52
|
+
* fileSizeLabel(512) // '512 B'
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const fileSizeLabel: (size?: string | number | null) => string;
|
|
56
|
+
/**
|
|
57
|
+
* A media's size and type, for the line under its name.
|
|
58
|
+
*
|
|
59
|
+
* ```ts
|
|
60
|
+
* mediaMeta({ filesize: '3.20MB', mimeType: 'image/jpeg' }) // '3.2 MB · JPG'
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const mediaMeta: (doc: {
|
|
64
|
+
filesize?: string | number | null;
|
|
65
|
+
mimeType?: string | null;
|
|
66
|
+
}) => string;
|
|
67
|
+
export declare const MEDIA_KINDS: readonly ["image", "video", "audio", "document", "other"];
|
|
68
|
+
export type MediaKind = (typeof MEDIA_KINDS)[number];
|
|
69
|
+
/**
|
|
70
|
+
* The kind of file a mime type is, to filter medias by.
|
|
71
|
+
*
|
|
72
|
+
* ```ts
|
|
73
|
+
* mediaKind('image/webp') // 'image'
|
|
74
|
+
* mediaKind('application/pdf') // 'document'
|
|
75
|
+
* mediaKind('application/zip') // 'other'
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const mediaKind: (mimeType?: string | null) => MediaKind;
|
|
79
|
+
/**
|
|
80
|
+
* The accepted types as a sentence.
|
|
81
|
+
*
|
|
82
|
+
* ```ts
|
|
83
|
+
* acceptLabel(['image/jpeg', 'image/png', 'image/webp'], 'or') // 'JPG, PNG or WEBP'
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare const acceptLabel: (accept: string[], or: string) => string;
|
|
87
|
+
/**
|
|
88
|
+
* Creates one document of an upload collection from a file, and answers it.
|
|
89
|
+
* Validation is skipped, so a required field the file cannot fill, like an `alt`, never blocks it.
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* const doc = await uploadFile(file, { url: '/api/medias', path: 'root:press' });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function uploadFile(file: File, target: UploadTarget): Promise<UploadDoc>;
|
|
96
|
+
/**
|
|
97
|
+
* Uploads files one after the other. A file that fails is counted and skipped.
|
|
98
|
+
*
|
|
99
|
+
* ```ts
|
|
100
|
+
* const { docs, failed } = await uploadFiles(files, target, (progress) => (state = progress));
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function uploadFiles(files: File[], target: UploadTarget, onProgress?: (progress: UploadProgress) => void): Promise<{
|
|
104
|
+
docs: UploadDoc[];
|
|
105
|
+
failed: string[];
|
|
106
|
+
}>;
|