@blocklet/discuss-kit-ux 1.6.212 → 1.6.214

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,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
4
4
  import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
5
5
  import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
6
6
  import { lazy } from "react";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-MrnIrDMc.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BvgOMp6U.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -8,6 +8,7 @@ var _a, _b;
8
8
  import { Labels2, LabelPicker } from "@blocklet/labels";
9
9
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
10
10
  import { useTheme, ThemeProvider, styled } from "@mui/material/styles";
11
+ import { create as create$1, styled as styled$1 } from "@arcblock/ux/lib/Theme";
11
12
  import { useEffect, useRef, lazy, useState, createElement, useContext, useMemo, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useCallback } from "react";
12
13
  import Box from "@mui/material/Box";
13
14
  import isNil from "lodash/isNil";
@@ -25,7 +26,6 @@ import { LocaleContext, useLocaleContext } from "@arcblock/ux/lib/Locale/context
25
26
  import Alert from "@mui/material/Alert";
26
27
  import isBoolean from "lodash/isBoolean";
27
28
  import Button from "@mui/material/Button";
28
- import { styled as styled$1 } from "@arcblock/ux/lib/Theme";
29
29
  import DidAvatar from "@arcblock/did-connect/lib/Avatar";
30
30
  import AvatarGroup from "@mui/material/AvatarGroup";
31
31
  import { grey, green, amber } from "@mui/material/colors";
@@ -76,46 +76,138 @@ import { createContainer } from "unstated-next";
76
76
  import Cookie from "js-cookie";
77
77
  import { WsClient } from "@arcblock/ws";
78
78
  import { css } from "@emotion/css";
79
+ const typography = {
80
+ h1: {
81
+ fontSize: "1.875rem",
82
+ lineHeight: 1.2,
83
+ fontWeight: 800,
84
+ letterSpacing: "-.025em"
85
+ },
86
+ h2: {
87
+ fontSize: "1.5rem",
88
+ lineHeight: 1.3333333,
89
+ fontWeight: 700,
90
+ letterSpacing: "-.025em"
91
+ },
92
+ h3: {
93
+ fontSize: "1.25rem",
94
+ lineHeight: 1.4,
95
+ fontWeight: 600,
96
+ letterSpacing: "-.025em"
97
+ },
98
+ h4: {
99
+ fontSize: "1.125rem",
100
+ lineHeight: 1.5,
101
+ fontWeight: 600
102
+ },
103
+ h5: {
104
+ fontSize: "1rem",
105
+ lineHeight: 1.75,
106
+ fontWeight: 400
107
+ },
108
+ h6: {
109
+ fontSize: "1rem",
110
+ lineHeight: 1.75,
111
+ fontWeight: 400
112
+ },
113
+ subtitle1: {
114
+ fontSize: "1rem",
115
+ lineHeight: 1.75,
116
+ fontWeight: 400
117
+ },
118
+ subtitle2: {
119
+ fontSize: "1rem",
120
+ lineHeight: 1.75,
121
+ fontWeight: 400
122
+ },
123
+ body1: {
124
+ fontSize: "1rem",
125
+ lineHeight: 1.75
126
+ },
127
+ fontWeightLight: 300,
128
+ fontWeightRegular: 400,
129
+ fontWeightMedium: 500,
130
+ fontWeightBold: 700
131
+ };
79
132
  const themeOverrides = {
133
+ shape: {
134
+ borderRadius: 8
135
+ },
80
136
  components: {
137
+ MuiInputBase: {
138
+ defaultProps: {
139
+ size: "small"
140
+ },
141
+ styleOverrides: {
142
+ root: ({ theme }) => ({
143
+ fontSize: "0.875rem",
144
+ // 调小输入框字体大小 (16px -> 14px)
145
+ backgroundColor: theme.palette.grey[50]
146
+ })
147
+ }
148
+ },
81
149
  MuiButton: {
82
150
  defaultProps: {
83
151
  size: "small"
84
152
  },
85
153
  styleOverrides: {
86
154
  root: {
155
+ fontWeight: 500,
87
156
  textTransform: "none"
157
+ },
158
+ outlinedPrimary: ({ theme }) => ({
159
+ border: `1px solid ${theme.palette.divider}`,
160
+ backgroundColor: "#fff",
161
+ "&:hover": {
162
+ border: `1px solid ${theme.palette.divider}`
163
+ }
164
+ }),
165
+ sizeSmall: {
166
+ height: 32
88
167
  }
89
168
  }
90
169
  },
91
170
  MuiIconButton: {
92
171
  defaultProps: {
93
172
  size: "small"
173
+ },
174
+ styleOverrides: {
175
+ root: {
176
+ textTransform: "none"
177
+ },
178
+ colorPrimary: {
179
+ backgroundColor: "#fff"
180
+ }
94
181
  }
95
182
  },
96
- MuiToggleButtonGroup: {
97
- defaultProps: {
98
- size: "small"
183
+ MuiToggleButton: {
184
+ styleOverrides: {
185
+ root: {
186
+ textTransform: "none"
187
+ }
99
188
  }
100
189
  },
101
- MuiToggleButton: {
190
+ MuiTab: {
102
191
  styleOverrides: {
103
192
  root: {
104
193
  textTransform: "none"
105
194
  }
106
195
  }
196
+ },
197
+ MuiTooltip: {
198
+ defaultProps: {
199
+ enterTouchDelay: 3e3,
200
+ leaveTouchDelay: 100
201
+ }
107
202
  }
108
203
  }
109
204
  };
110
205
  function InternalThemeProvider({ children }) {
111
206
  const theme = useTheme();
112
- const merged = {
113
- ...theme
114
- // components: {
115
- // ...theme.components,
116
- // ...themeOverrides.components,
117
- // },
118
- };
207
+ const merged = create$1(theme, {
208
+ typography,
209
+ ...themeOverrides
210
+ });
119
211
  return /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children });
120
212
  }
121
213
  const repairBase64Avatar = (avatar) => {
@@ -5179,7 +5271,7 @@ function Pagination({
5179
5271
  }
5180
5272
  );
5181
5273
  }
5182
- const Editor = lazy(() => import("./editor-D7VjqD2F.mjs"));
5274
+ const Editor = lazy(() => import("./editor-g8aVzRyQ.mjs"));
5183
5275
  function LazyEditor(props) {
5184
5276
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
5185
5277
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -11345,85 +11437,86 @@ function SegmentedControl({ value, options, onChange, sx, ...rest }) {
11345
11437
  ) });
11346
11438
  }
11347
11439
  export {
11348
- useUnreadNotification as $,
11440
+ UnreadNotificationContext as $,
11349
11441
  Avatar as A,
11350
11442
  Badge as B,
11351
11443
  CommentInput as C,
11352
11444
  DefaultEditorConfigProvider as D,
11353
- EmptyStatus as E,
11354
- BlogListWrapper as F,
11445
+ BinaryThumb as E,
11446
+ EmptyStatus as F,
11355
11447
  GithubReaction as G,
11356
- BlogCard as H,
11448
+ BlogListWrapper as H,
11357
11449
  ImagePathFixerPlugin as I,
11358
- BlogPermaLink as J,
11359
- getBlogLink as K,
11360
- CoverImage as L,
11450
+ BlogCard as J,
11451
+ BlogPermaLink as K,
11452
+ getBlogLink as L,
11361
11453
  Menu as M,
11362
- CoverImageUpload as N,
11363
- AccessControl as O,
11454
+ CoverImage as N,
11455
+ CoverImageUpload as O,
11364
11456
  Pagination as P,
11365
- useAuthzContext as Q,
11457
+ AccessControl as Q,
11366
11458
  RelativeTime as R,
11367
11459
  ScrollableEditorWrapper as S,
11368
- AuthzProvider as T,
11369
- ChatClient as U,
11460
+ useAuthzContext as T,
11461
+ AuthzProvider as U,
11370
11462
  VideoPathFixerPlugin as V,
11371
- Chat as W,
11372
- ChatHeaderAddon as X,
11373
- useChatContext as Y,
11374
- ChatProvider as Z,
11375
- UnreadNotificationContext as _,
11463
+ ChatClient as W,
11464
+ Chat as X,
11465
+ ChatHeaderAddon as Y,
11466
+ useChatContext as Z,
11467
+ ChatProvider as _,
11376
11468
  isEmptyContent as a,
11377
- UnreadNotificationProvider as a0,
11378
- Confirm as a1,
11379
- ConfirmContext as a2,
11380
- useConfirm as a3,
11381
- ConfirmProvider as a4,
11382
- SecureLabelPicker as a5,
11383
- useApiErrorHandler as a6,
11384
- useDefaultApiErrorHandler as a7,
11385
- DefaultApiErrorHandler as a8,
11386
- PreviousLocationRecorder as a9,
11387
- Back as aa,
11388
- LazyEditor as ab,
11389
- EditorPreview as ac,
11390
- DirtyPromptContainer as ad,
11391
- ConfirmNavigation as ae,
11392
- UploaderContext as af,
11393
- useUploader as ag,
11394
- UploaderTrigger as ah,
11395
- UploaderProvider as ai,
11396
- composeImageUrl as aj,
11397
- usePointUpContext as ak,
11398
- PointUpProvider as al,
11399
- ButtonGroup as am,
11400
- SegmentedControl as an,
11401
- create as ao,
11402
- getWsClient as ap,
11403
- useSubscription as aq,
11469
+ useUnreadNotification as a0,
11470
+ UnreadNotificationProvider as a1,
11471
+ Confirm as a2,
11472
+ ConfirmContext as a3,
11473
+ useConfirm as a4,
11474
+ ConfirmProvider as a5,
11475
+ SecureLabelPicker as a6,
11476
+ useApiErrorHandler as a7,
11477
+ useDefaultApiErrorHandler as a8,
11478
+ DefaultApiErrorHandler as a9,
11479
+ PreviousLocationRecorder as aa,
11480
+ Back as ab,
11481
+ LazyEditor as ac,
11482
+ EditorPreview as ad,
11483
+ DirtyPromptContainer as ae,
11484
+ ConfirmNavigation as af,
11485
+ UploaderContext as ag,
11486
+ useUploader as ah,
11487
+ UploaderTrigger as ai,
11488
+ UploaderProvider as aj,
11489
+ composeImageUrl as ak,
11490
+ usePointUpContext as al,
11491
+ PointUpProvider as am,
11492
+ ButtonGroup as an,
11493
+ SegmentedControl as ao,
11494
+ create as ap,
11495
+ getWsClient as aq,
11496
+ useSubscription as ar,
11404
11497
  Input as b,
11405
11498
  useChanged as c,
11406
11499
  useSessionContext as d,
11407
11500
  utils as e,
11408
- themeOverrides as f,
11501
+ typography as f,
11409
11502
  getExcerptSync as g,
11410
- InternalThemeProvider as h,
11503
+ themeOverrides as h,
11411
11504
  inferInitialEditorState as i,
11412
- Avatars as j,
11413
- AuthorInfo as k,
11505
+ InternalThemeProvider as j,
11506
+ Avatars as k,
11414
11507
  lexical as l,
11415
- SystemUser as m,
11416
- PostContent as n,
11417
- PostComponent as o,
11508
+ AuthorInfo as m,
11509
+ SystemUser as n,
11510
+ PostContent as o,
11418
11511
  preferences as p,
11419
- Comment as q,
11512
+ PostComponent as q,
11420
11513
  routes as r,
11421
11514
  stringify as s,
11422
11515
  translations as t,
11423
11516
  useNow as u,
11424
- CommentList as v,
11425
- CommentsContext as w,
11426
- useCommentsContext as x,
11427
- CommentsProvider as y,
11428
- BinaryThumb as z
11517
+ Comment as v,
11518
+ CommentList as w,
11519
+ CommentsContext as x,
11520
+ useCommentsContext as y,
11521
+ CommentsProvider as z
11429
11522
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from '@blocklet/labels';
2
- export * from './components/shared/theme';
2
+ export * from './theme';
3
3
  export { Input, CommentInput, ScrollableEditorWrapper } from './components/input';
4
4
  export * from './components/avatars';
5
5
  export * from './components/posts';
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { O, k, T, A, j, aa, B, z, H, F, J, am, W, U, X, Z, q, C, v, w, y, a1, a2, ae, a4, L, N, a8, D, ad, ac, E, G, b, h, ab, M, P, al, o, n, a9, R, S, a5, an, m, _, a0, af, ai, ah, aj, ao, K, ap, l, p, r, f, t, a6, Q, c, Y, x, a3, a7, u, ak, d, aq, $, ag, e } from "./index-MrnIrDMc.mjs";
2
+ import { Q, m, U, A, k, ab, B, E, J, H, K, an, X, W, Y, _, v, C, w, x, z, a2, a3, af, a5, N, O, a9, D, ae, ad, F, G, b, j, ac, M, P, am, q, o, aa, R, S, a6, ao, n, $, a1, ag, aj, ai, ak, ap, L, aq, l, p, r, h, t, f, a7, T, c, Z, y, a4, a8, u, al, d, ar, a0, ah, e } from "./index-BvgOMp6U.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -9,79 +9,80 @@ import "@mui/icons-material";
9
9
  import "@arcblock/ux/lib/Locale/context";
10
10
  import "@mui/material";
11
11
  export {
12
- O as AccessControl,
13
- k as AuthorInfo,
14
- T as AuthzProvider,
12
+ Q as AccessControl,
13
+ m as AuthorInfo,
14
+ U as AuthzProvider,
15
15
  A as Avatar,
16
- j as Avatars,
17
- aa as Back,
16
+ k as Avatars,
17
+ ab as Back,
18
18
  B as Badge,
19
- z as BinaryThumb,
20
- H as BlogCard,
21
- F as BlogList,
22
- J as BlogPermaLink,
23
- am as ButtonGroup,
24
- W as Chat,
25
- U as ChatClient,
26
- X as ChatHeaderAddon,
27
- Z as ChatProvider,
28
- q as Comment,
19
+ E as BinaryThumb,
20
+ J as BlogCard,
21
+ H as BlogList,
22
+ K as BlogPermaLink,
23
+ an as ButtonGroup,
24
+ X as Chat,
25
+ W as ChatClient,
26
+ Y as ChatHeaderAddon,
27
+ _ as ChatProvider,
28
+ v as Comment,
29
29
  C as CommentInput,
30
- v as CommentList,
31
- w as CommentsContext,
32
- y as CommentsProvider,
33
- a1 as Confirm,
34
- a2 as ConfirmContext,
35
- ae as ConfirmNavigation,
36
- a4 as ConfirmProvider,
37
- L as CoverImage,
38
- N as CoverImageUpload,
39
- a8 as DefaultApiErrorHandler,
30
+ w as CommentList,
31
+ x as CommentsContext,
32
+ z as CommentsProvider,
33
+ a2 as Confirm,
34
+ a3 as ConfirmContext,
35
+ af as ConfirmNavigation,
36
+ a5 as ConfirmProvider,
37
+ N as CoverImage,
38
+ O as CoverImageUpload,
39
+ a9 as DefaultApiErrorHandler,
40
40
  D as DefaultEditorConfigProvider,
41
- ad as DirtyPromptContainer,
42
- ac as EditorPreview,
43
- E as EmptyStatus,
41
+ ae as DirtyPromptContainer,
42
+ ad as EditorPreview,
43
+ F as EmptyStatus,
44
44
  G as GithubReaction,
45
45
  b as Input,
46
- h as InternalThemeProvider,
47
- ab as LazyEditor,
46
+ j as InternalThemeProvider,
47
+ ac as LazyEditor,
48
48
  M as Menu,
49
49
  P as Pagination,
50
- al as PointUpProvider,
51
- o as Post,
52
- n as PostContent,
53
- a9 as PreviousLocationRecorder,
50
+ am as PointUpProvider,
51
+ q as Post,
52
+ o as PostContent,
53
+ aa as PreviousLocationRecorder,
54
54
  R as RelativeTime,
55
55
  S as ScrollableEditorWrapper,
56
- a5 as SecureLabelPicker,
57
- an as SegmentedControl,
58
- m as SystemUser,
59
- _ as UnreadNotificationContext,
60
- a0 as UnreadNotificationProvider,
61
- af as UploaderContext,
62
- ai as UploaderProvider,
63
- ah as UploaderTrigger,
64
- aj as composeImageUrl,
65
- ao as create,
66
- K as getBlogLink,
67
- ap as getWsClient,
56
+ a6 as SecureLabelPicker,
57
+ ao as SegmentedControl,
58
+ n as SystemUser,
59
+ $ as UnreadNotificationContext,
60
+ a1 as UnreadNotificationProvider,
61
+ ag as UploaderContext,
62
+ aj as UploaderProvider,
63
+ ai as UploaderTrigger,
64
+ ak as composeImageUrl,
65
+ ap as create,
66
+ L as getBlogLink,
67
+ aq as getWsClient,
68
68
  l as lexicalUtils,
69
69
  p as preferences,
70
70
  r as routes,
71
- f as themeOverrides,
71
+ h as themeOverrides,
72
72
  t as translations,
73
- a6 as useApiErrorHandler,
74
- Q as useAuthzContext,
73
+ f as typography,
74
+ a7 as useApiErrorHandler,
75
+ T as useAuthzContext,
75
76
  c as useChanged,
76
- Y as useChatContext,
77
- x as useCommentsContext,
78
- a3 as useConfirm,
79
- a7 as useDefaultApiErrorHandler,
77
+ Z as useChatContext,
78
+ y as useCommentsContext,
79
+ a4 as useConfirm,
80
+ a8 as useDefaultApiErrorHandler,
80
81
  u as useNow,
81
- ak as usePointUpContext,
82
+ al as usePointUpContext,
82
83
  d as useSessionContext,
83
- aq as useSubscription,
84
- $ as useUnreadNotification,
85
- ag as useUploader,
84
+ ar as useSubscription,
85
+ a0 as useUnreadNotification,
86
+ ah as useUploader,
86
87
  e as utils
87
88
  };
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("react"), require("@mui/material/Box"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/ux/lib/Theme"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("url-join"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "react", "@mui/material/Box", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/ux/lib/Theme", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/material", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "url-join", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "@mui/icons-material/Add", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.react, global.Box, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.Theme, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$1, global.Session, global.material, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.joinUrl, global.reactDom, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.Fab, global.debounce, global.TextField, global.AddIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
- })(this, function(exports2, labels, jsxRuntime, styles, react, Box, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, Theme, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1, Session, material, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, Fab, debounce, TextField, AddIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin, SafeAreaPlugin, text, ImageNode, VideoNode) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material/Box"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("url-join"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "@arcblock/ux/lib/Theme", "react", "@mui/material/Box", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/material", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "url-join", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "@mui/icons-material/Add", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.Theme, global.react, global.Box, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$1, global.Session, global.material, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.joinUrl, global.reactDom, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.Fab, global.debounce, global.TextField, global.AddIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
+ })(this, function(exports2, labels, jsxRuntime, styles, Theme, react, Box, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1, Session, material, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, Fab, debounce, TextField, AddIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin, SafeAreaPlugin, text, ImageNode, VideoNode) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -9,46 +9,138 @@ var __publicField = (obj, key, value) => {
9
9
  };
10
10
 
11
11
  var _a, _b;
12
+ const typography = {
13
+ h1: {
14
+ fontSize: "1.875rem",
15
+ lineHeight: 1.2,
16
+ fontWeight: 800,
17
+ letterSpacing: "-.025em"
18
+ },
19
+ h2: {
20
+ fontSize: "1.5rem",
21
+ lineHeight: 1.3333333,
22
+ fontWeight: 700,
23
+ letterSpacing: "-.025em"
24
+ },
25
+ h3: {
26
+ fontSize: "1.25rem",
27
+ lineHeight: 1.4,
28
+ fontWeight: 600,
29
+ letterSpacing: "-.025em"
30
+ },
31
+ h4: {
32
+ fontSize: "1.125rem",
33
+ lineHeight: 1.5,
34
+ fontWeight: 600
35
+ },
36
+ h5: {
37
+ fontSize: "1rem",
38
+ lineHeight: 1.75,
39
+ fontWeight: 400
40
+ },
41
+ h6: {
42
+ fontSize: "1rem",
43
+ lineHeight: 1.75,
44
+ fontWeight: 400
45
+ },
46
+ subtitle1: {
47
+ fontSize: "1rem",
48
+ lineHeight: 1.75,
49
+ fontWeight: 400
50
+ },
51
+ subtitle2: {
52
+ fontSize: "1rem",
53
+ lineHeight: 1.75,
54
+ fontWeight: 400
55
+ },
56
+ body1: {
57
+ fontSize: "1rem",
58
+ lineHeight: 1.75
59
+ },
60
+ fontWeightLight: 300,
61
+ fontWeightRegular: 400,
62
+ fontWeightMedium: 500,
63
+ fontWeightBold: 700
64
+ };
12
65
  const themeOverrides = {
66
+ shape: {
67
+ borderRadius: 8
68
+ },
13
69
  components: {
70
+ MuiInputBase: {
71
+ defaultProps: {
72
+ size: "small"
73
+ },
74
+ styleOverrides: {
75
+ root: ({ theme }) => ({
76
+ fontSize: "0.875rem",
77
+ // 调小输入框字体大小 (16px -> 14px)
78
+ backgroundColor: theme.palette.grey[50]
79
+ })
80
+ }
81
+ },
14
82
  MuiButton: {
15
83
  defaultProps: {
16
84
  size: "small"
17
85
  },
18
86
  styleOverrides: {
19
87
  root: {
88
+ fontWeight: 500,
20
89
  textTransform: "none"
90
+ },
91
+ outlinedPrimary: ({ theme }) => ({
92
+ border: `1px solid ${theme.palette.divider}`,
93
+ backgroundColor: "#fff",
94
+ "&:hover": {
95
+ border: `1px solid ${theme.palette.divider}`
96
+ }
97
+ }),
98
+ sizeSmall: {
99
+ height: 32
21
100
  }
22
101
  }
23
102
  },
24
103
  MuiIconButton: {
25
104
  defaultProps: {
26
105
  size: "small"
106
+ },
107
+ styleOverrides: {
108
+ root: {
109
+ textTransform: "none"
110
+ },
111
+ colorPrimary: {
112
+ backgroundColor: "#fff"
113
+ }
27
114
  }
28
115
  },
29
- MuiToggleButtonGroup: {
30
- defaultProps: {
31
- size: "small"
116
+ MuiToggleButton: {
117
+ styleOverrides: {
118
+ root: {
119
+ textTransform: "none"
120
+ }
32
121
  }
33
122
  },
34
- MuiToggleButton: {
123
+ MuiTab: {
35
124
  styleOverrides: {
36
125
  root: {
37
126
  textTransform: "none"
38
127
  }
39
128
  }
129
+ },
130
+ MuiTooltip: {
131
+ defaultProps: {
132
+ enterTouchDelay: 3e3,
133
+ leaveTouchDelay: 100
134
+ }
40
135
  }
41
136
  }
42
137
  };
43
138
  function InternalThemeProvider({ children }) {
44
139
  const theme = styles.useTheme();
45
- const merged = {
46
- ...theme
47
- // components: {
48
- // ...theme.components,
49
- // ...themeOverrides.components,
50
- // },
51
- };
140
+ const merged = Theme.create(theme, {
141
+ typography,
142
+ ...themeOverrides
143
+ });
52
144
  return /* @__PURE__ */ jsxRuntime.jsx(styles.ThemeProvider, { theme: merged, children });
53
145
  }
54
146
  const repairBase64Avatar = (avatar) => {
@@ -11369,6 +11461,7 @@ var __publicField = (obj, key, value) => {
11369
11461
  exports2.routes = routes;
11370
11462
  exports2.themeOverrides = themeOverrides;
11371
11463
  exports2.translations = translations;
11464
+ exports2.typography = typography;
11372
11465
  exports2.useApiErrorHandler = useApiErrorHandler;
11373
11466
  exports2.useAuthzContext = useAuthzContext;
11374
11467
  exports2.useChanged = useChanged;
@@ -1,6 +1,9 @@
1
+ import { typography } from './typography';
2
+ import { default as React } from 'react';
1
3
  import { ThemeOptions } from '@mui/material/styles';
2
4
 
5
+ export { typography };
3
6
  export declare const themeOverrides: Partial<ThemeOptions>;
4
7
  export declare function InternalThemeProvider({ children }: {
5
- children: any;
8
+ children: React.ReactNode;
6
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TypographyOptions } from '@mui/material/styles/createTypography';
2
+
3
+ export declare const typography: TypographyOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.212",
3
+ "version": "1.6.214",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.115",
32
- "@blocklet/editor": "1.6.212",
33
- "@blocklet/labels": "1.6.212",
32
+ "@blocklet/editor": "1.6.214",
33
+ "@blocklet/labels": "1.6.214",
34
34
  "@blocklet/uploader": "^0.0.77",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -94,5 +94,5 @@
94
94
  "resolutions": {
95
95
  "react": "^18.2.0"
96
96
  },
97
- "gitHead": "3f73487eb255540445ffbf9f9a9a84df7af8d0e6"
97
+ "gitHead": "6867ef3fa1222ec20a115635a4bb711c1bbfea33"
98
98
  }