@ctx-core/window 14.1.69 → 14.2.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,21 @@
1
1
  # @ctx-core/window
2
2
 
3
+ ## 14.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - extract _.js & _.d.ts into directories
8
+
9
+ ## 14.1.70
10
+
11
+ ### Patch Changes
12
+
13
+ - @ctx-core/object: ^25.0.0 -> ^25.0.1
14
+ - Updated dependencies
15
+ - Updated dependencies
16
+ - @ctx-core/dom@11.4.12
17
+ - @ctx-core/nanostores@2.2.30
18
+
3
19
  ## 14.1.69
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/window",
3
- "version": "14.1.69",
3
+ "version": "14.2.0",
4
4
  "description": "ctx-core window",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -24,10 +24,10 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "dependencies": {
27
- "@ctx-core/dom": "^11.4.11",
27
+ "@ctx-core/dom": "^11.4.12",
28
28
  "@ctx-core/function": "^21.8.0",
29
- "@ctx-core/nanostores": "^2.2.29",
30
- "@ctx-core/object": "^25.0.0"
29
+ "@ctx-core/nanostores": "^2.2.30",
30
+ "@ctx-core/object": "^25.0.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "c8": "^7.13.0",
@@ -0,0 +1,4 @@
1
+ import type { WritableAtom_ } from '@ctx-core/nanostores'
2
+ import type { Be } from '@ctx-core/object'
3
+ export declare const hostname__:Be<WritableAtom_<string|undefined>>
4
+ export { hostname__ as hostname$_ }
@@ -1,5 +1,6 @@
1
1
  import { atom_ } from '@ctx-core/nanostores'
2
2
  import { be_ } from '@ctx-core/object'
3
+ /** @type {typeof import('./index.d.ts').hostname__} */
3
4
  export const hostname__ = be_('hostname__', ()=>
4
5
  atom_(undefined))
5
6
  export { hostname__ as hostname$_ }
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
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'
1
+ export * from './hostname__/index.js'
2
+ export * from './pathname__/index.js'
3
+ export * from './window_location__/index.js'
4
+ export * from './window_location_hostname__/index.js'
5
+ export * from './window_location_pathname__/index.js'
@@ -0,0 +1,7 @@
1
+ import type { WritableAtom_ } from '@ctx-core/nanostores'
2
+ import type { Be } from '@ctx-core/object'
3
+ export declare const pathname__:Be<WritableAtom_<string|undefined>>
4
+ export {
5
+ pathname__ as pathname$_,
6
+ pathname__ as b__pathname
7
+ }
@@ -1,5 +1,6 @@
1
1
  import { atom_ } from '@ctx-core/nanostores'
2
2
  import { be_ } from '@ctx-core/object'
3
+ /** @type {typeof import('./index.d.ts').pathname__} */
3
4
  export const pathname__ = be_('pathname__',
4
5
  ()=>atom_(undefined))
5
6
  export {
@@ -0,0 +1,7 @@
1
+ import type { WritableAtom_ } from '@ctx-core/nanostores'
2
+ import type { Be } from '@ctx-core/object'
3
+ export declare const window_location__:Be<window_location__T>
4
+ export interface window_location__T extends WritableAtom_<Location|undefined> {
5
+ window_location__reset:()=>void;
6
+ }
7
+ export { window_location__ as window_location$_ }
@@ -1,20 +1,21 @@
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
+ /** @type {typeof import('./index.d.ts').window_location__} */
4
5
  export const window_location__ = be_('window_location__', ()=>{
5
6
  const window_location_ = atom_(undefined)
6
- const window_location_reload_popstate_bound$ = atom_(undefined)
7
+ const window_location__onpopstate__bound_ = atom_(false)
7
8
  if (has_dom) {
8
- reset_window_location()
9
+ window_location__reset()
9
10
  }
10
11
  return assign(window_location_, {
11
- reset_window_location
12
+ window_location__reset
12
13
  })
13
- function reset_window_location() {
14
+ function window_location__reset() {
14
15
  if (!has_dom) return
15
- if (!window_location_reload_popstate_bound$.$) {
16
- window_location_reload_popstate_bound$.set(true)
17
- window.addEventListener('popstate', reset_window_location)
16
+ if (!window_location__onpopstate__bound_.$) {
17
+ window_location__onpopstate__bound_.set(true)
18
+ window.addEventListener('popstate', window_location__reset)
18
19
  }
19
20
  window_location_.set(window.location)
20
21
  }
@@ -0,0 +1,4 @@
1
+ import type { ReadableAtom_ } from '@ctx-core/nanostores'
2
+ import type { Be } from '@ctx-core/object'
3
+ export declare const window_location_hostname__:Be<ReadableAtom_<string|undefined>>
4
+ export { window_location_hostname__ as window_location_hostname$_ }
@@ -1,7 +1,8 @@
1
1
  import { computed_ } from '@ctx-core/nanostores'
2
2
  import { be_ } from '@ctx-core/object'
3
- import { hostname__ } from './hostname__.js'
4
- import { window_location__ } from './window_location__.js'
3
+ import { hostname__ } from '../hostname__/index.js'
4
+ import { window_location__ } from '../window_location__/index.js'
5
+ /** @type {typeof import('./index.d.ts').window_location_hostname__} */
5
6
  export const window_location_hostname__ = be_('window_location_hostname__', (ctx)=>computed_([
6
7
  hostname__(ctx),
7
8
  window_location__(ctx),
@@ -0,0 +1,5 @@
1
+ import type { ReadableAtom_ } from '@ctx-core/nanostores'
2
+ import type { Be } from '@ctx-core/object'
3
+ export declare const window_location_pathname__:Be<ReadableAtom_<window_location_pathname_T>>
4
+ export declare type window_location_pathname_T = string|undefined
5
+ export { window_location_pathname__ as window_location_pathname$_ }
@@ -1,7 +1,8 @@
1
1
  import { computed_ } from '@ctx-core/nanostores'
2
2
  import { be_ } from '@ctx-core/object'
3
- import { pathname__ } from './pathname__.js'
4
- import { window_location__ } from './window_location__.js'
3
+ import { pathname__ } from '../pathname__/index.js'
4
+ import { window_location__ } from '../window_location__/index.js'
5
+ /** @type {typeof import('./index.d.ts').window_location_pathname__} */
5
6
  export const window_location_pathname__ = be_('window_location_pathname__', ctx=>
6
7
  computed_([
7
8
  pathname__(ctx),
@@ -1,4 +0,0 @@
1
- import { type WritableAtom_ } from '@ctx-core/nanostores'
2
- import { type B } from '@ctx-core/object'
3
- export declare const hostname__:B<WritableAtom_<string|undefined>>
4
- export { hostname__ as hostname$_ }
@@ -1,7 +0,0 @@
1
- import { type WritableAtom_ } from '@ctx-core/nanostores'
2
- import { type B } from '@ctx-core/object'
3
- export declare const pathname__:B<WritableAtom_<string|undefined>>
4
- export {
5
- pathname__ as pathname$_,
6
- pathname__ as b__pathname
7
- }
@@ -1,7 +0,0 @@
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,4 +0,0 @@
1
- import { type ReadableAtom_ } from '@ctx-core/nanostores'
2
- import { type B } from '@ctx-core/object'
3
- export declare const window_location_hostname__:B<ReadableAtom_<string|undefined>>
4
- export { window_location_hostname__ as window_location_hostname$_ }
@@ -1,5 +0,0 @@
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$_ }