@measured/puck-plugin-heading-analyzer 0.14.2-canary.e585f20 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/index.js +25 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -45907,7 +45907,10 @@ var require_dist = __commonJS({
45907
45907
  return collected;
45908
45908
  };
45909
45909
  var getStyleSheet = (el) => {
45910
- return Array.from(document.styleSheets).find((ss) => ss.ownerNode === el);
45910
+ return Array.from(document.styleSheets).find((ss) => {
45911
+ const ownerNode = ss.ownerNode;
45912
+ return ownerNode.href === el.href;
45913
+ });
45911
45914
  };
45912
45915
  var getStyles2 = (styleSheet) => {
45913
45916
  if (styleSheet) {
@@ -45945,7 +45948,13 @@ var require_dist = __commonJS({
45945
45948
  mirror.type = "text/css";
45946
45949
  let styleSheet = getStyleSheet(el);
45947
45950
  if (!styleSheet) {
45948
- yield new Promise((resolve) => el.onload = resolve);
45951
+ yield new Promise((resolve) => {
45952
+ const fn = () => {
45953
+ resolve();
45954
+ el.removeEventListener("load", fn);
45955
+ };
45956
+ el.addEventListener("load", fn);
45957
+ });
45949
45958
  styleSheet = getStyleSheet(el);
45950
45959
  }
45951
45960
  const styles = getStyles2(styleSheet);
@@ -46038,15 +46047,17 @@ var require_dist = __commonJS({
46038
46047
  });
46039
46048
  const parentDocument = win.parent.document;
46040
46049
  const collectedStyles = collectStyles(parentDocument);
46041
- let mountedCounter = 0;
46050
+ const hrefs = [];
46042
46051
  Promise.all(
46043
- collectedStyles.map((styleNode) => __async2(void 0, null, function* () {
46044
- const mirror = yield mirrorEl(styleNode, () => {
46045
- mountedCounter += 1;
46046
- if (mountedCounter === collectedStyles.length) {
46047
- onStylesLoaded();
46052
+ collectedStyles.map((styleNode, i2) => __async2(void 0, null, function* () {
46053
+ if (styleNode.nodeName === "LINK") {
46054
+ const linkHref = styleNode.href;
46055
+ if (hrefs.indexOf(linkHref) > -1) {
46056
+ return;
46048
46057
  }
46049
- });
46058
+ hrefs.push(linkHref);
46059
+ }
46060
+ const mirror = yield mirrorEl(styleNode);
46050
46061
  if (!mirror)
46051
46062
  return;
46052
46063
  elements.push({ original: styleNode, mirror });
@@ -46063,6 +46074,7 @@ var require_dist = __commonJS({
46063
46074
  const elHash = (0, import_object_hash.default)(el.outerHTML);
46064
46075
  hashes[elHash] = true;
46065
46076
  });
46077
+ onStylesLoaded();
46066
46078
  });
46067
46079
  return () => {
46068
46080
  observer.disconnect();
@@ -78350,7 +78362,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
78350
78362
  onChange(e2.currentTarget.value);
78351
78363
  },
78352
78364
  disabled: readOnly,
78353
- defaultChecked: value === option.value
78365
+ checked: value === option.value
78354
78366
  }
78355
78367
  ),
78356
78368
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14("radioInner"), children: option.label || option.value })
@@ -79645,7 +79657,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
79645
79657
  viewports = defaultViewports2,
79646
79658
  iframe = {
79647
79659
  enabled: true
79648
- }
79660
+ },
79661
+ dnd
79649
79662
  }) {
79650
79663
  var _a3;
79651
79664
  const historyStore = useHistoryStore();
@@ -79845,6 +79858,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
79845
79858
  children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
79846
79859
  DragDropContext2,
79847
79860
  {
79861
+ autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
79848
79862
  onDragUpdate: (update2) => {
79849
79863
  setDraggedItem(__spreadValues2(__spreadValues2({}, draggedItem), update2));
79850
79864
  onDragStartOrUpdate(update2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck-plugin-heading-analyzer",
3
- "version": "0.14.2-canary.e585f20",
3
+ "version": "0.14.2",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -18,7 +18,7 @@
18
18
  "dist"
19
19
  ],
20
20
  "devDependencies": {
21
- "@measured/puck": "^0.14.2-canary.e585f20",
21
+ "@measured/puck": "^0.14.2",
22
22
  "@types/react": "^18.2.0",
23
23
  "@types/react-dom": "^18.2.0",
24
24
  "eslint": "^7.32.0",