@ibiz-template/vue3-components 0.7.41-alpha.45 → 0.7.41-alpha.46

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 (72) hide show
  1. package/dist/{index-DgqTP4Vw.js → index-B0XiEslO.js} +1 -1
  2. package/dist/{index-Dr0VM8iS.js → index-B6kaPJDO.js} +1 -1
  3. package/dist/{index-yLzheFmH.js → index-DTj1Yy9-.js} +4 -4
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{wang-editor-homqxACE.js → wang-editor-CRTv7Ujm.js} +1 -1
  7. package/dist/{xlsx-util-C5MBICNN.js → xlsx-util-CqW4WJ9G.js} +1 -1
  8. package/es/common/button-list/button-list.css +1 -1
  9. package/es/index.mjs +1 -0
  10. package/es/locale/en/index.mjs +13 -0
  11. package/es/locale/zh-CN/index.mjs +13 -0
  12. package/es/node_modules/.pnpm/modern-screenshot@4.6.7/node_modules/modern-screenshot/dist/index.mjs +1652 -0
  13. package/es/util/ai-chat-util/ai-chat-util.mjs +21 -21
  14. package/es/util/app-util/app-util.mjs +2 -4
  15. package/es/util/index.mjs +1 -0
  16. package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +3 -3
  17. package/es/util/screen-shot-util/screen-shot/components/index.mjs +3 -0
  18. package/es/util/screen-shot-util/screen-shot/components/screen-shot/screen-shot.css +1 -0
  19. package/es/util/screen-shot-util/screen-shot/components/screen-shot/screen-shot.mjs +113 -0
  20. package/es/util/screen-shot-util/screen-shot/components/screen-shot-toolbar/screen-shot-toolbar.css +1 -0
  21. package/es/util/screen-shot-util/screen-shot/components/screen-shot-toolbar/screen-shot-toolbar.mjs +105 -0
  22. package/es/util/screen-shot-util/screen-shot/constant/index.mjs +172 -0
  23. package/es/util/screen-shot-util/screen-shot/controller/index.mjs +3 -0
  24. package/es/util/screen-shot-util/screen-shot/controller/screen-shot.controller.mjs +366 -0
  25. package/es/util/screen-shot-util/screen-shot/controller/screen-shot.store.mjs +51 -0
  26. package/es/util/screen-shot-util/screen-shot/icon/icon.mjs +90 -0
  27. package/es/util/screen-shot-util/screen-shot/icon/index.mjs +3 -0
  28. package/es/util/screen-shot-util/screen-shot/index.mjs +4 -0
  29. package/es/util/screen-shot-util/screen-shot/module/draw-arrow.mjs +109 -0
  30. package/es/util/screen-shot-util/screen-shot/module/draw-circle.mjs +25 -0
  31. package/es/util/screen-shot-util/screen-shot/module/draw-mosaic.mjs +54 -0
  32. package/es/util/screen-shot-util/screen-shot/module/draw-pencil.mjs +15 -0
  33. package/es/util/screen-shot-util/screen-shot/module/draw-rectangle.mjs +12 -0
  34. package/es/util/screen-shot-util/screen-shot/module/draw-text.mjs +12 -0
  35. package/es/util/screen-shot-util/screen-shot/module/index.mjs +8 -0
  36. package/es/util/screen-shot-util/screen-shot/type/index.mjs +16 -0
  37. package/es/util/screen-shot-util/screen-shot/util/index.mjs +8 -0
  38. package/es/util/screen-shot-util/screen-shot-util.mjs +67 -0
  39. package/es/web-app/main.mjs +2 -0
  40. package/lib/common/button-list/button-list.css +1 -1
  41. package/lib/index.cjs +2 -0
  42. package/lib/locale/en/index.cjs +13 -0
  43. package/lib/locale/zh-CN/index.cjs +13 -0
  44. package/lib/node_modules/.pnpm/modern-screenshot@4.6.7/node_modules/modern-screenshot/dist/index.cjs +1667 -0
  45. package/lib/util/ai-chat-util/ai-chat-util.cjs +21 -21
  46. package/lib/util/app-util/app-util.cjs +2 -4
  47. package/lib/util/index.cjs +2 -0
  48. package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +3 -3
  49. package/lib/util/screen-shot-util/screen-shot/components/index.cjs +7 -0
  50. package/lib/util/screen-shot-util/screen-shot/components/screen-shot/screen-shot.cjs +115 -0
  51. package/lib/util/screen-shot-util/screen-shot/components/screen-shot/screen-shot.css +1 -0
  52. package/lib/util/screen-shot-util/screen-shot/components/screen-shot-toolbar/screen-shot-toolbar.cjs +107 -0
  53. package/lib/util/screen-shot-util/screen-shot/components/screen-shot-toolbar/screen-shot-toolbar.css +1 -0
  54. package/lib/util/screen-shot-util/screen-shot/constant/index.cjs +174 -0
  55. package/lib/util/screen-shot-util/screen-shot/controller/index.cjs +7 -0
  56. package/lib/util/screen-shot-util/screen-shot/controller/screen-shot.controller.cjs +368 -0
  57. package/lib/util/screen-shot-util/screen-shot/controller/screen-shot.store.cjs +53 -0
  58. package/lib/util/screen-shot-util/screen-shot/icon/icon.cjs +100 -0
  59. package/lib/util/screen-shot-util/screen-shot/icon/index.cjs +15 -0
  60. package/lib/util/screen-shot-util/screen-shot/index.cjs +8 -0
  61. package/lib/util/screen-shot-util/screen-shot/module/draw-arrow.cjs +111 -0
  62. package/lib/util/screen-shot-util/screen-shot/module/draw-circle.cjs +27 -0
  63. package/lib/util/screen-shot-util/screen-shot/module/draw-mosaic.cjs +56 -0
  64. package/lib/util/screen-shot-util/screen-shot/module/draw-pencil.cjs +18 -0
  65. package/lib/util/screen-shot-util/screen-shot/module/draw-rectangle.cjs +14 -0
  66. package/lib/util/screen-shot-util/screen-shot/module/draw-text.cjs +14 -0
  67. package/lib/util/screen-shot-util/screen-shot/module/index.cjs +18 -0
  68. package/lib/util/screen-shot-util/screen-shot/type/index.cjs +18 -0
  69. package/lib/util/screen-shot-util/screen-shot/util/index.cjs +10 -0
  70. package/lib/util/screen-shot-util/screen-shot-util.cjs +69 -0
  71. package/lib/web-app/main.cjs +2 -0
  72. package/package.json +6 -5
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ const getAxisColor = (imgData, x, y) => {
5
+ const w = imgData.width;
6
+ const d = imgData.data;
7
+ const color = [];
8
+ color[0] = d[4 * (y * w + x)];
9
+ color[1] = d[4 * (y * w + x) + 1];
10
+ color[2] = d[4 * (y * w + x) + 2];
11
+ color[3] = d[4 * (y * w + x) + 3];
12
+ return color;
13
+ };
14
+ const setAxisColor = (imgData, x, y, color) => {
15
+ const w = imgData.width;
16
+ const d = imgData.data;
17
+ d[4 * (y * w + x)] = color[0];
18
+ d[4 * (y * w + x) + 1] = color[1];
19
+ d[4 * (y * w + x) + 2] = color[2];
20
+ d[4 * (y * w + x) + 3] = color[3];
21
+ };
22
+ function drawMosaic(mouseX, mouseY, size, degreeOfBlur, context) {
23
+ const dpr = window.devicePixelRatio || 1;
24
+ const imgData = context.getImageData(
25
+ mouseX * dpr,
26
+ mouseY * dpr,
27
+ size * dpr,
28
+ size * dpr
29
+ );
30
+ const w = imgData.width;
31
+ const h = imgData.height;
32
+ const stepW = w / degreeOfBlur;
33
+ const stepH = h / degreeOfBlur;
34
+ for (let i = 0; i < stepH; i++) {
35
+ for (let j = 0; j < stepW; j++) {
36
+ const color = getAxisColor(
37
+ imgData,
38
+ j * degreeOfBlur + Math.floor(Math.random() * degreeOfBlur),
39
+ i * degreeOfBlur + Math.floor(Math.random() * degreeOfBlur)
40
+ );
41
+ for (let k = 0; k < degreeOfBlur; k++) {
42
+ for (let l = 0; l < degreeOfBlur; l++) {
43
+ setAxisColor(
44
+ imgData,
45
+ j * degreeOfBlur + l,
46
+ i * degreeOfBlur + k,
47
+ color
48
+ );
49
+ }
50
+ }
51
+ }
52
+ }
53
+ context.putImageData(imgData, mouseX * dpr, mouseY * dpr);
54
+ }
55
+
56
+ exports.drawMosaic = drawMosaic;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ function initPencil(context, mouseX, mouseY) {
5
+ context.beginPath();
6
+ context.moveTo(mouseX, mouseY);
7
+ }
8
+ function drawPencil(context, mouseX, mouseY, size, color) {
9
+ context.save();
10
+ context.lineWidth = size;
11
+ context.strokeStyle = color;
12
+ context.lineTo(mouseX, mouseY);
13
+ context.stroke();
14
+ context.restore();
15
+ }
16
+
17
+ exports.drawPencil = drawPencil;
18
+ exports.initPencil = initPencil;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ function drawRectangle(mouseX, mouseY, width, height, color, borderWidth, context) {
5
+ context.save();
6
+ context.strokeStyle = color;
7
+ context.lineWidth = borderWidth;
8
+ context.beginPath();
9
+ context.rect(mouseX, mouseY, width, height);
10
+ context.stroke();
11
+ context.restore();
12
+ }
13
+
14
+ exports.drawRectangle = drawRectangle;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ function drawText(text, mouseX, mouseY, color, fontSize, context) {
5
+ context.save();
6
+ context.lineWidth = 1;
7
+ context.fillStyle = color;
8
+ context.textBaseline = "middle";
9
+ context.font = "bold ".concat(fontSize, "px none");
10
+ context.fillText(text, mouseX, mouseY);
11
+ context.restore();
12
+ }
13
+
14
+ exports.drawText = drawText;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var drawPencil = require('./draw-pencil.cjs');
4
+ var drawText = require('./draw-text.cjs');
5
+ var drawArrow = require('./draw-arrow.cjs');
6
+ var drawCircle = require('./draw-circle.cjs');
7
+ var drawMosaic = require('./draw-mosaic.cjs');
8
+ var drawRectangle = require('./draw-rectangle.cjs');
9
+
10
+ "use strict";
11
+
12
+ exports.drawPencil = drawPencil.drawPencil;
13
+ exports.initPencil = drawPencil.initPencil;
14
+ exports.drawText = drawText.drawText;
15
+ exports.DrawArrow = drawArrow.DrawArrow;
16
+ exports.drawCircle = drawCircle.drawCircle;
17
+ exports.drawMosaic = drawMosaic.drawMosaic;
18
+ exports.drawRectangle = drawRectangle.drawRectangle;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ var ToolbarItemType = /* @__PURE__ */ ((ToolbarItemType2) => {
5
+ ToolbarItemType2["BRUSH"] = "brush";
6
+ ToolbarItemType2["RECT"] = "rect";
7
+ ToolbarItemType2["CIRCLE"] = "circle";
8
+ ToolbarItemType2["MARKER"] = "marker";
9
+ ToolbarItemType2["TEXT"] = "text";
10
+ ToolbarItemType2["ARROW"] = "arrow";
11
+ ToolbarItemType2["DIVIDER"] = "divider";
12
+ ToolbarItemType2["AI"] = "ai";
13
+ ToolbarItemType2["MOSAIC"] = "mosaic";
14
+ ToolbarItemType2["DRAWDOWN"] = "drawdown";
15
+ return ToolbarItemType2;
16
+ })(ToolbarItemType || {});
17
+
18
+ exports.ToolbarItemType = ToolbarItemType;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ "use strict";
4
+ function getMousePosition(event) {
5
+ const mouseX = event.offsetX > 0 ? event.offsetX : 0;
6
+ const mouseY = event.offsetY > 0 ? event.offsetY : 0;
7
+ return { mouseX, mouseY };
8
+ }
9
+
10
+ exports.getMousePosition = getMousePosition;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ require('./screen-shot/index.cjs');
5
+ var screenShot = require('./screen-shot/components/screen-shot/screen-shot.cjs');
6
+
7
+ "use strict";
8
+ var __defProp = Object.defineProperty;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __publicField = (obj, key, value) => {
11
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
12
+ return value;
13
+ };
14
+ class ScreenShotUtil {
15
+ /**
16
+ * Creates an instance of ScreenShotUtil.
17
+ * @memberof ScreenShotUtil
18
+ */
19
+ constructor() {
20
+ __publicField(this, "currentApp", null);
21
+ __publicField(this, "container", null);
22
+ }
23
+ /**
24
+ * @description 销毁组件实例
25
+ * @private
26
+ * @memberof ScreenShotUtil
27
+ */
28
+ destroyComponent() {
29
+ if (this.currentApp && this.container) {
30
+ this.currentApp.unmount();
31
+ this.currentApp = null;
32
+ }
33
+ if (this.container && document.body.contains(this.container)) {
34
+ document.body.removeChild(this.container);
35
+ this.container = null;
36
+ }
37
+ }
38
+ /**
39
+ * @description 开始截图
40
+ * @param {HTMLElement} element 需要截图的元素
41
+ * @param {{ container?: HTMLElement; itemClassName?: string }} opts 如果需针对dom内部滚动容器截图,则需配置:滚动容器,滚动容器项类名,用以排除非可视区元素
42
+ * @returns {*} {(Promise<string | undefined>)} 图片(png格式) base64 字符串
43
+ * @memberof ScreenShotUtil
44
+ */
45
+ async onScreenShot(element, opts) {
46
+ this.destroyComponent();
47
+ const { container, itemClassName } = opts;
48
+ return new Promise((resolve) => {
49
+ this.container = document.createElement("div");
50
+ document.body.appendChild(this.container);
51
+ this.currentApp = vue.createApp(screenShot.ScreenShot, {
52
+ element,
53
+ container,
54
+ itemClassName,
55
+ onComplete: (base64) => {
56
+ this.destroyComponent();
57
+ resolve(base64);
58
+ },
59
+ onCancel: () => {
60
+ this.destroyComponent();
61
+ resolve(void 0);
62
+ }
63
+ });
64
+ this.currentApp.mount(this.container);
65
+ });
66
+ }
67
+ }
68
+
69
+ exports.ScreenShotUtil = ScreenShotUtil;
@@ -24,6 +24,7 @@ var loadingUtil = require('../util/loading-util/loading-util.cjs');
24
24
  var noticeUtil = require('../util/notice-util/notice-util.cjs');
25
25
  var overlayController = require('../util/overlay-controller/overlay-controller.cjs');
26
26
  var inlineAiUtil = require('../util/inline-ai-util/inline-ai-util.cjs');
27
+ var screenShotUtil = require('../util/screen-shot-util/screen-shot-util.cjs');
27
28
  var aiChatUtil = require('../util/ai-chat-util/ai-chat-util.cjs');
28
29
  var fullscreenUtil = require('../util/fullscreen/fullscreen-util.cjs');
29
30
 
@@ -86,6 +87,7 @@ async function runApp(plugins, opts) {
86
87
  ibiz.notice = new noticeUtil.NoticeUtil();
87
88
  ibiz.overlay = new overlayController.OverlayController();
88
89
  ibiz.inLineAIUtil = new inlineAiUtil.InLineAIUtil();
90
+ ibiz.screenShotUtil = new screenShotUtil.ScreenShotUtil();
89
91
  ibiz.aiChatUtil = new aiChatUtil.AIChatUtil();
90
92
  ibiz.util.text.format = (value, code) => {
91
93
  return app.config.globalProperties.$textFormat(value, code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.45",
3
+ "version": "0.7.41-alpha.46",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -30,16 +30,16 @@
30
30
  "dependencies": {
31
31
  "@amap/amap-jsapi-loader": "^1.0.1",
32
32
  "@floating-ui/dom": "^1.5.3",
33
- "@ibiz-template-plugin/ai-chat": "^0.0.37",
33
+ "@ibiz-template-plugin/ai-chat": "^0.0.38",
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.316",
35
35
  "@ibiz-template-plugin/bi-report": "0.0.30",
36
36
  "@ibiz-template-plugin/data-view": "0.0.6",
37
37
  "@ibiz-template/core": "0.7.41-alpha.35",
38
38
  "@ibiz-template/devtool": "0.0.13",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.43",
40
- "@ibiz-template/runtime": "0.7.41-alpha.43",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.44",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.44",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.43",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.44",
43
43
  "@ibiz-template/web-theme": "3.9.0",
44
44
  "@ibiz/model-core": "^0.1.84",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",
@@ -68,6 +68,7 @@
68
68
  "vuedraggable": "^4.1.0",
69
69
  "sortablejs": "^1.15.6",
70
70
  "snabbdom": "^3.3.1",
71
+ "modern-screenshot": "^4.6.7",
71
72
  "xlsx": "^0.18.5"
72
73
  },
73
74
  "devDependencies": {