@univerjs/docs-ui 1.1.0 → 1.3.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 (102) hide show
  1. package/README.md +45 -0
  2. package/lib/cjs/index.js +822 -243
  3. package/lib/cjs/locale/ar-SA.js +4 -0
  4. package/lib/cjs/locale/ca-ES.js +4 -0
  5. package/lib/cjs/locale/de-DE.js +4 -0
  6. package/lib/cjs/locale/en-US.js +4 -0
  7. package/lib/cjs/locale/es-ES.js +4 -0
  8. package/lib/cjs/locale/fa-IR.js +4 -0
  9. package/lib/cjs/locale/fr-FR.js +4 -0
  10. package/lib/cjs/locale/id-ID.js +4 -0
  11. package/lib/cjs/locale/it-IT.js +4 -0
  12. package/lib/cjs/locale/ja-JP.js +4 -0
  13. package/lib/cjs/locale/ko-KR.js +4 -0
  14. package/lib/cjs/locale/pl-PL.js +4 -0
  15. package/lib/cjs/locale/pt-BR.js +4 -0
  16. package/lib/cjs/locale/ru-RU.js +4 -0
  17. package/lib/cjs/locale/sk-SK.js +4 -0
  18. package/lib/cjs/locale/vi-VN.js +4 -0
  19. package/lib/cjs/locale/zh-CN.js +4 -0
  20. package/lib/cjs/locale/zh-HK.js +4 -0
  21. package/lib/cjs/locale/zh-TW.js +4 -0
  22. package/lib/es/index.js +826 -248
  23. package/lib/es/locale/ar-SA.js +4 -0
  24. package/lib/es/locale/ca-ES.js +4 -0
  25. package/lib/es/locale/de-DE.js +4 -0
  26. package/lib/es/locale/en-US.js +4 -0
  27. package/lib/es/locale/es-ES.js +4 -0
  28. package/lib/es/locale/fa-IR.js +4 -0
  29. package/lib/es/locale/fr-FR.js +4 -0
  30. package/lib/es/locale/id-ID.js +4 -0
  31. package/lib/es/locale/it-IT.js +4 -0
  32. package/lib/es/locale/ja-JP.js +4 -0
  33. package/lib/es/locale/ko-KR.js +4 -0
  34. package/lib/es/locale/pl-PL.js +4 -0
  35. package/lib/es/locale/pt-BR.js +4 -0
  36. package/lib/es/locale/ru-RU.js +4 -0
  37. package/lib/es/locale/sk-SK.js +4 -0
  38. package/lib/es/locale/vi-VN.js +4 -0
  39. package/lib/es/locale/zh-CN.js +4 -0
  40. package/lib/es/locale/zh-HK.js +4 -0
  41. package/lib/es/locale/zh-TW.js +4 -0
  42. package/lib/index.css +40 -78
  43. package/lib/index.js +826 -248
  44. package/lib/locale/ar-SA.js +4 -0
  45. package/lib/locale/ca-ES.js +4 -0
  46. package/lib/locale/de-DE.js +4 -0
  47. package/lib/locale/en-US.js +4 -0
  48. package/lib/locale/es-ES.js +4 -0
  49. package/lib/locale/fa-IR.js +4 -0
  50. package/lib/locale/fr-FR.js +4 -0
  51. package/lib/locale/id-ID.js +4 -0
  52. package/lib/locale/it-IT.js +4 -0
  53. package/lib/locale/ja-JP.js +4 -0
  54. package/lib/locale/ko-KR.js +4 -0
  55. package/lib/locale/pl-PL.js +4 -0
  56. package/lib/locale/pt-BR.js +4 -0
  57. package/lib/locale/ru-RU.js +4 -0
  58. package/lib/locale/sk-SK.js +4 -0
  59. package/lib/locale/vi-VN.js +4 -0
  60. package/lib/locale/zh-CN.js +4 -0
  61. package/lib/locale/zh-HK.js +4 -0
  62. package/lib/locale/zh-TW.js +4 -0
  63. package/lib/types/config/config.d.ts +5 -0
  64. package/lib/types/index.d.ts +1 -0
  65. package/lib/types/locale/en-US.d.ts +4 -0
  66. package/lib/types/menu/menu.d.ts +1 -1
  67. package/lib/types/menu/mobile-schema.d.ts +41 -2
  68. package/lib/types/plugin.d.ts +1 -1
  69. package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
  70. package/lib/types/services/doc-heading-collapse.service.d.ts +38 -0
  71. package/lib/types/services/doc-paragraph-menu.service.d.ts +5 -3
  72. package/lib/types/services/doc-popup-manager.service.d.ts +4 -1
  73. package/lib/types/services/mobile/doc-selection-render.service.d.ts +1 -0
  74. package/lib/types/services/selection/doc-selection-render.service.d.ts +2 -1
  75. package/lib/types/views/EditorColorPicker.d.ts +20 -0
  76. package/lib/types/views/ParagraphMenu.d.ts +2 -2
  77. package/lib/types/views/doc-side-menu-layout.d.ts +17 -0
  78. package/lib/types/views/heading-collapse-shape.d.ts +38 -0
  79. package/lib/types/views/paragraph-menu/paragraph-menu-position.d.ts +21 -0
  80. package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -0
  81. package/lib/types/views/rich-text-editor/hooks/editor-undo-redo-keyboard.d.ts +5 -1
  82. package/lib/umd/index.js +16 -17
  83. package/lib/umd/locale/ar-SA.js +1 -1
  84. package/lib/umd/locale/ca-ES.js +1 -1
  85. package/lib/umd/locale/de-DE.js +1 -1
  86. package/lib/umd/locale/en-US.js +1 -1
  87. package/lib/umd/locale/es-ES.js +1 -1
  88. package/lib/umd/locale/fa-IR.js +1 -1
  89. package/lib/umd/locale/fr-FR.js +1 -1
  90. package/lib/umd/locale/id-ID.js +1 -1
  91. package/lib/umd/locale/it-IT.js +1 -1
  92. package/lib/umd/locale/ja-JP.js +1 -1
  93. package/lib/umd/locale/ko-KR.js +1 -1
  94. package/lib/umd/locale/pl-PL.js +1 -1
  95. package/lib/umd/locale/pt-BR.js +1 -1
  96. package/lib/umd/locale/ru-RU.js +1 -1
  97. package/lib/umd/locale/sk-SK.js +1 -1
  98. package/lib/umd/locale/vi-VN.js +1 -1
  99. package/lib/umd/locale/zh-CN.js +1 -1
  100. package/lib/umd/locale/zh-HK.js +1 -1
  101. package/lib/umd/locale/zh-TW.js +1 -1
  102. package/package.json +12 -12
package/README.md CHANGED
@@ -34,6 +34,51 @@ univer.registerPlugin(UniverDocsUIPlugin);
34
34
  // Merge EnUS into your Univer locale map when this package contributes UI text.
35
35
  ```
36
36
 
37
+ ## Document outline (`toc`)
38
+
39
+ The optional `IUniverDocsUIConfig.toc` setting controls the left-hand document outline for heading navigation.
40
+
41
+ | `toc` | Modern documents | Traditional documents |
42
+ | --- | --- | --- |
43
+ | Omitted | Enabled | Disabled |
44
+ | `true` | Enabled | Enabled |
45
+ | `false` | Disabled | Disabled |
46
+
47
+ Set it when registering the plugin to override the document mode's default:
48
+
49
+ ```ts
50
+ univer.registerPlugin(UniverDocsUIPlugin, {
51
+ toc: false,
52
+ });
53
+ ```
54
+
55
+ Preset integrations can pass the same option to `UniverDocsCorePreset({ container: 'app', toc: false })`.
56
+ When enabled, the outline collapses if there is insufficient space or table content overlaps it,
57
+ and reopens when the layout provides enough space without overlap.
58
+
59
+ ## Heading collapse
60
+
61
+ Modern documents show a Canvas triangle beside visible Heading 1 through Heading 5 paragraphs
62
+ that have section content. Click it to collapse or expand the section. This is independent of
63
+ the document outline's `toc` setting. Traditional documents and embedded text editors do not
64
+ show these controls.
65
+
66
+ Collapsing keeps the heading visible and hides its following section, including nested headings,
67
+ tables, and images. Expanding the parent retains each nested heading's own collapse state.
68
+ Hidden content remains in the document snapshot. Collapse changes participate in undo/redo and
69
+ collaboration, so other editors share the state. Selections inside hidden content move to a
70
+ visible heading, and caret navigation skips hidden content. Collaborative table edits and history
71
+ can update hidden cells without drawing a rectangular selection over that heading.
72
+
73
+ The paragraph menu leaves the Canvas arrow accessible when constrained against the canvas edge,
74
+ including headings resolved through inherited styles. The triangle and its tooltip are drawn on Canvas. Colors follow `ThemeService`, including
75
+ runtime theme changes. After a 500 ms hover, the control shows the localized “Collapse”
76
+ or “Expand” tooltip above it; if the viewport clips the top, the tooltip appears below.
77
+ Scrolling, zooming, leaving the control, or activating it clears the tooltip.
78
+
79
+ See [the snapshot and command contract](../docs/README.md#heading-collapse-in-modern-documents)
80
+ to change collapse state programmatically through `SetHeadingCollapsedCommand`.
81
+
37
82
  ## Format painter
38
83
 
39
84
  Use the shared Start ribbon format painter to copy character formatting. Include a paragraph