@coco-vexel/coco-office-editor 1.0.10 → 1.0.12

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 (46) hide show
  1. package/dist/index.cjs +1519 -28489
  2. package/dist/index.d.cts +3 -3
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +1518 -28267
  5. package/dist/{model-DT8Dw2G6.d.cts → model-CgISL5eB.d.cts} +2 -0
  6. package/dist/{model-DT8Dw2G6.d.ts → model-CgISL5eB.d.ts} +2 -0
  7. package/dist/{native-C3ZdrIcW.d.ts → native-D9lhNG94.d.ts} +2 -1
  8. package/dist/{native-wR2uhZvi.d.cts → native-DVRWKaOC.d.cts} +2 -1
  9. package/dist/ppt-native.cjs +7 -5369
  10. package/dist/ppt-native.js +7 -5367
  11. package/dist/ppt.cjs +7 -5462
  12. package/dist/ppt.js +7 -5445
  13. package/dist/spreadsheet.cjs +17 -5789
  14. package/dist/spreadsheet.d.cts +25 -6
  15. package/dist/spreadsheet.d.ts +25 -6
  16. package/dist/spreadsheet.js +17 -5718
  17. package/dist/word-editing.cjs +2 -812
  18. package/dist/word-editing.js +2 -803
  19. package/dist/word-native.cjs +1541 -13831
  20. package/dist/word-native.d.cts +2 -2
  21. package/dist/word-native.d.ts +2 -2
  22. package/dist/word-native.js +1541 -13723
  23. package/dist/word-prosemirror.cjs +1 -489
  24. package/dist/word-prosemirror.js +1 -483
  25. package/dist/word.cjs +1373 -17298
  26. package/dist/word.d.cts +5 -5
  27. package/dist/word.d.ts +5 -5
  28. package/dist/word.js +1373 -17163
  29. package/package.json +3 -3
  30. package/src/styles/editor.css +49 -5
  31. package/dist/index.cjs.map +0 -1
  32. package/dist/index.js.map +0 -1
  33. package/dist/ppt-native.cjs.map +0 -1
  34. package/dist/ppt-native.js.map +0 -1
  35. package/dist/ppt.cjs.map +0 -1
  36. package/dist/ppt.js.map +0 -1
  37. package/dist/spreadsheet.cjs.map +0 -1
  38. package/dist/spreadsheet.js.map +0 -1
  39. package/dist/word-editing.cjs.map +0 -1
  40. package/dist/word-editing.js.map +0 -1
  41. package/dist/word-native.cjs.map +0 -1
  42. package/dist/word-native.js.map +0 -1
  43. package/dist/word-prosemirror.cjs.map +0 -1
  44. package/dist/word-prosemirror.js.map +0 -1
  45. package/dist/word.cjs.map +0 -1
  46. package/dist/word.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coco-vexel/coco-office-editor",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -73,7 +73,7 @@
73
73
  "THIRD_PARTY_NOTICES.md"
74
74
  ],
75
75
  "dependencies": {
76
- "@coco-vexel/coco-office": "^1.0.10",
76
+ "@coco-vexel/coco-office": "^1.0.12",
77
77
  "prosemirror-commands": "^1.7.2",
78
78
  "prosemirror-keymap": "^1.2.3",
79
79
  "prosemirror-model": "^1.25.12",
@@ -86,7 +86,7 @@
86
86
  "jszip": "^3.10.2",
87
87
  "vite": "^8.3.5",
88
88
  "vitest": "^5.0.5",
89
- "@coco-vexel/coco-office-oojson": "^1.0.10"
89
+ "@coco-vexel/coco-office-oojson": "^1.0.12"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "tsup",
@@ -668,6 +668,16 @@ coco-word-native-page > coco-word-native-story[data-story-kind="header"] {
668
668
  top: var(--coco-word-header-distance, 0);
669
669
  }
670
670
 
671
+ /* With a nonnegative top margin Word moves the body down if the header outgrows
672
+ its reserved space. Let the same flex layout that pagination measures do this. */
673
+ coco-word-native-page:not([data-fixed-top-margin]) > coco-word-native-story[data-story-kind="header"] {
674
+ position: relative;
675
+ inset: auto;
676
+ flex: none;
677
+ margin-top: calc(var(--coco-word-header-distance) - var(--coco-word-page-margin-top));
678
+ min-height: max(0px, calc(var(--coco-word-page-margin-top) - var(--coco-word-header-distance)));
679
+ }
680
+
671
681
  coco-word-native-page > coco-word-native-story[data-story-kind="footer"] {
672
682
  bottom: var(--coco-word-footer-distance, 0);
673
683
  }
@@ -806,6 +816,12 @@ coco-word-native-p.has-tab-stops {
806
816
  display: none;
807
817
  }
808
818
 
819
+ /* In a monospace face the ASCII space and '0' both advance by exactly 1ch. */
820
+ .coco-word-songti-spaces {
821
+ font-family: monospace;
822
+ word-spacing: calc(0.5em - 1ch);
823
+ }
824
+
809
825
  coco-word-native-p[data-numbering="true"] {
810
826
  margin-left: 2.8em;
811
827
  padding-right: 0.5em;
@@ -836,20 +852,37 @@ coco-word-native-table {
836
852
  margin: 0;
837
853
  max-width: 100%;
838
854
  overflow: auto;
839
- scrollbar-gutter: stable;
840
855
  --coco-word-doc-grid-line-height: 1em;
841
856
  white-space: pre-wrap;
842
857
  }
843
858
 
844
859
  coco-word-native-table table {
845
860
  box-sizing: border-box;
846
- min-width: 100%;
861
+ width: 100%;
847
862
  max-width: none;
848
863
  margin: 0;
849
864
  border-collapse: collapse;
850
865
  table-layout: fixed;
851
866
  }
852
867
 
868
+ coco-word-native-table table[data-layout="autofit"] {
869
+ table-layout: auto;
870
+ }
871
+
872
+ coco-word-native-table table[data-layout="autofit"] > tbody > tr > td {
873
+ min-width: 0;
874
+ }
875
+
876
+ /* Keep whole words in the intrinsic width used by AutoFit. */
877
+ coco-word-native-table table[data-layout="autofit"] > tbody > tr > td > coco-word-native-p {
878
+ word-break: normal;
879
+ overflow-wrap: break-word;
880
+ }
881
+
882
+ coco-word-native-table table[data-layout="autofit"] > tbody > tr > td > coco-word-native-p.is-single-cjk-word {
883
+ word-break: keep-all;
884
+ }
885
+
853
886
  coco-word-native-table tbody {
854
887
  display: table-row-group;
855
888
  }
@@ -871,9 +904,20 @@ coco-word-native-table td {
871
904
  vertical-align: top;
872
905
  }
873
906
 
874
- /* Editor-only gridlines keep borderless OOXML tables legible without changing their document formatting. */
875
- coco-word-native-table.shows-auxiliary-gridlines > table > tbody > tr > td {
876
- border: 1px dashed rgb(148 163 184 / 72%) !important;
907
+ /* Guides sit inside the cell so they don't affect text wrapping or pagination. */
908
+ @media screen {
909
+ coco-word-native-table td.has-editing-gridlines {
910
+ position: relative;
911
+ }
912
+
913
+ coco-word-native-table td.has-editing-gridlines::before {
914
+ content: "";
915
+ position: absolute;
916
+ inset: 0;
917
+ pointer-events: none;
918
+ border: dashed #bfc3c8;
919
+ border-width: var(--coco-word-grid-widths);
920
+ }
877
921
  }
878
922
 
879
923
  coco-word-native-table td coco-word-native-p {