@kong-ui-public/misc-widgets 2.1.24-pr.1660.eb344441.0 → 2.1.24-pr.1663.f5fb2455.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.
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as c, computed as l, ref as p, onMounted as b, resolveComponent as d, openBlock as h, createElementBlock as g, createVNode as m, withCtx as f, createElementVNode as i, unref as s, toDisplayString as _, createCommentVNode as S } from "vue";
2
- import { createI18n as v, Translation as x } from "@kong-ui-public/i18n";
2
+ import { createI18n as v, i18nTComponent as x } from "@kong-ui-public/i18n";
3
3
  const k = {
4
4
  title: "Star",
5
5
  ariaLabel: "Star buttons/github-buttons on GitHub",
@@ -8,15 +8,16 @@ const k = {
8
8
  githubStar: k
9
9
  };
10
10
  function L() {
11
+ const t = v("en-us", y);
11
12
  return {
12
- i18n: v("en-us", y),
13
- i18nT: x
13
+ i18n: t,
14
+ i18nT: x(t)
14
15
  // Translation component <i18n-t>
15
16
  };
16
17
  }
17
- const T = {
18
+ const C = {
18
19
  useI18n: L
19
- }, C = {
20
+ }, T = {
20
21
  key: 0,
21
22
  class: "kong-ui-public-misc-widgets-github-star",
22
23
  "data-testid": "github-star"
@@ -34,16 +35,16 @@ const T = {
34
35
  }
35
36
  },
36
37
  setup(t) {
37
- const { i18n: e } = T.useI18n(), o = t, r = l(() => o.tooltipText || e.t("githubStar.tooltipLabel")), n = p(!1);
38
+ const { i18n: e } = C.useI18n(), o = t, a = l(() => o.tooltipText || e.t("githubStar.tooltipLabel")), n = p(!1);
38
39
  return b(async () => {
39
- const a = document.createElement("script");
40
- a.addEventListener("load", () => {
40
+ const r = document.createElement("script");
41
+ r.addEventListener("load", () => {
41
42
  n.value = !0;
42
- }), a.setAttribute("src", "https://buttons.github.io/buttons.js"), document.head.appendChild(a);
43
- }), (a, w) => {
43
+ }), r.setAttribute("src", "https://buttons.github.io/buttons.js"), document.head.appendChild(r);
44
+ }), (r, w) => {
44
45
  const u = d("KTooltip");
45
- return t.url && n.value ? (h(), g("div", C, [
46
- m(u, { text: r.value }, {
46
+ return t.url && n.value ? (h(), g("div", T, [
47
+ m(u, { text: a.value }, {
47
48
  default: f(() => [
48
49
  i("span", null, [
49
50
  i("a", {
@@ -63,8 +64,8 @@ const T = {
63
64
  }
64
65
  }), I = (t, e) => {
65
66
  const o = t.__vccOpts || t;
66
- for (const [r, n] of e)
67
- o[r] = n;
67
+ for (const [a, n] of e)
68
+ o[a] = n;
68
69
  return o;
69
70
  }, q = /* @__PURE__ */ I(G, [["__scopeId", "data-v-235436ca"]]);
70
71
  export {
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["kong-ui-public-misc-widgets"]={},e.Vue,e["kong-ui-public-i18n"]))})(this,function(e,t,u){"use strict";const c={githubStar:{title:"Star",ariaLabel:"Star buttons/github-buttons on GitHub",tooltipLabel:"Star this repository on Github"}};function l(){return{i18n:u.createI18n("en-us",c),i18nT:u.Translation}}const d={useI18n:l},p={key:0,class:"kong-ui-public-misc-widgets-github-star","data-testid":"github-star"},b=["aria-label","href"],h=((n,i)=>{const o=n.__vccOpts||n;for(const[s,r]of i)o[s]=r;return o})(t.defineComponent({__name:"GithubStar",props:{url:{type:String,required:!0},tooltipText:{type:String,required:!1,default:""}},setup(n){const{i18n:i}=d.useI18n(),o=n,s=t.computed(()=>o.tooltipText||i.t("githubStar.tooltipLabel")),r=t.ref(!1);return t.onMounted(async()=>{const a=document.createElement("script");a.addEventListener("load",()=>{r.value=!0}),a.setAttribute("src","https://buttons.github.io/buttons.js"),document.head.appendChild(a)}),(a,S)=>{const f=t.resolveComponent("KTooltip");return n.url&&r.value?(t.openBlock(),t.createElementBlock("div",p,[t.createVNode(f,{text:s.value},{default:t.withCtx(()=>[t.createElementVNode("span",null,[t.createElementVNode("a",{"aria-label":t.unref(i).t("githubStar.ariaLabel"),class:"github-button","data-color-scheme":"no-preference: light; light: light; dark: light;","data-show-count":"true",href:n.url,target:"_blank"},t.toDisplayString(t.unref(i).t("githubStar.title")),9,b)])]),_:1},8,["text"])])):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-235436ca"]]);e.GithubStar=h,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["kong-ui-public-misc-widgets"]={},n.Vue,n["kong-ui-public-i18n"]))})(this,function(n,t,c){"use strict";const u={githubStar:{title:"Star",ariaLabel:"Star buttons/github-buttons on GitHub",tooltipLabel:"Star this repository on Github"}};function l(){const e=c.createI18n("en-us",u);return{i18n:e,i18nT:c.i18nTComponent(e)}}const d={useI18n:l},p={key:0,class:"kong-ui-public-misc-widgets-github-star","data-testid":"github-star"},b=["aria-label","href"],h=((e,o)=>{const i=e.__vccOpts||e;for(const[s,r]of o)i[s]=r;return i})(t.defineComponent({__name:"GithubStar",props:{url:{type:String,required:!0},tooltipText:{type:String,required:!1,default:""}},setup(e){const{i18n:o}=d.useI18n(),i=e,s=t.computed(()=>i.tooltipText||o.t("githubStar.tooltipLabel")),r=t.ref(!1);return t.onMounted(async()=>{const a=document.createElement("script");a.addEventListener("load",()=>{r.value=!0}),a.setAttribute("src","https://buttons.github.io/buttons.js"),document.head.appendChild(a)}),(a,S)=>{const f=t.resolveComponent("KTooltip");return e.url&&r.value?(t.openBlock(),t.createElementBlock("div",p,[t.createVNode(f,{text:s.value},{default:t.withCtx(()=>[t.createElementVNode("span",null,[t.createElementVNode("a",{"aria-label":t.unref(o).t("githubStar.ariaLabel"),class:"github-button","data-color-scheme":"no-preference: light; light: light; dark: light;","data-show-count":"true",href:e.url,target:"_blank"},t.toDisplayString(t.unref(o).t("githubStar.title")),9,b)])]),_:1},8,["text"])])):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-235436ca"]]);n.GithubStar=h,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- {"version":3,"file":"GithubStar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/github-star/GithubStar.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsIA,wBAgBG"}
1
+ {"version":3,"file":"GithubStar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/github-star/GithubStar.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgMA,wBAgBG"}
@@ -1,15 +1,9 @@
1
- export default function usei18n(): {
2
- i18n: import("@kong-ui-public/i18n/dist/types/types").IntlShapeEx<{
3
- githubStar: {
4
- title: string;
5
- ariaLabel: string;
6
- tooltipLabel: string;
7
- };
8
- }>;
9
- i18nT: {
10
- install<MessageSource extends Record<string, any>>(app: import("@vue/runtime-core").App<any>, options: {
11
- i18n: import("@kong-ui-public/i18n/dist/types/types").IntlShapeEx<MessageSource>;
12
- }): void;
13
- };
14
- };
1
+ import { createI18n, i18nTComponent } from '@kong-ui-public/i18n';
2
+ import english from '../locales/en.json';
3
+ interface UseI18nReturn {
4
+ i18n: ReturnType<typeof createI18n<typeof english>>;
5
+ i18nT: ReturnType<typeof i18nTComponent<typeof english>>;
6
+ }
7
+ export default function useI18n(): UseI18nReturn;
8
+ export {};
15
9
  //# sourceMappingURL=useI18n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,OAAO;;;;;;;;;;;;;EAO9B"}
1
+ {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;IACnD,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,aAAa,CAO/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/misc-widgets",
3
- "version": "2.1.24-pr.1660.eb344441.0",
3
+ "version": "2.1.24-pr.1663.f5fb2455.0",
4
4
  "type": "module",
5
5
  "main": "./dist/misc-widgets.umd.js",
6
6
  "module": "./dist/misc-widgets.es.js",
@@ -26,7 +26,7 @@
26
26
  "@kong-ui-public/i18n": "^2.2.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@kong/kongponents": "9.8.3-pr.2405.edff6b087.0",
29
+ "@kong/kongponents": "9.8.1",
30
30
  "vue": "^3.4.38",
31
31
  "@kong-ui-public/i18n": "^2.2.2"
32
32
  },