react-big-screen 0.0.2 → 0.0.3

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 (44) hide show
  1. package/README.md +47 -0
  2. package/es/{attributes-DZxC4B37.mjs → attributes-9JJnMyOM.mjs} +1 -1
  3. package/es/{attributes-DieePkzV.mjs → attributes-B0TGeGwd.mjs} +1 -1
  4. package/es/{attributes-LoqmZojB.mjs → attributes-BYa3Kx6D.mjs} +1 -1
  5. package/es/{attributes-C4LeY1BZ.mjs → attributes-C1Er2mU2.mjs} +1 -1
  6. package/es/{attributes-CE73rly0.mjs → attributes-CjTTwDCD.mjs} +1 -1
  7. package/es/{attributes-CSKP7npu.mjs → attributes-DD_Hogjd.mjs} +1 -1
  8. package/es/{attributes-D_stokyh.mjs → attributes-D_kdeVdD.mjs} +1 -1
  9. package/es/{attributes-ue-CmjAw.mjs → attributes-DlWyA2om.mjs} +1 -1
  10. package/es/{attributes-Bd6bjYNO.mjs → attributes-DprEERBw.mjs} +2 -2
  11. package/es/{attributes-BwCVvyg1.mjs → attributes-DqJGC0Ag.mjs} +1 -1
  12. package/es/{attributes-BPfIEMhu.mjs → attributes-NyWPJ3_p.mjs} +1 -1
  13. package/es/{attributes-Ca3YwNp_.mjs → attributes-yntL0BJM.mjs} +1 -1
  14. package/es/{index-Bz8aOQKt.mjs → index-BFgfDn8P.mjs} +3 -3
  15. package/es/{index-Ch7bAVMa.mjs → index-BLkx_Jpg.mjs} +2 -2
  16. package/es/{index-NIXnXIfG.mjs → index-BRCJpbOA.mjs} +2 -2
  17. package/es/{index-COR9xxjJ.mjs → index-BUoMt_pm.mjs} +2 -2
  18. package/es/{index-EkKLbWrX.mjs → index-BVm2ihs2.mjs} +67 -59
  19. package/es/{index-Bx44D9HL.mjs → index-BsZJ5Qtx.mjs} +12 -12
  20. package/es/{index-5L7Vf29E.mjs → index-BvJsCGUq.mjs} +2 -2
  21. package/es/{index-CWaDu7tv.mjs → index-BvMSWX7-.mjs} +2 -2
  22. package/es/{index-oRp9BKd0.mjs → index-C9x-zwVC.mjs} +28 -28
  23. package/es/{index-dvGAMCvV.mjs → index-CGPWZMnx.mjs} +2 -2
  24. package/es/{index-B00lQcU7.mjs → index-CPJZOGYB.mjs} +2 -2
  25. package/es/{index-BUdNXLkt.mjs → index-CPeT0oeP.mjs} +3 -3
  26. package/es/{index-BSb4qVX4.mjs → index-CRv8sS9n.mjs} +2 -2
  27. package/es/{index-DzGMaMlo.mjs → index-CaDgVbYl.mjs} +1 -1
  28. package/es/{index-CNVmSNi4.mjs → index-Co9UFyo-.mjs} +2 -2
  29. package/es/{index-7ZW-SCwo.mjs → index-Cp1LVlIc.mjs} +2 -2
  30. package/es/{index-Gk3zSHHS.mjs → index-CtW8_7m2.mjs} +2 -2
  31. package/es/{index-BE6SbJah.mjs → index-D-MRie5y.mjs} +1 -1
  32. package/es/{index-syzd3ScW.mjs → index-DCC5Ubca.mjs} +2 -2
  33. package/es/{index-NDbr0gtf.mjs → index-DCssRFM_.mjs} +2 -2
  34. package/es/{index-BH8sNWnz.mjs → index-DKoIcrH8.mjs} +2 -2
  35. package/es/{index-BXv4ZOBe.mjs → index-IPshmTia.mjs} +3 -3
  36. package/es/{index-D2MkDARx.mjs → index-eNxsu4gw.mjs} +2 -2
  37. package/es/{index-Bf6X5Fsf.mjs → index-om-B_yMg.mjs} +3 -3
  38. package/es/{index-WI440ion.mjs → index-qx54Fc2k.mjs} +2 -2
  39. package/es/{index-BFdbTW64.mjs → index-zQJneiJO.mjs} +2 -2
  40. package/es/index.mjs +1 -1
  41. package/es/{selectPage-BQkRPT-9.mjs → selectPage-BV06fhR-.mjs} +1 -1
  42. package/es/{useCurrentPageId-DrIZvYrl.mjs → useCurrentPageId-7D7A4sjF.mjs} +1 -1
  43. package/package.json +3 -3
  44. package/types/src/export/index.d.ts +7 -1
package/README.md CHANGED
@@ -36,6 +36,53 @@ react-big-screen 是一个使用React开发的`前端可拖拽大屏`开源项
36
36
  - [点击访问:多组件联动](https://tangjiahui-cn.github.io/react-big-screen/#/create?example=multiple-components-interactive)
37
37
 
38
38
  ## 快速开始
39
+
40
+ 注:仅支持node版本20+、react版本18+
41
+
42
+ ```shell
43
+ pnpm install react-big-screen
44
+ ```
45
+
46
+ ```tsx
47
+ // index.tsx
48
+ import { EXAMPLE, RbsEngine } from "react-big-screen";
49
+ import * as React from "react";
50
+ import "antd/dist/antd.min.css";
51
+ import "react-big-screen/es/style.css";
52
+
53
+ export default () => {
54
+ const domRef = React.useRef<HTMLDivElement>(null);
55
+
56
+ React.useEffect(() => {
57
+ const engine = new RbsEngine();
58
+
59
+ // 挂载到DOM
60
+ engine.mount(domRef.current!).then(() => {
61
+ // 挂载成功后,导入JSON文件
62
+ engine.importJSON(EXAMPLE.classic);
63
+ });
64
+
65
+ // 销毁
66
+ return () => {
67
+ engine.destroy()
68
+ };
69
+ }, []);
70
+
71
+ return (
72
+ <div
73
+ ref={domRef}
74
+ style={{
75
+ width: "100vw",
76
+ height: "100vh",
77
+ position: "fixed",
78
+ overflow: "hidden",
79
+ }}
80
+ />
81
+ );
82
+ };
83
+ ```
84
+
85
+ ## 本地调试
39
86
  本地启动一个项目,用以调试或者开发功能。
40
87
  ```shell
41
88
  # 拉取代码
@@ -1,4 +1,4 @@
1
- import { o } from "./index-EkKLbWrX.mjs";
1
+ import { o } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { o as n } from "./index-EkKLbWrX.mjs";
2
+ import { o as n } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,4 +1,4 @@
1
- import { o as t } from "./index-EkKLbWrX.mjs";
1
+ import { o as t } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { o as r } from "./index-EkKLbWrX.mjs";
2
+ import { o as r } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,4 +1,4 @@
1
- import { o as t } from "./index-EkKLbWrX.mjs";
1
+ import { o as t } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { o as r } from "./index-EkKLbWrX.mjs";
2
+ import { o as r } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { o as t } from "./index-EkKLbWrX.mjs";
2
+ import { o as t } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs as y, jsx as d } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { i as k, c as I, o as L } from "./index-EkKLbWrX.mjs";
2
+ import { i as k, c as I, o as L } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import { useRef as S, useMemo as H } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,12 +1,12 @@
1
1
  import { jsx as e } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { o as t } from "./index-EkKLbWrX.mjs";
2
+ import { o as t } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
6
6
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js";
7
7
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.js.mjs";
8
8
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.css";
9
- import { I as b } from "./index-DzGMaMlo.mjs";
9
+ import { I as b } from "./index-CaDgVbYl.mjs";
10
10
  const g = {
11
11
  id: "clock.png"
12
12
  }, s = t(
@@ -1,4 +1,4 @@
1
- import { o as e } from "./index-EkKLbWrX.mjs";
1
+ import { o as e } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import { useMemo as n } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,4 +1,4 @@
1
- import { o as e } from "./index-EkKLbWrX.mjs";
1
+ import { o as e } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,4 +1,4 @@
1
- import { o as e } from "./index-EkKLbWrX.mjs";
1
+ import { o as e } from "./index-BVm2ihs2.mjs";
2
2
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -1,13 +1,13 @@
1
1
  import { jsx as c } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { R as u } from "./index-BE6SbJah.mjs";
3
- import { n as f } from "./index-EkKLbWrX.mjs";
2
+ import { R as u } from "./index-D-MRie5y.mjs";
3
+ import { n as f } from "./index-BVm2ihs2.mjs";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
5
5
  import { useMemo as g } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
6
6
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
7
7
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js";
8
8
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.js.mjs";
9
9
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.css";
10
- import { DEFAULT_OPTIONS as l } from "./attributes-ue-CmjAw.mjs";
10
+ import { DEFAULT_OPTIONS as l } from "./attributes-DlWyA2om.mjs";
11
11
  function p(m = "name", a, n) {
12
12
  return !(a != null && a.length) || !(n != null && n.length) ? {
13
13
  source: []
@@ -1,12 +1,12 @@
1
1
  import { jsx as f } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { n as l } from "./index-EkKLbWrX.mjs";
2
+ import { n as l } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import { useRef as c, useEffect as a } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
6
6
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js";
7
7
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.js.mjs";
8
8
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.css";
9
- import { DEFAULT_OPTIONS as u } from "./attributes-BPfIEMhu.mjs";
9
+ import { DEFAULT_OPTIONS as u } from "./attributes-NyWPJ3_p.mjs";
10
10
  import d from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js";
11
11
  const D = l((m) => {
12
12
  const { width: i, height: n, options: e } = m, r = c(null);
@@ -1,5 +1,5 @@
1
1
  import { jsx as c } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
- import { n as b } from "./index-EkKLbWrX.mjs";
2
+ import { n as b } from "./index-BVm2ihs2.mjs";
3
3
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
4
4
  import { useState as u, useMemo as x } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
@@ -8,7 +8,7 @@ import { r as f, g as y } from "./random-DD0zMfMm.mjs";
8
8
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.js.mjs";
9
9
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.css";
10
10
  import { u as d } from "./useEffectOnce-DrBvWFlm.mjs";
11
- import { R as h } from "./index-BE6SbJah.mjs";
11
+ import { R as h } from "./index-D-MRie5y.mjs";
12
12
  const g = ["06-01", "06-02", "06-03", "06-04", "06-05", "06-06", "06-07"], r = 250, a = [210, 200, 195, 200, 202, 195, 180], N = b((i) => {
13
13
  const { width: n, height: s } = i, [e, l] = u(a), m = x(() => {
14
14
  const o = e.map((t) => t * 100 / r);
@@ -1,13 +1,13 @@
1
1
  import { jsx as o } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
2
2
  import { Image as i } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/antd@4.24.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/index.js";
3
- import { n as p } from "./index-EkKLbWrX.mjs";
3
+ import { n as p } from "./index-BVm2ihs2.mjs";
4
4
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
5
5
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
6
6
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
7
7
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js";
8
8
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.js.mjs";
9
9
  import "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/driver.js@1.3.6/node_modules/driver.js/dist/driver.css";
10
- import { DEFAULT_OPTIONS as n } from "./attributes-CE73rly0.mjs";
10
+ import { DEFAULT_OPTIONS as n } from "./attributes-CjTTwDCD.mjs";
11
11
  const g = p((e) => {
12
12
  const { options: r, width: t, height: m } = e;
13
13
  return /* @__PURE__ */ o(
@@ -4,7 +4,7 @@ var u = (r, e, t) => Qe(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { jsx as d, jsxs as C, Fragment as et } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
5
5
  import { create as tt } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/zustand@5.0.8_@types+react@18.3.26_react@18.3.1/node_modules/zustand/esm/index.mjs";
6
6
  import re from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js";
7
- import c, { createContext as at, useRef as R, useCallback as nt, useMemo as G, isValidElement as it, useEffect as V, useContext as rt, useState as x, forwardRef as ot, useImperativeHandle as lt } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
7
+ import c, { createContext as at, useRef as R, useCallback as nt, useMemo as G, isValidElement as it, useEffect as J, useContext as rt, useState as x, forwardRef as ot, useImperativeHandle as lt } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
8
8
  import st from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/index.js";
9
9
  import ct, { createRoot as ue } from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js";
10
10
  import * as dt from "/Users/tangjiahui/Desktop/big-screen-demo/node_modules/.pnpm/antd@4.24.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/index.js";
@@ -38,7 +38,7 @@ function w(r) {
38
38
  function z() {
39
39
  return ve.getState();
40
40
  }
41
- const J = "未命名文件.txt";
41
+ const V = "未命名文件.txt";
42
42
  async function _e(r) {
43
43
  return new Promise((e) => {
44
44
  fetch(r).then(async (t) => {
@@ -49,18 +49,18 @@ async function _e(r) {
49
49
  });
50
50
  });
51
51
  }
52
- function xn(r = "", e = J) {
52
+ function xn(r = "", e = V) {
53
53
  _e(r).then((t) => {
54
54
  kt(t, e);
55
55
  });
56
56
  }
57
- function kt(r = "", e = J) {
57
+ function kt(r = "", e = V) {
58
58
  const t = new Blob([r], {
59
59
  type: "text/plain;charset=utf-8"
60
60
  });
61
61
  Tt(t, e);
62
62
  }
63
- function Tt(r = new Blob([""]), e = J) {
63
+ function Tt(r = new Blob([""]), e = V) {
64
64
  const t = document.createElement("a"), a = URL.createObjectURL(r);
65
65
  t.style.display = "none", t.download = e, t.href = a, t.click(), setTimeout(() => {
66
66
  URL.revokeObjectURL(a);
@@ -540,7 +540,7 @@ const Ot = "_configRender_wy2nc_59", Dt = "_configRender_item_wy2nc_65", Rt = "_
540
540
  function se() {
541
541
  return rt(Ie);
542
542
  }
543
- import("./index-B00lQcU7.mjs").then((r) => {
543
+ import("./index-CPJZOGYB.mjs").then((r) => {
544
544
  var e;
545
545
  (e = r.default) == null || e.call(r);
546
546
  });
@@ -602,7 +602,7 @@ function Se(r) {
602
602
  }
603
603
  );
604
604
  }, [e]);
605
- return V(() => {
605
+ return J(() => {
606
606
  t.setFieldsValue({
607
607
  ...n(),
608
608
  ...r == null ? void 0 : r.value
@@ -1131,7 +1131,7 @@ class Gt {
1131
1131
  return this.getConfig().currentPageId || S.id;
1132
1132
  }
1133
1133
  }
1134
- class Vt {
1134
+ class Jt {
1135
1135
  constructor() {
1136
1136
  u(this, "favorites", []);
1137
1137
  u(this, "listeners", []);
@@ -1188,7 +1188,7 @@ const j = {
1188
1188
  value: "一段文字",
1189
1189
  fontSize: 14,
1190
1190
  lineHeight: 32
1191
- }, Jt = A(
1191
+ }, Vt = A(
1192
1192
  [
1193
1193
  { key: "value", label: "内容", component: "textarea" },
1194
1194
  { key: "fontSize", label: "字号", component: "inputNumber", options: { min: 8 } },
@@ -1223,7 +1223,7 @@ const j = {
1223
1223
  ), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1224
1224
  __proto__: null,
1225
1225
  DEFAULT_OPTIONS: j,
1226
- default: Jt
1226
+ default: Vt
1227
1227
  }, Symbol.toStringTag, { value: "Module" })), Ce = [{ label: "点击事件", value: "onClick" }], ke = [{ label: "更新文本", value: "setText" }], qt = T((r) => {
1228
1228
  const { options: e, width: t, height: a, useExpose: n, handleTrigger: i } = r, [o, l] = x();
1229
1229
  return n({
@@ -1475,8 +1475,8 @@ const j = {
1475
1475
  y: 0,
1476
1476
  width: 500,
1477
1477
  height: 300,
1478
- component: c.lazy(() => import("./index-BFdbTW64.mjs")),
1479
- attributesComponent: c.lazy(() => import("./attributes-DZxC4B37.mjs"))
1478
+ component: c.lazy(() => import("./index-zQJneiJO.mjs")),
1479
+ attributesComponent: c.lazy(() => import("./attributes-9JJnMyOM.mjs"))
1480
1480
  },
1481
1481
  {
1482
1482
  cId: "image",
@@ -1487,8 +1487,8 @@ const j = {
1487
1487
  y: 0,
1488
1488
  width: 270,
1489
1489
  height: 150,
1490
- component: c.lazy(() => import("./index-COR9xxjJ.mjs")),
1491
- attributesComponent: c.lazy(() => import("./attributes-CE73rly0.mjs"))
1490
+ component: c.lazy(() => import("./index-BUoMt_pm.mjs")),
1491
+ attributesComponent: c.lazy(() => import("./attributes-CjTTwDCD.mjs"))
1492
1492
  },
1493
1493
  {
1494
1494
  cId: "dateDisplay",
@@ -1499,8 +1499,8 @@ const j = {
1499
1499
  y: 0,
1500
1500
  width: 250,
1501
1501
  height: 26,
1502
- component: c.lazy(() => import("./index-Ch7bAVMa.mjs")),
1503
- attributesComponent: c.lazy(() => import("./attributes-BPfIEMhu.mjs"))
1502
+ component: c.lazy(() => import("./index-BLkx_Jpg.mjs")),
1503
+ attributesComponent: c.lazy(() => import("./attributes-NyWPJ3_p.mjs"))
1504
1504
  },
1505
1505
  {
1506
1506
  cId: "doubleText",
@@ -1511,8 +1511,8 @@ const j = {
1511
1511
  y: 0,
1512
1512
  width: 120,
1513
1513
  height: 64,
1514
- component: c.lazy(() => import("./index-5L7Vf29E.mjs")),
1515
- attributesComponent: c.lazy(() => import("./attributes-DieePkzV.mjs"))
1514
+ component: c.lazy(() => import("./index-BvJsCGUq.mjs")),
1515
+ attributesComponent: c.lazy(() => import("./attributes-B0TGeGwd.mjs"))
1516
1516
  }
1517
1517
  ], da = "_carousel_1b8a0_59", ua = "_carousel_bordered_1b8a0_62", ce = {
1518
1518
  carousel: da,
@@ -1665,7 +1665,7 @@ function Ca(r) {
1665
1665
  }
1666
1666
  function ka() {
1667
1667
  const r = R();
1668
- return V(() => () => {
1668
+ return J(() => () => {
1669
1669
  var e;
1670
1670
  (e = r.current) == null || e.forEach((t) => t == null ? void 0 : t()), r.current = void 0;
1671
1671
  }, []), G(() => function(e) {
@@ -1834,7 +1834,7 @@ const Me = [
1834
1834
  e.componentNode.hidePanel(s.current), s.current = p, e.componentNode.showPanel(p);
1835
1835
  }));
1836
1836
  }
1837
- return V(() => {
1837
+ return J(() => {
1838
1838
  var p, f;
1839
1839
  const y = (f = (p = i.panels) == null ? void 0 : p.findIndex) == null ? void 0 : f.call(p, (_) => (_ == null ? void 0 : _.value) === (i == null ? void 0 : i.currentPanelId));
1840
1840
  y !== void 0 && v(y);
@@ -1898,8 +1898,8 @@ const Me = [
1898
1898
  y: 0,
1899
1899
  width: 400,
1900
1900
  height: 300,
1901
- component: c.lazy(() => import("./index-7ZW-SCwo.mjs")),
1902
- attributesComponent: c.lazy(() => import("./attributes-BwCVvyg1.mjs")),
1901
+ component: c.lazy(() => import("./index-Cp1LVlIc.mjs")),
1902
+ attributesComponent: c.lazy(() => import("./attributes-DqJGC0Ag.mjs")),
1903
1903
  icon: () => import("./specialCard-jikYSVVg.mjs"),
1904
1904
  panels: [{ label: "特殊卡片", value: "" }]
1905
1905
  }
@@ -1913,7 +1913,7 @@ const Me = [
1913
1913
  y: 0,
1914
1914
  width: 250,
1915
1915
  height: 250,
1916
- component: c.lazy(() => import("./index-D2MkDARx.mjs"))
1916
+ component: c.lazy(() => import("./index-eNxsu4gw.mjs"))
1917
1917
  },
1918
1918
  {
1919
1919
  cId: "line",
@@ -1924,8 +1924,8 @@ const Me = [
1924
1924
  y: 0,
1925
1925
  width: 250,
1926
1926
  height: 250,
1927
- component: c.lazy(() => import("./index-Bz8aOQKt.mjs")),
1928
- attributesComponent: c.lazy(() => import("./attributes-ue-CmjAw.mjs")),
1927
+ component: c.lazy(() => import("./index-BFgfDn8P.mjs")),
1928
+ attributesComponent: c.lazy(() => import("./attributes-DlWyA2om.mjs")),
1929
1929
  dataSourceType: "static",
1930
1930
  staticDataSource: [
1931
1931
  { name: "选项一", value1: 100, value2: 200, value3: 300 },
@@ -1942,7 +1942,7 @@ const Me = [
1942
1942
  y: 0,
1943
1943
  width: 250,
1944
1944
  height: 250,
1945
- component: c.lazy(() => import("./index-BH8sNWnz.mjs"))
1945
+ component: c.lazy(() => import("./index-DKoIcrH8.mjs"))
1946
1946
  },
1947
1947
  {
1948
1948
  cId: "radar",
@@ -1954,7 +1954,7 @@ const Me = [
1954
1954
  width: 350,
1955
1955
  height: 300,
1956
1956
  options: {},
1957
- component: c.lazy(() => import("./index-CNVmSNi4.mjs"))
1957
+ component: c.lazy(() => import("./index-Co9UFyo-.mjs"))
1958
1958
  },
1959
1959
  {
1960
1960
  cId: "gauge",
@@ -1966,7 +1966,7 @@ const Me = [
1966
1966
  width: 350,
1967
1967
  height: 300,
1968
1968
  options: {},
1969
- component: c.lazy(() => import("./index-Gk3zSHHS.mjs"))
1969
+ component: c.lazy(() => import("./index-CtW8_7m2.mjs"))
1970
1970
  },
1971
1971
  {
1972
1972
  cId: "horizontalBar",
@@ -1978,7 +1978,7 @@ const Me = [
1978
1978
  width: 350,
1979
1979
  height: 300,
1980
1980
  options: {},
1981
- component: c.lazy(() => import("./index-dvGAMCvV.mjs"))
1981
+ component: c.lazy(() => import("./index-CGPWZMnx.mjs"))
1982
1982
  },
1983
1983
  {
1984
1984
  cId: "barLine",
@@ -1990,7 +1990,7 @@ const Me = [
1990
1990
  width: 350,
1991
1991
  height: 300,
1992
1992
  options: {},
1993
- component: c.lazy(() => import("./index-NIXnXIfG.mjs"))
1993
+ component: c.lazy(() => import("./index-BRCJpbOA.mjs"))
1994
1994
  },
1995
1995
  {
1996
1996
  cId: "ring",
@@ -2002,8 +2002,8 @@ const Me = [
2002
2002
  width: 350,
2003
2003
  height: 300,
2004
2004
  options: {},
2005
- component: c.lazy(() => import("./index-Bf6X5Fsf.mjs")),
2006
- attributesComponent: c.lazy(() => import("./attributes-LoqmZojB.mjs"))
2005
+ component: c.lazy(() => import("./index-om-B_yMg.mjs")),
2006
+ attributesComponent: c.lazy(() => import("./attributes-BYa3Kx6D.mjs"))
2007
2007
  }
2008
2008
  ], Fa = [
2009
2009
  {
@@ -2017,7 +2017,7 @@ const Me = [
2017
2017
  width: 300,
2018
2018
  height: 32,
2019
2019
  isAllPage: !0,
2020
- component: c.lazy(() => import("./index-BXv4ZOBe.mjs"))
2020
+ component: c.lazy(() => import("./index-IPshmTia.mjs"))
2021
2021
  }
2022
2022
  ];
2023
2023
  async function Ha(r, e = 300) {
@@ -2137,11 +2137,11 @@ const wn = ot(
2137
2137
  pagination: !1
2138
2138
  }
2139
2139
  );
2140
- }), Va = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2140
+ }), Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2141
2141
  __proto__: null,
2142
2142
  default: Ga,
2143
2143
  peopleExposes: Oe
2144
- }, Symbol.toStringTag, { value: "Module" })), Ja = [
2144
+ }, Symbol.toStringTag, { value: "Module" })), Va = [
2145
2145
  {
2146
2146
  cId: "peopleTable",
2147
2147
  cName: "人员表格",
@@ -2153,7 +2153,7 @@ const wn = ot(
2153
2153
  width: 600,
2154
2154
  height: 300,
2155
2155
  exposes: Oe,
2156
- component: c.lazy(() => Promise.resolve().then(() => Va))
2156
+ component: c.lazy(() => Promise.resolve().then(() => Ja))
2157
2157
  },
2158
2158
  {
2159
2159
  cId: "chinaMap",
@@ -2165,8 +2165,8 @@ const wn = ot(
2165
2165
  y: 0,
2166
2166
  width: 500,
2167
2167
  height: 500,
2168
- component: c.lazy(() => import("./index-BUdNXLkt.mjs")),
2169
- attributesComponent: c.lazy(() => import("./attributes-C4LeY1BZ.mjs"))
2168
+ component: c.lazy(() => import("./index-CPeT0oeP.mjs")),
2169
+ attributesComponent: c.lazy(() => import("./attributes-C1Er2mU2.mjs"))
2170
2170
  },
2171
2171
  {
2172
2172
  cId: "scrollList",
@@ -2187,8 +2187,8 @@ const wn = ot(
2187
2187
  { key: "5", title: "培训项目二", status: "2" },
2188
2188
  { key: "6", title: "tjh项目", status: "1" }
2189
2189
  ],
2190
- component: c.lazy(() => import("./index-BSb4qVX4.mjs")),
2191
- attributesComponent: c.lazy(() => import("./attributes-D_stokyh.mjs"))
2190
+ component: c.lazy(() => import("./index-CRv8sS9n.mjs")),
2191
+ attributesComponent: c.lazy(() => import("./attributes-D_kdeVdD.mjs"))
2192
2192
  },
2193
2193
  {
2194
2194
  cId: "defaultImage",
@@ -2200,8 +2200,8 @@ const wn = ot(
2200
2200
  y: 0,
2201
2201
  width: 150,
2202
2202
  height: 150,
2203
- component: c.lazy(() => import("./index-CWaDu7tv.mjs")),
2204
- attributesComponent: c.lazy(() => import("./attributes-Bd6bjYNO.mjs"))
2203
+ component: c.lazy(() => import("./index-BvMSWX7-.mjs")),
2204
+ attributesComponent: c.lazy(() => import("./attributes-DprEERBw.mjs"))
2205
2205
  },
2206
2206
  {
2207
2207
  cId: "ProgressList",
@@ -2222,8 +2222,8 @@ const wn = ot(
2222
2222
  { key: "5", title: "培训项目二", count: 200 },
2223
2223
  { key: "6", title: "tjh项目", count: 0 }
2224
2224
  ],
2225
- component: c.lazy(() => import("./index-WI440ion.mjs")),
2226
- attributesComponent: c.lazy(() => import("./attributes-CSKP7npu.mjs"))
2225
+ component: c.lazy(() => import("./index-qx54Fc2k.mjs")),
2226
+ attributesComponent: c.lazy(() => import("./attributes-DD_Hogjd.mjs"))
2227
2227
  },
2228
2228
  {
2229
2229
  cId: "specialTitle",
@@ -2235,14 +2235,14 @@ const wn = ot(
2235
2235
  y: 0,
2236
2236
  width: 500,
2237
2237
  height: 32,
2238
- component: c.lazy(() => import("./index-syzd3ScW.mjs")),
2239
- attributesComponent: c.lazy(() => import("./attributes-Ca3YwNp_.mjs"))
2238
+ component: c.lazy(() => import("./index-DCC5Ubca.mjs")),
2239
+ attributesComponent: c.lazy(() => import("./attributes-yntL0BJM.mjs"))
2240
2240
  }
2241
2241
  ], ja = {
2242
2242
  id: "system",
2243
2243
  name: "默认组件包",
2244
2244
  origin: "system",
2245
- version: "0.0.2",
2245
+ version: "0.0.3",
2246
2246
  description: "由官方发布的组件库,随编辑器主版本迭代而更新。",
2247
2247
  components: [
2248
2248
  ...ca,
@@ -2253,7 +2253,7 @@ const wn = ot(
2253
2253
  // 图表组件
2254
2254
  ...Fa,
2255
2255
  // 导航组件
2256
- ...Ja
2256
+ ...Va
2257
2257
  // 其他组件
2258
2258
  ]
2259
2259
  };
@@ -2629,7 +2629,7 @@ class Qa {
2629
2629
  // 事件
2630
2630
  u(this, "events", new qa());
2631
2631
  // 收藏夹
2632
- u(this, "favorites", new Vt());
2632
+ u(this, "favorites", new Jt());
2633
2633
  // 子页面管理
2634
2634
  u(this, "page", new Ut());
2635
2635
  // 历史记录管理
@@ -3795,7 +3795,7 @@ const De = {
3795
3795
  pages: Ue,
3796
3796
  selectedIds: He,
3797
3797
  used: De
3798
- }, Symbol.toStringTag, { value: "Module" })), Ve = {
3798
+ }, Symbol.toStringTag, { value: "Module" })), Je = {
3799
3799
  peopleTable: {
3800
3800
  count: 1
3801
3801
  },
@@ -3808,7 +3808,7 @@ const De = {
3808
3808
  button: {
3809
3809
  count: 2
3810
3810
  }
3811
- }, Je = [
3811
+ }, Ve = [
3812
3812
  {
3813
3813
  cId: "peopleTable",
3814
3814
  cName: "人员表格",
@@ -4233,8 +4233,8 @@ function main(value, {origin, target, option}) {
4233
4233
  id: "58de04a398"
4234
4234
  }
4235
4235
  ], Ke = {
4236
- used: Ve,
4237
- componentNodes: Je,
4236
+ used: Je,
4237
+ componentNodes: Ve,
4238
4238
  config: je,
4239
4239
  selectedIds: qe,
4240
4240
  localPackages: We,
@@ -4242,18 +4242,18 @@ function main(value, {origin, target, option}) {
4242
4242
  pages: Ze
4243
4243
  }, Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4244
4244
  __proto__: null,
4245
- componentNodes: Je,
4245
+ componentNodes: Ve,
4246
4246
  config: je,
4247
4247
  default: Ke,
4248
4248
  favorites: Xe,
4249
4249
  localPackages: We,
4250
4250
  pages: Ze,
4251
4251
  selectedIds: qe,
4252
- used: Ve
4252
+ used: Je
4253
4253
  }, Symbol.toStringTag, { value: "Module" })), Pn = {
4254
4254
  classic: Ge,
4255
4255
  multiple_components_interactive: Ke
4256
- }, O = "_$_rbs_current_engine_$_", en = c.lazy(() => import("./index-Bx44D9HL.mjs")), tn = c.lazy(() => import("./index-oRp9BKd0.mjs"));
4256
+ }, O = "_$_rbs_current_engine_$_", en = c.lazy(() => import("./index-BsZJ5Qtx.mjs")), tn = c.lazy(() => import("./index-C9x-zwVC.mjs"));
4257
4257
  class zn {
4258
4258
  constructor(e) {
4259
4259
  /** react createApp */
@@ -4266,6 +4266,7 @@ class zn {
4266
4266
  u(this, "mode", "edit");
4267
4267
  /** 事件钩子 */
4268
4268
  u(this, "hooks", null);
4269
+ u(this, "lastJson");
4269
4270
  const { activeGlobal: t = !0, onStartPreview: a, dom: n, ...i } = e || {};
4270
4271
  this.engine = new Qa(i), n && this.mount(n), t && this.activeGlobal(), a && this.on("startPreview", a);
4271
4272
  }
@@ -4278,7 +4279,14 @@ class zn {
4278
4279
  console.error("RBS el has been mounted.");
4279
4280
  return;
4280
4281
  }
4281
- return this.el = e, this.importJSON();
4282
+ return this.el = e, this.importJSON(this.lastJson);
4283
+ }
4284
+ /**
4285
+ * 取消挂载dom
4286
+ * @description 与destroy的区别是会保留json的状态,重新挂载dom即可重新渲染。
4287
+ */
4288
+ async unmount() {
4289
+ this.app && (this.lastJson = await this.engine.getJSON(), this.app.unmount(), this.app = null, this.el = null);
4282
4290
  }
4283
4291
  /**
4284
4292
  * 监听事件
@@ -4316,8 +4324,8 @@ class zn {
4316
4324
  /**
4317
4325
  * 销毁
4318
4326
  */
4319
- destroy() {
4320
- this.unActiveGlobal(), this.app && (this.app.unmount(), this.app = null), this.engine.destroy(), this.hooks = null;
4327
+ async destroy() {
4328
+ this.unActiveGlobal(), await this.unmount(), this.engine.destroy(), this.hooks = null, this.lastJson = void 0;
4321
4329
  }
4322
4330
  /**
4323
4331
  * 导入JSONString(会触发渲染)