@measured/puck 0.17.0-canary.229cbdd → 0.17.0-canary.ccec96e

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.
package/dist/index.js CHANGED
@@ -1485,60 +1485,32 @@ var ArrayField = ({
1485
1485
  children: [
1486
1486
  field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
1487
1487
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("rhs"), children: [
1488
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("actions"), children: [
1489
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1490
- IconButton,
1491
- {
1492
- type: "button",
1493
- disabled: !!addDisabled,
1494
- onClick: (e) => {
1495
- e.stopPropagation();
1496
- const existingValue = [
1497
- ...value || []
1498
- ];
1499
- existingValue.splice(
1500
- i,
1501
- 0,
1502
- existingValue[i]
1503
- );
1504
- onChange(
1505
- existingValue,
1506
- mapArrayStateToUi(
1507
- regenerateArrayState(existingValue)
1508
- )
1509
- );
1510
- },
1511
- title: "Duplicate",
1512
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
1513
- }
1514
- ) }),
1515
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1516
- IconButton,
1517
- {
1518
- type: "button",
1519
- disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1520
- onClick: (e) => {
1521
- e.stopPropagation();
1522
- const existingValue = [
1523
- ...value || []
1524
- ];
1525
- const existingItems = [
1526
- ...arrayState.items || []
1527
- ];
1528
- existingValue.splice(i, 1);
1529
- existingItems.splice(i, 1);
1530
- onChange(
1531
- existingValue,
1532
- mapArrayStateToUi({
1533
- items: existingItems
1534
- })
1535
- );
1536
- },
1537
- title: "Delete",
1538
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
1539
- }
1540
- ) })
1541
- ] }),
1488
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1489
+ IconButton,
1490
+ {
1491
+ type: "button",
1492
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1493
+ onClick: (e) => {
1494
+ e.stopPropagation();
1495
+ const existingValue = [
1496
+ ...value || []
1497
+ ];
1498
+ const existingItems = [
1499
+ ...arrayState.items || []
1500
+ ];
1501
+ existingValue.splice(i, 1);
1502
+ existingItems.splice(i, 1);
1503
+ onChange(
1504
+ existingValue,
1505
+ mapArrayStateToUi({
1506
+ items: existingItems
1507
+ })
1508
+ );
1509
+ },
1510
+ title: "Delete",
1511
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
1512
+ }
1513
+ ) }) }),
1542
1514
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DragIcon, {}) })
1543
1515
  ] })
1544
1516
  ]
package/dist/index.mjs CHANGED
@@ -1298,60 +1298,32 @@ var ArrayField = ({
1298
1298
  children: [
1299
1299
  field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
1300
1300
  /* @__PURE__ */ jsxs4("div", { className: getClassNameItem("rhs"), children: [
1301
- !readOnly && /* @__PURE__ */ jsxs4("div", { className: getClassNameItem("actions"), children: [
1302
- /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1303
- IconButton,
1304
- {
1305
- type: "button",
1306
- disabled: !!addDisabled,
1307
- onClick: (e) => {
1308
- e.stopPropagation();
1309
- const existingValue = [
1310
- ...value || []
1311
- ];
1312
- existingValue.splice(
1313
- i,
1314
- 0,
1315
- existingValue[i]
1316
- );
1317
- onChange(
1318
- existingValue,
1319
- mapArrayStateToUi(
1320
- regenerateArrayState(existingValue)
1321
- )
1322
- );
1323
- },
1324
- title: "Duplicate",
1325
- children: /* @__PURE__ */ jsx9(Copy, { size: 16 })
1326
- }
1327
- ) }),
1328
- /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1329
- IconButton,
1330
- {
1331
- type: "button",
1332
- disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1333
- onClick: (e) => {
1334
- e.stopPropagation();
1335
- const existingValue = [
1336
- ...value || []
1337
- ];
1338
- const existingItems = [
1339
- ...arrayState.items || []
1340
- ];
1341
- existingValue.splice(i, 1);
1342
- existingItems.splice(i, 1);
1343
- onChange(
1344
- existingValue,
1345
- mapArrayStateToUi({
1346
- items: existingItems
1347
- })
1348
- );
1349
- },
1350
- title: "Delete",
1351
- children: /* @__PURE__ */ jsx9(Trash, { size: 16 })
1352
- }
1353
- ) })
1354
- ] }),
1301
+ !readOnly && /* @__PURE__ */ jsx9("div", { className: getClassNameItem("actions"), children: /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1302
+ IconButton,
1303
+ {
1304
+ type: "button",
1305
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1306
+ onClick: (e) => {
1307
+ e.stopPropagation();
1308
+ const existingValue = [
1309
+ ...value || []
1310
+ ];
1311
+ const existingItems = [
1312
+ ...arrayState.items || []
1313
+ ];
1314
+ existingValue.splice(i, 1);
1315
+ existingItems.splice(i, 1);
1316
+ onChange(
1317
+ existingValue,
1318
+ mapArrayStateToUi({
1319
+ items: existingItems
1320
+ })
1321
+ );
1322
+ },
1323
+ title: "Delete",
1324
+ children: /* @__PURE__ */ jsx9(Trash, { size: 16 })
1325
+ }
1326
+ ) }) }),
1355
1327
  /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(DragIcon, {}) })
1356
1328
  ] })
1357
1329
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.17.0-canary.229cbdd",
3
+ "version": "0.17.0-canary.ccec96e",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",