@univerjs/docs-ui 0.6.6 → 0.6.7-nightly.202503261607

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 (52) hide show
  1. package/lib/cjs/index.js +34 -21
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +3367 -3063
  10. package/lib/es/locale/en-US.js +1 -0
  11. package/lib/es/locale/fa-IR.js +1 -0
  12. package/lib/es/locale/fr-FR.js +1 -0
  13. package/lib/es/locale/ru-RU.js +1 -0
  14. package/lib/es/locale/vi-VN.js +1 -0
  15. package/lib/es/locale/zh-CN.js +1 -0
  16. package/lib/es/locale/zh-TW.js +1 -0
  17. package/lib/facade.js +105 -0
  18. package/lib/index.css +1 -1
  19. package/lib/index.js +11456 -0
  20. package/lib/locale/en-US.js +86 -0
  21. package/lib/locale/fa-IR.js +86 -0
  22. package/lib/locale/fr-FR.js +86 -0
  23. package/lib/locale/ru-RU.js +86 -0
  24. package/lib/locale/vi-VN.js +86 -0
  25. package/lib/locale/zh-CN.js +86 -0
  26. package/lib/locale/zh-TW.js +86 -0
  27. package/lib/types/commands/commands/break-line.command.d.ts +7 -3
  28. package/lib/types/commands/commands/doc-delete.command.d.ts +1 -0
  29. package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +5 -0
  30. package/lib/types/commands/commands/insert-custom-range.command.d.ts +11 -0
  31. package/lib/types/commands/commands/list.command.d.ts +0 -2
  32. package/lib/types/commands/commands/set-heading.command.d.ts +5 -0
  33. package/lib/types/{views/doc-container/index.d.ts → components/float-toolbar/FloatToolbar.d.ts} +5 -1
  34. package/lib/types/components/float-toolbar/FloatToolbar.stories.d.ts +7 -0
  35. package/lib/types/controllers/float-menu.controller.d.ts +16 -0
  36. package/lib/types/controllers/menu/menu.d.ts +2 -0
  37. package/lib/types/index.d.ts +6 -4
  38. package/lib/types/locale/zh-CN.d.ts +1 -0
  39. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  40. package/lib/types/views/doc-container/DocContainer.d.ts +1 -7
  41. package/lib/types/views/doc-footer/DocFooter.d.ts +1 -1
  42. package/lib/types/views/paragraph-setting/hook/utils.d.ts +1 -1
  43. package/lib/umd/index.js +35 -22
  44. package/lib/umd/locale/en-US.js +1 -1
  45. package/lib/umd/locale/fa-IR.js +1 -1
  46. package/lib/umd/locale/fr-FR.js +1 -1
  47. package/lib/umd/locale/ru-RU.js +1 -1
  48. package/lib/umd/locale/vi-VN.js +1 -1
  49. package/lib/umd/locale/zh-CN.js +1 -1
  50. package/lib/umd/locale/zh-TW.js +1 -1
  51. package/package.json +12 -13
  52. package/LICENSE +0 -176
@@ -33,6 +33,7 @@ const e = {
33
33
  alignCenter: "Align Center",
34
34
  alignRight: "Align Right",
35
35
  alignJustify: "Justify",
36
+ horizontalLine: "Horizontal line",
36
37
  headerFooter: "Header & Footer"
37
38
  },
38
39
  table: {
@@ -33,6 +33,7 @@ const e = {
33
33
  alignCenter: "تراز وسط",
34
34
  alignRight: "تراز راست",
35
35
  alignJustify: "توجیه",
36
+ horizontalLine: "Horizontal line",
36
37
  headerFooter: "هدر و فوتر"
37
38
  },
38
39
  table: {
@@ -33,6 +33,7 @@ const e = {
33
33
  alignCenter: "Aligner au centre",
34
34
  alignRight: "Aligner à droite",
35
35
  alignJustify: "Justifier",
36
+ horizontalLine: "Horizontal line",
36
37
  headerFooter: "En-tête et pied de page"
37
38
  },
38
39
  table: {
@@ -31,6 +31,7 @@ const e = {
31
31
  alignCenter: "Выровнять по центру",
32
32
  alignRight: "Выровнять по правому краю",
33
33
  alignJustify: "Выровнять по ширине",
34
+ horizontalLine: "Horizontal line",
34
35
  headerFooter: "Header & Footer",
35
36
  checklist: "Task list",
36
37
  documentFlavor: "Modern Mode"
@@ -31,6 +31,7 @@ const n = {
31
31
  alignCenter: "Căn giữa",
32
32
  alignRight: "Căn phải",
33
33
  alignJustify: "Căn đều hai bên",
34
+ horizontalLine: "Horizontal line",
34
35
  headerFooter: "Đầu trang và chân trang",
35
36
  checklist: "Task list",
36
37
  documentFlavor: "Modern Mode"
@@ -33,6 +33,7 @@ const e = {
33
33
  alignCenter: "居中对齐",
34
34
  alignRight: "右对齐",
35
35
  alignJustify: "两端对齐",
36
+ horizontalLine: "水平分割线",
36
37
  headerFooter: "页眉页脚"
37
38
  },
38
39
  table: {
@@ -31,6 +31,7 @@ const e = {
31
31
  alignCenter: "居中對齊",
32
32
  alignRight: "右對齊",
33
33
  alignJustify: "兩端對齊",
34
+ horizontalLine: "Horizontal line",
34
35
  headerFooter: "頁眉頁腳",
35
36
  checklist: "任務列表",
36
37
  documentFlavor: "现代模式"
package/lib/facade.js ADDED
@@ -0,0 +1,105 @@
1
+ var h = Object.defineProperty;
2
+ var v = (n, e, t) => e in n ? h(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var m = (n, e, t) => v(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as _, Injector as g, IUniverInstanceService as I, ICommandService as p, IResourceManagerService as S, UniverInstanceType as a, UndoCommand as l, RedoCommand as D, DOC_RANGE_TYPE as U } from "@univerjs/core";
5
+ import { FUniver as u } from "@univerjs/core/facade";
6
+ import { InsertCommand as f, DocSelectionRenderService as C } from "@univerjs/docs-ui";
7
+ import { IRenderManagerService as y } from "@univerjs/engine-render";
8
+ var M = Object.getOwnPropertyDescriptor, R = (n, e, t, r) => {
9
+ for (var i = r > 1 ? void 0 : r ? M(e, t) : e, s = n.length - 1, d; s >= 0; s--)
10
+ (d = n[s]) && (i = d(i) || i);
11
+ return i;
12
+ }, c = (n, e) => (t, r) => e(t, r, n);
13
+ let o = class {
14
+ constructor(n, e, t, r, i, s) {
15
+ m(this, "id");
16
+ this._documentDataModel = n, this._injector = e, this._univerInstanceService = t, this._commandService = r, this._resourceManagerService = i, this._renderManagerService = s, this.id = this._documentDataModel.getUnitId();
17
+ }
18
+ getId() {
19
+ return this._documentDataModel.getUnitId();
20
+ }
21
+ getName() {
22
+ return this.getSnapshot().title || "";
23
+ }
24
+ getSnapshot() {
25
+ const n = this._resourceManagerService.getResourcesByType(this.id, a.UNIVER_DOC), e = this._documentDataModel.getSnapshot();
26
+ return e.resources = n, e;
27
+ }
28
+ undo() {
29
+ return this._univerInstanceService.focusUnit(this.id), this._commandService.executeCommand(l.id);
30
+ }
31
+ redo() {
32
+ return this._univerInstanceService.focusUnit(this.id), this._commandService.executeCommand(D.id);
33
+ }
34
+ /**
35
+ * Adds the specified text to the end of this text region.
36
+ * @param text - The text to be added to the end of this text region.
37
+ */
38
+ appendText(n) {
39
+ const e = this.id, { body: t } = this.getSnapshot();
40
+ if (!t)
41
+ throw new Error("The document body is empty");
42
+ const r = t.dataStream.length - 2, i = {
43
+ startOffset: r,
44
+ endOffset: r,
45
+ collapsed: !0,
46
+ segmentId: ""
47
+ }, { segmentId: s } = i;
48
+ return this._commandService.executeCommand(f.id, {
49
+ unitId: e,
50
+ body: {
51
+ dataStream: n
52
+ },
53
+ range: i,
54
+ segmentId: s
55
+ });
56
+ }
57
+ /**
58
+ * Sets the selection to a specified text range in the document.
59
+ * @param startOffset - The starting offset of the selection in the document.
60
+ * @param endOffset - The ending offset of the selection in the document.
61
+ * @example
62
+ * ```typescript
63
+ * document.setSelection(10, 20);
64
+ * ```
65
+ */
66
+ setSelection(n, e) {
67
+ var r;
68
+ const t = (r = this._renderManagerService.getRenderById(this.getId())) == null ? void 0 : r.with(C);
69
+ t == null || t.removeAllRanges(), t == null || t.addDocRanges(
70
+ [
71
+ {
72
+ startOffset: n,
73
+ endOffset: e,
74
+ rangeType: U.TEXT
75
+ }
76
+ ],
77
+ !0
78
+ );
79
+ }
80
+ };
81
+ o = R([
82
+ c(1, _(g)),
83
+ c(2, I),
84
+ c(3, p),
85
+ c(4, S),
86
+ c(5, y)
87
+ ], o);
88
+ class O extends u {
89
+ createUniverDoc(e) {
90
+ const t = this._univerInstanceService.createUnit(a.UNIVER_DOC, e);
91
+ return this._injector.createInstance(o, t);
92
+ }
93
+ getActiveDocument() {
94
+ const e = this._univerInstanceService.getCurrentUnitForType(a.UNIVER_DOC);
95
+ return e ? this._injector.createInstance(o, e) : null;
96
+ }
97
+ getUniverDoc(e) {
98
+ const t = this._univerInstanceService.getUniverDocInstance(e);
99
+ return t ? this._injector.createInstance(o, t) : null;
100
+ }
101
+ }
102
+ u.extend(O);
103
+ export {
104
+ o as FDocument
105
+ };
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-rich-text-editor-active{border-color:rgb(var(--hyacinth-500))!important}.univer-rich-text-editor-wrap{height:32px;padding:6px 8px 2px 6px;width:100%;display:flex;justify-content:space-around;align-items:center;gap:8px;border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);box-sizing:border-box;position:relative}.univer-rich-text-editor-wrap .univer-rich-text-editor-text{width:100%;height:100%;position:relative}.univer-rich-text-editor-wrap .univer-rich-text-editor-error-wrap{font-size:12px;color:rgb(var(--red-500));position:absolute;bottom:-18px;left:0}.univer-rich-text-editor-placeholder{font-size:14px;color:rgb(var(--grey-500));position:absolute;left:5px;top:5px}.univer-panel{padding-top:20px;font-size:var(--font-size-sm)}.univer-options-section{margin-top:10px;padding-bottom:10px}.univer-options-form-item{display:block;margin-bottom:5px}.univer-options-input{width:80%;margin-top:5px}.univer-options-margin-setting{display:flex}.univer-doc-list-type-picker{display:flex;flex-direction:row;justify-content:space-between;flex-wrap:wrap;padding:var(--padding-sm);width:240px;margin-bottom:-var(--margin-xs)}.univer-doc-list-type-picker-item{width:72px;height:81px;border-radius:4px;border:1px solid rgb(var(--border-color));margin-bottom:var(--margin-xs)}.univer-doc-list-type-picker-item:hover,.univer-doc-list-type-picker-item-active{border:1px solid rgb(var(--blue-400))}.univer-doc-count-bar{display:flex;flex:0 0 260px;justify-content:flex-end}.univer-doc-footer-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 var(--padding-xl)}.univer-paragraph-setting-icon-list{display:flex;width:100%;padding:4px;align-items:center;gap:4px;justify-content:space-between;border:1px solid #e5e5e5;border:1px solid var(---Grey-200, #e5e5e5);border-radius:6px;border-radius:var(--radius-m, 6px)}.univer-paragraph-setting-icon-list-item{padding:4px 14px;border-radius:4px;background:none;display:flex;justify-content:center;align-items:center;cursor:pointer}.univer-paragraph-setting-icon-list-item:hover{background:#1e222b0f;background:var(--black-6, rgba(30, 34, 43, .06))}.univer-paragraph-setting-icon-list-item.univer-paragraph-setting-icon-list-active{background:#1e222b17;background:var(--black-9, rgba(30, 34, 43, .09))}.univer-paragraph-setting-title{margin-top:var(--margin-base);font-size:13px;color:#1e222b;font-weight:500}.univer-paragraph-setting-label{font-size:12px;margin-top:var(--margin-sm);color:#1e222b;font-weight:400}.univer-paragraph-setting-mt-base{margin-top:var(--margin-base)}.univer-paragraph-setting-flex-col{display:flex;justify-content:space-between;align-items:center}.univer-paragraph-setting-space-line{display:flex;flex-direction:column;gap:6px}.univer-create{padding:20px auto;display:flex;align-content:center;justify-content:space-between}.univer-create-item{display:flex;align-items:center}.univer-create-label{margin-right:5px}.univer-create-input{width:110px}
1
+ .univer-absolute{position:absolute}.univer-relative{position:relative}.univer-left-\[5px\]{left:5px}.univer-top-\[5px\]{top:5px}.univer-mb-1{margin-bottom:.25rem}.univer-mt-1\.5{margin-top:.375rem}.univer-mt-3{margin-top:.75rem}.univer-mt-4{margin-top:1rem}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-flex{display:flex}.univer-grid{display:grid}.univer-size-full{width:100%;height:100%}.univer-h-20{height:5rem}.univer-h-8{height:2rem}.univer-w-28{width:7rem}.univer-w-4\/5{width:80%}.univer-w-\[72px\]{width:72px}.univer-w-full{width:100%}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow-0{flex-grow:0}.univer-basis-\[260px\]{flex-basis:260px}.univer-cursor-pointer{cursor:pointer}.univer-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-justify-around{justify-content:space-around}.univer-gap-1{gap:.25rem}.univer-gap-1\.5{gap:.375rem}.univer-gap-2{gap:.5rem}.univer-gap-4{gap:1rem}.univer-overflow-hidden{overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-gray-200{--tw-border-opacity: 1;border-color:#e3e5ea;border-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-primary-500{--tw-border-opacity: 1;border-color:#466af7;border-color:rgba(70,106,247,var(--tw-border-opacity, 1))}.univer-bg-white{--tw-bg-opacity: 1;background-color:#fff;background-color:rgba(255,255,255,var(--tw-bg-opacity, 1))}.univer-bg-none{background-image:none}.univer-p-1{padding:.25rem}.univer-p-1\.5{padding:.375rem}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-px-3{padding-left:.75rem;padding-right:.75rem}.univer-px-5{padding-left:1.25rem;padding-right:1.25rem}.univer-py-1{padding-top:.25rem;padding-bottom:.25rem}.univer-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.univer-pb-0\.5{padding-bottom:.125rem}.univer-pl-1\.5{padding-left:.375rem}.univer-pr-2{padding-right:.5rem}.univer-pt-1\.5{padding-top:.375rem}.univer-text-\[13px\]{font-size:13px}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-font-medium{font-weight:500}.univer-text-gray-400{--tw-text-opacity: 1;color:#979dac;color:rgba(151,157,172,var(--tw-text-opacity, 1))}.univer-text-gray-500{--tw-text-opacity: 1;color:#5f6574;color:rgba(95,101,116,var(--tw-text-opacity, 1))}.univer-shadow-\[0_1px_6px_-2px_rgba\(30\,40\,77\,0\.08\)\,0_2px_6px_-1px_rgba\(30\,40\,77\,0\.10\)\]{--tw-shadow: 0 1px 6px -2px rgba(30,40,77,.08),0 2px 6px -1px rgba(30,40,77,.1);--tw-shadow-colored: 0 1px 6px -2px var(--tw-shadow-color), 0 2px 6px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:univer-border-primary-500:hover{--tw-border-opacity: 1;border-color:#466af7;border-color:rgba(70,106,247,var(--tw-border-opacity, 1))}.hover\:univer-bg-black\/60:hover{background-color:#0009}