@blocklet/editor 2.4.100 → 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.
- package/lib/ext/CustomComponent/components/Code.js +1 -1
- package/lib/ext/CustomComponent/components/Field.js +2 -2
- package/lib/ext/PagesKitComponent/PagesKitComponentNode.d.ts +1 -1
- package/lib/ext/PagesKitComponent/PagesKitComponentNode.js +3 -2
- package/lib/main/nodes/MermaidNode.d.ts +1 -1
- package/lib/main/nodes/MermaidNode.js +3 -2
- package/lib/main/styled-editor-content.js +1 -1
- package/package.json +5 -5
|
@@ -358,7 +358,7 @@ function CodeHeader({ title, icon, actions }) {
|
|
|
358
358
|
p: 1.5,
|
|
359
359
|
borderBottom: 1,
|
|
360
360
|
borderColor: 'divider',
|
|
361
|
-
bgcolor: '
|
|
361
|
+
bgcolor: 'background.paper',
|
|
362
362
|
borderRadius: '8px 8px 0 0',
|
|
363
363
|
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flex: 1 }, children: [icon && (_jsx(Box, { component: Icon, icon: icon, sx: {
|
|
364
364
|
fontSize: '16px',
|
|
@@ -79,7 +79,7 @@ export default function Field({ name, type, default: defaultVal, required, depre
|
|
|
79
79
|
const unsubscribe = highlightManager.subscribe(setHighlightedFieldId);
|
|
80
80
|
return () => unsubscribe();
|
|
81
81
|
}, []);
|
|
82
|
-
const metaInfo = (_jsxs(_Fragment, { children: [_jsx(Tag, { sx: { backgroundColor: ({ palette }) => alpha(palette.grey[100], 0.6) }, children: type }), isRequired && (_jsx(Tag, { sx: { color: 'error.main', background: ({ palette }) => alpha(palette.error.main, 0.1), fontWeight: 500 }, children: t('required') })), isDeprecated && (_jsx(Tag, { sx: {
|
|
82
|
+
const metaInfo = (_jsxs(_Fragment, { children: [type && _jsx(Tag, { sx: { backgroundColor: ({ palette }) => alpha(palette.grey[100], 0.6) }, children: type }), isRequired && (_jsx(Tag, { sx: { color: 'error.main', background: ({ palette }) => alpha(palette.error.main, 0.1), fontWeight: 500 }, children: t('required') })), isDeprecated && (_jsx(Tag, { sx: {
|
|
83
83
|
color: 'warning.light',
|
|
84
84
|
background: ({ palette }) => alpha(palette.warning.light, 0.1),
|
|
85
85
|
fontWeight: 500,
|
|
@@ -130,5 +130,5 @@ export default function Field({ name, type, default: defaultVal, required, depre
|
|
|
130
130
|
'& &:last-child': {
|
|
131
131
|
borderBottom: 'none',
|
|
132
132
|
},
|
|
133
|
-
}, children: [_jsxs(Bar, { children: [_jsx(Box, { sx: { color: 'primary.main', fontWeight: 500 }, children: name }), !isMobile && metaInfo] }), isMobile && _jsx(Bar, { sx: { mt: 1.25 }, children: metaInfo }), desc && _jsx(Box, { sx: { color: 'text.secondary', mt: 2 }, children: desc }), renderChildren()] }));
|
|
133
|
+
}, children: [_jsxs(Bar, { children: [name && _jsx(Box, { sx: { color: 'primary.main', fontWeight: 500 }, children: name }), !isMobile && metaInfo] }), isMobile && _jsx(Bar, { sx: { mt: 1.25 }, children: metaInfo }), desc && _jsx(Box, { sx: { color: 'text.secondary', mt: 2 }, children: desc }), renderChildren()] }));
|
|
134
134
|
}
|
|
@@ -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 }) {
|
|
@@ -125,7 +125,7 @@ const StyledEditorWrapper = styled(Box) `
|
|
|
125
125
|
background-color: ${({ theme }) => theme.palette.grey[100]} !important;
|
|
126
126
|
}
|
|
127
127
|
.PlaygroundEditorTheme__tableCellHeader {
|
|
128
|
-
background-color: ${({ theme }) => theme.palette.
|
|
128
|
+
background-color: ${({ theme }) => theme.palette.background.paper} !important;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@container blocklet-editor (max-width: 1000px) {
|
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": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@blocklet/code-editor": "^0.5.
|
|
28
|
+
"@blocklet/code-editor": "^0.5.20",
|
|
29
29
|
"@blocklet/embed": "^0.2.5",
|
|
30
30
|
"@blocklet/js-sdk": "^1.16.51",
|
|
31
|
-
"@blocklet/pages-kit": "^0.6.
|
|
32
|
-
"@blocklet/pages-kit-runtime": "^0.6.
|
|
31
|
+
"@blocklet/pages-kit": "^0.6.72",
|
|
32
|
+
"@blocklet/pages-kit-runtime": "^0.6.72",
|
|
33
33
|
"@excalidraw/excalidraw": "^0.18.0",
|
|
34
34
|
"@iconify/iconify": "^3.1.1",
|
|
35
35
|
"@iconify/icons-tabler": "^1.2.95",
|
|
@@ -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",
|