@ctx-core/window 16.0.101 → 16.0.104
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/hostname/index.js +7 -6
- package/package.json +2 -2
- package/pathname/index.js +4 -4
- package/window_location/index.js +12 -10
package/hostname/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="ctx-core" />
|
|
2
2
|
/// <reference types="./index.d.ts" />
|
|
3
|
-
import {
|
|
3
|
+
import { id_be_memo_pair_, nullish__none_ } from 'ctx-core/rmemo'
|
|
4
4
|
import { window_location_ } from '../window_location/index.js'
|
|
5
5
|
/** @type {typeof hostname$_} */
|
|
6
6
|
export const [
|
|
7
7
|
hostname$_,
|
|
8
8
|
hostname_,
|
|
9
|
-
] =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
] = id_be_memo_pair_(
|
|
10
|
+
'hostname',
|
|
11
|
+
ctx=>
|
|
12
|
+
nullish__none_([window_location_(ctx)],
|
|
13
|
+
window_location=>
|
|
14
|
+
window_location.hostname))
|
|
14
15
|
export {
|
|
15
16
|
hostname$_ as hostname__,
|
|
16
17
|
hostname$_ as window_location_hostname__,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/window",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.104",
|
|
4
4
|
"description": "ctx-core window",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"ctx-core": "^
|
|
38
|
+
"ctx-core": "^7.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"c8": "^9.1.0",
|
package/pathname/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="ctx-core" />
|
|
2
2
|
/// <reference types="./index.d.ts" />
|
|
3
|
-
import {
|
|
3
|
+
import { id_be_memo_pair_, nullish__none_ } from 'ctx-core/rmemo'
|
|
4
4
|
import { window_location_ } from '../window_location/index.js'
|
|
5
5
|
/** @typedef {ctx_T} */
|
|
6
6
|
/** @type {typeof pathname$_} */
|
|
7
7
|
export const [
|
|
8
8
|
pathname$_,
|
|
9
9
|
pathname_,
|
|
10
|
-
] =
|
|
10
|
+
] = id_be_memo_pair_(
|
|
11
|
+
'pathname',
|
|
11
12
|
ctx=>
|
|
12
13
|
nullish__none_([window_location_(ctx)],
|
|
13
14
|
window_location=>
|
|
14
|
-
window_location.pathname)
|
|
15
|
-
{ id: 'pathname' })
|
|
15
|
+
window_location.pathname))
|
|
16
16
|
export {
|
|
17
17
|
pathname$_ as pathname__,
|
|
18
18
|
pathname$_ as b__pathname,
|
package/window_location/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { be_ } from 'ctx-core/be'
|
|
3
3
|
/// <reference types="./index.d.ts" />
|
|
4
4
|
import { is_browser_, is_server_ } from 'ctx-core/env'
|
|
5
|
-
import {
|
|
5
|
+
import { id_be_memo_pair_, sig_ } from 'ctx-core/rmemo'
|
|
6
6
|
const window_location__sig$_ = be_(()=>
|
|
7
7
|
sig_())
|
|
8
8
|
/** @type {typeof window_location$_} */
|
|
@@ -10,20 +10,22 @@ export const [
|
|
|
10
10
|
window_location$_,
|
|
11
11
|
window_location_,
|
|
12
12
|
] = /** @type {be_memo_pair_T<Location>} */
|
|
13
|
-
|
|
13
|
+
id_be_memo_pair_(
|
|
14
|
+
'window_location',
|
|
14
15
|
ctx=>window_location__sig$_(ctx)(),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
[
|
|
17
|
+
ctx=>{
|
|
18
|
+
if (is_browser_()) {
|
|
19
|
+
let onpopstate = ()=>window_location__reset(ctx)
|
|
20
|
+
window.addEventListener('popstate', onpopstate)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
])
|
|
22
24
|
export { window_location$_ as window_location__ }
|
|
23
25
|
/**
|
|
24
26
|
* @param {ctx_T}ctx
|
|
25
27
|
*/
|
|
26
28
|
export function window_location__reset(ctx) {
|
|
27
29
|
if (is_server_()) return
|
|
28
|
-
window_location__sig$_(ctx).
|
|
30
|
+
window_location__sig$_(ctx).set(window.location)
|
|
29
31
|
}
|