@dxos/react-ui-editor 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea
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 +4577 -4832
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- 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 +4577 -4832
- 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.map +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Editor/Editor.d.ts +13 -4
- package/dist/types/src/components/Editor/Editor.d.ts.map +1 -1
- package/dist/types/src/components/Editor/Editor.stories.d.ts +27 -0
- package/dist/types/src/components/Editor/Editor.stories.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts +17 -2
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/headings.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/util.d.ts +5 -19
- package/dist/types/src/components/EditorToolbar/util.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/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/cursor.d.ts +1 -1
- package/dist/types/src/extensions/automerge/cursor.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/sync.d.ts +3 -3
- package/dist/types/src/extensions/automerge/sync.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/update-automerge.d.ts +1 -1
- package/dist/types/src/extensions/automerge/update-automerge.d.ts.map +1 -1
- package/dist/types/src/extensions/autoscroll.d.ts +2 -2
- package/dist/types/src/extensions/autoscroll.d.ts.map +1 -1
- package/dist/types/src/extensions/awareness/awareness-provider.d.ts +1 -1
- package/dist/types/src/extensions/awareness/awareness-provider.d.ts.map +1 -1
- package/dist/types/src/extensions/factories.d.ts +9 -4
- package/dist/types/src/extensions/factories.d.ts.map +1 -1
- package/dist/types/src/extensions/index.d.ts +2 -3
- 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/listener.d.ts +8 -6
- package/dist/types/src/extensions/listener.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/bundle.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts +1 -2
- package/dist/types/src/extensions/markdown/formatting.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/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 +6 -3
- 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/hooks/useTextEditor.d.ts +2 -6
- package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
- package/dist/types/src/stories/CommandDialog.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Comments.stories.d.ts +2 -2
- package/dist/types/src/stories/EditorToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Experimental.stories.d.ts +2 -2
- package/dist/types/src/stories/Markdown.stories.d.ts +2 -2
- package/dist/types/src/stories/Outliner.stories.d.ts.map +1 -1
- package/dist/types/src/stories/{CommandMenu.stories.d.ts → Popover.stories.d.ts} +6 -5
- package/dist/types/src/stories/Popover.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Preview.stories.d.ts +2 -2
- package/dist/types/src/stories/Preview.stories.d.ts.map +1 -1
- package/dist/types/src/stories/TextEditor.stories.d.ts +2 -3
- package/dist/types/src/stories/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/EditorStory.d.ts +3 -3
- 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.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -38
- package/src/components/Editor/Editor.stories.tsx +69 -0
- package/src/components/Editor/Editor.tsx +25 -17
- package/src/components/EditorToolbar/EditorToolbar.tsx +88 -87
- package/src/components/EditorToolbar/headings.ts +6 -4
- package/src/components/EditorToolbar/util.ts +2 -18
- package/src/components/index.ts +0 -1
- package/src/extensions/{autocomplete.ts → autocomplete/autocomplete.ts} +1 -0
- package/src/extensions/autocomplete/index.ts +8 -0
- package/src/extensions/autocomplete/match.ts +46 -0
- package/src/extensions/{command-menu → autocomplete}/placeholder.ts +21 -17
- package/src/extensions/{command-dialog → autocomplete}/typeahead.ts +6 -48
- package/src/extensions/automerge/automerge.ts +28 -9
- package/src/extensions/automerge/cursor.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 +3 -3
- package/src/extensions/awareness/awareness-provider.ts +2 -2
- package/src/extensions/factories.ts +18 -10
- package/src/extensions/hashtag.tsx +2 -2
- package/src/extensions/index.ts +2 -3
- package/src/extensions/json.ts +1 -1
- package/src/extensions/listener.ts +14 -20
- package/src/extensions/markdown/bundle.ts +14 -2
- package/src/extensions/markdown/formatting.ts +8 -8
- package/src/extensions/modes.ts +2 -2
- package/src/extensions/{floating-menu.ts → outliner/menu.ts} +7 -5
- package/src/extensions/outliner/outliner.ts +2 -2
- package/src/extensions/popover/PopoverMenuProvider.tsx +220 -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 +289 -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 +10 -7
- package/src/extensions/state.ts +7 -0
- package/src/hooks/useTextEditor.ts +21 -21
- package/src/stories/CommandDialog.stories.tsx +3 -14
- package/src/stories/EditorToolbar.stories.tsx +4 -5
- package/src/stories/Outliner.stories.tsx +16 -9
- package/src/stories/Popover.stories.tsx +163 -0
- package/src/stories/Preview.stories.tsx +15 -8
- package/src/stories/TextEditor.stories.tsx +3 -29
- package/src/stories/components/EditorStory.tsx +5 -3
- package/src/styles/theme.ts +2 -1
- package/src/testing/PreviewPopover.tsx +2 -0
- package/src/types/types.ts +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/CommandMenu/CommandMenu.d.ts +0 -38
- package/dist/types/src/components/CommandMenu/CommandMenu.d.ts.map +0 -1
- package/dist/types/src/components/CommandMenu/index.d.ts +0 -2
- package/dist/types/src/components/CommandMenu/index.d.ts.map +0 -1
- package/dist/types/src/extensions/autocomplete.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/action.d.ts +0 -17
- package/dist/types/src/extensions/command-dialog/action.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/command-dialog.d.ts +0 -6
- package/dist/types/src/extensions/command-dialog/command-dialog.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/hint.d.ts +0 -19
- package/dist/types/src/extensions/command-dialog/hint.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/index.d.ts +0 -4
- package/dist/types/src/extensions/command-dialog/index.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/state.d.ts +0 -16
- package/dist/types/src/extensions/command-dialog/state.d.ts.map +0 -1
- package/dist/types/src/extensions/command-dialog/typeahead.d.ts +0 -22
- package/dist/types/src/extensions/command-dialog/typeahead.d.ts.map +0 -1
- package/dist/types/src/extensions/command-menu/command-menu.d.ts +0 -20
- package/dist/types/src/extensions/command-menu/command-menu.d.ts.map +0 -1
- package/dist/types/src/extensions/command-menu/index.d.ts +0 -3
- package/dist/types/src/extensions/command-menu/index.d.ts.map +0 -1
- package/dist/types/src/extensions/command-menu/placeholder.d.ts +0 -10
- package/dist/types/src/extensions/command-menu/placeholder.d.ts.map +0 -1
- package/dist/types/src/extensions/command-menu/useCommandMenu.d.ts +0 -24
- package/dist/types/src/extensions/command-menu/useCommandMenu.d.ts.map +0 -1
- package/dist/types/src/extensions/floating-menu.d.ts +0 -7
- package/dist/types/src/extensions/floating-menu.d.ts.map +0 -1
- package/dist/types/src/stories/CommandMenu.stories.d.ts.map +0 -1
- package/src/components/CommandMenu/CommandMenu.tsx +0 -348
- package/src/components/CommandMenu/index.ts +0 -5
- package/src/extensions/command-dialog/action.ts +0 -55
- package/src/extensions/command-dialog/command-dialog.ts +0 -34
- package/src/extensions/command-dialog/hint.ts +0 -103
- package/src/extensions/command-dialog/index.ts +0 -7
- package/src/extensions/command-dialog/state.ts +0 -90
- package/src/extensions/command-menu/command-menu.ts +0 -210
- package/src/extensions/command-menu/index.ts +0 -6
- package/src/extensions/command-menu/useCommandMenu.ts +0 -134
- package/src/stories/CommandMenu.stories.tsx +0 -158
- /package/dist/types/src/extensions/{autocomplete.d.ts → autocomplete/autocomplete.d.ts} +0 -0
|
@@ -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;AAoMF,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,7 +1,10 @@
|
|
|
1
1
|
import { type EditorState, type Extension } from '@codemirror/state';
|
|
2
2
|
import { type SyntaxNode } from '@lezer/common';
|
|
3
|
+
export type PreviewBlock = {
|
|
4
|
+
link: PreviewLinkRef;
|
|
5
|
+
el: HTMLElement;
|
|
6
|
+
};
|
|
3
7
|
export type PreviewLinkRef = {
|
|
4
|
-
/** @deprecated */
|
|
5
8
|
suggest?: boolean;
|
|
6
9
|
block?: boolean;
|
|
7
10
|
label: string;
|
|
@@ -13,8 +16,8 @@ export type PreviewLinkTarget = {
|
|
|
13
16
|
object?: any;
|
|
14
17
|
};
|
|
15
18
|
export type PreviewOptions = {
|
|
16
|
-
addBlockContainer?: (
|
|
17
|
-
removeBlockContainer?: (
|
|
19
|
+
addBlockContainer?: (block: PreviewBlock) => void;
|
|
20
|
+
removeBlockContainer?: (block: PreviewBlock) => void;
|
|
18
21
|
};
|
|
19
22
|
/**
|
|
20
23
|
* Create preview decorations.
|
|
@@ -1 +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,EAA+B,MAAM,mBAAmB,CAAC;AAElG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,
|
|
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,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,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAClD,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD,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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type EditorStateConfig, type Text } from '@codemirror/state';
|
|
2
2
|
import { EditorView } from '@codemirror/view';
|
|
3
|
-
import { type
|
|
4
|
-
import { type DependencyList, type KeyboardEventHandler, type RefObject } from 'react';
|
|
3
|
+
import { type ComponentPropsWithoutRef, type DependencyList, type RefObject } from 'react';
|
|
5
4
|
import { type MaybeProvider } from '@dxos/util';
|
|
6
5
|
import { type EditorSelection } from '../extensions';
|
|
7
6
|
export type CursorInfo = {
|
|
@@ -15,10 +14,7 @@ export type CursorInfo = {
|
|
|
15
14
|
export type UseTextEditor = {
|
|
16
15
|
parentRef: RefObject<HTMLDivElement | null>;
|
|
17
16
|
view: EditorView | null;
|
|
18
|
-
focusAttributes?:
|
|
19
|
-
tabIndex: 0;
|
|
20
|
-
onKeyUp: KeyboardEventHandler<HTMLDivElement>;
|
|
21
|
-
};
|
|
17
|
+
focusAttributes?: ComponentPropsWithoutRef<'div'>;
|
|
22
18
|
};
|
|
23
19
|
export type UseTextEditorProps = Pick<EditorStateConfig, 'extensions'> & {
|
|
24
20
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"useTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EAEnB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,KAAK,eAAe,EAA6D,MAAM,eAAe,CAAC;AAKhH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAO,aAAa,CAAC,kBAAkB,CAAM,EAC7C,OAAM,cAAmB,KACxB,aAuHF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/CommandDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CommandDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/CommandDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAuC,MAAM,OAAO,CAAC;AA2D5D,QAAA,MAAM,IAAI;;;;;;;CAOqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { type StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<import("..").ThemeExtensionsOptions, "slots"> & {
|
|
6
6
|
debug?: import("./components").DebugMode;
|
|
7
7
|
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
8
|
text?: string;
|
|
9
|
-
object?: import("@dxos/echo
|
|
9
|
+
object?: import("@dxos/echo/internal").Expando;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
lineNumbers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorToolbar.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EditorToolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AAkBrD,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,UAAU,CAAC;AAIlE,KAAK,UAAU,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorToolbar.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EditorToolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AAkBrD,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,UAAU,CAAC;AAIlE,KAAK,UAAU,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC;AA+ChE,QAAA,MAAM,IAAI;;uDA7CsD,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDrC,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { type StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<import("..").ThemeExtensionsOptions, "slots"> & {
|
|
6
6
|
debug?: import("./components").DebugMode;
|
|
7
7
|
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
8
|
text?: string;
|
|
9
|
-
object?: import("@dxos/echo
|
|
9
|
+
object?: import("@dxos/echo/internal").Expando;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
lineNumbers?: boolean;
|
|
@@ -2,11 +2,11 @@ import { type StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<import("..").ThemeExtensionsOptions, "slots"> & {
|
|
6
6
|
debug?: import("./components").DebugMode;
|
|
7
7
|
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
8
|
text?: string;
|
|
9
|
-
object?: import("@dxos/echo
|
|
9
|
+
object?: import("@dxos/echo/internal").Expando;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
lineNumbers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Outliner.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Outliner.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA0B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Outliner.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Outliner.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA0B,MAAM,OAAO,CAAC;AAkB/C,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAiDF,QAAA,MAAM,IAAI;;uBA/CsB,UAAU;;;;;CAsDL,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAanB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAapB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type
|
|
4
|
-
type StoryProps = Omit<
|
|
3
|
+
import { type UsePopoverMenuProps } from '../extensions';
|
|
4
|
+
type StoryProps = Omit<UsePopoverMenuProps, 'viewRef'> & {
|
|
5
5
|
text: string;
|
|
6
6
|
};
|
|
7
7
|
declare const meta: {
|
|
8
8
|
title: string;
|
|
9
|
-
render: ({ text, ...
|
|
9
|
+
render: ({ text, ...props }: StoryProps) => React.JSX.Element;
|
|
10
10
|
decorators: import("@storybook/react").Decorator[];
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: string;
|
|
@@ -14,6 +14,7 @@ declare const meta: {
|
|
|
14
14
|
};
|
|
15
15
|
export default meta;
|
|
16
16
|
type Story = StoryObj<typeof meta>;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const Default: Story;
|
|
18
|
+
export declare const Formatting: Story;
|
|
18
19
|
export declare const Link: Story;
|
|
19
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=Popover.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Popover.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAIL,KAAK,mBAAmB,EAQzB,MAAM,eAAe,CAAC;AAyBvB,KAAK,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAuD1E,QAAA,MAAM,IAAI;;iCArDgC,UAAU;;;;;CA4Df,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAsBlB,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { type StoryObj } from '@storybook/react-vite';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "
|
|
6
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<import("..").ThemeExtensionsOptions, "slots"> & {
|
|
7
7
|
debug?: import("./components").DebugMode;
|
|
8
8
|
debugCustom?: (view: EditorView) => React.ReactNode;
|
|
9
9
|
text?: string;
|
|
10
|
-
object?: import("@dxos/echo
|
|
10
|
+
object?: import("@dxos/echo/internal").Expando;
|
|
11
11
|
readOnly?: boolean;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
lineNumbers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Preview.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAoD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Preview.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Preview.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AAsKzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;CAO0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAiDrB,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { type StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<import("..").ThemeExtensionsOptions, "slots"> & {
|
|
6
6
|
debug?: import("./components").DebugMode;
|
|
7
7
|
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
8
|
text?: string;
|
|
9
|
-
object?: import("@dxos/echo
|
|
9
|
+
object?: import("@dxos/echo/internal").Expando;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
lineNumbers?: boolean;
|
|
@@ -34,7 +34,6 @@ export declare const Scrolling: Story;
|
|
|
34
34
|
export declare const ScrollingWithImages: Story;
|
|
35
35
|
export declare const ScrollTo: Story;
|
|
36
36
|
export declare const Typescript: Story;
|
|
37
|
-
export declare const Autocomplete: Story;
|
|
38
37
|
export declare const Typeahead: Story;
|
|
39
38
|
export declare const Mention: Story;
|
|
40
39
|
export declare const Search: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/TextEditor.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/TextEditor.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;CAQ0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAMpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,KAExB,CAAC;AAMF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAMF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAMF,eAAO,MAAM,GAAG,EAAE,KAOjB,CAAC;AAMF,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAC;AAMF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAMF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAIjC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAQF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAMF,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAMF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EditorView } from '@codemirror/view';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
|
-
import { Expando } from '@dxos/echo
|
|
3
|
+
import { Expando } from '@dxos/echo/internal';
|
|
4
4
|
import { type ThemeExtensionsOptions } from '../../extensions';
|
|
5
5
|
import { type UseTextEditorProps } from '../../hooks';
|
|
6
6
|
export type DebugMode = 'raw' | 'tree' | 'raw+tree';
|
|
@@ -14,7 +14,7 @@ export type StoryProps = Pick<UseTextEditorProps, 'id' | 'scrollTo' | 'selection
|
|
|
14
14
|
lineNumbers?: boolean;
|
|
15
15
|
onReady?: (view: EditorView) => void;
|
|
16
16
|
};
|
|
17
|
-
export declare const EditorStory: React.ForwardRefExoticComponent<Pick<UseTextEditorProps, "selection" | "
|
|
17
|
+
export declare const EditorStory: React.ForwardRefExoticComponent<Pick<UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<ThemeExtensionsOptions, "slots"> & {
|
|
18
18
|
debug?: DebugMode;
|
|
19
19
|
debugCustom?: (view: EditorView) => ReactNode;
|
|
20
20
|
text?: string;
|
|
@@ -27,7 +27,7 @@ export declare const EditorStory: React.ForwardRefExoticComponent<Pick<UseTextEd
|
|
|
27
27
|
/**
|
|
28
28
|
* Default story component.
|
|
29
29
|
*/
|
|
30
|
-
export declare const EditorComponent: React.ForwardRefExoticComponent<Pick<UseTextEditorProps, "selection" | "
|
|
30
|
+
export declare const EditorComponent: React.ForwardRefExoticComponent<Pick<UseTextEditorProps, "selection" | "scrollTo" | "id" | "extensions"> & Pick<ThemeExtensionsOptions, "slots"> & {
|
|
31
31
|
debug?: DebugMode;
|
|
32
32
|
debugCustom?: (view: EditorView) => ReactNode;
|
|
33
33
|
text?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorStory.d.ts","sourceRoot":"","sources":["../../../../../src/stories/components/EditorStory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorStory.d.ts","sourceRoot":"","sources":["../../../../../src/stories/components/EditorStory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;AAG7G,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAW9C,OAAO,EAEL,KAAK,sBAAsB,EAO5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,aAAa,CAAC;AAGrE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAIpD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC,GAC/F,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC,CAAC;AAEJ,eAAO,MAAM,WAAW;YAVZ,SAAS;kBACH,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;WACtC,MAAM;aACJ,OAAO;eACL,OAAO;kBACJ,MAAM;kBACN,OAAO;cACX,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI;2CAoCvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;YAhDhB,SAAS;kBACH,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;WACtC,MAAM;aACJ,OAAO;eACL,OAAO;kBACJ,MAAM;kBACN,OAAO;cACX,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI;2CA0FvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,YAAY,EAAE,WAgO1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewPopover.d.ts","sourceRoot":"","sources":["../../../../src/testing/PreviewPopover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAA4D,MAAM,OAAO,CAAC;AAKhH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5E,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE7F,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,QAAA,MAAsC,iBAAiB;UAL/C,cAAc;YACZ,iBAAiB;aAChB,OAAO;EAGiG,CAAC;AAEpH,KAAK,0BAA0B,GAAG,iBAAiB,CAAC;IAClD,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"PreviewPopover.d.ts","sourceRoot":"","sources":["../../../../src/testing/PreviewPopover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAA4D,MAAM,OAAO,CAAC;AAKhH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5E,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE7F,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,QAAA,MAAsC,iBAAiB;UAL/C,cAAc;YACZ,iBAAiB;aAChB,OAAO;EAGiG,CAAC;AAEpH,KAAK,0BAA0B,GAAG,iBAAiB,CAAC;IAClD,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC,CAAC;AAGH,QAAA,MAAM,sBAAsB,GAAI,wBAAwB,0BAA0B,sBAgDjF,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;AAErD,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,MAAM,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;AAE7G,eAAO,MAAM,eAAe,4CAA6C,CAAC;AAC1E,eAAO,MAAM,cAAc,4FAAuE,CAAC;AACnG,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvE,eAAO,MAAM,gBAAgB,uCAAwC,CAAC;AACtE,eAAO,MAAM,eAAe,kFAAwE,CAAC;AACrG,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC"}
|