@magicfeedback/popup-sdk 1.0.14 → 1.1.0

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.
@@ -101,8 +101,8 @@
101
101
  box-shadow: 0 0 3px #ccc;
102
102
  }
103
103
 
104
- input::-webkit-outer-spin-button,
105
- input::-webkit-inner-spin-button {
104
+ .deepdots-popup input::-webkit-outer-spin-button,
105
+ .deepdots-popup input::-webkit-inner-spin-button {
106
106
  -webkit-appearance: none;
107
107
  -moz-appearance: textfield;
108
108
  }
@@ -127,12 +127,12 @@ input::-webkit-inner-spin-button {
127
127
  width: 100%;
128
128
  }
129
129
 
130
- p {
130
+ .deepdots-popup p {
131
131
  margin-bottom: 0px;
132
132
  font-size: 12px;
133
133
  }
134
134
 
135
- h2 {
135
+ .deepdots-popup h2 {
136
136
  line-height: 1.66;
137
137
  margin: 0;
138
138
  padding: 0;
@@ -145,17 +145,17 @@ h2 {
145
145
  margin-bottom: 40px;
146
146
  }
147
147
 
148
- h6 {
148
+ .deepdots-popup h6 {
149
149
  margin-bottom: 1rem;
150
150
  }
151
151
 
152
- input[type="date"],
153
- input[type="text"],
154
- input[type="number"],
155
- input[type="email"],
156
- input[type="password"],
157
- textarea,
158
- select {
152
+ .deepdots-popup input[type="date"],
153
+ .deepdots-popup input[type="text"],
154
+ .deepdots-popup input[type="number"],
155
+ .deepdots-popup input[type="email"],
156
+ .deepdots-popup input[type="password"],
157
+ .deepdots-popup textarea,
158
+ .deepdots-popup select {
159
159
  box-sizing: border-box;
160
160
  padding: 10px;
161
161
  margin: 10px 0;
@@ -170,7 +170,7 @@ select {
170
170
  -webkit-appearance: none;
171
171
  }
172
172
 
173
- select {
173
+ .deepdots-popup select {
174
174
  background-image: linear-gradient(45deg, transparent 50%, gray 50%),
175
175
  linear-gradient(135deg, gray 50%, transparent 50%),
176
176
  linear-gradient(to right, #ccc, #ccc);
@@ -233,7 +233,7 @@ select {
233
233
  background-color: #cadff8;
234
234
  }
235
235
 
236
- input[type="radio"] {
236
+ .deepdots-popup input[type="radio"] {
237
237
  padding: 20px;
238
238
  margin: 10px 0 10px 15px;
239
239
  width: 40px;
@@ -242,12 +242,12 @@ input[type="radio"] {
242
242
  }
243
243
 
244
244
  /* Style for focused input/select */
245
- input:focus, select:focus {
245
+ .deepdots-popup input:focus, .deepdots-popup select:focus {
246
246
  border-color: #4CAF50; /* Highlight color when focused - you can customize this */
247
247
  }
248
248
 
249
249
  /* Style for invalid input (example: validation error) */
250
- input.error, select.error {
250
+ .deepdots-popup input.error, .deepdots-popup select.error {
251
251
  border-color: #ff3333; /* Red color for error state - you can customize this */
252
252
  }
253
253
 
package/dist/index.js CHANGED
@@ -2077,8 +2077,8 @@ var style_default = `.magicfeedback-container {
2077
2077
  box-shadow: 0 0 3px #ccc;
2078
2078
  }
2079
2079
 
2080
- input::-webkit-outer-spin-button,
2081
- input::-webkit-inner-spin-button {
2080
+ .deepdots-popup input::-webkit-outer-spin-button,
2081
+ .deepdots-popup input::-webkit-inner-spin-button {
2082
2082
  -webkit-appearance: none;
2083
2083
  -moz-appearance: textfield;
2084
2084
  }
@@ -2103,12 +2103,12 @@ input::-webkit-inner-spin-button {
2103
2103
  width: 100%;
2104
2104
  }
2105
2105
 
2106
- p {
2106
+ .deepdots-popup p {
2107
2107
  margin-bottom: 0px;
2108
2108
  font-size: 12px;
2109
2109
  }
2110
2110
 
2111
- h2 {
2111
+ .deepdots-popup h2 {
2112
2112
  line-height: 1.66;
2113
2113
  margin: 0;
2114
2114
  padding: 0;
@@ -2121,17 +2121,17 @@ h2 {
2121
2121
  margin-bottom: 40px;
2122
2122
  }
2123
2123
 
2124
- h6 {
2124
+ .deepdots-popup h6 {
2125
2125
  margin-bottom: 1rem;
2126
2126
  }
2127
2127
 
2128
- input[type="date"],
2129
- input[type="text"],
2130
- input[type="number"],
2131
- input[type="email"],
2132
- input[type="password"],
2133
- textarea,
2134
- select {
2128
+ .deepdots-popup input[type="date"],
2129
+ .deepdots-popup input[type="text"],
2130
+ .deepdots-popup input[type="number"],
2131
+ .deepdots-popup input[type="email"],
2132
+ .deepdots-popup input[type="password"],
2133
+ .deepdots-popup textarea,
2134
+ .deepdots-popup select {
2135
2135
  box-sizing: border-box;
2136
2136
  padding: 10px;
2137
2137
  margin: 10px 0;
@@ -2146,7 +2146,7 @@ select {
2146
2146
  -webkit-appearance: none;
2147
2147
  }
2148
2148
 
2149
- select {
2149
+ .deepdots-popup select {
2150
2150
  background-image: linear-gradient(45deg, transparent 50%, gray 50%),
2151
2151
  linear-gradient(135deg, gray 50%, transparent 50%),
2152
2152
  linear-gradient(to right, #ccc, #ccc);
@@ -2209,7 +2209,7 @@ select {
2209
2209
  background-color: #cadff8;
2210
2210
  }
2211
2211
 
2212
- input[type="radio"] {
2212
+ .deepdots-popup input[type="radio"] {
2213
2213
  padding: 20px;
2214
2214
  margin: 10px 0 10px 15px;
2215
2215
  width: 40px;
@@ -2218,12 +2218,12 @@ input[type="radio"] {
2218
2218
  }
2219
2219
 
2220
2220
  /* Style for focused input/select */
2221
- input:focus, select:focus {
2221
+ .deepdots-popup input:focus, .deepdots-popup select:focus {
2222
2222
  border-color: #4CAF50; /* Highlight color when focused - you can customize this */
2223
2223
  }
2224
2224
 
2225
2225
  /* Style for invalid input (example: validation error) */
2226
- input.error, select.error {
2226
+ .deepdots-popup input.error, .deepdots-popup select.error {
2227
2227
  border-color: #ff3333; /* Red color for error state - you can customize this */
2228
2228
  }
2229
2229
 
@@ -4144,18 +4144,20 @@ var DeepdotsPopups = class {
4144
4144
  emitEvent(type, surveyId, data) {
4145
4145
  const event = { type, surveyId, timestamp: Date.now(), data };
4146
4146
  this.log("Event emitted", event);
4147
- if (type === "popup_clicked" && data?.action === "partial") {
4147
+ const isPartialClick = type === "popup_clicked" && data?.action === "partial";
4148
+ if (isPartialClick) {
4148
4149
  this.markSurveyProgress(surveyId, "PARTIAL");
4149
4150
  }
4150
4151
  if (type === "survey_completed") {
4151
4152
  this.markSurveyAnswered(surveyId);
4152
4153
  }
4153
- if (type === "popup_shown" || type === "survey_completed") {
4154
+ if (type === "popup_shown" || type === "survey_completed" || isPartialClick) {
4154
4155
  const popupIdFromData = data?.popupId;
4155
4156
  const popupId = popupIdFromData || this.surveyToPopupId.get(surveyId);
4156
4157
  if (popupId) {
4157
4158
  const userIdFromData = data?.userId;
4158
- void this.postPopupEvent(type === "popup_shown" ? "SHOWED" /* SHOWED */ : "COMPLETED" /* COMPLETED */, popupId, userIdFromData || this.config?.userId);
4159
+ const status = type === "popup_shown" ? "SHOWED" /* SHOWED */ : type === "survey_completed" ? "COMPLETED" /* COMPLETED */ : "PARTIAL" /* PARTIAL */;
4160
+ void this.postPopupEvent(status, popupId, userIdFromData || this.config?.userId);
4159
4161
  } else {
4160
4162
  this.debug("No popupId available to post event", { type, surveyId });
4161
4163
  }