@scalar/api-client 2.36.0 → 2.36.2
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/CHANGELOG.md +65 -0
- package/dist/monacoeditorwork/editor.worker.bundle.js +14463 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +22211 -0
- package/dist/monacoeditorwork/yaml.worker.bundle.js +46771 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -27
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +12 -11
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +47 -42
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +65 -59
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +57 -42
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +44 -41
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/components/resize/index.d.ts +1 -0
- package/dist/v2/components/resize/index.d.ts.map +1 -1
- package/dist/v2/components/resize/index.js +4 -2
- package/dist/v2/components/resize/use-split-resize.d.ts +27 -0
- package/dist/v2/components/resize/use-split-resize.d.ts.map +1 -0
- package/dist/v2/components/resize/use-split-resize.js +57 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +38 -34
- package/dist/v2/features/app/App.vue.d.ts +5 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +71 -63
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +34 -30
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +7 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +15 -10
- package/dist/v2/features/app/helpers/routes.d.ts +6 -0
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +3 -2
- package/dist/v2/features/app/hooks/use-document-watcher.js +13 -13
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +292 -100
- package/dist/v2/features/collection/DocumentCollection.vue3.js +5 -0
- package/dist/v2/features/collection/OperationCollection.vue.js +20 -19
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +6 -5
- package/dist/v2/features/collection/components/Authentication.vue2.js +16 -15
- package/dist/v2/features/collection/components/Cookies.vue.js +7 -6
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Editor/Editor.vue.js +3 -3
- package/dist/v2/features/collection/components/Editor/Editor.vue2.js +182 -171
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts +2 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +13 -12
- package/dist/v2/features/collection/components/Overview.vue2.js +7 -6
- package/dist/v2/features/collection/components/Servers.vue.js +64 -63
- package/dist/v2/features/collection/components/Settings.vue.js +8 -7
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.d.ts +18 -0
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.d.ts.map +1 -0
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.js +7 -0
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue2.js +136 -0
- package/dist/v2/features/editor/config.d.ts +16 -0
- package/dist/v2/features/editor/config.d.ts.map +1 -0
- package/dist/v2/features/editor/config.js +16 -0
- package/dist/v2/features/editor/helpers/configure-language-support.d.ts +13 -0
- package/dist/v2/features/editor/helpers/configure-language-support.d.ts.map +1 -0
- package/dist/v2/features/{collection/components/Editor → editor}/helpers/configure-language-support.js +6 -7
- package/dist/v2/features/editor/helpers/ensure-monaco-environment.d.ts.map +1 -0
- package/dist/v2/features/{collection/components/Editor → editor}/helpers/ensure-monaco-environment.js +9 -12
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts +12 -0
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/json/create-json-model.js +19 -0
- package/dist/v2/features/editor/helpers/json/get-json-ast-node-from-path.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/json/json-ast.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/json/json-pointer-links.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/json/json-pointer-path.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/json/json-pointer-path.js +21 -0
- package/dist/v2/features/editor/helpers/model.d.ts +9 -0
- package/dist/v2/features/editor/helpers/model.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/range-to-whole-line.d.ts +14 -0
- package/dist/v2/features/editor/helpers/range-to-whole-line.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/range-to-whole-line.js +8 -0
- package/dist/v2/features/editor/helpers/theme/apply-scalar-theme.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/theme/load-css-variables.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts +13 -0
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts.map +1 -0
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.js +19 -0
- package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/yaml}/get-yaml-node-range-from-path.d.ts +2 -2
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts.map +1 -0
- package/dist/v2/features/editor/hooks/use-editor-markers.d.ts.map +1 -0
- package/dist/v2/features/editor/hooks/use-editor.d.ts +39 -0
- package/dist/v2/features/editor/hooks/use-editor.d.ts.map +1 -0
- package/dist/v2/features/editor/hooks/use-editor.js +107 -0
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts +16 -0
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts.map +1 -0
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.js +27 -0
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts +77 -0
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts.map +1 -0
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +316 -0
- package/dist/v2/features/editor/index.d.ts +5 -0
- package/dist/v2/features/editor/index.d.ts.map +1 -0
- package/dist/v2/features/editor/index.js +10 -0
- package/dist/v2/features/operation/Operation.vue.js +18 -17
- package/dist/v2/types/configuration.d.ts +11 -0
- package/dist/v2/types/configuration.d.ts.map +1 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +44 -45
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +24 -18
- package/dist/assets/yaml.worker-CcQnAKCg.js +0 -490
- package/dist/v2/features/collection/DocumentCollection.vue2.js +0 -4
- package/dist/v2/features/collection/components/Editor/helpers/apply-scalar-theme.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts +0 -7
- package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-json-ast-node-from-path.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/json-ast.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/json-pointer-links.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/json-pointer-path.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/json-pointer-path.js +0 -20
- package/dist/v2/features/collection/components/Editor/helpers/load-css-variables.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.d.ts +0 -2
- package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/helpers/yaml.worker.js +0 -11
- package/dist/v2/features/collection/components/Editor/hooks/use-editor-markers.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor.d.ts +0 -39
- package/dist/v2/features/collection/components/Editor/hooks/use-editor.d.ts.map +0 -1
- package/dist/v2/features/collection/components/Editor/hooks/use-editor.js +0 -153
- /package/dist/v2/features/{collection/components/Editor → editor}/helpers/ensure-monaco-environment.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/get-json-ast-node-from-path.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/get-json-ast-node-from-path.js +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-ast.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-ast.js +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-pointer-links.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-pointer-links.js +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-pointer-path.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/theme}/apply-scalar-theme.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/theme}/apply-scalar-theme.js +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/theme}/load-css-variables.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/theme}/load-css-variables.js +0 -0
- /package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/yaml}/get-yaml-node-range-from-path.js +0 -0
- /package/dist/v2/features/{collection/components/Editor → editor}/hooks/use-editor-markers.d.ts +0 -0
- /package/dist/v2/features/{collection/components/Editor → editor}/hooks/use-editor-markers.js +0 -0
- /package/dist/v2/features/{collection/components/Editor → editor}/schemas/openapi-3.1-schema.json.js +0 -0
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import o from "monaco-editor/esm/vs/editor/editor.worker.js?worker";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
getWorker(
|
|
7
|
-
switch (
|
|
2
|
+
import e from "monaco-editor/esm/vs/language/json/json.worker.js?worker";
|
|
3
|
+
import n from "monaco-yaml/yaml.worker.js?worker";
|
|
4
|
+
const s = () => {
|
|
5
|
+
globalThis.MonacoEnvironment ??= {
|
|
6
|
+
getWorker(t, r) {
|
|
7
|
+
switch (r) {
|
|
8
8
|
case "json":
|
|
9
|
-
return new
|
|
9
|
+
return new e();
|
|
10
10
|
case "yaml":
|
|
11
|
-
return new
|
|
11
|
+
return new n();
|
|
12
12
|
default:
|
|
13
13
|
return new o();
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
globalThis.MonacoEnvironment ??= {
|
|
18
|
-
getWorker: r.getWorker
|
|
19
|
-
};
|
|
20
17
|
};
|
|
21
18
|
export {
|
|
22
|
-
|
|
19
|
+
s as ensureMonacoEnvironment
|
|
23
20
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EditorModel } from '../../../../../v2/features/editor/helpers/model';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JSON Monaco editor model with enhanced language support.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The initial JSON content for the model.
|
|
6
|
+
* @returns An object containing the Monaco model and a function to get a range from a JSON path.
|
|
7
|
+
*
|
|
8
|
+
* The returned `getRangeFromPath` function asynchronously finds the AST node for a JSON path,
|
|
9
|
+
* converts its offset and length to a Monaco Range, or returns null if not found.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createJsonModel: (value?: string) => EditorModel;
|
|
12
|
+
//# sourceMappingURL=create-json-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-json-model.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/json/create-json-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,oCAAoC,CAAA;AAI3E;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,WAqBhD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as r from "monaco-editor";
|
|
2
|
+
import { getJsonAstNodeFromPath as m } from "./get-json-ast-node-from-path.js";
|
|
3
|
+
import { configureJson as a } from "../configure-language-support.js";
|
|
4
|
+
const u = (s) => {
|
|
5
|
+
const o = r.editor.createModel(s ?? "", "json");
|
|
6
|
+
return a(o.uri.toString()), {
|
|
7
|
+
model: o,
|
|
8
|
+
getRangeFromPath: async (i) => {
|
|
9
|
+
const t = await m(o, i);
|
|
10
|
+
if (!t)
|
|
11
|
+
return null;
|
|
12
|
+
const e = o.getPositionAt(t.offset), n = o.getPositionAt(t.offset + t.length);
|
|
13
|
+
return new r.Range(e.lineNumber, e.column, n.lineNumber, n.column);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
u as createJsonModel
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-json-ast-node-from-path.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/json/get-json-ast-node-from-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAC/B,MAAM,QAAQ,KACb,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAW9C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-ast.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/json/json-ast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,EAC/C,MAAM,QAAQ,KACb,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,GAAG,SAkClC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-pointer-links.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/json/json-pointer-links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAmEvC;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GAAI,UAAU,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;;;CA2E/F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-pointer-path.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/json/json-pointer-path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA0B1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,QAAQ,GAAG,IAOjE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { parseJsonPointerSegments as i } from "@scalar/helpers/json/parse-json-pointer-segments";
|
|
2
|
+
const o = (r) => {
|
|
3
|
+
const t = r.trim();
|
|
4
|
+
if (t.startsWith("/"))
|
|
5
|
+
return t;
|
|
6
|
+
if (t.startsWith("#")) {
|
|
7
|
+
const s = t.slice(1);
|
|
8
|
+
return s.startsWith("/") ? s : null;
|
|
9
|
+
}
|
|
10
|
+
const n = t.indexOf("#");
|
|
11
|
+
if (n === -1)
|
|
12
|
+
return null;
|
|
13
|
+
const e = t.slice(n + 1);
|
|
14
|
+
return e.startsWith("/") ? e : null;
|
|
15
|
+
}, c = (r) => {
|
|
16
|
+
const t = o(r);
|
|
17
|
+
return t ? i(t) : null;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
c as parseJsonPointerPath
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as monaco from 'monaco-editor';
|
|
2
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
3
|
+
export type Path = readonly (string | number)[];
|
|
4
|
+
export type EditorModel = {
|
|
5
|
+
model: monaco.editor.ITextModel;
|
|
6
|
+
getRangeFromPath: (path: Path) => MaybePromise<monaco.Range | null>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/helpers/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAErC,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAA;IAC/B,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;CACpE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Expands a given range to cover whole lines within a Monaco editor model.
|
|
4
|
+
*
|
|
5
|
+
* Given a text model and an input range, this function calculates the smallest
|
|
6
|
+
* and largest lines touched by the range and returns a new range that starts at
|
|
7
|
+
* the beginning of the first touched line and ends at the end of the last touched line.
|
|
8
|
+
*
|
|
9
|
+
* @param model The Monaco editor text model.
|
|
10
|
+
* @param range The Monaco Range to expand.
|
|
11
|
+
* @returns A new Monaco Range covering the whole lines spanned by the given range.
|
|
12
|
+
*/
|
|
13
|
+
export declare const rangeToWholeLine: (model: monaco.editor.ITextModel, range: monaco.Range) => monaco.Range;
|
|
14
|
+
//# sourceMappingURL=range-to-whole-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-to-whole-line.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/helpers/range-to-whole-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,MAAM,CAAC,KAAK,KAAG,MAAM,CAAC,KAS9F,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as c from "monaco-editor";
|
|
2
|
+
const g = (t, n) => {
|
|
3
|
+
const e = t.getOffsetAt(n.getStartPosition()), i = t.getOffsetAt(n.getEndPosition()), a = t.getPositionAt(e), f = Math.max(e, i - 1), r = t.getPositionAt(f), s = Math.max(1, a.lineNumber), o = Math.max(s, r.lineNumber);
|
|
4
|
+
return new c.Range(s, 1, o, t.getLineMaxColumn(o));
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
g as rangeToWholeLine
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-scalar-theme.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/theme/apply-scalar-theme.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAU,OAAO,MAAM,EAAE,YAAY,OAAO,kBAwExE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-css-variables.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/theme/load-css-variables.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM;WAIU,GAAG;UAAQ,GAAG;EA2CzE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditorModel } from '../../../../../v2/features/editor/helpers/model';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a YAML model for use in the Monaco editor.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The initial YAML string value for the model.
|
|
6
|
+
* @returns An object containing the Monaco model and a method to get a range from a YAML path.
|
|
7
|
+
*
|
|
8
|
+
* The created model is configured for YAML language support.
|
|
9
|
+
* The `getRangeFromPath` method returns a Monaco Range object indicating the text range
|
|
10
|
+
* that corresponds to a given path in the YAML document, or null if the path is not found.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createYamlModel: (value?: string) => EditorModel;
|
|
13
|
+
//# sourceMappingURL=create-yaml-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-yaml-model.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/yaml/create-yaml-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,oCAAoC,CAAA;AAG3E;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,WAoBhD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as n from "monaco-editor";
|
|
2
|
+
import { configureYaml as m } from "../configure-language-support.js";
|
|
3
|
+
import { getYamlNodeRangeFromPath as l } from "./get-yaml-node-range-from-path.js";
|
|
4
|
+
const c = (i) => {
|
|
5
|
+
const e = n.editor.createModel("", "yaml");
|
|
6
|
+
return m(e.uri.toString()), {
|
|
7
|
+
model: e,
|
|
8
|
+
getRangeFromPath: (a) => {
|
|
9
|
+
const t = l(e.getValue(), a);
|
|
10
|
+
if (!t)
|
|
11
|
+
return null;
|
|
12
|
+
const o = e.getPositionAt(t.startOffset), r = e.getPositionAt(t.endOffset);
|
|
13
|
+
return new n.Range(o.lineNumber, o.column, r.lineNumber, r.column);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
c as createYamlModel
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Path } from '../../../../../v2/features/editor/helpers/model';
|
|
2
2
|
type YamlNodeRange = {
|
|
3
3
|
startOffset: number;
|
|
4
4
|
endOffset: number;
|
|
@@ -14,6 +14,6 @@ type YamlNodeRange = {
|
|
|
14
14
|
* @param path An array representing the path to traverse
|
|
15
15
|
* @returns The byte offsets in the YAML string of the node (or null if not found)
|
|
16
16
|
*/
|
|
17
|
-
export declare const getYamlNodeRangeFromPath: (yamlText: string, path:
|
|
17
|
+
export declare const getYamlNodeRangeFromPath: (yamlText: string, path: Path) => YamlNodeRange | null;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=get-yaml-node-range-from-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-yaml-node-range-from-path.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAE9D,KAAK,aAAa,GAAG;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAaD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,MAAM,IAAI,KAAG,aAAa,GAAG,IA0EvF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-editor-markers.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/hooks/use-editor-markers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,2CAA2C,CAAA;AACnE,OAAO,EAAE,KAAK,gBAAgB,EAAmD,MAAM,KAAK,CAAA;AAE5F,eAAO,MAAM,gBAAgB,GAAI,WAAW,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;;;;;;;;;;;sBAkD0iJ,CAAC;yBAA2B,CAAC;oBAA6B,CAAC;qBAA8B,CAAC;wBAAiC,CAAC;;;;;;;;;;;;;;;;0BAA5H,CAAC;6BAA2B,CAAC;wBAA6B,CAAC;yBAA8B,CAAC;4BAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;0BAA5H,CAAC;6BAA2B,CAAC;wBAA6B,CAAC;yBAA8B,CAAC;4BAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;;sBAA5H,CAAC;yBAA2B,CAAC;oBAA6B,CAAC;qBAA8B,CAAC;wBAAiC,CAAC;;;;;;;;;;;;;;;;0BAA5H,CAAC;6BAA2B,CAAC;wBAA6B,CAAC;yBAA8B,CAAC;4BAAiC,CAAC;;;;;;;;;;;;;;;;;;;;;;0BAA5H,CAAC;6BAA2B,CAAC;wBAA6B,CAAC;yBAA8B,CAAC;4BAAiC,CAAC;;;;;;;;;;;;;;CADlxJ,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import type { EditorModel, Path } from '../../../../v2/features/editor/helpers/model';
|
|
4
|
+
type MonacoEditorAction = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
keybindings?: number[];
|
|
8
|
+
run: () => void | Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates and manages a Monaco editor instance.
|
|
12
|
+
*
|
|
13
|
+
* @param element - The HTML element to mount the editor into.
|
|
14
|
+
* @param onChange - A callback function to handle changes to the editor's value.
|
|
15
|
+
* @param actions - An array of actions to add to the editor.
|
|
16
|
+
* @param readOnly - Whether the editor should be read-only.
|
|
17
|
+
* @param model - The editor model to use.
|
|
18
|
+
* @returns An object containing the editor instance, model, and utility functions.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useEditor: ({ element, onChange, actions, readOnly, model, }: {
|
|
21
|
+
element: HTMLElement;
|
|
22
|
+
readOnly?: MaybeRefOrGetter<boolean>;
|
|
23
|
+
onChange?: (e: string) => void;
|
|
24
|
+
actions?: MonacoEditorAction[];
|
|
25
|
+
/** Editor model provided from outside; must implement EditorModel (model + getRangeFromPath). */
|
|
26
|
+
model: MaybeRefOrGetter<EditorModel>;
|
|
27
|
+
}) => {
|
|
28
|
+
editor: monaco.editor.IStandaloneCodeEditor;
|
|
29
|
+
model: MaybeRefOrGetter<EditorModel>;
|
|
30
|
+
highlightPath: (path: Path) => Promise<void>;
|
|
31
|
+
focusPath: (path: Path) => Promise<void>;
|
|
32
|
+
formatDocument: () => Promise<void>;
|
|
33
|
+
getValue: () => string;
|
|
34
|
+
setValue: (nextValue: string, isProgrammaticUpdate?: boolean) => void;
|
|
35
|
+
hasTextFocus: () => boolean;
|
|
36
|
+
dispose: () => void;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=use-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/hooks/use-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,KAAK,CAAA;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAI3E,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,GAAG,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,kDAMvB;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC9B,iGAAiG;IACjG,KAAK,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;CACrC;;;0BAyDoC,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;sBAoBxB,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;0BAgDlB,OAAO,CAAC,IAAI,CAAC;oBAIzB,MAAM;0BAEE,MAAM,qCAAiC,IAAI;wBAQ/C,OAAO;mBAEZ,IAAI;CAezB,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as m from "monaco-editor";
|
|
2
|
+
import { toValue as a, watch as g } from "vue";
|
|
3
|
+
const L = "json-focus-highlight", S = ({
|
|
4
|
+
element: f,
|
|
5
|
+
onChange: h,
|
|
6
|
+
actions: p,
|
|
7
|
+
readOnly: l = !1,
|
|
8
|
+
model: s
|
|
9
|
+
}) => {
|
|
10
|
+
const n = () => a(s), t = m.editor.create(f, {
|
|
11
|
+
model: n().model,
|
|
12
|
+
automaticLayout: !0,
|
|
13
|
+
folding: !0,
|
|
14
|
+
showFoldingControls: "always",
|
|
15
|
+
glyphMargin: !0,
|
|
16
|
+
lineNumbers: "on",
|
|
17
|
+
minimap: { enabled: !1 },
|
|
18
|
+
overviewRulerLanes: 0,
|
|
19
|
+
readOnly: a(l),
|
|
20
|
+
scrollbar: {
|
|
21
|
+
useShadows: !1,
|
|
22
|
+
verticalScrollbarSize: 5
|
|
23
|
+
},
|
|
24
|
+
scrollBeyondLastLine: !1,
|
|
25
|
+
guides: {
|
|
26
|
+
indentation: !0
|
|
27
|
+
},
|
|
28
|
+
formatOnPaste: !0,
|
|
29
|
+
renderValidationDecorations: "on",
|
|
30
|
+
formatOnType: !0,
|
|
31
|
+
lineHeight: 20,
|
|
32
|
+
renderLineHighlight: "none",
|
|
33
|
+
fontFamily: "'JetBrains Mono', monospace"
|
|
34
|
+
});
|
|
35
|
+
t.updateOptions({ insertSpaces: !0, tabSize: 2 }), g(s, (e) => {
|
|
36
|
+
t.setModel(a(e).model);
|
|
37
|
+
});
|
|
38
|
+
let u = [], i = 0;
|
|
39
|
+
p?.forEach((e) => {
|
|
40
|
+
t.addAction({
|
|
41
|
+
id: e.id,
|
|
42
|
+
label: e.label,
|
|
43
|
+
keybindings: e.keybindings,
|
|
44
|
+
run: async () => {
|
|
45
|
+
await e.run();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
const r = async (e) => {
|
|
50
|
+
await t.getAction(e)?.run();
|
|
51
|
+
}, c = async (e) => {
|
|
52
|
+
const o = await Promise.resolve(n().getRangeFromPath(e));
|
|
53
|
+
o && (u = t.deltaDecorations(u, [
|
|
54
|
+
{
|
|
55
|
+
range: o,
|
|
56
|
+
options: {
|
|
57
|
+
className: L
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]));
|
|
61
|
+
}, y = async (e) => {
|
|
62
|
+
const o = await Promise.resolve(n().getRangeFromPath(e));
|
|
63
|
+
if (!o)
|
|
64
|
+
return;
|
|
65
|
+
const w = n().model, b = new m.Range(
|
|
66
|
+
o.startLineNumber,
|
|
67
|
+
1,
|
|
68
|
+
o.endLineNumber,
|
|
69
|
+
w.getLineMaxColumn(o.endLineNumber)
|
|
70
|
+
);
|
|
71
|
+
await r("editor.foldAll"), t.setSelection(b), await r("editor.unfoldRecursively");
|
|
72
|
+
const d = { lineNumber: o.startLineNumber, column: o.startColumn };
|
|
73
|
+
t.setPosition(d), t.revealPositionNearTop(d), await c(e);
|
|
74
|
+
};
|
|
75
|
+
return t.onDidChangeModelContent(() => {
|
|
76
|
+
if (i > 0) {
|
|
77
|
+
i -= 1;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const e = t.getValue();
|
|
81
|
+
typeof e == "string" && h?.(e ?? "");
|
|
82
|
+
}), g(
|
|
83
|
+
() => a(l),
|
|
84
|
+
(e) => {
|
|
85
|
+
t?.updateOptions({ readOnly: e });
|
|
86
|
+
}
|
|
87
|
+
), {
|
|
88
|
+
editor: t,
|
|
89
|
+
model: s,
|
|
90
|
+
highlightPath: c,
|
|
91
|
+
focusPath: y,
|
|
92
|
+
formatDocument: async () => {
|
|
93
|
+
await r("editor.action.formatDocument");
|
|
94
|
+
},
|
|
95
|
+
getValue: () => t.getValue(),
|
|
96
|
+
setValue: (e, o = !1) => {
|
|
97
|
+
o && (i += 1), t.setValue(e);
|
|
98
|
+
},
|
|
99
|
+
hasTextFocus: () => t.hasTextFocus(),
|
|
100
|
+
dispose: () => {
|
|
101
|
+
t.dispose();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
S as useEditor
|
|
107
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { EditorModel } from '../../../../v2/features/editor/helpers/model';
|
|
3
|
+
type EditorNavigationApi = {
|
|
4
|
+
focusPath: (path: string[]) => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Enables clickable JSON Pointer links when the editor model is JSON.
|
|
8
|
+
* Relates link support to the current model and uses the provided editor API to navigate.
|
|
9
|
+
*
|
|
10
|
+
* Call this hook with the return value of useEditor (or a ref to it) and the same model
|
|
11
|
+
* passed to useEditor. When the model's language is JSON, links like "#/paths/..." in
|
|
12
|
+
* string values become clickable and trigger focusPath on the editor.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useJsonPointerLinkSupport: (editorApi: MaybeRefOrGetter<EditorNavigationApi | undefined>, model: MaybeRefOrGetter<EditorModel | undefined>) => void;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=use-json-pointer-link-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-json-pointer-link-support.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/hooks/use-json-pointer-link-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAkC,MAAM,KAAK,CAAA;AAI3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAIrE,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,WAAW,gBAAgB,CAAC,mBAAmB,GAAG,SAAS,CAAC,EAC5D,OAAO,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAC,KAC/C,IA+CF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { watch as p, toValue as n, onScopeDispose as c } from "vue";
|
|
2
|
+
import { ensureJsonPointerLinkSupport as l } from "../helpers/json/json-pointer-links.js";
|
|
3
|
+
import { parseJsonPointerPath as f } from "../helpers/json/json-pointer-path.js";
|
|
4
|
+
const g = "json", I = (o, e) => {
|
|
5
|
+
let t = null;
|
|
6
|
+
const i = () => {
|
|
7
|
+
const s = n(o), r = n(e);
|
|
8
|
+
if (t && (t(), t = null), !s?.focusPath || !r || r.model.getLanguageId() !== g)
|
|
9
|
+
return;
|
|
10
|
+
t = l(async (u) => {
|
|
11
|
+
const a = f(u);
|
|
12
|
+
a && await s.focusPath(a.map(String));
|
|
13
|
+
}).dispose;
|
|
14
|
+
};
|
|
15
|
+
p(
|
|
16
|
+
() => [n(o), n(e)],
|
|
17
|
+
() => {
|
|
18
|
+
i();
|
|
19
|
+
},
|
|
20
|
+
{ immediate: !0 }
|
|
21
|
+
), c(() => {
|
|
22
|
+
t && (t(), t = null);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
I as useJsonPointerLinkSupport
|
|
27
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type merge } from '@scalar/json-magic/diff';
|
|
2
|
+
import type { ComputedRef } from 'vue';
|
|
3
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
4
|
+
type UseThreeWayMergeEditorOptions = {
|
|
5
|
+
/** Base document (common ancestor). */
|
|
6
|
+
baseDocument: MaybeRefOrGetter<Record<string, unknown>>;
|
|
7
|
+
/** Document with resolved conflicts (current result). */
|
|
8
|
+
resolvedDocument: MaybeRefOrGetter<Record<string, unknown>>;
|
|
9
|
+
/** Merge conflicts from diff. */
|
|
10
|
+
conflicts: MaybeRefOrGetter<ReturnType<typeof merge>['conflicts']>;
|
|
11
|
+
/** Called when user applies resolved changes. */
|
|
12
|
+
onApplyChanges: (resolvedDocument: Record<string, unknown>) => void;
|
|
13
|
+
/** Optional: called with error message for conflicts left or parse errors. */
|
|
14
|
+
onError?: (message: string) => void;
|
|
15
|
+
};
|
|
16
|
+
type ThreeWayMergeEditorContainers = {
|
|
17
|
+
/** Container for the local (current) diff editor. */
|
|
18
|
+
local: HTMLElement;
|
|
19
|
+
/** Container for the remote diff editor. */
|
|
20
|
+
remote: HTMLElement;
|
|
21
|
+
/** Container for the result (editable) diff editor. */
|
|
22
|
+
result: HTMLElement;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Shared state and logic for a 3-way merge editor (base | local | remote → result).
|
|
26
|
+
* Create editors by calling init() with the three container elements (e.g. from refs in onMounted).
|
|
27
|
+
* Call dispose() in onUnmounted.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```vue
|
|
31
|
+
* <script setup lang="ts">
|
|
32
|
+
* const localRef = ref<HTMLDivElement>()
|
|
33
|
+
* const remoteRef = ref<HTMLDivElement>()
|
|
34
|
+
* const resultRef = ref<HTMLDivElement>()
|
|
35
|
+
*
|
|
36
|
+
* const mergeEditor = useThreeWayMergeEditor({
|
|
37
|
+
* baseDocument,
|
|
38
|
+
* resolvedDocument,
|
|
39
|
+
* conflicts,
|
|
40
|
+
* onApplyChanges: (doc) => emit('applyChanges', { resolvedDocument: doc }),
|
|
41
|
+
* onError: (msg) => toast(msg, 'error'),
|
|
42
|
+
* })
|
|
43
|
+
*
|
|
44
|
+
* onMounted(() => {
|
|
45
|
+
* const local = localRef.value
|
|
46
|
+
* const remote = remoteRef.value
|
|
47
|
+
* const result = resultRef.value
|
|
48
|
+
* if (local && remote && result) {
|
|
49
|
+
* mergeEditor.init({ local, remote, result })
|
|
50
|
+
* }
|
|
51
|
+
* })
|
|
52
|
+
*
|
|
53
|
+
* onUnmounted(() => {
|
|
54
|
+
* mergeEditor.dispose()
|
|
55
|
+
* })
|
|
56
|
+
* </script>
|
|
57
|
+
*
|
|
58
|
+
* <template>
|
|
59
|
+
* <div ref="localRef" />
|
|
60
|
+
* <div ref="remoteRef" />
|
|
61
|
+
* <div ref="resultRef" />
|
|
62
|
+
* <button @click="mergeEditor.goToNextConflict">Next conflict</button>
|
|
63
|
+
* <button :disabled="mergeEditor.conflictsLeft > 0" @click="mergeEditor.applyResolvedConflicts">
|
|
64
|
+
* Apply ({{ mergeEditor.conflictsLeft }} left)
|
|
65
|
+
* </button>
|
|
66
|
+
* </template>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function useThreeWayMergeEditor(options: UseThreeWayMergeEditorOptions): {
|
|
70
|
+
init: (containers: ThreeWayMergeEditorContainers) => void;
|
|
71
|
+
dispose: () => void;
|
|
72
|
+
conflictsLeft: ComputedRef<number>;
|
|
73
|
+
goToNextConflict: () => void;
|
|
74
|
+
applyResolvedConflicts: () => void;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=use-three-way-merge-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-three-way-merge-editor.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/editor/hooks/use-three-way-merge-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,KAAK,gBAAgB,EAAsD,MAAM,KAAK,CAAA;AAY/F,KAAK,6BAA6B,GAAG;IACnC,uCAAuC;IACvC,YAAY,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACvD,yDAAyD;IACzD,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAC3D,iCAAiC;IACjC,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;IAClE,iDAAiD;IACjD,cAAc,EAAE,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACnE,8EAA8E;IAC9E,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,CAAA;AAED,KAAK,6BAA6B,GAAG;IACnC,qDAAqD;IACrD,KAAK,EAAE,WAAW,CAAA;IAClB,4CAA4C;IAC5C,MAAM,EAAE,WAAW,CAAA;IACnB,uDAAuD;IACvD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG;IAC9E,IAAI,EAAE,CAAC,UAAU,EAAE,6BAA6B,KAAK,IAAI,CAAA;IACzD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,sBAAsB,EAAE,MAAM,IAAI,CAAA;CACnC,CAydA"}
|