@ctx-core/scroll 16.0.5 → 17.0.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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # @ctx-core/scroll
2
2
 
3
+ ## 17.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - sticky*scroll_active\$*:+ jsdoc
8
+
9
+ ## 17.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - .js + .d.ts instead of .ts
14
+
15
+ ## 17.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - extract functions from sticky*scroll_active\$*(ctx)
20
+
21
+ add*sticky_scroll_active,remove_sticky_scroll_active,sticky_scroll_active_key_active*,sticky*scroll_active_key_match*
22
+
23
+ ## 16.0.6
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+ - @ctx-core/nanostores@0.7.0
29
+
3
30
  ## 16.0.5
4
31
 
5
32
  ### Patch Changes
Binary file
package/package.json CHANGED
@@ -1,52 +1,54 @@
1
1
  {
2
- "name": "@ctx-core/scroll",
3
- "version": "16.0.5",
4
- "description": "ctx-core scroll",
5
- "keywords": [
6
- "ctx-core",
7
- "scroll"
8
- ],
9
- "homepage": "https://github.com/ctx-core/scroll#readme",
10
- "bugs": {
11
- "url": "https://github.com/ctx-core/scroll/issues"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/ctx-core/scroll.git"
16
- },
17
- "license": "Apache-2.0",
18
- "author": "Brian Takita",
19
- "type": "module",
20
- "types": "./lib/index.d.ts",
21
- "exports": {
22
- ".": {
23
- "import": "./lib/index.js"
24
- },
25
- "./package.json": "./package.json"
26
- },
27
- "dependencies": {
28
- "@ctx-core/nanostores": "^0.6.0",
29
- "@ctx-core/object": "*"
30
- },
31
- "devDependencies": {
32
- "@swc/cli": "^0.1.55",
33
- "@swc/core": "^1.2.138",
34
- "rimraf": "^3.0.2",
35
- "typescript": "next"
36
- },
37
- "publishConfig": {
38
- "access": "public",
39
- "cache": "~/.npm"
40
- },
41
- "svelte": "./lib/index.js",
42
- "sideEffects": false,
43
- "scripts": {
44
- "build": "npm run compile",
45
- "clean": "rimraf lib && npm run clean:tsbuildinfo",
46
- "clean:tsbuildinfo": "rimraf tsconfig.tsbuildinfo && rimraf lib/**/*.d.ts",
47
- "compile": "npm run compile:source && npm run compile:declaration",
48
- "compile:source": "swc src --out-dir lib --copy-files --source-maps --config-file .swcrc",
49
- "compile:declaration": "npm run clean:tsbuildinfo && tsc --declaration --emitDeclarationOnly --declarationDir lib",
50
- "exec": "$@"
51
- }
52
- }
2
+ "name": "@ctx-core/scroll",
3
+ "version": "17.0.2",
4
+ "description": "ctx-core scroll",
5
+ "keywords": [
6
+ "ctx-core",
7
+ "scroll"
8
+ ],
9
+ "homepage": "https://github.com/ctx-core/scroll#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/ctx-core/scroll/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/ctx-core/scroll.git"
16
+ },
17
+ "license": "Apache-2.0",
18
+ "author": "Brian Takita",
19
+ "type": "module",
20
+ "types": "./src/index.d.ts",
21
+ "svelte": "./src/index.js",
22
+ "exports": {
23
+ ".": {
24
+ "import": "./src/index.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "scripts": {
29
+ "build": ":",
30
+ "clean": ":",
31
+ "exec": "$@",
32
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
33
+ "test": "pnpm test-unit && check-dts",
34
+ "test-unit": "tsm node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
35
+ "test-unit-coverage": "c8 pnpm test-unit"
36
+ },
37
+ "dependencies": {
38
+ "@ctx-core/nanostores": "^0.7.1",
39
+ "@ctx-core/object": "*"
40
+ },
41
+ "devDependencies": {
42
+ "c8": "^7.11.0",
43
+ "check-dts": "^0.6.6",
44
+ "tslib": "^2.3.1",
45
+ "tsm": "^2.2.1",
46
+ "typescript": "next",
47
+ "uvu": "^0.5.3"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public",
51
+ "cache": "~/.npm"
52
+ },
53
+ "sideEffects": false
54
+ }
File without changes
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from './is_active_.js'
2
+ export * from './is_visible_.js'
3
+ export * from './out_is_active_.js'
4
+ export * from './out_is_visible_.js'
5
+ export * from './sticky_scroll_active$_.js'
6
+
@@ -0,0 +1,2 @@
1
+ export declare function is_active_(el:HTMLElement):boolean;
2
+ export { is_active_ as _is_active, }
@@ -1,8 +1,10 @@
1
1
  import { out_is_active_ } from './out_is_active_.js'
2
- export function is_active_(el:HTMLElement) {
2
+ /**
3
+ * @param {HTMLElement}el
4
+ * @return {boolean}
5
+ */
6
+ export function is_active_(el) {
3
7
  const { top, bottom } = el.getBoundingClientRect()
4
8
  return out_is_active_(top, bottom)
5
9
  }
6
- export {
7
- is_active_ as _is_active,
8
- }
10
+ export { is_active_ as _is_active, }
@@ -0,0 +1,2 @@
1
+ export declare function is_visible_(el:HTMLElement):boolean;
2
+ export { is_visible_ as _is_visible, }
@@ -1,9 +1,11 @@
1
1
  import { out_is_visible_ } from './out_is_visible_.js'
2
- export function is_visible_(el:HTMLElement) {
2
+ /**
3
+ * @param {HTMLElement}el
4
+ * @return {boolean}
5
+ */
6
+ export function is_visible_(el) {
3
7
  const { top, bottom } = el.getBoundingClientRect()
4
8
  const { innerHeight } = window
5
9
  return out_is_visible_(top, bottom, innerHeight)
6
10
  }
7
- export {
8
- is_visible_ as _is_visible,
9
- }
11
+ export { is_visible_ as _is_visible, }
@@ -0,0 +1 @@
1
+ export declare function out_is_active_(top:number, bottom:number):boolean;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @param {number}top
3
+ * @param {number}bottom
4
+ * @return {boolean}
5
+ */
6
+ export function out_is_active_(top, bottom) {
7
+ return top <= 0 && bottom >= 0
8
+ }
@@ -0,0 +1,2 @@
1
+ export declare function out_is_visible_(top:number, bottom:number, innerHeight:number):boolean;
2
+ export { out_is_visible_ as _out_is_visible, }
@@ -0,0 +1,11 @@
1
+ import { out_is_active_ } from './out_is_active_.js'
2
+ /**
3
+ * @param {number}top
4
+ * @param {number}bottom
5
+ * @param {number}innerHeight
6
+ * @return {boolean}
7
+ */
8
+ export function out_is_visible_(top, bottom, innerHeight) {
9
+ return top > 0 && top < innerHeight || out_is_active_(top, bottom)
10
+ }
11
+ export { out_is_visible_ as _out_is_visible, }
@@ -0,0 +1,9 @@
1
+ import { B, Ctx } from '@ctx-core/object'
2
+ import { WritableAtom$ } from '@ctx-core/nanostores'
3
+ export declare const sticky_scroll_active$_:B<sticky_scroll_active$_T>
4
+ export type sticky_scroll_active_T = Record<string, boolean>
5
+ export type sticky_scroll_active$_T = WritableAtom$<sticky_scroll_active_T>
6
+ export declare function add_sticky_scroll_active(ctx:Ctx, key:string):void;
7
+ export declare function remove_sticky_scroll_active(ctx:Ctx, key:string):void;
8
+ export declare function sticky_scroll_active_key_active_(ctx:Ctx, key:string):void;
9
+ export declare function sticky_scroll_active_key_match_(ctx:Ctx, key:string, active:any):void;
@@ -0,0 +1,44 @@
1
+ import { atom$ } from '@ctx-core/nanostores'
2
+ import { b_ } from '@ctx-core/object'
3
+ /** @type {import('./sticky_scroll_active$_.d.ts').sticky_scroll_active$_} */
4
+ export const sticky_scroll_active$_ = b_('sticky_scroll_active$', ()=>
5
+ atom$({}))
6
+ /**
7
+ * @param {import('@ctx-core/object').Ctx}ctx
8
+ * @param {string}key
9
+ */
10
+ export function add_sticky_scroll_active(ctx, key) {
11
+ const sticky_scroll_active$ = sticky_scroll_active$_(ctx)
12
+ const sticky_scroll_active = sticky_scroll_active$.$
13
+ sticky_scroll_active[key] = true
14
+ sticky_scroll_active$.$ = sticky_scroll_active
15
+ }
16
+ /**
17
+ * @param {import('@ctx-core/object').Ctx}ctx
18
+ * @param {string}key
19
+ */
20
+ export function remove_sticky_scroll_active(ctx, key) {
21
+ const sticky_scroll_active$ = sticky_scroll_active$_(ctx)
22
+ const sticky_scroll_active = sticky_scroll_active$.$
23
+ sticky_scroll_active[key] = false
24
+ sticky_scroll_active$.$ = sticky_scroll_active
25
+ }
26
+ /**
27
+ * @param {import('@ctx-core/object').Ctx}ctx
28
+ * @param {string}key
29
+ */
30
+ export function sticky_scroll_active_key_active_(ctx, key) {
31
+ const sticky_scroll_active$ = sticky_scroll_active$_(ctx)
32
+ const sticky_scroll_active = sticky_scroll_active$.$
33
+ const active = sticky_scroll_active ? sticky_scroll_active[key] : false
34
+ return active
35
+ }
36
+ /**
37
+ * @param {import('@ctx-core/object').Ctx}ctx
38
+ * @param {string}key
39
+ * @param {boolean}active
40
+ */
41
+ export function sticky_scroll_active_key_match_(ctx, key, active) {
42
+ const sticky_scroll_active$ = sticky_scroll_active$_(ctx)
43
+ return !!active == !!sticky_scroll_active_key_active_(ctx, key)
44
+ }
package/.swcrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "jsc": {
3
- "target": "es2020",
4
- "parser": {
5
- "syntax": "typescript",
6
- "tsx": true,
7
- "dynamicImport": true
8
- }
9
- }
10
- }
package/lib/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './is_active_.js';
2
- export * from './is_visible_.js';
3
- export * from './out_is_active_.js';
4
- export * from './out_is_visible_.js';
5
- export * from './sticky_scroll_active$_.js';
package/lib/index.js DELETED
@@ -1,7 +0,0 @@
1
- export * from './is_active_.js';
2
- export * from './is_visible_.js';
3
- export * from './out_is_active_.js';
4
- export * from './out_is_visible_.js';
5
- export * from './sticky_scroll_active$_.js';
6
-
7
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './is_active_.js'\nexport * from './is_visible_.js'\nexport * from './out_is_active_.js'\nexport * from './out_is_visible_.js'\nexport * from './sticky_scroll_active$_.js'\n"],"names":[],"mappings":"cAAc,CAAiB;cACjB,CAAkB;cAClB,CAAqB;cACrB,CAAsB;cACtB,CAA6B"}
@@ -1,2 +0,0 @@
1
- export declare function is_active_(el: HTMLElement): boolean;
2
- export { is_active_ as _is_active, };
package/lib/is_active_.js DELETED
@@ -1,8 +0,0 @@
1
- import { out_is_active_ } from './out_is_active_.js';
2
- export function is_active_(el) {
3
- const { top , bottom } = el.getBoundingClientRect();
4
- return out_is_active_(top, bottom);
5
- }
6
- export { is_active_ as _is_active, };
7
-
8
- //# sourceMappingURL=is_active_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/is_active_.ts"],"sourcesContent":["import { out_is_active_ } from './out_is_active_.js'\nexport function is_active_(el:HTMLElement) {\n\tconst { top, bottom } = el.getBoundingClientRect()\n\treturn out_is_active_(top, bottom)\n}\nexport {\n\tis_active_ as _is_active,\n}\n"],"names":["out_is_active_","is_active_","el","top","bottom","getBoundingClientRect","_is_active"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,UAAU,CAACC,EAAc,EAAE,CAAC;IAC3C,KAAK,CAAC,CAAC,CAACC,GAAG,GAAEC,MAAM,EAAC,CAAC,GAAGF,EAAE,CAACG,qBAAqB;IAChD,MAAM,CAACL,cAAc,CAACG,GAAG,EAAEC,MAAM;AAClC,CAAC;AACD,MAAM,GACLH,UAAU,IAAIK,UAAU"}
@@ -1,2 +0,0 @@
1
- export declare function is_visible_(el: HTMLElement): boolean;
2
- export { is_visible_ as _is_visible, };
@@ -1,9 +0,0 @@
1
- import { out_is_visible_ } from './out_is_visible_.js';
2
- export function is_visible_(el) {
3
- const { top , bottom } = el.getBoundingClientRect();
4
- const { innerHeight } = window;
5
- return out_is_visible_(top, bottom, innerHeight);
6
- }
7
- export { is_visible_ as _is_visible, };
8
-
9
- //# sourceMappingURL=is_visible_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/is_visible_.ts"],"sourcesContent":["import { out_is_visible_ } from './out_is_visible_.js'\nexport function is_visible_(el:HTMLElement) {\n\tconst { top, bottom } = el.getBoundingClientRect()\n\tconst { innerHeight } = window\n\treturn out_is_visible_(top, bottom, innerHeight)\n}\nexport {\n\tis_visible_ as _is_visible,\n}\n"],"names":["out_is_visible_","is_visible_","el","top","bottom","getBoundingClientRect","innerHeight","window","_is_visible"],"mappings":"AAAA,MAAM,GAAGA,eAAe,QAAQ,CAAsB;AACtD,MAAM,UAAUC,WAAW,CAACC,EAAc,EAAE,CAAC;IAC5C,KAAK,CAAC,CAAC,CAACC,GAAG,GAAEC,MAAM,EAAC,CAAC,GAAGF,EAAE,CAACG,qBAAqB;IAChD,KAAK,CAAC,CAAC,CAACC,WAAW,EAAC,CAAC,GAAGC,MAAM;IAC9B,MAAM,CAACP,eAAe,CAACG,GAAG,EAAEC,MAAM,EAAEE,WAAW;AAChD,CAAC;AACD,MAAM,GACLL,WAAW,IAAIO,WAAW"}
@@ -1 +0,0 @@
1
- export declare function out_is_active_(top: number, bottom: number): boolean;
@@ -1,5 +0,0 @@
1
- export function out_is_active_(top, bottom) {
2
- return top <= 0 && bottom >= 0;
3
- }
4
-
5
- //# sourceMappingURL=out_is_active_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/out_is_active_.ts"],"sourcesContent":["export function out_is_active_(top:number, bottom:number) {\n\treturn top <= 0 && bottom >= 0\n}\n"],"names":["out_is_active_","top","bottom"],"mappings":"AAAA,MAAM,UAAUA,cAAc,CAACC,GAAU,EAAEC,MAAa,EAAE,CAAC;IAC1D,MAAM,CAACD,GAAG,IAAI,CAAC,IAAIC,MAAM,IAAI,CAAC;AAC/B,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function out_is_visible_(top: number, bottom: number, innerHeight: number): boolean;
2
- export { out_is_visible_ as _out_is_visible, };
@@ -1,7 +0,0 @@
1
- import { out_is_active_ } from './out_is_active_.js';
2
- export function out_is_visible_(top, bottom, innerHeight) {
3
- return top > 0 && top < innerHeight || out_is_active_(top, bottom);
4
- }
5
- export { out_is_visible_ as _out_is_visible, };
6
-
7
- //# sourceMappingURL=out_is_visible_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/out_is_visible_.ts"],"sourcesContent":["import { out_is_active_ } from './out_is_active_.js'\nexport function out_is_visible_(top:number, bottom:number, innerHeight:number) {\n\treturn (top > 0 && top < innerHeight)\n\t\t|| out_is_active_(top, bottom)\n}\nexport {\n\tout_is_visible_ as _out_is_visible,\n}\n"],"names":["out_is_active_","out_is_visible_","top","bottom","innerHeight","_out_is_visible"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,eAAe,CAACC,GAAU,EAAEC,MAAa,EAAEC,WAAkB,EAAE,CAAC;IAC/E,MAAM,CAAEF,GAAG,GAAG,CAAC,IAAIA,GAAG,GAAGE,WAAW,IAChCJ,cAAc,CAACE,GAAG,EAAEC,MAAM;AAC/B,CAAC;AACD,MAAM,GACLF,eAAe,IAAII,eAAe"}
@@ -1,11 +0,0 @@
1
- import { B } from '@ctx-core/object';
2
- import { WritableAtom$ } from '@ctx-core/nanostores';
3
- export declare const sticky_scroll_active$_: B<sticky_scroll_active$_T>;
4
- export interface sticky_scroll_active_T extends Record<string, boolean> {
5
- }
6
- export interface sticky_scroll_active$_T extends WritableAtom$<sticky_scroll_active_T> {
7
- add_sticky_scroll_active: (key: string) => void;
8
- remove_sticky_scroll_active: (key: string) => void;
9
- sticky_scroll_active_key_active_: (key: string) => void;
10
- sticky_scroll_active_key_match_: (key: string, active: any) => void;
11
- }
@@ -1,31 +0,0 @@
1
- import { assign, b_ } from '@ctx-core/object';
2
- import { atom$ } from '@ctx-core/nanostores';
3
- export const sticky_scroll_active$_ = b_('sticky_scroll_active$', ()=>{
4
- const sticky_scroll_active$ = atom$({});
5
- return assign(sticky_scroll_active$, {
6
- add_sticky_scroll_active,
7
- remove_sticky_scroll_active,
8
- sticky_scroll_active_key_active_,
9
- sticky_scroll_active_key_match_
10
- });
11
- function add_sticky_scroll_active(key) {
12
- const sticky_scroll_active = sticky_scroll_active$.$;
13
- sticky_scroll_active[key] = true;
14
- sticky_scroll_active$.$ = sticky_scroll_active;
15
- }
16
- function remove_sticky_scroll_active(key) {
17
- const sticky_scroll_active = sticky_scroll_active$.$;
18
- sticky_scroll_active[key] = false;
19
- sticky_scroll_active$.$ = sticky_scroll_active;
20
- }
21
- function sticky_scroll_active_key_active_(key) {
22
- const sticky_scroll_active = sticky_scroll_active$.$;
23
- const active = sticky_scroll_active ? sticky_scroll_active[key] : false;
24
- return active;
25
- }
26
- function sticky_scroll_active_key_match_(key, active) {
27
- return !!active == !!sticky_scroll_active_key_active_(key);
28
- }
29
- });
30
-
31
- //# sourceMappingURL=sticky_scroll_active$_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/sticky_scroll_active$_.ts"],"sourcesContent":["import { assign, B, b_ } from '@ctx-core/object'\nimport { atom$, WritableAtom$ } from '@ctx-core/nanostores'\nexport const sticky_scroll_active$_:B<sticky_scroll_active$_T> = b_('sticky_scroll_active$', ()=>{\n\tconst sticky_scroll_active$ = atom$<sticky_scroll_active_T>({})\n\treturn assign(sticky_scroll_active$, {\n\t\tadd_sticky_scroll_active,\n\t\tremove_sticky_scroll_active,\n\t\tsticky_scroll_active_key_active_,\n\t\tsticky_scroll_active_key_match_,\n\t}) as sticky_scroll_active$_T\n\tfunction add_sticky_scroll_active(key:string) {\n\t\tconst sticky_scroll_active = sticky_scroll_active$.$\n\t\tsticky_scroll_active[key] = true\n\t\tsticky_scroll_active$.$ = sticky_scroll_active\n\t}\n\tfunction remove_sticky_scroll_active(key:string) {\n\t\tconst sticky_scroll_active = sticky_scroll_active$.$\n\t\tsticky_scroll_active[key] = false\n\t\tsticky_scroll_active$.$ = sticky_scroll_active\n\t}\n\tfunction sticky_scroll_active_key_active_(key:string) {\n\t\tconst sticky_scroll_active = sticky_scroll_active$.$\n\t\tconst active =\n\t\t\tsticky_scroll_active\n\t\t\t? sticky_scroll_active[key]\n\t\t\t: false\n\t\treturn active\n\t}\n\tfunction sticky_scroll_active_key_match_(key:string, active:boolean) {\n\t\treturn !!(active) == !!(sticky_scroll_active_key_active_(key))\n\t}\n})\nexport interface sticky_scroll_active_T extends Record<string, boolean> {}\nexport interface sticky_scroll_active$_T extends WritableAtom$<sticky_scroll_active_T> {\n\tadd_sticky_scroll_active:(key:string)=>void\n\tremove_sticky_scroll_active:(key:string)=>void\n\tsticky_scroll_active_key_active_:(key:string)=>void\n\tsticky_scroll_active_key_match_:(key:string, active:any)=>void\n}\n"],"names":["assign","b_","atom$","sticky_scroll_active$_","sticky_scroll_active$","add_sticky_scroll_active","remove_sticky_scroll_active","sticky_scroll_active_key_active_","sticky_scroll_active_key_match_","key","sticky_scroll_active","$","active"],"mappings":"AAAA,MAAM,GAAGA,MAAM,EAAKC,EAAE,QAAQ,CAAkB;AAChD,MAAM,GAAGC,KAAK,QAAuB,CAAsB;AAC3D,MAAM,CAAC,KAAK,CAACC,sBAAsB,GAA8BF,EAAE,CAAC,CAAuB,4BAAM,CAAC;IACjG,KAAK,CAACG,qBAAqB,GAAGF,KAAK,CAAyB,CAAC,CAAC;IAC9D,MAAM,CAACF,MAAM,CAACI,qBAAqB,EAAE,CAAC;QACrCC,wBAAwB;QACxBC,2BAA2B;QAC3BC,gCAAgC;QAChCC,+BAA+B;IAChC,CAAC;aACQH,wBAAwB,CAACI,GAAU,EAAE,CAAC;QAC9C,KAAK,CAACC,oBAAoB,GAAGN,qBAAqB,CAACO,CAAC;QACpDD,oBAAoB,CAACD,GAAG,IAAI,IAAI;QAChCL,qBAAqB,CAACO,CAAC,GAAGD,oBAAoB;IAC/C,CAAC;aACQJ,2BAA2B,CAACG,GAAU,EAAE,CAAC;QACjD,KAAK,CAACC,oBAAoB,GAAGN,qBAAqB,CAACO,CAAC;QACpDD,oBAAoB,CAACD,GAAG,IAAI,KAAK;QACjCL,qBAAqB,CAACO,CAAC,GAAGD,oBAAoB;IAC/C,CAAC;aACQH,gCAAgC,CAACE,GAAU,EAAE,CAAC;QACtD,KAAK,CAACC,oBAAoB,GAAGN,qBAAqB,CAACO,CAAC;QACpD,KAAK,CAACC,MAAM,GACXF,oBAAoB,GAClBA,oBAAoB,CAACD,GAAG,IACxB,KAAK;QACR,MAAM,CAACG,MAAM;IACd,CAAC;aACQJ,+BAA+B,CAACC,GAAU,EAAEG,MAAc,EAAE,CAAC;QACrE,MAAM,GAAIA,MAAM,MAAQL,gCAAgC,CAACE,GAAG;IAC7D,CAAC;AACF,CAAC"}
@@ -1,3 +0,0 @@
1
- export function out_is_active_(top:number, bottom:number) {
2
- return top <= 0 && bottom >= 0
3
- }
@@ -1,8 +0,0 @@
1
- import { out_is_active_ } from './out_is_active_.js'
2
- export function out_is_visible_(top:number, bottom:number, innerHeight:number) {
3
- return (top > 0 && top < innerHeight)
4
- || out_is_active_(top, bottom)
5
- }
6
- export {
7
- out_is_visible_ as _out_is_visible,
8
- }
@@ -1,39 +0,0 @@
1
- import { assign, B, b_ } from '@ctx-core/object'
2
- import { atom$, WritableAtom$ } from '@ctx-core/nanostores'
3
- export const sticky_scroll_active$_:B<sticky_scroll_active$_T> = b_('sticky_scroll_active$', ()=>{
4
- const sticky_scroll_active$ = atom$<sticky_scroll_active_T>({})
5
- return assign(sticky_scroll_active$, {
6
- add_sticky_scroll_active,
7
- remove_sticky_scroll_active,
8
- sticky_scroll_active_key_active_,
9
- sticky_scroll_active_key_match_,
10
- }) as sticky_scroll_active$_T
11
- function add_sticky_scroll_active(key:string) {
12
- const sticky_scroll_active = sticky_scroll_active$.$
13
- sticky_scroll_active[key] = true
14
- sticky_scroll_active$.$ = sticky_scroll_active
15
- }
16
- function remove_sticky_scroll_active(key:string) {
17
- const sticky_scroll_active = sticky_scroll_active$.$
18
- sticky_scroll_active[key] = false
19
- sticky_scroll_active$.$ = sticky_scroll_active
20
- }
21
- function sticky_scroll_active_key_active_(key:string) {
22
- const sticky_scroll_active = sticky_scroll_active$.$
23
- const active =
24
- sticky_scroll_active
25
- ? sticky_scroll_active[key]
26
- : false
27
- return active
28
- }
29
- function sticky_scroll_active_key_match_(key:string, active:boolean) {
30
- return !!(active) == !!(sticky_scroll_active_key_active_(key))
31
- }
32
- })
33
- export interface sticky_scroll_active_T extends Record<string, boolean> {}
34
- export interface sticky_scroll_active$_T extends WritableAtom$<sticky_scroll_active_T> {
35
- add_sticky_scroll_active:(key:string)=>void
36
- remove_sticky_scroll_active:(key:string)=>void
37
- sticky_scroll_active_key_active_:(key:string)=>void
38
- sticky_scroll_active_key_match_:(key:string, active:any)=>void
39
- }