@glodon-aiot/react-components 0.0.0-20251106104234

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 (92) hide show
  1. package/README.git.md +73 -0
  2. package/README.lib.md +135 -0
  3. package/dist/aiot-react-components.js +20191 -0
  4. package/dist/aiot-react-components.umd.cjs +183 -0
  5. package/dist/es/Button/index.mjs +48 -0
  6. package/dist/es/Button/style.less.mjs +4 -0
  7. package/dist/es/ConfirmableButton/index.mjs +59 -0
  8. package/dist/es/Drawable/Drawable.mjs +220 -0
  9. package/dist/es/Drawable/LineElement.mjs +27 -0
  10. package/dist/es/Drawable/MarkerElement.mjs +39 -0
  11. package/dist/es/Drawable/PolygonElement.mjs +88 -0
  12. package/dist/es/Drawable/index.mjs +16 -0
  13. package/dist/es/Drawable/state.mjs +134 -0
  14. package/dist/es/ExpandablePannel/index.mjs +94 -0
  15. package/dist/es/ExpandablePannel/style.less.mjs +4 -0
  16. package/dist/es/GOSImageMap/DrawableImageMap.mjs +49 -0
  17. package/dist/es/GOSImageMap/ImageMap.mjs +39 -0
  18. package/dist/es/IconButton/index.mjs +23 -0
  19. package/dist/es/IconButton/style.less.mjs +4 -0
  20. package/dist/es/Iconfont/index.mjs +8 -0
  21. package/dist/es/ImageMap/index.mjs +297 -0
  22. package/dist/es/ImageMap/style.less.mjs +4 -0
  23. package/dist/es/MouseTip/constant.mjs +9 -0
  24. package/dist/es/MouseTip/index.mjs +54 -0
  25. package/dist/es/MouseTip/style.less.mjs +4 -0
  26. package/dist/es/MouseTip/utils.mjs +70 -0
  27. package/dist/es/PanoramaRecordPlayer/index.mjs +84 -0
  28. package/dist/es/PassMap/index.mjs +43 -0
  29. package/dist/es/PassMap/style.less.mjs +4 -0
  30. package/dist/es/TrackMap/PointTooltip.mjs +88 -0
  31. package/dist/es/TrackMap/TrackPoint.mjs +57 -0
  32. package/dist/es/TrackMap/index.mjs +375 -0
  33. package/dist/es/TrackMap/style.less.mjs +4 -0
  34. package/dist/es/Zoom/index.mjs +48 -0
  35. package/dist/es/components/Copy/index.mjs +44 -0
  36. package/dist/es/components/Copy/style.less.mjs +4 -0
  37. package/dist/es/components/Markdown/ATag/index.mjs +49 -0
  38. package/dist/es/components/Markdown/Code/index.mjs +69 -0
  39. package/dist/es/components/Markdown/Image/index.mjs +65 -0
  40. package/dist/es/components/Markdown/Video/index.mjs +22 -0
  41. package/dist/es/components/Markdown/index.mjs +85 -0
  42. package/dist/es/components/Markdown/style.less.mjs +4 -0
  43. package/dist/es/index.mjs +42 -0
  44. package/dist/es/useBimface/index.mjs +148 -0
  45. package/dist/es/utils/JSAsyncLoader.mjs +7 -0
  46. package/dist/es/utils/clipboard.mjs +38 -0
  47. package/dist/es/utils/markdown/index.mjs +29 -0
  48. package/dist/lib/index.js +2 -0
  49. package/dist/src/Button/index.d.ts +10 -0
  50. package/dist/src/ConfirmableButton/index.d.ts +16 -0
  51. package/dist/src/Drawable/Drawable.d.ts +32 -0
  52. package/dist/src/Drawable/LineElement.d.ts +8 -0
  53. package/dist/src/Drawable/MarkerElement.d.ts +10 -0
  54. package/dist/src/Drawable/MarkersMap.d.ts +7 -0
  55. package/dist/src/Drawable/PolygonElement.d.ts +10 -0
  56. package/dist/src/Drawable/index.d.ts +33 -0
  57. package/dist/src/Drawable/state.d.ts +49 -0
  58. package/dist/src/ExpandablePannel/index.d.ts +24 -0
  59. package/dist/src/GOSImageMap/DrawableImageMap.d.ts +8 -0
  60. package/dist/src/GOSImageMap/ImageMap.d.ts +8 -0
  61. package/dist/src/GOSImageMap/index.d.ts +2 -0
  62. package/dist/src/IconButton/index.d.ts +5 -0
  63. package/dist/src/Iconfont/CloudIconfont.d.ts +2 -0
  64. package/dist/src/Iconfont/EdgeIconfont.d.ts +2 -0
  65. package/dist/src/Iconfont/font_3929209_z3fhml098hr.d.ts +0 -0
  66. package/dist/src/Iconfont/font_edge.d.ts +0 -0
  67. package/dist/src/Iconfont/index.d.ts +2 -0
  68. package/dist/src/ImageMap/index.d.ts +40 -0
  69. package/dist/src/MouseTip/constant.d.ts +6 -0
  70. package/dist/src/MouseTip/index.d.ts +17 -0
  71. package/dist/src/MouseTip/types.d.ts +8 -0
  72. package/dist/src/MouseTip/utils.d.ts +8 -0
  73. package/dist/src/PanoramaRecordPlayer/index.d.ts +14 -0
  74. package/dist/src/PassMap/index.d.ts +11 -0
  75. package/dist/src/TrackMap/PointTooltip.d.ts +9 -0
  76. package/dist/src/TrackMap/TrackPoint.d.ts +19 -0
  77. package/dist/src/TrackMap/index.d.ts +82 -0
  78. package/dist/src/Zoom/index.d.ts +13 -0
  79. package/dist/src/components/Copy/index.d.ts +5 -0
  80. package/dist/src/components/Markdown/ATag/index.d.ts +2 -0
  81. package/dist/src/components/Markdown/Code/index.d.ts +2 -0
  82. package/dist/src/components/Markdown/Image/index.d.ts +2 -0
  83. package/dist/src/components/Markdown/Video/index.d.ts +2 -0
  84. package/dist/src/components/Markdown/index.d.ts +19 -0
  85. package/dist/src/index.d.ts +17 -0
  86. package/dist/src/useBimface/example.d.ts +2 -0
  87. package/dist/src/useBimface/index.d.ts +65 -0
  88. package/dist/src/utils/JSAsyncLoader.d.ts +2 -0
  89. package/dist/src/utils/clipboard.d.ts +11 -0
  90. package/dist/src/utils/markdown/index.d.ts +10 -0
  91. package/dist/style.css +1 -0
  92. package/package.json +138 -0
@@ -0,0 +1,375 @@
1
+ var Te = Object.defineProperty, $e = Object.defineProperties;
2
+ var Fe = Object.getOwnPropertyDescriptors;
3
+ var he = Object.getOwnPropertySymbols;
4
+ var Ce = Object.prototype.hasOwnProperty, ze = Object.prototype.propertyIsEnumerable;
5
+ var ye = (x, l, y) => l in x ? Te(x, l, { enumerable: !0, configurable: !0, writable: !0, value: y }) : x[l] = y, b = (x, l) => {
6
+ for (var y in l || (l = {}))
7
+ Ce.call(l, y) && ye(x, y, l[y]);
8
+ if (he)
9
+ for (var y of he(l))
10
+ ze.call(l, y) && ye(x, y, l[y]);
11
+ return x;
12
+ }, X = (x, l) => $e(x, Fe(l));
13
+ import { jsx as d, jsxs as Y } from "react/jsx-runtime";
14
+ import { useRef as z, useState as u, useEffect as h } from "react";
15
+ import De from "antd/es/tooltip";
16
+ import Me from "react-moveable";
17
+ import "./style.less.mjs";
18
+ import me from "./TrackPoint.mjs";
19
+ import { ConfigProvider as Oe } from "antd";
20
+ const Ue = (x) => {
21
+ var fe;
22
+ const {
23
+ width: l,
24
+ height: y,
25
+ points: T,
26
+ scale: a,
27
+ pointSize: $ = 6,
28
+ direction: q,
29
+ activePointId: D,
30
+ style: g,
31
+ lineStyle: M,
32
+ pointStyle: R,
33
+ directionStyle: xe,
34
+ marks: oe,
35
+ resizable: H,
36
+ transform: r,
37
+ keepRatio: ie = !1,
38
+ onPointClick: J,
39
+ onTransform: N,
40
+ onPointsChange: O,
41
+ onCancelResize: Pe,
42
+ actions: B = !0,
43
+ setIsSaved: se,
44
+ isSaved: ce = !1
45
+ } = x, S = z(null), w = z(null), s = z(null), E = z(null), K = z(null), [F, pe] = u(null), [Q, U] = u((r == null ? void 0 : r.scale) || [1, 1]), [V, Z] = u((r == null ? void 0 : r.rotate) || 0), [P, _] = u((r == null ? void 0 : r.translate) || [0, 0, 0, 0]), [be, ve] = u([]), [f, ke] = u(), [Re, ae] = u(), [W, G] = u(H), [le, ee] = u([]), [v, de] = u(T), [I, We] = u(!0), [k, j] = u(), [m, C] = u(), [Ie, Ne] = u(typeof B != "boolean" ? B : B === !0 ? {} : null), A = ($ - $ / 4 * 0.9) * 2 / a;
46
+ h(() => {
47
+ Ne(typeof B != "boolean" ? B : B === !0 ? {} : null);
48
+ }, [B]);
49
+ const Be = (e, t) => {
50
+ if (!e.length)
51
+ return;
52
+ let i;
53
+ return e.map((o) => {
54
+ var p;
55
+ if (!i) {
56
+ i = o;
57
+ return;
58
+ }
59
+ const c = d("line", {
60
+ x1: Number.isFinite(i.x) ? i.x : 0,
61
+ y1: Number.isFinite(i.y) ? i.y : 0,
62
+ x2: Number.isFinite(o.x) ? o.x : 0,
63
+ y2: Number.isFinite(o.y) ? o.y : 0,
64
+ style: X(b(b({
65
+ stroke: "#1F66E1BF"
66
+ }, M), i.lineStyle), {
67
+ strokeWidth: Number((M == null ? void 0 : M.strokeWidth) || ((p = i.lineStyle) == null ? void 0 : p.strokeWidth) || 2) / t
68
+ })
69
+ }, o.id);
70
+ return i = o, c;
71
+ });
72
+ }, ue = new ResizeObserver(() => {
73
+ S.current && (w.current && (w.current.style.transform = "none", w.current.style.width = "auto", w.current.style.height = "100%"), w.current && (w.current.style.width = "100%", w.current.style.height = "100%"));
74
+ });
75
+ h(() => {
76
+ var e;
77
+ C((e = s.current) == null ? void 0 : e.getBoundingClientRect());
78
+ }, [g == null ? void 0 : g.left, g == null ? void 0 : g.top, g == null ? void 0 : g.width, g == null ? void 0 : g.height, a]), h(() => {
79
+ G(H);
80
+ }, [H]), h(() => {
81
+ de(T || []);
82
+ }, [T, le]), h(() => {
83
+ var e;
84
+ (!((e = s.current) != null && e.style.transform) || s.current.style.transform === "none") && (U((r == null ? void 0 : r.scale) || [1, 1]), Z((r == null ? void 0 : r.rotate) || 0), _((r == null ? void 0 : r.translate) || [0, 0, 0, 0]));
85
+ }, [(fe = s.current) == null ? void 0 : fe.style.transform]), h(() => {
86
+ !s.current || W || (s.current.style.transform = "none", U((r == null ? void 0 : r.scale) || [1, 1]), Z((r == null ? void 0 : r.rotate) || 0), _((r == null ? void 0 : r.translate) || [0, 0, 0, 0]));
87
+ }, [W]), h(() => {
88
+ if (S.current)
89
+ return ue.observe(S.current), () => {
90
+ S.current && ue.unobserve(S.current);
91
+ };
92
+ }, [S.current]), h(() => {
93
+ !F || !r || (F.throttleDragRotate = r.rotate, F.throttleScale = r.scale, F.throttleDrag = r.translate);
94
+ }, [F, r]), h(() => {
95
+ ke(v == null ? void 0 : v.find((t) => t.id === D));
96
+ let e = v.map((t) => {
97
+ var p, ne, L;
98
+ const i = t.x, n = t.y, o = t.id === D, c = $ * (o ? 1.2 : 1) / a;
99
+ return d(me, {
100
+ open: I,
101
+ id: t.id,
102
+ point: t,
103
+ getTooltipContainer: () => K.current || document.body,
104
+ x: i,
105
+ y: n,
106
+ r: R != null && R.r || (p = t.pointStyle) != null && p.r ? Number((R == null ? void 0 : R.r) || ((ne = t.pointStyle) == null ? void 0 : ne.r)) / a : c / 2,
107
+ hidden: o,
108
+ style: X(b(b({
109
+ stroke: "#1F66E1BF",
110
+ fill: "#fff",
111
+ cursor: J ? "pointer" : "unset"
112
+ }, R), t.pointStyle), {
113
+ strokeWidth: Number(((L = t.pointStyle) == null ? void 0 : L.strokeWidth) || 2) / a,
114
+ r: void 0
115
+ }),
116
+ onPointClick: J
117
+ }, t.id);
118
+ }) || [];
119
+ ve(e);
120
+ }, [v, D, a, I]), h(() => {
121
+ var o, c, p;
122
+ if (!f) {
123
+ ae(void 0);
124
+ return;
125
+ }
126
+ const e = f.x, t = f.y, i = f.id === D, n = $ * (i ? 1.2 : 1) / a;
127
+ ae(Y("g", {
128
+ children: [q !== void 0 && d("circle", {
129
+ id: `mark-${f.id}`,
130
+ cx: e,
131
+ cy: t,
132
+ r: `${A}`,
133
+ strokeDasharray: A * 2 * Math.PI,
134
+ strokeDashoffset: A * 2 * Math.PI / 360 * (360 - 60),
135
+ style: b({
136
+ transform: `rotate(${q + 240}deg)`,
137
+ transformOrigin: `${e}px ${t}px`,
138
+ strokeWidth: A * 2,
139
+ stroke: "#1F66E1BF",
140
+ fill: "transparent",
141
+ pointerEvents: "none"
142
+ }, xe)
143
+ }), d(me, {
144
+ open: I,
145
+ point: f,
146
+ getTooltipContainer: () => K.current || document.body,
147
+ x: e,
148
+ y: t,
149
+ r: (o = f.pointStyle) != null && o.r ? Number((c = f.pointStyle) == null ? void 0 : c.r) / a : n / 2,
150
+ style: X(b(b({
151
+ stroke: "#1F66E1BF",
152
+ fill: "#fff"
153
+ }, R), f.pointStyle), {
154
+ strokeWidth: Number(((p = f.pointStyle) == null ? void 0 : p.strokeWidth) || 2) / a,
155
+ r: void 0
156
+ }),
157
+ onPointClick: J
158
+ }, f.id)]
159
+ }, f.id));
160
+ }, [f, q, a, I]), h(() => {
161
+ s.current && setTimeout(() => {
162
+ var e, t;
163
+ j((e = s.current) == null ? void 0 : e.getBBox()), C((t = s.current) == null ? void 0 : t.getBoundingClientRect());
164
+ }, 100);
165
+ }, [r]), h(() => {
166
+ var t, i;
167
+ if (!s.current)
168
+ return;
169
+ j((t = s.current) == null ? void 0 : t.getBBox()), C((i = s.current) == null ? void 0 : i.getBoundingClientRect()), new ResizeObserver(() => {
170
+ var n, o;
171
+ j((n = s.current) == null ? void 0 : n.getBBox()), C((o = s.current) == null ? void 0 : o.getBoundingClientRect());
172
+ }).observe(s.current);
173
+ }, [s.current]), h(() => {
174
+ ce && (Se(), se && se(!1));
175
+ }, [ce]);
176
+ const Se = () => {
177
+ var n;
178
+ const e = (n = E.current) == null ? void 0 : n.getBoundingClientRect();
179
+ if (!e) {
180
+ O && O(T), G(!1);
181
+ return;
182
+ }
183
+ const t = le.map((o) => {
184
+ const c = o.getBoundingClientRect();
185
+ return {
186
+ id: o.id.split("-")[1],
187
+ x: (c.x + c.width / 2 - e.x) / a,
188
+ y: (c.y + c.height / 2 - e.y) / a
189
+ };
190
+ }), i = T.map((o) => {
191
+ const c = t == null ? void 0 : t.find((p) => p.id.toString() === o.id.toString());
192
+ return c ? b(b({}, o), c) : o;
193
+ });
194
+ de(i), O && O(i.length ? i.map((o, c) => ({
195
+ id: o.id,
196
+ x: o.x,
197
+ y: o.y,
198
+ order: c
199
+ })) : T), G(!1);
200
+ }, we = (e) => e.map((t) => {
201
+ const {
202
+ render: i,
203
+ renderData: n
204
+ } = t, o = t.x * a, c = t.y * a;
205
+ return d(De, {
206
+ className: "track-map-marker-tooltip",
207
+ placement: "top",
208
+ title: i(n, b({}, t)),
209
+ open: !!n,
210
+ style: {
211
+ zIndex: 9999
212
+ },
213
+ children: d("circle", {
214
+ id: `mark-${t.id}`,
215
+ cx: o,
216
+ cy: c,
217
+ r: $ / 2,
218
+ style: {
219
+ stroke: "#1F66E100",
220
+ strokeWidth: 2,
221
+ fill: "#fff0"
222
+ },
223
+ children: d("span", {
224
+ children: n.label
225
+ })
226
+ })
227
+ }, t.id);
228
+ }), ge = k ? {
229
+ x: k.x + k.width / 2,
230
+ y: k.y + k.height / 2
231
+ } : {
232
+ x: 0,
233
+ y: 0
234
+ }, te = v.reduce((e, t) => [Math.min(e[0], t.x), Math.max(e[1], t.x)], [0, 0]), re = v.reduce((e, t) => [Math.min(e[0], t.y), Math.max(e[1], t.y)], [0, 0]);
235
+ return d(Oe, {
236
+ prefixCls: "g-rc",
237
+ children: Y("div", {
238
+ className: "track-map",
239
+ style: {
240
+ width: "100%",
241
+ height: "100%"
242
+ },
243
+ ref: S,
244
+ children: [d("svg", {
245
+ style: g,
246
+ ref: E,
247
+ viewBox: `0 0 ${l} ${y}`,
248
+ children: Y("g", {
249
+ ref: s,
250
+ x: te[0],
251
+ y: re[0],
252
+ width: te[1] - te[0],
253
+ height: re[1] - re[0],
254
+ style: {
255
+ transformOrigin: `${ge.x}px ${ge.y}px`,
256
+ cursor: W ? "url('./images/icon-move.svg') 16 16, move" : "unset",
257
+ transform: r && r.scale ? `${r.translate ? ` translate(${r.translate[0]}px, ${r.translate[1]}px)` : ""} rotate(${r.rotate}rad)${r.scale ? ` scale(${r.scale[0]}, ${r.scale[1]})` : ""}` : "none"
258
+ },
259
+ children: [k && d("rect", {
260
+ x: k.x,
261
+ y: k.y,
262
+ width: k.width,
263
+ height: k.height,
264
+ fill: "#ff000004"
265
+ }), d("g", {
266
+ className: "track-lines",
267
+ children: Be((v == null ? void 0 : v.filter((e) => e.order > -1)) || [], a)
268
+ }), Y("g", {
269
+ className: "track-points",
270
+ children: [be, Re]
271
+ }), oe && d("g", {
272
+ children: we(oe)
273
+ })]
274
+ })
275
+ }), d("div", {
276
+ className: "tooltip-container",
277
+ ref: K,
278
+ style: {
279
+ position: "fixed",
280
+ top: (m == null ? void 0 : m.y) || 0,
281
+ left: (m == null ? void 0 : m.x) || 0,
282
+ width: (m == null ? void 0 : m.width) || 0,
283
+ height: (m == null ? void 0 : m.height) || 0
284
+ }
285
+ }), W && s.current && E.current && d(Me, {
286
+ className: "path-moveable-control-box",
287
+ ref: (e) => {
288
+ pe(e);
289
+ },
290
+ keepRatio: ie,
291
+ target: [s.current],
292
+ draggable: !0,
293
+ scalable: !0,
294
+ rotatable: !0,
295
+ padding: {
296
+ left: 10,
297
+ right: 10,
298
+ top: 10,
299
+ bottom: 10
300
+ },
301
+ onDrag: ({
302
+ target: e,
303
+ beforeDelta: t,
304
+ beforeDist: i,
305
+ left: n,
306
+ top: o,
307
+ right: c,
308
+ bottom: p,
309
+ delta: ne,
310
+ dist: L,
311
+ transform: Ee,
312
+ clientX: je,
313
+ clientY: Ae
314
+ }) => {
315
+ _(L), e.style.transform = Ee;
316
+ },
317
+ onDragStart: ({
318
+ inputEvent: e
319
+ }) => {
320
+ e.stopPropagation();
321
+ },
322
+ onDragEnd: () => {
323
+ var t;
324
+ const e = (t = s.current) == null ? void 0 : t.getElementsByTagName("circle");
325
+ ee(e != null && e.length ? [...e] : []), N && N({
326
+ rotate: V,
327
+ translate: P,
328
+ scale: Q
329
+ }, e != null && e.length ? [...e] : [], E.current || void 0);
330
+ },
331
+ renderDirections: ie ? ["nw", "ne", "sw", "se"] : ["n", "w", "e", "s", "nw", "ne", "sw", "se"],
332
+ onScale: ({
333
+ target: e,
334
+ scale: t,
335
+ transform: i
336
+ }) => {
337
+ var o;
338
+ U(t), e.style.transform = i;
339
+ const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
340
+ ee(n != null && n.length ? [...n] : []), N && N({
341
+ rotate: V,
342
+ translate: P,
343
+ scale: t
344
+ }, n != null && n.length ? [...n] : [], E.current || void 0);
345
+ },
346
+ onRotate: ({
347
+ target: e,
348
+ dist: t,
349
+ transform: i
350
+ }) => {
351
+ var o;
352
+ Z(t), e.style.transform = i;
353
+ const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
354
+ ee(n != null && n.length ? [...n] : []), N && N({
355
+ rotate: t,
356
+ translate: P,
357
+ scale: Q
358
+ }, n != null && n.length ? [...n] : [], E.current || void 0);
359
+ },
360
+ onRenderEnd: () => {
361
+ var t, i, n;
362
+ const e = (t = s.current) == null ? void 0 : t.getElementsByTagName("circle");
363
+ N && N({
364
+ rotate: V,
365
+ translate: P,
366
+ scale: Q
367
+ }, e != null && e.length ? [...e] : [], E.current || void 0), j((i = s.current) == null ? void 0 : i.getBBox()), C((n = s.current) == null ? void 0 : n.getBoundingClientRect());
368
+ }
369
+ })]
370
+ })
371
+ });
372
+ };
373
+ export {
374
+ Ue as TrackMap
375
+ };
@@ -0,0 +1,4 @@
1
+ const t = "";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,48 @@
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { IconButton as m } from "../IconButton/index.mjs";
3
+ import { Iconfont as l } from "../Iconfont/index.mjs";
4
+ import { useState as x, useEffect as y } from "react";
5
+ const j = (a) => {
6
+ const {
7
+ className: f,
8
+ style: h,
9
+ value: t,
10
+ min: i,
11
+ max: c,
12
+ step: e = 1,
13
+ onChange: r,
14
+ showText: p = !1
15
+ } = a, [o, s] = x(t != null ? t : 0);
16
+ return y(() => {
17
+ s(t != null ? t : 0);
18
+ }, [t]), d("div", {
19
+ className: f,
20
+ style: h,
21
+ children: [n(m, {
22
+ disabled: !!(c && c <= o),
23
+ onClick: () => {
24
+ r(o + e), s(o + e);
25
+ },
26
+ children: n(l, {
27
+ type: "icon-fangda"
28
+ })
29
+ }), p && d("div", {
30
+ style: {
31
+ width: 40,
32
+ textAlign: "center"
33
+ },
34
+ children: [Math.round(o * 100), "%"]
35
+ }), n(m, {
36
+ disabled: !!(i && i >= o),
37
+ onClick: () => {
38
+ r(o - e), s(o - e);
39
+ },
40
+ children: n(l, {
41
+ type: "icon-suoxiao"
42
+ })
43
+ })]
44
+ });
45
+ };
46
+ export {
47
+ j as Zoom
48
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useState as r, useEffect as c } from "react";
3
+ import { Iconfont as l } from "../../Iconfont/index.mjs";
4
+ import { copyToClipboard as m } from "../../utils/clipboard.mjs";
5
+ import "./style.less.mjs";
6
+ import { CheckOutlined as n, CloseOutlined as p } from "@ant-design/icons";
7
+ import { Tooltip as f } from "antd";
8
+ const g = ({
9
+ text: i
10
+ }) => {
11
+ const [o, t] = r();
12
+ return c(() => {
13
+ o && setTimeout(() => t(void 0), 2e3);
14
+ }, [o]), o ? e("div", {
15
+ className: "copy-tip",
16
+ children: o === "success" ? e(n, {
17
+ style: {
18
+ color: "rgba(48, 191, 19, 1)"
19
+ }
20
+ }) : e(p, {
21
+ style: {
22
+ color: "#dc4446"
23
+ }
24
+ })
25
+ }) : e(f, {
26
+ title: "复制",
27
+ children: e("div", {
28
+ className: "copy-btn",
29
+ onClick: () => {
30
+ m({
31
+ value: i
32
+ }).then((s) => {
33
+ t(s ? "success" : "failed");
34
+ });
35
+ },
36
+ children: e(l, {
37
+ type: "icon-fuzhi"
38
+ })
39
+ })
40
+ });
41
+ };
42
+ export {
43
+ g as Copy
44
+ };
@@ -0,0 +1,4 @@
1
+ const t = "";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,49 @@
1
+ var j = Object.defineProperty, v = Object.defineProperties;
2
+ var A = Object.getOwnPropertyDescriptors;
3
+ var w = Object.getOwnPropertySymbols;
4
+ var f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
5
+ var d = (e, t, n) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, c = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ f.call(t, n) && d(e, n, t[n]);
8
+ if (w)
9
+ for (var n of w(t))
10
+ m.call(t, n) && d(e, n, t[n]);
11
+ return e;
12
+ }, u = (e, t) => v(e, A(t));
13
+ var x = (e, t) => {
14
+ var n = {};
15
+ for (var r in e)
16
+ f.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
17
+ if (e != null && w)
18
+ for (var r of w(e))
19
+ t.indexOf(r) < 0 && m.call(e, r) && (n[r] = e[r]);
20
+ return n;
21
+ };
22
+ import { jsx as o, jsxs as T, Fragment as b } from "react/jsx-runtime";
23
+ const p = (e) => {
24
+ var h, i;
25
+ const r = e, {
26
+ node: t
27
+ } = r, n = x(r, [
28
+ "node"
29
+ ]);
30
+ if (t.tagName === "a" && ((h = t.children) == null ? void 0 : h.length) > 0) {
31
+ const g = ((i = t.children[0]) == null ? void 0 : i.value) || "";
32
+ let s = /(^https?:\/\/|^www\.)(?:www\.)?[\w\-]+(\.[\w\-]+)+(\/[\w\- .\/?%&=]*)?/g, a = g.match(s), k = g.replace(s, "").trim();
33
+ if (!(a != null && a.length))
34
+ return o("a", c({}, n));
35
+ const l = a[0];
36
+ return T(b, {
37
+ children: [o("a", u(c({
38
+ href: /^www\./.test(l) ? "//" + l : l,
39
+ onClick: () => window.open(e.href, e.target || "_blank")
40
+ }, n), {
41
+ children: l
42
+ })), k]
43
+ });
44
+ }
45
+ return o("a", c({}, n));
46
+ }, M = p;
47
+ export {
48
+ M as default
49
+ };
@@ -0,0 +1,69 @@
1
+ var x = Object.defineProperty, h = Object.defineProperties;
2
+ var N = Object.getOwnPropertyDescriptors;
3
+ var t = Object.getOwnPropertySymbols;
4
+ var g = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
5
+ var w = (e, o, a) => o in e ? x(e, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[o] = a, d = (e, o) => {
6
+ for (var a in o || (o = {}))
7
+ g.call(o, a) && w(e, a, o[a]);
8
+ if (t)
9
+ for (var a of t(o))
10
+ p.call(o, a) && w(e, a, o[a]);
11
+ return e;
12
+ }, s = (e, o) => h(e, N(o));
13
+ var u = (e, o) => {
14
+ var a = {};
15
+ for (var n in e)
16
+ g.call(e, n) && o.indexOf(n) < 0 && (a[n] = e[n]);
17
+ if (e != null && t)
18
+ for (var n of t(e))
19
+ o.indexOf(n) < 0 && p.call(e, n) && (a[n] = e[n]);
20
+ return a;
21
+ };
22
+ import { jsxs as k, jsx as r } from "react/jsx-runtime";
23
+ import { Prism as f } from "react-syntax-highlighter";
24
+ import { Copy as v } from "../../Copy/index.mjs";
25
+ import { Space as C } from "antd";
26
+ const L = (S) => {
27
+ var i = S, {
28
+ node: e,
29
+ inline: o,
30
+ className: a,
31
+ children: n
32
+ } = i, m = u(i, [
33
+ "node",
34
+ "inline",
35
+ "className",
36
+ "children"
37
+ ]);
38
+ const l = /language-(\w+)/.exec(a || ""), c = l ? l[1] : null;
39
+ return !o && c ? k("div", {
40
+ className: "markdown-code",
41
+ children: [k("div", {
42
+ className: "markdown-code-title",
43
+ children: [r("span", {
44
+ className: "markdown-code-title-text",
45
+ children: c
46
+ }), r(C, {
47
+ className: "markdown-code-title-action",
48
+ children: r(v, {
49
+ text: String(n)
50
+ })
51
+ })]
52
+ }), r(f, s(d({
53
+ className: "markdown-code-context",
54
+ language: c
55
+ }, m), {
56
+ wrapLongLines: !0,
57
+ showLineNumbers: !0,
58
+ PreTag: "div",
59
+ children: String(n).replace(/\n$/, "")
60
+ }))]
61
+ }) : r("code", s(d({
62
+ className: a
63
+ }, m), {
64
+ children: n
65
+ }));
66
+ }, y = L;
67
+ export {
68
+ y as default
69
+ };
@@ -0,0 +1,65 @@
1
+ var w = Object.defineProperty, k = Object.defineProperties;
2
+ var I = Object.getOwnPropertyDescriptors;
3
+ var f = Object.getOwnPropertySymbols;
4
+ var y = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
5
+ var d = (e, t, i) => t in e ? w(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, r = (e, t) => {
6
+ for (var i in t || (t = {}))
7
+ y.call(t, i) && d(e, i, t[i]);
8
+ if (f)
9
+ for (var i of f(t))
10
+ M.call(t, i) && d(e, i, t[i]);
11
+ return e;
12
+ }, a = (e, t) => k(e, I(t));
13
+ import { jsx as m, jsxs as V, Fragment as b } from "react/jsx-runtime";
14
+ import { Image as h } from "antd";
15
+ import { ImageViewer as x } from "antd-mobile";
16
+ import { useState as s, useEffect as C } from "react";
17
+ import { isMobile as v } from "react-device-detect";
18
+ import T from "../Video/index.mjs";
19
+ import { checkMediaType as j } from "../../../utils/markdown/index.mjs";
20
+ const E = (e) => {
21
+ const [t, i] = s(!1), [g, u] = s();
22
+ return C(() => {
23
+ e.src && u(j(e.src));
24
+ }, [e.src]), g == "video" ? m(T, {
25
+ src: e.src,
26
+ controls: !0
27
+ }) : v ? V(b, {
28
+ children: [m("img", r({
29
+ style: {
30
+ maxWidth: "100%"
31
+ },
32
+ src: e == null ? void 0 : e.src,
33
+ onClick: () => {
34
+ i(!0);
35
+ }
36
+ }, e)), m(x, {
37
+ image: (e == null ? void 0 : e.src) || "",
38
+ visible: t,
39
+ onClose: () => {
40
+ i(!1);
41
+ }
42
+ })]
43
+ }) : m(h, a(r({
44
+ style: {
45
+ maxWidth: "100%"
46
+ },
47
+ preview: {
48
+ // 强制挂载到 body,解决 transform 包含块问题
49
+ getContainer: () => document.body
50
+ }
51
+ }, e), {
52
+ onClick: (n) => {
53
+ var c, o, l;
54
+ (l = e.onClick) == null || l.call(e, a(r({}, n), {
55
+ target: (o = (c = n.target) == null ? void 0 : c.offsetParent) == null ? void 0 : o.children[0]
56
+ }));
57
+ },
58
+ onError: () => {
59
+ console.log(e), console.warn("图片加载失败");
60
+ }
61
+ }));
62
+ }, B = E;
63
+ export {
64
+ B as default
65
+ };
@@ -0,0 +1,22 @@
1
+ var a = Object.defineProperty;
2
+ var e = Object.getOwnPropertySymbols;
3
+ var n = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
4
+ var i = (d, o, t) => o in d ? a(d, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[o] = t, r = (d, o) => {
5
+ for (var t in o || (o = {}))
6
+ n.call(o, t) && i(d, t, o[t]);
7
+ if (e)
8
+ for (var t of e(o))
9
+ s.call(o, t) && i(d, t, o[t]);
10
+ return d;
11
+ };
12
+ import { jsx as h } from "react/jsx-runtime";
13
+ const m = (d) => h("video", r({
14
+ style: {
15
+ maxWidth: "100%",
16
+ width: 560,
17
+ height: 315
18
+ }
19
+ }, d)), c = m;
20
+ export {
21
+ c as default
22
+ };