@scalar/api-client 3.25.1 → 3.27.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.
- package/CHANGELOG.md +26 -0
- package/dist/style.css +156 -55
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js +33 -3
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +88 -15
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts +35 -0
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js +7 -0
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +9 -4
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js +65 -17
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js +22 -17
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts +9 -0
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.js +60 -0
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.js.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js +31 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js +43 -25
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +8 -8
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +9 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js +14 -4
- package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/localization/locales/ar.d.ts +8 -0
- package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/ar.js +8 -0
- package/dist/v2/features/localization/locales/ar.js.map +1 -1
- package/dist/v2/features/localization/locales/de.d.ts +8 -0
- package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/de.js +8 -0
- package/dist/v2/features/localization/locales/de.js.map +1 -1
- package/dist/v2/features/localization/locales/es.d.ts +8 -0
- package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/es.js +8 -0
- package/dist/v2/features/localization/locales/es.js.map +1 -1
- package/dist/v2/features/localization/locales/fr.d.ts +8 -0
- package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/fr.js +8 -0
- package/dist/v2/features/localization/locales/fr.js.map +1 -1
- package/dist/v2/features/localization/locales/pt.d.ts +8 -0
- package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/pt.js +8 -0
- package/dist/v2/features/localization/locales/pt.js.map +1 -1
- package/dist/v2/features/localization/locales/ru.d.ts +8 -0
- package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/ru.js +8 -0
- package/dist/v2/features/localization/locales/ru.js.map +1 -1
- package/dist/v2/features/localization/locales/zh-cn.d.ts +8 -0
- package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/zh-cn.js +8 -0
- package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
- package/dist/v2/features/localization/locales/zh-tw.d.ts +8 -0
- package/dist/v2/features/localization/locales/zh-tw.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/zh-tw.js +8 -0
- package/dist/v2/features/localization/locales/zh-tw.js.map +1 -1
- package/dist/v2/features/localization/translations.d.ts +8 -0
- package/dist/v2/features/localization/translations.d.ts.map +1 -1
- package/dist/v2/features/localization/translations.js +8 -0
- package/dist/v2/features/localization/translations.js.map +1 -1
- package/dist/vue-styles.css +19 -19
- package/package.json +17 -17
|
@@ -7,6 +7,7 @@ import DataTableRow_default from "../../../components/data-table/DataTableRow.vu
|
|
|
7
7
|
import { getFileName } from "../helpers/files.js";
|
|
8
8
|
import { validateParameter } from "../helpers/validate-parameter.js";
|
|
9
9
|
import RequestTableTooltip_default from "./RequestTableTooltip.vue.js";
|
|
10
|
+
import RequestTableFileList_default from "./RequestTableFileList.vue.js";
|
|
10
11
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
11
12
|
import { ScalarButton } from "@scalar/components/button";
|
|
12
13
|
import { ScalarIconGlobe, ScalarIconTrash } from "@scalar/icons";
|
|
@@ -14,6 +15,7 @@ import { ScalarIcon } from "@scalar/components/icon";
|
|
|
14
15
|
import { ScalarIconButton } from "@scalar/components/icon-button";
|
|
15
16
|
import { unpackProxyObject } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
16
17
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
18
|
+
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
17
19
|
import { isFileSchema } from "@scalar/workspace-store/helpers/is-file-schema";
|
|
18
20
|
//#region src/v2/blocks/request-block/components/RequestTableRow.vue?vue&type=script&setup=true&lang.ts
|
|
19
21
|
var _hoisted_1 = { class: "text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1" };
|
|
@@ -50,6 +52,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
50
52
|
"deleteRow",
|
|
51
53
|
"uploadFile",
|
|
52
54
|
"removeFile",
|
|
55
|
+
"updateFile",
|
|
53
56
|
"navigate",
|
|
54
57
|
"selectPreset"
|
|
55
58
|
],
|
|
@@ -57,7 +60,11 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
57
60
|
const emit = __emit;
|
|
58
61
|
const { translate } = useLocalization();
|
|
59
62
|
const valueInput = useTemplateRef("valueInput");
|
|
60
|
-
|
|
63
|
+
const fileList = useTemplateRef("fileList");
|
|
64
|
+
__expose({ focusValue: () => {
|
|
65
|
+
if (__props.data.files) fileList.value?.focusUpload();
|
|
66
|
+
else valueInput.value?.focus();
|
|
67
|
+
} });
|
|
61
68
|
const name = ref(__props.data.name ?? "");
|
|
62
69
|
const value = ref(unpackProxyObject(__props.data.value) ?? "");
|
|
63
70
|
const isDisabled = ref(__props.data.isDisabled ?? false);
|
|
@@ -71,6 +78,8 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
71
78
|
const isFile = computed(() => value.value instanceof File);
|
|
72
79
|
/** Whether this row’s schema accepts a file part. */
|
|
73
80
|
const canUploadFile = computed(() => __props.data.schema ? isFileSchema(__props.data.schema, true, __props.data.contentType) : __props.allowUnknownFileUploads);
|
|
81
|
+
const fileUploadLabel = computed(() => translate(__props.data.schema && isArraySchema(__props.data.schema) ? "apiClient.requestTableRow.selectFiles" : "apiClient.requestTableRow.selectFile"));
|
|
82
|
+
const hasMixedFileSelection = computed(() => Boolean(__props.data.files?.some((file) => file.isDisabled) && __props.data.files.some((file) => !file.isDisabled)));
|
|
74
83
|
/** Display value handles File instances and shows filename instead */
|
|
75
84
|
const displayValue = computed(() => (isFile.value ? getFileName(value.value) : value.value) ?? "");
|
|
76
85
|
const defaultValue = computed(() => __props.data.schema?.default);
|
|
@@ -134,16 +143,19 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
134
143
|
default: withCtx(() => [
|
|
135
144
|
createVNode(unref(DataTableCheckbox_default), {
|
|
136
145
|
ariaLabel: unref(translate)("apiClient.requestTableRow.include", { name: __props.data.name || unref(translate)("apiClient.requestTableRow.row") }),
|
|
137
|
-
class: "!border-r",
|
|
146
|
+
class: normalizeClass(["!border-r", { "max-h-none": __props.data.files }]),
|
|
138
147
|
disabled: __props.hasCheckboxDisabled ?? false,
|
|
148
|
+
indeterminate: hasMixedFileSelection.value,
|
|
139
149
|
modelValue: !isDisabled.value,
|
|
140
150
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => handleUpdateRow({ isDisabled: !v }))
|
|
141
151
|
}, null, 8, [
|
|
142
152
|
"ariaLabel",
|
|
153
|
+
"class",
|
|
143
154
|
"disabled",
|
|
155
|
+
"indeterminate",
|
|
144
156
|
"modelValue"
|
|
145
157
|
]),
|
|
146
|
-
createVNode(unref(DataTableCell_default),
|
|
158
|
+
createVNode(unref(DataTableCell_default), { class: normalizeClass({ "max-h-none": __props.data.files }) }, {
|
|
147
159
|
default: withCtx(() => [createVNode(unref(CodeInputLite_default), {
|
|
148
160
|
"aria-label": unref(translate)("apiClient.requestTableRow.keyLabel", { name: __props.label ?? "" }),
|
|
149
161
|
disabled: __props.data.isReadonly,
|
|
@@ -164,14 +176,46 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
164
176
|
"required"
|
|
165
177
|
])]),
|
|
166
178
|
_: 1
|
|
167
|
-
}),
|
|
168
|
-
|
|
179
|
+
}, 8, ["class"]),
|
|
180
|
+
__props.data.files ? (openBlock(), createBlock(unref(DataTableCell_default), {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "col-span-2 max-h-none",
|
|
183
|
+
colspan: 2
|
|
184
|
+
}, {
|
|
185
|
+
default: withCtx(() => [createVNode(RequestTableFileList_default, {
|
|
186
|
+
ref_key: "fileList",
|
|
187
|
+
ref: fileList,
|
|
188
|
+
disabled: __props.data.isReadonly,
|
|
189
|
+
files: __props.data.files,
|
|
190
|
+
name: name.value,
|
|
191
|
+
onRemoveFile: _cache[4] || (_cache[4] = (index) => emit("removeFile", index)),
|
|
192
|
+
onUpdateFile: _cache[5] || (_cache[5] = (index, disabled) => emit("updateFile", index, disabled)),
|
|
193
|
+
onUploadFile: _cache[6] || (_cache[6] = ($event) => emit("uploadFile"))
|
|
194
|
+
}, {
|
|
195
|
+
default: withCtx(() => [__props.data.schema ? (openBlock(), createBlock(RequestTableTooltip_default, {
|
|
196
|
+
key: 0,
|
|
197
|
+
description: __props.data.description,
|
|
198
|
+
schema: __props.data.schema,
|
|
199
|
+
value: value.value
|
|
200
|
+
}, null, 8, [
|
|
201
|
+
"description",
|
|
202
|
+
"schema",
|
|
203
|
+
"value"
|
|
204
|
+
])) : createCommentVNode("", true)]),
|
|
205
|
+
_: 1
|
|
206
|
+
}, 8, [
|
|
207
|
+
"disabled",
|
|
208
|
+
"files",
|
|
209
|
+
"name"
|
|
210
|
+
])]),
|
|
211
|
+
_: 1
|
|
212
|
+
})) : (openBlock(), createBlock(unref(DataTableCell_default), { key: 1 }, {
|
|
169
213
|
default: withCtx(() => [__props.data.presetOptions?.length ? (openBlock(), createBlock(unref(DataTableInputSelect_default), {
|
|
170
214
|
key: 0,
|
|
171
215
|
canAddCustomValue: false,
|
|
172
216
|
modelValue: displayValue.value,
|
|
173
217
|
value: __props.data.presetOptions,
|
|
174
|
-
"onUpdate:modelValue": _cache[
|
|
218
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => emit("selectPreset", v))
|
|
175
219
|
}, null, 8, ["modelValue", "value"])) : (openBlock(), createBlock(unref(CodeInputLite_default), {
|
|
176
220
|
key: 1,
|
|
177
221
|
ref_key: "valueInput",
|
|
@@ -189,8 +233,8 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
189
233
|
placeholder: unref(translate)("apiClient.requestTableRow.value"),
|
|
190
234
|
type: typeValue.value,
|
|
191
235
|
withFakeData: "",
|
|
192
|
-
onNavigate: _cache[
|
|
193
|
-
"onUpdate:modelValue": _cache[
|
|
236
|
+
onNavigate: _cache[10] || (_cache[10] = (route) => emit("navigate", route)),
|
|
237
|
+
"onUpdate:modelValue": _cache[11] || (_cache[11] = (v) => handleUpdateRow({ value: v }))
|
|
194
238
|
}, {
|
|
195
239
|
icon: withCtx(() => [
|
|
196
240
|
Boolean(__props.data.name || value.value) && !__props.data.isRequired && __props.data.isReadonly !== true ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
@@ -199,7 +243,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
199
243
|
class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex",
|
|
200
244
|
size: "sm",
|
|
201
245
|
variant: "ghost",
|
|
202
|
-
onClick: _cache[
|
|
246
|
+
onClick: _cache[8] || (_cache[8] = ($event) => emit("deleteRow"))
|
|
203
247
|
}, {
|
|
204
248
|
default: withCtx(() => [createVNode(unref(ScalarIconTrash), { class: "size-3.5" })]),
|
|
205
249
|
_: 1
|
|
@@ -212,7 +256,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
212
256
|
size: "xs",
|
|
213
257
|
tooltip: "top",
|
|
214
258
|
variant: "ghost",
|
|
215
|
-
onClick: _cache[
|
|
259
|
+
onClick: _cache[9] || (_cache[9] = ($event) => emit("navigate", __props.data.globalRoute))
|
|
216
260
|
}, null, 8, ["icon", "label"])) : createCommentVNode("", true),
|
|
217
261
|
__props.data.isReadonly ? (openBlock(), createBlock(RequestTableTooltip_default, {
|
|
218
262
|
key: 2,
|
|
@@ -244,9 +288,9 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
244
288
|
"type"
|
|
245
289
|
]))]),
|
|
246
290
|
_: 1
|
|
247
|
-
}),
|
|
248
|
-
__props.showUploadButton ? (openBlock(), createBlock(unref(DataTableCell_default), {
|
|
249
|
-
key:
|
|
291
|
+
})),
|
|
292
|
+
__props.showUploadButton && !__props.data.files ? (openBlock(), createBlock(unref(DataTableCell_default), {
|
|
293
|
+
key: 2,
|
|
250
294
|
class: "group/upload flex items-center justify-center whitespace-nowrap"
|
|
251
295
|
}, {
|
|
252
296
|
default: withCtx(() => [isFile.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("div", _hoisted_1, [createElementVNode("span", {
|
|
@@ -255,21 +299,25 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
255
299
|
}, toDisplayString(displayValue.value), 9, _hoisted_2)]), createElementVNode("button", {
|
|
256
300
|
class: "bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100",
|
|
257
301
|
type: "button",
|
|
258
|
-
onClick: _cache[
|
|
302
|
+
onClick: _cache[12] || (_cache[12] = ($event) => emit("removeFile"))
|
|
259
303
|
}, toDisplayString(unref(translate)("apiClient.requestTableRow.delete")), 1)], 64)) : canUploadFile.value ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(ScalarButton), {
|
|
304
|
+
"aria-label": unref(translate)("apiClient.requestTableRow.uploadFor", {
|
|
305
|
+
action: fileUploadLabel.value,
|
|
306
|
+
name: name.value || unref(translate)("apiClient.requestTableRow.row")
|
|
307
|
+
}),
|
|
260
308
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
261
309
|
size: "sm",
|
|
262
310
|
variant: "outlined",
|
|
263
|
-
onClick: _cache[
|
|
311
|
+
onClick: _cache[13] || (_cache[13] = ($event) => emit("uploadFile"))
|
|
264
312
|
}, {
|
|
265
|
-
default: withCtx(() => [createElementVNode("span", null, toDisplayString(
|
|
313
|
+
default: withCtx(() => [createElementVNode("span", null, toDisplayString(fileUploadLabel.value), 1), createVNode(unref(ScalarIcon), {
|
|
266
314
|
class: "ml-1",
|
|
267
315
|
icon: "Upload",
|
|
268
316
|
size: "xs",
|
|
269
317
|
thickness: "2.5"
|
|
270
318
|
})]),
|
|
271
319
|
_: 1
|
|
272
|
-
})])) : createCommentVNode("", true)]),
|
|
320
|
+
}, 8, ["aria-label"])])) : createCommentVNode("", true)]),
|
|
273
321
|
_: 1
|
|
274
322
|
})) : createCommentVNode("", true)
|
|
275
323
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableRow.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTableRow","_normalizeClass","_withCtx","_createVNode","DataTableCheckbox","DataTableCell","CodeInputLite","DataTableInputSelect","_createCommentVNode","RequestTableTooltip","_createElementBlock","_Fragment","_createElementVNode","_toDisplayString"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n allowUnknownFileUploads = true,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n /** Unknown fields remain editable as files only in free-form multipart requests. */\n allowUnknownFileUploads?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst valueInput = useTemplateRef('valueInput')\ndefineExpose({ focusValue: (): void => valueInput.value?.focus() })\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Explicit media type for this multipart field. */\n contentType?: string\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Text representation used by array enum controls. */\n arrayEncoding?: 'json' | 'comma-separated'\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value && !deferKeyUpdates) {\n return\n }\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Whether this row’s schema accepts a file part. */\nconst canUploadFile = computed<boolean>(() =>\n data.schema\n ? isFileSchema(data.schema, true, data.contentType)\n : allowUnknownFileUploads,\n)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<unknown[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return data.arrayEncoding === 'json'\n ? resolved.enum\n : resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name && (!deferKeyUpdates || name.value !== '')) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n ref=\"valueInput\"\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n :arrayEncoding=\"data.arrayEncoding\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else-if=\"canUploadFile\">\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ translate('apiClient.requestTableRow.selectFile') }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDA,MAAM,OAAO;EAUb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,aAAa,eAAe,YAAY;EAC9C,SAAa,EAAE,kBAAwB,WAAW,OAAO,MAAM,EAAE,CAAC;EA2DlE,MAAM,OAAO,IAAY,QAAA,KAAK,QAAQ,EAAE;EACxC,MAAM,QAAQ,IAAmB,kBAAkB,QAAA,KAAK,KAAK,KAAK,EAAE;EACpE,MAAM,aAAa,IAAa,QAAA,KAAK,cAAc,KAAK;EAGxD,YACQ,QAAA,KAAK,OACV,YAAY;GAIX,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,QAAA,iBAC7B;GAEF,KAAK,QAAQ,WAAW;EAC1B,CACF;EACA,YACQ,QAAA,KAAK,QACV,aAAc,MAAM,QAAQ,kBAAkB,QAAQ,KAAK,EAC9D;EACA,YACQ,QAAA,KAAK,aACV,kBAAmB,WAAW,QAAQ,iBAAiB,KAC1D;;EAGA,MAAM,SAAS,eAAe,MAAM,iBAAiB,IAAI;;EAGzD,MAAM,gBAAgB,eACpB,QAAA,KAAK,SACD,aAAa,QAAA,KAAK,QAAQ,MAAM,QAAA,KAAK,WAAW,IAChD,QAAA,uBACN;;EAGA,MAAM,eAAe,gBAEhB,OAAO,QACJ,YAAY,MAAM,KAAa,IAC9B,MAAM,UAAqB,EACpC;EAEA,MAAM,eAAe,eAAe,QAAA,KAAK,QAAQ,OAAiB;;EAGlE,MAAM,YAAY,eAA0B;GA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OAbN,YAaM,CAZJP,YAWeJ,MAAA,YAAA,GAAA;OAVb,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;OACZ,SAAAG,cAAoE,CAApEU,mBAAoE,QAAA,MAAAC,gBAA3Dd,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,GAClBI,YAIoBJ,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
|
|
1
|
+
{"version":3,"file":"RequestTableRow.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTableRow","_normalizeClass","_withCtx","_createVNode","DataTableCheckbox","DataTableCell","CodeInputLite","RequestTableFileList","RequestTableTooltip","_createCommentVNode","DataTableInputSelect","_createElementBlock","_Fragment","_createElementVNode","_toDisplayString"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\nimport RequestTableFileList, {\n type RequestTableFile,\n} from './RequestTableFileList.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n allowUnknownFileUploads = true,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n /** Unknown fields remain editable as files only in free-form multipart requests. */\n allowUnknownFileUploads?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile', fileIndex?: number): void\n (e: 'updateFile', fileIndex: number, isDisabled: boolean): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst valueInput = useTemplateRef('valueInput')\nconst fileList = useTemplateRef('fileList')\ndefineExpose({\n focusValue: (): void => {\n if (data.files) {\n fileList.value?.focusUpload()\n } else {\n valueInput.value?.focus()\n }\n },\n})\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Selected files grouped for display; source rows remain separate multipart parts. */\n files?: RequestTableFile[]\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Explicit media type for this multipart field. */\n contentType?: string\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Text representation used by array enum controls. */\n arrayEncoding?: 'json' | 'comma-separated'\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value && !deferKeyUpdates) {\n return\n }\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Whether this row’s schema accepts a file part. */\nconst canUploadFile = computed<boolean>(() =>\n data.schema\n ? isFileSchema(data.schema, true, data.contentType)\n : allowUnknownFileUploads,\n)\n\nconst fileUploadLabel = computed<string>(() =>\n translate(\n data.schema && isArraySchema(data.schema)\n ? 'apiClient.requestTableRow.selectFiles'\n : 'apiClient.requestTableRow.selectFile',\n ),\n)\n\nconst hasMixedFileSelection = computed<boolean>(() =>\n Boolean(\n data.files?.some((file) => file.isDisabled) &&\n data.files.some((file) => !file.isDisabled),\n ),\n)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<unknown[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return data.arrayEncoding === 'json'\n ? resolved.enum\n : resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name && (!deferKeyUpdates || name.value !== '')) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :class=\"{ 'max-h-none': data.files }\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :indeterminate=\"hasMixedFileSelection\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell :class=\"{ 'max-h-none': data.files }\">\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell\n v-if=\"data.files\"\n class=\"col-span-2 max-h-none\"\n :colspan=\"2\">\n <RequestTableFileList\n ref=\"fileList\"\n :disabled=\"data.isReadonly\"\n :files=\"data.files\"\n :name=\"name\"\n @removeFile=\"(index) => emit('removeFile', index)\"\n @updateFile=\"(index, disabled) => emit('updateFile', index, disabled)\"\n @uploadFile=\"emit('uploadFile')\">\n <RequestTableTooltip\n v-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value=\"value\" />\n </RequestTableFileList>\n </DataTableCell>\n <DataTableCell v-else>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n ref=\"valueInput\"\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n :arrayEncoding=\"data.arrayEncoding\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton && !data.files\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else-if=\"canUploadFile\">\n <div class=\"p-0.5\">\n <ScalarButton\n :aria-label=\"\n translate('apiClient.requestTableRow.uploadFor', {\n action: fileUploadLabel,\n name: name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ fileUploadLabel }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDA,MAAM,OAAO;EAWb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,aAAa,eAAe,YAAY;EAC9C,MAAM,WAAW,eAAe,UAAU;EAC1C,SAAa,EACX,kBAAwB;GACtB,IAAI,QAAA,KAAK,OACP,SAAS,OAAO,YAAY;QAE5B,WAAW,OAAO,MAAM;EAE5B,EACF,CAAC;EA6DD,MAAM,OAAO,IAAY,QAAA,KAAK,QAAQ,EAAE;EACxC,MAAM,QAAQ,IAAmB,kBAAkB,QAAA,KAAK,KAAK,KAAK,EAAE;EACpE,MAAM,aAAa,IAAa,QAAA,KAAK,cAAc,KAAK;EAGxD,YACQ,QAAA,KAAK,OACV,YAAY;GAIX,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,QAAA,iBAC7B;GAEF,KAAK,QAAQ,WAAW;EAC1B,CACF;EACA,YACQ,QAAA,KAAK,QACV,aAAc,MAAM,QAAQ,kBAAkB,QAAQ,KAAK,EAC9D;EACA,YACQ,QAAA,KAAK,aACV,kBAAmB,WAAW,QAAQ,iBAAiB,KAC1D;;EAGA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AAA,SAAA,CAAS,CAAA,kCAAA,CAAA,GAAA,CAAA,C,UAGK,cAAA,SACnBF,UAAA,GAAAc,mBAmBM,OAnBN,YAmBM,CAlBJR,YAiBeJ,MAAA,YAAA,GAAA;OAhBZ,cAA2BA,MAAA,SAAA,CAAS,CAAA,uCAAA;QAAkE,QAAA,gBAAA;QAAuC,MAAA,KAAA,SAAQA,MAAA,SAAA,CAAS,CAAA,+BAAA;;OAM/J,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;OACZ,SAAAG,cAAkC,CAAlCW,mBAAkC,QAAA,MAAAC,gBAAzB,gBAAA,KAAe,GAAA,CAAA,GACxBX,YAIoBJ,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"AAoGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AA2LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableTooltip.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded
|
|
1
|
+
{"version":3,"file":"RequestTableTooltip.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, toDisplayString } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\nconst schemaDetails = computed<string[]>(() => {\n if (!schema) {\n return []\n }\n\n const type = 'type' in schema ? schema.type : undefined\n\n return [\n Array.isArray(type) ? type.join(' | ') : (type ?? ''),\n 'format' in schema ? (schema.format ?? '') : '',\n 'minimum' in schema && schema.minimum !== undefined\n ? `${translate('apiClient.requestTableTooltip.min')} ${schema.minimum}`\n : '',\n 'maximum' in schema && schema.maximum !== undefined\n ? `${translate('apiClient.requestTableTooltip.max')} ${schema.maximum}`\n : '',\n 'default' in schema && schema.default !== undefined\n ? `${translate('apiClient.requestTableTooltip.default')} ${toDisplayString(schema.default)}`\n : '',\n ].filter((detail) => detail.trim().length > 0)\n})\nconst hasDescription = computed<boolean>(() => Boolean(description?.trim()))\nconst hasContent = computed<boolean>(\n () =>\n isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value,\n)\n</script>\n<template>\n <ScalarPopover\n v-if=\"hasContent\"\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"schemaDetails.length\"\n class=\"schema text-c-2 *:not-first:before:content-['_·_']\">\n <span\n v-for=\"(detail, index) in schemaDetails\"\n :key=\"index\"\n >{{ detail }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"hasDescription && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useLocalization } from "../../../features/localization/index.js";
|
|
2
2
|
import { validateParameter } from "../helpers/validate-parameter.js";
|
|
3
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
4
4
|
import { ScalarIconInfo, ScalarIconWarning } from "@scalar/icons";
|
|
5
5
|
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
6
6
|
import { ScalarPopover } from "@scalar/components/popover";
|
|
7
7
|
//#region src/v2/blocks/request-block/components/RequestTableTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var _hoisted_1 = ["aria-label", "role"];
|
|
9
9
|
var _hoisted_2 = {
|
|
10
|
-
class: "text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded
|
|
10
|
+
class: "text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere",
|
|
11
11
|
"data-testid": "request-table-tooltip-content"
|
|
12
12
|
};
|
|
13
13
|
var _hoisted_3 = {
|
|
@@ -16,13 +16,8 @@ var _hoisted_3 = {
|
|
|
16
16
|
};
|
|
17
17
|
var _hoisted_4 = {
|
|
18
18
|
key: 1,
|
|
19
|
-
class: "schema text-c-2
|
|
19
|
+
class: "schema text-c-2 *:not-first:before:content-['_·_']"
|
|
20
20
|
};
|
|
21
|
-
var _hoisted_5 = { key: 0 };
|
|
22
|
-
var _hoisted_6 = { key: 1 };
|
|
23
|
-
var _hoisted_7 = { key: 2 };
|
|
24
|
-
var _hoisted_8 = { key: 3 };
|
|
25
|
-
var _hoisted_9 = { key: 4 };
|
|
26
21
|
var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
27
22
|
__name: "RequestTableTooltip",
|
|
28
23
|
props: {
|
|
@@ -34,19 +29,29 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
34
29
|
const { translate } = useLocalization();
|
|
35
30
|
const invalidParameterMessage = computed(() => validateParameter(__props.schema, __props.value));
|
|
36
31
|
const isInvalid = computed(() => invalidParameterMessage.value.ok === false);
|
|
32
|
+
const schemaDetails = computed(() => {
|
|
33
|
+
if (!__props.schema) return [];
|
|
34
|
+
const type = "type" in __props.schema ? __props.schema.type : void 0;
|
|
35
|
+
return [
|
|
36
|
+
Array.isArray(type) ? type.join(" | ") : type ?? "",
|
|
37
|
+
"format" in __props.schema ? __props.schema.format ?? "" : "",
|
|
38
|
+
"minimum" in __props.schema && __props.schema.minimum !== void 0 ? `${translate("apiClient.requestTableTooltip.min")} ${__props.schema.minimum}` : "",
|
|
39
|
+
"maximum" in __props.schema && __props.schema.maximum !== void 0 ? `${translate("apiClient.requestTableTooltip.max")} ${__props.schema.maximum}` : "",
|
|
40
|
+
"default" in __props.schema && __props.schema.default !== void 0 ? `${translate("apiClient.requestTableTooltip.default")} ${toDisplayString(__props.schema.default)}` : ""
|
|
41
|
+
].filter((detail) => detail.trim().length > 0);
|
|
42
|
+
});
|
|
43
|
+
const hasDescription = computed(() => Boolean(__props.description?.trim()));
|
|
44
|
+
const hasContent = computed(() => isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value);
|
|
37
45
|
return (_ctx, _cache) => {
|
|
38
|
-
return openBlock(), createBlock(unref(ScalarPopover), {
|
|
46
|
+
return hasContent.value ? (openBlock(), createBlock(unref(ScalarPopover), {
|
|
47
|
+
key: 0,
|
|
39
48
|
offset: 4,
|
|
40
49
|
placement: "left",
|
|
41
50
|
teleport: ""
|
|
42
51
|
}, {
|
|
43
|
-
popover: withCtx(() => [createElementVNode("div", _hoisted_2, [invalidParameterMessage.value.ok === false ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(invalidParameterMessage.value.message), 1)) :
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"minimum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(translate)("apiClient.requestTableTooltip.min")) + " " + toDisplayString(__props.schema.minimum), 1)) : createCommentVNode("", true),
|
|
47
|
-
"maximum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(translate)("apiClient.requestTableTooltip.max")) + " " + toDisplayString(__props.schema.maximum), 1)) : createCommentVNode("", true),
|
|
48
|
-
"default" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(translate)("apiClient.requestTableTooltip.default")) + " " + toDisplayString(__props.schema.default), 1)) : createCommentVNode("", true)
|
|
49
|
-
])) : createCommentVNode("", true), __props.description && !isInvalid.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
52
|
+
popover: withCtx(() => [createElementVNode("div", _hoisted_2, [invalidParameterMessage.value.ok === false ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(invalidParameterMessage.value.message), 1)) : schemaDetails.value.length ? (openBlock(), createElementBlock("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(schemaDetails.value, (detail, index) => {
|
|
53
|
+
return openBlock(), createElementBlock("span", { key: index }, toDisplayString(detail), 1);
|
|
54
|
+
}), 128))])) : createCommentVNode("", true), hasDescription.value && !isInvalid.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
50
55
|
key: 2,
|
|
51
56
|
value: __props.description
|
|
52
57
|
}, null, 8, ["value"])) : createCommentVNode("", true)])]),
|
|
@@ -63,7 +68,7 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
63
68
|
class: "text-c-2 hover:text-c-1 size-3.5"
|
|
64
69
|
}))], 8, _hoisted_1)]),
|
|
65
70
|
_: 1
|
|
66
|
-
});
|
|
71
|
+
})) : createCommentVNode("", true);
|
|
67
72
|
};
|
|
68
73
|
}
|
|
69
74
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTableTooltip.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded
|
|
1
|
+
{"version":3,"file":"RequestTableTooltip.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_toDisplayString","_Fragment","_renderList","_createCommentVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, toDisplayString } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\nconst schemaDetails = computed<string[]>(() => {\n if (!schema) {\n return []\n }\n\n const type = 'type' in schema ? schema.type : undefined\n\n return [\n Array.isArray(type) ? type.join(' | ') : (type ?? ''),\n 'format' in schema ? (schema.format ?? '') : '',\n 'minimum' in schema && schema.minimum !== undefined\n ? `${translate('apiClient.requestTableTooltip.min')} ${schema.minimum}`\n : '',\n 'maximum' in schema && schema.maximum !== undefined\n ? `${translate('apiClient.requestTableTooltip.max')} ${schema.maximum}`\n : '',\n 'default' in schema && schema.default !== undefined\n ? `${translate('apiClient.requestTableTooltip.default')} ${toDisplayString(schema.default)}`\n : '',\n ].filter((detail) => detail.trim().length > 0)\n})\nconst hasDescription = computed<boolean>(() => Boolean(description?.trim()))\nconst hasContent = computed<boolean>(\n () =>\n isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value,\n)\n</script>\n<template>\n <ScalarPopover\n v-if=\"hasContent\"\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"schemaDetails.length\"\n class=\"schema text-c-2 *:not-first:before:content-['_·_']\">\n <span\n v-for=\"(detail, index) in schemaDetails\"\n :key=\"index\"\n >{{ detail }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"hasDescription && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,0BAA0B,eAAe,kBAAkB,QAAA,QAAQ,QAAA,KAAK,CAAC;EAC/E,MAAM,YAAY,eAAe,wBAAwB,MAAM,OAAO,KAAK;EAC3E,MAAM,gBAAgB,eAAyB;GAC7C,IAAI,CAAC,QAAA,QACH,OAAO,CAAC;GAGV,MAAM,OAAO,UAAU,QAAA,SAAS,QAAA,OAAO,OAAO,KAAA;GAE9C,OAAO;IACL,MAAM,QAAQ,IAAI,IAAI,KAAK,K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eS,CAfTC,mBAeS,UAAA;KAdN,cAAqB,UAAA,QAAsBF,MAAA,SAAA,CAAS,CAAA,uCAAA,IAAsDA,MAAA,SAAA,CAAS,CAAA,+CAAA;KAKpH,OAAM;KACL,MAAM,UAAA,QAAS,UAAA;KAChB,MAAK;I,IAEG,UAAA,SADRF,UAAA,GAAAC,YAEmEC,MAAA,iBAAA,GAAA;;KAAjE,OAAM;I,OACRF,UAAA,GAAAC,YAE6CC,MAAA,cAAA,GAAA;;KAA3C,OAAM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TableRow } from '../components/RequestTableRow.vue.js';
|
|
2
|
+
/** A visible field with the source rows used to serialize its multipart parts. */
|
|
3
|
+
export type FormBodyField = {
|
|
4
|
+
data: TableRow;
|
|
5
|
+
sourceIndices: number[];
|
|
6
|
+
};
|
|
7
|
+
/** Group uploaded files for array fields without changing stored values or multipart serialization. */
|
|
8
|
+
export declare const groupFormBodyFiles: (rows: TableRow[]) => FormBodyField[];
|
|
9
|
+
//# sourceMappingURL=group-form-body-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-form-body-files.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/group-form-body-files.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAEjE,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAA;IACd,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAgCD,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,GAAI,MAAM,QAAQ,EAAE,KAAG,aAAa,EA6BlE,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
2
|
+
import { isFileSchema } from "@scalar/workspace-store/helpers/is-file-schema";
|
|
3
|
+
import { resolveSchemaWithAnnotations } from "@scalar/workspace-store/helpers/resolve-schema-with-annotations";
|
|
4
|
+
//#region src/v2/blocks/request-block/helpers/group-form-body-files.ts
|
|
5
|
+
/** Empty fields must keep text editing unless every non-null alternative requires a file. */
|
|
6
|
+
var requiresFile = (input, contentType, ancestors = /* @__PURE__ */ new Set()) => {
|
|
7
|
+
if (!input || ancestors.has(input)) return false;
|
|
8
|
+
const schema = resolveSchemaWithAnnotations(input);
|
|
9
|
+
if (!schema || !isFileSchema(schema, false, contentType)) return false;
|
|
10
|
+
const seen = /* @__PURE__ */ new Set([...ancestors, input]);
|
|
11
|
+
if ("type" in schema || "format" in schema && schema.format === "binary") return true;
|
|
12
|
+
const alternatives = schema.oneOf ?? schema.anyOf;
|
|
13
|
+
if (alternatives?.length) return alternatives.every((member) => {
|
|
14
|
+
const resolved = resolveSchemaWithAnnotations(member);
|
|
15
|
+
return resolved && "type" in resolved && resolved.type === "null" || requiresFile(member, contentType, seen);
|
|
16
|
+
});
|
|
17
|
+
if (schema.allOf?.length) return schema.allOf.some((member) => requiresFile(member, contentType, seen));
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
/** Group uploaded files for array fields without changing stored values or multipart serialization. */
|
|
21
|
+
var groupFormBodyFiles = (rows) => {
|
|
22
|
+
const fields = [];
|
|
23
|
+
const fileFields = /* @__PURE__ */ new Map();
|
|
24
|
+
rows.forEach((row, index) => {
|
|
25
|
+
const isFileArray = row.schema && isArraySchema(row.schema) && (row.value instanceof File || requiresFile(row.schema.items, row.contentType));
|
|
26
|
+
const canGroup = row.value instanceof File || row.value === "" || row.value === "[]" || row.value === null;
|
|
27
|
+
if (!isFileArray || !canGroup) {
|
|
28
|
+
fields.push({
|
|
29
|
+
data: row,
|
|
30
|
+
sourceIndices: [index]
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const field = fileFields.get(row.name) ?? {
|
|
35
|
+
data: {
|
|
36
|
+
...row,
|
|
37
|
+
files: []
|
|
38
|
+
},
|
|
39
|
+
sourceIndices: []
|
|
40
|
+
};
|
|
41
|
+
if (!fileFields.has(row.name)) {
|
|
42
|
+
fields.push(field);
|
|
43
|
+
fileFields.set(row.name, field);
|
|
44
|
+
}
|
|
45
|
+
field.sourceIndices.push(index);
|
|
46
|
+
if (row.value instanceof File) {
|
|
47
|
+
field.data.files?.push({
|
|
48
|
+
file: row.value,
|
|
49
|
+
index,
|
|
50
|
+
isDisabled: row.isDisabled ?? false
|
|
51
|
+
});
|
|
52
|
+
field.data.isDisabled = field.data.files?.every((file) => file.isDisabled) ?? false;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return fields;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { groupFormBodyFiles };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=group-form-body-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-form-body-files.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/helpers/group-form-body-files.ts"],"sourcesContent":["import { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveSchemaWithAnnotations } from '@scalar/workspace-store/helpers/resolve-schema-with-annotations'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/schema'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport type { TableRow } from '../components/RequestTableRow.vue'\n\n/** A visible field with the source rows used to serialize its multipart parts. */\nexport type FormBodyField = {\n data: TableRow\n sourceIndices: number[]\n}\n\n/** Empty fields must keep text editing unless every non-null alternative requires a file. */\nconst requiresFile = (\n input: MaybeRefSchemaObject | undefined,\n contentType?: string,\n ancestors = new Set<MaybeRefSchemaObject>(),\n): boolean => {\n if (!input || ancestors.has(input)) {\n return false\n }\n const schema: SchemaObject | undefined = resolveSchemaWithAnnotations(input)\n if (!schema || !isFileSchema(schema, false, contentType)) {\n return false\n }\n const seen = new Set([...ancestors, input])\n if ('type' in schema || ('format' in schema && schema.format === 'binary')) {\n return true\n }\n const alternatives = schema.oneOf ?? schema.anyOf\n if (alternatives?.length) {\n return alternatives.every((member) => {\n const resolved = resolveSchemaWithAnnotations(member)\n return (resolved && 'type' in resolved && resolved.type === 'null') || requiresFile(member, contentType, seen)\n })\n }\n if (schema.allOf?.length) {\n return schema.allOf.some((member) => requiresFile(member, contentType, seen))\n }\n return true\n}\n\n/** Group uploaded files for array fields without changing stored values or multipart serialization. */\nexport const groupFormBodyFiles = (rows: TableRow[]): FormBodyField[] => {\n const fields: FormBodyField[] = []\n const fileFields = new Map<string, FormBodyField>()\n\n rows.forEach((row, index) => {\n const isFileArray =\n row.schema &&\n isArraySchema(row.schema) &&\n (row.value instanceof File || requiresFile(row.schema.items, row.contentType))\n // Preserve editable example values, such as variable expressions, until files are selected.\n const canGroup = row.value instanceof File || row.value === '' || row.value === '[]' || row.value === null\n if (!isFileArray || !canGroup) {\n fields.push({ data: row, sourceIndices: [index] })\n return\n }\n\n const field: FormBodyField = fileFields.get(row.name) ?? { data: { ...row, files: [] }, sourceIndices: [] }\n if (!fileFields.has(row.name)) {\n fields.push(field)\n fileFields.set(row.name, field)\n }\n field.sourceIndices.push(index)\n if (row.value instanceof File) {\n field.data.files?.push({ file: row.value, index, isDisabled: row.isDisabled ?? false })\n field.data.isDisabled = field.data.files?.every((file) => file.isDisabled) ?? false\n }\n })\n\n return fields\n}\n"],"mappings":";;;;;AAeA,IAAM,gBACJ,OACA,aACA,4BAAY,IAAI,IAA0B,MAC9B;CACZ,IAAI,CAAC,SAAS,UAAU,IAAI,KAAK,GAC/B,OAAO;CAET,MAAM,SAAmC,6BAA6B,KAAK;CAC3E,IAAI,CAAC,UAAU,CAAC,aAAa,QAAQ,OAAO,WAAW,GACrD,OAAO;CAET,MAAM,uBAAO,IAAI,IAAI,CAAC,GAAG,WAAW,KAAK,CAAC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M,KAAK,OAAO,OAAO,SAAS,KAAK,UAAU,KAAK;EAChF;CACF,CAAC;CAED,OAAO;AACT"}
|
|
@@ -45,12 +45,14 @@ declare const __VLS_export: import("vue").DefineComponent<AddressBarProps, {
|
|
|
45
45
|
"select:history:item": (payload: {
|
|
46
46
|
index: number;
|
|
47
47
|
}) => any;
|
|
48
|
+
"open:browser": () => any;
|
|
48
49
|
execute: () => any;
|
|
49
50
|
"update:webhook-url": (url: string) => any;
|
|
50
51
|
}, string, import("vue").PublicProps, Readonly<AddressBarProps> & Readonly<{
|
|
51
52
|
"onSelect:history:item"?: ((payload: {
|
|
52
53
|
index: number;
|
|
53
54
|
}) => any) | undefined;
|
|
55
|
+
"onOpen:browser"?: (() => any) | undefined;
|
|
54
56
|
onExecute?: (() => any) | undefined;
|
|
55
57
|
"onUpdate:webhook-url"?: ((url: string) => any) | undefined;
|
|
56
58
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAowBA,OAAO,KAAK,EAEV,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAqBhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGzE;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,MAAM,MAAM,eAAe,GAAG;IAC5B,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AACD,QAAA,MAAM,YAAY;;;;;eAwB6B,MAAM;;;;;;;eAAN,MAAM;;;;;kFAihCjD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import AddressBar_vue_vue_type_script_setup_true_lang_default from "./AddressBar.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue
|
|
5
|
-
var AddressBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(AddressBar_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var AddressBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(AddressBar_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b5b0a654"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AddressBar_default as default };
|
|
8
8
|
|