@univerjs/docs-ui 1.3.1 → 1.5.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 (107) hide show
  1. package/README.md +7 -75
  2. package/lib/cjs/facade.js +1 -3
  3. package/lib/cjs/index.js +384 -523
  4. package/lib/cjs/locale/ar-SA.js +2 -2
  5. package/lib/cjs/locale/ca-ES.js +2 -2
  6. package/lib/cjs/locale/de-DE.js +2 -2
  7. package/lib/cjs/locale/en-US.js +2 -2
  8. package/lib/cjs/locale/es-ES.js +2 -2
  9. package/lib/cjs/locale/fa-IR.js +2 -2
  10. package/lib/cjs/locale/fr-FR.js +2 -2
  11. package/lib/cjs/locale/id-ID.js +2 -2
  12. package/lib/cjs/locale/it-IT.js +2 -2
  13. package/lib/cjs/locale/ja-JP.js +2 -2
  14. package/lib/cjs/locale/ko-KR.js +2 -2
  15. package/lib/cjs/locale/pl-PL.js +2 -2
  16. package/lib/cjs/locale/pt-BR.js +2 -2
  17. package/lib/cjs/locale/ru-RU.js +2 -2
  18. package/lib/cjs/locale/sk-SK.js +2 -2
  19. package/lib/cjs/locale/vi-VN.js +2 -2
  20. package/lib/cjs/locale/zh-CN.js +2 -2
  21. package/lib/cjs/locale/zh-HK.js +2 -2
  22. package/lib/cjs/locale/zh-TW.js +2 -2
  23. package/lib/es/facade.js +1 -2
  24. package/lib/es/index.js +384 -522
  25. package/lib/es/locale/ar-SA.js +2 -2
  26. package/lib/es/locale/ca-ES.js +2 -2
  27. package/lib/es/locale/de-DE.js +2 -2
  28. package/lib/es/locale/en-US.js +2 -2
  29. package/lib/es/locale/es-ES.js +2 -2
  30. package/lib/es/locale/fa-IR.js +2 -2
  31. package/lib/es/locale/fr-FR.js +2 -2
  32. package/lib/es/locale/id-ID.js +2 -2
  33. package/lib/es/locale/it-IT.js +2 -2
  34. package/lib/es/locale/ja-JP.js +2 -2
  35. package/lib/es/locale/ko-KR.js +2 -2
  36. package/lib/es/locale/pl-PL.js +2 -2
  37. package/lib/es/locale/pt-BR.js +2 -2
  38. package/lib/es/locale/ru-RU.js +2 -2
  39. package/lib/es/locale/sk-SK.js +2 -2
  40. package/lib/es/locale/vi-VN.js +2 -2
  41. package/lib/es/locale/zh-CN.js +2 -2
  42. package/lib/es/locale/zh-HK.js +2 -2
  43. package/lib/es/locale/zh-TW.js +2 -2
  44. package/lib/facade.js +1 -2
  45. package/lib/index.css +4 -21
  46. package/lib/index.js +384 -522
  47. package/lib/locale/ar-SA.js +2 -2
  48. package/lib/locale/ca-ES.js +2 -2
  49. package/lib/locale/de-DE.js +2 -2
  50. package/lib/locale/en-US.js +2 -2
  51. package/lib/locale/es-ES.js +2 -2
  52. package/lib/locale/fa-IR.js +2 -2
  53. package/lib/locale/fr-FR.js +2 -2
  54. package/lib/locale/id-ID.js +2 -2
  55. package/lib/locale/it-IT.js +2 -2
  56. package/lib/locale/ja-JP.js +2 -2
  57. package/lib/locale/ko-KR.js +2 -2
  58. package/lib/locale/pl-PL.js +2 -2
  59. package/lib/locale/pt-BR.js +2 -2
  60. package/lib/locale/ru-RU.js +2 -2
  61. package/lib/locale/sk-SK.js +2 -2
  62. package/lib/locale/vi-VN.js +2 -2
  63. package/lib/locale/zh-CN.js +2 -2
  64. package/lib/locale/zh-HK.js +2 -2
  65. package/lib/locale/zh-TW.js +2 -2
  66. package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -1
  67. package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -2
  68. package/lib/types/controllers/components.controller.d.ts +0 -1
  69. package/lib/types/controllers/mobile/components.controller.d.ts +0 -1
  70. package/lib/types/locale/en-US.d.ts +1 -0
  71. package/lib/types/menu/mobile-schema.d.ts +5 -4
  72. package/lib/types/menu/paragraph-menu.d.ts +2 -2
  73. package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
  74. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +1 -1
  75. package/lib/types/services/clipboard/paste-options.d.ts +6 -6
  76. package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +1 -1
  77. package/lib/types/services/doc-render-background.d.ts +1 -1
  78. package/lib/types/services/editor/editor-manager.service.d.ts +1 -1
  79. package/lib/types/services/editor/editor.d.ts +1 -1
  80. package/lib/types/services/selection/text-range.d.ts +2 -2
  81. package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
  82. package/lib/types/views/header-footer/panel/use-header-footer-options.d.ts +2 -2
  83. package/lib/types/views/paragraph-setting/ParagraphWordWrapSetting.d.ts +16 -0
  84. package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -2
  85. package/lib/types/views/rich-text-editor/hooks/use-resize.d.ts +1 -1
  86. package/lib/types/views/section-setting/use-section-setting.d.ts +13 -13
  87. package/lib/umd/index.js +16 -16
  88. package/lib/umd/locale/ar-SA.js +1 -1
  89. package/lib/umd/locale/ca-ES.js +1 -1
  90. package/lib/umd/locale/de-DE.js +1 -1
  91. package/lib/umd/locale/en-US.js +1 -1
  92. package/lib/umd/locale/es-ES.js +1 -1
  93. package/lib/umd/locale/fa-IR.js +1 -1
  94. package/lib/umd/locale/fr-FR.js +1 -1
  95. package/lib/umd/locale/id-ID.js +1 -1
  96. package/lib/umd/locale/it-IT.js +1 -1
  97. package/lib/umd/locale/ja-JP.js +1 -1
  98. package/lib/umd/locale/ko-KR.js +1 -1
  99. package/lib/umd/locale/pl-PL.js +1 -1
  100. package/lib/umd/locale/pt-BR.js +1 -1
  101. package/lib/umd/locale/ru-RU.js +1 -1
  102. package/lib/umd/locale/sk-SK.js +1 -1
  103. package/lib/umd/locale/vi-VN.js +1 -1
  104. package/lib/umd/locale/zh-CN.js +1 -1
  105. package/lib/umd/locale/zh-HK.js +1 -1
  106. package/lib/umd/locale/zh-TW.js +1 -1
  107. package/package.json +16 -16
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  ## Package Overview
10
10
 
11
- | Package | UMD global | CSS | Locales | Facade entry |
12
- | --- | --- | :---: | :---: | :---: |
13
- | `@univerjs/docs-ui` | `UniverDocsUi` | Yes | Yes | Yes |
11
+ | Package | UMD global | CSS | Locales | Facade entry | Worker entry |
12
+ | --- | --- | :---: | :---: | :---: | :---: |
13
+ | `@univerjs/docs-ui` | `UniverDocsUi` | Yes | Yes | Yes | No |
14
14
 
15
15
  ## Installation
16
16
 
@@ -20,10 +20,10 @@ pnpm add @univerjs/docs-ui
20
20
  npm install @univerjs/docs-ui
21
21
  ```
22
22
 
23
- Keep all `@univerjs/*` packages on the same version.
24
-
25
23
  ## Usage
26
24
 
25
+ Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
26
+
27
27
  ```ts
28
28
  import '@univerjs/docs-ui/lib/index.css';
29
29
  import EnUS from '@univerjs/docs-ui/locale/en-US';
@@ -34,77 +34,9 @@ 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
-
82
- ## Format painter
83
-
84
- Use the shared Start ribbon format painter to copy character formatting. Include a paragraph
85
- mark in the source selection to also copy paragraph formatting and list formatting. Drag over
86
- a target selection or click a word to apply. Text, paragraph identities, and embedded entities
87
- are retained, and each application is undoable. The same text command serves embedded Shape
88
- text editors. The source format is captured when the brush is activated.
89
- The clear-formatting icon resets the selected text and paragraphs to default formatting,
90
- retains their content and identities, and supports undo.
91
-
92
- ## Typing format at text boundaries
93
-
94
- Backspace in ordinary document text retains the removed character's formatting for immediate
95
- input. Forward Delete and Cut resolve formatting at the surviving caret. Replacing a text
96
- selection uses its first character's format, regardless of selection direction. In table cells,
97
- character-by-character Backspace resolves the surviving caret format; selection Backspace retains
98
- the first selected character's format.
37
+ ## Integration Notes
99
38
 
100
- Retained typing format is transient and clears on explicit selection changes or document switches.
101
- Formatting commands such as Bold update this input format without clearing it.
102
- It is not serialized as an empty text run. Explicit `paragraphMarkTextStyle` remains authoritative
103
- after repositioning or reopening; deletion does not overwrite this explicit paragraph style.
104
- Modern paragraphs, including list items, retain their first character's formatting on the existing
105
- paragraph-ending character when all text is deleted. This keeps empty-paragraph input and list
106
- markers stable after editing elsewhere, undo/redo and reopening. Explicit list-marker and
107
- paragraph-mark style overrides retain their precedence.
39
+ - Import `@univerjs/docs-ui/facade` when using this package through Univer Facade APIs.
108
40
 
109
41
  ## Resources
110
42
 
package/lib/cjs/facade.js CHANGED
@@ -4,7 +4,7 @@ let _univerjs_docs_ui = require("@univerjs/docs-ui");
4
4
  let _univerjs_docs_facade = require("@univerjs/docs/facade");
5
5
  let _univerjs_engine_render = require("@univerjs/engine-render");
6
6
 
7
- //#region src/facade/f-document.ts
7
+ // src/facade/f-document.ts
8
8
  /**
9
9
  * Copyright 2023-present DreamNum Co., Ltd.
10
10
  *
@@ -77,5 +77,3 @@ var FDocumentUIMixin = class extends _univerjs_docs_facade.FDocument {
77
77
  }
78
78
  };
79
79
  _univerjs_docs_facade.FDocument.extend(FDocumentUIMixin);
80
-
81
- //#endregion