@domql/router 3.8.0 → 3.8.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/cjs/index.js +5 -2
- package/dist/esm/index.js +5 -2
- package/dist/iife/index.js +5 -2
- package/index.js +4 -2
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -151,7 +151,7 @@ const defaultOptions = {
|
|
|
151
151
|
scrollToOffset: 0,
|
|
152
152
|
contentElementKey: "content",
|
|
153
153
|
scrollToOptions: { behavior: "smooth" },
|
|
154
|
-
useParamsMatching:
|
|
154
|
+
useParamsMatching: true
|
|
155
155
|
};
|
|
156
156
|
const router = (path, el, state = {}, options = {}) => {
|
|
157
157
|
const element = el || void 0;
|
|
@@ -204,7 +204,10 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
if (opts.pushState) {
|
|
207
|
-
|
|
207
|
+
try {
|
|
208
|
+
win.history.pushState(state, null, pathname + (search || "") + (hash || ""));
|
|
209
|
+
} catch (e) {
|
|
210
|
+
}
|
|
208
211
|
}
|
|
209
212
|
if (pathChanged || !hashChanged) {
|
|
210
213
|
const stateUpdate = { route, hash, debugging: false };
|
package/dist/esm/index.js
CHANGED
|
@@ -120,7 +120,7 @@ const defaultOptions = {
|
|
|
120
120
|
scrollToOffset: 0,
|
|
121
121
|
contentElementKey: "content",
|
|
122
122
|
scrollToOptions: { behavior: "smooth" },
|
|
123
|
-
useParamsMatching:
|
|
123
|
+
useParamsMatching: true
|
|
124
124
|
};
|
|
125
125
|
const router = (path, el, state = {}, options = {}) => {
|
|
126
126
|
const element = el || void 0;
|
|
@@ -173,7 +173,10 @@ const router = (path, el, state = {}, options = {}) => {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
if (opts.pushState) {
|
|
176
|
-
|
|
176
|
+
try {
|
|
177
|
+
win.history.pushState(state, null, pathname + (search || "") + (hash || ""));
|
|
178
|
+
} catch (e) {
|
|
179
|
+
}
|
|
177
180
|
}
|
|
178
181
|
if (pathChanged || !hashChanged) {
|
|
179
182
|
const stateUpdate = { route, hash, debugging: false };
|
package/dist/iife/index.js
CHANGED
|
@@ -498,7 +498,7 @@ var DomqlRouter = (() => {
|
|
|
498
498
|
scrollToOffset: 0,
|
|
499
499
|
contentElementKey: "content",
|
|
500
500
|
scrollToOptions: { behavior: "smooth" },
|
|
501
|
-
useParamsMatching:
|
|
501
|
+
useParamsMatching: true
|
|
502
502
|
};
|
|
503
503
|
var router = (path, el, state = {}, options = {}) => {
|
|
504
504
|
const element = el || void 0;
|
|
@@ -551,7 +551,10 @@ var DomqlRouter = (() => {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
if (opts.pushState) {
|
|
554
|
-
|
|
554
|
+
try {
|
|
555
|
+
win.history.pushState(state, null, pathname + (search || "") + (hash || ""));
|
|
556
|
+
} catch (e) {
|
|
557
|
+
}
|
|
555
558
|
}
|
|
556
559
|
if (pathChanged || !hashChanged) {
|
|
557
560
|
const stateUpdate = { route, hash, debugging: false };
|
package/index.js
CHANGED
|
@@ -154,7 +154,7 @@ const defaultOptions = {
|
|
|
154
154
|
scrollToOffset: 0,
|
|
155
155
|
contentElementKey: 'content',
|
|
156
156
|
scrollToOptions: { behavior: 'smooth' },
|
|
157
|
-
useParamsMatching:
|
|
157
|
+
useParamsMatching: true
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export const router = (path, el, state = {}, options = {}) => {
|
|
@@ -227,7 +227,9 @@ export const router = (path, el, state = {}, options = {}) => {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
if (opts.pushState) {
|
|
230
|
-
|
|
230
|
+
try {
|
|
231
|
+
win.history.pushState(state, null, pathname + (search || '') + (hash || ''))
|
|
232
|
+
} catch (e) {} // expected in sandboxed iframes (e.g. about:srcdoc) where pushState is restricted
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
if (pathChanged || !hashChanged) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/router",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"license": "CC-BY-NC-4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"prepublish": "npm run build && npm run copy:package:cjs"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@domql/element": "^3.8.
|
|
31
|
-
"@domql/utils": "^3.8.
|
|
30
|
+
"@domql/element": "^3.8.1",
|
|
31
|
+
"@domql/utils": "^3.8.1"
|
|
32
32
|
},
|
|
33
33
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
34
34
|
"devDependencies": {
|