@raketa-builder/support 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminPageRender/AdminWidgetMinimal.js +1 -1
- package/dist/AdminPageRender/IconButton.js +1 -2
- package/dist/AdminPageRender/index.js +22 -5
- package/dist/Container.js +1 -2
- package/dist/EmbeddedVideo.js +8 -4
- package/dist/Image.js +2 -3
- package/dist/WidgetRender/index.js +1 -1
- package/dist/{chunk-ORMEWXMH.js → chunk-BBZEL7EG.js} +21 -1
- package/dist/extractImageValue.js +2 -2
- package/dist/imagePlaceholder.js +1 -1
- package/dist/imageSrc.js +1 -1
- package/dist/index.js +3 -1
- package/dist/isImagePresent.js +2 -2
- package/dist/lib/SelectedWidgetsButtons.js +92 -0
- package/dist/lib/SelectedWidgetsToolbar.js +72 -11
- package/dist/toHTML.js +12 -5
- package/package.json +7 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __spreadProps, __spreadValues, __objRest } from '../chunk-
|
|
1
|
+
import { __spreadProps, __spreadValues, __objRest } from '../chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import IconButton from './IconButton';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __spreadValues } from '../chunk-
|
|
1
|
+
import { __spreadValues } from '../chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
|
|
5
4
|
const ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
|
|
6
5
|
const IconButton = (props) => /* @__PURE__ */ jsx(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { __spreadProps, __spreadValues } from '../chunk-
|
|
1
|
+
import { __spreadProps, __spreadValues } from '../chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import AdminWidgetMinimal from './AdminWidgetMinimal';
|
|
5
5
|
import SelectedWidgetsToolbar from '../lib/SelectedWidgetsToolbar';
|
|
6
|
+
import { validateButtons } from '../lib/SelectedWidgetsButtons';
|
|
6
7
|
|
|
7
8
|
const saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
|
|
8
9
|
`clipboard\u2013${identifier}`,
|
|
@@ -18,8 +19,13 @@ const AdminPageRender = ({
|
|
|
18
19
|
detailPath,
|
|
19
20
|
canvasClassName = "",
|
|
20
21
|
layoutMessage = "",
|
|
21
|
-
wrapWidget = true
|
|
22
|
+
wrapWidget = true,
|
|
23
|
+
selectedWidgetsButtons = []
|
|
22
24
|
}) => {
|
|
25
|
+
React.useMemo(
|
|
26
|
+
() => validateButtons(selectedWidgetsButtons),
|
|
27
|
+
[selectedWidgetsButtons]
|
|
28
|
+
);
|
|
23
29
|
const [selectedWidgets, setSelectedWidgets] = React.useState([]);
|
|
24
30
|
const entity = __spreadProps(__spreadValues({}, page), {
|
|
25
31
|
widgets: page.widgets.map((w) => __spreadProps(__spreadValues({}, w), {
|
|
@@ -60,8 +66,11 @@ const AdminPageRender = ({
|
|
|
60
66
|
selectedWidgets.length > 0 && /* @__PURE__ */ jsx(
|
|
61
67
|
SelectedWidgetsToolbar,
|
|
62
68
|
{
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
selectedWidgets,
|
|
70
|
+
widgets: entity.widgets,
|
|
71
|
+
buttons: selectedWidgetsButtons,
|
|
72
|
+
onCopy: () => handleCopyWidgets(selectedWidgets, "multiple"),
|
|
73
|
+
onDeselect: () => setSelectedWidgets([])
|
|
65
74
|
}
|
|
66
75
|
),
|
|
67
76
|
entity.widgets.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -73,7 +82,15 @@ const AdminPageRender = ({
|
|
|
73
82
|
onClick: () => handleSelectAll()
|
|
74
83
|
}
|
|
75
84
|
),
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"a",
|
|
87
|
+
{
|
|
88
|
+
href: detailPath,
|
|
89
|
+
className: "r-reset r-details-link",
|
|
90
|
+
title: "Details",
|
|
91
|
+
"aria-label": "Details"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
77
94
|
/* @__PURE__ */ jsx("div", { className: canvasClassName, children: entity.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ jsx(
|
|
78
95
|
AdminWidgetMinimal,
|
|
79
96
|
{
|
package/dist/Container.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __objRest, __spreadProps, __spreadValues } from './chunk-
|
|
1
|
+
import { __objRest, __spreadProps, __spreadValues } from './chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
|
|
5
4
|
const Container = (_a) => {
|
|
6
5
|
var _b = _a, { settings, className, children } = _b, rest = __objRest(_b, ["settings", "className", "children"]);
|
package/dist/EmbeddedVideo.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
|
|
5
4
|
const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
6
5
|
"iframe",
|
|
7
6
|
{
|
|
7
|
+
title: `Vimeo embed video ${videoId2}`,
|
|
8
8
|
frameBorder: "0",
|
|
9
9
|
allowFullScreen: "0",
|
|
10
10
|
src: `https://player.vimeo.com/video/${videoId2}?color=ffffff&title=0&byline=0&portrait=0&autoplay=${autoplay === true ? "1" : "0"}`,
|
|
@@ -15,6 +15,7 @@ const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
|
15
15
|
const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
16
16
|
"iframe",
|
|
17
17
|
{
|
|
18
|
+
title: `Youku embed video ${videoId2}`,
|
|
18
19
|
height: "0",
|
|
19
20
|
width: "0",
|
|
20
21
|
src: `https://player.youku.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
@@ -27,6 +28,7 @@ const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
|
27
28
|
const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
28
29
|
"iframe",
|
|
29
30
|
{
|
|
31
|
+
title: `YouTube embed video ${videoId2}`,
|
|
30
32
|
frameBorder: "0",
|
|
31
33
|
allowFullScreen: true,
|
|
32
34
|
src: `https://youtube.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
@@ -37,6 +39,7 @@ const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
|
37
39
|
const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
38
40
|
"iframe",
|
|
39
41
|
{
|
|
42
|
+
title: `YouTube no cookie embed video ${videoId2}`,
|
|
40
43
|
frameBorder: "0",
|
|
41
44
|
allowFullScreen: true,
|
|
42
45
|
src: `https://www.youtube-nocookie.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
@@ -47,6 +50,7 @@ const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ *
|
|
|
47
50
|
const WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
|
|
48
51
|
"iframe",
|
|
49
52
|
{
|
|
53
|
+
title: `Wistia video ${videoId2}`,
|
|
50
54
|
frameBorder: "0",
|
|
51
55
|
allowFullScreen: true,
|
|
52
56
|
src: `https://fast.wistia.net/embed/iframe/${videoId2}${autoplay ? "?autoPlay=true" : ""}`,
|
|
@@ -63,9 +67,9 @@ const videoType = (url) => {
|
|
|
63
67
|
const youtubeId = (url) => {
|
|
64
68
|
var _a;
|
|
65
69
|
let matches = url.match(
|
|
66
|
-
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([
|
|
70
|
+
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^?&"'>]+)/
|
|
67
71
|
);
|
|
68
|
-
if (matches
|
|
72
|
+
if (matches == null ? void 0 : matches[5]) {
|
|
69
73
|
return matches[5];
|
|
70
74
|
}
|
|
71
75
|
matches = url.match(new RegExp("youtu\\.be\\/|youtube\\.com\\/shorts\\/(?<id>.*)(\\?.*)?"));
|
package/dist/Image.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __objRest, __spreadValues } from './chunk-
|
|
1
|
+
import { __objRest, __spreadValues } from './chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
|
|
5
4
|
const getWebp = (url) => {
|
|
6
5
|
if (!url) return null;
|
|
@@ -59,7 +58,7 @@ const getSrc = (src, variant, optimizedFormats) => {
|
|
|
59
58
|
};
|
|
60
59
|
const getImageObjOrSrc = (value) => {
|
|
61
60
|
const type = typeof value;
|
|
62
|
-
if (type === "object" &&
|
|
61
|
+
if (type === "object" && Object.hasOwn(value, "image")) {
|
|
63
62
|
return value.image;
|
|
64
63
|
}
|
|
65
64
|
return value;
|
|
@@ -29,5 +29,25 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
32
52
|
|
|
33
|
-
export { __objRest, __spreadProps, __spreadValues };
|
|
53
|
+
export { __async, __objRest, __spreadProps, __spreadValues };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-BBZEL7EG.js';
|
|
2
2
|
|
|
3
3
|
function extractImageValue(value) {
|
|
4
4
|
if (!value) {
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
return
|
|
7
|
+
return Object.hasOwn(value, "image") ? value.image : value;
|
|
8
8
|
}
|
|
9
9
|
var extractImageValue_default = extractImageValue;
|
|
10
10
|
|
package/dist/imagePlaceholder.js
CHANGED
package/dist/imageSrc.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-BBZEL7EG.js';
|
|
2
2
|
export { default as Image } from './Image';
|
|
3
3
|
export { default as imageSrc } from './imageSrc';
|
|
4
4
|
export { default as imagePlaceholder } from './imagePlaceholder';
|
|
@@ -9,3 +9,5 @@ export { default as isImagePresent } from './isImagePresent';
|
|
|
9
9
|
export { default as AdminPageRender } from './AdminPageRender';
|
|
10
10
|
export { default as WidgetRender } from './WidgetRender';
|
|
11
11
|
export { default as extractImageValue } from './extractImageValue';
|
|
12
|
+
export { default as SelectedWidgetsButtons, validateButtons } from './lib/SelectedWidgetsButtons';
|
|
13
|
+
export { default as SelectedWidgetsToolbar } from './lib/SelectedWidgetsToolbar';
|
package/dist/isImagePresent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-BBZEL7EG.js';
|
|
2
2
|
|
|
3
3
|
const isEmptyObject = (value) => typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
4
4
|
function isImagePresent(value) {
|
|
@@ -11,7 +11,7 @@ function isImagePresent(value) {
|
|
|
11
11
|
if (isEmptyObject(value)) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
14
|
+
if (Object.hasOwn(value, "image")) {
|
|
15
15
|
return !!value.image && !isEmptyObject(value.image);
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __async } from '../chunk-BBZEL7EG.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
const COUNT_PLACEHOLDER = /\{\{SELECTED_WIDGETS_COUNT\}\}/g;
|
|
6
|
+
const formatLabel = (label, count) => typeof label === "string" ? label.replace(COUNT_PLACEHOLDER, String(count)) : label;
|
|
7
|
+
const renderIcon = (icon) => {
|
|
8
|
+
if (icon === void 0 || icon === null) return null;
|
|
9
|
+
if (React.isValidElement(icon)) return icon;
|
|
10
|
+
if (typeof icon === "string") return /* @__PURE__ */ jsx("img", { src: icon, alt: "" });
|
|
11
|
+
throw new Error(
|
|
12
|
+
"Selected widgets button `icon` must be a React element or an image URL string"
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
const validateButton = (button) => {
|
|
16
|
+
if (!button || typeof button !== "object") {
|
|
17
|
+
throw new Error("Selected widgets button must be an object");
|
|
18
|
+
}
|
|
19
|
+
if (typeof button.id !== "string" || button.id === "") {
|
|
20
|
+
throw new Error("Selected widgets button requires a non-empty string `id`");
|
|
21
|
+
}
|
|
22
|
+
if (typeof button.onClick !== "function") {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`Selected widgets button "${button.id}" requires an \`onClick\` function`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
if (button.onError !== void 0 && typeof button.onError !== "function") {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Selected widgets button "${button.id}" \`onError\` must be a function`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const validateButtons = (buttons) => {
|
|
34
|
+
if (!Array.isArray(buttons)) {
|
|
35
|
+
throw new Error("`selectedWidgetsButtons` must be an array");
|
|
36
|
+
}
|
|
37
|
+
buttons.forEach(validateButton);
|
|
38
|
+
return buttons;
|
|
39
|
+
};
|
|
40
|
+
const joinClassNames = (...classNames) => classNames.filter(Boolean).join(" ");
|
|
41
|
+
const SelectedWidgetsButtons = ({
|
|
42
|
+
buttons = [],
|
|
43
|
+
selectedWidgets = [],
|
|
44
|
+
widgets = [],
|
|
45
|
+
buttonClassName,
|
|
46
|
+
showIcons = true,
|
|
47
|
+
onDeselect
|
|
48
|
+
}) => {
|
|
49
|
+
React.useMemo(() => validateButtons(buttons), [buttons]);
|
|
50
|
+
const [pendingId, setPendingId] = React.useState(null);
|
|
51
|
+
const latestSelectedWidgets = React.useRef(selectedWidgets);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
latestSelectedWidgets.current = selectedWidgets;
|
|
54
|
+
});
|
|
55
|
+
const count = selectedWidgets.length;
|
|
56
|
+
const handleClick = (button) => __async(null, null, function* () {
|
|
57
|
+
const snapshot = [...selectedWidgets];
|
|
58
|
+
const selected = widgets.filter((w) => snapshot.includes(w.widgetId));
|
|
59
|
+
setPendingId(button.id);
|
|
60
|
+
try {
|
|
61
|
+
yield button.onClick(selected);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (button.onError) {
|
|
64
|
+
button.onError(error, selected);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
} finally {
|
|
69
|
+
setPendingId(null);
|
|
70
|
+
}
|
|
71
|
+
const current = latestSelectedWidgets.current;
|
|
72
|
+
const unchanged = current.length === snapshot.length && snapshot.every((id) => current.includes(id));
|
|
73
|
+
if (onDeselect && unchanged) onDeselect();
|
|
74
|
+
});
|
|
75
|
+
return buttons.map((button) => /* @__PURE__ */ jsxs(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
className: joinClassNames(buttonClassName, button.className),
|
|
80
|
+
disabled: pendingId !== null,
|
|
81
|
+
onClick: () => handleClick(button),
|
|
82
|
+
children: [
|
|
83
|
+
showIcons && renderIcon(button.icon),
|
|
84
|
+
formatLabel(button.label, count)
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
button.id
|
|
88
|
+
));
|
|
89
|
+
};
|
|
90
|
+
var SelectedWidgetsButtons_default = SelectedWidgetsButtons;
|
|
91
|
+
|
|
92
|
+
export { SelectedWidgetsButtons_default as default, formatLabel, renderIcon, validateButtons };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import '../chunk-
|
|
1
|
+
import '../chunk-BBZEL7EG.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import SelectedWidgetsButtons from './SelectedWidgetsButtons';
|
|
3
4
|
|
|
4
5
|
const IconCopy = () => /* @__PURE__ */ jsxs(
|
|
5
6
|
"svg",
|
|
6
7
|
{
|
|
8
|
+
"aria-hidden": "true",
|
|
7
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8
10
|
width: "16",
|
|
9
11
|
height: "16",
|
|
@@ -36,20 +38,79 @@ const IconCopy = () => /* @__PURE__ */ jsxs(
|
|
|
36
38
|
]
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
|
-
const
|
|
40
|
-
"
|
|
41
|
+
const IconDelete = () => /* @__PURE__ */ jsxs(
|
|
42
|
+
"svg",
|
|
41
43
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
width: "16",
|
|
47
|
+
height: "16",
|
|
48
|
+
viewBox: "0 0 16 16",
|
|
49
|
+
fill: "none",
|
|
45
50
|
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"path",
|
|
53
|
+
{
|
|
54
|
+
d: "M2 4H14",
|
|
55
|
+
stroke: "white",
|
|
56
|
+
strokeWidth: "2",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"path",
|
|
63
|
+
{
|
|
64
|
+
d: "M12.6667 4V13.3333C12.6667 14 12 14.6667 11.3334 14.6667H4.66671C4.00004 14.6667 3.33337 14 3.33337 13.3333V4",
|
|
65
|
+
stroke: "white",
|
|
66
|
+
strokeWidth: "2",
|
|
67
|
+
strokeLinecap: "round",
|
|
68
|
+
strokeLinejoin: "round"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
"path",
|
|
73
|
+
{
|
|
74
|
+
d: "M5.33337 3.99998V2.66665C5.33337 1.99998 6.00004 1.33331 6.66671 1.33331H9.33337C10 1.33331 10.6667 1.99998 10.6667 2.66665V3.99998",
|
|
75
|
+
stroke: "white",
|
|
76
|
+
strokeWidth: "2",
|
|
77
|
+
strokeLinecap: "round",
|
|
78
|
+
strokeLinejoin: "round"
|
|
79
|
+
}
|
|
80
|
+
)
|
|
50
81
|
]
|
|
51
82
|
}
|
|
52
|
-
)
|
|
83
|
+
);
|
|
84
|
+
const BUTTON_CLASS_NAME = "r-button-reset r-toolbar-button";
|
|
85
|
+
const SelectedWidgetsToolbar = ({
|
|
86
|
+
selectedWidgets = [],
|
|
87
|
+
widgets = [],
|
|
88
|
+
buttons = [],
|
|
89
|
+
onCopy,
|
|
90
|
+
onRemove,
|
|
91
|
+
onDeselect
|
|
92
|
+
}) => /* @__PURE__ */ jsx("div", { className: "r-selected-widgets-toolbar", children: /* @__PURE__ */ jsxs("div", { className: "r-toolbar-inner", children: [
|
|
93
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: BUTTON_CLASS_NAME, onClick: onCopy, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(IconCopy, {}),
|
|
95
|
+
"Copy selected (",
|
|
96
|
+
selectedWidgets.length,
|
|
97
|
+
")"
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
SelectedWidgetsButtons,
|
|
101
|
+
{
|
|
102
|
+
buttons,
|
|
103
|
+
selectedWidgets,
|
|
104
|
+
widgets,
|
|
105
|
+
buttonClassName: BUTTON_CLASS_NAME,
|
|
106
|
+
onDeselect
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
onRemove && /* @__PURE__ */ jsxs("button", { type: "button", className: BUTTON_CLASS_NAME, onClick: onRemove, children: [
|
|
110
|
+
/* @__PURE__ */ jsx(IconDelete, {}),
|
|
111
|
+
"Delete selected"
|
|
112
|
+
] })
|
|
113
|
+
] }) });
|
|
53
114
|
var SelectedWidgetsToolbar_default = SelectedWidgetsToolbar;
|
|
54
115
|
|
|
55
116
|
export { SelectedWidgetsToolbar_default as default };
|
package/dist/toHTML.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-BBZEL7EG.js';
|
|
2
2
|
import { Marked } from 'marked';
|
|
3
3
|
import parseAttrs from 'attributes-parser';
|
|
4
4
|
|
|
@@ -20,14 +20,14 @@ const attributes = {
|
|
|
20
20
|
type: "attributes",
|
|
21
21
|
raw: match[0]
|
|
22
22
|
};
|
|
23
|
-
} catch (
|
|
23
|
+
} catch (_error) {
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
},
|
|
30
|
-
renderer(
|
|
30
|
+
renderer(_token) {
|
|
31
31
|
return "";
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -67,11 +67,18 @@ function addNewTabAttrs(match, href, rest) {
|
|
|
67
67
|
}
|
|
68
68
|
const toHTML = (string, options = {}) => {
|
|
69
69
|
if (!string) return "";
|
|
70
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
inline = false,
|
|
72
|
+
externalLinksNewTab = true,
|
|
73
|
+
internalDomains = []
|
|
74
|
+
} = options;
|
|
71
75
|
try {
|
|
72
76
|
const html = inline ? markedInstance.parseInline(string) : markedInstance.parse(string);
|
|
73
77
|
if (!externalLinksNewTab) return html;
|
|
74
|
-
return html.replace(
|
|
78
|
+
return html.replace(
|
|
79
|
+
buildExternalLinkRegex(internalDomains),
|
|
80
|
+
addNewTabAttrs
|
|
81
|
+
);
|
|
75
82
|
} catch (error) {
|
|
76
83
|
console.error("Parse error:", error);
|
|
77
84
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/support",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "./dist/index.js",
|
|
5
6
|
"module": "./dist/index.mjs",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": {
|
|
11
|
-
"types": "./dist/index.d.
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"default": "./dist/index.js"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
@@ -26,8 +27,10 @@
|
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsup",
|
|
28
29
|
"dev": "tsup --watch",
|
|
29
|
-
"format": "prettier --write .",
|
|
30
|
-
"
|
|
30
|
+
"format": "prettier --ignore-path ../../.prettierignore --write .",
|
|
31
|
+
"format:check": "prettier --ignore-path ../../.prettierignore --check .",
|
|
32
|
+
"lint": "biome lint --write --max-diagnostics=5000 .",
|
|
33
|
+
"lint:check": "biome lint --max-diagnostics=5000 ."
|
|
31
34
|
},
|
|
32
35
|
"peerDependencies": {
|
|
33
36
|
"react": ">=19.1.0 && <=19.3.0",
|