@ctx-core/window 14.0.31 → 14.1.2
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/CHANGELOG.md +22 -0
- package/package.json +9 -9
- package/src/hostname__.d.ts +4 -0
- package/src/{hostname$_.js → hostname__.js} +2 -1
- package/src/index.d.ts +5 -5
- package/src/index.js +5 -5
- package/src/pathname__.d.ts +7 -0
- package/src/pathname__.js +8 -0
- package/src/window_location__.d.ts +7 -0
- package/src/{window_location$_.js → window_location__.js} +5 -4
- package/src/window_location_hostname__.d.ts +4 -0
- package/src/window_location_hostname__.js +10 -0
- package/src/window_location_pathname__.d.ts +5 -0
- package/src/window_location_pathname__.js +11 -0
- package/src/hostname$_.d.ts +0 -4
- package/src/pathname$_.d.ts +0 -5
- package/src/pathname$_.js +0 -5
- package/src/window_location$_.d.ts +0 -6
- package/src/window_location_hostname$_.d.ts +0 -4
- package/src/window_location_hostname$_.js +0 -9
- package/src/window_location_pathname$_.d.ts +0 -5
- package/src/window_location_pathname$_.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ctx-core/window
|
|
2
2
|
|
|
3
|
+
## 14.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @ctx-core: 20.9.0
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @ctx-core/dom@11.1.22
|
|
10
|
+
- @ctx-core/nanostores@1.4.3
|
|
11
|
+
- @ctx-core/object@22.2.2
|
|
12
|
+
|
|
13
|
+
## 14.1.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- @ctx-core/nanostores: ^1.4.1 -> ^1.4.2
|
|
18
|
+
|
|
19
|
+
## 14.1.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- \__ suffix aliased by \$_
|
|
24
|
+
|
|
3
25
|
## 14.0.31
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/window",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.2",
|
|
4
4
|
"description": "ctx-core window",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ctx-core/dom": "^11.1.
|
|
28
|
-
"@ctx-core/function": "^20.
|
|
29
|
-
"@ctx-core/nanostores": "^1.4.
|
|
30
|
-
"@ctx-core/object": "^22.2.
|
|
27
|
+
"@ctx-core/dom": "^11.1.22",
|
|
28
|
+
"@ctx-core/function": "^20.9.0",
|
|
29
|
+
"@ctx-core/nanostores": "^1.4.3",
|
|
30
|
+
"@ctx-core/object": "^22.2.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"c8": "^7.
|
|
33
|
+
"c8": "^7.12.0",
|
|
34
34
|
"check-dts": "^0.6.7",
|
|
35
|
-
"
|
|
35
|
+
"tsx": "^3.8.0",
|
|
36
36
|
"typescript": "next",
|
|
37
|
-
"uvu": "^0.5.
|
|
37
|
+
"uvu": "^0.5.6"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"clean": ":",
|
|
47
47
|
"exec": "$@",
|
|
48
48
|
"test": "pnpm test-unit && check-dts",
|
|
49
|
-
"test-unit": "
|
|
49
|
+
"test-unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
|
|
50
50
|
"test-unit-coverage": "c8 pnpm test-unit"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './hostname__'
|
|
2
|
+
export * from './pathname__'
|
|
3
|
+
export * from './window_location__'
|
|
4
|
+
export * from './window_location_hostname__'
|
|
5
|
+
export * from './window_location_pathname__'
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './hostname__.js'
|
|
2
|
+
export * from './pathname__.js'
|
|
3
|
+
export * from './window_location__.js'
|
|
4
|
+
export * from './window_location_hostname__.js'
|
|
5
|
+
export * from './window_location_pathname__.js'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WritableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { type B } from '@ctx-core/object'
|
|
3
|
+
export declare const window_location__:B<window_location__T>
|
|
4
|
+
export interface window_location__T extends WritableAtom_<Location|undefined> {
|
|
5
|
+
reset_window_location:()=>void;
|
|
6
|
+
}
|
|
7
|
+
export { window_location__ as window_location$_ }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { has_dom } from '@ctx-core/dom'
|
|
2
2
|
import { atom_ } from '@ctx-core/nanostores'
|
|
3
3
|
import { assign, be_ } from '@ctx-core/object'
|
|
4
|
-
export const
|
|
5
|
-
const
|
|
4
|
+
export const window_location__ = be_('window_location__', ()=>{
|
|
5
|
+
const window_location_ = atom_(undefined)
|
|
6
6
|
const window_location_reload_popstate_bound$ = atom_(undefined)
|
|
7
7
|
if (has_dom) {
|
|
8
8
|
reset_window_location()
|
|
9
9
|
}
|
|
10
|
-
return assign(
|
|
10
|
+
return assign(window_location_, {
|
|
11
11
|
reset_window_location
|
|
12
12
|
})
|
|
13
13
|
function reset_window_location() {
|
|
@@ -16,6 +16,7 @@ export const window_location$_ = be_('window_location$', ()=>{
|
|
|
16
16
|
window_location_reload_popstate_bound$.set(true)
|
|
17
17
|
window.addEventListener('popstate', reset_window_location)
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
window_location_.set(window.location)
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
|
+
export { window_location__ as window_location$_ }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { be_ } from '@ctx-core/object'
|
|
3
|
+
import { hostname__ } from './hostname__.js'
|
|
4
|
+
import { window_location__ } from './window_location__.js'
|
|
5
|
+
export const window_location_hostname__ = be_('window_location_hostname__', (ctx)=>computed_([
|
|
6
|
+
hostname__(ctx),
|
|
7
|
+
window_location__(ctx),
|
|
8
|
+
], (hostname, window_location)=>
|
|
9
|
+
window_location && window_location.hostname || hostname || ''))
|
|
10
|
+
export { window_location_hostname__ as window_location_hostname$_ }
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { type B } from '@ctx-core/object'
|
|
3
|
+
export declare const window_location_pathname__:B<ReadableAtom_<window_location_pathname_T>>
|
|
4
|
+
export declare type window_location_pathname_T = string|undefined;
|
|
5
|
+
export { window_location_pathname__ as window_location_pathname$_ }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
+
import { be_ } from '@ctx-core/object'
|
|
3
|
+
import { pathname__ } from './pathname__.js'
|
|
4
|
+
import { window_location__ } from './window_location__.js'
|
|
5
|
+
export const window_location_pathname__ = be_('window_location_pathname__', ctx=>
|
|
6
|
+
computed_([
|
|
7
|
+
pathname__(ctx),
|
|
8
|
+
window_location__(ctx),
|
|
9
|
+
], (pathname, location__window)=>
|
|
10
|
+
location__window && location__window.pathname || pathname || ''))
|
|
11
|
+
export { window_location_pathname__ as window_location_pathname$_ }
|
package/src/hostname$_.d.ts
DELETED
package/src/pathname$_.d.ts
DELETED
package/src/pathname$_.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WritableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { B } from '@ctx-core/object'
|
|
3
|
-
export declare const window_location$_:B<window_location$_T>
|
|
4
|
-
export interface window_location$_T extends WritableAtom_<Location|undefined> {
|
|
5
|
-
reset_window_location:()=>void;
|
|
6
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { hostname$_ } from './hostname$_.js'
|
|
4
|
-
import { window_location$_ } from './window_location$_.js'
|
|
5
|
-
export const window_location_hostname$_ = be_('window_location_hostname$', (ctx)=>computed_([
|
|
6
|
-
hostname$_(ctx),
|
|
7
|
-
window_location$_(ctx),
|
|
8
|
-
], (hostname, window_location)=>
|
|
9
|
-
window_location && window_location.hostname || hostname || ''))
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ReadableAtom_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { B } from '@ctx-core/object'
|
|
3
|
-
export declare const window_location_pathname$_:B<window_location_pathname$_T>
|
|
4
|
-
export declare type window_location_pathname_T = string|undefined;
|
|
5
|
-
export declare type window_location_pathname$_T = ReadableAtom_<window_location_pathname_T>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { computed_ } from '@ctx-core/nanostores'
|
|
2
|
-
import { be_ } from '@ctx-core/object'
|
|
3
|
-
import { pathname$_ } from './pathname$_.js'
|
|
4
|
-
import { window_location$_ } from './window_location$_.js'
|
|
5
|
-
export const window_location_pathname$_ = be_('window_location_pathname$', (ctx)=>computed_([
|
|
6
|
-
pathname$_(ctx),
|
|
7
|
-
window_location$_(ctx),
|
|
8
|
-
], (pathname, location__window)=>
|
|
9
|
-
location__window && location__window.pathname || pathname || ''))
|