@scalar/api-client 2.20.2 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +56 -59
  5. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +52 -51
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +4 -0
  8. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +1 -0
  9. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +23 -0
  10. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +24 -23
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -8
  14. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -2
  16. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +57 -60
  17. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +61 -41
  19. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +0 -3
  20. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  22. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -34
  23. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts +3 -3
  24. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
  26. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +26 -20
  27. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts +4 -2
  28. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  29. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +39 -33
  30. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  32. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +64 -64
  33. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +1 -0
  34. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +12 -11
  36. package/dist/v2/components/code-input/CodeInput.vue.d.ts +152 -95
  37. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  38. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  39. package/dist/v2/components/code-input/CodeInput.vue2.js +87 -99
  40. package/dist/v2/features/operation/Operation.vue.js +1 -1
  41. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  42. package/package.json +12 -12
@@ -12,7 +12,9 @@ export type CodeInputModelValue = string | number | boolean | Array<string | num
12
12
  * - Editor mode: CodeMirror with environment variable support
13
13
  *
14
14
  * Type `{{` to trigger environment variable autocomplete when an environment is provided.
15
- *d
15
+ * It takes in any data but always will emit a string value,
16
+ * this string should then be parsed in accordance to the schema or content type.
17
+ *
16
18
  * @example
17
19
  * ```vue
18
20
  * <!-- Basic input with environment variables -->
@@ -25,100 +27,155 @@ export type CodeInputModelValue = string | number | boolean | Array<string | num
25
27
  * <CodeInput v-model="data" language="json" :lint="true" />
26
28
  * ```
27
29
  */
28
- declare const _default: <T extends CodeInputModelValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
29
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
30
- readonly onSubmit?: ((value: string) => any) | undefined;
31
- readonly onRedirectToEnvironment?: (() => any) | undefined;
32
- readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
33
- readonly onBlur?: ((value: string) => any) | undefined;
34
- readonly onCurl?: ((value: string) => any) | undefined;
35
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onSubmit" | "onUpdate:modelValue" | "onCurl" | "onRedirectToEnvironment"> & {
36
- modelValue: T;
37
- /** Environment for variable substitution. Pass undefined to disable environment variables */
38
- environment: XScalarEnvironment | undefined;
39
- /** Type of the input value, affects rendering mode for booleans */
40
- type?: string | string[];
41
- /** Render as disabled text display */
42
- disabled?: boolean;
43
- /** Show error styling */
44
- error?: boolean;
45
- /** Layout context affects styling and behavior */
46
- layout?: ClientLayout;
47
- /** Predefined enum values, triggers select mode */
48
- enum?: string[];
49
- /** Example values, triggers select mode */
50
- examples?: string[];
51
- /** Default value to show in select mode */
52
- default?: T;
53
- /** Allow null in boolean select options */
54
- nullable?: boolean;
55
- /** Placeholder text for empty input */
56
- placeholder?: string;
57
- /** Show required indicator */
58
- required?: boolean;
59
- /** Enable color picker extension */
60
- colorPicker?: boolean;
61
- /** Show line numbers in editor */
62
- lineNumbers?: boolean;
63
- /** Enable linting */
64
- lint?: boolean;
65
- /** Enable line wrapping */
66
- lineWrapping?: boolean;
67
- /** CodeMirror language mode */
68
- language?: CodeMirrorLanguage;
69
- /** Additional CodeMirror extensions */
70
- extensions?: Extension[];
71
- /** Disable tab key for indentation */
72
- disableTabIndent?: boolean;
73
- /** Disable enter key */
74
- disableEnter?: boolean;
75
- /** Disable automatic bracket closing */
76
- disableCloseBrackets?: boolean;
77
- /** Emit submit event on blur */
78
- emitOnBlur?: boolean;
79
- /** Enable environment variable pills */
80
- withVariables?: boolean;
81
- /** Detect and emit curl commands */
82
- importCurl?: boolean;
83
- /** Emit change event even if the value is the same */
84
- alwaysEmitChange?: boolean;
85
- /** Custom change handler, prevents default emit */
86
- handleFieldChange?: (value: T) => void;
87
- /** Custom submit handler, prevents default emit */
88
- handleFieldSubmit?: (value: string) => void;
89
- /** Put a linethrough on the input text */
90
- linethrough?: boolean;
91
- } & Partial<{}>> & import("vue").PublicProps;
92
- expose(exposed: import("vue").ShallowUnwrapRef<{
93
- /**
94
- * Focus the codemirror element
95
- *
96
- * @param cursorAtEnd boolean place the cursor at the end of the input
97
- */
98
- focus: (position?: "start" | "end" | number) => void;
99
- isFocused: Ref<boolean, boolean>;
100
- handleChange: (value: string) => void;
101
- handleSubmit: (value: string) => void;
102
- handleBlur: (value: string) => void;
103
- booleanOptions: import("vue").ComputedRef<string[]>;
104
- codeMirror: Ref<import("@codemirror/view").EditorView | null, import("@codemirror/view").EditorView | null>;
105
- modelValue: T;
106
- cursorPosition: () => number | undefined;
107
- serializeValue: (value: T) => string;
108
- deserializeValue: (value: string) => T;
109
- }>): void;
110
- attrs: any;
111
- slots: {
112
- warning?: (props: {}) => any;
113
- } & {
114
- icon?: (props: {}) => any;
30
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
31
+ modelValue: CodeInputModelValue;
32
+ /** Environment for variable substitution. Pass undefined to disable environment variables */
33
+ environment: XScalarEnvironment | undefined;
34
+ /** Type of the input value, affects rendering mode for booleans */
35
+ type?: string | string[];
36
+ /** Render as disabled text display */
37
+ disabled?: boolean;
38
+ /** Show error styling */
39
+ error?: boolean;
40
+ /** Layout context affects styling and behavior */
41
+ layout?: ClientLayout;
42
+ /** Predefined enum values, triggers select mode */
43
+ enum?: string[];
44
+ /** Example values, triggers select mode */
45
+ examples?: string[];
46
+ /** Default value to show in select mode */
47
+ default?: CodeInputModelValue;
48
+ /** Allow null in boolean select options */
49
+ nullable?: boolean;
50
+ /** Placeholder text for empty input */
51
+ placeholder?: string;
52
+ /** Show required indicator */
53
+ required?: boolean;
54
+ /** Enable color picker extension */
55
+ colorPicker?: boolean;
56
+ /** Show line numbers in editor */
57
+ lineNumbers?: boolean;
58
+ /** Enable linting */
59
+ lint?: boolean;
60
+ /** Enable line wrapping */
61
+ lineWrapping?: boolean;
62
+ /** CodeMirror language mode */
63
+ language?: CodeMirrorLanguage;
64
+ /** Additional CodeMirror extensions */
65
+ extensions?: Extension[];
66
+ /** Disable tab key for indentation */
67
+ disableTabIndent?: boolean;
68
+ /** Disable enter key */
69
+ disableEnter?: boolean;
70
+ /** Disable automatic bracket closing */
71
+ disableCloseBrackets?: boolean;
72
+ /** Emit submit event on blur */
73
+ emitOnBlur?: boolean;
74
+ /** Enable environment variable pills */
75
+ withVariables?: boolean;
76
+ /** Detect and emit curl commands */
77
+ importCurl?: boolean;
78
+ /** Emit change event even if the value is the same */
79
+ alwaysEmitChange?: boolean;
80
+ /** Custom change handler, prevents default emit */
81
+ handleFieldChange?: (value: string) => void;
82
+ /** Custom submit handler, prevents default emit */
83
+ handleFieldSubmit?: (value: string) => void;
84
+ /** Put a linethrough on the input text */
85
+ linethrough?: boolean;
86
+ }, {
87
+ /**
88
+ * Focus the codemirror element
89
+ *
90
+ * @param cursorAtEnd boolean place the cursor at the end of the input
91
+ */
92
+ focus: (position?: "start" | "end" | number) => void;
93
+ isFocused: Ref<boolean, boolean>;
94
+ handleChange: (value: string) => void;
95
+ handleSubmit: (value: string) => void;
96
+ handleBlur: (value: string) => void;
97
+ booleanOptions: import("vue").ComputedRef<string[]>;
98
+ codeMirror: Ref<import("@codemirror/view").EditorView | null, import("@codemirror/view").EditorView | null>;
99
+ modelValue: CodeInputModelValue;
100
+ cursorPosition: () => number | undefined;
101
+ serializeValue: (value: CodeInputModelValue) => string;
102
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
103
+ submit: (value: string) => any;
104
+ redirectToEnvironment: () => any;
105
+ "update:modelValue": (value: string) => any;
106
+ blur: (value: string) => any;
107
+ curl: (value: string) => any;
108
+ }, string, import("vue").PublicProps, Readonly<{
109
+ modelValue: CodeInputModelValue;
110
+ /** Environment for variable substitution. Pass undefined to disable environment variables */
111
+ environment: XScalarEnvironment | undefined;
112
+ /** Type of the input value, affects rendering mode for booleans */
113
+ type?: string | string[];
114
+ /** Render as disabled text display */
115
+ disabled?: boolean;
116
+ /** Show error styling */
117
+ error?: boolean;
118
+ /** Layout context affects styling and behavior */
119
+ layout?: ClientLayout;
120
+ /** Predefined enum values, triggers select mode */
121
+ enum?: string[];
122
+ /** Example values, triggers select mode */
123
+ examples?: string[];
124
+ /** Default value to show in select mode */
125
+ default?: CodeInputModelValue;
126
+ /** Allow null in boolean select options */
127
+ nullable?: boolean;
128
+ /** Placeholder text for empty input */
129
+ placeholder?: string;
130
+ /** Show required indicator */
131
+ required?: boolean;
132
+ /** Enable color picker extension */
133
+ colorPicker?: boolean;
134
+ /** Show line numbers in editor */
135
+ lineNumbers?: boolean;
136
+ /** Enable linting */
137
+ lint?: boolean;
138
+ /** Enable line wrapping */
139
+ lineWrapping?: boolean;
140
+ /** CodeMirror language mode */
141
+ language?: CodeMirrorLanguage;
142
+ /** Additional CodeMirror extensions */
143
+ extensions?: Extension[];
144
+ /** Disable tab key for indentation */
145
+ disableTabIndent?: boolean;
146
+ /** Disable enter key */
147
+ disableEnter?: boolean;
148
+ /** Disable automatic bracket closing */
149
+ disableCloseBrackets?: boolean;
150
+ /** Emit submit event on blur */
151
+ emitOnBlur?: boolean;
152
+ /** Enable environment variable pills */
153
+ withVariables?: boolean;
154
+ /** Detect and emit curl commands */
155
+ importCurl?: boolean;
156
+ /** Emit change event even if the value is the same */
157
+ alwaysEmitChange?: boolean;
158
+ /** Custom change handler, prevents default emit */
159
+ handleFieldChange?: (value: string) => void;
160
+ /** Custom submit handler, prevents default emit */
161
+ handleFieldSubmit?: (value: string) => void;
162
+ /** Put a linethrough on the input text */
163
+ linethrough?: boolean;
164
+ }> & Readonly<{
165
+ onSubmit?: ((value: string) => any) | undefined;
166
+ onRedirectToEnvironment?: (() => any) | undefined;
167
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
168
+ onBlur?: ((value: string) => any) | undefined;
169
+ onCurl?: ((value: string) => any) | undefined;
170
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
171
+ warning?: (props: {}) => any;
172
+ } & {
173
+ icon?: (props: {}) => any;
174
+ }>;
175
+ export default _default;
176
+ type __VLS_WithSlots<T, S> = T & {
177
+ new (): {
178
+ $slots: S;
115
179
  };
116
- emit: ((evt: "submit", value: string) => void) & ((evt: "redirectToEnvironment") => void) & ((evt: "update:modelValue", value: T) => void) & ((evt: "blur", value: string) => void) & ((evt: "curl", value: string) => void);
117
- }>) => import("vue").VNode & {
118
- __ctx?: Awaited<typeof __VLS_setup>;
119
180
  };
120
- export default _default;
121
- type __VLS_PrettifyLocal<T> = {
122
- [K in keyof T]: T[K];
123
- } & {};
124
181
  //# sourceMappingURL=CodeInput.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"names":[],"mappings":"AAmuBA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CA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ChF,kBAAkB,GAAG,SAAS;IAC3C,mEAAmE;WAC5D,MAAM,GAAG,MAAM,EAAE;IACxB,sCAAsC;eAC3B,OAAO;IAClB,yBAAyB;YACjB,OAAO;IACf,kDAAkD;aACzC,YAAY;IACrB,mDAAmD;WAC5C,MAAM,EAAE;IACf,2CAA2C;eAChC,MAAM,EAAE;IACnB,2CAA2C;;IAE3C,2CAA2C;eAChC,OAAO;IAClB,uCAAuC;kBACzB,MAAM;IACpB,8BAA8B;eACnB,OAAO;IAClB,oCAAoC;kBACtB,OAAO;IACrB,kCAAkC;kBACpB,OAAO;IACrB,qBAAqB;WACd,OAAO;IACd,2BAA2B;mBACZ,OAAO;IACtB,+BAA+B;eACpB,kBAAkB;IAC7B,uCAAuC;iBAC1B,SAAS,EAAE;IACxB,sCAAsC;uBACnB,OAAO;IAC1B,wBAAwB;mBACT,OAAO;IACtB,wCAAwC;2BACjB,OAAO;IAC9B,gCAAgC;iBACnB,OAAO;IACpB,wCAAwC;oBACxB,OAAO;IACvB,oCAAoC;iBACvB,OAAO;IACpB,sDAAsD;uBACnC,OAAO;IAC1B,mDAAmD;wBAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IAC3C,mDAAmD;wBAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IAC3C,0CAA0C;kBAC5B,OAAO;;;;;;;;cAonBT,CAAC,KAAK,IAAiB,KAAK,GAAG;;WAClC,CAAC,KAAK,IAAiB,KAAK,GAAG;;AA7qB1C,wBAiuBC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e2bff922"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4481799e"]]);
6
6
  export {
7
- e as default
7
+ _ as default
8
8
  };
@@ -1,30 +1,30 @@
1
- import { defineComponent as Q, useAttrs as G, ref as d, computed as s, toRef as r, watch as X, createElementBlock as i, openBlock as a, Fragment as Y, createBlock as y, createCommentVNode as c, normalizeClass as Z, createElementVNode as V, toDisplayString as _, mergeProps as ee, unref as O, withKeys as h, withModifiers as $, createTextVNode as p, renderSlot as I } from "vue";
2
- import { isDefined as te } from "@scalar/helpers/array/is-defined";
3
- import { useCodeMirror as le, useDropdown as ne, colorPicker as oe } from "@scalar/use-codemirror";
4
- import { nanoid as ae } from "nanoid";
5
- import B from "../data-table/DataTableInputSelect.vue.js";
6
- import re from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
- import { pillPlugin as ie, backspaceCommand as ue } from "./code-variable-widget.js";
8
- const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
1
+ import { defineComponent as W, useAttrs as H, ref as d, computed as s, toRef as r, watch as J, createElementBlock as i, openBlock as o, Fragment as Q, createBlock as b, createCommentVNode as f, normalizeClass as G, createElementVNode as V, toDisplayString as X, mergeProps as Y, unref as T, withKeys as h, withModifiers as A, createTextVNode as B, renderSlot as N } from "vue";
2
+ import { isDefined as Z } from "@scalar/helpers/array/is-defined";
3
+ import { useCodeMirror as _, useDropdown as ee, colorPicker as te } from "@scalar/use-codemirror";
4
+ import { nanoid as le } from "nanoid";
5
+ import p from "../data-table/DataTableInputSelect.vue.js";
6
+ import ne from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
+ import { pillPlugin as oe, backspaceCommand as ae } from "./code-variable-widget.js";
8
+ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
9
9
  key: 0,
10
10
  class: "z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block",
11
11
  role: "alert"
12
- }, fe = {
12
+ }, de = {
13
13
  key: 5,
14
14
  class: "centered-y text-orange absolute right-7 text-xs"
15
- }, me = {
15
+ }, se = {
16
16
  key: 6,
17
17
  class: "centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1"
18
- }, ye = {
18
+ }, fe = {
19
19
  key: 7,
20
20
  class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
21
- }, he = {
21
+ }, ce = {
22
22
  inheritAttrs: !1
23
- }, ke = /* @__PURE__ */ Q({
24
- ...he,
23
+ }, xe = /* @__PURE__ */ W({
24
+ ...ce,
25
25
  __name: "CodeInput",
26
26
  props: {
27
- modelValue: {},
27
+ modelValue: { type: [String, Number, Boolean, Array, Object] },
28
28
  environment: {},
29
29
  type: {},
30
30
  disabled: { type: Boolean, default: !1 },
@@ -32,7 +32,7 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
32
32
  layout: { default: "desktop" },
33
33
  enum: {},
34
34
  examples: {},
35
- default: {},
35
+ default: { type: [String, Number, Boolean, Array, Object] },
36
36
  nullable: { type: Boolean, default: !1 },
37
37
  placeholder: {},
38
38
  required: { type: Boolean },
@@ -54,57 +54,46 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
54
54
  linethrough: { type: Boolean }
55
55
  },
56
56
  emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
57
- setup(e, { expose: M, emit: N }) {
58
- const u = N, k = G(), R = k.id || `id-${ae()}`, b = d(!1), q = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(() => e.nullable ? ["true", "false", "null"] : ["true", "false"]), z = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
59
- if (!e.alwaysEmitChange && t === f(e.modelValue))
60
- return;
61
- if (typeof t == "string" && e.importCurl && t.trim().toLowerCase().startsWith("curl")) {
62
- u("curl", t), n.value && n.value.dispatch({
63
- changes: {
64
- from: 0,
65
- to: n.value.state.doc.length,
66
- insert: f(e.modelValue)
67
- }
68
- });
69
- return;
57
+ setup(e, { expose: O, emit: $ }) {
58
+ const u = $, k = H(), I = k.id || `id-${le()}`, y = d(!1), M = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(
59
+ () => e.nullable ? ["true", "false", "null"] : ["true", "false"]
60
+ ), R = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
61
+ if (!(!e.alwaysEmitChange && t === c(e.modelValue))) {
62
+ if (e.importCurl && t.trim().toLowerCase().startsWith("curl")) {
63
+ u("curl", t), n.value && n.value.dispatch({
64
+ changes: {
65
+ from: 0,
66
+ to: n.value.state.doc.length,
67
+ insert: c(e.modelValue)
68
+ }
69
+ });
70
+ return;
71
+ }
72
+ e.handleFieldChange ? e.handleFieldChange(t) : u("update:modelValue", t);
70
73
  }
71
- const l = T(t);
72
- e.handleFieldChange ? e.handleFieldChange(l) : u("update:modelValue", l);
73
74
  }, g = (t) => {
74
75
  e.handleFieldSubmit ? e.handleFieldSubmit(t) : u("submit", t);
75
76
  }, S = (t) => {
76
- b.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
77
- }, v = (t) => {
78
- u("update:modelValue", t);
79
- }, W = () => {
77
+ y.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
78
+ }, v = (t) => u("update:modelValue", t), q = () => {
80
79
  const t = [...e.extensions];
81
- return e.colorPicker && t.push(oe), t;
82
- }, K = s(
83
- () => ie({
80
+ return e.colorPicker && t.push(te), t;
81
+ }, z = s(
82
+ () => oe({
84
83
  environment: e.environment,
85
84
  isReadOnly: e.layout === "modal"
86
85
  })
87
- ), L = s(() => [
88
- ...W(),
89
- K.value,
90
- ue
91
- ]), P = d(null), f = (t) => typeof t == "object" ? JSON.stringify(t) : String(t ?? ""), T = (t) => {
92
- const l = t.trim(), o = l.startsWith("[") || l.startsWith("{"), F = typeof e.modelValue;
93
- if (Array.isArray(e.modelValue) && !o && l.includes(","))
94
- return l.split(",").map((H) => H.trim());
95
- if (o || F === "number" || F === "boolean")
96
- try {
97
- return JSON.parse(t);
98
- } catch {
99
- }
100
- return t;
101
- }, { codeMirror: n } = le({
102
- content: r(() => f(e.modelValue)),
86
+ ), j = s(() => [
87
+ ...q(),
88
+ z.value,
89
+ ae
90
+ ]), P = d(null), c = (t) => typeof t == "string" ? t : JSON.stringify(t), { codeMirror: n } = _({
91
+ content: r(() => c(e.modelValue)),
103
92
  onChange: (t) => {
104
- E(t), J();
93
+ E(t), L();
105
94
  },
106
95
  onFocus: () => {
107
- b.value = !0;
96
+ y.value = !0;
108
97
  },
109
98
  onBlur: S,
110
99
  codeMirrorRef: P,
@@ -114,17 +103,17 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
114
103
  lineNumbers: r(() => e.lineNumbers),
115
104
  language: r(() => e.language),
116
105
  lint: r(() => e.lint),
117
- extensions: L,
106
+ extensions: j,
118
107
  placeholder: r(() => e.placeholder)
119
108
  });
120
- X(n, () => {
109
+ J(n, () => {
121
110
  n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
122
111
  });
123
- const w = d(!1), A = d(""), D = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: j, updateDropdownVisibility: J } = ne({
112
+ const w = d(!1), D = d(""), F = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: K, updateDropdownVisibility: L } = ee({
124
113
  codeMirror: n,
125
- query: A,
114
+ query: D,
126
115
  showDropdown: w,
127
- dropdownPosition: D
116
+ dropdownPosition: F
128
117
  }), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t, l) => {
129
118
  if (w.value) {
130
119
  t === "down" || t === "up" ? (l.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (l.preventDefault(), x.value?.handleSelect());
@@ -132,14 +121,14 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
132
121
  }
133
122
  t === "escape" && !e.disableTabIndent && l.stopPropagation(), t === "enter" && l.target instanceof HTMLDivElement && g(l.target.textContent ?? "");
134
123
  };
135
- return M({
124
+ return O({
136
125
  /**
137
126
  * Focus the codemirror element
138
127
  *
139
128
  * @param cursorAtEnd boolean place the cursor at the end of the input
140
129
  */
141
130
  focus: (t) => {
142
- if (!n.value || (n.value.focus(), !te(t)))
131
+ if (!n.value || (n.value.focus(), !Z(t)))
143
132
  return;
144
133
  const l = t === "start" ? 0 : t === "end" ? n.value.state.doc.length : t;
145
134
  n.value.dispatch({
@@ -147,7 +136,7 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
147
136
  scrollIntoView: !0
148
137
  });
149
138
  },
150
- isFocused: b,
139
+ isFocused: y,
151
140
  handleChange: E,
152
141
  handleSubmit: g,
153
142
  handleBlur: S,
@@ -155,41 +144,40 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
155
144
  codeMirror: n,
156
145
  modelValue: e.modelValue,
157
146
  cursorPosition: () => n.value?.state.selection.main.head,
158
- serializeValue: f,
159
- deserializeValue: T
160
- }), (t, l) => (a(), i(Y, null, [
161
- e.disabled ? (a(), i("div", {
147
+ serializeValue: c
148
+ }), (t, l) => (o(), i(Q, null, [
149
+ e.disabled ? (o(), i("div", {
162
150
  key: 0,
163
- class: Z(["text-c-2 flex cursor-default items-center justify-center", {
151
+ class: G(["text-c-2 flex cursor-default items-center justify-center", {
164
152
  "font-code pr-2 pl-1 text-base": e.layout === "modal",
165
153
  "px-2": e.layout !== "modal",
166
154
  "line-through": e.linethrough
167
155
  }]),
168
156
  "data-testid": "code-input-disabled"
169
157
  }, [
170
- V("span", de, _(e.modelValue), 1)
171
- ], 2)) : e.enum?.length ? (a(), y(B, {
158
+ V("span", re, X(e.modelValue), 1)
159
+ ], 2)) : e.enum?.length ? (o(), b(p, {
172
160
  key: 1,
173
161
  default: e.default,
174
162
  modelValue: e.modelValue,
175
- type: z.value,
163
+ type: R.value,
176
164
  value: e.enum,
177
165
  "onUpdate:modelValue": v
178
- }, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (a(), y(B, {
166
+ }, null, 8, ["default", "modelValue", "type", "value"])) : M.value ? (o(), b(p, {
179
167
  key: 2,
180
168
  default: e.default,
181
169
  modelValue: e.modelValue,
182
170
  value: C.value,
183
171
  "onUpdate:modelValue": v
184
- }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (a(), y(B, {
172
+ }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), b(p, {
185
173
  key: 3,
186
174
  default: e.default,
187
175
  modelValue: e.modelValue,
188
176
  value: e.examples,
189
177
  "onUpdate:modelValue": v
190
- }, null, 8, ["default", "modelValue", "value"])) : (a(), i("div", ee({
178
+ }, null, 8, ["default", "modelValue", "value"])) : (o(), i("div", Y({
191
179
  key: 4,
192
- id: O(R)
180
+ id: T(I)
193
181
  }, t.$attrs, {
194
182
  ref_key: "codeMirrorRef",
195
183
  ref: P,
@@ -199,40 +187,40 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
199
187
  "line-through": e.linethrough
200
188
  }],
201
189
  onKeydown: [
202
- l[0] || (l[0] = h($((o) => m("down", o), ["stop"]), ["down"])),
203
- l[1] || (l[1] = h((o) => m("enter", o), ["enter"])),
204
- l[2] || (l[2] = h((o) => m("escape", o), ["escape"])),
205
- l[3] || (l[3] = h($((o) => m("up", o), ["stop"]), ["up"]))
190
+ l[0] || (l[0] = h(A((a) => m("down", a), ["stop"]), ["down"])),
191
+ l[1] || (l[1] = h((a) => m("enter", a), ["enter"])),
192
+ l[2] || (l[2] = h((a) => m("escape", a), ["escape"])),
193
+ l[3] || (l[3] = h(A((a) => m("up", a), ["stop"]), ["up"]))
206
194
  ]
207
195
  }), [
208
- e.disableTabIndent ? c("", !0) : (a(), i("div", ce, [...l[5] || (l[5] = [
209
- p(" Press ", -1),
196
+ e.disableTabIndent ? f("", !0) : (o(), i("div", ue, [...l[5] || (l[5] = [
197
+ B(" Press ", -1),
210
198
  V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
211
- p(" then ", -1),
199
+ B(" then ", -1),
212
200
  V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
213
- p(" to exit ", -1)
201
+ B(" to exit ", -1)
214
202
  ])]))
215
- ], 16, se)),
216
- t.$slots.warning ? (a(), i("div", fe, [
217
- I(t.$slots, "warning", {}, void 0, !0)
218
- ])) : c("", !0),
219
- t.$slots.icon ? (a(), i("div", me, [
220
- I(t.$slots, "icon", {}, void 0, !0)
221
- ])) : c("", !0),
222
- e.required ? (a(), i("div", ye, " Required ")) : c("", !0),
223
- U.value && e.environment ? (a(), y(re, {
203
+ ], 16, ie)),
204
+ t.$slots.warning ? (o(), i("div", de, [
205
+ N(t.$slots, "warning", {}, void 0, !0)
206
+ ])) : f("", !0),
207
+ t.$slots.icon ? (o(), i("div", se, [
208
+ N(t.$slots, "icon", {}, void 0, !0)
209
+ ])) : f("", !0),
210
+ e.required ? (o(), i("div", fe, " Required ")) : f("", !0),
211
+ U.value && e.environment ? (o(), b(ne, {
224
212
  key: 8,
225
213
  ref_key: "dropdownRef",
226
214
  ref: x,
227
- dropdownPosition: D.value,
215
+ dropdownPosition: F.value,
228
216
  environment: e.environment,
229
- query: A.value,
230
- onRedirect: l[4] || (l[4] = (o) => u("redirectToEnvironment")),
231
- onSelect: O(j)
232
- }, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : c("", !0)
217
+ query: D.value,
218
+ onRedirect: l[4] || (l[4] = (a) => u("redirectToEnvironment")),
219
+ onSelect: T(K)
220
+ }, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : f("", !0)
233
221
  ], 64));
234
222
  }
235
223
  });
236
224
  export {
237
- ke as default
225
+ xe as default
238
226
  };
@@ -69,7 +69,7 @@ const b = {
69
69
  type: "document"
70
70
  }), h = n(
71
71
  () => C(o(e.options)?.hiddenClients)
72
- ), f = "2.20.2";
72
+ ), f = "2.21.0";
73
73
  return (t, a) => e.path && e.method && e.exampleName && l.value ? (c(), x(i(p), {
74
74
  key: 0,
75
75
  appVersion: i(f),
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (u) => {
35
35
  u?.createNew && g.name === "request" && p();
36
- }, v = "2.20.2";
36
+ }, v = "2.21.0";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {