@ctx-core/window 12.0.8 → 13.0.3
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 +36 -0
- package/dist/hostname$_b.d.ts +2 -2
- package/dist/hostname$_b.js +2 -2
- package/dist/hostname$_b.js.map +1 -1
- package/dist/pathname$_b.d.ts +2 -2
- package/dist/pathname$_b.js +2 -2
- package/dist/pathname$_b.js.map +1 -1
- package/dist/window_location$_b.d.ts +2 -2
- package/dist/window_location$_b.js +4 -4
- package/dist/window_location$_b.js.map +1 -1
- package/dist/window_location_hostname$_b.d.ts +2 -2
- package/dist/window_location_hostname$_b.js +3 -3
- package/dist/window_location_hostname$_b.js.map +1 -1
- package/dist/window_location_pathname$_b.d.ts +2 -2
- package/dist/window_location_pathname$_b.js +3 -3
- package/dist/window_location_pathname$_b.js.map +1 -1
- package/package.json +7 -8
- package/src/hostname$_b.ts +3 -3
- package/src/pathname$_b.ts +3 -3
- package/src/window_location$_b.ts +5 -5
- package/src/window_location_hostname$_b.ts +4 -4
- package/src/window_location_pathname$_b.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @ctx-core/window
|
|
2
2
|
|
|
3
|
+
## 13.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- update dependencies
|
|
8
|
+
|
|
9
|
+
## 13.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @ctx-core/nanostores@0.2.0
|
|
15
|
+
|
|
16
|
+
## 13.0.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- update dependencies
|
|
21
|
+
|
|
22
|
+
## 13.0.0
|
|
23
|
+
|
|
24
|
+
### Major Changes
|
|
25
|
+
|
|
26
|
+
- using @ctx-core/nanostores for stores instead of @ctx-core/store,@ctx-core/svelte
|
|
27
|
+
|
|
28
|
+
## 12.0.9
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- fix: error TS6059: \* is not under 'rootDir': package.json: types: ./dist/index.d.ts
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @ctx-core/dom@11.0.48
|
|
35
|
+
- @ctx-core/function@20.2.20
|
|
36
|
+
- @ctx-core/object@22.0.8
|
|
37
|
+
- @ctx-core/store@27.0.55
|
|
38
|
+
|
|
3
39
|
## 12.0.8
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/dist/hostname$_b.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { WritableAtom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
3
|
export declare const hostname$_b: B<hostname$_T>;
|
|
4
|
-
export declare type hostname$_T =
|
|
4
|
+
export declare type hostname$_T = WritableAtom$<string | undefined>;
|
|
5
5
|
export { hostname$_b as b__hostname };
|
package/dist/hostname$_b.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { atom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { writable$ } from '@ctx-core/store';
|
|
3
3
|
const key = 'hostname$';
|
|
4
|
-
export const hostname$_b = be_(key, ()=>
|
|
4
|
+
export const hostname$_b = be_(key, ()=>atom$(undefined)
|
|
5
5
|
);
|
|
6
6
|
export { hostname$_b as b__hostname };
|
|
7
7
|
|
package/dist/hostname$_b.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hostname$_b.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/hostname$_b.ts"],"sourcesContent":["import { WritableAtom$, atom$ } from '@ctx-core/nanostores'\nimport { B, be_ } from '@ctx-core/object'\nconst key = 'hostname$'\nexport const hostname$_b:B<hostname$_T> = be_(key, ()=>\n\tatom$(undefined) as hostname$_T\n)\nexport type hostname$_T = WritableAtom$<string|undefined>\nexport { hostname$_b as b__hostname }\n"],"names":["atom$","be_","key","hostname$_b","undefined","b__hostname"],"mappings":"AAAA,MAAM,GAAkBA,KAAK,QAAQ,CAAsB;AAC3D,MAAM,GAAMC,GAAG,QAAQ,CAAkB;AACzC,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAAkBF,GAAG,CAACC,GAAG,MAChDF,KAAK,CAACI,SAAS;;AAGhB,MAAM,GAAGD,WAAW,IAAIE,WAAW"}
|
package/dist/pathname$_b.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { WritableAtom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
3
|
export declare const pathname$_b: B<pathname$_T>;
|
|
4
|
-
export interface pathname$_T extends
|
|
4
|
+
export interface pathname$_T extends WritableAtom$<string | undefined> {
|
|
5
5
|
}
|
|
6
6
|
export { pathname$_b as b__pathname };
|
package/dist/pathname$_b.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { atom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { writable$ } from '@ctx-core/store';
|
|
3
3
|
const key = 'pathname$';
|
|
4
|
-
export const pathname$_b = be_(key, ()=>
|
|
4
|
+
export const pathname$_b = be_(key, ()=>atom$(undefined)
|
|
5
5
|
);
|
|
6
6
|
export { pathname$_b as b__pathname };
|
|
7
7
|
|
package/dist/pathname$_b.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pathname$_b.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/pathname$_b.ts"],"sourcesContent":["import { WritableAtom$, atom$ } from '@ctx-core/nanostores'\nimport { B, be_ } from '@ctx-core/object'\nconst key = 'pathname$'\nexport const pathname$_b:B<pathname$_T> = be_(key, ()=>\n\tatom$(undefined) as pathname$_T\n)\nexport interface pathname$_T extends WritableAtom$<string|undefined> {}\nexport { pathname$_b as b__pathname }\n"],"names":["atom$","be_","key","pathname$_b","undefined","b__pathname"],"mappings":"AAAA,MAAM,GAAkBA,KAAK,QAAQ,CAAsB;AAC3D,MAAM,GAAMC,GAAG,QAAQ,CAAkB;AACzC,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAAkBF,GAAG,CAACC,GAAG,MAChDF,KAAK,CAACI,SAAS;;AAGhB,MAAM,GAAGD,WAAW,IAAIE,WAAW"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { WritableAtom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Writable$ } from '@ctx-core/store';
|
|
3
3
|
export declare const window_location$_b: B<window_location$_T>;
|
|
4
|
-
export interface window_location$_T extends
|
|
4
|
+
export interface window_location$_T extends WritableAtom$<Location | undefined> {
|
|
5
5
|
reset_window_location: () => void;
|
|
6
6
|
reset__location__window: () => void;
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { be_, assign } from '@ctx-core/object';
|
|
2
1
|
import { has_dom } from '@ctx-core/dom';
|
|
3
|
-
import {
|
|
2
|
+
import { atom$ } from '@ctx-core/nanostores';
|
|
3
|
+
import { be_, assign } from '@ctx-core/object';
|
|
4
4
|
const key = 'window_location$';
|
|
5
5
|
export const window_location$_b = be_(key, ()=>{
|
|
6
|
-
const window_location$ =
|
|
7
|
-
const window_location_reload_popstate_bound$ =
|
|
6
|
+
const window_location$ = atom$(undefined);
|
|
7
|
+
const window_location_reload_popstate_bound$ = atom$(undefined);
|
|
8
8
|
if (has_dom) {
|
|
9
9
|
reset_window_location();
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window_location$_b.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/window_location$_b.ts"],"sourcesContent":["import { has_dom } from '@ctx-core/dom'\nimport { WritableAtom$, atom$ } from '@ctx-core/nanostores'\nimport { B, be_, assign } from '@ctx-core/object'\nconst key = 'window_location$'\nexport const window_location$_b:B<window_location$_T> = be_(key, ()=>{\n\tconst window_location$ = atom$<Location|undefined>(undefined)\n\tconst window_location_reload_popstate_bound$ =\n\t\tatom$(undefined) as WritableAtom$<boolean|undefined>\n\tif (has_dom) {\n\t\treset_window_location()\n\t}\n\treturn assign(window_location$, {\n\t\treset_window_location,\n\t\treset__location__window: reset_window_location,\n\t}) as window_location$_T\n\tfunction reset_window_location() {\n\t\tif (!has_dom) return\n\t\tif (!window_location_reload_popstate_bound$.$) {\n\t\t\twindow_location_reload_popstate_bound$.set(true)\n\t\t\twindow.addEventListener(\n\t\t\t\t'popstate',\n\t\t\t\treset_window_location)\n\t\t}\n\t\twindow_location$.set(window.location)\n\t}\n})\nexport interface window_location$_T extends WritableAtom$<Location|undefined> {\n\treset_window_location:()=>void\n\treset__location__window:()=>void\n}\nexport {\n\twindow_location$_b as b__location__window,\n}\n"],"names":["has_dom","atom$","be_","assign","key","window_location$_b","window_location$","undefined","window_location_reload_popstate_bound$","reset_window_location","reset__location__window","$","set","window","addEventListener","location","b__location__window"],"mappings":"AAAA,MAAM,GAAGA,OAAO,QAAQ,CAAe;AACvC,MAAM,GAAkBC,KAAK,QAAQ,CAAsB;AAC3D,MAAM,GAAMC,GAAG,EAAEC,MAAM,QAAQ,CAAkB;AACjD,KAAK,CAACC,GAAG,GAAG,CAAkB;AAC9B,MAAM,CAAC,KAAK,CAACC,kBAAkB,GAAyBH,GAAG,CAACE,GAAG,MAAM,CAAC;IACrE,KAAK,CAACE,gBAAgB,GAAGL,KAAK,CAAqBM,SAAS;IAC5D,KAAK,CAACC,sCAAsC,GAC3CP,KAAK,CAACM,SAAS;IAChB,EAAE,EAAEP,OAAO,EAAE,CAAC;QACbS,qBAAqB;IACtB,CAAC;IACD,MAAM,CAACN,MAAM,CAACG,gBAAgB,EAAE,CAAC;QAChCG,qBAAqB;QACrBC,uBAAuB,EAAED,qBAAqB;IAC/C,CAAC;aACQA,qBAAqB,GAAG,CAAC;QACjC,EAAE,GAAGT,OAAO,EAAE,MAAM;QACpB,EAAE,GAAGQ,sCAAsC,CAACG,CAAC,EAAE,CAAC;YAC/CH,sCAAsC,CAACI,GAAG,CAAC,IAAI;YAC/CC,MAAM,CAACC,gBAAgB,CACtB,CAAU,WACVL,qBAAqB;QACvB,CAAC;QACDH,gBAAgB,CAACM,GAAG,CAACC,MAAM,CAACE,QAAQ;IACrC,CAAC;AACF,CAAC;AAKD,MAAM,GACLV,kBAAkB,IAAIW,mBAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { ReadableAtom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Readable$ } from '@ctx-core/store';
|
|
3
3
|
export declare const window_location_hostname$_b: B<window_location_hostname$_T>;
|
|
4
|
-
export declare type window_location_hostname$_T =
|
|
4
|
+
export declare type window_location_hostname$_T = ReadableAtom$<string | undefined>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { computed$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { derived$ } from '@ctx-core/store';
|
|
3
3
|
import { hostname$_b } from './hostname$_b.js';
|
|
4
4
|
import { window_location$_b } from './window_location$_b.js';
|
|
5
5
|
const key = 'window_location_hostname$';
|
|
6
|
-
export const window_location_hostname$_b = be_(key, (ctx)=>
|
|
6
|
+
export const window_location_hostname$_b = be_(key, (ctx)=>computed$([
|
|
7
7
|
hostname$_b(ctx),
|
|
8
8
|
window_location$_b(ctx),
|
|
9
|
-
], (
|
|
9
|
+
], (hostname, window_location)=>window_location && window_location.hostname || hostname || ''
|
|
10
10
|
)
|
|
11
11
|
);
|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window_location_hostname$_b.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/window_location_hostname$_b.ts"],"sourcesContent":["import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'\nimport { B, be_ } from '@ctx-core/object'\nimport { hostname$_b } from './hostname$_b.js'\nimport { window_location$_b } from './window_location$_b.js'\nconst key = 'window_location_hostname$'\nexport const window_location_hostname$_b:B<window_location_hostname$_T> = be_(key, ctx=>\n\tcomputed$([\n\t\t\thostname$_b(ctx),\n\t\t\twindow_location$_b(ctx),\n\t\t],\n\t\t(hostname, window_location)=>\n\t\t\t(window_location && (window_location as Location).hostname) || hostname || ''\n\t) as window_location_hostname$_T\n)\nexport type window_location_hostname$_T = ReadableAtom$<string|undefined>\n"],"names":["computed$","be_","hostname$_b","window_location$_b","key","window_location_hostname$_b","ctx","hostname","window_location"],"mappings":"AAAA,MAAM,GAAGA,SAAS,QAAuB,CAAsB;AAC/D,MAAM,GAAMC,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,MAAM,GAAGC,kBAAkB,QAAQ,CAAyB;AAC5D,KAAK,CAACC,GAAG,GAAG,CAA2B;AACvC,MAAM,CAAC,KAAK,CAACC,2BAA2B,GAAkCJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GACrFN,SAAS,CAAC,CAAC;QACTE,WAAW,CAACI,GAAG;QACfH,kBAAkB,CAACG,GAAG;IACvB,CAAC,GACAC,QAAQ,EAAEC,eAAe,GACxBA,eAAe,IAAKA,eAAe,CAAcD,QAAQ,IAAKA,QAAQ,IAAI,CAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ReadableAtom$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { B } from '@ctx-core/object';
|
|
2
|
-
import { Readable$ } from '@ctx-core/store';
|
|
3
3
|
export declare const window_location_pathname$_b: B<window_location_pathname$_T>;
|
|
4
4
|
export declare type window_location_pathname_T = string | undefined;
|
|
5
|
-
export interface window_location_pathname$_T extends
|
|
5
|
+
export interface window_location_pathname$_T extends ReadableAtom$<window_location_pathname_T> {
|
|
6
6
|
}
|
|
7
7
|
export { window_location_pathname$_b as window_location_pathname_b, window_location_pathname$_b as b__pathname__location__window, };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { computed$ } from '@ctx-core/nanostores';
|
|
1
2
|
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { derived$ } from '@ctx-core/store';
|
|
3
3
|
import { pathname$_b } from './pathname$_b.js';
|
|
4
4
|
import { window_location$_b } from './window_location$_b.js';
|
|
5
5
|
const key = 'window_location_pathname$';
|
|
6
|
-
export const window_location_pathname$_b = be_(key, (ctx)=>
|
|
6
|
+
export const window_location_pathname$_b = be_(key, (ctx)=>computed$([
|
|
7
7
|
pathname$_b(ctx),
|
|
8
8
|
window_location$_b(ctx),
|
|
9
|
-
], (
|
|
9
|
+
], (pathname, location__window)=>location__window && location__window.pathname || pathname || ''
|
|
10
10
|
)
|
|
11
11
|
);
|
|
12
12
|
export { window_location_pathname$_b as window_location_pathname_b, window_location_pathname$_b as b__pathname__location__window, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window_location_pathname$_b.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/window_location_pathname$_b.ts"],"sourcesContent":["import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'\nimport { B, be_ } from '@ctx-core/object'\nimport { pathname$_b } from './pathname$_b.js'\nimport { window_location$_b } from './window_location$_b.js'\nconst key = 'window_location_pathname$'\nexport const window_location_pathname$_b:B<window_location_pathname$_T> = be_(key, ctx=>\n\tcomputed$([\n\t\t\tpathname$_b(ctx),\n\t\t\twindow_location$_b(ctx),\n\t\t],\n\t\t(pathname, location__window)=>\n\t\t\t(location__window && (location__window as Location).pathname)\n\t\t\t|| pathname\n\t\t\t|| ''\n\t) as window_location_pathname$_T\n)\nexport type window_location_pathname_T = string|undefined\nexport interface window_location_pathname$_T extends ReadableAtom$<window_location_pathname_T> {}\nexport {\n\twindow_location_pathname$_b as window_location_pathname_b,\n\twindow_location_pathname$_b as b__pathname__location__window,\n}\n"],"names":["computed$","be_","pathname$_b","window_location$_b","key","window_location_pathname$_b","ctx","pathname","location__window","window_location_pathname_b","b__pathname__location__window"],"mappings":"AAAA,MAAM,GAAGA,SAAS,QAAuB,CAAsB;AAC/D,MAAM,GAAMC,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,MAAM,GAAGC,kBAAkB,QAAQ,CAAyB;AAC5D,KAAK,CAACC,GAAG,GAAG,CAA2B;AACvC,MAAM,CAAC,KAAK,CAACC,2BAA2B,GAAkCJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GACrFN,SAAS,CAAC,CAAC;QACTE,WAAW,CAACI,GAAG;QACfH,kBAAkB,CAACG,GAAG;IACvB,CAAC,GACAC,QAAQ,EAAEC,gBAAgB,GACzBA,gBAAgB,IAAKA,gBAAgB,CAAcD,QAAQ,IACzDA,QAAQ,IACR,CAAE;;;AAKR,MAAM,GACLF,2BAA2B,IAAII,0BAA0B,EACzDJ,2BAA2B,IAAIK,6BAA6B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/window",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.3",
|
|
4
4
|
"description": "ctx-core window",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Brian Takita",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"types": "./
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"import": "./dist/index.js"
|
|
@@ -25,15 +25,14 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ctx-core/dom": "^11.0.
|
|
29
|
-
"@ctx-core/function": "^20.2.
|
|
30
|
-
"@ctx-core/
|
|
31
|
-
"@ctx-core/
|
|
32
|
-
"svelte": "^3.44.3"
|
|
28
|
+
"@ctx-core/dom": "^11.0.48",
|
|
29
|
+
"@ctx-core/function": "^20.2.20",
|
|
30
|
+
"@ctx-core/nanostores": "^0.2.0",
|
|
31
|
+
"@ctx-core/object": "^22.0.8"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@swc/cli": "^0.1.55",
|
|
36
|
-
"@swc/core": "^1.2.
|
|
35
|
+
"@swc/core": "^1.2.121",
|
|
37
36
|
"rimraf": "^3.0.2",
|
|
38
37
|
"typescript": "next"
|
|
39
38
|
},
|
package/src/hostname$_b.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { WritableAtom$, atom$ } from '@ctx-core/nanostores'
|
|
1
2
|
import { B, be_ } from '@ctx-core/object'
|
|
2
|
-
import { Writable$, writable$ } from '@ctx-core/store'
|
|
3
3
|
const key = 'hostname$'
|
|
4
4
|
export const hostname$_b:B<hostname$_T> = be_(key, ()=>
|
|
5
|
-
|
|
5
|
+
atom$(undefined) as hostname$_T
|
|
6
6
|
)
|
|
7
|
-
export type hostname$_T =
|
|
7
|
+
export type hostname$_T = WritableAtom$<string|undefined>
|
|
8
8
|
export { hostname$_b as b__hostname }
|
package/src/pathname$_b.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { WritableAtom$, atom$ } from '@ctx-core/nanostores'
|
|
1
2
|
import { B, be_ } from '@ctx-core/object'
|
|
2
|
-
import { Writable$, writable$ } from '@ctx-core/store'
|
|
3
3
|
const key = 'pathname$'
|
|
4
4
|
export const pathname$_b:B<pathname$_T> = be_(key, ()=>
|
|
5
|
-
|
|
5
|
+
atom$(undefined) as pathname$_T
|
|
6
6
|
)
|
|
7
|
-
export interface pathname$_T extends
|
|
7
|
+
export interface pathname$_T extends WritableAtom$<string|undefined> {}
|
|
8
8
|
export { pathname$_b as b__pathname }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { B, be_, assign } from '@ctx-core/object'
|
|
2
1
|
import { has_dom } from '@ctx-core/dom'
|
|
3
|
-
import {
|
|
2
|
+
import { WritableAtom$, atom$ } from '@ctx-core/nanostores'
|
|
3
|
+
import { B, be_, assign } from '@ctx-core/object'
|
|
4
4
|
const key = 'window_location$'
|
|
5
5
|
export const window_location$_b:B<window_location$_T> = be_(key, ()=>{
|
|
6
|
-
const window_location$ =
|
|
6
|
+
const window_location$ = atom$<Location|undefined>(undefined)
|
|
7
7
|
const window_location_reload_popstate_bound$ =
|
|
8
|
-
|
|
8
|
+
atom$(undefined) as WritableAtom$<boolean|undefined>
|
|
9
9
|
if (has_dom) {
|
|
10
10
|
reset_window_location()
|
|
11
11
|
}
|
|
@@ -24,7 +24,7 @@ export const window_location$_b:B<window_location$_T> = be_(key, ()=>{
|
|
|
24
24
|
window_location$.set(window.location)
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
|
-
export interface window_location$_T extends
|
|
27
|
+
export interface window_location$_T extends WritableAtom$<Location|undefined> {
|
|
28
28
|
reset_window_location:()=>void
|
|
29
29
|
reset__location__window:()=>void
|
|
30
30
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'
|
|
1
2
|
import { B, be_ } from '@ctx-core/object'
|
|
2
|
-
import { derived$, Readable$ } from '@ctx-core/store'
|
|
3
3
|
import { hostname$_b } from './hostname$_b.js'
|
|
4
4
|
import { window_location$_b } from './window_location$_b.js'
|
|
5
5
|
const key = 'window_location_hostname$'
|
|
6
6
|
export const window_location_hostname$_b:B<window_location_hostname$_T> = be_(key, ctx=>
|
|
7
|
-
|
|
7
|
+
computed$([
|
|
8
8
|
hostname$_b(ctx),
|
|
9
9
|
window_location$_b(ctx),
|
|
10
10
|
],
|
|
11
|
-
(
|
|
11
|
+
(hostname, window_location)=>
|
|
12
12
|
(window_location && (window_location as Location).hostname) || hostname || ''
|
|
13
13
|
) as window_location_hostname$_T
|
|
14
14
|
)
|
|
15
|
-
export type window_location_hostname$_T =
|
|
15
|
+
export type window_location_hostname$_T = ReadableAtom$<string|undefined>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import { computed$, ReadableAtom$ } from '@ctx-core/nanostores'
|
|
1
2
|
import { B, be_ } from '@ctx-core/object'
|
|
2
|
-
import { derived$, Readable$ } from '@ctx-core/store'
|
|
3
3
|
import { pathname$_b } from './pathname$_b.js'
|
|
4
4
|
import { window_location$_b } from './window_location$_b.js'
|
|
5
5
|
const key = 'window_location_pathname$'
|
|
6
6
|
export const window_location_pathname$_b:B<window_location_pathname$_T> = be_(key, ctx=>
|
|
7
|
-
|
|
7
|
+
computed$([
|
|
8
8
|
pathname$_b(ctx),
|
|
9
9
|
window_location$_b(ctx),
|
|
10
10
|
],
|
|
11
|
-
(
|
|
11
|
+
(pathname, location__window)=>
|
|
12
12
|
(location__window && (location__window as Location).pathname)
|
|
13
13
|
|| pathname
|
|
14
14
|
|| ''
|
|
15
15
|
) as window_location_pathname$_T
|
|
16
16
|
)
|
|
17
17
|
export type window_location_pathname_T = string|undefined
|
|
18
|
-
export interface window_location_pathname$_T extends
|
|
18
|
+
export interface window_location_pathname$_T extends ReadableAtom$<window_location_pathname_T> {}
|
|
19
19
|
export {
|
|
20
20
|
window_location_pathname$_b as window_location_pathname_b,
|
|
21
21
|
window_location_pathname$_b as b__pathname__location__window,
|