@a3s-lab/office 0.13.1 → 0.14.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.
Files changed (35) hide show
  1. package/README.md +28 -5
  2. package/dist/0~7048.js +14 -4
  3. package/dist/0~spreadsheet-editor.js +9329 -5294
  4. package/dist/internal/features/work/editors/office-checkbox.d.ts +3 -2
  5. package/dist/internal/features/work/editors/spreadsheet-auto-sum-command.d.ts +3 -0
  6. package/dist/internal/features/work/editors/spreadsheet-auto-sum.d.ts +19 -0
  7. package/dist/internal/features/work/editors/spreadsheet-cell-format-command.d.ts +3 -0
  8. package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +36 -0
  9. package/dist/internal/features/work/editors/spreadsheet-cell-mutation-guard.d.ts +4 -0
  10. package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +1 -0
  11. package/dist/internal/features/work/editors/spreadsheet-clipboard.d.ts +13 -0
  12. package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +119 -0
  13. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +38 -0
  14. package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +5 -15
  15. package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +1 -2
  16. package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +86 -0
  17. package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-panels.d.ts +15 -0
  18. package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog.d.ts +8 -0
  19. package/dist/internal/features/work/editors/spreadsheet-go-to.d.ts +24 -0
  20. package/dist/internal/features/work/editors/spreadsheet-keyboard-navigation.d.ts +4 -0
  21. package/dist/internal/features/work/editors/spreadsheet-navigation-command.d.ts +3 -0
  22. package/dist/internal/features/work/editors/spreadsheet-number-format-command.d.ts +24 -0
  23. package/dist/internal/features/work/editors/spreadsheet-paste-special-cell.d.ts +17 -0
  24. package/dist/internal/features/work/editors/spreadsheet-paste-special-dialog.d.ts +9 -0
  25. package/dist/internal/features/work/editors/spreadsheet-paste-special-mode.d.ts +11 -0
  26. package/dist/internal/features/work/editors/spreadsheet-paste-special-plan.d.ts +4 -0
  27. package/dist/internal/features/work/editors/spreadsheet-paste-special-sheet.d.ts +23 -0
  28. package/dist/internal/features/work/editors/spreadsheet-paste-special-snapshot.d.ts +10 -0
  29. package/dist/internal/features/work/editors/spreadsheet-paste-special-types.d.ts +127 -0
  30. package/dist/internal/features/work/editors/spreadsheet-paste-special.d.ts +7 -0
  31. package/dist/internal/features/work/editors/use-spreadsheet-clipboard.d.ts +36 -0
  32. package/dist/office-kernel.wasm +0 -0
  33. package/dist/styles.css +548 -1
  34. package/docs/latest/en/browser-editor-architecture.md +12 -1
  35. package/package.json +9 -3
package/README.md CHANGED
@@ -517,16 +517,24 @@ interaction model.
517
517
  selection-preserving undo/redo, deterministic Arrow, Enter, Tab, Home,
518
518
  PageUp/PageDown, row, column, and all-cells selection shortcuts, Cmd/Ctrl
519
519
  formatting through root-scoped capture before vendor grid listeners, an
520
- editor-owned Cmd/Ctrl+F search bar that finds displayed values, raw values,
521
- formulas, and sparse cells without opening browser Find, with a viewport-safe
522
- phone layout, touch-sized controls, and exact grid-focus restoration,
520
+ WPS-style Home and Editing Find and Select menu whose editor-owned
521
+ `Cmd/Ctrl+F` search finds displayed values, raw values, formulas, and sparse
522
+ cells without opening browser Find, plus view-only `Ctrl+G` and `F5` Go To
523
+ for direct, quoted cross-sheet, and named ranges without content updates,
524
+ Undo records, or sparse materialization, with a viewport-safe phone Find
525
+ layout, touch-sized controls, bounded validation, and exact focus restoration,
523
526
  desktop workbook task panes that become focus-contained phone dialogs with
524
527
  an inert workbook background and exact ribbon-invoker restoration,
525
528
  a WPS-familiar command catalog and tab order, quick-access Undo and Redo,
526
529
  a priority-aware adaptive and collapsible ribbon with temporary tab
527
530
  expansion, an executable Home clipboard group whose Paste, Cut, and Copy
528
531
  commands share the permission-resilient local fallback with their WPS
529
- shortcuts, a WPS-style Format Painter with single-use and double-click locked
532
+ shortcuts, a WPS-style Paste split command with quick All, Values, Formulas,
533
+ and Formatting actions plus `Cmd/Ctrl+Alt+V` Paste Special for ten content
534
+ modes, arithmetic operations, Skip blanks, Transpose, translated formula
535
+ references, rich same-editor styles/comments/validation/merges/column widths,
536
+ bounded TSV fallback, one-step Undo, and fail-closed protected or unsafe
537
+ targets, a WPS-style Format Painter with single-use and double-click locked
530
538
  sessions, cross-sheet range-pattern tiling, Escape cancellation, and native
531
539
  style-only writes, a Home and Font cell-border split control with side, all,
532
540
  outside, inside, horizontal, vertical, clear, and diagonal targets, ten
@@ -547,10 +555,24 @@ interaction model.
547
555
  relative-formula and style propagation, WPS `Cmd/Ctrl+D` and `Cmd/Ctrl+R`
548
556
  shortcuts, one-step history, protected-range preflight, a 50,000-target-cell
549
557
  guard, and sparse-row-safe execution,
558
+ a WPS AutoSum split command before Fill with Sum, Average, Count, Maximum,
559
+ and Minimum, the editor-scoped `Alt+=` Sum shortcut, contiguous source
560
+ inference above or left of a blank target, multi-formula totals rows and
561
+ columns, target-style preservation, merged/protected/read-only/pivot and
562
+ overwrite preflight, a 1,000-formula bound, sparse-safe native batches, and
563
+ one-step history,
550
564
  Home and Number presets for General, Number, CNY Currency, Accounting,
551
565
  Percentage, Short Date, Time, Scientific, Fraction, and Text, including the
552
566
  seven standard `Cmd/Ctrl+Shift` format shortcuts, exact XLSX format-code
553
- round trips, value/formula preservation, and one-step history,
567
+ round trips, value/formula preservation, and one-step history, plus
568
+ 10,000-cell-bounded Increase/Decrease Decimal commands that retain every
569
+ cell's format family across mixed selections and commit one native batch,
570
+ a WPS-style Format Cells dialog under Home and Number with the editor-scoped
571
+ `Cmd/Ctrl+1` shortcut, functional Number, Alignment, Font, Border, Fill, and
572
+ Protection tabs, untouched mixed-value preservation, custom native number
573
+ codes, compact protection ranges, dense/sparse representation retention,
574
+ bounded blank-cell materialization, one controlled update and one Undo
575
+ record per Apply, and exact launcher or remounted-grid focus restoration,
554
576
  a Home and Styles gallery with 17 WPS built-in cell styles grouped as Common,
555
577
  Data and Model, and Titles and Totals, true native previews, two-dimensional
556
578
  keyboard navigation, a 10,000-cell bound, blank-cell styling, per-cell border
@@ -1462,6 +1484,7 @@ without hard-coded return URLs.
1462
1484
 
1463
1485
  - [Live Playground](https://a3s-lab.github.io/Office/)
1464
1486
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1487
+ - [A3S Office 0.14.0 documentation](https://a3s-lab.github.io/Office/docs/0.14.0/)
1465
1488
  - [A3S Office 0.13.1 documentation](https://a3s-lab.github.io/Office/docs/0.13.1/)
1466
1489
  - [A3S Office 0.13.0 documentation](https://a3s-lab.github.io/Office/docs/0.13.0/)
1467
1490
  - [A3S Office 0.12.0 documentation](https://a3s-lab.github.io/Office/docs/0.12.0/)
package/dist/0~7048.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useId, useRef, useState } from "react";
3
- import { Check, ChevronDown, ChevronUp } from "lucide-react";
3
+ import { Check, ChevronDown, ChevronUp, Minus } from "lucide-react";
4
4
  import { Dialog } from "./0~4595.js";
5
5
  import { button_Button, office_text_field_OfficeTextField, office_text_field_OfficeTextArea } from "./0~6090.js";
6
6
  import { OFFICE_KERNEL_SPREADSHEET_MAX_ROWS as office_kernel_spreadsheet_protocol_OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, isOfficeKernelSpreadsheetError } from "./5184.js";
@@ -433,13 +433,21 @@ function safelyNormalizeOfficeNumberDraft(normalizeValue, draft) {
433
433
  return null;
434
434
  }
435
435
  }
436
- function OfficeCheckbox({ ariaLabel, checked, onCheckedChange, children, disabled = false, className = '' }) {
436
+ function OfficeCheckbox({ ariaLabel, checked, onCheckedChange, children, disabled = false, className = '', indeterminate = false }) {
437
+ const inputRef = useRef(null);
438
+ useEffect(()=>{
439
+ if (inputRef.current) inputRef.current.indeterminate = indeterminate;
440
+ }, [
441
+ indeterminate
442
+ ]);
437
443
  return /*#__PURE__*/ jsxs("label", {
438
- className: `work-office-checkbox ${checked ? 'checked' : ''} ${disabled ? 'disabled' : ''} ${className}`.trim(),
444
+ className: `work-office-checkbox ${checked ? 'checked' : ''} ${indeterminate ? 'indeterminate' : ''} ${disabled ? 'disabled' : ''} ${className}`.trim(),
439
445
  children: [
440
446
  /*#__PURE__*/ jsx("input", {
447
+ ref: inputRef,
441
448
  type: "checkbox",
442
449
  "aria-label": ariaLabel,
450
+ "aria-checked": indeterminate ? 'mixed' : checked,
443
451
  checked: checked,
444
452
  disabled: disabled,
445
453
  onChange: (event)=>onCheckedChange(event.target.checked)
@@ -447,7 +455,9 @@ function OfficeCheckbox({ ariaLabel, checked, onCheckedChange, children, disable
447
455
  /*#__PURE__*/ jsx("span", {
448
456
  className: "work-office-checkbox-box",
449
457
  "aria-hidden": "true",
450
- children: checked && /*#__PURE__*/ jsx(Check, {
458
+ children: indeterminate ? /*#__PURE__*/ jsx(Minus, {
459
+ size: 11
460
+ }) : checked && /*#__PURE__*/ jsx(Check, {
451
461
  size: 11
452
462
  })
453
463
  }),