@fle-ui/plus-im-record 0.0.6-beta.0 → 0.0.8-beta.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 (67) hide show
  1. package/package.json +2 -2
  2. package/es/@types/index.d.ts +0 -620
  3. package/es/CardTag/index.d.ts +0 -3
  4. package/es/CardTag/index.js +0 -18
  5. package/es/ChatMessageItem/index.d.ts +0 -17
  6. package/es/ChatMessageItem/index.js +0 -130
  7. package/es/ChatMessageItem/index.less +0 -108
  8. package/es/ChatMessageList/index.d.ts +0 -26
  9. package/es/ChatMessageList/index.js +0 -56
  10. package/es/ChatMessageList/index.less +0 -33
  11. package/es/GoodsCard/index.d.ts +0 -14
  12. package/es/GoodsCard/index.js +0 -93
  13. package/es/GoodsCard/index.less +0 -49
  14. package/es/GoodsOrderCard/index.d.ts +0 -17
  15. package/es/GoodsOrderCard/index.js +0 -161
  16. package/es/GoodsOrderCard/index.less +0 -81
  17. package/es/Icon/index.d.ts +0 -8
  18. package/es/Icon/index.js +0 -11
  19. package/es/ParseSession/index.d.ts +0 -21
  20. package/es/ParseSession/index.js +0 -454
  21. package/es/ParseSession/index.less +0 -181
  22. package/es/api/index.d.ts +0 -29
  23. package/es/api/index.js +0 -48
  24. package/es/common/const/index.d.ts +0 -46
  25. package/es/common/const/index.js +0 -82
  26. package/es/common/utils/index.d.ts +0 -33
  27. package/es/common/utils/index.js +0 -169
  28. package/es/index.d.ts +0 -25
  29. package/es/index.js +0 -76
  30. package/es/styles/extends.less +0 -50
  31. package/es/styles/index.less +0 -35
  32. package/es/styles/vars.less +0 -8
  33. package/es/utils/index.d.ts +0 -14
  34. package/es/utils/index.js +0 -50
  35. package/lib/@types/index.d.ts +0 -620
  36. package/lib/CardTag/index.d.ts +0 -3
  37. package/lib/CardTag/index.js +0 -25
  38. package/lib/ChatMessageItem/index.d.ts +0 -17
  39. package/lib/ChatMessageItem/index.js +0 -136
  40. package/lib/ChatMessageItem/index.less +0 -108
  41. package/lib/ChatMessageList/index.d.ts +0 -26
  42. package/lib/ChatMessageList/index.js +0 -63
  43. package/lib/ChatMessageList/index.less +0 -33
  44. package/lib/GoodsCard/index.d.ts +0 -14
  45. package/lib/GoodsCard/index.js +0 -103
  46. package/lib/GoodsCard/index.less +0 -49
  47. package/lib/GoodsOrderCard/index.d.ts +0 -17
  48. package/lib/GoodsOrderCard/index.js +0 -169
  49. package/lib/GoodsOrderCard/index.less +0 -81
  50. package/lib/Icon/index.d.ts +0 -8
  51. package/lib/Icon/index.js +0 -18
  52. package/lib/ParseSession/index.d.ts +0 -21
  53. package/lib/ParseSession/index.js +0 -456
  54. package/lib/ParseSession/index.less +0 -181
  55. package/lib/api/index.d.ts +0 -29
  56. package/lib/api/index.js +0 -55
  57. package/lib/common/const/index.d.ts +0 -46
  58. package/lib/common/const/index.js +0 -88
  59. package/lib/common/utils/index.d.ts +0 -33
  60. package/lib/common/utils/index.js +0 -183
  61. package/lib/index.d.ts +0 -25
  62. package/lib/index.js +0 -85
  63. package/lib/styles/extends.less +0 -50
  64. package/lib/styles/index.less +0 -35
  65. package/lib/styles/vars.less +0 -8
  66. package/lib/utils/index.d.ts +0 -14
  67. package/lib/utils/index.js +0 -56
@@ -1,454 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- import "antd/es/message/style";
3
- import _message from "antd/es/message";
4
- import "antd/es/button/style";
5
- import _Button from "antd/es/button";
6
- import "antd/es/image/style";
7
- import _Image from "antd/es/image";
8
- import "antd/es/space/style";
9
- import _Space from "antd/es/space";
10
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
20
- import reactStringReplace from 'react-string-replace';
21
- import { parseFileSize, addUrlSearch } from '../utils';
22
- import { ProForm, ProFormText } from '@ant-design/pro-components';
23
- import { DownloadOutlined } from '@ant-design/icons';
24
- import { fileTypes, imMsgTypes } from '../common/const';
25
- import { downloadByUrl, getSimplifyMsg } from '../common/utils';
26
- import Icon from '../Icon';
27
- import GoodsCard from '../GoodsCard';
28
- import GoodsOrderCard from '../GoodsOrderCard';
29
- import { ImContext } from '..';
30
- import './index.less';
31
- export var pauseAllAudio = function pauseAllAudio() {
32
- var audio = document.getElementById('fxMessageAudio');
33
- audio === null || audio === void 0 ? void 0 : audio.pause();
34
- return audio;
35
- };
36
- export var pauseOtherVideo = function pauseOtherVideo(idClient) {
37
- var videoElements = document.getElementsByTagName('video');
38
- for (var i = 0; i < videoElements.length; i++) {
39
- if (videoElements[i].id !== "fxMessageVideo-".concat(idClient)) {
40
- videoElements[i].pause();
41
- }
42
- }
43
- };
44
- export var pauseAllVideo = function pauseAllVideo() {
45
- var videoElements = document.getElementsByTagName('video');
46
- for (var i = 0; i < videoElements.length; i++) {
47
- if (videoElements[i].id.startsWith('fxMessageVideo-')) {
48
- videoElements[i].pause();
49
- }
50
- }
51
- };
52
- //
53
- var ParseSession = function ParseSession(_ref) {
54
- var prefix = _ref.prefix,
55
- keyword = _ref.keyword,
56
- msg = _ref.msg,
57
- h5 = _ref.h5,
58
- isSessionEnd = _ref.isSessionEnd,
59
- onChartHistoryClick = _ref.onChartHistoryClick,
60
- recordSession = _ref.recordSession;
61
- var _useContext = useContext(ImContext),
62
- api = _useContext.api;
63
- var formRef = useRef();
64
- var audioRef = useRef(null);
65
- var _useState = useState(false),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- animationFlag = _useState2[0],
68
- setAnimationFlag = _useState2[1];
69
- var _useState3 = useState(),
70
- _useState4 = _slicedToArray(_useState3, 2),
71
- contactInfo = _useState4[0],
72
- setContactInfo = _useState4[1];
73
- var attach = msg.attach || {};
74
- var renderText = function renderText(preset) {
75
- var text = reactStringReplace(attach.content, /(https?:\/\/\S+)/gi, function (match) {
76
- return /*#__PURE__*/React.createElement("a", {
77
- key: msg.idClient,
78
- href: match,
79
- target: "_blank",
80
- rel: "noreferrer"
81
- }, match);
82
- });
83
- var renderKeywordText = function renderKeywordText(str) {
84
- if (!str || !keyword || typeof str !== 'string') return str;
85
- var strArr = str.split(keyword);
86
- return strArr.map(function (item, index) {
87
- var isKeyword = index < strArr.length - 1;
88
- return /*#__PURE__*/React.createElement("span", {
89
- key: index
90
- }, item, isKeyword && /*#__PURE__*/React.createElement("span", {
91
- style: {
92
- backgroundColor: 'orange',
93
- borderRadius: 3
94
- }
95
- }, keyword));
96
- });
97
- };
98
- return /*#__PURE__*/React.createElement("div", {
99
- className: "".concat(prefix, "-text")
100
- }, preset || text.map(renderKeywordText));
101
- };
102
- var renderImage = function renderImage() {
103
- return /*#__PURE__*/React.createElement(_Image, {
104
- loading: "lazy",
105
- className: "".concat(prefix, "-image"),
106
- fallback: "https://yx-web-nosdn.netease.im/common/33d3e1fa8de771277ea4466564ef37aa/emptyImg.png",
107
- src: "".concat(attach.content.url, "?x-oss-process=image/resize,h_150,m_lfit"),
108
- height: 150,
109
- preview: {
110
- src: attach.content.url,
111
- toolbarRender: function toolbarRender(originalNode) {
112
- var _originalNode$props;
113
- return h5 ? null : /*#__PURE__*/React.createElement(_Space, {
114
- size: 12,
115
- className: "fx-preview-toolbar-wrapper"
116
- }, /*#__PURE__*/React.createElement(DownloadOutlined, {
117
- onClick: function onClick() {
118
- attach.content.url && downloadByUrl(attach.content.url);
119
- }
120
- }), (_originalNode$props = originalNode.props) === null || _originalNode$props === void 0 ? void 0 : _originalNode$props.children);
121
- }
122
- }
123
- });
124
- };
125
- var renderFaq = function renderFaq() {
126
- var faqList = attach.content || [];
127
- return /*#__PURE__*/React.createElement("div", {
128
- className: "".concat(prefix, "-helps")
129
- }, /*#__PURE__*/React.createElement("img", {
130
- src: "https://qa-oss.elebuys.com/tmpdir/202402241614290002520093.png"
131
- }), faqList.map(function (item) {
132
- return /*#__PURE__*/React.createElement("p", {
133
- key: item.id,
134
- onClick: function onClick() {}
135
- }, /*#__PURE__*/React.createElement("span", {
136
- className: "title"
137
- }, item.title), /*#__PURE__*/React.createElement(Icon, {
138
- type: 'icon-zhankaishouqi',
139
- rotate: -90,
140
- style: {
141
- color: '#aaa',
142
- fontSize: 13,
143
- flexShrink: 0,
144
- fontWeight: 400
145
- }
146
- }));
147
- }));
148
- };
149
- var renderFaqLink = function renderFaqLink() {
150
- var _attach$content, _attach$content2, _attach$content3;
151
- return /*#__PURE__*/React.createElement("div", {
152
- className: "".concat(prefix, "-faqlink")
153
- }, /*#__PURE__*/React.createElement("h3", null, (_attach$content = attach.content) === null || _attach$content === void 0 ? void 0 : _attach$content.title), /*#__PURE__*/React.createElement("a", {
154
- href: (_attach$content2 = attach.content) === null || _attach$content2 === void 0 ? void 0 : _attach$content2.url,
155
- target: "_blank",
156
- rel: "noreferrer"
157
- }, (_attach$content3 = attach.content) === null || _attach$content3 === void 0 ? void 0 : _attach$content3.url));
158
- };
159
- useEffect(function () {
160
- if (attach.type === 'formCustomer' && msg.idServer) {
161
- api.getContact({
162
- msgId: msg.idServer
163
- }).then(function (res) {
164
- var _formRef$current;
165
- setContactInfo(res.data);
166
- (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldsValue(res.data || {});
167
- });
168
- }
169
- }, [msg.idServer, attach.type, attach.submission]);
170
- var isSubmitForm = useMemo(function () {
171
- if (contactInfo && contactInfo.contactName && contactInfo.contactPhone || attach.submission) {
172
- return true;
173
- } else {
174
- return false;
175
- }
176
- }, [contactInfo, attach]);
177
- var renderFormCustomer = function renderFormCustomer() {
178
- return /*#__PURE__*/React.createElement("div", {
179
- className: "".concat(prefix, "-form")
180
- }, /*#__PURE__*/React.createElement("img", {
181
- src: "https://qa-oss.elebuys.com/tmpdir/202402261955060002520212.png"
182
- }), /*#__PURE__*/React.createElement(ProForm, {
183
- formRef: formRef,
184
- autoFocusFirstInput: false,
185
- disabled: isSubmitForm || isSessionEnd,
186
- initialValues: contactInfo || {},
187
- submitter: {
188
- render: function render() {
189
- return /*#__PURE__*/React.createElement(_Button, {
190
- style: {
191
- width: '100%'
192
- },
193
- type: "primary",
194
- size: "large",
195
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
196
- return _regeneratorRuntime().wrap(function _callee$(_context) {
197
- while (1) switch (_context.prev = _context.next) {
198
- case 0:
199
- case "end":
200
- return _context.stop();
201
- }
202
- }, _callee);
203
- }))
204
- }, isSubmitForm ? '已提交' : '提交');
205
- }
206
- }
207
- }, /*#__PURE__*/React.createElement(ProFormText, {
208
- rules: [{
209
- required: true,
210
- message: '请输入企业名称'
211
- }],
212
- name: "enterpriseName",
213
- placeholder: "\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0"
214
- }), /*#__PURE__*/React.createElement(ProFormText, {
215
- rules: [{
216
- required: true,
217
- message: '请输入姓名'
218
- }],
219
- name: "contactName",
220
- placeholder: "\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA\u59D3\u540D"
221
- }), /*#__PURE__*/React.createElement(ProFormText, {
222
- rules: [{
223
- required: true,
224
- message: '请输入手机号'
225
- }, {
226
- validator: function () {
227
- var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_, value) {
228
- var reg;
229
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
230
- while (1) switch (_context2.prev = _context2.next) {
231
- case 0:
232
- reg = /^1\d{10}$/;
233
- if (!(value && (value === null || value === void 0 ? void 0 : value.length) !== 11 && !reg.test(value))) {
234
- _context2.next = 5;
235
- break;
236
- }
237
- return _context2.abrupt("return", Promise.reject(new Error('手机号格式不正确')));
238
- case 5:
239
- return _context2.abrupt("return", Promise.resolve());
240
- case 6:
241
- case "end":
242
- return _context2.stop();
243
- }
244
- }, _callee2);
245
- }));
246
- function validator(_x, _x2) {
247
- return _validator.apply(this, arguments);
248
- }
249
- return validator;
250
- }()
251
- }],
252
- name: "contactPhone",
253
- placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u8054\u7CFB\u7535\u8BDD"
254
- })));
255
- };
256
- var renderNotification = function renderNotification() {
257
- return null;
258
- };
259
- var renderAudio = function renderAudio() {
260
- var flow = msg.flow;
261
- var duration = Math.floor(attach.content.dur) || 0;
262
- var durations = {
263
- mm: Math.floor(duration / 60),
264
- ss: duration % 60
265
- };
266
- return /*#__PURE__*/React.createElement("div", {
267
- className: "".concat(prefix, "-audio"),
268
- ref: audioRef
269
- }, /*#__PURE__*/React.createElement("div", {
270
- className: flow === 'in' ? "".concat(prefix, "-audio-in") : "".concat(prefix, "-audio-out"),
271
- onClick: function onClick() {
272
- var _audioRef$current;
273
- pauseAllVideo();
274
- var oldAudio = pauseAllAudio();
275
- var msgId = oldAudio === null || oldAudio === void 0 ? void 0 : oldAudio.getAttribute('msgId');
276
- if (msgId === msg.idClient) {
277
- setAnimationFlag(false);
278
- return;
279
- }
280
- var audio = new Audio(attach.content.url);
281
- audio.id = 'fxMessageAudio';
282
- audio.setAttribute('msgId', msg.idClient);
283
- audio.play();
284
- (_audioRef$current = audioRef.current) === null || _audioRef$current === void 0 ? void 0 : _audioRef$current.appendChild(audio);
285
- audio.addEventListener('ended', function () {
286
- var _audio$parentNode;
287
- setAnimationFlag(false);
288
- (_audio$parentNode = audio.parentNode) === null || _audio$parentNode === void 0 ? void 0 : _audio$parentNode.removeChild(audio);
289
- });
290
- audio.addEventListener('pause', function () {
291
- var _audio$parentNode2;
292
- setAnimationFlag(false);
293
- (_audio$parentNode2 = audio.parentNode) === null || _audio$parentNode2 === void 0 ? void 0 : _audio$parentNode2.removeChild(audio);
294
- });
295
- setAnimationFlag(true);
296
- }
297
- }, /*#__PURE__*/React.createElement("span", null, "".concat(durations.mm > 0 ? "".concat(durations.mm, "'") : '', " ").concat(durations.ss, "\"")), /*#__PURE__*/React.createElement("span", {
298
- className: "".concat(prefix, "-audio-icon")
299
- }, animationFlag ? /*#__PURE__*/React.createElement("img", {
300
- src: "https://qa-oss.elebuys.com/tmpdir/202401152050070000640984.gif"
301
- }) : /*#__PURE__*/React.createElement(Icon, {
302
- type: "icon-a-yuyin2"
303
- }))));
304
- };
305
- var renderVideo = function renderVideo() {
306
- var _attach$content4;
307
- var url = "".concat(attach.content.url, "?download=").concat(msg.idClient, ".").concat((_attach$content4 = attach.content) === null || _attach$content4 === void 0 ? void 0 : _attach$content4.ext);
308
- var poster = "".concat(attach.content.url, "?x-oss-process=video/snapshot,t_100,f_jpg,m_fast");
309
- return /*#__PURE__*/React.createElement("video", {
310
- poster: poster,
311
- playsInline: true,
312
- preload: "auto",
313
- src: url,
314
- id: "fxMessageVideo-".concat(msg.idClient),
315
- controls: true,
316
- onPlay: function onPlay() {
317
- pauseOtherVideo(msg.idClient);
318
- pauseAllAudio();
319
- }
320
- // onCanPlay={(e: any) => {
321
- // setTimeout(() => {
322
- // e.target?.pause();
323
- // }, 0);
324
- // }}
325
- ,
326
- onError: function onError() {
327
- _message.warning('视频播放失败');
328
- }
329
- });
330
- };
331
- var renderFile = function renderFile() {
332
- var _attach$content5, _attach$content6, _attach$content7;
333
- if (fileTypes.video.includes((_attach$content5 = attach.content) === null || _attach$content5 === void 0 ? void 0 : _attach$content5.ext)) {
334
- return renderVideo();
335
- }
336
- if (fileTypes.audio.includes((_attach$content6 = attach.content) === null || _attach$content6 === void 0 ? void 0 : _attach$content6.ext)) {
337
- return renderAudio();
338
- }
339
- if (fileTypes.img.includes((_attach$content7 = attach.content) === null || _attach$content7 === void 0 ? void 0 : _attach$content7.ext)) {
340
- return renderImage();
341
- }
342
- return /*#__PURE__*/React.createElement("div", {
343
- className: "".concat(prefix, "-file")
344
- }, /*#__PURE__*/React.createElement(Icon, {
345
- className: "".concat(prefix, "-file-icon"),
346
- type: 'icon-wenjian'
347
- }), /*#__PURE__*/React.createElement("div", {
348
- className: "".concat(prefix, "-file-info")
349
- }, /*#__PURE__*/React.createElement("a", {
350
- download: attach.content.fileName,
351
- href: addUrlSearch(attach.content.url, "download=".concat(attach.content.fileName)),
352
- target: "_blank",
353
- rel: "noreferrer"
354
- }, attach.content.fileName), /*#__PURE__*/React.createElement("span", null, parseFileSize(attach.content.size))));
355
- };
356
- var renderOrderCard = function renderOrderCard() {
357
- var _attach$content8, _attach$content9;
358
- return /*#__PURE__*/React.createElement(GoodsOrderCard, {
359
- prefix: prefix,
360
- recordSession: recordSession,
361
- orderSn: (_attach$content8 = attach.content) === null || _attach$content8 === void 0 ? void 0 : _attach$content8.orderSn,
362
- orderId: (_attach$content9 = attach.content) === null || _attach$content9 === void 0 ? void 0 : _attach$content9.orderId
363
- });
364
- };
365
- var renderGoodsCard = function renderGoodsCard() {
366
- return /*#__PURE__*/React.createElement(GoodsCard, {
367
- prefix: prefix,
368
- content: attach.content || {}
369
- });
370
- };
371
- var renderChartRecord = function renderChartRecord() {
372
- var _attach$content10, _attach$content11, _attach$content12;
373
- var records = ((_attach$content10 = attach.content) === null || _attach$content10 === void 0 ? void 0 : _attach$content10.items) || [];
374
- var msgIds = ((_attach$content11 = attach.content) === null || _attach$content11 === void 0 ? void 0 : _attach$content11.msgIds) || [];
375
- var title = (_attach$content12 = attach.content) === null || _attach$content12 === void 0 ? void 0 : _attach$content12.title;
376
- var list = records.filter(function (v) {
377
- var _v$attach;
378
- return ![imMsgTypes.event].includes((_v$attach = v.attach) === null || _v$attach === void 0 ? void 0 : _v$attach.type);
379
- }).slice(0, 4);
380
- return /*#__PURE__*/React.createElement("div", {
381
- className: "".concat(prefix, "-charthistory"),
382
- onClick: function onClick() {
383
- return onChartHistoryClick === null || onChartHistoryClick === void 0 ? void 0 : onChartHistoryClick({
384
- title: title,
385
- msgIds: msgIds
386
- });
387
- }
388
- }, /*#__PURE__*/React.createElement("h4", null, title), list.map(function (item, i) {
389
- return /*#__PURE__*/React.createElement("p", {
390
- key: i,
391
- className: "one-line-text"
392
- }, item.from, ": ", getSimplifyMsg(item));
393
- }), /*#__PURE__*/React.createElement("div", {
394
- className: "".concat(prefix, "-charthistory-from")
395
- }, /*#__PURE__*/React.createElement("span", {
396
- className: "".concat(prefix, "-charthistory-from-icon")
397
- }, /*#__PURE__*/React.createElement(Icon, {
398
- type: 'icon-kefu',
399
- style: {
400
- fontSize: 12,
401
- color: '#fff'
402
- }
403
- })), "\u7CFB\u7EDF\u8F6C\u53D1"));
404
- };
405
- var renderOfflineSupport = function renderOfflineSupport() {
406
- var _attach$content13, _attach$content14;
407
- return /*#__PURE__*/React.createElement("div", {
408
- className: "".concat(prefix, "-text")
409
- }, (_attach$content13 = attach.content) === null || _attach$content13 === void 0 ? void 0 : _attach$content13.supportDesc, ((_attach$content14 = attach.content) === null || _attach$content14 === void 0 ? void 0 : _attach$content14.contact) && /*#__PURE__*/React.createElement("a", {
410
- href: "tel:".concat(attach.content.contact),
411
- rel: "noreferrer"
412
- }, attach.content.contact));
413
- };
414
- var renderMsgContent = function renderMsgContent() {
415
- try {
416
- switch (attach.type) {
417
- case imMsgTypes.text:
418
- return renderText();
419
- case imMsgTypes.image:
420
- return renderImage();
421
- case imMsgTypes.video:
422
- return renderVideo();
423
- case imMsgTypes.audio:
424
- return renderAudio();
425
- case imMsgTypes.link:
426
- return renderText();
427
- case imMsgTypes.file:
428
- return renderFile();
429
- case imMsgTypes.faq:
430
- return renderFaq();
431
- case imMsgTypes.faqLink:
432
- return renderFaqLink();
433
- case imMsgTypes.formCustomer:
434
- return renderFormCustomer();
435
- case imMsgTypes.tip:
436
- return renderNotification();
437
- case imMsgTypes.order:
438
- return renderOrderCard();
439
- case imMsgTypes.product:
440
- return renderGoodsCard();
441
- case imMsgTypes.chatrecord:
442
- return renderChartRecord();
443
- case imMsgTypes.offlineSupport:
444
- return renderOfflineSupport();
445
- default:
446
- return '';
447
- }
448
- } catch (error) {
449
- return '';
450
- }
451
- };
452
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderMsgContent());
453
- };
454
- export default ParseSession;
@@ -1,181 +0,0 @@
1
- @prefix: chart-messages-item;
2
-
3
- .@{prefix} {
4
- &-text {
5
- padding: 8px;
6
- }
7
-
8
- &-image {
9
- // padding: 4px;
10
- border-radius: 6px;
11
- max-width: 200px;
12
- max-height: 200px;
13
- }
14
-
15
- video {
16
- width: 100%;
17
- height: 100%;
18
- max-width: 200px;
19
- max-height: 200px;
20
- border-radius: 6px;
21
- object-fit: fill;
22
- }
23
-
24
- &-audio {
25
- padding: 8px;
26
-
27
- &-in,
28
- &-out {
29
- width: 90px;
30
- display: flex;
31
- justify-content: space-between;
32
- cursor: pointer;
33
- .@{prefix}-audio-icon {
34
- display: flex;
35
- justify-content: center;
36
- align-items: center;
37
- margin-top: 2px;
38
- width: 16px;
39
- height: 16px;
40
- font-size: 16px;
41
- img {
42
- display: block;
43
- height: 100%;
44
- transform: translate(2px, 0);
45
- }
46
- }
47
- }
48
- &-in {
49
- flex-direction: row-reverse;
50
- .@{prefix}-audio-icon {
51
- transform: rotate(180deg);
52
- }
53
- }
54
- }
55
-
56
- &-file {
57
- display: flex;
58
- justify-content: space-between;
59
- padding: 8px 8px 8px 12px;
60
- &-icon {
61
- font-size: 28px;
62
- color: #2c6bffff;
63
- }
64
- &-info {
65
- padding-left: 10px;
66
- display: flex;
67
- flex-direction: column;
68
- color: #777;
69
- }
70
- }
71
-
72
- &-helps {
73
- width: 276px;
74
- color: #333;
75
- img {
76
- display: block;
77
- width: 276px;
78
- }
79
- p {
80
- margin: 0;
81
- padding: 10px 8px;
82
- font-size: 14px;
83
- border-top: 1px solid #e4ecff;
84
- cursor: pointer;
85
- display: flex;
86
- gap: 8px;
87
- .title {
88
- flex: 1;
89
- word-break: break-all;
90
- }
91
- }
92
- }
93
-
94
- &-faqlink {
95
- padding: 8px;
96
- h3 {
97
- margin: 0;
98
- font-size: 14px;
99
- color: #333;
100
- font-weight: 600;
101
- }
102
- }
103
-
104
- &-form {
105
- width: 272px;
106
- .fx-form {
107
- padding: 0 10px 10px 10px;
108
- }
109
-
110
- img {
111
- display: block;
112
- width: 272px;
113
- margin-bottom: 16px;
114
- }
115
-
116
- &-code {
117
- display: flex;
118
- justify-content: space-between;
119
- }
120
-
121
- .fx-form-item {
122
- margin-bottom: 20px;
123
- .fx-form-item-explain-error {
124
- font-size: 12px;
125
- }
126
- .fx-input[disabled] {
127
- color: #999;
128
- }
129
- }
130
- .fx-btn-primary:disabled {
131
- color: #999;
132
- }
133
- }
134
-
135
- &-charthistory {
136
- padding: 8px;
137
- min-width: 272px;
138
- max-width: 400px;
139
- cursor: pointer;
140
- h4 {
141
- font-weight: 600;
142
- margin-bottom: 5px;
143
- color: #333;
144
- }
145
- p {
146
- margin-bottom: 4px;
147
- font-size: 12px;
148
- color: #777;
149
- }
150
- &-from {
151
- display: flex;
152
- align-items: center;
153
- border-top: 1px solid #eee;
154
- padding-top: 5px;
155
- color: #777;
156
- font-size: 12px;
157
- &-icon {
158
- display: flex;
159
- justify-content: center;
160
- align-items: center;
161
- width: 16px;
162
- height: 16px;
163
- border-radius: 50%;
164
- margin-right: 3px;
165
- background-color: #2c6bffff;
166
- }
167
- }
168
- }
169
- }
170
-
171
- .fx-preview-toolbar-wrapper {
172
- position: fixed;
173
- bottom: 32px;
174
- left: 50%;
175
- padding: 0 24px;
176
- color: #fff;
177
- font-size: 20px;
178
- background-color: rgba(0, 0, 0, 0.1);
179
- border-radius: 100px;
180
- transform: translateX(-50%);
181
- }
package/es/api/index.d.ts DELETED
@@ -1,29 +0,0 @@
1
- declare const baseURLMap: {
2
- dev: string;
3
- test: string;
4
- qa: string;
5
- prod: string;
6
- };
7
- export type Env = keyof typeof baseURLMap;
8
- interface ApiMethods {
9
- getAccountInfoByAccid: (data: {
10
- accids: string[];
11
- }) => Promise<any>;
12
- getProductById: (data: {
13
- productId: number;
14
- relationId: string | number;
15
- relationType: string | number;
16
- }) => Promise<any>;
17
- getCSOrder: (data: {
18
- orderSn: number | string;
19
- orderId: any;
20
- accid: string;
21
- relationId?: string | number;
22
- relationType?: number;
23
- }) => Promise<any>;
24
- getContact: (params: {
25
- msgId?: string;
26
- }) => Promise<any>;
27
- }
28
- export declare const apiCreate: (_env?: Env, token?: string) => ApiMethods;
29
- export {};