@thoughtbot/superglue 0.54.0 → 1.0.0
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/.prettierrc +3 -1
- package/dist/action_creators.d.mts +1 -23
- package/dist/action_creators.mjs +3 -7
- package/dist/{chunk-MNVGYKSD.mjs → chunk-LGUVOEZ3.mjs} +253 -242
- package/dist/chunk-LGUVOEZ3.mjs.map +1 -0
- package/dist/cjs/action_creators.cjs +215 -172
- package/dist/cjs/action_creators.cjs.map +1 -1
- package/dist/cjs/superglue.cjs +666 -766
- package/dist/cjs/superglue.cjs.map +1 -1
- package/dist/index-BYr1PoYr.d.mts +232 -0
- package/dist/superglue.d.mts +53 -54
- package/dist/superglue.mjs +368 -482
- package/dist/superglue.mjs.map +1 -1
- package/package.json +9 -10
- package/typedoc.json +3 -1
- package/dist/chunk-MNVGYKSD.mjs.map +0 -1
- package/dist/index-DfWsUSqv.d.mts +0 -246
package/dist/superglue.d.mts
CHANGED
|
@@ -1,65 +1,64 @@
|
|
|
1
|
+
import * as history from 'history';
|
|
2
|
+
import { J as JSONMappable, K as Keypath, a as JSONValue, P as PageKey, N as NavigationContextProps, b as NavigationProviderProps, c as NavigateTo, V as VisitResponse, F as FetchArgs, S as SuperglueState, d as SuperglueStore, e as SetupProps, A as ApplicationVisit, f as ApplicationRemote, H as Handlers, g as ApplicationProps } from './index-BYr1PoYr.mjs';
|
|
3
|
+
export { t as AllPages, O as BasicRequestInit, _ as BeforeSave, Q as BuildStore, T as BuildVisitAndRemote, C as ComponentIdentifier, D as Defer, L as DefermentThunk, y as Dispatch, q as Fragment, G as GraftResponse, a0 as GraftingErrorAction, $ as GraftingSuccessAction, z as HistoryState, l as JSONKeyable, k as JSONObject, j as JSONPrimitive, M as Meta, E as MetaThunk, i as NavigationAction, n as Page, o as PageResponse, m as ParsedResponse, Y as Remote, x as RemoteCreator, Z as RemoteProps, R as RestoreStrategy, u as RootState, B as SaveAndProcessPageThunk, U as UJSHandlers, W as Visit, w as VisitCreator, v as VisitMeta, I as VisitMetaThunk, X as VisitProps, p as pageReducer, r as rootReducer, s as saveAndProcessPage, h as superglueReducer } from './index-BYr1PoYr.mjs';
|
|
1
4
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { UnknownAction, Middleware } from 'redux';
|
|
4
|
-
import { BrowserHistory } from 'history';
|
|
5
|
-
import '@reduxjs/toolkit';
|
|
6
|
-
import 'react-redux';
|
|
7
|
-
|
|
8
|
-
declare function pageReducer(state: AllPages | undefined, action: PageReducerAction | UnknownAction): AllPages;
|
|
9
|
-
declare function superglueReducer(state: Partial<SuperglueState> | undefined, action: SuperglueReducerAction | UnknownAction): Partial<SuperglueState>;
|
|
10
|
-
declare const rootReducer: {
|
|
11
|
-
superglue: typeof superglueReducer;
|
|
12
|
-
pages: typeof pageReducer;
|
|
13
|
-
};
|
|
5
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
14
6
|
|
|
15
7
|
declare function getIn(node: JSONMappable, path: Keypath): JSONValue;
|
|
16
8
|
|
|
17
9
|
declare function urlToPageKey(url: string): PageKey;
|
|
18
10
|
|
|
19
|
-
declare const
|
|
20
|
-
declare const
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
declare const NavigationContext: React.Context<NavigationContextProps>;
|
|
12
|
+
declare const NavigationProvider: React.ForwardRefExoticComponent<NavigationProviderProps & React.RefAttributes<{
|
|
13
|
+
navigateTo: NavigateTo | null;
|
|
14
|
+
}>>;
|
|
15
|
+
|
|
23
16
|
declare const GRAFTING_ERROR = "@@superglue/GRAFTING_ERROR";
|
|
24
17
|
declare const GRAFTING_SUCCESS = "@@superglue/GRAFTING_SUCCESS";
|
|
25
|
-
declare const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
declare const saveResponse: _reduxjs_toolkit.ActionCreatorWithPreparedPayload<[{
|
|
19
|
+
pageKey: string;
|
|
20
|
+
page: VisitResponse;
|
|
21
|
+
}], {
|
|
22
|
+
pageKey: string;
|
|
23
|
+
page: VisitResponse;
|
|
24
|
+
}, "@@superglue/SAVE_RESPONSE", never, never>;
|
|
25
|
+
declare const updateFragments: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
26
|
+
name: string;
|
|
27
|
+
path: Keypath;
|
|
28
|
+
pageKey: PageKey;
|
|
29
|
+
value: JSONMappable;
|
|
30
|
+
previousValue?: JSONMappable;
|
|
31
|
+
}, string>;
|
|
32
|
+
declare const copyPage: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
33
|
+
from: PageKey;
|
|
34
|
+
to: PageKey;
|
|
35
|
+
}, string>;
|
|
36
|
+
declare const removePage: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
37
|
+
pageKey: PageKey;
|
|
38
|
+
}, string>;
|
|
39
|
+
declare const beforeFetch: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
40
|
+
fetchArgs: FetchArgs;
|
|
41
|
+
}, string>;
|
|
42
|
+
declare const beforeVisit: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
43
|
+
currentPageKey: PageKey;
|
|
44
|
+
fetchArgs: FetchArgs;
|
|
45
|
+
}, string>;
|
|
46
|
+
declare const beforeRemote: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
47
|
+
currentPageKey: PageKey;
|
|
48
|
+
fetchArgs: FetchArgs;
|
|
49
|
+
}, string>;
|
|
29
50
|
|
|
30
|
-
declare
|
|
51
|
+
declare function useSuperglue(): SuperglueState;
|
|
52
|
+
declare function useContent<T = JSONMappable>(): T;
|
|
31
53
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
private navigatorRef;
|
|
42
|
-
private initialPageKey;
|
|
43
|
-
private store;
|
|
44
|
-
private history;
|
|
45
|
-
private connectedMapping;
|
|
46
|
-
private ujsHandlers;
|
|
47
|
-
private visit;
|
|
48
|
-
private remote;
|
|
49
|
-
constructor(props: ApplicationProps);
|
|
50
|
-
abstract visitAndRemote(navigatorRef: React.RefObject<Nav>, store: SuperglueStore): {
|
|
51
|
-
visit: Visit;
|
|
52
|
-
remote: Remote;
|
|
53
|
-
};
|
|
54
|
-
componentDidMount(): void;
|
|
55
|
-
componentWillUnmount(): void;
|
|
56
|
-
abstract buildStore(initialState: {
|
|
57
|
-
pages: AllPages;
|
|
58
|
-
[key: string]: JSONValue;
|
|
59
|
-
}, reducer: typeof rootReducer): SuperglueStore;
|
|
60
|
-
createHistory(): BrowserHistory;
|
|
61
|
-
abstract mapping(): Record<string, React.ComponentType>;
|
|
62
|
-
render(): JSX.Element;
|
|
63
|
-
}
|
|
54
|
+
declare const prepareStore: (store: SuperglueStore, initialPage: VisitResponse, path: string) => void;
|
|
55
|
+
declare const setup: ({ initialPage, baseUrl, path, store, buildVisitAndRemote, history, navigatorRef, }: SetupProps) => {
|
|
56
|
+
visit: ApplicationVisit;
|
|
57
|
+
remote: ApplicationRemote;
|
|
58
|
+
nextHistory: history.History;
|
|
59
|
+
initialPageKey: string;
|
|
60
|
+
ujs: Handlers;
|
|
61
|
+
};
|
|
62
|
+
declare function Application({ initialPage, baseUrl, path, store, buildVisitAndRemote, history, mapping, ...rest }: ApplicationProps): React.JSX.Element;
|
|
64
63
|
|
|
65
|
-
export {
|
|
64
|
+
export { Application, ApplicationProps, ApplicationRemote, ApplicationVisit, FetchArgs, GRAFTING_ERROR, GRAFTING_SUCCESS, Handlers, JSONMappable, JSONValue, Keypath, NavigateTo, NavigationContext, NavigationContextProps, NavigationProvider, NavigationProviderProps, PageKey, SetupProps, SuperglueState, SuperglueStore, VisitResponse, beforeFetch, beforeRemote, beforeVisit, copyPage, getIn, prepareStore, removePage, saveResponse, setup, updateFragments, urlToPageKey, useContent, useSuperglue };
|