@blocklet/pages-kit 0.6.21 → 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.
@@ -1024,7 +1024,7 @@ export default () =>
1024
1024
  docs: {
1025
1025
  components: ['ImagePreview'],
1026
1026
  import: "import * as ImagePreview from '@blocklet/pages-kit/builtin/async/image-preview'",
1027
- export: "export default () => import('@blocklet/ai-kit/components/image-preview');",
1027
+ export: "export default () => import('@blocklet/aigne-hub/components/image-preview');",
1028
1028
  examples: [],
1029
1029
  },
1030
1030
  },
@@ -1 +1 @@
1
- export default () => import('@blocklet/ai-kit/components/image-preview');
1
+ export default () => import('@blocklet/aigne-hub/components/image-preview');
@@ -180,7 +180,7 @@ const MuiThemeTab = ({ value, onChange, }) => {
180
180
  }) })] }, palette)))] }));
181
181
  };
182
182
  // Custom Color Tab Component
183
- const CustomColorTab = ({ value, onChange, }) => {
183
+ const CustomColorTab = ({ value, onChange, disableGradient = false, }) => {
184
184
  const muiPalette = useMuiColorPalette();
185
185
  const mode = muiPalette?.theme?.palette?.mode;
186
186
  const isDark = mode === 'dark';
@@ -192,9 +192,9 @@ const CustomColorTab = ({ value, onChange, }) => {
192
192
  value: colorValue,
193
193
  originalMuiKey: null,
194
194
  });
195
- }, hidePresets: true, hideAdvancedSliders: true, hideColorGuide: true, hideInputType: true }) }) }));
195
+ }, hideColorTypeBtns: disableGradient, hidePresets: true, hideAdvancedSliders: true, hideColorGuide: true, hideInputType: true }) }) }));
196
196
  };
197
- export const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enableMuiPalette = true, renderTabs, }) {
197
+ export const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enableMuiPalette = true, renderTabs, disableGradient = false, }) {
198
198
  const state = useReactive({
199
199
  value: '',
200
200
  originalMuiKey: null,
@@ -347,7 +347,7 @@ export const ConfigColorDialog = function ConfigColorDialog({ ref, onSave, enabl
347
347
  state.value = value || '';
348
348
  state.originalMuiKey = null;
349
349
  }
350
- } })) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "outlined", size: "small", onClick: handleClose, children: t('common.cancel') }), _jsx(Button, { variant: "contained", size: "small", onClick: handleSave, children: t('maker.save') })] })] }));
350
+ }, ...(disableGradient ? { disableGradient } : {}) })) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "outlined", size: "small", onClick: handleClose, children: t('common.cancel') }), _jsx(Button, { variant: "contained", size: "small", onClick: handleSave, children: t('maker.save') })] })] }));
351
351
  };
352
352
  export function ColorPicker({ value, onChange, style = {}, sx = {}, renderTabs }) {
353
353
  const refDialog = useRef(null);
@@ -27,11 +27,19 @@ export function useMuiColorPalette() {
27
27
  format: () => 'transparent',
28
28
  accessor: () => ({ transparent: 'transparent' }),
29
29
  },
30
- // mapper all colors
30
+ // common 颜色
31
+ {
32
+ type: 'common',
33
+ keys: ['black', 'white'],
34
+ variants: null,
35
+ format: (key) => `common.${key}`,
36
+ accessor: () => theme.palette.common,
37
+ },
38
+ // 主要颜色组
31
39
  ...['primary', 'secondary', 'error', 'warning', 'info', 'success'].map((key) => ({
32
40
  type: key,
33
41
  keys: [key],
34
- variants: ['main', 'light', 'dark'],
42
+ variants: ['main', 'light', 'dark', 'contrastText'],
35
43
  format: (key, variant) => `${key}.${variant}`,
36
44
  accessor: (key) => theme.palette[key],
37
45
  })),
@@ -56,16 +64,38 @@ export function useMuiColorPalette() {
56
64
  format: (key) => `text.${key}`,
57
65
  accessor: () => theme.palette.text,
58
66
  },
67
+ // 分隔线颜色
68
+ {
69
+ type: 'divider',
70
+ keys: ['divider'],
71
+ variants: null,
72
+ format: () => 'divider',
73
+ accessor: () => ({ divider: theme.palette.divider }),
74
+ },
75
+ // 动作颜色
59
76
  // {
60
77
  // type: 'action',
61
- // keys: ['active', 'hover', 'selected', 'disabled', 'disabledBackground', 'focus'],
78
+ // keys: [
79
+ // 'active',
80
+ // 'hover',
81
+ // 'selected',
82
+ // 'disabled',
83
+ // 'disabledBackground',
84
+ // 'focus',
85
+ // 'activatedOpacity',
86
+ // 'focusOpacity',
87
+ // 'selectedOpacity',
88
+ // 'disabledOpacity',
89
+ // 'hoverOpacity',
90
+ // ],
62
91
  // variants: null,
63
92
  // format: (key: string) => `action.${key}`,
64
93
  // accessor: () => theme.palette.action,
65
94
  // },
95
+ // 灰色
66
96
  {
67
97
  type: 'grey',
68
- keys: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
98
+ keys: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'],
69
99
  variants: null,
70
100
  format: (key) => `grey.${key}`,
71
101
  accessor: () => theme.palette.grey,