bg-editor 0.0.1
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/LICENSE +8 -0
- package/README.md +51 -0
- package/README.zh-CN.md +51 -0
- package/dist/_basePickBy-4kmg42pS.js +158 -0
- package/dist/_baseUniq-WOvvCHTI.js +621 -0
- package/dist/arc-wItjmL5I.js +90 -0
- package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
- package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
- package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
- package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
- package/dist/channel-Dah4F59k.js +12 -0
- package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
- package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
- package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
- package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
- package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
- package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
- package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
- package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
- package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
- package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
- package/dist/clone-C74UiRbr.js +15 -0
- package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
- package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
- package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
- package/dist/defaultLocale-DgmhL6Re.js +178 -0
- package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
- package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
- package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
- package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
- package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
- package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
- package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
- package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
- package/dist/graph-CnOTx4E0.js +254 -0
- package/dist/index-D6-Wf75-.js +122127 -0
- package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
- package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
- package/dist/init-d639unba.js +23 -0
- package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
- package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
- package/dist/layout-OXk4OSoz.js +1342 -0
- package/dist/linear-CO_vz87n.js +266 -0
- package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
- package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
- package/dist/ordinal-CofNqUw2.js +68 -0
- package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
- package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
- package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
- package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
- package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
- package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
- package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
- package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
- package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
- package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
- package/dist/style.css +1 -0
- package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
- package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
- package/dist/umo-editor.js +16 -0
- package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
- package/package.json +200 -0
- package/types/index.d.ts +277 -0
- package/types/src/components/index.d.ts +9 -0
- package/types/src/components/menus/button.vue.d.ts +583 -0
- package/types/src/components/modal.vue.d.ts +2 -0
- package/types/src/components/tooltip.vue.d.ts +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright © 2024 umo-team
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# BG Editor
|
|
2
|
+
|
|
3
|
+
A powerful open-source document editor based on Vue3 and Tiptap.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📄 **Pagination Mode** - Microsoft Word-like page layout
|
|
8
|
+
- ✍️ **Rich Text Editing** - Complete formatting options
|
|
9
|
+
- 🤖 **AI Integration** - AI-assisted content creation
|
|
10
|
+
- 📝 **Markdown Support** - Write with Markdown syntax
|
|
11
|
+
- 🎨 **Multiple Node Types** - Tables, images, code blocks, and more
|
|
12
|
+
- 📤 **Export Options** - PDF, Word, HTML, and more
|
|
13
|
+
- 🖨️ **Print Support** - Print preview and direct printing
|
|
14
|
+
- 🔌 **Extensible** - Add custom extensions
|
|
15
|
+
- 🌍 **i18n** - Multi-language support
|
|
16
|
+
- 🌙 **Dark Theme** - Built-in dark mode
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install bg-editor
|
|
22
|
+
# or
|
|
23
|
+
pnpm add bg-editor
|
|
24
|
+
# or
|
|
25
|
+
yarn add bg-editor
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<template>
|
|
32
|
+
<BgEditor v-model="content" />
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { ref } from 'vue'
|
|
37
|
+
import BgEditor from 'bg-editor'
|
|
38
|
+
import 'bg-editor/style'
|
|
39
|
+
|
|
40
|
+
const content = ref('')
|
|
41
|
+
</script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Vue >= 3.x
|
|
47
|
+
- Node >= 18.0.0
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
[MIT](./LICENSE)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# BG Editor
|
|
2
|
+
|
|
3
|
+
一个基于 Vue3 和 Tiptap 的开源文档编辑器。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- 📄 **分页模式** - 类似 Microsoft Word 的页面布局
|
|
8
|
+
- ✍️ **富文本编辑** - 完整的格式化选项
|
|
9
|
+
- 🤖 **AI 集成** - AI 辅助内容创作
|
|
10
|
+
- 📝 **Markdown 支持** - 使用 Markdown 语法编写
|
|
11
|
+
- 🎨 **多种节点类型** - 表格、图片、代码块等
|
|
12
|
+
- 📤 **导出选项** - PDF、Word、HTML 等格式
|
|
13
|
+
- 🖨️ **打印支持** - 打印预览和直接打印
|
|
14
|
+
- 🔌 **可扩展** - 添加自定义扩展
|
|
15
|
+
- 🌍 **国际化** - 多语言支持
|
|
16
|
+
- 🌙 **暗色主题** - 内置暗色模式
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install bg-editor
|
|
22
|
+
# 或
|
|
23
|
+
pnpm add bg-editor
|
|
24
|
+
# 或
|
|
25
|
+
yarn add bg-editor
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 快速开始
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<template>
|
|
32
|
+
<BgEditor v-model="content" />
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { ref } from 'vue'
|
|
37
|
+
import BgEditor from 'bg-editor'
|
|
38
|
+
import 'bg-editor/style'
|
|
39
|
+
|
|
40
|
+
const content = ref('')
|
|
41
|
+
</script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 环境要求
|
|
45
|
+
|
|
46
|
+
- Vue >= 3.x
|
|
47
|
+
- Node >= 18.0.0
|
|
48
|
+
|
|
49
|
+
## 许可证
|
|
50
|
+
|
|
51
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { e as x, c as O, g as m, k as p, h as P, j as w, l as A, m as c, n as I, t as N, o as _ } from "./_baseUniq-WOvvCHTI.js";
|
|
3
|
+
import { aS as g, aA as E, aT as F, aU as M, aV as T, aW as l, aX as $, aY as B, aZ as S, a_ as y } from "./index-D6-Wf75-.js";
|
|
4
|
+
/**
|
|
5
|
+
* @umoteam/editor 9.0.1
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @author umodoc https://www.umodoc.com
|
|
8
|
+
* @see https://www.umodoc.com
|
|
9
|
+
**/
|
|
10
|
+
var G = /\s/;
|
|
11
|
+
function H(n) {
|
|
12
|
+
for (var r = n.length; r-- && G.test(n.charAt(r)); )
|
|
13
|
+
;
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
var L = /^\s+/;
|
|
17
|
+
function R(n) {
|
|
18
|
+
return n && n.slice(0, H(n) + 1).replace(L, "");
|
|
19
|
+
}
|
|
20
|
+
var o = NaN, W = /^[-+]0x[0-9a-f]+$/i, X = /^0b[01]+$/i, Y = /^0o[0-7]+$/i, q = parseInt;
|
|
21
|
+
function z(n) {
|
|
22
|
+
if (typeof n == "number")
|
|
23
|
+
return n;
|
|
24
|
+
if (x(n))
|
|
25
|
+
return o;
|
|
26
|
+
if (g(n)) {
|
|
27
|
+
var r = typeof n.valueOf == "function" ? n.valueOf() : n;
|
|
28
|
+
n = g(r) ? r + "" : r;
|
|
29
|
+
}
|
|
30
|
+
if (typeof n != "string")
|
|
31
|
+
return n === 0 ? n : +n;
|
|
32
|
+
n = R(n);
|
|
33
|
+
var t = X.test(n);
|
|
34
|
+
return t || Y.test(n) ? q(n.slice(2), t ? 2 : 8) : W.test(n) ? o : +n;
|
|
35
|
+
}
|
|
36
|
+
var v = 1 / 0, C = 17976931348623157e292;
|
|
37
|
+
function K(n) {
|
|
38
|
+
if (!n)
|
|
39
|
+
return n === 0 ? n : 0;
|
|
40
|
+
if (n = z(n), n === v || n === -v) {
|
|
41
|
+
var r = n < 0 ? -1 : 1;
|
|
42
|
+
return r * C;
|
|
43
|
+
}
|
|
44
|
+
return n === n ? n : 0;
|
|
45
|
+
}
|
|
46
|
+
function U(n) {
|
|
47
|
+
var r = K(n), t = r % 1;
|
|
48
|
+
return r === r ? t ? r - t : r : 0;
|
|
49
|
+
}
|
|
50
|
+
function dn(n) {
|
|
51
|
+
var r = n == null ? 0 : n.length;
|
|
52
|
+
return r ? O(n) : [];
|
|
53
|
+
}
|
|
54
|
+
var b = Object.prototype, Z = b.hasOwnProperty, un = E(function(n, r) {
|
|
55
|
+
n = Object(n);
|
|
56
|
+
var t = -1, i = r.length, a = i > 2 ? r[2] : void 0;
|
|
57
|
+
for (a && F(r[0], r[1], a) && (i = 1); ++t < i; )
|
|
58
|
+
for (var f = r[t], e = M(f), s = -1, d = e.length; ++s < d; ) {
|
|
59
|
+
var u = e[s], h = n[u];
|
|
60
|
+
(h === void 0 || T(h, b[u]) && !Z.call(n, u)) && (n[u] = f[u]);
|
|
61
|
+
}
|
|
62
|
+
return n;
|
|
63
|
+
});
|
|
64
|
+
function hn(n) {
|
|
65
|
+
var r = n == null ? 0 : n.length;
|
|
66
|
+
return r ? n[r - 1] : void 0;
|
|
67
|
+
}
|
|
68
|
+
function D(n) {
|
|
69
|
+
return function(r, t, i) {
|
|
70
|
+
var a = Object(r);
|
|
71
|
+
if (!l(r)) {
|
|
72
|
+
var f = m(t);
|
|
73
|
+
r = p(r), t = function(s) {
|
|
74
|
+
return f(a[s], s, a);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
var e = n(r, t, i);
|
|
78
|
+
return e > -1 ? a[f ? r[e] : e] : void 0;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
var J = Math.max;
|
|
82
|
+
function Q(n, r, t) {
|
|
83
|
+
var i = n == null ? 0 : n.length;
|
|
84
|
+
if (!i)
|
|
85
|
+
return -1;
|
|
86
|
+
var a = t == null ? 0 : U(t);
|
|
87
|
+
return a < 0 && (a = J(i + a, 0)), P(n, m(r), a);
|
|
88
|
+
}
|
|
89
|
+
var gn = D(Q);
|
|
90
|
+
function V(n, r) {
|
|
91
|
+
var t = -1, i = l(n) ? Array(n.length) : [];
|
|
92
|
+
return w(n, function(a, f, e) {
|
|
93
|
+
i[++t] = r(a, f, e);
|
|
94
|
+
}), i;
|
|
95
|
+
}
|
|
96
|
+
function mn(n, r) {
|
|
97
|
+
var t = $(n) ? A : V;
|
|
98
|
+
return t(n, m(r));
|
|
99
|
+
}
|
|
100
|
+
var j = Object.prototype, k = j.hasOwnProperty;
|
|
101
|
+
function nn(n, r) {
|
|
102
|
+
return n != null && k.call(n, r);
|
|
103
|
+
}
|
|
104
|
+
function on(n, r) {
|
|
105
|
+
return n != null && c(n, r, nn);
|
|
106
|
+
}
|
|
107
|
+
function rn(n, r) {
|
|
108
|
+
return n < r;
|
|
109
|
+
}
|
|
110
|
+
function tn(n, r, t) {
|
|
111
|
+
for (var i = -1, a = n.length; ++i < a; ) {
|
|
112
|
+
var f = n[i], e = r(f);
|
|
113
|
+
if (e != null && (s === void 0 ? e === e && !x(e) : t(e, s)))
|
|
114
|
+
var s = e, d = f;
|
|
115
|
+
}
|
|
116
|
+
return d;
|
|
117
|
+
}
|
|
118
|
+
function vn(n) {
|
|
119
|
+
return n && n.length ? tn(n, B, rn) : void 0;
|
|
120
|
+
}
|
|
121
|
+
function an(n, r, t, i) {
|
|
122
|
+
if (!g(n))
|
|
123
|
+
return n;
|
|
124
|
+
r = I(r, n);
|
|
125
|
+
for (var a = -1, f = r.length, e = f - 1, s = n; s != null && ++a < f; ) {
|
|
126
|
+
var d = N(r[a]), u = t;
|
|
127
|
+
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
128
|
+
return n;
|
|
129
|
+
if (a != e) {
|
|
130
|
+
var h = s[d];
|
|
131
|
+
u = void 0, u === void 0 && (u = g(h) ? h : S(r[a + 1]) ? [] : {});
|
|
132
|
+
}
|
|
133
|
+
y(s, d, u), s = s[d];
|
|
134
|
+
}
|
|
135
|
+
return n;
|
|
136
|
+
}
|
|
137
|
+
function xn(n, r, t) {
|
|
138
|
+
for (var i = -1, a = r.length, f = {}; ++i < a; ) {
|
|
139
|
+
var e = r[i], s = _(n, e);
|
|
140
|
+
t(s, e) && an(f, I(e, n), s);
|
|
141
|
+
}
|
|
142
|
+
return f;
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
rn as a,
|
|
146
|
+
tn as b,
|
|
147
|
+
V as c,
|
|
148
|
+
xn as d,
|
|
149
|
+
vn as e,
|
|
150
|
+
dn as f,
|
|
151
|
+
gn as g,
|
|
152
|
+
on as h,
|
|
153
|
+
un as i,
|
|
154
|
+
U as j,
|
|
155
|
+
hn as l,
|
|
156
|
+
mn as m,
|
|
157
|
+
K as t
|
|
158
|
+
};
|