@gridsheet/react-core 3.0.0-rc.1 → 3.0.0-rc.3

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 (232) hide show
  1. package/dist/components/Cell.d.ts.map +1 -1
  2. package/dist/components/ColumnMenu.d.ts.map +1 -1
  3. package/dist/components/ColumnMenuFilterSection.d.ts +5 -0
  4. package/dist/components/ColumnMenuFilterSection.d.ts.map +1 -0
  5. package/dist/components/ColumnMenuLabelSection.d.ts +5 -0
  6. package/dist/components/ColumnMenuLabelSection.d.ts.map +1 -0
  7. package/dist/components/ColumnMenuSortSection.d.ts +5 -0
  8. package/dist/components/ColumnMenuSortSection.d.ts.map +1 -0
  9. package/dist/components/ContextMenu.d.ts +0 -19
  10. package/dist/components/ContextMenu.d.ts.map +1 -1
  11. package/dist/components/Editor.d.ts.map +1 -1
  12. package/dist/components/EditorOptions.d.ts.map +1 -1
  13. package/dist/components/FormulaBar.d.ts.map +1 -1
  14. package/dist/components/FunctionGuide.d.ts +3 -2
  15. package/dist/components/FunctionGuide.d.ts.map +1 -1
  16. package/dist/components/GridSheet.d.ts +6 -4
  17. package/dist/components/GridSheet.d.ts.map +1 -1
  18. package/dist/components/HeaderCellLeft.d.ts.map +1 -1
  19. package/dist/components/HeaderCellTop.d.ts.map +1 -1
  20. package/dist/components/MenuItem.d.ts +18 -0
  21. package/dist/components/MenuItem.d.ts.map +1 -0
  22. package/dist/components/PluginBase.d.ts +2 -2
  23. package/dist/components/PluginBase.d.ts.map +1 -1
  24. package/dist/components/Resizer.d.ts.map +1 -1
  25. package/dist/components/RowMenu.d.ts.map +1 -1
  26. package/dist/components/ScrollHandle.d.ts.map +1 -1
  27. package/dist/components/SearchBar.d.ts.map +1 -1
  28. package/dist/components/StoreObserver.d.ts +7 -4
  29. package/dist/components/StoreObserver.d.ts.map +1 -1
  30. package/dist/components/Tabular.d.ts.map +1 -1
  31. package/dist/components/useAutocomplete.d.ts.map +1 -1
  32. package/dist/constants.d.ts +4 -0
  33. package/dist/constants.d.ts.map +1 -1
  34. package/dist/formula/evaluator.d.ts +36 -40
  35. package/dist/formula/evaluator.d.ts.map +1 -1
  36. package/dist/formula/formula-error.d.ts +10 -0
  37. package/dist/formula/formula-error.d.ts.map +1 -0
  38. package/dist/formula/functions/__async.d.ts +17 -12
  39. package/dist/formula/functions/__async.d.ts.map +1 -1
  40. package/dist/formula/functions/__base.d.ts +82 -23
  41. package/dist/formula/functions/__base.d.ts.map +1 -1
  42. package/dist/formula/functions/__utils.d.ts +4 -0
  43. package/dist/formula/functions/__utils.d.ts.map +1 -1
  44. package/dist/formula/functions/abs.d.ts +5 -5
  45. package/dist/formula/functions/abs.d.ts.map +1 -1
  46. package/dist/formula/functions/add.d.ts +6 -6
  47. package/dist/formula/functions/add.d.ts.map +1 -1
  48. package/dist/formula/functions/and.d.ts +5 -5
  49. package/dist/formula/functions/and.d.ts.map +1 -1
  50. package/dist/formula/functions/arrayformula.d.ts +12 -0
  51. package/dist/formula/functions/arrayformula.d.ts.map +1 -0
  52. package/dist/formula/functions/average.d.ts +5 -5
  53. package/dist/formula/functions/average.d.ts.map +1 -1
  54. package/dist/formula/functions/concat.d.ts +5 -5
  55. package/dist/formula/functions/concat.d.ts.map +1 -1
  56. package/dist/formula/functions/count.d.ts +4 -4
  57. package/dist/formula/functions/count.d.ts.map +1 -1
  58. package/dist/formula/functions/counta.d.ts +4 -4
  59. package/dist/formula/functions/counta.d.ts.map +1 -1
  60. package/dist/formula/functions/divide.d.ts +5 -4
  61. package/dist/formula/functions/divide.d.ts.map +1 -1
  62. package/dist/formula/functions/eq.d.ts +4 -4
  63. package/dist/formula/functions/eq.d.ts.map +1 -1
  64. package/dist/formula/functions/gt.d.ts +5 -5
  65. package/dist/formula/functions/gt.d.ts.map +1 -1
  66. package/dist/formula/functions/gte.d.ts +5 -5
  67. package/dist/formula/functions/gte.d.ts.map +1 -1
  68. package/dist/formula/functions/if.d.ts +5 -5
  69. package/dist/formula/functions/if.d.ts.map +1 -1
  70. package/dist/formula/functions/iferror.d.ts +7 -9
  71. package/dist/formula/functions/iferror.d.ts.map +1 -1
  72. package/dist/formula/functions/len.d.ts +5 -5
  73. package/dist/formula/functions/len.d.ts.map +1 -1
  74. package/dist/formula/functions/lt.d.ts +5 -5
  75. package/dist/formula/functions/lt.d.ts.map +1 -1
  76. package/dist/formula/functions/lte.d.ts +5 -5
  77. package/dist/formula/functions/lte.d.ts.map +1 -1
  78. package/dist/formula/functions/max.d.ts +5 -5
  79. package/dist/formula/functions/max.d.ts.map +1 -1
  80. package/dist/formula/functions/min.d.ts +5 -5
  81. package/dist/formula/functions/min.d.ts.map +1 -1
  82. package/dist/formula/functions/minus.d.ts +6 -6
  83. package/dist/formula/functions/minus.d.ts.map +1 -1
  84. package/dist/formula/functions/multiply.d.ts +5 -5
  85. package/dist/formula/functions/multiply.d.ts.map +1 -1
  86. package/dist/formula/functions/ne.d.ts +4 -4
  87. package/dist/formula/functions/ne.d.ts.map +1 -1
  88. package/dist/formula/functions/not.d.ts +5 -5
  89. package/dist/formula/functions/not.d.ts.map +1 -1
  90. package/dist/formula/functions/now.d.ts +4 -4
  91. package/dist/formula/functions/now.d.ts.map +1 -1
  92. package/dist/formula/functions/or.d.ts +5 -5
  93. package/dist/formula/functions/or.d.ts.map +1 -1
  94. package/dist/formula/functions/power.d.ts +5 -5
  95. package/dist/formula/functions/power.d.ts.map +1 -1
  96. package/dist/formula/functions/sum.d.ts +5 -5
  97. package/dist/formula/functions/sum.d.ts.map +1 -1
  98. package/dist/formula/functions/uminus.d.ts +5 -5
  99. package/dist/formula/functions/uminus.d.ts.map +1 -1
  100. package/dist/formula/mapping.d.ts +4 -3
  101. package/dist/formula/mapping.d.ts.map +1 -1
  102. package/dist/formula/solver.d.ts +28 -15
  103. package/dist/formula/solver.d.ts.map +1 -1
  104. package/dist/index.d.ts +25 -23
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +7875 -8226
  107. package/dist/index.js.map +1 -1
  108. package/dist/lib/autofill.d.ts +3 -3
  109. package/dist/lib/autofill.d.ts.map +1 -1
  110. package/dist/lib/{hub.d.ts → book.d.ts} +30 -45
  111. package/dist/lib/book.d.ts.map +1 -0
  112. package/dist/lib/cell.d.ts +6 -4
  113. package/dist/lib/cell.d.ts.map +1 -1
  114. package/dist/lib/clipboard.d.ts +16 -1
  115. package/dist/lib/clipboard.d.ts.map +1 -1
  116. package/dist/lib/coords.d.ts +13 -1
  117. package/dist/lib/coords.d.ts.map +1 -1
  118. package/dist/lib/dom.d.ts +7 -0
  119. package/dist/lib/dom.d.ts.map +1 -0
  120. package/dist/lib/input.d.ts +11 -2
  121. package/dist/lib/input.d.ts.map +1 -1
  122. package/dist/lib/label.d.ts +4 -0
  123. package/dist/lib/label.d.ts.map +1 -0
  124. package/dist/lib/menu.d.ts +99 -0
  125. package/dist/lib/menu.d.ts.map +1 -0
  126. package/dist/lib/operation.d.ts +0 -3
  127. package/dist/lib/operation.d.ts.map +1 -1
  128. package/dist/lib/popup.d.ts +24 -0
  129. package/dist/lib/popup.d.ts.map +1 -0
  130. package/dist/lib/reference.d.ts +10 -4
  131. package/dist/lib/reference.d.ts.map +1 -1
  132. package/dist/lib/sheet.d.ts +507 -2
  133. package/dist/lib/sheet.d.ts.map +1 -1
  134. package/dist/lib/sheet_utils.d.ts +55 -0
  135. package/dist/lib/sheet_utils.d.ts.map +1 -0
  136. package/dist/lib/spatial.d.ts +5 -20
  137. package/dist/lib/spatial.d.ts.map +1 -1
  138. package/dist/lib/time.d.ts +19 -15
  139. package/dist/lib/time.d.ts.map +1 -1
  140. package/dist/lib/virtualization.d.ts +4 -4
  141. package/dist/policy/checkbox.d.ts +3 -0
  142. package/dist/policy/checkbox.d.ts.map +1 -0
  143. package/dist/policy/core.d.ts +128 -18
  144. package/dist/policy/core.d.ts.map +1 -1
  145. package/dist/policy/thousand_separator.d.ts +4 -0
  146. package/dist/policy/thousand_separator.d.ts.map +1 -0
  147. package/dist/sentinels.d.ts +21 -4
  148. package/dist/sentinels.d.ts.map +1 -1
  149. package/dist/store/actions.d.ts +3 -3
  150. package/dist/store/actions.d.ts.map +1 -1
  151. package/dist/store/dispatchers.d.ts +38 -34
  152. package/dist/store/dispatchers.d.ts.map +1 -1
  153. package/dist/store/helpers.d.ts +13 -4
  154. package/dist/store/helpers.d.ts.map +1 -1
  155. package/dist/styles/minified.d.ts +2 -2
  156. package/dist/styles/minified.d.ts.map +1 -1
  157. package/dist/types.d.ts +59 -55
  158. package/dist/types.d.ts.map +1 -1
  159. package/package.json +1 -1
  160. package/dist/formula/functions/acos.d.ts +0 -9
  161. package/dist/formula/functions/acos.d.ts.map +0 -1
  162. package/dist/formula/functions/asin.d.ts +0 -9
  163. package/dist/formula/functions/asin.d.ts.map +0 -1
  164. package/dist/formula/functions/atan.d.ts +0 -9
  165. package/dist/formula/functions/atan.d.ts.map +0 -1
  166. package/dist/formula/functions/atan2.d.ts +0 -9
  167. package/dist/formula/functions/atan2.d.ts.map +0 -1
  168. package/dist/formula/functions/col.d.ts +0 -9
  169. package/dist/formula/functions/col.d.ts.map +0 -1
  170. package/dist/formula/functions/concatenate.d.ts +0 -9
  171. package/dist/formula/functions/concatenate.d.ts.map +0 -1
  172. package/dist/formula/functions/cos.d.ts +0 -9
  173. package/dist/formula/functions/cos.d.ts.map +0 -1
  174. package/dist/formula/functions/countif.d.ts +0 -10
  175. package/dist/formula/functions/countif.d.ts.map +0 -1
  176. package/dist/formula/functions/exp.d.ts +0 -9
  177. package/dist/formula/functions/exp.d.ts.map +0 -1
  178. package/dist/formula/functions/hlookup.d.ts +0 -10
  179. package/dist/formula/functions/hlookup.d.ts.map +0 -1
  180. package/dist/formula/functions/index.d.ts +0 -10
  181. package/dist/formula/functions/index.d.ts.map +0 -1
  182. package/dist/formula/functions/lenb.d.ts +0 -9
  183. package/dist/formula/functions/lenb.d.ts.map +0 -1
  184. package/dist/formula/functions/ln.d.ts +0 -9
  185. package/dist/formula/functions/ln.d.ts.map +0 -1
  186. package/dist/formula/functions/log.d.ts +0 -9
  187. package/dist/formula/functions/log.d.ts.map +0 -1
  188. package/dist/formula/functions/log10.d.ts +0 -9
  189. package/dist/formula/functions/log10.d.ts.map +0 -1
  190. package/dist/formula/functions/match.d.ts +0 -10
  191. package/dist/formula/functions/match.d.ts.map +0 -1
  192. package/dist/formula/functions/match.test.d.ts +0 -2
  193. package/dist/formula/functions/match.test.d.ts.map +0 -1
  194. package/dist/formula/functions/mod.d.ts +0 -9
  195. package/dist/formula/functions/mod.d.ts.map +0 -1
  196. package/dist/formula/functions/pi.d.ts +0 -9
  197. package/dist/formula/functions/pi.d.ts.map +0 -1
  198. package/dist/formula/functions/product.d.ts +0 -9
  199. package/dist/formula/functions/product.d.ts.map +0 -1
  200. package/dist/formula/functions/radians.d.ts +0 -9
  201. package/dist/formula/functions/radians.d.ts.map +0 -1
  202. package/dist/formula/functions/rand.d.ts +0 -9
  203. package/dist/formula/functions/rand.d.ts.map +0 -1
  204. package/dist/formula/functions/round.d.ts +0 -9
  205. package/dist/formula/functions/round.d.ts.map +0 -1
  206. package/dist/formula/functions/rounddown.d.ts +0 -9
  207. package/dist/formula/functions/rounddown.d.ts.map +0 -1
  208. package/dist/formula/functions/roundup.d.ts +0 -9
  209. package/dist/formula/functions/roundup.d.ts.map +0 -1
  210. package/dist/formula/functions/row.d.ts +0 -9
  211. package/dist/formula/functions/row.d.ts.map +0 -1
  212. package/dist/formula/functions/sin.d.ts +0 -9
  213. package/dist/formula/functions/sin.d.ts.map +0 -1
  214. package/dist/formula/functions/sqrt.d.ts +0 -9
  215. package/dist/formula/functions/sqrt.d.ts.map +0 -1
  216. package/dist/formula/functions/sumif.d.ts +0 -10
  217. package/dist/formula/functions/sumif.d.ts.map +0 -1
  218. package/dist/formula/functions/tan.d.ts +0 -9
  219. package/dist/formula/functions/tan.d.ts.map +0 -1
  220. package/dist/formula/functions/vlookup.d.ts +0 -10
  221. package/dist/formula/functions/vlookup.d.ts.map +0 -1
  222. package/dist/lib/hub.d.ts.map +0 -1
  223. package/dist/lib/table.d.ts +0 -463
  224. package/dist/lib/table.d.ts.map +0 -1
  225. package/dist/parsers/core.d.ts +0 -38
  226. package/dist/parsers/core.d.ts.map +0 -1
  227. package/dist/renderers/checkbox.d.ts +0 -5
  228. package/dist/renderers/checkbox.d.ts.map +0 -1
  229. package/dist/renderers/core.d.ts +0 -66
  230. package/dist/renderers/core.d.ts.map +0 -1
  231. package/dist/renderers/thousand_separator.d.ts +0 -3
  232. package/dist/renderers/thousand_separator.d.ts.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { AreaType, PointType, StoreType } from '../types';
2
- import { Table } from './table';
2
+ import { Sheet } from './sheet';
3
3
  import { CSSProperties } from 'react';
4
4
  export declare class Autofill {
5
5
  private readonly src;
6
6
  private readonly dst;
7
7
  private readonly direction;
8
- private readonly table;
8
+ private readonly sheet;
9
9
  constructor(store: StoreType, draggingTo: PointType);
10
- get applied(): Table;
10
+ get applied(): Sheet;
11
11
  get wholeArea(): AreaType;
12
12
  getCellStyle(target: PointType): CSSProperties;
13
13
  private getDestinationArea;
@@ -1 +1 @@
1
- {"version":3,"file":"autofill.d.ts","sourceRoot":"","sources":["../../src/lib/autofill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAgC,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAClB,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS;IAYnD,IAAW,OAAO,IAAI,KAAK,CAyD1B;IAED,IAAW,SAAS,aAEnB;IAEM,YAAY,CAAC,MAAM,EAAE,SAAS;IAmErC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,iBAAiB;CA6F1B"}
1
+ {"version":3,"file":"autofill.d.ts","sourceRoot":"","sources":["../../src/lib/autofill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAgC,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAClB,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS;IAYnD,IAAW,OAAO,IAAI,KAAK,CAiE1B;IAED,IAAW,SAAS,aAEnB;IAEM,YAAY,CAAC,MAAM,EAAE,SAAS;IAmErC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,iBAAiB;CA4F1B"}
@@ -1,42 +1,31 @@
1
1
  import { Pending } from '../sentinels';
2
- import { HistoryType, RefPaletteType, SheetIdsByName, ContextsBySheetId, ZoneType, CellsByIdType, Id, FeedbackType, EditorEvent, CursorStateType } from '../types';
3
- import { UserTable } from './table';
2
+ import { HistoryType, RefPaletteType, SheetIdsByName, ContextsBySheetId, ZoneType, CellsByIdType, SystemsByIdType, Id, FeedbackType, EditorEvent, CursorStateType } from '../types';
3
+ import { UserSheet } from './sheet';
4
4
  import { FunctionMapping } from '../formula/functions/__base';
5
5
  import { PolicyType } from '../policy/core';
6
- import { RendererType } from '../renderers/core';
7
- import { ParserType } from '../parsers/core';
8
- export type WireProps = {
6
+ export type RegistryProps = {
9
7
  historyLimit?: number;
10
8
  additionalFunctions?: FunctionMapping;
11
- renderers?: {
12
- [rendererName: string]: RendererType | null;
13
- };
14
- parsers?: {
15
- [parserName: string]: ParserType | null;
16
- };
17
- labelers?: {
18
- [labelerName: string]: ((n: number) => string) | null;
19
- };
20
9
  policies?: {
21
10
  [policyName: string]: PolicyType | null;
22
11
  };
23
12
  onSave?: FeedbackType;
24
13
  onChange?: FeedbackType;
25
14
  onRemoveRows?: (args: {
26
- table: UserTable;
15
+ sheet: UserSheet;
27
16
  ys: number[];
28
17
  }) => void;
29
18
  onRemoveCols?: (args: {
30
- table: UserTable;
19
+ sheet: UserSheet;
31
20
  xs: number[];
32
21
  }) => void;
33
22
  onInsertRows?: (args: {
34
- table: UserTable;
23
+ sheet: UserSheet;
35
24
  y: number;
36
25
  numRows: number;
37
26
  }) => void;
38
27
  onInsertCols?: (args: {
39
- table: UserTable;
28
+ sheet: UserSheet;
40
29
  x: number;
41
30
  numCols: number;
42
31
  }) => void;
@@ -46,14 +35,15 @@ export type WireProps = {
46
35
  points: CursorStateType;
47
36
  }) => void;
48
37
  onInit?: (args: {
49
- table: UserTable;
38
+ sheet: UserSheet;
50
39
  }) => void;
51
40
  };
52
- export type HubProps = WireProps;
53
- export declare class Wire {
41
+ export type BookProps = RegistryProps;
42
+ export declare class Registry {
54
43
  sheetHead: number;
55
44
  cellHead: number;
56
45
  data: CellsByIdType;
46
+ systems: SystemsByIdType;
57
47
  sheetIdsByName: SheetIdsByName;
58
48
  contextsBySheetId: ContextsBySheetId;
59
49
  choosingSheetId: number;
@@ -65,6 +55,8 @@ export declare class Wire {
65
55
  };
66
56
  lastFocused: HTMLTextAreaElement | null;
67
57
  solvedCaches: Map<Id, any>;
58
+ /** IDs of non-origin cells that received spilled values (populated in spill(), cleared in clearSolvedCaches()). */
59
+ lastSpilledTargetIds: Set<Id>;
68
60
  /** Currently in-flight async formula Pending sentinels (keyed by cell ID). */
69
61
  asyncPending: Map<string, Pending>;
70
62
  /** In-flight async formulas shared by cache key (for useInflight). */
@@ -82,35 +74,26 @@ export declare class Wire {
82
74
  currentHistory?: HistoryType;
83
75
  ready: boolean;
84
76
  functions: FunctionMapping;
85
- renderers: {
86
- [rendererName: string]: RendererType | null;
87
- };
88
- parsers: {
89
- [parserName: string]: ParserType | null;
90
- };
91
- labelers: {
92
- [labelerName: string]: ((n: number) => string) | null;
93
- };
94
77
  policies: {
95
78
  [policyName: string]: PolicyType | null;
96
79
  };
97
80
  onSave?: FeedbackType;
98
81
  onChange?: FeedbackType;
99
82
  onRemoveRows?: (args: {
100
- table: UserTable;
83
+ sheet: UserSheet;
101
84
  ys: number[];
102
85
  }) => void;
103
86
  onRemoveCols?: (args: {
104
- table: UserTable;
87
+ sheet: UserSheet;
105
88
  xs: number[];
106
89
  }) => void;
107
90
  onInsertRows?: (args: {
108
- table: UserTable;
91
+ sheet: UserSheet;
109
92
  y: number;
110
93
  numRows: number;
111
94
  }) => void;
112
95
  onInsertCols?: (args: {
113
- table: UserTable;
96
+ sheet: UserSheet;
114
97
  x: number;
115
98
  numCols: number;
116
99
  }) => void;
@@ -120,17 +103,19 @@ export declare class Wire {
120
103
  points: CursorStateType;
121
104
  }) => void;
122
105
  onInit?: (args: {
123
- table: UserTable;
106
+ sheet: UserSheet;
124
107
  }) => void;
125
- transmit: (newHub?: TransmitProps) => void;
126
- identifyFormula(): void;
127
- constructor({ historyLimit, additionalFunctions, renderers, parsers, labelers, policies, onSave, onChange, onRemoveRows, onRemoveCols, onInsertRows, onInsertCols, onSelect, onKeyUp, onInit, }?: WireProps);
108
+ transmit: (newBook?: TransmitProps) => void;
109
+ boot(): void;
110
+ constructor({ historyLimit, additionalFunctions, policies, onSave, onChange, onRemoveRows, onRemoveCols, onInsertRows, onInsertCols, onSelect, onKeyUp, onInit, }?: RegistryProps);
128
111
  }
129
- export type TransmitProps = Partial<Wire>;
130
- export declare const createWire: (props?: WireProps) => Wire;
131
- export type HubType = {
132
- wire: Wire;
112
+ export type TransmitProps = Partial<Registry>;
113
+ export declare const createRegistry: (props?: RegistryProps) => Registry;
114
+ /** @deprecated use createRegistry */
115
+ export declare const createBinding: (props?: RegistryProps) => Registry;
116
+ export type BookType = {
117
+ registry: Registry;
133
118
  };
134
- export declare const createHub: (props?: WireProps) => HubType;
135
- export declare const useHub: (props?: WireProps) => HubType;
136
- //# sourceMappingURL=hub.d.ts.map
119
+ export declare const createBook: (props?: RegistryProps) => BookType;
120
+ export declare const useBook: (props?: RegistryProps) => BookType;
121
+ //# sourceMappingURL=book.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/lib/book.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,eAAe,EAEf,EAAE,EAEF,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAA;KAAE,CAAC;IACvD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAA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E,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,CAAA;KAAE,KAAK,IAAI,CAAC;IAE9C,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,IAAI,CAEzC;IAEK,IAAI;gBA2BC,EACV,YAAY,EACZ,mBAAmB,EACnB,QAAa,EACb,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,GACP,GAAE,aAAkB;CAuBtB;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,GAAI,QAAO,aAAkB,aAEvD,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,aAAa,WALY,aAAa,aAKR,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAO,aAAkB,KAAG,QAEtD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,QAAO,aAAkB,aAchD,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { AsyncCache, CellType, System } from '../types';
2
2
  export declare const filterCellFields: (cell: CellType, ignoreFields: (keyof CellType)[]) => CellType;
3
3
  /**
4
- * Ensure that `cell._sys` exists, initialising it with sensible defaults
5
- * when missing. Any keys present in `defaults` that are absent on the
6
- * existing `_sys` object are filled in.
4
+ * Ensure that `registry.systems[id]` exists, initialising it with sensible
5
+ * defaults when missing. Any keys present in `defaults` that are absent on
6
+ * the existing System object are filled in.
7
7
  * Returns the (possibly freshly-created) `System` object.
8
8
  */
9
- export declare const ensureSys: (cell: CellType, defaults?: Partial<System>) => System;
9
+ export declare const ensureSys: (registry: {
10
+ systems: Record<string, System>;
11
+ }, id: string, defaults?: Partial<System>) => System;
10
12
  /**
11
13
  * Write an `AsyncCache` entry into `cell.asyncCaches[key]`, creating the
12
14
  * `asyncCaches` record if it does not yet exist.
@@ -1 +1 @@
1
- {"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/lib/cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7D,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,cAAc,CAAC,MAAM,QAAQ,CAAC,EAAE,KAAG,QAOnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,QAAQ,EAAE,WAAU,OAAO,CAAC,MAAM,CAAM,KAAG,MAS1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,EAAE,KAAK,MAAM,EAAE,IAAI,UAAU,KAAG,IAK3E,CAAC"}
1
+ {"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/lib/cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7D,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,cAAc,CAAC,MAAM,QAAQ,CAAC,EAAE,KAAG,QAOnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAC7C,IAAI,MAAM,EACV,WAAU,OAAO,CAAC,MAAM,CAAM,KAC7B,MASF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,EAAE,KAAK,MAAM,EAAE,IAAI,UAAU,KAAG,IAK3E,CAAC"}
@@ -1,3 +1,18 @@
1
- import { StoreType, AreaType } from '../types';
1
+ import { StoreType, AreaType, PointType } from '../types';
2
+ import { UserSheet } from './sheet';
2
3
  export declare const clip: (store: StoreType) => AreaType;
4
+ export type SheetCSVProps = {
5
+ getter?: (sheet: UserSheet, point: PointType) => string;
6
+ filteredRowsIncluded?: boolean;
7
+ trailingEmptyRowsOmitted?: boolean;
8
+ separator?: string;
9
+ newline?: string;
10
+ };
11
+ export declare const sheet2csv: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, separator, newline, }?: SheetCSVProps) => string;
12
+ export type SheetHTMLProps = {
13
+ getter?: (sheet: UserSheet, point: PointType) => string;
14
+ filteredRowsIncluded?: boolean;
15
+ trailingEmptyRowsOmitted?: boolean;
16
+ };
17
+ export declare const sheet2html: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, }?: SheetHTMLProps) => string;
3
18
  //# sourceMappingURL=clipboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/lib/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,UAAU,CAAC;AAK/D,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,aAsCpC,CAAC"}
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/lib/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,aAgDpC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IACxD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,OAAO,SAAS,EAChB,kFAQG,aAAkB,KACpB,MA4BF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IACxD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,OAAO,SAAS,EAChB,8DAMG,cAAmB,KACrB,MA8BF,CAAC"}
@@ -3,8 +3,20 @@ export declare const x2c: (x: number) => string;
3
3
  export declare const c2x: (col: string, absolute?: boolean) => number;
4
4
  export declare const y2r: (y: number) => string;
5
5
  export declare const r2y: (row: number | string, absolute?: boolean) => number;
6
- export declare const p2a: ({ y, x, absX, absY }: ExtraPointType) => string;
6
+ export declare const p2a: ({ y, x, absX, absY }: Partial<ExtraPointType>) => string;
7
7
  export declare const a2p: (address: Address) => ExtraPointType;
8
8
  export declare const grantAddressAbsolute: (address: Address, absCol: boolean, absRow: boolean) => string;
9
+ /**
10
+ * Returns the row header cell address for a given row number by prepending `0`.
11
+ * e.g. rh(6) → '06', rh(1) → '01'
12
+ */
13
+ export declare const rh: (y: number) => string;
14
+ /**
15
+ * Returns the column header cell address for a given column letter or column index
16
+ * (1-based, same as point.x) by appending `0`.
17
+ * e.g. ch('A') → 'A0', ch(1) → 'A0'
18
+ */
19
+ export declare const ch: (col: string | number) => string;
9
20
  export declare const stripAddressAbsolute: (address: Address) => string;
21
+ export declare const buildIdentifiedRef: (id: string, absX?: boolean, absY?: boolean) => string;
10
22
  //# sourceMappingURL=coords.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coords.d.ts","sourceRoot":"","sources":["../../src/lib/coords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,cAAc,EAAE,MAAM,UAAU,CAAC;AAwDnE,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAM/B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,kBAAgB,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAK5B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,kBAAgB,WAKzD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,sBAAsB,cAAc,WAQvD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,SAAS,OAAO,KAAG,cAWtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE,QAAQ,OAAO,WAOtF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,WAEpD,CAAC"}
1
+ {"version":3,"file":"coords.d.ts","sourceRoot":"","sources":["../../src/lib/coords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,cAAc,EAAE,MAAM,UAAU,CAAC;AAwDnE,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAM/B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,kBAAgB,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAK5B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,kBAAgB,WAKzD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,sBAAsB,OAAO,CAAC,cAAc,CAAC,WAOhE,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,SAAS,OAAO,KAAG,cAWtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE,QAAQ,OAAO,WAOtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,KAAG,MAAiB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,MAAM,GAAG,MAAM,KAAG,MAC0B,CAAC;AAErE,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,WAEpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,EAAE,cAAY,EAAE,cAAY,KAAG,MAE3E,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const focus: (el: HTMLElement | null | undefined) => void;
2
+ /**
3
+ * Prevents Safari elastic bounce (rubber-band) at scroll boundaries.
4
+ * No-op on non-Safari browsers. Returns a cleanup function to remove the listeners.
5
+ */
6
+ export declare const preventSafariBounce: (el: HTMLDivElement) => (() => void);
7
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,SAEvD,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,cAAc,KAAG,CAAC,MAAM,IAAI,CAmDnE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { PointType } from '../types';
2
- import { Table } from './table';
2
+ import { Sheet } from './sheet';
3
3
  export declare const insertTextAtCursor: (input: HTMLTextAreaElement, text: string) => void;
4
4
  type InsertRefProps = {
5
5
  input: HTMLTextAreaElement | null;
@@ -9,7 +9,16 @@ type InsertRefProps = {
9
9
  export declare const insertRef: ({ input, ref, dryRun }: InsertRefProps) => boolean;
10
10
  export declare const isRefInsertable: (input: HTMLTextAreaElement | null) => boolean;
11
11
  export declare const expandInput: (input: HTMLTextAreaElement | null) => void;
12
- export declare const resetInput: (input: HTMLTextAreaElement | null, table: Table, point: PointType) => void;
12
+ export declare const resetInput: (input: HTMLTextAreaElement | null, sheet: Sheet, point: PointType) => void;
13
13
  export declare const isFocus: (input: HTMLTextAreaElement | null) => boolean;
14
+ /**
15
+ * Handles auto-close behavior for double quotes in formula editing.
16
+ * - Typing `"` inserts `""` and places cursor between them.
17
+ * - Typing `"` when cursor is right before an auto-closed `"` skips over it.
18
+ * - Backspace between empty `""` deletes both quotes.
19
+ *
20
+ * Returns true if the event was handled (caller should preventDefault), false otherwise.
21
+ */
22
+ export declare const handleFormulaQuoteAutoClose: (e: React.KeyboardEvent<HTMLTextAreaElement>, inputting: string) => boolean;
14
23
  export {};
15
24
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/lib/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMrC,eAAO,MAAM,kBAAkB,GAAI,OAAO,mBAAmB,EAAE,MAAM,MAAM,SAQ1E,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,wBAAgC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AAC,mBAAmB,CAAC,EAC3C,WAAW,MAAM,KAChB,OAsEF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PointType } from '../types';
2
+ import { UserSheet } from './sheet';
3
+ export declare const getLabel: (sheet: UserSheet, label: string | undefined, point: PointType, n: number) => string | null;
4
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/lib/label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,EAAE,OAAO,MAAM,GAAG,SAAS,EAAE,OAAO,SAAS,EAAE,GAAG,MAAM,KAAG,MAAM,GAAG,IAM5G,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { PointType, ZoneType, FilterConfig, StoreType } from '../types';
2
+ import { UserSheet } from './sheet';
3
+ import { Dispatcher } from '../store';
4
+ import { FC } from 'react';
5
+ export type MenuContext = {
6
+ /** Current sheet instance */
7
+ sheet: UserSheet;
8
+ /** Currently focused cell */
9
+ choosing: PointType;
10
+ /** Currently selected zone */
11
+ selectingZone: ZoneType;
12
+ /** True when the left (row) header is being selected */
13
+ leftHeaderSelecting: boolean;
14
+ /** True when the top (column) header is being selected */
15
+ topHeaderSelecting: boolean;
16
+ cut(): Promise<void>;
17
+ copy(): Promise<void>;
18
+ paste(onlyValue?: boolean): Promise<void>;
19
+ undo(): void;
20
+ redo(): void;
21
+ insertRowsAbove(y: number, numRows: number): void;
22
+ insertRowsBelow(y: number, numRows: number): void;
23
+ removeRows(y: number, numRows: number): void;
24
+ insertColsLeft(x: number, numCols: number): void;
25
+ insertColsRight(x: number, numCols: number): void;
26
+ removeCols(x: number, numCols: number): void;
27
+ sortRows(x: number, direction: 'asc' | 'desc'): Promise<void>;
28
+ filterRows(x: number, filter?: FilterConfig): Promise<void>;
29
+ clearFilter(x?: number): void;
30
+ toggleSortFixed(y: number): void;
31
+ toggleFilterFixed(y: number): void;
32
+ search(): void;
33
+ updateColLabel(x: number, label: string | undefined): void;
34
+ /** Close the currently open menu */
35
+ close(): void;
36
+ };
37
+ export type MenuDividerItem = {
38
+ type: 'divider';
39
+ visible?: (ctx: MenuContext) => boolean;
40
+ };
41
+ /**
42
+ * Base structure shared by all menu item descriptors.
43
+ * `Args` is the tuple of coordinate arguments passed after `ctx`:
44
+ * - `[]` → ContextMenu (no coordinate)
45
+ * - `[y: number]` → RowMenu
46
+ * - `[x: number]` → ColMenu
47
+ */
48
+ export type MenuItemBase<Args extends unknown[] = []> = {
49
+ type?: 'item';
50
+ id?: string;
51
+ label: string | ((ctx: MenuContext, ...args: Args) => string);
52
+ shortcuts?: string[] | ((ctx: MenuContext, ...args: Args) => string[]);
53
+ visible?: (ctx: MenuContext, ...args: Args) => boolean;
54
+ disabled?: (ctx: MenuContext, ...args: Args) => boolean;
55
+ /** Render a checkmark prefix when defined. */
56
+ checked?: (ctx: MenuContext, ...args: Args) => boolean;
57
+ onClick: (ctx: MenuContext, ...args: Args) => void | Promise<void>;
58
+ };
59
+ /**
60
+ * A menu entry that renders a registered React component.
61
+ * Use `registerMenuComponent(id, Component)` to associate an id with a component,
62
+ * then reference it here as `{ type: 'component', componentId: id }`.
63
+ */
64
+ export type MenuComponentItem<Args extends unknown[] = []> = {
65
+ type: 'component';
66
+ componentId: string;
67
+ visible?: (ctx: MenuContext, ...args: Args) => boolean;
68
+ };
69
+ export type ContextMenuItemDescriptor = MenuDividerItem | MenuItemBase | MenuComponentItem;
70
+ export type RowMenuItemDescriptor = MenuDividerItem | MenuItemBase<[y: number]> | MenuComponentItem<[y: number]>;
71
+ export type ColMenuItemDescriptor = MenuDividerItem | MenuItemBase<[x: number]> | MenuComponentItem<[x: number]>;
72
+ export declare const defaultContextMenuDescriptors: ContextMenuItemDescriptor[];
73
+ export declare const defaultRowMenuDescriptors: RowMenuItemDescriptor[];
74
+ export declare const defaultColMenuDescriptors: ColMenuItemDescriptor[];
75
+ export declare function buildMenuContext(store: StoreType, dispatch: Dispatcher, close: () => void): MenuContext;
76
+ export type ContextMenuSectionProps = {
77
+ close: () => void;
78
+ };
79
+ export type RowMenuSectionProps = {
80
+ y: number;
81
+ close: () => void;
82
+ };
83
+ export type ColMenuSectionProps = {
84
+ x: number;
85
+ close: () => void;
86
+ /** Signal waiting state to parent menu. Pass null to clear. */
87
+ onWaiting?: (message: string | null, cancel?: () => void) => void;
88
+ };
89
+ /**
90
+ * Register a React component under a string id so it can be referenced in menu
91
+ * descriptors via `{ type: 'component', componentId: '...' }`.
92
+ *
93
+ * Built-in ids: `'col-filter'`, `'col-sort'`, `'col-label'`.
94
+ * You can override any built-in by registering your own component with the same id.
95
+ */
96
+ export declare function registerMenuComponent(id: string, component: FC<any>): void;
97
+ /** Look up a previously registered component by id. */
98
+ export declare function getMenuComponent(id: string): FC<any> | undefined;
99
+ //# sourceMappingURL=menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/lib/menu.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA4B3C,MAAM,MAAM,WAAW,GAAG;IACxB,6BAA6B;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,8BAA8B;IAC9B,aAAa,EAAE,QAAQ,CAAC;IACxB,wDAAwD;IACxD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0DAA0D;IAC1D,kBA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F;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAE1E;AAED,uDAAuD;AAEvD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAEhE"}
@@ -11,13 +11,10 @@ export declare const Write: operations;
11
11
  export declare const Style: operations;
12
12
  export declare const Copy: operations;
13
13
  export declare const Resize: operations;
14
- export declare const SetRenderer: operations;
15
- export declare const SetParser: operations;
16
14
  export declare const SetPolicy: operations;
17
15
  export declare const Sort: operations;
18
16
  export declare const Filter: operations;
19
17
  export declare const SetLabel: operations;
20
- export declare const SetLabeler: operations;
21
18
  export declare const NoOperation: operations;
22
19
  export declare const Move: operations;
23
20
  export declare const Update: operations;
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/lib/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,UAAoE,CAAC;AAC9F,eAAO,MAAM,UAAU,EAAE,UAAoE,CAAC;AAC9F,eAAO,MAAM,eAAe,EAAE,UAAoE,CAAC;AACnG,eAAO,MAAM,eAAe,EAAE,UAAoE,CAAC;AACnG,eAAO,MAAM,cAAc,EAAE,UAAoE,CAAC;AAClG,eAAO,MAAM,eAAe,EAAE,UAAoE,CAAC;AACnG,eAAO,MAAM,QAAQ,EAAE,UAAoE,CAAC;AAC5F,eAAO,MAAM,MAAM,EAAE,UAAoE,CAAC;AAC1F,eAAO,MAAM,KAAK,EAAE,UAAoE,CAAC;AACzF,eAAO,MAAM,KAAK,EAAE,UAAoE,CAAC;AACzF,eAAO,MAAM,IAAI,EAAE,UAAoE,CAAC;AACxF,eAAO,MAAM,MAAM,EAAE,UAAoE,CAAC;AAC1F,eAAO,MAAM,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
3
+ *
4
+ * Utility functions for computing the position of floating UI elements
5
+ * (tooltips, dropdowns, autocomplete lists, function guides, etc.)
6
+ * so they don't overflow the viewport.
7
+ */
8
+ export type HAlign = 'left' | 'right';
9
+ export type VAlign = 'top' | 'bottom';
10
+ export type PopupPosition = {
11
+ x: number;
12
+ y: number;
13
+ hAlign: HAlign;
14
+ };
15
+ export declare const calcBelowPosition: (rect: DOMRect, maxWidth?: number, margin?: number) => PopupPosition;
16
+ export declare const clampLeft: (left: number, width: number, margin?: number) => number;
17
+ export type SideStyle = {
18
+ left: string;
19
+ right: string;
20
+ };
21
+ export declare const calcSideStyle: (el: HTMLElement, gap?: number) => SideStyle;
22
+ export declare const clampPopup: (el: HTMLElement) => void;
23
+ export declare const hAlignTransform: (hAlign: HAlign) => string;
24
+ //# sourceMappingURL=popup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../../src/lib/popup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,EAAE,iBAAc,EAAE,eAAe,KAAG,aAKlF,CAAC;AAUF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,eAAe,KAAG,MAIxE,CAAC;AAgBF,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,eAAO,MAAM,aAAa,GAAI,IAAI,WAAW,EAAE,YAAY,KAAG,SAc7D,CAAC;AAYF,eAAO,MAAM,UAAU,GAAI,IAAI,WAAW,KAAG,IAW5C,CAAC;AASF,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAA6D,CAAC"}
@@ -1,13 +1,19 @@
1
1
  import { CellsByIdType, Id } from '../types';
2
- import { Table } from './table';
2
+ import { Sheet } from './sheet';
3
3
  export declare class ReferencePreserver {
4
4
  map: {
5
5
  [id: Id]: Id;
6
6
  };
7
- private table;
7
+ private sheet;
8
8
  private dependentIds;
9
- constructor(table: Table);
10
- addTheDependents(...ids: Id[]): void;
9
+ constructor(sheet: Sheet);
10
+ collectDependents(...ids: Id[]): void;
11
+ /**
12
+ * Compare two idMatrix snapshots (`before` and `after`) and populate
13
+ * `this.map` and collect dependents for every position where the occupying
14
+ * cell ID changed. Works for any rearrangement (sort, move, etc.).
15
+ */
16
+ buildMap(before: Id[], after: Id[]): void;
11
17
  resolveDependents(operation?: 'move' | 'removeRows' | 'removeCols'): CellsByIdType;
12
18
  }
13
19
  //# sourceMappingURL=reference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/lib/reference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,kBAAkB;IACtB,GAAG,EAAE;QAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAA;KAAE,CAAM;IAClC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAA0B;gBAElC,KAAK,EAAE,KAAK;IAIxB,gBAAgB,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE;IAS7B,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa;CAmBnF"}
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/lib/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,kBAAkB;IACtB,GAAG,EAAE;QAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAA;KAAE,CAAM;IAClC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAA0B;gBAElC,KAAK,EAAE,KAAK;IAIxB,iBAAiB,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE;IAQ9B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAWlC,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa;CAmBnF"}