zcw-shared 2.4.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/dist/functions/android/integrateThirdPartyModule.d.ts +5 -0
  2. package/dist/functions/android/integrateThirdPartyModule.js +70 -0
  3. package/dist/functions/android/integrateThirdPartyModule.js.map +1 -1
  4. package/dist/functions/android/integrateUniPushAndroid.d.ts +23 -0
  5. package/dist/functions/android/integrateUniPushAndroid.js +266 -0
  6. package/dist/functions/android/integrateUniPushAndroid.js.map +1 -0
  7. package/dist/functions/browser/isElectron.d.ts +5 -0
  8. package/dist/functions/browser/isElectron.js +4 -0
  9. package/dist/functions/browser/isElectron.js.map +1 -0
  10. package/dist/functions/dom/isTextTruncated.d.ts +4 -0
  11. package/dist/functions/dom/isTextTruncated.js +16 -0
  12. package/dist/functions/dom/isTextTruncated.js.map +1 -0
  13. package/dist/functions/dom/localFileInput.d.ts +14 -0
  14. package/dist/functions/dom/localFileInput.js +27 -0
  15. package/dist/functions/dom/localFileInput.js.map +1 -0
  16. package/dist/functions/file/getIconfontNameByExtension.js +48 -51
  17. package/dist/functions/file/getIconfontNameByExtension.js.map +1 -1
  18. package/dist/functions/im/parseImMentionSegments.d.ts +15 -0
  19. package/dist/functions/im/parseImMentionSegments.js +56 -0
  20. package/dist/functions/im/parseImMentionSegments.js.map +1 -0
  21. package/dist/functions/ios/integrateThirdPartyModule.d.ts +9 -1
  22. package/dist/functions/ios/integrateThirdPartyModule.js +112 -2
  23. package/dist/functions/ios/integrateThirdPartyModule.js.map +1 -1
  24. package/dist/functions/ios/integrateUniPushIOS.d.ts +18 -0
  25. package/dist/functions/ios/integrateUniPushIOS.js +200 -0
  26. package/dist/functions/ios/integrateUniPushIOS.js.map +1 -0
  27. package/dist/functions/uniapp/app-plus/buildAndroidApp.js +38 -0
  28. package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
  29. package/dist/functions/uniapp/app-plus/buildIOSApp.js +38 -0
  30. package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
  31. package/dist/vue-hooks/dom/useAppendToBody.d.ts +25 -0
  32. package/dist/vue-hooks/dom/useAppendToBody.js +31 -0
  33. package/dist/vue-hooks/dom/useAppendToBody.js.map +1 -0
  34. package/dist/vue-hooks/dom/useDraggable.d.ts +8 -3
  35. package/dist/vue-hooks/dom/useDraggable.js +57 -19
  36. package/dist/vue-hooks/dom/useDraggable.js.map +1 -1
  37. package/package.json +11 -1
  38. package/references/dom.d.ts +8 -3
  39. package/types/im-api.d.ts +32 -4
  40. package/types/im-chat.d.ts +44 -1
  41. package/types/im-message-display.d.ts +89 -0
  42. package/types/uniapp-android-build.d.ts +31 -0
  43. package/types/uniapp-ios-build.d.ts +26 -0
  44. package/types/user.d.ts +2 -1
  45. package/dist/functions/async/sleep.d.ts +0 -5
  46. package/dist/functions/async/sleep.js +0 -6
  47. package/dist/functions/async/sleep.js.map +0 -1
  48. package/dist/functions/async/timeout.d.ts +0 -6
  49. package/dist/functions/async/timeout.js +0 -12
  50. package/dist/functions/async/timeout.js.map +0 -1
  51. package/dist/functions/browser/computePosition.d.ts +0 -6
  52. package/dist/functions/browser/computePosition.js +0 -49
  53. package/dist/functions/browser/computePosition.js.map +0 -1
  54. package/dist/functions/browser/createSharedKeyboardCenter.d.ts +0 -18
  55. package/dist/functions/browser/createSharedKeyboardCenter.js +0 -58
  56. package/dist/functions/browser/createSharedKeyboardCenter.js.map +0 -1
  57. package/dist/functions/browser/createThrottledEventListener.d.ts +0 -11
  58. package/dist/functions/browser/createThrottledEventListener.js +0 -51
  59. package/dist/functions/browser/createThrottledEventListener.js.map +0 -1
  60. package/dist/functions/browser/demonstrateResourceLoading.d.ts +0 -32
  61. package/dist/functions/browser/demonstrateResourceLoading.js +0 -169
  62. package/dist/functions/browser/demonstrateResourceLoading.js.map +0 -1
  63. package/dist/functions/browser/detectOverflow.d.ts +0 -12
  64. package/dist/functions/browser/detectOverflow.js +0 -17
  65. package/dist/functions/browser/detectOverflow.js.map +0 -1
  66. package/dist/functions/browser/getAlignment.d.ts +0 -2
  67. package/dist/functions/browser/getAlignment.js +0 -5
  68. package/dist/functions/browser/getAlignment.js.map +0 -1
  69. package/dist/functions/browser/getBasePlacement.d.ts +0 -2
  70. package/dist/functions/browser/getBasePlacement.js +0 -4
  71. package/dist/functions/browser/getBasePlacement.js.map +0 -1
  72. package/dist/functions/browser/getCrossAxisFlip.d.ts +0 -2
  73. package/dist/functions/browser/getCrossAxisFlip.js +0 -11
  74. package/dist/functions/browser/getCrossAxisFlip.js.map +0 -1
  75. package/dist/functions/browser/getElementRect.d.ts +0 -3
  76. package/dist/functions/browser/getElementRect.js +0 -14
  77. package/dist/functions/browser/getElementRect.js.map +0 -1
  78. package/dist/functions/browser/getFlipPlacements.d.ts +0 -2
  79. package/dist/functions/browser/getFlipPlacements.js +0 -13
  80. package/dist/functions/browser/getFlipPlacements.js.map +0 -1
  81. package/dist/functions/browser/getMainAxisFlip.d.ts +0 -2
  82. package/dist/functions/browser/getMainAxisFlip.js +0 -17
  83. package/dist/functions/browser/getMainAxisFlip.js.map +0 -1
  84. package/dist/functions/browser/getRelativePosition.d.ts +0 -3
  85. package/dist/functions/browser/getRelativePosition.js +0 -14
  86. package/dist/functions/browser/getRelativePosition.js.map +0 -1
  87. package/dist/functions/browser/getViewportRect.d.ts +0 -7
  88. package/dist/functions/browser/getViewportRect.js +0 -15
  89. package/dist/functions/browser/getViewportRect.js.map +0 -1
  90. package/dist/functions/browser/isValidPlacement.d.ts +0 -2
  91. package/dist/functions/browser/isValidPlacement.js +0 -16
  92. package/dist/functions/browser/isValidPlacement.js.map +0 -1
  93. package/dist/functions/browser/pickFile.d.ts +0 -15
  94. package/dist/functions/browser/pickFile.js +0 -48
  95. package/dist/functions/browser/pickFile.js.map +0 -1
  96. package/dist/functions/build/generateExports.d.ts +0 -26
  97. package/dist/functions/build/generateExports.js +0 -34
  98. package/dist/functions/build/generateExports.js.map +0 -1
  99. package/dist/functions/core/diff/diff.d.ts +0 -25
  100. package/dist/functions/core/diff/diff.js +0 -316
  101. package/dist/functions/core/diff/diff.js.map +0 -1
  102. package/dist/functions/core/diff/vueDiff.d.ts +0 -38
  103. package/dist/functions/core/diff/vueDiff.js +0 -333
  104. package/dist/functions/core/diff/vueDiff.js.map +0 -1
  105. package/dist/functions/core/generator/generatorUtils.d.ts +0 -16
  106. package/dist/functions/core/generator/generatorUtils.js +0 -139
  107. package/dist/functions/core/generator/generatorUtils.js.map +0 -1
  108. package/dist/functions/core/type/isType.d.ts +0 -11
  109. package/dist/functions/core/type/isType.js +0 -30
  110. package/dist/functions/core/type/isType.js.map +0 -1
  111. package/dist/functions/data/array-object/chunk.d.ts +0 -1
  112. package/dist/functions/data/array-object/chunk.js +0 -11
  113. package/dist/functions/data/array-object/chunk.js.map +0 -1
  114. package/dist/functions/data/array-object/deepClone.d.ts +0 -12
  115. package/dist/functions/data/array-object/deepClone.js +0 -131
  116. package/dist/functions/data/array-object/deepClone.js.map +0 -1
  117. package/dist/functions/data/array-object/evolve.d.ts +0 -3
  118. package/dist/functions/data/array-object/evolve.js +0 -15
  119. package/dist/functions/data/array-object/evolve.js.map +0 -1
  120. package/dist/functions/data/array-object/flatten.d.ts +0 -7
  121. package/dist/functions/data/array-object/flatten.js +0 -60
  122. package/dist/functions/data/array-object/flatten.js.map +0 -1
  123. package/dist/functions/data/array-object/flattenObject.d.ts +0 -5
  124. package/dist/functions/data/array-object/flattenObject.js +0 -102
  125. package/dist/functions/data/array-object/flattenObject.js.map +0 -1
  126. package/dist/functions/data/array-object/groupBy.d.ts +0 -1
  127. package/dist/functions/data/array-object/groupBy.js +0 -14
  128. package/dist/functions/data/array-object/groupBy.js.map +0 -1
  129. package/dist/functions/data/array-object/omit.d.ts +0 -1
  130. package/dist/functions/data/array-object/omit.js +0 -8
  131. package/dist/functions/data/array-object/omit.js.map +0 -1
  132. package/dist/functions/data/array-object/pick.d.ts +0 -1
  133. package/dist/functions/data/array-object/pick.js +0 -10
  134. package/dist/functions/data/array-object/pick.js.map +0 -1
  135. package/dist/functions/data/array-object/shuffle.d.ts +0 -1
  136. package/dist/functions/data/array-object/shuffle.js +0 -9
  137. package/dist/functions/data/array-object/shuffle.js.map +0 -1
  138. package/dist/functions/data/array-object/sortBy.d.ts +0 -1
  139. package/dist/functions/data/array-object/sortBy.js +0 -13
  140. package/dist/functions/data/array-object/sortBy.js.map +0 -1
  141. package/dist/functions/data/array-object/unique.d.ts +0 -10
  142. package/dist/functions/data/array-object/unique.js +0 -85
  143. package/dist/functions/data/array-object/unique.js.map +0 -1
  144. package/dist/functions/data/date/dateRange.d.ts +0 -1
  145. package/dist/functions/data/date/dateRange.js +0 -18
  146. package/dist/functions/data/date/dateRange.js.map +0 -1
  147. package/dist/functions/data/date/formatDate.d.ts +0 -1
  148. package/dist/functions/data/date/formatDate.js +0 -21
  149. package/dist/functions/data/date/formatDate.js.map +0 -1
  150. package/dist/functions/data/date/timeAgo.d.ts +0 -1
  151. package/dist/functions/data/date/timeAgo.js +0 -49
  152. package/dist/functions/data/date/timeAgo.js.map +0 -1
  153. package/dist/functions/data/number/average.d.ts +0 -1
  154. package/dist/functions/data/number/average.js +0 -8
  155. package/dist/functions/data/number/average.js.map +0 -1
  156. package/dist/functions/data/number/clamp.d.ts +0 -1
  157. package/dist/functions/data/number/clamp.js +0 -7
  158. package/dist/functions/data/number/clamp.js.map +0 -1
  159. package/dist/functions/data/number/formatNumber.d.ts +0 -8
  160. package/dist/functions/data/number/formatNumber.js +0 -16
  161. package/dist/functions/data/number/formatNumber.js.map +0 -1
  162. package/dist/functions/data/number/median.d.ts +0 -1
  163. package/dist/functions/data/number/median.js +0 -14
  164. package/dist/functions/data/number/median.js.map +0 -1
  165. package/dist/functions/data/number/percentile.d.ts +0 -1
  166. package/dist/functions/data/number/percentile.js +0 -18
  167. package/dist/functions/data/number/percentile.js.map +0 -1
  168. package/dist/functions/data/number/random.d.ts +0 -4
  169. package/dist/functions/data/number/random.js +0 -9
  170. package/dist/functions/data/number/random.js.map +0 -1
  171. package/dist/functions/data/number/range.d.ts +0 -1
  172. package/dist/functions/data/number/range.js +0 -18
  173. package/dist/functions/data/number/range.js.map +0 -1
  174. package/dist/functions/data/number/sum.d.ts +0 -1
  175. package/dist/functions/data/number/sum.js +0 -4
  176. package/dist/functions/data/number/sum.js.map +0 -1
  177. package/dist/functions/data/randomRegion.d.ts +0 -24
  178. package/dist/functions/data/randomRegion.js +0 -74
  179. package/dist/functions/data/randomRegion.js.map +0 -1
  180. package/dist/functions/data/string/base64.d.ts +0 -5
  181. package/dist/functions/data/string/base64.js +0 -6
  182. package/dist/functions/data/string/base64.js.map +0 -1
  183. package/dist/functions/data/string/capitalize.d.ts +0 -1
  184. package/dist/functions/data/string/capitalize.js +0 -6
  185. package/dist/functions/data/string/capitalize.js.map +0 -1
  186. package/dist/functions/data/string/caseConverter.d.ts +0 -19
  187. package/dist/functions/data/string/caseConverter.js +0 -94
  188. package/dist/functions/data/string/caseConverter.js.map +0 -1
  189. package/dist/functions/data/string/desensitize.d.ts +0 -13
  190. package/dist/functions/data/string/desensitize.js +0 -107
  191. package/dist/functions/data/string/desensitize.js.map +0 -1
  192. package/dist/functions/data/string/htmlEscape.d.ts +0 -20
  193. package/dist/functions/data/string/htmlEscape.js +0 -80
  194. package/dist/functions/data/string/htmlEscape.js.map +0 -1
  195. package/dist/functions/data/string/levenshtein.d.ts +0 -1
  196. package/dist/functions/data/string/levenshtein.js +0 -27
  197. package/dist/functions/data/string/levenshtein.js.map +0 -1
  198. package/dist/functions/data/string/normalize.d.ts +0 -8
  199. package/dist/functions/data/string/normalize.js +0 -37
  200. package/dist/functions/data/string/normalize.js.map +0 -1
  201. package/dist/functions/data/string/pad.d.ts +0 -13
  202. package/dist/functions/data/string/pad.js +0 -50
  203. package/dist/functions/data/string/pad.js.map +0 -1
  204. package/dist/functions/data/string/palindrome.d.ts +0 -3
  205. package/dist/functions/data/string/palindrome.js +0 -15
  206. package/dist/functions/data/string/palindrome.js.map +0 -1
  207. package/dist/functions/data/string/similarity.d.ts +0 -1
  208. package/dist/functions/data/string/similarity.js +0 -13
  209. package/dist/functions/data/string/similarity.js.map +0 -1
  210. package/dist/functions/data/string/template.d.ts +0 -4
  211. package/dist/functions/data/string/template.js +0 -21
  212. package/dist/functions/data/string/template.js.map +0 -1
  213. package/dist/functions/data/string/testRegex.d.ts +0 -20
  214. package/dist/functions/data/string/testRegex.js +0 -300
  215. package/dist/functions/data/string/testRegex.js.map +0 -1
  216. package/dist/functions/data/string/wordCount.d.ts +0 -5
  217. package/dist/functions/data/string/wordCount.js +0 -11
  218. package/dist/functions/data/string/wordCount.js.map +0 -1
  219. package/dist/functions/data/tree/buildTree.d.ts +0 -7
  220. package/dist/functions/data/tree/buildTree.js +0 -27
  221. package/dist/functions/data/tree/buildTree.js.map +0 -1
  222. package/dist/functions/data/tree/filterTree.d.ts +0 -4
  223. package/dist/functions/data/tree/filterTree.js +0 -21
  224. package/dist/functions/data/tree/filterTree.js.map +0 -1
  225. package/dist/functions/data/tree/findNode.d.ts +0 -4
  226. package/dist/functions/data/tree/findNode.js +0 -21
  227. package/dist/functions/data/tree/findNode.js.map +0 -1
  228. package/dist/functions/data/tree/flattenTree.d.ts +0 -6
  229. package/dist/functions/data/tree/flattenTree.js +0 -21
  230. package/dist/functions/data/tree/flattenTree.js.map +0 -1
  231. package/dist/functions/file/walk.d.ts +0 -18
  232. package/dist/functions/file/walk.js +0 -58
  233. package/dist/functions/file/walk.js.map +0 -1
  234. package/dist/functions/hybrid/detectBridgeEnvironment.d.ts +0 -11
  235. package/dist/functions/hybrid/detectBridgeEnvironment.js +0 -26
  236. package/dist/functions/hybrid/detectBridgeEnvironment.js.map +0 -1
  237. package/dist/functions/integrations/ag-grid/generateLicense.d.ts +0 -7
  238. package/dist/functions/integrations/ag-grid/generateLicense.js +0 -12
  239. package/dist/functions/integrations/ag-grid/generateLicense.js.map +0 -1
  240. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.d.ts +0 -30
  241. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js +0 -884
  242. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js.map +0 -1
  243. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.d.ts +0 -31
  244. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js +0 -900
  245. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js.map +0 -1
  246. package/dist/functions/integrations/uniapp/build.d.ts +0 -21
  247. package/dist/functions/integrations/uniapp/build.js +0 -83
  248. package/dist/functions/integrations/uniapp/build.js.map +0 -1
  249. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.d.ts +0 -11
  250. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js +0 -30
  251. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js.map +0 -1
  252. package/dist/functions/integrations/uniapp/detectProjectType.d.ts +0 -20
  253. package/dist/functions/integrations/uniapp/detectProjectType.js +0 -68
  254. package/dist/functions/integrations/uniapp/detectProjectType.js.map +0 -1
  255. package/dist/functions/integrations/uniapp/parseManifest.d.ts +0 -20
  256. package/dist/functions/integrations/uniapp/parseManifest.js +0 -51
  257. package/dist/functions/integrations/uniapp/parseManifest.js.map +0 -1
  258. package/dist/functions/integrations/uniapp/waitForPages.d.ts +0 -7
  259. package/dist/functions/integrations/uniapp/waitForPages.js +0 -20
  260. package/dist/functions/integrations/uniapp/waitForPages.js.map +0 -1
  261. package/dist/functions/integrations/vue/dynamicMount.d.ts +0 -18
  262. package/dist/functions/integrations/vue/dynamicMount.js +0 -25
  263. package/dist/functions/integrations/vue/dynamicMount.js.map +0 -1
  264. package/dist/functions/integrations/vue/extractColorsFromVueFile.d.ts +0 -3
  265. package/dist/functions/integrations/vue/extractColorsFromVueFile.js +0 -18
  266. package/dist/functions/integrations/vue/extractColorsFromVueFile.js.map +0 -1
  267. package/dist/functions/integrations/vue/extractColorsFromVueSection.d.ts +0 -3
  268. package/dist/functions/integrations/vue/extractColorsFromVueSection.js +0 -53
  269. package/dist/functions/integrations/vue/extractColorsFromVueSection.js.map +0 -1
  270. package/dist/functions/integrations/vue/filterSections.d.ts +0 -2
  271. package/dist/functions/integrations/vue/filterSections.js +0 -11
  272. package/dist/functions/integrations/vue/filterSections.js.map +0 -1
  273. package/dist/functions/integrations/vue/isVNode.d.ts +0 -2
  274. package/dist/functions/integrations/vue/isVNode.js +0 -6
  275. package/dist/functions/integrations/vue/isVNode.js.map +0 -1
  276. package/dist/functions/integrations/vue/isVueComponent.d.ts +0 -2
  277. package/dist/functions/integrations/vue/isVueComponent.js +0 -6
  278. package/dist/functions/integrations/vue/isVueComponent.js.map +0 -1
  279. package/dist/functions/integrations/vue/parseVueFile.d.ts +0 -2
  280. package/dist/functions/integrations/vue/parseVueFile.js +0 -53
  281. package/dist/functions/integrations/vue/parseVueFile.js.map +0 -1
  282. package/dist/functions/integrations/wechat/miniapp/downloadFile.d.ts +0 -6
  283. package/dist/functions/integrations/wechat/miniapp/downloadFile.js +0 -39
  284. package/dist/functions/integrations/wechat/miniapp/downloadFile.js.map +0 -1
  285. package/dist/functions/patterns/MyPromise.d.ts +0 -32
  286. package/dist/functions/patterns/MyPromise.js +0 -254
  287. package/dist/functions/patterns/MyPromise.js.map +0 -1
  288. package/dist/functions/patterns/functionBind.d.ts +0 -4
  289. package/dist/functions/patterns/functionBind.js +0 -33
  290. package/dist/functions/patterns/functionBind.js.map +0 -1
  291. package/dist/functions/patterns/myInstanceof.d.ts +0 -5
  292. package/dist/functions/patterns/myInstanceof.js +0 -56
  293. package/dist/functions/patterns/myInstanceof.js.map +0 -1
  294. package/dist/functions/patterns/myNew.d.ts +0 -3
  295. package/dist/functions/patterns/myNew.js +0 -19
  296. package/dist/functions/patterns/myNew.js.map +0 -1
  297. package/dist/functions/platform/android/buildProject.d.ts +0 -13
  298. package/dist/functions/platform/android/buildProject.js +0 -122
  299. package/dist/functions/platform/android/buildProject.js.map +0 -1
  300. package/dist/functions/platform/android/configureAppIcon.d.ts +0 -17
  301. package/dist/functions/platform/android/configureAppIcon.js +0 -106
  302. package/dist/functions/platform/android/configureAppIcon.js.map +0 -1
  303. package/dist/functions/platform/android/configureLaunchScreen.d.ts +0 -21
  304. package/dist/functions/platform/android/configureLaunchScreen.js +0 -328
  305. package/dist/functions/platform/android/configureLaunchScreen.js.map +0 -1
  306. package/dist/functions/platform/android/detectAndroidModules.d.ts +0 -8
  307. package/dist/functions/platform/android/detectAndroidModules.js +0 -21
  308. package/dist/functions/platform/android/detectAndroidModules.js.map +0 -1
  309. package/dist/functions/platform/android/integrateFacebookLogin.d.ts +0 -12
  310. package/dist/functions/platform/android/integrateFacebookLogin.js +0 -91
  311. package/dist/functions/platform/android/integrateFacebookLogin.js.map +0 -1
  312. package/dist/functions/platform/android/integrateGoogleLogin.d.ts +0 -10
  313. package/dist/functions/platform/android/integrateGoogleLogin.js +0 -199
  314. package/dist/functions/platform/android/integrateGoogleLogin.js.map +0 -1
  315. package/dist/functions/platform/android/integrateMiuiLogin.d.ts +0 -13
  316. package/dist/functions/platform/android/integrateMiuiLogin.js +0 -115
  317. package/dist/functions/platform/android/integrateMiuiLogin.js.map +0 -1
  318. package/dist/functions/platform/android/integrateQQLogin.d.ts +0 -12
  319. package/dist/functions/platform/android/integrateQQLogin.js +0 -130
  320. package/dist/functions/platform/android/integrateQQLogin.js.map +0 -1
  321. package/dist/functions/platform/android/integrateShareTrace.d.ts +0 -10
  322. package/dist/functions/platform/android/integrateShareTrace.js +0 -181
  323. package/dist/functions/platform/android/integrateShareTrace.js.map +0 -1
  324. package/dist/functions/platform/android/integrateSinaLogin.d.ts +0 -13
  325. package/dist/functions/platform/android/integrateSinaLogin.js +0 -85
  326. package/dist/functions/platform/android/integrateSinaLogin.js.map +0 -1
  327. package/dist/functions/platform/android/integrateThirdPartyModule.d.ts +0 -46
  328. package/dist/functions/platform/android/integrateThirdPartyModule.js +0 -251
  329. package/dist/functions/platform/android/integrateThirdPartyModule.js.map +0 -1
  330. package/dist/functions/platform/android/integrateUniAppNativePlugin.d.ts +0 -22
  331. package/dist/functions/platform/android/integrateUniAppNativePlugin.js +0 -631
  332. package/dist/functions/platform/android/integrateUniAppNativePlugin.js.map +0 -1
  333. package/dist/functions/platform/android/integrateUniverifyLogin.d.ts +0 -11
  334. package/dist/functions/platform/android/integrateUniverifyLogin.js +0 -314
  335. package/dist/functions/platform/android/integrateUniverifyLogin.js.map +0 -1
  336. package/dist/functions/platform/android/integrateWechatLogin.d.ts +0 -13
  337. package/dist/functions/platform/android/integrateWechatLogin.js +0 -154
  338. package/dist/functions/platform/android/integrateWechatLogin.js.map +0 -1
  339. package/dist/functions/platform/android/integrateWechatShare.d.ts +0 -13
  340. package/dist/functions/platform/android/integrateWechatShare.js +0 -154
  341. package/dist/functions/platform/android/integrateWechatShare.js.map +0 -1
  342. package/dist/functions/platform/android/modifyGradle.d.ts +0 -28
  343. package/dist/functions/platform/android/modifyGradle.js +0 -119
  344. package/dist/functions/platform/android/modifyGradle.js.map +0 -1
  345. package/dist/functions/platform/android/modifyManifest.d.ts +0 -39
  346. package/dist/functions/platform/android/modifyManifest.js +0 -225
  347. package/dist/functions/platform/android/modifyManifest.js.map +0 -1
  348. package/dist/functions/platform/android/permission.d.ts +0 -54
  349. package/dist/functions/platform/android/permission.js +0 -85
  350. package/dist/functions/platform/android/permission.js.map +0 -1
  351. package/dist/functions/platform/ios/configureAppIcon.d.ts +0 -17
  352. package/dist/functions/platform/ios/configureAppIcon.js +0 -149
  353. package/dist/functions/platform/ios/configureAppIcon.js.map +0 -1
  354. package/dist/functions/platform/ios/configureLaunchScreen.d.ts +0 -17
  355. package/dist/functions/platform/ios/configureLaunchScreen.js +0 -150
  356. package/dist/functions/platform/ios/configureLaunchScreen.js.map +0 -1
  357. package/dist/functions/platform/ios/configurePermissions.d.ts +0 -19
  358. package/dist/functions/platform/ios/configurePermissions.js +0 -120
  359. package/dist/functions/platform/ios/configurePermissions.js.map +0 -1
  360. package/dist/functions/platform/ios/integrateNativePlugin.d.ts +0 -35
  361. package/dist/functions/platform/ios/integrateNativePlugin.js +0 -994
  362. package/dist/functions/platform/ios/integrateNativePlugin.js.map +0 -1
  363. package/dist/functions/platform/ios/integrateQQShare.d.ts +0 -14
  364. package/dist/functions/platform/ios/integrateQQShare.js +0 -132
  365. package/dist/functions/platform/ios/integrateQQShare.js.map +0 -1
  366. package/dist/functions/platform/ios/integrateSinaShare.d.ts +0 -16
  367. package/dist/functions/platform/ios/integrateSinaShare.js +0 -108
  368. package/dist/functions/platform/ios/integrateSinaShare.js.map +0 -1
  369. package/dist/functions/platform/ios/integrateThirdPartyModule.d.ts +0 -62
  370. package/dist/functions/platform/ios/integrateThirdPartyModule.js +0 -883
  371. package/dist/functions/platform/ios/integrateThirdPartyModule.js.map +0 -1
  372. package/dist/functions/platform/ios/integrateWechatOauth.d.ts +0 -14
  373. package/dist/functions/platform/ios/integrateWechatOauth.js +0 -107
  374. package/dist/functions/platform/ios/integrateWechatOauth.js.map +0 -1
  375. package/dist/functions/platform/ios/integrateWechatShare.d.ts +0 -14
  376. package/dist/functions/platform/ios/integrateWechatShare.js +0 -101
  377. package/dist/functions/platform/ios/integrateWechatShare.js.map +0 -1
  378. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.d.ts +0 -2
  379. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js +0 -45
  380. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js.map +0 -1
  381. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.d.ts +0 -16
  382. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js +0 -136
  383. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js.map +0 -1
  384. package/dist/functions/platform/ios/useAltool.d.ts +0 -39
  385. package/dist/functions/platform/ios/useAltool.js +0 -350
  386. package/dist/functions/platform/ios/useAltool.js.map +0 -1
  387. package/dist/functions/software/publishToPgyer.d.ts +0 -16
  388. package/dist/functions/software/publishToPgyer.js +0 -96
  389. package/dist/functions/software/publishToPgyer.js.map +0 -1
  390. package/dist/functions/style/buildTokens.d.ts +0 -76
  391. package/dist/functions/style/buildTokens.js +0 -183
  392. package/dist/functions/style/buildTokens.js.map +0 -1
  393. package/dist/functions/style/extractCssVariables.d.ts +0 -16
  394. package/dist/functions/style/extractCssVariables.js +0 -256
  395. package/dist/functions/style/extractCssVariables.js.map +0 -1
  396. package/dist/functions/style/generateVariables.d.ts +0 -7
  397. package/dist/functions/style/generateVariables.js +0 -135
  398. package/dist/functions/style/generateVariables.js.map +0 -1
  399. package/dist/functions/style/mixColors.d.ts +0 -1
  400. package/dist/functions/style/mixColors.js +0 -38
  401. package/dist/functions/style/mixColors.js.map +0 -1
  402. package/dist/functions/style/parseDesignTokens.d.ts +0 -10
  403. package/dist/functions/style/parseDesignTokens.js +0 -216
  404. package/dist/functions/style/parseDesignTokens.js.map +0 -1
  405. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.d.ts +0 -3
  406. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js +0 -509
  407. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js.map +0 -1
  408. package/dist/functions/uniapp/app-plus/buildIOSPlugin.d.ts +0 -3
  409. package/dist/functions/uniapp/app-plus/buildIOSPlugin.js +0 -406
  410. package/dist/functions/uniapp/app-plus/buildIOSPlugin.js.map +0 -1
  411. package/dist/functions/validation/generateFakeBankCard.d.ts +0 -87
  412. package/dist/functions/validation/generateFakeBankCard.js +0 -152
  413. package/dist/functions/validation/generateFakeBankCard.js.map +0 -1
  414. package/dist/functions/validation/generateFakeBusinessLicense.d.ts +0 -21
  415. package/dist/functions/validation/generateFakeBusinessLicense.js +0 -160
  416. package/dist/functions/validation/generateFakeBusinessLicense.js.map +0 -1
  417. package/dist/functions/validation/generateFakeDrivingLicense.d.ts +0 -31
  418. package/dist/functions/validation/generateFakeDrivingLicense.js +0 -119
  419. package/dist/functions/validation/generateFakeDrivingLicense.js.map +0 -1
  420. package/dist/functions/validation/generateFakeIdCard.d.ts +0 -30
  421. package/dist/functions/validation/generateFakeIdCard.js +0 -123
  422. package/dist/functions/validation/generateFakeIdCard.js.map +0 -1
  423. package/dist/functions/validation/generateFakeLicensePlate.d.ts +0 -13
  424. package/dist/functions/validation/generateFakeLicensePlate.js +0 -87
  425. package/dist/functions/validation/generateFakeLicensePlate.js.map +0 -1
  426. package/dist/functions/validation/parseJwtPayload.d.ts +0 -7
  427. package/dist/functions/validation/parseJwtPayload.js +0 -33
  428. package/dist/functions/validation/parseJwtPayload.js.map +0 -1
  429. package/dist/functions/validation/validate.d.ts +0 -11
  430. package/dist/functions/validation/validate.js +0 -44
  431. package/dist/functions/validation/validate.js.map +0 -1
@@ -4,9 +4,18 @@
4
4
  * 与接口 JSON 形状不同,后者见 `zcw-shared/types/im-api`(`ImApiMessage` / `ImApiConversation`)。
5
5
  * 在仓库层做 `ImApiMessage` → `ChatMessage` 的映射即可两端共类型、各层语义清晰。
6
6
  */
7
+ import type { ImMessageDisplaySpec } from './im-message-display'
8
+
9
+ /** 与 `ImMessage.extra_data.attachments[]` 对齐的列表项(会话消息内联附件) */
10
+ export interface ChatInlineAttachmentListItem {
11
+ url: string
12
+ name?: string
13
+ mimeType?: string
14
+ }
15
+
7
16
  export interface ChatMessage {
8
17
  id: string
9
- type: 'text' | 'image' | 'video' | 'voice' | 'file'
18
+ type: 'text' | 'markdown' | 'image' | 'video' | 'voice' | 'file'
10
19
  content: string
11
20
  timestamp: Date
12
21
  sender: {
@@ -25,18 +34,40 @@ export interface ChatMessage {
25
34
  mediaUploadStatus?: 'uploading' | 'uploaded' | 'failed'
26
35
  /** 本地上传 0–100;仅在前端写入,用于 OSS 上传进度 */
27
36
  mediaUploadProgress?: number
37
+ /**
38
+ * 媒体出站细分阶段:登记接口尚未返回时没有 OSS 字节进度,勿与实际上传百分比混淆。
39
+ * server_storage:客户端向 COS 直传时的占位阶段(如 PUT 已发出、等待完成回调)。
40
+ */
41
+ mediaUploadPhase?: 'registering' | 'oss' | 'server_storage'
28
42
  /** 终端幂等 id,与 ImApiMessage.client_message_id 一致 */
29
43
  clientMessageId?: string
30
44
  /** 媒体登记时原名(content 尚为空时用于文件气泡标题) */
31
45
  mediaOriginalFileName?: string
46
+ /** 文件体积(字节),来自 extra_data.size_bytes 等 */
47
+ mediaFileSizeBytes?: number
32
48
  /** 图片/视频缩略图 URL;存在时列表气泡优先展示缩略图 */
33
49
  mediaThumbnailUrl?: string
34
50
  /** 气泡内展示用的原始像素宽(如 extra_data.location_x / image_width) */
35
51
  mediaWidth?: number
36
52
  /** 气泡内展示用的原始像素高 */
37
53
  mediaHeight?: number
54
+ /**
55
+ * 与正文同条的附件数量(ImMessage.extra_data.attachments,非独立 image/file 气泡)
56
+ */
57
+ inlineAttachmentCount?: number
58
+ /** 与 `extra_data.attachments` 同步的只读列表(用于附件列表弹窗等) */
59
+ inlineAttachments?: ChatInlineAttachmentListItem[]
60
+ /**
61
+ * `extra_data.im_display`:多段气泡(图文混排等);存在时气泡层优先按块渲染。
62
+ */
63
+ displaySpec?: ImMessageDisplaySpec
64
+ /** 智能体代理失败且服务端声明可重试时,由前端写入,展示「点击重试」 */
65
+ agentProxyRetryable?: boolean
66
+ /** 代理失败时的错误文案(如库不可用、ENOTFOUND) */
67
+ agentProxyError?: string
38
68
  }
39
69
 
70
+
40
71
  export interface ChatConversation {
41
72
  id: string
42
73
  name: string
@@ -46,4 +77,16 @@ export interface ChatConversation {
46
77
  timestamp?: Date
47
78
  unreadCount?: number
48
79
  isOnline?: boolean
80
+ /** 会话成员人数;大于 2 时为多人会话(多人文气泡、@、管理入口等) */
81
+ memberCount: number
82
+ /** 会话创建者 userId */
83
+ createdBy?: string
84
+ /** 会话管理员(含创建者;默认可仅一人) */
85
+ adminIds?: string[]
86
+ /** 会话公告 */
87
+ announcement?: string
88
+ /** 会话置顶(仅客户端 IndexedDB,右键菜单) */
89
+ pinned?: boolean
90
+ /** 消息免打扰:列表不展示未读红点(仅客户端) */
91
+ muted?: boolean
49
92
  }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * IM 消息「多段展示」:落库在 `ImApiMessage.extra_data.im_display`。
3
+ *
4
+ * - **v1**:结构化块 kind + 固定字段
5
+ * - **v2**:配置驱动,按路径从 JSON 取值填入各渲染器 props
6
+ */
7
+
8
+ /** ---------- v1 ---------- */
9
+
10
+ /** 已解析的展示块 */
11
+ export type ImDisplayBlock =
12
+ | { kind: 'text'; text: string }
13
+ | { kind: 'image'; url: string; width?: number; height?: number }
14
+ | { kind: 'video'; url: string; posterUrl?: string; width?: number; height?: number }
15
+ | { kind: 'file'; url: string; name?: string; sizeBytes?: number }
16
+
17
+ export interface ImMessageDisplaySpecV1 {
18
+ version: 1
19
+ blocks: ImDisplayBlock[]
20
+ }
21
+
22
+ /** v1 模板(version 省略或 1) */
23
+ export type ImDisplayBlockTemplate =
24
+ | { kind: 'text'; text: string }
25
+ | {
26
+ kind: 'image'
27
+ urlPath: string[]
28
+ widthPath?: string[]
29
+ heightPath?: string[]
30
+ }
31
+ | {
32
+ kind: 'video'
33
+ urlPath: string[]
34
+ posterPath?: string[]
35
+ widthPath?: string[]
36
+ heightPath?: string[]
37
+ }
38
+ | { kind: 'file'; urlPath: string[]; namePath?: string[]; sizePath?: string[] }
39
+
40
+ export interface ImToolMessageFormatConfigV1 {
41
+ version: 1
42
+ blocks: ImDisplayBlockTemplate[]
43
+ }
44
+
45
+ /** ---------- v2(配置驱动) ---------- */
46
+
47
+ /** 单 prop 绑定:路径 + 可选强制类型 */
48
+ export type ImPropBinding =
49
+ | string[]
50
+ | {
51
+ path: string[]
52
+ /** 默认 string;url 会校验 http(s);positiveInt 为 1~65536 像素或非负整数(文件大小用 number) */
53
+ coerce?: 'string' | 'url' | 'positiveInt' | 'number'
54
+ }
55
+
56
+ /**
57
+ * 渲染器 type 白名单(与 vue-ui 注册表一致):
58
+ * - im.text → content
59
+ * - im.markdown → content(Markdown 源文本,由 CwMarkdown 渲染)
60
+ * - im.image → thumbnailUrl, width?, height?
61
+ * - im.video → videoUrl, thumbnailUrl?, width?, height?
62
+ * - im.file → downloadUrl, originalFileName?, fileSizeBytes?
63
+ */
64
+ export interface ImToolMessageFormatBlockV2 {
65
+ type: string
66
+ propsFromResult: Record<string, ImPropBinding>
67
+ }
68
+
69
+ export interface ImToolMessageFormatConfigV2 {
70
+ version: 2
71
+ blocks: ImToolMessageFormatBlockV2[]
72
+ }
73
+
74
+ /** 写入 im_display 的块(props 已展开) */
75
+ export interface ImFormattedDisplayBlock {
76
+ type: string
77
+ props: Record<string, unknown>
78
+ }
79
+
80
+ export interface ImMessageDisplaySpecV2 {
81
+ version: 2
82
+ blocks: ImFormattedDisplayBlock[]
83
+ }
84
+
85
+ export type ImMessageDisplaySpec = ImMessageDisplaySpecV1 | ImMessageDisplaySpecV2
86
+
87
+ export type ImToolMessageFormatConfig =
88
+ | ImToolMessageFormatConfigV1
89
+ | ImToolMessageFormatConfigV2
@@ -108,6 +108,34 @@ export interface FacebookLoginOptions {
108
108
  oauthAarPath: string
109
109
  }
110
110
 
111
+ /**
112
+ * uniPush 配置(Android 离线打包,HBuilderX 3.99+ 默认 maven 方式)
113
+ *
114
+ * @see https://nativesupport.dcloud.net.cn/AppDocs/usemodule/androidModuleConfig/push.html
115
+ */
116
+ export interface UniPushAndroidOptions {
117
+ /** uniPush AppId */
118
+ appId: string
119
+ /** uniPush AppKey */
120
+ appKey: string
121
+ /** uniPush AppSecret */
122
+ appSecret: string
123
+ /** maven(默认):根工程加个推仓 + gtsdk/gtc-dcloud;aar:仅拷贝本地 aar */
124
+ integrationMode?: 'maven' | 'aar'
125
+ /** aar 模式:SDK/libs 等待拷贝的 aar/jar 列表 */
126
+ aarLibFiles?: Array<{ source: string; targetName?: string }>
127
+ /** maven 模式额外 implementation 整行 */
128
+ extraMavenDependencies?: string[]
129
+ /** maven 是否写入文档中的空厂商 manifestPlaceholders 键,默认 true */
130
+ includeDefaultOemPlaceholderKeys?: boolean
131
+ /** 是否同步 dcloud_properties(Push/unipush/push service),默认 true */
132
+ syncDcloudProperties?: boolean
133
+ /** 是否添加 unipush deep link 的 intent-filter,默认 true */
134
+ addUniPushDeepLinkIntentFilter?: boolean
135
+ /** 是否添加 OPPO 推送 intent-filter,默认 false */
136
+ addOppoPushIntentFilter?: boolean
137
+ }
138
+
111
139
  /**
112
140
  * ShareTrace配置
113
141
  */
@@ -195,6 +223,8 @@ export interface UniAppAndroidBuildOptions extends AndroidBuildOptions {
195
223
  facebookLogin?: FacebookLoginOptions
196
224
  /** ShareTrace配置(可选) */
197
225
  shareTrace?: ShareTraceOptions
226
+ /** uniPush 配置(可选) */
227
+ uniPush?: UniPushAndroidOptions
198
228
  /** UniApp 原生插件配置列表(可选) */
199
229
  nativePlugins?: UniAppNativePluginOptions[]
200
230
  }
@@ -229,4 +259,5 @@ export interface UniAppAndroidPluginBuildOptions extends Omit<UniAppAndroidBuild
229
259
  googleLogin?: never
230
260
  facebookLogin?: never
231
261
  shareTrace?: never
262
+ uniPush?: never
232
263
  }
@@ -78,6 +78,30 @@ export interface SinaShareIOSOptions {
78
78
  weiboSDKBundlePath?: string
79
79
  }
80
80
 
81
+ /**
82
+ * uniPush 配置(iOS 离线打包)
83
+ *
84
+ * @see https://nativesupport.dcloud.net.cn/AppDocs/usemodule/iOSModuleConfig/push.html#unipush
85
+ */
86
+ export interface UniPushIOSOptions {
87
+ /** Info.plist 根节点 `getui` 字典(与开发者后台字段一致,如 appid、appkey、appsecret) */
88
+ getui: Record<string, string>
89
+ /** liblibPush.a 路径 */
90
+ liblibPushPath?: string
91
+ /** libUniPush.a 路径 */
92
+ libUniPushPath?: string
93
+ /** GTSDK.xcframework 路径 */
94
+ gtSdkXcframeworkPath?: string
95
+ /** 是否同步 PandoraApi.bundle/feature.plist 中的 Push 节点为文档标准结构,默认 true */
96
+ syncFeaturePlistPush?: boolean
97
+ /** PandoraApi.bundle 目录;默认 `{projectPath}/{projectName}/PandoraApi.bundle` */
98
+ pandoraApiBundlePath?: string
99
+ /** 是否自动添加文档中的系统 tbd 与框架(含弱链接 UserNotifications),默认 true */
100
+ includeDefaultSystemDependencies?: boolean
101
+ extraSystemFrameworks?: string[]
102
+ extraSystemTbdLibraries?: string[]
103
+ }
104
+
81
105
  /**
82
106
  * Camera/Gallery 配置(iOS)
83
107
  */
@@ -152,6 +176,8 @@ export interface UniAppIOSBuildOptions extends IOSBuildOptions {
152
176
  sinaShare?: SinaShareIOSOptions
153
177
  /** Camera/Gallery 配置(可选) */
154
178
  cameraGallery?: CameraGalleryIOSOptions
179
+ /** uniPush 配置(可选) */
180
+ uniPush?: UniPushIOSOptions
155
181
  /** UniApp 原生插件配置列表(可选) */
156
182
  nativePlugins?: UniAppNativePluginIOSOptions[]
157
183
  /** 源码目录名称(可选,如果 .xcodeproj 文件名与实际源码目录不一致时需要指定,默认从 .xcodeproj 推断) */
package/types/user.d.ts CHANGED
@@ -6,7 +6,8 @@ export interface User {
6
6
  wechat_openid?: string
7
7
  wechat_unionid?: string
8
8
  wechat_nickname?: string
9
- wechat_avatar?: string
9
+ /** 用户头像 URL(微信登录等会写入微信头像) */
10
+ avatar?: string
10
11
  created_at?: string
11
12
  updated_at?: string
12
13
  // 兼容旧字段名
@@ -1,5 +0,0 @@
1
- import type { setTimeout } from '../../../references/timer.d';
2
- export interface SleepDeps {
3
- setTimeout: typeof setTimeout;
4
- }
5
- export declare function sleep(ms: number, deps: SleepDeps): Promise<void>;
@@ -1,6 +0,0 @@
1
- export function sleep(ms, deps) {
2
- return new Promise(resolve => {
3
- deps.setTimeout(resolve, ms);
4
- });
5
- }
6
- //# sourceMappingURL=sleep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../src/functions/async/sleep.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,KAAK,CAAC,EAAU,EAAE,IAAe;IAC/C,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { setTimeout, clearTimeout } from '../../../references/timer.d';
2
- export interface TimeoutDeps {
3
- setTimeout: typeof setTimeout;
4
- clearTimeout: typeof clearTimeout;
5
- }
6
- export declare function timeout<T>(promise: Promise<T>, ms: number, deps: TimeoutDeps): Promise<T>;
@@ -1,12 +0,0 @@
1
- export function timeout(promise, ms, deps) {
2
- let timeoutId;
3
- const timeoutPromise = new Promise((_, reject) => {
4
- timeoutId = deps.setTimeout(() => {
5
- reject(new Error(`Operation timed out after ${ms}ms`));
6
- }, ms);
7
- });
8
- return Promise.race([promise, timeoutPromise]).finally(() => {
9
- deps.clearTimeout(timeoutId);
10
- });
11
- }
12
- //# sourceMappingURL=timeout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../src/functions/async/timeout.ts"],"names":[],"mappings":"AAyCA,MAAM,UAAU,OAAO,CACrB,OAAmB,EACnB,EAAU,EACV,IAAiB;IAEjB,IAAI,SAAc,CAAA;IAElB,MAAM,cAAc,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;QACtD,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YAC/B,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAAC,CAAA;QACxD,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1D,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Placement } from '../../../types/placement';
2
- import type { Rect, Coords } from '../../../types/geometry';
3
- export declare function computePosition(placement: Placement, reference: Rect, floating: {
4
- width: number;
5
- height: number;
6
- }, scrollOffset: Coords): Coords;
@@ -1,49 +0,0 @@
1
- import { getBasePlacement } from './getBasePlacement';
2
- import { getAlignment } from './getAlignment';
3
- export function computePosition(placement, reference, floating, scrollOffset) {
4
- const basePlacement = getBasePlacement(placement);
5
- const alignment = getAlignment(placement);
6
- let x = reference.x;
7
- let y = reference.y;
8
- switch (basePlacement) {
9
- case 'top':
10
- x = x + reference.width / 2 - floating.width / 2;
11
- y = reference.y - floating.height;
12
- break;
13
- case 'bottom':
14
- x = x + reference.width / 2 - floating.width / 2;
15
- y = reference.y + reference.height;
16
- break;
17
- case 'left':
18
- x = x - floating.width;
19
- y = y + reference.height / 2 - floating.height / 2;
20
- break;
21
- case 'right':
22
- x = x + reference.width;
23
- y = y + reference.height / 2 - floating.height / 2;
24
- break;
25
- }
26
- if (alignment) {
27
- if (basePlacement === 'top' || basePlacement === 'bottom') {
28
- if (alignment === 'start') {
29
- x = reference.x;
30
- }
31
- else if (alignment === 'end') {
32
- x = reference.x + reference.width - floating.width;
33
- }
34
- }
35
- else {
36
- if (alignment === 'start') {
37
- y = reference.y;
38
- }
39
- else if (alignment === 'end') {
40
- y = reference.y + reference.height - floating.height;
41
- }
42
- }
43
- }
44
- return {
45
- x: x + scrollOffset.x,
46
- y: y + scrollOffset.y,
47
- };
48
- }
49
- //# sourceMappingURL=computePosition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computePosition.js","sourceRoot":"","sources":["../../../src/functions/browser/computePosition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AA0B7C,MAAM,UAAU,eAAe,CAC7B,SAAoB,EACpB,SAAe,EACf,QAA2C,EAC3C,YAAoB;IAEpB,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;IACjD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;IAGzC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;IACnB,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;IAGnB,QAAQ,aAAa,EAAE,CAAC;QACtB,KAAK,KAAK;YACR,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAA;YAChD,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAA;YACjC,MAAK;QACP,KAAK,QAAQ;YACX,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAA;YAChD,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAA;YAClC,MAAK;QACP,KAAK,MAAM;YACT,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAA;YACtB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;YAClD,MAAK;QACP,KAAK,OAAO;YACV,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAA;YACvB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;YAClD,MAAK;IACT,CAAC;IAGD,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,aAAa,KAAK,KAAK,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;YAE1D,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC1B,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;YACjB,CAAC;iBAAM,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBAC/B,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;YACpD,CAAC;QACH,CAAC;aAAM,CAAC;YAEN,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC1B,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;YACjB,CAAC;iBAAM,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBAC/B,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;YACtD,CAAC;QACH,CAAC;IACH,CAAC;IAGD,OAAO;QACL,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC;QACrB,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC;KACtB,CAAA;AACH,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { Window } from '../../../references/browser.d';
2
- import type { KeyboardEvent } from '../../../references/dom.d';
3
- import type { Console } from '../../../references/console.d';
4
- export type KeyboardEventListener = (event: KeyboardEvent) => void;
5
- export interface KeyboardCenterDeps {
6
- addEventListener: Window['addEventListener'];
7
- removeEventListener: Window['removeEventListener'];
8
- log: Console['log'];
9
- error: Console['error'];
10
- warn: Console['warn'];
11
- }
12
- export interface KeyboardCenter {
13
- subscribe(listener: KeyboardEventListener): () => void;
14
- unsubscribe(listener: KeyboardEventListener): void;
15
- getListenerCount(): number;
16
- isInitialized(): boolean;
17
- }
18
- export declare function createSharedKeyboardCenter(deps: KeyboardCenterDeps): KeyboardCenter;
@@ -1,58 +0,0 @@
1
- import { createEventEmitter } from '../patterns/EventEmitter';
2
- let globalCenter = null;
3
- export function createSharedKeyboardCenter(deps) {
4
- if (globalCenter) {
5
- return globalCenter;
6
- }
7
- const emitter = createEventEmitter({ log: deps.log, error: deps.error, warn: deps.warn }, { maxListeners: 50 });
8
- let isListenerAdded = false;
9
- const listeners = new Set();
10
- const globalKeyboardHandler = (event) => {
11
- if (listeners.size === 0) {
12
- return;
13
- }
14
- listeners.forEach(listener => {
15
- try {
16
- listener(event);
17
- }
18
- catch (error) {
19
- deps.error('[KeyboardCenter] 监听器执行错误:', error);
20
- }
21
- });
22
- };
23
- const center = {
24
- subscribe(listener) {
25
- listeners.add(listener);
26
- emitter.on('keyboard', listener);
27
- if (!isListenerAdded) {
28
- deps.addEventListener('keydown', globalKeyboardHandler, {
29
- passive: true
30
- });
31
- deps.addEventListener('keyup', globalKeyboardHandler, {
32
- passive: true
33
- });
34
- isListenerAdded = true;
35
- deps.log('[KeyboardCenter] 已添加全局键盘监听');
36
- }
37
- return () => {
38
- center.unsubscribe(listener);
39
- };
40
- },
41
- unsubscribe(listener) {
42
- listeners.delete(listener);
43
- emitter.off('keyboard', listener);
44
- if (listeners.size === 0) {
45
- deps.log('[KeyboardCenter] 所有订阅者已移除,但保持全局监听');
46
- }
47
- },
48
- getListenerCount() {
49
- return listeners.size;
50
- },
51
- isInitialized() {
52
- return isListenerAdded;
53
- }
54
- };
55
- globalCenter = center;
56
- return center;
57
- }
58
- //# sourceMappingURL=createSharedKeyboardCenter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSharedKeyboardCenter.js","sourceRoot":"","sources":["../../../src/functions/browser/createSharedKeyboardCenter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAsD3E,IAAI,YAAY,GAA0B,IAAI,CAAA;AAiC9C,MAAM,UAAU,0BAA0B,CAAC,IAAwB;IAEjE,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAA;IACrB,CAAC;IAGD,MAAM,OAAO,GAAG,kBAAkB,CAChC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACrD,EAAE,YAAY,EAAE,EAAE,EAAE,CACrB,CAAA;IAED,IAAI,eAAe,GAAG,KAAK,CAAA;IAC3B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyB,CAAA;IAKlD,MAAM,qBAAqB,GAAG,CAAC,KAAoB,EAAE,EAAE;QAErD,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACzB,OAAM;QACR,CAAC;QAGD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC3B,IAAI,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,CAAA;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAA;YAChD,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,MAAM,GAAmB;QAI7B,SAAS,CAAC,QAA+B;YACvC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;YAGhC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,qBAAsC,EAAE;oBACvE,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;gBACF,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,qBAAsC,EAAE;oBACrE,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;gBACF,eAAe,GAAG,IAAI,CAAA;gBACtB,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;YACxC,CAAC;YAGD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;YAC9B,CAAC,CAAA;QACH,CAAC;QAKD,WAAW,CAAC,QAA+B;YACzC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC1B,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;YAIjC,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;QAKD,gBAAgB;YACd,OAAO,SAAS,CAAC,IAAI,CAAA;QACvB,CAAC;QAKD,aAAa;YACX,OAAO,eAAe,CAAA;QACxB,CAAC;KACF,CAAA;IAGD,YAAY,GAAG,MAAM,CAAA;IAErB,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Window } from '../../../references/browser.d';
2
- import type { setTimeout, clearTimeout } from '../../../references/timer.d';
3
- export type ThrottledEventType = 'resize' | 'scroll' | 'mousemove' | 'touchmove' | 'pointermove' | 'wheel';
4
- export interface CreateThrottledEventListenerDeps {
5
- addEventListener: Window['addEventListener'];
6
- removeEventListener: Window['removeEventListener'];
7
- setTimeout: typeof setTimeout;
8
- clearTimeout: typeof clearTimeout;
9
- now: () => number;
10
- }
11
- export declare function createThrottledEventListener(eventType: ThrottledEventType, callback: () => void, throttleMs: number, deps: CreateThrottledEventListenerDeps): () => void;
@@ -1,51 +0,0 @@
1
- export function createThrottledEventListener(eventType, callback, throttleMs, deps) {
2
- if (throttleMs === 0) {
3
- const handleEvent = () => {
4
- callback();
5
- };
6
- deps.addEventListener(eventType, handleEvent, { passive: true });
7
- return () => {
8
- deps.removeEventListener(eventType, handleEvent);
9
- };
10
- }
11
- let timeoutId = undefined;
12
- let lastExecuteTime = -1;
13
- let hasPendingCall = false;
14
- const executeCallback = () => {
15
- lastExecuteTime = deps.now();
16
- hasPendingCall = false;
17
- callback();
18
- };
19
- const handleEvent = () => {
20
- const now = deps.now();
21
- const timeSinceLastExecute = now - lastExecuteTime;
22
- if (lastExecuteTime < 0 || timeSinceLastExecute >= throttleMs) {
23
- if (timeoutId !== undefined) {
24
- deps.clearTimeout(timeoutId);
25
- timeoutId = undefined;
26
- }
27
- executeCallback();
28
- }
29
- else {
30
- hasPendingCall = true;
31
- if (timeoutId === undefined) {
32
- const remainingTime = throttleMs - timeSinceLastExecute;
33
- timeoutId = deps.setTimeout(() => {
34
- timeoutId = undefined;
35
- if (hasPendingCall) {
36
- executeCallback();
37
- }
38
- }, remainingTime);
39
- }
40
- }
41
- };
42
- deps.addEventListener(eventType, handleEvent, { passive: true });
43
- return () => {
44
- deps.removeEventListener(eventType, handleEvent);
45
- if (timeoutId !== undefined) {
46
- deps.clearTimeout(timeoutId);
47
- timeoutId = undefined;
48
- }
49
- };
50
- }
51
- //# sourceMappingURL=createThrottledEventListener.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createThrottledEventListener.js","sourceRoot":"","sources":["../../../src/functions/browser/createThrottledEventListener.ts"],"names":[],"mappings":"AA+DA,MAAM,UAAU,4BAA4B,CAC1C,SAA6B,EAC7B,QAAoB,EACpB,UAAkB,EAClB,IAAsC;IAGtC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,WAAW,GAAkB,GAAG,EAAE;YACtC,QAAQ,EAAE,CAAA;QACZ,CAAC,CAAA;QAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAEhE,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QAClD,CAAC,CAAA;IACH,CAAC;IAGD,IAAI,SAAS,GAAQ,SAAS,CAAA;IAC9B,IAAI,eAAe,GAAG,CAAC,CAAC,CAAA;IACxB,IAAI,cAAc,GAAG,KAAK,CAAA;IAE1B,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAC5B,cAAc,GAAG,KAAK,CAAA;QACtB,QAAQ,EAAE,CAAA;IACZ,CAAC,CAAA;IAED,MAAM,WAAW,GAAkB,GAAG,EAAE;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,MAAM,oBAAoB,GAAG,GAAG,GAAG,eAAe,CAAA;QAGlD,IAAI,eAAe,GAAG,CAAC,IAAI,oBAAoB,IAAI,UAAU,EAAE,CAAC;YAE9D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;gBAC5B,SAAS,GAAG,SAAS,CAAA;YACvB,CAAC;YACD,eAAe,EAAE,CAAA;QACnB,CAAC;aAAM,CAAC;YAEN,cAAc,GAAG,IAAI,CAAA;YAGrB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,MAAM,aAAa,GAAG,UAAU,GAAG,oBAAoB,CAAA;gBACvD,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;oBAC/B,SAAS,GAAG,SAAS,CAAA;oBACrB,IAAI,cAAc,EAAE,CAAC;wBACnB,eAAe,EAAE,CAAA;oBACnB,CAAC;gBACH,CAAC,EAAE,aAAa,CAAC,CAAA;YACnB,CAAC;QAGH,CAAC;IACH,CAAC,CAAA;IAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAGhE,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QAChD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;YAC5B,SAAS,GAAG,SAAS,CAAA;QACvB,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
@@ -1,32 +0,0 @@
1
- import type { Document } from '../../../references/dom.d';
2
- import type { setTimeout } from '../../../references/timer.d';
3
- import type { Console } from '../../../references/console.d';
4
- export type ResourceType = 'script' | 'style' | 'image' | 'iframe';
5
- export type ScriptLoadMode = 'normal' | 'async' | 'defer' | 'module';
6
- export interface ResourceLoadOptions {
7
- type: ResourceType;
8
- url: string;
9
- mode?: ScriptLoadMode;
10
- blocking?: boolean;
11
- delay?: number;
12
- }
13
- export interface ResourceLoadEvent {
14
- type: 'start' | 'load' | 'error' | 'execute';
15
- resource: ResourceLoadOptions;
16
- timestamp: number;
17
- relativeTime: number;
18
- message?: string;
19
- }
20
- export interface ResourceLoadResult {
21
- events: ResourceLoadEvent[];
22
- totalTime: number;
23
- success: boolean;
24
- }
25
- export interface ResourceLoadingDeps {
26
- setTimeout: typeof setTimeout;
27
- error: Console['error'];
28
- createElement: Document['createElement'];
29
- head: Document['head'];
30
- }
31
- export declare function demonstrateResourceLoading(resources: ResourceLoadOptions[], deps: ResourceLoadingDeps, onEvent?: (event: ResourceLoadEvent) => void): Promise<ResourceLoadResult>;
32
- export declare function getResourceLoadingDescription(type: ResourceType, mode?: ScriptLoadMode, blocking?: boolean): string;