extra-react-hooks 0.3.4 → 0.4.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/lib/index.d.ts +16 -16
- package/lib/index.js +16 -16
- package/lib/index.js.map +1 -1
- package/lib/use-finite-state-machine.js +2 -2
- package/lib/use-finite-state-machine.js.map +1 -1
- package/lib/use-iife.js +2 -2
- package/lib/use-iife.js.map +1 -1
- package/lib/use-is-mounted.js +2 -2
- package/lib/use-is-mounted.js.map +1 -1
- package/lib/use-multiple-selection.d.ts +1 -1
- package/lib/use-multiple-selection.js +2 -2
- package/lib/use-multiple-selection.js.map +1 -1
- package/lib/use-single-selection.d.ts +1 -1
- package/lib/use-single-selection.js +2 -2
- package/lib/use-single-selection.js.map +1 -1
- package/lib/use-update-effect.js +2 -2
- package/lib/use-update-effect.js.map +1 -1
- package/package.json +36 -35
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './use-increment';
|
|
2
|
-
export * from './use-is-mounted';
|
|
3
|
-
export * from './use-is-first-render';
|
|
4
|
-
export * from './use-render-counter';
|
|
5
|
-
export * from './use-mount';
|
|
6
|
-
export * from './use-unmount';
|
|
7
|
-
export * from './use-update-effect';
|
|
8
|
-
export * from './use-single-selection';
|
|
9
|
-
export * from './use-multiple-selection';
|
|
10
|
-
export * from './use-state-cycle';
|
|
11
|
-
export * from './use-toggle';
|
|
12
|
-
export * from './use-resize-observer';
|
|
13
|
-
export * from './use-step';
|
|
14
|
-
export * from './use-force-update';
|
|
15
|
-
export * from './use-finite-state-machine';
|
|
16
|
-
export * from './use-iife';
|
|
1
|
+
export * from './use-increment.js';
|
|
2
|
+
export * from './use-is-mounted.js';
|
|
3
|
+
export * from './use-is-first-render.js';
|
|
4
|
+
export * from './use-render-counter.js';
|
|
5
|
+
export * from './use-mount.js';
|
|
6
|
+
export * from './use-unmount.js';
|
|
7
|
+
export * from './use-update-effect.js';
|
|
8
|
+
export * from './use-single-selection.js';
|
|
9
|
+
export * from './use-multiple-selection.js';
|
|
10
|
+
export * from './use-state-cycle.js';
|
|
11
|
+
export * from './use-toggle.js';
|
|
12
|
+
export * from './use-resize-observer.js';
|
|
13
|
+
export * from './use-step.js';
|
|
14
|
+
export * from './use-force-update.js';
|
|
15
|
+
export * from './use-finite-state-machine.js';
|
|
16
|
+
export * from './use-iife.js';
|
package/lib/index.js
CHANGED
|
@@ -14,20 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./use-increment"), exports);
|
|
18
|
-
__exportStar(require("./use-is-mounted"), exports);
|
|
19
|
-
__exportStar(require("./use-is-first-render"), exports);
|
|
20
|
-
__exportStar(require("./use-render-counter"), exports);
|
|
21
|
-
__exportStar(require("./use-mount"), exports);
|
|
22
|
-
__exportStar(require("./use-unmount"), exports);
|
|
23
|
-
__exportStar(require("./use-update-effect"), exports);
|
|
24
|
-
__exportStar(require("./use-single-selection"), exports);
|
|
25
|
-
__exportStar(require("./use-multiple-selection"), exports);
|
|
26
|
-
__exportStar(require("./use-state-cycle"), exports);
|
|
27
|
-
__exportStar(require("./use-toggle"), exports);
|
|
28
|
-
__exportStar(require("./use-resize-observer"), exports);
|
|
29
|
-
__exportStar(require("./use-step"), exports);
|
|
30
|
-
__exportStar(require("./use-force-update"), exports);
|
|
31
|
-
__exportStar(require("./use-finite-state-machine"), exports);
|
|
32
|
-
__exportStar(require("./use-iife"), exports);
|
|
17
|
+
__exportStar(require("./use-increment.js"), exports);
|
|
18
|
+
__exportStar(require("./use-is-mounted.js"), exports);
|
|
19
|
+
__exportStar(require("./use-is-first-render.js"), exports);
|
|
20
|
+
__exportStar(require("./use-render-counter.js"), exports);
|
|
21
|
+
__exportStar(require("./use-mount.js"), exports);
|
|
22
|
+
__exportStar(require("./use-unmount.js"), exports);
|
|
23
|
+
__exportStar(require("./use-update-effect.js"), exports);
|
|
24
|
+
__exportStar(require("./use-single-selection.js"), exports);
|
|
25
|
+
__exportStar(require("./use-multiple-selection.js"), exports);
|
|
26
|
+
__exportStar(require("./use-state-cycle.js"), exports);
|
|
27
|
+
__exportStar(require("./use-toggle.js"), exports);
|
|
28
|
+
__exportStar(require("./use-resize-observer.js"), exports);
|
|
29
|
+
__exportStar(require("./use-step.js"), exports);
|
|
30
|
+
__exportStar(require("./use-force-update.js"), exports);
|
|
31
|
+
__exportStar(require("./use-finite-state-machine.js"), exports);
|
|
32
|
+
__exportStar(require("./use-iife.js"), exports);
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,sDAAmC;AACnC,2DAAwC;AACxC,0DAAuC;AACvC,iDAA8B;AAC9B,mDAAgC;AAChC,yDAAsC;AACtC,4DAAyC;AACzC,8DAA2C;AAC3C,uDAAoC;AACpC,kDAA+B;AAC/B,2DAAwC;AACxC,gDAA6B;AAC7B,wDAAqC;AACrC,gEAA6C;AAC7C,gDAA6B"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useFiniteStateMachine = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const extra_fsm_1 = require("extra-fsm");
|
|
6
|
-
const
|
|
6
|
+
const use_force_update_js_1 = require("./use-force-update.js");
|
|
7
7
|
function useFiniteStateMachine(schema, initialState) {
|
|
8
|
-
const forceUpdate = (0,
|
|
8
|
+
const forceUpdate = (0, use_force_update_js_1.useForceUpdate)();
|
|
9
9
|
const fsm = (0, react_1.useMemo)(() => new extra_fsm_1.ObservableFiniteStateMachine(schema, initialState), [schema, initialState]);
|
|
10
10
|
(0, react_1.useEffect)(() => {
|
|
11
11
|
const observable = fsm.observeStateChanges();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-finite-state-machine.js","sourceRoot":"","sources":["../src/use-finite-state-machine.ts"],"names":[],"mappings":";;;AAAA,iCAA0C;AAC1C,yCAAmF;AACnF
|
|
1
|
+
{"version":3,"file":"use-finite-state-machine.js","sourceRoot":"","sources":["../src/use-finite-state-machine.ts"],"names":[],"mappings":";;;AAAA,iCAA0C;AAC1C,yCAAmF;AACnF,+DAAsD;AAOtD,SAAgB,qBAAqB,CACnC,MAA+C,EAC/C,YAAmB;IAEnB,MAAM,WAAW,GAAG,IAAA,oCAAc,GAAE,CAAA;IACpC,MAAM,GAAG,GAAG,IAAA,eAAO,EACjB,GAAG,EAAE,CAAC,IAAI,wCAA4B,CAAC,MAAM,EAAE,YAAY,CAAC,EAC5D,CAAC,MAAM,EAAE,YAAY,CAAC,CACvB,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,GAAG,CAAC,mBAAmB,EAAE,CAAA;QAC5C,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;QAE9D,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAA;IACzC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAET,OAAO,GAAG,CAAA;AACZ,CAAC;AAlBD,sDAkBC"}
|
package/lib/use-iife.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIIFE = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const use_is_first_render_js_1 = require("./use-is-first-render.js");
|
|
6
6
|
function useIIFE(iife, deps) {
|
|
7
7
|
const oldDeps = (0, react_1.useRef)([]);
|
|
8
|
-
const isFirstRender = (0,
|
|
8
|
+
const isFirstRender = (0, use_is_first_render_js_1.useIsFirstRender)();
|
|
9
9
|
if (isFirstRender()) {
|
|
10
10
|
iife();
|
|
11
11
|
}
|
package/lib/use-iife.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-iife.js","sourceRoot":"","sources":["../src/use-iife.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"use-iife.js","sourceRoot":"","sources":["../src/use-iife.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAC9B,qEAA8D;AAE9D,SAAgB,OAAO,CAAC,IAAgB,EAAE,IAA0B;IAClE,MAAM,OAAO,GAAG,IAAA,cAAM,EAAuB,EAAE,CAAC,CAAA;IAChD,MAAM,aAAa,GAAG,IAAA,yCAAgB,GAAE,CAAA;IAExC,IAAI,aAAa,EAAE,EAAE;QACnB,IAAI,EAAE,CAAA;KACP;SAAM;QACL,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE;YAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;gBACjD,IAAI,EAAE,CAAA;aACP;SACF;aAAM;YACL,IAAI,EAAE,CAAA;SACP;KACF;IAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACpC,CAAC;AAjBD,0BAiBC"}
|
package/lib/use-is-mounted.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIsMounted = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const use_mount_js_1 = require("./use-mount.js");
|
|
6
6
|
function useIsMounted() {
|
|
7
7
|
const mounted = (0, react_1.useRef)(false);
|
|
8
|
-
(0,
|
|
8
|
+
(0, use_mount_js_1.useMount)(() => {
|
|
9
9
|
mounted.current = true;
|
|
10
10
|
return () => {
|
|
11
11
|
mounted.current = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-mounted.js","sourceRoot":"","sources":["../src/use-is-mounted.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"use-is-mounted.js","sourceRoot":"","sources":["../src/use-is-mounted.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAC3C,iDAAyC;AAEzC,SAAgB,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAA;IAE7B,IAAA,uBAAQ,EAAC,GAAG,EAAE;QACZ,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QACtB,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,OAAO,GAAG,KAAK,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,IAAA,mBAAW,EAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAEjC,SAAS,SAAS;QAChB,OAAO,OAAO,CAAC,OAAO,CAAA;IACxB,CAAC;AACH,CAAC;AAfD,oCAeC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonEmptyArray } from 'justypes';
|
|
2
|
-
import { IOptionState } from
|
|
2
|
+
import { IOptionState } from "./types.js";
|
|
3
3
|
export declare function useMultipleSelection<T>(options: NonEmptyArray<T>, defaultSelectedIndexes?: number[]): {
|
|
4
4
|
selectedIndexes: number[];
|
|
5
5
|
optionStates: IOptionState[];
|
|
@@ -4,9 +4,9 @@ exports.useMultipleSelection = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const errors_1 = require("@blackglory/errors");
|
|
6
6
|
const iterable_operator_1 = require("iterable-operator");
|
|
7
|
-
const
|
|
7
|
+
const use_iife_js_1 = require("./use-iife.js");
|
|
8
8
|
function useMultipleSelection(options, defaultSelectedIndexes = []) {
|
|
9
|
-
(0,
|
|
9
|
+
(0, use_iife_js_1.useIIFE)(() => {
|
|
10
10
|
for (const index of defaultSelectedIndexes) {
|
|
11
11
|
(0, errors_1.assert)(index >= 0 && index < options.length, 'The index of parameter defaultSelectedIndexes must be in the range of 0 to values.length');
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-multiple-selection.js","sourceRoot":"","sources":["../src/use-multiple-selection.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,+CAA2C;AAC3C,yDAA2C;AAG3C
|
|
1
|
+
{"version":3,"file":"use-multiple-selection.js","sourceRoot":"","sources":["../src/use-multiple-selection.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,+CAA2C;AAC3C,yDAA2C;AAG3C,+CAA0C;AAE1C,SAAgB,oBAAoB,CAClC,OAAyB,EACzB,yBAAmC,EAAE;IAQrC,IAAA,qBAAO,EAAC,GAAG,EAAE;QACX,KAAK,MAAM,KAAK,IAAI,sBAAsB,EAAE;YAC1C,IAAA,eAAM,EACJ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EACpC,0FAA0F,CAC3F,CAAA;SACF;IACH,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAA;IAE5B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAA;IAEvF,OAAO;QACL,eAAe,EAAE,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,2BAAO,EAAC,eAAe,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;QAC3E,YAAY,EAAE,IAAA,eAAO,EAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QACrE,MAAM,EAAE,IAAA,mBAAW,EAAC,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC;QAC9C,MAAM,EAAE,IAAA,mBAAW,EAAC,MAAM,EAAE,EAAE,CAAC;QAC/B,QAAQ,EAAE,IAAA,mBAAW,EAAC,QAAQ,EAAE,EAAE,CAAC;KACpC,CAAA;IAED,SAAS,kBAAkB;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;YAC9B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;YAClC,OAAO,EAAE,QAAQ,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,UAAU,CAAC,KAAa;QAC/B,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACnC,CAAC;IAED,SAAS,MAAM,CAAC,KAAa;QAC3B,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;YACrB,QAAQ,CAAC,KAAK,CAAC,CAAA;SAChB;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,CAAA;SACd;IACH,CAAC;IAED,SAAS,MAAM,CAAC,KAAa;QAC3B,kBAAkB,CAAC,eAAe,CAAC,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;YACvC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACjB,OAAO,MAAM,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,QAAQ,CAAC,KAAa;QAC7B,kBAAkB,CAAC,eAAe,CAAC,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;YACvC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACpB,OAAO,MAAM,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AA/DD,oDA+DC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonEmptyArray } from 'justypes';
|
|
2
|
-
import { IOptionState } from
|
|
2
|
+
import { IOptionState } from "./types.js";
|
|
3
3
|
export declare function useSingleSelection<T>(options: NonEmptyArray<T>, defaultSelectedIndex: number): {
|
|
4
4
|
selectedIndex: number;
|
|
5
5
|
optionStates: IOptionState[];
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useSingleSelection = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const errors_1 = require("@blackglory/errors");
|
|
6
|
-
const
|
|
6
|
+
const use_iife_js_1 = require("./use-iife.js");
|
|
7
7
|
function useSingleSelection(options, defaultSelectedIndex) {
|
|
8
|
-
(0,
|
|
8
|
+
(0, use_iife_js_1.useIIFE)(() => {
|
|
9
9
|
(0, errors_1.assert)(defaultSelectedIndex >= 0 && defaultSelectedIndex < options.length, 'The parameter defaultSelectedIndex must be in the range of 0 to values.length');
|
|
10
10
|
}, [defaultSelectedIndex]);
|
|
11
11
|
const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(defaultSelectedIndex);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-single-selection.js","sourceRoot":"","sources":["../src/use-single-selection.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,+CAA2C;AAG3C
|
|
1
|
+
{"version":3,"file":"use-single-selection.js","sourceRoot":"","sources":["../src/use-single-selection.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,+CAA2C;AAG3C,+CAA0C;AAE1C,SAAgB,kBAAkB,CAChC,OAAyB,EACzB,oBAA4B;IAM5B,IAAA,qBAAO,EAAC,GAAG,EAAE;QACX,IAAA,eAAM,EACJ,oBAAoB,IAAI,CAAC,IAAI,oBAAoB,GAAG,OAAO,CAAC,MAAM,EAClE,+EAA+E,CAChF,CAAA;IACH,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;IAE1B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,oBAAoB,CAAC,CAAA;IAExE,OAAO;QACL,aAAa;QACb,YAAY,EAAE,IAAA,eAAO,EAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACnE,MAAM,EAAE,IAAA,mBAAW,EAAC,MAAM,EAAE,EAAE,CAAC;KAChC,CAAA;IAED,SAAS,kBAAkB;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YAChC,QAAQ,EAAE,KAAK,KAAK,aAAa;SAClC,CAAC,CAAC,CAAA;IACL,CAAC;IAED,SAAS,MAAM,CAAC,KAAa;QAC3B,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;AACH,CAAC;AAhCD,gDAgCC"}
|
package/lib/use-update-effect.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useUpdateEffect = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const use_is_first_render_js_1 = require("./use-is-first-render.js");
|
|
6
6
|
function useUpdateEffect(effect, deps) {
|
|
7
|
-
const isFirstRender = (0,
|
|
7
|
+
const isFirstRender = (0, use_is_first_render_js_1.useIsFirstRender)();
|
|
8
8
|
(0, react_1.useEffect)(() => {
|
|
9
9
|
if (!isFirstRender()) {
|
|
10
10
|
return effect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-update-effect.js","sourceRoot":"","sources":["../src/use-update-effect.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AACjD
|
|
1
|
+
{"version":3,"file":"use-update-effect.js","sourceRoot":"","sources":["../src/use-update-effect.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AACjD,qEAA2D;AAE3D,SAAgB,eAAe,CAC7B,MAAsB,EACtB,IAA2B;IAE3B,MAAM,aAAa,GAAG,IAAA,yCAAgB,GAAE,CAAA;IAExC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,EAAE,EAAE;YACpB,OAAO,MAAM,EAAE,CAAA;SAChB;IACH,CAAC,EAAE,IAAI,CAAC,CAAA;AACV,CAAC;AAXD,0CAWC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extra-react-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"files": [
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
|
+
"type": "module",
|
|
9
10
|
"main": "lib/index.js",
|
|
10
11
|
"types": "lib/index.d.ts",
|
|
11
12
|
"sideEffects": false,
|
|
@@ -13,61 +14,61 @@
|
|
|
13
14
|
"author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"scripts": {
|
|
17
|
+
"prepare": "ts-patch install -s",
|
|
16
18
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src __tests__",
|
|
17
|
-
"test": "karma start karma.config.
|
|
18
|
-
"test:dev": "karma start karma.config.
|
|
19
|
-
"prepublishOnly": "run-s clean build",
|
|
19
|
+
"test": "karma start karma.config.cjs --single-run",
|
|
20
|
+
"test:dev": "karma start karma.config.cjs",
|
|
21
|
+
"prepublishOnly": "run-s prepare clean build",
|
|
20
22
|
"clean": "rimraf lib",
|
|
21
|
-
"build": "
|
|
22
|
-
"build:compile": "tsc --project tsconfig.build.json --module commonjs --target es2018 --outDir lib",
|
|
23
|
-
"build:patch": "tscpaths -p tsconfig.build.json -s ./src -o ./lib",
|
|
23
|
+
"build": "tsc --project tsconfig.build.json --outDir lib",
|
|
24
24
|
"release": "standard-version"
|
|
25
25
|
},
|
|
26
26
|
"husky": {
|
|
27
27
|
"hooks": {
|
|
28
|
-
"pre-commit": "run-s lint build test",
|
|
28
|
+
"pre-commit": "run-s prepare lint build test",
|
|
29
29
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@blackglory/wait-for": "^0.
|
|
34
|
-
"@commitlint/cli": "^17.
|
|
35
|
-
"@commitlint/config-conventional": "^17.
|
|
36
|
-
"@testing-library/react": "^
|
|
37
|
-
"@testing-library/react-hooks": "^
|
|
38
|
-
"@types/jasmine": "^4.3.
|
|
33
|
+
"@blackglory/wait-for": "^0.6.0",
|
|
34
|
+
"@commitlint/cli": "^17.4.2",
|
|
35
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
36
|
+
"@testing-library/react": "^13.4.0",
|
|
37
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
38
|
+
"@types/jasmine": "^4.3.1",
|
|
39
39
|
"@types/react": "^17.0.40",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
-
"eslint": "^8.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
|
41
|
+
"@typescript-eslint/parser": "^5.48.2",
|
|
42
|
+
"eslint": "^8.32.0",
|
|
43
43
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
44
|
"husky": "4",
|
|
45
|
-
"karma": "^6.
|
|
45
|
+
"karma": "^6.4.1",
|
|
46
46
|
"karma-chrome-launcher": "^3.1.1",
|
|
47
47
|
"karma-jasmine": "^5.1.0",
|
|
48
48
|
"karma-webpack": "^5.0.0",
|
|
49
49
|
"npm-run-all": "^4.1.5",
|
|
50
|
-
"react": "^
|
|
51
|
-
"react-dom": "^
|
|
52
|
-
"react-test-renderer": "^
|
|
53
|
-
"rimraf": "^
|
|
50
|
+
"react": "^18.2.0",
|
|
51
|
+
"react-dom": "^18.2.0",
|
|
52
|
+
"react-test-renderer": "^18.2.0",
|
|
53
|
+
"rimraf": "^4.1.1",
|
|
54
54
|
"standard-version": "^9.3.2",
|
|
55
|
-
"ts-loader": "^9.
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"tslib": "^2.
|
|
59
|
-
"typescript": "
|
|
60
|
-
"
|
|
55
|
+
"ts-loader": "^9.4.2",
|
|
56
|
+
"ts-patch": "^2.1.0",
|
|
57
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
58
|
+
"tslib": "^2.4.1",
|
|
59
|
+
"typescript": "4.8",
|
|
60
|
+
"typescript-transform-paths": "^3.4.6",
|
|
61
|
+
"webpack": "^5.75.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
|
-
"@blackglory/errors": "^2.
|
|
64
|
-
"@blackglory/types": "^1.
|
|
65
|
-
"extra-fsm": "^0.1.
|
|
66
|
-
"iterable-operator": "^
|
|
67
|
-
"justypes": "^
|
|
68
|
-
"rxjs": "^7.
|
|
64
|
+
"@blackglory/errors": "^2.4.3",
|
|
65
|
+
"@blackglory/types": "^1.4.0",
|
|
66
|
+
"extra-fsm": "^0.1.1",
|
|
67
|
+
"iterable-operator": "^4.0.0",
|
|
68
|
+
"justypes": "^4.1.0",
|
|
69
|
+
"rxjs": "^7.8.0"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
|
-
"react": "
|
|
72
|
+
"react": "^16.8 || ^17 || ^18"
|
|
72
73
|
}
|
|
73
74
|
}
|