@dxos/react-ui-editor 0.3.11-main.f14932f → 0.3.11-main.f437bee

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.
@@ -2531,7 +2531,7 @@ var EditorModes = [
2531
2531
  "default",
2532
2532
  "vim"
2533
2533
  ];
2534
- var BaseTextEditor = /* @__PURE__ */ forwardRef(({ model, focus, readonly, comments: comments2, extensions = [], editorMode, slots = defaultSlots }, forwardedRef) => {
2534
+ var BaseTextEditor = /* @__PURE__ */ forwardRef(({ model, focus, selection, readonly, comments: comments2, extensions = [], editorMode, slots = defaultSlots }, forwardedRef) => {
2535
2535
  const tabsterDOMAttribute = useFocusableGroup({
2536
2536
  tabBehavior: "limited"
2537
2537
  });
@@ -2542,12 +2542,12 @@ var BaseTextEditor = /* @__PURE__ */ forwardRef(({ model, focus, readonly, comme
2542
2542
  view
2543
2543
  ]);
2544
2544
  useEffect(() => {
2545
- if (focus && view) {
2545
+ if (view && focus) {
2546
2546
  view.focus();
2547
2547
  }
2548
2548
  }, [
2549
- focus,
2550
- view
2549
+ view,
2550
+ focus
2551
2551
  ]);
2552
2552
  const { awareness: awareness2, peer } = model;
2553
2553
  useEffect(() => {
@@ -2589,6 +2589,7 @@ var BaseTextEditor = /* @__PURE__ */ forwardRef(({ model, focus, readonly, comme
2589
2589
  }
2590
2590
  const state = EditorState2.create({
2591
2591
  doc: model.text(),
2592
+ selection,
2592
2593
  extensions: [
2593
2594
  readonly && EditorState2.readOnly.of(readonly),
2594
2595
  // TODO(burdon): Factor out VIM mode? (manage via MarkdownPlugin).