@dxos/react-ui-editor 0.3.9-main.c414ce0 → 0.3.9-main.c64f707

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.
@@ -9,11 +9,12 @@ import { tags as tags2 } from "@lezer/highlight";
9
9
  import { closeBrackets } from "@codemirror/autocomplete";
10
10
  import { bracketMatching, defaultHighlightStyle, syntaxHighlighting } from "@codemirror/language";
11
11
  import { oneDarkHighlightStyle } from "@codemirror/theme-one-dark";
12
- import { placeholder } from "@codemirror/view";
12
+ import { EditorView, placeholder } from "@codemirror/view";
13
13
  var basicBundle = ({ themeMode, placeholder: _placeholder }) => [
14
14
  bracketMatching(),
15
15
  closeBrackets(),
16
16
  _placeholder && placeholder(_placeholder),
17
+ EditorView.lineWrapping,
17
18
  // TODO(burdon): Is this required?
18
19
  themeMode === "dark" ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle)
19
20
  ].filter(Boolean);
@@ -91,7 +92,7 @@ var onChangeExtension = (onChange) => StateField.define({
91
92
  // packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts
92
93
  import { syntaxTree } from "@codemirror/language";
93
94
  import { RangeSetBuilder, StateField as StateField2 } from "@codemirror/state";
94
- import { Decoration, EditorView, WidgetType } from "@codemirror/view";
95
+ import { Decoration, EditorView as EditorView2, WidgetType } from "@codemirror/view";
95
96
  var Link = class extends WidgetType {
96
97
  constructor(_anchor, _text, _url) {
97
98
  super();
@@ -125,7 +126,7 @@ var hyperlinkDecoration = ({ link } = {}) => {
125
126
  return StateField2.define({
126
127
  create: (state) => update(state, link),
127
128
  update: (_, tr) => update(tr.state, link),
128
- provide: (field) => EditorView.decorations.from(field)
129
+ provide: (field) => EditorView2.decorations.from(field)
129
130
  });
130
131
  };
131
132
  var update = (state, link) => {
@@ -195,7 +196,7 @@ var createHyperlinkTooltip = (onHover, regexp = markdownLinkRegexp) => hoverTool
195
196
  });
196
197
 
197
198
  // packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx
198
- import { Decoration as Decoration2, EditorView as EditorView2, MatchDecorator, ViewPlugin } from "@codemirror/view";
199
+ import { Decoration as Decoration2, EditorView as EditorView3, MatchDecorator, ViewPlugin } from "@codemirror/view";
199
200
  var markdownLinkRegexp2 = /\[([^\]]+)]\(([^)]+)\)(!?)/gi;
200
201
  var linkDecorator = () => new MatchDecorator({
201
202
  regexp: markdownLinkRegexp2,
@@ -269,7 +270,7 @@ function hyperLinkExtension() {
269
270
  }
270
271
  });
271
272
  }
272
- var hyperlinkStyle = EditorView2.baseTheme({
273
+ var hyperlinkStyle = EditorView3.baseTheme({
273
274
  ".cm-hyperlink-label": {
274
275
  cursor: "pointer",
275
276
  textDecoration: "underline"
@@ -297,7 +298,7 @@ import { lintKeymap } from "@codemirror/lint";
297
298
  import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
298
299
  import { EditorState } from "@codemirror/state";
299
300
  import { oneDarkHighlightStyle as oneDarkHighlightStyle2 } from "@codemirror/theme-one-dark";
300
- import { crosshairCursor, drawSelection, dropCursor, EditorView as EditorView3, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, placeholder as placeholder2, rectangularSelection } from "@codemirror/view";
301
+ import { crosshairCursor, drawSelection, dropCursor, EditorView as EditorView4, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, placeholder as placeholder2, rectangularSelection } from "@codemirror/view";
301
302
 
302
303
  // packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts
303
304
  import { styleTags, Tag } from "@lezer/highlight";
@@ -640,7 +641,7 @@ var markdownBundle = ({ themeMode, placeholder: _placeholder }) => {
640
641
  closeBrackets2(),
641
642
  _placeholder && placeholder2(_placeholder),
642
643
  EditorState.allowMultipleSelections.of(true),
643
- EditorView3.lineWrapping,
644
+ EditorView4.lineWrapping,
644
645
  // autocompletion(),
645
646
  crosshairCursor(),
646
647
  dropCursor(),
@@ -685,7 +686,7 @@ var markdownBundle = ({ themeMode, placeholder: _placeholder }) => {
685
686
 
686
687
  // packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx
687
688
  import { EditorState as EditorState2 } from "@codemirror/state";
688
- import { EditorView as EditorView4 } from "@codemirror/view";
689
+ import { EditorView as EditorView5 } from "@codemirror/view";
689
690
  import { useFocusableGroup } from "@fluentui/react-tabster";
690
691
  import { vim } from "@replit/codemirror-vim";
691
692
  import defaultsDeep from "lodash.defaultsdeep";
@@ -1223,14 +1224,14 @@ var BaseTextEditor = /* @__PURE__ */ forwardRef(({ model, extensions = [], slots
1223
1224
  // Replication.
1224
1225
  collaboration,
1225
1226
  // Theme.
1226
- slots?.editor?.theme && EditorView4.theme(slots?.editor?.theme),
1227
+ slots?.editor?.theme && EditorView5.theme(slots?.editor?.theme),
1227
1228
  // Custom.
1228
1229
  ...extensions
1229
1230
  ].filter(Boolean)
1230
1231
  });
1231
1232
  setState(state2);
1232
1233
  view?.destroy();
1233
- setView(new EditorView4({
1234
+ setView(new EditorView5({
1234
1235
  state: state2,
1235
1236
  parent
1236
1237
  }));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/index.ts", "../../../src/components/TextEditor/index.ts", "../../../src/components/TextEditor/extensions/basic/bundle.ts", "../../../src/components/TextEditor/extensions/basic/theme.ts", "../../../src/styles/markdown.ts", "../../../src/styles/tokens.ts", "../../../src/components/TextEditor/extensions/change.ts", "../../../src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts", "../../../src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx", "../../../src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx", "../../../src/components/TextEditor/extensions/markdown/bundle.ts", "../../../src/components/TextEditor/extensions/markdown/tags.ts", "../../../src/components/TextEditor/extensions/markdown/theme.ts", "../../../src/components/TextEditor/TextEditor.tsx", "../../../src/hooks/useCollaboration.ts", "../../../src/automerge/automerge-plugin/plugin.ts", "../../../src/automerge/automerge-plugin/PatchSemaphore.ts", "../../../src/automerge/automerge-plugin/amToCodemirror.ts", "../../../src/automerge/automerge-plugin/codeMirrorToAm.ts", "../../../src/hooks/useTextModel.ts", "../../../src/hooks/yjs/cursors.ts", "../../../src/hooks/yjs/space-provider.ts"],
4
- "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nexport { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';\nexport { Doc, YText, YXmlFragment } from '@dxos/text-model';\n\nexport * from './components';\nexport * from './hooks';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport { tags } from '@lezer/highlight';\n\nexport * from './extensions';\nexport * from './TextEditor';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { closeBrackets } from '@codemirror/autocomplete';\nimport { bracketMatching, defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport { placeholder } from '@codemirror/view';\n\nimport type { ThemeMode } from '@dxos/react-ui';\n\nexport type BasicBundleOptions = {\n themeMode?: ThemeMode;\n placeholder?: string;\n};\n\nexport const basicBundle = ({ themeMode, placeholder: _placeholder }: BasicBundleOptions): Extension[] =>\n [\n bracketMatching(),\n closeBrackets(),\n _placeholder && placeholder(_placeholder),\n\n // TODO(burdon): Is this required?\n themeMode === 'dark' ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle),\n ].filter(Boolean) as Extension[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport get from 'lodash.get';\nimport { type StyleSpec } from 'style-mod';\n\nimport { tokens } from '../../../../styles';\n\n/**\n * Minimal styles.\n * NOTE: The '&' prefix denotes the CM editor root.\n * https://codemirror.net/examples/styling\n */\n// TODO(burdon): Remove?\nexport const basicTheme: {\n [selector: string]: StyleSpec;\n} = {\n '&.cm-focused': {\n outline: 'none',\n },\n '& .cm-line': {\n paddingInline: 0,\n lineHeight: 1.6,\n minBlockSize: '1.6em',\n },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '& .cm-scroller': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n overflow: 'visible',\n },\n '& .cm-content': {\n padding: 0,\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: 'white',\n },\n '& .cm-tooltip': {\n backgroundColor: 'transparent',\n border: 'none',\n },\n '& .cm-link': {\n color: get(tokens, 'extend.colors.primary.500'),\n textDecoration: 'underline',\n },\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport const heading: Record<HeadingLevel, string> = {\n 1: 'mbs-4 mbe-2 text-4xl font-semibold text-inherit no-underline',\n 2: 'mbs-4 mbe-2 text-3xl font-bold text-inherit no-underline',\n 3: 'mbs-4 mbe-2 text-2xl font-bold text-inherit no-underline',\n 4: 'mbs-4 mbe-2 text-xl font-extrabold text-inherit no-underline',\n 5: 'mbs-4 mbe-2 text-lg font-extrabold text-inherit no-underline',\n 6: 'mbs-4 mbe-2 font-black text-inherit no-underline',\n};\n\nexport const blockquote = 'mlb-2 border-is-4 border-neutral-500/50 pis-5';\n\n// TODO(thure): Tailwind was not seeing `[&>li:before]:content-[\"•\"]` as a utility class, but it would work if instead of `\"•\"` it was `\"X\"`… why?\nexport const unorderedList =\n 'mlb-2 grid grid-cols-[min-content_1fr] [&>li:before]:content-[attr(marker)] [&>li:before]:mlb-1 [&>li:before]:mie-2';\nexport const orderedList =\n 'mlb-2 grid grid-cols-[min-content_1fr] [&>li:before]:content-[counters(section,_\".\")_\"._\"] [counter-reset:section] [&>li:before]:mlb-1';\n\nexport const listItem = 'contents before:[counter-increment:section]';\n\nexport const codeBlock = 'mlb-2 font-mono bg-neutral-500/10 p-3 rounded';\n\nexport const horizontalRule = 'mlb-4 border-neutral-500/50';\n\nexport const paragraph = 'mlb-1';\n\nexport const bold = 'font-bold';\n\nexport const code = 'font-mono bg-neutral-500/10 rounded pli-0.5 plb-0.5 -mlb-0.5';\n\nexport const placeholder = 'font-mono';\n\nexport const codeWithoutMarks = mx(code, 'pli-1.5 mli-0.5');\n\nexport const italic = 'italic';\n\nexport const strikethrough = 'line-through';\n\nexport const mark = '!font-normal !no-underline !text-inherit opacity-40';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { StyleSpec } from 'style-mod';\n\nimport { tailwindConfig, type TailwindConfig } from '@dxos/react-ui-theme';\n\nexport type ThemeStyles = {\n [selector: string]: StyleSpec;\n};\n\n// TODO(thure): Why export the whole theme? Can this be done differently?\nexport const tokens: TailwindConfig['theme'] = tailwindConfig({}).theme;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StateField } from '@codemirror/state';\n\n/**\n * Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799\n * @param onChange\n */\n// TODO(burdon): Name?\nexport const onChangeExtension = (onChange: (text: string) => void) =>\n StateField.define({\n create: () => null,\n update: (_value, transaction) => {\n if (transaction.docChanged && onChange) {\n onChange(transaction.newDoc.toString());\n }\n\n return null;\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n// Copyright CodeMirror\n//\n\nimport { syntaxTree } from '@codemirror/language';\nimport { type EditorState, type RangeSet, RangeSetBuilder, StateField, type Transaction } from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType } from '@codemirror/view';\n\n// Adapted from:\n// https://codemirror.net/try/?c=aW1wb3J0IHsgYmFzaWNTZXR1cCwgRWRpdG9yVmlldyB9IGZyb20gImNvZGVtaXJyb3IiCmltcG9ydCB7IG1hcmtkb3duIH0gZnJvbSAiQGNvZGVtaXJyb3IvbGFuZy1tYXJrZG93biIKaW1wb3J0IHsgc3ludGF4VHJlZSB9IGZyb20gIkBjb2RlbWlycm9yL2xhbmd1YWdlIjsKaW1wb3J0IHsgRWRpdG9yU3RhdGUsIFJhbmdlU2V0QnV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h0ID0gbWFya3MubGVuZ3RoID49IDIgPyB0ci5zdGF0ZS5zbGljZURvYyhtYXJrc1swXS50bywgbWFya3NbMV0uZnJvbSkgOiAiIgoKICAgICAgICAgIGxldCB1cmxOb2RlID0gbm9kZS5ub2RlLmdldENoaWxkKCJVUkwiKTsKICAgICAgICAgIGxldCB1cmwgPSB1cmxOb2RlID8gdHIuc3RhdGUuc2xpY2VEb2ModXJsTm9kZS5mcm9tLCB1cmxOb2RlLnRvKSA6ICIiCiAgICAgICAgICBidWlsZGVyLmFkZChub2RlLmZyb20sIG5vZGUudG8sIERlY29yYXRpb24ucmVwbGFjZSh7CiAgICAgICAgICAgIHdpZGdldDogbmV3IExpbmsodGV4dCwgdXJsKSwKICAgICAgICAgIH0pLAogICAgICAgICAgICAgICAgICAgICApOwogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgfSwKICAgIH0pOwogICAgcmV0dXJuIGJ1aWxkZXIuZmluaXNoKCk7CiAgfSwKICBwcm92aWRlOiAoZikgPT4gRWRpdG9yVmlldy5kZWNvcmF0aW9ucy5mcm9tKGYpLAp9KTsKCmxldCB2aWV3ID0gbmV3IEVkaXRvclZpZXcoewogIGRvYzogIiMgSGVsbG8gV29ybGRcblxuW1Rlc3RdKGh0dHBzOi8vZXhhbXBsZS5jb20pXG5cblxuIiwKICBleHRlbnNpb25zOiBbZGVjb3JhdGlvbnNGaWVsZCwgbWFya2Rvd24oKV0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5LAp9KTsKCnZpZXcuZm9jdXMoKTs=\n// https://discuss.codemirror.net/t/link-widget-is-clicked-only-if-editor-is-out-of-focus/7433\n\n// TODO(burdon): Adapt to make all markdown editable?\n\n// TODO(burdon): Research overlays.\n// https://stackoverflow.com/questions/26933344/codemirror-detect-and-create-links-inside-editor\n// https://codemirror.net/5/doc/manual.html#addOverlay\n// https://codemirror.net/5/demo/simplemode.html\n// https://codemirror.net/5/demo/search.html (Search dialog).\n\nclass Link extends WidgetType {\n constructor(private readonly _anchor: number, private readonly _text: string, private readonly _url?: string) {\n super();\n }\n\n override eq(other: any) {\n return this._text === other.text && this._url === other.url;\n }\n\n toDOM(view: EditorView) {\n const link = document.createElement('a');\n link.setAttribute('class', 'cm-link');\n link.textContent = this._text;\n if (this._url) {\n link.setAttribute('target', '_blank');\n link.href = this._url;\n } else {\n link.onclick = () => {\n view.dispatch({\n selection: {\n anchor: this._anchor,\n },\n });\n };\n }\n\n return link;\n }\n}\n\ntype HyperlinkDecorationConfig = {\n link?: boolean;\n};\n\n/**\n * Creates a state field to replace AST elements with a hyperlink widget.\n * https://codemirror.net/docs/ref/#state.StateField\n */\nexport const hyperlinkDecoration = ({ link }: HyperlinkDecorationConfig = {}) => {\n return StateField.define<RangeSet<any>>({\n create: (state) => update(state, link),\n update: (_: RangeSet<any>, tr: Transaction) => update(tr.state, link),\n provide: (field) => EditorView.decorations.from(field),\n });\n};\n\nconst update = (state: EditorState, link?: boolean) => {\n const builder = new RangeSetBuilder();\n const cursor = state.selection.main.head;\n syntaxTree(state).iterate({\n enter: (node) => {\n // Check if cursor is inside text.\n if (cursor < node.from || cursor > node.to) {\n if (node.name === 'Link') {\n const marks = node.node.getChildren('LinkMark');\n const text = marks.length >= 2 ? state.sliceDoc(marks[0].to, marks[1].from) : '';\n\n const urlNode = node.node.getChild('URL');\n const url = urlNode ? state.sliceDoc(urlNode.from, urlNode.to) : '';\n\n builder.add(\n node.from,\n node.to,\n Decoration.replace({\n widget: new Link(node.from, text, link ? url : undefined),\n }),\n );\n\n return false;\n }\n }\n\n return true;\n },\n });\n\n return builder.finish();\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { hoverTooltip } from '@codemirror/view';\n\nimport { tooltipContent } from '@dxos/react-ui-theme';\n\nconst markdownLinkRegexp = /\\[([^\\]]+)]\\(([^)]+)\\)/;\n\nexport type OnHyperlinkHover = (el: Element, url: string) => void;\n\n/**\n * https://codemirror.net/examples/tooltip\n * https://codemirror.net/docs/ref/#view.hoverTooltip\n * https://github.com/codemirror/view/blob/main/src/tooltip.ts\n */\n// TODO(burdon): Create config object.\nexport const createHyperlinkTooltip = (onHover: OnHyperlinkHover, regexp = markdownLinkRegexp) =>\n hoverTooltip((view, pos) => {\n const { from, text } = view.state.doc.lineAt(pos);\n const p = pos - from;\n\n let idx = 0;\n let match;\n do {\n match = text.substring(idx).match(regexp);\n if (!match) {\n match = undefined;\n break;\n }\n\n idx = text.indexOf(match[0]);\n if (p >= idx && p < idx + match[0].length) {\n break;\n }\n\n idx += match[0].length;\n } while (true);\n\n if (!match) {\n return null;\n }\n\n const [, , url] = match ?? [];\n\n return {\n pos: idx + from,\n end: idx + from + match[0].length,\n above: true,\n create: () => {\n const el = document.createElement('a');\n el.innerText = '_'; // Required so doesn't collapse.\n el.className = tooltipContent({}, 'mb-2 p-1');\n el.setAttribute('target', '_blank');\n el.setAttribute('href', url);\n onHover(el, url);\n return { dom: el };\n },\n };\n });\n", "//\n// Copyright 2023 DXOS.org\n// Adapted from: https://github.com/uiwjs/react-codemirror/blob/master/extensions/hyper-link/src/index.ts\n//\n\nimport { type Extension } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n MatchDecorator,\n ViewPlugin,\n type ViewUpdate,\n} from '@codemirror/view';\n\n// Notes: Can't edit widget content (or cursor nav through them).\n// - https://discuss.codemirror.net/t/focusing-inputs-within-widgets/5178/7\n// Widgets intentionally always get set to contenteditable=false,\n// or they would become part of CodeMirror’s editable content element.\n// You should be able to introduce new contenteditable=true child elements inside of them.\n\nconst markdownLinkRegexp = /\\[([^\\]]+)]\\(([^)]+)\\)(!?)/gi;\n\n/**\n * Custom link decorator.\n * NOTE: The default markdown extension formats links by default.\n * @deprecated\n */\nconst linkDecorator = () =>\n new MatchDecorator({\n regexp: markdownLinkRegexp,\n decorate: (add, from, to, match, view) => {\n const [_, label, url] = match;\n const p0 = {\n start: from,\n end: from + 1,\n };\n\n const p1 = {\n start: from + 1,\n end: from + 1 + label.length,\n };\n\n const p2 = {\n start: p1.end,\n end: p1.end + 1,\n };\n\n const p3 = {\n start: p1.end + 1,\n end: p1.end + 1 + url.length + 2,\n };\n\n add(\n p0.start,\n p0.end,\n Decoration.mark({ class: 'cm-hyperlink-bracket', _attributes: { style: 'display: none' } }),\n );\n add(p1.start, p1.end, Decoration.mark({ class: 'cm-hyperlink-label' }));\n add(\n p2.start,\n p2.end,\n Decoration.mark({ class: 'cm-hyperlink-bracket', _attributes: { style: 'display: none' } }),\n );\n add(p3.start, p3.end, Decoration.mark({ class: 'cm-hyperlink-url', _attributes: { style: 'display: none' } }));\n },\n });\n\nexport function hyperLinkExtension() {\n return ViewPlugin.fromClass(\n class HyperLinkView {\n readonly decorator: MatchDecorator;\n decorations: DecorationSet;\n constructor(view: EditorView) {\n this.decorator = linkDecorator();\n this.decorations = this.decorator.createDeco(view);\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged) {\n this.decorations = this.decorator.updateDeco(update, this.decorations);\n }\n }\n },\n {\n decorations: (view) => view.decorations,\n eventHandlers: {\n // TODO(burdon): CLick to expand link.\n // https://discuss.codemirror.net/t/decorator-iteration-on-click-event/4226/2\n mousedown: function (event, view) {\n const pos = view.posAtDOM(event.target as Node);\n if (pos !== 0) {\n console.log(this);\n }\n },\n // TODO(burdon): Hide when cursor moves away.\n keydown: (event, view) => {\n view.update([]);\n },\n },\n },\n );\n}\n\nexport const hyperlinkStyle = EditorView.baseTheme({\n '.cm-hyperlink-label': {\n cursor: 'pointer',\n textDecoration: 'underline',\n },\n '.cm-hyperlink-bracket': {\n opacity: 0.2,\n },\n '.cm-hyperlink-url': {\n opacity: 0.5,\n fontFamily: 'monospace',\n },\n});\n\nexport const hyperlinkWidget: Extension = [hyperLinkExtension(), hyperlinkStyle];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';\nimport { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport { markdownLanguage, markdown } from '@codemirror/lang-markdown';\nimport {\n bracketMatching,\n defaultHighlightStyle,\n foldKeymap,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { lintKeymap } from '@codemirror/lint';\nimport { highlightSelectionMatches, searchKeymap } from '@codemirror/search';\nimport { EditorState, type Extension } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport {\n crosshairCursor,\n drawSelection,\n dropCursor,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n highlightSpecialChars,\n keymap,\n placeholder,\n rectangularSelection,\n} from '@codemirror/view';\n// import { GFM } from '@lezer/markdown';\n\nimport type { ThemeMode } from '@dxos/react-ui';\n\nimport { markdownTagsExtension } from './tags';\nimport { markdownHighlightStyle } from './theme';\n\nexport type MarkdownBundleOptions = {\n themeMode?: ThemeMode;\n placeholder?: string;\n};\n\nexport const markdownBundle = ({ themeMode, placeholder: _placeholder }: MarkdownBundleOptions): Extension[] => {\n // All of https://github.com/codemirror/basic-setup minus line numbers and fold gutter.\n // https://codemirror.net/docs/ref/#codemirror.basicSetup\n return [\n bracketMatching(),\n closeBrackets(),\n _placeholder && placeholder(_placeholder),\n\n EditorState.allowMultipleSelections.of(true),\n EditorView.lineWrapping,\n\n // autocompletion(),\n crosshairCursor(),\n dropCursor(),\n drawSelection(),\n highlightActiveLine(),\n highlightActiveLineGutter(),\n highlightSelectionMatches(),\n highlightSpecialChars(),\n history(),\n indentOnInput(),\n rectangularSelection(),\n\n keymap.of([\n ...closeBracketsKeymap,\n // ...completionKeymap,\n ...defaultKeymap,\n ...foldKeymap,\n ...historyKeymap,\n ...lintKeymap,\n ...searchKeymap,\n indentWithTab,\n ]),\n\n // Main extension.\n // https://github.com/codemirror/lang-markdown\n markdown({\n base: markdownLanguage,\n codeLanguages: languages,\n extensions: [\n // TODO(burdon): This seems to upgrade the parser.\n // GitHub flavored markdown bundle: Table, TaskList, Strikethrough, and Autolink.\n // https://github.com/lezer-parser/markdown?tab=readme-ov-file#github-flavored-markdown\n // https://github.github.com/gfm\n // GFM,\n\n // Custom styling.\n markdownTagsExtension,\n ],\n }),\n\n // TODO(thure): All but one rule here apply to both themes; rename or refactor.\n syntaxHighlighting(markdownHighlightStyle),\n themeMode === 'dark' ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle),\n ].filter(Boolean) as Extension[];\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { styleTags, Tag } from '@lezer/highlight';\nimport { type MarkdownConfig } from '@lezer/markdown';\n\nexport const markdownTags = {\n headingMark: Tag.define(),\n quoteMark: Tag.define(),\n listMark: Tag.define(),\n linkMark: Tag.define(),\n emphasisMark: Tag.define(),\n codeMark: Tag.define(),\n codeText: Tag.define(),\n inlineCode: Tag.define(),\n url: Tag.define(),\n linkReference: Tag.define(),\n linkLabel: Tag.define(),\n};\n\nexport const markdownTagsExtension: MarkdownConfig = {\n props: [\n styleTags({\n HeaderMark: markdownTags.headingMark,\n QuoteMark: markdownTags.quoteMark,\n ListMark: markdownTags.listMark,\n LinkMark: markdownTags.linkMark,\n EmphasisMark: markdownTags.emphasisMark,\n CodeMark: markdownTags.codeMark,\n CodeText: markdownTags.codeText,\n InlineCode: markdownTags.inlineCode,\n URL: markdownTags.url,\n LinkReference: markdownTags.linkReference,\n LinkLabel: markdownTags.linkLabel,\n }),\n ],\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { markdownLanguage } from '@codemirror/lang-markdown';\nimport { HighlightStyle } from '@codemirror/language';\nimport { tags } from '@lezer/highlight';\nimport get from 'lodash.get';\n\nimport { markdownTags } from './tags';\nimport { bold, heading, italic, mark, strikethrough, tokens, type ThemeStyles } from '../../../../styles';\n\n// TODO(burdon): Rationalize theme/colors. Hoist onto single property object.\nexport const chalky = '#e5c07b';\nexport const coral = '#e06c75';\nexport const cyan = '#56b6c2';\nexport const invalid = '#ffffff';\nexport const ivory = '#abb2bf';\nexport const stone = '#7d8799';\nexport const malibu = '#61afef';\nexport const sage = '#98c379';\nexport const whiskey = '#d19a66';\nexport const violet = '#c678dd';\nconst _darkBackground = '#21252b';\nexport const highlightBackground = '#2c313a';\nconst _background = '#282c34';\nexport const tooltipBackground = '#353a42';\nconst _selection = '#3E4451';\n\nconst monospace = get(tokens, 'fontFamily.mono', ['monospace']).join(',');\n\n/**\n * NOTE: The '&' prefix denotes the CM editor root.\n * https://codemirror.net/examples/styling\n */\nexport const markdownTheme: ThemeStyles = {\n // TODO(thure): Consider whether these commented-out rules from one-dark-theme should be integrated.\n // '&': {\n // color: ivory,\n // backgroundColor: background\n // },\n // '.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },\n // '&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {\n // backgroundColor: selection\n // },\n // '.cm-panels': { backgroundColor: darkBackground, color: ivory },\n // '.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },\n // '.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },\n // '.cm-searchMatch': {\n // backgroundColor: '#72a1ff59',\n // outline: '1px solid #457dff'\n // },\n // '.cm-searchMatch.cm-searchMatch-selected': {\n // backgroundColor: '#6199ff2f'\n // },\n // '.cm-activeLine': { backgroundColor: '#6699ff0b' },\n // '.cm-selectionMatch': { backgroundColor: '#aafe661a' },\n // '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {\n // backgroundColor: '#bad0f847'\n // },\n // '.cm-gutters': {\n // backgroundColor: background,\n // color: stone,\n // border: 'none'\n // },\n // '.cm-activeLineGutter': {\n // backgroundColor: highlightBackground\n // },\n // '.cm-foldPlaceholder': {\n // backgroundColor: 'transparent',\n // border: 'none',\n // color: '#ddd'\n // },\n\n '& .cm-tooltip': {\n backgroundColor: 'transparent',\n border: 'none',\n },\n // '.dark & .cm-tooltip': {\n // border: 'none',\n // backgroundColor: tooltipBackground,\n // },\n // '.dark & .cm-tooltip .cm-tooltip-arrow:before': {\n // borderTopColor: 'transparent',\n // borderBottomColor: 'transparent',\n // },\n // '.dark & .cm-tooltip .cm-tooltip-arrow:after': {\n // borderTopColor: tooltipBackground,\n // borderBottomColor: tooltipBackground,\n // },\n // '.dark & .cm-tooltip-autocomplete': {\n // '& > ul > li[aria-selected]': {\n // backgroundColor: highlightBackground,\n // color: ivory,\n // },\n // },\n '&.cm-focused': {\n outline: 'none',\n },\n '& .cm-line': {\n paddingInline: 0,\n lineHeight: 1.6,\n minBlockSize: '1.6em',\n },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '&.cm-focused .cm-selectionBackground, & .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.150', '#00ffff'),\n },\n '.dark & .cm-selectionBackground, .dark &.cm-focused .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.850', '#00ffff'),\n },\n '& .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.250', '#00ffff') + '44',\n },\n '.dark & .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.600', '#00ffff') + '44',\n },\n '& .cm-content': {\n padding: 0,\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: 'white',\n },\n '& .cm-cursor': {\n borderLeftColor: 'black',\n },\n '.dark & .cm-cursor': {\n borderLeftColor: 'white',\n },\n '.cm-placeholder': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n },\n '& .cm-scroller': {\n fontFamily: get(tokens, 'fontFamily.mono', []).join(','),\n overflow: 'visible',\n },\n '& .cm-activeLine': {\n backgroundColor: 'transparent',\n },\n '.dark & .cm-activeLine': {\n backgroundColor: 'transparent',\n },\n '& .cm-ySelectionInfo': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n padding: '2px 4px',\n marginBlockStart: '-4px',\n },\n '& .cm-ySelection, & .cm-selectionMatch': {\n paddingBlockStart: '.15em',\n paddingBlockEnd: '.15em',\n },\n '& .cm-ySelection, & .cm-yLineSelection': {\n mixBlendMode: 'multiply',\n },\n '.dark & .cm-ySelection, .dark & .cm-yLineSelection': {\n mixBlendMode: 'screen',\n },\n '& .cm-ySelectionCaret': {\n display: 'inline-block',\n insetBlockStart: '.1em',\n blockSize: '1.4em',\n verticalAlign: 'top',\n },\n '& .cm-yLineSelection': {\n margin: '0',\n },\n '.cm-link': {\n color: 'rgb(20 89 208)', // TODO(burdon): Rationalize.\n textDecorationLine: 'underline',\n textDecorationThickness: '1px',\n textUnderlineOffset: '2px',\n borderRadius: '.125rem',\n },\n // TODO(burdon): Document.\n ...Object.keys(get(tokens, 'extend.fontSize', {})).reduce((acc: Record<string, any>, fontSize) => {\n const height = get(tokens, ['extend', 'fontSize', fontSize, 1, 'lineHeight']);\n // TODO(thure): This appears to be the best or only way to set selection caret heights, but it's far more verbose than it needs to be.\n acc[`& .text-${fontSize} + .cm-ySelectionCaret`] = { height };\n acc[`& .text-${fontSize} + .cm-ySelection + .cm-ySelectionCaret`] = { height };\n acc[`& .text-${fontSize} + .cm-widgetBuffer + .cm-ySelectionCaret`] = { height };\n return acc;\n }, {}),\n};\n\nexport const markdownHighlightStyle = HighlightStyle.define(\n [\n {\n tag: [\n tags.keyword,\n tags.name,\n tags.deleted,\n tags.character,\n tags.propertyName,\n tags.macroName,\n tags.color,\n tags.constant(tags.name),\n tags.standard(tags.name),\n tags.definition(tags.name),\n tags.separator,\n tags.typeName,\n tags.className,\n tags.number,\n tags.changed,\n tags.annotation,\n tags.modifier,\n tags.self,\n tags.namespace,\n tags.operator,\n tags.operatorKeyword,\n tags.escape,\n tags.regexp,\n tags.special(tags.string),\n tags.meta,\n tags.comment,\n tags.atom,\n tags.bool,\n tags.special(tags.variableName),\n tags.processingInstruction,\n tags.string,\n tags.inserted,\n tags.invalid,\n ],\n color: 'inherit !important',\n },\n {\n tag: [tags.link, tags.url],\n color: 'inherit !important',\n textDecoration: 'none !important',\n },\n {\n tag: [tags.function(tags.variableName), tags.labelName],\n color: malibu,\n fontFamily: monospace,\n },\n {\n tag: [\n markdownTags.codeMark,\n markdownTags.emphasisMark,\n markdownTags.headingMark,\n markdownTags.linkLabel,\n markdownTags.linkReference,\n markdownTags.listMark,\n markdownTags.quoteMark,\n markdownTags.url,\n tags.meta,\n tags.processingInstruction,\n ],\n class: mark,\n },\n { tag: [markdownTags.codeText, markdownTags.inlineCode], class: 'font-mono' },\n { tag: tags.emphasis, class: italic },\n { tag: tags.heading1, class: heading[1] },\n { tag: tags.heading2, class: heading[2] },\n { tag: tags.heading3, class: heading[3] },\n { tag: tags.heading4, class: heading[4] },\n { tag: tags.heading5, class: heading[5] },\n { tag: tags.heading6, class: heading[6] },\n { tag: tags.strikethrough, class: strikethrough },\n { tag: tags.strong, class: bold },\n ],\n { scope: markdownLanguage, all: { fontFamily: get(tokens, 'fontFamily.body', []).join(',') } },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { EditorState, type Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { vim } from '@replit/codemirror-vim';\nimport defaultsDeep from 'lodash.defaultsdeep';\nimport get from 'lodash.get';\nimport React, {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useState,\n type ComponentProps,\n} from 'react';\n\nimport { isDocAccessor } from '@dxos/echo-schema';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { basicBundle, basicTheme, markdownBundle, markdownTheme } from './extensions';\nimport { type EditorModel, useCollaboration } from '../../hooks';\nimport type { ThemeStyles } from '../../styles';\n\nexport const EditorModes = ['default', 'vim'] as const;\nexport type EditorMode = (typeof EditorModes)[number];\n\nexport type CursorInfo = {\n from: number;\n to: number;\n line: number;\n lines: number;\n after?: string;\n};\n\nexport type TextEditorRef = {\n editor: HTMLDivElement | null;\n state?: EditorState;\n view?: EditorView;\n};\n\nexport type TextEditorSlots = {\n root?: Omit<ComponentProps<'div'>, 'ref'>;\n editor?: {\n className?: string;\n placeholder?: string;\n spellCheck?: boolean;\n tabIndex?: number;\n theme?: ThemeStyles;\n };\n};\n\nexport type TextEditorProps = {\n model: EditorModel;\n extensions?: Extension[];\n slots?: TextEditorSlots;\n editorMode?: EditorMode;\n};\n\n/**\n * Base text editor.\n * NOTE: Rather than adding properties, try to create extensions that can be reused.\n */\nexport const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ model, extensions = [], slots, editorMode }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const tabsterDOMAttribute = useFocusableGroup({ tabBehavior: 'limited' });\n\n const [parent, setParent] = useState<HTMLDivElement | null>(null);\n const [state, setState] = useState<EditorState>();\n const [view, setView] = useState<EditorView>();\n useImperativeHandle(\n forwardedRef,\n () => ({\n editor: parent,\n state,\n view,\n }),\n [view, state, parent],\n );\n\n // TODO(burdon): Pass in extension?\n const collaboration = useCollaboration(model, themeMode);\n\n useEffect(() => {\n if (!parent) {\n return;\n }\n\n const initialText = isDocAccessor(model.content)\n ? get(model.content.handle.docSync(), model.content.path)\n : model.content?.toString();\n\n const state = EditorState.create({\n doc: initialText,\n extensions: [\n // TODO(burdon): Factor out VIM mode?\n editorMode === 'vim' && vim(),\n\n // Replication.\n collaboration,\n\n // Theme.\n slots?.editor?.theme && EditorView.theme(slots?.editor?.theme),\n\n // Custom.\n ...extensions,\n ].filter(Boolean) as Extension[],\n });\n\n setState(state);\n\n // NOTE: This repaints the editor.\n // If the new state is derived from the old state, it will likely not be visible other than the cursor resetting.\n // Ideally this should not be hit except when changing between text objects.\n view?.destroy();\n setView(new EditorView({ state, parent }));\n\n return () => {\n view?.destroy();\n setView(undefined);\n setState(undefined);\n };\n }, [parent, model.content, themeMode, editorMode]);\n\n const handleKeyUp = useCallback(\n (event: KeyboardEvent) => {\n const { key, altKey, shiftKey, metaKey, ctrlKey } = event;\n switch (key) {\n case 'Enter': {\n view?.contentDOM.focus();\n break;\n }\n\n case 'Escape': {\n editorMode === 'vim' && (altKey || shiftKey || metaKey || ctrlKey) && parent?.focus();\n break;\n }\n }\n },\n [view, editorMode],\n );\n\n return (\n <div\n key={model.id}\n ref={setParent}\n tabIndex={0}\n {...slots?.root}\n {...(editorMode !== 'vim' && tabsterDOMAttribute)}\n onKeyUp={handleKeyUp}\n />\n );\n },\n);\n\nexport const TextEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ extensions: _extensions, slots, ...props }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const extensions = [...(_extensions ?? []), basicBundle({ themeMode, placeholder: slots?.editor?.placeholder })];\n return (\n <BaseTextEditor\n ref={forwardedRef}\n extensions={extensions}\n slots={defaultsDeep({}, slots, { editor: { theme: basicTheme } })}\n {...props}\n />\n );\n },\n);\n\nexport const MarkdownEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ extensions: _extensions, slots, ...props }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const extensions = [...(_extensions ?? []), markdownBundle({ themeMode })];\n return (\n <BaseTextEditor\n ref={forwardedRef}\n extensions={extensions}\n slots={defaultsDeep({}, slots, { editor: { theme: markdownTheme } })}\n {...props}\n />\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Extension } from '@codemirror/state';\nimport { useEffect, useMemo } from 'react';\nimport { yCollab } from 'y-codemirror.next';\n\nimport { generateName } from '@dxos/display-name';\nimport { isDocAccessor } from '@dxos/echo-schema';\nimport type { ThemeMode } from '@dxos/react-ui';\nimport { getColorForValue } from '@dxos/react-ui-theme';\nimport { YText } from '@dxos/text-model';\n\nimport type { EditorModel } from './useTextModel';\nimport { automergePlugin } from '../automerge/automerge-plugin';\n\n/**\n * Replication and awareness (incl. remote selection).\n * https://codemirror.net/docs/ref/#collab\n */\nexport const useCollaboration = (model: EditorModel, themeMode: ThemeMode): Extension | undefined => {\n const { provider, peer, content } = model;\n const extension = useMemo(() => {\n if (content instanceof YText) {\n return yCollab(content, provider?.awareness);\n } else if (isDocAccessor(content)) {\n return automergePlugin(content.handle, content.path);\n } else {\n return undefined;\n }\n }, []);\n\n useEffect(() => {\n if (provider && peer) {\n provider.awareness.setLocalStateField('user', {\n name: peer.name ?? generateName(peer.id),\n color: getColorForValue({ value: peer.id, type: 'color' }),\n colorLight: getColorForValue({ value: peer.id, themeMode, type: 'highlight' }),\n });\n }\n }, [provider, peer, themeMode]);\n\n return extension;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n Annotation,\n type EditorState,\n type Extension,\n Facet,\n StateEffect,\n StateField,\n type Transaction,\n type TransactionSpec,\n} from '@codemirror/state';\nimport { ViewPlugin, type EditorView, type PluginValue, type ViewUpdate } from '@codemirror/view';\n\nimport * as automerge from '@dxos/automerge/automerge';\nimport { type Heads, type Prop } from '@dxos/automerge/automerge';\n\nimport { PatchSemaphore } from './PatchSemaphore';\nimport { type IDocHandle } from './handle';\n\nexport type Value = {\n lastHeads: Heads;\n path: Prop[];\n unreconciledTransactions: Transaction[];\n};\n\ntype UpdateHeads = {\n newHeads: Heads;\n};\n\nexport const effectType = StateEffect.define<UpdateHeads>({});\n\nexport const updateHeads = (newHeads: Heads): StateEffect<UpdateHeads> => effectType.of({ newHeads });\n\nexport const getLastHeads = (state: EditorState, field: Field): Heads => state.field(field).lastHeads;\n\nexport const getPath = (state: EditorState, field: Field): Prop[] => state.field(field).path;\n\nexport type Field = StateField<Value>;\n\nconst semaphoreFacet = Facet.define<PatchSemaphore, PatchSemaphore>({\n combine: (values) => values.at(-1)!, // Take last.\n});\n\nexport type AutomergePlugin = {\n extension: Extension;\n};\n\nexport const automergePlugin = (handle: IDocHandle, path: Prop[]): AutomergePlugin => {\n const stateField: StateField<Value> = StateField.define({\n create: () => ({\n lastHeads: automerge.getHeads(handle.docSync()!),\n unreconciledTransactions: [],\n path: path.slice(),\n }),\n update: (value: Value, tr: Transaction) => {\n const result: Value = {\n lastHeads: value.lastHeads,\n unreconciledTransactions: value.unreconciledTransactions.slice(),\n path: path.slice(),\n };\n let clearUnreconciled = false;\n for (const effect of tr.effects) {\n if (effect.is(effectType)) {\n result.lastHeads = effect.value.newHeads;\n clearUnreconciled = true;\n }\n }\n if (clearUnreconciled) {\n result.unreconciledTransactions = [];\n } else {\n if (!isReconcileTx(tr)) {\n result.unreconciledTransactions.push(tr);\n }\n }\n return result;\n },\n });\n const semaphore = new PatchSemaphore(stateField);\n\n const viewPlugin = ViewPlugin.fromClass(\n class AutomergeCodemirrorViewPlugin implements PluginValue {\n private _view: EditorView;\n\n constructor(view: EditorView) {\n this._view = view;\n handle.addListener('change', this._handleChange);\n }\n\n update(update: ViewUpdate) {\n if (update.transactions.length > 0 && update.transactions.some((t) => !isReconcileTx(t))) {\n queueMicrotask(() => {\n this._view.state.facet(semaphoreFacet).reconcile(handle, this._view);\n });\n }\n }\n\n destroy() {\n handle.addListener('change', this._handleChange);\n }\n\n private _handleChange = () => {\n this._view.state.facet(semaphoreFacet).reconcile(handle, this._view);\n };\n },\n );\n\n return {\n extension: [stateField, semaphoreFacet.of(semaphore), viewPlugin],\n };\n};\n\nexport const reconcileAnnotationType = Annotation.define<unknown>();\n\nexport const isReconcileTx = (tr: Transaction): boolean => !!tr.annotation(reconcileAnnotationType);\n\nexport const makeReconcile = (tr: TransactionSpec) => {\n if (tr.annotations != null) {\n if (tr.annotations instanceof Array) {\n tr.annotations = [...tr.annotations, reconcileAnnotationType.of({})];\n } else {\n tr.annotations = [tr.annotations, reconcileAnnotationType.of({})];\n }\n } else {\n tr.annotations = [reconcileAnnotationType.of({})];\n }\n // return {\n // ...tr,\n // annotations: reconcileAnnotationType.of({})\n // }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorView } from '@codemirror/view';\n\nimport { next as automerge } from '@dxos/automerge/automerge';\n\nimport amToCodemirror from './amToCodemirror';\nimport codeMirrorToAm from './codeMirrorToAm';\nimport { type IDocHandle } from './handle';\nimport { type Field, isReconcileTx, getPath, reconcileAnnotationType, updateHeads, getLastHeads } from './plugin';\n\ntype Doc<T> = automerge.Doc<T>;\ntype Heads = automerge.Heads;\n\ntype ChangeFn = (atHeads: Heads, change: (doc: Doc<unknown>) => void) => Heads | undefined;\n\nexport class PatchSemaphore {\n _field!: Field;\n _inReconcile = false;\n _queue: Array<ChangeFn> = [];\n\n constructor(field?: Field) {\n if (field !== undefined) {\n this._field = field;\n }\n }\n\n reconcile = (handle: IDocHandle, view: EditorView) => {\n if (this._inReconcile) {\n return;\n }\n this._inReconcile = true;\n\n const path = getPath(view.state, this._field);\n const oldHeads = getLastHeads(view.state, this._field);\n let selection = view.state.selection;\n\n const transactions = view.state.field(this._field).unreconciledTransactions.filter((tx) => !isReconcileTx(tx));\n\n // First undo all the unreconciled transactions\n const toInvert = transactions.slice().reverse();\n for (const tx of toInvert) {\n const inverted = tx.changes.invert(tx.startState.doc);\n selection = selection.map(inverted);\n view.dispatch({\n changes: inverted,\n annotations: reconcileAnnotationType.of(true),\n });\n }\n\n // now apply the unreconciled transactions to the document\n let newHeads = codeMirrorToAm(this._field, handle, transactions, view.state);\n\n // NOTE: null and undefined each come from automerge and repo respectively\n if (newHeads === null || newHeads === undefined) {\n // TODO: @alexjg this is the call that's resetting the editor state on click\n newHeads = automerge.getHeads(handle.docSync()!);\n }\n\n // now get the diff between the updated state of the document and the heads\n // and apply that to the codemirror doc\n const diff = automerge.equals(oldHeads, newHeads) ? [] : automerge.diff(handle.docSync()!, oldHeads, newHeads);\n amToCodemirror(view, selection, path, diff);\n\n view.dispatch({\n effects: updateHeads(newHeads),\n annotations: reconcileAnnotationType.of({}),\n });\n\n this._inReconcile = false;\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ChangeSet, type ChangeSpec, type EditorSelection, type EditorState } from '@codemirror/state';\nimport { type EditorView } from '@codemirror/view';\n\nimport {\n type DelPatch,\n type InsertPatch,\n type Patch,\n type Prop,\n type PutPatch,\n type SpliceTextPatch,\n} from '@dxos/automerge/automerge';\n\nimport { reconcileAnnotationType } from './plugin';\n\nexport default (view: EditorView, selection: EditorSelection, target: Prop[], patches: Patch[]) => {\n for (const patch of patches) {\n const changeSpec = handlePatch(patch, target, view.state);\n if (changeSpec != null) {\n const changeSet = ChangeSet.of(changeSpec, view.state.doc.length, '\\n');\n selection = selection.map(changeSet, 1);\n view.dispatch({\n changes: changeSet,\n annotations: reconcileAnnotationType.of({}),\n });\n }\n }\n view.dispatch({\n selection,\n annotations: reconcileAnnotationType.of({}),\n });\n};\n\nconst handlePatch = (patch: Patch, target: Prop[], state: EditorState): ChangeSpec | null => {\n if (patch.action === 'insert') {\n return handleInsert(target, patch);\n } else if (patch.action === 'splice') {\n return handleSplice(target, patch);\n } else if (patch.action === 'del') {\n return handleDel(target, patch);\n } else if (patch.action === 'put') {\n return handlePut(target, patch, state);\n } else {\n return null;\n }\n};\n\nconst handleInsert = (target: Prop[], patch: InsertPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n const text = patch.values.map((v) => (v ? v.toString() : '')).join('');\n return [{ from: index, to: index, insert: text }];\n};\n\nconst handleSplice = (target: Prop[], patch: SpliceTextPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n return [{ from: index, insert: patch.value }];\n};\n\nconst handleDel = (target: Prop[], patch: DelPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n const length = patch.length || 1;\n return [{ from: index, to: index + length }];\n};\n\nconst handlePut = (target: Prop[], patch: PutPatch, state: EditorState): Array<ChangeSpec> => {\n const index = charPath(target, [...patch.path, 0]);\n if (index == null) {\n return [];\n }\n const length = state.doc.length;\n if (typeof patch.value !== 'string') {\n return []; // TODO(dmaretskyi): How to handle non string values?\n }\n return [{ from: 0, to: length, insert: patch.value as any }];\n};\n\n// If the path of the patch is of the form [path, <index>] then we know this is\n// a path to a character within the sequence given by path\nconst charPath = (textPath: Prop[], candidatePath: Prop[]): number | null => {\n if (candidatePath.length !== textPath.length + 1) {\n return null;\n }\n for (let i = 0; i < textPath.length; i++) {\n if (textPath[i] !== candidatePath[i]) {\n return null;\n }\n }\n const index = candidatePath[candidatePath.length - 1];\n if (typeof index === 'number') {\n return index;\n }\n return null;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorState, type Text, type Transaction } from '@codemirror/state';\n\nimport { next as am, type Heads } from '@dxos/automerge/automerge';\n\nimport { type IDocHandle } from './handle';\nimport { type Field } from './plugin';\n\nexport default (\n field: Field,\n handle: IDocHandle,\n transactions: Transaction[],\n state: EditorState,\n): Heads | undefined => {\n const { lastHeads, path } = state.field(field);\n\n // We don't want to call `automerge.updateAt` if there are no changes.\n // Otherwise later on `automerge.diff` will return empty patches that result in a no-op but still mess up the selection.\n let hasChanges = false;\n for (const tr of transactions) {\n tr.changes.iterChanges(() => {\n hasChanges = true;\n });\n }\n\n if (!hasChanges) {\n return undefined;\n }\n\n const newHeads = handle.changeAt(lastHeads, (doc: am.Doc<unknown>) => {\n for (const tr of transactions) {\n tr.changes.iterChanges((fromA: number, toA: number, _fromB: number, _toB: number, inserted: Text) => {\n am.splice(doc, path, fromA, toA - fromA, inserted.toString());\n });\n }\n });\n return newHeads ?? undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useMemo } from 'react';\nimport type * as awarenessProtocol from 'y-protocols/awareness';\n\nimport {\n type DocAccessor,\n type Space,\n type TextObject,\n type AutomergeTextCompat,\n getRawDoc,\n isActualAutomergeObject,\n} from '@dxos/react-client/echo';\nimport { type Identity } from '@dxos/react-client/halo';\nimport type { YText, YXmlFragment } from '@dxos/text-model';\n\nimport { SpaceAwarenessProvider } from './yjs';\n\n// TODO(burdon): Move.\ntype Awareness = awarenessProtocol.Awareness;\ntype Provider = { awareness: Awareness };\n\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport type EditorModel = {\n id: string;\n content: string | YText | YXmlFragment | DocAccessor;\n provider?: Provider;\n peer?: {\n id: string;\n name?: string;\n };\n};\n\nexport type UseTextModelOptions = {\n identity?: Identity | null;\n space?: Space;\n text?: TextObject;\n};\n\n// TODO(burdon): Don't support returning undefined (and remove checks from calling code).\n// TODO(burdon): Decouple space (make Editor less dependent on entire stack)?\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport const useTextModel = ({ identity, space, text }: UseTextModelOptions): EditorModel | undefined => {\n const provider = useMemo(() => {\n if (isActualAutomergeObject(text)) {\n return undefined;\n }\n\n if (!space || !text?.doc) {\n return undefined;\n }\n\n return new SpaceAwarenessProvider({ space, doc: text.doc, channel: `yjs.awareness.${text.id}` });\n }, [identity, space, text, text?.doc]);\n\n const content = useMemo(() => {\n if (isActualAutomergeObject(text)) {\n const obj = text as any as AutomergeTextCompat;\n return getRawDoc(obj, [obj.field]);\n } else {\n return text?.content;\n }\n }, [text]);\n\n if (isActualAutomergeObject(text)) {\n const obj = text as any as AutomergeTextCompat;\n return {\n id: obj.id,\n content: content!,\n provider: undefined,\n peer: identity\n ? {\n id: identity.identityKey.toHex(),\n name: identity.profile?.displayName,\n }\n : undefined,\n };\n }\n\n if (!text?.doc || !text?.content) {\n return undefined;\n }\n\n return {\n id: text.doc.guid,\n content: text.content,\n provider,\n peer: identity\n ? {\n id: identity.identityKey.toHex(),\n name: identity.profile?.displayName,\n }\n : undefined,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// Copied from https://github.com/yjs/y-codemirror.next#example.\n\nimport * as random from 'lib0/random';\n\nconst cursorColors = [\n { color: '#30bced', light: '#30bced33' },\n { color: '#6eeb83', light: '#6eeb8333' },\n { color: '#ffbc42', light: '#ffbc4233' },\n { color: '#ecd444', light: '#ecd44433' },\n { color: '#ee6352', light: '#ee635233' },\n { color: '#9ac2c9', light: '#9ac2c933' },\n { color: '#8acb88', light: '#8acb8833' },\n { color: '#1be7ff', light: '#1be7ff33' },\n];\n\n// Select a random color for this user.\nexport const cursorColor = cursorColors[random.uint32() % cursorColors.length];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as decoding from 'lib0/decoding';\nimport * as encoding from 'lib0/encoding';\nimport { Observable } from 'lib0/observable';\nimport * as awarenessProtocol from 'y-protocols/awareness';\nimport { type Doc } from 'yjs';\n\nimport { log } from '@dxos/log';\nimport { type Space } from '@dxos/react-client/echo';\nimport { type GossipMessage } from '@dxos/react-client/mesh';\n\ntype Awareness = awarenessProtocol.Awareness;\n\n// Based on https://github.com/yjs/y-webrtc/blob/88baab2/src/y-webrtc.js.\n\nconst messageAwareness = 1;\nconst messageQueryAwareness = 3;\n\n/**\n * Yjs awareness provider on top of a DXOS space.\n */\nexport class SpaceAwarenessProvider extends Observable<any> {\n private readonly _space: Space;\n private readonly _awareness: Awareness;\n private readonly _clientId: number;\n private readonly _channel: string;\n\n constructor({ space, doc, channel, awareness }: { space: Space; doc: Doc; channel: string; awareness?: Awareness }) {\n super();\n this._space = space;\n this._awareness = awareness ?? new awarenessProtocol.Awareness(doc);\n this._channel = channel;\n this._clientId = doc.clientID;\n\n this._awareness.on('update', this._handleAwarenessUpdate.bind(this));\n this._space.listen(this._channel, this._handleSpaceMessage.bind(this));\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._handleBeforeUnload.bind(this));\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._handleBeforeUnload.bind(this));\n }\n\n // Post queryAwareness.\n const encoderAwarenessQuery = encoding.createEncoder();\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness);\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwarenessQuery));\n\n // Post local awareness state.\n const encoderAwarenessState = encoding.createEncoder();\n encoding.writeVarUint(encoderAwarenessState, messageAwareness);\n encoding.writeVarUint8Array(\n encoderAwarenessState,\n awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this._clientId]),\n );\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwarenessState));\n }\n\n get awareness(): Awareness {\n return this._awareness;\n }\n\n private _handleAwarenessUpdate({ added, updated, removed }: any, origin: any) {\n log('awareness update', { added, updated, removed, origin });\n const changedClients = added.concat(updated).concat(removed);\n const encoderAwareness = encoding.createEncoder();\n encoding.writeVarUint(encoderAwareness, messageAwareness);\n encoding.writeVarUint8Array(\n encoderAwareness,\n awarenessProtocol.encodeAwarenessUpdate(this._awareness, changedClients),\n );\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwareness));\n }\n\n private _handleSpaceMessage({ payload }: GossipMessage) {\n log('space message', payload);\n const data = new Uint8Array(Array.from(Object.values(payload)));\n const encoder = this._readMessage(data);\n if (encoder) {\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoder));\n }\n }\n\n private _readMessage(message: Uint8Array) {\n const decoder = decoding.createDecoder(message);\n const encoder = encoding.createEncoder();\n const messageType = decoding.readVarUint(decoder);\n\n let sendReply = false;\n switch (messageType) {\n case messageAwareness: {\n awarenessProtocol.applyAwarenessUpdate(this._awareness, decoding.readVarUint8Array(decoder), this);\n break;\n }\n\n case messageQueryAwareness: {\n encoding.writeVarUint(encoder, messageAwareness);\n encoding.writeVarUint8Array(\n encoder,\n awarenessProtocol.encodeAwarenessUpdate(this._awareness, Array.from(this._awareness.getStates().keys())),\n );\n sendReply = true;\n break;\n }\n\n default: {\n console.error('Invalid message:', messageType);\n return encoder;\n }\n }\n\n if (!sendReply) {\n // Nothing has been written, no answer created.\n return null;\n }\n\n return encoder;\n }\n\n private _handleBeforeUnload() {\n awarenessProtocol.removeAwarenessStates(this._awareness, [this._clientId], 'window unload');\n }\n}\n"],
5
- "mappings": ";AAIA,SAASA,gBAAgB;AACzB,SAASC,KAAKC,SAAAA,QAAOC,oBAAoB;;;ACDzC,SAASC,QAAAA,aAAY;;;ACArB,SAASC,qBAAqB;AAC9B,SAASC,iBAAiBC,uBAAuBC,0BAA0B;AAE3E,SAASC,6BAA6B;AACtC,SAASC,mBAAmB;AASrB,IAAMC,cAAc,CAAC,EAAEC,WAAWC,aAAaC,aAAY,MAChE;EACEC,gB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MAAWuD,aAAa1D,OAAOgB,QAAQ0C;IAAY,CAAA;;AAC7G,SACE,sBAAA,cAAC9D,gBAAAA;IACCsD,KAAKhD;IACLH;IACAC,OAAO2D,aAAa,CAAC,GAAG3D,OAAO;MAAEgB,QAAQ;QAAEgB,OAAO4B;MAAW;IAAE,CAAA;IAC9D,GAAGJ;;AAGV,CAAA;AAGK,IAAMK,iBAAiBhE,2BAC5B,CAAC,EAAEE,YAAYwD,aAAavD,OAAO,GAAGwD,MAAAA,GAAStD,iBAAAA;AAC7C,QAAM,EAAEC,UAAS,IAAKC,gBAAAA;AACtB,QAAML,aAAa;OAAKwD,eAAe,CAAA;IAAKO,eAAe;MAAE3D;IAAU,CAAA;;AACvE,SACE,sBAAA,cAACP,gBAAAA;IACCsD,KAAKhD;IACLH;IACAC,OAAO2D,aAAa,CAAC,GAAG3D,OAAO;MAAEgB,QAAQ;QAAEgB,OAAO+B;MAAc;IAAE,CAAA;IACjE,GAAGP;;AAGV,CAAA;",
6
- "names": ["TextKind", "Doc", "YText", "YXmlFragment", "tags", "closeBrackets", "bracketMatching", "defaultHighlightStyle", "syntaxHighlighting", "oneDarkHighlightStyle", "placeholder", "basicBundle", "themeMode", "placeholder", "_placeholder", "bracketMatching", "closeBrackets", "syntaxHighlighting", "oneDarkHighlightStyle", "defaultHighlightStyle", "filter", "Boolean", "get", "mx", "heading", "bold", "code", "codeWithoutMarks", "mx", "code", "italic", "strikethrough", "mark", "tailwindConfig", "tokens", "tailwindConfig", "theme", "basicTheme", "outline", "paddingInline", "lineHeight", "minBlockSize", "fontFamily", "get", "tokens", "join", "overflow", "padding", "caretColor", "backgroundColor", "border", "color", "textDecoration", "StateField", "onChangeExtension", "onChange", "StateField", "define", "create", "update", "_value", "transaction", "docChanged", "newDoc", "toString", "syntaxTree", "RangeSetBuilder", "StateField", "Decoration", "EditorView", "WidgetType", "Link", "WidgetType", "constructor", "_anchor", "_text", "_url", "eq", "other", "text", "url", "toDOM", "view", "link", "document", "createElement", "setAttribute", "textContent", "href", "onclick", "dispatch", "selection", "anchor", "hyperlinkDecoration", "StateField", "define", "create", "state", "update", "_", "tr", "provide", "field", "EditorView", "decorations", "from", "builder", "RangeSetBuilder", "cursor", "main", "head", "syntaxTree", "iterate", "enter", "node", "to", "name", "marks", "getChildren", "length", "sliceDoc", "urlNode", "getChild", "add", "Decoration", "replace", "widget", "undefined", "finish", "hoverTooltip", "tooltipContent", "markdownLinkRegexp", "createHyperlinkTooltip", "onHover", "regexp", "hoverTooltip", "view", "pos", "from", "text", "state", "doc", "lineAt", "p", "idx", "match", "substring", "undefined", "indexOf", "length", "url", "end", "above", "create", "el", "document", "createElement", "innerText", "className", "tooltipContent", "setAttribute", "dom", "Decoration", "EditorView", "MatchDecorator", "ViewPlugin", "markdownLinkRegexp", "linkDecorator", "MatchDecorator", "regexp", "decorate", "add", "from", "to", "match", "view", "_", "label", "url", "p0", "start", "end", "p1", "length", "p2", "p3", "Decoration", "mark", "class", "_attributes", "style", "hyperLinkExtension", "ViewPlugin", "fromClass", "HyperLinkView", "constructor", "decorator", "decorations", "createDeco", "update", "docChanged", "viewportChanged", "updateDeco", "eventHandlers", "mousedown", "event", "pos", "posAtDOM", "target", "console", "log", "keydown", "hyperlinkStyle", "EditorView", "baseTheme", "cursor", "textDecoration", "opacity", "fontFamily", "hyperlinkWidget", "closeBrackets", "closeBracketsKeymap", "defaultKeymap", "history", "historyKeymap", "indentWithTab", "markdownLanguage", "markdown", "bracketMatching", "defaultHighlightStyle", "foldKeymap", "indentOnInput", "syntaxHighlighting", "languages", "lintKeymap", "highlightSelectionMatches", "searchKeymap", "EditorState", "oneDarkHighlightStyle", "crosshairCursor", "drawSelection", "dropCursor", "EditorView", "highlightActiveLine", "highlightActiveLineGutter", "highlightSpecialChars", "keymap", "placeholder", "rectangularSelection", "styleTags", "Tag", "markdownTags", "headingMark", "Tag", "define", "quoteMark", "listMark", "linkMark", "emphasisMark", "codeMark", "codeText", "inlineCode", "url", "linkReference", "linkLabel", "markdownTagsExtension", "props", "styleTags", "HeaderMark", "QuoteMark", "ListMark", "LinkMark", "EmphasisMark", "CodeMark", "CodeText", "InlineCode", "URL", "LinkReference", "LinkLabel", "markdownLanguage", "HighlightStyle", "tags", "get", "chalky", "coral", "cyan", "invalid", "ivory", "stone", "malibu", "sage", "whiskey", "violet", "highlightBackground", "tooltipBackground", "monospace", "get", "tokens", "join", "markdownTheme", "backgroundColor", "border", "outline", "paddingInline", "lineHeight", "minBlockSize", "background", "padding", "caretColor", "borderLeftColor", "fontFamily", "overflow", "marginBlockStart", "paddingBlockStart", "paddingBlockEnd", "mixBlendMode", "display", "insetBlockStart", "blockSize", "verticalAlign", "margin", "color", "textDecorationLine", "textDecorationThickness", "textUnderlineOffset", "borderRadius", "Object", "keys", "reduce", "acc", "fontSize", "height", "markdownHighlightStyle", "HighlightStyle", "define", "tag", "tags", "keyword", "name", "deleted", "character", "propertyName", "macroName", "constant", "standard", "definition", "separator", "typeName", "className", "number", "changed", "annotation", "modifier", "self", "namespace", "operator", "operatorKeyword", "escape", "regexp", "special", "string", "meta", "comment", "atom", "bool", "variableName", "processingInstruction", "inserted", "invalid", "link", "url", "textDecoration", "function", "labelName", "malibu", "markdownTags", "codeMark", "emphasisMark", "headingMark", "linkLabel", "linkReference", "listMark", "quoteMark", "class", "mark", "codeText", "inlineCode", "emphasis", "italic", "heading1", "heading", "heading2", "heading3", "heading4", "heading5", "heading6", "strikethrough", "strong", "bold", "scope", "markdownLanguage", "all", "markdownBundle", "themeMode", "placeholder", "_placeholder", "bracketMatching", "closeBrackets", "EditorState", "allowMultipleSelections", "of", "EditorView", "lineWrapping", "crosshairCursor", "dropCursor", "drawSelection", "highlightActiveLine", "highlightActiveLineGutter", "highlightSelectionMatches", "highlightSpecialChars", "history", "indentOnInput", "rectangularSelection", "keymap", "closeBracketsKeymap", "defaultKeymap", "foldKeymap", "historyKeymap", "lintKeymap", "searchKeymap", "indentWithTab", "markdown", "base", "markdownLanguage", "codeLanguages", "languages", "extensions", "markdownTagsExtension", "syntaxHighlighting", "markdownHighlightStyle", "oneDarkHighlightStyle", "defaultHighlightStyle", "filter", "Boolean", "EditorState", "EditorView", "useFocusableGroup", "vim", "defaultsDeep", "get", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useState", "isDocAccessor", "useThemeContext", "useEffect", "useMemo", "yCollab", "generateName", "isDocAccessor", "getColorForValue", "YText", "Annotation", "Facet", "StateEffect", "StateField", "ViewPlugin", "automerge", "next", "automerge", "ChangeSet", "view", "selection", "target", "patches", "patch", "changeSpec", "handlePatch", "state", "changeSet", "ChangeSet", "of", "doc", "length", "map", "dispatch", "changes", "annotations", "reconcileAnnotationType", "action", "handleInsert", "handleSplice", "handleDel", "handlePut", "index", "charPath", "path", "text", "values", "v", "toString", "join", "from", "to", "insert", "value", "textPath", "candidatePath", "i", "next", "am", "field", "handle", "transactions", "state", "lastHeads", "path", "hasChanges", "tr", "changes", "iterChanges", "undefined", "newHeads", "changeAt", "doc", "fromA", "toA", "_fromB", "_toB", "inserted", "am", "splice", "toString", "PatchSemaphore", "constructor", "field", "_inReconcile", "_queue", "reconcile", "handle", "view", "path", "getPath", "state", "_field", "oldHeads", "getLastHeads", "selection", "transactions", "unreconciledTransactions", "filter", "tx", "isReconcileTx", "toInvert", "slice", "reverse", "inverted", "changes", "invert", "startState", "doc", "map", "dispatch", "annotations", "reconcileAnnotationType", "of", "newHeads", "codeMirrorToAm", "undefined", "automerge", "getHeads", "docSync", "diff", "equals", "amToCodemirror", "effects", "updateHeads", "effectType", "StateEffect", "define", "updateHeads", "newHeads", "of", "getLastHeads", "state", "field", "lastHeads", "getPath", "path", "semaphoreFacet", "Facet", "combine", "values", "at", "automergePlugin", "handle", "stateField", "StateField", "create", "getHeads", "docSync", "unreconciledTransactions", "slice", "update", "value", "tr", "result", "clearUnreconciled", "effect", "effects", "is", "isReconcileTx", "push", "semaphore", "PatchSemaphore", "viewPlugin", "ViewPlugin", "fromClass", "AutomergeCodemirrorViewPlugin", "constructor", "view", "_handleChange", "_view", "facet", "reconcile", "addListener", "transactions", "length", "some", "t", "queueMicrotask", "destroy", "extension", "reconcileAnnotationType", "Annotation", "annotation", "useCollaboration", "model", "themeMode", "provider", "peer", "content", "extension", "useMemo", "YText", "yCollab", "awareness", "isDocAccessor", "automergePlugin", "handle", "path", "undefined", "useEffect", "setLocalStateField", "name", "generateName", "id", "color", "getColorForValue", "value", "type", "colorLight", "useMemo", "getRawDoc", "isActualAutomergeObject", "random", "cursorColors", "color", "light", "cursorColor", "uint32", "length", "decoding", "encoding", "Observable", "awarenessProtocol", "log", "messageAwareness", "messageQueryAwareness", "SpaceAwarenessProvider", "constructor", "space", "doc", "channel", "awareness", "_space", "_awareness", "Awareness", "_channel", "_clientId", "clientID", "on", "_handleAwarenessUpdate", "bind", "listen", "_handleSpaceMessage", "window", "addEventListener", "_handleBeforeUnload", "process", "encoderAwarenessQuery", "createEncoder", "writeVarUint", "postMessage", "toUint8Array", "encoderAwarenessState", "writeVarUint8Array", "encodeAwarenessUpdate", "added", "updated", "removed", "origin", "changedClients", "concat", "encoderAwareness", "payload", "data", "Uint8Array", "Array", "from", "Object", "values", "encoder", "_readMessage", "message", "decoder", "createDecoder", "messageType", "readVarUint", "sendReply", "applyAwarenessUpdate", "readVarUint8Array", "getStates", "keys", "console", "error", "removeAwarenessStates", "useTextModel", "identity", "space", "text", "provider", "useMemo", "isActualAutomergeObject", "undefined", "doc", "SpaceAwarenessProvider", "channel", "id", "content", "obj", "getRawDoc", "field", "peer", "identityKey", "toHex", "name", "profile", "displayName", "guid", "EditorModes", "BaseTextEditor", "forwardRef", "model", "extensions", "slots", "editorMode", "forwardedRef", "themeMode", "useThemeContext", "tabsterDOMAttribute", "useFocusableGroup", "tabBehavior", "parent", "setParent", "useState", "state", "setState", "view", "setView", "useImperativeHandle", "editor", "collaboration", "useCollaboration", "useEffect", "initialText", "isDocAccessor", "content", "get", "handle", "docSync", "path", "toString", "EditorState", "create", "doc", "vim", "theme", "EditorView", "filter", "Boolean", "destroy", "undefined", "handleKeyUp", "useCallback", "event", "key", "altKey", "shiftKey", "metaKey", "ctrlKey", "contentDOM", "focus", "div", "id", "ref", "tabIndex", "root", "onKeyUp", "TextEditor", "_extensions", "props", "basicBundle", "placeholder", "defaultsDeep", "basicTheme", "MarkdownEditor", "markdownBundle", "markdownTheme"]
4
+ "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nexport { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';\nexport { Doc, YText, YXmlFragment } from '@dxos/text-model';\n\nexport * from './components';\nexport * from './hooks';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport { tags } from '@lezer/highlight';\n\nexport * from './extensions';\nexport * from './TextEditor';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { closeBrackets } from '@codemirror/autocomplete';\nimport { bracketMatching, defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport { EditorView, placeholder } from '@codemirror/view';\n\nimport type { ThemeMode } from '@dxos/react-ui';\n\nexport type BasicBundleOptions = {\n themeMode?: ThemeMode;\n placeholder?: string;\n};\n\nexport const basicBundle = ({ themeMode, placeholder: _placeholder }: BasicBundleOptions): Extension[] =>\n [\n bracketMatching(),\n closeBrackets(),\n _placeholder && placeholder(_placeholder),\n\n EditorView.lineWrapping,\n\n // TODO(burdon): Is this required?\n themeMode === 'dark' ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle),\n ].filter(Boolean) as Extension[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport get from 'lodash.get';\nimport { type StyleSpec } from 'style-mod';\n\nimport { tokens } from '../../../../styles';\n\n/**\n * Minimal styles.\n * NOTE: The '&' prefix denotes the CM editor root.\n * https://codemirror.net/examples/styling\n */\n// TODO(burdon): Remove?\nexport const basicTheme: {\n [selector: string]: StyleSpec;\n} = {\n '&.cm-focused': {\n outline: 'none',\n },\n '& .cm-line': {\n paddingInline: 0,\n lineHeight: 1.6,\n minBlockSize: '1.6em',\n },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '& .cm-scroller': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n overflow: 'visible',\n },\n '& .cm-content': {\n padding: 0,\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: 'white',\n },\n '& .cm-tooltip': {\n backgroundColor: 'transparent',\n border: 'none',\n },\n '& .cm-link': {\n color: get(tokens, 'extend.colors.primary.500'),\n textDecoration: 'underline',\n },\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport const heading: Record<HeadingLevel, string> = {\n 1: 'mbs-4 mbe-2 text-4xl font-semibold text-inherit no-underline',\n 2: 'mbs-4 mbe-2 text-3xl font-bold text-inherit no-underline',\n 3: 'mbs-4 mbe-2 text-2xl font-bold text-inherit no-underline',\n 4: 'mbs-4 mbe-2 text-xl font-extrabold text-inherit no-underline',\n 5: 'mbs-4 mbe-2 text-lg font-extrabold text-inherit no-underline',\n 6: 'mbs-4 mbe-2 font-black text-inherit no-underline',\n};\n\nexport const blockquote = 'mlb-2 border-is-4 border-neutral-500/50 pis-5';\n\n// TODO(thure): Tailwind was not seeing `[&>li:before]:content-[\"•\"]` as a utility class, but it would work if instead of `\"•\"` it was `\"X\"`… why?\nexport const unorderedList =\n 'mlb-2 grid grid-cols-[min-content_1fr] [&>li:before]:content-[attr(marker)] [&>li:before]:mlb-1 [&>li:before]:mie-2';\nexport const orderedList =\n 'mlb-2 grid grid-cols-[min-content_1fr] [&>li:before]:content-[counters(section,_\".\")_\"._\"] [counter-reset:section] [&>li:before]:mlb-1';\n\nexport const listItem = 'contents before:[counter-increment:section]';\n\nexport const codeBlock = 'mlb-2 font-mono bg-neutral-500/10 p-3 rounded';\n\nexport const horizontalRule = 'mlb-4 border-neutral-500/50';\n\nexport const paragraph = 'mlb-1';\n\nexport const bold = 'font-bold';\n\nexport const code = 'font-mono bg-neutral-500/10 rounded pli-0.5 plb-0.5 -mlb-0.5';\n\nexport const placeholder = 'font-mono';\n\nexport const codeWithoutMarks = mx(code, 'pli-1.5 mli-0.5');\n\nexport const italic = 'italic';\n\nexport const strikethrough = 'line-through';\n\nexport const mark = '!font-normal !no-underline !text-inherit opacity-40';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { StyleSpec } from 'style-mod';\n\nimport { tailwindConfig, type TailwindConfig } from '@dxos/react-ui-theme';\n\nexport type ThemeStyles = {\n [selector: string]: StyleSpec;\n};\n\n// TODO(thure): Why export the whole theme? Can this be done differently?\nexport const tokens: TailwindConfig['theme'] = tailwindConfig({}).theme;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StateField } from '@codemirror/state';\n\n/**\n * Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799\n * @param onChange\n */\n// TODO(burdon): Name?\nexport const onChangeExtension = (onChange: (text: string) => void) =>\n StateField.define({\n create: () => null,\n update: (_value, transaction) => {\n if (transaction.docChanged && onChange) {\n onChange(transaction.newDoc.toString());\n }\n\n return null;\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n// Copyright CodeMirror\n//\n\nimport { syntaxTree } from '@codemirror/language';\nimport { type EditorState, type RangeSet, RangeSetBuilder, StateField, type Transaction } from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType } from '@codemirror/view';\n\n// Adapted from:\n// https://codemirror.net/try/?c=aW1wb3J0IHsgYmFzaWNTZXR1cCwgRWRpdG9yVmlldyB9IGZyb20gImNvZGVtaXJyb3IiCmltcG9ydCB7IG1hcmtkb3duIH0gZnJvbSAiQGNvZGVtaXJyb3IvbGFuZy1tYXJrZG93biIKaW1wb3J0IHsgc3ludGF4VHJlZSB9IGZyb20gIkBjb2RlbWlycm9yL2xhbmd1YWdlIjsKaW1wb3J0IHsgRWR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hcmsiKTsKICAgICAgICAgIGxldCB0ZXh0ID0gbWFya3MubGVuZ3RoID49IDIgPyB0ci5zdGF0ZS5zbGljZURvYyhtYXJrc1swXS50bywgbWFya3NbMV0uZnJvbSkgOiAiIgoKICAgICAgICAgIGxldCB1cmxOb2RlID0gbm9kZS5ub2RlLmdldENoaWxkKCJVUkwiKTsKICAgICAgICAgIGxldCB1cmwgPSB1cmxOb2RlID8gdHIuc3RhdGUuc2xpY2VEb2ModXJsTm9kZS5mcm9tLCB1cmxOb2RlLnRvKSA6ICIiCiAgICAgICAgICBidWlsZGVyLmFkZChub2RlLmZyb20sIG5vZGUudG8sIERlY29yYXRpb24ucmVwbGFjZSh7CiAgICAgICAgICAgIHdpZGdldDogbmV3IExpbmsodGV4dCwgdXJsKSwKICAgICAgICAgIH0pLAogICAgICAgICAgICAgICAgICAgICApOwogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgfSwKICAgIH0pOwogICAgcmV0dXJuIGJ1aWxkZXIuZmluaXNoKCk7CiAgfSwKICBwcm92aWRlOiAoZikgPT4gRWRpdG9yVmlldy5kZWNvcmF0aW9ucy5mcm9tKGYpLAp9KTsKCmxldCB2aWV3ID0gbmV3IEVkaXRvclZpZXcoewogIGRvYzogIiMgSGVsbG8gV29ybGRcblxuW1Rlc3RdKGh0dHBzOi8vZXhhbXBsZS5jb20pXG5cblxuIiwKICBleHRlbnNpb25zOiBbZGVjb3JhdGlvbnNGaWVsZCwgbWFya2Rvd24oKV0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5LAp9KTsKCnZpZXcuZm9jdXMoKTs=\n// https://discuss.codemirror.net/t/link-widget-is-clicked-only-if-editor-is-out-of-focus/7433\n\n// TODO(burdon): Adapt to make all markdown editable?\n\n// TODO(burdon): Research overlays.\n// https://stackoverflow.com/questions/26933344/codemirror-detect-and-create-links-inside-editor\n// https://codemirror.net/5/doc/manual.html#addOverlay\n// https://codemirror.net/5/demo/simplemode.html\n// https://codemirror.net/5/demo/search.html (Search dialog).\n\nclass Link extends WidgetType {\n constructor(private readonly _anchor: number, private readonly _text: string, private readonly _url?: string) {\n super();\n }\n\n override eq(other: any) {\n return this._text === other.text && this._url === other.url;\n }\n\n toDOM(view: EditorView) {\n const link = document.createElement('a');\n link.setAttribute('class', 'cm-link');\n link.textContent = this._text;\n if (this._url) {\n link.setAttribute('target', '_blank');\n link.href = this._url;\n } else {\n link.onclick = () => {\n view.dispatch({\n selection: {\n anchor: this._anchor,\n },\n });\n };\n }\n\n return link;\n }\n}\n\ntype HyperlinkDecorationConfig = {\n link?: boolean;\n};\n\n/**\n * Creates a state field to replace AST elements with a hyperlink widget.\n * https://codemirror.net/docs/ref/#state.StateField\n */\nexport const hyperlinkDecoration = ({ link }: HyperlinkDecorationConfig = {}) => {\n return StateField.define<RangeSet<any>>({\n create: (state) => update(state, link),\n update: (_: RangeSet<any>, tr: Transaction) => update(tr.state, link),\n provide: (field) => EditorView.decorations.from(field),\n });\n};\n\nconst update = (state: EditorState, link?: boolean) => {\n const builder = new RangeSetBuilder();\n const cursor = state.selection.main.head;\n syntaxTree(state).iterate({\n enter: (node) => {\n // Check if cursor is inside text.\n if (cursor < node.from || cursor > node.to) {\n if (node.name === 'Link') {\n const marks = node.node.getChildren('LinkMark');\n const text = marks.length >= 2 ? state.sliceDoc(marks[0].to, marks[1].from) : '';\n\n const urlNode = node.node.getChild('URL');\n const url = urlNode ? state.sliceDoc(urlNode.from, urlNode.to) : '';\n\n builder.add(\n node.from,\n node.to,\n Decoration.replace({\n widget: new Link(node.from, text, link ? url : undefined),\n }),\n );\n\n return false;\n }\n }\n\n return true;\n },\n });\n\n return builder.finish();\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { hoverTooltip } from '@codemirror/view';\n\nimport { tooltipContent } from '@dxos/react-ui-theme';\n\nconst markdownLinkRegexp = /\\[([^\\]]+)]\\(([^)]+)\\)/;\n\nexport type OnHyperlinkHover = (el: Element, url: string) => void;\n\n/**\n * https://codemirror.net/examples/tooltip\n * https://codemirror.net/docs/ref/#view.hoverTooltip\n * https://github.com/codemirror/view/blob/main/src/tooltip.ts\n */\n// TODO(burdon): Create config object.\nexport const createHyperlinkTooltip = (onHover: OnHyperlinkHover, regexp = markdownLinkRegexp) =>\n hoverTooltip((view, pos) => {\n const { from, text } = view.state.doc.lineAt(pos);\n const p = pos - from;\n\n let idx = 0;\n let match;\n do {\n match = text.substring(idx).match(regexp);\n if (!match) {\n match = undefined;\n break;\n }\n\n idx = text.indexOf(match[0]);\n if (p >= idx && p < idx + match[0].length) {\n break;\n }\n\n idx += match[0].length;\n } while (true);\n\n if (!match) {\n return null;\n }\n\n const [, , url] = match ?? [];\n\n return {\n pos: idx + from,\n end: idx + from + match[0].length,\n above: true,\n create: () => {\n const el = document.createElement('a');\n el.innerText = '_'; // Required so doesn't collapse.\n el.className = tooltipContent({}, 'mb-2 p-1');\n el.setAttribute('target', '_blank');\n el.setAttribute('href', url);\n onHover(el, url);\n return { dom: el };\n },\n };\n });\n", "//\n// Copyright 2023 DXOS.org\n// Adapted from: https://github.com/uiwjs/react-codemirror/blob/master/extensions/hyper-link/src/index.ts\n//\n\nimport { type Extension } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n MatchDecorator,\n ViewPlugin,\n type ViewUpdate,\n} from '@codemirror/view';\n\n// Notes: Can't edit widget content (or cursor nav through them).\n// - https://discuss.codemirror.net/t/focusing-inputs-within-widgets/5178/7\n// Widgets intentionally always get set to contenteditable=false,\n// or they would become part of CodeMirror’s editable content element.\n// You should be able to introduce new contenteditable=true child elements inside of them.\n\nconst markdownLinkRegexp = /\\[([^\\]]+)]\\(([^)]+)\\)(!?)/gi;\n\n/**\n * Custom link decorator.\n * NOTE: The default markdown extension formats links by default.\n * @deprecated\n */\nconst linkDecorator = () =>\n new MatchDecorator({\n regexp: markdownLinkRegexp,\n decorate: (add, from, to, match, view) => {\n const [_, label, url] = match;\n const p0 = {\n start: from,\n end: from + 1,\n };\n\n const p1 = {\n start: from + 1,\n end: from + 1 + label.length,\n };\n\n const p2 = {\n start: p1.end,\n end: p1.end + 1,\n };\n\n const p3 = {\n start: p1.end + 1,\n end: p1.end + 1 + url.length + 2,\n };\n\n add(\n p0.start,\n p0.end,\n Decoration.mark({ class: 'cm-hyperlink-bracket', _attributes: { style: 'display: none' } }),\n );\n add(p1.start, p1.end, Decoration.mark({ class: 'cm-hyperlink-label' }));\n add(\n p2.start,\n p2.end,\n Decoration.mark({ class: 'cm-hyperlink-bracket', _attributes: { style: 'display: none' } }),\n );\n add(p3.start, p3.end, Decoration.mark({ class: 'cm-hyperlink-url', _attributes: { style: 'display: none' } }));\n },\n });\n\nexport function hyperLinkExtension() {\n return ViewPlugin.fromClass(\n class HyperLinkView {\n readonly decorator: MatchDecorator;\n decorations: DecorationSet;\n constructor(view: EditorView) {\n this.decorator = linkDecorator();\n this.decorations = this.decorator.createDeco(view);\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged) {\n this.decorations = this.decorator.updateDeco(update, this.decorations);\n }\n }\n },\n {\n decorations: (view) => view.decorations,\n eventHandlers: {\n // TODO(burdon): CLick to expand link.\n // https://discuss.codemirror.net/t/decorator-iteration-on-click-event/4226/2\n mousedown: function (event, view) {\n const pos = view.posAtDOM(event.target as Node);\n if (pos !== 0) {\n console.log(this);\n }\n },\n // TODO(burdon): Hide when cursor moves away.\n keydown: (event, view) => {\n view.update([]);\n },\n },\n },\n );\n}\n\nexport const hyperlinkStyle = EditorView.baseTheme({\n '.cm-hyperlink-label': {\n cursor: 'pointer',\n textDecoration: 'underline',\n },\n '.cm-hyperlink-bracket': {\n opacity: 0.2,\n },\n '.cm-hyperlink-url': {\n opacity: 0.5,\n fontFamily: 'monospace',\n },\n});\n\nexport const hyperlinkWidget: Extension = [hyperLinkExtension(), hyperlinkStyle];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';\nimport { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport { markdownLanguage, markdown } from '@codemirror/lang-markdown';\nimport {\n bracketMatching,\n defaultHighlightStyle,\n foldKeymap,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { lintKeymap } from '@codemirror/lint';\nimport { highlightSelectionMatches, searchKeymap } from '@codemirror/search';\nimport { EditorState, type Extension } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport {\n crosshairCursor,\n drawSelection,\n dropCursor,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n highlightSpecialChars,\n keymap,\n placeholder,\n rectangularSelection,\n} from '@codemirror/view';\n// import { GFM } from '@lezer/markdown';\n\nimport type { ThemeMode } from '@dxos/react-ui';\n\nimport { markdownTagsExtension } from './tags';\nimport { markdownHighlightStyle } from './theme';\n\nexport type MarkdownBundleOptions = {\n themeMode?: ThemeMode;\n placeholder?: string;\n};\n\nexport const markdownBundle = ({ themeMode, placeholder: _placeholder }: MarkdownBundleOptions): Extension[] => {\n // All of https://github.com/codemirror/basic-setup minus line numbers and fold gutter.\n // https://codemirror.net/docs/ref/#codemirror.basicSetup\n return [\n bracketMatching(),\n closeBrackets(),\n _placeholder && placeholder(_placeholder),\n\n EditorState.allowMultipleSelections.of(true),\n EditorView.lineWrapping,\n\n // autocompletion(),\n crosshairCursor(),\n dropCursor(),\n drawSelection(),\n highlightActiveLine(),\n highlightActiveLineGutter(),\n highlightSelectionMatches(),\n highlightSpecialChars(),\n history(),\n indentOnInput(),\n rectangularSelection(),\n\n keymap.of([\n ...closeBracketsKeymap,\n // ...completionKeymap,\n ...defaultKeymap,\n ...foldKeymap,\n ...historyKeymap,\n ...lintKeymap,\n ...searchKeymap,\n indentWithTab,\n ]),\n\n // Main extension.\n // https://github.com/codemirror/lang-markdown\n markdown({\n base: markdownLanguage,\n codeLanguages: languages,\n extensions: [\n // TODO(burdon): This seems to upgrade the parser.\n // GitHub flavored markdown bundle: Table, TaskList, Strikethrough, and Autolink.\n // https://github.com/lezer-parser/markdown?tab=readme-ov-file#github-flavored-markdown\n // https://github.github.com/gfm\n // GFM,\n\n // Custom styling.\n markdownTagsExtension,\n ],\n }),\n\n // TODO(thure): All but one rule here apply to both themes; rename or refactor.\n syntaxHighlighting(markdownHighlightStyle),\n themeMode === 'dark' ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle),\n ].filter(Boolean) as Extension[];\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { styleTags, Tag } from '@lezer/highlight';\nimport { type MarkdownConfig } from '@lezer/markdown';\n\nexport const markdownTags = {\n headingMark: Tag.define(),\n quoteMark: Tag.define(),\n listMark: Tag.define(),\n linkMark: Tag.define(),\n emphasisMark: Tag.define(),\n codeMark: Tag.define(),\n codeText: Tag.define(),\n inlineCode: Tag.define(),\n url: Tag.define(),\n linkReference: Tag.define(),\n linkLabel: Tag.define(),\n};\n\nexport const markdownTagsExtension: MarkdownConfig = {\n props: [\n styleTags({\n HeaderMark: markdownTags.headingMark,\n QuoteMark: markdownTags.quoteMark,\n ListMark: markdownTags.listMark,\n LinkMark: markdownTags.linkMark,\n EmphasisMark: markdownTags.emphasisMark,\n CodeMark: markdownTags.codeMark,\n CodeText: markdownTags.codeText,\n InlineCode: markdownTags.inlineCode,\n URL: markdownTags.url,\n LinkReference: markdownTags.linkReference,\n LinkLabel: markdownTags.linkLabel,\n }),\n ],\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { markdownLanguage } from '@codemirror/lang-markdown';\nimport { HighlightStyle } from '@codemirror/language';\nimport { tags } from '@lezer/highlight';\nimport get from 'lodash.get';\n\nimport { markdownTags } from './tags';\nimport { bold, heading, italic, mark, strikethrough, tokens, type ThemeStyles } from '../../../../styles';\n\n// TODO(burdon): Rationalize theme/colors. Hoist onto single property object.\nexport const chalky = '#e5c07b';\nexport const coral = '#e06c75';\nexport const cyan = '#56b6c2';\nexport const invalid = '#ffffff';\nexport const ivory = '#abb2bf';\nexport const stone = '#7d8799';\nexport const malibu = '#61afef';\nexport const sage = '#98c379';\nexport const whiskey = '#d19a66';\nexport const violet = '#c678dd';\nconst _darkBackground = '#21252b';\nexport const highlightBackground = '#2c313a';\nconst _background = '#282c34';\nexport const tooltipBackground = '#353a42';\nconst _selection = '#3E4451';\n\nconst monospace = get(tokens, 'fontFamily.mono', ['monospace']).join(',');\n\n/**\n * NOTE: The '&' prefix denotes the CM editor root.\n * https://codemirror.net/examples/styling\n */\nexport const markdownTheme: ThemeStyles = {\n // TODO(thure): Consider whether these commented-out rules from one-dark-theme should be integrated.\n // '&': {\n // color: ivory,\n // backgroundColor: background\n // },\n // '.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },\n // '&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {\n // backgroundColor: selection\n // },\n // '.cm-panels': { backgroundColor: darkBackground, color: ivory },\n // '.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },\n // '.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },\n // '.cm-searchMatch': {\n // backgroundColor: '#72a1ff59',\n // outline: '1px solid #457dff'\n // },\n // '.cm-searchMatch.cm-searchMatch-selected': {\n // backgroundColor: '#6199ff2f'\n // },\n // '.cm-activeLine': { backgroundColor: '#6699ff0b' },\n // '.cm-selectionMatch': { backgroundColor: '#aafe661a' },\n // '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {\n // backgroundColor: '#bad0f847'\n // },\n // '.cm-gutters': {\n // backgroundColor: background,\n // color: stone,\n // border: 'none'\n // },\n // '.cm-activeLineGutter': {\n // backgroundColor: highlightBackground\n // },\n // '.cm-foldPlaceholder': {\n // backgroundColor: 'transparent',\n // border: 'none',\n // color: '#ddd'\n // },\n\n '& .cm-tooltip': {\n backgroundColor: 'transparent',\n border: 'none',\n },\n // '.dark & .cm-tooltip': {\n // border: 'none',\n // backgroundColor: tooltipBackground,\n // },\n // '.dark & .cm-tooltip .cm-tooltip-arrow:before': {\n // borderTopColor: 'transparent',\n // borderBottomColor: 'transparent',\n // },\n // '.dark & .cm-tooltip .cm-tooltip-arrow:after': {\n // borderTopColor: tooltipBackground,\n // borderBottomColor: tooltipBackground,\n // },\n // '.dark & .cm-tooltip-autocomplete': {\n // '& > ul > li[aria-selected]': {\n // backgroundColor: highlightBackground,\n // color: ivory,\n // },\n // },\n '&.cm-focused': {\n outline: 'none',\n },\n '& .cm-line': {\n paddingInline: 0,\n lineHeight: 1.6,\n minBlockSize: '1.6em',\n },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '&.cm-focused .cm-selectionBackground, & .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.150', '#00ffff'),\n },\n '.dark & .cm-selectionBackground, .dark &.cm-focused .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.850', '#00ffff'),\n },\n '& .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.250', '#00ffff') + '44',\n },\n '.dark & .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.600', '#00ffff') + '44',\n },\n '& .cm-content': {\n padding: 0,\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: 'white',\n },\n '& .cm-cursor': {\n borderLeftColor: 'black',\n },\n '.dark & .cm-cursor': {\n borderLeftColor: 'white',\n },\n '.cm-placeholder': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n },\n '& .cm-scroller': {\n fontFamily: get(tokens, 'fontFamily.mono', []).join(','),\n overflow: 'visible',\n },\n '& .cm-activeLine': {\n backgroundColor: 'transparent',\n },\n '.dark & .cm-activeLine': {\n backgroundColor: 'transparent',\n },\n '& .cm-ySelectionInfo': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n padding: '2px 4px',\n marginBlockStart: '-4px',\n },\n '& .cm-ySelection, & .cm-selectionMatch': {\n paddingBlockStart: '.15em',\n paddingBlockEnd: '.15em',\n },\n '& .cm-ySelection, & .cm-yLineSelection': {\n mixBlendMode: 'multiply',\n },\n '.dark & .cm-ySelection, .dark & .cm-yLineSelection': {\n mixBlendMode: 'screen',\n },\n '& .cm-ySelectionCaret': {\n display: 'inline-block',\n insetBlockStart: '.1em',\n blockSize: '1.4em',\n verticalAlign: 'top',\n },\n '& .cm-yLineSelection': {\n margin: '0',\n },\n '.cm-link': {\n color: 'rgb(20 89 208)', // TODO(burdon): Rationalize.\n textDecorationLine: 'underline',\n textDecorationThickness: '1px',\n textUnderlineOffset: '2px',\n borderRadius: '.125rem',\n },\n // TODO(burdon): Document.\n ...Object.keys(get(tokens, 'extend.fontSize', {})).reduce((acc: Record<string, any>, fontSize) => {\n const height = get(tokens, ['extend', 'fontSize', fontSize, 1, 'lineHeight']);\n // TODO(thure): This appears to be the best or only way to set selection caret heights, but it's far more verbose than it needs to be.\n acc[`& .text-${fontSize} + .cm-ySelectionCaret`] = { height };\n acc[`& .text-${fontSize} + .cm-ySelection + .cm-ySelectionCaret`] = { height };\n acc[`& .text-${fontSize} + .cm-widgetBuffer + .cm-ySelectionCaret`] = { height };\n return acc;\n }, {}),\n};\n\nexport const markdownHighlightStyle = HighlightStyle.define(\n [\n {\n tag: [\n tags.keyword,\n tags.name,\n tags.deleted,\n tags.character,\n tags.propertyName,\n tags.macroName,\n tags.color,\n tags.constant(tags.name),\n tags.standard(tags.name),\n tags.definition(tags.name),\n tags.separator,\n tags.typeName,\n tags.className,\n tags.number,\n tags.changed,\n tags.annotation,\n tags.modifier,\n tags.self,\n tags.namespace,\n tags.operator,\n tags.operatorKeyword,\n tags.escape,\n tags.regexp,\n tags.special(tags.string),\n tags.meta,\n tags.comment,\n tags.atom,\n tags.bool,\n tags.special(tags.variableName),\n tags.processingInstruction,\n tags.string,\n tags.inserted,\n tags.invalid,\n ],\n color: 'inherit !important',\n },\n {\n tag: [tags.link, tags.url],\n color: 'inherit !important',\n textDecoration: 'none !important',\n },\n {\n tag: [tags.function(tags.variableName), tags.labelName],\n color: malibu,\n fontFamily: monospace,\n },\n {\n tag: [\n markdownTags.codeMark,\n markdownTags.emphasisMark,\n markdownTags.headingMark,\n markdownTags.linkLabel,\n markdownTags.linkReference,\n markdownTags.listMark,\n markdownTags.quoteMark,\n markdownTags.url,\n tags.meta,\n tags.processingInstruction,\n ],\n class: mark,\n },\n { tag: [markdownTags.codeText, markdownTags.inlineCode], class: 'font-mono' },\n { tag: tags.emphasis, class: italic },\n { tag: tags.heading1, class: heading[1] },\n { tag: tags.heading2, class: heading[2] },\n { tag: tags.heading3, class: heading[3] },\n { tag: tags.heading4, class: heading[4] },\n { tag: tags.heading5, class: heading[5] },\n { tag: tags.heading6, class: heading[6] },\n { tag: tags.strikethrough, class: strikethrough },\n { tag: tags.strong, class: bold },\n ],\n { scope: markdownLanguage, all: { fontFamily: get(tokens, 'fontFamily.body', []).join(',') } },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { EditorState, type Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { vim } from '@replit/codemirror-vim';\nimport defaultsDeep from 'lodash.defaultsdeep';\nimport get from 'lodash.get';\nimport React, {\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useState,\n type ComponentProps,\n} from 'react';\n\nimport { isDocAccessor } from '@dxos/echo-schema';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { basicBundle, basicTheme, markdownBundle, markdownTheme } from './extensions';\nimport { type EditorModel, useCollaboration } from '../../hooks';\nimport type { ThemeStyles } from '../../styles';\n\nexport const EditorModes = ['default', 'vim'] as const;\nexport type EditorMode = (typeof EditorModes)[number];\n\nexport type CursorInfo = {\n from: number;\n to: number;\n line: number;\n lines: number;\n after?: string;\n};\n\nexport type TextEditorRef = {\n editor: HTMLDivElement | null;\n state?: EditorState;\n view?: EditorView;\n};\n\nexport type TextEditorSlots = {\n root?: Omit<ComponentProps<'div'>, 'ref'>;\n editor?: {\n className?: string;\n placeholder?: string;\n spellCheck?: boolean;\n tabIndex?: number;\n theme?: ThemeStyles;\n };\n};\n\nexport type TextEditorProps = {\n model: EditorModel;\n extensions?: Extension[];\n slots?: TextEditorSlots;\n editorMode?: EditorMode;\n};\n\n/**\n * Base text editor.\n * NOTE: Rather than adding properties, try to create extensions that can be reused.\n */\nexport const BaseTextEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ model, extensions = [], slots, editorMode }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const tabsterDOMAttribute = useFocusableGroup({ tabBehavior: 'limited' });\n\n const [parent, setParent] = useState<HTMLDivElement | null>(null);\n const [state, setState] = useState<EditorState>();\n const [view, setView] = useState<EditorView>();\n useImperativeHandle(\n forwardedRef,\n () => ({\n editor: parent,\n state,\n view,\n }),\n [view, state, parent],\n );\n\n // TODO(burdon): Pass in extension?\n const collaboration = useCollaboration(model, themeMode);\n\n useEffect(() => {\n if (!parent) {\n return;\n }\n\n const initialText = isDocAccessor(model.content)\n ? get(model.content.handle.docSync(), model.content.path)\n : model.content?.toString();\n\n const state = EditorState.create({\n doc: initialText,\n extensions: [\n // TODO(burdon): Factor out VIM mode?\n editorMode === 'vim' && vim(),\n\n // Replication.\n collaboration,\n\n // Theme.\n slots?.editor?.theme && EditorView.theme(slots?.editor?.theme),\n\n // Custom.\n ...extensions,\n ].filter(Boolean) as Extension[],\n });\n\n setState(state);\n\n // NOTE: This repaints the editor.\n // If the new state is derived from the old state, it will likely not be visible other than the cursor resetting.\n // Ideally this should not be hit except when changing between text objects.\n view?.destroy();\n setView(new EditorView({ state, parent }));\n\n return () => {\n view?.destroy();\n setView(undefined);\n setState(undefined);\n };\n }, [parent, model.content, themeMode, editorMode]);\n\n const handleKeyUp = useCallback(\n (event: KeyboardEvent) => {\n const { key, altKey, shiftKey, metaKey, ctrlKey } = event;\n switch (key) {\n case 'Enter': {\n view?.contentDOM.focus();\n break;\n }\n\n case 'Escape': {\n editorMode === 'vim' && (altKey || shiftKey || metaKey || ctrlKey) && parent?.focus();\n break;\n }\n }\n },\n [view, editorMode],\n );\n\n return (\n <div\n key={model.id}\n ref={setParent}\n tabIndex={0}\n {...slots?.root}\n {...(editorMode !== 'vim' && tabsterDOMAttribute)}\n onKeyUp={handleKeyUp}\n />\n );\n },\n);\n\nexport const TextEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ extensions: _extensions, slots, ...props }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const extensions = [...(_extensions ?? []), basicBundle({ themeMode, placeholder: slots?.editor?.placeholder })];\n return (\n <BaseTextEditor\n ref={forwardedRef}\n extensions={extensions}\n slots={defaultsDeep({}, slots, { editor: { theme: basicTheme } })}\n {...props}\n />\n );\n },\n);\n\nexport const MarkdownEditor = forwardRef<TextEditorRef, TextEditorProps>(\n ({ extensions: _extensions, slots, ...props }, forwardedRef) => {\n const { themeMode } = useThemeContext();\n const extensions = [...(_extensions ?? []), markdownBundle({ themeMode })];\n return (\n <BaseTextEditor\n ref={forwardedRef}\n extensions={extensions}\n slots={defaultsDeep({}, slots, { editor: { theme: markdownTheme } })}\n {...props}\n />\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Extension } from '@codemirror/state';\nimport { useEffect, useMemo } from 'react';\nimport { yCollab } from 'y-codemirror.next';\n\nimport { generateName } from '@dxos/display-name';\nimport { isDocAccessor } from '@dxos/echo-schema';\nimport type { ThemeMode } from '@dxos/react-ui';\nimport { getColorForValue } from '@dxos/react-ui-theme';\nimport { YText } from '@dxos/text-model';\n\nimport type { EditorModel } from './useTextModel';\nimport { automergePlugin } from '../automerge/automerge-plugin';\n\n/**\n * Replication and awareness (incl. remote selection).\n * https://codemirror.net/docs/ref/#collab\n */\nexport const useCollaboration = (model: EditorModel, themeMode: ThemeMode): Extension | undefined => {\n const { provider, peer, content } = model;\n const extension = useMemo(() => {\n if (content instanceof YText) {\n return yCollab(content, provider?.awareness);\n } else if (isDocAccessor(content)) {\n return automergePlugin(content.handle, content.path);\n } else {\n return undefined;\n }\n }, []);\n\n useEffect(() => {\n if (provider && peer) {\n provider.awareness.setLocalStateField('user', {\n name: peer.name ?? generateName(peer.id),\n color: getColorForValue({ value: peer.id, type: 'color' }),\n colorLight: getColorForValue({ value: peer.id, themeMode, type: 'highlight' }),\n });\n }\n }, [provider, peer, themeMode]);\n\n return extension;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n Annotation,\n type EditorState,\n type Extension,\n Facet,\n StateEffect,\n StateField,\n type Transaction,\n type TransactionSpec,\n} from '@codemirror/state';\nimport { ViewPlugin, type EditorView, type PluginValue, type ViewUpdate } from '@codemirror/view';\n\nimport * as automerge from '@dxos/automerge/automerge';\nimport { type Heads, type Prop } from '@dxos/automerge/automerge';\n\nimport { PatchSemaphore } from './PatchSemaphore';\nimport { type IDocHandle } from './handle';\n\nexport type Value = {\n lastHeads: Heads;\n path: Prop[];\n unreconciledTransactions: Transaction[];\n};\n\ntype UpdateHeads = {\n newHeads: Heads;\n};\n\nexport const effectType = StateEffect.define<UpdateHeads>({});\n\nexport const updateHeads = (newHeads: Heads): StateEffect<UpdateHeads> => effectType.of({ newHeads });\n\nexport const getLastHeads = (state: EditorState, field: Field): Heads => state.field(field).lastHeads;\n\nexport const getPath = (state: EditorState, field: Field): Prop[] => state.field(field).path;\n\nexport type Field = StateField<Value>;\n\nconst semaphoreFacet = Facet.define<PatchSemaphore, PatchSemaphore>({\n combine: (values) => values.at(-1)!, // Take last.\n});\n\nexport type AutomergePlugin = {\n extension: Extension;\n};\n\nexport const automergePlugin = (handle: IDocHandle, path: Prop[]): AutomergePlugin => {\n const stateField: StateField<Value> = StateField.define({\n create: () => ({\n lastHeads: automerge.getHeads(handle.docSync()!),\n unreconciledTransactions: [],\n path: path.slice(),\n }),\n update: (value: Value, tr: Transaction) => {\n const result: Value = {\n lastHeads: value.lastHeads,\n unreconciledTransactions: value.unreconciledTransactions.slice(),\n path: path.slice(),\n };\n let clearUnreconciled = false;\n for (const effect of tr.effects) {\n if (effect.is(effectType)) {\n result.lastHeads = effect.value.newHeads;\n clearUnreconciled = true;\n }\n }\n if (clearUnreconciled) {\n result.unreconciledTransactions = [];\n } else {\n if (!isReconcileTx(tr)) {\n result.unreconciledTransactions.push(tr);\n }\n }\n return result;\n },\n });\n const semaphore = new PatchSemaphore(stateField);\n\n const viewPlugin = ViewPlugin.fromClass(\n class AutomergeCodemirrorViewPlugin implements PluginValue {\n private _view: EditorView;\n\n constructor(view: EditorView) {\n this._view = view;\n handle.addListener('change', this._handleChange);\n }\n\n update(update: ViewUpdate) {\n if (update.transactions.length > 0 && update.transactions.some((t) => !isReconcileTx(t))) {\n queueMicrotask(() => {\n this._view.state.facet(semaphoreFacet).reconcile(handle, this._view);\n });\n }\n }\n\n destroy() {\n handle.addListener('change', this._handleChange);\n }\n\n private _handleChange = () => {\n this._view.state.facet(semaphoreFacet).reconcile(handle, this._view);\n };\n },\n );\n\n return {\n extension: [stateField, semaphoreFacet.of(semaphore), viewPlugin],\n };\n};\n\nexport const reconcileAnnotationType = Annotation.define<unknown>();\n\nexport const isReconcileTx = (tr: Transaction): boolean => !!tr.annotation(reconcileAnnotationType);\n\nexport const makeReconcile = (tr: TransactionSpec) => {\n if (tr.annotations != null) {\n if (tr.annotations instanceof Array) {\n tr.annotations = [...tr.annotations, reconcileAnnotationType.of({})];\n } else {\n tr.annotations = [tr.annotations, reconcileAnnotationType.of({})];\n }\n } else {\n tr.annotations = [reconcileAnnotationType.of({})];\n }\n // return {\n // ...tr,\n // annotations: reconcileAnnotationType.of({})\n // }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorView } from '@codemirror/view';\n\nimport { next as automerge } from '@dxos/automerge/automerge';\n\nimport amToCodemirror from './amToCodemirror';\nimport codeMirrorToAm from './codeMirrorToAm';\nimport { type IDocHandle } from './handle';\nimport { type Field, isReconcileTx, getPath, reconcileAnnotationType, updateHeads, getLastHeads } from './plugin';\n\ntype Doc<T> = automerge.Doc<T>;\ntype Heads = automerge.Heads;\n\ntype ChangeFn = (atHeads: Heads, change: (doc: Doc<unknown>) => void) => Heads | undefined;\n\nexport class PatchSemaphore {\n _field!: Field;\n _inReconcile = false;\n _queue: Array<ChangeFn> = [];\n\n constructor(field?: Field) {\n if (field !== undefined) {\n this._field = field;\n }\n }\n\n reconcile = (handle: IDocHandle, view: EditorView) => {\n if (this._inReconcile) {\n return;\n }\n this._inReconcile = true;\n\n const path = getPath(view.state, this._field);\n const oldHeads = getLastHeads(view.state, this._field);\n let selection = view.state.selection;\n\n const transactions = view.state.field(this._field).unreconciledTransactions.filter((tx) => !isReconcileTx(tx));\n\n // First undo all the unreconciled transactions\n const toInvert = transactions.slice().reverse();\n for (const tx of toInvert) {\n const inverted = tx.changes.invert(tx.startState.doc);\n selection = selection.map(inverted);\n view.dispatch({\n changes: inverted,\n annotations: reconcileAnnotationType.of(true),\n });\n }\n\n // now apply the unreconciled transactions to the document\n let newHeads = codeMirrorToAm(this._field, handle, transactions, view.state);\n\n // NOTE: null and undefined each come from automerge and repo respectively\n if (newHeads === null || newHeads === undefined) {\n // TODO: @alexjg this is the call that's resetting the editor state on click\n newHeads = automerge.getHeads(handle.docSync()!);\n }\n\n // now get the diff between the updated state of the document and the heads\n // and apply that to the codemirror doc\n const diff = automerge.equals(oldHeads, newHeads) ? [] : automerge.diff(handle.docSync()!, oldHeads, newHeads);\n amToCodemirror(view, selection, path, diff);\n\n view.dispatch({\n effects: updateHeads(newHeads),\n annotations: reconcileAnnotationType.of({}),\n });\n\n this._inReconcile = false;\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ChangeSet, type ChangeSpec, type EditorSelection, type EditorState } from '@codemirror/state';\nimport { type EditorView } from '@codemirror/view';\n\nimport {\n type DelPatch,\n type InsertPatch,\n type Patch,\n type Prop,\n type PutPatch,\n type SpliceTextPatch,\n} from '@dxos/automerge/automerge';\n\nimport { reconcileAnnotationType } from './plugin';\n\nexport default (view: EditorView, selection: EditorSelection, target: Prop[], patches: Patch[]) => {\n for (const patch of patches) {\n const changeSpec = handlePatch(patch, target, view.state);\n if (changeSpec != null) {\n const changeSet = ChangeSet.of(changeSpec, view.state.doc.length, '\\n');\n selection = selection.map(changeSet, 1);\n view.dispatch({\n changes: changeSet,\n annotations: reconcileAnnotationType.of({}),\n });\n }\n }\n view.dispatch({\n selection,\n annotations: reconcileAnnotationType.of({}),\n });\n};\n\nconst handlePatch = (patch: Patch, target: Prop[], state: EditorState): ChangeSpec | null => {\n if (patch.action === 'insert') {\n return handleInsert(target, patch);\n } else if (patch.action === 'splice') {\n return handleSplice(target, patch);\n } else if (patch.action === 'del') {\n return handleDel(target, patch);\n } else if (patch.action === 'put') {\n return handlePut(target, patch, state);\n } else {\n return null;\n }\n};\n\nconst handleInsert = (target: Prop[], patch: InsertPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n const text = patch.values.map((v) => (v ? v.toString() : '')).join('');\n return [{ from: index, to: index, insert: text }];\n};\n\nconst handleSplice = (target: Prop[], patch: SpliceTextPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n return [{ from: index, insert: patch.value }];\n};\n\nconst handleDel = (target: Prop[], patch: DelPatch): Array<ChangeSpec> => {\n const index = charPath(target, patch.path);\n if (index == null) {\n return [];\n }\n const length = patch.length || 1;\n return [{ from: index, to: index + length }];\n};\n\nconst handlePut = (target: Prop[], patch: PutPatch, state: EditorState): Array<ChangeSpec> => {\n const index = charPath(target, [...patch.path, 0]);\n if (index == null) {\n return [];\n }\n const length = state.doc.length;\n if (typeof patch.value !== 'string') {\n return []; // TODO(dmaretskyi): How to handle non string values?\n }\n return [{ from: 0, to: length, insert: patch.value as any }];\n};\n\n// If the path of the patch is of the form [path, <index>] then we know this is\n// a path to a character within the sequence given by path\nconst charPath = (textPath: Prop[], candidatePath: Prop[]): number | null => {\n if (candidatePath.length !== textPath.length + 1) {\n return null;\n }\n for (let i = 0; i < textPath.length; i++) {\n if (textPath[i] !== candidatePath[i]) {\n return null;\n }\n }\n const index = candidatePath[candidatePath.length - 1];\n if (typeof index === 'number') {\n return index;\n }\n return null;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorState, type Text, type Transaction } from '@codemirror/state';\n\nimport { next as am, type Heads } from '@dxos/automerge/automerge';\n\nimport { type IDocHandle } from './handle';\nimport { type Field } from './plugin';\n\nexport default (\n field: Field,\n handle: IDocHandle,\n transactions: Transaction[],\n state: EditorState,\n): Heads | undefined => {\n const { lastHeads, path } = state.field(field);\n\n // We don't want to call `automerge.updateAt` if there are no changes.\n // Otherwise later on `automerge.diff` will return empty patches that result in a no-op but still mess up the selection.\n let hasChanges = false;\n for (const tr of transactions) {\n tr.changes.iterChanges(() => {\n hasChanges = true;\n });\n }\n\n if (!hasChanges) {\n return undefined;\n }\n\n const newHeads = handle.changeAt(lastHeads, (doc: am.Doc<unknown>) => {\n for (const tr of transactions) {\n tr.changes.iterChanges((fromA: number, toA: number, _fromB: number, _toB: number, inserted: Text) => {\n am.splice(doc, path, fromA, toA - fromA, inserted.toString());\n });\n }\n });\n return newHeads ?? undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useMemo } from 'react';\nimport type * as awarenessProtocol from 'y-protocols/awareness';\n\nimport {\n type DocAccessor,\n type Space,\n type TextObject,\n type AutomergeTextCompat,\n getRawDoc,\n isActualAutomergeObject,\n} from '@dxos/react-client/echo';\nimport { type Identity } from '@dxos/react-client/halo';\nimport type { YText, YXmlFragment } from '@dxos/text-model';\n\nimport { SpaceAwarenessProvider } from './yjs';\n\n// TODO(burdon): Move.\ntype Awareness = awarenessProtocol.Awareness;\ntype Provider = { awareness: Awareness };\n\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport type EditorModel = {\n id: string;\n content: string | YText | YXmlFragment | DocAccessor;\n provider?: Provider;\n peer?: {\n id: string;\n name?: string;\n };\n};\n\nexport type UseTextModelOptions = {\n identity?: Identity | null;\n space?: Space;\n text?: TextObject;\n};\n\n// TODO(burdon): Don't support returning undefined (and remove checks from calling code).\n// TODO(burdon): Decouple space (make Editor less dependent on entire stack)?\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport const useTextModel = ({ identity, space, text }: UseTextModelOptions): EditorModel | undefined => {\n const provider = useMemo(() => {\n if (isActualAutomergeObject(text)) {\n return undefined;\n }\n\n if (!space || !text?.doc) {\n return undefined;\n }\n\n return new SpaceAwarenessProvider({ space, doc: text.doc, channel: `yjs.awareness.${text.id}` });\n }, [identity, space, text, text?.doc]);\n\n const content = useMemo(() => {\n if (isActualAutomergeObject(text)) {\n const obj = text as any as AutomergeTextCompat;\n return getRawDoc(obj, [obj.field]);\n } else {\n return text?.content;\n }\n }, [text]);\n\n if (isActualAutomergeObject(text)) {\n const obj = text as any as AutomergeTextCompat;\n return {\n id: obj.id,\n content: content!,\n provider: undefined,\n peer: identity\n ? {\n id: identity.identityKey.toHex(),\n name: identity.profile?.displayName,\n }\n : undefined,\n };\n }\n\n if (!text?.doc || !text?.content) {\n return undefined;\n }\n\n return {\n id: text.doc.guid,\n content: text.content,\n provider,\n peer: identity\n ? {\n id: identity.identityKey.toHex(),\n name: identity.profile?.displayName,\n }\n : undefined,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// Copied from https://github.com/yjs/y-codemirror.next#example.\n\nimport * as random from 'lib0/random';\n\nconst cursorColors = [\n { color: '#30bced', light: '#30bced33' },\n { color: '#6eeb83', light: '#6eeb8333' },\n { color: '#ffbc42', light: '#ffbc4233' },\n { color: '#ecd444', light: '#ecd44433' },\n { color: '#ee6352', light: '#ee635233' },\n { color: '#9ac2c9', light: '#9ac2c933' },\n { color: '#8acb88', light: '#8acb8833' },\n { color: '#1be7ff', light: '#1be7ff33' },\n];\n\n// Select a random color for this user.\nexport const cursorColor = cursorColors[random.uint32() % cursorColors.length];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as decoding from 'lib0/decoding';\nimport * as encoding from 'lib0/encoding';\nimport { Observable } from 'lib0/observable';\nimport * as awarenessProtocol from 'y-protocols/awareness';\nimport { type Doc } from 'yjs';\n\nimport { log } from '@dxos/log';\nimport { type Space } from '@dxos/react-client/echo';\nimport { type GossipMessage } from '@dxos/react-client/mesh';\n\ntype Awareness = awarenessProtocol.Awareness;\n\n// Based on https://github.com/yjs/y-webrtc/blob/88baab2/src/y-webrtc.js.\n\nconst messageAwareness = 1;\nconst messageQueryAwareness = 3;\n\n/**\n * Yjs awareness provider on top of a DXOS space.\n */\nexport class SpaceAwarenessProvider extends Observable<any> {\n private readonly _space: Space;\n private readonly _awareness: Awareness;\n private readonly _clientId: number;\n private readonly _channel: string;\n\n constructor({ space, doc, channel, awareness }: { space: Space; doc: Doc; channel: string; awareness?: Awareness }) {\n super();\n this._space = space;\n this._awareness = awareness ?? new awarenessProtocol.Awareness(doc);\n this._channel = channel;\n this._clientId = doc.clientID;\n\n this._awareness.on('update', this._handleAwarenessUpdate.bind(this));\n this._space.listen(this._channel, this._handleSpaceMessage.bind(this));\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._handleBeforeUnload.bind(this));\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._handleBeforeUnload.bind(this));\n }\n\n // Post queryAwareness.\n const encoderAwarenessQuery = encoding.createEncoder();\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness);\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwarenessQuery));\n\n // Post local awareness state.\n const encoderAwarenessState = encoding.createEncoder();\n encoding.writeVarUint(encoderAwarenessState, messageAwareness);\n encoding.writeVarUint8Array(\n encoderAwarenessState,\n awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this._clientId]),\n );\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwarenessState));\n }\n\n get awareness(): Awareness {\n return this._awareness;\n }\n\n private _handleAwarenessUpdate({ added, updated, removed }: any, origin: any) {\n log('awareness update', { added, updated, removed, origin });\n const changedClients = added.concat(updated).concat(removed);\n const encoderAwareness = encoding.createEncoder();\n encoding.writeVarUint(encoderAwareness, messageAwareness);\n encoding.writeVarUint8Array(\n encoderAwareness,\n awarenessProtocol.encodeAwarenessUpdate(this._awareness, changedClients),\n );\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoderAwareness));\n }\n\n private _handleSpaceMessage({ payload }: GossipMessage) {\n log('space message', payload);\n const data = new Uint8Array(Array.from(Object.values(payload)));\n const encoder = this._readMessage(data);\n if (encoder) {\n void this._space.postMessage(this._channel, encoding.toUint8Array(encoder));\n }\n }\n\n private _readMessage(message: Uint8Array) {\n const decoder = decoding.createDecoder(message);\n const encoder = encoding.createEncoder();\n const messageType = decoding.readVarUint(decoder);\n\n let sendReply = false;\n switch (messageType) {\n case messageAwareness: {\n awarenessProtocol.applyAwarenessUpdate(this._awareness, decoding.readVarUint8Array(decoder), this);\n break;\n }\n\n case messageQueryAwareness: {\n encoding.writeVarUint(encoder, messageAwareness);\n encoding.writeVarUint8Array(\n encoder,\n awarenessProtocol.encodeAwarenessUpdate(this._awareness, Array.from(this._awareness.getStates().keys())),\n );\n sendReply = true;\n break;\n }\n\n default: {\n console.error('Invalid message:', messageType);\n return encoder;\n }\n }\n\n if (!sendReply) {\n // Nothing has been written, no answer created.\n return null;\n }\n\n return encoder;\n }\n\n private _handleBeforeUnload() {\n awarenessProtocol.removeAwarenessStates(this._awareness, [this._clientId], 'window unload');\n }\n}\n"],
5
+ "mappings": ";AAIA,SAASA,gBAAgB;AACzB,SAASC,KAAKC,SAAAA,QAAOC,oBAAoB;;;ACDzC,SAASC,QAAAA,aAAY;;;ACArB,SAASC,qBAAqB;AAC9B,SAASC,iBAAiBC,uBAAuBC,0BAA0B;AAE3E,SAASC,6BAA6B;AACtC,SAASC,YAAYC,mBAAmB;AASjC,IAAMC,cAAc,CAAC,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AA;AACtB,QAAML,aAAa;OAAKwD,eAAe,CAAA;IAAKE,YAAY;MAAEtD;MAAWuD,aAAa1D,OAAOgB,QAAQ0C;IAAY,CAAA;;AAC7G,SACE,sBAAA,cAAC9D,gBAAAA;IACCsD,KAAKhD;IACLH;IACAC,OAAO2D,aAAa,CAAC,GAAG3D,OAAO;MAAEgB,QAAQ;QAAEgB,OAAO4B;MAAW;IAAE,CAAA;IAC9D,GAAGJ;;AAGV,CAAA;AAGK,IAAMK,iBAAiBhE,2BAC5B,CAAC,EAAEE,YAAYwD,aAAavD,OAAO,GAAGwD,MAAAA,GAAStD,iBAAAA;AAC7C,QAAM,EAAEC,UAAS,IAAKC,gBAAAA;AACtB,QAAML,aAAa;OAAKwD,eAAe,CAAA;IAAKO,eAAe;MAAE3D;IAAU,CAAA;;AACvE,SACE,sBAAA,cAACP,gBAAAA;IACCsD,KAAKhD;IACLH;IACAC,OAAO2D,aAAa,CAAC,GAAG3D,OAAO;MAAEgB,QAAQ;QAAEgB,OAAO+B;MAAc;IAAE,CAAA;IACjE,GAAGP;;AAGV,CAAA;",
6
+ "names": ["TextKind", "Doc", "YText", "YXmlFragment", "tags", "closeBrackets", "bracketMatching", "defaultHighlightStyle", "syntaxHighlighting", "oneDarkHighlightStyle", "EditorView", "placeholder", "basicBundle", "themeMode", "placeholder", "_placeholder", "bracketMatching", "closeBrackets", "EditorView", "lineWrapping", "syntaxHighlighting", "oneDarkHighlightStyle", "defaultHighlightStyle", "filter", "Boolean", "get", "mx", "heading", "bold", "code", "codeWithoutMarks", "mx", "code", "italic", "strikethrough", "mark", "tailwindConfig", "tokens", "tailwindConfig", "theme", "basicTheme", "outline", "paddingInline", "lineHeight", "minBlockSize", "fontFamily", "get", "tokens", "join", "overflow", "padding", "caretColor", "backgroundColor", "border", "color", "textDecoration", "StateField", "onChangeExtension", "onChange", "StateField", "define", "create", "update", "_value", "transaction", "docChanged", "newDoc", "toString", "syntaxTree", "RangeSetBuilder", "StateField", "Decoration", "EditorView", "WidgetType", "Link", "WidgetType", "constructor", "_anchor", "_text", "_url", "eq", "other", "text", "url", "toDOM", "view", "link", "document", "createElement", "setAttribute", "textContent", "href", "onclick", "dispatch", "selection", "anchor", "hyperlinkDecoration", "StateField", "define", "create", "state", "update", "_", "tr", "provide", "field", "EditorView", "decorations", "from", "builder", "RangeSetBuilder", "cursor", "main", "head", "syntaxTree", "iterate", "enter", "node", "to", "name", "marks", "getChildren", "length", "sliceDoc", "urlNode", "getChild", "add", "Decoration", "replace", "widget", "undefined", "finish", "hoverTooltip", "tooltipContent", "markdownLinkRegexp", "createHyperlinkTooltip", "onHover", "regexp", "hoverTooltip", "view", "pos", "from", "text", "state", "doc", "lineAt", "p", "idx", "match", "substring", "undefined", "indexOf", "length", "url", "end", "above", "create", "el", "document", "createElement", "innerText", "className", "tooltipContent", "setAttribute", "dom", "Decoration", "EditorView", "MatchDecorator", "ViewPlugin", "markdownLinkRegexp", "linkDecorator", "MatchDecorator", "regexp", "decorate", "add", "from", "to", "match", "view", "_", "label", "url", "p0", "start", "end", "p1", "length", "p2", "p3", "Decoration", "mark", "class", "_attributes", "style", "hyperLinkExtension", "ViewPlugin", "fromClass", "HyperLinkView", "constructor", "decorator", "decorations", "createDeco", "update", "docChanged", "viewportChanged", "updateDeco", "eventHandlers", "mousedown", "event", "pos", "posAtDOM", "target", "console", "log", "keydown", "hyperlinkStyle", "EditorView", "baseTheme", "cursor", "textDecoration", "opacity", "fontFamily", "hyperlinkWidget", "closeBrackets", "closeBracketsKeymap", "defaultKeymap", "history", "historyKeymap", "indentWithTab", "markdownLanguage", "markdown", "bracketMatching", "defaultHighlightStyle", "foldKeymap", "indentOnInput", "syntaxHighlighting", "languages", "lintKeymap", "highlightSelectionMatches", "searchKeymap", "EditorState", "oneDarkHighlightStyle", "crosshairCursor", "drawSelection", "dropCursor", "EditorView", "highlightActiveLine", "highlightActiveLineGutter", "highlightSpecialChars", "keymap", "placeholder", "rectangularSelection", "styleTags", "Tag", "markdownTags", "headingMark", "Tag", "define", "quoteMark", "listMark", "linkMark", "emphasisMark", "codeMark", "codeText", "inlineCode", "url", "linkReference", "linkLabel", "markdownTagsExtension", "props", "styleTags", "HeaderMark", "QuoteMark", "ListMark", "LinkMark", "EmphasisMark", "CodeMark", "CodeText", "InlineCode", "URL", "LinkReference", "LinkLabel", "markdownLanguage", "HighlightStyle", "tags", "get", "chalky", "coral", "cyan", "invalid", "ivory", "stone", "malibu", "sage", "whiskey", "violet", "highlightBackground", "tooltipBackground", "monospace", "get", "tokens", "join", "markdownTheme", "backgroundColor", "border", "outline", "paddingInline", "lineHeight", "minBlockSize", "background", "padding", "caretColor", "borderLeftColor", "fontFamily", "overflow", "marginBlockStart", "paddingBlockStart", "paddingBlockEnd", "mixBlendMode", "display", "insetBlockStart", "blockSize", "verticalAlign", "margin", "color", "textDecorationLine", "textDecorationThickness", "textUnderlineOffset", "borderRadius", "Object", "keys", "reduce", "acc", "fontSize", "height", "markdownHighlightStyle", "HighlightStyle", "define", "tag", "tags", "keyword", "name", "deleted", "character", "propertyName", "macroName", "constant", "standard", "definition", "separator", "typeName", "className", "number", "changed", "annotation", "modifier", "self", "namespace", "operator", "operatorKeyword", "escape", "regexp", "special", "string", "meta", "comment", "atom", "bool", "variableName", "processingInstruction", "inserted", "invalid", "link", "url", "textDecoration", "function", "labelName", "malibu", "markdownTags", "codeMark", "emphasisMark", "headingMark", "linkLabel", "linkReference", "listMark", "quoteMark", "class", "mark", "codeText", "inlineCode", "emphasis", "italic", "heading1", "heading", "heading2", "heading3", "heading4", "heading5", "heading6", "strikethrough", "strong", "bold", "scope", "markdownLanguage", "all", "markdownBundle", "themeMode", "placeholder", "_placeholder", "bracketMatching", "closeBrackets", "EditorState", "allowMultipleSelections", "of", "EditorView", "lineWrapping", "crosshairCursor", "dropCursor", "drawSelection", "highlightActiveLine", "highlightActiveLineGutter", "highlightSelectionMatches", "highlightSpecialChars", "history", "indentOnInput", "rectangularSelection", "keymap", "closeBracketsKeymap", "defaultKeymap", "foldKeymap", "historyKeymap", "lintKeymap", "searchKeymap", "indentWithTab", "markdown", "base", "markdownLanguage", "codeLanguages", "languages", "extensions", "markdownTagsExtension", "syntaxHighlighting", "markdownHighlightStyle", "oneDarkHighlightStyle", "defaultHighlightStyle", "filter", "Boolean", "EditorState", "EditorView", "useFocusableGroup", "vim", "defaultsDeep", "get", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useState", "isDocAccessor", "useThemeContext", "useEffect", "useMemo", "yCollab", "generateName", "isDocAccessor", "getColorForValue", "YText", "Annotation", "Facet", "StateEffect", "StateField", "ViewPlugin", "automerge", "next", "automerge", "ChangeSet", "view", "selection", "target", "patches", "patch", "changeSpec", "handlePatch", "state", "changeSet", "ChangeSet", "of", "doc", "length", "map", "dispatch", "changes", "annotations", "reconcileAnnotationType", "action", "handleInsert", "handleSplice", "handleDel", "handlePut", "index", "charPath", "path", "text", "values", "v", "toString", "join", "from", "to", "insert", "value", "textPath", "candidatePath", "i", "next", "am", "field", "handle", "transactions", "state", "lastHeads", "path", "hasChanges", "tr", "changes", "iterChanges", "undefined", "newHeads", "changeAt", "doc", "fromA", "toA", "_fromB", "_toB", "inserted", "am", "splice", "toString", "PatchSemaphore", "constructor", "field", "_inReconcile", "_queue", "reconcile", "handle", "view", "path", "getPath", "state", "_field", "oldHeads", "getLastHeads", "selection", "transactions", "unreconciledTransactions", "filter", "tx", "isReconcileTx", "toInvert", "slice", "reverse", "inverted", "changes", "invert", "startState", "doc", "map", "dispatch", "annotations", "reconcileAnnotationType", "of", "newHeads", "codeMirrorToAm", "undefined", "automerge", "getHeads", "docSync", "diff", "equals", "amToCodemirror", "effects", "updateHeads", "effectType", "StateEffect", "define", "updateHeads", "newHeads", "of", "getLastHeads", "state", "field", "lastHeads", "getPath", "path", "semaphoreFacet", "Facet", "combine", "values", "at", "automergePlugin", "handle", "stateField", "StateField", "create", "getHeads", "docSync", "unreconciledTransactions", "slice", "update", "value", "tr", "result", "clearUnreconciled", "effect", "effects", "is", "isReconcileTx", "push", "semaphore", "PatchSemaphore", "viewPlugin", "ViewPlugin", "fromClass", "AutomergeCodemirrorViewPlugin", "constructor", "view", "_handleChange", "_view", "facet", "reconcile", "addListener", "transactions", "length", "some", "t", "queueMicrotask", "destroy", "extension", "reconcileAnnotationType", "Annotation", "annotation", "useCollaboration", "model", "themeMode", "provider", "peer", "content", "extension", "useMemo", "YText", "yCollab", "awareness", "isDocAccessor", "automergePlugin", "handle", "path", "undefined", "useEffect", "setLocalStateField", "name", "generateName", "id", "color", "getColorForValue", "value", "type", "colorLight", "useMemo", "getRawDoc", "isActualAutomergeObject", "random", "cursorColors", "color", "light", "cursorColor", "uint32", "length", "decoding", "encoding", "Observable", "awarenessProtocol", "log", "messageAwareness", "messageQueryAwareness", "SpaceAwarenessProvider", "constructor", "space", "doc", "channel", "awareness", "_space", "_awareness", "Awareness", "_channel", "_clientId", "clientID", "on", "_handleAwarenessUpdate", "bind", "listen", "_handleSpaceMessage", "window", "addEventListener", "_handleBeforeUnload", "process", "encoderAwarenessQuery", "createEncoder", "writeVarUint", "postMessage", "toUint8Array", "encoderAwarenessState", "writeVarUint8Array", "encodeAwarenessUpdate", "added", "updated", "removed", "origin", "changedClients", "concat", "encoderAwareness", "payload", "data", "Uint8Array", "Array", "from", "Object", "values", "encoder", "_readMessage", "message", "decoder", "createDecoder", "messageType", "readVarUint", "sendReply", "applyAwarenessUpdate", "readVarUint8Array", "getStates", "keys", "console", "error", "removeAwarenessStates", "useTextModel", "identity", "space", "text", "provider", "useMemo", "isActualAutomergeObject", "undefined", "doc", "SpaceAwarenessProvider", "channel", "id", "content", "obj", "getRawDoc", "field", "peer", "identityKey", "toHex", "name", "profile", "displayName", "guid", "EditorModes", "BaseTextEditor", "forwardRef", "model", "extensions", "slots", "editorMode", "forwardedRef", "themeMode", "useThemeContext", "tabsterDOMAttribute", "useFocusableGroup", "tabBehavior", "parent", "setParent", "useState", "state", "setState", "view", "setView", "useImperativeHandle", "editor", "collaboration", "useCollaboration", "useEffect", "initialText", "isDocAccessor", "content", "get", "handle", "docSync", "path", "toString", "EditorState", "create", "doc", "vim", "theme", "EditorView", "filter", "Boolean", "destroy", "undefined", "handleKeyUp", "useCallback", "event", "key", "altKey", "shiftKey", "metaKey", "ctrlKey", "contentDOM", "focus", "div", "id", "ref", "tabIndex", "root", "onKeyUp", "TextEditor", "_extensions", "props", "basicBundle", "placeholder", "defaultsDeep", "basicTheme", "MarkdownEditor", "markdownBundle", "markdownTheme"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts":{"bytes":2895,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":5365,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1192,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytes":560,"imports":[{"path":"packages/ui/react-ui-editor/src/styles/markdown.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/styles/tokens.ts","kind":"import-statement","original":"./tokens"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts":{"bytes":3552,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts":{"bytes":2042,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts":{"bytes":15934,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx":{"bytes":5911,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx":{"bytes":11946,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts":{"bytes":756,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts","kind":"import-statement","original":"./hyperlinkDecoration"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx","kind":"import-statement","original":"./hyperlinkTooltip"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx","kind":"import-statement","original":"./hyperlinkWidget"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts":{"bytes":4141,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts":{"bytes":28934,"imports":[{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts","kind":"import-statement","original":"./tags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytes":9988,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts","kind":"import-statement","original":"./tags"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytes":588,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytes":756,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts","kind":"import-statement","original":"./basic"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts","kind":"import-statement","original":"./change"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts","kind":"import-statement","original":"./hyperlink"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts","kind":"import-statement","original":"./markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts":{"bytes":11071,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytes":3923,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytes":8493,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts","kind":"import-statement","original":"./amToCodemirror"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts","kind":"import-statement","original":"./codeMirrorToAm"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytes":13093,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts","kind":"import-statement","original":"./PatchSemaphore"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytes":662,"imports":[{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytes":5351,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts","kind":"import-statement","original":"../automerge/automerge-plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytes":2636,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytes":15639,"imports":[{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytes":582,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytes":7380,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytes":672,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts","kind":"import-statement","original":"./useCollaboration"},{"path":"packages/ui/react-ui-editor/src/hooks/useTextModel.ts","kind":"import-statement","original":"./useTextModel"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytes":16768,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytes":734,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":484,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/index.ts","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":87576},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"lib0/random","kind":"import-statement","external":true},{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["BaseTextEditor","Doc","EditorModes","MarkdownEditor","SpaceAwarenessProvider","TextEditor","TextKind","YText","YXmlFragment","basicBundle","basicTheme","chalky","coral","createHyperlinkTooltip","cursorColor","cyan","highlightBackground","hyperLinkExtension","hyperlinkDecoration","hyperlinkStyle","hyperlinkWidget","invalid","ivory","malibu","markdownBundle","markdownHighlightStyle","markdownTheme","onChangeExtension","sage","stone","tags","tooltipBackground","useCollaboration","useTextModel","violet","whiskey"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":142},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts":{"bytesInOutput":591},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts":{"bytesInOutput":657},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":731},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytesInOutput":94},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts":{"bytesInOutput":289},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts":{"bytesInOutput":1897},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx":{"bytesInOutput":1083},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx":{"bytesInOutput":2395},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytesInOutput":2602},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts":{"bytesInOutput":7373},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":3616},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytesInOutput":1120},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytesInOutput":2340},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytesInOutput":1519},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts":{"bytesInOutput":2412},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytesInOutput":644},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":1285},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytesInOutput":3766},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0}},"bytes":38857}}}
1
+ {"inputs":{"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts":{"bytes":3072,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":5365,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1192,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytes":560,"imports":[{"path":"packages/ui/react-ui-editor/src/styles/markdown.ts","kind":"import-statement","original":"./markdown"},{"path":"packages/ui/react-ui-editor/src/styles/tokens.ts","kind":"import-statement","original":"./tokens"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts":{"bytes":3552,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts":{"bytes":585,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts":{"bytes":2042,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts":{"bytes":15934,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx":{"bytes":5911,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx":{"bytes":11946,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts":{"bytes":756,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts","kind":"import-statement","original":"./hyperlinkDecoration"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx","kind":"import-statement","original":"./hyperlinkTooltip"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx","kind":"import-statement","original":"./hyperlinkWidget"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts":{"bytes":4141,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts":{"bytes":28934,"imports":[{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts","kind":"import-statement","original":"./tags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytes":9988,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts","kind":"import-statement","original":"./tags"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytes":588,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts","kind":"import-statement","original":"./bundle"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts","kind":"import-statement","original":"./theme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytes":756,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts","kind":"import-statement","original":"./basic"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts","kind":"import-statement","original":"./change"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts","kind":"import-statement","original":"./hyperlink"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts","kind":"import-statement","original":"./markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts":{"bytes":11071,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytes":3923,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytes":8493,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts","kind":"import-statement","original":"./amToCodemirror"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts","kind":"import-statement","original":"./codeMirrorToAm"},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytes":13093,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts","kind":"import-statement","original":"./PatchSemaphore"}],"format":"esm"},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytes":662,"imports":[{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytes":5351,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts","kind":"import-statement","original":"../automerge/automerge-plugin"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytes":2636,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytes":15639,"imports":[{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytes":582,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytes":7380,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytes":672,"imports":[{"path":"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts","kind":"import-statement","original":"./useCollaboration"},{"path":"packages/ui/react-ui-editor/src/hooks/useTextModel.ts","kind":"import-statement","original":"./useTextModel"},{"path":"packages/ui/react-ui-editor/src/hooks/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytes":16768,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytes":734,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":484,"imports":[{"path":"packages/ui/react-ui-editor/src/components/TextEditor/index.ts","kind":"import-statement","original":"./TextEditor"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":87688},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/commands","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/language-data","kind":"import-statement","external":true},{"path":"@codemirror/lint","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"@codemirror/lang-markdown","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"y-codemirror.next","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"lib0/random","kind":"import-statement","external":true},{"path":"lib0/decoding","kind":"import-statement","external":true},{"path":"lib0/encoding","kind":"import-statement","external":true},{"path":"lib0/observable","kind":"import-statement","external":true},{"path":"y-protocols/awareness","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["BaseTextEditor","Doc","EditorModes","MarkdownEditor","SpaceAwarenessProvider","TextEditor","TextKind","YText","YXmlFragment","basicBundle","basicTheme","chalky","coral","createHyperlinkTooltip","cursorColor","cyan","highlightBackground","hyperLinkExtension","hyperlinkDecoration","hyperlinkStyle","hyperlinkWidget","invalid","ivory","malibu","markdownBundle","markdownHighlightStyle","markdownTheme","onChangeExtension","sage","stone","tags","tooltipBackground","useCollaboration","useTextModel","violet","whiskey"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":142},"packages/ui/react-ui-editor/src/components/TextEditor/index.ts":{"bytesInOutput":50},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/bundle.ts":{"bytesInOutput":630},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/basic/theme.ts":{"bytesInOutput":657},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":731},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytesInOutput":94},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/change.ts":{"bytesInOutput":289},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts":{"bytesInOutput":1913},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx":{"bytesInOutput":1083},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx":{"bytesInOutput":2395},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/bundle.ts":{"bytesInOutput":2602},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/tags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/theme.ts":{"bytesInOutput":7373},"packages/ui/react-ui-editor/src/components/TextEditor/extensions/markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx":{"bytesInOutput":3616},"packages/ui/react-ui-editor/src/hooks/useCollaboration.ts":{"bytesInOutput":1120},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/plugin.ts":{"bytesInOutput":2340},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/PatchSemaphore.ts":{"bytesInOutput":1519},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/amToCodemirror.ts":{"bytesInOutput":2412},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/codeMirrorToAm.ts":{"bytesInOutput":644},"packages/ui/react-ui-editor/src/automerge/automerge-plugin/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/useTextModel.ts":{"bytesInOutput":1285},"packages/ui/react-ui-editor/src/hooks/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/hooks/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/hooks/yjs/space-provider.ts":{"bytesInOutput":3766},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0}},"bytes":38912}}}
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/basic/bundle.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,6CAA8C,kBAAkB,KAAG,SAAS,EAQlE,CAAC"}
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/basic/bundle.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,6CAA8C,kBAAkB,KAAG,SAAS,EAUlE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-editor",
3
- "version": "0.3.9-main.c414ce0",
3
+ "version": "0.3.9-main.c64f707",
4
4
  "description": "Document editing experience within a DXOS shell.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -49,18 +49,18 @@
49
49
  "y-prosemirror": "~1.0.20",
50
50
  "y-protocols": "^1.0.5",
51
51
  "yjs": "^13.6.10",
52
- "@dxos/display-name": "0.3.9-main.c414ce0",
53
- "@dxos/automerge": "0.3.9-main.c414ce0",
54
- "@dxos/debug": "0.3.9-main.c414ce0",
55
- "@dxos/echo-schema": "0.3.9-main.c414ce0",
56
- "@dxos/invariant": "0.3.9-main.c414ce0",
57
- "@dxos/log": "0.3.9-main.c414ce0",
58
- "@dxos/protocols": "0.3.9-main.c414ce0",
59
- "@dxos/react-ui-theme": "0.3.9-main.c414ce0",
60
- "@dxos/react-async": "0.3.9-main.c414ce0",
61
- "@dxos/react-ui": "0.3.9-main.c414ce0",
62
- "@dxos/text-model": "0.3.9-main.c414ce0",
63
- "@dxos/util": "0.3.9-main.c414ce0"
52
+ "@dxos/automerge": "0.3.9-main.c64f707",
53
+ "@dxos/debug": "0.3.9-main.c64f707",
54
+ "@dxos/display-name": "0.3.9-main.c64f707",
55
+ "@dxos/echo-schema": "0.3.9-main.c64f707",
56
+ "@dxos/invariant": "0.3.9-main.c64f707",
57
+ "@dxos/log": "0.3.9-main.c64f707",
58
+ "@dxos/protocols": "0.3.9-main.c64f707",
59
+ "@dxos/react-async": "0.3.9-main.c64f707",
60
+ "@dxos/react-ui": "0.3.9-main.c64f707",
61
+ "@dxos/react-ui-theme": "0.3.9-main.c64f707",
62
+ "@dxos/text-model": "0.3.9-main.c64f707",
63
+ "@dxos/util": "0.3.9-main.c64f707"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@automerge/automerge-repo-network-broadcastchannel": "^1.0.19",
@@ -71,17 +71,17 @@
71
71
  "@types/react-dom": "^18.0.6",
72
72
  "react": "^18.2.0",
73
73
  "react-dom": "^18.2.0",
74
- "@dxos/config": "0.3.9-main.c414ce0",
75
- "@dxos/react-client": "0.3.9-main.c414ce0",
76
- "@dxos/echo-typegen": "0.3.9-main.c414ce0",
77
- "@dxos/react-ui": "0.3.9-main.c414ce0",
78
- "@dxos/storybook-utils": "0.3.9-main.c414ce0"
74
+ "@dxos/config": "0.3.9-main.c64f707",
75
+ "@dxos/echo-typegen": "0.3.9-main.c64f707",
76
+ "@dxos/react-client": "0.3.9-main.c64f707",
77
+ "@dxos/react-ui": "0.3.9-main.c64f707",
78
+ "@dxos/storybook-utils": "0.3.9-main.c64f707"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@phosphor-icons/react": "^2.0.5",
82
82
  "react": "^18.2.0",
83
83
  "react-dom": "^18.2.0",
84
- "@dxos/react-client": "0.3.9-main.c414ce0"
84
+ "@dxos/react-client": "0.3.9-main.c64f707"
85
85
  },
86
86
  "publishConfig": {
87
87
  "access": "public"
@@ -6,7 +6,7 @@ import { closeBrackets } from '@codemirror/autocomplete';
6
6
  import { bracketMatching, defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';
7
7
  import { type Extension } from '@codemirror/state';
8
8
  import { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';
9
- import { placeholder } from '@codemirror/view';
9
+ import { EditorView, placeholder } from '@codemirror/view';
10
10
 
11
11
  import type { ThemeMode } from '@dxos/react-ui';
12
12
 
@@ -21,6 +21,8 @@ export const basicBundle = ({ themeMode, placeholder: _placeholder }: BasicBundl
21
21
  closeBrackets(),
22
22
  _placeholder && placeholder(_placeholder),
23
23
 
24
+ EditorView.lineWrapping,
25
+
24
26
  // TODO(burdon): Is this required?
25
27
  themeMode === 'dark' ? syntaxHighlighting(oneDarkHighlightStyle) : syntaxHighlighting(defaultHighlightStyle),
26
28
  ].filter(Boolean) as Extension[];