@mog-sdk/node 0.1.8 → 0.1.9-beta.2

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.
package/dist/index.cjs CHANGED
@@ -79377,10 +79377,10 @@ async function getPrecedents(ctx, sheetId, row, col) {
79377
79377
  init_cjs_shims();
79378
79378
  init_errors();
79379
79379
  function computeDirection(source, target) {
79380
- if (target.startRow > source.endRow) return "down";
79381
- if (target.endRow < source.startRow) return "up";
79382
- if (target.startCol > source.endCol) return "right";
79383
- if (target.endCol < source.startCol) return "left";
79380
+ if (target.endRow > source.endRow) return "down";
79381
+ if (target.startRow < source.startRow) return "up";
79382
+ if (target.endCol > source.endCol) return "right";
79383
+ if (target.startCol < source.startCol) return "left";
79384
79384
  return "down";
79385
79385
  }
79386
79386
  function modeToFlags(mode) {
@@ -87537,8 +87537,16 @@ var WorksheetImpl = class {
87537
87537
  // ===========================================================================
87538
87538
  // Identity (sync)
87539
87539
  // ===========================================================================
87540
- getName() {
87541
- return this._cachedName ?? this.sheetId;
87540
+ async getName() {
87541
+ if (this._cachedName != null) {
87542
+ return this._cachedName;
87543
+ }
87544
+ const name = await this.ctx.computeBridge.getSheetName(this.sheetId);
87545
+ if (name != null) {
87546
+ this._cachedName = name;
87547
+ return name;
87548
+ }
87549
+ return this.sheetId;
87542
87550
  }
87543
87551
  async setName(name) {
87544
87552
  await renameSheet(this.ctx, this.sheetId, name);
@@ -90382,14 +90390,20 @@ var WorkbookImpl = class {
90382
90390
  }
90383
90391
  /**
90384
90392
  * Initialize the workbook. Called by createWorkbook() factory.
90393
+ *
90394
+ * Pre-creates WorksheetImpl instances for all sheets and populates their
90395
+ * cached metadata (name, index, visibility) so that sync accessors like
90396
+ * getName() work immediately without a separate refreshSheetMetadata() call.
90385
90397
  */
90386
90398
  async _init() {
90387
- if (this._ownsActiveSheetTracking) {
90388
- const order = await getOrder(this.ctx);
90389
- if (order.length > 0) {
90390
- this.setActiveSheetIdFn(order[0]);
90391
- }
90399
+ const order = await getOrder(this.ctx);
90400
+ if (this._ownsActiveSheetTracking && order.length > 0) {
90401
+ this.setActiveSheetIdFn(order[0]);
90402
+ }
90403
+ for (const sheetId of order) {
90404
+ this._getOrCreateWorksheet(sheetId);
90392
90405
  }
90406
+ await this.refreshSheetMetadata();
90393
90407
  }
90394
90408
  /**
90395
90409
  * Resolve a name or index to a sheetId. ASYNC — reads from Rust.
@@ -91015,7 +91029,6 @@ async function createWorkbookWithBootstrap(options) {
91015
91029
  ctx: handle.context,
91016
91030
  eventBus
91017
91031
  });
91018
- await wb.refreshSheetMetadata();
91019
91032
  const originalDispose = wb.dispose.bind(wb);
91020
91033
  wb.dispose = () => {
91021
91034
  originalDispose();
@@ -91454,8 +91467,8 @@ var api_spec_default = {
91454
91467
  docstring: "",
91455
91468
  functions: {
91456
91469
  getName: {
91457
- signature: "getName(): string;",
91458
- docstring: "Get the sheet name.",
91470
+ signature: "getName(): Promise<string>;",
91471
+ docstring: "Get the sheet name. Async \u2014 reads from Rust via IPC (cached after first call).",
91459
91472
  usedTypes: [],
91460
91473
  tags: [
91461
91474
  "ask"
@@ -97517,7 +97530,7 @@ Used in condition filters where users specify rules like
97517
97530
  docstring: "A summary snapshot of the entire workbook state."
97518
97531
  }
97519
97532
  },
97520
- generated: "2026-03-31T22:12:29.100Z"
97533
+ generated: "2026-04-01T03:19:27.745Z"
97521
97534
  };
97522
97535
 
97523
97536
  // src/api-describe.ts