@bigbinary/neeto-form-frontend 1.2.1 → 1.2.2

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/dist/index.cjs.js CHANGED
@@ -50012,7 +50012,7 @@ var RatingField = function RatingField(_ref) {
50012
50012
 
50013
50013
  function cov_169joloac6() {
50014
50014
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/ExternalForm/Fields/RichTextEditor.jsx";
50015
- var hash = "6ba7fc3833833f3e5a9b53ad73dcbbb33833852b";
50015
+ var hash = "606c74303adb3d540387836761d6cccb9f3cc43f";
50016
50016
  var global = new Function("return this")();
50017
50017
  var gcv = "__coverage__";
50018
50018
  var coverageData = {
@@ -50020,61 +50020,81 @@ function cov_169joloac6() {
50020
50020
  statementMap: {
50021
50021
  "0": {
50022
50022
  start: {
50023
- line: 9,
50023
+ line: 10,
50024
50024
  column: 23
50025
50025
  },
50026
50026
  end: {
50027
- line: 46,
50027
+ line: 54,
50028
50028
  column: 1
50029
50029
  }
50030
50030
  },
50031
50031
  "1": {
50032
50032
  start: {
50033
- line: 10,
50033
+ line: 11,
50034
50034
  column: 69
50035
50035
  },
50036
50036
  end: {
50037
- line: 10,
50037
+ line: 11,
50038
50038
  column: 77
50039
50039
  }
50040
50040
  },
50041
50041
  "2": {
50042
50042
  start: {
50043
- line: 12,
50043
+ line: 13,
50044
+ column: 31
50045
+ },
50046
+ end: {
50047
+ line: 13,
50048
+ column: 60
50049
+ }
50050
+ },
50051
+ "3": {
50052
+ start: {
50053
+ line: 15,
50044
50054
  column: 2
50045
50055
  },
50046
50056
  end: {
50047
- line: 45,
50057
+ line: 53,
50048
50058
  column: 4
50049
50059
  }
50050
50060
  },
50051
- "3": {
50061
+ "4": {
50052
50062
  start: {
50053
- line: 26,
50063
+ line: 29,
50054
50064
  column: 10
50055
50065
  },
50056
50066
  end: {
50057
- line: 41,
50067
+ line: 29,
50068
+ column: 75
50069
+ }
50070
+ },
50071
+ "5": {
50072
+ start: {
50073
+ line: 33,
50074
+ column: 10
50075
+ },
50076
+ end: {
50077
+ line: 49,
50058
50078
  column: 12
50059
50079
  }
50060
50080
  },
50061
- "4": {
50081
+ "6": {
50062
50082
  start: {
50063
- line: 38,
50083
+ line: 46,
50064
50084
  column: 26
50065
50085
  },
50066
50086
  end: {
50067
- line: 38,
50087
+ line: 46,
50068
50088
  column: 58
50069
50089
  }
50070
50090
  },
50071
- "5": {
50091
+ "7": {
50072
50092
  start: {
50073
- line: 39,
50093
+ line: 47,
50074
50094
  column: 31
50075
50095
  },
50076
50096
  end: {
50077
- line: 39,
50097
+ line: 47,
50078
50098
  column: 62
50079
50099
  }
50080
50100
  }
@@ -50084,222 +50104,246 @@ function cov_169joloac6() {
50084
50104
  name: "(anonymous_0)",
50085
50105
  decl: {
50086
50106
  start: {
50087
- line: 9,
50107
+ line: 10,
50088
50108
  column: 23
50089
50109
  },
50090
50110
  end: {
50091
- line: 9,
50111
+ line: 10,
50092
50112
  column: 24
50093
50113
  }
50094
50114
  },
50095
50115
  loc: {
50096
50116
  start: {
50097
- line: 9,
50117
+ line: 10,
50098
50118
  column: 70
50099
50119
  },
50100
50120
  end: {
50101
- line: 46,
50121
+ line: 54,
50102
50122
  column: 1
50103
50123
  }
50104
50124
  },
50105
- line: 9
50125
+ line: 10
50106
50126
  },
50107
50127
  "1": {
50108
50128
  name: "(anonymous_1)",
50109
50129
  decl: {
50110
50130
  start: {
50111
- line: 25,
50131
+ line: 28,
50132
+ column: 22
50133
+ },
50134
+ end: {
50135
+ line: 28,
50136
+ column: 23
50137
+ }
50138
+ },
50139
+ loc: {
50140
+ start: {
50141
+ line: 29,
50142
+ column: 10
50143
+ },
50144
+ end: {
50145
+ line: 29,
50146
+ column: 75
50147
+ }
50148
+ },
50149
+ line: 29
50150
+ },
50151
+ "2": {
50152
+ name: "(anonymous_2)",
50153
+ decl: {
50154
+ start: {
50155
+ line: 32,
50112
50156
  column: 9
50113
50157
  },
50114
50158
  end: {
50115
- line: 25,
50159
+ line: 32,
50116
50160
  column: 10
50117
50161
  }
50118
50162
  },
50119
50163
  loc: {
50120
50164
  start: {
50121
- line: 26,
50165
+ line: 33,
50122
50166
  column: 10
50123
50167
  },
50124
50168
  end: {
50125
- line: 41,
50169
+ line: 49,
50126
50170
  column: 12
50127
50171
  }
50128
50172
  },
50129
- line: 26
50173
+ line: 33
50130
50174
  },
50131
- "2": {
50132
- name: "(anonymous_2)",
50175
+ "3": {
50176
+ name: "(anonymous_3)",
50133
50177
  decl: {
50134
50178
  start: {
50135
- line: 38,
50179
+ line: 46,
50136
50180
  column: 20
50137
50181
  },
50138
50182
  end: {
50139
- line: 38,
50183
+ line: 46,
50140
50184
  column: 21
50141
50185
  }
50142
50186
  },
50143
50187
  loc: {
50144
50188
  start: {
50145
- line: 38,
50189
+ line: 46,
50146
50190
  column: 26
50147
50191
  },
50148
50192
  end: {
50149
- line: 38,
50193
+ line: 46,
50150
50194
  column: 58
50151
50195
  }
50152
50196
  },
50153
- line: 38
50197
+ line: 46
50154
50198
  },
50155
- "3": {
50156
- name: "(anonymous_3)",
50199
+ "4": {
50200
+ name: "(anonymous_4)",
50157
50201
  decl: {
50158
50202
  start: {
50159
- line: 39,
50203
+ line: 47,
50160
50204
  column: 22
50161
50205
  },
50162
50206
  end: {
50163
- line: 39,
50207
+ line: 47,
50164
50208
  column: 23
50165
50209
  }
50166
50210
  },
50167
50211
  loc: {
50168
50212
  start: {
50169
- line: 39,
50213
+ line: 47,
50170
50214
  column: 31
50171
50215
  },
50172
50216
  end: {
50173
- line: 39,
50217
+ line: 47,
50174
50218
  column: 62
50175
50219
  }
50176
50220
  },
50177
- line: 39
50221
+ line: 47
50178
50222
  }
50179
50223
  },
50180
50224
  branchMap: {
50181
50225
  "0": {
50182
50226
  loc: {
50183
50227
  start: {
50184
- line: 9,
50228
+ line: 10,
50185
50229
  column: 47
50186
50230
  },
50187
50231
  end: {
50188
- line: 9,
50232
+ line: 10,
50189
50233
  column: 63
50190
50234
  }
50191
50235
  },
50192
50236
  type: "default-arg",
50193
50237
  locations: [{
50194
50238
  start: {
50195
- line: 9,
50239
+ line: 10,
50196
50240
  column: 61
50197
50241
  },
50198
50242
  end: {
50199
- line: 9,
50243
+ line: 10,
50200
50244
  column: 63
50201
50245
  }
50202
50246
  }],
50203
- line: 9
50247
+ line: 10
50204
50248
  },
50205
50249
  "1": {
50206
50250
  loc: {
50207
50251
  start: {
50208
- line: 15,
50252
+ line: 18,
50209
50253
  column: 9
50210
50254
  },
50211
50255
  end: {
50212
- line: 19,
50256
+ line: 22,
50213
50257
  column: 9
50214
50258
  }
50215
50259
  },
50216
50260
  type: "binary-expr",
50217
50261
  locations: [{
50218
50262
  start: {
50219
- line: 15,
50263
+ line: 18,
50220
50264
  column: 9
50221
50265
  },
50222
50266
  end: {
50223
- line: 15,
50267
+ line: 18,
50224
50268
  column: 14
50225
50269
  }
50226
50270
  }, {
50227
50271
  start: {
50228
- line: 16,
50272
+ line: 19,
50229
50273
  column: 10
50230
50274
  },
50231
50275
  end: {
50232
- line: 18,
50276
+ line: 21,
50233
50277
  column: 18
50234
50278
  }
50235
50279
  }],
50236
- line: 15
50280
+ line: 18
50237
50281
  },
50238
50282
  "2": {
50239
50283
  loc: {
50240
50284
  start: {
50241
- line: 22,
50285
+ line: 26,
50242
50286
  column: 14
50243
50287
  },
50244
50288
  end: {
50245
- line: 22,
50289
+ line: 26,
50246
50290
  column: 28
50247
50291
  }
50248
50292
  },
50249
50293
  type: "binary-expr",
50250
50294
  locations: [{
50251
50295
  start: {
50252
- line: 22,
50296
+ line: 26,
50253
50297
  column: 14
50254
50298
  },
50255
50299
  end: {
50256
- line: 22,
50300
+ line: 26,
50257
50301
  column: 18
50258
50302
  }
50259
50303
  }, {
50260
50304
  start: {
50261
- line: 22,
50305
+ line: 26,
50262
50306
  column: 22
50263
50307
  },
50264
50308
  end: {
50265
- line: 22,
50309
+ line: 26,
50266
50310
  column: 28
50267
50311
  }
50268
50312
  }],
50269
- line: 22
50313
+ line: 26
50270
50314
  },
50271
50315
  "3": {
50272
50316
  loc: {
50273
50317
  start: {
50274
- line: 28,
50318
+ line: 35,
50275
50319
  column: 19
50276
50320
  },
50277
50321
  end: {
50278
- line: 28,
50322
+ line: 35,
50279
50323
  column: 49
50280
50324
  }
50281
50325
  },
50282
50326
  type: "cond-expr",
50283
50327
  locations: [{
50284
50328
  start: {
50285
- line: 28,
50329
+ line: 35,
50286
50330
  column: 34
50287
50331
  },
50288
50332
  end: {
50289
- line: 28,
50333
+ line: 35,
50290
50334
  column: 44
50291
50335
  }
50292
50336
  }, {
50293
50337
  start: {
50294
- line: 28,
50338
+ line: 35,
50295
50339
  column: 47
50296
50340
  },
50297
50341
  end: {
50298
- line: 28,
50342
+ line: 35,
50299
50343
  column: 49
50300
50344
  }
50301
50345
  }],
50302
- line: 28
50346
+ line: 35
50303
50347
  }
50304
50348
  },
50305
50349
  s: {
@@ -50308,13 +50352,16 @@ function cov_169joloac6() {
50308
50352
  "2": 0,
50309
50353
  "3": 0,
50310
50354
  "4": 0,
50311
- "5": 0
50355
+ "5": 0,
50356
+ "6": 0,
50357
+ "7": 0
50312
50358
  },
50313
50359
  f: {
50314
50360
  "0": 0,
50315
50361
  "1": 0,
50316
50362
  "2": 0,
50317
- "3": 0
50363
+ "3": 0,
50364
+ "4": 0
50318
50365
  },
50319
50366
  b: {
50320
50367
  "0": [0],
@@ -50323,7 +50370,7 @@ function cov_169joloac6() {
50323
50370
  "3": [0, 0]
50324
50371
  },
50325
50372
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
50326
- hash: "6ba7fc3833833f3e5a9b53ad73dcbbb33833852b"
50373
+ hash: "606c74303adb3d540387836761d6cccb9f3cc43f"
50327
50374
  };
50328
50375
  var coverage = global[gcv] || (global[gcv] = {});
50329
50376
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -50353,7 +50400,8 @@ var RichTextEditor = function RichTextEditor(_ref) {
50353
50400
  isRequired = _ref2.isRequired,
50354
50401
  nodeId = _ref2.nodeId,
50355
50402
  placeholder = _ref2.placeholder;
50356
- cov_169joloac6().s[2]++;
50403
+ var debouncedPlaceholder = (cov_169joloac6().s[2]++, reactUtils.useDebounce(placeholder, 300));
50404
+ cov_169joloac6().s[3]++;
50357
50405
  return /*#__PURE__*/React__default["default"].createElement("div", {
50358
50406
  className: "neeto-form-engine-input__wrapper"
50359
50407
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -50361,33 +50409,40 @@ var RichTextEditor = function RichTextEditor(_ref) {
50361
50409
  }, (cov_169joloac6().b[1][0]++, label) && (cov_169joloac6().b[1][1]++, /*#__PURE__*/React__default["default"].createElement("label", {
50362
50410
  className: "neeto-form-engine-label"
50363
50411
  }, getLabel$1(label, isRequired)))), /*#__PURE__*/React__default["default"].createElement(formik.FastField, {
50412
+ debouncedPlaceholder: debouncedPlaceholder,
50364
50413
  name: (cov_169joloac6().b[2][0]++, name) || (cov_169joloac6().b[2][1]++, nodeId),
50365
50414
  validate: validateFieldValue({
50366
50415
  kind: kind,
50367
50416
  label: label,
50368
50417
  isRequired: isRequired
50369
- })
50418
+ }),
50419
+ shouldUpdate: function shouldUpdate(nextProps, prevProps) {
50420
+ cov_169joloac6().f[1]++;
50421
+ cov_169joloac6().s[4]++;
50422
+ return nextProps.debouncedPlaceholder !== prevProps.debouncedPlaceholder;
50423
+ }
50370
50424
  }, function (_ref3) {
50371
50425
  var field = _ref3.field,
50372
50426
  form = _ref3.form,
50373
50427
  meta = _ref3.meta;
50374
- cov_169joloac6().f[1]++;
50375
- cov_169joloac6().s[3]++;
50428
+ cov_169joloac6().f[2]++;
50429
+ cov_169joloac6().s[5]++;
50376
50430
  return /*#__PURE__*/React__default["default"].createElement(neetoEditor.Editor, _extends$8({
50377
50431
  className: "neeto-form-engine-rich-text-input",
50378
50432
  error: meta.touched ? (cov_169joloac6().b[3][0]++, meta.error) : (cov_169joloac6().b[3][1]++, ""),
50379
50433
  initialValue: field.value,
50380
- placeholder: placeholder,
50434
+ key: debouncedPlaceholder,
50435
+ placeholder: debouncedPlaceholder,
50381
50436
  ref: editorRef,
50382
50437
  addons: ["attachments", "block-quote", "code-block", "image-upload"],
50383
50438
  onBlur: function onBlur() {
50384
- cov_169joloac6().f[2]++;
50385
- cov_169joloac6().s[4]++;
50439
+ cov_169joloac6().f[3]++;
50440
+ cov_169joloac6().s[6]++;
50386
50441
  return form.setFieldTouched(name, true);
50387
50442
  },
50388
50443
  onChange: function onChange(value) {
50389
- cov_169joloac6().f[3]++;
50390
- cov_169joloac6().s[5]++;
50444
+ cov_169joloac6().f[4]++;
50445
+ cov_169joloac6().s[7]++;
50391
50446
  return form.setFieldValue(name, value);
50392
50447
  }
50393
50448
  }, editorProps));