@extend-ai/react-xlsx 0.18.0 → 0.18.1
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.
- package/README.md +50 -0
- package/dist/Carlito-OFL.txt +94 -0
- package/dist/chart-renderer-HQSQHDCB.js +5040 -0
- package/dist/chart-renderer-HQSQHDCB.js.map +1 -0
- package/dist/chart-renderer-ZUWRNNZT.cjs +5041 -0
- package/dist/chart-renderer-ZUWRNNZT.cjs.map +1 -0
- package/dist/chunk-5ERNVHSO.cjs +94 -0
- package/dist/chunk-5ERNVHSO.cjs.map +1 -0
- package/dist/chunk-BAAMDEDS.js +104 -0
- package/dist/chunk-BAAMDEDS.js.map +1 -0
- package/dist/chunk-E2VSYCP2.cjs +104 -0
- package/dist/chunk-E2VSYCP2.cjs.map +1 -0
- package/dist/chunk-FO6MIHX4.cjs +8 -0
- package/dist/chunk-FO6MIHX4.cjs.map +1 -0
- package/dist/chunk-OZLJPZUX.js +70 -0
- package/dist/chunk-OZLJPZUX.js.map +1 -0
- package/dist/chunk-VWGKYABF.js +94 -0
- package/dist/chunk-VWGKYABF.js.map +1 -0
- package/dist/chunk-WFQGZI2Z.cjs +70 -0
- package/dist/chunk-WFQGZI2Z.cjs.map +1 -0
- package/dist/index.cjs +2701 -9431
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1084 -7781
- package/dist/index.js.map +1 -1
- package/dist/region-map-geography-5E5SVPGS.cjs +184 -0
- package/dist/region-map-geography-5E5SVPGS.cjs.map +1 -0
- package/dist/region-map-geography-YD54DI3H.js +182 -0
- package/dist/region-map-geography-YD54DI3H.js.map +1 -0
- package/dist/spreadsheet-font-assets-7QMV43XD.cjs +121 -0
- package/dist/spreadsheet-font-assets-7QMV43XD.cjs.map +1 -0
- package/dist/spreadsheet-font-assets-V366MXRM.js +119 -0
- package/dist/spreadsheet-font-assets-V366MXRM.js.map +1 -0
- package/dist/surface-regl-NWR5ZZ5D.js +720 -0
- package/dist/surface-regl-NWR5ZZ5D.js.map +1 -0
- package/dist/surface-regl-WVLW3SEA.cjs +721 -0
- package/dist/surface-regl-WVLW3SEA.cjs.map +1 -0
- package/dist/xlsx-worker.js +234 -267
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,6 +24,26 @@ pnpm add @extend-ai/react-xlsx react react-dom
|
|
|
24
24
|
|
|
25
25
|
`react` and `react-dom` are peer dependencies.
|
|
26
26
|
|
|
27
|
+
## Automatic Chart Loading
|
|
28
|
+
|
|
29
|
+
Chart rendering loads automatically when the viewer encounters charts in the active tab. Map geometry and WebGL surface rendering load separately when those chart types are needed. No extra imports or configuration are required.
|
|
30
|
+
|
|
31
|
+
The viewer starts loading chart modules while chart metadata is being hydrated. The grid stays usable while charts load. Use `renderChartLoading` to supply a custom component for chart metadata, chart rendering code, and map geometry loading. Its `stage` field is `"metadata"`, `"renderer"`, or `"map"`, and its `chart`, `rect`, and `defaultNode` fields provide context. The component renders in the full chart rectangle and can contain ordinary HTML.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<XlsxViewer renderChartLoading={() => <LoadingSpinner />} />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Surface charts use their SVG rendering while the WebGL module loads. Loaded modules are reused across tabs and workbooks.
|
|
38
|
+
|
|
39
|
+
Use a production bundler that preserves dynamic imports, and deploy all generated JavaScript chunks alongside the application. This reduces the initial browser download; all chart modules remain included in the installed package.
|
|
40
|
+
|
|
41
|
+
## Spreadsheet Fonts
|
|
42
|
+
|
|
43
|
+
The first workbook load also loads a bundled Carlito font fallback before measuring text and column widths. It supplies Calibri-compatible metrics when Calibri is unavailable, including regular, bold, italic, and bold italic styles. Installed Calibri and Carlito fonts remain preferred. Other font families still depend on the host application or system.
|
|
44
|
+
|
|
45
|
+
The fallback is a separate JavaScript chunk with embedded WOFF2 data, so production rendering does not contact a font CDN. Deploy this chunk with the package's other generated chunks. Carlito is distributed under the SIL Open Font License; the published package includes `dist/Carlito-OFL.txt`.
|
|
46
|
+
|
|
27
47
|
## WebAssembly Asset
|
|
28
48
|
|
|
29
49
|
Workbook parsing and calculation run through the `@dukelib/sheets-wasm` WebAssembly module. The module loads lazily, on the first workbook parse.
|
|
@@ -231,6 +251,20 @@ These hooks work inside `XlsxViewer` or `XlsxViewerProvider` context.
|
|
|
231
251
|
- `useXlsxViewerCharts()` for chart, chart element, formula, and chartsheet state
|
|
232
252
|
- `useXlsxViewerThumbnails(options)` for painting worksheet thumbnails into your own canvases
|
|
233
253
|
|
|
254
|
+
## Merging Cells
|
|
255
|
+
|
|
256
|
+
The controller and `useXlsxViewerEditing()` expose `mergeSelection(mode?)` and `unmergeSelection()`. The merge modes are:
|
|
257
|
+
|
|
258
|
+
| Mode | Behavior |
|
|
259
|
+
| --- | --- |
|
|
260
|
+
| `"cells"` (default) | Merge the entire selection and preserve the anchor's alignment. |
|
|
261
|
+
| `"center"` | Merge the entire selection and persist horizontal center alignment. |
|
|
262
|
+
| `"across"` | Merge each selected row separately, preserving each row's anchor alignment. |
|
|
263
|
+
|
|
264
|
+
The playground Merge menu and the editable viewer's context menu expose all three modes. Merge and alignment changes participate in undo/redo and persist in XLSX exports. Unmerge works when selecting any cell within a merged range.
|
|
265
|
+
|
|
266
|
+
General alignment follows the underlying value type: numbers align right, text aligns left, and booleans and errors align center. Explicit horizontal and vertical alignment is preserved for both merged and ordinary cells.
|
|
267
|
+
|
|
234
268
|
## Form Control Editing
|
|
235
269
|
|
|
236
270
|
When `readOnly={false}`, Duke-backed checkboxes, option buttons, dropdowns, list boxes, scrollbars, and spinners are interactive. Changes update linked cells immediately, participate in undo/redo, and are written by `exportXlsx()` / `download()`.
|
|
@@ -396,6 +430,22 @@ Supported references include single cells (`A1`), rectangles (`B2:E8`), absolute
|
|
|
396
430
|
|
|
397
431
|
Each string must contain one rectangular A1 reference, not named ranges, structured table references, unions, R1C1 notation, external workbooks, or references spanning multiple worksheets. Whole-row/column highlights cover the displayed grid and extend as it grows.
|
|
398
432
|
|
|
433
|
+
## Examples
|
|
434
|
+
|
|
435
|
+
See `@extend-ai/react-xlsx` in action in these live [Extend UI](https://www.extend.ai/ui) examples. Click a screenshot to open the demo and integration docs.
|
|
436
|
+
|
|
437
|
+
### [XLSX Viewer](https://www.extend.ai/ui/docs/components/xlsx-viewer)
|
|
438
|
+
|
|
439
|
+
Explore workbook navigation, sheet tabs, zoom, and charts.
|
|
440
|
+
|
|
441
|
+
[](https://www.extend.ai/ui/docs/components/xlsx-viewer)
|
|
442
|
+
|
|
443
|
+
### [XLSX Editor](https://www.extend.ai/ui/docs/components/xlsx-editor)
|
|
444
|
+
|
|
445
|
+
Try the experimental editor with cell formatting, formulas, undo/redo, and export.
|
|
446
|
+
|
|
447
|
+
[](https://www.extend.ai/ui/docs/components/xlsx-editor)
|
|
448
|
+
|
|
399
449
|
## Context Menus
|
|
400
450
|
|
|
401
451
|
Right-click a worksheet cell, row header, column header, or the top-left corner to open the context menu. Right-clicking inside a selection preserves the range. Shift+F10 or the context-menu key opens it at the active cell; arrow keys navigate and Escape dismisses it.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Copyright 2013 The Carlito Project Authors (https://github.com/googlefonts/carlito), with Reserved Font Name "Carlito"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
https://scripts.sil.org/OFL
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|