@plaudit/gutenberg-api-extensions 1.4.0 → 1.4.1

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.
@@ -5,7 +5,7 @@ import React, { type ReactNode } from "react";
5
5
  export type SimpleBlockTypeConfig<TAttributes extends Record<string, any>> = {
6
6
  icon?: BlockConfiguration<TAttributes>['icon'] | undefined;
7
7
  defaults: Required<TAttributes>;
8
- controls: NonNullable<Block<TAttributes>['edit']>;
8
+ controls?: NonNullable<Block<TAttributes>['edit']>;
9
9
  renderer: (attributes: BlockSaveProps<TAttributes>, wrapperProps: UseBlockProps | UseBlockProps['save'], innerBlocks: () => React.ReactElement, mode: "edit" | "save") => ReactNode;
10
10
  innerBlocksProps?: InnerBlocks.Props;
11
11
  settings?: Partial<BlockConfiguration<TAttributes>>;
@@ -17,7 +17,7 @@ export function registerSimpleBlockType(metadata, config) {
17
17
  const populatedProps = applyDefaults(props);
18
18
  const rendered = config.renderer(populatedProps, useBlockProps, () => React.createElement(InnerBlocks, Object.assign({}, config.innerBlocksProps)), "edit");
19
19
  return React.createElement(React.Fragment, null,
20
- React.createElement(config.controls, Object.assign({}, populatedProps)),
20
+ config.controls && React.createElement(config.controls, Object.assign({}, populatedProps)),
21
21
  rendered);
22
22
  },
23
23
  save(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/gutenberg-api-extensions",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "scripts": {
5
5
  "prepublishOnly": "rm -rf build && mkdir build && tsc",
6
6
  "build": "tsc",