@glodon-aiot/react-components 0.0.0-snapshot-20250729081352

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 +86 -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 +47 -0
  38. package/dist/es/components/Markdown/Code/index.mjs +69 -0
  39. package/dist/es/components/Markdown/Image/index.mjs +59 -0
  40. package/dist/es/components/Markdown/Video/index.mjs +22 -0
  41. package/dist/es/components/Markdown/index.mjs +75 -0
  42. package/dist/es/components/Markdown/style.less.mjs +4 -0
  43. package/dist/es/index.mjs +34 -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 +9 -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 Tt = Object.defineProperty, $t = Object.defineProperties;
2
+ var Ft = Object.getOwnPropertyDescriptors;
3
+ var ht = Object.getOwnPropertySymbols;
4
+ var zt = Object.prototype.hasOwnProperty, Dt = Object.prototype.propertyIsEnumerable;
5
+ var yt = (x, l, y) => l in x ? Tt(x, l, { enumerable: !0, configurable: !0, writable: !0, value: y }) : x[l] = y, b = (x, l) => {
6
+ for (var y in l || (l = {}))
7
+ zt.call(l, y) && yt(x, y, l[y]);
8
+ if (ht)
9
+ for (var y of ht(l))
10
+ Dt.call(l, y) && yt(x, y, l[y]);
11
+ return x;
12
+ }, X = (x, l) => $t(x, Ft(l));
13
+ import { jsx as d, jsxs as Y } from "react/jsx-runtime";
14
+ import { useRef as D, useState as u, useEffect as h } from "react";
15
+ import Mt from "antd/es/tooltip";
16
+ import Ot from "react-moveable";
17
+ import "./style.less.mjs";
18
+ import mt from "./TrackPoint.mjs";
19
+ import { ConfigProvider as Ct } from "antd";
20
+ const Ut = (x) => {
21
+ var ft;
22
+ const {
23
+ width: l,
24
+ height: y,
25
+ points: T,
26
+ scale: a,
27
+ pointSize: $ = 6,
28
+ direction: q,
29
+ activePointId: M,
30
+ style: g,
31
+ lineStyle: O,
32
+ pointStyle: k,
33
+ directionStyle: xt,
34
+ marks: ot,
35
+ resizable: H,
36
+ transform: r,
37
+ keepRatio: it = !1,
38
+ onPointClick: J,
39
+ onTransform: N,
40
+ onPointsChange: C,
41
+ onCancelResize: Wt,
42
+ actions: B = !0,
43
+ setIsSaved: st,
44
+ isSaved: ct = !1
45
+ } = x, S = D(null), w = D(null), s = D(null), E = D(null), K = D(null), [F, pt] = u(null), [Q, U] = u((r == null ? void 0 : r.scale) || [1, 1]), [V, Z] = u((r == null ? void 0 : r.rotate) || 0), [W, _] = u((r == null ? void 0 : r.translate) || [0, 0, 0, 0]), [bt, vt] = u([]), [f, Rt] = u(), [kt, at] = u(), [P, G] = u(H), [lt, tt] = u([]), [v, dt] = u(T), [I, Pt] = u(!0), [R, j] = u(), [m, z] = u(), [It, Nt] = u(typeof B != "boolean" ? B : B === !0 ? {} : null), A = ($ - $ / 4 * 0.9) * 2 / a;
46
+ h(() => {
47
+ Nt(typeof B != "boolean" ? B : B === !0 ? {} : null);
48
+ }, [B]);
49
+ const Bt = (t, e) => {
50
+ if (!t.length)
51
+ return;
52
+ let i;
53
+ return t.map((o) => {
54
+ var p;
55
+ if (!i) {
56
+ i = o;
57
+ return;
58
+ }
59
+ const c = /* @__PURE__ */ 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
+ }, O), i.lineStyle), {
67
+ strokeWidth: Number((O == null ? void 0 : O.strokeWidth) || ((p = i.lineStyle) == null ? void 0 : p.strokeWidth) || 2) / e
68
+ })
69
+ }, o.id);
70
+ return i = o, c;
71
+ });
72
+ }, ut = 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 t;
77
+ z((t = s.current) == null ? void 0 : t.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
+ dt(T || []);
82
+ }, [T, lt]), h(() => {
83
+ var t;
84
+ (!((t = s.current) != null && t.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
+ }, [(ft = s.current) == null ? void 0 : ft.style.transform]), h(() => {
86
+ !s.current || P || (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
+ }, [P]), h(() => {
88
+ if (S.current)
89
+ return ut.observe(S.current), () => {
90
+ S.current && ut.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
+ Rt(v == null ? void 0 : v.find((e) => e.id === M));
96
+ let t = v.map((e) => {
97
+ var p, nt, L;
98
+ const i = e.x, n = e.y, o = e.id === M, c = $ * (o ? 1.2 : 1) / a;
99
+ return /* @__PURE__ */ d(mt, {
100
+ open: I,
101
+ id: e.id,
102
+ point: e,
103
+ getTooltipContainer: () => K.current || document.body,
104
+ x: i,
105
+ y: n,
106
+ r: k != null && k.r || (p = e.pointStyle) != null && p.r ? Number((k == null ? void 0 : k.r) || ((nt = e.pointStyle) == null ? void 0 : nt.r)) / a : c / 2,
107
+ hidden: o,
108
+ style: X(b(b({
109
+ stroke: "#1F66E1BF",
110
+ fill: "#fff",
111
+ cursor: J ? "pointer" : "unset"
112
+ }, k), e.pointStyle), {
113
+ strokeWidth: Number(((L = e.pointStyle) == null ? void 0 : L.strokeWidth) || 2) / a,
114
+ r: void 0
115
+ }),
116
+ onPointClick: J
117
+ }, e.id);
118
+ }) || [];
119
+ vt(t);
120
+ }, [v, M, a, I]), h(() => {
121
+ var o, c, p;
122
+ if (!f) {
123
+ at(void 0);
124
+ return;
125
+ }
126
+ const t = f.x, e = f.y, i = f.id === M, n = $ * (i ? 1.2 : 1) / a;
127
+ at(/* @__PURE__ */ Y("g", {
128
+ children: [q !== void 0 && /* @__PURE__ */ d("circle", {
129
+ id: `mark-${f.id}`,
130
+ cx: t,
131
+ cy: e,
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: `${t}px ${e}px`,
138
+ strokeWidth: A * 2,
139
+ stroke: "#1F66E1BF",
140
+ fill: "transparent",
141
+ pointerEvents: "none"
142
+ }, xt)
143
+ }), /* @__PURE__ */ d(mt, {
144
+ open: I,
145
+ point: f,
146
+ getTooltipContainer: () => K.current || document.body,
147
+ x: t,
148
+ y: e,
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
+ }, k), 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 t, e;
163
+ j((t = s.current) == null ? void 0 : t.getBBox()), z((e = s.current) == null ? void 0 : e.getBoundingClientRect());
164
+ }, 100);
165
+ }, [r]), h(() => {
166
+ var e, i;
167
+ if (!s.current)
168
+ return;
169
+ j((e = s.current) == null ? void 0 : e.getBBox()), z((i = s.current) == null ? void 0 : i.getBoundingClientRect()), new ResizeObserver(() => {
170
+ var n, o;
171
+ j((n = s.current) == null ? void 0 : n.getBBox()), z((o = s.current) == null ? void 0 : o.getBoundingClientRect());
172
+ }).observe(s.current);
173
+ }, [s.current]), h(() => {
174
+ ct && (St(), st && st(!1));
175
+ }, [ct]);
176
+ const St = () => {
177
+ var n;
178
+ const t = (n = E.current) == null ? void 0 : n.getBoundingClientRect();
179
+ if (!t) {
180
+ C && C(T), G(!1);
181
+ return;
182
+ }
183
+ const e = lt.map((o) => {
184
+ const c = o.getBoundingClientRect();
185
+ return {
186
+ id: o.id.split("-")[1],
187
+ x: (c.x + c.width / 2 - t.x) / a,
188
+ y: (c.y + c.height / 2 - t.y) / a
189
+ };
190
+ }), i = T.map((o) => {
191
+ const c = e == null ? void 0 : e.find((p) => p.id.toString() === o.id.toString());
192
+ return c ? b(b({}, o), c) : o;
193
+ });
194
+ dt(i), C && C(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
+ }, wt = (t) => t.map((e) => {
201
+ const {
202
+ render: i,
203
+ renderData: n
204
+ } = e, o = e.x * a, c = e.y * a;
205
+ return /* @__PURE__ */ d(Mt, {
206
+ className: "track-map-marker-tooltip",
207
+ placement: "top",
208
+ title: i(n, b({}, e)),
209
+ open: !!n,
210
+ style: {
211
+ zIndex: 9999
212
+ },
213
+ children: /* @__PURE__ */ d("circle", {
214
+ id: `mark-${e.id}`,
215
+ cx: o,
216
+ cy: c,
217
+ r: $ / 2,
218
+ style: {
219
+ stroke: "#1F66E100",
220
+ strokeWidth: 2,
221
+ fill: "#fff0"
222
+ },
223
+ children: /* @__PURE__ */ d("span", {
224
+ children: n.label
225
+ })
226
+ })
227
+ }, e.id);
228
+ }), gt = R ? {
229
+ x: R.x + R.width / 2,
230
+ y: R.y + R.height / 2
231
+ } : {
232
+ x: 0,
233
+ y: 0
234
+ }, et = v.reduce((t, e) => [Math.min(t[0], e.x), Math.max(t[1], e.x)], [0, 0]), rt = v.reduce((t, e) => [Math.min(t[0], e.y), Math.max(t[1], e.y)], [0, 0]);
235
+ return /* @__PURE__ */ d(Ct, {
236
+ prefixCls: "g-rc",
237
+ children: /* @__PURE__ */ Y("div", {
238
+ className: "track-map",
239
+ style: {
240
+ width: "100%",
241
+ height: "100%"
242
+ },
243
+ ref: S,
244
+ children: [/* @__PURE__ */ d("svg", {
245
+ style: g,
246
+ ref: E,
247
+ viewBox: `0 0 ${l} ${y}`,
248
+ children: /* @__PURE__ */ Y("g", {
249
+ ref: s,
250
+ x: et[0],
251
+ y: rt[0],
252
+ width: et[1] - et[0],
253
+ height: rt[1] - rt[0],
254
+ style: {
255
+ transformOrigin: `${gt.x}px ${gt.y}px`,
256
+ cursor: P ? "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: [R && /* @__PURE__ */ d("rect", {
260
+ x: R.x,
261
+ y: R.y,
262
+ width: R.width,
263
+ height: R.height,
264
+ fill: "#ff000004"
265
+ }), /* @__PURE__ */ d("g", {
266
+ className: "track-lines",
267
+ children: Bt((v == null ? void 0 : v.filter((t) => t.order > -1)) || [], a)
268
+ }), /* @__PURE__ */ Y("g", {
269
+ className: "track-points",
270
+ children: [bt, kt]
271
+ }), ot && /* @__PURE__ */ d("g", {
272
+ children: wt(ot)
273
+ })]
274
+ })
275
+ }), /* @__PURE__ */ 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
+ }), P && s.current && E.current && /* @__PURE__ */ d(Ot, {
286
+ className: "path-moveable-control-box",
287
+ ref: (t) => {
288
+ pt(t);
289
+ },
290
+ keepRatio: it,
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: t,
303
+ beforeDelta: e,
304
+ beforeDist: i,
305
+ left: n,
306
+ top: o,
307
+ right: c,
308
+ bottom: p,
309
+ delta: nt,
310
+ dist: L,
311
+ transform: Et,
312
+ clientX: jt,
313
+ clientY: At
314
+ }) => {
315
+ _(L), t.style.transform = Et;
316
+ },
317
+ onDragStart: ({
318
+ inputEvent: t
319
+ }) => {
320
+ t.stopPropagation();
321
+ },
322
+ onDragEnd: () => {
323
+ var e;
324
+ const t = (e = s.current) == null ? void 0 : e.getElementsByTagName("circle");
325
+ tt(t != null && t.length ? [...t] : []), N && N({
326
+ rotate: V,
327
+ translate: W,
328
+ scale: Q
329
+ }, t != null && t.length ? [...t] : [], E.current || void 0);
330
+ },
331
+ renderDirections: it ? ["nw", "ne", "sw", "se"] : ["n", "w", "e", "s", "nw", "ne", "sw", "se"],
332
+ onScale: ({
333
+ target: t,
334
+ scale: e,
335
+ transform: i
336
+ }) => {
337
+ var o;
338
+ U(e), t.style.transform = i;
339
+ const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
340
+ tt(n != null && n.length ? [...n] : []), N && N({
341
+ rotate: V,
342
+ translate: W,
343
+ scale: e
344
+ }, n != null && n.length ? [...n] : [], E.current || void 0);
345
+ },
346
+ onRotate: ({
347
+ target: t,
348
+ dist: e,
349
+ transform: i
350
+ }) => {
351
+ var o;
352
+ Z(e), t.style.transform = i;
353
+ const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
354
+ tt(n != null && n.length ? [...n] : []), N && N({
355
+ rotate: e,
356
+ translate: W,
357
+ scale: Q
358
+ }, n != null && n.length ? [...n] : [], E.current || void 0);
359
+ },
360
+ onRenderEnd: () => {
361
+ var e, i, n;
362
+ const t = (e = s.current) == null ? void 0 : e.getElementsByTagName("circle");
363
+ N && N({
364
+ rotate: V,
365
+ translate: W,
366
+ scale: Q
367
+ }, t != null && t.length ? [...t] : [], E.current || void 0), j((i = s.current) == null ? void 0 : i.getBBox()), z((n = s.current) == null ? void 0 : n.getBoundingClientRect());
368
+ }
369
+ })]
370
+ })
371
+ });
372
+ };
373
+ export {
374
+ Ut 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 e } 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: o,
10
+ min: s,
11
+ max: r,
12
+ step: n = 1,
13
+ onChange: c,
14
+ showText: p = !1
15
+ } = a, [t, i] = x(o != null ? o : 0);
16
+ return y(() => {
17
+ i(o != null ? o : 0);
18
+ }, [o]), /* @__PURE__ */ d("div", {
19
+ className: f,
20
+ style: h,
21
+ children: [/* @__PURE__ */ e(m, {
22
+ disabled: !!(r && r <= t),
23
+ onClick: () => {
24
+ c(t + n), i(t + n);
25
+ },
26
+ children: /* @__PURE__ */ e(l, {
27
+ type: "icon-fangda"
28
+ })
29
+ }), p && /* @__PURE__ */ d("div", {
30
+ style: {
31
+ width: 40,
32
+ textAlign: "center"
33
+ },
34
+ children: [Math.round(t * 100), "%"]
35
+ }), /* @__PURE__ */ e(m, {
36
+ disabled: !!(s && s >= t),
37
+ onClick: () => {
38
+ c(t - n), i(t - n);
39
+ },
40
+ children: /* @__PURE__ */ e(l, {
41
+ type: "icon-suoxiao"
42
+ })
43
+ })]
44
+ });
45
+ };
46
+ export {
47
+ j as Zoom
48
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx as o } 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 p, CloseOutlined as n } from "@ant-design/icons";
7
+ import { Tooltip as f } from "antd";
8
+ const b = ({
9
+ text: i
10
+ }) => {
11
+ const [e, t] = r();
12
+ return c(() => {
13
+ e && setTimeout(() => t(void 0), 2e3);
14
+ }, [e]), e ? /* @__PURE__ */ o("div", {
15
+ className: "copy-tip",
16
+ children: e === "success" ? /* @__PURE__ */ o(p, {
17
+ style: {
18
+ color: "rgba(48, 191, 19, 1)"
19
+ }
20
+ }) : /* @__PURE__ */ o(n, {
21
+ style: {
22
+ color: "#dc4446"
23
+ }
24
+ })
25
+ }) : /* @__PURE__ */ o(f, {
26
+ title: "复制",
27
+ children: /* @__PURE__ */ o("div", {
28
+ className: "copy-btn",
29
+ onClick: () => {
30
+ m({
31
+ value: i
32
+ }).then((s) => {
33
+ t(s ? "success" : "failed");
34
+ });
35
+ },
36
+ children: /* @__PURE__ */ o(l, {
37
+ type: "icon-fuzhi"
38
+ })
39
+ })
40
+ });
41
+ };
42
+ export {
43
+ b as Copy
44
+ };
@@ -0,0 +1,4 @@
1
+ const t = "";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,47 @@
1
+ var j = Object.defineProperty, v = Object.defineProperties;
2
+ var A = Object.getOwnPropertyDescriptors;
3
+ var w = Object.getOwnPropertySymbols;
4
+ var m = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
5
+ var d = (e, t, r) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, c = (e, t) => {
6
+ for (var r in t || (t = {}))
7
+ m.call(t, r) && d(e, r, t[r]);
8
+ if (w)
9
+ for (var r of w(t))
10
+ u.call(t, r) && d(e, r, t[r]);
11
+ return e;
12
+ }, f = (e, t) => v(e, A(t));
13
+ var x = (e, t) => {
14
+ var r = {};
15
+ for (var n in e)
16
+ m.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
17
+ if (e != null && w)
18
+ for (var n of w(e))
19
+ t.indexOf(n) < 0 && u.call(e, n) && (r[n] = e[n]);
20
+ return r;
21
+ };
22
+ import { jsx as s, jsxs as T, Fragment as F } from "react/jsx-runtime";
23
+ const N = (e) => {
24
+ var h, o;
25
+ const n = e, {
26
+ node: t
27
+ } = n, r = x(n, [
28
+ "node"
29
+ ]);
30
+ if (t.tagName === "a" && ((h = t.children) == null ? void 0 : h.length) > 0) {
31
+ const g = ((o = t.children[0]) == null ? void 0 : o.value) || "";
32
+ let i = /(^https?:\/\/|^www\.)(?:www\.)?[\w\-]+(\.[\w\-]+)+(\/[\w\- .\/?%&=]*)?/g, a = g.match(i), p = g.replace(i, "").trim();
33
+ if (!(a != null && a.length))
34
+ return /* @__PURE__ */ s("a", c({}, r));
35
+ const l = a[0];
36
+ return /* @__PURE__ */ T(F, {
37
+ children: [/* @__PURE__ */ s("a", f(c({}, r), {
38
+ href: /^www\./.test(l) ? "//" + l : l,
39
+ children: l
40
+ })), p]
41
+ });
42
+ }
43
+ return /* @__PURE__ */ s("a", c({}, r));
44
+ }, k = N;
45
+ export {
46
+ k as default
47
+ };
@@ -0,0 +1,69 @@
1
+ var x = Object.defineProperty, f = Object.defineProperties;
2
+ var h = 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
+ }, m = (e, o) => f(e, h(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 N } 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, s = 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 ? /* @__PURE__ */ k("div", {
40
+ className: "markdown-code",
41
+ children: [/* @__PURE__ */ k("div", {
42
+ className: "markdown-code-title",
43
+ children: [/* @__PURE__ */ r("span", {
44
+ className: "markdown-code-title-text",
45
+ children: c
46
+ }), /* @__PURE__ */ r(C, {
47
+ className: "markdown-code-title-action",
48
+ children: /* @__PURE__ */ r(v, {
49
+ text: String(n)
50
+ })
51
+ })]
52
+ }), /* @__PURE__ */ r(N, m(d({
53
+ className: "markdown-code-context",
54
+ language: c
55
+ }, s), {
56
+ wrapLongLines: !0,
57
+ showLineNumbers: !0,
58
+ PreTag: "div",
59
+ children: String(n).replace(/\n$/, "")
60
+ }))]
61
+ }) : /* @__PURE__ */ r("code", m(d({
62
+ className: a
63
+ }, s), {
64
+ children: n
65
+ }));
66
+ }, y = L;
67
+ export {
68
+ y as default
69
+ };
@@ -0,0 +1,59 @@
1
+ var g = Object.defineProperty, u = Object.defineProperties;
2
+ var k = Object.getOwnPropertyDescriptors;
3
+ var a = Object.getOwnPropertySymbols;
4
+ var w = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
+ var c = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, n = (e, i) => {
6
+ for (var t in i || (i = {}))
7
+ w.call(i, t) && c(e, t, i[t]);
8
+ if (a)
9
+ for (var t of a(i))
10
+ I.call(i, t) && c(e, t, i[t]);
11
+ return e;
12
+ }, o = (e, i) => u(e, k(i));
13
+ import { jsx as m, jsxs as M, Fragment as V } from "react/jsx-runtime";
14
+ import { Image as x } from "antd";
15
+ import { ImageViewer as y } from "antd-mobile";
16
+ import { useState as l, useEffect as b } from "react";
17
+ import { isMobile as h } from "react-device-detect";
18
+ import C from "../Video/index.mjs";
19
+ import { checkMediaType as T } from "../../../utils/markdown/index.mjs";
20
+ const j = (e) => {
21
+ const [i, t] = l(!1), [f, s] = l();
22
+ return b(() => {
23
+ e.src && s(T(e.src));
24
+ }, [e.src]), f == "video" ? /* @__PURE__ */ m(C, {
25
+ src: e.src,
26
+ controls: !0
27
+ }) : h ? /* @__PURE__ */ M(V, {
28
+ children: [/* @__PURE__ */ m("img", {
29
+ style: {
30
+ maxWidth: "100%"
31
+ },
32
+ src: e == null ? void 0 : e.src,
33
+ onClick: () => {
34
+ t(!0);
35
+ }
36
+ }), /* @__PURE__ */ m(y, {
37
+ image: (e == null ? void 0 : e.src) || "",
38
+ visible: i,
39
+ onClose: () => {
40
+ t(!1);
41
+ }
42
+ })]
43
+ }) : /* @__PURE__ */ m(x, o(n({
44
+ style: {
45
+ maxWidth: "100%"
46
+ }
47
+ }, e), {
48
+ onClick: (d) => {
49
+ var r;
50
+ return (r = e.onClick) == null ? void 0 : r.call(e, d);
51
+ },
52
+ onError: () => {
53
+ console.log(e), console.warn("图片加载失败");
54
+ }
55
+ }));
56
+ }, A = j;
57
+ export {
58
+ A as default
59
+ };
@@ -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) => /* @__PURE__ */ 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
+ };