@measured/puck 0.20.0-canary.0708ce21 → 0.20.0-canary.14d96817

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.
@@ -1387,49 +1387,51 @@ var ArrayField = ({
1387
1387
  ]
1388
1388
  }
1389
1389
  ),
1390
- /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ jsx8("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
1391
- const subField = field.arrayFields[subName];
1392
- const indexName = `${name}[${i}]`;
1393
- const subPath = `${indexName}.${subName}`;
1394
- const localIndexName = `${localName}[${i}]`;
1395
- const localWildcardName = `${localName}[*]`;
1396
- const localSubPath = `${localIndexName}.${subName}`;
1397
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
1398
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
1399
- const label2 = subField.label || subName;
1400
- return /* @__PURE__ */ jsx8(
1401
- NestedFieldProvider,
1402
- {
1403
- name: localIndexName,
1404
- wildcardName: localWildcardName,
1405
- subName,
1406
- readOnlyFields,
1407
- children: /* @__PURE__ */ jsx8(
1408
- AutoFieldPrivate,
1409
- {
1410
- name: subPath,
1411
- label: label2,
1412
- id: `${_arrayId}_${subName}`,
1413
- readOnly: subReadOnly,
1414
- field: __spreadProps(__spreadValues({}, subField), {
1415
- label: label2
1416
- // May be used by custom fields
1417
- }),
1418
- value: data[subName],
1419
- onChange: (val, ui) => {
1420
- onChange(
1421
- replace(value, i, __spreadProps(__spreadValues({}, data), {
1422
- [subName]: val
1423
- })),
1424
- ui
1425
- );
1390
+ /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: arrayState.openId === _arrayId && /* @__PURE__ */ jsx8("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
1391
+ (subName) => {
1392
+ const subField = field.arrayFields[subName];
1393
+ const indexName = `${name}[${i}]`;
1394
+ const subPath = `${indexName}.${subName}`;
1395
+ const localIndexName = `${localName}[${i}]`;
1396
+ const localWildcardName = `${localName}[*]`;
1397
+ const localSubPath = `${localIndexName}.${subName}`;
1398
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
1399
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
1400
+ const label2 = subField.label || subName;
1401
+ return /* @__PURE__ */ jsx8(
1402
+ NestedFieldProvider,
1403
+ {
1404
+ name: localIndexName,
1405
+ wildcardName: localWildcardName,
1406
+ subName,
1407
+ readOnlyFields,
1408
+ children: /* @__PURE__ */ jsx8(
1409
+ AutoFieldPrivate,
1410
+ {
1411
+ name: subPath,
1412
+ label: label2,
1413
+ id: `${_arrayId}_${subName}`,
1414
+ readOnly: subReadOnly,
1415
+ field: __spreadProps(__spreadValues({}, subField), {
1416
+ label: label2
1417
+ // May be used by custom fields
1418
+ }),
1419
+ value: data[subName],
1420
+ onChange: (val, ui) => {
1421
+ onChange(
1422
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
1423
+ [subName]: val
1424
+ })),
1425
+ ui
1426
+ );
1427
+ }
1426
1428
  }
1427
- }
1428
- )
1429
- },
1430
- subPath
1431
- );
1432
- }) }) })
1429
+ )
1430
+ },
1431
+ subPath
1432
+ );
1433
+ }
1434
+ ) }) })
1433
1435
  ]
1434
1436
  }
1435
1437
  )
package/dist/index.js CHANGED
@@ -3466,49 +3466,51 @@ var ArrayField = ({
3466
3466
  ]
3467
3467
  }
3468
3468
  ),
3469
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
3470
- const subField = field.arrayFields[subName];
3471
- const indexName = `${name}[${i}]`;
3472
- const subPath = `${indexName}.${subName}`;
3473
- const localIndexName = `${localName}[${i}]`;
3474
- const localWildcardName = `${localName}[*]`;
3475
- const localSubPath = `${localIndexName}.${subName}`;
3476
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
3477
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
3478
- const label2 = subField.label || subName;
3479
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3480
- NestedFieldProvider,
3481
- {
3482
- name: localIndexName,
3483
- wildcardName: localWildcardName,
3484
- subName,
3485
- readOnlyFields,
3486
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3487
- AutoFieldPrivate,
3488
- {
3489
- name: subPath,
3490
- label: label2,
3491
- id: `${_arrayId}_${subName}`,
3492
- readOnly: subReadOnly,
3493
- field: __spreadProps(__spreadValues({}, subField), {
3494
- label: label2
3495
- // May be used by custom fields
3496
- }),
3497
- value: data[subName],
3498
- onChange: (val, ui) => {
3499
- onChange(
3500
- replace(value, i, __spreadProps(__spreadValues({}, data), {
3501
- [subName]: val
3502
- })),
3503
- ui
3504
- );
3469
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: arrayState.openId === _arrayId && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
3470
+ (subName) => {
3471
+ const subField = field.arrayFields[subName];
3472
+ const indexName = `${name}[${i}]`;
3473
+ const subPath = `${indexName}.${subName}`;
3474
+ const localIndexName = `${localName}[${i}]`;
3475
+ const localWildcardName = `${localName}[*]`;
3476
+ const localSubPath = `${localIndexName}.${subName}`;
3477
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
3478
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
3479
+ const label2 = subField.label || subName;
3480
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3481
+ NestedFieldProvider,
3482
+ {
3483
+ name: localIndexName,
3484
+ wildcardName: localWildcardName,
3485
+ subName,
3486
+ readOnlyFields,
3487
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3488
+ AutoFieldPrivate,
3489
+ {
3490
+ name: subPath,
3491
+ label: label2,
3492
+ id: `${_arrayId}_${subName}`,
3493
+ readOnly: subReadOnly,
3494
+ field: __spreadProps(__spreadValues({}, subField), {
3495
+ label: label2
3496
+ // May be used by custom fields
3497
+ }),
3498
+ value: data[subName],
3499
+ onChange: (val, ui) => {
3500
+ onChange(
3501
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
3502
+ [subName]: val
3503
+ })),
3504
+ ui
3505
+ );
3506
+ }
3505
3507
  }
3506
- }
3507
- )
3508
- },
3509
- subPath
3510
- );
3511
- }) }) })
3508
+ )
3509
+ },
3510
+ subPath
3511
+ );
3512
+ }
3513
+ ) }) })
3512
3514
  ]
3513
3515
  }
3514
3516
  )
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  renderContext,
17
17
  useGetPuck,
18
18
  usePuck
19
- } from "./chunk-EUMTIHGS.mjs";
19
+ } from "./chunk-ICVTPWJU.mjs";
20
20
  import {
21
21
  init_react_import,
22
22
  migrate,
@@ -3466,49 +3466,51 @@ var ArrayField = ({
3466
3466
  ]
3467
3467
  }
3468
3468
  ),
3469
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
3470
- const subField = field.arrayFields[subName];
3471
- const indexName = `${name}[${i}]`;
3472
- const subPath = `${indexName}.${subName}`;
3473
- const localIndexName = `${localName}[${i}]`;
3474
- const localWildcardName = `${localName}[*]`;
3475
- const localSubPath = `${localIndexName}.${subName}`;
3476
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
3477
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
3478
- const label2 = subField.label || subName;
3479
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3480
- NestedFieldProvider,
3481
- {
3482
- name: localIndexName,
3483
- wildcardName: localWildcardName,
3484
- subName,
3485
- readOnlyFields,
3486
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3487
- AutoFieldPrivate,
3488
- {
3489
- name: subPath,
3490
- label: label2,
3491
- id: `${_arrayId}_${subName}`,
3492
- readOnly: subReadOnly,
3493
- field: __spreadProps(__spreadValues({}, subField), {
3494
- label: label2
3495
- // May be used by custom fields
3496
- }),
3497
- value: data[subName],
3498
- onChange: (val, ui) => {
3499
- onChange(
3500
- replace(value, i, __spreadProps(__spreadValues({}, data), {
3501
- [subName]: val
3502
- })),
3503
- ui
3504
- );
3469
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: arrayState.openId === _arrayId && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
3470
+ (subName) => {
3471
+ const subField = field.arrayFields[subName];
3472
+ const indexName = `${name}[${i}]`;
3473
+ const subPath = `${indexName}.${subName}`;
3474
+ const localIndexName = `${localName}[${i}]`;
3475
+ const localWildcardName = `${localName}[*]`;
3476
+ const localSubPath = `${localIndexName}.${subName}`;
3477
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
3478
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
3479
+ const label2 = subField.label || subName;
3480
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3481
+ NestedFieldProvider,
3482
+ {
3483
+ name: localIndexName,
3484
+ wildcardName: localWildcardName,
3485
+ subName,
3486
+ readOnlyFields,
3487
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3488
+ AutoFieldPrivate,
3489
+ {
3490
+ name: subPath,
3491
+ label: label2,
3492
+ id: `${_arrayId}_${subName}`,
3493
+ readOnly: subReadOnly,
3494
+ field: __spreadProps(__spreadValues({}, subField), {
3495
+ label: label2
3496
+ // May be used by custom fields
3497
+ }),
3498
+ value: data[subName],
3499
+ onChange: (val, ui) => {
3500
+ onChange(
3501
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
3502
+ [subName]: val
3503
+ })),
3504
+ ui
3505
+ );
3506
+ }
3505
3507
  }
3506
- }
3507
- )
3508
- },
3509
- subPath
3510
- );
3511
- }) }) })
3508
+ )
3509
+ },
3510
+ subPath
3511
+ );
3512
+ }
3513
+ ) }) })
3512
3514
  ]
3513
3515
  }
3514
3516
  )
@@ -16,7 +16,7 @@ import {
16
16
  renderContext,
17
17
  useGetPuck,
18
18
  usePuck
19
- } from "./chunk-EUMTIHGS.mjs";
19
+ } from "./chunk-ICVTPWJU.mjs";
20
20
  import {
21
21
  init_react_import,
22
22
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.20.0-canary.0708ce21",
3
+ "version": "0.20.0-canary.14d96817",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",