@applicaster/quick-brick-core 15.1.15-rc.0 → 15.1.16-alpha.1335343245

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.
@@ -246,6 +246,10 @@ export function NavigationProvider({ children }: Props) {
246
246
  playNextOverlayState.current = state;
247
247
  };
248
248
 
249
+ // The play-next overlay owns remote focus while it is visible, so key
250
+ // handling (InteractionManager) needs to be able to ask for it.
251
+ const getPlayNextOverlay = () => playNextOverlayState.current ?? null;
252
+
249
253
  const setNestedScreenContent = (entry: ZappEntry, screenId: string) => {
250
254
  const screen = rivers[screenId];
251
255
  const parent = findParent(context, navigator.currentRoute);
@@ -352,10 +356,7 @@ export function NavigationProvider({ children }: Props) {
352
356
  state: firstRoute.state,
353
357
  };
354
358
 
355
- if (
356
- stateForBack?.state?.entry &&
357
- "home" in stateForBack?.state?.entry
358
- ) {
359
+ if (stateForBack?.state?.entry?.home) {
359
360
  goHome();
360
361
  } else {
361
362
  dispatch(back(stateForBack));
@@ -790,6 +791,7 @@ export function NavigationProvider({ children }: Props) {
790
791
  replace: replaceItem,
791
792
  setNestedScreenContent,
792
793
  setPlayNextOverlay,
794
+ getPlayNextOverlay,
793
795
  goHome,
794
796
  canGoBack,
795
797
  goBack,
@@ -423,6 +423,60 @@ describe("<NavigationProvider />", () => {
423
423
  });
424
424
  });
425
425
 
426
+ describe("when backToTop is requested from a non-home tab", () => {
427
+ const listenRiver = {
428
+ id: "LISTEN",
429
+ home: false,
430
+ navigations: [],
431
+ ui_components: [],
432
+ hooks: {
433
+ preload_plugins: [],
434
+ postload_plugins: [],
435
+ },
436
+ };
437
+
438
+ beforeEach(() => {
439
+ rivers.LISTEN = listenRiver;
440
+
441
+ act(() => {
442
+ wrapper = renderContextConsumer();
443
+ });
444
+
445
+ act(() => {
446
+ getByTestId(wrapper, "WrapperView").props.navigator.replace(
447
+ listenRiver
448
+ );
449
+ });
450
+ });
451
+
452
+ afterEach(() => {
453
+ delete rivers.LISTEN;
454
+ });
455
+
456
+ it("returns to the tab root from the second level", () => {
457
+ const view = getByTestId(wrapper, "WrapperView");
458
+
459
+ act(() => view.props.navigator.push(rivers.A1234));
460
+ act(() => view.props.navigator.goBack(false, false, true));
461
+
462
+ expect(view.props.navigator.currentRoute).toEqual("/river/LISTEN");
463
+ expect(view.props.navigator.activeRiver).toEqual(listenRiver);
464
+ expect(view.props.state.stack.mainStack).toHaveLength(1);
465
+ });
466
+
467
+ it("returns to the tab root from the third level", () => {
468
+ const view = getByTestId(wrapper, "WrapperView");
469
+
470
+ act(() => view.props.navigator.push(rivers.A1234));
471
+ act(() => view.props.navigator.push(rivers.C0987));
472
+ act(() => view.props.navigator.goBack(false, false, true));
473
+
474
+ expect(view.props.navigator.currentRoute).toEqual("/river/LISTEN");
475
+ expect(view.props.navigator.activeRiver).toEqual(listenRiver);
476
+ expect(view.props.state.stack.mainStack).toHaveLength(1);
477
+ });
478
+ });
479
+
426
480
  describe("when there is a previous route and there are hooks", () => {
427
481
  act(() => {
428
482
  wrapper = renderContextConsumer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "15.1.15-rc.0",
3
+ "version": "15.1.16-alpha.1335343245",
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": "15.1.15-rc.0",
32
- "@applicaster/quick-brick-core-plugins": "15.1.15-rc.0",
33
- "@applicaster/zapp-pipes-v2-client": "15.1.15-rc.0",
34
- "@applicaster/zapp-react-native-bridge": "15.1.15-rc.0",
35
- "@applicaster/zapp-react-native-redux": "15.1.15-rc.0",
36
- "@applicaster/zapp-react-native-ui-components": "15.1.15-rc.0",
37
- "@applicaster/zapp-react-native-utils": "15.1.15-rc.0",
31
+ "@applicaster/applicaster-types": "15.1.16-alpha.1335343245",
32
+ "@applicaster/quick-brick-core-plugins": "15.1.16-alpha.1335343245",
33
+ "@applicaster/zapp-pipes-v2-client": "15.1.16-alpha.1335343245",
34
+ "@applicaster/zapp-react-native-bridge": "15.1.16-alpha.1335343245",
35
+ "@applicaster/zapp-react-native-redux": "15.1.16-alpha.1335343245",
36
+ "@applicaster/zapp-react-native-ui-components": "15.1.16-alpha.1335343245",
37
+ "@applicaster/zapp-react-native-utils": "15.1.16-alpha.1335343245",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",