@measured/puck 0.7.0 → 0.7.1-canary.104091a

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/README.md CHANGED
@@ -16,6 +16,7 @@ Render the editor:
16
16
  ```jsx
17
17
  // Editor.jsx
18
18
  import { Puck } from "@measured/puck";
19
+ import "@measured/puck/dist/index.css";
19
20
 
20
21
  // Create puck component config
21
22
  const config = {
@@ -34,7 +35,10 @@ const config = {
34
35
  };
35
36
 
36
37
  // Describe the initial data
37
- const initialData = {};
38
+ const initialData = {
39
+ content: [],
40
+ root: {},
41
+ };
38
42
 
39
43
  // Save the data to your database
40
44
  const save = (data) => {};
package/dist/index.css CHANGED
@@ -419,38 +419,38 @@
419
419
  }
420
420
 
421
421
  /* css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/styles.module.css/#css-module-data */
422
- ._Input_kf9j8_1 {
422
+ ._Input_16exs_1 {
423
423
  color: var(--puck-color-grey-3);
424
424
  padding: 16px;
425
425
  padding-bottom: 12px;
426
426
  display: block;
427
427
  font-family: var(--puck-font-stack);
428
428
  }
429
- ._Input_kf9j8_1 ._Input_kf9j8_1 {
429
+ ._Input_16exs_1 ._Input_16exs_1 {
430
430
  padding: 0px;
431
431
  }
432
- ._Input_kf9j8_1 * {
432
+ ._Input_16exs_1 * {
433
433
  box-sizing: border-box;
434
434
  }
435
- ._Input_kf9j8_1 + ._Input_kf9j8_1 {
435
+ ._Input_16exs_1 + ._Input_16exs_1 {
436
436
  border-top: 1px solid var(--puck-color-grey-8);
437
437
  margin-top: 8px;
438
438
  }
439
- ._Input_kf9j8_1 ._Input_kf9j8_1 + ._Input_kf9j8_1 {
439
+ ._Input_16exs_1 ._Input_16exs_1 + ._Input_16exs_1 {
440
440
  border-top: 0px;
441
441
  margin-top: 12px;
442
442
  }
443
- ._Input-label_kf9j8_27 {
443
+ ._Input-label_16exs_27 {
444
444
  display: flex;
445
445
  padding-bottom: 12px;
446
446
  font-size: var(--puck-font-size-xxs);
447
447
  font-weight: 600;
448
448
  }
449
- ._Input-labelIcon_kf9j8_34 {
449
+ ._Input-labelIcon_16exs_34 {
450
450
  color: var(--puck-color-grey-6);
451
451
  margin-right: 4px;
452
452
  }
453
- ._Input-input_kf9j8_39 {
453
+ ._Input-input_16exs_39 {
454
454
  border-width: 1px;
455
455
  border-style: solid;
456
456
  border-color: var(--puck-color-grey-8);
@@ -459,7 +459,7 @@
459
459
  padding: 12px 16px;
460
460
  width: 100%;
461
461
  }
462
- ._Input_kf9j8_1 select {
462
+ ._Input_16exs_1 select {
463
463
  appearance: none;
464
464
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
465
465
  background-size: 12px;
@@ -467,19 +467,19 @@
467
467
  background-repeat: no-repeat;
468
468
  background-color: white;
469
469
  }
470
- ._Input--readOnly_kf9j8_60 ._Input-input_kf9j8_39 {
470
+ ._Input--readOnly_16exs_60 ._Input-input_16exs_39 {
471
471
  background-color: var(--puck-color-grey-10);
472
472
  border-color: var(--puck-color-grey-8);
473
473
  }
474
- ._Input-input_kf9j8_39:hover {
474
+ ._Input-input_16exs_39:hover {
475
475
  border-color: var(--puck-color-neutral-3);
476
476
  }
477
- ._Input-arrayItem_kf9j8_69 {
477
+ ._Input-arrayItem_16exs_69 {
478
478
  background: white;
479
479
  border: 1px solid var(--puck-color-grey-8);
480
480
  border-radius: 4px;
481
481
  }
482
- ._Input-arrayItem_kf9j8_69 > summary {
482
+ ._Input-arrayItem_16exs_69 > summary {
483
483
  color: var(--puck-color-grey-3);
484
484
  display: flex;
485
485
  align-items: center;
@@ -489,14 +489,14 @@
489
489
  padding: 12px 16px;
490
490
  position: relative;
491
491
  }
492
- ._Input-arrayItem_kf9j8_69 > summary:hover {
492
+ ._Input-arrayItem_16exs_69 > summary:hover {
493
493
  cursor: pointer;
494
494
  color: var(--puck-color-blue);
495
495
  }
496
- ._Input-arrayItem_kf9j8_69 > summary::-webkit-details-marker {
496
+ ._Input-arrayItem_16exs_69 > summary::-webkit-details-marker {
497
497
  display: none;
498
498
  }
499
- ._Input-arrayItem_kf9j8_69 > fieldset {
499
+ ._Input-arrayItem_16exs_69 > ._Input-fieldset_16exs_95 {
500
500
  background-color: var(--puck-color-grey-11);
501
501
  border: none;
502
502
  border-top: 1px solid var(--puck-color-grey-8);
@@ -504,28 +504,28 @@
504
504
  padding-bottom: 16px;
505
505
  padding-top: 16px;
506
506
  }
507
- ._Input-arrayItem_kf9j8_69 > fieldset ._Input_kf9j8_1 + ._Input-arrayItem_kf9j8_69 > fieldset ._Input_kf9j8_1 {
507
+ ._Input-arrayItem_16exs_69 > ._Input-fieldset_16exs_95 ._Input_16exs_1 + ._Input-arrayItem_16exs_69 > ._Input-fieldset_16exs_95 ._Input_16exs_1 {
508
508
  margin-top: 16px;
509
509
  }
510
- ._Input-arrayItem_kf9j8_69 > fieldset ._Input-label_kf9j8_27 {
510
+ ._Input-arrayItem_16exs_69 > ._Input-fieldset_16exs_95 ._Input-label_16exs_27 {
511
511
  padding-bottom: 4px;
512
512
  }
513
- ._Input-arrayItem_kf9j8_69 ._Input-arrayItemAction_kf9j8_112 {
513
+ ._Input-arrayItem_16exs_69 ._Input-arrayItemAction_16exs_117 {
514
514
  border-radius: 4px;
515
515
  opacity: 0;
516
516
  }
517
- ._Input-arrayItem_kf9j8_69 summary:hover ._Input-arrayItemAction_kf9j8_112 {
517
+ ._Input-arrayItem_16exs_69 summary:hover ._Input-arrayItemAction_16exs_117 {
518
518
  opacity: 1;
519
519
  }
520
- ._Input-arrayItem_kf9j8_69 ._Input-arrayItemAction_kf9j8_112:hover {
520
+ ._Input-arrayItem_16exs_69 ._Input-arrayItemAction_16exs_117:hover {
521
521
  background: var(--puck-color-grey-9);
522
522
  color: var(--puck-color-blue);
523
523
  cursor: pointer;
524
524
  }
525
- ._Input-arrayItem_kf9j8_69 + ._Input-arrayItem_kf9j8_69 {
525
+ ._Input-arrayItem_16exs_69 + ._Input-arrayItem_16exs_69 {
526
526
  margin-top: 12px;
527
527
  }
528
- ._Input-addButton_kf9j8_131 {
528
+ ._Input-addButton_16exs_136 {
529
529
  background-color: white;
530
530
  border: none;
531
531
  border-radius: 4px;
@@ -537,45 +537,45 @@
537
537
  padding: 12px 16px;
538
538
  text-align: left;
539
539
  }
540
- ._Input-addButton_kf9j8_131:hover {
540
+ ._Input-addButton_16exs_136:hover {
541
541
  background: var(--puck-color-grey-10);
542
542
  }
543
- ._Input-array_kf9j8_69 {
543
+ ._Input-array_16exs_69 {
544
544
  overflow: hidden;
545
545
  }
546
- ._Input-radioGroupItems_kf9j8_152 {
546
+ ._Input-radioGroupItems_16exs_157 {
547
547
  display: flex;
548
548
  border: 1px solid var(--puck-color-grey-7);
549
549
  border-radius: 4px;
550
550
  flex-wrap: wrap;
551
551
  overflow: hidden;
552
552
  }
553
- ._Input-radio_kf9j8_152 {
553
+ ._Input-radio_16exs_157 {
554
554
  border-right: 1px solid var(--puck-color-grey-7);
555
555
  flex-grow: 1;
556
556
  }
557
- ._Input-radio_kf9j8_152:last-of-type {
557
+ ._Input-radio_16exs_157:last-of-type {
558
558
  border-right: none;
559
559
  }
560
- ._Input-radioInner_kf9j8_169 {
560
+ ._Input-radioInner_16exs_174 {
561
561
  color: var(--puck-color-grey-4);
562
562
  font-size: var(--puck-font-size-xxxs);
563
563
  padding: 8px 12px;
564
564
  text-align: center;
565
565
  }
566
- ._Input-radioInner_kf9j8_169:hover {
566
+ ._Input-radioInner_16exs_174:hover {
567
567
  background-color: var(--puck-color-azure-9);
568
568
  cursor: pointer;
569
569
  }
570
- ._Input-radio_kf9j8_152 input:checked ~ ._Input-radioInner_kf9j8_169 {
570
+ ._Input-radio_16exs_157 ._Input-radioInput_16exs_186:checked ~ ._Input-radioInner_16exs_174 {
571
571
  background-color: var(--puck-color-azure-9);
572
572
  color: var(--puck-color-grey-2);
573
573
  font-weight: 500;
574
574
  }
575
- ._Input-radio_kf9j8_152 input {
575
+ ._Input-radio_16exs_157 ._Input-radioInput_16exs_186 {
576
576
  display: none;
577
577
  }
578
- ._Input_kf9j8_1 textarea {
578
+ ._Input_16exs_1 textarea._Input-input_16exs_39 {
579
579
  margin-bottom: -4px;
580
580
  }
581
581
 
package/dist/index.js CHANGED
@@ -525,7 +525,7 @@ var ExternalInput = ({
525
525
 
526
526
  // css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/styles.module.css#css-module
527
527
  init_react_import();
528
- var styles_module_default3 = { "Input": "_Input_kf9j8_1", "Input-label": "_Input-label_kf9j8_27", "Input-labelIcon": "_Input-labelIcon_kf9j8_34", "Input-input": "_Input-input_kf9j8_39", "Input--readOnly": "_Input--readOnly_kf9j8_60", "Input-arrayItem": "_Input-arrayItem_kf9j8_69", "Input-arrayItemAction": "_Input-arrayItemAction_kf9j8_112", "Input-addButton": "_Input-addButton_kf9j8_131", "Input-array": "_Input-array_kf9j8_69", "Input-radioGroupItems": "_Input-radioGroupItems_kf9j8_152", "Input-radio": "_Input-radio_kf9j8_152", "Input-radioInner": "_Input-radioInner_kf9j8_169" };
528
+ var styles_module_default3 = { "Input": "_Input_16exs_1", "Input-label": "_Input-label_16exs_27", "Input-labelIcon": "_Input-labelIcon_16exs_34", "Input-input": "_Input-input_16exs_39", "Input--readOnly": "_Input--readOnly_16exs_60", "Input-arrayItem": "_Input-arrayItem_16exs_69", "Input-fieldset": "_Input-fieldset_16exs_95", "Input-arrayItemAction": "_Input-arrayItemAction_16exs_117", "Input-addButton": "_Input-addButton_16exs_136", "Input-array": "_Input-array_16exs_69", "Input-radioGroupItems": "_Input-radioGroupItems_16exs_157", "Input-radio": "_Input-radio_16exs_157", "Input-radioInner": "_Input-radioInner_16exs_174", "Input-radioInput": "_Input-radioInput_16exs_186" };
529
529
 
530
530
  // lib/index.ts
531
531
  init_react_import();
@@ -614,7 +614,7 @@ var InputOrGroup = ({
614
614
  }
615
615
  ) })
616
616
  ] }),
617
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("fieldset", { children: Object.keys(field.arrayFields).map((fieldName) => {
617
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("fieldset", { className: getClassName5("fieldset"), children: Object.keys(field.arrayFields).map((fieldName) => {
618
618
  const subField = field.arrayFields[fieldName];
619
619
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
620
620
  InputOrGroup,
@@ -728,6 +728,7 @@ var InputOrGroup = ({
728
728
  "input",
729
729
  {
730
730
  type: "radio",
731
+ className: getClassName5("radioInput"),
731
732
  value: option.value,
732
733
  name,
733
734
  onChange: (e) => {
@@ -1301,6 +1302,11 @@ function Puck({
1301
1302
  id: "puck-drop-zone",
1302
1303
  children: [
1303
1304
  data.content.map((item, i) => {
1305
+ var _a2;
1306
+ const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
1307
+ "No configuration for ",
1308
+ item.type
1309
+ ] });
1304
1310
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1305
1311
  DraggableComponent,
1306
1312
  {
@@ -1330,17 +1336,11 @@ function Puck({
1330
1336
  setData(newData);
1331
1337
  e.stopPropagation();
1332
1338
  },
1333
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { zoom: 0.75 }, children: config.components[item.type] ? config.components[item.type].render(__spreadProps(__spreadValues(__spreadValues({}, config.components[item.type].defaultProps), item.props), {
1334
- editMode: true
1335
- })) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1336
- "div",
1337
- {
1338
- style: { padding: 48, textAlign: "center" },
1339
- children: [
1340
- "No configuration for ",
1341
- item.type
1342
- ]
1343
- }
1339
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { zoom: 0.75 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1340
+ Render2,
1341
+ __spreadProps(__spreadValues(__spreadValues({}, (_a2 = config.components[item.type]) == null ? void 0 : _a2.defaultProps), item.props), {
1342
+ editMode: true
1343
+ })
1344
1344
  ) })
1345
1345
  },
1346
1346
  item.props.id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.7.0",
3
+ "version": "0.7.1-canary.104091a",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",