@mittwald/flow-remote-react-renderer 1.4.27 → 1.4.29
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/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteRootRenderer.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteRootRenderer.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteTextRenderer.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteTextRenderer.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/constants.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/constants.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/props-for-element.mjs +2 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/props-for-element.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/remote-received.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/remote-received.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/node.mjs +1 -1
- package/dist/js/node_modules/.pnpm/{@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_165efefefb651960d4019e048af092f_2527982a00987364ad8ee3a73574093c → @mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790}/node_modules/@mittwald/remote-dom-react/build/esm/host/node.mjs.map +1 -1
- package/dist/js/packages/remote-react-renderer/src/RemoteRendererBrowser.mjs +1 -1
- package/dist/js/packages/remote-react-renderer/src/components.mjs +1 -1
- package/dist/js/packages/remote-react-renderer/src/lib/createFlowRemoteComponentRenderer.mjs +1 -1
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useRemoteReceived } from "./hooks/remote-received.mjs";
|
|
4
4
|
import { renderRemoteNode } from "./node.mjs";
|
|
5
5
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
6
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteRootRenderer.mjs
|
|
7
7
|
/**
|
|
8
8
|
* A component that can be used to render a tree of UI elements from a remote
|
|
9
9
|
* environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteRootRenderer.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"RemoteRootRenderer.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteRootRenderer.mjs"],"sourcesContent":["import { useRemoteReceived } from './hooks/remote-received.mjs';\nimport { renderRemoteNode } from './node.mjs';\nimport { jsx, Fragment } from 'react/jsx-runtime';\n\n/**\n * A component that can be used to render a tree of UI elements from a remote\n * environment.\n */\nfunction RemoteRootRenderer(props) {\n const {\n receiver\n } = props;\n const {\n children\n } = useRemoteReceived(receiver.root, receiver);\n return /*#__PURE__*/jsx(Fragment, {\n children: children.map(child => renderRemoteNode(child, props))\n });\n}\n\nexport { RemoteRootRenderer };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQA,SAAS,mBAAmB,OAAO;CACjC,MAAM,EACJ,aACE;CACJ,MAAM,EACJ,aACE,kBAAkB,SAAS,MAAM,QAAQ;CAC7C,OAAoB,kBAAI,UAAU,EAChC,UAAU,SAAS,KAAI,UAAS,iBAAiB,OAAO,KAAK,CAAC,EAChE,CAAC;AACH"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { useRemoteReceived } from "./hooks/remote-received.mjs";
|
|
4
4
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
5
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteTextRenderer.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Renders a remote React element to the host using React.
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteTextRenderer.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"RemoteTextRenderer.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteTextRenderer.mjs"],"sourcesContent":["import { useRemoteReceived } from './hooks/remote-received.mjs';\nimport { jsx, Fragment } from 'react/jsx-runtime';\n\n/**\n * Renders a remote React element to the host using React.\n */\nfunction RemoteTextRenderer({\n remote,\n receiver\n}) {\n const text = useRemoteReceived(remote, receiver);\n return text ? /*#__PURE__*/jsx(Fragment, {\n children: text.data\n }) : null;\n}\n\nexport { RemoteTextRenderer };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAMA,SAAS,mBAAmB,EAC1B,QACA,YACC;CACD,MAAM,OAAO,kBAAkB,QAAQ,QAAQ;CAC/C,OAAO,OAAoB,kBAAI,UAAU,EACvC,UAAU,KAAK,KACjB,CAAC,IAAI;AACP"}
|
|
@@ -5,7 +5,7 @@ import { usePropsForRemoteElement } from "./hooks/props-for-element.mjs";
|
|
|
5
5
|
import { REMOTE_ELEMENT_ATTACHED_PROP, REMOTE_ELEMENT_PROP } from "./constants.mjs";
|
|
6
6
|
import { memo, useEffect, useRef } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
8
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs
|
|
9
9
|
/**
|
|
10
10
|
* Takes a React component, and returns a new component that can be used to render that
|
|
11
11
|
* component from a remote element. This wrapper will handle subscribing to changes in that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"component.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs"],"sourcesContent":["import { memo, useRef, useEffect } from 'react';\nimport { useRemoteReceived } from './hooks/remote-received.mjs';\nimport { usePropsForRemoteElement } from './hooks/props-for-element.mjs';\nimport { REMOTE_ELEMENT_PROP, REMOTE_ELEMENT_ATTACHED_PROP } from './constants.mjs';\nimport { jsx } from 'react/jsx-runtime';\n\n/**\n * Takes a React component, and returns a new component that can be used to render that\n * component from a remote element. This wrapper will handle subscribing to changes in that\n * element, and will normalize the properties on that remote element before passing them\n * to your React component.\n */\nfunction createRemoteComponentRenderer(Component, {\n name,\n eventProps\n} = {}) {\n const RemoteComponentRenderer = /*#__PURE__*/memo(function RemoteComponentRenderer({\n element,\n receiver,\n components\n }) {\n const internalsRef = useRef();\n const attachedElement = useRemoteReceived(element, receiver);\n const resolvedElement = attachedElement ?? element;\n const resolvedId = resolvedElement.id;\n const props = usePropsForRemoteElement(resolvedElement, {\n receiver,\n components,\n eventProps\n });\n props[REMOTE_ELEMENT_PROP] = resolvedElement;\n props[REMOTE_ELEMENT_ATTACHED_PROP] = attachedElement != null;\n if (internalsRef.current == null) {\n const internals = {\n id: resolvedId,\n receiver\n };\n internals.instanceRef = createImplementationRef(internals);\n internalsRef.current = internals;\n }\n internalsRef.current.id = resolvedId;\n internalsRef.current.receiver = receiver;\n useEffect(() => {\n const node = {\n id: resolvedId\n };\n receiver.implement(node, internalsRef.current?.instanceRef.current);\n return () => {\n receiver.implement(node, null);\n };\n }, [resolvedId, receiver]);\n return /*#__PURE__*/jsx(Component, {\n ref: internalsRef.current.instanceRef,\n ...props\n });\n });\n RemoteComponentRenderer.displayName = name ?? `RemoteComponentRenderer(${Component.displayName ?? Component.name ?? 'Component'})`;\n return RemoteComponentRenderer;\n}\nfunction createImplementationRef(internals) {\n let current = null;\n return {\n get current() {\n return current;\n },\n set current(implementation) {\n current = implementation;\n internals.receiver.implement(internals, implementation);\n }\n };\n}\n\nexport { createRemoteComponentRenderer };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;AAYA,SAAS,8BAA8B,WAAW,EAChD,MACA,eACE,CAAC,GAAG;CACN,MAAM,0BAAuC,mBAAK,SAAS,wBAAwB,EACjF,SACA,UACA,cACC;EACD,MAAM,eAAe,OAAO;EAC5B,MAAM,kBAAkB,kBAAkB,SAAS,QAAQ;EAC3D,MAAM,kBAAkB,mBAAmB;EAC3C,MAAM,aAAa,gBAAgB;EACnC,MAAM,QAAQ,yBAAyB,iBAAiB;GACtD;GACA;GACA;EACF,CAAC;EACD,MAAM,uBAAuB;EAC7B,MAAM,gCAAgC,mBAAmB;EACzD,IAAI,aAAa,WAAW,MAAM;GAChC,MAAM,YAAY;IAChB,IAAI;IACJ;GACF;GACA,UAAU,cAAc,wBAAwB,SAAS;GACzD,aAAa,UAAU;EACzB;EACA,aAAa,QAAQ,KAAK;EAC1B,aAAa,QAAQ,WAAW;EAChC,gBAAgB;GACd,MAAM,OAAO,EACX,IAAI,WACN;GACA,SAAS,UAAU,MAAM,aAAa,SAAS,YAAY,OAAO;GAClE,aAAa;IACX,SAAS,UAAU,MAAM,IAAI;GAC/B;EACF,GAAG,CAAC,YAAY,QAAQ,CAAC;EACzB,OAAoB,kBAAI,WAAW;GACjC,KAAK,aAAa,QAAQ;GAC1B,GAAG;EACL,CAAC;CACH,CAAC;CACD,wBAAwB,cAAc,QAAQ,2BAA2B,UAAU,eAAe,UAAU,QAAQ,YAAY;CAChI,OAAO;AACT;AACA,SAAS,wBAAwB,WAAW;CAC1C,IAAI,UAAU;CACd,OAAO;EACL,IAAI,UAAU;GACZ,OAAO;EACT;EACA,IAAI,QAAQ,gBAAgB;GAC1B,UAAU;GACV,UAAU,SAAS,UAAU,WAAW,cAAc;EACxD;CACF;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
3
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/constants.mjs
|
|
4
4
|
/**
|
|
5
5
|
* The property name used to pass a remote element instance to the React component
|
|
6
6
|
* that is configured to render it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/constants.mjs"],"sourcesContent":["/**\n * The property name used to pass a remote element instance to the React component\n * that is configured to render it.\n */\nconst REMOTE_ELEMENT_PROP = Symbol.for('remote-dom.element');\nconst REMOTE_ELEMENT_ATTACHED_PROP = Symbol.for('remote-dom.element.attached');\n\nexport { REMOTE_ELEMENT_ATTACHED_PROP, REMOTE_ELEMENT_PROP };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAIA,IAAM,sBAAsB,OAAO,IAAI,oBAAoB;AAC3D,IAAM,+BAA+B,OAAO,IAAI,6BAA6B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { renderRemoteNode } from "../node.mjs";
|
|
4
4
|
import { Fragment, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
5
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/props-for-element.mjs
|
|
6
6
|
function usePropsForRemoteElement(element, options) {
|
|
7
7
|
if (!element) return void 0;
|
|
8
8
|
const { children, properties, attributes, eventListeners } = element;
|
|
@@ -27,6 +27,7 @@ function usePropsForRemoteElement(element, options) {
|
|
|
27
27
|
const rendered = renderRemoteNode(child, options);
|
|
28
28
|
resolvedProperties[slot] = resolvedProperties[slot] ? /*#__PURE__*/ jsxs(Fragment, { children: [resolvedProperties[slot], rendered] }) : rendered;
|
|
29
29
|
} else reactChildren.push(renderRemoteNode(child, options));
|
|
30
|
+
if (reactChildren.length === 0) delete resolvedProperties.children;
|
|
30
31
|
return resolvedProperties;
|
|
31
32
|
}
|
|
32
33
|
function wrapEventListenerForCallback(listener) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-for-element.mjs","names":[],"sources":["../../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"props-for-element.mjs","names":[],"sources":["../../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/props-for-element.mjs"],"sourcesContent":["import { renderRemoteNode } from '../node.mjs';\nimport { jsxs, Fragment } from 'react/jsx-runtime';\n\nfunction usePropsForRemoteElement(element, options) {\n if (!element) return undefined;\n const {\n children,\n properties,\n attributes,\n eventListeners\n } = element;\n const reactChildren = [];\n const resolvedProperties = {\n ...properties,\n ...attributes,\n children: reactChildren\n };\n if (options.eventProps) {\n for (const [prop, eventDescription] of Object.entries(options.eventProps)) {\n const eventName = eventDescription?.event;\n if (eventName == null) continue;\n const listener = eventListeners[eventName];\n if (listener) {\n resolvedProperties[prop] = wrapEventListenerForCallback(listener);\n }\n }\n } else {\n // Assume all event listeners are allowed, and write each one as a conventional\n // Preact callback prop.\n for (const [eventName, listener] of Object.entries(eventListeners)) {\n // A removed listener reaches the host as an update to `undefined`,\n // because RemoteReceiver assigns rather than deletes, so the key\n // outlives it. Wrapping that installs a callable prop that throws\n // when the event fires.\n if (!listener) continue;\n resolvedProperties[`on${eventName[0].toUpperCase()}${eventName.slice(1)}`] = wrapEventListenerForCallback(listener);\n }\n }\n for (const child of children) {\n if (child.type === 1 && typeof child.attributes.slot === 'string') {\n const slot = child.attributes.slot;\n const rendered = renderRemoteNode(child, options);\n resolvedProperties[slot] = resolvedProperties[slot] ? /*#__PURE__*/jsxs(Fragment, {\n children: [resolvedProperties[slot], rendered]\n }) : rendered;\n } else {\n reactChildren.push(renderRemoteNode(child, options));\n }\n }\n // Pass no children rather than `[]`, so the component sees `undefined`\n // as it does when rendered locally.\n if (reactChildren.length === 0) delete resolvedProperties.children;\n return resolvedProperties;\n}\nfunction wrapEventListenerForCallback(listener) {\n return function eventListenerCallbackWrapper(...args) {\n if (args.length === 1 && args[0] instanceof Event) {\n const event = args[0];\n if (event.target !== event.currentTarget) return;\n return 'detail' in event ? listener(event.detail) : listener();\n }\n return listener(...args);\n };\n}\n\nexport { usePropsForRemoteElement };\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAGA,SAAS,yBAAyB,SAAS,SAAS;CAClD,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,MAAM,EACJ,UACA,YACA,YACA,mBACE;CACJ,MAAM,gBAAgB,CAAC;CACvB,MAAM,qBAAqB;EACzB,GAAG;EACH,GAAG;EACH,UAAU;CACZ;CACA,IAAI,QAAQ,YACV,KAAK,MAAM,CAAC,MAAM,qBAAqB,OAAO,QAAQ,QAAQ,UAAU,GAAG;EACzE,MAAM,YAAY,kBAAkB;EACpC,IAAI,aAAa,MAAM;EACvB,MAAM,WAAW,eAAe;EAChC,IAAI,UACF,mBAAmB,QAAQ,6BAA6B,QAAQ;CAEpE;MAIA,KAAK,MAAM,CAAC,WAAW,aAAa,OAAO,QAAQ,cAAc,GAAG;EAKlE,IAAI,CAAC,UAAU;EACf,mBAAmB,KAAK,UAAU,EAAE,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC,OAAO,6BAA6B,QAAQ;CACpH;CAEF,KAAK,MAAM,SAAS,UAClB,IAAI,MAAM,SAAS,KAAK,OAAO,MAAM,WAAW,SAAS,UAAU;EACjE,MAAM,OAAO,MAAM,WAAW;EAC9B,MAAM,WAAW,iBAAiB,OAAO,OAAO;EAChD,mBAAmB,QAAQ,mBAAmB,QAAqB,mBAAK,UAAU,EAChF,UAAU,CAAC,mBAAmB,OAAO,QAAQ,EAC/C,CAAC,IAAI;CACP,OACE,cAAc,KAAK,iBAAiB,OAAO,OAAO,CAAC;CAKvD,IAAI,cAAc,WAAW,GAAG,OAAO,mBAAmB;CAC1D,OAAO;AACT;AACA,SAAS,6BAA6B,UAAU;CAC9C,OAAO,SAAS,6BAA6B,GAAG,MAAM;EACpD,IAAI,KAAK,WAAW,KAAK,KAAK,cAAc,OAAO;GACjD,MAAM,QAAQ,KAAK;GACnB,IAAI,MAAM,WAAW,MAAM,eAAe;GAC1C,OAAO,YAAY,QAAQ,SAAS,MAAM,MAAM,IAAI,SAAS;EAC/D;EACA,OAAO,SAAS,GAAG,IAAI;CACzB;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { useDebugValue, useEffect, useState } from "react";
|
|
4
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
4
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/remote-received.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Subscribes to a remote node’s updates and returns its current value.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-received.mjs","names":[],"sources":["../../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"remote-received.mjs","names":[],"sources":["../../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/hooks/remote-received.mjs"],"sourcesContent":["import { useState, useDebugValue, useEffect } from 'react';\n\n/**\n * Subscribes to a remote node’s updates and returns its current value.\n */\nfunction useRemoteReceived(remote, receiver) {\n const [state, setState] = useState(() => {\n const value = receiver.get(remote);\n return {\n id: remote.id,\n version: value?.version,\n value,\n receiver\n };\n });\n let returnValue = state.value;\n\n // If parameters have changed since our last render, schedule an update with its current value.\n if (state.receiver !== receiver || state.id !== remote.id) {\n // When the consumer of this hook changes receiver or attached node, the node they switched\n // to might already be unmounted. We guard against that by making sure we don’t get null\n // back from the receiver, and storing the “attached” node in state whether it is actually\n // attached or not, so we have a paper trail of how we got here.\n const updated = receiver.get(remote);\n\n // If the subscription has been updated, we'll schedule another update with React.\n // React will process this update immediately, so the old subscription value won't be committed.\n // It is still nice to avoid returning a mismatched value though, so let's override the return value.\n returnValue = updated;\n setState({\n receiver,\n id: remote.id,\n version: updated?.version,\n value: returnValue\n });\n }\n useDebugValue(returnValue);\n useEffect(() => {\n const abort = new AbortController();\n const checkForUpdates = () => {\n if (abort.signal.aborted) return;\n setState(previousState => {\n const {\n id: previousId,\n version: previousVersion,\n receiver: previousReceiver\n } = previousState;\n const {\n id\n } = remote;\n\n // Ignore values from stale sources\n if (previousReceiver !== receiver || previousId !== id) {\n return previousState;\n }\n\n // This function is also called as part of the initial useEffect() when the\n // component mounts. It’s possible that between the initial render (when the\n // remote component was for sure attached, to the best of the host’s knowledge)\n // and the effect, the component was removed from the remote tree. You’ll see that\n // the rest of this callback is careful to handle cases where the node is in this\n // state.\n const value = receiver.get(remote);\n const version = value?.version;\n\n // If the value hasn't changed, no update is needed.\n // Return state as-is so React can bail out and avoid an unnecessary render.\n if (previousVersion === version) {\n return previousState;\n }\n return {\n receiver,\n value,\n id,\n version\n };\n });\n };\n receiver.subscribe(remote, checkForUpdates, {\n signal: abort.signal\n });\n\n // Passive effect, so we need to check if anything has changed\n checkForUpdates();\n return () => {\n abort.abort();\n };\n }, [receiver, remote.id]);\n return returnValue;\n}\n\nexport { useRemoteReceived };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAKA,SAAS,kBAAkB,QAAQ,UAAU;CAC3C,MAAM,CAAC,OAAO,YAAY,eAAe;EACvC,MAAM,QAAQ,SAAS,IAAI,MAAM;EACjC,OAAO;GACL,IAAI,OAAO;GACX,SAAS,OAAO;GAChB;GACA;EACF;CACF,CAAC;CACD,IAAI,cAAc,MAAM;CAGxB,IAAI,MAAM,aAAa,YAAY,MAAM,OAAO,OAAO,IAAI;EAKzD,MAAM,UAAU,SAAS,IAAI,MAAM;EAKnC,cAAc;EACd,SAAS;GACP;GACA,IAAI,OAAO;GACX,SAAS,SAAS;GAClB,OAAO;EACT,CAAC;CACH;CACA,cAAc,WAAW;CACzB,gBAAgB;EACd,MAAM,QAAQ,IAAI,gBAAgB;EAClC,MAAM,wBAAwB;GAC5B,IAAI,MAAM,OAAO,SAAS;GAC1B,UAAS,kBAAiB;IACxB,MAAM,EACJ,IAAI,YACJ,SAAS,iBACT,UAAU,qBACR;IACJ,MAAM,EACJ,OACE;IAGJ,IAAI,qBAAqB,YAAY,eAAe,IAClD,OAAO;IAST,MAAM,QAAQ,SAAS,IAAI,MAAM;IACjC,MAAM,UAAU,OAAO;IAIvB,IAAI,oBAAoB,SACtB,OAAO;IAET,OAAO;KACL;KACA;KACA;KACA;IACF;GACF,CAAC;EACH;EACA,SAAS,UAAU,QAAQ,iBAAiB,EAC1C,QAAQ,MAAM,OAChB,CAAC;EAGD,gBAAgB;EAChB,aAAa;GACX,MAAM,MAAM;EACd;CACF,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC;CACxB,OAAO;AACT"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { RemoteTextRenderer } from "./RemoteTextRenderer.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
5
|
+
//#region ../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/node.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Renders a remote node to the host using React.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mittwald+remote-dom-react@1.2.2-mittwald.10_patch_hash=62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/node.mjs"],"sourcesContent":["import { RemoteTextRenderer } from './RemoteTextRenderer.mjs';\nimport { jsx } from 'react/jsx-runtime';\n\n/**\n * Renders a remote node to the host using React.\n *\n * @param node The remote node to render using React\n */\nfunction renderRemoteNode(node, {\n receiver,\n components\n}) {\n switch (node.type) {\n case 1:\n {\n const Component = components.get(node.element);\n if (Component == null) {\n throw new Error(`No component found for remote element: ${node.element}`);\n }\n return /*#__PURE__*/jsx(Component, {\n element: node,\n receiver: receiver,\n components: components\n }, node.id);\n }\n case 3:\n {\n return /*#__PURE__*/jsx(RemoteTextRenderer, {\n remote: node,\n receiver: receiver\n }, node.id);\n }\n case 8:\n {\n return null;\n }\n default:\n {\n throw new Error(`Unknown remote node type: ${String(node)}`);\n }\n }\n}\n\nexport { renderRemoteNode };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQA,SAAS,iBAAiB,MAAM,EAC9B,UACA,cACC;CACD,QAAQ,KAAK,MAAb;EACE,KAAK,GACH;GACE,MAAM,YAAY,WAAW,IAAI,KAAK,OAAO;GAC7C,IAAI,aAAa,MACf,MAAM,IAAI,MAAM,0CAA0C,KAAK,SAAS;GAE1E,OAAoB,kBAAI,WAAW;IACjC,SAAS;IACC;IACE;GACd,GAAG,KAAK,EAAE;EACZ;EACF,KAAK,GAED,OAAoB,kBAAI,oBAAoB;GAC1C,QAAQ;GACE;EACZ,GAAG,KAAK,EAAE;EAEd,KAAK,GAED,OAAO;EAEX,SAEI,MAAM,IAAI,MAAM,6BAA6B,OAAO,IAAI,GAAG;CAEjE;AACF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
import { HostRenderErrorBoundary } from "./components/HostRenderErrorBoundary.mjs";
|
|
5
5
|
import { RemoteReceiver } from "../../../node_modules/.pnpm/@mittwald_remote-dom-core@1.7.0-mittwald.10_@preact_signals-core@1.14.2/node_modules/@mittwald/remote-dom-core/build/esm/receivers/RemoteReceiver.mjs";
|
|
6
|
-
import { RemoteRootRenderer } from "../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.
|
|
6
|
+
import { RemoteRootRenderer } from "../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/RemoteRootRenderer.mjs";
|
|
7
7
|
import { useMergedComponents } from "./hooks/useMergedComponents.mjs";
|
|
8
8
|
import { toComponentUsageEvent } from "./lib/componentUsage.mjs";
|
|
9
9
|
import { useControllableSuspenseTrigger } from "./hooks/useControllableSuspenseTrigger.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { createRemoteComponentRenderer } from "../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.
|
|
3
|
+
import { createRemoteComponentRenderer } from "../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs";
|
|
4
4
|
import { createFlowRemoteComponentRenderer } from "./lib/createFlowRemoteComponentRenderer.mjs";
|
|
5
5
|
import { elementFactory } from "./lib/elementFactory.mjs";
|
|
6
6
|
import flowComponents from "./auto-generated/index.mjs";
|
package/dist/js/packages/remote-react-renderer/src/lib/createFlowRemoteComponentRenderer.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { isReactSuspendedStyle, isStyleProp } from "./propClassifiers.mjs";
|
|
4
|
-
import { createRemoteComponentRenderer } from "../../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.
|
|
4
|
+
import { createRemoteComponentRenderer } from "../../../../node_modules/.pnpm/@mittwald_remote-dom-react@1.2.2-mittwald.10_patch_hash_62bb2b92626b650b153b14495520154_33e6b0816e3c6200b85ecb89e48d0790/node_modules/@mittwald/remote-dom-react/build/esm/host/component.mjs";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { Version } from "@mittwald/flow-remote-core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-react-renderer",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React rendering for Flow Remote Elements",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"test:unit": "vitest run --passWithNoTests"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mittwald/ext-bridge": "1.4.
|
|
33
|
-
"@mittwald/flow-remote-core": "1.4.
|
|
34
|
-
"@mittwald/flow-remote-elements": "1.4.
|
|
32
|
+
"@mittwald/ext-bridge": "1.4.29",
|
|
33
|
+
"@mittwald/flow-remote-core": "1.4.29",
|
|
34
|
+
"@mittwald/flow-remote-elements": "1.4.29",
|
|
35
35
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
36
36
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
37
37
|
"@types/react": "^19.2",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"remeda": "^2.43.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@mittwald/flow-core": "1.4.
|
|
44
|
-
"@mittwald/flow-react-components": "1.4.
|
|
45
|
-
"@mittwald/typescript-config": "1.4.
|
|
43
|
+
"@mittwald/flow-core": "1.4.29",
|
|
44
|
+
"@mittwald/flow-react-components": "1.4.29",
|
|
45
|
+
"@mittwald/typescript-config": "1.4.29",
|
|
46
46
|
"@types/node": "^25.9.3",
|
|
47
47
|
"nx": "^22.7.5",
|
|
48
48
|
"react": "^19.2.8",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"vitest": "^4.1.11"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@mittwald/flow-react-components": "1.4.
|
|
60
|
+
"@mittwald/flow-react-components": "1.4.29",
|
|
61
61
|
"react": "^19.2.0",
|
|
62
62
|
"react-dom": "^19.2.0",
|
|
63
63
|
"react-hook-form": "^7.65.0"
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"optional": true
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "abad221a4b67665b116f1f8346d30e699ae728fb"
|
|
71
71
|
}
|