anu-verzum 2.2.7 → 2.2.9

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.
@@ -6,7 +6,7 @@ export declare abstract class Component<P extends Record<string, any> = Props, S
6
6
  __fiber?: any;
7
7
  static isAnuComponent: boolean;
8
8
  constructor(props: P, context?: Record<string, any>);
9
- setState(partialState?: Partial<S> | ((prevState: S, prevProps: P) => S)): void;
9
+ setState(partialState?: Partial<S> | ((prevState: S, prevProps: P) => Partial<S>)): void;
10
10
  abstract render(): AnuElement | AnuElement[] | string | number | boolean | null | undefined;
11
11
  componentDidMount(): void;
12
12
  componentDidUpdate(_prevProps: P, _prevState: S): void;
@@ -144,15 +144,14 @@ const updateClassComponent = wipFiber => {
144
144
  wipFiber.stateNode.componentWillUnmount = wipFiber.stateNode.componentWillUnmount.bind(wipFiber.stateNode);
145
145
  }
146
146
  } else if (wipFiber.props === instance.props && !wipFiber.partialState && !wipFiber.partialStateCallback) {
147
+ wipFiber.prevState = {
148
+ ...instance.state
149
+ };
147
150
  cloneChildFibers(wipFiber);
148
151
  return;
149
152
  }
150
- let nextState;
151
- if (!wipFiber.partialStateCallback) {
152
- nextState = Object.assign({}, instance.state, wipFiber.partialState);
153
- } else {
154
- nextState = wipFiber.partialStateCallback(instance.state, wipFiber.props);
155
- }
153
+ const statePatch = wipFiber.partialStateCallback ? wipFiber.partialStateCallback(instance.state, wipFiber.props) : wipFiber.partialState;
154
+ const nextState = Object.assign({}, instance.state, statePatch);
156
155
  wipFiber.prevState = {
157
156
  ...instance.state
158
157
  };
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ declare const Anu: {
43
43
  state: Record<string, any>;
44
44
  context: Record<string, any>;
45
45
  __fiber?: any;
46
- setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/Feature").FeatureToggleProps) => Record<string, any>)): void;
46
+ setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/Feature").FeatureToggleProps) => Partial<Record<string, any>>)): void;
47
47
  componentDidMount(): void;
48
48
  componentDidUpdate(_prevProps: import("./core/components/Feature").FeatureToggleProps, _prevState: Record<string, any>): void;
49
49
  componentWillUnmount(): void;
@@ -61,7 +61,7 @@ declare const Anu: {
61
61
  state: Record<string, any>;
62
62
  context: Record<string, any>;
63
63
  __fiber?: any;
64
- setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryLinkProps) => Record<string, any>)): void;
64
+ setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryLinkProps) => Partial<Record<string, any>>)): void;
65
65
  componentDidMount(): void;
66
66
  componentDidUpdate(_prevProps: import("./core/components/History").HistoryLinkProps, _prevState: Record<string, any>): void;
67
67
  componentWillUnmount(): void;
@@ -76,7 +76,7 @@ declare const Anu: {
76
76
  state: Record<string, any>;
77
77
  context: Record<string, any>;
78
78
  __fiber?: any;
79
- setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryRedirectProps) => Record<string, any>)): void;
79
+ setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryRedirectProps) => Partial<Record<string, any>>)): void;
80
80
  componentDidUpdate(_prevProps: import("./core/components/History").HistoryRedirectProps, _prevState: Record<string, any>): void;
81
81
  componentWillUnmount(): void;
82
82
  };
@@ -92,7 +92,7 @@ declare const Anu: {
92
92
  state: Record<string, any>;
93
93
  context: Record<string, any>;
94
94
  __fiber?: any;
95
- setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryRouteProps) => Record<string, any>)): void;
95
+ setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/History").HistoryRouteProps) => Partial<Record<string, any>>)): void;
96
96
  componentDidUpdate(_prevProps: import("./core/components/History").HistoryRouteProps, _prevState: Record<string, any>): void;
97
97
  };
98
98
  isAnuComponent: boolean;
@@ -123,7 +123,7 @@ declare const Anu: {
123
123
  state: Record<string, any>;
124
124
  context: Record<string, any>;
125
125
  __fiber?: any;
126
- setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/Connector").ConnectorProviderProps) => Record<string, any>)): void;
126
+ setState(partialState?: Partial<Record<string, any>> | ((prevState: Record<string, any>, prevProps: import("./core/components/Connector").ConnectorProviderProps) => Partial<Record<string, any>>)): void;
127
127
  componentDidMount(): void;
128
128
  componentDidUpdate(_prevProps: import("./core/components/Connector").ConnectorProviderProps, _prevState: Record<string, any>): void;
129
129
  componentWillUnmount(): void;
@@ -15,6 +15,11 @@ export declare const fireEvent: {
15
15
  submit(el: Element, init?: EventInit): boolean;
16
16
  mouseDown(el: Element, init?: EventInit): boolean;
17
17
  mouseUp(el: Element, init?: EventInit): boolean;
18
+ mouseEnter(el: Element, init?: EventInit): boolean;
19
+ mouseLeave(el: Element, init?: EventInit): boolean;
20
+ mouseOver(el: Element, init?: EventInit): boolean;
21
+ mouseOut(el: Element, init?: EventInit): boolean;
22
+ mouseMove(el: Element, init?: EventInit): boolean;
18
23
  wheel(el: Element, init?: EventInit): boolean;
19
24
  error(el: Element, init?: EventInit): boolean;
20
25
  load(el: Element, init?: EventInit): boolean;
@@ -53,6 +53,11 @@ fireEvent.keyPress = (el, init) => fireEvent(el, 'keypress', init);
53
53
  fireEvent.submit = (el, init) => fireEvent(el, 'submit', init);
54
54
  fireEvent.mouseDown = (el, init) => fireEvent(el, 'mousedown', init);
55
55
  fireEvent.mouseUp = (el, init) => fireEvent(el, 'mouseup', init);
56
+ fireEvent.mouseEnter = (el, init) => fireEvent(el, 'mouseenter', init);
57
+ fireEvent.mouseLeave = (el, init) => fireEvent(el, 'mouseleave', init);
58
+ fireEvent.mouseOver = (el, init) => fireEvent(el, 'mouseover', init);
59
+ fireEvent.mouseOut = (el, init) => fireEvent(el, 'mouseout', init);
60
+ fireEvent.mouseMove = (el, init) => fireEvent(el, 'mousemove', init);
56
61
  fireEvent.wheel = (el, init) => fireEvent(el, 'wheel', init);
57
62
  fireEvent.error = (el, init) => fireEvent(el, 'error', init);
58
63
  fireEvent.load = (el, init) => fireEvent(el, 'load', init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anu-verzum",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "A \"React-like\" UI library that supports JSX syntax, Redux-like state management, array-rendering, i18n, routing and many more.",
5
5
  "keywords": [
6
6
  "anu-verzum",