xlsx-svelte-viewer 2.2.0 → 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.
@@ -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, fonts, 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, fonts, 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
@@ -4,7 +4,7 @@ import * as ooxml_core_collab from 'ooxml-core/collab';
4
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';
@@ -74,6 +74,8 @@ interface EditorProps {
74
74
  * printing. A new array with the same entries is no change, so a re-render never re-registers.
75
75
  */
76
76
  fonts?: HostFontsOption | undefined;
77
+ /** Package limits for subsequent XLSX loads. */
78
+ limits?: XlsxLoadLimits | undefined;
77
79
  /**
78
80
  * Host customisation (`ExcelCustomization`): `capabilities`, `backstage.extraPages` and
79
81
  * `contextMenu.extraCommands`. Forwarded when the object changes, so keep it stable (memoise
@@ -126,7 +128,7 @@ interface EditorEventOptions {
126
128
  interface EditorOptions extends EditorProps, EditorEventOptions {
127
129
  }
128
130
  /** Single source of truth for the prop keys every adapter forwards. */
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"];
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"];
130
132
  type EditorPropKey = (typeof EDITOR_PROP_KEYS)[number];
131
133
  /** Single source of truth for the element events every adapter surfaces. */
132
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
@@ -7,19 +7,19 @@ export * from "ooxml-ui/xlsx";
7
7
  export * from "@christophervr/xlsx-core";
8
8
  // \0rolldown/runtime.js
9
9
  var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, T = Object.getOwnPropertyNames, E = Object.prototype.hasOwnProperty, D = (e, t) => {
10
- let n = {};
10
+ let n = Object.setPrototypeOf({}, null);
11
11
  for (var r in e) C(n, r, {
12
12
  get: e[r],
13
13
  enumerable: !0
14
14
  });
15
- return t || C(n, Symbol.toStringTag, { value: "Module" }), n;
15
+ return t & 1 || C(n, Symbol.toStringTag, { value: "Module" }), t & 2 ? n : Object.preventExtensions(n);
16
16
  }, O = (e, t, n, r) => {
17
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
19
  enumerable: !(r = w(t, s)) || r.enumerable
20
20
  });
21
21
  return e;
22
- }, k = (e, t, n) => (O(e, t, "default"), n && O(n, t, "default")), A = /* @__PURE__ */ D({});
22
+ }, k = (e, t, n) => (O(e, t, "default"), n && O(n, t, "default")), A = /* @__PURE__ */ D({}, 2);
23
23
  import * as j from "ooxml-ui/xlsx";
24
24
  k(A, j);
25
25
  // packages/bindings/src/contract.ts
@@ -44,6 +44,7 @@ var M = [
44
44
  "imageProvider",
45
45
  "googleFonts",
46
46
  "fonts",
47
+ "limits",
47
48
  "customization"
48
49
  ], N = [
49
50
  "workbook-change",
@@ -118,6 +119,7 @@ var F = {
118
119
  forward: "changed",
119
120
  same: c
120
121
  },
122
+ limits: { forward: "changed" },
121
123
  themeColors: {
122
124
  forward: "changed",
123
125
  same: u,
@@ -291,7 +293,7 @@ var G = /* @__PURE__ */ D({
291
293
  parseCsv: () => _,
292
294
  saveWorkbook: () => v,
293
295
  sheetToCsv: () => y
294
- });
296
+ }, 2);
295
297
  k(G, A);
296
298
  // packages/bindings/src/building-blocks.ts
297
299
  var ee = Object.freeze({
@@ -452,5 +454,5 @@ k(/* @__PURE__ */ D({
452
454
  sheetToCsv: () => y,
453
455
  svelteEditorOptions: () => z,
454
456
  toolbarModel: () => X
455
- }), G);
457
+ }, 2), G);
456
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.2.0",
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.3",
71
- "ooxml-ui": "^2.6.0"
70
+ "ooxml-core": "^2.8.1",
71
+ "ooxml-ui": "^2.8.1"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "svelte": "^5.0.0"