@dxos/react-ui-editor 0.3.11-main.ff3a851 → 0.3.11-next.e28df4f
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/lib/browser/index.mjs +9 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/comments.stories.d.ts +26 -0
- package/dist/types/src/components/TextEditor/comments.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/useTextModel.d.ts +0 -12
- package/dist/types/src/hooks/useTextModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/themes/default.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/components/TextEditor/TextEditor.tsx +4 -3
- package/src/components/TextEditor/comments.stories.tsx +357 -0
- package/src/extensions/awareness.ts +1 -4
- package/src/extensions/blast.ts +1 -4
- package/src/extensions/markdown/link.ts +2 -8
- package/src/hooks/useTextModel.ts +1 -17
- package/src/index.ts +1 -1
- package/src/themes/default.ts +2 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// packages/ui/react-ui-editor/src/index.ts
|
|
2
2
|
import { TextKind } from "@dxos/protocols/proto/dxos/echo/model/text";
|
|
3
3
|
import { Doc, YText, YXmlFragment } from "@dxos/text-model";
|
|
4
|
-
import { keymap as keymap7 } from "@codemirror/view";
|
|
5
4
|
|
|
6
5
|
// packages/ui/react-ui-editor/src/components/TextEditor/index.ts
|
|
7
6
|
import { tags as tags2 } from "@lezer/highlight";
|
|
@@ -14,7 +13,7 @@ import defaultsDeep2 from "lodash.defaultsdeep";
|
|
|
14
13
|
import React, { forwardRef, useCallback, useEffect as useEffect2, useImperativeHandle, useRef, useState } from "react";
|
|
15
14
|
import { log as log2 } from "@dxos/log";
|
|
16
15
|
import { useThemeContext } from "@dxos/react-ui";
|
|
17
|
-
import {
|
|
16
|
+
import { attentionSurface, mx as mx3 } from "@dxos/react-ui-theme";
|
|
18
17
|
import { isNotFalsy as isNotFalsy3 } from "@dxos/util";
|
|
19
18
|
|
|
20
19
|
// packages/ui/react-ui-editor/src/extensions/autocomplete.ts
|
|
@@ -783,7 +782,7 @@ var Blaster = class {
|
|
|
783
782
|
initialize() {
|
|
784
783
|
invariant(!this._canvas && !this._ctx, void 0, {
|
|
785
784
|
F: __dxlog_file,
|
|
786
|
-
L:
|
|
785
|
+
L: 138,
|
|
787
786
|
S: this,
|
|
788
787
|
A: [
|
|
789
788
|
"!this._canvas && !this._ctx",
|
|
@@ -820,7 +819,7 @@ var Blaster = class {
|
|
|
820
819
|
start() {
|
|
821
820
|
invariant(this._canvas && this._ctx, void 0, {
|
|
822
821
|
F: __dxlog_file,
|
|
823
|
-
L:
|
|
822
|
+
L: 177,
|
|
824
823
|
S: this,
|
|
825
824
|
A: [
|
|
826
825
|
"this._canvas && this._ctx",
|
|
@@ -2607,11 +2606,8 @@ var defaultTheme = {
|
|
|
2607
2606
|
"&dark .cm-cursor, &dark .cm-dropCursor": {
|
|
2608
2607
|
borderLeft: "2px solid white"
|
|
2609
2608
|
},
|
|
2610
|
-
"
|
|
2611
|
-
|
|
2612
|
-
},
|
|
2613
|
-
"&dark .cm-placeholder": {
|
|
2614
|
-
color: get3(tokens, "extend.semanticColors.description.dark", "rgba(255,255,255,.2)")
|
|
2609
|
+
".cm-placeholder": {
|
|
2610
|
+
fontWeight: 100
|
|
2615
2611
|
},
|
|
2616
2612
|
//
|
|
2617
2613
|
// line
|
|
@@ -2952,10 +2948,11 @@ var MarkdownEditor = /* @__PURE__ */ forwardRef(({ readonly, placeholder: placeh
|
|
|
2952
2948
|
});
|
|
2953
2949
|
var defaultSlots = {
|
|
2954
2950
|
root: {
|
|
2955
|
-
|
|
2951
|
+
// TODO(burdon): Add focusRing by default/as property?
|
|
2952
|
+
className: mx3("flex flex-col grow overflow-y-auto", attentionSurface)
|
|
2956
2953
|
},
|
|
2957
2954
|
editor: {
|
|
2958
|
-
className: "
|
|
2955
|
+
className: "h-full p-2"
|
|
2959
2956
|
}
|
|
2960
2957
|
};
|
|
2961
2958
|
var defaultTextSlots = {
|
|
@@ -3415,19 +3412,10 @@ var useTextModel = (props) => {
|
|
|
3415
3412
|
]);
|
|
3416
3413
|
return model;
|
|
3417
3414
|
};
|
|
3418
|
-
var useInMemoryTextModel = ({ id, defaultContent }) => {
|
|
3419
|
-
const [content, setContent] = useState4(defaultContent ?? "");
|
|
3420
|
-
return {
|
|
3421
|
-
id,
|
|
3422
|
-
content,
|
|
3423
|
-
setContent,
|
|
3424
|
-
text: () => content
|
|
3425
|
-
};
|
|
3426
|
-
};
|
|
3427
3415
|
var createModel = ({ space, identity, text }) => {
|
|
3428
3416
|
invariant3(isAutomergeObject(text), void 0, {
|
|
3429
3417
|
F: __dxlog_file6,
|
|
3430
|
-
L:
|
|
3418
|
+
L: 34,
|
|
3431
3419
|
S: void 0,
|
|
3432
3420
|
A: [
|
|
3433
3421
|
"isAutomergeObject(text)",
|
|
@@ -3511,7 +3499,6 @@ export {
|
|
|
3511
3499
|
image,
|
|
3512
3500
|
insertCodeblock,
|
|
3513
3501
|
insertTable,
|
|
3514
|
-
keymap7 as keymap,
|
|
3515
3502
|
link,
|
|
3516
3503
|
listener,
|
|
3517
3504
|
logChanges,
|
|
@@ -3538,7 +3525,6 @@ export {
|
|
|
3538
3525
|
useActionHandler,
|
|
3539
3526
|
useComments,
|
|
3540
3527
|
useEditorView,
|
|
3541
|
-
useInMemoryTextModel,
|
|
3542
3528
|
useTextEditor,
|
|
3543
3529
|
useTextModel,
|
|
3544
3530
|
useToolbarContext
|