@scalar/api-client 2.5.22 → 2.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +2 -2
  3. package/dist/components/CodeInput/CodeInput.vue.d.ts +0 -3
  4. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue2.js +86 -106
  7. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  8. package/dist/components/CodeInput/codeVariableWidget.js +55 -87
  9. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -6
  10. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  11. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  12. package/dist/components/EmptyState.vue.d.ts.map +1 -1
  13. package/dist/components/EmptyState.vue.js +1 -1
  14. package/dist/components/EmptyState.vue2.js +12 -12
  15. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  16. package/dist/components/Server/ServerVariablesTextbox.vue.js +1 -1
  17. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/SidebarButton.vue.js +11 -12
  19. package/dist/components/TopNav/TopNav.vue.js +50 -51
  20. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  21. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  22. package/dist/components/TopNav/TopNavItem.vue2.js +19 -20
  23. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  24. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +8 -8
  25. package/dist/layouts/App/create-api-client-app.d.ts +50 -50
  26. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts +100 -100
  28. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  29. package/dist/layouts/Web/create-api-client-web.d.ts +50 -50
  30. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  31. package/dist/libs/create-client.d.ts +50 -50
  32. package/dist/libs/create-client.d.ts.map +1 -1
  33. package/dist/libs/send-request/create-request-operation.test.d.ts +5 -5
  34. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  35. package/dist/store/active-entities.d.ts +5 -5
  36. package/dist/store/active-entities.d.ts.map +1 -1
  37. package/dist/store/request-example.d.ts +50 -50
  38. package/dist/store/request-example.d.ts.map +1 -1
  39. package/dist/store/store.d.ts +50 -50
  40. package/dist/store/store.d.ts.map +1 -1
  41. package/dist/style.css +1 -1
  42. package/dist/views/Collection/components/EnvironmentForm.vue.js +2 -2
  43. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  44. package/dist/views/Environment/Environment.vue2.js +14 -15
  45. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  46. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +71 -65
  47. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  48. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +80 -59
  49. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  50. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +52 -52
  51. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  52. package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
  53. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  54. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  55. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +5 -7
  56. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  57. package/dist/views/Request/RequestSection/helpers/filter-security-requirements.d.ts.map +1 -1
  58. package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +26 -13
  59. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
  60. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +2 -2
  61. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +26 -37
  62. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  63. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  64. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +9 -9
  65. package/package.json +16 -17
  66. package/dist/components/ScalarHotkey.test.d.ts +0 -2
  67. package/dist/components/ScalarHotkey.test.d.ts.map +0 -1
  68. package/dist/components/ScalarHotkey.vue.d.ts +0 -8
  69. package/dist/components/ScalarHotkey.vue.d.ts.map +0 -1
  70. package/dist/components/ScalarHotkey.vue.js +0 -44
  71. package/dist/components/ScalarHotkey.vue2.js +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.5.24
4
+
5
+ ### Patch Changes
6
+
7
+ - 172e397: feat(components): add hotkey component and tooltip support
8
+ - 5f022b5: feat: use registry.scalar.com URLs as example
9
+ - 0804cfc: eat(components): Add ScalarMarkdown summary component
10
+ - Updated dependencies [bbef120]
11
+ - Updated dependencies [a1429ca]
12
+ - Updated dependencies [d4adeba]
13
+ - Updated dependencies [172e397]
14
+ - Updated dependencies [66b18fc]
15
+ - Updated dependencies [5f022b5]
16
+ - Updated dependencies [d8b8a5b]
17
+ - Updated dependencies [6c24be9]
18
+ - Updated dependencies [6a88108]
19
+ - Updated dependencies [c418e92]
20
+ - Updated dependencies [638120c]
21
+ - Updated dependencies [0804cfc]
22
+ - @scalar/oas-utils@0.4.20
23
+ - @scalar/openapi-parser@0.20.0
24
+ - @scalar/components@0.14.25
25
+ - @scalar/helpers@0.0.8
26
+ - @scalar/themes@0.13.13
27
+ - @scalar/types@0.2.12
28
+ - @scalar/postman-to-openapi@0.3.23
29
+ - @scalar/import@0.4.18
30
+ - @scalar/use-codemirror@0.12.26
31
+ - @scalar/draggable@0.2.0
32
+ - @scalar/icons@0.4.7
33
+ - @scalar/object-utils@1.2.4
34
+ - @scalar/openapi-types@0.3.7
35
+ - @scalar/snippetz@0.4.5
36
+ - @scalar/use-hooks@0.2.4
37
+ - @scalar/use-toasts@0.8.0
38
+
39
+ ## 2.5.23
40
+
41
+ ### Patch Changes
42
+
43
+ - b235392: feat: add de-select all button for scopes
44
+ - 58b9321: feat: adds scalar code block copy component
45
+ - 68e4631: fix(api-client): firefox input content field height
46
+ - 376739d: fix: environment variable pill not displayed
47
+ - Updated dependencies [e203e90]
48
+ - Updated dependencies [3de82ac]
49
+ - Updated dependencies [58b9321]
50
+ - Updated dependencies [b1ceaab]
51
+ - Updated dependencies [fbafeab]
52
+ - @scalar/openapi-parser@0.19.1
53
+ - @scalar/oas-utils@0.4.19
54
+ - @scalar/components@0.14.24
55
+ - @scalar/icons@0.4.7
56
+ - @scalar/import@0.4.17
57
+ - @scalar/postman-to-openapi@0.3.22
58
+ - @scalar/use-codemirror@0.12.25
59
+ - @scalar/draggable@0.2.0
60
+ - @scalar/helpers@0.0.7
61
+ - @scalar/object-utils@1.2.3
62
+ - @scalar/openapi-types@0.3.7
63
+ - @scalar/snippetz@0.4.4
64
+ - @scalar/themes@0.13.12
65
+ - @scalar/types@0.2.11
66
+ - @scalar/use-hooks@0.2.4
67
+ - @scalar/use-toasts@0.8.0
68
+ - @scalar/use-tooltip@1.1.0
69
+
3
70
  ## 2.5.22
4
71
 
5
72
  ### Patch Changes
package/README.md CHANGED
@@ -59,7 +59,7 @@ import { createApiClientApp } from '@/App'
59
59
 
60
60
  // Initialize
61
61
  await createApiClientApp(document.getElementById('scalar-client'), {
62
- url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
62
+ url: 'https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json',
63
63
  proxyUrl: 'https://proxy.scalar.com',
64
64
  })
65
65
  ```
@@ -76,7 +76,7 @@ import { createApiClientApp } from '@/App'
76
76
  const { open } = await createApiClientApp(
77
77
  document.getElementById('scalar-client'),
78
78
  {
79
- url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
79
+ url: 'https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json',
80
80
  proxyUrl: 'https://proxy.scalar.com',
81
81
  },
82
82
  )
@@ -26,7 +26,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
26
26
  nullable?: boolean;
27
27
  withVariables?: boolean;
28
28
  importCurl?: boolean;
29
- isCopyable?: boolean;
30
29
  default?: string | number;
31
30
  environment: Environment;
32
31
  envVariables: EnvVariable[];
@@ -69,7 +68,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
69
68
  nullable?: boolean;
70
69
  withVariables?: boolean;
71
70
  importCurl?: boolean;
72
- isCopyable?: boolean;
73
71
  default?: string | number;
74
72
  environment: Environment;
75
73
  envVariables: EnvVariable[];
@@ -90,7 +88,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
90
88
  disableEnter: boolean;
91
89
  disableCloseBrackets: boolean;
92
90
  withVariables: boolean;
93
- isCopyable: boolean;
94
91
  lineWrapping: boolean;
95
92
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
96
93
  warning?(_: {}): any;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AA0iBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;;kBAYxC,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;iBACP,SAAS,EAAE;kBACV,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;IAuMxB,0BAA0B;;0BAzJC,MAAM;0BA0BN,MAAM;wBAOR,MAAM;;;;;;;;;;kBA1Gf,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;iBACP,SAAS,EAAE;kBACV,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;;;;;;cARX,OAAO;cAlBP,OAAO;iBADJ,OAAO;gBAIR,OAAO;gBACP,SAAS,EAAE;sBAGL,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAKd,OAAO;gBAEV,OAAO;kBAKL,OAAO;;qBAqjBI,GAAG;kBACN,GAAG;;AAplB9B,wBA+oBC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAifA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;;kBAYxC,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;iBACP,SAAS,EAAE;kBACV,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;IAqMxB,0BAA0B;;0BAzJC,MAAM;0BA0BN,MAAM;wBAOR,MAAM;;;;;;;;;;kBAvGf,OAAO;eACV,OAAO;gBACN,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;iBACP,SAAS,EAAE;kBACV,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;;;;;;cAPX,OAAO;cAlBP,OAAO;iBADJ,OAAO;gBAIR,OAAO;gBACP,SAAS,EAAE;sBAGL,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAKd,OAAO;kBAMR,OAAO;;qBAqhBI,GAAG;kBACN,GAAG;;AAnjB9B,wBA2mBC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  import "./CodeInput.vue3.js";
3
3
  import "./CodeInput.vue4.js";
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b356b2d9"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-599b2506"]]);
6
6
  export {
7
7
  a as default
8
8
  };
@@ -1,33 +1,27 @@
1
- import { defineComponent as Q, useAttrs as G, ref as u, computed as m, toRef as r, watch as X, createElementBlock as s, openBlock as n, Fragment as Y, createBlock as g, createCommentVNode as d, normalizeClass as Z, unref as p, createElementVNode as c, toDisplayString as _, mergeProps as ee, withKeys as v, withModifiers as N, createVNode as oe, createTextVNode as k, renderSlot as R } from "vue";
2
- import { ScalarIcon as le } from "@scalar/components";
3
- import { prettyPrintJson as te } from "@scalar/oas-utils/helpers";
4
- import { useCodeMirror as ne, useDropdown as ae, colorPicker as re } from "@scalar/use-codemirror";
5
- import { useClipboard as se } from "@scalar/use-hooks/useClipboard";
6
- import { nanoid as ie } from "nanoid";
7
- import ue from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
8
- import B from "../DataTable/DataTableInputSelect.vue.js";
9
- import { pillPlugin as de, backspaceCommand as pe } from "./codeVariableWidget.js";
10
- import { useLayout as fe } from "../../hooks/useLayout.js";
11
- const me = { class: "whitespace-nowrap" }, ce = ["id"], be = {
1
+ import { defineComponent as Q, useAttrs as G, ref as i, computed as p, toRef as r, watch as J, createElementBlock as u, openBlock as n, Fragment as X, createBlock as b, createCommentVNode as f, normalizeClass as Y, unref as w, createElementVNode as V, toDisplayString as Z, mergeProps as _, withKeys as y, withModifiers as A, createTextVNode as k, renderSlot as I } from "vue";
2
+ import { useCodeMirror as ee, useDropdown as oe, colorPicker as le } from "@scalar/use-codemirror";
3
+ import { nanoid as te } from "nanoid";
4
+ import ne from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
5
+ import x from "../DataTable/DataTableInputSelect.vue.js";
6
+ import { pillPlugin as ae, backspaceCommand as re } from "./codeVariableWidget.js";
7
+ import { useLayout as se } from "../../hooks/useLayout.js";
8
+ const ue = { class: "whitespace-nowrap" }, ie = ["id"], de = {
12
9
  key: 0,
13
- class: "scalar-code-copy z-context"
14
- }, ye = {
15
- key: 1,
16
10
  class: "z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block",
17
11
  role: "alert"
18
- }, ge = {
12
+ }, pe = {
19
13
  key: 5,
20
14
  class: "centered-y text-orange absolute right-7 text-xs"
21
- }, ve = {
15
+ }, fe = {
22
16
  key: 6,
23
17
  class: "centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1"
24
- }, he = {
18
+ }, me = {
25
19
  key: 7,
26
20
  class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
27
- }, we = {
21
+ }, ce = {
28
22
  inheritAttrs: !1
29
- }, Fe = /* @__PURE__ */ Q({
30
- ...we,
23
+ }, ke = /* @__PURE__ */ Q({
24
+ ...ce,
31
25
  __name: "CodeInput",
32
26
  props: {
33
27
  colorPicker: { type: Boolean, default: !1 },
@@ -52,7 +46,6 @@ const me = { class: "whitespace-nowrap" }, ce = ["id"], be = {
52
46
  nullable: { type: Boolean, default: !1 },
53
47
  withVariables: { type: Boolean, default: !0 },
54
48
  importCurl: { type: Boolean },
55
- isCopyable: { type: Boolean, default: !1 },
56
49
  default: {},
57
50
  environment: {},
58
51
  envVariables: {},
@@ -60,80 +53,80 @@ const me = { class: "whitespace-nowrap" }, ce = ["id"], be = {
60
53
  lineWrapping: { type: Boolean, default: !1 }
61
54
  },
62
55
  emits: ["submit", "update:modelValue", "curl", "blur"],
63
- setup(z, { expose: A, emit: M }) {
56
+ setup(M, { expose: N, emit: O }) {
64
57
  var q;
65
- const o = z, i = M, C = G(), O = C.id || `id-${ie()}`, x = u(!1), h = u(!1), P = u(""), S = u({ left: 0, top: 0 }), b = u(null), { layout: w } = fe(), { copyToClipboard: K } = se();
58
+ const o = M, s = O, B = G(), K = B.id || `id-${te()}`, C = i(!1), g = i(!1), P = i(""), S = i({ left: 0, top: 0 }), m = i(null), { layout: v } = se();
66
59
  function D(e) {
67
60
  var l;
68
- return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (i("curl", e), (l = a.value) == null || l.dispatch({
61
+ return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (s("curl", e), (l = a.value) == null || l.dispatch({
69
62
  changes: {
70
63
  from: 0,
71
64
  to: a.value.state.doc.length,
72
65
  insert: String(o.modelValue)
73
66
  }
74
- }), null) : o.handleFieldChange ? o.handleFieldChange(e) : i("update:modelValue", e);
67
+ }), null) : o.handleFieldChange ? o.handleFieldChange(e) : s("update:modelValue", e);
75
68
  }
76
- function V(e) {
77
- return o.handleFieldSubmit ? o.handleFieldSubmit(e) : i("submit", e);
69
+ function h(e) {
70
+ return o.handleFieldSubmit ? o.handleFieldSubmit(e) : s("submit", e);
78
71
  }
79
- function T(e) {
80
- x.value = !1, o.emitOnBlur && o.modelValue && V(e), i("blur", e);
72
+ function E(e) {
73
+ C.value = !1, o.emitOnBlur && o.modelValue && h(e), s("blur", e);
81
74
  }
82
- const E = [...o.extensions];
83
- o.colorPicker && E.push(re);
84
- const L = m(
85
- () => de({
75
+ const F = [...o.extensions];
76
+ o.colorPicker && F.push(le);
77
+ const z = p(
78
+ () => ae({
86
79
  environment: o.environment,
87
80
  envVariables: o.envVariables,
88
81
  workspace: o.workspace,
89
- isReadOnly: w === "modal"
82
+ isReadOnly: v === "modal"
90
83
  })
91
- ), U = m(() => [
92
- ...E,
93
- L.value,
94
- pe
95
- ]), F = u(null), { codeMirror: a } = ne({
84
+ ), L = p(() => [
85
+ ...F,
86
+ z.value,
87
+ re
88
+ ]), T = i(null), { codeMirror: a } = ee({
96
89
  content: r(
97
90
  () => o.modelValue !== void 0 ? String(o.modelValue) : ""
98
91
  ),
99
92
  onChange: (e) => {
100
- D(e), j();
93
+ D(e), W();
101
94
  },
102
- onFocus: () => x.value = !0,
103
- onBlur: (e) => T(e),
104
- codeMirrorRef: F,
95
+ onFocus: () => C.value = !0,
96
+ onBlur: (e) => E(e),
97
+ codeMirrorRef: T,
105
98
  disableTabIndent: r(() => o.disableTabIndent),
106
99
  disableEnter: r(() => o.disableEnter),
107
100
  disableCloseBrackets: r(() => o.disableCloseBrackets),
108
101
  lineNumbers: r(() => o.lineNumbers),
109
102
  language: r(() => o.language),
110
103
  lint: r(() => o.lint),
111
- extensions: U,
104
+ extensions: L,
112
105
  placeholder: r(() => o.placeholder)
113
106
  });
114
- (q = a.value) == null || q.focus(), X(a, () => {
115
- a.value && Object.prototype.hasOwnProperty.call(C, "autofocus") && a.value.focus();
107
+ (q = a.value) == null || q.focus(), J(a, () => {
108
+ a.value && Object.prototype.hasOwnProperty.call(B, "autofocus") && a.value.focus();
116
109
  });
117
- const { handleDropdownSelect: W, updateDropdownVisibility: j } = ae({
110
+ const { handleDropdownSelect: U, updateDropdownVisibility: W } = oe({
118
111
  codeMirror: a,
119
112
  query: P,
120
- showDropdown: h,
113
+ showDropdown: g,
121
114
  dropdownPosition: S
122
- }), $ = m(
115
+ }), $ = p(
123
116
  () => o.nullable ? ["true", "false", "null"] : ["true", "false"]
124
- ), y = (e, l) => {
125
- var f, t, I;
126
- h.value ? e === "down" ? (l.preventDefault(), (f = b.value) == null || f.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = b.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (I = b.value) == null || I.handleSelect()) : e === "escape" ? o.disableTabIndent || l.stopPropagation() : e === "enter" && l.target instanceof HTMLDivElement && V(l.target.textContent ?? "");
127
- }, H = m(() => Array.isArray(o.type) ? (
117
+ ), c = (e, l) => {
118
+ var d, t, R;
119
+ g.value ? e === "down" ? (l.preventDefault(), (d = m.value) == null || d.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = m.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (R = m.value) == null || R.handleSelect()) : e === "escape" ? o.disableTabIndent || l.stopPropagation() : e === "enter" && l.target instanceof HTMLDivElement && h(l.target.textContent ?? "");
120
+ }, j = p(() => Array.isArray(o.type) ? (
128
121
  // Find the first type, that's not 'null'
129
122
  o.type.find((e) => e !== "null") ?? "string"
130
123
  ) : (
131
124
  // If it's not an array, just return the type
132
125
  o.type
133
- )), J = m(
134
- () => h.value && o.withVariables && w !== "modal" && o.environment
126
+ )), H = p(
127
+ () => g.value && o.withVariables && v !== "modal" && o.environment
135
128
  );
136
- return A({
129
+ return N({
137
130
  /** Expose focus method */
138
131
  focus: () => {
139
132
  var e;
@@ -141,98 +134,85 @@ const me = { class: "whitespace-nowrap" }, ce = ["id"], be = {
141
134
  },
142
135
  // Expose these methods for testing
143
136
  handleChange: D,
144
- handleSubmit: V,
145
- handleBlur: T,
137
+ handleSubmit: h,
138
+ handleBlur: E,
146
139
  booleanOptions: $,
147
140
  codeMirror: a,
148
141
  modelValue: o.modelValue
149
142
  }), (e, l) => {
150
- var f;
151
- return n(), s(Y, null, [
152
- e.disabled ? (n(), s("div", {
143
+ var d;
144
+ return n(), u(X, null, [
145
+ e.disabled ? (n(), u("div", {
153
146
  key: 0,
154
- class: Z(["text-c-2 flex cursor-default items-center justify-center", p(w) === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
147
+ class: Y(["text-c-2 flex cursor-default items-center justify-center", w(v) === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
155
148
  "data-testid": "code-input-disabled"
156
149
  }, [
157
- c("span", me, _(e.modelValue), 1)
158
- ], 2)) : o.enum && o.enum.length ? (n(), g(B, {
150
+ V("span", ue, Z(e.modelValue), 1)
151
+ ], 2)) : o.enum && o.enum.length ? (n(), b(x, {
159
152
  key: 1,
160
153
  default: o.default,
161
154
  modelValue: e.modelValue,
162
- type: H.value,
155
+ type: j.value,
163
156
  value: o.enum,
164
- "onUpdate:modelValue": l[0] || (l[0] = (t) => i("update:modelValue", t))
165
- }, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (n(), g(B, {
157
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => s("update:modelValue", t))
158
+ }, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (d = e.type) != null && d.includes("boolean") ? (n(), b(x, {
166
159
  key: 2,
167
160
  default: o.default,
168
161
  modelValue: e.modelValue,
169
162
  value: $.value,
170
- "onUpdate:modelValue": l[1] || (l[1] = (t) => i("update:modelValue", t))
171
- }, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), g(B, {
163
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => s("update:modelValue", t))
164
+ }, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), b(x, {
172
165
  key: 3,
173
166
  default: o.default,
174
167
  modelValue: o.modelValue,
175
168
  value: o.examples,
176
- "onUpdate:modelValue": l[2] || (l[2] = (t) => i("update:modelValue", t))
177
- }, null, 8, ["default", "modelValue", "value"])) : (n(), s("div", ee({
169
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => s("update:modelValue", t))
170
+ }, null, 8, ["default", "modelValue", "value"])) : (n(), u("div", _({
178
171
  key: 4,
179
- id: p(O)
172
+ id: w(K)
180
173
  }, e.$attrs, {
181
174
  ref_key: "codeMirrorRef",
182
- ref: F,
175
+ ref: T,
183
176
  class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
184
177
  "line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": e.lineWrapping,
185
178
  "flow-code-input--error": e.error
186
179
  }],
187
180
  onKeydown: [
188
- l[4] || (l[4] = v(N((t) => y("down", t), ["stop"]), ["down"])),
189
- l[5] || (l[5] = v((t) => y("enter", t), ["enter"])),
190
- l[6] || (l[6] = v((t) => y("escape", t), ["escape"])),
191
- l[7] || (l[7] = v(N((t) => y("up", t), ["stop"]), ["up"]))
181
+ l[3] || (l[3] = y(A((t) => c("down", t), ["stop"]), ["down"])),
182
+ l[4] || (l[4] = y((t) => c("enter", t), ["enter"])),
183
+ l[5] || (l[5] = y((t) => c("escape", t), ["escape"])),
184
+ l[6] || (l[6] = y(A((t) => c("up", t), ["stop"]), ["up"]))
192
185
  ]
193
186
  }), [
194
- e.isCopyable ? (n(), s("div", be, [
195
- c("button", {
196
- class: "copy-button",
197
- type: "button",
198
- onClick: l[3] || (l[3] = (t) => p(K)(p(te)(e.modelValue)))
199
- }, [
200
- l[8] || (l[8] = c("span", { class: "sr-only" }, "Copy content", -1)),
201
- oe(p(le), {
202
- icon: "Clipboard",
203
- size: "md"
204
- })
205
- ])
206
- ])) : d("", !0),
207
- e.disableTabIndent ? d("", !0) : (n(), s("div", ye, l[9] || (l[9] = [
187
+ e.disableTabIndent ? f("", !0) : (n(), u("div", de, l[7] || (l[7] = [
208
188
  k(" Press "),
209
- c("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
189
+ V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
210
190
  k(" then "),
211
- c("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
191
+ V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
212
192
  k(" to exit ")
213
193
  ])))
214
- ], 16, ce)),
215
- e.$slots.warning ? (n(), s("div", ge, [
216
- R(e.$slots, "warning", {}, void 0, !0)
217
- ])) : d("", !0),
218
- e.$slots.icon ? (n(), s("div", ve, [
219
- R(e.$slots, "icon", {}, void 0, !0)
220
- ])) : d("", !0),
221
- e.required ? (n(), s("div", he, " Required ")) : d("", !0),
222
- J.value ? (n(), g(ue, {
194
+ ], 16, ie)),
195
+ e.$slots.warning ? (n(), u("div", pe, [
196
+ I(e.$slots, "warning", {}, void 0, !0)
197
+ ])) : f("", !0),
198
+ e.$slots.icon ? (n(), u("div", fe, [
199
+ I(e.$slots, "icon", {}, void 0, !0)
200
+ ])) : f("", !0),
201
+ e.required ? (n(), u("div", me, " Required ")) : f("", !0),
202
+ H.value ? (n(), b(ne, {
223
203
  key: 8,
224
204
  ref_key: "dropdownRef",
225
- ref: b,
205
+ ref: m,
226
206
  dropdownPosition: S.value,
227
207
  envVariables: e.envVariables,
228
208
  environment: e.environment,
229
209
  query: P.value,
230
- onSelect: p(W)
231
- }, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : d("", !0)
210
+ onSelect: w(U)
211
+ }, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : f("", !0)
232
212
  ], 64);
233
213
  };
234
214
  }
235
215
  });
236
216
  export {
237
- Fe as default
217
+ ke as default
238
218
  };
@@ -1 +1 @@
1
- {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAuI/B;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAChC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;IACtC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;CAChC;iBAGkB,aAAa;mBAMX,UAAU;2BASF,UAAU;EAkCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
1
+ {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAsG/B;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAChC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;IACtC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;CAChC;iBAGkB,aAAa;mBAMX,UAAU;2BASF,UAAU;EAkCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}