How to use the @webiny/app-page-builder/editor/redux.redux.store function in @webiny/app-page-builder

To help you get started, we’ve selected a few @webiny/app-page-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / elementSettings / clone / CloneAction.js View on Github external
duplicate: ({ element }) => () => {
            const state = redux.store.getState();
            element = getElementWithChildren(state, element.id);
            const parent = getParentElementWithChildren(state, element.id);
            const position = parent.elements.findIndex(el => el.id === element.id) + 1;

            const newElement = set(parent, "elements", [
                ...parent.elements.slice(0, position),
                cloneElement(element),
                ...(position < parent.elements.length ? parent.elements.slice(position) : [])
            ]);
            return redux.store.dispatch(updateElement({ element: newElement }));
        }
    })
github webiny / webiny-js / packages / app-page-builder / src / admin / views / Pages / Editor.js View on Github external
Loading Editor<span>.</span>
                                <span>.</span>
                                <span>.</span>
                            
                        
                    
                );
            }

            if (!get(data, "pageBuilder.page.data")) {
                return null;
            }

            if (!redux.store) {
                redux.initStore({}, { client });
            }

            if (!loading) {
                const { revisions, ...page } = data.pageBuilder.page.data;
                if (!page.content) {
                    page.content = createElement("document");
                }

                if (pageSet !== page.id) {
                    pageSet = page.id;
                    redux.store.dispatch({
                        type: SETUP_EDITOR,
                        payload: getEmptyData(page, revisions)
                    });
                    redux.store.dispatch({ type: "@@redux-undo/INIT" });
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / elements / block / index.js View on Github external
onChildDeleted({ element }) {
            if (element.elements.length === 0) {
                element = set(element, "elements", [
                    createRow({
                        elements: [createColumn({ data: { width: 100 } })]
                    })
                ]);

                redux.store.dispatch(updateElement({ element }));
            }
        }
    };
github webiny / webiny-js / packages / app-page-builder / src / admin / views / Pages / Editor.js View on Github external
return null;
            }

            if (!redux.store) {
                redux.initStore({}, { client });
            }

            if (!loading) {
                const { revisions, ...page } = data.pageBuilder.page.data;
                if (!page.content) {
                    page.content = createElement("document");
                }

                if (pageSet !== page.id) {
                    pageSet = page.id;
                    redux.store.dispatch({
                        type: SETUP_EDITOR,
                        payload: getEmptyData(page, revisions)
                    });
                    redux.store.dispatch({ type: "@@redux-undo/INIT" });
                }
            }

            return (
                
                    
                        
                    
                    <div style="{{">
                        
                    </div>

@webiny/app-page-builder

[![](https://img.shields.io/npm/dw/@webiny/app-page-builder.svg)](https://www.npmjs.com/package/@webiny/app-page-builder) [![](https://img.shields.io/npm/v/@webiny/app-page-builder.svg)](https://www.npmjs.com/package/@webiny/app-page-builder) [![code sty

MIT
Latest version published 2 days ago

Package Health Score

80 / 100
Full package analysis

Similar packages