@teambit/react-router 1.0.282 → 1.0.283
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_ui_foundation_react_router-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dist/{preview-1716520879631.js → preview-1716607230882.js} +2 -2
- package/dist/react-router.composition.js +1 -1
- package/dist/react-router.composition.js.map +1 -1
- package/dist/react-router.ui.runtime.js +2 -2
- package/dist/react-router.ui.runtime.js.map +1 -1
- package/dist/route-context.js +1 -1
- package/dist/route-context.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.ui-foundation/react-router@1.0.
|
|
3
|
+
<testsuite name="teambit.ui-foundation/react-router@1.0.283" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.ui-foundation/react-router-preview"]=t():e["teambit.ui-foundation/react-router-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.ui-foundation/react-router-preview"]=t():e["teambit.ui-foundation/react-router-preview"]=t()}(self,(()=>(()=>{"use strict";var e={2015:(e,t,o)=>{var r={id:"teambit.ui-foundation/react-router@1.0.283",homepage:"https://bit.cloud/teambit/ui-foundation/react-router",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const a=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/react-router.svg"}));a.__bit_component=r,t.Logo=a},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{compositions:()=>d,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>s});var t=o(2015);o(41594);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var a=["components"];function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},u.apply(null,arguments)}var c={},p="wrapper";function s(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||{}.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,a);return(0,n.mdx)(p,u({},c,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}s.isMDXComponent=!0;const d=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_react-router@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_react-router@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_react-router@1.0.283/dist/react-router.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.ui-foundation_react-router@1.0.283/dist/react-router.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -11,7 +11,7 @@ function _react() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
16
16
|
style: {
|
|
17
17
|
height: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["react-router.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/react-router.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAA0D,CAAE,CACxF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -53,8 +53,8 @@ function _LocationHooks() {
|
|
|
53
53
|
};
|
|
54
54
|
return data;
|
|
55
55
|
}
|
|
56
|
-
function _interopRequireDefault(
|
|
57
|
-
function _defineProperty(
|
|
56
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
57
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
58
58
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
59
59
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
60
60
|
class ReactRouterUI {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_ui","_reactRouter","_routeContext","_routingMethod","_LocationHooks","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_ui","_reactRouter","_routeContext","_routingMethod","_LocationHooks","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ReactRouterUI","constructor","routeSlot","routeChangeListener","Routing","url","path","action","state","undefined","navigate","replace","location","listeners","values","forEach","listener","children","renderCtx","createElement","RouteContext","reactRouterUi","routing","routingMode","initialLocation","LocationHooks","onLocationChange","handleLocationChange","onNavigatorChange","nav","static","browserInit","window","pathname","search","hash","serverInit","browser","reactClientContext","RoutingContext","reactServerContext","ServerRouting","renderRoutes","routes","RootRoute","rootRoutes","setRoutingMode","register","route","registerListener","provider","deps","config","routeChangeSlot","exports","Slot","withType","UIRuntime","ReactRouterAspect","addRuntime"],"sources":["react-router.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { NavigateFunction } from 'react-router-dom';\nimport type { Location, NavigationType, RouteProps } from 'react-router-dom';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport type { SSR } from '@teambit/ui';\nimport type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\n\nimport { ReactRouterAspect } from './react-router.aspect';\nimport { RouteContext, RootRoute } from './route-context';\nimport { Routing } from './routing-method';\nimport { LocationHooks } from './LocationHooks';\n\nexport type LocationListener = (location: Location, action: NavigationType) => void;\ntype RouteChangeSlot = SlotRegistry<LocationListener>;\ntype RenderContext = { initialLocation?: string };\n\nexport class ReactRouterUI {\n private routingMode = Routing.url;\n\n constructor(\n /**\n * route slot.\n */\n private routeSlot: RouteSlot,\n /**\n *\n */\n private routeChangeListener: RouteChangeSlot\n ) {}\n\n /**\n * render all slot routes.\n */\n renderRoutes(routes: RouteProps[]) {\n return <RootRoute routeSlot={this.routeSlot} rootRoutes={routes} />;\n }\n\n /** decides how navigation is stored and applied.\n * Url - updates the `window.location.pathname`.\n * Hash - updates `window.location.hash`.\n * InMemory - store state internally and don't update the browser.\n */\n setRoutingMode(routing: Routing) {\n this.routingMode = routing;\n }\n\n /**\n * register a new route.\n */\n register(route: RouteProps) {\n this.routeSlot.register(route);\n return this;\n }\n\n registerListener(listener: LocationListener) {\n this.routeChangeListener.register(listener);\n }\n\n /**\n * change browser location\n */\n navigateTo = (\n /** destination */\n path: Location | string,\n /** history action to execute (pop / push / replace) */\n action?: NavigationType\n ) => {\n const state = typeof path !== 'string' ? path.state : undefined;\n\n switch (action) {\n case 'POP':\n return; // TBD;\n case 'REPLACE':\n this.navigate?.(path, { replace: true, state });\n return;\n case 'PUSH':\n default:\n this.navigate?.(path, { state });\n }\n };\n\n private navigate?: NavigateFunction = undefined;\n\n private handleLocationChange = (location: Location, action: NavigationType) => {\n const listeners = this.routeChangeListener.values();\n listeners.forEach((listener) => listener(location, action));\n };\n\n private RoutingContext = ({ children, renderCtx }: { children: ReactNode; renderCtx?: RenderContext }) => {\n return (\n <RouteContext reactRouterUi={this} routing={this.routingMode} location={renderCtx?.initialLocation}>\n {children}\n <LocationHooks\n onLocationChange={this.handleLocationChange}\n onNavigatorChange={(nav) => (this.navigate = nav)}\n />\n </RouteContext>\n );\n };\n\n private ServerRouting = ({ children, renderCtx }: { children: ReactNode; renderCtx?: RenderContext }) => {\n return (\n <RouteContext reactRouterUi={this} routing={Routing.static} location={renderCtx?.initialLocation}>\n {children}\n <LocationHooks\n onLocationChange={this.handleLocationChange}\n onNavigatorChange={(nav) => (this.navigate = nav)}\n />\n </RouteContext>\n );\n };\n\n public renderPlugin: SSR.RenderPlugin<RenderContext> = {\n browserInit: () => {\n const initialLocation = `${window.location.pathname}${window.location.search}${window.location.hash}`;\n return { initialLocation };\n },\n serverInit: ({ browser }) => {\n const initialLocation = browser?.location.url;\n return { initialLocation };\n },\n reactClientContext: this.RoutingContext,\n reactServerContext: this.ServerRouting,\n };\n\n static slots = [Slot.withType<RouteProps>(), Slot.withType<LocationListener>()];\n static runtime = UIRuntime;\n\n static async provider(deps, config, [routeSlot, routeChangeSlot]: [RouteSlot, RouteChangeSlot]) {\n return new ReactRouterUI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C;EACtD;AACF;AAACC,OAAA,CAAAtD,aAAA,GAAAA,aAAA;AAAAlB,eAAA,CAnHYkB,aAAa,WA6GT,CAACuD,eAAI,CAACC,QAAQ,CAAa,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAmB,CAAC,CAAC;AAAA1E,eAAA,CA7GpEkB,aAAa,aA8GPyD,eAAS;AAO5BC,gCAAiB,CAACC,UAAU,CAAC3D,aAAa,CAAC","ignoreList":[]}
|
package/dist/route-context.js
CHANGED
|
@@ -54,7 +54,7 @@ function _routingMethod() {
|
|
|
54
54
|
};
|
|
55
55
|
return data;
|
|
56
56
|
}
|
|
57
|
-
function _interopRequireDefault(
|
|
57
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
58
58
|
/**
|
|
59
59
|
* Setup context needed for routing.
|
|
60
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_reactRouterDom","_server","_uiFoundationUiReactRouter","_baseReactNavigation","_uiFoundationUiNavigation","_routingMethod","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_reactRouterDom","_server","_uiFoundationUiReactRouter","_baseReactNavigation","_uiFoundationUiNavigation","_routingMethod","e","__esModule","default","RouteContext","routing","Routing","url","children","location","createElement","Router","type","NavigationProvider","implementation","reactRouterAdapter","RootRoute","rootRoutes","routeSlot","SlotRouter","slot","static","StaticRouter","inMemory","MemoryRouter","initialEntries","initialIndex","hash","HashRouter","BrowserRouter"],"sources":["route-context.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { BrowserRouter, MemoryRouter, HashRouter, RouteProps } from 'react-router-dom';\nimport { StaticRouter } from 'react-router-dom/server';\nimport { SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NavigationProvider } from '@teambit/base-react.navigation.link';\nimport { reactRouterAdapter } from '@teambit/ui-foundation.ui.navigation.react-router-adapter';\nimport { ReactRouterUI } from './react-router.ui.runtime';\nimport { Routing } from './routing-method';\n\ntype RouterContextProps = {\n reactRouterUi: ReactRouterUI;\n routing?: Routing;\n children: ReactNode;\n location?: string;\n};\n\ntype RootRouteProps = {\n rootRoutes: RouteProps[];\n routeSlot: RouteSlot;\n};\n\n/**\n * Setup context needed for routing.\n */\nexport function RouteContext({ routing = Routing.url, children, location }: RouterContextProps) {\n return (\n <Router type={routing} location={location}>\n <NavigationProvider implementation={reactRouterAdapter}>{children}</NavigationProvider>\n </Router>\n );\n}\n\nexport function RootRoute({ rootRoutes, routeSlot }: RootRouteProps) {\n return <SlotRouter slot={routeSlot} rootRoutes={rootRoutes} />;\n}\n\n/** provides the router engine (browser, inMemory, etc) */\nfunction Router({ type, children, location }: { type: Routing; children: ReactNode; location?: string }) {\n switch (type) {\n case Routing.static:\n return <StaticRouter location={location || '/'}>{children}</StaticRouter>;\n case Routing.inMemory:\n return (\n <MemoryRouter initialEntries={[location || '/']} initialIndex={1}>\n {children}\n </MemoryRouter>\n );\n case Routing.hash:\n // @ts-ignore - https://github.com/teambit/bit/issues/5746\n return <HashRouter>{children}</HashRouter>;\n case Routing.url:\n default:\n // @ts-ignore - https://github.com/teambit/bit/issues/5746\n return <BrowserRouter>{children}</BrowserRouter>;\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,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,MAAMA,CAAC;EAAEC,IAAI;EAAEJ,QAAQ;EAAEC;AAAoE,CAAC,EAAE;EACvG,QAAQG,IAAI;IACV,KAAKN,wBAAO,CAACe,MAAM;MACjB,oBAAO9B,MAAA,GAAAY,OAAA,CAAAO,aAAA,CAACd,OAAA,GAAA0B,YAAY;QAACb,QAAQ,EAAEA,QAAQ,IAAI;MAAI,GAAED,QAAuB,CAAC;IAC3E,KAAKF,wBAAO,CAACiB,QAAQ;MACnB,oBACEhC,MAAA,GAAAY,OAAA,CAAAO,aAAA,CAACf,eAAA,GAAA6B,YAAY;QAACC,cAAc,EAAE,CAAChB,QAAQ,IAAI,GAAG,CAAE;QAACiB,YAAY,EAAE;MAAE,GAC9DlB,QACW,CAAC;IAEnB,KAAKF,wBAAO,CAACqB,IAAI;MACf;MACA,oBAAOpC,MAAA,GAAAY,OAAA,CAAAO,aAAA,CAACf,eAAA,GAAAiC,UAAU,QAAEpB,QAAqB,CAAC;IAC5C,KAAKF,wBAAO,CAACC,GAAG;IAChB;MACE;MACA,oBAAOhB,MAAA,GAAAY,OAAA,CAAAO,aAAA,CAACf,eAAA,GAAAkC,aAAa,QAAErB,QAAwB,CAAC;EACpD;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react-router",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.283",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/ui-foundation/react-router",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "react-router",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.283"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.4.6",
|
|
13
13
|
"@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.1",
|
|
14
14
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.509",
|
|
15
|
-
"@teambit/ui": "1.0.
|
|
15
|
+
"@teambit/ui": "1.0.283"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/mocha": "9.1.0",
|