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/esm/types/extension.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import type { PiralCustomExtensionSlotMap } from './custom';
|
|
3
|
-
import type { ExtensionRegistration } from './state';
|
|
4
|
-
/**
|
|
5
|
-
* The mapping of the existing (known) extension slots.
|
|
6
|
-
*/
|
|
7
|
-
export interface PiralExtensionSlotMap extends PiralCustomExtensionSlotMap {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* The basic props for defining an extension slot.
|
|
11
|
-
*/
|
|
12
|
-
export interface BaseExtensionSlotProps<TName, TParams> {
|
|
13
|
-
/**
|
|
14
|
-
* The children to transport, if any.
|
|
15
|
-
*/
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Defines what should be rendered when no components are available
|
|
19
|
-
* for the specified extension.
|
|
20
|
-
*/
|
|
21
|
-
empty?(props: TParams): ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Determines if the `render` function should be called in case no
|
|
24
|
-
* components are available for the specified extension.
|
|
25
|
-
*
|
|
26
|
-
* If true, `empty` will be called and returned from the slot.
|
|
27
|
-
* If false, `render` will be called with the result of calling `empty`.
|
|
28
|
-
* The result of calling `render` will then be returned from the slot.
|
|
29
|
-
*/
|
|
30
|
-
emptySkipsRender?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Defines the order of the components to render.
|
|
33
|
-
* May be more convient than using `render` w.r.t. ordering extensions
|
|
34
|
-
* by their supplied metadata.
|
|
35
|
-
* @param extensions The registered extensions.
|
|
36
|
-
* @returns The ordered extensions.
|
|
37
|
-
*/
|
|
38
|
-
order?(extensions: Array<ExtensionRegistration>): Array<ExtensionRegistration>;
|
|
39
|
-
/**
|
|
40
|
-
* Defines how the provided nodes should be rendered.
|
|
41
|
-
* @param nodes The rendered extension nodes.
|
|
42
|
-
* @returns The rendered nodes, i.e., an ReactElement.
|
|
43
|
-
*/
|
|
44
|
-
render?(nodes: Array<ReactNode>): ReactElement<any, any> | null;
|
|
45
|
-
/**
|
|
46
|
-
* The custom parameters for the given extension.
|
|
47
|
-
*/
|
|
48
|
-
params?: TParams;
|
|
49
|
-
/**
|
|
50
|
-
* The name of the extension to render.
|
|
51
|
-
*/
|
|
52
|
-
name: TName;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gives the extension params shape for the given extension slot name.
|
|
56
|
-
*/
|
|
57
|
-
export type ExtensionParams<TName> = TName extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[TName] : TName extends string ? any : TName;
|
|
58
|
-
/**
|
|
59
|
-
* The props for defining an extension slot.
|
|
60
|
-
*/
|
|
61
|
-
export type ExtensionSlotProps<TName = string> = BaseExtensionSlotProps<TName extends string ? TName : string, ExtensionParams<TName>>;
|
package/esm/types/extension.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/types/extension.ts"],"names":[],"mappings":""}
|
package/esm/types/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export * from './common';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export * from './config';
|
|
5
|
-
export * from './custom';
|
|
6
|
-
export * from './data';
|
|
7
|
-
export * from './extension';
|
|
8
|
-
export * from './instance';
|
|
9
|
-
export * from './layout';
|
|
10
|
-
export * from './navigation';
|
|
11
|
-
export * from './plugin';
|
|
12
|
-
export * from './state';
|
|
13
|
-
export * from './utils';
|
|
14
|
-
export * from './web';
|
package/esm/types/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export * from './common';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export * from './config';
|
|
5
|
-
export * from './custom';
|
|
6
|
-
export * from './data';
|
|
7
|
-
export * from './extension';
|
|
8
|
-
export * from './instance';
|
|
9
|
-
export * from './layout';
|
|
10
|
-
export * from './navigation';
|
|
11
|
-
export * from './plugin';
|
|
12
|
-
export * from './state';
|
|
13
|
-
export * from './utils';
|
|
14
|
-
export * from './web';
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/esm/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
package/esm/types/instance.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { PiletApi, PiletApiCreator, LoadPiletsOptions, EventEmitter } from 'piral-base';
|
|
3
|
-
import type { GlobalStateContext } from './state';
|
|
4
|
-
import type { LayoutBreakpoints } from './layout';
|
|
5
|
-
import type { PiralConfiguration } from './config';
|
|
6
|
-
/**
|
|
7
|
-
* The props of the Piral context.
|
|
8
|
-
*/
|
|
9
|
-
export interface PiralContextProps {
|
|
10
|
-
/**
|
|
11
|
-
* The specific Piral instance to be used.
|
|
12
|
-
*/
|
|
13
|
-
instance?: PiralInstance;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The props of the Piral component.
|
|
18
|
-
*/
|
|
19
|
-
export interface PiralProps extends PiralContextProps {
|
|
20
|
-
/**
|
|
21
|
-
* The custom breakpoints for the different layout modi.
|
|
22
|
-
*/
|
|
23
|
-
breakpoints?: LayoutBreakpoints;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The options for creating a new PiralInstance object.
|
|
27
|
-
*/
|
|
28
|
-
export interface PiralInstanceOptions extends PiralConfiguration {
|
|
29
|
-
/**
|
|
30
|
-
* Defines the id of this instance. Used in case of multiple instances.
|
|
31
|
-
*/
|
|
32
|
-
id?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* The PiralInstance object, which is an event emitter with some other
|
|
36
|
-
* utilities and helper. This object is the source for the React
|
|
37
|
-
* functional component (`Piral`).
|
|
38
|
-
*/
|
|
39
|
-
export interface PiralInstance extends EventEmitter {
|
|
40
|
-
/**
|
|
41
|
-
* The id of the Piral instance.
|
|
42
|
-
*/
|
|
43
|
-
id: string;
|
|
44
|
-
/**
|
|
45
|
-
* The global state context instance.
|
|
46
|
-
*/
|
|
47
|
-
context: GlobalStateContext;
|
|
48
|
-
/**
|
|
49
|
-
* The pilet API creator callback.
|
|
50
|
-
*/
|
|
51
|
-
createApi: PiletApiCreator;
|
|
52
|
-
/**
|
|
53
|
-
* The used options for loading pilets.
|
|
54
|
-
*/
|
|
55
|
-
options: LoadPiletsOptions;
|
|
56
|
-
/**
|
|
57
|
-
* The root pilet for using the pilet API within the Piral instance.
|
|
58
|
-
*/
|
|
59
|
-
root: PiletApi;
|
|
60
|
-
}
|
package/esm/types/instance.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/types/instance.ts"],"names":[],"mappings":""}
|
package/esm/types/layout.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The mapping of breakpoints to layout type index.
|
|
3
|
-
*/
|
|
4
|
-
export type LayoutBreakpoints = [string, string, string];
|
|
5
|
-
/**
|
|
6
|
-
* The different known layout types.
|
|
7
|
-
*/
|
|
8
|
-
export type LayoutType = 'mobile' | 'tablet' | 'desktop';
|
|
9
|
-
/**
|
|
10
|
-
* The mapping of the layout types to breakpoint index.
|
|
11
|
-
*/
|
|
12
|
-
export type LayoutTypes = [LayoutType, LayoutType, LayoutType];
|
package/esm/types/layout.js
DELETED
package/esm/types/layout.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":""}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { Disposable } from './utils';
|
|
2
|
-
export type NavigationAction = 'POP' | 'PUSH' | 'REPLACE';
|
|
3
|
-
export interface NavigationLocation {
|
|
4
|
-
/**
|
|
5
|
-
* The fully qualified URL incl. the origin and base path.
|
|
6
|
-
*/
|
|
7
|
-
href: string;
|
|
8
|
-
/**
|
|
9
|
-
* The location.pathname property is a string that contains an initial "/"
|
|
10
|
-
* followed by the remainder of the URL up to the ?.
|
|
11
|
-
*/
|
|
12
|
-
pathname: string;
|
|
13
|
-
/**
|
|
14
|
-
* The location.search property is a string that contains an initial "?"
|
|
15
|
-
* followed by the key=value pairs in the query string. If there are no
|
|
16
|
-
* parameters, this value may be the empty string (i.e. '').
|
|
17
|
-
*/
|
|
18
|
-
search: string;
|
|
19
|
-
/**
|
|
20
|
-
* The location.hash property is a string that contains an initial "#"
|
|
21
|
-
* followed by fragment identifier of the URL. If there is no fragment
|
|
22
|
-
* identifier, this value may be the empty string (i.e. '').
|
|
23
|
-
*/
|
|
24
|
-
hash: string;
|
|
25
|
-
/**
|
|
26
|
-
* The location.state property is a user-supplied State object that is
|
|
27
|
-
* associated with this location. This can be a useful place to store
|
|
28
|
-
* any information you do not want to put in the URL, e.g. session-specific
|
|
29
|
-
* data.
|
|
30
|
-
*/
|
|
31
|
-
state: unknown;
|
|
32
|
-
/**
|
|
33
|
-
* The location.key property is a unique string associated with this location.
|
|
34
|
-
* On the initial location, this will be the string default. On all subsequent
|
|
35
|
-
* locations, this string will be a unique identifier.
|
|
36
|
-
*/
|
|
37
|
-
key?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface NavigationListener {
|
|
40
|
-
(update: NavigationUpdate): void;
|
|
41
|
-
}
|
|
42
|
-
export interface NavigationBlocker {
|
|
43
|
-
(tx: NavigationTransition): void;
|
|
44
|
-
}
|
|
45
|
-
export interface NavigationUpdate {
|
|
46
|
-
action: NavigationAction;
|
|
47
|
-
location: NavigationLocation;
|
|
48
|
-
}
|
|
49
|
-
export interface NavigationTransition extends NavigationUpdate {
|
|
50
|
-
retry?(): void;
|
|
51
|
-
}
|
|
52
|
-
export interface NavigationApi {
|
|
53
|
-
/**
|
|
54
|
-
* Pushes a new location onto the history stack.
|
|
55
|
-
*/
|
|
56
|
-
push(target: string, state?: any): void;
|
|
57
|
-
/**
|
|
58
|
-
* Replaces the current location with another.
|
|
59
|
-
*/
|
|
60
|
-
replace(target: string, state?: any): void;
|
|
61
|
-
/**
|
|
62
|
-
* Changes the current index in the history stack by a given delta.
|
|
63
|
-
*/
|
|
64
|
-
go(n: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Prevents changes to the history stack from happening.
|
|
67
|
-
* This is useful when you want to prevent the user navigating
|
|
68
|
-
* away from the current page, for example when they have some
|
|
69
|
-
* unsaved data on the current page.
|
|
70
|
-
* @param blocker The function being called with a transition request.
|
|
71
|
-
* @returns The disposable for stopping the block.
|
|
72
|
-
*/
|
|
73
|
-
block(blocker: NavigationBlocker): Disposable;
|
|
74
|
-
/**
|
|
75
|
-
* Starts listening for location changes and calls the given
|
|
76
|
-
* callback with an Update when it does.
|
|
77
|
-
* @param listener The function being called when the route changes.
|
|
78
|
-
* @returns The disposable for stopping the block.
|
|
79
|
-
*/
|
|
80
|
-
listen(listener: NavigationListener): Disposable;
|
|
81
|
-
/**
|
|
82
|
-
* Gets the current navigation / application path.
|
|
83
|
-
*/
|
|
84
|
-
path: string;
|
|
85
|
-
/**
|
|
86
|
-
* Gets the current navigation path incl. search and hash parts.
|
|
87
|
-
*/
|
|
88
|
-
url: string;
|
|
89
|
-
/**
|
|
90
|
-
* The original router behind the navigation. Don't depend on this
|
|
91
|
-
* as the implementation is router specific and may change over time.
|
|
92
|
-
*/
|
|
93
|
-
router: any;
|
|
94
|
-
/**
|
|
95
|
-
* Gets the public path of the application.
|
|
96
|
-
*/
|
|
97
|
-
publicPath: string;
|
|
98
|
-
}
|
package/esm/types/navigation.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":""}
|
package/esm/types/plugin.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PiletApiExtender } from 'piral-base';
|
|
2
|
-
import type { PiletApi } from './api';
|
|
3
|
-
import type { GlobalStateContext } from './state';
|
|
4
|
-
/**
|
|
5
|
-
* Shape to be used by a plugin used in the Piral instance.
|
|
6
|
-
*/
|
|
7
|
-
export interface PiralPlugin<T = Partial<PiletApi>> {
|
|
8
|
-
/**
|
|
9
|
-
* Extends the base API with a custom set of functionality to be used by modules.
|
|
10
|
-
* @param context The global state context to be used.
|
|
11
|
-
* @returns The extended API or a function to create the extended API for a specific target.
|
|
12
|
-
*/
|
|
13
|
-
(context: GlobalStateContext): T | PiletApiExtender<T>;
|
|
14
|
-
}
|
package/esm/types/plugin.js
DELETED
package/esm/types/plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":""}
|
package/esm/types/state.d.ts
DELETED
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, ReactPortal, PropsWithChildren } from 'react';
|
|
2
|
-
import type { RouteComponentProps } from 'react-router';
|
|
3
|
-
import type { LoadPiletsOptions } from 'piral-base';
|
|
4
|
-
import type { UseBoundStore } from 'zustand';
|
|
5
|
-
import type { Dict, Without } from './common';
|
|
6
|
-
import type { NavigationApi } from './navigation';
|
|
7
|
-
import type { SharedDataItem, DataStoreTarget } from './data';
|
|
8
|
-
import type { PiralCustomActions, PiralCustomState, PiralCustomRegistryState, PiralCustomComponentsState } from './custom';
|
|
9
|
-
import type { EventEmitter, Pilet, BaseComponentProps, PageComponentProps, ExtensionComponentProps, PiletsBag, PiletEntry } from './api';
|
|
10
|
-
import type { PiralPageMeta, ComponentConverters, LoadingIndicatorProps, ErrorInfoProps, RouterProps, LayoutProps, Errors, RouteSwitchProps } from './components';
|
|
11
|
-
export interface StateDispatcher<TState> {
|
|
12
|
-
(state: TState): Partial<TState>;
|
|
13
|
-
}
|
|
14
|
-
export type WrappedComponent<TProps> = ComponentType<PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
15
|
-
/**
|
|
16
|
-
* The base type for pilet component registration in the global state context.
|
|
17
|
-
*/
|
|
18
|
-
export interface BaseRegistration {
|
|
19
|
-
/**
|
|
20
|
-
* The pilet registering the component.
|
|
21
|
-
*/
|
|
22
|
-
pilet: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The interface modeling the registration of a pilet page component.
|
|
26
|
-
*/
|
|
27
|
-
export interface PageRegistration extends BaseRegistration {
|
|
28
|
-
/**
|
|
29
|
-
* The registered page component.
|
|
30
|
-
*/
|
|
31
|
-
component: WrappedComponent<PageComponentProps>;
|
|
32
|
-
/**
|
|
33
|
-
* The page's associated metadata.
|
|
34
|
-
*/
|
|
35
|
-
meta: PiralPageMeta;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The interface modeling the registration of a pilet extension component.
|
|
39
|
-
*/
|
|
40
|
-
export interface ExtensionRegistration extends BaseRegistration {
|
|
41
|
-
/**
|
|
42
|
-
* The wrapped registered extension component.
|
|
43
|
-
*/
|
|
44
|
-
component: WrappedComponent<ExtensionComponentProps<string>>;
|
|
45
|
-
/**
|
|
46
|
-
* The original extension component that has been registered.
|
|
47
|
-
*/
|
|
48
|
-
reference: any;
|
|
49
|
-
/**
|
|
50
|
-
* The default params (i.e., meta) of the extension.
|
|
51
|
-
*/
|
|
52
|
-
defaults: any;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The Piral global app sub-state container for shared components.
|
|
56
|
-
*/
|
|
57
|
-
export interface ComponentsState extends PiralCustomComponentsState {
|
|
58
|
-
/**
|
|
59
|
-
* The loading indicator renderer.
|
|
60
|
-
*/
|
|
61
|
-
LoadingIndicator: ComponentType<LoadingIndicatorProps>;
|
|
62
|
-
/**
|
|
63
|
-
* The error renderer.
|
|
64
|
-
*/
|
|
65
|
-
ErrorInfo: ComponentType<ErrorInfoProps>;
|
|
66
|
-
/**
|
|
67
|
-
* The router context.
|
|
68
|
-
*/
|
|
69
|
-
Router: ComponentType<RouterProps>;
|
|
70
|
-
/**
|
|
71
|
-
* The layout used for pages.
|
|
72
|
-
*/
|
|
73
|
-
Layout: ComponentType<LayoutProps>;
|
|
74
|
-
/**
|
|
75
|
-
* The route switch used for determining the route registration.
|
|
76
|
-
*/
|
|
77
|
-
RouteSwitch: ComponentType<RouteSwitchProps>;
|
|
78
|
-
/**
|
|
79
|
-
* A component that can be used for debugging purposes.
|
|
80
|
-
*/
|
|
81
|
-
Debug?: ComponentType;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* The Piral global app sub-state container for app information.
|
|
85
|
-
*/
|
|
86
|
-
export interface AppState {
|
|
87
|
-
/**
|
|
88
|
-
* Gets if the application is currently performing a background loading
|
|
89
|
-
* activity, e.g., for loading modules asynchronously or fetching
|
|
90
|
-
* translations.
|
|
91
|
-
*/
|
|
92
|
-
loading: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Gets an unrecoverable application error, if any.
|
|
95
|
-
*/
|
|
96
|
-
error: Error | undefined;
|
|
97
|
-
/**
|
|
98
|
-
* Gets if the components from the micro frontends should be wrapped
|
|
99
|
-
* in a piral-component element.
|
|
100
|
-
*/
|
|
101
|
-
wrap: boolean;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* The Piral global app sub-state container for component registrations.
|
|
105
|
-
*/
|
|
106
|
-
export interface RegistryState extends PiralCustomRegistryState {
|
|
107
|
-
/**
|
|
108
|
-
* The registered page components for the router.
|
|
109
|
-
*/
|
|
110
|
-
pages: Dict<PageRegistration>;
|
|
111
|
-
/**
|
|
112
|
-
* The registered extension components for extension slots.
|
|
113
|
-
*/
|
|
114
|
-
extensions: Dict<Array<ExtensionRegistration>>;
|
|
115
|
-
/**
|
|
116
|
-
* The registered wrappers for any component.
|
|
117
|
-
*/
|
|
118
|
-
wrappers: Dict<ComponentType<any>>;
|
|
119
|
-
}
|
|
120
|
-
export type ErrorComponentsState = {
|
|
121
|
-
[P in keyof Errors]?: ComponentType<Errors[P]>;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* The Piral global app state container.
|
|
125
|
-
*/
|
|
126
|
-
export interface GlobalState extends PiralCustomState {
|
|
127
|
-
/**
|
|
128
|
-
* The relevant state for the app itself.
|
|
129
|
-
*/
|
|
130
|
-
app: AppState;
|
|
131
|
-
/**
|
|
132
|
-
* The relevant state for rendering errors of the app.
|
|
133
|
-
*/
|
|
134
|
-
errorComponents: ErrorComponentsState;
|
|
135
|
-
/**
|
|
136
|
-
* The relevant state for rendering parts of the app.
|
|
137
|
-
*/
|
|
138
|
-
components: ComponentsState;
|
|
139
|
-
/**
|
|
140
|
-
* The relevant state for the registered components.
|
|
141
|
-
*/
|
|
142
|
-
registry: RegistryState;
|
|
143
|
-
/**
|
|
144
|
-
* Gets the loaded modules.
|
|
145
|
-
*/
|
|
146
|
-
modules: Array<Pilet>;
|
|
147
|
-
/**
|
|
148
|
-
* The foreign component portals to render.
|
|
149
|
-
*/
|
|
150
|
-
portals: Record<string, Array<ReactPortal>>;
|
|
151
|
-
/**
|
|
152
|
-
* The application's shared data.
|
|
153
|
-
*/
|
|
154
|
-
data: Dict<SharedDataItem>;
|
|
155
|
-
/**
|
|
156
|
-
* The used (exact) application routes.
|
|
157
|
-
*/
|
|
158
|
-
routes: Dict<ComponentType<RouteComponentProps<any>> & {
|
|
159
|
-
/**
|
|
160
|
-
* The optional meta data registered with the page.
|
|
161
|
-
*/
|
|
162
|
-
meta?: PiralPageMeta;
|
|
163
|
-
}>;
|
|
164
|
-
/**
|
|
165
|
-
* The current provider.
|
|
166
|
-
*/
|
|
167
|
-
provider?: ComponentType;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* The shape of an app action in Piral.
|
|
171
|
-
*/
|
|
172
|
-
export interface PiralAction<T extends (...args: any) => any> {
|
|
173
|
-
(ctx: GlobalStateContext, ...args: Parameters<T>): ReturnType<T>;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* A subset of the available app actions in Piral.
|
|
177
|
-
*/
|
|
178
|
-
export type PiralDefineActions = Partial<{
|
|
179
|
-
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
180
|
-
}>;
|
|
181
|
-
/**
|
|
182
|
-
* The globally defined actions.
|
|
183
|
-
*/
|
|
184
|
-
export interface PiralActions extends PiralCustomActions {
|
|
185
|
-
/**
|
|
186
|
-
* Initializes the application shell.
|
|
187
|
-
* @param loading The current loading state.
|
|
188
|
-
* @param error The application error, if any.
|
|
189
|
-
* @param modules The loaded pilets.
|
|
190
|
-
*/
|
|
191
|
-
initialize(loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
|
|
192
|
-
/**
|
|
193
|
-
* Injects an evaluated pilet at runtime - removes the pilet from registry first if available.
|
|
194
|
-
* @param pilet The pilet to be injected.
|
|
195
|
-
* @returns The injected pilet.
|
|
196
|
-
*/
|
|
197
|
-
injectPilet(pilet: Pilet): Pilet;
|
|
198
|
-
/**
|
|
199
|
-
* Adds a pilet at runtime by loading it, evaluating it, and then injecting it.
|
|
200
|
-
* @param pilet The pilet to be added.
|
|
201
|
-
* @returns The promise indicating when the pilet was fully added.
|
|
202
|
-
*/
|
|
203
|
-
addPilet(pilet: PiletEntry): Promise<void>;
|
|
204
|
-
/**
|
|
205
|
-
* Removes a pilet by unloading it and deleting all component registrations.
|
|
206
|
-
* @param name The name of the pilet to remove.
|
|
207
|
-
*/
|
|
208
|
-
removePilet(name: string): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Defines a single action for Piral.
|
|
211
|
-
* @param actionName The name of the action to define.
|
|
212
|
-
* @param action The action to include.
|
|
213
|
-
*/
|
|
214
|
-
defineAction<T extends keyof PiralActions>(actionName: T, action: PiralAction<PiralActions[T]>): void;
|
|
215
|
-
/**
|
|
216
|
-
* Defines a set of actions for Piral.
|
|
217
|
-
* @param actions The actions to define.
|
|
218
|
-
*/
|
|
219
|
-
defineActions(actions: PiralDefineActions): void;
|
|
220
|
-
/**
|
|
221
|
-
* Reads the value of a shared data item.
|
|
222
|
-
* @param name The name of the shared item.
|
|
223
|
-
*/
|
|
224
|
-
readDataValue(name: string): any;
|
|
225
|
-
/**
|
|
226
|
-
* Tries to write a shared data item. The write access is only
|
|
227
|
-
* possible if the name belongs to the provided owner or has not
|
|
228
|
-
* been taken yet.
|
|
229
|
-
* Setting the value to null will release it.
|
|
230
|
-
* @param name The name of the shared data item.
|
|
231
|
-
* @param value The value of the shared data item.
|
|
232
|
-
* @param owner The owner of the shared data item.
|
|
233
|
-
* @param target The target storage locatation.
|
|
234
|
-
* @param expiration The time for when to dispose the shared item.
|
|
235
|
-
*/
|
|
236
|
-
tryWriteDataItem(name: string, value: any, owner: string, target: DataStoreTarget, expiration: number): boolean;
|
|
237
|
-
/**
|
|
238
|
-
* Registers a new route to be resolved.
|
|
239
|
-
* @param route The route to register.
|
|
240
|
-
* @param value The page to be rendered on the route.
|
|
241
|
-
*/
|
|
242
|
-
registerPage(route: string, value: PageRegistration): void;
|
|
243
|
-
/**
|
|
244
|
-
* Unregisters an existing route.
|
|
245
|
-
* @param route The route to be removed.
|
|
246
|
-
*/
|
|
247
|
-
unregisterPage(route: string): void;
|
|
248
|
-
/**
|
|
249
|
-
* Registers a new extension.
|
|
250
|
-
* @param name The name of the extension category.
|
|
251
|
-
* @param value The extension registration.
|
|
252
|
-
*/
|
|
253
|
-
registerExtension(name: string, value: ExtensionRegistration): void;
|
|
254
|
-
/**
|
|
255
|
-
* Unregisters an existing extension.
|
|
256
|
-
* @param name The name of the extension category.
|
|
257
|
-
* @param value The extension that will be removed.
|
|
258
|
-
*/
|
|
259
|
-
unregisterExtension(name: string, reference: any): void;
|
|
260
|
-
/**
|
|
261
|
-
* Sets the common component to render.
|
|
262
|
-
* @param name The name of the component.
|
|
263
|
-
* @param component The component to use for rendering.
|
|
264
|
-
*/
|
|
265
|
-
setComponent<TKey extends keyof ComponentsState>(name: TKey, component: ComponentsState[TKey]): void;
|
|
266
|
-
/**
|
|
267
|
-
* Sets the error component to render.
|
|
268
|
-
* @param type The type of the error.
|
|
269
|
-
* @param component The component to use for rendering.
|
|
270
|
-
*/
|
|
271
|
-
setErrorComponent<TKey extends keyof ErrorComponentsState>(type: TKey, component: ErrorComponentsState[TKey]): void;
|
|
272
|
-
/**
|
|
273
|
-
* Sets the common routes to render.
|
|
274
|
-
* @param path The name of the component.
|
|
275
|
-
* @param component The component to use for rendering.
|
|
276
|
-
*/
|
|
277
|
-
setRoute<T extends {
|
|
278
|
-
[K in keyof T]?: string;
|
|
279
|
-
} = {}>(path: string, component: ComponentType<RouteComponentProps<T>>): void;
|
|
280
|
-
/**
|
|
281
|
-
* Includes a new provider as a sub-provider to the current provider.
|
|
282
|
-
* @param provider The provider to include.
|
|
283
|
-
*/
|
|
284
|
-
includeProvider(provider: JSX.Element): void;
|
|
285
|
-
/**
|
|
286
|
-
* Destroys (i.e., resets) the given portal instance.
|
|
287
|
-
* @param id The id of the portal to destroy.
|
|
288
|
-
*/
|
|
289
|
-
destroyPortal(id: string): void;
|
|
290
|
-
/**
|
|
291
|
-
* Includes the provided portal in the rendering pipeline.
|
|
292
|
-
* @param id The id of the portal to use.
|
|
293
|
-
* @param entry The child to render.
|
|
294
|
-
*/
|
|
295
|
-
showPortal(id: string, entry: ReactPortal): void;
|
|
296
|
-
/**
|
|
297
|
-
* Hides the provided portal in the rendering pipeline.
|
|
298
|
-
* @param id The id of the portal to use.
|
|
299
|
-
* @param entry The child to remove.
|
|
300
|
-
*/
|
|
301
|
-
hidePortal(id: string, entry: ReactPortal): void;
|
|
302
|
-
/**
|
|
303
|
-
* Updates the provided portal in the rendering pipeline.
|
|
304
|
-
* @param id The id of the portal to use.
|
|
305
|
-
* @param current The currently displayed child.
|
|
306
|
-
* @param next The updated child that should be displayed.
|
|
307
|
-
*/
|
|
308
|
-
updatePortal(id: string, current: ReactPortal, next: ReactPortal): void;
|
|
309
|
-
/**
|
|
310
|
-
* Dispatches a state change.
|
|
311
|
-
* @param update The update function creating a new state.
|
|
312
|
-
*/
|
|
313
|
-
dispatch(update: (state: GlobalState) => GlobalState): void;
|
|
314
|
-
/**
|
|
315
|
-
* Reads the selected part of the global state.
|
|
316
|
-
* @param select The selector for getting the desired part.
|
|
317
|
-
* @returns The desired part.
|
|
318
|
-
*/
|
|
319
|
-
readState<S>(select: (state: GlobalState) => S): S;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* The Piral app instance context.
|
|
323
|
-
*/
|
|
324
|
-
export interface GlobalStateContext extends PiralActions, EventEmitter {
|
|
325
|
-
/**
|
|
326
|
-
* The global state context atom.
|
|
327
|
-
* Changes to the state should always be dispatched via the `dispatch` action.
|
|
328
|
-
*/
|
|
329
|
-
state: UseBoundStore<GlobalState>;
|
|
330
|
-
/**
|
|
331
|
-
* The API objects created for the loaded pilets.
|
|
332
|
-
*/
|
|
333
|
-
apis: PiletsBag;
|
|
334
|
-
/**
|
|
335
|
-
* The available component converters.
|
|
336
|
-
*/
|
|
337
|
-
converters: ComponentConverters<any>;
|
|
338
|
-
/**
|
|
339
|
-
* The navigation manager for the whole instance.
|
|
340
|
-
*/
|
|
341
|
-
navigation: NavigationApi;
|
|
342
|
-
/**
|
|
343
|
-
* The initial options.
|
|
344
|
-
*/
|
|
345
|
-
options: LoadPiletsOptions;
|
|
346
|
-
}
|
package/esm/types/state.js
DELETED
package/esm/types/state.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/types/state.ts"],"names":[],"mappings":""}
|