alinea 2.0.0-preview.0 → 2.0.0-preview.10
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/.init/.mcp.json +11 -0
- package/dist/.init/AGENTS.md +17 -0
- package/dist/.init/CLAUDE.md +1 -0
- package/dist/.init/content/pages/welcome.json +1 -1
- package/dist/.init/package.json +1 -1
- package/dist/.init/src/cms.ts +5 -6
- package/dist/.mcp/later/dev.json +1 -0
- package/dist/.mcp/lock/dev.json +1 -0
- package/dist/.mcp/online/dev.json +1 -0
- package/dist/LICENSES.md +2342 -289
- package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
- package/dist/adapter/next/ForwardCredentials.js +17 -0
- package/dist/adapter/next/cms.d.ts +20 -6
- package/dist/adapter/next/cms.js +226 -54
- package/dist/adapter/next/context.d.ts +1 -1
- package/dist/adapter/next/context.js +15 -5
- package/dist/adapter/next/devCache.d.ts +16 -0
- package/dist/adapter/next/devCache.js +32 -0
- package/dist/adapter/next/handler.d.ts +6 -0
- package/dist/adapter/next/handler.js +119 -23
- package/dist/adapter/next/node.d.ts +5 -0
- package/dist/adapter/next/node.js +16 -0
- package/dist/adapter/next/previews.d.ts +4 -1
- package/dist/adapter/next/previews.js +20 -1
- package/dist/adapter/next/renderStats.d.ts +45 -0
- package/dist/adapter/next/renderStats.js +142 -0
- package/dist/adapter/next/syncCheck.d.ts +18 -0
- package/dist/adapter/next/syncCheck.js +53 -0
- package/dist/adapter/next/with-alinea.d.ts +0 -8
- package/dist/adapter/next/with-alinea.js +65 -46
- package/dist/adapter/vite/plugin.js +9 -4
- package/dist/backend/HandleAction.d.ts +1 -1
- package/dist/backend/HandleAction.js +1 -1
- package/dist/backend/Handler.d.ts +15 -14
- package/dist/backend/Handler.js +193 -49
- package/dist/backend/api/BasicAuth.d.ts +1 -1
- package/dist/backend/api/BasicAuth.js +14 -14
- package/dist/backend/api/CreateBackend.js +15 -3
- package/dist/backend/api/DatabaseApi.js +22 -135
- package/dist/backend/api/GithubApi.js +16 -7
- package/dist/backend/api/OAuth2.d.ts +3 -3
- package/dist/backend/api/OAuth2.js +7 -4
- package/dist/backend/api/ProxyMedia.d.ts +2 -0
- package/dist/backend/api/ProxyMedia.js +27 -0
- package/dist/backend/api/S3Uploads.d.ts +1 -1
- package/dist/backend/api/database.js +15 -3
- package/dist/backend/resolver/ParsePreview.d.ts +9 -5
- package/dist/backend/resolver/ParsePreview.js +40 -43
- package/dist/backend/router/NodeHandler.js +2 -0
- package/dist/backend/router/Router.d.ts +1 -0
- package/dist/backend/router/Router.js +23 -15
- package/dist/backend/store/GeneratedDatabase.d.ts +8 -0
- package/dist/backend/store/GeneratedDatabase.js +33 -0
- package/dist/backend/store/GeneratedDatabaseNode.d.ts +8 -0
- package/dist/backend/store/GeneratedDatabaseNode.js +25 -0
- package/dist/backend/store/GeneratedRelease.d.ts +1 -1
- package/dist/backend/store/GeneratedRelease.js +3 -4
- package/dist/backend/util/ORM.js +4 -2
- package/dist/backend/util/Syncable.js +1 -1
- package/dist/bundled.d.ts +11698 -6082
- package/dist/chunks/bun-sqlite-5SHXN3AT.js +18 -0
- package/dist/chunks/ccitt-Y7TDCCPM.js +90 -0
- package/dist/chunks/chunk-2BJ2IFQM.js +1085 -0
- package/dist/chunks/chunk-2PIFHEYR.js +364 -0
- package/dist/chunks/chunk-66YZ47TY.js +94 -0
- package/dist/chunks/chunk-6UT4N4CO.js +919 -0
- package/dist/chunks/chunk-76VMZTLN.js +55 -0
- package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
- package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
- package/dist/chunks/chunk-AIU6CMVT.js +495 -0
- package/dist/chunks/chunk-ASYKC6IE.js +103 -0
- package/dist/chunks/chunk-ATF42T2B.js +35 -0
- package/dist/chunks/{chunk-Y7XOMJOC.js → chunk-CFNRVI3Y.js} +220 -247
- package/dist/chunks/chunk-D6UJHBJJ.js +183 -0
- package/dist/chunks/{chunk-NWQXN4SB.js → chunk-ETBQTP2S.js} +40 -29
- package/dist/chunks/chunk-ETWOY4AL.js +100 -0
- package/dist/chunks/{chunk-EQ3TDHYD.js → chunk-HXXBAY3B.js} +35 -7
- package/dist/chunks/{chunk-I7X64JTZ.js → chunk-JOF663EG.js} +6479 -3715
- package/dist/chunks/chunk-K62JP6HR.js +22 -0
- package/dist/chunks/chunk-MOWR65LM.js +610 -0
- package/dist/chunks/chunk-N47Y62CI.js +396 -0
- package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-NP4M2257.js} +203 -269
- package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
- package/dist/chunks/{chunk-IYAQC63Y.js → chunk-PSSMQKAH.js} +1607 -744
- package/dist/chunks/chunk-QBPYWU6C.js +24 -0
- package/dist/chunks/{chunk-X47OVDF3.js → chunk-QJGGYF6E.js} +356 -1000
- package/dist/chunks/chunk-QSN6RH6X.js +94 -0
- package/dist/chunks/{chunk-IWN3T3FL.js → chunk-RE523BQ7.js} +21443 -16177
- package/dist/chunks/chunk-RE6CDK2M.js +254 -0
- package/dist/chunks/chunk-TIJTT5ZI.js +228 -0
- package/dist/chunks/{chunk-I4GC3E65.js → chunk-UPY2RUZF.js} +0 -1
- package/dist/chunks/chunk-W5AXN7GH.js +219 -0
- package/dist/chunks/chunk-XCZXR3C2.js +112 -0
- package/dist/chunks/chunk-XTWYBWP2.js +81 -0
- package/dist/chunks/dist-UDQZOKRG.js +7499 -0
- package/dist/chunks/jpeg-OJTBZV3C.js +292 -0
- package/dist/chunks/jpx-4VRYG2JB.js +667 -0
- package/dist/chunks/node-sqlite-XVNTNMCY.js +18 -0
- package/dist/cli/Generate.d.ts +2 -1
- package/dist/cli/Generate.js +91 -79
- package/dist/cli/Init.d.ts +43 -2
- package/dist/cli/Init.js +144 -28
- package/dist/cli/Mcp.d.ts +25 -0
- package/dist/cli/Mcp.js +106 -0
- package/dist/cli/Serve.d.ts +0 -1
- package/dist/cli/Serve.js +15 -5
- package/dist/cli/bin.js +44 -14
- package/dist/cli/generate/CompileConfig.js +3 -2
- package/dist/cli/generate/CopyStaticFiles.d.ts +1 -1
- package/dist/cli/generate/CopyStaticFiles.js +39 -24
- package/dist/cli/generate/DevDB.d.ts +21 -4
- package/dist/cli/generate/DevDB.js +139 -27
- package/dist/cli/generate/FillCache.d.ts +1 -1
- package/dist/cli/generate/FillCache.js +20 -9
- package/dist/cli/generate/GenerateContext.d.ts +3 -0
- package/dist/cli/generate/GenerateDashboard.d.ts +1 -1
- package/dist/cli/generate/GenerateDashboard.js +3 -1
- package/dist/cli/generate/GeneratedPaths.d.ts +21 -0
- package/dist/cli/generate/GeneratedPaths.js +33 -0
- package/dist/cli/generate/LinkMediaFiles.d.ts +7 -0
- package/dist/cli/generate/LinkMediaFiles.js +52 -0
- package/dist/cli/serve/CreateLocalServer.d.ts +3 -2
- package/dist/cli/serve/CreateLocalServer.js +106 -50
- package/dist/cli/serve/DevLock.d.ts +11 -0
- package/dist/cli/serve/DevLock.js +42 -0
- package/dist/cli/serve/DevServer.d.ts +6 -4
- package/dist/cli/serve/DevServer.js +71 -8
- package/dist/cli/serve/LiveReload.d.ts +2 -2
- package/dist/cli/serve/LiveReload.js +6 -2
- package/dist/cli/serve/LocalAuth.js +1 -1
- package/dist/cli/serve/ServeContext.d.ts +1 -1
- package/dist/cli/serve/StartServer.d.ts +3 -1
- package/dist/cli/serve/StartServer.js +10 -3
- package/dist/cli/serve/mcp/DevMcp.d.ts +16 -0
- package/dist/cli/serve/mcp/DevMcp.js +50 -0
- package/dist/cli/serve/mcp/McpGraph.d.ts +35 -0
- package/dist/cli/serve/mcp/McpGraph.js +64 -0
- package/dist/cli/serve/mcp/McpInput.d.ts +11 -0
- package/dist/cli/serve/mcp/McpInput.js +254 -0
- package/dist/cli/serve/mcp/McpInstructions.d.ts +1 -0
- package/dist/cli/serve/mcp/McpInstructions.js +16 -0
- package/dist/cli/serve/mcp/McpSchema.d.ts +31 -0
- package/dist/cli/serve/mcp/McpSchema.js +184 -0
- package/dist/cli/serve/mcp/McpServer.d.ts +47 -0
- package/dist/cli/serve/mcp/McpServer.js +112 -0
- package/dist/cli/serve/mcp/McpTools.d.ts +25 -0
- package/dist/cli/serve/mcp/McpTools.js +567 -0
- package/dist/cli/static/init/agents.md +13 -0
- package/dist/cli/static/init/cms.js +5 -6
- package/dist/cli/util/ContentType.d.ts +1 -0
- package/dist/cli/util/ContentType.js +36 -0
- package/dist/cli/util/Emitter.js +1 -1
- package/dist/cli/util/EnsureLibs.js +2 -2
- package/dist/cli/util/EnsureNode.js +2 -2
- package/dist/cli/util/ForwardCommand.js +4 -12
- package/dist/cli/util/PublicDefines.d.ts +1 -0
- package/dist/cli/util/PublicDefines.js +2 -1
- package/dist/cli/util/RunForwarded.d.ts +13 -0
- package/dist/cli/util/RunForwarded.js +166 -0
- package/dist/cli/util/WarnPublicEnv.js +2 -0
- package/dist/cloud/AuthResult.d.ts +2 -0
- package/dist/cloud/CloudHandshake.d.ts +13 -0
- package/dist/cloud/CloudHandshake.js +121 -0
- package/dist/cloud/CloudRemote.d.ts +6 -2
- package/dist/cloud/CloudRemote.js +43 -10
- package/dist/cms.d.ts +19 -0
- package/dist/cms.js +49 -0
- package/dist/components/Alert.d.ts +29 -0
- package/dist/components/Alert.js +86 -0
- package/dist/components/AppShell.d.ts +15 -0
- package/dist/components/AppShell.js +38 -0
- package/dist/components/Badge.d.ts +11 -0
- package/dist/components/Badge.js +51 -0
- package/dist/components/Blockquote.d.ts +7 -0
- package/dist/components/Blockquote.js +26 -0
- package/dist/components/Breadcrumbs.d.ts +39 -3
- package/dist/components/Breadcrumbs.js +103 -22
- package/dist/components/Button.d.ts +28 -8
- package/dist/components/Button.js +63 -22
- package/dist/components/Calendar.d.ts +28 -3
- package/dist/components/Calendar.js +163 -54
- package/dist/components/Checkbox.d.ts +18 -7
- package/dist/components/Checkbox.js +85 -39
- package/dist/components/CheckboxGroup.d.ts +11 -5
- package/dist/components/CheckboxGroup.js +55 -19
- package/dist/components/Code.d.ts +10 -0
- package/dist/components/Code.js +49 -0
- package/dist/components/Collapsible.d.ts +25 -0
- package/dist/components/Collapsible.js +146 -0
- package/dist/components/ColorSwatch.d.ts +9 -2
- package/dist/components/ColorSwatch.js +20 -20
- package/dist/components/ColorSwatchPicker.d.ts +18 -3
- package/dist/components/ColorSwatchPicker.js +29 -25
- package/dist/components/ComboBox.d.ts +27 -9
- package/dist/components/ComboBox.js +198 -100
- package/dist/components/Command.d.ts +66 -0
- package/dist/components/Command.js +236 -0
- package/dist/components/ContentCard.d.ts +30 -0
- package/dist/components/ContentCard.js +199 -0
- package/dist/components/ContentGrid.d.ts +58 -0
- package/dist/components/ContentGrid.js +220 -0
- package/dist/components/DataList.d.ts +27 -0
- package/dist/components/DataList.js +68 -0
- package/dist/components/DateField.d.ts +15 -4
- package/dist/components/DateField.js +51 -44
- package/dist/components/DatePicker.d.ts +17 -4
- package/dist/components/DatePicker.js +61 -68
- package/dist/components/DateRangePicker.d.ts +19 -4
- package/dist/components/DateRangePicker.js +69 -80
- package/dist/components/Dialog.d.ts +53 -3
- package/dist/components/Dialog.js +188 -20
- package/dist/components/DropZone.d.ts +25 -3
- package/dist/components/DropZone.js +99 -18
- package/dist/components/DropdownMenu.d.ts +78 -0
- package/dist/components/DropdownMenu.js +318 -0
- package/dist/components/Empty.d.ts +46 -0
- package/dist/components/Empty.js +93 -0
- package/dist/components/Field.d.ts +34 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/FileTrigger.d.ts +21 -0
- package/dist/components/FileTrigger.js +53 -0
- package/dist/components/FoldIcon.js +2 -1
- package/dist/components/Heading.d.ts +13 -0
- package/dist/components/Heading.js +48 -0
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/Icon.js +3 -3
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/Kbd.js +27 -0
- package/dist/components/Link.d.ts +14 -4
- package/dist/components/Link.js +22 -20
- package/dist/components/List.d.ts +20 -63
- package/dist/components/List.js +129 -250
- package/dist/components/MediaPreview.d.ts +35 -0
- package/dist/components/MediaPreview.js +227 -0
- package/dist/components/MultipleSelect.d.ts +22 -20
- package/dist/components/MultipleSelect.js +234 -216
- package/dist/components/NavRail.d.ts +41 -0
- package/dist/components/NavRail.js +121 -0
- package/dist/components/NumberField.d.ts +19 -4
- package/dist/components/NumberField.js +105 -54
- package/dist/components/Page.d.ts +57 -0
- package/dist/components/Page.js +130 -0
- package/dist/components/Popover.d.ts +39 -5
- package/dist/components/Popover.js +146 -22
- package/dist/components/PreviewFrame.d.ts +46 -0
- package/dist/components/PreviewFrame.js +182 -0
- package/dist/components/RadioGroup.d.ts +20 -7
- package/dist/components/RadioGroup.js +121 -31
- package/dist/components/Resizable.d.ts +51 -0
- package/dist/components/Resizable.js +1349 -0
- package/dist/components/SearchField.d.ts +37 -6
- package/dist/components/SearchField.js +115 -56
- package/dist/components/Select.d.ts +35 -10
- package/dist/components/Select.js +189 -97
- package/dist/components/Sidebar.d.ts +56 -0
- package/dist/components/Sidebar.js +136 -0
- package/dist/components/SortableList.d.ts +80 -0
- package/dist/components/SortableList.js +471 -0
- package/dist/components/Spinner.d.ts +8 -0
- package/dist/components/Spinner.js +86 -0
- package/dist/components/Surface.js +13 -3
- package/dist/components/Switch.d.ts +15 -4
- package/dist/components/Switch.js +32 -20
- package/dist/components/Table.d.ts +107 -14
- package/dist/components/Table.js +470 -100
- package/dist/components/Tabs.d.ts +33 -12
- package/dist/components/Tabs.js +68 -51
- package/dist/components/TagGroup.d.ts +26 -9
- package/dist/components/TagGroup.js +99 -33
- package/dist/components/Text.d.ts +16 -0
- package/dist/components/Text.js +44 -0
- package/dist/components/TextField.d.ts +27 -9
- package/dist/components/TextField.js +142 -46
- package/dist/components/TimeField.d.ts +20 -4
- package/dist/components/TimeField.js +75 -23
- package/dist/components/Timestamp.d.ts +17 -0
- package/dist/components/Timestamp.js +131 -0
- package/dist/components/Toggle.d.ts +15 -7
- package/dist/components/Toggle.js +4 -54
- package/dist/components/ToggleGroup.d.ts +33 -0
- package/dist/components/ToggleGroup.js +90 -0
- package/dist/components/Toolbar.d.ts +27 -8
- package/dist/components/Toolbar.js +51 -40
- package/dist/components/Tooltip.d.ts +22 -4
- package/dist/components/Tooltip.js +77 -34
- package/dist/components/Tree.d.ts +48 -18
- package/dist/components/Tree.js +227 -81
- package/dist/components/internal/Accept.d.ts +5 -0
- package/dist/components/internal/Accept.js +17 -0
- package/dist/components/internal/DateControl.d.ts +18 -0
- package/dist/components/internal/DateControl.js +92 -0
- package/dist/components/internal/DateValue.d.ts +16 -0
- package/dist/components/internal/DateValue.js +40 -0
- package/dist/components/internal/ListBoxOption.d.ts +20 -0
- package/dist/components/internal/ListBoxOption.js +111 -0
- package/dist/components/internal/Locale.d.ts +7 -0
- package/dist/components/internal/Locale.js +18 -0
- package/dist/components/internal/Placement.d.ts +3 -0
- package/dist/components/internal/Placement.js +13 -0
- package/dist/components/internal/PopoverSurface.d.ts +21 -0
- package/dist/components/internal/PopoverSurface.js +66 -0
- package/dist/components/internal/SelectionCheckbox.d.ts +8 -0
- package/dist/components/internal/SelectionCheckbox.js +57 -0
- package/dist/components/internal/Slot.d.ts +7 -0
- package/dist/components/internal/Slot.js +26 -0
- package/dist/components/internal/ToggleButton.d.ts +26 -0
- package/dist/components/internal/ToggleButton.js +68 -0
- package/dist/components/internal/Trigger.d.ts +16 -0
- package/dist/components/internal/Trigger.js +34 -0
- package/dist/components/internal/useDragDrop.d.ts +22 -0
- package/dist/components/internal/useDragDrop.js +110 -0
- package/dist/components/types.d.ts +106 -0
- package/dist/components/types.js +0 -0
- package/dist/components.d.ts +29 -5
- package/dist/components.js +28 -5
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/core/BlobTransport.d.ts +5 -0
- package/dist/core/BlobTransport.js +79 -0
- package/dist/core/Client.d.ts +3 -5
- package/dist/core/Client.js +22 -19
- package/dist/core/Config.d.ts +26 -3
- package/dist/core/Config.js +24 -2
- package/dist/core/Connection.d.ts +29 -10
- package/dist/core/Connection.js +17 -0
- package/dist/core/Document.d.ts +2 -2
- package/dist/core/Document.js +15 -3
- package/dist/core/Entry.d.ts +9 -0
- package/dist/core/Entry.js +14 -0
- package/dist/core/EntryFields.d.ts +5 -0
- package/dist/core/EntrySeed.d.ts +23 -0
- package/dist/core/EntrySeed.js +135 -0
- package/dist/core/Expr.d.ts +11 -0
- package/dist/core/Field.d.ts +28 -1
- package/dist/core/Field.js +23 -0
- package/dist/core/Filter.d.ts +53 -2
- package/dist/core/Filter.js +145 -0
- package/dist/core/Graph.d.ts +35 -13
- package/dist/core/Id.d.ts +1 -0
- package/dist/core/Id.js +8 -0
- package/dist/core/Infer.d.ts +25 -1
- package/dist/core/ListRow.d.ts +3 -0
- package/dist/core/ListRow.js +1 -0
- package/dist/core/OrderBy.d.ts +7 -3
- package/dist/core/Overview.d.ts +242 -0
- package/dist/core/Overview.js +47 -0
- package/dist/core/Reference.d.ts +1 -0
- package/dist/core/Role.d.ts +6 -0
- package/dist/core/Role.js +17 -14
- package/dist/core/Root.d.ts +18 -2
- package/dist/core/Root.js +11 -3
- package/dist/core/Scope.d.ts +2 -0
- package/dist/core/Scope.js +16 -1
- package/dist/core/TextDoc.d.ts +24 -1
- package/dist/core/TextDoc.js +1 -0
- package/dist/core/Trace.d.ts +8 -0
- package/dist/core/Trace.js +32 -0
- package/dist/core/Type.d.ts +46 -9
- package/dist/core/Type.js +44 -9
- package/dist/core/Validation.d.ts +56 -0
- package/dist/core/Validation.js +121 -0
- package/dist/core/Workspace.d.ts +7 -5
- package/dist/core/Workspace.js +5 -1
- package/dist/core/db/CommitRequest.d.ts +0 -3
- package/dist/core/db/CommitRequest.js +0 -9
- package/dist/core/db/EntryAliases.js +2 -15
- package/dist/core/db/EntryReference.d.ts +8 -7
- package/dist/core/db/EntryUrlConflictError.js +1 -1
- package/dist/core/db/EntryValidationError.d.ts +13 -0
- package/dist/core/db/EntryValidationError.js +23 -0
- package/dist/core/db/IndexEvent.d.ts +2 -1
- package/dist/core/db/IndexEvent.js +11 -3
- package/dist/core/db/LinkResolver.d.ts +13 -7
- package/dist/core/db/LinkResolver.js +0 -30
- package/dist/core/db/LocalStore.d.ts +27 -0
- package/dist/core/db/LocalStore.js +0 -0
- package/dist/core/db/Operation.d.ts +24 -3
- package/dist/core/db/Operation.js +119 -26
- package/dist/core/db/WriteableGraph.d.ts +5 -0
- package/dist/core/field/CreateField.d.ts +1 -1
- package/dist/core/field/ListField.js +44 -8
- package/dist/core/field/RecordField.js +16 -2
- package/dist/core/field/RichTextField.d.ts +30 -3
- package/dist/core/field/RichTextField.js +232 -79
- package/dist/core/field/ScalarField.d.ts +2 -2
- package/dist/core/field/UnionField.js +32 -2
- package/dist/core/media/CompressPdf.browser.d.ts +5 -0
- package/dist/core/media/CompressPdf.browser.js +13 -0
- package/dist/core/media/CompressPdf.d.ts +6 -0
- package/dist/core/media/CompressPdf.js +45 -0
- package/dist/core/media/CreatePreview.browser.d.ts +5 -1
- package/dist/core/media/CreatePreview.browser.js +16 -0
- package/dist/core/media/CreatePreview.d.ts +2 -1
- package/dist/core/media/CreatePreview.js +2 -0
- package/dist/core/media/FileKinds.d.ts +10 -0
- package/dist/core/media/FileKinds.js +25 -0
- package/dist/core/media/ImageTransform.d.ts +78 -0
- package/dist/core/media/ImageTransform.js +108 -0
- package/dist/core/media/MediaAltField.d.ts +1 -0
- package/dist/core/media/MediaAltField.js +9 -1
- package/dist/core/media/MediaLocation.d.ts +11 -14
- package/dist/core/media/MediaLocation.js +31 -22
- package/dist/core/media/MediaRoot.js +2 -0
- package/dist/core/media/MediaTypes.d.ts +14 -10
- package/dist/core/media/MediaTypes.js +167 -32
- package/dist/core/media/Pdf.d.ts +15 -0
- package/dist/core/media/Pdf.js +31 -0
- package/dist/core/media/TransformImage.browser.d.ts +7 -0
- package/dist/core/media/TransformImage.browser.js +38 -0
- package/dist/core/media/TransformImage.d.ts +7 -0
- package/dist/core/media/TransformImage.js +38 -0
- package/dist/core/source/CombinedSource.d.ts +2 -2
- package/dist/core/source/CombinedSource.js +6 -3
- package/dist/core/source/FSSource.d.ts +18 -5
- package/dist/core/source/FSSource.js +114 -37
- package/dist/core/source/GitUtils.d.ts +4 -0
- package/dist/core/source/GitUtils.js +9 -10
- package/dist/core/source/GithubSource.d.ts +2 -2
- package/dist/core/source/GithubSource.js +77 -26
- package/dist/core/source/IndexedDBSource.d.ts +3 -2
- package/dist/core/source/IndexedDBSource.js +70 -54
- package/dist/core/source/MemorySource.d.ts +2 -2
- package/dist/core/source/MemorySource.js +8 -4
- package/dist/core/source/OverlaySource.d.ts +15 -0
- package/dist/core/source/OverlaySource.js +78 -0
- package/dist/core/source/Source.d.ts +8 -2
- package/dist/core/source/Source.js +18 -5
- package/dist/core/source/Tree.d.ts +10 -7
- package/dist/core/source/Tree.js +118 -70
- package/dist/core/source/Utils.js +6 -3
- package/dist/core/text/MarkdownToTextDoc.d.ts +29 -0
- package/dist/core/text/MarkdownToTextDoc.js +524 -0
- package/dist/core/text/TextDocToMarkdown.d.ts +20 -0
- package/dist/core/text/TextDocToMarkdown.js +316 -0
- package/dist/core/util/Arrays.d.ts +1 -0
- package/dist/core/util/Arrays.js +10 -0
- package/dist/core/util/Async.d.ts +15 -2
- package/dist/core/util/Async.js +82 -0
- package/dist/core/util/Checks.js +1 -1
- package/dist/core/util/EntryFilenames.d.ts +24 -3
- package/dist/core/util/EntryFilenames.js +59 -5
- package/dist/core/util/IndexedDB.d.ts +4 -0
- package/dist/core/util/IndexedDB.js +20 -0
- package/dist/core/util/Objects.d.ts +2 -0
- package/dist/core/util/Objects.js +7 -0
- package/dist/core/util/OrderKeys.d.ts +11 -0
- package/dist/core/util/OrderKeys.js +64 -0
- package/dist/core/util/Paths.js +5 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +8 -1
- package/dist/dashboard/App.css +202 -76
- package/dist/dashboard/App.d.ts +3 -0
- package/dist/dashboard/App.js +55 -31
- package/dist/dashboard/StoryProvider.js +2 -2
- package/dist/dashboard/ViewKeys.d.ts +2 -0
- package/dist/dashboard/ViewKeys.js +2 -0
- package/dist/dashboard/app/AccessDenied.d.ts +16 -1
- package/dist/dashboard/app/AccessDenied.js +42 -25
- package/dist/dashboard/app/ActivityStatus.d.ts +5 -4
- package/dist/dashboard/app/ActivityStatus.js +124 -167
- package/dist/dashboard/app/AppearanceToggle.d.ts +1 -0
- package/dist/dashboard/app/AppearanceToggle.js +62 -0
- package/dist/dashboard/app/AuthView.d.ts +1 -1
- package/dist/dashboard/app/AuthView.js +78 -68
- package/dist/dashboard/app/CompactField.d.ts +19 -6
- package/dist/dashboard/app/CompactField.js +174 -48
- package/dist/dashboard/app/CroppedImage.d.ts +17 -0
- package/dist/dashboard/app/CroppedImage.js +73 -0
- package/dist/dashboard/app/DashboardErrorBoundary.js +43 -19
- package/dist/dashboard/app/DashboardLayout.d.ts +4 -2
- package/dist/dashboard/app/DashboardLayout.js +53 -34
- package/dist/dashboard/app/DashboardMeta.d.ts +2 -1
- package/dist/dashboard/app/DashboardMeta.js +20 -5
- package/dist/dashboard/app/DeleteDialog.d.ts +11 -0
- package/dist/dashboard/app/DeleteDialog.js +249 -0
- package/dist/dashboard/app/EntryFields.d.ts +12 -10
- package/dist/dashboard/app/EntryFields.js +13 -21
- package/dist/dashboard/app/EntryHeader.d.ts +2 -2
- package/dist/dashboard/app/EntryHeader.js +322 -217
- package/dist/dashboard/app/EntryHeaderActions.d.ts +24 -4
- package/dist/dashboard/app/EntryHeaderActions.js +46 -29
- package/dist/dashboard/app/EntryReferences.d.ts +13 -1
- package/dist/dashboard/app/EntryReferences.js +65 -63
- package/dist/dashboard/app/EntrySidebar.d.ts +8 -6
- package/dist/dashboard/app/EntrySidebar.js +111 -92
- package/dist/dashboard/app/EntrySidebarPreview.d.ts +5 -2
- package/dist/dashboard/app/EntrySidebarPreview.js +92 -129
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
- package/dist/dashboard/app/EntrySidebarToggle.js +5 -6
- package/dist/dashboard/app/EntryTranslationBanner.d.ts +3 -1
- package/dist/dashboard/app/EntryTranslationBanner.js +40 -45
- package/dist/dashboard/app/EntryValidationModal.d.ts +12 -0
- package/dist/dashboard/app/EntryValidationModal.js +77 -0
- package/dist/dashboard/app/Explorer.d.ts +15 -6
- package/dist/dashboard/app/Explorer.js +319 -340
- package/dist/dashboard/app/ExplorerBatchActions.d.ts +17 -0
- package/dist/dashboard/app/ExplorerBatchActions.js +158 -0
- package/dist/dashboard/app/ExplorerCards.d.ts +8 -3
- package/dist/dashboard/app/ExplorerCards.js +106 -314
- package/dist/dashboard/app/ExplorerControls.d.ts +20 -0
- package/dist/dashboard/app/ExplorerControls.js +170 -0
- package/dist/dashboard/app/ExplorerList.d.ts +7 -4
- package/dist/dashboard/app/ExplorerList.js +165 -101
- package/dist/dashboard/app/ExplorerModal.d.ts +2 -5
- package/dist/dashboard/app/ExplorerModal.js +6 -18
- package/dist/dashboard/app/ExplorerPickerContent.d.ts +19 -3
- package/dist/dashboard/app/ExplorerPickerContent.js +74 -6
- package/dist/dashboard/app/ExplorerTable.d.ts +8 -4
- package/dist/dashboard/app/ExplorerTable.js +175 -372
- package/dist/dashboard/app/ExternalLinkPicker.js +49 -48
- package/dist/dashboard/app/FileKind.d.ts +8 -0
- package/dist/dashboard/app/FileKind.js +40 -0
- package/dist/dashboard/app/ImageEditor.d.ts +13 -0
- package/dist/dashboard/app/ImageEditor.js +302 -0
- package/dist/dashboard/app/ImageEditorCrop.d.ts +19 -0
- package/dist/dashboard/app/ImageEditorCrop.js +90 -0
- package/dist/dashboard/app/ImagePicker.d.ts +1 -1
- package/dist/dashboard/app/ImagePicker.js +36 -86
- package/dist/dashboard/app/LinkPicker.d.ts +1 -1
- package/dist/dashboard/app/LinkPicker.js +123 -127
- package/dist/dashboard/app/LocaleMenu.d.ts +10 -1
- package/dist/dashboard/app/LocaleMenu.js +78 -53
- package/dist/dashboard/app/MediaPreviewCell.d.ts +8 -0
- package/dist/dashboard/app/MediaPreviewCell.js +50 -0
- package/dist/dashboard/app/MoveDialog.d.ts +10 -0
- package/dist/dashboard/app/MoveDialog.js +161 -0
- package/dist/dashboard/app/NodeEditor.d.ts +11 -0
- package/dist/dashboard/app/NodeEditor.js +13 -0
- package/dist/dashboard/app/OverviewCell.d.ts +15 -0
- package/dist/dashboard/app/OverviewCell.js +251 -0
- package/dist/dashboard/app/PendingUploadsDialog.d.ts +2 -0
- package/dist/dashboard/app/PendingUploadsDialog.js +49 -0
- package/dist/dashboard/app/PendingUploadsView.d.ts +19 -0
- package/dist/dashboard/app/PendingUploadsView.js +209 -0
- package/dist/dashboard/app/ReadOnlyBadge.d.ts +4 -0
- package/dist/dashboard/app/ReadOnlyBadge.js +33 -0
- package/dist/dashboard/app/SidebarLayout.d.ts +9 -0
- package/dist/dashboard/app/SidebarLayout.js +64 -0
- package/dist/dashboard/app/SidebarTree.d.ts +14 -11
- package/dist/dashboard/app/SidebarTree.js +267 -262
- package/dist/dashboard/app/ViewToggle.d.ts +1 -1
- package/dist/dashboard/app/ViewToggle.js +17 -10
- package/dist/dashboard/app/WorkspaceMenu.d.ts +11 -5
- package/dist/dashboard/app/WorkspaceMenu.js +125 -139
- package/dist/dashboard/app/WorkspaceRoots.d.ts +1 -1
- package/dist/dashboard/app/WorkspaceRoots.js +130 -187
- package/dist/dashboard/app/editor/FileEditor.d.ts +3 -3
- package/dist/dashboard/app/editor/FileEditor.js +129 -117
- package/dist/dashboard/app/editor/FilePreview.d.ts +5 -6
- package/dist/dashboard/app/editor/FilePreview.js +14 -139
- package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
- package/dist/dashboard/app/editor/MediaAltField.view.js +14 -17
- package/dist/dashboard/app/modals/CreateEntry.js +109 -117
- package/dist/dashboard/app/pages/EntryPage.js +178 -91
- package/dist/dashboard/app/pages/RootPage.js +8 -10
- package/dist/dashboard/app/pages/SplashPage.d.ts +22 -0
- package/dist/dashboard/app/pages/SplashPage.js +414 -0
- package/dist/dashboard/app/pages/UsersPage.d.ts +20 -1
- package/dist/dashboard/app/pages/UsersPage.js +187 -260
- package/dist/dashboard/app/ui/DashboardModal.d.ts +18 -12
- package/dist/dashboard/app/ui/DashboardModal.js +56 -72
- package/dist/dashboard/atoms/ReactiveNode.js +59 -20
- package/dist/dashboard/atoms/activity.d.ts +0 -2
- package/dist/dashboard/atoms/activity.js +6 -13
- package/dist/dashboard/atoms/auth.d.ts +2 -0
- package/dist/dashboard/atoms/auth.js +10 -4
- package/dist/dashboard/atoms/config.d.ts +7 -5
- package/dist/dashboard/atoms/config.js +1 -1
- package/dist/dashboard/atoms/core.d.ts +16 -2
- package/dist/dashboard/atoms/core.js +20 -8
- package/dist/dashboard/atoms/create.js +4 -8
- package/dist/dashboard/atoms/dashboard.d.ts +14 -0
- package/dist/dashboard/atoms/dashboard.js +23 -3
- package/dist/dashboard/atoms/delete.d.ts +68 -0
- package/dist/dashboard/atoms/delete.js +143 -0
- package/dist/dashboard/atoms/editor.d.ts +8 -1
- package/dist/dashboard/atoms/editor.js +22 -35
- package/dist/dashboard/atoms/entry.d.ts +80 -52
- package/dist/dashboard/atoms/entry.js +425 -118
- package/dist/dashboard/atoms/entryTable.d.ts +10 -0
- package/dist/dashboard/atoms/entryTable.js +41 -0
- package/dist/dashboard/atoms/explorer.d.ts +164 -38
- package/dist/dashboard/atoms/explorer.js +540 -248
- package/dist/dashboard/atoms/graph.d.ts +1 -0
- package/dist/dashboard/atoms/graph.js +7 -2
- package/dist/dashboard/atoms/link.d.ts +1 -1
- package/dist/dashboard/atoms/link.js +41 -57
- package/dist/dashboard/atoms/move.d.ts +59 -0
- package/dist/dashboard/atoms/move.js +103 -0
- package/dist/dashboard/atoms/nav.d.ts +19 -4
- package/dist/dashboard/atoms/nav.js +107 -18
- package/dist/dashboard/atoms/overview.d.ts +203 -0
- package/dist/dashboard/atoms/overview.js +503 -0
- package/dist/dashboard/atoms/preview.d.ts +3 -0
- package/dist/dashboard/atoms/preview.js +19 -2
- package/dist/dashboard/atoms/root.d.ts +41 -22
- package/dist/dashboard/atoms/root.js +316 -266
- package/dist/dashboard/atoms/upload.d.ts +92 -3
- package/dist/dashboard/atoms/upload.js +245 -13
- package/dist/dashboard/atoms/user.d.ts +1 -1
- package/dist/dashboard/atoms/user.js +8 -6
- package/dist/dashboard/atoms/utils.d.ts +12 -4
- package/dist/dashboard/atoms/utils.js +36 -3
- package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
- package/dist/dashboard/boot/Boot.d.ts +2 -0
- package/dist/dashboard/boot/Boot.js +13 -13
- package/dist/dashboard/boot/BootDev.js +13 -10
- package/dist/dashboard/boot/BootProd.js +1 -0
- package/dist/dashboard/boot/DashboardWorker.d.ts +3 -3
- package/dist/dashboard/boot/DashboardWorker.js +115 -80
- package/dist/dashboard/boot/LoadWorker.js +3 -4
- package/dist/dashboard/boot/WorkerDB.d.ts +2 -2
- package/dist/dashboard/cms/EntryTable.d.ts +55 -0
- package/dist/dashboard/cms/EntryTable.js +265 -0
- package/dist/dashboard/cms/FieldChrome.d.ts +21 -0
- package/dist/dashboard/cms/FieldChrome.js +26 -0
- package/dist/dashboard/cms/ViewProps.d.ts +41 -0
- package/dist/dashboard/cms/ViewProps.js +0 -0
- package/dist/dashboard/cms/hooks.d.ts +104 -0
- package/dist/dashboard/cms/hooks.js +107 -0
- package/dist/dashboard/contexts.d.ts +58 -0
- package/dist/dashboard/contexts.js +42 -0
- package/dist/dashboard/editor/UseField.d.ts +29 -6
- package/dist/dashboard/editor/UseField.js +6 -6
- package/dist/dashboard/fixture/cms.d.ts +14 -2
- package/dist/dashboard/fixture/cms.js +54 -6
- package/dist/dashboard/hook/UseEntryEditor.d.ts +3 -0
- package/dist/dashboard/hook/UseGraph.d.ts +3 -1
- package/dist/dashboard/hook/UseGraph.js +4 -4
- package/dist/dashboard/hook/UseLocale.d.ts +3 -1
- package/dist/dashboard/hook/UseRoot.d.ts +3 -1
- package/dist/dashboard/hook/UseRoot.js +4 -4
- package/dist/dashboard/hook/UseSaveShortcut.d.ts +1 -0
- package/dist/dashboard/hook/UseSaveShortcut.js +24 -0
- package/dist/dashboard/hook/UseSearchShortcut.d.ts +11 -0
- package/dist/dashboard/hook/UseSearchShortcut.js +32 -0
- package/dist/dashboard/hook/UseWorkspace.d.ts +3 -1
- package/dist/dashboard/hooks.d.ts +20 -100
- package/dist/dashboard/hooks.js +39 -101
- package/dist/dashboard/icons.d.ts +12 -0
- package/dist/dashboard/icons.js +140 -0
- package/dist/dashboard/plugins/alineaFixturePlugin.js +14 -3
- package/dist/dashboard.d.ts +23 -1
- package/dist/dashboard.js +5 -2
- package/dist/database/BrowserEntryStore.d.ts +47 -0
- package/dist/database/BrowserEntryStore.js +190 -0
- package/dist/database/DatabaseSource.d.ts +13 -0
- package/dist/database/DatabaseSource.js +25 -0
- package/dist/database/DatabaseTables.d.ts +38 -0
- package/dist/database/DatabaseTables.js +53 -0
- package/dist/database/EntryDatabase.d.ts +97 -0
- package/dist/database/EntryDatabase.js +532 -0
- package/dist/database/EntryStore.d.ts +58 -0
- package/dist/database/EntryStore.js +230 -0
- package/dist/database/EntryTransaction.d.ts +28 -0
- package/dist/database/EntryTransaction.js +1041 -0
- package/dist/database/EntryUrlAliases.d.ts +2 -0
- package/dist/database/EntryUrlAliases.js +69 -0
- package/dist/database/LocalDB.d.ts +39 -0
- package/dist/database/LocalDB.js +79 -0
- package/dist/database/Version.d.ts +9 -0
- package/dist/database/Version.js +13 -0
- package/dist/database/driver/DatabaseHandle.d.ts +17 -0
- package/dist/database/driver/DatabaseHandle.js +0 -0
- package/dist/database/driver/OverlayExtension.browser.d.ts +2 -0
- package/dist/database/driver/OverlayExtension.browser.js +9 -0
- package/dist/database/driver/OverlayExtension.d.ts +1 -0
- package/dist/database/driver/OverlayExtension.js +7 -0
- package/dist/database/driver/RuntimeDatabase.d.ts +13 -0
- package/dist/database/driver/RuntimeDatabase.js +77 -0
- package/dist/database/driver/WasmDatabase.d.ts +29 -0
- package/dist/database/driver/WasmDatabase.js +48 -0
- package/dist/database/entry/EntryData.d.ts +13 -0
- package/dist/database/entry/EntryData.js +51 -0
- package/dist/database/entry/EntryTable.d.ts +189 -0
- package/dist/database/entry/EntryTable.js +193 -0
- package/dist/database/query/Condition.d.ts +13 -0
- package/dist/database/query/Condition.js +125 -0
- package/dist/database/query/EntryQuery.d.ts +48 -0
- package/dist/database/query/EntryQuery.js +446 -0
- package/dist/database/query/EntryReferences.d.ts +5 -0
- package/dist/database/query/EntryReferences.js +71 -0
- package/dist/database/query/Relation.d.ts +11 -0
- package/dist/database/query/Relation.js +123 -0
- package/dist/database/query/ResolveQuery.d.ts +12 -0
- package/dist/database/query/ResolveQuery.js +191 -0
- package/dist/database/query/Search.d.ts +41 -0
- package/dist/database/query/Search.js +177 -0
- package/dist/database/sync/Derive.d.ts +8 -0
- package/dist/database/sync/Derive.js +274 -0
- package/dist/database/sync/EntryParser.d.ts +8 -0
- package/dist/database/sync/EntryParser.js +91 -0
- package/dist/database/sync/EntrySyncer.d.ts +25 -0
- package/dist/database/sync/EntrySyncer.js +89 -0
- package/dist/database/sync/Ingest.d.ts +21 -0
- package/dist/database/sync/Ingest.js +146 -0
- package/dist/database/sync/SyncQueries.d.ts +161 -0
- package/dist/database/sync/SyncQueries.js +216 -0
- package/dist/field/check/CheckField.js +3 -1
- package/dist/field/check/CheckField.view.js +10 -9
- package/dist/field/code/CodeField.d.ts +9 -0
- package/dist/field/code/CodeField.view.d.ts +3 -1
- package/dist/field/code/CodeField.view.js +28 -19
- package/dist/field/code/SimpleCodeEditor.js +0 -18
- package/dist/field/date/DateField.view.js +7 -13
- package/dist/field/link/EntryLink.d.ts +1 -1
- package/dist/field/link/EntryLink.js +1 -0
- package/dist/field/link/FileLink.d.ts +5 -2
- package/dist/field/link/FileLink.js +3 -7
- package/dist/field/link/ImageLink.d.ts +4 -1
- package/dist/field/link/ImageLink.js +3 -4
- package/dist/field/link/Link.js +3 -2
- package/dist/field/link/LinkField.d.ts +10 -5
- package/dist/field/link/LinkField.js +25 -0
- package/dist/field/link/LinkField.view.js +499 -497
- package/dist/field/link/UrlLink.d.ts +1 -0
- package/dist/field/link.d.ts +1 -0
- package/dist/field/list/ListField.d.ts +10 -4
- package/dist/field/list/ListField.js +10 -5
- package/dist/field/list/ListField.view.js +377 -548
- package/dist/field/localiser/LocalisedField.view.js +19 -19
- package/dist/field/localiser/LocalisedFieldTab.d.ts +7 -0
- package/dist/field/localiser/LocalisedFieldTab.js +30 -0
- package/dist/field/localiser/LocalisedFieldTabs.js +5 -5
- package/dist/field/localiser/Localiser.js +25 -7
- package/dist/field/localiser/SelectLocale.d.ts +5 -0
- package/dist/field/localiser/SelectLocale.js +12 -0
- package/dist/field/metadata/MetadataAudit.d.ts +39 -0
- package/dist/field/metadata/MetadataAudit.js +124 -0
- package/dist/field/metadata/MetadataField.d.ts +30 -23
- package/dist/field/metadata/MetadataField.js +48 -104
- package/dist/field/metadata/MetadataField.view.d.ts +5 -0
- package/dist/field/metadata/MetadataField.view.js +51 -35
- package/dist/field/number/NumberField.d.ts +2 -0
- package/dist/field/number/NumberField.view.js +10 -9
- package/dist/field/object/ObjectField.view.js +15 -19
- package/dist/field/path/PathField.view.js +3 -3
- package/dist/field/path/SlugField.d.ts +1 -2
- package/dist/field/path/SlugField.js +5 -7
- package/dist/field/richtext/PickTextAnchor.js +10 -10
- package/dist/field/richtext/PickTextLink.d.ts +10 -1
- package/dist/field/richtext/PickTextLink.js +125 -22
- package/dist/field/richtext/ReferenceLink.d.ts +6 -1
- package/dist/field/richtext/ReferenceLink.js +23 -4
- package/dist/field/richtext/RichTextBlock.js +51 -46
- package/dist/field/richtext/RichTextBlocks.js +1 -1
- package/dist/field/richtext/RichTextDocument.d.ts +7 -2
- package/dist/field/richtext/RichTextDocument.js +43 -6
- package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
- package/dist/field/richtext/RichTextExtensions.js +2745 -7498
- package/dist/field/richtext/RichTextField.d.ts +7 -0
- package/dist/field/richtext/RichTextField.story.d.ts +4 -0
- package/dist/field/richtext/RichTextField.view.js +66 -34
- package/dist/field/richtext/RichTextInsertMenu.js +304 -525
- package/dist/field/richtext/RichTextState.js +1 -1
- package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
- package/dist/field/richtext/RichTextToolbar.js +95 -37
- package/dist/field/richtext/Toolbar.d.ts +19 -1
- package/dist/field/richtext/Toolbar.js +18 -13
- package/dist/field/richtext/extensions/Anchor.js +1 -1
- package/dist/field/richtext/extensions/Link.d.ts +1 -0
- package/dist/field/richtext/extensions/Link.js +2 -1
- package/dist/field/richtext/extensions/Small.js +1 -1
- package/dist/field/richtext.d.ts +2 -0
- package/dist/field/richtext.js +2 -0
- package/dist/field/select/SelectField.view.js +20 -83
- package/dist/field/tabs/Tabs.view.js +8 -8
- package/dist/field/text/TextField.view.js +11 -10
- package/dist/field/time/TimeField.d.ts +0 -2
- package/dist/field/time/TimeField.view.js +10 -18
- package/dist/field/views.js +4 -0
- package/dist/field.d.ts +1 -1
- package/dist/field.js +1 -1
- package/dist/index.css +5434 -4984
- package/dist/next.cjs +118 -46
- package/dist/next.d.ts +4 -2
- package/dist/next.edge.d.ts +3 -2
- package/dist/next.js +1 -2
- package/dist/picker/entry/EntryPicker.d.ts +7 -3
- package/dist/picker/entry/EntryPicker.js +18 -45
- package/dist/picker/entry/EntryReference.d.ts +2 -0
- package/dist/picker/entry/EntryReference.js +1 -0
- package/dist/picker/url/UrlPicker.js +1 -0
- package/dist/preview/PreviewMessage.d.ts +3 -0
- package/dist/preview/PreviewMessage.js +1 -0
- package/dist/preview/PreviewPayload.js +35 -250
- package/dist/preview/RegisterPreview.d.ts +1 -1
- package/dist/preview/RegisterPreview.js +28 -10
- package/dist/preview/react.d.ts +5 -1
- package/dist/preview/react.js +12 -9
- package/dist/preview/widget.d.ts +45 -0
- package/dist/preview/widget.js +100 -11
- package/dist/query.d.ts +16 -225
- package/dist/types.d.ts +6 -3
- package/dist/ui/RichText.d.ts +1 -0
- package/dist/ui/RichText.js +62 -20
- package/docs/ai-agents.md +316 -0
- package/docs/ai-setup.md +297 -0
- package/docs/cli.md +94 -0
- package/docs/components/alert.md +122 -0
- package/docs/components/app-shell.md +77 -0
- package/docs/components/badge.md +88 -0
- package/docs/components/blockquote.md +24 -0
- package/docs/components/breadcrumb.md +83 -0
- package/docs/components/button.md +141 -0
- package/docs/components/calendar.md +32 -0
- package/docs/components/checkbox-group.md +38 -0
- package/docs/components/checkbox.md +61 -0
- package/docs/components/code.md +37 -0
- package/docs/components/collapsible.md +53 -0
- package/docs/components/color-swatch-picker.md +47 -0
- package/docs/components/combo-box.md +57 -0
- package/docs/components/command.md +101 -0
- package/docs/components/content-card.md +63 -0
- package/docs/components/content-grid.md +71 -0
- package/docs/components/data-list.md +64 -0
- package/docs/components/date-field.md +34 -0
- package/docs/components/date-picker.md +35 -0
- package/docs/components/date-range-picker.md +34 -0
- package/docs/components/dialog.md +182 -0
- package/docs/components/drop-zone.md +45 -0
- package/docs/components/dropdown-menu.md +223 -0
- package/docs/components/empty.md +81 -0
- package/docs/components/field.md +66 -0
- package/docs/components/file-trigger.md +33 -0
- package/docs/components/fold-icon.md +34 -0
- package/docs/components/heading.md +33 -0
- package/docs/components/icon.md +43 -0
- package/docs/components/kbd.md +29 -0
- package/docs/components/link.md +35 -0
- package/docs/components/list.md +104 -0
- package/docs/components/media-preview.md +43 -0
- package/docs/components/multiple-select.md +56 -0
- package/docs/components/nav-rail.md +79 -0
- package/docs/components/number-field.md +49 -0
- package/docs/components/page.md +97 -0
- package/docs/components/popover.md +71 -0
- package/docs/components/preview-frame.md +63 -0
- package/docs/components/radio-group.md +47 -0
- package/docs/components/resizable-panel-group.md +63 -0
- package/docs/components/search-field.md +53 -0
- package/docs/components/select.md +138 -0
- package/docs/components/sidebar.md +104 -0
- package/docs/components/sortable-list.md +125 -0
- package/docs/components/spinner.md +29 -0
- package/docs/components/surface.md +54 -0
- package/docs/components/switch.md +52 -0
- package/docs/components/table.md +178 -0
- package/docs/components/tabs.md +120 -0
- package/docs/components/tag-group.md +56 -0
- package/docs/components/text-field.md +134 -0
- package/docs/components/text.md +44 -0
- package/docs/components/time-field.md +37 -0
- package/docs/components/timestamp.md +45 -0
- package/docs/components/toggle-group.md +46 -0
- package/docs/components/toggle.md +37 -0
- package/docs/components/toolbar.md +96 -0
- package/docs/components/tooltip.md +78 -0
- package/docs/components/tree.md +67 -0
- package/docs/components.md +131 -0
- package/docs/configuration.md +175 -0
- package/docs/content-model.md +87 -0
- package/docs/custom-fields.md +231 -0
- package/docs/dashboard-ui.md +3 -0
- package/docs/deploy/alinea-cloud.md +26 -0
- package/docs/deploy/self-host.md +193 -0
- package/docs/deploy.md +123 -0
- package/docs/editing-content.md +195 -0
- package/docs/fields/check.md +40 -0
- package/docs/fields/code.md +35 -0
- package/docs/fields/date.md +90 -0
- package/docs/fields/entry.md +179 -0
- package/docs/fields/file.md +60 -0
- package/docs/fields/image.md +139 -0
- package/docs/fields/link.md +121 -0
- package/docs/fields/list.md +126 -0
- package/docs/fields/number.md +58 -0
- package/docs/fields/object.md +91 -0
- package/docs/fields/path.md +105 -0
- package/docs/fields/rich-text.md +236 -0
- package/docs/fields/select.md +99 -0
- package/docs/fields/tabs.md +87 -0
- package/docs/fields/text.md +46 -0
- package/docs/fields/url.md +51 -0
- package/docs/fields.md +231 -0
- package/docs/get-started.md +3 -0
- package/docs/guides.md +3 -0
- package/docs/index.md +138 -0
- package/docs/instant-publishing.md +43 -0
- package/docs/internationalization.md +201 -0
- package/docs/introduction.md +5 -0
- package/docs/live-previews.md +151 -0
- package/docs/mcp.md +500 -0
- package/docs/overviews.md +456 -0
- package/docs/query/advanced.md +123 -0
- package/docs/query/examples.md +231 -0
- package/docs/query/filtering.md +160 -0
- package/docs/query/related.md +129 -0
- package/docs/query/structural.md +164 -0
- package/docs/query.md +139 -0
- package/docs/quickstart.md +203 -0
- package/docs/reference.md +3 -0
- package/docs/roles-permissions.md +234 -0
- package/docs/schema/document.md +98 -0
- package/docs/schema/type.md +131 -0
- package/docs/schema.md +66 -0
- package/docs/tutorial/step-1-landing-page.md +244 -0
- package/docs/tutorial/step-2-block-list.md +364 -0
- package/docs/tutorial/step-3-layout-root.md +200 -0
- package/docs/tutorial/step-4-blog.md +384 -0
- package/docs/tutorial/step-5-catch-all.md +222 -0
- package/docs/tutorial.md +21 -0
- package/docs/typescript.md +115 -0
- package/docs/upgrading.md +286 -0
- package/docs/workspaces/media.md +48 -0
- package/docs/workspaces/root.md +127 -0
- package/docs/workspaces.md +98 -0
- package/llms-full.txt +11973 -3202
- package/package.json +35 -7
- package/readme.md +136 -55
- package/dist/backend/store/GeneratedSource.d.ts +0 -2
- package/dist/backend/store/GeneratedSource.js +0 -21
- package/dist/chunks/chunk-AC4U3IMS.js +0 -205
- package/dist/chunks/chunk-G6E35DMJ.js +0 -1997
- package/dist/chunks/chunk-JFROOUG6.js +0 -6363
- package/dist/chunks/chunk-LUBOGJCG.js +0 -129
- package/dist/chunks/chunk-SJBZFMQ2.js +0 -2966
- package/dist/chunks/chunk-STAJCW4Z.js +0 -322
- package/dist/chunks/chunk-U4VOHNR2.js +0 -210
- package/dist/chunks/chunk-YK3OSMDM.js +0 -5473
- package/dist/cli/util/ExternalPlugin.d.ts +0 -2
- package/dist/cli/util/ExternalPlugin.js +0 -919
- package/dist/components/Disclosure.d.ts +0 -5
- package/dist/components/Disclosure.js +0 -106
- package/dist/components/Label.d.ts +0 -48
- package/dist/components/Label.js +0 -210
- package/dist/components/Menu.d.ts +0 -16
- package/dist/components/Menu.js +0 -95
- package/dist/components/Modal.d.ts +0 -7
- package/dist/components/Modal.js +0 -58
- package/dist/components/ProgressCircle.d.ts +0 -6
- package/dist/components/ProgressCircle.js +0 -96
- package/dist/core/db/EntryDB.d.ts +0 -19
- package/dist/core/db/EntryDB.js +0 -48
- package/dist/core/db/EntryIndex.d.ts +0 -130
- package/dist/core/db/EntryIndex.js +0 -2609
- package/dist/core/db/EntryReferenceIndex.d.ts +0 -21
- package/dist/core/db/EntryReferenceIndex.js +0 -131
- package/dist/core/db/EntryResolver.d.ts +0 -56
- package/dist/core/db/EntryResolver.js +0 -624
- package/dist/core/db/EntryTarget.d.ts +0 -5
- package/dist/core/db/EntryTransaction.d.ts +0 -32
- package/dist/core/db/EntryTransaction.js +0 -946
- package/dist/core/db/LocalDB.d.ts +0 -42
- package/dist/core/db/LocalDB.js +0 -112
- package/dist/core/db/TestDB.d.ts +0 -19
- package/dist/core/db/TestDB.js +0 -50
- package/dist/dashboard/app/AppShell.d.ts +0 -4
- package/dist/dashboard/app/AppShell.js +0 -29
- package/dist/dashboard/app/Badge.d.ts +0 -8
- package/dist/dashboard/app/Badge.js +0 -42
- package/dist/dashboard/app/EditorBackButton.d.ts +0 -5
- package/dist/dashboard/app/EditorBackButton.js +0 -33
- package/dist/dashboard/app/EntrySidebarPreview.spec.d.ts +0 -1
- package/dist/dashboard/app/ExplorerFileCard.d.ts +0 -10
- package/dist/dashboard/app/ExplorerFileCard.js +0 -115
- package/dist/dashboard/app/StatusBadge.d.ts +0 -6
- package/dist/dashboard/app/StatusBadge.js +0 -26
- package/dist/dashboard/app/WorkspaceMenu.spec.d.ts +0 -1
- package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +0 -5
- package/dist/dashboard/app/ui/Rail.d.ts +0 -18
- package/dist/dashboard/app/ui/Rail.js +0 -41
- package/dist/dashboard/app/ui/Sidebar.d.ts +0 -15
- package/dist/dashboard/app/ui/Sidebar.js +0 -55
- package/dist/field/link/LinkField.spec.d.ts +0 -1
- package/dist/field/link/LinkField.stories.d.ts +0 -15
- package/dist/field/list/ListField.spec.d.ts +0 -1
- package/dist/field/list/ListField.stories.d.ts +0 -6
- package/dist/field/richtext/RichTextField.spec.d.ts +0 -1
- /package/dist/{core/db/EntryTarget.js → .init-pm/bun.lock} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FieldSharedProps, StyleProps } from 'alinea/components/types';
|
|
2
|
+
import type { Field } from 'alinea/core/Field';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export interface FieldChromeProps extends FieldSharedProps, StyleProps {
|
|
5
|
+
/** The field whose label, help text, validation error and state to show */
|
|
6
|
+
field: Field;
|
|
7
|
+
/** Id of the control the label describes */
|
|
8
|
+
htmlFor?: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the label, help text, shared badge and validation error of a field
|
|
13
|
+
* around a custom control, like the built-in fields. The values come from the
|
|
14
|
+
* field's options and validation state; pass a prop to override one.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <FieldChrome field={field} htmlFor={id}>
|
|
18
|
+
* <input id={id} type="range" />
|
|
19
|
+
* </FieldChrome>
|
|
20
|
+
*/
|
|
21
|
+
export declare function FieldChrome({ field, children, ...props }: FieldChromeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "../../chunks/chunk-CQ52GEHY.js";
|
|
2
|
+
|
|
3
|
+
// src/dashboard/cms/FieldChrome.tsx
|
|
4
|
+
import { Field as FieldFrame } from "alinea/components/Field";
|
|
5
|
+
import { useFieldError, useFieldOptions } from "../hooks.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function FieldChrome({ field, children, ...props }) {
|
|
8
|
+
const options = useFieldOptions(field);
|
|
9
|
+
const error = useFieldError(field);
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
FieldFrame,
|
|
12
|
+
{
|
|
13
|
+
label: options.label,
|
|
14
|
+
description: options.help,
|
|
15
|
+
error,
|
|
16
|
+
required: options.required,
|
|
17
|
+
readOnly: options.readOnly,
|
|
18
|
+
shared: options.shared,
|
|
19
|
+
...props,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
FieldChrome
|
|
26
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Field } from 'alinea/core/Field';
|
|
2
|
+
import type { RootData } from 'alinea/core/Root';
|
|
3
|
+
import type { Section } from 'alinea/core/Section';
|
|
4
|
+
import type { Type } from 'alinea/core/Type';
|
|
5
|
+
/**
|
|
6
|
+
* Props of the component a field points to with `view`, for example in
|
|
7
|
+
* `Field.create({label, options, view: '@/fields/Range.view'})`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* export default function RangeView({field}: FieldViewProps<RangeField>) {
|
|
11
|
+
* const [value, setValue] = useField(field)
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface FieldViewProps<F extends Field = Field> {
|
|
15
|
+
/** The field being rendered, pass it to the field hooks */
|
|
16
|
+
field: F;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props of the component passed to `Field.view(...)`, rendered between the
|
|
20
|
+
* fields of a type.
|
|
21
|
+
*/
|
|
22
|
+
export interface SectionViewProps {
|
|
23
|
+
/** The section that holds the view */
|
|
24
|
+
section: Section;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props of the component a type points to with `view`. It replaces the
|
|
28
|
+
* default entry editor for entries of that type.
|
|
29
|
+
*/
|
|
30
|
+
export interface TypeViewProps {
|
|
31
|
+
/** The type of the entry being shown */
|
|
32
|
+
type: Type;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Props of the component a root points to with `view`. It replaces the
|
|
36
|
+
* default root overview.
|
|
37
|
+
*/
|
|
38
|
+
export interface RootViewProps {
|
|
39
|
+
/** The configuration of the root, including its `label` */
|
|
40
|
+
root: RootData;
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hooks of custom field and dashboard views, exported from `alinea/cms`.
|
|
3
|
+
* Their types do not expose the internal state of the dashboard.
|
|
4
|
+
*/
|
|
5
|
+
import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
|
|
6
|
+
import type { Entry as EntryRecord } from 'alinea/core/Entry';
|
|
7
|
+
import type { Field } from 'alinea/core/Field';
|
|
8
|
+
import type { PreviewMetadata } from 'alinea/core/Preview';
|
|
9
|
+
import type { Policy } from 'alinea/core/Role';
|
|
10
|
+
import type { User } from 'alinea/core/User';
|
|
11
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* Returns the permissions of the signed-in user. Check access with
|
|
14
|
+
* `policy.get({workspace, root, id, ...})`, which returns flags such as
|
|
15
|
+
* `read`, `update` and `publish`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function usePolicy(): Policy;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the authenticated dashboard user, or null when no user is active.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useUser(): User | null;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the dashboard's content graph. Query it with the same API as the
|
|
24
|
+
* `cms` instance, for example `graph.find({type: Article})`. Changes made
|
|
25
|
+
* through it are committed with the permissions of the signed-in user.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useGraph(): WriteableGraph;
|
|
28
|
+
/**
|
|
29
|
+
* Returns metadata reported by the active browser preview, when available.
|
|
30
|
+
*/
|
|
31
|
+
export declare function usePreviewMetadata(): PreviewMetadata | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the stored value of a field in the entry, list row or object being
|
|
34
|
+
* edited. Use it in a view that only reads the value.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useFieldValue<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): StoredValue;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the stored value of a field and a setter, like `useState`. The
|
|
39
|
+
* setter also accepts an updater function that receives the current value.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const [value, setValue] = useField(field)
|
|
43
|
+
*/
|
|
44
|
+
export declare function useField<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): [StoredValue, Dispatch<SetStateAction<StoredValue>>];
|
|
45
|
+
/**
|
|
46
|
+
* Returns only the setter of a field's stored value, so the component does
|
|
47
|
+
* not re-render when the value changes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useFieldSetter<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Dispatch<SetStateAction<StoredValue>>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the key a field is stored under in the entry, list row or object
|
|
52
|
+
* being edited, for example `'title'`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useFieldKey<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the options of a field with the dashboard state applied: `readOnly`
|
|
57
|
+
* is also `true` when the user may not edit the field or the entry, and
|
|
58
|
+
* `hidden` reflects the user's permissions. Includes the field's `label`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function useFieldOptions<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Options;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the validation message of a field (from `required` or `validate`),
|
|
63
|
+
* or `undefined` while the value is valid.
|
|
64
|
+
*/
|
|
65
|
+
export declare function useFieldError<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the stored value of another field in the same entry, list row or
|
|
68
|
+
* object, by its key.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useSiblingFieldValue(key: string): unknown;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the selected entry version as a plain Entry object.
|
|
73
|
+
*
|
|
74
|
+
* Returns null outside an entry scope, or when the current entry cannot be
|
|
75
|
+
* resolved. The returned value follows locale/status selection and does not
|
|
76
|
+
* expose internal atoms.
|
|
77
|
+
*/
|
|
78
|
+
export declare function useEntry(): EntryRecord<Record<string, unknown>> | null;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the current locale of the dashboard: the locale of the entry being
|
|
81
|
+
* edited, or the selected locale of the current root. `null` for content
|
|
82
|
+
* without translations or outside the dashboard layout.
|
|
83
|
+
*/
|
|
84
|
+
export declare function useLocale(): string | null;
|
|
85
|
+
/** A place in the dashboard to navigate to */
|
|
86
|
+
export interface DashboardLocation {
|
|
87
|
+
/** Name of the workspace */
|
|
88
|
+
workspace: string;
|
|
89
|
+
/** Name of the root */
|
|
90
|
+
root: string;
|
|
91
|
+
/** Id of the entry to open, leave out to open the root */
|
|
92
|
+
entryId?: string;
|
|
93
|
+
/** Locale to open, for roots with translations */
|
|
94
|
+
locale?: string | null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns a function that navigates the dashboard to an entry or root. The
|
|
98
|
+
* user is asked to confirm first when the current entry has unsaved changes.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const navigate = useNavigate()
|
|
102
|
+
* navigate({workspace: entry.workspace, root: entry.root, entryId: entry.id})
|
|
103
|
+
*/
|
|
104
|
+
export declare function useNavigate(): (location: DashboardLocation) => void;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAtomValueRaw,
|
|
3
|
+
useSetAtom
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
6
|
+
import "../../chunks/chunk-CQ52GEHY.js";
|
|
7
|
+
|
|
8
|
+
// src/dashboard/cms/hooks.ts
|
|
9
|
+
import { assert } from "alinea/core/util/Assert";
|
|
10
|
+
import {
|
|
11
|
+
useCallback,
|
|
12
|
+
useContext
|
|
13
|
+
} from "react";
|
|
14
|
+
import { graphAtom } from "../atoms/core.js";
|
|
15
|
+
import { routeAtom } from "../atoms/nav.js";
|
|
16
|
+
import { previewMetadataAtom } from "../atoms/preview.js";
|
|
17
|
+
import { policyAtom, userAtom } from "../atoms/user.js";
|
|
18
|
+
import {
|
|
19
|
+
dashboardContext,
|
|
20
|
+
entryContext,
|
|
21
|
+
useEditor,
|
|
22
|
+
useFieldInfo,
|
|
23
|
+
useFieldNode
|
|
24
|
+
} from "../contexts.js";
|
|
25
|
+
function usePolicy() {
|
|
26
|
+
return useAtomValueRaw(policyAtom);
|
|
27
|
+
}
|
|
28
|
+
function useUser() {
|
|
29
|
+
return useAtomValueRaw(userAtom);
|
|
30
|
+
}
|
|
31
|
+
function useGraph() {
|
|
32
|
+
return useAtomValueRaw(graphAtom);
|
|
33
|
+
}
|
|
34
|
+
function usePreviewMetadata() {
|
|
35
|
+
return useAtomValueRaw(previewMetadataAtom);
|
|
36
|
+
}
|
|
37
|
+
function useFieldValue(field) {
|
|
38
|
+
const node = useFieldNode(field);
|
|
39
|
+
return useAtomValueRaw(node.value);
|
|
40
|
+
}
|
|
41
|
+
function useField(field) {
|
|
42
|
+
const info = useFieldInfo(field);
|
|
43
|
+
const value = useAtomValueRaw(info.value);
|
|
44
|
+
const setValue = useSetAtom(info.value);
|
|
45
|
+
return [value, setValue];
|
|
46
|
+
}
|
|
47
|
+
function useFieldSetter(field) {
|
|
48
|
+
const info = useFieldInfo(field);
|
|
49
|
+
return useSetAtom(info.value);
|
|
50
|
+
}
|
|
51
|
+
function useFieldKey(field) {
|
|
52
|
+
const info = useFieldInfo(field);
|
|
53
|
+
return info.key;
|
|
54
|
+
}
|
|
55
|
+
function useFieldOptions(field) {
|
|
56
|
+
const info = useFieldInfo(field);
|
|
57
|
+
return useAtomValueRaw(info.options);
|
|
58
|
+
}
|
|
59
|
+
function useFieldError(field) {
|
|
60
|
+
const info = useFieldInfo(field);
|
|
61
|
+
return useAtomValueRaw(info.error);
|
|
62
|
+
}
|
|
63
|
+
function useSiblingFieldValue(key) {
|
|
64
|
+
const editor = useEditor();
|
|
65
|
+
const info = editor.field(key);
|
|
66
|
+
assert(info, `Field not found: ${key}`);
|
|
67
|
+
return useAtomValueRaw(info.value);
|
|
68
|
+
}
|
|
69
|
+
function useEntry() {
|
|
70
|
+
const scope = useContext(entryContext);
|
|
71
|
+
return scope?.selectedEntry ?? null;
|
|
72
|
+
}
|
|
73
|
+
function useLocale() {
|
|
74
|
+
const entry = useContext(entryContext);
|
|
75
|
+
const dashboard = useContext(dashboardContext);
|
|
76
|
+
if (entry) return entry.localeData.requestedLocale;
|
|
77
|
+
return dashboard?.page.locale ?? null;
|
|
78
|
+
}
|
|
79
|
+
function useNavigate() {
|
|
80
|
+
const setRoute = useSetAtom(routeAtom);
|
|
81
|
+
return useCallback(
|
|
82
|
+
(location) => setRoute({
|
|
83
|
+
page: "entry",
|
|
84
|
+
workspace: location.workspace,
|
|
85
|
+
root: location.root,
|
|
86
|
+
entry: location.entryId,
|
|
87
|
+
locale: location.locale ?? void 0
|
|
88
|
+
}),
|
|
89
|
+
[setRoute]
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
useEntry,
|
|
94
|
+
useField,
|
|
95
|
+
useFieldError,
|
|
96
|
+
useFieldKey,
|
|
97
|
+
useFieldOptions,
|
|
98
|
+
useFieldSetter,
|
|
99
|
+
useFieldValue,
|
|
100
|
+
useGraph,
|
|
101
|
+
useLocale,
|
|
102
|
+
useNavigate,
|
|
103
|
+
usePolicy,
|
|
104
|
+
usePreviewMetadata,
|
|
105
|
+
useSiblingFieldValue,
|
|
106
|
+
useUser
|
|
107
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts the dashboard hooks read, see `hooks.tsx`
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
import type { Config } from 'alinea/core/Config';
|
|
7
|
+
import type { LocalConnection } from 'alinea/core/Connection';
|
|
8
|
+
import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
|
|
9
|
+
import type { Entry as EntryRecord } from 'alinea/core/Entry';
|
|
10
|
+
import type { Field } from 'alinea/core/Field';
|
|
11
|
+
import type { WorkspaceInternal } from 'alinea/core/Workspace';
|
|
12
|
+
import { type ComponentType } from 'react';
|
|
13
|
+
import type { EditorModel, ResolvedEditorImage } from './atoms/editor.js';
|
|
14
|
+
import type { EntryAtoms, EntryLocaleAtoms } from './atoms/entry.js';
|
|
15
|
+
import type { Page } from './atoms/nav.js';
|
|
16
|
+
import type { ReactiveNode } from './atoms/ReactiveNode.js';
|
|
17
|
+
import type { RootAtoms } from './atoms/root.js';
|
|
18
|
+
export interface EntryContextValue {
|
|
19
|
+
entry: EntryAtoms;
|
|
20
|
+
localeData: EntryLocaleAtoms;
|
|
21
|
+
richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
|
|
22
|
+
selectedEntry: EntryRecord<Record<string, unknown>>;
|
|
23
|
+
}
|
|
24
|
+
export interface DashboardOptions {
|
|
25
|
+
alineaDev?: boolean;
|
|
26
|
+
local?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface Dashboard {
|
|
29
|
+
graph: WriteableGraph;
|
|
30
|
+
config: Config;
|
|
31
|
+
events: EventTarget;
|
|
32
|
+
client: LocalConnection;
|
|
33
|
+
views?: Record<string, ComponentType>;
|
|
34
|
+
options?: DashboardOptions;
|
|
35
|
+
}
|
|
36
|
+
export interface DashboardContextValue {
|
|
37
|
+
page: Page;
|
|
38
|
+
workspace: WorkspaceInternal & {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
root: RootAtoms;
|
|
42
|
+
}
|
|
43
|
+
export declare const entryContext: import("react").Context<EntryContextValue | null>;
|
|
44
|
+
export declare const dashboardContext: import("react").Context<DashboardContextValue | null>;
|
|
45
|
+
export declare const dashboardModelContext: import("react").Context<Dashboard | null>;
|
|
46
|
+
export declare const editorContext: import("react").Context<EditorModel | null>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the active dashboard editor from the nearest editor scope.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useEditor(): EditorModel;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the editor metadata for a field in the active editor scope.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useFieldInfo(field: Field): import("./atoms/editor.js").EditorField;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the reactive node backing a field in the active editor.
|
|
57
|
+
*/
|
|
58
|
+
export declare function useFieldNode<Value>(field: Field): ReactiveNode<Value>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAtomValueRaw
|
|
3
|
+
} from "../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../chunks/chunk-CFNRVI3Y.js";
|
|
5
|
+
import "../chunks/chunk-CQ52GEHY.js";
|
|
6
|
+
|
|
7
|
+
// src/dashboard/contexts.ts
|
|
8
|
+
import { assert } from "alinea/core/util/Assert";
|
|
9
|
+
import { createContext, useContext } from "react";
|
|
10
|
+
var entryContext = createContext(null);
|
|
11
|
+
var dashboardContext = createContext(
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
var dashboardModelContext = createContext(null);
|
|
15
|
+
var editorContext = createContext(null);
|
|
16
|
+
function useEditor() {
|
|
17
|
+
const editor = useContext(editorContext);
|
|
18
|
+
assert(editor, "EntryEditor not found in context");
|
|
19
|
+
return editor;
|
|
20
|
+
}
|
|
21
|
+
function useFieldInfo(field) {
|
|
22
|
+
const editor = useEditor();
|
|
23
|
+
const info = editor.get(field);
|
|
24
|
+
assert(info, "Field info not found in editor");
|
|
25
|
+
return info;
|
|
26
|
+
}
|
|
27
|
+
function useFieldNode(field) {
|
|
28
|
+
const { key } = useFieldInfo(field);
|
|
29
|
+
const editor = useEditor();
|
|
30
|
+
const nodes = useAtomValueRaw(editor.node.nodes);
|
|
31
|
+
assert(nodes[key], `Node not found for field key: ${key}`);
|
|
32
|
+
return nodes[key];
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
dashboardContext,
|
|
36
|
+
dashboardModelContext,
|
|
37
|
+
editorContext,
|
|
38
|
+
entryContext,
|
|
39
|
+
useEditor,
|
|
40
|
+
useFieldInfo,
|
|
41
|
+
useFieldNode
|
|
42
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Field, type FieldOptions } from 'alinea/core/Field';
|
|
2
|
+
/**
|
|
3
|
+
* The result of the deprecated object-returning `useField`.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Use the tuple `useField` from 'alinea/cms'.
|
|
6
|
+
*/
|
|
2
7
|
export interface UseFieldResult<StoredValue, Mutator, Options> {
|
|
3
8
|
fieldKey: string;
|
|
4
9
|
label: string;
|
|
@@ -8,26 +13,44 @@ export interface UseFieldResult<StoredValue, Mutator, Options> {
|
|
|
8
13
|
error: string | undefined;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
16
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
17
|
+
* Also accepts the field's key instead of the field.
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Use the tuple `useField` from 'alinea/cms' (`const [value, setValue] = useField(field)`) with `useFieldOptions` and `useFieldError`.
|
|
12
20
|
*/
|
|
13
21
|
export declare function useField<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): UseFieldResult<StoredValue, Mutator, Options>;
|
|
14
22
|
/**
|
|
15
|
-
*
|
|
23
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
24
|
+
* Also accepts the field's key instead of the field.
|
|
25
|
+
*
|
|
26
|
+
* @deprecated Use `useFieldKey` from 'alinea/cms'.
|
|
16
27
|
*/
|
|
17
28
|
export declare function useFieldKey<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): string;
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
30
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
31
|
+
* Also accepts the field's key instead of the field.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Use `useFieldOptions` from 'alinea/cms'.
|
|
20
34
|
*/
|
|
21
35
|
export declare function useFieldOptions<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): Options & FieldOptions<StoredValue>;
|
|
22
36
|
/**
|
|
23
|
-
*
|
|
37
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
38
|
+
* Also accepts the field's key instead of the field.
|
|
39
|
+
*
|
|
40
|
+
* @deprecated Use `useFieldError` from 'alinea/cms'.
|
|
24
41
|
*/
|
|
25
42
|
export declare function useFieldError<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): string | undefined;
|
|
26
43
|
/**
|
|
27
|
-
*
|
|
44
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
45
|
+
* Also accepts the field's key instead of the field.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated Use `useFieldValue` from 'alinea/cms'.
|
|
28
48
|
*/
|
|
29
49
|
export declare function useFieldValue<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): StoredValue;
|
|
30
50
|
/**
|
|
31
|
-
*
|
|
51
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
52
|
+
* Also accepts the field's key instead of the field.
|
|
53
|
+
*
|
|
54
|
+
* @deprecated Use `useFieldSetter` from 'alinea/cms'.
|
|
32
55
|
*/
|
|
33
56
|
export declare function useFieldMutator<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): Mutator;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
3
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
6
6
|
import "../../chunks/chunk-CQ52GEHY.js";
|
|
7
7
|
|
|
8
8
|
// src/dashboard/editor/UseField.ts
|
|
@@ -36,15 +36,15 @@ function useFieldKey(field) {
|
|
|
36
36
|
}
|
|
37
37
|
function useFieldOptions(field) {
|
|
38
38
|
const info = useFieldInfo(field);
|
|
39
|
-
return
|
|
39
|
+
return useAtomValueRaw(info.options);
|
|
40
40
|
}
|
|
41
41
|
function useFieldError(field) {
|
|
42
42
|
const info = useFieldInfo(field);
|
|
43
|
-
return
|
|
43
|
+
return useAtomValueRaw(info.error);
|
|
44
44
|
}
|
|
45
45
|
function useFieldValue(field) {
|
|
46
46
|
const info = useFieldInfo(field);
|
|
47
|
-
return
|
|
47
|
+
return useAtomValueRaw(info.value);
|
|
48
48
|
}
|
|
49
49
|
function useFieldMutator(field) {
|
|
50
50
|
const info = useFieldInfo(field);
|
|
@@ -73,12 +73,12 @@ export declare const cms: import("../../adapter/core/cms.js").CoreCMS<{
|
|
|
73
73
|
heading: string;
|
|
74
74
|
text: string;
|
|
75
75
|
snippet: string;
|
|
76
|
-
} & import("
|
|
76
|
+
} & import("alinea").ListRow, {
|
|
77
77
|
_type: "callout";
|
|
78
78
|
heading: string;
|
|
79
79
|
text: string;
|
|
80
80
|
snippet: string;
|
|
81
|
-
} & import("
|
|
81
|
+
} & import("alinea").ListRow, import("../../field/list.js").ListOptions<{
|
|
82
82
|
callout: import("alinea").Type<{
|
|
83
83
|
heading: import("../../field/text.js").TextField;
|
|
84
84
|
text: import("../../field/text.js").TextField;
|
|
@@ -112,5 +112,17 @@ export declare const cms: import("../../adapter/core/cms.js").CoreCMS<{
|
|
|
112
112
|
pages: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
113
113
|
media: import("../../core/media/MediaRoot.js").MediaRoot<import("../../core/Root.js").ChildrenDefinition>;
|
|
114
114
|
}>;
|
|
115
|
+
manyRoots: import("alinea").Workspace<{
|
|
116
|
+
pages: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
117
|
+
articles: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
118
|
+
documentation: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
119
|
+
campaigns: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
120
|
+
translations: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
121
|
+
archive: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
122
|
+
settings: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
123
|
+
brandAssets: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
124
|
+
nestedContent: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
|
|
125
|
+
media: import("../../core/media/MediaRoot.js").MediaRoot<import("../../core/Root.js").ChildrenDefinition>;
|
|
126
|
+
}>;
|
|
115
127
|
};
|
|
116
128
|
}>;
|
|
@@ -4,10 +4,17 @@ import "../../chunks/chunk-CQ52GEHY.js";
|
|
|
4
4
|
import { createCMS } from "alinea/core";
|
|
5
5
|
import { Config, Field } from "alinea/index";
|
|
6
6
|
import {
|
|
7
|
+
IcOutlineFolder,
|
|
7
8
|
IcOutlineGridView,
|
|
9
|
+
IcOutlineSettings,
|
|
10
|
+
IcRoundDescription,
|
|
8
11
|
IcRoundHistory,
|
|
12
|
+
IcRoundImage,
|
|
13
|
+
IcRoundLanguage,
|
|
14
|
+
IcRoundPublic,
|
|
9
15
|
IcRoundTranslate,
|
|
10
|
-
MiLayers
|
|
16
|
+
MiLayers,
|
|
17
|
+
LucideFolder
|
|
11
18
|
} from "../icons.js";
|
|
12
19
|
var Page = Config.document("Page", {
|
|
13
20
|
contains: ["Page", "Folder"],
|
|
@@ -116,10 +123,7 @@ var Page = Config.document("Page", {
|
|
|
116
123
|
publishDate: Field.date("Publish date", {
|
|
117
124
|
width: 1 / 3
|
|
118
125
|
}),
|
|
119
|
-
publishTime: Field.time("Publish time", {
|
|
120
|
-
width: 1 / 3,
|
|
121
|
-
step: 900
|
|
122
|
-
}),
|
|
126
|
+
publishTime: Field.time("Publish time", { width: 1 / 3 }),
|
|
123
127
|
relatedLink: Field.link("Related link"),
|
|
124
128
|
resources: Field.link.multiple("Resources"),
|
|
125
129
|
inner: Field.object("Testje", {
|
|
@@ -214,6 +218,49 @@ var statuses = Config.workspace("Statuses", {
|
|
|
214
218
|
media: Config.media()
|
|
215
219
|
}
|
|
216
220
|
});
|
|
221
|
+
var manyRoots = Config.workspace("Many roots", {
|
|
222
|
+
source: "content/manyRoots",
|
|
223
|
+
icon: LucideFolder,
|
|
224
|
+
roots: {
|
|
225
|
+
pages: Config.root("Pages", {
|
|
226
|
+
contains: ["Page", "Folder"],
|
|
227
|
+
openByDefault: true
|
|
228
|
+
}),
|
|
229
|
+
articles: Config.root("Articles", {
|
|
230
|
+
contains: ["Page", "Folder"],
|
|
231
|
+
icon: IcRoundDescription
|
|
232
|
+
}),
|
|
233
|
+
documentation: Config.root("Documentation", {
|
|
234
|
+
contains: ["Page", "Folder"],
|
|
235
|
+
icon: IcOutlineFolder
|
|
236
|
+
}),
|
|
237
|
+
campaigns: Config.root("Campaigns", {
|
|
238
|
+
contains: ["Page", "Folder"],
|
|
239
|
+
icon: IcRoundPublic
|
|
240
|
+
}),
|
|
241
|
+
translations: Config.root("Translations", {
|
|
242
|
+
contains: ["Page", "Folder"],
|
|
243
|
+
icon: IcRoundLanguage
|
|
244
|
+
}),
|
|
245
|
+
archive: Config.root("Archive", {
|
|
246
|
+
contains: ["Page", "Folder"],
|
|
247
|
+
icon: IcRoundHistory
|
|
248
|
+
}),
|
|
249
|
+
settings: Config.root("Settings", {
|
|
250
|
+
contains: ["Page", "Folder"],
|
|
251
|
+
icon: IcOutlineSettings
|
|
252
|
+
}),
|
|
253
|
+
brandAssets: Config.root("Brand assets", {
|
|
254
|
+
contains: ["Page", "Folder"],
|
|
255
|
+
icon: IcRoundImage
|
|
256
|
+
}),
|
|
257
|
+
nestedContent: Config.root("Nested content", {
|
|
258
|
+
contains: ["Page", "Folder"],
|
|
259
|
+
icon: MiLayers
|
|
260
|
+
}),
|
|
261
|
+
media: Config.media()
|
|
262
|
+
}
|
|
263
|
+
});
|
|
217
264
|
var cms = createCMS({
|
|
218
265
|
enableDrafts: true,
|
|
219
266
|
schema: { Page, Folder },
|
|
@@ -222,7 +269,8 @@ var cms = createCMS({
|
|
|
222
269
|
nested,
|
|
223
270
|
many,
|
|
224
271
|
i18n,
|
|
225
|
-
statuses
|
|
272
|
+
statuses,
|
|
273
|
+
manyRoots
|
|
226
274
|
}
|
|
227
275
|
});
|
|
228
276
|
export {
|
|
@@ -22,5 +22,8 @@ export interface EntryEditor {
|
|
|
22
22
|
/**
|
|
23
23
|
* Returns the consumer-facing entry editor shape. Only the fields declared by
|
|
24
24
|
* EntryEditor are supported; dashboard atoms remain an internal detail.
|
|
25
|
+
*
|
|
26
|
+
* @deprecated Use `useEntry` from 'alinea/cms': it returns the entry being
|
|
27
|
+
* edited with its `id`, `locale`, `path`, `title`, `type` and `status`.
|
|
25
28
|
*/
|
|
26
29
|
export declare function useEntryEditor(): EntryEditor | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Graph } from 'alinea/core/Graph';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Compatibility hook for dashboard extensions written for Alinea 1.x.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Use `useGraph` from 'alinea/cms'.
|
|
4
6
|
*/
|
|
5
7
|
export declare function useGraph(): Graph;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
2
|
+
useAtomValueRaw
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
5
|
import "../../chunks/chunk-CQ52GEHY.js";
|
|
6
6
|
|
|
7
7
|
// src/dashboard/hook/UseGraph.ts
|
|
8
8
|
import { graphAtom } from "../atoms/core.js";
|
|
9
9
|
function useGraph() {
|
|
10
|
-
return
|
|
10
|
+
return useAtomValueRaw(graphAtom);
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
13
|
useGraph
|