@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.
@@ -1,19 +1,54 @@
1
- import { __objRest, __spreadValues } from '../chunk-ORMEWXMH.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import React from 'react';
4
- import IconButton from './IconButton';
5
- import Container from '../Container';
1
+ 'use strict';
6
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
+ };
7
42
  function cn() {
8
43
  return Array.from(arguments).filter(Boolean).map(String).join(" ");
9
44
  }
10
45
  const AdminWidgetWrapper = (_a) => {
11
46
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
12
- return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("r-admin-widget-wrapper", className) }, rest));
47
+ return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("r-admin-widget-wrapper", className) }, rest));
13
48
  };
14
49
  const AdminWidgetToolbar = (_c) => {
15
50
  var _d = _c, { className } = _d, rest = __objRest(_d, ["className"]);
16
- return /* @__PURE__ */ jsx(
51
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
52
  "div",
18
53
  __spreadValues({
19
54
  className: cn("r-reset", "r-admin-widget-toolbar", className)
@@ -22,7 +57,7 @@ const AdminWidgetToolbar = (_c) => {
22
57
  };
23
58
  const AdminWidgetLabel = (_e) => {
24
59
  var _f = _e, { className } = _f, rest = __objRest(_f, ["className"]);
25
- return /* @__PURE__ */ jsx(
60
+ return /* @__PURE__ */ jsxRuntime.jsx(
26
61
  "div",
27
62
  __spreadValues({
28
63
  className: cn("r-reset", "r-fs-small", "r-admin-widget-label", className)
@@ -50,17 +85,17 @@ const AdminWidgetMinimal = ({
50
85
  const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
51
86
  if (!currentWidget || !currentAdminWidget) {
52
87
  console.error(`Unknown widget: ${widget.component}`);
53
- return /* @__PURE__ */ jsx(AdminWidgetWrapper, { "data-widget": widget.component, children: /* @__PURE__ */ jsx("div", { className: cn("r-reset", "r-fs-large", "r-admin-missing-widget"), children: `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}` }) });
54
89
  }
55
90
  const handleCopyWidget = () => {
56
91
  const widgetsToCopy = [widget];
57
92
  onCopy(widgetsToCopy);
58
93
  };
59
94
  const handleSelectWidget = () => onSelectWidget(widget.widgetId);
60
- return /* @__PURE__ */ jsxs(AdminWidgetWrapper, { "data-widget": widget.component, children: [
61
- isSelected && /* @__PURE__ */ jsx("div", { className: "r-selected-widget" }),
62
- /* @__PURE__ */ jsxs(AdminWidgetToolbar, { "data-toolbar": true, children: [
63
- /* @__PURE__ */ jsx(
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(
64
99
  "input",
65
100
  {
66
101
  type: "checkbox",
@@ -72,12 +107,12 @@ const AdminWidgetMinimal = ({
72
107
  checked: isSelected
73
108
  }
74
109
  ),
75
- !isSelected && !deprecated(currentAdminWidget) && /* @__PURE__ */ jsx(IconButton, { onClick: handleCopyWidget })
110
+ !isSelected && !deprecated(currentAdminWidget) && /* @__PURE__ */ jsxRuntime.jsx(IconButton__default.default, { onClick: handleCopyWidget })
76
111
  ] }),
77
- /* @__PURE__ */ jsx(AdminWidgetLabel, { "data-widget-label": true, children: title(currentAdminWidget) }),
78
- /* @__PURE__ */ jsx(Container, { settings: containerSettings, children: React.createElement(currentWidget, widget.settings) })
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) })
79
114
  ] });
80
115
  };
81
116
  var AdminWidgetMinimal_default = AdminWidgetMinimal;
82
117
 
83
- export { AdminWidgetMinimal_default as default };
118
+ module.exports = AdminWidgetMinimal_default;
@@ -0,0 +1,83 @@
1
+ import { __objRest, __spreadValues } from '../chunk-FWCSY2DS.mjs';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import React from 'react';
4
+ import IconButton from './IconButton';
5
+ import Container from '../Container';
6
+
7
+ function cn() {
8
+ return Array.from(arguments).filter(Boolean).map(String).join(" ");
9
+ }
10
+ const AdminWidgetWrapper = (_a) => {
11
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
12
+ return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("r-admin-widget-wrapper", className) }, rest));
13
+ };
14
+ const AdminWidgetToolbar = (_c) => {
15
+ var _d = _c, { className } = _d, rest = __objRest(_d, ["className"]);
16
+ return /* @__PURE__ */ jsx(
17
+ "div",
18
+ __spreadValues({
19
+ className: cn("r-reset", "r-admin-widget-toolbar", className)
20
+ }, rest)
21
+ );
22
+ };
23
+ const AdminWidgetLabel = (_e) => {
24
+ var _f = _e, { className } = _f, rest = __objRest(_f, ["className"]);
25
+ return /* @__PURE__ */ jsx(
26
+ "div",
27
+ __spreadValues({
28
+ className: cn("r-reset", "r-fs-small", "r-admin-widget-label", className)
29
+ }, rest)
30
+ );
31
+ };
32
+ const title = (widget) => {
33
+ return widget.Config.title;
34
+ };
35
+ const deprecated = (widget) => {
36
+ return widget.Config.deprecated;
37
+ };
38
+ const AdminWidgetMinimal = ({
39
+ library,
40
+ adminLibrary,
41
+ widget,
42
+ onCopy,
43
+ onSelectWidget,
44
+ selectedWidgets
45
+ }) => {
46
+ var _a;
47
+ const currentWidget = library[widget.component];
48
+ const currentAdminWidget = adminLibrary[widget.component];
49
+ const containerSettings = ((_a = widget == null ? void 0 : widget.settings) == null ? void 0 : _a.containerSettings) || {};
50
+ const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
51
+ if (!currentWidget || !currentAdminWidget) {
52
+ console.error(`Unknown widget: ${widget.component}`);
53
+ return /* @__PURE__ */ jsx(AdminWidgetWrapper, { "data-widget": widget.component, children: /* @__PURE__ */ jsx("div", { className: cn("r-reset", "r-fs-large", "r-admin-missing-widget"), children: `Unknown widget: ${widget.component}` }) });
54
+ }
55
+ const handleCopyWidget = () => {
56
+ const widgetsToCopy = [widget];
57
+ onCopy(widgetsToCopy);
58
+ };
59
+ const handleSelectWidget = () => onSelectWidget(widget.widgetId);
60
+ return /* @__PURE__ */ jsxs(AdminWidgetWrapper, { "data-widget": widget.component, children: [
61
+ isSelected && /* @__PURE__ */ jsx("div", { className: "r-selected-widget" }),
62
+ /* @__PURE__ */ jsxs(AdminWidgetToolbar, { "data-toolbar": true, children: [
63
+ /* @__PURE__ */ jsx(
64
+ "input",
65
+ {
66
+ type: "checkbox",
67
+ style: {
68
+ width: "32px",
69
+ height: "32px"
70
+ },
71
+ onChange: handleSelectWidget,
72
+ checked: isSelected
73
+ }
74
+ ),
75
+ !isSelected && !deprecated(currentAdminWidget) && /* @__PURE__ */ jsx(IconButton, { onClick: handleCopyWidget })
76
+ ] }),
77
+ /* @__PURE__ */ jsx(AdminWidgetLabel, { "data-widget-label": true, children: title(currentAdminWidget) }),
78
+ /* @__PURE__ */ jsx(Container, { settings: containerSettings, children: React.createElement(currentWidget, widget.settings) })
79
+ ] });
80
+ };
81
+ var AdminWidgetMinimal_default = AdminWidgetMinimal;
82
+
83
+ export { AdminWidgetMinimal_default as default };
@@ -1,9 +1,26 @@
1
- import { __spreadValues } from '../chunk-ORMEWXMH.js';
2
- import { 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
+ };
5
22
  const ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
6
- const IconButton = (props) => /* @__PURE__ */ jsx(
23
+ const IconButton = (props) => /* @__PURE__ */ jsxRuntime.jsx(
7
24
  "button",
8
25
  __spreadValues({
9
26
  type: "button",
@@ -29,4 +46,4 @@ const IconButton = (props) => /* @__PURE__ */ jsx(
29
46
  );
30
47
  var IconButton_default = IconButton;
31
48
 
32
- export { IconButton_default as default };
49
+ module.exports = IconButton_default;
@@ -0,0 +1,32 @@
1
+ import { __spreadValues } from '../chunk-FWCSY2DS.mjs';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+ const ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
6
+ const IconButton = (props) => /* @__PURE__ */ jsx(
7
+ "button",
8
+ __spreadValues({
9
+ type: "button",
10
+ style: {
11
+ display: "inline-block",
12
+ width: "32px",
13
+ height: "32px",
14
+ marginRight: "4px",
15
+ marginLeft: "0px",
16
+ appearance: "none",
17
+ outline: "0",
18
+ border: "0",
19
+ borderRadius: "3px",
20
+ background: "transparent",
21
+ backgroundColor: "#fff",
22
+ backgroundRepeat: "no-repeat",
23
+ backgroundPosition: "center",
24
+ backgroundSize: "50%",
25
+ backgroundImage: `url(${ICON_COPY})`,
26
+ cursor: "pointer"
27
+ }
28
+ }, props)
29
+ );
30
+ var IconButton_default = IconButton;
31
+
32
+ export { IconButton_default as default };
@@ -1,9 +1,35 @@
1
- import { __spreadProps, __spreadValues } from '../chunk-ORMEWXMH.js';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React from 'react';
4
- import AdminWidgetMinimal from './AdminWidgetMinimal';
5
- import SelectedWidgetsToolbar from '../lib/SelectedWidgetsToolbar';
1
+ 'use strict';
6
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));
7
33
  const saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
8
34
  `clipboard\u2013${identifier}`,
9
35
  JSON.stringify(widgets)
@@ -19,7 +45,7 @@ const AdminPageRender = ({
19
45
  canvasClassName = "",
20
46
  layoutMessage = ""
21
47
  }) => {
22
- const [selectedWidgets, setSelectedWidgets] = React.useState([]);
48
+ const [selectedWidgets, setSelectedWidgets] = React__default.default.useState([]);
23
49
  const entity = __spreadProps(__spreadValues({}, page), {
24
50
  widgets: page.widgets.map((w) => __spreadProps(__spreadValues({}, w), {
25
51
  settings: __spreadProps(__spreadValues({}, w.settings), {
@@ -54,16 +80,16 @@ const AdminPageRender = ({
54
80
  if (areAllSelected) return setSelectedWidgets([]);
55
81
  setSelectedWidgets(entity.widgets.map((w) => w.widgetId));
56
82
  };
57
- return /* @__PURE__ */ jsxs(React.Fragment, { children: [
58
- layoutMessage && /* @__PURE__ */ jsx("div", { className: "r-reset r-fs-base r-layout-message", children: layoutMessage }),
59
- selectedWidgets.length > 0 && /* @__PURE__ */ jsx(
60
- SelectedWidgetsToolbar,
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,
61
87
  {
62
88
  length: selectedWidgets.length,
63
89
  onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
64
90
  }
65
91
  ),
66
- entity.widgets.length > 0 && /* @__PURE__ */ jsx(
92
+ entity.widgets.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
67
93
  "button",
68
94
  {
69
95
  className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
@@ -72,9 +98,9 @@ const AdminPageRender = ({
72
98
  onClick: () => handleSelectAll()
73
99
  }
74
100
  ),
75
- /* @__PURE__ */ jsx("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
76
- /* @__PURE__ */ jsx("div", { className: canvasClassName, children: entity.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ jsx(
77
- AdminWidgetMinimal,
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,
78
104
  {
79
105
  library,
80
106
  adminLibrary,
@@ -89,4 +115,4 @@ const AdminPageRender = ({
89
115
  };
90
116
  var AdminPageRender_default = AdminPageRender;
91
117
 
92
- export { AdminPageRender_default as default };
118
+ module.exports = AdminPageRender_default;
@@ -0,0 +1,92 @@
1
+ import { __spreadProps, __spreadValues } from '../chunk-FWCSY2DS.mjs';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React from 'react';
4
+ import AdminWidgetMinimal from './AdminWidgetMinimal';
5
+ import SelectedWidgetsToolbar from '../lib/SelectedWidgetsToolbar';
6
+
7
+ const saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
8
+ `clipboard\u2013${identifier}`,
9
+ JSON.stringify(widgets)
10
+ );
11
+ const AdminPageRender = ({
12
+ page,
13
+ context = {},
14
+ preloaded = {},
15
+ library,
16
+ adminLibrary,
17
+ identifier,
18
+ detailPath,
19
+ canvasClassName = "",
20
+ layoutMessage = ""
21
+ }) => {
22
+ const [selectedWidgets, setSelectedWidgets] = React.useState([]);
23
+ const entity = __spreadProps(__spreadValues({}, page), {
24
+ widgets: page.widgets.map((w) => __spreadProps(__spreadValues({}, w), {
25
+ settings: __spreadProps(__spreadValues({}, w.settings), {
26
+ __ctx: context,
27
+ __data: preloaded[w.widgetId]
28
+ })
29
+ }))
30
+ });
31
+ const areAllSelected = selectedWidgets.length === entity.widgets.length;
32
+ const handleSelectWidget = (newWidget) => {
33
+ setSelectedWidgets((oldList) => {
34
+ const isUnique = oldList.filter((w) => w === newWidget).length <= 0;
35
+ if (isUnique) {
36
+ return [...oldList, newWidget];
37
+ } else {
38
+ return oldList.filter((w) => w !== newWidget);
39
+ }
40
+ });
41
+ };
42
+ const handleCopyWidgets = (widgets, copyType) => {
43
+ if (copyType === "multiple") {
44
+ const filterSelected = entity.widgets.filter(
45
+ (w) => widgets.some((c) => w.widgetId === c)
46
+ );
47
+ saveToLocalStorage(identifier, filterSelected);
48
+ setSelectedWidgets([]);
49
+ return;
50
+ }
51
+ saveToLocalStorage(identifier, widgets);
52
+ };
53
+ const handleSelectAll = () => {
54
+ if (areAllSelected) return setSelectedWidgets([]);
55
+ setSelectedWidgets(entity.widgets.map((w) => w.widgetId));
56
+ };
57
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
58
+ layoutMessage && /* @__PURE__ */ jsx("div", { className: "r-reset r-fs-base r-layout-message", children: layoutMessage }),
59
+ selectedWidgets.length > 0 && /* @__PURE__ */ jsx(
60
+ SelectedWidgetsToolbar,
61
+ {
62
+ length: selectedWidgets.length,
63
+ onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
64
+ }
65
+ ),
66
+ entity.widgets.length > 0 && /* @__PURE__ */ jsx(
67
+ "button",
68
+ {
69
+ className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
70
+ type: "button",
71
+ title: "Select all (or Deselect all)",
72
+ onClick: () => handleSelectAll()
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsx("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
76
+ /* @__PURE__ */ jsx("div", { className: canvasClassName, children: entity.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ jsx(
77
+ AdminWidgetMinimal,
78
+ {
79
+ library,
80
+ adminLibrary,
81
+ widget: { widgetId, component, settings },
82
+ onCopy: handleCopyWidgets,
83
+ onSelectWidget: handleSelectWidget,
84
+ selectedWidgets
85
+ },
86
+ widgetId
87
+ )) })
88
+ ] });
89
+ };
90
+ var AdminPageRender_default = AdminPageRender;
91
+
92
+ export { AdminPageRender_default as default };
package/dist/Container.js CHANGED
@@ -1,13 +1,45 @@
1
- import { __objRest, __spreadProps, __spreadValues } from './chunk-ORMEWXMH.js';
2
- import { 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 __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
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
5
37
  const Container = (_a) => {
6
38
  var _b = _a, { settings, className, children } = _b, rest = __objRest(_b, ["settings", "className", "children"]);
7
39
  const _a2 = settings || {}, { containerID } = _a2, restSettings = __objRest(_a2, ["containerID"]);
8
40
  const cssClasses = [...Object.values(restSettings), className].join(" ");
9
- return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ id: containerID, className: cssClasses }, rest), { children }));
41
+ return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ id: containerID, className: cssClasses }, rest), { children }));
10
42
  };
11
43
  var Container_default = Container;
12
44
 
13
- export { Container_default as default };
45
+ module.exports = Container_default;
@@ -0,0 +1,13 @@
1
+ import { __objRest, __spreadProps, __spreadValues } from './chunk-FWCSY2DS.mjs';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+ const Container = (_a) => {
6
+ var _b = _a, { settings, className, children } = _b, rest = __objRest(_b, ["settings", "className", "children"]);
7
+ const _a2 = settings || {}, { containerID } = _a2, restSettings = __objRest(_a2, ["containerID"]);
8
+ const cssClasses = [...Object.values(restSettings), className].join(" ");
9
+ return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ id: containerID, className: cssClasses }, rest), { children }));
10
+ };
11
+ var Container_default = Container;
12
+
13
+ export { Container_default as default };
@@ -1,8 +1,9 @@
1
- import './chunk-ORMEWXMH.js';
2
- import { jsx } from 'react/jsx-runtime';
3
- import 'react';
1
+ 'use strict';
4
2
 
5
- const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ require('react');
5
+
6
+ const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
6
7
  "iframe",
7
8
  {
8
9
  frameBorder: "0",
@@ -12,7 +13,7 @@ const VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
12
13
  allow: "autoplay"
13
14
  }
14
15
  );
15
- const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
16
+ const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
16
17
  "iframe",
17
18
  {
18
19
  height: "0",
@@ -24,7 +25,7 @@ const YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
24
25
  allow: "autoplay"
25
26
  }
26
27
  );
27
- const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
28
+ const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
28
29
  "iframe",
29
30
  {
30
31
  frameBorder: "0",
@@ -34,7 +35,7 @@ const YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
34
35
  allow: "autoplay"
35
36
  }
36
37
  );
37
- const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
38
+ const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
38
39
  "iframe",
39
40
  {
40
41
  frameBorder: "0",
@@ -44,7 +45,7 @@ const YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ *
44
45
  allow: "autoplay"
45
46
  }
46
47
  );
47
- const WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsx(
48
+ const WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ jsxRuntime.jsx(
48
49
  "iframe",
49
50
  {
50
51
  frameBorder: "0",
@@ -121,10 +122,10 @@ const EmbeddedVideo = ({
121
122
  const vId = videoId(videoUrl);
122
123
  const VideoComponent = VideoComponentType(vType, noCookieDomains);
123
124
  if (VideoComponent) {
124
- return /* @__PURE__ */ jsx(VideoComponent, { videoId: vId, autoplay });
125
+ return /* @__PURE__ */ jsxRuntime.jsx(VideoComponent, { videoId: vId, autoplay });
125
126
  }
126
127
  return null;
127
128
  };
128
129
  var EmbeddedVideo_default = EmbeddedVideo;
129
130
 
130
- export { EmbeddedVideo_default as default };
131
+ module.exports = EmbeddedVideo_default;