rimecms 0.33.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-sqlite/auth.server.d.ts +2 -2
- package/dist/adapter-sqlite/columns.server.js +2 -2
- package/dist/adapter-sqlite/connect.server.d.ts +12 -0
- package/dist/adapter-sqlite/connect.server.js +31 -0
- package/dist/adapter-sqlite/generate-schema/index.server.js +11 -3
- package/dist/adapter-sqlite/generate-schema/root.server.d.ts +13 -4
- package/dist/adapter-sqlite/generate-schema/root.server.js +75 -131
- package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +36 -15
- package/dist/adapter-sqlite/generate-schema/templates.server.js +60 -18
- package/dist/adapter-sqlite/index.server.d.ts +13 -5
- package/dist/adapter-sqlite/index.server.js +9 -6
- package/dist/adapter-sqlite/naming.server.d.ts +6 -8
- package/dist/adapter-sqlite/naming.server.js +22 -4
- package/dist/adapter-sqlite/paths.server.d.ts +10 -0
- package/dist/adapter-sqlite/paths.server.js +131 -0
- package/dist/adapter-sqlite/read.server.d.ts +10 -1
- package/dist/adapter-sqlite/read.server.js +22 -10
- package/dist/adapter-sqlite/rows.server.d.ts +1 -1
- package/dist/adapter-sqlite/select.server.d.ts +19 -0
- package/dist/adapter-sqlite/select.server.js +71 -63
- package/dist/adapter-sqlite/table.server.d.ts +2 -2
- package/dist/adapter-sqlite/transform.server.js +33 -3
- package/dist/adapter-sqlite/types.server.d.ts +10 -3
- package/dist/adapter-sqlite/where.server.d.ts +2 -3
- package/dist/adapter-sqlite/where.server.js +19 -1
- package/dist/core/adapter.d.ts +98 -0
- package/dist/core/auth/better-auth/config.server.d.ts +3 -3
- package/dist/core/auth/better-auth/instance.server.d.ts +6 -6
- package/dist/core/auth/handler/index.server.js +1 -1
- package/dist/core/auth/staff/derive.js +1 -1
- package/dist/core/auth/validate-config.js +3 -5
- package/dist/core/boot.server.d.ts +8 -8
- package/dist/core/config/context.server.d.ts +2 -2
- package/dist/core/config/types.d.ts +43 -5
- package/dist/core/config/validate.server.js +34 -51
- package/dist/core/dev/cli/commands/build.js +21 -6
- package/dist/core/dev/cli/commands/init.server.d.ts +2 -1
- package/dist/core/dev/cli/commands/init.server.js +32 -6
- package/dist/core/dev/cli/index.js +1 -0
- package/dist/core/dev/cli/templates/init.d.ts +6 -1
- package/dist/core/dev/cli/templates/init.js +30 -2
- package/dist/core/dev/cli/util/package-manager.server.d.ts +1 -0
- package/dist/core/dev/cli/util/package-manager.server.js +11 -8
- package/dist/core/dev/cli/util/package.server.d.ts +9 -0
- package/dist/core/dev/cli/util/package.server.js +43 -0
- package/dist/core/dev/codegen/routes/common.server.d.ts +2 -0
- package/dist/core/dev/codegen/routes/common.server.js +7 -3
- package/dist/core/dev/codegen/routes/util.server.d.ts +2 -1
- package/dist/core/dev/codegen/routes/util.server.js +4 -1
- package/dist/core/dev/codegen/types/contributions.server.d.ts +3 -2
- package/dist/core/dev/codegen/types/contributions.server.js +10 -3
- package/dist/core/dev/config-memo.server.js +4 -0
- package/dist/core/dev/vite.server.js +4 -3
- package/dist/core/fields/blank.d.ts +21 -0
- package/dist/core/fields/blank.js +37 -0
- package/dist/core/fields/builders/field-builder.d.ts +53 -0
- package/dist/core/fields/builders/field-builder.js +14 -1
- package/dist/core/fields/builders/form-field-builder.d.ts +8 -0
- package/dist/core/fields/builders/form-field-builder.js +14 -1
- package/dist/core/fields/util.d.ts +9 -2
- package/dist/core/fields/util.js +123 -135
- package/dist/core/fields/walk.d.ts +44 -0
- package/dist/core/fields/walk.js +55 -0
- package/dist/core/handler.server.js +4 -0
- package/dist/core/i18n/context.d.ts +5 -0
- package/dist/core/i18n/context.js +6 -0
- package/dist/core/i18n/en/common.d.ts +71 -0
- package/dist/core/i18n/en/common.js +72 -1
- package/dist/core/i18n/en/fields.d.ts +68 -0
- package/dist/core/i18n/en/fields.js +69 -1
- package/dist/core/i18n/fr/common.d.ts +71 -0
- package/dist/core/i18n/fr/common.js +72 -1
- package/dist/core/i18n/fr/fields.d.ts +68 -0
- package/dist/core/i18n/fr/fields.js +69 -1
- package/dist/core/i18n/index.d.ts +29 -3
- package/dist/core/i18n/index.js +55 -29
- package/dist/core/locale/copy.server.js +3 -3
- package/dist/core/logger.server.js +15 -6
- package/dist/core/pipeline/build-document.server.d.ts +3 -0
- package/dist/core/pipeline/build-document.server.js +10 -7
- package/dist/core/pipeline/config-map/index.d.ts +9 -0
- package/dist/core/pipeline/config-map/index.js +16 -50
- package/dist/core/pipeline/hooks/process-document-fields.server.d.ts +3 -0
- package/dist/core/pipeline/hooks/process-document-fields.server.js +48 -12
- package/dist/core/pipeline/hooks/set-default-values.server.d.ts +1 -0
- package/dist/core/pipeline/hooks/set-default-values.server.js +1 -0
- package/dist/core/pipeline/persist/blocks/extract.server.js +1 -1
- package/dist/core/pipeline/persist/relations/extract.server.js +2 -0
- package/dist/core/pipeline/populate-relations.server.d.ts +27 -0
- package/dist/core/pipeline/populate-relations.server.js +42 -0
- package/dist/core/pipeline/run.server.d.ts +17 -6
- package/dist/core/pipeline/run.server.js +44 -30
- package/dist/core/plugins/cache/module.server.d.ts +1 -1
- package/dist/core/plugins/cache/module.server.js +5 -5
- package/dist/core/prototype/area/api.server.js +1 -2
- package/dist/core/prototype/area/definition.js +1 -10
- package/dist/core/prototype/area/definition.server.js +4 -5
- package/dist/core/prototype/area/hooks.server.js +3 -2
- package/dist/core/prototype/area/operations/find.js +2 -0
- package/dist/core/prototype/blank.d.ts +26 -0
- package/dist/core/prototype/blank.js +22 -0
- package/dist/core/prototype/collection/api.server.d.ts +29 -3
- package/dist/core/prototype/collection/api.server.js +47 -4
- package/dist/core/prototype/collection/definition.js +0 -3
- package/dist/core/prototype/collection/hooks/merge-with-blank.server.d.ts +5 -1
- package/dist/core/prototype/collection/hooks/merge-with-blank.server.js +8 -22
- package/dist/core/prototype/collection/hooks.server.js +11 -5
- package/dist/core/prototype/collection/nested/module.server.js +3 -1
- package/dist/core/prototype/collection/nested/tree.d.ts +12 -0
- package/dist/core/prototype/collection/nested/tree.js +42 -0
- package/dist/core/prototype/collection/operations/duplicate.js +1 -1
- package/dist/core/prototype/collection/operations/find-by-id.js +2 -0
- package/dist/core/prototype/collection/operations/find-by-ids.d.ts +19 -0
- package/dist/core/prototype/collection/operations/find-by-ids.js +54 -0
- package/dist/core/prototype/collection/operations/find.js +21 -27
- package/dist/core/prototype/collection/operations/update-slug-by-id.d.ts +20 -0
- package/dist/core/prototype/collection/operations/update-slug-by-id.js +53 -0
- package/dist/core/prototype/collection/rest/index.server.js +3 -1
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.d.ts +2 -0
- package/dist/core/prototype/collection/rest/update-slug-by-id.server.js +20 -0
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.d.ts +2 -1
- package/dist/core/prototype/collection/thumbnail/find-thumbnail.js +4 -27
- package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +1 -1
- package/dist/core/prototype/collection/upload/directories/derive.js +3 -1
- package/dist/core/prototype/collection/upload/disk/delete.server.js +1 -2
- package/dist/core/prototype/define.js +2 -0
- package/dist/core/prototype/shared/metas/fields.js +2 -1
- package/dist/core/prototype/shared/title/find-title.d.ts +2 -1
- package/dist/core/prototype/shared/title/find-title.js +5 -28
- package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +1 -1
- package/dist/core/prototype/shared/url/addresses.server.d.ts +36 -0
- package/dist/core/prototype/shared/url/addresses.server.js +119 -0
- package/dist/core/prototype/shared/url/doc-type.d.ts +6 -0
- package/dist/core/prototype/shared/url/doc-type.js +9 -0
- package/dist/core/prototype/shared/url/format.server.d.ts +27 -0
- package/dist/core/prototype/shared/url/format.server.js +38 -0
- package/dist/core/prototype/shared/url/hooks/create-paths.server.d.ts +2 -0
- package/dist/core/prototype/shared/url/hooks/create-paths.server.js +9 -0
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.d.ts +6 -0
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.js +19 -0
- package/dist/core/prototype/shared/url/hooks/index.server.d.ts +5 -1
- package/dist/core/prototype/shared/url/hooks/index.server.js +5 -1
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.d.ts +2 -0
- package/dist/core/prototype/shared/url/hooks/set-area-url.server.js +8 -0
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.d.ts +5 -0
- package/dist/core/prototype/shared/url/hooks/set-live-url.server.js +19 -0
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.d.ts +8 -0
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.js +38 -0
- package/dist/core/prototype/shared/url/refresh.server.d.ts +36 -0
- package/dist/core/prototype/shared/url/refresh.server.js +58 -0
- package/dist/core/prototype/shared/versions/configure.server.js +3 -0
- package/dist/core/routes/context.server.d.ts +2 -1
- package/dist/fields/blocks/component/AddBlockButton.svelte +48 -137
- package/dist/fields/blocks/component/Block.svelte +153 -117
- package/dist/fields/blocks/component/Block.svelte.d.ts +11 -5
- package/dist/fields/blocks/component/BlockActions.svelte +76 -26
- package/dist/fields/blocks/component/BlockActions.svelte.d.ts +3 -0
- package/dist/fields/blocks/component/Blocks.svelte +248 -91
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +680 -0
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte.d.ts +7 -0
- package/dist/fields/blocks/component/focus/Layers.svelte +145 -0
- package/dist/fields/blocks/component/focus/Layers.svelte.d.ts +9 -0
- package/dist/fields/blocks/component/focus/LayersList.svelte +304 -0
- package/dist/fields/blocks/component/focus/LayersList.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/focus/Palette.svelte +135 -0
- package/dist/fields/blocks/component/focus/Palette.svelte.d.ts +9 -0
- package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte +77 -0
- package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/focus/Renders.svelte +302 -0
- package/dist/fields/blocks/component/focus/Renders.svelte.d.ts +11 -0
- package/dist/fields/blocks/component/focus/Stage.svelte +190 -0
- package/dist/fields/blocks/component/focus/Stage.svelte.d.ts +8 -0
- package/dist/fields/blocks/component/focus/StagePlaceholder.svelte +69 -0
- package/dist/fields/blocks/component/focus/StagePlaceholder.svelte.d.ts +3 -0
- package/dist/fields/blocks/component/focus/focus.svelte.d.ts +140 -0
- package/dist/fields/blocks/component/focus/focus.svelte.js +424 -0
- package/dist/fields/blocks/component/picker/BlockPicker.svelte +88 -0
- package/dist/fields/blocks/component/picker/BlockPicker.svelte.d.ts +10 -0
- package/dist/fields/blocks/component/picker/BlockTile.svelte +121 -0
- package/dist/fields/blocks/component/picker/BlockTile.svelte.d.ts +12 -0
- package/dist/fields/blocks/index.d.ts +49 -7
- package/dist/fields/blocks/index.js +61 -12
- package/dist/fields/checkbox/component/Checkbox.svelte +11 -37
- package/dist/fields/checkbox/component/Checkbox.svelte.d.ts +1 -0
- package/dist/fields/combobox/component/ComboBox.svelte +37 -7
- package/dist/fields/combobox/component/combobox.css +26 -10
- package/dist/fields/date/component/Date.svelte +43 -12
- package/dist/fields/group/component/Group.svelte +110 -41
- package/dist/fields/group/index.d.ts +5 -1
- package/dist/fields/group/index.js +10 -2
- package/dist/fields/link/component/Link.svelte +184 -143
- package/dist/fields/link/component/RessourceInput.svelte +26 -24
- package/dist/fields/link/index.d.ts +2 -1
- package/dist/fields/link/module.server.js +2 -4
- package/dist/fields/number/component/Number.svelte +38 -20
- package/dist/fields/number/component/number.css +22 -20
- package/dist/fields/number/index.d.ts +1 -0
- package/dist/fields/radio/component/Radio.svelte +12 -0
- package/dist/fields/radio/index.js +1 -1
- package/dist/fields/relation/component/Relation.svelte +169 -40
- package/dist/fields/relation/component/RelationInline.svelte +258 -0
- package/dist/fields/relation/component/RelationInline.svelte.d.ts +26 -0
- package/dist/fields/relation/component/default/Default.svelte +210 -100
- package/dist/fields/relation/component/default/Default.svelte.d.ts +14 -1
- package/dist/fields/relation/component/types.d.ts +4 -0
- package/dist/fields/relation/component/upload/Browse.svelte +619 -88
- package/dist/fields/relation/component/upload/Browse.svelte.d.ts +10 -2
- package/dist/fields/relation/component/upload/Create.svelte +41 -0
- package/dist/fields/relation/component/upload/Create.svelte.d.ts +13 -0
- package/dist/fields/relation/component/upload/Upload.svelte +287 -101
- package/dist/fields/relation/component/upload/Upload.svelte.d.ts +6 -1
- package/dist/fields/relation/component/upload/upload.css +5 -81
- package/dist/fields/relation/index.d.ts +1 -41
- package/dist/fields/relation/index.js +0 -67
- package/dist/fields/relation/module.server.js +7 -1
- package/dist/fields/relation/populate.d.ts +8 -0
- package/dist/fields/relation/populate.js +49 -0
- package/dist/fields/relation/util.d.ts +69 -0
- package/dist/fields/relation/util.js +103 -0
- package/dist/fields/relation/value.d.ts +25 -0
- package/dist/fields/relation/value.js +27 -0
- package/dist/fields/rich-text/client.d.ts +2 -5
- package/dist/fields/rich-text/client.js +1 -3
- package/dist/fields/rich-text/component/Cell.svelte +1 -1
- package/dist/fields/rich-text/component/RichText.svelte +12 -80
- package/dist/fields/rich-text/component/RichText.svelte.d.ts +1 -1
- package/dist/fields/rich-text/component/RichTextInline.svelte +28 -0
- package/dist/fields/rich-text/component/RichTextInline.svelte.d.ts +11 -0
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.css +4 -3
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +3 -1
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.css +2 -2
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +7 -10
- package/dist/fields/rich-text/component/drag-handle/drag-handle.css +0 -2
- package/dist/fields/rich-text/component/styles/editor.css +111 -0
- package/dist/fields/rich-text/component/styles/field.css +71 -0
- package/dist/fields/rich-text/component/suggestion/suggestion.svelte +41 -56
- package/dist/fields/rich-text/core/build-editor-config.js +1 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.js +29 -3
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.d.ts +1 -0
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +2 -1
- package/dist/fields/rich-text/core/features/fields/fields.css +2 -3
- package/dist/fields/rich-text/core/features/hr/hr.css +4 -4
- package/dist/fields/rich-text/core/features/link/component/link-selector.css +0 -4
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +24 -8
- package/dist/fields/rich-text/core/features/resource/resource-extension.js +3 -3
- package/dist/fields/rich-text/core/features/resource/resource.svelte +21 -7
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +3 -4
- package/dist/fields/rich-text/core/features/upload/upload.svelte +21 -9
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte +103 -0
- package/dist/fields/rich-text/core/rich-text-editor-core.svelte.d.ts +15 -0
- package/dist/fields/rich-text/index.d.ts +0 -17
- package/dist/fields/rich-text/index.js +0 -44
- package/dist/fields/rich-text/json.d.ts +18 -0
- package/dist/fields/rich-text/json.js +44 -0
- package/dist/fields/select/component/Select.svelte +67 -28
- package/dist/fields/slug/component/Slug.svelte +26 -53
- package/dist/fields/slug/index.d.ts +1 -0
- package/dist/fields/slug/index.js +1 -1
- package/dist/fields/tabs/component/Tabs.svelte +28 -22
- package/dist/fields/tabs/index.d.ts +4 -1
- package/dist/fields/tabs/index.js +17 -5
- package/dist/fields/text/index.d.ts +1 -0
- package/dist/fields/textarea/component/TextArea.svelte +28 -13
- package/dist/fields/textarea/index.d.ts +1 -0
- package/dist/fields/time/component/Time.svelte +9 -2
- package/dist/fields/toggle/component/Toggle.svelte +8 -25
- package/dist/fields/toggle/component/Toggle.svelte.d.ts +1 -0
- package/dist/fields/toggle/index.d.ts +1 -0
- package/dist/fields/tree/component/AddItemButton.svelte +18 -5
- package/dist/fields/tree/component/Tree.svelte +48 -19
- package/dist/fields/tree/component/TreeBlock.svelte +318 -104
- package/dist/fields/tree/component/TreeBlockActions.svelte +71 -7
- package/dist/fields/tree/component/TreeBlockActions.svelte.d.ts +4 -0
- package/dist/fields/tree/component/props.d.ts +2 -1
- package/dist/fields/tree/index.d.ts +13 -1
- package/dist/fields/tree/index.js +35 -9
- package/dist/fields/types.d.ts +3 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -6
- package/dist/{panel/components/sections/live → live}/Consumer.svelte +2 -2
- package/dist/{panel/components/sections/live → live}/Consumer.svelte.d.ts +1 -1
- package/dist/{panel/components/sections/live → live}/LiveEdit.svelte +3 -3
- package/dist/{panel/components/sections/live → live}/Provider.svelte +1 -1
- package/dist/{panel/context/live.svelte.d.ts → live/context.svelte.d.ts} +1 -1
- package/dist/{panel/context/live.svelte.js → live/context.svelte.js} +3 -74
- package/dist/panel/components/Root.svelte +16 -44
- package/dist/panel/components/Root.svelte.d.ts +1 -1
- package/dist/panel/components/fields/Error.svelte +18 -3
- package/dist/panel/components/fields/FieldsPreview.svelte +30 -17
- package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +25 -3
- package/dist/panel/components/fields/Hint.svelte +51 -8
- package/dist/panel/components/fields/Hint.svelte.d.ts +11 -0
- package/dist/panel/components/fields/Label.svelte +2 -0
- package/dist/panel/components/fields/LabelFor.svelte +7 -2
- package/dist/panel/components/fields/RenderFields.svelte +10 -3
- package/dist/panel/components/fields/fieldset.svelte.d.ts +4 -1
- package/dist/panel/components/fields/fieldset.svelte.js +9 -2
- package/dist/panel/components/fields/index.d.ts +1 -0
- package/dist/panel/components/fields/setting.css +82 -0
- package/dist/panel/components/sections/auth/AuthForm.svelte +25 -26
- package/dist/panel/components/sections/collection/Avatar.svelte +61 -0
- package/dist/panel/components/sections/collection/Avatar.svelte.d.ts +9 -0
- package/dist/panel/components/sections/collection/DocStatus.svelte +28 -0
- package/dist/panel/components/sections/collection/DocStatus.svelte.d.ts +7 -0
- package/dist/panel/components/sections/collection/Empty.svelte +3 -3
- package/dist/panel/components/sections/collection/StatusDot.svelte +7 -5
- package/dist/panel/components/sections/collection/When.svelte +33 -0
- package/dist/panel/components/sections/collection/When.svelte.d.ts +8 -0
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte +65 -21
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte.d.ts +3 -2
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte +45 -162
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte.d.ts +3 -2
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte +151 -0
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte.d.ts +17 -0
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +177 -0
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte.d.ts +12 -0
- package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte +75 -0
- package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte.d.ts +8 -0
- package/dist/panel/components/sections/collection/folder/Folder.svelte +18 -3
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +26 -18
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +98 -58
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte.d.ts +0 -1
- package/dist/panel/components/sections/collection/folder/Folders.svelte +60 -0
- package/dist/panel/components/sections/collection/folder/Folders.svelte.d.ts +7 -0
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +31 -71
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte.d.ts +1 -0
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +5 -3
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +250 -37
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte.d.ts +2 -0
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +43 -18
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +6 -4
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte +69 -58
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte.d.ts +0 -1
- package/dist/panel/components/sections/collection/header/FilterMenu.svelte +60 -0
- package/dist/panel/components/sections/collection/header/FilterMenu.svelte.d.ts +14 -0
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +17 -26
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +19 -34
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +99 -68
- package/dist/panel/components/sections/collection/list/columns.d.ts +21 -0
- package/dist/panel/components/sections/collection/list/columns.js +23 -0
- package/dist/panel/components/sections/collection/list/header/Header.svelte +99 -51
- package/dist/panel/components/sections/collection/list/row/Row.svelte +165 -82
- package/dist/panel/components/sections/collection/list/row/Row.svelte.d.ts +4 -0
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +92 -44
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte.d.ts +1 -0
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +139 -43
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte.d.ts +2 -0
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +1 -1
- package/dist/panel/components/sections/commands/CommandButton.svelte +99 -0
- package/dist/panel/components/sections/commands/CommandButton.svelte.d.ts +10 -0
- package/dist/panel/components/sections/commands/CommandPalette.svelte +275 -0
- package/dist/panel/components/sections/commands/CommandPalette.svelte.d.ts +8 -0
- package/dist/panel/components/sections/commands/Commands.svelte +18 -0
- package/dist/panel/components/sections/commands/Commands.svelte.d.ts +9 -0
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +23 -7
- package/dist/panel/components/sections/document/AuthFooter.svelte +31 -12
- package/dist/panel/components/sections/document/AutoSaveBanner.svelte +24 -7
- package/dist/panel/components/sections/document/ButtonSave.svelte +32 -21
- package/dist/panel/components/sections/document/ButtonSave.svelte.d.ts +5 -5
- package/dist/panel/components/sections/document/ButtonStatus.svelte +68 -20
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +199 -0
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte.d.ts +10 -0
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte +2 -2
- package/dist/panel/components/sections/document/Document.svelte +96 -65
- package/dist/panel/components/sections/document/DocumentChildren.svelte +175 -0
- package/dist/panel/components/sections/document/DocumentChildren.svelte.d.ts +8 -0
- package/dist/panel/components/sections/document/DocumentUrl.svelte +119 -0
- package/dist/panel/components/sections/document/DocumentUrl.svelte.d.ts +9 -0
- package/dist/panel/components/sections/document/Header.svelte +171 -94
- package/dist/panel/components/sections/document/Settings.svelte +255 -110
- package/dist/panel/components/sections/document/Settings.svelte.d.ts +0 -1
- package/dist/panel/components/sections/document/Versions.svelte +5 -3
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +112 -53
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte.d.ts +2 -2
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +74 -41
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte +30 -11
- package/dist/panel/components/sections/live/live-edit-panel.css +2 -2
- package/dist/panel/components/sections/page-layout/Page.svelte +13 -1
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +55 -27
- package/dist/panel/components/ui/button/button.svelte +81 -54
- package/dist/panel/components/ui/button/index.d.ts +7 -3
- package/dist/panel/components/ui/button/index.js +2 -2
- package/dist/panel/components/ui/calendar/calendar.css +27 -27
- package/dist/panel/components/ui/card/card-description.svelte +1 -1
- package/dist/panel/components/ui/card/card.svelte +21 -4
- package/dist/panel/components/ui/card-document/card-document.svelte +24 -12
- package/dist/panel/components/ui/card-resource/card-resource.svelte +26 -8
- package/dist/panel/components/ui/checkbox/checkbox.css +8 -10
- package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/panel/components/ui/command/command-dialog.css +28 -4
- package/dist/panel/components/ui/command/command-dialog.svelte +4 -1
- package/dist/panel/components/ui/command/command-dialog.svelte.d.ts +2 -0
- package/dist/panel/components/ui/command/command-empty.css +1 -1
- package/dist/panel/components/ui/command/command-group.css +3 -3
- package/dist/panel/components/ui/command/command-input-select.svelte +3 -3
- package/dist/panel/components/ui/command/command-input.svelte +38 -14
- package/dist/panel/components/ui/command/command-input.svelte.d.ts +6 -1
- package/dist/panel/components/ui/command/command-item.css +2 -2
- package/dist/panel/components/ui/command/command-list.css +1 -1
- package/dist/panel/components/ui/command/command-separator.css +1 -1
- package/dist/panel/components/ui/context-menu/context-menu-item.css +2 -2
- package/dist/panel/components/ui/context-menu/context-menu.css +6 -7
- package/dist/panel/components/ui/dialog/dialog-content.css +8 -10
- package/dist/panel/components/ui/dialog/dialog-content.svelte +19 -0
- package/dist/panel/components/ui/dialog/dialog-description.css +1 -1
- package/dist/panel/components/ui/dialog/dialog-footer.svelte +5 -1
- package/dist/panel/components/ui/dialog/dialog-overlay.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +19 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +6 -4
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-separator.css +1 -1
- package/dist/panel/components/ui/input/input.svelte +57 -31
- package/dist/panel/components/ui/kbd/Kbd.svelte +90 -0
- package/dist/panel/components/ui/kbd/Kbd.svelte.d.ts +11 -0
- package/dist/panel/components/ui/kbd/index.d.ts +1 -0
- package/dist/panel/components/ui/kbd/index.js +1 -0
- package/dist/panel/components/ui/label/label.css +5 -3
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +27 -15
- package/dist/panel/components/ui/nav/Nav.svelte +180 -110
- package/dist/panel/components/ui/nav/Nav.svelte.d.ts +0 -2
- package/dist/panel/components/ui/nav/NavGroup.svelte +87 -73
- package/dist/panel/components/ui/nav/NavItemButton.svelte +69 -29
- package/dist/panel/components/ui/nav/UserButton.svelte +132 -71
- package/dist/panel/components/ui/page-header/PageHeader.svelte +140 -42
- package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +8 -1
- package/dist/panel/components/ui/popover/popover-content.css +4 -3
- package/dist/panel/components/ui/radio-group/radio-group.css +4 -6
- package/dist/panel/components/ui/radio-row-group/radio-row-group.css +19 -7
- package/dist/panel/components/ui/scroll-area/scroll-area.css +2 -2
- package/dist/panel/components/ui/separator/separator.svelte +1 -1
- package/dist/panel/components/ui/sheet/index.d.ts +4 -4
- package/dist/panel/components/ui/sheet/index.js +5 -5
- package/dist/panel/components/ui/sheet/sheet.css +50 -11
- package/dist/panel/components/ui/sonner/sonner.css +11 -8
- package/dist/panel/components/ui/switch/switch.css +13 -18
- package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
- package/dist/panel/components/ui/tabs/tabs.css +44 -35
- package/dist/panel/components/ui/tag/tag.svelte +20 -6
- package/dist/panel/components/ui/tooltip/tooltip-content.svelte +14 -4
- package/dist/panel/components/ui/tree/tree-rows.css +146 -0
- package/dist/panel/context/blocks-ops.d.ts +78 -0
- package/dist/panel/context/blocks-ops.js +170 -0
- package/dist/panel/context/collection.svelte.d.ts +28 -0
- package/dist/panel/context/collection.svelte.js +120 -65
- package/dist/panel/context/commands.svelte.d.ts +80 -0
- package/dist/panel/context/commands.svelte.js +108 -0
- package/dist/panel/context/config.svelte.d.ts +2 -2
- package/dist/panel/context/documentForm.svelte.d.ts +34 -2
- package/dist/panel/context/documentForm.svelte.js +106 -103
- package/dist/panel/context/nav.svelte.d.ts +23 -0
- package/dist/panel/context/nav.svelte.js +56 -0
- package/dist/panel/fonts/Geist-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/GeistMono-VariableFont_wght.ttf +0 -0
- package/dist/panel/index.d.ts +7 -4
- package/dist/panel/index.js +11 -5
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +16 -1
- package/dist/panel/pages/collection/CollectionPage.svelte +236 -61
- package/dist/panel/pages/collection/load.server.js +1 -1
- package/dist/panel/pages/dashboard/Dashboard.svelte +135 -90
- package/dist/panel/pages/dashboard/DashboardCard.svelte +109 -0
- package/dist/panel/pages/dashboard/DashboardCard.svelte.d.ts +14 -0
- package/dist/panel/pages/dashboard/DashboardCollection.svelte +180 -57
- package/dist/panel/pages/dashboard/DashboardCollection.svelte.d.ts +1 -0
- package/dist/panel/pages/dashboard/DashboardRow.svelte +93 -0
- package/dist/panel/pages/dashboard/DashboardRow.svelte.d.ts +16 -0
- package/dist/panel/pages/dashboard/load.server.js +49 -25
- package/dist/panel/pages/dashboard/time.d.ts +19 -0
- package/dist/panel/pages/dashboard/time.js +29 -0
- package/dist/panel/pages/dashboard/types.d.ts +9 -2
- package/dist/panel/pages/live/Live.svelte +53 -50
- package/dist/panel/public.d.ts +4 -0
- package/dist/panel/public.js +6 -0
- package/dist/panel/style/font.css +21 -32
- package/dist/panel/style/index.css +191 -122
- package/dist/panel/style/mixins/index.css +14 -0
- package/dist/panel/style/palette.css +35 -26
- package/dist/panel/style/postcss/size-function.d.ts +4 -0
- package/dist/panel/style/postcss/size-function.js +24 -0
- package/dist/panel/style/radius.css +4 -5
- package/dist/panel/style/scheme.css +111 -0
- package/dist/panel/style/size.css +3 -0
- package/dist/panel/util/Sortable.js +9 -4
- package/dist/panel/util/keys.d.ts +24 -0
- package/dist/panel/util/keys.js +63 -0
- package/dist/panel/util/time.d.ts +12 -0
- package/dist/panel/util/time.js +35 -0
- package/dist/panel/util/upload-file.d.ts +106 -0
- package/dist/panel/util/upload-file.js +165 -0
- package/dist/public.d.ts +13 -0
- package/dist/public.js +12 -0
- package/dist/util/index.d.ts +7 -10
- package/dist/util/index.js +7 -8
- package/dist/util/object.d.ts +10 -0
- package/dist/util/object.js +22 -1
- package/dist/util/string.d.ts +17 -0
- package/dist/util/string.js +23 -0
- package/package.json +12 -8
- package/dist/core/pipeline/config-map/build-tree-map.d.ts +0 -4
- package/dist/core/pipeline/config-map/build-tree-map.js +0 -30
- package/dist/core/prototype/doc.d.ts +0 -31
- package/dist/core/prototype/doc.js +0 -118
- package/dist/core/prototype/shared/url/augment.d.ts +0 -13
- package/dist/core/prototype/shared/url/augment.js +0 -11
- package/dist/core/prototype/shared/url/hooks/populate-url.server.d.ts +0 -4
- package/dist/core/prototype/shared/url/hooks/populate-url.server.js +0 -120
- package/dist/fields/relation/client.d.ts +0 -28
- package/dist/fields/relation/client.js +0 -37
- package/dist/fields/rich-text/component/styles/rich-text.css +0 -183
- package/dist/panel/components/sections/collection/header/Header.svelte +0 -17
- package/dist/panel/components/sections/collection/header/Header.svelte.d.ts +0 -3
- package/dist/panel/components/sections/collection/header/Separator.svelte +0 -8
- package/dist/panel/components/sections/collection/header/Separator.svelte.d.ts +0 -26
- package/dist/panel/components/sections/collection/tree/util.d.ts +0 -12
- package/dist/panel/components/sections/collection/tree/util.js +0 -22
- package/dist/panel/fonts/ChivoMono-Italic-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/ChivoMono-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/panel/fonts/Lora-Italic-VariableFont_wght.ttf +0 -0
- package/dist/panel/fonts/Lora-VariableFont_wght.ttf +0 -0
- package/dist/panel/style/shadow.css +0 -10
- package/dist/util/path.d.ts +0 -16
- package/dist/util/path.js +0 -19
- /package/dist/{panel/components/sections/live → live}/LiveEdit.svelte.d.ts +0 -0
- /package/dist/{panel/components/sections/live → live}/Provider.svelte.d.ts +0 -0
package/dist/core/fields/util.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { TabsBuilder } from '../../fields/tabs/index.js';
|
|
4
|
-
import { TreeBuilder } from '../../fields/tree/index.js';
|
|
5
|
-
import { normalizeFieldPath } from '../../util/path.js';
|
|
1
|
+
import { normalizeFieldPath } from '../../util/string.js';
|
|
2
|
+
import { matchesSegment, walkFields } from './walk.js';
|
|
6
3
|
/**
|
|
7
4
|
* Checks if a field is a presentative field (currently only separator fields).
|
|
8
5
|
* Presentative fields are used for UI organization and don't store data.
|
|
@@ -36,31 +33,20 @@ export const isLiveField = (field) => field.live;
|
|
|
36
33
|
* ]}
|
|
37
34
|
* ]);
|
|
38
35
|
*/
|
|
39
|
-
export const emptyValuesFromFieldConfig = (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
emptyValue = tabsValue;
|
|
56
|
-
}
|
|
57
|
-
// Handle default values
|
|
58
|
-
else {
|
|
59
|
-
emptyValue = config.use.defaultValue();
|
|
60
|
-
}
|
|
61
|
-
return [config.name, emptyValue];
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
36
|
+
export const emptyValuesFromFieldConfig = (fields) => Object.fromEntries(fields.filter(isFormField).map((config) => {
|
|
37
|
+
const nodes = config.use.nodes();
|
|
38
|
+
// A leaf, and a repeater with it: `#` means only a document can name the children, so an
|
|
39
|
+
// empty one holds the field's own default.
|
|
40
|
+
if (!nodes.length || nodes.some((node) => node.segment.includes('#'))) {
|
|
41
|
+
return [config.name, config.use.defaultValue()];
|
|
42
|
+
}
|
|
43
|
+
const value = {};
|
|
44
|
+
for (const node of nodes) {
|
|
45
|
+
const bucket = node.segment ? (value[node.segment] = {}) : value;
|
|
46
|
+
Object.assign(bucket, emptyValuesFromFieldConfig(node.fields));
|
|
47
|
+
}
|
|
48
|
+
return [config.name, value];
|
|
49
|
+
}));
|
|
64
50
|
/**
|
|
65
51
|
* Converts a path with numeric indices to a regex pattern
|
|
66
52
|
* Numbers between dots or between dot and colon are converted to \d+
|
|
@@ -91,49 +77,53 @@ export function pathToRegex(path) {
|
|
|
91
77
|
*
|
|
92
78
|
*/
|
|
93
79
|
export const getFieldAtPath = (path, fields) => {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
if (remainingParts.length === 0)
|
|
80
|
+
const findInFields = (currentFields, parts) => {
|
|
81
|
+
if (!parts.length)
|
|
97
82
|
return undefined;
|
|
98
|
-
const currentPart = remainingParts[0];
|
|
99
83
|
for (const field of currentFields) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
const nodes = field.use.nodes();
|
|
85
|
+
// A container with no name of its own: its branches are the segment (tabs).
|
|
86
|
+
if (!field.name) {
|
|
87
|
+
for (const node of nodes) {
|
|
88
|
+
if (!matchesSegment(node.segment, parts[0]))
|
|
89
|
+
continue;
|
|
90
|
+
const found = findInFields(node.fields, parts.slice(1));
|
|
91
|
+
if (found)
|
|
92
|
+
return found;
|
|
105
93
|
}
|
|
106
94
|
continue;
|
|
107
95
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return findInFields(field.get.fields, remainingParts.slice(2));
|
|
130
|
-
}
|
|
96
|
+
if (field.name !== parts[0])
|
|
97
|
+
continue;
|
|
98
|
+
if (parts.length === 1)
|
|
99
|
+
return field;
|
|
100
|
+
for (const node of nodes) {
|
|
101
|
+
// A branch that adds no segment: the rest of the path is already inside it.
|
|
102
|
+
if (!node.segment) {
|
|
103
|
+
const found = findInFields(node.fields, parts.slice(1));
|
|
104
|
+
if (found)
|
|
105
|
+
return found;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (!matchesSegment(node.segment, parts[1]))
|
|
109
|
+
continue;
|
|
110
|
+
// A repeating branch stays itself through `_children.<index>`, however deep.
|
|
111
|
+
let rest = parts.slice(2);
|
|
112
|
+
while (node.repeatVia &&
|
|
113
|
+
rest[0] === node.repeatVia &&
|
|
114
|
+
rest[1] !== undefined &&
|
|
115
|
+
matchesSegment(node.segment, rest[1])) {
|
|
116
|
+
rest = rest.slice(2);
|
|
131
117
|
}
|
|
118
|
+
const found = findInFields(node.fields, rest);
|
|
119
|
+
if (found)
|
|
120
|
+
return found;
|
|
132
121
|
}
|
|
122
|
+
return undefined;
|
|
133
123
|
}
|
|
134
124
|
return undefined;
|
|
135
125
|
};
|
|
136
|
-
return findInFields(fields,
|
|
126
|
+
return findInFields(fields, path.split('.'));
|
|
137
127
|
};
|
|
138
128
|
/**
|
|
139
129
|
* Traverses a FieldBuilder[] tree and returns the subset of builders to pass to
|
|
@@ -149,60 +139,53 @@ export function getFieldListAtPath(fieldPath, fields, parentPath = '') {
|
|
|
149
139
|
const dotIndex = fieldPath.indexOf('.');
|
|
150
140
|
const head = dotIndex === -1 ? fieldPath : fieldPath.slice(0, dotIndex);
|
|
151
141
|
const tail = dotIndex === -1 ? '' : fieldPath.slice(dotIndex + 1);
|
|
152
|
-
const isEndpoint =
|
|
153
|
-
const
|
|
142
|
+
const isEndpoint = !tail;
|
|
143
|
+
const below = (path, segment) => normalizeFieldPath(path ? `${path}.${segment}` : segment);
|
|
154
144
|
for (const field of fields) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
145
|
+
const nodes = field.use.nodes();
|
|
146
|
+
// A container with no name of its own: its branches are the segment (tabs).
|
|
147
|
+
if (!field.name) {
|
|
148
|
+
const node = nodes.find((candidate) => matchesSegment(candidate.segment, head));
|
|
149
|
+
if (!node)
|
|
159
150
|
continue;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return getFieldListAtPath(tail, tab.get.fields, nextParentPath);
|
|
151
|
+
const path = below(parentPath, head);
|
|
152
|
+
return isEndpoint
|
|
153
|
+
? { fields: node.fields, path }
|
|
154
|
+
: getFieldListAtPath(tail, node.fields, path);
|
|
165
155
|
}
|
|
166
|
-
if (
|
|
156
|
+
if (field.name !== head)
|
|
167
157
|
continue;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
158
|
+
const own = below(parentPath, head);
|
|
159
|
+
// A branch that adds no segment: the rest of the path is already inside it (group).
|
|
160
|
+
const transparent = nodes.find((node) => !node.segment);
|
|
161
|
+
if (transparent) {
|
|
162
|
+
return isEndpoint
|
|
163
|
+
? { fields: transparent.fields, path: own }
|
|
164
|
+
: getFieldListAtPath(tail, transparent.fields, own);
|
|
174
165
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
if (blockType) {
|
|
181
|
-
const block = field.get.blocks.find((b) => b.name === blockType);
|
|
182
|
-
if (!isInnerBlockLookup && block?.get.fields) {
|
|
183
|
-
return {
|
|
184
|
-
fields: block.get.fields,
|
|
185
|
-
path: normalizeFieldPath(nextParentPathWithBlockIndex)
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
if (block) {
|
|
189
|
-
return getFieldListAtPath(tail.split('.').slice(1).join('.'), block.get.fields, normalizeFieldPath(nextParentPathWithBlockIndex));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return { fields: [field], path: parentPath };
|
|
193
|
-
}
|
|
194
|
-
// Tree
|
|
195
|
-
if (field instanceof TreeBuilder && field.name === head) {
|
|
196
|
-
const children = field.get.fields;
|
|
197
|
-
const nextParentPathWithIndex = `${nextParentPath}.${tail.split('.')[0]}`;
|
|
198
|
-
if (isEndpoint)
|
|
199
|
-
return { fields: children, path: nextParentPath };
|
|
200
|
-
return getFieldListAtPath(tail.split('.').slice(1).join('.'), children, nextParentPathWithIndex);
|
|
166
|
+
if (isEndpoint) {
|
|
167
|
+
// Nothing left to pick a branch with. One unnamed branch is still the answer — a tree row;
|
|
168
|
+
// several named ones are not — a blocks field answers with itself.
|
|
169
|
+
const only = nodes.length === 1 && !nodes[0].segment.includes(':') ? nodes[0] : undefined;
|
|
170
|
+
return only ? { fields: only.fields, path: own } : { fields: [field], path: parentPath };
|
|
201
171
|
}
|
|
202
|
-
|
|
203
|
-
|
|
172
|
+
const parts = tail.split('.');
|
|
173
|
+
const node = nodes.find((candidate) => matchesSegment(candidate.segment, parts[0]));
|
|
174
|
+
if (!node)
|
|
204
175
|
return { fields: [field], path: parentPath };
|
|
176
|
+
// A repeating branch stays itself through `_children.<index>`, however deep.
|
|
177
|
+
let rest = parts.slice(1);
|
|
178
|
+
let path = below(own, parts[0]);
|
|
179
|
+
while (node.repeatVia &&
|
|
180
|
+
rest[0] === node.repeatVia &&
|
|
181
|
+
rest[1] !== undefined &&
|
|
182
|
+
matchesSegment(node.segment, rest[1])) {
|
|
183
|
+
path = `${path}.${rest[0]}.${rest[1]}`;
|
|
184
|
+
rest = rest.slice(2);
|
|
205
185
|
}
|
|
186
|
+
return rest.length
|
|
187
|
+
? getFieldListAtPath(rest.join('.'), node.fields, path)
|
|
188
|
+
: { fields: node.fields, path };
|
|
206
189
|
}
|
|
207
190
|
console.warn(`[LiveEditPanel] fieldPath "${fieldPath}" not found in config fields`);
|
|
208
191
|
return { fields, path: parentPath };
|
|
@@ -218,10 +201,7 @@ export function getFieldListAtPath(fieldPath, fields, parentPath = '') {
|
|
|
218
201
|
*
|
|
219
202
|
* Top-level only, matching the generator: a nested field cannot be split off its parent.
|
|
220
203
|
*/
|
|
221
|
-
export const baseFieldNames = (config) => config.fields
|
|
222
|
-
.filter(isFormField)
|
|
223
|
-
.filter((field) => field.get.root)
|
|
224
|
-
.map((field) => field.name);
|
|
204
|
+
export const baseFieldNames = (config) => config.fields.filter((field) => field.get.root).map((field) => field.name);
|
|
225
205
|
/**
|
|
226
206
|
* The fields a read resolves into the document they reference, with the column each one is
|
|
227
207
|
* stored in. A field opts in with `$references(slug, { resolve: true })`.
|
|
@@ -237,31 +217,39 @@ export const baseFieldNames = (config) => config.fields
|
|
|
237
217
|
* Walks tabs and groups, whose columns sit on the owner's row. Blocks and tree rows are their
|
|
238
218
|
* own tables and are not walked.
|
|
239
219
|
*/
|
|
220
|
+
/**
|
|
221
|
+
* The resolved references a reader may see, by path — what a read asks the adapter to join. A
|
|
222
|
+
* reference the pipeline would drop for this reader is not joined for nothing.
|
|
223
|
+
*/
|
|
224
|
+
export const readableReferences = (fields, user) => resolvedReferencesOf(fields)
|
|
225
|
+
.filter((reference) => reference.field.use.accessRead(user))
|
|
226
|
+
.map((reference) => reference.path);
|
|
227
|
+
const resolvedReferencesMemo = new WeakMap();
|
|
240
228
|
export const resolvedReferencesOf = (fields, parentPath = '') => {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
continue;
|
|
229
|
+
// A config's fields do not change once built, and this is asked once per query and once per
|
|
230
|
+
// document read: answered once per list of fields.
|
|
231
|
+
if (!parentPath) {
|
|
232
|
+
let found = resolvedReferencesMemo.get(fields);
|
|
233
|
+
if (!found) {
|
|
234
|
+
found = collectResolvedReferences(fields, '');
|
|
235
|
+
resolvedReferencesMemo.set(fields, found);
|
|
249
236
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
237
|
+
return found;
|
|
238
|
+
}
|
|
239
|
+
return collectResolvedReferences(fields, parentPath);
|
|
240
|
+
};
|
|
241
|
+
const collectResolvedReferences = (fields, parentPath) => {
|
|
242
|
+
const found = [];
|
|
243
|
+
for (const { field, path } of walkFields(fields, { path: parentPath, determinate: true })) {
|
|
244
|
+
if (!isFormField(field) || !field._references?.resolve)
|
|
254
245
|
continue;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
to: field._references.table
|
|
263
|
-
});
|
|
264
|
-
}
|
|
246
|
+
found.push({
|
|
247
|
+
field,
|
|
248
|
+
path,
|
|
249
|
+
column: path.replace(/\./g, '__'),
|
|
250
|
+
root: field.get.root,
|
|
251
|
+
to: field._references.table
|
|
252
|
+
});
|
|
265
253
|
}
|
|
266
254
|
return found;
|
|
267
255
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FieldBuilder } from './builders/field-builder.js';
|
|
2
|
+
/** A field the walk reached, the path it sits at, and the data there when the walk has data. */
|
|
3
|
+
export type Visit = {
|
|
4
|
+
field: FieldBuilder;
|
|
5
|
+
path: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
};
|
|
8
|
+
/** The document grammar's join. A joiner is never handed an empty part — a branch that
|
|
9
|
+
* contributes no segment keeps its parent's path — so it only guards the empty parent. */
|
|
10
|
+
export declare const joinPath: (parent: string, part: string) => string;
|
|
11
|
+
export type WalkOptions = {
|
|
12
|
+
path?: string;
|
|
13
|
+
/** The schema generator joins with `__`. */
|
|
14
|
+
join?: (parent: string, part: string) => string;
|
|
15
|
+
/** Skip branches whose segment holds a `#` — a path no config alone can name. */
|
|
16
|
+
determinate?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Every field the config declares, parents before children, siblings in declaration order.
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
22
|
+
* tabs(tab('meta').fields(group('seo').fields(text('title'))))
|
|
23
|
+
* -> meta.seo · meta.seo.title
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function walkFields(fields: FieldBuilder[], { path, join, determinate }?: WalkOptions): Generator<Visit>;
|
|
27
|
+
/**
|
|
28
|
+
* Every field a document actually carries, at the path its value sits at. A named field the data
|
|
29
|
+
* does not hold contributes nothing.
|
|
30
|
+
*
|
|
31
|
+
* ```
|
|
32
|
+
* blocks('layout', [block('hero').fields(text('title'))])
|
|
33
|
+
* { layout: [ { type: 'hero', title: 'x' } ] } -> layout · layout.0:hero.title
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function walkValues(fields: FieldBuilder[], data: unknown, { path, join }?: WalkOptions): Generator<Visit>;
|
|
37
|
+
/**
|
|
38
|
+
* Whether one concrete segment is the branch a declared segment stands for.
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* '#:hero' matches '0:hero' · '#' matches '7' · 'meta' matches only 'meta'
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const matchesSegment: (pattern: string, segment: string) => boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { isObjectLiteral } from '../../util/object.js';
|
|
2
|
+
/** The document grammar's join. A joiner is never handed an empty part — a branch that
|
|
3
|
+
* contributes no segment keeps its parent's path — so it only guards the empty parent. */
|
|
4
|
+
export const joinPath = (parent, part) => (parent ? `${parent}.${part}` : part);
|
|
5
|
+
/**
|
|
6
|
+
* Every field the config declares, parents before children, siblings in declaration order.
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* tabs(tab('meta').fields(group('seo').fields(text('title'))))
|
|
10
|
+
* -> meta.seo · meta.seo.title
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function* walkFields(fields, { path = '', join = joinPath, determinate = false } = {}) {
|
|
14
|
+
for (const field of fields) {
|
|
15
|
+
const own = field.name ? join(path, field.name) : path;
|
|
16
|
+
yield { field, path: own, value: undefined };
|
|
17
|
+
for (const node of field.use.nodes()) {
|
|
18
|
+
if (determinate && node.segment.includes('#'))
|
|
19
|
+
continue;
|
|
20
|
+
const below = node.segment ? join(own, node.segment) : own;
|
|
21
|
+
yield* walkFields(node.fields, { path: below, join, determinate });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every field a document actually carries, at the path its value sits at. A named field the data
|
|
27
|
+
* does not hold contributes nothing.
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* blocks('layout', [block('hero').fields(text('title'))])
|
|
31
|
+
* { layout: [ { type: 'hero', title: 'x' } ] } -> layout · layout.0:hero.title
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function* walkValues(fields, data, { path = '', join = joinPath } = {}) {
|
|
35
|
+
for (const field of fields) {
|
|
36
|
+
if (field.name && !(isObjectLiteral(data) && field.name in data))
|
|
37
|
+
continue;
|
|
38
|
+
const own = field.name ? join(path, field.name) : path;
|
|
39
|
+
const value = field.name ? data[field.name] : data;
|
|
40
|
+
yield { field, path: own, value };
|
|
41
|
+
for (const node of field.use.nodesFor(value)) {
|
|
42
|
+
const below = node.segment ? join(own, node.segment) : own;
|
|
43
|
+
yield* walkValues(node.fields, node.value, { path: below, join });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const escapeRegex = (str) => str.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
48
|
+
/**
|
|
49
|
+
* Whether one concrete segment is the branch a declared segment stands for.
|
|
50
|
+
*
|
|
51
|
+
* ```
|
|
52
|
+
* '#:hero' matches '0:hero' · '#' matches '7' · 'meta' matches only 'meta'
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export const matchesSegment = (pattern, segment) => new RegExp(`^${pattern.split('#').map(escapeRegex).join('\\d+')}$`).test(segment);
|
|
@@ -5,11 +5,15 @@ import { logger } from './logger.server.js';
|
|
|
5
5
|
import {} from '@sveltejs/kit';
|
|
6
6
|
import { svelteKitHandler } from 'better-auth/svelte-kit';
|
|
7
7
|
import { createPluginsHandler } from './plugins/plugins.server.js';
|
|
8
|
+
import { ensureAddresses } from './prototype/shared/url/addresses.server.js';
|
|
8
9
|
import { handleRoutes } from './routes/handler.server.js';
|
|
9
10
|
function createCMSHandler(rime) {
|
|
10
11
|
const handleCMS = async ({ event, resolve }) => {
|
|
11
12
|
logger.info(`${event.request.method} ${event.url.pathname}`);
|
|
12
13
|
event.locals.rime = rime.createRimeContext(event);
|
|
14
|
+
// Once per process: pages written before their collection kept addresses get theirs.
|
|
15
|
+
if (!building)
|
|
16
|
+
await ensureAddresses(event);
|
|
13
17
|
return svelteKitHandler({ event, resolve, auth: rime.auth, building });
|
|
14
18
|
};
|
|
15
19
|
return handleCMS;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { I18n } from './index.js';
|
|
2
|
+
/** Puts a translator in Svelte context, for `getI18nContext` in every component below. */
|
|
3
|
+
export declare const setI18nContext: (i18n: I18n) => I18n;
|
|
4
|
+
/** The translator the nearest `setI18nContext` above put in context. */
|
|
5
|
+
export declare const getI18nContext: () => I18n;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
const KEY = 'rime:i18n';
|
|
3
|
+
/** Puts a translator in Svelte context, for `getI18nContext` in every component below. */
|
|
4
|
+
export const setI18nContext = (i18n) => setContext(KEY, i18n);
|
|
5
|
+
/** The translator the nearest `setI18nContext` above put in context. */
|
|
6
|
+
export const getI18nContext = () => getContext(KEY);
|
|
@@ -66,7 +66,34 @@ declare namespace _default {
|
|
|
66
66
|
export let save: string;
|
|
67
67
|
export let search_a: string;
|
|
68
68
|
export let search: string;
|
|
69
|
+
export let language: string;
|
|
70
|
+
export let switch_to_language: string;
|
|
71
|
+
export let commands: string;
|
|
72
|
+
export let collection: string;
|
|
73
|
+
export let search_in: string;
|
|
74
|
+
export let show_as_list: string;
|
|
75
|
+
export let show_as_grid: string;
|
|
76
|
+
export let show_as_tree: string;
|
|
77
|
+
export let mark_as: string;
|
|
78
|
+
export let type_a_command: string;
|
|
79
|
+
export let nothing_found: string;
|
|
80
|
+
export let palette_move: string;
|
|
81
|
+
export let palette_run: string;
|
|
82
|
+
export let palette_close: string;
|
|
83
|
+
export let profile: string;
|
|
84
|
+
export let sign_out: string;
|
|
85
|
+
export let go_to: string;
|
|
86
|
+
export let document: string;
|
|
87
|
+
export let collections: string;
|
|
88
|
+
export let areas: string;
|
|
89
|
+
export let text: string;
|
|
69
90
|
export let select_all: string;
|
|
91
|
+
export let collection_count: string;
|
|
92
|
+
export let collection_count_files: string;
|
|
93
|
+
export let collection_deselect_all: string;
|
|
94
|
+
export let collection_display: string;
|
|
95
|
+
export let collection_select: string;
|
|
96
|
+
export let collection_upload: string;
|
|
70
97
|
export let sendPasswordResetLink: string;
|
|
71
98
|
export let signin: string;
|
|
72
99
|
export let someone: string;
|
|
@@ -78,7 +105,51 @@ declare namespace _default {
|
|
|
78
105
|
export let view_all: string;
|
|
79
106
|
export let view_page: string;
|
|
80
107
|
export let view_site: string;
|
|
108
|
+
export let good_morning: string;
|
|
109
|
+
export let good_afternoon: string;
|
|
110
|
+
export let good_evening: string;
|
|
111
|
+
export let no_documents_yet: string;
|
|
112
|
+
export let create_first_one: string;
|
|
113
|
+
export let all: string;
|
|
114
|
+
export let author: string;
|
|
115
|
+
export let status: string;
|
|
116
|
+
export let title: string;
|
|
117
|
+
export let updated: string;
|
|
118
|
+
export let sort_by: string;
|
|
119
|
+
export let collection_count_drafts: string;
|
|
120
|
+
export let drafts_waiting: string;
|
|
121
|
+
export let drop_anywhere: string;
|
|
122
|
+
export let drop_to_upload_into: string;
|
|
123
|
+
export let media_kind_image: string;
|
|
124
|
+
export let media_kind_video: string;
|
|
125
|
+
export let media_kind_audio: string;
|
|
126
|
+
export let media_kind_document: string;
|
|
127
|
+
export let media_kind_other: string;
|
|
128
|
+
export let time_now: string;
|
|
129
|
+
export let time_minutes_ago: string;
|
|
130
|
+
export let time_hours_ago: string;
|
|
131
|
+
export let time_yesterday: string;
|
|
132
|
+
export let time_days_ago: string;
|
|
81
133
|
export let welcome: string;
|
|
82
134
|
export let your_auto_save: string;
|
|
135
|
+
export let untitled: string;
|
|
136
|
+
export let edited: string;
|
|
137
|
+
export let edited_by: string;
|
|
138
|
+
export let document_actions: string;
|
|
139
|
+
export let copy_id: string;
|
|
140
|
+
export let id_copied: string;
|
|
141
|
+
export let created_on: string;
|
|
142
|
+
export let updated_on: string;
|
|
143
|
+
export let by_user: string;
|
|
144
|
+
export let id: string;
|
|
145
|
+
export let change_url: string;
|
|
146
|
+
export let copy_url: string;
|
|
147
|
+
export let url_copied: string;
|
|
148
|
+
export let url_changed: string;
|
|
149
|
+
export let url_address: string;
|
|
150
|
+
export let url_on_published: string;
|
|
151
|
+
export let url_slug_required: string;
|
|
152
|
+
export let url_slug_taken: string;
|
|
153
|
+
export let under_this_page: string;
|
|
83
154
|
}
|
|
84
155
|
export default _default;
|
|
@@ -67,7 +67,34 @@ export default {
|
|
|
67
67
|
save: 'Save',
|
|
68
68
|
search_a: 'Search a $1...',
|
|
69
69
|
search: 'Search $1...',
|
|
70
|
+
language: 'Language',
|
|
71
|
+
switch_to_language: 'Switch to $1',
|
|
72
|
+
commands: 'Commands',
|
|
73
|
+
collection: 'Collection',
|
|
74
|
+
search_in: 'Search in $1',
|
|
75
|
+
show_as_list: 'Show as a list',
|
|
76
|
+
show_as_grid: 'Show as a grid',
|
|
77
|
+
show_as_tree: 'Show as a tree',
|
|
78
|
+
mark_as: 'Mark as $1',
|
|
79
|
+
type_a_command: 'A command, a document…',
|
|
80
|
+
nothing_found: 'Nothing found',
|
|
81
|
+
palette_move: 'to move',
|
|
82
|
+
palette_run: 'to run',
|
|
83
|
+
palette_close: 'to close',
|
|
84
|
+
profile: 'Profile',
|
|
85
|
+
sign_out: 'Sign out',
|
|
86
|
+
go_to: 'Go to',
|
|
87
|
+
document: 'Document',
|
|
88
|
+
collections: 'Collections',
|
|
89
|
+
areas: 'Areas',
|
|
90
|
+
text: 'Text',
|
|
70
91
|
select_all: 'Select all',
|
|
92
|
+
collection_count: '$1 {document|document|documents}',
|
|
93
|
+
collection_count_files: '$1 {file|file|files}',
|
|
94
|
+
collection_deselect_all: 'Deselect all',
|
|
95
|
+
collection_display: 'Display',
|
|
96
|
+
collection_select: 'Select',
|
|
97
|
+
collection_upload: 'Upload',
|
|
71
98
|
sendPasswordResetLink: 'Send a password reset link',
|
|
72
99
|
signin: 'Sign In',
|
|
73
100
|
someone: 'Someone',
|
|
@@ -79,6 +106,50 @@ export default {
|
|
|
79
106
|
view_all: 'View all',
|
|
80
107
|
view_page: 'View page',
|
|
81
108
|
view_site: 'View website',
|
|
109
|
+
good_morning: 'Good morning, $1',
|
|
110
|
+
good_afternoon: 'Good afternoon, $1',
|
|
111
|
+
good_evening: 'Good evening, $1',
|
|
112
|
+
no_documents_yet: 'No $1 yet.',
|
|
113
|
+
create_first_one: 'Create the first one',
|
|
114
|
+
all: 'All',
|
|
115
|
+
author: 'Author',
|
|
116
|
+
status: 'Status',
|
|
117
|
+
title: 'Title',
|
|
118
|
+
updated: 'Updated',
|
|
119
|
+
sort_by: 'Sort by $1',
|
|
120
|
+
collection_count_drafts: '$1 {draft|draft|drafts}',
|
|
121
|
+
drafts_waiting: '$1 {draft|draft|drafts} waiting',
|
|
122
|
+
drop_anywhere: 'drop files anywhere to upload them',
|
|
123
|
+
drop_to_upload_into: 'Drop to upload into $1',
|
|
124
|
+
media_kind_image: 'Images',
|
|
125
|
+
media_kind_video: 'Videos',
|
|
126
|
+
media_kind_audio: 'Audio',
|
|
127
|
+
media_kind_document: 'Documents',
|
|
128
|
+
media_kind_other: 'Other files',
|
|
129
|
+
time_now: 'Just now',
|
|
130
|
+
time_minutes_ago: '$1 min ago',
|
|
131
|
+
time_hours_ago: '$1 h ago',
|
|
132
|
+
time_yesterday: 'Yesterday',
|
|
133
|
+
time_days_ago: '$1 d ago',
|
|
82
134
|
welcome: 'Welcome',
|
|
83
|
-
your_auto_save: 'Your auto-save'
|
|
135
|
+
your_auto_save: 'Your auto-save',
|
|
136
|
+
untitled: 'Untitled',
|
|
137
|
+
edited: 'edited $1',
|
|
138
|
+
edited_by: 'edited by $1, $2',
|
|
139
|
+
document_actions: 'Document actions',
|
|
140
|
+
copy_id: 'Copy the ID',
|
|
141
|
+
id_copied: 'ID copied',
|
|
142
|
+
created_on: 'Created $1',
|
|
143
|
+
updated_on: 'Updated $1',
|
|
144
|
+
by_user: 'by $1',
|
|
145
|
+
id: 'ID',
|
|
146
|
+
change_url: 'Change url',
|
|
147
|
+
copy_url: 'Copy the url',
|
|
148
|
+
url_copied: 'Url copied',
|
|
149
|
+
url_changed: 'Url changed',
|
|
150
|
+
url_address: 'Address',
|
|
151
|
+
url_on_published: 'The url changes on the published version.',
|
|
152
|
+
url_slug_required: 'The address needs at least one letter or digit.',
|
|
153
|
+
url_slug_taken: 'Another page at this level already uses this address.',
|
|
154
|
+
under_this_page: 'Under this page'
|
|
84
155
|
};
|