@dxos/react-ui-editor 0.7.5-main.ff8607b → 0.7.5-staging.b81e783

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.
@@ -459,11 +459,10 @@ var defaultTheme = {
459
459
  /**
460
460
  * Gutters
461
461
  * NOTE: Gutters should have the same top margin as the content.
462
- * NOTE: They can't be transparent since the content needs to scroll below.
463
462
  */
464
463
  ".cm-gutters": {
465
- background: "var(--surface-bg)",
466
- borderRight: "none"
464
+ borderRight: "none",
465
+ background: "transparent"
467
466
  },
468
467
  ".cm-gutter": {},
469
468
  ".cm-gutter.cm-lineNumbers .cm-gutterElement": {
@@ -2047,7 +2046,7 @@ import sortBy from "lodash.sortby";
2047
2046
  import { useEffect, useMemo as useMemo2 } from "react";
2048
2047
  import { debounce as debounce2 } from "@dxos/async";
2049
2048
  import { log as log4 } from "@dxos/log";
2050
- import { nonNullable } from "@dxos/util";
2049
+ import { isNonNullable } from "@dxos/util";
2051
2050
 
2052
2051
  // packages/ui/react-ui-editor/src/extensions/selection.ts
2053
2052
  import { Transaction } from "@codemirror/state";
@@ -2172,7 +2171,7 @@ var commentsState = StateField4.define({
2172
2171
  comment,
2173
2172
  range
2174
2173
  };
2175
- }).filter(nonNullable);
2174
+ }).filter(isNonNullable);
2176
2175
  return {
2177
2176
  ...value,
2178
2177
  comments: commentStates
@@ -2224,7 +2223,7 @@ var commentsDecorations = EditorView9.decorations.compute([
2224
2223
  }
2225
2224
  const mark = createCommentMark(comment.comment.id, comment.comment.id === current);
2226
2225
  return mark.range(range.from, range.to);
2227
- }).filter(nonNullable);
2226
+ }).filter(isNonNullable);
2228
2227
  return Decoration4.set(decorations);
2229
2228
  });
2230
2229
  var commentClickedEffect = StateEffect3.define();
@@ -2495,7 +2494,7 @@ var comments = (options = {}) => {
2495
2494
  }
2496
2495
  }),
2497
2496
  options.onUpdate && trackPastedComments(options.onUpdate)
2498
- ].filter(nonNullable);
2497
+ ].filter(isNonNullable);
2499
2498
  };
2500
2499
  var scrollThreadIntoView = (view, id, center = true) => {
2501
2500
  const comment = view.state.field(commentsState).comments.find((range2) => range2.comment.id === id);
@@ -2665,7 +2664,6 @@ import defaultsDeep2 from "lodash.defaultsdeep";
2665
2664
  import merge from "lodash.merge";
2666
2665
  import { generateName } from "@dxos/display-name";
2667
2666
  import { log as log5 } from "@dxos/log";
2668
- import { hueTokens } from "@dxos/react-ui-theme";
2669
2667
  import { hexToHue, isNotFalsy as isNotFalsy3 } from "@dxos/util";
2670
2668
 
2671
2669
  // packages/ui/react-ui-editor/src/extensions/focus.ts
@@ -2764,7 +2762,14 @@ var createBasicExtensions = (_props) => {
2764
2762
  // https://codemirror.net/docs/ref/#commands.historyKeymap
2765
2763
  ...props.history ? historyKeymap : [],
2766
2764
  // https://codemirror.net/docs/ref/#search.searchKeymap
2767
- ...props.search ? searchKeymap : []
2765
+ ...props.search ? searchKeymap : [],
2766
+ // Disable bindings that conflict with system shortcuts.
2767
+ // TODO(burdon): Catalog global shortcuts.
2768
+ {
2769
+ key: "Mod-Shift-k",
2770
+ preventDefault: true,
2771
+ run: () => true
2772
+ }
2768
2773
  ].filter(isNotFalsy3))
2769
2774
  ].filter(isNotFalsy3);
2770
2775
  };
@@ -2795,15 +2800,15 @@ var createDataExtensions = ({ id, text, space, identity }) => {
2795
2800
  }
2796
2801
  if (space && identity) {
2797
2802
  const peerId = identity?.identityKey.toHex();
2798
- const { cursorLightValue, cursorDarkValue } = hueTokens[identity?.profile?.data?.hue ?? hexToHue(peerId ?? "0")];
2803
+ const hue = identity?.profile?.data?.hue ?? hexToHue(peerId ?? "0");
2799
2804
  extensions.push(awareness(new SpaceAwarenessProvider({
2800
2805
  space,
2801
2806
  channel: `awareness.${id}`,
2802
2807
  peerId: identity.identityKey.toHex(),
2803
2808
  info: {
2804
2809
  displayName: identity.profile?.displayName ?? generateName(identity.identityKey.toHex()),
2805
- darkColor: cursorDarkValue,
2806
- lightColor: cursorLightValue
2810
+ darkColor: `var(--dx-${hue}Cursor)`,
2811
+ lightColor: `var(--dx-${hue}Cursor)`
2807
2812
  }
2808
2813
  })));
2809
2814
  }