@blocklet/pages-kit-inner-components 0.4.104 → 0.4.106

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.
@@ -4,30 +4,29 @@ import HI from "@arcblock/ux/lib/Empty";
4
4
  import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
5
5
  import { Icon as $ } from "@iconify-icon/react";
6
6
  import AC from "@mui/icons-material/Check";
7
- import { styled as iC, Box as D, InputLabel as lI, TextField as h, IconButton as G, Autocomplete as EI, FormControl as oC, Select as wC, MenuItem as Q, ListItemText as tI, Typography as k, OutlinedInput as sC, CircularProgress as gI, InputAdornment as MC, Button as X, Grid as V, Stack as nI, Input as uI, CssBaseline as LC, Menu as jC, Dialog as wI, DialogTitle as sI, DialogContent as MI, DialogActions as LI, ThemeProvider as JC, Tabs as OC, Tab as mC, Card as SC, CardMedia as BC, CardContent as yC, Skeleton as DC } from "@mui/material";
8
- import { useRequest as eC, useReactive as v, useUpdate as XI, useThrottleFn as WI, useGetState as bC, useAsyncEffect as TI, useBoolean as YI } from "ahooks";
9
- import xI, { useState as c, useEffect as t, useMemo as E, createContext as jI, useContext as NC, useRef as Z, useCallback as T, createElement as KC, forwardRef as JI, useImperativeHandle as OI } from "react";
10
- import { I as dC, n as DI, A as zC, b as cC, c as FC, T as aC, B as HC } from "./chunks/array-C85JziT_.js";
7
+ import { styled as iC, Box as D, InputLabel as lI, TextField as h, IconButton as G, Autocomplete as EI, FormControl as oC, Select as wC, MenuItem as Q, ListItemText as tI, Typography as k, OutlinedInput as sC, useTheme as MC, CircularProgress as gI, InputAdornment as LC, Button as X, Grid as V, Stack as nI, Input as uI, CssBaseline as jC, Menu as JC, Dialog as wI, DialogTitle as sI, DialogContent as MI, DialogActions as LI, ThemeProvider as OC, Tabs as mC, Tab as SC, Card as BC, CardMedia as yC, CardContent as DC, Skeleton as eC } from "@mui/material";
8
+ import { useRequest as bC, useReactive as v, useUpdate as XI, useThrottleFn as WI, useGetState as NC, useAsyncEffect as TI, useBoolean as YI } from "ahooks";
9
+ import xI, { useState as c, useEffect as t, useMemo as E, createContext as jI, useContext as KC, useRef as Z, useCallback as T, createElement as dC, forwardRef as JI, useImperativeHandle as OI } from "react";
10
+ import { I as zC, n as DI, A as cC, b as FC, c as aC, T as HC, B as lC } from "./chunks/array-C85JziT_.js";
11
11
  import { C as II } from "./chunks/config-color-B-ax03qd.js";
12
- import lC from "lodash/cloneDeep";
13
- import { DragIndicator as EC, SearchRounded as tC, Remove as nC, Add as rI, Language as uC, CopyAll as XC, Settings as WC, Delete as TC } from "@mui/icons-material";
14
- import { useDrag as YC, useDrop as xC } from "react-dnd";
12
+ import EC from "lodash/cloneDeep";
13
+ import { DragIndicator as tC, SearchRounded as nC, Remove as uC, Add as rI, Language as XC, CopyAll as WC, Settings as TC, Delete as YC } from "@mui/icons-material";
14
+ import { useDrag as xC, useDrop as rC } from "react-dnd";
15
15
  import "@arcblock/ux/lib/Tabs";
16
16
  import "@blocklet/pages-kit/utils/style";
17
17
  import "lodash/pick";
18
18
  import { styled as AI } from "@arcblock/ux/lib/Theme";
19
- import { LoadingButton as rC } from "@mui/lab";
20
- import { produce as a, original as hC } from "immer";
21
- import { pagesTheme as ZC } from "./theme.js";
22
- import { useDebounce as QC, useAsync as hI } from "react-use";
23
- import ZI, { ToastProvider as kC } from "@arcblock/ux/lib/Toast";
24
- import RC from "@mui/material/Tooltip";
19
+ import { LoadingButton as hC } from "@mui/lab";
20
+ import { produce as a, original as ZC } from "immer";
21
+ import { pagesTheme as QC } from "./theme.js";
22
+ import { useDebounce as kC, useAsync as hI } from "react-use";
23
+ import ZI, { ToastProvider as RC } from "@arcblock/ux/lib/Toast";
24
+ import pC from "@mui/material/Tooltip";
25
25
  import mI from "@mui/icons-material/KeyboardArrowLeft";
26
26
  import r from "@mui/material/Box";
27
27
  import SI from "@mui/material/DialogTitle";
28
28
  import BI from "@mui/material/IconButton";
29
- import pC from "@mui/material/Dialog";
30
- import { useTheme as UC } from "@mui/material/styles";
29
+ import UC from "@mui/material/Dialog";
31
30
  import fC from "@mui/material/useMediaQuery";
32
31
  import { css as GC, Global as VC } from "@emotion/react";
33
32
  import vC from "@mui/material/Alert";
@@ -66,7 +65,7 @@ function Dg({
66
65
  actions: L,
67
66
  ...J
68
67
  }) {
69
- const [{ isDragging: M }, y, S] = YC(
68
+ const [{ isDragging: M }, y, S] = xC(
70
69
  () => ({
71
70
  type: i,
72
71
  item: { id: o, index: A },
@@ -80,7 +79,7 @@ function Dg({
80
79
  }
81
80
  }),
82
81
  [i, o, A, s]
83
- ), [, j] = xC(
82
+ ), [, j] = rC(
84
83
  () => ({
85
84
  accept: w,
86
85
  hover(b) {
@@ -90,7 +89,7 @@ function Dg({
90
89
  [w, o, A, s]
91
90
  ), B = M ? 0.3 : 1;
92
91
  return /* @__PURE__ */ e(eg, { ...J, id: C, ref: (b) => j(S(b)), sx: { ...J.sx, opacity: B }, children: [
93
- /* @__PURE__ */ I("div", { className: "drag", ref: (b) => y(b), children: /* @__PURE__ */ I(EC, {}) }),
92
+ /* @__PURE__ */ I("div", { className: "drag", ref: (b) => y(b), children: /* @__PURE__ */ I(tC, {}) }),
94
93
  /* @__PURE__ */ I("div", { className: "name", children: g }),
95
94
  /* @__PURE__ */ I("div", { className: "actions", onClick: (b) => b.stopPropagation(), children: L })
96
95
  ] });
@@ -214,7 +213,7 @@ function Kg({ value: C, onChange: i, ...w }) {
214
213
  const [A, o] = c(""), { t: g } = W();
215
214
  return t(() => {
216
215
  o(C || "");
217
- }, [C, o]), QC(
216
+ }, [C, o]), kC(
218
217
  () => {
219
218
  A !== C && i(A);
220
219
  },
@@ -230,8 +229,8 @@ function Kg({ value: C, onChange: i, ...w }) {
230
229
  value: A,
231
230
  onChange: (s) => o(s.target.value),
232
231
  InputProps: {
233
- startAdornment: /* @__PURE__ */ I(G, { size: "small", children: /* @__PURE__ */ I(dC, { icon: A }) }),
234
- endAdornment: /* @__PURE__ */ I(G, { size: "small", href: "https://icones.js.org", target: "_blank", children: /* @__PURE__ */ I(tC, {}) })
232
+ startAdornment: /* @__PURE__ */ I(G, { size: "small", children: /* @__PURE__ */ I(zC, { icon: A }) }),
233
+ endAdornment: /* @__PURE__ */ I(G, { size: "small", href: "https://icones.js.org", target: "_blank", children: /* @__PURE__ */ I(nC, {}) })
235
234
  }
236
235
  }
237
236
  );
@@ -299,7 +298,7 @@ function iI({ label: C, placeholder: i, options: w, value: A, onChange: o, ...g
299
298
  ] });
300
299
  }
301
300
  const dg = () => {
302
- const { t: C } = W(), i = eC(async () => {
301
+ const { t: C } = W(), i = bC(async () => {
303
302
  var s;
304
303
  if (!((s = window.blocklet) == null ? void 0 : s.componentMountPoints.find((L) => L.name === "ai-kit")))
305
304
  return { install: !1 };
@@ -314,35 +313,27 @@ const dg = () => {
314
313
  }, [i]);
315
314
  return [w, A];
316
315
  };
317
- function yI({
318
- children: C,
319
- open: i = !0,
320
- embed: w = !1,
321
- ...A
322
- }) {
323
- const o = UC(), g = fC(o.breakpoints.down("md"));
324
- return /* @__PURE__ */ I(
325
- pC,
326
- {
327
- open: i,
328
- fullScreen: g,
329
- maxWidth: "md",
330
- disableEnforceFocus: !0,
331
- disableRestoreFocus: !0,
332
- disablePortal: !0,
333
- sx: { zIndex: 13001 },
334
- PaperProps: {
335
- sx: g ? {} : {
336
- width: 1,
337
- margin: 0,
338
- height: w ? "100%" : "75vh",
339
- maxHeight: w ? "100%" : "75vh"
340
- }
341
- },
342
- ...A,
343
- children: C
344
- }
345
- );
316
+ function yI({ children: C, open: i = !0, embed: w = !1, ...A }) {
317
+ const o = MC(), g = fC(o.breakpoints.down("md"));
318
+ return /* @__PURE__ */ I(UC, {
319
+ open: i,
320
+ fullScreen: g,
321
+ maxWidth: "md",
322
+ disableEnforceFocus: !0,
323
+ disableRestoreFocus: !0,
324
+ disablePortal: !0,
325
+ sx: { zIndex: 13001 },
326
+ PaperProps: {
327
+ sx: g ? {} : {
328
+ width: 1,
329
+ margin: 0,
330
+ height: w ? "100%" : "75vh",
331
+ maxHeight: w ? "100%" : "75vh"
332
+ }
333
+ },
334
+ ...A,
335
+ children: C
336
+ });
346
337
  }
347
338
  const RI = jI({ embed: !1 }), { Provider: zg } = RI;
348
339
  function cg({
@@ -355,7 +346,7 @@ function cg({
355
346
  return /* @__PURE__ */ I(zg, { value: { ...o, template: g, response: L, api: w, customOutputChildren: A, setTemplate: s, setResponse: J }, children: C });
356
347
  }
357
348
  function q() {
358
- return NC(RI);
349
+ return KC(RI);
359
350
  }
360
351
  function pI(C) {
361
352
  return E(() => blocklet == null ? void 0 : blocklet.componentMountPoints.find((i) => i.name === C), []);
@@ -391,7 +382,7 @@ async function Fg({
391
382
  const M = (J = L[0]) == null ? void 0 : J.list.shift();
392
383
  if (!M)
393
384
  break;
394
- g.push(hC(M));
385
+ g.push(ZC(M));
395
386
  }
396
387
  });
397
388
  return [g, { items: s }];
@@ -496,7 +487,7 @@ function ng(C) {
496
487
  getOptionLabel: (g) => typeof g == "string" ? g : g.name || "",
497
488
  isOptionEqualToValue: (g, s) => g.id === s.id || g.longitude === s.longitude && g.latitude === s.latitude,
498
489
  filterOptions: (g) => g,
499
- renderOption: (g, s) => /* @__PURE__ */ KC(Q, { ...g, key: s.id }, s.name),
490
+ renderOption: (g, s) => /* @__PURE__ */ dC(Q, { ...g, key: s.id }, s.name),
500
491
  loading: i.searching,
501
492
  renderInput: (g) => o({
502
493
  ...g,
@@ -825,7 +816,7 @@ function kg({
825
816
  textField: {
826
817
  ...(J = w.slotProps) == null ? void 0 : J.textField,
827
818
  InputProps: {
828
- startAdornment: /* @__PURE__ */ I(MC, { position: "start", children: /* @__PURE__ */ e(
819
+ startAdornment: /* @__PURE__ */ I(LC, { position: "start", children: /* @__PURE__ */ e(
829
820
  X,
830
821
  {
831
822
  size: "small",
@@ -836,7 +827,7 @@ function kg({
836
827
  },
837
828
  children: [
838
829
  /* @__PURE__ */ I(D, { component: "span", sx: { lineHeight: 1 }, children: "UTC" }),
839
- L === -1 ? /* @__PURE__ */ I(nC, { fontSize: "small" }) : /* @__PURE__ */ I(rI, { fontSize: "small" })
830
+ L === -1 ? /* @__PURE__ */ I(uC, { fontSize: "small" }) : /* @__PURE__ */ I(rI, { fontSize: "small" })
840
831
  ]
841
832
  }
842
833
  ) })
@@ -920,7 +911,7 @@ function Rg({
920
911
  var y;
921
912
  const { t: w } = W(), A = E(() => {
922
913
  let S = {};
923
- return C.parameters && typeof C.parameters == "object" && (S = lC(C.parameters)), S;
914
+ return C.parameters && typeof C.parameters == "object" && (S = EC(C.parameters)), S;
924
915
  }, [C]), o = E(() => Object.keys(A), [A]), g = hI(() => UI(), []), s = v({});
925
916
  t(() => {
926
917
  for (const [S, j] of Object.entries(A))
@@ -1124,7 +1115,7 @@ function fg({
1124
1115
  embed: w = !1,
1125
1116
  children: A
1126
1117
  }) {
1127
- const [o, g] = bC({
1118
+ const [o, g] = NC({
1128
1119
  embed: w,
1129
1120
  multiple: C,
1130
1121
  loading: !1,
@@ -1454,9 +1445,9 @@ function wA({
1454
1445
  customOutputChildren: o
1455
1446
  }) {
1456
1447
  return /* @__PURE__ */ e(_C, { FallbackComponent: iA, children: [
1457
- /* @__PURE__ */ I(LC, {}),
1448
+ /* @__PURE__ */ I(jC, {}),
1458
1449
  /* @__PURE__ */ I(VC, { styles: oA }),
1459
- /* @__PURE__ */ I(lg, { children: /* @__PURE__ */ I(cg, { api: i, customOutputChildren: o, children: /* @__PURE__ */ e(kC, { children: [
1450
+ /* @__PURE__ */ I(lg, { children: /* @__PURE__ */ I(cg, { api: i, customOutputChildren: o, children: /* @__PURE__ */ e(RC, { children: [
1460
1451
  /* @__PURE__ */ I(IA, { templates: C }),
1461
1452
  /* @__PURE__ */ I($g, { onSelect: w, onClose: A })
1462
1453
  ] }) }) })
@@ -1810,7 +1801,7 @@ function mA({
1810
1801
  }
1811
1802
  );
1812
1803
  return /* @__PURE__ */ e(SA, { children: [
1813
- S ? /* @__PURE__ */ I(RC, { title: S, children: /* @__PURE__ */ I("span", { children: /* @__PURE__ */ I(
1804
+ S ? /* @__PURE__ */ I(pC, { title: S, children: /* @__PURE__ */ I("span", { children: /* @__PURE__ */ I(
1814
1805
  G,
1815
1806
  {
1816
1807
  size: "small",
@@ -1855,7 +1846,7 @@ const SA = AI(D)`
1855
1846
  }
1856
1847
  `;
1857
1848
  function BA() {
1858
- const [C, i] = c(), w = E(() => C ? /* @__PURE__ */ I(jC, { ...C }) : null, [C]), A = T(() => {
1849
+ const [C, i] = c(), w = E(() => C ? /* @__PURE__ */ I(JC, { ...C }) : null, [C]), A = T(() => {
1859
1850
  i(void 0);
1860
1851
  }, []), o = T(
1861
1852
  (g) => {
@@ -1943,7 +1934,7 @@ function yA({
1943
1934
  ))
1944
1935
  }),
1945
1936
  children: [
1946
- /* @__PURE__ */ I(uC, { fontSize: "small" }),
1937
+ /* @__PURE__ */ I(XC, { fontSize: "small" }),
1947
1938
  j && /* @__PURE__ */ I(gI, { size: 22 })
1948
1939
  ]
1949
1940
  }
@@ -2245,14 +2236,14 @@ function dA({ value: C, locale: i, locales: w, onChange: A = () => {
2245
2236
  };
2246
2237
  return /* @__PURE__ */ e(f, { children: [
2247
2238
  /* @__PURE__ */ e(bg, { label: g("maker.properties.buttons"), children: [
2248
- /* @__PURE__ */ I(JC, { theme: ZC, children: (j = C.map) == null ? void 0 : j.call(C, (B, b) => /* @__PURE__ */ I(
2239
+ /* @__PURE__ */ I(OC, { theme: QC, children: (j = C.map) == null ? void 0 : j.call(C, (B, b) => /* @__PURE__ */ I(
2249
2240
  Dg,
2250
2241
  {
2251
2242
  dragType: "SECTION_ACTION_DND_TYPE",
2252
2243
  dropType: "SECTION_ACTION_DND_TYPE",
2253
2244
  id: B.id,
2254
2245
  index: b,
2255
- title: /* @__PURE__ */ I(zC, { ...B, size: "small", editing: !0 }),
2246
+ title: /* @__PURE__ */ I(cC, { ...B, size: "small", editing: !0 }),
2256
2247
  move: (N, O) => S(N, O),
2257
2248
  actions: /* @__PURE__ */ e(f, { children: [
2258
2249
  /* @__PURE__ */ I(
@@ -2264,11 +2255,11 @@ function dA({ value: C, locale: i, locales: w, onChange: A = () => {
2264
2255
  N.splice(b + 1, 0, { ...B, id: _() });
2265
2256
  })
2266
2257
  ),
2267
- children: /* @__PURE__ */ I(XC, {})
2258
+ children: /* @__PURE__ */ I(WC, {})
2268
2259
  }
2269
2260
  ),
2270
- /* @__PURE__ */ I(D, { mr: 0.35, onClick: () => J(B), children: /* @__PURE__ */ I(WC, {}) }),
2271
- /* @__PURE__ */ I(D, { onClick: () => M(b), children: /* @__PURE__ */ I(TC, {}) })
2261
+ /* @__PURE__ */ I(D, { mr: 0.35, onClick: () => J(B), children: /* @__PURE__ */ I(TC, {}) }),
2262
+ /* @__PURE__ */ I(D, { onClick: () => M(b), children: /* @__PURE__ */ I(YC, {}) })
2272
2263
  ] })
2273
2264
  },
2274
2265
  B.id
@@ -2434,7 +2425,7 @@ JI(function({ onSave: i = () => {
2434
2425
  ] }) }),
2435
2426
  /* @__PURE__ */ e(LI, { children: [
2436
2427
  /* @__PURE__ */ I(X, { variant: "outlined", size: "small", onClick: b, children: s("common.cancel") }),
2437
- /* @__PURE__ */ I(rC, { loading: m, variant: "contained", size: "small", onClick: Y, children: s("maker.save") })
2428
+ /* @__PURE__ */ I(hC, { loading: m, variant: "contained", size: "small", onClick: Y, children: s("maker.save") })
2438
2429
  ] })
2439
2430
  ] });
2440
2431
  });
@@ -2501,12 +2492,12 @@ const FI = 260, aA = 5, _I = "IGNORE_RENDER_BLOCKLET_TITLE", aI = (C, i) => C ?
2501
2492
  {
2502
2493
  id: "iframe",
2503
2494
  name: "Embed",
2504
- properties: cC
2495
+ properties: FC
2505
2496
  },
2506
2497
  {
2507
2498
  id: "section",
2508
2499
  name: "Section",
2509
- properties: FC
2500
+ properties: aC
2510
2501
  },
2511
2502
  {
2512
2503
  id: "section-card-list",
@@ -2516,10 +2507,10 @@ const FI = 260, aA = 5, _I = "IGNORE_RENDER_BLOCKLET_TITLE", aI = (C, i) => C ?
2516
2507
  {
2517
2508
  id: "toc",
2518
2509
  name: "Toc",
2519
- properties: aC
2510
+ properties: HC
2520
2511
  }
2521
2512
  ].map((C) => ({ ...C, type: "basic", component: C.id }));
2522
- function Xi({
2513
+ function ui({
2523
2514
  state: C,
2524
2515
  open: i,
2525
2516
  onClose: w,
@@ -2639,7 +2630,7 @@ function Xi({
2639
2630
  },
2640
2631
  children: [
2641
2632
  !z && /* @__PURE__ */ I(D, { sx: { width: 150, borderRight: 1, borderColor: "divider" }, children: /* @__PURE__ */ I(
2642
- OC,
2633
+ mC,
2643
2634
  {
2644
2635
  orientation: "vertical",
2645
2636
  value: b,
@@ -2653,7 +2644,7 @@ function Xi({
2653
2644
  px: 2
2654
2645
  }
2655
2646
  },
2656
- children: B.map((K, H) => /* @__PURE__ */ I(mC, { label: K == null ? void 0 : K.label, value: K == null ? void 0 : K.name }, H))
2647
+ children: B.map((K, H) => /* @__PURE__ */ I(SC, { label: K == null ? void 0 : K.label, value: K == null ? void 0 : K.name }, H))
2657
2648
  }
2658
2649
  ) }),
2659
2650
  /* @__PURE__ */ I(
@@ -2729,7 +2720,7 @@ function Xi({
2729
2720
  }
2730
2721
  },
2731
2722
  children: /* @__PURE__ */ e(
2732
- SC,
2723
+ BC,
2733
2724
  {
2734
2725
  className: "add-component-card",
2735
2726
  sx: {
@@ -2740,7 +2731,7 @@ function Xi({
2740
2731
  onClick: () => O(K),
2741
2732
  children: [
2742
2733
  /* @__PURE__ */ I(
2743
- BC,
2734
+ yC,
2744
2735
  {
2745
2736
  sx: {
2746
2737
  width: "100%",
@@ -2760,7 +2751,7 @@ function Xi({
2760
2751
  }
2761
2752
  ),
2762
2753
  /* @__PURE__ */ I(
2763
- yC,
2754
+ DC,
2764
2755
  {
2765
2756
  sx: {
2766
2757
  bgcolor: "background.paper",
@@ -2878,7 +2869,7 @@ function lA({
2878
2869
  },
2879
2870
  y
2880
2871
  ) : S === "basic" ? /* @__PURE__ */ I(
2881
- HC,
2872
+ lC,
2882
2873
  {
2883
2874
  id: y,
2884
2875
  type: j,
@@ -2916,7 +2907,7 @@ function lA({
2916
2907
  height: g.hadInit && g.shouldScroll ? "100%" : `${100 / g.scale}%`
2917
2908
  },
2918
2909
  children: [
2919
- !g.hadInit && /* @__PURE__ */ I(DC, { variant: "rectangular", width: "100%", height: "100%" }),
2910
+ !g.hadInit && /* @__PURE__ */ I(eC, { variant: "rectangular", width: "100%", height: "100%" }),
2920
2911
  /* @__PURE__ */ I(
2921
2912
  D,
2922
2913
  {
@@ -2983,10 +2974,10 @@ function EA({
2983
2974
  ] }, g)) : /* @__PURE__ */ I(HI, { children: i }) });
2984
2975
  }
2985
2976
  export {
2986
- Xi as AddComponent,
2977
+ ui as AddComponent,
2987
2978
  lA as AutoScaledComponentRenderer,
2988
2979
  HA as BASIC_COMPONENT_LIST,
2989
2980
  EA as GroupedComponentsList,
2990
- Xi as default,
2981
+ ui as default,
2991
2982
  aI as formatComponent
2992
2983
  };