@etsoo/react 1.7.60 → 1.7.62

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.
@@ -91,16 +91,10 @@ export interface INotifierReact extends INotifier<React.ReactNode, NotificationR
91
91
  /**
92
92
  * Create state provider
93
93
  * @param className Style class name
94
- * @param optionGenerator Options generator
94
+ * @param debug Is debug mode
95
95
  * @returns Provider
96
96
  */
97
- createProvider(className?: string, optionGenerator?: INotifierOptions): React.FunctionComponent<NotificationReactRenderProps>;
98
- }
99
- /**
100
- * Notifier options generator
101
- */
102
- export interface INotifierOptions {
103
- (): any;
97
+ createProvider(className?: string, debug?: boolean): React.FunctionComponent<NotificationReactRenderProps>;
104
98
  }
105
99
  /**
106
100
  * Notifier for React
@@ -136,6 +130,6 @@ export declare abstract class NotifierReact extends NotificationContainer<React.
136
130
  * @param className Style class name
137
131
  * @returns Provider
138
132
  */
139
- createProvider(className?: string): React.FunctionComponent<React.PropsWithChildren<NotificationReactRenderProps>>;
133
+ createProvider(className?: string, debug?: boolean): React.FunctionComponent<React.PropsWithChildren<NotificationReactRenderProps>>;
140
134
  }
141
135
  export {};
@@ -28,6 +28,10 @@ export class NotifierReact extends NotificationContainer {
28
28
  */
29
29
  constructor() {
30
30
  super((notification, dismiss) => {
31
+ // Debug
32
+ if (this.debug) {
33
+ console.debug('NotifierReact.updateCallback', notification, dismiss, this.loadingCount);
34
+ }
31
35
  // Make sure the state update is set
32
36
  if (this.stateUpdate)
33
37
  this.stateUpdate({ notification, dismiss });
@@ -38,15 +42,11 @@ export class NotifierReact extends NotificationContainer {
38
42
  * @param className Style class name
39
43
  * @returns Provider
40
44
  */
41
- createProvider(className) {
45
+ createProvider(className, debug) {
42
46
  // Custom creator
43
47
  const creator = (state, update, props) => {
44
48
  // Hold the current state update
45
49
  this.stateUpdate = update;
46
- // Debug
47
- if (this.debug) {
48
- console.debug('NotifierReact.createProvider.render', state, props);
49
- }
50
50
  // Aligns collection
51
51
  const aligns = [];
52
52
  for (const align in state) {
@@ -57,6 +57,10 @@ export class NotifierReact extends NotificationContainer {
57
57
  // Add to the collection
58
58
  aligns.push(this.createContainer(Number(align), ui));
59
59
  }
60
+ // Debug
61
+ if (debug) {
62
+ console.debug('NotifierReact.createProvider', className, state, aligns);
63
+ }
60
64
  // Generate the component
61
65
  return React.createElement('div', { className }, aligns);
62
66
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.7.60",
3
+ "version": "1.7.62",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,8 +50,8 @@
50
50
  "@emotion/css": "^11.13.0",
51
51
  "@emotion/react": "^11.13.0",
52
52
  "@emotion/styled": "^11.13.0",
53
- "@etsoo/appscript": "^1.5.1",
54
- "@etsoo/notificationbase": "^1.1.46",
53
+ "@etsoo/appscript": "^1.5.5",
54
+ "@etsoo/notificationbase": "^1.1.47",
55
55
  "@etsoo/shared": "^1.2.44",
56
56
  "react": "^18.3.1",
57
57
  "react-dom": "^18.3.1",
@@ -135,22 +135,15 @@ export interface INotifierReact
135
135
  /**
136
136
  * Create state provider
137
137
  * @param className Style class name
138
- * @param optionGenerator Options generator
138
+ * @param debug Is debug mode
139
139
  * @returns Provider
140
140
  */
141
141
  createProvider(
142
142
  className?: string,
143
- optionGenerator?: INotifierOptions
143
+ debug?: boolean
144
144
  ): React.FunctionComponent<NotificationReactRenderProps>;
145
145
  }
146
146
 
147
- /**
148
- * Notifier options generator
149
- */
150
- export interface INotifierOptions {
151
- (): any;
152
- }
153
-
154
147
  /**
155
148
  * Notifier for React
156
149
  */
@@ -181,6 +174,16 @@ export abstract class NotifierReact
181
174
  */
182
175
  protected constructor() {
183
176
  super((notification, dismiss) => {
177
+ // Debug
178
+ if (this.debug) {
179
+ console.debug(
180
+ 'NotifierReact.updateCallback',
181
+ notification,
182
+ dismiss,
183
+ this.loadingCount
184
+ );
185
+ }
186
+
184
187
  // Make sure the state update is set
185
188
  if (this.stateUpdate) this.stateUpdate({ notification, dismiss });
186
189
  });
@@ -207,7 +210,7 @@ export abstract class NotifierReact
207
210
  * @param className Style class name
208
211
  * @returns Provider
209
212
  */
210
- createProvider(className?: string) {
213
+ createProvider(className?: string, debug?: boolean) {
211
214
  // Custom creator
212
215
  const creator = (
213
216
  state: ReactNotifications,
@@ -217,15 +220,6 @@ export abstract class NotifierReact
217
220
  // Hold the current state update
218
221
  this.stateUpdate = update;
219
222
 
220
- // Debug
221
- if (this.debug) {
222
- console.debug(
223
- 'NotifierReact.createProvider.render',
224
- state,
225
- props
226
- );
227
- }
228
-
229
223
  // Aligns collection
230
224
  const aligns: React.ReactNode[] = [];
231
225
  for (const align in state) {
@@ -244,6 +238,16 @@ export abstract class NotifierReact
244
238
  aligns.push(this.createContainer(Number(align), ui));
245
239
  }
246
240
 
241
+ // Debug
242
+ if (debug) {
243
+ console.debug(
244
+ 'NotifierReact.createProvider',
245
+ className,
246
+ state,
247
+ aligns
248
+ );
249
+ }
250
+
247
251
  // Generate the component
248
252
  return React.createElement('div', { className }, aligns);
249
253
  };