@applicaster/zapp-react-native-utils 16.0.0-rc.61 → 16.0.0-rc.63

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.
@@ -17,10 +17,6 @@ jest.mock("../../../modalState/ModalOrchestrator", () => ({
17
17
  }));
18
18
 
19
19
  describe("openBottomSheetAction inline items", () => {
20
- const HeaderComponent = function HeaderComponent() {
21
- return null;
22
- };
23
-
24
20
  beforeEach(() => {
25
21
  jest.clearAllMocks();
26
22
  (modalOrchestrator as any).stackSize = 0;
@@ -101,30 +97,4 @@ describe("openBottomSheetAction inline items", () => {
101
97
  expect(modalOrchestrator.replace).toHaveBeenCalledTimes(1);
102
98
  expect(modalOrchestrator.open).not.toHaveBeenCalled();
103
99
  });
104
-
105
- it("forwards a custom header component and its props onto the menu", async () => {
106
- await openBottomSheetAction({
107
- type: "openBottomSheet",
108
- options: {
109
- header: {
110
- title: "Sleep Timer",
111
- component: HeaderComponent,
112
- componentProps: { timerDate: 123 },
113
- },
114
- content: {
115
- items: [{ id: "5", title: "5 minutes" }],
116
- },
117
- },
118
- } as any);
119
-
120
- const [menu] = (modalOrchestrator.open as jest.Mock).mock.calls[0];
121
-
122
- expect(menu.header).toEqual({
123
- title: "Sleep Timer",
124
- subtitle: undefined,
125
- icon: undefined,
126
- component: HeaderComponent,
127
- componentProps: { timerDate: 123 },
128
- });
129
- });
130
100
  });
@@ -264,8 +264,6 @@ export async function openBottomSheetAction(
264
264
  title: header.title,
265
265
  subtitle: header.subtitle,
266
266
  icon: header.icon,
267
- component: header.component,
268
- componentProps: header.componentProps,
269
267
  }
270
268
  : undefined,
271
269
  content: {
@@ -0,0 +1 @@
1
+ export const getUpcomingQueue = async (): Promise<unknown[] | null> => null;
@@ -0,0 +1 @@
1
+ export const getUpcomingQueue = async (): Promise<unknown[] | null> => null;
@@ -0,0 +1,5 @@
1
+ export const getUpcomingQueue = async () => {
2
+ const { QueueManager } = require("@applicaster/queue-action/src/Manager");
3
+
4
+ return QueueManager.instance.getUpcomingQueue();
5
+ };
@@ -0,0 +1 @@
1
+ export const getUpcomingQueue = async (): Promise<unknown[] | null> => null;
@@ -8,6 +8,7 @@ import { log_error, log_info } from "./OverlaysObserver";
8
8
  import { toNumber, toNumberWithDefault } from "../../../numberUtils";
9
9
 
10
10
  import { findPluginByIdentifier } from "../../../pluginUtils";
11
+ import { getUpcomingQueue } from "./getUpcomingQueue";
11
12
 
12
13
  export const parseTimeToSeconds = (timeStr: string): number => {
13
14
  const validationError = new Error("Invalid time format");
@@ -69,8 +70,7 @@ export const retrieveFeedUrl = async (
69
70
 
70
71
  if (queuePlugin) {
71
72
  try {
72
- const { QueueManager } = require("@applicaster/queue-action/src/Manager");
73
- const upcomingQueue = await QueueManager.instance.getUpcomingQueue();
73
+ const upcomingQueue = await getUpcomingQueue();
74
74
 
75
75
  if (upcomingQueue && upcomingQueue.length > 0) {
76
76
  const queueItemId = entry?.extensions?.queueItemId || entry?.id;
@@ -37,8 +37,6 @@ function menuToModalArgs(
37
37
  itemsUrl: menu.content.itemsUrl,
38
38
  title: menu.header?.title ?? menu.content.title,
39
39
  summary: menu.header?.subtitle,
40
- headerComponent: menu.header?.component,
41
- headerComponentProps: menu.header?.componentProps,
42
40
  styleOverrides: menu.content.styleOverrides,
43
41
  onPress: onItemPress,
44
42
  viewModel,
@@ -26,17 +26,11 @@ describe("ModalOrchestrator phase 3", () => {
26
26
  expect(props.title).toBe("Playlists");
27
27
  });
28
28
 
29
- it("forwards header.component as headerComponent", () => {
30
- const HeaderComponent = function HeaderComponent() {
31
- return null;
32
- };
33
-
29
+ it("forwards header title and subtitle as summary", () => {
34
30
  modalOrchestrator.open({
35
31
  header: {
36
32
  title: "Sleep Timer",
37
33
  subtitle: "remaining",
38
- component: HeaderComponent,
39
- componentProps: { timerDate: 123 },
40
34
  },
41
35
  content: {
42
36
  title: "Sleep Timer",
@@ -47,8 +41,6 @@ describe("ModalOrchestrator phase 3", () => {
47
41
  const props = (modalStore.getState().modalState.screen as any)
48
42
  ?.modalBottomSheetContentProps;
49
43
 
50
- expect(props.headerComponent).toBe(HeaderComponent);
51
- expect(props.headerComponentProps).toEqual({ timerDate: 123 });
52
44
  expect(props.title).toBe("Sleep Timer");
53
45
  expect(props.summary).toBe("remaining");
54
46
  });
@@ -1,11 +1,7 @@
1
- import type { ComponentType } from "react";
2
-
3
1
  export interface Header {
4
2
  title: string;
5
3
  subtitle?: string;
6
4
  icon?: string;
7
- component?: ComponentType<any>;
8
- componentProps?: Record<string, any>;
9
5
  }
10
6
 
11
7
  export interface Action {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "16.0.0-rc.61",
3
+ "version": "16.0.0-rc.63",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "16.0.0-rc.61",
30
+ "@applicaster/applicaster-types": "16.0.0-rc.63",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",