@dxos/react-ui-editor 0.3.3 → 0.3.4-main.17ab053

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.
@@ -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/circleci/project/packages/ui/react-ui-editor/src/yjs/space-provider.ts";
52
+ var __dxlog_file = "/home/runner/work/dxos/dxos/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 {
@@ -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 Text } 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?: Text;\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 { configColors } 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\nconst hexadecimalPaletteSeries: (keyof typeof configColors)[] = [\n 'red' as const,\n 'orange' as const,\n 'amber' as const,\n 'yellow' as const,\n 'lime' as const,\n 'green' as const,\n 'emerald' as const,\n 'teal' as const,\n 'cyan' as const,\n 'sky' as const,\n 'indigo' as const,\n 'violet' as const,\n 'purple' as const,\n 'fuchsia' as const,\n 'pink' as const,\n 'rose' as const,\n];\n\nconst shadeKeys = {\n color: '450' as const,\n highlightDark: '800' as const,\n highlightLight: '100' as const,\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 let peerColorDigit = Math.floor(16 * Math.random());\n try {\n // TODO(wittjosiah): Factor out for use w/ html-only story and RichText component.\n // `peer.id` is already a `string`, so we attempt `parseInt` within a `try` since we can’t be certain it is hexadecimal.\n peerColorDigit = parseInt(peer.id.slice(-1), 16);\n } catch (_) {}\n provider.awareness.setLocalStateField('user', {\n name: peer.name ?? generateName(peer.id),\n color: configColors[hexadecimalPaletteSeries[peerColorDigit]][shadeKeys.color],\n colorLight:\n configColors[hexadecimalPaletteSeries[peerColorDigit]][\n shadeKeys[themeMode === 'dark' ? 'highlightDark' : 'highlightLight']\n ],\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"],
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 { configColors } 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\nconst hexadecimalPaletteSeries: (keyof typeof configColors)[] = [\n 'red' as const,\n 'orange' as const,\n 'amber' as const,\n 'yellow' as const,\n 'lime' as const,\n 'green' as const,\n 'emerald' as const,\n 'teal' as const,\n 'cyan' as const,\n 'sky' as const,\n 'indigo' as const,\n 'violet' as const,\n 'purple' as const,\n 'fuchsia' as const,\n 'pink' as const,\n 'rose' as const,\n];\n\nconst shadeKeys = {\n color: '450' as const,\n highlightDark: '800' as const,\n highlightLight: '100' as const,\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 let peerColorDigit = Math.floor(16 * Math.random());\n try {\n // TODO(wittjosiah): Factor out for use w/ html-only story and RichText component.\n // `peer.id` is already a `string`, so we attempt `parseInt` within a `try` since we can’t be certain it is hexadecimal.\n peerColorDigit = parseInt(peer.id.slice(-1), 16);\n } catch (_) {}\n provider.awareness.setLocalStateField('user', {\n name: peer.name ?? generateName(peer.id),\n color: configColors[hexadecimalPaletteSeries[peerColorDigit]][shadeKeys.color],\n colorLight:\n configColors[hexadecimalPaletteSeries[peerColorDigit]][\n shadeKeys[themeMode === 'dark' ? 'highlightDark' : 'highlightLight']\n ],\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
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;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;EACvC;IAAED,OAAO;IAAWC,OAAO;EAAY;;AAIlC,IAA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OAAOC,YAAYD;QACrB;MACF,CAAA;QAEF,CAAA;IACJE,YAAY7C,UAAU;MACpBL,aAAAA;MACAmD,kBAAkB;IACpB,CAAA;KAEF;IAACpD,OAAOgD;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
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", "configColors", "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", "hexadecimalPaletteSeries", "shadeKeys", "color", "highlightDark", "highlightLight", "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", "peerColorDigit", "Math", "floor", "random", "parseInt", "slice", "_", "awareness", "setLocalStateField", "name", "generateName", "configColors", "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":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":4996,"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":26011,"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":25600,"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":53035},"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":6043},"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":25443}}}
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":25605,"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":53047},"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":6043},"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":25448}}}
@@ -1,7 +1,7 @@
1
1
  import { type EditorView } from '@codemirror/view';
2
2
  import { type ComponentProps } from 'react';
3
3
  import type * as awarenessProtocol from 'y-protocols/awareness';
4
- import { type Space, type Text } from '@dxos/react-client/echo';
4
+ import { type Space, type TextObject } from '@dxos/react-client/echo';
5
5
  import { type Identity } from '@dxos/react-client/halo';
6
6
  import type { YText, YXmlFragment } from '@dxos/text-model';
7
7
  export type ComposerSlots = {
@@ -30,7 +30,7 @@ export type ComposerModel = {
30
30
  export type UseTextModelOptions = {
31
31
  identity?: Identity | null;
32
32
  space?: Space;
33
- text?: Text;
33
+ text?: TextObject;
34
34
  };
35
35
  export declare const useTextModel: ({ identity, space, text }: UseTextModelOptions) => ComposerModel | undefined;
36
36
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI5D,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACxD,CAAC;CACH,CAAC;AAEF,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAC7C,KAAK,QAAQ,GAAG;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,YAAY,CAAC;IACvC,QAAQ,CAAC,EAAE,QAAQ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AS,CAAC;AAC7C,KAAK,QAAQ,GAAG;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,YAAY,CAAC;IACvC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAIF,eAAO,MAAM,YAAY,8BAA+B,mBAAmB,KAAG,aAAa,GAAG,SAwB7F,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj } from '@storybook/html';
2
- import { Client, PublicKey } from '@dxos/react-client';
2
+ import { Client, type PublicKey } from '@dxos/react-client';
3
3
  declare const _default: {
4
4
  title: string;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"code-mirror.stories.d.ts","sourceRoot":"","sources":["../../../../stories/html/code-mirror.stories.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;;;;AASvD,wBAEE;AAoEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAoBjF,CAAC"}
1
+ {"version":3,"file":"code-mirror.stories.d.ts","sourceRoot":"","sources":["../../../../stories/html/code-mirror.stories.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;;;;AAS5D,wBAEE;AAoEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAoBjF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-editor",
3
- "version": "0.3.3",
3
+ "version": "0.3.4-main.17ab053",
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.7",
50
- "@dxos/debug": "0.3.3",
51
- "@dxos/display-name": "0.3.3",
52
- "@dxos/log": "0.3.3",
53
- "@dxos/protocols": "0.3.3",
54
- "@dxos/react-async": "0.3.3",
55
- "@dxos/react-ui": "0.3.3",
56
- "@dxos/react-ui-theme": "0.3.3",
57
- "@dxos/text-model": "0.3.3",
58
- "@dxos/util": "0.3.3"
50
+ "@dxos/debug": "0.3.4-main.17ab053",
51
+ "@dxos/display-name": "0.3.4-main.17ab053",
52
+ "@dxos/log": "0.3.4-main.17ab053",
53
+ "@dxos/protocols": "0.3.4-main.17ab053",
54
+ "@dxos/react-async": "0.3.4-main.17ab053",
55
+ "@dxos/react-ui": "0.3.4-main.17ab053",
56
+ "@dxos/react-ui-theme": "0.3.4-main.17ab053",
57
+ "@dxos/text-model": "0.3.4-main.17ab053",
58
+ "@dxos/util": "0.3.4-main.17ab053"
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.3",
67
- "@dxos/echo-schema": "0.3.3",
68
- "@dxos/echo-typegen": "0.3.3",
69
- "@dxos/react-client": "0.3.3"
66
+ "@dxos/config": "0.3.4-main.17ab053",
67
+ "@dxos/echo-schema": "0.3.4-main.17ab053",
68
+ "@dxos/echo-typegen": "0.3.4-main.17ab053",
69
+ "@dxos/react-client": "0.3.4-main.17ab053"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^18.2.0",
73
73
  "react-dom": "^18.2.0",
74
- "@dxos/react-client": "0.3.3"
74
+ "@dxos/react-client": "0.3.4-main.17ab053"
75
75
  },
76
76
  "publishConfig": {
77
77
  "access": "public"
@@ -7,7 +7,7 @@ import '@dxosTheme';
7
7
  import React, { useState } from 'react';
8
8
 
9
9
  import { type PublicKey } from '@dxos/react-client';
10
- import { Text, TextKind, useQuery, useSpace } from '@dxos/react-client/echo';
10
+ import { TextObject, TextKind, useQuery, useSpace } from '@dxos/react-client/echo';
11
11
  import { useIdentity } from '@dxos/react-client/halo';
12
12
  import { ClientDecorator, setupPeersInSpace, textGenerator, useDataGenerator } from '@dxos/react-client/testing';
13
13
  import { useId } from '@dxos/react-ui';
@@ -48,7 +48,7 @@ const { spaceKey: markdownSpaceKey, clients: markdownClients } = await setupPeer
48
48
  count: 2,
49
49
  schema,
50
50
  onCreateSpace: async (space) => {
51
- const document = new ComposerDocument({ content: new Text('Hello, Storybook!') });
51
+ const document = new ComposerDocument({ content: new TextObject('Hello, Storybook!') });
52
52
  await space?.db.add(document);
53
53
  },
54
54
  });
@@ -62,7 +62,7 @@ const { spaceKey: richSpaceKey, clients: richClients } = await setupPeersInSpace
62
62
  count: 2,
63
63
  schema,
64
64
  onCreateSpace: async (space) => {
65
- const document = new ComposerDocument({ content: new Text('Hello, Storybook!', TextKind.RICH) });
65
+ const document = new ComposerDocument({ content: new TextObject('Hello, Storybook!', TextKind.RICH) });
66
66
  await space?.db.add(document);
67
67
  },
68
68
  });
package/src/model.ts CHANGED
@@ -6,7 +6,7 @@ import { type EditorView } from '@codemirror/view';
6
6
  import { type ComponentProps, useMemo } from 'react';
7
7
  import type * as awarenessProtocol from 'y-protocols/awareness';
8
8
 
9
- import { type Space, type Text } from '@dxos/react-client/echo';
9
+ import { type Space, type TextObject } from '@dxos/react-client/echo';
10
10
  import { type Identity } from '@dxos/react-client/halo';
11
11
  import type { YText, YXmlFragment } from '@dxos/text-model';
12
12
 
@@ -40,7 +40,7 @@ export type ComposerModel = {
40
40
  export type UseTextModelOptions = {
41
41
  identity?: Identity | null;
42
42
  space?: Space;
43
- text?: Text;
43
+ text?: TextObject;
44
44
  };
45
45
 
46
46
  // TODO(wittjosiah): Factor out to common package? @dxos/react-client?
@@ -16,7 +16,7 @@ export class ComposerDocument extends dxos_echo_schema.TypedObject<ComposerDocum
16
16
  static filter(
17
17
  opts?: Partial<ComposerDocumentProps>
18
18
  ): dxos_echo_schema.Filter<ComposerDocument> {
19
- return dxos_echo_schema.Filter.byTypeName(
19
+ return dxos_echo_schema.Filter.typename(
20
20
  "dxos.testing.composer.ComposerDocument",
21
21
  opts
22
22
  );