@codeleap/web-navigation 6.8.0 → 7.0.1

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/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './navigation';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -0,0 +1,233 @@
1
+ import deepmerge from '@fastify/deepmerge';
2
+ const IS_SSR = typeof window === 'undefined' || typeof history === 'undefined';
3
+ const defaultConfig = {
4
+ historyEnabled: false,
5
+ getMetadata: () => { },
6
+ };
7
+ /**
8
+ * Type-safe navigation controller that wraps a platform-specific navigator
9
+ * (e.g. Next.js `router.push`) and enforces route param contracts at compile time.
10
+ *
11
+ * `R` is the routes definition object — nested keys map to `{{param}}`-bearing
12
+ * path strings. `O` is the navigator's option bag. `C` is the shared context
13
+ * forwarded to every navigator call so adapters can read app-level state without
14
+ * closure coupling.
15
+ *
16
+ * The class is SSR-safe: any method that touches `window` or `history` short-circuits
17
+ * when running outside a browser environment.
18
+ */
19
+ export class Navigation {
20
+ get history() {
21
+ return this._history;
22
+ }
23
+ putHistory(path, info = {}) {
24
+ var _a, _b, _c;
25
+ const idx = Object.keys(this._history).length + 1;
26
+ const origin = IS_SSR ? null : (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin;
27
+ const value = {
28
+ [idx]: {
29
+ origin,
30
+ date: new Date(),
31
+ path,
32
+ metadata: (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.getMetadata) === null || _c === void 0 ? void 0 : _c.call(_b),
33
+ info,
34
+ },
35
+ };
36
+ this._history = this.merge(this._history, value);
37
+ }
38
+ merge(obj, addObj) {
39
+ return deepmerge({ all: true })(obj !== null && obj !== void 0 ? obj : {}, addObj !== null && addObj !== void 0 ? addObj : {});
40
+ }
41
+ /**
42
+ * @param routes Nested object whose leaf values are path strings with optional
43
+ * `{{param}}` placeholders. Dot-notation keys derived from this object become
44
+ * the typed route identifiers accepted by `navigate`, `getPath`, etc.
45
+ * @param navigator Platform adapter called for every navigation; receives the
46
+ * resolved path, stripped options, and the current `context` value.
47
+ * @param config Optional behaviour flags. Merged with defaults, so partial
48
+ * configs are safe.
49
+ */
50
+ constructor(routes, navigator, config = {}) {
51
+ this._history = {};
52
+ this.config = defaultConfig;
53
+ this.context = {};
54
+ this.navigator = null;
55
+ this.routes = {};
56
+ this.navigator = navigator;
57
+ this.routes = routes;
58
+ this.config = this.merge(this.config, config);
59
+ }
60
+ /**
61
+ * Checks if the user is on a certain route based on the parameters passed
62
+ * @param route Route that will be used to direct
63
+ * @param routeParams Parameters that will be applied to the route
64
+ * @param exact Accurate path checking - default false
65
+ * @returns Is on the route - boolean
66
+ */
67
+ isCurrentRoute(route,
68
+ // @ts-expect-error
69
+ routeParams = {}, exact = false) {
70
+ var _a;
71
+ if (IS_SSR)
72
+ return false;
73
+ let path = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.pathname;
74
+ // @ts-ignore
75
+ const routePath = this.getPathWithParams(route, routeParams);
76
+ const isRootPath = routePath === '/';
77
+ if (isRootPath) {
78
+ const { pathname, origin, href } = window.location || {};
79
+ path = href === null || href === void 0 ? void 0 : href.replace(path, '');
80
+ path = path === null || path === void 0 ? void 0 : path.replace(origin, '');
81
+ return !path || pathname == routePath;
82
+ }
83
+ if (exact) {
84
+ return path === null || path === void 0 ? void 0 : path.endsWith(routePath);
85
+ }
86
+ if (path === null || path === void 0 ? void 0 : path.includes(routePath)) {
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ /**
92
+ * Get the path from the route
93
+ * @param route Route that will be used to direct
94
+ * @returns Path - string
95
+ */
96
+ getPath(route) {
97
+ var _a, _b;
98
+ let path = this.routes;
99
+ // @ts-ignore
100
+ if (route === null || route === void 0 ? void 0 : route.includes('.')) {
101
+ // @ts-ignore
102
+ const indexesAccess = route === null || route === void 0 ? void 0 : route.split('.');
103
+ for (const index of indexesAccess) {
104
+ path = path === null || path === void 0 ? void 0 : path[index];
105
+ }
106
+ }
107
+ else {
108
+ // @ts-ignore
109
+ path = path === null || path === void 0 ? void 0 : path[route];
110
+ }
111
+ return (_b = (_a = String(path)) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a);
112
+ }
113
+ /**
114
+ * Get the path from the route and route params
115
+ * @param route Route that will be used to direct
116
+ * @param routeParams Parameters that will be applied to the route
117
+ * @returns Path - string
118
+ */
119
+ getPathWithParams(route,
120
+ // @ts-expect-error
121
+ routeParams = {}) {
122
+ let path = this.getPath(route);
123
+ for (const key in routeParams) {
124
+ const value = String(routeParams === null || routeParams === void 0 ? void 0 : routeParams[key]);
125
+ const searchPartial = `{{${key}}}`;
126
+ if (path === null || path === void 0 ? void 0 : path.includes(searchPartial)) {
127
+ path = path === null || path === void 0 ? void 0 : path.replace(searchPartial, encodeURIComponent(value));
128
+ }
129
+ }
130
+ if (!(path === null || path === void 0 ? void 0 : path.startsWith('/'))) {
131
+ path = '/' + path;
132
+ }
133
+ if (!(path === null || path === void 0 ? void 0 : path.endsWith('/'))) {
134
+ path = path + '/';
135
+ }
136
+ return path === null || path === void 0 ? void 0 : path.trim();
137
+ }
138
+ /**
139
+ * Function to navigate to the previous page, if history is enabled, the penultimate record will be used,
140
+ * otherwise the browser's own api with "history.back()"
141
+ */
142
+ goBack() {
143
+ var _a, _b, _c, _d;
144
+ if (IS_SSR)
145
+ return;
146
+ if (!this.config.historyEnabled) {
147
+ (_a = history === null || history === void 0 ? void 0 : history.back) === null || _a === void 0 ? void 0 : _a.call(history);
148
+ return;
149
+ }
150
+ const lastIdx = (_b = Object.keys(this.history)) === null || _b === void 0 ? void 0 : _b.length;
151
+ const historyData = this.history[lastIdx - 1];
152
+ if (!historyData) {
153
+ throw new Error('Not find back route');
154
+ }
155
+ const info = this.merge(historyData === null || historyData === void 0 ? void 0 : historyData.info, {
156
+ 'action': 'goBack',
157
+ });
158
+ this.to(historyData === null || historyData === void 0 ? void 0 : historyData.path, (_d = (_c = historyData === null || historyData === void 0 ? void 0 : historyData.info) === null || _c === void 0 ? void 0 : _c.options) !== null && _d !== void 0 ? _d : {}, info);
159
+ }
160
+ /**
161
+ * Main function to navigate between the app using the route system with dynamic parameters
162
+ * @param route Route that will be used to direct
163
+ * @param options Route parameters (marked by {{}}), which will be automatically shown if they exist, and navigator options and route queryParams can also be passed through the "params" property
164
+ */
165
+ navigate(route,
166
+ // @ts-expect-error
167
+ options = {}) {
168
+ // @ts-ignore
169
+ let path = this.getPath(route);
170
+ let _options = {};
171
+ let params = null;
172
+ let routeParams = {};
173
+ const queryParamsKey = 'params';
174
+ for (const key in options) {
175
+ const value = options === null || options === void 0 ? void 0 : options[key];
176
+ const searchPartial = `{{${key}}}`;
177
+ if (path === null || path === void 0 ? void 0 : path.includes(searchPartial)) {
178
+ path = path === null || path === void 0 ? void 0 : path.replace(searchPartial, encodeURIComponent(String(value)));
179
+ routeParams = this.merge(routeParams, { [key]: String(value) });
180
+ }
181
+ else if (key == queryParamsKey) {
182
+ params = value;
183
+ }
184
+ else {
185
+ _options = this.merge(_options, { [key]: value });
186
+ }
187
+ }
188
+ if (!(path === null || path === void 0 ? void 0 : path.startsWith('/'))) {
189
+ path = '/' + path;
190
+ }
191
+ if (typeof params === 'object') {
192
+ let searchParams = null;
193
+ for (const paramKey in (params !== null && params !== void 0 ? params : {})) {
194
+ const value = params === null || params === void 0 ? void 0 : params[paramKey];
195
+ const param = `${paramKey}=${encodeURIComponent(value)}`;
196
+ const separator = searchParams == null ? '' : '&';
197
+ searchParams = `${searchParams !== null && searchParams !== void 0 ? searchParams : ''}${separator}${param}`;
198
+ }
199
+ if (typeof searchParams === 'string') {
200
+ if (path === null || path === void 0 ? void 0 : path.endsWith('/')) {
201
+ path = path.slice(0, -1);
202
+ }
203
+ path = `${path}?${searchParams}`;
204
+ }
205
+ }
206
+ if (!(path === null || path === void 0 ? void 0 : path.endsWith('/')) && !params) {
207
+ path = path + '/';
208
+ }
209
+ this.to(path === null || path === void 0 ? void 0 : path.trim(), _options, {
210
+ params,
211
+ routeParams,
212
+ });
213
+ }
214
+ /**
215
+ * Calls the navigator to direct the user to a page
216
+ * @param path Path to which the user will be taken
217
+ * @param options Options that will be passed to the navigator
218
+ * @param info Information that will be added to the history
219
+ */
220
+ to(path, options = null, info = {}) {
221
+ if (this.config.historyEnabled) {
222
+ this.putHistory(path, this.merge(options, info));
223
+ }
224
+ this.navigator(path, options, this.context);
225
+ }
226
+ /**
227
+ * Clear history data
228
+ */
229
+ wipeHistory() {
230
+ this._history = {};
231
+ }
232
+ }
233
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../src/navigation.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAA;AAE9E,MAAM,aAAa,GAAoB;IACrC,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;CACvB,CAAA;AAOD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,UAAU;IAKrB,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAIO,UAAU,CAAC,IAAe,EAAE,OAAY,EAAE;;QAChD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;QAEjD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,MAAM,CAAA;QAEvD,MAAM,KAA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.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codeleap/web-navigation",
3
- "version": "6.8.0",
4
- "main": "src/index.ts",
3
+ "version": "7.0.1",
4
+ "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
7
7
  ".": {