@a3s-lab/office 0.35.0 → 0.37.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.
package/dist/styles.css CHANGED
@@ -18364,6 +18364,113 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
18364
18364
  min-width: 76px;
18365
18365
  }
18366
18366
 
18367
+ .work-spreadsheet-table-totals-root {
18368
+ display: flex;
18369
+ }
18370
+
18371
+ .work-office-ribbon .work-spreadsheet-table-totals-trigger {
18372
+ min-width: 70px;
18373
+ }
18374
+
18375
+ .work-spreadsheet-table-totals-menu {
18376
+ border: 1px solid var(--a3s-overlay-border);
18377
+ border-radius: var(--a3s-overlay-radius);
18378
+ background: var(--a3s-overlay-surface);
18379
+ width: min(560px, 100vw - 24px);
18380
+ max-height: min(650px, 100vh - 32px);
18381
+ box-shadow: var(--a3s-shadow-soft);
18382
+ padding: 14px;
18383
+ overflow: auto;
18384
+ }
18385
+
18386
+ .work-spreadsheet-table-totals-content {
18387
+ gap: 10px;
18388
+ display: grid;
18389
+ }
18390
+
18391
+ .work-spreadsheet-table-totals-hint {
18392
+ color: var(--a3s-muted);
18393
+ margin: -4px 0 2px;
18394
+ font-size: 11px;
18395
+ line-height: 1.45;
18396
+ }
18397
+
18398
+ .work-spreadsheet-table-totals-columns {
18399
+ gap: 8px;
18400
+ max-height: 440px;
18401
+ padding-right: 2px;
18402
+ display: grid;
18403
+ overflow: auto;
18404
+ }
18405
+
18406
+ .work-spreadsheet-table-totals-column {
18407
+ border: 1px solid var(--a3s-line);
18408
+ background: var(--a3s-panel-soft);
18409
+ border-radius: 7px;
18410
+ grid-template-columns: minmax(92px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr);
18411
+ align-items: end;
18412
+ gap: 7px;
18413
+ padding: 9px;
18414
+ display: grid;
18415
+ }
18416
+
18417
+ .work-spreadsheet-table-totals-column > strong {
18418
+ color: var(--a3s-ink);
18419
+ text-overflow: ellipsis;
18420
+ white-space: nowrap;
18421
+ grid-column: 1 / -1;
18422
+ font-size: 11px;
18423
+ font-weight: 650;
18424
+ overflow: hidden;
18425
+ }
18426
+
18427
+ .work-spreadsheet-table-totals-column label {
18428
+ gap: 3px;
18429
+ min-width: 0;
18430
+ display: grid;
18431
+ }
18432
+
18433
+ .work-spreadsheet-table-totals-column label > span {
18434
+ color: var(--a3s-muted);
18435
+ font-size: 9px;
18436
+ line-height: 1;
18437
+ }
18438
+
18439
+ .work-spreadsheet-table-totals-column select, .work-spreadsheet-table-totals-column input {
18440
+ box-sizing: border-box;
18441
+ border: 1px solid var(--a3s-line-strong);
18442
+ background: var(--a3s-panel);
18443
+ width: 100%;
18444
+ min-width: 0;
18445
+ height: 28px;
18446
+ color: var(--a3s-ink);
18447
+ border-radius: 5px;
18448
+ padding: 0 7px;
18449
+ font-size: 11px;
18450
+ }
18451
+
18452
+ .work-spreadsheet-table-totals-column select:disabled, .work-spreadsheet-table-totals-column input:disabled {
18453
+ cursor: not-allowed;
18454
+ opacity: .55;
18455
+ }
18456
+
18457
+ .work-spreadsheet-table-totals-close {
18458
+ border: 1px solid var(--work-spreadsheet-accent, #159469);
18459
+ background: var(--work-spreadsheet-accent, #159469);
18460
+ color: #fff;
18461
+ cursor: pointer;
18462
+ border-radius: 5px;
18463
+ justify-self: end;
18464
+ min-height: 29px;
18465
+ padding: 0 13px;
18466
+ font-size: 11px;
18467
+ font-weight: 650;
18468
+ }
18469
+
18470
+ .work-spreadsheet-table-totals-close:hover, .work-spreadsheet-table-totals-close:focus-visible {
18471
+ filter: brightness(.94);
18472
+ }
18473
+
18367
18474
  .work-spreadsheet-table-style-preview {
18368
18475
  background: #fff;
18369
18476
  border: 1px solid #0f172a29;
@@ -18455,6 +18562,19 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
18455
18562
  padding: 8px;
18456
18563
  }
18457
18564
 
18565
+ .work-spreadsheet-table-totals-menu {
18566
+ width: min(440px, 100vw - 16px);
18567
+ padding: 10px;
18568
+ }
18569
+
18570
+ .work-spreadsheet-table-totals-column {
18571
+ grid-template-columns: 1fr 1fr;
18572
+ }
18573
+
18574
+ .work-spreadsheet-table-totals-column label:last-child {
18575
+ grid-column: 1 / -1;
18576
+ }
18577
+
18458
18578
  .work-spreadsheet-table-style-family > div {
18459
18579
  grid-template-columns: repeat(5, minmax(0, 1fr));
18460
18580
  }
@@ -603,11 +603,16 @@ tests. Successful scalar results are applied without adding undo history,
603
603
  known grouped formulas refresh before their dependents, and unresolved
604
604
  dependencies enter an ordered, cell-scoped Fortune Sheet compatibility pass.
605
605
  The shared Rust parser handles the same bounded formula grammar in the native
606
- core and browser kernel. This is not a complete Excel engine: Fortune Sheet
607
- remains the canonical grid, initial and replacement sparse projection still
608
- run on the main thread, and the kernel does not materialize whole-row or
609
- whole-column ranges, calculate arrays, spills, structured references or
610
- external workbooks, own number formatting, or own print layout.
606
+ core and browser kernel. The current table slice resolves names/display names,
607
+ worksheet-qualified tables, contiguous column ranges, `#All`, `#Headers`,
608
+ `#Data`, `#Totals`, `#This Row`, and table-local `[@Column]` formulas. It is not
609
+ a complete Excel engine: Fortune Sheet remains the canonical grid, initial and
610
+ replacement sparse projection still run on the main thread, and the kernel
611
+ does not materialize whole-row or whole-column ranges, calculate arrays, spills,
612
+ external workbooks, own number formatting, or own print layout. Structured
613
+ areas are capped at 100,000 cells and requests at 1,024 tables; disjoint,
614
+ three-dimensional, missing, or over-budget references fail closed with a
615
+ cell-scoped diagnostic.
611
616
  Presentation sends alignment plus move and resize snapping to Rust/WASM. The
612
617
  main thread treats an ordered selection as one bounded geometry frame, paints
613
618
  at most one transient preview per animation frame, and ignores stale geometry
@@ -1419,8 +1424,20 @@ row/column operations reconcile table structure, and Convert to Range
1419
1424
  materializes appearance through a sparse-safe path. XLSX table parts,
1420
1425
  relationships, content types, styles, and supported filters round-trip, while
1421
1426
  Yjs uses ordered ID-keyed records and creation claims for two-client
1422
- convergence. Structured-reference calculation, calculated columns, complete
1423
- totals authoring, slicers, and external/query tables remain open gates.
1427
+ convergence. The follow-up structured-reference slice now shares the parser and
1428
+ dependency session with native calculation, including calculated-column
1429
+ formulas authored on data rows and totals/header/data selectors. A consistent
1430
+ current-row rule is persisted in the table metadata and fills only empty cells
1431
+ in newly inserted body rows; manual values and conflicting formulas fail closed.
1432
+ Dense and sparse sheet representations use the same path, and native XLSX
1433
+ `<calculatedColumnFormula>` metadata round-trips. Native totals-row authoring
1434
+ now extends the same model: Table Design controls the row and each column's
1435
+ label, aggregate, or custom formula; native aggregates map to filter-aware
1436
+ `SUBTOTAL` codes; generated cells are reconciled after direct edits, row/column
1437
+ changes, and table renames; and `totalsRowFunction`, `totalsRowLabel`, and
1438
+ `totalsRowFormula` survive XLSX and Yjs round trips. Occupied, merged,
1439
+ protected, overlapping, AutoFilter, unsafe, external, and over-budget targets
1440
+ fail closed. Slicers and external/query tables remain open gates.
1424
1441
 
1425
1442
  Exit criteria: scrolling and selection do not scale with total row count;
1426
1443
  incremental recalculation touches only affected dependency subgraphs; XLSX
@@ -1642,7 +1659,9 @@ The XLSX row above is a rectangular one-million-cell data fixture, not a
1642
1659
  semantic `WorkSpreadsheetTable`/OOXML ListObject benchmark. It proves the
1643
1660
  plain-workbook import and visible-range Canvas path; it must not be used to
1644
1661
  claim that structured-reference calculation, calculated columns, totals,
1645
- filters, or table conversion have the same profile. A dedicated large
1662
+ filters, or table conversion have the same profile. Calculated-column fill is
1663
+ bounded by the inserted-row operation and has correctness coverage, but no
1664
+ large-ListObject latency or memory number is published yet. A dedicated large
1646
1665
  ListObject matrix remains required before publishing table-specific load,
1647
1666
  mutation, conversion, and export budgets.
1648
1667
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -114,6 +114,7 @@
114
114
  "playground:visual:spreadsheet-rich-text": "playwright test visual-tests/spreadsheet-rich-text.functional.spec.ts --config playwright.config.ts",
115
115
  "playground:visual:spreadsheet-underline": "playwright test visual-tests/spreadsheet-underline.functional.spec.ts --config playwright.config.ts",
116
116
  "playground:visual:spreadsheet-table": "playwright test visual-tests/spreadsheet-table.functional.spec.ts --config playwright.config.ts",
117
+ "playground:visual:spreadsheet-table-totals": "playwright test visual-tests/spreadsheet-table-totals.functional.spec.ts --config playwright.config.ts",
117
118
  "playground:visual:presentation-animation": "playwright test visual-tests/presentation-animation.functional.spec.ts --config playwright.config.ts",
118
119
  "playground:visual:pdf-page-organization": "playwright test visual-tests/pdf-page-organization.functional.spec.ts --config playwright.config.ts",
119
120
  "playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
@@ -178,6 +179,8 @@
178
179
  "test:e2e:spreadsheet-underline-styles:check": "a3s-test check tests/e2e/spreadsheet-underline-styles.acl --json",
179
180
  "test:e2e:spreadsheet-table": "a3s-test run tests/e2e/spreadsheet-table.acl --json",
180
181
  "test:e2e:spreadsheet-table:check": "a3s-test check tests/e2e/spreadsheet-table.acl --json",
182
+ "test:e2e:spreadsheet-table-totals": "a3s-test run tests/e2e/spreadsheet-table-totals.acl --json",
183
+ "test:e2e:spreadsheet-table-totals:check": "a3s-test check tests/e2e/spreadsheet-table-totals.acl --json",
181
184
  "test:e2e:spreadsheet-cell-fill": "a3s-test run tests/e2e/spreadsheet-cell-fill.acl --json",
182
185
  "test:e2e:spreadsheet-cell-fill:check": "a3s-test check tests/e2e/spreadsheet-cell-fill.acl --json",
183
186
  "test:e2e:spreadsheet-auto-sum": "a3s-test run tests/e2e/spreadsheet-auto-sum.acl --json",