@blocklet/editor 2.4.101 → 2.4.102
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType, LexicalEditor, LexicalNode, NodeKey, Spread } from 'lexical';
|
|
2
2
|
import { DecoratorBlockNode, SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
|
|
3
|
-
import type
|
|
3
|
+
import { type JSX } from 'react';
|
|
4
4
|
import type { Properties } from './utils';
|
|
5
5
|
export interface ComponentData {
|
|
6
6
|
id: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BlockWithAlignableContents } from '@lexical/react/LexicalBlockWithAlignableContents';
|
|
3
3
|
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
|
|
4
|
-
import {
|
|
4
|
+
import { lazy, Suspense } from 'react';
|
|
5
|
+
const LazyPagesKitComponentRenderer = lazy(() => import('./PagesKitComponentRenderer').then((mod) => ({ default: mod.PagesKitComponentRenderer })));
|
|
5
6
|
function PagesKitComponent({ className, format, nodeKey, data, onPropertiesChange }) {
|
|
6
|
-
return (_jsx(BlockWithAlignableContents, { className: className, format: format, nodeKey: nodeKey, children: _jsx(
|
|
7
|
+
return (_jsx(BlockWithAlignableContents, { className: className, format: format, nodeKey: nodeKey, children: _jsx(Suspense, { fallback: null, children: _jsx(LazyPagesKitComponentRenderer, { id: data.id, name: data.name, properties: data.properties, onPropertiesChange: onPropertiesChange }) }) }));
|
|
7
8
|
}
|
|
8
9
|
function convertPagesKitComponentElement(domNode) {
|
|
9
10
|
const pagesKitComponentStr = domNode.getAttribute('data-lexical-pages-kit-component');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
2
2
|
import { DecoratorNode } from 'lexical';
|
|
3
|
-
import type
|
|
3
|
+
import { type JSX } from 'react';
|
|
4
4
|
export interface MermaidPayload {
|
|
5
5
|
code: string;
|
|
6
6
|
theme?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DecoratorNode } from 'lexical';
|
|
3
|
-
import
|
|
3
|
+
import { lazy, Suspense } from 'react';
|
|
4
|
+
const LazyMermaidComponent = lazy(() => import('./MermaidComponent'));
|
|
4
5
|
function convertMermaidElement(domNode) {
|
|
5
6
|
if (domNode && domNode.classList?.contains('mermaid')) {
|
|
6
7
|
const code = domNode.textContent || '';
|
|
@@ -84,7 +85,7 @@ export class MermaidNode extends DecoratorNode {
|
|
|
84
85
|
return false;
|
|
85
86
|
}
|
|
86
87
|
decorate() {
|
|
87
|
-
return _jsx(
|
|
88
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(LazyMermaidComponent, { code: this.__code, theme: this.__theme, mode: this.__mode }) }));
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
export function $createMermaidNode({ code, theme, mode, key }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/editor",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.102",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"ufo": "^1.5.4",
|
|
74
74
|
"url-join": "^4.0.1",
|
|
75
75
|
"zustand": "^4.5.5",
|
|
76
|
-
"@blocklet/pdf": "2.4.
|
|
76
|
+
"@blocklet/pdf": "2.4.102"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@babel/core": "^7.25.2",
|