@devgateway/dvz-ui-react 1.7.13 → 1.7.14
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
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),m=require("react"),c=require("@devgateway/wp-react-lib"),h=require("semantic-ui-react"),P=require("react-intl"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),m=require("react"),c=require("@devgateway/wp-react-lib"),h=require("semantic-ui-react"),P=require("react-intl"),j=(e,s)=>!e||!s?e:e.replace(/href\s*=\s*(['"])(https?:\/\/[^'"]+)\1/ig,(o,a,t)=>{try{const r=new URL(t),u=r.pathname.indexOf("/wp/");if(u===-1)return o;const i=r.pathname.slice(u+3);return r.pathname=i.startsWith("/"+s)?i:"/"+s+i,`href=${a}${r.toString()}${a}`}catch{return o}}),I=e=>{const s=e.as?e.as:h.Container,o=["post","pageNumber","visibility","intl","as"],a={};return Object.keys(e).filter(t=>t).forEach(t=>{o.indexOf(t)==-1&&(a[t]=e[t])}),n.jsx(s,{...a,children:e.children})},_=e=>{const s=P.useIntl(),[o,a]=m.useState(!1);m.useEffect(()=>{e.onLoad&&e.onLoad()},[]);const{post:t,pageNumber:r,showTitle:u,showContent:i,showIntro:w,showDate:L,showLoading:b,as:N,locale:C,messages:y,preview:S}=e,d=C||s.locale;if(t){const l=t.content?t.content.rendered.split("<!--more-->"):[],v=l.length>1?l[0]:null,f=l.length>1?l[1]:l[0],x=f?f.split("<!--nextpage-->"):"";let g="";return r!=null&&x.length>0?g=x[r]:g=f,n.jsx(c.EmbeddedGateway,{parentUnique:e.parentUnique,messages:y,parent:S?t.parent:t.id,children:n.jsxs(I,{className:"entry-content",...e,children:[n.jsx("div",{}),L&&n.jsx(h.Container,{fluid:!0,className:"date",children:t.date.toLocaleString()}),u&&n.jsx("span",{id:t.slug,className:"title",dangerouslySetInnerHTML:{__html:t.title.rendered}},"title"),w&&n.jsx(h.Container,{fluid:!0,className:"excerpt",dangerouslySetInnerHTML:{__html:c.utils.removePatternBrackets(j(c.dvizTranslate(v,d),d))}},"intro"),i&&n.jsx(h.Container,{fluid:!0,className:"content ",dangerouslySetInnerHTML:{__html:c.utils.removePatternBrackets(j(c.dvizTranslate(g,d),d))}},"content")]})})}else return b?"Loading":!1},p=e=>n.jsx(m.Suspense,{children:n.jsx(_,{...e})});exports.FilteredPostContent=p;exports.default=p;
|
|
@@ -31,10 +31,10 @@ const L = (e, r) => !e || !r ? e : e.replace(/href\s*=\s*(['"])(https?:\/\/[^'"]
|
|
|
31
31
|
showDate: b,
|
|
32
32
|
showLoading: x,
|
|
33
33
|
as: k,
|
|
34
|
-
locale:
|
|
35
|
-
messages:
|
|
34
|
+
locale: S,
|
|
35
|
+
messages: C,
|
|
36
36
|
preview: I
|
|
37
|
-
} = e, d =
|
|
37
|
+
} = e, d = S || r.locale;
|
|
38
38
|
if (t) {
|
|
39
39
|
const i = t.content ? t.content.rendered.split("<!--more-->") : [], N = i.length > 1 ? i[0] : null, f = i.length > 1 ? i[1] : i[0], m = f ? f.split("<!--nextpage-->") : "";
|
|
40
40
|
let h = "";
|
|
@@ -42,7 +42,7 @@ const L = (e, r) => !e || !r ? e : e.replace(/href\s*=\s*(['"])(https?:\/\/[^'"]
|
|
|
42
42
|
E,
|
|
43
43
|
{
|
|
44
44
|
parentUnique: e.parentUnique,
|
|
45
|
-
messages:
|
|
45
|
+
messages: C,
|
|
46
46
|
parent: I ? t.parent : t.id,
|
|
47
47
|
children: /* @__PURE__ */ P(T, { className: "entry-content", ...e, children: [
|
|
48
48
|
/* @__PURE__ */ n("div", {}),
|
|
@@ -79,7 +79,7 @@ const L = (e, r) => !e || !r ? e : e.replace(/href\s*=\s*(['"])(https?:\/\/[^'"]
|
|
|
79
79
|
);
|
|
80
80
|
} else
|
|
81
81
|
return x ? "Loading" : !1;
|
|
82
|
-
}, B = (e) => /* @__PURE__ */ n(v, { children: /* @__PURE__ */ n(j, { ...e
|
|
82
|
+
}, B = (e) => /* @__PURE__ */ n(v, { children: /* @__PURE__ */ n(j, { ...e }) });
|
|
83
83
|
export {
|
|
84
84
|
B as FilteredPostContent,
|
|
85
85
|
B as default
|