@ishibashi0112/spreadsheet-grid-core 1.0.1 → 1.0.2

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.
Files changed (103) hide show
  1. package/dist/controllers/autoHeightMeasurer.cjs +1 -1
  2. package/dist/controllers/autoHeightMeasurer.js +4 -2
  3. package/dist/controllers/clipboardController.cjs +1 -2
  4. package/dist/controllers/clipboardController.js +26 -26
  5. package/dist/controllers/columnAutosizeRunner.cjs +1 -1
  6. package/dist/controllers/columnAutosizeRunner.d.ts +2 -1
  7. package/dist/controllers/columnAutosizeRunner.js +11 -10
  8. package/dist/controllers/columnHeaderDragController.cjs +1 -1
  9. package/dist/controllers/columnHeaderDragController.js +176 -171
  10. package/dist/controllers/columnMenuController.cjs +1 -1
  11. package/dist/controllers/columnMenuController.js +1 -1
  12. package/dist/controllers/editController.cjs +1 -1
  13. package/dist/controllers/editController.js +78 -78
  14. package/dist/controllers/escapeClaimController.cjs +1 -1
  15. package/dist/controllers/escapeClaimController.d.ts +1 -0
  16. package/dist/controllers/escapeClaimController.js +11 -5
  17. package/dist/controllers/fillHandleController.cjs +1 -1
  18. package/dist/controllers/fillHandleController.js +141 -140
  19. package/dist/controllers/filterPopoverController.cjs +1 -1
  20. package/dist/controllers/filterPopoverController.js +81 -77
  21. package/dist/controllers/findController.cjs +1 -1
  22. package/dist/controllers/findController.d.ts +1 -0
  23. package/dist/controllers/findController.js +36 -29
  24. package/dist/controllers/keyboardController.cjs +1 -1
  25. package/dist/controllers/keyboardController.js +112 -116
  26. package/dist/controllers/popoverSupport.cjs +1 -1
  27. package/dist/controllers/popoverSupport.js +10 -5
  28. package/dist/controllers/rowDragController.cjs +1 -1
  29. package/dist/controllers/rowDragController.js +128 -127
  30. package/dist/controllers/rowEnterController.cjs +1 -1
  31. package/dist/controllers/rowEnterController.d.ts +1 -0
  32. package/dist/controllers/rowEnterController.js +47 -42
  33. package/dist/controllers/tooltipController.cjs +1 -1
  34. package/dist/controllers/tooltipController.js +64 -47
  35. package/dist/controllers/viewportSyncController.cjs +1 -1
  36. package/dist/controllers/viewportSyncController.d.ts +1 -0
  37. package/dist/controllers/viewportSyncController.js +29 -8
  38. package/dist/engine/filterPopoverCommands.cjs +1 -1
  39. package/dist/engine/filterPopoverCommands.d.ts +2 -0
  40. package/dist/engine/filterPopoverCommands.js +15 -15
  41. package/dist/engine/fullFeatures.cjs +1 -1
  42. package/dist/engine/fullFeatures.js +17 -17
  43. package/dist/engine/gridApi.cjs +2 -2
  44. package/dist/engine/gridApi.d.ts +1 -0
  45. package/dist/engine/gridApi.js +11 -11
  46. package/dist/engine/rowSelectionCommands.cjs +1 -1
  47. package/dist/engine/rowSelectionCommands.d.ts +1 -0
  48. package/dist/engine/rowSelectionCommands.js +21 -12
  49. package/dist/locales/en.cjs +1 -1
  50. package/dist/locales/en.js +7 -4
  51. package/dist/logic/columnAutosize.cjs +1 -1
  52. package/dist/logic/columnAutosize.d.ts +8 -2
  53. package/dist/logic/columnAutosize.js +102 -87
  54. package/dist/logic/detailRow.cjs +1 -1
  55. package/dist/logic/detailRow.d.ts +4 -0
  56. package/dist/logic/detailRow.js +18 -15
  57. package/dist/logic/editorValues.cjs +1 -1
  58. package/dist/logic/editorValues.d.ts +1 -0
  59. package/dist/logic/editorValues.js +29 -29
  60. package/dist/logic/filterSummary.cjs +1 -1
  61. package/dist/logic/filterSummary.js +9 -2
  62. package/dist/logic/find.cjs +1 -1
  63. package/dist/logic/find.d.ts +4 -3
  64. package/dist/logic/find.js +27 -13
  65. package/dist/logic/gridAsk.cjs +2 -2
  66. package/dist/logic/gridAsk.d.ts +7 -7
  67. package/dist/logic/gridAsk.js +140 -122
  68. package/dist/logic/gridAskLocaleText.cjs +1 -1
  69. package/dist/logic/gridAskLocaleText.d.ts +2 -0
  70. package/dist/logic/gridAskLocaleText.js +1 -0
  71. package/dist/logic/gridState.d.ts +2 -2
  72. package/dist/logic/localeText.cjs +1 -1
  73. package/dist/logic/localeText.d.ts +2 -0
  74. package/dist/logic/localeText.js +1 -0
  75. package/dist/logic/localeTextFeatures.cjs +1 -1
  76. package/dist/logic/localeTextFeatures.js +2 -2
  77. package/dist/logic/localeTextFilters.cjs +1 -1
  78. package/dist/logic/localeTextFilters.d.ts +1 -0
  79. package/dist/logic/localeTextFilters.js +1 -0
  80. package/dist/logic/localeTextPopups.cjs +1 -1
  81. package/dist/logic/localeTextPopups.js +2 -2
  82. package/dist/logic/numberFilterCondition.cjs +1 -1
  83. package/dist/logic/numberFilterCondition.d.ts +1 -1
  84. package/dist/logic/numberFilterCondition.js +5 -5
  85. package/dist/logic/scrollTargets.cjs +1 -1
  86. package/dist/logic/scrollTargets.js +2 -2
  87. package/dist/logic/selectEditorState.cjs +1 -1
  88. package/dist/logic/selectEditorState.d.ts +1 -0
  89. package/dist/logic/selectEditorState.js +8 -1
  90. package/dist/logic/valueFormatters.d.ts +5 -5
  91. package/dist/logic/verticalGeometry.cjs +1 -1
  92. package/dist/logic/verticalGeometry.d.ts +1 -0
  93. package/dist/logic/verticalGeometry.js +12 -8
  94. package/dist/model/gridActions.cjs +1 -1
  95. package/dist/model/gridActions.d.ts +2 -1
  96. package/dist/model/gridActions.js +3 -2
  97. package/dist/model/gridReducer.cjs +1 -1
  98. package/dist/model/gridReducer.js +145 -62
  99. package/dist/model/gridTypes.core.d.ts +319 -298
  100. package/dist/utils/clipboard.cjs +3 -5
  101. package/dist/utils/clipboard.d.ts +1 -0
  102. package/dist/utils/clipboard.js +25 -22
  103. package/package.json +1 -1
@@ -2,15 +2,16 @@ import { resolveMoveTargetIndex as e, resolveRowDropSlot as t, resolveRowDropSlo
2
2
  import { isInsideDetailCardOf as r } from "../logic/detailRow.js";
3
3
  import { clampClientYAboveFooter as i, computeNextScrollPosition as a, hasPointerLeftActivationRadius as o, resolveAutoScrollAxisDirection as s, resolveScrollContentBox as c } from "../logic/autoScrollGeometry.js";
4
4
  import { resolveElementScale as l } from "../logic/elementScale.js";
5
- import { applySlotToElement as u } from "../logic/slotDom.js";
6
- import { syncPortalTokens as d } from "../utils/portalTokens.js";
5
+ import { beginEscapeCancelableDrag as u } from "./escapeClaimController.js";
6
+ import { applySlotToElement as d } from "../logic/slotDom.js";
7
+ import { syncPortalTokens as f } from "../utils/portalTokens.js";
7
8
  //#region src/controllers/rowDragController.ts
8
- var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"8 6 12 2 16 6\"/><polyline points=\"16 18 12 22 8 18\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", g = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", _ = 200, v = "cubic-bezier(0.2, 0.7, 0.3, 1)", y = `transform 160ms ${v}`, b = "data-ssg-row-dragging", x = (e) => e?.closest(".ssg-motion-off") != null, S = /translateY\((-?[\d.]+)px\)/, C = (e) => {
9
+ var p = 14, m = 12, h = "0.5", g = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"8 6 12 2 16 6\"/><polyline points=\"16 18 12 22 8 18\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", _ = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", v = 200, y = "cubic-bezier(0.2, 0.7, 0.3, 1)", b = `transform 160ms ${y}`, x = "data-ssg-row-dragging", S = (e) => e?.closest(".ssg-motion-off") != null, C = /translateY\((-?[\d.]+)px\)/, w = (e) => {
9
10
  let t = [];
10
11
  return e.querySelectorAll(".ssg-body-row[data-row-index]").forEach((n) => {
11
12
  r(e, n) || t.push(n);
12
13
  }), t;
13
- }, w = (e) => {
14
+ }, T = (e) => {
14
15
  let t = [], n = /* @__PURE__ */ new Map();
15
16
  return e.querySelectorAll(".ssg-detail-band[data-detail-row-index]").forEach((i) => {
16
17
  if (r(e, i)) return;
@@ -21,22 +22,22 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
21
22
  key: `band|${o}|${a}`
22
23
  });
23
24
  }), t;
24
- }, T = (e) => {
25
+ }, E = (e) => {
25
26
  e.style.transition = "", e.style.transform = "", e.style.willChange = "", e.style.zIndex = "";
26
- }, E = () => {
27
- let E = null, D = null, O = null, k = {
27
+ }, D = () => {
28
+ let D = null, O = null, k = null, A = {
28
29
  x: 0,
29
30
  y: 0
30
- }, A = null, j = !1, M = null, N = null, P = null, F = null, I = null, L = null, R = 0, z = null, B = () => E?.motion === "live", V = null, H = null, U = null, W = () => [
31
- E?.leftIndicatorRef.current ?? null,
32
- E?.centerIndicatorRef.current ?? null,
33
- E?.rightIndicatorRef.current ?? null
34
- ], G = () => {
35
- for (let e of W()) e && (e.style.display = "none");
36
- }, K = (e) => {
37
- if (V) return;
31
+ }, j = null, M = !1, N = null, P = null, F = null, I = null, L = null, R = null, z = 0, B = null, V = () => D?.motion === "live", H = null, U = null, W = null, G = () => [
32
+ D?.leftIndicatorRef.current ?? null,
33
+ D?.centerIndicatorRef.current ?? null,
34
+ D?.rightIndicatorRef.current ?? null
35
+ ], K = () => {
36
+ for (let e of G()) e && (e.style.display = "none");
37
+ }, ee = (e) => {
38
+ if (H) return;
38
39
  let t = document.createElement("div");
39
- t.setAttribute("data-grid-drag-ghost", ""), E?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), E?.scrollContainerRef.current?.closest(".ssg-theme-class") != null && t.classList.add("ssg-theme-class"), E?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
40
+ t.setAttribute("data-grid-drag-ghost", ""), D?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), D?.scrollContainerRef.current?.closest(".ssg-theme-class") != null && t.classList.add("ssg-theme-class"), D?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
40
41
  "position:fixed",
41
42
  "top:0",
42
43
  "left:0",
@@ -61,53 +62,53 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
61
62
  "z-index:9999",
62
63
  "will-change:transform",
63
64
  "transform:translate(-9999px,-9999px)"
64
- ].join(";"), u(t, E?.ghostSlot);
65
+ ].join(";"), d(t, D?.ghostSlot);
65
66
  let n = document.createElement("span");
66
67
  n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
67
68
  let r = document.createElement("span");
68
- r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), d(E?.scrollContainerRef.current, t), V = t, H = n, U = null;
69
- }, ee = (e) => {
70
- let t = V;
69
+ r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), f(D?.scrollContainerRef.current, t), H = t, U = n, W = null;
70
+ }, te = (e) => {
71
+ let t = H;
71
72
  if (!t) return;
72
- t.style.transform = "translate(" + (k.x + f) + "px," + (k.y + p) + "px)";
73
+ t.style.transform = "translate(" + (A.x + p) + "px," + (A.y + m) + "px)";
73
74
  let n = e ? "move" : "out";
74
- if (U === n) return;
75
- U = n;
76
- let r = H;
77
- n === "out" ? (t.style.opacity = m, r && (r.innerHTML = g)) : (t.style.opacity = "1", r && (r.innerHTML = h));
75
+ if (W === n) return;
76
+ W = n;
77
+ let r = U;
78
+ n === "out" ? (t.style.opacity = h, r && (r.innerHTML = _)) : (t.style.opacity = "1", r && (r.innerHTML = g));
78
79
  }, q = () => {
79
- V && V.parentNode && V.parentNode.removeChild(V), V = null, H = null, U = null;
80
+ H && H.parentNode && H.parentNode.removeChild(H), H = null, U = null, W = null;
80
81
  }, J = (e, t) => {
81
- let n = E?.scrollContainerRef.current ?? null;
82
- !n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${b}]`).forEach((e) => {
83
- r(n, e) || (t ? e.setAttribute(b, B() ? "live" : "") : e.removeAttribute(b));
82
+ let n = D?.scrollContainerRef.current ?? null;
83
+ !n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${x}]`).forEach((e) => {
84
+ r(n, e) || (t ? e.setAttribute(x, V() ? "live" : "") : e.removeAttribute(x));
84
85
  });
85
- }, te = () => {
86
- let e = E?.scrollContainerRef.current ?? null;
86
+ }, ne = () => {
87
+ let e = D?.scrollContainerRef.current ?? null;
87
88
  if (!e) return null;
88
89
  let t = /* @__PURE__ */ new Map();
89
- for (let n of C(e)) {
90
- let e = S.exec(n.style.transform);
90
+ for (let n of w(e)) {
91
+ let e = C.exec(n.style.transform);
91
92
  e && t.set(n, {
92
93
  index: Number(n.getAttribute("data-row-index")),
93
94
  baseY: parseFloat(e[1])
94
95
  });
95
96
  }
96
97
  return t;
97
- }, ne = (t) => {
98
- let n = L, r = D;
99
- if (!n || r === null || E === null) return;
100
- let i = E.scrollContainerRef.current;
98
+ }, re = (t) => {
99
+ let n = R, r = O;
100
+ if (!n || r === null || D === null) return;
101
+ let i = D.scrollContainerRef.current;
101
102
  if (!i) return;
102
- for (let e of C(i)) {
103
+ for (let e of w(i)) {
103
104
  if (n.has(e)) continue;
104
- let t = S.exec(e.style.transform);
105
+ let t = C.exec(e.style.transform);
105
106
  t && n.set(e, {
106
107
  index: Number(e.getAttribute("data-row-index")),
107
108
  baseY: parseFloat(t[1])
108
109
  });
109
110
  }
110
- let a = E.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - R) * E.verticalScaleFactor, s = (A ? k.y - A.y : 0) + o, c = t === null ? null : e(r, t);
111
+ let a = D.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - z) * D.verticalScaleFactor, s = (j ? A.y - j.y : 0) + o, c = t === null ? null : e(r, t);
111
112
  n.forEach((e, t) => {
112
113
  let { index: i, baseY: o } = e;
113
114
  if (!t.isConnected) {
@@ -119,25 +120,25 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
119
120
  return;
120
121
  }
121
122
  let l = 0;
122
- c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = y, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
123
+ c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = b, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
123
124
  });
124
- let l = z ?? /* @__PURE__ */ new Set();
125
- z = l;
126
- for (let { el: e, index: t } of w(i)) {
125
+ let l = B ?? /* @__PURE__ */ new Set();
126
+ B = l;
127
+ for (let { el: e, index: t } of T(i)) {
127
128
  if (l.add(e), t === r) {
128
129
  e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", e.style.zIndex = "10";
129
130
  continue;
130
131
  }
131
132
  let n = 0;
132
- c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition = y, e.style.transform = `translateY(${n}px)`, e.style.zIndex = "";
133
+ c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition = b, e.style.transform = `translateY(${n}px)`, e.style.zIndex = "";
133
134
  }
134
- }, re = (e, r) => {
135
- if (E === null) return null;
136
- let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } = E, d = a.current, f = o.current;
135
+ }, ie = (e, r) => {
136
+ if (D === null) return null;
137
+ let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } = D, d = a.current, f = o.current;
137
138
  if (!d || !f) return null;
138
139
  let p = d.getBoundingClientRect();
139
140
  if (e < p.left || e > p.right || r < p.top || r > p.bottom) return null;
140
- let m = i(r, p.top + d.clientTop + d.clientHeight, E.footerHeight ?? 0), h = f.getBoundingClientRect(), g = f.scrollTop + m - h.top - c - d.scrollTop * (1 - l), _ = t(g, s), v = D, y = v !== null && B() ? s.detailHeight(v) : 0;
141
+ let m = i(r, p.top + d.clientTop + d.clientHeight, D.footerHeight ?? 0), h = f.getBoundingClientRect(), g = f.scrollTop + m - h.top - c - d.scrollTop * (1 - l), _ = t(g, s), v = O, y = v !== null && V() ? s.detailHeight(v) : 0;
141
142
  if (v !== null && y > 0) {
142
143
  let e = t(g + y, s);
143
144
  e > v + 1 && (_ = e);
@@ -148,24 +149,24 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
148
149
  top: c + b - u
149
150
  };
150
151
  }, Y = () => {
151
- let t = re(k.x, k.y), n = D;
152
- if (B()) {
153
- t && n !== null && (O = e(n, t.slot) === null ? null : t.slot), G(), ne(O);
152
+ let t = ie(A.x, A.y), n = O;
153
+ if (V()) {
154
+ t && n !== null && (k = e(n, t.slot) === null ? null : t.slot), K(), re(k);
154
155
  return;
155
156
  }
156
- if (ee(t), !t || n === null || e(n, t.slot) === null) {
157
- O = null, G();
157
+ if (te(t), !t || n === null || e(n, t.slot) === null) {
158
+ k = null, K();
158
159
  return;
159
160
  }
160
- O = t.slot;
161
- for (let e of W()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
161
+ k = t.slot;
162
+ for (let e of G()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
162
163
  }, X = () => {
163
- if (D === null) {
164
- P = null;
164
+ if (O === null) {
165
+ F = null;
165
166
  return;
166
167
  }
167
- let e = E?.scrollContainerRef.current ?? null;
168
- if (e && (j || (!A || o(A, k, 6)) && (j = !0), j)) {
168
+ let e = D?.scrollContainerRef.current ?? null;
169
+ if (e && (M || (!j || o(j, A, 6)) && (M = !0), M)) {
169
170
  let t = e.getBoundingClientRect(), n = c({
170
171
  rectLeft: t.left,
171
172
  rectTop: t.top,
@@ -174,32 +175,32 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
174
175
  clientWidth: e.clientWidth,
175
176
  clientHeight: e.clientHeight,
176
177
  scale: l(e, t)
177
- }), r = s(k.y, n.top, n.bottom - (E?.footerHeight ?? 0), 24), i = a(e.scrollTop, r, 18, e.scrollHeight - e.clientHeight);
178
+ }), r = s(A.y, n.top, n.bottom - (D?.footerHeight ?? 0), 24), i = a(e.scrollTop, r, 18, e.scrollHeight - e.clientHeight);
178
179
  i !== e.scrollTop && e.scrollTo({
179
180
  top: i,
180
181
  behavior: "auto"
181
182
  });
182
183
  }
183
- Y(), P = requestAnimationFrame(X);
184
+ Y(), F = requestAnimationFrame(X);
184
185
  }, Z = (e, t) => `${e.getAttribute("data-pane") ?? ""}|${t}`, Q = () => {
185
- let e = E?.scrollContainerRef.current ?? null;
186
+ let e = D?.scrollContainerRef.current ?? null;
186
187
  if (!e) return null;
187
188
  let t = /* @__PURE__ */ new Map();
188
- for (let n of C(e)) t.set(Z(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
189
- for (let n of w(e)) t.set(n.key, n.el.getBoundingClientRect().top);
189
+ for (let n of w(e)) t.set(Z(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
190
+ for (let n of T(e)) t.set(n.key, n.el.getBoundingClientRect().top);
190
191
  return t;
191
192
  }, $ = (t) => {
192
- P !== null && (cancelAnimationFrame(P), P = null), document.body.style.cursor = "", G(), q();
193
- let n = D, r = O, i = I;
194
- J(n, !1), D = null, I = null, O = null, A = null, N = null;
195
- let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && E !== null, s = L;
196
- L = null;
197
- let c = s && o && E !== null && !x(E.scrollContainerRef.current) ? Q() : null, l = z;
198
- if (z = null, l && (o ? l.forEach(T) : (l.forEach((e) => {
199
- e.isConnected && (e.style.transition = y, e.style.transform = "translateY(0px)", e.style.zIndex = "");
193
+ F !== null && (cancelAnimationFrame(F), F = null), document.body.style.cursor = "", K(), q();
194
+ let n = O, r = k, i = L;
195
+ J(n, !1), O = null, L = null, k = null, j = null, P = null;
196
+ let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && D !== null, s = R;
197
+ R = null;
198
+ let c = s && o && D !== null && !S(D.scrollContainerRef.current) ? Q() : null, l = B;
199
+ if (B = null, l && (o ? l.forEach(E) : (l.forEach((e) => {
200
+ e.isConnected && (e.style.transition = b, e.style.transform = "translateY(0px)", e.style.zIndex = "");
200
201
  }), window.setTimeout(() => {
201
202
  l.forEach((e) => {
202
- z?.has(e) || T(e);
203
+ B?.has(e) || E(e);
203
204
  });
204
205
  }, 200))), s) if (o) s.forEach(({ baseY: e }, t) => {
205
206
  t.style.transition = "", t.style.willChange = "", t.isConnected && (t.style.transform = `translateY(${e}px)`);
@@ -207,131 +208,131 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
207
208
  else {
208
209
  let e = [];
209
210
  s.forEach(({ baseY: t }, n) => {
210
- n.isConnected && (n.style.transition = y, n.style.transform = `translateY(${t}px)`, e.push(n));
211
+ n.isConnected && (n.style.transition = b, n.style.transform = `translateY(${t}px)`, e.push(n));
211
212
  }), window.setTimeout(() => {
212
213
  for (let t of e) t.style.transition = "", t.style.willChange = "";
213
214
  }, 200);
214
215
  }
215
- if (!o || n === null || a === null || E === null) return;
216
- let u = c ?? (x(E.scrollContainerRef.current) ? null : Q()), d = u ? {
216
+ if (!o || n === null || a === null || D === null) return;
217
+ let u = c ?? (S(D.scrollContainerRef.current) ? null : Q()), d = u ? {
217
218
  tops: u,
218
219
  from: n,
219
220
  to: a,
220
221
  row: i
221
222
  } : null;
222
- F = d, E.commitRowMove(n, a), d && requestAnimationFrame(() => {
223
- F === d && (F = null);
223
+ I = d, D.commitRowMove(n, a), d && requestAnimationFrame(() => {
224
+ I === d && (I = null);
224
225
  });
225
- }, ie = () => {
226
- let e = F;
227
- if (F = null, !e) return;
228
- let t = E?.scrollContainerRef.current ?? null;
226
+ }, ae = () => {
227
+ let e = I;
228
+ if (I = null, !e) return;
229
+ let t = D?.scrollContainerRef.current ?? null;
229
230
  if (!t) return;
230
231
  let { tops: n, from: r, to: i } = e;
231
- if (E?.locateDragRow && e.row !== null && E.locateDragRow(e.row, i) !== i) return;
232
+ if (D?.locateDragRow && e.row !== null && D.locateDragRow(e.row, i) !== i) return;
232
233
  let a = (e) => e === i ? r : r < i && e >= r && e < i ? e + 1 : i < r && e > i && e <= r ? e - 1 : e, o = [], s = /* @__PURE__ */ new Map();
233
- C(t).forEach((e) => {
234
+ w(t).forEach((e) => {
234
235
  let t = n.get(Z(e, a(Number(e.getAttribute("data-row-index")))));
235
236
  if (t === void 0) return;
236
237
  let r = t - e.getBoundingClientRect().top;
237
238
  if (Math.abs(r) < .5) return;
238
- let i = S.exec(e.style.transform);
239
+ let i = C.exec(e.style.transform);
239
240
  if (!i) return;
240
241
  let c = parseFloat(i[1]);
241
242
  s.set(e, c), e.style.transition = "none", e.style.transform = `translateY(${c + r}px)`, e.style.willChange = "transform", o.push(e);
242
243
  });
243
244
  let c = [];
244
- if (w(t).forEach(({ el: e, index: t, key: r }) => {
245
+ if (T(t).forEach(({ el: e, index: t, key: r }) => {
245
246
  let i = a(t), o = n.get(r.slice(0, r.lastIndexOf("|") + 1) + i);
246
247
  if (o === void 0) return;
247
248
  let s = o - e.getBoundingClientRect().top;
248
249
  Math.abs(s) < .5 || (e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", c.push(e));
249
250
  }), !(o.length === 0 && c.length === 0)) {
250
251
  t.getBoundingClientRect();
251
- for (let e of o) e.style.transition = `transform ${_}ms ${v}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
252
- for (let e of c) e.style.transition = `transform ${_}ms ${v}`, e.style.transform = "translateY(0px)";
252
+ for (let e of o) e.style.transition = `transform ${v}ms ${y}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
253
+ for (let e of c) e.style.transition = `transform ${v}ms ${y}`, e.style.transform = "translateY(0px)";
253
254
  window.setTimeout(() => {
254
255
  for (let e of o) e.style.transition = "", e.style.willChange = "";
255
- for (let e of c) z?.has(e) || T(e);
256
+ for (let e of c) B?.has(e) || E(e);
256
257
  }, 280);
257
258
  }
258
- }, ae = (e, t) => {
259
- if (E === null || !E.enabled || t.button !== 0) return;
260
- if (t.stopPropagation(), t.preventDefault(), E.gridRootRef?.current?.focus({ preventScroll: !0 }), D !== null) {
261
- if (t.pointerId !== N) return;
262
- M?.(), $(!1);
259
+ }, oe = (e, t) => {
260
+ if (D === null || !D.enabled || t.button !== 0) return;
261
+ if (t.stopPropagation(), t.preventDefault(), D.gridRootRef?.current?.focus({ preventScroll: !0 }), O !== null) {
262
+ if (t.pointerId !== P) return;
263
+ N?.(), $(!1);
263
264
  }
264
- D = e, I = E.getDragRow?.(e) ?? null, N = t.pointerId, O = null, k = {
265
+ O = e, L = D.getDragRow?.(e) ?? null, P = t.pointerId, k = null, A = {
265
266
  x: t.clientX,
266
267
  y: t.clientY
267
- }, A = {
268
+ }, j = {
268
269
  x: t.clientX,
269
270
  y: t.clientY
270
- }, j = !1, document.body.style.cursor = "grabbing", B() ? (L = te(), R = E.scrollContainerRef.current?.scrollTop ?? 0) : K(E.getRowDragLabel(e)), J(e, !0);
271
+ }, M = !1, document.body.style.cursor = "grabbing", V() ? (R = ne(), z = D.scrollContainerRef.current?.scrollTop ?? 0) : ee(D.getRowDragLabel(e)), J(e, !0);
271
272
  let n = t.currentTarget, r = t.pointerId;
272
273
  try {
273
274
  n.setPointerCapture(r);
274
275
  } catch {}
275
276
  let i = (e) => {
276
- e.pointerId === r && (k = {
277
+ e.pointerId === r && (A = {
277
278
  x: e.clientX,
278
279
  y: e.clientY
279
280
  }, Y());
280
- }, a = () => {
281
- window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l), M = null;
281
+ }, a = u(), o = () => {
282
+ window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", c), window.removeEventListener("keydown", l, !0), window.removeEventListener("blur", d), a(), N = null;
282
283
  try {
283
284
  n.releasePointerCapture(r);
284
285
  } catch {}
285
286
  };
286
- function o(e) {
287
- e.pointerId === r && (a(), $(!0));
288
- }
289
287
  function s(e) {
290
- e.pointerId === r && (a(), $(!1));
288
+ e.pointerId === r && (o(), $(!0));
291
289
  }
292
290
  function c(e) {
293
- e.key === "Escape" && (a(), $(!1));
291
+ e.pointerId === r && (o(), $(!1));
292
+ }
293
+ function l(e) {
294
+ e.key === "Escape" && (o(), $(!1));
294
295
  }
295
- function l() {
296
- a(), $(!1);
296
+ function d() {
297
+ o(), $(!1);
297
298
  }
298
- window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l), M = a, Y(), P = requestAnimationFrame(X);
299
- }, oe = (e) => {
300
- if (D === null || I == null || E?.locateDragRow === void 0) return;
301
- let t = E.locateDragRow(I, D);
302
- if (L && L.forEach((e, t) => {
299
+ window.addEventListener("pointermove", i), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", c), window.addEventListener("keydown", l, !0), window.addEventListener("blur", d), N = o, Y(), F = requestAnimationFrame(X);
300
+ }, se = (e) => {
301
+ if (O === null || L == null || D?.locateDragRow === void 0) return;
302
+ let t = D.locateDragRow(L, O);
303
+ if (R && R.forEach((e, t) => {
303
304
  if (!t.isConnected) {
304
- L?.delete(t);
305
+ R?.delete(t);
305
306
  return;
306
307
  }
307
308
  let n = Number(t.getAttribute("data-row-index"));
308
309
  if (n === e.index && (e.applied === void 0 || t.style.transform === e.applied)) return;
309
- let r = S.exec(t.style.transform);
310
+ let r = C.exec(t.style.transform);
310
311
  if (!r) {
311
- L?.delete(t);
312
+ R?.delete(t);
312
313
  return;
313
314
  }
314
315
  e.index = n, e.baseY = parseFloat(r[1]), e.applied = void 0;
315
316
  }), t === null) {
316
- M?.(), $(!1);
317
+ N?.(), $(!1);
317
318
  return;
318
319
  }
319
- L && t !== D && A !== null && e !== null && (A = {
320
- x: A.x,
321
- y: A.y + E.rowMetrics.rowTop(t) - e.rowTop(D)
322
- }), t !== D && (J(null, !1), D = t, J(t, !0)), Y();
320
+ R && t !== O && j !== null && e !== null && (j = {
321
+ x: j.x,
322
+ y: j.y + D.rowMetrics.rowTop(t) - e.rowTop(O)
323
+ }), t !== O && (J(null, !1), O = t, J(t, !0)), Y();
323
324
  };
324
325
  return {
325
326
  update: (e) => {
326
- let t = E;
327
- E = e, D !== null && t !== null && t.locateDragRow !== e.locateDragRow && oe(t.rowMetrics);
327
+ let t = D;
328
+ D = e, O !== null && t !== null && t.locateDragRow !== e.locateDragRow && se(t.rowMetrics);
328
329
  },
329
- onRowDragHandlePointerDown: ae,
330
- applyReorderSettle: ie,
330
+ onRowDragHandlePointerDown: oe,
331
+ applyReorderSettle: ae,
331
332
  dispose: () => {
332
- M?.(), M = null, P !== null && (cancelAnimationFrame(P), P = null), document.body.style.cursor = "", q(), J(D, !1), D = null, I = null, O = null, L = null, z?.forEach(T), z = null, F = null;
333
+ N?.(), N = null, F !== null && (cancelAnimationFrame(F), F = null), document.body.style.cursor = "", q(), J(O, !1), O = null, L = null, k = null, R = null, B?.forEach(E), B = null, I = null;
333
334
  }
334
335
  };
335
336
  };
336
337
  //#endregion
337
- export { E as createRowDragController };
338
+ export { D as createRowDragController };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`ssg-body-row--enter`,n=`--ssg-row-enter-index`,r=12,i=1500,a=e=>Number(e.getAttribute(`data-row-index`)),o=/(?:^|;)\s*transform\s*:\s*([^;]+)/,s=e=>{if(!e)return null;let t=o.exec(e);return t?t[1].trim():null},c=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),l=`ssg-scroll-container--scrolling`,u=()=>{let r=null,o=null,u=!1,d={skeletonEnter:!1,mountEnter:!1},f=new Map,p=e=>{e.classList.remove(t),e.style.removeProperty(n);let r=f.get(e);r!==void 0&&(clearTimeout(r),f.delete(e))},m=(e,r)=>{e.style.setProperty(n,String(r)),e.classList.add(t);let a=()=>{e.removeEventListener(`animationend`,a),p(e)};e.addEventListener(`animationend`,a),f.set(e,setTimeout(()=>{e.removeEventListener(`animationend`,a),p(e)},i))},h=(e,t)=>{let n=[];for(let r of e){if(r.style.transition)continue;let e=s(t.get(r)??null),i=r.style.transform;!e||!i||e===i||n.push({el:r,from:e,to:i})}if(n.length!==0){for(let{el:e,from:t}of n)e.style.transform=t;o?.getBoundingClientRect();for(let{el:e,to:t}of n)e.style.transform=t}},g=t=>c(t)&&(o===null||!e.isInsideDetailCardOf(o,t)),_=t=>{let n=new Set,r=new Map,i=new Set,s=[];for(let l of t){if(l.type===`attributes`){let e=l.target;g(e)&&!r.has(e)&&r.set(e,l.oldValue);continue}let t=o!==null&&l.target instanceof Element&&e.isInsideDetailCardOf(o,l.target);l.removedNodes.forEach(e=>{t||!c(e)||(e.hasAttribute(`data-skeleton-row`)?n.add(a(e)):i.add(e))}),l.addedNodes.forEach(e=>{g(e)&&!e.hasAttribute(`data-skeleton-row`)&&s.push(e)})}if(s.length===0)return;let u=o?.classList.contains(l)===!0;d.mountEnter&&!u&&h(s.filter(e=>i.has(e)),r);let f=s.filter(e=>d.mountEnter&&!u&&!i.has(e)||d.skeletonEnter&&n.has(a(e)));if(f.length===0)return;let p=Array.from(new Set(f.map(a))).sort((e,t)=>e-t),_=new Map;p.forEach((e,t)=>{_.set(e,Math.min(t,12))});for(let e of f)m(e,_.get(a(e))??0)},v=()=>{r?.disconnect(),r=null,o=null,u=!1;for(let e of Array.from(f.keys()))p(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:n})=>{d={skeletonEnter:t,mountEnter:n};let i=t||n?e.current:null;i===o&&n===u||(v(),!(!i||typeof MutationObserver>`u`)&&(r=new MutationObserver(_),r.observe(i,n?{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`],attributeOldValue:!0}:{childList:!0,subtree:!0}),o=i,u=n))},dispose:v}};exports.ROW_ENTER_CLASS_NAME=t,exports.ROW_ENTER_FALLBACK_MS=i,exports.ROW_ENTER_INDEX_VAR=n,exports.ROW_ENTER_STAGGER_CAP=r,exports.createRowEnterController=u,exports.transformOfStyleText=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`ssg-body-row--enter`,n=`--ssg-row-enter-index`,r=12,i=1500,a=1e3,o=e=>Number(e.getAttribute(`data-row-index`)),s=/(?:^|;)\s*transform\s*:\s*([^;]+)/,c=e=>{if(!e)return null;let t=s.exec(e);return t?t[1].trim():null},l=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),u=`ssg-scroll-container--scrolling`,d=()=>{let r=null,s=null,d=!1,f={skeletonEnter:!1,mountEnter:!1},p=new Map,m=-1/0,h=e=>{e.classList.remove(t),e.style.removeProperty(n);let r=p.get(e);r!==void 0&&(clearTimeout(r),p.delete(e))},g=(e,r)=>{e.style.setProperty(n,String(r)),e.classList.add(t);let a=()=>{e.removeEventListener(`animationend`,a),h(e)};e.addEventListener(`animationend`,a),p.set(e,setTimeout(()=>{e.removeEventListener(`animationend`,a),h(e)},i))},_=(e,t)=>{let n=[];for(let r of e){if(r.style.transition)continue;let e=c(t.get(r)??null),i=r.style.transform;!e||!i||e===i||n.push({el:r,from:e,to:i})}if(n.length!==0){for(let{el:e,from:t}of n)e.style.transform=t;s?.getBoundingClientRect();for(let{el:e,to:t}of n)e.style.transform=t}},v=t=>l(t)&&(s===null||!e.isInsideDetailCardOf(s,t)),y=t=>{let n=new Set,r=new Map,i=new Set,c=[];for(let a of t){if(a.type===`attributes`){let e=a.target;v(e)&&!r.has(e)&&r.set(e,a.oldValue);continue}let t=s!==null&&a.target instanceof Element&&e.isInsideDetailCardOf(s,a.target);a.removedNodes.forEach(e=>{t||!l(e)||(e.hasAttribute(`data-skeleton-row`)?n.add(o(e)):i.add(e))}),a.addedNodes.forEach(e=>{v(e)&&!e.hasAttribute(`data-skeleton-row`)&&c.push(e)})}if(c.length===0)return;let d=s?.classList.contains(u)===!0;f.mountEnter&&!d&&_(c.filter(e=>i.has(e)),r);let p=f.mountEnter&&!d;if(p&&c.some(e=>!i.has(e))){let e=Date.now();p=e-m>=a,m=e}let h=c.filter(e=>p&&!i.has(e)||f.skeletonEnter&&n.has(o(e)));if(h.length===0)return;let y=Array.from(new Set(h.map(o))).sort((e,t)=>e-t),b=new Map;y.forEach((e,t)=>{b.set(e,Math.min(t,12))});for(let e of h)g(e,b.get(o(e))??0)},b=()=>{r?.disconnect(),r=null,s=null,d=!1;for(let e of Array.from(p.keys()))h(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:n})=>{f={skeletonEnter:t,mountEnter:n};let i=t||n?e.current:null;i===s&&n===d||(b(),!(!i||typeof MutationObserver>`u`)&&(r=new MutationObserver(y),r.observe(i,n?{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`],attributeOldValue:!0}:{childList:!0,subtree:!0}),s=i,d=n))},dispose:b}};exports.ROW_ENTER_CLASS_NAME=t,exports.ROW_ENTER_FALLBACK_MS=i,exports.ROW_ENTER_INDEX_VAR=n,exports.ROW_ENTER_LIVE_WINDOW_MS=a,exports.ROW_ENTER_STAGGER_CAP=r,exports.createRowEnterController=d,exports.transformOfStyleText=c;
@@ -14,6 +14,7 @@ export declare const ROW_ENTER_CLASS_NAME = "ssg-body-row--enter";
14
14
  export declare const ROW_ENTER_INDEX_VAR = "--ssg-row-enter-index";
15
15
  export declare const ROW_ENTER_STAGGER_CAP = 12;
16
16
  export declare const ROW_ENTER_FALLBACK_MS = 1500;
17
+ export declare const ROW_ENTER_LIVE_WINDOW_MS = 1000;
17
18
  export declare const transformOfStyleText: (styleText: string | null) => string | null;
18
19
  export declare const createRowEnterController: () => RowEnterController;
19
20
  export {};
@@ -1,30 +1,30 @@
1
1
  import { isInsideDetailCardOf as e } from "../logic/detailRow.js";
2
2
  //#region src/controllers/rowEnterController.ts
3
- var t = "ssg-body-row--enter", n = "--ssg-row-enter-index", r = 12, i = 1500, a = (e) => Number(e.getAttribute("data-row-index")), o = /(?:^|;)\s*transform\s*:\s*([^;]+)/, s = (e) => {
3
+ var t = "ssg-body-row--enter", n = "--ssg-row-enter-index", r = 12, i = 1500, a = 1e3, o = (e) => Number(e.getAttribute("data-row-index")), s = /(?:^|;)\s*transform\s*:\s*([^;]+)/, c = (e) => {
4
4
  if (!e) return null;
5
- let t = o.exec(e);
5
+ let t = s.exec(e);
6
6
  return t ? t[1].trim() : null;
7
- }, c = (e) => e instanceof HTMLElement && e.classList.contains("ssg-body-row"), l = "ssg-scroll-container--scrolling", u = () => {
8
- let r = null, o = null, u = !1, d = {
7
+ }, l = (e) => e instanceof HTMLElement && e.classList.contains("ssg-body-row"), u = "ssg-scroll-container--scrolling", d = () => {
8
+ let r = null, s = null, d = !1, f = {
9
9
  skeletonEnter: !1,
10
10
  mountEnter: !1
11
- }, f = /* @__PURE__ */ new Map(), p = (e) => {
11
+ }, p = /* @__PURE__ */ new Map(), m = -Infinity, h = (e) => {
12
12
  e.classList.remove(t), e.style.removeProperty(n);
13
- let r = f.get(e);
14
- r !== void 0 && (clearTimeout(r), f.delete(e));
15
- }, m = (e, r) => {
13
+ let r = p.get(e);
14
+ r !== void 0 && (clearTimeout(r), p.delete(e));
15
+ }, g = (e, r) => {
16
16
  e.style.setProperty(n, String(r)), e.classList.add(t);
17
17
  let a = () => {
18
- e.removeEventListener("animationend", a), p(e);
18
+ e.removeEventListener("animationend", a), h(e);
19
19
  };
20
- e.addEventListener("animationend", a), f.set(e, setTimeout(() => {
21
- e.removeEventListener("animationend", a), p(e);
20
+ e.addEventListener("animationend", a), p.set(e, setTimeout(() => {
21
+ e.removeEventListener("animationend", a), h(e);
22
22
  }, i));
23
- }, h = (e, t) => {
23
+ }, _ = (e, t) => {
24
24
  let n = [];
25
25
  for (let r of e) {
26
26
  if (r.style.transition) continue;
27
- let e = s(t.get(r) ?? null), i = r.style.transform;
27
+ let e = c(t.get(r) ?? null), i = r.style.transform;
28
28
  !e || !i || e === i || n.push({
29
29
  el: r,
30
30
  from: e,
@@ -33,46 +33,51 @@ var t = "ssg-body-row--enter", n = "--ssg-row-enter-index", r = 12, i = 1500, a
33
33
  }
34
34
  if (n.length !== 0) {
35
35
  for (let { el: e, from: t } of n) e.style.transform = t;
36
- o?.getBoundingClientRect();
36
+ s?.getBoundingClientRect();
37
37
  for (let { el: e, to: t } of n) e.style.transform = t;
38
38
  }
39
- }, g = (t) => c(t) && (o === null || !e(o, t)), _ = (t) => {
40
- let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [];
41
- for (let l of t) {
42
- if (l.type === "attributes") {
43
- let e = l.target;
44
- g(e) && !r.has(e) && r.set(e, l.oldValue);
39
+ }, v = (t) => l(t) && (s === null || !e(s, t)), y = (t) => {
40
+ let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), c = [];
41
+ for (let a of t) {
42
+ if (a.type === "attributes") {
43
+ let e = a.target;
44
+ v(e) && !r.has(e) && r.set(e, a.oldValue);
45
45
  continue;
46
46
  }
47
- let t = o !== null && l.target instanceof Element && e(o, l.target);
48
- l.removedNodes.forEach((e) => {
49
- t || !c(e) || (e.hasAttribute("data-skeleton-row") ? n.add(a(e)) : i.add(e));
50
- }), l.addedNodes.forEach((e) => {
51
- g(e) && !e.hasAttribute("data-skeleton-row") && s.push(e);
47
+ let t = s !== null && a.target instanceof Element && e(s, a.target);
48
+ a.removedNodes.forEach((e) => {
49
+ t || !l(e) || (e.hasAttribute("data-skeleton-row") ? n.add(o(e)) : i.add(e));
50
+ }), a.addedNodes.forEach((e) => {
51
+ v(e) && !e.hasAttribute("data-skeleton-row") && c.push(e);
52
52
  });
53
53
  }
54
- if (s.length === 0) return;
55
- let u = o?.classList.contains(l) === !0;
56
- d.mountEnter && !u && h(s.filter((e) => i.has(e)), r);
57
- let f = s.filter((e) => d.mountEnter && !u && !i.has(e) || d.skeletonEnter && n.has(a(e)));
58
- if (f.length === 0) return;
59
- let p = Array.from(new Set(f.map(a))).sort((e, t) => e - t), _ = /* @__PURE__ */ new Map();
60
- p.forEach((e, t) => {
61
- _.set(e, Math.min(t, 12));
54
+ if (c.length === 0) return;
55
+ let d = s?.classList.contains(u) === !0;
56
+ f.mountEnter && !d && _(c.filter((e) => i.has(e)), r);
57
+ let p = f.mountEnter && !d;
58
+ if (p && c.some((e) => !i.has(e))) {
59
+ let e = Date.now();
60
+ p = e - m >= a, m = e;
61
+ }
62
+ let h = c.filter((e) => p && !i.has(e) || f.skeletonEnter && n.has(o(e)));
63
+ if (h.length === 0) return;
64
+ let y = Array.from(new Set(h.map(o))).sort((e, t) => e - t), b = /* @__PURE__ */ new Map();
65
+ y.forEach((e, t) => {
66
+ b.set(e, Math.min(t, 12));
62
67
  });
63
- for (let e of f) m(e, _.get(a(e)) ?? 0);
64
- }, v = () => {
65
- r?.disconnect(), r = null, o = null, u = !1;
66
- for (let e of Array.from(f.keys())) p(e);
68
+ for (let e of h) g(e, b.get(o(e)) ?? 0);
69
+ }, b = () => {
70
+ r?.disconnect(), r = null, s = null, d = !1;
71
+ for (let e of Array.from(p.keys())) h(e);
67
72
  };
68
73
  return {
69
74
  update: ({ scrollContainerRef: e, skeletonEnter: t, mountEnter: n }) => {
70
- d = {
75
+ f = {
71
76
  skeletonEnter: t,
72
77
  mountEnter: n
73
78
  };
74
79
  let i = t || n ? e.current : null;
75
- i === o && n === u || (v(), !(!i || typeof MutationObserver > "u") && (r = new MutationObserver(_), r.observe(i, n ? {
80
+ i === s && n === d || (b(), !(!i || typeof MutationObserver > "u") && (r = new MutationObserver(y), r.observe(i, n ? {
76
81
  childList: !0,
77
82
  subtree: !0,
78
83
  attributes: !0,
@@ -81,10 +86,10 @@ var t = "ssg-body-row--enter", n = "--ssg-row-enter-index", r = 12, i = 1500, a
81
86
  } : {
82
87
  childList: !0,
83
88
  subtree: !0
84
- }), o = i, u = n));
89
+ }), s = i, d = n));
85
90
  },
86
- dispose: v
91
+ dispose: b
87
92
  };
88
93
  };
89
94
  //#endregion
90
- export { t as ROW_ENTER_CLASS_NAME, i as ROW_ENTER_FALLBACK_MS, n as ROW_ENTER_INDEX_VAR, r as ROW_ENTER_STAGGER_CAP, u as createRowEnterController, s as transformOfStyleText };
95
+ export { t as ROW_ENTER_CLASS_NAME, i as ROW_ENTER_FALLBACK_MS, n as ROW_ENTER_INDEX_VAR, a as ROW_ENTER_LIVE_WINDOW_MS, r as ROW_ENTER_STAGGER_CAP, d as createRowEnterController, c as transformOfStyleText };