@blockbite/ui 2.0.5 → 2.0.6
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/dist/AutocompleteDropdown.d.ts +1 -1
- package/dist/AutocompleteDropdown.js +24 -24
- package/dist/BitePreview.d.ts +1 -2
- package/dist/BitePreview.js +9 -9
- package/dist/ButtonToggle.d.ts +3 -4
- package/dist/ButtonToggle.js +13 -14
- package/dist/DropdownPicker.js +1 -1
- package/dist/EmptyState.d.ts +1 -1
- package/dist/EmptyState.js +5 -5
- package/dist/FloatingPanel.d.ts +1 -1
- package/dist/FloatingPanel.js +12 -12
- package/dist/FocalPointControl.d.ts +1 -1
- package/dist/FocalPointControl.js +1 -0
- package/dist/LinkPicker.d.ts +1 -1
- package/dist/LinkPicker.js +16 -16
- package/dist/MediaPicker.d.ts +1 -1
- package/dist/MediaPicker.js +14 -14
- package/dist/MetricsControl.d.ts +1 -1
- package/dist/MetricsControl.js +51 -55
- package/dist/Modal.d.ts +7 -7
- package/dist/Modal.js +3 -3
- package/dist/Popover.js +1 -1
- package/dist/RangeSlider.d.ts +1 -2
- package/dist/RangeSlider.js +26 -26
- package/dist/ResponsiveImage.d.ts +1 -1
- package/dist/ResponsiveImage.js +6 -6
- package/dist/ResponsiveVideo.d.ts +1 -1
- package/dist/ResponsiveVideo.js +2 -2
- package/dist/SectionList.d.ts +1 -1
- package/dist/SectionList.js +18 -18
- package/dist/SingleBlockTypeAppender.d.ts +2 -2
- package/dist/SingleBlockTypeAppender.js +7 -7
- package/dist/Tabs.d.ts +5 -0
- package/dist/Tabs.js +22 -17
- package/dist/TextControlLabel.js +1 -1
- package/dist/ToggleGroup.d.ts +2 -2
- package/dist/index.d.ts +48 -0
- package/dist/index.js +88 -0
- package/package.json +24 -20
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js +0 -589
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -28
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js +0 -8
- package/dist/packages/icons/jsx/ChevronDown.js +0 -23
- package/dist/packages/icons/jsx/ColumnSpacing.js +0 -25
- package/dist/packages/icons/jsx/Cross2.js +0 -23
- package/dist/packages/icons/jsx/Desktop.js +0 -25
- package/dist/packages/icons/jsx/Grid.js +0 -25
- package/dist/packages/icons/jsx/Pencil1.js +0 -25
- package/dist/packages/icons/jsx/Percentage.js +0 -28
- package/dist/packages/icons/jsx/Plus.js +0 -23
- package/dist/packages/icons/jsx/Slider.js +0 -25
- package/dist/packages/icons/jsx/Tailwind.js +0 -23
- package/dist/packages/icons/jsx/Trash.js +0 -25
|
@@ -7,5 +7,5 @@ interface OptionPanelDropdownProps {
|
|
|
7
7
|
onPressedChange: (value: string) => void;
|
|
8
8
|
swatch?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export declare function AutocompleteDropdown({ defaultValue, options, swatch, onPressedChange, }: OptionPanelDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { j as e } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import v from "
|
|
2
|
+
import { Pencil1 as v } from "@blockbite/icons";
|
|
3
3
|
import { Dropdown as f, TextControl as j, Button as h } from "@wordpress/components";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as c, useEffect as p } from "@wordpress/element";
|
|
5
5
|
import n from "classnames";
|
|
6
|
-
import { ButtonToggle as
|
|
6
|
+
import { ButtonToggle as N } from "./ButtonToggle.js";
|
|
7
7
|
import { Wrap as x } from "./Wrap.js";
|
|
8
8
|
function T({
|
|
9
|
-
defaultValue:
|
|
9
|
+
defaultValue: r,
|
|
10
10
|
options: s,
|
|
11
11
|
swatch: l,
|
|
12
12
|
onPressedChange: u
|
|
13
13
|
}) {
|
|
14
|
-
const [o, i] =
|
|
15
|
-
return
|
|
14
|
+
const [o, i] = c(""), [d, m] = c([]);
|
|
15
|
+
return p(() => {
|
|
16
16
|
m(
|
|
17
17
|
s.filter(
|
|
18
|
-
(
|
|
18
|
+
(t) => t.label.toLowerCase().includes(o.toLowerCase())
|
|
19
19
|
)
|
|
20
20
|
);
|
|
21
|
-
}, [o, s]),
|
|
21
|
+
}, [o, s]), p(() => {
|
|
22
22
|
i(""), m(s);
|
|
23
|
-
}, [
|
|
23
|
+
}, [r, s]), /* @__PURE__ */ e.jsx(
|
|
24
24
|
f,
|
|
25
25
|
{
|
|
26
26
|
className: "option-panel-dropdown",
|
|
27
27
|
contentClassName: "option-panel-dropdown-content",
|
|
28
28
|
popoverProps: { placement: "bottom-start" },
|
|
29
|
-
renderToggle: ({ isOpen:
|
|
29
|
+
renderToggle: ({ isOpen: t, onToggle: a }) => /* @__PURE__ */ e.jsx(x, { important: !0, children: /* @__PURE__ */ e.jsx(
|
|
30
30
|
h,
|
|
31
31
|
{
|
|
32
32
|
variant: "secondary",
|
|
33
33
|
size: "small",
|
|
34
34
|
onClick: a,
|
|
35
|
-
"aria-expanded":
|
|
35
|
+
"aria-expanded": t,
|
|
36
36
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 !bg-transparent !p-0 !text-[11px] !text-current", children: [
|
|
37
37
|
l && /* @__PURE__ */ e.jsx(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
className: n(
|
|
41
|
-
`h-3 w-3 rounded-full bg-${
|
|
41
|
+
`h-3 w-3 rounded-full bg-${r}`
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
45
|
+
/* @__PURE__ */ e.jsx("span", { children: r || "Select option…" }),
|
|
46
46
|
/* @__PURE__ */ e.jsx(v, {})
|
|
47
47
|
] })
|
|
48
48
|
}
|
|
@@ -53,37 +53,37 @@ function T({
|
|
|
53
53
|
{
|
|
54
54
|
label: "Search options",
|
|
55
55
|
value: o,
|
|
56
|
-
onChange: (
|
|
56
|
+
onChange: (t) => i(t),
|
|
57
57
|
autoComplete: "off"
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
60
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-1 !bg-transparent !p-0 !pt-2", children: [
|
|
61
61
|
d.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "!text-gray-medium col-span-2 pb-2 text-center !text-[11px]", children: "No options found." }),
|
|
62
|
-
d.map((
|
|
63
|
-
|
|
62
|
+
d.map((t, a) => /* @__PURE__ */ e.jsxs(
|
|
63
|
+
N,
|
|
64
64
|
{
|
|
65
65
|
className: n({
|
|
66
|
-
"bg-primary":
|
|
66
|
+
"bg-primary": t.value
|
|
67
67
|
}),
|
|
68
68
|
size: "small",
|
|
69
|
-
value:
|
|
70
|
-
defaultPressed:
|
|
69
|
+
value: t.value.toString(),
|
|
70
|
+
defaultPressed: r,
|
|
71
71
|
onPressedChange: (g) => {
|
|
72
|
-
u(g ?
|
|
72
|
+
u(g ? t.value : "");
|
|
73
73
|
},
|
|
74
74
|
children: [
|
|
75
75
|
l && /* @__PURE__ */ e.jsx(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
className: n(
|
|
79
|
-
`mr-3 h-3 w-3 rounded-full bg-${
|
|
79
|
+
`mr-3 h-3 w-3 rounded-full bg-${t.value}`
|
|
80
80
|
)
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
|
|
83
|
+
t.label
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
`ButtonToggle__${
|
|
86
|
+
`ButtonToggle__${t.value}___${a}`
|
|
87
87
|
))
|
|
88
88
|
] })
|
|
89
89
|
] }) })
|
|
@@ -91,5 +91,5 @@ function T({
|
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
T as
|
|
94
|
+
T as AutocompleteDropdown
|
|
95
95
|
};
|
package/dist/BitePreview.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare const BitePreview: ({ htmlContent, cssContent, frontendAssets }: {
|
|
1
|
+
export declare const BitePreview: ({ htmlContent, cssContent, frontendAssets }: {
|
|
2
2
|
htmlContent: any;
|
|
3
3
|
cssContent: any;
|
|
4
4
|
frontendAssets: any;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default BitePreview;
|
package/dist/BitePreview.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as r } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { useRef as h, useState as y, useEffect as E, createPortal as w } from "@wordpress/element";
|
|
3
|
-
const j = ({ htmlContent: i, cssContent: s, frontendAssets:
|
|
4
|
-
const
|
|
3
|
+
const j = ({ htmlContent: i, cssContent: s, frontendAssets: o }) => {
|
|
4
|
+
const a = h(null), [l, p] = y(null);
|
|
5
5
|
return E(() => {
|
|
6
|
-
const n =
|
|
6
|
+
const n = a.current;
|
|
7
7
|
return n && (n.onload = () => {
|
|
8
8
|
const t = n.contentDocument || n.contentWindow.document;
|
|
9
9
|
if (t) {
|
|
10
10
|
p(t.body);
|
|
11
11
|
const c = t.createElement("style");
|
|
12
|
-
c.innerHTML = s, t.head.appendChild(c),
|
|
12
|
+
c.innerHTML = s, t.head.appendChild(c), o.forEach(({ type: d, id: m, url: f }) => {
|
|
13
13
|
const u = document.getElementById(m);
|
|
14
14
|
if (u) {
|
|
15
15
|
const e = document.adoptNode(
|
|
@@ -27,7 +27,7 @@ const j = ({ htmlContent: i, cssContent: s, frontendAssets: a }) => {
|
|
|
27
27
|
}), () => {
|
|
28
28
|
n && (n.onload = null);
|
|
29
29
|
};
|
|
30
|
-
}, [i, s,
|
|
30
|
+
}, [i, s, o]), /* @__PURE__ */ r.jsxs(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: "render-preview-container",
|
|
@@ -36,14 +36,14 @@ const j = ({ htmlContent: i, cssContent: s, frontendAssets: a }) => {
|
|
|
36
36
|
/* @__PURE__ */ r.jsx(
|
|
37
37
|
"iframe",
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: a,
|
|
40
40
|
title: "Preview",
|
|
41
41
|
className: "editor-styles-wrapper",
|
|
42
42
|
width: "100%",
|
|
43
43
|
height: "100%"
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
|
|
46
|
+
l && w(
|
|
47
47
|
/* @__PURE__ */ r.jsx("div", { className: "b_", children: /* @__PURE__ */ r.jsx(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
@@ -51,12 +51,12 @@ const j = ({ htmlContent: i, cssContent: s, frontendAssets: a }) => {
|
|
|
51
51
|
dangerouslySetInnerHTML: { __html: i }
|
|
52
52
|
}
|
|
53
53
|
) }),
|
|
54
|
-
|
|
54
|
+
l
|
|
55
55
|
)
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
|
-
j as
|
|
61
|
+
j as BitePreview
|
|
62
62
|
};
|
package/dist/ButtonToggle.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ type ButtonToggleGroupProps = {
|
|
|
30
30
|
icon?: any;
|
|
31
31
|
onPressedChange?: (value: string) => void;
|
|
32
32
|
};
|
|
33
|
-
declare const ButtonToggle: React.FC<ButtonToggleProps>;
|
|
34
|
-
declare const ButtonToggleGroup: React.FC<ButtonToggleGroupProps>;
|
|
35
|
-
export
|
|
36
|
-
export { ButtonToggle, ButtonToggleGroup };
|
|
33
|
+
export declare const ButtonToggle: React.FC<ButtonToggleProps>;
|
|
34
|
+
export declare const ButtonToggleGroup: React.FC<ButtonToggleGroupProps>;
|
|
35
|
+
export {};
|
package/dist/ButtonToggle.js
CHANGED
|
@@ -8,7 +8,7 @@ const E = p(
|
|
|
8
8
|
({
|
|
9
9
|
children: u,
|
|
10
10
|
className: c,
|
|
11
|
-
value:
|
|
11
|
+
value: r,
|
|
12
12
|
variant: o = "secondary",
|
|
13
13
|
defaultPressed: i,
|
|
14
14
|
onPressedChange: m,
|
|
@@ -17,24 +17,24 @@ const E = p(
|
|
|
17
17
|
display: a = "auto",
|
|
18
18
|
label: l
|
|
19
19
|
}) => {
|
|
20
|
-
const [
|
|
20
|
+
const [t, n] = g(!1);
|
|
21
21
|
w(() => {
|
|
22
|
-
n(i ===
|
|
22
|
+
n(i === r);
|
|
23
23
|
}, [i]);
|
|
24
24
|
const j = B(() => {
|
|
25
|
-
n((_) => !_), m(
|
|
26
|
-
}, [
|
|
25
|
+
n((_) => !_), m(r);
|
|
26
|
+
}, [t, m]);
|
|
27
27
|
return /* @__PURE__ */ s.jsxs(
|
|
28
28
|
k,
|
|
29
29
|
{
|
|
30
30
|
"aria-label": l,
|
|
31
31
|
className: d(c, "blockbite-ui__button--default"),
|
|
32
|
-
value:
|
|
32
|
+
value: r,
|
|
33
33
|
size: x,
|
|
34
34
|
label: l,
|
|
35
35
|
variant: o,
|
|
36
36
|
showTooltip: !0,
|
|
37
|
-
isPressed:
|
|
37
|
+
isPressed: t,
|
|
38
38
|
onClick: j,
|
|
39
39
|
children: [
|
|
40
40
|
b && /* @__PURE__ */ s.jsx(h, { icon: b }),
|
|
@@ -48,7 +48,7 @@ const E = p(
|
|
|
48
48
|
({
|
|
49
49
|
className: u,
|
|
50
50
|
defaultPressed: c = "",
|
|
51
|
-
toggle:
|
|
51
|
+
toggle: r = !0,
|
|
52
52
|
display: o = "auto",
|
|
53
53
|
options: i,
|
|
54
54
|
size: m = "compact",
|
|
@@ -57,16 +57,16 @@ const E = p(
|
|
|
57
57
|
stretch: a = !1,
|
|
58
58
|
onPressedChange: l
|
|
59
59
|
}) => {
|
|
60
|
-
const [
|
|
60
|
+
const [t, n] = g(c);
|
|
61
61
|
w(() => {
|
|
62
62
|
n(c);
|
|
63
63
|
}, [c]);
|
|
64
64
|
const j = B(
|
|
65
65
|
(e) => {
|
|
66
|
-
const f =
|
|
66
|
+
const f = r && t === e ? "" : e;
|
|
67
67
|
n(f), l?.(f);
|
|
68
68
|
},
|
|
69
|
-
[
|
|
69
|
+
[t, l, r]
|
|
70
70
|
), _ = (e) => o === "icon" && e?.icon ? /* @__PURE__ */ s.jsx(h, { icon: e.icon }) : o === "label" ? /* @__PURE__ */ s.jsx("span", { children: e.label }) : /* @__PURE__ */ s.jsxs("span", { className: "flex items-center justify-center gap-1", children: [
|
|
71
71
|
e.icon && /* @__PURE__ */ s.jsx(h, { icon: e.icon }),
|
|
72
72
|
/* @__PURE__ */ s.jsx("span", { children: e.label })
|
|
@@ -92,7 +92,7 @@ const E = p(
|
|
|
92
92
|
size: m,
|
|
93
93
|
label: e?.tooltip || e.label,
|
|
94
94
|
variant: x,
|
|
95
|
-
isPressed:
|
|
95
|
+
isPressed: t === e.value,
|
|
96
96
|
onClick: () => j(e.value),
|
|
97
97
|
children: [
|
|
98
98
|
_(e),
|
|
@@ -107,6 +107,5 @@ const E = p(
|
|
|
107
107
|
);
|
|
108
108
|
export {
|
|
109
109
|
E as ButtonToggle,
|
|
110
|
-
G as ButtonToggleGroup
|
|
111
|
-
G as default
|
|
110
|
+
G as ButtonToggleGroup
|
|
112
111
|
};
|
package/dist/DropdownPicker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as o } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import p from "
|
|
2
|
+
import { ChevronDown as p } from "@blockbite/icons";
|
|
3
3
|
import { DropdownMenu as b } from "@wordpress/components";
|
|
4
4
|
import { useState as f, useEffect as v } from "@wordpress/element";
|
|
5
5
|
import x from "classnames";
|
package/dist/EmptyState.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export declare function EmptyState({ icon, title, description, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
package/dist/EmptyState.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as s } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
2
|
function n({
|
|
3
3
|
icon: t,
|
|
4
|
-
title:
|
|
5
|
-
description:
|
|
4
|
+
title: m,
|
|
5
|
+
description: a,
|
|
6
6
|
children: e = null,
|
|
7
7
|
...l
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ s.jsx("div", { ...l, children: /* @__PURE__ */ s.jsx("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans", children: /* @__PURE__ */ s.jsxs("div", { className: "max-w-sm", children: [
|
|
10
10
|
t && /* @__PURE__ */ s.jsx("div", { className: "mx-auto !text-gray-400", children: t }),
|
|
11
|
-
/* @__PURE__ */ s.jsx("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium", children:
|
|
12
|
-
/* @__PURE__ */ s.jsx("p", { className: "mt-1 !font-sans text-sm !text-gray-500", children:
|
|
11
|
+
/* @__PURE__ */ s.jsx("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium", children: m }),
|
|
12
|
+
/* @__PURE__ */ s.jsx("p", { className: "mt-1 !font-sans text-sm !text-gray-500", children: a }),
|
|
13
13
|
e && /* @__PURE__ */ s.jsx("div", { className: "mt-4", children: e })
|
|
14
14
|
] }) }) });
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
n as
|
|
17
|
+
n as EmptyState
|
|
18
18
|
};
|
package/dist/FloatingPanel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type DraggablePanelProps = {
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export declare function FloatingPanel({ children, }: DraggablePanelProps & {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
package/dist/FloatingPanel.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as x, useState as
|
|
1
|
+
import { j as o } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { useRef as x, useState as s, useEffect as g } from "@wordpress/element";
|
|
3
3
|
function w({
|
|
4
|
-
children:
|
|
4
|
+
children: c
|
|
5
5
|
}) {
|
|
6
|
-
const i = x(null), [r,
|
|
6
|
+
const i = x(null), [r, d] = s({ x: 100, y: 100 }), [l, a] = s(!1), [n, f] = s({ x: 0, y: 0 });
|
|
7
7
|
g(() => {
|
|
8
8
|
const e = (u) => {
|
|
9
|
-
|
|
9
|
+
l && d({
|
|
10
10
|
x: u.clientX - n.x,
|
|
11
11
|
y: u.clientY - n.y
|
|
12
12
|
});
|
|
13
|
-
}, t = () =>
|
|
13
|
+
}, t = () => a(!1);
|
|
14
14
|
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
|
|
15
15
|
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
|
|
16
16
|
};
|
|
17
|
-
}, [
|
|
17
|
+
}, [l, n]);
|
|
18
18
|
const m = (e) => {
|
|
19
19
|
const t = i.current.getBoundingClientRect();
|
|
20
|
-
f({ x: e.clientX - t.left, y: e.clientY - t.top }),
|
|
20
|
+
f({ x: e.clientX - t.left, y: e.clientY - t.top }), a(!0);
|
|
21
21
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ o.jsx("div", { className: "bb_", children: /* @__PURE__ */ o.jsxs(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
25
|
ref: i,
|
|
26
26
|
className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]",
|
|
27
27
|
style: { left: r.x, top: r.y },
|
|
28
28
|
children: [
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
29
|
+
c,
|
|
30
|
+
/* @__PURE__ */ o.jsx(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded",
|
|
@@ -39,5 +39,5 @@ function w({
|
|
|
39
39
|
) });
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
w as
|
|
42
|
+
w as FloatingPanel
|
|
43
43
|
};
|
|
@@ -3,5 +3,5 @@ type FocalPointControlProps = {
|
|
|
3
3
|
onValueChange: (value: string) => void;
|
|
4
4
|
url?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const FocalPointControl: React.FC<FocalPointControlProps>;
|
|
6
|
+
export declare const FocalPointControl: React.FC<FocalPointControlProps>;
|
|
7
7
|
export default FocalPointControl;
|
package/dist/LinkPicker.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function LinkPicker(props: any): import("react/jsx-runtime").JSX.Element;
|
package/dist/LinkPicker.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as e } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import
|
|
3
|
-
import { TextControl as
|
|
2
|
+
import h from "@wordpress/api-fetch";
|
|
3
|
+
import { TextControl as u } from "@wordpress/components";
|
|
4
4
|
import { useState as c, useEffect as a } from "@wordpress/element";
|
|
5
5
|
import { __ as p } from "@wordpress/i18n";
|
|
6
6
|
import { Wrap as k } from "./Wrap.js";
|
|
7
|
-
function g(
|
|
8
|
-
const [t,
|
|
7
|
+
function g(r) {
|
|
8
|
+
const [t, s] = c(""), [i, n] = c([]), [o, b] = c({
|
|
9
9
|
url: "",
|
|
10
10
|
title: ""
|
|
11
11
|
});
|
|
12
12
|
return a(() => {
|
|
13
|
-
t !== "" && (n(null),
|
|
13
|
+
t !== "" && (n(null), h({
|
|
14
14
|
path: `/blockbite/v1/block-helpers/get-links/${t}`
|
|
15
15
|
}).then(
|
|
16
16
|
(l) => {
|
|
@@ -18,15 +18,15 @@ function g(s) {
|
|
|
18
18
|
}
|
|
19
19
|
));
|
|
20
20
|
}, [t]), a(() => {
|
|
21
|
-
o.url !== "" &&
|
|
21
|
+
o.url !== "" && r.parentCallback(o);
|
|
22
22
|
}, [o]), /* @__PURE__ */ e.jsxs(k, { className: "blockbite--editor-linkwrap", children: [
|
|
23
23
|
/* @__PURE__ */ e.jsx(
|
|
24
|
-
|
|
24
|
+
u,
|
|
25
25
|
{
|
|
26
26
|
label: p("Search link", "blockbitelinks"),
|
|
27
27
|
value: t,
|
|
28
28
|
placeholder: "Example: About",
|
|
29
|
-
onChange: (l) =>
|
|
29
|
+
onChange: (l) => s(l),
|
|
30
30
|
help: p("Type a post, page, title", "blockbitelinks")
|
|
31
31
|
}
|
|
32
32
|
),
|
|
@@ -35,17 +35,17 @@ function g(s) {
|
|
|
35
35
|
{
|
|
36
36
|
links: i,
|
|
37
37
|
onActiveLink: (l) => [
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
b({ ...l }),
|
|
39
|
+
s("")
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
) }) : null
|
|
43
43
|
] });
|
|
44
44
|
}
|
|
45
|
-
function m({ links:
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
|
|
45
|
+
function m({ links: r, onActiveLink: t }) {
|
|
46
|
+
const s = [];
|
|
47
|
+
return r === null ? /* @__PURE__ */ e.jsx("p", { children: "Loading..." }) : r.length === 0 ? /* @__PURE__ */ e.jsx("p", { children: "No Results" }) : (r.forEach((i) => {
|
|
48
|
+
s.push(
|
|
49
49
|
// add key
|
|
50
50
|
/* @__PURE__ */ e.jsx(k, { children: /* @__PURE__ */ e.jsxs(
|
|
51
51
|
"span",
|
|
@@ -60,8 +60,8 @@ function m({ links: s, onActiveLink: t }) {
|
|
|
60
60
|
}
|
|
61
61
|
) }, i.id)
|
|
62
62
|
);
|
|
63
|
-
}),
|
|
63
|
+
}), s);
|
|
64
64
|
}
|
|
65
65
|
export {
|
|
66
|
-
g as
|
|
66
|
+
g as LinkPicker
|
|
67
67
|
};
|
package/dist/MediaPicker.d.ts
CHANGED
package/dist/MediaPicker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as l } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import { MediaUploadCheck as
|
|
3
|
-
import { PanelRow as b, Button as
|
|
2
|
+
import { MediaUploadCheck as n, MediaUpload as m } from "@wordpress/block-editor";
|
|
3
|
+
import { PanelRow as b, Button as a } from "@wordpress/components";
|
|
4
4
|
import { useState as j, useEffect as x } from "@wordpress/element";
|
|
5
5
|
import { __ as r } from "@wordpress/i18n";
|
|
6
|
-
function S({ mediaProps: d, mediaCallback:
|
|
7
|
-
const
|
|
6
|
+
function S({ mediaProps: d, mediaCallback: c }) {
|
|
7
|
+
const u = [
|
|
8
8
|
"image",
|
|
9
9
|
"video",
|
|
10
10
|
"image/svg+xml",
|
|
@@ -24,7 +24,7 @@ function S({ mediaProps: d, mediaCallback: u }) {
|
|
|
24
24
|
d && g({ ...d });
|
|
25
25
|
}, [d]);
|
|
26
26
|
const p = () => {
|
|
27
|
-
|
|
27
|
+
c({ ...{
|
|
28
28
|
mediaId: 0,
|
|
29
29
|
mediaUrl: ""
|
|
30
30
|
} });
|
|
@@ -47,17 +47,17 @@ function S({ mediaProps: d, mediaCallback: u }) {
|
|
|
47
47
|
width: e.width,
|
|
48
48
|
height: e.height
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
c({ ...f });
|
|
51
51
|
};
|
|
52
52
|
return /* @__PURE__ */ l.jsxs(b, { children: [
|
|
53
|
-
t.id !== null && /* @__PURE__ */ l.jsx(
|
|
53
|
+
t.id !== null && /* @__PURE__ */ l.jsx(n, { children: /* @__PURE__ */ l.jsx(
|
|
54
54
|
m,
|
|
55
55
|
{
|
|
56
56
|
onSelect: h,
|
|
57
57
|
value: t.id,
|
|
58
|
-
allowedTypes:
|
|
58
|
+
allowedTypes: u,
|
|
59
59
|
render: ({ open: e }) => /* @__PURE__ */ l.jsxs(
|
|
60
|
-
|
|
60
|
+
a,
|
|
61
61
|
{
|
|
62
62
|
className: t.id === 0 ? "editor-post-featured-image__toggle" : "editor-post-featured-image__preview",
|
|
63
63
|
onClick: e,
|
|
@@ -75,19 +75,19 @@ function S({ mediaProps: d, mediaCallback: u }) {
|
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
) }),
|
|
78
|
-
t.id !== 0 && /* @__PURE__ */ l.jsx(
|
|
78
|
+
t.id !== 0 && /* @__PURE__ */ l.jsx(n, { children: /* @__PURE__ */ l.jsx(
|
|
79
79
|
m,
|
|
80
80
|
{
|
|
81
81
|
title: r("Replace media", "blockbite"),
|
|
82
82
|
value: t.id,
|
|
83
83
|
onSelect: h,
|
|
84
|
-
allowedTypes:
|
|
85
|
-
render: ({ open: e }) => /* @__PURE__ */ l.jsx(
|
|
84
|
+
allowedTypes: u,
|
|
85
|
+
render: ({ open: e }) => /* @__PURE__ */ l.jsx(a, { onClick: e, children: r("Replace media", "blockbite") })
|
|
86
86
|
}
|
|
87
87
|
) }),
|
|
88
|
-
t.id !== 0 && /* @__PURE__ */ l.jsx(
|
|
88
|
+
t.id !== 0 && /* @__PURE__ */ l.jsx(n, { children: /* @__PURE__ */ l.jsx(a, { onClick: () => p(), isDestructive: !0, children: r("Remove media", "blockbite") }) })
|
|
89
89
|
] });
|
|
90
90
|
}
|
|
91
91
|
export {
|
|
92
|
-
S as
|
|
92
|
+
S as MediaPicker
|
|
93
93
|
};
|
package/dist/MetricsControl.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ type MetricsControlProps = {
|
|
|
6
6
|
onValueChange: (value: string) => void;
|
|
7
7
|
onUnitChange: (unit: string) => void;
|
|
8
8
|
};
|
|
9
|
-
declare const MetricsControl: React.FC<MetricsControlProps>;
|
|
9
|
+
export declare const MetricsControl: React.FC<MetricsControlProps>;
|
|
10
10
|
export default MetricsControl;
|