starfish-editor-custom 1.0.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 (108) hide show
  1. package/auto-imports.d.ts +10 -0
  2. package/babel.config.js +8 -0
  3. package/components.d.ts +46 -0
  4. package/dist/ConditionModule.js +892 -0
  5. package/dist/ConditionSelect.js +483 -0
  6. package/dist/CustomDialog.js +105 -0
  7. package/dist/formStyle.js +245 -0
  8. package/dist/globalFormList.js +59 -0
  9. package/dist/jsonCode.js +74 -0
  10. package/dist/jsonEditor.js +71 -0
  11. package/dist/main.js +3319 -0
  12. package/dist/starfish-editor.es.js +30 -0
  13. package/dist/style.css +1 -0
  14. package/dist/types/editor/src/common/ConditionSelect/ConditionGroup.vue.d.ts +61 -0
  15. package/dist/types/editor/src/common/ConditionSelect/ConditionModule.vue.d.ts +43 -0
  16. package/dist/types/editor/src/common/ConditionSelect/ConditionTanc.vue.d.ts +48 -0
  17. package/dist/types/editor/src/common/ConditionSelect.vue.d.ts +72 -0
  18. package/dist/types/editor/src/common/CustomDialog.vue.d.ts +25 -0
  19. package/dist/types/editor/src/common/Loading.vue.d.ts +3 -0
  20. package/dist/types/editor/src/common/formJson.d.ts +80 -0
  21. package/dist/types/editor/src/common/jsonCode.vue.d.ts +110 -0
  22. package/dist/types/editor/src/components/ComponentList.vue.d.ts +32 -0
  23. package/dist/types/editor/src/components/FormPreview.vue.d.ts +25 -0
  24. package/dist/types/editor/src/components/Nav.vue.d.ts +9 -0
  25. package/dist/types/editor/src/components/PropsPanel.vue.d.ts +53 -0
  26. package/dist/types/editor/src/components/Shape.vue.d.ts +40 -0
  27. package/dist/types/editor/src/components/Workspace.vue.d.ts +22 -0
  28. package/dist/types/editor/src/components/globalFormList.vue.d.ts +6 -0
  29. package/dist/types/editor/src/components/jsonEditor.vue.d.ts +6 -0
  30. package/dist/types/editor/src/controller/action.d.ts +18 -0
  31. package/dist/types/editor/src/controller/form.d.ts +24 -0
  32. package/dist/types/editor/src/controller/history.d.ts +12 -0
  33. package/dist/types/editor/src/controller/shortcut.d.ts +20 -0
  34. package/dist/types/editor/src/controller/ui.d.ts +10 -0
  35. package/dist/types/editor/src/layouts/ControlEditSize.vue.d.ts +17 -0
  36. package/dist/types/editor/src/layouts/Framework.vue.d.ts +33 -0
  37. package/dist/types/editor/src/layouts/Resizer.vue.d.ts +13 -0
  38. package/dist/types/editor/src/layouts/ShortcutKey.vue.d.ts +8 -0
  39. package/dist/types/editor/src/main.d.ts +5 -0
  40. package/dist/types/editor/src/shims-vue.d.ts +23 -0
  41. package/dist/types/editor/src/starfish-editor.vue.d.ts +109 -0
  42. package/dist/types/editor/src/type.d.ts +224 -0
  43. package/dist/types/editor/src/utils/_.d.ts +33 -0
  44. package/dist/types/editor/src/utils/formKeycon.d.ts +18 -0
  45. package/dist/types/editor/src/utils/shortcutKey.d.ts +3 -0
  46. package/dist/types/editor/src/utils/vm.d.ts +3 -0
  47. package/dist/types/starfish-editor.d.ts +3 -0
  48. package/package.json +55 -0
  49. package/src/common/ConditionSelect/ConditionGroup.vue +167 -0
  50. package/src/common/ConditionSelect/ConditionModule.vue +118 -0
  51. package/src/common/ConditionSelect/ConditionTanc.vue +319 -0
  52. package/src/common/ConditionSelect.vue +268 -0
  53. package/src/common/CustomDialog.vue +77 -0
  54. package/src/common/Loading.vue +10 -0
  55. package/src/common/formJson.ts +143 -0
  56. package/src/common/formStyle.vue +170 -0
  57. package/src/common/jsonCode.vue +45 -0
  58. package/src/components/ComponentList.vue +156 -0
  59. package/src/components/FormPreview.vue +197 -0
  60. package/src/components/Nav.vue +128 -0
  61. package/src/components/NavList.vue +560 -0
  62. package/src/components/PropsPanel.vue +376 -0
  63. package/src/components/Shape.vue +178 -0
  64. package/src/components/Workspace.vue +258 -0
  65. package/src/components/globalFormList.vue +30 -0
  66. package/src/components/jsonEditor.vue +41 -0
  67. package/src/controller/action.ts +37 -0
  68. package/src/controller/form.ts +207 -0
  69. package/src/controller/history.ts +57 -0
  70. package/src/controller/shortcut.ts +81 -0
  71. package/src/controller/ui.ts +91 -0
  72. package/src/layouts/ControlEditSize.vue +52 -0
  73. package/src/layouts/Framework.vue +76 -0
  74. package/src/layouts/Resizer.vue +54 -0
  75. package/src/layouts/ShortcutKey.vue +61 -0
  76. package/src/main.ts +56 -0
  77. package/src/shims-vue.d.ts +23 -0
  78. package/src/starfish-editor.vue +176 -0
  79. package/src/styles/common/normalize.css +455 -0
  80. package/src/styles/component-list.scss +64 -0
  81. package/src/styles/condition-select.scss +176 -0
  82. package/src/styles/control_edit_size.scss +36 -0
  83. package/src/styles/custom-dialog.scss +110 -0
  84. package/src/styles/form-preview.scss +47 -0
  85. package/src/styles/framework.scss +150 -0
  86. package/src/styles/iconfont/iconfont.css +247 -0
  87. package/src/styles/iconfont/iconfont.js +1 -0
  88. package/src/styles/iconfont/iconfont.json +415 -0
  89. package/src/styles/iconfont/iconfont.ttf +0 -0
  90. package/src/styles/iconfont/iconfont.woff +0 -0
  91. package/src/styles/iconfont/iconfont.woff2 +0 -0
  92. package/src/styles/index.scss +18 -0
  93. package/src/styles/nav-list.scss +59 -0
  94. package/src/styles/nav.scss +46 -0
  95. package/src/styles/props-panel.scss +115 -0
  96. package/src/styles/resizer.scss +15 -0
  97. package/src/styles/shape.scss +101 -0
  98. package/src/styles/shortcutkey.scss +44 -0
  99. package/src/styles/variables.scss +36 -0
  100. package/src/styles/work-space.scss +126 -0
  101. package/src/type.ts +240 -0
  102. package/src/utils/_.ts +349 -0
  103. package/src/utils/formKeycon.ts +42 -0
  104. package/src/utils/shortcutKey.ts +46 -0
  105. package/src/utils/vm.ts +3 -0
  106. package/stats.html +4949 -0
  107. package/tsconfig.json +19 -0
  108. package/vite.config.ts +111 -0
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "../..",
5
+ "paths": {
6
+ "~editor/*": [
7
+ "./src/pages/Editor/components/*"
8
+ ],
9
+ "@/*": [
10
+ "src/*"
11
+ ]
12
+ },
13
+ },
14
+
15
+ "exclude": [
16
+ "node_modules",
17
+ "**/dist/**/*"
18
+ ],
19
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,111 @@
1
+ import { defineConfig } from "vite";
2
+ import dts from 'vite-plugin-dts';
3
+ import vue from "@vitejs/plugin-vue";
4
+ import path from "path";
5
+ import pkg from './package.json';
6
+ import visualizer from 'rollup-plugin-visualizer'
7
+ import AutoImport from "unplugin-auto-import/vite";
8
+ import Components from "unplugin-vue-components/vite";
9
+ import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
10
+ const alias: any = [
11
+ {
12
+ find: "@",
13
+ replacement: path.resolve(__dirname, "./src"),
14
+ },
15
+ {
16
+ find: "~editor",
17
+ replacement: path.resolve(__dirname, "./src/components"),
18
+ },
19
+ ];
20
+ if (process.env.NODE_ENV != "production") {
21
+ alias.push({ find: /^starfish-form$/, replacement: path.join(__dirname, "../form/src/main.ts") });
22
+ }
23
+ export default defineConfig({
24
+ plugins: [
25
+ dts({
26
+ outputDir: path.join(path.resolve(__dirname, 'dist'), "types"),
27
+ include: ['src/**/*'],
28
+ staticImport: true,
29
+ insertTypesEntry: true,
30
+ logDiagnostics: true
31
+ }),
32
+ vue(),
33
+ visualizer({
34
+ open: true, //在默认用户代理中打开生成的文件
35
+ }),
36
+ AutoImport({
37
+ resolvers: [ElementPlusResolver()],
38
+ }),
39
+ Components({
40
+ resolvers: [ElementPlusResolver()],
41
+ }),
42
+ ],
43
+ resolve: {
44
+ alias,
45
+ },
46
+ css: {
47
+ //css预处理
48
+ preprocessorOptions: {
49
+ scss: {
50
+ additionalData: '@import "./src/styles/variables.scss";',
51
+ },
52
+ },
53
+ postcss: {
54
+ plugins: [
55
+ {
56
+ postcssPlugin: "internal:charset-removal",
57
+ AtRule: {
58
+ charset: (atRule) => {
59
+ if (atRule.name === "charset") {
60
+ atRule.remove();
61
+ }
62
+ },
63
+ },
64
+ },
65
+ ],
66
+ },
67
+ },
68
+ server: {
69
+ host: "0.0.0.0",
70
+ port: 8888,
71
+ },
72
+ build: {
73
+ cssCodeSplit: false, // 如果设置为false,整个项目中的所有 CSS 将被提取到一个 CSS 文件中
74
+ sourcemap: false, // 构建后是否生成 source map 文件。如果为 true,将会创建一个独立的 source map 文件
75
+ target: "esnext", // 设置最终构建的浏览器兼容目标。默认值是一个 Vite 特有的值——'modules' 还可设置为 'es2015' 'es2016'等
76
+ minify: "terser", // 'terser' 相对较慢,但大多数情况下构建后的文件体积更小。'esbuild' 最小化混淆更快但构建后的文件相对更大。
77
+ // terserOptions: {
78
+ // compress: {
79
+ // drop_console: true, // 生产环境去除console
80
+ // drop_debugger: true, // 生产环境去除debugger
81
+ // },
82
+ // },
83
+ lib: {
84
+ entry: "src/main.ts",
85
+ name: "StarfishEditor",
86
+ fileName: "starfish-editor",
87
+ formats: ['es'],
88
+ },
89
+ rollupOptions: {
90
+ // input: {
91
+ // main: path.resolve(__dirname, "index.html"),
92
+ // },
93
+ // manualChunks(id) {
94
+ // if (id.includes("node_modules") && id.includes("element-plus")) {
95
+ // return "element-plus";
96
+ // } else if (id.includes("node_modules") && id.includes("vue")) {
97
+ // return "vue";
98
+ // } else if (id.includes("node_modules") && id.includes("wangeditor")) {
99
+ // return "vendor";
100
+ // } else if (id.includes("node_modules") && id.includes("jsoneditor")) {
101
+ // return "jsoneditor";
102
+ // } else {
103
+ // return "vendor";
104
+ // }
105
+ // },
106
+ external(id: string) {
107
+ return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id));
108
+ },
109
+ },
110
+ },
111
+ });