@applicaster/quick-brick-core 14.0.0-alpha.1308901965 → 14.0.0-alpha.1322105203

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.
@@ -12,7 +12,6 @@ const debugActions = (actions) =>
12
12
  message: `useSubscribeToActionProviders - available actions count: ${
13
13
  Object.keys(actions).length
14
14
  }`,
15
- data: { actions },
16
15
  });
17
16
 
18
17
  const warnUndefinedContext = (context) =>
@@ -60,6 +60,10 @@ export class ErrorBoundary extends React.Component<Props> {
60
60
  useErrorStore.getState().setError(error, info, recoverable);
61
61
  }
62
62
 
63
+ static getDerivedStateFromError(_error) {
64
+ return { hasError: true };
65
+ }
66
+
63
67
  render() {
64
68
  return <ErrorBoundaryContent>{this.props.children}</ErrorBoundaryContent>;
65
69
  }
@@ -47,7 +47,7 @@ const getSheetHeight = ({ height, bottomOffset, maxHeight }) => {
47
47
  ios: height - bottomOffset,
48
48
  default:
49
49
  (height || maxHeight) -
50
- (!isAndroidVersionAtLeast(35) && isAndroidPlatform() ? bottomOffset : 0),
50
+ (isAndroidPlatform() && !isAndroidVersionAtLeast(35) ? bottomOffset : 0),
51
51
  });
52
52
  };
53
53
 
@@ -429,18 +429,34 @@ export default function navigationReducer(
429
429
  case ACTIONS.REPLACE:
430
430
  case ACTIONS.REPLACE_TOP:
431
431
  case ACTIONS.BACK:
432
- case ACTIONS.BACK_PLAYER_NESTED_CONTENT:
433
- return R.evolve(
434
- {
435
- stack: applyReducer(navigationStackReducer, { type, payload }),
436
- location: applyReducer(locationReducer, {
437
- type,
438
- payload,
439
- meta: state,
440
- }),
441
- },
442
- state
443
- );
432
+ // eslint-disable-next-line
433
+ case ACTIONS.BACK_PLAYER_NESTED_CONTENT: {
434
+ // TODO: Check this solution with Pawel, does not work without it on tvs
435
+ const screenStateStore: UseBoundStore<StoreApi<ScreenStateStore>> =
436
+ create<ScreenStateStore>((set) => ({
437
+ data: {},
438
+ setValue: (key, value) =>
439
+ set((s) => ({ data: { ...s.data, [key]: value } })),
440
+ removeValue: (key) =>
441
+ set((s) => {
442
+ const data = { ...s.data };
443
+ delete data[key];
444
+
445
+ return { data };
446
+ }),
447
+ }));
448
+
449
+ const actionWithStore = {
450
+ type,
451
+ payload: { ...payload, screenStateStore },
452
+ meta: state,
453
+ };
454
+
455
+ const stack = applyReducer(navigationStackReducer, actionWithStore);
456
+ const location = applyReducer(locationReducer, actionWithStore);
457
+
458
+ return R.evolve({ stack, location }, state);
459
+ }
444
460
 
445
461
  case ACTIONS.SET_NESTED_CONTENT:
446
462
  return R.evolve(
@@ -42,9 +42,12 @@ jest.mock("../AppStateDecorator", () => ({
42
42
  withAppManager: (Comp) => Comp,
43
43
  }));
44
44
 
45
- jest.mock("@applicaster/zapp-react-native-utils/reactHooks", () => ({
46
- useDimensions: jest.fn(() => ({ width: 375, height: 800 })),
47
- }));
45
+ jest.mock(
46
+ "@applicaster/zapp-react-native-utils/reactHooks/layout/useDimensions",
47
+ () => ({
48
+ useDimensions: jest.fn(() => ({ width: 375, height: 800 })),
49
+ })
50
+ );
48
51
 
49
52
  jest.mock("react-native", () => {
50
53
  const RNMock = jest.genMockFromModule("react-native");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "14.0.0-alpha.1308901965",
3
+ "version": "14.0.0-alpha.1322105203",
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.1308901965",
32
- "@applicaster/quick-brick-core-plugins": "14.0.0-alpha.1308901965",
33
- "@applicaster/zapp-pipes-v2-client": "14.0.0-alpha.1308901965",
34
- "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.1308901965",
35
- "@applicaster/zapp-react-native-redux": "14.0.0-alpha.1308901965",
36
- "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1308901965",
37
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.1308901965",
31
+ "@applicaster/applicaster-types": "14.0.0-alpha.1322105203",
32
+ "@applicaster/quick-brick-core-plugins": "14.0.0-alpha.1322105203",
33
+ "@applicaster/zapp-pipes-v2-client": "14.0.0-alpha.1322105203",
34
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.1322105203",
35
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.1322105203",
36
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1322105203",
37
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.1322105203",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",
@@ -60,19 +60,12 @@
60
60
  "react": "*",
61
61
  "react-native": "*",
62
62
  "react-native-fs": "*",
63
- "react-native-gesture-handler": "*",
64
63
  "react-native-linear-gradient": "*",
65
64
  "react-native-safe-area-context": "*",
66
65
  "react-native-svg": "*",
67
- "react-native-web": "*",
68
66
  "react-native-webview": "*",
69
67
  "uglify-js": "*",
70
68
  "validate-color": "*",
71
69
  "zustand": "*"
72
- },
73
- "devDependencies": {
74
- "nock": "^10.0.0",
75
- "redux-mock-store": "^1.5.3"
76
- },
77
- "gitHead": "a473487564142c55cdb50f02505cf0b60fe75658"
70
+ }
78
71
  }
@@ -19,7 +19,7 @@
19
19
  * @param {React.ComponentType<any>} App component to start
20
20
  */
21
21
  export function renderZappApp(options) {
22
- const { App, AppRegistry, appMountId } = options;
22
+ const { App, AppRegistry, appMountId, mode } = options;
23
23
 
24
24
  if (!App) {
25
25
  throw new Error("No App Component provided, nothing to render");
@@ -37,6 +37,7 @@ export function renderZappApp(options) {
37
37
  if (appMountId) {
38
38
  AppRegistry.runApplication("QuickBrickApp", {
39
39
  rootTag: document.getElementById(appMountId),
40
+ mode,
40
41
  });
41
42
  }
42
43
  }