/**
 * Generated by a build script. Do not modify.
 * Check orginal .jsx file.
 */
/* eslint-disable */

(function(Drupal2, wp2) {
  const { blocks, element, blockEditor } = wp2;
  const { registerBlockType } = blocks;
  const { Fragment } = element;
  const { RichText } = blockEditor;
  const __ = Drupal2.t;
  const settings = {
    title: __("Simple text"),
    description: __("Simple text block."),
    icon: "editor-textcolor",
    supports: {
      inserter: false
    },
    attributes: {
      tag: {
        type: "string",
        default: "p"
      },
      text: {
        type: "string"
      },
      placeholder: {
        type: "string",
        default: "Insert text"
      }
    },
    edit({ className, attributes, setAttributes }) {
      const { text, tag, placeholder } = attributes;
      return /* @__PURE__ */ React.createElement(Fragment, null, /* @__PURE__ */ React.createElement("div", { className }, /* @__PURE__ */ React.createElement(
        RichText,
        {
          tagName: tag,
          value: text,
          placeholder,
          keepPlaceholderOnFocus: true,
          allowedFormats: [],
          onChange: (newValue) => setAttributes({ text: newValue })
        }
      )));
    },
    save({ attributes }) {
      const { text } = attributes;
      return /* @__PURE__ */ React.createElement("span", null, text);
    }
  };
  settings.deprecated = [
    {
      attributes: settings.attributes,
      supports: settings.supports,
      save: ({ attributes }) => {
        const { text } = attributes;
        return text;
      }
    }
  ];
  registerBlockType(`drupal/simple-text`, { category: "common", ...settings });
})(Drupal, wp);
