@kong-ui-public/entities-shared 3.57.9 → 3.57.10
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-DXzCT2F2.cjs +1 -0
- package/dist/{_plugin-vue_export-helper-DifnnlJk.js → _plugin-vue_export-helper-DmBKRdlq.js} +71 -69
- package/dist/deck-editor.cjs.js +1 -1
- package/dist/deck-editor.es.js +1 -1
- package/dist/entities-shared.cjs.js +43 -43
- package/dist/entities-shared.es.js +929 -922
- package/dist/style.css +1 -1
- package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts.map +1 -1
- package/dist/types/components/common/JsonCodeBlock.vue.d.ts.map +1 -1
- package/dist/types/components/common/TerraformCodeBlock.vue.d.ts.map +1 -1
- package/dist/types/components/common/YamlCodeBlock.vue.d.ts.map +1 -1
- package/dist/types/constants.d.ts +11 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/utils/code-block.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/_plugin-vue_export-helper-BqAuE0lQ.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const M=require("axios"),i=require("vue"),N=require("@kong-ui-public/i18n"),Q=Symbol("PLUGIN_FORM_LAYOUT_STATE"),T=Symbol("DECK_COMMAND_EDITOR"),K="[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).",Z="50vh",ee=2e5;function te(){return{getAxiosInstance:(e={})=>{try{const n=i.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):M.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),M.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>e?.response?.headers["x-datadog-trace-id"]||""}}function ae(){return{debounce:(e,n)=>{let o;return(...t)=>{clearTimeout(o),o=window?.setTimeout(()=>{e(...t)},n)}}}}const O="khcp-user-table-preferences",se={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function ne(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},n=()=>{const o=e(localStorage.getItem(O));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,t)=>{try{const s=n();s.set(o,t),localStorage.setItem(O,JSON.stringify(Object.fromEntries(s.entries())))}catch(s){console.error("useTablePreferences(setTablePreferences)",s)}},getTablePreferences:(o,t)=>n()?.get(o)||void 0||t||se,deleteAllTablePreferences:()=>{localStorage.removeItem(O)}}}function R(e={}){const{getAxiosInstance:n}=te();return{axiosInstance:n(e)}}const re={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},oe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ie={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."}},ce={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},le={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"}},ue={learnMore:"Learn more",pricingTitle:"Pricing: "},de={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},fe={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},pe={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ge={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},me={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"}},he={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"},ve={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"},ye={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…"}},be={rotateKey:"Rotate key",generateKey:"Generate key",placeholder:"Enter or generate a key",oneTimeHint:"The key is shown only once. Copy it now and store it securely.",copy:"Copy",showKey:"Show key",hideKey:"Hide key"},_e={global:re,deleteModal:oe,baseForm:ie,baseTable:ce,baseConfigCard:le,emptyState:ue,filter:de,debouncedFilter:fe,errors:pe,validationErrors:ge,toggleModal:me,deckCodeBlock:he,deckCallout:ve,generatePatModal:ye,sensitiveInput:be};function D(){const e=N.createI18n("en-us",_e);return{i18n:e,i18nT:N.i18nTComponent(e)}}function S(){const e=(r,a)=>a?.[r]??void 0,n=(r,a)=>{if(r.length!==a.length)return!1;const c=new Set([...r,...a]);for(const u of c){const m=r.filter(l=>l===u).length,g=a.filter(l=>l===u).length;if(m!==g)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,a,c)=>{if(c){if(Object.keys(r).length===Object.keys(a).length)for(const u in r)if(Array.isArray(r[u])&&Array.isArray(a[u])){if(n(r[u],a[u]))continue;return!1}else{if(r[u]===a[u])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(a)}catch{return!1}},sortAlpha:r=>(a,c)=>{let u=a[r]===void 0||a[r]===null?"":a[r],m=c[r]===void 0||c[r]===null?"":c[r];return Array.isArray(a[r])&&(u=a[r][0]),Array.isArray(c[r])&&(m=c[r][0]),u.localeCompare(m)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Ce(e,n,o,t={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="1000");const{axiosInstance:s}=R(e.axiosRequestConfig),{i18n:{t:r}}=D(),{debounce:a}=ae(),c=a(async f=>{await w(f)},200),u=i.ref(!1),m=i.ref(""),g=i.ref(""),l=i.ref([]),y=i.ref([]),d=i.ref(void 0),p=i.computed(()=>{let f=`${e.apiBaseUrl}${i.unref(n)}`;return e.app==="konnect"&&(f=f.replace(/{controlPlaneId}/gi,e?.controlPlaneId||"")),f.replace(/\/{workspace}/gi,e?.workspace?`/${e.workspace}`:"")}),{isValidUuid:h}=S(),k=async()=>{try{u.value=!0;const{data:f}=await s.get(`${p.value}?size=${o}`);f?.next||(d.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[]),y.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[],l.value=y.value}catch{l.value=[],m.value=r("debouncedFilter.errors.fetch")}finally{u.value=!1}},A=i.ref(""),w=async f=>{if(A.value!==f){if(A.value=f??"",!f){l.value=y.value;return}if(d.value===void 0)try{if(u.value=!0,m.value="",g.value="",e.app==="konnect"){const v=`${p.value}/${f}`,{data:b}=await s.get(`${v}?size=${o}`);t.fetchedItemsKey in b?l.value=b[t.fetchedItemsKey]:b?.[t.exactMatchKey??"id"]?l.value=[b]:l.value=[]}else{const v=[];h(f)&&t.searchKeys.includes("id")?v.push((async()=>{const{data:_}=await s.get(`${p.value}/${f}`);return[_[t.fetchedItemsKey]??_]})()):v.push(...t.searchKeys.filter(_=>_!=="id").map(async _=>{const{data:x}=await s.get(`${p.value}?${_}=${f}`);return x[t.fetchedItemsKey]}));const b=await Promise.all(v),I=new Set;l.value=[],b?.forEach?.(_=>{_?.forEach?.(x=>{I.has(x.id)||(I.add(x.id),l.value.push(x))})})}}catch(v){v?.response?.status===404?g.value=r("debouncedFilter.errors.invalid"):(l.value=[],m.value=r("debouncedFilter.errors.fetch"))}finally{u.value=!1}else u.value=!0,g.value="",l.value=d.value?.filter(v=>{let b=!1;for(const I of t.searchKeys)(typeof v[I]=="string"?v[I]?.toLowerCase():v[I])?.includes(f.toLowerCase())&&(b=!0);return b}),(!l.value||!l.value.length)&&(g.value=r("debouncedFilter.errors.invalid")),u.value=!1}};return{loading:u,error:m,validationError:g,results:l,allRecords:d,loadItems:k,debouncedQueryChange:c}}var C=(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))(C||{}),L=(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.PluginSchema="plugin_schema",e.CustomPlugin="custom_plugin",e.ClonedPlugin="cloned_plugin",e))(L||{});const Ae=Object.values(L),z=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","plugin_schema","custom_plugin","cloned_plugin","route","upstream","target","vault","partial"];function P(e){return z.includes(e)}const ke=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],we=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var H=(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))(H||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(W||{});const Ie=["structured","yaml","json","terraform","deck"];function xe(e,n){const o=i.inject(T,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckConfig))&&P(i.toValue(n))}),s=i.computed(()=>{const a=i.toValue(e),c=a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.customization:void 0;if(c&&!o){console.warn(K);return}return c}),r=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:s,deckCalloutPreferenceKey:r}}function De(e,n){const o=i.inject(T,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckTab))&&P(i.toValue(n))}),s=i.computed(()=>{const a=i.toValue(e),c=a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.customization:void 0;if(c&&!o){console.warn(K);return}return c}),r=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:s,deckCalloutPreferenceKey:r}}function Oe(e,n){const o=i.unref(n),t=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return t.value.search="",s=>`${t.value.href}/${s}`}function Ee(){const{i18n:{t:e}}=D();return{getErrorFieldsFromError:t=>{if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(t?.response?.status===401)return{messages:[],fields:[]};let s=[e("errors.unexpected")];const r=[];if(t?.response?.data){if(t.response.data.details?.length)return s=[],t.response.data.details.forEach(a=>{let c=e("errors.unexpected");a.messages&&Array.isArray(a.messages)&&a.messages.length&&(c=a.messages.join(", ")),a.field&&r.push({field:a.field,message:c}),s.push(`${a.field??""} ${c}`)}),{messages:s,fields:r};if(t.response.data.message&&Array.isArray(t.response.data.message))return s=[],t.response.data.message.forEach(a=>{if(a?.constraints){const c=Object.values(a.constraints).join(", ");s.push(c),a.property&&r.push({field:a.property,message:c})}else a?.property&&a?.message?(r.push({field:a.property,message:a.message}),s.push(a.message)):s.push(a)}),{messages:s,fields:r};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 s=[],Object.keys(t.response.data).forEach(a=>{r.push({field:a,message:t.response.data[a]}),s.push(t.response.data[a])}),{messages:s,fields:r}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{if(!t)return e("errors.unexpected");if(t?.response?.status===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if(t?.response?.data){if(t.response.data.detail)return t.response.data.detail;if(t.response.data.details?.length)return t.response.data.details.map(s=>{let r=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(r=s.messages.join(", ")),s.field?`${s.field} - ${r}`:r}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?s[0]?.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Te(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const t=e.join("/"),s=`${o}${t}`,r=e.some(c=>c.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(s)&&!r&&new URL(s))return`${o}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function Y(e,n){const o=i.computed(()=>{const s=i.toValue(e);return typeof s.isExactMatch=="boolean"?s.isExactMatch:s.app==="konnect"}),t=i.computed(()=>{const s=i.toValue(n);return s.startsWith("/")?new URL(`${window.location.origin}${s}`):new URL(s)});return s=>{const{page:r,pageSize:a,offset:c,sortColumnKey:u,sortColumnOrder:m,query:g}=s;try{let l=new URL(t.value.href);if(o.value&&g){const y=new URLSearchParams(t.value.search);l.search="",l=i.toValue(e).isExactMatch?new URL(`${l.href}/${g}`):new URL(`${l.href}?filter[name][contains]=${g}`),y.forEach((d,p)=>l.searchParams.append(p,d))}else o.value||new URLSearchParams(g).forEach((y,d)=>{l.searchParams.append(d,y)}),u&&l.searchParams.append("sort_by",u),m==="desc"&&l.searchParams.append("sort_desc","1"),l.searchParams.append("size",String(a));return c&&r!==1&&l.searchParams.append("offset",String(c)),l.href}catch(l){return console.error("RouteList(fetcher)",l),i.toValue(n)}}}const $=new Map;function Ke(e,n,o){const t=i.ref(!0),s=i.toValue(e),{axiosInstance:r}=R(s.axiosRequestConfig),a=Y(e,n),c=i.ref({status:C.Idle}),u=async l=>{const y=i.toValue(o)||"data";try{c.value=t.value?{status:C.InitialLoad}:{status:C.Loading},t.value=!1;let d=a(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const p=await r.get(d);if(p.status>=400)throw p;const h=p.data,k=y&&y.replace(/[^\w-_]/gi,"");let A;h[k]?A=Array.isArray(h[k])?h[k]:[h[k]]:Array.isArray(h)?A=h:A=Object.keys(h).length?[h]:[];const w={data:A,total:A.length,...h.offset?{pagination:{offset:h.offset}}:null};return w.data.length===0&&!l.query?c.value={status:C.NoRecords,response:w}:c.value={status:C.Idle,response:w},w}catch(d){const p={data:[],total:0};return l.query&&(d.response?.status===404||d.status===404)?(c.value={status:C.NoResults,response:p,error:d.response?d:{response:d}},p):(c.value={status:C.Error,response:p,error:d.response?d:{response:d}},p)}},m=s.cacheIdentifier,g=J(m);return{fetcher:u,fetcherState:c,fetcherCacheKey:g}}function J(e){if(e){let n=$.get(e);return n||(n=i.ref(1),$.set(e,n)),n}return i.ref(1)}function Re(){const e=(t,s="_")=>t?t.split(s).map(r=>r.toLowerCase()==="id"?r.toUpperCase():r.charAt(0).toUpperCase()+r.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(n,s=>s.toUpperCase()):"",convertKeyToTitle:e}}const q=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,U=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(q);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},j=e=>e==="*"||e==="x"||e==="X",F=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},Le=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Pe=(e,n)=>{if(j(e)||j(n))return 0;const[o,t]=Le(F(e),F(n));return o>t?1:o<t?-1:0},G=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const t=Pe(e[o]||"0",n[o]||"0");if(t!==0)return t}return 0},Me=(e,n)=>{const o=U(e),t=U(n),s=o.pop(),r=t.pop(),a=G(o,t);return a!==0?a:s&&r?G(s.split("."),r.split(".")):s||r?s?-1:1:0},V=(e,n,o)=>{Ne(o);const t=Me(e,n);return X[o].includes(t)},X={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},B=Object.keys(X),Ne=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(B.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${B.join("|")}`)},$e=e=>typeof e=="string"&&/^[v\d]/.test(e)&&q.test(e);function Ue(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:t,version:s}=n;if(!$e(s))return console.error("Invalid version"),!1;const r=o[t];if(!r)return!1;const[a,c]=r;return!(a&&V(s,a,"<")||c&&V(s,c,">"))}function je(e){const n=i.ref(0),o=i.ref(0),t=i.ref(!1);return i.watch(e,r=>{r&&!t.value&&(n.value=r.offsetWidth,o.value=r.scrollWidth,t.value=!0)}),{isTruncated:i.computed(()=>n.value<o.value)}}function Fe(){const{i18n:{t:e}}=D();return{utf8Name:o=>/^[\p{N}\p{L}.\-_~]*$/u.test(o)?"":e("validationErrors.utf8Name")}}const E=Symbol("schema"),Ge=e=>{i.provide(E,e)},Ve=e=>{const o=i.inject(E,void 0)?.value?.fields?.find(s=>Object.keys(s)[0]===e),t=i.toRef(o?.[e]);return i.provide(E,t),t};function Be(e){let n="";const o=i.ref(!1),t=i.ref(null),s=i.computed(()=>{let a;return o.value?a=!0:t.value?a=t.value.hasData||e&&i.toValue(e):a=!1,!a});return{tableState:t,hasRecords:o,hideTableToolbar:s,handleStateChange:a=>{a.hasData?o.value=!0:a.state==="success"&&!a.hasData&&(!e||!n)&&(o.value=!1),e&&(n=i.toValue(e)),t.value={...a}}}}const Se={useAxios:R,useDebouncedFilter:Ce,useDeleteUrlBuilder:Oe,useBaseEntityDeckOptions:xe,useBaseFormDeckOptions:De,useErrors:Ee,useExternalLinkCreator:Te,useFetcher:Ke,useFetcherCacheKey:J,useFetchUrlBuilder:Y,useHelpers:S,useStringHelpers:Re,useI18n:D,useGatewayFeatureSupported:Ue,useTruncationDetector:je,useValidators:Fe,useSchemaProvider:Ge,useSubSchema:Ve,useTableState:Be},ze=(e,n)=>{const o=e.__vccOpts||e;for(const[t,s]of n)o[t]=s;return o};exports.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT=Z;exports.CONFIG_CARD_FORMATS=Ie;exports.ConfigurationSchemaSection=W;exports.ConfigurationSchemaType=H;exports.DECK_COMMAND_EDITOR_KEY=T;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=K;exports.EventGatewayTypesArray=ke;exports.FetcherStatus=C;exports.IdentityTypesArray=we;exports.PLUGIN_FORM_LAYOUT_STATE=Q;exports.SHIKI_MAX_HIGHLIGHT_LENGTH=ee;exports.SupportedEntityDeckArray=z;exports.SupportedEntityType=L;exports.SupportedEntityTypesArray=Ae;exports._export_sfc=ze;exports.composables=Se;exports.de=ne;exports.isSupportedDeckEntityType=P;
|
package/dist/{_plugin-vue_export-helper-DifnnlJk.js → _plugin-vue_export-helper-DmBKRdlq.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { inject as D, ref as f, computed as y, unref as z, toValue as p, watch as
|
|
1
|
+
import $ from "axios";
|
|
2
|
+
import { inject as D, ref as f, computed as y, unref as z, toValue as p, watch as Z, toRef as ee, provide as G } from "vue";
|
|
3
3
|
import { createI18n as te, i18nTComponent as se } from "@kong-ui-public/i18n";
|
|
4
|
-
const
|
|
4
|
+
const We = /* @__PURE__ */ Symbol("PLUGIN_FORM_LAYOUT_STATE"), V = /* @__PURE__ */ Symbol("DECK_COMMAND_EDITOR"), H = "[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).", Je = "50vh", Ye = 2e5;
|
|
5
5
|
function ae() {
|
|
6
6
|
return {
|
|
7
7
|
getAxiosInstance: (e = {}) => {
|
|
8
8
|
try {
|
|
9
9
|
const n = D("get-axios-instance", void 0);
|
|
10
|
-
return typeof n == "function" ? n(e) :
|
|
10
|
+
return typeof n == "function" ? n(e) : $.create({
|
|
11
11
|
withCredentials: !0,
|
|
12
12
|
timeout: 3e4,
|
|
13
13
|
...e
|
|
14
14
|
});
|
|
15
15
|
} catch (n) {
|
|
16
|
-
return console.warn("getAxiosInstance:", n.message || n),
|
|
16
|
+
return console.warn("getAxiosInstance:", n.message || n), $.create({
|
|
17
17
|
withCredentials: !0,
|
|
18
18
|
timeout: 3e4,
|
|
19
19
|
...e
|
|
@@ -35,13 +35,13 @@ function ne() {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const R = "khcp-user-table-preferences", re = {
|
|
39
39
|
pageSize: 30,
|
|
40
40
|
sortColumnKey: void 0,
|
|
41
41
|
sortColumnOrder: void 0,
|
|
42
42
|
columnVisibility: {}
|
|
43
43
|
};
|
|
44
|
-
function
|
|
44
|
+
function Qe() {
|
|
45
45
|
const e = (o) => {
|
|
46
46
|
if (typeof o == "string")
|
|
47
47
|
try {
|
|
@@ -51,25 +51,25 @@ function Ye() {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
}, n = () => {
|
|
54
|
-
const o = e(localStorage.getItem(
|
|
54
|
+
const o = e(localStorage.getItem(R));
|
|
55
55
|
return !o || !Object.keys(o).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(o));
|
|
56
56
|
};
|
|
57
57
|
return {
|
|
58
58
|
setTablePreferences: (o, t) => {
|
|
59
59
|
try {
|
|
60
60
|
const a = n();
|
|
61
|
-
a.set(o, t), localStorage.setItem(
|
|
61
|
+
a.set(o, t), localStorage.setItem(R, JSON.stringify(Object.fromEntries(a.entries())));
|
|
62
62
|
} catch (a) {
|
|
63
63
|
console.error("useTablePreferences(setTablePreferences)", a);
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
getTablePreferences: (o, t) => n()?.get(o) || void 0 || t || re,
|
|
67
67
|
deleteAllTablePreferences: () => {
|
|
68
|
-
localStorage.removeItem(
|
|
68
|
+
localStorage.removeItem(R);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function E(e = {}) {
|
|
73
73
|
const { getAxiosInstance: n } = ae();
|
|
74
74
|
return {
|
|
75
75
|
axiosInstance: n(e)
|
|
@@ -92,7 +92,7 @@ const oe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clip
|
|
|
92
92
|
generatePatModal: be,
|
|
93
93
|
sensitiveInput: _e
|
|
94
94
|
};
|
|
95
|
-
function
|
|
95
|
+
function O() {
|
|
96
96
|
const e = te("en-us", we);
|
|
97
97
|
return {
|
|
98
98
|
i18n: e,
|
|
@@ -147,7 +147,7 @@ function ke(e, n, o, t = {
|
|
|
147
147
|
searchKeys: ["id"]
|
|
148
148
|
}) {
|
|
149
149
|
o || (o = "1000");
|
|
150
|
-
const { axiosInstance: a } =
|
|
150
|
+
const { axiosInstance: a } = E(e.axiosRequestConfig), { i18n: { t: r } } = O(), { debounce: s } = ne(), i = s(async (d) => {
|
|
151
151
|
await x(d);
|
|
152
152
|
}, 200), l = f(!1), m = f(""), h = f(""), c = f([]), _ = f([]), u = f(void 0), g = y(() => {
|
|
153
153
|
let d = `${e.apiBaseUrl}${z(n)}`;
|
|
@@ -215,8 +215,8 @@ function ke(e, n, o, t = {
|
|
|
215
215
|
debouncedQueryChange: i
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
var A = /* @__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))(A || {}),
|
|
219
|
-
const
|
|
218
|
+
var A = /* @__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))(A || {}), W = /* @__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.PluginSchema = "plugin_schema", e.CustomPlugin = "custom_plugin", e.ClonedPlugin = "cloned_plugin", e))(W || {});
|
|
219
|
+
const Xe = Object.values(W), Ce = [
|
|
220
220
|
"ca_certificate",
|
|
221
221
|
"certificate",
|
|
222
222
|
"consumer",
|
|
@@ -235,20 +235,20 @@ const He = Object.values(J), Ce = [
|
|
|
235
235
|
"partial"
|
|
236
236
|
/* Partial */
|
|
237
237
|
];
|
|
238
|
-
function
|
|
238
|
+
function J(e) {
|
|
239
239
|
return Ce.includes(e);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const qe = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key", "tls_trust_bundle"], Ze = ["auth_server", "auth_server_scopes", "auth_server_claims", "auth_server_clients"];
|
|
242
242
|
var Ae = /* @__PURE__ */ ((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))(Ae || {}), Ie = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(Ie || {});
|
|
243
|
-
const
|
|
243
|
+
const et = ["structured", "yaml", "json", "terraform", "deck"];
|
|
244
244
|
function xe(e, n) {
|
|
245
245
|
const o = D(V, null), t = y(() => {
|
|
246
246
|
const s = p(e);
|
|
247
|
-
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckConfig)) &&
|
|
247
|
+
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckConfig)) && J(p(n));
|
|
248
248
|
}), a = y(() => {
|
|
249
249
|
const s = p(e), i = s.app === "konnect" && s.enableDeckConfig && typeof s.enableDeckConfig != "boolean" ? s.enableDeckConfig.customization : void 0;
|
|
250
250
|
if (i && !o) {
|
|
251
|
-
console.warn(
|
|
251
|
+
console.warn(H);
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
return i;
|
|
@@ -265,11 +265,11 @@ function xe(e, n) {
|
|
|
265
265
|
function Pe(e, n) {
|
|
266
266
|
const o = D(V, null), t = y(() => {
|
|
267
267
|
const s = p(e);
|
|
268
|
-
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckTab)) &&
|
|
268
|
+
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckTab)) && J(p(n));
|
|
269
269
|
}), a = y(() => {
|
|
270
270
|
const s = p(e), i = s.app === "konnect" && s.enableDeckTab && typeof s.enableDeckTab != "boolean" ? s.enableDeckTab.customization : void 0;
|
|
271
271
|
if (i && !o) {
|
|
272
|
-
console.warn(
|
|
272
|
+
console.warn(H);
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
return i;
|
|
@@ -290,7 +290,7 @@ function Ke(e, n) {
|
|
|
290
290
|
return t.value.search = "", (a) => `${t.value.href}/${a}`;
|
|
291
291
|
}
|
|
292
292
|
function De() {
|
|
293
|
-
const { i18n: { t: e } } =
|
|
293
|
+
const { i18n: { t: e } } = O();
|
|
294
294
|
return {
|
|
295
295
|
getErrorFieldsFromError: (t) => {
|
|
296
296
|
if (!t)
|
|
@@ -359,7 +359,7 @@ function De() {
|
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Oe(e) {
|
|
363
363
|
const n = window.location.origin, o = n.endsWith("/") ? n : `${n}/`;
|
|
364
364
|
try {
|
|
365
365
|
const t = e.join("/"), a = `${o}${t}`, r = e.some((i) => i.trim() === "");
|
|
@@ -370,7 +370,7 @@ function Re(e) {
|
|
|
370
370
|
return console.warn("Failed to build valid URL:", t), "";
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Y(e, n) {
|
|
374
374
|
const o = y(() => {
|
|
375
375
|
const a = p(e);
|
|
376
376
|
return typeof a.isExactMatch == "boolean" ? a.isExactMatch : a.app === "konnect";
|
|
@@ -395,9 +395,9 @@ function H(e, n) {
|
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
-
const
|
|
399
|
-
function
|
|
400
|
-
const t = f(!0), a = p(e), { axiosInstance: r } =
|
|
398
|
+
const T = /* @__PURE__ */ new Map();
|
|
399
|
+
function Re(e, n, o) {
|
|
400
|
+
const t = f(!0), a = p(e), { axiosInstance: r } = E(a.axiosRequestConfig), s = Y(e, n), i = f({
|
|
401
401
|
status: A.Idle
|
|
402
402
|
}), l = async (c) => {
|
|
403
403
|
const _ = p(o) || "data";
|
|
@@ -447,8 +447,8 @@ function Oe(e, n, o) {
|
|
|
447
447
|
}
|
|
448
448
|
function Q(e) {
|
|
449
449
|
if (e) {
|
|
450
|
-
let n =
|
|
451
|
-
return n || (n = f(1),
|
|
450
|
+
let n = T.get(e);
|
|
451
|
+
return n || (n = f(1), T.set(e, n)), n;
|
|
452
452
|
}
|
|
453
453
|
return f(1);
|
|
454
454
|
}
|
|
@@ -459,54 +459,54 @@ function Le() {
|
|
|
459
459
|
convertKeyToTitle: e
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const X = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, M = (e) => {
|
|
463
463
|
if (typeof e != "string")
|
|
464
464
|
throw new TypeError("Invalid argument expected string");
|
|
465
|
-
const n = e.match(
|
|
465
|
+
const n = e.match(X);
|
|
466
466
|
if (!n)
|
|
467
467
|
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
468
468
|
return n.shift(), n;
|
|
469
|
-
},
|
|
469
|
+
}, N = (e) => e === "*" || e === "x" || e === "X", U = (e) => {
|
|
470
470
|
const n = parseInt(e, 10);
|
|
471
471
|
return isNaN(n) ? e : n;
|
|
472
|
-
},
|
|
473
|
-
if (
|
|
472
|
+
}, Ee = (e, n) => typeof e != typeof n ? [String(e), String(n)] : [e, n], $e = (e, n) => {
|
|
473
|
+
if (N(e) || N(n))
|
|
474
474
|
return 0;
|
|
475
|
-
const [o, t] =
|
|
475
|
+
const [o, t] = Ee(U(e), U(n));
|
|
476
476
|
return o > t ? 1 : o < t ? -1 : 0;
|
|
477
477
|
}, j = (e, n) => {
|
|
478
478
|
for (let o = 0; o < Math.max(e.length, n.length); o++) {
|
|
479
|
-
const t =
|
|
479
|
+
const t = $e(e[o] || "0", n[o] || "0");
|
|
480
480
|
if (t !== 0)
|
|
481
481
|
return t;
|
|
482
482
|
}
|
|
483
483
|
return 0;
|
|
484
|
-
},
|
|
485
|
-
const o =
|
|
484
|
+
}, Te = (e, n) => {
|
|
485
|
+
const o = M(e), t = M(n), a = o.pop(), r = t.pop(), s = j(o, t);
|
|
486
486
|
return s !== 0 ? s : a && r ? j(a.split("."), r.split(".")) : a || r ? a ? -1 : 1 : 0;
|
|
487
487
|
}, F = (e, n, o) => {
|
|
488
|
-
|
|
489
|
-
const t =
|
|
490
|
-
return
|
|
491
|
-
},
|
|
488
|
+
Me(o);
|
|
489
|
+
const t = Te(e, n);
|
|
490
|
+
return q[o].includes(t);
|
|
491
|
+
}, q = {
|
|
492
492
|
">": [1],
|
|
493
493
|
">=": [0, 1],
|
|
494
494
|
"=": [0],
|
|
495
495
|
"<=": [-1, 0],
|
|
496
496
|
"<": [-1],
|
|
497
497
|
"!=": [-1, 1]
|
|
498
|
-
}, B = Object.keys(
|
|
498
|
+
}, B = Object.keys(q), Me = (e) => {
|
|
499
499
|
if (typeof e != "string")
|
|
500
500
|
throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
|
|
501
501
|
if (B.indexOf(e) === -1)
|
|
502
502
|
throw new Error(`Invalid operator, expected one of ${B.join("|")}`);
|
|
503
|
-
},
|
|
504
|
-
function
|
|
503
|
+
}, Ne = (e) => typeof e == "string" && /^[v\d]/.test(e) && X.test(e);
|
|
504
|
+
function Ue(e) {
|
|
505
505
|
const { gatewayInfo: n, supportedRange: o } = e;
|
|
506
506
|
if (!n)
|
|
507
507
|
return !0;
|
|
508
508
|
const { edition: t, version: a } = n;
|
|
509
|
-
if (!
|
|
509
|
+
if (!Ne(a))
|
|
510
510
|
return console.error("Invalid version"), !1;
|
|
511
511
|
const r = o[t];
|
|
512
512
|
if (!r)
|
|
@@ -516,14 +516,14 @@ function Ne(e) {
|
|
|
516
516
|
}
|
|
517
517
|
function je(e) {
|
|
518
518
|
const n = f(0), o = f(0), t = f(!1);
|
|
519
|
-
return
|
|
519
|
+
return Z(e, (r) => {
|
|
520
520
|
r && !t.value && (n.value = r.offsetWidth, o.value = r.scrollWidth, t.value = !0);
|
|
521
521
|
}), {
|
|
522
522
|
isTruncated: y(() => n.value < o.value)
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
525
|
function Fe() {
|
|
526
|
-
const { i18n: { t: e } } =
|
|
526
|
+
const { i18n: { t: e } } = O();
|
|
527
527
|
return {
|
|
528
528
|
utf8Name: (o) => /^[\p{N}\p{L}.\-_~]*$/u.test(o) ? "" : e("validationErrors.utf8Name")
|
|
529
529
|
};
|
|
@@ -549,27 +549,27 @@ function Ge(e) {
|
|
|
549
549
|
}
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
const
|
|
553
|
-
useAxios:
|
|
552
|
+
const tt = {
|
|
553
|
+
useAxios: E,
|
|
554
554
|
useDebouncedFilter: ke,
|
|
555
555
|
useDeleteUrlBuilder: Ke,
|
|
556
556
|
useBaseEntityDeckOptions: xe,
|
|
557
557
|
useBaseFormDeckOptions: Pe,
|
|
558
558
|
useErrors: De,
|
|
559
|
-
useExternalLinkCreator:
|
|
560
|
-
useFetcher:
|
|
559
|
+
useExternalLinkCreator: Oe,
|
|
560
|
+
useFetcher: Re,
|
|
561
561
|
useFetcherCacheKey: Q,
|
|
562
|
-
useFetchUrlBuilder:
|
|
562
|
+
useFetchUrlBuilder: Y,
|
|
563
563
|
useHelpers: S,
|
|
564
564
|
useStringHelpers: Le,
|
|
565
|
-
useI18n:
|
|
566
|
-
useGatewayFeatureSupported:
|
|
565
|
+
useI18n: O,
|
|
566
|
+
useGatewayFeatureSupported: Ue,
|
|
567
567
|
useTruncationDetector: je,
|
|
568
568
|
useValidators: Fe,
|
|
569
569
|
useSchemaProvider: Be,
|
|
570
570
|
useSubSchema: ze,
|
|
571
571
|
useTableState: Ge
|
|
572
|
-
},
|
|
572
|
+
}, st = (e, n) => {
|
|
573
573
|
const o = e.__vccOpts || e;
|
|
574
574
|
for (const [t, a] of n)
|
|
575
575
|
o[t] = a;
|
|
@@ -578,18 +578,20 @@ const Xe = {
|
|
|
578
578
|
export {
|
|
579
579
|
Ae as C,
|
|
580
580
|
V as D,
|
|
581
|
-
|
|
581
|
+
qe as E,
|
|
582
582
|
A as F,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
583
|
+
Ze as I,
|
|
584
|
+
We as P,
|
|
585
|
+
Ye as S,
|
|
586
|
+
st as _,
|
|
587
|
+
Je as a,
|
|
588
588
|
W as b,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
589
|
+
tt as c,
|
|
590
|
+
Xe as d,
|
|
591
|
+
H as e,
|
|
592
|
+
et as f,
|
|
593
|
+
Ie as g,
|
|
594
|
+
Qe as h,
|
|
595
|
+
Ce as i,
|
|
596
|
+
J as j
|
|
595
597
|
};
|
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-DXzCT2F2.cjs"),m=require("@kong-ui-public/monaco-editor"),p=require("@kong/icons"),k=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const y={class:"deck-command-editor-wrapper"},_={class:"deck-command-copy-button"},f=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 s(){await u(n.value)}async function u(l){if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=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,document?.body?.appendChild(o),o.focus(),o.select());let t;try{t=document?.execCommand("copy")}catch{t=!1}finally{document?.body?.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(e.unref(m.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",_,[e.createVNode(e.unref(k.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=>s())},{default:e.withCtx(()=>[e.createVNode(e.unref(p.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),i=a._export_sfc(f,[["__scopeId","data-v-55ffc70c"]]),C={},g={class:"editor-skeleton"};function v(r,n){const c=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",g,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,d=>e.createVNode(c,{key:d})),64))])}const b=a._export_sfc(C,[["render",v],["__scopeId","data-v-ec59bbd1"]]);function E(){e.provide(a.DECK_COMMAND_EDITOR_KEY,i)}exports.DeckCommandEditor=i;exports.DeckCommandEditorLoading=b;exports.provideDeckCommandEditor=E;
|
package/dist/deck-editor.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as f, useModel as y, openBlock as s, createElementBlock as i, createVNode as c, unref as t, createElementVNode as _, withCtx as k, mergeModels as C, resolveComponent as g, Fragment as v, renderList as b, provide as h } from "vue";
|
|
2
|
-
import { c as x, _ as m, D as E } from "./_plugin-vue_export-helper-
|
|
2
|
+
import { c as x, _ as m, D as E } from "./_plugin-vue_export-helper-DmBKRdlq.js";
|
|
3
3
|
import { MonacoEditor as D } from "@kong-ui-public/monaco-editor";
|
|
4
4
|
import { CopyIcon as w } from "@kong/icons";
|
|
5
5
|
import { KCodeBlockIconButton as V } from "@kong/kongponents";
|