@applicaster/quick-brick-core 14.0.0-alpha.2847632144 → 14.0.0-alpha.3126393935

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.
@@ -44,6 +44,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
44
44
  "supports_offline": false,
45
45
  "type": "general_content",
46
46
  },
47
+ "screenStateStore": [Function],
47
48
  },
48
49
  },
49
50
  "options": {
@@ -79,6 +80,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
79
80
  "supports_offline": false,
80
81
  "type": "general_content",
81
82
  },
83
+ "screenStateStore": undefined,
82
84
  },
83
85
  },
84
86
  ],
@@ -114,6 +116,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
114
116
  "supports_offline": false,
115
117
  "type": "general_content",
116
118
  },
119
+ "screenStateStore": [Function],
117
120
  },
118
121
  },
119
122
  "options": {
@@ -149,6 +152,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
149
152
  "supports_offline": false,
150
153
  "type": "general_content",
151
154
  },
155
+ "screenStateStore": undefined,
152
156
  },
153
157
  },
154
158
  {
@@ -180,6 +184,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
180
184
  "supports_offline": false,
181
185
  "type": "general_content",
182
186
  },
187
+ "screenStateStore": undefined,
183
188
  },
184
189
  },
185
190
  ],
@@ -215,6 +220,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
215
220
  "supports_offline": false,
216
221
  "type": "general_content",
217
222
  },
223
+ "screenStateStore": [Function],
218
224
  },
219
225
  },
220
226
  "options": {
@@ -250,6 +256,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
250
256
  "supports_offline": false,
251
257
  "type": "general_content",
252
258
  },
259
+ "screenStateStore": undefined,
253
260
  },
254
261
  },
255
262
  {
@@ -281,6 +288,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
281
288
  "supports_offline": false,
282
289
  "type": "general_content",
283
290
  },
291
+ "screenStateStore": undefined,
284
292
  },
285
293
  },
286
294
  {
@@ -312,6 +320,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
312
320
  "supports_offline": false,
313
321
  "type": "general_content",
314
322
  },
323
+ "screenStateStore": undefined,
315
324
  },
316
325
  },
317
326
  ],
@@ -348,6 +357,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
348
357
  "supports_offline": false,
349
358
  "type": "general_content",
350
359
  },
360
+ "screenStateStore": undefined,
351
361
  },
352
362
  },
353
363
  "options": {
@@ -383,6 +393,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
383
393
  "supports_offline": false,
384
394
  "type": "general_content",
385
395
  },
396
+ "screenStateStore": undefined,
386
397
  },
387
398
  },
388
399
  {
@@ -414,6 +425,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
414
425
  "supports_offline": false,
415
426
  "type": "general_content",
416
427
  },
428
+ "screenStateStore": undefined,
417
429
  },
418
430
  },
419
431
  ],
@@ -449,6 +461,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
449
461
  "supports_offline": false,
450
462
  "type": "general_content",
451
463
  },
464
+ "screenStateStore": [Function],
452
465
  },
453
466
  },
454
467
  "options": {
@@ -484,6 +497,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
484
497
  "supports_offline": false,
485
498
  "type": "general_content",
486
499
  },
500
+ "screenStateStore": undefined,
487
501
  },
488
502
  },
489
503
  {
@@ -515,6 +529,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
515
529
  "supports_offline": false,
516
530
  "type": "general_content",
517
531
  },
532
+ "screenStateStore": undefined,
518
533
  },
519
534
  },
520
535
  {
@@ -546,6 +561,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
546
561
  "supports_offline": false,
547
562
  "type": "general_content",
548
563
  },
564
+ "screenStateStore": undefined,
549
565
  },
550
566
  },
551
567
  ],
@@ -582,6 +598,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
582
598
  "supports_offline": false,
583
599
  "type": "general_content",
584
600
  },
601
+ "screenStateStore": undefined,
585
602
  },
586
603
  },
587
604
  "options": {
@@ -617,6 +634,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
617
634
  "supports_offline": false,
618
635
  "type": "general_content",
619
636
  },
637
+ "screenStateStore": undefined,
620
638
  },
621
639
  },
622
640
  {
@@ -648,6 +666,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
648
666
  "supports_offline": false,
649
667
  "type": "general_content",
650
668
  },
669
+ "screenStateStore": undefined,
651
670
  },
652
671
  },
653
672
  ],
@@ -5,6 +5,7 @@ import {
5
5
  firstStackEntriesSelector,
6
6
  previousStackEntriesSelector,
7
7
  } from "./selectors";
8
+ import { create, StoreApi, UseBoundStore } from "zustand";
8
9
 
9
10
  /* initial state */
10
11
 
@@ -120,12 +121,12 @@ export const setNestedContent = (
120
121
 
121
122
  const navigationEntry = (
122
123
  type: ActionValues,
123
- { route, screen, entry, key, options }: AnyRecord
124
+ { route, screen, entry, key, options, screenStateStore }: AnyRecord
124
125
  ) => ({
125
126
  key,
126
127
  action: type,
127
128
  route,
128
- state: { screen, entry, options },
129
+ state: { screen, entry, options, screenStateStore },
129
130
  });
130
131
 
131
132
  function updatePopActions(state) {
@@ -274,6 +275,25 @@ function locationReducer(
274
275
  ) {
275
276
  const { route, key, screen, entry, options } = payload;
276
277
 
278
+ const screenStateStore: UseBoundStore<StoreApi<ScreenStateStore>> =
279
+ create<ScreenStateStore>((set) => ({
280
+ data: {},
281
+ setValue: (key, value) =>
282
+ set((state) => ({
283
+ data: {
284
+ ...state.data,
285
+ [key]: value,
286
+ },
287
+ })),
288
+ removeValue: (key) =>
289
+ set((state) => {
290
+ const newData = { ...state.data };
291
+ delete newData[key];
292
+
293
+ return { data: newData };
294
+ }),
295
+ }));
296
+
277
297
  switch (type) {
278
298
  case ACTIONS.BACK:
279
299
  // eslint-disable-next-line no-case-declarations
@@ -294,14 +314,18 @@ function locationReducer(
294
314
  case ACTIONS.REPLACE:
295
315
  case ACTIONS.REPLACE_TOP:
296
316
  case ACTIONS.BACK_PLAYER_NESTED_CONTENT:
297
- return { pathname: route, state: { screen, entry, options }, key };
317
+ return {
318
+ pathname: route,
319
+ state: { screen, entry, options, screenStateStore },
320
+ key,
321
+ };
298
322
 
299
323
  case ACTIONS.SET_NESTED_CONTENT:
300
324
  // eslint-disable-next-line no-case-declarations
301
- const nestedEntry = navigationEntry(
302
- ACTIONS.REPLACE,
303
- payload as AnyRecord
304
- );
325
+ const nestedEntry = navigationEntry(ACTIONS.REPLACE, {
326
+ ...payload,
327
+ screenStateStore,
328
+ } as AnyRecord);
305
329
 
306
330
  return R.assocPath(["state", "nested"], nestedEntry.state, state);
307
331
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "14.0.0-alpha.2847632144",
3
+ "version": "14.0.0-alpha.3126393935",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "14.0.0-alpha.2847632144",
32
- "@applicaster/quick-brick-core-plugins": "14.0.0-alpha.2847632144",
33
- "@applicaster/zapp-pipes-v2-client": "14.0.0-alpha.2847632144",
34
- "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.2847632144",
35
- "@applicaster/zapp-react-native-redux": "14.0.0-alpha.2847632144",
36
- "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.2847632144",
37
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.2847632144",
31
+ "@applicaster/applicaster-types": "14.0.0-alpha.3126393935",
32
+ "@applicaster/quick-brick-core-plugins": "14.0.0-alpha.3126393935",
33
+ "@applicaster/zapp-pipes-v2-client": "14.0.0-alpha.3126393935",
34
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.3126393935",
35
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.3126393935",
36
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.3126393935",
37
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.3126393935",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",