@openlettermarketing/olc-react-sdk 2.1.6-beta.4 → 2.1.6-beta.5

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.
@@ -140,6 +140,7 @@ export declare const MESSAGES: {
140
140
  readonly TITLE: "Invalid Fields";
141
141
  readonly HEADING: "The following fields are not recognized";
142
142
  readonly DESCRIPTION: "The following field(s) used in this template are not recognized by the system. You can save the template as is, but these fields will not populate with data. To resolve this, remove or replace them with valid field names.";
143
+ readonly LIST_REGION_LABEL: "Unrecognized template fields";
143
144
  readonly ACKNOWLEDGE_LABEL: "I understand that saving now will preserve these invalid fields, but they will not be populated with data.";
144
145
  readonly CONTINUE_BUTTON: "Continue Saving";
145
146
  readonly CANCEL_BUTTON: "Cancel";
@@ -1 +1 @@
1
- export const SDK_VERSION: "2.1.6-beta.4";
1
+ export const SDK_VERSION: "2.1.6-beta.5";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openlettermarketing/olc-react-sdk",
3
3
  "private": false,
4
- "version": "2.1.6-beta.4",
4
+ "version": "2.1.6-beta.5",
5
5
  "type": "module",
6
6
  "description": "Simplify template builder integration for any product.",
7
7
  "main": "build/index.js",
@@ -59,11 +59,20 @@ const FieldValidationModal: React.FC<FieldValidationModalProps> = ({
59
59
  <p className="field-validation-description">
60
60
  {MESSAGES.TEMPLATE.FIELD_VALIDATION.DESCRIPTION}
61
61
  </p>
62
- <ol className="field-validation-list">
63
- {invalidFields.map((field, index) => (
64
- <li key={index}>{field}</li>
65
- ))}
66
- </ol>
62
+ <div
63
+ className="field-validation-list-scroll"
64
+ role="region"
65
+ aria-label={MESSAGES.TEMPLATE.FIELD_VALIDATION.LIST_REGION_LABEL}
66
+ >
67
+ <ul className="field-validation-list">
68
+ {invalidFields.map((field, index) => (
69
+ <li key={`${field}-${index}`}>
70
+ <span className="field-validation-list-index">{index + 1}.</span>
71
+ <span className="field-validation-list-text">{field}</span>
72
+ </li>
73
+ ))}
74
+ </ul>
75
+ </div>
67
76
  <label
68
77
  className="field-validation-acknowledge"
69
78
  onClick={() => setAcknowledged((prev) => !prev)}
@@ -14,21 +14,67 @@
14
14
  padding: 0;
15
15
  }
16
16
 
17
- .field-validation-list {
17
+ // Scroll only the list; keep markers visible for 10+ (outside markers need horizontal room —
18
+ // overflow-x: hidden was clipping two-digit list numbers to "0", "1", "2").
19
+ .field-validation-list-scroll {
20
+ max-height: min(40vh, 280px);
21
+ overflow-y: auto;
22
+ overscroll-behavior: contain;
18
23
  margin: 0 0 16px 0;
19
- padding-left: 20px;
24
+ padding-right: 6px;
25
+ padding-left: 4px;
26
+ box-sizing: border-box;
27
+
28
+ // Match the SDK-wide scrollbar (same variables used in .builder-wrapper and Polotno panels)
29
+ scrollbar-width: thin;
30
+ scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
31
+
32
+ &::-webkit-scrollbar {
33
+ width: 10px;
34
+ }
35
+
36
+ &::-webkit-scrollbar-track {
37
+ background: var(--scrollbar-track-color);
38
+ border-radius: 3px;
39
+ }
40
+
41
+ &::-webkit-scrollbar-thumb {
42
+ background: var(--scrollbar-thumb-color);
43
+ border-radius: 3px;
44
+ }
45
+ }
46
+
47
+ .field-validation-list {
48
+ margin: 0;
49
+ padding: 0;
50
+ list-style: none;
20
51
 
21
52
  li {
53
+ display: flex;
54
+ gap: 6px;
55
+ align-items: flex-start;
22
56
  font-size: 16px;
23
57
  font-weight: 400;
24
58
  color: var(--text-color);
25
59
  line-height: 20px;
26
60
  margin-bottom: 6px;
27
- word-break: break-all;
28
61
  font-family: var(--font-family);
29
62
  }
30
63
  }
31
64
 
65
+ .field-validation-list-index {
66
+ flex-shrink: 0;
67
+ min-width: 1.75rem;
68
+ text-align: right;
69
+ font-variant-numeric: tabular-nums;
70
+ }
71
+
72
+ .field-validation-list-text {
73
+ flex: 1;
74
+ min-width: 0;
75
+ word-break: break-all;
76
+ }
77
+
32
78
  .field-validation-acknowledge {
33
79
  display: flex;
34
80
  align-items: flex-start;
@@ -430,10 +430,14 @@ const TopNavigation: React.FC<TopNavigationProps> = ({
430
430
  }
431
431
  };
432
432
 
433
- const handleSave = async (invalidFieldsAcknowledged: boolean = false) => {
433
+ const handleSave = async (
434
+ hasFieldsWarnings: boolean = false,
435
+ fieldsWarningsAccepted: boolean = false
436
+ ) => {
434
437
  try {
435
438
  const formData = new FormData();
436
- formData.append('invalidFieldsAcknowledged', String(invalidFieldsAcknowledged));
439
+ formData.append('has_fields_warnings', String(hasFieldsWarnings));
440
+ formData.append('fields_warnings_accepted', String(fieldsWarningsAccepted));
437
441
  const allFields = [
438
442
  ...defaultFields,
439
443
  ...customFields,
@@ -579,7 +583,7 @@ const TopNavigation: React.FC<TopNavigationProps> = ({
579
583
 
580
584
  const handleContinueAnyway = (acknowledged: boolean) => {
581
585
  setIsShowModel((prev) => ({ ...prev, loading: true }));
582
- handleSave(acknowledged);
586
+ handleSave(true, acknowledged);
583
587
  };
584
588
 
585
589
  const handleChangeModel = (
@@ -147,6 +147,7 @@ export const MESSAGES = {
147
147
  TITLE: "Invalid Fields",
148
148
  HEADING: "The following fields are not recognized",
149
149
  DESCRIPTION: "The following field(s) used in this template are not recognized by the system. You can save the template as is, but these fields will not populate with data. To resolve this, remove or replace them with valid field names.",
150
+ LIST_REGION_LABEL: "Unrecognized template fields",
150
151
  ACKNOWLEDGE_LABEL: "I understand that saving now will preserve these invalid fields, but they will not be populated with data.",
151
152
  CONTINUE_BUTTON: "Continue Saving",
152
153
  CANCEL_BUTTON: "Cancel",
package/version.js CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.1.6-beta.4';
1
+ export const SDK_VERSION = '2.1.6-beta.5';