@fileverse-dev/dsheet 2.1.2-dropIn-mri-5 → 2.1.3-package-cleanup-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.
Files changed (28) hide show
  1. package/dist/editor/components/api-key-modal/api-key-input.d.ts +5 -0
  2. package/dist/editor/components/api-key-modal/api-key-modal.d.ts +7 -0
  3. package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +4 -0
  4. package/dist/editor/components/editor-workbook.d.ts +3 -5
  5. package/dist/editor/contexts/editor-context.d.ts +14 -2
  6. package/dist/editor/dsheet-editor.d.ts +1 -1
  7. package/dist/editor/hooks/live-query/use-live-query.d.ts +4 -2
  8. package/dist/editor/hooks/use-editor-data.d.ts +4 -2
  9. package/dist/editor/types.d.ts +18 -25
  10. package/dist/editor/utils/after-update-cell.d.ts +13 -8
  11. package/dist/editor/utils/api-key-storage.d.ts +6 -0
  12. package/dist/editor/utils/api-keys-local-storage.d.ts +2 -0
  13. package/dist/editor/utils/data-block-error-handler.d.ts +21 -0
  14. package/dist/editor/utils/datablock-error-utils.d.ts +1 -0
  15. package/dist/{executeStringFunction-BU-Q3JXP.js → executeStringFunction-C26SXUpc.js} +1831 -1771
  16. package/dist/formula.js +1 -1
  17. package/dist/{index-DfYO5xfL.js → index-DSogq3Tz.js} +19714 -19360
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.es.js +21 -21
  20. package/dist/sheet-engine/core/theme.d.ts +67 -0
  21. package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +5 -4
  22. package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
  23. package/dist/sheet-engine/react/components/Workbook/index.d.ts +2 -0
  24. package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/{use-xlsx-import-impl-CHQzU9l2.js → use-xlsx-import-impl-C-PHnu49.js} +2 -2
  27. package/dist/{xlsx-export-impl-CC1y_nZm.js → xlsx-export-impl-BAJCFNh6.js} +2 -2
  28. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { formulaResponseUiSync } from './editor/utils/formula-ui-sync';
4
4
  export { executeStringFunction } from './editor/utils/executeStringFunction';
5
5
  export { FLVURL } from '@fileverse-dev/formulajs';
6
6
  export { loadLocale } from './sheet-engine/core';
7
- export type { ErrorMessageHandlerReturnType } from './editor/types';
7
+ export type { ErrorMessageHandlerReturnType, DataBlockEvent, DataBlockEventType, ApiKeyStorage } from './editor/types';
8
8
  export type { PanelConfig, PanelId, BuiltInPanelType } from './editor/types';
9
9
  export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, } from './editor/types/comments';
10
10
  export { CommentAction } from './editor/types/comments';
package/dist/index.es.js CHANGED
@@ -1,33 +1,33 @@
1
- import { C as s, a as t, b as o, S as r, d as l, i as n, T as d, e as i, f as S, g as c, h, j as m, k as C, l as u, n as p, o as E, p as F, q as g, r as x, s as R, t as f, u as A, v as I, w as L, x as w, z as T, A as b, B as v, D as k, E as D, F as M, G as V, H as X, I as z, J as P, K as U } from "./index-DfYO5xfL.js";
2
- import { bV as y, bW as B, bX as G, ar as H, bh as O, e as j, f as q, h as J, a as K, ck as N, aq as W, cs as Y } from "./executeStringFunction-BU-Q3JXP.js";
3
- import { FLVURL as Q } from "@fileverse-dev/formulajs";
1
+ import { C as s, a as t, b as o, S as l, d as r, i as n, T as d, e as i, f as S, g as c, h, j as m, k as C, l as u, n as p, o as E, p as F, q as g, r as x, s as R, t as f, u as A, v as I, w as L, x as w, z as T, A as b, B as v, D, E as M, F as k, G as V, H as X, I as z, J as P, K as U } from "./index-DSogq3Tz.js";
2
+ import { bX as j, bY as y, bZ as B, at as G, bj as H, e as O, f as J, h as K, a as Y, cm as Z, as as q, cu as N } from "./executeStringFunction-C26SXUpc.js";
3
+ import { FLVURL as W } from "@fileverse-dev/formulajs";
4
4
  import { E as ee, S as ae } from "./constants-yStXQJiK.js";
5
5
  export {
6
6
  s as CommentAction,
7
7
  t as CommentCellUI,
8
8
  o as CommentsContent,
9
- r as DSheetEditor,
10
- l as DSheetSkeleton,
9
+ l as DSheetEditor,
10
+ r as DSheetSkeleton,
11
11
  ee as ERROR_MESSAGES_FLAG,
12
- Q as FLVURL,
12
+ W as FLVURL,
13
13
  n as FortuneCore,
14
14
  ae as SERVICES_API_KEY,
15
15
  d as TEMPLATES,
16
16
  i as api,
17
- y as clearColumnsCellsFormat,
17
+ j as clearColumnsCellsFormat,
18
18
  S as clearFilter,
19
- B as clearRowsCellsFormat,
20
- G as clearSelectedCellFormat,
19
+ y as clearRowsCellsFormat,
20
+ B as clearSelectedCellFormat,
21
21
  c as createFilter,
22
- H as deleteRowCol,
23
- O as deleteSelectedCellText,
22
+ G as deleteRowCol,
23
+ H as deleteSelectedCellText,
24
24
  h as describeMatchedShortcut,
25
- j as executeStringFunction,
26
- q as formulaResponseUiSync,
27
- J as getFlowdata,
25
+ O as executeStringFunction,
26
+ J as formulaResponseUiSync,
27
+ K as getFlowdata,
28
28
  m as getRemoveDuplicatesErrorMessage,
29
29
  C as getRemoveDuplicatesPreview,
30
- K as getSheetIndex,
30
+ Y as getSheetIndex,
31
31
  u as handleCSVUpload,
32
32
  p as handleCopy,
33
33
  E as handleExportToCSV,
@@ -41,14 +41,14 @@ export {
41
41
  L as handleSort,
42
42
  w as handleTextSize,
43
43
  T as handleVerticalAlign,
44
- N as insertRowCol,
44
+ Z as insertRowCol,
45
45
  b as isBrowserZoomShortcut,
46
46
  v as isFormulaListShortcut,
47
- k as isOpenShortcutsModalShortcut,
48
- W as jfrefreshgrid,
49
- Y as loadLocale,
50
- D as removeActiveImage,
51
- M as removeDuplicates,
47
+ D as isOpenShortcutsModalShortcut,
48
+ q as jfrefreshgrid,
49
+ N as loadLocale,
50
+ M as removeActiveImage,
51
+ k as removeDuplicates,
52
52
  V as showImgChooser,
53
53
  X as toolbarItemClickHandler,
54
54
  z as updateFormat,
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Grid (canvas) theming — the single source of truth for the JS-painted grid's per-theme colors.
3
+ *
4
+ * The chrome (toolbar, sidebars, comments) themes passively via `@fileverse/ui` `.color-*`
5
+ * utilities + the `<html>` class. The canvas grid cannot read CSS variables, so `canvas.ts`
6
+ * resolves its colors from `activePalette` here. On theme change the host threads a `theme` prop
7
+ * to the engine, which calls `setActiveGridPalette` and repaints via `jfrefreshgrid`.
8
+ *
9
+ * `ThemeKey` is copied verbatim from `fileverse-ddoc` `package/types.ts` so the dsheet `theme`
10
+ * prop is type-identical to ddoc's and a host app can pass the same value to both editors.
11
+ *
12
+ * See docs/superpowers/specs/2026-06-30-dsheet-canvas-theming-design.md
13
+ */
14
+ export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink' | 'theme-green';
15
+ export declare const DEFAULT_THEME: ThemeKey;
16
+ /**
17
+ * dsheet selection-accent brand color. Constant across all five themes (readable on every
18
+ * background) — intentionally NOT a per-theme palette slot. Used for the fill handle, selection
19
+ * border, and marching ants.
20
+ */
21
+ export declare const SELECTION_ACCENT = "#EFC703";
22
+ /**
23
+ * One slot per neutral grid-chrome color role painted in `canvas.ts`. User-authored cell colors
24
+ * (cell `bg`/`fc`/border, conditional-format colors) are NOT here — they render literally in every
25
+ * theme and are read straight from cell data.
26
+ */
27
+ export interface GridPalette {
28
+ /** Unset cell background + main-area canvas clear (the `!fillStyle` fallback branch). */
29
+ cellBg: string;
30
+ /** Gridlines. */
31
+ gridLine: string;
32
+ /** Default cell text (cells with no user `fc`). */
33
+ cellText: string;
34
+ /** Row/column header background. */
35
+ headerBg: string;
36
+ /** Row/column header text. */
37
+ headerText: string;
38
+ /** Secondary fill for on-canvas chips (e.g. data-verification dropdown). */
39
+ secondaryFill: string;
40
+ /** Frozen-pane divider line. */
41
+ freezeLine: string;
42
+ }
43
+ /**
44
+ * Per-theme grid palettes.
45
+ *
46
+ * `light` holds the EXACT pre-theming hex from `canvas.ts`, so the default theme renders
47
+ * pixel-identical to before this change (regression guard).
48
+ *
49
+ * [Unverified] The four non-light palettes are reasonable design-guess values derived from each
50
+ * theme's surface swatch — NOT final brand colors; they need design sign-off. The mechanism is
51
+ * independent of the exact values.
52
+ */
53
+ export declare const GRID_THEMES: Record<ThemeKey, GridPalette>;
54
+ export declare const resolveGridPalette: (theme?: ThemeKey) => GridPalette;
55
+ /**
56
+ * The palette the canvas paints from. Module-level so the imperative canvas reads it on every
57
+ * repaint without prop threading inside the engine. `canvas.ts` imports this as a live binding and
58
+ * reads `activePalette.<slot>` at paint time; reassigning it here updates every reader.
59
+ *
60
+ * NOTE: this is a module singleton — multiple workbooks with different themes on one page would
61
+ * share it. dsheet renders one editor per page (like ddoc), so this is acceptable. If multi-instance
62
+ * is ever needed, move the palette onto `sheetCtx`.
63
+ */
64
+ export declare let activePalette: GridPalette;
65
+ /** Swap the active grid palette. Returns true if it actually changed (caller decides to repaint). */
66
+ export declare const setActiveGridPalette: (theme?: ThemeKey) => boolean;
67
+ export declare const getActiveTheme: () => ThemeKey;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { LucideIconProps } from './LucideIcon';
2
3
 
3
4
  export declare const LucideIcons: {
@@ -11,10 +12,10 @@ export declare const LucideIcons: {
11
12
  Farcaster: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
12
13
  Warpcast: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
13
14
  DSheetTextDisabled: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
14
- AddColLeft: () => import("react/jsx-runtime").JSX.Element;
15
- AddColRight: () => import("react/jsx-runtime").JSX.Element;
16
- AddRowBelowLocal: () => import("react/jsx-runtime").JSX.Element;
17
- AddRowAboveLocal: () => import("react/jsx-runtime").JSX.Element;
15
+ AddColLeft: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
16
+ AddColRight: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
17
+ AddRowBelowLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
+ AddRowAboveLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
19
  DSheetOnlyText: () => import("react/jsx-runtime").JSX.Element;
19
20
  Orb: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
20
21
  Lens: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -11,10 +11,10 @@ export declare const UltimateIcons: {
11
11
  Farcaster: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
12
12
  Warpcast: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
13
13
  DSheetTextDisabled: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
14
- AddColLeft: () => import("react/jsx-runtime").JSX.Element;
15
- AddColRight: () => import("react/jsx-runtime").JSX.Element;
16
- AddRowBelowLocal: () => import("react/jsx-runtime").JSX.Element;
17
- AddRowAboveLocal: () => import("react/jsx-runtime").JSX.Element;
14
+ AddColLeft: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
15
+ AddColRight: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
16
+ AddRowBelowLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
17
+ AddRowAboveLocal: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
18
  DSheetOnlyText: () => import("react/jsx-runtime").JSX.Element;
19
19
  Orb: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
20
20
  Lens: ({ width, height, ...props }: LucideIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { Settings, Context, CellWithRowAndCol, Sheet as SheetType, Op, CellMatrix, api } from '../../../core';
2
+ import { ThemeKey } from '../../../core/theme';
2
3
  import { default as React } from 'react';
3
4
  import { getCryptoPrice } from '../../utils/cryptoApi';
4
5
  import { SetContextOptions } from '../../context';
@@ -11,6 +12,7 @@ type AdditionalProps = {
11
12
  sidebarActivePanel?: string | null;
12
13
  sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
13
14
  sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
15
+ theme?: ThemeKey;
14
16
  };
15
17
  declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalProps & React.RefAttributes<{
16
18
  applyOp: (ops: Op[]) => void;
@@ -1,2 +1,2 @@
1
- export declare const datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
1
+ export declare const datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid hsl(var(--color-border-default));\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: hsl(var(--color-text-default));\n background-color: hsl(var(--color-bg-default));\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #0188fb;\n box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);\n }\n";
2
2
  export declare const injectDatepickerStyles: () => void;