@univerjs/docs-ui 1.0.4 → 1.2.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/README.md +45 -0
- package/lib/cjs/index.js +937 -296
- package/lib/cjs/locale/ar-SA.js +6 -0
- package/lib/cjs/locale/ca-ES.js +6 -0
- package/lib/cjs/locale/de-DE.js +6 -0
- package/lib/cjs/locale/en-US.js +6 -0
- package/lib/cjs/locale/es-ES.js +6 -0
- package/lib/cjs/locale/fa-IR.js +6 -0
- package/lib/cjs/locale/fr-FR.js +6 -0
- package/lib/cjs/locale/id-ID.js +6 -0
- package/lib/cjs/locale/it-IT.js +6 -0
- package/lib/cjs/locale/ja-JP.js +6 -0
- package/lib/cjs/locale/ko-KR.js +6 -0
- package/lib/cjs/locale/pl-PL.js +6 -0
- package/lib/cjs/locale/pt-BR.js +6 -0
- package/lib/cjs/locale/ru-RU.js +6 -0
- package/lib/cjs/locale/sk-SK.js +6 -0
- package/lib/cjs/locale/vi-VN.js +6 -0
- package/lib/cjs/locale/zh-CN.js +6 -0
- package/lib/cjs/locale/zh-HK.js +6 -0
- package/lib/cjs/locale/zh-TW.js +6 -0
- package/lib/es/index.js +918 -283
- package/lib/es/locale/ar-SA.js +6 -0
- package/lib/es/locale/ca-ES.js +6 -0
- package/lib/es/locale/de-DE.js +6 -0
- package/lib/es/locale/en-US.js +6 -0
- package/lib/es/locale/es-ES.js +6 -0
- package/lib/es/locale/fa-IR.js +6 -0
- package/lib/es/locale/fr-FR.js +6 -0
- package/lib/es/locale/id-ID.js +6 -0
- package/lib/es/locale/it-IT.js +6 -0
- package/lib/es/locale/ja-JP.js +6 -0
- package/lib/es/locale/ko-KR.js +6 -0
- package/lib/es/locale/pl-PL.js +6 -0
- package/lib/es/locale/pt-BR.js +6 -0
- package/lib/es/locale/ru-RU.js +6 -0
- package/lib/es/locale/sk-SK.js +6 -0
- package/lib/es/locale/vi-VN.js +6 -0
- package/lib/es/locale/zh-CN.js +6 -0
- package/lib/es/locale/zh-HK.js +6 -0
- package/lib/es/locale/zh-TW.js +6 -0
- package/lib/index.css +41 -82
- package/lib/index.js +918 -283
- package/lib/locale/ar-SA.js +6 -0
- package/lib/locale/ca-ES.js +6 -0
- package/lib/locale/de-DE.js +6 -0
- package/lib/locale/en-US.js +6 -0
- package/lib/locale/es-ES.js +6 -0
- package/lib/locale/fa-IR.js +6 -0
- package/lib/locale/fr-FR.js +6 -0
- package/lib/locale/id-ID.js +6 -0
- package/lib/locale/it-IT.js +6 -0
- package/lib/locale/ja-JP.js +6 -0
- package/lib/locale/ko-KR.js +6 -0
- package/lib/locale/pl-PL.js +6 -0
- package/lib/locale/pt-BR.js +6 -0
- package/lib/locale/ru-RU.js +6 -0
- package/lib/locale/sk-SK.js +6 -0
- package/lib/locale/vi-VN.js +6 -0
- package/lib/locale/zh-CN.js +6 -0
- package/lib/locale/zh-HK.js +6 -0
- package/lib/locale/zh-TW.js +6 -0
- package/lib/types/config/config.d.ts +5 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/en-US.d.ts +6 -0
- package/lib/types/menu/display.menu.d.ts +21 -0
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
- package/lib/types/services/doc-heading-collapse.service.d.ts +38 -0
- package/lib/types/services/doc-paragraph-menu.service.d.ts +12 -3
- package/lib/types/services/doc-popup-manager.service.d.ts +4 -1
- package/lib/types/services/doc-zoom.d.ts +4 -1
- package/lib/types/views/ParagraphMenu.d.ts +2 -2
- package/lib/types/views/doc-side-menu-layout.d.ts +17 -0
- package/lib/types/views/heading-collapse-shape.d.ts +38 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +16 -16
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +15 -15
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
|