@blocklet/editor 2.4.90 → 2.4.91

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.
@@ -0,0 +1,4 @@
1
+ import { EditorViewerProps } from './main/viewer/types';
2
+ export declare const BlockletEditorViewer: import("react-lazy-with-preload").PreloadableComponent<typeof import("./main/viewer").BlockletEditorViewer>;
3
+ export declare const useBlockletEditorViewerLoaded: () => boolean;
4
+ export type { EditorViewerProps };
@@ -0,0 +1,12 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { lazyWithPreload } from 'react-lazy-with-preload';
3
+ export const BlockletEditorViewer = lazyWithPreload(() => import('./main/viewer').then((m) => ({ default: m.BlockletEditorViewer })));
4
+ export const useBlockletEditorViewerLoaded = () => {
5
+ const [loaded, setLoaded] = useState(false);
6
+ useEffect(() => {
7
+ BlockletEditorViewer.preload().then(() => {
8
+ setLoaded(true);
9
+ });
10
+ }, []);
11
+ return loaded;
12
+ };
@@ -0,0 +1,2 @@
1
+ export declare const BlockletEditor: import("react-lazy-with-preload").PreloadableComponent<typeof import("./main").default>;
2
+ export declare const useBlockletEditorLoaded: () => boolean;
@@ -0,0 +1,12 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { lazyWithPreload } from 'react-lazy-with-preload';
3
+ export const BlockletEditor = lazyWithPreload(() => import('./main'));
4
+ export const useBlockletEditorLoaded = () => {
5
+ const [loaded, setLoaded] = useState(false);
6
+ useEffect(() => {
7
+ BlockletEditor.preload().then(() => {
8
+ setLoaded(true);
9
+ });
10
+ }, []);
11
+ return loaded;
12
+ };
@@ -7,14 +7,14 @@ import { useEffect, useMemo, useState, lazy, Suspense } from 'react';
7
7
  import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
8
8
  import SplitPane, { Pane } from 'split-pane-react';
9
9
  import 'split-pane-react/esm/themes/default.css';
10
- import { CustomComponentRenderer, customComponentStates } from '@blocklet/pages-kit/components';
11
- // @ts-ignore
10
+ import { customComponentStates } from '@blocklet/pages-kit/components';
12
11
  import { translations } from '@blocklet/pages-kit-runtime/locales';
13
12
  import { LocaleProvider } from '@arcblock/ux/lib/Locale/context';
14
13
  import mapValues from 'lodash/mapValues';
15
14
  import { isBlockletRunning } from '../utils';
16
15
  import { mode, getLocalizedValue } from './utils';
17
16
  import { useContentLocale } from '../ContentLocale';
17
+ const CustomComponentRenderer = lazy(() => import('@blocklet/pages-kit/components').then((mod) => ({ default: mod.CustomComponentRenderer })));
18
18
  const ParametersConfigLazy = lazy(() => import('@blocklet/pages-kit-runtime/components').then((mod) => ({
19
19
  // @ts-ignore
20
20
  default: mod.ParametersConfig,
package/lib/index.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- import '@iconify/iconify';
2
- import './main/index.css';
3
1
  import BlockletEditor from './main';
4
2
  export default BlockletEditor;
5
3
  export type { BlockletEditorProps } from './main';
6
4
  export * from './config';
7
5
  export * from './main/markdown-to-lexical';
8
- export type { EditorState } from 'lexical';
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import '@iconify/iconify';
2
- import './main/index.css';
3
1
  import BlockletEditor from './main';
2
+ // @deprecated
3
+ // 建议使用 src/blocklet-editor.ts 代替
4
4
  export default BlockletEditor;
5
5
  export * from './config';
6
6
  export * from './main/markdown-to-lexical';