xlsx-svelte-viewer 2.1.1 → 2.2.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 CHANGED
@@ -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, limits, 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, limits, onworkbookchange, onworkbookerror, onselectionchange, ondirtychange, onreadonlychange, onfilecommand, onworkbookwarning, onribbonaction, onribboncustomize, onsheetchange, onribbonaddin, oncollaborationchange, onready }}></div>
package/dist/runtime.d.ts CHANGED
@@ -1,10 +1,10 @@
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
- import { Workbook, ImageProvider } from '@christophervr/xlsx-core';
7
+ import { Workbook, ImageProvider, XlsxLoadLimits } from '@christophervr/xlsx-core';
8
8
  export * from '@christophervr/xlsx-core';
9
9
  import { DocumentStorage, CloudFileProvider, CloudOpenedFile } from 'ooxml-core/embedding';
10
10
  import { GoogleFontsOption } from 'ooxml-core/text';
@@ -68,6 +68,14 @@ 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;
77
+ /** Package limits for subsequent XLSX loads. */
78
+ limits?: XlsxLoadLimits | undefined;
71
79
  /**
72
80
  * Host customisation (`ExcelCustomization`): `capabilities`, `backstage.extraPages` and
73
81
  * `contextMenu.extraCommands`. Forwarded when the object changes, so keep it stable (memoise
@@ -120,7 +128,7 @@ interface EditorEventOptions {
120
128
  interface EditorOptions extends EditorProps, EditorEventOptions {
121
129
  }
122
130
  /** 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"];
131
+ 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", "limits", "customization"];
124
132
  type EditorPropKey = (typeof EDITOR_PROP_KEYS)[number];
125
133
  /** Single source of truth for the element events every adapter surfaces. */
126
134
  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) => {
10
- let n = {};
11
- for (var r in e) S(n, r, {
9
+ var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, T = Object.getOwnPropertyNames, E = Object.prototype.hasOwnProperty, D = (e, t) => {
10
+ let n = Object.setPrototypeOf({}, null);
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 & 1 || C(n, Symbol.toStringTag, { value: "Module" }), t & 2 ? n : Object.preventExtensions(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({}, 2);
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,10 @@ var j = [
43
43
  "fileProviders",
44
44
  "imageProvider",
45
45
  "googleFonts",
46
+ "fonts",
47
+ "limits",
46
48
  "customization"
47
- ], M = [
49
+ ], N = [
48
50
  "workbook-change",
49
51
  "workbook-error",
50
52
  "selection-change",
@@ -58,10 +60,10 @@ var j = [
58
60
  "office-ribbon-add-in",
59
61
  "collaboration-change"
60
62
  ];
61
- function N(e, t) {
63
+ function P(e, t) {
62
64
  return (e ?? void 0) === (t ?? void 0) || typeof e == "object" && typeof t == "object" && e?.baseUrl === t?.baseUrl;
63
65
  }
64
- var P = {
66
+ var F = {
65
67
  props: {
66
68
  locale: {
67
69
  forward: "changed",
@@ -93,7 +95,7 @@ var P = {
93
95
  },
94
96
  hiddenActions: {
95
97
  forward: "changed",
96
- same: c,
98
+ same: l,
97
99
  apply: (e, t) => e.hiddenActions = [...t ?? []]
98
100
  },
99
101
  ribbonAddIns: {
@@ -111,11 +113,16 @@ var P = {
111
113
  },
112
114
  googleFonts: {
113
115
  forward: "changed",
114
- same: N
116
+ same: P
117
+ },
118
+ fonts: {
119
+ forward: "changed",
120
+ same: c
115
121
  },
122
+ limits: { forward: "changed" },
116
123
  themeColors: {
117
124
  forward: "changed",
118
- same: l,
125
+ same: u,
119
126
  apply: (e, t) => e.themeColors = { ...t }
120
127
  },
121
128
  fileName: { forward: "defined" },
@@ -178,23 +185,23 @@ var P = {
178
185
  share: "call",
179
186
  dirty: { fallback: !1 }
180
187
  }
181
- }, F = ["onReady"];
182
- function I(e) {
183
- return o(P, e);
184
- }
188
+ }, I = ["onReady"];
185
189
  function L(e) {
190
+ return o(F, e);
191
+ }
192
+ function R(e) {
186
193
  return {
187
- ...a(P, e),
194
+ ...a(F, e),
188
195
  onReady: e.ready
189
196
  };
190
197
  }
191
- function R(e) {
192
- return t(P, e, u, F);
193
- }
194
198
  function z(e) {
195
- return r(P.handle, e);
199
+ return t(F, e, d, I);
196
200
  }
197
- var B = [
201
+ function B(e) {
202
+ return r(F.handle, e);
203
+ }
204
+ var V = [
198
205
  "element",
199
206
  "load",
200
207
  "newWorkbook",
@@ -210,14 +217,14 @@ var B = [
210
217
  "dirty"
211
218
  ];
212
219
  // packages/bindings/src/index.ts
213
- function V(t, r = {}, i = !1) {
214
- (0, k.defineXlsxEditor)();
220
+ function H(t, r = {}, i = !1) {
221
+ (0, A.defineXlsxEditor)();
215
222
  let a = t.ownerDocument.createElement("xlsx-editor");
216
223
  if (i && typeof a.getToolbarProps != "function") throw Error("Update ooxml-ui to use editor building blocks.");
217
224
  a.surfaceOnly = i;
218
225
  let o = {}, s, c, l, u, d = !1, f = (e) => {
219
226
  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) => {
227
+ }, p = (e, t) => a.load(e, t).catch(() => void 0), m = n(p, f), h = e(a, F, () => o, { onEvent: (e, t) => {
221
228
  e === "workbook-change" && (c = t.detail.workbook);
222
229
  } }), g = {
223
230
  element: a,
@@ -244,7 +251,7 @@ function V(t, r = {}, i = !1) {
244
251
  };
245
252
  return g.update(r), t.append(a), o.onReady?.(a), g;
246
253
  }
247
- var H = [
254
+ var U = [
248
255
  "onOpenShareDialog",
249
256
  "onOpenSettings",
250
257
  "onOpenFormatCells",
@@ -254,14 +261,14 @@ var H = [
254
261
  "onContextMenu",
255
262
  "onContextMenuItems"
256
263
  ];
257
- function U(e, t = {}) {
264
+ function W(e, t = {}) {
258
265
  let n = t, r = (e) => ({
259
266
  ...e,
260
267
  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;
268
+ }), i = H(e, r(t), !0), { element: a } = i, o = i.update, s = i.destroy, c = {}, l = (e) => {
269
+ if (U.every((t) => c[t] === e[t])) return;
263
270
  let t = {};
264
- for (let n of H) t[n] = e[n];
271
+ for (let n of U) t[n] = e[n];
265
272
  c = t, a.surfaceActions = t;
266
273
  }, u = (e) => n.onValidationError?.(e.detail);
267
274
  return a.addEventListener("validation-error", u), l(t), Object.assign(i, {
@@ -276,20 +283,20 @@ function U(e, t = {}) {
276
283
  });
277
284
  }
278
285
  // 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
289
- });
290
- O(W, k);
286
+ var G = /* @__PURE__ */ D({
287
+ LegacyXlsError: () => f,
288
+ csvToWorkbook: () => p,
289
+ detectWorkbookFormat: () => m,
290
+ loadLegacyXls: () => h,
291
+ loadWorkbook: () => g,
292
+ mountEditorSurface: () => W,
293
+ parseCsv: () => _,
294
+ saveWorkbook: () => v,
295
+ sheetToCsv: () => y
296
+ }, 2);
297
+ k(G, A);
291
298
  // packages/bindings/src/building-blocks.ts
292
- var G = Object.freeze({
299
+ var ee = Object.freeze({
293
300
  active: !1,
294
301
  roomId: void 0,
295
302
  status: "off",
@@ -300,7 +307,7 @@ function K(e) {
300
307
  return {
301
308
  dirty: e?.dirty ?? !1,
302
309
  selection: e?.selection ?? "",
303
- collaboration: e?.collaboration ?? G,
310
+ collaboration: e?.collaboration ?? ee,
304
311
  editError: e?.editError ?? null
305
312
  };
306
313
  }
@@ -325,9 +332,9 @@ function q(e) {
325
332
  t = null, r?.(), r = void 0, n?.destroy(), n = void 0, s();
326
333
  };
327
334
  return {
328
- handle: z(() => n),
335
+ handle: B(() => n),
329
336
  mount(e) {
330
- e && e === t || (l(), e && (a = null, n = U(e, c()), t = e, r = n.subscribe(s), s()));
337
+ e && e === t || (l(), e && (a = null, n = W(e, c()), t = e, r = n.subscribe(s), s()));
331
338
  },
332
339
  update(e) {
333
340
  (e.workbook !== i.workbook || e.bytes !== i.bytes || e.src !== i.src) && (a = null), i = e, n?.update(c()), s();
@@ -409,13 +416,13 @@ function Z(e, t) {
409
416
  // packages/bindings/src/block-theme.ts
410
417
  function Q(e, t) {
411
418
  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"));
419
+ let n = e, r = Reflect.get(S, "prepareOfficeUiBlock");
420
+ typeof r == "function" ? r(n, t, "xlsx") : (S.installOfficeUiTheme(n.ownerDocument), n.setAttribute("data-office-block", t), n.setAttribute("data-office-product", "xlsx"));
414
421
  }
415
422
  // packages/svelte/src/building-blocks.ts
416
423
  function $(e = {}) {
417
- let t = b(J()), n = q(t.set);
418
- return n.update(e), y(n.destroy), {
424
+ let t = x(J()), n = q(t.set);
425
+ return n.update(e), b(n.destroy), {
419
426
  subscribe: t.subscribe,
420
427
  update: n.update,
421
428
  handle: n.handle,
@@ -423,29 +430,29 @@ function $(e = {}) {
423
430
  destroy: n.destroy
424
431
  };
425
432
  }
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,
433
+ k(/* @__PURE__ */ D({
434
+ EDITOR_CALLBACKS: () => I,
435
+ EDITOR_CONTRACT: () => F,
436
+ EDITOR_EVENT_NAMES: () => N,
437
+ EDITOR_HANDLE_KEYS: () => V,
438
+ EDITOR_PROP_KEYS: () => M,
439
+ LegacyXlsError: () => f,
433
440
  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,
441
+ csvToWorkbook: () => p,
442
+ deferredHandle: () => B,
443
+ detectWorkbookFormat: () => m,
444
+ eventOptions: () => R,
445
+ loadLegacyXls: () => h,
446
+ loadWorkbook: () => g,
447
+ mountEditor: () => H,
448
+ mountEditorSurface: () => W,
449
+ parseCsv: () => _,
450
+ pickEditorProps: () => L,
444
451
  prepareBlock: () => Q,
445
- saveWorkbook: () => _,
452
+ saveWorkbook: () => v,
446
453
  selectReference: () => Z,
447
- sheetToCsv: () => v,
448
- svelteEditorOptions: () => R,
454
+ sheetToCsv: () => y,
455
+ svelteEditorOptions: () => z,
449
456
  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 };
457
+ }, 2), G);
458
+ 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.1",
3
+ "version": "2.2.1",
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.6.0",
71
- "ooxml-ui": "^2.5.1"
70
+ "ooxml-core": "^2.8.1",
71
+ "ooxml-ui": "^2.8.1"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "svelte": "^5.0.0"