@ibiz-template/mob-vue3-components 0.7.41-alpha.20 → 0.7.41-alpha.22

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 (397) hide show
  1. package/dist/ibiz-markdown-editor-COU_MxNu.js +2 -0
  2. package/dist/ibiz-markdown-editor-COU_MxNu.js.map +1 -0
  3. package/dist/index-Bn7VkqJp.js +76 -0
  4. package/dist/index-Bn7VkqJp.js.map +1 -0
  5. package/dist/index-ChdHGLJI.js +2 -0
  6. package/dist/index-ChdHGLJI.js.map +1 -0
  7. package/dist/index-Dd7yiMzY.js +2 -0
  8. package/dist/index-Dd7yiMzY.js.map +1 -0
  9. package/dist/index.es-D0mZvSDS.js +14 -0
  10. package/dist/index.es-D0mZvSDS.js.map +1 -0
  11. package/dist/index.min.css +2 -2
  12. package/dist/index.system.min.js +1 -1
  13. package/dist/{quill-COWm2ioZ.js → quill-BOA7ZLOz.js} +2 -2
  14. package/dist/{quill-COWm2ioZ.js.map → quill-BOA7ZLOz.js.map} +1 -1
  15. package/dist/{quill-editor-BwfQqajZ.js → quill-editor-DcZd_lqh.js} +2 -2
  16. package/dist/{quill-editor-BwfQqajZ.js.map → quill-editor-DcZd_lqh.js.map} +1 -1
  17. package/dist/quill-editor-preview-DghpeKpg.js +2 -0
  18. package/dist/quill-editor-preview-DghpeKpg.js.map +1 -0
  19. package/dist/{tree-CgxZzCGY.js → tree-BTa0bMPr.js} +2 -2
  20. package/dist/{tree-CgxZzCGY.js.map → tree-BTa0bMPr.js.map} +1 -1
  21. package/dist/xlsx-util-CQaOn5OK.js +105 -0
  22. package/dist/xlsx-util-CQaOn5OK.js.map +1 -0
  23. package/es/_virtual/FileSaver.min.mjs +3 -0
  24. package/es/_virtual/index12.mjs +2 -2
  25. package/es/_virtual/index14.mjs +2 -2
  26. package/es/common/action-group/action-group.css +1 -1
  27. package/es/common/action-toolbar/action-toolbar.css +1 -1
  28. package/es/common/add-btn/add-btn.css +1 -1
  29. package/es/common/button-list/button-list.css +1 -1
  30. package/es/common/cropping/cropping.css +1 -1
  31. package/es/common/date-range-picker/components/range-picker/range-picker.css +1 -1
  32. package/es/common/date-range-picker/components/single-picker/single-picker.css +1 -1
  33. package/es/common/date-range-picker/date-range-picker.css +1 -1
  34. package/es/common/emoji-select/components/categories/categories.css +1 -1
  35. package/es/common/emoji-select/components/category-label/category-label.css +1 -1
  36. package/es/common/emoji-select/components/emoji-item/emoji-item.css +1 -1
  37. package/es/common/emoji-select/components/emoji-list/emoji-list.css +1 -1
  38. package/es/common/emoji-select/emoji-select.css +1 -1
  39. package/es/common/fullscreen-header/fullscreen-header.css +1 -1
  40. package/es/common/md-advaned-searchform/md-advaned-searchform.css +1 -1
  41. package/es/common/md-sort-setting/md-sort-setting.css +1 -1
  42. package/es/common/preset-view-back/preset-view-back.css +1 -1
  43. package/es/common/rawitem/rawitem.css +1 -1
  44. package/es/common/split/split.css +1 -1
  45. package/es/common/split-trigger/split-trigger.css +1 -1
  46. package/es/common/tab-layout/tab-default-layout/tab-default-layout.css +1 -1
  47. package/es/common/tab-layout/tab-default-layout/tab-default-layout.mjs +1 -0
  48. package/es/common/tab-layout/tab-dropdown/tab-dropdown-list-content.css +1 -1
  49. package/es/common/tab-layout/tab-dropdown/tab-dropdown.css +1 -1
  50. package/es/common/tab-layout/tab-flow-layout/tab-flow-layout.css +1 -1
  51. package/es/common/tab-layout/tab-layout.css +1 -1
  52. package/es/common/tab-layout/tab-sidebar-layout/tab-sidebar-layout.css +1 -1
  53. package/es/common/view-message/view-message.mjs +1 -1
  54. package/es/control/app-menu/app-menu.css +1 -1
  55. package/es/control/app-menu/app-menu.mjs +2 -2
  56. package/es/control/app-menu-icon-view/app-menu-icon-view.css +1 -1
  57. package/es/control/app-menu-icon-view/app-menu-icon-view.mjs +2 -2
  58. package/es/control/app-menu-list-view/app-menu-list-view.css +1 -1
  59. package/es/control/calendar/calendar.css +1 -1
  60. package/es/control/calendar/calendar.mjs +1 -1
  61. package/es/control/caption-bar/caption-bar.css +1 -1
  62. package/es/control/dashboard/custom-dashboard-design/custom-dashboard-design.css +1 -1
  63. package/es/control/dashboard/dashboard.css +1 -1
  64. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  65. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +4 -1
  66. package/es/control/data-view/data-view.css +1 -1
  67. package/es/control/drbar/drbar.css +1 -1
  68. package/es/control/drtab/drtab.controller.mjs +1 -1
  69. package/es/control/drtab/drtab.css +1 -1
  70. package/es/control/form/edit-form/edit-form.css +1 -1
  71. package/es/control/form/form/form.css +1 -1
  72. package/es/control/form/form-detail/form-button/form-button.css +1 -1
  73. package/es/control/form/form-detail/form-button-list/form-button-list.css +1 -1
  74. package/es/control/form/form-detail/form-druipart/form-druipart.css +1 -1
  75. package/es/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
  76. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
  77. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +3 -3
  78. package/es/control/form/form-detail/form-item/form-item.css +1 -1
  79. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.css +0 -1
  80. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.mjs +2 -19
  81. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -1
  82. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.mjs +7 -0
  83. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.css +1 -0
  84. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +239 -0
  85. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.css +1 -1
  86. package/es/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
  87. package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.css +1 -1
  88. package/es/control/form/form-detail/form-page/form-page-item/form-page-item.css +1 -1
  89. package/es/control/form/form-detail/form-page/form-page.css +1 -1
  90. package/es/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
  91. package/es/control/list/list/list.css +0 -1
  92. package/es/control/list/list/list.mjs +20 -121
  93. package/es/control/list/md-ctrl/md-ctrl.css +1 -1
  94. package/es/control/search-bar/filter-tree/filter-tree.css +1 -1
  95. package/es/control/search-bar/search-bar.css +1 -1
  96. package/es/control/tab-exp-panel/tab-exp-panel.css +1 -1
  97. package/es/control/toolbar/toolbar-render-util.mjs +4 -0
  98. package/es/control/toolbar/toolbar.css +1 -1
  99. package/es/control/tree/tree.css +1 -1
  100. package/es/control/wizard-panel/wizard-panel.css +1 -1
  101. package/es/editor/array/ibiz-array/ibiz-array.css +1 -1
  102. package/es/editor/cascader/ibiz-cascader/ibiz-cascader.css +1 -1
  103. package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.css +1 -1
  104. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
  105. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.css +1 -1
  106. package/es/editor/common/data-mpicker/ibiz-data-mpicker.css +1 -1
  107. package/es/editor/common/right-icon/right-icon.css +1 -1
  108. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
  109. package/es/editor/data-picker/ibiz-picker/ibiz-picker.css +1 -1
  110. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
  111. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  112. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +1 -1
  113. package/es/editor/data-picker/picker-editor.controller.mjs +1 -1
  114. package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.css +1 -1
  115. package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.css +1 -1
  116. package/es/editor/dropdown-list/ibiz-cascader-dropdown/ibiz-cascader-dropdown.css +1 -1
  117. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
  118. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +18 -9
  119. package/es/editor/dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.css +1 -1
  120. package/es/editor/dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.mjs +8 -1
  121. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.css +1 -1
  122. package/es/editor/html/quill-editor/quill-editor.css +1 -1
  123. package/es/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
  124. package/es/editor/html/quill-editor-preview/quill-editor-preview.mjs +4 -3
  125. package/es/editor/map-picker/ibiz-map-picker/ibiz-map-picker.css +1 -1
  126. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
  127. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +3 -1
  128. package/es/editor/not-supported-editor/not-supported-editor.css +1 -1
  129. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.css +1 -1
  130. package/es/editor/qrcode/ibiz-qrcode/ibiz-qrcode.css +1 -1
  131. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
  132. package/es/editor/rate/ibiz-rate/ibiz-rate.css +1 -1
  133. package/es/editor/raw/ibiz-raw/ibiz-raw.css +1 -1
  134. package/es/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  135. package/es/editor/span/span/span.css +1 -1
  136. package/es/editor/span/span-link/span-link.css +1 -1
  137. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -1
  138. package/es/editor/switch/ibiz-switch/ibiz-switch.css +1 -1
  139. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
  140. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +1 -1
  141. package/es/editor/text-box/input/input.css +1 -1
  142. package/es/editor/text-box/input/input.mjs +33 -2
  143. package/es/editor/text-box/signature/signature.css +1 -1
  144. package/es/editor/text-box/signature/signature.mjs +1 -1
  145. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
  146. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +1 -1
  147. package/es/editor/upload/ibiz-image-cropping/ibiz-image-cropping.css +1 -1
  148. package/es/editor/upload/ibiz-image-select/ibiz-image-select.css +1 -1
  149. package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.css +1 -1
  150. package/es/ibiz-vue3.mjs +1 -0
  151. package/es/index.mjs +3 -0
  152. package/es/locale/en/index.mjs +32 -0
  153. package/es/locale/zh-CN/index.mjs +35 -1
  154. package/es/mob-app/components/modal-router-shell/modal-router-shell.mjs +2 -2
  155. package/es/mob-app/guard/auth-guard/auth-guard.mjs +206 -194
  156. package/es/mob-app/guard/auth-guard/dyna-auth-guard.mjs +65 -0
  157. package/es/mob-app/guard/index.mjs +1 -0
  158. package/es/mob-app/index.mjs +1 -0
  159. package/es/mob-app/main.mjs +14 -1
  160. package/es/mob-app/router/index.mjs +6 -4
  161. package/es/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.mjs +1 -1
  162. package/es/node_modules/.pnpm/@ibiz-template-plugin_ibiz-mob-ai-chat@0.0.1_cherry-markdown@0.8.58_interactjs@1.10.27_qx-uti_xgmgjpxet4ghyc7txs4jkjxilq/node_modules/@ibiz-template-plugin/ibiz-mob-ai-chat/dist/index.es.mjs +4425 -0
  163. package/es/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.mjs +1 -1
  164. package/es/node_modules/.pnpm/file-saver@2.0.5/node_modules/file-saver/dist/FileSaver.min.mjs +15 -0
  165. package/es/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx.mjs +24580 -0
  166. package/es/panel-component/async-action/async-action/async-action.css +1 -1
  167. package/es/panel-component/async-action/async-action-preview/async-action-preview.css +1 -1
  168. package/es/panel-component/async-action/async-action-tab/async-action-tab.css +1 -1
  169. package/es/panel-component/async-action/mob-async-action.css +1 -1
  170. package/es/panel-component/auth-sso/auth-sso.css +1 -1
  171. package/es/panel-component/auth-userinfo/auth-userinfo.css +1 -1
  172. package/es/panel-component/index.mjs +2 -0
  173. package/es/panel-component/panel-app-title/panel-app-title.css +1 -1
  174. package/es/panel-component/panel-button/panel-button.css +1 -1
  175. package/es/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
  176. package/es/panel-component/setting-container/setting-container.css +1 -1
  177. package/es/panel-component/theme-toggling/index.mjs +15 -0
  178. package/es/panel-component/theme-toggling/theme-toggling.controller.mjs +90 -0
  179. package/es/panel-component/theme-toggling/theme-toggling.css +1 -0
  180. package/es/panel-component/theme-toggling/theme-toggling.mjs +72 -0
  181. package/es/panel-component/theme-toggling/theme-toggling.provider.mjs +21 -0
  182. package/es/panel-component/theme-toggling/theme-toggling.state.mjs +22 -0
  183. package/es/panel-component/user-message/common/internal-message-container/internal-message-container.css +1 -1
  184. package/es/panel-component/user-message/common/internal-message-default/internal-message-default.css +1 -1
  185. package/es/panel-component/user-message/internal-message-text/internal-message-text.css +1 -1
  186. package/es/panel-component/user-message/user-message.css +1 -1
  187. package/es/panel-component/view-content-panel-container/view-content-panel-container.css +1 -1
  188. package/es/panel-component/view-content-panel-container/view-content-panel-container.mjs +18 -4
  189. package/es/panel-component/view-header-panel-container/view-header-panel-container.css +1 -1
  190. package/es/panel-component/wf-action-button/wf-action-button.css +1 -1
  191. package/es/panel-component/wf-step-trace/wf-step-trace.css +1 -1
  192. package/es/util/ai-chat-util/ai-chat-util.mjs +932 -0
  193. package/es/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
  194. package/es/util/ai-chat-util/ai-feedback/ai-feedback.mjs +140 -0
  195. package/es/util/app-drawer/app-drawer-component.mjs +7 -17
  196. package/es/util/app-modal/app-modal-component.mjs +4 -2
  197. package/es/util/app-util/app-util.mjs +76 -6
  198. package/es/util/index.mjs +2 -0
  199. package/es/util/list-util/list-render-util.mjs +1 -2
  200. package/es/util/user-route-util/user-route-util.mjs +55 -0
  201. package/es/util/xlsx-util/xlsx-util.mjs +163 -0
  202. package/es/view/portal-view/portal-view.mjs +3 -2
  203. package/es/view-engine/mob-calendar-view.engine.mjs +4 -0
  204. package/es/view-engine/mob-pickup-md-view.engine.mjs +1 -0
  205. package/lib/_virtual/FileSaver.min.cjs +5 -0
  206. package/lib/_virtual/index12.cjs +2 -2
  207. package/lib/_virtual/index14.cjs +2 -2
  208. package/lib/common/action-group/action-group.css +1 -1
  209. package/lib/common/action-toolbar/action-toolbar.css +1 -1
  210. package/lib/common/add-btn/add-btn.css +1 -1
  211. package/lib/common/button-list/button-list.css +1 -1
  212. package/lib/common/cropping/cropping.css +1 -1
  213. package/lib/common/date-range-picker/components/range-picker/range-picker.css +1 -1
  214. package/lib/common/date-range-picker/components/single-picker/single-picker.css +1 -1
  215. package/lib/common/date-range-picker/date-range-picker.css +1 -1
  216. package/lib/common/emoji-select/components/categories/categories.css +1 -1
  217. package/lib/common/emoji-select/components/category-label/category-label.css +1 -1
  218. package/lib/common/emoji-select/components/emoji-item/emoji-item.css +1 -1
  219. package/lib/common/emoji-select/components/emoji-list/emoji-list.css +1 -1
  220. package/lib/common/emoji-select/emoji-select.css +1 -1
  221. package/lib/common/fullscreen-header/fullscreen-header.css +1 -1
  222. package/lib/common/md-advaned-searchform/md-advaned-searchform.css +1 -1
  223. package/lib/common/md-sort-setting/md-sort-setting.css +1 -1
  224. package/lib/common/preset-view-back/preset-view-back.css +1 -1
  225. package/lib/common/rawitem/rawitem.css +1 -1
  226. package/lib/common/split/split.css +1 -1
  227. package/lib/common/split-trigger/split-trigger.css +1 -1
  228. package/lib/common/tab-layout/tab-default-layout/tab-default-layout.cjs +1 -0
  229. package/lib/common/tab-layout/tab-default-layout/tab-default-layout.css +1 -1
  230. package/lib/common/tab-layout/tab-dropdown/tab-dropdown-list-content.css +1 -1
  231. package/lib/common/tab-layout/tab-dropdown/tab-dropdown.css +1 -1
  232. package/lib/common/tab-layout/tab-flow-layout/tab-flow-layout.css +1 -1
  233. package/lib/common/tab-layout/tab-layout.css +1 -1
  234. package/lib/common/tab-layout/tab-sidebar-layout/tab-sidebar-layout.css +1 -1
  235. package/lib/common/view-message/view-message.cjs +1 -1
  236. package/lib/control/app-menu/app-menu.cjs +2 -2
  237. package/lib/control/app-menu/app-menu.css +1 -1
  238. package/lib/control/app-menu-icon-view/app-menu-icon-view.cjs +2 -2
  239. package/lib/control/app-menu-icon-view/app-menu-icon-view.css +1 -1
  240. package/lib/control/app-menu-list-view/app-menu-list-view.css +1 -1
  241. package/lib/control/calendar/calendar.cjs +1 -1
  242. package/lib/control/calendar/calendar.css +1 -1
  243. package/lib/control/caption-bar/caption-bar.css +1 -1
  244. package/lib/control/dashboard/custom-dashboard-design/custom-dashboard-design.css +1 -1
  245. package/lib/control/dashboard/dashboard.css +1 -1
  246. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +4 -1
  247. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  248. package/lib/control/data-view/data-view.css +1 -1
  249. package/lib/control/drbar/drbar.css +1 -1
  250. package/lib/control/drtab/drtab.controller.cjs +1 -1
  251. package/lib/control/drtab/drtab.css +1 -1
  252. package/lib/control/form/edit-form/edit-form.css +1 -1
  253. package/lib/control/form/form/form.css +1 -1
  254. package/lib/control/form/form-detail/form-button/form-button.css +1 -1
  255. package/lib/control/form/form-detail/form-button-list/form-button-list.css +1 -1
  256. package/lib/control/form/form-detail/form-druipart/form-druipart.css +1 -1
  257. package/lib/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
  258. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +3 -3
  259. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
  260. package/lib/control/form/form-detail/form-item/form-item.css +1 -1
  261. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.cjs +1 -18
  262. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.css +0 -1
  263. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -1
  264. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.cjs +7 -0
  265. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +241 -0
  266. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.css +1 -0
  267. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.css +1 -1
  268. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
  269. package/lib/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.css +1 -1
  270. package/lib/control/form/form-detail/form-page/form-page-item/form-page-item.css +1 -1
  271. package/lib/control/form/form-detail/form-page/form-page.css +1 -1
  272. package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
  273. package/lib/control/list/list/list.cjs +19 -120
  274. package/lib/control/list/list/list.css +0 -1
  275. package/lib/control/list/md-ctrl/md-ctrl.css +1 -1
  276. package/lib/control/search-bar/filter-tree/filter-tree.css +1 -1
  277. package/lib/control/search-bar/search-bar.css +1 -1
  278. package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -1
  279. package/lib/control/toolbar/toolbar-render-util.cjs +4 -0
  280. package/lib/control/toolbar/toolbar.css +1 -1
  281. package/lib/control/tree/tree.css +1 -1
  282. package/lib/control/wizard-panel/wizard-panel.css +1 -1
  283. package/lib/editor/array/ibiz-array/ibiz-array.css +1 -1
  284. package/lib/editor/cascader/ibiz-cascader/ibiz-cascader.css +1 -1
  285. package/lib/editor/check-box/ibiz-checkbox/ibiz-checkbox.css +1 -1
  286. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
  287. package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.css +1 -1
  288. package/lib/editor/common/data-mpicker/ibiz-data-mpicker.css +1 -1
  289. package/lib/editor/common/right-icon/right-icon.css +1 -1
  290. package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
  291. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +2 -2
  292. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.css +1 -1
  293. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +1 -1
  294. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  295. package/lib/editor/data-picker/picker-editor.controller.cjs +1 -1
  296. package/lib/editor/date-picker/ibiz-date-picker/ibiz-date-picker.css +1 -1
  297. package/lib/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.css +1 -1
  298. package/lib/editor/dropdown-list/ibiz-cascader-dropdown/ibiz-cascader-dropdown.css +1 -1
  299. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +18 -9
  300. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
  301. package/lib/editor/dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.cjs +8 -1
  302. package/lib/editor/dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.css +1 -1
  303. package/lib/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.css +1 -1
  304. package/lib/editor/html/quill-editor/quill-editor.css +1 -1
  305. package/lib/editor/html/quill-editor-preview/quill-editor-preview.cjs +4 -3
  306. package/lib/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
  307. package/lib/editor/map-picker/ibiz-map-picker/ibiz-map-picker.css +1 -1
  308. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +3 -1
  309. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
  310. package/lib/editor/not-supported-editor/not-supported-editor.css +1 -1
  311. package/lib/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.css +1 -1
  312. package/lib/editor/qrcode/ibiz-qrcode/ibiz-qrcode.css +1 -1
  313. package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
  314. package/lib/editor/rate/ibiz-rate/ibiz-rate.css +1 -1
  315. package/lib/editor/raw/ibiz-raw/ibiz-raw.css +1 -1
  316. package/lib/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
  317. package/lib/editor/span/span/span.css +1 -1
  318. package/lib/editor/span/span-link/span-link.css +1 -1
  319. package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -1
  320. package/lib/editor/switch/ibiz-switch/ibiz-switch.css +1 -1
  321. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +1 -1
  322. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
  323. package/lib/editor/text-box/input/input.cjs +32 -1
  324. package/lib/editor/text-box/input/input.css +1 -1
  325. package/lib/editor/text-box/signature/signature.cjs +1 -1
  326. package/lib/editor/text-box/signature/signature.css +1 -1
  327. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +1 -1
  328. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
  329. package/lib/editor/upload/ibiz-image-cropping/ibiz-image-cropping.css +1 -1
  330. package/lib/editor/upload/ibiz-image-select/ibiz-image-select.css +1 -1
  331. package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.css +1 -1
  332. package/lib/ibiz-vue3.cjs +1 -0
  333. package/lib/index.cjs +7 -0
  334. package/lib/locale/en/index.cjs +32 -0
  335. package/lib/locale/zh-CN/index.cjs +35 -1
  336. package/lib/mob-app/components/modal-router-shell/modal-router-shell.cjs +2 -2
  337. package/lib/mob-app/guard/auth-guard/auth-guard.cjs +206 -194
  338. package/lib/mob-app/guard/auth-guard/dyna-auth-guard.cjs +67 -0
  339. package/lib/mob-app/guard/index.cjs +2 -0
  340. package/lib/mob-app/index.cjs +2 -0
  341. package/lib/mob-app/main.cjs +14 -1
  342. package/lib/mob-app/router/index.cjs +6 -4
  343. package/lib/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.cjs +1 -1
  344. package/lib/node_modules/.pnpm/@ibiz-template-plugin_ibiz-mob-ai-chat@0.0.1_cherry-markdown@0.8.58_interactjs@1.10.27_qx-uti_xgmgjpxet4ghyc7txs4jkjxilq/node_modules/@ibiz-template-plugin/ibiz-mob-ai-chat/dist/index.es.cjs +4427 -0
  345. package/lib/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.cjs +1 -1
  346. package/lib/node_modules/.pnpm/file-saver@2.0.5/node_modules/file-saver/dist/FileSaver.min.cjs +20 -0
  347. package/lib/node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx.cjs +24599 -0
  348. package/lib/panel-component/async-action/async-action/async-action.css +1 -1
  349. package/lib/panel-component/async-action/async-action-preview/async-action-preview.css +1 -1
  350. package/lib/panel-component/async-action/async-action-tab/async-action-tab.css +1 -1
  351. package/lib/panel-component/async-action/mob-async-action.css +1 -1
  352. package/lib/panel-component/auth-sso/auth-sso.css +1 -1
  353. package/lib/panel-component/auth-userinfo/auth-userinfo.css +1 -1
  354. package/lib/panel-component/index.cjs +44 -42
  355. package/lib/panel-component/panel-app-title/panel-app-title.css +1 -1
  356. package/lib/panel-component/panel-button/panel-button.css +1 -1
  357. package/lib/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
  358. package/lib/panel-component/setting-container/setting-container.css +1 -1
  359. package/lib/panel-component/theme-toggling/index.cjs +20 -0
  360. package/lib/panel-component/theme-toggling/theme-toggling.cjs +74 -0
  361. package/lib/panel-component/theme-toggling/theme-toggling.controller.cjs +92 -0
  362. package/lib/panel-component/theme-toggling/theme-toggling.css +1 -0
  363. package/lib/panel-component/theme-toggling/theme-toggling.provider.cjs +23 -0
  364. package/lib/panel-component/theme-toggling/theme-toggling.state.cjs +24 -0
  365. package/lib/panel-component/user-message/common/internal-message-container/internal-message-container.css +1 -1
  366. package/lib/panel-component/user-message/common/internal-message-default/internal-message-default.css +1 -1
  367. package/lib/panel-component/user-message/internal-message-text/internal-message-text.css +1 -1
  368. package/lib/panel-component/user-message/user-message.css +1 -1
  369. package/lib/panel-component/view-content-panel-container/view-content-panel-container.cjs +18 -4
  370. package/lib/panel-component/view-content-panel-container/view-content-panel-container.css +1 -1
  371. package/lib/panel-component/view-header-panel-container/view-header-panel-container.css +1 -1
  372. package/lib/panel-component/wf-action-button/wf-action-button.css +1 -1
  373. package/lib/panel-component/wf-step-trace/wf-step-trace.css +1 -1
  374. package/lib/util/ai-chat-util/ai-chat-util.cjs +934 -0
  375. package/lib/util/ai-chat-util/ai-feedback/ai-feedback.cjs +142 -0
  376. package/lib/util/ai-chat-util/ai-feedback/ai-feedback.css +1 -0
  377. package/lib/util/app-drawer/app-drawer-component.cjs +7 -17
  378. package/lib/util/app-modal/app-modal-component.cjs +4 -2
  379. package/lib/util/app-util/app-util.cjs +75 -5
  380. package/lib/util/index.cjs +5 -0
  381. package/lib/util/list-util/list-render-util.cjs +1 -2
  382. package/lib/util/user-route-util/user-route-util.cjs +58 -0
  383. package/lib/util/xlsx-util/xlsx-util.cjs +166 -0
  384. package/lib/view/portal-view/portal-view.cjs +3 -2
  385. package/lib/view-engine/mob-calendar-view.engine.cjs +4 -0
  386. package/lib/view-engine/mob-pickup-md-view.engine.cjs +1 -0
  387. package/package.json +12 -9
  388. package/dist/ibiz-markdown-editor-DMe7ZdYW.js +0 -2
  389. package/dist/ibiz-markdown-editor-DMe7ZdYW.js.map +0 -1
  390. package/dist/index-B0eDJ8A4.js +0 -2
  391. package/dist/index-B0eDJ8A4.js.map +0 -1
  392. package/dist/index-FB2X3Nyy.js +0 -76
  393. package/dist/index-FB2X3Nyy.js.map +0 -1
  394. package/dist/index-nqcMxJEO.js +0 -2
  395. package/dist/index-nqcMxJEO.js.map +0 -1
  396. package/dist/quill-editor-preview-Bj3EE5LD.js +0 -2
  397. package/dist/quill-editor-preview-Bj3EE5LD.js.map +0 -1
@@ -0,0 +1,932 @@
1
+ import { h } from 'vue';
2
+ import { createUUID } from 'qx-util';
3
+ import { UIActionUtil, SysUIActionTag, ConfigService, UtilService, AIUtilService } from '@ibiz-template/runtime';
4
+ import { StringUtil, IBizContext } from '@ibiz-template/core';
5
+ import { AIFeedback } from './ai-feedback/ai-feedback.mjs';
6
+
7
+ "use strict";
8
+ var __defProp = Object.defineProperty;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __publicField = (obj, key, value) => {
11
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
12
+ return value;
13
+ };
14
+ class AIChatUtil {
15
+ constructor() {
16
+ __publicField(this, "TOPIC_CHAT_PREFIX", "topic");
17
+ __publicField(this, "INLINE_CHAT_SUFFIX", "inline");
18
+ __publicField(this, "TEMP_CHAT_SUFFIX", "temp");
19
+ __publicField(this, "UNKOWN_CHAT_SUFFIX", "unknow");
20
+ }
21
+ /**
22
+ * 获取AI聊天对象
23
+ */
24
+ async getAIChat() {
25
+ const module = await import('../../node_modules/.pnpm/@ibiz-template-plugin_ibiz-mob-ai-chat@0.0.1_cherry-markdown@0.8.58_interactjs@1.10.27_qx-uti_xgmgjpxet4ghyc7txs4jkjxilq/node_modules/@ibiz-template-plugin/ibiz-mob-ai-chat/dist/index.es.mjs');
26
+ const chatInstance = module.chat || module.default.chat;
27
+ return chatInstance;
28
+ }
29
+ /**
30
+ * 获取编辑器扩展AI聊天参数
31
+ * @param editorParams
32
+ * @param context
33
+ * @param params
34
+ * @param data
35
+ */
36
+ async getEditorExAIChatParams(editorParams, context, params, data, deACMode, args) {
37
+ const containerOptions = {};
38
+ if (editorParams.autoclose) {
39
+ try {
40
+ containerOptions.autoClose = JSON.parse(editorParams.autoclose);
41
+ } catch (error) {
42
+ ibiz.log.error(error);
43
+ }
44
+ }
45
+ if (editorParams.openmode)
46
+ containerOptions.openMode = editorParams.openmode;
47
+ const topicOptions = {};
48
+ const chatOptions = {};
49
+ if (editorParams.srfaiappendcurdata) {
50
+ chatOptions.appendCurData = editorParams.srfaiappendcurdata === "true" ? data : void 0;
51
+ }
52
+ chatOptions.appendCurContent = editorParams.srfaiappendcurcontent ? StringUtil.fill(
53
+ editorParams.srfaiappendcurcontent,
54
+ context,
55
+ params,
56
+ data
57
+ ) : void 0;
58
+ chatOptions.autoQuestion = editorParams.autoquestion !== "false";
59
+ chatOptions.autoFill = editorParams.autofill === "true";
60
+ chatOptions.appendCurResource = editorParams.srfaiappendresource ? StringUtil.fill(editorParams.srfaiappendresource, context, params, data) : void 0;
61
+ if (editorParams.srfmode) {
62
+ chatOptions.srfMode = editorParams.srfmode;
63
+ }
64
+ let enableAIAgentChange = ibiz.config.common.enableAIAgentChange;
65
+ if (editorParams.srfenableaiagentchange) {
66
+ enableAIAgentChange = editorParams.srfenableaiagentchange === "true";
67
+ }
68
+ chatOptions.enableAIAgentChange = enableAIAgentChange;
69
+ if (editorParams.srfaiagent) {
70
+ chatOptions.activeAIAgentID = editorParams.srfaiagent;
71
+ }
72
+ const aiAgentlist = await this.getAIAgentList(
73
+ context,
74
+ params,
75
+ editorParams
76
+ );
77
+ chatOptions.aiAgentlist = aiAgentlist;
78
+ if (deACMode) {
79
+ const {
80
+ contentToolbarItems,
81
+ footerToolbarItems,
82
+ questionToolbarItems,
83
+ otherToolbarItems
84
+ } = this.calcAiToolbarItemsByAc(deACMode);
85
+ chatOptions.contentToolbarItems = contentToolbarItems;
86
+ chatOptions.footerToolbarItems = footerToolbarItems;
87
+ chatOptions.questionToolbarItems = questionToolbarItems;
88
+ chatOptions.otherToolbarItems = otherToolbarItems;
89
+ }
90
+ const sessionid = this.getChatSessionId("TEMP");
91
+ chatOptions.sessionid = sessionid;
92
+ let id = "";
93
+ let abortController;
94
+ let asyncacitonid = "";
95
+ const { chatInstance, view, ctrl } = args;
96
+ chatOptions.history = async (ctx, param, other) => {
97
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
98
+ const historyRequestData = {};
99
+ if (other.appendCurData) {
100
+ Object.assign(historyRequestData, {
101
+ ...other.appendCurData
102
+ });
103
+ }
104
+ if (other.sessionid) {
105
+ Object.assign(historyRequestData, {
106
+ sessionid: other.sessionid
107
+ });
108
+ }
109
+ if (other.srfaiagent) {
110
+ Object.assign(historyRequestData, {
111
+ srfaiagent: other.srfaiagent
112
+ });
113
+ }
114
+ if (other.srfmode) {
115
+ Object.assign(historyRequestData, {
116
+ mode: other.srfmode
117
+ });
118
+ }
119
+ const result = await deService.aiChatHistory(
120
+ ctx,
121
+ param,
122
+ historyRequestData
123
+ );
124
+ if (result.data && Array.isArray(result.data)) {
125
+ let preMsg;
126
+ result.data.forEach((item) => {
127
+ if (item.role === "TOOL") {
128
+ if (preMsg && item.content) {
129
+ chatInstance.aiChat.updateRecommendPrompt(
130
+ preMsg,
131
+ item.content
132
+ );
133
+ }
134
+ } else {
135
+ const msg = {
136
+ messageid: createUUID(),
137
+ state: 30,
138
+ type: "DEFAULT",
139
+ role: item.role,
140
+ content: item.content,
141
+ completed: true
142
+ };
143
+ preMsg = msg;
144
+ chatInstance.aiChat.addMessage(msg);
145
+ }
146
+ });
147
+ }
148
+ return true;
149
+ };
150
+ chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid2, srfaiagent, srfmode) => {
151
+ id = createUUID();
152
+ abortController = new AbortController();
153
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
154
+ try {
155
+ const questionRequestData = {
156
+ messages: arr,
157
+ sessionid: sessionid2
158
+ };
159
+ if (srfaiagent) {
160
+ questionRequestData.srfaiagent = srfaiagent;
161
+ }
162
+ if (srfmode) {
163
+ questionRequestData.mode = srfmode;
164
+ }
165
+ await deService.aiChatSse(
166
+ (msg) => {
167
+ if (msg.actionstate === 20 && msg.actionresult) {
168
+ asyncacitonid = msg.asyncacitonid;
169
+ aiChat.addMessage({
170
+ messageid: id,
171
+ state: msg.actionstate,
172
+ type: "DEFAULT",
173
+ role: "ASSISTANT",
174
+ content: msg.actionresult,
175
+ status: "pending"
176
+ });
177
+ } else if (msg.actionstate === 30 && msg.actionresult) {
178
+ const result = JSON.parse(msg.actionresult);
179
+ const choices = result.choices;
180
+ if (choices && choices.length > 0) {
181
+ aiChat.replaceMessage({
182
+ messageid: id,
183
+ state: msg.actionstate,
184
+ type: "DEFAULT",
185
+ role: "ASSISTANT",
186
+ content: choices[0].content || "",
187
+ realmessageid: choices[0].messageid,
188
+ status: "sent"
189
+ });
190
+ }
191
+ } else if (msg.actionstate === 40) {
192
+ aiChat.replaceMessage({
193
+ messageid: id,
194
+ state: msg.actionstate,
195
+ type: "ERROR",
196
+ role: "ASSISTANT",
197
+ content: msg.actionresult,
198
+ status: "failed"
199
+ });
200
+ }
201
+ },
202
+ abortController,
203
+ ctx,
204
+ param,
205
+ { ...questionRequestData }
206
+ );
207
+ } catch (error) {
208
+ aiChat.replaceMessage({
209
+ messageid: id,
210
+ state: 40,
211
+ type: "ERROR",
212
+ role: "ASSISTANT",
213
+ content: error.message || ibiz.i18n.t("app.aiError"),
214
+ status: "failed"
215
+ });
216
+ abortController == null ? void 0 : abortController.abort();
217
+ } finally {
218
+ aiChat.completeMessage(id, true);
219
+ return true;
220
+ }
221
+ };
222
+ chatOptions.abortQuestion = async (aiChat, ctx, param, other) => {
223
+ abortController == null ? void 0 : abortController.abort();
224
+ if (asyncacitonid) {
225
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
226
+ const abortRequestData = { asyncacitonid };
227
+ if (other.sessionid) {
228
+ Object.assign(abortRequestData, {
229
+ sessionid: other.sessionid
230
+ });
231
+ }
232
+ const result = await deService.aiChatCancel(
233
+ ctx,
234
+ param,
235
+ abortRequestData
236
+ );
237
+ asyncacitonid = "";
238
+ }
239
+ await aiChat.stopMessage({
240
+ messageid: id,
241
+ state: 30,
242
+ type: "DEFAULT",
243
+ role: "ASSISTANT",
244
+ content: "",
245
+ status: "canceled"
246
+ });
247
+ await aiChat.completeMessage(id, true);
248
+ };
249
+ chatOptions.recommendPrompt = async (ctx, param, other) => {
250
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
251
+ const tempParams = { ...param };
252
+ if (other.srfaiagent) {
253
+ tempParams.srfaiagent = other.srfaiagent;
254
+ }
255
+ const result = await deService.aiChatRecommendPrompt(
256
+ ctx,
257
+ tempParams,
258
+ other.message
259
+ );
260
+ if (result.ok && result.data) {
261
+ const choices = result.data.choices;
262
+ if (choices && choices.length > 0) {
263
+ return choices[0];
264
+ }
265
+ return null;
266
+ }
267
+ return null;
268
+ };
269
+ chatOptions.uploader = {
270
+ onUpload: async (file, reportProgress, options) => {
271
+ const fileMeata = ibiz.util.file.calcFileUpDownUrl(
272
+ (options == null ? void 0 : options.context) || context,
273
+ (options == null ? void 0 : options.params) || params,
274
+ {},
275
+ { enableNoAccess: true }
276
+ );
277
+ const fielUploadHeaders = ibiz.util.file.getUploadHeaders();
278
+ const formData = new FormData();
279
+ formData.append("file", file);
280
+ const res = await ibiz.net.axios({
281
+ url: fileMeata.uploadUrl,
282
+ method: "post",
283
+ headers: fielUploadHeaders,
284
+ data: formData,
285
+ onUploadProgress: (progressEvent) => {
286
+ const percent = progressEvent.loaded / progressEvent.total * 100;
287
+ reportProgress(percent);
288
+ }
289
+ });
290
+ return res.data;
291
+ }
292
+ };
293
+ chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
294
+ var _a, _b, _c;
295
+ const { id: id2, isPluginApp } = source;
296
+ let appId = source.appId;
297
+ const tempContext = IBizContext.create(context2);
298
+ if (isPluginApp) {
299
+ const mainApp = ibiz.hub.getApp();
300
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
301
+ (subAppRef) => subAppRef.appId.endsWith(appId)
302
+ );
303
+ if (targetApp) {
304
+ const targetAppId = targetApp.appId;
305
+ tempContext.srfappid = targetAppId;
306
+ appId = targetAppId;
307
+ }
308
+ }
309
+ const result = await UIActionUtil.exec(
310
+ id2,
311
+ {
312
+ view,
313
+ ctrl,
314
+ context: tempContext,
315
+ params: params2,
316
+ data: [data2],
317
+ event
318
+ },
319
+ appId
320
+ );
321
+ if (result.closeView) {
322
+ view.closeView({ ok: true });
323
+ } else if (result.refresh) {
324
+ switch (result.refreshMode) {
325
+ case 1:
326
+ view.callUIAction(SysUIActionTag.REFRESH);
327
+ break;
328
+ case 2:
329
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(SysUIActionTag.REFRESH);
330
+ break;
331
+ case 3:
332
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(SysUIActionTag.REFRESH);
333
+ break;
334
+ default:
335
+ }
336
+ }
337
+ return result;
338
+ };
339
+ return { containerOptions, topicOptions, chatOptions };
340
+ }
341
+ /**
342
+ * 获取界面行为扩展AI聊天参数
343
+ * @param context
344
+ * @param params
345
+ * @param data
346
+ * @param deACMode
347
+ * @param args
348
+ * @returns
349
+ */
350
+ async getUIActionExAIChatParams(context, params, data, deACMode, args) {
351
+ const containerOptions = {};
352
+ if (params.hasOwnProperty("autoclose")) {
353
+ try {
354
+ containerOptions.autoClose = JSON.parse(params.autoclose);
355
+ delete params.autoclose;
356
+ } catch (error) {
357
+ ibiz.log.error(error);
358
+ }
359
+ }
360
+ if (params.hasOwnProperty("openmode")) {
361
+ containerOptions.openMode = params.openmode;
362
+ delete params.openmode;
363
+ }
364
+ const topicOptions = {};
365
+ if (params.hasOwnProperty("topiccaptionmode")) {
366
+ topicOptions.captionMode = params.topiccaptionmode;
367
+ delete params.topiccaptionmode;
368
+ } else {
369
+ topicOptions.captionMode = ibiz.config.common.aiChatTopicCaptionMode;
370
+ }
371
+ topicOptions.disableStorage = false;
372
+ if (params.hasOwnProperty("disabletopicstorage")) {
373
+ topicOptions.disableStorage = params.disabletopicstorage === "true";
374
+ delete params.disabletopicstorage;
375
+ }
376
+ topicOptions.beforeDelete = async (...args2) => {
377
+ const isBatchRemove = args2[4];
378
+ const result = await ibiz.confirm.warning({
379
+ title: ibiz.i18n.t(
380
+ `util.appUtil.${isBatchRemove ? "clearTopic" : "aiTitle"}`
381
+ ),
382
+ desc: ibiz.i18n.t(
383
+ `util.appUtil.${isBatchRemove ? "clearTopicDesc" : "aiDesc"}`
384
+ )
385
+ });
386
+ return result;
387
+ };
388
+ topicOptions.action = async (action, context2, params2, data2, event) => {
389
+ if (action === "LINK")
390
+ await ibiz.openView.push(data2.url);
391
+ return true;
392
+ };
393
+ topicOptions.configService = (appid, storageType, subType) => {
394
+ return new ConfigService(appid, storageType, subType);
395
+ };
396
+ const chatOptions = {};
397
+ if (context.srfaiappendcurdata === "true") {
398
+ chatOptions.appendCurData = data;
399
+ } else if (params.hasOwnProperty("srfaiappendcurdata")) {
400
+ chatOptions.appendCurData = params.srfaiappendcurdata === "true" ? data : void 0;
401
+ delete params.srfaiappendcurdata;
402
+ }
403
+ if (params.hasOwnProperty("srfaiappendcurcontent")) {
404
+ chatOptions.appendCurContent = StringUtil.fill(
405
+ params.srfaiappendcurcontent,
406
+ context,
407
+ params,
408
+ data
409
+ );
410
+ delete params.srfaiappendcurcontent;
411
+ }
412
+ if (params.hasOwnProperty("autoquestion")) {
413
+ chatOptions.autoQuestion = params.autoquestion !== "false";
414
+ delete params.autoquestion;
415
+ }
416
+ if (params.hasOwnProperty("srfaiappendresource")) {
417
+ chatOptions.appendCurResource = StringUtil.fill(
418
+ params.srfaiappendresource,
419
+ context,
420
+ params,
421
+ data
422
+ );
423
+ delete params.srfaiappendresource;
424
+ }
425
+ if (params.hasOwnProperty("srfmode")) {
426
+ chatOptions.srfMode = params.srfmode;
427
+ delete params.srfmode;
428
+ }
429
+ if (params.hasOwnProperty("srfaiagent")) {
430
+ chatOptions.activeAIAgentID = params.srfaiagent;
431
+ delete params.srfaiagent;
432
+ }
433
+ let enableAIAgentChange = ibiz.config.common.enableAIAgentChange;
434
+ if (params.hasOwnProperty("srfenableaiagentchange")) {
435
+ enableAIAgentChange = params.srfenableaiagentchange === "true";
436
+ delete params.srfenableaiagentchange;
437
+ }
438
+ chatOptions.enableAIAgentChange = enableAIAgentChange;
439
+ const aiAgentlist = await this.getAIAgentList(context, params);
440
+ chatOptions.aiAgentlist = aiAgentlist;
441
+ if (deACMode) {
442
+ const {
443
+ contentToolbarItems,
444
+ footerToolbarItems,
445
+ questionToolbarItems,
446
+ otherToolbarItems
447
+ } = this.calcAiToolbarItemsByAc(deACMode);
448
+ chatOptions.contentToolbarItems = contentToolbarItems;
449
+ chatOptions.footerToolbarItems = footerToolbarItems;
450
+ chatOptions.questionToolbarItems = questionToolbarItems;
451
+ chatOptions.otherToolbarItems = otherToolbarItems;
452
+ }
453
+ let id = "";
454
+ let abortController;
455
+ let asyncacitonid = "";
456
+ const { chatInstance, view, ctrl } = args;
457
+ chatOptions.history = async (ctx, param, other) => {
458
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
459
+ const historyRequestData = {};
460
+ if (other.appendCurData) {
461
+ Object.assign(historyRequestData, {
462
+ ...other.appendCurData
463
+ });
464
+ }
465
+ if (other.sessionid) {
466
+ Object.assign(historyRequestData, {
467
+ sessionid: other.sessionid
468
+ });
469
+ }
470
+ if (other.srfaiagent) {
471
+ Object.assign(historyRequestData, {
472
+ srfaiagent: other.srfaiagent
473
+ });
474
+ }
475
+ if (other.srfmode) {
476
+ Object.assign(historyRequestData, {
477
+ mode: other.srfmode
478
+ });
479
+ }
480
+ const result = await deService.aiChatHistory(
481
+ ctx,
482
+ param,
483
+ historyRequestData
484
+ );
485
+ if (result.data && Array.isArray(result.data)) {
486
+ let preMsg;
487
+ result.data.forEach((item) => {
488
+ if (item.role === "TOOL") {
489
+ if (preMsg && item.content) {
490
+ chatInstance.aiChat.updateRecommendPrompt(
491
+ preMsg,
492
+ item.content
493
+ );
494
+ }
495
+ } else {
496
+ const msg = {
497
+ messageid: createUUID(),
498
+ state: 30,
499
+ type: "DEFAULT",
500
+ role: item.role,
501
+ content: item.content,
502
+ completed: true
503
+ };
504
+ preMsg = msg;
505
+ chatInstance.aiChat.addMessage(msg);
506
+ }
507
+ });
508
+ }
509
+ return true;
510
+ };
511
+ chatOptions.question = async (aiChat, ctx, param, other, arr, sessionid, srfaiagent, srfmode) => {
512
+ id = createUUID();
513
+ abortController = new AbortController();
514
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
515
+ try {
516
+ const questionRequestData = {
517
+ messages: arr,
518
+ sessionid
519
+ };
520
+ if (srfaiagent) {
521
+ questionRequestData.srfaiagent = srfaiagent;
522
+ }
523
+ if (srfmode) {
524
+ questionRequestData.mode = srfmode;
525
+ }
526
+ await deService.aiChatSse(
527
+ (msg) => {
528
+ if (msg.actionstate === 20 && msg.actionresult) {
529
+ asyncacitonid = msg.asyncacitonid;
530
+ aiChat.addMessage({
531
+ messageid: id,
532
+ state: msg.actionstate,
533
+ type: "DEFAULT",
534
+ role: "ASSISTANT",
535
+ content: msg.actionresult,
536
+ status: "pending"
537
+ });
538
+ } else if (msg.actionstate === 30 && msg.actionresult) {
539
+ const result = JSON.parse(msg.actionresult);
540
+ const choices = result.choices;
541
+ if (choices && choices.length > 0) {
542
+ aiChat.replaceMessage({
543
+ messageid: id,
544
+ state: msg.actionstate,
545
+ type: "DEFAULT",
546
+ role: "ASSISTANT",
547
+ content: choices[0].content || "",
548
+ realmessageid: choices[0].messageid,
549
+ status: "sent"
550
+ });
551
+ }
552
+ } else if (msg.actionstate === 40) {
553
+ aiChat.replaceMessage({
554
+ messageid: id,
555
+ state: msg.actionstate,
556
+ type: "ERROR",
557
+ role: "ASSISTANT",
558
+ content: msg.actionresult,
559
+ status: "failed"
560
+ });
561
+ }
562
+ },
563
+ abortController,
564
+ ctx,
565
+ param,
566
+ { ...questionRequestData }
567
+ );
568
+ } catch (error) {
569
+ aiChat.replaceMessage({
570
+ messageid: id,
571
+ state: 40,
572
+ type: "ERROR",
573
+ role: "ASSISTANT",
574
+ content: error.message || ibiz.i18n.t("app.aiError"),
575
+ status: "failed"
576
+ });
577
+ abortController == null ? void 0 : abortController.abort();
578
+ } finally {
579
+ aiChat.completeMessage(id, true);
580
+ return true;
581
+ }
582
+ };
583
+ chatOptions.abortQuestion = async (aiChat, ctx, param, other) => {
584
+ abortController == null ? void 0 : abortController.abort();
585
+ if (asyncacitonid) {
586
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
587
+ const abortRequestData = { asyncacitonid };
588
+ if (other.sessionid) {
589
+ Object.assign(abortRequestData, {
590
+ sessionid: other.sessionid
591
+ });
592
+ }
593
+ const result = await deService.aiChatCancel(
594
+ ctx,
595
+ param,
596
+ abortRequestData
597
+ );
598
+ asyncacitonid = "";
599
+ }
600
+ await aiChat.stopMessage({
601
+ messageid: id,
602
+ state: 30,
603
+ type: "DEFAULT",
604
+ role: "ASSISTANT",
605
+ content: "",
606
+ status: "canceled"
607
+ });
608
+ await aiChat.completeMessage(id, true);
609
+ };
610
+ chatOptions.recommendPrompt = async (ctx, param, other) => {
611
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
612
+ const tempParams = { ...param };
613
+ if (other.srfaiagent) {
614
+ tempParams.srfaiagent = other.srfaiagent;
615
+ }
616
+ const result = await deService.aiChatRecommendPrompt(
617
+ ctx,
618
+ tempParams,
619
+ other.message
620
+ );
621
+ if (result.ok && result.data) {
622
+ const choices = result.data.choices;
623
+ if (choices && choices.length > 0) {
624
+ return choices[0];
625
+ }
626
+ return null;
627
+ }
628
+ return null;
629
+ };
630
+ chatOptions.uploader = {
631
+ onUpload: async (file, reportProgress, options) => {
632
+ const { uploadUrl } = ibiz.util.file.calcFileUpDownUrl(
633
+ (options == null ? void 0 : options.context) || context,
634
+ (options == null ? void 0 : options.params) || params,
635
+ {},
636
+ { enableNoAccess: true }
637
+ );
638
+ const headers = ibiz.util.file.getUploadHeaders();
639
+ const formData = new FormData();
640
+ formData.append("file", file);
641
+ const res = await ibiz.net.axios({
642
+ url: uploadUrl,
643
+ method: "post",
644
+ headers,
645
+ data: formData,
646
+ onUploadProgress: (progressEvent) => {
647
+ const percent = progressEvent.loaded / progressEvent.total * 100;
648
+ reportProgress(percent);
649
+ }
650
+ });
651
+ return res.data;
652
+ }
653
+ };
654
+ chatOptions.extendToolbarClick = async (event, source, context2, params2, data2) => {
655
+ var _a, _b, _c;
656
+ const { id: id2, isPluginApp } = source;
657
+ let appId = source.appId;
658
+ const tempContext = IBizContext.create(context2);
659
+ if (isPluginApp) {
660
+ const mainApp = ibiz.hub.getApp();
661
+ const targetApp = (_a = mainApp.model.subAppRefs) == null ? void 0 : _a.find(
662
+ (subAppRef) => subAppRef.appId.endsWith(appId)
663
+ );
664
+ if (targetApp) {
665
+ const targetAppId = targetApp.appId;
666
+ tempContext.srfappid = targetAppId;
667
+ appId = targetAppId;
668
+ }
669
+ }
670
+ const result = await UIActionUtil.exec(
671
+ id2,
672
+ {
673
+ view,
674
+ ctrl,
675
+ context: tempContext,
676
+ params: params2,
677
+ data: [data2],
678
+ event
679
+ },
680
+ appId
681
+ );
682
+ if (result.closeView) {
683
+ view.closeView({ ok: true });
684
+ } else if (result.refresh) {
685
+ switch (result.refreshMode) {
686
+ case 1:
687
+ view.callUIAction(SysUIActionTag.REFRESH);
688
+ break;
689
+ case 2:
690
+ (_b = view.parentView) == null ? void 0 : _b.callUIAction(SysUIActionTag.REFRESH);
691
+ break;
692
+ case 3:
693
+ (_c = view.getTopView()) == null ? void 0 : _c.callUIAction(SysUIActionTag.REFRESH);
694
+ break;
695
+ default:
696
+ }
697
+ }
698
+ return result;
699
+ };
700
+ return { containerOptions, topicOptions, chatOptions };
701
+ }
702
+ /**
703
+ * 计算界面行为扩展AI聊天工具栏项
704
+ * @param deACMode 自填模式
705
+ */
706
+ calcAiToolbarItemsByAc(deACMode) {
707
+ var _a;
708
+ const contentToolbarItems = [];
709
+ const footerToolbarItems = [];
710
+ const questionToolbarItems = [];
711
+ const functionToolbarItems = [];
712
+ const inlineToolbarItems = [];
713
+ const otherToolbarItems = [];
714
+ if (!deACMode || !deACMode.deuiactionGroup) {
715
+ return {
716
+ contentToolbarItems,
717
+ footerToolbarItems,
718
+ questionToolbarItems,
719
+ otherToolbarItems,
720
+ functionToolbarItems,
721
+ inlineToolbarItems
722
+ };
723
+ }
724
+ (_a = deACMode.deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.forEach(
725
+ (item) => {
726
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
727
+ const toolbarItem = {
728
+ appId: item.appId,
729
+ id: item.uiactionId,
730
+ label: item.showCaption ? item.caption : "",
731
+ title: item.tooltip,
732
+ icon: {
733
+ showIcon: item.showIcon,
734
+ cssClass: (_a2 = item.sysImage) == null ? void 0 : _a2.cssClass,
735
+ imagePath: (_b = item.sysImage) == null ? void 0 : _b.imagePath
736
+ }
737
+ };
738
+ if (item.sysImage && item.sysImage.imagePath && !item.sysImage.imagePath.startsWith("http")) {
739
+ toolbarItem.icon.imagePath = `${ibiz.env.assetsUrl}/images/${item.sysImage.imagePath}`;
740
+ }
741
+ if ((_c = item.uiactionId) == null ? void 0 : _c.startsWith("mob_msg_content_")) {
742
+ contentToolbarItems.push(toolbarItem);
743
+ } else if ((_d = item.uiactionId) == null ? void 0 : _d.startsWith("mob_msg_footer_")) {
744
+ footerToolbarItems.push(toolbarItem);
745
+ } else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("mob_question_")) {
746
+ questionToolbarItems.push(toolbarItem);
747
+ } else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("mob_function_")) {
748
+ functionToolbarItems.push(toolbarItem);
749
+ } else if (((_g = item.uiactionId) == null ? void 0 : _g.startsWith("mob_inline")) || item.refUIActionGroup && ((_h = item.refUIActionGroup.id) == null ? void 0 : _h.startsWith("mob_inline"))) {
750
+ inlineToolbarItems.push(toolbarItem);
751
+ } else {
752
+ otherToolbarItems.push(toolbarItem);
753
+ }
754
+ }
755
+ );
756
+ return {
757
+ contentToolbarItems,
758
+ footerToolbarItems,
759
+ questionToolbarItems,
760
+ otherToolbarItems,
761
+ functionToolbarItems,
762
+ inlineToolbarItems
763
+ };
764
+ }
765
+ /**
766
+ * 获取AI代理列表
767
+ * @param context
768
+ * @param params
769
+ */
770
+ async getAIAgentList(context, params, editorParams) {
771
+ const emptyList = [];
772
+ const app = ibiz.hub.getApp(ibiz.env.appId);
773
+ const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
774
+ if (!aiAgentUtil) {
775
+ return emptyList;
776
+ }
777
+ const utilService = new UtilService(aiAgentUtil);
778
+ const resultParams = { ...params, page: 0, size: 1e3 };
779
+ if (editorParams && editorParams.srfaiagentscope) {
780
+ Object.assign(resultParams, {
781
+ srfaiagentscope: editorParams.srfaiagentscope
782
+ });
783
+ }
784
+ const data = await utilService.load("", context, resultParams);
785
+ if (!data || data.length === 0) {
786
+ return emptyList;
787
+ }
788
+ return data;
789
+ }
790
+ /**
791
+ * 获取会话标识(TOPIC:适用于多话题场景;INLINE:适用于ai行内会话场景;TEMP:适用于传统ai编辑器会话场景)
792
+ * @param sessionID
793
+ */
794
+ getChatSessionId(type, sessionID) {
795
+ let tempSessionID = "";
796
+ switch (type) {
797
+ case "TOPIC":
798
+ tempSessionID += this.TOPIC_CHAT_PREFIX;
799
+ break;
800
+ case "INLINE":
801
+ tempSessionID += this.INLINE_CHAT_SUFFIX;
802
+ break;
803
+ case "TEMP":
804
+ tempSessionID += this.TEMP_CHAT_SUFFIX;
805
+ break;
806
+ default:
807
+ tempSessionID += this.UNKOWN_CHAT_SUFFIX;
808
+ break;
809
+ }
810
+ tempSessionID += `@${sessionID || createUUID()}@${(/* @__PURE__ */ new Date()).getTime()}`;
811
+ return tempSessionID;
812
+ }
813
+ /**
814
+ * 获取AI会话应用功能
815
+ * @returns
816
+ */
817
+ async getAIResourceUtil() {
818
+ const app = ibiz.hub.getApp(ibiz.env.appId);
819
+ const aiSessionUtil = app.getAppUtil("DYNAMICAISESSION", "CUSTOM");
820
+ return aiSessionUtil;
821
+ }
822
+ /**
823
+ * 获取AI资源参数
824
+ * @returns
825
+ */
826
+ async getAIResourceOptions(context, params) {
827
+ const resourceOptions = {};
828
+ if (ibiz.config.common.aiResourceMode) {
829
+ resourceOptions.resourceMode = ibiz.config.common.aiResourceMode;
830
+ return resourceOptions;
831
+ }
832
+ const aiSessionUtil = await this.getAIResourceUtil();
833
+ resourceOptions.resourceMode = aiSessionUtil ? "REMOTE" : "LOCAL";
834
+ if (!aiSessionUtil) {
835
+ return resourceOptions;
836
+ }
837
+ const utilService = new AIUtilService(aiSessionUtil);
838
+ resourceOptions.getSessionList = async (args = {}) => {
839
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
840
+ const result = await utilService.getSessionList(context, tempParams);
841
+ return result;
842
+ };
843
+ resourceOptions.updateSession = async (realID, data) => {
844
+ const result = await utilService.updateSession(
845
+ context,
846
+ params,
847
+ realID,
848
+ data
849
+ );
850
+ return result;
851
+ };
852
+ resourceOptions.deleteSession = async (realID) => {
853
+ const result = await utilService.deleteSession(context, params, realID);
854
+ return result;
855
+ };
856
+ resourceOptions.getMessages = async (args = {}) => {
857
+ const tempParams = { ...params, page: 0, size: 1e3, ...args };
858
+ const result = await utilService.getMessageList(context, tempParams);
859
+ return result;
860
+ };
861
+ resourceOptions.deleteMessage = async (messageID) => {
862
+ const result = await utilService.deleteMessage(
863
+ context,
864
+ params,
865
+ messageID
866
+ );
867
+ return result;
868
+ };
869
+ resourceOptions.likeMessage = async (messageID) => {
870
+ const result = await utilService.likeMessage(context, params, messageID);
871
+ return result;
872
+ };
873
+ resourceOptions.dislikeMessage = async (messageID, feedbackContent) => {
874
+ var _a, _b;
875
+ const overlay = ibiz.overlay.createDrawer(
876
+ (modal) => {
877
+ return h(AIFeedback, {
878
+ modal,
879
+ content: feedbackContent
880
+ });
881
+ },
882
+ void 0,
883
+ {
884
+ height: "auto",
885
+ placement: "bottom",
886
+ attrs: {
887
+ closeable: false
888
+ }
889
+ }
890
+ );
891
+ overlay.present();
892
+ const result = await overlay.onWillDismiss();
893
+ if (!result.ok)
894
+ return false;
895
+ const content = (_b = (_a = result.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.feedbackContent;
896
+ const _result = await utilService.dislikeMessage(
897
+ context,
898
+ params,
899
+ messageID,
900
+ content
901
+ );
902
+ return _result;
903
+ };
904
+ resourceOptions.cancelFeedback = async (messageID) => {
905
+ const result = await utilService.cancelFeedback(
906
+ context,
907
+ params,
908
+ messageID
909
+ );
910
+ return result;
911
+ };
912
+ resourceOptions.clearAllSession = async (excludeSessionID) => {
913
+ const result = await utilService.clearAllSession(
914
+ context,
915
+ params,
916
+ excludeSessionID
917
+ );
918
+ return result;
919
+ };
920
+ resourceOptions.clearAllMessageBySessionId = async (realID) => {
921
+ const result = await utilService.clearAllMessageBySessionId(
922
+ context,
923
+ params,
924
+ realID
925
+ );
926
+ return result;
927
+ };
928
+ return resourceOptions;
929
+ }
930
+ }
931
+
932
+ export { AIChatUtil };