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/createInstance.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { __assign } from 'tslib';
|
|
2
|
-
import { blazingStrategy, standardStrategy, createListener, isfunc } from 'piral-base';
|
|
3
|
-
import { defaultApiFactory, defaultDependencySelector, defaultModuleRequester } from './modules';
|
|
4
|
-
import { createGlobalState, createActions, includeActions } from './state';
|
|
5
|
-
import { createPiletOptions } from './helpers';
|
|
6
|
-
import { generateId } from './utils';
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new PiralInstance component, which can be used for
|
|
9
|
-
* bootstrapping the application easily.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
```jsx
|
|
13
|
-
const instance = createInstance({
|
|
14
|
-
requestPilets() {
|
|
15
|
-
return fetch(...);
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const app = (
|
|
20
|
-
<Piral instance={instance}>
|
|
21
|
-
<Define name="Layout" component={MyLayout} />
|
|
22
|
-
</Piral>
|
|
23
|
-
);
|
|
24
|
-
render(app, document.querySelector('#app'));
|
|
25
|
-
```
|
|
26
|
-
*/
|
|
27
|
-
export function createInstance(config = {}) {
|
|
28
|
-
const { id = generateId(), state, actions, availablePilets = [], plugins, requestPilets = defaultModuleRequester, loaderConfig, async = false, shareDependencies = defaultDependencySelector, loadPilet, loaders, debug, apiFactory = defaultApiFactory, } = config;
|
|
29
|
-
const globalState = createGlobalState(state);
|
|
30
|
-
const events = createListener(globalState);
|
|
31
|
-
const context = createActions(globalState, events);
|
|
32
|
-
const definedPlugins = plugins || [];
|
|
33
|
-
const usedPlugins = Array.isArray(definedPlugins) ? definedPlugins : [definedPlugins];
|
|
34
|
-
const createApi = apiFactory(context, usedPlugins);
|
|
35
|
-
const root = createApi({
|
|
36
|
-
name: '_',
|
|
37
|
-
version: '0',
|
|
38
|
-
spec: 'v0',
|
|
39
|
-
basePath: '',
|
|
40
|
-
link: '',
|
|
41
|
-
config: {},
|
|
42
|
-
dependencies: {},
|
|
43
|
-
});
|
|
44
|
-
const options = createPiletOptions({
|
|
45
|
-
context,
|
|
46
|
-
createApi,
|
|
47
|
-
loaders,
|
|
48
|
-
loadPilet,
|
|
49
|
-
availablePilets,
|
|
50
|
-
loaderConfig,
|
|
51
|
-
shareDependencies,
|
|
52
|
-
strategy: isfunc(async) ? async : async ? blazingStrategy : standardStrategy,
|
|
53
|
-
requestPilets,
|
|
54
|
-
debug,
|
|
55
|
-
});
|
|
56
|
-
if (actions) {
|
|
57
|
-
includeActions(context, actions);
|
|
58
|
-
}
|
|
59
|
-
context.options = options;
|
|
60
|
-
return __assign(events, {
|
|
61
|
-
id,
|
|
62
|
-
createApi,
|
|
63
|
-
context,
|
|
64
|
-
root,
|
|
65
|
-
options,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=createInstance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createInstance.js","sourceRoot":"","sources":["../src/createInstance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAAC,SAA+B,EAAE;IAC9D,MAAM,EACJ,EAAE,GAAG,UAAU,EAAE,EACjB,KAAK,EACL,OAAO,EACP,eAAe,GAAG,EAAE,EACpB,OAAO,EACP,aAAa,GAAG,sBAAsB,EACtC,YAAY,EACZ,KAAK,GAAG,KAAK,EACb,iBAAiB,GAAG,yBAAyB,EAC7C,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,GAAG,iBAAiB,GAC/B,GAAG,MAAM,CAAC;IACX,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACtF,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,SAAS,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,GAAG;QACZ,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,kBAAkB,CAAC;QACjC,OAAO;QACP,SAAS;QACT,OAAO;QACP,SAAS;QACT,eAAe;QACf,YAAY;QACZ,iBAAiB;QACjB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB;QAC5E,aAAa;QACb,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,OAAO,EAAE;QACX,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KAClC;IAED,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1B,OAAO,QAAQ,CAAC,MAAM,EAAE;QACtB,EAAE;QACF,SAAS;QACT,OAAO;QACP,IAAI;QACJ,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ErrorInfoProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* The default error info component. Just uses the "error" extension slot.
|
|
5
|
-
* Leverage the default one by registration of respective extensions using
|
|
6
|
-
* the "error" name.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DefaultErrorInfo: React.FC<ErrorInfoProps>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ExtensionSlot } from '../components/ExtensionSlot';
|
|
3
|
-
import { SwitchErrorInfo } from '../components/SwitchErrorInfo';
|
|
4
|
-
/**
|
|
5
|
-
* The default error info component. Just uses the "error" extension slot.
|
|
6
|
-
* Leverage the default one by registration of respective extensions using
|
|
7
|
-
* the "error" name.
|
|
8
|
-
*/
|
|
9
|
-
export const DefaultErrorInfo = (props) => (React.createElement(ExtensionSlot, { name: "error", params: props, empty: () => React.createElement(SwitchErrorInfo, { ...props }) }));
|
|
10
|
-
DefaultErrorInfo.displayName = 'DefaultErrorInfo';
|
|
11
|
-
//# sourceMappingURL=DefaultErrorInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultErrorInfo.js","sourceRoot":"","sources":["../../src/defaults/DefaultErrorInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,oBAAC,aAAa,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAC,eAAe,OAAK,KAAK,GAAI,GAAI,CAC3F,CAAC;AACF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { defaultRender } from '../utils';
|
|
2
|
-
/**
|
|
3
|
-
* The default layout only rendering the provided children.
|
|
4
|
-
*/
|
|
5
|
-
export const DefaultLayout = ({ children }) => defaultRender(children);
|
|
6
|
-
DefaultLayout.displayName = 'DefaultLayout';
|
|
7
|
-
//# sourceMappingURL=DefaultLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../src/defaults/DefaultLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC9F,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The default loading indicator only displaying "Loading".
|
|
4
|
-
*/
|
|
5
|
-
export const DefaultLoadingIndicator = () => React.createElement("div", null, "Loading");
|
|
6
|
-
DefaultLoadingIndicator.displayName = 'DefaultLoadingIndicator';
|
|
7
|
-
//# sourceMappingURL=DefaultLoadingIndicator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultLoadingIndicator.js","sourceRoot":"","sources":["../../src/defaults/DefaultLoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAoC,GAAG,EAAE,CAAC,2CAAkB,CAAC;AACjG,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Switch, Route } from 'react-router';
|
|
3
|
-
export const DefaultRouteSwitch = ({ paths, NotFound, ...props }) => {
|
|
4
|
-
return (React.createElement(Switch, { ...props },
|
|
5
|
-
paths.map(({ path, Component }) => (React.createElement(Route, { exact: true, key: path, path: path, component: Component }))),
|
|
6
|
-
React.createElement(Route, { component: NotFound })));
|
|
7
|
-
};
|
|
8
|
-
DefaultRouteSwitch.displayName = 'DefaultRouteSwitch';
|
|
9
|
-
//# sourceMappingURL=DefaultRouteSwitch_v5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRouteSwitch_v5.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouteSwitch_v5.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9F,OAAO,CACL,oBAAC,MAAM,OAAK,KAAK;QACd,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAClC,oBAAC,KAAK,IAAC,KAAK,QAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAC7D,CAAC;QACF,oBAAC,KAAK,IAAC,SAAS,EAAE,QAAQ,GAAI,CACvB,CACV,CAAC;AACJ,CAAC,CAAC;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
//@ts-ignore
|
|
3
|
-
import { Routes, Route } from 'react-router-dom';
|
|
4
|
-
export const DefaultRouteSwitch = ({ paths, NotFound, ...props }) => {
|
|
5
|
-
return (React.createElement(Routes, { ...props },
|
|
6
|
-
paths.map(({ path, Component }) => (
|
|
7
|
-
//@ts-ignore
|
|
8
|
-
React.createElement(Route, { key: path, path: path, element: React.createElement(Component, null) }))),
|
|
9
|
-
//@ts-ignore
|
|
10
|
-
React.createElement(Route, { path: "*", element: React.createElement(NotFound, null) })));
|
|
11
|
-
};
|
|
12
|
-
DefaultRouteSwitch.displayName = 'DefaultRouteSwitch';
|
|
13
|
-
//# sourceMappingURL=DefaultRouteSwitch_v6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRouteSwitch_v6.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouteSwitch_v6.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,YAAY;AACZ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9F,OAAO,CACL,oBAAC,MAAM,OAAK,KAAK;QACd,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;QAClC,YAAY;QACZ,oBAAC,KAAK,IAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAC,SAAS,OAAG,GAAI,CACzD,CAAC;QAEA,YAAY;QACZ,oBAAC,KAAK,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,oBAAC,QAAQ,OAAG,GAAI,CAEpC,CACV,CAAC;AACJ,CAAC,CAAC;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
-
export const DefaultRouter = ({ children, publicPath }) => {
|
|
4
|
-
return React.createElement(BrowserRouter, { basename: publicPath }, children);
|
|
5
|
-
};
|
|
6
|
-
DefaultRouter.displayName = 'DefaultRouter';
|
|
7
|
-
//# sourceMappingURL=DefaultRouter_v5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRouter_v5.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouter_v5.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IAC/E,OAAO,oBAAC,aAAa,IAAC,QAAQ,EAAE,UAAU,IAAG,QAAQ,CAAiB,CAAC;AACzE,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
-
export const DefaultRouter = ({ children, publicPath }) => {
|
|
4
|
-
return React.createElement(BrowserRouter, { basename: publicPath }, children);
|
|
5
|
-
};
|
|
6
|
-
DefaultRouter.displayName = 'DefaultRouter';
|
|
7
|
-
//# sourceMappingURL=DefaultRouter_v6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRouter_v6.js","sourceRoot":"","sources":["../../src/defaults/DefaultRouter_v6.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IAC/E,OAAO,oBAAC,aAAa,IAAC,QAAQ,EAAE,UAAU,IAAG,QAAQ,CAAiB,CAAC;AACzE,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigationApi } from '../types';
|
|
2
|
-
export declare function useRouterContext(): any;
|
|
3
|
-
export declare function useCurrentNavigation(): void;
|
|
4
|
-
export declare function createRedirect(): () => any;
|
|
5
|
-
export declare function createNavigation(publicPath: string): NavigationApi;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const _noop = () => { };
|
|
2
|
-
export function useRouterContext() {
|
|
3
|
-
return undefined;
|
|
4
|
-
}
|
|
5
|
-
export function useCurrentNavigation() { }
|
|
6
|
-
export function createRedirect() {
|
|
7
|
-
return () => null;
|
|
8
|
-
}
|
|
9
|
-
export function createNavigation(publicPath) {
|
|
10
|
-
return {
|
|
11
|
-
get path() {
|
|
12
|
-
return location.pathname;
|
|
13
|
-
},
|
|
14
|
-
get url() {
|
|
15
|
-
const loc = location;
|
|
16
|
-
return `${loc.pathname}${loc.search}${loc.hash}`;
|
|
17
|
-
},
|
|
18
|
-
push(target, state) { },
|
|
19
|
-
replace(target, state) { },
|
|
20
|
-
go(n) { },
|
|
21
|
-
block(blocker) {
|
|
22
|
-
return _noop;
|
|
23
|
-
},
|
|
24
|
-
listen(listener) {
|
|
25
|
-
return _noop;
|
|
26
|
-
},
|
|
27
|
-
router: undefined,
|
|
28
|
-
publicPath,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=navigator_none.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigator_none.js","sourceRoot":"","sources":["../../src/defaults/navigator_none.tsx"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEvB,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,KAAI,CAAC;AAEzC,MAAM,UAAU,cAAc;IAC5B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO;QACL,IAAI,IAAI;YACN,OAAO,QAAQ,CAAC,QAAQ,CAAC;QAC3B,CAAC;QACD,IAAI,GAAG;YACL,MAAM,GAAG,GAAG,QAAQ,CAAC;YACrB,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,KAAK,IAAG,CAAC;QACtB,OAAO,CAAC,MAAM,EAAE,KAAK,IAAG,CAAC;QACzB,EAAE,CAAC,CAAC,IAAG,CAAC;QACR,KAAK,CAAC,OAAO;YACX,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,CAAC,QAAQ;YACb,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,EAAE,SAAS;QACjB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { NavigationApi } from '../types';
|
|
3
|
-
export declare function useRouterContext(): import("react-router").RouteComponentProps<{}, import("react-router").StaticContext, unknown>;
|
|
4
|
-
export declare function useCurrentNavigation(): void;
|
|
5
|
-
export declare function createRedirect(to: string): () => React.JSX.Element;
|
|
6
|
-
export declare function createNavigation(publicPath: string): NavigationApi;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { __RouterContext as RouterContext, Redirect, useLocation } from 'react-router';
|
|
3
|
-
let _nav;
|
|
4
|
-
const _noop = () => { };
|
|
5
|
-
export function useRouterContext() {
|
|
6
|
-
return React.useContext(RouterContext);
|
|
7
|
-
}
|
|
8
|
-
export function useCurrentNavigation() {
|
|
9
|
-
const ctx = useRouterContext();
|
|
10
|
-
const location = useLocation();
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
if (_nav) {
|
|
13
|
-
window.dispatchEvent(new CustomEvent('piral-navigate', {
|
|
14
|
-
detail: {
|
|
15
|
-
location,
|
|
16
|
-
},
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
}, [location]);
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
_nav = ctx.history;
|
|
22
|
-
return () => {
|
|
23
|
-
_nav = undefined;
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
}
|
|
27
|
-
export function createRedirect(to) {
|
|
28
|
-
return () => React.createElement(Redirect, { to: to });
|
|
29
|
-
}
|
|
30
|
-
export function createNavigation(publicPath) {
|
|
31
|
-
const enhance = (location, action) => ({
|
|
32
|
-
action,
|
|
33
|
-
location: {
|
|
34
|
-
get href() {
|
|
35
|
-
return _nav.createHref(location);
|
|
36
|
-
},
|
|
37
|
-
...location,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
get path() {
|
|
42
|
-
const loc = _nav ? _nav.location : location;
|
|
43
|
-
return loc.pathname;
|
|
44
|
-
},
|
|
45
|
-
get url() {
|
|
46
|
-
const loc = _nav ? _nav.location : location;
|
|
47
|
-
return `${loc.pathname}${loc.search}${loc.hash}`;
|
|
48
|
-
},
|
|
49
|
-
push(target, state) {
|
|
50
|
-
if (_nav) {
|
|
51
|
-
_nav.push(target, state);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
replace(target, state) {
|
|
55
|
-
if (_nav) {
|
|
56
|
-
_nav.replace(target, state);
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
go(n) {
|
|
60
|
-
if (_nav) {
|
|
61
|
-
_nav.go(n);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
block(blocker) {
|
|
65
|
-
if (!_nav) {
|
|
66
|
-
return _noop;
|
|
67
|
-
}
|
|
68
|
-
return _nav.block((location, action) => blocker(enhance(location, action)));
|
|
69
|
-
},
|
|
70
|
-
listen(listener) {
|
|
71
|
-
const handler = (e) => listener(enhance(e.detail.location, _nav.action));
|
|
72
|
-
window.addEventListener('piral-navigate', handler);
|
|
73
|
-
return () => {
|
|
74
|
-
window.removeEventListener('piral-navigate', handler);
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
router: {
|
|
78
|
-
get history() {
|
|
79
|
-
return _nav;
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
publicPath,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=navigator_v5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigator_v5.js","sourceRoot":"","sources":["../../src/defaults/navigator_v5.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,IAAI,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvF,IAAI,IAAa,CAAC;AAClB,MAAM,KAAK,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEvB,MAAM,UAAU,gBAAgB;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE;oBACN,QAAQ;iBACT;aACF,CAAC,CACH,CAAC;SACH;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,SAAS,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,GAAG,EAAE,CAAC,oBAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,GAAI,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,MAAM,OAAO,GAAG,CAAC,QAAkB,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC;QACvD,MAAM;QACN,QAAQ,EAAE;YACR,IAAI,IAAI;gBACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACnC,CAAC;YACD,GAAG,QAAQ;SACZ;KACF,CAAC,CAAC;IAEH,OAAO;QACL,IAAI,IAAI;YACN,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC5C,OAAO,GAAG,CAAC,QAAQ,CAAC;QACtB,CAAC;QACD,IAAI,GAAG;YACL,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC5C,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,KAAK;YAChB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;aAC1B;QACH,CAAC;QACD,OAAO,CAAC,MAAM,EAAE,KAAK;YACnB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;aAC7B;QACH,CAAC;QACD,EAAE,CAAC,CAAC;YACF,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACZ;QACH,CAAC;QACD,KAAK,CAAC,OAAO;YACX,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;YAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,CAAC,QAAQ;YACb,MAAM,OAAO,GAAG,CAAC,CAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAEtF,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;YAEnD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;YACxD,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,EAAE;YACN,IAAI,OAAO;gBACT,OAAO,IAAI,CAAC;YACd,CAAC;SACF;QACD,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { NavigationApi } from '../types';
|
|
3
|
-
export declare function useRouterContext(): unknown;
|
|
4
|
-
export declare function useCurrentNavigation(): void;
|
|
5
|
-
export declare function createRedirect(to: string): () => React.JSX.Element;
|
|
6
|
-
export declare function createNavigation(publicPath: string): NavigationApi;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
//@ts-ignore
|
|
3
|
-
import { UNSAFE_NavigationContext as RouterContext, Navigate, useLocation } from 'react-router';
|
|
4
|
-
let _nav;
|
|
5
|
-
const _noop = () => { };
|
|
6
|
-
export function useRouterContext() {
|
|
7
|
-
return React.useContext(RouterContext);
|
|
8
|
-
}
|
|
9
|
-
export function useCurrentNavigation() {
|
|
10
|
-
const ctx = useRouterContext();
|
|
11
|
-
const location = useLocation();
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
if (_nav) {
|
|
14
|
-
window.dispatchEvent(new CustomEvent('piral-navigate', {
|
|
15
|
-
detail: {
|
|
16
|
-
location,
|
|
17
|
-
},
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
}, [location]);
|
|
21
|
-
React.useEffect(() => {
|
|
22
|
-
_nav = ctx.navigator;
|
|
23
|
-
return () => {
|
|
24
|
-
_nav = undefined;
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
}
|
|
28
|
-
export function createRedirect(to) {
|
|
29
|
-
return () => React.createElement(Navigate, { to: to });
|
|
30
|
-
}
|
|
31
|
-
export function createNavigation(publicPath) {
|
|
32
|
-
const enhance = (info) => ({
|
|
33
|
-
...info,
|
|
34
|
-
location: {
|
|
35
|
-
get href() {
|
|
36
|
-
return _nav.createHref(info.location);
|
|
37
|
-
},
|
|
38
|
-
...info.location,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
get path() {
|
|
43
|
-
const loc = _nav ? _nav.location : location;
|
|
44
|
-
return loc.pathname;
|
|
45
|
-
},
|
|
46
|
-
get url() {
|
|
47
|
-
const loc = _nav ? _nav.location : location;
|
|
48
|
-
return `${loc.pathname}${loc.search}${loc.hash}`;
|
|
49
|
-
},
|
|
50
|
-
push(target, state) {
|
|
51
|
-
if (_nav) {
|
|
52
|
-
_nav.push(target, state);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
replace(target, state) {
|
|
56
|
-
if (_nav) {
|
|
57
|
-
_nav.replace(target, state);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
go(n) {
|
|
61
|
-
if (_nav) {
|
|
62
|
-
_nav.go(n);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
block(blocker) {
|
|
66
|
-
if (!_nav) {
|
|
67
|
-
return _noop;
|
|
68
|
-
}
|
|
69
|
-
return _nav.block((transition) => blocker(enhance(transition)));
|
|
70
|
-
},
|
|
71
|
-
listen(listener) {
|
|
72
|
-
const handler = (e) => listener(enhance(e.detail));
|
|
73
|
-
window.addEventListener('piral-navigate', handler);
|
|
74
|
-
return () => {
|
|
75
|
-
window.removeEventListener('piral-navigate', handler);
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
get router() {
|
|
79
|
-
return _nav;
|
|
80
|
-
},
|
|
81
|
-
publicPath,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=navigator_v6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigator_v6.js","sourceRoot":"","sources":["../../src/defaults/navigator_v6.tsx"],"names":[],"mappings":"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"}
|
package/esm/helpers.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PiletApiCreator, LoadPiletsOptions, CustomSpecLoaders, DefaultLoaderConfig, PiletLoader, PiletLifecycleHooks } from 'piral-base';
|
|
2
|
-
import type { DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
3
|
-
import type { Pilet, PiletRequester, GlobalStateContext, PiletLoadingStrategy, DependencySelector } from './types';
|
|
4
|
-
export interface PiletOptionsConfig {
|
|
5
|
-
context: GlobalStateContext;
|
|
6
|
-
hooks?: PiletLifecycleHooks;
|
|
7
|
-
loaders?: CustomSpecLoaders;
|
|
8
|
-
loaderConfig?: DefaultLoaderConfig;
|
|
9
|
-
availablePilets: Array<Pilet>;
|
|
10
|
-
strategy: PiletLoadingStrategy;
|
|
11
|
-
createApi: PiletApiCreator;
|
|
12
|
-
loadPilet: PiletLoader;
|
|
13
|
-
requestPilets: PiletRequester;
|
|
14
|
-
shareDependencies: DependencySelector;
|
|
15
|
-
debug?: DebuggerExtensionOptions;
|
|
16
|
-
}
|
|
17
|
-
export declare function createPiletOptions({ hooks, context, loaders, loaderConfig, availablePilets, strategy, createApi, loadPilet, requestPilets, shareDependencies, debug, }: PiletOptionsConfig): LoadPiletsOptions;
|
package/esm/helpers.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { getDefaultLoader, extendLoader, } from 'piral-base';
|
|
2
|
-
import { globalDependencies } from './modules';
|
|
3
|
-
import { integrateDebugger, integrateEmulator } from '../app.codegen';
|
|
4
|
-
export function createPiletOptions({ hooks, context, loaders, loaderConfig, availablePilets, strategy, createApi, loadPilet, requestPilets, shareDependencies, debug, }) {
|
|
5
|
-
const options = {
|
|
6
|
-
config: loaderConfig,
|
|
7
|
-
strategy,
|
|
8
|
-
loadPilet: extendLoader(loadPilet ?? getDefaultLoader(loaderConfig), loaders),
|
|
9
|
-
createApi,
|
|
10
|
-
pilets: availablePilets,
|
|
11
|
-
fetchPilets: requestPilets,
|
|
12
|
-
hooks,
|
|
13
|
-
dependencies: shareDependencies(globalDependencies),
|
|
14
|
-
};
|
|
15
|
-
integrateDebugger(context, options, debug);
|
|
16
|
-
integrateEmulator(context, options, debug);
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=helpers.js.map
|
package/esm/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,gBAAgB,EAChB,YAAY,GAGb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAgBtE,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,KAAK,GACc;IACnB,MAAM,OAAO,GAAsB;QACjC,MAAM,EAAE,YAAY;QACpB,QAAQ;QACR,SAAS,EAAE,YAAY,CAAC,SAAS,IAAI,gBAAgB,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;QAC7E,SAAS;QACT,MAAM,EAAE,eAAe;QACvB,WAAW,EAAE,aAAa;QAC1B,KAAK;QACL,YAAY,EAAE,iBAAiB,CAAC,kBAAkB,CAAC;KACpD,CAAC;IAEF,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAE3C,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/esm/hooks/action.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PiralActions, GlobalStateContext } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Hook that gets an action for manipulating the global state.
|
|
4
|
-
* @param action The name of the action to retrieve.
|
|
5
|
-
*/
|
|
6
|
-
export declare function useAction<T extends keyof PiralActions>(action: T): GlobalStateContext[T];
|
package/esm/hooks/action.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useGlobalStateContext } from './globalState';
|
|
2
|
-
/**
|
|
3
|
-
* Hook that gets an action for manipulating the global state.
|
|
4
|
-
* @param action The name of the action to retrieve.
|
|
5
|
-
*/
|
|
6
|
-
export function useAction(action) {
|
|
7
|
-
const ctx = useGlobalStateContext();
|
|
8
|
-
return ctx[action];
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=action.js.map
|
package/esm/hooks/action.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/hooks/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGtD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAA+B,MAAS;IAC/D,MAAM,GAAG,GAAG,qBAAqB,EAAE,CAAC;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC"}
|
package/esm/hooks/actions.d.ts
DELETED
package/esm/hooks/actions.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { StateContext } from '../state/stateContext';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that gets the actions for manipulating the global state.
|
|
5
|
-
*/
|
|
6
|
-
export function useActions() {
|
|
7
|
-
const { state, ...actions } = useContext(StateContext);
|
|
8
|
-
return actions;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=actions.js.map
|
package/esm/hooks/actions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/hooks/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAqB,YAAY,CAAC,CAAC;IAC3E,OAAO,OAAuB,CAAC;AACjC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { GlobalState } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Hook to obtain the global state context, which gives you directly
|
|
4
|
-
* all actions, state, and more of the Piral instance.
|
|
5
|
-
* If you are only interested in reading out the state, use the
|
|
6
|
-
* `useGlobalState` hook instead.
|
|
7
|
-
*/
|
|
8
|
-
export declare function useGlobalStateContext(): import("../types").GlobalStateContext;
|
|
9
|
-
/**
|
|
10
|
-
* Hook that yields the full global state.
|
|
11
|
-
* Any change to the global state yields the new state.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useGlobalState(): GlobalState;
|
|
14
|
-
/**
|
|
15
|
-
* Hook that yields the selected subset of the global state.
|
|
16
|
-
* Only changes to this subset will yield a new state.
|
|
17
|
-
* @param select The subset selection.
|
|
18
|
-
*/
|
|
19
|
-
export declare function useGlobalState<R>(select: (state: GlobalState) => R): R;
|
package/esm/hooks/globalState.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { StateContext } from '../state/stateContext';
|
|
3
|
-
/**
|
|
4
|
-
* Hook to obtain the global state context, which gives you directly
|
|
5
|
-
* all actions, state, and more of the Piral instance.
|
|
6
|
-
* If you are only interested in reading out the state, use the
|
|
7
|
-
* `useGlobalState` hook instead.
|
|
8
|
-
*/
|
|
9
|
-
export function useGlobalStateContext() {
|
|
10
|
-
return useContext(StateContext);
|
|
11
|
-
}
|
|
12
|
-
export function useGlobalState(select) {
|
|
13
|
-
const { state: useState } = useGlobalStateContext();
|
|
14
|
-
return useState(select);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=globalState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"globalState.js","sourceRoot":"","sources":["../../src/hooks/globalState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC;AAeD,MAAM,UAAU,cAAc,CAAI,MAAkC;IAClE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACpD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
|
package/esm/hooks/index.d.ts
DELETED
package/esm/hooks/index.js
DELETED
package/esm/hooks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
package/esm/hooks/media.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook to detect layout changes (e.g., which UI breakpoint was hit).
|
|
3
|
-
* @param queries The available queries matching the breakpoints.
|
|
4
|
-
* @param values The values mapping to the breakpoints
|
|
5
|
-
* @param defaultValue The default value.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useMedia<T>(queries: Array<string>, values: Array<T>, defaultValue: T): T;
|