@arquimedes.co/eureka-forms 0.2.13-test → 0.2.18-test

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.
@@ -39,6 +39,20 @@ function TextAreaStep(_a) {
39
39
  return { border: '1px solid ' + formStyle.outlineColor };
40
40
  }
41
41
  };
42
+ var calcDefaultValue = function () {
43
+ var _a, _b;
44
+ if ((_a = originalValues[step.id]) === null || _a === void 0 ? void 0 : _a.draft) {
45
+ (_b = originalValues[step.id]) === null || _b === void 0 ? void 0 : _b.draft;
46
+ var converted = convertFromRaw(originalValues[step.id].draft);
47
+ console.log(converted);
48
+ var test_1 = EditorState.createWithContent(converted);
49
+ console.log(test_1);
50
+ return test_1;
51
+ }
52
+ else {
53
+ return EditorState.createEmpty();
54
+ }
55
+ };
42
56
  if (step.hasTextEditor) {
43
57
  return (_jsxs("div", __assign({ className: styles.textEditorContainer, style: {
44
58
  '--eureka-outline': formStyle.outlineColor,
@@ -63,9 +77,7 @@ function TextAreaStep(_a) {
63
77
  if (!postview) {
64
78
  setFocus(true);
65
79
  }
66
- } }, { children: [postview && (_jsx("div", { className: styles.disabledCurtain }, void 0)), _jsx(Controller, { name: step.id, control: control, defaultValue: originalValues[step.id]
67
- ? EditorState.createWithContent(convertFromRaw(originalValues[step.id].draft))
68
- : EditorState.createEmpty(), rules: step.required
80
+ } }, { children: [postview && (_jsx("div", { className: styles.disabledCurtain }, void 0)), _jsx(Controller, { name: step.id, control: control, defaultValue: calcDefaultValue(), rules: step.required
69
81
  ? {
70
82
  validate: function (editorState) {
71
83
  return editorState
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "0.2.13-test",
4
+ "version": "0.2.18-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",