@dxos/react-ui-editor 0.8.4-main.3f58842 → 0.8.4-main.406dc2a
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/{chunk-22UMM3QJ.mjs → chunk-HL3YF6WC.mjs} +2 -2
- package/dist/lib/browser/chunk-HL3YF6WC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4239 -3098
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +71 -1
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-YXYQPV6R.mjs → chunk-YJZGD3LY.mjs} +2 -2
- package/dist/lib/node-esm/chunk-YJZGD3LY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4239 -3098
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +71 -1
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Editor/Editor.d.ts +24 -9
- package/dist/types/src/components/Editor/Editor.d.ts.map +1 -1
- package/dist/types/src/components/Editor/Editor.stories.d.ts +30 -0
- package/dist/types/src/components/Editor/Editor.stories.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/blocks.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/formatting.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/headings.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/image.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/lists.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/search.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/util.d.ts +3 -3
- package/dist/types/src/components/EditorToolbar/util.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/defaults.d.ts.map +1 -1
- package/dist/types/src/extensions/autocomplete/autocomplete.d.ts +26 -0
- package/dist/types/src/extensions/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/types/src/extensions/autocomplete/index.d.ts +5 -0
- package/dist/types/src/extensions/autocomplete/index.d.ts.map +1 -0
- package/dist/types/src/extensions/autocomplete/match.d.ts +13 -0
- package/dist/types/src/extensions/autocomplete/match.d.ts.map +1 -0
- package/dist/types/src/extensions/autocomplete/placeholder.d.ts +20 -0
- package/dist/types/src/extensions/autocomplete/placeholder.d.ts.map +1 -0
- package/dist/types/src/extensions/autocomplete/typeahead.d.ts +10 -0
- package/dist/types/src/extensions/autocomplete/typeahead.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/automerge.d.ts +1 -1
- package/dist/types/src/extensions/automerge/automerge.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts +10 -19
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/defs.d.ts +1 -1
- package/dist/types/src/extensions/automerge/defs.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/sync.d.ts +2 -2
- package/dist/types/src/extensions/automerge/sync.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/update-automerge.d.ts.map +1 -1
- package/dist/types/src/extensions/autoscroll.d.ts +10 -0
- package/dist/types/src/extensions/autoscroll.d.ts.map +1 -0
- package/dist/types/src/extensions/comments.d.ts +1 -1
- package/dist/types/src/extensions/comments.d.ts.map +1 -1
- package/dist/types/src/extensions/dnd.d.ts.map +1 -1
- package/dist/types/src/extensions/factories.d.ts +8 -8
- package/dist/types/src/extensions/factories.d.ts.map +1 -1
- package/dist/types/src/extensions/focus.d.ts.map +1 -1
- package/dist/types/src/extensions/folding.d.ts.map +1 -1
- package/dist/types/src/extensions/index.d.ts +4 -1
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/json.d.ts +1 -1
- package/dist/types/src/extensions/json.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/action.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/bundle.d.ts +8 -2
- package/dist/types/src/extensions/markdown/bundle.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/changes.d.ts +1 -1
- package/dist/types/src/extensions/markdown/changes.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/decorate.d.ts +9 -1
- package/dist/types/src/extensions/markdown/decorate.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.test.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/highlight.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/image.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/link.d.ts.map +1 -1
- package/dist/types/src/extensions/modes.d.ts +1 -1
- package/dist/types/src/extensions/modes.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/menu.d.ts +8 -0
- package/dist/types/src/extensions/outliner/menu.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/outliner.d.ts +1 -1
- package/dist/types/src/extensions/outliner/outliner.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/selection.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/tree.d.ts +2 -2
- package/dist/types/src/extensions/outliner/tree.d.ts.map +1 -1
- package/dist/types/src/extensions/popover/PopoverMenuProvider.d.ts +36 -0
- package/dist/types/src/extensions/popover/PopoverMenuProvider.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/index.d.ts +8 -0
- package/dist/types/src/extensions/popover/index.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/menu-presets.d.ts +4 -0
- package/dist/types/src/extensions/popover/menu-presets.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/menu.d.ts +24 -0
- package/dist/types/src/extensions/popover/menu.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/modal.d.ts +7 -0
- package/dist/types/src/extensions/popover/modal.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/popover.d.ts +47 -0
- package/dist/types/src/extensions/popover/popover.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/usePopoverMenu.d.ts +34 -0
- package/dist/types/src/extensions/popover/usePopoverMenu.d.ts.map +1 -0
- package/dist/types/src/extensions/popover/util.d.ts +8 -0
- package/dist/types/src/extensions/popover/util.d.ts.map +1 -0
- package/dist/types/src/extensions/preview/preview.d.ts +2 -6
- package/dist/types/src/extensions/preview/preview.d.ts.map +1 -1
- package/dist/types/src/extensions/state.d.ts +2 -0
- package/dist/types/src/extensions/state.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/extended-markdown.d.ts +10 -0
- package/dist/types/src/extensions/tags/extended-markdown.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/extended-markdown.test.d.ts +2 -0
- package/dist/types/src/extensions/tags/extended-markdown.test.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/index.d.ts +4 -0
- package/dist/types/src/extensions/tags/index.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/streamer.d.ts +12 -0
- package/dist/types/src/extensions/tags/streamer.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-tags.d.ts +72 -0
- package/dist/types/src/extensions/tags/xml-tags.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-util.d.ts +10 -0
- package/dist/types/src/extensions/tags/xml-util.d.ts.map +1 -0
- package/dist/types/src/hooks/useTextEditor.d.ts +4 -8
- package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
- package/dist/types/src/stories/CommandDialog.stories.d.ts +14 -0
- package/dist/types/src/stories/CommandDialog.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Comments.stories.d.ts +21 -10
- package/dist/types/src/stories/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/stories/EditorToolbar.stories.d.ts +39 -3
- package/dist/types/src/stories/EditorToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Experimental.stories.d.ts +22 -13
- package/dist/types/src/stories/Experimental.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Markdown.stories.d.ts +32 -43
- package/dist/types/src/stories/Markdown.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Outliner.stories.d.ts +15 -21
- package/dist/types/src/stories/Outliner.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Popover.stories.d.ts +20 -0
- package/dist/types/src/stories/Popover.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Preview.stories.d.ts +21 -7
- package/dist/types/src/stories/Preview.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Tags.stories.d.ts +16 -0
- package/dist/types/src/stories/Tags.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TextEditor.stories.d.ts +37 -52
- package/dist/types/src/stories/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/EditorStory.d.ts +6 -9
- package/dist/types/src/stories/components/EditorStory.d.ts.map +1 -1
- package/dist/types/src/styles/theme.d.ts.map +1 -1
- package/dist/types/src/testing/PreviewPopover.d.ts +20 -0
- package/dist/types/src/testing/PreviewPopover.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/util.d.ts +1 -0
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -1
- package/dist/types/src/types/types.d.ts +2 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/cursor.d.ts.map +1 -1
- package/dist/types/src/util/debug.d.ts +1 -1
- package/dist/types/src/util/debug.d.ts.map +1 -1
- package/dist/types/src/util/decorations.d.ts +4 -0
- package/dist/types/src/util/decorations.d.ts.map +1 -0
- package/dist/types/src/util/dom.d.ts +2 -12
- package/dist/types/src/util/dom.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/react.d.ts +1 -1
- package/dist/types/src/util/react.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +69 -61
- package/src/components/Editor/Editor.stories.tsx +72 -0
- package/src/components/Editor/Editor.tsx +58 -15
- package/src/components/EditorToolbar/EditorToolbar.tsx +41 -30
- package/src/components/EditorToolbar/blocks.ts +21 -24
- package/src/components/EditorToolbar/formatting.ts +22 -25
- package/src/components/EditorToolbar/headings.ts +10 -5
- package/src/components/EditorToolbar/image.ts +8 -4
- package/src/components/EditorToolbar/lists.ts +16 -19
- package/src/components/EditorToolbar/search.ts +8 -4
- package/src/components/EditorToolbar/util.ts +16 -5
- package/src/components/EditorToolbar/view-mode.ts +11 -6
- package/src/components/index.ts +0 -1
- package/src/defaults.ts +5 -2
- package/src/extensions/autocomplete/autocomplete.ts +220 -0
- package/src/extensions/autocomplete/index.ts +8 -0
- package/src/extensions/autocomplete/match.ts +46 -0
- package/src/extensions/{command → autocomplete}/placeholder.ts +22 -18
- package/src/extensions/{command → autocomplete}/typeahead.ts +8 -50
- package/src/extensions/automerge/automerge.stories.tsx +31 -24
- package/src/extensions/automerge/automerge.ts +31 -11
- package/src/extensions/automerge/defs.ts +1 -1
- package/src/extensions/automerge/sync.ts +8 -4
- package/src/extensions/automerge/update-automerge.ts +1 -1
- package/src/extensions/autoscroll.ts +157 -0
- package/src/extensions/awareness/awareness.ts +2 -2
- package/src/extensions/comments.ts +18 -13
- package/src/extensions/dnd.ts +1 -1
- package/src/extensions/factories.ts +48 -31
- package/src/extensions/focus.ts +5 -4
- package/src/extensions/folding.tsx +4 -6
- package/src/extensions/hashtag.tsx +2 -2
- package/src/extensions/index.ts +4 -1
- package/src/extensions/json.ts +1 -1
- package/src/extensions/markdown/action.ts +2 -1
- package/src/extensions/markdown/bundle.ts +29 -5
- package/src/extensions/markdown/changes.ts +1 -1
- package/src/extensions/markdown/decorate.ts +24 -14
- package/src/extensions/markdown/formatting.test.ts +6 -6
- package/src/extensions/markdown/formatting.ts +3 -3
- package/src/extensions/markdown/highlight.ts +1 -1
- package/src/extensions/markdown/image.ts +3 -4
- package/src/extensions/markdown/link.ts +3 -0
- package/src/extensions/markdown/table.ts +7 -1
- package/src/extensions/mention.ts +1 -1
- package/src/extensions/modes.ts +2 -2
- package/src/extensions/{command/floating-menu.ts → outliner/menu.ts} +16 -21
- package/src/extensions/outliner/outliner.test.ts +3 -2
- package/src/extensions/outliner/outliner.ts +7 -6
- package/src/extensions/outliner/selection.ts +1 -1
- package/src/extensions/outliner/tree.test.ts +2 -1
- package/src/extensions/outliner/tree.ts +2 -2
- package/src/extensions/popover/PopoverMenuProvider.tsx +221 -0
- package/src/extensions/popover/index.ts +12 -0
- package/src/extensions/popover/menu-presets.ts +124 -0
- package/src/extensions/popover/menu.ts +67 -0
- package/src/extensions/popover/modal.ts +24 -0
- package/src/extensions/popover/popover.ts +293 -0
- package/src/extensions/popover/usePopoverMenu.ts +173 -0
- package/src/extensions/popover/util.ts +29 -0
- package/src/extensions/preview/index.ts +1 -1
- package/src/extensions/preview/preview.ts +57 -62
- package/src/extensions/selection.ts +2 -2
- package/src/extensions/state.ts +7 -0
- package/src/extensions/tags/extended-markdown.test.ts +261 -0
- package/src/extensions/tags/extended-markdown.ts +78 -0
- package/src/extensions/tags/index.ts +7 -0
- package/src/extensions/tags/streamer.ts +243 -0
- package/src/extensions/tags/xml-tags.ts +393 -0
- package/src/extensions/tags/xml-util.ts +94 -0
- package/src/hooks/useTextEditor.ts +27 -39
- package/src/stories/CommandDialog.stories.tsx +78 -0
- package/src/stories/Comments.stories.tsx +14 -10
- package/src/stories/EditorToolbar.stories.tsx +13 -12
- package/src/stories/Experimental.stories.tsx +17 -13
- package/src/stories/Markdown.stories.tsx +25 -21
- package/src/stories/Outliner.stories.tsx +54 -35
- package/src/stories/Popover.stories.tsx +163 -0
- package/src/stories/Preview.stories.tsx +34 -33
- package/src/stories/Tags.stories.tsx +81 -0
- package/src/stories/TextEditor.stories.tsx +39 -58
- package/src/stories/components/EditorStory.tsx +16 -15
- package/src/styles/theme.ts +16 -12
- package/src/testing/PreviewPopover.tsx +80 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/util.ts +2 -0
- package/src/translations.ts +1 -1
- package/src/types/types.ts +1 -1
- package/src/util/cursor.ts +2 -1
- package/src/util/debug.ts +2 -2
- package/src/util/decorations.ts +21 -0
- package/src/util/dom.ts +5 -27
- package/src/util/index.ts +1 -0
- package/src/util/react.tsx +1 -1
- package/dist/lib/browser/chunk-22UMM3QJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YXYQPV6R.mjs.map +0 -7
- package/dist/types/src/components/Popover/CommandMenu.d.ts +0 -34
- package/dist/types/src/components/Popover/CommandMenu.d.ts.map +0 -1
- package/dist/types/src/components/Popover/RefDropdownMenu.d.ts +0 -21
- package/dist/types/src/components/Popover/RefDropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Popover/RefPopover.d.ts +0 -34
- package/dist/types/src/components/Popover/RefPopover.d.ts.map +0 -1
- package/dist/types/src/components/Popover/index.d.ts +0 -4
- package/dist/types/src/components/Popover/index.d.ts.map +0 -1
- package/dist/types/src/extensions/autocomplete.d.ts +0 -13
- package/dist/types/src/extensions/autocomplete.d.ts.map +0 -1
- package/dist/types/src/extensions/command/action.d.ts +0 -17
- package/dist/types/src/extensions/command/action.d.ts.map +0 -1
- package/dist/types/src/extensions/command/command-menu.d.ts +0 -20
- package/dist/types/src/extensions/command/command-menu.d.ts.map +0 -1
- package/dist/types/src/extensions/command/command.d.ts +0 -6
- package/dist/types/src/extensions/command/command.d.ts.map +0 -1
- package/dist/types/src/extensions/command/floating-menu.d.ts +0 -7
- package/dist/types/src/extensions/command/floating-menu.d.ts.map +0 -1
- package/dist/types/src/extensions/command/hint.d.ts +0 -24
- package/dist/types/src/extensions/command/hint.d.ts.map +0 -1
- package/dist/types/src/extensions/command/index.d.ts +0 -7
- package/dist/types/src/extensions/command/index.d.ts.map +0 -1
- package/dist/types/src/extensions/command/placeholder.d.ts +0 -10
- package/dist/types/src/extensions/command/placeholder.d.ts.map +0 -1
- package/dist/types/src/extensions/command/state.d.ts +0 -16
- package/dist/types/src/extensions/command/state.d.ts.map +0 -1
- package/dist/types/src/extensions/command/typeahead.d.ts +0 -22
- package/dist/types/src/extensions/command/typeahead.d.ts.map +0 -1
- package/dist/types/src/extensions/command/useCommandMenu.d.ts +0 -26
- package/dist/types/src/extensions/command/useCommandMenu.d.ts.map +0 -1
- package/dist/types/src/stories/Command.stories.d.ts +0 -7
- package/dist/types/src/stories/Command.stories.d.ts.map +0 -1
- package/dist/types/src/stories/CommandMenu.stories.d.ts +0 -13
- package/dist/types/src/stories/CommandMenu.stories.d.ts.map +0 -1
- package/src/components/Popover/CommandMenu.tsx +0 -279
- package/src/components/Popover/RefDropdownMenu.tsx +0 -85
- package/src/components/Popover/RefPopover.tsx +0 -99
- package/src/components/Popover/index.ts +0 -7
- package/src/extensions/autocomplete.ts +0 -69
- package/src/extensions/command/action.ts +0 -56
- package/src/extensions/command/command-menu.ts +0 -210
- package/src/extensions/command/command.ts +0 -34
- package/src/extensions/command/hint.ts +0 -102
- package/src/extensions/command/index.ts +0 -10
- package/src/extensions/command/state.ts +0 -89
- package/src/extensions/command/useCommandMenu.ts +0 -118
- package/src/stories/Command.stories.tsx +0 -97
- package/src/stories/CommandMenu.stories.tsx +0 -159
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { type
|
|
2
|
+
import { type MarkdownConfig } from '@lezer/markdown';
|
|
3
3
|
export type MarkdownBundleOptions = {
|
|
4
|
-
|
|
4
|
+
extensions?: MarkdownConfig[];
|
|
5
5
|
indentWithTab?: boolean;
|
|
6
|
+
setextHeading?: boolean;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* Creates markdown extensions.
|
|
@@ -13,4 +14,9 @@ export type MarkdownBundleOptions = {
|
|
|
13
14
|
* https://codemirror.net/docs/ref/#codemirror.basicSetup
|
|
14
15
|
*/
|
|
15
16
|
export declare const createMarkdownExtensions: (options?: MarkdownBundleOptions) => Extension[];
|
|
17
|
+
/**
|
|
18
|
+
* Default customizations.
|
|
19
|
+
* https://github.com/lezer-parser/markdown/blob/main/src/markdown.ts
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultExtensions: () => MarkdownConfig[];
|
|
16
22
|
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/bundle.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/bundle.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAS,qBAA0B,KAAG,SAAS,EA2CvF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,cAAc,EAA+B,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { ViewPlugin, type ViewUpdate } from '@codemirror/view';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const adjustChanges: () => ViewPlugin<{
|
|
6
6
|
update(update: ViewUpdate): void;
|
|
7
|
-
}>;
|
|
7
|
+
}, undefined>;
|
|
8
8
|
export declare const createLink: (url: URL, label: string) => string;
|
|
9
9
|
export declare const createLinkLabel: (url: URL) => string;
|
|
10
10
|
//# sourceMappingURL=changes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/changes.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/changes.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjF;;GAEG;AAEH,eAAO,MAAM,aAAa;mBAGL,UAAU;aAqF9B,CAAC;AAMF,eAAO,MAAM,UAAU,GAAI,KAAK,GAAG,EAAE,OAAO,MAAM,KAAG,MAepD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,KAAK,GAAG,KAAG,MAW1C,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type RenderCallback } from '../../types';
|
|
2
|
+
export type NodeData = {
|
|
3
|
+
name: 'Link';
|
|
4
|
+
url: string;
|
|
5
|
+
} | {
|
|
6
|
+
name: 'Image';
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
2
9
|
export interface DecorateOptions {
|
|
3
10
|
/**
|
|
4
11
|
* Prevents triggering decorations as the cursor moves through the document.
|
|
@@ -8,10 +15,11 @@ export interface DecorateOptions {
|
|
|
8
15
|
from: number;
|
|
9
16
|
to?: number;
|
|
10
17
|
};
|
|
18
|
+
listPaddingLeft?: number;
|
|
19
|
+
skip?: (node: NodeData) => boolean;
|
|
11
20
|
renderLinkButton?: RenderCallback<{
|
|
12
21
|
url: string;
|
|
13
22
|
}>;
|
|
14
|
-
listPaddingLeft?: number;
|
|
15
23
|
}
|
|
16
24
|
export declare const decorateMarkdown: (options?: DecorateOptions) => import("@codemirror/state").Extension[];
|
|
17
25
|
//# sourceMappingURL=decorate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/decorate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/decorate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AA2flD,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjD,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IAEnC,gBAAgB,CAAC,EAAE,cAAc,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,gBAAgB,GAAI,UAAS,eAAoB,4CAgE7D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type EditorState, type Extension, type StateCommand } from '@codemirror/state';
|
|
2
2
|
import { EditorView } from '@codemirror/view';
|
|
3
3
|
import { type Live } from '@dxos/live-object';
|
|
4
4
|
import { type EditorToolbarState } from '../../components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAA2B,MAAM,kBAAkB,CAAC;AAKvE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAU3D,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IAGnB,SAAS,EACL,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,GACX,IAAI,CAAC;IAET,UAAU,EAAE,OAAO,CAAC;IAEpB,MAAM,EAAE,OAAO,CAAC;IAEhB,QAAQ,EAAE,OAAO,CAAC;IAElB,aAAa,EAAE,OAAO,CAAC;IAEvB,IAAI,EAAE,OAAO,CAAC;IAEd,IAAI,EAAE,OAAO,CAAC;IAEd,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;CACjD,CAAC,CAAC;AAEH,eAAO,MAAM,gBAAgB,GAAI,GAAG,UAAU,EAAE,GAAG,UAAU,YAQ9B,CAAC;AAEhC,oBAAY,MAAM;IAChB,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,aAAa,IAAI;IACjB,IAAI,IAAI;CACT;AAED,oBAAY,IAAI;IACd,OAAO,IAAA;IACP,MAAM,IAAA;IACN,IAAI,IAAA;CACL;AAMD,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,YAmE1C,CAAC;AAMF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,QAAQ,OAAO,KAAG,YAqKxD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,KAAG,YAAqC,CAAC;AAE/E,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,YAAsC,CAAC;AAEnF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,YAc3C,CAAC;AAEF,eAAO,MAAM,YAAY,cAA6B,CAAC;AACvD,eAAO,MAAM,cAAc,cAA+B,CAAC;AAC3D,eAAO,MAAM,mBAAmB,cAAoC,CAAC;AACrE,eAAO,MAAM,gBAAgB,cAA2B,CAAC;AA0EzD,eAAO,MAAM,WAAW,GAAI,MAAM,UAAU,SAS3C,CAAC;AA4BF,eAAO,MAAM,UAAU,EAAE,YAUxB,CAAC;AAGF,eAAO,MAAM,OAAO,GAAI,iBAAgB;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,KAAG,YA6FhF,CAAC;AAMF,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,KAAG,YAmJpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,YA+DvC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,YAOvC,CAAC;AAqBF,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,KAAG,YAyE/C,CAAC;AAEF,eAAO,MAAM,aAAa,cAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,cAAuB,CAAC;AAErD,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,YA8D1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YA0C7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAE7B,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEnC,eAAO,MAAM,gBAAgB,GAAI,WAAU,iBAAsB,KAAG,SAanE,CAAC;AA4CF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,WAAW,KAAG,UAqKlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAG,SAapE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.test.ts"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"formatting.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.test.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,UAAU,EAehB,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,eAAe,EAAE,UAU7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/highlight.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/highlight.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAmB,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,iBAAiB,CAAC;AAI7D;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAexB,CAAC;AAaF,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAKlD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAAI,WAAU,gBAAqB,mBAsHrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAK/G,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,WAAU,YAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAK/G,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,WAAU,YAAiB,KAAG,SAmCnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/link.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,WAAW,GAAI,eAAe,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/link.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,WAAW,GAAI,eAAe,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;;CAoCzE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
export type EditorInputConfig = {
|
|
3
3
|
type?: string;
|
|
4
|
-
|
|
4
|
+
ignoreEscape?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const editorInputMode: import("@codemirror/state").Facet<EditorInputConfig, EditorInputConfig>;
|
|
7
7
|
export declare const InputModeExtensions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../../src/extensions/modes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../../src/extensions/modes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,yEAA0C,CAAC;AAEvE,eAAO,MAAM,mBAAmB,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAsB5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/menu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAGF,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,SA+GhD,CAAC"}
|
|
@@ -7,5 +7,5 @@ export type OutlinerProps = {};
|
|
|
7
7
|
* - Constrains editor to outline structure.
|
|
8
8
|
* - Supports smart cut-and-paste.
|
|
9
9
|
*/
|
|
10
|
-
export declare const outliner: (
|
|
10
|
+
export declare const outliner: (_options?: OutlinerProps) => Extension;
|
|
11
11
|
//# sourceMappingURL=outliner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outliner.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/outliner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAAoB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"outliner.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/outliner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAAoB,MAAM,mBAAmB,CAAC;AA2BvF,MAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,WAAU,aAAkB,KAAG,SAwBvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/selection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/selection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAIjE,MAAM,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAEjC,eAAO,MAAM,YAAY,GAAI,OAAO,WAAW,KAAG,cAAsC,CAAC;AAEzF,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,YAA2D,CAAC;AAEpH,eAAO,MAAM,cAAc,6BAEzB,CAAC;AAEH,eAAO,MAAM,oBAAoB,aAAoB,CAAC;AAEtD,eAAO,MAAM,UAAU,EAAE,OAMxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OAUvB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,OAEtB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAExB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type EditorState, type Extension } from '@codemirror/state';
|
|
2
2
|
import { Facet } from '@codemirror/state';
|
|
3
3
|
import { type SyntaxNode } from '@lezer/common';
|
|
4
4
|
import { type Range } from '../../types';
|
|
@@ -75,5 +75,5 @@ export type TreeOptions = {};
|
|
|
75
75
|
* This adds overhead relative to the markdown AST, but allows for efficient traversal of the list items.
|
|
76
76
|
* NOTE: Requires markdown parser to be enabled.
|
|
77
77
|
*/
|
|
78
|
-
export declare const outlinerTree: (
|
|
78
|
+
export declare const outlinerTree: (_options?: TreeOptions) => Extension;
|
|
79
79
|
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/tree.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/tree.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAgC,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IACjB;;;OAGG;IACH,YAAY,EAAE,KAAK,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,GAAI,2DAA2D,IAAI,KAAG,GAE5F,CAAC;AAEF;;GAEG;AACH,qBAAa,IAAK,YAAW,IAAI;IAC/B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAU;IAC5B,KAAK,SAAM;IACX,KAAK,SAAM;IACX,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7B,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAM;gBAEpB,IAAI,EAAE,UAAU;IAM5B,MAAM;IAIN,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,SAAS;IAC7E,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,SAAS;IAYzF;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAInC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,UAAO,GAAG,IAAI,GAAG,SAAS;IAgBhD;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;IAQlC;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAGjC;AAED,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,EAAE,MAAM,IAAI,KAAG,CAAC,MAAM,EAAE,MAAM,CAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,GAAG,EAAE,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,KAAG,CAAC,GAAG,SAoB/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,WAAW,EAAE,MAAM,IAAI,KAAG,MAEnE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,EAAE,cAAS,WAerD,CAAC;AAUF,eAAO,MAAM,SAAS,mBAEpB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC;AAE7B;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,WAAU,WAAgB,KAAG,SAuHzD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type EditorView } from '@codemirror/view';
|
|
2
|
+
import React, { type PropsWithChildren } from 'react';
|
|
3
|
+
import { type PopoverMenuGroup, type PopoverMenuItem } from './menu';
|
|
4
|
+
export type PopoverMenuProviderProps = PropsWithChildren<{
|
|
5
|
+
view?: EditorView | null;
|
|
6
|
+
groups: PopoverMenuGroup[];
|
|
7
|
+
currentItem?: string;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
numItems?: number;
|
|
11
|
+
onOpenChange?: (event: {
|
|
12
|
+
view: EditorView;
|
|
13
|
+
open: boolean;
|
|
14
|
+
trigger?: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onActivate?: (event: {
|
|
17
|
+
view: EditorView;
|
|
18
|
+
trigger?: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
onSelect?: (event: {
|
|
21
|
+
view: EditorView;
|
|
22
|
+
item: PopoverMenuItem;
|
|
23
|
+
}) => void;
|
|
24
|
+
onCancel?: (event: {
|
|
25
|
+
view: EditorView;
|
|
26
|
+
}) => void;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Implements the Popover and listens for the `dx-anchor-activate` event from the
|
|
30
|
+
* `popover` extension's decoration.
|
|
31
|
+
*
|
|
32
|
+
* NOTE: We don't use DropdownMenu because the command menu needs to manage focus explicitly.
|
|
33
|
+
* I.e., focus must remain in the editor while displaying the menu (for type-ahead).
|
|
34
|
+
*/
|
|
35
|
+
export declare const PopoverMenuProvider: ({ children, view, groups, currentItem, open: openParam, defaultOpen, numItems, onOpenChange, onActivate, onSelect, onCancel, }: PopoverMenuProviderProps) => React.JSX.Element;
|
|
36
|
+
//# sourceMappingURL=PopoverMenuProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverMenuProvider.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/PopoverMenuProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,EAAY,KAAK,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAc1G,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACvD,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;CAClD,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,gIAYjC,wBAAwB,sBAyF1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAEvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-presets.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/menu-presets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG/C,eAAO,MAAM,kBAAkB,EAAE,gBA6EhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAmC/B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type EditorView } from '@codemirror/view';
|
|
2
|
+
import { type Label } from '@dxos/react-ui';
|
|
3
|
+
import { type MaybePromise } from '@dxos/util';
|
|
4
|
+
export type PopoverMenuGroup = {
|
|
5
|
+
id: string;
|
|
6
|
+
label?: Label;
|
|
7
|
+
items: PopoverMenuItem[];
|
|
8
|
+
};
|
|
9
|
+
export type PopoverMenuItem = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: Label;
|
|
12
|
+
icon?: string;
|
|
13
|
+
onSelect?: (view: EditorView, head: number) => MaybePromise<void>;
|
|
14
|
+
};
|
|
15
|
+
export declare const getMenuItem: (groups: PopoverMenuGroup[], id?: string) => PopoverMenuItem | undefined;
|
|
16
|
+
export declare const getNextMenuItem: (groups: PopoverMenuGroup[], id?: string) => PopoverMenuItem;
|
|
17
|
+
export declare const getPreviousMenuItem: (groups: PopoverMenuGroup[], id?: string) => PopoverMenuItem;
|
|
18
|
+
export declare const createMenuGroup: ({ id, label, items, }: {
|
|
19
|
+
id?: string;
|
|
20
|
+
label?: Label;
|
|
21
|
+
items: string[];
|
|
22
|
+
}) => PopoverMenuGroup;
|
|
23
|
+
export declare const filterMenuGroups: (groups: PopoverMenuGroup[], filter: (item: PopoverMenuItem) => boolean) => PopoverMenuGroup[];
|
|
24
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/menu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAAe,GAAG,SAEvF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAIzE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAI7E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,uBAI7B;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,KAAG,gBAQF,CAAC;AAEH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,KACzC,gBAAgB,EAKlB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StateField } from '@codemirror/state';
|
|
2
|
+
export declare const modalStateEffect: import("@codemirror/state").StateEffectType<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Determines if a modal dialog (e.g., popover) is active.
|
|
5
|
+
*/
|
|
6
|
+
export declare const modalStateField: StateField<boolean>;
|
|
7
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/modal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,sDAAgC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe,qBAY1B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Extension, StateField } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import { type Range } from '../../types';
|
|
4
|
+
import { type PlaceholderOptions } from '../autocomplete';
|
|
5
|
+
export type PopoverOptions = {
|
|
6
|
+
trigger?: string | string[];
|
|
7
|
+
triggerKey?: string;
|
|
8
|
+
placeholder?: Partial<PlaceholderOptions>;
|
|
9
|
+
delimiters?: string[];
|
|
10
|
+
onTextChange?: (event: {
|
|
11
|
+
view: EditorView;
|
|
12
|
+
pos: number;
|
|
13
|
+
text: string;
|
|
14
|
+
trigger?: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onClose?: (event: {
|
|
17
|
+
view: EditorView;
|
|
18
|
+
}) => void;
|
|
19
|
+
onEnter?: (event: {
|
|
20
|
+
view: EditorView;
|
|
21
|
+
}) => void;
|
|
22
|
+
onArrowUp?: (event: {
|
|
23
|
+
view: EditorView;
|
|
24
|
+
}) => void;
|
|
25
|
+
onArrowDown?: (event: {
|
|
26
|
+
view: EditorView;
|
|
27
|
+
}) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates a popover that appears when the trigger character is inserted.
|
|
31
|
+
* This can be used for context menus or autocompletion.
|
|
32
|
+
*/
|
|
33
|
+
export declare const popover: (options?: PopoverOptions) => Extension;
|
|
34
|
+
type PopoverState = {
|
|
35
|
+
/**
|
|
36
|
+
* Trigger prefix (in document).
|
|
37
|
+
*/
|
|
38
|
+
trigger?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Current document completion range.
|
|
41
|
+
*/
|
|
42
|
+
range: Range;
|
|
43
|
+
};
|
|
44
|
+
export declare const popoverRangeEffect: import("@codemirror/state").StateEffectType<PopoverState | null>;
|
|
45
|
+
export declare const popoverStateField: StateField<PopoverState | null>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/popover.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAsC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAGL,UAAU,EAKX,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,iBAAiB,CAAC;AAMvE,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAMtB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAGhD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,SActD,CAAC;AAwMF,KAAK,YAAY,GAAG;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,eAAO,MAAM,kBAAkB,kEAA4C,CAAC;AAG5E,eAAO,MAAM,iBAAiB,iCAY5B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type EditorState } from '@codemirror/state';
|
|
3
|
+
import { type RefObject } from 'react';
|
|
4
|
+
import { type MaybePromise } from '@dxos/util';
|
|
5
|
+
import { type PopoverMenuGroup } from './menu';
|
|
6
|
+
import { type PopoverOptions } from './popover';
|
|
7
|
+
import { type PopoverMenuProviderProps } from './PopoverMenuProvider';
|
|
8
|
+
export type GetMenuContext = {
|
|
9
|
+
state: EditorState;
|
|
10
|
+
pos: number;
|
|
11
|
+
text: string;
|
|
12
|
+
trigger?: string;
|
|
13
|
+
};
|
|
14
|
+
export type UsePopoverMenuProps = {
|
|
15
|
+
filter?: boolean;
|
|
16
|
+
getMenu?: (context: GetMenuContext) => MaybePromise<PopoverMenuGroup[]>;
|
|
17
|
+
} & Pick<PopoverOptions, 'trigger' | 'triggerKey' | 'placeholder'>;
|
|
18
|
+
export type UsePopoverMenu = {
|
|
19
|
+
groupsRef: RefObject<PopoverMenuGroup[]>;
|
|
20
|
+
extension: Extension;
|
|
21
|
+
} & Pick<PopoverMenuProviderProps, 'currentItem' | 'open' | 'onOpenChange' | 'onActivate' | 'onSelect' | 'onCancel'>;
|
|
22
|
+
/**
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { groupsRef, extension, ...menuProps } = usePopoverMenu();
|
|
25
|
+
* const { parentRef, viewRef } = useTextEditor({ extensions: [extension] });
|
|
26
|
+
* return (
|
|
27
|
+
* <PopoverMenuProvider view={viewRef.current} groups={groupsRef.current} {...menuProps}>
|
|
28
|
+
* <div ref={parentRef} />
|
|
29
|
+
* </PopoverMenuProvider>
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const usePopoverMenu: ({ trigger, triggerKey, placeholder, filter, getMenu, }: UsePopoverMenuProps) => UsePopoverMenu;
|
|
34
|
+
//# sourceMappingURL=usePopoverMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePopoverMenu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/usePopoverMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,QAAQ,CAAC;AAGrE,OAAO,EAAE,KAAK,cAAc,EAAkD,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACzE,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,wBAAwB,EAAE,aAAa,GAAG,MAAM,GAAG,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;AAErH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,wDAM5B,mBAAmB,KAAG,cAyHxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type EditorView } from '@codemirror/view';
|
|
2
|
+
export declare const insertAtCursor: (view: EditorView, from: number, insert: string) => void;
|
|
3
|
+
/**
|
|
4
|
+
* If the cursor is at the start of a line, insert the text at the cursor.
|
|
5
|
+
* Otherwise, insert the text on a new line.
|
|
6
|
+
*/
|
|
7
|
+
export declare const insertAtLineStart: (view: EditorView, from: number, insert: string) => void;
|
|
8
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/popover/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,eAAO,MAAM,cAAc,GAAI,MAAM,UAAU,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,SAK5E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,UAAU,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,SAW/E,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '@dxos/lit-ui/dx-ref-tag.pcss';
|
|
2
1
|
import { type EditorState, type Extension } from '@codemirror/state';
|
|
3
2
|
import { type SyntaxNode } from '@lezer/common';
|
|
4
3
|
export type PreviewLinkRef = {
|
|
@@ -12,7 +11,6 @@ export type PreviewLinkTarget = {
|
|
|
12
11
|
text?: string;
|
|
13
12
|
object?: any;
|
|
14
13
|
};
|
|
15
|
-
export type PreviewLookup = (link: PreviewLinkRef) => Promise<PreviewLinkTarget | null | undefined>;
|
|
16
14
|
export type PreviewOptions = {
|
|
17
15
|
addBlockContainer?: (link: PreviewLinkRef, el: HTMLElement) => void;
|
|
18
16
|
removeBlockContainer?: (link: PreviewLinkRef) => void;
|
|
@@ -23,10 +21,8 @@ export type PreviewOptions = {
|
|
|
23
21
|
export declare const preview: (options?: PreviewOptions) => Extension;
|
|
24
22
|
/**
|
|
25
23
|
* Link references.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* ![Label][dxn:echo:123] Block reference
|
|
29
|
-
* ![Label][?dxn:echo:123] Suggestion
|
|
24
|
+
* [Label](dxn:echo:123) Inline reference
|
|
25
|
+
*  Block reference
|
|
30
26
|
*/
|
|
31
27
|
export declare const getLinkRef: (state: EditorState, node: SyntaxNode) => PreviewLinkRef | undefined;
|
|
32
28
|
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/preview/preview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/preview/preview.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAA+B,MAAM,mBAAmB,CAAC;AAElG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IACpE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,SAmBtD,CAAC;AA0DF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,WAAW,EAAE,MAAM,UAAU,KAAG,cAAc,GAAG,SAclF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/extensions/state.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,gDAA2C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type XmlWidgetRegistry } from './xml-tags';
|
|
3
|
+
export type ExtendedMarkdownOptions = {
|
|
4
|
+
registry?: XmlWidgetRegistry;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Extended markdown parser with mixed parser for custom rendering of XML tags.
|
|
8
|
+
*/
|
|
9
|
+
export declare const extendedMarkdown: ({ registry }?: ExtendedMarkdownOptions) => Extension;
|
|
10
|
+
//# sourceMappingURL=extended-markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extended-markdown.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/extended-markdown.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,eAAc,uBAA4B,KAAG,SAiB7E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extended-markdown.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/extended-markdown.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type StreamerOptions = {
|
|
3
|
+
cursor?: boolean;
|
|
4
|
+
fadeIn?: boolean | {
|
|
5
|
+
removalDelay?: number;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Extension that adds a blinking cursor widget at the end of the document.
|
|
10
|
+
*/
|
|
11
|
+
export declare const streamer: (options?: StreamerOptions) => Extension;
|
|
12
|
+
//# sourceMappingURL=streamer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamer.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/streamer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,mBAAmB,CAAC;AAQ5E,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,CAAC,EAAE,OAAO,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAS,eAAoB,KAAG,SAKxD,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { WidgetType } from '@codemirror/view';
|
|
3
|
+
import { type ComponentType, type FC } from 'react';
|
|
4
|
+
export type StateDispatch<T> = T | ((state: T) => T);
|
|
5
|
+
/**
|
|
6
|
+
* Manages widget state.
|
|
7
|
+
*/
|
|
8
|
+
export interface XmlWidgetStateManager {
|
|
9
|
+
updateWidget<T>(id: string, props: StateDispatch<T>): void;
|
|
10
|
+
}
|
|
11
|
+
export type XmlEventHandler<TEvent = any> = (event: TEvent) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Widget component.
|
|
14
|
+
*/
|
|
15
|
+
export type XmlWidgetProps<TContext = any, TProps = any> = TProps & {
|
|
16
|
+
_tag: string;
|
|
17
|
+
context: TContext;
|
|
18
|
+
onEvent?: XmlEventHandler;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Factory for creating widgets.
|
|
22
|
+
*/
|
|
23
|
+
export type XmlWidgetFactory = (props: XmlWidgetProps, onEvent?: XmlEventHandler) => WidgetType | null;
|
|
24
|
+
/**
|
|
25
|
+
* Widget registry definition.
|
|
26
|
+
*/
|
|
27
|
+
export type XmlWidgetDef = {
|
|
28
|
+
block?: boolean;
|
|
29
|
+
/** Native widget. */
|
|
30
|
+
factory?: XmlWidgetFactory;
|
|
31
|
+
/** React widget. */
|
|
32
|
+
Component?: FC<XmlWidgetProps>;
|
|
33
|
+
};
|
|
34
|
+
export type XmlWidgetRegistry = Record<string, XmlWidgetDef>;
|
|
35
|
+
export declare const getXmlTextChild: (children: any[]) => string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Update context.
|
|
38
|
+
*/
|
|
39
|
+
export declare const xmlTagContextEffect: import("@codemirror/state").StateEffectType<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Update widget.
|
|
42
|
+
*/
|
|
43
|
+
export declare const xmlTagUpdateEffect: import("@codemirror/state").StateEffectType<{
|
|
44
|
+
id: string;
|
|
45
|
+
value: any;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Reset all state.
|
|
49
|
+
*/
|
|
50
|
+
export declare const xmlTagResetEffect: import("@codemirror/state").StateEffectType<null>;
|
|
51
|
+
export type XmlWidgetState = {
|
|
52
|
+
id: string;
|
|
53
|
+
props: any;
|
|
54
|
+
root: HTMLElement;
|
|
55
|
+
Component: ComponentType<any>;
|
|
56
|
+
};
|
|
57
|
+
export interface XmlWidgetNotifier {
|
|
58
|
+
mounted(widget: XmlWidgetState): void;
|
|
59
|
+
unmounted(id: string): void;
|
|
60
|
+
}
|
|
61
|
+
export type XmlTagsOptions = {
|
|
62
|
+
registry?: XmlWidgetRegistry;
|
|
63
|
+
/**
|
|
64
|
+
* Called when a widget is mounted or unmounted.
|
|
65
|
+
*/
|
|
66
|
+
setWidgets?: (widgets: XmlWidgetState[]) => void;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Extension that adds thread-related functionality including XML tag decorations.
|
|
70
|
+
*/
|
|
71
|
+
export declare const xmlTags: (options?: XmlTagsOptions) => Extension;
|
|
72
|
+
//# sourceMappingURL=xml-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-tags.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/xml-tags.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA8C,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AASpD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,MAAM,GAAG;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,UAAU,GAAG,IAAI,CAAC;AAEvG;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qBAAqB;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,oBAAoB;IACpB,SAAS,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAE7D,eAAO,MAAM,eAAe,GAAI,UAAU,GAAG,EAAE,KAAG,MAAM,GAAG,IAG1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,kDAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,kBAAkB;QAA4B,MAAM;WAAS,GAAG;EAAK,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,iBAAiB,mDAAuB,CAAC;AAStD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,SA4KtD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EditorState } from '@codemirror/state';
|
|
2
|
+
import { type SyntaxNode } from '@lezer/common';
|
|
3
|
+
export type Tag = Record<string, any> & {
|
|
4
|
+
_tag: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Parse XML Element.
|
|
8
|
+
*/
|
|
9
|
+
export declare const nodeToJson: (state: EditorState, node: SyntaxNode) => Tag | undefined;
|
|
10
|
+
//# sourceMappingURL=xml-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-util.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/tags/xml-util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,WAAW,EAAE,MAAM,UAAU,KAAG,GAAG,GAAG,SA6EvE,CAAC"}
|