@dxos/plugin-markdown 0.6.14-staging.8758a12 → 0.6.14-staging.9b873ce
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{MarkdownContainer-J5BZUIVL.mjs → MarkdownContainer-UBYHA366.mjs} +14 -31
- package/dist/lib/browser/MarkdownContainer-UBYHA366.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/{MarkdownContainer-UYBYWCRU.cjs → MarkdownContainer-2S666KPG.cjs} +14 -31
- package/dist/lib/node/MarkdownContainer-2S666KPG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/{MarkdownContainer-P3EAZ3OR.mjs → MarkdownContainer-IITZD46A.mjs} +14 -31
- package/dist/lib/node-esm/MarkdownContainer-IITZD46A.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/MarkdownContainer.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownEditor.d.ts.map +1 -1
- package/package.json +28 -29
- package/src/components/MarkdownContainer.tsx +1 -2
- package/src/components/MarkdownEditor.tsx +18 -39
- package/src/extensions.tsx +1 -1
- package/dist/lib/browser/MarkdownContainer-J5BZUIVL.mjs.map +0 -7
- package/dist/lib/node/MarkdownContainer-UYBYWCRU.cjs.map +0 -7
- package/dist/lib/node-esm/MarkdownContainer-P3EAZ3OR.mjs.map +0 -7
|
@@ -19,10 +19,10 @@ import { openSearchPanel } from "@codemirror/search";
|
|
|
19
19
|
import React, { useMemo, useEffect, useCallback as useCallback2 } from "react";
|
|
20
20
|
import { LayoutAction as LayoutAction2, useIntentDispatcher } from "@dxos/app-framework";
|
|
21
21
|
import { useThemeContext, useTranslation } from "@dxos/react-ui";
|
|
22
|
-
import {
|
|
22
|
+
import { useAttention } from "@dxos/react-ui-attention";
|
|
23
23
|
import { Toolbar, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, dropFile, editorContent, editorGutter, processAction, useActionHandler, useCommentState, useCommentClickListener, useFormattingState, useTextEditor } from "@dxos/react-ui-editor";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
25
|
+
import { mx, textBlockWidth } from "@dxos/react-ui-theme";
|
|
26
26
|
import { isNotFalsy, nonNullable } from "@dxos/util";
|
|
27
27
|
|
|
28
28
|
// packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx
|
|
@@ -74,7 +74,6 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
74
74
|
const { themeMode } = useThemeContext();
|
|
75
75
|
const dispatch = useIntentDispatcher();
|
|
76
76
|
const [formattingState, formattingObserver] = useFormattingState();
|
|
77
|
-
const attendableAttributes = useAttendableAttributes(id);
|
|
78
77
|
const { hasAttention } = useAttention(id);
|
|
79
78
|
const { scrollTo, selection } = useMemo(() => editorStateStore?.getState(id) ?? {}, [
|
|
80
79
|
id
|
|
@@ -145,7 +144,6 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
145
144
|
}
|
|
146
145
|
}), [
|
|
147
146
|
id,
|
|
148
|
-
initialValue,
|
|
149
147
|
formattingObserver,
|
|
150
148
|
viewMode,
|
|
151
149
|
themeMode,
|
|
@@ -170,29 +168,16 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
170
168
|
}
|
|
171
169
|
handleToolbarAction?.(action);
|
|
172
170
|
};
|
|
173
|
-
return /* @__PURE__ */ React.createElement(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
className: "flex flex-col"
|
|
177
|
-
} : {
|
|
178
|
-
className: "contents",
|
|
179
|
-
// TODO(wittjosiah): Factor out to `useAttendableAttributes`?
|
|
180
|
-
...hasAttention && {
|
|
181
|
-
"aria-current": "location"
|
|
182
|
-
},
|
|
183
|
-
...attendableAttributes
|
|
184
|
-
}
|
|
171
|
+
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
172
|
+
toolbar,
|
|
173
|
+
contentSize: role === "article" ? "cover" : "intrinsic"
|
|
185
174
|
}, toolbar && /* @__PURE__ */ React.createElement("div", {
|
|
186
175
|
role: "none",
|
|
187
|
-
className: "
|
|
176
|
+
className: mx("attention-surface is-full", role === "section" && "sticky block-start-0 z-[1] border-be !border-separator -mbe-px min-is-0")
|
|
188
177
|
}, /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
189
|
-
classNames:
|
|
178
|
+
classNames: [
|
|
190
179
|
textBlockWidth,
|
|
191
|
-
"
|
|
192
|
-
!hasAttention && "invisible",
|
|
193
|
-
sectionToolbarLayout
|
|
194
|
-
] : [
|
|
195
|
-
textBlockWidth
|
|
180
|
+
!hasAttention && "opacity-20"
|
|
196
181
|
],
|
|
197
182
|
state: formattingState && {
|
|
198
183
|
...formattingState,
|
|
@@ -208,7 +193,7 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
208
193
|
ref: parentRef,
|
|
209
194
|
"data-testid": "composer.markdownRoot",
|
|
210
195
|
"data-toolbar": toolbar ? "enabled" : "disabled",
|
|
211
|
-
className:
|
|
196
|
+
className: mx("ch-focus-ring-inset data-[toolbar=disabled]:pbs-2 attention-surface", role === "article" ? "min-bs-0" : "[&_.cm-scroller]:overflow-hidden [&_.cm-scroller]:min-bs-24"),
|
|
212
197
|
...focusAttributes
|
|
213
198
|
}));
|
|
214
199
|
};
|
|
@@ -264,7 +249,8 @@ var useExtensions = ({ document, settings, viewMode, editorStateStore, extension
|
|
|
264
249
|
}
|
|
265
250
|
return acc;
|
|
266
251
|
}, []), [
|
|
267
|
-
extensionProviders
|
|
252
|
+
extensionProviders,
|
|
253
|
+
document
|
|
268
254
|
]);
|
|
269
255
|
return useMemo2(() => [
|
|
270
256
|
// NOTE: Data extensions must be first so that automerge is updated before other extensions compute their state.
|
|
@@ -433,9 +419,6 @@ var MarkdownContainer = ({ id, role, object, extensionProviders, settings, viewM
|
|
|
433
419
|
};
|
|
434
420
|
var DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }) => {
|
|
435
421
|
const space = getSpace2(doc);
|
|
436
|
-
const initialValue = useMemo3(() => doc.content?.content, [
|
|
437
|
-
doc.content
|
|
438
|
-
]);
|
|
439
422
|
useEffect2(() => {
|
|
440
423
|
if (!doc.fallbackName && doc.content?.content) {
|
|
441
424
|
doc.fallbackName = getFallbackName(doc.content.content);
|
|
@@ -456,7 +439,7 @@ var DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }) => {
|
|
|
456
439
|
]);
|
|
457
440
|
return /* @__PURE__ */ React3.createElement(MarkdownEditor, {
|
|
458
441
|
id,
|
|
459
|
-
initialValue,
|
|
442
|
+
initialValue: doc.content?.content,
|
|
460
443
|
viewMode,
|
|
461
444
|
toolbar: settings.toolbar,
|
|
462
445
|
inputMode: settings.editorInputMode,
|
|
@@ -469,4 +452,4 @@ export {
|
|
|
469
452
|
DocumentEditor,
|
|
470
453
|
MarkdownContainer_default as default
|
|
471
454
|
};
|
|
472
|
-
//# sourceMappingURL=MarkdownContainer-
|
|
455
|
+
//# sourceMappingURL=MarkdownContainer-UBYHA366.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/MarkdownContainer.tsx", "../../../src/components/MarkdownEditor.tsx", "../../../src/hooks/useSelectCurrentThread.tsx", "../../../src/extensions.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useMemo } from 'react';\n\nimport { useResolvePlugin, parseFileManagerPlugin } from '@dxos/app-framework';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\n\nimport { MarkdownEditor, type MarkdownEditorProps } from './MarkdownEditor';\nimport { useExtensions } from '../extensions';\nimport { DocumentType, type MarkdownSettingsProps } from '../types';\nimport { getFallbackName } from '../util';\n\nexport type MarkdownContainerProps = Pick<\n MarkdownEditorProps,\n 'role' | 'extensionProviders' | 'viewMode' | 'editorStateStore' | 'onViewModeChange'\n> & {\n id: string;\n object: DocumentType | any;\n settings: MarkdownSettingsProps;\n};\n\n// TODO(burdon): Move toolbar here.\n// TODO(burdon): Factor out difference for ECHO and non-ECHO objects; i.e., single component.\nconst MarkdownContainer = ({\n id,\n role,\n object,\n extensionProviders,\n settings,\n viewMode,\n editorStateStore,\n onViewModeChange,\n}: MarkdownContainerProps) => {\n const scrollPastEnd = role === 'article';\n const doc = object instanceof DocumentType ? object : undefined;\n const extensions = useExtensions({ extensionProviders, document: doc, settings, viewMode, editorStateStore });\n\n if (doc) {\n return (\n <DocumentEditor\n id={fullyQualifiedId(object)}\n role={role}\n document={doc}\n extensions={extensions}\n settings={settings}\n scrollPastEnd={scrollPastEnd}\n onViewModeChange={onViewModeChange}\n />\n );\n } else {\n return (\n <MarkdownEditor\n id={id}\n role={role}\n initialValue={object.text}\n extensions={extensions}\n viewMode={viewMode}\n toolbar={settings.toolbar}\n inputMode={settings.editorInputMode}\n scrollPastEnd={scrollPastEnd}\n onViewModeChange={onViewModeChange}\n />\n );\n }\n};\n\ntype DocumentEditorProps = Omit<MarkdownContainerProps, 'object' | 'extensionProviders' | 'editorStateStore'> &\n Pick<MarkdownEditorProps, 'id' | 'scrollPastEnd' | 'extensions'> & {\n document: DocumentType;\n };\n\nexport const DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }: DocumentEditorProps) => {\n const space = getSpace(doc);\n\n // Migrate gradually to `fallbackName`.\n useEffect(() => {\n if (!doc.fallbackName && doc.content?.content) {\n doc.fallbackName = getFallbackName(doc.content.content);\n }\n }, [doc, doc.content]);\n\n // File dragging.\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n const handleFileUpload = useMemo(() => {\n if (space === undefined || fileManagerPlugin?.provides.file.upload === undefined) {\n return undefined;\n }\n\n // TODO(burdon): Re-order props: space, file.\n return async (file: File) => fileManagerPlugin?.provides?.file?.upload?.(file, space);\n }, [space, fileManagerPlugin]);\n\n return (\n <MarkdownEditor\n id={id}\n initialValue={doc.content?.content}\n viewMode={viewMode}\n toolbar={settings.toolbar}\n inputMode={settings.editorInputMode}\n onFileUpload={handleFileUpload}\n {...props}\n />\n );\n};\n\nexport default MarkdownContainer;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { openSearchPanel } from '@codemirror/search';\nimport { type EditorView } from '@codemirror/view';\nimport React, { useMemo, useEffect, useCallback } from 'react';\n\nimport { type FileInfo, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport {\n type Action,\n type DNDOptions,\n type EditorViewMode,\n type EditorInputMode,\n type EditorSelectionState,\n type EditorStateStore,\n Toolbar,\n type UseTextEditorProps,\n createBasicExtensions,\n createMarkdownExtensions,\n createThemeExtensions,\n dropFile,\n editorContent,\n editorGutter,\n processAction,\n useActionHandler,\n useCommentState,\n useCommentClickListener,\n useFormattingState,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx, textBlockWidth } from '@dxos/react-ui-theme';\nimport { isNotFalsy, nonNullable } from '@dxos/util';\n\nimport { useSelectCurrentThread } from '../hooks';\nimport { MARKDOWN_PLUGIN } from '../meta';\nimport { type MarkdownPluginState } from '../types';\n\nconst DEFAULT_VIEW_MODE: EditorViewMode = 'preview';\n\nexport type MarkdownEditorProps = {\n id: string;\n role?: string;\n inputMode?: EditorInputMode;\n scrollPastEnd?: boolean;\n toolbar?: boolean;\n viewMode?: EditorViewMode;\n editorStateStore?: EditorStateStore;\n onViewModeChange?: (id: string, mode: EditorViewMode) => void;\n onFileUpload?: (file: File) => Promise<FileInfo | undefined>;\n} & Pick<UseTextEditorProps, 'initialValue' | 'extensions'> &\n Partial<Pick<MarkdownPluginState, 'extensionProviders'>>;\n\n/**\n * Base markdown editor component.\n *\n * This component provides all the features of the markdown editor that do no depend on ECHO.\n * This allows it to be used as a common editor for markdown content on arbitrary backends (e.g. files).\n */\nexport const MarkdownEditor = ({\n id,\n role = 'article',\n initialValue,\n extensions,\n extensionProviders,\n scrollPastEnd,\n toolbar,\n viewMode,\n editorStateStore,\n onFileUpload,\n onViewModeChange,\n}: MarkdownEditorProps) => {\n const { t } = useTranslation(MARKDOWN_PLUGIN);\n const { themeMode } = useThemeContext();\n const dispatch = useIntentDispatcher();\n const [formattingState, formattingObserver] = useFormattingState();\n const { hasAttention } = useAttention(id);\n\n // Restore last selection and scroll point.\n const { scrollTo, selection } = useMemo<EditorSelectionState>(() => editorStateStore?.getState(id) ?? {}, [id]);\n\n // Extensions from other plugins.\n // TODO(burdon): Reconcile with DocumentEditor.useExtensions.\n const providerExtensions = useMemo(\n () => extensionProviders?.flatMap((provider) => provider({})).filter(nonNullable),\n [extensionProviders],\n );\n\n // TODO(Zan): Move these into thread plugin as well?\n const [commentsState, commentObserver] = useCommentState();\n const onCommentClick = useCallback(() => {\n void dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: { element: 'complementary', state: true },\n });\n }, [dispatch]);\n const commentClickObserver = useCommentClickListener(onCommentClick);\n\n // Drag files.\n const handleDrop: DNDOptions['onDrop'] = async (view, { files }) => {\n const file = files[0];\n const info = file && onFileUpload ? await onFileUpload(file) : undefined;\n if (info) {\n processAction(view, { type: 'image', data: info.url });\n }\n };\n\n const {\n parentRef,\n view: editorView,\n focusAttributes,\n } = useTextEditor(\n () => ({\n initialValue,\n extensions: [\n formattingObserver,\n commentObserver,\n commentClickObserver,\n createBasicExtensions({\n readonly: viewMode === 'readonly',\n placeholder: t('editor placeholder'),\n scrollPastEnd: role === 'section' ? false : scrollPastEnd,\n }),\n createMarkdownExtensions({ themeMode }),\n createThemeExtensions({\n themeMode,\n syntaxHighlighting: true,\n slots: { content: { className: editorContent } },\n }),\n editorGutter,\n role !== 'section' && onFileUpload && dropFile({ onDrop: handleDrop }),\n providerExtensions,\n extensions,\n ].filter(isNotFalsy),\n ...(role !== 'section' && {\n id,\n scrollTo,\n selection,\n // TODO(wittjosiah): Autofocus based on layout is racy.\n // autoFocus: layoutPlugin?.provides.layout ? layoutPlugin?.provides.layout.scrollIntoView === id : true,\n moveToEndOfLine: true,\n }),\n }),\n [id, formattingObserver, viewMode, themeMode, extensions, providerExtensions],\n );\n\n useTest(editorView);\n useSelectCurrentThread(editorView, id);\n\n // Toolbar handler.\n const handleToolbarAction = useActionHandler(editorView);\n const handleAction = (action: Action) => {\n switch (action.type) {\n case 'search': {\n if (editorView) {\n openSearchPanel(editorView);\n }\n return;\n }\n case 'view-mode': {\n onViewModeChange?.(id, action.data);\n return;\n }\n }\n\n handleToolbarAction?.(action);\n };\n\n return (\n <StackItem.Content toolbar={toolbar} contentSize={role === 'article' ? 'cover' : 'intrinsic'}>\n {toolbar && (\n <div\n role='none'\n className={mx(\n 'attention-surface is-full',\n role === 'section' && 'sticky block-start-0 z-[1] border-be !border-separator -mbe-px min-is-0',\n )}\n >\n <Toolbar.Root\n classNames={[textBlockWidth, !hasAttention && 'opacity-20']}\n state={formattingState && { ...formattingState, ...commentsState }}\n onAction={handleAction}\n >\n <Toolbar.Markdown />\n {onFileUpload && <Toolbar.Custom onUpload={onFileUpload} />}\n <Toolbar.Separator />\n <Toolbar.View mode={viewMode ?? DEFAULT_VIEW_MODE} />\n <Toolbar.Actions />\n </Toolbar.Root>\n </div>\n )}\n <div\n role='none'\n ref={parentRef}\n data-testid='composer.markdownRoot'\n data-toolbar={toolbar ? 'enabled' : 'disabled'}\n className={mx(\n 'ch-focus-ring-inset data-[toolbar=disabled]:pbs-2 attention-surface',\n role === 'article' ? 'min-bs-0' : '[&_.cm-scroller]:overflow-hidden [&_.cm-scroller]:min-bs-24',\n )}\n {...focusAttributes}\n />\n </StackItem.Content>\n );\n};\n\n// Expose editor view for playwright tests.\n// TODO(wittjosiah): Find a better way to expose this or find a way to limit it to test runs.\nconst useTest = (view?: EditorView) => {\n useEffect(() => {\n const composer = (window as any).composer;\n if (composer) {\n composer.editorView = view;\n }\n }, [view]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { useCallback } from 'react';\n\nimport { LayoutAction, useIntentResolver } from '@dxos/app-framework';\nimport { Cursor, setSelection } from '@dxos/react-ui-editor';\n\nimport { MARKDOWN_PLUGIN } from '../meta';\n\n/**\n * Handle scrolling and selection of the current thread in a markdown editor.\n */\nexport const useSelectCurrentThread = (editorView: EditorView | undefined, documentId: string) => {\n const handleScrollIntoView = useCallback(\n ({ action, data }: { action: string; data?: any }) => {\n if (action === LayoutAction.SCROLL_INTO_VIEW) {\n if (editorView && data?.id === documentId && data?.cursor) {\n // TODO(burdon): We need typed intents.\n const range = Cursor.getRangeFromCursor(editorView.state, data.cursor);\n if (range) {\n const selection = editorView.state.selection.main.from !== range.from ? { anchor: range.from } : undefined;\n const effects = [\n // NOTE: This does not use the DOM scrollIntoView function.\n EditorView.scrollIntoView(range.from, { y: 'start', yMargin: 96 }),\n ];\n if (selection) {\n // Update the editor selection to get bi-directional highlighting.\n effects.push(setSelection.of({ current: documentId }));\n }\n\n editorView.dispatch({\n effects,\n selection: selection ? { anchor: range.from } : undefined,\n });\n }\n }\n }\n },\n [documentId, editorView],\n );\n\n useIntentResolver(MARKDOWN_PLUGIN, handleScrollIntoView);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type AnchorHTMLAttributes, type ReactNode, useMemo } from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { type IntentDispatcher, NavigationAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { createDocAccessor, fullyQualifiedId, getSpace, type Query } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ThemeProvider } from '@dxos/react-ui';\nimport {\n type AutocompleteResult,\n type EditorStateStore,\n type EditorViewMode,\n type Extension,\n InputModeExtensions,\n createDataExtensions,\n autocomplete,\n decorateMarkdown,\n folding,\n formattingKeymap,\n linkTooltip,\n listener,\n selectionState,\n typewriter,\n} from '@dxos/react-ui-editor';\nimport { defaultTx } from '@dxos/react-ui-theme';\nimport { isNotFalsy } from '@dxos/util';\n\nimport { type DocumentType, type MarkdownPluginState, type MarkdownSettingsProps } from './types';\nimport { setFallbackName } from './util';\n\ntype ExtensionsOptions = {\n document?: DocumentType;\n dispatch?: IntentDispatcher;\n query?: Query<DocumentType>;\n settings: MarkdownSettingsProps;\n viewMode?: EditorViewMode;\n editorStateStore?: EditorStateStore;\n};\n\n// TODO(burdon): Merge with createBaseExtensions below.\nexport const useExtensions = ({\n document,\n settings,\n viewMode,\n editorStateStore,\n extensionProviders,\n}: ExtensionsOptions & Pick<MarkdownPluginState, 'extensionProviders'>): Extension[] => {\n const dispatch = useIntentDispatcher();\n const identity = useIdentity();\n const space = getSpace(document);\n\n // TODO(wittjosiah): Autocomplete is not working and this query is causing performance issues.\n // TODO(burdon): Unsubscribe.\n // const query = space?.db.query(Filter.schema(DocumentType));\n // query?.subscribe();\n const baseExtensions = useMemo(\n () =>\n createBaseExtensions({\n document,\n settings,\n viewMode,\n dispatch,\n // query,\n }),\n [\n document,\n viewMode,\n dispatch,\n settings,\n settings.editorInputMode,\n settings.folding,\n settings.numberedHeadings,\n settings.debug,\n settings.typewriter,\n ],\n );\n\n //\n // External extensions from other plugins.\n //\n const pluginExtensions = useMemo<Extension[] | undefined>(\n () =>\n extensionProviders?.reduce((acc: Extension[], provider) => {\n const extension = typeof provider === 'function' ? provider({ document }) : provider;\n if (extension) {\n acc.push(extension);\n }\n\n return acc;\n }, []),\n [extensionProviders, document],\n );\n\n //\n // Basic plugins.\n //\n return useMemo<Extension[]>(\n () =>\n [\n // NOTE: Data extensions must be first so that automerge is updated before other extensions compute their state.\n document &&\n createDataExtensions({\n id: document.id,\n text: document.content && createDocAccessor(document.content, ['content']),\n space,\n identity,\n }),\n selectionState(editorStateStore),\n document &&\n listener({\n onChange: (text) => setFallbackName(document, text),\n }),\n baseExtensions,\n pluginExtensions,\n ].filter(isNotFalsy),\n [baseExtensions, pluginExtensions, document, document?.content, space, identity],\n );\n};\n\n/**\n * Create extension instances for editor.\n */\nconst createBaseExtensions = ({ document, dispatch, settings, query, viewMode }: ExtensionsOptions): Extension[] => {\n const extensions: Extension[] = [\n settings.editorInputMode && InputModeExtensions[settings.editorInputMode],\n settings.folding && folding(),\n ].filter(isNotFalsy);\n\n //\n // Markdown\n //\n if (viewMode !== 'source') {\n extensions.push(\n ...[\n formattingKeymap(),\n decorateMarkdown({\n selectionChangeDelay: 100,\n numberedHeadings: settings.numberedHeadings ? { from: 2 } : undefined,\n // TODO(wittjosiah): For internal links, consider ignoring the link text and rendering the label of the object being linked to.\n renderLinkButton:\n dispatch && document\n ? onRenderLink((id: string) => {\n void dispatch({\n action: NavigationAction.ADD_TO_ACTIVE,\n data: {\n id,\n part: 'main',\n pivotId: fullyQualifiedId(document),\n scrollIntoView: true,\n },\n });\n })\n : undefined,\n }),\n linkTooltip(renderLinkTooltip),\n ],\n );\n }\n\n //\n // Autocomplete object links.\n //\n if (query) {\n extensions.push(\n autocomplete({\n onSearch: (text: string) => {\n // TODO(burdon): Specify filter (e.g., stack).\n return query.objects\n .map<AutocompleteResult | undefined>((object) =>\n object.name?.length && object.id !== document?.id\n ? {\n label: object.name,\n // TODO(burdon): Factor out URL builder.\n apply: `[${object.name}](/${fullyQualifiedId(object)})`,\n }\n : undefined,\n )\n .filter(isNotFalsy);\n },\n }),\n );\n }\n\n if (settings.debug) {\n const items = settings.typewriter?.split(/[,\\n]/) ?? '';\n if (items) {\n extensions.push(typewriter({ items }));\n }\n }\n\n return extensions;\n};\n\n// TODO(burdon): Factor out styles.\nconst style = {\n hover: 'rounded-sm text-primary-500 hover:text-primary-600 dark:text-primary-500 hover:dark:text-primary-400',\n icon: 'inline-block leading-none mis-1 cursor-pointer',\n};\n\nconst onRenderLink = (onSelectObject: (id: string) => void) => (el: Element, url: string) => {\n // TODO(burdon): Formalize/document internal link format.\n const isInternal =\n url.startsWith('/') ||\n // TODO(wittjosiah): This should probably be parsed out on paste?\n url.startsWith(window.location.origin);\n\n const options: AnchorHTMLAttributes<any> = isInternal\n ? {\n onClick: () => {\n const qualifiedId = url.split('/').at(-1);\n invariant(qualifiedId, 'Invalid link format.');\n onSelectObject(qualifiedId);\n },\n }\n : {\n href: url,\n rel: 'noreferrer',\n target: '_blank',\n };\n\n renderRoot(\n el,\n <a {...options} className={style.hover}>\n <Icon\n icon={isInternal ? 'ph--arrow-square-down--bold' : 'ph--arrow-square-out--bold'}\n size={4}\n classNames={style.icon}\n />\n </a>,\n );\n};\n\nconst renderLinkTooltip = (el: Element, url: string) => {\n const web = new URL(url);\n renderRoot(\n el,\n <a href={url} rel='noreferrer' target='_blank' className={style.hover}>\n {web.origin}\n <Icon icon='ph--arrow-square-out--bold' size={4} classNames={style.icon} />\n </a>,\n );\n};\n\n// TODO(burdon): Remove react rendering; use DOM directly.\nexport const renderRoot = <T extends Element>(root: T, node: ReactNode): T => {\n createRoot(root).render(<ThemeProvider tx={defaultTx}>{node}</ThemeProvider>);\n return root;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,UAASC,aAAAA,YAAWC,WAAAA,gBAAe;AAE1C,SAASC,kBAAkBC,8BAA8B;AACzD,SAASC,oBAAAA,mBAAkBC,YAAAA,iBAAgB;;;ACH3C,SAASC,uBAAuB;AAEhC,OAAOC,SAASC,SAASC,WAAWC,eAAAA,oBAAmB;AAEvD,SAAwBC,gBAAAA,eAAcC,2BAA2B;AACjE,SAASC,iBAAiBC,sBAAsB;AAChD,SAASC,oBAAoB;AAC7B,SAOEC,SAEAC,uBACAC,0BACAC,uBACAC,UACAC,eACAC,cACAC,eACAC,kBACAC,iBACAC,yBACAC,oBACAC,qB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7B,SACE,gBAAAhB,OAAA,cAACG,gBAAAA;IACClB;IACAmB,cAAcV,IAAIoB,SAASA;IAC3BxB;IACAgB,SAASjB,SAASiB;IAClBC,WAAWlB,SAASmB;IACpBgB,cAAcL;IACb,GAAGV;;AAGV;AAEA,IAAA,4BAAezB;",
|
|
6
|
+
"names": ["React", "useEffect", "useMemo", "useResolvePlugin", "parseFileManagerPlugin", "fullyQualifiedId", "getSpace", "openSearchPanel", "React", "useMemo", "useEffect", "useCallback", "LayoutAction", "useIntentDispatcher", "useThemeContext", "useTranslation", "useAttention", "Toolbar", "createBasicExtensions", "createMarkdownExtensions", "createThemeExtensions", "dropFile", "editorContent", "editorGutter", "processAction", "useActionHandler", "useCommentState", "useCommentClickListener", "useFormattingState", "useTextEditor", "StackItem", "mx", "textBlockWidth", "isNotFalsy", "nonNullable", "EditorView", "useCallback", "LayoutAction", "useIntentResolver", "Cursor", "setSelection", "useSelectCurrentThread", "editorView", "documentId", "handleScrollIntoView", "useCallback", "action", "data", "LayoutAction", "SCROLL_INTO_VIEW", "id", "cursor", "range", "Cursor", "getRangeFromCursor", "state", "selection", "main", "from", "anchor", "undefined", "effects", "EditorView", "scrollIntoView", "y", "yMargin", "push", "setSelection", "of", "current", "dispatch", "useIntentResolver", "MARKDOWN_PLUGIN", "DEFAULT_VIEW_MODE", "MarkdownEditor", "id", "role", "initialValue", "extensions", "extensionProviders", "scrollPastEnd", "toolbar", "viewMode", "editorStateStore", "onFileUpload", "onViewModeChange", "t", "useTranslation", "MARKDOWN_PLUGIN", "themeMode", "useThemeContext", "dispatch", "useIntentDispatcher", "formattingState", "formattingObserver", "useFormattingState", "hasAttention", "useAttention", "scrollTo", "selection", "useMemo", "getState", "providerExtensions", "flatMap", "provider", "filter", "nonNullable", "commentsState", "commentObserver", "useCommentState", "onCommentClick", "useCallback", "action", "LayoutAction", "SET_LAYOUT", "data", "element", "state", "commentClickObserver", "useCommentClickListener", "handleDrop", "view", "files", "file", "info", "undefined", "processAction", "type", "url", "parentRef", "editorView", "focusAttributes", "useTextEditor", "createBasicExtensions", "readonly", "placeholder", "createMarkdownExtensions", "createThemeExtensions", "syntaxHighlighting", "slots", "content", "className", "editorContent", "editorGutter", "dropFile", "onDrop", "isNotFalsy", "moveToEndOfLine", "useTest", "useSelectCurrentThread", "handleToolbarAction", "useActionHandler", "handleAction", "openSearchPanel", "StackItem", "Content", "contentSize", "div", "mx", "Toolbar", "Root", "classNames", "textBlockWidth", "onAction", "Markdown", "Custom", "onUpload", "Separator", "View", "mode", "Actions", "ref", "data-testid", "data-toolbar", "useEffect", "composer", "window", "React", "useMemo", "createRoot", "NavigationAction", "useIntentDispatcher", "invariant", "createDocAccessor", "fullyQualifiedId", "getSpace", "useIdentity", "Icon", "ThemeProvider", "InputModeExtensions", "createDataExtensions", "autocomplete", "decorateMarkdown", "folding", "formattingKeymap", "linkTooltip", "listener", "selectionState", "typewriter", "defaultTx", "isNotFalsy", "useExtensions", "document", "settings", "viewMode", "editorStateStore", "extensionProviders", "dispatch", "useIntentDispatcher", "identity", "useIdentity", "space", "getSpace", "baseExtensions", "useMemo", "createBaseExtensions", "editorInputMode", "folding", "numberedHeadings", "debug", "typewriter", "pluginExtensions", "reduce", "acc", "provider", "extension", "push", "createDataExtensions", "id", "text", "content", "createDocAccessor", "selectionState", "listener", "onChange", "setFallbackName", "filter", "isNotFalsy", "query", "extensions", "InputModeExtensions", "formattingKeymap", "decorateMarkdown", "selectionChangeDelay", "from", "undefined", "renderLinkButton", "onRenderLink", "action", "NavigationAction", "ADD_TO_ACTIVE", "data", "part", "pivotId", "fullyQualifiedId", "scrollIntoView", "linkTooltip", "renderLinkTooltip", "autocomplete", "onSearch", "objects", "map", "object", "name", "length", "label", "apply", "items", "split", "style", "hover", "icon", "onSelectObject", "el", "url", "isInternal", "startsWith", "window", "location", "origin", "options", "onClick", "qualifiedId", "at", "invariant", "href", "rel", "target", "renderRoot", "React", "a", "className", "Icon", "size", "classNames", "web", "URL", "root", "node", "createRoot", "render", "ThemeProvider", "tx", "defaultTx", "MarkdownContainer", "id", "role", "object", "extensionProviders", "settings", "viewMode", "editorStateStore", "onViewModeChange", "scrollPastEnd", "doc", "DocumentType", "undefined", "extensions", "useExtensions", "document", "React", "DocumentEditor", "fullyQualifiedId", "MarkdownEditor", "initialValue", "text", "toolbar", "inputMode", "editorInputMode", "props", "space", "getSpace", "useEffect", "fallbackName", "content", "getFallbackName", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "handleFileUpload", "useMemo", "provides", "file", "upload", "onFileUpload"]
|
|
7
|
+
}
|
|
@@ -98,7 +98,7 @@ var MarkdownSettings = ({ settings }) => {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
// packages/plugins/plugin-markdown/src/components/index.ts
|
|
101
|
-
var MarkdownContainer = lazy(() => import("./MarkdownContainer-
|
|
101
|
+
var MarkdownContainer = lazy(() => import("./MarkdownContainer-UBYHA366.mjs"));
|
|
102
102
|
|
|
103
103
|
// packages/plugins/plugin-markdown/src/translations.ts
|
|
104
104
|
var translations_default = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-markdown/src/meta.ts":{"bytes":1471,"imports":[],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx":{"bytes":12696,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx":{"bytes":6483,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/hooks/index.ts":{"bytes":544,"imports":[{"path":"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx","kind":"import-statement","original":"./useSelectCurrentThread"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx":{"bytes":25111,"imports":[{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/document.ts":{"bytes":3473,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/types.ts":{"bytes":4453,"imports":[{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/index.ts":{"bytes":591,"imports":[{"path":"packages/plugins/plugin-markdown/src/types/document.ts","kind":"import-statement","original":"./document"},{"path":"packages/plugins/plugin-markdown/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-markdown/src/util.tsx":{"bytes":6544,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-markdown/src/extensions.tsx":{"bytes":24256,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx":{"bytes":10828,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx","kind":"import-statement","original":"./MarkdownEditor"},{"path":"packages/plugins/plugin-markdown/src/extensions.tsx","kind":"import-statement","original":"../extensions"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/index.ts":{"bytes":931,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx","kind":"import-statement","original":"./MarkdownSettings"},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx","kind":"dynamic-import","original":"./MarkdownContainer"}],"format":"esm"},"packages/plugins/plugin-markdown/src/translations.ts":{"bytes":4737,"imports":[{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx":{"bytes":44180,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-markdown/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/index.ts":{"bytes":969,"imports":[{"path":"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx","kind":"import-statement","original":"./MarkdownPlugin"},{"path":"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx","kind":"import-statement","original":"./MarkdownPlugin"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-markdown/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29247},"packages/plugins/plugin-markdown/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-J5BZUIVL.mjs","kind":"dynamic-import"}],"exports":["DocumentType","MarkdownAction","MarkdownPlugin","TextType","default","getFallbackName","isEditorModel","isMarkdownProperties","markdownExtensionPlugins","serializer","setFallbackName"],"entryPoint":"packages/plugins/plugin-markdown/src/index.ts","inputs":{"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx":{"bytesInOutput":11564},"packages/plugins/plugin-markdown/src/components/index.ts":{"bytesInOutput":110},"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx":{"bytesInOutput":3494},"packages/plugins/plugin-markdown/src/translations.ts":{"bytesInOutput":1451},"packages/plugins/plugin-markdown/src/index.ts":{"bytesInOutput":34}},"bytes":17651},"packages/plugins/plugin-markdown/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-markdown/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"}],"exports":["MARKDOWN_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-markdown/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-markdown/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-markdown/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"}],"exports":["DocumentType","MarkdownAction","TextType","isEditorModel"],"entryPoint":"packages/plugins/plugin-markdown/src/types/index.ts","inputs":{},"bytes":244},"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-J5BZUIVL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33996},"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-J5BZUIVL.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DocumentEditor","default"],"entryPoint":"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx","inputs":{"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx":{"bytesInOutput":2185},"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx":{"bytesInOutput":5842},"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx":{"bytesInOutput":1356},"packages/plugins/plugin-markdown/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-markdown/src/extensions.tsx":{"bytesInOutput":5569}},"bytes":15687},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3586},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["getFallbackName","isMarkdownProperties","markdownExtensionPlugins","serializer","setFallbackName"],"inputs":{"packages/plugins/plugin-markdown/src/util.tsx":{"bytesInOutput":1313}},"bytes":1590},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["DocumentType","MarkdownAction","TextType","isEditorModel"],"inputs":{"packages/plugins/plugin-markdown/src/types/document.ts":{"bytesInOutput":661},"packages/plugins/plugin-markdown/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-markdown/src/types/types.ts":{"bytesInOutput":340}},"bytes":1293},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":703},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs":{"imports":[],"exports":["MARKDOWN_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-markdown/src/meta.ts":{"bytesInOutput":293}},"bytes":432}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-markdown/src/meta.ts":{"bytes":1471,"imports":[],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx":{"bytes":12696,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx":{"bytes":6483,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/hooks/index.ts":{"bytes":544,"imports":[{"path":"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx","kind":"import-statement","original":"./useSelectCurrentThread"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx":{"bytes":23190,"imports":[{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/document.ts":{"bytes":3473,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/types.ts":{"bytes":4453,"imports":[{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/types/index.ts":{"bytes":591,"imports":[{"path":"packages/plugins/plugin-markdown/src/types/document.ts","kind":"import-statement","original":"./document"},{"path":"packages/plugins/plugin-markdown/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-markdown/src/util.tsx":{"bytes":6544,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-markdown/src/extensions.tsx":{"bytes":24298,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx":{"bytes":10575,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx","kind":"import-statement","original":"./MarkdownEditor"},{"path":"packages/plugins/plugin-markdown/src/extensions.tsx","kind":"import-statement","original":"../extensions"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/components/index.ts":{"bytes":931,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx","kind":"import-statement","original":"./MarkdownSettings"},{"path":"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx","kind":"dynamic-import","original":"./MarkdownContainer"}],"format":"esm"},"packages/plugins/plugin-markdown/src/translations.ts":{"bytes":4737,"imports":[{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx":{"bytes":44180,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-markdown/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-markdown/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/plugins/plugin-markdown/src/index.ts":{"bytes":969,"imports":[{"path":"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx","kind":"import-statement","original":"./MarkdownPlugin"},{"path":"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx","kind":"import-statement","original":"./MarkdownPlugin"},{"path":"packages/plugins/plugin-markdown/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-markdown/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-markdown/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29247},"packages/plugins/plugin-markdown/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-UBYHA366.mjs","kind":"dynamic-import"}],"exports":["DocumentType","MarkdownAction","MarkdownPlugin","TextType","default","getFallbackName","isEditorModel","isMarkdownProperties","markdownExtensionPlugins","serializer","setFallbackName"],"entryPoint":"packages/plugins/plugin-markdown/src/index.ts","inputs":{"packages/plugins/plugin-markdown/src/MarkdownPlugin.tsx":{"bytesInOutput":11564},"packages/plugins/plugin-markdown/src/components/index.ts":{"bytesInOutput":110},"packages/plugins/plugin-markdown/src/components/MarkdownSettings.tsx":{"bytesInOutput":3494},"packages/plugins/plugin-markdown/src/translations.ts":{"bytesInOutput":1451},"packages/plugins/plugin-markdown/src/index.ts":{"bytesInOutput":34}},"bytes":17651},"packages/plugins/plugin-markdown/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-markdown/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"}],"exports":["MARKDOWN_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-markdown/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-markdown/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-markdown/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"}],"exports":["DocumentType","MarkdownAction","TextType","isEditorModel"],"entryPoint":"packages/plugins/plugin-markdown/src/types/index.ts","inputs":{},"bytes":244},"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-UBYHA366.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32866},"packages/plugins/plugin-markdown/dist/lib/browser/MarkdownContainer-UBYHA366.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom/client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DocumentEditor","default"],"entryPoint":"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx","inputs":{"packages/plugins/plugin-markdown/src/components/MarkdownContainer.tsx":{"bytesInOutput":2123},"packages/plugins/plugin-markdown/src/components/MarkdownEditor.tsx":{"bytesInOutput":5360},"packages/plugins/plugin-markdown/src/hooks/useSelectCurrentThread.tsx":{"bytesInOutput":1356},"packages/plugins/plugin-markdown/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-markdown/src/extensions.tsx":{"bytesInOutput":5583}},"bytes":15157},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3586},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-PV4AWYWK.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["getFallbackName","isMarkdownProperties","markdownExtensionPlugins","serializer","setFallbackName"],"inputs":{"packages/plugins/plugin-markdown/src/util.tsx":{"bytesInOutput":1313}},"bytes":1590},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-VZAGHNHU.mjs":{"imports":[{"path":"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["DocumentType","MarkdownAction","TextType","isEditorModel"],"inputs":{"packages/plugins/plugin-markdown/src/types/document.ts":{"bytesInOutput":661},"packages/plugins/plugin-markdown/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-markdown/src/types/types.ts":{"bytesInOutput":340}},"bytes":1293},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":703},"packages/plugins/plugin-markdown/dist/lib/browser/chunk-4X6YX3KU.mjs":{"imports":[],"exports":["MARKDOWN_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-markdown/src/meta.ts":{"bytesInOutput":293}},"bytes":432}}}
|
|
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var MarkdownContainer_2S666KPG_exports = {};
|
|
30
|
+
__export(MarkdownContainer_2S666KPG_exports, {
|
|
31
31
|
DocumentEditor: () => DocumentEditor,
|
|
32
32
|
default: () => MarkdownContainer_default
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(MarkdownContainer_2S666KPG_exports);
|
|
35
35
|
var import_chunk_2A5P424C = require("./chunk-2A5P424C.cjs");
|
|
36
36
|
var import_chunk_BHPFK7YI = require("./chunk-BHPFK7YI.cjs");
|
|
37
37
|
var import_chunk_PHHIPRJC = require("./chunk-PHHIPRJC.cjs");
|
|
@@ -103,7 +103,6 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
103
103
|
const { themeMode } = (0, import_react_ui.useThemeContext)();
|
|
104
104
|
const dispatch = (0, import_app_framework2.useIntentDispatcher)();
|
|
105
105
|
const [formattingState, formattingObserver] = (0, import_react_ui_editor.useFormattingState)();
|
|
106
|
-
const attendableAttributes = (0, import_react_ui_attention.useAttendableAttributes)(id);
|
|
107
106
|
const { hasAttention } = (0, import_react_ui_attention.useAttention)(id);
|
|
108
107
|
const { scrollTo, selection } = (0, import_react2.useMemo)(() => editorStateStore?.getState(id) ?? {}, [
|
|
109
108
|
id
|
|
@@ -174,7 +173,6 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
174
173
|
}
|
|
175
174
|
}), [
|
|
176
175
|
id,
|
|
177
|
-
initialValue,
|
|
178
176
|
formattingObserver,
|
|
179
177
|
viewMode,
|
|
180
178
|
themeMode,
|
|
@@ -199,29 +197,16 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
199
197
|
}
|
|
200
198
|
handleToolbarAction?.(action);
|
|
201
199
|
};
|
|
202
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
className: "flex flex-col"
|
|
206
|
-
} : {
|
|
207
|
-
className: "contents",
|
|
208
|
-
// TODO(wittjosiah): Factor out to `useAttendableAttributes`?
|
|
209
|
-
...hasAttention && {
|
|
210
|
-
"aria-current": "location"
|
|
211
|
-
},
|
|
212
|
-
...attendableAttributes
|
|
213
|
-
}
|
|
200
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
201
|
+
toolbar,
|
|
202
|
+
contentSize: role === "article" ? "cover" : "intrinsic"
|
|
214
203
|
}, toolbar && /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
215
204
|
role: "none",
|
|
216
|
-
className: "
|
|
205
|
+
className: (0, import_react_ui_theme.mx)("attention-surface is-full", role === "section" && "sticky block-start-0 z-[1] border-be !border-separator -mbe-px min-is-0")
|
|
217
206
|
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui_editor.Toolbar.Root, {
|
|
218
|
-
classNames:
|
|
207
|
+
classNames: [
|
|
219
208
|
import_react_ui_theme.textBlockWidth,
|
|
220
|
-
"
|
|
221
|
-
!hasAttention && "invisible",
|
|
222
|
-
import_react_ui_stack.sectionToolbarLayout
|
|
223
|
-
] : [
|
|
224
|
-
import_react_ui_theme.textBlockWidth
|
|
209
|
+
!hasAttention && "opacity-20"
|
|
225
210
|
],
|
|
226
211
|
state: formattingState && {
|
|
227
212
|
...formattingState,
|
|
@@ -237,7 +222,7 @@ var MarkdownEditor = ({ id, role = "article", initialValue, extensions, extensio
|
|
|
237
222
|
ref: parentRef,
|
|
238
223
|
"data-testid": "composer.markdownRoot",
|
|
239
224
|
"data-toolbar": toolbar ? "enabled" : "disabled",
|
|
240
|
-
className:
|
|
225
|
+
className: (0, import_react_ui_theme.mx)("ch-focus-ring-inset data-[toolbar=disabled]:pbs-2 attention-surface", role === "article" ? "min-bs-0" : "[&_.cm-scroller]:overflow-hidden [&_.cm-scroller]:min-bs-24"),
|
|
241
226
|
...focusAttributes
|
|
242
227
|
}));
|
|
243
228
|
};
|
|
@@ -281,7 +266,8 @@ var useExtensions = ({ document, settings, viewMode, editorStateStore, extension
|
|
|
281
266
|
}
|
|
282
267
|
return acc;
|
|
283
268
|
}, []), [
|
|
284
|
-
extensionProviders
|
|
269
|
+
extensionProviders,
|
|
270
|
+
document
|
|
285
271
|
]);
|
|
286
272
|
return (0, import_react4.useMemo)(() => [
|
|
287
273
|
// NOTE: Data extensions must be first so that automerge is updated before other extensions compute their state.
|
|
@@ -448,9 +434,6 @@ var MarkdownContainer = ({ id, role, object, extensionProviders, settings, viewM
|
|
|
448
434
|
};
|
|
449
435
|
var DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }) => {
|
|
450
436
|
const space = (0, import_echo.getSpace)(doc);
|
|
451
|
-
const initialValue = (0, import_react.useMemo)(() => doc.content?.content, [
|
|
452
|
-
doc.content
|
|
453
|
-
]);
|
|
454
437
|
(0, import_react.useEffect)(() => {
|
|
455
438
|
if (!doc.fallbackName && doc.content?.content) {
|
|
456
439
|
doc.fallbackName = (0, import_chunk_2A5P424C.getFallbackName)(doc.content.content);
|
|
@@ -471,7 +454,7 @@ var DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }) => {
|
|
|
471
454
|
]);
|
|
472
455
|
return /* @__PURE__ */ import_react.default.createElement(MarkdownEditor, {
|
|
473
456
|
id,
|
|
474
|
-
initialValue,
|
|
457
|
+
initialValue: doc.content?.content,
|
|
475
458
|
viewMode,
|
|
476
459
|
toolbar: settings.toolbar,
|
|
477
460
|
inputMode: settings.editorInputMode,
|
|
@@ -484,4 +467,4 @@ var MarkdownContainer_default = MarkdownContainer;
|
|
|
484
467
|
0 && (module.exports = {
|
|
485
468
|
DocumentEditor
|
|
486
469
|
});
|
|
487
|
-
//# sourceMappingURL=MarkdownContainer-
|
|
470
|
+
//# sourceMappingURL=MarkdownContainer-2S666KPG.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/MarkdownContainer.tsx", "../../../src/components/MarkdownEditor.tsx", "../../../src/hooks/useSelectCurrentThread.tsx", "../../../src/extensions.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useMemo } from 'react';\n\nimport { useResolvePlugin, parseFileManagerPlugin } from '@dxos/app-framework';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\n\nimport { MarkdownEditor, type MarkdownEditorProps } from './MarkdownEditor';\nimport { useExtensions } from '../extensions';\nimport { DocumentType, type MarkdownSettingsProps } from '../types';\nimport { getFallbackName } from '../util';\n\nexport type MarkdownContainerProps = Pick<\n MarkdownEditorProps,\n 'role' | 'extensionProviders' | 'viewMode' | 'editorStateStore' | 'onViewModeChange'\n> & {\n id: string;\n object: DocumentType | any;\n settings: MarkdownSettingsProps;\n};\n\n// TODO(burdon): Move toolbar here.\n// TODO(burdon): Factor out difference for ECHO and non-ECHO objects; i.e., single component.\nconst MarkdownContainer = ({\n id,\n role,\n object,\n extensionProviders,\n settings,\n viewMode,\n editorStateStore,\n onViewModeChange,\n}: MarkdownContainerProps) => {\n const scrollPastEnd = role === 'article';\n const doc = object instanceof DocumentType ? object : undefined;\n const extensions = useExtensions({ extensionProviders, document: doc, settings, viewMode, editorStateStore });\n\n if (doc) {\n return (\n <DocumentEditor\n id={fullyQualifiedId(object)}\n role={role}\n document={doc}\n extensions={extensions}\n settings={settings}\n scrollPastEnd={scrollPastEnd}\n onViewModeChange={onViewModeChange}\n />\n );\n } else {\n return (\n <MarkdownEditor\n id={id}\n role={role}\n initialValue={object.text}\n extensions={extensions}\n viewMode={viewMode}\n toolbar={settings.toolbar}\n inputMode={settings.editorInputMode}\n scrollPastEnd={scrollPastEnd}\n onViewModeChange={onViewModeChange}\n />\n );\n }\n};\n\ntype DocumentEditorProps = Omit<MarkdownContainerProps, 'object' | 'extensionProviders' | 'editorStateStore'> &\n Pick<MarkdownEditorProps, 'id' | 'scrollPastEnd' | 'extensions'> & {\n document: DocumentType;\n };\n\nexport const DocumentEditor = ({ id, document: doc, settings, viewMode, ...props }: DocumentEditorProps) => {\n const space = getSpace(doc);\n\n // Migrate gradually to `fallbackName`.\n useEffect(() => {\n if (!doc.fallbackName && doc.content?.content) {\n doc.fallbackName = getFallbackName(doc.content.content);\n }\n }, [doc, doc.content]);\n\n // File dragging.\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n const handleFileUpload = useMemo(() => {\n if (space === undefined || fileManagerPlugin?.provides.file.upload === undefined) {\n return undefined;\n }\n\n // TODO(burdon): Re-order props: space, file.\n return async (file: File) => fileManagerPlugin?.provides?.file?.upload?.(file, space);\n }, [space, fileManagerPlugin]);\n\n return (\n <MarkdownEditor\n id={id}\n initialValue={doc.content?.content}\n viewMode={viewMode}\n toolbar={settings.toolbar}\n inputMode={settings.editorInputMode}\n onFileUpload={handleFileUpload}\n {...props}\n />\n );\n};\n\nexport default MarkdownContainer;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { openSearchPanel } from '@codemirror/search';\nimport { type EditorView } from '@codemirror/view';\nimport React, { useMemo, useEffect, useCallback } from 'react';\n\nimport { type FileInfo, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport {\n type Action,\n type DNDOptions,\n type EditorViewMode,\n type EditorInputMode,\n type EditorSelectionState,\n type EditorStateStore,\n Toolbar,\n type UseTextEditorProps,\n createBasicExtensions,\n createMarkdownExtensions,\n createThemeExtensions,\n dropFile,\n editorContent,\n editorGutter,\n processAction,\n useActionHandler,\n useCommentState,\n useCommentClickListener,\n useFormattingState,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx, textBlockWidth } from '@dxos/react-ui-theme';\nimport { isNotFalsy, nonNullable } from '@dxos/util';\n\nimport { useSelectCurrentThread } from '../hooks';\nimport { MARKDOWN_PLUGIN } from '../meta';\nimport { type MarkdownPluginState } from '../types';\n\nconst DEFAULT_VIEW_MODE: EditorViewMode = 'preview';\n\nexport type MarkdownEditorProps = {\n id: string;\n role?: string;\n inputMode?: EditorInputMode;\n scrollPastEnd?: boolean;\n toolbar?: boolean;\n viewMode?: EditorViewMode;\n editorStateStore?: EditorStateStore;\n onViewModeChange?: (id: string, mode: EditorViewMode) => void;\n onFileUpload?: (file: File) => Promise<FileInfo | undefined>;\n} & Pick<UseTextEditorProps, 'initialValue' | 'extensions'> &\n Partial<Pick<MarkdownPluginState, 'extensionProviders'>>;\n\n/**\n * Base markdown editor component.\n *\n * This component provides all the features of the markdown editor that do no depend on ECHO.\n * This allows it to be used as a common editor for markdown content on arbitrary backends (e.g. files).\n */\nexport const MarkdownEditor = ({\n id,\n role = 'article',\n initialValue,\n extensions,\n extensionProviders,\n scrollPastEnd,\n toolbar,\n viewMode,\n editorStateStore,\n onFileUpload,\n onViewModeChange,\n}: MarkdownEditorProps) => {\n const { t } = useTranslation(MARKDOWN_PLUGIN);\n const { themeMode } = useThemeContext();\n const dispatch = useIntentDispatcher();\n const [formattingState, formattingObserver] = useFormattingState();\n const { hasAttention } = useAttention(id);\n\n // Restore last selection and scroll point.\n const { scrollTo, selection } = useMemo<EditorSelectionState>(() => editorStateStore?.getState(id) ?? {}, [id]);\n\n // Extensions from other plugins.\n // TODO(burdon): Reconcile with DocumentEditor.useExtensions.\n const providerExtensions = useMemo(\n () => extensionProviders?.flatMap((provider) => provider({})).filter(nonNullable),\n [extensionProviders],\n );\n\n // TODO(Zan): Move these into thread plugin as well?\n const [commentsState, commentObserver] = useCommentState();\n const onCommentClick = useCallback(() => {\n void dispatch({\n action: LayoutAction.SET_LAYOUT,\n data: { element: 'complementary', state: true },\n });\n }, [dispatch]);\n const commentClickObserver = useCommentClickListener(onCommentClick);\n\n // Drag files.\n const handleDrop: DNDOptions['onDrop'] = async (view, { files }) => {\n const file = files[0];\n const info = file && onFileUpload ? await onFileUpload(file) : undefined;\n if (info) {\n processAction(view, { type: 'image', data: info.url });\n }\n };\n\n const {\n parentRef,\n view: editorView,\n focusAttributes,\n } = useTextEditor(\n () => ({\n initialValue,\n extensions: [\n formattingObserver,\n commentObserver,\n commentClickObserver,\n createBasicExtensions({\n readonly: viewMode === 'readonly',\n placeholder: t('editor placeholder'),\n scrollPastEnd: role === 'section' ? false : scrollPastEnd,\n }),\n createMarkdownExtensions({ themeMode }),\n createThemeExtensions({\n themeMode,\n syntaxHighlighting: true,\n slots: { content: { className: editorContent } },\n }),\n editorGutter,\n role !== 'section' && onFileUpload && dropFile({ onDrop: handleDrop }),\n providerExtensions,\n extensions,\n ].filter(isNotFalsy),\n ...(role !== 'section' && {\n id,\n scrollTo,\n selection,\n // TODO(wittjosiah): Autofocus based on layout is racy.\n // autoFocus: layoutPlugin?.provides.layout ? layoutPlugin?.provides.layout.scrollIntoView === id : true,\n moveToEndOfLine: true,\n }),\n }),\n [id, formattingObserver, viewMode, themeMode, extensions, providerExtensions],\n );\n\n useTest(editorView);\n useSelectCurrentThread(editorView, id);\n\n // Toolbar handler.\n const handleToolbarAction = useActionHandler(editorView);\n const handleAction = (action: Action) => {\n switch (action.type) {\n case 'search': {\n if (editorView) {\n openSearchPanel(editorView);\n }\n return;\n }\n case 'view-mode': {\n onViewModeChange?.(id, action.data);\n return;\n }\n }\n\n handleToolbarAction?.(action);\n };\n\n return (\n <StackItem.Content toolbar={toolbar} contentSize={role === 'article' ? 'cover' : 'intrinsic'}>\n {toolbar && (\n <div\n role='none'\n className={mx(\n 'attention-surface is-full',\n role === 'section' && 'sticky block-start-0 z-[1] border-be !border-separator -mbe-px min-is-0',\n )}\n >\n <Toolbar.Root\n classNames={[textBlockWidth, !hasAttention && 'opacity-20']}\n state={formattingState && { ...formattingState, ...commentsState }}\n onAction={handleAction}\n >\n <Toolbar.Markdown />\n {onFileUpload && <Toolbar.Custom onUpload={onFileUpload} />}\n <Toolbar.Separator />\n <Toolbar.View mode={viewMode ?? DEFAULT_VIEW_MODE} />\n <Toolbar.Actions />\n </Toolbar.Root>\n </div>\n )}\n <div\n role='none'\n ref={parentRef}\n data-testid='composer.markdownRoot'\n data-toolbar={toolbar ? 'enabled' : 'disabled'}\n className={mx(\n 'ch-focus-ring-inset data-[toolbar=disabled]:pbs-2 attention-surface',\n role === 'article' ? 'min-bs-0' : '[&_.cm-scroller]:overflow-hidden [&_.cm-scroller]:min-bs-24',\n )}\n {...focusAttributes}\n />\n </StackItem.Content>\n );\n};\n\n// Expose editor view for playwright tests.\n// TODO(wittjosiah): Find a better way to expose this or find a way to limit it to test runs.\nconst useTest = (view?: EditorView) => {\n useEffect(() => {\n const composer = (window as any).composer;\n if (composer) {\n composer.editorView = view;\n }\n }, [view]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { useCallback } from 'react';\n\nimport { LayoutAction, useIntentResolver } from '@dxos/app-framework';\nimport { Cursor, setSelection } from '@dxos/react-ui-editor';\n\nimport { MARKDOWN_PLUGIN } from '../meta';\n\n/**\n * Handle scrolling and selection of the current thread in a markdown editor.\n */\nexport const useSelectCurrentThread = (editorView: EditorView | undefined, documentId: string) => {\n const handleScrollIntoView = useCallback(\n ({ action, data }: { action: string; data?: any }) => {\n if (action === LayoutAction.SCROLL_INTO_VIEW) {\n if (editorView && data?.id === documentId && data?.cursor) {\n // TODO(burdon): We need typed intents.\n const range = Cursor.getRangeFromCursor(editorView.state, data.cursor);\n if (range) {\n const selection = editorView.state.selection.main.from !== range.from ? { anchor: range.from } : undefined;\n const effects = [\n // NOTE: This does not use the DOM scrollIntoView function.\n EditorView.scrollIntoView(range.from, { y: 'start', yMargin: 96 }),\n ];\n if (selection) {\n // Update the editor selection to get bi-directional highlighting.\n effects.push(setSelection.of({ current: documentId }));\n }\n\n editorView.dispatch({\n effects,\n selection: selection ? { anchor: range.from } : undefined,\n });\n }\n }\n }\n },\n [documentId, editorView],\n );\n\n useIntentResolver(MARKDOWN_PLUGIN, handleScrollIntoView);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type AnchorHTMLAttributes, type ReactNode, useMemo } from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { type IntentDispatcher, NavigationAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { createDocAccessor, fullyQualifiedId, getSpace, type Query } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ThemeProvider } from '@dxos/react-ui';\nimport {\n type AutocompleteResult,\n type EditorStateStore,\n type EditorViewMode,\n type Extension,\n InputModeExtensions,\n createDataExtensions,\n autocomplete,\n decorateMarkdown,\n folding,\n formattingKeymap,\n linkTooltip,\n listener,\n selectionState,\n typewriter,\n} from '@dxos/react-ui-editor';\nimport { defaultTx } from '@dxos/react-ui-theme';\nimport { isNotFalsy } from '@dxos/util';\n\nimport { type DocumentType, type MarkdownPluginState, type MarkdownSettingsProps } from './types';\nimport { setFallbackName } from './util';\n\ntype ExtensionsOptions = {\n document?: DocumentType;\n dispatch?: IntentDispatcher;\n query?: Query<DocumentType>;\n settings: MarkdownSettingsProps;\n viewMode?: EditorViewMode;\n editorStateStore?: EditorStateStore;\n};\n\n// TODO(burdon): Merge with createBaseExtensions below.\nexport const useExtensions = ({\n document,\n settings,\n viewMode,\n editorStateStore,\n extensionProviders,\n}: ExtensionsOptions & Pick<MarkdownPluginState, 'extensionProviders'>): Extension[] => {\n const dispatch = useIntentDispatcher();\n const identity = useIdentity();\n const space = getSpace(document);\n\n // TODO(wittjosiah): Autocomplete is not working and this query is causing performance issues.\n // TODO(burdon): Unsubscribe.\n // const query = space?.db.query(Filter.schema(DocumentType));\n // query?.subscribe();\n const baseExtensions = useMemo(\n () =>\n createBaseExtensions({\n document,\n settings,\n viewMode,\n dispatch,\n // query,\n }),\n [\n document,\n viewMode,\n dispatch,\n settings,\n settings.editorInputMode,\n settings.folding,\n settings.numberedHeadings,\n settings.debug,\n settings.typewriter,\n ],\n );\n\n //\n // External extensions from other plugins.\n //\n const pluginExtensions = useMemo<Extension[] | undefined>(\n () =>\n extensionProviders?.reduce((acc: Extension[], provider) => {\n const extension = typeof provider === 'function' ? provider({ document }) : provider;\n if (extension) {\n acc.push(extension);\n }\n\n return acc;\n }, []),\n [extensionProviders, document],\n );\n\n //\n // Basic plugins.\n //\n return useMemo<Extension[]>(\n () =>\n [\n // NOTE: Data extensions must be first so that automerge is updated before other extensions compute their state.\n document &&\n createDataExtensions({\n id: document.id,\n text: document.content && createDocAccessor(document.content, ['content']),\n space,\n identity,\n }),\n selectionState(editorStateStore),\n document &&\n listener({\n onChange: (text) => setFallbackName(document, text),\n }),\n baseExtensions,\n pluginExtensions,\n ].filter(isNotFalsy),\n [baseExtensions, pluginExtensions, document, document?.content, space, identity],\n );\n};\n\n/**\n * Create extension instances for editor.\n */\nconst createBaseExtensions = ({ document, dispatch, settings, query, viewMode }: ExtensionsOptions): Extension[] => {\n const extensions: Extension[] = [\n settings.editorInputMode && InputModeExtensions[settings.editorInputMode],\n settings.folding && folding(),\n ].filter(isNotFalsy);\n\n //\n // Markdown\n //\n if (viewMode !== 'source') {\n extensions.push(\n ...[\n formattingKeymap(),\n decorateMarkdown({\n selectionChangeDelay: 100,\n numberedHeadings: settings.numberedHeadings ? { from: 2 } : undefined,\n // TODO(wittjosiah): For internal links, consider ignoring the link text and rendering the label of the object being linked to.\n renderLinkButton:\n dispatch && document\n ? onRenderLink((id: string) => {\n void dispatch({\n action: NavigationAction.ADD_TO_ACTIVE,\n data: {\n id,\n part: 'main',\n pivotId: fullyQualifiedId(document),\n scrollIntoView: true,\n },\n });\n })\n : undefined,\n }),\n linkTooltip(renderLinkTooltip),\n ],\n );\n }\n\n //\n // Autocomplete object links.\n //\n if (query) {\n extensions.push(\n autocomplete({\n onSearch: (text: string) => {\n // TODO(burdon): Specify filter (e.g., stack).\n return query.objects\n .map<AutocompleteResult | undefined>((object) =>\n object.name?.length && object.id !== document?.id\n ? {\n label: object.name,\n // TODO(burdon): Factor out URL builder.\n apply: `[${object.name}](/${fullyQualifiedId(object)})`,\n }\n : undefined,\n )\n .filter(isNotFalsy);\n },\n }),\n );\n }\n\n if (settings.debug) {\n const items = settings.typewriter?.split(/[,\\n]/) ?? '';\n if (items) {\n extensions.push(typewriter({ items }));\n }\n }\n\n return extensions;\n};\n\n// TODO(burdon): Factor out styles.\nconst style = {\n hover: 'rounded-sm text-primary-500 hover:text-primary-600 dark:text-primary-500 hover:dark:text-primary-400',\n icon: 'inline-block leading-none mis-1 cursor-pointer',\n};\n\nconst onRenderLink = (onSelectObject: (id: string) => void) => (el: Element, url: string) => {\n // TODO(burdon): Formalize/document internal link format.\n const isInternal =\n url.startsWith('/') ||\n // TODO(wittjosiah): This should probably be parsed out on paste?\n url.startsWith(window.location.origin);\n\n const options: AnchorHTMLAttributes<any> = isInternal\n ? {\n onClick: () => {\n const qualifiedId = url.split('/').at(-1);\n invariant(qualifiedId, 'Invalid link format.');\n onSelectObject(qualifiedId);\n },\n }\n : {\n href: url,\n rel: 'noreferrer',\n target: '_blank',\n };\n\n renderRoot(\n el,\n <a {...options} className={style.hover}>\n <Icon\n icon={isInternal ? 'ph--arrow-square-down--bold' : 'ph--arrow-square-out--bold'}\n size={4}\n classNames={style.icon}\n />\n </a>,\n );\n};\n\nconst renderLinkTooltip = (el: Element, url: string) => {\n const web = new URL(url);\n renderRoot(\n el,\n <a href={url} rel='noreferrer' target='_blank' className={style.hover}>\n {web.origin}\n <Icon icon='ph--arrow-square-out--bold' size={4} classNames={style.icon} />\n </a>,\n );\n};\n\n// TODO(burdon): Remove react rendering; use DOM directly.\nexport const renderRoot = <T extends Element>(root: T, node: ReactNode): T => {\n createRoot(root).render(<ThemeProvider tx={defaultTx}>{node}</ThemeProvider>);\n return root;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA0C;AAE1C,2BAAyD;AACzD,kBAA2C;ACH3C,oBAAgC;AAEhC,IAAAA,gBAAuD;AAEvD,IAAAC,wBAAiE;AACjE,sBAAgD;AAChD,gCAA6B;AAC7B,6BAqBO;AACP,4BAA0B;AAC1B,4BAAmC;AACnC,kBAAwC;AC/BxC,kBAA2B;AAC3B,IAAAD,gBAA4B;AAE5B,IAAAC,wBAAgD;AAChD,IAAAC,0BAAqC;ACJrC,IAAAF,gBAA0E;AAC1E,oBAA2B;AAE3B,IAAAC,wBAA6E;AAC7E,uB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xB;IACA0B,cAAc2K,IAAItH,SAASA;IAC3BhD;IACAD,SAASwF,SAASxF;IAClB0K,WAAWlF,SAASO;IACpB5F,cAAc8K;IACb,GAAGN;;AAGV;AAEA,IAAA,4BAAeL;",
|
|
6
|
+
"names": ["import_react", "import_app_framework", "import_react_ui_editor", "import_echo", "import_react_ui", "import_react_ui_theme", "import_util", "useSelectCurrentThread", "editorView", "documentId", "handleScrollIntoView", "useCallback", "action", "data", "LayoutAction", "SCROLL_INTO_VIEW", "id", "cursor", "range", "Cursor", "getRangeFromCursor", "state", "selection", "main", "from", "anchor", "undefined", "effects", "EditorView", "scrollIntoView", "y", "yMargin", "push", "setSelection", "of", "current", "dispatch", "useIntentResolver", "MARKDOWN_PLUGIN", "DEFAULT_VIEW_MODE", "MarkdownEditor", "role", "initialValue", "extensions", "extensionProviders", "scrollPastEnd", "toolbar", "viewMode", "editorStateStore", "onFileUpload", "onViewModeChange", "t", "useTranslation", "themeMode", "useThemeContext", "useIntentDispatcher", "formattingState", "formattingObserver", "useFormattingState", "hasAttention", "useAttention", "scrollTo", "useMemo", "getState", "providerExtensions", "flatMap", "provider", "filter", "nonNullable", "commentsState", "commentObserver", "useCommentState", "onCommentClick", "SET_LAYOUT", "element", "commentClickObserver", "useCommentClickListener", "handleDrop", "view", "files", "file", "info", "processAction", "type", "url", "parentRef", "focusAttributes", "useTextEditor", "createBasicExtensions", "readonly", "placeholder", "createMarkdownExtensions", "createThemeExtensions", "syntaxHighlighting", "slots", "content", "className", "editorContent", "editorGutter", "dropFile", "onDrop", "isNotFalsy", "moveToEndOfLine", "useTest", "handleToolbarAction", "useActionHandler", "handleAction", "openSearchPanel", "React", "StackItem", "Content", "contentSize", "div", "mx", "Toolbar", "Root", "classNames", "textBlockWidth", "onAction", "Markdown", "Custom", "onUpload", "Separator", "View", "mode", "Actions", "ref", "data-testid", "data-toolbar", "useEffect", "composer", "window", "useExtensions", "document", "settings", "identity", "useIdentity", "space", "getSpace", "baseExtensions", "createBaseExtensions", "editorInputMode", "folding", "numberedHeadings", "debug", "typewriter", "pluginExtensions", "reduce", "acc", "extension", "createDataExtensions", "text", "createDocAccessor", "selectionState", "listener", "onChange", "setFallbackName", "query", "InputModeExtensions", "formattingKeymap", "decorateMarkdown", "selectionChangeDelay", "renderLinkButton", "onRenderLink", "NavigationAction", "ADD_TO_ACTIVE", "part", "pivotId", "fullyQualifiedId", "linkTooltip", "renderLinkTooltip", "autocomplete", "onSearch", "objects", "map", "object", "name", "length", "label", "apply", "items", "split", "style", "hover", "icon", "onSelectObject", "el", "isInternal", "startsWith", "location", "origin", "options", "onClick", "qualifiedId", "at", "invariant", "href", "rel", "target", "renderRoot", "a", "Icon", "size", "web", "URL", "root", "node", "createRoot", "render", "ThemeProvider", "tx", "defaultTx", "MarkdownContainer", "doc", "DocumentType", "DocumentEditor", "inputMode", "props", "fallbackName", "getFallbackName", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "handleFileUpload", "provides", "upload"]
|
|
7
|
+
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -119,7 +119,7 @@ var MarkdownSettings = ({ settings }) => {
|
|
|
119
119
|
onCheckedChange: (checked) => settings.debug = !!checked
|
|
120
120
|
})));
|
|
121
121
|
};
|
|
122
|
-
var MarkdownContainer = (0, import_react3.lazy)(() => import("./MarkdownContainer-
|
|
122
|
+
var MarkdownContainer = (0, import_react3.lazy)(() => import("./MarkdownContainer-2S666KPG.cjs"));
|
|
123
123
|
var translations_default = [
|
|
124
124
|
{
|
|
125
125
|
"en-US": {
|