@ctx-core/window 12.0.9 → 13.0.0

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ctx-core/window
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - using @ctx-core/nanostores for stores instead of @ctx-core/store,@ctx-core/svelte
8
+
3
9
  ## 12.0.9
4
10
 
5
11
  ### Patch Changes
package/COMMIT_EDITMSG ADDED
@@ -0,0 +1 @@
1
+
@@ -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 = Writable$<string | undefined>;
4
+ export declare type hostname$_T = WritableAtom$<string | undefined>;
5
5
  export { hostname$_b as b__hostname };
@@ -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, ()=>writable$(undefined)
4
+ export const hostname$_b = be_(key, ()=>atom$(undefined)
5
5
  );
6
6
  export { hostname$_b as b__hostname };
7
7
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hostname$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { Writable$, writable$ } from '@ctx-core/store'\nconst key = 'hostname$'\nexport const hostname$_b:B<hostname$_T> = be_(key, ()=>\n\twritable$(undefined) as hostname$_T\n)\nexport type hostname$_T = Writable$<string|undefined>\nexport { hostname$_b as b__hostname }\n"],"names":["be_","writable$","key","hostname$_b","undefined","b__hostname"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAcC,SAAS,QAAQ,CAAiB;AACtD,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAAkBH,GAAG,CAACE,GAAG,MAChDD,SAAS,CAACG,SAAS;;AAGpB,MAAM,GAAGD,WAAW,IAAIE,WAAW"}
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"}
@@ -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 Writable$<string | undefined> {
4
+ export interface pathname$_T extends WritableAtom$<string | undefined> {
5
5
  }
6
6
  export { pathname$_b as b__pathname };
@@ -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, ()=>writable$(undefined)
4
+ export const pathname$_b = be_(key, ()=>atom$(undefined)
5
5
  );
6
6
  export { pathname$_b as b__pathname };
7
7
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/pathname$_b.ts"],"sourcesContent":["import { B, be_ } from '@ctx-core/object'\nimport { Writable$, writable$ } from '@ctx-core/store'\nconst key = 'pathname$'\nexport const pathname$_b:B<pathname$_T> = be_(key, ()=>\n\twritable$(undefined) as pathname$_T\n)\nexport interface pathname$_T extends Writable$<string|undefined> {}\nexport { pathname$_b as b__pathname }\n"],"names":["be_","writable$","key","pathname$_b","undefined","b__pathname"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAcC,SAAS,QAAQ,CAAiB;AACtD,KAAK,CAACC,GAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAAkBH,GAAG,CAACE,GAAG,MAChDD,SAAS,CAACG,SAAS;;AAGpB,MAAM,GAAGD,WAAW,IAAIE,WAAW"}
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 Writable$<Location | undefined> {
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 { writable$ } from '@ctx-core/store';
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$ = writable$(undefined);
7
- const window_location_reload_popstate_bound$ = writable$(undefined);
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 { B, be_, assign } from '@ctx-core/object'\nimport { has_dom } from '@ctx-core/dom'\nimport { Writable$, writable$ } from '@ctx-core/store'\nconst key = 'window_location$'\nexport const window_location$_b:B<window_location$_T> = be_(key, ()=>{\n\tconst window_location$ = writable$<Location|undefined>(undefined)\n\tconst window_location_reload_popstate_bound$ =\n\t\twritable$(undefined) as Writable$<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 Writable$<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":["be_","assign","has_dom","writable$","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,GAAMA,GAAG,EAAEC,MAAM,QAAQ,CAAkB;AACjD,MAAM,GAAGC,OAAO,QAAQ,CAAe;AACvC,MAAM,GAAcC,SAAS,QAAQ,CAAiB;AACtD,KAAK,CAACC,GAAG,GAAG,CAAkB;AAC9B,MAAM,CAAC,KAAK,CAACC,kBAAkB,GAAyBL,GAAG,CAACI,GAAG,MAAM,CAAC;IACrE,KAAK,CAACE,gBAAgB,GAAGH,SAAS,CAAqBI,SAAS;IAChE,KAAK,CAACC,sCAAsC,GAC3CL,SAAS,CAACI,SAAS;IACpB,EAAE,EAAEL,OAAO,EAAE,CAAC;QACbO,qBAAqB;IACtB,CAAC;IACD,MAAM,CAACR,MAAM,CAACK,gBAAgB,EAAE,CAAC;QAChCG,qBAAqB;QACrBC,uBAAuB,EAAED,qBAAqB;IAC/C,CAAC;aACQA,qBAAqB,GAAG,CAAC;QACjC,EAAE,GAAGP,OAAO,EAAE,MAAM;QACpB,EAAE,GAAGM,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
+ {"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 = Readable$<string | undefined>;
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)=>derived$([
6
+ export const window_location_hostname$_b = be_(key, (ctx)=>computed$([
7
7
  hostname$_b(ctx),
8
8
  window_location$_b(ctx),
9
- ], ([hostname, window_location])=>window_location && window_location.hostname || hostname || ''
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 { B, be_ } from '@ctx-core/object'\nimport { derived$, Readable$ } from '@ctx-core/store'\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\tderived$([\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 = Readable$<string|undefined>\n"],"names":["be_","derived$","hostname$_b","window_location$_b","key","window_location_hostname$_b","ctx","hostname","window_location"],"mappings":"AAAA,MAAM,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAmB,CAAiB;AACrD,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,MAAM,GAAGC,kBAAkB,QAAQ,CAAyB;AAC5D,KAAK,CAACC,GAAG,GAAG,CAA2B;AACvC,MAAM,CAAC,KAAK,CAACC,2BAA2B,GAAkCL,GAAG,CAACI,GAAG,GAAEE,GAAG,GACrFL,QAAQ,CAAC,CAAC;QACRC,WAAW,CAACI,GAAG;QACfH,kBAAkB,CAACG,GAAG;IACvB,CAAC,IACCC,QAAQ,EAAEC,eAAe,IACzBA,eAAe,IAAKA,eAAe,CAAcD,QAAQ,IAAKA,QAAQ,IAAI,CAAE"}
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 Readable$<window_location_pathname_T> {
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)=>derived$([
6
+ export const window_location_pathname$_b = be_(key, (ctx)=>computed$([
7
7
  pathname$_b(ctx),
8
8
  window_location$_b(ctx),
9
- ], ([pathname, location__window])=>location__window && location__window.pathname || pathname || ''
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 { B, be_ } from '@ctx-core/object'\nimport { derived$, Readable$ } from '@ctx-core/store'\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\tderived$([\n\t\t\tpathname$_b(ctx),\n\t\t\twindow_location$_b(ctx),\n\t\t],\n\t\t([pathname, location__window]:[string|undefined, Location|undefined])=>\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 Readable$<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":["be_","derived$","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,GAAMA,GAAG,QAAQ,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAmB,CAAiB;AACrD,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAC9C,MAAM,GAAGC,kBAAkB,QAAQ,CAAyB;AAC5D,KAAK,CAACC,GAAG,GAAG,CAA2B;AACvC,MAAM,CAAC,KAAK,CAACC,2BAA2B,GAAkCL,GAAG,CAACI,GAAG,GAAEE,GAAG,GACrFL,QAAQ,CAAC,CAAC;QACRC,WAAW,CAACI,GAAG;QACfH,kBAAkB,CAACG,GAAG;IACvB,CAAC,IACCC,QAAQ,EAAEC,gBAAgB,IAC1BA,gBAAgB,IAAKA,gBAAgB,CAAcD,QAAQ,IACzDA,QAAQ,IACR,CAAE;;;AAKR,MAAM,GACLF,2BAA2B,IAAII,0BAA0B,EACzDJ,2BAA2B,IAAIK,6BAA6B"}
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": "12.0.9",
3
+ "version": "13.0.0",
4
4
  "description": "ctx-core window",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -27,13 +27,12 @@
27
27
  "dependencies": {
28
28
  "@ctx-core/dom": "^11.0.48",
29
29
  "@ctx-core/function": "^20.2.20",
30
- "@ctx-core/object": "^22.0.8",
31
- "@ctx-core/store": "^27.0.55",
32
- "svelte": "^3.44.3"
30
+ "@ctx-core/nanostores": "^0.1.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.120",
35
+ "@swc/core": "^1.2.121",
37
36
  "rimraf": "^3.0.2",
38
37
  "typescript": "next"
39
38
  },
@@ -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
- writable$(undefined) as hostname$_T
5
+ atom$(undefined) as hostname$_T
6
6
  )
7
- export type hostname$_T = Writable$<string|undefined>
7
+ export type hostname$_T = WritableAtom$<string|undefined>
8
8
  export { hostname$_b as b__hostname }
@@ -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
- writable$(undefined) as pathname$_T
5
+ atom$(undefined) as pathname$_T
6
6
  )
7
- export interface pathname$_T extends Writable$<string|undefined> {}
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 { Writable$, writable$ } from '@ctx-core/store'
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$ = writable$<Location|undefined>(undefined)
6
+ const window_location$ = atom$<Location|undefined>(undefined)
7
7
  const window_location_reload_popstate_bound$ =
8
- writable$(undefined) as Writable$<boolean|undefined>
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 Writable$<Location|undefined> {
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
- derived$([
7
+ computed$([
8
8
  hostname$_b(ctx),
9
9
  window_location$_b(ctx),
10
10
  ],
11
- ([hostname, window_location])=>
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 = Readable$<string|undefined>
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
- derived$([
7
+ computed$([
8
8
  pathname$_b(ctx),
9
9
  window_location$_b(ctx),
10
10
  ],
11
- ([pathname, location__window]:[string|undefined, Location|undefined])=>
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 Readable$<window_location_pathname_T> {}
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,