@fonixtree/magic-design 1.0.4 → 2.0.2

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 (237) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +47 -3
  2. package/es/assets/fonts/magic-box-iconfont.css.bak +47 -3
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  8. package/es/assets/less/slider.less +49 -1
  9. package/es/common/ImageModal/index.js +35 -2
  10. package/es/common/ImagePicker/index.js +69 -9
  11. package/es/common/ImagePicker/index.less +1 -0
  12. package/es/common/LinkModal/AffiliateProductTable/index.js +348 -0
  13. package/es/common/LinkModal/index.js +6 -0
  14. package/es/composite-comp/bol/components/Banner/defaultJSON.js +1 -1
  15. package/es/composite-comp/bol/components/Banner/index.js +15 -1
  16. package/es/composite-comp/bol/components/Banner/mobile/index.js +1 -4
  17. package/es/composite-comp/bol/components/Banner/mobile/index.less +52 -78
  18. package/es/composite-comp/bol/components/Banner/pc/index.js +1 -4
  19. package/es/composite-comp/bol/components/Button/index.js +3 -4
  20. package/es/composite-comp/bol/components/Carousel/mobile/index.js +1 -4
  21. package/es/composite-comp/bol/components/Carousel/mobile/index.less +81 -100
  22. package/es/composite-comp/bol/components/Carousel/pc/index.js +1 -4
  23. package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +1 -4
  24. package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +15 -22
  25. package/es/composite-comp/bol/components/ImageGallery/pc/index.js +3 -4
  26. package/es/composite-comp/bol/components/ImageText/defaultJSON.js +11 -2
  27. package/es/composite-comp/bol/components/ImageText/mobile/index.js +1 -4
  28. package/es/composite-comp/bol/components/ImageText/mobile/index.less +233 -292
  29. package/es/composite-comp/bol/components/ImageText/pc/index.js +3 -4
  30. package/es/composite-comp/bol/components/Newsletter/index.js +1 -4
  31. package/es/composite-comp/bol/components/Tag/index.js +3 -4
  32. package/es/composite-comp/bol/components/Text/index.js +3 -4
  33. package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +49 -10
  34. package/es/composite-comp/bol/components/Video/components/VideoTag/index.less +5 -5
  35. package/es/composite-comp/bol/components/Video/defaultJSON.js +10 -0
  36. package/es/composite-comp/bol/components/Video/index.js +23 -1
  37. package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +9 -12
  38. package/es/composite-comp/bol/components/Video/mobile/Layout1/index.less +21 -27
  39. package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -11
  40. package/es/composite-comp/bol/components/Video/mobile/Layout2/index.less +36 -45
  41. package/es/composite-comp/bol/components/Video/mobile/Layout3/index.js +9 -11
  42. package/es/composite-comp/bol/components/Video/mobile/Layout3/index.less +43 -50
  43. package/es/composite-comp/bol/components/Video/mobile/index.js +8 -49
  44. package/es/composite-comp/bol/components/Video/mobile/index.less +2 -3
  45. package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +9 -12
  46. package/es/composite-comp/bol/components/Video/pc/Layout1/index.less +2 -2
  47. package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +15 -16
  48. package/es/composite-comp/bol/components/Video/pc/Layout2/index.less +4 -4
  49. package/es/composite-comp/bol/components/Video/pc/Layout3/index.js +8 -11
  50. package/es/composite-comp/bol/components/Video/pc/Layout3/index.less +2 -2
  51. package/es/composite-comp/bol/components/Video/pc/Layout4/index.js +9 -12
  52. package/es/composite-comp/bol/components/Video/pc/Layout4/index.less +5 -4
  53. package/es/composite-comp/bol/components/Video/pc/Layout5/index.js +9 -12
  54. package/es/composite-comp/bol/components/Video/pc/Layout5/index.less +12 -10
  55. package/es/composite-comp/bol/components/Wallet/mobile/index.js +1 -4
  56. package/es/composite-comp/bol/components/Wallet/mobile/index.less +27 -40
  57. package/es/composite-comp/bol/components/Wallet/pc/index.js +1 -4
  58. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +4 -0
  59. package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  60. package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +1 -1
  61. package/es/composite-comp/bol/config-panels/VideoConfig/VideoShareConfig/index.js +12 -2
  62. package/es/composite-comp/bol/config-panels/VideoConfig/index.js +3 -1
  63. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +10 -1
  64. package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +12 -2
  65. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +5 -3
  66. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +83 -97
  67. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +18 -35
  68. package/es/composite-comp/dito/components/Recommend/mobile/index.less +73 -86
  69. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +45 -52
  70. package/es/composite-comp/dito/components/SignBoard/mobile/index.less +76 -80
  71. package/es/constants/index.js +4 -2
  72. package/es/core/Designer/AiImageGenerator/GenerateArtist/images/back1.png +0 -0
  73. package/es/core/Designer/AiImageGenerator/GenerateArtist/images/back2.png +0 -0
  74. package/es/core/Designer/AiImageGenerator/GenerateArtist/images/back3.png +0 -0
  75. package/es/core/Designer/AiImageGenerator/GenerateArtist/images/back4.png +0 -0
  76. package/es/core/Designer/AiImageGenerator/GenerateArtist/index.js +72 -0
  77. package/es/core/Designer/AiImageGenerator/GenerateArtist/index.less +41 -0
  78. package/es/core/Designer/AiImageGenerator/GenerateSize/index.js +43 -0
  79. package/es/core/Designer/AiImageGenerator/GenerateSize/index.less +3 -0
  80. package/es/core/Designer/AiImageGenerator/History/index.js +141 -0
  81. package/es/core/Designer/AiImageGenerator/History/index.less +69 -0
  82. package/es/core/Designer/AiImageGenerator/UploadReference/index.js +45 -0
  83. package/es/core/Designer/AiImageGenerator/UploadReference/index.less +39 -0
  84. package/es/core/Designer/AiImageGenerator/images/nodata.png +0 -0
  85. package/es/core/Designer/AiImageGenerator/index.js +711 -0
  86. package/es/core/Designer/AiImageGenerator/index.less +140 -0
  87. package/es/core/Designer/ChatRobot/components/CopyBtn/index.js +49 -0
  88. package/es/core/Designer/ChatRobot/components/CopyBtn/index.less +0 -0
  89. package/es/core/Designer/ChatRobot/index.js +321 -0
  90. package/es/core/Designer/ChatRobot/index.less +130 -0
  91. package/es/core/Designer/ChatRobot/markdown.less +1 -0
  92. package/es/core/Designer/FonixtreeGpt/index.js +160 -0
  93. package/es/core/Designer/index.js +27 -8
  94. package/es/decorator/metaDecorator.js +1 -1
  95. package/es/locale/en/en.json +5 -0
  96. package/es/locale/es/es.json +5 -0
  97. package/es/locale/id/id.json +5 -0
  98. package/es/meta-comp/config-panels/ImageConfig/index.js +32 -11
  99. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-01.svg +4 -0
  100. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-02.svg +4 -0
  101. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-03.svg +4 -0
  102. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-04.svg +4 -0
  103. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-05.svg +3 -0
  104. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-01.svg +4 -0
  105. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-02.svg +4 -0
  106. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-03.svg +4 -0
  107. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-04.svg +4 -0
  108. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-05.svg +3 -0
  109. package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +63 -0
  110. package/es/meta-comp/config-panels/PlayIconConfig/index.js +211 -0
  111. package/es/meta-comp/config-panels/PlayIconConfig/index.less +37 -2
  112. package/es/meta-comp/config-panels/TextConfig/index.js +5 -1
  113. package/es/mobx/Store.js +3 -0
  114. package/es/utils/androidUtil.js +2 -1
  115. package/es/utils/businessUtil.js +13 -0
  116. package/es/utils/commonUtil.js +142 -34
  117. package/es/utils/coreUtil.js +3 -4
  118. package/lib/assets/fonts/magic-box-iconfont.css +47 -3
  119. package/lib/assets/fonts/magic-box-iconfont.css.bak +47 -3
  120. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  121. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  122. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  123. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  124. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  125. package/lib/assets/less/slider.less +49 -1
  126. package/lib/common/ImageModal/index.js +35 -2
  127. package/lib/common/ImagePicker/index.js +69 -9
  128. package/lib/common/ImagePicker/index.less +1 -0
  129. package/lib/common/LinkModal/AffiliateProductTable/index.js +348 -0
  130. package/lib/common/LinkModal/index.js +6 -0
  131. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +1 -1
  132. package/lib/composite-comp/bol/components/Banner/index.js +15 -1
  133. package/lib/composite-comp/bol/components/Banner/mobile/index.js +1 -4
  134. package/lib/composite-comp/bol/components/Banner/mobile/index.less +52 -78
  135. package/lib/composite-comp/bol/components/Banner/pc/index.js +1 -4
  136. package/lib/composite-comp/bol/components/Button/index.js +3 -4
  137. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +1 -4
  138. package/lib/composite-comp/bol/components/Carousel/mobile/index.less +81 -100
  139. package/lib/composite-comp/bol/components/Carousel/pc/index.js +1 -4
  140. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +1 -4
  141. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +15 -22
  142. package/lib/composite-comp/bol/components/ImageGallery/pc/index.js +3 -4
  143. package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +11 -2
  144. package/lib/composite-comp/bol/components/ImageText/mobile/index.js +1 -4
  145. package/lib/composite-comp/bol/components/ImageText/mobile/index.less +233 -292
  146. package/lib/composite-comp/bol/components/ImageText/pc/index.js +3 -4
  147. package/lib/composite-comp/bol/components/Newsletter/index.js +1 -4
  148. package/lib/composite-comp/bol/components/Tag/index.js +3 -4
  149. package/lib/composite-comp/bol/components/Text/index.js +3 -4
  150. package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +49 -10
  151. package/lib/composite-comp/bol/components/Video/components/VideoTag/index.less +5 -5
  152. package/lib/composite-comp/bol/components/Video/defaultJSON.js +10 -0
  153. package/lib/composite-comp/bol/components/Video/index.js +23 -1
  154. package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +9 -12
  155. package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.less +21 -27
  156. package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -11
  157. package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.less +36 -45
  158. package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.js +9 -11
  159. package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.less +43 -50
  160. package/lib/composite-comp/bol/components/Video/mobile/index.js +8 -49
  161. package/lib/composite-comp/bol/components/Video/mobile/index.less +2 -3
  162. package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +9 -12
  163. package/lib/composite-comp/bol/components/Video/pc/Layout1/index.less +2 -2
  164. package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +15 -16
  165. package/lib/composite-comp/bol/components/Video/pc/Layout2/index.less +4 -4
  166. package/lib/composite-comp/bol/components/Video/pc/Layout3/index.js +8 -11
  167. package/lib/composite-comp/bol/components/Video/pc/Layout3/index.less +2 -2
  168. package/lib/composite-comp/bol/components/Video/pc/Layout4/index.js +9 -12
  169. package/lib/composite-comp/bol/components/Video/pc/Layout4/index.less +5 -4
  170. package/lib/composite-comp/bol/components/Video/pc/Layout5/index.js +9 -12
  171. package/lib/composite-comp/bol/components/Video/pc/Layout5/index.less +12 -10
  172. package/lib/composite-comp/bol/components/Wallet/mobile/index.js +1 -4
  173. package/lib/composite-comp/bol/components/Wallet/mobile/index.less +27 -40
  174. package/lib/composite-comp/bol/components/Wallet/pc/index.js +1 -4
  175. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +4 -0
  176. package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  177. package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +1 -1
  178. package/lib/composite-comp/bol/config-panels/VideoConfig/VideoShareConfig/index.js +12 -2
  179. package/lib/composite-comp/bol/config-panels/VideoConfig/index.js +3 -1
  180. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +10 -1
  181. package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +12 -2
  182. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +5 -3
  183. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +83 -97
  184. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +18 -35
  185. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +73 -86
  186. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +45 -52
  187. package/lib/composite-comp/dito/components/SignBoard/mobile/index.less +76 -80
  188. package/lib/constants/index.js +4 -2
  189. package/lib/core/Designer/AiImageGenerator/GenerateArtist/images/back1.png +0 -0
  190. package/lib/core/Designer/AiImageGenerator/GenerateArtist/images/back2.png +0 -0
  191. package/lib/core/Designer/AiImageGenerator/GenerateArtist/images/back3.png +0 -0
  192. package/lib/core/Designer/AiImageGenerator/GenerateArtist/images/back4.png +0 -0
  193. package/lib/core/Designer/AiImageGenerator/GenerateArtist/index.js +72 -0
  194. package/lib/core/Designer/AiImageGenerator/GenerateArtist/index.less +41 -0
  195. package/lib/core/Designer/AiImageGenerator/GenerateSize/index.js +43 -0
  196. package/lib/core/Designer/AiImageGenerator/GenerateSize/index.less +3 -0
  197. package/lib/core/Designer/AiImageGenerator/History/index.js +141 -0
  198. package/lib/core/Designer/AiImageGenerator/History/index.less +69 -0
  199. package/lib/core/Designer/AiImageGenerator/UploadReference/index.js +45 -0
  200. package/lib/core/Designer/AiImageGenerator/UploadReference/index.less +39 -0
  201. package/lib/core/Designer/AiImageGenerator/images/nodata.png +0 -0
  202. package/lib/core/Designer/AiImageGenerator/index.js +711 -0
  203. package/lib/core/Designer/AiImageGenerator/index.less +140 -0
  204. package/lib/core/Designer/ChatRobot/components/CopyBtn/index.js +49 -0
  205. package/lib/core/Designer/ChatRobot/components/CopyBtn/index.less +0 -0
  206. package/lib/core/Designer/ChatRobot/index.js +321 -0
  207. package/lib/core/Designer/ChatRobot/index.less +130 -0
  208. package/lib/core/Designer/ChatRobot/markdown.less +1 -0
  209. package/lib/core/Designer/FonixtreeGpt/index.js +160 -0
  210. package/lib/core/Designer/index.js +27 -8
  211. package/lib/decorator/metaDecorator.js +1 -1
  212. package/lib/locale/en/en.json +5 -0
  213. package/lib/locale/es/es.json +5 -0
  214. package/lib/locale/id/id.json +5 -0
  215. package/lib/meta-comp/config-panels/ImageConfig/index.js +32 -11
  216. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-01.svg +4 -0
  217. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-02.svg +4 -0
  218. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-03.svg +4 -0
  219. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-04.svg +4 -0
  220. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/dark-playicon-05.svg +3 -0
  221. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-01.svg +4 -0
  222. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-02.svg +4 -0
  223. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-03.svg +4 -0
  224. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-04.svg +4 -0
  225. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/images/light-playicon-05.svg +3 -0
  226. package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +63 -0
  227. package/lib/meta-comp/config-panels/PlayIconConfig/index.js +211 -0
  228. package/lib/meta-comp/config-panels/PlayIconConfig/index.less +37 -2
  229. package/lib/meta-comp/config-panels/TextConfig/index.js +5 -1
  230. package/lib/mobx/Store.js +3 -0
  231. package/lib/utils/androidUtil.js +2 -1
  232. package/lib/utils/businessUtil.js +13 -0
  233. package/lib/utils/commonUtil.js +142 -34
  234. package/lib/utils/coreUtil.js +3 -4
  235. package/package.json +2 -1
  236. package/es/assets/fonts/.DS_Store +0 -0
  237. package/lib/assets/fonts/.DS_Store +0 -0
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _uuid = require("uuid");
9
+
10
+ var _commonUtil = require("../../../utils/commonUtil");
11
+
12
+ var _storeUtil = require("../../../utils/storeUtil");
13
+
14
+ // 角色
15
+ var roleMap = {
16
+ ASSISTANT: 'assistant',
17
+ USER: 'user'
18
+ }; // 上下文缓存key
19
+
20
+ var catchKey = 'fonixtree_chat_context';
21
+
22
+ var FonixtreeGpt =
23
+ /** @class */
24
+ function () {
25
+ function FonixtreeGpt(params) {
26
+ var _this = this; // 客户端标识
27
+
28
+
29
+ this.clientId = ''; // 是否正在生成
30
+
31
+ this.isGenerating = false; // 初始化参数
32
+
33
+ this.initParams = {}; // 建立连接
34
+
35
+ this.initChatConnect = function () {
36
+ var _a = _this.initParams,
37
+ onMessage = _a.onMessage,
38
+ onEnd = _a.onEnd;
39
+ var text = '';
40
+ var sse;
41
+ _this.clientId = (0, _uuid.v4)();
42
+ var eventSource = new EventSource("/designer/v1/ai/sse/create?clientId=" + _this.clientId);
43
+
44
+ eventSource.onopen = function (event) {
45
+ console.log('onOpen');
46
+ sse = event.target;
47
+ };
48
+
49
+ eventSource.onmessage = function (event) {
50
+ if (event.data == '[DONE]') {
51
+ _this.isGenerating = false;
52
+
53
+ _this.insertMessage2Context(text, roleMap.ASSISTANT);
54
+
55
+ text = '';
56
+ onEnd();
57
+
58
+ if (sse) {
59
+ sse.close();
60
+ }
61
+
62
+ return;
63
+ }
64
+
65
+ var jsonData = JSON.parse(event.data); // 没有数据
66
+
67
+ if (!jsonData.choices.length) {
68
+ return;
69
+ }
70
+
71
+ text += jsonData.choices[0].delta.content || '';
72
+ onMessage(text);
73
+ };
74
+
75
+ eventSource.onerror = function (event) {
76
+ console.log('onerror', event);
77
+ _this.isGenerating = false;
78
+
79
+ _this.regenerate();
80
+ };
81
+ }; // 获取chat上下文
82
+
83
+
84
+ this.getContext = function () {
85
+ var messages = (0, _storeUtil.getSessionStore)(catchKey) || [];
86
+ return messages;
87
+ }; // 消息插入上下文中
88
+
89
+
90
+ this.insertMessage2Context = function (message, role) {
91
+ if (role === void 0) {
92
+ role = roleMap.USER;
93
+ }
94
+
95
+ var messages = (0, _storeUtil.getSessionStore)(catchKey) || [];
96
+ messages.push({
97
+ content: message,
98
+ role: role
99
+ });
100
+ (0, _storeUtil.setSessionStore)(catchKey, messages);
101
+ }; // 发送消息
102
+
103
+
104
+ this.sendMessage = function (message) {
105
+ if (!message) {
106
+ return;
107
+ }
108
+
109
+ _this.isGenerating = true;
110
+
111
+ _this.insertMessage2Context(message);
112
+
113
+ var messages = _this.getContext();
114
+
115
+ _this.initChatConnect();
116
+
117
+ var newMessages = messages.splice(messages.length - 5);
118
+ setTimeout(function () {
119
+ (0, _commonUtil.commonFetch)('/designer/v1/ai/stream-chat-completion', {
120
+ clientId: _this.clientId,
121
+ messages: newMessages
122
+ }, 'POST');
123
+ }, 200);
124
+ }; // 重新生成
125
+
126
+
127
+ this.regenerate = function () {
128
+ var messages = (0, _storeUtil.getSessionStore)(catchKey) || [];
129
+
130
+ if (!messages.length) {
131
+ return;
132
+ }
133
+
134
+ if (!_this.isGenerating) {
135
+ // 清空上下文中的最后一次答案
136
+ messages.pop();
137
+ (0, _storeUtil.setSessionStore)(catchKey, messages);
138
+ }
139
+
140
+ _this.initChatConnect();
141
+
142
+ var newMessages = messages.splice(messages.length - 5);
143
+ setTimeout(function () {
144
+ (0, _commonUtil.commonFetch)('/designer/v1/ai/stream-chat-completion', {
145
+ clientId: _this.clientId,
146
+ messages: newMessages
147
+ }, 'POST');
148
+ }, 200);
149
+ }; // setSessionStore(catchKey, []);
150
+
151
+
152
+ this.clientId = (0, _uuid.v4)();
153
+ this.initParams = params;
154
+ }
155
+
156
+ return FonixtreeGpt;
157
+ }();
158
+
159
+ var _default = FonixtreeGpt;
160
+ exports["default"] = _default;
@@ -15,6 +15,8 @@ var _mobxReact = require("mobx-react");
15
15
 
16
16
  var _antd = require("antd");
17
17
 
18
+ var _ChatRobot = _interopRequireDefault(require("./ChatRobot"));
19
+
18
20
  var _CompListPanel = _interopRequireDefault(require("./CompListPanel"));
19
21
 
20
22
  var _PageCompList = _interopRequireDefault(require("./PageCompList"));
@@ -610,7 +612,8 @@ function (_super) {
610
612
  var pageData = props.pageData,
611
613
  config = props.config,
612
614
  outputType = props.outputType,
613
- locale = props.locale;
615
+ locale = props.locale; // console.log('constructor-- pageData', pageData);
616
+
614
617
  var MPageData = pageData.childNodes || [];
615
618
  _this.configRef = /*#__PURE__*/_react["default"].createRef(); // this.viewAreaRef = React.createRef();
616
619
 
@@ -638,25 +641,41 @@ function (_super) {
638
641
  }
639
642
 
640
643
  Designer.prototype.componentDidMount = function () {
641
- var _this = this; // 复合组件点击事件
644
+ var _this = this;
645
+
646
+ var _a; // 复合组件点击事件
642
647
 
643
648
 
644
649
  window.document.addEventListener('component-click', this.componentClick); // 复合组件重新渲染事件
645
650
 
646
- window.document.addEventListener('render-view', this.reRenderViewArea);
651
+ window.document.addEventListener('render-view', this.reRenderViewArea); // 兼容 旧组件新增 新功能的问题(本地)
652
+
653
+ if ((_a = this.props.pageData) === null || _a === void 0 ? void 0 : _a.childNodes) {
654
+ (0, _commonUtil.compatibleNewPageData)(this.props.pageData);
655
+ }
656
+
647
657
  this.destory = (0, _mobx.autorun)(function () {
658
+ var stateObj = {
659
+ imgGenVisible: _mobx.store.imgGenVisible
660
+ };
661
+
648
662
  if (_this.state.locale != _mobx.store.locale) {
649
- _this.setState({
650
- locale: _mobx.store.locale
651
- });
663
+ stateObj.locale = _mobx.store.locale;
652
664
  }
665
+
666
+ _this.setState(stateObj);
653
667
  });
654
668
  };
655
669
 
656
670
  Designer.prototype.componentWillReceiveProps = function (nextProps) {
657
671
  var pageData = nextProps.pageData,
658
672
  config = nextProps.config;
659
- var MPageData = pageData.childNodes || [];
673
+ var MPageData = pageData.childNodes || []; // 兼容 旧组件新增 新功能的问题(线上)
674
+
675
+ if (pageData === null || pageData === void 0 ? void 0 : pageData.childNodes) {
676
+ (0, _commonUtil.compatibleNewPageData)(pageData);
677
+ }
678
+
660
679
  this.history = new _History["default"](MPageData);
661
680
  this.setState({
662
681
  MPageData: MPageData
@@ -722,7 +741,7 @@ function (_super) {
722
741
  magic_design: ""
723
742
  }, /*#__PURE__*/_react["default"].createElement("div", {
724
743
  className: "designer-wrap"
725
- }, /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
744
+ }, /*#__PURE__*/_react["default"].createElement(_ChatRobot["default"], null), /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
726
745
  onAdd: this.onAdd,
727
746
  pageData: MPageData,
728
747
  pageName: pageName,
@@ -95,7 +95,7 @@ function metaDecorator(WrappedComponent) {
95
95
  GAData = _c.GAData;
96
96
  (0, _commonUtil.pushGA)(__assign(__assign({}, GAData), {
97
97
  elementId: data.id,
98
- elementName: data.text
98
+ elementName: data.text || GAData.groupName
99
99
  }));
100
100
  return;
101
101
  } // 组织冒泡
@@ -1,4 +1,9 @@
1
1
  {
2
+ "BOLD": "Bold",
3
+ "SEMIBOLD": "Semibold",
4
+ "DARK": "Dark",
5
+ "LIGHT": "Light",
6
+ "URL_IMAGE": "url image",
2
7
  "AI_IMAGE": "AI Image",
3
8
  "IMAGE_URL": "Image URL",
4
9
  "UPLOAD": "Upload",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "BOLD": "Bold",
3
+ "SEMIBOLD": "Semibold",
4
+ "DARK": "Dark",
5
+ "LIGHT": "Light",
6
+ "URL_IMAGE": "url image",
2
7
  "AI_IMAGE": "AI Image",
3
8
  "IMAGE_URL": "Image URL",
4
9
  "UPLOAD": "Upload",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "BOLD": "Bold",
3
+ "SEMIBOLD": "Semibold",
4
+ "DARK": "Dark",
5
+ "LIGHT": "Light",
6
+ "URL_IMAGE": "url image",
2
7
  "AI_IMAGE": "AI Image",
3
8
  "IMAGE_URL": "Image URL",
4
9
  "UPLOAD": "Upload",
@@ -205,7 +205,7 @@ function (_super) {
205
205
  _this.onClick = function (event) {// console.log(event);
206
206
  };
207
207
 
208
- _this.getImg = function (v) {
208
+ _this.getImg = function (v, way) {
209
209
  return __awaiter(_this, void 0, void 0, function () {
210
210
  var data, _scale, pcImg, h5Img;
211
211
 
@@ -214,6 +214,9 @@ function (_super) {
214
214
  case 0:
215
215
  data = this.props.data;
216
216
  _scale = 1;
217
+ if (!v) return [3
218
+ /*break*/
219
+ , 6];
217
220
  if (!(0, _coreUtil.isPc)()) return [3
218
221
  /*break*/
219
222
  , 3];
@@ -267,6 +270,10 @@ function (_super) {
267
270
  _a.label = 6;
268
271
 
269
272
  case 6:
273
+ if (way) {
274
+ data.content.imageSelectedWay = way;
275
+ }
276
+
270
277
  this.selfRender();
271
278
  return [2
272
279
  /*return*/
@@ -276,17 +283,23 @@ function (_super) {
276
283
  });
277
284
  };
278
285
 
279
- _this.getImgHoverUrl = function (v) {
286
+ _this.getImgHoverUrl = function (v, way) {
280
287
  var data = _this.props.data;
281
288
 
282
- if ((0, _coreUtil.isPc)()) {
283
- data.hover.pcImgHoverUrl = v.url;
289
+ if (v) {
290
+ if ((0, _coreUtil.isPc)()) {
291
+ data.hover.pcImgHoverUrl = v.url;
284
292
 
285
- if (!data.hover.h5ImgHoverUrl) {
293
+ if (!data.hover.h5ImgHoverUrl) {
294
+ data.hover.h5ImgHoverUrl = v.url;
295
+ }
296
+ } else {
286
297
  data.hover.h5ImgHoverUrl = v.url;
287
298
  }
288
- } else {
289
- data.hover.h5ImgHoverUrl = v.url;
299
+ }
300
+
301
+ if (way) {
302
+ data.hover.imageSelectedWay = way;
290
303
  }
291
304
 
292
305
  _this.selfRender();
@@ -310,8 +323,12 @@ function (_super) {
310
323
  var selectImg = this.getSelectedImg(data);
311
324
 
312
325
  var ContentSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
313
- onChange: function onChange(v) {
314
- _this.getImg(v);
326
+ imageSelectedWay: data.content.imageSelectedWay || {
327
+ pc: '',
328
+ mobile: ''
329
+ },
330
+ onChange: function onChange(v, way) {
331
+ _this.getImg(v, way);
315
332
  },
316
333
  value: selectImg
317
334
  }), needClickArea && selectImg && /*#__PURE__*/_react["default"].createElement(_HotAreaConfig["default"], {
@@ -364,8 +381,12 @@ function (_super) {
364
381
  count: data.hover.magnification
365
382
  }
366
383
  })), data.hover.backgroundType === 'new' && /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
367
- onChange: function onChange(v) {
368
- return _this.getImgHoverUrl(v);
384
+ imageSelectedWay: data.hover.imageSelectedWay || {
385
+ pc: '',
386
+ mobile: ''
387
+ },
388
+ onChange: function onChange(v, way) {
389
+ return _this.getImgHoverUrl(v, way);
369
390
  },
370
391
  value: (0, _coreUtil.isPc)() ? data.hover.pcImgHoverUrl : data.hover.h5ImgHoverUrl
371
392
  }));
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 4.5C8.86522 4.5 4.5 8.86522 4.5 14.25C4.5 19.6348 8.86522 24 14.25 24C19.6348 24 24 19.6348 24 14.25C24 8.86522 19.6348 4.5 14.25 4.5ZM3 14.25C3 8.0368 8.0368 3 14.25 3C20.4632 3 25.5 8.0368 25.5 14.25C25.5 20.4632 20.4632 25.5 14.25 25.5C8.0368 25.5 3 20.4632 3 14.25Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.8961 10.0887C12.14 9.95823 12.4359 9.97254 12.666 10.126L17.916 13.626C18.1247 13.7651 18.25 13.9992 18.25 14.25C18.25 14.5008 18.1247 14.7349 17.916 14.874L12.666 18.374C12.4359 18.5275 12.14 18.5418 11.8961 18.4113C11.6522 18.2807 11.5 18.0266 11.5 17.75V10.75C11.5 10.4734 11.6522 10.2193 11.8961 10.0887Z" fill="black"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14 2.625C11.7502 2.625 9.551 3.29213 7.68039 4.54203C5.80978 5.79193 4.35182 7.56847 3.49088 9.64698C2.62993 11.7255 2.40467 14.0126 2.84357 16.2192C3.28248 18.4257 4.36584 20.4525 5.95667 22.0433C7.54749 23.6342 9.57432 24.7175 11.7809 25.1564C13.9874 25.5953 16.2745 25.3701 18.353 24.5091C20.4315 23.6482 22.2081 22.1902 23.458 20.3196C24.7079 18.449 25.375 16.2498 25.375 14C25.3692 10.9849 24.1689 8.09502 22.037 5.96305C19.905 3.83107 17.0151 2.63078 14 2.625Z" fill="black"/>
3
+ <path d="M17.9813 14.7322L12.7313 18.2322C12.5865 18.3218 12.4203 18.3709 12.25 18.3744C12.1057 18.3743 11.9634 18.3406 11.8344 18.276C11.6945 18.2005 11.5778 18.0883 11.4969 17.9515C11.416 17.8147 11.3738 17.6584 11.375 17.4994V10.4994C11.3738 10.3405 11.416 10.1842 11.4969 10.0474C11.5778 9.91054 11.6945 9.79836 11.8344 9.72286C11.9749 9.65176 12.1314 9.61841 12.2886 9.62608C12.4459 9.63375 12.5984 9.68218 12.7313 9.76661L17.9813 13.2666C18.1031 13.3461 18.2033 13.4548 18.2726 13.5827C18.3419 13.7107 18.3781 13.8539 18.3781 13.9994C18.3781 14.1449 18.3419 14.2882 18.2726 14.4161C18.2033 14.5441 18.1031 14.6527 17.9813 14.7322Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25 6.5H3C2.17157 6.5 1.5 7.17157 1.5 8V21C1.5 21.8284 2.17157 22.5 3 22.5H25C25.8284 22.5 26.5 21.8284 26.5 21V8C26.5 7.17157 25.8284 6.5 25 6.5ZM3 5C1.34315 5 0 6.34315 0 8V21C0 22.6569 1.34315 24 3 24H25C26.6569 24 28 22.6569 28 21V8C28 6.34315 26.6569 5 25 5H3Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.8961 10.3387C12.14 10.2082 12.4359 10.2225 12.666 10.376L17.916 13.876C18.1247 14.0151 18.25 14.2492 18.25 14.5C18.25 14.7508 18.1247 14.9849 17.916 15.124L12.666 18.624C12.4359 18.7775 12.14 18.7918 11.8961 18.6613C11.6522 18.5307 11.5 18.2766 11.5 18V11C11.5 10.7234 11.6522 10.4693 11.8961 10.3387Z" fill="black"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect y="4" width="28" height="20" rx="3" fill="black"/>
3
+ <path d="M17.6063 14.6072L12.3563 18.1072C12.2115 18.1968 12.0453 18.2459 11.875 18.2494C11.7307 18.2493 11.5884 18.2156 11.4594 18.151C11.3195 18.0755 11.2028 17.9633 11.1219 17.8265C11.041 17.6897 10.9988 17.5334 11 17.3744V10.3744C10.9988 10.2155 11.041 10.0592 11.1219 9.92236C11.2028 9.78554 11.3195 9.67336 11.4594 9.59786C11.5999 9.52676 11.7564 9.49341 11.9136 9.50108C12.0709 9.50875 12.2234 9.55718 12.3563 9.64161L17.6063 13.1416C17.7281 13.2211 17.8283 13.3298 17.8976 13.4577C17.9669 13.5857 18.0031 13.7289 18.0031 13.8744C18.0031 14.0199 17.9669 14.1632 17.8976 14.2911C17.8283 14.4191 17.7281 14.5277 17.6063 14.6072Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M21.4288 12.9462L10.7945 6.18518C10.6174 6.06826 10.4128 6.00428 10.2032 6.00021C9.99348 5.99614 9.78676 6.05214 9.60557 6.1621C9.42169 6.26718 9.26841 6.42193 9.16184 6.61008C9.05528 6.79823 8.99937 7.01281 9.00001 7.23126V20.7687C8.99937 20.9872 9.05528 21.2018 9.16184 21.3899C9.26841 21.5781 9.42169 21.7328 9.60557 21.8379C9.78676 21.9479 9.99348 22.0039 10.2032 21.9998C10.4128 21.9957 10.6174 21.9317 10.7945 21.8148L21.4288 15.0538C21.6031 14.9443 21.7473 14.7897 21.8473 14.6051C21.9474 14.4204 22 14.212 22 14C22 13.788 21.9474 13.5796 21.8473 13.3949C21.7473 13.2103 21.6031 13.0558 21.4288 12.9462Z" fill="black"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 4.5C8.86522 4.5 4.5 8.86522 4.5 14.25C4.5 19.6348 8.86522 24 14.25 24C19.6348 24 24 19.6348 24 14.25C24 8.86522 19.6348 4.5 14.25 4.5ZM3 14.25C3 8.0368 8.0368 3 14.25 3C20.4632 3 25.5 8.0368 25.5 14.25C25.5 20.4632 20.4632 25.5 14.25 25.5C8.0368 25.5 3 20.4632 3 14.25Z" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.8961 10.0887C12.14 9.95823 12.4359 9.97254 12.666 10.126L17.916 13.626C18.1247 13.7651 18.25 13.9992 18.25 14.25C18.25 14.5008 18.1247 14.7349 17.916 14.874L12.666 18.374C12.4359 18.5275 12.14 18.5418 11.8961 18.4113C11.6522 18.2807 11.5 18.0266 11.5 17.75V10.75C11.5 10.4734 11.6522 10.2193 11.8961 10.0887Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14 2.625C11.7502 2.625 9.551 3.29213 7.68039 4.54203C5.80978 5.79193 4.35182 7.56847 3.49088 9.64698C2.62993 11.7255 2.40467 14.0126 2.84357 16.2192C3.28248 18.4257 4.36584 20.4525 5.95667 22.0433C7.54749 23.6342 9.57432 24.7175 11.7809 25.1564C13.9874 25.5953 16.2745 25.3701 18.353 24.5091C20.4315 23.6482 22.2081 22.1902 23.458 20.3196C24.7079 18.449 25.375 16.2498 25.375 14C25.3692 10.9849 24.1689 8.09502 22.037 5.96305C19.905 3.83107 17.0151 2.63078 14 2.625Z" fill="white"/>
3
+ <path d="M17.9813 14.7322L12.7313 18.2322C12.5865 18.3218 12.4203 18.3709 12.25 18.3744C12.1057 18.3743 11.9634 18.3406 11.8344 18.276C11.6945 18.2005 11.5778 18.0883 11.4969 17.9515C11.416 17.8147 11.3738 17.6584 11.375 17.4994V10.4994C11.3738 10.3405 11.416 10.1842 11.4969 10.0474C11.5778 9.91054 11.6945 9.79836 11.8344 9.72286C11.9749 9.65176 12.1314 9.61841 12.2886 9.62608C12.4459 9.63375 12.5984 9.68218 12.7313 9.76661L17.9813 13.2666C18.1031 13.3461 18.2033 13.4548 18.2726 13.5827C18.3419 13.7107 18.3781 13.8539 18.3781 13.9994C18.3781 14.1449 18.3419 14.2882 18.2726 14.4161C18.2033 14.5441 18.1031 14.6527 17.9813 14.7322Z" fill="black"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25 6.5H3C2.17157 6.5 1.5 7.17157 1.5 8V21C1.5 21.8284 2.17157 22.5 3 22.5H25C25.8284 22.5 26.5 21.8284 26.5 21V8C26.5 7.17157 25.8284 6.5 25 6.5ZM3 5C1.34315 5 0 6.34315 0 8V21C0 22.6569 1.34315 24 3 24H25C26.6569 24 28 22.6569 28 21V8C28 6.34315 26.6569 5 25 5H3Z" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.8961 10.3387C12.14 10.2082 12.4359 10.2225 12.666 10.376L17.916 13.876C18.1247 14.0151 18.25 14.2492 18.25 14.5C18.25 14.7508 18.1247 14.9849 17.916 15.124L12.666 18.624C12.4359 18.7775 12.14 18.7918 11.8961 18.6613C11.6522 18.5307 11.5 18.2766 11.5 18V11C11.5 10.7234 11.6522 10.4693 11.8961 10.3387Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect y="4" width="28" height="20" rx="3" fill="white"/>
3
+ <path d="M17.6063 14.6072L12.3563 18.1072C12.2115 18.1968 12.0453 18.2459 11.875 18.2494C11.7307 18.2493 11.5884 18.2156 11.4594 18.151C11.3195 18.0755 11.2028 17.9633 11.1219 17.8265C11.041 17.6897 10.9988 17.5334 11 17.3744V10.3744C10.9988 10.2155 11.041 10.0592 11.1219 9.92236C11.2028 9.78554 11.3195 9.67336 11.4594 9.59786C11.5999 9.52676 11.7564 9.49341 11.9136 9.50108C12.0709 9.50875 12.2234 9.55718 12.3563 9.64161L17.6063 13.1416C17.7281 13.2211 17.8283 13.3298 17.8976 13.4577C17.9669 13.5857 18.0031 13.7289 18.0031 13.8744C18.0031 14.0199 17.9669 14.1632 17.8976 14.2911C17.8283 14.4191 17.7281 14.5277 17.6063 14.6072Z" fill="black"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M21.4288 12.9462L10.7945 6.18518C10.6174 6.06826 10.4128 6.00428 10.2032 6.00021C9.99348 5.99614 9.78676 6.05214 9.60557 6.1621C9.42169 6.26718 9.26841 6.42193 9.16184 6.61008C9.05528 6.79823 8.99937 7.01281 9.00001 7.23126V20.7687C8.99937 20.9872 9.05528 21.2018 9.16184 21.3899C9.26841 21.5781 9.42169 21.7328 9.60557 21.8379C9.78676 21.9479 9.99348 22.0039 10.2032 21.9998C10.4128 21.9957 10.6174 21.9317 10.7945 21.8148L21.4288 15.0538C21.6031 14.9443 21.7473 14.7897 21.8473 14.6051C21.9474 14.4204 22 14.212 22 14C22 13.788 21.9474 13.5796 21.8473 13.3949C21.7473 13.2103 21.6031 13.0558 21.4288 12.9462Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = PlaySvg;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _darkPlayicon = _interopRequireDefault(require("./images/dark-playicon-01.svg"));
11
+
12
+ var _darkPlayicon2 = _interopRequireDefault(require("./images/dark-playicon-02.svg"));
13
+
14
+ var _darkPlayicon3 = _interopRequireDefault(require("./images/dark-playicon-03.svg"));
15
+
16
+ var _darkPlayicon4 = _interopRequireDefault(require("./images/dark-playicon-04.svg"));
17
+
18
+ var _darkPlayicon5 = _interopRequireDefault(require("./images/dark-playicon-05.svg"));
19
+
20
+ var _lightPlayicon = _interopRequireDefault(require("./images/light-playicon-01.svg"));
21
+
22
+ var _lightPlayicon2 = _interopRequireDefault(require("./images/light-playicon-02.svg"));
23
+
24
+ var _lightPlayicon3 = _interopRequireDefault(require("./images/light-playicon-03.svg"));
25
+
26
+ var _lightPlayicon4 = _interopRequireDefault(require("./images/light-playicon-04.svg"));
27
+
28
+ var _lightPlayicon5 = _interopRequireDefault(require("./images/light-playicon-05.svg"));
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
31
+
32
+ var imageSrcMap = {
33
+ 'light-playicon-01': _lightPlayicon["default"],
34
+ 'light-playicon-02': _lightPlayicon2["default"],
35
+ 'light-playicon-03': _lightPlayicon3["default"],
36
+ 'light-playicon-04': _lightPlayicon4["default"],
37
+ 'light-playicon-05': _lightPlayicon5["default"],
38
+ 'dark-playicon-01': _darkPlayicon["default"],
39
+ 'dark-playicon-02': _darkPlayicon2["default"],
40
+ 'dark-playicon-03': _darkPlayicon3["default"],
41
+ 'dark-playicon-04': _darkPlayicon4["default"],
42
+ 'dark-playicon-05': _darkPlayicon5["default"]
43
+ };
44
+
45
+ function PlaySvg(props) {
46
+ // const [imgSrc, setImgSrc] = useState(null);
47
+ // const getImageUrl = async () => {
48
+ // console.log('-- imagePath', imageSrcMap[props.imgName]);
49
+ // return await import(`./images/${props.imgName}.svg`);
50
+ // };
51
+ // useEffect(() => {
52
+ // getImageUrl().then(v => {
53
+ // setImgSrc(v.default);
54
+ // });
55
+ // });
56
+ return /*#__PURE__*/_react["default"].createElement("img", {
57
+ alt: "icon",
58
+ src: imageSrcMap[props.imgName],
59
+ style: {
60
+ width: props.imgWidth
61
+ }
62
+ });
63
+ }