@dotcms/analytics 26.9.3-1 → 26.9.3-1-next.2649

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": "26.09.03-01",
3
+ "version": "26.9.3-1-next.2649",
4
4
  "description": "Official JavaScript library for Content Analytics with DotCMS.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "@analytics/queue-utils": "^0.1.3",
25
25
  "@analytics/router-utils": "^0.1.1",
26
26
  "@analytics/storage-utils": "^0.4.0",
27
- "@dotcms/uve": "26.09.03-01",
27
+ "@dotcms/uve": "26.9.3-1-next.2649",
28
28
  "analytics": "^0.8.0"
29
29
  },
30
30
  "peerDependencies": {
@@ -1,5 +1,5 @@
1
1
  import "../../internal/constants.js";
2
- function f(t) {
2
+ function p(t) {
3
3
  return t.map((e) => {
4
4
  const n = e.getBoundingClientRect(), o = Array.from(
5
5
  e.querySelectorAll('[data-dot-object="contentlet"]')
@@ -12,11 +12,14 @@ function f(t) {
12
12
  payload: JSON.stringify({
13
13
  container: r(e)
14
14
  }),
15
- contentlets: c(n, o)
15
+ contentlets: u(n, o)
16
16
  };
17
17
  });
18
18
  }
19
- function c(t, e) {
19
+ function i(t) {
20
+ return t?.dotCanEdit !== "false";
21
+ }
22
+ function u(t, e) {
20
23
  return e.map((n) => {
21
24
  const o = n.getBoundingClientRect();
22
25
  return {
@@ -30,7 +33,8 @@ function c(t, e) {
30
33
  identifier: n.dataset?.dotIdentifier,
31
34
  title: n.dataset?.dotTitle,
32
35
  inode: n.dataset?.dotInode,
33
- contentType: n.dataset?.dotType
36
+ contentType: n.dataset?.dotType,
37
+ canEdit: i(n.dataset)
34
38
  }
35
39
  })
36
40
  };
@@ -48,14 +52,14 @@ function l(t) {
48
52
  const e = t.closest('[data-dot-object="container"]');
49
53
  return e ? r(e) : (console.warn("No container found for the contentlet"), null);
50
54
  }
51
- function u(t) {
55
+ function f(t) {
52
56
  if (!t) return null;
53
57
  const e = t.querySelector('[data-dot-object="empty-content"]');
54
58
  return t?.dataset?.dotObject === "contentlet" || // The container inside Headless components have a span with the data-dot-object="container" attribute
55
59
  t?.dataset?.dotObject === "container" && e || // The container inside Traditional have no content inside
56
- t?.dataset?.dotObject === "container" && t.children.length === 0 ? t : u(t?.parentElement);
60
+ t?.dataset?.dotObject === "container" && t.children.length === 0 ? t : f(t?.parentElement);
57
61
  }
58
- function p(t) {
62
+ function g(t) {
59
63
  const e = t.querySelectorAll(
60
64
  '[data-dot-object="vtl-file"]'
61
65
  );
@@ -64,7 +68,7 @@ function p(t) {
64
68
  name: n.dataset?.dotUrl
65
69
  })) : null;
66
70
  }
67
- function g(t) {
71
+ function C(t) {
68
72
  const e = t.dataset ?? {};
69
73
  return {
70
74
  identifier: e.dotIdentifier,
@@ -74,25 +78,26 @@ function g(t) {
74
78
  baseType: e.dotBasetype,
75
79
  widgetTitle: e.dotWidgetTitle,
76
80
  onNumberOfPages: e.dotOnNumberOfPages,
81
+ canEdit: i(e),
77
82
  ...e.dotStyleProperties && {
78
83
  dotStyleProperties: JSON.parse(e.dotStyleProperties)
79
84
  }
80
85
  };
81
86
  }
82
87
  function b(t) {
83
- const e = globalThis.Zone, n = (a) => typeof e?.__symbol__ == "function" ? e.__symbol__(a) : `__zone_symbol__${a}`, o = t, d = t, i = o[n("addEventListener")], s = o[n("removeEventListener")];
88
+ const e = globalThis.Zone, n = (a) => typeof e?.__symbol__ == "function" ? e.__symbol__(a) : `__zone_symbol__${a}`, o = t, d = t, s = o[n("addEventListener")], c = o[n("removeEventListener")];
84
89
  return {
85
- addEventListener: (i ?? d.addEventListener).bind(d),
86
- removeEventListener: (s ?? d.removeEventListener).bind(d)
90
+ addEventListener: (s ?? d.addEventListener).bind(d),
91
+ removeEventListener: (c ?? d.removeEventListener).bind(d)
87
92
  };
88
93
  }
89
94
  export {
90
- u as findDotCMSElement,
91
- p as findDotCMSVTLData,
95
+ f as findDotCMSElement,
96
+ g as findDotCMSVTLData,
92
97
  l as getClosestDotCMSContainerData,
93
98
  r as getDotCMSContainerData,
94
- c as getDotCMSContentletsBound,
95
- f as getDotCMSPageBounds,
99
+ u as getDotCMSContentletsBound,
100
+ p as getDotCMSPageBounds,
96
101
  b as getNativeEventBinder,
97
- g as readContentletDataset
102
+ C as readContentletDataset
98
103
  };