@raketa-builder/image-input 0.10.0 → 0.11.0

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,5 +1,5 @@
1
1
 
2
- > @raketa-builder/image-input@0.10.0 build
2
+ > @raketa-builder/image-input@0.11.0 build
3
3
  > tsup src/index.js --format cjs --loader ".js=jsx"
4
4
 
5
5
  CLI Building entry: src/index.js
@@ -7,5 +7,5 @@ CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v6.5.0
8
8
  CLI Target: es6
9
9
  CJS Build start
10
- CJS dist/index.js 307.82 KB
11
- CJS ⚡️ Build success in 179ms
10
+ CJS dist/index.js 321.20 KB
11
+ CJS ⚡️ Build success in 306ms
package/dist/index.js CHANGED
@@ -114,6 +114,7 @@ var require_dist = __commonJS({
114
114
  var src_exports2 = {};
115
115
  __export2(src_exports2, {
116
116
  Button: () => Button_default,
117
+ CategoriesMenu: () => CategoriesMenu_default,
117
118
  Col: () => Col,
118
119
  Container: () => Container_default,
119
120
  DataGrid: () => DataGrid_default,
@@ -219,7 +220,19 @@ var require_dist = __commonJS({
219
220
  var import_react32 = __toESM2(require("react"));
220
221
  var import_jsx_runtime32 = require("react/jsx-runtime");
221
222
  var Button5 = (_a) => {
222
- var _b = _a, { as = "button", size, variant, className } = _b, rest = __objRest2(_b, ["as", "size", "variant", "className"]);
223
+ var _b = _a, {
224
+ as = "button",
225
+ size = "md",
226
+ variant = "primary",
227
+ className,
228
+ type = "button"
229
+ } = _b, rest = __objRest2(_b, [
230
+ "as",
231
+ "size",
232
+ "variant",
233
+ "className",
234
+ "type"
235
+ ]);
223
236
  const Component = as;
224
237
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
225
238
  Component,
@@ -235,11 +248,6 @@ var require_dist = __commonJS({
235
248
  }, rest)
236
249
  );
237
250
  };
238
- Button5.defaultProps = {
239
- type: "button",
240
- size: "md",
241
- variant: "primary"
242
- };
243
251
  Button5.variants = ["primary", "secondary", "success", "danger"];
244
252
  Button5.sizes = {
245
253
  sm: "sm",
@@ -730,7 +738,7 @@ var require_dist = __commonJS({
730
738
  var import_react24 = __toESM2(require("react"));
731
739
  var import_jsx_runtime24 = require("react/jsx-runtime");
732
740
  var ImageAvatar = (_a) => {
733
- var _b = _a, { size, className } = _b, props = __objRest2(_b, ["size", "className"]);
741
+ var _b = _a, { size = "24px", className } = _b, props = __objRest2(_b, ["size", "className"]);
734
742
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
735
743
  "img",
736
744
  __spreadValues2({
@@ -743,9 +751,6 @@ var require_dist = __commonJS({
743
751
  }, props)
744
752
  );
745
753
  };
746
- ImageAvatar.defaultProps = {
747
- size: "24px"
748
- };
749
754
  var ImageAvatar_default = ImageAvatar;
750
755
  var import_react25 = __toESM2(require("react"));
751
756
  var import_jsx_runtime25 = require("react/jsx-runtime");
@@ -786,14 +791,53 @@ var require_dist = __commonJS({
786
791
  );
787
792
  };
788
793
  var DefaultAvatar = (_a) => {
789
- var _b = _a, { initials } = _b, props = __objRest2(_b, ["initials"]);
790
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials }, props), { children: initials }));
791
- };
792
- DefaultAvatar.defaultProps = {
793
- size: "24px",
794
- initials: "AA"
794
+ var _b = _a, { initials = "AA", size = "24px" } = _b, props = __objRest2(_b, ["initials", "size"]);
795
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials, size }, props), { children: initials }));
795
796
  };
796
797
  var DefaultAvatar_default = DefaultAvatar;
798
+ var import_react26 = __toESM2(require("react"));
799
+ var import_jsx_runtime26 = require("react/jsx-runtime");
800
+ var IconsWrapper = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "r-reset r-categories-icons-wrapper", children: [
801
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
802
+ "img",
803
+ {
804
+ style: {
805
+ color: "#fff",
806
+ width: "24px",
807
+ height: "24px",
808
+ filter: "invert(1)"
809
+ },
810
+ alt: "directions",
811
+ src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZ3JpZCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjciIGhlaWdodD0iNyI+PC9yZWN0PjxyZWN0IHg9IjE0IiB5PSIzIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMTQiIHk9IjE0IiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMyIgeT0iMTQiIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjwvcmVjdD48L3N2Zz4="
812
+ }
813
+ ),
814
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
815
+ "img",
816
+ {
817
+ className: "r-reset r-category-chevron",
818
+ alt: "directions",
819
+ src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAyMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxIDExLjVMMTEgMS41TDEgMTEuNSIgc3Ryb2tlPSIjMEMwQTA5IiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="
820
+ }
821
+ )
822
+ ] });
823
+ var Title2 = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-categories-title", children: "Categories" });
824
+ var CategoriesInner = (_a) => {
825
+ var props = __objRest2(_a, []);
826
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadProps2(__spreadValues2({}, props), { className: "r-reset r-categories-inner" }));
827
+ };
828
+ var CategoriesHiddenMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-reset r-categories-hidden-menu", children: paths.map(({ title, link }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: link, className: "r-reset r-category-link", children: title })) });
829
+ var CategoriesMenuWrapper = (_a) => {
830
+ var props = __objRest2(_a, []);
831
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadValues2({ className: "r-reset r-categories-menu" }, props));
832
+ };
833
+ var CategoriesMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesMenuWrapper, { children: [
834
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesInner, { children: [
835
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconsWrapper, {}),
836
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Title2, {})
837
+ ] }),
838
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CategoriesHiddenMenu, { paths })
839
+ ] });
840
+ var CategoriesMenu_default = CategoriesMenu;
797
841
  }
798
842
  });
799
843
 
@@ -6354,11 +6398,14 @@ var require_dist2 = __commonJS({
6354
6398
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
6355
6399
  var src_exports2 = {};
6356
6400
  __export2(src_exports2, {
6401
+ AdminPageRender: () => AdminPageRender_default,
6357
6402
  Container: () => Container_default,
6358
6403
  EmbeddedVideo: () => EmbeddedVideo_default,
6359
6404
  Image: () => Image_default,
6405
+ extractImageValue: () => extractImageValue_default,
6360
6406
  imagePlaceholder: () => imagePlaceholder_default,
6361
6407
  imageSrc: () => imageSrc_default,
6408
+ isImagePresent: () => isImagePresent_default,
6362
6409
  toHTML: () => toHTML_default
6363
6410
  });
6364
6411
  module2.exports = __toCommonJS2(src_exports2);
@@ -6374,8 +6421,8 @@ var require_dist2 = __commonJS({
6374
6421
  var getDimensions = (src, variant) => {
6375
6422
  var _a, _b, _c;
6376
6423
  if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
6377
- const width = src.width;
6378
- const height = src.height;
6424
+ const width = src.width || null;
6425
+ const height = src.height || null;
6379
6426
  return [width, height];
6380
6427
  }
6381
6428
  if (typeof src === "object") {
@@ -6421,7 +6468,7 @@ var require_dist2 = __commonJS({
6421
6468
  return value;
6422
6469
  };
6423
6470
  var Image3 = (_a) => {
6424
- var _b = _a, { variant, src, alt, loading } = _b, props = __objRest2(_b, ["variant", "src", "alt", "loading"]);
6471
+ var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest2(_b, ["variant", "src", "alt", "loading"]);
6425
6472
  if (!variant) {
6426
6473
  console.error("Image with no variant", { variant, src, alt, props });
6427
6474
  return null;
@@ -6453,9 +6500,6 @@ var require_dist2 = __commonJS({
6453
6500
  )
6454
6501
  ] });
6455
6502
  };
6456
- Image3.defaultProps = {
6457
- loading: "lazy"
6458
- };
6459
6503
  var Image_default = Image3;
6460
6504
  var imageSrc = (src, variant) => {
6461
6505
  if (typeof src === "object" && !("name" in src))
@@ -6631,6 +6675,257 @@ var require_dist2 = __commonJS({
6631
6675
  return inline ? parser.renderInline(string) : parser.render(string);
6632
6676
  };
6633
6677
  var toHTML_default = toHTML;
6678
+ function isImagePresent(value) {
6679
+ if (!value) {
6680
+ return false;
6681
+ }
6682
+ if (value.hasOwnProperty("image")) {
6683
+ return !!value.image;
6684
+ }
6685
+ if (typeof value === "string" && value) {
6686
+ return true;
6687
+ }
6688
+ return !!value;
6689
+ }
6690
+ var isImagePresent_default = isImagePresent;
6691
+ var import_react62 = __toESM2(require("react"));
6692
+ var import_react52 = __toESM2(require("react"));
6693
+ var import_react42 = __toESM2(require("react"));
6694
+ var import_jsx_runtime42 = require("react/jsx-runtime");
6695
+ var ICON_COPY = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY29weSI+PHJlY3QgeD0iOSIgeT0iOSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEzIiByeD0iMiIgcnk9IjIiPjwvcmVjdD48cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+PC9zdmc+";
6696
+ var IconButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6697
+ "button",
6698
+ __spreadValues2({
6699
+ type: "button",
6700
+ style: {
6701
+ display: "inline-block",
6702
+ width: "32px",
6703
+ height: "32px",
6704
+ marginRight: "4px",
6705
+ marginLeft: "0px",
6706
+ appearance: "none",
6707
+ outline: "0",
6708
+ border: "0",
6709
+ borderRadius: "3px",
6710
+ background: "transparent",
6711
+ backgroundColor: "#fff",
6712
+ backgroundRepeat: "no-repeat",
6713
+ backgroundPosition: "center",
6714
+ backgroundSize: "50%",
6715
+ backgroundImage: `url(${ICON_COPY})`,
6716
+ cursor: "pointer"
6717
+ }
6718
+ }, props)
6719
+ );
6720
+ var IconButton_default = IconButton;
6721
+ var import_jsx_runtime52 = require("react/jsx-runtime");
6722
+ function cn7() {
6723
+ return Array.from(arguments).filter(Boolean).map(String).join(" ");
6724
+ }
6725
+ var AdminWidgetWrapper = (_a) => {
6726
+ var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
6727
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", __spreadValues2({ className: cn7("r-admin-widget-wrapper", className) }, rest));
6728
+ };
6729
+ var AdminWidgetToolbar = (_a) => {
6730
+ var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
6731
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6732
+ "div",
6733
+ __spreadValues2({
6734
+ className: cn7("r-reset", "r-admin-widget-toolbar", className)
6735
+ }, rest)
6736
+ );
6737
+ };
6738
+ var AdminWidgetLabel = (_a) => {
6739
+ var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
6740
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6741
+ "div",
6742
+ __spreadValues2({
6743
+ className: cn7("r-reset", "r-fs-small", "r-admin-widget-label", className)
6744
+ }, rest)
6745
+ );
6746
+ };
6747
+ var title = (widget) => {
6748
+ return widget.Config.title;
6749
+ };
6750
+ var deprecated = (widget) => {
6751
+ return widget.Config.deprecated;
6752
+ };
6753
+ var AdminWidgetMinimal = ({
6754
+ library,
6755
+ adminLibrary,
6756
+ widget,
6757
+ onCopy,
6758
+ onSelectWidget,
6759
+ selectedWidgets
6760
+ }) => {
6761
+ var _a;
6762
+ const currentWidget = library[widget.component];
6763
+ const currentAdminWidget = adminLibrary[widget.component];
6764
+ const containerSettings = ((_a = widget == null ? void 0 : widget.settings) == null ? void 0 : _a.containerSettings) || {};
6765
+ const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
6766
+ if (!currentWidget || !currentAdminWidget) {
6767
+ console.error(`Unknown widget: ${widget.component}`);
6768
+ return null;
6769
+ }
6770
+ const handleCopyWidget = () => {
6771
+ const widgetsToCopy = [widget];
6772
+ onCopy(widgetsToCopy);
6773
+ };
6774
+ const handleSelectWidget = () => onSelectWidget(widget.widgetId);
6775
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(AdminWidgetWrapper, { "data-widget": widget.component, children: [
6776
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "r-selected-widget" }),
6777
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(AdminWidgetToolbar, { "data-toolbar": true, children: [
6778
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6779
+ "input",
6780
+ {
6781
+ type: "checkbox",
6782
+ style: {
6783
+ width: "32px",
6784
+ height: "32px"
6785
+ },
6786
+ onChange: handleSelectWidget,
6787
+ checked: isSelected
6788
+ }
6789
+ ),
6790
+ !isSelected && !deprecated(currentAdminWidget) && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconButton_default, { onClick: handleCopyWidget })
6791
+ ] }),
6792
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AdminWidgetLabel, { "data-widget-label": true, children: title(currentAdminWidget) }),
6793
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Container_default, { settings: containerSettings, children: import_react52.default.createElement(currentWidget, widget.settings) })
6794
+ ] });
6795
+ };
6796
+ var AdminWidgetMinimal_default = AdminWidgetMinimal;
6797
+ var import_jsx_runtime62 = require("react/jsx-runtime");
6798
+ var IconCopy = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
6799
+ "svg",
6800
+ {
6801
+ xmlns: "http://www.w3.org/2000/svg",
6802
+ width: "16",
6803
+ height: "16",
6804
+ viewBox: "0 0 16 16",
6805
+ fill: "none",
6806
+ children: [
6807
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("g", { clipPath: "url(#clip0_2312_498)", children: [
6808
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6809
+ "path",
6810
+ {
6811
+ 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",
6812
+ stroke: "white",
6813
+ strokeWidth: "2",
6814
+ strokeLinecap: "round",
6815
+ strokeLinejoin: "round"
6816
+ }
6817
+ ),
6818
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6819
+ "path",
6820
+ {
6821
+ 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",
6822
+ stroke: "white",
6823
+ strokeWidth: "2",
6824
+ strokeLinecap: "round",
6825
+ strokeLinejoin: "round"
6826
+ }
6827
+ )
6828
+ ] }),
6829
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("clipPath", { id: "clip0_2312_498", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
6830
+ ]
6831
+ }
6832
+ );
6833
+ var SelectedWidgetsToolbar = ({ length, onCopy }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "r-selected-widgets-toolbar", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "r-toolbar-inner", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
6834
+ "button",
6835
+ {
6836
+ type: "button",
6837
+ className: "r-button-reset r-toolbar-button",
6838
+ onClick: onCopy,
6839
+ children: [
6840
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IconCopy, {}),
6841
+ "Copy selected (",
6842
+ length,
6843
+ ")"
6844
+ ]
6845
+ }
6846
+ ) }) });
6847
+ var SelectedWidgetsToolbar_default = SelectedWidgetsToolbar;
6848
+ var import_jsx_runtime72 = require("react/jsx-runtime");
6849
+ var saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
6850
+ `clipboard\u2013${identifier}`,
6851
+ JSON.stringify(widgets)
6852
+ );
6853
+ var AdminPageRender = ({
6854
+ page,
6855
+ library,
6856
+ adminLibrary,
6857
+ identifier,
6858
+ detailPath,
6859
+ canvasClassName = ""
6860
+ }) => {
6861
+ const [selectedWidgets, setSelectedWidgets] = import_react62.default.useState([]);
6862
+ const areAllSelected = selectedWidgets.length === page.widgets.length;
6863
+ const handleSelectWidget = (newWidget) => {
6864
+ setSelectedWidgets((oldList) => {
6865
+ const isUnique = oldList.filter((w) => w === newWidget).length <= 0;
6866
+ if (isUnique) {
6867
+ return [...oldList, newWidget];
6868
+ } else {
6869
+ return oldList.filter((w) => w !== newWidget);
6870
+ }
6871
+ });
6872
+ };
6873
+ const handleCopyWidgets = (widgets, copyType) => {
6874
+ if (copyType === "multiple") {
6875
+ const filterSelected = page.widgets.filter(
6876
+ (w) => widgets.some((c) => w.widgetId === c)
6877
+ );
6878
+ saveToLocalStorage(identifier, filterSelected);
6879
+ setSelectedWidgets([]);
6880
+ return;
6881
+ }
6882
+ saveToLocalStorage(identifier, widgets);
6883
+ };
6884
+ const handleSelectAll = () => {
6885
+ if (areAllSelected)
6886
+ return setSelectedWidgets([]);
6887
+ setSelectedWidgets(page.widgets.map((w) => w.widgetId));
6888
+ };
6889
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_react62.default.Fragment, { children: [
6890
+ selectedWidgets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6891
+ SelectedWidgetsToolbar_default,
6892
+ {
6893
+ length: selectedWidgets.length,
6894
+ onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
6895
+ }
6896
+ ),
6897
+ page.widgets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6898
+ "button",
6899
+ {
6900
+ className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
6901
+ type: "button",
6902
+ title: "Select all (or Deselect all)",
6903
+ onClick: () => handleSelectAll()
6904
+ }
6905
+ ),
6906
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
6907
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: canvasClassName, children: page.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6908
+ AdminWidgetMinimal_default,
6909
+ {
6910
+ library,
6911
+ adminLibrary,
6912
+ widget: { widgetId, component, settings },
6913
+ onCopy: handleCopyWidgets,
6914
+ onSelectWidget: handleSelectWidget,
6915
+ selectedWidgets
6916
+ },
6917
+ widgetId
6918
+ )) })
6919
+ ] });
6920
+ };
6921
+ var AdminPageRender_default = AdminPageRender;
6922
+ function extractImageValue(value) {
6923
+ if (!value) {
6924
+ return null;
6925
+ }
6926
+ return value.hasOwnProperty("image") ? value.image : value;
6927
+ }
6928
+ var extractImageValue_default = extractImageValue;
6634
6929
  }
6635
6930
  });
6636
6931
 
@@ -6687,7 +6982,7 @@ var TextField = (props) => {
6687
6982
  hint ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.P, { children: hint }) : ""
6688
6983
  ] });
6689
6984
  };
6690
- var TextInput = ({ label, onChange, value, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
6985
+ var TextInput = ({ label, onChange, value = "", placeholder = "" }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
6691
6986
  TextField,
6692
6987
  {
6693
6988
  label,
@@ -6696,10 +6991,6 @@ var TextInput = ({ label, onChange, value, placeholder }) => /* @__PURE__ */ (0,
6696
6991
  onChange
6697
6992
  }
6698
6993
  );
6699
- TextInput.defaultProps = {
6700
- value: "",
6701
- placeholder: ""
6702
- };
6703
6994
  var TextInput_default = TextInput;
6704
6995
 
6705
6996
  // src/dialogs/Dialog.js
@@ -6738,10 +7029,6 @@ var Dialog = ({
6738
7029
  secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Button, { type: "button", variant: "secondary", onClick: onClose, children: secondaryLabel })
6739
7030
  ] })
6740
7031
  ] });
6741
- Dialog.defaultProps = {
6742
- children: [],
6743
- dialogSize: ""
6744
- };
6745
7032
  var Dialog_default = Dialog;
6746
7033
 
6747
7034
  // src/pickers/ImagePicker/BrowseTab.js
@@ -6953,7 +7240,7 @@ var DropzoneLabel = (_a) => {
6953
7240
  }, rest)
6954
7241
  );
6955
7242
  };
6956
- var Dropbox = ({ buttonLabel, onDrop }) => {
7243
+ var Dropbox = ({ buttonLabel = "Select files...", onDrop }) => {
6957
7244
  const dropzoneRef = import_react4.default.createRef();
6958
7245
  const handleOpen = () => dropzoneRef.current.open();
6959
7246
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react4.default.Fragment, { children: [
@@ -6974,7 +7261,6 @@ var Dropbox = ({ buttonLabel, onDrop }) => {
6974
7261
  )
6975
7262
  ] });
6976
7263
  };
6977
- Dropbox.defaultProps = { buttonLabel: "Select files..." };
6978
7264
  var Dropbox_default = Dropbox;
6979
7265
 
6980
7266
  // src/lib/ProgressBar.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/image-input",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -44,9 +44,4 @@ const Dialog = ({
44
44
  </Modal>
45
45
  );
46
46
 
47
- Dialog.defaultProps = {
48
- children: [],
49
- dialogSize: "",
50
- };
51
-
52
47
  export default Dialog;
@@ -33,7 +33,7 @@ const TextField = (props) => {
33
33
  );
34
34
  };
35
35
 
36
- const TextInput = ({ label, onChange, value, placeholder }) => (
36
+ const TextInput = ({ label, onChange, value = "", placeholder = "" }) => (
37
37
  <TextField
38
38
  label={label}
39
39
  value={value}
@@ -42,9 +42,4 @@ const TextInput = ({ label, onChange, value, placeholder }) => (
42
42
  />
43
43
  );
44
44
 
45
- TextInput.defaultProps = {
46
- value: "",
47
- placeholder: "",
48
- };
49
-
50
45
  export default TextInput;
@@ -17,7 +17,7 @@ const DropzoneLabel = ({ className, ...rest }) => (
17
17
  />
18
18
  );
19
19
 
20
- const Dropbox = ({ buttonLabel, onDrop }) => {
20
+ const Dropbox = ({ buttonLabel = "Select files...", onDrop }) => {
21
21
  const dropzoneRef = React.createRef();
22
22
 
23
23
  const handleOpen = () => dropzoneRef.current.open();
@@ -48,6 +48,4 @@ const Dropbox = ({ buttonLabel, onDrop }) => {
48
48
  );
49
49
  };
50
50
 
51
- Dropbox.defaultProps = { buttonLabel: "Select files..." };
52
-
53
51
  export default Dropbox;