@picked/react 0.0.65-next.3 → 0.0.65
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.
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface HtmlRenderProps {
|
|
3
|
+
/** The resolved html-asset field value (for example `content.body`). */
|
|
4
|
+
readonly html: unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Renders a resolved html-asset field's HTML and rehydrates its Picked-tagged scripts after commit.
|
|
8
|
+
* Swap a consumer's raw `dangerouslySetInnerHTML` for this so shadow-DOM landing-page scripts run.
|
|
9
|
+
* A non-matching value or a `null` content renders nothing.
|
|
10
|
+
*
|
|
11
|
+
* @param {HtmlRenderProps} props - The component props.
|
|
12
|
+
* @returns {React.JSX.Element} The container element.
|
|
13
|
+
* @example
|
|
14
|
+
* <HtmlRender html={content.body} />
|
|
15
|
+
*/
|
|
16
|
+
declare function HtmlRender({ html }: HtmlRenderProps): React.JSX.Element;
|
|
17
|
+
export default HtmlRender;
|
|
18
|
+
//# sourceMappingURL=HtmlRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlRender.d.ts","sourceRoot":"","sources":["../../src/experience/HtmlRender.tsx"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,KAA4B,MAAM,OAAO,CAAA;AAGhD,UAAU,eAAe;IACvB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAahE;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e,useRef as t}from"react";import{isHtmlAssetValue as n,rehydrateScripts as r,supportsWindow as i}from"@picked/client";import{jsx as a}from"react/jsx-runtime";function o({html:o}){let s=n(o)?o:null,c=s?.content??``,l=t(null);return e(()=>{let e=l.current;i()&&e&&c&&r(e)},[c]),a(`div`,{ref:l,dangerouslySetInnerHTML:{__html:c}},s?.id??``)}export{o as default};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { adaptReactComponent, isValidAdaptedComponent } from './component';
|
|
|
5
5
|
export type * from './component';
|
|
6
6
|
export { default as PickedProvider } from './experience/PickedProvider';
|
|
7
7
|
export { default as ExperienceSlot } from './experience/ExperienceSlot';
|
|
8
|
+
export { default as HtmlRender } from './experience/HtmlRender';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1E,mBAAmB,aAAa,CAAA;AAChC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1E,mBAAmB,aAAa,CAAA;AAChC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{adaptReactComponent as e,isValidAdaptedComponent as t}from"./component.js";import n from"./experience/PickedProvider.js";import r from"./experience/ExperienceSlot.js";export{r as ExperienceSlot,n as PickedProvider,e as adaptReactComponent,t as isValidAdaptedComponent};
|
|
1
|
+
import{adaptReactComponent as e,isValidAdaptedComponent as t}from"./component.js";import n from"./experience/PickedProvider.js";import r from"./experience/ExperienceSlot.js";import i from"./experience/HtmlRender.js";export{r as ExperienceSlot,i as HtmlRender,n as PickedProvider,e as adaptReactComponent,t as isValidAdaptedComponent};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/react",
|
|
3
|
-
"version": "0.0.65
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@picked/client": "workspace:*",
|
|
6
6
|
"@repo/eslint-config": "workspace:*",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"module": "./dist/index.js",
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@picked/client": "0.0.65
|
|
88
|
+
"@picked/client": "0.0.65",
|
|
89
89
|
"effector": "^23.3.0",
|
|
90
90
|
"react": "19.2.2",
|
|
91
91
|
"react-dom": "19.2.2"
|