Skip to content

Commit 17ce028

Browse files
committed
improved debugging
1 parent d22bd55 commit 17ce028

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/spreadsheet.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ICellData,
66
type IObjectMatrixPrimitiveType,
77
type IStyleData,
8+
type IWorkbookData,
89
type IWorksheetData,
910
TextDirection,
1011
VerticalAlign,
@@ -80,12 +81,13 @@ async function buildCellData(dataArray: any[]) {
8081
async function setupUniver(container: HTMLElement) {
8182
const { LocaleType, createUniver, defaultTheme } = await univerPresets;
8283
const { UniverSheetsCorePreset } = await univerPresetsSheets;
83-
const { default: UniverPresetSheetsCoreEnUS } = await univerPresetsSheetsLocale;
84+
const { default: UniverPresetSheetsCoreEnUS } =
85+
await univerPresetsSheetsLocale;
8486

8587
const { univerAPI } = createUniver({
8688
locale: LocaleType.EN_US,
8789
locales: {
88-
[LocaleType.EN_US]: UniverPresetSheetsCoreEnUS
90+
[LocaleType.EN_US]: UniverPresetSheetsCoreEnUS,
8991
},
9092
logLevel: DEBUG ? 3 : 0,
9193
theme: defaultTheme,
@@ -188,14 +190,17 @@ async function renderSpreadsheet(
188190

189191
const univerAPI = await setupUniver(container);
190192

191-
univerAPI.createUniverSheet({
193+
const sheet: Partial<IWorkbookData> = {
192194
sheetOrder: ["sqlpage"],
193195
name: "sqlpage",
194196
appVersion: "0.2.14",
195197
sheets: {
196198
sqlpage: worksheet,
197199
},
198-
});
200+
};
201+
if (DEBUG) console.log("sqlpage-spreadsheet: creating sheet", sheet);
202+
203+
univerAPI.createUniverSheet(sheet);
199204

200205
const { update_link } = props;
201206
univerAPI.onCommandExecuted(({ id, params }) => {
@@ -224,7 +229,6 @@ function handleSetRangeValues(
224229
for (const col in cols) {
225230
const cell = cols[col];
226231
if (!cell) continue;
227-
console.log(cell);
228232
let value = cell.v as CellValue | null | undefined;
229233
if (value == null && cell.p) {
230234
value = cell.p.body?.dataStream?.trimEnd();

0 commit comments

Comments
 (0)