@gridsheet/preact-core 3.1.0 → 3.3.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.
@@ -1,5 +1,5 @@
1
1
  import { StoreType, AreaType, PointType } from '../types';
2
- import { UserSheet } from '@gridsheet/core';
2
+ import { UserSheet } from '@gridsheet/web';
3
3
  export declare const clip: (store: StoreType) => AreaType;
4
4
  export type SheetCSVProps = {
5
5
  getter?: (sheet: UserSheet, point: PointType) => string;
@@ -1,4 +1,4 @@
1
- import { BookType, RegistryProps } from '@gridsheet/core';
1
+ import { BookType, RegistryProps } from '@gridsheet/web';
2
2
  export declare const useBrowser: () => {
3
3
  window: Window & typeof globalThis;
4
4
  document: Document;
@@ -1,5 +1,5 @@
1
1
  import { PointType, ZoneType, FilterConfig, StoreType } from '../types';
2
- import { UserSheet } from '@gridsheet/core';
2
+ import { UserSheet } from '@gridsheet/web';
3
3
  import { Dispatcher } from '../store';
4
4
  import { FC } from 'react';
5
5
  export type MenuContext = {
@@ -1,3 +1,3 @@
1
- import { PolicyMixinType } from '@gridsheet/core';
1
+ import { PolicyMixinType } from '@gridsheet/web';
2
2
  export declare const CheckboxPolicyMixin: PolicyMixinType;
3
3
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1,6 +1,6 @@
1
- import { RegistryProps } from '@gridsheet/core';
1
+ import { RegistryProps } from '@gridsheet/web';
2
2
  /** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
3
- export declare const useSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/core').BookType;
3
+ export declare const useSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/engine').BookType;
4
4
  /** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
5
- export declare const createSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/core').BookType;
5
+ export declare const createSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/engine').BookType;
6
6
  //# sourceMappingURL=spellbook.d.ts.map
package/dist/spellbook.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { allFunctions } from "@gridsheet/functions";
2
- import { createBook } from "@gridsheet/core";
3
- import { U as useBook } from "./hooks-ykrgAwg5.mjs";
2
+ import { aA as useBook, a_ as xn } from "./hooks-DroLjp9H.mjs";
4
3
  const useSpellbook = ({ additionalFunctions, ...rest } = {}) => useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });
5
- const createSpellbook = ({ additionalFunctions, ...rest } = {}) => createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });
4
+ const createSpellbook = ({ additionalFunctions, ...rest } = {}) => xn({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });
6
5
  export {
7
6
  createSpellbook,
8
7
  useSpellbook
@@ -1 +1 @@
1
- {"version":3,"file":"spellbook.js","sources":["../../react-core/src/spellbook.ts"],"sourcesContent":["import { allFunctions } from '@gridsheet/functions';\nimport type { RegistryProps } from '@gridsheet/core';\nimport { createBook } from '@gridsheet/core';\nimport { useBook } from './lib/hooks';\n\n/** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const useSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\n/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const createSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n"],"names":[],"mappings":";;;AAMa,MAAA,eAAe,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAC7E,QAAQ,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;AAG1E,MAAA,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAChF,WAAW,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;"}
1
+ {"version":3,"file":"spellbook.js","sources":["../../react-core/src/spellbook.ts"],"sourcesContent":["import { allFunctions } from '@gridsheet/functions';\nimport type { RegistryProps } from '@gridsheet/web';\nimport { createBook } from '@gridsheet/web';\nimport { useBook } from './lib/hooks';\n\n/** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const useSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\n/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const createSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n"],"names":["createBook"],"mappings":";;AAMa,MAAA,eAAe,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAC7E,QAAQ,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;AAG1E,MAAA,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,KAAK,IAAmB,CAAA,MAChFA,GAAW,EAAE,GAAG,MAAM,qBAAqB,EAAE,GAAG,cAAc,GAAG,oBAAA,EAAuB,CAAA;"}
@@ -1,5 +1,5 @@
1
1
  import { StoreType, RectType, ZoneType, PointType, RangeType, PositionType, RawCellType, OperatorType, FilterConfig } from '../types';
2
- import { Sheet } from '@gridsheet/core';
2
+ import { Sheet } from '@gridsheet/web';
3
3
  type StoreWithCallback = StoreType & {
4
4
  callback?: (store: StoreType) => void;
5
5
  };
@@ -296,6 +296,7 @@ export declare const setColumnMenu: (payload: {
296
296
  y: number;
297
297
  x: number;
298
298
  };
299
+ focusLabel?: boolean;
299
300
  } | null) => {
300
301
  type: number;
301
302
  value: {
@@ -304,6 +305,7 @@ export declare const setColumnMenu: (payload: {
304
305
  y: number;
305
306
  x: number;
306
307
  };
308
+ focusLabel?: boolean;
307
309
  } | null;
308
310
  };
309
311
  export declare const setRowMenu: (payload: {
@@ -1,4 +1,4 @@
1
- import { Sheet } from '@gridsheet/core';
1
+ import { Sheet } from '@gridsheet/web';
2
2
  import { PointType, StorePatchType, StoreType } from '../types';
3
3
  /**
4
4
  * Strip redundant fields from a StorePatchType before recording in history.
package/dist/types.d.ts CHANGED
@@ -1,10 +1,21 @@
1
1
  import { RefObject, CSSProperties, KeyboardEvent } from 'react';
2
- import { Sheet, UserSheet, BookType, PolicyType, ModeType, PointType, ZoneType, RectType, PositionType, CellsByAddressType, SheetLimits } from '@gridsheet/core';
2
+ import { Sheet, UserSheet, BookType, PolicyType, ModeType, DensityType, GridLinesType, MatrixAlignmentType, PointType, ZoneType, RectType, PositionType, CellsByAddressType, SheetLimits } from '@gridsheet/web';
3
3
  import { ContextMenuItemDescriptor, RowMenuItemDescriptor, ColMenuItemDescriptor } from './lib/menu';
4
- export type { CSSPropertiesLike, RefLike, Resolution, Y, X, Height, Width, ShapeType, RectType, MatrixType, CursorStateType, FeedbackType, ModeType, HeadersType, AsyncCache, System, FilterConditionMethod, FilterCondition, FilterConfig, CellType, RawCellType, CellPatchType, CellFilter, CellsByAddressType, CellsByIdType, SystemsByIdType, RangeType, PointType, ExtraPointType, PositionType, ZoneType, AreaType, WriterType, Id, Ids, IdMatrix, Address, MatricesByAddress, StorePatchType, HistoryUpdateType, MoveRelation, MoveRelations, HistoryMoveType, HistoryInsertRowsType, HistoryRemoveRowsType, HistoryInsertColsType, HistoryRemoveColsType, HistorySortRowsType, HistoryType, Virtualization, OperatorType, OperationType, Dispatcher, StoreDispatchType, ContextsBySheetId, SheetIdsByName, RefPaletteType, } from '@gridsheet/core';
4
+ export type { CSSPropertiesLike, RefLike, Resolution, Y, X, Height, Width, ShapeType, RectType, MatrixType, CursorStateType, FeedbackType, ModeType, HeadersType, AsyncCache, System, FilterConditionMethod, FilterCondition, FilterConfig, CellType, RawCellType, CellPatchType, CellFilter, CellsByAddressType, CellsByIdType, SystemsByIdType, RangeType, PointType, ExtraPointType, PositionType, ZoneType, AreaType, WriterType, Id, Ids, IdMatrix, Address, MatricesByAddress, StorePatchType, HistoryUpdateType, MoveRelation, MoveRelations, HistoryMoveType, HistoryInsertRowsType, HistoryRemoveRowsType, HistoryInsertColsType, HistoryRemoveColsType, HistorySortRowsType, HistoryType, Virtualization, OperatorType, OperationType, Dispatcher, StoreDispatchType, ContextsBySheetId, SheetIdsByName, RefPaletteType, } from '@gridsheet/web';
5
5
  export type Policies = {
6
6
  [s: string]: PolicyType;
7
7
  };
8
+ /**
9
+ * Border visibility per side. `all` sets every side; a specific side overrides `all`.
10
+ * e.g. { all: true, bottom: false } => every side except bottom.
11
+ */
12
+ export type BorderSides = {
13
+ all?: boolean;
14
+ left?: boolean;
15
+ top?: boolean;
16
+ right?: boolean;
17
+ bottom?: boolean;
18
+ };
8
19
  export type OptionsType = {
9
20
  sheetHeight?: number | string;
10
21
  sheetWidth?: number | string;
@@ -20,6 +31,19 @@ export type OptionsType = {
20
31
  eager?: boolean;
21
32
  limits?: SheetLimits;
22
33
  mode?: ModeType;
34
+ /** Cell spacing. 'compact' (default) keeps the current metrics; 'comfortable' roomier. */
35
+ density?: DensityType;
36
+ /** Grid line visibility. 'all' (default) | 'horizontal' (no vertical lines) | 'none'. */
37
+ gridLines?: GridLinesType;
38
+ /** Which sides of the formula bar draw a border. Default: { all: true }. */
39
+ formulaBarBorders?: BorderSides;
40
+ /** Which sides of the matrix (cell grid) draw an outer border. Default: { all: true }. */
41
+ matrixBorders?: BorderSides;
42
+ /**
43
+ * Center the matrix inside the sheet box when the box (explicit sheetWidth/sheetHeight,
44
+ * or a manual resize) is larger than the content. Default 'none' keeps top-left.
45
+ */
46
+ matrixAlignment?: MatrixAlignmentType;
23
47
  contextMenu?: ContextMenuItemDescriptor[];
24
48
  rowMenu?: RowMenuItemDescriptor[];
25
49
  colMenu?: ColMenuItemDescriptor[];
@@ -46,6 +70,8 @@ export type StoreType = {
46
70
  dragging: boolean;
47
71
  sheetHeight: number;
48
72
  sheetWidth: number;
73
+ fixedWidth: boolean;
74
+ fixedHeight: boolean;
49
75
  mode: ModeType;
50
76
  searchQuery?: string;
51
77
  searchCaseSensitive: boolean;
@@ -63,6 +89,7 @@ export type StoreType = {
63
89
  columnMenuState: {
64
90
  x: number;
65
91
  position: PositionType;
92
+ focusLabel?: boolean;
66
93
  } | null;
67
94
  rowMenuState: {
68
95
  y: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsheet/preact-core",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "Spreadsheet component for Preact",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/walkframe/gridsheet.git"
11
11
  },
12
12
  "dependencies": {
13
- "@gridsheet/core": "3.1.0"
13
+ "@gridsheet/web": "3.3.0"
14
14
  },
15
15
  "exports": {
16
16
  ".": {
@@ -35,7 +35,8 @@
35
35
  "vite": "^6.2.2",
36
36
  "vite-plugin-dts": "^4.5.3",
37
37
  "@preact/preset-vite": "^2.10.1",
38
- "@gridsheet/functions": "3.1.0"
38
+ "@gridsheet/functions": "3.3.0",
39
+ "@gridsheet/react-core": "3.3.0"
39
40
  },
40
41
  "bugs": {
41
42
  "url": "https://github.com/walkframe/gridsheet/issues"