diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx
index c8cbf8b..b2eb942 100644
--- a/src/editor/Editor.jsx
+++ b/src/editor/Editor.jsx
@@ -1,7 +1,7 @@
import React from 'preact/compat';
import { useState, useRef, useEffect } from 'preact/hooks';
import Environment from '../Environment';
-import DOMWidget from './DOMWidget';
+import DOMWidget from './widgets/DOMWidget';
import setPosition from './setPosition';
import i18n from '../i18n';
@@ -139,32 +139,21 @@ const Editor = props => {
}
};
- const widgets = props.widget ? props.widgets.map(fn => ) : [];
+ const widgets = props.widgets ? props.widgets.map(fn => ) : [];
return (
- {React.Children.map(props.children, child =>
- React.cloneElement(child, {
- ...child.props,
- annotation : currentAnnotation,
- readOnly : props.readOnly,
- onAppendBody,
- onUpdateBody,
- onRemoveBody,
- onSaveAndClose : onOk
- }))
- }
-
{widgets.map(widget =>
React.cloneElement(widget, {
annotation : currentAnnotation,
readOnly : props.readOnly,
+ config: props.config,
onAppendBody,
onUpdateBody,
onRemoveBody,
- onSaveAndClose : onOk
+ onSaveAndClose: onOk
})
)}
diff --git a/src/editor/index.js b/src/editor/index.js
index 4bf9280..9d69b35 100644
--- a/src/editor/index.js
+++ b/src/editor/index.js
@@ -3,6 +3,12 @@ import Editor from './Editor';
import CommentWidget from './widgets/comment/CommentWidget';
import TagWidget from './widgets/tag/TagWidget';
+/** Standard widgets included by default **/
+const DEFAULT_WIDGETS = {
+ COMMENT: CommentWidget,
+ TAG: TagWidget
+};
+
Editor.CommentWidget = CommentWidget;
Editor.TagWidget = TagWidget;
diff --git a/src/editor/DOMWidget.jsx b/src/editor/widgets/DOMWidget.jsx
similarity index 100%
rename from src/editor/DOMWidget.jsx
rename to src/editor/widgets/DOMWidget.jsx
diff --git a/src/editor/widgets/index.js b/src/editor/widgets/index.js
new file mode 100644
index 0000000..e69de29