@gridsheet/react-core 3.0.0-rc.9 → 3.0.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.
Files changed (140) hide show
  1. package/README.md +39 -1
  2. package/dist/components/Cell.d.ts.map +1 -0
  3. package/dist/components/CellStateOverlay.d.ts.map +1 -0
  4. package/dist/components/ColumnMenu.d.ts.map +1 -0
  5. package/dist/components/ColumnMenuFilterSection.d.ts.map +1 -0
  6. package/dist/components/ColumnMenuLabelSection.d.ts.map +1 -0
  7. package/dist/components/ColumnMenuSortSection.d.ts.map +1 -0
  8. package/dist/components/ContextMenu.d.ts.map +1 -0
  9. package/dist/components/Editor.d.ts.map +1 -0
  10. package/dist/components/EditorOptions.d.ts.map +1 -0
  11. package/dist/components/Emitter.d.ts.map +1 -0
  12. package/dist/components/Fixed.d.ts.map +1 -0
  13. package/dist/components/FormulaBar.d.ts.map +1 -0
  14. package/dist/{react-core/src/components → components}/FunctionGuide.d.ts +1 -2
  15. package/dist/components/FunctionGuide.d.ts.map +1 -0
  16. package/dist/components/GridSheet.d.ts.map +1 -0
  17. package/dist/components/HeaderCellLeft.d.ts.map +1 -0
  18. package/dist/components/HeaderCellTop.d.ts.map +1 -0
  19. package/dist/components/MenuItem.d.ts.map +1 -0
  20. package/dist/components/PluginBase.d.ts.map +1 -0
  21. package/dist/components/Resizer.d.ts.map +1 -0
  22. package/dist/components/RowMenu.d.ts.map +1 -0
  23. package/dist/components/ScrollHandle.d.ts.map +1 -0
  24. package/dist/components/SearchBar.d.ts.map +1 -0
  25. package/dist/components/StoreObserver.d.ts.map +1 -0
  26. package/dist/components/Tabular.d.ts.map +1 -0
  27. package/dist/components/svg/AddIcon.d.ts.map +1 -0
  28. package/dist/components/svg/Base.d.ts.map +1 -0
  29. package/dist/components/svg/CloseIcon.d.ts.map +1 -0
  30. package/dist/components/svg/SearchIcon.d.ts.map +1 -0
  31. package/dist/{react-core/src/components → components}/useAutocomplete.d.ts +1 -3
  32. package/dist/components/useAutocomplete.d.ts.map +1 -0
  33. package/dist/{hooks-6pHKH3g9.mjs → hooks-Y7BI_RNj.mjs} +141 -147
  34. package/dist/hooks-Y7BI_RNj.mjs.map +1 -0
  35. package/dist/index.d.ts +17 -2
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +441 -457
  38. package/dist/index.js.map +1 -1
  39. package/dist/{react-core/src/lib → lib}/clipboard.d.ts +1 -1
  40. package/dist/lib/clipboard.d.ts.map +1 -0
  41. package/dist/lib/events.d.ts.map +1 -0
  42. package/dist/{react-core/src/lib → lib}/hooks.d.ts +1 -1
  43. package/dist/lib/hooks.d.ts.map +1 -0
  44. package/dist/{react-core/src/lib → lib}/menu.d.ts +1 -1
  45. package/dist/lib/menu.d.ts.map +1 -0
  46. package/dist/lib/paste.d.ts.map +1 -0
  47. package/dist/lib/style.d.ts.map +1 -0
  48. package/dist/policy/checkbox.d.ts +3 -0
  49. package/dist/policy/checkbox.d.ts.map +1 -0
  50. package/dist/spellbook.d.ts +6 -2
  51. package/dist/spellbook.d.ts.map +1 -0
  52. package/dist/spellbook.js +1 -1
  53. package/dist/{react-core/src/store → store}/actions.d.ts +1 -1
  54. package/dist/store/actions.d.ts.map +1 -0
  55. package/dist/store/applyers.d.ts.map +1 -0
  56. package/dist/{react-core/src/store → store}/helpers.d.ts +1 -1
  57. package/dist/store/helpers.d.ts.map +1 -0
  58. package/dist/store/index.d.ts.map +1 -0
  59. package/dist/{react-core/src/types.d.ts → types.d.ts} +2 -5
  60. package/dist/types.d.ts.map +1 -0
  61. package/package.json +3 -4
  62. package/dist/hooks-6pHKH3g9.mjs.map +0 -1
  63. package/dist/react-core/src/components/Cell.d.ts.map +0 -1
  64. package/dist/react-core/src/components/CellStateOverlay.d.ts.map +0 -1
  65. package/dist/react-core/src/components/ColumnMenu.d.ts.map +0 -1
  66. package/dist/react-core/src/components/ColumnMenuFilterSection.d.ts.map +0 -1
  67. package/dist/react-core/src/components/ColumnMenuLabelSection.d.ts.map +0 -1
  68. package/dist/react-core/src/components/ColumnMenuSortSection.d.ts.map +0 -1
  69. package/dist/react-core/src/components/ContextMenu.d.ts.map +0 -1
  70. package/dist/react-core/src/components/Editor.d.ts.map +0 -1
  71. package/dist/react-core/src/components/EditorOptions.d.ts.map +0 -1
  72. package/dist/react-core/src/components/Emitter.d.ts.map +0 -1
  73. package/dist/react-core/src/components/Fixed.d.ts.map +0 -1
  74. package/dist/react-core/src/components/FormulaBar.d.ts.map +0 -1
  75. package/dist/react-core/src/components/FunctionGuide.d.ts.map +0 -1
  76. package/dist/react-core/src/components/GridSheet.d.ts.map +0 -1
  77. package/dist/react-core/src/components/HeaderCellLeft.d.ts.map +0 -1
  78. package/dist/react-core/src/components/HeaderCellTop.d.ts.map +0 -1
  79. package/dist/react-core/src/components/MenuItem.d.ts.map +0 -1
  80. package/dist/react-core/src/components/PluginBase.d.ts.map +0 -1
  81. package/dist/react-core/src/components/Resizer.d.ts.map +0 -1
  82. package/dist/react-core/src/components/RowMenu.d.ts.map +0 -1
  83. package/dist/react-core/src/components/ScrollHandle.d.ts.map +0 -1
  84. package/dist/react-core/src/components/SearchBar.d.ts.map +0 -1
  85. package/dist/react-core/src/components/StoreObserver.d.ts.map +0 -1
  86. package/dist/react-core/src/components/Tabular.d.ts.map +0 -1
  87. package/dist/react-core/src/components/svg/AddIcon.d.ts.map +0 -1
  88. package/dist/react-core/src/components/svg/Base.d.ts.map +0 -1
  89. package/dist/react-core/src/components/svg/CloseIcon.d.ts.map +0 -1
  90. package/dist/react-core/src/components/svg/SearchIcon.d.ts.map +0 -1
  91. package/dist/react-core/src/components/useAutocomplete.d.ts.map +0 -1
  92. package/dist/react-core/src/index.d.ts +0 -17
  93. package/dist/react-core/src/index.d.ts.map +0 -1
  94. package/dist/react-core/src/lib/clipboard.d.ts.map +0 -1
  95. package/dist/react-core/src/lib/events.d.ts.map +0 -1
  96. package/dist/react-core/src/lib/hooks.d.ts.map +0 -1
  97. package/dist/react-core/src/lib/menu.d.ts.map +0 -1
  98. package/dist/react-core/src/lib/paste.d.ts.map +0 -1
  99. package/dist/react-core/src/lib/style.d.ts.map +0 -1
  100. package/dist/react-core/src/policy/checkbox.d.ts +0 -3
  101. package/dist/react-core/src/policy/checkbox.d.ts.map +0 -1
  102. package/dist/react-core/src/spellbook.d.ts +0 -6
  103. package/dist/react-core/src/spellbook.d.ts.map +0 -1
  104. package/dist/react-core/src/store/actions.d.ts.map +0 -1
  105. package/dist/react-core/src/store/applyers.d.ts.map +0 -1
  106. package/dist/react-core/src/store/helpers.d.ts.map +0 -1
  107. package/dist/react-core/src/store/index.d.ts.map +0 -1
  108. package/dist/react-core/src/types.d.ts.map +0 -1
  109. /package/dist/{react-core/src/components → components}/Cell.d.ts +0 -0
  110. /package/dist/{react-core/src/components → components}/CellStateOverlay.d.ts +0 -0
  111. /package/dist/{react-core/src/components → components}/ColumnMenu.d.ts +0 -0
  112. /package/dist/{react-core/src/components → components}/ColumnMenuFilterSection.d.ts +0 -0
  113. /package/dist/{react-core/src/components → components}/ColumnMenuLabelSection.d.ts +0 -0
  114. /package/dist/{react-core/src/components → components}/ColumnMenuSortSection.d.ts +0 -0
  115. /package/dist/{react-core/src/components → components}/ContextMenu.d.ts +0 -0
  116. /package/dist/{react-core/src/components → components}/Editor.d.ts +0 -0
  117. /package/dist/{react-core/src/components → components}/EditorOptions.d.ts +0 -0
  118. /package/dist/{react-core/src/components → components}/Emitter.d.ts +0 -0
  119. /package/dist/{react-core/src/components → components}/Fixed.d.ts +0 -0
  120. /package/dist/{react-core/src/components → components}/FormulaBar.d.ts +0 -0
  121. /package/dist/{react-core/src/components → components}/GridSheet.d.ts +0 -0
  122. /package/dist/{react-core/src/components → components}/HeaderCellLeft.d.ts +0 -0
  123. /package/dist/{react-core/src/components → components}/HeaderCellTop.d.ts +0 -0
  124. /package/dist/{react-core/src/components → components}/MenuItem.d.ts +0 -0
  125. /package/dist/{react-core/src/components → components}/PluginBase.d.ts +0 -0
  126. /package/dist/{react-core/src/components → components}/Resizer.d.ts +0 -0
  127. /package/dist/{react-core/src/components → components}/RowMenu.d.ts +0 -0
  128. /package/dist/{react-core/src/components → components}/ScrollHandle.d.ts +0 -0
  129. /package/dist/{react-core/src/components → components}/SearchBar.d.ts +0 -0
  130. /package/dist/{react-core/src/components → components}/StoreObserver.d.ts +0 -0
  131. /package/dist/{react-core/src/components → components}/Tabular.d.ts +0 -0
  132. /package/dist/{react-core/src/components → components}/svg/AddIcon.d.ts +0 -0
  133. /package/dist/{react-core/src/components → components}/svg/Base.d.ts +0 -0
  134. /package/dist/{react-core/src/components → components}/svg/CloseIcon.d.ts +0 -0
  135. /package/dist/{react-core/src/components → components}/svg/SearchIcon.d.ts +0 -0
  136. /package/dist/{react-core/src/lib → lib}/events.d.ts +0 -0
  137. /package/dist/{react-core/src/lib → lib}/paste.d.ts +0 -0
  138. /package/dist/{react-core/src/lib → lib}/style.d.ts +0 -0
  139. /package/dist/{react-core/src/store → store}/applyers.d.ts +0 -0
  140. /package/dist/{react-core/src/store → store}/index.d.ts +0 -0
@@ -1,33 +1,27 @@
1
1
  import { useRef as V, useEffect as O, useState as K } from "react";
2
- import { createBook as ne } from "@gridsheet/core";
3
- import { areaToZone as L, zoneToArea as z, areaDiff as j, restrictZone as U, matrixShape as se, superposeArea as ie } from "@gridsheet/core/lib/spatial";
4
- import { x2c as oe, y2r as ce, a2p as N, p2a as re } from "@gridsheet/core/lib/coords";
5
- import { DEFAULT_HEIGHT as F, DEFAULT_WIDTH as k } from "@gridsheet/core/constants";
6
- import { smartScroll as $ } from "@gridsheet/core/lib/virtualization";
7
- import * as G from "@gridsheet/core/lib/operation";
8
- import { Autofill as de } from "@gridsheet/core/lib/autofill";
9
- const p = (o) => {
10
- const e = { ...o };
2
+ import { x2c as ne, y2r as se, a2p as N, Autofill as ie, areaToZone as L, zoneToArea as z, areaDiff as j, restrictZone as U, matrixShape as ce, superposeArea as oe, p2a as re, operations as G, DEFAULT_HEIGHT as F, DEFAULT_WIDTH as k, smartScroll as $, createBook as de } from "@gridsheet/core";
3
+ const p = (c) => {
4
+ const e = { ...c };
11
5
  return e.selectingZone != null && e.selectingZone.endY === -1 && e.selectingZone.endX === -1 && delete e.selectingZone, e;
12
- }, W = (o, e) => {
13
- const { choosing: s, selectingZone: t } = o;
14
- let { y: n, x: i } = s, { startY: c, startX: d, endY: r, endX: u } = t;
6
+ }, W = (c, e) => {
7
+ const { choosing: s, selectingZone: t } = c;
8
+ let { y: n, x: i } = s, { startY: o, startX: d, endY: r, endX: u } = t;
15
9
  const [l, a] = [e.numRows, e.numCols];
16
- return n > l && (n = l), i > a && (i = a), c > l && (c = l), r > l && (r = l), d > a && (d = a), u > a && (u = a), {
10
+ return n > l && (n = l), i > a && (i = a), o > l && (o = l), r > l && (r = l), d > a && (d = a), u > a && (u = a), {
17
11
  choosing: { y: n, x: i },
18
- selectingZone: { startY: c, startX: d, endY: r, endX: u }
12
+ selectingZone: { startY: o, startX: d, endY: r, endX: u }
19
13
  };
20
- }, _ = "gs-flash-overlay--active", le = 600, D = (o) => {
21
- o && (o.classList.remove(_), o.offsetWidth, o.classList.add(_), setTimeout(() => o.classList.remove(_), le));
22
- }, J = (o, e, s) => ({
23
- ...o,
14
+ }, _ = "gs-flash-overlay--active", le = 600, D = (c) => {
15
+ c && (c.classList.remove(_), c.offsetWidth, c.classList.add(_), setTimeout(() => c.classList.remove(_), le));
16
+ }, J = (c, e, s) => ({
17
+ ...c,
24
18
  sheetReactive: { current: e },
25
19
  callback: (t) => {
26
- s == null || s(t), D(o.flashRef.current);
20
+ s == null || s(t), D(c.flashRef.current);
27
21
  }
28
- }), M = (o, e) => {
22
+ }), M = (c, e) => {
29
23
  const { searchQuery: s, searchCaseSensitive: t, searchRegex: n, searchRange: i } = e;
30
- let { choosing: c } = e;
24
+ let { choosing: o } = e;
31
25
  if (!s)
32
26
  return { matchingCells: [] };
33
27
  const d = [];
@@ -44,39 +38,39 @@ const p = (o) => {
44
38
  const x = t ? s : s.toLowerCase();
45
39
  r = (w) => (t ? w : w.toLowerCase()).indexOf(x) !== -1;
46
40
  }
47
- let u = 1, l = o.bottom, a = 1, f = o.right;
41
+ let u = 1, l = c.bottom, a = 1, f = c.right;
48
42
  i && (u = i.startY, l = i.endY, a = i.startX, f = i.endX);
49
43
  for (let x = u; x <= l; x++)
50
44
  for (let w = a; w <= f; w++) {
51
- const g = o.getSerializedValue({ point: { y: x, x: w } });
52
- r(g) && d.push(`${oe(w)}${ce(x)}`);
45
+ const g = c.getSerializedValue({ point: { y: x, x: w } });
46
+ r(g) && d.push(`${ne(w)}${se(x)}`);
53
47
  }
54
48
  const m = d.length === e.matchingCells.length ? e.matchingCellIndex : 0;
55
49
  if (d.length > 0) {
56
50
  const x = d[m];
57
- c = N(x);
51
+ o = N(x);
58
52
  }
59
- return { matchingCells: d, searchQuery: s, matchingCellIndex: m, choosing: c };
60
- }, Ht = (o) => {
61
- const { sheetId: e, sheetReactive: s } = o, t = s.current;
53
+ return { matchingCells: d, searchQuery: s, matchingCellIndex: m, choosing: o };
54
+ }, Zt = (c) => {
55
+ const { sheetId: e, sheetReactive: s } = c, t = s.current;
62
56
  return !t || e === t.registry.editingSheetId ? !1 : !!t.registry.editingAddress;
63
- }, E = { startY: -1, startX: -1, endY: -1, endX: -1 }, ee = {}, Ft = (o, e) => {
57
+ }, E = { startY: -1, startX: -1, endY: -1, endX: -1 }, ee = {}, Xt = (c, e) => {
64
58
  var d, r;
65
59
  const s = ee[e.type];
66
60
  if (s == null)
67
- return o;
68
- const t = (d = o.sheetReactive.current) == null ? void 0 : d.registry;
61
+ return c;
62
+ const t = (d = c.sheetReactive.current) == null ? void 0 : d.registry;
69
63
  if ((r = t == null ? void 0 : t._strictModeCache) != null && r.has(e)) {
70
64
  const u = t._strictModeCache.get(e);
71
65
  return t._strictModeCache.delete(e), u;
72
66
  }
73
- const { callback: n, ...i } = s.reduce(o, e.value);
67
+ const { callback: n, ...i } = s.reduce(c, e.value);
74
68
  n == null || n(i);
75
- const c = { ...o, ...i };
76
- return t && (t._strictModeCache || (t._strictModeCache = /* @__PURE__ */ new Map()), t._strictModeCache.set(e, c), queueMicrotask(() => {
69
+ const o = { ...c, ...i };
70
+ return t && (t._strictModeCache || (t._strictModeCache = /* @__PURE__ */ new Map()), t._strictModeCache.set(e, o), queueMicrotask(() => {
77
71
  var u;
78
72
  (u = t._strictModeCache) == null || u.delete(e);
79
- })), c;
73
+ })), o;
80
74
  }, B = class B {
81
75
  constructor() {
82
76
  this.actionId = 1;
@@ -106,7 +100,7 @@ class ae extends h {
106
100
  };
107
101
  }
108
102
  }
109
- const kt = new ae().bind();
103
+ const Mt = new ae().bind();
110
104
  class ue extends h {
111
105
  reduce(e, s) {
112
106
  const t = s, { sheetReactive: n } = e;
@@ -117,7 +111,7 @@ class ue extends h {
117
111
  };
118
112
  }
119
113
  }
120
- const Lt = new ue().bind();
114
+ const Et = new ue().bind();
121
115
  class he extends h {
122
116
  reduce(e, s) {
123
117
  const t = s, { sheetReactive: n } = e;
@@ -128,7 +122,7 @@ class he extends h {
128
122
  };
129
123
  }
130
124
  }
131
- const Dt = new he().bind();
125
+ const Tt = new he().bind();
132
126
  class fe extends h {
133
127
  reduce(e, s) {
134
128
  const t = s, { sheetReactive: n } = e;
@@ -139,7 +133,7 @@ class fe extends h {
139
133
  };
140
134
  }
141
135
  }
142
- const Pt = new fe().bind();
136
+ const Ht = new fe().bind();
143
137
  class ge extends h {
144
138
  reduce(e, s) {
145
139
  return {
@@ -148,7 +142,7 @@ class ge extends h {
148
142
  };
149
143
  }
150
144
  }
151
- const zt = new ge().bind();
145
+ const Ft = new ge().bind();
152
146
  class Re extends h {
153
147
  reduce(e, s) {
154
148
  return {
@@ -157,10 +151,10 @@ class Re extends h {
157
151
  };
158
152
  }
159
153
  }
160
- const Bt = new Re().bind();
154
+ const kt = new Re().bind();
161
155
  class we extends h {
162
156
  reduce(e, s) {
163
- const t = new de(e, s), n = t.applied, i = L(t.wholeArea);
157
+ const t = new ie(e, s), n = t.applied, i = L(t.wholeArea);
164
158
  return {
165
159
  ...e,
166
160
  sheetReactive: { current: n },
@@ -173,7 +167,7 @@ class we extends h {
173
167
  };
174
168
  }
175
169
  }
176
- const Wt = new we().bind();
170
+ const Lt = new we().bind();
177
171
  class Se extends h {
178
172
  reduce(e, s) {
179
173
  return {
@@ -182,7 +176,7 @@ class Se extends h {
182
176
  };
183
177
  }
184
178
  }
185
- const Ut = new Se().bind();
179
+ const Dt = new Se().bind();
186
180
  class xe extends h {
187
181
  reduce(e, s) {
188
182
  return {
@@ -191,7 +185,7 @@ class xe extends h {
191
185
  };
192
186
  }
193
187
  }
194
- const _t = new xe().bind();
188
+ const Pt = new xe().bind();
195
189
  class ye extends h {
196
190
  reduce(e, s) {
197
191
  return {
@@ -200,7 +194,7 @@ class ye extends h {
200
194
  };
201
195
  }
202
196
  }
203
- const Ot = new ye().bind();
197
+ const zt = new ye().bind();
204
198
  class pe extends h {
205
199
  reduce(e, s) {
206
200
  return {
@@ -209,7 +203,7 @@ class pe extends h {
209
203
  };
210
204
  }
211
205
  }
212
- const qt = new pe().bind();
206
+ const Bt = new pe().bind();
213
207
  class me extends h {
214
208
  reduce(e, s) {
215
209
  return {
@@ -229,7 +223,7 @@ class be extends h {
229
223
  };
230
224
  }
231
225
  }
232
- const Qt = new be().bind();
226
+ const Wt = new be().bind();
233
227
  class Ae extends h {
234
228
  reduce(e, s) {
235
229
  return {
@@ -238,7 +232,7 @@ class Ae extends h {
238
232
  };
239
233
  }
240
234
  }
241
- const Vt = new Ae().bind();
235
+ const Ut = new Ae().bind();
242
236
  class Ce extends h {
243
237
  reduce(e, s) {
244
238
  return {
@@ -282,10 +276,10 @@ class Xe extends h {
282
276
  const Me = new Xe().bind();
283
277
  class Ee extends h {
284
278
  reduce(e, s) {
285
- const { choosing: t, selectingZone: n, sheetReactive: i } = e, c = i.current;
286
- if (!c)
279
+ const { choosing: t, selectingZone: n, sheetReactive: i } = e, o = i.current;
280
+ if (!o)
287
281
  return e;
288
- const { registry: d } = c, { copyingSheetId: r, copyingZone: u, cutting: l } = d, a = c.getSheetBySheetId(r);
282
+ const { registry: d } = o, { copyingSheetId: r, copyingZone: u, cutting: l } = d, a = o.getSheetBySheetId(r);
289
283
  let f = z(n);
290
284
  const m = z(u), { matrix: x, onlyValue: w } = s;
291
285
  if (l) {
@@ -301,7 +295,7 @@ class Ee extends h {
301
295
  left: t.x,
302
296
  bottom: t.y + C,
303
297
  right: t.x + v
304
- }, y = U(L(R)), X = c.move({
298
+ }, y = U(L(R)), X = o.move({
305
299
  srcSheet: a,
306
300
  src: Y,
307
301
  dst: R,
@@ -334,7 +328,7 @@ class Ee extends h {
334
328
  }
335
329
  let g, { y: S, x: Z } = t;
336
330
  if (m.top === -1) {
337
- const { rows: Y, cols: C } = se({ matrix: x, base: -1 });
331
+ const { rows: Y, cols: C } = ce({ matrix: x, base: -1 });
338
332
  f = {
339
333
  top: S,
340
334
  left: Z,
@@ -342,17 +336,17 @@ class Ee extends h {
342
336
  right: Z + C
343
337
  };
344
338
  const v = U(L(f));
345
- g = c.writeRawCellMatrix({
339
+ g = o.writeRawCellMatrix({
346
340
  point: { y: S, x: Z },
347
341
  matrix: x,
348
342
  onlyValue: w,
349
343
  undoReflection: p({
350
- sheetId: c.id,
344
+ sheetId: o.id,
351
345
  selectingZone: v,
352
346
  choosing: t
353
347
  }),
354
348
  redoReflection: p({
355
- sheetId: c.id,
349
+ sheetId: o.id,
356
350
  selectingZone: v,
357
351
  choosing: t
358
352
  })
@@ -363,10 +357,10 @@ class Ee extends h {
363
357
  let { rows: Y, cols: C } = j(m);
364
358
  if (f.top !== -1) {
365
359
  S = f.top, Z = f.left;
366
- const v = ie(f, m);
360
+ const v = oe(f, m);
367
361
  Y = v.rows, C = v.cols;
368
362
  }
369
- f = { top: S, left: Z, bottom: S + Y, right: Z + C }, g = c.copy({
363
+ f = { top: S, left: Z, bottom: S + Y, right: Z + C }, g = o.copy({
370
364
  srcSheet: a,
371
365
  src: m,
372
366
  dst: f,
@@ -443,15 +437,15 @@ class De extends h {
443
437
  const Pe = new De().bind();
444
438
  class ze extends h {
445
439
  reduce(e, s) {
446
- const { range: t, numCols: n } = s, { start: i, end: c } = t, d = e.sheetReactive.current, r = {
440
+ const { range: t, numCols: n } = s, { start: i, end: o } = t, d = e.sheetReactive.current, r = {
447
441
  startY: i,
448
442
  startX: 1,
449
- endY: c,
443
+ endY: o,
450
444
  endX: n
451
445
  };
452
446
  let u = i;
453
447
  if (d) {
454
- for (let l = i; l <= c; l++)
448
+ for (let l = i; l <= o; l++)
455
449
  if (!d.isRowFiltered(l)) {
456
450
  u = l;
457
451
  break;
@@ -469,11 +463,11 @@ class ze extends h {
469
463
  const Be = new ze().bind();
470
464
  class We extends h {
471
465
  reduce(e, s) {
472
- const { range: t, numRows: n } = s, { start: i, end: c } = t, d = e.sheetReactive.current, r = {
466
+ const { range: t, numRows: n } = s, { start: i, end: o } = t, d = e.sheetReactive.current, r = {
473
467
  startY: 1,
474
468
  startX: i,
475
469
  endY: n,
476
- endX: c
470
+ endX: o
477
471
  };
478
472
  let u = 1;
479
473
  if (d) {
@@ -510,8 +504,8 @@ class qe extends h {
510
504
  const { matchingCells: t } = e;
511
505
  let { matchingCellIndex: n, choosing: i } = e;
512
506
  if (n += s, n >= t.length ? n = 0 : n < 0 && (n = t.length - 1), t.length > 0) {
513
- const c = t[n];
514
- i = N(c);
507
+ const o = t[n];
508
+ i = N(o);
515
509
  }
516
510
  return { ...e, matchingCells: t, matchingCellIndex: n, choosing: i };
517
511
  }
@@ -520,7 +514,7 @@ const Qe = new qe().bind();
520
514
  class Ve extends h {
521
515
  reduce(e, s) {
522
516
  let { value: t, point: n } = s;
523
- const { choosing: i, selectingZone: c, sheetReactive: d } = e;
517
+ const { choosing: i, selectingZone: o, sheetReactive: d } = e;
524
518
  n == null && (n = i);
525
519
  const r = d.current;
526
520
  if (!r)
@@ -531,12 +525,12 @@ class Ve extends h {
531
525
  operator: "USER",
532
526
  undoReflection: p({
533
527
  sheetId: r.id,
534
- selectingZone: c,
528
+ selectingZone: o,
535
529
  choosing: n
536
530
  }),
537
531
  redoReflection: p({
538
532
  sheetId: r.id,
539
- selectingZone: c,
533
+ selectingZone: o,
540
534
  choosing: n
541
535
  })
542
536
  });
@@ -556,8 +550,8 @@ const je = new Ve().bind();
556
550
  class Ge extends h {
557
551
  reduce(e, s) {
558
552
  var x;
559
- const { choosing: t, selectingZone: n, sheetReactive: i } = e, c = i.current;
560
- if (!c)
553
+ const { choosing: t, selectingZone: n, sheetReactive: i } = e, o = i.current;
554
+ if (!o)
561
555
  return e;
562
556
  let d = z(n);
563
557
  if (d.top === -1) {
@@ -567,29 +561,29 @@ class Ge extends h {
567
561
  const { top: r, left: u, bottom: l, right: a } = d, f = {};
568
562
  let m = 0;
569
563
  for (let w = r; w <= l; w++)
570
- if (!c.isRowFiltered(w))
564
+ if (!o.isRowFiltered(w))
571
565
  for (let g = u; g <= a; g++) {
572
- const S = c.getCell({ y: w, x: g }, { resolution: "SYSTEM" }), Z = re({ y: w, x: g });
573
- G.hasOperation(S == null ? void 0 : S.prevention, G.Write) || ((x = c.getSystem({ y: w, x: g })) == null ? void 0 : x.spilledFrom) == null && (S == null ? void 0 : S.value) != null && (f[Z] = { value: void 0 }, m++);
566
+ const S = o.getCell({ y: w, x: g }, { resolution: "SYSTEM" }), Z = re({ y: w, x: g });
567
+ G.hasOperation(S == null ? void 0 : S.prevention, G.Write) || ((x = o.getSystem({ y: w, x: g })) == null ? void 0 : x.spilledFrom) == null && (S == null ? void 0 : S.value) != null && (f[Z] = { value: void 0 }, m++);
574
568
  }
575
- return m === 0 ? e : (c.update({
569
+ return m === 0 ? e : (o.update({
576
570
  diff: f,
577
571
  partial: !0,
578
572
  operator: "USER",
579
573
  undoReflection: p({
580
- sheetId: c.id,
574
+ sheetId: o.id,
581
575
  selectingZone: n,
582
576
  choosing: t
583
577
  }),
584
578
  redoReflection: p({
585
- sheetId: c.id,
579
+ sheetId: o.id,
586
580
  selectingZone: n,
587
581
  choosing: t
588
582
  })
589
583
  }), {
590
584
  ...e,
591
- ...M(c, e),
592
- sheetReactive: { current: c }
585
+ ...M(o, e),
586
+ sheetReactive: { current: o }
593
587
  });
594
588
  }
595
589
  }
@@ -599,7 +593,7 @@ class Ne extends h {
599
593
  const { sheetReactive: t } = e, n = t.current;
600
594
  if (!n)
601
595
  return e;
602
- const { history: i, callback: c } = n.undo();
596
+ const { history: i, callback: o } = n.undo();
603
597
  if (i == null)
604
598
  return e;
605
599
  if (i.dstSheetId !== n.id) {
@@ -610,7 +604,7 @@ class Ne extends h {
610
604
  ...i.undoReflection,
611
605
  sheetReactive: { current: r.sheetReactive.current }
612
606
  })
613
- ), D(r.flashRef.current), i.srcSheetId === n.id ? J(e, n, c) : e;
607
+ ), D(r.flashRef.current), i.srcSheetId === n.id ? J(e, n, o) : e;
614
608
  }
615
609
  return {
616
610
  ...e,
@@ -619,7 +613,7 @@ class Ne extends h {
619
613
  ...M(n, e),
620
614
  sheetReactive: { current: n },
621
615
  callback: (d) => {
622
- c == null || c(d), D(e.flashRef.current);
616
+ o == null || o(d), D(e.flashRef.current);
623
617
  }
624
618
  };
625
619
  }
@@ -630,7 +624,7 @@ class Je extends h {
630
624
  const { sheetReactive: t } = e, n = t.current;
631
625
  if (n == null)
632
626
  return e;
633
- const { history: i, newSheet: c, callback: d } = n.redo();
627
+ const { history: i, newSheet: o, callback: d } = n.redo();
634
628
  if (i == null)
635
629
  return e;
636
630
  if (i.dstSheetId !== n.id) {
@@ -659,7 +653,7 @@ const et = new Je().bind();
659
653
  class tt extends h {
660
654
  reduce(e, s) {
661
655
  var R, y, X, H;
662
- const { shiftKey: t, deltaY: n, deltaX: i, numRows: c, numCols: d } = s, { choosing: r, sheetReactive: u, tabularRef: l } = e, a = u.current;
656
+ const { shiftKey: t, deltaY: n, deltaX: i, numRows: o, numCols: d } = s, { choosing: r, sheetReactive: u, tabularRef: l } = e, a = u.current;
663
657
  if (a == null)
664
658
  return e;
665
659
  let { selectingZone: f } = e;
@@ -669,20 +663,20 @@ class tt extends h {
669
663
  f.endY === -1 ? m : f.endY,
670
664
  f.endX === -1 ? x : f.endX
671
665
  ], [T, A] = [b + n, P + i];
672
- return T < 1 || c < T || A < 1 || d < A ? e : (f = m === T && x === A ? { startY: -1, startX: -1, endY: -1, endX: -1 } : { startY: m, startX: x, endY: T, endX: A }, {
666
+ return T < 1 || o < T || A < 1 || d < A ? e : (f = m === T && x === A ? { startY: -1, startX: -1, endY: -1, endX: -1 } : { startY: m, startX: x, endY: T, endX: A }, {
673
667
  ...e,
674
668
  selectingZone: f
675
669
  });
676
670
  }
677
671
  const [w, g] = [m + n, x + i];
678
- if (w < 1 || c < w || g < 1 || d < g)
672
+ if (w < 1 || o < w || g < 1 || d < g)
679
673
  return e;
680
674
  let S = w;
681
675
  if (a.isRowFiltered(S)) {
682
676
  const b = n >= 0 ? 1 : -1;
683
- for (; S >= 1 && S <= c && a.isRowFiltered(S); )
677
+ for (; S >= 1 && S <= o && a.isRowFiltered(S); )
684
678
  S += b;
685
- if (S < 1 || S > c)
679
+ if (S < 1 || S > o)
686
680
  return e;
687
681
  }
688
682
  let { y: Z, x: I, height: Y, width: C } = e.editorRect;
@@ -712,14 +706,14 @@ class st extends h {
712
706
  reduce(e, s) {
713
707
  var H, b, P, T;
714
708
  const { numRows: t, numCols: n } = s;
715
- let { deltaY: i, deltaX: c } = s;
709
+ let { deltaY: i, deltaX: o } = s;
716
710
  const { choosing: d, selectingZone: r, sheetReactive: u, tabularRef: l } = e, a = u.current;
717
711
  if (a == null)
718
712
  return e;
719
713
  let { y: f, x: m, height: x, width: w } = e.editorRect;
720
714
  const { y: g, x: S } = d, Z = z(r), { top: I, left: Y, bottom: C, right: v } = Z;
721
- let [R, y] = [g + i, S + c];
722
- if (R < I && I !== -1 && (i = C - R, R = C, y > Y ? (y--, c--) : (c = v - y, y = v)), R > C && C !== -1 && (i = I - R, R = I, y < v ? (y++, c++) : (c = Y - y, y = Y)), y < Y && Y !== -1 && (c = v - y, y = v, R > I ? (R--, i--) : (i = C - R, R = C)), y > v && v !== -1 && (c = Y - y, y = Y, R < C ? (R++, i++) : (i = I - R, R = I)), R < 1 || t < R || y < 1 || n < y)
715
+ let [R, y] = [g + i, S + o];
716
+ if (R < I && I !== -1 && (i = C - R, R = C, y > Y ? (y--, o--) : (o = v - y, y = v)), R > C && C !== -1 && (i = I - R, R = I, y < v ? (y++, o++) : (o = Y - y, y = Y)), y < Y && Y !== -1 && (o = v - y, y = v, R > I ? (R--, i--) : (i = C - R, R = C)), y > v && v !== -1 && (o = Y - y, y = Y, R < C ? (R++, i++) : (i = I - R, R = I)), R < 1 || t < R || y < 1 || n < y)
723
717
  return e;
724
718
  if (a.isRowFiltered(R)) {
725
719
  const A = i >= 0 ? 1 : -1, q = I !== -1 ? I : 1, Q = C !== -1 ? C : t;
@@ -734,10 +728,10 @@ class st extends h {
734
728
  else if (i < 0)
735
729
  for (let A = g - 1; A >= R; A--)
736
730
  f -= ((b = a.getCell({ y: A, x: 0 }, { resolution: "SYSTEM" })) == null ? void 0 : b.height) || F;
737
- if (c > 0)
731
+ if (o > 0)
738
732
  for (let A = S; A < y; A++)
739
733
  m += ((P = a.getCell({ y: 0, x: A }, { resolution: "SYSTEM" })) == null ? void 0 : P.width) || k;
740
- else if (c < 0)
734
+ else if (o < 0)
741
735
  for (let A = S - 1; A >= y; A--)
742
736
  m -= ((T = a.getCell({ y: 0, x: A }, { resolution: "SYSTEM" })) == null ? void 0 : T.width) || k;
743
737
  const X = a.getCell({ y: R, x: y }, { resolution: "SYSTEM" });
@@ -749,7 +743,7 @@ class st extends h {
749
743
  }
750
744
  }
751
745
  const it = new st().bind();
752
- class ot extends h {
746
+ class ct extends h {
753
747
  reduce(e, s) {
754
748
  return {
755
749
  ...e,
@@ -757,10 +751,10 @@ class ot extends h {
757
751
  };
758
752
  }
759
753
  }
760
- const jt = new ot().bind();
761
- class ct extends h {
754
+ const _t = new ct().bind();
755
+ class ot extends h {
762
756
  reduce(e, s) {
763
- const { numRows: t, y: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r } = e, u = c.current;
757
+ const { numRows: t, y: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r } = e, u = o.current;
764
758
  return u == null ? e : (u.insertRows({
765
759
  y: n,
766
760
  numRows: t,
@@ -782,10 +776,10 @@ class ct extends h {
782
776
  });
783
777
  }
784
778
  }
785
- const rt = new ct().bind();
779
+ const rt = new ot().bind();
786
780
  class dt extends h {
787
781
  reduce(e, s) {
788
- const { numRows: t, y: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r, editorRef: u } = e, l = c.current;
782
+ const { numRows: t, y: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r, editorRef: u } = e, l = o.current;
789
783
  if (l == null)
790
784
  return e;
791
785
  const a = {
@@ -819,7 +813,7 @@ class dt extends h {
819
813
  const lt = new dt().bind();
820
814
  class at extends h {
821
815
  reduce(e, s) {
822
- const { numCols: t, x: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r, editorRef: u } = e, l = c.current;
816
+ const { numCols: t, x: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r, editorRef: u } = e, l = o.current;
823
817
  return l == null ? e : (l.insertCols({
824
818
  x: n,
825
819
  numCols: t,
@@ -844,7 +838,7 @@ class at extends h {
844
838
  const ut = new at().bind();
845
839
  class ht extends h {
846
840
  reduce(e, s) {
847
- const { numCols: t, x: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r } = e, u = c.current;
841
+ const { numCols: t, x: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r } = e, u = o.current;
848
842
  if (u == null)
849
843
  return e;
850
844
  const l = {
@@ -878,7 +872,7 @@ class ht extends h {
878
872
  const ft = new ht().bind();
879
873
  class gt extends h {
880
874
  reduce(e, s) {
881
- const { numRows: t, y: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r, editorRef: u } = e, l = c.current;
875
+ const { numRows: t, y: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r, editorRef: u } = e, l = o.current;
882
876
  return l == null ? e : (l.removeRows({
883
877
  y: n,
884
878
  numRows: t,
@@ -903,7 +897,7 @@ class gt extends h {
903
897
  const Rt = new gt().bind();
904
898
  class wt extends h {
905
899
  reduce(e, s) {
906
- const { numCols: t, x: n, operator: i } = s, { sheetReactive: c, selectingZone: d, choosing: r, editorRef: u } = e, l = c.current;
900
+ const { numCols: t, x: n, operator: i } = s, { sheetReactive: o, selectingZone: d, choosing: r, editorRef: u } = e, l = o.current;
907
901
  return l == null ? e : (l.removeCols({
908
902
  x: n,
909
903
  numCols: t,
@@ -928,11 +922,11 @@ class wt extends h {
928
922
  const St = new wt().bind();
929
923
  class xt extends h {
930
924
  reduce(e, s) {
931
- const { x: t, direction: n } = s, { sheetReactive: i, selectingZone: c, choosing: d } = e, r = i.current;
925
+ const { x: t, direction: n } = s, { sheetReactive: i, selectingZone: o, choosing: d } = e, r = i.current;
932
926
  if (r == null)
933
927
  return e;
934
928
  r.sortRows({ x: t, direction: n });
935
- const u = p({ sheetId: r.id, selectingZone: c, choosing: d });
929
+ const u = p({ sheetId: r.id, selectingZone: o, choosing: d });
936
930
  return r.registry.lastHistory && (r.registry.lastHistory.undoReflection = u, r.registry.lastHistory.redoReflection = u), {
937
931
  ...e,
938
932
  sheetReactive: { current: r }
@@ -942,11 +936,11 @@ class xt extends h {
942
936
  const yt = new xt().bind();
943
937
  class pt extends h {
944
938
  reduce(e, s) {
945
- const { x: t, filter: n } = s, { sheetReactive: i, selectingZone: c, choosing: d } = e, r = i.current;
939
+ const { x: t, filter: n } = s, { sheetReactive: i, selectingZone: o, choosing: d } = e, r = i.current;
946
940
  if (r == null)
947
941
  return e;
948
942
  r.filterRows({ x: t, filter: n });
949
- const u = p({ sheetId: r.id, selectingZone: c, choosing: d });
943
+ const u = p({ sheetId: r.id, selectingZone: o, choosing: d });
950
944
  r.registry.lastHistory && (r.registry.lastHistory.undoReflection = u, r.registry.lastHistory.redoReflection = u);
951
945
  let l = d;
952
946
  if (r.isRowFiltered(d.y)) {
@@ -959,7 +953,7 @@ class pt extends h {
959
953
  return {
960
954
  ...e,
961
955
  choosing: l,
962
- selectingZone: l !== d ? E : c,
956
+ selectingZone: l !== d ? E : o,
963
957
  sheetReactive: { current: r },
964
958
  callback: ({ sheetReactive: a }) => {
965
959
  const f = a.current;
@@ -980,7 +974,7 @@ class vt extends h {
980
974
  };
981
975
  }
982
976
  }
983
- const Gt = new vt().bind();
977
+ const Ot = new vt().bind();
984
978
  class bt extends h {
985
979
  reduce(e, s) {
986
980
  return {
@@ -989,7 +983,7 @@ class bt extends h {
989
983
  };
990
984
  }
991
985
  }
992
- const Kt = new bt().bind();
986
+ const qt = new bt().bind();
993
987
  class At extends h {
994
988
  reduce(e, s) {
995
989
  return {
@@ -998,7 +992,7 @@ class At extends h {
998
992
  };
999
993
  }
1000
994
  }
1001
- const Nt = new At().bind();
995
+ const Qt = new At().bind();
1002
996
  class Ct extends h {
1003
997
  reduce(e, s) {
1004
998
  return {
@@ -1007,7 +1001,7 @@ class Ct extends h {
1007
1001
  };
1008
1002
  }
1009
1003
  }
1010
- const te = new Ct().bind(), $t = {
1004
+ const te = new Ct().bind(), Vt = {
1011
1005
  blur: Ie,
1012
1006
  copy: Ze,
1013
1007
  cut: Me,
@@ -1033,77 +1027,77 @@ const te = new Ct().bind(), $t = {
1033
1027
  removeCols: St,
1034
1028
  sortRows: yt,
1035
1029
  filterRows: mt
1036
- }, Jt = () => {
1037
- const [o, e] = K(!1);
1030
+ }, jt = () => {
1031
+ const [c, e] = K(!1);
1038
1032
  return O(() => {
1039
1033
  e(!0);
1040
- }, []), o && typeof window < "u" ? { window, document } : { window: null, document: null };
1041
- }, en = (o, e = 100) => {
1042
- const s = V(o), t = V();
1034
+ }, []), c && typeof window < "u" ? { window, document } : { window: null, document: null };
1035
+ }, Gt = (c, e = 100) => {
1036
+ const s = V(c), t = V();
1043
1037
  return O(() => {
1044
- s.current = o;
1045
- }, [o]), (...n) => {
1038
+ s.current = c;
1039
+ }, [c]), (...n) => {
1046
1040
  window.clearTimeout(t.current), t.current = window.setTimeout(() => {
1047
1041
  s.current(...n);
1048
1042
  }, e);
1049
1043
  };
1050
- }, tn = (o = {}) => {
1051
- const [e, s] = K(() => ne(o)), { registry: t } = e;
1044
+ }, Kt = (c = {}) => {
1045
+ const [e, s] = K(() => de(c)), { registry: t } = e;
1052
1046
  return t.updateSheet = ve, t.transmit = (n) => {
1053
1047
  Object.assign(t, n), t.ready && requestAnimationFrame(() => s({ registry: t }));
1054
1048
  }, O(() => {
1055
- Object.assign(t, o);
1056
- }, [o]), e;
1049
+ Object.assign(t, c);
1050
+ }, [c]), e;
1057
1051
  };
1058
1052
  export {
1059
1053
  ut as A,
1060
1054
  lt as B,
1061
1055
  rt as C,
1062
- Ut as D,
1063
- Gt as E,
1064
- Kt as F,
1065
- Ht as G,
1066
- Qt as H,
1056
+ Dt as D,
1057
+ Ot as E,
1058
+ qt as F,
1059
+ Zt as G,
1060
+ Wt as H,
1067
1061
  Le as I,
1068
1062
  Oe as J,
1069
- Vt as K,
1070
- Wt as L,
1071
- Bt as M,
1063
+ Ut as K,
1064
+ Lt as L,
1065
+ kt as M,
1072
1066
  Ue as N,
1073
- en as O,
1067
+ Gt as O,
1074
1068
  Be as P,
1075
1069
  Qe as Q,
1076
- Lt as R,
1077
- Dt as S,
1078
- Pt as T,
1079
- tn as U,
1080
- Ft as V,
1081
- $t as W,
1082
- jt as a,
1070
+ Et as R,
1071
+ Tt as S,
1072
+ Ht as T,
1073
+ Kt as U,
1074
+ Xt as V,
1075
+ Vt as W,
1076
+ _t as a,
1083
1077
  ve as b,
1084
1078
  $e as c,
1085
1079
  Me as d,
1086
- kt as e,
1087
- qt as f,
1080
+ Mt as e,
1081
+ Bt as f,
1088
1082
  Ze as g,
1089
1083
  Pe as h,
1090
1084
  nt as i,
1091
1085
  Fe as j,
1092
1086
  Ke as k,
1093
1087
  it as l,
1094
- Nt as m,
1088
+ Qt as m,
1095
1089
  te as n,
1096
- _t as o,
1090
+ Pt as o,
1097
1091
  Te as p,
1098
- Ot as q,
1092
+ zt as q,
1099
1093
  et as r,
1100
- zt as s,
1094
+ Ft as s,
1101
1095
  mt as t,
1102
- Jt as u,
1096
+ jt as u,
1103
1097
  yt as v,
1104
1098
  je as w,
1105
1099
  St as x,
1106
1100
  Rt as y,
1107
1101
  ft as z
1108
1102
  };
1109
- //# sourceMappingURL=hooks-6pHKH3g9.mjs.map
1103
+ //# sourceMappingURL=hooks-Y7BI_RNj.mjs.map