@storyblok/react 5.4.9 → 5.4.11

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/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function l(t){return t.replace(/-([a-z])/g,o=>o[1].toUpperCase())}function w(t){return t.split(";").reduce((o,i)=>{let[r,n]=i.split(":");return r=r==null?void 0:r.trim(),n=n==null?void 0:n.trim(),r&&n&&(o[l(r)]=n),o},{})}function d(t){if(Array.isArray(t))return t.map(e=>d(e));const o={class:"className",for:"htmlFor",targetAttr:"targetattr"},i=Object.keys(t.props).reduce((e,s)=>{let a=t.props[s];s==="style"&&typeof a=="string"&&(a=w(a));const f=o[s]||s;return e[f]=a,e},{});i.key=t.key;const r=u.Children.map(t.props.children,e=>typeof e=="string"?e:d(e));return u.createElement(t.type,i,r)}const c=()=>typeof window<"u",y=()=>typeof window>"u",g=()=>c()&&typeof window.storyblokRegisterEvent<"u",p=()=>c()&&window.self!==window.top,m=()=>c()&&p()&&window.location.search.includes("_storyblok");exports.convertAttributesInElement=d;exports.isBridgeLoaded=g;exports.isBrowser=c;exports.isIframe=p;exports.isServer=y;exports.isVisualEditor=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function f(e){return e.replace(/-([a-z])/g,o=>o[1].toUpperCase())}function m(e){return e.split(";").reduce((o,i)=>{let[t,n]=i.split(":");return t=t==null?void 0:t.trim(),n=n==null?void 0:n.trim(),t&&n&&(o[f(t)]=n),o},{})}function c(e){if(Array.isArray(e))return e.map(r=>c(r));const o={allowfullscreen:"allowFullScreen",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",charset:"charSet",class:"className",colspan:"colSpan",colwidth:"colWidth",contenteditable:"contentEditable",crossorigin:"crossOrigin",enctype:"encType",for:"htmlFor",formnovalidate:"formNoValidate",frameborder:"frameBorder",inputmode:"inputMode",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",minlength:"minLength",novalidate:"noValidate",playsinline:"playsInline",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",srcset:"srcSet",tabindex:"tabIndex",targetAttr:"targetattr",usemap:"useMap"},i=Object.keys(e.props).reduce((r,a)=>{let s=e.props[a];a==="style"&&typeof s=="string"&&(s=m(s));const u=o[a]||a;return r[u]=s,r},{});i.key=e.key;const t=d.Children.map(e.props.children,r=>typeof r=="string"?r:c(r));return d.createElement(e.type,i,t)}const l=()=>typeof window<"u",g=()=>typeof window>"u",w=()=>l()&&typeof window.storyblokRegisterEvent<"u",p=()=>l()&&window.self!==window.top,y=()=>l()&&p()&&window.location.search.includes("_storyblok");exports.convertAttributesInElement=c;exports.isBridgeLoaded=w;exports.isBrowser=l;exports.isIframe=p;exports.isServer=g;exports.isVisualEditor=y;
package/dist/utils.mjs CHANGED
@@ -1,37 +1,61 @@
1
- import a from "react";
2
- function f(t) {
3
- return t.replace(/-([a-z])/g, (o) => o[1].toUpperCase());
1
+ import c from "react";
2
+ function u(e) {
3
+ return e.replace(/-([a-z])/g, (o) => o[1].toUpperCase());
4
4
  }
5
- function w(t) {
6
- return t.split(";").reduce((o, s) => {
7
- let [r, n] = s.split(":");
8
- return r = r == null ? void 0 : r.trim(), n = n == null ? void 0 : n.trim(), r && n && (o[f(r)] = n), o;
5
+ function f(e) {
6
+ return e.split(";").reduce((o, i) => {
7
+ let [t, n] = i.split(":");
8
+ return t = t == null ? void 0 : t.trim(), n = n == null ? void 0 : n.trim(), t && n && (o[u(t)] = n), o;
9
9
  }, {});
10
10
  }
11
- function d(t) {
12
- if (Array.isArray(t))
13
- return t.map((e) => d(e));
11
+ function p(e) {
12
+ if (Array.isArray(e))
13
+ return e.map((r) => p(r));
14
14
  const o = {
15
+ allowfullscreen: "allowFullScreen",
16
+ autocomplete: "autoComplete",
17
+ autofocus: "autoFocus",
18
+ autoplay: "autoPlay",
19
+ charset: "charSet",
15
20
  class: "className",
21
+ colspan: "colSpan",
22
+ colwidth: "colWidth",
23
+ contenteditable: "contentEditable",
24
+ crossorigin: "crossOrigin",
25
+ enctype: "encType",
16
26
  for: "htmlFor",
17
- targetAttr: "targetattr"
18
- // Add more attribute conversions here as needed
19
- }, s = Object.keys(t.props).reduce((e, i) => {
20
- let p = t.props[i];
21
- i === "style" && typeof p == "string" && (p = w(p));
22
- const u = o[i] || i;
23
- return e[u] = p, e;
27
+ formnovalidate: "formNoValidate",
28
+ frameborder: "frameBorder",
29
+ inputmode: "inputMode",
30
+ marginheight: "marginHeight",
31
+ marginwidth: "marginWidth",
32
+ maxlength: "maxLength",
33
+ minlength: "minLength",
34
+ novalidate: "noValidate",
35
+ playsinline: "playsInline",
36
+ readonly: "readOnly",
37
+ referrerpolicy: "referrerPolicy",
38
+ rowspan: "rowSpan",
39
+ srcset: "srcSet",
40
+ tabindex: "tabIndex",
41
+ targetAttr: "targetattr",
42
+ usemap: "useMap"
43
+ }, i = Object.keys(e.props).reduce((r, a) => {
44
+ let s = e.props[a];
45
+ a === "style" && typeof s == "string" && (s = f(s));
46
+ const d = o[a] || a;
47
+ return r[d] = s, r;
24
48
  }, {});
25
- s.key = t.key;
26
- const r = a.Children.map(t.props.children, (e) => typeof e == "string" ? e : d(e));
27
- return a.createElement(t.type, s, r);
49
+ i.key = e.key;
50
+ const t = c.Children.map(e.props.children, (r) => typeof r == "string" ? r : p(r));
51
+ return c.createElement(e.type, i, t);
28
52
  }
29
- const c = () => typeof window < "u", m = () => typeof window > "u", g = () => c() && typeof window.storyblokRegisterEvent < "u", l = () => c() && window.self !== window.top, E = () => c() && l() && window.location.search.includes("_storyblok");
53
+ const l = () => typeof window < "u", y = () => typeof window > "u", g = () => l() && typeof window.storyblokRegisterEvent < "u", m = () => l() && window.self !== window.top, h = () => l() && m() && window.location.search.includes("_storyblok");
30
54
  export {
31
- d as convertAttributesInElement,
55
+ p as convertAttributesInElement,
32
56
  g as isBridgeLoaded,
33
- c as isBrowser,
34
- l as isIframe,
35
- m as isServer,
36
- E as isVisualEditor
57
+ l as isBrowser,
58
+ m as isIframe,
59
+ y as isServer,
60
+ h as isVisualEditor
37
61
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storyblok/react",
3
3
  "type": "module",
4
- "version": "5.4.9",
4
+ "version": "5.4.11",
5
5
  "private": false,
6
6
  "description": "SDK to integrate Storyblok into your project using React.",
7
7
  "author": "Storyblok",
@@ -49,7 +49,7 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@storyblok/js": "4.2.7"
52
+ "@storyblok/js": "4.2.8"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@babel/core": "^7.27.1",