@scalar/blocks 0.7.2 → 0.7.3
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 +16 -0
- package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
- package/dist/code-example/components/CodeExample.vue.js +1 -1
- package/dist/code-example/components/CodeExample.vue.js.map +1 -1
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +57 -57
- package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
- package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.js +1 -1
- package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
- package/dist/code-example/mount.d.ts.map +1 -1
- package/dist/code-example/mount.js +30 -29
- package/dist/code-example/mount.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/style.css +9 -5
- package/dist/vue-styles.css +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamplePicker.vue.d.ts","sourceRoot":"","sources":["../../../src/code-example/components/ExamplePicker.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExamplePicker.vue.d.ts","sourceRoot":"","sources":["../../../src/code-example/components/ExamplePicker.vue"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,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;AA+GxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamplePicker.vue.js","names":["_sfc_main","ExamplePicker_vue_vue_type_script_setup_true_lang_default","ExamplePicker_default"],"sources":["../../../src/code-example/components/ExamplePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { getExampleSummary } from '../../schema/helpers/get-rendered-example'\n\nconst { examples = {} } = defineProps<{\n examples?: MediaTypeObject['examples'] | Record<string, string>\n}>()\n\nconst selectedExampleKey = defineModel<string>({\n required: true,\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst exampleOptions = computed<ScalarListboxOption[]>(() =>\n Object.entries(examples).map(([key, example]) => ({\n id: key,\n label: getExampleSummary(example) || key,\n })),\n)\n\nconst selectedExample = computed<ScalarListboxOption | undefined>({\n get: () =>\n exampleOptions.value.find(({ id }) => id === selectedExampleKey.value),\n set: (v) => (selectedExampleKey.value = v?.id ?? ''),\n})\n</script>\n\n<template>\n <ScalarListbox\n v-model=\"selectedExample\"\n class=\"w-fit min-w-32\"\n :options=\"exampleOptions\"\n placement=\"bottom-start\"\n teleport>\n <ScalarButton\n 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\"\n data-testid=\"example-picker\"\n variant=\"ghost\"\n v-bind=\"$attrs\">\n <div class=\"min-w-0 flex-1 truncate\">\n {{ selectedExample?.label ?? 'Select an example' }}\n </div>\n <ScalarIconCaretDown\n class=\"
|
|
1
|
+
{"version":3,"file":"ExamplePicker.vue.js","names":["_sfc_main","ExamplePicker_vue_vue_type_script_setup_true_lang_default","ExamplePicker_default"],"sources":["../../../src/code-example/components/ExamplePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { getExampleSummary } from '../../schema/helpers/get-rendered-example'\n\nconst { examples = {} } = defineProps<{\n examples?: MediaTypeObject['examples'] | Record<string, string>\n}>()\n\nconst selectedExampleKey = defineModel<string>({\n required: true,\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst exampleOptions = computed<ScalarListboxOption[]>(() =>\n Object.entries(examples).map(([key, example]) => ({\n id: key,\n label: getExampleSummary(example) || key,\n })),\n)\n\nconst selectedExample = computed<ScalarListboxOption | undefined>({\n get: () =>\n exampleOptions.value.find(({ id }) => id === selectedExampleKey.value),\n set: (v) => (selectedExampleKey.value = v?.id ?? ''),\n})\n</script>\n\n<template>\n <ScalarListbox\n v-slot=\"{ open }\"\n v-model=\"selectedExample\"\n class=\"w-fit min-w-32\"\n :options=\"exampleOptions\"\n placement=\"bottom-start\"\n teleport>\n <ScalarButton\n 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\"\n data-testid=\"example-picker\"\n variant=\"ghost\"\n v-bind=\"$attrs\">\n <div class=\"min-w-0 flex-1 truncate\">\n {{ selectedExample?.label ?? 'Select an example' }}\n </div>\n <!--\n Follow this listbox's own state. The `ui-open:` variant also matches any open\n Headless UI ancestor, such as an expanded operation in the classic layout.\n -->\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarListbox>\n</template>\n"],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getExampleSummary as e } from "../../schema/helpers/get-rendered-example.js";
|
|
2
|
-
import { computed as t, createBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeModels as o, mergeProps as s,
|
|
3
|
-
import { ScalarButton as
|
|
4
|
-
import { ScalarListbox as
|
|
5
|
-
import { ScalarIconCaretDown as
|
|
2
|
+
import { computed as t, createBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, normalizeClass as c, openBlock as l, toDisplayString as u, unref as d, useModel as f, withCtx as p } from "vue";
|
|
3
|
+
import { ScalarButton as m } from "@scalar/components/button";
|
|
4
|
+
import { ScalarListbox as h } from "@scalar/components/listbox";
|
|
5
|
+
import { ScalarIconCaretDown as g } from "@scalar/icons";
|
|
6
6
|
//#region src/code-example/components/ExamplePicker.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var _ = { class: "min-w-0 flex-1 truncate" }, v = /*@__PURE__*/ a({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ExamplePicker",
|
|
10
10
|
props: /*@__PURE__*/ o({ examples: { default: () => ({}) } }, {
|
|
@@ -13,37 +13,37 @@ var g = { class: "min-w-0 flex-1 truncate" }, _ = /*@__PURE__*/ a({
|
|
|
13
13
|
}),
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
15
|
setup(a) {
|
|
16
|
-
let o =
|
|
16
|
+
let o = f(a, "modelValue"), v = t(() => Object.entries(a.examples).map(([t, n]) => ({
|
|
17
17
|
id: t,
|
|
18
18
|
label: e(n) || t
|
|
19
|
-
}))),
|
|
20
|
-
get: () =>
|
|
19
|
+
}))), y = t({
|
|
20
|
+
get: () => v.value.find(({ id: e }) => e === o.value),
|
|
21
21
|
set: (e) => o.value = e?.id ?? ""
|
|
22
22
|
});
|
|
23
|
-
return (e, t) => (
|
|
24
|
-
modelValue:
|
|
25
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
23
|
+
return (e, t) => (l(), n(d(h), {
|
|
24
|
+
modelValue: y.value,
|
|
25
|
+
"onUpdate:modelValue": t[0] ||= (e) => y.value = e,
|
|
26
26
|
class: "w-fit min-w-32",
|
|
27
|
-
options:
|
|
27
|
+
options: v.value,
|
|
28
28
|
placement: "bottom-start",
|
|
29
29
|
teleport: ""
|
|
30
30
|
}, {
|
|
31
|
-
default:
|
|
31
|
+
default: p(({ open: t }) => [i(d(m), s({
|
|
32
32
|
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",
|
|
33
33
|
"data-testid": "example-picker",
|
|
34
34
|
variant: "ghost"
|
|
35
35
|
}, e.$attrs), {
|
|
36
|
-
default:
|
|
37
|
-
class: "
|
|
36
|
+
default: p(() => [r("div", _, u(y.value?.label ?? "Select an example"), 1), i(d(g), {
|
|
37
|
+
class: c(["mt-0.25 size-3 transition-transform duration-100", { "rotate-180": t }]),
|
|
38
38
|
weight: "bold"
|
|
39
|
-
})]),
|
|
40
|
-
_:
|
|
41
|
-
},
|
|
39
|
+
}, null, 8, ["class"])]),
|
|
40
|
+
_: 2
|
|
41
|
+
}, 1040)]),
|
|
42
42
|
_: 1
|
|
43
43
|
}, 8, ["modelValue", "options"]));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { v as default };
|
|
48
48
|
|
|
49
49
|
//# sourceMappingURL=ExamplePicker.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamplePicker.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_createElementVNode","_toDisplayString","_hoisted_1","ExamplePicker_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","selectedExampleKey","useModel","__props","exampleOptions","computed","key","example","getExampleSummary","selectedExample","id","v","openBlock","createBlock","unref","ScalarListbox","_cache","$event","withCtx","createVNode","ScalarButton","mergeProps","_ctx","createElementVNode","toDisplayString","ScalarIconCaretDown"],"sources":["../../../src/code-example/components/ExamplePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { getExampleSummary } from '../../schema/helpers/get-rendered-example'\n\nconst { examples = {} } = defineProps<{\n examples?: MediaTypeObject['examples'] | Record<string, string>\n}>()\n\nconst selectedExampleKey = defineModel<string>({\n required: true,\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst exampleOptions = computed<ScalarListboxOption[]>(() =>\n Object.entries(examples).map(([key, example]) => ({\n id: key,\n label: getExampleSummary(example) || key,\n })),\n)\n\nconst selectedExample = computed<ScalarListboxOption | undefined>({\n get: () =>\n exampleOptions.value.find(({ id }) => id === selectedExampleKey.value),\n set: (v) => (selectedExampleKey.value = v?.id ?? ''),\n})\n</script>\n\n<template>\n <ScalarListbox\n v-model=\"selectedExample\"\n class=\"w-fit min-w-32\"\n :options=\"exampleOptions\"\n placement=\"bottom-start\"\n teleport>\n <ScalarButton\n 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\"\n data-testid=\"example-picker\"\n variant=\"ghost\"\n v-bind=\"$attrs\">\n <div class=\"min-w-0 flex-1 truncate\">\n {{ selectedExample?.label ?? 'Select an example' }}\n </div>\n <ScalarIconCaretDown\n class=\"
|
|
1
|
+
{"version":3,"file":"ExamplePicker.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_mergeProps","_createElementVNode","_toDisplayString","_normalizeClass","_hoisted_1","ExamplePicker_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","selectedExampleKey","useModel","__props","exampleOptions","computed","key","example","getExampleSummary","selectedExample","id","v","openBlock","createBlock","unref","ScalarListbox","_cache","$event","withCtx","createVNode","ScalarButton","mergeProps","_ctx","createElementVNode","toDisplayString","ScalarIconCaretDown","normalizeClass","open"],"sources":["../../../src/code-example/components/ExamplePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { getExampleSummary } from '../../schema/helpers/get-rendered-example'\n\nconst { examples = {} } = defineProps<{\n examples?: MediaTypeObject['examples'] | Record<string, string>\n}>()\n\nconst selectedExampleKey = defineModel<string>({\n required: true,\n})\n\ndefineOptions({ inheritAttrs: false })\n\nconst exampleOptions = computed<ScalarListboxOption[]>(() =>\n Object.entries(examples).map(([key, example]) => ({\n id: key,\n label: getExampleSummary(example) || key,\n })),\n)\n\nconst selectedExample = computed<ScalarListboxOption | undefined>({\n get: () =>\n exampleOptions.value.find(({ id }) => id === selectedExampleKey.value),\n set: (v) => (selectedExampleKey.value = v?.id ?? ''),\n})\n</script>\n\n<template>\n <ScalarListbox\n v-slot=\"{ open }\"\n v-model=\"selectedExample\"\n class=\"w-fit min-w-32\"\n :options=\"exampleOptions\"\n placement=\"bottom-start\"\n teleport>\n <ScalarButton\n 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\"\n data-testid=\"example-picker\"\n variant=\"ghost\"\n v-bind=\"$attrs\">\n <div class=\"min-w-0 flex-1 truncate\">\n {{ selectedExample?.label ?? 'Select an example' }}\n </div>\n <!--\n Follow this listbox's own state. The `ui-open:` variant also matches any open\n Headless UI ancestor, such as an expanded operation in the classic layout.\n -->\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarListbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAgBA,IAAMe,IAAqBd,EAAmBgB,GAAA,YAE7C,GAIKC,IAAiBC,QACrB,OAAO,QAAQF,EAAA,QAAQ,CAAC,CAAC,KAAK,CAACG,GAAKC,QAAc;GAChD,IAAID;GACJ,OAAOE,EAAkBD,CAAO,KAAKD;EACvC,EAAE,CACJ,GAEMG,IAAkBJ,EAA0C;GAChE,WACED,EAAe,MAAM,MAAM,EAAE,YAASM,MAAOT,EAAmB,KAAK;GACvE,MAAM,MAAO,EAAmB,QAAQU,GAAG,MAAM;EACnD,CAAC;E,kBAICvB,EAAA,GAAAC,EAwBgBC,EAAAyB,CAAA,GAAA;GAtBL,YAAAN,EAAA;GAAA,uBAAA,AAAAO,EAAA,QAAA,MAAA,EAAe,QAAAC;GACxB,OAAM;GACL,SAASb,EAAA;GACV,WAAU;GACV,UAAA;;GACA,SAAAb,GAgBe,EAtBL,cAAI,CAMdC,EAgBeF,EAAA8B,CAAA,GAhBf3B,EAgBe;IAfb,OAAM;IACN,eAAY;IACZ,SAAQ;GACAP,GAAAA,EAAAA,MAAM,GAAA;IACd,SAAAK,QAEM,CAFNG,EAEM,OAFNG,GAEMF,EADDc,EAAA,OAAiB,SAAK,mBAAA,GAAA,CAAA,GAM3BjB,EAGkBF,EAAAmC,CAAA,GAAA;KAFhB,OAAK7B,EAAA,CAAC,oDAAkD,EAAA,cAChC+B,EAAI,CAAA,CAAA;KAC5B,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../src/code-example/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AASvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,0BAA0B,EAAE,CAAA;IAC9C,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,+LAa5B,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../src/code-example/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AASvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,0BAA0B,EAAE,CAAA;IAC9C,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,+LAa5B,mBAAmB,KAAG,UA6JxB,CAAA"}
|
|
@@ -80,7 +80,7 @@ var u = ({ includeDefaultHeaders: u = !1, operation: d, contentType: f, method:
|
|
|
80
80
|
let e = T.url.indexOf("#"), t = e === -1 ? "" : T.url.slice(e), n = e === -1 ? T.url : T.url.slice(0, e), r = T.queryString.map(({ name: e, value: t }) => `${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&");
|
|
81
81
|
T.url = `${n}${n.includes("?") ? "&" : "?"}${r}${t}`, T.queryString = [];
|
|
82
82
|
}
|
|
83
|
-
T.postData?.mimeType === "multipart/form-data" && T.postData.params?.
|
|
83
|
+
T.postData?.mimeType === "multipart/form-data" && T.postData.params?.length && (T.headers = T.headers.filter((e) => e.name.toLowerCase() !== "content-type"));
|
|
84
84
|
let j = 0;
|
|
85
85
|
for (let e of T.headers) j += (e.name?.length ?? 0) + 2 + (e.value?.length ?? 0) + 2;
|
|
86
86
|
return T.headersSize = j, T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-to-har.js","names":["operationToHar","defaultHeaders","includeDefaultHeaders","getDefaultHeaders","example","isElectron","APP_VERSION","defaultHeadersWithConventionalNames","restoreConventionalDefaultHeaderNames","disabledGlobalCookies","operation","harRequest","processServerUrl","server","path","name","value","hasCookieStyleEntries","hasSerializedQuery","processedCookieStyleEntries","processedSerializedQuery","processParameters","defaultDisabledParameters","filteredGlobalCookies","globalCookies","filterGlobalCookie","cookie","url","headers","queryString","cookies","body","getResolvedRef","postData","processBody","existingContentTypeHeader","header","hasUriReadyQuery","parameter","securitySchemes","processSecuritySchemes","cookieHeader","extraCookies","hashIndex","hash","query","param","headersSize","h"],"sources":["../../../../src/code-example/helpers/operation-to-har/operation-to-har.ts"],"sourcesContent":["import { isElectron } from '@scalar/helpers/general/is-electron'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n type SecuritySchemeObjectSecret,\n filterGlobalCookie,\n getDefaultHeaders,\n restoreConventionalDefaultHeaderNames,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\nimport { APP_VERSION } from '@/constants'\n\nimport { processBody } from './process-body'\nimport { processParameters } from './process-parameters'\nimport { processSecuritySchemes } from './process-security-schemes'\nimport { processServerUrl } from './process-server-url'\n\nexport type OperationToHarProps = {\n /** OpenAPI Operation object */\n operation: OperationObject\n /** HTTP method of the operation */\n method: string\n /** Path of the operation */\n path: string\n /**\n * Name of the currently selected operation example\n *\n * Applies to both the body and the parameters\n */\n example?: string\n /**\n * Content type of the operation\n *\n * Applies to both the body and the parameters (if applicable)\n * @defaults to the first content type in the MediaTypeObject\n */\n contentType?: string\n /** OpenAPI Server object */\n server?: ServerObject | null\n /** OpenAPI SecurityScheme objects which are applicable to the operation */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /**\n * Whether to include default headers (e.g., Accept, Content-Type) automatically.\n * If false, default headers will be omitted from the HAR request.\n * @default true\n */\n includeDefaultHeaders?: boolean\n /**\n * Selected oneOf/anyOf variants for nested request body example generation\n * (e.g. from the schema dropdowns in the API reference).\n */\n /** Originating OpenAPI version, used for version-specific serialization. */\n openapiVersion?: string\n requestBodyCompositionSelection?: Record<string, number>\n /**\n * Whether to disable parameters by default.\n * @default false\n */\n defaultDisabledParameters?: boolean\n}\n\n/**\n * Converts an OpenAPI Operation to a HarRequest format for generating HTTP request snippets.\n *\n * This function transforms OpenAPI 3.1 operation objects into HAR (HTTP Archive) format requests,\n * which can be used to generate code snippets for various programming languages and HTTP clients.\n *\n * The conversion handles:\n * - Server URL processing and path parameter substitution\n * - Query parameter formatting based on OpenAPI parameter styles\n * - Request body processing with content type handling\n * - Security scheme integration (API keys, etc.)\n *\n * The resulting HarRequest object follows the HAR specification and includes:\n * - HTTP method and URL\n * - Headers and query parameters\n * - Request body (if present)\n * - Cookie information\n * - Size calculations for headers and body\n *\n * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html\n * @see https://spec.openapis.org/oas/v3.1.0#operation-object\n */\nexport const operationToHar = ({\n includeDefaultHeaders = false,\n operation,\n contentType,\n method,\n path,\n server = null,\n example,\n securitySchemes,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n defaultDisabledParameters = false,\n}: OperationToHarProps): HarRequest => {\n const defaultHeaders = includeDefaultHeaders\n ? getDefaultHeaders({\n method,\n operation,\n exampleName: example ?? 'default',\n hideDisabledHeaders: true,\n hideOverriddenHeaders: true,\n options: { isElectron: isElectron(), appVersion: APP_VERSION },\n })\n : {}\n const defaultHeadersWithConventionalNames = restoreConventionalDefaultHeaderNames(defaultHeaders)\n\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[example ?? 'default'] ?? {}\n\n const serverUrl = processServerUrl(server, path)\n\n // Initialize the HAR request with basic properties\n const harRequest: HarRequest = {\n method,\n url: serverUrl,\n headers: Object.entries(defaultHeadersWithConventionalNames).map(([name, value]) => ({ name, value })),\n queryString: [],\n postData: undefined,\n httpVersion: 'HTTP/1.1',\n cookies: [],\n headersSize: -1,\n bodySize: -1,\n }\n\n let hasCookieStyleEntries = false\n let hasSerializedQuery = false\n\n // Handle parameters\n if (operation.parameters) {\n const {\n url,\n headers,\n queryString,\n cookies,\n hasCookieStyleEntries: processedCookieStyleEntries,\n hasSerializedQuery: processedSerializedQuery,\n } = processParameters({\n harRequest,\n parameters: operation.parameters,\n openapiVersion,\n example,\n defaultDisabled: defaultDisabledParameters,\n })\n\n // Correctly filter the global cookies by the processed url\n const filteredGlobalCookies =\n globalCookies\n ?.filter((cookie) => filterGlobalCookie({ cookie, url, disabledGlobalCookies }))\n ?.map((cookie) => ({ name: cookie.name, value: cookie.value })) ?? []\n\n hasCookieStyleEntries = processedCookieStyleEntries\n hasSerializedQuery = processedSerializedQuery ?? false\n harRequest.url = url\n harRequest.headers = headers\n harRequest.queryString = queryString\n harRequest.cookies = [...filteredGlobalCookies, ...cookies]\n }\n\n const body = getResolvedRef(operation.requestBody)\n\n // Handle request body\n if (body?.content) {\n const postData = processBody({\n requestBody: body,\n contentType,\n example,\n openapiVersion,\n requestBodyCompositionSelection,\n })\n\n if (postData) {\n harRequest.postData = postData\n harRequest.bodySize = postData.text?.length ?? -1\n\n // Add or update Content-Type header\n if (postData.mimeType) {\n const existingContentTypeHeader = harRequest.headers.find(\n (header) => header.name.toLowerCase() === 'content-type',\n )\n // Update existing header if it has an empty value\n if (\n existingContentTypeHeader &&\n (!existingContentTypeHeader.value ||\n (postData.mimeType.startsWith('multipart/') &&\n postData.mimeType.includes('boundary=') &&\n postData.text !== undefined))\n ) {\n existingContentTypeHeader.value = postData.mimeType\n }\n // Add new header if none exists\n else if (!existingContentTypeHeader) {\n harRequest.headers.push({\n name: 'Content-Type',\n value: postData.mimeType,\n })\n }\n }\n }\n }\n\n const hasUriReadyQuery =\n hasSerializedQuery || operation.parameters?.some((parameter) => getResolvedRef(parameter)?.in === 'querystring')\n\n // Handle security schemes\n if (securitySchemes) {\n const { headers, queryString, cookies } = processSecuritySchemes(securitySchemes)\n harRequest.headers.push(...headers)\n harRequest.queryString.push(...queryString)\n harRequest.cookies.push(...cookies)\n }\n\n // Keep authentication and global cookies in the explicit header as well, so\n // snippet generators cannot replace cookie-style parameters with their own header.\n const cookieHeader = harRequest.headers.find((header) => header.name.toLowerCase() === 'cookie')\n if (hasCookieStyleEntries && cookieHeader && harRequest.cookies.length) {\n const extraCookies = harRequest.cookies\n .map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`)\n .join('; ')\n cookieHeader.value = cookieHeader.value ? `${cookieHeader.value}; ${extraCookies}` : extraCookies\n harRequest.cookies = []\n }\n\n // Whole-query content and serialized examples must retain their authored URI encoding.\n // Keeping all query data in the URL avoids snippet generators introducing a second question mark.\n if (hasUriReadyQuery && harRequest.queryString.length) {\n const hashIndex = harRequest.url.indexOf('#')\n const hash = hashIndex === -1 ? '' : harRequest.url.slice(hashIndex)\n const url = hashIndex === -1 ? harRequest.url : harRequest.url.slice(0, hashIndex)\n const query = harRequest.queryString\n .map(({ name, value }) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`)\n .join('&')\n harRequest.url = `${url}${url.includes('?') ? '&' : '?'}${query}${hash}`\n harRequest.queryString = []\n }\n\n // Multipart file parts are encoded by the HTTP client, which owns the boundary.\n // Raw multipart text already has its boundary and must retain its Content-Type.\n if (\n harRequest.postData?.mimeType === 'multipart/form-data' &&\n harRequest.postData.params?.some((param) => param.fileName !== undefined)\n ) {\n harRequest.headers = harRequest.headers.filter((header) => header.name.toLowerCase() !== 'content-type')\n }\n\n // Calculate headers size without allocating a large joined string\n let headersSize = 0\n for (const h of harRequest.headers) {\n // name + \": \" + value + \"\\r\\n\"\n headersSize += (h.name?.length ?? 0) + 2 + (h.value?.length ?? 0) + 2\n }\n harRequest.headersSize = headersSize\n\n return harRequest\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"operation-to-har.js","names":["operationToHar","defaultHeaders","includeDefaultHeaders","getDefaultHeaders","example","isElectron","APP_VERSION","defaultHeadersWithConventionalNames","restoreConventionalDefaultHeaderNames","disabledGlobalCookies","operation","harRequest","processServerUrl","server","path","name","value","hasCookieStyleEntries","hasSerializedQuery","processedCookieStyleEntries","processedSerializedQuery","processParameters","defaultDisabledParameters","filteredGlobalCookies","globalCookies","filterGlobalCookie","cookie","url","headers","queryString","cookies","body","getResolvedRef","postData","processBody","existingContentTypeHeader","header","hasUriReadyQuery","parameter","securitySchemes","processSecuritySchemes","cookieHeader","extraCookies","hashIndex","hash","query","headersSize","h"],"sources":["../../../../src/code-example/helpers/operation-to-har/operation-to-har.ts"],"sourcesContent":["import { isElectron } from '@scalar/helpers/general/is-electron'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n type SecuritySchemeObjectSecret,\n filterGlobalCookie,\n getDefaultHeaders,\n restoreConventionalDefaultHeaderNames,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\nimport { APP_VERSION } from '@/constants'\n\nimport { processBody } from './process-body'\nimport { processParameters } from './process-parameters'\nimport { processSecuritySchemes } from './process-security-schemes'\nimport { processServerUrl } from './process-server-url'\n\nexport type OperationToHarProps = {\n /** OpenAPI Operation object */\n operation: OperationObject\n /** HTTP method of the operation */\n method: string\n /** Path of the operation */\n path: string\n /**\n * Name of the currently selected operation example\n *\n * Applies to both the body and the parameters\n */\n example?: string\n /**\n * Content type of the operation\n *\n * Applies to both the body and the parameters (if applicable)\n * @defaults to the first content type in the MediaTypeObject\n */\n contentType?: string\n /** OpenAPI Server object */\n server?: ServerObject | null\n /** OpenAPI SecurityScheme objects which are applicable to the operation */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /**\n * Whether to include default headers (e.g., Accept, Content-Type) automatically.\n * If false, default headers will be omitted from the HAR request.\n * @default true\n */\n includeDefaultHeaders?: boolean\n /**\n * Selected oneOf/anyOf variants for nested request body example generation\n * (e.g. from the schema dropdowns in the API reference).\n */\n /** Originating OpenAPI version, used for version-specific serialization. */\n openapiVersion?: string\n requestBodyCompositionSelection?: Record<string, number>\n /**\n * Whether to disable parameters by default.\n * @default false\n */\n defaultDisabledParameters?: boolean\n}\n\n/**\n * Converts an OpenAPI Operation to a HarRequest format for generating HTTP request snippets.\n *\n * This function transforms OpenAPI 3.1 operation objects into HAR (HTTP Archive) format requests,\n * which can be used to generate code snippets for various programming languages and HTTP clients.\n *\n * The conversion handles:\n * - Server URL processing and path parameter substitution\n * - Query parameter formatting based on OpenAPI parameter styles\n * - Request body processing with content type handling\n * - Security scheme integration (API keys, etc.)\n *\n * The resulting HarRequest object follows the HAR specification and includes:\n * - HTTP method and URL\n * - Headers and query parameters\n * - Request body (if present)\n * - Cookie information\n * - Size calculations for headers and body\n *\n * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html\n * @see https://spec.openapis.org/oas/v3.1.0#operation-object\n */\nexport const operationToHar = ({\n includeDefaultHeaders = false,\n operation,\n contentType,\n method,\n path,\n server = null,\n example,\n securitySchemes,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n defaultDisabledParameters = false,\n}: OperationToHarProps): HarRequest => {\n const defaultHeaders = includeDefaultHeaders\n ? getDefaultHeaders({\n method,\n operation,\n exampleName: example ?? 'default',\n hideDisabledHeaders: true,\n hideOverriddenHeaders: true,\n options: { isElectron: isElectron(), appVersion: APP_VERSION },\n })\n : {}\n const defaultHeadersWithConventionalNames = restoreConventionalDefaultHeaderNames(defaultHeaders)\n\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[example ?? 'default'] ?? {}\n\n const serverUrl = processServerUrl(server, path)\n\n // Initialize the HAR request with basic properties\n const harRequest: HarRequest = {\n method,\n url: serverUrl,\n headers: Object.entries(defaultHeadersWithConventionalNames).map(([name, value]) => ({ name, value })),\n queryString: [],\n postData: undefined,\n httpVersion: 'HTTP/1.1',\n cookies: [],\n headersSize: -1,\n bodySize: -1,\n }\n\n let hasCookieStyleEntries = false\n let hasSerializedQuery = false\n\n // Handle parameters\n if (operation.parameters) {\n const {\n url,\n headers,\n queryString,\n cookies,\n hasCookieStyleEntries: processedCookieStyleEntries,\n hasSerializedQuery: processedSerializedQuery,\n } = processParameters({\n harRequest,\n parameters: operation.parameters,\n openapiVersion,\n example,\n defaultDisabled: defaultDisabledParameters,\n })\n\n // Correctly filter the global cookies by the processed url\n const filteredGlobalCookies =\n globalCookies\n ?.filter((cookie) => filterGlobalCookie({ cookie, url, disabledGlobalCookies }))\n ?.map((cookie) => ({ name: cookie.name, value: cookie.value })) ?? []\n\n hasCookieStyleEntries = processedCookieStyleEntries\n hasSerializedQuery = processedSerializedQuery ?? false\n harRequest.url = url\n harRequest.headers = headers\n harRequest.queryString = queryString\n harRequest.cookies = [...filteredGlobalCookies, ...cookies]\n }\n\n const body = getResolvedRef(operation.requestBody)\n\n // Handle request body\n if (body?.content) {\n const postData = processBody({\n requestBody: body,\n contentType,\n example,\n openapiVersion,\n requestBodyCompositionSelection,\n })\n\n if (postData) {\n harRequest.postData = postData\n harRequest.bodySize = postData.text?.length ?? -1\n\n // Add or update Content-Type header\n if (postData.mimeType) {\n const existingContentTypeHeader = harRequest.headers.find(\n (header) => header.name.toLowerCase() === 'content-type',\n )\n // Update existing header if it has an empty value\n if (\n existingContentTypeHeader &&\n (!existingContentTypeHeader.value ||\n (postData.mimeType.startsWith('multipart/') &&\n postData.mimeType.includes('boundary=') &&\n postData.text !== undefined))\n ) {\n existingContentTypeHeader.value = postData.mimeType\n }\n // Add new header if none exists\n else if (!existingContentTypeHeader) {\n harRequest.headers.push({\n name: 'Content-Type',\n value: postData.mimeType,\n })\n }\n }\n }\n }\n\n const hasUriReadyQuery =\n hasSerializedQuery || operation.parameters?.some((parameter) => getResolvedRef(parameter)?.in === 'querystring')\n\n // Handle security schemes\n if (securitySchemes) {\n const { headers, queryString, cookies } = processSecuritySchemes(securitySchemes)\n harRequest.headers.push(...headers)\n harRequest.queryString.push(...queryString)\n harRequest.cookies.push(...cookies)\n }\n\n // Keep authentication and global cookies in the explicit header as well, so\n // snippet generators cannot replace cookie-style parameters with their own header.\n const cookieHeader = harRequest.headers.find((header) => header.name.toLowerCase() === 'cookie')\n if (hasCookieStyleEntries && cookieHeader && harRequest.cookies.length) {\n const extraCookies = harRequest.cookies\n .map((cookie) => `${encodeURIComponent(cookie.name)}=${encodeURIComponent(cookie.value)}`)\n .join('; ')\n cookieHeader.value = cookieHeader.value ? `${cookieHeader.value}; ${extraCookies}` : extraCookies\n harRequest.cookies = []\n }\n\n // Whole-query content and serialized examples must retain their authored URI encoding.\n // Keeping all query data in the URL avoids snippet generators introducing a second question mark.\n if (hasUriReadyQuery && harRequest.queryString.length) {\n const hashIndex = harRequest.url.indexOf('#')\n const hash = hashIndex === -1 ? '' : harRequest.url.slice(hashIndex)\n const url = hashIndex === -1 ? harRequest.url : harRequest.url.slice(0, hashIndex)\n const query = harRequest.queryString\n .map(({ name, value }) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`)\n .join('&')\n harRequest.url = `${url}${url.includes('?') ? '&' : '?'}${query}${hash}`\n harRequest.queryString = []\n }\n\n // Structured multipart parts (with or without files) are encoded by the HTTP client, which owns the boundary.\n // Raw multipart text already has its boundary and must retain its Content-Type.\n if (harRequest.postData?.mimeType === 'multipart/form-data' && harRequest.postData.params?.length) {\n harRequest.headers = harRequest.headers.filter((header) => header.name.toLowerCase() !== 'content-type')\n }\n\n // Calculate headers size without allocating a large joined string\n let headersSize = 0\n for (const h of harRequest.headers) {\n // name + \": \" + value + \"\\r\\n\"\n headersSize += (h.name?.length ?? 0) + 2 + (h.value?.length ?? 0) + 2\n }\n harRequest.headersSize = headersSize\n\n return harRequest\n}\n"],"mappings":";;;;;;;;;AAuFA,IAAaA,KAAkB,EAC7B,2BAAwB,IACxB,cACA,gBACA,WACA,SACA,YAAS,MACT,YACA,oBACA,kBACA,mBACA,oCACA,+BAA4B,SACS;CACrC,IAAMC,IAAiBC,IACnBC,EAAkB;EAChB;EACA;EACA,aAAaC,KAAW;EACxB,qBAAqB;EACrB,uBAAuB;EACvB,SAAS;GAAE,YAAYC,EAAW;GAAG,YAAYC;EAAY;CAC/D,CAAC,IACD,CAAC,GACCC,IAAsCC,EAAsCP,CAAc,GAE1FQ,IACJC,EAAU,8BAA8B,GAAG,iBAAiB,GAAGN,KAAW,cAAc,CAAC,GAKrFO,IAAyB;EAC7B;EACA,KALgBC,EAAiBC,GAAQC,CAKpC;EACL,SAAS,OAAO,QAAQP,CAAmC,CAAC,CAAC,KAAK,CAACQ,GAAMC,QAAY;GAAE;GAAM;EAAM,EAAE;EACrG,aAAa,CAAC;EACd,UAAU,KAAA;EACV,aAAa;EACb,SAAS,CAAC;EACV,aAAa;EACb,UAAU;CACZ,GAEIC,IAAwB,IACxBC,IAAqB;CAGzB,IAAIR,EAAU,YAAY;EACxB,IAAM,EACJ,QACA,YACA,gBACA,YACA,uBAAuBS,GACvB,oBAAoBC,MAClBC,EAAkB;GACpB;GACA,YAAYX,EAAU;GACtB;GACA;GACA,iBAAiBY;EACnB,CAAC,GAGKC,IACJC,GACI,QAAQ,MAAWC,EAAmB;GAAE;GAAQ;GAAK;EAAsB,CAAC,CAAC,CAAC,EAC9E,KAAK,OAAY;GAAE,MAAMC,EAAO;GAAM,OAAOA,EAAO;EAAM,EAAE,KAAK,CAAC;EAOxE,AALA,IAAwBP,GACxB,IAAqBC,KAA4B,IACjD,EAAW,MAAMO,GACjB,EAAW,UAAUC,GACrB,EAAW,cAAcC,GACzB,EAAW,UAAU,CAAC,GAAGN,GAAuB,GAAGO,CAAO;CAC5D;CAEA,IAAMC,IAAOC,EAAetB,EAAU,WAAW;CAGjD,IAAIqB,GAAM,SAAS;EACjB,IAAME,IAAWC,EAAY;GAC3B,aAAaH;GACb;GACA;GACA;GACA;EACF,CAAC;EAED,IAAIE,MACF,EAAW,WAAWA,GACtB,EAAW,WAAWA,EAAS,MAAM,UAAU,IAG3CA,EAAS,WAAU;GACrB,IAAME,IAA4BxB,EAAW,QAAQ,MAClD,MAAWyB,EAAO,KAAK,YAAY,MAAM,cAC5C;GAEA,AACED,MACC,CAACA,EAA0B,SACzBF,EAAS,SAAS,WAAW,YAAY,KACxCA,EAAS,SAAS,SAAS,WAAW,KACtCA,EAAS,SAAS,KAAA,KAEtB,EAA0B,QAAQA,EAAS,WAGnCE,KACRxB,EAAW,QAAQ,KAAK;IACtB,MAAM;IACN,OAAOsB,EAAS;GAClB,CAAC;EAEL;CAEJ;CAEA,IAAMI,IACJnB,KAAsBR,EAAU,YAAY,MAAM,MAAcsB,EAAeM,CAAS,CAAC,EAAE,OAAO,aAAa;CAGjH,IAAIC,GAAiB;EACnB,IAAM,EAAE,YAAS,gBAAa,eAAYC,EAAuBD,CAAe;EAGhF,AAFA5B,EAAW,QAAQ,KAAK,GAAGiB,CAAO,GAClCjB,EAAW,YAAY,KAAK,GAAGkB,CAAW,GAC1ClB,EAAW,QAAQ,KAAK,GAAGmB,CAAO;CACpC;CAIA,IAAMW,IAAe9B,EAAW,QAAQ,MAAM,MAAWyB,EAAO,KAAK,YAAY,MAAM,QAAQ;CAC/F,IAAInB,KAAyBwB,KAAgB9B,EAAW,QAAQ,QAAQ;EACtE,IAAM+B,IAAe/B,EAAW,QAC7B,KAAK,MAAW,GAAG,mBAAmBe,EAAO,IAAI,EAAE,GAAG,mBAAmBA,EAAO,KAAK,GAAG,CAAC,CACzF,KAAK,IAAI;EAEZ,AADA,EAAa,QAAQe,EAAa,QAAQ,GAAGA,EAAa,MAAM,IAAIC,MAAiBA,GACrF,EAAW,UAAU,CAAC;CACxB;CAIA,IAAIL,KAAoB1B,EAAW,YAAY,QAAQ;EACrD,IAAMgC,IAAYhC,EAAW,IAAI,QAAQ,GAAG,GACtCiC,IAAOD,MAAc,KAAK,KAAKhC,EAAW,IAAI,MAAMgC,CAAS,GAC7DhB,IAAMgB,MAAc,KAAKhC,EAAW,MAAMA,EAAW,IAAI,MAAM,GAAGgC,CAAS,GAC3EE,IAAQlC,EAAW,YACtB,KAAK,EAAE,SAAM,eAAY,GAAG,mBAAmBI,CAAI,EAAE,GAAG,mBAAmBC,CAAK,GAAG,CAAC,CACpF,KAAK,GAAG;EAEX,AADA,EAAW,MAAM,GAAGW,IAAMA,EAAI,SAAS,GAAG,IAAI,MAAM,MAAMkB,IAAQD,KAClE,EAAW,cAAc,CAAC;CAC5B;CAIA,AAAIjC,EAAW,UAAU,aAAa,yBAAyBA,EAAW,SAAS,QAAQ,WACzF,EAAW,UAAUA,EAAW,QAAQ,QAAQ,MAAWyB,EAAO,KAAK,YAAY,MAAM,cAAc;CAIzG,IAAIU,IAAc;CAClB,KAAK,IAAMC,KAAKpC,EAAW,SAEzB,MAAgBoC,EAAE,MAAM,UAAU,KAAK,KAAKA,EAAE,OAAO,UAAU,KAAK;CAItE,OAFA,EAAW,cAAcD,GAElBnC;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/code-example/mount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAOpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/code-example/mount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAOpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAEzF,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,EAAE,KAAK,GAAG,EAA0B,MAAM,KAAK,CAAA;AAItD,OAAO,EAAE,KAAK,gCAAgC,EAA6B,MAAM,kBAAkB,CAAA;AAEnG,MAAM,MAAM,wBAAwB,GAAG;IACrC,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,yEAAyE;IACzE,KAAK,EAAE,cAAc,CAAA;IACrB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACpC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oDAAoD;IACpD,eAAe,CAAC,EAAE,0BAA0B,EAAE,CAAA;IAC9C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAkBD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,IAAI,WAAW,GAAG,MAAM,EACxB,SAAS,wBAAwB,GAAG,gCAAgC,KACnE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CA+IjC,CAAA"}
|
|
@@ -10,63 +10,64 @@ import { ScalarTeleportRoot as u } from "@scalar/components/teleport";
|
|
|
10
10
|
import { getPathItemOperation as d } from "@scalar/workspace-store/helpers/for-each-path-item-operation";
|
|
11
11
|
import { getFirstServer as f } from "@scalar/workspace-store/helpers/get-first-server";
|
|
12
12
|
import { generateClientMutators as p } from "@scalar/workspace-store/mutators";
|
|
13
|
+
import { isOpenApiDocument as m } from "@scalar/workspace-store/schemas/type-guards";
|
|
13
14
|
//#region src/code-example/mount.ts
|
|
14
|
-
var
|
|
15
|
-
if ("operationName" in
|
|
16
|
-
let
|
|
17
|
-
if (!
|
|
18
|
-
let
|
|
19
|
-
let e =
|
|
20
|
-
if (!
|
|
21
|
-
let t = s(e.paths?.[
|
|
15
|
+
var h = (e) => e === !0 ? "scalar-app dark-mode" : e === !1 ? "scalar-app light-mode" : "scalar-app", g = (g, _) => {
|
|
16
|
+
if ("operationName" in _) return n(g, _);
|
|
17
|
+
let v = typeof g == "string" ? document.querySelector(g) : g;
|
|
18
|
+
if (!v) throw Error(`Element not found: ${g}`);
|
|
19
|
+
let y = c(), b = e(), x = p(_.store), S = y.on("workspace:update:selected-client", (e) => x.workspace().workspace.updateSelectedClient(e)), C = y.on("workspace:update:selected-example", (e) => x.workspace().workspace.updateSelectedExample(e)), w = () => {
|
|
20
|
+
let e = _.store.workspace.activeDocument;
|
|
21
|
+
if (!m(e)) return;
|
|
22
|
+
let t = s(e.paths?.[_.path]), n = s(d(t, _.method));
|
|
22
23
|
if (n) return {
|
|
23
24
|
operation: n,
|
|
24
25
|
server: f(n.servers ?? null, t?.servers ?? null, e.servers ?? null)
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
|
-
if (!
|
|
28
|
-
let
|
|
29
|
-
let e =
|
|
30
|
-
return e && (
|
|
31
|
-
},
|
|
28
|
+
if (!w()) throw Error(`Operation not found: ${_.method.toUpperCase()} ${_.path}`);
|
|
29
|
+
let T, E = () => {
|
|
30
|
+
let e = w();
|
|
31
|
+
return e && (T = e), e ?? T;
|
|
32
|
+
}, D = a({
|
|
32
33
|
get codeSampleUnavailable() {
|
|
33
|
-
return
|
|
34
|
+
return _.codeSampleUnavailable;
|
|
34
35
|
},
|
|
35
36
|
get codeSampleLabel() {
|
|
36
|
-
return
|
|
37
|
+
return _.codeSampleLabel;
|
|
37
38
|
},
|
|
38
39
|
get operation() {
|
|
39
|
-
return
|
|
40
|
+
return E().operation;
|
|
40
41
|
},
|
|
41
42
|
get method() {
|
|
42
|
-
return
|
|
43
|
+
return _.method;
|
|
43
44
|
},
|
|
44
45
|
get path() {
|
|
45
|
-
return
|
|
46
|
+
return _.path;
|
|
46
47
|
},
|
|
47
|
-
clientOptions:
|
|
48
|
-
eventBus:
|
|
48
|
+
clientOptions: b,
|
|
49
|
+
eventBus: y,
|
|
49
50
|
get securitySchemes() {
|
|
50
|
-
return
|
|
51
|
+
return _.securitySchemes ?? [];
|
|
51
52
|
},
|
|
52
53
|
get selectedClient() {
|
|
53
|
-
return
|
|
54
|
+
return _.store.workspace["x-scalar-default-client"] ?? _.selectedClient;
|
|
54
55
|
},
|
|
55
56
|
get selectedExample() {
|
|
56
|
-
return
|
|
57
|
+
return _.store.workspace["x-scalar-default-example"] ?? _.selectedExample;
|
|
57
58
|
},
|
|
58
59
|
get selectedServer() {
|
|
59
|
-
return
|
|
60
|
+
return _.selectedServer === void 0 ? E().server : _.selectedServer;
|
|
60
61
|
}
|
|
61
|
-
}),
|
|
62
|
-
return
|
|
63
|
-
app:
|
|
62
|
+
}), O = () => i("span", { class: "font-code text-c-2 min-w-0" }, i(o, { text: _.path })), k = r(() => i("div", { class: h(_.darkMode) }, [i(u, null, { default: () => i(t, D, { header: O }) })]));
|
|
63
|
+
return k.provide(l, () => _.store.externalExamples()), k.mount(v), {
|
|
64
|
+
app: k,
|
|
64
65
|
destroy: () => {
|
|
65
|
-
|
|
66
|
+
S(), C(), k.unmount();
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
};
|
|
69
70
|
//#endregion
|
|
70
|
-
export {
|
|
71
|
+
export { g as createCodeExample };
|
|
71
72
|
|
|
72
73
|
//# sourceMappingURL=mount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","names":["CodeExample","CodeExample_default","getWrapperClass","darkMode","createCodeExample","options","createAsyncApiCodeExample","el","element","eventBus","createWorkspaceEventBus","clientOptions","generateClientOptions","mutators","generateClientMutators","unsubscribeClient","payload","unsubscribeExample","resolveContext","activeDocument","pathItem","getResolvedRef","operation","getPathItemOperation","getFirstServer","lastContext","currentContext","context","props","reactive","renderHeader","h","ScalarWrappingText","app","createApp","ScalarTeleportRoot","EXTERNAL_EXAMPLES"],"sources":["../../src/code-example/mount.ts"],"sourcesContent":["import { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport type { AvailableClients } from '@scalar/snippetz'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getFirstServer } from '@scalar/workspace-store/helpers/get-first-server'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { EXTERNAL_EXAMPLES } from '@scalar/workspace-store/helpers/use-external-examples'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { type App, createApp, h, reactive } from 'vue'\n\nimport CodeExample, { type CodeExampleProps } from './components/CodeExample.vue'\nimport { generateClientOptions } from './helpers/generate-client-options'\nimport { type CreateAsyncApiCodeExampleOptions, createAsyncApiCodeExample } from './mount-asyncapi'\n\nexport type CreateCodeExampleOptions = {\n /** Localized status text shown when the selected example has no linked code sample. */\n codeSampleUnavailable?: string\n /** Localized accessible name for the focusable code sample scroller. */\n codeSampleLabel?: string\n /** Workspace store that holds the OpenAPI document(s) to render from. */\n store: WorkspaceStore\n /** Path of the operation to render, e.g. '/users/{id}'. */\n path: string\n /** HTTP method of the operation to render. */\n method: string\n /** Pre-selected client ID, e.g. 'shell/curl'. */\n selectedClient?: AvailableClients[number]\n /**\n * Server object override used to build the example request.\n *\n * When omitted, the server is derived from the active document (operation,\n * then path item, then document level), mirroring the API reference. Pass\n * `null` to force \"no server\".\n */\n selectedServer?: ServerObject | null\n /**\n * Pre-selected example key for parameters and the request body.\n *\n * The store is the source of truth once an example is picked, so\n * `x-scalar-default-example` wins over this initial seed and the selection\n * round-trips through the store like the client selection does.\n */\n selectedExample?: string\n /** Security schemes applicable to the operation. */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /**\n * Force a color mode on the rendered block.\n *\n * When omitted, the block inherits the ambient theme of the host page.\n * Pass `true` for dark mode or `false` for light mode.\n */\n darkMode?: boolean\n}\n\n/**\n * Builds the wrapper classes for the mounted block.\n *\n * The `.scalar-app` class scopes the Tailwind utilities, and the optional\n * color-mode class lets consumers pin the block to dark or light.\n */\nconst getWrapperClass = (darkMode: boolean | undefined): string => {\n if (darkMode === true) {\n return 'scalar-app dark-mode'\n }\n if (darkMode === false) {\n return 'scalar-app light-mode'\n }\n return 'scalar-app'\n}\n\n/**\n * Mount the CodeExample block to a DOM element without Vue.\n *\n * The consumer creates and controls their own workspace store,\n * then passes it in along with the path and method to render.\n */\nexport const createCodeExample = (\n el: HTMLElement | string,\n options: CreateCodeExampleOptions | CreateAsyncApiCodeExampleOptions,\n): { app: App; destroy: () => void } => {\n if ('operationName' in options) return createAsyncApiCodeExample(el, options)\n\n const element = typeof el === 'string' ? document.querySelector(el) : el\n if (!element) {\n throw new Error(`Element not found: ${el}`)\n }\n\n const eventBus = createWorkspaceEventBus()\n const clientOptions = generateClientOptions()\n\n // Persist client changes back to the store. The block emits\n // `workspace:update:selected-client` on its private bus when the user picks a\n // client; without this subscription the choice would never reach the store\n // and `x-scalar-default-client` (the source of truth read below) would stay\n // stale, so the selection would not survive a re-render or be shared with\n // other blocks reading from the same store.\n const mutators = generateClientMutators(options.store)\n const unsubscribeClient = eventBus.on('workspace:update:selected-client', (payload) =>\n mutators.workspace().workspace.updateSelectedClient(payload),\n )\n\n // Persist example changes back to the store as well, mirroring the client\n // round-trip above. The block emits `workspace:update:selected-example` when\n // the user picks an example; without this the choice would never reach\n // `x-scalar-default-example` (read below) and would neither survive a\n // re-render nor sync to other blocks reading from the same store.\n const unsubscribeExample = eventBus.on('workspace:update:selected-example', (payload) =>\n mutators.workspace().workspace.updateSelectedExample(payload),\n )\n\n type OperationContext = { operation: OperationObject; server: ServerObject | null }\n\n /**\n * Resolve the operation and its effective server from the active document.\n *\n * The server is resolved from the same document the operation came from\n * (operation, then path item, then document level), so a snippet never pairs\n * an operation with a server URL from a different spec.\n */\n const resolveContext = (): OperationContext | undefined => {\n // The active document may be an AsyncAPI document, which has no `paths`.\n const activeDocument = options.store.workspace.activeDocument\n if (!activeDocument || !('paths' in activeDocument)) {\n return undefined\n }\n const pathItem = getResolvedRef(activeDocument.paths?.[options.path])\n const operation = getResolvedRef(getPathItemOperation(pathItem, options.method))\n if (!operation) {\n return undefined\n }\n const server = getFirstServer(operation.servers ?? null, pathItem?.servers ?? null, activeDocument.servers ?? null)\n return { operation, server }\n }\n\n // Fail loudly if the path and method do not point at an operation in the store,\n // mirroring the \"element not found\" guard above.\n if (!resolveContext()) {\n throw new Error(`Operation not found: ${options.method.toUpperCase()} ${options.path}`)\n }\n\n // Remember the last context that resolved so a transient miss (e.g. the active\n // document is swapped to one without this path or method after mount) keeps\n // rendering the previous operation, paired with the server it actually came\n // from, instead of feeding `undefined` to the block.\n let lastContext: OperationContext | undefined\n\n /** Current operation + server, falling back to the last good resolution on a transient miss. */\n const currentContext = (): OperationContext => {\n const context = resolveContext()\n if (context) {\n lastContext = context\n }\n return (context ?? lastContext) as OperationContext\n }\n\n // Props are getters so the block tracks the reactive store (active document,\n // `x-scalar-default-client`, `x-scalar-default-example`) live. Change the\n // client, example, or server through the store to drive re-renders.\n const props = reactive<CodeExampleProps>({\n get codeSampleUnavailable() {\n return options.codeSampleUnavailable\n },\n get codeSampleLabel() {\n return options.codeSampleLabel\n },\n get operation(): OperationObject {\n return currentContext().operation\n },\n get method() {\n return options.method\n },\n get path() {\n return options.path\n },\n clientOptions,\n eventBus,\n get securitySchemes() {\n return options.securitySchemes ?? []\n },\n get selectedClient() {\n // The store is the source of truth once the user picks a client, so it\n // wins over the initial `options.selectedClient` seed and the selection\n // round-trips through the subscription above.\n return options.store.workspace['x-scalar-default-client'] ?? options.selectedClient\n },\n get selectedExample() {\n // Same as the client: the store wins over the initial seed so the example\n // selection survives re-renders and syncs across blocks.\n return options.store.workspace['x-scalar-default-example'] ?? options.selectedExample\n },\n get selectedServer() {\n // An explicit option wins (including an explicit `null` for \"no server\");\n // otherwise derive it from the same document the operation resolved from.\n return options.selectedServer !== undefined ? options.selectedServer : currentContext().server\n },\n })\n\n // Render the operation path in the header by default. The reference renders\n // this via the `#header` slot too, so the standalone block matches its look.\n const renderHeader = () =>\n h('span', { class: 'font-code text-c-2 min-w-0' }, h(ScalarWrappingText, { text: options.path }))\n\n // Wrap the block in its own teleport root so floating UI (the client picker\n // popover) renders inside the themed `.scalar-app` wrapper instead of escaping\n // to `body`, where it would miss the color-mode variables and lose its styling.\n const app = createApp(() =>\n h('div', { class: getWrapperClass(options.darkMode) }, [\n h(ScalarTeleportRoot, null, { default: () => h(CodeExample, props, { header: renderHeader }) }),\n ]),\n )\n\n app.provide(EXTERNAL_EXAMPLES, () => options.store.externalExamples())\n app.mount(element)\n\n return {\n app,\n destroy: () => {\n unsubscribeClient()\n unsubscribeExample()\n app.unmount()\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAgEA,IAAME,KAAmB,MACnBC,MAAa,KACR,yBAELA,MAAa,KACR,0BAEF,cASIC,KACX,GACA,MACsC;CACtC,IAAI,mBAAmBC,GAAS,OAAOC,EAA0BC,GAAIF,CAAO;CAE5E,IAAMG,IAAU,OAAOD,KAAO,WAAW,SAAS,cAAcA,CAAE,IAAIA;CACtE,IAAI,CAACC,GACH,MAAU,MAAM,sBAAsBD,GAAI;CAG5C,IAAME,IAAWC,EAAwB,GACnCC,IAAgBC,EAAsB,GAQtCC,IAAWC,EAAuBT,EAAQ,KAAK,GAC/CU,IAAoBN,EAAS,GAAG,qCAAqC,MACzEI,EAAS,UAAU,CAAC,CAAC,UAAU,qBAAqBG,CAAO,CAC7D,GAOMC,IAAqBR,EAAS,GAAG,sCAAsC,MAC3EI,EAAS,UAAU,CAAC,CAAC,UAAU,sBAAsBG,CAAO,CAC9D,GAWME,UAAqD;EAEzD,IAAMC,IAAiBd,EAAQ,MAAM,UAAU;EAC/C,IAAI,CAACc,KAAkB,EAAE,WAAWA,IAClC;EAEF,IAAMC,IAAWC,EAAeF,EAAe,QAAQd,EAAQ,KAAK,GAC9DiB,IAAYD,EAAeE,EAAqBH,GAAUf,EAAQ,MAAM,CAAC;EAC/E,IAAKiB,GAIL,OAAO;GAAE;GAAW,QADLE,EAAeF,EAAU,WAAW,MAAMF,GAAU,WAAW,MAAMD,EAAe,WAAW,IAC1F;EAAO;CAC7B;CAIA,IAAI,CAACD,EAAe,GAClB,MAAU,MAAM,wBAAwBb,EAAQ,OAAO,YAAY,EAAE,GAAGA,EAAQ,MAAM;CAOxF,IAAIoB,GAGEC,UAAyC;EAC7C,IAAMC,IAAUT,EAAe;EAI/B,OAHIS,MACF,IAAcA,IAERA,KAAWF;CACrB,GAKMG,IAAQC,EAA2B;EACvC,IAAI,wBAAwB;GAC1B,OAAOxB,EAAQ;EACjB;EACA,IAAI,kBAAkB;GACpB,OAAOA,EAAQ;EACjB;EACA,IAAI,YAA6B;GAC/B,OAAOqB,EAAe,CAAC,CAAC;EAC1B;EACA,IAAI,SAAS;GACX,OAAOrB,EAAQ;EACjB;EACA,IAAI,OAAO;GACT,OAAOA,EAAQ;EACjB;EACA;EACA;EACA,IAAI,kBAAkB;GACpB,OAAOA,EAAQ,mBAAmB,CAAC;EACrC;EACA,IAAI,iBAAiB;GAInB,OAAOA,EAAQ,MAAM,UAAU,8BAA8BA,EAAQ;EACvE;EACA,IAAI,kBAAkB;GAGpB,OAAOA,EAAQ,MAAM,UAAU,+BAA+BA,EAAQ;EACxE;EACA,IAAI,iBAAiB;GAGnB,OAAOA,EAAQ,mBAAmB,KAAA,IAAqCqB,EAAe,CAAC,CAAC,SAA1CrB,EAAQ;EACxD;CACF,CAAC,GAIKyB,UACJC,EAAE,QAAQ,EAAE,OAAO,6BAA6B,GAAGA,EAAEC,GAAoB,EAAE,MAAM3B,EAAQ,KAAK,CAAC,CAAC,GAK5F4B,IAAMC,QACVH,EAAE,OAAO,EAAE,OAAO7B,EAAgBG,EAAQ,QAAQ,EAAE,GAAG,CACrD0B,EAAEI,GAAoB,MAAM,EAAE,eAAeJ,EAAE/B,GAAa4B,GAAO,EAAE,QAAQE,EAAa,CAAC,EAAE,CAAC,CAChG,CAAC,CACH;CAKA,OAHAG,EAAI,QAAQG,SAAyB/B,EAAQ,MAAM,iBAAiB,CAAC,GACrE4B,EAAI,MAAMzB,CAAO,GAEV;EACL;EACA,eAAe;GAGb,AAFAO,EAAkB,GAClBE,EAAmB,GACnBgB,EAAI,QAAQ;EACd;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"mount.js","names":["CodeExample","CodeExample_default","getWrapperClass","darkMode","createCodeExample","options","createAsyncApiCodeExample","el","element","eventBus","createWorkspaceEventBus","clientOptions","generateClientOptions","mutators","generateClientMutators","unsubscribeClient","payload","unsubscribeExample","resolveContext","activeDocument","isOpenApiDocument","pathItem","getResolvedRef","operation","getPathItemOperation","getFirstServer","lastContext","currentContext","context","props","reactive","renderHeader","h","ScalarWrappingText","app","createApp","ScalarTeleportRoot","EXTERNAL_EXAMPLES"],"sources":["../../src/code-example/mount.ts"],"sourcesContent":["import { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport type { AvailableClients } from '@scalar/snippetz'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getFirstServer } from '@scalar/workspace-store/helpers/get-first-server'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { EXTERNAL_EXAMPLES } from '@scalar/workspace-store/helpers/use-external-examples'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { type App, createApp, h, reactive } from 'vue'\n\nimport CodeExample, { type CodeExampleProps } from './components/CodeExample.vue'\nimport { generateClientOptions } from './helpers/generate-client-options'\nimport { type CreateAsyncApiCodeExampleOptions, createAsyncApiCodeExample } from './mount-asyncapi'\n\nexport type CreateCodeExampleOptions = {\n /** Localized status text shown when the selected example has no linked code sample. */\n codeSampleUnavailable?: string\n /** Localized accessible name for the focusable code sample scroller. */\n codeSampleLabel?: string\n /** Workspace store that holds the OpenAPI document(s) to render from. */\n store: WorkspaceStore\n /** Path of the operation to render, e.g. '/users/{id}'. */\n path: string\n /** HTTP method of the operation to render. */\n method: string\n /** Pre-selected client ID, e.g. 'shell/curl'. */\n selectedClient?: AvailableClients[number]\n /**\n * Server object override used to build the example request.\n *\n * When omitted, the server is derived from the active document (operation,\n * then path item, then document level), mirroring the API reference. Pass\n * `null` to force \"no server\".\n */\n selectedServer?: ServerObject | null\n /**\n * Pre-selected example key for parameters and the request body.\n *\n * The store is the source of truth once an example is picked, so\n * `x-scalar-default-example` wins over this initial seed and the selection\n * round-trips through the store like the client selection does.\n */\n selectedExample?: string\n /** Security schemes applicable to the operation. */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /**\n * Force a color mode on the rendered block.\n *\n * When omitted, the block inherits the ambient theme of the host page.\n * Pass `true` for dark mode or `false` for light mode.\n */\n darkMode?: boolean\n}\n\n/**\n * Builds the wrapper classes for the mounted block.\n *\n * The `.scalar-app` class scopes the Tailwind utilities, and the optional\n * color-mode class lets consumers pin the block to dark or light.\n */\nconst getWrapperClass = (darkMode: boolean | undefined): string => {\n if (darkMode === true) {\n return 'scalar-app dark-mode'\n }\n if (darkMode === false) {\n return 'scalar-app light-mode'\n }\n return 'scalar-app'\n}\n\n/**\n * Mount the CodeExample block to a DOM element without Vue.\n *\n * The consumer creates and controls their own workspace store,\n * then passes it in along with the path and method to render.\n */\nexport const createCodeExample = (\n el: HTMLElement | string,\n options: CreateCodeExampleOptions | CreateAsyncApiCodeExampleOptions,\n): { app: App; destroy: () => void } => {\n if ('operationName' in options) return createAsyncApiCodeExample(el, options)\n\n const element = typeof el === 'string' ? document.querySelector(el) : el\n if (!element) {\n throw new Error(`Element not found: ${el}`)\n }\n\n const eventBus = createWorkspaceEventBus()\n const clientOptions = generateClientOptions()\n\n // Persist client changes back to the store. The block emits\n // `workspace:update:selected-client` on its private bus when the user picks a\n // client; without this subscription the choice would never reach the store\n // and `x-scalar-default-client` (the source of truth read below) would stay\n // stale, so the selection would not survive a re-render or be shared with\n // other blocks reading from the same store.\n const mutators = generateClientMutators(options.store)\n const unsubscribeClient = eventBus.on('workspace:update:selected-client', (payload) =>\n mutators.workspace().workspace.updateSelectedClient(payload),\n )\n\n // Persist example changes back to the store as well, mirroring the client\n // round-trip above. The block emits `workspace:update:selected-example` when\n // the user picks an example; without this the choice would never reach\n // `x-scalar-default-example` (read below) and would neither survive a\n // re-render nor sync to other blocks reading from the same store.\n const unsubscribeExample = eventBus.on('workspace:update:selected-example', (payload) =>\n mutators.workspace().workspace.updateSelectedExample(payload),\n )\n\n type OperationContext = { operation: OperationObject; server: ServerObject | null }\n\n /**\n * Resolve the operation and its effective server from the active document.\n *\n * The server is resolved from the same document the operation came from\n * (operation, then path item, then document level), so a snippet never pairs\n * an operation with a server URL from a different spec.\n */\n const resolveContext = (): OperationContext | undefined => {\n // The active document may be an AsyncAPI or plugin document, which has no `paths`.\n const activeDocument = options.store.workspace.activeDocument\n if (!isOpenApiDocument(activeDocument)) {\n return undefined\n }\n const pathItem = getResolvedRef(activeDocument.paths?.[options.path])\n const operation = getResolvedRef(getPathItemOperation(pathItem, options.method))\n if (!operation) {\n return undefined\n }\n const server = getFirstServer(operation.servers ?? null, pathItem?.servers ?? null, activeDocument.servers ?? null)\n return { operation, server }\n }\n\n // Fail loudly if the path and method do not point at an operation in the store,\n // mirroring the \"element not found\" guard above.\n if (!resolveContext()) {\n throw new Error(`Operation not found: ${options.method.toUpperCase()} ${options.path}`)\n }\n\n // Remember the last context that resolved so a transient miss (e.g. the active\n // document is swapped to one without this path or method after mount) keeps\n // rendering the previous operation, paired with the server it actually came\n // from, instead of feeding `undefined` to the block.\n let lastContext: OperationContext | undefined\n\n /** Current operation + server, falling back to the last good resolution on a transient miss. */\n const currentContext = (): OperationContext => {\n const context = resolveContext()\n if (context) {\n lastContext = context\n }\n return (context ?? lastContext) as OperationContext\n }\n\n // Props are getters so the block tracks the reactive store (active document,\n // `x-scalar-default-client`, `x-scalar-default-example`) live. Change the\n // client, example, or server through the store to drive re-renders.\n const props = reactive<CodeExampleProps>({\n get codeSampleUnavailable() {\n return options.codeSampleUnavailable\n },\n get codeSampleLabel() {\n return options.codeSampleLabel\n },\n get operation(): OperationObject {\n return currentContext().operation\n },\n get method() {\n return options.method\n },\n get path() {\n return options.path\n },\n clientOptions,\n eventBus,\n get securitySchemes() {\n return options.securitySchemes ?? []\n },\n get selectedClient() {\n // The store is the source of truth once the user picks a client, so it\n // wins over the initial `options.selectedClient` seed and the selection\n // round-trips through the subscription above.\n return options.store.workspace['x-scalar-default-client'] ?? options.selectedClient\n },\n get selectedExample() {\n // Same as the client: the store wins over the initial seed so the example\n // selection survives re-renders and syncs across blocks.\n return options.store.workspace['x-scalar-default-example'] ?? options.selectedExample\n },\n get selectedServer() {\n // An explicit option wins (including an explicit `null` for \"no server\");\n // otherwise derive it from the same document the operation resolved from.\n return options.selectedServer !== undefined ? options.selectedServer : currentContext().server\n },\n })\n\n // Render the operation path in the header by default. The reference renders\n // this via the `#header` slot too, so the standalone block matches its look.\n const renderHeader = () =>\n h('span', { class: 'font-code text-c-2 min-w-0' }, h(ScalarWrappingText, { text: options.path }))\n\n // Wrap the block in its own teleport root so floating UI (the client picker\n // popover) renders inside the themed `.scalar-app` wrapper instead of escaping\n // to `body`, where it would miss the color-mode variables and lose its styling.\n const app = createApp(() =>\n h('div', { class: getWrapperClass(options.darkMode) }, [\n h(ScalarTeleportRoot, null, { default: () => h(CodeExample, props, { header: renderHeader }) }),\n ]),\n )\n\n app.provide(EXTERNAL_EXAMPLES, () => options.store.externalExamples())\n app.mount(element)\n\n return {\n app,\n destroy: () => {\n unsubscribeClient()\n unsubscribeExample()\n app.unmount()\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAiEA,IAAME,KAAmB,MACnBC,MAAa,KACR,yBAELA,MAAa,KACR,0BAEF,cASIC,KACX,GACA,MACsC;CACtC,IAAI,mBAAmBC,GAAS,OAAOC,EAA0BC,GAAIF,CAAO;CAE5E,IAAMG,IAAU,OAAOD,KAAO,WAAW,SAAS,cAAcA,CAAE,IAAIA;CACtE,IAAI,CAACC,GACH,MAAU,MAAM,sBAAsBD,GAAI;CAG5C,IAAME,IAAWC,EAAwB,GACnCC,IAAgBC,EAAsB,GAQtCC,IAAWC,EAAuBT,EAAQ,KAAK,GAC/CU,IAAoBN,EAAS,GAAG,qCAAqC,MACzEI,EAAS,UAAU,CAAC,CAAC,UAAU,qBAAqBG,CAAO,CAC7D,GAOMC,IAAqBR,EAAS,GAAG,sCAAsC,MAC3EI,EAAS,UAAU,CAAC,CAAC,UAAU,sBAAsBG,CAAO,CAC9D,GAWME,UAAqD;EAEzD,IAAMC,IAAiBd,EAAQ,MAAM,UAAU;EAC/C,IAAI,CAACe,EAAkBD,CAAc,GACnC;EAEF,IAAME,IAAWC,EAAeH,EAAe,QAAQd,EAAQ,KAAK,GAC9DkB,IAAYD,EAAeE,EAAqBH,GAAUhB,EAAQ,MAAM,CAAC;EAC/E,IAAKkB,GAIL,OAAO;GAAE;GAAW,QADLE,EAAeF,EAAU,WAAW,MAAMF,GAAU,WAAW,MAAMF,EAAe,WAAW,IAC1F;EAAO;CAC7B;CAIA,IAAI,CAACD,EAAe,GAClB,MAAU,MAAM,wBAAwBb,EAAQ,OAAO,YAAY,EAAE,GAAGA,EAAQ,MAAM;CAOxF,IAAIqB,GAGEC,UAAyC;EAC7C,IAAMC,IAAUV,EAAe;EAI/B,OAHIU,MACF,IAAcA,IAERA,KAAWF;CACrB,GAKMG,IAAQC,EAA2B;EACvC,IAAI,wBAAwB;GAC1B,OAAOzB,EAAQ;EACjB;EACA,IAAI,kBAAkB;GACpB,OAAOA,EAAQ;EACjB;EACA,IAAI,YAA6B;GAC/B,OAAOsB,EAAe,CAAC,CAAC;EAC1B;EACA,IAAI,SAAS;GACX,OAAOtB,EAAQ;EACjB;EACA,IAAI,OAAO;GACT,OAAOA,EAAQ;EACjB;EACA;EACA;EACA,IAAI,kBAAkB;GACpB,OAAOA,EAAQ,mBAAmB,CAAC;EACrC;EACA,IAAI,iBAAiB;GAInB,OAAOA,EAAQ,MAAM,UAAU,8BAA8BA,EAAQ;EACvE;EACA,IAAI,kBAAkB;GAGpB,OAAOA,EAAQ,MAAM,UAAU,+BAA+BA,EAAQ;EACxE;EACA,IAAI,iBAAiB;GAGnB,OAAOA,EAAQ,mBAAmB,KAAA,IAAqCsB,EAAe,CAAC,CAAC,SAA1CtB,EAAQ;EACxD;CACF,CAAC,GAIK0B,UACJC,EAAE,QAAQ,EAAE,OAAO,6BAA6B,GAAGA,EAAEC,GAAoB,EAAE,MAAM5B,EAAQ,KAAK,CAAC,CAAC,GAK5F6B,IAAMC,QACVH,EAAE,OAAO,EAAE,OAAO9B,EAAgBG,EAAQ,QAAQ,EAAE,GAAG,CACrD2B,EAAEI,GAAoB,MAAM,EAAE,eAAeJ,EAAEhC,GAAa6B,GAAO,EAAE,QAAQE,EAAa,CAAC,EAAE,CAAC,CAChG,CAAC,CACH;CAKA,OAHAG,EAAI,QAAQG,SAAyBhC,EAAQ,MAAM,iBAAiB,CAAC,GACrE6B,EAAI,MAAM1B,CAAO,GAEV;EACL;EACA,eAAe;GAGb,AAFAO,EAAkB,GAClBE,EAAmB,GACnBiB,EAAI,QAAQ;EACd;CACF;AACF"}
|
package/dist/constants.js
CHANGED
package/dist/style.css
CHANGED
|
@@ -744,6 +744,14 @@
|
|
|
744
744
|
border-radius: var(--scalar-radius-xl);
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
+
:where(.scalar-card.p-1 > .scalar-card-header:first-child:not(:last-child)) {
|
|
748
|
+
margin-block: -2px 2px;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
:where(.scalar-card.p-1 > .scalar-card-footer:last-child:not(:first-child)) {
|
|
752
|
+
margin-block: 2px -2px;
|
|
753
|
+
}
|
|
754
|
+
|
|
747
755
|
.scalar-app .hljs-regexp, .scalar-app .hljs-string, .scalar-app .hljs-built_in, .scalar-app .hljs-subst, .scalar-app .hljs-name, .scalar-app .hljs-doctag, .scalar-app .hljs-section, .scalar-app .hljs-title {
|
|
748
756
|
color: var(--scalar-color-blue);
|
|
749
757
|
}
|
|
@@ -4716,10 +4724,6 @@
|
|
|
4716
4724
|
}
|
|
4717
4725
|
}
|
|
4718
4726
|
|
|
4719
|
-
.scalar-app .ui-open\:rotate-180[data-headlessui-state~="open"], :where([data-headlessui-state~="open"]) :is(.scalar-app .ui-open\:rotate-180) {
|
|
4720
|
-
rotate: 180deg;
|
|
4721
|
-
}
|
|
4722
|
-
|
|
4723
4727
|
@media (max-width: 720px) and (max-height: 480px) {
|
|
4724
4728
|
.scalar-app .zoomed\:whitespace-normal\! {
|
|
4725
4729
|
white-space: normal !important;
|
|
@@ -5174,5 +5178,5 @@
|
|
|
5174
5178
|
opacity: .5;
|
|
5175
5179
|
}
|
|
5176
5180
|
}
|
|
5177
|
-
.request-card[data-v-aaf1efda],.request-card[data-v-3954f074]{color:var(--scalar-color-1);font-size:var(--scalar-font-size-3)}.request-method[data-v-3954f074]{font-family:var(--scalar-font-code);margin-right:6px}.request-card-footer[data-v-3954f074]{flex-shrink:0;justify-content:flex-end;padding:6px;display:flex;position:relative}.request-card-footer--wraps[data-v-3954f074]{flex-wrap:wrap;row-gap:4px}.request-card-footer-start[data-v-3954f074]{flex:1 0 auto;align-items:center;display:flex}.request-card-footer-addon[data-v-3954f074]{flex:1;align-items:center;min-width:0;display:flex}.request-editor-section[data-v-3954f074]{flex:1;display:flex}.code-snippet>.scalar-code-copy[data-v-3954f074]{background:var(--scalar-card-surface-raised,var(--scalar-background-2))}.request-card-simple[data-v-3954f074]{font-size:var(--scalar-small);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px 8px 8px 12px;display:flex}.request-header[data-v-3954f074]{overflow-wrap:anywhere;flex:999 auto;min-width:0}.request-card-actions[data-v-3954f074]{flex:1 0 auto}.code-snippet[data-v-3954f074]{flex-direction:column;width:100%;display:flex}.property-example[data-v-72248a2e]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-example[data-v-72248a2e]:hover:before{pointer-events:none;content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-example-value[data-v-72248a2e]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-example-value span[data-v-72248a2e]{text-overflow:ellipsis;white-space:pre;display:block;overflow:hidden}.property-example-value[data-v-72248a2e] svg{color:var(--scalar-color-3)}.property-example-value[data-v-72248a2e]:hover svg{color:var(--scalar-color-1)}.property-example-value[data-v-72248a2e]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-example-value-list[data-v-72248a2e]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-example-value-list-start[data-v-72248a2e]{left:0;transform:none}.property-example:hover .property-example-value-list[data-v-72248a2e]{display:flex}.error[data-v-86862f28]{background-color:var(--scalar-color-red)}.schema-card[data-v-86862f28]{font-size:var(--scalar-font-size-4);color:var(--scalar-color-1)}.schema-card-title[data-v-86862f28]{height:var(--schema-title-height);color:var(--scalar-color-2);font-weight:var(--scalar-semibold);font-size:var(--scalar-mini);border-bottom:var(--scalar-border-width) solid transparent;align-items:center;gap:4px;padding:6px 8px;display:flex}button.schema-card-title[data-v-86862f28]{cursor:pointer}button.schema-card-title[data-v-86862f28]:hover{color:var(--scalar-color-1)}.schema-properties-open>.schema-card-title[data-v-86862f28]{border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);border-bottom-right-radius:0;border-bottom-left-radius:0}.schema-properties-open>.schema-properties[data-v-86862f28]{width:fit-content}.schema-card-description[data-v-86862f28]{color:var(--scalar-color-2)}.schema-card-description+.schema-properties[data-v-86862f28]{width:fit-content;margin-top:8px}.schema-card--level-0:first-of-type>.schema-card-description[data-v-86862f28]:has(+.schema-properties){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);margin-bottom:-8px;padding-bottom:8px}.schema-card--level-0~.schema-card--level-0>.schema-card-description[data-v-86862f28]:has(+.schema-properties){padding-top:8px}.schema-properties-open.schema-properties[data-v-86862f28],.schema-properties-open>.schema-card--open[data-v-86862f28]{width:100%}.schema-properties[data-v-86862f28]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius-lg);flex-direction:column;width:fit-content;display:flex}.schema-properties-name[data-v-86862f28]{width:100%}.schema-properties .schema-properties[data-v-86862f28]{border-radius:13.5px}.schema-properties .schema-properties.schema-properties-open[data-v-86862f28]{border-radius:var(--scalar-radius-lg)}.schema-properties-open[data-v-86862f28]{width:100%}.schema-card--compact[data-v-86862f28]{align-self:flex-start}.schema-card--compact.schema-card--open[data-v-86862f28]{align-self:initial}.schema-card-title--compact[data-v-86862f28]{color:var(--scalar-color-2);border-bottom:none;height:auto;padding:6px 10px 6px 8px}.schema-properties-open>.schema-card-title--compact[data-v-86862f28]{position:static}.property--level-0>.schema-properties>.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}.property--level-0 .schema-card--level-0:not(.schema-card--compact) .property--level-1[data-v-86862f28]{padding:0 0 8px}:not(.composition-panel)>.schema-card--compact.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}[data-v-86862f28] .schema-card-description p{font-size:var(--scalar-small,var(--scalar-paragraph));color:var(--scalar-color-2);margin-bottom:6px;display:block}.children .schema-card-description[data-v-86862f28]:first-of-type{padding-top:0}.property-rule[data-v-e22666da] .composition-panel>.schema-card>.schema-properties>ul>li.property.property--tree-container{padding-top:0!important}.property-heading:empty+.property-description[data-v-1b21ab2e]:last-of-type,.property-description[data-v-1b21ab2e]:first-of-type:last-of-type{margin-top:0}.property-list[data-v-1b21ab2e]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);margin-top:10px}.property-list .property[data-v-1b21ab2e]:last-of-type{padding-bottom:10px}.enum-toggle-button[data-v-1b21ab2e]:hover{color:var(--scalar-color-1)}.badge.badge-colored[data-v-eecf5e58]{background-color:var(--badge-color);color:color-mix(in srgb, var(--badge-color), black 40%)}@supports (color:lch(from red calc((50 - l) * infinity) 0 0)){.badge.badge-colored[data-v-eecf5e58]{color:lch(from var(--badge-color) calc((50 - l) * infinity) 0 0 / 1)}}.badge.text-orange[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-orange), transparent 90%);border:#0000}.badge.text-yellow[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);border:#0000}.badge.text-red[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-red), transparent 90%);border:#0000}.badge.text-purple[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-purple), transparent 90%);border:#0000}.badge.text-green[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-green), transparent 90%);border:#0000}.property-default[data-v-46973243]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-default[data-v-46973243]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-default:hover .property-default-label span[data-v-46973243]{color:var(--scalar-color-1)}.property-default-label span[data-v-46973243]{color:var(--scalar-color-2);border-bottom:var(--scalar-border-width) dotted currentColor;position:relative}.property-default-value[data-v-46973243]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-default-value span[data-v-46973243]{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.property-default-value[data-v-46973243] svg{color:var(--scalar-color-3)}.property-default-value[data-v-46973243]:hover svg{color:var(--scalar-color-1)}.property-default-value[data-v-46973243]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-default-value-list[data-v-46973243]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:2;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-default:hover .property-default-value-list[data-v-46973243]{display:flex}.property-detail[data-v-8b57daa7]{display:inline-flex}.property-detail+.property-detail[data-v-8b57daa7]:before{content:"·";margin:0 .5ch;display:block}.property-detail-truncate[data-v-8b57daa7]{overflow:hidden}.property-detail-truncate>.property-detail-value[data-v-8b57daa7]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.property-detail-prefix[data-v-8b57daa7]{color:var(--scalar-color-2)}code.property-detail-value[data-v-8b57daa7]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);background:color-mix(in srgb, var(--scalar-background-2), var(--scalar-background-1));border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);padding:0 4px}.property-pattern[data-v-e8f7b07b]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-pattern[data-v-e8f7b07b]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-pattern-popup[data-v-e8f7b07b]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;min-width:200px;max-width:min(500px,100vw - 32px);max-height:min(400px,100vh - 32px);padding:9px;display:none;position:absolute;top:18px;left:50%;overflow-y:auto;transform:translate(-50%)}.property-pattern:hover .property-pattern-popup[data-v-e8f7b07b],.property-pattern:focus-within .property-pattern-popup[data-v-e8f7b07b],.property-pattern.is-open .property-pattern-popup[data-v-e8f7b07b]{display:flex}.property-pattern-value[data-v-e8f7b07b]{font-family:var(--scalar-font-code);background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);align-items:flex-start;gap:8px;width:100%;padding:6px;display:flex}.property-pattern-value code[data-v-e8f7b07b]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;text-align:left;flex:1}.property-heading[data-v-09888606]{white-space:nowrap;flex-wrap:wrap;align-items:baseline;row-gap:9px;display:flex}:is(.property-heading[data-v-09888606]:has(+.children),.property-heading[data-v-09888606]:has(+.property-rule)){margin-bottom:9px}.property-heading[data-v-09888606]>*{margin-right:9px}.property-heading[data-v-09888606]:last-child{margin-right:0}.property-name[data-v-09888606]{max-width:100%;font-family:var(--scalar-font-code);font-weight:var(--scalar-bold);font-size:var(--scalar-font-size-4);white-space:normal;overflow-wrap:break-word}.property-additional[data-v-09888606]{font-family:var(--scalar-font-code)}.property-required[data-v-09888606],.property-optional[data-v-09888606]{color:var(--scalar-color-2)}.property-required[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-orange)}.light-mode .property-required[data-v-09888606]{color:color-mix(in srgb, var(--scalar-color-orange), var(--scalar-color-1) 32%)}.property-read-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-blue)}.property-write-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-green)}.property-discriminator[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-purple)}.property-detail[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-2);align-items:center;min-width:0;display:flex}.property-const[data-v-09888606]{color:var(--scalar-color-1)}.deprecated[data-v-09888606]{text-decoration:line-through}.property[data-v-00f22f7c]{color:var(--scalar-color-1);font-size:var(--scalar-small);flex-direction:column;padding:10px;display:flex;position:relative}.property[data-v-00f22f7c]:has(>.property-rule:first-of-type):not(.property--compact){padding-top:8px;padding-bottom:8px}.property--deprecated[data-v-00f22f7c]{background:repeating-linear-gradient(-45deg, var(--scalar-background-2) 0, var(--scalar-background-2) 2px, transparent 2px, transparent 5px);background-size:100%}.property-description[data-v-00f22f7c]{line-height:1.4;font-size:var(--scalar-small);margin-top:6px}.property-description[data-v-00f22f7c]:has(+.property-rule){margin-bottom:9px}[data-v-00f22f7c] .property-description *{color:var(--scalar-color-2)!important}.property[data-v-00f22f7c]:not(:last-of-type){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color)}.property-description+.children[data-v-00f22f7c],.children+.property-rule[data-v-00f22f7c]{margin-top:9px}.children[data-v-00f22f7c]{flex-direction:column;display:flex}.children .property--compact.property--level-1[data-v-00f22f7c]{padding:12px}.property-example-value[data-v-00f22f7c]{all:unset;font-family:var(--scalar-font-code);border-top:var(--scalar-border-width) solid var(--scalar-border-color);padding:6px}.property-rule[data-v-00f22f7c]{border-radius:var(--scalar-radius-lg);flex-direction:column;display:flex}.property-example[data-v-00f22f7c]{background:0 0;border:none;flex-direction:row;gap:8px;display:flex}.property-example-label[data-v-00f22f7c],.property-example-value[data-v-00f22f7c]{padding:3px 0 0}.property-example-value[data-v-00f22f7c]{background:var(--scalar-background-2);border-radius:var(--scalar-radius);border-top:0;padding:3px 4px}.property-name[data-v-00f22f7c]{font-family:var(--scalar-font-code);font-weight:var(--scalar-semibold)}.property-name-additional-properties[data-v-00f22f7c]:before,.property-name-pattern-properties[data-v-00f22f7c]:before{text-transform:uppercase;font-size:var(--scalar-micro);border-radius:var(--scalar-radius);color:var(--scalar-color-1);border:var(--scalar-border-width) solid var(--scalar-border-color);background-color:var(--scalar-background-2);margin-right:4px;padding:2px 4px;display:inline-block}.property-name-pattern-properties[data-v-00f22f7c]:before{content:"regex"}.property-name-additional-properties[data-v-00f22f7c],.property-name-pattern-properties[data-v-00f22f7c]{border:1px dashed var(--scalar-border-color);color:var(--scalar-color-accent);border-radius:var(--scalar-radius);padding:2px;display:inline-block}.schema-type-icon[data-v-39d4fd7f]{color:var(--scalar-color-1);display:none}.schema-type[data-v-39d4fd7f]{font-family:var(--scalar-font-code);color:var(--scalar-color-1)}
|
|
5181
|
+
.request-card[data-v-aaf1efda],.request-card[data-v-8530ae0b]{color:var(--scalar-color-1);font-size:var(--scalar-font-size-3)}.request-method[data-v-8530ae0b]{font-family:var(--scalar-font-code);margin-right:6px}.request-card-footer[data-v-8530ae0b]{flex-shrink:0;justify-content:flex-end;padding:6px;display:flex;position:relative}.request-card-footer--wraps[data-v-8530ae0b]{flex-wrap:wrap;row-gap:4px}.request-card-footer-start[data-v-8530ae0b]{flex:1 0 auto;align-items:center;display:flex}.request-card-footer-addon[data-v-8530ae0b]{flex:7em;align-items:center;min-width:0;max-width:max-content;margin-inline-end:auto;display:flex}.request-editor-section[data-v-8530ae0b]{flex:1;display:flex}.code-snippet>.scalar-code-copy[data-v-8530ae0b]{background:var(--scalar-card-surface-raised,var(--scalar-background-2))}.request-card-simple[data-v-8530ae0b]{font-size:var(--scalar-small);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px 8px 8px 12px;display:flex}.request-header[data-v-8530ae0b]{overflow-wrap:anywhere;flex:999 auto;min-width:0}.request-card-actions[data-v-8530ae0b]{flex:1 0 auto}.code-snippet[data-v-8530ae0b]{flex-direction:column;width:100%;display:flex}.property-example[data-v-72248a2e]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-example[data-v-72248a2e]:hover:before{pointer-events:none;content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-example-value[data-v-72248a2e]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-example-value span[data-v-72248a2e]{text-overflow:ellipsis;white-space:pre;display:block;overflow:hidden}.property-example-value[data-v-72248a2e] svg{color:var(--scalar-color-3)}.property-example-value[data-v-72248a2e]:hover svg{color:var(--scalar-color-1)}.property-example-value[data-v-72248a2e]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-example-value-list[data-v-72248a2e]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-example-value-list-start[data-v-72248a2e]{left:0;transform:none}.property-example:hover .property-example-value-list[data-v-72248a2e]{display:flex}.error[data-v-86862f28]{background-color:var(--scalar-color-red)}.schema-card[data-v-86862f28]{font-size:var(--scalar-font-size-4);color:var(--scalar-color-1)}.schema-card-title[data-v-86862f28]{height:var(--schema-title-height);color:var(--scalar-color-2);font-weight:var(--scalar-semibold);font-size:var(--scalar-mini);border-bottom:var(--scalar-border-width) solid transparent;align-items:center;gap:4px;padding:6px 8px;display:flex}button.schema-card-title[data-v-86862f28]{cursor:pointer}button.schema-card-title[data-v-86862f28]:hover{color:var(--scalar-color-1)}.schema-properties-open>.schema-card-title[data-v-86862f28]{border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);border-bottom-right-radius:0;border-bottom-left-radius:0}.schema-properties-open>.schema-properties[data-v-86862f28]{width:fit-content}.schema-card-description[data-v-86862f28]{color:var(--scalar-color-2)}.schema-card-description+.schema-properties[data-v-86862f28]{width:fit-content;margin-top:8px}.schema-card--level-0:first-of-type>.schema-card-description[data-v-86862f28]:has(+.schema-properties){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);margin-bottom:-8px;padding-bottom:8px}.schema-card--level-0~.schema-card--level-0>.schema-card-description[data-v-86862f28]:has(+.schema-properties){padding-top:8px}.schema-properties-open.schema-properties[data-v-86862f28],.schema-properties-open>.schema-card--open[data-v-86862f28]{width:100%}.schema-properties[data-v-86862f28]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius-lg);flex-direction:column;width:fit-content;display:flex}.schema-properties-name[data-v-86862f28]{width:100%}.schema-properties .schema-properties[data-v-86862f28]{border-radius:13.5px}.schema-properties .schema-properties.schema-properties-open[data-v-86862f28]{border-radius:var(--scalar-radius-lg)}.schema-properties-open[data-v-86862f28]{width:100%}.schema-card--compact[data-v-86862f28]{align-self:flex-start}.schema-card--compact.schema-card--open[data-v-86862f28]{align-self:initial}.schema-card-title--compact[data-v-86862f28]{color:var(--scalar-color-2);border-bottom:none;height:auto;padding:6px 10px 6px 8px}.schema-properties-open>.schema-card-title--compact[data-v-86862f28]{position:static}.property--level-0>.schema-properties>.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}.property--level-0 .schema-card--level-0:not(.schema-card--compact) .property--level-1[data-v-86862f28]{padding:0 0 8px}:not(.composition-panel)>.schema-card--compact.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}[data-v-86862f28] .schema-card-description p{font-size:var(--scalar-small,var(--scalar-paragraph));color:var(--scalar-color-2);margin-bottom:6px;display:block}.children .schema-card-description[data-v-86862f28]:first-of-type{padding-top:0}.property-rule[data-v-e22666da] .composition-panel>.schema-card>.schema-properties>ul>li.property.property--tree-container{padding-top:0!important}.property-heading:empty+.property-description[data-v-1b21ab2e]:last-of-type,.property-description[data-v-1b21ab2e]:first-of-type:last-of-type{margin-top:0}.property-list[data-v-1b21ab2e]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);margin-top:10px}.property-list .property[data-v-1b21ab2e]:last-of-type{padding-bottom:10px}.enum-toggle-button[data-v-1b21ab2e]:hover{color:var(--scalar-color-1)}.badge.badge-colored[data-v-eecf5e58]{background-color:var(--badge-color);color:color-mix(in srgb, var(--badge-color), black 40%)}@supports (color:lch(from red calc((50 - l) * infinity) 0 0)){.badge.badge-colored[data-v-eecf5e58]{color:lch(from var(--badge-color) calc((50 - l) * infinity) 0 0 / 1)}}.badge.text-orange[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-orange), transparent 90%);border:#0000}.badge.text-yellow[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);border:#0000}.badge.text-red[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-red), transparent 90%);border:#0000}.badge.text-purple[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-purple), transparent 90%);border:#0000}.badge.text-green[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-green), transparent 90%);border:#0000}.property-default[data-v-46973243]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-default[data-v-46973243]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-default:hover .property-default-label span[data-v-46973243]{color:var(--scalar-color-1)}.property-default-label span[data-v-46973243]{color:var(--scalar-color-2);border-bottom:var(--scalar-border-width) dotted currentColor;position:relative}.property-default-value[data-v-46973243]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-default-value span[data-v-46973243]{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.property-default-value[data-v-46973243] svg{color:var(--scalar-color-3)}.property-default-value[data-v-46973243]:hover svg{color:var(--scalar-color-1)}.property-default-value[data-v-46973243]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-default-value-list[data-v-46973243]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:2;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-default:hover .property-default-value-list[data-v-46973243]{display:flex}.property-detail[data-v-8b57daa7]{display:inline-flex}.property-detail+.property-detail[data-v-8b57daa7]:before{content:"·";margin:0 .5ch;display:block}.property-detail-truncate[data-v-8b57daa7]{overflow:hidden}.property-detail-truncate>.property-detail-value[data-v-8b57daa7]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.property-detail-prefix[data-v-8b57daa7]{color:var(--scalar-color-2)}code.property-detail-value[data-v-8b57daa7]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);background:color-mix(in srgb, var(--scalar-background-2), var(--scalar-background-1));border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);padding:0 4px}.property-pattern[data-v-e8f7b07b]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-pattern[data-v-e8f7b07b]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-pattern-popup[data-v-e8f7b07b]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;min-width:200px;max-width:min(500px,100vw - 32px);max-height:min(400px,100vh - 32px);padding:9px;display:none;position:absolute;top:18px;left:50%;overflow-y:auto;transform:translate(-50%)}.property-pattern:hover .property-pattern-popup[data-v-e8f7b07b],.property-pattern:focus-within .property-pattern-popup[data-v-e8f7b07b],.property-pattern.is-open .property-pattern-popup[data-v-e8f7b07b]{display:flex}.property-pattern-value[data-v-e8f7b07b]{font-family:var(--scalar-font-code);background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);align-items:flex-start;gap:8px;width:100%;padding:6px;display:flex}.property-pattern-value code[data-v-e8f7b07b]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;text-align:left;flex:1}.property-heading[data-v-09888606]{white-space:nowrap;flex-wrap:wrap;align-items:baseline;row-gap:9px;display:flex}:is(.property-heading[data-v-09888606]:has(+.children),.property-heading[data-v-09888606]:has(+.property-rule)){margin-bottom:9px}.property-heading[data-v-09888606]>*{margin-right:9px}.property-heading[data-v-09888606]:last-child{margin-right:0}.property-name[data-v-09888606]{max-width:100%;font-family:var(--scalar-font-code);font-weight:var(--scalar-bold);font-size:var(--scalar-font-size-4);white-space:normal;overflow-wrap:break-word}.property-additional[data-v-09888606]{font-family:var(--scalar-font-code)}.property-required[data-v-09888606],.property-optional[data-v-09888606]{color:var(--scalar-color-2)}.property-required[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-orange)}.light-mode .property-required[data-v-09888606]{color:color-mix(in srgb, var(--scalar-color-orange), var(--scalar-color-1) 32%)}.property-read-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-blue)}.property-write-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-green)}.property-discriminator[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-purple)}.property-detail[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-2);align-items:center;min-width:0;display:flex}.property-const[data-v-09888606]{color:var(--scalar-color-1)}.deprecated[data-v-09888606]{text-decoration:line-through}.property[data-v-00f22f7c]{color:var(--scalar-color-1);font-size:var(--scalar-small);flex-direction:column;padding:10px;display:flex;position:relative}.property[data-v-00f22f7c]:has(>.property-rule:first-of-type):not(.property--compact){padding-top:8px;padding-bottom:8px}.property--deprecated[data-v-00f22f7c]{background:repeating-linear-gradient(-45deg, var(--scalar-background-2) 0, var(--scalar-background-2) 2px, transparent 2px, transparent 5px);background-size:100%}.property-description[data-v-00f22f7c]{line-height:1.4;font-size:var(--scalar-small);margin-top:6px}.property-description[data-v-00f22f7c]:has(+.property-rule){margin-bottom:9px}[data-v-00f22f7c] .property-description *{color:var(--scalar-color-2)!important}.property[data-v-00f22f7c]:not(:last-of-type){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color)}.property-description+.children[data-v-00f22f7c],.children+.property-rule[data-v-00f22f7c]{margin-top:9px}.children[data-v-00f22f7c]{flex-direction:column;display:flex}.children .property--compact.property--level-1[data-v-00f22f7c]{padding:12px}.property-example-value[data-v-00f22f7c]{all:unset;font-family:var(--scalar-font-code);border-top:var(--scalar-border-width) solid var(--scalar-border-color);padding:6px}.property-rule[data-v-00f22f7c]{border-radius:var(--scalar-radius-lg);flex-direction:column;display:flex}.property-example[data-v-00f22f7c]{background:0 0;border:none;flex-direction:row;gap:8px;display:flex}.property-example-label[data-v-00f22f7c],.property-example-value[data-v-00f22f7c]{padding:3px 0 0}.property-example-value[data-v-00f22f7c]{background:var(--scalar-background-2);border-radius:var(--scalar-radius);border-top:0;padding:3px 4px}.property-name[data-v-00f22f7c]{font-family:var(--scalar-font-code);font-weight:var(--scalar-semibold)}.property-name-additional-properties[data-v-00f22f7c]:before,.property-name-pattern-properties[data-v-00f22f7c]:before{text-transform:uppercase;font-size:var(--scalar-micro);border-radius:var(--scalar-radius);color:var(--scalar-color-1);border:var(--scalar-border-width) solid var(--scalar-border-color);background-color:var(--scalar-background-2);margin-right:4px;padding:2px 4px;display:inline-block}.property-name-pattern-properties[data-v-00f22f7c]:before{content:"regex"}.property-name-additional-properties[data-v-00f22f7c],.property-name-pattern-properties[data-v-00f22f7c]{border:1px dashed var(--scalar-border-color);color:var(--scalar-color-accent);border-radius:var(--scalar-radius);padding:2px;display:inline-block}.schema-type-icon[data-v-39d4fd7f]{color:var(--scalar-color-1);display:none}.schema-type[data-v-39d4fd7f]{font-family:var(--scalar-font-code);color:var(--scalar-color-1)}
|
|
5178
5182
|
/*$vite$:1*/
|
package/dist/vue-styles.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.request-card[data-v-aaf1efda],.request-card[data-v-3954f074]{color:var(--scalar-color-1);font-size:var(--scalar-font-size-3)}.request-method[data-v-3954f074]{font-family:var(--scalar-font-code);margin-right:6px}.request-card-footer[data-v-3954f074]{flex-shrink:0;justify-content:flex-end;padding:6px;display:flex;position:relative}.request-card-footer--wraps[data-v-3954f074]{flex-wrap:wrap;row-gap:4px}.request-card-footer-start[data-v-3954f074]{flex:1 0 auto;align-items:center;display:flex}.request-card-footer-addon[data-v-3954f074]{flex:1;align-items:center;min-width:0;display:flex}.request-editor-section[data-v-3954f074]{flex:1;display:flex}.code-snippet>.scalar-code-copy[data-v-3954f074]{background:var(--scalar-card-surface-raised,var(--scalar-background-2))}.request-card-simple[data-v-3954f074]{font-size:var(--scalar-small);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px 8px 8px 12px;display:flex}.request-header[data-v-3954f074]{overflow-wrap:anywhere;flex:999 auto;min-width:0}.request-card-actions[data-v-3954f074]{flex:1 0 auto}.code-snippet[data-v-3954f074]{flex-direction:column;width:100%;display:flex}.property-example[data-v-72248a2e]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-example[data-v-72248a2e]:hover:before{pointer-events:none;content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-example-value[data-v-72248a2e]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-example-value span[data-v-72248a2e]{text-overflow:ellipsis;white-space:pre;display:block;overflow:hidden}.property-example-value[data-v-72248a2e] svg{color:var(--scalar-color-3)}.property-example-value[data-v-72248a2e]:hover svg{color:var(--scalar-color-1)}.property-example-value[data-v-72248a2e]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-example-value-list[data-v-72248a2e]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-example-value-list-start[data-v-72248a2e]{left:0;transform:none}.property-example:hover .property-example-value-list[data-v-72248a2e]{display:flex}.error[data-v-86862f28]{background-color:var(--scalar-color-red)}.schema-card[data-v-86862f28]{font-size:var(--scalar-font-size-4);color:var(--scalar-color-1)}.schema-card-title[data-v-86862f28]{height:var(--schema-title-height);color:var(--scalar-color-2);font-weight:var(--scalar-semibold);font-size:var(--scalar-mini);border-bottom:var(--scalar-border-width) solid transparent;align-items:center;gap:4px;padding:6px 8px;display:flex}button.schema-card-title[data-v-86862f28]{cursor:pointer}button.schema-card-title[data-v-86862f28]:hover{color:var(--scalar-color-1)}.schema-properties-open>.schema-card-title[data-v-86862f28]{border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);border-bottom-right-radius:0;border-bottom-left-radius:0}.schema-properties-open>.schema-properties[data-v-86862f28]{width:fit-content}.schema-card-description[data-v-86862f28]{color:var(--scalar-color-2)}.schema-card-description+.schema-properties[data-v-86862f28]{width:fit-content;margin-top:8px}.schema-card--level-0:first-of-type>.schema-card-description[data-v-86862f28]:has(+.schema-properties){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);margin-bottom:-8px;padding-bottom:8px}.schema-card--level-0~.schema-card--level-0>.schema-card-description[data-v-86862f28]:has(+.schema-properties){padding-top:8px}.schema-properties-open.schema-properties[data-v-86862f28],.schema-properties-open>.schema-card--open[data-v-86862f28]{width:100%}.schema-properties[data-v-86862f28]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius-lg);flex-direction:column;width:fit-content;display:flex}.schema-properties-name[data-v-86862f28]{width:100%}.schema-properties .schema-properties[data-v-86862f28]{border-radius:13.5px}.schema-properties .schema-properties.schema-properties-open[data-v-86862f28]{border-radius:var(--scalar-radius-lg)}.schema-properties-open[data-v-86862f28]{width:100%}.schema-card--compact[data-v-86862f28]{align-self:flex-start}.schema-card--compact.schema-card--open[data-v-86862f28]{align-self:initial}.schema-card-title--compact[data-v-86862f28]{color:var(--scalar-color-2);border-bottom:none;height:auto;padding:6px 10px 6px 8px}.schema-properties-open>.schema-card-title--compact[data-v-86862f28]{position:static}.property--level-0>.schema-properties>.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}.property--level-0 .schema-card--level-0:not(.schema-card--compact) .property--level-1[data-v-86862f28]{padding:0 0 8px}:not(.composition-panel)>.schema-card--compact.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}[data-v-86862f28] .schema-card-description p{font-size:var(--scalar-small,var(--scalar-paragraph));color:var(--scalar-color-2);margin-bottom:6px;display:block}.children .schema-card-description[data-v-86862f28]:first-of-type{padding-top:0}.property-rule[data-v-e22666da] .composition-panel>.schema-card>.schema-properties>ul>li.property.property--tree-container{padding-top:0!important}.property-heading:empty+.property-description[data-v-1b21ab2e]:last-of-type,.property-description[data-v-1b21ab2e]:first-of-type:last-of-type{margin-top:0}.property-list[data-v-1b21ab2e]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);margin-top:10px}.property-list .property[data-v-1b21ab2e]:last-of-type{padding-bottom:10px}.enum-toggle-button[data-v-1b21ab2e]:hover{color:var(--scalar-color-1)}.badge.badge-colored[data-v-eecf5e58]{background-color:var(--badge-color);color:color-mix(in srgb, var(--badge-color), black 40%)}@supports (color:lch(from red calc((50 - l) * infinity) 0 0)){.badge.badge-colored[data-v-eecf5e58]{color:lch(from var(--badge-color) calc((50 - l) * infinity) 0 0 / 1)}}.badge.text-orange[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-orange), transparent 90%);border:#0000}.badge.text-yellow[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);border:#0000}.badge.text-red[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-red), transparent 90%);border:#0000}.badge.text-purple[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-purple), transparent 90%);border:#0000}.badge.text-green[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-green), transparent 90%);border:#0000}.property-default[data-v-46973243]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-default[data-v-46973243]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-default:hover .property-default-label span[data-v-46973243]{color:var(--scalar-color-1)}.property-default-label span[data-v-46973243]{color:var(--scalar-color-2);border-bottom:var(--scalar-border-width) dotted currentColor;position:relative}.property-default-value[data-v-46973243]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-default-value span[data-v-46973243]{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.property-default-value[data-v-46973243] svg{color:var(--scalar-color-3)}.property-default-value[data-v-46973243]:hover svg{color:var(--scalar-color-1)}.property-default-value[data-v-46973243]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-default-value-list[data-v-46973243]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:2;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-default:hover .property-default-value-list[data-v-46973243]{display:flex}.property-detail[data-v-8b57daa7]{display:inline-flex}.property-detail+.property-detail[data-v-8b57daa7]:before{content:"·";margin:0 .5ch;display:block}.property-detail-truncate[data-v-8b57daa7]{overflow:hidden}.property-detail-truncate>.property-detail-value[data-v-8b57daa7]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.property-detail-prefix[data-v-8b57daa7]{color:var(--scalar-color-2)}code.property-detail-value[data-v-8b57daa7]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);background:color-mix(in srgb, var(--scalar-background-2), var(--scalar-background-1));border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);padding:0 4px}.property-pattern[data-v-e8f7b07b]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-pattern[data-v-e8f7b07b]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-pattern-popup[data-v-e8f7b07b]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;min-width:200px;max-width:min(500px,100vw - 32px);max-height:min(400px,100vh - 32px);padding:9px;display:none;position:absolute;top:18px;left:50%;overflow-y:auto;transform:translate(-50%)}.property-pattern:hover .property-pattern-popup[data-v-e8f7b07b],.property-pattern:focus-within .property-pattern-popup[data-v-e8f7b07b],.property-pattern.is-open .property-pattern-popup[data-v-e8f7b07b]{display:flex}.property-pattern-value[data-v-e8f7b07b]{font-family:var(--scalar-font-code);background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);align-items:flex-start;gap:8px;width:100%;padding:6px;display:flex}.property-pattern-value code[data-v-e8f7b07b]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;text-align:left;flex:1}.property-heading[data-v-09888606]{white-space:nowrap;flex-wrap:wrap;align-items:baseline;row-gap:9px;display:flex}:is(.property-heading[data-v-09888606]:has(+.children),.property-heading[data-v-09888606]:has(+.property-rule)){margin-bottom:9px}.property-heading[data-v-09888606]>*{margin-right:9px}.property-heading[data-v-09888606]:last-child{margin-right:0}.property-name[data-v-09888606]{max-width:100%;font-family:var(--scalar-font-code);font-weight:var(--scalar-bold);font-size:var(--scalar-font-size-4);white-space:normal;overflow-wrap:break-word}.property-additional[data-v-09888606]{font-family:var(--scalar-font-code)}.property-required[data-v-09888606],.property-optional[data-v-09888606]{color:var(--scalar-color-2)}.property-required[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-orange)}.light-mode .property-required[data-v-09888606]{color:color-mix(in srgb, var(--scalar-color-orange), var(--scalar-color-1) 32%)}.property-read-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-blue)}.property-write-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-green)}.property-discriminator[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-purple)}.property-detail[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-2);align-items:center;min-width:0;display:flex}.property-const[data-v-09888606]{color:var(--scalar-color-1)}.deprecated[data-v-09888606]{text-decoration:line-through}.property[data-v-00f22f7c]{color:var(--scalar-color-1);font-size:var(--scalar-small);flex-direction:column;padding:10px;display:flex;position:relative}.property[data-v-00f22f7c]:has(>.property-rule:first-of-type):not(.property--compact){padding-top:8px;padding-bottom:8px}.property--deprecated[data-v-00f22f7c]{background:repeating-linear-gradient(-45deg, var(--scalar-background-2) 0, var(--scalar-background-2) 2px, transparent 2px, transparent 5px);background-size:100%}.property-description[data-v-00f22f7c]{line-height:1.4;font-size:var(--scalar-small);margin-top:6px}.property-description[data-v-00f22f7c]:has(+.property-rule){margin-bottom:9px}[data-v-00f22f7c] .property-description *{color:var(--scalar-color-2)!important}.property[data-v-00f22f7c]:not(:last-of-type){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color)}.property-description+.children[data-v-00f22f7c],.children+.property-rule[data-v-00f22f7c]{margin-top:9px}.children[data-v-00f22f7c]{flex-direction:column;display:flex}.children .property--compact.property--level-1[data-v-00f22f7c]{padding:12px}.property-example-value[data-v-00f22f7c]{all:unset;font-family:var(--scalar-font-code);border-top:var(--scalar-border-width) solid var(--scalar-border-color);padding:6px}.property-rule[data-v-00f22f7c]{border-radius:var(--scalar-radius-lg);flex-direction:column;display:flex}.property-example[data-v-00f22f7c]{background:0 0;border:none;flex-direction:row;gap:8px;display:flex}.property-example-label[data-v-00f22f7c],.property-example-value[data-v-00f22f7c]{padding:3px 0 0}.property-example-value[data-v-00f22f7c]{background:var(--scalar-background-2);border-radius:var(--scalar-radius);border-top:0;padding:3px 4px}.property-name[data-v-00f22f7c]{font-family:var(--scalar-font-code);font-weight:var(--scalar-semibold)}.property-name-additional-properties[data-v-00f22f7c]:before,.property-name-pattern-properties[data-v-00f22f7c]:before{text-transform:uppercase;font-size:var(--scalar-micro);border-radius:var(--scalar-radius);color:var(--scalar-color-1);border:var(--scalar-border-width) solid var(--scalar-border-color);background-color:var(--scalar-background-2);margin-right:4px;padding:2px 4px;display:inline-block}.property-name-pattern-properties[data-v-00f22f7c]:before{content:"regex"}.property-name-additional-properties[data-v-00f22f7c],.property-name-pattern-properties[data-v-00f22f7c]{border:1px dashed var(--scalar-border-color);color:var(--scalar-color-accent);border-radius:var(--scalar-radius);padding:2px;display:inline-block}.schema-type-icon[data-v-39d4fd7f]{color:var(--scalar-color-1);display:none}.schema-type[data-v-39d4fd7f]{font-family:var(--scalar-font-code);color:var(--scalar-color-1)}
|
|
1
|
+
.request-card[data-v-aaf1efda],.request-card[data-v-8530ae0b]{color:var(--scalar-color-1);font-size:var(--scalar-font-size-3)}.request-method[data-v-8530ae0b]{font-family:var(--scalar-font-code);margin-right:6px}.request-card-footer[data-v-8530ae0b]{flex-shrink:0;justify-content:flex-end;padding:6px;display:flex;position:relative}.request-card-footer--wraps[data-v-8530ae0b]{flex-wrap:wrap;row-gap:4px}.request-card-footer-start[data-v-8530ae0b]{flex:1 0 auto;align-items:center;display:flex}.request-card-footer-addon[data-v-8530ae0b]{flex:7em;align-items:center;min-width:0;max-width:max-content;margin-inline-end:auto;display:flex}.request-editor-section[data-v-8530ae0b]{flex:1;display:flex}.code-snippet>.scalar-code-copy[data-v-8530ae0b]{background:var(--scalar-card-surface-raised,var(--scalar-background-2))}.request-card-simple[data-v-8530ae0b]{font-size:var(--scalar-small);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px 8px 8px 12px;display:flex}.request-header[data-v-8530ae0b]{overflow-wrap:anywhere;flex:999 auto;min-width:0}.request-card-actions[data-v-8530ae0b]{flex:1 0 auto}.code-snippet[data-v-8530ae0b]{flex-direction:column;width:100%;display:flex}.property-example[data-v-72248a2e]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-example[data-v-72248a2e]:hover:before{pointer-events:none;content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-example-value[data-v-72248a2e]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-example-value span[data-v-72248a2e]{text-overflow:ellipsis;white-space:pre;display:block;overflow:hidden}.property-example-value[data-v-72248a2e] svg{color:var(--scalar-color-3)}.property-example-value[data-v-72248a2e]:hover svg{color:var(--scalar-color-1)}.property-example-value[data-v-72248a2e]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-example-value-list[data-v-72248a2e]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-example-value-list-start[data-v-72248a2e]{left:0;transform:none}.property-example:hover .property-example-value-list[data-v-72248a2e]{display:flex}.error[data-v-86862f28]{background-color:var(--scalar-color-red)}.schema-card[data-v-86862f28]{font-size:var(--scalar-font-size-4);color:var(--scalar-color-1)}.schema-card-title[data-v-86862f28]{height:var(--schema-title-height);color:var(--scalar-color-2);font-weight:var(--scalar-semibold);font-size:var(--scalar-mini);border-bottom:var(--scalar-border-width) solid transparent;align-items:center;gap:4px;padding:6px 8px;display:flex}button.schema-card-title[data-v-86862f28]{cursor:pointer}button.schema-card-title[data-v-86862f28]:hover{color:var(--scalar-color-1)}.schema-properties-open>.schema-card-title[data-v-86862f28]{border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);border-bottom-right-radius:0;border-bottom-left-radius:0}.schema-properties-open>.schema-properties[data-v-86862f28]{width:fit-content}.schema-card-description[data-v-86862f28]{color:var(--scalar-color-2)}.schema-card-description+.schema-properties[data-v-86862f28]{width:fit-content;margin-top:8px}.schema-card--level-0:first-of-type>.schema-card-description[data-v-86862f28]:has(+.schema-properties){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color);margin-bottom:-8px;padding-bottom:8px}.schema-card--level-0~.schema-card--level-0>.schema-card-description[data-v-86862f28]:has(+.schema-properties){padding-top:8px}.schema-properties-open.schema-properties[data-v-86862f28],.schema-properties-open>.schema-card--open[data-v-86862f28]{width:100%}.schema-properties[data-v-86862f28]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius-lg);flex-direction:column;width:fit-content;display:flex}.schema-properties-name[data-v-86862f28]{width:100%}.schema-properties .schema-properties[data-v-86862f28]{border-radius:13.5px}.schema-properties .schema-properties.schema-properties-open[data-v-86862f28]{border-radius:var(--scalar-radius-lg)}.schema-properties-open[data-v-86862f28]{width:100%}.schema-card--compact[data-v-86862f28]{align-self:flex-start}.schema-card--compact.schema-card--open[data-v-86862f28]{align-self:initial}.schema-card-title--compact[data-v-86862f28]{color:var(--scalar-color-2);border-bottom:none;height:auto;padding:6px 10px 6px 8px}.schema-properties-open>.schema-card-title--compact[data-v-86862f28]{position:static}.property--level-0>.schema-properties>.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}.property--level-0 .schema-card--level-0:not(.schema-card--compact) .property--level-1[data-v-86862f28]{padding:0 0 8px}:not(.composition-panel)>.schema-card--compact.schema-card--level-0>.schema-properties[data-v-86862f28]{border:none}[data-v-86862f28] .schema-card-description p{font-size:var(--scalar-small,var(--scalar-paragraph));color:var(--scalar-color-2);margin-bottom:6px;display:block}.children .schema-card-description[data-v-86862f28]:first-of-type{padding-top:0}.property-rule[data-v-e22666da] .composition-panel>.schema-card>.schema-properties>ul>li.property.property--tree-container{padding-top:0!important}.property-heading:empty+.property-description[data-v-1b21ab2e]:last-of-type,.property-description[data-v-1b21ab2e]:first-of-type:last-of-type{margin-top:0}.property-list[data-v-1b21ab2e]{border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);margin-top:10px}.property-list .property[data-v-1b21ab2e]:last-of-type{padding-bottom:10px}.enum-toggle-button[data-v-1b21ab2e]:hover{color:var(--scalar-color-1)}.badge.badge-colored[data-v-eecf5e58]{background-color:var(--badge-color);color:color-mix(in srgb, var(--badge-color), black 40%)}@supports (color:lch(from red calc((50 - l) * infinity) 0 0)){.badge.badge-colored[data-v-eecf5e58]{color:lch(from var(--badge-color) calc((50 - l) * infinity) 0 0 / 1)}}.badge.text-orange[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-orange), transparent 90%);border:#0000}.badge.text-yellow[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);border:#0000}.badge.text-red[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-red), transparent 90%);border:#0000}.badge.text-purple[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-purple), transparent 90%);border:#0000}.badge.text-green[data-v-eecf5e58]{background:color-mix(in srgb, var(--scalar-color-green), transparent 90%);border:#0000}.property-default[data-v-46973243]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-default[data-v-46973243]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-default:hover .property-default-label span[data-v-46973243]{color:var(--scalar-color-1)}.property-default-label span[data-v-46973243]{color:var(--scalar-color-2);border-bottom:var(--scalar-border-width) dotted currentColor;position:relative}.property-default-value[data-v-46973243]{font-family:var(--scalar-font-code);align-items:center;gap:8px;width:100%;padding:6px;display:flex}.property-default-value span[data-v-46973243]{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.property-default-value[data-v-46973243] svg{color:var(--scalar-color-3)}.property-default-value[data-v-46973243]:hover svg{color:var(--scalar-color-1)}.property-default-value[data-v-46973243]{background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius)}.property-default-value-list[data-v-46973243]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:2;flex-direction:column;gap:3px;min-width:200px;max-width:300px;padding:9px;display:none;position:absolute;top:18px;left:50%;overflow:auto;transform:translate(-50%)}.property-default:hover .property-default-value-list[data-v-46973243]{display:flex}.property-detail[data-v-8b57daa7]{display:inline-flex}.property-detail+.property-detail[data-v-8b57daa7]:before{content:"·";margin:0 .5ch;display:block}.property-detail-truncate[data-v-8b57daa7]{overflow:hidden}.property-detail-truncate>.property-detail-value[data-v-8b57daa7]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.property-detail-prefix[data-v-8b57daa7]{color:var(--scalar-color-2)}code.property-detail-value[data-v-8b57daa7]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);background:color-mix(in srgb, var(--scalar-background-2), var(--scalar-background-1));border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);padding:0 4px}.property-pattern[data-v-e8f7b07b]{font-size:var(--scalar-mini);flex-direction:column;display:flex;position:relative}.property-pattern[data-v-e8f7b07b]:hover:before{content:"";border-radius:var(--scalar-radius);width:100%;height:20px;position:absolute;top:0;left:0}.property-pattern-popup[data-v-e8f7b07b]{background-color:var(--scalar-background-1);box-shadow:var(--scalar-shadow-1);border-radius:var(--scalar-radius-lg);border:var(--scalar-border-width) solid var(--scalar-border-color);z-index:1000;min-width:200px;max-width:min(500px,100vw - 32px);max-height:min(400px,100vh - 32px);padding:9px;display:none;position:absolute;top:18px;left:50%;overflow-y:auto;transform:translate(-50%)}.property-pattern:hover .property-pattern-popup[data-v-e8f7b07b],.property-pattern:focus-within .property-pattern-popup[data-v-e8f7b07b],.property-pattern.is-open .property-pattern-popup[data-v-e8f7b07b]{display:flex}.property-pattern-value[data-v-e8f7b07b]{font-family:var(--scalar-font-code);background:var(--scalar-background-2);border:var(--scalar-border-width) solid var(--scalar-border-color);border-radius:var(--scalar-radius);align-items:flex-start;gap:8px;width:100%;padding:6px;display:flex}.property-pattern-value code[data-v-e8f7b07b]{font-family:var(--scalar-font-code);font-size:var(--scalar-font-size-3);color:var(--scalar-color-2);white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;text-align:left;flex:1}.property-heading[data-v-09888606]{white-space:nowrap;flex-wrap:wrap;align-items:baseline;row-gap:9px;display:flex}:is(.property-heading[data-v-09888606]:has(+.children),.property-heading[data-v-09888606]:has(+.property-rule)){margin-bottom:9px}.property-heading[data-v-09888606]>*{margin-right:9px}.property-heading[data-v-09888606]:last-child{margin-right:0}.property-name[data-v-09888606]{max-width:100%;font-family:var(--scalar-font-code);font-weight:var(--scalar-bold);font-size:var(--scalar-font-size-4);white-space:normal;overflow-wrap:break-word}.property-additional[data-v-09888606]{font-family:var(--scalar-font-code)}.property-required[data-v-09888606],.property-optional[data-v-09888606]{color:var(--scalar-color-2)}.property-required[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-orange)}.light-mode .property-required[data-v-09888606]{color:color-mix(in srgb, var(--scalar-color-orange), var(--scalar-color-1) 32%)}.property-read-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-blue)}.property-write-only[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-green)}.property-discriminator[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-purple)}.property-detail[data-v-09888606]{font-size:var(--scalar-mini);color:var(--scalar-color-2);align-items:center;min-width:0;display:flex}.property-const[data-v-09888606]{color:var(--scalar-color-1)}.deprecated[data-v-09888606]{text-decoration:line-through}.property[data-v-00f22f7c]{color:var(--scalar-color-1);font-size:var(--scalar-small);flex-direction:column;padding:10px;display:flex;position:relative}.property[data-v-00f22f7c]:has(>.property-rule:first-of-type):not(.property--compact){padding-top:8px;padding-bottom:8px}.property--deprecated[data-v-00f22f7c]{background:repeating-linear-gradient(-45deg, var(--scalar-background-2) 0, var(--scalar-background-2) 2px, transparent 2px, transparent 5px);background-size:100%}.property-description[data-v-00f22f7c]{line-height:1.4;font-size:var(--scalar-small);margin-top:6px}.property-description[data-v-00f22f7c]:has(+.property-rule){margin-bottom:9px}[data-v-00f22f7c] .property-description *{color:var(--scalar-color-2)!important}.property[data-v-00f22f7c]:not(:last-of-type){border-bottom:var(--scalar-border-width) solid var(--scalar-border-color)}.property-description+.children[data-v-00f22f7c],.children+.property-rule[data-v-00f22f7c]{margin-top:9px}.children[data-v-00f22f7c]{flex-direction:column;display:flex}.children .property--compact.property--level-1[data-v-00f22f7c]{padding:12px}.property-example-value[data-v-00f22f7c]{all:unset;font-family:var(--scalar-font-code);border-top:var(--scalar-border-width) solid var(--scalar-border-color);padding:6px}.property-rule[data-v-00f22f7c]{border-radius:var(--scalar-radius-lg);flex-direction:column;display:flex}.property-example[data-v-00f22f7c]{background:0 0;border:none;flex-direction:row;gap:8px;display:flex}.property-example-label[data-v-00f22f7c],.property-example-value[data-v-00f22f7c]{padding:3px 0 0}.property-example-value[data-v-00f22f7c]{background:var(--scalar-background-2);border-radius:var(--scalar-radius);border-top:0;padding:3px 4px}.property-name[data-v-00f22f7c]{font-family:var(--scalar-font-code);font-weight:var(--scalar-semibold)}.property-name-additional-properties[data-v-00f22f7c]:before,.property-name-pattern-properties[data-v-00f22f7c]:before{text-transform:uppercase;font-size:var(--scalar-micro);border-radius:var(--scalar-radius);color:var(--scalar-color-1);border:var(--scalar-border-width) solid var(--scalar-border-color);background-color:var(--scalar-background-2);margin-right:4px;padding:2px 4px;display:inline-block}.property-name-pattern-properties[data-v-00f22f7c]:before{content:"regex"}.property-name-additional-properties[data-v-00f22f7c],.property-name-pattern-properties[data-v-00f22f7c]{border:1px dashed var(--scalar-border-color);color:var(--scalar-color-accent);border-radius:var(--scalar-radius);padding:2px;display:inline-block}.schema-type-icon[data-v-39d4fd7f]{color:var(--scalar-color-1);display:none}.schema-type[data-v-39d4fd7f]{font-family:var(--scalar-font-code);color:var(--scalar-color-1)}
|
|
2
2
|
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"blocks",
|
|
18
18
|
"docs"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.7.
|
|
20
|
+
"version": "0.7.3",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=22"
|
|
23
23
|
},
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"CHANGELOG.md"
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@scalar/components": "0.35.
|
|
66
|
-
"@scalar/helpers": "0.18.
|
|
67
|
-
"@scalar/icons": "0.7.
|
|
68
|
-
"@scalar/localization": "0.2.
|
|
69
|
-
"@scalar/snippetz": "0.10.
|
|
70
|
-
"@scalar/themes": "0.20.
|
|
71
|
-
"@scalar/types": "0.
|
|
72
|
-
"@scalar/use-hooks": "0.4.
|
|
73
|
-
"@scalar/workspace-store": "0.
|
|
65
|
+
"@scalar/components": "0.35.1",
|
|
66
|
+
"@scalar/helpers": "0.18.1",
|
|
67
|
+
"@scalar/icons": "0.7.10",
|
|
68
|
+
"@scalar/localization": "0.2.13",
|
|
69
|
+
"@scalar/snippetz": "0.10.19",
|
|
70
|
+
"@scalar/themes": "0.20.2",
|
|
71
|
+
"@scalar/types": "0.30.0",
|
|
72
|
+
"@scalar/use-hooks": "0.4.27",
|
|
73
|
+
"@scalar/workspace-store": "0.73.0",
|
|
74
74
|
"@types/har-format": "^1.2.16",
|
|
75
75
|
"@vueuse/core": "15.0.0",
|
|
76
76
|
"js-base64": "^3.9.4",
|