@dxos/react-ui-editor 0.10.0 → 0.11.0
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/index.mjs +1477 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/translations.mjs +32 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/types/src/components/Editor/Editor.d.ts +22 -17
- package/dist/types/src/components/Editor/Editor.d.ts.map +1 -1
- package/dist/types/src/components/Editor/EditorContext.d.ts +20 -0
- package/dist/types/src/components/Editor/EditorContext.d.ts.map +1 -0
- package/dist/types/src/components/Editor/EditorView.d.ts +1 -2
- package/dist/types/src/components/Editor/EditorView.d.ts.map +1 -1
- package/dist/types/src/components/Editor/index.d.ts +2 -0
- package/dist/types/src/components/Editor/index.d.ts.map +1 -1
- package/dist/types/src/components/EditorMenuProvider/EditorMenuProvider.d.ts +7 -1
- package/dist/types/src/components/EditorMenuProvider/EditorMenuProvider.d.ts.map +1 -1
- package/dist/types/src/components/EditorMenuProvider/menu.d.ts +4 -2
- package/dist/types/src/components/EditorMenuProvider/menu.d.ts.map +1 -1
- package/dist/types/src/components/EditorMenuProvider/useEditorMenu.d.ts +7 -2
- package/dist/types/src/components/EditorMenuProvider/useEditorMenu.d.ts.map +1 -1
- package/dist/types/src/components/EditorPreviewProvider/EditorPreviewContext.d.ts +18 -0
- package/dist/types/src/components/EditorPreviewProvider/EditorPreviewContext.d.ts.map +1 -0
- package/dist/types/src/components/EditorPreviewProvider/EditorPreviewProvider.d.ts +0 -6
- package/dist/types/src/components/EditorPreviewProvider/EditorPreviewProvider.d.ts.map +1 -1
- package/dist/types/src/components/EditorPreviewProvider/index.d.ts +1 -0
- package/dist/types/src/components/EditorPreviewProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts +4 -1
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/index.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/index.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/lists.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts +27 -2
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/stories/Assistant.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Automerge.stories.d.ts +16 -39
- package/dist/types/src/stories/Automerge.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Blocks.stories.d.ts +10 -0
- package/dist/types/src/stories/Blocks.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Comments.stories.d.ts +53 -14
- package/dist/types/src/stories/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Diff.stories.d.ts +32 -0
- package/dist/types/src/stories/Diff.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Experimental.stories.d.ts +1 -0
- package/dist/types/src/stories/Experimental.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Folding.stories.d.ts +18 -0
- package/dist/types/src/stories/Folding.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Outliner.stories.d.ts +4 -4
- package/dist/types/src/stories/Outliner.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Popover.stories.d.ts +3 -3
- package/dist/types/src/stories/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Suggest.stories.d.ts +27 -0
- package/dist/types/src/stories/Suggest.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TrackChanges.stories.d.ts +44 -0
- package/dist/types/src/stories/TrackChanges.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Widgets.stories.d.ts +12 -0
- package/dist/types/src/stories/Widgets.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/EditorStory.d.ts.map +1 -1
- package/dist/types/src/stories/components/util.d.ts +16 -0
- package/dist/types/src/stories/components/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -83
- package/src/components/Editor/Editor.tsx +142 -35
- package/src/components/Editor/EditorContext.ts +34 -0
- package/src/components/Editor/EditorView.tsx +9 -6
- package/src/components/Editor/index.ts +3 -0
- package/src/components/EditorMenuProvider/EditorMenuProvider.tsx +98 -8
- package/src/components/EditorMenuProvider/menu.ts +4 -2
- package/src/components/EditorMenuProvider/useEditorMenu.ts +114 -29
- package/src/components/EditorPreviewProvider/EditorPreviewContext.ts +21 -0
- package/src/components/EditorPreviewProvider/EditorPreviewProvider.tsx +1 -10
- package/src/components/EditorPreviewProvider/index.ts +2 -0
- package/src/components/EditorToolbar/EditorToolbar.tsx +6 -3
- package/src/components/EditorToolbar/index.ts +1 -0
- package/src/components/EditorToolbar/lists.ts +2 -6
- package/src/components/EditorToolbar/view-mode.ts +41 -12
- package/src/components/index.ts +1 -0
- package/src/index.ts +0 -1
- package/src/{extensions → stories}/Assistant.stories.tsx +7 -2
- package/src/stories/Automerge.stories.tsx +99 -78
- package/src/stories/Blocks.stories.tsx +83 -0
- package/src/stories/Comments.stories.tsx +273 -74
- package/src/stories/Diff.stories.tsx +48 -0
- package/src/stories/EditorToolbar.stories.tsx +2 -2
- package/src/stories/Experimental.stories.tsx +13 -2
- package/src/stories/Folding.stories.tsx +120 -0
- package/src/stories/Markdown.stories.tsx +1 -1
- package/src/stories/Outliner.stories.tsx +18 -7
- package/src/stories/Popover.stories.tsx +27 -5
- package/src/stories/Suggest.stories.tsx +199 -0
- package/src/stories/TrackChanges.stories.tsx +226 -0
- package/src/stories/Widgets.stories.tsx +162 -10
- package/src/stories/components/EditorStory.tsx +15 -6
- package/src/stories/components/util.tsx +40 -2
- package/dist/lib/browser/index.mjs +0 -1676
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/translations.mjs +0 -39
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -1678
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -41
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/types/src/extensions/Assistant.stories.d.ts.map +0 -1
- package/dist/types/src/extensions/assistant-extension.d.ts +0 -24
- package/dist/types/src/extensions/assistant-extension.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/src/extensions/assistant-extension.tsx +0 -223
- package/src/extensions/index.ts +0 -5
- /package/dist/types/src/{extensions → stories}/Assistant.stories.d.ts +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type EditorView } from '@codemirror/view';
|
|
2
|
-
import { Atom } from '@effect-atom/atom
|
|
2
|
+
import { Atom } from '@effect-atom/atom';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { type Node } from '@dxos/app-graph';
|
|
5
5
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
6
6
|
import { type ActionGraphProps, type MenuAction } from '@dxos/react-ui-menu';
|
|
7
7
|
import { type EditorViewMode } from '@dxos/ui-editor/types';
|
|
8
8
|
import { type EditorToolbarState } from './types';
|
|
9
|
+
import { type ViewModeItem } from './view-mode';
|
|
9
10
|
export type EditorToolbarFeatureFlags = Partial<{
|
|
10
11
|
showHeadings: boolean;
|
|
11
12
|
showFormatting: boolean;
|
|
@@ -14,6 +15,8 @@ export type EditorToolbarFeatureFlags = Partial<{
|
|
|
14
15
|
showSearch: boolean;
|
|
15
16
|
onImageUpload: () => void;
|
|
16
17
|
onViewModeChange: (mode: EditorViewMode) => void;
|
|
18
|
+
/** Override the view-mode dropdown entries (default: the three built-in modes). See {@link ViewModeItem}. */
|
|
19
|
+
viewModes: ViewModeItem[];
|
|
17
20
|
}>;
|
|
18
21
|
export type EditorToolbarActionGraphProps = {
|
|
19
22
|
state: Atom.Atom<EditorToolbarState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/EditorToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/EditorToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,KAAK,gBAAgB,EAAQ,KAAK,UAAU,EAA+B,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,aAAa,CAAC;AAO7D,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IAGpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,6GAA6G;IAC7G,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,UAAU,CAAC;IAE1B,aAAa,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC9C;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;CACnE,GAAG,CAAC,6BAA6B,GAAG,yBAAyB,CAAC,CAChE,CAAC;AAEF,eAAO,MAAM,aAAa,qFAAiE,kBAAkB,uBAU3G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AAExB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AAExB,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/lists.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,oBAAoB,EAAyC,MAAM,qBAAqB,CAAC;AAKvG,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQlD,uCAAuC;AACvC,eAAO,MAAM,QAAQ,UACX,kBAAkB,WAAW,MAAM,UAAU,KAAG,
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/lists.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,oBAAoB,EAAyC,MAAM,qBAAqB,CAAC;AAKvG,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQlD,uCAAuC;AACvC,eAAO,MAAM,QAAQ,UACX,kBAAkB,WAAW,MAAM,UAAU,KAAG,oBAgCvD,CAAC"}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { type ActionGroupBuilderFn } from '@dxos/react-ui-menu';
|
|
2
2
|
import { type EditorViewMode } from '@dxos/ui-editor/types';
|
|
3
|
+
import { type Label } from '@dxos/ui-types';
|
|
3
4
|
import { type EditorToolbarState } from './types';
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* One entry in the editor's view-mode dropdown. A built-in entry references an {@link EditorViewMode}
|
|
7
|
+
* by `id` and relies on the defaults (label `view-mode.<id>.label`, checked when it is the active view
|
|
8
|
+
* mode, select via `onViewModeChange`). A contributed entry (e.g. a review "Suggesting" mode) supplies
|
|
9
|
+
* its own `label`, `checked`, and `onSelect` so it can drive state other than the editor view mode.
|
|
10
|
+
*/
|
|
11
|
+
export type ViewModeItem = {
|
|
12
|
+
id: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
label?: Label;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
onSelect?: () => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The built-in view modes: preview (rendered), source (raw edit), readonly (non-editable source). Typed
|
|
20
|
+
* so each `id` is an {@link EditorViewMode}, letting callers pass `item.id` to `onViewModeChange` without a cast.
|
|
21
|
+
*/
|
|
22
|
+
export declare const defaultViewModeItems: Array<ViewModeItem & {
|
|
23
|
+
id: EditorViewMode;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Add view mode actions to the builder. `items` defaults to the three built-in editor view modes;
|
|
27
|
+
* callers pass an extended list to surface contributed modes (see {@link ViewModeItem}) in the same
|
|
28
|
+
* single-select dropdown. The trigger tracks the checked item (via the group's `applyActive`).
|
|
29
|
+
*/
|
|
30
|
+
export declare const addViewMode: (state: EditorToolbarState, onViewModeChange: (mode: EditorViewMode) => void, items?: ViewModeItem[]) => ActionGroupBuilderFn;
|
|
6
31
|
//# sourceMappingURL=view-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/view-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAyC,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/view-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAyC,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,YAAY,GAAG;IAAE,EAAE,EAAE,cAAc,CAAA;CAAE,CAI7E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAEb,kBAAkB,oBACP,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,UACzC,YAAY,EAAE,KACpB,oBA+BF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assistant.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Assistant.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,KAAuC,MAAM,OAAO,CAAC;AAiB5D,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAqC7D,KAAK,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAEhD,QAAA,MAAM,YAAY,UAAW,SAAS,sBAwBrC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CASnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC"}
|
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly 'comment.label': 'Create comment';
|
|
12
|
-
readonly 'image.label': 'Insert image';
|
|
13
|
-
readonly 'search.label': 'Search';
|
|
14
|
-
readonly 'block.label': 'Block';
|
|
15
|
-
readonly 'block.blockquote.label': 'Block quote';
|
|
16
|
-
readonly 'block.codeblock.label': 'Code block';
|
|
17
|
-
readonly 'block.table.label': 'Create table';
|
|
18
|
-
readonly 'formatting.label': 'Formatting';
|
|
19
|
-
readonly 'formatting.strong.label': 'Bold';
|
|
20
|
-
readonly 'formatting.emphasis.label': 'Italics';
|
|
21
|
-
readonly 'formatting.strikethrough.label': 'Strikethrough';
|
|
22
|
-
readonly 'formatting.code.label': 'Code';
|
|
23
|
-
readonly 'formatting.link.label': 'Link';
|
|
24
|
-
readonly 'list.bullet.label': 'Bullet list';
|
|
25
|
-
readonly 'list.ordered.label': 'Numbered list';
|
|
26
|
-
readonly 'list.task.label': 'Task list';
|
|
27
|
-
readonly 'heading.label': 'Heading level';
|
|
28
|
-
readonly 'heading-level.label_zero': 'Paragraph';
|
|
29
|
-
readonly 'heading-level.label_one': 'Heading level {{count}}';
|
|
30
|
-
readonly 'heading-level.label_other': 'Heading level {{count}}';
|
|
31
|
-
readonly 'view-mode.label': 'Editor view';
|
|
32
|
-
readonly 'view-mode.preview.label': 'Markdown';
|
|
33
|
-
readonly 'view-mode.source.label': 'Plain text';
|
|
34
|
-
readonly 'view-mode.readonly.label': 'Read only';
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
}];
|
|
38
|
-
};
|
|
39
|
-
};
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Two editors bound to the same in-process Automerge document (no client or networking). Editing
|
|
5
|
+
* either column mutates the shared handle; the automerge data extension on the other column observes
|
|
6
|
+
* the handle's `change` event and reconciles, so the columns stay in sync. For true cross-peer
|
|
7
|
+
* replication over a transport, see the `WithEcho` story.
|
|
8
|
+
*/
|
|
9
|
+
declare const DefaultStory: () => React.JSX.Element;
|
|
10
|
+
declare const meta: Meta<typeof DefaultStory>;
|
|
40
11
|
export default meta;
|
|
41
12
|
type Story = StoryObj<typeof meta>;
|
|
42
13
|
export declare const Default: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Two in-memory ECHO peers (no real networking, see `withMultiClientProvider`) sharing a
|
|
16
|
+
* document, exercising the `Space.postMessage`/`listen` gossip channel and the CodeMirror
|
|
17
|
+
* `awareness` extension end to end. This covers the same wiring as the (currently skipped,
|
|
18
|
+
* flaky) composer-app e2e collaboration cursor test, deterministically and without a browser.
|
|
19
|
+
*/
|
|
43
20
|
export declare const WithEcho: Story;
|
|
44
21
|
//# sourceMappingURL=Automerge.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Automerge.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAsD5D;;;;;GAKG;AACH,QAAA,MAAM,YAAY,yBAgBjB,CAAC;AA0CF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAQnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,KAoDtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type EditorViewProps } from '../components';
|
|
4
|
+
type StoryArgs = Pick<EditorViewProps, 'value'>;
|
|
5
|
+
declare const DefaultStory: (props: StoryArgs) => React.JSX.Element;
|
|
6
|
+
declare const meta: Meta<typeof DefaultStory>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
//# sourceMappingURL=Blocks.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Blocks.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Blocks.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAkB,MAAM,OAAO,CAAC;AAevC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAM7D,KAAK,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAEhD,QAAA,MAAM,YAAY,UAAW,SAAS,sBAkBrC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAQnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAoBnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1,25 +1,64 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { type Comment } from '@dxos/ui-editor/types';
|
|
4
|
+
type StoryArgs = {
|
|
5
|
+
content?: string;
|
|
6
|
+
comments?: Comment[];
|
|
7
|
+
};
|
|
3
8
|
declare const meta: {
|
|
4
9
|
title: string;
|
|
5
|
-
|
|
6
|
-
debug?: import("./components").DebugMode;
|
|
7
|
-
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
|
-
text?: string;
|
|
9
|
-
object?: import("@dxos/echo/Obj").OfShape<import("@dxos/echo/testing").TestSchema.Expando>;
|
|
10
|
-
readOnly?: boolean;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
lineNumbers?: boolean;
|
|
13
|
-
monospace?: boolean;
|
|
14
|
-
onReady?: (view: import("@codemirror/view").EditorView) => void;
|
|
15
|
-
} & React.RefAttributes<import("..").EditorController>>;
|
|
10
|
+
render: (args: StoryArgs) => React.JSX.Element;
|
|
16
11
|
decorators: import("@storybook/react").Decorator[];
|
|
17
12
|
parameters: {
|
|
18
13
|
layout: string;
|
|
14
|
+
translations: [{
|
|
15
|
+
readonly 'en-US': {
|
|
16
|
+
readonly "@dxos/react-ui-editor": {
|
|
17
|
+
readonly 'comment.label': 'Create comment';
|
|
18
|
+
readonly 'image.label': 'Insert image';
|
|
19
|
+
readonly 'search.label': 'Search';
|
|
20
|
+
readonly 'block.label': 'Block';
|
|
21
|
+
readonly 'block.blockquote.label': 'Block quote';
|
|
22
|
+
readonly 'block.codeblock.label': 'Code block';
|
|
23
|
+
readonly 'block.table.label': 'Create table';
|
|
24
|
+
readonly 'formatting.label': 'Formatting';
|
|
25
|
+
readonly 'formatting.strong.label': 'Bold';
|
|
26
|
+
readonly 'formatting.emphasis.label': 'Italics';
|
|
27
|
+
readonly 'formatting.strikethrough.label': 'Strikethrough';
|
|
28
|
+
readonly 'formatting.code.label': 'Code';
|
|
29
|
+
readonly 'formatting.link.label': 'Link';
|
|
30
|
+
readonly 'list.bullet.label': 'Bullet list';
|
|
31
|
+
readonly 'list.ordered.label': 'Numbered list';
|
|
32
|
+
readonly 'list.task.label': 'Task list';
|
|
33
|
+
readonly 'heading.label': 'Heading level';
|
|
34
|
+
readonly 'heading-level.label_zero': 'Paragraph';
|
|
35
|
+
readonly 'heading-level.label_one': 'Heading level {{count}}';
|
|
36
|
+
readonly 'heading-level.label_other': 'Heading level {{count}}';
|
|
37
|
+
readonly 'view-mode.label': 'Editor view';
|
|
38
|
+
readonly 'view-mode.preview.label': 'Markdown';
|
|
39
|
+
readonly 'view-mode.source.label': 'Plain text';
|
|
40
|
+
readonly 'view-mode.readonly.label': 'Read only';
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}];
|
|
19
44
|
};
|
|
20
45
|
};
|
|
21
46
|
export default meta;
|
|
22
|
-
type Story = StoryObj<
|
|
23
|
-
export declare const
|
|
24
|
-
|
|
47
|
+
type Story = StoryObj<StoryArgs>;
|
|
48
|
+
export declare const Default: Story;
|
|
49
|
+
/**
|
|
50
|
+
* Regression: clicking INSIDE a comment must be detected. The highlight-layer rectangles are drawn over
|
|
51
|
+
* the comment text; if they intercept the click (no `pointer-events: none`), it never reaches
|
|
52
|
+
* `handleCommentClick` and the thread isn't selected. Asserts the clicked comment becomes current.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ClickSelectsComment: Story;
|
|
55
|
+
/**
|
|
56
|
+
* Regression (app repro): a click on a comment often lands on the `.cm-line` (an ANCESTOR of the
|
|
57
|
+
* `.cm-comment` span), because the highlight-layer rectangles sit over the text with
|
|
58
|
+
* `pointer-events: none` and pass the click through to the line. An upward DOM-target walk never finds
|
|
59
|
+
* the span's `data-comment-id`, so `handleCommentClick` must fall back to a `posAtCoords` hit-test.
|
|
60
|
+
* Dispatches the click ON the line element (target = line) at the comment's coordinates and asserts the
|
|
61
|
+
* thread is still selected — this is exactly the "first click ignored" case seen in the app.
|
|
62
|
+
*/
|
|
63
|
+
export declare const ClickThroughLineSelectsComment: Story;
|
|
25
64
|
//# sourceMappingURL=Comments.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Comments.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Comments.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgD,MAAM,OAAO,CAAC;AAyBrE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAUrD,KAAK,SAAS,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AA4KF,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAkBjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,EAAE,KA6B5C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("..").UseTextEditorProps, "extensions" | "id" | "scrollTo" | "selection"> & Pick<import("@dxos/ui-editor").ThemeExtensionsOptions, "slots"> & {
|
|
6
|
+
debug?: import("./components").DebugMode;
|
|
7
|
+
debugCustom?: (view: import("@codemirror/view").EditorView) => React.ReactNode;
|
|
8
|
+
text?: string;
|
|
9
|
+
object?: import("@dxos/echo/Obj").OfShape<import("@dxos/echo/testing").TestSchema.Expando>;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
lineNumbers?: boolean;
|
|
13
|
+
monospace?: boolean;
|
|
14
|
+
onReady?: (view: import("@codemirror/view").EditorView) => void;
|
|
15
|
+
} & React.RefAttributes<import("..").EditorController>>;
|
|
16
|
+
decorators: import("@storybook/react").Decorator[];
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: string;
|
|
19
|
+
controls: {
|
|
20
|
+
disable: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
/**
|
|
27
|
+
* Inline (unified) diff of two markdown versions — what the branch compare view renders. The editor
|
|
28
|
+
* stays editable: typing updates the diff against `original` live (you edit the current branch while
|
|
29
|
+
* viewing the diff to another branch).
|
|
30
|
+
*/
|
|
31
|
+
export declare const Markdown: Story;
|
|
32
|
+
//# sourceMappingURL=Diff.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Diff.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Diff.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAqB1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;QAKN,MAAM;QACN,QAAQ;YAAI,OAAO;;;CAEa,CAAC;eAEtB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Experimental.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Experimental.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Experimental.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Experimental.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;QAKN,MAAM;;CAE0B,CAAC;eAEtB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAQnC,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAMF,eAAO,MAAM,KAAK,EAAE,KAqBnB,CAAC;AAMF,eAAO,MAAM,GAAG,EAAE,KAajB,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stories for turn folding: a chat transcript is treated as a sequence of turns, and each turn's
|
|
3
|
+
* response is a foldable region built on CodeMirror's native folding. The fold ranges are supplied
|
|
4
|
+
* by the story via a `TurnSource` — here, one that scans `<prompt>` boundaries (a user turn is a
|
|
5
|
+
* `<prompt>` element; the response is everything up to the next prompt).
|
|
6
|
+
*/
|
|
7
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
declare const meta: {
|
|
9
|
+
title: string;
|
|
10
|
+
decorators: import("@storybook/react").Decorator[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Default: Story;
|
|
18
|
+
//# sourceMappingURL=Folding.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Folding.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Folding.stories.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgGjE,QAAA,MAAM,IAAI;;;;QAGM,MAAM;;CACN,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
3
|
+
import { EditorStoryProps } from './components';
|
|
4
|
+
type StoryArgs = EditorStoryProps;
|
|
6
5
|
declare const meta: {
|
|
7
6
|
title: string;
|
|
8
|
-
render: (
|
|
7
|
+
render: (props: StoryArgs) => React.JSX.Element;
|
|
9
8
|
decorators: import("@storybook/react").Decorator[];
|
|
10
9
|
parameters: {
|
|
11
10
|
layout: string;
|
|
@@ -14,6 +13,7 @@ declare const meta: {
|
|
|
14
13
|
export default meta;
|
|
15
14
|
type Story = StoryObj<typeof meta>;
|
|
16
15
|
export declare const Empty: Story;
|
|
16
|
+
export declare const Paragraphs: Story;
|
|
17
17
|
export declare const Basic: Story;
|
|
18
18
|
export declare const Nested: Story;
|
|
19
19
|
export declare const Continuation: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Outliner.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Outliner.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Outliner.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Outliner.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAyC,MAAM,OAAO,CAAC;AAQ9D,OAAO,EAAe,gBAAgB,EAAgB,MAAM,cAAc,CAAC;AAE3E,KAAK,SAAS,GAAG,gBAAgB,CAAC;AAmDlC,QAAA,MAAM,IAAI;;oBAjDmB,SAAS;;;QAsDlC,MAAM;;CAE2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAcnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAcpB,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 UseEditorMenuProps } from '../components';
|
|
4
|
-
type StoryArgs = Omit<UseEditorMenuProps, 'viewRef'> & {
|
|
3
|
+
import { type EditorMenuProviderProps, type UseEditorMenuProps } from '../components';
|
|
4
|
+
type StoryArgs = Omit<UseEditorMenuProps, 'viewRef'> & Pick<EditorMenuProviderProps, 'searchPlaceholder'> & {
|
|
5
5
|
text: string;
|
|
6
6
|
};
|
|
7
7
|
declare const meta: {
|
|
8
8
|
title: string;
|
|
9
|
-
render: ({ text, ...props }: StoryArgs) => React.JSX.Element;
|
|
9
|
+
render: ({ text, searchPlaceholder, ...props }: StoryArgs) => React.JSX.Element;
|
|
10
10
|
decorators: import("@storybook/react").Decorator[];
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Popover.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,OAAO,EAKL,KAAK,kBAAkB,EAMxB,MAAM,eAAe,CAAC;AAmBvB,KAAK,SAAS,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Popover.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAMxB,MAAM,eAAe,CAAC;AAmBvB,KAAK,SAAS,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAClD,IAAI,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AA0ExE,QAAA,MAAM,IAAI;;oDAxEmD,SAAS;;;QA6ElE,MAAM;;CAE2B,CAAC;eAEvB,IAAI;AAEnB,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,KAyBlB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type EditorViewProps } from '../components';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
render: (args: EditorViewProps) => React.JSX.Element;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
/** The branch's changes rendered over the parent as accept/reject suggestions. */
|
|
15
|
+
export declare const Default: Story;
|
|
16
|
+
/**
|
|
17
|
+
* Accept applies a change to the document (merging it into the parent); Reject hides a change without
|
|
18
|
+
* altering the document. Deterministic — no AI, so it runs in CI.
|
|
19
|
+
*/
|
|
20
|
+
export declare const AcceptReject: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Two authors reviewing the same base, overlapping on one word. Each change is independently
|
|
23
|
+
* attributable and accepting one re-diffs the rest (the overlapping author's change persists).
|
|
24
|
+
* Deterministic — no AI, so it runs in CI.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MultipleAuthors: Story;
|
|
27
|
+
//# sourceMappingURL=Suggest.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Suggest.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Suggest.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAkBvC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAuF7D,QAAA,MAAM,IAAI;;mBArDY,eAAe;;;QA0DjC,MAAM;;CAEqB,CAAC;eAEjB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,kFAAkF;AAClF,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KA8B1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type EditorViewProps } from '../components';
|
|
4
|
+
type RenderProps = EditorViewProps & {
|
|
5
|
+
branch: string;
|
|
6
|
+
};
|
|
7
|
+
declare const meta: {
|
|
8
|
+
title: string;
|
|
9
|
+
render: ({ branch, ...args }: RenderProps) => React.JSX.Element;
|
|
10
|
+
decorators: import("@storybook/react").Decorator[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
/**
|
|
18
|
+
* Interactive "Suggesting mode" (bind-to-branch): the editor is bound to a branch that starts equal to
|
|
19
|
+
* MAIN, so it opens clean. Type to feel the tracked-change ergonomics:
|
|
20
|
+
*
|
|
21
|
+
* - Type — the added characters appear as an underlined, cyan insertion (character-level, so editing
|
|
22
|
+
* inside a word marks only the changed characters, not the whole word).
|
|
23
|
+
* - Select text and delete it — the removed characters stay visible as a struck-through phantom
|
|
24
|
+
* (`~~old~~`), because they are absent from the branch but present in main.
|
|
25
|
+
* - Replace text — you get both at once, `~~old~~new`, at character granularity.
|
|
26
|
+
* - Move the caret across a phantom with the arrow keys — it is stepped over as one unit.
|
|
27
|
+
* - Press Backspace with the caret just after a phantom — the real branch text behind it is protected
|
|
28
|
+
* (the keystroke is swallowed rather than eating the hidden character).
|
|
29
|
+
*/
|
|
30
|
+
export declare const Default: Story;
|
|
31
|
+
/**
|
|
32
|
+
* A branch that has already diverged from main, so tracked changes render on mount without typing:
|
|
33
|
+
* `swiftly ` inserted after "jumps" and `lazy ` deleted — both clean whole-word edits so the
|
|
34
|
+
* character-level diff yields contiguous hunks. Deterministic — used for the render smoke test.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Divergent: Story;
|
|
37
|
+
/**
|
|
38
|
+
* A foreign author's proposal (Bob: "lazy"→"sleepy") layered over the tester's own live edits. The
|
|
39
|
+
* overlay is diffed against MAIN (not the branch), so after the tester types, their new text is tracked
|
|
40
|
+
* as a self-insertion and is NOT struck by Bob's overlay, while Bob's change still renders. This is the
|
|
41
|
+
* multi-author case the old (diff-vs-document) overlay could not support. Deterministic — runs in CI.
|
|
42
|
+
*/
|
|
43
|
+
export declare const WithForeignAuthor: Story;
|
|
44
|
+
//# sourceMappingURL=TrackChanges.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackChanges.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/TrackChanges.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAevC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAwB7D,KAAK,WAAW,GAAG,eAAe,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAiDxD,QAAA,MAAM,IAAI;;kCA/C2B,WAAW;;;QAoD5C,MAAM;;CAEqB,CAAC;eAEjB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KA2BvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA8D/B,CAAC"}
|
|
@@ -22,4 +22,16 @@ export declare const XmlTags: Story;
|
|
|
22
22
|
* Markdown image/link URLs (echo:/…) trigger block widgets via xmlTags.
|
|
23
23
|
*/
|
|
24
24
|
export declare const Preview: Story;
|
|
25
|
+
/**
|
|
26
|
+
* A fixed-height (400px) `echo:` block embed in a long scrollable document. Sets `estimatedHeight`
|
|
27
|
+
* from the label so CM reserves the right space, matching the plugin-markdown sketch embed. Use this
|
|
28
|
+
* to reproduce scroll behavior: scroll the block off-screen and back, and past the viewport edges.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PreviewScroll: Story;
|
|
31
|
+
/**
|
|
32
|
+
* Same long scrollable document as `PreviewScroll`, but the block renders a Surface-like component
|
|
33
|
+
* (async mount + inner ResizeObserver). Use this to reproduce the scroll jump that only appears with
|
|
34
|
+
* Surface-backed embeds, and to verify fixes against it.
|
|
35
|
+
*/
|
|
36
|
+
export declare const PreviewScrollSurface: Story;
|
|
25
37
|
//# sourceMappingURL=Widgets.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Widgets.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Widgets.stories.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Widgets.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Widgets.stories.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkNjE,QAAA,MAAM,IAAI;;;;QAGM,MAAM;;CACN,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAkBnC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAmBF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAoCrB,CAAC;AAYF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,KA6BlC,CAAC"}
|
|
@@ -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,EAAyE,MAAM,OAAO,CAAC;AAErH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,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,EAAyE,MAAM,OAAO,CAAC;AAErH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,OAAO,EAEL,KAAK,sBAAsB,EAM5B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,aAAa,CAAC;AAGrE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAIpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC,GACrG,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,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC,CAAC;AAEJ,eAAO,MAAM,WAAW;YAXZ,SAAS;kBACH,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;WACtC,MAAM;aACJ,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;eAC7B,OAAO;kBACJ,MAAM;kBACN,OAAO;gBACT,OAAO;cACT,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI;0CAgDvC,CAAC"}
|
|
@@ -4,6 +4,22 @@ import { type EditorSelectionState } from '@dxos/ui-editor';
|
|
|
4
4
|
import { type RenderCallback } from '@dxos/ui-editor/types';
|
|
5
5
|
export declare const num: () => string;
|
|
6
6
|
export declare const img = "";
|
|
7
|
+
export type GenerateListOptions = {
|
|
8
|
+
/** Maximum nesting depth. */
|
|
9
|
+
depth?: number;
|
|
10
|
+
/** Children per node — a fixed count or an inclusive `[min, max]` range. */
|
|
11
|
+
children?: number | [number, number];
|
|
12
|
+
/** Emit task markers (`- [ ]`) rather than plain bullets (`- `). */
|
|
13
|
+
task?: boolean;
|
|
14
|
+
/** Spaces of indentation per level. */
|
|
15
|
+
indent?: number;
|
|
16
|
+
/** Content generator for each item (default: a lorem sentence). */
|
|
17
|
+
content?: () => string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Generates a hierarchical markdown list for the outliner stories. Deterministic under `random.seed`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const generateList: ({ depth, children, task, indent, content, }?: GenerateListOptions) => string;
|
|
7
23
|
export declare const code: string;
|
|
8
24
|
export declare const content: {
|
|
9
25
|
tasks: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/stories/components/util.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EACL,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/stories/components/util.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EACL,KAAK,oBAAoB,EAQ1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAO5D,eAAO,MAAM,GAAG,cAAkE,CAAC;AAEnF,eAAO,MAAM,GAAG,yDAAyD,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,iDAMtB,mBAAmB,KAAQ,MAW7B,CAAC;AAEF,eAAO,MAAM,IAAI,QAQhB,CAAC;AAGF,eAAO,MAAM,OAAO;IAClB,KAAK;IAYL,OAAO;IAYP,QAAQ;IAkBR,UAAU;IAEV,UAAU;IAcV,OAAO;IAYP,KAAK;IAYL,KAAK;IAYL,KAAK;IAEL,QAAQ;IAMR,UAAU;IAQV,WAAW;IAcX,UAAU;IAEV,MAAM;CACP,CAAC;AAGF,eAAO,MAAM,IAAI,QAyBhB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,UAAU,EAM7B,CAAC;AAEF,eAAO,MAAM,KAAK,UAA4E,CAAC;AAK/F,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAQ7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAO5D,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAIxC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,EAOpC,CAAC;AAGF,eAAO,MAAM,QAAQ,QAEN,CAAC;AAEhB,eAAO,MAAM,eAAe,QAGb,CAAC;AAEhB,eAAO,MAAM,QAAQ,QAIpB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAA0C,CAAC"}
|