How to use the webiny-plugins.getPlugins function in webiny-plugins

To help you get started, we’ve selected a few webiny-plugins 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 / webiny-app-forms / src / admin / components / FormEditor / EditTab / useEditTab.js View on Github external
if (fields[pos.row].length === 0) {
                    fields.splice(pos.row, 1);
                    if (pos.row < row) {
                        createAtRef.current.row--;
                    }
                }

                return insertField(fieldData, createAtRef.current, { ...state, fields });
            });

            return;
        }

        // Find field plugin which handles the dropped field type "id".
        const plugin = getPlugins("form-editor-field-type").find(pl => pl.fieldType.id === type);
        const data = plugin.fieldType.createField();
        insertField(data, createAtRef.current);
    }
github webiny / webiny-js / packages / webiny-app-cms / src / editor / plugins / elements / imagesList / ImagesList.js View on Github external
const ImagesList = pure(({ data = {}, cms: { theme } }: Object = {}) => {
    const { component, images } = data;
    const components = getPlugins("pb-page-element-images-list-component");
    const imageList = components.find(cmp => cmp.name === component);

    if (!imageList) {
        return "Selected image gallery component not found!";
    }

    const { component: ListComponent } = imageList;
    if (!ListComponent) {
        return "You must select a component to render your image gallery!";
    }

    return ;
});
github webiny / webiny-js / packages / webiny-app-page-builder / src / editor / plugins / elementSettings / save / SaveAction.js View on Github external
const SaveAction = ({
    showDialog,
    hideDialog,
    isDialogOpened,
    children,
    onSubmit,
    element
}: Props) => {
    if (!element) {
        return null;
    }
    const plugin = getPlugins("pb-page-element").find(pl => pl.elementType === element.type);
    if (!plugin) {
        return null;
    }

    return (
        
            
            {React.cloneElement(children, { onClick: showDialog })}
github webiny / webiny-js / packages / webiny-app-cms / src / editor / components / Editor / Toolbar.js View on Github external
const Toolbar = ({ activePluginsTop }: Object) => {
    const actionsTop = getPlugins("cms-toolbar-top");
    const actionsBottom = getPlugins("cms-toolbar-bottom");

    return (
        
            
                {actionsTop
                    .filter(plugin => typeof plugin.renderDrawer === "function")
                    .map(plugin => (
                        
                            {plugin.renderDrawer()}
                        
                    ))}
github webiny / webiny-js / packages / webiny-app-cms / src / editor / plugins / elementSettings / advanced / AdvancedAction.js View on Github external
const AdvancedAction = ({ elementType, children }: Object) => {
    const plugins = getPlugins("pb-page-element-advanced-settings");

    if (!plugins.some(pl => pl.element === elementType)) {
        return null;
    }

    return children;
};
github webiny / webiny-js / packages / webiny-app-cms / src / render / components / Element.js View on Github external
const Element = ({ element, cms: { theme } }: ElementProps) => {
    if (!element) {
        return null;
    }

    const plugin = getPlugins("cms-render-element").find(pl => pl.element === element.type);

    if (!plugin) {
        return null;
    }

    return plugin.render({ theme, element });
};
github webiny / webiny-js / packages / webiny-app-forms / src / admin / plugins / validators / pattern.js View on Github external
renderSettings({ Bind, setValue, setMessage, data }) {
            const inputsDisabled = data.settings.preset !== "custom";
            const presetPlugins = getPlugins("form-editor-field-validator-pattern");

            return (
                
                    
                         {
                                if (value === "custom") {
                                    setMessage("Invalid value.");
                                    return;
                                }

                                setValue("settings.regex", null);
                                setValue("settings.flags", null);
github webiny / webiny-js / packages / webiny-app-cms / src / editor / plugins / defaultBar / components / PageOptionsMenu.js View on Github external
export default function PageOptionsMenu() {
    const plugins = getPlugins("cms-default-bar-right-page-options-option");
    return (
        <menu>} /&gt;}&gt;
            {plugins.map(pl =&gt; React.cloneElement(pl.render(), { key: pl.name }))}
        </menu>
    );
}

webiny-plugins

A simple registry that stores all plugins in a shared object.

MIT
Latest version published 6 years ago

Package Health Score

66 / 100
Full package analysis

Similar packages