@storyblok/react 4.3.4 → 4.3.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAqCxI"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4D1B;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CA+CxI"}
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react");function l(t){return t.replace(/-([a-z])/g,n=>n[1].toUpperCase())}function f(t){return t.split(";").reduce((n,s)=>{let[r,e]=s.split(":");return r=r==null?void 0:r.trim(),e=e==null?void 0:e.trim(),r&&e&&(n[l(r)]=e),n},{})}function p(t){if(Array.isArray(t))return t.map(i=>p(i));if(!a.isValidElement(t))return t;const n={class:"className",for:"htmlFor",targetAttr:"targetattr"},s=Object.keys(t.props).reduce((i,o)=>{let c=t.props[o];o==="style"&&typeof c=="string"&&(c=f(c));const u=n[o]||o;return i[u]=c,i},{});s.key=t.key;const r=a.Children.map(t.props.children,i=>p(i));return a.createElement(t.type,s,r)}exports.convertAttributesInElement=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),d={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&nbsp;":" ","&copy;":"©","&reg;":"®","&deg;":"°","&plusmn;":"±","&para;":"¶","&middot;":"·","&ndash;":"–","&mdash;":"—","&lsquo;":"‘","&rsquo;":"’","&sbquo;":"‚","&ldquo;":"“","&rdquo;":"”","&bdquo;":"„","&hellip;":"…"};function c(r){return r.replace(/&[#\w]+;/g,t=>{if(t.startsWith("&#")){const e=t.slice(2,-1);return e.startsWith("x")?String.fromCharCode(Number.parseInt(e.slice(1),16)):String.fromCharCode(Number.parseInt(e,10))}return d[t]||t})}function f(r){return r.replace(/-([a-z])/g,t=>t[1].toUpperCase())}function g(r){return r.split(";").reduce((t,e)=>{let[n,o]=e.split(":");return n=n==null?void 0:n.trim(),o=o==null?void 0:o.trim(),n&&o&&(t[f(n)]=o),t},{})}function p(r){if(Array.isArray(r))return r.map(s=>p(s));if(!a.isValidElement(r))return typeof r=="string"?c(r):r;const t={class:"className",for:"htmlFor",targetAttr:"targetattr"},e=Object.keys(r.props).reduce((s,i)=>{let u=r.props[i];i==="style"&&typeof u=="string"&&(u=g(u));const l=t[i]||i;return s[l]=u,s},{});e.key=r.key;const n=a.Children.map(r.props.children,s=>typeof s=="string"?c(s):p(s));return a.createElement(r.type,e,n)}exports.convertAttributesInElement=p;
package/dist/utils.mjs CHANGED
@@ -1,32 +1,65 @@
1
- import a from "react";
1
+ import p from "react";
2
+ const d = {
3
+ "&amp;": "&",
4
+ "&lt;": "<",
5
+ "&gt;": ">",
6
+ "&quot;": '"',
7
+ "&#39;": "'",
8
+ "&apos;": "'",
9
+ "&nbsp;": " ",
10
+ "&copy;": "©",
11
+ "&reg;": "®",
12
+ "&deg;": "°",
13
+ "&plusmn;": "±",
14
+ "&para;": "¶",
15
+ "&middot;": "·",
16
+ "&ndash;": "–",
17
+ "&mdash;": "—",
18
+ "&lsquo;": "‘",
19
+ "&rsquo;": "’",
20
+ "&sbquo;": "‚",
21
+ "&ldquo;": "“",
22
+ "&rdquo;": "”",
23
+ "&bdquo;": "„",
24
+ "&hellip;": "…"
25
+ };
26
+ function u(r) {
27
+ return r.replace(/&[#\w]+;/g, (t) => {
28
+ if (t.startsWith("&#")) {
29
+ const e = t.slice(2, -1);
30
+ return e.startsWith("x") ? String.fromCharCode(Number.parseInt(e.slice(1), 16)) : String.fromCharCode(Number.parseInt(e, 10));
31
+ }
32
+ return d[t] || t;
33
+ });
34
+ }
2
35
  function l(r) {
3
- return r.replace(/-([a-z])/g, (n) => n[1].toUpperCase());
36
+ return r.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
4
37
  }
5
- function f(r) {
6
- return r.split(";").reduce((n, o) => {
7
- let [t, e] = o.split(":");
8
- return t = t == null ? void 0 : t.trim(), e = e == null ? void 0 : e.trim(), t && e && (n[l(t)] = e), n;
38
+ function m(r) {
39
+ return r.split(";").reduce((t, e) => {
40
+ let [o, n] = e.split(":");
41
+ return o = o == null ? void 0 : o.trim(), n = n == null ? void 0 : n.trim(), o && n && (t[l(o)] = n), t;
9
42
  }, {});
10
43
  }
11
44
  function c(r) {
12
45
  if (Array.isArray(r))
13
- return r.map((i) => c(i));
14
- if (!a.isValidElement(r))
15
- return r;
16
- const n = {
46
+ return r.map((s) => c(s));
47
+ if (!p.isValidElement(r))
48
+ return typeof r == "string" ? u(r) : r;
49
+ const t = {
17
50
  class: "className",
18
51
  for: "htmlFor",
19
52
  targetAttr: "targetattr"
20
53
  // Add more attribute conversions here as needed
21
- }, o = Object.keys(r.props).reduce((i, s) => {
22
- let p = r.props[s];
23
- s === "style" && typeof p == "string" && (p = f(p));
24
- const u = n[s] || s;
25
- return i[u] = p, i;
54
+ }, e = Object.keys(r.props).reduce((s, i) => {
55
+ let a = r.props[i];
56
+ i === "style" && typeof a == "string" && (a = m(a));
57
+ const f = t[i] || i;
58
+ return s[f] = a, s;
26
59
  }, {});
27
- o.key = r.key;
28
- const t = a.Children.map(r.props.children, (i) => c(i));
29
- return a.createElement(r.type, o, t);
60
+ e.key = r.key;
61
+ const o = p.Children.map(r.props.children, (s) => typeof s == "string" ? u(s) : c(s));
62
+ return p.createElement(r.type, e, o);
30
63
  }
31
64
  export {
32
65
  c as convertAttributesInElement
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@storyblok/react",
3
3
  "type": "module",
4
- "version": "4.3.4",
4
+ "version": "4.3.6",
5
5
  "private": false,
6
- "packageManager": "pnpm@9.15.1",
6
+ "packageManager": "pnpm@10.2.0",
7
7
  "description": "SDK to integrate Storyblok into your project using React.",
8
8
  "author": "Storyblok",
9
9
  "license": "MIT",
@@ -61,31 +61,36 @@
61
61
  "@storyblok/js": "3.2.2"
62
62
  },
63
63
  "devDependencies": {
64
- "@babel/core": "^7.26.0",
65
- "@babel/preset-env": "^7.26.0",
66
- "@commitlint/cli": "^19.6.1",
67
- "@commitlint/config-conventional": "^19.6.0",
64
+ "@babel/core": "^7.26.7",
65
+ "@babel/preset-env": "^7.26.7",
66
+ "@commitlint/cli": "^19.7.1",
67
+ "@commitlint/config-conventional": "^19.7.1",
68
68
  "@cypress/react": "^8.0.2",
69
69
  "@cypress/vite-dev-server": "^5.2.1",
70
70
  "@storyblok/eslint-config": "^0.3.0",
71
71
  "@tsconfig/recommended": "^1.0.8",
72
- "@types/node": "^20.17.10",
72
+ "@types/node": "^22.13.1",
73
73
  "@types/react": "18.3.12",
74
74
  "@vitejs/plugin-react": "^4.3.4",
75
75
  "babel-jest": "^29.7.0",
76
76
  "cypress": "^13.17.0",
77
- "eslint": "^9.17.0",
77
+ "eslint": "^9.19.0",
78
78
  "eslint-plugin-cypress": "^4.1.0",
79
- "eslint-plugin-jest": "^28.10.0",
79
+ "eslint-plugin-jest": "^28.11.0",
80
80
  "react": "^18.3.1",
81
81
  "react-dom": "^18.3.1",
82
82
  "rollup-plugin-preserve-directives": "^0.4.0",
83
83
  "simple-git-hooks": "^2.11.1",
84
- "start-server-and-test": "^2.0.9",
85
- "typescript": "5.6.3",
86
- "vite": "^6.0.6",
87
- "vite-plugin-dts": "^4.4.0",
88
- "vitest": "^2.1.8"
84
+ "start-server-and-test": "^2.0.10",
85
+ "typescript": "5.7.3",
86
+ "vite": "^6.1.0",
87
+ "vite-plugin-dts": "^4.5.0",
88
+ "vitest": "^3.0.5"
89
+ },
90
+ "pnpm": {
91
+ "onlyBuiltDependencies": [
92
+ "cypress"
93
+ ]
89
94
  },
90
95
  "babel": {
91
96
  "presets": [