@scalar/api-client 2.36.1 → 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 +36 -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-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/request-block/helpers/get-default-headers.js +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/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/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/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply-scalar-theme.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/apply-scalar-theme.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAU,OAAO,MAAM,EAAE,YAAY,OAAO,kBAwExE,CAAA"}
|
package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configures both JSON and YAML language support for the given model URI
|
|
3
|
-
*
|
|
4
|
-
* @param modelUri - The URI of the model to configure language support for
|
|
5
|
-
*/
|
|
6
|
-
export declare const configureLanguageSupport: (modelUri: string) => void;
|
|
7
|
-
//# sourceMappingURL=configure-language-support.d.ts.map
|
package/dist/v2/features/collection/components/Editor/helpers/configure-language-support.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure-language-support.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/configure-language-support.ts"],"names":[],"mappings":"AAyDA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,KAAG,IAG3D,CAAA"}
|
package/dist/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-monaco-environment.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/ensure-monaco-environment.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAO,IAkB1C,CAAA"}
|
package/dist/v2/features/collection/components/Editor/helpers/get-json-ast-node-from-path.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-json-ast-node-from-path.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/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"}
|
package/dist/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-yaml-node-range-from-path.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/get-yaml-node-range-from-path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,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,QAAQ,KAAG,aAAa,GAAG,IA0E3F,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-ast.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-pointer-links.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-pointer-path.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/json-pointer-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA+B1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,QAAQ,GAAG,IAOjE,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const i = (e) => e.replace(/~1/g, "/").replace(/~0/g, "~"), c = (e) => {
|
|
2
|
-
const t = e.trim();
|
|
3
|
-
if (t.startsWith("/"))
|
|
4
|
-
return t;
|
|
5
|
-
if (t.startsWith("#")) {
|
|
6
|
-
const s = t.slice(1);
|
|
7
|
-
return s.startsWith("/") ? s : null;
|
|
8
|
-
}
|
|
9
|
-
const r = t.indexOf("#");
|
|
10
|
-
if (r === -1)
|
|
11
|
-
return null;
|
|
12
|
-
const n = t.slice(r + 1);
|
|
13
|
-
return n.startsWith("/") ? n : null;
|
|
14
|
-
}, o = (e) => {
|
|
15
|
-
const t = c(e);
|
|
16
|
-
return t ? t.split("/").slice(1).map(i) : null;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
o as parseJsonPointerPath
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-css-variables.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/load-css-variables.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM;WAIU,GAAG;UAAQ,GAAG;EA2CzE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.worker.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/helpers/yaml.worker.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-editor-markers.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/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"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as monaco from 'monaco-editor';
|
|
2
|
-
import 'monaco-editor/esm/vs/language/json/monaco.contribution';
|
|
3
|
-
import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution';
|
|
4
|
-
import 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding';
|
|
5
|
-
import 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.css';
|
|
6
|
-
import 'monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css';
|
|
7
|
-
import { type MaybeRefOrGetter } from 'vue';
|
|
8
|
-
import type { JsonPath } from '../../../../../../v2/features/collection/components/Editor/helpers/json-ast.js';
|
|
9
|
-
type MonacoEditorAction = {
|
|
10
|
-
id: string;
|
|
11
|
-
label: string;
|
|
12
|
-
keybindings?: number[];
|
|
13
|
-
run: () => void | Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
export type MonacoEditorLanguage = 'json' | 'yaml';
|
|
16
|
-
export declare const useEditor: ({ element, value, onChange, actions, readOnly, isDarkMode, theme, language, }: {
|
|
17
|
-
element: HTMLElement;
|
|
18
|
-
value?: MaybeRefOrGetter<string>;
|
|
19
|
-
readOnly?: MaybeRefOrGetter<boolean>;
|
|
20
|
-
onChange?: (e: string) => void;
|
|
21
|
-
actions?: MonacoEditorAction[];
|
|
22
|
-
isDarkMode?: MaybeRefOrGetter<boolean>;
|
|
23
|
-
theme?: MaybeRefOrGetter<string>;
|
|
24
|
-
language?: MonacoEditorLanguage;
|
|
25
|
-
}) => {
|
|
26
|
-
editor: monaco.editor.IStandaloneCodeEditor;
|
|
27
|
-
model: monaco.editor.ITextModel;
|
|
28
|
-
highlightPath: (path: JsonPath) => Promise<void>;
|
|
29
|
-
focusPath: (path: JsonPath) => Promise<void>;
|
|
30
|
-
formatDocument: () => Promise<void>;
|
|
31
|
-
getValue: () => string;
|
|
32
|
-
setValue: (nextValue: string, isProgrammaticUpdate?: boolean) => void;
|
|
33
|
-
hasTextFocus: () => boolean;
|
|
34
|
-
setLanguage: (nextLanguage: MonacoEditorLanguage) => void;
|
|
35
|
-
setCursorToMarker: (marker: monaco.editor.IMarker) => void;
|
|
36
|
-
dispose: () => void;
|
|
37
|
-
};
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=use-editor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-editor.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/features/collection/components/Editor/hooks/use-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,wDAAwD,CAAA;AAC/D,OAAO,6DAA6D,CAAA;AACpE,OAAO,6DAA6D,CAAA;AACpE,OAAO,iEAAiE,CAAA;AACxE,OAAO,mEAAmE,CAAA;AAG1E,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,KAAK,CAAA;AAO3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6DAA6D,CAAA;AAI3F,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,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AAMlD,eAAO,MAAM,SAAS,GAAI,+EASvB;IACD,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAChC,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,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACtC,KAAK,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;;;0BA2FoC,QAAQ;sBASZ,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC;0BAoFtB,OAAO,CAAC,IAAI,CAAC;oBAIzB,MAAM;0BAEE,MAAM,qCAAiC,IAAI;wBAQ/C,OAAO;gCAEG,oBAAoB,KAAG,IAAI;gCAI3B,MAAM,CAAC,MAAM,CAAC,OAAO,KAAG,IAAI;mBAO3C,IAAI;CAmBzB,CAAA"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import * as r from "monaco-editor";
|
|
2
|
-
import "monaco-editor/esm/vs/editor/contrib/folding/browser/folding.css";
|
|
3
|
-
import "monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css";
|
|
4
|
-
import { presets as E } from "@scalar/themes";
|
|
5
|
-
import { toValue as a, watch as c } from "vue";
|
|
6
|
-
import { applyScalarTheme as J } from "../helpers/apply-scalar-theme.js";
|
|
7
|
-
import { configureLanguageSupport as R } from "../helpers/configure-language-support.js";
|
|
8
|
-
import { ensureMonacoEnvironment as k } from "../helpers/ensure-monaco-environment.js";
|
|
9
|
-
import { getJsonAstNodeFromPath as D } from "../helpers/get-json-ast-node-from-path.js";
|
|
10
|
-
import { getYamlNodeRangeFromPath as j } from "../helpers/get-yaml-node-range-from-path.js";
|
|
11
|
-
import { ensureJsonPointerLinkSupport as z } from "../helpers/json-pointer-links.js";
|
|
12
|
-
import { parseJsonPointerPath as B } from "../helpers/json-pointer-path.js";
|
|
13
|
-
const ot = ({
|
|
14
|
-
element: w,
|
|
15
|
-
value: f,
|
|
16
|
-
onChange: b,
|
|
17
|
-
actions: O,
|
|
18
|
-
readOnly: m = !1,
|
|
19
|
-
isDarkMode: x = !1,
|
|
20
|
-
theme: S = E.default.theme,
|
|
21
|
-
language: C = "json"
|
|
22
|
-
}) => {
|
|
23
|
-
k();
|
|
24
|
-
const n = r.editor.createModel(a(f) ?? "", C);
|
|
25
|
-
R(n.uri.toString());
|
|
26
|
-
const o = r.editor.create(w, {
|
|
27
|
-
model: n,
|
|
28
|
-
automaticLayout: !0,
|
|
29
|
-
folding: !0,
|
|
30
|
-
showFoldingControls: "always",
|
|
31
|
-
glyphMargin: !0,
|
|
32
|
-
lineNumbers: "on",
|
|
33
|
-
minimap: { enabled: !1 },
|
|
34
|
-
overviewRulerLanes: 0,
|
|
35
|
-
readOnly: a(m),
|
|
36
|
-
scrollbar: {
|
|
37
|
-
useShadows: !1,
|
|
38
|
-
verticalScrollbarSize: 5
|
|
39
|
-
},
|
|
40
|
-
scrollBeyondLastLine: !1,
|
|
41
|
-
guides: {
|
|
42
|
-
indentation: !0
|
|
43
|
-
},
|
|
44
|
-
formatOnPaste: !0,
|
|
45
|
-
renderValidationDecorations: "on",
|
|
46
|
-
formatOnType: !0,
|
|
47
|
-
lineHeight: 20,
|
|
48
|
-
renderLineHighlight: "none",
|
|
49
|
-
fontFamily: "'JetBrains Mono', monospace"
|
|
50
|
-
});
|
|
51
|
-
o.updateOptions({ insertSpaces: !0, tabSize: 2 });
|
|
52
|
-
let d = [], u = 0;
|
|
53
|
-
O?.forEach((t) => {
|
|
54
|
-
o.addAction({
|
|
55
|
-
id: t.id,
|
|
56
|
-
label: t.label,
|
|
57
|
-
keybindings: t.keybindings,
|
|
58
|
-
run: async () => {
|
|
59
|
-
await t.run();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
const g = (t, e) => {
|
|
64
|
-
const s = n.getPositionAt(t), i = Math.max(t, e - 1), F = n.getPositionAt(i), P = Math.max(1, s.lineNumber), M = Math.max(P, F.lineNumber);
|
|
65
|
-
return new r.Range(P, 1, M, n.getLineMaxColumn(M));
|
|
66
|
-
}, p = async (t) => {
|
|
67
|
-
if (n.getLanguageId() === "yaml")
|
|
68
|
-
return j(n.getValue(), t);
|
|
69
|
-
const e = await D(n, t);
|
|
70
|
-
return e ? { startOffset: e.offset, endOffset: e.offset + e.length } : null;
|
|
71
|
-
}, l = async (t) => {
|
|
72
|
-
await o.getAction(t)?.run();
|
|
73
|
-
}, h = ({ startOffset: t, endOffset: e }) => {
|
|
74
|
-
const s = g(t, e);
|
|
75
|
-
d = o.deltaDecorations(d, [
|
|
76
|
-
{
|
|
77
|
-
range: s,
|
|
78
|
-
options: {
|
|
79
|
-
isWholeLine: !0,
|
|
80
|
-
className: "json-focus-highlight"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
]);
|
|
84
|
-
}, T = async (t) => {
|
|
85
|
-
const e = await p(t);
|
|
86
|
-
e && h(e);
|
|
87
|
-
}, y = async (t) => {
|
|
88
|
-
const e = await p(t);
|
|
89
|
-
if (!e)
|
|
90
|
-
return;
|
|
91
|
-
const s = g(e.startOffset, e.endOffset);
|
|
92
|
-
await l("editor.foldAll"), o.setSelection(s), await l("editor.unfoldRecursively");
|
|
93
|
-
const i = n.getPositionAt(e.startOffset);
|
|
94
|
-
o.setPosition(i), o.revealPositionNearTop(i), h(e);
|
|
95
|
-
}, N = async (t) => {
|
|
96
|
-
const e = B(t);
|
|
97
|
-
e && await y(e);
|
|
98
|
-
}, { dispose: v } = z(N);
|
|
99
|
-
o.onDidChangeModelContent(() => {
|
|
100
|
-
if (u > 0) {
|
|
101
|
-
u -= 1;
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const t = o.getValue();
|
|
105
|
-
typeof t == "string" && b?.(t ?? "");
|
|
106
|
-
}), c(
|
|
107
|
-
() => a(f),
|
|
108
|
-
(t) => {
|
|
109
|
-
t && o.getValue() !== t && L(t, !0);
|
|
110
|
-
}
|
|
111
|
-
), c(
|
|
112
|
-
[() => a(S), () => a(x)],
|
|
113
|
-
async ([t, e]) => {
|
|
114
|
-
await J(t, e);
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
immediate: !0
|
|
118
|
-
}
|
|
119
|
-
), c(
|
|
120
|
-
() => a(m),
|
|
121
|
-
(t) => {
|
|
122
|
-
o?.updateOptions({ readOnly: t });
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
const A = async () => {
|
|
126
|
-
await l("editor.action.formatDocument");
|
|
127
|
-
}, V = () => o.getValue(), L = (t, e = !1) => {
|
|
128
|
-
e && (u += 1), o.setValue(t);
|
|
129
|
-
};
|
|
130
|
-
return {
|
|
131
|
-
editor: o,
|
|
132
|
-
model: n,
|
|
133
|
-
highlightPath: T,
|
|
134
|
-
focusPath: y,
|
|
135
|
-
formatDocument: A,
|
|
136
|
-
getValue: V,
|
|
137
|
-
setValue: L,
|
|
138
|
-
hasTextFocus: () => o.hasTextFocus(),
|
|
139
|
-
setLanguage: (t) => {
|
|
140
|
-
r.editor.setModelLanguage(n, t);
|
|
141
|
-
},
|
|
142
|
-
setCursorToMarker: (t) => {
|
|
143
|
-
const e = Math.min(Math.max(t.startLineNumber || 1, 1), n.getLineCount()), s = Math.min(Math.max(t.startColumn || 1, 1), n.getLineMaxColumn(e));
|
|
144
|
-
o.setPosition({ lineNumber: e, column: s });
|
|
145
|
-
},
|
|
146
|
-
dispose: () => {
|
|
147
|
-
o.dispose(), n.dispose(), v();
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
export {
|
|
152
|
-
ot as useEditor
|
|
153
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-ast.d.ts
RENAMED
|
File without changes
|
/package/dist/v2/features/{collection/components/Editor/helpers → editor/helpers/json}/json-ast.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/v2/features/{collection/components/Editor → editor}/hooks/use-editor-markers.d.ts
RENAMED
|
File without changes
|
/package/dist/v2/features/{collection/components/Editor → editor}/hooks/use-editor-markers.js
RENAMED
|
File without changes
|
/package/dist/v2/features/{collection/components/Editor → editor}/schemas/openapi-3.1-schema.json.js
RENAMED
|
File without changes
|