@telia-ace/alliance-ui 1.0.14-next.0 → 1.0.14-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-ui",
|
|
3
|
-
"version": "1.0.14-next.
|
|
3
|
+
"version": "1.0.14-next.1",
|
|
4
4
|
"description": "UI components used by ACE Alliance apps.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@teliads/components": "^22.1.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@telia-ace/alliance-internal-client-utilities": "1.0.
|
|
48
|
-
"@telia-ace/alliance-internal-node-utilities": "1.0.3-next.
|
|
47
|
+
"@telia-ace/alliance-internal-client-utilities": "1.0.3-next.0",
|
|
48
|
+
"@telia-ace/alliance-internal-node-utilities": "1.0.3-next.3",
|
|
49
49
|
"@types/fs-extra": "^11.0.1",
|
|
50
50
|
"fs-extra": "^11.1.1",
|
|
51
51
|
"lit": "^2.7.6",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@teliads/components/dist/components/telia-voca-stats';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { p as a, H as r } from "../../chunks/index-eef143db.js";
|
|
2
|
-
const n = {
|
|
3
|
-
DK: "Denmark",
|
|
4
|
-
EE: "Estonia",
|
|
5
|
-
FI: "Finland",
|
|
6
|
-
LT: "Lithuania",
|
|
7
|
-
NO: "Norway",
|
|
8
|
-
SE: "Sweden",
|
|
9
|
-
Global: "Global"
|
|
10
|
-
};
|
|
11
|
-
Object.values(n);
|
|
12
|
-
const i = "https://stats.api.voca.teliacompany.com/components", l = /* @__PURE__ */ a(class extends r {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(), this.__registerHost(), this.project = "", this.country = null, this.cache = /* @__PURE__ */ new Set();
|
|
15
|
-
}
|
|
16
|
-
handleVocaInternalUStats(o) {
|
|
17
|
-
if (window.location.hostname === "localhost")
|
|
18
|
-
try {
|
|
19
|
-
const t = n[this.country] || (() => {
|
|
20
|
-
throw new Error('telia-voca-stats "country" prop is invalid');
|
|
21
|
-
})(), s = `${o.detail.voca_component}-${o.detail.voca_added}`;
|
|
22
|
-
if (!this.cache.has(s) && this.project) {
|
|
23
|
-
const c = Object.assign({ voca_project: this.project, voca_country: t }, o.detail);
|
|
24
|
-
this.cache.add(s), fetch(i, {
|
|
25
|
-
method: "POST",
|
|
26
|
-
body: JSON.stringify(c)
|
|
27
|
-
}).then((e) => e.json()).catch((e) => {
|
|
28
|
-
console.error(e.body);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
} catch (t) {
|
|
32
|
-
console.error(t.message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}, [0, "telia-voca-stats", {
|
|
39
|
-
project: [1],
|
|
40
|
-
country: [1]
|
|
41
|
-
}, [[8, "vocaInternalUStats", "handleVocaInternalUStats"]]]);
|
|
42
|
-
function h() {
|
|
43
|
-
if (typeof customElements > "u")
|
|
44
|
-
return;
|
|
45
|
-
["telia-voca-stats"].forEach((t) => {
|
|
46
|
-
switch (t) {
|
|
47
|
-
case "telia-voca-stats":
|
|
48
|
-
customElements.get(t) || customElements.define(t, l);
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
h();
|
|
54
|
-
//# sourceMappingURL=telia-voca-stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telia-voca-stats.js","sources":["../../../../node_modules/.pnpm/@teliads+components@22.1.0/node_modules/@teliads/components/dist/components/telia-voca-stats.js"],"sourcesContent":["import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';\n\nconst Countries = {\n DK: 'Denmark',\n EE: 'Estonia',\n FI: 'Finland',\n LT: 'Lithuania',\n NO: 'Norway',\n SE: 'Sweden',\n Global: 'Global',\n};\nObject.values(Countries);\n\nconst API_STATS = 'https://stats.api.voca.teliacompany.com/components';\nconst TeliaVocaStats$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n /** Name of the project. Project field is unique and required. To ensure uniqueness of this field,\n * please input it in correct format `'[projectsName]-[countryCode]'`. E.g., `'b2c-fi'`, `'b2c-ecom-fi'`, `'b2b-se'` */\n this.project = '';\n /** Country initials of the project, this prop is provided by the project that uses Voca DS.\n * Possible values: 'DK' | 'EE' | 'FI' | 'LT' | 'NO' | 'SE' | 'Global'. */\n this.country = null;\n // To avoid unneccessary logging, first leverage in-memeory Cache\n this.cache = new Set();\n }\n handleVocaInternalUStats(event) {\n if (window.location.hostname !== 'localhost') {\n return;\n }\n try {\n /** id is unique identifier for component,\n * it consists of components name, page url, projects name and projects country. */\n const country = Countries[this.country] ||\n (() => {\n throw new Error('telia-voca-stats \"country\" prop is invalid');\n })();\n const id = `${event.detail.voca_component}-${event.detail.voca_added}`;\n const exist = this.cache.has(id);\n if (!exist && this.project) {\n const body = Object.assign({ voca_project: this.project, voca_country: country }, event.detail);\n this.cache.add(id);\n // Post date to API\n // Sends Component usage stats data to AWS S3.\n fetch(API_STATS, {\n method: 'POST',\n body: JSON.stringify(body),\n })\n .then(response => {\n return response.json();\n })\n .catch((error) => {\n console.error(error.body);\n });\n }\n }\n catch (error) {\n console.error(error.message);\n }\n }\n render() {\n /** telia-voca-stats is not a component, so it returns null, instead of html. */\n return null;\n }\n}, [0, \"telia-voca-stats\", {\n \"project\": [1],\n \"country\": [1]\n }, [[8, \"vocaInternalUStats\", \"handleVocaInternalUStats\"]]]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"telia-voca-stats\"];\n components.forEach(tagName => { switch (tagName) {\n case \"telia-voca-stats\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, TeliaVocaStats$1);\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst TeliaVocaStats = TeliaVocaStats$1;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { TeliaVocaStats, defineCustomElement };\n"],"names":["Countries","API_STATS","TeliaVocaStats$1","proxyCustomElement","HTMLElement","event","country","id","body","response","error","defineCustomElement$1","tagName"],"mappings":";AAEA,MAAMA,IAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,QAAQ;AACV;AACA,OAAO,OAAOA,CAAS;AAEvB,MAAMC,IAAY,sDACZC,IAAiC,gBAAAC,EAAmB,cAAcC,EAAY;AAAA,EAClF,cAAc;AACZ,aACA,KAAK,eAAc,GAGnB,KAAK,UAAU,IAGf,KAAK,UAAU,MAEf,KAAK,QAAQ,oBAAI;EAClB;AAAA,EACD,yBAAyBC,GAAO;AAC9B,QAAI,OAAO,SAAS,aAAa;AAGjC,UAAI;AAGF,cAAMC,IAAUN,EAAU,KAAK,OAAO,MACnC,MAAM;AACL,gBAAM,IAAI,MAAM,4CAA4C;AAAA,QACtE,MACYO,IAAK,GAAGF,EAAM,OAAO,cAAc,IAAIA,EAAM,OAAO,UAAU;AAEpE,YAAI,CADU,KAAK,MAAM,IAAIE,CAAE,KACjB,KAAK,SAAS;AAC1B,gBAAMC,IAAO,OAAO,OAAO,EAAE,cAAc,KAAK,SAAS,cAAcF,EAAO,GAAID,EAAM,MAAM;AAC9F,eAAK,MAAM,IAAIE,CAAE,GAGjB,MAAMN,GAAW;AAAA,YACf,QAAQ;AAAA,YACR,MAAM,KAAK,UAAUO,CAAI;AAAA,UACnC,CAAS,EACE,KAAK,CAAAC,MACCA,EAAS,MACjB,EACE,MAAM,CAACC,MAAU;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