@raketa-builder/support 1.3.13 → 1.3.14
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 -28
- package/dist/AdminPageRender/IconButton.js +1 -16
- package/dist/AdminPageRender/index.js +1 -19
- package/dist/Container.js +1 -31
- package/dist/EmbeddedVideo.js +1 -0
- package/dist/Image.js +1 -28
- package/dist/WidgetRender/index.js +1 -19
- package/dist/{Container.cjs → chunk-ORMEWXMH.js} +1 -13
- package/dist/extractImageValue.js +2 -0
- package/dist/imagePlaceholder.js +2 -0
- package/dist/imageSrc.js +2 -0
- package/dist/index.js +1 -0
- package/dist/isImagePresent.js +2 -0
- package/dist/lib/SelectedWidgetsToolbar.js +1 -0
- package/dist/toHTML.js +4 -1
- package/package.json +1 -1
- package/dist/AdminPageRender/AdminWidgetMinimal.cjs +0 -118
- package/dist/AdminPageRender/IconButton.cjs +0 -49
- package/dist/AdminPageRender/index.cjs +0 -118
- package/dist/EmbeddedVideo.cjs +0 -131
- package/dist/Image.cjs +0 -132
- package/dist/WidgetRender/index.cjs +0 -67
- package/dist/extractImageValue.cjs +0 -11
- package/dist/imagePlaceholder.cjs +0 -8
- package/dist/imageSrc.cjs +0 -14
- package/dist/index.cjs +0 -68
- package/dist/isImagePresent.cjs +0 -17
- package/dist/lib/SelectedWidgetsToolbar.cjs +0 -56
- package/dist/toHTML.cjs +0 -27
|
@@ -1,36 +1,9 @@
|
|
|
1
|
+
import { __objRest, __spreadValues } from '../chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import IconButton from './IconButton';
|
|
4
5
|
import Container from '../Container';
|
|
5
6
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
7
|
function cn() {
|
|
35
8
|
return Array.from(arguments).filter(Boolean).map(String).join(" ");
|
|
36
9
|
}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
+
import { __spreadValues } from '../chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import 'react';
|
|
3
4
|
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
5
|
const ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
|
|
21
6
|
const IconButton = (props) => /* @__PURE__ */ jsx(
|
|
22
7
|
"button",
|
|
@@ -1,27 +1,9 @@
|
|
|
1
|
+
import { __spreadProps, __spreadValues } from '../chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import AdminWidgetMinimal from './AdminWidgetMinimal';
|
|
4
5
|
import SelectedWidgetsToolbar from '../lib/SelectedWidgetsToolbar';
|
|
5
6
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defProps = Object.defineProperties;
|
|
8
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
7
|
const saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
|
|
26
8
|
`clipboard\u2013${identifier}`,
|
|
27
9
|
JSON.stringify(widgets)
|
package/dist/Container.js
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
|
+
import { __objRest, __spreadProps, __spreadValues } from './chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import 'react';
|
|
3
4
|
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defProps = Object.defineProperties;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
var __objRest = (source, exclude) => {
|
|
24
|
-
var target = {};
|
|
25
|
-
for (var prop in source)
|
|
26
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
-
target[prop] = source[prop];
|
|
28
|
-
if (source != null && __getOwnPropSymbols)
|
|
29
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
-
target[prop] = source[prop];
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
5
|
const Container = (_a) => {
|
|
36
6
|
var _b = _a, { settings, className, children } = _b, rest = __objRest(_b, ["settings", "className", "children"]);
|
|
37
7
|
const _a2 = settings || {}, { containerID } = _a2, restSettings = __objRest(_a2, ["containerID"]);
|
package/dist/EmbeddedVideo.js
CHANGED
package/dist/Image.js
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
+
import { __objRest, __spreadValues } from './chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import 'react';
|
|
3
4
|
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
5
|
const getWebp = (url) => {
|
|
33
6
|
if (!url) return null;
|
|
34
7
|
const segments = url.split(".");
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
+
import { __spreadProps, __spreadValues } from '../chunk-ORMEWXMH.js';
|
|
1
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import Container from '../Container';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defProps = Object.defineProperties;
|
|
7
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
6
|
const WidgetRender = ({
|
|
25
7
|
library,
|
|
26
8
|
entity,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
require('react');
|
|
5
|
-
|
|
6
1
|
var __defProp = Object.defineProperty;
|
|
7
2
|
var __defProps = Object.defineProperties;
|
|
8
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -34,12 +29,5 @@ var __objRest = (source, exclude) => {
|
|
|
34
29
|
}
|
|
35
30
|
return target;
|
|
36
31
|
};
|
|
37
|
-
const Container = (_a) => {
|
|
38
|
-
var _b = _a, { settings, className, children } = _b, rest = __objRest(_b, ["settings", "className", "children"]);
|
|
39
|
-
const _a2 = settings || {}, { containerID } = _a2, restSettings = __objRest(_a2, ["containerID"]);
|
|
40
|
-
const cssClasses = [...Object.values(restSettings), className].join(" ");
|
|
41
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ id: containerID, className: cssClasses }, rest), { children }));
|
|
42
|
-
};
|
|
43
|
-
var Container_default = Container;
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
export { __objRest, __spreadProps, __spreadValues };
|
package/dist/imagePlaceholder.js
CHANGED
package/dist/imageSrc.js
CHANGED
package/dist/index.js
CHANGED
package/dist/isImagePresent.js
CHANGED
package/dist/toHTML.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './chunk-ORMEWXMH.js';
|
|
2
|
+
import MarkdownItCjs from 'markdown-it/dist/index.cjs.js';
|
|
2
3
|
import markdownItAttrs from 'markdown-it-attrs';
|
|
3
4
|
|
|
5
|
+
var _a;
|
|
6
|
+
const MarkdownIt = (_a = MarkdownItCjs.default) != null ? _a : MarkdownItCjs;
|
|
4
7
|
const parser = new MarkdownIt({
|
|
5
8
|
html: true,
|
|
6
9
|
breaks: true
|
package/package.json
CHANGED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var IconButton = require('./IconButton');
|
|
6
|
-
var Container = require('../Container');
|
|
7
|
-
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
-
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
12
|
-
var Container__default = /*#__PURE__*/_interopDefault(Container);
|
|
13
|
-
|
|
14
|
-
var __defProp = Object.defineProperty;
|
|
15
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
16
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
18
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
-
var __spreadValues = (a, b) => {
|
|
20
|
-
for (var prop in b || (b = {}))
|
|
21
|
-
if (__hasOwnProp.call(b, prop))
|
|
22
|
-
__defNormalProp(a, prop, b[prop]);
|
|
23
|
-
if (__getOwnPropSymbols)
|
|
24
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
25
|
-
if (__propIsEnum.call(b, prop))
|
|
26
|
-
__defNormalProp(a, prop, b[prop]);
|
|
27
|
-
}
|
|
28
|
-
return a;
|
|
29
|
-
};
|
|
30
|
-
var __objRest = (source, exclude) => {
|
|
31
|
-
var target = {};
|
|
32
|
-
for (var prop in source)
|
|
33
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
if (source != null && __getOwnPropSymbols)
|
|
36
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
37
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
38
|
-
target[prop] = source[prop];
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
};
|
|
42
|
-
function cn() {
|
|
43
|
-
return Array.from(arguments).filter(Boolean).map(String).join(" ");
|
|
44
|
-
}
|
|
45
|
-
const AdminWidgetWrapper = (_a) => {
|
|
46
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
47
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("r-admin-widget-wrapper", className) }, rest));
|
|
48
|
-
};
|
|
49
|
-
const AdminWidgetToolbar = (_c) => {
|
|
50
|
-
var _d = _c, { className } = _d, rest = __objRest(_d, ["className"]);
|
|
51
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
-
"div",
|
|
53
|
-
__spreadValues({
|
|
54
|
-
className: cn("r-reset", "r-admin-widget-toolbar", className)
|
|
55
|
-
}, rest)
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
const AdminWidgetLabel = (_e) => {
|
|
59
|
-
var _f = _e, { className } = _f, rest = __objRest(_f, ["className"]);
|
|
60
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
-
"div",
|
|
62
|
-
__spreadValues({
|
|
63
|
-
className: cn("r-reset", "r-fs-small", "r-admin-widget-label", className)
|
|
64
|
-
}, rest)
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
const title = (widget) => {
|
|
68
|
-
return widget.Config.title;
|
|
69
|
-
};
|
|
70
|
-
const deprecated = (widget) => {
|
|
71
|
-
return widget.Config.deprecated;
|
|
72
|
-
};
|
|
73
|
-
const AdminWidgetMinimal = ({
|
|
74
|
-
library,
|
|
75
|
-
adminLibrary,
|
|
76
|
-
widget,
|
|
77
|
-
onCopy,
|
|
78
|
-
onSelectWidget,
|
|
79
|
-
selectedWidgets
|
|
80
|
-
}) => {
|
|
81
|
-
var _a;
|
|
82
|
-
const currentWidget = library[widget.component];
|
|
83
|
-
const currentAdminWidget = adminLibrary[widget.component];
|
|
84
|
-
const containerSettings = ((_a = widget == null ? void 0 : widget.settings) == null ? void 0 : _a.containerSettings) || {};
|
|
85
|
-
const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
|
|
86
|
-
if (!currentWidget || !currentAdminWidget) {
|
|
87
|
-
console.error(`Unknown widget: ${widget.component}`);
|
|
88
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AdminWidgetWrapper, { "data-widget": widget.component, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("r-reset", "r-fs-large", "r-admin-missing-widget"), children: `Unknown widget: ${widget.component}` }) });
|
|
89
|
-
}
|
|
90
|
-
const handleCopyWidget = () => {
|
|
91
|
-
const widgetsToCopy = [widget];
|
|
92
|
-
onCopy(widgetsToCopy);
|
|
93
|
-
};
|
|
94
|
-
const handleSelectWidget = () => onSelectWidget(widget.widgetId);
|
|
95
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(AdminWidgetWrapper, { "data-widget": widget.component, children: [
|
|
96
|
-
isSelected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "r-selected-widget" }),
|
|
97
|
-
/* @__PURE__ */ jsxRuntime.jsxs(AdminWidgetToolbar, { "data-toolbar": true, children: [
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
-
"input",
|
|
100
|
-
{
|
|
101
|
-
type: "checkbox",
|
|
102
|
-
style: {
|
|
103
|
-
width: "32px",
|
|
104
|
-
height: "32px"
|
|
105
|
-
},
|
|
106
|
-
onChange: handleSelectWidget,
|
|
107
|
-
checked: isSelected
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
!isSelected && !deprecated(currentAdminWidget) && /* @__PURE__ */ jsxRuntime.jsx(IconButton__default.default, { onClick: handleCopyWidget })
|
|
111
|
-
] }),
|
|
112
|
-
/* @__PURE__ */ jsxRuntime.jsx(AdminWidgetLabel, { "data-widget-label": true, children: title(currentAdminWidget) }),
|
|
113
|
-
/* @__PURE__ */ jsxRuntime.jsx(Container__default.default, { settings: containerSettings, children: React__default.default.createElement(currentWidget, widget.settings) })
|
|
114
|
-
] });
|
|
115
|
-
};
|
|
116
|
-
var AdminWidgetMinimal_default = AdminWidgetMinimal;
|
|
117
|
-
|
|
118
|
-
module.exports = AdminWidgetMinimal_default;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
require('react');
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
const ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
|
|
23
|
-
const IconButton = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
-
"button",
|
|
25
|
-
__spreadValues({
|
|
26
|
-
type: "button",
|
|
27
|
-
style: {
|
|
28
|
-
display: "inline-block",
|
|
29
|
-
width: "32px",
|
|
30
|
-
height: "32px",
|
|
31
|
-
marginRight: "4px",
|
|
32
|
-
marginLeft: "0px",
|
|
33
|
-
appearance: "none",
|
|
34
|
-
outline: "0",
|
|
35
|
-
border: "0",
|
|
36
|
-
borderRadius: "3px",
|
|
37
|
-
background: "transparent",
|
|
38
|
-
backgroundColor: "#fff",
|
|
39
|
-
backgroundRepeat: "no-repeat",
|
|
40
|
-
backgroundPosition: "center",
|
|
41
|
-
backgroundSize: "50%",
|
|
42
|
-
backgroundImage: `url(${ICON_COPY})`,
|
|
43
|
-
cursor: "pointer"
|
|
44
|
-
}
|
|
45
|
-
}, props)
|
|
46
|
-
);
|
|
47
|
-
var IconButton_default = IconButton;
|
|
48
|
-
|
|
49
|
-
module.exports = IconButton_default;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var AdminWidgetMinimal = require('./AdminWidgetMinimal');
|
|
6
|
-
var SelectedWidgetsToolbar = require('../lib/SelectedWidgetsToolbar');
|
|
7
|
-
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
-
var AdminWidgetMinimal__default = /*#__PURE__*/_interopDefault(AdminWidgetMinimal);
|
|
12
|
-
var SelectedWidgetsToolbar__default = /*#__PURE__*/_interopDefault(SelectedWidgetsToolbar);
|
|
13
|
-
|
|
14
|
-
var __defProp = Object.defineProperty;
|
|
15
|
-
var __defProps = Object.defineProperties;
|
|
16
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
17
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
18
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
19
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
20
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21
|
-
var __spreadValues = (a, b) => {
|
|
22
|
-
for (var prop in b || (b = {}))
|
|
23
|
-
if (__hasOwnProp.call(b, prop))
|
|
24
|
-
__defNormalProp(a, prop, b[prop]);
|
|
25
|
-
if (__getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
27
|
-
if (__propIsEnum.call(b, prop))
|
|
28
|
-
__defNormalProp(a, prop, b[prop]);
|
|
29
|
-
}
|
|
30
|
-
return a;
|
|
31
|
-
};
|
|
32
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
33
|
-
const saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
|
|
34
|
-
`clipboard\u2013${identifier}`,
|
|
35
|
-
JSON.stringify(widgets)
|
|
36
|
-
);
|
|
37
|
-
const AdminPageRender = ({
|
|
38
|
-
page,
|
|
39
|
-
context = {},
|
|
40
|
-
preloaded = {},
|
|
41
|
-
library,
|
|
42
|
-
adminLibrary,
|
|
43
|
-
identifier,
|
|
44
|
-
detailPath,
|
|
45
|
-
canvasClassName = "",
|
|
46
|
-
layoutMessage = ""
|
|
47
|
-
}) => {
|
|
48
|
-
const [selectedWidgets, setSelectedWidgets] = React__default.default.useState([]);
|
|
49
|
-
const entity = __spreadProps(__spreadValues({}, page), {
|
|
50
|
-
widgets: page.widgets.map((w) => __spreadProps(__spreadValues({}, w), {
|
|
51
|
-
settings: __spreadProps(__spreadValues({}, w.settings), {
|
|
52
|
-
__ctx: context,
|
|
53
|
-
__data: preloaded[w.widgetId]
|
|
54
|
-
})
|
|
55
|
-
}))
|
|
56
|
-
});
|
|
57
|
-
const areAllSelected = selectedWidgets.length === entity.widgets.length;
|
|
58
|
-
const handleSelectWidget = (newWidget) => {
|
|
59
|
-
setSelectedWidgets((oldList) => {
|
|
60
|
-
const isUnique = oldList.filter((w) => w === newWidget).length <= 0;
|
|
61
|
-
if (isUnique) {
|
|
62
|
-
return [...oldList, newWidget];
|
|
63
|
-
} else {
|
|
64
|
-
return oldList.filter((w) => w !== newWidget);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
const handleCopyWidgets = (widgets, copyType) => {
|
|
69
|
-
if (copyType === "multiple") {
|
|
70
|
-
const filterSelected = entity.widgets.filter(
|
|
71
|
-
(w) => widgets.some((c) => w.widgetId === c)
|
|
72
|
-
);
|
|
73
|
-
saveToLocalStorage(identifier, filterSelected);
|
|
74
|
-
setSelectedWidgets([]);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
saveToLocalStorage(identifier, widgets);
|
|
78
|
-
};
|
|
79
|
-
const handleSelectAll = () => {
|
|
80
|
-
if (areAllSelected) return setSelectedWidgets([]);
|
|
81
|
-
setSelectedWidgets(entity.widgets.map((w) => w.widgetId));
|
|
82
|
-
};
|
|
83
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(React__default.default.Fragment, { children: [
|
|
84
|
-
layoutMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "r-reset r-fs-base r-layout-message", children: layoutMessage }),
|
|
85
|
-
selectedWidgets.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
SelectedWidgetsToolbar__default.default,
|
|
87
|
-
{
|
|
88
|
-
length: selectedWidgets.length,
|
|
89
|
-
onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
entity.widgets.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
|
|
96
|
-
type: "button",
|
|
97
|
-
title: "Select all (or Deselect all)",
|
|
98
|
-
onClick: () => handleSelectAll()
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: canvasClassName, children: entity.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
AdminWidgetMinimal__default.default,
|
|
104
|
-
{
|
|
105
|
-
library,
|
|
106
|
-
adminLibrary,
|
|
107
|
-
widget: { widgetId, component, settings },
|
|
108
|
-
onCopy: handleCopyWidgets,
|
|
109
|
-
onSelectWidget: handleSelectWidget,
|
|
110
|
-
selectedWidgets
|
|
111
|
-
},
|
|
112
|
-
widgetId
|
|
113
|
-
)) })
|
|
114
|
-
] });
|
|
115
|
-
};
|
|
116
|
-
var AdminPageRender_default = AdminPageRender;
|
|
117
|
-
|
|
118
|
-
module.exports = AdminPageRender_default;
|
package/dist/EmbeddedVideo.cjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
require('react');
|
|
5
|
-
|
|
6
|
-
const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7
|
-
"iframe",
|
|
8
|
-
{
|
|
9
|
-
frameBorder: "0",
|
|
10
|
-
allowFullScreen: "0",
|
|
11
|
-
src: `https://player.vimeo.com/video/${videoId2}?color=ffffff&title=0&byline=0&portrait=0&autoplay=${autoplay === true ? "1" : "0"}`,
|
|
12
|
-
className: "content",
|
|
13
|
-
allow: "autoplay"
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
-
"iframe",
|
|
18
|
-
{
|
|
19
|
-
height: "0",
|
|
20
|
-
width: "0",
|
|
21
|
-
src: `https://player.youku.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
22
|
-
frameBorder: "0",
|
|
23
|
-
allowFullScreen: true,
|
|
24
|
-
className: "content",
|
|
25
|
-
allow: "autoplay"
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
-
"iframe",
|
|
30
|
-
{
|
|
31
|
-
frameBorder: "0",
|
|
32
|
-
allowFullScreen: true,
|
|
33
|
-
src: `https://youtube.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
34
|
-
className: "content",
|
|
35
|
-
allow: "autoplay"
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
-
"iframe",
|
|
40
|
-
{
|
|
41
|
-
frameBorder: "0",
|
|
42
|
-
allowFullScreen: true,
|
|
43
|
-
src: `https://www.youtube-nocookie.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
|
|
44
|
-
className: "content",
|
|
45
|
-
allow: "autoplay"
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
const WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
-
"iframe",
|
|
50
|
-
{
|
|
51
|
-
frameBorder: "0",
|
|
52
|
-
allowFullScreen: true,
|
|
53
|
-
src: `https://fast.wistia.net/embed/iframe/${videoId2}${autoplay ? "?autoPlay=true" : ""}`,
|
|
54
|
-
className: "content",
|
|
55
|
-
allow: "autoplay"
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
const videoType = (url) => {
|
|
59
|
-
if (url.includes("youtu")) return "youtube";
|
|
60
|
-
if (url.includes("vimeo")) return "vimeo";
|
|
61
|
-
if (url.includes("youku")) return "youku";
|
|
62
|
-
if (url.includes("wistia")) return "wistia";
|
|
63
|
-
};
|
|
64
|
-
const youtubeId = (url) => {
|
|
65
|
-
var _a;
|
|
66
|
-
let matches = url.match(
|
|
67
|
-
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
|
|
68
|
-
);
|
|
69
|
-
if (matches && matches[5]) {
|
|
70
|
-
return matches[5];
|
|
71
|
-
}
|
|
72
|
-
matches = url.match(new RegExp("youtu\\.be\\/|youtube\\.com\\/shorts\\/(?<id>.*)(\\?.*)?"));
|
|
73
|
-
return ((_a = matches == null ? void 0 : matches.groups) == null ? void 0 : _a.id) || "";
|
|
74
|
-
};
|
|
75
|
-
const vimeoId = (url) => {
|
|
76
|
-
const matches = url.match(/http(s?):\/\/(www\.)?vimeo\.com\/(\d+)($|\/)/);
|
|
77
|
-
return matches !== "" && matches !== null ? matches[3] : "";
|
|
78
|
-
};
|
|
79
|
-
const youkuId = (url) => {
|
|
80
|
-
const matches = url.match(
|
|
81
|
-
/http(s?):\/\/v\.youku\.com\/v_show\/id_([A-Za-z0-9=]+)\.html/
|
|
82
|
-
);
|
|
83
|
-
return matches !== "" && matches !== null ? matches[2] : "";
|
|
84
|
-
};
|
|
85
|
-
const wistiaId = (url) => {
|
|
86
|
-
const matches = url.match(
|
|
87
|
-
/http(s?):\/\/fast\.wistia\.net\/embed\/iframe\/(.*)($|\?)/
|
|
88
|
-
);
|
|
89
|
-
return matches !== "" && matches !== null ? matches[2] : "";
|
|
90
|
-
};
|
|
91
|
-
const videoId = (url) => {
|
|
92
|
-
if (videoType(url) === "youtube") return youtubeId(url);
|
|
93
|
-
if (videoType(url) === "vimeo") return vimeoId(url);
|
|
94
|
-
if (videoType(url) === "youku") return youkuId(url);
|
|
95
|
-
if (videoType(url) === "wistia") return wistiaId(url);
|
|
96
|
-
};
|
|
97
|
-
const VideoComponentType = (vType, noCookieDomains) => {
|
|
98
|
-
const components = {
|
|
99
|
-
youtube: YouTubeEmbed,
|
|
100
|
-
vimeo: VimeoEmbed,
|
|
101
|
-
youku: YoukuEmbed,
|
|
102
|
-
wistia: WistiaEmbed
|
|
103
|
-
};
|
|
104
|
-
const noCookiesComponents = {
|
|
105
|
-
youtube: YouTubeNoCookieEmbed,
|
|
106
|
-
vimeo: VimeoEmbed,
|
|
107
|
-
youku: YoukuEmbed,
|
|
108
|
-
wistia: WistiaEmbed
|
|
109
|
-
};
|
|
110
|
-
if (noCookieDomains) {
|
|
111
|
-
return noCookiesComponents[vType];
|
|
112
|
-
} else {
|
|
113
|
-
return components[vType];
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const EmbeddedVideo = ({
|
|
117
|
-
videoUrl,
|
|
118
|
-
autoplay = false,
|
|
119
|
-
noCookieDomains = false
|
|
120
|
-
}) => {
|
|
121
|
-
const vType = videoType(videoUrl);
|
|
122
|
-
const vId = videoId(videoUrl);
|
|
123
|
-
const VideoComponent = VideoComponentType(vType, noCookieDomains);
|
|
124
|
-
if (VideoComponent) {
|
|
125
|
-
return /* @__PURE__ */ jsxRuntime.jsx(VideoComponent, { videoId: vId, autoplay });
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
};
|
|
129
|
-
var EmbeddedVideo_default = EmbeddedVideo;
|
|
130
|
-
|
|
131
|
-
module.exports = EmbeddedVideo_default;
|
package/dist/Image.cjs
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
require('react');
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
|
-
const getWebp = (url) => {
|
|
35
|
-
if (!url) return null;
|
|
36
|
-
const segments = url.split(".");
|
|
37
|
-
segments[segments.length - 1] = "webp";
|
|
38
|
-
return segments.join(".");
|
|
39
|
-
};
|
|
40
|
-
const getAvif = (url) => {
|
|
41
|
-
if (!url) return null;
|
|
42
|
-
const segments = url.split(".");
|
|
43
|
-
segments[segments.length - 1] = "avif";
|
|
44
|
-
return segments.join(".");
|
|
45
|
-
};
|
|
46
|
-
const getDimensions = (src, variant) => {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
|
|
49
|
-
const width = src.width || null;
|
|
50
|
-
const height = src.height || null;
|
|
51
|
-
return [width, height];
|
|
52
|
-
}
|
|
53
|
-
if (typeof src === "object") {
|
|
54
|
-
const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || null;
|
|
55
|
-
const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || null;
|
|
56
|
-
return [width, height];
|
|
57
|
-
}
|
|
58
|
-
return [null, null];
|
|
59
|
-
};
|
|
60
|
-
const getAlt = (src) => {
|
|
61
|
-
const type = typeof src;
|
|
62
|
-
if (type === "object" && src.alt) {
|
|
63
|
-
return src.alt;
|
|
64
|
-
}
|
|
65
|
-
if (type === "object") {
|
|
66
|
-
const imageObj = src.image || src;
|
|
67
|
-
const altSetting = ((imageObj == null ? void 0 : imageObj.settings) || []).find(
|
|
68
|
-
(setting) => setting.key === "alt"
|
|
69
|
-
);
|
|
70
|
-
if (altSetting) {
|
|
71
|
-
return altSetting.value;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return "";
|
|
75
|
-
};
|
|
76
|
-
const getSrc = (src, variant) => {
|
|
77
|
-
var _a, _b, _c;
|
|
78
|
-
if (typeof src === "object") {
|
|
79
|
-
if (((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg")) || ((_b = src == null ? void 0 : src.name) == null ? void 0 : _b.includes(".gif"))) {
|
|
80
|
-
return [null, null, (_c = src.urls) == null ? void 0 : _c.original];
|
|
81
|
-
}
|
|
82
|
-
const fallback = src.urls[variant];
|
|
83
|
-
const webp = getWebp(fallback);
|
|
84
|
-
const avif = getAvif(fallback);
|
|
85
|
-
return [webp, avif, fallback];
|
|
86
|
-
}
|
|
87
|
-
return [null, null, src];
|
|
88
|
-
};
|
|
89
|
-
const getImageObjOrSrc = (value) => {
|
|
90
|
-
const type = typeof value;
|
|
91
|
-
if (type === "object" && value.hasOwnProperty("image")) {
|
|
92
|
-
return value.image;
|
|
93
|
-
}
|
|
94
|
-
return value;
|
|
95
|
-
};
|
|
96
|
-
const Image = (_a) => {
|
|
97
|
-
var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
|
|
98
|
-
if (!variant) {
|
|
99
|
-
console.error("Image with no variant", { variant, src, alt, props });
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
if (!src) {
|
|
103
|
-
console.error("Image with no src", { variant, src, alt, props });
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
const imageObjOrSrc = getImageObjOrSrc(src);
|
|
107
|
-
if (imageObjOrSrc && typeof imageObjOrSrc === "object" && !imageObjOrSrc.sizes) {
|
|
108
|
-
console.error("Image with no sizes", { variant, src, alt, props });
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
const [width, height] = getDimensions(imageObjOrSrc, variant);
|
|
112
|
-
const altAttr = alt || getAlt(src);
|
|
113
|
-
const [webp, avif, fallback] = getSrc(imageObjOrSrc, variant);
|
|
114
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("picture", { children: [
|
|
115
|
-
avif && /* @__PURE__ */ jsxRuntime.jsx("source", { srcSet: encodeURI(avif), type: "image/avif" }),
|
|
116
|
-
webp && /* @__PURE__ */ jsxRuntime.jsx("source", { srcSet: encodeURI(webp), type: "image/webp" }),
|
|
117
|
-
/* @__PURE__ */ jsxRuntime.jsx("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
-
"img",
|
|
120
|
-
__spreadValues({
|
|
121
|
-
src: fallback,
|
|
122
|
-
alt: altAttr,
|
|
123
|
-
width,
|
|
124
|
-
height,
|
|
125
|
-
loading
|
|
126
|
-
}, props)
|
|
127
|
-
)
|
|
128
|
-
] });
|
|
129
|
-
};
|
|
130
|
-
var Image_default = Image;
|
|
131
|
-
|
|
132
|
-
module.exports = Image_default;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var Container = require('../Container');
|
|
6
|
-
|
|
7
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
-
var Container__default = /*#__PURE__*/_interopDefault(Container);
|
|
11
|
-
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __defProps = Object.defineProperties;
|
|
14
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
15
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
16
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
18
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
-
var __spreadValues = (a, b) => {
|
|
20
|
-
for (var prop in b || (b = {}))
|
|
21
|
-
if (__hasOwnProp.call(b, prop))
|
|
22
|
-
__defNormalProp(a, prop, b[prop]);
|
|
23
|
-
if (__getOwnPropSymbols)
|
|
24
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
25
|
-
if (__propIsEnum.call(b, prop))
|
|
26
|
-
__defNormalProp(a, prop, b[prop]);
|
|
27
|
-
}
|
|
28
|
-
return a;
|
|
29
|
-
};
|
|
30
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
31
|
-
const WidgetRender = ({
|
|
32
|
-
library,
|
|
33
|
-
entity,
|
|
34
|
-
page,
|
|
35
|
-
context = {},
|
|
36
|
-
preloaded = {},
|
|
37
|
-
locale = "es"
|
|
38
|
-
}) => {
|
|
39
|
-
var _a;
|
|
40
|
-
const pageData = page || entity;
|
|
41
|
-
context = __spreadProps(__spreadValues({}, context), {
|
|
42
|
-
locale: (_a = context.locale) != null ? _a : locale
|
|
43
|
-
});
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: pageData.widgets.map(({ widgetId, component, settings }) => {
|
|
45
|
-
if (!library[component]) {
|
|
46
|
-
console.error(
|
|
47
|
-
`Unknown widget: {widgetId: ${widgetId}, component: ${component}, settings: ${settings}}`
|
|
48
|
-
);
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
-
Container__default.default,
|
|
53
|
-
{
|
|
54
|
-
settings: (settings == null ? void 0 : settings.containerSettings) || {},
|
|
55
|
-
"data-widget": component,
|
|
56
|
-
children: React__default.default.createElement(library[component], __spreadProps(__spreadValues({}, settings), {
|
|
57
|
-
__ctx: context,
|
|
58
|
-
__data: (preloaded == null ? void 0 : preloaded[widgetId]) || {}
|
|
59
|
-
}))
|
|
60
|
-
},
|
|
61
|
-
widgetId
|
|
62
|
-
);
|
|
63
|
-
}) });
|
|
64
|
-
};
|
|
65
|
-
var WidgetRender_default = WidgetRender;
|
|
66
|
-
|
|
67
|
-
module.exports = WidgetRender_default;
|
package/dist/imageSrc.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const imageSrc = (src, variant) => {
|
|
4
|
-
if (typeof src === "object" && !("name" in src))
|
|
5
|
-
console.warn(`WARNING: Image with empty {}: ${variant}`);
|
|
6
|
-
if (typeof src === "object" && "name" in src && (src.name.includes(".svg") || src.name.includes(".gif")))
|
|
7
|
-
return src.urls.original;
|
|
8
|
-
if (typeof src === "object" && "name" in src) return src.urls[variant];
|
|
9
|
-
if (typeof src === "string") return src;
|
|
10
|
-
return null;
|
|
11
|
-
};
|
|
12
|
-
var imageSrc_default = imageSrc;
|
|
13
|
-
|
|
14
|
-
module.exports = imageSrc_default;
|
package/dist/index.cjs
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var Image = require('./Image');
|
|
4
|
-
var imageSrc = require('./imageSrc');
|
|
5
|
-
var imagePlaceholder = require('./imagePlaceholder');
|
|
6
|
-
var Container = require('./Container');
|
|
7
|
-
var EmbeddedVideo = require('./EmbeddedVideo');
|
|
8
|
-
var toHTML = require('./toHTML');
|
|
9
|
-
var isImagePresent = require('./isImagePresent');
|
|
10
|
-
var AdminPageRender = require('./AdminPageRender');
|
|
11
|
-
var WidgetRender = require('./WidgetRender');
|
|
12
|
-
var extractImageValue = require('./extractImageValue');
|
|
13
|
-
|
|
14
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
|
|
16
|
-
var Image__default = /*#__PURE__*/_interopDefault(Image);
|
|
17
|
-
var imageSrc__default = /*#__PURE__*/_interopDefault(imageSrc);
|
|
18
|
-
var imagePlaceholder__default = /*#__PURE__*/_interopDefault(imagePlaceholder);
|
|
19
|
-
var Container__default = /*#__PURE__*/_interopDefault(Container);
|
|
20
|
-
var EmbeddedVideo__default = /*#__PURE__*/_interopDefault(EmbeddedVideo);
|
|
21
|
-
var toHTML__default = /*#__PURE__*/_interopDefault(toHTML);
|
|
22
|
-
var isImagePresent__default = /*#__PURE__*/_interopDefault(isImagePresent);
|
|
23
|
-
var AdminPageRender__default = /*#__PURE__*/_interopDefault(AdminPageRender);
|
|
24
|
-
var WidgetRender__default = /*#__PURE__*/_interopDefault(WidgetRender);
|
|
25
|
-
var extractImageValue__default = /*#__PURE__*/_interopDefault(extractImageValue);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Object.defineProperty(exports, "Image", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () { return Image__default.default; }
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(exports, "imageSrc", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () { return imageSrc__default.default; }
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "imagePlaceholder", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () { return imagePlaceholder__default.default; }
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(exports, "Container", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () { return Container__default.default; }
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(exports, "EmbeddedVideo", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function () { return EmbeddedVideo__default.default; }
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, "toHTML", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () { return toHTML__default.default; }
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(exports, "isImagePresent", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function () { return isImagePresent__default.default; }
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, "AdminPageRender", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () { return AdminPageRender__default.default; }
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, "WidgetRender", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () { return WidgetRender__default.default; }
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(exports, "extractImageValue", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () { return extractImageValue__default.default; }
|
|
68
|
-
});
|
package/dist/isImagePresent.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function isImagePresent(value) {
|
|
4
|
-
if (!value) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
if (value.hasOwnProperty("image")) {
|
|
8
|
-
return !!value.image;
|
|
9
|
-
}
|
|
10
|
-
if (typeof value === "string" && value) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return !!value;
|
|
14
|
-
}
|
|
15
|
-
var isImagePresent_default = isImagePresent;
|
|
16
|
-
|
|
17
|
-
module.exports = isImagePresent_default;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
|
|
5
|
-
const IconCopy = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6
|
-
"svg",
|
|
7
|
-
{
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
-
width: "16",
|
|
10
|
-
height: "16",
|
|
11
|
-
viewBox: "0 0 16 16",
|
|
12
|
-
fill: "none",
|
|
13
|
-
children: [
|
|
14
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#clip0_2312_498)", children: [
|
|
15
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
-
"path",
|
|
17
|
-
{
|
|
18
|
-
d: "M13.3334 5.33331H6.66671C5.93033 5.33331 5.33337 5.93027 5.33337 6.66665V13.3333C5.33337 14.0697 5.93033 14.6666 6.66671 14.6666H13.3334C14.0698 14.6666 14.6667 14.0697 14.6667 13.3333V6.66665C14.6667 5.93027 14.0698 5.33331 13.3334 5.33331Z",
|
|
19
|
-
stroke: "white",
|
|
20
|
-
strokeWidth: "2",
|
|
21
|
-
strokeLinecap: "round",
|
|
22
|
-
strokeLinejoin: "round"
|
|
23
|
-
}
|
|
24
|
-
),
|
|
25
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
-
"path",
|
|
27
|
-
{
|
|
28
|
-
d: "M2.66671 10.6666C1.93337 10.6666 1.33337 10.0666 1.33337 9.33331V2.66665C1.33337 1.93331 1.93337 1.33331 2.66671 1.33331H9.33337C10.0667 1.33331 10.6667 1.93331 10.6667 2.66665",
|
|
29
|
-
stroke: "white",
|
|
30
|
-
strokeWidth: "2",
|
|
31
|
-
strokeLinecap: "round",
|
|
32
|
-
strokeLinejoin: "round"
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_2312_498", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
const SelectedWidgetsToolbar = ({ length, onCopy }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "r-selected-widgets-toolbar", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "r-toolbar-inner", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41
|
-
"button",
|
|
42
|
-
{
|
|
43
|
-
type: "button",
|
|
44
|
-
className: "r-button-reset r-toolbar-button",
|
|
45
|
-
onClick: onCopy,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsxRuntime.jsx(IconCopy, {}),
|
|
48
|
-
"Copy selected (",
|
|
49
|
-
length,
|
|
50
|
-
")"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
) }) });
|
|
54
|
-
var SelectedWidgetsToolbar_default = SelectedWidgetsToolbar;
|
|
55
|
-
|
|
56
|
-
module.exports = SelectedWidgetsToolbar_default;
|
package/dist/toHTML.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var MarkdownIt = require('markdown-it');
|
|
4
|
-
var markdownItAttrs = require('markdown-it-attrs');
|
|
5
|
-
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var MarkdownIt__default = /*#__PURE__*/_interopDefault(MarkdownIt);
|
|
9
|
-
var markdownItAttrs__default = /*#__PURE__*/_interopDefault(markdownItAttrs);
|
|
10
|
-
|
|
11
|
-
const parser = new MarkdownIt__default.default({
|
|
12
|
-
html: true,
|
|
13
|
-
breaks: true
|
|
14
|
-
}).use(markdownItAttrs__default.default, {
|
|
15
|
-
// optional, these are default options
|
|
16
|
-
leftDelimiter: "{",
|
|
17
|
-
rightDelimiter: "}",
|
|
18
|
-
allowedAttributes: []
|
|
19
|
-
// empty array = all attributes are allowed
|
|
20
|
-
});
|
|
21
|
-
const toHTML = (string, inline = false) => {
|
|
22
|
-
if (!string) return;
|
|
23
|
-
return inline ? parser.renderInline(string) : parser.render(string);
|
|
24
|
-
};
|
|
25
|
-
var toHTML_default = toHTML;
|
|
26
|
-
|
|
27
|
-
module.exports = toHTML_default;
|