piral-core 1.6.0-beta.7240 → 1.6.0-beta.7244
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/app.codegen +2 -3
- package/lib/Piral.js +8 -13
- package/lib/Piral.js.map +1 -1
- package/lib/PiralContext.js +11 -16
- package/lib/PiralContext.js.map +1 -1
- package/lib/RootListener.js +8 -13
- package/lib/RootListener.js.map +1 -1
- package/lib/actions/app.js +19 -30
- package/lib/actions/app.js.map +1 -1
- package/lib/actions/components.js +9 -16
- package/lib/actions/components.js.map +1 -1
- package/lib/actions/data.js +7 -15
- package/lib/actions/data.js.map +1 -1
- package/lib/actions/define.js +2 -7
- package/lib/actions/define.js.map +1 -1
- package/lib/actions/index.js +6 -9
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/portal.js +9 -16
- package/lib/actions/portal.js.map +1 -1
- package/lib/actions/state.js +4 -9
- package/lib/actions/state.js.map +1 -1
- package/lib/components/ErrorBoundary.js +9 -14
- package/lib/components/ErrorBoundary.js.map +1 -1
- package/lib/components/ExtensionSlot.js +9 -14
- package/lib/components/ExtensionSlot.js.map +1 -1
- package/lib/components/ForeignComponentContainer.js +6 -11
- package/lib/components/ForeignComponentContainer.js.map +1 -1
- package/lib/components/Mediator.js +8 -13
- package/lib/components/Mediator.js.map +1 -1
- package/lib/components/PiralGlobals.js +6 -11
- package/lib/components/PiralGlobals.js.map +1 -1
- package/lib/components/PiralRoutes.js +11 -16
- package/lib/components/PiralRoutes.js.map +1 -1
- package/lib/components/PiralSuspense.js +6 -11
- package/lib/components/PiralSuspense.js.map +1 -1
- package/lib/components/PiralView.js +13 -18
- package/lib/components/PiralView.js.map +1 -1
- package/lib/components/PortalRenderer.js +5 -9
- package/lib/components/PortalRenderer.js.map +1 -1
- package/lib/components/ResponsiveLayout.js +6 -11
- package/lib/components/ResponsiveLayout.js.map +1 -1
- package/lib/components/SwitchErrorInfo.js +7 -12
- package/lib/components/SwitchErrorInfo.js.map +1 -1
- package/lib/components/components.js +10 -15
- package/lib/components/components.js.map +1 -1
- package/lib/components/index.js +12 -15
- package/lib/components/index.js.map +1 -1
- package/lib/components/wrapComponent.js +12 -17
- package/lib/components/wrapComponent.js.map +1 -1
- package/lib/createInstance.js +15 -19
- package/lib/createInstance.js.map +1 -1
- package/lib/defaults/DefaultErrorInfo.js +5 -10
- package/lib/defaults/DefaultErrorInfo.js.map +1 -1
- package/lib/defaults/DefaultLayout.js +3 -7
- package/lib/defaults/DefaultLayout.js.map +1 -1
- package/lib/defaults/DefaultLoadingIndicator.js +3 -8
- package/lib/defaults/DefaultLoadingIndicator.js.map +1 -1
- package/lib/defaults/DefaultRouteSwitch_v5.js +7 -12
- package/lib/defaults/DefaultRouteSwitch_v5.js.map +1 -1
- package/lib/defaults/DefaultRouteSwitch_v6.js +7 -12
- package/lib/defaults/DefaultRouteSwitch_v6.js.map +1 -1
- package/lib/defaults/DefaultRouter_v5.js +5 -10
- package/lib/defaults/DefaultRouter_v5.js.map +1 -1
- package/lib/defaults/DefaultRouter_v6.js +5 -10
- package/lib/defaults/DefaultRouter_v6.js.map +1 -1
- package/lib/defaults/navigator_none.js +4 -11
- package/lib/defaults/navigator_none.js.map +1 -1
- package/lib/defaults/navigator_v5.js +9 -17
- package/lib/defaults/navigator_v5.js.map +1 -1
- package/lib/defaults/navigator_v6.js +9 -17
- package/lib/defaults/navigator_v6.js.map +1 -1
- package/lib/helpers.js +8 -12
- package/lib/helpers.js.map +1 -1
- package/lib/hooks/action.js +3 -7
- package/lib/hooks/action.js.map +1 -1
- package/lib/hooks/actions.js +4 -8
- package/lib/hooks/actions.js.map +1 -1
- package/lib/hooks/globalState.js +5 -10
- package/lib/hooks/globalState.js.map +1 -1
- package/lib/hooks/index.js +7 -10
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/media.js +8 -12
- package/lib/hooks/media.js.map +1 -1
- package/lib/hooks/piletApi.js +5 -9
- package/lib/hooks/piletApi.js.map +1 -1
- package/lib/hooks/setter.js +5 -9
- package/lib/hooks/setter.js.map +1 -1
- package/lib/hooks/sharedData.js +3 -7
- package/lib/hooks/sharedData.js.map +1 -1
- package/lib/index.js +10 -13
- package/lib/index.js.map +1 -1
- package/lib/modules/api.js +8 -13
- package/lib/modules/api.js.map +1 -1
- package/lib/modules/core.js +11 -15
- package/lib/modules/core.js.map +1 -1
- package/lib/modules/dependencies.js +7 -12
- package/lib/modules/dependencies.js.map +1 -1
- package/lib/modules/element.js +22 -26
- package/lib/modules/element.js.map +1 -1
- package/lib/modules/index.js +3 -6
- package/lib/modules/index.js.map +1 -1
- package/lib/setters/SetComponent.js +4 -8
- package/lib/setters/SetComponent.js.map +1 -1
- package/lib/setters/SetError.js +4 -8
- package/lib/setters/SetError.js.map +1 -1
- package/lib/setters/SetErrors.js +4 -9
- package/lib/setters/SetErrors.js.map +1 -1
- package/lib/setters/SetLayout.js +4 -9
- package/lib/setters/SetLayout.js.map +1 -1
- package/lib/setters/SetProvider.js +4 -8
- package/lib/setters/SetProvider.js.map +1 -1
- package/lib/setters/SetRedirect.js +5 -9
- package/lib/setters/SetRedirect.js.map +1 -1
- package/lib/setters/SetRoute.js +4 -8
- package/lib/setters/SetRoute.js.map +1 -1
- package/lib/setters/index.js +7 -10
- package/lib/setters/index.js.map +1 -1
- package/lib/state/createActions.js +5 -11
- package/lib/state/createActions.js.map +1 -1
- package/lib/state/createGlobalState.js +5 -10
- package/lib/state/createGlobalState.js.map +1 -1
- package/lib/state/index.js +4 -7
- package/lib/state/index.js.map +1 -1
- package/lib/state/stateContext.js +3 -7
- package/lib/state/stateContext.js.map +1 -1
- package/lib/state/withApi.js +7 -12
- package/lib/state/withApi.js.map +1 -1
- package/lib/tools/codegen.js +15 -22
- package/lib/tools/codegen.js.map +1 -1
- package/lib/tools/debugger.js +3 -7
- package/lib/tools/debugger.js.map +1 -1
- package/lib/tools/emulator.js +3 -7
- package/lib/tools/emulator.js.map +1 -1
- package/lib/types/api.js +1 -2
- package/lib/types/common.js +1 -2
- package/lib/types/components.js +1 -2
- package/lib/types/config.js +1 -2
- package/lib/types/custom.js +1 -2
- package/lib/types/data.js +1 -2
- package/lib/types/extension.js +1 -2
- package/lib/types/index.js +14 -17
- package/lib/types/index.js.map +1 -1
- package/lib/types/instance.js +1 -2
- package/lib/types/layout.js +1 -2
- package/lib/types/navigation.js +1 -2
- package/lib/types/plugin.js +1 -2
- package/lib/types/state.js +1 -2
- package/lib/types/utils.js +1 -2
- package/lib/types/web.js +1 -2
- package/lib/utils/compare.js +1 -5
- package/lib/utils/compare.js.map +1 -1
- package/lib/utils/data.js +3 -9
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/extension.js +3 -9
- package/lib/utils/extension.js.map +1 -1
- package/lib/utils/foreign.js +15 -23
- package/lib/utils/foreign.js.map +1 -1
- package/lib/utils/guid.js +2 -7
- package/lib/utils/guid.js.map +1 -1
- package/lib/utils/helpers.js +24 -41
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.js +12 -18
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/media.js +5 -9
- package/lib/utils/media.js.map +1 -1
- package/lib/utils/react.js +2 -7
- package/lib/utils/react.js.map +1 -1
- package/lib/utils/routes.js +3 -8
- package/lib/utils/routes.js.map +1 -1
- package/lib/utils/state.js +19 -30
- package/lib/utils/state.js.map +1 -1
- package/lib/utils/storage.js +2 -5
- package/lib/utils/storage.js.map +1 -1
- package/package.json +11 -26
- package/esm/Piral.d.ts +0 -18
- package/esm/Piral.js +0 -24
- package/esm/Piral.js.map +0 -1
- package/esm/PiralContext.d.ts +0 -21
- package/esm/PiralContext.js +0 -34
- package/esm/PiralContext.js.map +0 -1
- package/esm/RootListener.d.ts +0 -2
- package/esm/RootListener.js +0 -44
- package/esm/RootListener.js.map +0 -1
- package/esm/actions/app.d.ts +0 -13
- package/esm/actions/app.js +0 -61
- package/esm/actions/app.js.map +0 -1
- package/esm/actions/components.d.ts +0 -5
- package/esm/actions/components.js +0 -14
- package/esm/actions/components.js.map +0 -1
- package/esm/actions/data.d.ts +0 -6
- package/esm/actions/data.js +0 -46
- package/esm/actions/data.js.map +0 -1
- package/esm/actions/define.d.ts +0 -3
- package/esm/actions/define.js +0 -10
- package/esm/actions/define.js.map +0 -1
- package/esm/actions/index.d.ts +0 -6
- package/esm/actions/index.js +0 -7
- package/esm/actions/index.js.map +0 -1
- package/esm/actions/portal.d.ts +0 -6
- package/esm/actions/portal.js +0 -26
- package/esm/actions/portal.js.map +0 -1
- package/esm/actions/state.d.ts +0 -3
- package/esm/actions/state.js +0 -12
- package/esm/actions/state.js.map +0 -1
- package/esm/components/ErrorBoundary.d.ts +0 -33
- package/esm/components/ErrorBoundary.js +0 -50
- package/esm/components/ErrorBoundary.js.map +0 -1
- package/esm/components/ExtensionSlot.d.ts +0 -11
- package/esm/components/ExtensionSlot.js +0 -29
- package/esm/components/ExtensionSlot.js.map +0 -1
- package/esm/components/ForeignComponentContainer.d.ts +0 -19
- package/esm/components/ForeignComponentContainer.js +0 -46
- package/esm/components/ForeignComponentContainer.js.map +0 -1
- package/esm/components/Mediator.d.ts +0 -15
- package/esm/components/Mediator.js +0 -24
- package/esm/components/Mediator.js.map +0 -1
- package/esm/components/PiralGlobals.d.ts +0 -6
- package/esm/components/PiralGlobals.js +0 -13
- package/esm/components/PiralGlobals.js.map +0 -1
- package/esm/components/PiralRoutes.d.ts +0 -20
- package/esm/components/PiralRoutes.js +0 -36
- package/esm/components/PiralRoutes.js.map +0 -1
- package/esm/components/PiralSuspense.d.ts +0 -5
- package/esm/components/PiralSuspense.js +0 -8
- package/esm/components/PiralSuspense.js.map +0 -1
- package/esm/components/PiralView.d.ts +0 -20
- package/esm/components/PiralView.js +0 -19
- package/esm/components/PiralView.js.map +0 -1
- package/esm/components/PortalRenderer.d.ts +0 -5
- package/esm/components/PortalRenderer.js +0 -7
- package/esm/components/PortalRenderer.js.map +0 -1
- package/esm/components/ResponsiveLayout.d.ts +0 -23
- package/esm/components/ResponsiveLayout.js +0 -12
- package/esm/components/ResponsiveLayout.js.map +0 -1
- package/esm/components/SwitchErrorInfo.d.ts +0 -3
- package/esm/components/SwitchErrorInfo.js +0 -23
- package/esm/components/SwitchErrorInfo.js.map +0 -1
- package/esm/components/components.d.ts +0 -40
- package/esm/components/components.js +0 -47
- package/esm/components/components.js.map +0 -1
- package/esm/components/index.d.ts +0 -12
- package/esm/components/index.js +0 -13
- package/esm/components/index.js.map +0 -1
- package/esm/components/wrapComponent.d.ts +0 -7
- package/esm/components/wrapComponent.js +0 -41
- package/esm/components/wrapComponent.js.map +0 -1
- package/esm/createInstance.d.ts +0 -22
- package/esm/createInstance.js +0 -68
- package/esm/createInstance.js.map +0 -1
- package/esm/defaults/DefaultErrorInfo.d.ts +0 -8
- package/esm/defaults/DefaultErrorInfo.js +0 -11
- package/esm/defaults/DefaultErrorInfo.js.map +0 -1
- package/esm/defaults/DefaultLayout.d.ts +0 -6
- package/esm/defaults/DefaultLayout.js +0 -7
- package/esm/defaults/DefaultLayout.js.map +0 -1
- package/esm/defaults/DefaultLoadingIndicator.d.ts +0 -6
- package/esm/defaults/DefaultLoadingIndicator.js +0 -7
- package/esm/defaults/DefaultLoadingIndicator.js.map +0 -1
- package/esm/defaults/DefaultRouteSwitch_v5.d.ts +0 -3
- package/esm/defaults/DefaultRouteSwitch_v5.js +0 -9
- package/esm/defaults/DefaultRouteSwitch_v5.js.map +0 -1
- package/esm/defaults/DefaultRouteSwitch_v6.d.ts +0 -3
- package/esm/defaults/DefaultRouteSwitch_v6.js +0 -13
- package/esm/defaults/DefaultRouteSwitch_v6.js.map +0 -1
- package/esm/defaults/DefaultRouter_v5.d.ts +0 -3
- package/esm/defaults/DefaultRouter_v5.js +0 -7
- package/esm/defaults/DefaultRouter_v5.js.map +0 -1
- package/esm/defaults/DefaultRouter_v6.d.ts +0 -3
- package/esm/defaults/DefaultRouter_v6.js +0 -7
- package/esm/defaults/DefaultRouter_v6.js.map +0 -1
- package/esm/defaults/navigator_none.d.ts +0 -5
- package/esm/defaults/navigator_none.js +0 -31
- package/esm/defaults/navigator_none.js.map +0 -1
- package/esm/defaults/navigator_v5.d.ts +0 -6
- package/esm/defaults/navigator_v5.js +0 -85
- package/esm/defaults/navigator_v5.js.map +0 -1
- package/esm/defaults/navigator_v6.d.ts +0 -6
- package/esm/defaults/navigator_v6.js +0 -84
- package/esm/defaults/navigator_v6.js.map +0 -1
- package/esm/helpers.d.ts +0 -17
- package/esm/helpers.js +0 -19
- package/esm/helpers.js.map +0 -1
- package/esm/hooks/action.d.ts +0 -6
- package/esm/hooks/action.js +0 -10
- package/esm/hooks/action.js.map +0 -1
- package/esm/hooks/actions.d.ts +0 -5
- package/esm/hooks/actions.js +0 -10
- package/esm/hooks/actions.js.map +0 -1
- package/esm/hooks/globalState.d.ts +0 -19
- package/esm/hooks/globalState.js +0 -16
- package/esm/hooks/globalState.js.map +0 -1
- package/esm/hooks/index.d.ts +0 -7
- package/esm/hooks/index.js +0 -8
- package/esm/hooks/index.js.map +0 -1
- package/esm/hooks/media.d.ts +0 -7
- package/esm/hooks/media.js +0 -22
- package/esm/hooks/media.js.map +0 -1
- package/esm/hooks/piletApi.d.ts +0 -7
- package/esm/hooks/piletApi.js +0 -14
- package/esm/hooks/piletApi.js.map +0 -1
- package/esm/hooks/setter.d.ts +0 -5
- package/esm/hooks/setter.js +0 -14
- package/esm/hooks/setter.js.map +0 -1
- package/esm/hooks/sharedData.d.ts +0 -12
- package/esm/hooks/sharedData.js +0 -6
- package/esm/hooks/sharedData.js.map +0 -1
- package/esm/index.d.ts +0 -10
- package/esm/index.js +0 -11
- package/esm/index.js.map +0 -1
- package/esm/modules/api.d.ts +0 -4
- package/esm/modules/api.js +0 -25
- package/esm/modules/api.js.map +0 -1
- package/esm/modules/core.d.ts +0 -3
- package/esm/modules/core.js +0 -50
- package/esm/modules/core.js.map +0 -1
- package/esm/modules/dependencies.d.ts +0 -23
- package/esm/modules/dependencies.js +0 -32
- package/esm/modules/dependencies.js.map +0 -1
- package/esm/modules/element.d.ts +0 -5
- package/esm/modules/element.js +0 -248
- package/esm/modules/element.js.map +0 -1
- package/esm/modules/index.d.ts +0 -3
- package/esm/modules/index.js +0 -4
- package/esm/modules/index.js.map +0 -1
- package/esm/setters/SetComponent.d.ts +0 -19
- package/esm/setters/SetComponent.js +0 -11
- package/esm/setters/SetComponent.js.map +0 -1
- package/esm/setters/SetError.d.ts +0 -19
- package/esm/setters/SetError.js +0 -11
- package/esm/setters/SetError.js.map +0 -1
- package/esm/setters/SetErrors.d.ts +0 -15
- package/esm/setters/SetErrors.js +0 -9
- package/esm/setters/SetErrors.js.map +0 -1
- package/esm/setters/SetLayout.d.ts +0 -15
- package/esm/setters/SetLayout.js +0 -9
- package/esm/setters/SetLayout.js.map +0 -1
- package/esm/setters/SetProvider.d.ts +0 -14
- package/esm/setters/SetProvider.js +0 -11
- package/esm/setters/SetProvider.js.map +0 -1
- package/esm/setters/SetRedirect.d.ts +0 -18
- package/esm/setters/SetRedirect.js +0 -12
- package/esm/setters/SetRedirect.js.map +0 -1
- package/esm/setters/SetRoute.d.ts +0 -23
- package/esm/setters/SetRoute.js +0 -11
- package/esm/setters/SetRoute.js.map +0 -1
- package/esm/setters/index.d.ts +0 -7
- package/esm/setters/index.js +0 -8
- package/esm/setters/index.js.map +0 -1
- package/esm/state/createActions.d.ts +0 -4
- package/esm/state/createActions.js +0 -27
- package/esm/state/createActions.js.map +0 -1
- package/esm/state/createGlobalState.d.ts +0 -2
- package/esm/state/createGlobalState.js +0 -19
- package/esm/state/createGlobalState.js.map +0 -1
- package/esm/state/index.d.ts +0 -4
- package/esm/state/index.js +0 -5
- package/esm/state/index.js.map +0 -1
- package/esm/state/stateContext.d.ts +0 -4
- package/esm/state/stateContext.js +0 -4
- package/esm/state/stateContext.js.map +0 -1
- package/esm/state/withApi.d.ts +0 -3
- package/esm/state/withApi.js +0 -30
- package/esm/state/withApi.js.map +0 -1
- package/esm/tools/codegen.d.ts +0 -23
- package/esm/tools/codegen.js +0 -194
- package/esm/tools/codegen.js.map +0 -1
- package/esm/tools/debugger.d.ts +0 -4
- package/esm/tools/debugger.js +0 -61
- package/esm/tools/debugger.js.map +0 -1
- package/esm/tools/emulator.d.ts +0 -4
- package/esm/tools/emulator.js +0 -12
- package/esm/tools/emulator.js.map +0 -1
- package/esm/types/api.d.ts +0 -141
- package/esm/types/api.js +0 -2
- package/esm/types/api.js.map +0 -1
- package/esm/types/common.d.ts +0 -21
- package/esm/types/common.js +0 -2
- package/esm/types/common.js.map +0 -1
- package/esm/types/components.d.ts +0 -250
- package/esm/types/components.js +0 -2
- package/esm/types/components.js.map +0 -1
- package/esm/types/config.d.ts +0 -94
- package/esm/types/config.js +0 -2
- package/esm/types/config.js.map +0 -1
- package/esm/types/custom.d.ts +0 -50
- package/esm/types/custom.js +0 -2
- package/esm/types/custom.js.map +0 -1
- package/esm/types/data.d.ts +0 -51
- package/esm/types/data.js +0 -2
- package/esm/types/data.js.map +0 -1
- package/esm/types/extension.d.ts +0 -61
- package/esm/types/extension.js +0 -2
- package/esm/types/extension.js.map +0 -1
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.js +0 -15
- package/esm/types/index.js.map +0 -1
- package/esm/types/instance.d.ts +0 -60
- package/esm/types/instance.js +0 -2
- package/esm/types/instance.js.map +0 -1
- package/esm/types/layout.d.ts +0 -12
- package/esm/types/layout.js +0 -2
- package/esm/types/layout.js.map +0 -1
- package/esm/types/navigation.d.ts +0 -98
- package/esm/types/navigation.js +0 -2
- package/esm/types/navigation.js.map +0 -1
- package/esm/types/plugin.d.ts +0 -14
- package/esm/types/plugin.js +0 -2
- package/esm/types/plugin.js.map +0 -1
- package/esm/types/state.d.ts +0 -346
- package/esm/types/state.js +0 -2
- package/esm/types/state.js.map +0 -1
- package/esm/types/utils.d.ts +0 -84
- package/esm/types/utils.js +0 -2
- package/esm/types/utils.js.map +0 -1
- package/esm/types/web.d.ts +0 -47
- package/esm/types/web.js +0 -2
- package/esm/types/web.js.map +0 -1
- package/esm/utils/compare.d.ts +0 -1
- package/esm/utils/compare.js +0 -42
- package/esm/utils/compare.js.map +0 -1
- package/esm/utils/data.d.ts +0 -4
- package/esm/utils/data.js +0 -39
- package/esm/utils/data.js.map +0 -1
- package/esm/utils/extension.d.ts +0 -16
- package/esm/utils/extension.js +0 -36
- package/esm/utils/extension.js.map +0 -1
- package/esm/utils/foreign.d.ts +0 -14
- package/esm/utils/foreign.js +0 -39
- package/esm/utils/foreign.js.map +0 -1
- package/esm/utils/guid.d.ts +0 -2
- package/esm/utils/guid.js +0 -12
- package/esm/utils/guid.js.map +0 -1
- package/esm/utils/helpers.d.ts +0 -16
- package/esm/utils/helpers.js +0 -76
- package/esm/utils/helpers.js.map +0 -1
- package/esm/utils/index.d.ts +0 -12
- package/esm/utils/index.js +0 -13
- package/esm/utils/index.js.map +0 -1
- package/esm/utils/media.d.ts +0 -4
- package/esm/utils/media.js +0 -12
- package/esm/utils/media.js.map +0 -1
- package/esm/utils/react.d.ts +0 -2
- package/esm/utils/react.js +0 -5
- package/esm/utils/react.js.map +0 -1
- package/esm/utils/routes.d.ts +0 -1
- package/esm/utils/routes.js +0 -5
- package/esm/utils/routes.js.map +0 -1
- package/esm/utils/state.d.ts +0 -57
- package/esm/utils/state.js +0 -113
- package/esm/utils/state.js.map +0 -1
- package/esm/utils/storage.d.ts +0 -3
- package/esm/utils/storage.js +0 -26
- package/esm/utils/storage.js.map +0 -1
- /package/{dist → lib}/codegen.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.7244",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -22,34 +22,20 @@
|
|
|
22
22
|
"author": "smapiot",
|
|
23
23
|
"homepage": "https://piral.io",
|
|
24
24
|
"license": "MIT",
|
|
25
|
-
"module": "
|
|
25
|
+
"module": "lib/index.js",
|
|
26
26
|
"main": "lib/index.js",
|
|
27
27
|
"typings": "lib/index.d.ts",
|
|
28
28
|
"exports": {
|
|
29
|
-
".":
|
|
30
|
-
"import": "./esm/index.js",
|
|
31
|
-
"require": "./lib/index.js",
|
|
32
|
-
"types": "./lib/index.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./esm/*": {
|
|
35
|
-
"import": "./esm/*",
|
|
36
|
-
"types": "./lib/*.d.ts"
|
|
37
|
-
},
|
|
29
|
+
".": "./lib/index.js",
|
|
38
30
|
"./lib/*": {
|
|
39
|
-
"
|
|
40
|
-
"types": "./lib/*.d.ts"
|
|
41
|
-
},
|
|
42
|
-
"./_/*": {
|
|
43
|
-
"import": "./esm/*.js",
|
|
44
|
-
"require": "./lib/*.js",
|
|
31
|
+
"import": "./lib/*",
|
|
45
32
|
"types": "./lib/*.d.ts"
|
|
46
33
|
},
|
|
34
|
+
"./app.codegen": "./app.codegen",
|
|
47
35
|
"./package.json": "./package.json"
|
|
48
36
|
},
|
|
49
37
|
"sideEffects": false,
|
|
50
38
|
"files": [
|
|
51
|
-
"dist",
|
|
52
|
-
"esm",
|
|
53
39
|
"lib",
|
|
54
40
|
"src",
|
|
55
41
|
"app.codegen",
|
|
@@ -68,17 +54,16 @@
|
|
|
68
54
|
},
|
|
69
55
|
"scripts": {
|
|
70
56
|
"cleanup": "rimraf dist esm lib",
|
|
71
|
-
"build": "yarn build:
|
|
72
|
-
"build:
|
|
73
|
-
"build:
|
|
74
|
-
"build:codegen": "esbuild src/tools/codegen.ts --bundle --outfile=dist/codegen.js --format=cjs --platform=node --external:pnpapi",
|
|
57
|
+
"build": "yarn build:esnext && yarn build:codegen",
|
|
58
|
+
"build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
|
|
59
|
+
"build:codegen": "esbuild src/tools/codegen.ts --bundle --outfile=lib/codegen.js --format=cjs --platform=node --external:pnpapi",
|
|
75
60
|
"typedoc": "typedoc --json ../../../docs/types/piral-core.json src --exclude \"src/**/*.test.*\"",
|
|
76
61
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
77
62
|
},
|
|
78
63
|
"dependencies": {
|
|
79
64
|
"path-to-regexp": "^1.8.0",
|
|
80
|
-
"piral-base": "1.6.0-beta.
|
|
81
|
-
"piral-debug-utils": "1.6.0-beta.
|
|
65
|
+
"piral-base": "1.6.0-beta.7244",
|
|
66
|
+
"piral-debug-utils": "1.6.0-beta.7244",
|
|
82
67
|
"zustand": "^3.0.0"
|
|
83
68
|
},
|
|
84
69
|
"devDependencies": {
|
|
@@ -98,5 +83,5 @@
|
|
|
98
83
|
"react-router-dom",
|
|
99
84
|
"tslib"
|
|
100
85
|
],
|
|
101
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "65ac1291c3429dbf16079b4deb6138b24c5719f7"
|
|
102
87
|
}
|
package/esm/Piral.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { PiralProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the Piral app shell frame. Use this component together
|
|
5
|
-
* with an existing instance to render the app shell.
|
|
6
|
-
* Includes layout and routing handling. Connects the Piral context
|
|
7
|
-
* and the React router to the generated views.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
```jsx
|
|
11
|
-
const app = (
|
|
12
|
-
<Piral instance={yourPiralInstance}>
|
|
13
|
-
<Define name="Layout" component={MyLayout} />
|
|
14
|
-
</Piral>
|
|
15
|
-
);
|
|
16
|
-
```
|
|
17
|
-
*/
|
|
18
|
-
export declare const Piral: React.FC<PiralProps>;
|
package/esm/Piral.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createInstance } from './createInstance';
|
|
3
|
-
import { PiralView, RegisteredRouter } from './components';
|
|
4
|
-
import { PiralContext } from './PiralContext';
|
|
5
|
-
/**
|
|
6
|
-
* Represents the Piral app shell frame. Use this component together
|
|
7
|
-
* with an existing instance to render the app shell.
|
|
8
|
-
* Includes layout and routing handling. Connects the Piral context
|
|
9
|
-
* and the React router to the generated views.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
```jsx
|
|
13
|
-
const app = (
|
|
14
|
-
<Piral instance={yourPiralInstance}>
|
|
15
|
-
<Define name="Layout" component={MyLayout} />
|
|
16
|
-
</Piral>
|
|
17
|
-
);
|
|
18
|
-
```
|
|
19
|
-
*/
|
|
20
|
-
export const Piral = ({ instance = createInstance(), breakpoints, children }) => (React.createElement(PiralContext, { instance: instance },
|
|
21
|
-
React.createElement(RegisteredRouter, { publicPath: instance.context.navigation.publicPath },
|
|
22
|
-
React.createElement(PiralView, { breakpoints: breakpoints }, children))));
|
|
23
|
-
Piral.displayName = 'Piral';
|
|
24
|
-
//# sourceMappingURL=Piral.js.map
|
package/esm/Piral.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Piral.js","sourceRoot":"","sources":["../src/Piral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAAE,QAAQ,GAAG,cAAc,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACrG,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ;IAC9B,oBAAC,gBAAgB,IAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU;QAClE,oBAAC,SAAS,IAAC,WAAW,EAAE,WAAW,IAAG,QAAQ,CAAa,CAC1C,CACN,CAChB,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
|
package/esm/PiralContext.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { PiralContextProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the Piral app shell frame. Use this component together
|
|
5
|
-
* with an existing instance to render components from micro frontends
|
|
6
|
-
* in your app.
|
|
7
|
-
* Wires the state container together with the global providers.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
```jsx
|
|
11
|
-
const app = (
|
|
12
|
-
<MyRouter>
|
|
13
|
-
<PiralContext instance={yourPiralInstance}>
|
|
14
|
-
<PiralGlobals />
|
|
15
|
-
<MyAppContent />
|
|
16
|
-
</PiralContext>
|
|
17
|
-
</MyRouter>
|
|
18
|
-
);
|
|
19
|
-
```
|
|
20
|
-
*/
|
|
21
|
-
export declare const PiralContext: React.FC<PiralContextProps>;
|
package/esm/PiralContext.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { StateContext } from './state';
|
|
3
|
-
import { createInstance } from './createInstance';
|
|
4
|
-
import { Mediator } from './components';
|
|
5
|
-
import { useGlobalState } from './hooks';
|
|
6
|
-
import { RootListener } from './RootListener';
|
|
7
|
-
const PiralProvider = ({ children }) => {
|
|
8
|
-
const Provider = useGlobalState((m) => m.provider || React.Fragment);
|
|
9
|
-
return React.createElement(Provider, null, children);
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Represents the Piral app shell frame. Use this component together
|
|
13
|
-
* with an existing instance to render components from micro frontends
|
|
14
|
-
* in your app.
|
|
15
|
-
* Wires the state container together with the global providers.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
```jsx
|
|
19
|
-
const app = (
|
|
20
|
-
<MyRouter>
|
|
21
|
-
<PiralContext instance={yourPiralInstance}>
|
|
22
|
-
<PiralGlobals />
|
|
23
|
-
<MyAppContent />
|
|
24
|
-
</PiralContext>
|
|
25
|
-
</MyRouter>
|
|
26
|
-
);
|
|
27
|
-
```
|
|
28
|
-
*/
|
|
29
|
-
export const PiralContext = ({ instance = createInstance(), children }) => (React.createElement(StateContext.Provider, { value: instance.context },
|
|
30
|
-
React.createElement(Mediator, { options: instance.options, key: instance.id }),
|
|
31
|
-
React.createElement(RootListener, null),
|
|
32
|
-
React.createElement(PiralProvider, null, children)));
|
|
33
|
-
PiralContext.displayName = 'PiralContext';
|
|
34
|
-
//# sourceMappingURL=PiralContext.js.map
|
package/esm/PiralContext.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PiralContext.js","sourceRoot":"","sources":["../src/PiralContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,MAAM,aAAa,GAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,oBAAC,QAAQ,QAAE,QAAQ,CAAY,CAAC;AACzC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,QAAQ,GAAG,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtG,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO;IAC5C,oBAAC,QAAQ,IAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAI;IACzD,oBAAC,YAAY,OAAG;IAChB,oBAAC,aAAa,QAAE,QAAQ,CAAiB,CACnB,CACzB,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
package/esm/RootListener.d.ts
DELETED
package/esm/RootListener.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createPortal } from 'react-dom';
|
|
3
|
-
import { useGlobalStateContext } from './hooks';
|
|
4
|
-
import { renderElement } from './modules';
|
|
5
|
-
const renderHtmlEvent = 'render-html';
|
|
6
|
-
const renderContentEvent = 'render-content';
|
|
7
|
-
const forwardEventEvent = 'forward-event';
|
|
8
|
-
export const RootListener = () => {
|
|
9
|
-
const context = useGlobalStateContext();
|
|
10
|
-
React.useLayoutEffect(() => {
|
|
11
|
-
if (typeof document !== 'undefined') {
|
|
12
|
-
const renderHtml = (ev) => {
|
|
13
|
-
ev.stopPropagation();
|
|
14
|
-
const { target, props } = ev.detail;
|
|
15
|
-
const [dispose, update] = renderElement(context, target, props);
|
|
16
|
-
target.dispose = dispose;
|
|
17
|
-
target.update = update;
|
|
18
|
-
};
|
|
19
|
-
const renderContent = (ev) => {
|
|
20
|
-
ev.stopPropagation();
|
|
21
|
-
const { target, content, portalId } = ev.detail;
|
|
22
|
-
const portal = createPortal(content, target);
|
|
23
|
-
const dispose = () => context.hidePortal(portalId, portal);
|
|
24
|
-
context.showPortal(portalId, portal);
|
|
25
|
-
target.dispose = dispose;
|
|
26
|
-
};
|
|
27
|
-
const forwardEvent = (ev) => {
|
|
28
|
-
ev.stopPropagation();
|
|
29
|
-
const { type, args } = ev.detail;
|
|
30
|
-
context.emit(type, args);
|
|
31
|
-
};
|
|
32
|
-
document.body.addEventListener(renderHtmlEvent, renderHtml, false);
|
|
33
|
-
document.body.addEventListener(forwardEventEvent, forwardEvent, false);
|
|
34
|
-
window.addEventListener(renderContentEvent, renderContent, false);
|
|
35
|
-
return () => {
|
|
36
|
-
document.body.removeEventListener(renderHtmlEvent, renderHtml, false);
|
|
37
|
-
document.body.removeEventListener(forwardEventEvent, forwardEvent, false);
|
|
38
|
-
window.removeEventListener(renderContentEvent, renderContent, false);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}, [context]);
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=RootListener.js.map
|
package/esm/RootListener.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RootListener.js","sourceRoot":"","sources":["../src/RootListener.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,eAAe,GAAG,aAAa,CAAC;AACtC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IAExC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;YACnC,MAAM,UAAU,GAAG,CAAC,EAAe,EAAE,EAAE;gBACrC,EAAE,CAAC,eAAe,EAAE,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC;gBACpC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBAChE,MA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AAE,KAAK,CAAC,CAAC;gBAC1E,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;YACvE,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/esm/actions/app.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router';
|
|
3
|
-
import { ComponentsState, ErrorComponentsState, GlobalStateContext, Pilet, PiletEntry } from '../types';
|
|
4
|
-
export declare function initialize(ctx: GlobalStateContext, loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
|
|
5
|
-
export declare function addPilet(ctx: GlobalStateContext, meta: PiletEntry): Promise<void>;
|
|
6
|
-
export declare function removePilet(ctx: GlobalStateContext, name: string): Promise<void>;
|
|
7
|
-
export declare function injectPilet(ctx: GlobalStateContext, pilet: Pilet): Pilet;
|
|
8
|
-
export declare function setComponent<TKey extends keyof ComponentsState>(ctx: GlobalStateContext, name: TKey, component: ComponentsState[TKey]): void;
|
|
9
|
-
export declare function setErrorComponent<TKey extends keyof ErrorComponentsState>(ctx: GlobalStateContext, type: TKey, component: ErrorComponentsState[TKey]): void;
|
|
10
|
-
export declare function setRoute<T extends {
|
|
11
|
-
[K in keyof T]?: string;
|
|
12
|
-
} = {}>(ctx: GlobalStateContext, path: string, component: ComponentType<RouteComponentProps<T>>): void;
|
|
13
|
-
export declare function includeProvider(ctx: GlobalStateContext, provider: JSX.Element): void;
|
package/esm/actions/app.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { runPilet } from 'piral-base';
|
|
2
|
-
import { withKey, replaceOrAddItem, removeNested, withProvider, withRoute, noop } from '../utils';
|
|
3
|
-
export function initialize(ctx, loading, error, modules) {
|
|
4
|
-
ctx.dispatch((state) => ({
|
|
5
|
-
...state,
|
|
6
|
-
app: {
|
|
7
|
-
...state.app,
|
|
8
|
-
error,
|
|
9
|
-
loading,
|
|
10
|
-
},
|
|
11
|
-
modules,
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
export function addPilet(ctx, meta) {
|
|
15
|
-
return ctx.options
|
|
16
|
-
.loadPilet(meta)
|
|
17
|
-
.then((pilet) => ctx.injectPilet(pilet))
|
|
18
|
-
.then((pilet) => runPilet(ctx.options.createApi, pilet, ctx.options.hooks))
|
|
19
|
-
.then(noop);
|
|
20
|
-
}
|
|
21
|
-
export function removePilet(ctx, name) {
|
|
22
|
-
ctx.dispatch((state) => ({
|
|
23
|
-
...state,
|
|
24
|
-
modules: state.modules.filter((m) => m.name !== name),
|
|
25
|
-
registry: removeNested(state.registry, (m) => m.pilet === name),
|
|
26
|
-
}));
|
|
27
|
-
ctx.emit('unload-pilet', {
|
|
28
|
-
name,
|
|
29
|
-
});
|
|
30
|
-
return Promise.resolve();
|
|
31
|
-
}
|
|
32
|
-
export function injectPilet(ctx, pilet) {
|
|
33
|
-
ctx.dispatch((state) => ({
|
|
34
|
-
...state,
|
|
35
|
-
modules: replaceOrAddItem(state.modules, pilet, (m) => m.name === pilet.name),
|
|
36
|
-
registry: removeNested(state.registry, (m) => m.pilet === pilet.name),
|
|
37
|
-
}));
|
|
38
|
-
ctx.emit('unload-pilet', {
|
|
39
|
-
name: pilet.name,
|
|
40
|
-
});
|
|
41
|
-
return pilet;
|
|
42
|
-
}
|
|
43
|
-
export function setComponent(ctx, name, component) {
|
|
44
|
-
ctx.dispatch((state) => ({
|
|
45
|
-
...state,
|
|
46
|
-
components: withKey(state.components, name, component),
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
export function setErrorComponent(ctx, type, component) {
|
|
50
|
-
ctx.dispatch((state) => ({
|
|
51
|
-
...state,
|
|
52
|
-
errorComponents: withKey(state.errorComponents, type, component),
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
export function setRoute(ctx, path, component) {
|
|
56
|
-
ctx.dispatch(withRoute(path, component));
|
|
57
|
-
}
|
|
58
|
-
export function includeProvider(ctx, provider) {
|
|
59
|
-
ctx.dispatch(withProvider(provider));
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=app.js.map
|
package/esm/actions/app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/actions/app.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAWlG,MAAM,UAAU,UAAU,CAAC,GAAuB,EAAE,OAAgB,EAAE,KAAwB,EAAE,OAAqB;IACnH,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,GAAG,EAAE;YACH,GAAG,KAAK,CAAC,GAAG;YACZ,KAAK;YACL,OAAO;SACR;QACD,OAAO;KACR,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAuB,EAAE,IAAgB;IAChE,OAAO,GAAG,CAAC,OAAO;SACf,SAAS,CAAC,IAAI,CAAC;SACf,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACvC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC1E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAuB,EAAE,IAAY;IAC/D,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE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AAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,GAAuB,EACvB,IAAU,EACV,SAAqC;IAErC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC;KACjE,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,GAAuB,EACvB,IAAY,EACZ,SAAgD;IAEhD,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAuB,EAAE,QAAqB;IAC5E,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PageRegistration, ExtensionRegistration, GlobalStateContext } from '../types';
|
|
2
|
-
export declare function registerPage(ctx: GlobalStateContext, name: string, value: PageRegistration): void;
|
|
3
|
-
export declare function unregisterPage(ctx: GlobalStateContext, name: string): void;
|
|
4
|
-
export declare function registerExtension(ctx: GlobalStateContext, name: string, value: ExtensionRegistration): void;
|
|
5
|
-
export declare function unregisterExtension(ctx: GlobalStateContext, name: string, reference: any): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { withExtension, withoutExtension, withoutPage, withPage } from '../utils';
|
|
2
|
-
export function registerPage(ctx, name, value) {
|
|
3
|
-
ctx.dispatch(withPage(name, value));
|
|
4
|
-
}
|
|
5
|
-
export function unregisterPage(ctx, name) {
|
|
6
|
-
ctx.dispatch(withoutPage(name));
|
|
7
|
-
}
|
|
8
|
-
export function registerExtension(ctx, name, value) {
|
|
9
|
-
ctx.dispatch(withExtension(name, value));
|
|
10
|
-
}
|
|
11
|
-
export function unregisterExtension(ctx, name, reference) {
|
|
12
|
-
ctx.dispatch(withoutExtension(name, reference));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=components.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/actions/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGlF,MAAM,UAAU,YAAY,CAAC,GAAuB,EAAE,IAAY,EAAE,KAAuB;IACzF,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAuB,EAAE,IAAY;IAClE,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAuB,EAAE,IAAY,EAAE,KAA4B;IACnG,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAuB,EAAE,IAAY,EAAE,SAAc;IACvF,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
package/esm/actions/data.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DataStoreTarget, GlobalStateContext } from '../types';
|
|
2
|
-
export declare function resetData(ctx: GlobalStateContext): void;
|
|
3
|
-
export declare function readDataItem(ctx: GlobalStateContext, key: string): import("../types").SharedDataItem<any>;
|
|
4
|
-
export declare function readDataValue(ctx: GlobalStateContext, key: string): any;
|
|
5
|
-
export declare function writeDataItem(ctx: GlobalStateContext, key: string, value: any, owner: string, target: DataStoreTarget, expires: number): void;
|
|
6
|
-
export declare function tryWriteDataItem(ctx: GlobalStateContext, key: string, value: any, owner: string, target: DataStoreTarget, expires: number): boolean;
|
package/esm/actions/data.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { updateKey } from '../utils';
|
|
2
|
-
export function resetData(ctx) {
|
|
3
|
-
ctx.dispatch((state) => ({
|
|
4
|
-
...state,
|
|
5
|
-
data: {},
|
|
6
|
-
}));
|
|
7
|
-
}
|
|
8
|
-
export function readDataItem(ctx, key) {
|
|
9
|
-
return ctx.readState((state) => state.data[key]);
|
|
10
|
-
}
|
|
11
|
-
export function readDataValue(ctx, key) {
|
|
12
|
-
const item = readDataItem(ctx, key);
|
|
13
|
-
return item && item.value;
|
|
14
|
-
}
|
|
15
|
-
export function writeDataItem(ctx, key, value, owner, target, expires) {
|
|
16
|
-
const isNull = !value && typeof value === 'object';
|
|
17
|
-
const data = isNull
|
|
18
|
-
? value
|
|
19
|
-
: {
|
|
20
|
-
value,
|
|
21
|
-
owner,
|
|
22
|
-
target,
|
|
23
|
-
expires,
|
|
24
|
-
};
|
|
25
|
-
ctx.dispatch((state) => ({
|
|
26
|
-
...state,
|
|
27
|
-
data: updateKey(state.data, key, data),
|
|
28
|
-
}));
|
|
29
|
-
ctx.emit('store-data', {
|
|
30
|
-
name: key,
|
|
31
|
-
target,
|
|
32
|
-
value,
|
|
33
|
-
owner,
|
|
34
|
-
expires,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
export function tryWriteDataItem(ctx, key, value, owner, target, expires) {
|
|
38
|
-
const item = readDataItem(ctx, key);
|
|
39
|
-
if (item && item.owner !== owner) {
|
|
40
|
-
console.error(`Invalid data write to '${key}'. This item currently belongs to '${item.owner}' (write attempted from '${owner}'). The action has been ignored.`);
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
writeDataItem(ctx, key, value, owner, target, expires);
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=data.js.map
|
package/esm/actions/data.js.map
DELETED
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;QACN,KAAK;QACL,KAAK;QACL,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,GAAuB,EACvB,GAAW,EACX,KAAU,EACV,KAAa,EACb,MAAuB,EACvB,OAAe;IAEf,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAEpC,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;QAChC,OAAO,CAAC,KAAK,CACX,0BAA0B,GAAG,sCAAsC,IAAI,CAAC,KAAK,4BAA4B,KAAK,kCAAkC,CACjJ,CAAC;QACF,OAAO,KAAK,CAAC;KACd;IAED,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/esm/actions/define.d.ts
DELETED
package/esm/actions/define.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function defineAction(ctx, actionName, action) {
|
|
2
|
-
ctx[actionName] = action.bind(ctx, ctx);
|
|
3
|
-
}
|
|
4
|
-
export function defineActions(ctx, actions) {
|
|
5
|
-
for (const actionName of Object.keys(actions)) {
|
|
6
|
-
const action = actions[actionName];
|
|
7
|
-
defineAction(ctx, actionName, action);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=define.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/actions/define.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAAuB,EAAE,UAAkB,EAAE,MAAW;IACnF,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,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"}
|
package/esm/actions/index.d.ts
DELETED
package/esm/actions/index.js
DELETED
package/esm/actions/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/esm/actions/portal.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ReactPortal } from 'react';
|
|
2
|
-
import { GlobalStateContext } from '../types';
|
|
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;
|
|
6
|
-
export declare function showPortal(ctx: GlobalStateContext, id: string, entry: ReactPortal): void;
|
package/esm/actions/portal.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { withoutKey, withKey, includeItem, excludeItem, replaceOrAddItem } from '../utils';
|
|
2
|
-
export function destroyPortal(ctx, id) {
|
|
3
|
-
ctx.dispatch((state) => ({
|
|
4
|
-
...state,
|
|
5
|
-
portals: withoutKey(state.portals, id),
|
|
6
|
-
}));
|
|
7
|
-
}
|
|
8
|
-
export function hidePortal(ctx, id, entry) {
|
|
9
|
-
ctx.dispatch((state) => ({
|
|
10
|
-
...state,
|
|
11
|
-
portals: withKey(state.portals, id, excludeItem(state.portals[id], entry)),
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
export function updatePortal(ctx, id, current, next) {
|
|
15
|
-
ctx.dispatch((state) => ({
|
|
16
|
-
...state,
|
|
17
|
-
portals: withKey(state.portals, id, replaceOrAddItem(state.portals[id], next, (m) => m === current)),
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
export function showPortal(ctx, id, entry) {
|
|
21
|
-
ctx.dispatch((state) => ({
|
|
22
|
-
...state,
|
|
23
|
-
portals: withKey(state.portals, id, includeItem(state.portals[id], entry)),
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=portal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../src/actions/portal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG3F,MAAM,UAAU,aAAa,CAAC,GAAuB,EAAE,EAAU;IAC/D,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;KACvC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAuB,EAAE,EAAU,EAAE,KAAkB;IAChF,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3E,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAuB,EAAE,EAAU,EAAE,OAAoB,EAAE,IAAiB;IACvG,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,OAAO,EAAE,OAAO,CACd,KAAK,CAAC,OAAO,EACb,EAAE,EACF,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAChE;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAuB,EAAE,EAAU,EAAE,KAAkB;IAChF,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvB,GAAG,KAAK;QACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KAC3E,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/esm/actions/state.d.ts
DELETED
package/esm/actions/state.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isSame } from '../utils';
|
|
2
|
-
export function dispatch(ctx, update) {
|
|
3
|
-
const oldState = ctx.state.getState();
|
|
4
|
-
const newState = update(oldState);
|
|
5
|
-
if (!isSame(oldState, newState)) {
|
|
6
|
-
ctx.state.setState(newState);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export function readState(ctx, read) {
|
|
10
|
-
return read(ctx.state.getState());
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=state.js.map
|
package/esm/actions/state.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/actions/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,MAAM,UAAU,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,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;QAC/B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC9B;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,GAAuB,EAAE,IAA+B;IACnF,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Errors, PiletApi } from '../types';
|
|
3
|
-
export interface ErrorBoundaryProps {
|
|
4
|
-
/**
|
|
5
|
-
* The type of error to indicate when caught.
|
|
6
|
-
*/
|
|
7
|
-
errorType: keyof Errors;
|
|
8
|
-
/**
|
|
9
|
-
* The associated pilet api for the metadata.
|
|
10
|
-
*/
|
|
11
|
-
piral: PiletApi;
|
|
12
|
-
/**
|
|
13
|
-
* The content to render (i.e., where to apply the boundary to).
|
|
14
|
-
*/
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export interface ErrorBoundaryState {
|
|
18
|
-
/**
|
|
19
|
-
* The current error (if any) caught by the boundary.
|
|
20
|
-
*/
|
|
21
|
-
error?: Error;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The component for catching errors and displaying error information.
|
|
25
|
-
*/
|
|
26
|
-
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
27
|
-
state: {
|
|
28
|
-
error: any;
|
|
29
|
-
};
|
|
30
|
-
componentDidCatch(error: Error): void;
|
|
31
|
-
componentDidUpdate(_: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
|
|
32
|
-
render(): React.JSX.Element;
|
|
33
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { findDOMNode } from 'react-dom';
|
|
3
|
-
import { RegisteredErrorInfo, RegisteredLoadingIndicator } from './components';
|
|
4
|
-
import { defer } from '../utils';
|
|
5
|
-
/**
|
|
6
|
-
* The component for catching errors and displaying error information.
|
|
7
|
-
*/
|
|
8
|
-
export class ErrorBoundary extends React.Component {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.state = {
|
|
12
|
-
error: undefined,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
componentDidCatch(error) {
|
|
16
|
-
const { piral, errorType } = this.props;
|
|
17
|
-
const pilet = piral.meta.name;
|
|
18
|
-
console.error(`[${pilet}] Exception in component of type "${errorType}".`, error);
|
|
19
|
-
this.setState({
|
|
20
|
-
error,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
componentDidUpdate(_, prevState) {
|
|
24
|
-
const { error } = this.state;
|
|
25
|
-
if (error && !prevState.error) {
|
|
26
|
-
const { piral, errorType } = this.props;
|
|
27
|
-
const pilet = piral.meta.name;
|
|
28
|
-
defer(() => {
|
|
29
|
-
const container = findDOMNode(this);
|
|
30
|
-
piral.emit('unhandled-error', {
|
|
31
|
-
container,
|
|
32
|
-
errorType,
|
|
33
|
-
error,
|
|
34
|
-
pilet,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
const { children, piral, errorType, ...renderProps } = this.props;
|
|
41
|
-
const { error } = this.state;
|
|
42
|
-
const rest = renderProps;
|
|
43
|
-
if (error) {
|
|
44
|
-
const pilet = piral.meta.name;
|
|
45
|
-
return React.createElement(RegisteredErrorInfo, { type: errorType, error: error, pilet: pilet, ...rest });
|
|
46
|
-
}
|
|
47
|
-
return React.createElement(React.Suspense, { fallback: React.createElement(RegisteredLoadingIndicator, null) }, children);
|
|
48
|
-
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AAI,CAAC,iBAAiB,EAAE;oBAC5B,SAAS;oBACT,SAAS;oBACT,KAAK;oBACL,KAAK;iBACN,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,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,mBAAmB,IAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAM,IAAI,GAAI,CAAC;SACvF;QAED,OAAO,oBAAC,KAAK,CAAC,QAAQ,IAAC,QAAQ,EAAE,oBAAC,0BAA0B,OAAG,IAAG,QAAQ,CAAkB,CAAC;IAC/F,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ExtensionSlotProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* The extension slot component to be used when the available
|
|
5
|
-
* extensions of a given name should be rendered at a specific
|
|
6
|
-
* location.
|
|
7
|
-
*/
|
|
8
|
-
export declare function ExtensionSlot<T extends string>(props: ExtensionSlotProps<T>): React.JSX.Element;
|
|
9
|
-
export declare namespace ExtensionSlot {
|
|
10
|
-
var displayName: string;
|
|
11
|
-
}
|