@measured/puck 0.14.0-canary.70cf177 → 0.14.0-canary.924c85a

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.css CHANGED
@@ -281,25 +281,25 @@
281
281
  }
282
282
 
283
283
  /* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
284
- ._DraggableComponent_175tf_1 {
284
+ ._DraggableComponent_17mte_1 {
285
285
  pointer-events: auto;
286
286
  --overlay-background: color-mix( in srgb, var(--puck-color-azure-08) 30%, transparent );
287
287
  }
288
- ._DraggableComponent--isDragging_175tf_11 {
288
+ ._DraggableComponent--isDragging_17mte_11 {
289
289
  background: color-mix(in srgb, var(--puck-color-azure-08) 10%, transparent);
290
290
  overflow: hidden;
291
291
  }
292
- ._DraggableComponent-contents_175tf_16 {
292
+ ._DraggableComponent-contents_17mte_16 {
293
293
  position: relative;
294
294
  pointer-events: none;
295
295
  z-index: 0;
296
296
  }
297
- ._DraggableComponent-contents_175tf_16::before,
298
- ._DraggableComponent-contents_175tf_16::after {
297
+ ._DraggableComponent-contents_17mte_16::before,
298
+ ._DraggableComponent-contents_17mte_16::after {
299
299
  content: " ";
300
300
  display: table;
301
301
  }
302
- ._DraggableComponent-overlay_175tf_29 {
302
+ ._DraggableComponent-overlay_17mte_29 {
303
303
  cursor: pointer;
304
304
  height: 100%;
305
305
  width: 100%;
@@ -310,13 +310,13 @@
310
310
  box-sizing: border-box;
311
311
  z-index: 1;
312
312
  }
313
- ._DraggableComponent_175tf_1:focus-visible ._DraggableComponent-overlay_175tf_29 {
313
+ ._DraggableComponent_17mte_1:focus-visible ._DraggableComponent-overlay_17mte_29 {
314
314
  outline: 1px solid var(--puck-color-azure-05);
315
315
  }
316
- ._DraggableComponent--isDragging_175tf_11 ._DraggableComponent-overlay_175tf_29 {
316
+ ._DraggableComponent--isDragging_17mte_11 ._DraggableComponent-overlay_17mte_29 {
317
317
  outline: 1px var(--puck-color-azure-09) solid !important;
318
318
  }
319
- ._DraggableComponent-loadingOverlay_175tf_49 {
319
+ ._DraggableComponent-loadingOverlay_17mte_49 {
320
320
  background: var(--puck-color-white);
321
321
  color: var(--puck-color-grey-03);
322
322
  border-radius: 4px;
@@ -331,32 +331,32 @@
331
331
  opacity: 0.8;
332
332
  z-index: 1;
333
333
  }
334
- ._DraggableComponent_175tf_1:hover:not(._DraggableComponent--isLocked_175tf_65) > ._DraggableComponent-overlay_175tf_29 {
334
+ ._DraggableComponent_17mte_1:hover:not(._DraggableComponent--isLocked_17mte_65) > ._DraggableComponent-overlay_17mte_29 {
335
335
  background: var(--overlay-background);
336
336
  pointer-events: none;
337
337
  }
338
- ._DraggableComponent--forceHover_175tf_71 > ._DraggableComponent-overlay_175tf_29 {
338
+ ._DraggableComponent--forceHover_17mte_71 > ._DraggableComponent-overlay_17mte_29 {
339
339
  background: var(--overlay-background);
340
340
  pointer-events: none;
341
341
  }
342
- ._DraggableComponent_175tf_1:not(._DraggableComponent--isSelected_175tf_76):hover > ._DraggableComponent-overlay_175tf_29 {
342
+ ._DraggableComponent_17mte_1:not(._DraggableComponent--isSelected_17mte_76):hover > ._DraggableComponent-overlay_17mte_29 {
343
343
  outline: 2px var(--puck-color-azure-09) solid !important;
344
344
  }
345
- ._DraggableComponent--indicativeHover_175tf_81 > ._DraggableComponent-overlay_175tf_29 {
345
+ ._DraggableComponent--indicativeHover_17mte_81 > ._DraggableComponent-overlay_17mte_29 {
346
346
  pointer-events: none;
347
347
  }
348
- ._DraggableComponent_175tf_1:not(._DraggableComponent--isSelected_175tf_76):has(._DraggableComponent_175tf_1:hover > ._DraggableComponent-overlay_175tf_29) > ._DraggableComponent-overlay_175tf_29 {
348
+ ._DraggableComponent_17mte_1:not(._DraggableComponent--isSelected_17mte_76):has(._DraggableComponent_17mte_1:hover > ._DraggableComponent-overlay_17mte_29) > ._DraggableComponent-overlay_17mte_29 {
349
349
  display: none;
350
350
  }
351
- ._DraggableComponent--isSelected_175tf_76 ._DraggableComponent-overlay_175tf_29 {
351
+ ._DraggableComponent--isSelected_17mte_76 > ._DraggableComponent-overlay_17mte_29 {
352
352
  outline: 2px var(--puck-color-azure-07) solid !important;
353
353
  }
354
- ._DraggableComponent--isSelected_175tf_76 > ._DraggableComponent-actionsOverlay_175tf_97 {
354
+ ._DraggableComponent--isSelected_17mte_76 > ._DraggableComponent-actionsOverlay_17mte_97 {
355
355
  display: block;
356
356
  position: sticky;
357
357
  z-index: 2;
358
358
  }
359
- ._DraggableComponent-actions_175tf_97 {
359
+ ._DraggableComponent-actions_17mte_97 {
360
360
  position: absolute;
361
361
  width: auto;
362
362
  padding: 4px;
@@ -373,10 +373,10 @@
373
373
  box-sizing: border-box;
374
374
  transform-origin: right top;
375
375
  }
376
- ._DraggableComponent--isSelected_175tf_76 > ._DraggableComponent-actionsOverlay_175tf_97 > ._DraggableComponent-actions_175tf_97 {
376
+ ._DraggableComponent--isSelected_17mte_76 > ._DraggableComponent-actionsOverlay_17mte_97 > ._DraggableComponent-actions_17mte_97 {
377
377
  display: flex;
378
378
  }
379
- ._DraggableComponent-actionsLabel_175tf_127 {
379
+ ._DraggableComponent-actionsLabel_17mte_127 {
380
380
  color: var(--puck-color-grey-08);
381
381
  display: flex;
382
382
  font-size: var(--puck-font-size-xxxs);
@@ -390,7 +390,7 @@
390
390
  text-overflow: ellipsis;
391
391
  white-space: nowrap;
392
392
  }
393
- ._DraggableComponent-action_175tf_97 {
393
+ ._DraggableComponent-action_17mte_97 {
394
394
  background: transparent;
395
395
  border: none;
396
396
  color: var(--puck-color-grey-08);
@@ -403,17 +403,17 @@
403
403
  justify-content: center;
404
404
  transition: color 50ms ease-in;
405
405
  }
406
- ._DraggableComponent-action_175tf_97:focus-visible {
406
+ ._DraggableComponent-action_17mte_97:focus-visible {
407
407
  outline: 2px solid var(--puck-color-azure-05);
408
408
  outline-offset: -2px;
409
409
  }
410
410
  @media (hover: hover) and (pointer: fine) {
411
- ._DraggableComponent-action_175tf_97:hover {
411
+ ._DraggableComponent-action_17mte_97:hover {
412
412
  color: var(--puck-color-azure-06);
413
413
  transition: none;
414
414
  }
415
415
  }
416
- ._DraggableComponent-action_175tf_97:active {
416
+ ._DraggableComponent-action_17mte_97:active {
417
417
  color: var(--puck-color-azure-07);
418
418
  transition: none;
419
419
  }
@@ -1549,14 +1549,23 @@ textarea._Input-input_1qi5b_46 {
1549
1549
  }
1550
1550
 
1551
1551
  /* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css/#css-module-data */
1552
- ._PuckPreview_29rm6_1 {
1552
+ ._PuckPreview_379hm_1 {
1553
1553
  height: 100%;
1554
1554
  }
1555
- ._PuckPreview-iframe_29rm6_5 {
1555
+ ._PuckPreview-iframe_379hm_5 {
1556
1556
  border: none;
1557
1557
  height: 100%;
1558
1558
  width: 100%;
1559
1559
  }
1560
+ ._PuckPreview-content_379hm_11 {
1561
+ height: 100%;
1562
+ width: 100%;
1563
+ opacity: 0;
1564
+ transition: opacity 150ms ease-out;
1565
+ }
1566
+ ._PuckPreview--stylesLoaded_379hm_18 ._PuckPreview-content_379hm_11 {
1567
+ opacity: 1;
1568
+ }
1560
1569
 
1561
1570
  /* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
1562
1571
  ._LayerTree_1pgw8_1 {
package/dist/index.js CHANGED
@@ -8084,7 +8084,7 @@ var require_react_dom_development = __commonJS({
8084
8084
  var HostPortal = 4;
8085
8085
  var HostComponent = 5;
8086
8086
  var HostText = 6;
8087
- var Fragment14 = 7;
8087
+ var Fragment16 = 7;
8088
8088
  var Mode = 8;
8089
8089
  var ContextConsumer = 9;
8090
8090
  var ContextProvider = 10;
@@ -9240,7 +9240,7 @@ var require_react_dom_development = __commonJS({
9240
9240
  return "DehydratedFragment";
9241
9241
  case ForwardRef:
9242
9242
  return getWrappedName$1(type, type.render, "ForwardRef");
9243
- case Fragment14:
9243
+ case Fragment16:
9244
9244
  return "Fragment";
9245
9245
  case HostComponent:
9246
9246
  return type;
@@ -18911,7 +18911,7 @@ var require_react_dom_development = __commonJS({
18911
18911
  }
18912
18912
  }
18913
18913
  function updateFragment2(returnFiber, current2, fragment, lanes, key) {
18914
- if (current2 === null || current2.tag !== Fragment14) {
18914
+ if (current2 === null || current2.tag !== Fragment16) {
18915
18915
  var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
18916
18916
  created.return = returnFiber;
18917
18917
  return created;
@@ -19314,7 +19314,7 @@ var require_react_dom_development = __commonJS({
19314
19314
  if (child.key === key) {
19315
19315
  var elementType = element.type;
19316
19316
  if (elementType === REACT_FRAGMENT_TYPE) {
19317
- if (child.tag === Fragment14) {
19317
+ if (child.tag === Fragment16) {
19318
19318
  deleteRemainingChildren(returnFiber, child.sibling);
19319
19319
  var existing = useFiber(child, element.props.children);
19320
19320
  existing.return = returnFiber;
@@ -23489,7 +23489,7 @@ var require_react_dom_development = __commonJS({
23489
23489
  var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
23490
23490
  return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
23491
23491
  }
23492
- case Fragment14:
23492
+ case Fragment16:
23493
23493
  return updateFragment(current2, workInProgress2, renderLanes2);
23494
23494
  case Mode:
23495
23495
  return updateMode(current2, workInProgress2, renderLanes2);
@@ -23762,7 +23762,7 @@ var require_react_dom_development = __commonJS({
23762
23762
  case SimpleMemoComponent:
23763
23763
  case FunctionComponent:
23764
23764
  case ForwardRef:
23765
- case Fragment14:
23765
+ case Fragment16:
23766
23766
  case Mode:
23767
23767
  case Profiler:
23768
23768
  case ContextConsumer:
@@ -28021,7 +28021,7 @@ var require_react_dom_development = __commonJS({
28021
28021
  return fiber;
28022
28022
  }
28023
28023
  function createFiberFromFragment(elements, mode, lanes, key) {
28024
- var fiber = createFiber(Fragment14, elements, key, mode);
28024
+ var fiber = createFiber(Fragment16, elements, key, mode);
28025
28025
  fiber.lanes = lanes;
28026
28026
  return fiber;
28027
28027
  }
@@ -29400,7 +29400,7 @@ var defaultSnapshot = {
29400
29400
  draggingFromThisWith: null,
29401
29401
  isUsingPlaceholder: false
29402
29402
  };
29403
- var DefaultDroppable = ({ children }) => children(defaultProvided, defaultSnapshot);
29403
+ var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: children(defaultProvided, defaultSnapshot) });
29404
29404
  var Droppable = (props) => {
29405
29405
  const { status } = useAppContext();
29406
29406
  const El = status === "READY" ? import_dnd.Droppable : DefaultDroppable;
@@ -29438,7 +29438,7 @@ var defaultRubric = {
29438
29438
  type: "",
29439
29439
  source: { droppableId: "", index: 0 }
29440
29440
  };
29441
- var DefaultDraggable = ({ children }) => children(defaultProvided2, defaultSnapshot2, defaultRubric);
29441
+ var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: children(defaultProvided2, defaultSnapshot2, defaultRubric) });
29442
29442
  var Draggable = ({
29443
29443
  className,
29444
29444
  children,
@@ -29587,7 +29587,7 @@ var import_dnd3 = require("@measured/dnd");
29587
29587
 
29588
29588
  // css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
29589
29589
  init_react_import();
29590
- var styles_module_default3 = { "DraggableComponent": "_DraggableComponent_175tf_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_175tf_11", "DraggableComponent-contents": "_DraggableComponent-contents_175tf_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_175tf_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_175tf_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_175tf_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_175tf_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_175tf_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_175tf_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_175tf_97", "DraggableComponent-actions": "_DraggableComponent-actions_175tf_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_175tf_127", "DraggableComponent-action": "_DraggableComponent-action_175tf_97" };
29590
+ var styles_module_default3 = { "DraggableComponent": "_DraggableComponent_17mte_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_17mte_11", "DraggableComponent-contents": "_DraggableComponent-contents_17mte_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_17mte_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_17mte_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_17mte_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_17mte_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_17mte_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_17mte_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_17mte_97", "DraggableComponent-actions": "_DraggableComponent-actions_17mte_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_17mte_127", "DraggableComponent-action": "_DraggableComponent-action_17mte_97" };
29591
29591
 
29592
29592
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
29593
29593
  init_react_import();
@@ -31333,7 +31333,7 @@ var import_react14 = require("react");
31333
31333
  init_react_import();
31334
31334
  var import_dnd4 = require("@measured/dnd");
31335
31335
  var import_jsx_runtime14 = require("react/jsx-runtime");
31336
- var DefaultDragDropContext = ({ children }) => children;
31336
+ var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
31337
31337
  var DragDropContext = (props) => {
31338
31338
  const { status } = useAppContext();
31339
31339
  const El = status === "READY" ? import_dnd4.DragDropContext : DefaultDragDropContext;
@@ -32552,7 +32552,7 @@ var import_auto_frame_component = __toESM(require("@measured/auto-frame-componen
32552
32552
 
32553
32553
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css#css-module
32554
32554
  init_react_import();
32555
- var styles_module_default16 = { "PuckPreview": "_PuckPreview_29rm6_1", "PuckPreview-iframe": "_PuckPreview-iframe_29rm6_5" };
32555
+ var styles_module_default16 = { "PuckPreview": "_PuckPreview_379hm_1", "PuckPreview-iframe": "_PuckPreview-iframe_379hm_5", "PuckPreview-content": "_PuckPreview-content_379hm_11", "PuckPreview--stylesLoaded": "_PuckPreview--stylesLoaded_379hm_18" };
32556
32556
 
32557
32557
  // components/Puck/components/Preview/index.tsx
32558
32558
  var import_jsx_runtime29 = require("react/jsx-runtime");
@@ -32568,24 +32568,30 @@ var Preview = ({ id = "puck-preview" }) => {
32568
32568
  );
32569
32569
  const rootProps = state.data.root.props || state.data.root;
32570
32570
  const ref = (0, import_react22.useRef)(null);
32571
+ const [stylesLoaded, setStylesLoaded] = (0, import_react22.useState)(false);
32571
32572
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
32572
32573
  "div",
32573
32574
  {
32574
- className: getClassName21(),
32575
+ className: getClassName21({ stylesLoaded }),
32575
32576
  id,
32576
32577
  onClick: () => {
32577
32578
  dispatch({ type: "setUi", ui: __spreadProps(__spreadValues({}, state.ui), { itemSelector: null }) });
32578
32579
  },
32579
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
32580
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName21("content"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
32580
32581
  import_auto_frame_component.default,
32581
32582
  {
32582
32583
  id: "preview-iframe",
32583
32584
  className: getClassName21("iframe"),
32584
32585
  "data-rfd-iframe": true,
32585
32586
  ref,
32587
+ debug: true,
32588
+ onStylesLoaded: () => {
32589
+ console.log("callback");
32590
+ setStylesLoaded(true);
32591
+ },
32586
32592
  children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Page, __spreadProps(__spreadValues({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropZone, { zone: rootDroppableId }) }))
32587
32593
  }
32588
- )
32594
+ ) })
32589
32595
  }
32590
32596
  );
32591
32597
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.14.0-canary.70cf177",
3
+ "version": "0.14.0-canary.924c85a",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -59,7 +59,7 @@
59
59
  "typescript": "^4.5.2"
60
60
  },
61
61
  "dependencies": {
62
- "@measured/auto-frame-component": "0.1.0-canary.4686711",
62
+ "@measured/auto-frame-component": "0.1.0",
63
63
  "@measured/dnd": "16.6.0-canary.dcf051d",
64
64
  "deep-diff": "^1.0.2",
65
65
  "react-hotkeys-hook": "^4.4.1",