xlsx-svelte-viewer 2.1.0 → 2.2.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.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [Live demo](https://christophervr.github.io/ooxml/xlsx/demo-svelte/) · [Documentation](https://christophervr.github.io/ooxml/xlsx/) · [Svelte guide](https://christophervr.github.io/ooxml/xlsx/frameworks/svelte) · [Changelog](https://github.com/ChristopherVR/ooxml/blob/main/viewers/xlsx/packages/svelte/CHANGELOG.md) · [Report a bug](https://github.com/ChristopherVR/ooxml/issues)
10
10
 
11
- ![The Excel editor with its ribbon, formula bar, grid and sheet tabs](https://raw.githubusercontent.com/ChristopherVR/ooxml/main/viewers/xlsx/docs/public/hero-editor.webp)
11
+ [![The Excel editor in use: selecting a range, inserting a column chart, adding a SUM formula and changing values while the chart and the total update](https://raw.githubusercontent.com/ChristopherVR/ooxml/main/viewers/xlsx/docs/public/hero-editor.gif)](https://christophervr.github.io/ooxml/apps/excel/)
12
12
 
13
13
  ## Install
14
14
 
@@ -47,21 +47,22 @@ The component renders one host `<div>`, which `class` and `style` style: give it
47
47
 
48
48
  ## Props
49
49
 
50
- | Prop | What it does |
51
- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
52
- | `workbook`, `bytes`, `src`, `fileName` | What to show: a workbook model, file bytes or a URL, and the name used by the title bar, Save and Download (default `Book1.xlsx`). |
53
- | `readOnly` | Opens in Viewing mode (default `false`). |
54
- | `locale` | Interface language (see [Localisation](#localisation)). |
55
- | `theme`, `themeColors` | `light`, `dark` or `auto` (default), and `--xve-*` token overrides (see [Theming](#theming)). |
56
- | `showToolbar`, `showFormulaBar` | Show or hide the ribbon and the formula bar (both default `true`). |
57
- | `hiddenActions`, `ribbonAddIns` | Hide ribbon commands by stable id, or add your own tabs after Excel's. |
58
- | `customization` | Capabilities, hidden ribbon tabs (File included), extra File pages and context-menu commands. |
59
- | `storage`, `fileProviders` | Send File > Save and Open to your own storage, and add OneDrive or your own cloud places to File > Open. |
60
- | `collaboration` | Join a shared room while set; `null` leaves it. |
61
- | `imageProvider` | Opt in to `IMAGE` formulas with your own fetcher (without one they show `#BLOCKED!`). |
62
- | `googleFonts` | Turn font downloads off (`false`) or point them at Google Fonts or your mirror (`{ baseUrl }`); unset leaves it to the reader (off by default). |
63
- | `authorName`, `validateReplace` | The author of new comments (default `Author`), and whether Replace applies data validation (default `false`). |
64
- | `class`, `style` | Class and inline style of the host `<div>` the editor fills. |
50
+ | Prop | What it does |
51
+ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
+ | `workbook`, `bytes`, `src`, `fileName` | What to show: a workbook model, file bytes or a URL, and the name used by the title bar, Save and Download (default `Book1.xlsx`). |
53
+ | `readOnly` | Opens in Viewing mode (default `false`). |
54
+ | `locale` | Interface language (see [Localisation](#localisation)). |
55
+ | `theme`, `themeColors` | `light`, `dark` or `auto` (default), and `--xve-*` token overrides (see [Theming](#theming)). |
56
+ | `showToolbar`, `showFormulaBar` | Show or hide the ribbon and the formula bar (both default `true`). |
57
+ | `hiddenActions`, `ribbonAddIns` | Hide ribbon commands by stable id, or add your own tabs after Excel's. |
58
+ | `customization` | Capabilities, hidden ribbon tabs (File included), extra File pages and context-menu commands. |
59
+ | `storage`, `fileProviders` | Send File > Save and Open to your own storage, and add OneDrive or your own cloud places to File > Open. |
60
+ | `collaboration` | Join a shared room while set; `null` leaves it. |
61
+ | `imageProvider` | Opt in to `IMAGE` formulas with your own fetcher (without one they show `#BLOCKED!`). |
62
+ | `googleFonts` | Turn font downloads off (`false`) or point them at Google Fonts or your mirror (`{ baseUrl }`); unset leaves it to the reader (off by default). |
63
+ | `fonts` | Font files you supply (`{ family, data, bold?, italic? }`, `FontFace` or `{ family, src }`), used for layout, drawing and printing before the workbook is first shown. Keep the array stable. |
64
+ | `authorName`, `validateReplace` | The author of new comments (default `Author`), and whether Replace applies data validation (default `false`). |
65
+ | `class`, `style` | Class and inline style of the host `<div>` the editor fills. |
65
66
 
66
67
  Props are forwarded only when their value changes, so a re-render never undoes what the user changed inside the editor (Editing or Viewing, theme, language, Customize Ribbon). Keep `customization`, `fileProviders` and `ribbonAddIns` stable between renders.
67
68
 
@@ -118,7 +119,7 @@ See [features and limitations](https://christophervr.github.io/ooxml/xlsx/featur
118
119
  Workbooks open, calculate, render, edit and save on the device. Nothing is uploaded, and nothing collects analytics or telemetry.
119
120
 
120
121
  - **Same-origin assets.** Workers, the selected non-English language, and chart, PivotTable, picture and shape tool code load on demand from your app's origin, carrying only the asset URL. Keep `locale` at `en` to skip language requests.
121
- - **Fonts.** Off by default. Fonts the device lacks are downloaded from `fonts.googleapis.com` and `fonts.gstatic.com` only when the reader turns on File > Options > Trust Center "Download fonts that are not installed or embedded", or the host sets the `googleFonts` prop: `false` turns downloads off and locks the toggle, `{ baseUrl }` points at Google Fonts or your own mirror. Only public font family names are sent.
122
+ - **Fonts.** Off by default. Fonts the device lacks are downloaded from `fonts.googleapis.com` and `fonts.gstatic.com` only when the reader turns on File > Options > Trust Center "Download fonts that are not installed or embedded", or the host sets the `googleFonts` prop: `false` turns downloads off and locks the toggle, `{ baseUrl }` points at Google Fonts or your own mirror. Only public font family names are sent. Font files you pass in the `fonts` prop are registered on the page and fetched only when an entry is a URL you name; they are removed when the editor is removed.
122
123
  - **Linked content.** Linked pictures are not fetched, external links and linked data are not refreshed, and `WEBSERVICE` is not evaluated. `IMAGE` formulas fetch only through an `imageProvider` you pass.
123
124
  - **Destinations you choose.** `src` fetches the URL you pass; sharing (`collaboration`, or a server URL the reader types in File > Share) talks only to that server, and without one connects tabs of the same browser only; OneDrive and other `fileProviders` only when you add them. Hyperlinks and the Forms link open only when the reader follows them.
124
125
  - **On the device.** Small preferences, such as the font-download choice (`ooxml.xlsx.allowFontDownloads`), stay in localStorage.
@@ -19,7 +19,7 @@
19
19
  class?: string;
20
20
  style?: string;
21
21
  };
22
- let { workbook, bytes, src, fileName, readOnly = false, locale = 'en', theme = 'auto', authorName = 'Author', validateReplace = false, showToolbar = true, showFormulaBar = true, hiddenActions = [], ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, imageProvider, googleFonts, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready, class: className, style }: Props = $props();
22
+ let { workbook, bytes, src, fileName, readOnly = false, locale = 'en', theme = 'auto', authorName = 'Author', validateReplace = false, showToolbar = true, showFormulaBar = true, hiddenActions = [], ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, imageProvider, googleFonts, fonts, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready, class: className, style }: Props = $props();
23
23
  let binding: EditorBinding | undefined;
24
24
  const handle = deferredHandle(() => binding);
25
25
  // Live `element` and `dirty`, the same handle vocabulary as the other frameworks (`EDITOR_HANDLE_KEYS`).
@@ -52,4 +52,4 @@
52
52
  export function getElement() { return binding?.element; }
53
53
  export { element, dirty };
54
54
  </script>
55
- <div class={className} {style} use:attach={{ workbook, bytes, src, fileName, readOnly, locale, theme, authorName, validateReplace, showToolbar, showFormulaBar, hiddenActions, ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, imageProvider, googleFonts, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }}></div>
55
+ <div class={className} {style} use:attach={{ workbook, bytes, src, fileName, readOnly, locale, theme, authorName, validateReplace, showToolbar, showFormulaBar, hiddenActions, ribbonAddIns, themeColors, collaboration, customization, storage, fileProviders, imageProvider, googleFonts, fonts, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }}></div>
package/dist/runtime.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as ooxml_core_xlsx from 'ooxml-core/xlsx';
2
2
  import * as ooxml_core_xlsx_ui from 'ooxml-core/xlsx/ui';
3
3
  import * as ooxml_core_collab from 'ooxml-core/collab';
4
- import { EditorLocaleInput, EditorThemeMode, RibbonAddInTab, XlsxThemeColors, XlsxCollaborationOptions, ExcelCustomization, SelectionChangeDetail, FileCommandDetail, RibbonAddInCommandDetail, XlsxCollaborationState, XlsxEditorElement, SurfaceHostActions, ValidationErrorDetail, FormatCellsOperations, FindOperations, InsertFunctionOperations, ContextMenuKind, ContextMenuModel, SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
4
+ import { EditorLocaleInput, EditorThemeMode, RibbonAddInTab, XlsxThemeColors, XlsxCollaborationOptions, HostFontsOption, ExcelCustomization, SelectionChangeDetail, FileCommandDetail, RibbonAddInCommandDetail, XlsxCollaborationState, XlsxEditorElement, SurfaceHostActions, ValidationErrorDetail, FormatCellsOperations, FindOperations, InsertFunctionOperations, ContextMenuKind, ContextMenuModel, SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
5
5
  export * from 'ooxml-ui/xlsx';
6
6
  export { SpreadsheetToolbarProps } from 'ooxml-ui/xlsx';
7
7
  import { Workbook, ImageProvider } from '@christophervr/xlsx-core';
@@ -68,6 +68,12 @@ interface EditorProps {
68
68
  * Options > Trust Center choice applies, which is off by default.
69
69
  */
70
70
  googleFonts?: GoogleFontsOption | null | undefined;
71
+ /**
72
+ * Font files the host supplies (`{ family, data, bold?, italic? }` bytes, `FontFace` objects or
73
+ * `{ family, src }` URLs), registered before a loaded workbook is first laid out and used when
74
+ * printing. A new array with the same entries is no change, so a re-render never re-registers.
75
+ */
76
+ fonts?: HostFontsOption | undefined;
71
77
  /**
72
78
  * Host customisation (`ExcelCustomization`): `capabilities`, `backstage.extraPages` and
73
79
  * `contextMenu.extraCommands`. Forwarded when the object changes, so keep it stable (memoise
@@ -120,7 +126,7 @@ interface EditorEventOptions {
120
126
  interface EditorOptions extends EditorProps, EditorEventOptions {
121
127
  }
122
128
  /** Single source of truth for the prop keys every adapter forwards. */
123
- declare const EDITOR_PROP_KEYS: readonly ["workbook", "bytes", "src", "fileName", "readOnly", "locale", "theme", "authorName", "validateReplace", "showToolbar", "showFormulaBar", "hiddenActions", "ribbonAddIns", "themeColors", "collaboration", "storage", "fileProviders", "imageProvider", "googleFonts", "customization"];
129
+ declare const EDITOR_PROP_KEYS: readonly ["workbook", "bytes", "src", "fileName", "readOnly", "locale", "theme", "authorName", "validateReplace", "showToolbar", "showFormulaBar", "hiddenActions", "ribbonAddIns", "themeColors", "collaboration", "storage", "fileProviders", "imageProvider", "googleFonts", "fonts", "customization"];
124
130
  type EditorPropKey = (typeof EDITOR_PROP_KEYS)[number];
125
131
  /** Single source of truth for the element events every adapter surfaces. */
126
132
  declare const EDITOR_EVENT_NAMES: readonly ["workbook-change", "workbook-error", "selection-change", "dirty-change", "readonly-change", "file-command", "workbook-warning", "ribbon-action", "ribbon-customize", "sheet-change", "office-ribbon-add-in", "collaboration-change"];
package/dist/runtime.js CHANGED
@@ -1,29 +1,29 @@
1
- import { bindElement as e, contractOptions as t, createSrcLoader as n, deferredHandle as r, eventArgs as i, eventOptions as a, pickProps as o, readOnlyChange as s, sameList as c, shallowEqual as l, svelteHandlerName as u } from "ooxml-ui/bindings";
2
- import { LegacyXlsError as d, csvToWorkbook as f, detectWorkbookFormat as p, loadLegacyXls as m, loadWorkbook as h, parseCsv as g, saveWorkbook as _, sheetToCsv as v } from "@christophervr/xlsx-core/load";
3
- import { onDestroy as y } from "svelte";
4
- import { writable as b } from "svelte/store";
5
- import * as x from "ooxml-ui/theme";
1
+ import { bindElement as e, contractOptions as t, createSrcLoader as n, deferredHandle as r, eventArgs as i, eventOptions as a, pickProps as o, readOnlyChange as s, sameHostFonts as c, sameList as l, shallowEqual as u, svelteHandlerName as d } from "ooxml-ui/bindings";
2
+ import { LegacyXlsError as f, csvToWorkbook as p, detectWorkbookFormat as m, loadLegacyXls as h, loadWorkbook as g, parseCsv as _, saveWorkbook as v, sheetToCsv as y } from "@christophervr/xlsx-core/load";
3
+ import { onDestroy as b } from "svelte";
4
+ import { writable as x } from "svelte/store";
5
+ import * as S from "ooxml-ui/theme";
6
6
  export * from "ooxml-ui/xlsx";
7
7
  export * from "@christophervr/xlsx-core";
8
8
  // \0rolldown/runtime.js
9
- var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, w = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, E = (e, t) => {
9
+ var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, T = Object.getOwnPropertyNames, E = Object.prototype.hasOwnProperty, D = (e, t) => {
10
10
  let n = {};
11
- for (var r in e) S(n, r, {
11
+ for (var r in e) C(n, r, {
12
12
  get: e[r],
13
13
  enumerable: !0
14
14
  });
15
- return t || S(n, Symbol.toStringTag, { value: "Module" }), n;
16
- }, D = (e, t, n, r) => {
17
- if (t && typeof t == "object" || typeof t == "function") for (var i = w(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !T.call(e, s) && s !== n && S(e, s, {
15
+ return t || C(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ }, O = (e, t, n, r) => {
17
+ if (t && typeof t == "object" || typeof t == "function") for (var i = T(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !E.call(e, s) && s !== n && C(e, s, {
18
18
  get: ((e) => t[e]).bind(null, s),
19
- enumerable: !(r = C(t, s)) || r.enumerable
19
+ enumerable: !(r = w(t, s)) || r.enumerable
20
20
  });
21
21
  return e;
22
- }, O = (e, t, n) => (D(e, t, "default"), n && D(n, t, "default")), k = /* @__PURE__ */ E({});
23
- import * as A from "ooxml-ui/xlsx";
24
- O(k, A);
22
+ }, k = (e, t, n) => (O(e, t, "default"), n && O(n, t, "default")), A = /* @__PURE__ */ D({});
23
+ import * as j from "ooxml-ui/xlsx";
24
+ k(A, j);
25
25
  // packages/bindings/src/contract.ts
26
- var j = [
26
+ var M = [
27
27
  "workbook",
28
28
  "bytes",
29
29
  "src",
@@ -43,8 +43,9 @@ var j = [
43
43
  "fileProviders",
44
44
  "imageProvider",
45
45
  "googleFonts",
46
+ "fonts",
46
47
  "customization"
47
- ], M = [
48
+ ], N = [
48
49
  "workbook-change",
49
50
  "workbook-error",
50
51
  "selection-change",
@@ -58,10 +59,10 @@ var j = [
58
59
  "office-ribbon-add-in",
59
60
  "collaboration-change"
60
61
  ];
61
- function N(e, t) {
62
+ function P(e, t) {
62
63
  return (e ?? void 0) === (t ?? void 0) || typeof e == "object" && typeof t == "object" && e?.baseUrl === t?.baseUrl;
63
64
  }
64
- var P = {
65
+ var F = {
65
66
  props: {
66
67
  locale: {
67
68
  forward: "changed",
@@ -93,7 +94,7 @@ var P = {
93
94
  },
94
95
  hiddenActions: {
95
96
  forward: "changed",
96
- same: c,
97
+ same: l,
97
98
  apply: (e, t) => e.hiddenActions = [...t ?? []]
98
99
  },
99
100
  ribbonAddIns: {
@@ -111,11 +112,15 @@ var P = {
111
112
  },
112
113
  googleFonts: {
113
114
  forward: "changed",
114
- same: N
115
+ same: P
116
+ },
117
+ fonts: {
118
+ forward: "changed",
119
+ same: c
115
120
  },
116
121
  themeColors: {
117
122
  forward: "changed",
118
- same: l,
123
+ same: u,
119
124
  apply: (e, t) => e.themeColors = { ...t }
120
125
  },
121
126
  fileName: { forward: "defined" },
@@ -178,23 +183,23 @@ var P = {
178
183
  share: "call",
179
184
  dirty: { fallback: !1 }
180
185
  }
181
- }, F = ["onReady"];
182
- function I(e) {
183
- return o(P, e);
184
- }
186
+ }, I = ["onReady"];
185
187
  function L(e) {
188
+ return o(F, e);
189
+ }
190
+ function R(e) {
186
191
  return {
187
- ...a(P, e),
192
+ ...a(F, e),
188
193
  onReady: e.ready
189
194
  };
190
195
  }
191
- function R(e) {
192
- return t(P, e, u, F);
193
- }
194
196
  function z(e) {
195
- return r(P.handle, e);
197
+ return t(F, e, d, I);
198
+ }
199
+ function B(e) {
200
+ return r(F.handle, e);
196
201
  }
197
- var B = [
202
+ var V = [
198
203
  "element",
199
204
  "load",
200
205
  "newWorkbook",
@@ -210,14 +215,14 @@ var B = [
210
215
  "dirty"
211
216
  ];
212
217
  // packages/bindings/src/index.ts
213
- function V(t, r = {}, i = !1) {
214
- (0, k.defineXlsxEditor)();
218
+ function H(t, r = {}, i = !1) {
219
+ (0, A.defineXlsxEditor)();
215
220
  let a = t.ownerDocument.createElement("xlsx-editor");
216
221
  if (i && typeof a.getToolbarProps != "function") throw Error("Update ooxml-ui to use editor building blocks.");
217
222
  a.surfaceOnly = i;
218
223
  let o = {}, s, c, l, u, d = !1, f = (e) => {
219
224
  d || o.onWorkbookError?.(e instanceof Error ? e : Error(String(e)));
220
- }, p = (e, t) => a.load(e, t).catch(() => void 0), m = n(p, f), h = e(a, P, () => o, { onEvent: (e, t) => {
225
+ }, p = (e, t) => a.load(e, t).catch(() => void 0), m = n(p, f), h = e(a, F, () => o, { onEvent: (e, t) => {
221
226
  e === "workbook-change" && (c = t.detail.workbook);
222
227
  } }), g = {
223
228
  element: a,
@@ -244,7 +249,7 @@ function V(t, r = {}, i = !1) {
244
249
  };
245
250
  return g.update(r), t.append(a), o.onReady?.(a), g;
246
251
  }
247
- var H = [
252
+ var U = [
248
253
  "onOpenShareDialog",
249
254
  "onOpenSettings",
250
255
  "onOpenFormatCells",
@@ -254,14 +259,14 @@ var H = [
254
259
  "onContextMenu",
255
260
  "onContextMenuItems"
256
261
  ];
257
- function U(e, t = {}) {
262
+ function W(e, t = {}) {
258
263
  let n = t, r = (e) => ({
259
264
  ...e,
260
265
  readOnly: e.canEdit !== !0 || e.readOnly === !0
261
- }), i = V(e, r(t), !0), { element: a } = i, o = i.update, s = i.destroy, c = {}, l = (e) => {
262
- if (H.every((t) => c[t] === e[t])) return;
266
+ }), i = H(e, r(t), !0), { element: a } = i, o = i.update, s = i.destroy, c = {}, l = (e) => {
267
+ if (U.every((t) => c[t] === e[t])) return;
263
268
  let t = {};
264
- for (let n of H) t[n] = e[n];
269
+ for (let n of U) t[n] = e[n];
265
270
  c = t, a.surfaceActions = t;
266
271
  }, u = (e) => n.onValidationError?.(e.detail);
267
272
  return a.addEventListener("validation-error", u), l(t), Object.assign(i, {
@@ -276,20 +281,20 @@ function U(e, t = {}) {
276
281
  });
277
282
  }
278
283
  // packages/bindings/src/common.ts
279
- var W = /* @__PURE__ */ E({
280
- LegacyXlsError: () => d,
281
- csvToWorkbook: () => f,
282
- detectWorkbookFormat: () => p,
283
- loadLegacyXls: () => m,
284
- loadWorkbook: () => h,
285
- mountEditorSurface: () => U,
286
- parseCsv: () => g,
287
- saveWorkbook: () => _,
288
- sheetToCsv: () => v
284
+ var G = /* @__PURE__ */ D({
285
+ LegacyXlsError: () => f,
286
+ csvToWorkbook: () => p,
287
+ detectWorkbookFormat: () => m,
288
+ loadLegacyXls: () => h,
289
+ loadWorkbook: () => g,
290
+ mountEditorSurface: () => W,
291
+ parseCsv: () => _,
292
+ saveWorkbook: () => v,
293
+ sheetToCsv: () => y
289
294
  });
290
- O(W, k);
295
+ k(G, A);
291
296
  // packages/bindings/src/building-blocks.ts
292
- var G = Object.freeze({
297
+ var ee = Object.freeze({
293
298
  active: !1,
294
299
  roomId: void 0,
295
300
  status: "off",
@@ -300,7 +305,7 @@ function K(e) {
300
305
  return {
301
306
  dirty: e?.dirty ?? !1,
302
307
  selection: e?.selection ?? "",
303
- collaboration: e?.collaboration ?? G,
308
+ collaboration: e?.collaboration ?? ee,
304
309
  editError: e?.editError ?? null
305
310
  };
306
311
  }
@@ -325,9 +330,9 @@ function q(e) {
325
330
  t = null, r?.(), r = void 0, n?.destroy(), n = void 0, s();
326
331
  };
327
332
  return {
328
- handle: z(() => n),
333
+ handle: B(() => n),
329
334
  mount(e) {
330
- e && e === t || (l(), e && (a = null, n = U(e, c()), t = e, r = n.subscribe(s), s()));
335
+ e && e === t || (l(), e && (a = null, n = W(e, c()), t = e, r = n.subscribe(s), s()));
331
336
  },
332
337
  update(e) {
333
338
  (e.workbook !== i.workbook || e.bytes !== i.bytes || e.src !== i.src) && (a = null), i = e, n?.update(c()), s();
@@ -409,13 +414,13 @@ function Z(e, t) {
409
414
  // packages/bindings/src/block-theme.ts
410
415
  function Q(e, t) {
411
416
  if (!e || typeof e != "object" || !("ownerDocument" in e)) return;
412
- let n = e, r = Reflect.get(x, "prepareOfficeUiBlock");
413
- typeof r == "function" ? r(n, t, "xlsx") : (x.installOfficeUiTheme(n.ownerDocument), n.setAttribute("data-office-block", t), n.setAttribute("data-office-product", "xlsx"));
417
+ let n = e, r = Reflect.get(S, "prepareOfficeUiBlock");
418
+ typeof r == "function" ? r(n, t, "xlsx") : (S.installOfficeUiTheme(n.ownerDocument), n.setAttribute("data-office-block", t), n.setAttribute("data-office-product", "xlsx"));
414
419
  }
415
420
  // packages/svelte/src/building-blocks.ts
416
421
  function $(e = {}) {
417
- let t = b(J()), n = q(t.set);
418
- return n.update(e), y(n.destroy), {
422
+ let t = x(J()), n = q(t.set);
423
+ return n.update(e), b(n.destroy), {
419
424
  subscribe: t.subscribe,
420
425
  update: n.update,
421
426
  handle: n.handle,
@@ -423,29 +428,29 @@ function $(e = {}) {
423
428
  destroy: n.destroy
424
429
  };
425
430
  }
426
- O(/* @__PURE__ */ E({
427
- EDITOR_CALLBACKS: () => F,
428
- EDITOR_CONTRACT: () => P,
429
- EDITOR_EVENT_NAMES: () => M,
430
- EDITOR_HANDLE_KEYS: () => B,
431
- EDITOR_PROP_KEYS: () => j,
432
- LegacyXlsError: () => d,
431
+ k(/* @__PURE__ */ D({
432
+ EDITOR_CALLBACKS: () => I,
433
+ EDITOR_CONTRACT: () => F,
434
+ EDITOR_EVENT_NAMES: () => N,
435
+ EDITOR_HANDLE_KEYS: () => V,
436
+ EDITOR_PROP_KEYS: () => M,
437
+ LegacyXlsError: () => f,
433
438
  createViewerBuildingBlocks: () => $,
434
- csvToWorkbook: () => f,
435
- deferredHandle: () => z,
436
- detectWorkbookFormat: () => p,
437
- eventOptions: () => L,
438
- loadLegacyXls: () => m,
439
- loadWorkbook: () => h,
440
- mountEditor: () => V,
441
- mountEditorSurface: () => U,
442
- parseCsv: () => g,
443
- pickEditorProps: () => I,
439
+ csvToWorkbook: () => p,
440
+ deferredHandle: () => B,
441
+ detectWorkbookFormat: () => m,
442
+ eventOptions: () => R,
443
+ loadLegacyXls: () => h,
444
+ loadWorkbook: () => g,
445
+ mountEditor: () => H,
446
+ mountEditorSurface: () => W,
447
+ parseCsv: () => _,
448
+ pickEditorProps: () => L,
444
449
  prepareBlock: () => Q,
445
- saveWorkbook: () => _,
450
+ saveWorkbook: () => v,
446
451
  selectReference: () => Z,
447
- sheetToCsv: () => v,
448
- svelteEditorOptions: () => R,
452
+ sheetToCsv: () => y,
453
+ svelteEditorOptions: () => z,
449
454
  toolbarModel: () => X
450
- }), W);
451
- export { F as EDITOR_CALLBACKS, P as EDITOR_CONTRACT, M as EDITOR_EVENT_NAMES, B as EDITOR_HANDLE_KEYS, j as EDITOR_PROP_KEYS, d as LegacyXlsError, $ as createViewerBuildingBlocks, f as csvToWorkbook, z as deferredHandle, p as detectWorkbookFormat, L as eventOptions, m as loadLegacyXls, h as loadWorkbook, V as mountEditor, U as mountEditorSurface, g as parseCsv, I as pickEditorProps, Q as prepareBlock, _ as saveWorkbook, Z as selectReference, v as sheetToCsv, R as svelteEditorOptions, X as toolbarModel };
455
+ }), G);
456
+ export { I as EDITOR_CALLBACKS, F as EDITOR_CONTRACT, N as EDITOR_EVENT_NAMES, V as EDITOR_HANDLE_KEYS, M as EDITOR_PROP_KEYS, f as LegacyXlsError, $ as createViewerBuildingBlocks, p as csvToWorkbook, B as deferredHandle, m as detectWorkbookFormat, R as eventOptions, h as loadLegacyXls, g as loadWorkbook, H as mountEditor, W as mountEditorSurface, _ as parseCsv, L as pickEditorProps, Q as prepareBlock, v as saveWorkbook, Z as selectReference, y as sheetToCsv, z as svelteEditorOptions, X as toolbarModel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xlsx-svelte-viewer",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Svelte 5 component for the Excel spreadsheet editor. Self-contained: includes the editor, the formula engine and the legacy .xls reader.",
5
5
  "keywords": [
6
6
  "editor",
@@ -67,8 +67,8 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@christophervr/xlsx-core": "^2.0.1",
70
- "ooxml-core": "^2.5.0",
71
- "ooxml-ui": "^2.5.0"
70
+ "ooxml-core": "^2.6.3",
71
+ "ooxml-ui": "^2.6.0"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "svelte": "^5.0.0"