aldehyde 0.2.512 → 0.2.513

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 (64) hide show
  1. package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
  2. package/lib/draw-canvas-edit/components/asset-bar/index.less +35 -35
  3. package/lib/draw-canvas-edit/components/main-header/index.less +23 -23
  4. package/lib/lowcode-components/base-table/index.less +61 -61
  5. package/lib/lowcode-components/data-number/index.less +10 -10
  6. package/lib/lowcode-components/date-time/index.less +4 -4
  7. package/lib/lowcode-components/four-angle-glow-border/index.less +49 -49
  8. package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  9. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  10. package/lib/lowcode-components/text-scroller/index.less +28 -28
  11. package/lib/table/act-table.js +1 -1
  12. package/lib/table/act-table.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
  15. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +156 -156
  16. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.less +35 -35
  17. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.tsx +110 -110
  18. package/src/aldehyde/draw-canvas-edit/components/main-header/index.less +23 -23
  19. package/src/aldehyde/draw-canvas-edit/components/main-header/index.tsx +263 -263
  20. package/src/aldehyde/draw-canvas-edit/components/render/draws/index.ts +7 -7
  21. package/src/aldehyde/draw-canvas-edit/components/render/graphs/base-graph.ts +241 -241
  22. package/src/aldehyde/draw-canvas-edit/components/render/graphs/circle.ts +699 -699
  23. package/src/aldehyde/draw-canvas-edit/components/render/graphs/curve.ts +500 -500
  24. package/src/aldehyde/draw-canvas-edit/components/render/graphs/index.ts +5 -5
  25. package/src/aldehyde/draw-canvas-edit/components/render/graphs/line.ts +493 -493
  26. package/src/aldehyde/draw-canvas-edit/components/render/graphs/rect.ts +680 -680
  27. package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-handlers.ts +68 -68
  28. package/src/aldehyde/draw-canvas-edit/components/render/handlers/graph-handlers.ts +113 -113
  29. package/src/aldehyde/draw-canvas-edit/components/render/handlers/index.ts +9 -9
  30. package/src/aldehyde/draw-canvas-edit/components/render/handlers/key-move-handlers.ts +49 -49
  31. package/src/aldehyde/draw-canvas-edit/components/render/handlers/link-handlers.ts +45 -45
  32. package/src/aldehyde/draw-canvas-edit/components/render/handlers/shutcut-handlers.ts +45 -45
  33. package/src/aldehyde/draw-canvas-edit/components/render/handlers/text-handlers.ts +81 -81
  34. package/src/aldehyde/draw-canvas-edit/components/render/handlers/zoom-handlers.ts +59 -59
  35. package/src/aldehyde/draw-canvas-edit/components/render/tools/align-tool.ts +89 -89
  36. package/src/aldehyde/draw-canvas-edit/components/render/tools/asset-tool.ts +154 -154
  37. package/src/aldehyde/draw-canvas-edit/components/render/tools/link-tool.ts +222 -222
  38. package/src/aldehyde/draw-canvas-edit/components/render/tools/z-index-tool.ts +224 -224
  39. package/src/aldehyde/draw-canvas-edit/components/render/utils/a-star.ts +116 -116
  40. package/src/aldehyde/draw-canvas-edit/components/render/utils/bezier-scene-func.ts +72 -72
  41. package/src/aldehyde/draw-canvas-edit/components/setting-form/imag-upload.tsx +119 -119
  42. package/src/aldehyde/layout4/imgs/user.svg +26 -26
  43. package/src/aldehyde/lowcode-components/base-color-block/index.tsx +31 -31
  44. package/src/aldehyde/lowcode-components/base-table/index.less +61 -61
  45. package/src/aldehyde/lowcode-components/data-number/index.less +10 -10
  46. package/src/aldehyde/lowcode-components/date-time/index.less +4 -4
  47. package/src/aldehyde/lowcode-components/date-time/index.tsx +64 -64
  48. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.less +49 -49
  49. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.tsx +53 -53
  50. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-controller.ts +64 -64
  51. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-definition.ts +77 -77
  52. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-loader.ts +36 -36
  53. package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +144 -144
  54. package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  55. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/controller.ts +36 -36
  56. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/definition.ts +53 -53
  57. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/index.tsx +15 -15
  58. package/src/aldehyde/lowcode-components/lowcode-view/component/layer-builder.tsx +98 -98
  59. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  60. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +121 -121
  61. package/src/aldehyde/lowcode-components/placeholder-component/index.tsx +81 -81
  62. package/src/aldehyde/lowcode-components/text-scroller/index.less +28 -28
  63. package/src/aldehyde/lowcode-components/text-scroller/index.tsx +173 -173
  64. package/src/aldehyde/table/act-table.tsx +1 -1
@@ -1,81 +1,81 @@
1
- import Konva from 'konva';
2
- import { Render } from '../index';
3
- import { Handler } from '../types';
4
-
5
- // 文本创建操作
6
-
7
- export class TextHandlers implements Handler {
8
- static readonly NAME = 'TextHandlers';
9
- private render: Render;
10
- constructor(render: Render) {
11
- this.render = render;
12
- }
13
- // 获取鼠标位置,并处理为相对大小
14
- getStagePoint(attract = false) {
15
- const pos = this.render.stage.getPointerPosition();
16
- if (pos) {
17
- const stageState = this.render.getStageState();
18
- if (attract) {
19
- const { pos: transformerPos } = this.render.attractTool.attractPoint(pos);
20
- return {
21
- x: this.render.toStageValue(transformerPos.x - stageState.x),
22
- y: this.render.toStageValue(transformerPos.y - stageState.y)
23
- };
24
- } else {
25
- return {
26
- x: this.render.toStageValue(pos.x - stageState.x),
27
- y: this.render.toStageValue(pos.y - stageState.y)
28
- };
29
- }
30
- }
31
- return null;
32
- }
33
- group: Konva.Group | null = null;
34
- handlers = {
35
- stage: {
36
- mousedown: (e: Konva.KonvaEventObject<MouseEvent>) => {
37
- // 只有在 texting 模式且点击空白区域时才创建文本
38
- if (!this.render.texting) return;
39
- const target = e.target;
40
- // 检查是否点击在 stage 背景上(不是其他元素)
41
- const isBackground = target === this.render.stage ||
42
- (target.attrs && target.attrs.name && target.attrs.name.includes('background'));
43
- if (!isBackground) return;
44
- try {
45
- // 清除当前选择
46
- this.render.selectionTool.selectingClear();
47
- this.render.linkTool.selectingClear();
48
- const point = this.getStagePoint();
49
- if (point) {
50
- this.group = this.render.importExportTool.addTextAsset(point);
51
- if (this.group) {
52
- // 创建成功后立即选中文本
53
- this.render.selectionTool.select([this.group]);
54
- }
55
- }
56
- } catch (err) {
57
- console.error('Failed to create text asset:', err);
58
- this.group = null;
59
- }
60
- },
61
- mouseup: () => { // 重置 texting 状态
62
- this.render.changeTexting(false);
63
- this.group = null;
64
- },
65
- click: (e: Konva.KonvaEventObject<MouseEvent>) => { // 点击空白区域时,如果有文本创建了一半,也取消
66
- if (!this.render.texting) return;
67
- const target = e.target;
68
- const isBackground = target === this.render.stage ||
69
- (target.attrs && target.attrs.name && target.attrs.name.includes('background'));
70
- if (isBackground) {
71
- this.render.changeTexting(false);
72
- }
73
- }
74
- },
75
- transformer: {
76
- dblclick: () => {
77
- // 双击文本时显示编辑面板
78
- }
79
- }
80
- }
81
- }
1
+ import Konva from 'konva';
2
+ import { Render } from '../index';
3
+ import { Handler } from '../types';
4
+
5
+ // 文本创建操作
6
+
7
+ export class TextHandlers implements Handler {
8
+ static readonly NAME = 'TextHandlers';
9
+ private render: Render;
10
+ constructor(render: Render) {
11
+ this.render = render;
12
+ }
13
+ // 获取鼠标位置,并处理为相对大小
14
+ getStagePoint(attract = false) {
15
+ const pos = this.render.stage.getPointerPosition();
16
+ if (pos) {
17
+ const stageState = this.render.getStageState();
18
+ if (attract) {
19
+ const { pos: transformerPos } = this.render.attractTool.attractPoint(pos);
20
+ return {
21
+ x: this.render.toStageValue(transformerPos.x - stageState.x),
22
+ y: this.render.toStageValue(transformerPos.y - stageState.y)
23
+ };
24
+ } else {
25
+ return {
26
+ x: this.render.toStageValue(pos.x - stageState.x),
27
+ y: this.render.toStageValue(pos.y - stageState.y)
28
+ };
29
+ }
30
+ }
31
+ return null;
32
+ }
33
+ group: Konva.Group | null = null;
34
+ handlers = {
35
+ stage: {
36
+ mousedown: (e: Konva.KonvaEventObject<MouseEvent>) => {
37
+ // 只有在 texting 模式且点击空白区域时才创建文本
38
+ if (!this.render.texting) return;
39
+ const target = e.target;
40
+ // 检查是否点击在 stage 背景上(不是其他元素)
41
+ const isBackground = target === this.render.stage ||
42
+ (target.attrs && target.attrs.name && target.attrs.name.includes('background'));
43
+ if (!isBackground) return;
44
+ try {
45
+ // 清除当前选择
46
+ this.render.selectionTool.selectingClear();
47
+ this.render.linkTool.selectingClear();
48
+ const point = this.getStagePoint();
49
+ if (point) {
50
+ this.group = this.render.importExportTool.addTextAsset(point);
51
+ if (this.group) {
52
+ // 创建成功后立即选中文本
53
+ this.render.selectionTool.select([this.group]);
54
+ }
55
+ }
56
+ } catch (err) {
57
+ console.error('Failed to create text asset:', err);
58
+ this.group = null;
59
+ }
60
+ },
61
+ mouseup: () => { // 重置 texting 状态
62
+ this.render.changeTexting(false);
63
+ this.group = null;
64
+ },
65
+ click: (e: Konva.KonvaEventObject<MouseEvent>) => { // 点击空白区域时,如果有文本创建了一半,也取消
66
+ if (!this.render.texting) return;
67
+ const target = e.target;
68
+ const isBackground = target === this.render.stage ||
69
+ (target.attrs && target.attrs.name && target.attrs.name.includes('background'));
70
+ if (isBackground) {
71
+ this.render.changeTexting(false);
72
+ }
73
+ }
74
+ },
75
+ transformer: {
76
+ dblclick: () => {
77
+ // 双击文本时显示编辑面板
78
+ }
79
+ }
80
+ }
81
+ }
@@ -1,59 +1,59 @@
1
- import Konva from 'konva';
2
- import { Render } from '../index';
3
- import { Handler } from '../types';
4
- import { GraphDraw, LinkDraw, RulerDraw, PreviewDraw, RefLineDraw, BgDraw } from '../draws';
5
-
6
- // 缩放
7
-
8
- export class ZoomHandlers implements Handler {
9
- static readonly NAME = 'ZoomHandlers';
10
- private render: Render;
11
- constructor(render: Render) {
12
- this.render = render;
13
- }
14
- scaleBy = 0.1; // zoom 速度
15
- // zoom 范围
16
- scaleMin = 0.2;
17
- scaleMax = 5;
18
-
19
- handlers = {
20
- stage: {
21
- wheel: (e: Konva.KonvaEventObject<GlobalEventHandlersEventMap['wheel']>) => {
22
- const { scale: oldScale } = this.render.getStageState();
23
- const isPinchToZoom = e.evt.ctrlKey;
24
- const newScale = isPinchToZoom ? oldScale + (e.evt.deltaY < 0 ? this.scaleBy : -this.scaleBy) : oldScale;
25
- const finalScale = Math.max(this.scaleMin, Math.min(this.scaleMax, newScale));
26
- if (finalScale !== oldScale) {
27
- const position = this.render.stage.getPosition();
28
- const point = { x: e.evt.offsetX, y: e.evt.offsetY };
29
- const mousePointTo = {
30
- x: (point.x - position.x) / oldScale,
31
- y: (point.y - position.y) / oldScale
32
- };
33
- const newPosition = {
34
- x: -(mousePointTo.x * finalScale - point.x),
35
- y: -(mousePointTo.y * finalScale - point.y)
36
- };
37
- this.render.emit('scale-change', finalScale);
38
- this.render.stage.scale({ x: finalScale, y: finalScale });
39
- this.render.stage.position(newPosition);
40
- } else if (!isPinchToZoom) {
41
- const position = this.render.stage.getPosition();
42
- this.render.stage.position({
43
- x: position.x - e.evt.deltaX,
44
- y: position.y - e.evt.deltaY
45
- });
46
- }
47
- // 重绘
48
- this.render.redraw([
49
- BgDraw.NAME,
50
- GraphDraw.NAME,
51
- LinkDraw.NAME,
52
- RulerDraw.NAME,
53
- RefLineDraw.NAME,
54
- PreviewDraw.NAME
55
- ]);
56
- }
57
- }
58
- }
59
- }
1
+ import Konva from 'konva';
2
+ import { Render } from '../index';
3
+ import { Handler } from '../types';
4
+ import { GraphDraw, LinkDraw, RulerDraw, PreviewDraw, RefLineDraw, BgDraw } from '../draws';
5
+
6
+ // 缩放
7
+
8
+ export class ZoomHandlers implements Handler {
9
+ static readonly NAME = 'ZoomHandlers';
10
+ private render: Render;
11
+ constructor(render: Render) {
12
+ this.render = render;
13
+ }
14
+ scaleBy = 0.1; // zoom 速度
15
+ // zoom 范围
16
+ scaleMin = 0.2;
17
+ scaleMax = 5;
18
+
19
+ handlers = {
20
+ stage: {
21
+ wheel: (e: Konva.KonvaEventObject<GlobalEventHandlersEventMap['wheel']>) => {
22
+ const { scale: oldScale } = this.render.getStageState();
23
+ const isPinchToZoom = e.evt.ctrlKey;
24
+ const newScale = isPinchToZoom ? oldScale + (e.evt.deltaY < 0 ? this.scaleBy : -this.scaleBy) : oldScale;
25
+ const finalScale = Math.max(this.scaleMin, Math.min(this.scaleMax, newScale));
26
+ if (finalScale !== oldScale) {
27
+ const position = this.render.stage.getPosition();
28
+ const point = { x: e.evt.offsetX, y: e.evt.offsetY };
29
+ const mousePointTo = {
30
+ x: (point.x - position.x) / oldScale,
31
+ y: (point.y - position.y) / oldScale
32
+ };
33
+ const newPosition = {
34
+ x: -(mousePointTo.x * finalScale - point.x),
35
+ y: -(mousePointTo.y * finalScale - point.y)
36
+ };
37
+ this.render.emit('scale-change', finalScale);
38
+ this.render.stage.scale({ x: finalScale, y: finalScale });
39
+ this.render.stage.position(newPosition);
40
+ } else if (!isPinchToZoom) {
41
+ const position = this.render.stage.getPosition();
42
+ this.render.stage.position({
43
+ x: position.x - e.evt.deltaX,
44
+ y: position.y - e.evt.deltaY
45
+ });
46
+ }
47
+ // 重绘
48
+ this.render.redraw([
49
+ BgDraw.NAME,
50
+ GraphDraw.NAME,
51
+ LinkDraw.NAME,
52
+ RulerDraw.NAME,
53
+ RefLineDraw.NAME,
54
+ PreviewDraw.NAME
55
+ ]);
56
+ }
57
+ }
58
+ }
59
+ }
@@ -1,89 +1,89 @@
1
- import Konva from 'konva';
2
- import { Render } from '../index';
3
- import { AlignType } from '../types';
4
- import { GraphDraw, LinkDraw, RulerDraw, PreviewDraw } from '../draws';
5
-
6
- // 工具栏对齐
7
-
8
- export class AlignTool {
9
- private render: Render;
10
- constructor(render: Render) {
11
- this.render = render;
12
- }
13
-
14
- getAlignRect(node: Konva.Node | Konva.Transformer) {
15
- const stageState = this.render.getStageState();
16
- let width = 0, height = 0, x = 0, y = 0;
17
- const result = node.getClientRect();
18
- // 转为 逻辑觉尺寸
19
- [width, height, x, y] = [
20
- this.render.toStageValue(result.width),
21
- this.render.toStageValue(result.height),
22
- this.render.toStageValue(result.x - stageState.x),
23
- this.render.toStageValue(result.y - stageState.y)
24
- ];
25
- return { width, height, x, y };
26
- }
27
-
28
- // 对齐参考点
29
- getAlignPoints(node?: Konva.Node | Konva.Transformer): { [index: string]: number } {
30
- let width = 0, height = 0, x = 0, y = 0;
31
- if (node !== void 0) {
32
- // 选择器 / 基于节点 逻辑觉尺寸
33
- const rect = this.getAlignRect(node);
34
- [width, height, x, y] = [rect.width, rect.height, rect.x, rect.y];
35
- } else { // 默认为选择器
36
- return this.getAlignPoints(this.render.transformer);
37
- }
38
- return {
39
- Middle: x + width / 2,
40
- Left: x,
41
- Right: x + width,
42
- Center: y + height / 2,
43
- Top: y,
44
- Bottom: y + height
45
- };
46
- }
47
-
48
- align(type: AlignType, target?: Konva.Node) {
49
- // 对齐参考点(所有)
50
- const points = this.getAlignPoints(target);
51
- // 对齐参考点
52
- const point = points[type];
53
- // 需要移动的节点
54
- const nodes = this.render.transformer.nodes().filter((node) => node !== target);
55
- // 移动逻辑
56
- for (const node of nodes) {
57
- // 逻辑觉尺寸
58
- const rect = this.getAlignRect(node);
59
- const [width, height, x, y] = [rect.width, rect.height, rect.x, rect.y];
60
- switch (type) {
61
- case "Middle":
62
- case "Left":
63
- case "Right":
64
- {
65
- const cx = type === "Middle" ? x + width / 2 : type === "Left" ? x : x + width;
66
- node.x(node.x() + (point - cx));
67
- }
68
- break;
69
- case "Center":
70
- case "Top":
71
- case "Bottom":
72
- {
73
- const cy = type === "Center" ? y + height / 2 : type === "Top" ? y : y + height;
74
- node.y(node.y() + (point - cy));
75
- }
76
- break;
77
- }
78
- }
79
- // 更新历史
80
- this.render.updateHistory();
81
- // 重绘
82
- this.render.redraw([
83
- GraphDraw.NAME,
84
- LinkDraw.NAME,
85
- RulerDraw.NAME,
86
- PreviewDraw.NAME
87
- ]);
88
- }
89
- }
1
+ import Konva from 'konva';
2
+ import { Render } from '../index';
3
+ import { AlignType } from '../types';
4
+ import { GraphDraw, LinkDraw, RulerDraw, PreviewDraw } from '../draws';
5
+
6
+ // 工具栏对齐
7
+
8
+ export class AlignTool {
9
+ private render: Render;
10
+ constructor(render: Render) {
11
+ this.render = render;
12
+ }
13
+
14
+ getAlignRect(node: Konva.Node | Konva.Transformer) {
15
+ const stageState = this.render.getStageState();
16
+ let width = 0, height = 0, x = 0, y = 0;
17
+ const result = node.getClientRect();
18
+ // 转为 逻辑觉尺寸
19
+ [width, height, x, y] = [
20
+ this.render.toStageValue(result.width),
21
+ this.render.toStageValue(result.height),
22
+ this.render.toStageValue(result.x - stageState.x),
23
+ this.render.toStageValue(result.y - stageState.y)
24
+ ];
25
+ return { width, height, x, y };
26
+ }
27
+
28
+ // 对齐参考点
29
+ getAlignPoints(node?: Konva.Node | Konva.Transformer): { [index: string]: number } {
30
+ let width = 0, height = 0, x = 0, y = 0;
31
+ if (node !== void 0) {
32
+ // 选择器 / 基于节点 逻辑觉尺寸
33
+ const rect = this.getAlignRect(node);
34
+ [width, height, x, y] = [rect.width, rect.height, rect.x, rect.y];
35
+ } else { // 默认为选择器
36
+ return this.getAlignPoints(this.render.transformer);
37
+ }
38
+ return {
39
+ Middle: x + width / 2,
40
+ Left: x,
41
+ Right: x + width,
42
+ Center: y + height / 2,
43
+ Top: y,
44
+ Bottom: y + height
45
+ };
46
+ }
47
+
48
+ align(type: AlignType, target?: Konva.Node) {
49
+ // 对齐参考点(所有)
50
+ const points = this.getAlignPoints(target);
51
+ // 对齐参考点
52
+ const point = points[type];
53
+ // 需要移动的节点
54
+ const nodes = this.render.transformer.nodes().filter((node) => node !== target);
55
+ // 移动逻辑
56
+ for (const node of nodes) {
57
+ // 逻辑觉尺寸
58
+ const rect = this.getAlignRect(node);
59
+ const [width, height, x, y] = [rect.width, rect.height, rect.x, rect.y];
60
+ switch (type) {
61
+ case "Middle":
62
+ case "Left":
63
+ case "Right":
64
+ {
65
+ const cx = type === "Middle" ? x + width / 2 : type === "Left" ? x : x + width;
66
+ node.x(node.x() + (point - cx));
67
+ }
68
+ break;
69
+ case "Center":
70
+ case "Top":
71
+ case "Bottom":
72
+ {
73
+ const cy = type === "Center" ? y + height / 2 : type === "Top" ? y : y + height;
74
+ node.y(node.y() + (point - cy));
75
+ }
76
+ break;
77
+ }
78
+ }
79
+ // 更新历史
80
+ this.render.updateHistory();
81
+ // 重绘
82
+ this.render.redraw([
83
+ GraphDraw.NAME,
84
+ LinkDraw.NAME,
85
+ RulerDraw.NAME,
86
+ PreviewDraw.NAME
87
+ ]);
88
+ }
89
+ }