@raketa-builder/support 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,130 @@
1
+ import './chunk-FWCSY2DS.mjs';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+ const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
6
+ "iframe",
7
+ {
8
+ frameBorder: "0",
9
+ allowFullScreen: "0",
10
+ src: `https://player.vimeo.com/video/${videoId2}?color=ffffff&title=0&byline=0&portrait=0&autoplay=${autoplay === true ? "1" : "0"}`,
11
+ className: "content",
12
+ allow: "autoplay"
13
+ }
14
+ );
15
+ const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
16
+ "iframe",
17
+ {
18
+ height: "0",
19
+ width: "0",
20
+ src: `https://player.youku.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
21
+ frameBorder: "0",
22
+ allowFullScreen: true,
23
+ className: "content",
24
+ allow: "autoplay"
25
+ }
26
+ );
27
+ const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
28
+ "iframe",
29
+ {
30
+ frameBorder: "0",
31
+ allowFullScreen: true,
32
+ src: `https://youtube.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
33
+ className: "content",
34
+ allow: "autoplay"
35
+ }
36
+ );
37
+ const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
38
+ "iframe",
39
+ {
40
+ frameBorder: "0",
41
+ allowFullScreen: true,
42
+ src: `https://www.youtube-nocookie.com/embed/${videoId2}?autoplay=${autoplay === true ? "1" : "0"}`,
43
+ className: "content",
44
+ allow: "autoplay"
45
+ }
46
+ );
47
+ const WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
48
+ "iframe",
49
+ {
50
+ frameBorder: "0",
51
+ allowFullScreen: true,
52
+ src: `https://fast.wistia.net/embed/iframe/${videoId2}${autoplay ? "?autoPlay=true" : ""}`,
53
+ className: "content",
54
+ allow: "autoplay"
55
+ }
56
+ );
57
+ const videoType = (url) => {
58
+ if (url.includes("youtu")) return "youtube";
59
+ if (url.includes("vimeo")) return "vimeo";
60
+ if (url.includes("youku")) return "youku";
61
+ if (url.includes("wistia")) return "wistia";
62
+ };
63
+ const youtubeId = (url) => {
64
+ var _a;
65
+ let matches = url.match(
66
+ /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
67
+ );
68
+ if (matches && matches[5]) {
69
+ return matches[5];
70
+ }
71
+ matches = url.match(new RegExp("youtu\\.be\\/|youtube\\.com\\/shorts\\/(?<id>.*)(\\?.*)?"));
72
+ return ((_a = matches == null ? void 0 : matches.groups) == null ? void 0 : _a.id) || "";
73
+ };
74
+ const vimeoId = (url) => {
75
+ const matches = url.match(/http(s?):\/\/(www\.)?vimeo\.com\/(\d+)($|\/)/);
76
+ return matches !== "" && matches !== null ? matches[3] : "";
77
+ };
78
+ const youkuId = (url) => {
79
+ const matches = url.match(
80
+ /http(s?):\/\/v\.youku\.com\/v_show\/id_([A-Za-z0-9=]+)\.html/
81
+ );
82
+ return matches !== "" && matches !== null ? matches[2] : "";
83
+ };
84
+ const wistiaId = (url) => {
85
+ const matches = url.match(
86
+ /http(s?):\/\/fast\.wistia\.net\/embed\/iframe\/(.*)($|\?)/
87
+ );
88
+ return matches !== "" && matches !== null ? matches[2] : "";
89
+ };
90
+ const videoId = (url) => {
91
+ if (videoType(url) === "youtube") return youtubeId(url);
92
+ if (videoType(url) === "vimeo") return vimeoId(url);
93
+ if (videoType(url) === "youku") return youkuId(url);
94
+ if (videoType(url) === "wistia") return wistiaId(url);
95
+ };
96
+ const VideoComponentType = (vType, noCookieDomains) => {
97
+ const components = {
98
+ youtube: YouTubeEmbed,
99
+ vimeo: VimeoEmbed,
100
+ youku: YoukuEmbed,
101
+ wistia: WistiaEmbed
102
+ };
103
+ const noCookiesComponents = {
104
+ youtube: YouTubeNoCookieEmbed,
105
+ vimeo: VimeoEmbed,
106
+ youku: YoukuEmbed,
107
+ wistia: WistiaEmbed
108
+ };
109
+ if (noCookieDomains) {
110
+ return noCookiesComponents[vType];
111
+ } else {
112
+ return components[vType];
113
+ }
114
+ };
115
+ const EmbeddedVideo = ({
116
+ videoUrl,
117
+ autoplay = false,
118
+ noCookieDomains = false
119
+ }) => {
120
+ const vType = videoType(videoUrl);
121
+ const vId = videoId(videoUrl);
122
+ const VideoComponent = VideoComponentType(vType, noCookieDomains);
123
+ if (VideoComponent) {
124
+ return /* @__PURE__ */ jsx(VideoComponent, { videoId: vId, autoplay });
125
+ }
126
+ return null;
127
+ };
128
+ var EmbeddedVideo_default = EmbeddedVideo;
129
+
130
+ export { EmbeddedVideo_default as default };
package/dist/Image.js CHANGED
@@ -1,7 +1,36 @@
1
- import { __objRest, __spreadValues } from './chunk-ORMEWXMH.js';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import 'react';
1
+ 'use strict';
4
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
+ };
5
34
  const getWebp = (url) => {
6
35
  if (!url) return null;
7
36
  const segments = url.split(".");
@@ -82,11 +111,11 @@ const Image = (_a) => {
82
111
  const [width, height] = getDimensions(imageObjOrSrc, variant);
83
112
  const altAttr = alt || getAlt(src);
84
113
  const [webp, avif, fallback] = getSrc(imageObjOrSrc, variant);
85
- return /* @__PURE__ */ jsxs("picture", { children: [
86
- avif && /* @__PURE__ */ jsx("source", { srcSet: encodeURI(avif), type: "image/avif" }),
87
- webp && /* @__PURE__ */ jsx("source", { srcSet: encodeURI(webp), type: "image/webp" }),
88
- /* @__PURE__ */ jsx("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
89
- /* @__PURE__ */ jsx(
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(
90
119
  "img",
91
120
  __spreadValues({
92
121
  src: fallback,
@@ -100,4 +129,4 @@ const Image = (_a) => {
100
129
  };
101
130
  var Image_default = Image;
102
131
 
103
- export { Image_default as default };
132
+ module.exports = Image_default;
package/dist/Image.mjs ADDED
@@ -0,0 +1,103 @@
1
+ import { __objRest, __spreadValues } from './chunk-FWCSY2DS.mjs';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+ const getWebp = (url) => {
6
+ if (!url) return null;
7
+ const segments = url.split(".");
8
+ segments[segments.length - 1] = "webp";
9
+ return segments.join(".");
10
+ };
11
+ const getAvif = (url) => {
12
+ if (!url) return null;
13
+ const segments = url.split(".");
14
+ segments[segments.length - 1] = "avif";
15
+ return segments.join(".");
16
+ };
17
+ const getDimensions = (src, variant) => {
18
+ var _a, _b, _c;
19
+ if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
20
+ const width = src.width || null;
21
+ const height = src.height || null;
22
+ return [width, height];
23
+ }
24
+ if (typeof src === "object") {
25
+ const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || null;
26
+ const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || null;
27
+ return [width, height];
28
+ }
29
+ return [null, null];
30
+ };
31
+ const getAlt = (src) => {
32
+ const type = typeof src;
33
+ if (type === "object" && src.alt) {
34
+ return src.alt;
35
+ }
36
+ if (type === "object") {
37
+ const imageObj = src.image || src;
38
+ const altSetting = ((imageObj == null ? void 0 : imageObj.settings) || []).find(
39
+ (setting) => setting.key === "alt"
40
+ );
41
+ if (altSetting) {
42
+ return altSetting.value;
43
+ }
44
+ }
45
+ return "";
46
+ };
47
+ const getSrc = (src, variant) => {
48
+ var _a, _b, _c;
49
+ if (typeof src === "object") {
50
+ 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"))) {
51
+ return [null, null, (_c = src.urls) == null ? void 0 : _c.original];
52
+ }
53
+ const fallback = src.urls[variant];
54
+ const webp = getWebp(fallback);
55
+ const avif = getAvif(fallback);
56
+ return [webp, avif, fallback];
57
+ }
58
+ return [null, null, src];
59
+ };
60
+ const getImageObjOrSrc = (value) => {
61
+ const type = typeof value;
62
+ if (type === "object" && value.hasOwnProperty("image")) {
63
+ return value.image;
64
+ }
65
+ return value;
66
+ };
67
+ const Image = (_a) => {
68
+ var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
69
+ if (!variant) {
70
+ console.error("Image with no variant", { variant, src, alt, props });
71
+ return null;
72
+ }
73
+ if (!src) {
74
+ console.error("Image with no src", { variant, src, alt, props });
75
+ return null;
76
+ }
77
+ const imageObjOrSrc = getImageObjOrSrc(src);
78
+ if (imageObjOrSrc && typeof imageObjOrSrc === "object" && !imageObjOrSrc.sizes) {
79
+ console.error("Image with no sizes", { variant, src, alt, props });
80
+ return null;
81
+ }
82
+ const [width, height] = getDimensions(imageObjOrSrc, variant);
83
+ const altAttr = alt || getAlt(src);
84
+ const [webp, avif, fallback] = getSrc(imageObjOrSrc, variant);
85
+ return /* @__PURE__ */ jsxs("picture", { children: [
86
+ avif && /* @__PURE__ */ jsx("source", { srcSet: encodeURI(avif), type: "image/avif" }),
87
+ webp && /* @__PURE__ */ jsx("source", { srcSet: encodeURI(webp), type: "image/webp" }),
88
+ /* @__PURE__ */ jsx("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
89
+ /* @__PURE__ */ jsx(
90
+ "img",
91
+ __spreadValues({
92
+ src: fallback,
93
+ alt: altAttr,
94
+ width,
95
+ height,
96
+ loading
97
+ }, props)
98
+ )
99
+ ] });
100
+ };
101
+ var Image_default = Image;
102
+
103
+ export { Image_default as default };
@@ -1,8 +1,33 @@
1
- import { __spreadProps, __spreadValues } from '../chunk-ORMEWXMH.js';
2
- import { jsx, Fragment } from 'react/jsx-runtime';
3
- import React from 'react';
4
- import Container from '../Container';
1
+ 'use strict';
5
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));
6
31
  const WidgetRender = ({
7
32
  library,
8
33
  entity,
@@ -16,19 +41,19 @@ const WidgetRender = ({
16
41
  context = __spreadProps(__spreadValues({}, context), {
17
42
  locale: (_a = context.locale) != null ? _a : locale
18
43
  });
19
- return /* @__PURE__ */ jsx(Fragment, { children: pageData.widgets.map(({ widgetId, component, settings }) => {
44
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: pageData.widgets.map(({ widgetId, component, settings }) => {
20
45
  if (!library[component]) {
21
46
  console.error(
22
47
  `Unknown widget: {widgetId: ${widgetId}, component: ${component}, settings: ${settings}}`
23
48
  );
24
49
  return null;
25
50
  }
26
- return /* @__PURE__ */ jsx(
27
- Container,
51
+ return /* @__PURE__ */ jsxRuntime.jsx(
52
+ Container__default.default,
28
53
  {
29
54
  settings: (settings == null ? void 0 : settings.containerSettings) || {},
30
55
  "data-widget": component,
31
- children: React.createElement(library[component], __spreadProps(__spreadValues({}, settings), {
56
+ children: React__default.default.createElement(library[component], __spreadProps(__spreadValues({}, settings), {
32
57
  __ctx: context,
33
58
  __data: (preloaded == null ? void 0 : preloaded[widgetId]) || {}
34
59
  }))
@@ -39,4 +64,4 @@ const WidgetRender = ({
39
64
  };
40
65
  var WidgetRender_default = WidgetRender;
41
66
 
42
- export { WidgetRender_default as default };
67
+ module.exports = WidgetRender_default;
@@ -0,0 +1,42 @@
1
+ import { __spreadProps, __spreadValues } from '../chunk-FWCSY2DS.mjs';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import React from 'react';
4
+ import Container from '../Container';
5
+
6
+ const WidgetRender = ({
7
+ library,
8
+ entity,
9
+ page,
10
+ context = {},
11
+ preloaded = {},
12
+ locale = "es"
13
+ }) => {
14
+ var _a;
15
+ const pageData = page || entity;
16
+ context = __spreadProps(__spreadValues({}, context), {
17
+ locale: (_a = context.locale) != null ? _a : locale
18
+ });
19
+ return /* @__PURE__ */ jsx(Fragment, { children: pageData.widgets.map(({ widgetId, component, settings }) => {
20
+ if (!library[component]) {
21
+ console.error(
22
+ `Unknown widget: {widgetId: ${widgetId}, component: ${component}, settings: ${settings}}`
23
+ );
24
+ return null;
25
+ }
26
+ return /* @__PURE__ */ jsx(
27
+ Container,
28
+ {
29
+ settings: (settings == null ? void 0 : settings.containerSettings) || {},
30
+ "data-widget": component,
31
+ children: React.createElement(library[component], __spreadProps(__spreadValues({}, settings), {
32
+ __ctx: context,
33
+ __data: (preloaded == null ? void 0 : preloaded[widgetId]) || {}
34
+ }))
35
+ },
36
+ widgetId
37
+ );
38
+ }) });
39
+ };
40
+ var WidgetRender_default = WidgetRender;
41
+
42
+ export { WidgetRender_default as default };
@@ -1,4 +1,4 @@
1
- import './chunk-ORMEWXMH.js';
1
+ 'use strict';
2
2
 
3
3
  function extractImageValue(value) {
4
4
  if (!value) {
@@ -8,4 +8,4 @@ function extractImageValue(value) {
8
8
  }
9
9
  var extractImageValue_default = extractImageValue;
10
10
 
11
- export { extractImageValue_default as default };
11
+ module.exports = extractImageValue_default;
@@ -0,0 +1,11 @@
1
+ import './chunk-FWCSY2DS.mjs';
2
+
3
+ function extractImageValue(value) {
4
+ if (!value) {
5
+ return null;
6
+ }
7
+ return value.hasOwnProperty("image") ? value.image : value;
8
+ }
9
+ var extractImageValue_default = extractImageValue;
10
+
11
+ export { extractImageValue_default as default };
@@ -1,8 +1,8 @@
1
- import './chunk-ORMEWXMH.js';
1
+ 'use strict';
2
2
 
3
3
  const imagePlaceholder = (size) => {
4
4
  return `https://placeholder.raketa.cloud/images/${size}`;
5
5
  };
6
6
  var imagePlaceholder_default = imagePlaceholder;
7
7
 
8
- export { imagePlaceholder_default as default };
8
+ module.exports = imagePlaceholder_default;
@@ -0,0 +1,8 @@
1
+ import './chunk-FWCSY2DS.mjs';
2
+
3
+ const imagePlaceholder = (size) => {
4
+ return `https://placeholder.raketa.cloud/images/${size}`;
5
+ };
6
+ var imagePlaceholder_default = imagePlaceholder;
7
+
8
+ export { imagePlaceholder_default as default };
package/dist/imageSrc.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-ORMEWXMH.js';
1
+ 'use strict';
2
2
 
3
3
  const imageSrc = (src, variant) => {
4
4
  if (typeof src === "object" && !("name" in src))
@@ -11,4 +11,4 @@ const imageSrc = (src, variant) => {
11
11
  };
12
12
  var imageSrc_default = imageSrc;
13
13
 
14
- export { imageSrc_default as default };
14
+ module.exports = imageSrc_default;
@@ -0,0 +1,14 @@
1
+ import './chunk-FWCSY2DS.mjs';
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
+ export { imageSrc_default as default };
package/dist/index.js CHANGED
@@ -1,11 +1,68 @@
1
- import './chunk-ORMEWXMH.js';
2
- export { default as Image } from './Image';
3
- export { default as imageSrc } from './imageSrc';
4
- export { default as imagePlaceholder } from './imagePlaceholder';
5
- export { default as Container } from './Container';
6
- export { default as EmbeddedVideo } from './EmbeddedVideo';
7
- export { default as toHTML } from './toHTML';
8
- export { default as isImagePresent } from './isImagePresent';
9
- export { default as AdminPageRender } from './AdminPageRender';
10
- export { default as WidgetRender } from './WidgetRender';
11
- export { default as extractImageValue } from './extractImageValue';
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/index.mjs ADDED
@@ -0,0 +1,11 @@
1
+ import './chunk-FWCSY2DS.mjs';
2
+ export { default as Image } from './Image';
3
+ export { default as imageSrc } from './imageSrc';
4
+ export { default as imagePlaceholder } from './imagePlaceholder';
5
+ export { default as Container } from './Container';
6
+ export { default as EmbeddedVideo } from './EmbeddedVideo';
7
+ export { default as toHTML } from './toHTML';
8
+ export { default as isImagePresent } from './isImagePresent';
9
+ export { default as AdminPageRender } from './AdminPageRender';
10
+ export { default as WidgetRender } from './WidgetRender';
11
+ export { default as extractImageValue } from './extractImageValue';
@@ -1,4 +1,4 @@
1
- import './chunk-ORMEWXMH.js';
1
+ 'use strict';
2
2
 
3
3
  function isImagePresent(value) {
4
4
  if (!value) {
@@ -14,4 +14,4 @@ function isImagePresent(value) {
14
14
  }
15
15
  var isImagePresent_default = isImagePresent;
16
16
 
17
- export { isImagePresent_default as default };
17
+ module.exports = isImagePresent_default;
@@ -0,0 +1,17 @@
1
+ import './chunk-FWCSY2DS.mjs';
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
+ export { isImagePresent_default as default };
@@ -1,7 +1,8 @@
1
- import '../chunk-ORMEWXMH.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ 'use strict';
3
2
 
4
- const IconCopy = () => /* @__PURE__ */ jsxs(
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ const IconCopy = () => /* @__PURE__ */ jsxRuntime.jsxs(
5
6
  "svg",
6
7
  {
7
8
  xmlns: "http://www.w3.org/2000/svg",
@@ -10,8 +11,8 @@ const IconCopy = () => /* @__PURE__ */ jsxs(
10
11
  viewBox: "0 0 16 16",
11
12
  fill: "none",
12
13
  children: [
13
- /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_2312_498)", children: [
14
- /* @__PURE__ */ jsx(
14
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#clip0_2312_498)", children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx(
15
16
  "path",
16
17
  {
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",
@@ -21,7 +22,7 @@ const IconCopy = () => /* @__PURE__ */ jsxs(
21
22
  strokeLinejoin: "round"
22
23
  }
23
24
  ),
24
- /* @__PURE__ */ jsx(
25
+ /* @__PURE__ */ jsxRuntime.jsx(
25
26
  "path",
26
27
  {
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",
@@ -32,18 +33,18 @@ const IconCopy = () => /* @__PURE__ */ jsxs(
32
33
  }
33
34
  )
34
35
  ] }),
35
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_2312_498", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
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" }) }) })
36
37
  ]
37
38
  }
38
39
  );
39
- const SelectedWidgetsToolbar = ({ length, onCopy }) => /* @__PURE__ */ jsx("div", { className: "r-selected-widgets-toolbar", children: /* @__PURE__ */ jsx("div", { className: "r-toolbar-inner", children: /* @__PURE__ */ jsxs(
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(
40
41
  "button",
41
42
  {
42
43
  type: "button",
43
44
  className: "r-button-reset r-toolbar-button",
44
45
  onClick: onCopy,
45
46
  children: [
46
- /* @__PURE__ */ jsx(IconCopy, {}),
47
+ /* @__PURE__ */ jsxRuntime.jsx(IconCopy, {}),
47
48
  "Copy selected (",
48
49
  length,
49
50
  ")"
@@ -52,4 +53,4 @@ const SelectedWidgetsToolbar = ({ length, onCopy }) => /* @__PURE__ */ jsx("div"
52
53
  ) }) });
53
54
  var SelectedWidgetsToolbar_default = SelectedWidgetsToolbar;
54
55
 
55
- export { SelectedWidgetsToolbar_default as default };
56
+ module.exports = SelectedWidgetsToolbar_default;