@blocklet/pages-kit 0.6.20 → 0.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,4 +23,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.default = () => Promise.resolve().then(() => __importStar(require('@blocklet/ai-kit/components/image-preview')));
26
+ exports.default = () => Promise.resolve().then(() => __importStar(require('@blocklet/aigne-hub/components/image-preview')));
@@ -214,7 +214,7 @@ const MuiThemeTab = ({ value, onChange, }) => {
214
214
  }) })] }, palette)))] }));
215
215
  };
216
216
  // Custom Color Tab Component
217
- const CustomColorTab = ({ value, onChange, }) => {
217
+ const CustomColorTab = ({ value, onChange, disableGradient = false, }) => {
218
218
  const muiPalette = (0, color_1.useMuiColorPalette)();
219
219
  const mode = muiPalette?.theme?.palette?.mode;
220
220
  const isDark = mode === 'dark';
@@ -226,9 +226,9 @@ const CustomColorTab = ({ value, onChange, }) => {
226
226
  value: colorValue,
227
227
  originalMuiKey: null,
228
228
  });
229
- }, hidePresets: true, hideAdvancedSliders: true, hideColorGuide: true, hideInputType: true }) }) }));
229
+ }, hideColorTypeBtns: disableGradient, hidePresets: true, hideAdvancedSliders: true, hideColorGuide: true, hideInputType: true }) }) }));
230
230
  };
231
- const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enableMuiPalette = true, renderTabs, }) {
231
+ const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enableMuiPalette = true, renderTabs, disableGradient = false, }) {
232
232
  const state = (0, ahooks_1.useReactive)({
233
233
  value: '',
234
234
  originalMuiKey: null,
@@ -381,7 +381,7 @@ const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enableMuiPal
381
381
  state.value = value || '';
382
382
  state.originalMuiKey = null;
383
383
  }
384
- } })) })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", size: "small", onClick: handleClose, children: t('common.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", size: "small", onClick: handleSave, children: t('maker.save') })] })] }));
384
+ }, ...(disableGradient ? { disableGradient } : {}) })) })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", size: "small", onClick: handleClose, children: t('common.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", size: "small", onClick: handleSave, children: t('maker.save') })] })] }));
385
385
  };
386
386
  exports.ConfigColorDialog = ConfigColorDialog;
387
387
  function ColorPicker({ value, onChange, style = {}, sx = {}, renderTabs }) {
@@ -34,11 +34,19 @@ function useMuiColorPalette() {
34
34
  format: () => 'transparent',
35
35
  accessor: () => ({ transparent: 'transparent' }),
36
36
  },
37
- // mapper all colors
37
+ // common 颜色
38
+ {
39
+ type: 'common',
40
+ keys: ['black', 'white'],
41
+ variants: null,
42
+ format: (key) => `common.${key}`,
43
+ accessor: () => theme.palette.common,
44
+ },
45
+ // 主要颜色组
38
46
  ...['primary', 'secondary', 'error', 'warning', 'info', 'success'].map((key) => ({
39
47
  type: key,
40
48
  keys: [key],
41
- variants: ['main', 'light', 'dark'],
49
+ variants: ['main', 'light', 'dark', 'contrastText'],
42
50
  format: (key, variant) => `${key}.${variant}`,
43
51
  accessor: (key) => theme.palette[key],
44
52
  })),
@@ -63,16 +71,38 @@ function useMuiColorPalette() {
63
71
  format: (key) => `text.${key}`,
64
72
  accessor: () => theme.palette.text,
65
73
  },
74
+ // 分隔线颜色
75
+ {
76
+ type: 'divider',
77
+ keys: ['divider'],
78
+ variants: null,
79
+ format: () => 'divider',
80
+ accessor: () => ({ divider: theme.palette.divider }),
81
+ },
82
+ // 动作颜色
66
83
  // {
67
84
  // type: 'action',
68
- // keys: ['active', 'hover', 'selected', 'disabled', 'disabledBackground', 'focus'],
85
+ // keys: [
86
+ // 'active',
87
+ // 'hover',
88
+ // 'selected',
89
+ // 'disabled',
90
+ // 'disabledBackground',
91
+ // 'focus',
92
+ // 'activatedOpacity',
93
+ // 'focusOpacity',
94
+ // 'selectedOpacity',
95
+ // 'disabledOpacity',
96
+ // 'hoverOpacity',
97
+ // ],
69
98
  // variants: null,
70
99
  // format: (key: string) => `action.${key}`,
71
100
  // accessor: () => theme.palette.action,
72
101
  // },
102
+ // 灰色
73
103
  {
74
104
  type: 'grey',
75
- keys: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
105
+ keys: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'],
76
106
  variants: null,
77
107
  format: (key) => `grey.${key}`,
78
108
  accessor: () => theme.palette.grey,