@scalar/api-client 2.9.0 → 2.9.1

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 (122) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/CommandPalette/CommandActionForm.vue.js +9 -9
  3. package/dist/style.css +1 -1
  4. package/dist/v2/components/code-input/CodeInput.test.d.ts +2 -0
  5. package/dist/v2/components/code-input/CodeInput.test.d.ts.map +1 -0
  6. package/dist/v2/components/code-input/CodeInput.vue.d.ts +140 -0
  7. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -0
  8. package/dist/v2/components/code-input/CodeInput.vue.js +8 -0
  9. package/dist/v2/components/code-input/CodeInput.vue2.js +202 -0
  10. package/dist/v2/components/code-input/code-variable-widget.d.ts +21 -0
  11. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -0
  12. package/dist/v2/components/code-input/code-variable-widget.js +106 -0
  13. package/dist/v2/components/code-input/code-variable-widget.test.d.ts +2 -0
  14. package/dist/v2/components/code-input/code-variable-widget.test.d.ts.map +1 -0
  15. package/dist/v2/components/code-input/index.d.ts +2 -0
  16. package/dist/v2/components/code-input/index.d.ts.map +1 -0
  17. package/dist/v2/components/code-input/index.js +4 -0
  18. package/dist/v2/components/data-table/DataTable.vue.d.ts +22 -0
  19. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -0
  20. package/dist/v2/components/data-table/DataTable.vue.js +38 -0
  21. package/dist/v2/components/data-table/DataTable.vue2.js +4 -0
  22. package/dist/v2/components/data-table/DataTableCell.vue.d.ts +19 -0
  23. package/dist/v2/components/data-table/DataTableCell.vue.d.ts.map +1 -0
  24. package/dist/v2/components/data-table/DataTableCell.vue.js +26 -0
  25. package/dist/v2/components/data-table/DataTableCell.vue2.js +4 -0
  26. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +14 -0
  27. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -0
  28. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +53 -0
  29. package/dist/v2/components/data-table/DataTableCheckbox.vue2.js +4 -0
  30. package/dist/v2/components/data-table/DataTableHeader.vue.d.ts +13 -0
  31. package/dist/v2/components/data-table/DataTableHeader.vue.d.ts.map +1 -0
  32. package/dist/v2/components/data-table/DataTableHeader.vue.js +18 -0
  33. package/dist/v2/components/data-table/DataTableHeader.vue2.js +4 -0
  34. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +53 -0
  35. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -0
  36. package/dist/v2/components/data-table/DataTableInput.vue.js +7 -0
  37. package/dist/v2/components/data-table/DataTableInput.vue2.js +117 -0
  38. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +16 -0
  39. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -0
  40. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +146 -0
  41. package/dist/v2/components/data-table/DataTableInputSelect.vue2.js +4 -0
  42. package/dist/v2/components/data-table/DataTableRow.vue.d.ts +13 -0
  43. package/dist/v2/components/data-table/DataTableRow.vue.d.ts.map +1 -0
  44. package/dist/v2/components/data-table/DataTableRow.vue.js +12 -0
  45. package/dist/v2/components/data-table/DataTableText.vue.d.ts +16 -0
  46. package/dist/v2/components/data-table/DataTableText.vue.d.ts.map +1 -0
  47. package/dist/v2/components/data-table/DataTableText.vue.js +23 -0
  48. package/dist/v2/components/data-table/DataTableText.vue2.js +4 -0
  49. package/dist/v2/components/data-table/index.d.ts +9 -0
  50. package/dist/v2/components/data-table/index.d.ts.map +1 -0
  51. package/dist/v2/components/data-table/index.js +18 -0
  52. package/dist/v2/features/app/App.test.d.ts +2 -0
  53. package/dist/v2/features/app/App.test.d.ts.map +1 -0
  54. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  55. package/dist/v2/features/app/App.vue.js +56 -41
  56. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +3 -0
  57. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  58. package/dist/v2/features/app/components/DesktopTabs.vue.js +8 -7
  59. package/dist/v2/features/app/components/DesktopTabs.vue2.js +6 -0
  60. package/dist/v2/features/app/helpers/routes.d.ts +12 -9
  61. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  62. package/dist/v2/features/app/helpers/routes.js +0 -6
  63. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  64. package/dist/v2/features/collection/DocumentCollection.vue2.js +58 -45
  65. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  66. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +12 -10
  67. package/dist/v2/features/collection/components/Environment.vue.d.ts +13 -87
  68. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  69. package/dist/v2/features/collection/components/Environment.vue2.js +20 -25
  70. package/dist/v2/features/collection/components/Overview.vue.d.ts +13 -12
  71. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  72. package/dist/v2/features/collection/components/Overview.vue.js +5 -2
  73. package/dist/v2/features/collection/components/Overview.vue2.js +64 -66
  74. package/dist/v2/features/collection/components/Tabs.vue.js +8 -8
  75. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +6 -95
  76. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  77. package/dist/v2/features/environments/EnvironmentsList.vue.js +50 -98
  78. package/dist/v2/features/environments/components/Environment.vue.d.ts +9 -63
  79. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  80. package/dist/v2/features/environments/components/Environment.vue.js +41 -92
  81. package/dist/v2/features/environments/components/EnvironmentColors.vue.d.ts.map +1 -1
  82. package/dist/v2/features/environments/components/EnvironmentColors.vue.js +105 -81
  83. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts +7 -14
  84. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  85. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +61 -39
  86. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +1 -1
  87. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  88. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +3 -3
  89. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +21 -0
  90. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -0
  91. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +109 -0
  92. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue2.js +4 -0
  93. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts +7 -20
  94. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  95. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
  96. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue2.js +85 -71
  97. package/dist/v2/features/environments/index.d.ts +0 -3
  98. package/dist/v2/features/environments/index.d.ts.map +1 -1
  99. package/dist/v2/features/environments/index.js +2 -4
  100. package/dist/v2/helpers/test-utils.d.ts +4 -0
  101. package/dist/v2/helpers/test-utils.d.ts.map +1 -0
  102. package/dist/v2/hooks/use-workspace-client-events.d.ts +2 -1
  103. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  104. package/dist/v2/hooks/use-workspace-client-events.js +23 -9
  105. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  106. package/package.json +13 -13
  107. package/dist/v2/features/collection/WorkspaceCollection.test.d.ts +0 -2
  108. package/dist/v2/features/collection/WorkspaceCollection.test.d.ts.map +0 -1
  109. package/dist/v2/features/environments/Environments.test.d.ts +0 -2
  110. package/dist/v2/features/environments/Environments.test.d.ts.map +0 -1
  111. package/dist/v2/features/environments/Environments.vue.d.ts +0 -31
  112. package/dist/v2/features/environments/Environments.vue.d.ts.map +0 -1
  113. package/dist/v2/features/environments/Environments.vue.js +0 -65
  114. package/dist/v2/features/environments/Environments.vue2.js +0 -4
  115. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts +0 -20
  116. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.d.ts.map +0 -1
  117. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue.js +0 -48
  118. package/dist/v2/features/environments/components/EnvironmentColorUpdateModal.vue2.js +0 -4
  119. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts +0 -18
  120. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.d.ts.map +0 -1
  121. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue.js +0 -35
  122. package/dist/v2/features/environments/components/EnvironmentNameUpdateModal.vue2.js +0 -4
@@ -1,104 +1,53 @@
1
- import { defineComponent as g, createBlock as t, openBlock as l, unref as r, withCtx as s, createElementVNode as d, renderSlot as k, createCommentVNode as c, createElementBlock as u, normalizeStyle as p, createTextVNode as F, toDisplayString as v, createVNode as b } from "vue";
2
- import { ScalarButton as i } from "@scalar/components";
3
- import { Draggable as w } from "@scalar/draggable";
4
- import { ScalarIconTrash as R } from "@scalar/icons";
5
- import V from "./EnvironmentVariablesTable.vue.js";
6
- const h = { class: "bg-b-2 flex cursor-grab justify-between rounded-t-lg px-1 py-1 text-sm" }, C = { class: "flex items-center gap-1" }, D = {
7
- key: 1,
8
- class: "flex h-6 w-6 items-center justify-center p-1"
9
- }, E = {
10
- key: 3,
11
- class: "px-1 py-0.5 text-sm"
12
- }, j = /* @__PURE__ */ g({
1
+ import { defineComponent as c, createElementBlock as a, openBlock as d, createElementVNode as n, createVNode as i, normalizeStyle as p, toDisplayString as v, unref as t } from "vue";
2
+ import { ScalarIconButton as r } from "@scalar/components";
3
+ import { ScalarIconNotePencil as u, ScalarIconTrash as f } from "@scalar/icons";
4
+ import y from "./EnvironmentVariablesTable.vue.js";
5
+ const _ = { class: "group rounded-lg border" }, b = { class: "bg-b-2 flex justify-between rounded-t-lg px-1 py-1 text-sm" }, g = { class: "flex items-center gap-1" }, h = { class: "flex h-6 w-6 items-center justify-center p-1" }, N = { class: "px-1 py-0.5 text-sm" }, B = { class: "hidden flex-row items-center gap-1 group-hover:flex" }, w = /* @__PURE__ */ c({
13
6
  __name: "Environment",
14
7
  props: {
15
- name: {},
16
- color: {},
17
- variables: {},
18
- isReadonly: { type: Boolean, default: !1 },
19
8
  environment: {},
20
- envVariables: {}
9
+ environmentName: {},
10
+ eventBus: {},
11
+ collectionType: {}
21
12
  },
22
- emits: ["delete", "reorder", "add:variable", "update:name", "update:color", "update:variable", "delete:variable"],
23
- setup(B, { emit: f }) {
24
- const o = f, y = (e, a) => {
25
- o("reorder", e, a);
26
- };
27
- return (e, a) => (l(), t(r(w), {
28
- id: e.name,
29
- class: "rounded-lg border",
30
- isDraggable: !0,
31
- isDroppable: !0,
32
- parentIds: [],
33
- onOnDragEnd: y
34
- }, {
35
- default: s(() => [
36
- d("div", h, [
37
- d("div", C, [
38
- e.isReadonly ? (l(), u("div", D, [
39
- d("span", {
40
- class: "h-2.5 w-2.5 rounded-full",
41
- style: p({ backgroundColor: e.color || "#FFFFFF" })
42
- }, null, 4)
43
- ])) : (l(), t(r(i), {
44
- key: 0,
45
- class: "hover:bg-b-3 flex h-6 w-6 p-1",
46
- disabled: e.isReadonly,
47
- variant: "ghost",
48
- onClick: a[0] || (a[0] = (n) => o("update:color"))
49
- }, {
50
- default: s(() => [
51
- d("span", {
52
- class: "h-2.5 w-2.5 rounded-full",
53
- style: p({ backgroundColor: e.color || "#FFFFFF" })
54
- }, null, 4)
55
- ]),
56
- _: 1
57
- }, 8, ["disabled"])),
58
- e.isReadonly ? (l(), u("span", E, v(e.name), 1)) : (l(), t(r(i), {
59
- key: 2,
60
- class: "hover:bg-b-3 rounded px-1 py-0.5 text-sm",
61
- disabled: e.isReadonly,
62
- variant: "ghost",
63
- onClick: a[1] || (a[1] = (n) => o("update:name"))
64
- }, {
65
- default: s(() => [
66
- F(v(e.name), 1)
67
- ]),
68
- _: 1
69
- }, 8, ["disabled"]))
13
+ emits: ["edit", "delete"],
14
+ setup(E, { emit: s }) {
15
+ const l = s;
16
+ return (e, o) => (d(), a("div", _, [
17
+ n("div", b, [
18
+ n("div", g, [
19
+ n("div", h, [
20
+ n("span", {
21
+ class: "h-2.5 w-2.5 rounded-full",
22
+ style: p({ backgroundColor: e.environment.color })
23
+ }, null, 4)
70
24
  ]),
71
- e.isReadonly ? c("", !0) : (l(), t(r(i), {
72
- key: 0,
73
- class: "text-c-2 hover:text-c-1 hover:bg-b-3 h-fit rounded p-1",
74
- size: "sm",
75
- variant: "ghost",
76
- onClick: a[2] || (a[2] = (n) => o("delete"))
77
- }, {
78
- default: s(() => [
79
- b(r(R), { class: "size-3.5" })
80
- ]),
81
- _: 1
82
- }))
25
+ n("span", N, v(e.environmentName), 1)
83
26
  ]),
84
- k(e.$slots, "default", {}, () => [
85
- b(V, {
86
- data: e.variables,
87
- envVariables: e.envVariables,
88
- environment: e.environment,
89
- onAddRow: a[3] || (a[3] = (n) => o("add:variable", { name: n.name, value: n.value })),
90
- onDeleteRow: a[4] || (a[4] = (n) => o("delete:variable", { id: n })),
91
- onUpdateRow: a[5] || (a[5] = (n, m) => o("update:variable", {
92
- id: n,
93
- value: { name: m.name, value: m.value }
94
- }))
95
- }, null, 8, ["data", "envVariables", "environment"])
27
+ n("div", B, [
28
+ i(t(r), {
29
+ icon: t(u),
30
+ label: "Edit Environment",
31
+ size: "sm",
32
+ onClick: o[0] || (o[0] = (m) => l("edit"))
33
+ }, null, 8, ["icon"]),
34
+ i(t(r), {
35
+ icon: t(f),
36
+ label: "Delete Environment",
37
+ size: "sm",
38
+ onClick: o[1] || (o[1] = (m) => l("delete"))
39
+ }, null, 8, ["icon"])
96
40
  ])
97
41
  ]),
98
- _: 3
99
- }, 8, ["id"]));
42
+ i(y, {
43
+ collectionType: e.collectionType,
44
+ environment: e.environment,
45
+ environmentName: e.environmentName,
46
+ eventBus: e.eventBus
47
+ }, null, 8, ["collectionType", "environment", "environmentName", "eventBus"])
48
+ ]));
100
49
  }
101
50
  });
102
51
  export {
103
- j as default
52
+ w as default
104
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"names":[],"mappings":"AA2IA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AAoQF,wBAOG"}
1
+ {"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"names":[],"mappings":"AA6LA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AAyUF,wBAOG"}
@@ -1,97 +1,121 @@
1
- import { defineComponent as z, ref as d, computed as m, createElementBlock as v, openBlock as s, createElementVNode as r, Fragment as B, renderList as E, normalizeStyle as C, createBlock as h, createCommentVNode as x, unref as f, withDirectives as I, vModelText as D, createVNode as V, nextTick as $ } from "vue";
2
- import { ScalarIcon as p } from "@scalar/components";
3
- const j = {
4
- key: 0,
5
- class: "flex min-h-10 min-w-[296px] flex-row items-center justify-between gap-1.5 space-x-1"
6
- }, N = ["onClick"], R = {
1
+ import { defineComponent as D, ref as d, computed as m, createElementBlock as a, openBlock as l, createCommentVNode as c, normalizeStyle as v, createBlock as k, unref as C, createElementVNode as s, Fragment as S, renderList as $, withDirectives as j, vModelText as N, createVNode as T, nextTick as V } from "vue";
2
+ import { ScalarIcon as f } from "@scalar/components";
3
+ const A = {
7
4
  key: 1,
8
- class: "flex min-h-10 flex-1 items-center gap-2 rounded"
9
- }, S = ["placeholder"], T = "linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));", O = /* @__PURE__ */ z({
5
+ class: "color-selector flex h-4 flex-row items-center justify-between gap-1.5 space-x-1"
6
+ }, R = ["onClick"], L = {
7
+ key: 2,
8
+ class: "color-selector flex h-4 flex-1 items-center gap-2 rounded"
9
+ }, U = ["placeholder"], W = "linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))", P = /* @__PURE__ */ D({
10
10
  __name: "EnvironmentColors",
11
11
  props: {
12
12
  activeColor: {}
13
13
  },
14
14
  emits: ["select"],
15
- setup(c, { emit: y }) {
16
- const w = y, a = d(""), t = m({
17
- get: () => a.value,
18
- set: (e) => {
19
- e && !e.startsWith("#") ? a.value = `#${e}` : a.value = e, e && (n.value = !0);
20
- }
21
- }), u = d(null), n = d(!1), i = [
22
- { color: "#FFFFFF" },
23
- { color: "#EF0006" },
24
- { color: "#EDBE20" },
25
- { color: "#069061" },
26
- { color: "#FB892C" },
27
- { color: "#0082D0" },
28
- { color: "#5203D1" },
29
- { color: "#FFC0CB" }
30
- ], F = m(() => c.activeColor && !i.some((e) => e.color === c.activeColor) || t.value), k = m(() => `background: ${F.value ? c.activeColor ?? t.value : T}`), b = () => {
31
- n.value = !n.value, $(() => {
32
- u.value && u.value.focus();
33
- });
34
- }, g = (e) => {
35
- w("select", e);
15
+ setup(i, { emit: w }) {
16
+ const F = w, t = d(""), p = d(null), r = d(!1), n = d(!1), b = [
17
+ "#FFFFFF",
18
+ "#EF0006",
19
+ "#EDBE20",
20
+ "#069061",
21
+ "#FB892C",
22
+ "#0082D0",
23
+ "#5203D1",
24
+ "#FFC0CB"
25
+ ], E = m(
26
+ () => b.includes(i.activeColor)
27
+ ), h = m(
28
+ () => i.activeColor && !E.value && !r.value
29
+ ), I = (e) => i.activeColor === e, y = m(() => {
30
+ const e = t.value || i.activeColor;
31
+ return h.value || t.value ? `background-color: ${e};` : `background: ${W};`;
32
+ }), g = async () => {
33
+ r.value = !r.value, n.value = !1, r.value && (await V(), p.value?.focus());
34
+ }, z = () => {
35
+ n.value = !n.value;
36
+ }, x = (e) => {
37
+ const o = e && !e.startsWith("#") ? `#${e}` : e;
38
+ F("select", o), n.value = !1;
39
+ }, B = () => {
40
+ if (!t.value)
41
+ return;
42
+ const e = t.value.startsWith("#") ? t.value : `#${t.value}`;
43
+ t.value = e, x(e);
36
44
  };
37
- return (e, l) => n.value ? (s(), v("div", R, [
38
- l[3] || (l[3] = r("span", { class: "absolute h-5 w-5 rounded-full border border-dashed" }, null, -1)),
39
- r("span", {
40
- class: "z-[1] h-5 w-5 rounded-full",
41
- style: C(k.value)
42
- }, null, 4),
43
- I(r("input", {
44
- ref_key: "customColorInputRef",
45
- ref: u,
46
- "onUpdate:modelValue": l[0] || (l[0] = (o) => t.value = o),
47
- class: "w-full flex-1 border-transparent text-sm outline-none",
48
- placeholder: e.activeColor || "#000000",
49
- type: "text",
50
- onInput: l[1] || (l[1] = (o) => g(t.value))
51
- }, null, 40, S), [
52
- [D, t.value]
53
- ]),
54
- r("button", {
55
- class: "text-c-3 hover:bg-b-2 rounded-lg p-1.5",
56
- type: "button",
57
- onClick: b
45
+ return (e, o) => (l(), a("div", null, [
46
+ !r.value && !n.value ? (l(), a("div", {
47
+ key: 0,
48
+ class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full",
49
+ style: v({ backgroundColor: e.activeColor }),
50
+ onClick: z
58
51
  }, [
59
- V(f(p), {
60
- icon: "Checkmark",
61
- size: "xs"
62
- })
63
- ])
64
- ])) : (s(), v("div", j, [
65
- (s(), v(B, null, E(i, (o) => r("div", {
66
- key: o.color,
67
- class: "flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",
68
- "data-testid": "color-option",
69
- style: C({ backgroundColor: o.color }),
70
- onClick: (G) => g(o.color)
71
- }, [
72
- e.activeColor === o.color && !t.value ? (s(), h(f(p), {
73
- key: 0,
74
- class: "text-c-btn",
75
- icon: "Checkmark",
76
- size: "xs"
77
- })) : x("", !0)
78
- ], 12, N)), 64)),
79
- l[2] || (l[2] = r("hr", { class: "border-ghost h-5 w-0.5 border-l" }, null, -1)),
80
- r("label", {
81
- class: "z-10 flex h-5 w-5 cursor-pointer flex-row items-center justify-center gap-2 rounded-full",
82
- style: C(k.value),
83
- onClick: b
84
- }, [
85
- !n.value && (e.activeColor === t.value || e.activeColor && !i.some((o) => o.color === e.activeColor)) ? (s(), h(f(p), {
52
+ e.activeColor ? (l(), k(C(f), {
86
53
  key: 0,
87
- class: "text-c-btn",
54
+ class: "text-c-btn p-0.5",
88
55
  icon: "Checkmark",
89
56
  size: "xs"
90
- })) : x("", !0)
91
- ], 4)
57
+ })) : c("", !0)
58
+ ], 4)) : c("", !0),
59
+ !r.value && n.value ? (l(), a("div", A, [
60
+ (l(), a(S, null, $(b, (u) => s("div", {
61
+ key: u,
62
+ class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full",
63
+ style: v({ backgroundColor: u }),
64
+ onClick: (G) => x(u)
65
+ }, [
66
+ I(u) ? (l(), k(C(f), {
67
+ key: 0,
68
+ class: "text-c-btn p-0.5",
69
+ icon: "Checkmark",
70
+ size: "xs"
71
+ })) : c("", !0)
72
+ ], 12, R)), 64)),
73
+ o[1] || (o[1] = s("hr", { class: "border-ghost h-5 w-0.5 border-l" }, null, -1)),
74
+ s("button", {
75
+ class: "z-10 flex h-4 w-4 cursor-pointer flex-row items-center justify-center gap-2 rounded-full",
76
+ style: v(y.value),
77
+ type: "button",
78
+ onClick: g
79
+ }, [
80
+ h.value ? (l(), k(C(f), {
81
+ key: 0,
82
+ class: "text-c-btn",
83
+ icon: "Checkmark",
84
+ size: "xs"
85
+ })) : c("", !0)
86
+ ], 4)
87
+ ])) : c("", !0),
88
+ r.value ? (l(), a("div", L, [
89
+ o[2] || (o[2] = s("span", { class: "absolute h-4 w-4 rounded-full border border-dashed" }, null, -1)),
90
+ s("span", {
91
+ class: "z-[1] h-4 w-4 rounded-full",
92
+ style: v(y.value)
93
+ }, null, 4),
94
+ j(s("input", {
95
+ ref_key: "customColorInputRef",
96
+ ref: p,
97
+ "onUpdate:modelValue": o[0] || (o[0] = (u) => t.value = u),
98
+ class: "w-full flex-1 border-transparent text-sm outline-none",
99
+ placeholder: e.activeColor || "#000000",
100
+ type: "text",
101
+ onInput: B
102
+ }, null, 40, U), [
103
+ [N, t.value]
104
+ ]),
105
+ s("button", {
106
+ class: "text-c-3 hover:bg-b-2 rounded-lg p-1.5",
107
+ type: "button",
108
+ onClick: g
109
+ }, [
110
+ T(C(f), {
111
+ icon: "Checkmark",
112
+ size: "xs"
113
+ })
114
+ ])
115
+ ])) : c("", !0)
92
116
  ]));
93
117
  }
94
118
  });
95
119
  export {
96
- O as default
120
+ P as default
97
121
  };
@@ -1,19 +1,12 @@
1
1
  import { type ModalState } from '@scalar/components';
2
+ import type { CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
2
4
  type __VLS_Props = {
5
+ environments: NonNullable<XScalarEnvironments['x-scalar-environments']>;
6
+ selectedEnvironmentName: string | null;
3
7
  state: ModalState;
4
- };
5
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
- submit: (environment: {
7
- name: string;
8
- color: string;
9
- }) => any;
10
- cancel: () => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
- onSubmit?: ((environment: {
13
- name: string;
14
- color: string;
15
- }) => any) | undefined;
16
- onCancel?: (() => any) | undefined;
17
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ eventBus: WorkspaceEventBus;
9
+ } & CollectionType;
10
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
11
  export default _default;
19
12
  //# sourceMappingURL=EnvironmentCreateModal.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AAAA,OA6EO,EAAe,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAC;;;cAQU,MAAM;eACL,MAAM;;;;;cADP,MAAM;eACL,MAAM;;;;AA4JnB,wBAOG"}
1
+ {"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AA+IA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAQpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;;AA8MrB,wBAMG"}
@@ -1,55 +1,77 @@
1
- import { defineComponent as f, ref as i, createBlock as v, openBlock as F, unref as C, withCtx as a, createVNode as n, createElementVNode as b, createTextVNode as _ } from "vue";
2
- import { ScalarModal as x } from "@scalar/components";
3
- import V from "../../../../components/CommandPalette/CommandActionForm.vue.js";
4
- import S from "../../../../components/CommandPalette/CommandActionInput.vue.js";
5
- import E from "./EnvironmentColors.vue.js";
6
- const N = { class: "flex items-start gap-2" }, M = /* @__PURE__ */ f({
1
+ import { defineComponent as f, ref as r, watch as N, computed as E, createBlock as y, openBlock as c, unref as h, withCtx as a, createVNode as m, createElementVNode as C, createElementBlock as b, createCommentVNode as x, createTextVNode as T, toDisplayString as F } from "vue";
2
+ import { ScalarModal as V } from "@scalar/components";
3
+ import k from "../../../../components/CommandPalette/CommandActionForm.vue.js";
4
+ import B from "../../../../components/CommandPalette/CommandActionInput.vue.js";
5
+ import S from "./EnvironmentColors.vue.js";
6
+ const O = { class: "flex items-start gap-2" }, g = {
7
+ key: 0,
8
+ class: "text-red text-xs"
9
+ }, s = "#FFFFFF", w = /* @__PURE__ */ f({
7
10
  __name: "EnvironmentCreateModal",
8
11
  props: {
9
- state: {}
12
+ environments: {},
13
+ selectedEnvironmentName: {},
14
+ state: {},
15
+ eventBus: {},
16
+ collectionType: {}
10
17
  },
11
- emits: ["cancel", "submit"],
12
- setup(d, { emit: u }) {
13
- const r = u, e = i(""), o = i("#FFFFFF"), s = () => {
14
- e.value = "", o.value = "#FFFFFF";
15
- }, m = () => {
16
- r("cancel"), s();
17
- }, c = () => {
18
- e.value.trim() && (r("submit", {
19
- name: e.value.trim(),
20
- color: o.value
21
- }), s(), d.state.hide());
22
- };
23
- return (p, t) => (F(), v(C(x), {
18
+ setup(e) {
19
+ const t = r(""), n = r(s);
20
+ N(
21
+ () => e.state.open,
22
+ (l) => {
23
+ if (l) {
24
+ const o = e.environments[e.selectedEnvironmentName ?? ""];
25
+ e.selectedEnvironmentName && o ? (t.value = e.selectedEnvironmentName, n.value = o.color) : (t.value = "", n.value = s);
26
+ }
27
+ }
28
+ );
29
+ const d = (l) => {
30
+ n.value = l;
31
+ }, v = () => {
32
+ e.selectedEnvironmentName ? e.eventBus.emit("environment:upsert:environment", {
33
+ oldEnvironmentName: e.selectedEnvironmentName,
34
+ payload: {
35
+ color: n.value
36
+ },
37
+ environmentName: t.value.trim(),
38
+ collectionType: e.collectionType
39
+ }) : e.eventBus.emit("environment:upsert:environment", {
40
+ environmentName: t.value.trim(),
41
+ payload: {
42
+ color: n.value
43
+ },
44
+ collectionType: e.collectionType
45
+ }), e.state.hide();
46
+ }, i = E(() => e.selectedEnvironmentName ? t.value !== e.selectedEnvironmentName && Object.keys(e.environments).includes(t.value) : Object.keys(e.environments).includes(t.value));
47
+ return (l, o) => (c(), y(h(V), {
24
48
  bodyClass: "border-t-0 rounded-t-lg",
25
49
  size: "xs",
26
- state: p.state,
27
- onClose: m
50
+ state: l.state
28
51
  }, {
29
52
  default: a(() => [
30
- n(V, {
31
- disabled: !e.value.trim(),
32
- onCancel: m,
33
- onSubmit: c
53
+ m(k, {
54
+ disabled: !t.value.trim() || i.value,
55
+ onSubmit: v
34
56
  }, {
35
- submit: a(() => [...t[2] || (t[2] = [
36
- _("Add Environment", -1)
37
- ])]),
57
+ submit: a(() => [
58
+ T(F(l.selectedEnvironmentName ? "Update" : "Add") + " Environment ", 1)
59
+ ]),
38
60
  default: a(() => [
39
- b("div", N, [
40
- n(E, {
41
- activeColor: o.value,
61
+ C("div", O, [
62
+ m(S, {
63
+ activeColor: n.value,
42
64
  class: "peer",
43
- selector: "",
44
- onSelect: t[0] || (t[0] = (l) => o.value = l)
65
+ onSelect: d
45
66
  }, null, 8, ["activeColor"]),
46
- n(S, {
47
- modelValue: e.value,
48
- "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value = l),
67
+ m(B, {
68
+ modelValue: t.value,
69
+ "onUpdate:modelValue": o[0] || (o[0] = (u) => t.value = u),
49
70
  class: "-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden",
50
71
  placeholder: "Environment name"
51
72
  }, null, 8, ["modelValue"])
52
- ])
73
+ ]),
74
+ i.value ? (c(), b("div", g, " This environment name is already in use. ")) : x("", !0)
53
75
  ]),
54
76
  _: 1
55
77
  }, 8, ["disabled"])
@@ -59,5 +81,5 @@ const N = { class: "flex items-start gap-2" }, M = /* @__PURE__ */ f({
59
81
  }
60
82
  });
61
83
  export {
62
- M as default
84
+ w as default
63
85
  };
@@ -1,7 +1,7 @@
1
1
  import { type ModalState } from '@scalar/components';
2
2
  type __VLS_Props = {
3
3
  state: ModalState;
4
- name: string;
4
+ name: string | null;
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
7
  submit: () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAoDA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;;;;;;;AAwHF,wBAOG"}
1
+ {"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAoDA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB,CAAC;;;;;;;;AAwHF,wBAOG"}
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as m, createBlock as u, openBlock as f, unref as n, withCtx as o, createElementVNode as a, createVNode as l, createTextVNode as i } from "vue";
2
2
  import { ScalarModal as p, ScalarButton as r } from "@scalar/components";
3
- const x = { class: "flex justify-between" }, y = /* @__PURE__ */ m({
3
+ const x = { class: "flex justify-between" }, k = /* @__PURE__ */ m({
4
4
  __name: "EnvironmentDeleteModal",
5
5
  props: {
6
6
  state: {},
7
- name: {}
7
+ name: { default: "unknown" }
8
8
  },
9
9
  emits: ["cancel", "submit"],
10
10
  setup(b, { emit: d }) {
@@ -49,5 +49,5 @@ const x = { class: "flex justify-between" }, y = /* @__PURE__ */ m({
49
49
  }
50
50
  });
51
51
  export {
52
- y as default
52
+ k as default
53
53
  };
@@ -0,0 +1,21 @@
1
+ import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
2
+ type __VLS_Props = {
3
+ query: string;
4
+ environment: XScalarEnvironment;
5
+ dropdownPosition?: {
6
+ left: number;
7
+ top: number;
8
+ };
9
+ };
10
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {
11
+ handleArrowKey: (direction: "up" | "down") => void;
12
+ handleSelect: () => void;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ select: (variable: string) => any;
15
+ redirect: () => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onSelect?: ((variable: string) => any) | undefined;
18
+ onRedirect?: (() => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
21
+ //# sourceMappingURL=EnvironmentVariablesDropdown.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentVariablesDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"names":[],"mappings":"AAkKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAKnH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,kBAAkB,CAAA;IAC/B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD,CAAC;;gCAqDiC,IAAI,GAAG,MAAM;;;;;;;;;AA0OhD,wBAQG"}