@editorcn/editor 0.3.5 → 0.3.6

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 CHANGED
@@ -1124,7 +1124,7 @@ var import_react7 = require("@tiptap/react");
1124
1124
  var import_react8 = require("react");
1125
1125
  var import_jsx_runtime20 = require("react/jsx-runtime");
1126
1126
  var RichTextEditorControl = ({
1127
- active,
1127
+ active = false,
1128
1128
  interactive: _interactive = true,
1129
1129
  className,
1130
1130
  children,
@@ -1175,12 +1175,9 @@ var createControl = ({
1175
1175
  const Control = ({ className }) => {
1176
1176
  const { editor, labels, icons } = useRichTextEditorContext();
1177
1177
  const ariaLabel = labels[label];
1178
- const editorState = (0, import_react7.useEditorState)({
1179
- editor: editor ?? null,
1180
- selector: createSelector(isActive, isDisabled)
1181
- });
1182
- const active = editorState?.active ?? false;
1183
- const disabled = editorState?.disabled ?? true;
1178
+ const selector = createSelector(isActive, isDisabled);
1179
+ (0, import_react7.useEditorState)({ editor: editor ?? null, selector });
1180
+ const { active, disabled } = selector({ editor: editor ?? null });
1184
1181
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1185
1182
  RichTextEditorControl,
1186
1183
  {