@design-edito/tools 0.5.37 → 0.5.39
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/agnostic/@react/effects/index.d.ts +1 -0
- package/agnostic/@react/effects/index.js +1 -0
- package/agnostic/@react/effects/use-state-change-dispatch/index.d.ts +22 -0
- package/agnostic/@react/effects/use-state-change-dispatch/index.js +31 -0
- package/agnostic/@react/index.d.ts +1 -0
- package/agnostic/@react/index.js +1 -0
- package/agnostic/arrays/index.d.ts +3 -2
- package/agnostic/arrays/index.js +3 -2
- package/agnostic/arrays/integers-between/index.d.ts +8 -0
- package/agnostic/arrays/integers-between/index.js +11 -0
- package/agnostic/arrays/integers-between/index.test.d.ts +1 -0
- package/agnostic/arrays/integers-between/index.test.js +16 -0
- package/agnostic/colors/index.d.ts +2 -2
- package/agnostic/colors/index.js +2 -2
- package/agnostic/css/index.d.ts +2 -1
- package/agnostic/css/index.js +2 -1
- package/agnostic/css/merge-class-names/index.d.ts +8 -0
- package/agnostic/css/merge-class-names/index.js +23 -0
- package/agnostic/css/merge-class-names/index.test.d.ts +1 -0
- package/agnostic/css/merge-class-names/index.test.js +52 -0
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +11 -11
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +11 -11
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +2 -2
- package/agnostic/html/index.d.ts +2 -2
- package/agnostic/html/index.js +2 -2
- package/agnostic/index.d.ts +2 -1
- package/agnostic/index.js +2 -1
- package/agnostic/misc/index.d.ts +1 -1
- package/agnostic/misc/index.js +1 -1
- package/agnostic/numbers/index.d.ts +2 -2
- package/agnostic/numbers/index.js +2 -2
- package/agnostic/objects/index.d.ts +2 -2
- package/agnostic/objects/index.js +2 -2
- package/agnostic/random/index.d.ts +1 -1
- package/agnostic/random/index.js +1 -1
- package/agnostic/time/dates/index.d.ts +1 -1
- package/agnostic/time/dates/index.js +1 -1
- package/components/BeforeAfter/index.controlled.js +1 -1
- package/components/BeforeAfter/index.js +2 -2
- package/components/Button/index.js +1 -1
- package/components/Clippable/index.js +1 -1
- package/components/Disclaimer/index.d.ts +2 -2
- package/components/Disclaimer/index.js +4 -3
- package/components/Drawer/index.js +4 -3
- package/components/EventListener/index.js +1 -1
- package/components/Gallery/index.js +5 -4
- package/components/Iframe/index.js +1 -1
- package/components/Image/index.d.ts +1 -1
- package/components/Image/index.js +3 -2
- package/components/Input/index.js +1 -1
- package/components/IntersectionObserver/index.js +1 -1
- package/components/JsonEditor/index.js +1 -1
- package/components/JsonEditor/types.d.ts +0 -6
- package/components/JsonEditor/utils.d.ts +0 -5
- package/components/JsonEditor/utils.js +0 -5
- package/components/Lightbox/index.d.ts +12 -12
- package/components/Lightbox/index.js +37 -35
- package/components/Lightbox/store.d.ts +9 -43
- package/components/Lightbox/store.js +51 -73
- package/components/Lightbox/types.d.ts +16 -0
- package/components/Lightbox/types.js +1 -0
- package/components/ListLoader/index.controlled.js +19 -13
- package/components/ListLoader/index.js +19 -3
- package/components/Overlayer/index.js +1 -1
- package/components/Paginator/index.js +4 -3
- package/components/ResizeObserver/index.js +1 -1
- package/components/Scrllgngn/index.d.ts +4 -4
- package/components/Scrllgngn/index.js +4 -3
- package/components/Scrllgngn/types.d.ts +55 -0
- package/components/Scrllgngn/types.js +24 -0
- package/components/Scrllgngn/utils.d.ts +2 -38
- package/components/ScrollListener/index.d.ts +1 -6
- package/components/ScrollListener/index.js +10 -9
- package/components/ScrollListener/types.d.ts +0 -3
- package/components/Select/index.js +1 -1
- package/components/Sequencer/index.d.ts +2 -9
- package/components/Sequencer/index.js +26 -128
- package/components/Sequencer/types.d.ts +30 -0
- package/components/Sequencer/types.js +30 -0
- package/components/Sequencer/utils.d.ts +4 -0
- package/components/Sequencer/utils.js +25 -0
- package/components/ShadowRoot/index.js +1 -1
- package/components/Subtitles/index.js +3 -5
- package/components/Subtitles/utils.d.ts +0 -51
- package/components/Subtitles/utils.js +0 -41
- package/components/Textarea/index.js +1 -1
- package/components/UIModule/index.d.ts +8 -6
- package/components/UIModule/index.js +11 -14
- package/components/Video/index.controlled.d.ts +1 -7
- package/components/Video/index.controlled.js +13 -12
- package/components/Video/index.d.ts +0 -8
- package/components/Video/index.js +11 -15
- package/components/Video/types.d.ts +33 -0
- package/components/Video/utils.d.ts +1 -67
- package/components/Video/utils.js +25 -44
- package/components/index.d.ts +3 -3
- package/components/index.js +3 -3
- package/components/utils/index.d.ts +1 -44
- package/components/utils/index.js +1 -83
- package/components/utils/viewport-behaviours/index.d.ts +8 -14
- package/components/utils/viewport-behaviours/index.js +15 -37
- package/components/utils/viewport-behaviours/types.d.ts +3 -9
- package/components/utils/viewport-behaviours/types.js +3 -4
- package/node/ftps/directory/index.d.ts +1 -1
- package/node/ftps/directory/index.js +1 -1
- package/node/images/index.d.ts +1 -1
- package/node/images/index.js +1 -1
- package/node/images/transform/operations/index.d.ts +3 -3
- package/node/images/transform/operations/index.js +3 -3
- package/node/index.d.ts +2 -2
- package/node/index.js +2 -2
- package/package.json +44 -1
- package/components/ListLoader/utils.d.ts +0 -8
- package/components/ListLoader/utils.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as useStateChangeDispatch from './use-state-change-dispatch/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as useStateChangeDispatch from './use-state-change-dispatch/index.js'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calls `onChange` whenever `value` changes, and only then — never on mount.
|
|
3
|
+
*
|
|
4
|
+
* This is how a component reports one of its state items to its consumer:
|
|
5
|
+
* a bare `useEffect` on the value would also fire on the first render, telling
|
|
6
|
+
* the consumer something changed when nothing did.
|
|
7
|
+
*
|
|
8
|
+
* @template T - Type of the watched value.
|
|
9
|
+
* @param value - The value to watch.
|
|
10
|
+
* @param onChange - Called with the new value, once the change has happened.
|
|
11
|
+
* @param isEqual - Decides whether the value actually changed. Defaults to
|
|
12
|
+
* `Object.is`, which covers booleans, numbers and strings. Pass a custom
|
|
13
|
+
* comparison for values rebuilt on every render, such as an array or an object
|
|
14
|
+
* derived from state, whose identity always differs.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* `onChange` is deliberately left out of the effect's dependencies. A consumer
|
|
18
|
+
* passing an inline arrow creates a new function on every render, which would
|
|
19
|
+
* re-run the effect each time and defeat the guard. The handler is read when the
|
|
20
|
+
* effect fires, so it is never a stale one.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useStateChangeDispatch<T>(value: T, onChange?: (value: T) => void, isEqual?: (a: T, b: T) => boolean): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Calls `onChange` whenever `value` changes, and only then — never on mount.
|
|
4
|
+
*
|
|
5
|
+
* This is how a component reports one of its state items to its consumer:
|
|
6
|
+
* a bare `useEffect` on the value would also fire on the first render, telling
|
|
7
|
+
* the consumer something changed when nothing did.
|
|
8
|
+
*
|
|
9
|
+
* @template T - Type of the watched value.
|
|
10
|
+
* @param value - The value to watch.
|
|
11
|
+
* @param onChange - Called with the new value, once the change has happened.
|
|
12
|
+
* @param isEqual - Decides whether the value actually changed. Defaults to
|
|
13
|
+
* `Object.is`, which covers booleans, numbers and strings. Pass a custom
|
|
14
|
+
* comparison for values rebuilt on every render, such as an array or an object
|
|
15
|
+
* derived from state, whose identity always differs.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* `onChange` is deliberately left out of the effect's dependencies. A consumer
|
|
19
|
+
* passing an inline arrow creates a new function on every render, which would
|
|
20
|
+
* re-run the effect each time and defeat the guard. The handler is read when the
|
|
21
|
+
* effect fires, so it is never a stale one.
|
|
22
|
+
*/
|
|
23
|
+
export function useStateChangeDispatch(value, onChange, isEqual = Object.is) {
|
|
24
|
+
const previousRef = useRef(value);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (isEqual(previousRef.current, value))
|
|
27
|
+
return;
|
|
28
|
+
previousRef.current = value;
|
|
29
|
+
onChange?.(value);
|
|
30
|
+
}, [value]);
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as effects from './effects/index.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as effects from './effects/index.js'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as dedupe from './dedupe/index.js'
|
|
2
|
+
export * as findDuplicates from './find-duplicates/index.js'
|
|
3
|
+
export * as integersBetween from './integers-between/index.js'
|
|
2
4
|
export * as isArrayOf from './is-array-of/index.js'
|
|
3
5
|
export * as make from './make/index.js'
|
|
4
|
-
export * as randomPick from './random-pick/index.js'
|
|
5
6
|
export * as shuffle from './shuffle/index.js'
|
|
6
|
-
export * as
|
|
7
|
+
export * as randomPick from './random-pick/index.js'
|
package/agnostic/arrays/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as dedupe from './dedupe/index.js'
|
|
2
|
+
export * as findDuplicates from './find-duplicates/index.js'
|
|
3
|
+
export * as integersBetween from './integers-between/index.js'
|
|
2
4
|
export * as isArrayOf from './is-array-of/index.js'
|
|
3
5
|
export * as make from './make/index.js'
|
|
4
|
-
export * as randomPick from './random-pick/index.js'
|
|
5
6
|
export * as shuffle from './shuffle/index.js'
|
|
6
|
-
export * as
|
|
7
|
+
export * as randomPick from './random-pick/index.js'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lists every integer from `from` to `to`, both included.
|
|
3
|
+
*
|
|
4
|
+
* @param from - Lower bound.
|
|
5
|
+
* @param to - Upper bound. When lower than `from`, the list is empty.
|
|
6
|
+
* @returns The integers in ascending order.
|
|
7
|
+
*/
|
|
8
|
+
export declare function integersBetween(from: number, to: number): number[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { make } from '../make/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Lists every integer from `from` to `to`, both included.
|
|
4
|
+
*
|
|
5
|
+
* @param from - Lower bound.
|
|
6
|
+
* @param to - Upper bound. When lower than `from`, the list is empty.
|
|
7
|
+
* @returns The integers in ascending order.
|
|
8
|
+
*/
|
|
9
|
+
export function integersBetween(from, to) {
|
|
10
|
+
return make(pos => from + pos, Math.max(0, to - from + 1));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { integersBetween } from './index.js';
|
|
3
|
+
describe('integersBetween', () => {
|
|
4
|
+
it('includes both bounds', () => {
|
|
5
|
+
expect(integersBetween(2, 5)).toEqual([2, 3, 4, 5]);
|
|
6
|
+
});
|
|
7
|
+
it('returns the bound alone when they are equal', () => {
|
|
8
|
+
expect(integersBetween(7, 7)).toEqual([7]);
|
|
9
|
+
});
|
|
10
|
+
it('returns nothing when the upper bound is lower', () => {
|
|
11
|
+
expect(integersBetween(5, 2)).toEqual([]);
|
|
12
|
+
});
|
|
13
|
+
it('walks through zero and negative bounds', () => {
|
|
14
|
+
expect(integersBetween(-2, 1)).toEqual([-2, -1, 0, 1]);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
|
-
export * as contrast from './contrast/index.js'
|
|
3
2
|
export * as convert from './convert/index.js'
|
|
3
|
+
export * as contrast from './contrast/index.js'
|
|
4
4
|
export * as distance from './distance/index.js'
|
|
5
5
|
export * as grayscale from './grayscale/index.js'
|
|
6
6
|
export * as invert from './invert/index.js'
|
|
7
|
-
export * as lerp from './lerp/index.js'
|
|
8
7
|
export * as luminance from './luminance/index.js'
|
|
9
8
|
export * as palette from './palette/index.js'
|
|
10
9
|
export * as rotate from './rotate/index.js'
|
|
11
10
|
export * as tidy from './tidy/index.js'
|
|
12
11
|
export * as typechecks from './typechecks/index.js'
|
|
12
|
+
export * as lerp from './lerp/index.js'
|
package/agnostic/colors/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
|
-
export * as contrast from './contrast/index.js'
|
|
3
2
|
export * as convert from './convert/index.js'
|
|
3
|
+
export * as contrast from './contrast/index.js'
|
|
4
4
|
export * as distance from './distance/index.js'
|
|
5
5
|
export * as grayscale from './grayscale/index.js'
|
|
6
6
|
export * as invert from './invert/index.js'
|
|
7
|
-
export * as lerp from './lerp/index.js'
|
|
8
7
|
export * as luminance from './luminance/index.js'
|
|
9
8
|
export * as palette from './palette/index.js'
|
|
10
9
|
export * as rotate from './rotate/index.js'
|
|
11
10
|
export * as tidy from './tidy/index.js'
|
|
12
11
|
export * as typechecks from './typechecks/index.js'
|
|
12
|
+
export * as lerp from './lerp/index.js'
|
package/agnostic/css/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as bem from './bem/index.js'
|
|
2
2
|
export * as clss from './clss/index.js'
|
|
3
3
|
export * as generateNiceColor from './generate-nice-color/index.js'
|
|
4
|
-
export * as scale from './scale/index.js'
|
|
5
4
|
export * as isValidCssClassName from './is-valid-css-class-name/index.js'
|
|
5
|
+
export * as mergeClassNames from './merge-class-names/index.js'
|
|
6
|
+
export * as scale from './scale/index.js'
|
|
6
7
|
export * as stylesSet from './styles-set/index.js'
|
package/agnostic/css/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as bem from './bem/index.js'
|
|
2
2
|
export * as clss from './clss/index.js'
|
|
3
3
|
export * as generateNiceColor from './generate-nice-color/index.js'
|
|
4
|
-
export * as scale from './scale/index.js'
|
|
5
4
|
export * as isValidCssClassName from './is-valid-css-class-name/index.js'
|
|
5
|
+
export * as mergeClassNames from './merge-class-names/index.js'
|
|
6
|
+
export * as scale from './scale/index.js'
|
|
6
7
|
export * as stylesSet from './styles-set/index.js'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flattens class name lists into the string an element's `class` attribute takes.
|
|
3
|
+
*
|
|
4
|
+
* @param names - Class names, nested one level deep, with `null`, `undefined` and
|
|
5
|
+
* blank entries allowed.
|
|
6
|
+
* @returns The names that were worth keeping, trimmed and space-separated.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeClassNames(...names: Array<string | null | undefined | Array<string | null | undefined>>): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flattens class name lists into the string an element's `class` attribute takes.
|
|
3
|
+
*
|
|
4
|
+
* @param names - Class names, nested one level deep, with `null`, `undefined` and
|
|
5
|
+
* blank entries allowed.
|
|
6
|
+
* @returns The names that were worth keeping, trimmed and space-separated.
|
|
7
|
+
*/
|
|
8
|
+
export function mergeClassNames(...names) {
|
|
9
|
+
return names.map(name => {
|
|
10
|
+
if (typeof name !== 'string' && !Array.isArray(name))
|
|
11
|
+
return false;
|
|
12
|
+
// An array that yields nothing comes back as `''`, which would survive the filter
|
|
13
|
+
// below and join as an empty segment — a trailing or doubled space in the result.
|
|
14
|
+
if (Array.isArray(name)) {
|
|
15
|
+
const merged = mergeClassNames(...name);
|
|
16
|
+
return merged === '' ? false : merged;
|
|
17
|
+
}
|
|
18
|
+
if (name.trim() === '')
|
|
19
|
+
return false;
|
|
20
|
+
return name.trim();
|
|
21
|
+
}).filter((name) => typeof name === 'string')
|
|
22
|
+
.join(' ');
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mergeClassNames } from './index.js';
|
|
3
|
+
describe('mergeClassNames', () => {
|
|
4
|
+
describe('joining', () => {
|
|
5
|
+
it('joins several names with a single space', () => {
|
|
6
|
+
expect(mergeClassNames('lm-video', 'is-playing')).toBe('lm-video is-playing');
|
|
7
|
+
});
|
|
8
|
+
it('returns an empty string when given nothing', () => {
|
|
9
|
+
expect(mergeClassNames()).toBe('');
|
|
10
|
+
});
|
|
11
|
+
it('keeps the order it was given', () => {
|
|
12
|
+
expect(mergeClassNames('c', 'a', 'b')).toBe('c a b');
|
|
13
|
+
});
|
|
14
|
+
it('keeps a name that appears twice', () => {
|
|
15
|
+
expect(mergeClassNames('lm-video', 'lm-video')).toBe('lm-video lm-video');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('discarding', () => {
|
|
19
|
+
it('drops `null` and `undefined`', () => {
|
|
20
|
+
expect(mergeClassNames('lm-video', null, 'is-playing', undefined)).toBe('lm-video is-playing');
|
|
21
|
+
});
|
|
22
|
+
it('drops a name that is empty or only whitespace', () => {
|
|
23
|
+
expect(mergeClassNames('lm-video', '', ' ', '\t')).toBe('lm-video');
|
|
24
|
+
});
|
|
25
|
+
it('returns an empty string when everything was discarded', () => {
|
|
26
|
+
expect(mergeClassNames(null, undefined, ' ')).toBe('');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe('trimming', () => {
|
|
30
|
+
it('trims each name', () => {
|
|
31
|
+
expect(mergeClassNames(' lm-video ', '\tis-playing\n')).toBe('lm-video is-playing');
|
|
32
|
+
});
|
|
33
|
+
it('leaves inner whitespace alone, so a pre-joined string survives', () => {
|
|
34
|
+
expect(mergeClassNames(' lm-video is-playing ')).toBe('lm-video is-playing');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('nested arrays', () => {
|
|
38
|
+
it('flattens an array of names', () => {
|
|
39
|
+
expect(mergeClassNames(['lm-video', 'is-playing'])).toBe('lm-video is-playing');
|
|
40
|
+
});
|
|
41
|
+
it('mixes bare names and arrays', () => {
|
|
42
|
+
expect(mergeClassNames('lm-video', ['is-playing', 'is-loud'], 'is-visible'))
|
|
43
|
+
.toBe('lm-video is-playing is-loud is-visible');
|
|
44
|
+
});
|
|
45
|
+
it('discards inside an array too', () => {
|
|
46
|
+
expect(mergeClassNames(['lm-video', null, '', undefined, 'is-playing'])).toBe('lm-video is-playing');
|
|
47
|
+
});
|
|
48
|
+
it('contributes nothing for an empty or fully discarded array', () => {
|
|
49
|
+
expect(mergeClassNames('lm-video', [], [null, undefined])).toBe('lm-video');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
|
-
export * as addclass from './addclass/index.js'
|
|
3
|
-
export * as append from './append/index.js'
|
|
4
2
|
export * as and from './and/index.js'
|
|
3
|
+
export * as append from './append/index.js'
|
|
5
4
|
export * as at from './at/index.js'
|
|
5
|
+
export * as addclass from './addclass/index.js'
|
|
6
6
|
export * as call from './call/index.js'
|
|
7
7
|
export * as clone from './clone/index.js'
|
|
8
8
|
export * as equals from './equals/index.js'
|
|
9
9
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
10
|
-
export * as getattribute from './getattribute/index.js'
|
|
11
10
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as
|
|
11
|
+
export * as getattribute from './getattribute/index.js'
|
|
13
12
|
export * as getproperty from './getproperty/index.js'
|
|
14
|
-
export * as
|
|
13
|
+
export * as hjstringify from './hjstringify/index.js'
|
|
15
14
|
export * as initialize from './initialize/index.js'
|
|
16
15
|
export * as join from './join/index.js'
|
|
17
16
|
export * as length from './length/index.js'
|
|
18
17
|
export * as map from './map/index.js'
|
|
19
|
-
export * as hjstringify from './hjstringify/index.js'
|
|
20
18
|
export * as negate from './negate/index.js'
|
|
19
|
+
export * as if from './if/index.js'
|
|
20
|
+
export * as hjparse from './hjparse/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
22
|
export * as or from './or/index.js'
|
|
23
23
|
export * as pickrandom from './pickrandom/index.js'
|
|
@@ -26,27 +26,27 @@ export * as print from './print/index.js'
|
|
|
26
26
|
export * as push from './push/index.js'
|
|
27
27
|
export * as pusheach from './pusheach/index.js'
|
|
28
28
|
export * as recordtoarray from './recordtoarray/index.js'
|
|
29
|
-
export * as removeattribute from './removeattribute/index.js'
|
|
30
29
|
export * as removeclass from './removeclass/index.js'
|
|
31
30
|
export * as renameproperty from './renameproperty/index.js'
|
|
32
31
|
export * as replace from './replace/index.js'
|
|
33
32
|
export * as select from './select/index.js'
|
|
34
33
|
export * as set from './set/index.js'
|
|
35
34
|
export * as setattribute from './setattribute/index.js'
|
|
36
|
-
export * as
|
|
35
|
+
export * as setproperty from './setproperty/index.js'
|
|
36
|
+
export * as removeattribute from './removeattribute/index.js'
|
|
37
|
+
export * as split from './split/index.js'
|
|
37
38
|
export * as spread from './spread/index.js'
|
|
38
39
|
export * as toarray from './toarray/index.js'
|
|
39
40
|
export * as toboolean from './toboolean/index.js'
|
|
40
41
|
export * as toelement from './toelement/index.js'
|
|
41
42
|
export * as toggleclass from './toggleclass/index.js'
|
|
42
|
-
export * as setproperty from './setproperty/index.js'
|
|
43
|
-
export * as split from './split/index.js'
|
|
44
43
|
export * as tonodelist from './tonodelist/index.js'
|
|
44
|
+
export * as sorton from './sorton/index.js'
|
|
45
45
|
export * as tonull from './tonull/index.js'
|
|
46
46
|
export * as tonumber from './tonumber/index.js'
|
|
47
|
+
export * as torecord from './torecord/index.js'
|
|
47
48
|
export * as toref from './toref/index.js'
|
|
48
49
|
export * as tostring from './tostring/index.js'
|
|
49
|
-
export * as torecord from './torecord/index.js'
|
|
50
50
|
export * as totext from './totext/index.js'
|
|
51
51
|
export * as transformselected from './transformselected/index.js'
|
|
52
52
|
export * as trim from './trim/index.js'
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
|
-
export * as addclass from './addclass/index.js'
|
|
3
|
-
export * as append from './append/index.js'
|
|
4
2
|
export * as and from './and/index.js'
|
|
3
|
+
export * as append from './append/index.js'
|
|
5
4
|
export * as at from './at/index.js'
|
|
5
|
+
export * as addclass from './addclass/index.js'
|
|
6
6
|
export * as call from './call/index.js'
|
|
7
7
|
export * as clone from './clone/index.js'
|
|
8
8
|
export * as equals from './equals/index.js'
|
|
9
9
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
10
|
-
export * as getattribute from './getattribute/index.js'
|
|
11
10
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as
|
|
11
|
+
export * as getattribute from './getattribute/index.js'
|
|
13
12
|
export * as getproperty from './getproperty/index.js'
|
|
14
|
-
export * as
|
|
13
|
+
export * as hjstringify from './hjstringify/index.js'
|
|
15
14
|
export * as initialize from './initialize/index.js'
|
|
16
15
|
export * as join from './join/index.js'
|
|
17
16
|
export * as length from './length/index.js'
|
|
18
17
|
export * as map from './map/index.js'
|
|
19
|
-
export * as hjstringify from './hjstringify/index.js'
|
|
20
18
|
export * as negate from './negate/index.js'
|
|
19
|
+
export * as if from './if/index.js'
|
|
20
|
+
export * as hjparse from './hjparse/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
22
|
export * as or from './or/index.js'
|
|
23
23
|
export * as pickrandom from './pickrandom/index.js'
|
|
@@ -26,27 +26,27 @@ export * as print from './print/index.js'
|
|
|
26
26
|
export * as push from './push/index.js'
|
|
27
27
|
export * as pusheach from './pusheach/index.js'
|
|
28
28
|
export * as recordtoarray from './recordtoarray/index.js'
|
|
29
|
-
export * as removeattribute from './removeattribute/index.js'
|
|
30
29
|
export * as removeclass from './removeclass/index.js'
|
|
31
30
|
export * as renameproperty from './renameproperty/index.js'
|
|
32
31
|
export * as replace from './replace/index.js'
|
|
33
32
|
export * as select from './select/index.js'
|
|
34
33
|
export * as set from './set/index.js'
|
|
35
34
|
export * as setattribute from './setattribute/index.js'
|
|
36
|
-
export * as
|
|
35
|
+
export * as setproperty from './setproperty/index.js'
|
|
36
|
+
export * as removeattribute from './removeattribute/index.js'
|
|
37
|
+
export * as split from './split/index.js'
|
|
37
38
|
export * as spread from './spread/index.js'
|
|
38
39
|
export * as toarray from './toarray/index.js'
|
|
39
40
|
export * as toboolean from './toboolean/index.js'
|
|
40
41
|
export * as toelement from './toelement/index.js'
|
|
41
42
|
export * as toggleclass from './toggleclass/index.js'
|
|
42
|
-
export * as setproperty from './setproperty/index.js'
|
|
43
|
-
export * as split from './split/index.js'
|
|
44
43
|
export * as tonodelist from './tonodelist/index.js'
|
|
44
|
+
export * as sorton from './sorton/index.js'
|
|
45
45
|
export * as tonull from './tonull/index.js'
|
|
46
46
|
export * as tonumber from './tonumber/index.js'
|
|
47
|
+
export * as torecord from './torecord/index.js'
|
|
47
48
|
export * as toref from './toref/index.js'
|
|
48
49
|
export * as tostring from './tostring/index.js'
|
|
49
|
-
export * as torecord from './torecord/index.js'
|
|
50
50
|
export * as totext from './totext/index.js'
|
|
51
51
|
export * as transformselected from './transformselected/index.js'
|
|
52
52
|
export * as trim from './trim/index.js'
|
|
@@ -3,11 +3,11 @@ export * as array from './array/index.js'
|
|
|
3
3
|
export * as boolean from './boolean/index.js'
|
|
4
4
|
export * as element from './element/index.js'
|
|
5
5
|
export * as get from './get/index.js'
|
|
6
|
-
export * as nodelist from './nodelist/index.js'
|
|
7
6
|
export * as guess from './guess/index.js'
|
|
7
|
+
export * as nodelist from './nodelist/index.js'
|
|
8
8
|
export * as null from './null/index.js'
|
|
9
9
|
export * as number from './number/index.js'
|
|
10
10
|
export * as record from './record/index.js'
|
|
11
11
|
export * as ref from './ref/index.js'
|
|
12
|
-
export * as string from './string/index.js'
|
|
13
12
|
export * as text from './text/index.js'
|
|
13
|
+
export * as string from './string/index.js'
|
|
@@ -3,11 +3,11 @@ export * as array from './array/index.js'
|
|
|
3
3
|
export * as boolean from './boolean/index.js'
|
|
4
4
|
export * as element from './element/index.js'
|
|
5
5
|
export * as get from './get/index.js'
|
|
6
|
-
export * as nodelist from './nodelist/index.js'
|
|
7
6
|
export * as guess from './guess/index.js'
|
|
7
|
+
export * as nodelist from './nodelist/index.js'
|
|
8
8
|
export * as null from './null/index.js'
|
|
9
9
|
export * as number from './number/index.js'
|
|
10
10
|
export * as record from './record/index.js'
|
|
11
11
|
export * as ref from './ref/index.js'
|
|
12
|
-
export * as string from './string/index.js'
|
|
13
12
|
export * as text from './text/index.js'
|
|
13
|
+
export * as string from './string/index.js'
|
package/agnostic/html/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export * as deepSelect from './deep-select/index.js'
|
|
|
2
2
|
export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
3
3
|
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
4
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
|
-
export * as insertNode from './insert-node/index.js'
|
|
6
5
|
export * as placeholders from './placeholders/index.js'
|
|
6
|
+
export * as insertNode from './insert-node/index.js'
|
|
7
7
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
8
8
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
|
-
export * as watchSelection from './watch-selection/index.js'
|
|
10
9
|
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
|
+
export * as watchSelection from './watch-selection/index.js'
|
package/agnostic/html/index.js
CHANGED
|
@@ -2,9 +2,9 @@ export * as deepSelect from './deep-select/index.js'
|
|
|
2
2
|
export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
3
3
|
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
4
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
|
-
export * as insertNode from './insert-node/index.js'
|
|
6
5
|
export * as placeholders from './placeholders/index.js'
|
|
6
|
+
export * as insertNode from './insert-node/index.js'
|
|
7
7
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
8
8
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
|
-
export * as watchSelection from './watch-selection/index.js'
|
|
10
9
|
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
|
+
export * as watchSelection from './watch-selection/index.js'
|
package/agnostic/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as react from './@react/index.js'
|
|
1
2
|
export * as arrays from './arrays/index.js'
|
|
2
3
|
export * as booleans from './booleans/index.js'
|
|
3
4
|
export * as colors from './colors/index.js'
|
|
@@ -12,6 +13,6 @@ export * as random from './random/index.js'
|
|
|
12
13
|
export * as regexps from './regexps/index.js'
|
|
13
14
|
export * as sanitization from './sanitization/index.js'
|
|
14
15
|
export * as strings from './strings/index.js'
|
|
15
|
-
export * as time from './time/index.js'
|
|
16
16
|
export * as subtitles from './subtitles/index.js'
|
|
17
|
+
export * as time from './time/index.js'
|
|
17
18
|
export * as typescript from './typescript/index.js'
|
package/agnostic/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as react from './@react/index.js'
|
|
1
2
|
export * as arrays from './arrays/index.js'
|
|
2
3
|
export * as booleans from './booleans/index.js'
|
|
3
4
|
export * as colors from './colors/index.js'
|
|
@@ -12,6 +13,6 @@ export * as random from './random/index.js'
|
|
|
12
13
|
export * as regexps from './regexps/index.js'
|
|
13
14
|
export * as sanitization from './sanitization/index.js'
|
|
14
15
|
export * as strings from './strings/index.js'
|
|
15
|
-
export * as time from './time/index.js'
|
|
16
16
|
export * as subtitles from './subtitles/index.js'
|
|
17
|
+
export * as time from './time/index.js'
|
|
17
18
|
export * as typescript from './typescript/index.js'
|
package/agnostic/misc/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * as assert from './assert/index.js'
|
|
2
|
-
export * as cast from './cast/index.js'
|
|
3
2
|
export * as connection from './connection/index.js'
|
|
4
3
|
export * as crawler from './crawler/index.js'
|
|
5
4
|
export * as crossenv from './crossenv/index.js'
|
|
6
5
|
export * as dataSize from './data-size/index.js'
|
|
7
6
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
7
|
+
export * as cast from './cast/index.js'
|
|
8
8
|
export * as isNullish from './is-nullish/index.js'
|
|
9
9
|
export * as logs from './logs/index.js'
|
|
10
10
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
package/agnostic/misc/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * as assert from './assert/index.js'
|
|
2
|
-
export * as cast from './cast/index.js'
|
|
3
2
|
export * as connection from './connection/index.js'
|
|
4
3
|
export * as crawler from './crawler/index.js'
|
|
5
4
|
export * as crossenv from './crossenv/index.js'
|
|
6
5
|
export * as dataSize from './data-size/index.js'
|
|
7
6
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
7
|
+
export * as cast from './cast/index.js'
|
|
8
8
|
export * as isNullish from './is-nullish/index.js'
|
|
9
9
|
export * as logs from './logs/index.js'
|
|
10
10
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
2
1
|
export * as approximateRational from './approximate-rational/index.js'
|
|
2
|
+
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
3
3
|
export * as clamp from './clamp/index.js'
|
|
4
|
+
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
4
5
|
export * as interpolate from './interpolate/index.js'
|
|
5
6
|
export * as round from './round/index.js'
|
|
6
|
-
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
2
1
|
export * as approximateRational from './approximate-rational/index.js'
|
|
2
|
+
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
3
3
|
export * as clamp from './clamp/index.js'
|
|
4
|
+
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
4
5
|
export * as interpolate from './interpolate/index.js'
|
|
5
6
|
export * as round from './round/index.js'
|
|
6
|
-
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
1
|
export * as enums from './enums/index.js'
|
|
2
|
+
export * as deepGetProperty from './deep-get-property/index.js'
|
|
3
3
|
export * as flattenGetters from './flatten-getters/index.js'
|
|
4
|
+
export * as isObject from './is-object/index.js'
|
|
4
5
|
export * as isRecord from './is-record/index.js'
|
|
5
6
|
export * as recordFormat from './record-format/index.js'
|
|
6
7
|
export * as recordMap from './record-map/index.js'
|
|
7
8
|
export * as sortKeys from './sort-keys/index.js'
|
|
8
9
|
export * as validation from './validation/index.js'
|
|
9
|
-
export * as isObject from './is-object/index.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
1
|
export * as enums from './enums/index.js'
|
|
2
|
+
export * as deepGetProperty from './deep-get-property/index.js'
|
|
3
3
|
export * as flattenGetters from './flatten-getters/index.js'
|
|
4
|
+
export * as isObject from './is-object/index.js'
|
|
4
5
|
export * as isRecord from './is-record/index.js'
|
|
5
6
|
export * as recordFormat from './record-format/index.js'
|
|
6
7
|
export * as recordMap from './record-map/index.js'
|
|
7
8
|
export * as sortKeys from './sort-keys/index.js'
|
|
8
9
|
export * as validation from './validation/index.js'
|
|
9
|
-
export * as isObject from './is-object/index.js'
|
package/agnostic/random/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useRef } from 'react';
|
|
|
3
3
|
import { clamp } from '../../agnostic/numbers/clamp/index.js';
|
|
4
4
|
import { round } from '../../agnostic/numbers/round/index.js';
|
|
5
5
|
import { clss } from '../../agnostic/css/clss/index.js';
|
|
6
|
-
import { mergeClassNames } from '
|
|
6
|
+
import { mergeClassNames } from '../../agnostic/css/merge-class-names/index.js';
|
|
7
7
|
import { beforeAfter as publicClassName } from '../public-classnames.js';
|
|
8
8
|
import cssModule from './styles.module.css';
|
|
9
9
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useStateChangeDispatch } from '../../agnostic/@react/effects/use-state-change-dispatch/index.js';
|
|
4
4
|
import { ControlledBeforeAfter } from './index.controlled.js';
|
|
5
5
|
/**
|
|
6
6
|
* Pointer ratios are stretched by this much on each side before becoming the
|
|
@@ -38,7 +38,7 @@ export const BeforeAfter = ({ mode = 'horizontal', ratio, defaultRatio = 0.5, on
|
|
|
38
38
|
const isControlled = ratio !== undefined;
|
|
39
39
|
const effectiveRatio = isControlled ? ratio : internalRatio;
|
|
40
40
|
// State dispatch
|
|
41
|
-
|
|
41
|
+
useStateChangeDispatch(effectiveRatio, onRatioChanged);
|
|
42
42
|
// User action handlers
|
|
43
43
|
const moveDividerTo = (xRatio, yRatio) => {
|
|
44
44
|
if (isControlled)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { clss } from '../../agnostic/css/clss/index.js';
|
|
3
|
-
import { mergeClassNames } from '
|
|
3
|
+
import { mergeClassNames } from '../../agnostic/css/merge-class-names/index.js';
|
|
4
4
|
import { button as publicClassName } from '../public-classnames.js';
|
|
5
5
|
import cssModule from './styles.module.css';
|
|
6
6
|
/**
|