@simple-builder/react 1.3.9 → 1.4.1

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.
Files changed (112) hide show
  1. package/dist/{build-container-client-THZHNQ5S.mjs → build-container-client-6S55GQVT.mjs} +81 -41
  2. package/dist/{build-container-client-NXIMV3RF.js → build-container-client-EQBL556Y.js} +148 -115
  3. package/dist/{build-container-client-ZXO66OL5.js → build-container-client-JAITVVDD.js} +176 -136
  4. package/dist/{build-container-client-5QC5KVS3.mjs → build-container-client-LMZUWEUI.mjs} +53 -20
  5. package/dist/{builder-content-3HENFCB5.js → builder-content-7ZRYWXPN.js} +7 -7
  6. package/dist/{builder-content-2J424EME.mjs → builder-content-H75SR7I7.mjs} +2 -2
  7. package/dist/{builder-content-4ZNXUE7D.mjs → builder-content-OR2VTIUY.mjs} +2 -2
  8. package/dist/{builder-content-2MA6BKJ5.js → builder-content-XNIM2YVG.js} +7 -7
  9. package/dist/{chunk-BCPLNZMY.js → chunk-4SFXTFFU.js} +5 -5
  10. package/dist/{chunk-2CPAROZB.js → chunk-63LNKQZD.js} +1 -1
  11. package/dist/{chunk-3QWMKMTN.js → chunk-7FWFM2TR.js} +5 -5
  12. package/dist/{chunk-4TVSMCQU.js → chunk-7I4RGF45.js} +3 -3
  13. package/dist/{chunk-7X5S5JRE.js → chunk-JFWIO2AR.js} +3 -3
  14. package/dist/{chunk-5OV6KPTF.mjs → chunk-MXIMMIPT.mjs} +1 -1
  15. package/dist/{chunk-B5R6QY7N.mjs → chunk-QSAIF4GO.mjs} +1 -1
  16. package/dist/{chunk-5Q4KJW4A.mjs → chunk-UA2CNH3R.mjs} +2 -2
  17. package/dist/{chunk-6GCMYFBT.mjs → chunk-X5MZZBYC.mjs} +2 -2
  18. package/dist/{chunk-DZLUIOVD.js → chunk-YFRFNRKR.js} +1 -1
  19. package/dist/{chunk-CJGHP5Q7.mjs → chunk-ZJYB6LEV.mjs} +1 -1
  20. package/dist/{chunk-2GOYHVMW.mjs → chunk-ZQBKKI2S.mjs} +1 -1
  21. package/dist/index.css +0 -3
  22. package/dist/index.d.mts +6 -12
  23. package/dist/index.d.ts +6 -12
  24. package/dist/index.js +6 -6
  25. package/dist/index.mjs +2 -2
  26. package/package.json +2 -2
  27. package/dist/build-container-client-7Z6WZVBX.js +0 -2295
  28. package/dist/build-container-client-DWKVE65B.mjs +0 -2262
  29. package/dist/build-container-client-FN3PZMM7.mjs +0 -2257
  30. package/dist/build-container-client-FVDRMOZ7.mjs +0 -2255
  31. package/dist/build-container-client-GV52F5RP.js +0 -2298
  32. package/dist/build-container-client-J56NWFBF.mjs +0 -2261
  33. package/dist/build-container-client-L3WD4CG7.mjs +0 -2259
  34. package/dist/build-container-client-RSJ4H3SB.js +0 -2290
  35. package/dist/build-container-client-WGVIYK47.css +0 -1968
  36. package/dist/build-container-client-WHIUDBOZ.mjs +0 -2263
  37. package/dist/build-container-client-WIGFVNOW.css +0 -1971
  38. package/dist/build-container-client-WN35X6JD.js +0 -2291
  39. package/dist/build-container-client-WYIHRPSW.js +0 -2299
  40. package/dist/build-container-client-XAQDWWKB.mjs +0 -2254
  41. package/dist/build-container-client-XOHYMPBB.js +0 -2293
  42. package/dist/build-container-client-YDRPPWCU.js +0 -2297
  43. package/dist/build-container-client-YWNDWXO2.css +0 -1967
  44. package/dist/build-container-client-ZP3O6EGC.mjs +0 -2253
  45. package/dist/build-container-client-ZXAAYUTL.js +0 -2289
  46. package/dist/builder-content-2ZXIEMS3.js +0 -42
  47. package/dist/builder-content-3H7GF3KF.mjs +0 -20
  48. package/dist/builder-content-6PIBXDPE.mjs +0 -20
  49. package/dist/builder-content-73ZKCEIT.mjs +0 -20
  50. package/dist/builder-content-BIVYFWCC.js +0 -42
  51. package/dist/builder-content-BKE4JZ75.js +0 -42
  52. package/dist/builder-content-BU4BXER7.mjs +0 -20
  53. package/dist/builder-content-CP5VLMVD.mjs +0 -20
  54. package/dist/builder-content-CY43LFAA.js +0 -42
  55. package/dist/builder-content-FMTTH7R2.js +0 -42
  56. package/dist/builder-content-GBSIY2Z7.js +0 -42
  57. package/dist/builder-content-GJ4HYIOA.mjs +0 -20
  58. package/dist/builder-content-HQXSXBFZ.mjs +0 -20
  59. package/dist/builder-content-L7NHKCKD.js +0 -42
  60. package/dist/builder-content-MI55X5HA.css +0 -1971
  61. package/dist/builder-content-PWV6LNFT.mjs +0 -20
  62. package/dist/builder-content-RROSPBT4.css +0 -1968
  63. package/dist/builder-content-RV3DPWFH.js +0 -42
  64. package/dist/builder-content-V2MDRHJI.css +0 -1967
  65. package/dist/chunk-2OHBCAZQ.mjs +0 -244
  66. package/dist/chunk-2OYBZSJQ.mjs +0 -123
  67. package/dist/chunk-454D7NIH.js +0 -153
  68. package/dist/chunk-6GCUWI4L.mjs +0 -135
  69. package/dist/chunk-6KNCX5O5.mjs +0 -123
  70. package/dist/chunk-6VINC5E2.mjs +0 -244
  71. package/dist/chunk-C5GHD62W.mjs +0 -20
  72. package/dist/chunk-CARNMQP6.mjs +0 -20
  73. package/dist/chunk-CJNSRJNF.js +0 -42
  74. package/dist/chunk-EVMN5SX2.js +0 -269
  75. package/dist/chunk-EZFQOJHG.mjs +0 -244
  76. package/dist/chunk-F5JWY4CM.mjs +0 -20
  77. package/dist/chunk-H357GPTV.mjs +0 -244
  78. package/dist/chunk-H6OM2V2U.mjs +0 -20
  79. package/dist/chunk-HCM5NR6G.js +0 -269
  80. package/dist/chunk-IJJTQQQN.mjs +0 -135
  81. package/dist/chunk-IQX5LONG.js +0 -153
  82. package/dist/chunk-LEIASP7E.js +0 -153
  83. package/dist/chunk-MBISMJDL.js +0 -269
  84. package/dist/chunk-NDE4WSBA.js +0 -269
  85. package/dist/chunk-NUDE6YTK.js +0 -165
  86. package/dist/chunk-NZ4ZQMIS.js +0 -42
  87. package/dist/chunk-OWZPAOR6.mjs +0 -244
  88. package/dist/chunk-PADTJYXB.mjs +0 -20
  89. package/dist/chunk-QZQRUNAY.js +0 -153
  90. package/dist/chunk-RGBUK5SR.js +0 -269
  91. package/dist/chunk-RNGHWAPZ.js +0 -269
  92. package/dist/chunk-RYW5OXNX.mjs +0 -244
  93. package/dist/chunk-RZFAIM2Q.mjs +0 -123
  94. package/dist/chunk-SFYJAJOD.js +0 -42
  95. package/dist/chunk-SLWJHIVH.mjs +0 -123
  96. package/dist/chunk-TMDKQB2L.js +0 -153
  97. package/dist/chunk-TQQ4WVQU.mjs +0 -123
  98. package/dist/chunk-VCXFPTGD.js +0 -42
  99. package/dist/chunk-VNNNLYSW.js +0 -42
  100. package/dist/chunk-VO7KUMAO.js +0 -165
  101. package/dist/chunk-W4OP4EHX.mjs +0 -20
  102. package/dist/chunk-WA7TKN6M.js +0 -42
  103. package/dist/chunk-WI3YU7TV.js +0 -42
  104. package/dist/chunk-WPBR7BJZ.js +0 -269
  105. package/dist/chunk-X5A4S44V.mjs +0 -244
  106. package/dist/chunk-X5GVLHI2.mjs +0 -20
  107. package/dist/chunk-XLE7GSYM.mjs +0 -244
  108. package/dist/chunk-XSG7W73Z.mjs +0 -20
  109. package/dist/chunk-XZNO7DXS.js +0 -153
  110. package/dist/chunk-YKPZPQ5D.js +0 -269
  111. package/dist/chunk-ZGHPPTOO.js +0 -42
  112. package/dist/chunk-ZZT7HGAM.mjs +0 -123
@@ -1,19 +1,8 @@
1
1
  'use client';
2
2
  'use client';
3
- 'use client';
4
- 'use client';
5
- 'use client';
6
- 'use client';
7
- 'use client';
8
- 'use client';
9
- 'use client';
10
- 'use client';
11
- 'use client';
12
- 'use client';
13
- 'use client';
14
- import './chunk-XSG7W73Z.mjs';
15
- import { buttonVariants, Button, useBuilder } from './chunk-CJGHP5Q7.mjs';
16
- import { cn, tv, DesignWrapper, builder, Image } from './chunk-B5R6QY7N.mjs';
3
+ import './chunk-UA2CNH3R.mjs';
4
+ import { buttonVariants, Button, useBuilder } from './chunk-MXIMMIPT.mjs';
5
+ import { cn, tv, DesignWrapper, builder, Image } from './chunk-ZQBKKI2S.mjs';
17
6
  import * as React25 from 'react';
18
7
  import { useCallback } from 'react';
19
8
  import { ChevronRight, Check, Circle, X, ChevronDown, ChevronUp, PlusIcon, ArrowUp, ArrowDown, Edit2Icon, Trash2Icon, ImageIcon, XIcon, PlusCircleIcon, CalendarIcon, MonitorIcon, SmartphoneIcon, ChevronLeftIcon, ChevronRightIcon, PaintbrushIcon, Loader2Icon, AlignHorizontalSpaceAroundIcon, AlignHorizontalJustifyStartIcon, ScanIcon } from 'lucide-react';
@@ -1175,11 +1164,26 @@ var ColorPicker = (props) => {
1175
1164
  }
1176
1165
  ))));
1177
1166
  };
1167
+ var IMAGE_FILE_ACCEPT = ".png,.jpg,.jpeg,.webp,.gif,.svg";
1168
+ var MEDIA_FILE_ACCEPT = `${IMAGE_FILE_ACCEPT},.mp4,.webm,.mov,.ogg,.ogv,.m4v,video/*`;
1169
+ var VIDEO_EXTENSIONS = [".mp4", ".webm", ".mov", ".ogg", ".ogv", ".m4v"];
1170
+ var isVideoUrl = (src) => {
1171
+ const path = src.split("?")[0].split("#")[0].toLowerCase();
1172
+ return VIDEO_EXTENSIONS.some((ext) => path.endsWith(ext));
1173
+ };
1174
+ var isVideoFile = (file) => file.type.startsWith("video/") || isVideoUrl(file.name);
1178
1175
  var MediaInput = (props) => {
1179
- const { onFilesChange, limit = 32, multiple = false, onError } = props;
1176
+ const {
1177
+ onFilesChange,
1178
+ limit = 32,
1179
+ multiple = false,
1180
+ onError,
1181
+ accept = MEDIA_FILE_ACCEPT
1182
+ } = props;
1180
1183
  const id = React25.useId();
1181
1184
  const [queue, setQueue] = React25.useState([]);
1182
1185
  const [sources, setSources] = React25.useState(props.files ?? []);
1186
+ const [videoUrls, setVideoUrls] = React25.useState({});
1183
1187
  const maxConcurrentUploads = 3;
1184
1188
  const uploadingCountRef = React25.useRef(0);
1185
1189
  const handleFilesAdd = async (e) => {
@@ -1229,6 +1233,9 @@ var MediaInput = (props) => {
1229
1233
  );
1230
1234
  continue;
1231
1235
  }
1236
+ if (isVideoFile(file)) {
1237
+ setVideoUrls((prev) => ({ ...prev, [url]: true }));
1238
+ }
1232
1239
  setSources((prev) => [...prev, url]);
1233
1240
  onFilesChange?.([...sources, url]);
1234
1241
  } catch (e2) {
@@ -1253,12 +1260,10 @@ var MediaInput = (props) => {
1253
1260
  });
1254
1261
  };
1255
1262
  return /* @__PURE__ */ React25.createElement("div", { className: cn("flex flex-wrap gap-4", props.className) }, sources.map((src) => /* @__PURE__ */ React25.createElement(MediaInputItem, { key: src, className: cn("group", props.itemClassName) }, /* @__PURE__ */ React25.createElement(
1256
- Image,
1263
+ MediaPreview,
1257
1264
  {
1258
1265
  src,
1259
- alt: "",
1260
- fill: true,
1261
- className: "sb:absolute sb:inset-0 sb:object-cover sb:pointer-events-none"
1266
+ isVideo: !!videoUrls[src] || isVideoUrl(src)
1262
1267
  }
1263
1268
  ), /* @__PURE__ */ React25.createElement("div", { className: "sb:absolute sb:right-1 sb:top-1 sb:z-30 sb:flex sb:items-center sb:justify-end sb:gap-3 sb:opacity-0 sb:transition-opacity sb:group-hover:opacity-100" }, /* @__PURE__ */ React25.createElement(
1264
1269
  "button",
@@ -1294,7 +1299,7 @@ var MediaInput = (props) => {
1294
1299
  type: "file",
1295
1300
  onChange: handleFilesAdd,
1296
1301
  multiple,
1297
- accept: ".png,.jpg,.jpeg,.webp,.gif,.svg",
1302
+ accept,
1298
1303
  className: "sb:hidden"
1299
1304
  }
1300
1305
  )
@@ -1312,6 +1317,33 @@ var MediaInputItem = (props) => {
1312
1317
  props.children
1313
1318
  );
1314
1319
  };
1320
+ var MediaPreview = (props) => {
1321
+ const [kind, setKind] = React25.useState(
1322
+ props.isVideo ? "video" : "image"
1323
+ );
1324
+ if (kind === "video") {
1325
+ return /* @__PURE__ */ React25.createElement(
1326
+ "video",
1327
+ {
1328
+ src: props.src,
1329
+ muted: true,
1330
+ playsInline: true,
1331
+ preload: "metadata",
1332
+ className: "sb:absolute sb:inset-0 sb:h-full sb:w-full sb:object-cover sb:pointer-events-none"
1333
+ }
1334
+ );
1335
+ }
1336
+ return /* @__PURE__ */ React25.createElement(
1337
+ Image,
1338
+ {
1339
+ src: props.src,
1340
+ alt: "",
1341
+ fill: true,
1342
+ className: "sb:absolute sb:inset-0 sb:object-cover sb:pointer-events-none",
1343
+ onError: () => setKind("video")
1344
+ }
1345
+ );
1346
+ };
1315
1347
  var MediaInputError = class extends Error {
1316
1348
  title;
1317
1349
  description;
@@ -1783,6 +1815,7 @@ var BackgroundPicker = (props) => {
1783
1815
  className: "sb:grid sb:grid-cols-2 sb:gap-1",
1784
1816
  itemClassName: "sb:aspect-video sb:h-auto sb:w-full",
1785
1817
  multiple: false,
1818
+ accept: IMAGE_FILE_ACCEPT,
1786
1819
  onFilesChange: (files) => {
1787
1820
  if (!files.length)
1788
1821
  return;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkRGBUK5SR_js = require('./chunk-RGBUK5SR.js');
4
- var chunkLEIASP7E_js = require('./chunk-LEIASP7E.js');
3
+ var chunk7FWFM2TR_js = require('./chunk-7FWFM2TR.js');
4
+ var chunk63LNKQZD_js = require('./chunk-63LNKQZD.js');
5
5
  var React2 = require('react');
6
6
 
7
7
  function _interopNamespace(e) {
@@ -25,17 +25,17 @@ function _interopNamespace(e) {
25
25
  var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
26
26
 
27
27
  var BuilderHeader = () => {
28
- const { save } = chunkRGBUK5SR_js.useBuilder();
29
- return /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:grid sb:grid-cols-3 sb:gap-4 sb:items-center sb:p-2 sb:shadow-lg sb:sticky sb:inset-x-0 sb:top-0 sb:bg-background sb:z-30" }, /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:flex sb:gap-4 sb:items-center" }, /* @__PURE__ */ React2__namespace.createElement(chunkRGBUK5SR_js.Button, { variant: "ghost", size: "sm", onClick: save }, "Opslaan")));
28
+ const { save } = chunk7FWFM2TR_js.useBuilder();
29
+ return /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:grid sb:grid-cols-3 sb:gap-4 sb:items-center sb:p-2 sb:shadow-lg sb:sticky sb:inset-x-0 sb:top-0 sb:bg-background sb:z-30" }, /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:flex sb:gap-4 sb:items-center" }, /* @__PURE__ */ React2__namespace.createElement(chunk7FWFM2TR_js.Button, { variant: "ghost", size: "sm", onClick: save }, "Opslaan")));
30
30
  };
31
31
 
32
32
  // src/components/builder-content.tsx
33
33
  var BuilderContent = (props) => {
34
- return /* @__PURE__ */ React2__namespace.createElement(chunkRGBUK5SR_js.BuilderProvider, { content: props.content }, /* @__PURE__ */ React2__namespace.createElement(BuilderContentInner, null));
34
+ return /* @__PURE__ */ React2__namespace.createElement(chunk7FWFM2TR_js.BuilderProvider, { content: props.content }, /* @__PURE__ */ React2__namespace.createElement(BuilderContentInner, null));
35
35
  };
36
36
  var BuilderContentInner = () => {
37
- const { content } = chunkRGBUK5SR_js.useBuilder();
38
- return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(BuilderHeader, null), /* @__PURE__ */ React2__namespace.createElement(chunkLEIASP7E_js.BuildContainer, { name: "root", edit: true, multiple: true, content }));
37
+ const { content } = chunk7FWFM2TR_js.useBuilder();
38
+ return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(BuilderHeader, null), /* @__PURE__ */ React2__namespace.createElement(chunk63LNKQZD_js.BuildContainer, { name: "root", edit: true, multiple: true, content }));
39
39
  };
40
40
  var builder_content_default = BuilderContent;
41
41
 
@@ -1,5 +1,5 @@
1
- import { BuilderProvider, useBuilder, Button } from './chunk-RYW5OXNX.mjs';
2
- import { BuildContainer } from './chunk-IJJTQQQN.mjs';
1
+ import { BuilderProvider, useBuilder, Button } from './chunk-ZJYB6LEV.mjs';
2
+ import { BuildContainer } from './chunk-QSAIF4GO.mjs';
3
3
  import * as React2 from 'react';
4
4
 
5
5
  var BuilderHeader = () => {
@@ -1,5 +1,5 @@
1
- import { BuilderProvider, useBuilder, Button } from './chunk-XLE7GSYM.mjs';
2
- import { BuildContainer } from './chunk-6GCUWI4L.mjs';
1
+ import { BuilderProvider, useBuilder, Button } from './chunk-MXIMMIPT.mjs';
2
+ import { BuildContainer } from './chunk-ZQBKKI2S.mjs';
3
3
  import * as React2 from 'react';
4
4
 
5
5
  var BuilderHeader = () => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkMBISMJDL_js = require('./chunk-MBISMJDL.js');
4
- var chunkIQX5LONG_js = require('./chunk-IQX5LONG.js');
3
+ var chunk4SFXTFFU_js = require('./chunk-4SFXTFFU.js');
4
+ var chunkYFRFNRKR_js = require('./chunk-YFRFNRKR.js');
5
5
  var React2 = require('react');
6
6
 
7
7
  function _interopNamespace(e) {
@@ -25,17 +25,17 @@ function _interopNamespace(e) {
25
25
  var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
26
26
 
27
27
  var BuilderHeader = () => {
28
- const { save } = chunkMBISMJDL_js.useBuilder();
29
- return /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:grid sb:grid-cols-3 sb:gap-4 sb:items-center sb:p-2 sb:shadow-lg sb:sticky sb:inset-x-0 sb:top-0 sb:bg-background sb:z-30" }, /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:flex sb:gap-4 sb:items-center" }, /* @__PURE__ */ React2__namespace.createElement(chunkMBISMJDL_js.Button, { variant: "ghost", size: "sm", onClick: save }, "Opslaan")));
28
+ const { save } = chunk4SFXTFFU_js.useBuilder();
29
+ return /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:grid sb:grid-cols-3 sb:gap-4 sb:items-center sb:p-2 sb:shadow-lg sb:sticky sb:inset-x-0 sb:top-0 sb:bg-background sb:z-30" }, /* @__PURE__ */ React2__namespace.createElement("div", { className: "sb:flex sb:gap-4 sb:items-center" }, /* @__PURE__ */ React2__namespace.createElement(chunk4SFXTFFU_js.Button, { variant: "ghost", size: "sm", onClick: save }, "Opslaan")));
30
30
  };
31
31
 
32
32
  // src/components/builder-content.tsx
33
33
  var BuilderContent = (props) => {
34
- return /* @__PURE__ */ React2__namespace.createElement(chunkMBISMJDL_js.BuilderProvider, { content: props.content }, /* @__PURE__ */ React2__namespace.createElement(BuilderContentInner, null));
34
+ return /* @__PURE__ */ React2__namespace.createElement(chunk4SFXTFFU_js.BuilderProvider, { content: props.content }, /* @__PURE__ */ React2__namespace.createElement(BuilderContentInner, null));
35
35
  };
36
36
  var BuilderContentInner = () => {
37
- const { content } = chunkMBISMJDL_js.useBuilder();
38
- return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(BuilderHeader, null), /* @__PURE__ */ React2__namespace.createElement(chunkIQX5LONG_js.BuildContainer, { name: "root", edit: true, multiple: true, content }));
37
+ const { content } = chunk4SFXTFFU_js.useBuilder();
38
+ return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(BuilderHeader, null), /* @__PURE__ */ React2__namespace.createElement(chunkYFRFNRKR_js.BuildContainer, { name: "root", edit: true, multiple: true, content }));
39
39
  };
40
40
  var builder_content_default = BuilderContent;
41
41
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkVO7KUMAO_js = require('./chunk-VO7KUMAO.js');
3
+ var chunkYFRFNRKR_js = require('./chunk-YFRFNRKR.js');
4
4
  var React = require('react');
5
5
  var reactSlot = require('@radix-ui/react-slot');
6
6
  var classVarianceAuthority = require('class-variance-authority');
@@ -57,7 +57,7 @@ var BuilderProvider = (props) => {
57
57
  );
58
58
  const addContent = React__namespace.useCallback(
59
59
  (name, container, parent, index = 0) => {
60
- const component = chunkVO7KUMAO_js.builder.getComponent(name);
60
+ const component = chunkYFRFNRKR_js.builder.getComponent(name);
61
61
  if (!component) {
62
62
  throw new Error(`[simple-builder]: Component "${name}" not found`);
63
63
  }
@@ -79,7 +79,7 @@ var BuilderProvider = (props) => {
79
79
  }
80
80
  };
81
81
  if (!parent) {
82
- setContent((content2) => chunkVO7KUMAO_js.insertAt(content2, index, entry));
82
+ setContent((content2) => chunkYFRFNRKR_js.insertAt(content2, index, entry));
83
83
  return;
84
84
  }
85
85
  setContent(
@@ -89,7 +89,7 @@ var BuilderProvider = (props) => {
89
89
  ...item,
90
90
  content: {
91
91
  ...item.content,
92
- [container]: chunkVO7KUMAO_js.insertAt(item.content?.[container], index, entry)
92
+ [container]: chunkYFRFNRKR_js.insertAt(item.content?.[container], index, entry)
93
93
  }
94
94
  };
95
95
  }
@@ -254,7 +254,7 @@ var Button = React__namespace.forwardRef(
254
254
  return /* @__PURE__ */ React__namespace.createElement(
255
255
  Comp,
256
256
  {
257
- className: chunkVO7KUMAO_js.cn(buttonVariants({ variant, size, className })),
257
+ className: chunkYFRFNRKR_js.cn(buttonVariants({ variant, size, className })),
258
258
  ref,
259
259
  ...props
260
260
  }
@@ -133,7 +133,7 @@ var DesignWrapper = (props) => {
133
133
  `.replace(/\s\s+/g, " ")));
134
134
  };
135
135
  var BuildContainerInner = React3__namespace.lazy(
136
- () => import('./build-container-client-NXIMV3RF.js')
136
+ () => import('./build-container-client-JAITVVDD.js')
137
137
  );
138
138
  var BuildContainer = (props) => {
139
139
  const { content, edit, name } = props;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTMDKQB2L_js = require('./chunk-TMDKQB2L.js');
3
+ var chunk63LNKQZD_js = require('./chunk-63LNKQZD.js');
4
4
  var React = require('react');
5
5
  var reactSlot = require('@radix-ui/react-slot');
6
6
  var classVarianceAuthority = require('class-variance-authority');
@@ -57,7 +57,7 @@ var BuilderProvider = (props) => {
57
57
  );
58
58
  const addContent = React__namespace.useCallback(
59
59
  (name, container, parent, index = 0) => {
60
- const component = chunkTMDKQB2L_js.builder.getComponent(name);
60
+ const component = chunk63LNKQZD_js.builder.getComponent(name);
61
61
  if (!component) {
62
62
  throw new Error(`[simple-builder]: Component "${name}" not found`);
63
63
  }
@@ -79,7 +79,7 @@ var BuilderProvider = (props) => {
79
79
  }
80
80
  };
81
81
  if (!parent) {
82
- setContent((content2) => chunkTMDKQB2L_js.insertAt(content2, index, entry));
82
+ setContent((content2) => chunk63LNKQZD_js.insertAt(content2, index, entry));
83
83
  return;
84
84
  }
85
85
  setContent(
@@ -89,7 +89,7 @@ var BuilderProvider = (props) => {
89
89
  ...item,
90
90
  content: {
91
91
  ...item.content,
92
- [container]: chunkTMDKQB2L_js.insertAt(item.content?.[container], index, entry)
92
+ [container]: chunk63LNKQZD_js.insertAt(item.content?.[container], index, entry)
93
93
  }
94
94
  };
95
95
  }
@@ -254,7 +254,7 @@ var Button = React__namespace.forwardRef(
254
254
  return /* @__PURE__ */ React__namespace.createElement(
255
255
  Comp,
256
256
  {
257
- className: chunkTMDKQB2L_js.cn(buttonVariants({ variant, size, className })),
257
+ className: chunk63LNKQZD_js.cn(buttonVariants({ variant, size, className })),
258
258
  ref,
259
259
  ...props
260
260
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkIQX5LONG_js = require('./chunk-IQX5LONG.js');
3
+ var chunkYFRFNRKR_js = require('./chunk-YFRFNRKR.js');
4
4
  var React = require('react');
5
5
 
6
6
  function _interopNamespace(e) {
@@ -25,7 +25,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
25
 
26
26
  var StaticContent = (props) => {
27
27
  return /* @__PURE__ */ React__namespace.createElement(
28
- chunkIQX5LONG_js.BuildContainer,
28
+ chunkYFRFNRKR_js.BuildContainer,
29
29
  {
30
30
  name: "root",
31
31
  edit: false,
@@ -36,7 +36,7 @@ var StaticContent = (props) => {
36
36
  };
37
37
 
38
38
  // src/index.ts
39
- var BuilderContent = React.lazy(() => import('./builder-content-2MA6BKJ5.js'));
39
+ var BuilderContent = React.lazy(() => import('./builder-content-XNIM2YVG.js'));
40
40
 
41
41
  exports.BuilderContent = BuilderContent;
42
42
  exports.StaticContent = StaticContent;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLEIASP7E_js = require('./chunk-LEIASP7E.js');
3
+ var chunk63LNKQZD_js = require('./chunk-63LNKQZD.js');
4
4
  var React = require('react');
5
5
 
6
6
  function _interopNamespace(e) {
@@ -25,7 +25,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
25
 
26
26
  var StaticContent = (props) => {
27
27
  return /* @__PURE__ */ React__namespace.createElement(
28
- chunkLEIASP7E_js.BuildContainer,
28
+ chunk63LNKQZD_js.BuildContainer,
29
29
  {
30
30
  name: "root",
31
31
  edit: false,
@@ -36,7 +36,7 @@ var StaticContent = (props) => {
36
36
  };
37
37
 
38
38
  // src/index.ts
39
- var BuilderContent = React.lazy(() => import('./builder-content-3HENFCB5.js'));
39
+ var BuilderContent = React.lazy(() => import('./builder-content-7ZRYWXPN.js'));
40
40
 
41
41
  exports.BuilderContent = BuilderContent;
42
42
  exports.StaticContent = StaticContent;
@@ -1,4 +1,4 @@
1
- import { cn, builder, insertAt } from './chunk-TQQ4WVQU.mjs';
1
+ import { cn, builder, insertAt } from './chunk-ZQBKKI2S.mjs';
2
2
  import * as React from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cva } from 'class-variance-authority';
@@ -109,7 +109,7 @@ var DesignWrapper = (props) => {
109
109
  `.replace(/\s\s+/g, " ")));
110
110
  };
111
111
  var BuildContainerInner = React3.lazy(
112
- () => import('./build-container-client-5QC5KVS3.mjs')
112
+ () => import('./build-container-client-6S55GQVT.mjs')
113
113
  );
114
114
  var BuildContainer = (props) => {
115
115
  const { content, edit, name } = props;
@@ -1,4 +1,4 @@
1
- import { BuildContainer } from './chunk-ZZT7HGAM.mjs';
1
+ import { BuildContainer } from './chunk-ZQBKKI2S.mjs';
2
2
  import * as React from 'react';
3
3
  import { lazy } from 'react';
4
4
 
@@ -15,6 +15,6 @@ var StaticContent = (props) => {
15
15
  };
16
16
 
17
17
  // src/index.ts
18
- var BuilderContent = lazy(() => import('./builder-content-PWV6LNFT.mjs'));
18
+ var BuilderContent = lazy(() => import('./builder-content-OR2VTIUY.mjs'));
19
19
 
20
20
  export { BuilderContent, StaticContent };
@@ -1,4 +1,4 @@
1
- import { BuildContainer } from './chunk-2GOYHVMW.mjs';
1
+ import { BuildContainer } from './chunk-QSAIF4GO.mjs';
2
2
  import * as React from 'react';
3
3
  import { lazy } from 'react';
4
4
 
@@ -15,6 +15,6 @@ var StaticContent = (props) => {
15
15
  };
16
16
 
17
17
  // src/index.ts
18
- var BuilderContent = lazy(() => import('./builder-content-73ZKCEIT.mjs'));
18
+ var BuilderContent = lazy(() => import('./builder-content-H75SR7I7.mjs'));
19
19
 
20
20
  export { BuilderContent, StaticContent };
@@ -133,7 +133,7 @@ var DesignWrapper = (props) => {
133
133
  `.replace(/\s\s+/g, " ")));
134
134
  };
135
135
  var BuildContainerInner = React3__namespace.lazy(
136
- () => import('./build-container-client-YDRPPWCU.js')
136
+ () => import('./build-container-client-EQBL556Y.js')
137
137
  );
138
138
  var BuildContainer = (props) => {
139
139
  const { content, edit, name } = props;
@@ -1,4 +1,4 @@
1
- import { cn, builder, insertAt } from './chunk-B5R6QY7N.mjs';
1
+ import { cn, builder, insertAt } from './chunk-QSAIF4GO.mjs';
2
2
  import * as React from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cva } from 'class-variance-authority';
@@ -109,7 +109,7 @@ var DesignWrapper = (props) => {
109
109
  `.replace(/\s\s+/g, " ")));
110
110
  };
111
111
  var BuildContainerInner = React3.lazy(
112
- () => import('./build-container-client-DWKVE65B.mjs')
112
+ () => import('./build-container-client-LMZUWEUI.mjs')
113
113
  );
114
114
  var BuildContainer = (props) => {
115
115
  const { content, edit, name } = props;
package/dist/index.css CHANGED
@@ -543,9 +543,6 @@
543
543
  .sb\:w-px {
544
544
  width: 1px;
545
545
  }
546
- .sb\:w-screen {
547
- width: 100vw;
548
- }
549
546
  .sb\:max-w-3xl {
550
547
  max-width: var(--sb-container-3xl);
551
548
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { createElement } from 'react';
3
2
  import * as _simple_builder_server from '@simple-builder/server';
4
3
  import { BuilderContent as BuilderContent$1, ContentItem } from '@simple-builder/server';
5
4
 
@@ -37,17 +36,12 @@ type BuildContainerProps$1 = {
37
36
  };
38
37
  };
39
38
 
40
- declare class Builder {
41
- private static instance;
42
- private components;
43
- private constructor();
44
- static getInstance(): Builder;
45
- register(component: Component["component"], config: Omit<Component, "component">): void;
46
- getComponents(): Component[];
47
- getComponent(name: string): Component | undefined;
48
- bindComponent({ content, ...block }: ContentItem, edit?: boolean): ReturnType<typeof createElement>;
49
- }
50
- declare const builder: Builder;
39
+ declare const builder: {
40
+ register: (component: any, config: Omit<Component, "component">) => void;
41
+ getComponents: () => Component[];
42
+ getComponent: (name: string) => Component | undefined;
43
+ bindComponent: ({ content, ...block }: ContentItem, edit?: boolean) => React.FunctionComponentElement<any>;
44
+ };
51
45
 
52
46
  type StaticContentProps = {
53
47
  content?: BuilderContent$1;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { createElement } from 'react';
3
2
  import * as _simple_builder_server from '@simple-builder/server';
4
3
  import { BuilderContent as BuilderContent$1, ContentItem } from '@simple-builder/server';
5
4
 
@@ -37,17 +36,12 @@ type BuildContainerProps$1 = {
37
36
  };
38
37
  };
39
38
 
40
- declare class Builder {
41
- private static instance;
42
- private components;
43
- private constructor();
44
- static getInstance(): Builder;
45
- register(component: Component["component"], config: Omit<Component, "component">): void;
46
- getComponents(): Component[];
47
- getComponent(name: string): Component | undefined;
48
- bindComponent({ content, ...block }: ContentItem, edit?: boolean): ReturnType<typeof createElement>;
49
- }
50
- declare const builder: Builder;
39
+ declare const builder: {
40
+ register: (component: any, config: Omit<Component, "component">) => void;
41
+ getComponents: () => Component[];
42
+ getComponent: (name: string) => Component | undefined;
43
+ bindComponent: ({ content, ...block }: ContentItem, edit?: boolean) => React.FunctionComponentElement<any>;
44
+ };
51
45
 
52
46
  type StaticContentProps = {
53
47
  content?: BuilderContent$1;
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var chunkZGHPPTOO_js = require('./chunk-ZGHPPTOO.js');
4
- var chunkVO7KUMAO_js = require('./chunk-VO7KUMAO.js');
3
+ var chunkJFWIO2AR_js = require('./chunk-JFWIO2AR.js');
4
+ var chunk63LNKQZD_js = require('./chunk-63LNKQZD.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "BuilderContent", {
9
9
  enumerable: true,
10
- get: function () { return chunkZGHPPTOO_js.BuilderContent; }
10
+ get: function () { return chunkJFWIO2AR_js.BuilderContent; }
11
11
  });
12
12
  Object.defineProperty(exports, "StaticContent", {
13
13
  enumerable: true,
14
- get: function () { return chunkZGHPPTOO_js.StaticContent; }
14
+ get: function () { return chunkJFWIO2AR_js.StaticContent; }
15
15
  });
16
16
  Object.defineProperty(exports, "BuildContainer", {
17
17
  enumerable: true,
18
- get: function () { return chunkVO7KUMAO_js.BuildContainer; }
18
+ get: function () { return chunk63LNKQZD_js.BuildContainer; }
19
19
  });
20
20
  Object.defineProperty(exports, "builder", {
21
21
  enumerable: true,
22
- get: function () { return chunkVO7KUMAO_js.builder; }
22
+ get: function () { return chunk63LNKQZD_js.builder; }
23
23
  });
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { BuilderContent, StaticContent } from './chunk-W4OP4EHX.mjs';
2
- export { BuildContainer, builder } from './chunk-IJJTQQQN.mjs';
1
+ export { BuilderContent, StaticContent } from './chunk-X5MZZBYC.mjs';
2
+ export { BuildContainer, builder } from './chunk-QSAIF4GO.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-builder/react",
3
- "version": "1.3.9",
3
+ "version": "1.4.1",
4
4
  "private": false,
5
5
  "description": "React package for the simple builder package.",
6
6
  "repository": "https://github.com/pieter-berkel/simple-builder.git",
@@ -59,7 +59,7 @@
59
59
  "tailwind-merge": "^2.2.0",
60
60
  "tailwind-variants": "^0.1.20",
61
61
  "zod": "^3.22.4",
62
- "@simple-builder/server": "1.3.9"
62
+ "@simple-builder/server": "1.4.1"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "react": ">=16.8.0",