@aiquants/spreadsheet 0.8.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 (68) hide show
  1. package/CHANGELOG.md +1103 -0
  2. package/LICENSE.md +155 -0
  3. package/README.md +817 -0
  4. package/dist/index.cjs +21 -0
  5. package/dist/index.d.cts +1960 -0
  6. package/dist/index.d.ts +1960 -0
  7. package/dist/index.js +7711 -0
  8. package/dist/styles/spreadsheet.css +2 -0
  9. package/dist/styles/spreadsheet.standalone.css +3 -0
  10. package/package.json +94 -0
  11. package/src/Spreadsheet.tsx +2313 -0
  12. package/src/clipboard/clipPayload.ts +1242 -0
  13. package/src/clipboard/fixtures/excel.fixture.ts +301 -0
  14. package/src/clipboard/fixtures/html.fixture.ts +90 -0
  15. package/src/clipboard/fixtures/sheets.fixture.ts +83 -0
  16. package/src/clipboard/htmlInterop.ts +1694 -0
  17. package/src/clipboard/numberFormatCodec.ts +870 -0
  18. package/src/clipboard/pasteSpecial.ts +608 -0
  19. package/src/clipboard/tiling.ts +370 -0
  20. package/src/clipboard/tsv.ts +186 -0
  21. package/src/clipboard/useClipboard.ts +1154 -0
  22. package/src/commands/selfCalc.ts +279 -0
  23. package/src/commands/useCommands.ts +946 -0
  24. package/src/editor/useCellEditor.ts +708 -0
  25. package/src/grid/CellView.tsx +51 -0
  26. package/src/grid/GridBody.tsx +489 -0
  27. package/src/header/ColumnHeader.tsx +167 -0
  28. package/src/header/RowHeader.tsx +144 -0
  29. package/src/header/columnName.ts +31 -0
  30. package/src/header/resizeGates.ts +146 -0
  31. package/src/header/resizeStrips.ts +79 -0
  32. package/src/header/useHeaderResize.ts +598 -0
  33. package/src/header/useHeaderSelection.ts +454 -0
  34. package/src/index.ts +122 -0
  35. package/src/keyboard/compositionGuard.ts +53 -0
  36. package/src/keyboard/ensureCellVisible.ts +77 -0
  37. package/src/keyboard/shortcuts.ts +718 -0
  38. package/src/keyboard/useGridKeyboard.ts +940 -0
  39. package/src/model/axisModel.ts +186 -0
  40. package/src/model/cellAnnotations.ts +92 -0
  41. package/src/model/cellCoord.ts +114 -0
  42. package/src/model/cellFormat.ts +562 -0
  43. package/src/model/cellPaint.ts +537 -0
  44. package/src/model/conditionalFormat.ts +805 -0
  45. package/src/model/dataAdapter.ts +478 -0
  46. package/src/model/dataValidation.ts +542 -0
  47. package/src/model/formulaRefs.ts +984 -0
  48. package/src/model/frozenPartition.ts +100 -0
  49. package/src/model/labels.ts +228 -0
  50. package/src/model/viewStore.ts +124 -0
  51. package/src/overlay/SelectionOverlay.tsx +1425 -0
  52. package/src/overlay/useFillHandle.ts +432 -0
  53. package/src/popover/CommentPopover.tsx +109 -0
  54. package/src/popover/LinkPopover.tsx +108 -0
  55. package/src/popover/ListPopover.tsx +161 -0
  56. package/src/popover/MessagePopover.tsx +36 -0
  57. package/src/popover/NotePopover.tsx +106 -0
  58. package/src/popover/NoteTip.tsx +26 -0
  59. package/src/popover/PopoverLayer.tsx +210 -0
  60. package/src/popover/placement.ts +138 -0
  61. package/src/popover/usePopovers.ts +642 -0
  62. package/src/selection/selectionState.ts +239 -0
  63. package/src/selection/useAutoScroller.ts +226 -0
  64. package/src/selection/usePointDrag.ts +273 -0
  65. package/src/selection/useSelectionEngine.ts +687 -0
  66. package/src/styles/components.entry.css +10 -0
  67. package/src/styles/spreadsheet.css +1029 -0
  68. package/src/styles/standalone.entry.css +9 -0
package/LICENSE.md ADDED
@@ -0,0 +1,155 @@
1
+ # @aiquants/spreadsheet License
2
+
3
+ Copyright © AI Quants Trading, LLC. All rights reserved.
4
+
5
+ This software is dual-licensed:
6
+
7
+ 1. **Noncommercial use** is licensed under the PolyForm Noncommercial
8
+ License 1.0.0, reproduced verbatim below. In short: personal,
9
+ research, educational, charitable, and other noncommercial purposes
10
+ are permitted free of charge, under the terms below.
11
+ 2. **Commercial use**: any use that is not a permitted (noncommercial)
12
+ purpose under the terms below requires a separate commercial license
13
+ agreement with AI Quants Trading, LLC. The terms below define the
14
+ precise scope of permitted purposes (including safe harbors for
15
+ personal uses and noncommercial organizations) — the license text
16
+ governs, not this summary. To obtain a commercial license, contact
17
+ AI Quants Trading, LLC.
18
+
19
+ Required Notice: Copyright © AI Quants Trading, LLC.
20
+
21
+ ---
22
+
23
+ <!-- markdownlint-disable MD025 MD034 -- the verbatim license text below carries its own top-level heading and a bare example URL -->
24
+
25
+ # PolyForm Noncommercial License 1.0.0
26
+
27
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
28
+
29
+ ## Acceptance
30
+
31
+ In order to get any license under these terms, you must agree
32
+ to them as both strict obligations and conditions to all
33
+ your licenses.
34
+
35
+ ## Copyright License
36
+
37
+ The licensor grants you a copyright license for the
38
+ software to do everything you might do with the software
39
+ that would otherwise infringe the licensor's copyright
40
+ in it for any permitted purpose. However, you may
41
+ only distribute the software according to [Distribution
42
+ License](#distribution-license) and make changes or new works
43
+ based on the software according to [Changes and New Works
44
+ License](#changes-and-new-works-license).
45
+
46
+ ## Distribution License
47
+
48
+ The licensor grants you an additional copyright license
49
+ to distribute copies of the software. Your license
50
+ to distribute covers distributing the software with
51
+ changes and new works permitted by [Changes and New Works
52
+ License](#changes-and-new-works-license).
53
+
54
+ ## Notices
55
+
56
+ You must ensure that anyone who gets a copy of any part of
57
+ the software from you also gets a copy of these terms or the
58
+ URL for them above, as well as copies of any plain-text lines
59
+ beginning with `Required Notice:` that the licensor provided
60
+ with the software. For example:
61
+
62
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
63
+
64
+ ## Changes and New Works License
65
+
66
+ The licensor grants you an additional copyright license to
67
+ make changes and new works based on the software for any
68
+ permitted purpose.
69
+
70
+ ## Patent License
71
+
72
+ The licensor grants you a patent license for the software that
73
+ covers patent claims the licensor can license, or becomes able
74
+ to license, that you would infringe by using the software.
75
+
76
+ ## Noncommercial Purposes
77
+
78
+ Any noncommercial purpose is a permitted purpose.
79
+
80
+ ## Personal Uses
81
+
82
+ Personal use for research, experiment, and testing for
83
+ the benefit of public knowledge, personal study, private
84
+ entertainment, hobby projects, amateur pursuits, or religious
85
+ observance, without any anticipated commercial application,
86
+ is use for a permitted purpose.
87
+
88
+ ## Noncommercial Organizations
89
+
90
+ Use by any charitable organization, educational institution,
91
+ public research organization, public safety or health
92
+ organization, environmental protection organization,
93
+ or government institution is use for a permitted purpose
94
+ regardless of the source of funding or obligations resulting
95
+ from the funding.
96
+
97
+ ## Fair Use
98
+
99
+ You may have "fair use" rights for the software under the
100
+ law. These terms do not limit them.
101
+
102
+ ## No Other Rights
103
+
104
+ These terms do not allow you to sublicense or transfer any of
105
+ your licenses to anyone else, or prevent the licensor from
106
+ granting licenses to anyone else. These terms do not imply
107
+ any other licenses.
108
+
109
+ ## Patent Defense
110
+
111
+ If you make any written claim that the software infringes or
112
+ contributes to infringement of any patent, your patent license
113
+ for the software granted under these terms ends immediately. If
114
+ your company makes such a claim, your patent license ends
115
+ immediately for work on behalf of your company.
116
+
117
+ ## Violations
118
+
119
+ The first time you are notified in writing that you have
120
+ violated any of these terms, or done anything with the software
121
+ not covered by your licenses, your licenses can nonetheless
122
+ continue if you come into full compliance with these terms,
123
+ and take practical steps to correct past violations, within
124
+ 32 days of receiving notice. Otherwise, all your licenses
125
+ end immediately.
126
+
127
+ ## No Liability
128
+
129
+ ***As far as the law allows, the software comes as is, without
130
+ any warranty or condition, and the licensor will not be liable
131
+ to you for any damages arising out of these terms or the use
132
+ or nature of the software, under any kind of legal claim.***
133
+
134
+ ## Definitions
135
+
136
+ The **licensor** is the individual or entity offering these
137
+ terms, and the **software** is the software the licensor makes
138
+ available under these terms.
139
+
140
+ **You** refers to the individual or entity agreeing to these
141
+ terms.
142
+
143
+ **Your company** is any legal entity, sole proprietorship,
144
+ or other kind of organization that you work for, plus all
145
+ organizations that have control over, are under the control of,
146
+ or are under common control with that organization. **Control**
147
+ means ownership of substantially all the assets of an entity,
148
+ or the power to direct its management and policies by vote,
149
+ contract, or otherwise. Control can be direct or indirect.
150
+
151
+ **Your licenses** are all the licenses granted to you for the
152
+ software under these terms.
153
+
154
+ **Use** means anything you do with the software requiring one
155
+ of your licenses.