sun-card-design 1.1.37 → 1.1.39

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 (162) hide show
  1. package/README.md +114 -112
  2. package/dist/mobile/sun-card-design-mobile.es11.js +3 -3
  3. package/dist/mobile/sun-card-design-mobile.es3.js +4 -4
  4. package/dist/mobile/sun-card-design-mobile.es4.js +5 -5
  5. package/dist/mobile/sun-card-design-mobile.es56.js +3 -4
  6. package/dist/mobile/sun-card-design-mobile.es6.js +2 -10
  7. package/dist/pc/sun-card-design-pc.es11.js +3 -3
  8. package/dist/pc/sun-card-design-pc.es3.js +4 -4
  9. package/dist/pc/sun-card-design-pc.es4.js +5 -5
  10. package/dist/pc/sun-card-design-pc.es56.js +3 -4
  11. package/dist/pc/sun-card-design-pc.es6.js +2 -10
  12. package/dist/public/sun-card-design.css +1 -1
  13. package/package.json +98 -96
  14. package/dist/public/sun-card-designer.css +0 -1
  15. package/dist/sun-card-designer.es.js +0 -25
  16. package/dist/sun-card-designer.es10.js +0 -167
  17. package/dist/sun-card-designer.es11.js +0 -197
  18. package/dist/sun-card-designer.es12.js +0 -203
  19. package/dist/sun-card-designer.es13.js +0 -130
  20. package/dist/sun-card-designer.es14.js +0 -120
  21. package/dist/sun-card-designer.es151.js +0 -4
  22. package/dist/sun-card-designer.es152.js +0 -4
  23. package/dist/sun-card-designer.es153.js +0 -4
  24. package/dist/sun-card-designer.es154.js +0 -4
  25. package/dist/sun-card-designer.es155.js +0 -82
  26. package/dist/sun-card-designer.es156.js +0 -91
  27. package/dist/sun-card-designer.es157.js +0 -92
  28. package/dist/sun-card-designer.es158.js +0 -191
  29. package/dist/sun-card-designer.es159.js +0 -86
  30. package/dist/sun-card-designer.es16.js +0 -10
  31. package/dist/sun-card-designer.es160.js +0 -238
  32. package/dist/sun-card-designer.es161.js +0 -113
  33. package/dist/sun-card-designer.es162.js +0 -49
  34. package/dist/sun-card-designer.es163.js +0 -43
  35. package/dist/sun-card-designer.es164.js +0 -39
  36. package/dist/sun-card-designer.es165.js +0 -46
  37. package/dist/sun-card-designer.es166.js +0 -58
  38. package/dist/sun-card-designer.es167.js +0 -56
  39. package/dist/sun-card-designer.es168.js +0 -58
  40. package/dist/sun-card-designer.es169.js +0 -73
  41. package/dist/sun-card-designer.es17.js +0 -333
  42. package/dist/sun-card-designer.es170.js +0 -59
  43. package/dist/sun-card-designer.es171.js +0 -69
  44. package/dist/sun-card-designer.es172.js +0 -182
  45. package/dist/sun-card-designer.es173.js +0 -176
  46. package/dist/sun-card-designer.es174.js +0 -184
  47. package/dist/sun-card-designer.es175.js +0 -409
  48. package/dist/sun-card-designer.es176.js +0 -365
  49. package/dist/sun-card-designer.es177.js +0 -70
  50. package/dist/sun-card-designer.es178.js +0 -68
  51. package/dist/sun-card-designer.es179.js +0 -184
  52. package/dist/sun-card-designer.es18.js +0 -68
  53. package/dist/sun-card-designer.es180.js +0 -193
  54. package/dist/sun-card-designer.es181.js +0 -193
  55. package/dist/sun-card-designer.es182.js +0 -193
  56. package/dist/sun-card-designer.es184.js +0 -228
  57. package/dist/sun-card-designer.es185.js +0 -71
  58. package/dist/sun-card-designer.es19.js +0 -611
  59. package/dist/sun-card-designer.es196.js +0 -4
  60. package/dist/sun-card-designer.es20.js +0 -225
  61. package/dist/sun-card-designer.es201.js +0 -125
  62. package/dist/sun-card-designer.es21.js +0 -69
  63. package/dist/sun-card-designer.es22.js +0 -719
  64. package/dist/sun-card-designer.es220.js +0 -63
  65. package/dist/sun-card-designer.es221.js +0 -80
  66. package/dist/sun-card-designer.es222.js +0 -82
  67. package/dist/sun-card-designer.es223.js +0 -94
  68. package/dist/sun-card-designer.es224.js +0 -87
  69. package/dist/sun-card-designer.es225.js +0 -226
  70. package/dist/sun-card-designer.es226.js +0 -105
  71. package/dist/sun-card-designer.es227.js +0 -45
  72. package/dist/sun-card-designer.es228.js +0 -31
  73. package/dist/sun-card-designer.es229.js +0 -29
  74. package/dist/sun-card-designer.es23.js +0 -211
  75. package/dist/sun-card-designer.es230.js +0 -32
  76. package/dist/sun-card-designer.es231.js +0 -46
  77. package/dist/sun-card-designer.es232.js +0 -42
  78. package/dist/sun-card-designer.es233.js +0 -44
  79. package/dist/sun-card-designer.es234.js +0 -61
  80. package/dist/sun-card-designer.es235.js +0 -46
  81. package/dist/sun-card-designer.es236.js +0 -54
  82. package/dist/sun-card-designer.es237.js +0 -130
  83. package/dist/sun-card-designer.es238.js +0 -127
  84. package/dist/sun-card-designer.es239.js +0 -132
  85. package/dist/sun-card-designer.es24.js +0 -265
  86. package/dist/sun-card-designer.es240.js +0 -375
  87. package/dist/sun-card-designer.es241.js +0 -348
  88. package/dist/sun-card-designer.es242.js +0 -69
  89. package/dist/sun-card-designer.es243.js +0 -65
  90. package/dist/sun-card-designer.es244.js +0 -87
  91. package/dist/sun-card-designer.es245.js +0 -98
  92. package/dist/sun-card-designer.es246.js +0 -98
  93. package/dist/sun-card-designer.es247.js +0 -98
  94. package/dist/sun-card-designer.es25.js +0 -857
  95. package/dist/sun-card-designer.es26.js +0 -768
  96. package/dist/sun-card-designer.es260.js +0 -125
  97. package/dist/sun-card-designer.es27.js +0 -264
  98. package/dist/sun-card-designer.es273.js +0 -192
  99. package/dist/sun-card-designer.es28.js +0 -809
  100. package/dist/sun-card-designer.es29.js +0 -220
  101. package/dist/sun-card-designer.es3.js +0 -506
  102. package/dist/sun-card-designer.es30.js +0 -809
  103. package/dist/sun-card-designer.es31.js +0 -220
  104. package/dist/sun-card-designer.es32.js +0 -820
  105. package/dist/sun-card-designer.es33.js +0 -225
  106. package/dist/sun-card-designer.es34.js +0 -69
  107. package/dist/sun-card-designer.es35.js +0 -375
  108. package/dist/sun-card-designer.es36.js +0 -186
  109. package/dist/sun-card-designer.es37.js +0 -119
  110. package/dist/sun-card-designer.es38.js +0 -354
  111. package/dist/sun-card-designer.es39.js +0 -127
  112. package/dist/sun-card-designer.es4.js +0 -365
  113. package/dist/sun-card-designer.es40.js +0 -100
  114. package/dist/sun-card-designer.es41.js +0 -214
  115. package/dist/sun-card-designer.es42.js +0 -119
  116. package/dist/sun-card-designer.es43.js +0 -250
  117. package/dist/sun-card-designer.es44.js +0 -118
  118. package/dist/sun-card-designer.es45.js +0 -64
  119. package/dist/sun-card-designer.es46.js +0 -223
  120. package/dist/sun-card-designer.es47.js +0 -196
  121. package/dist/sun-card-designer.es48.js +0 -77
  122. package/dist/sun-card-designer.es49.js +0 -85
  123. package/dist/sun-card-designer.es5.js +0 -317
  124. package/dist/sun-card-designer.es50.js +0 -85
  125. package/dist/sun-card-designer.es51.js +0 -64
  126. package/dist/sun-card-designer.es52.js +0 -283
  127. package/dist/sun-card-designer.es53.js +0 -64
  128. package/dist/sun-card-designer.es54.js +0 -142
  129. package/dist/sun-card-designer.es55.js +0 -52
  130. package/dist/sun-card-designer.es56.js +0 -85
  131. package/dist/sun-card-designer.es57.js +0 -258
  132. package/dist/sun-card-designer.es58.js +0 -226
  133. package/dist/sun-card-designer.es59.js +0 -169
  134. package/dist/sun-card-designer.es6.js +0 -190
  135. package/dist/sun-card-designer.es60.js +0 -280
  136. package/dist/sun-card-designer.es61.js +0 -168
  137. package/dist/sun-card-designer.es62.js +0 -219
  138. package/dist/sun-card-designer.es63.js +0 -168
  139. package/dist/sun-card-designer.es64.js +0 -275
  140. package/dist/sun-card-designer.es65.js +0 -760
  141. package/dist/sun-card-designer.es66.js +0 -272
  142. package/dist/sun-card-designer.es67.js +0 -559
  143. package/dist/sun-card-designer.es68.js +0 -124
  144. package/dist/sun-card-designer.es69.js +0 -528
  145. package/dist/sun-card-designer.es7.js +0 -65
  146. package/dist/sun-card-designer.es70.js +0 -185
  147. package/dist/sun-card-designer.es71.js +0 -107
  148. package/dist/sun-card-designer.es72.js +0 -153
  149. package/dist/sun-card-designer.es73.js +0 -315
  150. package/dist/sun-card-designer.es74.js +0 -114
  151. package/dist/sun-card-designer.es76.js +0 -4211
  152. package/dist/sun-card-designer.es79.js +0 -4
  153. package/dist/sun-card-designer.es8.js +0 -171
  154. package/dist/sun-card-designer.es80.js +0 -4
  155. package/dist/sun-card-designer.es81.js +0 -4
  156. package/dist/sun-card-designer.es84.js +0 -228
  157. package/dist/sun-card-designer.es87.js +0 -52
  158. package/dist/sun-card-designer.es88.js +0 -52
  159. package/dist/sun-card-designer.es9.js +0 -207
  160. package/dist/sun-card-designer.es91.js +0 -344
  161. package/dist/sun-card-designer.es92.js +0 -199
  162. package/dist/sun-card-designer.es95.js +0 -180
@@ -1,197 +0,0 @@
1
- import { ref, watch, onMounted, onUnmounted, createElementBlock, createCommentVNode, openBlock, createElementVNode, createBlock, unref } from "vue";
2
- import * as THREE from "three";
3
- import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
4
- import TWEEN from "@tweenjs/tween.js";
5
- import { useCardManageStore } from "./sun-card-designer.es13.js";
6
- import { CloseCircleFilled } from "@ant-design/icons-vue";
7
- /* empty css */
8
- import _export_sfc from "./sun-card-designer.es16.js";
9
- const _hoisted_1 = {
10
- key: 0,
11
- class: "canvas"
12
- };
13
- const _sfc_main = {
14
- __name: "panoramaView",
15
- setup(__props) {
16
- const cardManageStore = useCardManageStore();
17
- const show = ref(false);
18
- const isClose = ref(false);
19
- const containerRef = ref(null);
20
- let imgUrl = null;
21
- let renderer = null;
22
- let scene = null;
23
- let camera = null;
24
- let controls = null;
25
- let sphere = null;
26
- let animationId = null;
27
- let texture = null;
28
- let tween = null;
29
- const openView = () => {
30
- isClose.value = false;
31
- renderer = null;
32
- scene = null;
33
- camera = null;
34
- controls = null;
35
- sphere = null;
36
- animationId = null;
37
- texture = null;
38
- tween = null;
39
- setTimeout(() => {
40
- initThree();
41
- });
42
- };
43
- const closeView = () => {
44
- window.removeEventListener("resize", onResize);
45
- disposeThree();
46
- show.value = false;
47
- };
48
- watch(
49
- () => cardManageStore.activePanorama,
50
- (value) => {
51
- imgUrl = value();
52
- show.value = true;
53
- openView();
54
- }
55
- );
56
- function initThree() {
57
- const container = containerRef.value;
58
- if (!container) return;
59
- const { clientWidth, clientHeight } = container;
60
- scene = new THREE.Scene();
61
- camera = new THREE.PerspectiveCamera(170, Math.max(clientWidth, 1) / Math.max(clientHeight, 1), 0.1, 1500);
62
- camera.position.set(0, 500, 0);
63
- camera.lookAt(0, 0, 0);
64
- renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
65
- renderer.setSize(clientWidth, clientHeight);
66
- renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
67
- renderer.outputColorSpace = THREE.SRGBColorSpace;
68
- container.appendChild(renderer.domElement);
69
- const loader = new THREE.TextureLoader();
70
- const jpgUrl = new URL(imgUrl, import.meta.url).href;
71
- texture = loader.load(jpgUrl, () => {
72
- texture.mapping = THREE.EquirectangularReflectionMapping;
73
- texture.colorSpace = THREE.SRGBColorSpace;
74
- const geometry = new THREE.SphereGeometry(500, 64, 64);
75
- geometry.scale(1, 1, 1);
76
- const material = new THREE.MeshBasicMaterial({ map: texture, side: THREE.BackSide });
77
- sphere = new THREE.Mesh(geometry, material);
78
- scene.add(sphere);
79
- let time1 = setTimeout(() => {
80
- clearTimeout(time1);
81
- tween = new TWEEN.Tween({
82
- fov: 170,
83
- ars: 40,
84
- rot: 0
85
- }).to({
86
- fov: 90,
87
- ars: 0,
88
- rot: Math.PI
89
- }, 3e3).easing(TWEEN.Easing.Quadratic.InOut).onComplete(function() {
90
- }).onUpdate(function(t) {
91
- camera.fov = t.fov;
92
- camera.updateProjectionMatrix();
93
- sphere.rotation.y = t.rot;
94
- }).start();
95
- let time2 = setTimeout(() => {
96
- clearTimeout(time2);
97
- tween = new TWEEN.Tween({
98
- fov: camera.fov,
99
- y: camera.position.y,
100
- z: camera.position.z
101
- }).to({
102
- fov: 35,
103
- y: 0,
104
- z: 500
105
- }, 2e3).easing(TWEEN.Easing.Linear.None).onComplete(() => {
106
- isClose.value = true;
107
- }).onUpdate((e) => {
108
- camera.fov = e.fov;
109
- camera.position.y = e.y;
110
- camera.position.z = e.z;
111
- camera.updateProjectionMatrix();
112
- sphere.rotation.y += 0.02;
113
- const target = new THREE.Vector3(0, e.y, e.z);
114
- camera.lookAt(target);
115
- }).start();
116
- }, 2e3);
117
- }, 500);
118
- requestAnimationFrame(animate);
119
- });
120
- controls = new OrbitControls(camera, renderer.domElement);
121
- controls.enableDamping = true;
122
- controls.enableZoom = true;
123
- controls.rotateSpeed = 0.4;
124
- controls.minDistance = 0.01;
125
- controls.maxDistance = 1e3;
126
- controls.enablePan = false;
127
- controls.target.set(0, 0, -1);
128
- controls.update();
129
- window.addEventListener("resize", onResize);
130
- }
131
- function onResize() {
132
- if (!renderer || !camera || !containerRef.value) return;
133
- const { clientWidth, clientHeight } = containerRef.value;
134
- renderer.setSize(clientWidth, clientHeight);
135
- camera.aspect = Math.max(clientWidth, 1) / Math.max(clientHeight, 1);
136
- camera.updateProjectionMatrix();
137
- }
138
- function animate(time) {
139
- if (!!tween?.update) tween.update(time);
140
- animationId = requestAnimationFrame(animate);
141
- controls && controls.update();
142
- renderer && renderer.render(scene, camera);
143
- }
144
- function disposeThree() {
145
- if (animationId) cancelAnimationFrame(animationId);
146
- animationId = null;
147
- window.removeEventListener("resize", onResize);
148
- if (controls) {
149
- controls.dispose();
150
- controls = null;
151
- }
152
- if (sphere) {
153
- if (sphere.geometry) sphere.geometry.dispose();
154
- if (sphere.material) sphere.material.dispose();
155
- sphere = null;
156
- }
157
- if (texture) {
158
- texture.dispose && texture.dispose();
159
- texture = null;
160
- }
161
- if (renderer) {
162
- if (renderer.domElement && renderer.domElement.parentNode) {
163
- renderer.domElement.parentNode.removeChild(renderer.domElement);
164
- }
165
- renderer.dispose();
166
- renderer = null;
167
- }
168
- scene = null;
169
- camera = null;
170
- }
171
- onMounted(() => {
172
- });
173
- onUnmounted(() => {
174
- window.removeEventListener("resize", onResize);
175
- disposeThree();
176
- });
177
- return (_ctx, _cache) => {
178
- return show.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
179
- createElementVNode("div", {
180
- ref_key: "containerRef",
181
- ref: containerRef,
182
- class: "canvas-view"
183
- }, [
184
- isClose.value ? (openBlock(), createBlock(unref(CloseCircleFilled), {
185
- key: 0,
186
- class: "icon",
187
- onClick: closeView
188
- })) : createCommentVNode("", true)
189
- ], 512)
190
- ])) : createCommentVNode("", true);
191
- };
192
- }
193
- };
194
- const PanoramaView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d43255ee"]]);
195
- export {
196
- PanoramaView as default
197
- };
@@ -1,203 +0,0 @@
1
- import { ref, computed, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, unref, normalizeStyle } from "vue";
2
- import pcPanel from "./sun-card-designer.es87.js";
3
- import mobilePanel from "./sun-card-designer.es88.js";
4
- import { CloseOutlined } from "@ant-design/icons-vue";
5
- /* empty css */
6
- import _export_sfc from "./sun-card-designer.es16.js";
7
- const _hoisted_1 = {
8
- key: 0,
9
- class: "cantainter"
10
- };
11
- const _hoisted_2 = { class: "main" };
12
- const _hoisted_3 = { class: "content" };
13
- const _hoisted_4 = {
14
- class: "mb",
15
- style: { "position": "relative", "overflow": "hidden", "display": "flex", "justify-content": "center", "align-items": "center" }
16
- };
17
- const _hoisted_5 = { class: "mobile-content" };
18
- const _sfc_main = {
19
- __name: "previewPanel",
20
- setup(__props, { expose: __expose }) {
21
- const show = ref(false);
22
- const record = ref(null);
23
- const pcScroll = ref(null);
24
- const mbScroll = ref(null);
25
- const toolConfig = ref(null);
26
- const onOpen = (row) => {
27
- show.value = true;
28
- console.info(row);
29
- toolConfig.value = {
30
- variableList: [
31
- {
32
- id: "-1",
33
- name: "数组-Test1",
34
- type: "Array",
35
- defaultValue: JSON.stringify([
36
- {
37
- title: "标题一",
38
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
39
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid0.png"
40
- },
41
- {
42
- title: "标题二",
43
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
44
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid1.png"
45
- },
46
- {
47
- title: "标题三",
48
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
49
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid2.png"
50
- }
51
- ])
52
- },
53
- {
54
- id: "-2",
55
- name: "数组-Test2",
56
- type: "Array",
57
- defaultValue: JSON.stringify([
58
- {
59
- title: "标题一",
60
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
61
- src: "https://p3-card-sign.byteimg.com/tos-cn-i-xdt3xczzd3/4418314581863347_1732602585813000796.jpg~tplv-xdt3xczzd3-image.image?rk3s=886be006&x-expires=1769328834&x-signature=vMMCc%2FwlDQ3VuKobNwY%2BTxDCyi8%3D"
62
- },
63
- {
64
- title: "标题二",
65
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
66
- src: "https://p3-card-sign.byteimg.com/tos-cn-i-xdt3xczzd3/4418314581863347_1732602595678562905.jpg~tplv-xdt3xczzd3-image.image?rk3s=886be006&x-expires=1769328834&x-signature=xKW6RP0HPDQOFsjKE6y7BhO78Lg%3D"
67
- },
68
- {
69
- title: "标题三",
70
- content: "列表正文,组件整体绑定 Array 类型数据后,可在此文本上绑定 item.文本。",
71
- src: "https://p3-card-sign.byteimg.com/tos-cn-i-xdt3xczzd3/4418314581863347_1732602614071957770.jpg~tplv-xdt3xczzd3-image.image?rk3s=886be006&x-expires=1769328834&x-signature=UMKGwqp8s6qviF1gKDaRVjRRURw%3D"
72
- }
73
- ])
74
- },
75
- {
76
- id: "-3",
77
- name: "数组-Test3",
78
- type: "Array",
79
- defaultValue: JSON.stringify([
80
- {
81
- title: "标题一",
82
- content: "列表正文,组件整体绑定 Array 类型数据。",
83
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid0.png"
84
- },
85
- {
86
- title: "标题二",
87
- content: "列表正文,组件整体绑定 Array 类型数据。",
88
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid1.png"
89
- },
90
- {
91
- title: "标题三",
92
- content: "列表正文,组件整体绑定 Array 类型数据。",
93
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid2.png"
94
- },
95
- {
96
- title: "标题一",
97
- content: "列表正文,组件整体绑定 Array 类型数据。",
98
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid0.png"
99
- },
100
- {
101
- title: "标题二",
102
- content: "列表正文,组件整体绑定 Array 类型数据。",
103
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid1.png"
104
- },
105
- {
106
- title: "标题三",
107
- content: "列表正文,组件整体绑定 Array 类型数据。",
108
- src: "https://lf-coze-web-cdn.coze.cn/obj/coze-web-cn/ui-builder/img/grid2.png"
109
- }
110
- ])
111
- }
112
- ]
113
- };
114
- record.value = row;
115
- };
116
- const onClick = (record2) => {
117
- console.info("onClick: ", record2);
118
- };
119
- const onFileUpdate = (record2) => {
120
- console.info("onFileUpdate", record2);
121
- };
122
- const onClickColumns = (record2) => {
123
- console.info("onClickColumns", record2);
124
- };
125
- const bubbleArrowColor = computed(() => {
126
- const bg = record?.value?.config?.background || "";
127
- if (!bg) return "#ffffff";
128
- const isGradient = /gradient\s*\(/i.test(bg);
129
- if (!isGradient) return bg;
130
- const colorMatch = bg.match(/gradient\([^,]+,\s*([^\s,\)]+)/i);
131
- if (colorMatch && colorMatch[1]) return colorMatch[1];
132
- return "#ffffff";
133
- });
134
- __expose({
135
- onOpen
136
- });
137
- return (_ctx, _cache) => {
138
- return show.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
139
- createElementVNode("div", _hoisted_2, [
140
- createVNode(unref(CloseOutlined), {
141
- class: "close",
142
- onClick: _cache[0] || (_cache[0] = () => show.value = false)
143
- }),
144
- _cache[5] || (_cache[5] = createElementVNode("div", { class: "footer" }, [
145
- createElementVNode("div", null, "PC"),
146
- createElementVNode("div", null, "Mobile")
147
- ], -1)),
148
- createElementVNode("div", _hoisted_3, [
149
- createElementVNode("div", {
150
- class: "pc",
151
- ref_key: "pcScroll",
152
- ref: pcScroll
153
- }, [
154
- _cache[1] || (_cache[1] = createElementVNode("div", { class: "msg-tem" }, "Hi,你好呀", -1)),
155
- createElementVNode("div", {
156
- class: "msg-box",
157
- style: normalizeStyle({ "--bubble-bg": record.value.config.background, "--bubble-arrow-bg": bubbleArrowColor.value, borderRadius: record.value.config.borderRadius + "px" })
158
- }, [
159
- createVNode(pcPanel, {
160
- record: record.value,
161
- config: toolConfig.value,
162
- onClickEvent: onClick,
163
- onFileUpdateEvent: onFileUpdate,
164
- onClickColumnsEvent: onClickColumns
165
- }, null, 8, ["record", "config"])
166
- ], 4)
167
- ], 512),
168
- _cache[4] || (_cache[4] = createElementVNode("div", { class: "line" }, null, -1)),
169
- createElementVNode("div", _hoisted_4, [
170
- createElementVNode("div", {
171
- class: "mb-box mobile-emulator mate",
172
- ref_key: "mbScroll",
173
- ref: mbScroll,
174
- style: { "transform": "scale(0.7)" }
175
- }, [
176
- _cache[3] || (_cache[3] = createElementVNode("div", { class: "device-status-bar" }, null, -1)),
177
- createElementVNode("div", _hoisted_5, [
178
- _cache[2] || (_cache[2] = createElementVNode("div", { class: "msg-tem" }, "Hi,你好呀", -1)),
179
- createElementVNode("div", {
180
- class: "msg-box",
181
- style: normalizeStyle({ "--bubble-bg": record.value.config.background, "--bubble-arrow-bg": bubbleArrowColor.value, borderRadius: record.value.config.borderRadius + "px" })
182
- }, [
183
- createVNode(mobilePanel, {
184
- record: record.value,
185
- config: toolConfig.value,
186
- onClickEvent: onClick,
187
- onFileUpdateEvent: onFileUpdate,
188
- onClickColumnsEvent: onClickColumns
189
- }, null, 8, ["record", "config"])
190
- ], 4)
191
- ])
192
- ], 512)
193
- ])
194
- ])
195
- ])
196
- ])) : createCommentVNode("", true);
197
- };
198
- }
199
- };
200
- const PreviewPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4f3f4d8a"]]);
201
- export {
202
- PreviewPanel as default
203
- };
@@ -1,130 +0,0 @@
1
- import { defineStore } from "pinia";
2
- const useCardManageStore = defineStore("cardMange", {
3
- state: () => ({
4
- allClickEvent: () => null,
5
- createVarbEvent: () => null,
6
- variableList: [],
7
- currentSelectUuid: null,
8
- currentDeleteUuid: null,
9
- currentCopyUuid: () => null,
10
- dataSourceState: () => null,
11
- dataSource: {},
12
- currentRenderUI: "pc",
13
- marks: [],
14
- revokeState: false,
15
- redoState: false,
16
- activePanorama: () => null
17
- }),
18
- getters: {},
19
- actions: {
20
- setAllClickEvent(value) {
21
- this.allClickEvent = () => value;
22
- },
23
- setCreateVarbEvent(value) {
24
- this.createVarbEvent = () => value;
25
- },
26
- updateVariableList(value) {
27
- this.variableList = value;
28
- },
29
- setCurrentSelectUuid(value) {
30
- this.currentSelectUuid = value;
31
- },
32
- setCurrentDeleteUuid(value) {
33
- this.currentDeleteUuid = value;
34
- this.updateMarks("del", value);
35
- },
36
- setCurrentCopyUuid(value) {
37
- this.currentCopyUuid = () => value;
38
- },
39
- setDataSourceState(value) {
40
- this.dataSourceState = () => value;
41
- },
42
- setDataSource(value) {
43
- this.dataSource = value;
44
- },
45
- setCurrentRenderUI(value) {
46
- this.currentRenderUI = value;
47
- },
48
- setMarks(value) {
49
- this.marks.push(value);
50
- this.updateState();
51
- },
52
- clearMarks() {
53
- this.marks = [];
54
- this.revokeState = false;
55
- this.redoState = false;
56
- },
57
- updateMarks(status, uuid) {
58
- if (status === "revoke" && this.marks[this.marks.length - 1].action === status && this.marks[this.marks.length - 1].state === false) {
59
- console.error("结束");
60
- return;
61
- }
62
- if (status === "redo" && this.marks[0].action !== "revoke" && this.marks[0].action !== "del") {
63
- console.error("结束");
64
- return;
65
- }
66
- if (status === "revoke") {
67
- if (this.marks[this.marks.length - 1].action === "del") {
68
- this.marks[this.marks.length - 1].state = !this.marks[this.marks.length - 1].state;
69
- this.marks[this.marks.length - 1].action = status;
70
- } else {
71
- this.marks[this.marks.length - 1].state = !this.marks[this.marks.length - 1].state;
72
- this.marks[this.marks.length - 1].action = status;
73
- if (this.marks.length > 1) {
74
- const item = this.marks[this.marks.length - 1];
75
- this.marks.splice(this.marks.length - 1, 1);
76
- this.marks.unshift(item);
77
- }
78
- }
79
- }
80
- if (status === "redo") {
81
- this.marks[0].state = !this.marks[0].state;
82
- this.marks[0].action = status;
83
- if (this.marks.length > 1) {
84
- const item = this.marks[0];
85
- this.marks.splice(0, 1);
86
- this.marks.push(item);
87
- }
88
- }
89
- if (status === "del") {
90
- let indexMark = null;
91
- let item = null;
92
- this.marks.forEach((e, index) => {
93
- if (e.uuid === uuid) {
94
- e.state = false;
95
- e.action = status;
96
- indexMark = index;
97
- item = e;
98
- }
99
- });
100
- this.marks.splice(indexMark, 1);
101
- this.marks.push(item);
102
- }
103
- this.updateState();
104
- },
105
- updateState() {
106
- if (!this.marks.length || !this.marks.filter((e) => e.state).length) {
107
- this.marks = [];
108
- this.revokeState = false;
109
- this.redoState = false;
110
- return;
111
- }
112
- if (this.marks[this.marks.length - 1].action === "revoke" && this.marks[this.marks.length - 1].state === false) {
113
- this.revokeState = false;
114
- } else {
115
- this.revokeState = true;
116
- }
117
- if (this.marks[0].action !== "revoke" && this.marks[0].action !== "del" || this.marks[this.marks.length - 1].action === "del") {
118
- this.redoState = false;
119
- } else {
120
- this.redoState = true;
121
- }
122
- },
123
- setActivePanorama(value) {
124
- this.activePanorama = () => value;
125
- }
126
- }
127
- });
128
- export {
129
- useCardManageStore
130
- };
@@ -1,120 +0,0 @@
1
- import { useCardManageStore } from "./sun-card-designer.es13.js";
2
- const generateShortUUID = () => {
3
- return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
4
- };
5
- const renderTextByVariables = (text, index = 0) => {
6
- const cardManageStore = useCardManageStore();
7
- if (typeof text !== "string") return text ?? "";
8
- const map = /* @__PURE__ */ new Map();
9
- if (Array.isArray(cardManageStore.variableList)) {
10
- for (const item of cardManageStore.variableList) {
11
- if (!item || typeof item.name !== "string") continue;
12
- map.set(item.name, item?.defaultValue ?? "");
13
- }
14
- }
15
- const arrayIndex = index || 0;
16
- return text.replace(/\{([^{}]+)\}/g, (match, inner) => {
17
- const expr = String(inner).trim();
18
- const hashMatch = expr.match(/^([^#]+)\s*#\s*(.+)$/);
19
- if (hashMatch) {
20
- const varName = hashMatch[1].trim();
21
- const keyPath = hashMatch[2].trim();
22
- const variable = Array.isArray(cardManageStore.variableList) ? cardManageStore.variableList.find((v) => v && v.name === varName) : null;
23
- if (!variable) return match;
24
- try {
25
- const parsed = JSON.parse(variable.defaultValue || "[]");
26
- if (Array.isArray(parsed)) {
27
- if (keyPath === "item") {
28
- const item = parsed[arrayIndex];
29
- return item === null || item === void 0 ? "" : String(item);
30
- }
31
- if (keyPath.includes(".")) {
32
- const parts = keyPath.split(".");
33
- const firstPart = parts[0];
34
- if (firstPart === "item") {
35
- const item = parsed[arrayIndex];
36
- if (item && typeof item === "object") {
37
- const value = parts.slice(1).reduce((acc, k) => acc !== null && acc !== void 0 ? acc[k] : void 0, item);
38
- return value === null || value === void 0 ? "" : String(value);
39
- }
40
- }
41
- if (/^\d+$/.test(firstPart)) {
42
- const index2 = parseInt(firstPart, 10);
43
- const item = parsed[index2];
44
- if (item && typeof item === "object") {
45
- const value = parts.slice(1).reduce((acc, k) => acc !== null && acc !== void 0 ? acc[k] : void 0, item);
46
- return value === null || value === void 0 ? "" : String(value);
47
- }
48
- }
49
- }
50
- return "";
51
- }
52
- if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
53
- const value = keyPath.split(".").reduce((acc, k) => acc !== null && acc !== void 0 ? acc[k] : void 0, parsed);
54
- return value === null || value === void 0 ? "" : String(value);
55
- }
56
- return "";
57
- } catch (_) {
58
- return match;
59
- }
60
- }
61
- const name = expr;
62
- if (map.has(name)) {
63
- const val = map.get(name);
64
- return val === null ? "" : String(val);
65
- }
66
- return match;
67
- });
68
- };
69
- const getDataList = (list) => {
70
- const newList = [];
71
- getNewList(list, newList);
72
- const arr = newList.filter((e) => ["input", "enterpriseSearch"].includes(e.type));
73
- return arr;
74
- };
75
- function getNewList(list, newList) {
76
- list.forEach((e) => {
77
- if (e.type !== "grid") {
78
- newList.push({
79
- uuid: e.uuid,
80
- name: e.options.label,
81
- label: e.label,
82
- type: e.type
83
- });
84
- } else {
85
- e.columns.forEach((i) => {
86
- getNewList(i.list, newList);
87
- });
88
- }
89
- });
90
- }
91
- const findGridAncestorByUuid = (root, targetUuid) => {
92
- let foundGrids = [];
93
- const dfs = (list, currentGrids = []) => {
94
- if (!Array.isArray(list)) return false;
95
- for (const node of list) {
96
- const nextGrids = [...currentGrids];
97
- if (node?.type === "grid") {
98
- nextGrids.push(node);
99
- }
100
- if (node?.uuid === targetUuid) {
101
- foundGrids = [...nextGrids];
102
- return true;
103
- }
104
- if (node?.type === "grid" && Array.isArray(node.columns)) {
105
- for (const col of node.columns) {
106
- if (dfs(col?.list, nextGrids)) return true;
107
- }
108
- }
109
- }
110
- return false;
111
- };
112
- dfs(root?.list || [], []);
113
- return foundGrids.find((grid) => grid?.options?.variableName) || null;
114
- };
115
- export {
116
- findGridAncestorByUuid,
117
- generateShortUUID,
118
- getDataList,
119
- renderTextByVariables
120
- };