File tree Expand file tree Collapse file tree 5 files changed +15
-11
lines changed
fixed-layout-editor/src/preset
free-layout-editor/src/preset
playground-react/src/preset Expand file tree Collapse file tree 5 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -70,3 +70,5 @@ export * from './clients';
7070 */
7171
7272export * from '@flowgram.ai/node-variable-plugin' ;
73+
74+ export { createPlaygroundReactPreset } from '@flowgram.ai/playground-react' ;
Original file line number Diff line number Diff line change 11import { interfaces } from 'inversify' ;
22import { FlowRendererContainerModule , FlowRendererRegistry } from '@flowgram.ai/renderer' ;
33import { createReduxDevToolPlugin } from '@flowgram.ai/redux-devtool-plugin' ;
4- import { createPlaygroundReactPreset } from '@flowgram.ai/playground-react' ;
54import { createNodeVariablePlugin } from '@flowgram.ai/node-variable-plugin' ;
65import { createNodeCorePlugin } from '@flowgram.ai/node-core-plugin' ;
76import { createMaterialsPlugin } from '@flowgram.ai/materials-plugin' ;
@@ -121,6 +120,6 @@ export function createDefaultPreset<CTX extends EditorPluginContext = EditorPlug
121120 } )
122121 ) ;
123122
124- return createPlaygroundReactPreset < CTX > ( opts , plugins ) ( ctx ) ;
123+ return plugins ;
125124 } ;
126125}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 FlowNodesTransformLayer ,
2020 FlowScrollBarLayer ,
2121 FlowScrollLimitLayer ,
22+ createPlaygroundReactPreset ,
2223} from '@flowgram.ai/editor' ;
2324
2425import { FlowOperationService } from '../types' ;
@@ -152,6 +153,7 @@ export function createFixedLayoutPreset(
152153 } ,
153154 } )
154155 ) ;
155- return plugins ;
156+
157+ return createPlaygroundReactPreset ( opts , plugins ) ( ctx ) ;
156158 } ;
157159}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import {
2929 FlowNodesTransformLayer ,
3030 FlowScrollBarLayer ,
3131 FlowScrollLimitLayer ,
32+ createPlaygroundReactPreset ,
3233} from '@flowgram.ai/editor' ;
3334
3435import { FreeLayoutProps , FreeLayoutPluginContext } from './free-layout-props' ;
@@ -240,6 +241,7 @@ export function createFreeLayoutPreset(
240241 ...( opts . selectBox || { } ) ,
241242 } )
242243 ) ;
243- return plugins ;
244+
245+ return createPlaygroundReactPreset ( opts , plugins ) ( ctx ) ;
244246 } ;
245247}
Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ export function createPlaygroundReactPreset<CTX extends PluginContext = PluginCo
1717) : PluginsProvider < CTX > {
1818 return ( ctx : CTX ) => {
1919 plugins = plugins . slice ( ) ;
20+ /**
21+ * 注册背景 (放前面插入), 默认打开
22+ */
23+ if ( opts . background || opts . background === undefined ) {
24+ plugins . push ( createBackgroundPlugin ( opts . background || { } ) ) ;
25+ }
2026 /**
2127 * 注册快捷键
2228 */
@@ -70,13 +76,6 @@ export function createPlaygroundReactPreset<CTX extends PluginContext = PluginCo
7076 containerModules : opts . containerModules || [ ] ,
7177 } )
7278 ) ;
73-
74- /**
75- * 注册背景 (放最后插入), 默认打开
76- */
77- if ( opts . background || opts . background === undefined ) {
78- plugins . push ( createBackgroundPlugin ( opts . background || { } ) ) ;
79- }
8079 return plugins ;
8180 } ;
8281}
You can’t perform that action at this time.
0 commit comments