@rulab/adminjs-components 0.0.2 → 0.0.3
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 +5 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/src/components/Editor/Editor.jsx +1 -1
package/dist/index.cjs
CHANGED
|
@@ -416,6 +416,10 @@ var EDITOR_TOOLS = {
|
|
|
416
416
|
// src/components/Editor/Editor.jsx
|
|
417
417
|
var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
418
418
|
const [jsonData, setJsonData] = (0, import_react6.useState)();
|
|
419
|
+
console.log(
|
|
420
|
+
record.params[property.path],
|
|
421
|
+
"record.params[property.path].path"
|
|
422
|
+
);
|
|
419
423
|
const ref = (0, import_react6.useRef)();
|
|
420
424
|
(0, import_react6.useEffect)(() => {
|
|
421
425
|
onChangeAdmin(property.path, jsonData);
|
|
@@ -425,7 +429,7 @@ var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
425
429
|
const editor = new import_editorjs.default({
|
|
426
430
|
holder: editorId,
|
|
427
431
|
tools: EDITOR_TOOLS,
|
|
428
|
-
data: JSON.parse(record.params.
|
|
432
|
+
data: JSON.parse(record.params[property.path]),
|
|
429
433
|
async onChange(api, event) {
|
|
430
434
|
const data = await api.saver.save();
|
|
431
435
|
setJsonData(JSON.stringify(data));
|
package/dist/index.js
CHANGED
|
@@ -397,6 +397,10 @@ var EDITOR_TOOLS = {
|
|
|
397
397
|
// src/components/Editor/Editor.jsx
|
|
398
398
|
var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
399
399
|
const [jsonData, setJsonData] = useState4();
|
|
400
|
+
console.log(
|
|
401
|
+
record.params[property.path],
|
|
402
|
+
"record.params[property.path].path"
|
|
403
|
+
);
|
|
400
404
|
const ref = useRef();
|
|
401
405
|
useEffect3(() => {
|
|
402
406
|
onChangeAdmin(property.path, jsonData);
|
|
@@ -406,7 +410,7 @@ var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
406
410
|
const editor = new EditorJS({
|
|
407
411
|
holder: editorId,
|
|
408
412
|
tools: EDITOR_TOOLS,
|
|
409
|
-
data: JSON.parse(record.params.
|
|
413
|
+
data: JSON.parse(record.params[property.path]),
|
|
410
414
|
async onChange(api, event) {
|
|
411
415
|
const data = await api.saver.save();
|
|
412
416
|
setJsonData(JSON.stringify(data));
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ const Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
21
21
|
const editor = new EditorJS({
|
|
22
22
|
holder: editorId,
|
|
23
23
|
tools: EDITOR_TOOLS,
|
|
24
|
-
data: JSON.parse(record.params.
|
|
24
|
+
data: JSON.parse(record.params[property.path]),
|
|
25
25
|
async onChange(api, event) {
|
|
26
26
|
const data = await api.saver.save();
|
|
27
27
|
setJsonData(JSON.stringify(data));
|