@scalar/api-client 2.5.13 → 2.5.16

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 (127) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue2.js +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +3 -3
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +11 -10
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +10 -10
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  13. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +129 -116
  14. package/dist/components/DataTable/DataTableCell.vue.js +8 -8
  15. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  17. package/dist/components/Form/Form.vue.js +1 -1
  18. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  19. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +7 -7
  20. package/dist/components/ImportCollection/PrefetchError.vue.js +1 -1
  21. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +1 -1
  22. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts +5 -0
  23. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -0
  24. package/dist/components/ImportCollection/utils/get-openapi-version.js +20 -0
  25. package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts +2 -0
  26. package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts.map +1 -0
  27. package/dist/components/ImportCollection/utils/import-collection.js +1 -1
  28. package/dist/components/ImportCollection/utils/{isDocument.d.ts → is-document.d.ts} +2 -2
  29. package/dist/components/ImportCollection/utils/is-document.d.ts.map +1 -0
  30. package/dist/components/ImportCollection/utils/is-document.js +9 -0
  31. package/dist/components/ImportCollection/utils/is-document.test.d.ts +2 -0
  32. package/dist/components/ImportCollection/utils/is-document.test.d.ts.map +1 -0
  33. package/dist/components/ImportCollection/utils/is-url.d.ts +5 -0
  34. package/dist/components/ImportCollection/utils/is-url.d.ts.map +1 -0
  35. package/dist/components/ImportCollection/utils/is-url.js +9 -0
  36. package/dist/components/ImportCollection/utils/is-url.test.d.ts +2 -0
  37. package/dist/components/ImportCollection/utils/is-url.test.d.ts.map +1 -0
  38. package/dist/components/OpenApiClientButton.vue.js +2 -2
  39. package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
  40. package/dist/components/Server/ServerDropdown.vue.js +8 -8
  41. package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
  42. package/dist/components/Server/ServerSelector.vue.js +13 -13
  43. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  44. package/dist/components/Server/ServerVariablesSelect.vue.js +3 -3
  45. package/dist/components/TopNav/TopNav.vue.js +10 -10
  46. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  47. package/dist/components/TopNav/TopNavItem.vue2.js +1 -1
  48. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +5 -1
  49. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  50. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +42 -36
  51. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +4 -4
  52. package/dist/hooks/useClientConfig.d.ts +42 -36
  53. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  54. package/dist/layouts/App/create-api-client-app.d.ts +202 -162
  55. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  56. package/dist/layouts/Modal/create-api-client-modal.d.ts +404 -324
  57. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  58. package/dist/layouts/Web/create-api-client-web.d.ts +202 -162
  59. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  60. package/dist/libs/create-client.d.ts +202 -162
  61. package/dist/libs/create-client.d.ts.map +1 -1
  62. package/dist/libs/find-request.d.ts +5 -5
  63. package/dist/libs/find-request.d.ts.map +1 -1
  64. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
  65. package/dist/libs/get-request-uid-by-path-method.js +15 -7
  66. package/dist/libs/send-request/create-request-operation.js +10 -10
  67. package/dist/libs/send-request/create-request-operation.test.d.ts +33 -33
  68. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  69. package/dist/libs/send-request/set-request-cookies.d.ts +1 -1
  70. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
  71. package/dist/plugins/plugin-manager.d.ts +5 -3
  72. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  73. package/dist/plugins/plugin-manager.js +17 -9
  74. package/dist/plugins/plugin-manager.test.d.ts +2 -0
  75. package/dist/plugins/plugin-manager.test.d.ts.map +1 -0
  76. package/dist/store/active-entities.d.ts +33 -33
  77. package/dist/store/active-entities.d.ts.map +1 -1
  78. package/dist/store/request-example.d.ts +130 -130
  79. package/dist/store/request-example.d.ts.map +1 -1
  80. package/dist/store/requests.d.ts +55 -55
  81. package/dist/store/requests.d.ts.map +1 -1
  82. package/dist/store/security-schemes.d.ts +42 -2
  83. package/dist/store/security-schemes.d.ts.map +1 -1
  84. package/dist/store/store.d.ts +204 -164
  85. package/dist/store/store.d.ts.map +1 -1
  86. package/dist/style.css +1 -1
  87. package/dist/views/Collection/CollectionInfoForm.vue.js +2 -2
  88. package/dist/views/Collection/components/EnvironmentForm.vue.js +2 -2
  89. package/dist/views/Collection/components/MarkdownInput.vue.d.ts.map +1 -1
  90. package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
  91. package/dist/views/Collection/components/MarkdownInput.vue2.js +32 -26
  92. package/dist/views/Cookies/CookieForm.vue.js +1 -1
  93. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  94. package/dist/views/Cookies/Cookies.vue2.js +67 -61
  95. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  96. package/dist/views/Environment/Environment.vue2.js +98 -92
  97. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +1 -1
  98. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  100. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +126 -122
  101. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +1 -1
  102. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +22 -22
  103. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  104. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  105. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  106. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  108. package/dist/views/Request/RequestSidebarItem.vue2.js +9 -9
  109. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +9 -9
  110. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  111. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +3 -3
  112. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +1 -1
  113. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  114. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +9 -9
  115. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  116. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  117. package/dist/views/Request/libs/oauth2.js +39 -39
  118. package/dist/views/Settings/SettingsGeneral.vue.js +2 -2
  119. package/package.json +19 -19
  120. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts +0 -5
  121. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts.map +0 -1
  122. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.js +0 -20
  123. package/dist/components/ImportCollection/utils/isDocument.d.ts.map +0 -1
  124. package/dist/components/ImportCollection/utils/isDocument.js +0 -7
  125. package/dist/components/ImportCollection/utils/isUrl.d.ts +0 -3
  126. package/dist/components/ImportCollection/utils/isUrl.d.ts.map +0 -1
  127. package/dist/components/ImportCollection/utils/isUrl.js +0 -6
@@ -1,7 +1,7 @@
1
1
  import o from "./CollectionInfoForm.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-faabb883"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68d5218e"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./EnvironmentForm.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-efc6e074"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-2debec7e"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Collection/components/MarkdownInput.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;;;;;AAuSF,wBAQG"}
1
+ {"version":3,"file":"MarkdownInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Collection/components/MarkdownInput.vue"],"names":[],"mappings":"AAqHA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;;;;;AA4SF,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./MarkdownInput.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1d968b50"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5997a667"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as V, ref as p, watch as w, nextTick as x, createElementBlock as i, openBlock as o, createElementVNode as n, createBlock as u, createCommentVNode as a, unref as s, withCtx as v, createVNode as d, Fragment as f } from "vue";
2
- import { ScalarButton as c, ScalarIcon as b, ScalarMarkdown as h } from "@scalar/components";
3
- import y from "../../../components/CodeInput/CodeInput.vue.js";
4
- const z = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "flex min-h-8 items-center justify-between gap-2 pl-1.5" }, I = { class: "has-[:focus-visible]:bg-b-1 group relative z-1 flex flex-col rounded-lg" }, B = { class: "flex h-full min-h-[calc(1rem*4)] flex-col" }, $ = {
1
+ import { defineComponent as h, ref as p, watch as w, nextTick as x, createElementBlock as i, openBlock as o, createElementVNode as n, createBlock as u, createCommentVNode as a, unref as r, withCtx as v, createVNode as d, Fragment as f } from "vue";
2
+ import { ScalarButton as c, ScalarIcon as b, ScalarMarkdown as y } from "@scalar/components";
3
+ import z from "../../../components/CodeInput/CodeInput.vue.js";
4
+ const B = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "flex min-h-8 items-center justify-between gap-2 pl-1.5" }, I = { class: "has-[:focus-visible]:bg-b-1 group relative z-1 flex flex-col rounded-lg" }, E = { class: "flex h-full min-h-[calc(1rem*4)] flex-col" }, N = {
5
5
  key: 1,
6
6
  class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4"
7
- }, D = /* @__PURE__ */ V({
7
+ }, F = /* @__PURE__ */ h({
8
8
  __name: "MarkdownInput",
9
9
  props: {
10
10
  modelValue: {},
@@ -13,67 +13,73 @@ const z = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
13
13
  workspace: {}
14
14
  },
15
15
  emits: ["update:modelValue"],
16
- setup(E, { emit: k }) {
16
+ setup(S, { emit: k }) {
17
17
  const g = k, t = p("preview"), m = p(null);
18
- return w(t, (l) => {
18
+ w(t, (l) => {
19
19
  l === "edit" && x(() => {
20
20
  var e;
21
21
  (e = m.value) == null || e.focus();
22
22
  });
23
- }), (l, e) => (o(), i("div", z, [
23
+ });
24
+ const V = () => {
25
+ requestAnimationFrame(() => {
26
+ t.value = "preview";
27
+ });
28
+ };
29
+ return (l, e) => (o(), i("div", B, [
24
30
  n("div", C, [
25
- e[6] || (e[6] = n("h3", { class: "font-bold" }, "Description", -1)),
26
- t.value === "preview" ? (o(), u(s(c), {
31
+ e[5] || (e[5] = n("h3", { class: "font-bold" }, "Description", -1)),
32
+ t.value === "preview" ? (o(), u(r(c), {
27
33
  key: 0,
28
34
  class: "text-c-2 hover:text-c-1 flex items-center gap-2",
29
35
  size: "sm",
30
36
  type: "button",
31
37
  variant: "outlined",
32
- onClick: e[0] || (e[0] = (r) => t.value = "edit")
38
+ onClick: e[0] || (e[0] = (s) => t.value = "edit")
33
39
  }, {
34
40
  default: v(() => [
35
- d(s(b), {
41
+ d(r(b), {
36
42
  icon: "Pencil",
37
43
  size: "sm",
38
44
  thickness: "1.5"
39
45
  }),
40
- e[5] || (e[5] = n("span", null, "Edit", -1))
46
+ e[4] || (e[4] = n("span", null, "Edit", -1))
41
47
  ]),
42
48
  _: 1
43
49
  })) : a("", !0)
44
50
  ]),
45
51
  n("div", I, [
46
- n("div", B, [
52
+ n("div", E, [
47
53
  t.value === "preview" ? (o(), i(f, { key: 0 }, [
48
54
  l.modelValue && l.modelValue.trim().length ? (o(), i(f, { key: 0 }, [
49
- l.modelValue ? (o(), u(s(h), {
55
+ l.modelValue ? (o(), u(r(y), {
50
56
  key: 0,
51
57
  class: "h-full flex-1 rounded border border-transparent p-1.5 hover:border-(--scalar-background-3)",
52
58
  value: l.modelValue,
53
59
  withImages: "",
54
- onDblclick: e[1] || (e[1] = (r) => t.value = "edit")
60
+ onDblclick: e[1] || (e[1] = (s) => t.value = "edit")
55
61
  }, null, 8, ["value"])) : a("", !0),
56
- e[7] || (e[7] = n("div", { class: "brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-[:focus-visible]:hidden" }, null, -1))
57
- ], 64)) : (o(), i("div", $, [
58
- d(s(c), {
62
+ e[6] || (e[6] = n("div", { class: "brightness-lifted bg-b-1 absolute inset-0 -z-1 hidden rounded group-hover:block group-has-[:focus-visible]:hidden" }, null, -1))
63
+ ], 64)) : (o(), i("div", N, [
64
+ d(r(c), {
59
65
  class: "hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2",
60
66
  size: "sm",
61
67
  variant: "ghost",
62
- onClick: e[2] || (e[2] = (r) => t.value = "edit")
68
+ onClick: e[2] || (e[2] = (s) => t.value = "edit")
63
69
  }, {
64
70
  default: v(() => [
65
- d(s(b), {
71
+ d(r(b), {
66
72
  icon: "Pencil",
67
73
  size: "sm",
68
74
  thickness: "1.5"
69
75
  }),
70
- e[8] || (e[8] = n("span", null, "Write a description", -1))
76
+ e[7] || (e[7] = n("span", null, "Write a description", -1))
71
77
  ]),
72
78
  _: 1
73
79
  })
74
80
  ]))
75
81
  ], 64)) : a("", !0),
76
- t.value === "edit" ? (o(), u(y, {
82
+ t.value === "edit" ? (o(), u(z, {
77
83
  key: 1,
78
84
  ref_key: "codeInputRef",
79
85
  ref: m,
@@ -82,8 +88,8 @@ const z = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
82
88
  environment: l.environment,
83
89
  modelValue: l.modelValue,
84
90
  workspace: l.workspace,
85
- onBlur: e[3] || (e[3] = (r) => t.value = "preview"),
86
- "onUpdate:modelValue": e[4] || (e[4] = (r) => g("update:modelValue", r))
91
+ onBlur: V,
92
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => g("update:modelValue", s))
87
93
  }, null, 8, ["envVariables", "environment", "modelValue", "workspace"])) : a("", !0)
88
94
  ])
89
95
  ])
@@ -91,5 +97,5 @@ const z = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
91
97
  }
92
98
  });
93
99
  export {
94
- D as default
100
+ F as default
95
101
  };
@@ -10,7 +10,7 @@ const x = /* @__PURE__ */ s({
10
10
  { label: "Name", key: "name", placeholder: "session_id" },
11
11
  { label: "Value", key: "value", placeholder: "my-cookie-session-id" },
12
12
  { label: "Domain", key: "domain", placeholder: "example.com" }
13
- // TODO: We dont check the path (yet), so we dont need to show it.
13
+ // TODO: We don't check the path (yet), so we don't need to show it.
14
14
  // { label: 'Path', key: 'path', placeholder: '/' },
15
15
  ], m = l(
16
16
  () => t[e.value] || d.parse({
@@ -1 +1 @@
1
- {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";AA0jBA,wBAMG"}
1
+ {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";AA8kBA,wBAMG"}
@@ -1,110 +1,116 @@
1
- import { defineComponent as K, onMounted as L, onBeforeUnmount as V, computed as h, createBlock as d, openBlock as n, withCtx as a, createVNode as r, unref as u, createTextVNode as b, createElementVNode as y, createElementBlock as w, Fragment as j, renderList as A, withModifiers as O } from "vue";
2
- import { useModal as H } from "@scalar/components";
3
- import { cookieSchema as I } from "@scalar/oas-utils/entities/cookie";
4
- import { useRouter as R, useRoute as W } from "vue-router";
1
+ import { defineComponent as K, onMounted as L, onBeforeUnmount as V, computed as b, watch as j, createBlock as d, openBlock as r, withCtx as a, createVNode as n, unref as u, createTextVNode as y, createElementVNode as w, createElementBlock as x, Fragment as A, renderList as O, withModifiers as H } from "vue";
2
+ import { useModal as I } from "@scalar/components";
3
+ import { cookieSchema as R } from "@scalar/oas-utils/entities/cookie";
4
+ import { useRouter as W, useRoute as q } from "vue-router";
5
5
  import D from "../../components/EmptyState.vue.js";
6
6
  import F from "../../components/Sidebar/SidebarButton.vue.js";
7
7
  import P from "../../components/Sidebar/SidebarList.vue.js";
8
8
  import T from "../../components/Sidebar/SidebarListElement.vue.js";
9
9
  import U from "../../components/ViewLayout/ViewLayout.vue.js";
10
- import q from "../../components/ViewLayout/ViewLayoutContent.vue.js";
11
- import z from "../../components/ViewLayout/ViewLayoutSection.vue.js";
12
- import { PathId as x } from "../../routes.js";
13
- import G from "./CookieForm.vue.js";
14
- import J from "./CookieModal.vue.js";
15
- import { useActiveEntities as Q } from "../../store/active-entities.js";
16
- import { useWorkspace as X } from "../../store/store.js";
17
- import Y from "../../components/Sidebar/Sidebar.vue.js";
18
- const Z = { class: "flex-1" }, ee = { class: "relative mb-[.5px] last:mb-0" }, he = /* @__PURE__ */ K({
10
+ import z from "../../components/ViewLayout/ViewLayoutContent.vue.js";
11
+ import G from "../../components/ViewLayout/ViewLayoutSection.vue.js";
12
+ import { PathId as M } from "../../routes.js";
13
+ import J from "./CookieForm.vue.js";
14
+ import Q from "./CookieModal.vue.js";
15
+ import { useActiveEntities as X } from "../../store/active-entities.js";
16
+ import { useWorkspace as Y } from "../../store/store.js";
17
+ import Z from "../../components/Sidebar/Sidebar.vue.js";
18
+ const ee = { class: "flex-1" }, oe = { class: "relative mb-[.5px] last:mb-0" }, be = /* @__PURE__ */ K({
19
19
  __name: "Cookies",
20
- setup(oe) {
21
- const { cookies: c, cookieMutators: p, events: k, workspaceMutators: v } = X(), { activeWorkspace: l, activeCookieId: g } = Q(), m = R(), M = W(), f = H(), E = (t) => {
20
+ setup(te) {
21
+ const { cookies: c, cookieMutators: k, events: v, workspaceMutators: C } = Y(), { activeWorkspace: l, activeCookieId: g } = X(), m = W(), h = q(), f = I(), E = (o) => {
22
22
  var e, i;
23
- const o = I.parse({
24
- name: t.name,
25
- value: t.value,
26
- domain: t.domain,
23
+ const t = R.parse({
24
+ name: o.name,
25
+ value: o.value,
26
+ domain: o.domain,
27
27
  path: "/"
28
28
  });
29
- p.add(o), v.edit((e = l.value) == null ? void 0 : e.uid, "cookies", [
29
+ k.add(t), C.edit((e = l.value) == null ? void 0 : e.uid, "cookies", [
30
30
  ...((i = l.value) == null ? void 0 : i.cookies) ?? [],
31
- o.uid
31
+ t.uid
32
32
  ]), m.push({
33
33
  name: "cookies",
34
34
  params: {
35
- cookies: o.uid
35
+ cookies: t.uid
36
36
  }
37
37
  });
38
- }, N = (t) => {
38
+ }, N = (o) => {
39
39
  var e, i;
40
- p.delete(t), v.edit((e = l.value) == null ? void 0 : e.uid, "cookies", [
41
- ...(((i = l.value) == null ? void 0 : i.cookies) ?? []).filter((s) => s !== t)
40
+ k.delete(o), C.edit((e = l.value) == null ? void 0 : e.uid, "cookies", [
41
+ ...(((i = l.value) == null ? void 0 : i.cookies) ?? []).filter((s) => s !== o)
42
42
  ]);
43
- const o = Object.values(c).filter(
44
- (s) => s.uid !== t
43
+ const t = Object.values(c).filter(
44
+ (s) => s.uid !== o
45
45
  );
46
- if (o.length > 0) {
47
- const s = o[o.length - 1];
46
+ if (t.length > 0) {
47
+ const s = t[t.length - 1];
48
48
  s && m.push(s.uid);
49
49
  } else
50
50
  m.push({
51
51
  name: "cookies",
52
52
  params: {
53
- [x.Cookies]: "default"
53
+ [M.Cookies]: "default"
54
54
  }
55
55
  });
56
- }, C = () => {
56
+ }, p = () => {
57
57
  f.show();
58
- }, _ = (t) => {
59
- t != null && t.createNew && M.name === "cookies" && C();
60
- }, S = (t, o) => {
58
+ }, _ = (o) => {
59
+ o != null && o.createNew && h.name === "cookies" && p();
60
+ }, S = (o, t) => {
61
61
  var i;
62
62
  const e = {
63
63
  name: "cookies",
64
64
  params: {
65
65
  workspace: ((i = l.value) == null ? void 0 : i.uid) ?? "default",
66
- cookies: o
66
+ cookies: t
67
67
  }
68
68
  };
69
- if (t.metaKey) {
69
+ if (o.metaKey) {
70
70
  const s = m.resolve(e).href;
71
71
  window.open(s, "_blank");
72
72
  return;
73
73
  }
74
74
  m.push(e);
75
75
  };
76
- L(() => k.hotKeys.on(_)), V(() => k.hotKeys.off(_));
77
- const $ = h(
76
+ L(() => v.hotKeys.on(_)), V(() => v.hotKeys.off(_));
77
+ const $ = b(
78
78
  () => c[g.value]
79
- ), B = h(
79
+ ), B = b(
80
80
  () => Object.keys(c).length > 0 && $.value
81
81
  );
82
- return (t, o) => (n(), d(U, null, {
82
+ return j(
83
+ () => h.query.openCookieModal,
84
+ (o) => {
85
+ o === "true" && p();
86
+ },
87
+ { immediate: !0 }
88
+ ), (o, t) => (r(), d(U, null, {
83
89
  default: a(() => [
84
- r(u(Y), { title: "Cookies" }, {
90
+ n(u(Z), { title: "Cookies" }, {
85
91
  content: a(() => [
86
- y("div", Z, [
87
- r(P, null, {
92
+ w("div", ee, [
93
+ n(P, null, {
88
94
  default: a(() => [
89
- (n(!0), w(j, null, A(Object.values(u(c)), (e) => (n(), w("li", {
95
+ (r(!0), x(A, null, O(Object.values(u(c)), (e) => (r(), x("li", {
90
96
  key: e.uid,
91
97
  class: "gap-1/2 flex flex-col"
92
98
  }, [
93
- y("div", ee, [
94
- (n(), d(T, {
99
+ w("div", oe, [
100
+ (r(), d(T, {
95
101
  key: e.uid,
96
102
  class: "text-xs",
97
103
  isDeletable: "",
98
104
  to: {
99
105
  name: "cookies",
100
106
  params: {
101
- [u(x).Cookies]: e.uid
107
+ [u(M).Cookies]: e.uid
102
108
  }
103
109
  },
104
110
  type: "cookies",
105
111
  variable: { name: e.name, uid: e.uid },
106
112
  warningMessage: "Are you sure you want to delete this cookie?",
107
- onClick: O((i) => S(i, e.uid), ["prevent"]),
113
+ onClick: H((i) => S(i, e.uid), ["prevent"]),
108
114
  onDelete: (i) => N(e.uid)
109
115
  }, null, 8, ["to", "variable", "onClick", "onDelete"]))
110
116
  ])
@@ -115,38 +121,38 @@ const Z = { class: "flex-1" }, ee = { class: "relative mb-[.5px] last:mb-0" }, h
115
121
  ])
116
122
  ]),
117
123
  button: a(() => [
118
- r(F, {
119
- click: C,
124
+ n(F, {
125
+ click: p,
120
126
  hotkey: "N"
121
127
  }, {
122
- title: a(() => o[1] || (o[1] = [
123
- b(" Add Cookie ")
128
+ title: a(() => t[1] || (t[1] = [
129
+ y(" Add Cookie ")
124
130
  ])),
125
131
  _: 1
126
132
  })
127
133
  ]),
128
134
  _: 1
129
135
  }),
130
- r(q, { class: "flex-1" }, {
136
+ n(z, { class: "flex-1" }, {
131
137
  default: a(() => [
132
- B.value ? (n(), d(z, {
138
+ B.value ? (r(), d(G, {
133
139
  key: 0,
134
140
  class: "*:border-b-0"
135
141
  }, {
136
- title: a(() => o[2] || (o[2] = [
137
- b("Edit Cookie")
142
+ title: a(() => t[2] || (t[2] = [
143
+ y("Edit Cookie")
138
144
  ])),
139
145
  default: a(() => [
140
- r(G)
146
+ n(J)
141
147
  ]),
142
148
  _: 1
143
- })) : (n(), d(D, { key: 1 }))
149
+ })) : (r(), d(D, { key: 1 }))
144
150
  ]),
145
151
  _: 1
146
152
  }),
147
- r(J, {
153
+ n(Q, {
148
154
  state: u(f),
149
- onCancel: o[0] || (o[0] = (e) => u(f).hide()),
155
+ onCancel: t[0] || (t[0] = (e) => u(f).hide()),
150
156
  onSubmit: E
151
157
  }, null, 8, ["state"])
152
158
  ]),
@@ -155,5 +161,5 @@ const Z = { class: "flex-1" }, ee = { class: "relative mb-[.5px] last:mb-0" }, h
155
161
  }
156
162
  });
157
163
  export {
158
- he as default
164
+ be as default
159
165
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AA6/CA,wBAMG"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AAihDA,wBAMG"}