@capillarytech/creatives-library 9.0.13-alpha.0 → 9.0.13-alpha.1

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 (60) hide show
  1. package/constants/unified.js +0 -3
  2. package/package.json +1 -1
  3. package/utils/common.js +0 -8
  4. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberCarouselPreviewCards.js +132 -0
  5. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +108 -15
  6. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +141 -1
  7. package/v2Components/CommonTestAndPreview/UnifiedPreview/_viberCarouselPreviewCards.scss +132 -0
  8. package/v2Components/CommonTestAndPreview/index.js +244 -26
  9. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +364 -0
  10. package/v2Components/FormBuilder/_formBuilder.scss +0 -8
  11. package/v2Components/FormBuilder/index.js +4479 -41
  12. package/v2Containers/Templates/_templates.scss +83 -0
  13. package/v2Containers/Templates/index.js +90 -10
  14. package/v2Containers/Viber/constants.js +21 -0
  15. package/v2Containers/Viber/index.js +719 -49
  16. package/v2Containers/Viber/index.scss +175 -0
  17. package/v2Containers/Viber/messages.js +121 -0
  18. package/v2Containers/Viber/tests/index.test.js +80 -0
  19. package/v2Components/FormBuilder/Classic.js +0 -4487
  20. package/v2Components/FormBuilder/Functional/FormBuilderShell.js +0 -369
  21. package/v2Components/FormBuilder/Functional/channels/registry.js +0 -17
  22. package/v2Components/FormBuilder/Functional/channels/sms/buildSubmitPayload.js +0 -9
  23. package/v2Components/FormBuilder/Functional/channels/sms/config.js +0 -30
  24. package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +0 -46
  25. package/v2Components/FormBuilder/Functional/channels/sms/getLiquidContent.js +0 -13
  26. package/v2Components/FormBuilder/Functional/channels/sms/index.js +0 -22
  27. package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +0 -52
  28. package/v2Components/FormBuilder/Functional/channels/sms/tests/getLiquidContent.test.js +0 -25
  29. package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +0 -87
  30. package/v2Components/FormBuilder/Functional/channels/sms/validate.js +0 -89
  31. package/v2Components/FormBuilder/Functional/constants.js +0 -39
  32. package/v2Components/FormBuilder/Functional/core/schema/fieldRegistry.js +0 -38
  33. package/v2Components/FormBuilder/Functional/core/schema/initializeFormState.js +0 -85
  34. package/v2Components/FormBuilder/Functional/core/store/formReducer.js +0 -81
  35. package/v2Components/FormBuilder/Functional/core/store/selectors.js +0 -30
  36. package/v2Components/FormBuilder/Functional/core/store/toLegacyFormData.js +0 -91
  37. package/v2Components/FormBuilder/Functional/index.js +0 -26
  38. package/v2Components/FormBuilder/Functional/layout/FieldSlot.js +0 -59
  39. package/v2Components/FormBuilder/Functional/layout/SchemaForm.js +0 -32
  40. package/v2Components/FormBuilder/Functional/layout/Section.js +0 -118
  41. package/v2Components/FormBuilder/Functional/renderers/smsRenderers.js +0 -265
  42. package/v2Components/FormBuilder/Functional/tests/channelRegistry.test.js +0 -21
  43. package/v2Components/FormBuilder/Functional/tests/fieldRegistry.test.js +0 -65
  44. package/v2Components/FormBuilder/Functional/tests/fieldSlot.test.js +0 -97
  45. package/v2Components/FormBuilder/Functional/tests/fixtures/smsParityCases.js +0 -192
  46. package/v2Components/FormBuilder/Functional/tests/formReducer.test.js +0 -129
  47. package/v2Components/FormBuilder/Functional/tests/initializeFormState.test.js +0 -132
  48. package/v2Components/FormBuilder/Functional/tests/schemaForm.test.js +0 -40
  49. package/v2Components/FormBuilder/Functional/tests/section.test.js +0 -99
  50. package/v2Components/FormBuilder/Functional/tests/selectors.test.js +0 -67
  51. package/v2Components/FormBuilder/Functional/tests/sms.crossFlowParity.test.js +0 -155
  52. package/v2Components/FormBuilder/Functional/tests/sms.liquid.test.js +0 -172
  53. package/v2Components/FormBuilder/Functional/tests/sms.rollout.test.js +0 -122
  54. package/v2Components/FormBuilder/Functional/tests/sms.shell.parity.test.js +0 -329
  55. package/v2Components/FormBuilder/Functional/tests/smsRenderers.test.js +0 -162
  56. package/v2Components/FormBuilder/Functional/tests/toLegacyFormData.test.js +0 -95
  57. package/v2Components/FormBuilder/tests/__snapshots__/sms.characterization.test.js.snap +0 -114
  58. package/v2Components/FormBuilder/tests/entryGate.test.js +0 -106
  59. package/v2Components/FormBuilder/tests/sms.characterization.test.js +0 -336
  60. package/v2Components/TemplatePreview/coderabbits_comments +0 -171
@@ -1,171 +0,0 @@
1
- @coderabbitai
2
- coderabbitai Bot
3
- 2 days ago
4
- ⚠️ Potential issue | 🟠 Major | ⚡ Quick win
5
-
6
- Guard non-string channel values before calling toUpperCase().
7
-
8
- Current normalization crashes for truthy non-string channel values instead of returning null.
9
-
10
- Proposed fix
11
- -export const getChannelAdapter = (channel) => adapters[(channel || '').toUpperCase()] || null;
12
- +export const getChannelAdapter = (channel) => {
13
- + const key = typeof channel === 'string' ? channel.toUpperCase() : '';
14
- + return adapters[key] || null;
15
- +};
16
- 🤖 Prompt for AI Agents
17
- Verify each finding against current code. Fix only still-valid issues, skip the
18
- rest with a brief reason, keep changes minimal, and validate.
19
-
20
- In `@app/v2Components/FormBuilder/Functional/channels/registry.js` at line 12, The
21
- getChannelAdapter function does not guard against non-string values for the
22
- channel parameter. When a truthy non-string value (like a number or object) is
23
- passed, calling toUpperCase() on it will crash. Add a type check to ensure the
24
- channel value is a string before attempting to call toUpperCase() on it. If
25
- channel is not a string, return null directly. This prevents the crash while
26
- maintaining the existing behavior for null, undefined, and string values.
27
-
28
-
29
-
30
-
31
- coderabbitai Bot
32
- 2 days ago
33
- ⚠️ Potential issue | 🟠 Major | ⚡ Quick win
34
-
35
- Guard MULTICOLS row dereference to prevent schema-driven crashes.
36
-
37
- Line 38/39 assumes every row exists. A null row from schema data will throw before form initialization completes.
38
-
39
- Proposed fix
40
- - (section.inputFields || []).forEach((row) => (row.cols || []).forEach(visit));
41
- - (section.actionFields || []).forEach((row) => (row.cols || []).forEach(visit));
42
- + (section.inputFields || []).forEach((row) => (row?.cols || []).forEach(visit));
43
- + (section.actionFields || []).forEach((row) => (row?.cols || []).forEach(visit));
44
- 🤖 Prompt for AI Agents
45
- Verify each finding against current code. Fix only still-valid issues, skip the
46
- rest with a brief reason, keep changes minimal, and validate.
47
-
48
- In `@app/v2Components/FormBuilder/Functional/core/schema/initializeFormState.js`
49
- around lines 37 - 40, The MULTICOLS case in the section type handling does not
50
- guard against null or undefined row values before accessing the cols property,
51
- which will cause a crash if schema data contains null rows. Add a null check for
52
- each row within the forEach callbacks for both inputFields and actionFields
53
- processing to ensure the row exists before attempting to access row.cols,
54
- preventing dereferencing of null values during form initialization.
55
-
56
-
57
-
58
-
59
- coderabbitai Bot
60
- 2 days ago
61
- ⚠️ Potential issue | 🟠 Major | ⚡ Quick win
62
-
63
- Preserve original numeric tab indices when decoding legacy formData.
64
-
65
- Line 52 compacts tab keys into a dense array. For sparse legacy keys (e.g., only 1 present), toLegacy writes them back as 0, changing payload shape and base-tab addressing.
66
-
67
- Proposed fix
68
- 📝 Committable suggestion
69
- ‼️ IMPORTANT
70
- Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
71
-
72
- Suggested change
73
- const orderedIndices = Object.keys(tabsByIndex)
74
- .map(Number)
75
- .sort((a, b) => a - b);
76
- const tabs = orderedIndices.map((index) => tabsByIndex[index]);
77
- const foundBase = tabs.findIndex((tab) => tab?.base);
78
- const baseTabIndex = foundBase === -1 ? 0 : foundBase;
79
- const orderedIndices = Object.keys(tabsByIndex)
80
- .map(Number)
81
- .sort((a, b) => a - b);
82
- const tabs = [];
83
- orderedIndices.forEach((index) => {
84
- tabs[index] = tabsByIndex[index];
85
- });
86
- const foundBase = orderedIndices.find((index) => tabsByIndex[index]?.base);
87
- const baseTabIndex = foundBase === undefined ? 0 : foundBase;
88
- 🤖 Prompt for AI Agents
89
- Verify each finding against current code. Fix only still-valid issues, skip the
90
- rest with a brief reason, keep changes minimal, and validate.
91
-
92
- In `@app/v2Components/FormBuilder/Functional/core/store/toLegacyFormData.js`
93
- around lines 49 - 56, The issue is that the code compacts sparse tab indices
94
- into a dense array by mapping orderedIndices to a new tabs array, which loses
95
- the original numeric indices and changes the payload shape when converting back
96
- to legacy format. Instead of creating a compacted tabs array using
97
- orderedIndices.map, preserve the sparse structure by keeping the original
98
- numeric keys from tabsByIndex and adjusting the baseTabIndex calculation to work
99
- with the actual tab indices rather than array positions.
100
-
101
-
102
- @coderabbitai
103
- coderabbitai Bot
104
- 2 days ago
105
- ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
106
-
107
- Fix TagList prop contract types/defaults in FormBuilderShell.
108
-
109
- selectedOfferDetails and waitEventContextTags are typed opposite to how app/v2Containers/TagList/index.js consumes them (array and object respectively), which weakens contract checks and can hide wrong-shape regressions.
110
-
111
- Suggested fix
112
- FormBuilderShell.propTypes = {
113
- @@
114
- - selectedOfferDetails: PropTypes.object,
115
- + selectedOfferDetails: PropTypes.array,
116
- @@
117
- - waitEventContextTags: PropTypes.array,
118
- + waitEventContextTags: PropTypes.object,
119
- @@
120
- FormBuilderShell.defaultProps = {
121
- @@
122
- - selectedOfferDetails: undefined,
123
- + selectedOfferDetails: [],
124
- @@
125
- - waitEventContextTags: [],
126
- + waitEventContextTags: {},
127
- Also applies to: 361-364
128
-
129
- 🤖 Prompt for AI Agents
130
- Verify each finding against current code. Fix only still-valid issues, skip the
131
- rest with a brief reason, keep changes minimal, and validate.
132
-
133
- In `@app/v2Components/FormBuilder/Functional/FormBuilderShell.js` around lines 348
134
- - 350, The PropTypes definitions for selectedOfferDetails and
135
- waitEventContextTags in the FormBuilderShell propTypes are typed incorrectly
136
- compared to how they are consumed in the TagList component. Change
137
- selectedOfferDetails from PropTypes.object to PropTypes.array, and change
138
- waitEventContextTags from PropTypes.array to PropTypes.object. Apply the same
139
- type corrections to any other instances of these props mentioned in the file
140
- (lines 361-364).
141
-
142
-
143
- @coderabbitai
144
- coderabbitai Bot
145
- 2 days ago
146
- ⚠️ Potential issue | 🟠 Major | ⚡ Quick win
147
-
148
- Characterization can unintentionally run Functional instead of Classic.
149
-
150
- Line 22 imports the entry-gated FormBuilder (../index), and that gate can route SMS to Functional based on feature access. For a Classic golden suite, this makes the target non-deterministic and can hide Classic regressions.
151
-
152
- Suggested fix
153
- -import FormBuilder from '../index';
154
- +import ClassicFormBuilder from '../Classic';
155
- @@
156
- -const ComponentToRender = injectIntl(FormBuilder);
157
- +const ComponentToRender = injectIntl(ClassicFormBuilder);
158
- Also applies to: 47-47
159
-
160
- 🤖 Prompt for AI Agents
161
- Verify each finding against current code. Fix only still-valid issues, skip the
162
- rest with a brief reason, keep changes minimal, and validate.
163
-
164
- In `@app/v2Components/FormBuilder/tests/sms.characterization.test.js` around lines
165
- 22 - 23, The imports on line 22 and line 47 use the entry-gated FormBuilder from
166
- ../index which can route SMS to Functional based on feature access. For the
167
- Classic characterization test to be deterministic and properly test Classic
168
- behavior, import the Classic FormBuilder implementation directly rather than
169
- going through the gated entry point. Replace the imports from ../index with
170
- direct imports to the Classic FormBuilder implementation to ensure the test
171
- always uses the Classic version.