logisheets-core 1.7.0 → 1.8.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.
@@ -6,6 +6,8 @@ export interface FontStyle {
6
6
  color?: string;
7
7
  size?: number;
8
8
  strike?: boolean;
9
+ /** Font family name, e.g. "Arial", "Times New Roman", "微软雅黑". */
10
+ name?: string;
9
11
  }
10
12
  export declare function generateFontPayload(sheetIdx: number, data: SelectedData, update: FontStyle): readonly Payload[];
11
13
  export declare function generateAlgnmentPayload(sheetIdx: number, data: SelectedData, alignment: Alignment): readonly Payload[];
@@ -52,6 +52,8 @@ export function generateFontPayload(sheetIdx, data, update) {
52
52
  cellTy.setFontSize = update.size;
53
53
  if (update.strike !== undefined)
54
54
  cellTy.setFontStrike = update.strike;
55
+ if (update.name)
56
+ cellTy.setFontName = update.name;
55
57
  const d = data.data.d;
56
58
  const result = [];
57
59
  for (let i = d.startRow; i <= d.endRow; i += 1)
@@ -69,6 +71,12 @@ export function generateFontPayload(sheetIdx, data, update) {
69
71
  lineTy.setFontItalic = update.italic;
70
72
  if (update.color)
71
73
  lineTy.setFontColor = update.color;
74
+ if (update.size)
75
+ lineTy.setFontSize = update.size;
76
+ if (update.strike !== undefined)
77
+ lineTy.setFontStrike = update.strike;
78
+ if (update.name)
79
+ lineTy.setFontName = update.name;
72
80
  return [lineStyle(sheetIdx, d.start, d.end, d.type === 'row', lineTy)];
73
81
  }
74
82
  export function generateAlgnmentPayload(sheetIdx, data, alignment) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "logisheets-core",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "UI-free LogiSheets logic — runs in the browser or on Node. Depends on logisheets-web only for types; the engine Client is injected by the host.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "author": "Jeremy He",
45
45
  "license": "MIT",
46
46
  "peerDependencies": {
47
- "logisheets-web": "^1.7.0"
47
+ "logisheets-web": "^1.8.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "logisheets-web": "workspace:*",