@plaudit/gutenberg-api-extensions 2.43.1 → 2.44.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.
- package/build/blocks/MoveError.d.ts +10 -0
- package/build/blocks/MoveError.js +6 -0
- package/build/blocks/MoveError.js.map +1 -0
- package/build/blocks/PathError.d.ts +12 -0
- package/build/blocks/PathError.js +18 -0
- package/build/blocks/PathError.js.map +1 -0
- package/build/blocks/{snp-group-component.d.ts → SNPGroupComponent.d.ts} +6 -7
- package/build/blocks/SNPGroupComponent.js +6 -0
- package/build/blocks/SNPGroupComponent.js.map +1 -0
- package/build/blocks/SNPListComponent.d.ts +8 -0
- package/build/blocks/SNPListComponent.js +15 -0
- package/build/blocks/SNPListComponent.js.map +1 -0
- package/build/blocks/SNPTreeContext.d.ts +10 -0
- package/build/blocks/SNPTreeContext.js +15 -0
- package/build/blocks/SNPTreeContext.js.map +1 -0
- package/build/blocks/common-native-property-constructors.d.ts +14 -8
- package/build/blocks/common-native-property-constructors.js +128 -92
- package/build/blocks/common-native-property-constructors.js.map +1 -1
- package/build/blocks/conditions.d.ts +21 -0
- package/build/blocks/conditions.js +155 -0
- package/build/blocks/conditions.js.map +1 -0
- package/build/blocks/data-controller-manager.d.ts +8 -0
- package/build/blocks/data-controller-manager.js +38 -0
- package/build/blocks/data-controller-manager.js.map +1 -0
- package/build/blocks/data-controller.d.ts +62 -0
- package/build/blocks/data-controller.js +641 -0
- package/build/blocks/data-controller.js.map +1 -0
- package/build/blocks/full-size-toggle-control.d.ts +3 -3
- package/build/blocks/full-size-toggle-control.js +35 -32
- package/build/blocks/full-size-toggle-control.js.map +1 -1
- package/build/blocks/layered-styles-api.d.ts +3 -3
- package/build/blocks/layered-styles-api.js +2 -1
- package/build/blocks/layered-styles-api.js.map +1 -1
- package/build/blocks/layered-styles-impl.js +2 -4
- package/build/blocks/layered-styles-impl.js.map +1 -1
- package/build/blocks/layout/LaidOutProperty.d.ts +6 -0
- package/build/blocks/layout/LaidOutProperty.js +28 -0
- package/build/blocks/layout/LaidOutProperty.js.map +1 -0
- package/build/blocks/layout/LaidOutPropertyRow.d.ts +6 -0
- package/build/blocks/layout/LaidOutPropertyRow.js +12 -0
- package/build/blocks/layout/LaidOutPropertyRow.js.map +1 -0
- package/build/blocks/layout/NodeContext.d.ts +44 -0
- package/build/blocks/layout/NodeContext.js +37 -0
- package/build/blocks/layout/NodeContext.js.map +1 -0
- package/build/blocks/layout/PanelRoot.d.ts +5 -0
- package/build/blocks/layout/PanelRoot.js +23 -0
- package/build/blocks/layout/PanelRoot.js.map +1 -0
- package/build/blocks/layout/TabsRoot.d.ts +7 -0
- package/build/blocks/layout/TabsRoot.js +45 -0
- package/build/blocks/layout/TabsRoot.js.map +1 -0
- package/build/blocks/simple-block.js +6 -10
- package/build/blocks/simple-block.js.map +1 -1
- package/build/blocks/simple-native-property-api.d.ts +63 -28
- package/build/blocks/simple-native-property-api.js +9 -2
- package/build/blocks/simple-native-property-api.js.map +1 -1
- package/build/blocks/simple-native-property-impl.d.ts +0 -6
- package/build/blocks/simple-native-property-impl.js +121 -189
- package/build/blocks/simple-native-property-impl.js.map +1 -1
- package/build/blocks/simple-native-property-internal-shared.d.ts +30 -0
- package/build/blocks/simple-native-property-internal-shared.js +22 -0
- package/build/blocks/simple-native-property-internal-shared.js.map +1 -0
- package/build/blocks/snp-data-store.d.ts +8 -9
- package/build/blocks/snp-data-store.js +56 -31
- package/build/blocks/snp-data-store.js.map +1 -1
- package/build/controls/AsynchronousFormTokenField.d.ts +3 -3
- package/build/controls/AsynchronousFormTokenField.js +4 -18
- package/build/controls/AsynchronousFormTokenField.js.map +1 -1
- package/build/controls/ExtendedPostPicker.d.ts +3 -3
- package/build/controls/ExtendedPostPicker.js +4 -3
- package/build/controls/ExtendedPostPicker.js.map +1 -1
- package/build/controls/ExtendedRadioControl.d.ts +3 -3
- package/build/controls/ExtendedRadioControl.js +3 -11
- package/build/controls/ExtendedRadioControl.js.map +1 -1
- package/build/controls/ImageControl.d.ts +4 -2
- package/build/controls/ImageControl.js +16 -23
- package/build/controls/ImageControl.js.map +1 -1
- package/build/controls/InspectorPanel.d.ts +2 -2
- package/build/controls/InspectorPanel.js +4 -6
- package/build/controls/InspectorPanel.js.map +1 -1
- package/build/controls/LazySuggestionsComboboxControl.d.ts +1 -2
- package/build/controls/LazySuggestionsComboboxControl.js +3 -9
- package/build/controls/LazySuggestionsComboboxControl.js.map +1 -1
- package/build/controls/MultiSelectControl.d.ts +3 -3
- package/build/controls/MultiSelectControl.js +2 -2
- package/build/controls/MultiSelectControl.js.map +1 -1
- package/build/controls/PickOne.d.ts +5 -5
- package/build/controls/PickOne.js +7 -8
- package/build/controls/PickOne.js.map +1 -1
- package/build/controls/PromisableComponent.d.ts +1 -1
- package/build/controls/PromisableComponent.js +3 -3
- package/build/controls/PromisableComponent.js.map +1 -1
- package/build/controls/ProperLinkControl.d.ts +3 -3
- package/build/controls/ProperLinkControl.js +6 -9
- package/build/controls/ProperLinkControl.js.map +1 -1
- package/build/controls/SimpleToggle.d.ts +1 -2
- package/build/controls/SimpleToggle.js +2 -2
- package/build/controls/SimpleToggle.js.map +1 -1
- package/build/controls/SortableItemsControl.d.ts +7 -4
- package/build/controls/SortableItemsControl.js +12 -24
- package/build/controls/SortableItemsControl.js.map +1 -1
- package/build/controls/hooks/useTokenManager.js.map +1 -1
- package/build/editor/post-featured-image.js +34 -33
- package/build/editor/post-featured-image.js.map +1 -1
- package/build/lib/plaudit-icons/column-1.d.ts +1 -2
- package/build/lib/plaudit-icons/column-1.js +2 -3
- package/build/lib/plaudit-icons/column-1.js.map +1 -1
- package/build/lib/plaudit-icons/column-2.d.ts +1 -2
- package/build/lib/plaudit-icons/column-2.js +2 -3
- package/build/lib/plaudit-icons/column-2.js.map +1 -1
- package/build/lib/plaudit-icons/column-3.d.ts +1 -2
- package/build/lib/plaudit-icons/column-3.js +2 -3
- package/build/lib/plaudit-icons/column-3.js.map +1 -1
- package/build/lib/plaudit-icons/placement-center.d.ts +1 -2
- package/build/lib/plaudit-icons/placement-center.js +2 -3
- package/build/lib/plaudit-icons/placement-center.js.map +1 -1
- package/build/lib/plaudit-icons/placement-end.d.ts +1 -2
- package/build/lib/plaudit-icons/placement-end.js +2 -3
- package/build/lib/plaudit-icons/placement-end.js.map +1 -1
- package/build/lib/plaudit-icons/placement-start.d.ts +1 -2
- package/build/lib/plaudit-icons/placement-start.js +2 -3
- package/build/lib/plaudit-icons/placement-start.js.map +1 -1
- package/build/lib/plaudit-icons/placement-stretch.d.ts +1 -2
- package/build/lib/plaudit-icons/placement-stretch.js +2 -3
- package/build/lib/plaudit-icons/placement-stretch.js.map +1 -1
- package/build/lib/plaudit-icons/plaudit-icon.d.ts +1 -2
- package/build/lib/plaudit-icons/plaudit-icon.js +2 -3
- package/build/lib/plaudit-icons/plaudit-icon.js.map +1 -1
- package/build/lib/plaudit-icons/reusable-block-marker.d.ts +1 -2
- package/build/lib/plaudit-icons/reusable-block-marker.js +2 -3
- package/build/lib/plaudit-icons/reusable-block-marker.js.map +1 -1
- package/package.json +16 -12
- package/styles/editor.pcss +47 -0
- package/build/blocks/base-data-store.d.ts +0 -19
- package/build/blocks/base-data-store.js +0 -151
- package/build/blocks/base-data-store.js.map +0 -1
- package/build/blocks/data-store-list-holder.d.ts +0 -10
- package/build/blocks/data-store-list-holder.js +0 -55
- package/build/blocks/data-store-list-holder.js.map +0 -1
- package/build/blocks/object-data-store.d.ts +0 -15
- package/build/blocks/object-data-store.js +0 -41
- package/build/blocks/object-data-store.js.map +0 -1
- package/build/blocks/snp-group-component.js +0 -17
- package/build/blocks/snp-group-component.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoveError.js","sourceRoot":"","sources":["../../src/blocks/MoveError.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,IAAa,EAAE,EAAC,IAAI,EAAE,EAAE,EAAwD;QAC5G,KAAK,CAAC,GAAG,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RawPath } from "./simple-native-property-api";
|
|
2
|
+
export declare enum PathErrorType {
|
|
3
|
+
UNKNOWN = 0,
|
|
4
|
+
UNEXPECTED_LEAF = 1,
|
|
5
|
+
INSUFFICIENT_LENGTH = 2
|
|
6
|
+
}
|
|
7
|
+
export declare class PathError extends Error {
|
|
8
|
+
readonly path: RawPath;
|
|
9
|
+
readonly errorIndex: number;
|
|
10
|
+
readonly errorType: PathErrorType;
|
|
11
|
+
constructor(message: string, path: RawPath, errorIndex?: number, errorType?: PathErrorType);
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export var PathErrorType;
|
|
2
|
+
(function (PathErrorType) {
|
|
3
|
+
PathErrorType[PathErrorType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
4
|
+
PathErrorType[PathErrorType["UNEXPECTED_LEAF"] = 1] = "UNEXPECTED_LEAF";
|
|
5
|
+
PathErrorType[PathErrorType["INSUFFICIENT_LENGTH"] = 2] = "INSUFFICIENT_LENGTH";
|
|
6
|
+
})(PathErrorType || (PathErrorType = {}));
|
|
7
|
+
export class PathError extends Error {
|
|
8
|
+
path;
|
|
9
|
+
errorIndex;
|
|
10
|
+
errorType;
|
|
11
|
+
constructor(message, path, errorIndex = path.length - 1, errorType = PathErrorType.UNKNOWN) {
|
|
12
|
+
super(`${message} Full Path: ${path.join('.')}; Error Path: ${path.slice(0, errorIndex + 1).join('.')}`);
|
|
13
|
+
this.path = path;
|
|
14
|
+
this.errorIndex = errorIndex;
|
|
15
|
+
this.errorType = errorType;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=PathError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathError.js","sourceRoot":"","sources":["../../src/blocks/PathError.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,uDAAO,CAAA;IACP,uEAAe,CAAA;IACf,+EAAmB,CAAA;AACpB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,OAAO,SAAU,SAAQ,KAAK;IAGlB;IACA;IACA;IAJjB,YACC,OAAe,EACC,IAAa,EACb,aAAqB,IAAI,CAAC,MAAM,GAAG,CAAC,EACpC,YAAY,aAAa,CAAC,OAAO;QAEjD,KAAK,CAAC,GAAG,OAAO,eAAe,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAJzF,SAAI,GAAJ,IAAI,CAAS;QACb,eAAU,GAAV,UAAU,CAA0B;QACpC,cAAS,GAAT,SAAS,CAAwB;IAGlD,CAAC;CACD"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { Dict } from "../controls";
|
|
2
1
|
import type { GroupPropertyConfig } from "./common-native-property-constructors";
|
|
2
|
+
import type { Dict } from "../controls";
|
|
3
3
|
import type { CSNPControlComponentProps } from "./shared-internal-types";
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
4
|
+
import type { SNPControlSlots } from "./simple-native-property-api";
|
|
5
|
+
import type { HydratedLaidOutProperties } from "./simple-native-property-internal-shared";
|
|
6
6
|
export type SNPGroupComponentProps = CSNPControlComponentProps<GroupPropertyConfig, Dict<any>, {
|
|
7
|
-
hydratedProperties:
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export declare function SNPGroupComponent({ config, hydratedProperties, onChange, parentDataStore, value }: SNPGroupComponentProps): React.JSX.Element;
|
|
7
|
+
hydratedProperties: HydratedLaidOutProperties;
|
|
8
|
+
}> & SNPControlSlots;
|
|
9
|
+
export declare function SNPGroupComponent({ config, hydratedProperties, Label, Messages }: SNPGroupComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LaidOutPropertyRow } from "./layout/LaidOutPropertyRow";
|
|
3
|
+
export function SNPGroupComponent({ config, hydratedProperties, Label, Messages }) {
|
|
4
|
+
return _jsxs("fieldset", { ...config.component, className: config.component?.className ? `plaudit-snp-group-component ${config.component.className}` : "plaudit-snp-group-component", children: [_jsx("legend", { children: _jsx(Label, {}) }), ...hydratedProperties.map(property => _jsx(LaidOutPropertyRow, { property: property })), _jsx(Messages, {})] });
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=SNPGroupComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SNPGroupComponent.js","sourceRoot":"","sources":["../../src/blocks/SNPGroupComponent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAU/D,MAAM,UAAU,iBAAiB,CAAC,EAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,EAAyB;IACtG,OAAO,uBAAc,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,+BAA+B,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,6BAA6B,aAC1K,2BAAQ,KAAC,KAAK,KAAG,GAAS,KACtB,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAC,kBAAkB,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC,EAClF,KAAC,QAAQ,KAAG,IACF,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ObjectListPropertyConfig } from "./common-native-property-constructors";
|
|
2
|
+
import { type Dict } from "../controls";
|
|
3
|
+
import type { CSNPControlComponentProps } from "./shared-internal-types";
|
|
4
|
+
import type { HydratedSimpleNativeProperty, SNPControlSlots } from "./simple-native-property-api";
|
|
5
|
+
export type SNPListComponentProps = CSNPControlComponentProps<ObjectListPropertyConfig, Dict<any>[], {
|
|
6
|
+
hydratedProperties: (HydratedSimpleNativeProperty | HydratedSimpleNativeProperty[])[];
|
|
7
|
+
}> & SNPControlSlots;
|
|
8
|
+
export declare function SNPListComponent({ config, hydratedProperties, value, Label, Messages }: SNPListComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "@wordpress/element";
|
|
3
|
+
import { SortableItemsControl } from "../controls";
|
|
4
|
+
import { LaidOutPropertyRow } from "./layout/LaidOutPropertyRow";
|
|
5
|
+
import { NodeContextWrapper, useNodeContext } from "./layout/NodeContext";
|
|
6
|
+
export function SNPListComponent({ config, hydratedProperties, value, Label, Messages }) {
|
|
7
|
+
const context = useNodeContext("build a SNP List");
|
|
8
|
+
const onReorder = useCallback((oldIndex, newIndex) => context.moveNode({ from: oldIndex, to: newIndex }), [context]);
|
|
9
|
+
const emptyValue = useMemo(() => config.emptyValue ?? {}, [config.emptyValue]);
|
|
10
|
+
const childRenderer = useCallback((datum, onDatumChange, index) => {
|
|
11
|
+
return _jsx(NodeContextWrapper, { nodeName: index, children: hydratedProperties.map(property => _jsx(LaidOutPropertyRow, { property: property })) });
|
|
12
|
+
}, [hydratedProperties]);
|
|
13
|
+
return _jsx(SortableItemsControl, { value: value, min: config.min, max: config.max, Label: Label, Messages: Messages, help: config.help, emptyValue: emptyValue, ...config.component, onAdd: context.addNode, onRemove: context.removeNode, onReorder: onReorder, children: childRenderer });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SNPListComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SNPListComponent.js","sourceRoot":"","sources":["../../src/blocks/SNPListComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAY,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AASxE,MAAM,UAAU,gBAAgB,CAAC,EAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAwB;IAC3G,MAAM,OAAO,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnI,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/E,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,KAAgB,EAAE,aAAyC,EAAE,KAAa,EAAE,EAAE;QAChH,OAAO,KAAC,kBAAkB,IAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAC,kBAAkB,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC,GAAI,CAAA;IACzI,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,OAAO,KAAC,oBAAoB,IAC3B,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,KACvH,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GACxH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataController } from "./simple-native-property-api";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export type SNPTreeContextValue = {
|
|
4
|
+
dataController: DataController;
|
|
5
|
+
};
|
|
6
|
+
export declare const SNPTreeContext: import("react").Context<SNPTreeContextValue | undefined>;
|
|
7
|
+
export declare function useSNPTreeContext(action: string): SNPTreeContextValue;
|
|
8
|
+
export declare function SNPTreeContextRoot({ dataController, children }: SNPTreeContextValue & {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from "@wordpress/element";
|
|
3
|
+
export const SNPTreeContext = createContext(undefined);
|
|
4
|
+
export function useSNPTreeContext(action) {
|
|
5
|
+
const SNPTreeContextValue = useContext(SNPTreeContext);
|
|
6
|
+
if (SNPTreeContextValue === undefined) {
|
|
7
|
+
throw new Error(`Cannot ${action} outside of a SNPTreeContext`);
|
|
8
|
+
}
|
|
9
|
+
return SNPTreeContextValue;
|
|
10
|
+
}
|
|
11
|
+
export function SNPTreeContextRoot({ dataController, children }) {
|
|
12
|
+
const snpTreeContextValue = useMemo(() => ({ dataController }), [dataController]);
|
|
13
|
+
return _jsx(SNPTreeContext.Provider, { value: snpTreeContextValue, children: children });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SNPTreeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SNPTreeContext.js","sourceRoot":"","sources":["../../src/blocks/SNPTreeContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAMtE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAC;AAEtF,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC/C,MAAM,mBAAmB,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACvD,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,8BAA8B,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC5B,CAAC;AACD,MAAM,UAAU,kBAAkB,CAAC,EAAC,cAAc,EAAE,QAAQ,EAA4C;IACvG,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAwB,EAAE,CAAC,CAAC,EAAC,cAAc,EAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACrG,OAAO,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AACpF,CAAC"}
|
|
@@ -9,7 +9,7 @@ import type { ToggleGroupControlProps } from "@wordpress/components/build-types/
|
|
|
9
9
|
import { type ExtendedPostPickerProps, type ImageData, type ProperLinkControlProps, type SortableItemsControlProps, type PickableOptions } from "../controls";
|
|
10
10
|
import type { NormalSwitch, SmallSwitch } from "./shared-internal-types";
|
|
11
11
|
import type { IconName } from "./shared-exportable-types";
|
|
12
|
-
import type { GenericSimpleNativeProperty,
|
|
12
|
+
import type { BlockName, GenericSimpleNativeProperty, HydratedSimpleNativeProperty, PDSimpleNativeProperty, SimpleNativeProperty, SimpleNativePropertyType } from "./simple-native-property-api";
|
|
13
13
|
import React, { type CSSProperties, type ReactElement } from "react";
|
|
14
14
|
type ActualBEPAttrs = Record<string, any> & {
|
|
15
15
|
className?: string | undefined;
|
|
@@ -18,10 +18,15 @@ type PromisablePickableOptions<V extends string | number, T extends object = {}>
|
|
|
18
18
|
export type ActualBlockEditProps = {
|
|
19
19
|
attributes: ActualBEPAttrs;
|
|
20
20
|
setAttributes: (attributes: ActualBEPAttrs) => void;
|
|
21
|
-
name:
|
|
21
|
+
name: BlockName;
|
|
22
22
|
clientId: string;
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type ActualBlockListBlockProps = {
|
|
25
|
+
attributes: ActualBEPAttrs;
|
|
26
|
+
name: BlockName;
|
|
27
|
+
clientId: string;
|
|
28
|
+
};
|
|
29
|
+
export type CommonPropertyConfig<T, C, V extends SimpleNativePropertyType> = Omit<GenericSimpleNativeProperty<T, V>, 'control' | 'enum' | 'type' | 'label'> & {
|
|
25
30
|
label: string;
|
|
26
31
|
help?: string;
|
|
27
32
|
component?: Partial<C>;
|
|
@@ -29,7 +34,7 @@ export type CommonPropertyConfig<T, C, V extends SimpleNativePropertyType> = Omi
|
|
|
29
34
|
export type CommonPropertyConfigWithEnum<T, C, V extends SimpleNativePropertyType> = CommonPropertyConfig<T, C, V> & {
|
|
30
35
|
enum?: T[];
|
|
31
36
|
};
|
|
32
|
-
export type ShareableSNPElements<T extends SimpleNativeProperty['type']> = Pick<SimpleNativeProperty, 'name' | 'condition' | 'alwaysStore'> & {
|
|
37
|
+
export type ShareableSNPElements<T extends SimpleNativeProperty['type']> = Pick<SimpleNativeProperty, 'name' | 'condition' | 'alwaysStore' | 'label' | 'required'> & {
|
|
33
38
|
type: T;
|
|
34
39
|
};
|
|
35
40
|
export type CommonSimpleNativeProperty<N extends string, T, C, V extends SimpleNativePropertyType, A = {}> = CommonPropertyConfig<T, C, V> & A & {
|
|
@@ -113,7 +118,7 @@ export type ImagePropertyConfig = Omit<CommonPropertyConfig<ImageData, {}, 'obje
|
|
|
113
118
|
includeFocalPointPicker?: boolean;
|
|
114
119
|
};
|
|
115
120
|
export type GroupPropertyConfig = CommonPropertyConfig<Record<string, unknown>, React.HTMLAttributes<HTMLFieldSetElement>, 'object'> & {
|
|
116
|
-
fields
|
|
121
|
+
fields?: PDSimpleNativeProperty[];
|
|
117
122
|
};
|
|
118
123
|
type ListPropertyConfigBase<T extends string | number | object, V extends 'string' | 'number' | 'object'> = CommonPropertyConfig<T[], SortableItemsControlProps<T>, V> & {
|
|
119
124
|
emptyValue?: T;
|
|
@@ -130,7 +135,7 @@ export type StringListPropertyConfig = ListPropertyConfigBase<string, 'string'>
|
|
|
130
135
|
itemType?: 'string';
|
|
131
136
|
};
|
|
132
137
|
export type ObjectListPropertyConfig = ListPropertyConfigBase<object, 'object'> & {
|
|
133
|
-
itemType:
|
|
138
|
+
itemType: PDSimpleNativeProperty[];
|
|
134
139
|
};
|
|
135
140
|
export type ListPropertyConfig = StringListPropertyConfig | NumberListPropertyConfig | ObjectListPropertyConfig;
|
|
136
141
|
type ToggleGroupPropertyConfigBase<T extends string | number, V extends 'string' | 'number'> = CommonPropertyConfig<T, ToggleGroupControlProps, V> & {
|
|
@@ -149,7 +154,7 @@ export type TogglePropertyConfig = (CommonPropertyConfig<boolean, ToggleControlP
|
|
|
149
154
|
switch?: NormalSwitch;
|
|
150
155
|
});
|
|
151
156
|
export type CSNPConfig = ColorPaletteCSNPConfig | ConstantPropertyCSNPConfig | DatePropertyCSNPConfig | GroupPropertyCSNPConfig | ImagePropertyCSNPConfig | LinkPropertyCSNPConfig | ListPropertyCSNPConfig | NumberPropertyCSNPConfig | PostPropertyCSNPConfig | RadioPropertyCSNPConfig | RangePropertyCSNPConfig | SelectPropertyCSNPConfig | TextareaPropertyCSNPConfig | TextPropertyCSNPConfig | ToggleGroupPropertyCSNPConfig | TogglePropertyCSNPConfig;
|
|
152
|
-
export declare function hydrateSimpleNativeProperty(config:
|
|
157
|
+
export declare function hydrateSimpleNativeProperty(config: PDSimpleNativeProperty): HydratedSimpleNativeProperty;
|
|
153
158
|
type PostPropertyTypeSingle = CommonPropertyConfig<number, ExtendedPostPickerProps, 'number'> & {
|
|
154
159
|
postTypes?: string[];
|
|
155
160
|
multiple?: false;
|
|
@@ -159,5 +164,6 @@ type PostPropertyTypeMultiple = CommonPropertyConfig<number[], ExtendedPostPicke
|
|
|
159
164
|
multiple: true;
|
|
160
165
|
};
|
|
161
166
|
export type PostPropertyType = PostPropertyTypeSingle | PostPropertyTypeMultiple;
|
|
162
|
-
export declare function hydratePostProperty(config: PostPropertyType):
|
|
167
|
+
export declare function hydratePostProperty(config: PostPropertyType): HydratedSimpleNativeProperty;
|
|
168
|
+
export declare function registerPlainTextLabelRequiredMarker(componentType: string, labelSelectorFragment: string): void;
|
|
163
169
|
export {};
|