@dxos/react-ui-editor 0.3.6-next.941b574 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +13 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/Markdown/markdownTheme.d.ts +10 -2
- package/dist/types/src/components/Markdown/markdownTheme.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/components/Markdown/markdownTheme.ts +10 -2
|
@@ -49,7 +49,7 @@ import * as encoding from "lib0/encoding";
|
|
|
49
49
|
import { Observable } from "lib0/observable";
|
|
50
50
|
import * as awarenessProtocol from "y-protocols/awareness";
|
|
51
51
|
import { log } from "@dxos/log";
|
|
52
|
-
var __dxlog_file = "/home/
|
|
52
|
+
var __dxlog_file = "/home/circleci/project/packages/ui/react-ui-editor/src/yjs/space-provider.ts";
|
|
53
53
|
var messageAwareness = 1;
|
|
54
54
|
var messageQueryAwareness = 3;
|
|
55
55
|
var SpaceAwarenessProvider = class extends Observable {
|
|
@@ -329,7 +329,8 @@ var markdownTheme = {
|
|
|
329
329
|
outline: "none"
|
|
330
330
|
},
|
|
331
331
|
"& .cm-line": {
|
|
332
|
-
paddingInline: 0
|
|
332
|
+
paddingInline: 0,
|
|
333
|
+
minBlockSize: "1.6em"
|
|
333
334
|
},
|
|
334
335
|
"& .cm-line *": {
|
|
335
336
|
lineHeight: 1.6
|
|
@@ -362,7 +363,8 @@ var markdownTheme = {
|
|
|
362
363
|
fontFamily: get(tokens, "fontFamily.body", []).join(",")
|
|
363
364
|
},
|
|
364
365
|
"& .cm-scroller": {
|
|
365
|
-
fontFamily: get(tokens, "fontFamily.mono", []).join(",")
|
|
366
|
+
fontFamily: get(tokens, "fontFamily.mono", []).join(","),
|
|
367
|
+
overflow: "visible"
|
|
366
368
|
},
|
|
367
369
|
"& .cm-activeLine": {
|
|
368
370
|
backgroundColor: "transparent"
|
|
@@ -375,13 +377,19 @@ var markdownTheme = {
|
|
|
375
377
|
padding: "2px 4px",
|
|
376
378
|
marginBlockStart: "-4px"
|
|
377
379
|
},
|
|
378
|
-
"& .cm-ySelection": {
|
|
379
|
-
|
|
380
|
+
"& .cm-ySelection, & .cm-selectionMatch": {
|
|
381
|
+
paddingBlockStart: ".15em",
|
|
382
|
+
paddingBlockEnd: ".15em"
|
|
380
383
|
},
|
|
381
384
|
"& .cm-ySelectionCaret": {
|
|
382
385
|
display: "inline-block",
|
|
386
|
+
insetBlockStart: ".1em",
|
|
387
|
+
blockSize: "1.4em",
|
|
383
388
|
verticalAlign: "top"
|
|
384
389
|
},
|
|
390
|
+
"& .cm-yLineSelection": {
|
|
391
|
+
margin: "0"
|
|
392
|
+
},
|
|
385
393
|
...Object.keys(get(tokens, "extend.fontSize", {})).reduce((acc, fontSize) => {
|
|
386
394
|
const height = get(tokens, [
|
|
387
395
|
"extend",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Composer/Composer.tsx", "../../../src/model.ts", "../../../src/yjs/cursors.ts", "../../../src/yjs/space-provider.ts", "../../../src/components/Markdown/Markdown.tsx", "../../../src/components/Markdown/markdownTags.ts", "../../../src/components/Markdown/markdownTheme.ts", "../../../src/styles/markdown.ts", "../../../src/styles/tokens.ts", "../../../src/components/RichText/RichText.tsx", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { forwardRef, memo, type Ref } from 'react';\n\nimport { YXmlFragment } from '@dxos/text-model';\n\nimport { type ComposerSlots, useTextModel, type UseTextModelOptions } from '../../model';\nimport { MarkdownComposer, type MarkdownComposerRef } from '../Markdown';\nimport { RichTextComposer, type TipTapEditor } from '../RichText';\n\nexport type ComposerProps = UseTextModelOptions & {\n slots?: ComposerSlots;\n};\n\n/**\n * Memoized composer which depends DXOS platform.\n *\n * Determines which composer to render based on the kind of text.\n */\n// NOTE: Without `memo`, if parent component uses `observer` the composer re-renders excessively.\n// TODO(wittjosiah): Factor out?\nexport const Composer = memo(\n forwardRef<TipTapEditor | MarkdownComposerRef, ComposerProps>(({ slots, ...options }, forwardedRef) => {\n const model = useTextModel(options);\n if (model?.content instanceof YXmlFragment) {\n return <RichTextComposer ref={forwardedRef as Ref<TipTapEditor>} model={model} slots={slots} />;\n } else {\n return <MarkdownComposer ref={forwardedRef as Ref<MarkdownComposerRef>} model={model} slots={slots} />;\n }\n }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorView } from '@codemirror/view';\nimport { type ComponentProps, useMemo } from 'react';\nimport type * as awarenessProtocol from 'y-protocols/awareness';\n\nimport { type Space, type TextObject } 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\nexport type ComposerSlots = {\n root?: Omit<ComponentProps<'div'>, 'ref'>;\n editor?: {\n className?: string;\n placeholder?: string;\n spellCheck?: boolean;\n tabIndex?: number;\n markdownTheme?: Parameters<typeof EditorView.theme>[0];\n };\n};\n\ntype Awareness = awarenessProtocol.Awareness;\ntype Provider = { awareness: Awareness };\n\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport type ComposerModel = {\n id: string;\n content: string | YText | YXmlFragment;\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(wittjosiah): Factor out to common package? @dxos/react-client?\n// TODO(burdon): Decouple space (make Composer less dependent on entire stack)?\nexport const useTextModel = ({ identity, space, text }: UseTextModelOptions): ComposerModel | undefined => {\n const provider = useMemo(() => {\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?.doc]);\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { autocompletion, completionKeymap, closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';\nimport { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport { markdown, markdownLanguage } 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 { searchKeymap, highlightSelectionMatches } from '@codemirror/search';\nimport { EditorState, StateField, type Text } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport {\n keymap,\n crosshairCursor,\n drawSelection,\n dropCursor,\n highlightActiveLine,\n highlightActiveLineGutter,\n highlightSpecialChars,\n placeholder,\n rectangularSelection,\n EditorView,\n} from '@codemirror/view';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { vim } from '@replit/codemirror-vim';\nimport React, {\n type KeyboardEvent,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n useMemo,\n useCallback,\n} from 'react';\nimport { yCollab } from 'y-codemirror.next';\n\nimport { generateName } from '@dxos/display-name';\nimport { useThemeContext } from '@dxos/react-ui';\nimport { getColorForValue } from '@dxos/react-ui-theme';\nimport { YText } from '@dxos/text-model';\n\nimport { markdownTagsExtension } from './markdownTags';\nimport { markdownDarkHighlighting, markdownTheme } from './markdownTheme';\nimport { type ComposerModel, type ComposerSlots } from '../../model';\n\nexport const EditorModes = ['default', 'vim'] as const;\nexport type EditorMode = (typeof EditorModes)[number];\n\nexport type MarkdownComposerProps = {\n model?: ComposerModel;\n slots?: ComposerSlots;\n editorMode?: EditorMode;\n onChange?: (content: string | Text) => void;\n};\n\nexport type MarkdownComposerRef = {\n editor: HTMLDivElement | null;\n state?: EditorState;\n view?: EditorView;\n};\n\nexport const MarkdownComposer = forwardRef<MarkdownComposerRef, MarkdownComposerProps>(\n ({ model, slots = {}, onChange, editorMode }, forwardedRef) => {\n const { id, content, provider, peer } = model ?? {};\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\n useImperativeHandle(forwardedRef, () => ({\n editor: parent,\n state,\n view,\n }));\n\n const listenChangesExtension = useMemo(\n () =>\n StateField.define({\n create: () => null,\n update: (_value, transaction) => {\n if (transaction.docChanged && onChange) {\n onChange(transaction.newDoc);\n }\n return null;\n },\n }),\n [onChange],\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 useEffect(() => {\n if (!parent) {\n return;\n }\n\n const state = EditorState.create({\n doc: content?.toString(),\n extensions: [\n // Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799.\n listenChangesExtension,\n\n ...(editorMode === 'vim' ? [vim()] : []),\n\n // All of https://github.com/codemirror/basic-setup minus line numbers and fold gutter.\n highlightActiveLineGutter(),\n highlightSpecialChars(),\n history(),\n drawSelection(),\n dropCursor(),\n EditorState.allowMultipleSelections.of(true),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n bracketMatching(),\n closeBrackets(),\n autocompletion(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightSelectionMatches(),\n placeholder(slots.editor?.placeholder ?? ''), // TODO(burdon): Needs consistent styling.\n keymap.of([\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap,\n ...lintKeymap,\n indentWithTab,\n ]),\n EditorView.lineWrapping,\n // Theme\n markdown({ base: markdownLanguage, codeLanguages: languages, extensions: [markdownTagsExtension] }),\n EditorView.theme({ ...markdownTheme, ...slots.editor?.markdownTheme }),\n ...(themeMode === 'dark'\n ? [syntaxHighlighting(oneDarkHighlightStyle)]\n : [syntaxHighlighting(defaultHighlightStyle)]),\n // TODO(thure): All but one rule here apply to both themes; rename or refactor.\n syntaxHighlighting(markdownDarkHighlighting),\n\n // Collaboration\n ...(content instanceof YText ? [yCollab(content, provider?.awareness)] : []),\n ],\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, content, provider?.awareness, themeMode, editorMode]);\n\n const handleKeyUp = useCallback(\n ({ key, altKey, shiftKey, metaKey, ctrlKey }: KeyboardEvent) => {\n switch (key) {\n case 'Enter':\n view?.contentDOM.focus();\n break;\n\n case 'Escape':\n editorMode === 'vim' && (altKey || shiftKey || metaKey || ctrlKey) && parent?.focus();\n break;\n }\n },\n [view, editorMode],\n );\n\n return (\n <div\n tabIndex={0}\n key={id}\n {...slots.root}\n onKeyUp={handleKeyUp}\n {...(editorMode !== 'vim' ? tabsterDOMAttribute : {})}\n ref={setParent}\n />\n );\n },\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 './markdownTags';\nimport { bold, heading, italic, mark, strikethrough, tokens } from '../../styles';\n\n// TODO(burdon): Use theme colors.\n// TODO(burdon): Light mode.\n\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';\nexport const cursor = '#ffffff';\n\nconst monospace = get(tokens, 'fontFamily.mono', ['monospace']).join(',');\n\nexport const markdownTheme = {\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 '.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 },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '& .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.150', '#00ffff') + 'aa',\n },\n '.dark & .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.500', '#00ffff') + 'aa',\n },\n '& .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.100', '#00ffff') + '44',\n },\n '.dark & .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.400', '#00ffff') + '44',\n },\n '& .cm-content': {\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: cursor,\n },\n '& .cm-cursor': {\n borderLeftColor: 'black',\n },\n '.dark & .cm-cursor': {\n borderLeftColor: cursor,\n },\n '.cm-placeholder': {\n fontFamily: get(tokens, 'fontFamily.body', []).join(','),\n },\n '& .cm-scroller': {\n fontFamily: get(tokens, 'fontFamily.mono', []).join(','),\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': {\n display: 'inline-block',\n },\n '& .cm-ySelectionCaret': {\n display: 'inline-block',\n verticalAlign: 'top',\n },\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 markdownDarkHighlighting = 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 { 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 { tailwindConfig, type TailwindConfig } from '@dxos/react-ui-theme';\n\n// TODO(thure): Why export the whole theme? Can this be done differently?\nexport const tokens: TailwindConfig['theme'] = tailwindConfig({}).theme;\n", "//\n// Copyright 2022 DXOS.org\n//\nimport { mergeAttributes } from '@tiptap/core';\nimport Collaboration from '@tiptap/extension-collaboration';\nimport CollaborationCursor from '@tiptap/extension-collaboration-cursor';\nimport Heading from '@tiptap/extension-heading';\nimport ListItem from '@tiptap/extension-list-item';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { type Editor, EditorContent, useEditor as useNaturalEditor } from '@tiptap/react';\nimport StarterKit from '@tiptap/starter-kit';\nimport React, { forwardRef, useImperativeHandle, useMemo } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type ComposerModel, type ComposerSlots } from '../../model';\nimport {\n blockquote,\n bold,\n codeBlock,\n heading,\n type HeadingLevel,\n horizontalRule,\n italic,\n listItem,\n orderedList,\n paragraph,\n strikethrough,\n unorderedList,\n codeWithoutMarks,\n} from '../../styles';\nimport { cursorColor } from '../../yjs';\n\nexport type TipTapEditor = Editor;\n\ntype UseEditorOptions = {\n model?: ComposerModel;\n placeholder?: string;\n slots?: Pick<ComposerSlots, 'editor'>;\n};\n\nconst useEditor = ({ model, placeholder = 'Enter text…', slots = {} }: UseEditorOptions) => {\n const extensions = useMemo(\n () => [\n StarterKit.configure({\n // Extensions\n history: false,\n // Nodes\n blockquote: {\n HTMLAttributes: {\n class: blockquote,\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: unorderedList,\n },\n },\n codeBlock: {\n HTMLAttributes: {\n class: codeBlock,\n },\n },\n heading: false, // (thure): `StarterKit` doesn’t let you configure how headings are rendered, see `Heading` below.\n horizontalRule: {\n HTMLAttributes: {\n class: horizontalRule,\n },\n },\n listItem: false, // (thure): `StarterKit` doesn’t let you configure how list items are rendered, see `ListItem` below.\n orderedList: {\n HTMLAttributes: {\n class: orderedList,\n },\n },\n paragraph: {\n HTMLAttributes: {\n class: paragraph,\n },\n },\n // Marks\n bold: {\n HTMLAttributes: {\n class: bold,\n },\n },\n code: {\n HTMLAttributes: {\n class: codeWithoutMarks,\n },\n },\n italic: {\n HTMLAttributes: {\n class: italic,\n },\n },\n strike: {\n HTMLAttributes: {\n class: strikethrough,\n },\n },\n }),\n Heading.extend({\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level: HeadingLevel = hasLevel ? node.attrs.level : this.options.levels[0];\n\n return [\n `h${level}`,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n class: heading[level],\n }),\n 0,\n ];\n },\n }),\n ListItem.extend({\n renderHTML: ({ HTMLAttributes }) => [\n 'li',\n mergeAttributes(HTMLAttributes, {\n marker: '• ',\n class: listItem,\n }),\n ['div', { role: 'none' }, 0],\n ],\n }),\n // https://github.com/ueberdosis/tiptap/tree/main/packages/extension-collaboration\n ...(model && typeof model.content !== 'string' ? [Collaboration.configure({ fragment: model.content })] : []),\n ...(model?.provider\n ? [\n CollaborationCursor.configure({\n provider: model.provider,\n user: model.peer && {\n name: model.peer.name ?? generateName(model.peer.id),\n color: cursorColor.color,\n },\n }),\n ]\n : []),\n Placeholder.configure({\n placeholder,\n emptyEditorClass: 'before:content-[attr(data-placeholder)] before:absolute opacity-50 cursor-text',\n }),\n ],\n [model?.id],\n );\n\n return useNaturalEditor(\n {\n extensions,\n editorProps: {\n attributes: {\n class: mx('focus:outline-none focus-visible:outline-none', slots.editor?.className),\n spellcheck: slots.editor?.spellCheck === false ? 'false' : 'true',\n tabindex: slots.editor?.tabIndex ? String(slots.editor?.tabIndex) : '0',\n },\n },\n },\n [extensions],\n );\n};\n\nexport type RichTextComposerProps = UseEditorOptions & {\n slots?: ComposerSlots;\n};\n\n/**\n * @deprecated\n */\n// TODO(burdon): Currently broken.\nexport const RichTextComposer = forwardRef<Editor | null, RichTextComposerProps>((props, ref) => {\n const editor = useEditor(props);\n useImperativeHandle<Editor | null, Editor | null>(ref, () => editor, [editor]);\n\n // Reference:\n // https://tiptap.dev/installation/react\n // https://github.com/ueberdosis/tiptap\n // https://tiptap.dev/guide/output/#option-3-yjs\n return <EditorContent {...props.slots?.root} editor={editor} />;\n});\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport * from './components';\nexport * from './model';\n\nexport { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';\nexport { Doc, YText, YXmlFragment } from '@dxos/text-model';\n"],
|
|
5
|
-
"mappings": ";AAIA,OAAOA,UAASC,cAAAA,aAAYC,YAAsB;AAElD,SAASC,oBAAoB;;;ACD7B,SAA8BC,eAAe;;;ACC7C,YAAYC,YAAY;AAExB,IAAMC,eAAe;EACnB;IAAEC,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAW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D;GAAG;AAGb,SAAOK,iBACL;IACElD;IACAmD,aAAa;MACXC,YAAY;QACV7C,OAAO8C,IAAG,iDAAiDtD,MAAMuD,QAAQC,SAAAA;QACzEC,YAAYzD,MAAMuD,QAAQG,eAAe,QAAQ,UAAU;QAC3DC,UAAU3D,MAAMuD,QAAQK,WAAWC,OAAO7D,MAAMuD,QAAQK,QAAAA,IAAY;MACtE;IACF;EACF,GACA;IAAC3D;GAAW;AAEhB;AAUO,IAAM6D,mBAAmBC,gBAAAA,YAAiD,CAACC,OAAOC,QAAAA;AACvF,QAAMV,SAAS1D,UAAUmE,KAAAA;AACzBE,EAAAA,qBAAkDD,KAAK,MAAMV,QAAQ;IAACA;GAAO;AAM7E,SAAO,gBAAAY,OAAA,cAACC,eAAAA;IAAe,GAAGJ,MAAMhE,OAAOqE;IAAMd;;AAC/C,CAAA;;;AT7JO,IAAMe,WAAWC,qBACtBC,gBAAAA,YAA8D,CAAC,EAAEC,OAAO,GAAGC,QAAAA,GAAWC,iBAAAA;AACpF,QAAMC,QAAQC,aAAaH,OAAAA;AAC3B,MAAIE,OAAOE,mBAAmBC,cAAc;AAC1C,WAAO,gBAAAC,OAAA,cAACC,kBAAAA;MAAiBC,KAAKP;MAAmCC;MAAcH;;EACjF,OAAO;AACL,WAAO,gBAAAO,OAAA,cAACG,kBAAAA;MAAiBD,KAAKP;MAA0CC;MAAcH;;EACxF;AACF,CAAA,CAAA;;;AUxBF,SAASW,gBAAgB;AACzB,SAASC,KAAKC,SAAAA,QAAOC,gBAAAA,qBAAoB;",
|
|
6
|
-
"names": ["React", "forwardRef", "memo", "YXmlFragment", "useMemo", "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", "doc", "undefined", "SpaceAwarenessProvider", "channel", "id", "content", "guid", "peer", "identityKey", "toHex", "name", "profile", "displayName", "autocompletion", "completionKeymap", "closeBrackets", "closeBracketsKeymap", "defaultKeymap", "history", "historyKeymap", "indentWithTab", "markdown", "markdownLanguage", "bracketMatching", "defaultHighlightStyle", "foldKeymap", "indentOnInput", "syntaxHighlighting", "languages", "lintKeymap", "searchKeymap", "highlightSelectionMatches", "EditorState", "StateField", "oneDarkHighlightStyle", "keymap", "crosshairCursor", "drawSelection", "dropCursor", "highlightActiveLine", "highlightActiveLineGutter", "highlightSpecialChars", "placeholder", "rectangularSelection", "EditorView", "useFocusableGroup", "vim", "React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "useMemo", "useCallback", "yCollab", "generateName", "useThemeContext", "getColorForValue", "YText", "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", "mx", "heading", "blockquote", "unorderedList", "orderedList", "listItem", "codeBlock", "horizontalRule", "paragraph", "bold", "code", "codeWithoutMarks", "mx", "code", "italic", "strikethrough", "mark", "tailwindConfig", "tokens", "tailwindConfig", "theme", "ivory", "malibu", "highlightBackground", "tooltipBackground", "cursor", "monospace", "get", "tokens", "join", "markdownTheme", "border", "backgroundColor", "tooltipBackground", "borderTopColor", "borderBottomColor", "highlightBackground", "color", "ivory", "outline", "paddingInline", "lineHeight", "background", "caretColor", "borderLeftColor", "fontFamily", "padding", "marginBlockStart", "display", "verticalAlign", "Object", "keys", "reduce", "acc", "fontSize", "height", "markdownDarkHighlighting", "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", "EditorModes", "MarkdownComposer", "forwardRef", "model", "slots", "onChange", "editorMode", "forwardedRef", "id", "content", "provider", "peer", "themeMode", "useThemeContext", "tabsterDOMAttribute", "useFocusableGroup", "tabBehavior", "parent", "setParent", "useState", "state", "setState", "view", "setView", "useImperativeHandle", "editor", "listenChangesExtension", "useMemo", "StateField", "define", "create", "update", "_value", "transaction", "docChanged", "newDoc", "useEffect", "awareness", "setLocalStateField", "name", "generateName", "color", "getColorForValue", "value", "type", "colorLight", "EditorState", "doc", "toString", "extensions", "vim", "highlightActiveLineGutter", "highlightSpecialChars", "history", "drawSelection", "dropCursor", "allowMultipleSelections", "of", "indentOnInput", "syntaxHighlighting", "defaultHighlightStyle", "fallback", "bracketMatching", "closeBrackets", "autocompletion", "rectangularSelection", "crosshairCursor", "highlightActiveLine", "highlightSelectionMatches", "placeholder", "keymap", "closeBracketsKeymap", "defaultKeymap", "searchKeymap", "historyKeymap", "foldKeymap", "completionKeymap", "lintKeymap", "indentWithTab", "EditorView", "lineWrapping", "markdown", "base", "markdownLanguage", "codeLanguages", "languages", "markdownTagsExtension", "theme", "markdownTheme", "oneDarkHighlightStyle", "markdownDarkHighlighting", "YText", "yCollab", "destroy", "undefined", "handleKeyUp", "useCallback", "key", "altKey", "shiftKey", "metaKey", "ctrlKey", "contentDOM", "focus", "div", "tabIndex", "root", "onKeyUp", "ref", "mergeAttributes", "Collaboration", "CollaborationCursor", "Heading", "ListItem", "Placeholder", "EditorContent", "useEditor", "useNaturalEditor", "StarterKit", "React", "forwardRef", "useImperativeHandle", "useMemo", "generateName", "mx", "useEditor", "model", "placeholder", "slots", "extensions", "useMemo", "StarterKit", "configure", "history", "blockquote", "HTMLAttributes", "class", "bulletList", "unorderedList", "codeBlock", "heading", "horizontalRule", "listItem", "orderedList", "paragraph", "bold", "code", "codeWithoutMarks", "italic", "strike", "strikethrough", "Heading", "extend", "renderHTML", "node", "hasLevel", "options", "levels", "includes", "attrs", "level", "mergeAttributes", "ListItem", "marker", "role", "content", "Collaboration", "fragment", "provider", "CollaborationCursor", "user", "peer", "name", "generateName", "id", "color", "cursorColor", "Placeholder", "emptyEditorClass", "useNaturalEditor", "editorProps", "attributes", "mx", "editor", "className", "spellcheck", "spellCheck", "tabindex", "tabIndex", "String", "RichTextComposer", "forwardRef", "props", "ref", "useImperativeHandle", "React", "EditorContent", "root", "Composer", "memo", "forwardRef", "slots", "options", "forwardedRef", "model", "useTextModel", "content", "YXmlFragment", "React", "RichTextComposer", "ref", "MarkdownComposer", "TextKind", "Doc", "YText", "YXmlFragment"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { forwardRef, memo, type Ref } from 'react';\n\nimport { YXmlFragment } from '@dxos/text-model';\n\nimport { type ComposerSlots, useTextModel, type UseTextModelOptions } from '../../model';\nimport { MarkdownComposer, type MarkdownComposerRef } from '../Markdown';\nimport { RichTextComposer, type TipTapEditor } from '../RichText';\n\nexport type ComposerProps = UseTextModelOptions & {\n slots?: ComposerSlots;\n};\n\n/**\n * Memoized composer which depends DXOS platform.\n *\n * Determines which composer to render based on the kind of text.\n */\n// NOTE: Without `memo`, if parent component uses `observer` the composer re-renders excessively.\n// TODO(wittjosiah): Factor out?\nexport const Composer = memo(\n forwardRef<TipTapEditor | MarkdownComposerRef, ComposerProps>(({ slots, ...options }, forwardedRef) => {\n const model = useTextModel(options);\n if (model?.content instanceof YXmlFragment) {\n return <RichTextComposer ref={forwardedRef as Ref<TipTapEditor>} model={model} slots={slots} />;\n } else {\n return <MarkdownComposer ref={forwardedRef as Ref<MarkdownComposerRef>} model={model} slots={slots} />;\n }\n }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type EditorView } from '@codemirror/view';\nimport { type ComponentProps, useMemo } from 'react';\nimport type * as awarenessProtocol from 'y-protocols/awareness';\n\nimport { type Space, type TextObject } 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\nexport type ComposerSlots = {\n root?: Omit<ComponentProps<'div'>, 'ref'>;\n editor?: {\n className?: string;\n placeholder?: string;\n spellCheck?: boolean;\n tabIndex?: number;\n markdownTheme?: Parameters<typeof EditorView.theme>[0];\n };\n};\n\ntype Awareness = awarenessProtocol.Awareness;\ntype Provider = { awareness: Awareness };\n\n// TODO(wittjosiah): Factor out to common package? @dxos/react-client?\nexport type ComposerModel = {\n id: string;\n content: string | YText | YXmlFragment;\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(wittjosiah): Factor out to common package? @dxos/react-client?\n// TODO(burdon): Decouple space (make Composer less dependent on entire stack)?\nexport const useTextModel = ({ identity, space, text }: UseTextModelOptions): ComposerModel | undefined => {\n const provider = useMemo(() => {\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?.doc]);\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { autocompletion, completionKeymap, closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';\nimport { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport { markdown, markdownLanguage } 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 { searchKeymap, highlightSelectionMatches } from '@codemirror/search';\nimport { EditorState, StateField, type Text } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport {\n keymap,\n crosshairCursor,\n drawSelection,\n dropCursor,\n highlightActiveLine,\n highlightActiveLineGutter,\n highlightSpecialChars,\n placeholder,\n rectangularSelection,\n EditorView,\n} from '@codemirror/view';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { vim } from '@replit/codemirror-vim';\nimport React, {\n type KeyboardEvent,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n useMemo,\n useCallback,\n} from 'react';\nimport { yCollab } from 'y-codemirror.next';\n\nimport { generateName } from '@dxos/display-name';\nimport { useThemeContext } from '@dxos/react-ui';\nimport { getColorForValue } from '@dxos/react-ui-theme';\nimport { YText } from '@dxos/text-model';\n\nimport { markdownTagsExtension } from './markdownTags';\nimport { markdownDarkHighlighting, markdownTheme } from './markdownTheme';\nimport { type ComposerModel, type ComposerSlots } from '../../model';\n\nexport const EditorModes = ['default', 'vim'] as const;\nexport type EditorMode = (typeof EditorModes)[number];\n\nexport type MarkdownComposerProps = {\n model?: ComposerModel;\n slots?: ComposerSlots;\n editorMode?: EditorMode;\n onChange?: (content: string | Text) => void;\n};\n\nexport type MarkdownComposerRef = {\n editor: HTMLDivElement | null;\n state?: EditorState;\n view?: EditorView;\n};\n\nexport const MarkdownComposer = forwardRef<MarkdownComposerRef, MarkdownComposerProps>(\n ({ model, slots = {}, onChange, editorMode }, forwardedRef) => {\n const { id, content, provider, peer } = model ?? {};\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\n useImperativeHandle(forwardedRef, () => ({\n editor: parent,\n state,\n view,\n }));\n\n const listenChangesExtension = useMemo(\n () =>\n StateField.define({\n create: () => null,\n update: (_value, transaction) => {\n if (transaction.docChanged && onChange) {\n onChange(transaction.newDoc);\n }\n return null;\n },\n }),\n [onChange],\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 useEffect(() => {\n if (!parent) {\n return;\n }\n\n const state = EditorState.create({\n doc: content?.toString(),\n extensions: [\n // Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799.\n listenChangesExtension,\n\n ...(editorMode === 'vim' ? [vim()] : []),\n\n // All of https://github.com/codemirror/basic-setup minus line numbers and fold gutter.\n highlightActiveLineGutter(),\n highlightSpecialChars(),\n history(),\n drawSelection(),\n dropCursor(),\n EditorState.allowMultipleSelections.of(true),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n bracketMatching(),\n closeBrackets(),\n autocompletion(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightSelectionMatches(),\n placeholder(slots.editor?.placeholder ?? ''), // TODO(burdon): Needs consistent styling.\n keymap.of([\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap,\n ...lintKeymap,\n indentWithTab,\n ]),\n EditorView.lineWrapping,\n // Theme\n markdown({ base: markdownLanguage, codeLanguages: languages, extensions: [markdownTagsExtension] }),\n EditorView.theme({ ...markdownTheme, ...slots.editor?.markdownTheme }),\n ...(themeMode === 'dark'\n ? [syntaxHighlighting(oneDarkHighlightStyle)]\n : [syntaxHighlighting(defaultHighlightStyle)]),\n // TODO(thure): All but one rule here apply to both themes; rename or refactor.\n syntaxHighlighting(markdownDarkHighlighting),\n\n // Collaboration\n ...(content instanceof YText ? [yCollab(content, provider?.awareness)] : []),\n ],\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, content, provider?.awareness, themeMode, editorMode]);\n\n const handleKeyUp = useCallback(\n ({ key, altKey, shiftKey, metaKey, ctrlKey }: KeyboardEvent) => {\n switch (key) {\n case 'Enter':\n view?.contentDOM.focus();\n break;\n\n case 'Escape':\n editorMode === 'vim' && (altKey || shiftKey || metaKey || ctrlKey) && parent?.focus();\n break;\n }\n },\n [view, editorMode],\n );\n\n return (\n <div\n tabIndex={0}\n key={id}\n {...slots.root}\n onKeyUp={handleKeyUp}\n {...(editorMode !== 'vim' ? tabsterDOMAttribute : {})}\n ref={setParent}\n />\n );\n },\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 './markdownTags';\nimport { bold, heading, italic, mark, strikethrough, tokens } from '../../styles';\n\n// TODO(burdon): Use theme colors.\n// TODO(burdon): Light mode.\n\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';\nexport const cursor = '#ffffff';\n\nconst monospace = get(tokens, 'fontFamily.mono', ['monospace']).join(',');\n\nexport const markdownTheme = {\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 '.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 minBlockSize: '1.6em',\n },\n '& .cm-line *': {\n lineHeight: 1.6,\n },\n '& .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.150', '#00ffff') + 'aa',\n },\n '.dark & .cm-selectionBackground': {\n background: get(tokens, 'extend.colors.primary.500', '#00ffff') + 'aa',\n },\n '& .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.100', '#00ffff') + '44',\n },\n '.dark & .cm-selectionMatch': {\n background: get(tokens, 'extend.colors.primary.400', '#00ffff') + '44',\n },\n '& .cm-content': {\n caretColor: 'black',\n },\n '.dark & .cm-content': {\n caretColor: cursor,\n },\n '& .cm-cursor': {\n borderLeftColor: 'black',\n },\n '.dark & .cm-cursor': {\n borderLeftColor: cursor,\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-ySelectionCaret': {\n display: 'inline-block',\n insetBlockStart: '.1em',\n blockSize: '1.4em',\n verticalAlign: 'top',\n },\n '& .cm-yLineSelection': {\n margin: '0',\n },\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 markdownDarkHighlighting = 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 { 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 { tailwindConfig, type TailwindConfig } from '@dxos/react-ui-theme';\n\n// TODO(thure): Why export the whole theme? Can this be done differently?\nexport const tokens: TailwindConfig['theme'] = tailwindConfig({}).theme;\n", "//\n// Copyright 2022 DXOS.org\n//\nimport { mergeAttributes } from '@tiptap/core';\nimport Collaboration from '@tiptap/extension-collaboration';\nimport CollaborationCursor from '@tiptap/extension-collaboration-cursor';\nimport Heading from '@tiptap/extension-heading';\nimport ListItem from '@tiptap/extension-list-item';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { type Editor, EditorContent, useEditor as useNaturalEditor } from '@tiptap/react';\nimport StarterKit from '@tiptap/starter-kit';\nimport React, { forwardRef, useImperativeHandle, useMemo } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type ComposerModel, type ComposerSlots } from '../../model';\nimport {\n blockquote,\n bold,\n codeBlock,\n heading,\n type HeadingLevel,\n horizontalRule,\n italic,\n listItem,\n orderedList,\n paragraph,\n strikethrough,\n unorderedList,\n codeWithoutMarks,\n} from '../../styles';\nimport { cursorColor } from '../../yjs';\n\nexport type TipTapEditor = Editor;\n\ntype UseEditorOptions = {\n model?: ComposerModel;\n placeholder?: string;\n slots?: Pick<ComposerSlots, 'editor'>;\n};\n\nconst useEditor = ({ model, placeholder = 'Enter text…', slots = {} }: UseEditorOptions) => {\n const extensions = useMemo(\n () => [\n StarterKit.configure({\n // Extensions\n history: false,\n // Nodes\n blockquote: {\n HTMLAttributes: {\n class: blockquote,\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: unorderedList,\n },\n },\n codeBlock: {\n HTMLAttributes: {\n class: codeBlock,\n },\n },\n heading: false, // (thure): `StarterKit` doesn’t let you configure how headings are rendered, see `Heading` below.\n horizontalRule: {\n HTMLAttributes: {\n class: horizontalRule,\n },\n },\n listItem: false, // (thure): `StarterKit` doesn’t let you configure how list items are rendered, see `ListItem` below.\n orderedList: {\n HTMLAttributes: {\n class: orderedList,\n },\n },\n paragraph: {\n HTMLAttributes: {\n class: paragraph,\n },\n },\n // Marks\n bold: {\n HTMLAttributes: {\n class: bold,\n },\n },\n code: {\n HTMLAttributes: {\n class: codeWithoutMarks,\n },\n },\n italic: {\n HTMLAttributes: {\n class: italic,\n },\n },\n strike: {\n HTMLAttributes: {\n class: strikethrough,\n },\n },\n }),\n Heading.extend({\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level: HeadingLevel = hasLevel ? node.attrs.level : this.options.levels[0];\n\n return [\n `h${level}`,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n class: heading[level],\n }),\n 0,\n ];\n },\n }),\n ListItem.extend({\n renderHTML: ({ HTMLAttributes }) => [\n 'li',\n mergeAttributes(HTMLAttributes, {\n marker: '• ',\n class: listItem,\n }),\n ['div', { role: 'none' }, 0],\n ],\n }),\n // https://github.com/ueberdosis/tiptap/tree/main/packages/extension-collaboration\n ...(model && typeof model.content !== 'string' ? [Collaboration.configure({ fragment: model.content })] : []),\n ...(model?.provider\n ? [\n CollaborationCursor.configure({\n provider: model.provider,\n user: model.peer && {\n name: model.peer.name ?? generateName(model.peer.id),\n color: cursorColor.color,\n },\n }),\n ]\n : []),\n Placeholder.configure({\n placeholder,\n emptyEditorClass: 'before:content-[attr(data-placeholder)] before:absolute opacity-50 cursor-text',\n }),\n ],\n [model?.id],\n );\n\n return useNaturalEditor(\n {\n extensions,\n editorProps: {\n attributes: {\n class: mx('focus:outline-none focus-visible:outline-none', slots.editor?.className),\n spellcheck: slots.editor?.spellCheck === false ? 'false' : 'true',\n tabindex: slots.editor?.tabIndex ? String(slots.editor?.tabIndex) : '0',\n },\n },\n },\n [extensions],\n );\n};\n\nexport type RichTextComposerProps = UseEditorOptions & {\n slots?: ComposerSlots;\n};\n\n/**\n * @deprecated\n */\n// TODO(burdon): Currently broken.\nexport const RichTextComposer = forwardRef<Editor | null, RichTextComposerProps>((props, ref) => {\n const editor = useEditor(props);\n useImperativeHandle<Editor | null, Editor | null>(ref, () => editor, [editor]);\n\n // Reference:\n // https://tiptap.dev/installation/react\n // https://github.com/ueberdosis/tiptap\n // https://tiptap.dev/guide/output/#option-3-yjs\n return <EditorContent {...props.slots?.root} editor={editor} />;\n});\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport * from './components';\nexport * from './model';\n\nexport { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';\nexport { Doc, YText, YXmlFragment } from '@d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ACxF;AACF,CAAA,CAAA;;;AUxBF,SAASW,gBAAgB;AACzB,SAASC,KAAKC,SAAAA,QAAOC,gBAAAA,qBAAoB;",
|
|
6
|
+
"names": ["React", "forwardRef", "memo", "YXmlFragment", "useMemo", "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", "doc", "undefined", "SpaceAwarenessProvider", "channel", "id", "content", "guid", "peer", "identityKey", "toHex", "name", "profile", "displayName", "autocompletion", "completionKeymap", "closeBrackets", "closeBracketsKeymap", "defaultKeymap", "history", "historyKeymap", "indentWithTab", "markdown", "markdownLanguage", "bracketMatching", "defaultHighlightStyle", "foldKeymap", "indentOnInput", "syntaxHighlighting", "languages", "lintKeymap", "searchKeymap", "highlightSelectionMatches", "EditorState", "StateField", "oneDarkHighlightStyle", "keymap", "crosshairCursor", "drawSelection", "dropCursor", "highlightActiveLine", "highlightActiveLineGutter", "highlightSpecialChars", "placeholder", "rectangularSelection", "EditorView", "useFocusableGroup", "vim", "React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "useMemo", "useCallback", "yCollab", "generateName", "useThemeContext", "getColorForValue", "YText", "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", "mx", "heading", "blockquote", "unorderedList", "orderedList", "listItem", "codeBlock", "horizontalRule", "paragraph", "bold", "code", "codeWithoutMarks", "mx", "code", "italic", "strikethrough", "mark", "tailwindConfig", "tokens", "tailwindConfig", "theme", "ivory", "malibu", "highlightBackground", "tooltipBackground", "cursor", "monospace", "get", "tokens", "join", "markdownTheme", "border", "backgroundColor", "tooltipBackground", "borderTopColor", "borderBottomColor", "highlightBackground", "color", "ivory", "outline", "paddingInline", "minBlockSize", "lineHeight", "background", "caretColor", "borderLeftColor", "fontFamily", "overflow", "padding", "marginBlockStart", "paddingBlockStart", "paddingBlockEnd", "display", "insetBlockStart", "blockSize", "verticalAlign", "margin", "Object", "keys", "reduce", "acc", "fontSize", "height", "markdownDarkHighlighting", "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", "EditorModes", "MarkdownComposer", "forwardRef", "model", "slots", "onChange", "editorMode", "forwardedRef", "id", "content", "provider", "peer", "themeMode", "useThemeContext", "tabsterDOMAttribute", "useFocusableGroup", "tabBehavior", "parent", "setParent", "useState", "state", "setState", "view", "setView", "useImperativeHandle", "editor", "listenChangesExtension", "useMemo", "StateField", "define", "create", "update", "_value", "transaction", "docChanged", "newDoc", "useEffect", "awareness", "setLocalStateField", "name", "generateName", "color", "getColorForValue", "value", "type", "colorLight", "EditorState", "doc", "toString", "extensions", "vim", "highlightActiveLineGutter", "highlightSpecialChars", "history", "drawSelection", "dropCursor", "allowMultipleSelections", "of", "indentOnInput", "syntaxHighlighting", "defaultHighlightStyle", "fallback", "bracketMatching", "closeBrackets", "autocompletion", "rectangularSelection", "crosshairCursor", "highlightActiveLine", "highlightSelectionMatches", "placeholder", "keymap", "closeBracketsKeymap", "defaultKeymap", "searchKeymap", "historyKeymap", "foldKeymap", "completionKeymap", "lintKeymap", "indentWithTab", "EditorView", "lineWrapping", "markdown", "base", "markdownLanguage", "codeLanguages", "languages", "markdownTagsExtension", "theme", "markdownTheme", "oneDarkHighlightStyle", "markdownDarkHighlighting", "YText", "yCollab", "destroy", "undefined", "handleKeyUp", "useCallback", "key", "altKey", "shiftKey", "metaKey", "ctrlKey", "contentDOM", "focus", "div", "tabIndex", "root", "onKeyUp", "ref", "mergeAttributes", "Collaboration", "CollaborationCursor", "Heading", "ListItem", "Placeholder", "EditorContent", "useEditor", "useNaturalEditor", "StarterKit", "React", "forwardRef", "useImperativeHandle", "useMemo", "generateName", "mx", "useEditor", "model", "placeholder", "slots", "extensions", "useMemo", "StarterKit", "configure", "history", "blockquote", "HTMLAttributes", "class", "bulletList", "unorderedList", "codeBlock", "heading", "horizontalRule", "listItem", "orderedList", "paragraph", "bold", "code", "codeWithoutMarks", "italic", "strike", "strikethrough", "Heading", "extend", "renderHTML", "node", "hasLevel", "options", "levels", "includes", "attrs", "level", "mergeAttributes", "ListItem", "marker", "role", "content", "Collaboration", "fragment", "provider", "CollaborationCursor", "user", "peer", "name", "generateName", "id", "color", "cursorColor", "Placeholder", "emptyEditorClass", "useNaturalEditor", "editorProps", "attributes", "mx", "editor", "className", "spellcheck", "spellCheck", "tabindex", "tabIndex", "String", "RichTextComposer", "forwardRef", "props", "ref", "useImperativeHandle", "React", "EditorContent", "root", "Composer", "memo", "forwardRef", "slots", "options", "forwardedRef", "model", "useTextModel", "content", "YXmlFragment", "React", "RichTextComposer", "ref", "MarkdownComposer", "TextKind", "Doc", "YText", "YXmlFragment"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytes":2630,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytes":15633,"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/yjs/index.ts":{"bytes":576,"imports":[{"path":"packages/ui/react-ui-editor/src/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/model.ts":{"bytes":5017,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytes":4139,"imports":[{"path":"@lezer/highlight","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":1040,"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/Markdown/markdownTheme.ts":{"bytes":26016,"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/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytes":22875,"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":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","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/react-ui","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/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts","kind":"import-statement","original":"./markdownTheme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx","kind":"import-statement","original":"./Markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytes":17970,"imports":[{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"../../yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx":{"bytes":3877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"../../model"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"../Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"../RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Composer/index.ts":{"bytes":487,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx","kind":"import-statement","original":"./Composer"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":654,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Composer/index.ts","kind":"import-statement","original":"./Composer"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"./Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1026,"imports":[{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"./model"},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":51575},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"react","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},{"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":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","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/react-ui","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":"@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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"exports":["Composer","Doc","EditorModes","MarkdownComposer","RichTextComposer","TextKind","YText","YXmlFragment","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx":{"bytesInOutput":580},"packages/ui/react-ui-editor/src/model.ts":{"bytesInOutput":619},"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytesInOutput":3760},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytesInOutput":5582},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytesInOutput":6361},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1297},"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/Markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytesInOutput":3965},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/Composer/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":159}},"bytes":24987}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytes":2625,"imports":[{"path":"lib0/random","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytes":15628,"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/yjs/index.ts":{"bytes":571,"imports":[{"path":"packages/ui/react-ui-editor/src/yjs/cursors.ts","kind":"import-statement","original":"./cursors"},{"path":"packages/ui/react-ui-editor/src/yjs/space-provider.ts","kind":"import-statement","original":"./space-provider"}],"format":"esm"},"packages/ui/react-ui-editor/src/model.ts":{"bytes":5012,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"./yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytes":4134,"imports":[{"path":"@lezer/highlight","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytes":5360,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/tokens.ts":{"bytes":1035,"imports":[{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-editor/src/styles/index.ts":{"bytes":555,"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/Markdown/markdownTheme.ts":{"bytes":26804,"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/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytes":22870,"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":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","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/react-ui","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/components/Markdown/markdownTags.ts","kind":"import-statement","original":"./markdownTags"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts","kind":"import-statement","original":"./markdownTheme"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Markdown/index.ts":{"bytes":482,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx","kind":"import-statement","original":"./Markdown"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytes":17965,"imports":[{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/styles/index.ts","kind":"import-statement","original":"../../styles"},{"path":"packages/ui/react-ui-editor/src/yjs/index.ts","kind":"import-statement","original":"../../yjs"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytes":482,"imports":[{"path":"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx":{"bytes":3872,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"../../model"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"../Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"../RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/Composer/index.ts":{"bytes":482,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx","kind":"import-statement","original":"./Composer"}],"format":"esm"},"packages/ui/react-ui-editor/src/components/index.ts":{"bytes":649,"imports":[{"path":"packages/ui/react-ui-editor/src/components/Composer/index.ts","kind":"import-statement","original":"./Composer"},{"path":"packages/ui/react-ui-editor/src/components/Markdown/index.ts","kind":"import-statement","original":"./Markdown"},{"path":"packages/ui/react-ui-editor/src/components/RichText/index.ts","kind":"import-statement","original":"./RichText"}],"format":"esm"},"packages/ui/react-ui-editor/src/index.ts":{"bytes":1021,"imports":[{"path":"packages/ui/react-ui-editor/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-editor/src/model.ts","kind":"import-statement","original":"./model"},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/ui/react-ui-editor/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":52002},"packages/ui/react-ui-editor/dist/lib/browser/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true},{"path":"react","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},{"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":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@replit/codemirror-vim","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/react-ui","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":"@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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@tiptap/core","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration","kind":"import-statement","external":true},{"path":"@tiptap/extension-collaboration-cursor","kind":"import-statement","external":true},{"path":"@tiptap/extension-heading","kind":"import-statement","external":true},{"path":"@tiptap/extension-list-item","kind":"import-statement","external":true},{"path":"@tiptap/extension-placeholder","kind":"import-statement","external":true},{"path":"@tiptap/react","kind":"import-statement","external":true},{"path":"@tiptap/starter-kit","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/echo/model/text","kind":"import-statement","external":true},{"path":"@dxos/text-model","kind":"import-statement","external":true}],"exports":["Composer","Doc","EditorModes","MarkdownComposer","RichTextComposer","TextKind","YText","YXmlFragment","useTextModel"],"entryPoint":"packages/ui/react-ui-editor/src/index.ts","inputs":{"packages/ui/react-ui-editor/src/components/Composer/Composer.tsx":{"bytesInOutput":580},"packages/ui/react-ui-editor/src/model.ts":{"bytesInOutput":619},"packages/ui/react-ui-editor/src/yjs/cursors.ts":{"bytesInOutput":565},"packages/ui/react-ui-editor/src/yjs/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/yjs/space-provider.ts":{"bytesInOutput":3755},"packages/ui/react-ui-editor/src/components/Markdown/Markdown.tsx":{"bytesInOutput":5582},"packages/ui/react-ui-editor/src/components/Markdown/markdownTags.ts":{"bytesInOutput":891},"packages/ui/react-ui-editor/src/components/Markdown/markdownTheme.ts":{"bytesInOutput":6570},"packages/ui/react-ui-editor/src/styles/markdown.ts":{"bytesInOutput":1297},"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/Markdown/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/RichText/RichText.tsx":{"bytesInOutput":3965},"packages/ui/react-ui-editor/src/components/RichText/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/Composer/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-editor/src/index.ts":{"bytesInOutput":159}},"bytes":25191}}}
|
|
@@ -36,6 +36,7 @@ export declare const markdownTheme: {
|
|
|
36
36
|
};
|
|
37
37
|
'& .cm-line': {
|
|
38
38
|
paddingInline: number;
|
|
39
|
+
minBlockSize: string;
|
|
39
40
|
};
|
|
40
41
|
'& .cm-line *': {
|
|
41
42
|
lineHeight: number;
|
|
@@ -69,6 +70,7 @@ export declare const markdownTheme: {
|
|
|
69
70
|
};
|
|
70
71
|
'& .cm-scroller': {
|
|
71
72
|
fontFamily: any;
|
|
73
|
+
overflow: string;
|
|
72
74
|
};
|
|
73
75
|
'& .cm-activeLine': {
|
|
74
76
|
backgroundColor: string;
|
|
@@ -81,13 +83,19 @@ export declare const markdownTheme: {
|
|
|
81
83
|
padding: string;
|
|
82
84
|
marginBlockStart: string;
|
|
83
85
|
};
|
|
84
|
-
'& .cm-ySelection': {
|
|
85
|
-
|
|
86
|
+
'& .cm-ySelection, & .cm-selectionMatch': {
|
|
87
|
+
paddingBlockStart: string;
|
|
88
|
+
paddingBlockEnd: string;
|
|
86
89
|
};
|
|
87
90
|
'& .cm-ySelectionCaret': {
|
|
88
91
|
display: string;
|
|
92
|
+
insetBlockStart: string;
|
|
93
|
+
blockSize: string;
|
|
89
94
|
verticalAlign: string;
|
|
90
95
|
};
|
|
96
|
+
'& .cm-yLineSelection': {
|
|
97
|
+
margin: string;
|
|
98
|
+
};
|
|
91
99
|
};
|
|
92
100
|
export declare const markdownDarkHighlighting: HighlightStyle;
|
|
93
101
|
//# sourceMappingURL=markdownTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTheme.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/markdownTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,eAAO,MAAM,MAAM,YAAY,CAAC;AAIhC,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"markdownTheme.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/markdownTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,eAAO,MAAM,MAAM,YAAY,CAAC;AAIhC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkIzB,CAAC;AAEF,eAAO,MAAM,wBAAwB,gBA6EpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-editor",
|
|
3
|
-
"version": "0.3.6
|
|
3
|
+
"version": "0.3.6",
|
|
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",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"y-prosemirror": "~1.0.20",
|
|
48
48
|
"y-protocols": "^1.0.5",
|
|
49
49
|
"yjs": "^13.6.8",
|
|
50
|
-
"@dxos/debug": "0.3.6
|
|
51
|
-
"@dxos/display-name": "0.3.6
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-async": "0.3.6
|
|
55
|
-
"@dxos/react-ui": "0.3.6
|
|
56
|
-
"@dxos/react-ui-theme": "0.3.6
|
|
57
|
-
"@dxos/text-model": "0.3.6
|
|
58
|
-
"@dxos/util": "0.3.6
|
|
50
|
+
"@dxos/debug": "0.3.6",
|
|
51
|
+
"@dxos/display-name": "0.3.6",
|
|
52
|
+
"@dxos/protocols": "0.3.6",
|
|
53
|
+
"@dxos/log": "0.3.6",
|
|
54
|
+
"@dxos/react-async": "0.3.6",
|
|
55
|
+
"@dxos/react-ui": "0.3.6",
|
|
56
|
+
"@dxos/react-ui-theme": "0.3.6",
|
|
57
|
+
"@dxos/text-model": "0.3.6",
|
|
58
|
+
"@dxos/util": "0.3.6"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/lodash.get": "^4.4.7",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"@types/react-dom": "^18.0.6",
|
|
64
64
|
"react": "^18.2.0",
|
|
65
65
|
"react-dom": "^18.2.0",
|
|
66
|
-
"@dxos/config": "0.3.6
|
|
67
|
-
"@dxos/echo-schema": "0.3.6
|
|
68
|
-
"@dxos/echo-typegen": "0.3.6
|
|
69
|
-
"@dxos/react-client": "0.3.6
|
|
66
|
+
"@dxos/config": "0.3.6",
|
|
67
|
+
"@dxos/echo-schema": "0.3.6",
|
|
68
|
+
"@dxos/echo-typegen": "0.3.6",
|
|
69
|
+
"@dxos/react-client": "0.3.6"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"react": "^18.2.0",
|
|
73
73
|
"react-dom": "^18.2.0",
|
|
74
|
-
"@dxos/react-client": "0.3.6
|
|
74
|
+
"@dxos/react-client": "0.3.6"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
@@ -94,6 +94,7 @@ export const markdownTheme = {
|
|
|
94
94
|
},
|
|
95
95
|
'& .cm-line': {
|
|
96
96
|
paddingInline: 0,
|
|
97
|
+
minBlockSize: '1.6em',
|
|
97
98
|
},
|
|
98
99
|
'& .cm-line *': {
|
|
99
100
|
lineHeight: 1.6,
|
|
@@ -127,6 +128,7 @@ export const markdownTheme = {
|
|
|
127
128
|
},
|
|
128
129
|
'& .cm-scroller': {
|
|
129
130
|
fontFamily: get(tokens, 'fontFamily.mono', []).join(','),
|
|
131
|
+
overflow: 'visible',
|
|
130
132
|
},
|
|
131
133
|
'& .cm-activeLine': {
|
|
132
134
|
backgroundColor: 'transparent',
|
|
@@ -139,13 +141,19 @@ export const markdownTheme = {
|
|
|
139
141
|
padding: '2px 4px',
|
|
140
142
|
marginBlockStart: '-4px',
|
|
141
143
|
},
|
|
142
|
-
'& .cm-ySelection': {
|
|
143
|
-
|
|
144
|
+
'& .cm-ySelection, & .cm-selectionMatch': {
|
|
145
|
+
paddingBlockStart: '.15em',
|
|
146
|
+
paddingBlockEnd: '.15em',
|
|
144
147
|
},
|
|
145
148
|
'& .cm-ySelectionCaret': {
|
|
146
149
|
display: 'inline-block',
|
|
150
|
+
insetBlockStart: '.1em',
|
|
151
|
+
blockSize: '1.4em',
|
|
147
152
|
verticalAlign: 'top',
|
|
148
153
|
},
|
|
154
|
+
'& .cm-yLineSelection': {
|
|
155
|
+
margin: '0',
|
|
156
|
+
},
|
|
149
157
|
...Object.keys(get(tokens, 'extend.fontSize', {})).reduce((acc: Record<string, any>, fontSize) => {
|
|
150
158
|
const height = get(tokens, ['extend', 'fontSize', fontSize, 1, 'lineHeight']);
|
|
151
159
|
// 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.
|