@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamplePicker.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/ExamplePicker.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExamplePicker.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/ExamplePicker.vue"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAGnG,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChE,CAAC;AAwBF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAyGxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as u, mergeModels as p, useModel as c, computed as m, createBlock as f, openBlock as x, unref as l, withCtx as n, createVNode as i,
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { ScalarIconCaretDown as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as u, mergeModels as p, useModel as c, computed as m, createBlock as f, openBlock as x, unref as l, withCtx as n, createVNode as i, mergeProps as v, createElementVNode as w, toDisplayString as V } from "vue";
|
|
2
|
+
import { ScalarListbox as b, ScalarButton as g } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as h } from "@scalar/icons";
|
|
4
|
+
const S = { class: "min-w-0 flex-1 truncate" }, y = /* @__PURE__ */ u({
|
|
5
|
+
inheritAttrs: !1,
|
|
5
6
|
__name: "ExamplePicker",
|
|
6
7
|
props: /* @__PURE__ */ p({
|
|
7
8
|
examples: { default: () => ({}) }
|
|
@@ -22,7 +23,7 @@ const _ = { class: "min-w-0 flex-1 truncate" }, k = /* @__PURE__ */ u({
|
|
|
22
23
|
get: () => s.value.find(({ id: e }) => e === r.value),
|
|
23
24
|
set: (e) => r.value = e?.id ?? ""
|
|
24
25
|
});
|
|
25
|
-
return (e, t) => (x(), f(l(
|
|
26
|
+
return (e, t) => (x(), f(l(b), {
|
|
26
27
|
modelValue: a.value,
|
|
27
28
|
"onUpdate:modelValue": t[0] || (t[0] = (d) => a.value = d),
|
|
28
29
|
class: "w-fit min-w-32",
|
|
@@ -31,25 +32,25 @@ const _ = { class: "min-w-0 flex-1 truncate" }, k = /* @__PURE__ */ u({
|
|
|
31
32
|
teleport: ""
|
|
32
33
|
}, {
|
|
33
34
|
default: n(() => [
|
|
34
|
-
i(l(
|
|
35
|
+
i(l(g), v({
|
|
35
36
|
class: "text-c-2 hover:text-c-1 flex h-full w-fit min-w-0 gap-1.5 px-1.5 py-0.75 text-base font-normal",
|
|
36
37
|
"data-testid": "example-picker",
|
|
37
38
|
variant: "ghost"
|
|
38
|
-
}, {
|
|
39
|
+
}, e.$attrs), {
|
|
39
40
|
default: n(() => [
|
|
40
|
-
|
|
41
|
-
i(l(
|
|
41
|
+
w("div", S, V(a.value?.label ?? "Select an example"), 1),
|
|
42
|
+
i(l(h), {
|
|
42
43
|
class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
43
44
|
weight: "bold"
|
|
44
45
|
})
|
|
45
46
|
]),
|
|
46
47
|
_: 1
|
|
47
|
-
})
|
|
48
|
+
}, 16)
|
|
48
49
|
]),
|
|
49
50
|
_: 1
|
|
50
51
|
}, 8, ["modelValue", "options"]));
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
y as default
|
|
55
56
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
|
|
2
2
|
import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isElectron as y } from "../../../../libs/electron.js";
|
|
4
|
-
const l = "2.36.
|
|
4
|
+
const l = "2.36.2", T = "application/json", C = "*/*", a = (n, s, o) => ({
|
|
5
5
|
name: n,
|
|
6
6
|
defaultValue: s,
|
|
7
7
|
isOverridden: o.has(n.toLowerCase())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/resize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/resize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
type UseSplitResizeOptions = {
|
|
3
|
+
/** Ref to the container used for horizontal resize (width + clientX). */
|
|
4
|
+
horizontalContainerRef: Ref<HTMLElement | undefined>;
|
|
5
|
+
/** Ref to the container used for vertical resize (height + clientY). */
|
|
6
|
+
verticalContainerRef: Ref<HTMLElement | undefined>;
|
|
7
|
+
/** Ref for the left (or first) pane width in percent (0–100). */
|
|
8
|
+
leftPaneSize: Ref<number>;
|
|
9
|
+
/** Ref for the top pane height in percent (0–100). */
|
|
10
|
+
topPaneSize: Ref<number>;
|
|
11
|
+
horizontalMin?: number;
|
|
12
|
+
horizontalMax?: number;
|
|
13
|
+
verticalMin?: number;
|
|
14
|
+
verticalMax?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Shared pointer-based resize logic for split layouts with percentage sizes.
|
|
18
|
+
* Use when you have both a horizontal split (e.g. left/right) and a vertical split (e.g. top/bottom).
|
|
19
|
+
* Only one resize is active at a time; starting another stops the previous.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSplitResize(options: UseSplitResizeOptions): {
|
|
22
|
+
onHorizontalResizeStart: (event: PointerEvent) => void;
|
|
23
|
+
onVerticalResizeStart: (event: PointerEvent) => void;
|
|
24
|
+
stopActiveResize: () => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=use-split-resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-split-resize.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/resize/use-split-resize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B,KAAK,qBAAqB,GAAG;IAC3B,yEAAyE;IACzE,sBAAsB,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACpD,wEAAwE;IACxE,oBAAoB,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IAClD,iEAAiE;IACjE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,sDAAsD;IACtD,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG;IAC9D,uBAAuB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IACtD,qBAAqB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD,gBAAgB,EAAE,MAAM,IAAI,CAAA;CAC7B,CAoFA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const p = (r, s, c) => Math.min(c, Math.max(s, r));
|
|
2
|
+
function b(r) {
|
|
3
|
+
const {
|
|
4
|
+
horizontalContainerRef: s,
|
|
5
|
+
verticalContainerRef: c,
|
|
6
|
+
leftPaneSize: z,
|
|
7
|
+
topPaneSize: m,
|
|
8
|
+
horizontalMin: y = 20,
|
|
9
|
+
horizontalMax: R = 80,
|
|
10
|
+
verticalMin: S = 25,
|
|
11
|
+
verticalMax: h = 75
|
|
12
|
+
} = r;
|
|
13
|
+
let l;
|
|
14
|
+
const a = () => {
|
|
15
|
+
l?.(), l = void 0;
|
|
16
|
+
}, u = (o, e, n) => {
|
|
17
|
+
o.preventDefault(), a();
|
|
18
|
+
const t = document.body.style.userSelect, i = document.body.style.cursor;
|
|
19
|
+
document.body.style.userSelect = "none", document.body.style.cursor = n;
|
|
20
|
+
const d = (w) => {
|
|
21
|
+
e(w);
|
|
22
|
+
}, v = () => {
|
|
23
|
+
a();
|
|
24
|
+
};
|
|
25
|
+
window.addEventListener("pointermove", d), window.addEventListener("pointerup", v, { once: !0 }), l = () => {
|
|
26
|
+
window.removeEventListener("pointermove", d), window.removeEventListener("pointerup", v), document.body.style.userSelect = t, document.body.style.cursor = i;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
onHorizontalResizeStart: (o) => {
|
|
31
|
+
const e = s.value;
|
|
32
|
+
e && u(
|
|
33
|
+
o,
|
|
34
|
+
(n) => {
|
|
35
|
+
const t = e.getBoundingClientRect(), i = (n.clientX - t.left) / t.width * 100;
|
|
36
|
+
z.value = p(i, y, R);
|
|
37
|
+
},
|
|
38
|
+
"col-resize"
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
onVerticalResizeStart: (o) => {
|
|
42
|
+
const e = c.value;
|
|
43
|
+
e && u(
|
|
44
|
+
o,
|
|
45
|
+
(n) => {
|
|
46
|
+
const t = e.getBoundingClientRect(), i = (n.clientY - t.top) / t.height * 100;
|
|
47
|
+
m.value = p(i, S, h);
|
|
48
|
+
},
|
|
49
|
+
"row-resize"
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
stopActiveResize: a
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
b as useSplitResize
|
|
57
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
2
|
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
|
|
3
3
|
import type { CommandPaletteState } from '../../../v2/features/command-palette/hooks/use-command-palette-state.js';
|
|
4
|
+
import type { ImportDocumentFromRegistry } from '../../../v2/types/configuration';
|
|
4
5
|
import type { ClientLayout } from '../../../v2/types/layout';
|
|
5
6
|
import { type AppState } from './app-state.js';
|
|
6
7
|
/**
|
|
@@ -15,6 +16,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
15
16
|
plugins?: ClientPlugin[];
|
|
16
17
|
getAppState: () => AppState;
|
|
17
18
|
getCommandPaletteState: () => CommandPaletteState;
|
|
19
|
+
/** Fetches the full document from registry by meta. Passed through to route props for sync. */
|
|
20
|
+
fetchRegistryDocument?: ImportDocumentFromRegistry;
|
|
18
21
|
}, {
|
|
19
22
|
openCreateWorkspace: () => void;
|
|
20
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -22,6 +25,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
22
25
|
plugins?: ClientPlugin[];
|
|
23
26
|
getAppState: () => AppState;
|
|
24
27
|
getCommandPaletteState: () => CommandPaletteState;
|
|
28
|
+
/** Fetches the full document from registry by meta. Passed through to route props for sync. */
|
|
29
|
+
fetchRegistryDocument?: ImportDocumentFromRegistry;
|
|
25
30
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
26
31
|
/**
|
|
27
32
|
* Slot for customizing the actions section of the sidebar menu.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA+PA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAY7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AAKxG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;YAER,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;IACjD,+FAA+F;4BACvE,0BAA0B;;;;YAL1C,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;IACjD,+FAA+F;4BACvE,0BAA0B;;IAYlD;;;OAGG;4BACqB,MAAM,OAAO;IACrC;;;OAGG;yBACkB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO;EA6V9D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,53 +1,60 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { ScalarToasts as
|
|
4
|
-
import { extensions as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useDocumentWatcher as
|
|
9
|
-
import
|
|
10
|
-
import { useColorMode as
|
|
11
|
-
import { useGlobalHotKeys as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { defineComponent as T, computed as c, toValue as g, createBlock as p, openBlock as u, unref as t, withCtx as d, createElementVNode as i, createVNode as n, createElementBlock as v, renderSlot as k, createCommentVNode as W, normalizeProps as x, guardReactiveProps as B } from "vue";
|
|
2
|
+
import { useModal as C, ScalarTeleportRoot as M } from "@scalar/components";
|
|
3
|
+
import { ScalarToasts as D } from "@scalar/use-toasts";
|
|
4
|
+
import { extensions as O } from "@scalar/workspace-store/schemas/extensions";
|
|
5
|
+
import { RouterView as E } from "vue-router";
|
|
6
|
+
import _ from "./components/CreateWorkspaceModal.vue.js";
|
|
7
|
+
import A from "./components/SplashScreen.vue.js";
|
|
8
|
+
import { useDocumentWatcher as U } from "./hooks/use-document-watcher.js";
|
|
9
|
+
import V from "../command-palette/TheCommandPalette.vue.js";
|
|
10
|
+
import { useColorMode as I } from "../../hooks/use-color-mode.js";
|
|
11
|
+
import { useGlobalHotKeys as N } from "../../hooks/use-global-hot-keys.js";
|
|
12
|
+
import P from "./components/AppSidebar.vue.js";
|
|
13
|
+
import R from "./components/DesktopTabs.vue.js";
|
|
14
|
+
import { useMonacoEditorConfiguration as $ } from "../editor/config.js";
|
|
15
|
+
import { mergeSecurity as F } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
|
|
16
|
+
import H from "../../components/sidebar/SidebarToggle.vue.js";
|
|
17
|
+
const L = ["innerHTML"], z = { key: 0 }, G = { class: "relative flex h-dvh w-dvw flex-1 flex-col" }, K = { class: "flex min-h-0 flex-1 flex-row" }, j = { class: "flex flex-1 flex-col" }, q = { class: "bg-b-1 min-h-0 flex-1" }, J = { key: 1 }, Q = {}, ve = /* @__PURE__ */ T({
|
|
18
|
+
...Q,
|
|
18
19
|
__name: "App",
|
|
19
20
|
props: {
|
|
20
21
|
layout: {},
|
|
21
22
|
plugins: { default: () => [] },
|
|
22
23
|
getAppState: { type: Function },
|
|
23
|
-
getCommandPaletteState: { type: Function }
|
|
24
|
+
getCommandPaletteState: { type: Function },
|
|
25
|
+
fetchRegistryDocument: { type: Function }
|
|
24
26
|
},
|
|
25
|
-
setup(
|
|
26
|
-
|
|
27
|
+
setup(s, { expose: f }) {
|
|
28
|
+
f({
|
|
27
29
|
openCreateWorkspace: () => l.show()
|
|
28
30
|
});
|
|
29
|
-
const e =
|
|
30
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e),
|
|
31
|
-
documentName: () => e.store.value?.workspace[
|
|
31
|
+
const e = s.getAppState(), h = s.getCommandPaletteState();
|
|
32
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), N(e.eventBus, s.layout), U({
|
|
33
|
+
documentName: () => e.store.value?.workspace[O.workspace.activeDocument],
|
|
32
34
|
store: e.store,
|
|
33
35
|
initialTimeout: 5e3
|
|
34
|
-
}),
|
|
35
|
-
const
|
|
36
|
+
}), I({ workspaceStore: e.store });
|
|
37
|
+
const w = c(() => e.theme.styles.value.themeStyles), S = c(() => e.isDarkMode.value);
|
|
38
|
+
$({
|
|
39
|
+
theme: w,
|
|
40
|
+
darkMode: S
|
|
41
|
+
});
|
|
42
|
+
const m = (o, a) => {
|
|
36
43
|
e.eventBus.emit("ui:navigate", {
|
|
37
44
|
page: "workspace",
|
|
38
45
|
path: "environment",
|
|
39
46
|
namespace: o,
|
|
40
47
|
workspaceSlug: a
|
|
41
48
|
});
|
|
42
|
-
},
|
|
49
|
+
}, b = (o) => {
|
|
43
50
|
if (!o)
|
|
44
51
|
return;
|
|
45
52
|
const a = e.workspace.workspaceList.value?.find(
|
|
46
|
-
(
|
|
53
|
+
(r) => r.id === o
|
|
47
54
|
);
|
|
48
|
-
a &&
|
|
49
|
-
}, l =
|
|
50
|
-
const o = e.store.value?.auth ?
|
|
55
|
+
a && m(a.namespace, a.slug);
|
|
56
|
+
}, l = C(), y = c(() => {
|
|
57
|
+
const o = e.store.value?.auth ? F(
|
|
51
58
|
e.document.value?.components?.securitySchemes ?? {},
|
|
52
59
|
{},
|
|
53
60
|
e.store.value.auth,
|
|
@@ -59,80 +66,81 @@ const H = ["innerHTML"], L = { key: 0 }, F = { class: "relative flex h-dvh w-dvw
|
|
|
59
66
|
environment: e.environment.value,
|
|
60
67
|
eventBus: e.eventBus,
|
|
61
68
|
exampleName: e.activeEntities.exampleName.value,
|
|
62
|
-
|
|
69
|
+
fetchRegistryDocument: s.fetchRegistryDocument,
|
|
70
|
+
layout: s.layout,
|
|
63
71
|
method: e.activeEntities.method.value,
|
|
64
72
|
path: e.activeEntities.path.value,
|
|
65
73
|
workspaceStore: e.store.value,
|
|
66
74
|
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
67
|
-
plugins:
|
|
75
|
+
plugins: s.plugins,
|
|
68
76
|
securitySchemes: o,
|
|
69
77
|
isDarkMode: e.isDarkMode.value,
|
|
70
78
|
currentTheme: e.theme.styles.value.themeStyles,
|
|
71
|
-
customThemes:
|
|
79
|
+
customThemes: g(e.theme.customThemes)
|
|
72
80
|
};
|
|
73
81
|
});
|
|
74
|
-
return (o, a) => (u(), p(t(
|
|
75
|
-
default:
|
|
82
|
+
return (o, a) => (u(), p(t(M), null, {
|
|
83
|
+
default: d(() => [
|
|
76
84
|
i("div", {
|
|
77
85
|
innerHTML: t(e).theme.themeStyleTag.value
|
|
78
|
-
}, null, 8,
|
|
79
|
-
n(t(
|
|
80
|
-
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (u(),
|
|
81
|
-
i("div",
|
|
82
|
-
n(t(
|
|
86
|
+
}, null, 8, L),
|
|
87
|
+
n(t(D)),
|
|
88
|
+
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (u(), v("main", z, [
|
|
89
|
+
i("div", G, [
|
|
90
|
+
n(t(H), {
|
|
83
91
|
modelValue: t(e).sidebar.isOpen.value,
|
|
84
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
92
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => t(e).sidebar.isOpen.value = r),
|
|
85
93
|
class: "absolute top-4 left-3 z-[60] md:hidden"
|
|
86
94
|
}, null, 8, ["modelValue"]),
|
|
87
|
-
i("div",
|
|
88
|
-
n(
|
|
95
|
+
i("div", K, [
|
|
96
|
+
n(P, {
|
|
89
97
|
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
90
|
-
"onUpdate:isSidebarOpen": a[1] || (a[1] = (
|
|
98
|
+
"onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
|
|
91
99
|
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
92
100
|
eventBus: t(e).eventBus,
|
|
93
101
|
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
94
|
-
layout:
|
|
102
|
+
layout: s.layout,
|
|
95
103
|
sidebarState: t(e).sidebar.state,
|
|
96
104
|
sidebarWidth: t(e).sidebar.width.value,
|
|
97
105
|
store: t(e).store.value,
|
|
98
106
|
workspaces: t(e).workspace.workspaceGroups.value,
|
|
99
|
-
"onClick:workspace":
|
|
100
|
-
"onCreate:workspace": a[2] || (a[2] = (
|
|
101
|
-
"onSelect:workspace":
|
|
107
|
+
"onClick:workspace": m,
|
|
108
|
+
"onCreate:workspace": a[2] || (a[2] = (r) => t(l).show()),
|
|
109
|
+
"onSelect:workspace": b,
|
|
102
110
|
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
103
111
|
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
104
112
|
}, {
|
|
105
|
-
sidebarMenuActions:
|
|
106
|
-
|
|
113
|
+
sidebarMenuActions: d(() => [
|
|
114
|
+
k(o.$slots, "sidebar-menu-actions")
|
|
107
115
|
]),
|
|
108
116
|
_: 3
|
|
109
117
|
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
110
|
-
i("div",
|
|
111
|
-
|
|
118
|
+
i("div", j, [
|
|
119
|
+
s.layout === "desktop" ? (u(), p(R, {
|
|
112
120
|
key: 0,
|
|
113
121
|
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
114
122
|
eventBus: t(e).eventBus,
|
|
115
123
|
tabs: t(e).tabs.state.value
|
|
116
|
-
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) :
|
|
117
|
-
i("div",
|
|
118
|
-
n(t(
|
|
124
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : W("", !0),
|
|
125
|
+
i("div", q, [
|
|
126
|
+
n(t(E), x(B(y.value)), null, 16)
|
|
119
127
|
])
|
|
120
128
|
])
|
|
121
129
|
])
|
|
122
130
|
]),
|
|
123
|
-
|
|
124
|
-
n(
|
|
131
|
+
k(o.$slots, "create-workspace", { state: t(l) }, () => [
|
|
132
|
+
n(_, {
|
|
125
133
|
state: t(l),
|
|
126
|
-
"onCreate:workspace": a[3] || (a[3] = (
|
|
134
|
+
"onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
|
|
127
135
|
}, null, 8, ["state"])
|
|
128
136
|
]),
|
|
129
|
-
n(
|
|
137
|
+
n(V, {
|
|
130
138
|
eventBus: t(e).eventBus,
|
|
131
|
-
paletteState: t(
|
|
139
|
+
paletteState: t(h),
|
|
132
140
|
workspaceStore: t(e).store.value
|
|
133
141
|
}, null, 8, ["eventBus", "paletteState", "workspaceStore"])
|
|
134
|
-
])) : (u(),
|
|
135
|
-
n(
|
|
142
|
+
])) : (u(), v("main", J, [
|
|
143
|
+
n(A)
|
|
136
144
|
]))
|
|
137
145
|
]),
|
|
138
146
|
_: 3
|
|
@@ -140,5 +148,5 @@ const H = ["innerHTML"], L = { key: 0 }, F = { class: "relative flex h-dvh w-dvw
|
|
|
140
148
|
}
|
|
141
149
|
});
|
|
142
150
|
export {
|
|
143
|
-
|
|
151
|
+
ve as default
|
|
144
152
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
|
|
2
2
|
import type { Theme } from '@scalar/themes';
|
|
3
|
+
import type { ImportDocumentFromRegistry } from '../../../../v2/types/configuration';
|
|
3
4
|
import type { ClientLayout } from '../../../../v2/types/layout';
|
|
4
5
|
type CreateApiClientOptions = {
|
|
5
6
|
/**
|
|
@@ -22,6 +23,11 @@ type CreateApiClientOptions = {
|
|
|
22
23
|
* @default 'default'
|
|
23
24
|
*/
|
|
24
25
|
fallbackThemeSlug?: () => string;
|
|
26
|
+
/**
|
|
27
|
+
* Fetches the full document from registry by meta. When set, registry meta takes priority
|
|
28
|
+
* over x-scalar-original-source-url when syncing. Returns the document as a plain object.
|
|
29
|
+
*/
|
|
30
|
+
fetchRegistryDocument?: ImportDocumentFromRegistry;
|
|
25
31
|
};
|
|
26
32
|
/**
|
|
27
33
|
* Creates the appropriate router with the appropriate routes based on the layout
|
|
@@ -30,7 +36,7 @@ export declare const createAppRouter: (layout: CreateApiClientOptions["layout"])
|
|
|
30
36
|
/**
|
|
31
37
|
* Create the API Client with router and passes in the workspace store as a prop
|
|
32
38
|
*/
|
|
33
|
-
export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins, customThemes, fallbackThemeSlug }: CreateApiClientOptions) => Promise<{
|
|
39
|
+
export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins, customThemes, fallbackThemeSlug, fetchRegistryDocument }: CreateApiClientOptions) => Promise<{
|
|
34
40
|
app: import("vue").App<Element>;
|
|
35
41
|
state: import("../../../../v2/features/app/app-state.js").AppState;
|
|
36
42
|
} | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAO3C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,MAAM,CAAA;IAChC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,0BAA0B,CAAA;CACnD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,WAAW,GAAG,IAAI,EACtB,6EAAyF,sBAAsB;;;cAqChH,CAAA"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { createApp as
|
|
2
|
-
import { createRouter as p, createWebHistory as
|
|
3
|
-
import
|
|
1
|
+
import { createApp as u } from "vue";
|
|
2
|
+
import { createRouter as p, createWebHistory as d, createWebHashHistory as f } from "vue-router";
|
|
3
|
+
import A from "../App.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { createAppState as
|
|
5
|
+
import { createAppState as h } from "../app-state.js";
|
|
6
6
|
import { ROUTES as c } from "./routes.js";
|
|
7
|
-
import { useCommandPaletteState as
|
|
8
|
-
const
|
|
9
|
-
const o =
|
|
7
|
+
import { useCommandPaletteState as S } from "../../command-palette/hooks/use-command-palette-state.js";
|
|
8
|
+
const b = (t) => t === "web" ? p({ history: d(), routes: c }) : p({ history: f(), routes: c }), v = async (t, { layout: r = "desktop", plugins: i, customThemes: m, fallbackThemeSlug: n, fetchRegistryDocument: s }) => {
|
|
9
|
+
const o = b(r), a = await h({
|
|
10
|
+
router: o,
|
|
11
|
+
customThemes: m,
|
|
12
|
+
fallbackThemeSlug: n
|
|
13
|
+
}), l = S(), e = u(A, {
|
|
10
14
|
layout: r,
|
|
11
15
|
plugins: i,
|
|
12
16
|
getAppState: () => a,
|
|
13
|
-
getCommandPaletteState: () =>
|
|
17
|
+
getCommandPaletteState: () => l,
|
|
18
|
+
fetchRegistryDocument: s
|
|
14
19
|
});
|
|
15
20
|
if (e.use(o), !t) {
|
|
16
21
|
console.error(
|
|
@@ -26,6 +31,6 @@ const S = (t) => t === "web" ? p({ history: u(), routes: c }) : p({ history: d()
|
|
|
26
31
|
};
|
|
27
32
|
};
|
|
28
33
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
v as createApiClientApp,
|
|
35
|
+
b as createAppRouter
|
|
31
36
|
};
|
|
@@ -6,6 +6,7 @@ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
|
6
6
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
7
7
|
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
8
8
|
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
|
|
9
|
+
import type { ImportDocumentFromRegistry } from '../../../../v2/types/configuration';
|
|
9
10
|
import type { ClientLayout } from '../../../../v2/types/layout';
|
|
10
11
|
/** These props are provided at the route level */
|
|
11
12
|
export type RouteProps = {
|
|
@@ -42,6 +43,11 @@ export type RouteProps = {
|
|
|
42
43
|
currentTheme?: string;
|
|
43
44
|
/** Whether the current color mode is dark */
|
|
44
45
|
isDarkMode?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Fetches the full document from registry by meta. When provided, registry meta takes priority
|
|
48
|
+
* over x-scalar-original-source-url when syncing. Returns the document as a plain object.
|
|
49
|
+
*/
|
|
50
|
+
fetchRegistryDocument?: ImportDocumentFromRegistry;
|
|
45
51
|
};
|
|
46
52
|
/** When in the collections pages */
|
|
47
53
|
export type CollectionProps = RouteProps & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAa1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,mEAAmE;IACnE,YAAY,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,8BAA8B;IAC9B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+BAA+B;IAC/B,MAAM,EAAE,YAAY,CAAA;IACpB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,kCAAkC;IAClC,eAAe,EAAE,qBAAqB,CAAA;IACtC,0BAA0B;IAC1B,cAAc,EAAE,cAAc,CAAA;IAC9B,qCAAqC;IACrC,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"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"}
|
|
@@ -6,12 +6,13 @@ import m from "../../collection/components/Overview.vue.js";
|
|
|
6
6
|
import r from "../../collection/components/Servers.vue.js";
|
|
7
7
|
import c from "../../collection/components/Settings.vue.js";
|
|
8
8
|
import u from "../../collection/DocumentCollection.vue.js";
|
|
9
|
+
/* empty css */
|
|
9
10
|
import v from "../../collection/OperationCollection.vue.js";
|
|
10
11
|
import f from "../../collection/WorkspaceCollection.vue.js";
|
|
11
12
|
import { workspaceStorage as p } from "../../../helpers/storage.js";
|
|
12
13
|
import l from "../../operation/Operation.vue.js";
|
|
13
14
|
import w from "../../collection/components/Editor/Editor.vue.js";
|
|
14
|
-
const
|
|
15
|
+
const q = [
|
|
15
16
|
{
|
|
16
17
|
path: "/@:namespace/:workspaceSlug",
|
|
17
18
|
children: [
|
|
@@ -152,5 +153,5 @@ const O = [
|
|
|
152
153
|
}
|
|
153
154
|
];
|
|
154
155
|
export {
|
|
155
|
-
|
|
156
|
+
q as ROUTES
|
|
156
157
|
};
|
|
@@ -6,8 +6,8 @@ const p = 5 * 1e3, M = 60 * 1e3, E = () => {
|
|
|
6
6
|
};
|
|
7
7
|
return {
|
|
8
8
|
clear: e,
|
|
9
|
-
schedule: (
|
|
10
|
-
e(), t = setTimeout(
|
|
9
|
+
schedule: (s, c) => {
|
|
10
|
+
e(), t = setTimeout(s, c);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}, V = (t) => {
|
|
@@ -21,40 +21,40 @@ const p = 5 * 1e3, M = 60 * 1e3, E = () => {
|
|
|
21
21
|
},
|
|
22
22
|
get: () => e
|
|
23
23
|
};
|
|
24
|
-
}, k = (t) => t.flatMap(([e]) => e),
|
|
24
|
+
}, k = (t) => t.flatMap(([e]) => e), w = ({
|
|
25
25
|
documentName: t,
|
|
26
26
|
store: e,
|
|
27
27
|
initialTimeout: u = p
|
|
28
28
|
}) => {
|
|
29
|
-
const
|
|
29
|
+
const s = g(() => {
|
|
30
30
|
const r = l(e), o = l(t);
|
|
31
31
|
return !r || !o ? null : r.workspace.documents[o];
|
|
32
|
-
}), c = E(),
|
|
33
|
-
|
|
32
|
+
}), c = E(), a = V(u), f = () => {
|
|
33
|
+
a.reset(), c.schedule(i, a.get());
|
|
34
34
|
}, d = () => {
|
|
35
|
-
|
|
35
|
+
a.backoff(), c.schedule(i, a.get());
|
|
36
36
|
}, i = async () => {
|
|
37
|
-
const r = l(e), o = l(t), m =
|
|
37
|
+
const r = l(e), o = l(t), m = s.value?.["x-scalar-original-source-url"];
|
|
38
38
|
if (!r || !o || !m)
|
|
39
39
|
return;
|
|
40
40
|
const n = await r.rebaseDocument({
|
|
41
41
|
name: o,
|
|
42
42
|
url: m
|
|
43
43
|
});
|
|
44
|
-
n?.ok ? (await n.applyChanges(k(n.conflicts)), f()) : n?.ok === !1 && n.type === "NO_CHANGES_DETECTED" ? f() : d();
|
|
44
|
+
n?.ok ? (await n.applyChanges({ resolvedConflicts: k(n.conflicts) }), f()) : n?.ok === !1 && n.type === "NO_CHANGES_DETECTED" ? f() : d();
|
|
45
45
|
};
|
|
46
46
|
h(
|
|
47
|
-
[() =>
|
|
47
|
+
[() => s.value?.["x-scalar-original-source-url"], () => s.value?.["x-scalar-watch-mode"]],
|
|
48
48
|
([r, o = !1]) => {
|
|
49
49
|
if (!l(e)) {
|
|
50
50
|
c.clear();
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
if (c.clear(), !r || !o) {
|
|
54
|
-
|
|
54
|
+
a.reset();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
c.schedule(i,
|
|
57
|
+
c.schedule(i, a.get());
|
|
58
58
|
},
|
|
59
59
|
{ immediate: !0 }
|
|
60
60
|
), T(() => {
|
|
@@ -62,5 +62,5 @@ const p = 5 * 1e3, M = 60 * 1e3, E = () => {
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
w as useDocumentWatcher
|
|
66
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AA2dA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAOlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,gSAg4Bd,CAAC"}
|