@dotcms/analytics 1.5.1-next.1996 → 1.5.1-next.2010

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/analytics",
3
- "version": "1.5.1-next.1996",
3
+ "version": "1.5.1-next.2010",
4
4
  "description": "Official JavaScript library for Content Analytics with DotCMS.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,5 @@
1
+ const T = "TEMP_EMPTY_CONTENTLET", E = "TEMP_EMPTY_CONTENTLET_TYPE";
2
+ export {
3
+ T as TEMP_EMPTY_CONTENTLET,
4
+ E as TEMP_EMPTY_CONTENTLET_TYPE
5
+ };
@@ -1,8 +1,9 @@
1
1
  import { UVEEventType as s } from "../../../types/src/lib/editor/public.js";
2
2
  import { __DOTCMS_UVE_EVENT__ as i } from "../../../types/src/lib/events/internal.js";
3
- import { DOT_SECTION_ID_PREFIX as _ } from "./constants.js";
4
- import { findDotCMSElement as C, findDotCMSVTLData as f, getClosestDotCMSContainerData as O, getDotCMSPageBounds as g } from "../lib/dom/dom.utils.js";
5
- function p(o) {
3
+ import { DOT_SECTION_ID_PREFIX as C } from "./constants.js";
4
+ import { TEMP_EMPTY_CONTENTLET as r, TEMP_EMPTY_CONTENTLET_TYPE as f } from "./contentlet-sentinel.constants.js";
5
+ import { findDotCMSElement as g, findDotCMSVTLData as S, getClosestDotCMSContainerData as v, getDotCMSPageBounds as O } from "../lib/dom/dom.utils.js";
6
+ function y(o) {
6
7
  const t = (n) => {
7
8
  n.data.name === i.UVE_SET_PAGE_DATA && o(n.data.payload);
8
9
  };
@@ -13,7 +14,7 @@ function p(o) {
13
14
  event: s.CONTENT_CHANGES
14
15
  };
15
16
  }
16
- function b(o) {
17
+ function D(o) {
17
18
  const t = (n) => {
18
19
  n.data.name === i.UVE_RELOAD_PAGE && o();
19
20
  };
@@ -24,12 +25,12 @@ function b(o) {
24
25
  event: s.PAGE_RELOAD
25
26
  };
26
27
  }
27
- function w(o) {
28
+ function I(o) {
28
29
  const t = (n) => {
29
30
  if (n.data.name === i.UVE_REQUEST_BOUNDS) {
30
31
  const e = Array.from(
31
32
  document.querySelectorAll('[data-dot-object="container"]')
32
- ), a = g(e);
33
+ ), a = O(e);
33
34
  o(a);
34
35
  }
35
36
  };
@@ -40,7 +41,7 @@ function w(o) {
40
41
  event: s.REQUEST_BOUNDS
41
42
  };
42
43
  }
43
- function y(o) {
44
+ function R(o) {
44
45
  const t = (n) => {
45
46
  if (n.data.name === i.UVE_SCROLL_INSIDE_IFRAME) {
46
47
  const e = n.data.direction;
@@ -58,7 +59,7 @@ function M(o) {
58
59
  const t = (n) => {
59
60
  if (n.data.name !== i.UVE_SCROLL_TO_SECTION)
60
61
  return;
61
- const e = n.data.sectionIndex, a = document.querySelector(`#${_}${e}`) ?? document.querySelector(`#section-${e}`);
62
+ const e = n.data.sectionIndex, a = document.querySelector(`#${C}${e}`) ?? document.querySelector(`#section-${e}`);
62
63
  a && o({ sectionIndex: e, offsetTop: a.offsetTop });
63
64
  };
64
65
  return window.addEventListener("message", t), {
@@ -68,19 +69,19 @@ function M(o) {
68
69
  event: s.SCROLL_TO_SECTION
69
70
  };
70
71
  }
71
- function D(o) {
72
+ function A(o) {
72
73
  const t = (n) => {
73
- const e = C(n.target);
74
+ const e = g(n.target);
74
75
  if (!e) return;
75
- const { x: a, y: r, width: d, height: E } = e.getBoundingClientRect(), c = e.dataset?.dotObject === "container", T = {
76
- identifier: "TEMP_EMPTY_CONTENTLET",
77
- title: "TEMP_EMPTY_CONTENTLET",
78
- contentType: "TEMP_EMPTY_CONTENTLET_TYPE",
76
+ const { x: a, y: d, width: c, height: E } = e.getBoundingClientRect(), m = e.dataset?.dotObject === "container", l = {
77
+ identifier: r,
78
+ title: r,
79
+ contentType: f,
79
80
  inode: "TEMPY_EMPTY_CONTENTLET_INODE",
80
- widgetTitle: "TEMP_EMPTY_CONTENTLET",
81
- baseType: "TEMP_EMPTY_CONTENTLET",
81
+ widgetTitle: r,
82
+ baseType: r,
82
83
  onNumberOfPages: 1
83
- }, l = {
84
+ }, T = {
84
85
  identifier: e.dataset?.dotIdentifier,
85
86
  title: e.dataset?.dotTitle,
86
87
  inode: e.dataset?.dotInode,
@@ -91,21 +92,21 @@ function D(o) {
91
92
  ...e.dataset?.dotStyleProperties && {
92
93
  dotStyleProperties: JSON.parse(e.dataset.dotStyleProperties)
93
94
  }
94
- }, m = f(e), u = {
95
+ }, u = S(e), _ = {
95
96
  container: (
96
97
  // Here extract dot-container from contentlet if it is Headless
97
98
  // or search in parent container if it is VTL
98
- e.dataset?.dotContainer ? JSON.parse(e.dataset?.dotContainer) : O(e)
99
+ e.dataset?.dotContainer ? JSON.parse(e.dataset?.dotContainer) : v(e)
99
100
  ),
100
- contentlet: c ? T : l,
101
- vtlFiles: m
101
+ contentlet: m ? l : T,
102
+ vtlFiles: u
102
103
  };
103
104
  o({
104
105
  x: a,
105
- y: r,
106
- width: d,
106
+ y: d,
107
+ width: c,
107
108
  height: E,
108
- payload: u
109
+ payload: _
109
110
  });
110
111
  };
111
112
  return document.addEventListener("pointermove", t), {
@@ -116,10 +117,10 @@ function D(o) {
116
117
  };
117
118
  }
118
119
  export {
119
- p as onContentChanges,
120
- D as onContentletHovered,
121
- y as onIframeScroll,
122
- b as onPageReload,
123
- w as onRequestBounds,
120
+ y as onContentChanges,
121
+ A as onContentletHovered,
122
+ R as onIframeScroll,
123
+ D as onPageReload,
124
+ I as onRequestBounds,
124
125
  M as onScrollToSection
125
126
  };