@measured/puck 0.14.2-canary.c4a66ad → 0.14.2-canary.e529e85

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -108,7 +108,7 @@ Available recipes include:
108
108
 
109
109
  Puck is developed and maintained by **Measured**, a small group of industry veterans with decades of experience helping companies solve hard UI problems. We offer consultancy and development services for scale-ups, SMEs and enterprises.
110
110
 
111
- If you need support integrating Puck or creating a beautiful component library, please reach out via [our website](https://measured.co).
111
+ If you need support integrating Puck or creating a beautiful component library, please reach out via the [Measured](https://measured.co) website.
112
112
 
113
113
  ## License
114
114
 
package/dist/index.js CHANGED
@@ -29311,6 +29311,7 @@ var defaultViewports = [
29311
29311
  ];
29312
29312
 
29313
29313
  // components/Puck/context.tsx
29314
+ var import_ua_parser_js = require("ua-parser-js");
29314
29315
  var import_jsx_runtime2 = require("react/jsx-runtime");
29315
29316
  var defaultAppState = {
29316
29317
  data: { content: [], root: { props: { title: "" } } },
@@ -29350,7 +29351,8 @@ var defaultContext = {
29350
29351
  setZoomConfig: () => null,
29351
29352
  status: "LOADING",
29352
29353
  setStatus: () => null,
29353
- iframe: {}
29354
+ iframe: {},
29355
+ safariFallbackMode: false
29354
29356
  };
29355
29357
  var appContext = (0, import_react3.createContext)(defaultContext);
29356
29358
  var AppProvider = ({
@@ -29362,10 +29364,34 @@ var AppProvider = ({
29362
29364
  (0, import_react3.useEffect)(() => {
29363
29365
  setStatus("MOUNTED");
29364
29366
  }, []);
29367
+ const [safariFallbackMode, setSafariFallbackMode] = (0, import_react3.useState)(false);
29368
+ (0, import_react3.useEffect)(() => {
29369
+ var _a, _b, _c;
29370
+ const ua = new import_ua_parser_js.UAParser(navigator.userAgent);
29371
+ const { browser } = ua.getResult();
29372
+ if (browser.name === "Safari" && (((_a = browser.version) == null ? void 0 : _a.indexOf("17.2.")) || ((_b = browser.version) == null ? void 0 : _b.indexOf("17.3.")) || ((_c = browser.version) == null ? void 0 : _c.indexOf("17.4.")))) {
29373
+ if (process.env.NODE_ENV !== "production" && value.iframe.enabled) {
29374
+ console.warn(
29375
+ `Detected Safari ${browser.version}, which contains a bug that prevents Puck DropZones from detecting a mouseover event within an iframe. This affects Safari versions 17.2, 17.3 and 17.4.
29376
+
29377
+ Running in compatibility mode, which may have some DropZone side-effects. Alternatively, consider disabling iframes: https://puckeditor.com/docs/integrating-puck/viewports#opting-out-of-iframes.
29378
+
29379
+ See https://github.com/measuredco/puck/issues/411 for more information. This message will not show in production.`
29380
+ );
29381
+ }
29382
+ setSafariFallbackMode(true);
29383
+ }
29384
+ }, []);
29365
29385
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
29366
29386
  appContext.Provider,
29367
29387
  {
29368
- value: __spreadProps(__spreadValues({}, value), { zoomConfig, setZoomConfig, status, setStatus }),
29388
+ value: __spreadProps(__spreadValues({}, value), {
29389
+ zoomConfig,
29390
+ setZoomConfig,
29391
+ status,
29392
+ setStatus,
29393
+ safariFallbackMode
29394
+ }),
29369
29395
  children
29370
29396
  }
29371
29397
  );
@@ -30193,7 +30219,11 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
30193
30219
  let isEnabled = userWillDrag;
30194
30220
  if (userIsDragging) {
30195
30221
  if (draggingNewComponent) {
30196
- isEnabled = hoveringOverArea;
30222
+ if (appContext2.safariFallbackMode) {
30223
+ isEnabled = true;
30224
+ } else {
30225
+ isEnabled = hoveringOverArea;
30226
+ }
30197
30227
  } else {
30198
30228
  isEnabled = draggingOverArea && hoveringOverZone;
30199
30229
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.14.2-canary.c4a66ad",
3
+ "version": "0.14.2-canary.e529e85",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -46,6 +46,7 @@
46
46
  "@types/jest": "^29.5.4",
47
47
  "@types/react": "^18.2.0",
48
48
  "@types/react-dom": "^18.2.0",
49
+ "@types/ua-parser-js": "^0.7.39",
49
50
  "css-box-model": "^1.2.1",
50
51
  "eslint": "^7.32.0",
51
52
  "eslint-config-custom": "*",
@@ -59,11 +60,12 @@
59
60
  "typescript": "^4.5.2"
60
61
  },
61
62
  "dependencies": {
62
- "@measured/auto-frame-component": "0.1.1",
63
- "@measured/dnd": "16.6.0-canary.f472135",
63
+ "@measured/auto-frame-component": "0.1.3",
64
+ "@measured/dnd": "16.6.0-canary.eda7e8b",
64
65
  "deep-diff": "^1.0.2",
65
66
  "react-hotkeys-hook": "^4.4.1",
66
67
  "react-spinners": "^0.13.8",
68
+ "ua-parser-js": "^1.0.37",
67
69
  "use-debounce": "^9.0.4",
68
70
  "uuid": "^9.0.1"
69
71
  },