@pisell/materials 6.0.18 → 6.0.20

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 (204) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +51 -20
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +51 -20
  11. package/es/components/badge/index.d.ts +7 -0
  12. package/es/components/badge/index.js +44 -0
  13. package/es/components/badge/index.less +2 -0
  14. package/es/components/buttonGroupEdit/index.d.ts +8 -0
  15. package/es/components/buttonGroupEdit/index.js +408 -0
  16. package/es/components/buttonGroupPreview/index.d.ts +19 -0
  17. package/es/components/buttonGroupPreview/index.js +74 -0
  18. package/es/components/cardMetricItem/index.d.ts +12 -0
  19. package/es/components/cardMetricItem/index.js +39 -0
  20. package/es/components/cardMetricItem/index.less +39 -0
  21. package/es/components/cardPro/index.d.ts +3 -0
  22. package/es/components/cardPro/index.js +66 -0
  23. package/es/components/cardPro/index.less +55 -0
  24. package/es/components/cropPhoto/index.d.ts +3 -0
  25. package/es/components/cropPhoto/index.js +72 -0
  26. package/es/components/cropPhoto/index.less +15 -0
  27. package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  28. package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +13 -3
  29. package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  30. package/es/components/dataSourceComponents/fields/Input/WithMode.js +24 -1
  31. package/es/components/dataSourceComponents/fields/Input.Mobile/serve.js +31 -3
  32. package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +31 -3
  33. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  34. package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
  35. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +102 -141
  36. package/es/components/dataSourceComponents/fields/Upload/WithMode.js +6 -3
  37. package/es/components/dataSourceComponents/fields/Upload/serve.js +13 -3
  38. package/es/components/dataSourceComponents/fields/Upload/shopUploadServe.d.ts +56 -0
  39. package/es/components/dataSourceComponents/fields/Upload/shopUploadServe.js +396 -0
  40. package/es/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
  41. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -0
  42. package/es/components/dataSourceComponents/fields/Upload/utils.js +17 -2
  43. package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
  44. package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -0
  45. package/es/components/dataSourceComponents/hooks/usePlatform.js +12 -0
  46. package/es/components/login-and-register/index.js +23 -21
  47. package/es/components/login-and-register/index.less +7 -7
  48. package/es/components/page/index.js +23 -57
  49. package/es/components/pisellAnchor/index.d.ts +23 -0
  50. package/es/components/pisellAnchor/index.js +303 -0
  51. package/es/components/pisellAnchor/index.less +197 -0
  52. package/es/components/pisellNavigationMenu/PisellNavigationMenu.js +18 -2
  53. package/es/components/pisellQrcode/index.d.ts +10 -0
  54. package/es/components/pisellQrcode/index.js +70 -0
  55. package/es/components/pisellQrcode/index.less +41 -0
  56. package/es/components/pisellStatisticList/index.d.ts +3 -0
  57. package/es/components/pisellStatisticList/index.js +17 -5
  58. package/es/components/pisellStatisticList/index.less +1 -1
  59. package/es/components/pisellText/components/Amount/index.d.ts +2 -0
  60. package/es/components/pisellText/components/Amount/index.js +3 -2
  61. package/es/components/pisellWalletPassCard/index.d.ts +4 -4
  62. package/es/components/pisellWalletPassCard/index.js +28 -12
  63. package/es/components/pisellWalletPassCard/index.less +26 -4
  64. package/es/components/record-view/index.d.ts +13 -5
  65. package/es/components/record-view/index.js +81 -30
  66. package/es/components/record-view/index.less +37 -2
  67. package/es/components/table/Table/utils.d.ts +1 -1
  68. package/es/components/tabs/index.d.ts +1 -0
  69. package/es/components/tabs/index.js +25 -7
  70. package/es/components/tabs/index.less +5 -5
  71. package/es/components/walletCard/Guest/index.d.ts +3 -0
  72. package/es/components/walletCard/Guest/index.js +83 -0
  73. package/es/components/walletCard/Guest/index.less +71 -0
  74. package/es/components/walletCard/index.d.ts +65 -0
  75. package/es/components/walletCard/index.js +402 -0
  76. package/es/components/walletCard/index.less +267 -0
  77. package/es/index.d.ts +10 -1
  78. package/es/index.js +10 -1
  79. package/es/locales/en-US.d.ts +38 -2
  80. package/es/locales/en-US.js +55 -10
  81. package/es/locales/index.js +4 -2
  82. package/es/locales/zh-CN.d.ts +36 -0
  83. package/es/locales/zh-CN.js +41 -1
  84. package/es/locales/zh-TW.d.ts +36 -0
  85. package/es/locales/zh-TW.js +41 -1
  86. package/es/utils/index.d.ts +1 -0
  87. package/es/utils/index.js +3 -0
  88. package/es/utils/platform.d.ts +1 -1
  89. package/lib/components/badge/index.d.ts +7 -0
  90. package/lib/components/badge/index.js +70 -0
  91. package/lib/components/badge/index.less +2 -0
  92. package/lib/components/buttonGroupEdit/index.d.ts +8 -0
  93. package/lib/components/buttonGroupEdit/index.js +317 -0
  94. package/lib/components/buttonGroupPreview/index.d.ts +19 -0
  95. package/lib/components/buttonGroupPreview/index.js +79 -0
  96. package/lib/components/cardMetricItem/index.d.ts +12 -0
  97. package/lib/components/cardMetricItem/index.js +75 -0
  98. package/lib/components/cardMetricItem/index.less +39 -0
  99. package/lib/components/cardPro/index.d.ts +3 -0
  100. package/lib/components/cardPro/index.js +98 -0
  101. package/lib/components/cardPro/index.less +55 -0
  102. package/lib/components/cropPhoto/index.d.ts +3 -0
  103. package/lib/components/cropPhoto/index.js +70 -0
  104. package/lib/components/cropPhoto/index.less +15 -0
  105. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  106. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +12 -3
  107. package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  108. package/lib/components/dataSourceComponents/fields/Input/WithMode.js +21 -0
  109. package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.js +37 -3
  110. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +37 -3
  111. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  112. package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
  113. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +47 -72
  114. package/lib/components/dataSourceComponents/fields/Upload/WithMode.js +11 -9
  115. package/lib/components/dataSourceComponents/fields/Upload/serve.js +11 -2
  116. package/lib/components/dataSourceComponents/fields/Upload/shopUploadServe.d.ts +56 -0
  117. package/lib/components/dataSourceComponents/fields/Upload/shopUploadServe.js +247 -0
  118. package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
  119. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -0
  120. package/lib/components/dataSourceComponents/fields/Upload/utils.js +17 -2
  121. package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
  122. package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -0
  123. package/lib/components/dataSourceComponents/hooks/usePlatform.js +51 -0
  124. package/lib/components/login-and-register/index.js +23 -21
  125. package/lib/components/login-and-register/index.less +7 -7
  126. package/lib/components/page/index.js +37 -65
  127. package/lib/components/pisellAnchor/index.d.ts +23 -0
  128. package/lib/components/pisellAnchor/index.js +251 -0
  129. package/lib/components/pisellAnchor/index.less +197 -0
  130. package/lib/components/pisellNavigationMenu/PisellNavigationMenu.js +24 -3
  131. package/lib/components/pisellQrcode/index.d.ts +10 -0
  132. package/lib/components/pisellQrcode/index.js +82 -0
  133. package/lib/components/pisellQrcode/index.less +41 -0
  134. package/lib/components/pisellStatisticList/index.d.ts +3 -0
  135. package/lib/components/pisellStatisticList/index.js +35 -15
  136. package/lib/components/pisellStatisticList/index.less +1 -1
  137. package/lib/components/pisellText/components/Amount/index.d.ts +2 -0
  138. package/lib/components/pisellText/components/Amount/index.js +2 -1
  139. package/lib/components/pisellWalletPassCard/index.d.ts +4 -4
  140. package/lib/components/pisellWalletPassCard/index.js +17 -9
  141. package/lib/components/pisellWalletPassCard/index.less +26 -4
  142. package/lib/components/record-view/index.d.ts +13 -5
  143. package/lib/components/record-view/index.js +63 -11
  144. package/lib/components/record-view/index.less +37 -2
  145. package/lib/components/table/Table/utils.d.ts +1 -1
  146. package/lib/components/tabs/index.d.ts +1 -0
  147. package/lib/components/tabs/index.js +12 -1
  148. package/lib/components/tabs/index.less +5 -5
  149. package/lib/components/walletCard/Guest/index.d.ts +3 -0
  150. package/lib/components/walletCard/Guest/index.js +138 -0
  151. package/lib/components/walletCard/Guest/index.less +71 -0
  152. package/lib/components/walletCard/index.d.ts +65 -0
  153. package/lib/components/walletCard/index.js +374 -0
  154. package/lib/components/walletCard/index.less +267 -0
  155. package/lib/index.d.ts +10 -1
  156. package/lib/index.js +26 -1
  157. package/lib/locales/en-US.d.ts +38 -2
  158. package/lib/locales/en-US.js +41 -3
  159. package/lib/locales/index.js +4 -2
  160. package/lib/locales/zh-CN.d.ts +36 -0
  161. package/lib/locales/zh-CN.js +41 -1
  162. package/lib/locales/zh-TW.d.ts +36 -0
  163. package/lib/locales/zh-TW.js +41 -1
  164. package/lib/utils/index.d.ts +1 -0
  165. package/lib/utils/index.js +6 -1
  166. package/lib/utils/platform.d.ts +1 -1
  167. package/lowcode/badge/meta.ts +20 -11
  168. package/lowcode/badge/snippets.ts +2 -0
  169. package/lowcode/button/meta.ts +2 -6
  170. package/lowcode/button-group/meta.ts +198 -0
  171. package/lowcode/button-group/snippets.ts +68 -0
  172. package/lowcode/button-group-edit/meta.ts +32 -0
  173. package/lowcode/button-group-edit/snippets.ts +98 -0
  174. package/lowcode/button-group-preview/meta.ts +55 -0
  175. package/lowcode/button-group-preview/snippets.ts +57 -0
  176. package/lowcode/card/snippets.ts +55 -55
  177. package/lowcode/card-metric-item/meta.ts +83 -0
  178. package/lowcode/card-metric-item/snippets.ts +13 -0
  179. package/lowcode/card-pro/meta.ts +338 -0
  180. package/lowcode/card-pro/snippe.ts +39 -0
  181. package/lowcode/crop-photo/meta.ts +77 -0
  182. package/lowcode/crop-photo/snippe.ts +12 -0
  183. package/lowcode/form-item-input/snippets.ts +1 -1
  184. package/lowcode/form-item-upload/meta.ts +11 -0
  185. package/lowcode/pisell-anchor/meta.ts +118 -0
  186. package/lowcode/pisell-anchor/snippets.ts +26 -0
  187. package/lowcode/pisell-card/meta.ts +63 -27
  188. package/lowcode/pisell-card/snippets.ts +6 -0
  189. package/lowcode/pisell-modal.information/meta.ts +8 -0
  190. package/lowcode/pisell-qrcode/__screenshots__/upload-1.png +0 -0
  191. package/lowcode/pisell-qrcode/meta.ts +46 -0
  192. package/lowcode/pisell-qrcode/snippets.ts +13 -0
  193. package/lowcode/pisell-tooltip/meta.ts +1 -1
  194. package/lowcode/record-view/meta.ts +20 -0
  195. package/lowcode/section-footers/meta.ts +66 -0
  196. package/lowcode/section-footers/snippe.ts +21 -0
  197. package/lowcode/spin/meta.ts +9 -0
  198. package/lowcode/tag/meta.ts +6 -0
  199. package/lowcode/timeline/meta.ts +32 -9
  200. package/lowcode/timeline/snippets.ts +12 -2
  201. package/lowcode/timeline.item/meta.ts +1 -1
  202. package/lowcode/wallet-card/meta.ts +283 -0
  203. package/lowcode/wallet-card/snippets.ts +44 -0
  204. package/package.json +5 -1
@@ -0,0 +1,56 @@
1
+ import { RcFile } from 'antd/es/upload';
2
+ export declare const filetypes: Record<string, any>;
3
+ /**
4
+ * @Title: 获取 阿里云 Signature
5
+ * @Describe:
6
+ * @Author: Wzw
7
+ */
8
+ export declare const getPolicy: () => Promise<any>;
9
+ export declare const getPolicyFile: () => Promise<any>;
10
+ /**
11
+ * @Title: 获取图片尺寸
12
+ * @Describe:
13
+ * @Author: Wzw
14
+ * @param {*} async
15
+ */
16
+ export declare const getImageWidth: (file: any) => Promise<{
17
+ width: number;
18
+ height: number;
19
+ }>;
20
+ /**
21
+ * @Title: 重新生成文件名
22
+ * @Describe:
23
+ * @Author: Wzw
24
+ * @param {string} file
25
+ */
26
+ export declare const formatFileName: (file?: any) => Promise<string>;
27
+ export declare const uploadFileAli: (file: any) => Promise<any>;
28
+ /**
29
+ * @Title: base64转file
30
+ * @Describe:
31
+ * @Author: Wzw
32
+ * @param {any} dataurl
33
+ * @param {string} filename
34
+ */
35
+ export declare const dataURLtoFile: (dataurl: any, filename: string) => File;
36
+ /**
37
+ * @Title: 获取视频封面
38
+ * @Describe:
39
+ * @Author: Wzw
40
+ * @param {any} file
41
+ */
42
+ export declare const getVideoCover: (file: any) => Promise<unknown>;
43
+ /**
44
+ * @Title: 获取腾讯云 Signature
45
+ * @Describe:
46
+ * @Author: Wzw
47
+ */
48
+ export declare const getSignature: () => Promise<any>;
49
+ /**
50
+ * @Title: 上传到腾讯云
51
+ * @Describe:
52
+ * @Author: Wzw
53
+ * @param {any} file
54
+ */
55
+ export declare const uploadFileTencent: (file: any) => Promise<unknown>;
56
+ export declare const uploadFile: (file: RcFile) => Promise<any>;
@@ -0,0 +1,247 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/fields/Upload/shopUploadServe.ts
30
+ var shopUploadServe_exports = {};
31
+ __export(shopUploadServe_exports, {
32
+ dataURLtoFile: () => dataURLtoFile,
33
+ filetypes: () => filetypes,
34
+ formatFileName: () => formatFileName,
35
+ getImageWidth: () => getImageWidth,
36
+ getPolicy: () => getPolicy,
37
+ getPolicyFile: () => getPolicyFile,
38
+ getSignature: () => getSignature,
39
+ getVideoCover: () => getVideoCover,
40
+ uploadFile: () => uploadFile,
41
+ uploadFileAli: () => uploadFileAli,
42
+ uploadFileTencent: () => uploadFileTencent
43
+ });
44
+ module.exports = __toCommonJS(shopUploadServe_exports);
45
+ var import_dayjs = __toESM(require("dayjs"));
46
+ var import_utils = require("@pisell/utils");
47
+ var import_vod_js_sdk_v6 = __toESM(require("vod-js-sdk-v6"));
48
+ var import_utils2 = require("../../../table/utils");
49
+ var filetypes = {
50
+ "vnd.openxmlformats-officedocument.wordprocessingml.document": {
51
+ icon: "iconword",
52
+ type: "applicatio",
53
+ format: "docx"
54
+ },
55
+ "vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
56
+ icon: "iconxlsx",
57
+ type: "applicatio",
58
+ format: "xlsx"
59
+ },
60
+ csv: {
61
+ icon: "icontxt",
62
+ type: "text",
63
+ format: "csv"
64
+ },
65
+ "vnd.ms-excel": {
66
+ icon: "iconxlsx",
67
+ type: "applicatio",
68
+ format: "xls"
69
+ },
70
+ msword: {
71
+ icon: "iconword",
72
+ type: "applicatio",
73
+ format: "doc"
74
+ },
75
+ pdf: {
76
+ icon: "iconpdf",
77
+ type: "applicatio",
78
+ format: "pdf"
79
+ }
80
+ };
81
+ var getPolicy = () => import_utils2.request.getRequest().get("/shop/ali-upload/policy", { type: "image" });
82
+ var getPolicyFile = () => import_utils2.request.getRequest().get("/shop/ali-upload/policy", { type: "file" });
83
+ var getImageWidth = async (file) => {
84
+ return new Promise((resolve, reject) => {
85
+ try {
86
+ let url = window.URL || window.webkitURL;
87
+ let img = new Image();
88
+ img.src = url.createObjectURL(file);
89
+ img.onload = function() {
90
+ resolve({ width: img.width, height: img.height });
91
+ };
92
+ img.onerror = function() {
93
+ resolve({ width: 0, height: 0 });
94
+ };
95
+ } catch (err) {
96
+ resolve({ width: 0, height: 0 });
97
+ }
98
+ });
99
+ };
100
+ var formatFileName = async (file) => {
101
+ var _a;
102
+ const imgSize = await getImageWidth(file);
103
+ let _suffix = ((file == null ? void 0 : file.type) || "image/png").split("/")[1];
104
+ let fileType = (_a = filetypes[_suffix]) == null ? void 0 : _a.format;
105
+ if (fileType) {
106
+ _suffix = fileType;
107
+ }
108
+ return (0, import_dayjs.default)().format("YYYY_MM_DD_HH_mm_ss_SSS") + "_" + (0, import_utils.getUniqueId)() + "__" + imgSize.width + "_" + imgSize.height + "__." + _suffix;
109
+ };
110
+ var uploadFileAli = async (file) => {
111
+ const policyData = await getPolicy();
112
+ let _name = await formatFileName(file);
113
+ let formData = new FormData();
114
+ formData.append("Content-Type", "multipart/form-data");
115
+ formData.append("OSSAccessKeyId", policyData.data.access_key_id);
116
+ formData.append("policy", policyData.data.policy);
117
+ formData.append("Signature", policyData.data.signature);
118
+ formData.append("key", policyData.data.dir + _name);
119
+ formData.append("success_action_status", "200");
120
+ formData.append("callback", policyData.data.callback);
121
+ formData.append("file", file);
122
+ return import_utils2.request.getRequest().post(policyData.data.cdn_domain, formData);
123
+ };
124
+ var uploadAli = async (file) => {
125
+ return uploadFileAli(file);
126
+ };
127
+ var getObjectURL = (file) => {
128
+ var url = null;
129
+ if (window.createObjectURL != void 0) {
130
+ url = window.createObjectURL(file);
131
+ } else if (window.URL != void 0) {
132
+ url = window.URL.createObjectURL(file);
133
+ } else if (window.webkitURL != void 0) {
134
+ url = window.webkitURL.createObjectURL(file);
135
+ }
136
+ return url;
137
+ };
138
+ var dataURLtoFile = (dataurl, filename) => {
139
+ var arr = dataurl.split(","), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
140
+ while (n--) {
141
+ u8arr[n] = bstr.charCodeAt(n);
142
+ }
143
+ return new File([u8arr], filename, { type: mime });
144
+ };
145
+ var getVideoCover = (file) => {
146
+ const url = getObjectURL(file);
147
+ return new Promise(function(resolve, reject) {
148
+ try {
149
+ let _video = document.createElement("video");
150
+ _video.setAttribute("crossOrigin", "anonymous");
151
+ _video.setAttribute("preload", "auto");
152
+ _video.muted = true;
153
+ _video.setAttribute("autoplay", "autoplay");
154
+ _video.src = url;
155
+ _video.addEventListener("loadeddata", function() {
156
+ this.currentTime = 1;
157
+ });
158
+ _video.addEventListener("seeked", function() {
159
+ this.width = this.videoWidth;
160
+ this.height = this.videoHeight;
161
+ if (this.width === 0 || this.height === 0) {
162
+ return resolve("");
163
+ }
164
+ let canvas = document.createElement("canvas");
165
+ let ctx = canvas.getContext("2d");
166
+ canvas.width = this.width;
167
+ canvas.height = this.height;
168
+ if (ctx === null) return;
169
+ ctx.drawImage(this, 0, 0, canvas.width, canvas.height);
170
+ let _cover = canvas.toDataURL("image/jpeg", 1);
171
+ let _cover_name = file.name.split(".")[0] + "_cover.jpeg";
172
+ resolve(dataURLtoFile(_cover, _cover_name));
173
+ });
174
+ } catch (err) {
175
+ reject();
176
+ }
177
+ });
178
+ };
179
+ var getSignature = () => import_utils2.request.getRequest().get("/shop/core/tx-video-sign").then((res) => {
180
+ var _a;
181
+ return (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.sign;
182
+ });
183
+ var uploadFileTencent = async (file) => {
184
+ return new Promise(async (resolve, reject) => {
185
+ try {
186
+ const coverFile = await getVideoCover(file);
187
+ console.log(coverFile);
188
+ const coverData = await uploadFileAli(coverFile);
189
+ const tcVod = new import_vod_js_sdk_v6.default({
190
+ // 传入鉴权函数
191
+ getSignature
192
+ });
193
+ const uploader = tcVod.upload({
194
+ mediaFile: file,
195
+ mediaName: file.name
196
+ });
197
+ uploader.on("media_upload", (info) => {
198
+ });
199
+ uploader.done().then((doneResult) => {
200
+ var _a, _b;
201
+ let res = {
202
+ status: true,
203
+ data: {
204
+ ...doneResult,
205
+ cover: {
206
+ ...doneResult == null ? void 0 : doneResult.cover,
207
+ url: (_a = coverData == null ? void 0 : coverData.data) == null ? void 0 : _a.url
208
+ },
209
+ url: (_b = doneResult == null ? void 0 : doneResult.video) == null ? void 0 : _b.url
210
+ }
211
+ };
212
+ return resolve(res);
213
+ }).catch((err) => {
214
+ return reject(err);
215
+ });
216
+ } catch (err) {
217
+ return reject(err);
218
+ }
219
+ });
220
+ };
221
+ var uploadTencent = async (file) => {
222
+ const res = await uploadFileTencent(file);
223
+ return res;
224
+ };
225
+ var uploadFile = (file) => {
226
+ if (file.type.startsWith("image")) {
227
+ return uploadAli(file);
228
+ } else if (file.type.startsWith("video")) {
229
+ return uploadTencent(file);
230
+ } else {
231
+ return uploadAli(file);
232
+ }
233
+ };
234
+ // Annotate the CommonJS export names for ESM import in node:
235
+ 0 && (module.exports = {
236
+ dataURLtoFile,
237
+ filetypes,
238
+ formatFileName,
239
+ getImageWidth,
240
+ getPolicy,
241
+ getPolicyFile,
242
+ getSignature,
243
+ getVideoCover,
244
+ uploadFile,
245
+ uploadFileAli,
246
+ uploadFileTencent
247
+ });
@@ -16,6 +16,7 @@ export interface UploadProps {
16
16
  maxCount?: number;
17
17
  multiple?: boolean;
18
18
  presetType?: string[];
19
+ presetTypeString?: string[];
19
20
  customType?: string[];
20
21
  enablePresetType?: boolean;
21
22
  enableCustomType?: boolean;
@@ -15,3 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
15
15
  metadata?: MediaMetadata;
16
16
  }) => Record<string, any>;
17
17
  export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
18
+ export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
@@ -24,6 +24,7 @@ __export(utils_exports, {
24
24
  createMultilingualFileList: () => createMultilingualFileList,
25
25
  genFileListByString: () => genFileListByString,
26
26
  generateUid: () => generateUid,
27
+ getBaseTime: () => getBaseTime,
27
28
  getDefaultFileList: () => getDefaultFileList,
28
29
  getFileMetadataParams: () => getFileMetadataParams,
29
30
  getFileName: () => getFileName,
@@ -69,14 +70,19 @@ var checkFileCount = ({
69
70
  return { success: true };
70
71
  };
71
72
  var createVideoMetadata = async (file) => {
72
- return new Promise((resolve) => {
73
+ return new Promise((resolve, reject) => {
73
74
  const video = document.createElement("video");
74
75
  const canvas = document.createElement("canvas");
75
76
  video.preload = "metadata";
76
77
  let hasMetadata = false;
77
78
  let hasSeeked = false;
78
79
  const tryResolve = () => {
79
- if (!hasMetadata || !hasSeeked) return;
80
+ if (!hasMetadata || !hasSeeked) {
81
+ reject();
82
+ console.log("没有元数据或没有seeked");
83
+ return;
84
+ }
85
+ ;
80
86
  canvas.width = video.videoWidth;
81
87
  canvas.height = video.videoHeight;
82
88
  const ctx = canvas.getContext("2d");
@@ -248,6 +254,14 @@ var isValueEqual = (value, fileListValue) => {
248
254
  }
249
255
  return value === fileListValue;
250
256
  };
257
+ var getBaseTime = (size) => {
258
+ const KB = 1024;
259
+ const MB = KB * 1024;
260
+ if (size < MB) return 1e3;
261
+ if (size < 5 * MB) return 2e3;
262
+ if (size < 20 * MB) return 4e3;
263
+ return 8e3;
264
+ };
251
265
  // Annotate the CommonJS export names for ESM import in node:
252
266
  0 && (module.exports = {
253
267
  checkFileCount,
@@ -255,6 +269,7 @@ var isValueEqual = (value, fileListValue) => {
255
269
  createMultilingualFileList,
256
270
  genFileListByString,
257
271
  generateUid,
272
+ getBaseTime,
258
273
  getDefaultFileList,
259
274
  getFileMetadataParams,
260
275
  getFileName,
@@ -19,7 +19,7 @@ declare const formFieldMap: {
19
19
  Subdomain: import("react").FC<import("antd").InputProps & {
20
20
  onChange: (value: string) => void;
21
21
  onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
22
- rootDomain: "custom" | "saas" | "xzero";
22
+ rootDomain: "custom" | "xzero" | "saas";
23
23
  customDomain?: string | undefined;
24
24
  value?: string | undefined;
25
25
  tenantId: string;
@@ -59,13 +59,11 @@ declare const formFieldMap: {
59
59
  FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
60
60
  FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
61
61
  };
62
- declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
62
+ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
63
63
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
64
64
  } & {
65
65
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
66
- }) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
67
- onChange: (value: string) => void;
68
- } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
66
+ }) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
69
67
  JSON: import("react").FC<any>;
70
68
  Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
71
69
  TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
@@ -78,14 +76,14 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
78
76
  Subdomain: import("react").FC<import("antd").InputProps & {
79
77
  onChange: (value: string) => void;
80
78
  onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
81
- rootDomain: "custom" | "saas" | "xzero";
79
+ rootDomain: "custom" | "xzero" | "saas";
82
80
  customDomain?: string | undefined;
83
81
  value?: string | undefined;
84
82
  tenantId: string;
85
83
  name?: string | undefined;
86
84
  fieldKey?: string | undefined;
87
85
  } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
88
- }) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
86
+ }) | (import("react").FC<{}> & {
89
87
  Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
90
88
  } & {
91
89
  Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
@@ -97,5 +95,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
97
95
  extraParams?: Record<string, any> | undefined;
98
96
  } & {
99
97
  dataSource?: any;
100
- }) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
98
+ }) => JSX.Element) | import("react").FC<any> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
99
+ onChange: (value: string) => void;
100
+ } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
101
101
  export { getFieldComponent, formFieldMap };
@@ -0,0 +1,3 @@
1
+ declare const usePlatform: () => any;
2
+ declare const useIsShop: () => boolean;
3
+ export { usePlatform, useIsShop };
@@ -0,0 +1,51 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/hooks/usePlatform.ts
30
+ var usePlatform_exports = {};
31
+ __export(usePlatform_exports, {
32
+ useIsShop: () => useIsShop,
33
+ usePlatform: () => usePlatform
34
+ });
35
+ module.exports = __toCommonJS(usePlatform_exports);
36
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
37
+ var usePlatform = () => {
38
+ var _a, _b;
39
+ const context = (0, import_useEngineContext.default)();
40
+ const platform = (_b = (_a = context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.platform;
41
+ return platform;
42
+ };
43
+ var useIsShop = () => {
44
+ const platform = usePlatform();
45
+ return platform === "shop";
46
+ };
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ useIsShop,
50
+ usePlatform
51
+ });
@@ -35,49 +35,50 @@ module.exports = __toCommonJS(login_and_register_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_icons = require("@ant-design/icons");
38
+ var import_locales = require("../../locales/index");
38
39
  var import_index = require("./index.less");
39
40
  var loginAndRegister = ({
40
41
  showLogo = true,
41
42
  logo,
42
43
  logoPosition = "center",
43
44
  logoSize = { width: 48, height: 48 },
44
- title = "Log in to your account",
45
+ title = (0, import_locales.getText)("Log in to your account"),
45
46
  showTitle = false,
46
47
  titleAlign = "center",
47
- subtitle = "Welcome back! Please enter your details.",
48
+ subtitle = (0, import_locales.getText)("pisell-login-and-register-subtit"),
48
49
  showSubtitle = false,
49
50
  subtitleAlign = "center",
50
51
  loginMethods = ["email", "google", "facebook", "apple"],
51
52
  defaultLoginMethod = "email",
52
- emailLabel = "Email",
53
- passwordLabel = "Password",
54
- emailPlaceholder = "Enter your email",
55
- passwordPlaceholder = "Enter your password",
53
+ emailLabel = (0, import_locales.getText)("pisell-login-and-register-email-label"),
54
+ passwordLabel = (0, import_locales.getText)("pisell-login-and-register-password-label"),
55
+ emailPlaceholder = (0, import_locales.getText)("pisell-login-and-register-email-placeholder"),
56
+ passwordPlaceholder = (0, import_locales.getText)("pisell-login-and-register-password-placeholder"),
56
57
  emailRules = [
57
- { required: true, message: "Please input your email!" },
58
- { type: "email", message: "Please enter a valid email!" }
58
+ { required: true, message: (0, import_locales.getText)("pisell-login-and-register-email-error") },
59
+ { type: "email", message: (0, import_locales.getText)("pisell-login-and-register-email-error-valid") }
59
60
  ],
60
- buttonText = "Log in",
61
+ buttonText = (0, import_locales.getText)("Log in"),
61
62
  socialLoginTexts = {
62
- google: "Continue with Google",
63
- facebook: "Continue with Facebook",
64
- apple: "Continue with Apple"
63
+ google: (0, import_locales.getText)("pisell-login-and-register-google"),
64
+ facebook: (0, import_locales.getText)("pisell-login-and-register-facebook"),
65
+ apple: (0, import_locales.getText)("pisell-login-and-register-apple")
65
66
  },
66
67
  showFooter = true,
67
68
  showSignUp = true,
68
- signUpText = "Don't have an account? Sign up",
69
+ signUpText = (0, import_locales.getText)("pisell-login-and-register-sign-up"),
69
70
  signUpLink = "",
70
71
  signUpPosition = "center",
71
72
  otherLinks = [],
72
73
  otherLinksPosition = "center",
73
74
  showTabs = true,
74
- loginTabText = "Login",
75
- registerTabText = "Register",
76
- registerEmailPlaceholder = "Enter your email",
77
- registerPasswordPlaceholder = "Create a password",
78
- registerButtonText = "Create account",
79
- rememberMeText = "Remember me",
80
- forgotPasswordText = "Forgot password?",
75
+ loginTabText = (0, import_locales.getText)("pisell-login-and-register-login-tab"),
76
+ registerTabText = (0, import_locales.getText)("pisell-login-and-register-register-tab"),
77
+ registerEmailPlaceholder = (0, import_locales.getText)("pisell-login-and-register-register-email-placeholder"),
78
+ registerPasswordPlaceholder = (0, import_locales.getText)("pisell-login-and-register-register-password-placeholder"),
79
+ registerButtonText = (0, import_locales.getText)("pisell-login-and-register-register-button-text"),
80
+ rememberMeText = (0, import_locales.getText)("pisell-login-and-register-remember-me"),
81
+ forgotPasswordText = (0, import_locales.getText)("pisell-login-and-register-forgot-password"),
81
82
  showRememberMe = false,
82
83
  showForgotPassword = false,
83
84
  onLogin,
@@ -117,6 +118,7 @@ var loginAndRegister = ({
117
118
  setLoading(false);
118
119
  }
119
120
  };
121
+ console.log(registerButtonText, "registerButtonText");
120
122
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "saas-login-main" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "saas-login-container" }, showLogo && /* @__PURE__ */ import_react.default.createElement(
121
123
  "div",
122
124
  {
@@ -177,7 +179,7 @@ var loginAndRegister = ({
177
179
  onClick: handleEmailLogin,
178
180
  className: "saas-login-button"
179
181
  },
180
- "Log in"
182
+ (0, import_locales.getText)("pisell-login-and-register-login")
181
183
  )) : /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { form }, /* @__PURE__ */ import_react.default.createElement(
182
184
  import_antd.Form.Item,
183
185
  {
@@ -67,7 +67,7 @@
67
67
  position: relative;
68
68
 
69
69
  &.active {
70
- color: #7F56D9;
70
+ color: var(--theme-color);
71
71
 
72
72
  &:after {
73
73
  content: '';
@@ -76,7 +76,7 @@
76
76
  left: 0;
77
77
  right: 0;
78
78
  height: 2px;
79
- background: #7F56D9;
79
+ background: var(--theme-color);
80
80
  }
81
81
  }
82
82
 
@@ -105,11 +105,11 @@
105
105
  background: #FFF;
106
106
 
107
107
  &:hover {
108
- border-color: #7F56D9;
108
+ border-color: var(--theme-color);
109
109
  }
110
110
 
111
111
  &:focus {
112
- border-color: #7F56D9;
112
+ border-color: var(--theme-color);
113
113
  box-shadow: 0 0 0 4px rgba(127, 86, 217, 0.1);
114
114
  }
115
115
 
@@ -126,7 +126,7 @@
126
126
  .saas-login-button {
127
127
  height: 44px;
128
128
  border-radius: 8px;
129
- background: #7F56D9;
129
+ background: var(--theme-color);
130
130
  border: none;
131
131
  font-weight: 500;
132
132
 
@@ -135,7 +135,7 @@
135
135
  }
136
136
 
137
137
  &:focus {
138
- background: #7F56D9;
138
+ background: var(--theme-color);
139
139
  box-shadow: 0 0 0 4px rgba(127, 86, 217, 0.1);
140
140
  }
141
141
  }
@@ -185,7 +185,7 @@
185
185
  margin-bottom: 16px;
186
186
 
187
187
  a {
188
- color: #7F56D9;
188
+ //color: #7F56D9;
189
189
  margin-left: 4px;
190
190
  cursor: pointer;
191
191