@financial-times/custom-code-component 1.3.3 → 1.5.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.
|
@@ -21,10 +21,10 @@ class g extends HTMLElement {
|
|
|
21
21
|
throw new Error(
|
|
22
22
|
"path attribute not specified in <custom-code-component>"
|
|
23
23
|
);
|
|
24
|
-
const [n,
|
|
25
|
-
if (!n || !
|
|
24
|
+
const [n, c, i] = e.split("/").reverse();
|
|
25
|
+
if (!n || !c || !i)
|
|
26
26
|
return;
|
|
27
|
-
const f = l ? `http://localhost:5173/src/${n}/index.jsx` : `https://www.ft.com/__component/${
|
|
27
|
+
const f = l ? `http://localhost:5173/src/${n}/index.jsx` : `https://www.ft.com/__component/${i}/${c}${a ? `@${a}` : "@latest"}/${n}/${n}.js`;
|
|
28
28
|
try {
|
|
29
29
|
const s = await import(
|
|
30
30
|
/* webpackIgnore: true */
|
|
@@ -52,7 +52,7 @@ class g extends HTMLElement {
|
|
|
52
52
|
t && (this.unmount = t), o && (this.onmessage = o);
|
|
53
53
|
}
|
|
54
54
|
} catch (s) {
|
|
55
|
-
console.info(`<custom-code-component> uncaught error from ${e}
|
|
55
|
+
console.info(`<custom-code-component> uncaught error from ${e}`), console.error(s);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
connectedCallback() {
|
package/package.json
CHANGED
|
@@ -88,7 +88,8 @@ class FTCustomCodeComponent extends HTMLElement {
|
|
|
88
88
|
if (onmessage) this.onmessage = onmessage;
|
|
89
89
|
}
|
|
90
90
|
} catch (e) {
|
|
91
|
-
console.info(`<custom-code-component> uncaught error from ${path}
|
|
91
|
+
console.info(`<custom-code-component> uncaught error from ${path}`);
|
|
92
|
+
console.error(e);
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
|