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,1520 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dist_default
|
|
3
|
-
} from "../../../chunks/chunk-A5O3N2GS.js";
|
|
4
|
-
import {
|
|
5
|
-
__commonJS,
|
|
6
|
-
__toESM
|
|
7
|
-
} from "../../../chunks/chunk-NZLE2WMY.js";
|
|
8
|
-
|
|
9
|
-
// node_modules/diff-match-patch/index.js
|
|
10
|
-
var require_diff_match_patch = __commonJS({
|
|
11
|
-
"node_modules/diff-match-patch/index.js"(exports, module) {
|
|
12
|
-
var diff_match_patch = function() {
|
|
13
|
-
this.Diff_Timeout = 1;
|
|
14
|
-
this.Diff_EditCost = 4;
|
|
15
|
-
this.Match_Threshold = 0.5;
|
|
16
|
-
this.Match_Distance = 1e3;
|
|
17
|
-
this.Patch_DeleteThreshold = 0.5;
|
|
18
|
-
this.Patch_Margin = 4;
|
|
19
|
-
this.Match_MaxBits = 32;
|
|
20
|
-
};
|
|
21
|
-
var DIFF_DELETE = -1;
|
|
22
|
-
var DIFF_INSERT = 1;
|
|
23
|
-
var DIFF_EQUAL = 0;
|
|
24
|
-
diff_match_patch.Diff = function(op, text) {
|
|
25
|
-
return [op, text];
|
|
26
|
-
};
|
|
27
|
-
diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines, opt_deadline) {
|
|
28
|
-
if (typeof opt_deadline == "undefined") {
|
|
29
|
-
if (this.Diff_Timeout <= 0) {
|
|
30
|
-
opt_deadline = Number.MAX_VALUE;
|
|
31
|
-
} else {
|
|
32
|
-
opt_deadline = (/* @__PURE__ */ new Date()).getTime() + this.Diff_Timeout * 1e3;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var deadline = opt_deadline;
|
|
36
|
-
if (text1 == null || text2 == null) {
|
|
37
|
-
throw new Error("Null input. (diff_main)");
|
|
38
|
-
}
|
|
39
|
-
if (text1 == text2) {
|
|
40
|
-
if (text1) {
|
|
41
|
-
return [new diff_match_patch.Diff(DIFF_EQUAL, text1)];
|
|
42
|
-
}
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
if (typeof opt_checklines == "undefined") {
|
|
46
|
-
opt_checklines = true;
|
|
47
|
-
}
|
|
48
|
-
var checklines = opt_checklines;
|
|
49
|
-
var commonlength = this.diff_commonPrefix(text1, text2);
|
|
50
|
-
var commonprefix = text1.substring(0, commonlength);
|
|
51
|
-
text1 = text1.substring(commonlength);
|
|
52
|
-
text2 = text2.substring(commonlength);
|
|
53
|
-
commonlength = this.diff_commonSuffix(text1, text2);
|
|
54
|
-
var commonsuffix = text1.substring(text1.length - commonlength);
|
|
55
|
-
text1 = text1.substring(0, text1.length - commonlength);
|
|
56
|
-
text2 = text2.substring(0, text2.length - commonlength);
|
|
57
|
-
var diffs = this.diff_compute_(text1, text2, checklines, deadline);
|
|
58
|
-
if (commonprefix) {
|
|
59
|
-
diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, commonprefix));
|
|
60
|
-
}
|
|
61
|
-
if (commonsuffix) {
|
|
62
|
-
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, commonsuffix));
|
|
63
|
-
}
|
|
64
|
-
this.diff_cleanupMerge(diffs);
|
|
65
|
-
return diffs;
|
|
66
|
-
};
|
|
67
|
-
diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines, deadline) {
|
|
68
|
-
var diffs;
|
|
69
|
-
if (!text1) {
|
|
70
|
-
return [new diff_match_patch.Diff(DIFF_INSERT, text2)];
|
|
71
|
-
}
|
|
72
|
-
if (!text2) {
|
|
73
|
-
return [new diff_match_patch.Diff(DIFF_DELETE, text1)];
|
|
74
|
-
}
|
|
75
|
-
var longtext = text1.length > text2.length ? text1 : text2;
|
|
76
|
-
var shorttext = text1.length > text2.length ? text2 : text1;
|
|
77
|
-
var i = longtext.indexOf(shorttext);
|
|
78
|
-
if (i != -1) {
|
|
79
|
-
diffs = [
|
|
80
|
-
new diff_match_patch.Diff(DIFF_INSERT, longtext.substring(0, i)),
|
|
81
|
-
new diff_match_patch.Diff(DIFF_EQUAL, shorttext),
|
|
82
|
-
new diff_match_patch.Diff(
|
|
83
|
-
DIFF_INSERT,
|
|
84
|
-
longtext.substring(i + shorttext.length)
|
|
85
|
-
)
|
|
86
|
-
];
|
|
87
|
-
if (text1.length > text2.length) {
|
|
88
|
-
diffs[0][0] = diffs[2][0] = DIFF_DELETE;
|
|
89
|
-
}
|
|
90
|
-
return diffs;
|
|
91
|
-
}
|
|
92
|
-
if (shorttext.length == 1) {
|
|
93
|
-
return [
|
|
94
|
-
new diff_match_patch.Diff(DIFF_DELETE, text1),
|
|
95
|
-
new diff_match_patch.Diff(DIFF_INSERT, text2)
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
var hm = this.diff_halfMatch_(text1, text2);
|
|
99
|
-
if (hm) {
|
|
100
|
-
var text1_a = hm[0];
|
|
101
|
-
var text1_b = hm[1];
|
|
102
|
-
var text2_a = hm[2];
|
|
103
|
-
var text2_b = hm[3];
|
|
104
|
-
var mid_common = hm[4];
|
|
105
|
-
var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);
|
|
106
|
-
var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);
|
|
107
|
-
return diffs_a.concat(
|
|
108
|
-
[new diff_match_patch.Diff(DIFF_EQUAL, mid_common)],
|
|
109
|
-
diffs_b
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
if (checklines && text1.length > 100 && text2.length > 100) {
|
|
113
|
-
return this.diff_lineMode_(text1, text2, deadline);
|
|
114
|
-
}
|
|
115
|
-
return this.diff_bisect_(text1, text2, deadline);
|
|
116
|
-
};
|
|
117
|
-
diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
|
|
118
|
-
var a = this.diff_linesToChars_(text1, text2);
|
|
119
|
-
text1 = a.chars1;
|
|
120
|
-
text2 = a.chars2;
|
|
121
|
-
var linearray = a.lineArray;
|
|
122
|
-
var diffs = this.diff_main(text1, text2, false, deadline);
|
|
123
|
-
this.diff_charsToLines_(diffs, linearray);
|
|
124
|
-
this.diff_cleanupSemantic(diffs);
|
|
125
|
-
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ""));
|
|
126
|
-
var pointer = 0;
|
|
127
|
-
var count_delete = 0;
|
|
128
|
-
var count_insert = 0;
|
|
129
|
-
var text_delete = "";
|
|
130
|
-
var text_insert = "";
|
|
131
|
-
while (pointer < diffs.length) {
|
|
132
|
-
switch (diffs[pointer][0]) {
|
|
133
|
-
case DIFF_INSERT:
|
|
134
|
-
count_insert++;
|
|
135
|
-
text_insert += diffs[pointer][1];
|
|
136
|
-
break;
|
|
137
|
-
case DIFF_DELETE:
|
|
138
|
-
count_delete++;
|
|
139
|
-
text_delete += diffs[pointer][1];
|
|
140
|
-
break;
|
|
141
|
-
case DIFF_EQUAL:
|
|
142
|
-
if (count_delete >= 1 && count_insert >= 1) {
|
|
143
|
-
diffs.splice(
|
|
144
|
-
pointer - count_delete - count_insert,
|
|
145
|
-
count_delete + count_insert
|
|
146
|
-
);
|
|
147
|
-
pointer = pointer - count_delete - count_insert;
|
|
148
|
-
var subDiff = this.diff_main(text_delete, text_insert, false, deadline);
|
|
149
|
-
for (var j = subDiff.length - 1; j >= 0; j--) {
|
|
150
|
-
diffs.splice(pointer, 0, subDiff[j]);
|
|
151
|
-
}
|
|
152
|
-
pointer = pointer + subDiff.length;
|
|
153
|
-
}
|
|
154
|
-
count_insert = 0;
|
|
155
|
-
count_delete = 0;
|
|
156
|
-
text_delete = "";
|
|
157
|
-
text_insert = "";
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
pointer++;
|
|
161
|
-
}
|
|
162
|
-
diffs.pop();
|
|
163
|
-
return diffs;
|
|
164
|
-
};
|
|
165
|
-
diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
|
|
166
|
-
var text1_length = text1.length;
|
|
167
|
-
var text2_length = text2.length;
|
|
168
|
-
var max_d = Math.ceil((text1_length + text2_length) / 2);
|
|
169
|
-
var v_offset = max_d;
|
|
170
|
-
var v_length = 2 * max_d;
|
|
171
|
-
var v1 = new Array(v_length);
|
|
172
|
-
var v2 = new Array(v_length);
|
|
173
|
-
for (var x = 0; x < v_length; x++) {
|
|
174
|
-
v1[x] = -1;
|
|
175
|
-
v2[x] = -1;
|
|
176
|
-
}
|
|
177
|
-
v1[v_offset + 1] = 0;
|
|
178
|
-
v2[v_offset + 1] = 0;
|
|
179
|
-
var delta = text1_length - text2_length;
|
|
180
|
-
var front = delta % 2 != 0;
|
|
181
|
-
var k1start = 0;
|
|
182
|
-
var k1end = 0;
|
|
183
|
-
var k2start = 0;
|
|
184
|
-
var k2end = 0;
|
|
185
|
-
for (var d = 0; d < max_d; d++) {
|
|
186
|
-
if ((/* @__PURE__ */ new Date()).getTime() > deadline) {
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
|
|
190
|
-
var k1_offset = v_offset + k1;
|
|
191
|
-
var x1;
|
|
192
|
-
if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
|
|
193
|
-
x1 = v1[k1_offset + 1];
|
|
194
|
-
} else {
|
|
195
|
-
x1 = v1[k1_offset - 1] + 1;
|
|
196
|
-
}
|
|
197
|
-
var y1 = x1 - k1;
|
|
198
|
-
while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) {
|
|
199
|
-
x1++;
|
|
200
|
-
y1++;
|
|
201
|
-
}
|
|
202
|
-
v1[k1_offset] = x1;
|
|
203
|
-
if (x1 > text1_length) {
|
|
204
|
-
k1end += 2;
|
|
205
|
-
} else if (y1 > text2_length) {
|
|
206
|
-
k1start += 2;
|
|
207
|
-
} else if (front) {
|
|
208
|
-
var k2_offset = v_offset + delta - k1;
|
|
209
|
-
if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
|
|
210
|
-
var x2 = text1_length - v2[k2_offset];
|
|
211
|
-
if (x1 >= x2) {
|
|
212
|
-
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
|
|
218
|
-
var k2_offset = v_offset + k2;
|
|
219
|
-
var x2;
|
|
220
|
-
if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
|
|
221
|
-
x2 = v2[k2_offset + 1];
|
|
222
|
-
} else {
|
|
223
|
-
x2 = v2[k2_offset - 1] + 1;
|
|
224
|
-
}
|
|
225
|
-
var y2 = x2 - k2;
|
|
226
|
-
while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) {
|
|
227
|
-
x2++;
|
|
228
|
-
y2++;
|
|
229
|
-
}
|
|
230
|
-
v2[k2_offset] = x2;
|
|
231
|
-
if (x2 > text1_length) {
|
|
232
|
-
k2end += 2;
|
|
233
|
-
} else if (y2 > text2_length) {
|
|
234
|
-
k2start += 2;
|
|
235
|
-
} else if (!front) {
|
|
236
|
-
var k1_offset = v_offset + delta - k2;
|
|
237
|
-
if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
|
|
238
|
-
var x1 = v1[k1_offset];
|
|
239
|
-
var y1 = v_offset + x1 - k1_offset;
|
|
240
|
-
x2 = text1_length - x2;
|
|
241
|
-
if (x1 >= x2) {
|
|
242
|
-
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return [
|
|
249
|
-
new diff_match_patch.Diff(DIFF_DELETE, text1),
|
|
250
|
-
new diff_match_patch.Diff(DIFF_INSERT, text2)
|
|
251
|
-
];
|
|
252
|
-
};
|
|
253
|
-
diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y, deadline) {
|
|
254
|
-
var text1a = text1.substring(0, x);
|
|
255
|
-
var text2a = text2.substring(0, y);
|
|
256
|
-
var text1b = text1.substring(x);
|
|
257
|
-
var text2b = text2.substring(y);
|
|
258
|
-
var diffs = this.diff_main(text1a, text2a, false, deadline);
|
|
259
|
-
var diffsb = this.diff_main(text1b, text2b, false, deadline);
|
|
260
|
-
return diffs.concat(diffsb);
|
|
261
|
-
};
|
|
262
|
-
diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
|
|
263
|
-
var lineArray = [];
|
|
264
|
-
var lineHash = {};
|
|
265
|
-
lineArray[0] = "";
|
|
266
|
-
function diff_linesToCharsMunge_(text) {
|
|
267
|
-
var chars = "";
|
|
268
|
-
var lineStart = 0;
|
|
269
|
-
var lineEnd = -1;
|
|
270
|
-
var lineArrayLength = lineArray.length;
|
|
271
|
-
while (lineEnd < text.length - 1) {
|
|
272
|
-
lineEnd = text.indexOf("\n", lineStart);
|
|
273
|
-
if (lineEnd == -1) {
|
|
274
|
-
lineEnd = text.length - 1;
|
|
275
|
-
}
|
|
276
|
-
var line = text.substring(lineStart, lineEnd + 1);
|
|
277
|
-
if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== void 0) {
|
|
278
|
-
chars += String.fromCharCode(lineHash[line]);
|
|
279
|
-
} else {
|
|
280
|
-
if (lineArrayLength == maxLines) {
|
|
281
|
-
line = text.substring(lineStart);
|
|
282
|
-
lineEnd = text.length;
|
|
283
|
-
}
|
|
284
|
-
chars += String.fromCharCode(lineArrayLength);
|
|
285
|
-
lineHash[line] = lineArrayLength;
|
|
286
|
-
lineArray[lineArrayLength++] = line;
|
|
287
|
-
}
|
|
288
|
-
lineStart = lineEnd + 1;
|
|
289
|
-
}
|
|
290
|
-
return chars;
|
|
291
|
-
}
|
|
292
|
-
var maxLines = 4e4;
|
|
293
|
-
var chars1 = diff_linesToCharsMunge_(text1);
|
|
294
|
-
maxLines = 65535;
|
|
295
|
-
var chars2 = diff_linesToCharsMunge_(text2);
|
|
296
|
-
return { chars1, chars2, lineArray };
|
|
297
|
-
};
|
|
298
|
-
diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {
|
|
299
|
-
for (var i = 0; i < diffs.length; i++) {
|
|
300
|
-
var chars = diffs[i][1];
|
|
301
|
-
var text = [];
|
|
302
|
-
for (var j = 0; j < chars.length; j++) {
|
|
303
|
-
text[j] = lineArray[chars.charCodeAt(j)];
|
|
304
|
-
}
|
|
305
|
-
diffs[i][1] = text.join("");
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
|
|
309
|
-
if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
|
|
310
|
-
return 0;
|
|
311
|
-
}
|
|
312
|
-
var pointermin = 0;
|
|
313
|
-
var pointermax = Math.min(text1.length, text2.length);
|
|
314
|
-
var pointermid = pointermax;
|
|
315
|
-
var pointerstart = 0;
|
|
316
|
-
while (pointermin < pointermid) {
|
|
317
|
-
if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
|
|
318
|
-
pointermin = pointermid;
|
|
319
|
-
pointerstart = pointermin;
|
|
320
|
-
} else {
|
|
321
|
-
pointermax = pointermid;
|
|
322
|
-
}
|
|
323
|
-
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
324
|
-
}
|
|
325
|
-
return pointermid;
|
|
326
|
-
};
|
|
327
|
-
diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
|
|
328
|
-
if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
|
|
329
|
-
return 0;
|
|
330
|
-
}
|
|
331
|
-
var pointermin = 0;
|
|
332
|
-
var pointermax = Math.min(text1.length, text2.length);
|
|
333
|
-
var pointermid = pointermax;
|
|
334
|
-
var pointerend = 0;
|
|
335
|
-
while (pointermin < pointermid) {
|
|
336
|
-
if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
|
|
337
|
-
pointermin = pointermid;
|
|
338
|
-
pointerend = pointermin;
|
|
339
|
-
} else {
|
|
340
|
-
pointermax = pointermid;
|
|
341
|
-
}
|
|
342
|
-
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
343
|
-
}
|
|
344
|
-
return pointermid;
|
|
345
|
-
};
|
|
346
|
-
diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
|
|
347
|
-
var text1_length = text1.length;
|
|
348
|
-
var text2_length = text2.length;
|
|
349
|
-
if (text1_length == 0 || text2_length == 0) {
|
|
350
|
-
return 0;
|
|
351
|
-
}
|
|
352
|
-
if (text1_length > text2_length) {
|
|
353
|
-
text1 = text1.substring(text1_length - text2_length);
|
|
354
|
-
} else if (text1_length < text2_length) {
|
|
355
|
-
text2 = text2.substring(0, text1_length);
|
|
356
|
-
}
|
|
357
|
-
var text_length = Math.min(text1_length, text2_length);
|
|
358
|
-
if (text1 == text2) {
|
|
359
|
-
return text_length;
|
|
360
|
-
}
|
|
361
|
-
var best = 0;
|
|
362
|
-
var length = 1;
|
|
363
|
-
while (true) {
|
|
364
|
-
var pattern = text1.substring(text_length - length);
|
|
365
|
-
var found = text2.indexOf(pattern);
|
|
366
|
-
if (found == -1) {
|
|
367
|
-
return best;
|
|
368
|
-
}
|
|
369
|
-
length += found;
|
|
370
|
-
if (found == 0 || text1.substring(text_length - length) == text2.substring(0, length)) {
|
|
371
|
-
best = length;
|
|
372
|
-
length++;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
|
|
377
|
-
if (this.Diff_Timeout <= 0) {
|
|
378
|
-
return null;
|
|
379
|
-
}
|
|
380
|
-
var longtext = text1.length > text2.length ? text1 : text2;
|
|
381
|
-
var shorttext = text1.length > text2.length ? text2 : text1;
|
|
382
|
-
if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
|
|
383
|
-
return null;
|
|
384
|
-
}
|
|
385
|
-
var dmp2 = this;
|
|
386
|
-
function diff_halfMatchI_(longtext2, shorttext2, i) {
|
|
387
|
-
var seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
|
|
388
|
-
var j = -1;
|
|
389
|
-
var best_common = "";
|
|
390
|
-
var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
|
|
391
|
-
while ((j = shorttext2.indexOf(seed, j + 1)) != -1) {
|
|
392
|
-
var prefixLength = dmp2.diff_commonPrefix(
|
|
393
|
-
longtext2.substring(i),
|
|
394
|
-
shorttext2.substring(j)
|
|
395
|
-
);
|
|
396
|
-
var suffixLength = dmp2.diff_commonSuffix(
|
|
397
|
-
longtext2.substring(0, i),
|
|
398
|
-
shorttext2.substring(0, j)
|
|
399
|
-
);
|
|
400
|
-
if (best_common.length < suffixLength + prefixLength) {
|
|
401
|
-
best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
|
|
402
|
-
best_longtext_a = longtext2.substring(0, i - suffixLength);
|
|
403
|
-
best_longtext_b = longtext2.substring(i + prefixLength);
|
|
404
|
-
best_shorttext_a = shorttext2.substring(0, j - suffixLength);
|
|
405
|
-
best_shorttext_b = shorttext2.substring(j + prefixLength);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
if (best_common.length * 2 >= longtext2.length) {
|
|
409
|
-
return [
|
|
410
|
-
best_longtext_a,
|
|
411
|
-
best_longtext_b,
|
|
412
|
-
best_shorttext_a,
|
|
413
|
-
best_shorttext_b,
|
|
414
|
-
best_common
|
|
415
|
-
];
|
|
416
|
-
} else {
|
|
417
|
-
return null;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
var hm1 = diff_halfMatchI_(
|
|
421
|
-
longtext,
|
|
422
|
-
shorttext,
|
|
423
|
-
Math.ceil(longtext.length / 4)
|
|
424
|
-
);
|
|
425
|
-
var hm2 = diff_halfMatchI_(
|
|
426
|
-
longtext,
|
|
427
|
-
shorttext,
|
|
428
|
-
Math.ceil(longtext.length / 2)
|
|
429
|
-
);
|
|
430
|
-
var hm;
|
|
431
|
-
if (!hm1 && !hm2) {
|
|
432
|
-
return null;
|
|
433
|
-
} else if (!hm2) {
|
|
434
|
-
hm = hm1;
|
|
435
|
-
} else if (!hm1) {
|
|
436
|
-
hm = hm2;
|
|
437
|
-
} else {
|
|
438
|
-
hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
|
|
439
|
-
}
|
|
440
|
-
var text1_a, text1_b, text2_a, text2_b;
|
|
441
|
-
if (text1.length > text2.length) {
|
|
442
|
-
text1_a = hm[0];
|
|
443
|
-
text1_b = hm[1];
|
|
444
|
-
text2_a = hm[2];
|
|
445
|
-
text2_b = hm[3];
|
|
446
|
-
} else {
|
|
447
|
-
text2_a = hm[0];
|
|
448
|
-
text2_b = hm[1];
|
|
449
|
-
text1_a = hm[2];
|
|
450
|
-
text1_b = hm[3];
|
|
451
|
-
}
|
|
452
|
-
var mid_common = hm[4];
|
|
453
|
-
return [text1_a, text1_b, text2_a, text2_b, mid_common];
|
|
454
|
-
};
|
|
455
|
-
diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
|
|
456
|
-
var changes = false;
|
|
457
|
-
var equalities = [];
|
|
458
|
-
var equalitiesLength = 0;
|
|
459
|
-
var lastEquality = null;
|
|
460
|
-
var pointer = 0;
|
|
461
|
-
var length_insertions1 = 0;
|
|
462
|
-
var length_deletions1 = 0;
|
|
463
|
-
var length_insertions2 = 0;
|
|
464
|
-
var length_deletions2 = 0;
|
|
465
|
-
while (pointer < diffs.length) {
|
|
466
|
-
if (diffs[pointer][0] == DIFF_EQUAL) {
|
|
467
|
-
equalities[equalitiesLength++] = pointer;
|
|
468
|
-
length_insertions1 = length_insertions2;
|
|
469
|
-
length_deletions1 = length_deletions2;
|
|
470
|
-
length_insertions2 = 0;
|
|
471
|
-
length_deletions2 = 0;
|
|
472
|
-
lastEquality = diffs[pointer][1];
|
|
473
|
-
} else {
|
|
474
|
-
if (diffs[pointer][0] == DIFF_INSERT) {
|
|
475
|
-
length_insertions2 += diffs[pointer][1].length;
|
|
476
|
-
} else {
|
|
477
|
-
length_deletions2 += diffs[pointer][1].length;
|
|
478
|
-
}
|
|
479
|
-
if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(
|
|
480
|
-
length_insertions2,
|
|
481
|
-
length_deletions2
|
|
482
|
-
)) {
|
|
483
|
-
diffs.splice(
|
|
484
|
-
equalities[equalitiesLength - 1],
|
|
485
|
-
0,
|
|
486
|
-
new diff_match_patch.Diff(DIFF_DELETE, lastEquality)
|
|
487
|
-
);
|
|
488
|
-
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
489
|
-
equalitiesLength--;
|
|
490
|
-
equalitiesLength--;
|
|
491
|
-
pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
|
492
|
-
length_insertions1 = 0;
|
|
493
|
-
length_deletions1 = 0;
|
|
494
|
-
length_insertions2 = 0;
|
|
495
|
-
length_deletions2 = 0;
|
|
496
|
-
lastEquality = null;
|
|
497
|
-
changes = true;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
pointer++;
|
|
501
|
-
}
|
|
502
|
-
if (changes) {
|
|
503
|
-
this.diff_cleanupMerge(diffs);
|
|
504
|
-
}
|
|
505
|
-
this.diff_cleanupSemanticLossless(diffs);
|
|
506
|
-
pointer = 1;
|
|
507
|
-
while (pointer < diffs.length) {
|
|
508
|
-
if (diffs[pointer - 1][0] == DIFF_DELETE && diffs[pointer][0] == DIFF_INSERT) {
|
|
509
|
-
var deletion = diffs[pointer - 1][1];
|
|
510
|
-
var insertion = diffs[pointer][1];
|
|
511
|
-
var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);
|
|
512
|
-
var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);
|
|
513
|
-
if (overlap_length1 >= overlap_length2) {
|
|
514
|
-
if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
|
|
515
|
-
diffs.splice(pointer, 0, new diff_match_patch.Diff(
|
|
516
|
-
DIFF_EQUAL,
|
|
517
|
-
insertion.substring(0, overlap_length1)
|
|
518
|
-
));
|
|
519
|
-
diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
|
|
520
|
-
diffs[pointer + 1][1] = insertion.substring(overlap_length1);
|
|
521
|
-
pointer++;
|
|
522
|
-
}
|
|
523
|
-
} else {
|
|
524
|
-
if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
|
|
525
|
-
diffs.splice(pointer, 0, new diff_match_patch.Diff(
|
|
526
|
-
DIFF_EQUAL,
|
|
527
|
-
deletion.substring(0, overlap_length2)
|
|
528
|
-
));
|
|
529
|
-
diffs[pointer - 1][0] = DIFF_INSERT;
|
|
530
|
-
diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
|
|
531
|
-
diffs[pointer + 1][0] = DIFF_DELETE;
|
|
532
|
-
diffs[pointer + 1][1] = deletion.substring(overlap_length2);
|
|
533
|
-
pointer++;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
pointer++;
|
|
537
|
-
}
|
|
538
|
-
pointer++;
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
|
|
542
|
-
function diff_cleanupSemanticScore_(one, two) {
|
|
543
|
-
if (!one || !two) {
|
|
544
|
-
return 6;
|
|
545
|
-
}
|
|
546
|
-
var char1 = one.charAt(one.length - 1);
|
|
547
|
-
var char2 = two.charAt(0);
|
|
548
|
-
var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);
|
|
549
|
-
var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);
|
|
550
|
-
var whitespace1 = nonAlphaNumeric1 && char1.match(diff_match_patch.whitespaceRegex_);
|
|
551
|
-
var whitespace2 = nonAlphaNumeric2 && char2.match(diff_match_patch.whitespaceRegex_);
|
|
552
|
-
var lineBreak1 = whitespace1 && char1.match(diff_match_patch.linebreakRegex_);
|
|
553
|
-
var lineBreak2 = whitespace2 && char2.match(diff_match_patch.linebreakRegex_);
|
|
554
|
-
var blankLine1 = lineBreak1 && one.match(diff_match_patch.blanklineEndRegex_);
|
|
555
|
-
var blankLine2 = lineBreak2 && two.match(diff_match_patch.blanklineStartRegex_);
|
|
556
|
-
if (blankLine1 || blankLine2) {
|
|
557
|
-
return 5;
|
|
558
|
-
} else if (lineBreak1 || lineBreak2) {
|
|
559
|
-
return 4;
|
|
560
|
-
} else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
|
|
561
|
-
return 3;
|
|
562
|
-
} else if (whitespace1 || whitespace2) {
|
|
563
|
-
return 2;
|
|
564
|
-
} else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
|
|
565
|
-
return 1;
|
|
566
|
-
}
|
|
567
|
-
return 0;
|
|
568
|
-
}
|
|
569
|
-
var pointer = 1;
|
|
570
|
-
while (pointer < diffs.length - 1) {
|
|
571
|
-
if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
|
|
572
|
-
var equality1 = diffs[pointer - 1][1];
|
|
573
|
-
var edit = diffs[pointer][1];
|
|
574
|
-
var equality2 = diffs[pointer + 1][1];
|
|
575
|
-
var commonOffset = this.diff_commonSuffix(equality1, edit);
|
|
576
|
-
if (commonOffset) {
|
|
577
|
-
var commonString = edit.substring(edit.length - commonOffset);
|
|
578
|
-
equality1 = equality1.substring(0, equality1.length - commonOffset);
|
|
579
|
-
edit = commonString + edit.substring(0, edit.length - commonOffset);
|
|
580
|
-
equality2 = commonString + equality2;
|
|
581
|
-
}
|
|
582
|
-
var bestEquality1 = equality1;
|
|
583
|
-
var bestEdit = edit;
|
|
584
|
-
var bestEquality2 = equality2;
|
|
585
|
-
var bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
586
|
-
while (edit.charAt(0) === equality2.charAt(0)) {
|
|
587
|
-
equality1 += edit.charAt(0);
|
|
588
|
-
edit = edit.substring(1) + equality2.charAt(0);
|
|
589
|
-
equality2 = equality2.substring(1);
|
|
590
|
-
var score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
591
|
-
if (score >= bestScore) {
|
|
592
|
-
bestScore = score;
|
|
593
|
-
bestEquality1 = equality1;
|
|
594
|
-
bestEdit = edit;
|
|
595
|
-
bestEquality2 = equality2;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
if (diffs[pointer - 1][1] != bestEquality1) {
|
|
599
|
-
if (bestEquality1) {
|
|
600
|
-
diffs[pointer - 1][1] = bestEquality1;
|
|
601
|
-
} else {
|
|
602
|
-
diffs.splice(pointer - 1, 1);
|
|
603
|
-
pointer--;
|
|
604
|
-
}
|
|
605
|
-
diffs[pointer][1] = bestEdit;
|
|
606
|
-
if (bestEquality2) {
|
|
607
|
-
diffs[pointer + 1][1] = bestEquality2;
|
|
608
|
-
} else {
|
|
609
|
-
diffs.splice(pointer + 1, 1);
|
|
610
|
-
pointer--;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
pointer++;
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
diff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;
|
|
618
|
-
diff_match_patch.whitespaceRegex_ = /\s/;
|
|
619
|
-
diff_match_patch.linebreakRegex_ = /[\r\n]/;
|
|
620
|
-
diff_match_patch.blanklineEndRegex_ = /\n\r?\n$/;
|
|
621
|
-
diff_match_patch.blanklineStartRegex_ = /^\r?\n\r?\n/;
|
|
622
|
-
diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
|
|
623
|
-
var changes = false;
|
|
624
|
-
var equalities = [];
|
|
625
|
-
var equalitiesLength = 0;
|
|
626
|
-
var lastEquality = null;
|
|
627
|
-
var pointer = 0;
|
|
628
|
-
var pre_ins = false;
|
|
629
|
-
var pre_del = false;
|
|
630
|
-
var post_ins = false;
|
|
631
|
-
var post_del = false;
|
|
632
|
-
while (pointer < diffs.length) {
|
|
633
|
-
if (diffs[pointer][0] == DIFF_EQUAL) {
|
|
634
|
-
if (diffs[pointer][1].length < this.Diff_EditCost && (post_ins || post_del)) {
|
|
635
|
-
equalities[equalitiesLength++] = pointer;
|
|
636
|
-
pre_ins = post_ins;
|
|
637
|
-
pre_del = post_del;
|
|
638
|
-
lastEquality = diffs[pointer][1];
|
|
639
|
-
} else {
|
|
640
|
-
equalitiesLength = 0;
|
|
641
|
-
lastEquality = null;
|
|
642
|
-
}
|
|
643
|
-
post_ins = post_del = false;
|
|
644
|
-
} else {
|
|
645
|
-
if (diffs[pointer][0] == DIFF_DELETE) {
|
|
646
|
-
post_del = true;
|
|
647
|
-
} else {
|
|
648
|
-
post_ins = true;
|
|
649
|
-
}
|
|
650
|
-
if (lastEquality && (pre_ins && pre_del && post_ins && post_del || lastEquality.length < this.Diff_EditCost / 2 && pre_ins + pre_del + post_ins + post_del == 3)) {
|
|
651
|
-
diffs.splice(
|
|
652
|
-
equalities[equalitiesLength - 1],
|
|
653
|
-
0,
|
|
654
|
-
new diff_match_patch.Diff(DIFF_DELETE, lastEquality)
|
|
655
|
-
);
|
|
656
|
-
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
657
|
-
equalitiesLength--;
|
|
658
|
-
lastEquality = null;
|
|
659
|
-
if (pre_ins && pre_del) {
|
|
660
|
-
post_ins = post_del = true;
|
|
661
|
-
equalitiesLength = 0;
|
|
662
|
-
} else {
|
|
663
|
-
equalitiesLength--;
|
|
664
|
-
pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
|
665
|
-
post_ins = post_del = false;
|
|
666
|
-
}
|
|
667
|
-
changes = true;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
pointer++;
|
|
671
|
-
}
|
|
672
|
-
if (changes) {
|
|
673
|
-
this.diff_cleanupMerge(diffs);
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
|
|
677
|
-
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ""));
|
|
678
|
-
var pointer = 0;
|
|
679
|
-
var count_delete = 0;
|
|
680
|
-
var count_insert = 0;
|
|
681
|
-
var text_delete = "";
|
|
682
|
-
var text_insert = "";
|
|
683
|
-
var commonlength;
|
|
684
|
-
while (pointer < diffs.length) {
|
|
685
|
-
switch (diffs[pointer][0]) {
|
|
686
|
-
case DIFF_INSERT:
|
|
687
|
-
count_insert++;
|
|
688
|
-
text_insert += diffs[pointer][1];
|
|
689
|
-
pointer++;
|
|
690
|
-
break;
|
|
691
|
-
case DIFF_DELETE:
|
|
692
|
-
count_delete++;
|
|
693
|
-
text_delete += diffs[pointer][1];
|
|
694
|
-
pointer++;
|
|
695
|
-
break;
|
|
696
|
-
case DIFF_EQUAL:
|
|
697
|
-
if (count_delete + count_insert > 1) {
|
|
698
|
-
if (count_delete !== 0 && count_insert !== 0) {
|
|
699
|
-
commonlength = this.diff_commonPrefix(text_insert, text_delete);
|
|
700
|
-
if (commonlength !== 0) {
|
|
701
|
-
if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
|
|
702
|
-
diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
|
|
703
|
-
} else {
|
|
704
|
-
diffs.splice(0, 0, new diff_match_patch.Diff(
|
|
705
|
-
DIFF_EQUAL,
|
|
706
|
-
text_insert.substring(0, commonlength)
|
|
707
|
-
));
|
|
708
|
-
pointer++;
|
|
709
|
-
}
|
|
710
|
-
text_insert = text_insert.substring(commonlength);
|
|
711
|
-
text_delete = text_delete.substring(commonlength);
|
|
712
|
-
}
|
|
713
|
-
commonlength = this.diff_commonSuffix(text_insert, text_delete);
|
|
714
|
-
if (commonlength !== 0) {
|
|
715
|
-
diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
|
|
716
|
-
text_insert = text_insert.substring(0, text_insert.length - commonlength);
|
|
717
|
-
text_delete = text_delete.substring(0, text_delete.length - commonlength);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
pointer -= count_delete + count_insert;
|
|
721
|
-
diffs.splice(pointer, count_delete + count_insert);
|
|
722
|
-
if (text_delete.length) {
|
|
723
|
-
diffs.splice(
|
|
724
|
-
pointer,
|
|
725
|
-
0,
|
|
726
|
-
new diff_match_patch.Diff(DIFF_DELETE, text_delete)
|
|
727
|
-
);
|
|
728
|
-
pointer++;
|
|
729
|
-
}
|
|
730
|
-
if (text_insert.length) {
|
|
731
|
-
diffs.splice(
|
|
732
|
-
pointer,
|
|
733
|
-
0,
|
|
734
|
-
new diff_match_patch.Diff(DIFF_INSERT, text_insert)
|
|
735
|
-
);
|
|
736
|
-
pointer++;
|
|
737
|
-
}
|
|
738
|
-
pointer++;
|
|
739
|
-
} else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
|
|
740
|
-
diffs[pointer - 1][1] += diffs[pointer][1];
|
|
741
|
-
diffs.splice(pointer, 1);
|
|
742
|
-
} else {
|
|
743
|
-
pointer++;
|
|
744
|
-
}
|
|
745
|
-
count_insert = 0;
|
|
746
|
-
count_delete = 0;
|
|
747
|
-
text_delete = "";
|
|
748
|
-
text_insert = "";
|
|
749
|
-
break;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
if (diffs[diffs.length - 1][1] === "") {
|
|
753
|
-
diffs.pop();
|
|
754
|
-
}
|
|
755
|
-
var changes = false;
|
|
756
|
-
pointer = 1;
|
|
757
|
-
while (pointer < diffs.length - 1) {
|
|
758
|
-
if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
|
|
759
|
-
if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
|
|
760
|
-
diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
|
|
761
|
-
diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
|
|
762
|
-
diffs.splice(pointer - 1, 1);
|
|
763
|
-
changes = true;
|
|
764
|
-
} else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
|
|
765
|
-
diffs[pointer - 1][1] += diffs[pointer + 1][1];
|
|
766
|
-
diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
|
|
767
|
-
diffs.splice(pointer + 1, 1);
|
|
768
|
-
changes = true;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
pointer++;
|
|
772
|
-
}
|
|
773
|
-
if (changes) {
|
|
774
|
-
this.diff_cleanupMerge(diffs);
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
|
-
diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
|
|
778
|
-
var chars1 = 0;
|
|
779
|
-
var chars2 = 0;
|
|
780
|
-
var last_chars1 = 0;
|
|
781
|
-
var last_chars2 = 0;
|
|
782
|
-
var x;
|
|
783
|
-
for (x = 0; x < diffs.length; x++) {
|
|
784
|
-
if (diffs[x][0] !== DIFF_INSERT) {
|
|
785
|
-
chars1 += diffs[x][1].length;
|
|
786
|
-
}
|
|
787
|
-
if (diffs[x][0] !== DIFF_DELETE) {
|
|
788
|
-
chars2 += diffs[x][1].length;
|
|
789
|
-
}
|
|
790
|
-
if (chars1 > loc) {
|
|
791
|
-
break;
|
|
792
|
-
}
|
|
793
|
-
last_chars1 = chars1;
|
|
794
|
-
last_chars2 = chars2;
|
|
795
|
-
}
|
|
796
|
-
if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {
|
|
797
|
-
return last_chars2;
|
|
798
|
-
}
|
|
799
|
-
return last_chars2 + (loc - last_chars1);
|
|
800
|
-
};
|
|
801
|
-
diff_match_patch.prototype.diff_prettyHtml = function(diffs) {
|
|
802
|
-
var html = [];
|
|
803
|
-
var pattern_amp = /&/g;
|
|
804
|
-
var pattern_lt = /</g;
|
|
805
|
-
var pattern_gt = />/g;
|
|
806
|
-
var pattern_para = /\n/g;
|
|
807
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
808
|
-
var op = diffs[x][0];
|
|
809
|
-
var data = diffs[x][1];
|
|
810
|
-
var text = data.replace(pattern_amp, "&").replace(pattern_lt, "<").replace(pattern_gt, ">").replace(pattern_para, "¶<br>");
|
|
811
|
-
switch (op) {
|
|
812
|
-
case DIFF_INSERT:
|
|
813
|
-
html[x] = '<ins style="background:#e6ffe6;">' + text + "</ins>";
|
|
814
|
-
break;
|
|
815
|
-
case DIFF_DELETE:
|
|
816
|
-
html[x] = '<del style="background:#ffe6e6;">' + text + "</del>";
|
|
817
|
-
break;
|
|
818
|
-
case DIFF_EQUAL:
|
|
819
|
-
html[x] = "<span>" + text + "</span>";
|
|
820
|
-
break;
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
return html.join("");
|
|
824
|
-
};
|
|
825
|
-
diff_match_patch.prototype.diff_text1 = function(diffs) {
|
|
826
|
-
var text = [];
|
|
827
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
828
|
-
if (diffs[x][0] !== DIFF_INSERT) {
|
|
829
|
-
text[x] = diffs[x][1];
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
return text.join("");
|
|
833
|
-
};
|
|
834
|
-
diff_match_patch.prototype.diff_text2 = function(diffs) {
|
|
835
|
-
var text = [];
|
|
836
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
837
|
-
if (diffs[x][0] !== DIFF_DELETE) {
|
|
838
|
-
text[x] = diffs[x][1];
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
return text.join("");
|
|
842
|
-
};
|
|
843
|
-
diff_match_patch.prototype.diff_levenshtein = function(diffs) {
|
|
844
|
-
var levenshtein = 0;
|
|
845
|
-
var insertions = 0;
|
|
846
|
-
var deletions = 0;
|
|
847
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
848
|
-
var op = diffs[x][0];
|
|
849
|
-
var data = diffs[x][1];
|
|
850
|
-
switch (op) {
|
|
851
|
-
case DIFF_INSERT:
|
|
852
|
-
insertions += data.length;
|
|
853
|
-
break;
|
|
854
|
-
case DIFF_DELETE:
|
|
855
|
-
deletions += data.length;
|
|
856
|
-
break;
|
|
857
|
-
case DIFF_EQUAL:
|
|
858
|
-
levenshtein += Math.max(insertions, deletions);
|
|
859
|
-
insertions = 0;
|
|
860
|
-
deletions = 0;
|
|
861
|
-
break;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
levenshtein += Math.max(insertions, deletions);
|
|
865
|
-
return levenshtein;
|
|
866
|
-
};
|
|
867
|
-
diff_match_patch.prototype.diff_toDelta = function(diffs) {
|
|
868
|
-
var text = [];
|
|
869
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
870
|
-
switch (diffs[x][0]) {
|
|
871
|
-
case DIFF_INSERT:
|
|
872
|
-
text[x] = "+" + encodeURI(diffs[x][1]);
|
|
873
|
-
break;
|
|
874
|
-
case DIFF_DELETE:
|
|
875
|
-
text[x] = "-" + diffs[x][1].length;
|
|
876
|
-
break;
|
|
877
|
-
case DIFF_EQUAL:
|
|
878
|
-
text[x] = "=" + diffs[x][1].length;
|
|
879
|
-
break;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
return text.join(" ").replace(/%20/g, " ");
|
|
883
|
-
};
|
|
884
|
-
diff_match_patch.prototype.diff_fromDelta = function(text1, delta) {
|
|
885
|
-
var diffs = [];
|
|
886
|
-
var diffsLength = 0;
|
|
887
|
-
var pointer = 0;
|
|
888
|
-
var tokens = delta.split(/\t/g);
|
|
889
|
-
for (var x = 0; x < tokens.length; x++) {
|
|
890
|
-
var param = tokens[x].substring(1);
|
|
891
|
-
switch (tokens[x].charAt(0)) {
|
|
892
|
-
case "+":
|
|
893
|
-
try {
|
|
894
|
-
diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param));
|
|
895
|
-
} catch (ex) {
|
|
896
|
-
throw new Error("Illegal escape in diff_fromDelta: " + param);
|
|
897
|
-
}
|
|
898
|
-
break;
|
|
899
|
-
case "-":
|
|
900
|
-
// Fall through.
|
|
901
|
-
case "=":
|
|
902
|
-
var n = parseInt(param, 10);
|
|
903
|
-
if (isNaN(n) || n < 0) {
|
|
904
|
-
throw new Error("Invalid number in diff_fromDelta: " + param);
|
|
905
|
-
}
|
|
906
|
-
var text = text1.substring(pointer, pointer += n);
|
|
907
|
-
if (tokens[x].charAt(0) == "=") {
|
|
908
|
-
diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text);
|
|
909
|
-
} else {
|
|
910
|
-
diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text);
|
|
911
|
-
}
|
|
912
|
-
break;
|
|
913
|
-
default:
|
|
914
|
-
if (tokens[x]) {
|
|
915
|
-
throw new Error("Invalid diff operation in diff_fromDelta: " + tokens[x]);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
if (pointer != text1.length) {
|
|
920
|
-
throw new Error("Delta length (" + pointer + ") does not equal source text length (" + text1.length + ").");
|
|
921
|
-
}
|
|
922
|
-
return diffs;
|
|
923
|
-
};
|
|
924
|
-
diff_match_patch.prototype.match_main = function(text, pattern, loc) {
|
|
925
|
-
if (text == null || pattern == null || loc == null) {
|
|
926
|
-
throw new Error("Null input. (match_main)");
|
|
927
|
-
}
|
|
928
|
-
loc = Math.max(0, Math.min(loc, text.length));
|
|
929
|
-
if (text == pattern) {
|
|
930
|
-
return 0;
|
|
931
|
-
} else if (!text.length) {
|
|
932
|
-
return -1;
|
|
933
|
-
} else if (text.substring(loc, loc + pattern.length) == pattern) {
|
|
934
|
-
return loc;
|
|
935
|
-
} else {
|
|
936
|
-
return this.match_bitap_(text, pattern, loc);
|
|
937
|
-
}
|
|
938
|
-
};
|
|
939
|
-
diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
|
|
940
|
-
if (pattern.length > this.Match_MaxBits) {
|
|
941
|
-
throw new Error("Pattern too long for this browser.");
|
|
942
|
-
}
|
|
943
|
-
var s = this.match_alphabet_(pattern);
|
|
944
|
-
var dmp2 = this;
|
|
945
|
-
function match_bitapScore_(e, x) {
|
|
946
|
-
var accuracy = e / pattern.length;
|
|
947
|
-
var proximity = Math.abs(loc - x);
|
|
948
|
-
if (!dmp2.Match_Distance) {
|
|
949
|
-
return proximity ? 1 : accuracy;
|
|
950
|
-
}
|
|
951
|
-
return accuracy + proximity / dmp2.Match_Distance;
|
|
952
|
-
}
|
|
953
|
-
var score_threshold = this.Match_Threshold;
|
|
954
|
-
var best_loc = text.indexOf(pattern, loc);
|
|
955
|
-
if (best_loc != -1) {
|
|
956
|
-
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
|
957
|
-
best_loc = text.lastIndexOf(pattern, loc + pattern.length);
|
|
958
|
-
if (best_loc != -1) {
|
|
959
|
-
score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
var matchmask = 1 << pattern.length - 1;
|
|
963
|
-
best_loc = -1;
|
|
964
|
-
var bin_min, bin_mid;
|
|
965
|
-
var bin_max = pattern.length + text.length;
|
|
966
|
-
var last_rd;
|
|
967
|
-
for (var d = 0; d < pattern.length; d++) {
|
|
968
|
-
bin_min = 0;
|
|
969
|
-
bin_mid = bin_max;
|
|
970
|
-
while (bin_min < bin_mid) {
|
|
971
|
-
if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {
|
|
972
|
-
bin_min = bin_mid;
|
|
973
|
-
} else {
|
|
974
|
-
bin_max = bin_mid;
|
|
975
|
-
}
|
|
976
|
-
bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);
|
|
977
|
-
}
|
|
978
|
-
bin_max = bin_mid;
|
|
979
|
-
var start = Math.max(1, loc - bin_mid + 1);
|
|
980
|
-
var finish = Math.min(loc + bin_mid, text.length) + pattern.length;
|
|
981
|
-
var rd = Array(finish + 2);
|
|
982
|
-
rd[finish + 1] = (1 << d) - 1;
|
|
983
|
-
for (var j = finish; j >= start; j--) {
|
|
984
|
-
var charMatch = s[text.charAt(j - 1)];
|
|
985
|
-
if (d === 0) {
|
|
986
|
-
rd[j] = (rd[j + 1] << 1 | 1) & charMatch;
|
|
987
|
-
} else {
|
|
988
|
-
rd[j] = (rd[j + 1] << 1 | 1) & charMatch | ((last_rd[j + 1] | last_rd[j]) << 1 | 1) | last_rd[j + 1];
|
|
989
|
-
}
|
|
990
|
-
if (rd[j] & matchmask) {
|
|
991
|
-
var score = match_bitapScore_(d, j - 1);
|
|
992
|
-
if (score <= score_threshold) {
|
|
993
|
-
score_threshold = score;
|
|
994
|
-
best_loc = j - 1;
|
|
995
|
-
if (best_loc > loc) {
|
|
996
|
-
start = Math.max(1, 2 * loc - best_loc);
|
|
997
|
-
} else {
|
|
998
|
-
break;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
if (match_bitapScore_(d + 1, loc) > score_threshold) {
|
|
1004
|
-
break;
|
|
1005
|
-
}
|
|
1006
|
-
last_rd = rd;
|
|
1007
|
-
}
|
|
1008
|
-
return best_loc;
|
|
1009
|
-
};
|
|
1010
|
-
diff_match_patch.prototype.match_alphabet_ = function(pattern) {
|
|
1011
|
-
var s = {};
|
|
1012
|
-
for (var i = 0; i < pattern.length; i++) {
|
|
1013
|
-
s[pattern.charAt(i)] = 0;
|
|
1014
|
-
}
|
|
1015
|
-
for (var i = 0; i < pattern.length; i++) {
|
|
1016
|
-
s[pattern.charAt(i)] |= 1 << pattern.length - i - 1;
|
|
1017
|
-
}
|
|
1018
|
-
return s;
|
|
1019
|
-
};
|
|
1020
|
-
diff_match_patch.prototype.patch_addContext_ = function(patch, text) {
|
|
1021
|
-
if (text.length == 0) {
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
if (patch.start2 === null) {
|
|
1025
|
-
throw Error("patch not initialized");
|
|
1026
|
-
}
|
|
1027
|
-
var pattern = text.substring(patch.start2, patch.start2 + patch.length1);
|
|
1028
|
-
var padding = 0;
|
|
1029
|
-
while (text.indexOf(pattern) != text.lastIndexOf(pattern) && pattern.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin) {
|
|
1030
|
-
padding += this.Patch_Margin;
|
|
1031
|
-
pattern = text.substring(
|
|
1032
|
-
patch.start2 - padding,
|
|
1033
|
-
patch.start2 + patch.length1 + padding
|
|
1034
|
-
);
|
|
1035
|
-
}
|
|
1036
|
-
padding += this.Patch_Margin;
|
|
1037
|
-
var prefix = text.substring(patch.start2 - padding, patch.start2);
|
|
1038
|
-
if (prefix) {
|
|
1039
|
-
patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix));
|
|
1040
|
-
}
|
|
1041
|
-
var suffix = text.substring(
|
|
1042
|
-
patch.start2 + patch.length1,
|
|
1043
|
-
patch.start2 + patch.length1 + padding
|
|
1044
|
-
);
|
|
1045
|
-
if (suffix) {
|
|
1046
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix));
|
|
1047
|
-
}
|
|
1048
|
-
patch.start1 -= prefix.length;
|
|
1049
|
-
patch.start2 -= prefix.length;
|
|
1050
|
-
patch.length1 += prefix.length + suffix.length;
|
|
1051
|
-
patch.length2 += prefix.length + suffix.length;
|
|
1052
|
-
};
|
|
1053
|
-
diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
|
|
1054
|
-
var text1, diffs;
|
|
1055
|
-
if (typeof a == "string" && typeof opt_b == "string" && typeof opt_c == "undefined") {
|
|
1056
|
-
text1 = /** @type {string} */
|
|
1057
|
-
a;
|
|
1058
|
-
diffs = this.diff_main(
|
|
1059
|
-
text1,
|
|
1060
|
-
/** @type {string} */
|
|
1061
|
-
opt_b,
|
|
1062
|
-
true
|
|
1063
|
-
);
|
|
1064
|
-
if (diffs.length > 2) {
|
|
1065
|
-
this.diff_cleanupSemantic(diffs);
|
|
1066
|
-
this.diff_cleanupEfficiency(diffs);
|
|
1067
|
-
}
|
|
1068
|
-
} else if (a && typeof a == "object" && typeof opt_b == "undefined" && typeof opt_c == "undefined") {
|
|
1069
|
-
diffs = /** @type {!Array.<!diff_match_patch.Diff>} */
|
|
1070
|
-
a;
|
|
1071
|
-
text1 = this.diff_text1(diffs);
|
|
1072
|
-
} else if (typeof a == "string" && opt_b && typeof opt_b == "object" && typeof opt_c == "undefined") {
|
|
1073
|
-
text1 = /** @type {string} */
|
|
1074
|
-
a;
|
|
1075
|
-
diffs = /** @type {!Array.<!diff_match_patch.Diff>} */
|
|
1076
|
-
opt_b;
|
|
1077
|
-
} else if (typeof a == "string" && typeof opt_b == "string" && opt_c && typeof opt_c == "object") {
|
|
1078
|
-
text1 = /** @type {string} */
|
|
1079
|
-
a;
|
|
1080
|
-
diffs = /** @type {!Array.<!diff_match_patch.Diff>} */
|
|
1081
|
-
opt_c;
|
|
1082
|
-
} else {
|
|
1083
|
-
throw new Error("Unknown call format to patch_make.");
|
|
1084
|
-
}
|
|
1085
|
-
if (diffs.length === 0) {
|
|
1086
|
-
return [];
|
|
1087
|
-
}
|
|
1088
|
-
var patches = [];
|
|
1089
|
-
var patch = new diff_match_patch.patch_obj();
|
|
1090
|
-
var patchDiffLength = 0;
|
|
1091
|
-
var char_count1 = 0;
|
|
1092
|
-
var char_count2 = 0;
|
|
1093
|
-
var prepatch_text = text1;
|
|
1094
|
-
var postpatch_text = text1;
|
|
1095
|
-
for (var x = 0; x < diffs.length; x++) {
|
|
1096
|
-
var diff_type = diffs[x][0];
|
|
1097
|
-
var diff_text = diffs[x][1];
|
|
1098
|
-
if (!patchDiffLength && diff_type !== DIFF_EQUAL) {
|
|
1099
|
-
patch.start1 = char_count1;
|
|
1100
|
-
patch.start2 = char_count2;
|
|
1101
|
-
}
|
|
1102
|
-
switch (diff_type) {
|
|
1103
|
-
case DIFF_INSERT:
|
|
1104
|
-
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1105
|
-
patch.length2 += diff_text.length;
|
|
1106
|
-
postpatch_text = postpatch_text.substring(0, char_count2) + diff_text + postpatch_text.substring(char_count2);
|
|
1107
|
-
break;
|
|
1108
|
-
case DIFF_DELETE:
|
|
1109
|
-
patch.length1 += diff_text.length;
|
|
1110
|
-
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1111
|
-
postpatch_text = postpatch_text.substring(0, char_count2) + postpatch_text.substring(char_count2 + diff_text.length);
|
|
1112
|
-
break;
|
|
1113
|
-
case DIFF_EQUAL:
|
|
1114
|
-
if (diff_text.length <= 2 * this.Patch_Margin && patchDiffLength && diffs.length != x + 1) {
|
|
1115
|
-
patch.diffs[patchDiffLength++] = diffs[x];
|
|
1116
|
-
patch.length1 += diff_text.length;
|
|
1117
|
-
patch.length2 += diff_text.length;
|
|
1118
|
-
} else if (diff_text.length >= 2 * this.Patch_Margin) {
|
|
1119
|
-
if (patchDiffLength) {
|
|
1120
|
-
this.patch_addContext_(patch, prepatch_text);
|
|
1121
|
-
patches.push(patch);
|
|
1122
|
-
patch = new diff_match_patch.patch_obj();
|
|
1123
|
-
patchDiffLength = 0;
|
|
1124
|
-
prepatch_text = postpatch_text;
|
|
1125
|
-
char_count1 = char_count2;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
break;
|
|
1129
|
-
}
|
|
1130
|
-
if (diff_type !== DIFF_INSERT) {
|
|
1131
|
-
char_count1 += diff_text.length;
|
|
1132
|
-
}
|
|
1133
|
-
if (diff_type !== DIFF_DELETE) {
|
|
1134
|
-
char_count2 += diff_text.length;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
if (patchDiffLength) {
|
|
1138
|
-
this.patch_addContext_(patch, prepatch_text);
|
|
1139
|
-
patches.push(patch);
|
|
1140
|
-
}
|
|
1141
|
-
return patches;
|
|
1142
|
-
};
|
|
1143
|
-
diff_match_patch.prototype.patch_deepCopy = function(patches) {
|
|
1144
|
-
var patchesCopy = [];
|
|
1145
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1146
|
-
var patch = patches[x];
|
|
1147
|
-
var patchCopy = new diff_match_patch.patch_obj();
|
|
1148
|
-
patchCopy.diffs = [];
|
|
1149
|
-
for (var y = 0; y < patch.diffs.length; y++) {
|
|
1150
|
-
patchCopy.diffs[y] = new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]);
|
|
1151
|
-
}
|
|
1152
|
-
patchCopy.start1 = patch.start1;
|
|
1153
|
-
patchCopy.start2 = patch.start2;
|
|
1154
|
-
patchCopy.length1 = patch.length1;
|
|
1155
|
-
patchCopy.length2 = patch.length2;
|
|
1156
|
-
patchesCopy[x] = patchCopy;
|
|
1157
|
-
}
|
|
1158
|
-
return patchesCopy;
|
|
1159
|
-
};
|
|
1160
|
-
diff_match_patch.prototype.patch_apply = function(patches, text) {
|
|
1161
|
-
if (patches.length == 0) {
|
|
1162
|
-
return [text, []];
|
|
1163
|
-
}
|
|
1164
|
-
patches = this.patch_deepCopy(patches);
|
|
1165
|
-
var nullPadding = this.patch_addPadding(patches);
|
|
1166
|
-
text = nullPadding + text + nullPadding;
|
|
1167
|
-
this.patch_splitMax(patches);
|
|
1168
|
-
var delta = 0;
|
|
1169
|
-
var results = [];
|
|
1170
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1171
|
-
var expected_loc = patches[x].start2 + delta;
|
|
1172
|
-
var text1 = this.diff_text1(patches[x].diffs);
|
|
1173
|
-
var start_loc;
|
|
1174
|
-
var end_loc = -1;
|
|
1175
|
-
if (text1.length > this.Match_MaxBits) {
|
|
1176
|
-
start_loc = this.match_main(
|
|
1177
|
-
text,
|
|
1178
|
-
text1.substring(0, this.Match_MaxBits),
|
|
1179
|
-
expected_loc
|
|
1180
|
-
);
|
|
1181
|
-
if (start_loc != -1) {
|
|
1182
|
-
end_loc = this.match_main(
|
|
1183
|
-
text,
|
|
1184
|
-
text1.substring(text1.length - this.Match_MaxBits),
|
|
1185
|
-
expected_loc + text1.length - this.Match_MaxBits
|
|
1186
|
-
);
|
|
1187
|
-
if (end_loc == -1 || start_loc >= end_loc) {
|
|
1188
|
-
start_loc = -1;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
} else {
|
|
1192
|
-
start_loc = this.match_main(text, text1, expected_loc);
|
|
1193
|
-
}
|
|
1194
|
-
if (start_loc == -1) {
|
|
1195
|
-
results[x] = false;
|
|
1196
|
-
delta -= patches[x].length2 - patches[x].length1;
|
|
1197
|
-
} else {
|
|
1198
|
-
results[x] = true;
|
|
1199
|
-
delta = start_loc - expected_loc;
|
|
1200
|
-
var text2;
|
|
1201
|
-
if (end_loc == -1) {
|
|
1202
|
-
text2 = text.substring(start_loc, start_loc + text1.length);
|
|
1203
|
-
} else {
|
|
1204
|
-
text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);
|
|
1205
|
-
}
|
|
1206
|
-
if (text1 == text2) {
|
|
1207
|
-
text = text.substring(0, start_loc) + this.diff_text2(patches[x].diffs) + text.substring(start_loc + text1.length);
|
|
1208
|
-
} else {
|
|
1209
|
-
var diffs = this.diff_main(text1, text2, false);
|
|
1210
|
-
if (text1.length > this.Match_MaxBits && this.diff_levenshtein(diffs) / text1.length > this.Patch_DeleteThreshold) {
|
|
1211
|
-
results[x] = false;
|
|
1212
|
-
} else {
|
|
1213
|
-
this.diff_cleanupSemanticLossless(diffs);
|
|
1214
|
-
var index1 = 0;
|
|
1215
|
-
var index2;
|
|
1216
|
-
for (var y = 0; y < patches[x].diffs.length; y++) {
|
|
1217
|
-
var mod = patches[x].diffs[y];
|
|
1218
|
-
if (mod[0] !== DIFF_EQUAL) {
|
|
1219
|
-
index2 = this.diff_xIndex(diffs, index1);
|
|
1220
|
-
}
|
|
1221
|
-
if (mod[0] === DIFF_INSERT) {
|
|
1222
|
-
text = text.substring(0, start_loc + index2) + mod[1] + text.substring(start_loc + index2);
|
|
1223
|
-
} else if (mod[0] === DIFF_DELETE) {
|
|
1224
|
-
text = text.substring(0, start_loc + index2) + text.substring(start_loc + this.diff_xIndex(
|
|
1225
|
-
diffs,
|
|
1226
|
-
index1 + mod[1].length
|
|
1227
|
-
));
|
|
1228
|
-
}
|
|
1229
|
-
if (mod[0] !== DIFF_DELETE) {
|
|
1230
|
-
index1 += mod[1].length;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
text = text.substring(nullPadding.length, text.length - nullPadding.length);
|
|
1238
|
-
return [text, results];
|
|
1239
|
-
};
|
|
1240
|
-
diff_match_patch.prototype.patch_addPadding = function(patches) {
|
|
1241
|
-
var paddingLength = this.Patch_Margin;
|
|
1242
|
-
var nullPadding = "";
|
|
1243
|
-
for (var x = 1; x <= paddingLength; x++) {
|
|
1244
|
-
nullPadding += String.fromCharCode(x);
|
|
1245
|
-
}
|
|
1246
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1247
|
-
patches[x].start1 += paddingLength;
|
|
1248
|
-
patches[x].start2 += paddingLength;
|
|
1249
|
-
}
|
|
1250
|
-
var patch = patches[0];
|
|
1251
|
-
var diffs = patch.diffs;
|
|
1252
|
-
if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {
|
|
1253
|
-
diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));
|
|
1254
|
-
patch.start1 -= paddingLength;
|
|
1255
|
-
patch.start2 -= paddingLength;
|
|
1256
|
-
patch.length1 += paddingLength;
|
|
1257
|
-
patch.length2 += paddingLength;
|
|
1258
|
-
} else if (paddingLength > diffs[0][1].length) {
|
|
1259
|
-
var extraLength = paddingLength - diffs[0][1].length;
|
|
1260
|
-
diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];
|
|
1261
|
-
patch.start1 -= extraLength;
|
|
1262
|
-
patch.start2 -= extraLength;
|
|
1263
|
-
patch.length1 += extraLength;
|
|
1264
|
-
patch.length2 += extraLength;
|
|
1265
|
-
}
|
|
1266
|
-
patch = patches[patches.length - 1];
|
|
1267
|
-
diffs = patch.diffs;
|
|
1268
|
-
if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {
|
|
1269
|
-
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));
|
|
1270
|
-
patch.length1 += paddingLength;
|
|
1271
|
-
patch.length2 += paddingLength;
|
|
1272
|
-
} else if (paddingLength > diffs[diffs.length - 1][1].length) {
|
|
1273
|
-
var extraLength = paddingLength - diffs[diffs.length - 1][1].length;
|
|
1274
|
-
diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);
|
|
1275
|
-
patch.length1 += extraLength;
|
|
1276
|
-
patch.length2 += extraLength;
|
|
1277
|
-
}
|
|
1278
|
-
return nullPadding;
|
|
1279
|
-
};
|
|
1280
|
-
diff_match_patch.prototype.patch_splitMax = function(patches) {
|
|
1281
|
-
var patch_size = this.Match_MaxBits;
|
|
1282
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1283
|
-
if (patches[x].length1 <= patch_size) {
|
|
1284
|
-
continue;
|
|
1285
|
-
}
|
|
1286
|
-
var bigpatch = patches[x];
|
|
1287
|
-
patches.splice(x--, 1);
|
|
1288
|
-
var start1 = bigpatch.start1;
|
|
1289
|
-
var start2 = bigpatch.start2;
|
|
1290
|
-
var precontext = "";
|
|
1291
|
-
while (bigpatch.diffs.length !== 0) {
|
|
1292
|
-
var patch = new diff_match_patch.patch_obj();
|
|
1293
|
-
var empty = true;
|
|
1294
|
-
patch.start1 = start1 - precontext.length;
|
|
1295
|
-
patch.start2 = start2 - precontext.length;
|
|
1296
|
-
if (precontext !== "") {
|
|
1297
|
-
patch.length1 = patch.length2 = precontext.length;
|
|
1298
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, precontext));
|
|
1299
|
-
}
|
|
1300
|
-
while (bigpatch.diffs.length !== 0 && patch.length1 < patch_size - this.Patch_Margin) {
|
|
1301
|
-
var diff_type = bigpatch.diffs[0][0];
|
|
1302
|
-
var diff_text = bigpatch.diffs[0][1];
|
|
1303
|
-
if (diff_type === DIFF_INSERT) {
|
|
1304
|
-
patch.length2 += diff_text.length;
|
|
1305
|
-
start2 += diff_text.length;
|
|
1306
|
-
patch.diffs.push(bigpatch.diffs.shift());
|
|
1307
|
-
empty = false;
|
|
1308
|
-
} else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 && patch.diffs[0][0] == DIFF_EQUAL && diff_text.length > 2 * patch_size) {
|
|
1309
|
-
patch.length1 += diff_text.length;
|
|
1310
|
-
start1 += diff_text.length;
|
|
1311
|
-
empty = false;
|
|
1312
|
-
patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));
|
|
1313
|
-
bigpatch.diffs.shift();
|
|
1314
|
-
} else {
|
|
1315
|
-
diff_text = diff_text.substring(
|
|
1316
|
-
0,
|
|
1317
|
-
patch_size - patch.length1 - this.Patch_Margin
|
|
1318
|
-
);
|
|
1319
|
-
patch.length1 += diff_text.length;
|
|
1320
|
-
start1 += diff_text.length;
|
|
1321
|
-
if (diff_type === DIFF_EQUAL) {
|
|
1322
|
-
patch.length2 += diff_text.length;
|
|
1323
|
-
start2 += diff_text.length;
|
|
1324
|
-
} else {
|
|
1325
|
-
empty = false;
|
|
1326
|
-
}
|
|
1327
|
-
patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));
|
|
1328
|
-
if (diff_text == bigpatch.diffs[0][1]) {
|
|
1329
|
-
bigpatch.diffs.shift();
|
|
1330
|
-
} else {
|
|
1331
|
-
bigpatch.diffs[0][1] = bigpatch.diffs[0][1].substring(diff_text.length);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
precontext = this.diff_text2(patch.diffs);
|
|
1336
|
-
precontext = precontext.substring(precontext.length - this.Patch_Margin);
|
|
1337
|
-
var postcontext = this.diff_text1(bigpatch.diffs).substring(0, this.Patch_Margin);
|
|
1338
|
-
if (postcontext !== "") {
|
|
1339
|
-
patch.length1 += postcontext.length;
|
|
1340
|
-
patch.length2 += postcontext.length;
|
|
1341
|
-
if (patch.diffs.length !== 0 && patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
|
|
1342
|
-
patch.diffs[patch.diffs.length - 1][1] += postcontext;
|
|
1343
|
-
} else {
|
|
1344
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, postcontext));
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
if (!empty) {
|
|
1348
|
-
patches.splice(++x, 0, patch);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
};
|
|
1353
|
-
diff_match_patch.prototype.patch_toText = function(patches) {
|
|
1354
|
-
var text = [];
|
|
1355
|
-
for (var x = 0; x < patches.length; x++) {
|
|
1356
|
-
text[x] = patches[x];
|
|
1357
|
-
}
|
|
1358
|
-
return text.join("");
|
|
1359
|
-
};
|
|
1360
|
-
diff_match_patch.prototype.patch_fromText = function(textline) {
|
|
1361
|
-
var patches = [];
|
|
1362
|
-
if (!textline) {
|
|
1363
|
-
return patches;
|
|
1364
|
-
}
|
|
1365
|
-
var text = textline.split("\n");
|
|
1366
|
-
var textPointer = 0;
|
|
1367
|
-
var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
|
|
1368
|
-
while (textPointer < text.length) {
|
|
1369
|
-
var m = text[textPointer].match(patchHeader);
|
|
1370
|
-
if (!m) {
|
|
1371
|
-
throw new Error("Invalid patch string: " + text[textPointer]);
|
|
1372
|
-
}
|
|
1373
|
-
var patch = new diff_match_patch.patch_obj();
|
|
1374
|
-
patches.push(patch);
|
|
1375
|
-
patch.start1 = parseInt(m[1], 10);
|
|
1376
|
-
if (m[2] === "") {
|
|
1377
|
-
patch.start1--;
|
|
1378
|
-
patch.length1 = 1;
|
|
1379
|
-
} else if (m[2] == "0") {
|
|
1380
|
-
patch.length1 = 0;
|
|
1381
|
-
} else {
|
|
1382
|
-
patch.start1--;
|
|
1383
|
-
patch.length1 = parseInt(m[2], 10);
|
|
1384
|
-
}
|
|
1385
|
-
patch.start2 = parseInt(m[3], 10);
|
|
1386
|
-
if (m[4] === "") {
|
|
1387
|
-
patch.start2--;
|
|
1388
|
-
patch.length2 = 1;
|
|
1389
|
-
} else if (m[4] == "0") {
|
|
1390
|
-
patch.length2 = 0;
|
|
1391
|
-
} else {
|
|
1392
|
-
patch.start2--;
|
|
1393
|
-
patch.length2 = parseInt(m[4], 10);
|
|
1394
|
-
}
|
|
1395
|
-
textPointer++;
|
|
1396
|
-
while (textPointer < text.length) {
|
|
1397
|
-
var sign = text[textPointer].charAt(0);
|
|
1398
|
-
try {
|
|
1399
|
-
var line = decodeURI(text[textPointer].substring(1));
|
|
1400
|
-
} catch (ex) {
|
|
1401
|
-
throw new Error("Illegal escape in patch_fromText: " + line);
|
|
1402
|
-
}
|
|
1403
|
-
if (sign == "-") {
|
|
1404
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_DELETE, line));
|
|
1405
|
-
} else if (sign == "+") {
|
|
1406
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_INSERT, line));
|
|
1407
|
-
} else if (sign == " ") {
|
|
1408
|
-
patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, line));
|
|
1409
|
-
} else if (sign == "@") {
|
|
1410
|
-
break;
|
|
1411
|
-
} else if (sign === "") {
|
|
1412
|
-
} else {
|
|
1413
|
-
throw new Error('Invalid patch mode "' + sign + '" in: ' + line);
|
|
1414
|
-
}
|
|
1415
|
-
textPointer++;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
return patches;
|
|
1419
|
-
};
|
|
1420
|
-
diff_match_patch.patch_obj = function() {
|
|
1421
|
-
this.diffs = [];
|
|
1422
|
-
this.start1 = null;
|
|
1423
|
-
this.start2 = null;
|
|
1424
|
-
this.length1 = 0;
|
|
1425
|
-
this.length2 = 0;
|
|
1426
|
-
};
|
|
1427
|
-
diff_match_patch.patch_obj.prototype.toString = function() {
|
|
1428
|
-
var coords1, coords2;
|
|
1429
|
-
if (this.length1 === 0) {
|
|
1430
|
-
coords1 = this.start1 + ",0";
|
|
1431
|
-
} else if (this.length1 == 1) {
|
|
1432
|
-
coords1 = this.start1 + 1;
|
|
1433
|
-
} else {
|
|
1434
|
-
coords1 = this.start1 + 1 + "," + this.length1;
|
|
1435
|
-
}
|
|
1436
|
-
if (this.length2 === 0) {
|
|
1437
|
-
coords2 = this.start2 + ",0";
|
|
1438
|
-
} else if (this.length2 == 1) {
|
|
1439
|
-
coords2 = this.start2 + 1;
|
|
1440
|
-
} else {
|
|
1441
|
-
coords2 = this.start2 + 1 + "," + this.length2;
|
|
1442
|
-
}
|
|
1443
|
-
var text = ["@@ -" + coords1 + " +" + coords2 + " @@\n"];
|
|
1444
|
-
var op;
|
|
1445
|
-
for (var x = 0; x < this.diffs.length; x++) {
|
|
1446
|
-
switch (this.diffs[x][0]) {
|
|
1447
|
-
case DIFF_INSERT:
|
|
1448
|
-
op = "+";
|
|
1449
|
-
break;
|
|
1450
|
-
case DIFF_DELETE:
|
|
1451
|
-
op = "-";
|
|
1452
|
-
break;
|
|
1453
|
-
case DIFF_EQUAL:
|
|
1454
|
-
op = " ";
|
|
1455
|
-
break;
|
|
1456
|
-
}
|
|
1457
|
-
text[x + 1] = op + encodeURI(this.diffs[x][1]) + "\n";
|
|
1458
|
-
}
|
|
1459
|
-
return text.join("").replace(/%20/g, " ");
|
|
1460
|
-
};
|
|
1461
|
-
module.exports = diff_match_patch;
|
|
1462
|
-
module.exports["diff_match_patch"] = diff_match_patch;
|
|
1463
|
-
module.exports["DIFF_DELETE"] = DIFF_DELETE;
|
|
1464
|
-
module.exports["DIFF_INSERT"] = DIFF_INSERT;
|
|
1465
|
-
module.exports["DIFF_EQUAL"] = DIFF_EQUAL;
|
|
1466
|
-
}
|
|
1467
|
-
});
|
|
1468
|
-
|
|
1469
|
-
// src/dashboard/view/diff/ScalarDiff.tsx
|
|
1470
|
-
var import_diff_match_patch = __toESM(require_diff_match_patch(), 1);
|
|
1471
|
-
import { useMemo } from "react";
|
|
1472
|
-
|
|
1473
|
-
// src/dashboard/view/diff/ScalarDiff.module.scss
|
|
1474
|
-
var ScalarDiff_module_default = {
|
|
1475
|
-
"root": "alinea-ScalarDiff",
|
|
1476
|
-
"root-segment": "alinea-ScalarDiff-segment",
|
|
1477
|
-
"rootSegment": "alinea-ScalarDiff-segment",
|
|
1478
|
-
"is-insert": "alinea-ScalarDiff-is-insert",
|
|
1479
|
-
"isInsert": "alinea-ScalarDiff-is-insert",
|
|
1480
|
-
"is-delete": "alinea-ScalarDiff-is-delete",
|
|
1481
|
-
"isDelete": "alinea-ScalarDiff-is-delete"
|
|
1482
|
-
};
|
|
1483
|
-
|
|
1484
|
-
// src/dashboard/view/diff/ScalarDiff.tsx
|
|
1485
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1486
|
-
var styles = dist_default(ScalarDiff_module_default);
|
|
1487
|
-
var matcher = new import_diff_match_patch.default.diff_match_patch();
|
|
1488
|
-
function toScalar(value) {
|
|
1489
|
-
if (typeof value === "number") return String(value);
|
|
1490
|
-
return value ? String(value) : "";
|
|
1491
|
-
}
|
|
1492
|
-
function ScalarDiff({ valueA, valueB }) {
|
|
1493
|
-
const a = toScalar(valueA);
|
|
1494
|
-
const b = toScalar(valueB);
|
|
1495
|
-
const diffs = useMemo(() => {
|
|
1496
|
-
const res = matcher.diff_main(a, b);
|
|
1497
|
-
matcher.diff_cleanupSemantic(res);
|
|
1498
|
-
return res;
|
|
1499
|
-
}, [a, b]);
|
|
1500
|
-
return /* @__PURE__ */ jsxs("div", { className: styles.root(), children: [
|
|
1501
|
-
diffs.length === 0 && /* @__PURE__ */ jsx("br", {}),
|
|
1502
|
-
diffs.map(([op, text], i) => {
|
|
1503
|
-
return /* @__PURE__ */ jsx(
|
|
1504
|
-
"span",
|
|
1505
|
-
{
|
|
1506
|
-
className: styles.root.segment({
|
|
1507
|
-
insert: op === 1,
|
|
1508
|
-
delete: op === -1,
|
|
1509
|
-
equal: op === 0
|
|
1510
|
-
}),
|
|
1511
|
-
children: text
|
|
1512
|
-
},
|
|
1513
|
-
i
|
|
1514
|
-
);
|
|
1515
|
-
})
|
|
1516
|
-
] });
|
|
1517
|
-
}
|
|
1518
|
-
export {
|
|
1519
|
-
ScalarDiff
|
|
1520
|
-
};
|