@gemx-dev/heatmap-react 3.5.92-dev.10 → 3.5.92-dev.11
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/esm/components/Layout/HeatmapLayout.d.ts +1 -0
- package/dist/esm/components/Layout/HeatmapLayout.d.ts.map +1 -1
- package/dist/esm/hooks/common/useHeatmapWidthByDevice.d.ts.map +1 -1
- package/dist/esm/hooks/register/useRegisterConfig.d.ts +2 -1
- package/dist/esm/hooks/register/useRegisterConfig.d.ts.map +1 -1
- package/dist/esm/hooks/view-context/useHeatmapDataContext.d.ts +2 -0
- package/dist/esm/hooks/view-context/useHeatmapDataContext.d.ts.map +1 -1
- package/dist/esm/hooks/viz-render/useHeatmapRender.d.ts.map +1 -1
- package/dist/esm/index.js +97 -25
- package/dist/esm/index.mjs +97 -25
- package/dist/esm/libs/iframe-processor/index.d.ts +1 -1
- package/dist/esm/libs/iframe-processor/index.d.ts.map +1 -1
- package/dist/esm/libs/iframe-processor/processors/viewport/global-fixes/global-fixes/viewport-unit-replacer/fixes.d.ts.map +1 -1
- package/dist/esm/libs/index.d.ts +1 -0
- package/dist/esm/libs/index.d.ts.map +1 -1
- package/dist/esm/libs/perf.d.ts +83 -0
- package/dist/esm/libs/perf.d.ts.map +1 -0
- package/dist/esm/stores/config.d.ts +2 -0
- package/dist/esm/stores/config.d.ts.map +1 -1
- package/dist/esm/stores/data.d.ts +2 -0
- package/dist/esm/stores/data.d.ts.map +1 -1
- package/dist/esm/types/heatmap.d.ts +1 -0
- package/dist/esm/types/heatmap.d.ts.map +1 -1
- package/dist/umd/components/Layout/HeatmapLayout.d.ts +1 -0
- package/dist/umd/components/Layout/HeatmapLayout.d.ts.map +1 -1
- package/dist/umd/hooks/common/useHeatmapWidthByDevice.d.ts.map +1 -1
- package/dist/umd/hooks/register/useRegisterConfig.d.ts +2 -1
- package/dist/umd/hooks/register/useRegisterConfig.d.ts.map +1 -1
- package/dist/umd/hooks/view-context/useHeatmapDataContext.d.ts +2 -0
- package/dist/umd/hooks/view-context/useHeatmapDataContext.d.ts.map +1 -1
- package/dist/umd/hooks/viz-render/useHeatmapRender.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/libs/iframe-processor/index.d.ts +1 -1
- package/dist/umd/libs/iframe-processor/index.d.ts.map +1 -1
- package/dist/umd/libs/iframe-processor/processors/viewport/global-fixes/global-fixes/viewport-unit-replacer/fixes.d.ts.map +1 -1
- package/dist/umd/libs/index.d.ts +1 -0
- package/dist/umd/libs/index.d.ts.map +1 -1
- package/dist/umd/libs/perf.d.ts +83 -0
- package/dist/umd/libs/perf.d.ts.map +1 -0
- package/dist/umd/stores/config.d.ts +2 -0
- package/dist/umd/stores/config.d.ts.map +1 -1
- package/dist/umd/stores/data.d.ts +2 -0
- package/dist/umd/stores/data.d.ts.map +1 -1
- package/dist/umd/types/heatmap.d.ts +1 -0
- package/dist/umd/types/heatmap.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/esm/libs/iframe-processor/shared/perf.d.ts +0 -58
- package/dist/esm/libs/iframe-processor/shared/perf.d.ts.map +0 -1
- package/dist/umd/libs/iframe-processor/shared/perf.d.ts +0 -58
- package/dist/umd/libs/iframe-processor/shared/perf.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ClickMapPoint, EncodedPayload, IHeatmapInfo, IPersistedAreaData, ScrollMapPoint } from '../../types';
|
|
2
2
|
import type { IHeatmapControl } from '../../types/control';
|
|
3
3
|
interface HeatmapLayoutProps {
|
|
4
|
+
shopId?: string;
|
|
4
5
|
data?: EncodedPayload[];
|
|
5
6
|
clickmap?: ClickMapPoint[];
|
|
6
7
|
clickAreas?: IPersistedAreaData[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/HeatmapLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,a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pB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AACD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2DtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapWidthByDevice.d.ts","sourceRoot":"","sources":["../../../src/hooks/common/useHeatmapWidthByDevice.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"useHeatmapWidthByDevice.d.ts","sourceRoot":"","sources":["../../../src/hooks/common/useHeatmapWidthByDevice.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,cAoBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterConfig.d.ts","sourceRoot":"","sources":["../../../src/hooks/register/useRegisterConfig.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,GAAI,
|
|
1
|
+
{"version":3,"file":"useRegisterConfig.d.ts","sourceRoot":"","sources":["../../../src/hooks/register/useRegisterConfig.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,GAAI,yCAI/B;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,SA+BA,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ClickMapPoint, EncodedPayload, IHeatmapInfo, IPersistedAreaData, ScrollMapPoint } from '../../types';
|
|
2
2
|
interface IHeatmapDataState {
|
|
3
3
|
data: EncodedPayload[] | undefined;
|
|
4
|
+
dataHash: string | undefined;
|
|
4
5
|
dataSnapshot: EncodedPayload[] | undefined;
|
|
5
6
|
clickmap: ClickMapPoint[] | undefined;
|
|
6
7
|
clickAreas: IPersistedAreaData[] | undefined;
|
|
@@ -12,6 +13,7 @@ interface IHeatmapDataState {
|
|
|
12
13
|
interface IHeatmapDataActions {
|
|
13
14
|
setData: (newData: EncodedPayload[]) => void;
|
|
14
15
|
setDataSnapshot: (newData: EncodedPayload[]) => void;
|
|
16
|
+
setDataHash: (newHash: string | undefined) => void;
|
|
15
17
|
setClickmap: (newClickmap: ClickMapPoint[]) => void;
|
|
16
18
|
setClickAreas: (newClickAreas: IPersistedAreaData[]) => void;
|
|
17
19
|
setScrollmap: (newScrollmap: ScrollMapPoint[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapDataContext.d.ts","sourceRoot":"","sources":["../../../src/hooks/view-context/useHeatmapDataContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKnH,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACnC,YAAY,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACtC,UAAU,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAC7C,SAAS,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACxC,YAAY,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IACrD,WAAW,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACpD,aAAa,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAC7D,YAAY,EAAE,CAAC,YAAY,EAAE,cAAc,EA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KAAK,IAAI,CAAC;IACrD,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,WAAW,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACpD,aAAa,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAC7D,YAAY,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IACvD,eAAe,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,gBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACzF,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,qBAAqB;;;;;;;CA4BhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapRender.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapRender.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHeatmapRender.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapRender.ts"],"names":[],"mappings":"AAiCA,UAAU,uBAAuB;IAC/B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACtD;AAcD,eAAO,MAAM,gBAAgB,QAAO,uBAiFnC,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -152,6 +152,7 @@ function useDebounceCallback(callback, delay) {
|
|
|
152
152
|
|
|
153
153
|
var EDeviceType;
|
|
154
154
|
(function (EDeviceType) {
|
|
155
|
+
EDeviceType["DesktopLarge"] = "DESKTOP_LARGE";
|
|
155
156
|
EDeviceType["Desktop"] = "DESKTOP";
|
|
156
157
|
EDeviceType["Mobile"] = "MOBILE";
|
|
157
158
|
EDeviceType["Tablet"] = "TABLET";
|
|
@@ -319,15 +320,18 @@ const useHeatmapConfigStore = create()((set) => {
|
|
|
319
320
|
return {
|
|
320
321
|
mode: EHeatmapMode.Single,
|
|
321
322
|
sidebarWidth: DEFAULT_SIDEBAR_WIDTH,
|
|
323
|
+
shopId: undefined,
|
|
322
324
|
setMode: (mode) => set({ mode }),
|
|
323
325
|
resetMode: () => set({ mode: EHeatmapMode.Single }),
|
|
324
326
|
setSidebarWidth: (sidebarWidth) => set({ sidebarWidth }),
|
|
327
|
+
setShopId: (shopId) => set({ shopId }),
|
|
325
328
|
};
|
|
326
329
|
});
|
|
327
330
|
|
|
328
331
|
const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
329
332
|
return {
|
|
330
333
|
data: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
334
|
+
dataHash: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
331
335
|
dataSnapshot: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
332
336
|
clickmap: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
333
337
|
clickAreas: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
@@ -361,6 +365,11 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
361
365
|
newData.set(viewId, data);
|
|
362
366
|
return { data: newData };
|
|
363
367
|
}),
|
|
368
|
+
setDataHash: (dataHash, viewId = DEFAULT_VIEW_ID) => set((prev) => {
|
|
369
|
+
const newDataHash = new Map(prev.dataHash);
|
|
370
|
+
newDataHash.set(viewId, dataHash);
|
|
371
|
+
return { dataHash: newDataHash };
|
|
372
|
+
}),
|
|
364
373
|
setDataSnapshot: (data, viewId = DEFAULT_VIEW_ID) => set((prev) => {
|
|
365
374
|
const newDataSnapshot = new Map(prev.dataSnapshot);
|
|
366
375
|
newDataSnapshot.set(viewId, data);
|
|
@@ -394,8 +403,10 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
394
403
|
const newDataInfo = new Map(prev.dataInfo);
|
|
395
404
|
const newScrollmap = new Map(prev.scrollmap);
|
|
396
405
|
const newAttentionMap = new Map(prev.attentionMap);
|
|
406
|
+
const newDataHash = new Map(prev.dataHash);
|
|
397
407
|
newData.set(toViewId, prev.data.get(fromViewId));
|
|
398
408
|
newDataSnapshot.set(toViewId, prev.dataSnapshot.get(fromViewId));
|
|
409
|
+
newDataHash.set(toViewId, prev.dataHash.get(fromViewId));
|
|
399
410
|
newClickmap.set(toViewId, prev.clickmap.get(fromViewId));
|
|
400
411
|
newClickAreas.set(toViewId, prev.clickAreas.get(fromViewId));
|
|
401
412
|
newDataInfo.set(toViewId, prev.dataInfo.get(fromViewId));
|
|
@@ -409,6 +420,7 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
409
420
|
dataInfo: newDataInfo,
|
|
410
421
|
scrollmap: newScrollmap,
|
|
411
422
|
attentionMap: newAttentionMap,
|
|
423
|
+
dataHash: newDataHash,
|
|
412
424
|
};
|
|
413
425
|
}),
|
|
414
426
|
clearView: (viewId) => set((prev) => {
|
|
@@ -419,8 +431,10 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
419
431
|
const newDataInfo = new Map(prev.dataInfo);
|
|
420
432
|
const newScrollmap = new Map(prev.scrollmap);
|
|
421
433
|
const newAttentionMap = new Map(prev.attentionMap);
|
|
434
|
+
const newDataHash = new Map(prev.dataHash);
|
|
422
435
|
newData.delete(viewId);
|
|
423
436
|
newDataSnapshot.delete(viewId);
|
|
437
|
+
newDataHash.delete(viewId);
|
|
424
438
|
newClickmap.delete(viewId);
|
|
425
439
|
newClickAreas.delete(viewId);
|
|
426
440
|
newDataInfo.delete(viewId);
|
|
@@ -429,6 +443,7 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
429
443
|
return {
|
|
430
444
|
data: newData,
|
|
431
445
|
dataSnapshot: newDataSnapshot,
|
|
446
|
+
dataHash: newDataHash,
|
|
432
447
|
clickmap: newClickmap,
|
|
433
448
|
clickAreas: newClickAreas,
|
|
434
449
|
dataInfo: newDataInfo,
|
|
@@ -439,6 +454,7 @@ const useHeatmapDataStore = create()(subscribeWithSelector((set) => {
|
|
|
439
454
|
resetAll: () => set({
|
|
440
455
|
data: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
441
456
|
dataSnapshot: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
457
|
+
dataHash: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
442
458
|
clickmap: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
443
459
|
clickAreas: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
444
460
|
dataInfo: new Map([[DEFAULT_VIEW_ID, undefined]]),
|
|
@@ -1286,6 +1302,7 @@ const useHeatmapDataContext = createViewContextHook({
|
|
|
1286
1302
|
useStore: useHeatmapDataStore,
|
|
1287
1303
|
getState: (store, viewId) => ({
|
|
1288
1304
|
data: store.data.get(viewId),
|
|
1305
|
+
dataHash: store.dataHash.get(viewId),
|
|
1289
1306
|
dataSnapshot: store.dataSnapshot.get(viewId),
|
|
1290
1307
|
clickmap: store.clickmap.get(viewId),
|
|
1291
1308
|
clickAreas: store.clickAreas.get(viewId),
|
|
@@ -1297,6 +1314,7 @@ const useHeatmapDataContext = createViewContextHook({
|
|
|
1297
1314
|
getActions: (store, viewId) => ({
|
|
1298
1315
|
setData: (newData) => store.setData(newData, viewId),
|
|
1299
1316
|
setDataSnapshot: (newData) => store.setDataSnapshot(newData, viewId),
|
|
1317
|
+
setDataHash: (newHash) => store.setDataHash(newHash, viewId),
|
|
1300
1318
|
setClickmap: (newClickmap) => store.setClickmap(newClickmap, viewId),
|
|
1301
1319
|
setClickAreas: (newClickAreas) => store.setClickAreas(newClickAreas, viewId),
|
|
1302
1320
|
setDataInfoByKey: (key, value) => store.setDataInfoByKey(key, value, viewId),
|
|
@@ -1513,6 +1531,8 @@ const useHeatmapWidthByDevice = () => {
|
|
|
1513
1531
|
if (!deviceType)
|
|
1514
1532
|
return 1440;
|
|
1515
1533
|
switch (deviceType) {
|
|
1534
|
+
case EDeviceType.DesktopLarge:
|
|
1535
|
+
return 1920;
|
|
1516
1536
|
case EDeviceType.Desktop:
|
|
1517
1537
|
return 1440;
|
|
1518
1538
|
case EDeviceType.Tablet:
|
|
@@ -1523,13 +1543,20 @@ const useHeatmapWidthByDevice = () => {
|
|
|
1523
1543
|
}
|
|
1524
1544
|
};
|
|
1525
1545
|
|
|
1526
|
-
const useRegisterConfig = ({ isLoading, isLoadingCanvas, }) => {
|
|
1546
|
+
const useRegisterConfig = ({ shopId, isLoading, isLoadingCanvas, }) => {
|
|
1527
1547
|
const mode = useHeatmapConfigStore((state) => state.mode);
|
|
1548
|
+
const shopIdStore = useHeatmapConfigStore((state) => state.shopId);
|
|
1528
1549
|
const deviceType = useHeatmapSettingContext((state) => state.deviceType);
|
|
1529
1550
|
const sidebarWidth = useHeatmapConfigStore((state) => state.sidebarWidth);
|
|
1530
1551
|
const setIsRendering = useHeatmapSettingContext((state) => state.setIsRendering);
|
|
1531
1552
|
const setIsLoadingDom = useHeatmapSettingContext((state) => state.setIsLoadingDom);
|
|
1532
1553
|
const setIsLoadingCanvas = useHeatmapSettingContext((state) => state.setIsLoadingCanvas);
|
|
1554
|
+
const setShopId = useHeatmapConfigStore((state) => state.setShopId);
|
|
1555
|
+
useEffect(() => {
|
|
1556
|
+
if (!shopId || !!shopIdStore || shopIdStore === shopId)
|
|
1557
|
+
return;
|
|
1558
|
+
setShopId(shopId);
|
|
1559
|
+
}, [shopId, setShopId, shopIdStore]);
|
|
1533
1560
|
useEffect(() => {
|
|
1534
1561
|
setIsRendering(true);
|
|
1535
1562
|
setTimeout(() => {
|
|
@@ -4031,18 +4058,27 @@ function useVizLiveIframeMsg(options = {}) {
|
|
|
4031
4058
|
}
|
|
4032
4059
|
|
|
4033
4060
|
/**
|
|
4034
|
-
*
|
|
4035
|
-
*
|
|
4061
|
+
* Unified performance timing utility.
|
|
4062
|
+
*
|
|
4063
|
+
* Two complementary tools:
|
|
4036
4064
|
*
|
|
4037
|
-
*
|
|
4038
|
-
*
|
|
4039
|
-
*
|
|
4040
|
-
* perf.measure('viewport.run', t);
|
|
4041
|
-
* perf.endSession();
|
|
4065
|
+
* 1. `perf` — global DevTools session recorder.
|
|
4066
|
+
* Stores structured timing in `window.__gemxPerf` for inspection.
|
|
4067
|
+
* Used by the iframe-processor rendering pipeline.
|
|
4042
4068
|
*
|
|
4043
|
-
*
|
|
4044
|
-
*
|
|
4045
|
-
*
|
|
4069
|
+
* perf.startSession('render-1');
|
|
4070
|
+
* const t = perf.mark('viewport.run');
|
|
4071
|
+
* perf.measure('viewport.run', t);
|
|
4072
|
+
* perf.endSession();
|
|
4073
|
+
*
|
|
4074
|
+
* 2. `createPerfTimer` — per-module console logger factory.
|
|
4075
|
+
* Logs prefixed timings to the console AND records entries into the
|
|
4076
|
+
* active global session so they appear in `window.__gemxPerf` too.
|
|
4077
|
+
*
|
|
4078
|
+
* const timer = createPerfTimer('Render');
|
|
4079
|
+
* const t0 = timer.mark('start');
|
|
4080
|
+
* await timer.wrap('visualizer.html', () => visualizer.html(...));
|
|
4081
|
+
* timer.measure('total', t0);
|
|
4046
4082
|
*/
|
|
4047
4083
|
const s = {
|
|
4048
4084
|
enabled: true,
|
|
@@ -4050,7 +4086,7 @@ const s = {
|
|
|
4050
4086
|
sessions: [],
|
|
4051
4087
|
maxSessions: 20,
|
|
4052
4088
|
};
|
|
4053
|
-
// ──
|
|
4089
|
+
// ── Global singleton functions ────────────────────────────────────────────────
|
|
4054
4090
|
function startSession(id) {
|
|
4055
4091
|
if (!s.enabled)
|
|
4056
4092
|
return;
|
|
@@ -4067,7 +4103,7 @@ function endSession() {
|
|
|
4067
4103
|
return session;
|
|
4068
4104
|
}
|
|
4069
4105
|
/** Record a point-in-time mark. Returns `performance.now()` for use with measure(). */
|
|
4070
|
-
function
|
|
4106
|
+
function globalMark(label) {
|
|
4071
4107
|
const now = performance.now();
|
|
4072
4108
|
if (s.enabled && s.current) {
|
|
4073
4109
|
s.current.entries.push({ label, t: now - s.current.startedAt });
|
|
@@ -4075,7 +4111,7 @@ function mark$1(label) {
|
|
|
4075
4111
|
return now;
|
|
4076
4112
|
}
|
|
4077
4113
|
/** Record a duration from a previous mark() timestamp. */
|
|
4078
|
-
function
|
|
4114
|
+
function globalMeasure(label, t0) {
|
|
4079
4115
|
const duration = performance.now() - t0;
|
|
4080
4116
|
if (s.enabled && s.current) {
|
|
4081
4117
|
s.current.entries.push({ label, t: t0 - s.current.startedAt, duration });
|
|
@@ -4088,26 +4124,34 @@ function getReport() {
|
|
|
4088
4124
|
latest: s.sessions[0] ?? null,
|
|
4089
4125
|
};
|
|
4090
4126
|
}
|
|
4091
|
-
function
|
|
4127
|
+
function clearSessions() {
|
|
4092
4128
|
s.current = null;
|
|
4093
4129
|
s.sessions = [];
|
|
4094
4130
|
if (typeof window !== 'undefined')
|
|
4095
4131
|
delete window.__gemxPerf;
|
|
4096
4132
|
}
|
|
4097
|
-
function
|
|
4133
|
+
function enableGlobal() {
|
|
4098
4134
|
s.enabled = true;
|
|
4099
4135
|
}
|
|
4100
|
-
function
|
|
4136
|
+
function disableGlobal() {
|
|
4101
4137
|
s.enabled = false;
|
|
4102
4138
|
}
|
|
4103
|
-
// ── Internal ──────────────────────────────────────────────────────────────────
|
|
4104
4139
|
function flush() {
|
|
4105
4140
|
if (typeof window === 'undefined')
|
|
4106
4141
|
return;
|
|
4107
4142
|
window.__gemxPerf = getReport();
|
|
4108
4143
|
}
|
|
4109
|
-
// ──
|
|
4110
|
-
const perf = {
|
|
4144
|
+
// ── Global singleton export ───────────────────────────────────────────────────
|
|
4145
|
+
const perf = {
|
|
4146
|
+
startSession,
|
|
4147
|
+
endSession,
|
|
4148
|
+
mark: globalMark,
|
|
4149
|
+
measure: globalMeasure,
|
|
4150
|
+
getReport,
|
|
4151
|
+
clear: clearSessions,
|
|
4152
|
+
enable: enableGlobal,
|
|
4153
|
+
disable: disableGlobal,
|
|
4154
|
+
};
|
|
4111
4155
|
|
|
4112
4156
|
/**
|
|
4113
4157
|
* DOM observation setup — ResizeObserver + MutationObserver.
|
|
@@ -4845,6 +4889,25 @@ function getActiveFixes(ctx) {
|
|
|
4845
4889
|
const logger$1 = createLogger({ enabled: false, prefix: 'ViewportUnitReplacer' });
|
|
4846
4890
|
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
4847
4891
|
const HEIGHT_RELATED_PROPERTIES = ['height', 'min-height', 'max-height', 'top', 'bottom'];
|
|
4892
|
+
/**
|
|
4893
|
+
* Number of top-level CSS rules to process before yielding to the browser.
|
|
4894
|
+
* Keeps the main thread responsive during large stylesheets (prevents tab kill on mobile).
|
|
4895
|
+
*/
|
|
4896
|
+
const YIELD_EVERY_RULES = 100;
|
|
4897
|
+
// ─── Scheduler ────────────────────────────────────────────────────────────────
|
|
4898
|
+
/**
|
|
4899
|
+
* Yield control back to the browser so it can handle input, paint frames, and
|
|
4900
|
+
* avoid "page unresponsive" / tab-kill on mobile during heavy CSS processing.
|
|
4901
|
+
*
|
|
4902
|
+
* Uses `scheduler.yield()` (Chrome 115+) when available; falls back to a
|
|
4903
|
+
* zero-timeout macrotask which is universally supported.
|
|
4904
|
+
*/
|
|
4905
|
+
function yieldToMain() {
|
|
4906
|
+
if (typeof globalThis !== 'undefined' && 'scheduler' in globalThis) {
|
|
4907
|
+
return globalThis.scheduler.yield();
|
|
4908
|
+
}
|
|
4909
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
4910
|
+
}
|
|
4848
4911
|
// ─── Per-run tracking state (reset on each process() call) ───────────────────
|
|
4849
4912
|
let elementsWithViewportUnits = new Set();
|
|
4850
4913
|
let originalValues = new WeakMap();
|
|
@@ -4984,8 +5047,9 @@ function processRule(rule, ctx) {
|
|
|
4984
5047
|
return count;
|
|
4985
5048
|
}
|
|
4986
5049
|
/** Processes only inline <style> sheets. Linked sheets are handled by processLinkedStylesheets. */
|
|
4987
|
-
function processStylesheets(ctx) {
|
|
5050
|
+
async function processStylesheets(ctx) {
|
|
4988
5051
|
let total = 0;
|
|
5052
|
+
let rulesSinceYield = 0;
|
|
4989
5053
|
const sheets = ctx.doc.styleSheets;
|
|
4990
5054
|
for (let i = 0; i < sheets.length; i++) {
|
|
4991
5055
|
const sheet = sheets[i];
|
|
@@ -4995,6 +5059,11 @@ function processStylesheets(ctx) {
|
|
|
4995
5059
|
const rules = sheet.cssRules;
|
|
4996
5060
|
for (let j = 0; j < rules.length; j++) {
|
|
4997
5061
|
total += processRule(rules[j], ctx);
|
|
5062
|
+
rulesSinceYield++;
|
|
5063
|
+
if (rulesSinceYield >= YIELD_EVERY_RULES) {
|
|
5064
|
+
rulesSinceYield = 0;
|
|
5065
|
+
await yieldToMain();
|
|
5066
|
+
}
|
|
4998
5067
|
}
|
|
4999
5068
|
}
|
|
5000
5069
|
catch (e) {
|
|
@@ -5042,7 +5111,7 @@ async function process$1(ctx) {
|
|
|
5042
5111
|
originalValues = new WeakMap();
|
|
5043
5112
|
processInlineStyles(ctx);
|
|
5044
5113
|
processStyleTags(ctx);
|
|
5045
|
-
processStylesheets(ctx);
|
|
5114
|
+
await processStylesheets(ctx);
|
|
5046
5115
|
await processLinkedStylesheets(ctx);
|
|
5047
5116
|
// Wait for browser to apply the replaced styles
|
|
5048
5117
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
@@ -6054,6 +6123,7 @@ function measure(label, startMs) {
|
|
|
6054
6123
|
const useHeatmapRender = () => {
|
|
6055
6124
|
const viewId = useViewIdContext();
|
|
6056
6125
|
const data = useHeatmapDataContext((s) => s.data);
|
|
6126
|
+
const shopId = useHeatmapConfigStore((s) => s.shopId);
|
|
6057
6127
|
const vizRef = useHeatmapVizRectContext((s) => s.vizRef);
|
|
6058
6128
|
const setVizRef = useHeatmapVizRectContext((s) => s.setVizRef);
|
|
6059
6129
|
const setIframeHeight = useHeatmapVizRectContext((s) => s.setIframeHeight);
|
|
@@ -6090,6 +6160,7 @@ const useHeatmapRender = () => {
|
|
|
6090
6160
|
startIframe({
|
|
6091
6161
|
helperRef,
|
|
6092
6162
|
iframe,
|
|
6163
|
+
shopId,
|
|
6093
6164
|
deviceType,
|
|
6094
6165
|
size: { width: contentWidth, height: wrapperHeight },
|
|
6095
6166
|
t0,
|
|
@@ -6124,7 +6195,7 @@ const useHeatmapRender = () => {
|
|
|
6124
6195
|
};
|
|
6125
6196
|
};
|
|
6126
6197
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
6127
|
-
function startIframe({ helperRef, iframe, deviceType = EDeviceType.Desktop, size, t0, onSuccess }) {
|
|
6198
|
+
function startIframe({ helperRef, iframe, shopId, deviceType = EDeviceType.Desktop, size, t0, onSuccess, }) {
|
|
6128
6199
|
const docWidth = size.width ?? 0;
|
|
6129
6200
|
const docHeight = size.height ?? 0;
|
|
6130
6201
|
if (docHeight === 0)
|
|
@@ -6139,6 +6210,7 @@ function startIframe({ helperRef, iframe, deviceType = EDeviceType.Desktop, size
|
|
|
6139
6210
|
targetHeight: docHeight,
|
|
6140
6211
|
iframe,
|
|
6141
6212
|
debug: true,
|
|
6213
|
+
shopId,
|
|
6142
6214
|
onSuccess: (data) => {
|
|
6143
6215
|
measure('IframeHelper processing', tHelper);
|
|
6144
6216
|
measure('Total render', t0);
|
|
@@ -8410,11 +8482,11 @@ const ContentTopBar = () => {
|
|
|
8410
8482
|
}, children: CompTopBar && jsx(CompTopBar, {}) }));
|
|
8411
8483
|
};
|
|
8412
8484
|
|
|
8413
|
-
const HeatmapLayout = ({ data, clickmap, clickAreas, scrollmap, attentionMap, controls, dataInfo, isLoading, isLoadingCanvas, }) => {
|
|
8485
|
+
const HeatmapLayout = ({ shopId, data, clickmap, clickAreas, scrollmap, attentionMap, controls, dataInfo, isLoading, isLoadingCanvas, }) => {
|
|
8414
8486
|
useRegisterControl(controls);
|
|
8415
8487
|
useRegisterData(data, dataInfo);
|
|
8416
8488
|
useRegisterHeatmap({ clickmap, scrollmap, clickAreas, attentionMap });
|
|
8417
|
-
useRegisterConfig({ isLoading, isLoadingCanvas });
|
|
8489
|
+
useRegisterConfig({ isLoading, isLoadingCanvas, shopId });
|
|
8418
8490
|
// performanceLogger.configure({
|
|
8419
8491
|
// enabled: true,
|
|
8420
8492
|
// logToConsole: false,
|