@plaudit/gutenberg-api-extensions 2.1.0 → 2.2.0

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.
@@ -0,0 +1,33 @@
1
+ import type { RangeControlProps } from "@wordpress/components/build-types/range-control/types";
2
+ import type { TextControlProps } from "@wordpress/components/build-types/text-control/types";
3
+ import type { TextareaControlProps } from "@wordpress/components/build-types/textarea-control/types";
4
+ import type { SimpleNativeProperty } from "./simple-native-property";
5
+ type CommonPropertyConfig<T, V> = {
6
+ name: string;
7
+ label: string;
8
+ default: T;
9
+ enum?: T[];
10
+ component?: V;
11
+ };
12
+ export declare function rangeProperty(config: CommonPropertyConfig<number, RangeControlProps> & {
13
+ min: number;
14
+ max: number;
15
+ step?: number;
16
+ enum?: number[];
17
+ }): SimpleNativeProperty;
18
+ export declare function textProperty(config: CommonPropertyConfig<string, TextControlProps>): SimpleNativeProperty;
19
+ export declare function textareaProperty(config: CommonPropertyConfig<string, TextareaControlProps>): SimpleNativeProperty;
20
+ export type ImagePropertyData = {
21
+ media?: {
22
+ id?: number;
23
+ url?: string;
24
+ };
25
+ pos?: {
26
+ x?: number;
27
+ y?: number;
28
+ };
29
+ };
30
+ export declare function imageProperty(config: Omit<CommonPropertyConfig<ImagePropertyData, {}>, 'default'> & Partial<Pick<CommonPropertyConfig<ImagePropertyData, {}>, 'default'>> & {
31
+ enableFocalPointPicker?: boolean;
32
+ }): SimpleNativeProperty;
33
+ export {};
@@ -0,0 +1,82 @@
1
+ import { MediaUpload, MediaUploadCheck } from "@wordpress/block-editor";
2
+ import { Button, Card, CardBody, CardHeader, FocalPointPicker, RangeControl, ResponsiveWrapper, TextareaControl, TextControl, __experimentalHeading as Heading } from "@wordpress/components";
3
+ import { useSelect } from "@wordpress/data";
4
+ import { __ } from "@wordpress/i18n";
5
+ import React from "react";
6
+ export function rangeProperty(config) {
7
+ return {
8
+ name: config.name,
9
+ type: 'number',
10
+ enum: config.enum,
11
+ default: config.default,
12
+ renderer(value, onChange) {
13
+ return React.createElement(RangeControl, Object.assign({ value: value, onChange: onChange, min: config.min, max: config.max, label: config.label, step: config.step }, config.component));
14
+ }
15
+ };
16
+ }
17
+ export function textProperty(config) {
18
+ return {
19
+ name: config.name,
20
+ type: 'string',
21
+ default: config.default,
22
+ renderer(value, onChange) {
23
+ return React.createElement(TextControl, Object.assign({ value: value, onChange: onChange }, config.component));
24
+ }
25
+ };
26
+ }
27
+ export function textareaProperty(config) {
28
+ return {
29
+ name: config.name,
30
+ type: 'string',
31
+ default: config.default,
32
+ renderer(value, onChange) {
33
+ return React.createElement(TextareaControl, Object.assign({ value: value, onChange: onChange }, config.component));
34
+ }
35
+ };
36
+ }
37
+ export function imageProperty(config) {
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
39
+ return {
40
+ name: config.name,
41
+ type: "object",
42
+ default: { media: { id: (_c = (_b = (_a = config.default) === null || _a === void 0 ? void 0 : _a.media) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : 0, url: (_f = (_e = (_d = config.default) === null || _d === void 0 ? void 0 : _d.media) === null || _e === void 0 ? void 0 : _e.url) !== null && _f !== void 0 ? _f : '' }, pos: { x: (_j = (_h = (_g = config.default) === null || _g === void 0 ? void 0 : _g.pos) === null || _h === void 0 ? void 0 : _h.x) !== null && _j !== void 0 ? _j : 50, y: (_m = (_l = (_k = config.default) === null || _k === void 0 ? void 0 : _k.pos) === null || _l === void 0 ? void 0 : _l.y) !== null && _m !== void 0 ? _m : 50 } },
43
+ renderer(value, onChange) {
44
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
45
+ const { media } = useSelect(select => {
46
+ var _a;
47
+ return { media: ((_a = value.media) === null || _a === void 0 ? void 0 : _a.id) ? select('core').getMedia(value.media.id) : undefined };
48
+ }, [value]);
49
+ const noImageUploadedVersion = React.createElement(MediaUploadCheck, null,
50
+ React.createElement(MediaUpload, { onSelect: media => onChange(Object.assign(Object.assign({}, value), { media: { id: media.id, url: media['url'] } })), value: (_b = (_a = value.media) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0, allowedTypes: ['image'], render: ({ open }) => {
51
+ var _a, _b;
52
+ return (React.createElement(Button, { className: !((_a = value.media) === null || _a === void 0 ? void 0 : _a.id) ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview', onClick: open },
53
+ !((_b = value.media) === null || _b === void 0 ? void 0 : _b.id) && __('Choose an image', 'plaudit'),
54
+ media &&
55
+ React.createElement(ResponsiveWrapper, { naturalWidth: media.media_details.width, naturalHeight: media.media_details.height },
56
+ React.createElement("img", { src: media.source_url, alt: "The currently-selected image." }))));
57
+ } }));
58
+ let fppOrMedia;
59
+ if (config.enableFocalPointPicker !== false) {
60
+ fppOrMedia = React.createElement(FocalPointPicker, { onChange: pos => onChange(Object.assign(Object.assign({}, value), { pos: { x: pos.x * 100, y: pos.y * 100 } })), url: (_d = (_c = value.media) === null || _c === void 0 ? void 0 : _c.url) !== null && _d !== void 0 ? _d : '', value: {
61
+ x: ((_f = (_e = value.pos) === null || _e === void 0 ? void 0 : _e.x) !== null && _f !== void 0 ? _f : 50) / 100,
62
+ y: ((_h = (_g = value.pos) === null || _g === void 0 ? void 0 : _g.y) !== null && _h !== void 0 ? _h : 50) / 100
63
+ } });
64
+ }
65
+ else {
66
+ fppOrMedia = React.createElement(ResponsiveWrapper, { naturalWidth: media === null || media === void 0 ? void 0 : media.media_details.width, naturalHeight: media === null || media === void 0 ? void 0 : media.media_details.height },
67
+ React.createElement("img", { src: (_k = (_j = value.media) === null || _j === void 0 ? void 0 : _j.url) !== null && _k !== void 0 ? _k : '', alt: "The currently-selected image." }));
68
+ }
69
+ const imageUploadedVersion = React.createElement(React.Fragment, null,
70
+ ((_l = value.media) === null || _l === void 0 ? void 0 : _l.url) && fppOrMedia,
71
+ React.createElement(MediaUploadCheck, null,
72
+ React.createElement(MediaUpload, { title: __('Replace image', 'plaudit'), value: (_o = (_m = value.media) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : 0, onSelect: media => onChange(Object.assign(Object.assign({}, value), { media: { id: media.id, url: media['url'] } })), allowedTypes: ['image'], render: ({ open }) => (React.createElement(Button, { onClick: open, variant: "secondary" }, __('Replace image', 'plaudit'))) })),
73
+ React.createElement(MediaUploadCheck, null,
74
+ React.createElement(Button, { onClick: () => onChange(Object.assign(Object.assign({}, value), { media: { id: 0, url: '' } })), isDestructive: true }, __('Remove image', 'plaudit'))));
75
+ return React.createElement(Card, null,
76
+ React.createElement(CardHeader, null,
77
+ React.createElement(Heading, null, config.label)),
78
+ React.createElement(CardBody, null,
79
+ React.createElement("div", { className: "editor-post-featured-image" }, ((_p = value.media) === null || _p === void 0 ? void 0 : _p.id) ? imageUploadedVersion : noImageUploadedVersion)));
80
+ }
81
+ };
82
+ }
@@ -1,2 +1,4 @@
1
1
  export * from "./simple-block";
2
2
  export * from "./layered-styles";
3
+ export * from "./simple-native-property";
4
+ export * from './common-native-property-implementations';
@@ -1,18 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./simple-block"), exports);
18
- __exportStar(require("./layered-styles"), exports);
1
+ export * from "./simple-block";
2
+ export * from "./layered-styles";
3
+ export * from "./simple-native-property";
4
+ export * from './common-native-property-implementations';
@@ -1,20 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.installLayeredBlockStylesSupport = exports.registerLayeredBlockStyles = void 0;
7
- const compose_1 = require("@wordpress/compose");
8
- const hooks_1 = require("@wordpress/hooks");
9
- const react_1 = __importDefault(require("react"));
10
- const controls_1 = require("../controls");
11
- function registerLayeredBlockStyles(config) {
1
+ import { createHigherOrderComponent } from "@wordpress/compose";
2
+ import { addFilter } from "@wordpress/hooks";
3
+ import React from "react";
4
+ import { InspectorPanel, PickOneFromColors, PickOneFromRadios, PickOneFromSelect, PickOneFromToggleGroup } from "../controls";
5
+ export function registerLayeredBlockStyles(config) {
12
6
  var _a;
13
7
  const layeredBlockStyles = (_a = window.plauditLayeredBlockStyles) !== null && _a !== void 0 ? _a : (window.plauditLayeredBlockStyles = new Map());
14
8
  layeredBlockStyles.set(config.block, config);
15
9
  }
16
- exports.registerLayeredBlockStyles = registerLayeredBlockStyles;
17
- function installLayeredBlockStylesSupport() {
10
+ export function installLayeredBlockStylesSupport() {
18
11
  var _a;
19
12
  if (window.plauditLayeredBlockStylesInstalled) {
20
13
  return;
@@ -52,22 +45,21 @@ function installLayeredBlockStylesSupport() {
52
45
  switch (layer.picker) {
53
46
  case undefined:
54
47
  case 'toggle-control':
55
- return react_1.default.createElement(controls_1.PickOneFromToggleGroup, Object.assign({}, layer, sharedProps));
48
+ return React.createElement(PickOneFromToggleGroup, Object.assign({}, layer, sharedProps));
56
49
  case 'color':
57
- return react_1.default.createElement(controls_1.PickOneFromColors, Object.assign({}, layer, sharedProps));
50
+ return React.createElement(PickOneFromColors, Object.assign({}, layer, sharedProps));
58
51
  case 'radio':
59
- return react_1.default.createElement(controls_1.PickOneFromRadios, Object.assign({}, layer, sharedProps));
52
+ return React.createElement(PickOneFromRadios, Object.assign({}, layer, sharedProps));
60
53
  case 'select':
61
- return react_1.default.createElement(controls_1.PickOneFromSelect, Object.assign({}, layer, sharedProps));
54
+ return React.createElement(PickOneFromSelect, Object.assign({}, layer, sharedProps));
62
55
  }
63
56
  }
64
- (0, hooks_1.addFilter)('editor.BlockEdit', 'plaudit/gutenberg-api-extensions/layered-styles', (0, compose_1.createHigherOrderComponent)(BlockEdit => (props) => {
57
+ addFilter('editor.BlockEdit', 'plaudit/gutenberg-api-extensions/layered-styles', createHigherOrderComponent(BlockEdit => (props) => {
65
58
  if (!layeredBlockStyles.has(props['name'])) {
66
- return react_1.default.createElement(BlockEdit, Object.assign({}, props));
59
+ return React.createElement(BlockEdit, Object.assign({}, props));
67
60
  }
68
- return react_1.default.createElement(react_1.default.Fragment, null,
69
- react_1.default.createElement(BlockEdit, Object.assign({}, props)),
70
- react_1.default.createElement(controls_1.InspectorPanel, { title: "Layered Styles", initialOpen: true, group: "styles" }, ...layeredBlockStyles.get(props['name']).layers.map(layer => convertLayersToRadios(layer, layeredBlockStyles.get(props['name']).layers, props))));
61
+ return React.createElement(React.Fragment, null,
62
+ React.createElement(BlockEdit, Object.assign({}, props)),
63
+ React.createElement(InspectorPanel, { title: "Layered Styles", initialOpen: true, group: "styles" }, ...layeredBlockStyles.get(props['name']).layers.map(layer => convertLayersToRadios(layer, layeredBlockStyles.get(props['name']).layers, props))));
71
64
  }, 'plauditGutenbergApiExtensionsLayeredStyles'));
72
65
  }
73
- exports.installLayeredBlockStylesSupport = installLayeredBlockStylesSupport;
@@ -1,13 +1,7 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerSimpleContainerBlock = exports.registerSimpleBlockType = void 0;
7
- const blocks_1 = require("@wordpress/blocks");
8
- const block_editor_1 = require("@wordpress/block-editor");
9
- const plaudit_icons_1 = require("../lib/plaudit-icons");
10
- const react_1 = __importDefault(require("react"));
1
+ import { registerBlockType } from "@wordpress/blocks";
2
+ import { InnerBlocks, useBlockProps, useInnerBlocksProps } from "@wordpress/block-editor";
3
+ import { plauditIcon } from "../lib/plaudit-icons";
4
+ import React from "react";
11
5
  function applyDefaults(config, props) {
12
6
  var _a;
13
7
  const mutableProps = Object.assign(Object.assign({}, props), { attributes: Object.assign({}, props.attributes) });
@@ -18,32 +12,30 @@ function applyDefaults(config, props) {
18
12
  }
19
13
  return mutableProps;
20
14
  }
21
- function registerSimpleBlockType(metadata, config) {
15
+ export function registerSimpleBlockType(metadata, config) {
22
16
  var _a;
23
- return (0, blocks_1.registerBlockType)(metadata, Object.assign(Object.assign({}, config.settings), { icon: (_a = config.icon) !== null && _a !== void 0 ? _a : plaudit_icons_1.plauditIcon, edit(props) {
17
+ return registerBlockType(metadata, Object.assign(Object.assign({}, config.settings), { icon: (_a = config.icon) !== null && _a !== void 0 ? _a : plauditIcon, edit(props) {
24
18
  const populatedProps = applyDefaults(config, props);
25
- return react_1.default.createElement(react_1.default.Fragment, null,
26
- config.controls && react_1.default.createElement(config.controls, Object.assign({}, populatedProps)),
27
- config.renderer(populatedProps, block_editor_1.useBlockProps, () => react_1.default.createElement(block_editor_1.InnerBlocks, Object.assign({}, config.innerBlocksProps)), "edit"));
19
+ return React.createElement(React.Fragment, null,
20
+ config.controls && React.createElement(config.controls, Object.assign({}, populatedProps)),
21
+ config.renderer(populatedProps, useBlockProps, () => React.createElement(InnerBlocks, Object.assign({}, config.innerBlocksProps)), "edit"));
28
22
  },
29
23
  save(props) {
30
- return config.renderer(applyDefaults(config, props), block_editor_1.useBlockProps.save, () => react_1.default.createElement(block_editor_1.InnerBlocks.Content, null), "save");
24
+ return config.renderer(applyDefaults(config, props), useBlockProps.save, () => React.createElement(InnerBlocks.Content, null), "save");
31
25
  } }));
32
26
  }
33
- exports.registerSimpleBlockType = registerSimpleBlockType;
34
- function registerSimpleContainerBlock(metadata, config) {
27
+ export function registerSimpleContainerBlock(metadata, config) {
35
28
  var _a, _b;
36
- const Tag = (_a = config.tag) !== null && _a !== void 0 ? _a : ((props) => react_1.default.createElement("div", Object.assign({}, props)));
37
- return (0, blocks_1.registerBlockType)(metadata, Object.assign(Object.assign({}, config.settings), { icon: (_b = config.icon) !== null && _b !== void 0 ? _b : plaudit_icons_1.plauditIcon, edit(props) {
29
+ const Tag = (_a = config.tag) !== null && _a !== void 0 ? _a : ((props) => React.createElement("div", Object.assign({}, props)));
30
+ return registerBlockType(metadata, Object.assign(Object.assign({}, config.settings), { icon: (_b = config.icon) !== null && _b !== void 0 ? _b : plauditIcon, edit(props) {
38
31
  var _a;
39
32
  const populatedProps = applyDefaults(config, props);
40
- return react_1.default.createElement(react_1.default.Fragment, null,
41
- config.controls && react_1.default.createElement(config.controls, Object.assign({}, populatedProps)),
42
- react_1.default.createElement(Tag, Object.assign({}, (0, block_editor_1.useInnerBlocksProps)((0, block_editor_1.useBlockProps)(((_a = config.attributesFromProps) !== null && _a !== void 0 ? _a : (() => ({})))(populatedProps, "edit")), config.innerBlocksProps))));
33
+ return React.createElement(React.Fragment, null,
34
+ config.controls && React.createElement(config.controls, Object.assign({}, populatedProps)),
35
+ React.createElement(Tag, Object.assign({}, useInnerBlocksProps(useBlockProps(((_a = config.attributesFromProps) !== null && _a !== void 0 ? _a : (() => ({})))(populatedProps, "edit")), config.innerBlocksProps))));
43
36
  },
44
37
  save(props) {
45
38
  var _a;
46
- return react_1.default.createElement(Tag, Object.assign({}, block_editor_1.useInnerBlocksProps.save(block_editor_1.useBlockProps.save(((_a = config.attributesFromProps) !== null && _a !== void 0 ? _a : (() => ({})))(applyDefaults(config, props), "edit")))));
39
+ return React.createElement(Tag, Object.assign({}, useInnerBlocksProps.save(useBlockProps.save(((_a = config.attributesFromProps) !== null && _a !== void 0 ? _a : (() => ({})))(applyDefaults(config, props), "edit")))));
47
40
  } }));
48
41
  }
49
- exports.registerSimpleContainerBlock = registerSimpleContainerBlock;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ export type InspectorPanelGroup = 'default' | 'advanced' | 'background' | 'border' | 'color' | 'dimensions' | 'effects' | 'filter' | 'list' | 'position' | 'settings' | 'styles' | 'typography';
3
+ type GenericSimpleNativeProperty<T, V extends 'string' | 'number' | 'boolean' | 'array' | 'object'> = {
4
+ name: string;
5
+ type: V;
6
+ enum?: T[];
7
+ default: T;
8
+ renderer(value: T, onChange: (v: T | undefined) => void): React.JSX.Element;
9
+ };
10
+ export type SimpleNativeProperty = GenericSimpleNativeProperty<string, 'string'> & {
11
+ enum?: string[];
12
+ } | GenericSimpleNativeProperty<number, 'number'> & {
13
+ enum?: number[];
14
+ } | GenericSimpleNativeProperty<boolean, 'boolean'> | GenericSimpleNativeProperty<any[], 'array'> | GenericSimpleNativeProperty<Record<string | number, unknown>, 'object'>;
15
+ export type SimpleNativePanel = {
16
+ title: string;
17
+ group?: InspectorPanelGroup;
18
+ initialOpen?: boolean;
19
+ properties: SimpleNativeProperty[];
20
+ };
21
+ export declare function registerSimpleNativeProperties(config: {
22
+ block: `${string}/${string}` | Array<`${string}/${string}`>;
23
+ panel: SimpleNativePanel | Array<SimpleNativePanel>;
24
+ }): void;
25
+ export declare function installSimpleNativePropertiesSupport(): void;
26
+ export {};
@@ -0,0 +1,156 @@
1
+ import { createHigherOrderComponent } from "@wordpress/compose";
2
+ import { addFilter } from "@wordpress/hooks";
3
+ import { InspectorPanel } from "../controls";
4
+ import React from "react";
5
+ export function registerSimpleNativeProperties(config) {
6
+ var _a;
7
+ const simpleNativePanels = (_a = window.plauditSimpleNativePanels) !== null && _a !== void 0 ? _a : (window.plauditSimpleNativePanels = {});
8
+ if (Array.isArray(config.block)) {
9
+ for (const b of config.block) {
10
+ addPanels(b, config.panel, simpleNativePanels);
11
+ }
12
+ }
13
+ else {
14
+ addPanels(config.block, config.panel, simpleNativePanels);
15
+ }
16
+ }
17
+ function addPanels(block, panel, simpleNativePanels) {
18
+ var _a;
19
+ const panels = ((_a = simpleNativePanels[block]) !== null && _a !== void 0 ? _a : (simpleNativePanels[block] = []));
20
+ if (Array.isArray(panel)) {
21
+ panels.push(...panel);
22
+ }
23
+ else {
24
+ panels.push(panel);
25
+ }
26
+ }
27
+ export function installSimpleNativePropertiesSupport() {
28
+ var _a;
29
+ if (window.plauditSimpleNativePropertiesSupportInstalled) {
30
+ return;
31
+ }
32
+ window.plauditSimpleNativePropertiesSupportInstalled = true;
33
+ const simpleNativePanels = (_a = window.plauditSimpleNativePanels) !== null && _a !== void 0 ? _a : (window.plauditSimpleNativePanels = {});
34
+ addFilter('blocks.registerBlockType', 'plaudit/gutenberg-api-extensions/attach-simple-native-properties', (atts) => {
35
+ const blockSimpleNativePanels = simpleNativePanels[atts.name];
36
+ if (blockSimpleNativePanels) {
37
+ const injectableProperties = {};
38
+ for (const blockSimpleNativePanel of blockSimpleNativePanels) {
39
+ for (const property of blockSimpleNativePanel.properties) {
40
+ const attrPath = property.name.split('.');
41
+ if (attrPath.length === 1) {
42
+ injectableProperties[property.name] = { type: property.type, default: property.default };
43
+ if ('enum' in property) {
44
+ injectableProperties[property.name].enum = property.enum;
45
+ }
46
+ }
47
+ else {
48
+ let actualProp = injectableProperties[attrPath[0]];
49
+ if (actualProp === undefined) {
50
+ injectableProperties[attrPath[0]] = actualProp = { type: "object" };
51
+ }
52
+ else if (actualProp.type !== "object") {
53
+ throw new Error(`Property type collision on ${property.name}. Attempted treat the property as an object when it was already a ${actualProp.type}`);
54
+ }
55
+ if (property.default !== undefined) {
56
+ if (actualProp.default === undefined) {
57
+ actualProp.default = {};
58
+ }
59
+ let target = actualProp.default;
60
+ for (let i = 1; i < attrPath.length - 1; i++) {
61
+ target = target[attrPath[i]] = {};
62
+ }
63
+ target[attrPath[attrPath.length - 1]] = property.default;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ for (const [name, config] of Object.entries(injectableProperties)) {
69
+ atts.attributes[name] = config;
70
+ }
71
+ }
72
+ return atts;
73
+ });
74
+ function setDottedAttribute(blockEditProps, attr, value) {
75
+ const attrPath = attr.split('.');
76
+ if (attrPath.length === 1) {
77
+ return blockEditProps.setAttributes({ [attr]: value });
78
+ }
79
+ const payload = Object.assign({}, blockEditProps.attributes[attrPath[0]]);
80
+ let currentLayer = payload;
81
+ for (let i = 1; i < attrPath.length - 1; i++) {
82
+ const attrPathNode = attrPath[i];
83
+ currentLayer = currentLayer[attrPathNode] = {};
84
+ }
85
+ currentLayer[attrPath[attrPath.length - 1]] = value;
86
+ blockEditProps.setAttributes({ [attrPath[0]]: payload });
87
+ }
88
+ addFilter('editor.BlockEdit', 'plaudit/gutenberg-api-extensions/simple-native-properties', createHigherOrderComponent(BlockEdit => (blockEditProps) => {
89
+ const blockSimpleNativePanels = simpleNativePanels[blockEditProps.name];
90
+ if (!blockSimpleNativePanels) {
91
+ return React.createElement(BlockEdit, Object.assign({}, blockEditProps));
92
+ }
93
+ return React.createElement(React.Fragment, null,
94
+ React.createElement(BlockEdit, Object.assign({}, blockEditProps)),
95
+ ...blockSimpleNativePanels.map(p => React.createElement(React.Fragment, null,
96
+ React.createElement(InspectorPanel, Object.assign({}, p), ...p.properties.map(prop => {
97
+ const propPath = prop.name.split('.');
98
+ let existingValue;
99
+ if (propPath.length === 1) {
100
+ existingValue = blockEditProps.attributes[prop.name];
101
+ if (existingValue === undefined) {
102
+ existingValue = prop.default;
103
+ blockEditProps.setAttributes({ [prop.name]: prop.default });
104
+ }
105
+ }
106
+ else {
107
+ let graphExistingValue = blockEditProps.attributes[propPath[0]];
108
+ if (graphExistingValue === undefined) {
109
+ blockEditProps.attributes[propPath[0]] = graphExistingValue = {};
110
+ }
111
+ for (let i = 1; i < propPath.length; i++) {
112
+ if (graphExistingValue[propPath[i]] === undefined) {
113
+ for (; i < propPath.length - 1; i++) {
114
+ graphExistingValue = graphExistingValue[propPath[i]] = {};
115
+ }
116
+ graphExistingValue[propPath[propPath.length - 1]] = existingValue = prop.default;
117
+ blockEditProps.setAttributes({ [propPath[0]]: blockEditProps.attributes[propPath[0]] });
118
+ break;
119
+ }
120
+ else {
121
+ graphExistingValue = graphExistingValue[propPath[i]];
122
+ }
123
+ }
124
+ existingValue = graphExistingValue !== null && graphExistingValue !== void 0 ? graphExistingValue : prop.default;
125
+ }
126
+ switch (prop.type) {
127
+ case "array":
128
+ // If the value is not an array or is a sparse array, then it will cause unrecoverable errors upon conversion to PHP
129
+ if (!Array.isArray(existingValue) || existingValue.length > existingValue.filter(() => true).length) {
130
+ throw new Error(`Invalid value passed to an array-type property: ${existingValue}`);
131
+ }
132
+ return prop.renderer(existingValue, value => setDottedAttribute(blockEditProps, prop.name, value));
133
+ case "object":
134
+ if (Array.isArray(existingValue) || typeof existingValue !== 'object') {
135
+ throw new Error(`Invalid value passed to an object-type property: ${existingValue}`);
136
+ }
137
+ return prop.renderer(existingValue, value => setDottedAttribute(blockEditProps, prop.name, value));
138
+ case "boolean":
139
+ if (typeof existingValue !== 'boolean' && existingValue !== undefined) {
140
+ existingValue = !!existingValue;
141
+ }
142
+ return prop.renderer(existingValue, value => setDottedAttribute(blockEditProps, prop.name, value));
143
+ case 'string':
144
+ if (typeof existingValue !== 'string' && existingValue !== undefined) {
145
+ existingValue = existingValue.toString();
146
+ }
147
+ return prop.renderer(existingValue, value => setDottedAttribute(blockEditProps, prop.name, value));
148
+ case "number":
149
+ if (typeof existingValue !== 'number' && existingValue !== undefined) {
150
+ existingValue = parseFloat(existingValue);
151
+ }
152
+ return prop.renderer(existingValue, value => setDottedAttribute(blockEditProps, prop.name, value));
153
+ }
154
+ })))));
155
+ }, 'plauditGutenbergApiExtensionsSimpleNativeProperties'));
156
+ }
@@ -1,15 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.InspectorPanel = void 0;
7
- const block_editor_1 = require("@wordpress/block-editor");
8
- const components_1 = require("@wordpress/components");
9
- const react_1 = __importDefault(require("react"));
10
- function InspectorPanel(props) {
11
- const FullyTypedInspectorControls = block_editor_1.InspectorControls;
12
- return react_1.default.createElement(FullyTypedInspectorControls, { group: props.group },
13
- react_1.default.createElement(components_1.PanelBody, Object.assign({}, props, { children: props.children })));
1
+ import { InspectorControls } from "@wordpress/block-editor";
2
+ import { PanelBody } from "@wordpress/components";
3
+ import React from "react";
4
+ export function InspectorPanel(props) {
5
+ const FullyTypedInspectorControls = InspectorControls;
6
+ return React.createElement(FullyTypedInspectorControls, { group: props.group },
7
+ React.createElement(PanelBody, Object.assign({}, props, { children: props.children })));
14
8
  }
15
- exports.InspectorPanel = InspectorPanel;
@@ -1,11 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PickOneFromColors = exports.PickOneFromRadios = exports.PickOneFromSelect = exports.PickOneFromToggleGroup = void 0;
7
- const components_1 = require("@wordpress/components");
8
- const react_1 = __importDefault(require("react"));
1
+ import { __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon, BaseControl, ColorPalette, RadioControl, SelectControl, useBaseControlProps } from "@wordpress/components";
2
+ import React from "react";
9
3
  function makeSharedRadioAndSelectProps(props) {
10
4
  return {
11
5
  label: props.label,
@@ -17,21 +11,18 @@ function makeSharedRadioAndSelectProps(props) {
17
11
  }))
18
12
  };
19
13
  }
20
- function PickOneFromToggleGroup(props) {
21
- return react_1.default.createElement(components_1.__experimentalToggleGroupControl, { label: props.label, value: props.attributes[props.attribute], onChange: value => props.setAttributes({ [props.attribute]: value }), children: props.options.map(([value, label]) => typeof label === 'string'
22
- ? react_1.default.createElement(components_1.__experimentalToggleGroupControlOption, { key: value, value: value, label: label })
23
- : react_1.default.createElement(components_1.__experimentalToggleGroupControlOptionIcon, { key: value, value: value, label: label.text, icon: label.icon })) });
14
+ export function PickOneFromToggleGroup(props) {
15
+ return React.createElement(ToggleGroupControl, { label: props.label, value: props.attributes[props.attribute], onChange: value => props.setAttributes({ [props.attribute]: value }), children: props.options.map(([value, label]) => typeof label === 'string'
16
+ ? React.createElement(ToggleGroupControlOption, { key: value, value: value, label: label })
17
+ : React.createElement(ToggleGroupControlOptionIcon, { key: value, value: value, label: label.text, icon: label.icon })) });
24
18
  }
25
- exports.PickOneFromToggleGroup = PickOneFromToggleGroup;
26
- function PickOneFromSelect(props) {
27
- return react_1.default.createElement(components_1.SelectControl, Object.assign({}, makeSharedRadioAndSelectProps(props), { value: props.attributes[props.attribute] }));
19
+ export function PickOneFromSelect(props) {
20
+ return React.createElement(SelectControl, Object.assign({}, makeSharedRadioAndSelectProps(props), { value: props.attributes[props.attribute] }));
28
21
  }
29
- exports.PickOneFromSelect = PickOneFromSelect;
30
- function PickOneFromRadios(props) {
31
- return react_1.default.createElement(components_1.RadioControl, Object.assign({}, makeSharedRadioAndSelectProps(props), { selected: props.attributes[props.attribute] }));
22
+ export function PickOneFromRadios(props) {
23
+ return React.createElement(RadioControl, Object.assign({}, makeSharedRadioAndSelectProps(props), { selected: props.attributes[props.attribute] }));
32
24
  }
33
- exports.PickOneFromRadios = PickOneFromRadios;
34
- function PickOneFromColors(props) {
25
+ export function PickOneFromColors(props) {
35
26
  var _a;
36
27
  const valueToColorMap = new Map();
37
28
  const colorToValueMap = new Map();
@@ -50,8 +41,7 @@ function PickOneFromColors(props) {
50
41
  }
51
42
  }
52
43
  const currentColor = (_a = valueToColorMap.get(props.attributes[props.attribute])) !== null && _a !== void 0 ? _a : props.attributes[props.attribute];
53
- const { baseControlProps, controlProps } = (0, components_1.useBaseControlProps)({ label: props.label });
54
- return react_1.default.createElement(components_1.BaseControl, Object.assign({}, baseControlProps),
55
- react_1.default.createElement(components_1.ColorPalette, Object.assign({}, controlProps, { disableCustomColors: true, onChange: color => { var _a, _b; return props.setAttributes({ [props.attribute]: (_b = (_a = colorToValueMap.get(color !== null && color !== void 0 ? color : currentColor)) !== null && _a !== void 0 ? _a : color) !== null && _b !== void 0 ? _b : currentColor }); }, colors: colors, value: currentColor, clearable: false })));
44
+ const { baseControlProps, controlProps } = useBaseControlProps({ label: props.label });
45
+ return React.createElement(BaseControl, Object.assign({}, baseControlProps),
46
+ React.createElement(ColorPalette, Object.assign({}, controlProps, { disableCustomColors: true, onChange: color => { var _a, _b; return props.setAttributes({ [props.attribute]: (_b = (_a = colorToValueMap.get(color !== null && color !== void 0 ? color : currentColor)) !== null && _a !== void 0 ? _a : color) !== null && _b !== void 0 ? _b : currentColor }); }, colors: colors, value: currentColor, clearable: false })));
56
47
  }
57
- exports.PickOneFromColors = PickOneFromColors;
@@ -1,12 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SimpleToggle = void 0;
7
- const components_1 = require("@wordpress/components");
8
- const react_1 = __importDefault(require("react"));
9
- function SimpleToggle(props) {
10
- return react_1.default.createElement(components_1.ToggleControl, { checked: props.attributes[props.attribute], label: props.label, onChange: checked => props.setAttributes({ [props.attribute]: checked }) });
1
+ import { ToggleControl } from "@wordpress/components";
2
+ import React from "react";
3
+ export function SimpleToggle(props) {
4
+ return React.createElement(ToggleControl, { checked: props.attributes[props.attribute], label: props.label, onChange: checked => props.setAttributes({ [props.attribute]: checked }) });
11
5
  }
12
- exports.SimpleToggle = SimpleToggle;
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./InspectorPanel"), exports);
18
- __exportStar(require("./SimpleToggle"), exports);
19
- __exportStar(require("./PickOne"), exports);
1
+ export * from "./InspectorPanel";
2
+ export * from "./SimpleToggle";
3
+ export * from "./PickOne";
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/build/index.js CHANGED
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./blocks"), exports);
18
- __exportStar(require("./controls"), exports);
19
- __exportStar(require("./lib/plaudit-icons"), exports);
1
+ export * from "./blocks";
2
+ export * from "./controls";
3
+ export * from "./lib/plaudit-icons";
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.iconColumn1 = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- exports.iconColumn1 = react_1.default.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
9
- react_1.default.createElement("path", { d: "M32 2H2v20h30V2zM2 0C.9 0 0 .9 0 2v20c0 1.1.9 2 2 2h30c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2H2z", fillRule: "evenodd", clipRule: "evenodd" }));
1
+ import React from "react";
2
+ export const iconColumn1 = React.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
3
+ React.createElement("path", { d: "M32 2H2v20h30V2zM2 0C.9 0 0 .9 0 2v20c0 1.1.9 2 2 2h30c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2H2z", fillRule: "evenodd", clipRule: "evenodd" }));
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.iconColumn2 = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- exports.iconColumn2 = react_1.default.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
9
- react_1.default.createElement("path", { d: "M32 0c1.1 0 2 .9 2 2v20c0 1.1-.9 2-2 2H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h30zm0 22V2H18v20h14zm-16 0H2V2h14v20z", fillRule: "evenodd", clipRule: "evenodd" }));
1
+ import React from "react";
2
+ export const iconColumn2 = React.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
3
+ React.createElement("path", { d: "M32 0c1.1 0 2 .9 2 2v20c0 1.1-.9 2-2 2H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h30zm0 22V2H18v20h14zm-16 0H2V2h14v20z", fillRule: "evenodd", clipRule: "evenodd" }));
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.iconColumn3 = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- exports.iconColumn3 = react_1.default.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
9
- react_1.default.createElement("path", { d: "M34 2c0-1.1-.9-2-2-2H2C.9 0 0 .9 0 2v20c0 1.1.9 2 2 2h30c1.1 0 2-.9 2-2V2zM21.5 22h-9V2h9v20zm2 0V2H32v20h-8.5zm-13 0H2V2h8.5v20z", fillRule: "evenodd", clipRule: "evenodd" }));
1
+ import React from "react";
2
+ export const iconColumn3 = React.createElement("svg", { width: 34, height: 24, viewBox: "0 0 34 24" },
3
+ React.createElement("path", { d: "M34 2c0-1.1-.9-2-2-2H2C.9 0 0 .9 0 2v20c0 1.1.9 2 2 2h30c1.1 0 2-.9 2-2V2zM21.5 22h-9V2h9v20zm2 0V2H32v20h-8.5zm-13 0H2V2h8.5v20z", fillRule: "evenodd", clipRule: "evenodd" }));
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.plauditIcon = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- exports.plauditIcon = react_1.default.createElement("svg", { width: 24, height: 24, viewBox: "0 0 139 157.6" },
9
- react_1.default.createElement("path", { fill: "#d20000", d: "M83.3 39.1L101.6 9c2-3.2.9-7.1-2.4-8.5s-6.9.4-7.9 4l-9.7 33.9c-1.1 3.6-.3 4 1.7.7zm-43.9 19L9 40.5c-3.3-1.9-7.1-.7-8.5 2.6s.5 6.8 4.2 7.8l34.1 8.9c3.7 1 4 .2.6-1.7zm16.3-19c2 3.2 2.7 2.9 1.7-.7L47.6 4.5C46.5.8 43-1 39.7.5S35.3 5.8 37.3 9l18.4 30.1zm82.8 4c-1.4-3.3-5.2-4.5-8.5-2.6L99.5 58.1c-3.3 1.9-3 2.7.7 1.7l34.1-8.9c3.7-1 5.6-4.5 4.2-7.8zM88.8 57.7c-10.6-18.3-28-18.3-38.7 0l-38.7 66.6c-10.6 18.3-1.9 33.3 19.3 33.3h77.4c21.3 0 30-15 19.3-33.3L88.8 57.7zm-19.3 1c7.1 0 12.8 5.8 12.7 12.9s-5.8 12.8-12.9 12.7c-7 0-12.7-5.8-12.8-12.8.1-7.1 5.8-12.9 13-12.8zm32 91.2h-64c-17.6 0-24.8-8.1-16-18l32-35.9c8.8-9.9 23.2-9.9 32 0l32 35.9c8.8 9.9 1.6 17.9-16 18z" }));
1
+ import React from "react";
2
+ export const plauditIcon = React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 139 157.6" },
3
+ React.createElement("path", { fill: "#d20000", d: "M83.3 39.1L101.6 9c2-3.2.9-7.1-2.4-8.5s-6.9.4-7.9 4l-9.7 33.9c-1.1 3.6-.3 4 1.7.7zm-43.9 19L9 40.5c-3.3-1.9-7.1-.7-8.5 2.6s.5 6.8 4.2 7.8l34.1 8.9c3.7 1 4 .2.6-1.7zm16.3-19c2 3.2 2.7 2.9 1.7-.7L47.6 4.5C46.5.8 43-1 39.7.5S35.3 5.8 37.3 9l18.4 30.1zm82.8 4c-1.4-3.3-5.2-4.5-8.5-2.6L99.5 58.1c-3.3 1.9-3 2.7.7 1.7l34.1-8.9c3.7-1 5.6-4.5 4.2-7.8zM88.8 57.7c-10.6-18.3-28-18.3-38.7 0l-38.7 66.6c-10.6 18.3-1.9 33.3 19.3 33.3h77.4c21.3 0 30-15 19.3-33.3L88.8 57.7zm-19.3 1c7.1 0 12.8 5.8 12.7 12.9s-5.8 12.8-12.9 12.7c-7 0-12.7-5.8-12.8-12.8.1-7.1 5.8-12.9 13-12.8zm32 91.2h-64c-17.6 0-24.8-8.1-16-18l32-35.9c8.8-9.9 23.2-9.9 32 0l32 35.9c8.8 9.9 1.6 17.9-16 18z" }));
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.reusableBlockMarker = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- exports.reusableBlockMarker = react_1.default.createElement("svg", { viewBox: "0 0 24 24" },
9
- react_1.default.createElement("path", { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }));
1
+ import React from "react";
2
+ export const reusableBlockMarker = React.createElement("svg", { viewBox: "0 0 24 24" },
3
+ React.createElement("path", { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }));
@@ -1,24 +1,8 @@
1
- "use strict";
2
1
  // =============================================
3
2
  // Allows sharing of assets in block configurations
4
3
  // =============================================
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./plaudit-icons/plaudit-icon"), exports);
21
- __exportStar(require("./plaudit-icons/column-1"), exports);
22
- __exportStar(require("./plaudit-icons/column-2"), exports);
23
- __exportStar(require("./plaudit-icons/column-3"), exports);
24
- __exportStar(require("./plaudit-icons/reusable-block-marker"), exports);
4
+ export * from './plaudit-icons/plaudit-icon';
5
+ export * from './plaudit-icons/column-1';
6
+ export * from './plaudit-icons/column-2';
7
+ export * from './plaudit-icons/column-3';
8
+ export * from './plaudit-icons/reusable-block-marker';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/gutenberg-api-extensions",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "scripts": {
5
5
  "prepublishOnly": "rm -rf build && mkdir build && tsc",
6
6
  "build": "tsc",
@@ -21,15 +21,15 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@wordpress/block-editor": "^12.18.2",
25
- "@wordpress/blocks": "^12.27.1",
26
- "@wordpress/components": "^25.16.0",
27
- "@wordpress/compose": "^6.27.0",
28
- "@wordpress/core-data": "^6.27.2",
29
- "@wordpress/data": "^9.20.0",
30
- "@wordpress/element": "^5.27.0",
31
- "@wordpress/hooks": "^3.50.0",
32
- "@wordpress/i18n": "^4.50.0",
24
+ "@wordpress/block-editor": "^12.19.0",
25
+ "@wordpress/blocks": "^12.28.0",
26
+ "@wordpress/components": "^26.0.0",
27
+ "@wordpress/compose": "^6.28.0",
28
+ "@wordpress/core-data": "^6.28.0",
29
+ "@wordpress/data": "^9.21.0",
30
+ "@wordpress/element": "^5.28.0",
31
+ "@wordpress/hooks": "^3.51.0",
32
+ "@wordpress/i18n": "^4.51.0",
33
33
  "react": "^18.2.0",
34
34
  "react-dom": "^18.2.0"
35
35
  },