piral-core 1.0.0-pre.2296 → 1.0.1-beta.5640
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/LICENSE +1 -1
- package/README.md +12 -4
- package/app.codegen +36 -0
- package/app.codegen.d.ts +29 -0
- package/dist/codegen.js +5308 -0
- package/esm/Piral.d.ts +4 -4
- package/esm/Piral.js +8 -11
- package/esm/Piral.js.map +1 -1
- package/esm/PiralContext.d.ts +21 -0
- package/esm/PiralContext.js +34 -0
- package/esm/PiralContext.js.map +1 -0
- package/esm/RootListener.d.ts +2 -0
- package/esm/RootListener.js +23 -0
- package/esm/RootListener.js.map +1 -0
- package/esm/actions/app.d.ts +7 -4
- package/esm/actions/app.js +24 -14
- package/esm/actions/app.js.map +1 -1
- package/esm/actions/components.js +5 -6
- package/esm/actions/components.js.map +1 -1
- package/esm/actions/data.js +16 -17
- package/esm/actions/data.js.map +1 -1
- package/esm/actions/define.js +2 -3
- package/esm/actions/define.js.map +1 -1
- package/esm/actions/portal.d.ts +2 -0
- package/esm/actions/portal.js +9 -4
- package/esm/actions/portal.js.map +1 -1
- package/esm/actions/state.js +7 -4
- package/esm/actions/state.js.map +1 -1
- package/esm/components/ErrorBoundary.d.ts +14 -31
- package/esm/components/ErrorBoundary.js +22 -28
- package/esm/components/ErrorBoundary.js.map +1 -1
- package/esm/components/ExtensionSlot.d.ts +1 -0
- package/esm/components/ExtensionSlot.js +34 -11
- package/esm/components/ExtensionSlot.js.map +1 -1
- package/esm/components/ForeignComponentContainer.d.ts +19 -0
- package/esm/components/ForeignComponentContainer.js +46 -0
- package/esm/components/ForeignComponentContainer.js.map +1 -0
- package/esm/components/Mediator.js +15 -12
- package/esm/components/Mediator.js.map +1 -1
- package/esm/components/PiralGlobals.d.ts +6 -0
- package/esm/components/PiralGlobals.js +13 -0
- package/esm/components/PiralGlobals.js.map +1 -0
- package/esm/components/PiralRoutes.d.ts +5 -0
- package/esm/components/PiralRoutes.js +6 -11
- package/esm/components/PiralRoutes.js.map +1 -1
- package/esm/components/PiralSuspense.d.ts +5 -0
- package/esm/components/PiralSuspense.js +8 -0
- package/esm/components/PiralSuspense.js.map +1 -0
- package/esm/components/PiralView.d.ts +10 -1
- package/esm/components/PiralView.js +12 -25
- package/esm/components/PiralView.js.map +1 -1
- package/esm/components/PortalRenderer.d.ts +5 -0
- package/esm/components/PortalRenderer.js +7 -0
- package/esm/components/PortalRenderer.js.map +1 -0
- package/esm/components/ResponsiveLayout.d.ts +9 -1
- package/esm/components/ResponsiveLayout.js +5 -13
- package/esm/components/ResponsiveLayout.js.map +1 -1
- package/esm/components/SwitchErrorInfo.js +12 -10
- package/esm/components/SwitchErrorInfo.js.map +1 -1
- package/esm/components/components.d.ts +18 -6
- package/esm/components/components.js +21 -9
- package/esm/components/components.js.map +1 -1
- package/esm/components/index.d.ts +4 -10
- package/esm/components/index.js +4 -10
- package/esm/components/index.js.map +1 -1
- package/esm/components/wrapComponent.d.ts +7 -0
- package/esm/components/wrapComponent.js +42 -0
- package/esm/components/wrapComponent.js.map +1 -0
- package/esm/createInstance.d.ts +2 -2
- package/esm/createInstance.js +34 -30
- package/esm/createInstance.js.map +1 -1
- package/esm/defaults/DefaultErrorInfo.js +10 -0
- package/esm/defaults/DefaultErrorInfo.js.map +1 -0
- package/esm/{components → defaults}/DefaultLayout.js +1 -4
- package/esm/defaults/DefaultLayout.js.map +1 -0
- package/esm/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +2 -2
- package/esm/defaults/DefaultLoadingIndicator.js.map +1 -0
- package/esm/defaults/DefaultRouteSwitch_v5.d.ts +3 -0
- package/esm/defaults/DefaultRouteSwitch_v5.js +11 -0
- package/esm/defaults/DefaultRouteSwitch_v5.js.map +1 -0
- package/esm/defaults/DefaultRouteSwitch_v6.d.ts +3 -0
- package/esm/defaults/DefaultRouteSwitch_v6.js +15 -0
- package/esm/defaults/DefaultRouteSwitch_v6.js.map +1 -0
- package/esm/defaults/DefaultRouter_v5.d.ts +3 -0
- package/esm/defaults/DefaultRouter_v5.js +7 -0
- package/esm/defaults/DefaultRouter_v5.js.map +1 -0
- package/esm/defaults/DefaultRouter_v6.d.ts +3 -0
- package/esm/defaults/DefaultRouter_v6.js +7 -0
- package/esm/defaults/DefaultRouter_v6.js.map +1 -0
- package/esm/defaults/navigator_none.d.ts +5 -0
- package/esm/defaults/navigator_none.js +30 -0
- package/esm/defaults/navigator_none.js.map +1 -0
- package/esm/defaults/navigator_v5.d.ts +6 -0
- package/esm/defaults/navigator_v5.js +81 -0
- package/esm/defaults/navigator_v5.js.map +1 -0
- package/esm/defaults/navigator_v6.d.ts +6 -0
- package/esm/defaults/navigator_v6.js +77 -0
- package/esm/defaults/navigator_v6.js.map +1 -0
- package/esm/helpers.d.ts +12 -26
- package/esm/helpers.js +14 -72
- package/esm/helpers.js.map +1 -1
- package/esm/hooks/action.js +2 -3
- package/esm/hooks/action.js.map +1 -1
- package/esm/hooks/actions.js +1 -1
- package/esm/hooks/actions.js.map +1 -1
- package/esm/hooks/globalState.d.ts +7 -0
- package/esm/hooks/globalState.js +10 -8
- package/esm/hooks/globalState.js.map +1 -1
- package/esm/hooks/index.d.ts +2 -5
- package/esm/hooks/index.js +2 -5
- package/esm/hooks/index.js.map +1 -1
- package/esm/hooks/media.js +8 -7
- package/esm/hooks/media.js.map +1 -1
- package/esm/hooks/piletApi.d.ts +7 -0
- package/esm/hooks/piletApi.js +14 -0
- package/esm/hooks/piletApi.js.map +1 -0
- package/esm/hooks/routes.d.ts +2 -0
- package/esm/hooks/routes.js +11 -0
- package/esm/hooks/routes.js.map +1 -0
- package/esm/hooks/setter.js +3 -2
- package/esm/hooks/setter.js.map +1 -1
- package/esm/hooks/sharedData.js +2 -2
- package/esm/hooks/sharedData.js.map +1 -1
- package/esm/index.d.ts +3 -1
- package/esm/index.js +3 -1
- package/esm/index.js.map +1 -1
- package/esm/modules/api.d.ts +2 -5
- package/esm/modules/api.js +9 -69
- package/esm/modules/api.js.map +1 -1
- package/esm/modules/core.d.ts +3 -0
- package/esm/modules/core.js +50 -0
- package/esm/modules/core.js.map +1 -0
- package/esm/modules/dependencies.d.ts +5 -6
- package/esm/modules/dependencies.js +9 -24
- package/esm/modules/dependencies.js.map +1 -1
- package/esm/modules/element.d.ts +5 -0
- package/esm/modules/element.js +169 -0
- package/esm/modules/element.js.map +1 -0
- package/esm/modules/index.d.ts +1 -0
- package/esm/modules/index.js +1 -0
- package/esm/modules/index.js.map +1 -1
- package/esm/setters/SetComponent.js +11 -0
- package/esm/setters/SetComponent.js.map +1 -0
- package/esm/setters/SetError.js +11 -0
- package/esm/setters/SetError.js.map +1 -0
- package/esm/setters/SetErrors.js +9 -0
- package/esm/setters/SetErrors.js.map +1 -0
- package/esm/setters/SetLayout.js +9 -0
- package/esm/setters/SetLayout.js.map +1 -0
- package/esm/setters/SetProvider.js +11 -0
- package/esm/setters/SetProvider.js.map +1 -0
- package/esm/setters/SetRedirect.js +12 -0
- package/esm/setters/SetRedirect.js.map +1 -0
- package/{lib/components → esm/setters}/SetRoute.d.ts +6 -2
- package/esm/setters/SetRoute.js +11 -0
- package/esm/setters/SetRoute.js.map +1 -0
- package/esm/setters/index.d.ts +7 -0
- package/esm/setters/index.js +8 -0
- package/esm/setters/index.js.map +1 -0
- package/esm/state/createActions.d.ts +2 -2
- package/esm/state/createActions.js +8 -12
- package/esm/state/createActions.js.map +1 -1
- package/esm/state/createGlobalState.d.ts +1 -2
- package/esm/state/createGlobalState.js +9 -34
- package/esm/state/createGlobalState.js.map +1 -1
- package/esm/state/stateContext.js +1 -1
- package/esm/state/stateContext.js.map +1 -1
- package/esm/state/withApi.d.ts +1 -1
- package/esm/state/withApi.js +19 -104
- package/esm/state/withApi.js.map +1 -1
- package/esm/tools/codegen.d.ts +21 -0
- package/esm/tools/codegen.js +145 -0
- package/esm/tools/codegen.js.map +1 -0
- package/esm/tools/debugger.d.ts +4 -0
- package/esm/tools/debugger.js +54 -0
- package/esm/tools/debugger.js.map +1 -0
- package/esm/tools/emulator.d.ts +3 -0
- package/esm/tools/emulator.js +11 -0
- package/esm/tools/emulator.js.map +1 -0
- package/esm/types/api.d.ts +34 -9
- package/esm/types/common.d.ts +11 -11
- package/esm/types/components.d.ts +74 -8
- package/esm/types/config.d.ts +24 -17
- package/esm/types/data.d.ts +2 -2
- package/esm/types/extension.d.ts +31 -4
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/index.js.map +1 -1
- package/esm/types/instance.d.ts +26 -4
- package/esm/types/layout.d.ts +3 -3
- package/esm/types/navigation.d.ts +94 -0
- package/esm/types/navigation.js +2 -0
- package/esm/types/navigation.js.map +1 -0
- package/esm/types/plugin.d.ts +1 -14
- package/esm/types/state.d.ts +66 -27
- package/esm/types/utils.d.ts +1 -1
- package/esm/utils/compare.d.ts +1 -1
- package/esm/utils/compare.js +24 -7
- package/esm/utils/compare.js.map +1 -1
- package/esm/utils/data.js +6 -7
- package/esm/utils/data.js.map +1 -1
- package/esm/utils/extension.d.ts +16 -0
- package/esm/utils/extension.js +37 -0
- package/esm/utils/extension.js.map +1 -0
- package/esm/utils/foreign.d.ts +7 -2
- package/esm/utils/foreign.js +20 -9
- package/esm/utils/foreign.js.map +1 -1
- package/esm/utils/guid.js +3 -3
- package/esm/utils/guid.js.map +1 -1
- package/esm/utils/helpers.d.ts +11 -8
- package/esm/utils/helpers.js +29 -18
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +3 -1
- package/esm/utils/index.js +3 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/media.js +8 -8
- package/esm/utils/media.js.map +1 -1
- package/esm/utils/state.d.ts +57 -0
- package/esm/utils/state.js +83 -0
- package/esm/utils/state.js.map +1 -0
- package/esm/utils/storage.js +13 -14
- package/esm/utils/storage.js.map +1 -1
- package/lib/Piral.d.ts +4 -4
- package/lib/Piral.js +11 -13
- package/lib/Piral.js.map +1 -1
- package/lib/PiralContext.d.ts +21 -0
- package/lib/PiralContext.js +38 -0
- package/lib/PiralContext.js.map +1 -0
- package/lib/RootListener.d.ts +2 -0
- package/lib/RootListener.js +27 -0
- package/lib/RootListener.js.map +1 -0
- package/lib/actions/app.d.ts +7 -4
- package/lib/actions/app.js +27 -16
- package/lib/actions/app.js.map +1 -1
- package/lib/actions/components.js +5 -6
- package/lib/actions/components.js.map +1 -1
- package/lib/actions/data.js +17 -18
- package/lib/actions/data.js.map +1 -1
- package/lib/actions/define.js +2 -3
- package/lib/actions/define.js.map +1 -1
- package/lib/actions/index.js +1 -1
- package/lib/actions/portal.d.ts +2 -0
- package/lib/actions/portal.js +12 -5
- package/lib/actions/portal.js.map +1 -1
- package/lib/actions/state.js +7 -4
- package/lib/actions/state.js.map +1 -1
- package/lib/components/ErrorBoundary.d.ts +14 -31
- package/lib/components/ErrorBoundary.js +23 -28
- package/lib/components/ErrorBoundary.js.map +1 -1
- package/lib/components/ExtensionSlot.d.ts +1 -0
- package/lib/components/ExtensionSlot.js +37 -14
- package/lib/components/ExtensionSlot.js.map +1 -1
- package/lib/components/ForeignComponentContainer.d.ts +19 -0
- package/lib/components/ForeignComponentContainer.js +50 -0
- package/lib/components/ForeignComponentContainer.js.map +1 -0
- package/lib/components/Mediator.js +18 -14
- package/lib/components/Mediator.js.map +1 -1
- package/lib/components/PiralGlobals.d.ts +6 -0
- package/lib/components/PiralGlobals.js +17 -0
- package/lib/components/PiralGlobals.js.map +1 -0
- package/lib/components/PiralRoutes.d.ts +5 -0
- package/lib/components/PiralRoutes.js +8 -12
- package/lib/components/PiralRoutes.js.map +1 -1
- package/lib/components/PiralSuspense.d.ts +5 -0
- package/lib/components/PiralSuspense.js +12 -0
- package/lib/components/PiralSuspense.js.map +1 -0
- package/lib/components/PiralView.d.ts +10 -1
- package/lib/components/PiralView.js +15 -27
- package/lib/components/PiralView.js.map +1 -1
- package/lib/components/PortalRenderer.d.ts +5 -0
- package/lib/components/PortalRenderer.js +11 -0
- package/lib/components/PortalRenderer.js.map +1 -0
- package/lib/components/ResponsiveLayout.d.ts +9 -1
- package/lib/components/ResponsiveLayout.js +7 -14
- package/lib/components/ResponsiveLayout.js.map +1 -1
- package/lib/components/SwitchErrorInfo.js +15 -12
- package/lib/components/SwitchErrorInfo.js.map +1 -1
- package/lib/components/components.d.ts +18 -6
- package/lib/components/components.js +24 -12
- package/lib/components/components.js.map +1 -1
- package/lib/components/index.d.ts +4 -10
- package/lib/components/index.js +5 -11
- package/lib/components/index.js.map +1 -1
- package/lib/components/wrapComponent.d.ts +7 -0
- package/lib/components/wrapComponent.js +46 -0
- package/lib/components/wrapComponent.js.map +1 -0
- package/lib/createInstance.d.ts +2 -2
- package/lib/createInstance.js +40 -36
- package/lib/createInstance.js.map +1 -1
- package/lib/defaults/DefaultErrorInfo.js +14 -0
- package/lib/defaults/DefaultErrorInfo.js.map +1 -0
- package/lib/{components → defaults}/DefaultLayout.js +3 -5
- package/lib/defaults/DefaultLayout.js.map +1 -0
- package/lib/{components/DefaultLoader.js → defaults/DefaultLoadingIndicator.js} +4 -3
- package/lib/defaults/DefaultLoadingIndicator.js.map +1 -0
- package/lib/defaults/DefaultRouteSwitch_v5.d.ts +3 -0
- package/lib/defaults/DefaultRouteSwitch_v5.js +15 -0
- package/lib/defaults/DefaultRouteSwitch_v5.js.map +1 -0
- package/lib/defaults/DefaultRouteSwitch_v6.d.ts +3 -0
- package/lib/defaults/DefaultRouteSwitch_v6.js +19 -0
- package/lib/defaults/DefaultRouteSwitch_v6.js.map +1 -0
- package/lib/defaults/DefaultRouter_v5.d.ts +3 -0
- package/lib/defaults/DefaultRouter_v5.js +11 -0
- package/lib/defaults/DefaultRouter_v5.js.map +1 -0
- package/lib/defaults/DefaultRouter_v6.d.ts +3 -0
- package/lib/defaults/DefaultRouter_v6.js +11 -0
- package/lib/defaults/DefaultRouter_v6.js.map +1 -0
- package/lib/defaults/navigator_none.d.ts +5 -0
- package/lib/defaults/navigator_none.js +37 -0
- package/lib/defaults/navigator_none.js.map +1 -0
- package/lib/defaults/navigator_v5.d.ts +6 -0
- package/lib/defaults/navigator_v5.js +88 -0
- package/lib/defaults/navigator_v5.js.map +1 -0
- package/lib/defaults/navigator_v6.d.ts +6 -0
- package/lib/defaults/navigator_v6.js +84 -0
- package/lib/defaults/navigator_v6.js.map +1 -0
- package/lib/helpers.d.ts +12 -26
- package/lib/helpers.js +15 -75
- package/lib/helpers.js.map +1 -1
- package/lib/hooks/action.js +2 -3
- package/lib/hooks/action.js.map +1 -1
- package/lib/hooks/actions.js +4 -4
- package/lib/hooks/actions.js.map +1 -1
- package/lib/hooks/globalState.d.ts +7 -0
- package/lib/hooks/globalState.js +14 -11
- package/lib/hooks/globalState.js.map +1 -1
- package/lib/hooks/index.d.ts +2 -5
- package/lib/hooks/index.js +3 -6
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/media.js +10 -9
- package/lib/hooks/media.js.map +1 -1
- package/lib/hooks/piletApi.d.ts +7 -0
- package/lib/hooks/piletApi.js +18 -0
- package/lib/hooks/piletApi.js.map +1 -0
- package/lib/hooks/routes.d.ts +2 -0
- package/lib/hooks/routes.js +15 -0
- package/lib/hooks/routes.js.map +1 -0
- package/lib/hooks/setter.js +4 -3
- package/lib/hooks/setter.js.map +1 -1
- package/lib/hooks/sharedData.js +3 -3
- package/lib/hooks/sharedData.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/modules/api.d.ts +2 -5
- package/lib/modules/api.js +12 -75
- package/lib/modules/api.js.map +1 -1
- package/lib/modules/core.d.ts +3 -0
- package/lib/modules/core.js +54 -0
- package/lib/modules/core.js.map +1 -0
- package/lib/modules/dependencies.d.ts +5 -6
- package/lib/modules/dependencies.js +12 -27
- package/lib/modules/dependencies.js.map +1 -1
- package/lib/modules/element.d.ts +5 -0
- package/lib/modules/element.js +173 -0
- package/lib/modules/element.js.map +1 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -1
- package/lib/modules/index.js.map +1 -1
- package/lib/setters/SetComponent.js +15 -0
- package/lib/setters/SetComponent.js.map +1 -0
- package/lib/setters/SetError.js +15 -0
- package/lib/setters/SetError.js.map +1 -0
- package/lib/setters/SetErrors.js +13 -0
- package/lib/setters/SetErrors.js.map +1 -0
- package/lib/setters/SetLayout.js +13 -0
- package/lib/setters/SetLayout.js.map +1 -0
- package/lib/{components → setters}/SetProvider.js +4 -5
- package/lib/setters/SetProvider.js.map +1 -0
- package/lib/setters/SetRedirect.js +16 -0
- package/lib/setters/SetRedirect.js.map +1 -0
- package/{esm/components → lib/setters}/SetRoute.d.ts +6 -2
- package/lib/setters/SetRoute.js +15 -0
- package/lib/setters/SetRoute.js.map +1 -0
- package/lib/setters/index.d.ts +7 -0
- package/lib/setters/index.js +11 -0
- package/lib/setters/index.js.map +1 -0
- package/lib/state/createActions.d.ts +2 -2
- package/lib/state/createActions.js +9 -13
- package/lib/state/createActions.js.map +1 -1
- package/lib/state/createGlobalState.d.ts +1 -2
- package/lib/state/createGlobalState.js +9 -34
- package/lib/state/createGlobalState.js.map +1 -1
- package/lib/state/index.js +1 -1
- package/lib/state/stateContext.js +1 -1
- package/lib/state/stateContext.js.map +1 -1
- package/lib/state/withApi.d.ts +1 -1
- package/lib/state/withApi.js +20 -105
- package/lib/state/withApi.js.map +1 -1
- package/lib/tools/codegen.d.ts +21 -0
- package/lib/tools/codegen.js +152 -0
- package/lib/tools/codegen.js.map +1 -0
- package/lib/tools/debugger.d.ts +4 -0
- package/lib/tools/debugger.js +58 -0
- package/lib/tools/debugger.js.map +1 -0
- package/lib/tools/emulator.d.ts +3 -0
- package/lib/tools/emulator.js +15 -0
- package/lib/tools/emulator.js.map +1 -0
- package/lib/types/api.d.ts +34 -9
- package/lib/types/common.d.ts +11 -11
- package/lib/types/components.d.ts +74 -8
- package/lib/types/config.d.ts +24 -17
- package/lib/types/data.d.ts +2 -2
- package/lib/types/extension.d.ts +31 -4
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/instance.d.ts +26 -4
- package/lib/types/layout.d.ts +3 -3
- package/lib/types/navigation.d.ts +94 -0
- package/lib/types/navigation.js +3 -0
- package/lib/types/navigation.js.map +1 -0
- package/lib/types/plugin.d.ts +1 -14
- package/lib/types/state.d.ts +66 -27
- package/lib/types/utils.d.ts +1 -1
- package/lib/utils/compare.d.ts +1 -1
- package/lib/utils/compare.js +26 -9
- package/lib/utils/compare.js.map +1 -1
- package/lib/utils/data.js +6 -7
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/extension.d.ts +16 -0
- package/lib/utils/extension.js +42 -0
- package/lib/utils/extension.js.map +1 -0
- package/lib/utils/foreign.d.ts +7 -2
- package/lib/utils/foreign.js +25 -12
- package/lib/utils/foreign.js.map +1 -1
- package/lib/utils/guid.js +3 -3
- package/lib/utils/guid.js.map +1 -1
- package/lib/utils/helpers.d.ts +11 -8
- package/lib/utils/helpers.js +31 -18
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +7 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/media.js +7 -7
- package/lib/utils/media.js.map +1 -1
- package/lib/utils/react.js +1 -1
- package/lib/utils/react.js.map +1 -1
- package/lib/utils/state.d.ts +57 -0
- package/lib/utils/state.js +94 -0
- package/lib/utils/state.js.map +1 -0
- package/lib/utils/storage.js +11 -12
- package/lib/utils/storage.js.map +1 -1
- package/package.json +51 -20
- package/src/Piral.test.tsx +7 -16
- package/src/Piral.tsx +12 -11
- package/src/PiralContext.tsx +43 -0
- package/src/RootListener.test.tsx +46 -0
- package/src/RootListener.tsx +26 -0
- package/src/actions/app.test.ts +114 -44
- package/src/actions/app.ts +33 -23
- package/src/actions/components.test.ts +11 -11
- package/src/actions/components.ts +5 -33
- package/src/actions/data.test.ts +50 -50
- package/src/actions/define.test.ts +2 -2
- package/src/actions/portal.test.ts +62 -17
- package/src/actions/portal.ts +19 -1
- package/src/actions/state.test.ts +3 -3
- package/src/actions/state.ts +8 -4
- package/src/components/ErrorBoundary.tsx +22 -49
- package/src/components/ExtensionSlot.test.tsx +115 -30
- package/src/components/ExtensionSlot.tsx +57 -18
- package/src/components/ForeignComponentContainer.test.tsx +100 -0
- package/src/components/ForeignComponentContainer.tsx +63 -0
- package/src/components/Mediator.test.tsx +16 -14
- package/src/components/Mediator.tsx +17 -9
- package/src/components/PiralGlobals.tsx +16 -0
- package/src/components/PiralRoutes.test.tsx +65 -57
- package/src/components/PiralRoutes.tsx +10 -17
- package/src/components/PiralSuspense.tsx +19 -0
- package/src/components/PiralView-server.test.tsx +61 -0
- package/src/components/PiralView.test.tsx +27 -26
- package/src/components/PiralView.tsx +28 -35
- package/src/components/PortalRenderer.tsx +12 -0
- package/src/components/ResponsiveLayout.test.tsx +18 -37
- package/src/components/ResponsiveLayout.tsx +18 -15
- package/src/components/SwitchErrorInfo.test.tsx +36 -0
- package/src/components/SwitchErrorInfo.tsx +5 -1
- package/src/components/components.tsx +20 -6
- package/src/components/index.ts +4 -10
- package/src/components/wrapComponent.tsx +74 -0
- package/src/createInstance.test.tsx +10 -0
- package/src/createInstance.tsx +19 -14
- package/src/{components → defaults}/DefaultErrorInfo.test.tsx +15 -18
- package/src/{components → defaults}/DefaultErrorInfo.tsx +2 -3
- package/src/defaults/DefaultLayout.test.tsx +23 -0
- package/src/defaults/DefaultLoadingIndicator.test.tsx +10 -0
- package/src/defaults/DefaultRouteSwitch_v5.tsx +15 -0
- package/src/defaults/DefaultRouteSwitch_v6.tsx +20 -0
- package/src/defaults/DefaultRouter_v5.tsx +8 -0
- package/src/defaults/DefaultRouter_v6.tsx +8 -0
- package/src/defaults/navigator_none.tsx +35 -0
- package/src/defaults/navigator_v5.tsx +99 -0
- package/src/defaults/navigator_v6.tsx +96 -0
- package/src/helpers.test.tsx +30 -49
- package/src/helpers.tsx +31 -108
- package/src/hooks/action.ts +2 -3
- package/src/hooks/globalState.ts +10 -9
- package/src/hooks/index.ts +2 -5
- package/src/hooks/media.ts +2 -1
- package/src/hooks/piletApi.ts +14 -0
- package/src/hooks/routes.ts +14 -0
- package/src/hooks/setter-server.test.ts +22 -0
- package/src/hooks/setter.test.ts +18 -0
- package/src/hooks/setter.ts +2 -1
- package/src/index.tsx +3 -1
- package/src/modules/api.test.ts +15 -26
- package/src/modules/api.ts +3 -66
- package/src/modules/core.test.ts +148 -0
- package/src/modules/core.ts +52 -0
- package/src/modules/dependencies.test.ts +16 -5
- package/src/modules/dependencies.ts +13 -31
- package/src/modules/element-server.test.ts +29 -0
- package/src/modules/element.test.ts +67 -0
- package/src/modules/element.ts +212 -0
- package/src/modules/index.ts +1 -0
- package/src/{components → setters}/SetComponent.test.tsx +9 -8
- package/src/{components → setters}/SetComponent.tsx +2 -2
- package/src/{components → setters}/SetError.test.tsx +9 -8
- package/src/{components → setters}/SetError.tsx +2 -2
- package/src/{components → setters}/SetErrors.test.tsx +9 -8
- package/src/{components → setters}/SetLayout.test.tsx +9 -8
- package/src/{components → setters}/SetProvider.test.tsx +9 -8
- package/src/{components → setters}/SetProvider.tsx +2 -2
- package/src/{components → setters}/SetRedirect.test.tsx +9 -8
- package/src/{components → setters}/SetRedirect.tsx +4 -4
- package/src/{components → setters}/SetRoute.test.tsx +9 -8
- package/src/{components → setters}/SetRoute.tsx +7 -4
- package/src/setters/index.ts +7 -0
- package/src/state/createActions.test.ts +2 -2
- package/src/state/createActions.ts +5 -3
- package/src/state/createGlobalState.test.ts +55 -54
- package/src/state/createGlobalState.ts +4 -28
- package/src/state/withApi.test.tsx +87 -40
- package/src/state/withApi.tsx +31 -165
- package/src/tools/codegen.ts +193 -0
- package/src/tools/debugger.ts +84 -0
- package/src/tools/emulator.ts +13 -0
- package/src/types/api.ts +47 -10
- package/src/types/components.ts +76 -7
- package/src/types/config.ts +23 -17
- package/src/types/extension.ts +38 -5
- package/src/types/index.ts +1 -0
- package/src/types/instance.ts +28 -4
- package/src/types/navigation.ts +101 -0
- package/src/types/plugin.ts +1 -15
- package/src/types/state.ts +65 -25
- package/src/types/utils.ts +1 -1
- package/src/utils/compare.test.ts +15 -15
- package/src/utils/compare.ts +23 -3
- package/src/utils/extension.test.tsx +21 -0
- package/src/utils/extension.tsx +48 -0
- package/src/utils/foreign.test.ts +29 -11
- package/src/utils/foreign.ts +34 -7
- package/src/utils/guid.test.ts +6 -1
- package/src/utils/helpers.test.ts +52 -0
- package/src/utils/helpers.ts +22 -8
- package/src/utils/index.ts +4 -1
- package/src/utils/media-server.test.ts +13 -0
- package/src/utils/media.ts +2 -2
- package/src/utils/state.test.ts +37 -0
- package/src/utils/state.ts +131 -0
- package/dependencies.codegen +0 -9
- package/dependencies.codegen.native.js +0 -2
- package/esm/components/DefaultErrorInfo.js +0 -12
- package/esm/components/DefaultErrorInfo.js.map +0 -1
- package/esm/components/DefaultLayout.js.map +0 -1
- package/esm/components/DefaultLoader.js.map +0 -1
- package/esm/components/SetComponent.js +0 -12
- package/esm/components/SetComponent.js.map +0 -1
- package/esm/components/SetError.js +0 -12
- package/esm/components/SetError.js.map +0 -1
- package/esm/components/SetErrors.js +0 -10
- package/esm/components/SetErrors.js.map +0 -1
- package/esm/components/SetLayout.js +0 -10
- package/esm/components/SetLayout.js.map +0 -1
- package/esm/components/SetProvider.js +0 -12
- package/esm/components/SetProvider.js.map +0 -1
- package/esm/components/SetRedirect.js +0 -14
- package/esm/components/SetRedirect.js.map +0 -1
- package/esm/components/SetRoute.js +0 -12
- package/esm/components/SetRoute.js.map +0 -1
- package/esm/hooks/debounce.d.ts +0 -8
- package/esm/hooks/debounce.js +0 -18
- package/esm/hooks/debounce.js.map +0 -1
- package/esm/hooks/lockBodyScroll.d.ts +0 -6
- package/esm/hooks/lockBodyScroll.js +0 -13
- package/esm/hooks/lockBodyScroll.js.map +0 -1
- package/esm/hooks/onClickOutside.d.ts +0 -8
- package/esm/hooks/onClickOutside.js +0 -23
- package/esm/hooks/onClickOutside.js.map +0 -1
- package/esm/hooks/onScreenVisible.d.ts +0 -11
- package/esm/hooks/onScreenVisible.js +0 -28
- package/esm/hooks/onScreenVisible.js.map +0 -1
- package/esm/hooks/promise.d.ts +0 -13
- package/esm/hooks/promise.js +0 -21
- package/esm/hooks/promise.js.map +0 -1
- package/esm/utils/events.d.ts +0 -3
- package/esm/utils/events.js +0 -35
- package/esm/utils/events.js.map +0 -1
- package/lib/components/DefaultErrorInfo.js +0 -15
- package/lib/components/DefaultErrorInfo.js.map +0 -1
- package/lib/components/DefaultLayout.js.map +0 -1
- package/lib/components/DefaultLoader.js.map +0 -1
- package/lib/components/SetComponent.js +0 -16
- package/lib/components/SetComponent.js.map +0 -1
- package/lib/components/SetError.js +0 -16
- package/lib/components/SetError.js.map +0 -1
- package/lib/components/SetErrors.js +0 -14
- package/lib/components/SetErrors.js.map +0 -1
- package/lib/components/SetLayout.js +0 -14
- package/lib/components/SetLayout.js.map +0 -1
- package/lib/components/SetProvider.js.map +0 -1
- package/lib/components/SetRedirect.js +0 -18
- package/lib/components/SetRedirect.js.map +0 -1
- package/lib/components/SetRoute.js +0 -16
- package/lib/components/SetRoute.js.map +0 -1
- package/lib/hooks/debounce.d.ts +0 -8
- package/lib/hooks/debounce.js +0 -22
- package/lib/hooks/debounce.js.map +0 -1
- package/lib/hooks/lockBodyScroll.d.ts +0 -6
- package/lib/hooks/lockBodyScroll.js +0 -17
- package/lib/hooks/lockBodyScroll.js.map +0 -1
- package/lib/hooks/onClickOutside.d.ts +0 -8
- package/lib/hooks/onClickOutside.js +0 -27
- package/lib/hooks/onClickOutside.js.map +0 -1
- package/lib/hooks/onScreenVisible.d.ts +0 -11
- package/lib/hooks/onScreenVisible.js +0 -32
- package/lib/hooks/onScreenVisible.js.map +0 -1
- package/lib/hooks/promise.d.ts +0 -13
- package/lib/hooks/promise.js +0 -25
- package/lib/hooks/promise.js.map +0 -1
- package/lib/utils/events.d.ts +0 -3
- package/lib/utils/events.js +0 -39
- package/lib/utils/events.js.map +0 -1
- package/src/components/DefaultLayout.test.tsx +0 -23
- package/src/components/DefaultLoader.test.tsx +0 -10
- package/src/hooks/debounce.test.ts +0 -67
- package/src/hooks/debounce.ts +0 -19
- package/src/hooks/globalState.test.ts +0 -47
- package/src/hooks/lockBodyScroll.test.ts +0 -24
- package/src/hooks/lockBodyScroll.ts +0 -13
- package/src/hooks/onClickOutside.test.ts +0 -113
- package/src/hooks/onClickOutside.ts +0 -25
- package/src/hooks/onScreenVisible.test.ts +0 -68
- package/src/hooks/onScreenVisible.ts +0 -28
- package/src/hooks/promise.test.ts +0 -76
- package/src/hooks/promise.ts +0 -35
- package/src/utils/events.test.ts +0 -65
- package/src/utils/events.ts +0 -39
- package/esm/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
- package/esm/{components → defaults}/DefaultLayout.d.ts +0 -0
- package/esm/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
- package/esm/{components → setters}/SetComponent.d.ts +0 -0
- package/esm/{components → setters}/SetError.d.ts +0 -0
- package/esm/{components → setters}/SetErrors.d.ts +0 -0
- package/esm/{components → setters}/SetLayout.d.ts +0 -0
- package/esm/{components → setters}/SetProvider.d.ts +0 -0
- package/esm/{components → setters}/SetRedirect.d.ts +0 -0
- package/lib/{components → defaults}/DefaultErrorInfo.d.ts +0 -0
- package/lib/{components → defaults}/DefaultLayout.d.ts +0 -0
- package/lib/{components/DefaultLoader.d.ts → defaults/DefaultLoadingIndicator.d.ts} +0 -0
- package/lib/{components → setters}/SetComponent.d.ts +0 -0
- package/lib/{components → setters}/SetError.d.ts +0 -0
- package/lib/{components → setters}/SetErrors.d.ts +0 -0
- package/lib/{components → setters}/SetLayout.d.ts +0 -0
- package/lib/{components → setters}/SetProvider.d.ts +0 -0
- package/lib/{components → setters}/SetRedirect.d.ts +0 -0
- package/src/{components → defaults}/DefaultLayout.tsx +1 -1
- /package/src/{components/DefaultLoader.tsx → defaults/DefaultLoadingIndicator.tsx} +0 -0
- /package/src/{components → setters}/SetErrors.tsx +0 -0
- /package/src/{components → setters}/SetLayout.tsx +0 -0
package/lib/actions/define.js
CHANGED
|
@@ -6,9 +6,8 @@ function defineAction(ctx, actionName, action) {
|
|
|
6
6
|
}
|
|
7
7
|
exports.defineAction = defineAction;
|
|
8
8
|
function defineActions(ctx, actions) {
|
|
9
|
-
for (
|
|
10
|
-
|
|
11
|
-
var action = actions[actionName];
|
|
9
|
+
for (const actionName of Object.keys(actions)) {
|
|
10
|
+
const action = actions[actionName];
|
|
12
11
|
defineAction(ctx, actionName, action);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/actions/define.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,GAAuB,EAAE,UAAkB,EAAE,MAAW;IACnF,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,GAAuB,EAAE,OAAY;IACjE,
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/actions/define.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,GAAuB,EAAE,UAAkB,EAAE,MAAW;IACnF,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,GAAuB,EAAE,OAAY;IACjE,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;KACvC;AACH,CAAC;AALD,sCAKC"}
|
package/lib/actions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./app"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./components"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./data"), exports);
|
package/lib/actions/portal.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactPortal } from 'react';
|
|
2
2
|
import { GlobalStateContext } from '../types';
|
|
3
3
|
export declare function destroyPortal(ctx: GlobalStateContext, id: string): void;
|
|
4
|
+
export declare function hidePortal(ctx: GlobalStateContext, id: string, entry: ReactPortal): void;
|
|
5
|
+
export declare function updatePortal(ctx: GlobalStateContext, id: string, current: ReactPortal, next: ReactPortal): void;
|
|
4
6
|
export declare function showPortal(ctx: GlobalStateContext, id: string, entry: ReactPortal): void;
|
package/lib/actions/portal.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.showPortal = exports.destroyPortal = void 0;
|
|
4
|
-
|
|
5
|
-
var utils_1 = require("../utils");
|
|
3
|
+
exports.showPortal = exports.updatePortal = exports.hidePortal = exports.destroyPortal = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
6
5
|
function destroyPortal(ctx, id) {
|
|
7
|
-
ctx.dispatch(
|
|
6
|
+
ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withoutKey)(state.portals, id) })));
|
|
8
7
|
}
|
|
9
8
|
exports.destroyPortal = destroyPortal;
|
|
9
|
+
function hidePortal(ctx, id, entry) {
|
|
10
|
+
ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.excludeItem)(state.portals[id], entry)) })));
|
|
11
|
+
}
|
|
12
|
+
exports.hidePortal = hidePortal;
|
|
13
|
+
function updatePortal(ctx, id, current, next) {
|
|
14
|
+
ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.replaceOrAddItem)(state.portals[id], next, (m) => m === current)) })));
|
|
15
|
+
}
|
|
16
|
+
exports.updatePortal = updatePortal;
|
|
10
17
|
function showPortal(ctx, id, entry) {
|
|
11
|
-
ctx.dispatch(
|
|
18
|
+
ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { portals: (0, utils_1.withKey)(state.portals, id, (0, utils_1.includeItem)(state.portals[id], entry)) })));
|
|
12
19
|
}
|
|
13
20
|
exports.showPortal = showPortal;
|
|
14
21
|
//# sourceMappingURL=portal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/actions/portal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/actions/portal.ts"],"names":[],"mappings":";;;AACA,oCAA2F;AAG3F,SAAgB,aAAa,CAAC,GAAuB,EAAE,EAAU;IAC/D,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,kBAAU,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,IACtC,CAAC,CAAC;AACN,CAAC;AALD,sCAKC;AAED,SAAgB,UAAU,CAAC,GAAuB,EAAE,EAAU,EAAE,KAAkB;IAChF,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,eAAO,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,IAAA,mBAAW,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAC1E,CAAC,CAAC;AACN,CAAC;AALD,gCAKC;AAED,SAAgB,YAAY,CAAC,GAAuB,EAAE,EAAU,EAAE,OAAoB,EAAE,IAAiB;IACvG,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,eAAO,EACd,KAAK,CAAC,OAAO,EACb,EAAE,EACF,IAAA,wBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAChE,IACD,CAAC,CAAC;AACN,CAAC;AATD,oCASC;AAED,SAAgB,UAAU,CAAC,GAAuB,EAAE,EAAU,EAAE,KAAkB;IAChF,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCACnB,KAAK,KACR,OAAO,EAAE,IAAA,eAAO,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,IAAA,mBAAW,EAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAC1E,CAAC,CAAC;AACN,CAAC;AALD,gCAKC"}
|
package/lib/actions/state.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readState = exports.dispatch = void 0;
|
|
4
|
-
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
5
|
function dispatch(ctx, update) {
|
|
6
|
-
|
|
6
|
+
const oldState = ctx.state.getState();
|
|
7
|
+
const newState = update(oldState);
|
|
8
|
+
if (!(0, utils_1.isSame)(oldState, newState)) {
|
|
9
|
+
ctx.state.setState(newState);
|
|
10
|
+
}
|
|
7
11
|
}
|
|
8
12
|
exports.dispatch = dispatch;
|
|
9
13
|
function readState(ctx, read) {
|
|
10
|
-
|
|
11
|
-
return read(state);
|
|
14
|
+
return read(ctx.state.getState());
|
|
12
15
|
}
|
|
13
16
|
exports.readState = readState;
|
|
14
17
|
//# sourceMappingURL=state.js.map
|
package/lib/actions/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":";;;AAAA,oCAAkC;AAGlC,SAAgB,QAAQ,CAAC,GAAuB,EAAE,MAA2C;IAC3F,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAElC,IAAI,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;QAC/B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC9B;AACH,CAAC;AAPD,4BAOC;AAED,SAAgB,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AACpC,CAAC;AAFD,8BAEC"}
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export interface ErrorBoundaryOptions<T> {
|
|
2
|
+
import { Errors, PiletApi } from '../types';
|
|
3
|
+
export interface ErrorBoundaryProps {
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param error The error caught by the boundary.
|
|
5
|
+
* The type of error to indicate when caught.
|
|
9
6
|
*/
|
|
10
|
-
|
|
7
|
+
errorType: keyof Errors;
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param error The error caught by the boundary.
|
|
14
|
-
* @param props The props used by the boundary.
|
|
9
|
+
* The associated pilet api for the metadata.
|
|
15
10
|
*/
|
|
16
|
-
|
|
11
|
+
piral: PiletApi;
|
|
17
12
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @param children The standard children to render.
|
|
20
|
-
* @param props The props used by the boundary.
|
|
13
|
+
* The content to render (i.e., where to apply the boundary to).
|
|
21
14
|
*/
|
|
22
|
-
|
|
15
|
+
children: React.ReactNode;
|
|
23
16
|
}
|
|
24
|
-
/**
|
|
25
|
-
* The props of the ErrorBoundary component.
|
|
26
|
-
*/
|
|
27
|
-
export interface ErrorBoundaryProps<T> extends ErrorBoundaryOptions<T> {
|
|
28
|
-
/**
|
|
29
|
-
* The render props for the specific ErrorBoundary.
|
|
30
|
-
*/
|
|
31
|
-
renderProps: T;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The state of the ErrorBoundary component.
|
|
35
|
-
*/
|
|
36
17
|
export interface ErrorBoundaryState {
|
|
37
18
|
/**
|
|
38
19
|
* The current error (if any) caught by the boundary.
|
|
@@ -40,10 +21,12 @@ export interface ErrorBoundaryState {
|
|
|
40
21
|
error?: Error;
|
|
41
22
|
}
|
|
42
23
|
/**
|
|
43
|
-
* The
|
|
24
|
+
* The component for catching errors and displaying error information.
|
|
44
25
|
*/
|
|
45
|
-
export declare class ErrorBoundary
|
|
46
|
-
|
|
26
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
27
|
+
state: {
|
|
28
|
+
error: any;
|
|
29
|
+
};
|
|
47
30
|
componentDidCatch(error: Error): void;
|
|
48
|
-
render():
|
|
31
|
+
render(): JSX.Element;
|
|
49
32
|
}
|
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ErrorBoundary = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const components_1 = require("./components");
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The component for catching errors and displaying error information.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_this.state = {
|
|
10
|
+
class ErrorBoundary extends React.Component {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.state = {
|
|
15
14
|
error: undefined,
|
|
16
15
|
};
|
|
17
|
-
return _this;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
17
|
+
componentDidCatch(error) {
|
|
18
|
+
const { piral, errorType } = this.props;
|
|
19
|
+
const pilet = piral.meta.name;
|
|
20
|
+
console.error(`[${pilet}] Exception in component of type "${errorType}".`, error);
|
|
24
21
|
this.setState({
|
|
25
|
-
error
|
|
22
|
+
error,
|
|
26
23
|
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const _a = this.props, { children, piral, errorType } = _a, renderProps = tslib_1.__rest(_a, ["children", "piral", "errorType"]);
|
|
27
|
+
const { error } = this.state;
|
|
28
|
+
const rest = renderProps;
|
|
31
29
|
if (error) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
return React.createElement("div", { style: { whiteSpace: 'pre-wrap' } }, error && error.message);
|
|
30
|
+
const pilet = piral.meta.name;
|
|
31
|
+
return React.createElement(components_1.RegisteredErrorInfo, Object.assign({ type: errorType, error: error, pilet: pilet }, rest));
|
|
36
32
|
}
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}(React.Component));
|
|
33
|
+
return React.createElement(React.Suspense, { fallback: React.createElement(components_1.RegisteredLoadingIndicator, null) }, children);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
41
36
|
exports.ErrorBoundary = ErrorBoundary;
|
|
42
37
|
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,6CAA+E;AAyB/E;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,SAAiD;IAA1F;;QACE,UAAK,GAAG;YACN,KAAK,EAAE,SAAS;SACjB,CAAC;IAwBJ,CAAC;IAtBC,iBAAiB,CAAC,KAAY;QAC5B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,qCAAqC,SAAS,IAAI,EAAE,KAAK,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC;YACZ,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,MAAM,KAAiD,IAAI,CAAC,KAAK,EAA3D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA+B,EAA1B,WAAW,sBAA5C,kCAA8C,CAAa,CAAC;QAClE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,IAAI,GAAQ,WAAW,CAAC;QAE9B,IAAI,KAAK,EAAE;YACT,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9B,OAAO,oBAAC,gCAAmB,kBAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAM,IAAI,EAAI,CAAC;SACvF;QAED,OAAO,oBAAC,KAAK,CAAC,QAAQ,IAAC,QAAQ,EAAE,oBAAC,uCAA0B,OAAG,IAAG,QAAQ,CAAkB,CAAC;IAC/F,CAAC;CACF;AA3BD,sCA2BC"}
|
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExtensionSlot = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const piral_base_1 = require("piral-base");
|
|
6
|
+
const wrapComponent_1 = require("./wrapComponent");
|
|
7
|
+
const hooks_1 = require("../hooks");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const wrapper = ({ children }) => (0, utils_1.defaultRender)(children);
|
|
10
|
+
const renderExtensions = [
|
|
11
|
+
{
|
|
12
|
+
component: (props) => {
|
|
13
|
+
const context = (0, hooks_1.useGlobalStateContext)();
|
|
14
|
+
const converters = context.converters;
|
|
15
|
+
const piral = context.apis._;
|
|
16
|
+
const { component, props: args } = props.params;
|
|
17
|
+
const Component = React.useMemo(() => (0, wrapComponent_1.wrapComponent)(converters, component, { piral }, wrapper), [component]);
|
|
18
|
+
return React.createElement(Component, Object.assign({}, args));
|
|
19
|
+
},
|
|
20
|
+
defaults: {},
|
|
21
|
+
pilet: '',
|
|
22
|
+
reference: {
|
|
23
|
+
displayName: 'AnyComponent',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
function defaultOrder(extensions) {
|
|
28
|
+
return extensions;
|
|
29
|
+
}
|
|
9
30
|
/**
|
|
10
31
|
* The extension slot component to be used when the available
|
|
11
32
|
* extensions of a given name should be rendered at a specific
|
|
12
33
|
* location.
|
|
13
34
|
*/
|
|
14
35
|
function ExtensionSlot(props) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
const { name, render = utils_1.defaultRender, empty, params, children, emptySkipsRender = false, order = defaultOrder, } = props;
|
|
37
|
+
const extensions = (0, hooks_1.useGlobalState)((s) => (name ? s.registry.extensions[name] || utils_1.none : renderExtensions));
|
|
38
|
+
const isEmpty = extensions.length === 0 && (0, piral_base_1.isfunc)(empty);
|
|
39
|
+
const content = isEmpty
|
|
40
|
+
? [(0, utils_1.defaultRender)(empty(), 'empty')]
|
|
41
|
+
: order(extensions).map(({ component: Component, reference, defaults = {} }, i) => (React.createElement(Component, { key: `${(reference === null || reference === void 0 ? void 0 : reference.displayName) || '_'}${i}`, children: children, params: Object.assign(Object.assign({}, defaults), params) })));
|
|
42
|
+
if (isEmpty && emptySkipsRender) {
|
|
43
|
+
return content[0];
|
|
44
|
+
}
|
|
45
|
+
return render(content);
|
|
23
46
|
}
|
|
24
47
|
exports.ExtensionSlot = ExtensionSlot;
|
|
25
|
-
ExtensionSlot.displayName =
|
|
48
|
+
ExtensionSlot.displayName = `ExtensionSlot`;
|
|
26
49
|
//# sourceMappingURL=ExtensionSlot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../src/components/ExtensionSlot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../src/components/ExtensionSlot.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,2CAAoC;AACpC,mDAAgD;AAChD,oCAAiE;AACjE,oCAA+C;AAG/C,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,QAAQ,CAAC,CAAC;AAE1D,MAAM,gBAAgB,GAA4B;IAChD;QACE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAA,6BAAqB,GAAE,CAAC;YACxC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;YAChD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAA,6BAAa,EAAC,UAAU,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7G,OAAO,oBAAC,SAAS,oBAAK,IAAI,EAAI,CAAC;QACjC,CAAC;QACD,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,SAAS,EAAE;YACT,WAAW,EAAE,cAAc;SAC5B;KACF;CACF,CAAC;AAEF,SAAS,YAAY,CAAC,UAAwC;IAC5D,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAmB,KAA4B;IAC1E,MAAM,EACJ,IAAI,EACJ,MAAM,GAAG,qBAAa,EACtB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,gBAAgB,GAAG,KAAK,EACxB,KAAK,GAAG,YAAY,GACrB,GAAG,KAAK,CAAC;IACV,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,YAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC1G,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,mBAAM,EAAC,KAAK,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,OAAO;QACrB,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAC/E,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,KAAI,GAAG,GAAG,CAAC,EAAE,EAC3C,QAAQ,EAAE,QAAQ,EAClB,MAAM,kCACD,QAAQ,GACR,MAAM,IAEX,CACH,CAAC,CAAC;IAEP,IAAI,OAAO,IAAI,gBAAgB,EAAE;QAC/B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AA9BD,sCA8BC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ForeignComponent, BaseComponentProps, ComponentContext } from '../types';
|
|
3
|
+
interface ForeignComponentContainerProps<T> {
|
|
4
|
+
$portalId: string;
|
|
5
|
+
$component: ForeignComponent<T>;
|
|
6
|
+
$context: ComponentContext;
|
|
7
|
+
innerProps: T & BaseComponentProps;
|
|
8
|
+
}
|
|
9
|
+
export declare class ForeignComponentContainer<T> extends React.Component<ForeignComponentContainerProps<T>> {
|
|
10
|
+
private locals?;
|
|
11
|
+
private current?;
|
|
12
|
+
private previous?;
|
|
13
|
+
private setNode;
|
|
14
|
+
componentDidMount(): void;
|
|
15
|
+
componentDidUpdate(): void;
|
|
16
|
+
componentWillUnmount(): void;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForeignComponentContainer = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const piral_base_1 = require("piral-base");
|
|
6
|
+
class ForeignComponentContainer extends React.Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.locals = {};
|
|
10
|
+
this.setNode = (node) => {
|
|
11
|
+
this.current = node;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
componentDidMount() {
|
|
15
|
+
const { current } = this;
|
|
16
|
+
const { $component, $context, innerProps } = this.props;
|
|
17
|
+
const { mount } = $component;
|
|
18
|
+
if (current && (0, piral_base_1.isfunc)(mount)) {
|
|
19
|
+
mount(current, innerProps, $context, this.locals);
|
|
20
|
+
}
|
|
21
|
+
this.previous = current;
|
|
22
|
+
}
|
|
23
|
+
componentDidUpdate() {
|
|
24
|
+
const { current, previous } = this;
|
|
25
|
+
const { $component, $context, innerProps } = this.props;
|
|
26
|
+
const { update } = $component;
|
|
27
|
+
if (current !== previous) {
|
|
28
|
+
previous && this.componentWillUnmount();
|
|
29
|
+
current && this.componentDidMount();
|
|
30
|
+
}
|
|
31
|
+
else if ((0, piral_base_1.isfunc)(update)) {
|
|
32
|
+
update(current, innerProps, $context, this.locals);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
componentWillUnmount() {
|
|
36
|
+
const { previous } = this;
|
|
37
|
+
const { $component } = this.props;
|
|
38
|
+
const { unmount } = $component;
|
|
39
|
+
if (previous && (0, piral_base_1.isfunc)(unmount)) {
|
|
40
|
+
unmount(previous, this.locals);
|
|
41
|
+
}
|
|
42
|
+
this.previous = undefined;
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const { $portalId } = this.props;
|
|
46
|
+
return React.createElement("piral-portal", { pid: $portalId, ref: this.setNode });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.ForeignComponentContainer = ForeignComponentContainer;
|
|
50
|
+
//# sourceMappingURL=ForeignComponentContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForeignComponentContainer.js","sourceRoot":"","sources":["../../src/components/ForeignComponentContainer.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,2CAAoC;AAWpC,MAAa,yBAA6B,SAAQ,KAAK,CAAC,SAA4C;IAApG;;QACU,WAAM,GAAyB,EAAE,CAAC;QAIlC,YAAO,GAAG,CAAC,IAAoB,EAAE,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC;IA2CJ,CAAC;IAzCC,iBAAiB;QACf,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;QAE7B,IAAI,OAAO,IAAI,IAAA,mBAAM,EAAC,KAAK,CAAC,EAAE;YAC5B,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,kBAAkB;QAChB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QACnC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACxD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QAE9B,IAAI,OAAO,KAAK,QAAQ,EAAE;YACxB,QAAQ,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACxC,OAAO,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;SACrC;aAAM,IAAI,IAAA,mBAAM,EAAC,MAAM,CAAC,EAAE;YACzB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACpD;IACH,CAAC;IAED,oBAAoB;QAClB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAClC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;QAE/B,IAAI,QAAQ,IAAI,IAAA,mBAAM,EAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SAChC;QAED,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACjC,OAAO,sCAAc,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,GAAI,CAAC;IAC7D,CAAC;CACF;AAlDD,8DAkDC"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Mediator = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const piral_base_1 = require("piral-base");
|
|
6
|
+
const hooks_1 = require("../hooks");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
7
8
|
/**
|
|
8
9
|
* The Mediator component for interfacing with pilets loading.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const Mediator = ({ options }) => {
|
|
12
|
+
const { initialize, readState } = (0, hooks_1.useGlobalStateContext)();
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const shouldLoad = readState(s => s.app.loading);
|
|
15
|
+
if (shouldLoad) {
|
|
16
|
+
const { connect, disconnect } = (0, piral_base_1.startLoadingPilets)(options);
|
|
17
|
+
const notifier = (error, pilets, loaded) => {
|
|
18
|
+
initialize(!loaded, error, pilets);
|
|
19
|
+
};
|
|
20
|
+
connect(notifier);
|
|
21
|
+
return () => disconnect(notifier);
|
|
22
|
+
}
|
|
23
|
+
}, utils_1.none);
|
|
21
24
|
// tslint:disable-next-line:no-null-keyword
|
|
22
25
|
return null;
|
|
23
26
|
};
|
|
27
|
+
exports.Mediator = Mediator;
|
|
24
28
|
//# sourceMappingURL=Mediator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mediator.js","sourceRoot":"","sources":["../../src/components/Mediator.tsx"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"Mediator.js","sourceRoot":"","sources":["../../src/components/Mediator.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,2CAAkF;AAClF,oCAAiD;AACjD,oCAAgC;AAYhC;;GAEG;AACI,MAAM,QAAQ,GAA4B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAA,6BAAqB,GAAE,CAAC;IAE1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEjD,IAAI,UAAU,EAAE;YACd,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;YAC5D,MAAM,QAAQ,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACxD,UAAU,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;YACrC,CAAC,CAAC;YACF,OAAO,CAAC,QAAQ,CAAC,CAAC;YAClB,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SACnC;IAEH,CAAC,EAAE,YAAI,CAAC,CAAC;IAET,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,QAAQ,YAmBnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PiralGlobals = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const PortalRenderer_1 = require("./PortalRenderer");
|
|
6
|
+
const components_1 = require("./components");
|
|
7
|
+
/**
|
|
8
|
+
* Integrates the global portal renderer and the debug utilities
|
|
9
|
+
* (if registered).
|
|
10
|
+
*/
|
|
11
|
+
const PiralGlobals = () => {
|
|
12
|
+
return (React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement(PortalRenderer_1.PortalRenderer, { id: "root" }),
|
|
14
|
+
React.createElement(components_1.RegisteredDebug, null)));
|
|
15
|
+
};
|
|
16
|
+
exports.PiralGlobals = PiralGlobals;
|
|
17
|
+
//# sourceMappingURL=PiralGlobals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PiralGlobals.js","sourceRoot":"","sources":["../../src/components/PiralGlobals.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,qDAAkD;AAClD,6CAA+C;AAE/C;;;GAGG;AACI,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,OAAO,CACL;QACE,oBAAC,+BAAc,IAAC,EAAE,EAAC,MAAM,GAAG;QAC5B,oBAAC,4BAAe,OAAG,CAClB,CACJ,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RouteComponentProps, SwitchProps } from 'react-router';
|
|
3
|
+
import { RouteSwitchProps } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* The props used by the PiralRoutes component.
|
|
5
6
|
*/
|
|
@@ -8,6 +9,10 @@ export interface RoutesProps extends SwitchProps {
|
|
|
8
9
|
* Sets the component for showing the not found page.
|
|
9
10
|
*/
|
|
10
11
|
NotFound: React.ComponentType<RouteComponentProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the component for actually switching the routes.
|
|
14
|
+
*/
|
|
15
|
+
RouteSwitch: React.ComponentType<RouteSwitchProps>;
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* The component for defining the exclusive routes to be used.
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PiralRoutes = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var hooks_1 = require("../hooks");
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const hooks_1 = require("../hooks");
|
|
8
7
|
/**
|
|
9
8
|
* The component for defining the exclusive routes to be used.
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
var NotFound = _a
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (React.createElement(react_router_1.Switch, tslib_1.__assign({}, props),
|
|
16
|
-
Object.keys(routes).map(function (url) { return (React.createElement(react_router_1.Route, { exact: true, key: url, path: url, component: routes[url] })); }),
|
|
17
|
-
Object.keys(pages).map(function (url) { return (React.createElement(react_router_1.Route, { exact: true, key: url, path: url, component: pages[url].component })); }),
|
|
18
|
-
React.createElement(react_router_1.Route, { component: NotFound })));
|
|
10
|
+
const PiralRoutes = (_a) => {
|
|
11
|
+
var { NotFound, RouteSwitch } = _a, props = tslib_1.__rest(_a, ["NotFound", "RouteSwitch"]);
|
|
12
|
+
const paths = (0, hooks_1.useRoutes)();
|
|
13
|
+
return React.createElement(RouteSwitch, Object.assign({ NotFound: NotFound, paths: paths }, props));
|
|
19
14
|
};
|
|
15
|
+
exports.PiralRoutes = PiralRoutes;
|
|
20
16
|
exports.PiralRoutes.displayName = 'Routes';
|
|
21
17
|
//# sourceMappingURL=PiralRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAE/B,oCAAqC;AAiBrC;;GAEG;AACI,MAAM,WAAW,GAA0B,CAAC,EAAmC,EAAE,EAAE;QAAvC,EAAE,QAAQ,EAAE,WAAW,OAAY,EAAP,KAAK,sBAAjC,2BAAmC,CAAF;IAClF,MAAM,KAAK,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC1B,OAAO,oBAAC,WAAW,kBAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB;AACF,mBAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PiralSuspense = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const components_1 = require("./components");
|
|
6
|
+
const hooks_1 = require("../hooks");
|
|
7
|
+
const PiralSuspense = ({ children }) => {
|
|
8
|
+
const { error, loading } = (0, hooks_1.useGlobalState)((m) => m.app);
|
|
9
|
+
return error ? (React.createElement(components_1.RegisteredErrorInfo, { type: "loading", error: error })) : loading ? (React.createElement(components_1.RegisteredLoadingIndicator, null)) : (React.createElement(React.Fragment, null, children));
|
|
10
|
+
};
|
|
11
|
+
exports.PiralSuspense = PiralSuspense;
|
|
12
|
+
//# sourceMappingURL=PiralSuspense.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PiralSuspense.js","sourceRoot":"","sources":["../../src/components/PiralSuspense.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,6CAA+E;AAC/E,oCAA0C;AAMnC,MAAM,aAAa,GAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExD,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,gCAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,GAAI,CACrD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,uCAA0B,OAAG,CAC/B,CAAC,CAAC,CAAC,CACF,0CAAG,QAAQ,CAAI,CAChB,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { LayoutBreakpoints } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* The props for the PiralView component.
|
|
4
5
|
*/
|
|
5
6
|
export interface PiralViewProps {
|
|
7
|
+
/**
|
|
8
|
+
* The custom breakpoints for the different layout modi.
|
|
9
|
+
*/
|
|
10
|
+
breakpoints?: LayoutBreakpoints;
|
|
11
|
+
/**
|
|
12
|
+
* The extra content.
|
|
13
|
+
*/
|
|
14
|
+
children: React.ReactNode;
|
|
6
15
|
}
|
|
7
16
|
/**
|
|
8
17
|
* The component responsible for the generic view of the application.
|
|
9
|
-
* This includes the
|
|
18
|
+
* This includes the used the current content and some convenience.
|
|
10
19
|
*/
|
|
11
20
|
export declare const PiralView: React.FC<PiralViewProps>;
|