@raketa-builder/builder 0.38.0 → 0.39.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/builder@0.38.0 build
2
+ > @raketa-builder/builder@0.39.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 374.09 KB
11
- CJS ⚡️ Build success in 261ms
10
+ CJS dist/index.js 376.46 KB
11
+ CJS ⚡️ Build success in 290ms
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_default2,
117
+ CategoriesMenu: () => CategoriesMenu_default,
117
118
  Col: () => Col,
118
119
  Container: () => Container_default,
119
120
  DataGrid: () => DataGrid_default,
@@ -156,7 +157,7 @@ var require_dist = __commonJS({
156
157
  var xlarge = large * fraction;
157
158
  var xxlarge = xlarge * fraction;
158
159
  var huge = xxlarge * fraction;
159
- var theme2 = {
160
+ var theme = {
160
161
  font: {
161
162
  tiny: `${tiny}px`,
162
163
  small: `${small}px`,
@@ -193,15 +194,15 @@ var require_dist = __commonJS({
193
194
  dangerLight: "#e34850"
194
195
  }
195
196
  };
196
- var theme_default = theme2;
197
+ var theme_default = theme;
197
198
  var import_react32 = __toESM2(require("react"));
198
199
  function cn13() {
199
200
  return Array.from(arguments).filter(Boolean).map(String).join(" ");
200
201
  }
201
- var import_jsx_runtime34 = require("react/jsx-runtime");
202
+ var import_jsx_runtime33 = require("react/jsx-runtime");
202
203
  var H5 = (_a) => {
203
204
  var _b = _a, { size = "base", className = "" } = _b, props = __objRest2(_b, ["size", "className"]);
204
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
205
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
205
206
  "div",
206
207
  __spreadValues2({
207
208
  className: cn13("r-reset", "r-heading", `r-fs-${size}`, className)
@@ -217,11 +218,23 @@ var require_dist = __commonJS({
217
218
  };
218
219
  var P_default = P4;
219
220
  var import_react33 = __toESM2(require("react"));
220
- var import_jsx_runtime35 = require("react/jsx-runtime");
221
+ var import_jsx_runtime34 = 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 Component2 = as;
224
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
237
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
225
238
  Component2,
226
239
  __spreadValues2({
227
240
  className: cn13(
@@ -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_react242 = __toESM2(require("react"));
731
739
  var import_jsx_runtime242 = 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_runtime242.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_react252 = __toESM2(require("react"));
751
756
  var import_jsx_runtime252 = 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_runtime252.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_runtime252.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials, size }, props), { children: initials }));
795
796
  };
796
797
  var DefaultAvatar_default = DefaultAvatar;
798
+ var import_react262 = __toESM2(require("react"));
799
+ var import_jsx_runtime262 = require("react/jsx-runtime");
800
+ var IconsWrapper = () => /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)("div", { className: "r-reset r-categories-icons-wrapper", children: [
801
+ /* @__PURE__ */ (0, import_jsx_runtime262.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_runtime262.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 Title22 = () => /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "r-categories-title", children: "Categories" });
824
+ var CategoriesInner = (_a) => {
825
+ var props = __objRest2(_a, []);
826
+ return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", __spreadProps2(__spreadValues2({}, props), { className: "r-reset r-categories-inner" }));
827
+ };
828
+ var CategoriesHiddenMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "r-reset r-categories-hidden-menu", children: paths.map(({ title: title2, link }) => /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("a", { href: link, className: "r-reset r-category-link", children: title2 })) });
829
+ var CategoriesMenuWrapper = (_a) => {
830
+ var props = __objRest2(_a, []);
831
+ return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", __spreadValues2({ className: "r-reset r-categories-menu" }, props));
832
+ };
833
+ var CategoriesMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(CategoriesMenuWrapper, { children: [
834
+ /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(CategoriesInner, { children: [
835
+ /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(IconsWrapper, {}),
836
+ /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Title22, {})
837
+ ] }),
838
+ /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(CategoriesHiddenMenu, { paths })
839
+ ] });
840
+ var CategoriesMenu_default = CategoriesMenu;
797
841
  }
798
842
  });
799
843
 
@@ -6366,7 +6410,7 @@ var require_dist2 = __commonJS({
6366
6410
  });
6367
6411
  module2.exports = __toCommonJS2(src_exports2);
6368
6412
  var import_react32 = __toESM2(require("react"));
6369
- var import_jsx_runtime34 = require("react/jsx-runtime");
6413
+ var import_jsx_runtime33 = require("react/jsx-runtime");
6370
6414
  var getWebp2 = (url) => {
6371
6415
  if (!url)
6372
6416
  return null;
@@ -6377,8 +6421,8 @@ var require_dist2 = __commonJS({
6377
6421
  var getDimensions2 = (src, variant) => {
6378
6422
  var _a, _b, _c;
6379
6423
  if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
6380
- const width = src.width;
6381
- const height = src.height;
6424
+ const width = src.width || null;
6425
+ const height = src.height || null;
6382
6426
  return [width, height];
6383
6427
  }
6384
6428
  if (typeof src === "object") {
@@ -6424,7 +6468,7 @@ var require_dist2 = __commonJS({
6424
6468
  return value;
6425
6469
  };
6426
6470
  var Image2 = (_a) => {
6427
- 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"]);
6428
6472
  if (!variant) {
6429
6473
  console.error("Image with no variant", { variant, src, alt, props });
6430
6474
  return null;
@@ -6441,10 +6485,10 @@ var require_dist2 = __commonJS({
6441
6485
  const [width, height] = getDimensions2(imageObjOrSrc, variant);
6442
6486
  const altAttr = alt || getAlt2(src);
6443
6487
  const [webp, fallback] = getSrc2(imageObjOrSrc, variant);
6444
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("picture", { children: [
6445
- webp && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("source", { srcSet: encodeURI(webp), type: "image/webp" }),
6446
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
6447
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6488
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("picture", { children: [
6489
+ webp && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("source", { srcSet: encodeURI(webp), type: "image/webp" }),
6490
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
6491
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6448
6492
  "img",
6449
6493
  __spreadValues2({
6450
6494
  src: fallback,
@@ -6456,9 +6500,6 @@ var require_dist2 = __commonJS({
6456
6500
  )
6457
6501
  ] });
6458
6502
  };
6459
- Image2.defaultProps = {
6460
- loading: "lazy"
6461
- };
6462
6503
  var Image_default2 = Image2;
6463
6504
  var imageSrc = (src, variant) => {
6464
6505
  if (typeof src === "object" && !("name" in src))
@@ -6485,8 +6526,8 @@ var require_dist2 = __commonJS({
6485
6526
  };
6486
6527
  var Container_default = Container2;
6487
6528
  var import_react33 = __toESM2(require("react"));
6488
- var import_jsx_runtime35 = require("react/jsx-runtime");
6489
- var VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6529
+ var import_jsx_runtime34 = require("react/jsx-runtime");
6530
+ var VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6490
6531
  "iframe",
6491
6532
  {
6492
6533
  frameBorder: "0",
@@ -6496,7 +6537,7 @@ var require_dist2 = __commonJS({
6496
6537
  allow: "autoplay"
6497
6538
  }
6498
6539
  );
6499
- var YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6540
+ var YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6500
6541
  "iframe",
6501
6542
  {
6502
6543
  height: "0",
@@ -6508,7 +6549,7 @@ var require_dist2 = __commonJS({
6508
6549
  allow: "autoplay"
6509
6550
  }
6510
6551
  );
6511
- var YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6552
+ var YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6512
6553
  "iframe",
6513
6554
  {
6514
6555
  frameBorder: "0",
@@ -6518,7 +6559,7 @@ var require_dist2 = __commonJS({
6518
6559
  allow: "autoplay"
6519
6560
  }
6520
6561
  );
6521
- var YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6562
+ var YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6522
6563
  "iframe",
6523
6564
  {
6524
6565
  frameBorder: "0",
@@ -6528,7 +6569,7 @@ var require_dist2 = __commonJS({
6528
6569
  allow: "autoplay"
6529
6570
  }
6530
6571
  );
6531
- var WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6572
+ var WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6532
6573
  "iframe",
6533
6574
  {
6534
6575
  frameBorder: "0",
@@ -6613,7 +6654,7 @@ var require_dist2 = __commonJS({
6613
6654
  const vId = videoId(videoUrl);
6614
6655
  const VideoComponent = VideoComponentType(vType, noCookieDomains);
6615
6656
  if (VideoComponent) {
6616
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VideoComponent, { videoId: vId, autoplay });
6657
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VideoComponent, { videoId: vId, autoplay });
6617
6658
  }
6618
6659
  return null;
6619
6660
  };
@@ -6752,9 +6793,6 @@ var require_dist2 = __commonJS({
6752
6793
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Container_default, { settings: containerSettings, children: import_react52.default.createElement(currentWidget, widget.settings) })
6753
6794
  ] });
6754
6795
  };
6755
- AdminWidgetMinimal.defaultProps = {
6756
- containerSettings: {}
6757
- };
6758
6796
  var AdminWidgetMinimal_default = AdminWidgetMinimal;
6759
6797
  var import_jsx_runtime62 = require("react/jsx-runtime");
6760
6798
  var IconCopy2 = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
@@ -6909,12 +6947,10 @@ __export(src_exports, {
6909
6947
  ListInput: () => ListInput_default,
6910
6948
  MediaManager: () => MediaManager,
6911
6949
  PageBuilder: () => PageBuilder_default,
6912
- RaketaUIProvider: () => RaketaUIProvider,
6913
6950
  RichText: () => RichText_default,
6914
6951
  SelectMenu: () => SelectMenu_default,
6915
6952
  TextArea: () => TextArea_default,
6916
- TextInput: () => TextInput_default,
6917
- theme: () => theme
6953
+ TextInput: () => TextInput_default
6918
6954
  });
6919
6955
  module.exports = __toCommonJS(src_exports);
6920
6956
  var import_react31 = __toESM(require("react"));
@@ -7163,9 +7199,6 @@ var AdminWidget = ({
7163
7199
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_support.Container, { settings: containerSettings, children: import_react4.default.createElement(currentWidget, widget.settings) })
7164
7200
  ] });
7165
7201
  };
7166
- AdminWidget.defaultProps = {
7167
- containerSettings: {}
7168
- };
7169
7202
  var AdminWidget_default = AdminWidget;
7170
7203
 
7171
7204
  // src/ErrorBoundary/ErrorBoundary.js
@@ -7476,20 +7509,40 @@ var import_react9 = __toESM(require("react"));
7476
7509
  var import_ui8 = __toESM(require_dist());
7477
7510
  var import_jsx_runtime10 = require("react/jsx-runtime");
7478
7511
  var TextField = (_a) => {
7479
- var _b = _a, { label, hint, multiline, error, onChange } = _b, rest = __objRest(_b, ["label", "hint", "multiline", "error", "onChange"]);
7512
+ var _b = _a, {
7513
+ label,
7514
+ hint,
7515
+ multiline,
7516
+ error,
7517
+ onChange,
7518
+ value = "",
7519
+ placeholder = ""
7520
+ } = _b, rest = __objRest(_b, [
7521
+ "label",
7522
+ "hint",
7523
+ "multiline",
7524
+ "error",
7525
+ "onChange",
7526
+ "value",
7527
+ "placeholder"
7528
+ ]);
7480
7529
  const id = randomString();
7481
7530
  const Component2 = multiline ? import_ui8.Textarea : import_ui8.Input;
7482
7531
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ui8.FormGroup, { children: [
7483
7532
  label ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui8.Label, { htmlFor: id, error, children: label }) : "",
7484
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Component2, __spreadValues({ id, onChange: (e) => onChange(e.target.value) }, rest)),
7533
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
7534
+ Component2,
7535
+ __spreadValues({
7536
+ id,
7537
+ onChange: (e) => onChange(e.target.value),
7538
+ value,
7539
+ placeholder
7540
+ }, rest)
7541
+ ),
7485
7542
  hint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui8.Hint, { children: hint }) : ""
7486
7543
  ] });
7487
7544
  };
7488
7545
  var TextInput = (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextField, __spreadValues({}, props));
7489
- TextInput.defaultProps = {
7490
- value: "",
7491
- placeholder: ""
7492
- };
7493
7546
  var TextInput_default = TextInput;
7494
7547
 
7495
7548
  // src/lib/AdminSidebar.js
@@ -7652,7 +7705,7 @@ var Dialog = ({
7652
7705
  open,
7653
7706
  onClose,
7654
7707
  title: title2,
7655
- children,
7708
+ children = [],
7656
7709
  primaryLabel,
7657
7710
  secondaryLabel = "Cancel",
7658
7711
  onPrimary
@@ -7663,9 +7716,6 @@ var Dialog = ({
7663
7716
  secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui10.Button, { type: "button", variant: "secondary", onClick: onClose, children: secondaryLabel })
7664
7717
  ] })
7665
7718
  ] });
7666
- Dialog.defaultProps = {
7667
- children: []
7668
- };
7669
7719
  var Dialog_default = Dialog;
7670
7720
 
7671
7721
  // src/lib/ModalSelectedWidgetsToolbar.js
@@ -7758,7 +7808,7 @@ var getWidgetTitle = (library, widget) => {
7758
7808
  return [widgetName, widgetTitle].filter((s) => s !== "").join(": ");
7759
7809
  };
7760
7810
  var ReorderDialog = ({
7761
- widgets,
7811
+ widgets = [],
7762
7812
  onClose,
7763
7813
  onChange,
7764
7814
  onDelete,
@@ -7885,9 +7935,6 @@ var ReorderDialog = ({
7885
7935
  }
7886
7936
  );
7887
7937
  };
7888
- ReorderDialog.defaultProps = {
7889
- widgets: []
7890
- };
7891
7938
  var ReorderDialog_default = ReorderDialog;
7892
7939
 
7893
7940
  // src/dialogs/SettingsDialog.js
@@ -7905,11 +7952,10 @@ var BuilderContext_default = BuilderContext;
7905
7952
  // src/forms/TextArea.js
7906
7953
  var import_react15 = __toESM(require("react"));
7907
7954
  var import_jsx_runtime15 = require("react/jsx-runtime");
7908
- var TextArea = (props) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TextInput_default, __spreadValues({ multiline: true }, props));
7909
- TextArea.defaultProps = {
7910
- value: "",
7911
- placeholder: ""
7912
- };
7955
+ function TextArea(_a) {
7956
+ var _b = _a, { value = "", placeholder = "" } = _b, rest = __objRest(_b, ["value", "placeholder"]);
7957
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TextInput_default, __spreadValues({ multiline: true, value, placeholder }, rest));
7958
+ }
7913
7959
  var TextArea_default = TextArea;
7914
7960
 
7915
7961
  // src/forms/RichText.js
@@ -7959,7 +8005,13 @@ var SelectField = (props) => {
7959
8005
  hint ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui12.Hint, { children: hint }) : ""
7960
8006
  ] });
7961
8007
  };
7962
- var SelectMenu = ({ label, options, placeholder, onChange, value }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8008
+ var SelectMenu = ({
8009
+ label,
8010
+ options,
8011
+ placeholder = "Please select...",
8012
+ onChange,
8013
+ value = ""
8014
+ }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7963
8015
  SelectField,
7964
8016
  {
7965
8017
  label,
@@ -7968,10 +8020,6 @@ var SelectMenu = ({ label, options, placeholder, onChange, value }) => /* @__PUR
7968
8020
  onChange
7969
8021
  }
7970
8022
  );
7971
- SelectMenu.defaultProps = {
7972
- value: "",
7973
- placeholder: "Please select..."
7974
- };
7975
8023
  var SelectMenu_default = SelectMenu;
7976
8024
 
7977
8025
  // src/forms/ButtonSettings.js
@@ -8005,7 +8053,20 @@ var DEFAULT_BUTTON_STYLES = [
8005
8053
  ["text", "Text"]
8006
8054
  ];
8007
8055
  var mergeSettings = (settings, key, value) => Object.assign({}, settings, { [key]: value });
8008
- var ButtonSettings = ({ label, hint, value, onChange }) => {
8056
+ var DEFAULTS = {
8057
+ label: "Button",
8058
+ link: "#",
8059
+ id: "",
8060
+ type: "primary",
8061
+ target: "_self",
8062
+ rel: "follow"
8063
+ };
8064
+ var ButtonSettings = ({
8065
+ label = "Button",
8066
+ hint,
8067
+ value = DEFAULTS,
8068
+ onChange
8069
+ }) => {
8009
8070
  const { buttonStyles } = import_react18.default.useContext(BuilderContext_default) || DEFAULT_BUTTON_STYLES;
8010
8071
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ButtonControl, { children: [
8011
8072
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(FormSectionTitle, { children: [
@@ -8077,18 +8138,6 @@ var ButtonSettings = ({ label, hint, value, onChange }) => {
8077
8138
  hint ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui13.Hint, { children: hint }) : ""
8078
8139
  ] });
8079
8140
  };
8080
- var DEFAULTS = {
8081
- label: "Button",
8082
- link: "#",
8083
- id: "",
8084
- type: "primary",
8085
- target: "_self",
8086
- rel: "follow"
8087
- };
8088
- ButtonSettings.defaultProps = {
8089
- label: "Button",
8090
- value: DEFAULTS
8091
- };
8092
8141
  ButtonSettings.defaults = DEFAULTS;
8093
8142
  ButtonSettings.defaultButtonStyles = DEFAULT_BUTTON_STYLES;
8094
8143
  var ButtonSettings_default = ButtonSettings;
@@ -8733,7 +8782,8 @@ var getImageObjOrSrc = (value) => {
8733
8782
  return value;
8734
8783
  };
8735
8784
  var Image = (_a) => {
8736
- var _b = _a, { variant, src, alt, loading } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
8785
+ var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
8786
+ console.log(props);
8737
8787
  if (!variant) {
8738
8788
  console.error("Image with no variant", { variant, src, alt, props });
8739
8789
  return null;
@@ -8765,9 +8815,6 @@ var Image = (_a) => {
8765
8815
  )
8766
8816
  ] });
8767
8817
  };
8768
- Image.defaultProps = {
8769
- loading: "lazy"
8770
- };
8771
8818
  var Image_default = Image;
8772
8819
 
8773
8820
  // src/List.js
@@ -8930,7 +8977,7 @@ var Item = ({
8930
8977
  };
8931
8978
  var List = ({
8932
8979
  label,
8933
- items: defaultItems,
8980
+ items: defaultItems = [],
8934
8981
  listItem,
8935
8982
  template,
8936
8983
  primaryField: primaryField2,
@@ -9025,9 +9072,6 @@ var List = ({
9025
9072
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui15.Button, { type: "button", variant: "success", onClick: handleAdd, children: "Add item" })
9026
9073
  ] });
9027
9074
  };
9028
- List.defaultProps = {
9029
- items: []
9030
- };
9031
9075
  var List_default = List;
9032
9076
 
9033
9077
  // src/MediaManager.js
@@ -9114,7 +9158,15 @@ var ButtonControl2 = (_a) => {
9114
9158
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-reset", "r-button-control", className) }, props));
9115
9159
  };
9116
9160
  var mergeSettings2 = (settings, key, value) => Object.assign({}, settings, { [key]: value });
9117
- var LinkSettings = ({ label, hint, value, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ButtonControl2, { children: [
9161
+ var DEFAULTS2 = {
9162
+ label: "link",
9163
+ link: "#",
9164
+ id: "",
9165
+ className: "",
9166
+ target: "_self",
9167
+ rel: "follow"
9168
+ };
9169
+ var LinkSettings = ({ label = "Link", hint, value = DEFAULTS2, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ButtonControl2, { children: [
9118
9170
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(FormSectionTitle2, { children: [
9119
9171
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SettingsIcon2, {}),
9120
9172
  " ",
@@ -9182,18 +9234,6 @@ var LinkSettings = ({ label, hint, value, onChange }) => /* @__PURE__ */ (0, imp
9182
9234
  ] }),
9183
9235
  hint ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui17.Hint, { children: hint }) : ""
9184
9236
  ] });
9185
- var DEFAULTS2 = {
9186
- label: "link",
9187
- link: "#",
9188
- id: "",
9189
- className: "",
9190
- target: "_self",
9191
- rel: "follow"
9192
- };
9193
- LinkSettings.defaultProps = {
9194
- label: "Link ",
9195
- value: DEFAULTS2
9196
- };
9197
9237
  LinkSettings.defaults = DEFAULTS2;
9198
9238
  var LinkSettings_default = LinkSettings;
9199
9239
 
@@ -9215,14 +9255,6 @@ var Link = ({ settings, children, className }) => {
9215
9255
  );
9216
9256
  };
9217
9257
  var Link_default = Link;
9218
-
9219
- // src/index.js
9220
- var import_jsx_runtime33 = require("react/jsx-runtime");
9221
- var theme = {};
9222
- var RaketaUIProvider = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react31.default.Fragment, { children });
9223
- RaketaUIProvider.defaultProps = {
9224
- theme
9225
- };
9226
9258
  // Annotate the CommonJS export names for ESM import in node:
9227
9259
  0 && (module.exports = {
9228
9260
  BuilderContext,
@@ -9240,10 +9272,8 @@ RaketaUIProvider.defaultProps = {
9240
9272
  ListInput,
9241
9273
  MediaManager,
9242
9274
  PageBuilder,
9243
- RaketaUIProvider,
9244
9275
  RichText,
9245
9276
  SelectMenu,
9246
9277
  TextArea,
9247
- TextInput,
9248
- theme
9278
+ TextInput
9249
9279
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/builder",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
package/src/List.js CHANGED
@@ -173,7 +173,7 @@ const Item = ({
173
173
 
174
174
  const List = ({
175
175
  label,
176
- items: defaultItems,
176
+ items: defaultItems = [],
177
177
  listItem,
178
178
  template,
179
179
  primaryField,
@@ -299,8 +299,4 @@ const List = ({
299
299
  );
300
300
  };
301
301
 
302
- List.defaultProps = {
303
- items: [],
304
- };
305
-
306
302
  export default List;
@@ -13,7 +13,7 @@ const Dialog = ({
13
13
  open,
14
14
  onClose,
15
15
  title,
16
- children,
16
+ children = [],
17
17
  primaryLabel,
18
18
  secondaryLabel = "Cancel",
19
19
  onPrimary,
@@ -39,8 +39,4 @@ const Dialog = ({
39
39
  </Modal>
40
40
  );
41
41
 
42
- Dialog.defaultProps = {
43
- children: [],
44
- };
45
-
46
42
  export default Dialog;
@@ -43,7 +43,7 @@ const getWidgetTitle = (library, widget) => {
43
43
  };
44
44
 
45
45
  const ReorderDialog = ({
46
- widgets,
46
+ widgets = [],
47
47
  onClose,
48
48
  onChange,
49
49
  onDelete,
@@ -170,8 +170,4 @@ const ReorderDialog = ({
170
170
  );
171
171
  };
172
172
 
173
- ReorderDialog.defaultProps = {
174
- widgets: [],
175
- };
176
-
177
173
  export default ReorderDialog;
@@ -33,7 +33,21 @@ const DEFAULT_BUTTON_STYLES = [
33
33
  const mergeSettings = (settings, key, value) =>
34
34
  Object.assign({}, settings, { [key]: value });
35
35
 
36
- const ButtonSettings = ({ label, hint, value, onChange }) => {
36
+ const DEFAULTS = {
37
+ label: "Button",
38
+ link: "#",
39
+ id: "",
40
+ type: "primary",
41
+ target: "_self",
42
+ rel: "follow",
43
+ };
44
+
45
+ const ButtonSettings = ({
46
+ label = "Button",
47
+ hint,
48
+ value = DEFAULTS,
49
+ onChange,
50
+ }) => {
37
51
  const { buttonStyles } =
38
52
  React.useContext(BuilderContext) || DEFAULT_BUTTON_STYLES;
39
53
 
@@ -99,20 +113,6 @@ const ButtonSettings = ({ label, hint, value, onChange }) => {
99
113
  );
100
114
  };
101
115
 
102
- const DEFAULTS = {
103
- label: "Button",
104
- link: "#",
105
- id: "",
106
- type: "primary",
107
- target: "_self",
108
- rel: "follow",
109
- };
110
-
111
- ButtonSettings.defaultProps = {
112
- label: "Button",
113
- value: DEFAULTS,
114
- };
115
-
116
116
  ButtonSettings.defaults = DEFAULTS;
117
117
  ButtonSettings.defaultButtonStyles = DEFAULT_BUTTON_STYLES;
118
118
 
@@ -26,7 +26,16 @@ const ButtonControl = ({ className, ...props }) => (
26
26
  const mergeSettings = (settings, key, value) =>
27
27
  Object.assign({}, settings, { [key]: value });
28
28
 
29
- const LinkSettings = ({ label, hint, value, onChange }) => (
29
+ const DEFAULTS = {
30
+ label: "link",
31
+ link: "#",
32
+ id: "",
33
+ className: "",
34
+ target: "_self",
35
+ rel: "follow",
36
+ };
37
+
38
+ const LinkSettings = ({ label = "Link", hint, value = DEFAULTS, onChange }) => (
30
39
  <ButtonControl>
31
40
  <FormSectionTitle>
32
41
  <SettingsIcon /> {label}
@@ -86,20 +95,6 @@ const LinkSettings = ({ label, hint, value, onChange }) => (
86
95
  </ButtonControl>
87
96
  );
88
97
 
89
- const DEFAULTS = {
90
- label: "link",
91
- link: "#",
92
- id: "",
93
- className: "",
94
- target: "_self",
95
- rel: "follow",
96
- };
97
-
98
- LinkSettings.defaultProps = {
99
- label: "Link ",
100
- value: DEFAULTS,
101
- };
102
-
103
98
  LinkSettings.defaults = DEFAULTS;
104
99
 
105
100
  export default LinkSettings;
@@ -51,7 +51,13 @@ const SelectField = (props) => {
51
51
  );
52
52
  };
53
53
 
54
- const SelectMenu = ({ label, options, placeholder, onChange, value }) => (
54
+ const SelectMenu = ({
55
+ label,
56
+ options,
57
+ placeholder = "Please select...",
58
+ onChange,
59
+ value = "",
60
+ }) => (
55
61
  <SelectField
56
62
  label={label}
57
63
  options={getOptions(options, placeholder)}
@@ -60,9 +66,4 @@ const SelectMenu = ({ label, options, placeholder, onChange, value }) => (
60
66
  />
61
67
  );
62
68
 
63
- SelectMenu.defaultProps = {
64
- value: "",
65
- placeholder: "Please select...",
66
- };
67
-
68
69
  export default SelectMenu;
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
  import TextInput from "./TextInput";
3
3
 
4
- const TextArea = (props) => <TextInput multiline {...props} />;
5
-
6
- TextArea.defaultProps = {
7
- value: "",
8
- placeholder: "",
9
- };
4
+ function TextArea({ value = "", placeholder = "", ...rest }) {
5
+ return (
6
+ <TextInput multiline value={value} placeholder={placeholder} {...rest} />
7
+ );
8
+ }
10
9
 
11
10
  export default TextArea;
@@ -2,7 +2,16 @@ import React from "react";
2
2
  import { FormGroup, Label, Input, Textarea, Hint } from "@raketa-builder/ui";
3
3
  import { randomString } from "../lists";
4
4
 
5
- const TextField = ({ label, hint, multiline, error, onChange, ...rest }) => {
5
+ const TextField = ({
6
+ label,
7
+ hint,
8
+ multiline,
9
+ error,
10
+ onChange,
11
+ value = "",
12
+ placeholder = "",
13
+ ...rest
14
+ }) => {
6
15
  const id = randomString();
7
16
  const Component = multiline ? Textarea : Input;
8
17
 
@@ -15,7 +24,13 @@ const TextField = ({ label, hint, multiline, error, onChange, ...rest }) => {
15
24
  ) : (
16
25
  ""
17
26
  )}
18
- <Component id={id} onChange={(e) => onChange(e.target.value)} {...rest} />
27
+ <Component
28
+ id={id}
29
+ onChange={(e) => onChange(e.target.value)}
30
+ value={value}
31
+ placeholder={placeholder}
32
+ {...rest}
33
+ />
19
34
  {hint ? <Hint>{hint}</Hint> : ""}
20
35
  </FormGroup>
21
36
  );
@@ -23,9 +38,4 @@ const TextField = ({ label, hint, multiline, error, onChange, ...rest }) => {
23
38
 
24
39
  const TextInput = (props) => <TextField {...props} />;
25
40
 
26
- TextInput.defaultProps = {
27
- value: "",
28
- placeholder: "",
29
- };
30
-
31
41
  export default TextInput;
package/src/index.js CHANGED
@@ -18,15 +18,6 @@ import LinkSettings from "./forms/LinkSettings";
18
18
  import Link from "./lib/Link";
19
19
  import BuilderContext from "./contexts/BuilderContext";
20
20
 
21
- const theme = {};
22
- const RaketaUIProvider = ({ children }) => (
23
- <React.Fragment>{children}</React.Fragment>
24
- );
25
-
26
- RaketaUIProvider.defaultProps = {
27
- theme: theme,
28
- };
29
-
30
21
  export {
31
22
  PageBuilder,
32
23
  TextInput,
@@ -45,8 +36,6 @@ export {
45
36
  LinkSettings,
46
37
  Link,
47
38
  Label,
48
- theme,
49
39
  FormGroup,
50
- RaketaUIProvider,
51
40
  BuilderContext,
52
41
  };
@@ -97,8 +97,4 @@ const AdminWidget = ({
97
97
  );
98
98
  };
99
99
 
100
- AdminWidget.defaultProps = {
101
- containerSettings: {},
102
- };
103
-
104
100
  export default AdminWidget;
package/src/lib/Image.js CHANGED
@@ -38,7 +38,7 @@ const getAlt = (src) => {
38
38
  const imageObj = src.image || src;
39
39
 
40
40
  const altSetting = (imageObj?.settings || []).find(
41
- (setting) => setting.key === "alt",
41
+ (setting) => setting.key === "alt"
42
42
  );
43
43
 
44
44
  if (altSetting) {
@@ -74,7 +74,8 @@ const getImageObjOrSrc = (value) => {
74
74
  return value;
75
75
  };
76
76
 
77
- const Image = ({ variant, src, alt, loading, ...props }) => {
77
+ const Image = ({ variant, src, alt, loading = "lazy", ...props }) => {
78
+ console.log(props);
78
79
  if (!variant) {
79
80
  console.error("Image with no variant", { variant, src, alt, props });
80
81
  return null;
@@ -116,8 +117,4 @@ const Image = ({ variant, src, alt, loading, ...props }) => {
116
117
  );
117
118
  };
118
119
 
119
- Image.defaultProps = {
120
- loading: "lazy",
121
- };
122
-
123
120
  export default Image;