@gemx-dev/clarity-visualize 0.8.67 → 0.8.68
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/build/clarity.visualize.js +886 -1021
- package/build/clarity.visualize.min.js +1 -1
- package/build/clarity.visualize.module.js +886 -1021
- package/package.json +2 -2
- package/src/layout.ts +12 -3
- package/tsconfig.json +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemx-dev/clarity-visualize",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.68",
|
|
4
4
|
"description": "Clarity visualize",
|
|
5
5
|
"author": "Microsoft Corp.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"unpkg": "build/clarity.visualize.min.js",
|
|
10
10
|
"types": "types/index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@gemx-dev/clarity-decode": "^0.8.
|
|
12
|
+
"@gemx-dev/clarity-decode": "^0.8.68"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@rollup/plugin-commonjs": "^24.0.0",
|
package/src/layout.ts
CHANGED
|
@@ -107,7 +107,7 @@ const imageMaskedSvg = {
|
|
|
107
107
|
/* END imageMaskedSvgs */
|
|
108
108
|
|
|
109
109
|
export class LayoutHelper {
|
|
110
|
-
static TIMEOUT =
|
|
110
|
+
static TIMEOUT = 7000;
|
|
111
111
|
|
|
112
112
|
primaryHtmlNodeId: number | null = null;
|
|
113
113
|
isMobile: boolean;
|
|
@@ -249,8 +249,17 @@ export class LayoutHelper {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
public customElement = (event: DecodedLayout.CustomElementEvent): void => {
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
const tagName = event.data.name;
|
|
253
|
+
if (!this.state.window.customElements.get(tagName)) {
|
|
254
|
+
try {
|
|
255
|
+
// Use eval to create class in target window context (avoids ES5 transpilation issues)
|
|
256
|
+
const EmptyElement = (this.state.window as any).eval(
|
|
257
|
+
'(class extends HTMLElement { constructor() { super(); } })'
|
|
258
|
+
);
|
|
259
|
+
this.state.window.customElements.define(tagName, EmptyElement);
|
|
260
|
+
} catch (e) {
|
|
261
|
+
console.error(`Failed to define custom element ${tagName}:`, e);
|
|
262
|
+
}
|
|
254
263
|
}
|
|
255
264
|
}
|
|
256
265
|
|