@dxos/ui-editor 0.0.0 → 0.8.4-main.05e74ebcff
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/index.mjs +8657 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/types/index.mjs +33 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8659 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/types/index.mjs +35 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/defaults.d.ts +6 -0
- package/dist/types/src/defaults.d.ts.map +1 -0
- package/dist/types/src/extensions/annotations.d.ts +9 -0
- package/dist/types/src/extensions/annotations.d.ts.map +1 -0
- package/dist/types/src/extensions/autocomplete/autocomplete.d.ts +17 -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 +23 -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 +4 -0
- package/dist/types/src/extensions/automerge/automerge.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/automerge.test.d.ts +2 -0
- package/dist/types/src/extensions/automerge/automerge.test.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/cursor.d.ts +4 -0
- package/dist/types/src/extensions/automerge/cursor.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/defs.d.ts +17 -0
- package/dist/types/src/extensions/automerge/defs.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/index.d.ts +2 -0
- package/dist/types/src/extensions/automerge/index.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/sync.d.ts +17 -0
- package/dist/types/src/extensions/automerge/sync.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/update-automerge.d.ts +6 -0
- package/dist/types/src/extensions/automerge/update-automerge.d.ts.map +1 -0
- package/dist/types/src/extensions/automerge/update-codemirror.d.ts +5 -0
- package/dist/types/src/extensions/automerge/update-codemirror.d.ts.map +1 -0
- package/dist/types/src/extensions/awareness/awareness-provider.d.ts +31 -0
- package/dist/types/src/extensions/awareness/awareness-provider.d.ts.map +1 -0
- package/dist/types/src/extensions/awareness/awareness.d.ts +46 -0
- package/dist/types/src/extensions/awareness/awareness.d.ts.map +1 -0
- package/dist/types/src/extensions/awareness/index.d.ts +3 -0
- package/dist/types/src/extensions/awareness/index.d.ts.map +1 -0
- package/dist/types/src/extensions/blast.d.ts +25 -0
- package/dist/types/src/extensions/blast.d.ts.map +1 -0
- package/dist/types/src/extensions/blocks.d.ts +2 -0
- package/dist/types/src/extensions/blocks.d.ts.map +1 -0
- package/dist/types/src/extensions/bookmarks.d.ts +12 -0
- package/dist/types/src/extensions/bookmarks.d.ts.map +1 -0
- package/dist/types/src/extensions/comments.d.ts +90 -0
- package/dist/types/src/extensions/comments.d.ts.map +1 -0
- package/dist/types/src/extensions/debug.d.ts +3 -0
- package/dist/types/src/extensions/debug.d.ts.map +1 -0
- package/dist/types/src/extensions/dnd.d.ts +9 -0
- package/dist/types/src/extensions/dnd.d.ts.map +1 -0
- package/dist/types/src/extensions/factories.d.ts +88 -0
- package/dist/types/src/extensions/factories.d.ts.map +1 -0
- package/dist/types/src/extensions/factories.test.d.ts +2 -0
- package/dist/types/src/extensions/factories.test.d.ts.map +1 -0
- package/dist/types/src/extensions/focus.d.ts +7 -0
- package/dist/types/src/extensions/focus.d.ts.map +1 -0
- package/dist/types/src/extensions/folding.d.ts +6 -0
- package/dist/types/src/extensions/folding.d.ts.map +1 -0
- package/dist/types/src/extensions/hashtag.d.ts +3 -0
- package/dist/types/src/extensions/hashtag.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +30 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/json.d.ts +7 -0
- package/dist/types/src/extensions/json.d.ts.map +1 -0
- package/dist/types/src/extensions/listener.d.ts +13 -0
- package/dist/types/src/extensions/listener.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/action.d.ts +12 -0
- package/dist/types/src/extensions/markdown/action.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/bundle.d.ts +25 -0
- package/dist/types/src/extensions/markdown/bundle.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/changes.d.ts +10 -0
- package/dist/types/src/extensions/markdown/changes.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/changes.test.d.ts +2 -0
- package/dist/types/src/extensions/markdown/changes.test.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/debug.d.ts +11 -0
- package/dist/types/src/extensions/markdown/debug.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/decorate.d.ts +25 -0
- package/dist/types/src/extensions/markdown/decorate.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/formatting.d.ts +63 -0
- package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/formatting.test.d.ts +3 -0
- package/dist/types/src/extensions/markdown/formatting.test.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/highlight.d.ts +37 -0
- package/dist/types/src/extensions/markdown/highlight.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/image.d.ts +7 -0
- package/dist/types/src/extensions/markdown/image.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/index.d.ts +10 -0
- package/dist/types/src/extensions/markdown/index.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/link.d.ts +7 -0
- package/dist/types/src/extensions/markdown/link.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/parser.test.d.ts +2 -0
- package/dist/types/src/extensions/markdown/parser.test.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/styles.d.ts +4 -0
- package/dist/types/src/extensions/markdown/styles.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/table.d.ts +8 -0
- package/dist/types/src/extensions/markdown/table.d.ts.map +1 -0
- package/dist/types/src/extensions/mention.d.ts +7 -0
- package/dist/types/src/extensions/mention.d.ts.map +1 -0
- package/dist/types/src/extensions/modal.d.ts +7 -0
- package/dist/types/src/extensions/modal.d.ts.map +1 -0
- package/dist/types/src/extensions/modes.d.ts +10 -0
- package/dist/types/src/extensions/modes.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/commands.d.ts +10 -0
- package/dist/types/src/extensions/outliner/commands.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/editor.d.ts +5 -0
- package/dist/types/src/extensions/outliner/editor.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/editor.test.d.ts +2 -0
- package/dist/types/src/extensions/outliner/editor.test.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/index.d.ts +4 -0
- package/dist/types/src/extensions/outliner/index.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/extensions/outliner/outliner.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/outliner.test.d.ts +2 -0
- package/dist/types/src/extensions/outliner/outliner.test.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/selection.d.ts +12 -0
- package/dist/types/src/extensions/outliner/selection.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/tree.d.ts +79 -0
- package/dist/types/src/extensions/outliner/tree.d.ts.map +1 -0
- package/dist/types/src/extensions/outliner/tree.test.d.ts +2 -0
- package/dist/types/src/extensions/outliner/tree.test.d.ts.map +1 -0
- package/dist/types/src/extensions/preview/index.d.ts +2 -0
- package/dist/types/src/extensions/preview/index.d.ts.map +1 -0
- package/dist/types/src/extensions/preview/preview.d.ts +34 -0
- package/dist/types/src/extensions/preview/preview.d.ts.map +1 -0
- package/dist/types/src/extensions/replacer.d.ts +21 -0
- package/dist/types/src/extensions/replacer.d.ts.map +1 -0
- package/dist/types/src/extensions/replacer.test.d.ts +2 -0
- package/dist/types/src/extensions/replacer.test.d.ts.map +1 -0
- package/dist/types/src/extensions/scrolling/auto-scroll.d.ts +18 -0
- package/dist/types/src/extensions/scrolling/auto-scroll.d.ts.map +1 -0
- package/dist/types/src/extensions/scrolling/crawler.d.ts +75 -0
- package/dist/types/src/extensions/scrolling/crawler.d.ts.map +1 -0
- package/dist/types/src/extensions/scrolling/index.d.ts +5 -0
- package/dist/types/src/extensions/scrolling/index.d.ts.map +1 -0
- package/dist/types/src/extensions/scrolling/scroll-past-end.d.ts +3 -0
- package/dist/types/src/extensions/scrolling/scroll-past-end.d.ts.map +1 -0
- package/dist/types/src/extensions/scrolling/scroller.d.ts +16 -0
- package/dist/types/src/extensions/scrolling/scroller.d.ts.map +1 -0
- package/dist/types/src/extensions/selection.d.ts +24 -0
- package/dist/types/src/extensions/selection.d.ts.map +1 -0
- package/dist/types/src/extensions/snippets.d.ts +10 -0
- package/dist/types/src/extensions/snippets.d.ts.map +1 -0
- 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/submit.d.ts +10 -0
- package/dist/types/src/extensions/submit.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/fader.d.ts +12 -0
- package/dist/types/src/extensions/tags/fader.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/index.d.ts +7 -0
- package/dist/types/src/extensions/tags/index.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/typewriter.d.ts +43 -0
- package/dist/types/src/extensions/tags/typewriter.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/typewriter.test.d.ts +2 -0
- package/dist/types/src/extensions/tags/typewriter.test.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-block-decoration.d.ts +31 -0
- package/dist/types/src/extensions/tags/xml-block-decoration.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-formatting.d.ts +24 -0
- package/dist/types/src/extensions/tags/xml-formatting.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-tags.d.ts +117 -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/extensions/tags/xml-util.test.d.ts +2 -0
- package/dist/types/src/extensions/tags/xml-util.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/styles/index.d.ts +2 -0
- package/dist/types/src/styles/index.d.ts.map +1 -0
- package/dist/types/src/styles/theme.d.ts +58 -0
- package/dist/types/src/styles/theme.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +21 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/cursor.d.ts +31 -0
- package/dist/types/src/util/cursor.d.ts.map +1 -0
- package/dist/types/src/util/debug.d.ts +17 -0
- package/dist/types/src/util/debug.d.ts.map +1 -0
- 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 +10 -0
- package/dist/types/src/util/dom.d.ts.map +1 -0
- package/dist/types/src/util/facet.d.ts +3 -0
- package/dist/types/src/util/facet.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +7 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/util.d.ts +8 -0
- package/dist/types/src/util/util.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +43 -44
- package/src/defaults.ts +33 -20
- package/src/extensions/annotations.ts +1 -1
- package/src/extensions/autocomplete/placeholder.ts +37 -18
- package/src/extensions/automerge/automerge.test.tsx +37 -11
- package/src/extensions/automerge/automerge.ts +5 -7
- package/src/extensions/blocks.ts +5 -5
- package/src/extensions/comments.ts +5 -6
- package/src/extensions/dnd.ts +2 -2
- package/src/extensions/factories.test.ts +88 -0
- package/src/extensions/factories.ts +32 -15
- package/src/extensions/folding.ts +5 -22
- package/src/extensions/index.ts +2 -3
- package/src/extensions/markdown/action.ts +0 -1
- package/src/extensions/markdown/bundle.ts +23 -9
- package/src/extensions/markdown/decorate.ts +15 -12
- package/src/extensions/markdown/formatting.ts +5 -10
- package/src/extensions/markdown/highlight.ts +15 -7
- package/src/extensions/markdown/link.ts +27 -33
- package/src/extensions/markdown/parser.test.ts +0 -1
- package/src/extensions/markdown/styles.ts +42 -9
- package/src/extensions/markdown/table.ts +24 -2
- package/src/extensions/outliner/outliner.test.ts +0 -1
- package/src/extensions/outliner/outliner.ts +3 -4
- package/src/extensions/outliner/tree.test.ts +0 -1
- package/src/extensions/preview/preview.ts +62 -15
- package/src/extensions/scrolling/auto-scroll.ts +244 -0
- package/src/extensions/scrolling/crawler.ts +263 -0
- package/src/extensions/scrolling/index.ts +8 -0
- package/src/extensions/scrolling/scroll-past-end.ts +32 -0
- package/src/extensions/scrolling/scroller.ts +27 -0
- package/src/extensions/selection.ts +1 -1
- package/src/extensions/snippets.ts +67 -0
- package/src/extensions/tags/extended-markdown.test.ts +120 -2
- package/src/extensions/tags/extended-markdown.ts +80 -1
- package/src/extensions/tags/fader.ts +195 -0
- package/src/extensions/tags/index.ts +4 -1
- package/src/extensions/tags/testing/text.md +36 -0
- package/src/extensions/tags/testing/text.txt +35 -0
- package/src/extensions/tags/typewriter.test.ts +65 -0
- package/src/extensions/tags/typewriter.ts +594 -0
- package/src/extensions/tags/xml-block-decoration.ts +123 -0
- package/src/extensions/tags/xml-formatting.ts +125 -0
- package/src/extensions/tags/xml-tags.ts +186 -35
- package/src/extensions/tags/xml-util.test.ts +199 -24
- package/src/extensions/tags/xml-util.ts +62 -5
- package/src/index.ts +0 -1
- package/src/styles/index.ts +0 -2
- package/src/styles/theme.ts +125 -33
- package/src/types/types.ts +10 -2
- package/src/typings.d.ts +8 -0
- package/src/util/cursor.ts +1 -2
- package/src/extensions/autoscroll.ts +0 -165
- package/src/extensions/scrolling.ts +0 -189
- package/src/extensions/tags/streamer.ts +0 -243
- package/src/extensions/typewriter.ts +0 -68
- package/src/styles/markdown.ts +0 -26
- package/src/styles/tokens.ts +0 -17
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RenderCallback } from '../../types';
|
|
2
|
+
export declare const linkTooltip: (renderTooltip: RenderCallback<{
|
|
3
|
+
url: string;
|
|
4
|
+
}>) => import("@codemirror/state").Extension & {
|
|
5
|
+
active: import("@codemirror/state").StateField<readonly import("@codemirror/view").Tooltip[]>;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +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,kBAAmB,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;;CA8BzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/parser.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,eAAO,MAAM,gBAAgB,uCA4J3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type TableOptions = {};
|
|
3
|
+
/**
|
|
4
|
+
* GFM tables.
|
|
5
|
+
* https://github.github.com/gfm/#tables-extension
|
|
6
|
+
*/
|
|
7
|
+
export declare const table: (options?: TableOptions) => Extension;
|
|
8
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/table.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,mBAAmB,CAAC;AAQ3B,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,KAAK,aAAa,YAAY,KAAQ,SAMlD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
export type MentionOptions = {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
onSearch: (text: string) => string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const mention: ({ debug, onSearch }: MentionOptions) => Extension;
|
|
7
|
+
//# sourceMappingURL=mention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention.d.ts","sourceRoot":"","sources":["../../../../src/extensions/mention.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;CACtC,CAAC;AAGF,eAAO,MAAM,OAAO,wBAAyB,cAAc,KAAG,SAyB7D,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/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,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type EditorInputConfig = {
|
|
3
|
+
type?: string;
|
|
4
|
+
ignoreEscape?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const editorInputMode: import("@codemirror/state").Facet<EditorInputConfig, EditorInputConfig>;
|
|
7
|
+
export declare const InputModeExtensions: {
|
|
8
|
+
[mode: string]: Extension;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=modes.d.ts.map
|
|
@@ -0,0 +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,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,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type Command } from '@codemirror/view';
|
|
3
|
+
export declare const indentItemMore: Command;
|
|
4
|
+
export declare const indentItemLess: Command;
|
|
5
|
+
export declare const moveItemDown: Command;
|
|
6
|
+
export declare const moveItemUp: Command;
|
|
7
|
+
export declare const deleteItem: Command;
|
|
8
|
+
export declare const toggleTask: Command;
|
|
9
|
+
export declare const commands: () => Extension;
|
|
10
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,kBAAkB,CAAC;AASzE,eAAO,MAAM,cAAc,EAAE,OAa5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAsB5B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,OA6B1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OA6BxB,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,OAiBxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAmBxB,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,SAwGxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/editor.ts"],"names":[],"mappings":"AAsCA;;GAEG;AACH,eAAO,MAAM,MAAM,+CA8IlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/editor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,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,aAAa,WAAW,KAAQ,SA+GhD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type OutlinerProps = {};
|
|
3
|
+
/**
|
|
4
|
+
* Outliner extension.
|
|
5
|
+
* - Stores outline as a standard markdown document with task and list markers.
|
|
6
|
+
* - Supports continuation lines and rich formatting (with Shift+Enter).
|
|
7
|
+
* - Constrains editor to outline structure.
|
|
8
|
+
* - Supports smart cut-and-paste.
|
|
9
|
+
*/
|
|
10
|
+
export declare const outliner: (_options?: OutlinerProps) => Extension;
|
|
11
|
+
//# sourceMappingURL=outliner.d.ts.map
|
|
@@ -0,0 +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;AA0BvF,MAAM,MAAM,aAAa,GAAG,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,cAAc,aAAa,KAAQ,SAwBvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outliner.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/outliner.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Compartment, type EditorState, Facet, type SelectionRange } from '@codemirror/state';
|
|
2
|
+
import { type Command } from '@codemirror/view';
|
|
3
|
+
export type Selection = number[];
|
|
4
|
+
export declare const getSelection: (state: EditorState) => SelectionRange;
|
|
5
|
+
export declare const selectionEquals: (a: number[], b: number[]) => boolean;
|
|
6
|
+
export declare const selectionFacet: Facet<Selection, Selection>;
|
|
7
|
+
export declare const selectionCompartment: Compartment;
|
|
8
|
+
export declare const selectNone: Command;
|
|
9
|
+
export declare const selectAll: Command;
|
|
10
|
+
export declare const selectUp: Command;
|
|
11
|
+
export declare const selectDown: Command;
|
|
12
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +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,EAAE,KAAK,OAAO,EAAmB,MAAM,kBAAkB,CAAC;AAIjE,MAAM,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAEjC,eAAO,MAAM,YAAY,UAAW,WAAW,KAAG,cAAsC,CAAC;AAEzF,eAAO,MAAM,eAAe,MAAO,MAAM,EAAE,KAAK,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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type EditorState, type Extension } from '@codemirror/state';
|
|
2
|
+
import { Facet } from '@codemirror/state';
|
|
3
|
+
import { type SyntaxNode } from '@lezer/common';
|
|
4
|
+
import { type Range } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a single item in the tree.
|
|
7
|
+
*/
|
|
8
|
+
export interface Item {
|
|
9
|
+
type: 'root' | 'bullet' | 'task' | 'unknown';
|
|
10
|
+
index: number;
|
|
11
|
+
level: number;
|
|
12
|
+
node: SyntaxNode;
|
|
13
|
+
parent?: Item;
|
|
14
|
+
nextSibling?: Item;
|
|
15
|
+
prevSibling?: Item;
|
|
16
|
+
children: Item[];
|
|
17
|
+
/**
|
|
18
|
+
* Actual range.
|
|
19
|
+
* Starts at the start of the line containing the item and ends at the end of the line before the
|
|
20
|
+
* first child or next sibling.
|
|
21
|
+
*/
|
|
22
|
+
lineRange: Range;
|
|
23
|
+
/**
|
|
24
|
+
* Range of the editable content.
|
|
25
|
+
* This doesn't include the list or task marker or indentation.
|
|
26
|
+
*/
|
|
27
|
+
contentRange: Range;
|
|
28
|
+
}
|
|
29
|
+
export declare const itemToJSON: ({ type, index, level, lineRange, contentRange, children }: Item) => any;
|
|
30
|
+
/**
|
|
31
|
+
* Tree assumes the entire document is a single contiguous well-formed hierarchy of markdown LiteItem nodes.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Tree implements Item {
|
|
34
|
+
type: Item['type'];
|
|
35
|
+
index: number;
|
|
36
|
+
level: number;
|
|
37
|
+
node: Item['node'];
|
|
38
|
+
lineRange: Item['lineRange'];
|
|
39
|
+
contentRange: Item['contentRange'];
|
|
40
|
+
children: Item['children'];
|
|
41
|
+
constructor(node: SyntaxNode);
|
|
42
|
+
toJSON(): any;
|
|
43
|
+
get root(): Item;
|
|
44
|
+
traverse<T = any>(cb: (item: Item, level: number) => T | void): T | undefined;
|
|
45
|
+
traverse<T = any>(item: Item, cb: (item: Item, level: number) => T | void): T | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Return the closest item.
|
|
48
|
+
*/
|
|
49
|
+
find(pos: number): Item | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Return the first child, next sibling, or parent's next sibling.
|
|
52
|
+
*/
|
|
53
|
+
next(item: Item, enter?: boolean): Item | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Return the previous sibling, or parent.
|
|
56
|
+
*/
|
|
57
|
+
prev(item: Item): Item | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Return the last descendant of the item, or the item itself if it has no children.
|
|
60
|
+
*/
|
|
61
|
+
lastDescendant(item: Item): Item;
|
|
62
|
+
}
|
|
63
|
+
export declare const getRange: (tree: Tree, item: Item) => [number, number];
|
|
64
|
+
/**
|
|
65
|
+
* Traverse the tree, calling the callback for each item.
|
|
66
|
+
* If the callback returns a value, the traversal is stopped and the value is returned.
|
|
67
|
+
*/
|
|
68
|
+
export declare const traverse: <T = any>(root: Item, cb: (item: Item, level: number) => T | void) => T | undefined;
|
|
69
|
+
export declare const getListItemContent: (state: EditorState, item: Item) => string;
|
|
70
|
+
export declare const listItemToString: (item: Item, level?: number) => string;
|
|
71
|
+
export declare const treeFacet: Facet<Tree, Tree>;
|
|
72
|
+
export type TreeOptions = {};
|
|
73
|
+
/**
|
|
74
|
+
* Creates a shadow tree of `ListItem` nodes whenever the document changes.
|
|
75
|
+
* This adds overhead relative to the markdown AST, but allows for efficient traversal of the list items.
|
|
76
|
+
* NOTE: Requires markdown parser to be enabled.
|
|
77
|
+
*/
|
|
78
|
+
export declare const outlinerTree: (_options?: TreeOptions) => Extension;
|
|
79
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8DAA+D,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;IAEhC,YAAY,IAAI,EAAE,UAAU,EAI3B;IAED,MAAM,QAEL;IAED,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,CAAC;IAC9E,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,CAAC;IAY1F;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAElC;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,UAAO,GAAG,IAAI,GAAG,SAAS,CAc/C;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAMjC;IAED;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE/B;CACF;AAED,eAAO,MAAM,QAAQ,SAAU,IAAI,QAAQ,IAAI,KAAG,CAAC,MAAM,EAAE,MAAM,CAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,GAAG,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,KAAG,CAAC,GAAG,SAoB/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,WAAW,QAAQ,IAAI,KAAG,MAEnE,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,IAAI,2BAe1C,CAAC;AAUF,eAAO,MAAM,SAAS,mBAEpB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC;AAE7B;;;;GAIG;AACH,eAAO,MAAM,YAAY,cAAc,WAAW,KAAQ,SAuHzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.test.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/outliner/tree.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/preview/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type EditorState, type Extension } from '@codemirror/state';
|
|
2
|
+
import { type SyntaxNode } from '@lezer/common';
|
|
3
|
+
import { type Database } from '@dxos/echo';
|
|
4
|
+
export type PreviewBlock = {
|
|
5
|
+
link: PreviewLinkRef;
|
|
6
|
+
el: HTMLElement;
|
|
7
|
+
};
|
|
8
|
+
export type PreviewLinkRef = {
|
|
9
|
+
suggest?: boolean;
|
|
10
|
+
block?: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
dxn: string;
|
|
13
|
+
};
|
|
14
|
+
export type PreviewLinkTarget = {
|
|
15
|
+
label: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
object?: any;
|
|
18
|
+
};
|
|
19
|
+
export type PreviewOptions = {
|
|
20
|
+
db?: Database.Database;
|
|
21
|
+
addBlockContainer?: (block: PreviewBlock) => void;
|
|
22
|
+
removeBlockContainer?: (block: PreviewBlock) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Create preview decorations.
|
|
26
|
+
*/
|
|
27
|
+
export declare const preview: (options?: PreviewOptions) => Extension;
|
|
28
|
+
/**
|
|
29
|
+
* Link references.
|
|
30
|
+
* [Label](dxn:echo:123) Inline reference
|
|
31
|
+
*  Block reference
|
|
32
|
+
*/
|
|
33
|
+
export declare const getLinkRef: (state: EditorState, node: SyntaxNode) => PreviewLinkRef | undefined;
|
|
34
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/preview/preview.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,YAAY,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,WAAW,CAAC;CACjB,CAAC;AAEF,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,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAClD,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,OAAO,aAAa,cAAc,KAAQ,SA8BtD,CAAC;AAyFF;;;;GAIG;AACH,eAAO,MAAM,UAAU,UAAW,WAAW,QAAQ,UAAU,KAAG,cAAc,GAAG,SAclF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
type Replacement = {
|
|
3
|
+
input: string;
|
|
4
|
+
output: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Default character replacements for common typography.
|
|
8
|
+
*/
|
|
9
|
+
export declare const defaultReplacements: Replacement[];
|
|
10
|
+
/**
|
|
11
|
+
* Options for the replacer extension.
|
|
12
|
+
*/
|
|
13
|
+
export interface ReplacerOptions {
|
|
14
|
+
replacements?: Replacement[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a CodeMirror extension that automatically replaces typed character sequences.
|
|
18
|
+
*/
|
|
19
|
+
export declare const replacer: ({ replacements }?: ReplacerOptions) => Extension;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=replacer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replacer.d.ts","sourceRoot":"","sources":["../../../../src/extensions/replacer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAe5C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,sBAA4C,eAAe,KAAQ,SAkDvF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replacer.test.d.ts","sourceRoot":"","sources":["../../../../src/extensions/replacer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Enable or disable autoscroll. */
|
|
2
|
+
export declare const autoScrollEffect: import("@codemirror/state").StateEffectType<boolean>;
|
|
3
|
+
export type AutoScrollProps = {
|
|
4
|
+
/**
|
|
5
|
+
* If true, immediately jump to the bottom and re-pin whenever the size of the
|
|
6
|
+
* document view (the scroll container) changes — e.g. when a sidebar toggles
|
|
7
|
+
* or the window is resized. This avoids the visible "stuck near bottom" gap
|
|
8
|
+
* that otherwise appears because the previous `scrollTop` no longer reaches
|
|
9
|
+
* the new content height.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
scrollOnResize?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Extension that supports pinning the scroll position and automatically scrolls to the bottom when content is added.
|
|
16
|
+
*/
|
|
17
|
+
export declare const autoScroll: ({ scrollOnResize }?: AutoScrollProps) => import("@codemirror/state").Extension[];
|
|
18
|
+
//# sourceMappingURL=auto-scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-scroll.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/scrolling/auto-scroll.ts"],"names":[],"mappings":"AAaA,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,sDAAgC,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,wBAA+B,eAAe,4CA8LpE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for the scroll to line effect.
|
|
4
|
+
*/
|
|
5
|
+
export type ScrollToProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Zero-based line number; -1 for end of document.
|
|
8
|
+
* NOTE: view.state.doc.lineAt() uses 1-based line numbers.
|
|
9
|
+
*/
|
|
10
|
+
line: number;
|
|
11
|
+
/**
|
|
12
|
+
* Additional offset from the target line in pixels.
|
|
13
|
+
* Positive values scroll past the line, negative values stop before it.
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
offset?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Position of the target line in the viewport.
|
|
19
|
+
* - 'start': Line appears at the start (top) of the screen
|
|
20
|
+
* - 'end': Line appears at the end (bottom) of the screen
|
|
21
|
+
* @default 'start'
|
|
22
|
+
*/
|
|
23
|
+
position?: 'start' | 'end';
|
|
24
|
+
/**
|
|
25
|
+
* Whether to use smooth scrolling.
|
|
26
|
+
* @default 'instant'
|
|
27
|
+
*/
|
|
28
|
+
behavior?: ScrollBehavior;
|
|
29
|
+
};
|
|
30
|
+
/** Scroll to a specific line. */
|
|
31
|
+
export declare const crawlerLineEffect: import("@codemirror/state").StateEffectType<ScrollToProps>;
|
|
32
|
+
/** Start/stop crawling the end of the document. */
|
|
33
|
+
export declare const crawlerActiveEffect: import("@codemirror/state").StateEffectType<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper function to scroll to a specific line.
|
|
36
|
+
* This is a convenience function that can be used directly with an EditorView.
|
|
37
|
+
*/
|
|
38
|
+
export declare const scrollToLine: (view: EditorView, options: ScrollToProps) => void;
|
|
39
|
+
export type CrawlerOptions = {
|
|
40
|
+
/** Threshold in px to trigger scroll from bottom. */
|
|
41
|
+
overScroll?: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Imperative scroll-control primitive for streaming editor views.
|
|
45
|
+
*
|
|
46
|
+
* Owns the scroll-related effects (`crawlerLineEffect`, `crawlerActiveEffect`), the spring
|
|
47
|
+
* crawler that follows the bottom of the document, and the `.cm-scroller` theme (overflow,
|
|
48
|
+
* scrollbar styling, and the `::after` overscroll spacer).
|
|
49
|
+
*
|
|
50
|
+
* Use directly for jump-to-line navigation, or pair with `autoScroll` for a pin-to-bottom
|
|
51
|
+
* streaming policy. The composite `streamScroll` bundles both for the common case.
|
|
52
|
+
*/
|
|
53
|
+
export declare const crawler: ({ overScroll }?: CrawlerOptions) => import("@codemirror/state").Extension[];
|
|
54
|
+
/**
|
|
55
|
+
* Creates a smooth crawler that follows the live bottom of a CodeMirror 6 EditorView.
|
|
56
|
+
*
|
|
57
|
+
* Uses a critically-damped spring: each frame applies a restoring force toward the
|
|
58
|
+
* target and a damping force opposing current velocity. With damping = 2·ω, the
|
|
59
|
+
* system is critically damped — fastest approach without overshoot. The spring
|
|
60
|
+
* naturally sprints when far behind and eases as it approaches, so streaming
|
|
61
|
+
* content is followed tightly without the jerk of explicit accel/decel state.
|
|
62
|
+
*
|
|
63
|
+
* Integration uses real elapsed wall-clock time so the perceived speed stays
|
|
64
|
+
* constant when requestAnimationFrame is throttled (e.g. low-power mode dropping
|
|
65
|
+
* from 60Hz to 30Hz).
|
|
66
|
+
*
|
|
67
|
+
* @param omega Spring stiffness in rad/s. Higher = snappier follow. ~12–18 feels good.
|
|
68
|
+
* @param snapThreshold Snap-to-target distance threshold in px.
|
|
69
|
+
* @param snapVelocity Snap-to-target velocity threshold in px/s.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createCrawler(view: EditorView, omega?: number, snapThreshold?: number, snapVelocity?: number): {
|
|
72
|
+
scroll: () => void;
|
|
73
|
+
cancel: () => void;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=crawler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crawler.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/scrolling/crawler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAC;AAI1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,iCAAiC;AACjC,eAAO,MAAM,iBAAiB,4DAAsC,CAAC;AAErE,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,sDAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,WAAW,aAAa,SAIpE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,oBAAwB,cAAc,4CA0HzD,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,SAAI,EAAE,aAAa,SAAI,EAAE,YAAY,SAAK;IAiC3F,MAAM;IAON,MAAM;EAST"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/scrolling/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-past-end.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/scrolling/scroll-past-end.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAwBnD,eAAO,MAAM,aAAa,QAAO,SAGhC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type AutoScrollProps } from './auto-scroll';
|
|
3
|
+
import { type CrawlerOptions } from './crawler';
|
|
4
|
+
export type ScrollerOptions = CrawlerOptions & AutoScrollProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Include the auto-scroll policy (pin-to-bottom, user-scroll unpin, scroll-to-bottom button).
|
|
7
|
+
* Set to `false` to get only the crawler primitive (line jumps, theme, overscroll spacer).
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
autoScroll?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Composite scroll extension for streaming editor views (chat threads, transcripts, logs).
|
|
14
|
+
*/
|
|
15
|
+
export declare const scroller: ({ overScroll, scrollOnResize, autoScroll }?: ScrollerOptions) => Extension[];
|
|
16
|
+
//# sourceMappingURL=scroller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroller.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/scrolling/scroller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EAAE,KAAK,eAAe,EAAqC,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,WAAW,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG,cAAc,GAC1C,eAAe,GAAG;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,QAAQ,gDAAuD,eAAe,KAAQ,SAAS,EAE3G,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Extension, type TransactionSpec } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Currently edited document id as FQ string.
|
|
4
|
+
*/
|
|
5
|
+
export declare const documentId: import("@codemirror/state").Facet<string, string>;
|
|
6
|
+
export type EditorSelection = {
|
|
7
|
+
anchor: number;
|
|
8
|
+
head?: number;
|
|
9
|
+
};
|
|
10
|
+
export type EditorSelectionState = {
|
|
11
|
+
scrollTo?: number;
|
|
12
|
+
selection?: EditorSelection;
|
|
13
|
+
};
|
|
14
|
+
export type EditorStateStore = {
|
|
15
|
+
setState: (id: string, state: EditorSelectionState) => void;
|
|
16
|
+
getState: (id: string) => EditorSelectionState | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare const createEditorStateTransaction: ({ scrollTo, selection }: EditorSelectionState) => TransactionSpec;
|
|
19
|
+
export declare const createEditorStateStore: (keyPrefix: string) => EditorStateStore;
|
|
20
|
+
/**
|
|
21
|
+
* Track scrolling and selection state to be restored when switching to document.
|
|
22
|
+
*/
|
|
23
|
+
export declare const selectionState: ({ getState, setState }?: Partial<EditorStateStore>) => Extension;
|
|
24
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/selection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAe,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAStF;;GAEG;AACH,eAAO,MAAM,UAAU,mDAA6B,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC5D,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,oBAAoB,GAAG,SAAS,CAAC;CAC5D,CAAC;AAIF,eAAO,MAAM,4BAA4B,4BAA6B,oBAAoB,KAAG,eAO5F,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAe,MAAM,KAAG,gBAWzD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,4BAA4B,OAAO,CAAC,gBAAgB,CAAC,KAAQ,SAuCvF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type SnippetsOptions = {
|
|
3
|
+
delay?: number;
|
|
4
|
+
items?: string[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Configurable plugin that lets users cycle through pre-configured input snippets.
|
|
8
|
+
*/
|
|
9
|
+
export declare const snippets: ({ delay, items }?: SnippetsOptions) => Extension;
|
|
10
|
+
//# sourceMappingURL=snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../../../../src/extensions/snippets.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,QAAQ,sBAA0C,eAAe,KAAQ,SAgDrF,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
|
+
export type SubmitOptions = {
|
|
3
|
+
fireIfEmpty?: boolean;
|
|
4
|
+
onSubmit?: (text: string) => boolean | void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Handles Enter and Shift-Enter.
|
|
8
|
+
*/
|
|
9
|
+
export declare const submit: ({ fireIfEmpty, onSubmit }?: SubmitOptions) => Extension;
|
|
10
|
+
//# sourceMappingURL=submit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../../src/extensions/submit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAC;AAGzD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,+BAAuC,aAAa,KAAQ,SA8C9E,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;AAKF;;GAEG;AACH,eAAO,MAAM,gBAAgB,kBAAkB,uBAAuB,KAAQ,SAoB7E,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,12 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
export type FaderOptions = {
|
|
3
|
+
/** Time window in ms to coalesce adjacent appends into a single decoration. */
|
|
4
|
+
coalesce?: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Extension that decorates appended text with a fade-in effect.
|
|
8
|
+
* Adjacent appends within the coalesce window are merged into a single decoration.
|
|
9
|
+
* Decorations are queued with an expiry and removed by a timer.
|
|
10
|
+
*/
|
|
11
|
+
export declare const fader: (options?: FaderOptions) => Extension;
|
|
12
|
+
//# sourceMappingURL=fader.d.ts.map
|