@jnrs/lingshu-smart 2.2.47 → 3.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 (64) hide show
  1. package/AGENTS.md +281 -348
  2. package/dist/components/debug/DataLogPanel.vue.d.ts +13 -2
  3. package/dist/components/debug/PerformanceStats.vue.d.ts +1 -1
  4. package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +1 -1
  5. package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +4 -2
  6. package/dist/components/debug/ScriptRunner/index.vue.d.ts +11 -0
  7. package/dist/components/debug/ScriptRunner/script.d.ts +131 -41
  8. package/dist/components/debug/ScriptRunner/scriptFile.d.ts +92 -0
  9. package/dist/components/debug/WsProxy/index.vue.d.ts +10 -8
  10. package/dist/components/debug/WsProxy/proxy.d.ts +114 -53
  11. package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +18 -2
  12. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +2 -2
  13. package/dist/components/editor/ControlBar/PersistDialog.vue.d.ts +9 -0
  14. package/dist/components/index.js +8287 -6169
  15. package/dist/components/preview/index.vue.d.ts +6308 -4098
  16. package/dist/controller/AppController.d.ts +65 -3
  17. package/dist/controller/SocketDispatcher.d.ts +59 -0
  18. package/dist/fullscreen-BA3oea8O.js +53 -0
  19. package/dist/index-C6Liz-8o.js +1238 -0
  20. package/dist/index.js +36 -27
  21. package/dist/lingshu-smart/cases.json +5882 -14843
  22. package/dist/lingshu-smart/mockSocket.json +263 -0
  23. package/dist/lingshu-smart/wsProxyConfig.json +327 -725
  24. package/dist/playground/ViewPageDemo.vue.d.ts +13336 -8894
  25. package/dist/stores/index.js +1 -1
  26. package/dist/stores/useAppStore.d.ts +18952 -12321
  27. package/dist/stores/useDataStore.d.ts +19714 -12469
  28. package/dist/stores/useDebugStore.d.ts +11 -2
  29. package/dist/stores/useEditorStore.d.ts +3 -3
  30. package/dist/types/app.types.d.ts +1 -1
  31. package/dist/types/components/config.types.d.ts +16 -0
  32. package/dist/types/components/operating.types.d.ts +22 -13
  33. package/dist/types/enums.d.ts +22 -2
  34. package/dist/types/guards.d.ts +1 -0
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/models/config.types.d.ts +23 -5
  37. package/dist/types/models/operating.types.d.ts +57 -57
  38. package/dist/types/socket.types.d.ts +275 -0
  39. package/dist/ui/abstract/ModelAbs.d.ts +37 -2
  40. package/dist/ui/components/Resource.d.ts +0 -1
  41. package/dist/ui/components/StationSlot.d.ts +8 -2
  42. package/dist/ui/components/StationSlotGroup.d.ts +26 -1
  43. package/dist/ui/models/DoubleJointRobot.d.ts +14 -4
  44. package/dist/ui/models/MachineTool.d.ts +6 -1
  45. package/dist/ui/models/MaterialTrack.d.ts +14 -2
  46. package/dist/ui/models/Pallet.d.ts +20 -5
  47. package/dist/ui/models/ResourceOperationWindow.d.ts +0 -1
  48. package/dist/ui/models/ResourceStore.d.ts +7 -5
  49. package/dist/ui/models/Rgv.d.ts +4 -2
  50. package/dist/ui/models/ShuttleStation.d.ts +14 -2
  51. package/dist/ui/models/SingleJointRobot.d.ts +14 -4
  52. package/dist/ui/utils/resolveStationSlotLayers.d.ts +20 -0
  53. package/dist/ui/utils/resolveTypeStyle.d.ts +13 -0
  54. package/dist/useAppStore-DASwAOBy.js +7223 -0
  55. package/dist/utils/fullscreen.d.ts +9 -0
  56. package/dist/utils/index.d.ts +1 -0
  57. package/dist/vite.d.ts +15 -0
  58. package/dist/vite.js +39 -0
  59. package/package.json +6 -2
  60. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupBoth.vue.d.ts +0 -2
  61. package/dist/guards-Bi8oNtaY.js +0 -35
  62. package/dist/index-Dsgrnpn0.js +0 -1186
  63. package/dist/useAppStore-CevWqcmT.js +0 -6147
  64. /package/dist/components/editor/OptionCard/Equipment/{stationSlot/StationSlotGroup.vue.d.ts → models/ResourceStore.vue.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @File : fullscreen.ts
3
+ * @Desc. : 全屏切换 Composable(编辑器 / 预览看板共用)
4
+ * 监听 fullscreenchange 同步全屏状态:Esc 退出全屏等浏览器行为也能更新 isFullscreen
5
+ */
6
+ export declare const useFullscreen: () => {
7
+ isFullscreen: import('vue').Ref<boolean, boolean>;
8
+ toggleFullscreen: () => void;
9
+ };
@@ -1,6 +1,7 @@
1
1
  import { IScene } from '../types';
2
2
  export * from './logger';
3
3
  export * from './caseCompact';
4
+ export * from './fullscreen';
4
5
  /**
5
6
  * 数字生成器
6
7
  * @param {*} start 起始值
package/dist/vite.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { Plugin } from 'vite';
2
+ /**
3
+ * 方案 / 脚本烧录插件(仅开发服务器):
4
+ * - POST /lingshu-smart/__burn-cases → 写入宿主工程 public/lingshu-smart/cases.json(方案列表 ICase[])
5
+ * - POST /lingshu-smart/__burn-mock-socket → 写入宿主工程 public/lingshu-smart/mockSocket.json(脚本列表 ScriptStep[])
6
+ *
7
+ * 路径均以宿主 vite 进程工作目录为工程根。
8
+ * 用法:宿主 vite.config.ts 中注册 `plugins: [lingshuBurnCasesPlugin()]`。
9
+ * 请求体:纯数组(无响应头包装);响应:{ code: 0 } 或 { code: 4xx/500, msg: 错误信息 }。
10
+ * 分别与编辑器「保存方案」弹窗的「烧录进 cases.json」、脚本模拟器的「烧录」按钮配套使用。
11
+ *
12
+ * 注意:connect 中间件按**路径前缀**匹配,故两个路由前缀不可互相包含
13
+ * (如 `__burn-cases-scripts` 会被 cases 处理器抢先命中)。
14
+ */
15
+ export declare function lingshuBurnCasesPlugin(): Plugin;
package/dist/vite.js ADDED
@@ -0,0 +1,39 @@
1
+ import c from "node:fs";
2
+ import u from "node:path";
3
+ function p() {
4
+ const o = (e, a) => (s, t) => {
5
+ if (s.method !== "POST") {
6
+ t.statusCode = 405, t.end();
7
+ return;
8
+ }
9
+ let r = "";
10
+ s.on("data", (n) => r += n), s.on("end", () => {
11
+ try {
12
+ const n = JSON.parse(r);
13
+ if (!Array.isArray(n)) {
14
+ t.statusCode = 400, t.setHeader("Content-Type", "application/json"), t.end(JSON.stringify({ code: 400, msg: a }));
15
+ return;
16
+ }
17
+ const i = u.resolve(process.cwd(), e);
18
+ c.writeFileSync(i, JSON.stringify(n, null, 2), "utf-8"), t.setHeader("Content-Type", "application/json"), t.end(JSON.stringify({ code: 0 }));
19
+ } catch (n) {
20
+ t.statusCode = 500, t.setHeader("Content-Type", "application/json"), t.end(JSON.stringify({ code: 500, msg: String(n) }));
21
+ }
22
+ });
23
+ };
24
+ return {
25
+ name: "lingshu-burn-cases",
26
+ configureServer(e) {
27
+ e.middlewares.use(
28
+ "/lingshu-smart/__burn-cases",
29
+ o("public/lingshu-smart/cases.json", "请求体应为方案列表数组(ICase[])")
30
+ ), e.middlewares.use(
31
+ "/lingshu-smart/__burn-mock-socket",
32
+ o("public/lingshu-smart/mockSocket.json", "请求体应为脚本列表数组(ScriptStep[])")
33
+ );
34
+ }
35
+ };
36
+ }
37
+ export {
38
+ p as lingshuBurnCasesPlugin
39
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/lingshu-smart",
3
- "version": "2.2.47",
3
+ "version": "3.0.0",
4
4
  "description": "LingShu Smart 2D Digital Twin System.",
5
5
  "keywords": [
6
6
  "jnrs",
@@ -42,6 +42,10 @@
42
42
  "./stores": {
43
43
  "import": "./dist/stores/index.js",
44
44
  "types": "./dist/stores/index.d.ts"
45
+ },
46
+ "./vite": {
47
+ "import": "./dist/vite.js",
48
+ "types": "./dist/vite.d.ts"
45
49
  }
46
50
  },
47
51
  "peerDependencies": {
@@ -52,7 +56,7 @@
52
56
  "pinia-plugin-persistedstate": "^4.7.1",
53
57
  "vue": "^3.5.22",
54
58
  "vue-i18n": "^9.14.5",
55
- "@jnrs/shared": "1.1.40"
59
+ "@jnrs/shared": "1.1.41"
56
60
  },
57
61
  "devDependencies": {
58
62
  "@types/lodash-es": "^4.17.12",
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,35 +0,0 @@
1
- import { b as a } from "./index-Dsgrnpn0.js";
2
- function t(s) {
3
- return s?.className === a.MACHINE_TOOL;
4
- }
5
- function n(s) {
6
- return s?.className === a.MACHINE_TOOL || s?.className === a.MARKING_MACHINE || s?.className === a.CLEANING_MACHINE || s?.className === a.LOADING_STATION || s?.className === a.RESOURCE_OPERATION_WINDOW;
7
- }
8
- function c(s) {
9
- return s?.className === a.RESOURCE_STORE || s?.className === a.SINGLE_JOINT_ROBOT || s?.className === a.DOUBLE_JOINT_ROBOT || s?.className === a.RGV;
10
- }
11
- function O(s) {
12
- return s?.className === a.SHUTTLE_STATION || s?.className === a.MATERIAL_TRACK || s?.className === a.PALLET;
13
- }
14
- function T(s) {
15
- return s?.className === a.SINGLE_JOINT_ROBOT || s?.className === a.DOUBLE_JOINT_ROBOT;
16
- }
17
- function e(s) {
18
- return s?.className === a.RAIL;
19
- }
20
- function o(s) {
21
- return s?.className === a.SHUTTLE_STATION;
22
- }
23
- function i(s) {
24
- return s?.className === a.PALLET;
25
- }
26
- export {
27
- c as a,
28
- O as b,
29
- T as c,
30
- e as d,
31
- o as e,
32
- i as f,
33
- n as h,
34
- t as i
35
- };