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
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ErrorComponentsState } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* The props for the SetErrors component.
|
|
5
|
-
*/
|
|
6
|
-
export interface SetErrorsProps {
|
|
7
|
-
/**
|
|
8
|
-
* The error views of the Piral instance.
|
|
9
|
-
*/
|
|
10
|
-
errors?: Partial<ErrorComponentsState>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The component capable of batch setting error handling components.
|
|
14
|
-
*/
|
|
15
|
-
export declare function SetErrors({ errors }: SetErrorsProps): React.ReactElement;
|
package/esm/setters/SetErrors.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SetError } from './SetError';
|
|
3
|
-
/**
|
|
4
|
-
* The component capable of batch setting error handling components.
|
|
5
|
-
*/
|
|
6
|
-
export function SetErrors({ errors = {} }) {
|
|
7
|
-
return (React.createElement(React.Fragment, null, Object.keys(errors).map((key) => (React.createElement(SetError, { type: key, component: errors[key], key: key })))));
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=SetErrors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SetErrors.js","sourceRoot":"","sources":["../../src/setters/SetErrors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAatC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,QAAQ,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC1D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ComponentsState } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* The props for the SetLayout component.
|
|
5
|
-
*/
|
|
6
|
-
export interface SetLayoutProps {
|
|
7
|
-
/**
|
|
8
|
-
* The layout of the Piral instance.
|
|
9
|
-
*/
|
|
10
|
-
layout?: Partial<ComponentsState>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The component capable of batch setting layout components.
|
|
14
|
-
*/
|
|
15
|
-
export declare function SetLayout({ layout }: SetLayoutProps): React.ReactElement;
|
package/esm/setters/SetLayout.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SetComponent } from './SetComponent';
|
|
3
|
-
/**
|
|
4
|
-
* The component capable of batch setting layout components.
|
|
5
|
-
*/
|
|
6
|
-
export function SetLayout({ layout = {} }) {
|
|
7
|
-
return (React.createElement(React.Fragment, null, Object.keys(layout).map((key) => (React.createElement(SetComponent, { name: key, component: layout[key], key: key })))));
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=SetLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SetLayout.js","sourceRoot":"","sources":["../../src/setters/SetLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAa9C;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,GAAG,EAAE,EAAkB;IACvD,OAAO,CACL,0CACG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACrC,oBAAC,YAAY,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAC9D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The props for the SetProvider component.
|
|
4
|
-
*/
|
|
5
|
-
export interface SetProviderProps {
|
|
6
|
-
/**
|
|
7
|
-
* The provider to register.
|
|
8
|
-
*/
|
|
9
|
-
provider: JSX.Element;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The component capable of setting a global provider at mounting.
|
|
13
|
-
*/
|
|
14
|
-
export declare function SetProvider({ provider }: SetProviderProps): React.ReactElement;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useGlobalStateContext, useSetter } from '../hooks';
|
|
2
|
-
/**
|
|
3
|
-
* The component capable of setting a global provider at mounting.
|
|
4
|
-
*/
|
|
5
|
-
export function SetProvider({ provider }) {
|
|
6
|
-
const { includeProvider } = useGlobalStateContext();
|
|
7
|
-
useSetter(() => provider && includeProvider(provider));
|
|
8
|
-
// tslint:disable-next-line:no-null-keyword
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=SetProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/setters/SetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAY5D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAoB;IACxD,MAAM,EAAC,eAAe,EAAC,GAAG,qBAAqB,EAAE,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The props for the SetRedirect component.
|
|
4
|
-
*/
|
|
5
|
-
export interface SetRedirectProps {
|
|
6
|
-
/**
|
|
7
|
-
* The path of the seen route.
|
|
8
|
-
*/
|
|
9
|
-
from: string;
|
|
10
|
-
/**
|
|
11
|
-
* The path of the target route.
|
|
12
|
-
*/
|
|
13
|
-
to: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The component capable of setting a global redirect route at mounting.
|
|
17
|
-
*/
|
|
18
|
-
export declare function SetRedirect({ from, to }: SetRedirectProps): React.ReactElement;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useGlobalStateContext, useSetter } from '../hooks';
|
|
2
|
-
import { createRedirect } from '../../app.codegen';
|
|
3
|
-
/**
|
|
4
|
-
* The component capable of setting a global redirect route at mounting.
|
|
5
|
-
*/
|
|
6
|
-
export function SetRedirect({ from, to }) {
|
|
7
|
-
const { setRoute } = useGlobalStateContext();
|
|
8
|
-
useSetter(() => setRoute(from, createRedirect(to)));
|
|
9
|
-
// tslint:disable-next-line:no-null-keyword
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=SetRedirect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SetRedirect.js","sourceRoot":"","sources":["../../src/setters/SetRedirect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgBnD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,EAAoB;IACxD,MAAM,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router';
|
|
3
|
-
/**
|
|
4
|
-
* The props for the SetRoute component.
|
|
5
|
-
*/
|
|
6
|
-
export interface SetRouteProps<T extends {
|
|
7
|
-
[K in keyof T]?: string;
|
|
8
|
-
} = {}> {
|
|
9
|
-
/**
|
|
10
|
-
* The path to the route.
|
|
11
|
-
*/
|
|
12
|
-
path: string;
|
|
13
|
-
/**
|
|
14
|
-
* The component to render.
|
|
15
|
-
*/
|
|
16
|
-
component: React.ComponentType<RouteComponentProps<T>>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The component capable of setting a global route at mounting.
|
|
20
|
-
*/
|
|
21
|
-
export declare function SetRoute<T extends {
|
|
22
|
-
[K in keyof T]?: string;
|
|
23
|
-
} = {}>({ path, component, }: SetRouteProps<T>): React.ReactElement;
|
package/esm/setters/SetRoute.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useGlobalStateContext, useSetter } from '../hooks';
|
|
2
|
-
/**
|
|
3
|
-
* The component capable of setting a global route at mounting.
|
|
4
|
-
*/
|
|
5
|
-
export function SetRoute({ path, component, }) {
|
|
6
|
-
const { setRoute } = useGlobalStateContext();
|
|
7
|
-
useSetter(() => component && setRoute(path, component));
|
|
8
|
-
// tslint:disable-next-line:no-null-keyword
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=SetRoute.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SetRoute.js","sourceRoot":"","sources":["../../src/setters/SetRoute.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgB5D;;GAEG;AACH,MAAM,UAAU,QAAQ,CAA6C,EACnE,IAAI,EACJ,SAAS,GACQ;IACjB,MAAM,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACxD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/esm/setters/index.d.ts
DELETED
package/esm/setters/index.js
DELETED
package/esm/setters/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/setters/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { UseBoundStore } from 'zustand';
|
|
2
|
-
import { EventEmitter, GlobalState, GlobalStateContext, PiralDefineActions } from '../types';
|
|
3
|
-
export declare function includeActions(ctx: GlobalStateContext, actions: PiralDefineActions): void;
|
|
4
|
-
export declare function createActions(state: UseBoundStore<GlobalState>, events: EventEmitter): GlobalStateContext;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as actions from '../actions';
|
|
2
|
-
import { createNavigation, publicPath } from '../../app.codegen';
|
|
3
|
-
function createContext(state, events) {
|
|
4
|
-
const ctx = {
|
|
5
|
-
...events,
|
|
6
|
-
apis: {},
|
|
7
|
-
converters: {
|
|
8
|
-
html: ({ component }) => component,
|
|
9
|
-
},
|
|
10
|
-
navigation: createNavigation(publicPath),
|
|
11
|
-
state,
|
|
12
|
-
};
|
|
13
|
-
return ctx;
|
|
14
|
-
}
|
|
15
|
-
export function includeActions(ctx, actions) {
|
|
16
|
-
const actionNames = Object.keys(actions);
|
|
17
|
-
for (const actionName of actionNames) {
|
|
18
|
-
const action = actions[actionName];
|
|
19
|
-
ctx[actionName] = action.bind(ctx, ctx);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export function createActions(state, events) {
|
|
23
|
-
const context = createContext(state, events);
|
|
24
|
-
includeActions(context, actions);
|
|
25
|
-
return context;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=createActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createActions.js","sourceRoot":"","sources":["../../src/state/createActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGjE,SAAS,aAAa,CAAC,KAAiC,EAAE,MAAoB;IAC5E,MAAM,GAAG,GAAG;QACV,GAAG,MAAM;QACT,IAAI,EAAE,EAAE;QACR,UAAU,EAAE;YACV,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS;SACnC;QACD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;QACxC,KAAK;KACgB,CAAC;IACxB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAuB,EAAE,OAA2B;IACjF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEzC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;KACzC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAiC,EAAE,MAAoB;IACnF,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7C,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import create from 'zustand';
|
|
2
|
-
import { createDefaultState } from '../../app.codegen';
|
|
3
|
-
function extend(defaultState, customState) {
|
|
4
|
-
for (const key of Object.keys(customState)) {
|
|
5
|
-
if (key === '__proto__' || key === 'constructor') {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
const value = customState[key];
|
|
9
|
-
const original = defaultState[key];
|
|
10
|
-
const nested = typeof original === 'object' && typeof value === 'object';
|
|
11
|
-
defaultState[key] = nested ? extend(original, value) : value;
|
|
12
|
-
}
|
|
13
|
-
return defaultState;
|
|
14
|
-
}
|
|
15
|
-
export function createGlobalState(customState = {}) {
|
|
16
|
-
const defaultState = createDefaultState();
|
|
17
|
-
return create(() => extend(defaultState, customState));
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=createGlobalState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createGlobalState.js","sourceRoot":"","sources":["../../src/state/createGlobalState.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,SAAS,MAAM,CAAI,YAAe,EAAE,WAA6B;IAC/D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC1C,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,EAAE;YAChD,SAAS;SACV;QAED,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;QACzE,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KAC9D;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,cAA0C,EAAE;IAC5E,MAAM,YAAY,GAAgB,kBAAkB,EAAE,CAAC;IACvD,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
package/esm/state/index.d.ts
DELETED
package/esm/state/index.js
DELETED
package/esm/state/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateContext.js","sourceRoot":"","sources":["../../src/state/stateContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAqB,SAAS,CAAC,CAAC;AAE/E,eAAe,YAAY,CAAC"}
|
package/esm/state/withApi.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AnyComponent, Errors, PiletApi, BaseComponentProps, GlobalStateContext } from '../types';
|
|
3
|
-
export declare function withApi<TProps>(context: GlobalStateContext, component: AnyComponent<TProps & BaseComponentProps>, piral: PiletApi, errorType: keyof Errors, wrapperType?: string, captured?: {}): React.MemoExoticComponent<(props: TProps) => React.JSX.Element> | React.ComponentType<TProps>;
|
package/esm/state/withApi.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ErrorBoundary, wrapComponent } from '../components';
|
|
3
|
-
import { defaultRender } from '../utils';
|
|
4
|
-
const DefaultWrapper = (props) => defaultRender(props.children);
|
|
5
|
-
function getWrapper(wrappers, wrapperType) {
|
|
6
|
-
const WrapAll = wrappers['*'];
|
|
7
|
-
const WrapType = wrappers[wrapperType];
|
|
8
|
-
if (WrapAll && WrapType) {
|
|
9
|
-
return (props) => (React.createElement(WrapAll, { ...props },
|
|
10
|
-
React.createElement(WrapType, { ...props })));
|
|
11
|
-
}
|
|
12
|
-
return WrapType || WrapAll || DefaultWrapper;
|
|
13
|
-
}
|
|
14
|
-
function makeWrapper(context, outerProps, wrapperType, errorType) {
|
|
15
|
-
const wrapped = context.readState((m) => m.app.wrap);
|
|
16
|
-
const OuterWrapper = context.readState((m) => getWrapper(m.registry.wrappers, wrapperType));
|
|
17
|
-
const Wrapper = (props) => (React.createElement(OuterWrapper, { ...outerProps, ...props },
|
|
18
|
-
React.createElement(ErrorBoundary, { ...outerProps, ...props, errorType: errorType }, props.children)));
|
|
19
|
-
return wrapped
|
|
20
|
-
? (props) => (React.createElement("piral-component", { origin: outerProps.piral.meta.name },
|
|
21
|
-
React.createElement(Wrapper, { ...props })))
|
|
22
|
-
: Wrapper;
|
|
23
|
-
}
|
|
24
|
-
export function withApi(context, component, piral, errorType, wrapperType = errorType, captured = {}) {
|
|
25
|
-
const outerProps = { ...captured, piral };
|
|
26
|
-
const converters = context.converters;
|
|
27
|
-
const Wrapper = makeWrapper(context, outerProps, wrapperType, errorType);
|
|
28
|
-
return wrapComponent(converters, component, outerProps, Wrapper);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=withApi.js.map
|
package/esm/state/withApi.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withApi.js","sourceRoot":"","sources":["../../src/state/withApi.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,cAAc,GAA0C,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAEvG,SAAS,UAAU,CAAC,QAAkD,EAAE,WAAmB;IACzF,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC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O,CAAC,UAAU,CAAC;IACtC,MAAM,OAAO,GAAG,WAAW,CAAS,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACjF,OAAO,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC"}
|
package/esm/tools/codegen.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface CodegenOptions {
|
|
2
|
-
root: string;
|
|
3
|
-
origin: string;
|
|
4
|
-
cat: string;
|
|
5
|
-
appName: string;
|
|
6
|
-
externals: Array<string>;
|
|
7
|
-
publicPath: string;
|
|
8
|
-
isolation: 'classic' | 'modern';
|
|
9
|
-
debug?: {
|
|
10
|
-
viewState?: boolean;
|
|
11
|
-
loadPilets?: boolean;
|
|
12
|
-
hardRefresh?: boolean;
|
|
13
|
-
viewOrigins?: boolean;
|
|
14
|
-
extensionCatalogue?: boolean;
|
|
15
|
-
clearConsole?: boolean;
|
|
16
|
-
};
|
|
17
|
-
emulator: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare function createDependencies(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
20
|
-
export declare function createDefaultState(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
21
|
-
export declare function createDebugHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
22
|
-
export declare function createRouteHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
23
|
-
export {};
|
package/esm/tools/codegen.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
// this file is bundled, so the references here will not be at runtime (i.e., for a user)
|
|
2
|
-
import { getModulePath } from 'piral-cli/src/external/resolve';
|
|
3
|
-
import { readFileSync, existsSync } from 'fs';
|
|
4
|
-
import { resolve, relative, dirname, sep, posix } from 'path';
|
|
5
|
-
function findPackagePath(moduleDir) {
|
|
6
|
-
const packageJson = 'package.json';
|
|
7
|
-
const packagePath = resolve(moduleDir, packageJson);
|
|
8
|
-
if (existsSync(packagePath)) {
|
|
9
|
-
return packagePath;
|
|
10
|
-
}
|
|
11
|
-
const newDir = resolve(moduleDir, '..');
|
|
12
|
-
if (newDir !== moduleDir) {
|
|
13
|
-
return findPackagePath(newDir);
|
|
14
|
-
}
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
function getPackageJson(root, packageName) {
|
|
18
|
-
const moduleDir = dirname(getModulePath(root, packageName));
|
|
19
|
-
try {
|
|
20
|
-
const packagePath = findPackagePath(moduleDir);
|
|
21
|
-
const content = readFileSync(packagePath, 'utf8');
|
|
22
|
-
return JSON.parse(content) || {};
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function getRouterVersion(root) {
|
|
29
|
-
const router = 'react-router';
|
|
30
|
-
try {
|
|
31
|
-
const { version } = getPackageJson(root, router);
|
|
32
|
-
const [major] = version.split('.');
|
|
33
|
-
return parseInt(major, 10);
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
console.warn(`⚠ Could not determine version of ${router}. Falling back to v5.`);
|
|
37
|
-
return 5;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function getIdentifiers(root, packageName) {
|
|
41
|
-
const identifiers = [packageName];
|
|
42
|
-
try {
|
|
43
|
-
const details = getPackageJson(root, packageName);
|
|
44
|
-
if (details.version) {
|
|
45
|
-
identifiers.push(`${packageName}@${details.version}`);
|
|
46
|
-
if (details.name && details.name !== packageName) {
|
|
47
|
-
identifiers.push(`${details.name}@${details.version}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch { }
|
|
52
|
-
return identifiers;
|
|
53
|
-
}
|
|
54
|
-
function getModulePathOrDefault(root, origin, name) {
|
|
55
|
-
try {
|
|
56
|
-
const absPath = getModulePath(root, name);
|
|
57
|
-
const relPath = relative(origin, absPath);
|
|
58
|
-
// The relative path is to be used in an import statement,
|
|
59
|
-
// so it should be normalized back to use posix path separators.
|
|
60
|
-
const path = relPath.split(sep).join(posix.sep);
|
|
61
|
-
return path;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return name;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export function createDependencies(imports, exports, opts) {
|
|
68
|
-
const { root, appName, externals, origin } = opts;
|
|
69
|
-
const assignments = [];
|
|
70
|
-
const asyncAssignments = [];
|
|
71
|
-
if (appName) {
|
|
72
|
-
assignments.push(`deps['${appName}']={}`);
|
|
73
|
-
}
|
|
74
|
-
for (const external of externals) {
|
|
75
|
-
if (external.endsWith('?')) {
|
|
76
|
-
const name = external.replace(/\?+$/, '');
|
|
77
|
-
const identifiers = getIdentifiers(root, name);
|
|
78
|
-
const path = getModulePathOrDefault(root, origin, name);
|
|
79
|
-
for (const id of identifiers) {
|
|
80
|
-
asyncAssignments.push(`registerModule(${JSON.stringify(id)}, () => import(${JSON.stringify(path)}))`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
const name = external;
|
|
85
|
-
const identifiers = getIdentifiers(root, name);
|
|
86
|
-
const path = getModulePathOrDefault(root, origin, name);
|
|
87
|
-
const ref = `_${imports.length}`;
|
|
88
|
-
imports.push(`import * as ${ref} from ${JSON.stringify(path)}`);
|
|
89
|
-
for (const id of identifiers) {
|
|
90
|
-
assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (asyncAssignments.length) {
|
|
95
|
-
imports.push(`import { registerModule } from 'piral-base'`);
|
|
96
|
-
assignments.push(...asyncAssignments);
|
|
97
|
-
}
|
|
98
|
-
exports.push(`
|
|
99
|
-
export function fillDependencies(deps) {
|
|
100
|
-
${assignments.join(';')}
|
|
101
|
-
}
|
|
102
|
-
`);
|
|
103
|
-
}
|
|
104
|
-
export function createDefaultState(imports, exports, opts) {
|
|
105
|
-
const { root, cat, publicPath, isolation } = opts;
|
|
106
|
-
const routerVersion = getRouterVersion(root);
|
|
107
|
-
const wrap = isolation === 'modern' ? 'true' : 'false';
|
|
108
|
-
imports.push(`import { DefaultErrorInfo } from 'piral-core/${cat}/defaults/DefaultErrorInfo';`, `import { DefaultLoadingIndicator } from 'piral-core/${cat}/defaults/DefaultLoadingIndicator';`, `import { DefaultLayout } from 'piral-core/${cat}/defaults/DefaultLayout';`);
|
|
109
|
-
if (routerVersion < 6) {
|
|
110
|
-
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v5';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v5';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v5'`);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v6';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v6';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v6'`);
|
|
114
|
-
}
|
|
115
|
-
exports.push(`
|
|
116
|
-
export { createRedirect, createNavigation, useRouterContext };
|
|
117
|
-
`);
|
|
118
|
-
exports.push(`
|
|
119
|
-
export const publicPath = ${JSON.stringify(publicPath)};
|
|
120
|
-
`);
|
|
121
|
-
exports.push(`
|
|
122
|
-
export function createDefaultState() {
|
|
123
|
-
return {
|
|
124
|
-
app: {
|
|
125
|
-
error: undefined,
|
|
126
|
-
loading: typeof window !== 'undefined',
|
|
127
|
-
wrap: ${wrap},
|
|
128
|
-
},
|
|
129
|
-
components: {
|
|
130
|
-
ErrorInfo: DefaultErrorInfo,
|
|
131
|
-
LoadingIndicator: DefaultLoadingIndicator,
|
|
132
|
-
Router: DefaultRouter,
|
|
133
|
-
RouteSwitch: DefaultRouteSwitch,
|
|
134
|
-
Layout: DefaultLayout,
|
|
135
|
-
},
|
|
136
|
-
errorComponents: {},
|
|
137
|
-
registry: {
|
|
138
|
-
extensions: {},
|
|
139
|
-
pages: {},
|
|
140
|
-
wrappers: {},
|
|
141
|
-
},
|
|
142
|
-
routes: {},
|
|
143
|
-
data: {},
|
|
144
|
-
portals: {},
|
|
145
|
-
modules: [],
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
`);
|
|
149
|
-
}
|
|
150
|
-
export function createDebugHandler(imports, exports, opts) {
|
|
151
|
-
const { cat, debug, emulator } = opts;
|
|
152
|
-
// if we build the debug version of piral (debug and emulator build)
|
|
153
|
-
if (debug) {
|
|
154
|
-
const originalCall = `originalDebugger(context, options, {
|
|
155
|
-
defaultSettings: ${JSON.stringify(debug)},
|
|
156
|
-
emulator: ${JSON.stringify(emulator)},
|
|
157
|
-
...debug,
|
|
158
|
-
})`;
|
|
159
|
-
imports.push(`import { integrateDebugger as originalDebugger } from "piral-core/${cat}/tools/debugger"`);
|
|
160
|
-
exports.push(`export function integrateDebugger(context, options, debug) { return ${originalCall}; }`);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
exports.push(`export function integrateDebugger() {}`);
|
|
164
|
-
}
|
|
165
|
-
// if we build the emulator version of piral (shipped to pilets)
|
|
166
|
-
if (emulator) {
|
|
167
|
-
imports.push(`import { integrateEmulator } from "piral-core/${cat}/tools/emulator"`);
|
|
168
|
-
exports.push(`export { integrateEmulator }`);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
exports.push(`export function integrateEmulator() {}`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
export function createRouteHandler(imports, exports, opts) {
|
|
175
|
-
const { cat, emulator } = opts;
|
|
176
|
-
const assignments = [];
|
|
177
|
-
imports.push(`import { useGlobalStateContext } from 'piral-core/${cat}/hooks/globalState';`);
|
|
178
|
-
assignments.push(`
|
|
179
|
-
useCurrentNavigation();
|
|
180
|
-
`);
|
|
181
|
-
if (emulator) {
|
|
182
|
-
imports.push(`import { useDebugRouteFilter } from 'piral-debug-utils';`);
|
|
183
|
-
assignments.push('return useDebugRouteFilter(paths);');
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
assignments.push('return paths;');
|
|
187
|
-
}
|
|
188
|
-
exports.push(`
|
|
189
|
-
export function useRouteFilter(paths) {
|
|
190
|
-
${assignments.join('\n')}
|
|
191
|
-
}
|
|
192
|
-
`);
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=codegen.js.map
|
package/esm/tools/codegen.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/tools/codegen.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE9D,SAAS,eAAe,CAAC,SAAiB;IACxC,MAAM,WAAW,GAAG,cAAc,CAAC;IACnC,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEpD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE;QAC3B,OAAO,WAAW,CAAC;KACpB;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAExC,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;KAChC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAE,WAAmB;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;I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ACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAsB,EAAE,OAAsB,EAAE,IAAoB;IACrG,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,OAAO,CAAC,IAAI,CAAC,qDAAqD,GAAG,sBAAsB,CAAC,CAAC;IAE7F,WAAW,CAAC,IAAI,CAAC;;GAEhB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACzE,WAAW,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;KACxD;SAAM;QACL,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnC;IAED,OAAO,CAAC,IAAI,CAAC;;QAEP,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;GAE3B,CAAC,CAAC;AACL,CAAC"}
|
package/esm/tools/debugger.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { LoadPiletsOptions } from 'piral-base';
|
|
2
|
-
import { DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from '../types';
|
|
4
|
-
export declare function integrateDebugger(context: GlobalStateContext, options: LoadPiletsOptions, debug?: DebuggerExtensionOptions): void;
|
package/esm/tools/debugger.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { installPiralDebug } from 'piral-debug-utils';
|
|
2
|
-
export function integrateDebugger(context, options, debug = {}) {
|
|
3
|
-
installPiralDebug({
|
|
4
|
-
emulator: debug.emulator,
|
|
5
|
-
customSettings: debug.customSettings,
|
|
6
|
-
defaultSettings: debug.defaultSettings,
|
|
7
|
-
addPilet: context.addPilet,
|
|
8
|
-
removePilet: context.removePilet,
|
|
9
|
-
updatePilet(pilet) {
|
|
10
|
-
if (!pilet.disabled) {
|
|
11
|
-
context.addPilet(pilet);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
context.injectPilet(pilet);
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
fireEvent: context.emit,
|
|
18
|
-
getDependencies() {
|
|
19
|
-
return Object.keys(options.dependencies);
|
|
20
|
-
},
|
|
21
|
-
getExtensions() {
|
|
22
|
-
return context.readState((s) => Object.keys(s.registry.extensions));
|
|
23
|
-
},
|
|
24
|
-
getRoutes() {
|
|
25
|
-
const registeredRoutes = context.readState((state) => Object.keys(state.registry.pages));
|
|
26
|
-
const componentRoutes = context.readState((state) => Object.keys(state.routes));
|
|
27
|
-
return [...componentRoutes, ...registeredRoutes];
|
|
28
|
-
},
|
|
29
|
-
getGlobalState() {
|
|
30
|
-
return context.readState((s) => s);
|
|
31
|
-
},
|
|
32
|
-
navigate(path, state) {
|
|
33
|
-
return context.navigation.push(path, state);
|
|
34
|
-
},
|
|
35
|
-
getPilets() {
|
|
36
|
-
return context.readState((s) => s.modules);
|
|
37
|
-
},
|
|
38
|
-
integrate(dbg) {
|
|
39
|
-
context.dispatch((s) => ({
|
|
40
|
-
...s,
|
|
41
|
-
routes: {
|
|
42
|
-
...s.routes,
|
|
43
|
-
...dbg.routes,
|
|
44
|
-
},
|
|
45
|
-
}));
|
|
46
|
-
context.state.subscribe((current, previous) => {
|
|
47
|
-
const pilets = current.modules !== previous.modules;
|
|
48
|
-
const pages = current.registry.pages !== previous.registry.pages || current.routes !== previous.routes;
|
|
49
|
-
const extensions = current.registry.extensions !== previous.registry.extensions;
|
|
50
|
-
const state = current !== previous;
|
|
51
|
-
dbg.onChange(previous, current, {
|
|
52
|
-
pilets,
|
|
53
|
-
pages,
|
|
54
|
-
extensions,
|
|
55
|
-
state,
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=debugger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src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