@kong-ui-public/entities-shared 3.46.3 → 3.46.4-pr.3253.6926b8a78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_plugin-vue_export-helper-81qp9EEZ.js → _plugin-vue_export-helper-BpeW-zKx.js} +49 -49
- package/dist/_plugin-vue_export-helper-CwM56vX0.cjs +1 -0
- package/dist/deck-editor.cjs.js +1 -1
- package/dist/deck-editor.es.js +1 -1
- package/dist/entities-shared.cjs.js +4 -4
- package/dist/entities-shared.es.js +81 -79
- package/dist/style.css +1 -1
- package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts.map +1 -1
- package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts.map +1 -1
- package/package.json +5 -1
- package/dist/_plugin-vue_export-helper-B5cQfgfE.cjs +0 -1
package/dist/{_plugin-vue_export-helper-81qp9EEZ.js → _plugin-vue_export-helper-BpeW-zKx.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import N from "axios";
|
|
2
|
-
import { inject as P, ref as
|
|
2
|
+
import { inject as P, ref as h, computed as _, unref as W, toValue as m, watch as se, toRef as ne, provide as J } from "vue";
|
|
3
3
|
import { createI18n as re, i18nTComponent as oe } from "@kong-ui-public/i18n";
|
|
4
4
|
var x = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(x || {}), Y = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.CloudGatewayAddon = "cloud_gateway_addon", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.TlsTrustBundle = "tls_trust_bundle", e.AuthServer = "auth_server", e.AuthServerScopes = "auth_server_scopes", e.AuthServerClaims = "auth_server_claims", e.AuthServerClients = "auth_server_clients", e.Other = "other", e))(Y || {});
|
|
5
5
|
const Qe = Object.values(Y), ie = [
|
|
@@ -60,7 +60,7 @@ function de() {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const E = "khcp-user-table-preferences", fe = {
|
|
64
64
|
pageSize: 30,
|
|
65
65
|
sortColumnKey: void 0,
|
|
66
66
|
sortColumnOrder: void 0,
|
|
@@ -76,14 +76,14 @@ function et() {
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
}, s = () => {
|
|
79
|
-
const r = e(localStorage.getItem(
|
|
79
|
+
const r = e(localStorage.getItem(E));
|
|
80
80
|
return !r || !Object.keys(r).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(r));
|
|
81
81
|
};
|
|
82
82
|
return {
|
|
83
83
|
setTablePreferences: (r, t) => {
|
|
84
84
|
try {
|
|
85
85
|
const o = s();
|
|
86
|
-
o.set(r, t), localStorage.setItem(
|
|
86
|
+
o.set(r, t), localStorage.setItem(E, JSON.stringify(Object.fromEntries(o.entries())));
|
|
87
87
|
} catch (o) {
|
|
88
88
|
console.error("useTablePreferences(setTablePreferences)", o);
|
|
89
89
|
}
|
|
@@ -93,11 +93,11 @@ function et() {
|
|
|
93
93
|
return (o == null ? void 0 : o.get(r)) || void 0 || t || fe;
|
|
94
94
|
},
|
|
95
95
|
deleteAllTablePreferences: () => {
|
|
96
|
-
localStorage.removeItem(
|
|
96
|
+
localStorage.removeItem(E);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function $(e = {}) {
|
|
101
101
|
const { getAxiosInstance: s } = ue();
|
|
102
102
|
return {
|
|
103
103
|
axiosInstance: s(e)
|
|
@@ -113,7 +113,7 @@ const pe = {
|
|
|
113
113
|
}, ge = {
|
|
114
114
|
message: "Are you sure you want to delete this {entityType}?",
|
|
115
115
|
messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
|
|
116
|
-
},
|
|
116
|
+
}, he = {
|
|
117
117
|
actions: {
|
|
118
118
|
viewConfiguration: "View configuration",
|
|
119
119
|
hideConfiguration: "Hide configuration",
|
|
@@ -132,7 +132,7 @@ const pe = {
|
|
|
132
132
|
errors: {
|
|
133
133
|
edit: "The entity could not be edited at this time."
|
|
134
134
|
}
|
|
135
|
-
},
|
|
135
|
+
}, me = {
|
|
136
136
|
emptyState: {
|
|
137
137
|
noSearchResultsTitle: "No results found",
|
|
138
138
|
noSearchResultsMessage: "Please adjust the criteria and try again.",
|
|
@@ -225,7 +225,7 @@ const pe = {
|
|
|
225
225
|
copy_pat: "Make sure to copy your personal access token now. You won't be able to see it again.",
|
|
226
226
|
reuse_pat: "Use an existing PAT if you've already generated one.",
|
|
227
227
|
generate_pat: "Generate PAT",
|
|
228
|
-
footer_reminder: "Changes
|
|
228
|
+
footer_reminder: "Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",
|
|
229
229
|
secret_advise: "Command may contain sensitive values. Treat it as a secret."
|
|
230
230
|
},
|
|
231
231
|
copy_tooltip: "Copy"
|
|
@@ -254,8 +254,8 @@ const pe = {
|
|
|
254
254
|
}, De = {
|
|
255
255
|
global: pe,
|
|
256
256
|
deleteModal: ge,
|
|
257
|
-
baseForm:
|
|
258
|
-
baseTable:
|
|
257
|
+
baseForm: he,
|
|
258
|
+
baseTable: me,
|
|
259
259
|
baseConfigCard: ve,
|
|
260
260
|
emptyState: be,
|
|
261
261
|
filter: ye,
|
|
@@ -322,9 +322,9 @@ function Oe(e, s, r, t = {
|
|
|
322
322
|
searchKeys: ["id"]
|
|
323
323
|
}) {
|
|
324
324
|
r || (r = "1000");
|
|
325
|
-
const { axiosInstance: o } =
|
|
325
|
+
const { axiosInstance: o } = $(e.axiosRequestConfig), { i18n: { t: n } } = R(), { debounce: a } = de(), c = a(async (d) => {
|
|
326
326
|
await D(d);
|
|
327
|
-
}, 200), l =
|
|
327
|
+
}, 200), l = h(!1), i = h(""), f = h(""), u = h([]), k = h([]), w = h(void 0), p = _(() => {
|
|
328
328
|
let d = `${e.apiBaseUrl}${W(s)}`;
|
|
329
329
|
return e.app === "konnect" && (d = d.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "")), d.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "");
|
|
330
330
|
}), { isValidUuid: C } = Q(), y = async () => {
|
|
@@ -337,7 +337,7 @@ function Oe(e, s, r, t = {
|
|
|
337
337
|
} finally {
|
|
338
338
|
l.value = !1;
|
|
339
339
|
}
|
|
340
|
-
}, I =
|
|
340
|
+
}, I = h(""), D = async (d) => {
|
|
341
341
|
var M, T, U;
|
|
342
342
|
if (I.value !== d) {
|
|
343
343
|
if (I.value = d ?? "", !d) {
|
|
@@ -363,8 +363,8 @@ function Oe(e, s, r, t = {
|
|
|
363
363
|
const v = await Promise.all(b), O = /* @__PURE__ */ new Set();
|
|
364
364
|
u.value = [], (M = v == null ? void 0 : v.forEach) == null || M.call(v, (g) => {
|
|
365
365
|
var A;
|
|
366
|
-
(A = g == null ? void 0 : g.forEach) == null || A.call(g, (
|
|
367
|
-
O.has(
|
|
366
|
+
(A = g == null ? void 0 : g.forEach) == null || A.call(g, (K) => {
|
|
367
|
+
O.has(K.id) || (O.add(K.id), u.value.push(K));
|
|
368
368
|
});
|
|
369
369
|
});
|
|
370
370
|
}
|
|
@@ -398,17 +398,17 @@ function Oe(e, s, r, t = {
|
|
|
398
398
|
const tt = Symbol("PLUGIN_FORM_LAYOUT_STATE"), q = Symbol("DECK_COMMAND_EDITOR"), Z = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).";
|
|
399
399
|
function Pe(e, s) {
|
|
400
400
|
const r = P(q, null), t = _(() => {
|
|
401
|
-
const a =
|
|
402
|
-
return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckConfig)) && H(
|
|
401
|
+
const a = m(e);
|
|
402
|
+
return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckConfig)) && H(m(s));
|
|
403
403
|
}), o = _(() => {
|
|
404
|
-
const a =
|
|
404
|
+
const a = m(e), c = a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.customization : void 0;
|
|
405
405
|
if (c && !r) {
|
|
406
406
|
console.warn(Z);
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
409
|
return c;
|
|
410
410
|
}), n = _(() => {
|
|
411
|
-
const a =
|
|
411
|
+
const a = m(e);
|
|
412
412
|
return a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
|
|
413
413
|
});
|
|
414
414
|
return {
|
|
@@ -419,17 +419,17 @@ function Pe(e, s) {
|
|
|
419
419
|
}
|
|
420
420
|
function Re(e, s) {
|
|
421
421
|
const r = P(q, null), t = _(() => {
|
|
422
|
-
const a =
|
|
423
|
-
return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && H(
|
|
422
|
+
const a = m(e);
|
|
423
|
+
return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && H(m(s));
|
|
424
424
|
}), o = _(() => {
|
|
425
|
-
const a =
|
|
425
|
+
const a = m(e), c = a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.customization : void 0;
|
|
426
426
|
if (c && !r) {
|
|
427
427
|
console.warn(Z);
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
return c;
|
|
431
431
|
}), n = _(() => {
|
|
432
|
-
const a =
|
|
432
|
+
const a = m(e);
|
|
433
433
|
return a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
|
|
434
434
|
});
|
|
435
435
|
return {
|
|
@@ -438,13 +438,13 @@ function Re(e, s) {
|
|
|
438
438
|
deckCalloutPreferenceKey: n
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Ke(e, s) {
|
|
442
442
|
const r = W(s), t = _(
|
|
443
443
|
() => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${r}`) : new URL(r)
|
|
444
444
|
);
|
|
445
445
|
return t.value.search = "", (o) => `${t.value.href}/${o}`;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Ee() {
|
|
448
448
|
const { i18n: { t: e } } = R();
|
|
449
449
|
return {
|
|
450
450
|
getErrorFieldsFromError: (t) => {
|
|
@@ -516,7 +516,7 @@ function Ke() {
|
|
|
516
516
|
}
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Le(e) {
|
|
520
520
|
const s = window.location.origin, r = s.endsWith("/") ? s : `${s}/`;
|
|
521
521
|
try {
|
|
522
522
|
const t = e.join("/"), o = `${r}${t}`, n = e.some((c) => c.trim() === "");
|
|
@@ -529,10 +529,10 @@ function $e(e) {
|
|
|
529
529
|
}
|
|
530
530
|
function X(e, s) {
|
|
531
531
|
const r = _(() => {
|
|
532
|
-
const o =
|
|
532
|
+
const o = m(e);
|
|
533
533
|
return o.app === "konnect" || !!o.isExactMatch;
|
|
534
534
|
}), t = _(() => {
|
|
535
|
-
const o =
|
|
535
|
+
const o = m(s);
|
|
536
536
|
return o.startsWith("/") ? new URL(`${window.location.origin}${o}`) : new URL(o);
|
|
537
537
|
});
|
|
538
538
|
return (o) => {
|
|
@@ -541,24 +541,24 @@ function X(e, s) {
|
|
|
541
541
|
let u = new URL(t.value.href);
|
|
542
542
|
if (r.value && f) {
|
|
543
543
|
const k = new URLSearchParams(t.value.search);
|
|
544
|
-
u.search = "", u =
|
|
544
|
+
u.search = "", u = m(e).isExactMatch ? new URL(`${u.href}/${f}`) : new URL(`${u.href}?filter[name][contains]=${f}`), k.forEach((w, p) => u.searchParams.append(p, w));
|
|
545
545
|
} else
|
|
546
546
|
r.value || new URLSearchParams(f).forEach((k, w) => {
|
|
547
547
|
u.searchParams.append(w, k);
|
|
548
548
|
}), l && u.searchParams.append("sort_by", l), i === "desc" && u.searchParams.append("sort_desc", "1"), u.searchParams.append("size", String(a));
|
|
549
549
|
return c && n !== 1 && u.searchParams.append("offset", String(c)), u.href;
|
|
550
550
|
} catch (u) {
|
|
551
|
-
return console.error("RouteList(fetcher)", u),
|
|
551
|
+
return console.error("RouteList(fetcher)", u), m(s);
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
555
|
const j = /* @__PURE__ */ new Map();
|
|
556
|
-
function
|
|
557
|
-
const t =
|
|
556
|
+
function $e(e, s, r) {
|
|
557
|
+
const t = h(!0), o = m(e), { axiosInstance: n } = $(o.axiosRequestConfig), a = X(e, s), c = h({
|
|
558
558
|
status: x.Idle
|
|
559
559
|
}), l = async (u) => {
|
|
560
560
|
var w;
|
|
561
|
-
const k =
|
|
561
|
+
const k = m(r) || "data";
|
|
562
562
|
try {
|
|
563
563
|
c.value = t.value ? { status: x.InitialLoad } : { status: x.Loading }, t.value = !1;
|
|
564
564
|
let p = a(u);
|
|
@@ -606,9 +606,9 @@ function Le(e, s, r) {
|
|
|
606
606
|
function ee(e) {
|
|
607
607
|
if (e) {
|
|
608
608
|
let s = j.get(e);
|
|
609
|
-
return s || (s =
|
|
609
|
+
return s || (s = h(1), j.set(e, s)), s;
|
|
610
610
|
}
|
|
611
|
-
return
|
|
611
|
+
return h(1);
|
|
612
612
|
}
|
|
613
613
|
function Me() {
|
|
614
614
|
const e = (t, o = "_") => t ? t.split(o).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", s = /(?:^|[\s-:'"])\w/g;
|
|
@@ -673,7 +673,7 @@ function Be(e) {
|
|
|
673
673
|
return !(a && G(o, a, "<") || c && G(o, c, ">"));
|
|
674
674
|
}
|
|
675
675
|
function ze(e) {
|
|
676
|
-
const s =
|
|
676
|
+
const s = h(0), r = h(0), t = h(!1);
|
|
677
677
|
return se(e, (n) => {
|
|
678
678
|
n && !t.value && (s.value = n.offsetWidth, r.value = n.scrollWidth, t.value = !0);
|
|
679
679
|
}), {
|
|
@@ -686,37 +686,37 @@ function Ve() {
|
|
|
686
686
|
utf8Name: (r) => /^[\p{N}\p{L}.\-_~]*$/u.test(r) ? "" : e("validationErrors.utf8Name")
|
|
687
687
|
};
|
|
688
688
|
}
|
|
689
|
-
const
|
|
690
|
-
J(
|
|
689
|
+
const L = Symbol("schema"), Ge = (e) => {
|
|
690
|
+
J(L, e);
|
|
691
691
|
}, Se = (e) => {
|
|
692
692
|
var o, n;
|
|
693
|
-
const s = P(
|
|
694
|
-
return J(
|
|
693
|
+
const s = P(L, void 0), r = (n = (o = s == null ? void 0 : s.value) == null ? void 0 : o.fields) == null ? void 0 : n.find((a) => Object.keys(a)[0] === e), t = ne(r == null ? void 0 : r[e]);
|
|
694
|
+
return J(L, t), t;
|
|
695
695
|
};
|
|
696
696
|
function We(e) {
|
|
697
697
|
let s = "";
|
|
698
|
-
const r =
|
|
698
|
+
const r = h(!1), t = h(null), o = _(() => {
|
|
699
699
|
let a;
|
|
700
|
-
return r.value ? a = !0 : t.value ? a = t.value.hasData || e &&
|
|
700
|
+
return r.value ? a = !0 : t.value ? a = t.value.hasData || e && m(e) : a = !1, !a;
|
|
701
701
|
});
|
|
702
702
|
return {
|
|
703
703
|
tableState: t,
|
|
704
704
|
hasRecords: r,
|
|
705
705
|
hideTableToolbar: o,
|
|
706
706
|
handleStateChange: (a) => {
|
|
707
|
-
a.hasData ? r.value = !0 : a.state === "success" && !a.hasData && (!e || !s) && (r.value = !1), e && (s =
|
|
707
|
+
a.hasData ? r.value = !0 : a.state === "success" && !a.hasData && (!e || !s) && (r.value = !1), e && (s = m(e)), t.value = { ...a };
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
711
|
const at = {
|
|
712
|
-
useAxios:
|
|
712
|
+
useAxios: $,
|
|
713
713
|
useDebouncedFilter: Oe,
|
|
714
|
-
useDeleteUrlBuilder:
|
|
714
|
+
useDeleteUrlBuilder: Ke,
|
|
715
715
|
useBaseEntityDeckOptions: Pe,
|
|
716
716
|
useBaseFormDeckOptions: Re,
|
|
717
|
-
useErrors:
|
|
718
|
-
useExternalLinkCreator:
|
|
719
|
-
useFetcher:
|
|
717
|
+
useErrors: Ee,
|
|
718
|
+
useExternalLinkCreator: Le,
|
|
719
|
+
useFetcher: $e,
|
|
720
720
|
useFetcherCacheKey: ee,
|
|
721
721
|
useFetchUrlBuilder: X,
|
|
722
722
|
useHelpers: Q,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const j=require("axios"),i=require("vue"),F=require("@kong-ui-public/i18n");var w=(e=>(e[e.InitialLoad=0]="InitialLoad",e[e.Loading=1]="Loading",e[e.Idle=2]="Idle",e[e.NoResults=3]="NoResults",e[e.NoRecords=4]="NoRecords",e[e.Error=5]="Error",e))(w||{}),R=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Partial="partial",e.CloudGatewayAddon="cloud_gateway_addon",e.BackendCluster="backend_cluster",e.VirtualCluster="virtual_cluster",e.Listener="listener",e.ProducePolicy="produce_policy",e.ConsumePolicy="consume_policy",e.ClusterPolicy="cluster_policy",e.ListenerPolicy="listener_policy",e.SchemaRegistry="schema_registry",e.StaticKey="static_key",e.TlsTrustBundle="tls_trust_bundle",e.AuthServer="auth_server",e.AuthServerScopes="auth_server_scopes",e.AuthServerClaims="auth_server_claims",e.AuthServerClients="auth_server_clients",e.Other="other",e))(R||{});const ae=Object.values(R),J=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","route","upstream","target","vault","partial"];function M(e){return J.includes(e)}const se=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],ne=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var q=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(q||{}),H=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(H||{});const re=["structured","yaml","json","terraform","deck"];function oe(){return{getAxiosInstance:(e={})=>{try{const s=i.inject("get-axios-instance",void 0);return typeof s=="function"?s(e):j.create({withCredentials:!0,timeout:3e4,...e})}catch(s){return console.warn("getAxiosInstance:",s.message||s),j.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var s;return((s=e==null?void 0:e.response)==null?void 0:s.headers["x-datadog-trace-id"])||""}}}function ie(){return{debounce:(e,s)=>{let r;return(...t)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...t)},s)}}}}const O="khcp-user-table-preferences",ce={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function le(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},s=()=>{const r=e(localStorage.getItem(O));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,t)=>{try{const o=s();o.set(r,t),localStorage.setItem(O,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:(r,t)=>{const o=s();return(o==null?void 0:o.get(r))||void 0||t||ce},deleteAllTablePreferences:()=>{localStorage.removeItem(O)}}}function K(e={}){const{getAxiosInstance:s}=oe();return{axiosInstance:s(e)}}const ue={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},de={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},fe={actions:{viewConfiguration:"View configuration",hideConfiguration:"Hide configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform",deck:"decK"},errors:{edit:"The entity could not be edited at this time."}},pe={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ge={title:"Configuration",actions:{copy:"Copy JSON",deck_customize:"Customize before copying to CLI",deck_customize_cancel:"Cancel",sensitive_fields:"Show sensitive fields"},sections:{advanced:"Advanced",plugin:"Plugin specific configuration",policy:"Policy specific configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last updated",created_at_label:"Created",tags_label:"Tags",link:"Link",partial_label:"Redis configuration"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},me={learnMore:"Learn more",pricingTitle:"Pricing: "},he={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ye={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},be={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},_e={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ce={hint:{konnect:"The {token} environment variable must be added first. See {link} for details.",kongManager:"If your Admin API is secured, set up authentication following {link}."},documentation:"the documentation",steps:{step_1:"Step 1: Export token",step_2:"Step 2: Apply configuration"},customization:{title:"Customize before copying to CLI",copy_pat:"Make sure to copy your personal access token now. You won't be able to see it again.",reuse_pat:"Use an existing PAT if you've already generated one.",generate_pat:"Generate PAT",footer_reminder:"Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",secret_advise:"Command may contain sensitive values. Treat it as a secret."},copy_tooltip:"Copy"},we={body:"Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",cta:"Switch to decK format"},ke={title:"Generate a Personal Access Token",description:"Personal access tokens are used to authenticate decK commands and Konnect API requests.",fields:{name:{label:"Name",placeholder:"Enter token name"},expiresAt:{label:"Expiration date",placeholder:"Select an expiration date",n_days:"{n} days"}},actions:{cancel:"Cancel",generate:"Generate",generating:"Generating…"}},Ae={global:ue,deleteModal:de,baseForm:fe,baseTable:pe,baseConfigCard:ge,emptyState:me,filter:he,debouncedFilter:ve,errors:ye,validationErrors:be,toggleModal:_e,deckCodeBlock:Ce,deckCallout:we,generatePatModal:ke};function D(){const e=F.createI18n("en-us",Ae);return{i18n:e,i18nT:F.i18nTComponent(e)}}function Q(){const e=(n,a)=>(a==null?void 0:a[n])??void 0,s=(n,a)=>{if(n.length!==a.length)return!1;const u=new Set([...n,...a]);for(const l of u){const c=n.filter(d=>d===l).length,p=a.filter(d=>d===l).length;if(c!==p)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,a,u)=>{if(u){if(Object.keys(n).length===Object.keys(a).length)for(const l in n)if(Array.isArray(n[l])&&Array.isArray(a[l])){if(s(n[l],a[l]))continue;return!1}else{if(n[l]===a[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(a)}catch{return!1}},sortAlpha:n=>(a,u)=>{let l=a[n]===void 0||a[n]===null?"":a[n],c=u[n]===void 0||u[n]===null?"":u[n];return Array.isArray(a[n])&&(l=a[n][0]),Array.isArray(u[n])&&(c=u[n][0]),l.localeCompare(c)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function Ie(e,s,r,t={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=K(e.axiosRequestConfig),{i18n:{t:n}}=D(),{debounce:a}=ie(),u=a(async f=>{await I(f)},200),l=i.ref(!1),c=i.ref(""),p=i.ref(""),d=i.ref([]),_=i.ref([]),b=i.ref(void 0),g=i.computed(()=>{let f=`${e.apiBaseUrl}${i.unref(s)}`;return e.app==="konnect"&&(f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||"")),f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:"")}),{isValidUuid:C}=Q(),y=async()=>{try{l.value=!0;const{data:f}=await o.get(`${g.value}?size=${r}`);f!=null&&f.next||(b.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[]),_.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[],d.value=_.value}catch{d.value=[],c.value=n("debouncedFilter.errors.fetch")}finally{l.value=!1}},A=i.ref(""),I=async f=>{var P,$,U;if(A.value!==f){if(A.value=f??"",!f){d.value=_.value;return}if(b.value===void 0)try{if(l.value=!0,c.value="",p.value="",e.app==="konnect"){const v=`${g.value}/${f}`,{data:h}=await o.get(`${v}?size=${r}`);t.fetchedItemsKey in h?d.value=h[t.fetchedItemsKey]:h!=null&&h[t.exactMatchKey??"id"]?d.value=[h]:d.value=[]}else{const v=[];C(f)&&t.searchKeys.includes("id")?v.push((async()=>{const{data:m}=await o.get(`${g.value}/${f}`);return[m[t.fetchedItemsKey]??m]})()):v.push(...t.searchKeys.filter(m=>m!=="id").map(async m=>{const{data:k}=await o.get(`${g.value}?${m}=${f}`);return k[t.fetchedItemsKey]}));const h=await Promise.all(v),x=new Set;d.value=[],(P=h==null?void 0:h.forEach)==null||P.call(h,m=>{var k;(k=m==null?void 0:m.forEach)==null||k.call(m,E=>{x.has(E.id)||(x.add(E.id),d.value.push(E))})})}}catch(v){(($=v==null?void 0:v.response)==null?void 0:$.status)===404?p.value=n("debouncedFilter.errors.invalid"):(d.value=[],c.value=n("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,p.value="",d.value=(U=b.value)==null?void 0:U.filter(v=>{var x;let h=!1;for(const m of t.searchKeys){const k=typeof v[m]=="string"?(x=v[m])==null?void 0:x.toLowerCase():v[m];k!=null&&k.includes(f.toLowerCase())&&(h=!0)}return h}),(!d.value||!d.value.length)&&(p.value=n("debouncedFilter.errors.invalid")),l.value=!1}};return{loading:l,error:c,validationError:p,results:d,allRecords:b,loadItems:y,debouncedQueryChange:u}}const xe=Symbol("PLUGIN_FORM_LAYOUT_STATE"),L=Symbol("DECK_COMMAND_EDITOR"),N="[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).";function De(e,s){const r=i.inject(L,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckConfig))&&M(i.toValue(s))}),o=i.computed(()=>{const a=i.toValue(e),u=a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.customization:void 0;if(u&&!r){console.warn(N);return}return u}),n=i.computed(()=>{const a=i.toValue(e);return a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:o,deckCalloutPreferenceKey:n}}function Ee(e,s){const r=i.inject(L,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckTab))&&M(i.toValue(s))}),o=i.computed(()=>{const a=i.toValue(e),u=a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.customization:void 0;if(u&&!r){console.warn(N);return}return u}),n=i.computed(()=>{const a=i.toValue(e);return a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:o,deckCalloutPreferenceKey:n}}function Oe(e,s){const r=i.unref(s),t=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return t.value.search="",o=>`${t.value.href}/${o}`}function Te(){const{i18n:{t:e}}=D();return{getErrorFieldsFromError:t=>{var a,u,l;if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(((a=t==null?void 0:t.response)==null?void 0:a.status)===401)return{messages:[],fields:[]};let o=[e("errors.unexpected")];const n=[];if((u=t==null?void 0:t.response)!=null&&u.data){if((l=t.response.data.details)!=null&&l.length)return o=[],t.response.data.details.forEach(c=>{let p=e("errors.unexpected");c.messages&&Array.isArray(c.messages)&&c.messages.length&&(p=c.messages.join(", ")),c.field&&n.push({field:c.field,message:p}),o.push(`${c.field??""} ${p}`)}),{messages:o,fields:n};if(t.response.data.message&&Array.isArray(t.response.data.message))return o=[],t.response.data.message.forEach(c=>{if(c!=null&&c.constraints){const p=Object.values(c.constraints).join(", ");o.push(p),c.property&&n.push({field:c.property,message:p})}else c!=null&&c.property&&(c!=null&&c.message)?(n.push({field:c.property,message:c.message}),o.push(c.message)):o.push(c)}),{messages:o,fields:n};if(typeof t.response.data.message=="string"||typeof t.response.data=="string")return{messages:[t.response.data.message],fields:[]};if(typeof t.response.data=="object")return o=[],Object.keys(t.response.data).forEach(c=>{n.push({field:c,message:t.response.data[c]}),o.push(t.response.data[c])}),{messages:o,fields:n}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{var o,n,a,u;if(!t)return e("errors.unexpected");if(((o=t==null?void 0:t.response)==null?void 0:o.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((n=t==null?void 0:t.response)!=null&&n.data){if(t.response.data.detail)return t.response.data.detail;if((a=t.response.data.details)!=null&&a.length)return t.response.data.details.map(l=>{let c=e("errors.unexpected");return l.messages&&typeof l.messages=="object"&&l.messages.length&&(c=l.messages.join(", ")),l.field?`${l.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:l}=t.response.data;return Array.isArray(l)?(u=l[0])!=null&&u.constraints?Object.values(l[0].constraints)[0]:l[0]:l}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(l=>`${l} ${t.response.data[l]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Re(e){const s=window.location.origin,r=s.endsWith("/")?s:`${s}/`;try{const t=e.join("/"),o=`${r}${t}`,n=e.some(u=>u.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!n&&new URL(o))return`${r}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function Z(e,s){const r=i.computed(()=>{const o=i.toValue(e);return o.app==="konnect"||!!o.isExactMatch}),t=i.computed(()=>{const o=i.toValue(s);return o.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o)});return o=>{const{page:n,pageSize:a,offset:u,sortColumnKey:l,sortColumnOrder:c,query:p}=o;try{let d=new URL(t.value.href);if(r.value&&p){const _=new URLSearchParams(t.value.search);d.search="",d=i.toValue(e).isExactMatch?new URL(`${d.href}/${p}`):new URL(`${d.href}?filter[name][contains]=${p}`),_.forEach((b,g)=>d.searchParams.append(g,b))}else r.value||new URLSearchParams(p).forEach((_,b)=>{d.searchParams.append(b,_)}),l&&d.searchParams.append("sort_by",l),c==="desc"&&d.searchParams.append("sort_desc","1"),d.searchParams.append("size",String(a));return u&&n!==1&&d.searchParams.append("offset",String(u)),d.href}catch(d){return console.error("RouteList(fetcher)",d),i.toValue(s)}}}const V=new Map;function Me(e,s,r){const t=i.ref(!0),o=i.toValue(e),{axiosInstance:n}=K(o.axiosRequestConfig),a=Z(e,s),u=i.ref({status:w.Idle}),l=async d=>{var b;const _=i.toValue(r)||"data";try{u.value=t.value?{status:w.InitialLoad}:{status:w.Loading},t.value=!1;let g=a(d);g.includes("filter[name]")&&(g=`${g}&page[size]=${d.pageSize}&page[number]=${d.page}`);const C=await n.get(g);if(C.status>=400)throw C;const y=C.data,A=_&&_.replace(/[^\w-_]/gi,"");let I;y[A]?I=Array.isArray(y[A])?y[A]:[y[A]]:Array.isArray(y)?I=y:I=Object.keys(y).length?[y]:[];const f={data:I,total:I.length,...y.offset?{pagination:{offset:y.offset}}:null};return f.data.length===0&&!d.query?u.value={status:w.NoRecords,response:f}:u.value={status:w.Idle,response:f},f}catch(g){const C={data:[],total:0};return d.query&&(((b=g.response)==null?void 0:b.status)===404||g.status===404)?(u.value={status:w.NoResults,response:C,error:g.response?g:{response:g}},C):(u.value={status:w.Error,response:C,error:g.response?g:{response:g}},C)}},c=o.cacheIdentifier,p=X(c);return{fetcher:l,fetcherState:u,fetcherCacheKey:p}}function X(e){if(e){let s=V.get(e);return s||(s=i.ref(1),V.set(e,s)),s}return i.ref(1)}function Ke(){const e=(t,o="_")=>t?t.split(o).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",s=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(s,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const ee=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,S=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const s=e.match(ee);if(!s)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return s.shift(),s},B=e=>e==="*"||e==="x"||e==="X",z=e=>{const s=parseInt(e,10);return isNaN(s)?e:s},Le=(e,s)=>typeof e!=typeof s?[String(e),String(s)]:[e,s],Ne=(e,s)=>{if(B(e)||B(s))return 0;const[r,t]=Le(z(e),z(s));return r>t?1:r<t?-1:0},G=(e,s)=>{for(let r=0;r<Math.max(e.length,s.length);r++){const t=Ne(e[r]||"0",s[r]||"0");if(t!==0)return t}return 0},Pe=(e,s)=>{const r=S(e),t=S(s),o=r.pop(),n=t.pop(),a=G(r,t);return a!==0?a:o&&n?G(o.split("."),n.split(".")):o||n?o?-1:1:0},W=(e,s,r)=>{$e(r);const t=Pe(e,s);return te[r].includes(t)},te={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Y=Object.keys(te),$e=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Y.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Y.join("|")}`)},Ue=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ee.test(e);function je(e){const{gatewayInfo:s,supportedRange:r}=e;if(!s)return!0;const{edition:t,version:o}=s;if(!Ue(o))return console.error("Invalid version"),!1;const n=r[t];if(!n)return!1;const[a,u]=n;return!(a&&W(o,a,"<")||u&&W(o,u,">"))}function Fe(e){const s=i.ref(0),r=i.ref(0),t=i.ref(!1);return i.watch(e,n=>{n&&!t.value&&(s.value=n.offsetWidth,r.value=n.scrollWidth,t.value=!0)}),{isTruncated:i.computed(()=>s.value<r.value)}}function Ve(){const{i18n:{t:e}}=D();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const T=Symbol("schema"),Se=e=>{i.provide(T,e)},Be=e=>{var o,n;const s=i.inject(T,void 0),r=(n=(o=s==null?void 0:s.value)==null?void 0:o.fields)==null?void 0:n.find(a=>Object.keys(a)[0]===e),t=i.toRef(r==null?void 0:r[e]);return i.provide(T,t),t};function ze(e){let s="";const r=i.ref(!1),t=i.ref(null),o=i.computed(()=>{let a;return r.value?a=!0:t.value?a=t.value.hasData||e&&i.toValue(e):a=!1,!a});return{tableState:t,hasRecords:r,hideTableToolbar:o,handleStateChange:a=>{a.hasData?r.value=!0:a.state==="success"&&!a.hasData&&(!e||!s)&&(r.value=!1),e&&(s=i.toValue(e)),t.value={...a}}}}const Ge={useAxios:K,useDebouncedFilter:Ie,useDeleteUrlBuilder:Oe,useBaseEntityDeckOptions:De,useBaseFormDeckOptions:Ee,useErrors:Te,useExternalLinkCreator:Re,useFetcher:Me,useFetcherCacheKey:X,useFetchUrlBuilder:Z,useHelpers:Q,useStringHelpers:Ke,useI18n:D,useGatewayFeatureSupported:je,useTruncationDetector:Fe,useValidators:Ve,useSchemaProvider:Se,useSubSchema:Be,useTableState:ze},We=(e,s)=>{const r=e.__vccOpts||e;for(const[t,o]of s)r[t]=o;return r};exports.CONFIG_CARD_FORMATS=re;exports.ConfigurationSchemaSection=H;exports.ConfigurationSchemaType=q;exports.DECK_COMMAND_EDITOR_KEY=L;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=N;exports.EventGatewayTypesArray=se;exports.FetcherStatus=w;exports.IdentityTypesArray=ne;exports.PLUGIN_FORM_LAYOUT_STATE=xe;exports.SupportedEntityDeckArray=J;exports.SupportedEntityType=R;exports.SupportedEntityTypesArray=ae;exports._export_sfc=We;exports.composables=Ge;exports.ft=le;exports.isSupportedDeckEntityType=M;
|
package/dist/deck-editor.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-CwM56vX0.cjs"),k=require("@kong-ui-public/monaco-editor"),y=require("@kong/icons"),_=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const f={class:"deck-command-editor-wrapper"},C={class:"deck-command-copy-button"},g=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),d={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function m(){await p(n.value)}async function p(l){var i,s;if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document==null?void 0:document.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,(i=document==null?void 0:document.body)==null||i.appendChild(o),o.focus(),o.select());let t;try{t=document==null?void 0:document.execCommand("copy")}catch{t=!1}finally{(s=document==null?void 0:document.body)==null||s.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createVNode(e.unref(k.MonacoEditor),{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:d,theme:"light"},null,8,["modelValue","language"]),e.createElementVNode("div",C,[e.createVNode(e.unref(_.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>m())},{default:e.withCtx(()=>[e.createVNode(e.unref(y.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),u=a._export_sfc(g,[["__scopeId","data-v-93e2d4e7"]]),v={},b={class:"editor-skeleton"};function E(r,n){const c=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",b,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,d=>e.createVNode(c,{key:d})),64))])}const h=a._export_sfc(v,[["render",E],["__scopeId","data-v-ec59bbd1"]]);function x(){e.provide(a.DECK_COMMAND_EDITOR_KEY,u)}exports.DeckCommandEditor=u;exports.DeckCommandEditorLoading=h;exports.provideDeckCommandEditor=x;
|
package/dist/deck-editor.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, useModel as k, openBlock as s, createElementBlock as i, createVNode as c, unref as t, createElementVNode as C, withCtx as g, mergeModels as v, resolveComponent as b, Fragment as h, renderList as x, provide as E } from "vue";
|
|
2
|
-
import { c as D, _ as u, D as w } from "./_plugin-vue_export-helper-
|
|
2
|
+
import { c as D, _ as u, D as w } from "./_plugin-vue_export-helper-BpeW-zKx.js";
|
|
3
3
|
import { MonacoEditor as V } from "@kong-ui-public/monaco-editor";
|
|
4
4
|
import { CopyIcon as I } from "@kong/icons";
|
|
5
5
|
import { KCodeBlockIconButton as M } from "@kong/kongponents";
|