@measured/puck 0.19.3 → 0.19.4-canary.a062f526

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/dist/index.js CHANGED
@@ -7187,7 +7187,14 @@ var styleSelector = 'style, link[rel="stylesheet"]';
7187
7187
  var collectStyles = (doc) => {
7188
7188
  const collected = [];
7189
7189
  doc.querySelectorAll(styleSelector).forEach((style) => {
7190
- collected.push(style);
7190
+ if (style.tagName === "STYLE") {
7191
+ const hasContent = !!style.innerHTML.trim();
7192
+ if (hasContent) {
7193
+ collected.push(style);
7194
+ }
7195
+ } else {
7196
+ collected.push(style);
7197
+ }
7191
7198
  });
7192
7199
  return collected;
7193
7200
  };
@@ -7200,7 +7207,7 @@ var getStyleSheet = (el) => {
7200
7207
  var getStyles = (styleSheet) => {
7201
7208
  if (styleSheet) {
7202
7209
  try {
7203
- return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
7210
+ return [...Array.from(styleSheet.cssRules)].map((rule) => rule.cssText).join("");
7204
7211
  } catch (e) {
7205
7212
  console.warn(
7206
7213
  "Access to stylesheet %s is denied. Ignoring\u2026",
package/dist/index.mjs CHANGED
@@ -6351,7 +6351,14 @@ var styleSelector = 'style, link[rel="stylesheet"]';
6351
6351
  var collectStyles = (doc) => {
6352
6352
  const collected = [];
6353
6353
  doc.querySelectorAll(styleSelector).forEach((style) => {
6354
- collected.push(style);
6354
+ if (style.tagName === "STYLE") {
6355
+ const hasContent = !!style.innerHTML.trim();
6356
+ if (hasContent) {
6357
+ collected.push(style);
6358
+ }
6359
+ } else {
6360
+ collected.push(style);
6361
+ }
6355
6362
  });
6356
6363
  return collected;
6357
6364
  };
@@ -6364,7 +6371,7 @@ var getStyleSheet = (el) => {
6364
6371
  var getStyles = (styleSheet) => {
6365
6372
  if (styleSheet) {
6366
6373
  try {
6367
- return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
6374
+ return [...Array.from(styleSheet.cssRules)].map((rule) => rule.cssText).join("");
6368
6375
  } catch (e) {
6369
6376
  console.warn(
6370
6377
  "Access to stylesheet %s is denied. Ignoring\u2026",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.19.3",
3
+ "version": "0.19.4-canary.a062f526",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",