@floegence/floe-webapp-core 0.74.2 → 0.75.0

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,6 +1,6 @@
1
1
  function P(h) {
2
2
  const s = document, $ = 48e3, b = 240, A = () => h.scopeStorageKey ? sessionStorage.getItem(h.scopeStorageKey) ?? "" : "", g = (o) => typeof o == "string" && o.length <= 120 && !/[;{}<>\\]|url\(|var\(/i.test(o) && CSS.supports("color", o);
3
- let l, a, C = "", d;
3
+ let l, c, C = "", d;
4
4
  try {
5
5
  const o = sessionStorage.getItem(h.storageKey), e = o && o.length <= $ ? JSON.parse(o) : void 0;
6
6
  e?.version === 1 && e.scope === A() && e.width === innerWidth && e.height === innerHeight && g(e.background) && Array.isArray(e.scroll) && e.scroll.length <= 12 && e.scroll.every((r) => Array.isArray(r) && r.length === 3 && /^[a-z0-9-]{1,48}$/.test(r[0]) && r.slice(1).every((i) => typeof i == "number" && Number.isFinite(i) && i >= 0 && i <= 1e7)) && Array.isArray(e.boxes) && e.boxes.length > 0 && e.boxes.length <= b && e.boxes.every((r) => Array.isArray(r) && r.length === 7 && r.slice(0, 5).every((i) => typeof i == "number" && Number.isFinite(i) && i >= 0 && i <= 2e4) && g(r[5]) && g(r[6])) && (d = e);
@@ -17,19 +17,19 @@ function P(h) {
17
17
  pointerEvents: "none",
18
18
  contain: "strict"
19
19
  });
20
- for (const [o, e, r, i, x, m, w] of d.boxes) {
21
- const p = s.createElement("div");
22
- Object.assign(p.style, {
20
+ for (const [o, e, r, i, m, x, w] of d.boxes) {
21
+ const f = s.createElement("div");
22
+ Object.assign(f.style, {
23
23
  position: "absolute",
24
24
  left: `${o}px`,
25
25
  top: `${e}px`,
26
26
  width: `${r}px`,
27
27
  height: `${i}px`,
28
- borderRadius: `${x}px`,
29
- backgroundColor: m,
28
+ borderRadius: `${m}px`,
29
+ backgroundColor: x,
30
30
  border: `1px solid ${w}`,
31
31
  boxSizing: "border-box"
32
- }), l.append(p);
32
+ }), l.append(f);
33
33
  }
34
34
  s.body.append(l);
35
35
  }
@@ -45,53 +45,55 @@ function P(h) {
45
45
  }
46
46
  d = void 0, l?.remove(), l = void 0;
47
47
  }, N = () => {
48
- a = void 0, y();
48
+ c = void 0, y();
49
49
  try {
50
50
  sessionStorage.removeItem(h.storageKey);
51
51
  } catch {
52
52
  }
53
53
  }, O = () => {
54
- if (!a?.isConnected || l) return;
54
+ if (!c?.isConnected || l) return;
55
55
  const o = [], e = getComputedStyle(s.body).backgroundColor;
56
56
  if (!g(e)) return;
57
57
  const r = (n) => {
58
- const t = n.getBoundingClientRect(), c = getComputedStyle(n);
59
- return t.width && t.height && t.bottom > 0 && t.right > 0 && t.top < innerHeight && t.left < innerWidth && c.visibility === "visible" ? t : null;
60
- }, i = (n, t, c = "transparent", u = 3) => {
61
- if (o.length >= b || !g(t) || !g(c)) return;
62
- const f = Math.max(0, n.x), R = Math.max(0, n.y), k = Math.min(innerWidth, n.right) - f, E = Math.min(innerHeight, n.bottom) - R;
63
- k <= 0 || E <= 0 || o.push([f, R, k, E, Math.max(0, Math.min(u, 100)), t, c]);
58
+ const t = n.getBoundingClientRect(), a = getComputedStyle(n);
59
+ return t.width && t.height && t.bottom > 0 && t.right > 0 && t.top < innerHeight && t.left < innerWidth && a.visibility === "visible" ? t : null;
60
+ }, i = (n, t, a = "transparent", u = 3) => {
61
+ if (o.length >= b || !g(t) || !g(a)) return;
62
+ const p = Math.max(0, n.x), R = Math.max(0, n.y), k = Math.min(innerWidth, n.right) - p, E = Math.min(innerHeight, n.bottom) - R;
63
+ k <= 0 || E <= 0 || o.push([p, R, k, E, Math.max(0, Math.min(u, 100)), t, a]);
64
64
  };
65
- for (const n of a.querySelectorAll(C)) {
65
+ for (const n of c.querySelectorAll(C)) {
66
+ if (n.closest("[data-floe-reload-omit]")) continue;
66
67
  const t = r(n);
67
68
  if (!t) continue;
68
- const c = getComputedStyle(n);
69
- i(t, c.backgroundColor, c.borderTopStyle === "none" ? "transparent" : c.borderTopColor, parseFloat(c.borderRadius) || 0);
69
+ const a = getComputedStyle(n);
70
+ i(t, a.backgroundColor, a.borderTopStyle === "none" ? "transparent" : a.borderTopColor, parseFloat(a.borderRadius) || 0);
70
71
  }
71
- const x = getComputedStyle(a).color, m = g(x) ? `color-mix(in srgb, ${x} 9%, ${e})` : "#d4d4d4";
72
- for (const n of a.querySelectorAll("img,svg,input,textarea,canvas,video")) {
72
+ const m = getComputedStyle(c).color, x = g(m) ? `color-mix(in srgb, ${m} 9%, ${e})` : "#d4d4d4";
73
+ for (const n of c.querySelectorAll("img,svg,input,textarea,canvas,video")) {
74
+ if (n.closest("[data-floe-reload-omit]")) continue;
73
75
  const t = r(n);
74
- t && i(t, m, "transparent", Math.min(t.height / 4, 8));
76
+ t && i(t, x, "transparent", Math.min(t.height / 4, 8));
75
77
  }
76
- const w = s.createTreeWalker(a, NodeFilter.SHOW_TEXT), p = s.createRange();
78
+ const w = s.createTreeWalker(c, NodeFilter.SHOW_TEXT), f = s.createRange();
77
79
  let S, T = 0;
78
80
  for (; (S = w.nextNode()) && o.length < b && T++ < 12e3; ) {
79
81
  const n = S.parentElement;
80
- if (!(!n || n.closest('script,style,textarea,svg,[aria-hidden="true"]') || !r(n))) {
81
- p.selectNodeContents(S);
82
- for (const t of p.getClientRects())
83
- t.width < 2 || i(new DOMRect(t.x, t.y + t.height * 0.22, t.width, t.height * 0.56), m);
82
+ if (!(!n || n.closest('script,style,textarea,svg,[aria-hidden="true"],[data-floe-reload-omit]') || !r(n))) {
83
+ f.selectNodeContents(S);
84
+ for (const t of f.getClientRects())
85
+ t.width < 2 || i(new DOMRect(t.x, t.y + t.height * 0.22, t.width, t.height * 0.56), x);
84
86
  }
85
87
  }
86
88
  if (o.length)
87
89
  try {
88
90
  const n = [];
89
- for (const u of a.querySelectorAll("[data-floe-reload-scroll]")) {
90
- const f = u.getAttribute("data-floe-reload-scroll");
91
- /^[a-z0-9-]{1,48}$/.test(f) && n.length < 12 && r(u) && n.push([f, u.scrollLeft, u.scrollTop]);
91
+ for (const u of c.querySelectorAll("[data-floe-reload-scroll]")) {
92
+ const p = u.getAttribute("data-floe-reload-scroll");
93
+ /^[a-z0-9-]{1,48}$/.test(p) && n.length < 12 && r(u) && n.push([p, u.scrollLeft, u.scrollTop]);
92
94
  }
93
- const t = { version: 1, scope: A(), width: innerWidth, height: innerHeight, background: e, boxes: o, scroll: n }, c = JSON.stringify(t);
94
- c.length <= $ && sessionStorage.setItem(h.storageKey, c);
95
+ const t = { version: 1, scope: A(), width: innerWidth, height: innerHeight, background: e, boxes: o, scroll: n }, a = JSON.stringify(t);
96
+ a.length <= $ && sessionStorage.setItem(h.storageKey, a);
95
97
  } catch {
96
98
  }
97
99
  };
@@ -104,7 +106,7 @@ function P(h) {
104
106
  },
105
107
  finish: y,
106
108
  arm(o, e) {
107
- a = o, C = e;
109
+ c = o, C = e;
108
110
  },
109
111
  clear: N
110
112
  }, window.addEventListener("pagehide", O), window.addEventListener("resize", y, { once: !0 }), window.addEventListener("pageshow", (o) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.74.2",
3
+ "version": "0.75.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",