alinea 1.7.0 → 2.0.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.init/content/pages/welcome.json +1 -1
- package/dist/.init/src/app/(alinea)/api/cms/route.ts +8 -8
- package/dist/.init/src/cms.ts +45 -47
- package/dist/LICENSES.md +208 -560
- package/dist/adapter/core/cms.js +1 -1
- package/dist/adapter/core/handler.js +1 -1
- package/dist/adapter/core/preview.js +2 -2
- package/dist/adapter/core/previewContext.d.ts +1 -1
- package/dist/adapter/core/previewContext.js +1 -1
- package/dist/adapter/next/cms.d.ts +1 -1
- package/dist/adapter/next/cms.js +7 -7
- package/dist/adapter/next/context.js +1 -1
- package/dist/adapter/next/handler.d.ts +2 -4
- package/dist/adapter/next/handler.js +11 -5
- package/dist/adapter/next/previews.d.ts +2 -2
- package/dist/adapter/next/previews.js +13 -17
- package/dist/adapter/next/with-alinea.js +20 -10
- package/dist/adapter/vite/plugin.d.ts +2 -0
- package/dist/adapter/vite/plugin.js +66 -0
- package/dist/backend/Auth.js +1 -1
- package/dist/backend/HandleAction.d.ts +1 -0
- package/dist/backend/HandleAction.js +2 -1
- package/dist/backend/Handler.js +125 -17
- package/dist/backend/Previews.d.ts +2 -5
- package/dist/backend/api/BasicAuth.d.ts +2 -2
- package/dist/backend/api/BasicAuth.js +5 -3
- package/dist/backend/api/CreateBackend.d.ts +11 -2
- package/dist/backend/api/CreateBackend.js +45 -2502
- package/dist/backend/api/DatabaseApi.d.ts +8 -2
- package/dist/backend/api/DatabaseApi.js +252 -123
- package/dist/backend/api/GithubApi.d.ts +0 -4
- package/dist/backend/api/GithubApi.js +11 -7
- package/dist/backend/api/OAuth2.d.ts +3 -3
- package/dist/backend/api/OAuth2.js +36 -25
- package/dist/backend/api/S3Uploads.d.ts +32 -0
- package/dist/backend/api/S3Uploads.js +178 -0
- package/dist/backend/api/SupabaseUploads.d.ts +28 -0
- package/dist/backend/api/SupabaseUploads.js +41 -0
- package/dist/backend/api/UploadPaths.d.ts +7 -0
- package/dist/backend/api/UploadPaths.js +53 -0
- package/dist/backend/api/auth.d.ts +5 -0
- package/dist/backend/api/auth.js +15 -0
- package/dist/backend/api/database.d.ts +2 -0
- package/dist/backend/api/database.js +16 -0
- package/dist/backend/api/github.d.ts +3 -0
- package/dist/backend/api/github.js +10 -0
- package/dist/backend/api/uploads.d.ts +9 -0
- package/dist/backend/api/uploads.js +23 -0
- package/dist/backend/loader/JsonLoader.js +1 -1
- package/dist/backend/resolver/ParsePreview.js +2 -2
- package/dist/backend/router/NodeHandler.js +1 -1
- package/dist/backend/router/Router.js +32 -6
- package/dist/backend/store/GeneratedRelease.js +1 -1
- package/dist/backend/store/GeneratedSource.js +1 -1
- package/dist/backend/util/ExecGit.js +4 -4
- package/dist/backend/util/JWTPreviews.d.ts +3 -3
- package/dist/backend/util/JWTPreviews.js +19 -5
- package/dist/backend/util/JsonPatch.js +1 -1
- package/dist/backend/util/ORM.js +2 -2
- package/dist/backend/util/Syncable.js +2 -2
- package/dist/backend.d.ts +5 -0
- package/dist/backend.js +17 -0
- package/dist/bundled.d.ts +8233 -8178
- package/dist/chunks/chunk-53DZYORR.js +3705 -0
- package/dist/chunks/chunk-7ORQ7BYK.js +1187 -0
- package/dist/chunks/chunk-AC4U3IMS.js +205 -0
- package/dist/chunks/chunk-BYJRQTFR.js +57 -0
- package/dist/chunks/chunk-CQ52GEHY.js +39 -0
- package/dist/chunks/chunk-EQ3TDHYD.js +79 -0
- package/dist/chunks/chunk-F36YGSHN.js +335 -0
- package/dist/chunks/chunk-G6E35DMJ.js +1997 -0
- package/dist/chunks/chunk-I4GC3E65.js +170 -0
- package/dist/chunks/chunk-I4OYYAX5.js +63 -0
- package/dist/chunks/chunk-I7X64JTZ.js +10402 -0
- package/dist/chunks/chunk-IWN3T3FL.js +19493 -0
- package/dist/chunks/chunk-IYAQC63Y.js +1265 -0
- package/dist/chunks/chunk-JFROOUG6.js +6363 -0
- package/dist/chunks/chunk-LB3UYTOL.js +95 -0
- package/dist/chunks/chunk-LUBOGJCG.js +129 -0
- package/dist/chunks/chunk-NWQXN4SB.js +227 -0
- package/dist/chunks/chunk-RKDPDEF7.js +160 -0
- package/dist/chunks/chunk-SJBZFMQ2.js +2966 -0
- package/dist/chunks/chunk-STAJCW4Z.js +322 -0
- package/dist/chunks/chunk-TL7ZW6BX.js +17963 -0
- package/dist/chunks/chunk-U4VOHNR2.js +210 -0
- package/dist/chunks/chunk-U5Z2VE7Z.js +120 -0
- package/dist/chunks/chunk-X47OVDF3.js +1974 -0
- package/dist/chunks/chunk-Y7XOMJOC.js +791 -0
- package/dist/chunks/chunk-YK3OSMDM.js +5473 -0
- package/dist/chunks/crypto-UO2XRCJS.js +11 -0
- package/dist/cli/Generate.js +9 -4
- package/dist/cli/Init.js +1 -1
- package/dist/cli/Serve.d.ts +2 -2
- package/dist/cli/Serve.js +54 -100
- package/dist/cli/bin.js +85 -12
- package/dist/cli/build/BuildEmitter.js +1 -1
- package/dist/cli/build/BuildOptions.js +1 -1
- package/dist/cli/generate/CompileConfig.d.ts +1 -1
- package/dist/cli/generate/CompileConfig.js +1 -1
- package/dist/cli/generate/CopyStaticFiles.js +2 -1
- package/dist/cli/generate/DevDB.js +2 -8
- package/dist/cli/generate/FillCache.js +2 -2
- package/dist/cli/generate/GenerateDashboard.js +1 -1
- package/dist/cli/generate/LoadConfig.js +2 -3
- package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
- package/dist/cli/serve/CreateLocalServer.js +81 -26
- package/dist/cli/serve/DevServer.d.ts +19 -0
- package/dist/cli/serve/DevServer.js +134 -0
- package/dist/cli/serve/GitHistory.d.ts +1 -2
- package/dist/cli/serve/GitHistory.js +15 -2
- package/dist/cli/serve/LiveReload.js +1 -1
- package/dist/cli/serve/LocalAuth.js +1 -1
- package/dist/cli/serve/MemoryDrafts.js +1 -1
- package/dist/cli/serve/StartServer.js +1 -1
- package/dist/cli/static/init/cms.js +45 -47
- package/dist/cli/static/init/next-handler.js +8 -8
- package/dist/cli/util/CommitMessage.js +1 -1
- package/dist/cli/util/CommitSha.js +1 -1
- package/dist/cli/util/Dirname.js +1 -1
- package/dist/cli/util/Emitter.js +1 -1
- package/dist/cli/util/EnsureEnv.js +1 -1
- package/dist/cli/util/EnsureLibs.js +1 -1
- package/dist/cli/util/EnsureNode.js +1 -1
- package/dist/cli/util/ExternalPlugin.js +595 -486
- package/dist/cli/util/FS.js +1 -1
- package/dist/cli/util/FindConfigFile.js +1 -1
- package/dist/cli/util/ForwardCommand.js +1 -1
- package/dist/cli/util/IgnorePlugin.js +1 -1
- package/dist/cli/util/PublicDefines.js +1 -1
- package/dist/cli/util/Report.js +1 -1
- package/dist/cli/util/ViewsPlugin.js +2 -2
- package/dist/cli/util/WarnPublicEnv.js +1 -1
- package/dist/cli/util/Watcher.js +1 -1
- package/dist/cloud/AuthResult.js +1 -1
- package/dist/cloud/CloudConfig.d.ts +1 -0
- package/dist/cloud/CloudConfig.js +2 -1
- package/dist/cloud/CloudRemote.d.ts +10 -4
- package/dist/cloud/CloudRemote.js +56 -9
- package/dist/components/Breadcrumbs.d.ts +3 -0
- package/dist/components/Breadcrumbs.js +42 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.js +57 -0
- package/dist/components/Calendar.d.ts +3 -0
- package/dist/components/Calendar.js +94 -0
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +75 -0
- package/dist/components/CheckboxGroup.d.ts +6 -0
- package/dist/components/CheckboxGroup.js +45 -0
- package/dist/components/ColorSwatch.d.ts +2 -0
- package/dist/components/ColorSwatch.js +45 -0
- package/dist/components/ColorSwatchPicker.d.ts +3 -0
- package/dist/components/ColorSwatchPicker.js +66 -0
- package/dist/components/ComboBox.d.ts +13 -0
- package/dist/components/ComboBox.js +147 -0
- package/dist/components/DateField.d.ts +5 -0
- package/dist/components/DateField.js +61 -0
- package/dist/components/DatePicker.d.ts +5 -0
- package/dist/components/DatePicker.js +78 -0
- package/dist/components/DateRangePicker.d.ts +5 -0
- package/dist/components/DateRangePicker.js +95 -0
- package/dist/components/Dialog.d.ts +3 -0
- package/dist/components/Dialog.js +43 -0
- package/dist/components/Disclosure.d.ts +5 -0
- package/dist/components/Disclosure.js +106 -0
- package/dist/components/DropZone.d.ts +4 -0
- package/dist/components/DropZone.js +41 -0
- package/dist/components/FoldIcon.d.ts +6 -0
- package/dist/components/FoldIcon.js +31 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/Icon.js +40 -0
- package/dist/components/Label.d.ts +48 -0
- package/dist/components/Label.js +210 -0
- package/dist/components/Link.d.ts +5 -0
- package/dist/components/Link.js +42 -0
- package/dist/components/List.d.ts +99 -0
- package/dist/components/List.js +397 -0
- package/dist/components/Menu.d.ts +16 -0
- package/dist/components/Menu.js +95 -0
- package/dist/components/Modal.d.ts +7 -0
- package/dist/components/Modal.js +58 -0
- package/dist/components/MultipleSelect.d.ts +25 -0
- package/dist/components/MultipleSelect.js +278 -0
- package/dist/components/NumberField.d.ts +6 -0
- package/dist/components/NumberField.js +90 -0
- package/dist/components/Popover.d.ts +6 -0
- package/dist/components/Popover.js +42 -0
- package/dist/components/ProgressCircle.d.ts +6 -0
- package/dist/components/ProgressCircle.js +96 -0
- package/dist/components/RadioGroup.d.ts +8 -0
- package/dist/components/RadioGroup.js +64 -0
- package/dist/components/SearchField.d.ts +8 -0
- package/dist/components/SearchField.js +86 -0
- package/dist/components/Select.d.ts +13 -0
- package/dist/components/Select.js +150 -0
- package/dist/components/Surface.d.ts +15 -0
- package/dist/components/Surface.js +53 -0
- package/dist/components/Switch.d.ts +5 -0
- package/dist/components/Switch.js +47 -0
- package/dist/components/Table.d.ts +14 -0
- package/dist/components/Table.js +147 -0
- package/dist/components/Tabs.d.ts +13 -0
- package/dist/components/Tabs.js +96 -0
- package/dist/components/TagGroup.d.ts +10 -0
- package/dist/components/TagGroup.js +81 -0
- package/dist/components/TextField.d.ts +13 -0
- package/dist/components/TextField.js +77 -0
- package/dist/components/TimeField.d.ts +5 -0
- package/dist/components/TimeField.js +55 -0
- package/dist/components/Toggle.d.ts +8 -0
- package/dist/components/Toggle.js +61 -0
- package/dist/components/Toolbar.d.ts +8 -0
- package/dist/components/Toolbar.js +80 -0
- package/dist/components/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip.js +54 -0
- package/dist/components/Tree.d.ts +23 -0
- package/dist/components/Tree.js +130 -0
- package/dist/components.d.ts +38 -0
- package/dist/components.js +39 -0
- package/dist/config.js +1 -1
- package/dist/core/CMS.js +1 -1
- package/dist/core/Client.d.ts +11 -7
- package/dist/core/Client.js +53 -10
- package/dist/core/Config.d.ts +2 -0
- package/dist/core/Config.js +1 -3
- package/dist/core/Connection.d.ts +28 -9
- package/dist/core/Document.js +10 -8
- package/dist/core/Draft.js +1 -1
- package/dist/core/Entry.d.ts +6 -0
- package/dist/core/Entry.js +16 -1
- package/dist/core/EntryFields.d.ts +4 -0
- package/dist/core/EntryFields.js +4 -2
- package/dist/core/EntryRecord.js +1 -1
- package/dist/core/Expr.d.ts +1 -0
- package/dist/core/Expr.js +1 -1
- package/dist/core/Field.d.ts +46 -5
- package/dist/core/Field.js +56 -10
- package/dist/core/Graph.d.ts +6 -0
- package/dist/core/Graph.js +1 -1
- package/dist/core/HttpError.js +1 -1
- package/dist/core/Id.js +1 -1
- package/dist/core/Infer.d.ts +1 -1
- package/dist/core/Internal.js +6 -6
- package/dist/core/ListRow.d.ts +10 -0
- package/dist/core/ListRow.js +12 -0
- package/dist/core/Outcome.js +1 -1
- package/dist/core/Page.js +2 -2
- package/dist/core/Picker.d.ts +0 -2
- package/dist/core/Picker.js +1 -1
- package/dist/core/Reference.js +1 -1
- package/dist/core/Role.d.ts +3 -0
- package/dist/core/Role.js +7 -1
- package/dist/core/Root.d.ts +4 -0
- package/dist/core/Root.js +7 -2
- package/dist/core/Schema.d.ts +0 -2
- package/dist/core/Schema.js +2 -16
- package/dist/core/Scope.js +1 -1
- package/dist/core/Section.js +2 -2
- package/dist/core/TextDoc.d.ts +4 -0
- package/dist/core/TextDoc.js +3 -1
- package/dist/core/Tracker.d.ts +1 -6
- package/dist/core/Tracker.js +2 -12
- package/dist/core/Trigger.js +1 -1
- package/dist/core/Type.d.ts +15 -6
- package/dist/core/Type.js +108 -28
- package/dist/core/UnionRow.d.ts +11 -0
- package/dist/core/UnionRow.js +11 -0
- package/dist/core/User.d.ts +7 -1
- package/dist/core/User.js +1 -1
- package/dist/core/View.js +1 -1
- package/dist/core/Workspace.d.ts +4 -1
- package/dist/core/Workspace.js +1 -1
- package/dist/core/db/CommitRequest.d.ts +2 -0
- package/dist/core/db/CommitRequest.js +1 -1
- package/dist/core/db/EntryAliases.d.ts +2 -0
- package/dist/core/db/EntryAliases.js +28 -0
- package/dist/core/db/EntryDB.d.ts +2 -2
- package/dist/core/db/EntryDB.js +3 -3
- package/dist/core/db/EntryIndex.d.ts +7 -0
- package/dist/core/db/EntryIndex.js +168 -26
- package/dist/core/db/EntryReference.d.ts +44 -0
- package/dist/core/db/EntryReference.js +9 -0
- package/dist/core/db/EntryReferenceIndex.d.ts +21 -0
- package/dist/core/db/EntryReferenceIndex.js +131 -0
- package/dist/core/db/EntryResolver.d.ts +10 -7
- package/dist/core/db/EntryResolver.js +90 -35
- package/dist/core/db/EntryTransaction.d.ts +1 -1
- package/dist/core/db/EntryTransaction.js +395 -57
- package/dist/core/db/EntryUrlConflictError.d.ts +11 -0
- package/dist/core/db/EntryUrlConflictError.js +16 -0
- package/dist/core/db/IndexEvent.d.ts +5 -2
- package/dist/core/db/IndexEvent.js +2 -1
- package/dist/core/db/LinkResolver.d.ts +1 -1
- package/dist/core/db/LinkResolver.js +4 -1
- package/dist/core/db/LocalDB.d.ts +4 -2
- package/dist/core/db/LocalDB.js +8 -6
- package/dist/core/db/Mutation.d.ts +3 -3
- package/dist/core/db/Operation.d.ts +8 -3
- package/dist/core/db/Operation.js +67 -23
- package/dist/core/db/TestDB.d.ts +9 -1
- package/dist/core/db/TestDB.js +24 -1
- package/dist/core/db/WriteableGraph.d.ts +15 -4
- package/dist/core/db/WriteableGraph.js +14 -2
- package/dist/core/field/CreateField.d.ts +5 -4
- package/dist/core/field/CreateField.js +9 -5
- package/dist/core/field/ListField.d.ts +13 -4
- package/dist/core/field/ListField.js +146 -13
- package/dist/core/field/RecordField.d.ts +5 -3
- package/dist/core/field/RecordField.js +58 -2
- package/dist/core/field/RichTextField.d.ts +7 -2
- package/dist/core/field/RichTextField.js +325 -10
- package/dist/core/field/ScalarField.js +9 -7
- package/dist/core/field/UnionField.d.ts +2 -3
- package/dist/core/field/UnionField.js +61 -12
- package/dist/core/media/CreatePreview.browser.js +5 -5
- package/dist/core/media/CreatePreview.js +15 -10
- package/dist/core/media/IsImage.js +1 -1
- package/dist/core/media/MediaAltField.d.ts +9 -0
- package/dist/core/media/MediaAltField.js +17 -0
- package/dist/core/media/MediaLocation.d.ts +39 -0
- package/dist/core/media/MediaLocation.js +55 -2
- package/dist/core/media/MediaRoot.d.ts +2 -2
- package/dist/core/media/MediaRoot.js +12 -11
- package/dist/core/media/MediaTypes.d.ts +21 -15
- package/dist/core/media/MediaTypes.js +33 -16
- package/dist/core/media/Summary.d.ts +8 -8
- package/dist/core/media/Summary.js +1 -1
- package/dist/core/media/UploadLimits.d.ts +1 -0
- package/dist/core/media/UploadLimits.js +20 -0
- package/dist/core/pages/Snippet.js +1 -1
- package/dist/core/shape/ListShape.d.ts +1 -47
- package/dist/core/shape/ListShape.js +1 -224
- package/dist/core/source/CombinedSource.js +1 -1
- package/dist/core/source/FSSource.d.ts +3 -2
- package/dist/core/source/FSSource.js +25 -12
- package/dist/core/source/FilePatch.js +5 -2
- package/dist/core/source/GitDelta.js +1 -1
- package/dist/core/source/GitUtils.js +1 -1
- package/dist/core/source/GithubSource.d.ts +1 -0
- package/dist/core/source/GithubSource.js +17 -4
- package/dist/core/source/IndexedDBSource.js +23 -11
- package/dist/core/source/MemorySource.js +1 -1
- package/dist/core/source/ShaMismatchError.js +3 -1
- package/dist/core/source/Source.js +1 -1
- package/dist/core/source/SourceExport.js +3 -3
- package/dist/core/source/Tree.js +1 -1
- package/dist/core/source/Utils.js +2 -5
- package/dist/core/util/Anchors.d.ts +4 -0
- package/dist/core/util/Anchors.js +45 -0
- package/dist/core/util/ArrayBuffers.js +1 -1
- package/dist/core/util/Assert.js +1 -1
- package/dist/core/util/Async.js +1 -1
- package/dist/core/util/BufferToBase64.js +1 -1
- package/dist/core/util/Callable.js +1 -1
- package/dist/core/util/Checks.js +2 -2
- package/dist/core/util/CodeGen.js +3 -1
- package/dist/core/util/ContentHash.js +1 -1
- package/dist/core/util/Debounce.js +1 -1
- package/dist/core/util/DeepMap.d.ts +14 -0
- package/dist/core/util/DeepMap.js +75 -0
- package/dist/core/util/Encoding.js +1 -1
- package/dist/core/util/EntryFilenames.d.ts +0 -1
- package/dist/core/util/EntryFilenames.js +2 -6
- package/dist/core/util/EntryRows.js +1 -1
- package/dist/core/util/FractionalIndexing.js +1 -1
- package/dist/core/util/GetRandomColor.js +20 -20
- package/dist/core/util/Identifiers.js +1 -1
- package/dist/core/util/JWT.js +1 -1
- package/dist/core/util/Lazy.js +1 -1
- package/dist/core/util/LazyRecord.js +1 -1
- package/dist/core/util/Logger.js +2 -1
- package/dist/core/util/Objects.d.ts +1 -0
- package/dist/core/util/Objects.js +5 -1
- package/dist/core/util/Paths.js +2 -2
- package/dist/core/util/RowId.js +1 -1
- package/dist/core/util/Slugs.js +1 -1
- package/dist/core/util/Timer.js +1 -1
- package/dist/core/util/Types.js +1 -1
- package/dist/core/util/Urls.js +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +2 -1
- package/dist/dashboard/App.css +319 -0
- package/dist/dashboard/App.d.ts +8 -8
- package/dist/dashboard/App.js +188 -142
- package/dist/dashboard/StoryProvider.d.ts +12 -0
- package/dist/dashboard/StoryProvider.js +82 -0
- package/dist/dashboard/ViewKeys.d.ts +26 -0
- package/dist/dashboard/ViewKeys.js +32 -0
- package/dist/dashboard/app/AccessDenied.d.ts +5 -0
- package/dist/dashboard/app/AccessDenied.js +53 -0
- package/dist/dashboard/app/ActivityStatus.d.ts +10 -0
- package/dist/dashboard/app/ActivityStatus.js +459 -0
- package/dist/dashboard/app/AlineaLogo.d.ts +4 -0
- package/dist/dashboard/app/AlineaLogo.js +26 -0
- package/dist/dashboard/app/AppShell.d.ts +4 -0
- package/dist/dashboard/app/AppShell.js +29 -0
- package/dist/dashboard/app/AuthView.d.ts +8 -0
- package/dist/dashboard/app/AuthView.js +111 -0
- package/dist/dashboard/app/Badge.d.ts +8 -0
- package/dist/dashboard/app/Badge.js +42 -0
- package/dist/dashboard/app/CompactField.d.ts +14 -0
- package/dist/dashboard/app/CompactField.js +178 -0
- package/dist/dashboard/app/DashboardErrorBoundary.d.ts +2 -0
- package/dist/dashboard/app/DashboardErrorBoundary.js +122 -0
- package/dist/dashboard/app/DashboardLayout.d.ts +18 -0
- package/dist/dashboard/app/DashboardLayout.js +88 -0
- package/dist/dashboard/app/DashboardMeta.d.ts +7 -0
- package/dist/dashboard/app/DashboardMeta.js +28 -0
- package/dist/dashboard/app/EditorBackButton.d.ts +5 -0
- package/dist/dashboard/app/EditorBackButton.js +33 -0
- package/dist/dashboard/app/EntryFields.d.ts +21 -0
- package/dist/dashboard/app/EntryFields.js +101 -0
- package/dist/dashboard/app/EntryHeader.d.ts +15 -0
- package/dist/dashboard/app/EntryHeader.js +452 -0
- package/dist/dashboard/app/EntryHeaderActions.d.ts +37 -0
- package/dist/dashboard/app/EntryHeaderActions.js +71 -0
- package/dist/dashboard/app/EntryReferences.d.ts +6 -0
- package/dist/dashboard/app/EntryReferences.js +209 -0
- package/dist/dashboard/app/EntrySidebar.d.ts +25 -0
- package/dist/dashboard/app/EntrySidebar.js +378 -0
- package/dist/dashboard/app/EntrySidebarPreview.d.ts +10 -0
- package/dist/dashboard/app/EntrySidebarPreview.js +260 -0
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +1 -0
- package/dist/dashboard/app/EntrySidebarToggle.d.ts +6 -0
- package/dist/dashboard/app/EntrySidebarToggle.js +29 -0
- package/dist/dashboard/app/EntryTranslationBanner.d.ts +7 -0
- package/dist/dashboard/app/EntryTranslationBanner.js +60 -0
- package/dist/dashboard/app/Explorer.d.ts +41 -0
- package/dist/dashboard/app/Explorer.js +804 -0
- package/dist/dashboard/app/ExplorerCards.d.ts +12 -0
- package/dist/dashboard/app/ExplorerCards.js +389 -0
- package/dist/dashboard/app/ExplorerFileCard.d.ts +10 -0
- package/dist/dashboard/app/ExplorerFileCard.js +115 -0
- package/dist/dashboard/app/ExplorerList.d.ts +9 -0
- package/dist/dashboard/app/ExplorerList.js +165 -0
- package/dist/dashboard/app/ExplorerModal.d.ts +16 -0
- package/dist/dashboard/app/ExplorerModal.js +89 -0
- package/dist/dashboard/app/ExplorerPickerContent.d.ts +13 -0
- package/dist/dashboard/app/ExplorerPickerContent.js +114 -0
- package/dist/dashboard/app/ExplorerTable.d.ts +14 -0
- package/dist/dashboard/app/ExplorerTable.js +497 -0
- package/dist/dashboard/app/ExternalLinkPicker.d.ts +12 -0
- package/dist/dashboard/app/ExternalLinkPicker.js +97 -0
- package/dist/dashboard/app/ImagePicker.d.ts +6 -0
- package/dist/dashboard/app/ImagePicker.js +145 -0
- package/dist/dashboard/app/LinkPicker.d.ts +9 -0
- package/dist/dashboard/app/LinkPicker.js +317 -0
- package/dist/dashboard/app/LocaleMenu.d.ts +8 -0
- package/dist/dashboard/app/LocaleMenu.js +110 -0
- package/dist/dashboard/app/LogoShape.d.ts +8 -0
- package/dist/dashboard/app/LogoShape.js +60 -0
- package/dist/dashboard/app/SidebarTree.d.ts +37 -0
- package/dist/dashboard/app/SidebarTree.js +433 -0
- package/dist/dashboard/app/StatusBadge.d.ts +6 -0
- package/dist/dashboard/app/StatusBadge.js +26 -0
- package/dist/dashboard/app/ViewToggle.d.ts +7 -0
- package/dist/dashboard/app/ViewToggle.js +27 -0
- package/dist/dashboard/app/WorkspaceMenu.d.ts +24 -0
- package/dist/dashboard/app/WorkspaceMenu.js +264 -0
- package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +5 -0
- package/dist/dashboard/app/WorkspaceRoots.d.ts +6 -0
- package/dist/dashboard/app/WorkspaceRoots.js +285 -0
- package/dist/dashboard/app/editor/FileEditor.d.ts +5 -0
- package/dist/dashboard/app/editor/FileEditor.js +190 -0
- package/dist/dashboard/app/editor/FilePreview.d.ts +13 -0
- package/dist/dashboard/app/editor/FilePreview.js +196 -0
- package/dist/dashboard/app/editor/MediaAltField.view.d.ts +5 -0
- package/dist/dashboard/app/editor/MediaAltField.view.js +98 -0
- package/dist/dashboard/app/modals/CreateEntry.d.ts +1 -0
- package/dist/dashboard/app/modals/CreateEntry.js +283 -0
- package/dist/dashboard/app/pages/EntryPage.d.ts +11 -0
- package/dist/dashboard/app/pages/EntryPage.js +354 -0
- package/dist/dashboard/app/pages/RootPage.d.ts +9 -0
- package/dist/dashboard/app/pages/RootPage.js +90 -0
- package/dist/dashboard/app/pages/UsersPage.d.ts +7 -0
- package/dist/dashboard/app/pages/UsersPage.js +552 -0
- package/dist/dashboard/app/ui/DashboardModal.d.ts +34 -0
- package/dist/dashboard/app/ui/DashboardModal.js +192 -0
- package/dist/dashboard/app/ui/Rail.d.ts +18 -0
- package/dist/dashboard/app/ui/Rail.js +41 -0
- package/dist/dashboard/app/ui/Sidebar.d.ts +15 -0
- package/dist/dashboard/app/ui/Sidebar.js +55 -0
- package/dist/dashboard/atoms/ReactiveNode.d.ts +41 -0
- package/dist/dashboard/atoms/ReactiveNode.js +248 -0
- package/dist/dashboard/atoms/activity.d.ts +48 -0
- package/dist/dashboard/atoms/activity.js +189 -0
- package/dist/dashboard/atoms/auth.d.ts +38 -0
- package/dist/dashboard/atoms/auth.js +106 -0
- package/dist/dashboard/atoms/config.d.ts +27 -0
- package/dist/dashboard/atoms/config.js +49 -0
- package/dist/dashboard/atoms/core.d.ts +15 -0
- package/dist/dashboard/atoms/core.js +37 -0
- package/dist/dashboard/atoms/create.d.ts +13 -0
- package/dist/dashboard/atoms/create.js +79 -0
- package/dist/dashboard/atoms/dashboard.d.ts +12 -0
- package/dist/dashboard/atoms/dashboard.js +71 -0
- package/dist/dashboard/atoms/editor.d.ts +80 -0
- package/dist/dashboard/atoms/editor.js +132 -0
- package/dist/dashboard/atoms/entry.d.ts +223 -0
- package/dist/dashboard/atoms/entry.js +609 -0
- package/dist/dashboard/atoms/explorer.d.ts +257 -0
- package/dist/dashboard/atoms/explorer.js +677 -0
- package/dist/dashboard/atoms/graph.d.ts +5 -0
- package/dist/dashboard/atoms/graph.js +62 -0
- package/dist/dashboard/atoms/link.d.ts +24 -0
- package/dist/dashboard/atoms/link.js +82 -0
- package/dist/dashboard/atoms/nav.d.ts +47 -0
- package/dist/dashboard/atoms/nav.js +220 -0
- package/dist/dashboard/atoms/preview.d.ts +4 -0
- package/dist/dashboard/atoms/preview.js +10 -0
- package/dist/dashboard/atoms/root.d.ts +88 -0
- package/dist/dashboard/atoms/root.js +444 -0
- package/dist/dashboard/atoms/upload.d.ts +9 -0
- package/dist/dashboard/atoms/upload.js +81 -0
- package/dist/dashboard/atoms/user.d.ts +9 -0
- package/dist/dashboard/atoms/user.js +75 -0
- package/dist/dashboard/atoms/utils.d.ts +17 -0
- package/dist/dashboard/atoms/utils.js +151 -0
- package/dist/dashboard/boot/ActivityEvent.d.ts +44 -0
- package/dist/dashboard/boot/ActivityEvent.js +14 -0
- package/dist/dashboard/boot/Boot.js +9 -5
- package/dist/dashboard/boot/BootDev.js +2 -1
- package/dist/dashboard/boot/BootProd.js +1 -1
- package/dist/dashboard/boot/DashboardWorker.d.ts +7 -7
- package/dist/dashboard/boot/DashboardWorker.js +370 -30
- package/dist/dashboard/boot/LoadWorker.js +6 -3
- package/dist/dashboard/boot/WorkerDB.d.ts +9 -2
- package/dist/dashboard/boot/WorkerDB.js +20 -3
- package/dist/dashboard/editor/UseField.d.ts +29 -10
- package/dist/dashboard/editor/UseField.js +27 -59
- package/dist/dashboard/fixture/cms.d.ts +116 -0
- package/dist/dashboard/fixture/cms.js +230 -0
- package/dist/dashboard/hook/UseEntryEditor.d.ts +25 -6
- package/dist/dashboard/hook/UseEntryEditor.js +34 -12
- package/dist/dashboard/hook/UseGraph.d.ts +3 -0
- package/dist/dashboard/hook/UseGraph.js +5 -5
- package/dist/dashboard/hook/UseLocale.d.ts +4 -1
- package/dist/dashboard/hook/UseLocale.js +5 -7
- package/dist/dashboard/hook/UseRoot.d.ts +7 -12
- package/dist/dashboard/hook/UseRoot.js +8 -5
- package/dist/dashboard/hook/UseWorkspace.d.ts +7 -9
- package/dist/dashboard/hook/UseWorkspace.js +5 -7
- package/dist/dashboard/hooks.d.ts +157 -0
- package/dist/dashboard/hooks.js +229 -0
- package/dist/dashboard/icons.d.ts +171 -0
- package/dist/dashboard/icons.js +2686 -0
- package/dist/dashboard/plugins/alineaFixturePlugin.d.ts +2 -0
- package/dist/dashboard/plugins/alineaFixturePlugin.js +200 -0
- package/dist/dashboard.d.ts +1 -2
- package/dist/dashboard.js +6 -2
- package/dist/edit.d.ts +1 -1
- package/dist/edit.js +2 -4
- package/dist/field/check/CheckField.js +3 -3
- package/dist/field/check/CheckField.view.d.ts +3 -3
- package/dist/field/check/CheckField.view.js +37 -84
- package/dist/field/code/CodeField.js +2 -2
- package/dist/field/code/CodeField.view.d.ts +21 -3
- package/dist/field/code/CodeField.view.js +177 -39
- package/dist/field/code/SimpleCodeEditor.d.ts +50 -0
- package/dist/field/code/SimpleCodeEditor.js +452 -0
- package/dist/field/date/DateField.js +3 -3
- package/dist/field/date/DateField.view.d.ts +3 -3
- package/dist/field/date/DateField.view.js +26 -26
- package/dist/field/hidden/HiddenField.js +2 -2
- package/dist/field/hidden/HiddenField.view.js +1 -1
- package/dist/field/json/JsonField.js +2 -2
- package/dist/field/json/JsonField.view.d.ts +4 -4
- package/dist/field/json/JsonField.view.js +53 -76
- package/dist/field/link/EntryLink.d.ts +9 -8
- package/dist/field/link/EntryLink.js +4 -2
- package/dist/field/link/FileLink.d.ts +5 -5
- package/dist/field/link/FileLink.js +7 -3
- package/dist/field/link/ImageLink.d.ts +4 -2
- package/dist/field/link/ImageLink.js +4 -1
- package/dist/field/link/Link.d.ts +1 -1
- package/dist/field/link/Link.js +1 -1
- package/dist/field/link/LinkEditor.d.ts +1 -1
- package/dist/field/link/LinkEditor.js +1 -1
- package/dist/field/link/LinkField.d.ts +5 -3
- package/dist/field/link/LinkField.js +56 -17
- package/dist/field/link/LinkField.stories.d.ts +11 -1
- package/dist/field/link/LinkField.view.d.ts +8 -10
- package/dist/field/link/LinkField.view.js +1444 -362
- package/dist/field/link/UrlLink.d.ts +2 -2
- package/dist/field/link/UrlLink.js +4 -2
- package/dist/field/list/ListField.d.ts +3 -3
- package/dist/field/list/ListField.js +5 -6
- package/dist/field/list/ListField.stories.d.ts +2 -1
- package/dist/field/list/ListField.view.d.ts +15 -7
- package/dist/field/list/ListField.view.js +888 -377
- package/dist/field/localiser/LocalisedField.view.d.ts +5 -0
- package/dist/field/localiser/LocalisedField.view.js +63 -0
- package/dist/field/localiser/LocalisedFieldTabs.d.ts +8 -0
- package/dist/field/localiser/LocalisedFieldTabs.js +38 -0
- package/dist/field/localiser/Localiser.d.ts +25 -0
- package/dist/field/localiser/Localiser.js +140 -0
- package/dist/field/localiser.d.ts +1 -0
- package/dist/field/localiser.js +2 -0
- package/dist/field/metadata/MetadataAliases.d.ts +20 -0
- package/dist/field/metadata/MetadataAliases.js +22 -0
- package/dist/field/metadata/MetadataField.d.ts +31 -8
- package/dist/field/metadata/MetadataField.js +127 -11
- package/dist/field/metadata/MetadataField.view.d.ts +11 -3
- package/dist/field/metadata/MetadataField.view.js +130 -96
- package/dist/field/number/NumberField.js +3 -3
- package/dist/field/number/NumberField.view.d.ts +3 -3
- package/dist/field/number/NumberField.view.js +22 -54
- package/dist/field/object/ObjectField.d.ts +1 -1
- package/dist/field/object/ObjectField.js +11 -4
- package/dist/field/object/ObjectField.view.d.ts +4 -4
- package/dist/field/object/ObjectField.view.js +28 -19
- package/dist/field/path/PathField.js +3 -3
- package/dist/field/path/PathField.view.d.ts +3 -3
- package/dist/field/path/PathField.view.js +33 -133
- package/dist/field/path/SlugField.d.ts +16 -0
- package/dist/field/path/SlugField.js +52 -0
- package/dist/field/richtext/Extensions.d.ts +1 -28
- package/dist/field/richtext/Extensions.js +2 -4146
- package/dist/field/richtext/PickTextAnchor.d.ts +19 -0
- package/dist/field/richtext/PickTextAnchor.js +99 -0
- package/dist/field/richtext/PickTextLink.d.ts +18 -17
- package/dist/field/richtext/PickTextLink.js +133 -88
- package/dist/field/richtext/ReferenceLink.d.ts +2 -0
- package/dist/field/richtext/ReferenceLink.js +13 -4
- package/dist/field/richtext/RichTextBlock.d.ts +11 -0
- package/dist/field/richtext/RichTextBlock.js +143 -0
- package/dist/field/richtext/RichTextBlockHost.d.ts +13 -0
- package/dist/field/richtext/RichTextBlockHost.js +56 -0
- package/dist/field/richtext/RichTextBlockValue.d.ts +5 -0
- package/dist/field/richtext/RichTextBlockValue.js +34 -0
- package/dist/field/richtext/RichTextBlocks.d.ts +16 -0
- package/dist/field/richtext/RichTextBlocks.js +40 -0
- package/dist/field/richtext/RichTextDocument.d.ts +4 -0
- package/dist/field/richtext/RichTextDocument.js +162 -0
- package/dist/field/richtext/RichTextExtensions.d.ts +67 -0
- package/dist/field/richtext/RichTextExtensions.js +8219 -0
- package/dist/field/richtext/RichTextField.d.ts +10 -3
- package/dist/field/richtext/RichTextField.js +13 -3
- package/dist/field/richtext/RichTextField.story.d.ts +8 -0
- package/dist/field/richtext/RichTextField.view.d.ts +11 -5
- package/dist/field/richtext/RichTextField.view.js +385 -2447
- package/dist/field/richtext/RichTextInsertMenu.d.ts +9 -0
- package/dist/field/richtext/RichTextInsertMenu.js +1014 -0
- package/dist/field/richtext/RichTextState.d.ts +6 -0
- package/dist/field/richtext/RichTextState.js +58 -0
- package/dist/field/richtext/RichTextToolbar.d.ts +9 -36
- package/dist/field/richtext/RichTextToolbar.js +206 -178
- package/dist/field/richtext/Toolbar.d.ts +111 -65
- package/dist/field/richtext/Toolbar.js +60 -45
- package/dist/field/richtext/extensions/Anchor.d.ts +19 -0
- package/dist/field/richtext/extensions/Anchor.js +94 -0
- package/dist/field/richtext/extensions/Link.d.ts +3 -13
- package/dist/field/richtext/extensions/Link.js +15 -37
- package/dist/field/richtext/extensions/Small.d.ts +1 -10
- package/dist/field/richtext/extensions/Small.js +7 -19
- package/dist/field/select/SelectField.d.ts +15 -4
- package/dist/field/select/SelectField.js +17 -2
- package/dist/field/select/SelectField.view.d.ts +7 -3
- package/dist/field/select/SelectField.view.js +112 -155
- package/dist/field/tabs/Tabs.js +3 -2
- package/dist/field/tabs/Tabs.view.d.ts +1 -6
- package/dist/field/tabs/Tabs.view.js +22 -29
- package/dist/field/text/TextField.js +8 -3
- package/dist/field/text/TextField.view.d.ts +2 -2
- package/dist/field/text/TextField.view.js +40 -60
- package/dist/field/time/TimeField.js +3 -3
- package/dist/field/time/TimeField.view.d.ts +3 -3
- package/dist/field/time/TimeField.view.js +30 -30
- package/dist/field/view/View.js +1 -1
- package/dist/field/views.d.ts +2 -0
- package/dist/field/views.js +65 -0
- package/dist/field.d.ts +1 -0
- package/dist/field.js +3 -1
- package/dist/index.css +7034 -3625
- package/dist/index.js +1 -1
- package/dist/inter-latin-500-normal-JSHNAZJU.woff2 +0 -0
- package/dist/inter-latin-ext-500-normal-5ARINTHO.woff2 +0 -0
- package/dist/next.cjs +19 -9
- package/dist/next.edge.js +1 -1
- package/dist/next.js +1 -1
- package/dist/picker/entry/EntryPicker.d.ts +9 -4
- package/dist/picker/entry/EntryPicker.js +97 -19
- package/dist/picker/entry/EntryReference.d.ts +4 -0
- package/dist/picker/entry/EntryReference.js +3 -1
- package/dist/picker/url/UrlPicker.js +2 -12
- package/dist/preview/ChunkCookieValue.js +1 -1
- package/dist/preview/PreviewCookies.js +1 -1
- package/dist/preview/PreviewMessage.js +1 -1
- package/dist/preview/PreviewPayload.js +237 -10
- package/dist/preview/RegisterPreview.js +1 -1
- package/dist/preview/react.js +10 -3
- package/dist/preview/widget.js +1 -1
- package/dist/query.d.ts +116 -92
- package/dist/query.js +7 -1
- package/dist/types.d.ts +1 -0
- package/dist/ui/Link.d.ts +6 -5
- package/dist/ui/Link.js +37 -13
- package/dist/ui/RichText.d.ts +37 -11
- package/dist/ui/RichText.js +81 -44
- package/dist/ui/Stack.d.ts +11 -22
- package/dist/ui/Stack.js +54 -67
- package/dist/ui/icons/IcAlignCenter.d.ts +4 -2
- package/dist/ui/icons/IcAlignCenter.js +6 -12
- package/dist/ui/icons/IcOutlineGridView.d.ts +3 -2
- package/dist/ui/icons/IcOutlineGridView.js +3 -11
- package/dist/ui/icons/IcOutlineSettings.d.ts +3 -2
- package/dist/ui/icons/IcOutlineSettings.js +3 -11
- package/dist/ui/icons/IcRoundAccountTree.d.ts +4 -2
- package/dist/ui/icons/IcRoundAccountTree.js +6 -22
- package/dist/ui/icons/IcRoundClose.d.ts +4 -2
- package/dist/ui/icons/IcRoundClose.js +6 -12
- package/dist/ui/icons/IcRoundCode.d.ts +4 -2
- package/dist/ui/icons/IcRoundCode.js +6 -12
- package/dist/ui/icons/IcRoundDateRange.d.ts +3 -2
- package/dist/ui/icons/IcRoundDateRange.js +3 -11
- package/dist/ui/icons/IcRoundDelete.d.ts +4 -2
- package/dist/ui/icons/IcRoundDelete.js +6 -12
- package/dist/ui/icons/IcRoundEdit.d.ts +4 -2
- package/dist/ui/icons/IcRoundEdit.js +6 -12
- package/dist/ui/icons/IcRoundFormatListNumbered.d.ts +3 -2
- package/dist/ui/icons/IcRoundFormatListNumbered.js +3 -11
- package/dist/ui/icons/IcRoundLink.d.ts +4 -2
- package/dist/ui/icons/IcRoundLink.js +6 -12
- package/dist/ui/icons/IcRoundOpenInNew.d.ts +4 -2
- package/dist/ui/icons/IcRoundOpenInNew.js +6 -12
- package/dist/ui/icons/IcRoundPanorama.d.ts +4 -2
- package/dist/ui/icons/IcRoundPanorama.js +6 -6
- package/dist/ui/icons/IcRoundRefresh.d.ts +3 -2
- package/dist/ui/icons/IcRoundRefresh.js +3 -11
- package/dist/ui/icons/IcRoundSave.d.ts +4 -2
- package/dist/ui/icons/IcRoundSave.js +6 -22
- package/dist/ui/icons/IcRoundSearch.d.ts +4 -2
- package/dist/ui/icons/IcRoundSearch.js +6 -12
- package/dist/ui/icons/IcRoundShare.d.ts +4 -2
- package/dist/ui/icons/IcRoundShare.js +6 -12
- package/dist/ui/icons/IcRoundSync.d.ts +4 -2
- package/dist/ui/icons/IcRoundSync.js +6 -22
- package/dist/ui/icons/MaterialSymbolsDatabase.d.ts +4 -2
- package/dist/ui/icons/MaterialSymbolsDatabase.js +6 -22
- package/dist/ui/icons/TableInsert.d.ts +4 -2
- package/dist/ui/icons/TableInsert.js +6 -12
- package/dist/ui/util/ImageBlurUrl.js +1 -1
- package/dist/ui.d.ts +0 -8
- package/dist/ui.js +0 -8
- package/package.json +49 -64
- package/dist/backend/router/Proxy.d.ts +0 -1
- package/dist/backend/router/Proxy.js +0 -32
- package/dist/chunks/chunk-2NTSADJL.js +0 -20
- package/dist/chunks/chunk-2STBQ2Y4.js +0 -166
- package/dist/chunks/chunk-2X5P2RZV.js +0 -94
- package/dist/chunks/chunk-3DIW62EI.js +0 -2900
- package/dist/chunks/chunk-3TNMMA3W.js +0 -249
- package/dist/chunks/chunk-467JA2PB.js +0 -29
- package/dist/chunks/chunk-5LTN67OE.js +0 -51
- package/dist/chunks/chunk-76QF5YTJ.js +0 -107
- package/dist/chunks/chunk-A5O3N2GS.js +0 -63
- package/dist/chunks/chunk-AICQFCVN.js +0 -19
- package/dist/chunks/chunk-AJJSW27C.js +0 -728
- package/dist/chunks/chunk-C53YJRET.js +0 -112
- package/dist/chunks/chunk-CKT37OYJ.js +0 -9
- package/dist/chunks/chunk-F2HHHLEQ.js +0 -72
- package/dist/chunks/chunk-FKWEJTSK.js +0 -16282
- package/dist/chunks/chunk-G2AFWRAD.js +0 -12
- package/dist/chunks/chunk-HSIHEWFC.js +0 -101
- package/dist/chunks/chunk-I26ZIF6Q.js +0 -360
- package/dist/chunks/chunk-JL5K3F7X.js +0 -1116
- package/dist/chunks/chunk-NZLE2WMY.js +0 -35
- package/dist/chunks/chunk-ORDS5C6Z.js +0 -83
- package/dist/chunks/chunk-PNILF4WM.js +0 -251
- package/dist/chunks/chunk-QUIANN6B.js +0 -8001
- package/dist/chunks/chunk-RSX2DILK.js +0 -335
- package/dist/chunks/chunk-SKF4L7JN.js +0 -401
- package/dist/chunks/chunk-SOTBYUJY.js +0 -120
- package/dist/chunks/chunk-TOJF2G3X.js +0 -96
- package/dist/chunks/chunk-TPUTTEHF.js +0 -3002
- package/dist/chunks/chunk-VUACWPFC.js +0 -892
- package/dist/chunks/chunk-WD7H5L2L.js +0 -168
- package/dist/chunks/chunk-WDCPVJJC.js +0 -341
- package/dist/chunks/chunk-WJ67RR7S.js +0 -554
- package/dist/chunks/chunk-WKC37UOZ.js +0 -143
- package/dist/chunks/chunk-WLKPH7JA.js +0 -2786
- package/dist/chunks/chunk-YWCPLD22.js +0 -2343
- package/dist/chunks/crypto-HZTUU327.js +0 -11
- package/dist/cloud/view/CloudAuth.browser.d.ts +0 -2
- package/dist/cloud/view/CloudAuth.browser.js +0 -111
- package/dist/cloud/view/CloudAuth.d.ts +0 -1
- package/dist/cloud/view/CloudAuth.js +0 -9
- package/dist/core/Doc.d.ts +0 -11
- package/dist/core/Doc.js +0 -44
- package/dist/core/Role.test.d.ts +0 -1
- package/dist/core/Shape.d.ts +0 -19
- package/dist/core/Trigger.test.d.ts +0 -1
- package/dist/core/Type.test.d.ts +0 -1
- package/dist/core/db/EntryIndex.test.d.ts +0 -1
- package/dist/core/db/EntryResolver.test.d.ts +0 -1
- package/dist/core/db/LocalDB.test.d.ts +0 -1
- package/dist/core/field/RichTextField.test.d.ts +0 -1
- package/dist/core/shape/ListShape.test.d.ts +0 -1
- package/dist/core/shape/RecordShape.d.ts +0 -26
- package/dist/core/shape/RecordShape.js +0 -102
- package/dist/core/shape/RecordShape.test.d.ts +0 -1
- package/dist/core/shape/RichTextShape.d.ts +0 -75
- package/dist/core/shape/RichTextShape.js +0 -435
- package/dist/core/shape/RichTextShape.test.d.ts +0 -1
- package/dist/core/shape/ScalarShape.d.ts +0 -20
- package/dist/core/shape/ScalarShape.js +0 -53
- package/dist/core/shape/ScalarShape.test.d.ts +0 -1
- package/dist/core/shape/UnionShape.d.ts +0 -34
- package/dist/core/shape/UnionShape.js +0 -141
- package/dist/core/shape/UnionShape.test.d.ts +0 -1
- package/dist/core/source/CombinedSource.test.d.ts +0 -1
- package/dist/core/source/FSSource.test.d.ts +0 -1
- package/dist/core/source/FilePatch.test.d.ts +0 -1
- package/dist/core/source/GitDelta.test.d.ts +0 -1
- package/dist/core/source/GitUtils.test.d.ts +0 -1
- package/dist/core/source/GithubSource.test.d.ts +0 -1
- package/dist/core/source/IndexedDBSource.test.d.ts +0 -1
- package/dist/core/source/MemorySource.test.d.ts +0 -1
- package/dist/core/source/SourceExport.test.d.ts +0 -1
- package/dist/core/source/Tree.test.d.ts +0 -1
- package/dist/core/source/Utils.test.d.ts +0 -1
- package/dist/core/util/CodeGen.test.d.ts +0 -1
- package/dist/core/util/EntryFilenames.test.d.ts +0 -1
- package/dist/core/util/JWT.test.d.ts +0 -1
- package/dist/core/util/Paths.test.d.ts +0 -1
- package/dist/core/util/Slugs.test.d.ts +0 -1
- package/dist/dashboard/DashboardNav.d.ts +0 -22
- package/dist/dashboard/DashboardNav.js +0 -44
- package/dist/dashboard/DashboardProvider.d.ts +0 -16
- package/dist/dashboard/DashboardProvider.js +0 -28
- package/dist/dashboard/Routes.d.ts +0 -111
- package/dist/dashboard/Routes.js +0 -78
- package/dist/dashboard/Welcome.d.ts +0 -1
- package/dist/dashboard/Welcome.js +0 -21
- package/dist/dashboard/atoms/DashboardAtoms.d.ts +0 -18
- package/dist/dashboard/atoms/DashboardAtoms.js +0 -86
- package/dist/dashboard/atoms/DbAtoms.d.ts +0 -5
- package/dist/dashboard/atoms/DbAtoms.js +0 -95
- package/dist/dashboard/atoms/Edits.d.ts +0 -31
- package/dist/dashboard/atoms/Edits.js +0 -93
- package/dist/dashboard/atoms/EntryAtoms.d.ts +0 -34
- package/dist/dashboard/atoms/EntryAtoms.js +0 -298
- package/dist/dashboard/atoms/EntryEditorAtoms.d.ts +0 -255
- package/dist/dashboard/atoms/EntryEditorAtoms.js +0 -629
- package/dist/dashboard/atoms/EntrySummaryAtoms.d.ts +0 -21
- package/dist/dashboard/atoms/EntrySummaryAtoms.js +0 -58
- package/dist/dashboard/atoms/ErrorAtoms.d.ts +0 -4
- package/dist/dashboard/atoms/ErrorAtoms.js +0 -18
- package/dist/dashboard/atoms/FormAtoms.d.ts +0 -56
- package/dist/dashboard/atoms/FormAtoms.js +0 -189
- package/dist/dashboard/atoms/LocationAtoms.d.ts +0 -25
- package/dist/dashboard/atoms/LocationAtoms.js +0 -104
- package/dist/dashboard/atoms/NavigationAtoms.d.ts +0 -38
- package/dist/dashboard/atoms/NavigationAtoms.js +0 -124
- package/dist/dashboard/atoms/PolicyAtom.d.ts +0 -6
- package/dist/dashboard/atoms/PolicyAtom.js +0 -29
- package/dist/dashboard/atoms/PreferencesAtoms.d.ts +0 -16
- package/dist/dashboard/atoms/PreferencesAtoms.js +0 -53
- package/dist/dashboard/atoms/RouterAtoms.d.ts +0 -78
- package/dist/dashboard/atoms/RouterAtoms.js +0 -161
- package/dist/dashboard/atoms/StyleAtoms.d.ts +0 -1
- package/dist/dashboard/atoms/StyleAtoms.js +0 -14
- package/dist/dashboard/atoms/YAtom.d.ts +0 -2
- package/dist/dashboard/atoms/YAtom.js +0 -24
- package/dist/dashboard/editor/DefaultViews.d.ts +0 -19
- package/dist/dashboard/editor/DefaultViews.js +0 -52
- package/dist/dashboard/editor/InputForm.d.ts +0 -26
- package/dist/dashboard/editor/InputForm.js +0 -53
- package/dist/dashboard/editor/ViewKeys.d.ts +0 -23
- package/dist/dashboard/editor/ViewKeys.js +0 -29
- package/dist/dashboard/hook/UseConfig.d.ts +0 -1
- package/dist/dashboard/hook/UseConfig.js +0 -12
- package/dist/dashboard/hook/UseDashboard.d.ts +0 -1
- package/dist/dashboard/hook/UseDashboard.js +0 -12
- package/dist/dashboard/hook/UseDb.d.ts +0 -2
- package/dist/dashboard/hook/UseDb.js +0 -14
- package/dist/dashboard/hook/UseDebounce.d.ts +0 -1
- package/dist/dashboard/hook/UseDebounce.js +0 -23
- package/dist/dashboard/hook/UseEntryLocation.d.ts +0 -1
- package/dist/dashboard/hook/UseEntryLocation.js +0 -12
- package/dist/dashboard/hook/UseEntrySummary.d.ts +0 -1
- package/dist/dashboard/hook/UseEntrySummary.js +0 -16
- package/dist/dashboard/hook/UseExplorer.d.ts +0 -14
- package/dist/dashboard/hook/UseExplorer.js +0 -13
- package/dist/dashboard/hook/UseFocusList.d.ts +0 -14
- package/dist/dashboard/hook/UseFocusList.js +0 -113
- package/dist/dashboard/hook/UseNav.d.ts +0 -10
- package/dist/dashboard/hook/UseNav.js +0 -12
- package/dist/dashboard/hook/UsePolicy.d.ts +0 -1
- package/dist/dashboard/hook/UsePolicy.js +0 -14
- package/dist/dashboard/hook/UsePreferences.d.ts +0 -6
- package/dist/dashboard/hook/UsePreferences.js +0 -30
- package/dist/dashboard/hook/UseSession.d.ts +0 -1
- package/dist/dashboard/hook/UseSession.js +0 -12
- package/dist/dashboard/hook/UseUploads.d.ts +0 -42
- package/dist/dashboard/hook/UseUploads.js +0 -91
- package/dist/dashboard/pages/ContentView.d.ts +0 -5
- package/dist/dashboard/pages/ContentView.js +0 -96
- package/dist/dashboard/util/Atoms.d.ts +0 -2
- package/dist/dashboard/util/Atoms.js +0 -21
- package/dist/dashboard/util/DebounceAtom.d.ts +0 -2
- package/dist/dashboard/util/DebounceAtom.js +0 -26
- package/dist/dashboard/util/HashRouter.d.ts +0 -1
- package/dist/dashboard/util/HashRouter.js +0 -2
- package/dist/dashboard/util/Head.d.ts +0 -2
- package/dist/dashboard/util/Head.js +0 -10
- package/dist/dashboard/util/KeepInView.d.ts +0 -2
- package/dist/dashboard/util/KeepInView.js +0 -19
- package/dist/dashboard/util/KeepPreviousData.d.ts +0 -9
- package/dist/dashboard/util/KeepPreviousData.js +0 -32
- package/dist/dashboard/util/Loader.d.ts +0 -17
- package/dist/dashboard/util/Loader.js +0 -31
- package/dist/dashboard/util/SuspenseBoundary.d.ts +0 -4
- package/dist/dashboard/util/SuspenseBoundary.js +0 -23
- package/dist/dashboard/util/WithResolvers.d.ts +0 -2
- package/dist/dashboard/util/WithResolvers.js +0 -16
- package/dist/dashboard/view/AlineaLogo.d.ts +0 -2
- package/dist/dashboard/view/AlineaLogo.js +0 -16
- package/dist/dashboard/view/Breadcrumbs.d.ts +0 -3
- package/dist/dashboard/view/Breadcrumbs.js +0 -33
- package/dist/dashboard/view/Create.d.ts +0 -13
- package/dist/dashboard/view/Create.js +0 -75
- package/dist/dashboard/view/EntryEdit.d.ts +0 -5
- package/dist/dashboard/view/EntryEdit.js +0 -222
- package/dist/dashboard/view/EntryTree.d.ts +0 -5
- package/dist/dashboard/view/EntryTree.js +0 -1463
- package/dist/dashboard/view/ErrorBoundary.d.ts +0 -6
- package/dist/dashboard/view/ErrorBoundary.js +0 -95
- package/dist/dashboard/view/IconButton.d.ts +0 -18
- package/dist/dashboard/view/IconButton.js +0 -51
- package/dist/dashboard/view/InputLabel.d.ts +0 -36
- package/dist/dashboard/view/InputLabel.js +0 -151
- package/dist/dashboard/view/MediaExplorer.d.ts +0 -7
- package/dist/dashboard/view/MediaExplorer.js +0 -121
- package/dist/dashboard/view/Modal.d.ts +0 -8
- package/dist/dashboard/view/Modal.js +0 -63
- package/dist/dashboard/view/PageHeader.d.ts +0 -5
- package/dist/dashboard/view/PageHeader.js +0 -26
- package/dist/dashboard/view/Preview.d.ts +0 -3
- package/dist/dashboard/view/Preview.js +0 -20
- package/dist/dashboard/view/RootOverview.d.ts +0 -5
- package/dist/dashboard/view/RootOverview.js +0 -46
- package/dist/dashboard/view/SearchBox.d.ts +0 -1
- package/dist/dashboard/view/SearchBox.js +0 -126
- package/dist/dashboard/view/Sidebar.d.ts +0 -21
- package/dist/dashboard/view/Sidebar.js +0 -312
- package/dist/dashboard/view/Toolbar.d.ts +0 -9
- package/dist/dashboard/view/Toolbar.js +0 -240
- package/dist/dashboard/view/Viewport.d.ts +0 -8
- package/dist/dashboard/view/Viewport.js +0 -69
- package/dist/dashboard/view/WorkspaceLabel.d.ts +0 -7
- package/dist/dashboard/view/WorkspaceLabel.js +0 -32
- package/dist/dashboard/view/diff/ChangeBox.d.ts +0 -14
- package/dist/dashboard/view/diff/ChangeBox.js +0 -36
- package/dist/dashboard/view/diff/DiffUtils.d.ts +0 -16
- package/dist/dashboard/view/diff/DiffUtils.js +0 -82
- package/dist/dashboard/view/diff/DiffUtils.test.d.ts +0 -1
- package/dist/dashboard/view/diff/EntryDiff.d.ts +0 -6
- package/dist/dashboard/view/diff/EntryDiff.js +0 -45
- package/dist/dashboard/view/diff/FieldDiff.d.ts +0 -10
- package/dist/dashboard/view/diff/FieldDiff.js +0 -51
- package/dist/dashboard/view/diff/FieldsDiff.d.ts +0 -7
- package/dist/dashboard/view/diff/FieldsDiff.js +0 -24
- package/dist/dashboard/view/diff/ListDiff.d.ts +0 -10
- package/dist/dashboard/view/diff/ListDiff.js +0 -32
- package/dist/dashboard/view/diff/RichTextDiff.d.ts +0 -11
- package/dist/dashboard/view/diff/RichTextDiff.js +0 -94
- package/dist/dashboard/view/diff/ScalarDiff.d.ts +0 -5
- package/dist/dashboard/view/diff/ScalarDiff.js +0 -1520
- package/dist/dashboard/view/entry/EditModeToggle.d.ts +0 -9
- package/dist/dashboard/view/entry/EditModeToggle.js +0 -51
- package/dist/dashboard/view/entry/EntryHeader.d.ts +0 -5
- package/dist/dashboard/view/entry/EntryHeader.js +0 -414
- package/dist/dashboard/view/entry/EntryHistory.d.ts +0 -2
- package/dist/dashboard/view/entry/EntryHistory.js +0 -78
- package/dist/dashboard/view/entry/EntryNotice.d.ts +0 -7
- package/dist/dashboard/view/entry/EntryNotice.js +0 -44
- package/dist/dashboard/view/entry/EntryPreview.d.ts +0 -10
- package/dist/dashboard/view/entry/EntryPreview.js +0 -44
- package/dist/dashboard/view/entry/EntrySummary.d.ts +0 -3
- package/dist/dashboard/view/entry/EntrySummary.js +0 -75
- package/dist/dashboard/view/entry/EntryTitle.d.ts +0 -7
- package/dist/dashboard/view/entry/EntryTitle.js +0 -64
- package/dist/dashboard/view/entry/FieldToolbar.d.ts +0 -11
- package/dist/dashboard/view/entry/FieldToolbar.js +0 -41
- package/dist/dashboard/view/entry/LangSwitch.d.ts +0 -7
- package/dist/dashboard/view/entry/LangSwitch.js +0 -110
- package/dist/dashboard/view/entry/NewEntry.d.ts +0 -4
- package/dist/dashboard/view/entry/NewEntry.js +0 -288
- package/dist/dashboard/view/entry/RootHeader.d.ts +0 -4
- package/dist/dashboard/view/entry/RootHeader.js +0 -61
- package/dist/dashboard/view/explorer/Explorer.d.ts +0 -24
- package/dist/dashboard/view/explorer/Explorer.js +0 -2230
- package/dist/dashboard/view/explorer/ExplorerItem.d.ts +0 -11
- package/dist/dashboard/view/explorer/ExplorerItem.js +0 -128
- package/dist/dashboard/view/explorer/ExplorerRow.d.ts +0 -15
- package/dist/dashboard/view/explorer/ExplorerRow.js +0 -73
- package/dist/dashboard/view/media/CardOverview.d.ts +0 -1
- package/dist/dashboard/view/media/CardOverview.js +0 -10
- package/dist/dashboard/view/media/FileEntry.d.ts +0 -6
- package/dist/dashboard/view/media/FileEntry.js +0 -223
- package/dist/dashboard/view/media/FileSummary.d.ts +0 -3
- package/dist/dashboard/view/media/FileSummary.js +0 -102
- package/dist/dashboard/view/media/FileUploadRow.d.ts +0 -2
- package/dist/dashboard/view/media/FileUploadRow.js +0 -53
- package/dist/dashboard/view/media/FileUploader.d.ts +0 -10
- package/dist/dashboard/view/media/FileUploader.js +0 -151
- package/dist/dashboard/view/media/MediaThumbnail.d.ts +0 -11
- package/dist/dashboard/view/media/MediaThumbnail.js +0 -55
- package/dist/dashboard/view/preview/BrowserPreview.d.ts +0 -12
- package/dist/dashboard/view/preview/BrowserPreview.js +0 -210
- package/dist/dashboard/view/sidebar/SidebarSettings.d.ts +0 -1
- package/dist/dashboard/view/sidebar/SidebarSettings.js +0 -192
- package/dist/field/check/CheckField.stories.d.ts +0 -5
- package/dist/field/code/CodeField.stories.d.ts +0 -5
- package/dist/field/date/DateField.stories.d.ts +0 -5
- package/dist/field/json/JsonField.stories.d.ts +0 -5
- package/dist/field/metadata/MetadataField.stories.d.ts +0 -5
- package/dist/field/number/NumberField.stories.d.ts +0 -5
- package/dist/field/object/ObjectField.stories.d.ts +0 -5
- package/dist/field/path/PathField.stories.d.ts +0 -5
- package/dist/field/richtext/RichText.stories.d.ts +0 -5
- package/dist/field/select/SelectField.stories.d.ts +0 -5
- package/dist/field/tabs/Tabs.stories.d.ts +0 -5
- package/dist/field/text/TextField.stories.d.ts +0 -5
- package/dist/field/time/TimeField.stories.d.ts +0 -5
- package/dist/picker/entry/EntryPicker.browser.d.ts +0 -7
- package/dist/picker/entry/EntryPicker.browser.js +0 -373
- package/dist/picker/entry/EntryPicker.stories.d.ts +0 -2
- package/dist/picker/entry/EntryPickerRow.d.ts +0 -5
- package/dist/picker/entry/EntryPickerRow.js +0 -24
- package/dist/picker/url/UrlPicker.browser.d.ts +0 -6
- package/dist/picker/url/UrlPicker.browser.js +0 -83
- package/dist/picker/url/UrlPicker.stories.d.ts +0 -5
- package/dist/picker/url/UrlPickerRow.d.ts +0 -5
- package/dist/picker/url/UrlPickerRow.js +0 -38
- package/dist/preview/ChunkCookieValue.test.d.ts +0 -1
- package/dist/preview/PreviewPayload.test.d.ts +0 -1
- package/dist/test/EntryFixture.d.ts +0 -30
- package/dist/test/EntryFixture.js +0 -91
- package/dist/test/broken-index.test.d.ts +0 -1
- package/dist/test/cms.d.ts +0 -17
- package/dist/test/cms.js +0 -38
- package/dist/test/drafts.test.d.ts +0 -1
- package/dist/test/example.d.ts +0 -137
- package/dist/test/example.js +0 -230
- package/dist/test/insert-order.test.d.ts +0 -1
- package/dist/test/links.test.d.ts +0 -1
- package/dist/test/locales.test.d.ts +0 -1
- package/dist/test/moves.test.d.ts +0 -1
- package/dist/test/mutate.test.d.ts +0 -1
- package/dist/test/query.test.d.ts +0 -1
- package/dist/test/renames.test.d.ts +0 -1
- package/dist/test/roles.test.d.ts +0 -1
- package/dist/test/schema/DemoHome.d.ts +0 -25
- package/dist/test/schema/DemoHome.js +0 -25
- package/dist/test/schema/DemoRecipe.d.ts +0 -14
- package/dist/test/schema/DemoRecipe.js +0 -22
- package/dist/test/schema/DemoRecipes.d.ts +0 -4
- package/dist/test/schema/DemoRecipes.js +0 -14
- package/dist/test/schema/index.d.ts +0 -3
- package/dist/test/schema/index.js +0 -4
- package/dist/test/seeding.test.d.ts +0 -1
- package/dist/test/shared.test.d.ts +0 -1
- package/dist/test/status.test.d.ts +0 -1
- package/dist/test/uploads.test.d.ts +0 -1
- package/dist/ui/AppBar.d.ts +0 -14
- package/dist/ui/AppBar.js +0 -68
- package/dist/ui/Avatar.d.ts +0 -6
- package/dist/ui/Avatar.js +0 -33
- package/dist/ui/Badge.d.ts +0 -9
- package/dist/ui/Badge.js +0 -44
- package/dist/ui/Button.d.ts +0 -9
- package/dist/ui/Button.js +0 -57
- package/dist/ui/Button.stories.d.ts +0 -6
- package/dist/ui/Chip.d.ts +0 -8
- package/dist/ui/Chip.js +0 -46
- package/dist/ui/DropdownMenu.d.ts +0 -12
- package/dist/ui/DropdownMenu.js +0 -415
- package/dist/ui/Ellipsis.d.ts +0 -2
- package/dist/ui/Ellipsis.js +0 -33
- package/dist/ui/ErrorMessage.d.ts +0 -4
- package/dist/ui/ErrorMessage.js +0 -17
- package/dist/ui/Icon.d.ts +0 -9
- package/dist/ui/Icon.js +0 -41
- package/dist/ui/Lift.d.ts +0 -3
- package/dist/ui/Lift.js +0 -22
- package/dist/ui/Loader.d.ts +0 -8
- package/dist/ui/Loader.js +0 -32
- package/dist/ui/Main.d.ts +0 -12
- package/dist/ui/Main.js +0 -56
- package/dist/ui/Pane.d.ts +0 -9
- package/dist/ui/Pane.js +0 -132
- package/dist/ui/PopoverMenu.d.ts +0 -12
- package/dist/ui/PopoverMenu.js +0 -418
- package/dist/ui/Property.d.ts +0 -1
- package/dist/ui/Property.js +0 -7
- package/dist/ui/Sink.d.ts +0 -9
- package/dist/ui/Sink.js +0 -49
- package/dist/ui/Statusbar.d.ts +0 -15
- package/dist/ui/Statusbar.js +0 -54
- package/dist/ui/Tabs.d.ts +0 -11
- package/dist/ui/Tabs.js +0 -293
- package/dist/ui/TextLabel.d.ts +0 -5
- package/dist/ui/TextLabel.js +0 -10
- package/dist/ui/Typo.d.ts +0 -35
- package/dist/ui/Typo.js +0 -28
- package/dist/ui/UIStory.d.ts +0 -8
- package/dist/ui/branding/FavIcon.d.ts +0 -5
- package/dist/ui/branding/FavIcon.js +0 -56
- package/dist/ui/branding/LogoShape.d.ts +0 -6
- package/dist/ui/branding/LogoShape.js +0 -52
- package/dist/ui/hook/UseAutoHide.d.ts +0 -8
- package/dist/ui/hook/UseAutoHide.js +0 -43
- package/dist/ui/hook/UseColorScheme.d.ts +0 -4
- package/dist/ui/hook/UseColorScheme.js +0 -13
- package/dist/ui/hook/UseContrastColor.d.ts +0 -1
- package/dist/ui/hook/UseContrastColor.js +0 -12
- package/dist/ui/hook/UseElementSize.d.ts +0 -6
- package/dist/ui/hook/UseElementSize.js +0 -52
- package/dist/ui/hook/UseForceUpdate.d.ts +0 -1
- package/dist/ui/hook/UseForceUpdate.js +0 -11
- package/dist/ui/hook/UseHash.d.ts +0 -1
- package/dist/ui/hook/UseHash.js +0 -24
- package/dist/ui/hook/UseInitialEffect.d.ts +0 -2
- package/dist/ui/hook/UseInitialEffect.js +0 -15
- package/dist/ui/hook/UseLocalStorage.d.ts +0 -1
- package/dist/ui/hook/UseLocalStorage.js +0 -36
- package/dist/ui/hook/UseNonInitialEffect.d.ts +0 -2
- package/dist/ui/hook/UseNonInitialEffect.js +0 -17
- package/dist/ui/hook/UseTrigger.d.ts +0 -7
- package/dist/ui/hook/UseTrigger.js +0 -29
- package/dist/ui/icons/IcAlignJustify.d.ts +0 -3
- package/dist/ui/icons/IcAlignJustify.js +0 -18
- package/dist/ui/icons/IcAlignLeft.d.ts +0 -2
- package/dist/ui/icons/IcAlignLeft.js +0 -16
- package/dist/ui/icons/IcAlignRight.d.ts +0 -2
- package/dist/ui/icons/IcAlignRight.js +0 -16
- package/dist/ui/icons/IcBaselineAccountCircle.d.ts +0 -2
- package/dist/ui/icons/IcBaselineAccountCircle.js +0 -26
- package/dist/ui/icons/IcBaselineContentCopy.d.ts +0 -2
- package/dist/ui/icons/IcBaselineContentCopy.js +0 -26
- package/dist/ui/icons/IcBaselineContentPasteGo.d.ts +0 -2
- package/dist/ui/icons/IcBaselineContentPasteGo.js +0 -35
- package/dist/ui/icons/IcBaselineDesktopMac.d.ts +0 -2
- package/dist/ui/icons/IcBaselineDesktopMac.js +0 -16
- package/dist/ui/icons/IcBaselineErrorOutline.d.ts +0 -2
- package/dist/ui/icons/IcBaselineErrorOutline.js +0 -26
- package/dist/ui/icons/IcBaselinePause.d.ts +0 -2
- package/dist/ui/icons/IcBaselinePause.js +0 -20
- package/dist/ui/icons/IcBaselinePhoneIphone.d.ts +0 -2
- package/dist/ui/icons/IcBaselinePhoneIphone.js +0 -16
- package/dist/ui/icons/IcBaselineWifiTethering.d.ts +0 -2
- package/dist/ui/icons/IcBaselineWifiTethering.js +0 -26
- package/dist/ui/icons/IcOutlineArchive.d.ts +0 -2
- package/dist/ui/icons/IcOutlineArchive.js +0 -26
- package/dist/ui/icons/IcOutlineArrowCircleRight.d.ts +0 -2
- package/dist/ui/icons/IcOutlineArrowCircleRight.js +0 -16
- package/dist/ui/icons/IcOutlineAvTimer.d.ts +0 -2
- package/dist/ui/icons/IcOutlineAvTimer.js +0 -26
- package/dist/ui/icons/IcOutlineCloudUpload.d.ts +0 -2
- package/dist/ui/icons/IcOutlineCloudUpload.js +0 -26
- package/dist/ui/icons/IcOutlineDarkMode.d.ts +0 -2
- package/dist/ui/icons/IcOutlineDarkMode.js +0 -16
- package/dist/ui/icons/IcOutlineDescription.d.ts +0 -2
- package/dist/ui/icons/IcOutlineDescription.js +0 -26
- package/dist/ui/icons/IcOutlineDrafts.d.ts +0 -2
- package/dist/ui/icons/IcOutlineDrafts.js +0 -26
- package/dist/ui/icons/IcOutlineFolder.d.ts +0 -2
- package/dist/ui/icons/IcOutlineFolder.js +0 -26
- package/dist/ui/icons/IcOutlineInsertDriveFile.d.ts +0 -2
- package/dist/ui/icons/IcOutlineInsertDriveFile.js +0 -26
- package/dist/ui/icons/IcOutlineKeyboardTab.d.ts +0 -2
- package/dist/ui/icons/IcOutlineKeyboardTab.js +0 -26
- package/dist/ui/icons/IcOutlineLightMode.d.ts +0 -2
- package/dist/ui/icons/IcOutlineLightMode.js +0 -16
- package/dist/ui/icons/IcOutlineList.d.ts +0 -3
- package/dist/ui/icons/IcOutlineList.js +0 -18
- package/dist/ui/icons/IcOutlineLock.d.ts +0 -2
- package/dist/ui/icons/IcOutlineLock.js +0 -26
- package/dist/ui/icons/IcOutlineMoreHoriz.d.ts +0 -3
- package/dist/ui/icons/IcOutlineMoreHoriz.js +0 -18
- package/dist/ui/icons/IcOutlinePreview.d.ts +0 -2
- package/dist/ui/icons/IcOutlinePreview.js +0 -16
- package/dist/ui/icons/IcOutlineRemoveRedEye.d.ts +0 -2
- package/dist/ui/icons/IcOutlineRemoveRedEye.js +0 -26
- package/dist/ui/icons/IcOutlineScreenshot.d.ts +0 -2
- package/dist/ui/icons/IcOutlineScreenshot.js +0 -16
- package/dist/ui/icons/IcOutlineTableRows.d.ts +0 -2
- package/dist/ui/icons/IcOutlineTableRows.js +0 -26
- package/dist/ui/icons/IcRoundAdd.d.ts +0 -2
- package/dist/ui/icons/IcRoundAdd.js +0 -16
- package/dist/ui/icons/IcRoundAddCircle.d.ts +0 -3
- package/dist/ui/icons/IcRoundAddCircle.js +0 -18
- package/dist/ui/icons/IcRoundAddCircleOutline.d.ts +0 -2
- package/dist/ui/icons/IcRoundAddCircleOutline.js +0 -16
- package/dist/ui/icons/IcRoundArchive.d.ts +0 -2
- package/dist/ui/icons/IcRoundArchive.js +0 -16
- package/dist/ui/icons/IcRoundArrowBack.d.ts +0 -2
- package/dist/ui/icons/IcRoundArrowBack.js +0 -16
- package/dist/ui/icons/IcRoundArrowDownward.d.ts +0 -2
- package/dist/ui/icons/IcRoundArrowDownward.js +0 -26
- package/dist/ui/icons/IcRoundArrowDropDown.d.ts +0 -3
- package/dist/ui/icons/IcRoundArrowDropDown.js +0 -18
- package/dist/ui/icons/IcRoundArrowDropDownCircle.d.ts +0 -3
- package/dist/ui/icons/IcRoundArrowDropDownCircle.js +0 -18
- package/dist/ui/icons/IcRoundArrowDropUp.d.ts +0 -3
- package/dist/ui/icons/IcRoundArrowDropUp.js +0 -18
- package/dist/ui/icons/IcRoundArrowForward.d.ts +0 -2
- package/dist/ui/icons/IcRoundArrowForward.js +0 -16
- package/dist/ui/icons/IcRoundArrowUpward.d.ts +0 -2
- package/dist/ui/icons/IcRoundArrowUpward.js +0 -26
- package/dist/ui/icons/IcRoundAttachFile.d.ts +0 -2
- package/dist/ui/icons/IcRoundAttachFile.js +0 -10
- package/dist/ui/icons/IcRoundCheck.d.ts +0 -2
- package/dist/ui/icons/IcRoundCheck.js +0 -16
- package/dist/ui/icons/IcRoundCheckBox.d.ts +0 -2
- package/dist/ui/icons/IcRoundCheckBox.js +0 -16
- package/dist/ui/icons/IcRoundCheckBoxOutlineBlank.d.ts +0 -2
- package/dist/ui/icons/IcRoundCheckBoxOutlineBlank.js +0 -16
- package/dist/ui/icons/IcRoundChevronRight.d.ts +0 -2
- package/dist/ui/icons/IcRoundChevronRight.js +0 -26
- package/dist/ui/icons/IcRoundDescription.d.ts +0 -2
- package/dist/ui/icons/IcRoundDescription.js +0 -26
- package/dist/ui/icons/IcRoundDragHandle.d.ts +0 -3
- package/dist/ui/icons/IcRoundDragHandle.js +0 -18
- package/dist/ui/icons/IcRoundExitToApp.d.ts +0 -2
- package/dist/ui/icons/IcRoundExitToApp.js +0 -26
- package/dist/ui/icons/IcRoundFeed.d.ts +0 -2
- package/dist/ui/icons/IcRoundFeed.js +0 -16
- package/dist/ui/icons/IcRoundFormatBold.d.ts +0 -3
- package/dist/ui/icons/IcRoundFormatBold.js +0 -18
- package/dist/ui/icons/IcRoundFormatClear.d.ts +0 -3
- package/dist/ui/icons/IcRoundFormatClear.js +0 -18
- package/dist/ui/icons/IcRoundFormatItalic.d.ts +0 -3
- package/dist/ui/icons/IcRoundFormatItalic.js +0 -18
- package/dist/ui/icons/IcRoundFormatListBulleted.d.ts +0 -3
- package/dist/ui/icons/IcRoundFormatListBulleted.js +0 -18
- package/dist/ui/icons/IcRoundFormatPaint.d.ts +0 -2
- package/dist/ui/icons/IcRoundFormatPaint.js +0 -10
- package/dist/ui/icons/IcRoundHamburger.d.ts +0 -3
- package/dist/ui/icons/IcRoundHamburger.js +0 -18
- package/dist/ui/icons/IcRoundHdrStrong.d.ts +0 -3
- package/dist/ui/icons/IcRoundHdrStrong.js +0 -18
- package/dist/ui/icons/IcRoundHorizontalRule.d.ts +0 -3
- package/dist/ui/icons/IcRoundHorizontalRule.js +0 -19
- package/dist/ui/icons/IcRoundInsertDriveFile.d.ts +0 -2
- package/dist/ui/icons/IcRoundInsertDriveFile.js +0 -16
- package/dist/ui/icons/IcRoundKeyboardArrowDown.d.ts +0 -2
- package/dist/ui/icons/IcRoundKeyboardArrowDown.js +0 -16
- package/dist/ui/icons/IcRoundKeyboardArrowLeft.d.ts +0 -3
- package/dist/ui/icons/IcRoundKeyboardArrowLeft.js +0 -18
- package/dist/ui/icons/IcRoundKeyboardArrowRight.d.ts +0 -2
- package/dist/ui/icons/IcRoundKeyboardArrowRight.js +0 -16
- package/dist/ui/icons/IcRoundKeyboardArrowUp.d.ts +0 -2
- package/dist/ui/icons/IcRoundKeyboardArrowUp.js +0 -16
- package/dist/ui/icons/IcRoundLanguage.d.ts +0 -2
- package/dist/ui/icons/IcRoundLanguage.js +0 -16
- package/dist/ui/icons/IcRoundLastPage.d.ts +0 -2
- package/dist/ui/icons/IcRoundLastPage.js +0 -26
- package/dist/ui/icons/IcRoundLock.d.ts +0 -3
- package/dist/ui/icons/IcRoundLock.js +0 -18
- package/dist/ui/icons/IcRoundMenu.d.ts +0 -2
- package/dist/ui/icons/IcRoundMenu.js +0 -16
- package/dist/ui/icons/IcRoundMoreHoriz.d.ts +0 -2
- package/dist/ui/icons/IcRoundMoreHoriz.js +0 -16
- package/dist/ui/icons/IcRoundMoreVert.d.ts +0 -2
- package/dist/ui/icons/IcRoundMoreVert.js +0 -26
- package/dist/ui/icons/IcRoundNorthEast.d.ts +0 -2
- package/dist/ui/icons/IcRoundNorthEast.js +0 -16
- package/dist/ui/icons/IcRoundNotes.d.ts +0 -2
- package/dist/ui/icons/IcRoundNotes.js +0 -16
- package/dist/ui/icons/IcRoundNumbers.d.ts +0 -2
- package/dist/ui/icons/IcRoundNumbers.js +0 -16
- package/dist/ui/icons/IcRoundPermMedia.d.ts +0 -2
- package/dist/ui/icons/IcRoundPermMedia.js +0 -25
- package/dist/ui/icons/IcRoundPublish.d.ts +0 -2
- package/dist/ui/icons/IcRoundPublish.js +0 -16
- package/dist/ui/icons/IcRoundPublishedWithChanges.d.ts +0 -2
- package/dist/ui/icons/IcRoundPublishedWithChanges.js +0 -26
- package/dist/ui/icons/IcRoundQuote.d.ts +0 -2
- package/dist/ui/icons/IcRoundQuote.js +0 -16
- package/dist/ui/icons/IcRoundRedo.d.ts +0 -3
- package/dist/ui/icons/IcRoundRedo.js +0 -18
- package/dist/ui/icons/IcRoundRemoveCircleOutline.d.ts +0 -2
- package/dist/ui/icons/IcRoundRemoveCircleOutline.js +0 -16
- package/dist/ui/icons/IcRoundRotateLeft.d.ts +0 -2
- package/dist/ui/icons/IcRoundRotateLeft.js +0 -16
- package/dist/ui/icons/IcRoundSend.d.ts +0 -2
- package/dist/ui/icons/IcRoundSend.js +0 -26
- package/dist/ui/icons/IcRoundSouthWest.d.ts +0 -2
- package/dist/ui/icons/IcRoundSouthWest.js +0 -16
- package/dist/ui/icons/IcRoundSubscript.d.ts +0 -2
- package/dist/ui/icons/IcRoundSubscript.js +0 -26
- package/dist/ui/icons/IcRoundSuperscript.d.ts +0 -2
- package/dist/ui/icons/IcRoundSuperscript.js +0 -26
- package/dist/ui/icons/IcRoundTabletMac.d.ts +0 -2
- package/dist/ui/icons/IcRoundTabletMac.js +0 -16
- package/dist/ui/icons/IcRoundTextFields.d.ts +0 -2
- package/dist/ui/icons/IcRoundTextFields.js +0 -16
- package/dist/ui/icons/IcRoundTranslate.d.ts +0 -2
- package/dist/ui/icons/IcRoundTranslate.js +0 -26
- package/dist/ui/icons/IcRoundUndo.d.ts +0 -3
- package/dist/ui/icons/IcRoundUndo.js +0 -18
- package/dist/ui/icons/IcRoundUnfoldLess.d.ts +0 -2
- package/dist/ui/icons/IcRoundUnfoldLess.js +0 -26
- package/dist/ui/icons/IcRoundUnfoldMore.d.ts +0 -2
- package/dist/ui/icons/IcRoundUnfoldMore.js +0 -16
- package/dist/ui/icons/IcRoundUploadFile.d.ts +0 -3
- package/dist/ui/icons/IcRoundUploadFile.js +0 -18
- package/dist/ui/icons/IcRoundVisibilityOff.d.ts +0 -2
- package/dist/ui/icons/IcRoundVisibilityOff.js +0 -16
- package/dist/ui/icons/IcRoundWarning.d.ts +0 -2
- package/dist/ui/icons/IcRoundWarning.js +0 -16
- package/dist/ui/icons/IcSharpBrightnessMedium.d.ts +0 -2
- package/dist/ui/icons/IcSharpBrightnessMedium.js +0 -16
- package/dist/ui/icons/IcSharpVerticalAlignCenter.d.ts +0 -2
- package/dist/ui/icons/IcSharpVerticalAlignCenter.js +0 -16
- package/dist/ui/icons/IcTwotoneDescription.d.ts +0 -2
- package/dist/ui/icons/IcTwotoneDescription.js +0 -37
- package/dist/ui/icons/IcTwotoneFolder.d.ts +0 -2
- package/dist/ui/icons/IcTwotoneFolder.js +0 -37
- package/dist/ui/icons/IcTwotoneInsertDriveFile.d.ts +0 -2
- package/dist/ui/icons/IcTwotoneInsertDriveFile.js +0 -30
- package/dist/ui/icons/MdiGithub.d.ts +0 -3
- package/dist/ui/icons/MdiGithub.js +0 -18
- package/dist/ui/icons/MdiSourceBranch.d.ts +0 -2
- package/dist/ui/icons/MdiSourceBranch.js +0 -16
- package/dist/ui/icons/MdiTwitterCircle.d.ts +0 -2
- package/dist/ui/icons/MdiTwitterCircle.js +0 -26
- package/dist/ui/icons/MiLayers.d.ts +0 -3
- package/dist/ui/icons/MiLayers.js +0 -16
- package/dist/ui/icons/PhGlobe.d.ts +0 -2
- package/dist/ui/icons/PhGlobe.js +0 -26
- package/dist/ui/icons/RiFlashlightFill.d.ts +0 -2
- package/dist/ui/icons/RiFlashlightFill.js +0 -10
- package/dist/ui/icons/TableDelete.d.ts +0 -2
- package/dist/ui/icons/TableDelete.js +0 -25
- package/dist/ui/icons/TableDeleteColumn.d.ts +0 -2
- package/dist/ui/icons/TableDeleteColumn.js +0 -16
- package/dist/ui/icons/TableDeleteRow.d.ts +0 -2
- package/dist/ui/icons/TableDeleteRow.js +0 -16
- package/dist/ui/icons/TableHeaderCell.d.ts +0 -2
- package/dist/ui/icons/TableHeaderCell.js +0 -16
- package/dist/ui/icons/TableHeaderColumn.d.ts +0 -2
- package/dist/ui/icons/TableHeaderColumn.js +0 -16
- package/dist/ui/icons/TableHeaderRow.d.ts +0 -2
- package/dist/ui/icons/TableHeaderRow.js +0 -16
- package/dist/ui/icons/TableInsertColumnAfter.d.ts +0 -2
- package/dist/ui/icons/TableInsertColumnAfter.js +0 -16
- package/dist/ui/icons/TableInsertColumnBefore.d.ts +0 -2
- package/dist/ui/icons/TableInsertColumnBefore.js +0 -16
- package/dist/ui/icons/TableInsertRowAfter.d.ts +0 -2
- package/dist/ui/icons/TableInsertRowAfter.js +0 -16
- package/dist/ui/icons/TableInsertRowBefore.d.ts +0 -2
- package/dist/ui/icons/TableInsertRowBefore.js +0 -16
- package/dist/ui/icons/TableMergeCells.d.ts +0 -2
- package/dist/ui/icons/TableMergeCells.js +0 -16
- package/dist/ui/icons/TableSplitCell.d.ts +0 -2
- package/dist/ui/icons/TableSplitCell.js +0 -16
- package/dist/ui/util/ContrastColor.d.ts +0 -1
- package/dist/ui/util/ContrastColor.js +0 -17
- package/dist/ui/util/CreateTypo.d.ts +0 -62
- package/dist/ui/util/CreateTypo.js +0 -119
- package/dist/ui/util/Elevation.d.ts +0 -12
- package/dist/ui/util/Elevation.js +0 -20
- package/dist/ui/util/PropsWithAs.d.ts +0 -12
- package/dist/ui/util/PropsWithAs.js +0 -10
- package/dist/ui/util/Slots.d.ts +0 -11
- package/dist/ui/util/Slots.js +0 -50
- package/dist/ui/util/TextareaAutosize.d.ts +0 -2
- package/dist/ui/util/TextareaAutosize.js +0 -40
- package/dist/ui/util/Units.d.ts +0 -1
- package/dist/ui/util/Units.js +0 -7
- package/dist/ui/util/UseId.d.ts +0 -1
- package/dist/ui/util/UseId.js +0 -11
- package/dist/yjs.d.ts +0 -1
- package/dist/yjs.js +0 -206
- /package/dist/{core/Shape.js → chunks/chunk-NUFRM6SI.js} +0 -0
- /package/dist/{backend/Handler.test.d.ts → dashboard/app/EntrySidebarPreview.spec.d.ts} +0 -0
- /package/dist/{backend/router/Router.test.d.ts → dashboard/app/WorkspaceMenu.spec.d.ts} +0 -0
- /package/dist/{cli/Init.test.d.ts → field/link/LinkField.spec.d.ts} +0 -0
- /package/dist/{cli/util/CommitMessage.test.d.ts → field/list/ListField.spec.d.ts} +0 -0
- /package/dist/{core/Config.test.d.ts → field/richtext/RichTextField.spec.d.ts} +0 -0
|
@@ -1,419 +1,1501 @@
|
|
|
1
|
+
import "../../chunks/chunk-NUFRM6SI.js";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
unwrap
|
|
4
|
+
} from "../../chunks/chunk-STAJCW4Z.js";
|
|
5
|
+
import {
|
|
6
|
+
useAtomValue,
|
|
7
|
+
useSetAtom
|
|
8
|
+
} from "../../chunks/chunk-U4VOHNR2.js";
|
|
9
|
+
import {
|
|
10
|
+
atom
|
|
11
|
+
} from "../../chunks/chunk-Y7XOMJOC.js";
|
|
12
|
+
import "../../chunks/chunk-IWN3T3FL.js";
|
|
13
|
+
import "../../chunks/chunk-RKDPDEF7.js";
|
|
14
|
+
import "../../chunks/chunk-SJBZFMQ2.js";
|
|
15
|
+
import {
|
|
16
|
+
$5d3a17cc2564e64f$export$905ab40ac2179daa,
|
|
17
|
+
$74812c42150b3de8$export$7941f8aafa4b6021,
|
|
18
|
+
$f302ef02e940a6f8$export$ccdee5eaf73cf661
|
|
19
|
+
} from "../../chunks/chunk-YK3OSMDM.js";
|
|
18
20
|
import {
|
|
19
21
|
dist_default
|
|
20
|
-
} from "../../chunks/chunk-
|
|
21
|
-
import "../../chunks/chunk-
|
|
22
|
+
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
23
|
+
import "../../chunks/chunk-CQ52GEHY.js";
|
|
22
24
|
|
|
23
25
|
// src/field/link/LinkField.view.tsx
|
|
24
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
Button,
|
|
28
|
+
DialogTrigger,
|
|
29
|
+
Icon,
|
|
30
|
+
List,
|
|
31
|
+
ListCreateRow,
|
|
32
|
+
ListDragPreview,
|
|
33
|
+
ListLabel,
|
|
34
|
+
ListRow,
|
|
35
|
+
ListRowActions,
|
|
36
|
+
ListRowBadges,
|
|
37
|
+
ListRowBody,
|
|
38
|
+
ListRowDrag,
|
|
39
|
+
ListRowDragHandle,
|
|
40
|
+
ListRowFoldButton,
|
|
41
|
+
ListRowFooter,
|
|
42
|
+
ListRowHeader,
|
|
43
|
+
ListRowSettings,
|
|
44
|
+
MenuSeparator,
|
|
45
|
+
Popover,
|
|
46
|
+
Select,
|
|
47
|
+
SelectItem,
|
|
48
|
+
TextField
|
|
49
|
+
} from "alinea/components";
|
|
50
|
+
import { createId } from "alinea/core/Id";
|
|
51
|
+
import { getType, getWorkspace } from "alinea/core/Internal";
|
|
25
52
|
import { Reference } from "alinea/core/Reference";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import {
|
|
37
|
-
import { InputLabel } from "alinea/dashboard/view/InputLabel";
|
|
38
|
-
import { EntryReference } from "alinea/picker/entry/EntryReference";
|
|
39
|
-
import { UrlReference } from "alinea/picker/url/UrlPicker";
|
|
40
|
-
import { TextLabel } from "alinea/ui";
|
|
41
|
-
import { IcRoundAttachFile } from "alinea/ui/icons/IcRoundAttachFile";
|
|
42
|
-
import { IcRoundClose } from "alinea/ui/icons/IcRoundClose";
|
|
43
|
-
import IcRoundDragHandle from "alinea/ui/icons/IcRoundDragHandle";
|
|
44
|
-
import { IcRoundEdit } from "alinea/ui/icons/IcRoundEdit";
|
|
45
|
-
import { IcRoundLink } from "alinea/ui/icons/IcRoundLink";
|
|
46
|
-
import { IcRoundOpenInNew } from "alinea/ui/icons/IcRoundOpenInNew";
|
|
47
|
-
import { IcRoundPanorama } from "alinea/ui/icons/IcRoundPanorama";
|
|
48
|
-
import { Sink } from "alinea/ui/Sink";
|
|
53
|
+
import { Root } from "alinea/core/Root";
|
|
54
|
+
import { Type } from "alinea/core/Type";
|
|
55
|
+
import { Badge } from "alinea/dashboard/app/Badge";
|
|
56
|
+
import { CompactRecordFields } from "alinea/dashboard/app/CompactField";
|
|
57
|
+
import { NodeEditor } from "alinea/dashboard/app/EntryFields";
|
|
58
|
+
import { configAtom, graphAtom } from "alinea/dashboard/atoms/core";
|
|
59
|
+
import { linkEntryAtoms } from "alinea/dashboard/atoms/link";
|
|
60
|
+
import {
|
|
61
|
+
ExternalLinkPicker
|
|
62
|
+
} from "alinea/dashboard/app/ExternalLinkPicker";
|
|
63
|
+
import { ImagePicker } from "alinea/dashboard/app/ImagePicker";
|
|
49
64
|
import {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} from "
|
|
65
|
+
LinkPicker,
|
|
66
|
+
LinkPickerModal
|
|
67
|
+
} from "alinea/dashboard/app/LinkPicker";
|
|
68
|
+
import { nav } from "alinea/dashboard/atoms/nav";
|
|
69
|
+
import {
|
|
70
|
+
useEntry,
|
|
71
|
+
useField,
|
|
72
|
+
useFieldNode,
|
|
73
|
+
useFieldOptions,
|
|
74
|
+
useNodes,
|
|
75
|
+
useOptionalEntryAtoms
|
|
76
|
+
} from "alinea/dashboard/hooks";
|
|
77
|
+
import {
|
|
78
|
+
IcRoundAttachFile,
|
|
79
|
+
IcRoundAdd,
|
|
80
|
+
IcRoundClose,
|
|
81
|
+
IcRoundEdit,
|
|
82
|
+
IcRoundLink,
|
|
83
|
+
IcRoundMoreHoriz,
|
|
84
|
+
IcRoundOpenInNew,
|
|
85
|
+
IcRoundPanorama
|
|
86
|
+
} from "alinea/dashboard/icons";
|
|
87
|
+
import { Fragment, useMemo, useRef, useState } from "react";
|
|
53
88
|
|
|
54
|
-
// src/field/link/LinkField.module.
|
|
55
|
-
var
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
89
|
+
// src/field/link/LinkField.module.css
|
|
90
|
+
var LinkField_default = {
|
|
91
|
+
"LinkFieldView-previewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
|
|
92
|
+
"LinkFieldViewPreviewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
|
|
93
|
+
"LinkFieldView-skeleton-pulse": "alinea-LinkFieldView-skeleton-pulse",
|
|
94
|
+
"LinkFieldViewSkeletonPulse": "alinea-LinkFieldView-skeleton-pulse",
|
|
95
|
+
"LinkFieldView-title": "alinea-LinkFieldView-title",
|
|
96
|
+
"LinkFieldViewTitle": "alinea-LinkFieldView-title",
|
|
97
|
+
"LinkFieldView-metaLabel": "alinea-LinkFieldView-metaLabel",
|
|
98
|
+
"LinkFieldViewMetaLabel": "alinea-LinkFieldView-metaLabel",
|
|
99
|
+
"LinkFieldView-meta": "alinea-LinkFieldView-meta",
|
|
100
|
+
"LinkFieldViewMeta": "alinea-LinkFieldView-meta",
|
|
101
|
+
"LinkFieldView-anchorOption": "alinea-LinkFieldView-anchorOption",
|
|
102
|
+
"LinkFieldViewAnchorOption": "alinea-LinkFieldView-anchorOption",
|
|
103
|
+
"LinkFieldView-labelText": "alinea-LinkFieldView-labelText",
|
|
104
|
+
"LinkFieldViewLabelText": "alinea-LinkFieldView-labelText",
|
|
105
|
+
"is-missing": "alinea-is-missing",
|
|
106
|
+
"isMissing": "alinea-is-missing",
|
|
107
|
+
"LinkFieldView-type": "alinea-LinkFieldView-type",
|
|
108
|
+
"LinkFieldViewType": "alinea-LinkFieldView-type",
|
|
109
|
+
"is-wide": "alinea-is-wide",
|
|
110
|
+
"isWide": "alinea-is-wide",
|
|
111
|
+
"LinkFieldView-previewImage": "alinea-LinkFieldView-previewImage",
|
|
112
|
+
"LinkFieldViewPreviewImage": "alinea-LinkFieldView-previewImage",
|
|
113
|
+
"LinkFieldView-rowDropTarget": "alinea-LinkFieldView-rowDropTarget",
|
|
114
|
+
"LinkFieldViewRowDropTarget": "alinea-LinkFieldView-rowDropTarget",
|
|
115
|
+
"LinkFieldView-anchorOption-label": "alinea-LinkFieldView-anchorOption-label",
|
|
116
|
+
"LinkFieldViewAnchorOptionLabel": "alinea-LinkFieldView-anchorOption-label",
|
|
117
|
+
"LinkFieldView-dropIndicator": "alinea-LinkFieldView-dropIndicator",
|
|
118
|
+
"LinkFieldViewDropIndicator": "alinea-LinkFieldView-dropIndicator",
|
|
119
|
+
"LinkFieldView-icon": "alinea-LinkFieldView-icon",
|
|
120
|
+
"LinkFieldViewIcon": "alinea-LinkFieldView-icon",
|
|
121
|
+
"LinkFieldView-imagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
|
|
122
|
+
"LinkFieldViewImagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
|
|
123
|
+
"LinkFieldView-anchorOption-location": "alinea-LinkFieldView-anchorOption-location",
|
|
124
|
+
"LinkFieldViewAnchorOptionLocation": "alinea-LinkFieldView-anchorOption-location",
|
|
125
|
+
"LinkFieldView-label": "alinea-LinkFieldView-label",
|
|
126
|
+
"LinkFieldViewLabel": "alinea-LinkFieldView-label",
|
|
127
|
+
"LinkFieldView-create": "alinea-LinkFieldView-create",
|
|
128
|
+
"LinkFieldViewCreate": "alinea-LinkFieldView-create",
|
|
129
|
+
"LinkFieldView-image": "alinea-LinkFieldView-image",
|
|
130
|
+
"LinkFieldViewImage": "alinea-LinkFieldView-image",
|
|
131
|
+
"LinkFieldView-skeleton": "alinea-LinkFieldView-skeleton",
|
|
132
|
+
"LinkFieldViewSkeleton": "alinea-LinkFieldView-skeleton",
|
|
133
|
+
"is-loading": "alinea-is-loading",
|
|
134
|
+
"isLoading": "alinea-is-loading",
|
|
135
|
+
"LinkFieldView-createButton": "alinea-LinkFieldView-createButton",
|
|
136
|
+
"LinkFieldViewCreateButton": "alinea-LinkFieldView-createButton"
|
|
69
137
|
};
|
|
70
138
|
|
|
71
139
|
// src/field/link/LinkField.view.tsx
|
|
72
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
73
|
-
var styles = dist_default(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return IcRoundAttachFile;
|
|
82
|
-
case "image":
|
|
83
|
-
return IcRoundPanorama;
|
|
84
|
-
default:
|
|
85
|
-
return void 0;
|
|
86
|
-
}
|
|
140
|
+
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
141
|
+
var styles = dist_default(LinkField_default);
|
|
142
|
+
var LINK_FIELD_ROW_DRAG_TYPE = "application/x-alinea-link-field-row";
|
|
143
|
+
function LinkRowText({ node }) {
|
|
144
|
+
const type = useAtomValue(node.field("_type"));
|
|
145
|
+
if (type === "entry" || type === "image" || type === "file")
|
|
146
|
+
return /* @__PURE__ */ jsx(EntryRowLayer, { node, textOnly: true });
|
|
147
|
+
if (type === "url") return /* @__PURE__ */ jsx(UrlRow, { node, textOnly: true });
|
|
148
|
+
return null;
|
|
87
149
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
150
|
+
function isPickerType(type) {
|
|
151
|
+
return type === "entry" || type === "url" || type === "file" || type === "image";
|
|
152
|
+
}
|
|
153
|
+
function isLinkFieldRow(value) {
|
|
154
|
+
if (!value || typeof value !== "object") return false;
|
|
155
|
+
const type = value[Reference.type];
|
|
156
|
+
return typeof type === "string" && isPickerType(type);
|
|
157
|
+
}
|
|
158
|
+
function getPickerType(type) {
|
|
159
|
+
return isPickerType(type) ? type : "entry";
|
|
160
|
+
}
|
|
161
|
+
function getEntryPickerType(type) {
|
|
162
|
+
return type === "url" ? "entry" : type;
|
|
163
|
+
}
|
|
164
|
+
function EntryRowLayer({ hasFields, node, textOnly }) {
|
|
165
|
+
const entryId = useAtomValue(node.field("_entry"));
|
|
166
|
+
const type = useAtomValue(node.field("_type"));
|
|
167
|
+
if (!entryId) return null;
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
EntryRow,
|
|
170
|
+
{
|
|
171
|
+
entryId,
|
|
172
|
+
hasFields,
|
|
173
|
+
image: type === "image",
|
|
174
|
+
textOnly
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function EntryRow({ entryId, hasFields, image, textOnly }) {
|
|
179
|
+
const state = useLinkEntryState(entryId);
|
|
180
|
+
if (state.state === "hasData" && state.data)
|
|
181
|
+
return /* @__PURE__ */ jsx(
|
|
182
|
+
LoadedEntryRow,
|
|
105
183
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
onCancel: () => setPickFrom(void 0)
|
|
184
|
+
entry: state.data,
|
|
185
|
+
hasFields,
|
|
186
|
+
image,
|
|
187
|
+
textOnly
|
|
111
188
|
}
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
189
|
+
);
|
|
190
|
+
if (state.state !== "loading")
|
|
191
|
+
return /* @__PURE__ */ jsx(
|
|
192
|
+
MissingEntryRow,
|
|
115
193
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
194
|
+
entryId,
|
|
195
|
+
hasFields,
|
|
196
|
+
image,
|
|
197
|
+
textOnly
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
return /* @__PURE__ */ jsx(
|
|
201
|
+
EntryLoadingRow,
|
|
202
|
+
{
|
|
203
|
+
hasFields,
|
|
204
|
+
image,
|
|
205
|
+
pending: true,
|
|
206
|
+
textOnly
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function useLinkEntryState(entryId) {
|
|
211
|
+
return useAtomValue(linkEntryAtoms(entryId));
|
|
212
|
+
}
|
|
213
|
+
function MissingEntryRow({
|
|
214
|
+
entryId,
|
|
215
|
+
hasFields,
|
|
216
|
+
image,
|
|
217
|
+
textOnly
|
|
218
|
+
}) {
|
|
219
|
+
return /* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.label({ missing: true }), children: [
|
|
220
|
+
image && !textOnly && /* @__PURE__ */ jsx(
|
|
221
|
+
"span",
|
|
222
|
+
{
|
|
223
|
+
className: styles.LinkFieldView.imagePlaceholder(),
|
|
224
|
+
"data-has-fields": hasFields ? "true" : void 0,
|
|
225
|
+
"aria-hidden": "true"
|
|
124
226
|
}
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.labelText(), children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.title(), children: "Missing entry" }),
|
|
230
|
+
!textOnly && /* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.meta(), children: entryId })
|
|
231
|
+
] })
|
|
232
|
+
] });
|
|
233
|
+
}
|
|
234
|
+
function EntryLoadingRow({
|
|
235
|
+
hasFields,
|
|
236
|
+
image,
|
|
237
|
+
pending,
|
|
238
|
+
textOnly
|
|
239
|
+
}) {
|
|
240
|
+
return /* @__PURE__ */ jsxs(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
className: styles.LinkFieldView.label({ loading: true }),
|
|
244
|
+
"aria-busy": pending || void 0,
|
|
245
|
+
children: [
|
|
246
|
+
image && !textOnly && /* @__PURE__ */ jsx(
|
|
247
|
+
"span",
|
|
248
|
+
{
|
|
249
|
+
className: styles.LinkFieldView.imagePlaceholder(),
|
|
250
|
+
"data-has-fields": hasFields ? "true" : void 0,
|
|
251
|
+
"aria-hidden": "true"
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.labelText(), children: [
|
|
255
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.skeleton({ wide: true }) }),
|
|
256
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.skeleton() })
|
|
257
|
+
] })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
function LoadedEntryRow({
|
|
263
|
+
entry,
|
|
264
|
+
hasFields,
|
|
265
|
+
image,
|
|
266
|
+
textOnly
|
|
267
|
+
}) {
|
|
268
|
+
return /* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.label(), children: [
|
|
269
|
+
image && !textOnly && /* @__PURE__ */ jsx(EntryRowImage, { entry, hasFields }),
|
|
270
|
+
/* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.labelText(), children: [
|
|
271
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.title(), children: entry.title }),
|
|
272
|
+
entry.parents.length > 0 ? /* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.meta(), children: /* @__PURE__ */ jsx(EntryParents, { parents: entry.parents }) }) : null
|
|
273
|
+
] })
|
|
274
|
+
] });
|
|
275
|
+
}
|
|
276
|
+
function EntryRowImage({ entry, hasFields }) {
|
|
277
|
+
if (entry.preview) {
|
|
278
|
+
return /* @__PURE__ */ jsx(
|
|
279
|
+
"img",
|
|
280
|
+
{
|
|
281
|
+
alt: "",
|
|
282
|
+
className: styles.LinkFieldView.image(),
|
|
283
|
+
"data-has-fields": hasFields ? "true" : void 0,
|
|
284
|
+
src: entry.preview
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
function UrlRow({ node, textOnly }) {
|
|
291
|
+
const title = useAtomValue(node.field("_title"));
|
|
292
|
+
const url = useAtomValue(node.field("_url"));
|
|
293
|
+
return /* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.label(), children: [
|
|
294
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.title(), children: textOnly ? title || url : title || url }),
|
|
295
|
+
!textOnly && title && url && /* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.meta(), children: url })
|
|
296
|
+
] });
|
|
297
|
+
}
|
|
298
|
+
function EntryParents({ parents }) {
|
|
299
|
+
return /* @__PURE__ */ jsx(Fragment2, { children: parents.map((parent, index) => /* @__PURE__ */ jsxs("span", { children: [
|
|
300
|
+
parent.title,
|
|
301
|
+
index < parents.length - 1 ? " / " : ""
|
|
302
|
+
] }, parent.id)) });
|
|
303
|
+
}
|
|
304
|
+
function getLinkIcon(type) {
|
|
305
|
+
if (type === "url") return IcRoundOpenInNew;
|
|
306
|
+
if (type === "file") return IcRoundAttachFile;
|
|
307
|
+
if (type === "image") return IcRoundPanorama;
|
|
308
|
+
return IcRoundLink;
|
|
309
|
+
}
|
|
310
|
+
function createEntryLink(type, entryId, picker) {
|
|
311
|
+
return {
|
|
312
|
+
...initialFields(picker),
|
|
313
|
+
_id: createId(),
|
|
314
|
+
_type: getEntryPickerType(type),
|
|
315
|
+
_index: "",
|
|
316
|
+
_entry: entryId
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function createUrlLink(value, picker, current) {
|
|
320
|
+
return {
|
|
321
|
+
...current ?? initialFields(picker),
|
|
322
|
+
_id: current?._id ?? createId(),
|
|
323
|
+
_type: "url",
|
|
324
|
+
_index: current?._index ?? "",
|
|
325
|
+
_url: value.url,
|
|
326
|
+
_title: value.title,
|
|
327
|
+
_target: value.target
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function initialFields(picker) {
|
|
331
|
+
if (!picker.fields) return {};
|
|
332
|
+
return Type.initialValue(picker.fields);
|
|
333
|
+
}
|
|
334
|
+
function LinkPickerAction({
|
|
335
|
+
anchorRef,
|
|
336
|
+
ariaLabel,
|
|
337
|
+
buttonAppearance = "plain",
|
|
338
|
+
buttonIcon,
|
|
339
|
+
buttonSize,
|
|
340
|
+
children,
|
|
341
|
+
className,
|
|
342
|
+
isDisabled,
|
|
343
|
+
onPick,
|
|
344
|
+
onPickMany,
|
|
345
|
+
picker,
|
|
346
|
+
selection,
|
|
347
|
+
type,
|
|
348
|
+
value
|
|
349
|
+
}) {
|
|
350
|
+
const currentEntry = useEntry();
|
|
351
|
+
const config = useAtomValue(configAtom);
|
|
352
|
+
const selectedWorkspace = currentEntry?.workspace;
|
|
353
|
+
const selectedRoot = currentEntry?.root;
|
|
354
|
+
const selectedMediaRoot = mediaRoot(config, selectedWorkspace);
|
|
355
|
+
const options = picker.options;
|
|
356
|
+
const resolved = useResolvedEntryPickerOptions(options, type, currentEntry);
|
|
357
|
+
if (type === "url") {
|
|
358
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
359
|
+
/* @__PURE__ */ jsx(
|
|
360
|
+
Button,
|
|
361
|
+
{
|
|
362
|
+
"aria-label": ariaLabel,
|
|
363
|
+
appearance: buttonAppearance,
|
|
364
|
+
className,
|
|
365
|
+
icon: buttonIcon,
|
|
366
|
+
isDisabled,
|
|
367
|
+
size: buttonSize,
|
|
368
|
+
children
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
/* @__PURE__ */ jsx(
|
|
372
|
+
ExternalLinkPicker,
|
|
128
373
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
icon: getLinkIcon(name),
|
|
134
|
-
children: /* @__PURE__ */ jsx(TextLabel, { label: picker2.label })
|
|
374
|
+
initialValue: externalLinkValue(value),
|
|
375
|
+
selectionMode: "single",
|
|
376
|
+
submitLabel: value ? "Save link" : void 0,
|
|
377
|
+
onConfirm: (link) => onPick(createUrlLink(link, picker, value))
|
|
135
378
|
},
|
|
136
|
-
|
|
379
|
+
value?._id ?? "new"
|
|
380
|
+
)
|
|
381
|
+
] });
|
|
382
|
+
}
|
|
383
|
+
const childLocation = options.pickChildren && currentEntry ? {
|
|
384
|
+
workspace: currentEntry.workspace,
|
|
385
|
+
root: currentEntry.root,
|
|
386
|
+
parentId: currentEntry.id,
|
|
387
|
+
locale: currentEntry.locale
|
|
388
|
+
} : void 0;
|
|
389
|
+
const pickingChildren = Boolean(childLocation);
|
|
390
|
+
const fallbackRoot = type === "file" || type === "image" ? selectedMediaRoot : selectedRoot;
|
|
391
|
+
const fallbackLocation = selectedWorkspace && fallbackRoot ? { workspace: selectedWorkspace, root: fallbackRoot } : void 0;
|
|
392
|
+
const location = childLocation ?? resolved.location ?? fallbackLocation;
|
|
393
|
+
const condition = resolved.condition;
|
|
394
|
+
const handlesMultiple = Boolean(onPickMany && picker.handlesMultiple);
|
|
395
|
+
const pickerProps = {
|
|
396
|
+
condition,
|
|
397
|
+
initialView: type === "file" ? "row" : void 0,
|
|
398
|
+
initialResultMode: entryPickerResultMode(
|
|
399
|
+
type,
|
|
400
|
+
condition,
|
|
401
|
+
options.enableNavigation,
|
|
402
|
+
pickingChildren
|
|
403
|
+
),
|
|
404
|
+
initialSearchScope: entryPickerSearchScope(
|
|
405
|
+
condition,
|
|
406
|
+
resolved.location,
|
|
407
|
+
options.enableNavigation,
|
|
408
|
+
type
|
|
409
|
+
),
|
|
410
|
+
location,
|
|
411
|
+
limitLocations: options.limitLocations,
|
|
412
|
+
nestedNavigation: !pickingChildren,
|
|
413
|
+
pickChildren: pickingChildren,
|
|
414
|
+
preselect: false,
|
|
415
|
+
selectionMode: handlesMultiple ? "multiple" : "single",
|
|
416
|
+
selectionBehavior: handlesMultiple ? "toggle" : "replace",
|
|
417
|
+
initialSelection: initialSelection(value, selection),
|
|
418
|
+
onConfirm(selection2) {
|
|
419
|
+
const links = selection2.map(
|
|
420
|
+
(entryId) => createEntryLink(type, entryId, picker)
|
|
137
421
|
);
|
|
138
|
-
|
|
422
|
+
if (onPickMany) return onPickMany(links);
|
|
423
|
+
const [link] = links;
|
|
424
|
+
if (link) onPick(link);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
if (type === "file" || type === "image") {
|
|
428
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
429
|
+
/* @__PURE__ */ jsx(
|
|
430
|
+
Button,
|
|
431
|
+
{
|
|
432
|
+
"aria-label": ariaLabel,
|
|
433
|
+
appearance: buttonAppearance,
|
|
434
|
+
className,
|
|
435
|
+
icon: buttonIcon,
|
|
436
|
+
isDisabled,
|
|
437
|
+
size: buttonSize,
|
|
438
|
+
children
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ jsx(
|
|
442
|
+
ImagePicker,
|
|
443
|
+
{
|
|
444
|
+
...pickerProps,
|
|
445
|
+
label: type === "file" ? "Pick a file" : "Pick an image"
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
] });
|
|
449
|
+
}
|
|
450
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
451
|
+
/* @__PURE__ */ jsx(
|
|
452
|
+
Button,
|
|
453
|
+
{
|
|
454
|
+
"aria-label": ariaLabel,
|
|
455
|
+
appearance: buttonAppearance,
|
|
456
|
+
className,
|
|
457
|
+
icon: buttonIcon,
|
|
458
|
+
isDisabled,
|
|
459
|
+
size: buttonSize,
|
|
460
|
+
children
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
/* @__PURE__ */ jsx(LinkPicker, { ...pickerProps, anchorRef })
|
|
139
464
|
] });
|
|
140
465
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
466
|
+
function LinkPickerDialog({
|
|
467
|
+
isOpen,
|
|
468
|
+
onOpenChange,
|
|
469
|
+
onPick,
|
|
470
|
+
onPickMany,
|
|
471
|
+
picker,
|
|
472
|
+
selection,
|
|
473
|
+
type,
|
|
474
|
+
value
|
|
475
|
+
}) {
|
|
476
|
+
const currentEntry = useEntry();
|
|
477
|
+
const config = useAtomValue(configAtom);
|
|
478
|
+
const selectedWorkspace = currentEntry?.workspace;
|
|
479
|
+
const selectedRoot = currentEntry?.root;
|
|
480
|
+
const selectedMediaRoot = mediaRoot(config, selectedWorkspace);
|
|
481
|
+
const options = picker.options;
|
|
482
|
+
const resolved = useResolvedEntryPickerOptions(options, type, currentEntry);
|
|
483
|
+
function handlePick(link) {
|
|
484
|
+
onPick(link);
|
|
485
|
+
onOpenChange(false);
|
|
486
|
+
}
|
|
487
|
+
if (type === "url") {
|
|
488
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { isOpen, onOpenChange, children: [
|
|
489
|
+
/* @__PURE__ */ jsx(Button, { style: { display: "none" }, children: "Replace link" }),
|
|
490
|
+
/* @__PURE__ */ jsx(
|
|
491
|
+
ExternalLinkPicker,
|
|
492
|
+
{
|
|
493
|
+
initialValue: externalLinkValue(value),
|
|
494
|
+
selectionMode: "single",
|
|
495
|
+
submitLabel: value ? "Save link" : void 0,
|
|
496
|
+
onConfirm: (link) => handlePick(createUrlLink(link, picker, value))
|
|
497
|
+
},
|
|
498
|
+
value?._id ?? "new"
|
|
499
|
+
)
|
|
500
|
+
] });
|
|
501
|
+
}
|
|
502
|
+
const childLocation = options.pickChildren && currentEntry ? {
|
|
503
|
+
workspace: currentEntry.workspace,
|
|
504
|
+
root: currentEntry.root,
|
|
505
|
+
parentId: currentEntry.id
|
|
506
|
+
} : void 0;
|
|
507
|
+
const pickingChildren = Boolean(childLocation);
|
|
508
|
+
const fallbackRoot = type === "file" || type === "image" ? selectedMediaRoot : selectedRoot;
|
|
509
|
+
const fallbackLocation = selectedWorkspace && fallbackRoot ? { workspace: selectedWorkspace, root: fallbackRoot } : void 0;
|
|
510
|
+
const location = childLocation ?? resolved.location ?? fallbackLocation;
|
|
511
|
+
const condition = resolved.condition;
|
|
512
|
+
const handlesMultiple = Boolean(onPickMany && picker.handlesMultiple);
|
|
513
|
+
const pickerProps = {
|
|
514
|
+
condition,
|
|
515
|
+
initialView: type === "file" ? "row" : void 0,
|
|
516
|
+
initialResultMode: entryPickerResultMode(
|
|
517
|
+
type,
|
|
518
|
+
condition,
|
|
519
|
+
options.enableNavigation,
|
|
520
|
+
pickingChildren
|
|
521
|
+
),
|
|
522
|
+
initialSearchScope: entryPickerSearchScope(
|
|
523
|
+
condition,
|
|
524
|
+
resolved.location,
|
|
525
|
+
options.enableNavigation,
|
|
526
|
+
type
|
|
527
|
+
),
|
|
528
|
+
location,
|
|
529
|
+
limitLocations: options.limitLocations,
|
|
530
|
+
nestedNavigation: !pickingChildren,
|
|
531
|
+
pickChildren: pickingChildren,
|
|
532
|
+
preselect: false,
|
|
533
|
+
selectionMode: handlesMultiple ? "multiple" : "single",
|
|
534
|
+
selectionBehavior: handlesMultiple ? "toggle" : "replace",
|
|
535
|
+
initialSelection: initialSelection(value, selection),
|
|
536
|
+
onConfirm(selection2) {
|
|
537
|
+
const links = selection2.map(
|
|
538
|
+
(entryId) => createEntryLink(type, entryId, picker)
|
|
539
|
+
);
|
|
540
|
+
if (onPickMany) {
|
|
541
|
+
onPickMany(links);
|
|
542
|
+
onOpenChange(false);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
const [link] = links;
|
|
546
|
+
if (link) handlePick(link);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
if (type === "file" || type === "image") {
|
|
550
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { isOpen, onOpenChange, children: [
|
|
551
|
+
/* @__PURE__ */ jsx(Button, { style: { display: "none" }, children: "Replace link" }),
|
|
552
|
+
/* @__PURE__ */ jsx(
|
|
553
|
+
ImagePicker,
|
|
554
|
+
{
|
|
555
|
+
...pickerProps,
|
|
556
|
+
label: type === "file" ? "Pick a file" : "Pick an image"
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] });
|
|
560
|
+
}
|
|
561
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, { isOpen, onOpenChange, children: [
|
|
562
|
+
/* @__PURE__ */ jsx(Button, { style: { display: "none" }, children: "Replace link" }),
|
|
563
|
+
/* @__PURE__ */ jsx(LinkPickerModal, { ...pickerProps })
|
|
564
|
+
] });
|
|
565
|
+
}
|
|
566
|
+
function useResolvedEntryPickerOptions(options, type, entry) {
|
|
567
|
+
const { condition: conditionOption, location: locationOption } = options;
|
|
568
|
+
const resolvedAtom = useMemo(() => {
|
|
569
|
+
const initialValue = {
|
|
570
|
+
condition: typeof conditionOption === "function" ? void 0 : conditionOption,
|
|
571
|
+
location: typeof locationOption === "function" ? void 0 : locationOption
|
|
572
|
+
};
|
|
573
|
+
const resolved = atom(async (get) => {
|
|
574
|
+
if (type === "url") return { condition: void 0, location: void 0 };
|
|
575
|
+
if (!entry) return initialValue;
|
|
576
|
+
const info = { entry, graph: get(graphAtom) };
|
|
577
|
+
const condition = typeof conditionOption === "function" ? conditionOption(info) : conditionOption;
|
|
578
|
+
const location = typeof locationOption === "function" ? locationOption(info) : locationOption;
|
|
579
|
+
const [nextCondition, nextLocation] = await Promise.all([
|
|
580
|
+
condition,
|
|
581
|
+
location
|
|
582
|
+
]);
|
|
583
|
+
return { condition: nextCondition, location: nextLocation };
|
|
584
|
+
});
|
|
585
|
+
return unwrap(resolved, (previous) => previous ?? initialValue);
|
|
586
|
+
}, [conditionOption, entry, locationOption, type]);
|
|
587
|
+
return useAtomValue(resolvedAtom);
|
|
588
|
+
}
|
|
589
|
+
function entryPickerSearchScope(condition, location, enableNavigation, type) {
|
|
590
|
+
if (type === "file" || type === "image") return "workspace";
|
|
591
|
+
return condition && !location && enableNavigation !== true ? "everything" : "workspace";
|
|
592
|
+
}
|
|
593
|
+
function entryPickerResultMode(type, condition, enableNavigation, pickChildren) {
|
|
594
|
+
return pickChildren || type !== "image" && condition && enableNavigation !== true ? "matches" : "browse";
|
|
595
|
+
}
|
|
596
|
+
function externalLinkValue(value) {
|
|
597
|
+
if (value?.[Reference.type] !== "url") return void 0;
|
|
598
|
+
return {
|
|
599
|
+
url: value._url,
|
|
600
|
+
title: value._title,
|
|
601
|
+
target: value._target
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function initialSelection(value, selection = []) {
|
|
605
|
+
if (value && "_entry" in value) return [value._entry];
|
|
606
|
+
return selection.flatMap((row) => "_entry" in row ? [row._entry] : []);
|
|
607
|
+
}
|
|
608
|
+
function mediaRoot(config, workspaceName) {
|
|
609
|
+
if (!workspaceName) return void 0;
|
|
610
|
+
const workspace = config.workspaces[workspaceName];
|
|
611
|
+
if (!workspace) return void 0;
|
|
612
|
+
return Object.entries(getWorkspace(workspace).roots).find(
|
|
613
|
+
([, root]) => Root.isMediaRoot(root)
|
|
614
|
+
)?.[0];
|
|
615
|
+
}
|
|
616
|
+
function insertIndex(rowIndex, position) {
|
|
617
|
+
return position === "before" ? rowIndex : rowIndex + 1;
|
|
618
|
+
}
|
|
619
|
+
function reorderIndex(fromIndex, targetIndex) {
|
|
620
|
+
return fromIndex < targetIndex ? targetIndex - 1 : targetIndex;
|
|
621
|
+
}
|
|
622
|
+
function dragRowItem(id) {
|
|
623
|
+
return {
|
|
624
|
+
"text/plain": id,
|
|
625
|
+
[LINK_FIELD_ROW_DRAG_TYPE]: id
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function rowDropPosition(row, y) {
|
|
629
|
+
if (!row) return "after";
|
|
630
|
+
return y < row.offsetHeight / 2 ? "before" : "after";
|
|
631
|
+
}
|
|
632
|
+
async function getDraggedRowId(items, dragType) {
|
|
633
|
+
for (const item of items) {
|
|
634
|
+
if (item.kind === "text" && item.types.has(dragType) && item.getText) {
|
|
635
|
+
return item.getText(dragType);
|
|
158
636
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
637
|
+
}
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
function SingleLinkCreateActions({ field, value }) {
|
|
641
|
+
const options = useFieldOptions(field);
|
|
642
|
+
const [, setValue] = useField(field);
|
|
643
|
+
const anchorRef = useRef(null);
|
|
644
|
+
if (options.readOnly) return null;
|
|
645
|
+
return /* @__PURE__ */ jsx("div", { className: styles.LinkFieldView.create(), ref: anchorRef, children: Object.entries(options.pickers).map(([type, picker]) => /* @__PURE__ */ jsxs(
|
|
646
|
+
LinkPickerAction,
|
|
647
|
+
{
|
|
648
|
+
anchorRef,
|
|
649
|
+
buttonSize: "small",
|
|
650
|
+
className: styles.LinkFieldView.createButton(),
|
|
651
|
+
onPick: setValue,
|
|
652
|
+
picker,
|
|
653
|
+
type,
|
|
654
|
+
value: value?._type === type ? value : void 0,
|
|
655
|
+
children: [
|
|
656
|
+
/* @__PURE__ */ jsx(
|
|
657
|
+
Icon,
|
|
658
|
+
{
|
|
659
|
+
"aria-hidden": true,
|
|
660
|
+
icon: options.isEntryField ? IcRoundAdd : getLinkIcon(type)
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
options.isEntryField ? options.label : picker.label
|
|
664
|
+
]
|
|
665
|
+
},
|
|
666
|
+
type
|
|
667
|
+
)) });
|
|
668
|
+
}
|
|
669
|
+
function MultipleLinkCreateActions({ field }) {
|
|
670
|
+
const options = useFieldOptions(field);
|
|
671
|
+
const [value, setValue] = useField(field);
|
|
672
|
+
const anchorRef = useRef(null);
|
|
673
|
+
const links = value ?? [];
|
|
674
|
+
const showCreate = options.max ? links.length < options.max : true;
|
|
675
|
+
if (options.readOnly) return null;
|
|
676
|
+
if (!showCreate) return null;
|
|
677
|
+
return /* @__PURE__ */ jsx("div", { className: styles.LinkFieldView.create(), ref: anchorRef, children: Object.entries(options.pickers).map(([type, picker]) => /* @__PURE__ */ jsxs(
|
|
678
|
+
LinkPickerAction,
|
|
679
|
+
{
|
|
680
|
+
anchorRef,
|
|
681
|
+
buttonSize: "small",
|
|
682
|
+
className: styles.LinkFieldView.createButton(),
|
|
683
|
+
onPick: (link) => {
|
|
684
|
+
setValue((links2) => [...links2 ?? [], link]);
|
|
685
|
+
},
|
|
686
|
+
onPickMany: (picked) => setValue((links2) => [...links2 ?? [], ...picked]),
|
|
687
|
+
picker,
|
|
688
|
+
selection: links.filter((row) => row._type === type),
|
|
689
|
+
type,
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ jsx(
|
|
692
|
+
Icon,
|
|
693
|
+
{
|
|
694
|
+
"aria-hidden": true,
|
|
695
|
+
icon: options.isEntryField ? IcRoundAdd : getLinkIcon(type)
|
|
696
|
+
}
|
|
697
|
+
),
|
|
698
|
+
options.isEntryField ? options.label : picker.label
|
|
699
|
+
]
|
|
700
|
+
},
|
|
701
|
+
type
|
|
702
|
+
)) });
|
|
703
|
+
}
|
|
704
|
+
function LinkRowEditor({ node, picker }) {
|
|
705
|
+
if (!picker?.fields) return null;
|
|
706
|
+
return /* @__PURE__ */ jsx(NodeEditor, { node, type: picker.fields });
|
|
707
|
+
}
|
|
708
|
+
function LinkRowActions({
|
|
709
|
+
closeActions,
|
|
710
|
+
isDisabled,
|
|
711
|
+
picker,
|
|
712
|
+
type,
|
|
713
|
+
value,
|
|
714
|
+
onEdit
|
|
715
|
+
}) {
|
|
716
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
717
|
+
/* @__PURE__ */ jsx(
|
|
718
|
+
LinkRowReferenceActions,
|
|
719
|
+
{
|
|
720
|
+
closeActions,
|
|
721
|
+
type,
|
|
722
|
+
value
|
|
164
723
|
}
|
|
165
|
-
|
|
724
|
+
),
|
|
725
|
+
picker && /* @__PURE__ */ jsx(
|
|
726
|
+
Button,
|
|
727
|
+
{
|
|
728
|
+
"aria-label": "Replace link",
|
|
729
|
+
appearance: "plain",
|
|
730
|
+
icon: IcRoundEdit,
|
|
731
|
+
isDisabled,
|
|
732
|
+
onPress: () => {
|
|
733
|
+
closeActions();
|
|
734
|
+
onEdit();
|
|
735
|
+
},
|
|
736
|
+
children: "Replace link"
|
|
737
|
+
}
|
|
738
|
+
)
|
|
739
|
+
] });
|
|
740
|
+
}
|
|
741
|
+
function LinkLabelField({ isDisabled, node, value }) {
|
|
742
|
+
const customLabel = useAtomValue(node.field("_label"));
|
|
743
|
+
const setCustomLabel = useSetAtom(node.field("_label"));
|
|
744
|
+
if ("_entry" in value) {
|
|
745
|
+
return /* @__PURE__ */ jsx(
|
|
746
|
+
EntryLinkLabelField,
|
|
747
|
+
{
|
|
748
|
+
customLabel,
|
|
749
|
+
entryId: value._entry,
|
|
750
|
+
isDisabled,
|
|
751
|
+
onChange: setCustomLabel
|
|
752
|
+
}
|
|
753
|
+
);
|
|
166
754
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
755
|
+
return /* @__PURE__ */ jsx(
|
|
756
|
+
ResolvedLinkLabelField,
|
|
757
|
+
{
|
|
758
|
+
customLabel,
|
|
759
|
+
isDisabled,
|
|
760
|
+
onChange: setCustomLabel
|
|
761
|
+
}
|
|
174
762
|
);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
763
|
+
}
|
|
764
|
+
function EntryLinkSuffixField({
|
|
765
|
+
isDisabled,
|
|
766
|
+
node,
|
|
767
|
+
value
|
|
768
|
+
}) {
|
|
769
|
+
const suffix = useAtomValue(node.field("_suffix"));
|
|
770
|
+
const setSuffix = useSetAtom(node.field("_suffix"));
|
|
771
|
+
if (value[Reference.type] !== "entry") return null;
|
|
772
|
+
return /* @__PURE__ */ jsx(
|
|
773
|
+
TextField,
|
|
774
|
+
{
|
|
775
|
+
description: "E.g. ?s=search",
|
|
776
|
+
isDisabled,
|
|
777
|
+
label: "URL suffix",
|
|
778
|
+
onChange: (next) => setSuffix(next || void 0),
|
|
779
|
+
value: suffix ?? ""
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
function EntryAnchorField({ node, value }) {
|
|
784
|
+
const anchor = useAtomValue(node.field("_anchor"));
|
|
785
|
+
const setAnchor = useSetAtom(node.field("_anchor"));
|
|
786
|
+
if (value[Reference.type] !== "entry") return null;
|
|
787
|
+
return /* @__PURE__ */ jsx(
|
|
788
|
+
EntryAnchorFieldInner,
|
|
789
|
+
{
|
|
790
|
+
anchor,
|
|
791
|
+
entryId: value._entry,
|
|
792
|
+
onChange: setAnchor
|
|
793
|
+
}
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
function EntryAnchorBadge({ node, value }) {
|
|
797
|
+
const anchor = useAtomValue(node.field("_anchor"));
|
|
798
|
+
if (value[Reference.type] !== "entry" || !anchor) return null;
|
|
799
|
+
return /* @__PURE__ */ jsxs(Badge, { size: "small", children: [
|
|
800
|
+
"#",
|
|
801
|
+
anchor
|
|
802
|
+
] });
|
|
803
|
+
}
|
|
804
|
+
function EntryAnchorFieldInner({
|
|
805
|
+
anchor,
|
|
806
|
+
entryId,
|
|
807
|
+
onChange
|
|
808
|
+
}) {
|
|
809
|
+
const state = useLinkEntryState(entryId);
|
|
810
|
+
const anchors = state.state === "hasData" ? state.data?.anchors ?? [] : [];
|
|
811
|
+
return /* @__PURE__ */ jsx(
|
|
812
|
+
Select,
|
|
813
|
+
{
|
|
814
|
+
items: anchors,
|
|
815
|
+
label: "Anchor",
|
|
816
|
+
onChange: (next) => onChange(next === null ? void 0 : String(next)),
|
|
817
|
+
value: anchor ?? null,
|
|
818
|
+
children: (item) => /* @__PURE__ */ jsx(SelectItem, { id: item.id, textValue: item.label ?? `#${item.id}`, children: /* @__PURE__ */ jsxs("span", { className: styles.LinkFieldView.anchorOption(), children: [
|
|
819
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.anchorOption.label(), children: item.label ?? `#${item.id}` }),
|
|
820
|
+
/* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.anchorOption.location(), children: item.fieldLabel ?? item.fieldPath })
|
|
821
|
+
] }) })
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
function LinkMetaLabel({ className, node, value }) {
|
|
826
|
+
const customLabel = useAtomValue(node.field("_label"));
|
|
827
|
+
if ("_entry" in value) {
|
|
828
|
+
return /* @__PURE__ */ jsx(
|
|
829
|
+
EntryLinkMetaLabel,
|
|
830
|
+
{
|
|
831
|
+
className,
|
|
832
|
+
customLabel,
|
|
833
|
+
entryId: value._entry
|
|
834
|
+
}
|
|
835
|
+
);
|
|
178
836
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
837
|
+
return /* @__PURE__ */ jsx(
|
|
838
|
+
ResolvedLinkMetaLabel,
|
|
839
|
+
{
|
|
840
|
+
className,
|
|
841
|
+
label: customLabel || linkFallbackLabel(value)
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
function linkFallbackLabel(value) {
|
|
846
|
+
if ("_title" in value && value._title) return value._title;
|
|
847
|
+
if ("_url" in value && value._url) return value._url;
|
|
848
|
+
return void 0;
|
|
849
|
+
}
|
|
850
|
+
function EntryLinkMetaLabel({
|
|
851
|
+
className,
|
|
852
|
+
customLabel,
|
|
853
|
+
entryId
|
|
854
|
+
}) {
|
|
855
|
+
const state = useLinkEntryState(entryId);
|
|
856
|
+
if (state.state !== "hasData" || !state.data) {
|
|
857
|
+
return /* @__PURE__ */ jsx(ResolvedLinkMetaLabel, { className, label: customLabel });
|
|
858
|
+
}
|
|
859
|
+
return /* @__PURE__ */ jsx(
|
|
860
|
+
ResolvedLinkMetaLabel,
|
|
861
|
+
{
|
|
862
|
+
className,
|
|
863
|
+
label: customLabel ?? state.data.title
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
function ResolvedLinkMetaLabel({ className, label }) {
|
|
868
|
+
const value = label?.trim();
|
|
869
|
+
if (!value) return null;
|
|
870
|
+
return /* @__PURE__ */ jsx("span", { className, children: value });
|
|
871
|
+
}
|
|
872
|
+
function LinkTypeBadge({ picker, type, value, ...props }) {
|
|
873
|
+
const fallbackIcon = getLinkIcon(type);
|
|
874
|
+
const fallbackLabel = picker?.label ?? type;
|
|
875
|
+
if (type === "image") return null;
|
|
876
|
+
if (type === "file") {
|
|
877
|
+
return /* @__PURE__ */ jsx(Badge, { ...props, icon: IcRoundAttachFile, size: "small", children: "File" });
|
|
184
878
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
pickFrom && PickerView && /* @__PURE__ */ jsx(SuspenseBoundary, { name: "picker", children: /* @__PURE__ */ jsx(
|
|
189
|
-
PickerView,
|
|
879
|
+
if ("_entry" in value) {
|
|
880
|
+
return /* @__PURE__ */ jsx(
|
|
881
|
+
EntryLinkTypeBadge,
|
|
190
882
|
{
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (picker.handlesMultiple)
|
|
196
|
-
return ref[ListRow.type] === pickFrom[Reference.type];
|
|
197
|
-
return false;
|
|
198
|
-
}),
|
|
199
|
-
onConfirm: handleConfirm,
|
|
200
|
-
onCancel: () => setPickFrom(void 0)
|
|
883
|
+
...props,
|
|
884
|
+
entryId: value._entry,
|
|
885
|
+
fallbackIcon,
|
|
886
|
+
fallbackLabel
|
|
201
887
|
}
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
return /* @__PURE__ */ jsx(Badge, { ...props, icon: fallbackIcon, size: "small", children: fallbackLabel });
|
|
891
|
+
}
|
|
892
|
+
function EntryLinkImagePreview({ entryId }) {
|
|
893
|
+
const state = useLinkEntryState(entryId);
|
|
894
|
+
if (state.state !== "hasData" || !state.data?.preview)
|
|
895
|
+
return /* @__PURE__ */ jsx("span", { className: styles.LinkFieldView.previewImagePlaceholder() });
|
|
896
|
+
return /* @__PURE__ */ jsx(
|
|
897
|
+
"img",
|
|
898
|
+
{
|
|
899
|
+
alt: "",
|
|
900
|
+
className: styles.LinkFieldView.previewImage(),
|
|
901
|
+
src: state.data.preview
|
|
902
|
+
}
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
function EntryLinkTypeBadge({
|
|
906
|
+
entryId,
|
|
907
|
+
fallbackIcon,
|
|
908
|
+
fallbackLabel,
|
|
909
|
+
...props
|
|
910
|
+
}) {
|
|
911
|
+
const state = useLinkEntryState(entryId);
|
|
912
|
+
const config = useAtomValue(configAtom);
|
|
913
|
+
const entry = state.state === "hasData" ? state.data : void 0;
|
|
914
|
+
const type = entry ? config.schema[entry.type] : void 0;
|
|
915
|
+
if (!type) {
|
|
916
|
+
return /* @__PURE__ */ jsx(Badge, { ...props, icon: fallbackIcon, size: "small", children: fallbackLabel });
|
|
917
|
+
}
|
|
918
|
+
return /* @__PURE__ */ jsx(
|
|
919
|
+
Badge,
|
|
920
|
+
{
|
|
921
|
+
...props,
|
|
922
|
+
className: styles.LinkFieldView.type(
|
|
923
|
+
dist_default.merge({ className: props.className })
|
|
924
|
+
),
|
|
925
|
+
icon: getType(type).icon || IcRoundLink,
|
|
926
|
+
size: "small",
|
|
927
|
+
children: Type.label(type)
|
|
928
|
+
}
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
function EntryLinkLabelField({
|
|
932
|
+
customLabel,
|
|
933
|
+
entryId,
|
|
934
|
+
isDisabled,
|
|
935
|
+
onChange
|
|
936
|
+
}) {
|
|
937
|
+
const state = useLinkEntryState(entryId);
|
|
938
|
+
return /* @__PURE__ */ jsx(
|
|
939
|
+
ResolvedLinkLabelField,
|
|
940
|
+
{
|
|
941
|
+
customLabel,
|
|
942
|
+
fallbackLabel: state.state === "hasData" ? state.data?.title : void 0,
|
|
943
|
+
isDisabled,
|
|
944
|
+
onChange
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
function ResolvedLinkLabelField({
|
|
949
|
+
customLabel,
|
|
950
|
+
fallbackLabel = "",
|
|
951
|
+
isDisabled,
|
|
952
|
+
onChange
|
|
953
|
+
}) {
|
|
954
|
+
return /* @__PURE__ */ jsx(
|
|
955
|
+
TextField,
|
|
956
|
+
{
|
|
957
|
+
autoFocus: true,
|
|
958
|
+
isDisabled,
|
|
959
|
+
label: "Label",
|
|
960
|
+
onChange,
|
|
961
|
+
value: customLabel ?? fallbackLabel
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
function LinkSettingsButton() {
|
|
966
|
+
return /* @__PURE__ */ jsx(
|
|
967
|
+
Button,
|
|
968
|
+
{
|
|
969
|
+
appearance: "plain",
|
|
970
|
+
"aria-label": "Link settings",
|
|
971
|
+
icon: IcRoundMoreHoriz,
|
|
972
|
+
size: "icon-small"
|
|
973
|
+
}
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
function LinkRowReferenceActions({
|
|
977
|
+
closeActions,
|
|
978
|
+
type,
|
|
979
|
+
value
|
|
980
|
+
}) {
|
|
981
|
+
if (!("_entry" in value)) return null;
|
|
982
|
+
return /* @__PURE__ */ jsx(
|
|
983
|
+
EntryLinkRowActions,
|
|
984
|
+
{
|
|
985
|
+
closeActions,
|
|
986
|
+
entryId: value._entry,
|
|
987
|
+
type
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
function EntryLinkRowActions({
|
|
992
|
+
closeActions,
|
|
993
|
+
entryId,
|
|
994
|
+
type
|
|
995
|
+
}) {
|
|
996
|
+
const scope = useOptionalEntryAtoms();
|
|
997
|
+
const state = useLinkEntryState(entryId);
|
|
998
|
+
if (state.state !== "hasData" || !state.data) {
|
|
999
|
+
return /* @__PURE__ */ jsx(
|
|
1000
|
+
Button,
|
|
205
1001
|
{
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
children:
|
|
1002
|
+
"aria-label": "Open link",
|
|
1003
|
+
appearance: "plain",
|
|
1004
|
+
icon: IcRoundOpenInNew,
|
|
1005
|
+
isDisabled: true,
|
|
1006
|
+
size: "small",
|
|
1007
|
+
children: "Open link"
|
|
1008
|
+
}
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
const entry = state.data;
|
|
1012
|
+
const locale = type === "entry" ? scope?.localeData.requestedLocale : void 0;
|
|
1013
|
+
const href = `#${nav.entry(entry.workspace, entry.root, entry.id, locale)}`;
|
|
1014
|
+
return /* @__PURE__ */ jsx(
|
|
1015
|
+
Button,
|
|
1016
|
+
{
|
|
1017
|
+
"aria-label": "Open link",
|
|
1018
|
+
appearance: "plain",
|
|
1019
|
+
icon: IcRoundOpenInNew,
|
|
1020
|
+
onPress: () => {
|
|
1021
|
+
window.open(href, "_blank", "noopener,noreferrer");
|
|
1022
|
+
closeActions();
|
|
1023
|
+
},
|
|
1024
|
+
children: "Open link"
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
}
|
|
1028
|
+
function SingleLinkRow({ field, node, value }) {
|
|
1029
|
+
const [, setValue] = useField(field);
|
|
1030
|
+
const options = useFieldOptions(field);
|
|
1031
|
+
const type = getPickerType(value[Reference.type]);
|
|
1032
|
+
const picker = options.pickers[type];
|
|
1033
|
+
const hasFields = Boolean(picker?.fields);
|
|
1034
|
+
const imagePreviewEntryId = type === "image" && "_entry" in value ? value._entry : void 0;
|
|
1035
|
+
const [actionsOpen, setActionsOpen] = useState(false);
|
|
1036
|
+
const [editOpen, setEditOpen] = useState(false);
|
|
1037
|
+
function closeActions() {
|
|
1038
|
+
setActionsOpen(false);
|
|
1039
|
+
}
|
|
1040
|
+
function removeLink() {
|
|
1041
|
+
setValue(void 0);
|
|
1042
|
+
}
|
|
1043
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1044
|
+
/* @__PURE__ */ jsxs(ListRow, { "aria-label": "Link item 1", first: true, role: "listitem", children: [
|
|
1045
|
+
/* @__PURE__ */ jsxs(ListRowHeader, { first: true, hasFold: false, children: [
|
|
1046
|
+
imagePreviewEntryId && /* @__PURE__ */ jsx(EntryLinkImagePreview, { entryId: imagePreviewEntryId }),
|
|
1047
|
+
/* @__PURE__ */ jsx(ListRowDrag, { children: /* @__PURE__ */ jsxs(ListRowBadges, { children: [
|
|
212
1048
|
/* @__PURE__ */ jsx(
|
|
213
|
-
|
|
1049
|
+
LinkTypeBadge,
|
|
214
1050
|
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (!options.pickers[reference[ListRow.type]]) return null;
|
|
220
|
-
const picker2 = options.pickers[reference[ListRow.type]];
|
|
221
|
-
const type = picker2.fields;
|
|
222
|
-
return /* @__PURE__ */ jsx(
|
|
223
|
-
LinkInputRowSortable,
|
|
224
|
-
{
|
|
225
|
-
rowId: reference[ListRow.id],
|
|
226
|
-
field,
|
|
227
|
-
fields: type,
|
|
228
|
-
picker: picker2,
|
|
229
|
-
reference,
|
|
230
|
-
onRemove: () => mutator.remove(reference[ListRow.id]),
|
|
231
|
-
onEdit: () => setPickFrom(reference),
|
|
232
|
-
isSortable: options.max !== 1,
|
|
233
|
-
readOnly,
|
|
234
|
-
multiple: true
|
|
235
|
-
},
|
|
236
|
-
reference[ListRow.id]
|
|
237
|
-
);
|
|
238
|
-
}),
|
|
239
|
-
showLinkPicker && /* @__PURE__ */ jsx("div", { className: styles.create(), children: /* @__PURE__ */ jsx(Create.Root, { disabled: readOnly, children: entries(options.pickers).map(([name, picker2]) => {
|
|
240
|
-
return /* @__PURE__ */ jsx(
|
|
241
|
-
Create.Button,
|
|
242
|
-
{
|
|
243
|
-
onClick: () => setPickFrom({ [Reference.type]: name }),
|
|
244
|
-
icon: getLinkIcon(name),
|
|
245
|
-
children: /* @__PURE__ */ jsx(TextLabel, { label: picker2.label })
|
|
246
|
-
},
|
|
247
|
-
name
|
|
248
|
-
);
|
|
249
|
-
}) }) })
|
|
250
|
-
] })
|
|
1051
|
+
className: styles.LinkFieldView.type(),
|
|
1052
|
+
picker,
|
|
1053
|
+
type,
|
|
1054
|
+
value
|
|
251
1055
|
}
|
|
252
1056
|
),
|
|
253
1057
|
/* @__PURE__ */ jsx(
|
|
254
|
-
|
|
1058
|
+
LinkMetaLabel,
|
|
255
1059
|
{
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
1060
|
+
className: styles.LinkFieldView.metaLabel(),
|
|
1061
|
+
node,
|
|
1062
|
+
value
|
|
1063
|
+
}
|
|
1064
|
+
),
|
|
1065
|
+
/* @__PURE__ */ jsx(EntryAnchorBadge, { node, value })
|
|
1066
|
+
] }) }),
|
|
1067
|
+
!options.readOnly && /* @__PURE__ */ jsxs(ListRowActions, { children: [
|
|
1068
|
+
/* @__PURE__ */ jsxs(DialogTrigger, { isOpen: actionsOpen, onOpenChange: setActionsOpen, children: [
|
|
1069
|
+
/* @__PURE__ */ jsx(LinkSettingsButton, {}),
|
|
1070
|
+
/* @__PURE__ */ jsxs(Popover, { placement: "bottom right", children: [
|
|
1071
|
+
/* @__PURE__ */ jsxs(ListRowSettings, { children: [
|
|
1072
|
+
/* @__PURE__ */ jsx(LinkLabelField, { node, value }),
|
|
1073
|
+
/* @__PURE__ */ jsx(EntryAnchorField, { node, value }),
|
|
1074
|
+
/* @__PURE__ */ jsx(EntryLinkSuffixField, { node, value })
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1077
|
+
/* @__PURE__ */ jsx(ListRowSettings, { actions: true, children: /* @__PURE__ */ jsx(
|
|
1078
|
+
LinkRowActions,
|
|
262
1079
|
{
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
onRemove: () => mutator.remove(dragging._id),
|
|
269
|
-
onEdit: () => setPickFrom(dragging),
|
|
270
|
-
isDragOverlay: true,
|
|
271
|
-
isSortable: options.max !== 1,
|
|
272
|
-
readOnly,
|
|
273
|
-
multiple: true
|
|
1080
|
+
closeActions,
|
|
1081
|
+
onEdit: () => setEditOpen(true),
|
|
1082
|
+
picker,
|
|
1083
|
+
type,
|
|
1084
|
+
value
|
|
274
1085
|
}
|
|
275
|
-
)
|
|
1086
|
+
) })
|
|
1087
|
+
] })
|
|
1088
|
+
] }),
|
|
1089
|
+
/* @__PURE__ */ jsx(
|
|
1090
|
+
Button,
|
|
1091
|
+
{
|
|
1092
|
+
appearance: "plain",
|
|
1093
|
+
"aria-label": "Remove link",
|
|
1094
|
+
icon: IcRoundClose,
|
|
1095
|
+
onPress: removeLink,
|
|
1096
|
+
size: "icon-small"
|
|
276
1097
|
}
|
|
277
1098
|
)
|
|
278
|
-
] })
|
|
1099
|
+
] })
|
|
1100
|
+
] }),
|
|
1101
|
+
hasFields && /* @__PURE__ */ jsx(ListRowBody, { children: /* @__PURE__ */ jsx(LinkRowEditor, { node, picker }) })
|
|
1102
|
+
] }),
|
|
1103
|
+
picker && /* @__PURE__ */ jsx(
|
|
1104
|
+
LinkPickerDialog,
|
|
1105
|
+
{
|
|
1106
|
+
isOpen: editOpen,
|
|
1107
|
+
onOpenChange: setEditOpen,
|
|
1108
|
+
onPick: setValue,
|
|
1109
|
+
picker,
|
|
1110
|
+
type,
|
|
1111
|
+
value
|
|
279
1112
|
}
|
|
280
1113
|
)
|
|
281
1114
|
] });
|
|
282
1115
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
if (isSorting || wasSorting) return defaultAnimateLayoutChanges(args);
|
|
286
|
-
return true;
|
|
1116
|
+
function LinkFieldDragPreview({ icon, label }) {
|
|
1117
|
+
return /* @__PURE__ */ jsx(ListDragPreview, { icon, label });
|
|
287
1118
|
}
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
id: props.reference._id
|
|
292
|
-
});
|
|
293
|
-
const style = {
|
|
294
|
-
transform: CSS.Transform.toString(transform),
|
|
295
|
-
transition: transition || void 0
|
|
296
|
-
};
|
|
297
|
-
return /* @__PURE__ */ jsx(
|
|
298
|
-
LinkInputRow,
|
|
299
|
-
{
|
|
300
|
-
...props,
|
|
301
|
-
rootRef: setNodeRef,
|
|
302
|
-
style,
|
|
303
|
-
handle: listeners,
|
|
304
|
-
...attributes,
|
|
305
|
-
isDragging
|
|
306
|
-
}
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
function LinkInputRow({
|
|
1119
|
+
function MultipleLinkRow({
|
|
1120
|
+
dragging,
|
|
1121
|
+
expanded,
|
|
310
1122
|
field,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
isDragging,
|
|
320
|
-
isDragOverlay,
|
|
321
|
-
isSortable,
|
|
322
|
-
readOnly,
|
|
323
|
-
multiple,
|
|
324
|
-
...rest
|
|
1123
|
+
index,
|
|
1124
|
+
node,
|
|
1125
|
+
onMoveRow,
|
|
1126
|
+
onRowDragEnd,
|
|
1127
|
+
onRowDragStart,
|
|
1128
|
+
onDropIndicatorChange,
|
|
1129
|
+
onToggleRow,
|
|
1130
|
+
value
|
|
325
1131
|
}) {
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
1132
|
+
const [linksValue, setValue] = useField(field);
|
|
1133
|
+
const options = useFieldOptions(field);
|
|
1134
|
+
const links = linksValue ?? [];
|
|
1135
|
+
const type = getPickerType(value[Reference.type]);
|
|
1136
|
+
const picker = options.pickers[type];
|
|
1137
|
+
const hasFields = Boolean(picker?.fields);
|
|
1138
|
+
const imagePreviewEntryId = type === "image" && "_entry" in value ? value._entry : void 0;
|
|
1139
|
+
const itemId = value[Reference.id];
|
|
1140
|
+
const readOnly = Boolean(options.readOnly);
|
|
1141
|
+
const [actionsOpen, setActionsOpen] = useState(false);
|
|
1142
|
+
const [editOpen, setEditOpen] = useState(false);
|
|
1143
|
+
const dragPreview = useRef(null);
|
|
1144
|
+
const rowRef = useRef(null);
|
|
1145
|
+
const { dragProps, isDragging } = $74812c42150b3de8$export$7941f8aafa4b6021({
|
|
1146
|
+
getItems() {
|
|
1147
|
+
return [dragRowItem(itemId)];
|
|
1148
|
+
},
|
|
1149
|
+
getAllowedDropOperations() {
|
|
1150
|
+
return ["move"];
|
|
1151
|
+
},
|
|
1152
|
+
isDisabled: readOnly,
|
|
1153
|
+
onDragEnd: onRowDragEnd,
|
|
1154
|
+
onDragStart: onRowDragStart,
|
|
1155
|
+
preview: dragPreview
|
|
1156
|
+
});
|
|
1157
|
+
const { dropProps, isDropTarget } = $f302ef02e940a6f8$export$ccdee5eaf73cf661({
|
|
1158
|
+
ref: rowRef,
|
|
1159
|
+
isDisabled: readOnly || !dragging,
|
|
1160
|
+
getDropOperation(types, allowedOperations) {
|
|
1161
|
+
if (!types.has(LINK_FIELD_ROW_DRAG_TYPE)) return "cancel";
|
|
1162
|
+
return allowedOperations.includes("move") ? "move" : "cancel";
|
|
1163
|
+
},
|
|
1164
|
+
getDropOperationForPoint(types, allowedOperations) {
|
|
1165
|
+
if (!types.has(LINK_FIELD_ROW_DRAG_TYPE)) return "cancel";
|
|
1166
|
+
return allowedOperations.includes("move") ? "move" : "cancel";
|
|
1167
|
+
},
|
|
1168
|
+
onDropEnter(event) {
|
|
1169
|
+
const position = rowDropPosition(rowRef.current, event.y);
|
|
1170
|
+
onDropIndicatorChange(position);
|
|
1171
|
+
},
|
|
1172
|
+
onDropMove(event) {
|
|
1173
|
+
const position = rowDropPosition(rowRef.current, event.y);
|
|
1174
|
+
onDropIndicatorChange(position);
|
|
1175
|
+
},
|
|
1176
|
+
onDropExit() {
|
|
1177
|
+
onDropIndicatorChange(null);
|
|
1178
|
+
},
|
|
1179
|
+
async onDrop(event) {
|
|
1180
|
+
const position = rowDropPosition(rowRef.current, event.y);
|
|
1181
|
+
const rowId = await getDraggedRowId(event.items, LINK_FIELD_ROW_DRAG_TYPE);
|
|
1182
|
+
onDropIndicatorChange(null);
|
|
1183
|
+
if (!rowId) return;
|
|
1184
|
+
onMoveRow(rowId, insertIndex(index, position));
|
|
378
1185
|
}
|
|
379
|
-
);
|
|
380
|
-
|
|
1186
|
+
});
|
|
1187
|
+
function closeActions() {
|
|
1188
|
+
setActionsOpen(false);
|
|
1189
|
+
}
|
|
1190
|
+
function removeLink() {
|
|
1191
|
+
setValue((links2) => links2.filter((_, currentIndex) => currentIndex !== index));
|
|
1192
|
+
}
|
|
1193
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1194
|
+
/* @__PURE__ */ jsx(
|
|
1195
|
+
"div",
|
|
1196
|
+
{
|
|
1197
|
+
...dropProps,
|
|
1198
|
+
className: styles.LinkFieldView.rowDropTarget(),
|
|
1199
|
+
ref: rowRef,
|
|
1200
|
+
children: /* @__PURE__ */ jsxs(
|
|
1201
|
+
ListRow,
|
|
1202
|
+
{
|
|
1203
|
+
"aria-label": `Link item ${index + 1}`,
|
|
1204
|
+
dragging: isDragging,
|
|
1205
|
+
first: index === 0,
|
|
1206
|
+
role: "listitem",
|
|
1207
|
+
children: [
|
|
1208
|
+
/* @__PURE__ */ jsxs(ListRowHeader, { first: index === 0, hasFold: hasFields, children: [
|
|
1209
|
+
!readOnly && /* @__PURE__ */ jsx(
|
|
1210
|
+
ListRowDragHandle,
|
|
1211
|
+
{
|
|
1212
|
+
...dragProps,
|
|
1213
|
+
"aria-label": `Drag link item ${index + 1}`,
|
|
1214
|
+
dragging: isDragging
|
|
1215
|
+
}
|
|
1216
|
+
),
|
|
1217
|
+
imagePreviewEntryId && !hasFields && /* @__PURE__ */ jsx(EntryLinkImagePreview, { entryId: imagePreviewEntryId }),
|
|
1218
|
+
/* @__PURE__ */ jsx($5d3a17cc2564e64f$export$905ab40ac2179daa, { ref: dragPreview, children: () => /* @__PURE__ */ jsx(
|
|
1219
|
+
LinkFieldDragPreview,
|
|
1220
|
+
{
|
|
1221
|
+
icon: getLinkIcon(type),
|
|
1222
|
+
label: /* @__PURE__ */ jsx(LinkRowText, { node })
|
|
1223
|
+
}
|
|
1224
|
+
) }),
|
|
1225
|
+
/* @__PURE__ */ jsx(ListRowDrag, { dragging: isDragging, children: /* @__PURE__ */ jsxs(ListRowBadges, { children: [
|
|
1226
|
+
hasFields && /* @__PURE__ */ jsx(
|
|
1227
|
+
ListRowFoldButton,
|
|
1228
|
+
{
|
|
1229
|
+
"aria-label": expanded ? "Collapse link" : "Expand link",
|
|
1230
|
+
expanded,
|
|
1231
|
+
onPress: () => onToggleRow(itemId)
|
|
1232
|
+
}
|
|
1233
|
+
),
|
|
1234
|
+
imagePreviewEntryId && hasFields && /* @__PURE__ */ jsx(EntryLinkImagePreview, { entryId: imagePreviewEntryId }),
|
|
1235
|
+
/* @__PURE__ */ jsx(LinkTypeBadge, { picker, type, value }),
|
|
1236
|
+
/* @__PURE__ */ jsx(
|
|
1237
|
+
LinkMetaLabel,
|
|
1238
|
+
{
|
|
1239
|
+
className: styles.LinkFieldView.metaLabel(),
|
|
1240
|
+
node,
|
|
1241
|
+
value
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
/* @__PURE__ */ jsx(EntryAnchorBadge, { node, value })
|
|
1245
|
+
] }) }),
|
|
1246
|
+
/* @__PURE__ */ jsxs(ListRowActions, { children: [
|
|
1247
|
+
/* @__PURE__ */ jsxs(DialogTrigger, { isOpen: actionsOpen, onOpenChange: setActionsOpen, children: [
|
|
1248
|
+
/* @__PURE__ */ jsx(LinkSettingsButton, {}),
|
|
1249
|
+
/* @__PURE__ */ jsxs(Popover, { placement: "bottom right", children: [
|
|
1250
|
+
/* @__PURE__ */ jsxs(ListRowSettings, { children: [
|
|
1251
|
+
/* @__PURE__ */ jsx(
|
|
1252
|
+
LinkLabelField,
|
|
1253
|
+
{
|
|
1254
|
+
isDisabled: readOnly,
|
|
1255
|
+
node,
|
|
1256
|
+
value
|
|
1257
|
+
}
|
|
1258
|
+
),
|
|
1259
|
+
/* @__PURE__ */ jsx(EntryAnchorField, { node, value }),
|
|
1260
|
+
/* @__PURE__ */ jsx(
|
|
1261
|
+
EntryLinkSuffixField,
|
|
1262
|
+
{
|
|
1263
|
+
isDisabled: readOnly,
|
|
1264
|
+
node,
|
|
1265
|
+
value
|
|
1266
|
+
}
|
|
1267
|
+
)
|
|
1268
|
+
] }),
|
|
1269
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1270
|
+
/* @__PURE__ */ jsx(ListRowSettings, { actions: true, children: /* @__PURE__ */ jsx(
|
|
1271
|
+
LinkRowActions,
|
|
1272
|
+
{
|
|
1273
|
+
closeActions,
|
|
1274
|
+
isDisabled: readOnly,
|
|
1275
|
+
onEdit: () => setEditOpen(true),
|
|
1276
|
+
picker,
|
|
1277
|
+
type,
|
|
1278
|
+
value
|
|
1279
|
+
}
|
|
1280
|
+
) })
|
|
1281
|
+
] })
|
|
1282
|
+
] }),
|
|
1283
|
+
/* @__PURE__ */ jsx(
|
|
1284
|
+
Button,
|
|
1285
|
+
{
|
|
1286
|
+
appearance: "plain",
|
|
1287
|
+
"aria-label": "Remove link",
|
|
1288
|
+
icon: IcRoundClose,
|
|
1289
|
+
isDisabled: readOnly,
|
|
1290
|
+
onPress: removeLink,
|
|
1291
|
+
size: "icon-small"
|
|
1292
|
+
}
|
|
1293
|
+
)
|
|
1294
|
+
] })
|
|
1295
|
+
] }),
|
|
1296
|
+
expanded && hasFields && /* @__PURE__ */ jsx(ListRowBody, { children: /* @__PURE__ */ jsx(LinkRowEditor, { node, picker }) }),
|
|
1297
|
+
!expanded && picker?.fields && /* @__PURE__ */ jsx(ListRowFooter, { children: /* @__PURE__ */ jsx(
|
|
1298
|
+
CompactRecordFields,
|
|
1299
|
+
{
|
|
1300
|
+
fields: Type.fields(picker.fields),
|
|
1301
|
+
layout: "footer",
|
|
1302
|
+
value
|
|
1303
|
+
}
|
|
1304
|
+
) })
|
|
1305
|
+
]
|
|
1306
|
+
}
|
|
1307
|
+
)
|
|
1308
|
+
}
|
|
1309
|
+
),
|
|
1310
|
+
picker && /* @__PURE__ */ jsx(
|
|
1311
|
+
LinkPickerDialog,
|
|
1312
|
+
{
|
|
1313
|
+
isOpen: editOpen,
|
|
1314
|
+
onOpenChange: setEditOpen,
|
|
1315
|
+
onPick: (link) => {
|
|
1316
|
+
setValue(
|
|
1317
|
+
(links2) => links2.map(
|
|
1318
|
+
(current, currentIndex) => currentIndex === index ? link : current
|
|
1319
|
+
)
|
|
1320
|
+
);
|
|
1321
|
+
},
|
|
1322
|
+
picker,
|
|
1323
|
+
type,
|
|
1324
|
+
value
|
|
1325
|
+
}
|
|
1326
|
+
)
|
|
1327
|
+
] });
|
|
1328
|
+
}
|
|
1329
|
+
function LinkFieldDropIndicator({ active }) {
|
|
381
1330
|
return /* @__PURE__ */ jsx(
|
|
382
|
-
|
|
1331
|
+
"div",
|
|
383
1332
|
{
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
rowId: multiple ? rowId : void 0,
|
|
388
|
-
children: inner
|
|
1333
|
+
"aria-hidden": true,
|
|
1334
|
+
className: styles.LinkFieldView.dropIndicator(),
|
|
1335
|
+
"data-active": active || void 0
|
|
389
1336
|
}
|
|
390
1337
|
);
|
|
391
1338
|
}
|
|
392
|
-
function
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
1339
|
+
function SingleLinkFieldView({ field }) {
|
|
1340
|
+
const [value] = useField(field);
|
|
1341
|
+
const options = useFieldOptions(field);
|
|
1342
|
+
const node = useFieldNode(field);
|
|
1343
|
+
const nodeIsEmpty = useAtomValue(node.isEmpty);
|
|
1344
|
+
const selectedValue = isLinkFieldRow(value) ? value : void 0;
|
|
1345
|
+
const isEmpty = nodeIsEmpty || !selectedValue;
|
|
1346
|
+
const hasRows = Boolean(selectedValue);
|
|
1347
|
+
const readOnly = Boolean(options.readOnly);
|
|
1348
|
+
const selectedPicker = selectedValue ? options.pickers[getPickerType(selectedValue[Reference.type])] : void 0;
|
|
1349
|
+
const showFold = Boolean(selectedPicker?.fields);
|
|
1350
|
+
const content = (hasRows || !readOnly) && /* @__PURE__ */ jsxs(List, { "aria-label": options.label || "Link", children: [
|
|
1351
|
+
selectedValue && /* @__PURE__ */ jsx(
|
|
1352
|
+
SingleLinkRow,
|
|
1353
|
+
{
|
|
1354
|
+
field,
|
|
1355
|
+
node,
|
|
1356
|
+
value: selectedValue
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
isEmpty && !readOnly && /* @__PURE__ */ jsx(ListCreateRow, { empty: true, children: /* @__PURE__ */ jsx(SingleLinkCreateActions, { field }) })
|
|
1360
|
+
] });
|
|
1361
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1362
|
+
/* @__PURE__ */ jsx(
|
|
1363
|
+
ListLabel,
|
|
1364
|
+
{
|
|
1365
|
+
"aria-label": hasRows ? "Link selected" : "No link selected",
|
|
1366
|
+
expanded: true,
|
|
1367
|
+
hasRows,
|
|
1368
|
+
isDisabled: true,
|
|
1369
|
+
description: options.help,
|
|
1370
|
+
shared: options.shared,
|
|
1371
|
+
showFold,
|
|
1372
|
+
inline: options.inline,
|
|
1373
|
+
children: options.label
|
|
1374
|
+
}
|
|
1375
|
+
),
|
|
1376
|
+
content
|
|
1377
|
+
] });
|
|
1378
|
+
}
|
|
1379
|
+
function MultipleLinksFieldView({ field }) {
|
|
1380
|
+
const [value] = useField(field);
|
|
1381
|
+
const options = useFieldOptions(field);
|
|
1382
|
+
const list = useFieldNode(field);
|
|
1383
|
+
const links = value ?? [];
|
|
1384
|
+
const nodes = useNodes(list) ?? [];
|
|
1385
|
+
const readOnly = Boolean(options.readOnly);
|
|
1386
|
+
const hasRows = nodes.length > 0;
|
|
1387
|
+
const hasFoldableRows = links.some((link) => {
|
|
1388
|
+
const picker = options.pickers[getPickerType(link[Reference.type])];
|
|
1389
|
+
return Boolean(picker?.fields);
|
|
1390
|
+
});
|
|
1391
|
+
const [foldedIds, setFoldedIds] = useState(/* @__PURE__ */ new Set());
|
|
1392
|
+
const [draggingRowId, setDraggingRowId] = useState(null);
|
|
1393
|
+
const [dropIndicator, setDropIndicator] = useState(null);
|
|
1394
|
+
const rowIdsAtom = useMemo(
|
|
1395
|
+
() => atom((get) => {
|
|
1396
|
+
const nodes2 = get(list.nodes);
|
|
1397
|
+
return nodes2.map((node) => get(node.field("_id")));
|
|
1398
|
+
}),
|
|
1399
|
+
[list]
|
|
1400
|
+
);
|
|
1401
|
+
const rowIds = useAtomValue(rowIdsAtom);
|
|
1402
|
+
const moveRowAtom = useMemo(
|
|
1403
|
+
() => atom(null, (get, set, rowId, targetIndex) => {
|
|
1404
|
+
const currentNodes = get(list.nodes);
|
|
1405
|
+
const fromIndex = currentNodes.findIndex((node) => {
|
|
1406
|
+
return get(node.field("_id")) === rowId;
|
|
412
1407
|
});
|
|
413
|
-
|
|
414
|
-
|
|
1408
|
+
if (fromIndex === -1) return;
|
|
1409
|
+
const toIndex = reorderIndex(fromIndex, targetIndex);
|
|
1410
|
+
if (toIndex === fromIndex) return;
|
|
1411
|
+
set(list.move, fromIndex, toIndex);
|
|
1412
|
+
}),
|
|
1413
|
+
[list]
|
|
1414
|
+
);
|
|
1415
|
+
const moveRow = useSetAtom(moveRowAtom);
|
|
1416
|
+
const allExpanded = nodes.length > 0 && foldedIds.size === 0;
|
|
1417
|
+
function toggleAll() {
|
|
1418
|
+
setFoldedIds(allExpanded ? new Set(rowIds) : /* @__PURE__ */ new Set());
|
|
1419
|
+
}
|
|
1420
|
+
function toggleRow(rowId) {
|
|
1421
|
+
setFoldedIds((current) => {
|
|
1422
|
+
const next = new Set(current);
|
|
1423
|
+
if (next.has(rowId)) next.delete(rowId);
|
|
1424
|
+
else next.add(rowId);
|
|
1425
|
+
return next;
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
function isBoundaryDropTarget(index) {
|
|
1429
|
+
return dropIndicator?.index === index && dropIndicator.position === "before" || dropIndicator?.index === index - 1 && dropIndicator.position === "after";
|
|
1430
|
+
}
|
|
1431
|
+
const content = (hasRows || !readOnly) && /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1432
|
+
/* @__PURE__ */ jsx(
|
|
1433
|
+
LinkFieldDropIndicator,
|
|
1434
|
+
{
|
|
1435
|
+
active: dropIndicator?.index === 0 && dropIndicator.position === "before"
|
|
1436
|
+
}
|
|
1437
|
+
),
|
|
1438
|
+
/* @__PURE__ */ jsxs(List, { "aria-label": options.label || "Links", children: [
|
|
1439
|
+
nodes.length > 0 && /* @__PURE__ */ jsx(Fragment2, { children: nodes.map((node, index) => {
|
|
1440
|
+
const value2 = links[index];
|
|
1441
|
+
if (!value2) return null;
|
|
1442
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1443
|
+
index > 0 && /* @__PURE__ */ jsx(
|
|
1444
|
+
LinkFieldDropIndicator,
|
|
1445
|
+
{
|
|
1446
|
+
active: isBoundaryDropTarget(index)
|
|
1447
|
+
}
|
|
1448
|
+
),
|
|
1449
|
+
/* @__PURE__ */ jsx(
|
|
1450
|
+
MultipleLinkRow,
|
|
1451
|
+
{
|
|
1452
|
+
dragging: Boolean(draggingRowId),
|
|
1453
|
+
expanded: !foldedIds.has(value2._id),
|
|
1454
|
+
field,
|
|
1455
|
+
index,
|
|
1456
|
+
node,
|
|
1457
|
+
onMoveRow: moveRow,
|
|
1458
|
+
onRowDragEnd: () => {
|
|
1459
|
+
setDraggingRowId(null);
|
|
1460
|
+
setDropIndicator(null);
|
|
1461
|
+
},
|
|
1462
|
+
onRowDragStart: () => setDraggingRowId(value2._id),
|
|
1463
|
+
onDropIndicatorChange: (position) => setDropIndicator(position ? { index, position } : null),
|
|
1464
|
+
onToggleRow: toggleRow,
|
|
1465
|
+
value: value2
|
|
1466
|
+
}
|
|
1467
|
+
)
|
|
1468
|
+
] }, value2._id);
|
|
1469
|
+
}) }),
|
|
1470
|
+
/* @__PURE__ */ jsx(
|
|
1471
|
+
LinkFieldDropIndicator,
|
|
1472
|
+
{
|
|
1473
|
+
active: dropIndicator?.index === nodes.length - 1 && dropIndicator.position === "after"
|
|
1474
|
+
}
|
|
1475
|
+
),
|
|
1476
|
+
!readOnly && /* @__PURE__ */ jsx(ListCreateRow, { empty: !hasRows, children: /* @__PURE__ */ jsx(MultipleLinkCreateActions, { field }) })
|
|
1477
|
+
] })
|
|
1478
|
+
] });
|
|
1479
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1480
|
+
/* @__PURE__ */ jsx(
|
|
1481
|
+
ListLabel,
|
|
1482
|
+
{
|
|
1483
|
+
"aria-label": hasRows ? allExpanded ? "Collapse all links" : "Expand all links" : "No links to fold",
|
|
1484
|
+
expanded: allExpanded,
|
|
1485
|
+
hasRows,
|
|
1486
|
+
isDisabled: !hasFoldableRows,
|
|
1487
|
+
onPress: toggleAll,
|
|
1488
|
+
description: options.help,
|
|
1489
|
+
shared: options.shared,
|
|
1490
|
+
showFold: hasFoldableRows,
|
|
1491
|
+
inline: options.inline,
|
|
1492
|
+
children: options.label
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
content
|
|
1496
|
+
] });
|
|
415
1497
|
}
|
|
416
1498
|
export {
|
|
417
|
-
|
|
418
|
-
|
|
1499
|
+
MultipleLinksFieldView,
|
|
1500
|
+
SingleLinkFieldView
|
|
419
1501
|
};
|