@applicaster/zapp-react-native-utils 16.0.0-rc.56 → 16.0.0-rc.58

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.
Files changed (42) hide show
  1. package/actionsExecutor/ActionExecutor.ts +40 -2
  2. package/actionsExecutor/ActionExecutorContext.tsx +70 -16
  3. package/actionsExecutor/actions/__tests__/dismissBottomSheet.test.ts +22 -0
  4. package/actionsExecutor/actions/__tests__/loadItemsFromSource.test.ts +88 -0
  5. package/actionsExecutor/actions/__tests__/openBottomSheet.customContent.test.ts +76 -0
  6. package/actionsExecutor/actions/__tests__/openBottomSheet.inlineItems.test.ts +130 -0
  7. package/actionsExecutor/actions/dismissBottomSheet.ts +22 -0
  8. package/actionsExecutor/actions/index.ts +4 -0
  9. package/actionsExecutor/actions/openBottomSheet.ts +322 -0
  10. package/actionsExecutor/actions/refreshComponent.ts +6 -0
  11. package/actionsExecutor/actions/sendCloudEvent.ts +6 -1
  12. package/actionsExecutor/consts.ts +23 -0
  13. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +5 -2
  14. package/appUtils/playerManager/OverlayObserver/utils.ts +46 -20
  15. package/arrayUtils/__tests__/reorderByIds.test.ts +50 -0
  16. package/arrayUtils/index.ts +79 -0
  17. package/configurationUtils/__tests__/modalBlocksParser.test.ts +107 -0
  18. package/configurationUtils/manifestKeyParser.ts +38 -9
  19. package/configurationUtils/modalBlocksParser.ts +178 -0
  20. package/manifestUtils/index.js +3 -0
  21. package/manifestUtils/modalBlocks.js +304 -0
  22. package/modalState/ContentViewModel.ts +113 -0
  23. package/modalState/EditableCollection.ts +17 -0
  24. package/modalState/EditableCollectionRegistry.ts +51 -0
  25. package/modalState/ModalOrchestrator.ts +201 -0
  26. package/modalState/RemoteEditableCollection.ts +227 -0
  27. package/modalState/__tests__/ContentViewModel.editable.test.ts +69 -0
  28. package/modalState/__tests__/ContentViewModel.test.ts +165 -0
  29. package/modalState/__tests__/EditableCollectionRegistry.test.ts +112 -0
  30. package/modalState/__tests__/ModalOrchestrator.phase3.test.ts +55 -0
  31. package/modalState/__tests__/RemoteEditableCollection.test.ts +326 -0
  32. package/modalState/__tests__/useBottomSheetContent.test.ts +349 -0
  33. package/modalState/index.ts +30 -83
  34. package/modalState/store.ts +102 -0
  35. package/modalState/types.ts +137 -0
  36. package/modalState/useBottomSheetContent.ts +102 -0
  37. package/package.json +2 -2
  38. package/reactHooks/index.ts +2 -0
  39. package/reactHooks/usePluginConfiguration.ts +4 -1
  40. package/reactHooks/utils/__tests__/index.test.js +22 -2
  41. package/reactHooks/utils/index.ts +11 -1
  42. /package/reactHooks/actions/__tests__/{index.test.js → index.test.tsx} +0 -0
@@ -0,0 +1,107 @@
1
+ import { parseModalBlocksConfiguration } from "../modalBlocksParser";
2
+
3
+ // Mock the platform selection logic so it's consistent
4
+ jest.mock("../../reactUtils", () => ({
5
+ platformSelect: jest.fn().mockReturnValue("ios"),
6
+ }));
7
+
8
+ describe("parseModalBlocksConfiguration", () => {
9
+ beforeEach(() => {
10
+ jest.clearAllMocks();
11
+ });
12
+
13
+ it("should return empty structures for missing config or componentName", () => {
14
+ const result1 = parseModalBlocksConfiguration(
15
+ undefined as any,
16
+ "queue_action"
17
+ );
18
+
19
+ expect(result1.header.container).toEqual({});
20
+
21
+ const result2 = parseModalBlocksConfiguration({ foo: "bar" }, "");
22
+ expect(result2.item.background).toEqual({});
23
+ });
24
+
25
+ it("should correctly parse the specified flat keys into nested objects", () => {
26
+ // The keys follow: <component_name>_style_<blockName>_<subComponent>_[platform_][state_]<styleName>
27
+ const config = {
28
+ // Header container - default platform, default state
29
+ queue_action_style_header_container_backgroundColor: "#000000",
30
+
31
+ // Header title - default platform, pressed state
32
+ queue_action_style_header_title_pressed_fontColor: "#ffffff",
33
+
34
+ // Item background - ios platform, default state
35
+ queue_action_style_item_background_ios_backgroundColor: "blue",
36
+
37
+ // Item textLabel1 - default platform, focused state
38
+ queue_action_style_item_text_label_1_focused_fontSize: 16,
39
+
40
+ // Ignored key (unrelated to building blocks or queue_action)
41
+ other_action_style_header_title_fontColor: "red",
42
+ some_random_key: "value",
43
+
44
+ // Ignored non-style data keys (should NEVER be parsed as styles)
45
+ item_data_source: "http://pipes.example.com",
46
+ item_url: "http://example.com",
47
+
48
+ // New dot notation from manifest-generator (without plugin prefix)
49
+ "item.text_label_2.fontColor": "green",
50
+ "action.background.pressed_backgroundColor": "black",
51
+
52
+ // New now_playing_item block
53
+ "now_playing_item.text_label_1.fontColor": "yellow",
54
+ "now_playing_item.now_playing_asset.asset": "equalizer.png",
55
+ };
56
+
57
+ const componentName = "queue_action";
58
+
59
+ const result = parseModalBlocksConfiguration(config, componentName);
60
+
61
+ // Assert header container default state
62
+ expect(result.header.container.default).toEqual({
63
+ backgroundColor: "#000000",
64
+ });
65
+
66
+ // Assert header title pressed state
67
+ // (pressed state will inherit default styles in getAllSpecificStyles if any,
68
+ // but here we just have pressed, so it has default empty from the parser)
69
+ expect(result.header.title.pressed).toEqual({
70
+ fontColor: "#ffffff",
71
+ });
72
+
73
+ // Assert item background ios default state
74
+ // (mocked platform is ios, so it should be accepted and assigned to default)
75
+ expect(result.item.background.default).toEqual({
76
+ backgroundColor: "blue",
77
+ });
78
+
79
+ // Assert item textLabel1 focused state
80
+ expect(result.item.textLabel1.focused).toEqual({
81
+ fontSize: 16,
82
+ });
83
+
84
+ // Assert dot notation textLabel2 default state
85
+ expect(result.item.textLabel2.default).toEqual({
86
+ fontColor: "green",
87
+ });
88
+
89
+ // Assert dot notation action background pressed state
90
+ expect(result.action.background.pressed).toEqual({
91
+ backgroundColor: "black",
92
+ });
93
+
94
+ // Assert nowPlayingItem states
95
+ expect(result.nowPlayingItem?.textLabel1.default).toEqual({
96
+ fontColor: "yellow",
97
+ });
98
+
99
+ expect(result.nowPlayingItem?.nowPlayingAsset.default).toEqual({
100
+ asset: "equalizer.png",
101
+ });
102
+
103
+ // Assert untouched properties remain empty default style objects
104
+ expect(result.button.title).toEqual({ default: {} });
105
+ expect(result.action.leadingIcon).toEqual({ default: {} });
106
+ });
107
+ });
@@ -12,16 +12,23 @@ const currentPlatform = platformSelect({
12
12
  });
13
13
 
14
14
  // Do not change the order, focused_selected should be first
15
- const states = ["focused_selected", "pressed", "focused", "selected"];
15
+ const states = [
16
+ "focused_selected",
17
+ "pressed",
18
+ "focused",
19
+ "selected",
20
+ "default",
21
+ ];
16
22
 
17
23
  const platformSuffixes = ["ios", "tvos", "samsung", "lg", "android"];
18
- type StateKey = (typeof states)[number] | "default";
24
+ type StateKey = (typeof states)[number];
19
25
 
20
26
  export type GetAllSpecificStylesProps = {
21
27
  componentName: string;
22
28
  subComponentName: string;
23
29
  configuration: Record<string, any>;
24
30
  outStyles: Record<string, any>;
31
+ styleSeparator?: string;
25
32
  };
26
33
 
27
34
  /*
@@ -35,14 +42,23 @@ export const getAllSpecificStyles = ({
35
42
  componentName,
36
43
  subComponentName,
37
44
  outStyles,
45
+ styleSeparator = "_style_",
38
46
  }: GetAllSpecificStylesProps) => {
39
47
  if (!outStyles) throw new Error("outStyles is required");
40
48
  if (!componentName) throw new Error("componentName is required");
41
49
 
42
- const prefix =
50
+ const prefixes =
43
51
  subComponentName?.length > 0
44
- ? `${componentName}_style_${subComponentName}_`
45
- : `${componentName}_style_`;
52
+ ? [
53
+ styleSeparator
54
+ ? `${componentName}${styleSeparator}${subComponentName}_`
55
+ : `${subComponentName}_`,
56
+ `${componentName}_style_${subComponentName}_`,
57
+ ]
58
+ : [
59
+ styleSeparator ? `${componentName}${styleSeparator}` : "",
60
+ `${componentName}_style_`,
61
+ ];
46
62
 
47
63
  const defaultKey = "default";
48
64
 
@@ -51,12 +67,24 @@ export const getAllSpecificStyles = ({
51
67
  const tmpGenericDict: Record<StateKey, Record<string, any>> = {};
52
68
  const tmpPlatformDict: Record<StateKey, Record<string, any>> = {};
53
69
 
54
- const parseKey = (key: string, value: any) => {
55
- if (!key.startsWith(prefix)) {
70
+ const parseKey = (key: string, originalKey: string, value: any) => {
71
+ const matchedPrefix = prefixes.find((p) => p && key.startsWith(p));
72
+
73
+ if (!matchedPrefix) {
56
74
  return;
57
75
  }
58
76
 
59
- let styleName = key.slice(prefix.length);
77
+ // Guard: for empty styleSeparator, if matching modern prefix, require dot in originalKey
78
+ if (
79
+ styleSeparator === "" &&
80
+ matchedPrefix === `${subComponentName}_` &&
81
+ !originalKey.includes(".")
82
+ ) {
83
+ return;
84
+ }
85
+
86
+ let styleName = key.slice(matchedPrefix.length);
87
+
60
88
  if (!styleName || styleName.startsWith("_")) return;
61
89
 
62
90
  const platform = platformSuffixes.find((prefix) =>
@@ -93,7 +121,8 @@ export const getAllSpecificStyles = ({
93
121
  };
94
122
 
95
123
  for (const [key, value] of Object.entries(configuration)) {
96
- parseKey(key, value);
124
+ const formattedKey = key.replace(/\./g, "_");
125
+ parseKey(formattedKey, key, value);
97
126
  }
98
127
 
99
128
  const allStates = Array.from(
@@ -0,0 +1,178 @@
1
+ import { getAllSpecificStyles } from "./manifestKeyParser";
2
+
3
+ export type ModalBlocksConfig = {
4
+ header: {
5
+ container: Record<string, any>;
6
+ title: Record<string, any>;
7
+ closeButton: Record<string, any>;
8
+ actionButtons: Record<string, any>;
9
+ };
10
+ action: {
11
+ background: Record<string, any>;
12
+ title: Record<string, any>;
13
+ icons: Record<string, any>;
14
+ leadingIcon: Record<string, any>;
15
+ trailingIcon: Record<string, any>;
16
+ };
17
+ item: {
18
+ background: Record<string, any>;
19
+ image: Record<string, any>;
20
+ nowPlayingContainer: Record<string, any>;
21
+ nowPlayingAsset: Record<string, any>;
22
+ nowPlayingLabel: Record<string, any>;
23
+ textLabel1: Record<string, any>;
24
+ textLabel2: Record<string, any>;
25
+ buttonsContainer: Record<string, any>;
26
+ button1: Record<string, any>;
27
+ button2: Record<string, any>;
28
+ };
29
+ nowPlayingItem?: {
30
+ background: Record<string, any>;
31
+ image: Record<string, any>;
32
+ nowPlayingContainer: Record<string, any>;
33
+ nowPlayingAsset: Record<string, any>;
34
+ nowPlayingLabel: Record<string, any>;
35
+ textLabel1: Record<string, any>;
36
+ textLabel2: Record<string, any>;
37
+ buttonsContainer: Record<string, any>;
38
+ button1: Record<string, any>;
39
+ button2: Record<string, any>;
40
+ };
41
+ button: {
42
+ background: Record<string, any>;
43
+ title: Record<string, any>;
44
+ icons: Record<string, any>;
45
+ leadingIcon: Record<string, any>;
46
+ };
47
+ };
48
+
49
+ export const parseModalBlocksConfiguration = (
50
+ configuration: Record<string, any>,
51
+ componentName: string
52
+ ): ModalBlocksConfig => {
53
+ const result: ModalBlocksConfig = {
54
+ header: {
55
+ container: {},
56
+ title: {},
57
+ closeButton: {},
58
+ actionButtons: {},
59
+ },
60
+ action: {
61
+ background: {},
62
+ title: {},
63
+ icons: {},
64
+ leadingIcon: {},
65
+ trailingIcon: {},
66
+ },
67
+ item: {
68
+ background: {},
69
+ image: {},
70
+ nowPlayingContainer: {},
71
+ nowPlayingAsset: {},
72
+ nowPlayingLabel: {},
73
+ textLabel1: {},
74
+ textLabel2: {},
75
+ buttonsContainer: {},
76
+ button1: {},
77
+ button2: {},
78
+ },
79
+ nowPlayingItem: {
80
+ background: {},
81
+ image: {},
82
+ nowPlayingContainer: {},
83
+ nowPlayingAsset: {},
84
+ nowPlayingLabel: {},
85
+ textLabel1: {},
86
+ textLabel2: {},
87
+ buttonsContainer: {},
88
+ button1: {},
89
+ button2: {},
90
+ },
91
+ button: {
92
+ background: {},
93
+ title: {},
94
+ icons: {},
95
+ leadingIcon: {},
96
+ },
97
+ };
98
+
99
+ if (!configuration || !componentName) {
100
+ return result;
101
+ }
102
+
103
+ const normalizedComponentName = componentName.replace(/-/g, "_");
104
+
105
+ // Helper to parse sub-components for a block
106
+ const parseBlock = (blockName: string, subComponents: string[]) => {
107
+ subComponents.forEach((subComponent) => {
108
+ // e.g. header_container
109
+ const fullSubComponentName = `${blockName}_${subComponent}`;
110
+
111
+ // e.g. result.header.container
112
+ const camelSubComponent = subComponent.replace(/_([a-z0-9])/g, (g) =>
113
+ g[1].toUpperCase()
114
+ );
115
+
116
+ const camelBlockName = (blockName as string).replace(
117
+ /_([a-z0-9])/g,
118
+ (g) => g[1].toUpperCase()
119
+ ) as keyof ModalBlocksConfig;
120
+
121
+ getAllSpecificStyles({
122
+ configuration,
123
+ componentName: normalizedComponentName,
124
+ subComponentName: fullSubComponentName,
125
+ styleSeparator: "",
126
+ outStyles:
127
+ result[camelBlockName]![
128
+ camelSubComponent as keyof (typeof result)[typeof camelBlockName]
129
+ ],
130
+ });
131
+ });
132
+ };
133
+
134
+ parseBlock("header", [
135
+ "container",
136
+ "title",
137
+ "close_button",
138
+ "action_buttons",
139
+ ]);
140
+
141
+ parseBlock("action", [
142
+ "background",
143
+ "title",
144
+ "icons",
145
+ "leading_icon",
146
+ "trailing_icon",
147
+ ]);
148
+
149
+ parseBlock("item", [
150
+ "background",
151
+ "image",
152
+ "now_playing_container",
153
+ "now_playing_asset",
154
+ "now_playing_label",
155
+ "text_label_1",
156
+ "text_label_2",
157
+ "buttons_container",
158
+ "button_1",
159
+ "button_2",
160
+ ]);
161
+
162
+ parseBlock("now_playing_item", [
163
+ "background",
164
+ "image",
165
+ "now_playing_container",
166
+ "now_playing_asset",
167
+ "now_playing_label",
168
+ "text_label_1",
169
+ "text_label_2",
170
+ "buttons_container",
171
+ "button_1",
172
+ "button_2",
173
+ ]);
174
+
175
+ parseBlock("button", ["background", "title", "icons", "leading_icon"]);
176
+
177
+ return result;
178
+ };
@@ -24,6 +24,7 @@ const {
24
24
  const { buttonKey } = require("./buttons");
25
25
  const { tvBadges } = require("./tvBadges");
26
26
  const { mobileProgressBar, tvProgressBar } = require("./progressBar");
27
+ const { getModalBlockStyles, getModalLocalizations } = require("./modalBlocks");
27
28
 
28
29
  const {
29
30
  secondaryImage,
@@ -54,4 +55,6 @@ module.exports = {
54
55
  getUpdatedSecondaryImageKeys,
55
56
  DEFAULT_GRADIENT_IMAGE,
56
57
  compact,
58
+ getModalBlockStyles,
59
+ getModalLocalizations,
57
60
  };
@@ -0,0 +1,304 @@
1
+ function getModalBlockStyles({ prefix }) {
2
+ return [
3
+ {
4
+ group: true,
5
+ label: "Header Styles",
6
+ folded: true,
7
+ fields: [
8
+ {
9
+ type: "color_picker_rgba",
10
+ key: `${prefix}_style_header_container_default_backgroundColor`,
11
+ label: "Header Background Color",
12
+ initial_value: "rgba(30,30,30,1)",
13
+ },
14
+ {
15
+ type: "color_picker_rgba",
16
+ key: `${prefix}_style_header_container_default_borderBottomColor`,
17
+ label: "Header Border Bottom Color",
18
+ initial_value: "transparent",
19
+ },
20
+ {
21
+ type: "number_input",
22
+ key: `${prefix}_style_header_container_default_borderBottomSize`,
23
+ label: "Header Border Bottom Size",
24
+ initial_value: 0,
25
+ },
26
+ {
27
+ type: "color_picker_rgba",
28
+ key: `${prefix}_style_header_title_default_fontColor`,
29
+ label: "Header Title Color",
30
+ initial_value: "#EFEFEF",
31
+ },
32
+ {
33
+ type: "number_input",
34
+ key: `${prefix}_style_header_title_default_fontSize`,
35
+ label: "Header Title Font Size",
36
+ initial_value: 18,
37
+ },
38
+ {
39
+ type: "number_input",
40
+ key: `${prefix}_style_header_title_default_lineHeight`,
41
+ label: "Header Title Line Height",
42
+ initial_value: 32,
43
+ },
44
+ {
45
+ type: "color_picker_rgba",
46
+ key: `${prefix}_style_header_close_button_default_backgroundColor`,
47
+ label: "Close Button Background Color",
48
+ initial_value: "transparent",
49
+ },
50
+ {
51
+ type: "color_picker_rgba",
52
+ key: `${prefix}_style_header_close_button_hover_backgroundColor`,
53
+ label: "Close Button Hover Background Color",
54
+ initial_value: "rgba(46,46,46,1)",
55
+ },
56
+ {
57
+ type: "uploader",
58
+ key: `${prefix}_style_header_close_button_asset`,
59
+ label: "Close Button Icon Asset",
60
+ },
61
+ {
62
+ type: "color_picker_rgba",
63
+ key: `${prefix}_style_header_action_buttons_default_backgroundColor`,
64
+ label: "Header Action Button Background Color",
65
+ initial_value: "rgba(46,46,46,1)",
66
+ },
67
+ {
68
+ type: "color_picker_rgba",
69
+ key: `${prefix}_style_header_action_buttons_hover_backgroundColor`,
70
+ label: "Header Action Button Hover Color",
71
+ initial_value: "rgba(62,62,62,1)",
72
+ },
73
+ {
74
+ type: "color_picker_rgba",
75
+ key: `${prefix}_style_header_action_buttons_default_fontColor`,
76
+ label: "Header Action Button Title Color",
77
+ initial_value: "#EFEFEF",
78
+ },
79
+ {
80
+ type: "number_input",
81
+ key: `${prefix}_style_header_action_buttons_default_fontSize`,
82
+ label: "Header Action Button Font Size",
83
+ initial_value: 14,
84
+ },
85
+ {
86
+ type: "number_input",
87
+ key: `${prefix}_style_header_action_buttons_default_borderRadius`,
88
+ label: "Header Action Button Radius",
89
+ initial_value: 16,
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ group: true,
95
+ label: "Item Styles",
96
+ folded: true,
97
+ fields: [
98
+ {
99
+ type: "color_picker_rgba",
100
+ key: `${prefix}_style_item_background_default_backgroundColor`,
101
+ label: "Item Background Color",
102
+ initial_value: "transparent",
103
+ },
104
+ {
105
+ type: "color_picker_rgba",
106
+ key: `${prefix}_style_item_background_focus_backgroundColor`,
107
+ label: "Item Focus/Touch Color",
108
+ initial_value: "rgba(62,62,62,1)",
109
+ },
110
+ {
111
+ type: "number_input",
112
+ key: `${prefix}_style_item_background_default_borderRadius`,
113
+ label: "Item Corner Radius",
114
+ initial_value: 12,
115
+ },
116
+ {
117
+ type: "number_input",
118
+ key: `${prefix}_style_item_background_default_paddingTop`,
119
+ label: "Item Padding Top",
120
+ initial_value: 8,
121
+ },
122
+ {
123
+ type: "number_input",
124
+ key: `${prefix}_style_item_background_default_paddingBottom`,
125
+ label: "Item Padding Bottom",
126
+ initial_value: 8,
127
+ },
128
+ {
129
+ type: "number_input",
130
+ key: `${prefix}_style_item_background_default_paddingLeft`,
131
+ label: "Item Padding Left",
132
+ initial_value: 10,
133
+ },
134
+ {
135
+ type: "number_input",
136
+ key: `${prefix}_style_item_background_default_paddingRight`,
137
+ label: "Item Padding Right",
138
+ initial_value: 10,
139
+ },
140
+ {
141
+ type: "number_input",
142
+ key: `${prefix}_style_item_image_default_width`,
143
+ label: "Item Image Width",
144
+ initial_value: 48,
145
+ },
146
+ {
147
+ type: "number_input",
148
+ key: `${prefix}_style_item_image_default_height`,
149
+ label: "Item Image Height",
150
+ initial_value: 48,
151
+ },
152
+ {
153
+ type: "number_input",
154
+ key: `${prefix}_style_item_image_default_borderRadius`,
155
+ label: "Item Image Radius",
156
+ initial_value: 6,
157
+ },
158
+ {
159
+ type: "color_picker_rgba",
160
+ key: `${prefix}_style_item_text_label_1_default_fontColor`,
161
+ label: "Item Title Color",
162
+ initial_value: "#FFFFFF",
163
+ },
164
+ {
165
+ type: "number_input",
166
+ key: `${prefix}_style_item_text_label_1_default_fontSize`,
167
+ label: "Item Title Font Size",
168
+ initial_value: 15,
169
+ },
170
+ {
171
+ type: "color_picker_rgba",
172
+ key: `${prefix}_style_item_text_label_2_default_fontColor`,
173
+ label: "Item Subtitle Color",
174
+ initial_value: "#999999",
175
+ },
176
+ {
177
+ type: "number_input",
178
+ key: `${prefix}_style_item_text_label_2_default_fontSize`,
179
+ label: "Item Subtitle Font Size",
180
+ initial_value: 13,
181
+ },
182
+ ],
183
+ },
184
+ {
185
+ group: true,
186
+ label: "Action Styles",
187
+ folded: true,
188
+ fields: [
189
+ {
190
+ type: "color_picker_rgba",
191
+ key: `${prefix}_style_action_background_default_backgroundColor`,
192
+ label: "Action Background Color",
193
+ initial_value: "transparent",
194
+ },
195
+ {
196
+ type: "color_picker_rgba",
197
+ key: `${prefix}_style_action_background_hover_backgroundColor`,
198
+ label: "Action Hover/Touch Color",
199
+ initial_value: "rgba(46,46,46,1)",
200
+ },
201
+ {
202
+ type: "number_input",
203
+ key: `${prefix}_style_action_background_default_borderRadius`,
204
+ label: "Action Corner Radius",
205
+ initial_value: 12,
206
+ },
207
+ {
208
+ type: "number_input",
209
+ key: `${prefix}_style_action_background_default_paddingTop`,
210
+ label: "Action Padding Top",
211
+ initial_value: 14,
212
+ },
213
+ {
214
+ type: "number_input",
215
+ key: `${prefix}_style_action_background_default_paddingBottom`,
216
+ label: "Action Padding Bottom",
217
+ initial_value: 14,
218
+ },
219
+ {
220
+ type: "color_picker_rgba",
221
+ key: `${prefix}_style_action_title_default_fontColor`,
222
+ label: "Action Title Color",
223
+ initial_value: "#EFEFEF",
224
+ },
225
+ {
226
+ type: "number_input",
227
+ key: `${prefix}_style_action_title_default_fontSize`,
228
+ label: "Action Title Font Size",
229
+ initial_value: 14,
230
+ },
231
+ {
232
+ type: "uploader",
233
+ key: `${prefix}_style_action_trailing_icon_chevron_asset`,
234
+ label: "Action Chevron Asset",
235
+ },
236
+ ],
237
+ },
238
+ {
239
+ group: true,
240
+ label: "Button Styles",
241
+ folded: true,
242
+ fields: [
243
+ {
244
+ type: "color_picker_rgba",
245
+ key: `${prefix}_style_button_background_default_backgroundColor`,
246
+ label: "Button Background Color",
247
+ initial_value: "#FFFFFF",
248
+ },
249
+ {
250
+ type: "color_picker_rgba",
251
+ key: `${prefix}_style_button_background_focus_backgroundColor`,
252
+ label: "Button Focus Color",
253
+ initial_value: "#E0E0E0",
254
+ },
255
+ {
256
+ type: "color_picker_rgba",
257
+ key: `${prefix}_style_button_background_inactive_backgroundColor`,
258
+ label: "Button Inactive Color",
259
+ initial_value: "#999999",
260
+ },
261
+ {
262
+ type: "number_input",
263
+ key: `${prefix}_style_button_background_default_borderRadius`,
264
+ label: "Button Corner Radius",
265
+ initial_value: 12,
266
+ },
267
+ {
268
+ type: "color_picker_rgba",
269
+ key: `${prefix}_style_button_title_default_fontColor`,
270
+ label: "Button Title Color",
271
+ initial_value: "#000000",
272
+ },
273
+ {
274
+ type: "number_input",
275
+ key: `${prefix}_style_button_title_default_fontSize`,
276
+ label: "Button Title Font Size",
277
+ initial_value: 15,
278
+ },
279
+ ],
280
+ },
281
+ ];
282
+ }
283
+
284
+ function getModalLocalizations({ prefix }) {
285
+ return [
286
+ {
287
+ type: "text_input",
288
+ label: "Queue Header Title",
289
+ key: `${prefix}_header_title`,
290
+ initial_value: "Queue",
291
+ },
292
+ {
293
+ type: "text_input",
294
+ label: "Go To Queue Action Label",
295
+ key: `${prefix}_label_go_to_queue`,
296
+ initial_value: "Go To Queue",
297
+ },
298
+ ];
299
+ }
300
+
301
+ module.exports = {
302
+ getModalBlockStyles,
303
+ getModalLocalizations,
304
+ };