@jnrs/lingshu-smart 2.2.33 → 2.2.34

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 (50) hide show
  1. package/AGENTS.md +56 -3
  2. package/README.md +140 -0
  3. package/dist/components/debug/DebugPanel.vue.d.ts +2 -0
  4. package/dist/components/debug/PerformanceStats.vue.d.ts +42 -0
  5. package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +36 -0
  6. package/dist/components/debug/ScriptRunner/LogPanel.vue.d.ts +19 -0
  7. package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +42 -0
  8. package/dist/components/debug/ScriptRunner/index.vue.d.ts +16 -0
  9. package/dist/components/debug/ScriptRunner/script.d.ts +72 -0
  10. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +40 -40
  11. package/dist/components/editor/DrawingBoard.vue.d.ts +3 -1
  12. package/dist/components/editor/OptionCard/Equipment/models/PartConfig.vue.d.ts +2 -0
  13. package/dist/components/editor/index.vue.d.ts +3 -1
  14. package/dist/components/index.d.ts +3 -1
  15. package/dist/components/index.js +29307 -2053
  16. package/dist/components/preview/index.vue.d.ts +1859 -3
  17. package/dist/composables/useDebugEasterEgg.d.ts +2 -0
  18. package/dist/controller/AppController.d.ts +9 -0
  19. package/dist/controller/EditorController.d.ts +1 -1
  20. package/dist/index.js +153 -17
  21. package/dist/locales/en.d.ts +45 -0
  22. package/dist/locales/i18next.d.ts +102 -1
  23. package/dist/locales/index.js +94 -4
  24. package/dist/locales/zhCn.d.ts +45 -0
  25. package/dist/playground/ViewPageDemo.vue.d.ts +3744 -6
  26. package/dist/stores/index.d.ts +1 -0
  27. package/dist/stores/useAppStore.d.ts +5565 -3
  28. package/dist/stores/useDataStore.d.ts +5565 -3
  29. package/dist/stores/useDebugStore.d.ts +112 -0
  30. package/dist/stores/useEditorStore.d.ts +5 -2
  31. package/dist/types/app.types.d.ts +3 -0
  32. package/dist/types/enums.d.ts +1 -0
  33. package/dist/types/guards.d.ts +1 -0
  34. package/dist/types/models/config.types.d.ts +9 -1
  35. package/dist/types/models/operating.types.d.ts +8 -1
  36. package/dist/ui/abstract/BaseAbs.d.ts +23 -0
  37. package/dist/ui/abstract/ComponentAbs.d.ts +3 -15
  38. package/dist/ui/abstract/ModelAbs.d.ts +7 -17
  39. package/dist/ui/components/Light.d.ts +5 -0
  40. package/dist/ui/components/StationSlot.d.ts +2 -1
  41. package/dist/ui/models/ResourceStore.d.ts +5 -0
  42. package/dist/ui/models/ShuttleStation.d.ts +21 -0
  43. package/dist/utils/debug-flags.d.ts +9 -0
  44. package/dist/utils/formatOperating.d.ts +7 -0
  45. package/dist/utils/index.d.ts +19 -15
  46. package/dist/utils/logger.d.ts +22 -0
  47. package/dist/utils/performance-stats.d.ts +38 -0
  48. package/package.json +5 -3
  49. package/dist/index-g6O0IWAC.js +0 -24879
  50. package/dist/playground/mockWebSocketData.d.ts +0 -23
@@ -0,0 +1,2 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useDebugEasterEgg(target: Ref<HTMLElement | null | undefined>): void;
@@ -9,6 +9,7 @@ export declare class AppController {
9
9
  private actions;
10
10
  private hideSceneFill;
11
11
  private shadowsEnabled;
12
+ private animationsEnabled;
12
13
  constructor(options?: IContainer);
13
14
  start(): void;
14
15
  destroy(): void;
@@ -22,7 +23,15 @@ export declare class AppController {
22
23
  addModel(modelConfig: ILayer): void;
23
24
  rerenderModel(modelConfig: ILayer): void;
24
25
  operating(data: ILayerOperating): void;
26
+ worldToLocalPoint(worldX: number, worldY: number): {
27
+ x: number;
28
+ y: number;
29
+ } | null;
25
30
  toggleShadows(enabled?: boolean): void;
26
31
  private toggleShadowRecursive;
27
32
  getShadowsEnabled(): boolean;
33
+ toggleAnimations(enabled?: boolean): void;
34
+ private clearAllAnimations;
35
+ getAnimationsEnabled(): boolean;
36
+ setFps(mode: 'auto' | number): void;
28
37
  }
@@ -4,7 +4,7 @@ interface EditorOptions {
4
4
  container: AppController;
5
5
  zoomMin?: number;
6
6
  zoomMax?: number;
7
- onSelected?: (data: any[]) => void;
7
+ onSelected?: (ids: string[]) => void;
8
8
  onRotate?: (rotation: number) => void;
9
9
  onScale?: (width: number, height: number) => void;
10
10
  onMove?: (percentX: number, percentY: number) => void;
package/dist/index.js CHANGED
@@ -1,19 +1,155 @@
1
- import { c as e, b as n, d as o, E as t, a as r, f as i, h as u, i as l, g as m, e as p, l as c, n as h, j as E, t as T, m as x, k as P } from "./index-g6O0IWAC.js";
1
+ var S = /* @__PURE__ */ ((r) => (r.UNDO = "Undo", r.REDO = "Redo", r))(S || {}), _ = /* @__PURE__ */ ((r) => (r.TRANSPORT = "搬运设备", r.MACHINE = "机床", r.CLEANING = "清洗机", r.STATION = "装载站", r.STORAGE = "库", r.OTHER = "其他", r))(_ || {}), c = /* @__PURE__ */ ((r) => (r.SINGLE_JOINT_ROBOT = "SingleJointRobot", r.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", r.RGV = "Rgv", r.MACHINE_TOOL = "MachineTool", r.MARKING_MACHINE = "MarkingMachine", r.CLEANING_MACHINE = "CleaningMachine", r.LOADING_STATION = "LoadingStation", r.SHUTTLE_STATION = "ShuttleStation", r.RAIL = "Rail", r.RESOURCE_STORE = "ResourceStore", r))(c || {}), A = /* @__PURE__ */ ((r) => (r.STATION_SLOT = "StationSlot", r.RESOURCE = "Resource", r))(A || {}), x = /* @__PURE__ */ ((r) => (r.PALLET = "Pallet", r.TOOL = "Tool", r))(x || {});
2
+ function G(r) {
3
+ return r?.className === c.MACHINE_TOOL;
4
+ }
5
+ function C(r) {
6
+ return r?.className === c.MACHINE_TOOL || r?.className === c.MARKING_MACHINE || r?.className === c.CLEANING_MACHINE || r?.className === c.LOADING_STATION;
7
+ }
8
+ function F(r) {
9
+ return r?.className === c.RESOURCE_STORE || r?.className === c.SINGLE_JOINT_ROBOT || r?.className === c.DOUBLE_JOINT_ROBOT || r?.className === c.RGV;
10
+ }
11
+ function B(r) {
12
+ return r?.className === c.SINGLE_JOINT_ROBOT || r?.className === c.DOUBLE_JOINT_ROBOT;
13
+ }
14
+ function H(r) {
15
+ return r?.className === c.RAIL;
16
+ }
17
+ function P(r) {
18
+ return r?.className === c.SHUTTLE_STATION;
19
+ }
20
+ const d = {
21
+ none: 0,
22
+ error: 1,
23
+ warn: 2,
24
+ info: 3,
25
+ log: 4,
26
+ operating: 5
27
+ }, E = {
28
+ log: "LOG",
29
+ info: "INFO",
30
+ warn: "WARN",
31
+ error: "ERROR",
32
+ operating: "OPERATING"
33
+ };
34
+ let s = "warn";
35
+ function U(r) {
36
+ s = r;
37
+ }
38
+ function $() {
39
+ return s;
40
+ }
41
+ const h = {
42
+ log: "background: #6c8eef; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
43
+ info: "background: #4CA56E; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
44
+ warn: "background: #e6a23c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
45
+ error: "background: #f56c6c; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
46
+ operating: "background: #009866; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px"
47
+ }, l = "color: inherit; background: transparent; padding: 0; margin-left: 4px";
48
+ function b(r) {
49
+ return s === "operating-only" ? r === "operating" || r === "error" : r === "operating" ? s === "operating" : d[r] <= d[s];
50
+ }
51
+ const w = {
52
+ log: "log",
53
+ info: "info",
54
+ warn: "warn",
55
+ error: "error",
56
+ operating: "log"
57
+ };
58
+ function f(r, t, ...n) {
59
+ if (!b(r)) return;
60
+ const e = r === "log" || r === "info" || r === "operating", i = E[r], o = w[r];
61
+ t && e ? n.length > 0 && typeof n[0] == "string" ? console[o](`%c${i}:${t}%c ${n[0]}`, h[r], l, ...n.slice(1)) : console[o](`%c${i}:${t}%c`, h[r], l, ...n) : t ? n.length > 0 && typeof n[0] == "string" ? console[o](`[${i}:${t}] ${n[0]}`, ...n.slice(1)) : console[o](`[${i}:${t}]`, ...n) : console[o](...n);
62
+ }
63
+ function m(r = "") {
64
+ return {
65
+ log: (...t) => f("log", r, ...t),
66
+ info: (...t) => f("info", r, ...t),
67
+ warn: (...t) => f("warn", r, ...t),
68
+ error: (...t) => f("error", r, ...t),
69
+ operating: (...t) => f("operating", r, ...t)
70
+ };
71
+ }
72
+ const D = m("LingshuSmart");
73
+ function* J(r, t, n = !1) {
74
+ let e = r;
75
+ for (; ; ) {
76
+ if (e > t)
77
+ if (n)
78
+ e = r;
79
+ else
80
+ return;
81
+ yield e++;
82
+ }
83
+ }
84
+ const M = (r = 0, t = 100, n = 3, e = 300, i) => i ? new Promise((o) => {
85
+ const a = r, T = t, L = n * 1e3, g = performance.now();
86
+ let u = 0;
87
+ const N = (p) => {
88
+ const R = p - g, O = Math.min(R / L, 1), I = a + (T - a) * O;
89
+ if (i(I.toFixed(2)), O >= 1) {
90
+ cancelAnimationFrame(u), o();
91
+ return;
92
+ }
93
+ u = requestAnimationFrame(N);
94
+ };
95
+ u = requestAnimationFrame(N);
96
+ }) : !1;
97
+ function k(r, t, n = 3, e) {
98
+ return r === void 0 || t === void 0 ? 0 : e ? t > 0 ? Number((r / t).toFixed(3)) : 0 : Number((t * r).toFixed(n));
99
+ }
100
+ function V(r, t) {
101
+ return r === void 0 || t === void 0 ? 0 : t > 0 ? Number((r / t).toFixed(3)) : r;
102
+ }
103
+ function Y(r, t, n, e) {
104
+ if (r === void 0) return NaN;
105
+ let i = 0;
106
+ if (e === "width") {
107
+ const o = t?.width || 0, a = t?.runtime_width || 0;
108
+ if (o === 0 || a === 0) return 0;
109
+ i = o / a;
110
+ }
111
+ if (e === "height") {
112
+ const o = t?.height || 0, a = t?.runtime_height || 0;
113
+ if (o === 0 || a === 0) return 0;
114
+ i = o / a;
115
+ }
116
+ return Number((r * i).toFixed(n));
117
+ }
118
+ function q(r, t, n, e) {
119
+ if (r === void 0) return NaN;
120
+ let i = 0;
121
+ if (e === "width") {
122
+ const o = t?.width || 0;
123
+ if (o === 0) return r;
124
+ i = o * r;
125
+ }
126
+ if (e === "height") {
127
+ const o = t?.height || 0;
128
+ if (o === 0) return r;
129
+ i = o * r;
130
+ }
131
+ return Number(i.toFixed(n));
132
+ }
2
133
  export {
3
- e as EnumComponent,
4
- n as EnumModel,
5
- o as EnumResourceType,
6
- t as EnumStepType,
7
- r as EnumTag,
8
- i as hasFixtureChange,
9
- u as hasStationSlotGroup,
10
- l as isMachineTool,
11
- m as isRail,
12
- p as isStationSlotGroupBoth,
13
- c as linearIncrease,
14
- h as numberLoopGenerator,
15
- E as transFraction,
16
- T as transPercentAndPixel,
17
- x as transPercentToPixel,
18
- P as transRuntimeToPixel
134
+ A as EnumComponent,
135
+ c as EnumModel,
136
+ x as EnumResourceType,
137
+ S as EnumStepType,
138
+ _ as EnumTag,
139
+ m as createLogger,
140
+ $ as getLogLevel,
141
+ B as hasFixtureChange,
142
+ C as hasStationSlotGroup,
143
+ G as isMachineTool,
144
+ H as isRail,
145
+ P as isShuttleStation,
146
+ F as isStationSlotGroupBoth,
147
+ M as linearIncrease,
148
+ D as logger,
149
+ J as numberLoopGenerator,
150
+ U as setLogLevel,
151
+ V as transFraction,
152
+ k as transPercentAndPixel,
153
+ q as transPercentToPixel,
154
+ Y as transRuntimeToPixel
19
155
  };
@@ -2,5 +2,50 @@ declare const _default: {
2
2
  main: {
3
3
  title: string;
4
4
  };
5
+ debug: {
6
+ panelTitle: string;
7
+ logLevel: string;
8
+ shadows: string;
9
+ animations: string;
10
+ fps: string;
11
+ interactionsDisabled: string;
12
+ interactionsHint: string;
13
+ language: string;
14
+ reset: string;
15
+ close: string;
16
+ triggerTitle: string;
17
+ triggerMessage: string;
18
+ triggerConfirm: string;
19
+ triggerCancel: string;
20
+ logLevels: {
21
+ none: string;
22
+ operatingOnly: string;
23
+ error: string;
24
+ warn: string;
25
+ info: string;
26
+ log: string;
27
+ operating: string;
28
+ };
29
+ fpsModes: {
30
+ auto: string;
31
+ };
32
+ locales: {
33
+ zhCn: string;
34
+ en: string;
35
+ };
36
+ };
37
+ perf: {
38
+ title: string;
39
+ status: string;
40
+ statusConnected: string;
41
+ statusDisconnected: string;
42
+ sessionStart: string;
43
+ uptime: string;
44
+ websocketTraffic: string;
45
+ messages: string;
46
+ panelButton: string;
47
+ fps: string;
48
+ cpu: string;
49
+ };
5
50
  };
6
51
  export default _default;
@@ -1,2 +1,103 @@
1
- declare const i18n: import('vue-i18n').I18n<{}, {}, {}, string, false>;
1
+ declare const i18n: import('vue-i18n').I18n<{
2
+ zhCn: {
3
+ main: {
4
+ title: string;
5
+ };
6
+ debug: {
7
+ panelTitle: string;
8
+ logLevel: string;
9
+ shadows: string;
10
+ animations: string;
11
+ fps: string;
12
+ interactionsDisabled: string;
13
+ interactionsHint: string;
14
+ language: string;
15
+ reset: string;
16
+ close: string;
17
+ triggerTitle: string;
18
+ triggerMessage: string;
19
+ triggerConfirm: string;
20
+ triggerCancel: string;
21
+ logLevels: {
22
+ none: string;
23
+ operatingOnly: string;
24
+ error: string;
25
+ warn: string;
26
+ info: string;
27
+ log: string;
28
+ operating: string;
29
+ };
30
+ fpsModes: {
31
+ auto: string;
32
+ };
33
+ locales: {
34
+ zhCn: string;
35
+ en: string;
36
+ };
37
+ };
38
+ perf: {
39
+ title: string;
40
+ status: string;
41
+ statusConnected: string;
42
+ statusDisconnected: string;
43
+ sessionStart: string;
44
+ uptime: string;
45
+ websocketTraffic: string;
46
+ messages: string;
47
+ panelButton: string;
48
+ fps: string;
49
+ cpu: string;
50
+ };
51
+ };
52
+ en: {
53
+ main: {
54
+ title: string;
55
+ };
56
+ debug: {
57
+ panelTitle: string;
58
+ logLevel: string;
59
+ shadows: string;
60
+ animations: string;
61
+ fps: string;
62
+ interactionsDisabled: string;
63
+ interactionsHint: string;
64
+ language: string;
65
+ reset: string;
66
+ close: string;
67
+ triggerTitle: string;
68
+ triggerMessage: string;
69
+ triggerConfirm: string;
70
+ triggerCancel: string;
71
+ logLevels: {
72
+ none: string;
73
+ operatingOnly: string;
74
+ error: string;
75
+ warn: string;
76
+ info: string;
77
+ log: string;
78
+ operating: string;
79
+ };
80
+ fpsModes: {
81
+ auto: string;
82
+ };
83
+ locales: {
84
+ zhCn: string;
85
+ en: string;
86
+ };
87
+ };
88
+ perf: {
89
+ title: string;
90
+ status: string;
91
+ statusConnected: string;
92
+ statusDisconnected: string;
93
+ sessionStart: string;
94
+ uptime: string;
95
+ websocketTraffic: string;
96
+ messages: string;
97
+ panelButton: string;
98
+ fps: string;
99
+ cpu: string;
100
+ };
101
+ };
102
+ }, {}, {}, string, false>;
2
103
  export default i18n;
@@ -1,13 +1,103 @@
1
- const t = {
1
+ const e = {
2
2
  main: {
3
3
  title: "灵枢智造"
4
+ },
5
+ debug: {
6
+ panelTitle: "调试配置面板",
7
+ logLevel: "日志显示等级",
8
+ shadows: "显示内外阴影",
9
+ animations: "启用全局动画",
10
+ fps: "全局 FPS",
11
+ interactionsDisabled: "禁止与画布交互",
12
+ interactionsHint: "调试模式开关不受此限制",
13
+ language: "语言",
14
+ reset: "恢复默认",
15
+ close: "关闭",
16
+ triggerTitle: "调试模式",
17
+ triggerMessage: "检测到调试模式触发指令,是否打开调试配置面板?",
18
+ triggerConfirm: "打开",
19
+ triggerCancel: "取消",
20
+ logLevels: {
21
+ none: "全部静默",
22
+ operatingOnly: "全部静默 + 操作追踪",
23
+ error: "仅 Error",
24
+ warn: "Warn + Error",
25
+ info: "Info + Warn + Error",
26
+ log: "全部显示",
27
+ operating: "全部显示 + 操作追踪"
28
+ },
29
+ fpsModes: {
30
+ auto: "自动(不限制)"
31
+ },
32
+ locales: {
33
+ zhCn: "中文",
34
+ en: "English"
35
+ }
36
+ },
37
+ perf: {
38
+ title: "实时监控",
39
+ status: "运行中",
40
+ statusConnected: "已连接",
41
+ statusDisconnected: "已断开",
42
+ sessionStart: "渲染开始时间",
43
+ uptime: "渲染时长",
44
+ websocketTraffic: "WebSocket 流量",
45
+ messages: "条",
46
+ panelButton: "性能统计面板",
47
+ fps: "帧率",
48
+ cpu: "CPU负载"
4
49
  }
5
- }, n = {
50
+ }, t = {
6
51
  main: {
7
52
  title: "LingShu Smart"
53
+ },
54
+ debug: {
55
+ panelTitle: "Debug Configuration Panel",
56
+ logLevel: "Log Level",
57
+ shadows: "Show Shadows",
58
+ animations: "Enable Animations",
59
+ fps: "Global FPS",
60
+ interactionsDisabled: "Disable Canvas Interactions",
61
+ interactionsHint: "Debug mode toggle is not restricted",
62
+ language: "Language",
63
+ reset: "Reset",
64
+ close: "Close",
65
+ triggerTitle: "Debug Mode",
66
+ triggerMessage: "Debug mode trigger detected. Open the debug configuration panel?",
67
+ triggerConfirm: "Open",
68
+ triggerCancel: "Cancel",
69
+ logLevels: {
70
+ none: "Silent",
71
+ operatingOnly: "Silent + Operating Trace",
72
+ error: "Error Only",
73
+ warn: "Warn + Error",
74
+ info: "Info + Warn + Error",
75
+ log: "All (log)",
76
+ operating: "All + Operating Trace"
77
+ },
78
+ fpsModes: {
79
+ auto: "Auto (unlimited)"
80
+ },
81
+ locales: {
82
+ zhCn: "中文",
83
+ en: "English"
84
+ }
85
+ },
86
+ perf: {
87
+ title: "LIVE MONITOR",
88
+ status: "RUNNING",
89
+ statusConnected: "CONNECTED",
90
+ statusDisconnected: "OFFLINE",
91
+ sessionStart: "RENDER START",
92
+ uptime: "RENDER DURATION",
93
+ websocketTraffic: "WEBSOCKET TRAFFIC",
94
+ messages: "msgs",
95
+ panelButton: "Performance Stats",
96
+ fps: "FRAME RATE",
97
+ cpu: "CPU LOAD"
8
98
  }
9
99
  };
10
100
  export {
11
- n as en,
12
- t as zhCn
101
+ t as en,
102
+ e as zhCn
13
103
  };
@@ -2,5 +2,50 @@ declare const _default: {
2
2
  main: {
3
3
  title: string;
4
4
  };
5
+ debug: {
6
+ panelTitle: string;
7
+ logLevel: string;
8
+ shadows: string;
9
+ animations: string;
10
+ fps: string;
11
+ interactionsDisabled: string;
12
+ interactionsHint: string;
13
+ language: string;
14
+ reset: string;
15
+ close: string;
16
+ triggerTitle: string;
17
+ triggerMessage: string;
18
+ triggerConfirm: string;
19
+ triggerCancel: string;
20
+ logLevels: {
21
+ none: string;
22
+ operatingOnly: string;
23
+ error: string;
24
+ warn: string;
25
+ info: string;
26
+ log: string;
27
+ operating: string;
28
+ };
29
+ fpsModes: {
30
+ auto: string;
31
+ };
32
+ locales: {
33
+ zhCn: string;
34
+ en: string;
35
+ };
36
+ };
37
+ perf: {
38
+ title: string;
39
+ status: string;
40
+ statusConnected: string;
41
+ statusDisconnected: string;
42
+ sessionStart: string;
43
+ uptime: string;
44
+ websocketTraffic: string;
45
+ messages: string;
46
+ panelButton: string;
47
+ fps: string;
48
+ cpu: string;
49
+ };
5
50
  };
6
51
  export default _default;