@scalar/api-client 0.1.5 → 0.1.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ApiClient/AddressBar.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA8XA,wBAAkD"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ApiClient/AddressBar.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgYA,wBAAkD"}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeMirror.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeMirror/CodeMirror.vue.ts"],"names":[],"mappings":"AAyDA,KAAK,QAAQ,GAAG,OAAO,GACnB,GAAG,GACH,SAAS,GACT,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,MAAM,GACN,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,GAAG,GACH,MAAM,GACN,OAAO,GACP,OAAO,GACP,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0IT,wBAAkD"}
1
+ {"version":3,"file":"CodeMirror.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeMirror/CodeMirror.vue.ts"],"names":[],"mappings":"AA4DA,KAAK,QAAQ,GACT,OAAO,GACP,GAAG,GACH,SAAS,GACT,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,MAAM,GACN,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,GAAG,GACH,MAAM,GACN,OAAO,GACP,OAAO,GACP,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2IT,wBAAkD"}
package/dist/index.js CHANGED
@@ -5,13 +5,13 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { cloneVNode, h as h$2, Fragment, inject, provide, ref, onMounted, watchEffect, computed, defineComponent, onUnmounted, watch, Teleport, reactive, unref, shallowRef, nextTick, getCurrentScope, onScopeDispose, toRef as toRef$1, readonly, customRef, getCurrentInstance, openBlock, createElementBlock, createBlock, withCtx, createElementVNode, createVNode, normalizeClass, normalizeStyle, createTextVNode, toDisplayString, createCommentVNode, renderSlot, renderList, createStaticVNode, withDirectives, withModifiers, vShow, vModelSelect, vModelText, vModelCheckbox, withKeys } from "vue";
8
- import { json } from "@codemirror/lang-json";
9
- import { MatchDecorator, Decoration, ViewPlugin, EditorView, lineNumbers } from "@codemirror/view";
10
- import { useCodeMirror } from "@scalar/use-codemirror";
11
8
  import { java } from "@codemirror/lang-java";
12
9
  import { javascript } from "@codemirror/lang-javascript";
10
+ import { json } from "@codemirror/lang-json";
13
11
  import { python } from "@codemirror/lang-python";
14
12
  import { StreamLanguage } from "@codemirror/language";
13
+ import { MatchDecorator, Decoration, ViewPlugin, EditorView, lineNumbers } from "@codemirror/view";
14
+ import { useCodeMirror } from "@scalar/use-codemirror";
15
15
  function u$3(r2, n2, ...a2) {
16
16
  if (r2 in n2) {
17
17
  let e2 = n2[r2];
@@ -11964,37 +11964,6 @@ async function sendRequest(request, proxyUrl) {
11964
11964
  responseId: nanoid()
11965
11965
  } : null;
11966
11966
  }
11967
- const variableHighlighterDecoration = new MatchDecorator({
11968
- regexp: /(\{[^}]+\})/g,
11969
- decoration: () => Decoration.mark({
11970
- attributes: {
11971
- class: "scalar-api-client__variable"
11972
- }
11973
- })
11974
- });
11975
- const variables = () => ViewPlugin.fromClass(
11976
- class {
11977
- constructor(view) {
11978
- __publicField(this, "variables");
11979
- this.variables = variableHighlighterDecoration.createDeco(view);
11980
- }
11981
- update(update) {
11982
- this.variables = variableHighlighterDecoration.updateDeco(
11983
- update,
11984
- this.variables
11985
- );
11986
- }
11987
- },
11988
- {
11989
- decorations: (instance) => instance.variables,
11990
- provide: (plugin) => EditorView.atomicRanges.of(
11991
- (view) => {
11992
- var _a;
11993
- return ((_a = view.plugin(plugin)) == null ? void 0 : _a.variables) || Decoration.none;
11994
- }
11995
- )
11996
- }
11997
- );
11998
11967
  function Context$2(indented, column, type, info, align, prev) {
11999
11968
  this.indented = indented;
12000
11969
  this.column = column;
@@ -15732,6 +15701,37 @@ const swift = {
15732
15701
  closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }
15733
15702
  }
15734
15703
  };
15704
+ const variableHighlighterDecoration = new MatchDecorator({
15705
+ regexp: /(\{[^}]+\})/g,
15706
+ decoration: () => Decoration.mark({
15707
+ attributes: {
15708
+ class: "scalar-api-client__variable"
15709
+ }
15710
+ })
15711
+ });
15712
+ const variables = () => ViewPlugin.fromClass(
15713
+ class {
15714
+ constructor(view) {
15715
+ __publicField(this, "variables");
15716
+ this.variables = variableHighlighterDecoration.createDeco(view);
15717
+ }
15718
+ update(update) {
15719
+ this.variables = variableHighlighterDecoration.updateDeco(
15720
+ update,
15721
+ this.variables
15722
+ );
15723
+ }
15724
+ },
15725
+ {
15726
+ decorations: (instance) => instance.variables,
15727
+ provide: (plugin) => EditorView.atomicRanges.of(
15728
+ (view) => {
15729
+ var _a;
15730
+ return ((_a = view.plugin(plugin)) == null ? void 0 : _a.variables) || Decoration.none;
15731
+ }
15732
+ )
15733
+ }
15734
+ );
15735
15735
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
15736
15736
  __name: "CodeMirror",
15737
15737
  props: {
@@ -15879,7 +15879,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
15879
15879
  };
15880
15880
  }
15881
15881
  });
15882
- const FlowModal_vue_vue_type_style_index_0_scoped_5ddd5d0b_lang = "";
15882
+ const FlowModal_vue_vue_type_style_index_0_scoped_29ee9b2b_lang = "";
15883
15883
  const _export_sfc = (sfc, props) => {
15884
15884
  const target = sfc.__vccOpts || sfc;
15885
15885
  for (const [key, val] of props) {
@@ -15887,7 +15887,7 @@ const _export_sfc = (sfc, props) => {
15887
15887
  }
15888
15888
  return target;
15889
15889
  };
15890
- const FlowModal = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-5ddd5d0b"]]);
15890
+ const FlowModal = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-29ee9b2b"]]);
15891
15891
  const BYTE_UNITS = [
15892
15892
  "B",
15893
15893
  "kB",
@@ -16297,8 +16297,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16297
16297
  }, null, 8, ["content", "readOnly"])
16298
16298
  ]),
16299
16299
  createElementVNode("button", {
16300
- class: normalizeClass(["scalar-api-client__url-submit", [{ "scalar-api-client__url-submit--loading": loading.value }]]),
16301
- type: "button",
16300
+ class: normalizeClass(["scalar-api-client__send-request-button", [
16301
+ { "scalar-api-client__send-request-button--loading": loading.value }
16302
+ ]]),
16303
+ type: "submit",
16302
16304
  onClick: send
16303
16305
  }, _hoisted_6$4, 2)
16304
16306
  ]),
@@ -18178,9 +18180,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18178
18180
  };
18179
18181
  }
18180
18182
  });
18181
- const reset_css_vue_type_style_index_0_src_true_lang = "";
18182
- const variables_css_vue_type_style_index_1_src_true_lang = "";
18183
- const ApiClient_vue_vue_type_style_index_2_lang = "";
18183
+ const variables_css_vue_type_style_index_0_src_true_lang = "";
18184
+ const ApiClient_vue_vue_type_style_index_1_lang = "";
18184
18185
  function generateParameters(parameters) {
18185
18186
  const params = [];
18186
18187
  parameters.forEach((parameter) => {
package/dist/style.css CHANGED
@@ -30,7 +30,7 @@
30
30
  color: var(--scalar-api-client-color);
31
31
  }
32
32
 
33
- .modal-layout[data-v-5ddd5d0b] {
33
+ .modal-layout[data-v-29ee9b2b] {
34
34
  position: fixed;
35
35
  width: 100vw;
36
36
  height: 100vh;
@@ -40,16 +40,16 @@
40
40
  background: rgba(0, 0, 0, 0.44);
41
41
  padding: 20px;
42
42
  opacity: 0;
43
- animation: modal-fade-5ddd5d0b 0.2s forwards;
43
+ animation: modal-fade-29ee9b2b 0.2s forwards;
44
44
  }
45
- .modal-body[data-v-5ddd5d0b] {
45
+ .modal-body[data-v-29ee9b2b] {
46
46
  padding: 18px;
47
47
  max-height: calc(100vh - 240px);
48
48
  background: var(--scalar-api-client-background-primary);
49
49
  border-radius: var(--scalar-api-client-rounded);
50
50
  font-family: var(--scalar-api-client-font-sans);
51
51
  }
52
- .modal[data-v-5ddd5d0b] {
52
+ .modal[data-v-29ee9b2b] {
53
53
  margin: 80px auto 0;
54
54
  position: relative;
55
55
  background: var(--scalar-api-client-theme-background-2);
@@ -60,20 +60,20 @@
60
60
  line-height: 1.4;
61
61
  opacity: 0;
62
62
  transform: scale(0.98);
63
- animation: modal-pop-5ddd5d0b 0.15s 0.15s forwards;
63
+ animation: modal-pop-29ee9b2b 0.15s 0.15s forwards;
64
64
  display: flex;
65
65
  flex-direction: column;
66
66
  }
67
- .modal-content-large[data-v-5ddd5d0b] {
67
+ .modal-content-large[data-v-29ee9b2b] {
68
68
  max-width: 800px;
69
69
  }
70
- .modal-content-normal[data-v-5ddd5d0b] {
70
+ .modal-content-normal[data-v-29ee9b2b] {
71
71
  max-width: 640px;
72
72
  }
73
- .modal-content-small[data-v-5ddd5d0b] {
73
+ .modal-content-small[data-v-29ee9b2b] {
74
74
  max-width: 480px;
75
75
  }
76
- @keyframes modal-fade-5ddd5d0b {
76
+ @keyframes modal-fade-29ee9b2b {
77
77
  from {
78
78
  opacity: 0;
79
79
  }
@@ -81,7 +81,7 @@ to {
81
81
  opacity: 1;
82
82
  }
83
83
  }
84
- @keyframes modal-pop-5ddd5d0b {
84
+ @keyframes modal-pop-29ee9b2b {
85
85
  0% {
86
86
  opacity: 0;
87
87
  }
@@ -90,13 +90,14 @@ to {
90
90
  transform: scale(1);
91
91
  }
92
92
  }
93
- .modal-header[data-v-5ddd5d0b] {
93
+ .modal-header[data-v-29ee9b2b] {
94
94
  padding: 12px 24px;
95
95
  color: var(--scalar-api-client-text-color-primary);
96
96
  font-size: var(--scalar-api-client-theme-font-size-4);
97
97
  text-align: left;
98
98
  font-weight: 600;
99
- border-radius: var(--scalar-api-client-rounded) var(--scalar-api-client-rounded) 0 0;
99
+ border-radius: var(--scalar-api-client-rounded)
100
+ var(--scalar-api-client-rounded) 0 0;
100
101
  }
101
102
 
102
103
  .navtable-mock {
@@ -247,7 +248,7 @@ to {
247
248
  border-radius: var(--scalar-api-client-rounded);
248
249
  height: 100%;
249
250
  }
250
- .scalar-api-client__url-submit {
251
+ .scalar-api-client__send-request-button[type='submit'] {
251
252
  font-size: var(--scalar-api-client-text-xs);
252
253
  letter-spacing: 0.25px;
253
254
  line-height: 30px;
@@ -268,22 +269,22 @@ to {
268
269
  display: flex;
269
270
  align-items: center;
270
271
  }
271
- .scalar-api-client__url-submit svg {
272
+ .scalar-api-client__send-request-button svg {
272
273
  width: 12px;
273
274
  height: 12px;
274
275
  margin-right: 6px;
275
276
  }
276
- .scalar-api-client__url-submit--loading {
277
+ .scalar-api-client__send-request-button--loading {
277
278
  font-size: 0;
278
279
  display: flex;
279
280
  align-items: center;
280
281
  justify-content: center;
281
282
  min-width: 127px;
282
283
  }
283
- .scalar-api-client__url-submit--loading svg {
284
+ .scalar-api-client__send-request-button--loading svg {
284
285
  display: none;
285
286
  }
286
- .scalar-api-client__url-submit--loading:before {
287
+ .scalar-api-client__send-request-button--loading:before {
287
288
  content: '';
288
289
  border: 1px solid rgba(0, 0, 0, 0.1);
289
290
  border-top: 1px solid white;
@@ -295,7 +296,7 @@ to {
295
296
  margin-right: 9px;
296
297
  border-radius: 50%;
297
298
  }
298
- .scalar-api-client__url-submit--loading:after {
299
+ .scalar-api-client__send-request-button--loading:after {
299
300
  content: 'Loading';
300
301
  font-size: 12px;
301
302
  }
@@ -431,15 +432,15 @@ to {
431
432
  }
432
433
  @media screen and (max-width: 720px) {
433
434
  .scalar-api-client__history-toggle span,
434
- .scalar-api-client__url-submit span {
435
+ .scalar-api-client__send-request-button span {
435
436
  display: none;
436
437
  }
437
438
  .scalar-api-client__history-toggle svg,
438
- .scalar-api-client__url-submit svg {
439
+ .scalar-api-client__send-request-button svg {
439
440
  margin-right: 0;
440
441
  }
441
442
  .scalar-api-client__history-toggle,
442
- .scalar-api-client__url-submit {
443
+ .scalar-api-client__send-request-button {
443
444
  height: 31.5px;
444
445
  width: 31.5px;
445
446
  }
@@ -967,9 +968,9 @@ to {
967
968
  margin-top: -3px;
968
969
  justify-content: space-between;
969
970
  }
970
- .scalar-api-client__item__content .cm-s-default {
971
- border: var(--scalar-api-client-border);
972
- border-radius: var(--scalar-api-client-rounded);
971
+ .scalar-api-client__item__content .cm-s-default {
972
+ border: var(--scalar-api-client-border);
973
+ border-radius: var(--scalar-api-client-rounded);
973
974
  }
974
975
  .scalar-api-client__item__content .scalar-api-client__item__content--code {
975
976
  width: 100%;
@@ -1250,160 +1251,6 @@ a[data-v-84d41168] {
1250
1251
  top: 6px;
1251
1252
  right: 12px;
1252
1253
  }
1253
- /***
1254
- The new CSS reset - version 1.8.4 (last updated 14.2.2023)
1255
- GitHub page: https://github.com/elad2412/the-new-css-reset
1256
- ***/
1257
-
1258
- /*
1259
- Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
1260
- - The "symbol *" part is to solve Firefox SVG sprite bug
1261
- - The editor uses some browser defaults so it needs to be excluded from the reset (DOC-466)
1262
- */
1263
- *:where(
1264
- :not(html, iframe, canvas, img, svg, video, audio):not(
1265
- svg *,
1266
- symbol *,
1267
- .editor *,
1268
- .reference *
1269
- )
1270
- ) {
1271
- all: unset;
1272
- display: revert;
1273
- }
1274
-
1275
- /* Optional future support for reverting on >Chrome 90 */
1276
- /* @supports (-webkit-user-modify: revert-layer) {
1277
- * {
1278
- -moz-user-modify: revert-layer;
1279
- -webkit-user-modify: revert-layer;
1280
- overflow-wrap: revert-layer;
1281
- -webkit-line-break: revert-layer;
1282
- -webkit-user-select: revert-layer;
1283
- }
1284
- } */
1285
-
1286
- /* Preferred box-sizing value */
1287
- *,
1288
- *::before,
1289
- *::after {
1290
- box-sizing: border-box;
1291
- }
1292
-
1293
- /* Strip the padding from editor elements */
1294
- .editor *,
1295
- .reference * {
1296
- padding: 0;
1297
- margin: 0;
1298
- }
1299
-
1300
- /* Reapply the pointer cursor for anchor tags */
1301
- a,
1302
- button {
1303
- cursor: revert;
1304
- }
1305
-
1306
- /* Reapply outlines on keyboard focus */
1307
- a[href]:focus-visible,
1308
- button:focus-visible,
1309
- [tabindex]:focus-visible {
1310
- outline: 1px dashed var(--scalar-api-client-text-color-secondary);
1311
- outline-offset: 2px;
1312
- }
1313
-
1314
- /* Revert the font-size for selects
1315
- Ideally we would remove this once we style our selects better (DOC-466) */
1316
- select {
1317
- font-size: revert;
1318
- }
1319
-
1320
- /* Revert the line-height for buttons and inputs
1321
- Ideally we would remove this once we style our inputs and buttons better (DOC-466) */
1322
- input,
1323
- button {
1324
- line-height: revert;
1325
- }
1326
-
1327
- /* Remove list styles (bullets/numbers) */
1328
- /* It would be good to include this again (DOC-466) */
1329
- /* ol,
1330
- ul,
1331
- menu {
1332
- list-style: none;
1333
- } */
1334
-
1335
- /* For images to not be able to exceed their container */
1336
- img {
1337
- max-inline-size: 100%;
1338
- max-block-size: 100%;
1339
- }
1340
-
1341
- /* removes spacing between cells in tables */
1342
- table {
1343
- border-collapse: collapse;
1344
- }
1345
-
1346
- /* Safari - solving issue when using user-select:none on the <body> text input doesn't working */
1347
- /* Align our input text to the left */
1348
- input,
1349
- textarea {
1350
- -webkit-user-select: auto;
1351
- text-align: left;
1352
- font-weight: initial;
1353
- }
1354
-
1355
- /* revert the 'white-space' property for textarea elements on Safari */
1356
- textarea {
1357
- white-space: revert;
1358
- }
1359
-
1360
- /* minimum style to allow to style meter element */
1361
- meter {
1362
- -webkit-appearance: revert;
1363
- appearance: revert;
1364
- }
1365
-
1366
- /* preformatted text - use only for this feature */
1367
- /* :where(pre) {
1368
- all: revert;
1369
- } */
1370
-
1371
- /* reset default text opacity of input placeholder */
1372
- ::placeholder {
1373
- color: revert;
1374
- }
1375
-
1376
- /* remove default dot (•) sign */
1377
- ::marker {
1378
- content: initial;
1379
- }
1380
-
1381
- /* fix the feature of 'hidden' attribute.
1382
- display:revert; revert to element instead of attribute */
1383
- :where([hidden]) {
1384
- display: none;
1385
- }
1386
-
1387
- /* revert for bug in Chromium browsers
1388
- - fix for the content editable attribute will work properly.
1389
- - webkit-user-select: auto; added for Safari in case of using user-select:none on wrapper element*/
1390
- :where([contenteditable]:not([contenteditable="false"])) {
1391
- -moz-user-modify: revert-layer, read-write;
1392
- -webkit-user-modify: revert-layer, read-write;
1393
- overflow-wrap: revert-layer, break-word;
1394
- -webkit-line-break: revert-layer, after-white-space;
1395
- -webkit-user-select: revert-layer, auto;
1396
- }
1397
-
1398
- /* apply back the draggable feature - exist only in Chromium and Safari */
1399
- :where([draggable="true"]) {
1400
- -webkit-user-drag: element;
1401
- }
1402
-
1403
- /* Revert Modal native behavior */
1404
- :where(dialog:modal) {
1405
- all: revert;
1406
- }
1407
1254
  :root {
1408
1255
  /** Colors */
1409
1256
  --scalar-api-client-background-primary: #fff;
@@ -1418,11 +1265,11 @@ display:revert; revert to element instead of attribute */
1418
1265
  --scalar-api-client-rounded: 4px;
1419
1266
 
1420
1267
  /** Fonts */
1421
- --scalar-api-client-font-sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial,
1422
- sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
1423
- --scalar-api-client-font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono",
1424
- "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace",
1425
- "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
1268
+ --scalar-api-client-font-sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial,
1269
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
1270
+ --scalar-api-client-font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono',
1271
+ 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace',
1272
+ 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
1426
1273
 
1427
1274
  /** Font weights */
1428
1275
  --scalar-api-client-font-semibold: 600;
@@ -1632,11 +1479,11 @@ display:revert; revert to element instead of attribute */
1632
1479
  --scalar-api-client-rounded: 4px;
1633
1480
 
1634
1481
  /** Fonts */
1635
- --scalar-api-client-font-sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial,
1636
- sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
1637
- --scalar-api-client-font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono",
1638
- "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace",
1639
- "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
1482
+ --scalar-api-client-font-sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial,
1483
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
1484
+ --scalar-api-client-font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono',
1485
+ 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace',
1486
+ 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
1640
1487
 
1641
1488
  /** Font weights */
1642
1489
  --scalar-api-client-font-semibold: 600;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalar/api-client",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "author": "Scalar",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {