@picked/react 0.0.1-dev.1777601813342 → 0.0.1-dev.1777602638912
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.
|
@@ -14,8 +14,9 @@ export interface ReactFrameworkPluginOptions {
|
|
|
14
14
|
* This plugin registers the React framework and allows rendering React components
|
|
15
15
|
* with the client's experience data.
|
|
16
16
|
*
|
|
17
|
-
* @param {ReactFrameworkPluginOptions} options - Configuration options for the React plugin
|
|
17
|
+
* @param {ReactFrameworkPluginOptions} options - Configuration options for the React plugin
|
|
18
18
|
* @returns {Plugin} The plugin.
|
|
19
|
+
*
|
|
19
20
|
* @example
|
|
20
21
|
* ```typescript
|
|
21
22
|
* createClient({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/framework/plugin.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/framework/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAU,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChG,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAG9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,MAAM,CACJ,MAAM,mBAAmB,EACzB;IAAE,SAAS,EAAE,kBAAkB,CAAC;IAAC,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAAE,CACjE,CACF,CAAA;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,iBAAiB,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,2BAA2B,KAAG,MAuB3E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{adaptReactComponent as e}from"../../component.js";import{renderReactComponent as t
|
|
1
|
+
import{adaptReactComponent as e}from"../../component.js";import{renderReactComponent as t}from"../../render/browser.js";var n=n=>({name:`react-framework`,setup:r=>{r.registerFramework({name:`react`,render(...e){return t(...e,{stylesheets:n.stylesheets,css:n.css})}});let i=n.components.experience;i&&r.registerComponent(`experience`,e(i.component,i.style))}});export{n as reactFrameworkPlugin};
|
package/dist/render/browser.d.ts
CHANGED
|
@@ -3,13 +3,5 @@ export declare const renderReactComponent: (shadowRoot: ShadowRoot, component: A
|
|
|
3
3
|
stylesheets?: string[];
|
|
4
4
|
css?: string[];
|
|
5
5
|
}) => Promise<void>;
|
|
6
|
-
|
|
7
|
-
* Tears down the React root previously mounted into `shadowRoot` by
|
|
8
|
-
* {@link renderReactComponent}. No-op when no root was mounted there.
|
|
9
|
-
*
|
|
10
|
-
* @param {ShadowRoot} shadowRoot - The shadow root whose React tree should be unmounted.
|
|
11
|
-
* @example
|
|
12
|
-
* unRenderReactComponent(shadowRoot)
|
|
13
|
-
*/
|
|
14
|
-
export declare const unRenderReactComponent: (shadowRoot: ShadowRoot) => void;
|
|
6
|
+
export declare const unRenderReactComponent: (target: Element) => void;
|
|
15
7
|
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/render/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/render/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AASlF,eAAO,MAAM,oBAAoB,GAC/B,YAAY,UAAU,EACtB,WAAW,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5C,QAAQ,MAAM,EACd,YAAY,kBAAkB,EAC9B,SAAS;IACP,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CACf,kBA0DF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,QAAQ,OAAO,SAMrD,CAAA"}
|
package/dist/render/browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidAdaptedComponent as e}from"../component.js";import{ClientProvider as t,ExperienceProvider as n}from"../context.js";import{mergeArrays as r}from"../utils/array.js";import i from"react";import{isLazyLoader as a}from"@picked/client";import{createRoot as o}from"react-dom/client";var s=new WeakMap,c=async(c,l,u,d,f)=>{if(!e(l))throw Error(`The component is invalid.`);let p=
|
|
1
|
+
import{isValidAdaptedComponent as e}from"../component.js";import{ClientProvider as t,ExperienceProvider as n}from"../context.js";import{mergeArrays as r}from"../utils/array.js";import i from"react";import{isLazyLoader as a}from"@picked/client";import{createRoot as o}from"react-dom/client";var s=new WeakMap,c=async(c,l,u,d,f)=>{if(!e(l))throw Error(`The component is invalid.`);let p=r(l.style?.sheets,f.stylesheets),m=r(l.style?.css,f.css);p.length&&p.forEach(e=>{let t=document.createElement(`link`);t.setAttribute(`rel`,`stylesheet`),t.setAttribute(`href`,e),t.setAttribute(`type`,`text/css`),t.setAttribute(`picked-injected`,`true`),c.appendChild(t)}),m.length&&m.forEach(e=>{let t=document.createElement(`style`);t.textContent=e,t.setAttribute(`type`,`text/css`),t.setAttribute(`picked-injected`,`true`),c.appendChild(t)});let h=document.createElement(`div`);c.appendChild(h);let g=o(h);s.set(c,g);let _;_=a(l.component)?(await l.component.load()).default:l.component instanceof Promise?(await l.component).default:l.component,g.render(i.createElement(t,{value:u},i.createElement(n,{value:d},i.createElement(_,{client:u,experience:d}))))},l=e=>{let t=s.get(e);t&&(t.unmount(),s.delete(e))};export{c as renderReactComponent,l as unRenderReactComponent};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/react",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1777602638912",
|
|
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.1-dev.
|
|
88
|
+
"@picked/client": "0.0.1-dev.1777602638912",
|
|
89
89
|
"effector": "^23.3.0",
|
|
90
90
|
"effector-react": "^23.3.0",
|
|
91
91
|
"react": "19.2.2",
|