@tightknitai/block-kitchen 0.10.13 → 0.10.15

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
@@ -1922,11 +1922,18 @@ var EMBED_KEYS = /* @__PURE__ */ new Set(["video_url"]);
1922
1922
  var URL_KEY = /(^|_)(url|uri|link|href|src)$/;
1923
1923
  var MAYBE_URL_KEY = /url|uri|link|href|src/i;
1924
1924
  var IMAGE_KEY_HINT = /image|thumb|icon|avatar|logo|photo|picture/;
1925
+ var PROP_BAG_KEY = /(^|_)props$/;
1926
+ function normalizeKey(key) {
1927
+ return key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
1928
+ }
1929
+ function isRendererPropBag(key) {
1930
+ return PROP_BAG_KEY.test(normalizeKey(key));
1931
+ }
1925
1932
  function classifyUrlKey(key) {
1926
1933
  if (!MAYBE_URL_KEY.test(key)) {
1927
1934
  return null;
1928
1935
  }
1929
- const normalized = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
1936
+ const normalized = normalizeKey(key);
1930
1937
  if (EMBED_KEYS.has(normalized)) {
1931
1938
  return "embed";
1932
1939
  }
@@ -1962,7 +1969,7 @@ function sanitizeValue(value) {
1962
1969
  const dropKeys = typeof src.type === "string" ? RETRIEVAL_ONLY_KEYS.get(src.type) : void 0;
1963
1970
  let copy = null;
1964
1971
  for (const key of Object.keys(src)) {
1965
- if (dropKeys?.has(key)) {
1972
+ if (dropKeys?.has(key) || isRendererPropBag(key)) {
1966
1973
  copy ??= { ...src };
1967
1974
  delete copy[key];
1968
1975
  continue;
@@ -3329,6 +3336,10 @@ function SlackBlockPreview({
3329
3336
  el.setAttribute("data-bk-blocked-src", "1");
3330
3337
  }
3331
3338
  }
3339
+ for (const frame of root.querySelectorAll("iframe[srcdoc]")) {
3340
+ frame.removeAttribute("srcdoc");
3341
+ frame.setAttribute("data-bk-blocked-srcdoc", "1");
3342
+ }
3332
3343
  });
3333
3344
  return (
3334
3345
  // The library scopes all of its CSS under `#slack_blocks_to_jsx` and