@magicfeedback/popup-sdk 1.0.12 → 1.0.14

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # MagicFeedback Popup SDK
1
+ # Deepdots Popup SDK
2
2
 
3
- TypeScript SDK for loading and displaying MagicFeedback surveys as popups in browser apps.
3
+ TypeScript SDK for loading and displaying Deepdots surveys as popups in browser apps.
4
4
 
5
5
  Package name: `@magicfeedback/popup-sdk`
6
6
 
@@ -333,7 +333,7 @@ interface DeepdotsEvent {
333
333
  - `segments.path` is the only segment currently evaluated by the SDK runtime.
334
334
  - `exit` triggers work across anchor navigation, hash navigation, `history.pushState()`, and `history.replaceState()`.
335
335
  - Pending `exit` popups are stored in `sessionStorage` until they are shown or discarded.
336
- - The default browser renderer uses MagicFeedback forms and applies button labels from `actions.accept`, `actions.start`, `actions.back`, and `actions.complete`.
336
+ - The default browser renderer uses Deepdots forms and applies button labels from `actions.accept`, `actions.start`, `actions.back`, and `actions.complete`.
337
337
  - `title`, `message`, and `style` belong to the popup definition contract, but the current browser renderer focuses on the embedded form and does not render those fields as standalone popup copy/layout controls.
338
338
  - `actions.decline` is accepted in the definition shape, but the current browser renderer does not render a dedicated decline button or enforce `decline.cooldownDays`.
339
339
  - In browser mode, the SDK creates `#deepdots-popup-container` and injects the shared popup stylesheet from jsDelivr.
@@ -50,22 +50,16 @@
50
50
  }
51
51
 
52
52
  .magicfeedback-label {
53
- font-weight: 600;
54
- font-family: inherit;
55
- font-size: 1.1rem;
56
- color: #212529;
57
- text-align: start;
58
- word-wrap: break-word;
59
- white-space: normal;
60
- }
61
- .magicfeedback-sublabel{
53
+ margin-bottom: 25px;
54
+ margin-top: 20px;
62
55
  font-weight: 400;
63
56
  font-family: inherit;
64
- font-size: 1rem;
65
- color: #6c757d;
57
+ font-size: 1.2rem;
58
+ color: #212529;
66
59
  text-align: start;
67
60
  word-wrap: break-word;
68
61
  white-space: normal;
62
+
69
63
  }
70
64
 
71
65
  .magicfeedback-checkbox {
@@ -90,8 +84,8 @@
90
84
  justify-content: flex-start;
91
85
  flex-wrap: wrap;
92
86
  width: 100%;
93
- margin-top: 10px;
94
- gap: 10px;
87
+ margin-right: 5px;
88
+ padding: 5px;
95
89
  }
96
90
 
97
91
  .magicfeedback-checkbox-container,
@@ -100,12 +94,11 @@
100
94
  flex-direction: row;
101
95
  justify-content: flex-start;
102
96
  align-items: center;
103
- margin: 0 2px;
97
+ margin: 5px;
104
98
  padding: 5px 0;
105
99
  background-color: #fff;
106
100
  border-radius: 5px;
107
101
  box-shadow: 0 0 3px #ccc;
108
- width: calc(100% - 10px);
109
102
  }
110
103
 
111
104
  input::-webkit-outer-spin-button,
@@ -131,7 +124,7 @@ input::-webkit-inner-spin-button {
131
124
  font-size: 16px;
132
125
  color: #212529;
133
126
  text-align: start;
134
- width: auto;
127
+ width: 100%;
135
128
  }
136
129
 
137
130
  p {
@@ -165,7 +158,7 @@ textarea,
165
158
  select {
166
159
  box-sizing: border-box;
167
160
  padding: 10px;
168
- margin: 20px 0 10px 0;
161
+ margin: 10px 0;
169
162
  width: 100%;
170
163
  border: 2px solid #ccc; /* Default border color - you can customize this */
171
164
  border-radius: 5px;
@@ -409,7 +402,6 @@ input.error, select.error {
409
402
 
410
403
  margin: 15px 0;
411
404
  padding: 0;
412
- padding-top: 45px !important;
413
405
 
414
406
  list-style: none;
415
407
  font-size: 1.5rem;
@@ -420,6 +412,23 @@ input.error, select.error {
420
412
  -ms-user-select: none;
421
413
  }
422
414
 
415
+ /* Cuando hay placeholders (Very bad / Very good), el placeholder ocupa
416
+ el 100% de la primera línea y los boxes bajan a la siguiente */
417
+ .magicfeedback-rating-number-container--with-placeholder {
418
+ flex-wrap: wrap;
419
+ align-items: flex-start;
420
+ }
421
+
422
+ .magicfeedback-rating-number-container--with-placeholder .magicfeedback-rating-placeholder {
423
+ width: 100%;
424
+ margin-bottom: 8px;
425
+ }
426
+
427
+ .magicfeedback-rating-number-container--with-placeholder .magicfeedback-rating-number-option {
428
+ width: auto;
429
+ flex: 1;
430
+ }
431
+
423
432
  .magicfeedback-rating-number-option {
424
433
  display: flex;
425
434
  flex-direction: row;
@@ -538,7 +547,7 @@ input.error, select.error {
538
547
  .magicfeedback-rating-number-option {
539
548
  max-width: 100%;
540
549
  height: 55px;
541
- margin: 5px;
550
+ margin: 5px 0;
542
551
  }
543
552
  }
544
553
 
@@ -637,7 +646,7 @@ input.error, select.error {
637
646
  .magicfeedback-success-message,
638
647
  .magicfeedback-info-message,
639
648
  .magicfeedback-start-message {
640
- margin: 10px 5px;
649
+ margin: 35px 5px;
641
650
  }
642
651
 
643
652
  .magicfeedback-success-message p,
package/dist/index.d.mts CHANGED
@@ -114,8 +114,9 @@ interface PopupActions {
114
114
  /** Estilos configurables del popup */
115
115
  interface PopupStyle {
116
116
  theme: 'light' | 'dark';
117
- position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center';
118
- imageUrl: string | null;
117
+ position: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
118
+ /** @deprecated No usado por el SDK — solo se conserva por compatibilidad con la API */
119
+ imageUrl?: string | null;
119
120
  }
120
121
  /** Segmentos o targeting para mostrar el popup */
121
122
  interface PopupSegments {
@@ -141,7 +142,7 @@ interface PopupRenderer {
141
142
  /** Preparar recursos si aplica */
142
143
  init?(): void;
143
144
  /** Mostrar popup */
144
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string): void;
145
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle): void;
145
146
  /** Ocultar popup */
146
147
  hide(): void;
147
148
  }
@@ -190,6 +191,7 @@ declare class DeepdotsPopups {
190
191
  triggerEvent(eventName: string): void;
191
192
  private showDefinition;
192
193
  private shouldShow;
194
+ private matchesSegmentsLang;
193
195
  private matchesSegmentsPath;
194
196
  private evaluateCooldown;
195
197
  private evaluateLegacyCondition;
package/dist/index.d.ts CHANGED
@@ -114,8 +114,9 @@ interface PopupActions {
114
114
  /** Estilos configurables del popup */
115
115
  interface PopupStyle {
116
116
  theme: 'light' | 'dark';
117
- position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center';
118
- imageUrl: string | null;
117
+ position: 'bottom' | 'bottom-right' | 'bottom-left' | 'top' | 'top-right' | 'top-left' | 'center';
118
+ /** @deprecated No usado por el SDK — solo se conserva por compatibilidad con la API */
119
+ imageUrl?: string | null;
119
120
  }
120
121
  /** Segmentos o targeting para mostrar el popup */
121
122
  interface PopupSegments {
@@ -141,7 +142,7 @@ interface PopupRenderer {
141
142
  /** Preparar recursos si aplica */
142
143
  init?(): void;
143
144
  /** Mostrar popup */
144
- show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string): void;
145
+ show(surveyId: string, productId: string, actions: PopupActions | undefined, emit: (type: DeepdotsEventType, surveyId: string, data?: Record<string, unknown>) => void, onClose: () => void, env?: string, userId?: string, style?: PopupStyle): void;
145
146
  /** Ocultar popup */
146
147
  hide(): void;
147
148
  }
@@ -190,6 +191,7 @@ declare class DeepdotsPopups {
190
191
  triggerEvent(eventName: string): void;
191
192
  private showDefinition;
192
193
  private shouldShow;
194
+ private matchesSegmentsLang;
193
195
  private matchesSegmentsPath;
194
196
  private evaluateCooldown;
195
197
  private evaluateLegacyCondition;