@whcecw/maotu 0.0.28
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 +165 -0
- package/README.md +72 -0
- package/dist/favicon.svg +34 -0
- package/dist/imgs/change-attr.png +0 -0
- package/dist/imgs/edit-load.png +0 -0
- package/dist/imgs/edit.png +0 -0
- package/dist/imgs/event-callback.png +0 -0
- package/dist/imgs/set-node-attr.gif +0 -0
- package/dist/maotu.es.js +39711 -0
- package/dist/maotu.umd.js +1168 -0
- package/dist/src/components/custom-components/card-vue/index.vue.d.ts +32 -0
- package/dist/src/components/custom-components/jijia-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/kv-vue/index.vue.d.ts +86 -0
- package/dist/src/components/custom-components/now-time-vue/index.vue.d.ts +41 -0
- package/dist/src/components/custom-components/panche-vue/index.vue.d.ts +59 -0
- package/dist/src/components/custom-components/recttext-vue/index.vue.d.ts +77 -0
- package/dist/src/components/custom-components/rotor-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/sys-button-vue/index.vue.d.ts +35 -0
- package/dist/src/components/custom-components/text-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/topcover-vue/index.vue.d.ts +59 -0
- package/dist/src/components/mt-dzr/components/render-item.vue.d.ts +9 -0
- package/dist/src/components/mt-dzr/components/resize-handle.vue.d.ts +49 -0
- package/dist/src/components/mt-dzr/components/rotate-handle.vue.d.ts +34 -0
- package/dist/src/components/mt-dzr/composables/mouse.d.ts +0 -0
- package/dist/src/components/mt-dzr/index.d.ts +3 -0
- package/dist/src/components/mt-dzr/index.vue.d.ts +123 -0
- package/dist/src/components/mt-dzr/store/index.d.ts +3 -0
- package/dist/src/components/mt-dzr/store/types.d.ts +13 -0
- package/dist/src/components/mt-dzr/types.d.ts +31 -0
- package/dist/src/components/mt-dzr/utils/index.d.ts +84 -0
- package/dist/src/components/mt-dzr/utils/types.d.ts +1 -0
- package/dist/src/components/mt-edit/ace-edit.d.ts +1 -0
- package/dist/src/components/mt-edit/components/canvas-ruler/index.vue.d.ts +37 -0
- package/dist/src/components/mt-edit/components/context-menu/index.vue.d.ts +29 -0
- package/dist/src/components/mt-edit/components/custom-svg-render/index.vue.d.ts +2 -0
- package/dist/src/components/mt-edit/components/done-tree/index.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/drag-canvas/index.vue.d.ts +40 -0
- package/dist/src/components/mt-edit/components/draw-line-render/index.vue.d.ts +44 -0
- package/dist/src/components/mt-edit/components/export-json/index.vue.d.ts +26 -0
- package/dist/src/components/mt-edit/components/group-render/index.vue.d.ts +27 -0
- package/dist/src/components/mt-edit/components/import-json/index.vue.d.ts +4 -0
- package/dist/src/components/mt-edit/components/layout/header-panel/index.vue.d.ts +92 -0
- package/dist/src/components/mt-edit/components/layout/left-aside/index.vue.d.ts +30 -0
- package/dist/src/components/mt-edit/components/layout/main-panel/index.vue.d.ts +39 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/index.vue.d.ts +11 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/json-edit.vue.d.ts +18 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/page-setting.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-animate-setting/common-animate.vue.d.ts +18 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-animate-setting/index.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-event-setting/index.vue.d.ts +35 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-event-setting/input-target-value.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-props-setting.vue.d.ts +24 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-setting.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/line-render/index.vue.d.ts +44 -0
- package/dist/src/components/mt-edit/components/pattern-grid/index.vue.d.ts +32 -0
- package/dist/src/components/mt-edit/components/render-core/index.vue.d.ts +78 -0
- package/dist/src/components/mt-edit/components/render-core/types.d.ts +9 -0
- package/dist/src/components/mt-edit/components/render-item/index.vue.d.ts +47 -0
- package/dist/src/components/mt-edit/components/selected-area/index.vue.d.ts +40 -0
- package/dist/src/components/mt-edit/components/selected-area/types.d.ts +6 -0
- package/dist/src/components/mt-edit/components/svg-analysis/index.vue.d.ts +22 -0
- package/dist/src/components/mt-edit/components/svg-render/index.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/types.d.ts +13 -0
- package/dist/src/components/mt-edit/composables/index.d.ts +11 -0
- package/dist/src/components/mt-edit/composables/sys-line.d.ts +18 -0
- package/dist/src/components/mt-edit/composables/thumbnail.d.ts +1 -0
- package/dist/src/components/mt-edit/index.d.ts +3 -0
- package/dist/src/components/mt-edit/index.vue.d.ts +65 -0
- package/dist/src/components/mt-edit/store/cache.d.ts +3 -0
- package/dist/src/components/mt-edit/store/config.d.ts +3 -0
- package/dist/src/components/mt-edit/store/context-menu.d.ts +3 -0
- package/dist/src/components/mt-edit/store/global.d.ts +3 -0
- package/dist/src/components/mt-edit/store/left-aside.d.ts +3 -0
- package/dist/src/components/mt-edit/store/types.d.ts +238 -0
- package/dist/src/components/mt-edit/utils/index.d.ts +206 -0
- package/dist/src/components/mt-preview/index.d.ts +3 -0
- package/dist/src/components/mt-preview/index.vue.d.ts +51 -0
- package/dist/src/export.d.ts +6 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/router/index.d.ts +11 -0
- package/dist/style.css +7 -0
- package/dist/svgs/demo.svg +21 -0
- package/dist/svgs/my-button.svg +1 -0
- package/dist/svgs/my-input.svg +5 -0
- package/dist/svgs/pie-charts.svg +1 -0
- package/dist/svgs/rotor.svg +4 -0
- package/dist/svgs/rotor1.svg +10 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# maotu-webtopo
|
|
2
|
+
|
|
3
|
+
基于 vue3 的 web 组态引擎库
|
|
4
|
+
|
|
5
|
+
探索将已有 svg 文件转为自由缩放图形库的解决方案,也可用作低代码大屏项目开发
|
|
6
|
+
|
|
7
|
+
## 说明
|
|
8
|
+
|
|
9
|
+
此开源版本的代码源自于 [maotu 插件版](https://www.npmjs.com/package/maotu) 0.3.1 版本,与插件版的差异请查阅插件版的 readme。
|
|
10
|
+
|
|
11
|
+
## 使用文档
|
|
12
|
+
|
|
13
|
+
请参考:[http://mt.yaolm.top](http://mt.yaolm.top)
|
|
14
|
+
|
|
15
|
+
## 声明
|
|
16
|
+
|
|
17
|
+
`maotu-webtopo` 使用了 `LGPL-3.0` 协议。这意味着:
|
|
18
|
+
* 您可以将 `maotu-webtopo` 作为库链接到您的商业项目,而无需开源您的整个项目。
|
|
19
|
+
* 如果您修改了 `maotu-webtopo` 的**核心库**代码,并分发了修改后的版本,您必须按照 LGPL-3.0 协议的要求,开源您所做的修改。
|
|
20
|
+
* 如果您仅仅是将`maotu-webtopo` 作为库链接到你的项目,而没有修改或分发它的源代码,那么你的项目无需开源。
|
|
21
|
+
|
|
22
|
+
详细的 LGPL-3.0 许可证文本请查阅 [https://www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html)。
|
|
23
|
+
|
|
24
|
+
## 如何构建插件并使用
|
|
25
|
+
|
|
26
|
+
**构建库:**
|
|
27
|
+
|
|
28
|
+
1. 使用 `pnpm run lib` 命令构建 `maotu-webtopo`,生成 `dist` 文件夹。
|
|
29
|
+
|
|
30
|
+
**使用库:**
|
|
31
|
+
|
|
32
|
+
1. **推荐使用 pnpm 安装:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm i maotu # 前提是你已经发布到了 npm
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
如果选择手动复制,请继续参考以下步骤
|
|
39
|
+
|
|
40
|
+
2. 将 `dist` 文件夹中的以下文件复制到你的项目:
|
|
41
|
+
* `dist/maotu.es.js`:库的入口文件。
|
|
42
|
+
* `dist/style.css`:库的样式文件。
|
|
43
|
+
* `dist/src` : 库的ts类型定义。
|
|
44
|
+
* 将这些文件放到你项目中的合适位置。例如,你可以创建一个 `src/lib/maotu` 目录,并将它们复制到这里。
|
|
45
|
+
|
|
46
|
+
3. 确保你的项目可以访问到 `style.css` 文件。可以通过在入口文件或组件中引入的方式来实现。
|
|
47
|
+
|
|
48
|
+
**在项目中使用示例:**
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { MtEdit } from "@/lib/maotu/maotu.es" // 替换为你的实际路径
|
|
53
|
+
import "@/lib/maotu/style.css" // 替换为你的实际路径
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<div class="w-1/1 h-100vh">
|
|
58
|
+
<mt-edit ref="MtEditRef" />
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style scoped></style>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 鸣谢
|
|
66
|
+
|
|
67
|
+
maotu的部分逻辑实现参考了以下大佬的文章
|
|
68
|
+
|
|
69
|
+
[幽月之格-可拖拽、缩放、旋转组件实现细节](https://juejin.cn/user/3597257779449165/posts)
|
|
70
|
+
|
|
71
|
+
[woai3c-一个低代码(可视化拖拽)教学项目](https://github.com/woai3c/visual-drag-demo)
|
|
72
|
+
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<svg id="组_2" data-name="组 2" xmlns="http://www.w3.org/2000/svg" width="700" height="700" viewBox="0 0 700 700">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.cls-1 {
|
|
5
|
+
fill: none;
|
|
6
|
+
stroke: #00ccbd;
|
|
7
|
+
stroke-width: 20px;
|
|
8
|
+
fill-rule: evenodd;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cls-2 {
|
|
12
|
+
font-size: 100px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cls-2, .cls-3 {
|
|
16
|
+
fill: #deea2e;
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cls-3 {
|
|
21
|
+
font-size: 120px;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
</defs>
|
|
25
|
+
<g id="组_1" data-name="组 1">
|
|
26
|
+
<path id="形状_1" data-name="形状 1" class="cls-1" d="M34.518,406.156S47.789,166,187.922,211.451c0,0,55.156,15.864,91.453,45.448,0,0,67.7-42.655,141.6,0"/>
|
|
27
|
+
<path id="形状_1_拷贝" data-name="形状 1 拷贝" class="cls-1" d="M665.493,406.156s-13.271-240.373-153.4-194.884c0,0-55.156,15.879-91.452,45.489,0,0-67.7-42.694-141.6,0"/>
|
|
28
|
+
<path id="形状_2" data-name="形状 2" class="cls-1" d="M117.921,306.109s9.026-64.564,74.891-32.1"/>
|
|
29
|
+
<path id="形状_2_拷贝" data-name="形状 2 拷贝" class="cls-1" d="M581.357,306.589s-9-65.089-74.668-32.357"/>
|
|
30
|
+
<text id="ao" class="cls-2" transform="translate(124.132 368.651) scale(0.823)">ao</text>
|
|
31
|
+
<text id="tu" class="cls-2" transform="translate(482.948 368.651) scale(0.823)">tu</text>
|
|
32
|
+
</g>
|
|
33
|
+
<text id="M_A_O_T_U" data-name="M A O T U" class="cls-3" x="45.25" y="537.03">M A O T U</text>
|
|
34
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|