diff --git a/_bundles/ui-router-react-hybrid.js b/_bundles/ui-router-react-hybrid.js index 4b013404ba059f667ec5f4d5b39531a6a464bb1a..c01b345b8fbf09a3f89bfb02833431441e481360 100644 --- a/_bundles/ui-router-react-hybrid.js +++ b/_bundles/ui-router-react-hybrid.js @@ -5,10 +5,10 @@ * @license MIT License, http://www.opensource.org/licenses/MIT */ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@uirouter/angularjs'), require('@uirouter/react'), require('react'), require('angular'), require('react-dom'), require('@uirouter/core')) : - typeof define === 'function' && define.amd ? define(['exports', '@uirouter/angularjs', '@uirouter/react', 'react', 'angular', 'react-dom', '@uirouter/core'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@uirouter/react-hybrid'] = {}, global['@uirouter/angularjs'], global['@uirouter/react'], global.React, global.angular, global.ReactDOM, global['@uirouter/core'])); -}(this, (function (exports, angularjs, react, React, angular, ReactDOM, core) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@uirouter/angularjs'), require('@uirouter/react'), require('react'), require('angular'), require('../node_modules/react-dom/client.js'), require('@uirouter/core'), require('react-dom')) : + typeof define === 'function' && define.amd ? define(['exports', '@uirouter/angularjs', '@uirouter/react', 'react', 'angular', '../node_modules/react-dom/client', '@uirouter/core', 'react-dom'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@uirouter/react-hybrid'] = {}, global['@uirouter/angularjs'], global['@uirouter/react'], global.React, global.angular, global.client_js, global['@uirouter/core'], global.ReactDOM)); +}(this, (function (exports, angularjs, react, React, angular, client_js, core, ReactDOM) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return e; @@ -240,6 +240,7 @@ return debugLog.apply(void 0, __spreadArrays$1(['angularjs', 'react-ui-view-adapter', $id + "/" + attrs.name, method, message], args)); }; var el = elem[0]; + var root = client_js.createRoot(el); var _ref = null; var destroyed = false; var $id = id$1++; @@ -294,8 +295,8 @@ portalView.createPortalToChildUIView($id, { childUIViewProps: childUIViewProps, portalTarget: el }); } else { - debug('.renderReactUIView()', "ReactDOM.render()", el); - ReactDOM__namespace.render(React__namespace.createElement(ReactUIView, __assign$3({}, childUIViewProps)), el); + debug('.renderReactUIView()', "root.render()", el); + root.render(React__namespace.createElement(ReactUIView, __assign$3({}, childUIViewProps))); } } scope.$on('$destroy', function () { @@ -305,8 +306,8 @@ portalView.removePortalToChildUIView($id); } else { - var unmounted = ReactDOM__namespace.unmountComponentAtNode(el); - debug('.$on("$destroy")', "unmountComponentAtNode(): " + unmounted, el); + var unmounted = root.unmount(); + debug('.$on("$destroy")', "root.unmount(): " + unmounted, el); } // Remove using jQLite element for cross-browser compatibility. elem.remove(); diff --git a/_bundles/ui-router-react-hybrid.js.map b/_bundles/ui-router-react-hybrid.js.map index ae71416875eea761f4b771d275e2698f15608a34..4407d5be021a0a81bb8f6438357aa16e189cf492 100644 --- a/_bundles/ui-router-react-hybrid.js.map +++ b/_bundles/ui-router-react-hybrid.js.map @@ -19,7 +19,7 @@ "import * as angular from 'angular';\nimport * as React from 'react';\nimport { ReactNode, useContext, useRef, useState } from 'react';\nimport { UIViewData } from '@uirouter/angularjs/lib/directives/viewDirective';\nimport { UIRouterContext, UIViewContext, UIViewAddress } from '@uirouter/react';\nimport { UIRouter } from '@uirouter/core';\n\nexport interface IUIRouterContextComponentProps {\n parentContextLevel?: string;\n inherited?: boolean;\n}\n\ninterface IContextFromAngularJS {\n router: UIRouter;\n addr: UIViewAddress;\n}\nconst initialState: IContextFromAngularJS = { router: undefined, addr: undefined };\n\n/**\n * Provide react context necessary for UIView, UISref and UISrefActive\n *\n * Gets the context from the parent react UIView (if component tree is all react)\n * Gets the context from the from parent angular ui-view if no parent reat UIView is available\n */\nexport function UIRouterContextComponent(props: {\n parentContextLevel: string;\n inherited: boolean;\n children: ReactNode;\n}) {\n const { parentContextLevel, inherited, children } = props;\n const [contextFromAngularJS, setContextFromAngularJS] = useState(initialState);\n const routerFromReactContext = useContext(UIRouterContext);\n const parentUIViewFromReactContext = useContext(UIViewContext);\n const domRef = useRef(null);\n\n // Once we have a DOM node, get the AngularJS injector and walk up the DOM to find the AngularJS $uiView\n const refCallback = (el: HTMLElement) => {\n if (el && el !== domRef.current) {\n domRef.current = el;\n const injector = angular.element(el).injector();\n\n // get router from angularjs\n const router = injector?.get('$uiRouter');\n\n // get parent uiview from angularjs\n let steps = parseInt(parentContextLevel, 10);\n steps = isNaN(steps) ? 0 : steps;\n\n while (el && steps--) el = el.parentElement;\n const $uiView = el && angular.element(el).inheritedData('$uiView');\n const addr = $uiView && new ParentUIViewAddressAdapter($uiView);\n\n setContextFromAngularJS({ router, addr } as IContextFromAngularJS);\n }\n };\n\n // render a div once to get a ref into the dom\n // Use the dom ref to access the AngularJS state\n if (!domRef.current) {\n return
;\n }\n\n // We know the AngularJS state. Now render the {children}\n const childrenCount = React.Children.count(children);\n const isArray = Array.isArray(children);\n\n return (\n \n \n {childrenCount === 1 && !isArray ? React.Children.only(children) :
{children}
}\n
\n
\n );\n}\n\nUIRouterContextComponent.defaultProps = {\n parentContextLevel: '0',\n inherited: true,\n} as IUIRouterContextComponentProps;\n\n/**\n * Get the fqn and context from the parent angularjs ui-view.\n * Uses the ui-view element's data\n */\nclass ParentUIViewAddressAdapter {\n constructor(private _ngdata: UIViewData) {\n if (!_ngdata) throw new Error('@uirouter/react-hybrid: Address Adapter created with no _ngdata parameter.');\n }\n\n public get fqn() {\n return this._ngdata.$uiView.fqn;\n }\n\n public get context() {\n if (!this._ngdata || !this._ngdata.$cfg || !this._ngdata.$cfg.viewDecl) {\n console.log(this._ngdata);\n throw new Error(\n '@uirouter/react-hybrid: Uh oh. Views are in an invalid state. Parent UIView has no $cfg or viewDecl'\n );\n }\n\n return this._ngdata.$cfg.viewDecl.$context || this._ngdata.$uiView.creationContext;\n }\n}\n", "import { padString } from '@uirouter/core';\n\nexport const debugLog = (\n angularOrReact: 'angularjs' | 'react',\n component: string,\n id: string,\n method: string,\n message: string,\n ...args\n) => {\n if (window && window['debugReactHybrid'] !== true) return;\n console.log(\n `${padString(12, angularOrReact)} ${padString(40, `${component}[${id}]`)} ${padString(\n 35,\n `${method}:`\n )} ${message}`,\n ...args\n );\n};\n", "import * as React from 'react';\nimport { UIView, UIViewProps } from '@uirouter/react';\nimport { UIRouterContextComponent } from './UIRouterReactContext';\nimport { debugLog } from '../debug';\n\nconst InternalUIView = UIView.__internalViewComponent;\n\nexport interface IReactUIViewProps extends UIViewProps {\n refFn: (ref: HTMLElement) => void;\n}\n\nexport const ReactUIView = ({ refFn, ...props }: IReactUIViewProps) => {\n debugLog('react', 'ReactUIView', `?/${props['name']}`, '.render()', '');\n return (\n \n \n \n );\n};\n", - "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `ReactDOM.render()`, el);\n ReactDOM.render(, el as any);\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = ReactDOM.unmountComponentAtNode(el);\n debug('.$on(\"$destroy\")', `unmountComponentAtNode(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n", + "import * as React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n const root = createRoot(el);\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `root.render()`, el);\n root.render();\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = root.unmount();\n debug('.$on(\"$destroy\")', `root.unmount(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n", "import * as React from 'react';\nimport { IScope } from 'angular';\nimport { hybridModule } from '../angularjs/module';\nimport { PortalView } from './PortalView';\n\nlet $injector, $rootScope, $compile;\nhybridModule.run([\n '$injector',\n _$injector_ => {\n $injector = _$injector_;\n $rootScope = _$injector_.get('$rootScope');\n $compile = _$injector_.get('$compile');\n },\n]);\n\ninterface IAngularUIViewProps {\n portalView?: PortalView;\n className?: string;\n}\n\nexport interface IPortalScope extends IScope {\n $uiRouterReactHybridPortalView?: PortalView;\n}\n\n/**\n * A React component which renders an AngularJS \n * This was heavily influenced by https://github.com/coatue-oss/angular2react\n */\nexport class AngularUIView extends React.Component {\n private $scope: IPortalScope = $rootScope.$new();\n\n constructor(props: IAngularUIViewProps) {\n super(props);\n this.$scope.$uiRouterReactHybridPortalView = this.props.portalView;\n }\n\n componentWillUnmount() {\n this.$scope.$destroy();\n }\n\n render() {\n const { className, ...restProps } = this.props;\n const ref = (htmlRef: Element) => $compile(htmlRef)(this.$scope);\n\n const props = { ...restProps, class: className, ref };\n return React.createElement('ui-view', props);\n }\n\n /** Only render once */\n shouldComponentUpdate() {\n return false;\n }\n}\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { UIViewProps } from '@uirouter/react';\nimport { debugLog } from '../debug';\nimport { AngularUIView } from './AngularUIView';\nimport { IReactUIViewProps, ReactUIView } from './ReactUIView';\n\nlet id = 0;\n\ninterface IPortalViewState {\n portals: {\n [key: number]: ChildUIView;\n };\n}\n\nexport interface ChildUIView {\n childUIViewProps: IReactUIViewProps;\n portalTarget: HTMLElement;\n}\n\n/**\n * This react component renders the AngularUIView react component\n * and also creates React Portals as needed for child React UIViews.\n */\nexport class PortalView extends React.PureComponent {\n private $id = id++;\n public state: IPortalViewState = { portals: [] };\n\n private debug = (method: string, message: string, ...args) =>\n debugLog('react', 'PortalView', `${this.$id}/${this.props['name']}`, method, message, ...args);\n\n public componentWillUnmount() {\n this.debug('.componentWillUnmount()', '');\n }\n\n createPortalToChildUIView = (uiViewId: number, childUIView: ChildUIView) => {\n this.debug('.createPortalToChildUIView()', JSON.stringify(childUIView.childUIViewProps), childUIView.portalTarget);\n this.setState(prev => {\n const portals = { ...prev.portals, [uiViewId]: childUIView };\n return { portals };\n });\n };\n\n removePortalToChildUIView = (uiViewId: number) => {\n const childUIView = this.state.portals[uiViewId] || ({} as ChildUIView);\n this.debug('.removePortalToChildUIView()', `${uiViewId}`, childUIView.childUIViewProps, childUIView.portalTarget);\n this.setState(prev => {\n const portals = { ...prev.portals };\n delete portals[uiViewId];\n return { portals };\n });\n };\n\n renderPortals() {\n const { portals } = this.state;\n const method = `.renderPortals()`;\n\n Object.keys(portals).forEach(key => {\n const portal = portals[key];\n this.debug(method, `ReactDOM.createPortal(${key})`, '', portal.childUIViewProps, portal.portalTarget);\n });\n\n return Object.keys(portals).map(key => {\n const portal = portals[key];\n // No mechanism to provide a key when creating a portals array?\n return (\n
\n {ReactDOM.createPortal(, portal.portalTarget)}\n
\n );\n });\n }\n\n render() {\n this.debug('.render()', '');\n\n return (\n \n \n {this.renderPortals()}\n \n );\n }\n}\n", "import * as React from 'react';\nimport { UIView } from '@uirouter/react';\nimport { debugLog } from '../debug';\nimport { PortalView } from './PortalView';\n\nconst realRender = UIView.prototype.render;\n\n/**\n * Monkey patches the @uirouter/react UIView such that:\n *\n * When a @uirouter/react `` is rendered (from react code),\n * it renders first to an AngularJS `` component,\n * inside the `ui-view` is an AngularJS ``,\n * which finally renders a real @uirouter/react ``:\n *\n * \n * \n * \n * \n * \n * \n * \n */\n\nUIView.prototype.render = function() {\n if (this.props.wrap === false) {\n const id = `${this.$id}/${this.props['name']}`;\n debugLog('react', 'UIViewMonkeyPatch', id, '.render()', 'realRender.apply(this, arguments)');\n return realRender.apply(this, arguments);\n }\n\n return ;\n};\n", @@ -37,9 +37,10 @@ "padString", "UIView", "id", + "createRoot", "filter", - "ReactDOM", - "__extends" + "__extends", + "ReactDOM" ], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACa,sBAAsB,GAAG,yBAAyB;QAClD,YAAY,GAAGA,kBAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,WAAW,CAAC;;ICGhF;;;;;;IAOA,YAAY,CAAC,MAAM,CAAC;QACl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;;;;;;;;;;AAiBAA,gBAAM,CAAC,SAAS,CAAC,MAAM,GAAG;QACxB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE;YAC7B,IAAM,EAAE,GAAM,IAAI,CAAC,GAAG,SAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAG,CAAC;YAC/C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,CAAC,CAAC;YAC7F,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;SAC1C;QAED,OAAOP,+BAAC,UAAU,eAAK,IAAI,CAAC,KAAK,EAAI,CAAC;IACxC,CAAC;;IC7BD;;;;;;;;;;;;;;;;;;;;;;;;;aAyBgB,eAAe,CAAC,SAA8D;QAC5F,OAAO,UAAA,KAAK,IAAI,OAAAA,+BAAC,wBAAwB,QAAEA,gBAAK,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAA4B,GAAA,CAAC;IAC/G;;;;;;;;;;;;;" } \ No newline at end of file diff --git a/_bundles/ui-router-react-hybrid.min.js b/_bundles/ui-router-react-hybrid.min.js index 8b872247b2b64d9cda3d79d10ce53b4f833c0a61..16b97228040739ba982710bad549aba90687bcba 100644 --- a/_bundles/ui-router-react-hybrid.min.js +++ b/_bundles/ui-router-react-hybrid.min.js @@ -4,5 +4,5 @@ * @link undefined * @license MIT License, http://www.opensource.org/licenses/MIT */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@uirouter/angularjs"),require("@uirouter/react"),require("react"),require("angular"),require("react-dom"),require("@uirouter/core")):"function"==typeof define&&define.amd?define(["exports","@uirouter/angularjs","@uirouter/react","react","angular","react-dom","@uirouter/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@uirouter/react-hybrid"]={},e["@uirouter/angularjs"],e["@uirouter/react"],e.React,e.angular,e.ReactDOM,e["@uirouter/core"])}(this,(function(e,t,r,n,o,i,a){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=u(n),l=u(o),p=u(i),f="ui.router.react.hybrid",s=l.module(f,["ui.router"]);s.config(["$uiRouterProvider",function(e){e.viewService._pluginapi._viewConfigFactory("react",(function(e,t){return new r.ReactViewConfig(e,t)})),e.stateRegistry.decorator("views",(function(e,t){var r=t(e),n=e.self,o=n.views||{$default:n};return Object.keys(r).forEach((function(e){var t=r[e];o[e||"$default"];var n,i=((n=t.component)instanceof c.Component||n&&n.prototype&&n.prototype.isReactComponent||n&&n.prototype&&"function"==typeof n.prototype.render||n&&"function"==typeof n)&&"react";t.$type=o[e].$type||i||t.$type})),r}))}]);var d={router:void 0,addr:void 0};function v(e){var t=e.parentContextLevel,o=e.inherited,i=e.children,a=n.useState(d),u=a[0],p=a[1],f=n.useContext(r.UIRouterContext),s=n.useContext(r.UIViewContext),v=n.useRef(null);if(!v.current)return c.createElement("div",{ref:function(e){if(e&&e!==v.current){v.current=e;var r=l.element(e).injector(),n=null==r?void 0:r.get("$uiRouter"),o=parseInt(t,10);for(o=isNaN(o)?0:o;e&&o--;)e=e.parentElement;var i=e&&l.element(e).inheritedData("$uiView"),a=i&&new y(i);p({router:n,addr:a})}}});var h=c.Children.count(i),w=Array.isArray(i);return c.createElement(r.UIRouterContext.Provider,{value:o&&f||u.router},c.createElement(r.UIViewContext.Provider,{value:o&&s||u.addr},1!==h||w?c.createElement("div",null,i):c.Children.only(i)))}v.defaultProps={parentContextLevel:"0",inherited:!0};var y=function(){function e(e){if(this._ngdata=e,!e)throw new Error("@uirouter/react-hybrid: Address Adapter created with no _ngdata parameter.")}return Object.defineProperty(e.prototype,"fqn",{get:function(){return this._ngdata.$uiView.fqn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){if(!this._ngdata||!this._ngdata.$cfg||!this._ngdata.$cfg.viewDecl)throw console.log(this._ngdata),new Error("@uirouter/react-hybrid: Uh oh. Views are in an invalid state. Parent UIView has no $cfg or viewDecl");return this._ngdata.$cfg.viewDecl.$context||this._ngdata.$uiView.creationContext},enumerable:!1,configurable:!0}),e}(),h=function(){for(var e=0,t=0,r=arguments.length;t')}}}));var $=0;s.directive("reactUiViewAdapter",(function(){return{restrict:"E",link:function(e,t,r){var n=function(e,t){for(var n=[],o=2;o)',o),p.render(c.createElement(O,P({},t)),o))}}e.$on("$destroy",(function(){u=!0;var r=e.$uiRouterReactHybridPortalView;if(r)r.removePortalToChildUIView(l);else{var i=p.unmountComponentAtNode(o);n('.$on("$destroy")',"unmountComponentAtNode(): "+i,o)}t.remove()})),y()}}}));var j,U,C,_=(j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),I=function(){return(I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r')}}}));var $=0;d.directive("reactUiViewAdapter",(function(){return{restrict:"E",link:function(e,t,r){var n=function(e,t){for(var n=[],o=2;o)',o),u.render(l.createElement(P,V({},t))))}}e.$on("$destroy",(function(){p=!0;var r=e.$uiRouterReactHybridPortalView;if(r)r.removePortalToChildUIView(f);else{var i=u.unmount();n('.$on("$destroy")',"root.unmount(): "+i,o)}t.remove()})),h()}}}));var _,U,I,C=(_=function(e,t){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),R=function(){return(R=Object.assign||function(e){for(var t,r=1,n=arguments.length;r {\n if (el && el !== domRef.current) {\n domRef.current = el;\n const injector = angular.element(el).injector();\n\n // get router from angularjs\n const router = injector?.get('$uiRouter');\n\n // get parent uiview from angularjs\n let steps = parseInt(parentContextLevel, 10);\n steps = isNaN(steps) ? 0 : steps;\n\n while (el && steps--) el = el.parentElement;\n const $uiView = el && angular.element(el).inheritedData('$uiView');\n const addr = $uiView && new ParentUIViewAddressAdapter($uiView);\n\n setContextFromAngularJS({ router, addr } as IContextFromAngularJS);\n }\n };\n\n // render a div once to get a ref into the dom\n // Use the dom ref to access the AngularJS state\n if (!domRef.current) {\n return
;\n }\n\n // We know the AngularJS state. Now render the {children}\n const childrenCount = React.Children.count(children);\n const isArray = Array.isArray(children);\n\n return (\n \n \n {childrenCount === 1 && !isArray ? React.Children.only(children) :
{children}
}\n
\n
\n );\n}\n\nUIRouterContextComponent.defaultProps = {\n parentContextLevel: '0',\n inherited: true,\n} as IUIRouterContextComponentProps;\n\n/**\n * Get the fqn and context from the parent angularjs ui-view.\n * Uses the ui-view element's data\n */\nclass ParentUIViewAddressAdapter {\n constructor(private _ngdata: UIViewData) {\n if (!_ngdata) throw new Error('@uirouter/react-hybrid: Address Adapter created with no _ngdata parameter.');\n }\n\n public get fqn() {\n return this._ngdata.$uiView.fqn;\n }\n\n public get context() {\n if (!this._ngdata || !this._ngdata.$cfg || !this._ngdata.$cfg.viewDecl) {\n console.log(this._ngdata);\n throw new Error(\n '@uirouter/react-hybrid: Uh oh. Views are in an invalid state. Parent UIView has no $cfg or viewDecl'\n );\n }\n\n return this._ngdata.$cfg.viewDecl.$context || this._ngdata.$uiView.creationContext;\n }\n}\n", "import { padString } from '@uirouter/core';\n\nexport const debugLog = (\n angularOrReact: 'angularjs' | 'react',\n component: string,\n id: string,\n method: string,\n message: string,\n ...args\n) => {\n if (window && window['debugReactHybrid'] !== true) return;\n console.log(\n `${padString(12, angularOrReact)} ${padString(40, `${component}[${id}]`)} ${padString(\n 35,\n `${method}:`\n )} ${message}`,\n ...args\n );\n};\n", "import * as React from 'react';\nimport { UIView, UIViewProps } from '@uirouter/react';\nimport { UIRouterContextComponent } from './UIRouterReactContext';\nimport { debugLog } from '../debug';\n\nconst InternalUIView = UIView.__internalViewComponent;\n\nexport interface IReactUIViewProps extends UIViewProps {\n refFn: (ref: HTMLElement) => void;\n}\n\nexport const ReactUIView = ({ refFn, ...props }: IReactUIViewProps) => {\n debugLog('react', 'ReactUIView', `?/${props['name']}`, '.render()', '');\n return (\n \n \n \n );\n};\n", - "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `ReactDOM.render()`, el);\n ReactDOM.render(, el as any);\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = ReactDOM.unmountComponentAtNode(el);\n debug('.$on(\"$destroy\")', `unmountComponentAtNode(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n", + "import * as React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n const root = createRoot(el);\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `root.render()`, el);\n root.render();\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = root.unmount();\n debug('.$on(\"$destroy\")', `root.unmount(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n", "import * as React from 'react';\nimport { IScope } from 'angular';\nimport { hybridModule } from '../angularjs/module';\nimport { PortalView } from './PortalView';\n\nlet $injector, $rootScope, $compile;\nhybridModule.run([\n '$injector',\n _$injector_ => {\n $injector = _$injector_;\n $rootScope = _$injector_.get('$rootScope');\n $compile = _$injector_.get('$compile');\n },\n]);\n\ninterface IAngularUIViewProps {\n portalView?: PortalView;\n className?: string;\n}\n\nexport interface IPortalScope extends IScope {\n $uiRouterReactHybridPortalView?: PortalView;\n}\n\n/**\n * A React component which renders an AngularJS \n * This was heavily influenced by https://github.com/coatue-oss/angular2react\n */\nexport class AngularUIView extends React.Component {\n private $scope: IPortalScope = $rootScope.$new();\n\n constructor(props: IAngularUIViewProps) {\n super(props);\n this.$scope.$uiRouterReactHybridPortalView = this.props.portalView;\n }\n\n componentWillUnmount() {\n this.$scope.$destroy();\n }\n\n render() {\n const { className, ...restProps } = this.props;\n const ref = (htmlRef: Element) => $compile(htmlRef)(this.$scope);\n\n const props = { ...restProps, class: className, ref };\n return React.createElement('ui-view', props);\n }\n\n /** Only render once */\n shouldComponentUpdate() {\n return false;\n }\n}\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { UIViewProps } from '@uirouter/react';\nimport { debugLog } from '../debug';\nimport { AngularUIView } from './AngularUIView';\nimport { IReactUIViewProps, ReactUIView } from './ReactUIView';\n\nlet id = 0;\n\ninterface IPortalViewState {\n portals: {\n [key: number]: ChildUIView;\n };\n}\n\nexport interface ChildUIView {\n childUIViewProps: IReactUIViewProps;\n portalTarget: HTMLElement;\n}\n\n/**\n * This react component renders the AngularUIView react component\n * and also creates React Portals as needed for child React UIViews.\n */\nexport class PortalView extends React.PureComponent {\n private $id = id++;\n public state: IPortalViewState = { portals: [] };\n\n private debug = (method: string, message: string, ...args) =>\n debugLog('react', 'PortalView', `${this.$id}/${this.props['name']}`, method, message, ...args);\n\n public componentWillUnmount() {\n this.debug('.componentWillUnmount()', '');\n }\n\n createPortalToChildUIView = (uiViewId: number, childUIView: ChildUIView) => {\n this.debug('.createPortalToChildUIView()', JSON.stringify(childUIView.childUIViewProps), childUIView.portalTarget);\n this.setState(prev => {\n const portals = { ...prev.portals, [uiViewId]: childUIView };\n return { portals };\n });\n };\n\n removePortalToChildUIView = (uiViewId: number) => {\n const childUIView = this.state.portals[uiViewId] || ({} as ChildUIView);\n this.debug('.removePortalToChildUIView()', `${uiViewId}`, childUIView.childUIViewProps, childUIView.portalTarget);\n this.setState(prev => {\n const portals = { ...prev.portals };\n delete portals[uiViewId];\n return { portals };\n });\n };\n\n renderPortals() {\n const { portals } = this.state;\n const method = `.renderPortals()`;\n\n Object.keys(portals).forEach(key => {\n const portal = portals[key];\n this.debug(method, `ReactDOM.createPortal(${key})`, '', portal.childUIViewProps, portal.portalTarget);\n });\n\n return Object.keys(portals).map(key => {\n const portal = portals[key];\n // No mechanism to provide a key when creating a portals array?\n return (\n
\n {ReactDOM.createPortal(, portal.portalTarget)}\n
\n );\n });\n }\n\n render() {\n this.debug('.render()', '');\n\n return (\n \n \n {this.renderPortals()}\n \n );\n }\n}\n", "import * as React from 'react';\nimport { UIView } from '@uirouter/react';\nimport { debugLog } from '../debug';\nimport { PortalView } from './PortalView';\n\nconst realRender = UIView.prototype.render;\n\n/**\n * Monkey patches the @uirouter/react UIView such that:\n *\n * When a @uirouter/react `` is rendered (from react code),\n * it renders first to an AngularJS `` component,\n * inside the `ui-view` is an AngularJS ``,\n * which finally renders a real @uirouter/react ``:\n *\n * \n * \n * \n * \n * \n * \n * \n */\n\nUIView.prototype.render = function() {\n if (this.props.wrap === false) {\n const id = `${this.$id}/${this.props['name']}`;\n debugLog('react', 'UIViewMonkeyPatch', id, '.render()', 'realRender.apply(this, arguments)');\n return realRender.apply(this, arguments);\n }\n\n return ;\n};\n", @@ -138,6 +138,8 @@ "attrs", "debug", "$id", + "root", + "createRoot", "_ref", "destroyed", "ignoredAttrKeys", @@ -157,11 +159,10 @@ "$uiRouterReactHybridPortalView", "createPortalToChildUIView", "portalTarget", - "ReactDOM", "$on", "removePortalToChildUIView", "unmounted", - "unmountComponentAtNode", + "unmount", "remove", "$rootScope", "$compile", @@ -190,6 +191,7 @@ "map", "style", "display", + "ReactDOM", "createPortal", "Fragment", "renderPortals", @@ -198,5 +200,5 @@ "apply", "arguments" ], - "mappings": ";;;;;;w4BACaA,EAAyB,yBACzBC,EAAeC,EAAQC,OAAOH,EAAwB,CAAC,cCUpEC,EAAaG,OAAO,CAClB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AO,CAAEC,QAAS,QAAU9I,IAAK,GAAGA,GACtC+I,EAASC,aAAa3I,gBAACqE,OAAgBiE,EAAOlC,mBAAsBkC,EAAO7B,mBAMpF4B,mBAAA,WAGE,OAFArF,KAAKmC,MAAM,YAAa,IAGtBnF,gBAACA,EAAM4I,cACL5I,gBAACwH,OAAkBxE,KAAKtC,OAAO4F,WAAYtD,QAC1CA,KAAK6F,qBAvDkB7I,EAAM8I,8NCnBhCC,EAAa5E,SAAOjE,UAAUE,gBAmB7BF,UAAUE,OAAS,WACxB,IAAwB,IAApB4C,KAAKtC,MAAM2F,KAAgB,CAC7B,IAAM1C,EAAQX,KAAKoC,QAAOpC,KAAKtC,MAAY,KAE3C,OADA+C,EAAS,QAAS,oBAAqBE,EAAI,YAAa,qCACjDoF,EAAWC,MAAMhG,KAAMiG,WAGhC,OAAOjJ,gBAACqI,OAAerF,KAAKtC,oCCHET,GAC9B,OAAO,SAAAS,GAAS,OAAAV,gBAACS,OAA0BT,EAAM+F,cAAc9F,EAAWS" } \ No newline at end of file diff --git a/lib/angularjs/ReactUIViewAdapterComponent.js b/lib/angularjs/ReactUIViewAdapterComponent.js index 3a32f9dda404767884adfe001da25dd022d63f25..7668a35623056fbfbe662e9059b64c4d5e3bbeb2 100644 --- a/lib/angularjs/ReactUIViewAdapterComponent.js +++ b/lib/angularjs/ReactUIViewAdapterComponent.js @@ -19,7 +19,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { }; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); -var ReactDOM = require("react-dom"); +var client_1 = require("react-dom/client"); var core_1 = require("@uirouter/core"); var ReactUIView_1 = require("../react/ReactUIView"); var module_1 = require("./module"); @@ -52,6 +52,7 @@ module_1.hybridModule.directive('reactUiViewAdapter', function () { return debug_1.debugLog.apply(void 0, __spreadArrays(['angularjs', 'react-ui-view-adapter', $id + "/" + attrs.name, method, message], args)); }; var el = elem[0]; + var root = client_1.createRoot(el); var _ref = null; var destroyed = false; var $id = id++; @@ -106,8 +107,8 @@ module_1.hybridModule.directive('reactUiViewAdapter', function () { portalView.createPortalToChildUIView($id, { childUIViewProps: childUIViewProps, portalTarget: el }); } else { - debug('.renderReactUIView()', "ReactDOM.render()", el); - ReactDOM.render(React.createElement(ReactUIView_1.ReactUIView, __assign({}, childUIViewProps)), el); + debug('.renderReactUIView()', "root.render()", el); + root.render(React.createElement(ReactUIView_1.ReactUIView, __assign({}, childUIViewProps))); } } scope.$on('$destroy', function () { @@ -117,8 +118,8 @@ module_1.hybridModule.directive('reactUiViewAdapter', function () { portalView.removePortalToChildUIView($id); } else { - var unmounted = ReactDOM.unmountComponentAtNode(el); - debug('.$on("$destroy")', "unmountComponentAtNode(): " + unmounted, el); + var unmounted = root.unmount(); + debug('.$on("$destroy")', "root.unmount(): " + unmounted, el); } // Remove using jQLite element for cross-browser compatibility. elem.remove(); diff --git a/lib/angularjs/ReactUIViewAdapterComponent.js.map b/lib/angularjs/ReactUIViewAdapterComponent.js.map index 1f4758129f6fc27656109a571256de3f8f6bc03e..3e75ba521158e62fc08d42f3e251a21f2114e8f2 100644 --- a/lib/angularjs/ReactUIViewAdapterComponent.js.map +++ b/lib/angularjs/ReactUIViewAdapterComponent.js.map @@ -6,8 +6,8 @@ "@uirouter/react-hybrid/angularjs/ReactUIViewAdapterComponent.tsx" ], "names": [], - "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,oCAAsC;AACtC,uCAAwC;AAGxC,oDAAmD;AACnD,mCAAwC;AACxC,kCAAoC;AAEpC,mHAAmH;AACnH,qBAAY,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC/B,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,UAAS,KAAK,EAAE,MAAM;YACvB,IAAA,IAAI,GAAa,MAAM,KAAnB,EAAE,MAAM,GAAK,MAAM,OAAX,CAAY;YAC9B,IAAI,GAAG,IAAI,IAAI,MAAM,IAAI,UAAU,CAAC;YACpC,gBAAQ,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AAC,UAAU,EAAE;gBACpB,SAAS,GAAG,IAAI,CAAC;gBACjB,IAAM,UAAU,GAAe,KAAK,CAAC,8BAA8B,CAAC;gBACpE,IAAI,UAAU,EAAE;oBACd,UAAU,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;iBAC3C;qBAAM;oBACL,IAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjC,KAAK,CAAC,kBAAkB,EAAE,qBAAmB,SAAW,EAAE,EAAE,CAAC,CAAC;iBAC/D;gBACD,+DAA+D;gBAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;YAEH,iBAAiB,EAAE,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC", "sourcesContent": [ - "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `ReactDOM.render()`, el);\n ReactDOM.render(, el as any);\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = ReactDOM.unmountComponentAtNode(el);\n debug('.$on(\"$destroy\")', `unmountComponentAtNode(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n" + "import * as React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n const root = createRoot(el);\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `root.render()`, el);\n root.render();\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = root.unmount();\n debug('.$on(\"$destroy\")', `root.unmount(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n" ] } \ No newline at end of file diff --git a/lib/react/AngularUIView.d.ts b/lib/react/AngularUIView.d.ts index 3545db87a3164571fb18c0222c824fa594b59366..6b296dbb14655d6b399cd6677b7b69dc64cc01fc 100644 --- a/lib/react/AngularUIView.d.ts +++ b/lib/react/AngularUIView.d.ts @@ -16,12 +16,7 @@ export declare class AngularUIView extends React.Component private $scope; constructor(props: IAngularUIViewProps); componentWillUnmount(): void; - render(): React.DOMElement<{ - class: string; - ref: (htmlRef: Element) => any; - portalView?: PortalView; - children?: React.ReactNode; - }, Element>; + render(): React.DOMElement, Element>; /** Only render once */ shouldComponentUpdate(): boolean; } diff --git a/lib-esm/angularjs/ReactUIViewAdapterComponent.js b/lib-esm/angularjs/ReactUIViewAdapterComponent.js index 84c728fa69116b5804f81a9fc019a4500ff07046..37a767d40ebeeb732a8a2c4e3f8bc857f60825b8 100644 --- a/lib-esm/angularjs/ReactUIViewAdapterComponent.js +++ b/lib-esm/angularjs/ReactUIViewAdapterComponent.js @@ -17,7 +17,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { return r; }; import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { filter } from '@uirouter/core'; import { ReactUIView } from '../react/ReactUIView'; import { hybridModule } from './module'; @@ -50,6 +50,7 @@ hybridModule.directive('reactUiViewAdapter', function () { return debugLog.apply(void 0, __spreadArrays(['angularjs', 'react-ui-view-adapter', $id + "/" + attrs.name, method, message], args)); }; var el = elem[0]; + var root = createRoot(el); var _ref = null; var destroyed = false; var $id = id++; @@ -104,8 +105,8 @@ hybridModule.directive('reactUiViewAdapter', function () { portalView.createPortalToChildUIView($id, { childUIViewProps: childUIViewProps, portalTarget: el }); } else { - debug('.renderReactUIView()', "ReactDOM.render()", el); - ReactDOM.render(React.createElement(ReactUIView, __assign({}, childUIViewProps)), el); + debug('.renderReactUIView()', "root.render()", el); + root.render(React.createElement(ReactUIView, __assign({}, childUIViewProps))); } } scope.$on('$destroy', function () { @@ -115,8 +116,8 @@ hybridModule.directive('reactUiViewAdapter', function () { portalView.removePortalToChildUIView($id); } else { - var unmounted = ReactDOM.unmountComponentAtNode(el); - debug('.$on("$destroy")', "unmountComponentAtNode(): " + unmounted, el); + var unmounted = root.unmount(); + debug('.$on("$destroy")', "root.unmount(): " + unmounted, el); } // Remove using jQLite element for cross-browser compatibility. elem.remove(); diff --git a/lib-esm/angularjs/ReactUIViewAdapterComponent.js.map b/lib-esm/angularjs/ReactUIViewAdapterComponent.js.map index b56a4f94f332f74fbe7e3e1ec2ca93604743053f..58879389ab97694c64a2e8f0c0ec7f6fc1d1f8a6 100644 --- a/lib-esm/angularjs/ReactUIViewAdapterComponent.js.map +++ b/lib-esm/angularjs/ReactUIViewAdapterComponent.js.map @@ -6,8 +6,8 @@ "@uirouter/react-hybrid/angularjs/ReactUIViewAdapterComponent.tsx" ], "names": [], - "mappings": ";;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,mHAAmH;AACnH,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC/B,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,UAAS,KAAK,EAAE,MAAM;YACvB,IAAA,IAAI,GAAa,MAAM,KAAnB,EAAE,MAAM,GAAK,MAAM,OAAX,CAAY;YAC9B,IAAI,GAAG,IAAI,IAAI,MAAM,IAAI,UAAU,CAAC;YACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,gCAAgC,EAAE,KAAK,CAAC,CAAC;YAC7F,KAAK,CAAC,IAAI,CAAC,mCAAgC,IAAI,gCAA4B,CAAC,CAAC;QAC/E,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAI,EAAE,GAAG,CAA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AAI,CAAC;gBACjB,IAAM,UAAU,GAAe,KAAK,CAAC,8BAA8B,CAAC;gBACpE,IAAI,UAAU,EAAE;oBACd,UAAU,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;iBAC3C;qBAAM;oBACL,IAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjC,KAAK,CAAC,kBAAkB,EAAE,qBAAmB,SAAW,EAAE,EAAE,CAAC,CAAC;iBAC/D;gBACD,+DAA+D;gBAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;YAEH,iBAAiB,EAAE,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC", "sourcesContent": [ - "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `ReactDOM.render()`, el);\n ReactDOM.render(, el as any);\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = ReactDOM.unmountComponentAtNode(el);\n debug('.$on(\"$destroy\")', `unmountComponentAtNode(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n" + "import * as React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { filter } from '@uirouter/core';\nimport { IPortalScope } from '../react/AngularUIView';\nimport { PortalView } from '../react/PortalView';\nimport { ReactUIView } from '../react/ReactUIView';\nimport { hybridModule } from './module';\nimport { debugLog } from '../debug';\n\n// When an angularjs `ui-view` is instantiated, also create an react-ui-view-adapter (which creates a react UIView)\nhybridModule.directive('uiView', function() {\n return {\n restrict: 'AE',\n compile: function(tElem, tAttrs) {\n let { name, uiView } = tAttrs;\n name = name || uiView || '$default';\n debugLog('angularjs', 'ui-view', '?', '.compile()', 'Creating react-ui-view-adapter', tElem);\n tElem.html(``);\n },\n };\n});\n\nvar id = 0;\n\n// This angularjs adapter (inside an angularjs ui-view) creates the react UIView and provides it the correct context\n// It also allows angularjs children created inside the react view (via angular2react or whatever) to access the correct\n// context from the react UIView\nhybridModule.directive('reactUiViewAdapter', function() {\n return {\n restrict: 'E',\n link: function(scope: IPortalScope, elem, attrs) {\n const debug = (method: string, message: string, ...args) =>\n debugLog('angularjs', 'react-ui-view-adapter', `${$id}/${attrs.name}`, method, message, ...args);\n\n const el = elem[0];\n const root = createRoot(el);\n let _ref = null;\n let destroyed = false;\n const $id = id++;\n const ignoredAttrKeys = ['$$element', '$attr'];\n attrs = filter(attrs, (val, key) => ignoredAttrKeys.indexOf(key) === -1) as any;\n\n debug('.link()', 'linking react-ui-view-adapter into ', el, attrs);\n\n // The UIView ref callback, which is called after the initial render\n // the ref value will be the component instance\n const ref = (ref: HTMLElement) => {\n // If refs are the same - don't re-render React component.\n const isSameRef = ref && _ref === ref;\n\n // If previously there was a ref, and the new `ref` is empty - the component was unmounted.\n // Leave the unmounted component as it was, and don't try to re-mount it.\n const isComponentUnmounted = !ref && _ref;\n\n if (isSameRef || isComponentUnmounted) {\n return;\n }\n\n _ref = ref;\n\n debug('.ref()', 'Received new React UIView ref', ref);\n\n // Add the $uiView data to the adapter element to provide context to child angular elements\n provideContextToAngularJSChildren();\n renderReactUIView();\n };\n\n // The render callback for the React UIView\n const render = (cmp, props: object) => {\n debug('.render()', `has ref: ${!!_ref}`);\n\n provideContextToAngularJSChildren();\n // Only create the children when the _ref is ready\n return !_ref ? null : React.createElement(cmp, props);\n };\n\n const provideContextToAngularJSChildren = () => {\n const $cfg = _ref?.uiViewData?.config;\n const $uiView = _ref?.uiViewAddress;\n\n debug('.provideContextToAngularJSChildren', '', el, $cfg, $uiView);\n\n if (!$cfg || !$uiView) {\n elem.removeData('$uiView');\n } else {\n elem.data('$uiView', { $cfg, $uiView });\n }\n };\n\n function renderReactUIView() {\n if (destroyed) {\n debug('.renderReactUIView()', `already destroyed -- will not render React UIView`);\n return;\n }\n\n const childUIViewProps = { ...attrs, render, wrap: false, refFn: ref };\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n\n if (portalView) {\n debug('.renderReactUIView()', `will createPortalToChildUIView({ name: '${childUIViewProps['name']}' })`, el);\n portalView.createPortalToChildUIView($id, { childUIViewProps, portalTarget: el });\n } else {\n debug('.renderReactUIView()', `root.render()`, el);\n root.render();\n }\n }\n\n scope.$on('$destroy', () => {\n destroyed = true;\n const portalView: PortalView = scope.$uiRouterReactHybridPortalView;\n if (portalView) {\n portalView.removePortalToChildUIView($id);\n } else {\n const unmounted = root.unmount();\n debug('.$on(\"$destroy\")', `root.unmount(): ${unmounted}`, el);\n }\n // Remove using jQLite element for cross-browser compatibility.\n elem.remove();\n });\n\n renderReactUIView();\n },\n };\n});\n" ] } \ No newline at end of file diff --git a/lib-esm/react/AngularUIView.d.ts b/lib-esm/react/AngularUIView.d.ts index 3545db87a3164571fb18c0222c824fa594b59366..6b296dbb14655d6b399cd6677b7b69dc64cc01fc 100644 --- a/lib-esm/react/AngularUIView.d.ts +++ b/lib-esm/react/AngularUIView.d.ts @@ -16,12 +16,7 @@ export declare class AngularUIView extends React.Component private $scope; constructor(props: IAngularUIViewProps); componentWillUnmount(): void; - render(): React.DOMElement<{ - class: string; - ref: (htmlRef: Element) => any; - portalView?: PortalView; - children?: React.ReactNode; - }, Element>; + render(): React.DOMElement, Element>; /** Only render once */ shouldComponentUpdate(): boolean; } diff --git a/package copy.json b/package copy.json new file mode 100644 index 0000000000000000000000000000000000000000..2dcddfd983342d867b77aa39f17d15d984e4ea8e --- /dev/null +++ b/package copy.json @@ -0,0 +1,53 @@ +{ + "name": "@uirouter/react-hybrid", + "version": "1.0.5", + "scripts": { + "clean": "shx rm -rf lib lib-esm _bundles", + "compile": "npm run clean && tsc && tsc --module es6 --outDir lib-esm", + "bundle": "rollup -c && rollup -c --environment MINIFY", + "fixmaps:lib": "tweak_sourcemap_paths -a --include 'lib/**/*.js.map' 'lib-esm/**/*.js.map'", + "fixmaps:bundle": "tweak_sourcemap_paths -a --include '_bundles/**/*.js.map'", + "build": "run-s compile bundle fixmaps:*", + "test": "npm run build", + "test:downstream": "test_downstream_projects", + "prepublishOnly": "npm run build", + "release": "release --deps @uirouter/core @uirouter/react @uirouter/angularjs", + "prepare": "husky install" + }, + "license": "MIT", + "dependencies": { + "@uirouter/angularjs": "1.0.29", + "@uirouter/core": "6.0.7", + "@uirouter/react": "1.0.7" + }, + "peerDependencies": { + "angular": "^1.5.0", + "react": ">=18.0.0" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^18.0.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "@types/angular": "^1.8.2", + "@types/jquery": "^3.5.6", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "@uirouter/publish-scripts": "^2.5.5", + "angular": "^1.8.2", + "husky": "^6.0.0", + "prettier": "^2.3.2", + "pretty-quick": "^3.1.1", + "react": "^18.0.0", + "react-dom": "^18.0.0", + "rollup": "^2.55.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "rollup-plugin-terser": "^7.0.2", + "typescript": "^3.9.7" + }, + "main": "_bundles/ui-router-react-hybrid.js", + "module": "lib-esm/index.js", + "typings": "lib/index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/ui-router/react-hybrid.git" + } +}