@dotcms/analytics 26.9.18-1 → 26.9.18-1-next.2741

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.
@@ -1,237 +1,307 @@
1
- import { ANALYTICS_JS_DEFAULT_PROPERTIES as T, SESSION_STORAGE_KEY as h, DEFAULT_SESSION_TIMEOUT_MINUTES as p, USER_ID_KEY as f, EXPECTED_UTM_KEYS as I, CONTENTLET_CLASS as m, DEFAULT_IMPRESSION_MUTATION_OBSERVER_DEBOUNCE_MS as D } from "../constants/dot-analytics.constants.js";
2
- import { DotLogger as y } from "../dot-analytics.logger.js";
3
- function P(t) {
4
- const e = [];
5
- return t.siteAuth?.trim() || e.push('"siteAuth"'), t.server?.trim() || e.push('"server"'), e.length > 0 ? e : null;
1
+ import { DotLogger as v } from "../dot-analytics.logger.js";
2
+ import { ANALYTICS_MINIFIED_SCRIPT_NAME as b, ANALYTICS_JS_DEFAULT_PROPERTIES as A, SESSION_STORAGE_KEY as h, DEFAULT_SESSION_TIMEOUT_MINUTES as I, USER_ID_KEY as p, EXPECTED_UTM_KEYS as _, CONTENTLET_CLASS as m, DEFAULT_IMPRESSION_MUTATION_OBSERVER_DEBOUNCE_MS as T } from "../constants/dot-analytics.constants.js";
3
+ function R(e) {
4
+ const s = [];
5
+ return e.siteAuth?.trim() || s.push('"siteAuth"'), e.server?.trim() || s.push('"server"'), s.length > 0 ? s : null;
6
6
  }
7
- let u = null, l = null;
8
- const g = (t) => {
9
- const e = Date.now(), n = Math.random().toString(36).substr(2, 9), s = Math.random().toString(36).substr(2, 9);
10
- return `${t}_${e}_${n}${s}`;
11
- }, w = {
12
- getItem: (t) => {
7
+ let d = null, g = null;
8
+ const f = (e) => {
9
+ const s = Date.now(), t = Math.random().toString(36).substr(2, 9), o = Math.random().toString(36).substr(2, 9);
10
+ return `${e}_${s}_${t}${o}`;
11
+ }, S = {
12
+ getItem: (e) => {
13
13
  try {
14
- return localStorage.getItem(t);
14
+ return localStorage.getItem(e);
15
15
  } catch {
16
16
  return null;
17
17
  }
18
18
  },
19
- setItem: (t, e) => {
19
+ setItem: (e, s) => {
20
20
  try {
21
- localStorage.setItem(t, e);
22
- } catch (n) {
23
- throw console.warn(`DotCMS Analytics [Core]: Could not save ${t} to localStorage`), n;
21
+ localStorage.setItem(e, s);
22
+ } catch (t) {
23
+ throw console.warn(`DotCMS Analytics [Core]: Could not save ${e} to localStorage`), t;
24
24
  }
25
25
  }
26
- }, R = {
27
- getItem: (t) => {
26
+ }, x = {
27
+ getItem: (e) => {
28
28
  try {
29
- return sessionStorage.getItem(t);
29
+ return sessionStorage.getItem(e);
30
30
  } catch {
31
31
  return null;
32
32
  }
33
33
  },
34
- setItem: (t, e) => {
34
+ setItem: (e, s) => {
35
35
  try {
36
- sessionStorage.setItem(t, e);
37
- } catch (n) {
38
- throw console.warn(`DotCMS Analytics [Core]: Could not save ${t} to sessionStorage`), n;
36
+ sessionStorage.setItem(e, s);
37
+ } catch (t) {
38
+ throw console.warn(`DotCMS Analytics [Core]: Could not save ${e} to sessionStorage`), t;
39
39
  }
40
40
  },
41
- removeItem: (t) => {
41
+ removeItem: (e) => {
42
42
  try {
43
- sessionStorage.removeItem(t);
43
+ sessionStorage.removeItem(e);
44
44
  } catch {
45
- console.warn(`DotCMS Analytics [Core]: Could not remove ${t} from sessionStorage`);
45
+ console.warn(`DotCMS Analytics [Core]: Could not remove ${e} from sessionStorage`);
46
46
  }
47
47
  }
48
- }, E = () => {
49
- let t = w.getItem(f);
50
- if (!t) {
51
- t = g("user");
48
+ }, C = () => {
49
+ let e = S.getItem(p);
50
+ if (!e) {
51
+ e = f("user");
52
52
  try {
53
- w.setItem(f, t);
53
+ S.setItem(p, e);
54
54
  } catch {
55
55
  }
56
56
  }
57
- return t;
58
- }, C = (t) => {
59
- const e = new Date(t), n = /* @__PURE__ */ new Date(), s = new Date(
60
- e.getUTCFullYear(),
61
- e.getUTCMonth(),
62
- e.getUTCDate()
63
- ), o = new Date(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate());
64
- return s.getTime() !== o.getTime();
65
- }, v = () => {
66
- const t = Date.now();
57
+ return e;
58
+ }, D = (e) => {
59
+ const s = new Date(e), t = /* @__PURE__ */ new Date(), o = new Date(
60
+ s.getUTCFullYear(),
61
+ s.getUTCMonth(),
62
+ s.getUTCDate()
63
+ ), n = new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
64
+ return o.getTime() !== n.getTime();
65
+ }, E = () => {
66
+ const e = Date.now();
67
67
  if (typeof window > "u")
68
- return g("session_fallback");
68
+ return f("session_fallback");
69
69
  try {
70
- const e = sessionStorage.getItem(h);
71
- if (e) {
72
- const { sessionId: o, startTime: r, lastActivity: c } = JSON.parse(e), a = !C(r), d = t - c < p * 60 * 1e3;
73
- if (a && d)
70
+ const s = sessionStorage.getItem(h);
71
+ if (s) {
72
+ const { sessionId: n, startTime: r, lastActivity: c } = JSON.parse(s), i = !D(r), u = e - c < I * 60 * 1e3;
73
+ if (i && u)
74
74
  return sessionStorage.setItem(
75
75
  h,
76
76
  JSON.stringify({
77
- sessionId: o,
77
+ sessionId: n,
78
78
  startTime: r,
79
- lastActivity: t
79
+ lastActivity: e
80
80
  })
81
- ), o;
81
+ ), n;
82
82
  }
83
- const n = g("session"), s = {
84
- sessionId: n,
85
- startTime: t,
86
- lastActivity: t
83
+ const t = f("session"), o = {
84
+ sessionId: t,
85
+ startTime: e,
86
+ lastActivity: e
87
87
  };
88
- return sessionStorage.setItem(h, JSON.stringify(s)), n;
88
+ return sessionStorage.setItem(h, JSON.stringify(o)), t;
89
89
  } catch {
90
- return g("session_fallback");
90
+ return f("session_fallback");
91
91
  }
92
- }, x = (t) => {
93
- const e = v(), n = E(), s = A();
92
+ }, k = (e) => {
93
+ const s = E(), t = C(), o = M();
94
94
  return {
95
- site_auth: t.siteAuth,
96
- session_id: e,
97
- user_id: n,
98
- device: s
95
+ site_auth: e.siteAuth,
96
+ session_id: s,
97
+ user_id: t,
98
+ device: o
99
+ };
100
+ }, B = () => {
101
+ const e = document.querySelector(
102
+ `script[src*="${b}"][data-analytics-auth]`
103
+ );
104
+ if (e) {
105
+ const s = e.getAttribute("data-analytics-config");
106
+ let t = {};
107
+ if (s)
108
+ try {
109
+ const a = JSON.parse(s);
110
+ t = y(a);
111
+ } catch {
112
+ try {
113
+ const a = s.replace(/([{,]\s*)'(.+?)'(\s*:)/g, '$1"$2"$3').replace(/(:\s*)'(.+?)'(\s*[,}\]])/g, '$1"$2"$3'), l = JSON.parse(a);
114
+ t = y(l);
115
+ } catch (a) {
116
+ console.error("Failed to parse data-analytics-config JSON:", a);
117
+ }
118
+ }
119
+ const o = e.getAttribute("data-analytics-server"), n = e.getAttribute("data-analytics-debug"), r = e.getAttribute("data-analytics-auto-page-view"), c = e.getAttribute("data-analytics-auth"), i = e.getAttribute("data-analytics-impressions"), u = e.getAttribute("data-analytics-clicks");
120
+ return {
121
+ // 1. Default fallback values
122
+ server: window.location.origin,
123
+ debug: !1,
124
+ autoPageView: !0,
125
+ siteAuth: "",
126
+ // 2. Advanced config (JSON)
127
+ ...t,
128
+ // 3. Explicit attributes (highest priority)
129
+ ...o && { server: o },
130
+ ...n && { debug: n === "true" },
131
+ // autoPageView is opt-out: presence of the attribute overrides JSON config; only the
132
+ // literal string "false" disables it (any other value, including "", enables it)
133
+ ...r !== null && { autoPageView: r !== "false" },
134
+ ...c && { siteAuth: c },
135
+ ...i && { impressions: i === "true" },
136
+ ...u && { clicks: u === "true" }
137
+ };
138
+ }
139
+ return console.warn("[DotCMS Analytics] Script wrapper not found - verify installation"), {
140
+ server: window.location.origin,
141
+ debug: !1,
142
+ autoPageView: !0,
143
+ siteAuth: ""
99
144
  };
100
- }, _ = () => u || (u = {
145
+ }, w = () => d || (d = {
101
146
  user_language: navigator.language,
102
147
  doc_encoding: document.characterSet || document.charset,
103
148
  screen_resolution: typeof screen < "u" && screen.width && screen.height ? `${screen.width}x${screen.height}` : ""
104
- }, u), A = () => {
105
- const t = _(), e = window.innerWidth || document.documentElement.clientWidth || 0, n = window.innerHeight || document.documentElement.clientHeight || 0;
149
+ }, d), M = () => {
150
+ const e = w(), s = window.innerWidth || document.documentElement.clientWidth || 0, t = window.innerHeight || document.documentElement.clientHeight || 0;
106
151
  return {
107
- screen_resolution: t.screen_resolution ?? "",
108
- language: t.user_language ?? "",
109
- viewport_width: String(e),
110
- viewport_height: String(n)
152
+ screen_resolution: e.screen_resolution ?? "",
153
+ language: e.user_language ?? "",
154
+ viewport_width: String(s),
155
+ viewport_height: String(t)
111
156
  };
112
- }, b = (t) => {
113
- const e = t.search;
114
- if (l && l.search === e)
115
- return l.params;
116
- const n = new URLSearchParams(e), s = {};
117
- return I.forEach((o) => {
118
- const r = n.get(o);
157
+ }, N = (e) => {
158
+ const s = e.search;
159
+ if (g && g.search === s)
160
+ return g.params;
161
+ const t = new URLSearchParams(s), o = {};
162
+ return _.forEach((n) => {
163
+ const r = t.get(n);
119
164
  if (r) {
120
- const c = o.replace("utm_", "");
121
- s[c] = r;
165
+ const c = n.replace("utm_", "");
166
+ o[c] = r;
122
167
  }
123
- }), l = { search: e, params: s }, s;
168
+ }), g = { search: s, params: o }, o;
124
169
  }, O = () => {
125
170
  try {
126
- const t = (/* @__PURE__ */ new Date()).getTimezoneOffset(), e = t > 0 ? "-" : "+", n = Math.abs(t), s = Math.floor(n / 60), o = n % 60;
127
- return `${e}${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
171
+ const e = (/* @__PURE__ */ new Date()).getTimezoneOffset(), s = e > 0 ? "-" : "+", t = Math.abs(e), o = Math.floor(t / 60), n = t % 60;
172
+ return `${s}${o.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
128
173
  } catch {
129
174
  return "+00:00";
130
175
  }
131
- }, M = () => {
176
+ }, L = () => {
132
177
  try {
133
- const t = /* @__PURE__ */ new Date(), e = O(), n = t.getFullYear(), s = (t.getMonth() + 1).toString().padStart(2, "0"), o = t.getDate().toString().padStart(2, "0"), r = t.getHours().toString().padStart(2, "0"), c = t.getMinutes().toString().padStart(2, "0"), a = t.getSeconds().toString().padStart(2, "0");
134
- return `${n}-${s}-${o}T${r}:${c}:${a}${e}`;
178
+ const e = /* @__PURE__ */ new Date(), s = O(), t = e.getFullYear(), o = (e.getMonth() + 1).toString().padStart(2, "0"), n = e.getDate().toString().padStart(2, "0"), r = e.getHours().toString().padStart(2, "0"), c = e.getMinutes().toString().padStart(2, "0"), i = e.getSeconds().toString().padStart(2, "0");
179
+ return `${t}-${o}-${n}T${r}:${c}:${i}${s}`;
135
180
  } catch {
136
181
  return (/* @__PURE__ */ new Date()).toISOString();
137
182
  }
138
- }, Y = (t, e = typeof window < "u" ? window.location : {}) => {
139
- const n = M(), s = _(), { properties: o } = t, r = {};
140
- Object.keys(o).forEach((i) => {
141
- T.includes(i) || (r[i] = o[i]);
183
+ }, j = (e, s = typeof window < "u" ? window.location : {}) => {
184
+ const t = L(), o = w(), { properties: n } = e, r = {};
185
+ Object.keys(n).forEach((a) => {
186
+ A.includes(a) || (r[a] = n[a]);
142
187
  });
143
- const c = t.context?.device?.language?.toLowerCase() ?? "", a = {
144
- url: e.href,
145
- doc_encoding: s.doc_encoding,
146
- doc_hash: e.hash,
147
- doc_protocol: e.protocol,
148
- doc_search: e.search,
149
- doc_host: e.hostname,
150
- doc_path: e.pathname,
151
- title: o.title ?? document?.title,
188
+ const c = e.context?.device?.language?.toLowerCase() ?? "", i = {
189
+ url: s.href,
190
+ doc_encoding: o.doc_encoding,
191
+ doc_hash: s.hash,
192
+ doc_protocol: s.protocol,
193
+ doc_search: s.search,
194
+ doc_host: s.hostname,
195
+ doc_path: s.pathname,
196
+ title: n.title ?? document?.title,
152
197
  locale_id: c
153
- }, d = b(e);
198
+ }, u = N(s);
154
199
  return {
155
- ...t,
156
- page: a,
157
- ...Object.keys(d).length > 0 && { utm: d },
200
+ ...e,
201
+ page: i,
202
+ ...Object.keys(u).length > 0 && { utm: u },
158
203
  // Only include custom if there are user-provided properties
159
204
  ...Object.keys(r).length > 0 && { custom: r },
160
- local_time: n
205
+ local_time: t
161
206
  };
162
207
  };
163
- function L(t, e) {
164
- let n = 0;
165
- return (...s) => {
166
- const o = Date.now();
167
- o - n >= e && (t(...s), n = o);
208
+ function $(e, s) {
209
+ let t = 0;
210
+ return (...o) => {
211
+ const n = Date.now();
212
+ n - t >= s && (e(...o), t = n);
168
213
  };
169
214
  }
170
- function B(t) {
171
- return t.dataset.dotIdentifier || null;
215
+ function F(e) {
216
+ return e.dataset.dotIdentifier || null;
172
217
  }
173
- function F(t) {
218
+ function Y(e) {
174
219
  return {
175
- identifier: t.dataset.dotIdentifier || "",
176
- inode: t.dataset.dotInode || "",
177
- contentType: t.dataset.dotType || "",
178
- title: t.dataset.dotTitle || "",
179
- baseType: t.dataset.dotBasetype || ""
220
+ identifier: e.dataset.dotIdentifier || "",
221
+ inode: e.dataset.dotInode || "",
222
+ contentType: e.dataset.dotType || "",
223
+ title: e.dataset.dotTitle || "",
224
+ baseType: e.dataset.dotBasetype || ""
180
225
  };
181
226
  }
182
- const z = 100, N = () => typeof window < "u" && typeof document < "u", H = () => Array.from(document.querySelectorAll(`.${m}`)), J = (t, e = D) => {
183
- const n = L(t, e), s = new MutationObserver((r) => {
184
- r.some((a) => a.addedNodes.length === 0 && a.removedNodes.length === 0 ? !1 : [
185
- ...Array.from(a.addedNodes),
186
- ...Array.from(a.removedNodes)
187
- ].some((i) => {
188
- if (i.nodeType !== Node.ELEMENT_NODE)
227
+ const z = 100, P = () => typeof window < "u" && typeof document < "u", V = () => Array.from(document.querySelectorAll(`.${m}`)), J = (e, s = T) => {
228
+ const t = $(e, s), o = new MutationObserver((r) => {
229
+ r.some((i) => i.addedNodes.length === 0 && i.removedNodes.length === 0 ? !1 : [
230
+ ...Array.from(i.addedNodes),
231
+ ...Array.from(i.removedNodes)
232
+ ].some((a) => {
233
+ if (a.nodeType !== Node.ELEMENT_NODE)
189
234
  return !1;
190
- const S = i;
191
- return S.classList?.contains(m) ? !0 : S.querySelector?.(`.${m}`) !== null;
192
- })) && n();
193
- }), o = document.body || document.documentElement;
194
- return o ? s.observe(o, {
235
+ const l = a;
236
+ return l.classList?.contains(m) ? !0 : l.querySelector?.(`.${m}`) !== null;
237
+ })) && t();
238
+ }), n = document.body || document.documentElement;
239
+ return n ? o.observe(n, {
195
240
  childList: !0,
196
241
  subtree: !0,
197
242
  attributes: !1,
198
243
  characterData: !1
199
244
  }) : window.addEventListener("DOMContentLoaded", () => {
200
- document.body && s.observe(document.body, {
245
+ document.body && o.observe(document.body, {
201
246
  childList: !0,
202
247
  subtree: !0,
203
248
  attributes: !1,
204
249
  characterData: !1
205
250
  });
206
- }), s;
207
- }, K = (t) => {
208
- N() && (window.addEventListener("beforeunload", t), window.addEventListener("pagehide", t));
209
- }, j = (t, e) => {
210
- const n = e.logLevel ?? (e.debug ? "debug" : "warn");
211
- return new y("Analytics", t, n);
212
- }, W = (t, e, n) => [
213
- t.impressions && e(t),
214
- t.clicks && n(t)
251
+ }), o;
252
+ }, H = (e) => {
253
+ P() && (window.addEventListener("beforeunload", e), window.addEventListener("pagehide", e));
254
+ }, K = (e, s) => {
255
+ const t = s.logLevel ?? (s.debug ? "debug" : "warn");
256
+ return new v("Analytics", e, t);
257
+ }, W = (e, s, t) => [
258
+ e.impressions && s(e),
259
+ e.clicks && t(e)
215
260
  ].filter(Boolean);
261
+ function y(e) {
262
+ if (typeof e != "object" || e === null)
263
+ return {};
264
+ const s = {}, t = e;
265
+ if (typeof t.server == "string" && t.server.trim().length > 0 && (s.server = t.server.trim()), typeof t.siteAuth == "string" && t.siteAuth.trim().length > 0 && (s.siteAuth = t.siteAuth.trim()), t.queue !== void 0) {
266
+ if (typeof t.queue == "boolean")
267
+ s.queue = t.queue;
268
+ else if (typeof t.queue == "object" && t.queue !== null) {
269
+ const n = {};
270
+ typeof t.queue.eventBatchSize == "number" && (n.eventBatchSize = t.queue.eventBatchSize), typeof t.queue.flushInterval == "number" && (n.flushInterval = t.queue.flushInterval), Object.keys(n).length > 0 && (s.queue = n);
271
+ }
272
+ }
273
+ if (t.impressions !== void 0) {
274
+ if (typeof t.impressions == "boolean")
275
+ s.impressions = t.impressions;
276
+ else if (typeof t.impressions == "object" && t.impressions !== null) {
277
+ const n = {};
278
+ typeof t.impressions.visibilityThreshold == "number" && (n.visibilityThreshold = t.impressions.visibilityThreshold), typeof t.impressions.dwellMs == "number" && (n.dwellMs = t.impressions.dwellMs), typeof t.impressions.maxNodes == "number" && (n.maxNodes = t.impressions.maxNodes), typeof t.impressions.throttleMs == "number" && (n.throttleMs = t.impressions.throttleMs), Object.keys(n).length > 0 && (s.impressions = n);
279
+ }
280
+ }
281
+ typeof t.clicks == "boolean" && (s.clicks = t.clicks), typeof t.autoPageView == "boolean" && (s.autoPageView = t.autoPageView), typeof t.debug == "boolean" && (s.debug = t.debug);
282
+ const o = ["debug", "info", "warn", "error"];
283
+ return typeof t.logLevel == "string" && o.includes(t.logLevel) && (s.logLevel = t.logLevel), s;
284
+ }
216
285
  export {
217
286
  z as INITIAL_SCAN_DELAY_MS,
218
287
  J as createContentletObserver,
219
- j as createPluginLogger,
220
- L as createThrottle,
221
- Y as enrichPagePayloadOptimized,
222
- F as extractContentletData,
223
- B as extractContentletIdentifier,
224
- b as extractUTMParameters,
225
- H as findContentlets,
226
- g as generateSecureId,
227
- x as getAnalyticsContext,
228
- A as getDeviceDataForContext,
288
+ K as createPluginLogger,
289
+ $ as createThrottle,
290
+ j as enrichPagePayloadOptimized,
291
+ Y as extractContentletData,
292
+ F as extractContentletIdentifier,
293
+ N as extractUTMParameters,
294
+ V as findContentlets,
295
+ f as generateSecureId,
296
+ B as getAnalyticsConfig,
297
+ k as getAnalyticsContext,
298
+ M as getDeviceDataForContext,
229
299
  W as getEnhancedTrackingPlugins,
230
- M as getLocalTime,
231
- v as getSessionId,
232
- E as getUserId,
233
- N as isBrowser,
234
- R as safeSessionStorage,
235
- K as setupPluginCleanup,
236
- P as validateAnalyticsConfig
300
+ L as getLocalTime,
301
+ E as getSessionId,
302
+ C as getUserId,
303
+ P as isBrowser,
304
+ x as safeSessionStorage,
305
+ H as setupPluginCleanup,
306
+ R as validateAnalyticsConfig
237
307
  };
@@ -1,6 +1,5 @@
1
1
  import { useMemo as c, useCallback as r } from "react";
2
2
  import { getUVEState as l } from "../../../uve/src/lib/core/core.utils.js";
3
- import "../../../uve/src/internal/constants.js";
4
3
  import { initializeAnalytics as u } from "../internal/utils.js";
5
4
  const A = {
6
5
  track: () => {
@@ -9,7 +8,7 @@ const A = {
9
8
  },
10
9
  conversion: () => {
11
10
  }
12
- }, v = (i) => {
11
+ }, f = (i) => {
13
12
  const t = c(() => {
14
13
  const e = u(i);
15
14
  return e || (l() ? console.warn(
@@ -20,12 +19,12 @@ const A = {
20
19
  }, [i.server, i.siteAuth]);
21
20
  if (!t)
22
21
  return A;
23
- const o = r(
22
+ const s = r(
24
23
  (e, n = {}) => {
25
24
  t.track(e, n);
26
25
  },
27
26
  [t]
28
- ), s = r(
27
+ ), o = r(
29
28
  (e = {}) => {
30
29
  t.pageView(e);
31
30
  },
@@ -37,11 +36,11 @@ const A = {
37
36
  [t]
38
37
  );
39
38
  return {
40
- track: o,
41
- pageView: s,
39
+ track: s,
40
+ pageView: o,
42
41
  conversion: a
43
42
  };
44
43
  };
45
44
  export {
46
- v as useContentAnalytics
45
+ f as useContentAnalytics
47
46
  };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@dotcms/analytics",
3
- "version": "26.9.18-1",
3
+ "version": "26.9.18-1-next.2741",
4
+ "type": "module",
4
5
  "description": "Official JavaScript library for Content Analytics with DotCMS.",
5
6
  "repository": {
6
7
  "type": "git",
@@ -28,10 +29,11 @@
28
29
  },
29
30
  "peerDependencies": {
30
31
  "react": "^18 || ^19",
31
- "@dotcms/uve": "26.9.18-1"
32
+ "@dotcms/uve": "26.9.18-1-next.2741",
33
+ "next": ">=13"
32
34
  },
33
35
  "devDependencies": {
34
- "@dotcms/types": "26.9.18-1",
36
+ "@dotcms/types": "26.9.18-1-next.2741",
35
37
  "@testing-library/jest-dom": "^6.1.6",
36
38
  "@testing-library/react": "^14.0.0",
37
39
  "vite": "~5.0.0"
@@ -50,13 +52,23 @@
50
52
  }
51
53
  },
52
54
  "exports": {
55
+ "./package.json": "./package.json",
53
56
  ".": {
54
- "import": "./index.js",
55
- "types": "./index.d.ts"
57
+ "types": "./index.d.ts",
58
+ "import": "./index.js"
56
59
  },
57
60
  "./react": {
58
- "import": "./react/index.js",
59
- "types": "./lib/react/index.d.ts"
61
+ "types": "./lib/react/index.d.ts",
62
+ "import": "./react/index.js"
63
+ }
64
+ },
65
+ "sideEffects": false,
66
+ "peerDependenciesMeta": {
67
+ "next": {
68
+ "optional": true
69
+ },
70
+ "react": {
71
+ "optional": true
60
72
  }
61
73
  }
62
74
  }
@@ -1,5 +1,4 @@
1
- var r = /* @__PURE__ */ ((N) => (N.EDIT = "EDIT_MODE", N.PREVIEW = "PREVIEW_MODE", N.LIVE = "LIVE", N.UNKNOWN = "UNKNOWN", N))(r || {}), O = /* @__PURE__ */ ((N) => (N.CONTENT_CHANGES = "changes", N.PAGE_RELOAD = "page-reload", N.IFRAME_SCROLL = "iframe-scroll", N.CONTENTLET_HOVERED = "contentlet-hovered", N.CONTENTLET_CLICKED = "contentlet-clicked", N.SCROLL_TO_SECTION = "scroll-to-section", N.SELECTION_CLEARED = "selection-cleared", N.AUTO_BOUNDS = "auto-bounds", N))(O || {});
1
+ var N = /* @__PURE__ */ ((I) => (I.EDIT = "EDIT_MODE", I.PREVIEW = "PREVIEW_MODE", I.LIVE = "LIVE", I.UNKNOWN = "UNKNOWN", I))(N || {});
2
2
  export {
3
- O as UVEEventType,
4
- r as UVE_MODE
3
+ N as UVE_MODE
5
4
  };
@@ -1,6 +1,5 @@
1
1
  import { UVE_MODE as t } from "../../../../types/src/lib/editor/public.js";
2
- import "../../internal/constants.js";
3
- function p() {
2
+ function g() {
4
3
  if (typeof window > "u" || window.parent === window || !window.location)
5
4
  return;
6
5
  const e = new URL(window.location.href), o = Object.values(t);
@@ -17,5 +16,5 @@ function p() {
17
16
  };
18
17
  }
19
18
  export {
20
- p as getUVEState
19
+ g as getUVEState
21
20
  };
@@ -1,4 +0,0 @@
1
- var u = /* @__PURE__ */ ((e) => (e.UVE_RELOAD_PAGE = "uve-reload-page", e.UVE_FLUSH_BOUNDS = "uve-flush-bounds", e.UVE_REQUEST_BOUNDS = "uve-request-bounds", e.UVE_EDITOR_PONG = "uve-editor-pong", e.UVE_SCROLL_INSIDE_IFRAME = "uve-scroll-inside-iframe", e.UVE_SET_PAGE_DATA = "uve-set-page-data", e.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS = "uve-copy-contentlet-inline-editing-success", e.UVE_SCROLL_TO_SECTION = "uve-scroll-to-section", e.UVE_SELECTION_CLEARED = "uve-selection-cleared", e))(u || {});
2
- export {
3
- u as __DOTCMS_UVE_EVENT__
4
- };
@@ -1,7 +0,0 @@
1
- import { UVEEventType as e } from "../../../types/src/lib/editor/public.js";
2
- import { onAutoBounds as o, onScrollToSection as r, onContentletClicked as t, onContentletHovered as E, onIframeScroll as C, onPageReload as T, onContentChanges as O } from "./events.js";
3
- e.CONTENT_CHANGES + "", e.PAGE_RELOAD + "", e.IFRAME_SCROLL + "", e.CONTENTLET_HOVERED + "", e.CONTENTLET_CLICKED + "", e.SCROLL_TO_SECTION + "", e.SELECTION_CLEARED + "", e.AUTO_BOUNDS + "";
4
- const L = "dot-section-";
5
- export {
6
- L as DOT_SECTION_ID_PREFIX
7
- };
@@ -1,5 +0,0 @@
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
- };