@dxos/react-ui-editor 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
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/index.mjs +1125 -1137
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +1145 -1171
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1125 -1137
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/InputMode.stories.d.ts +3 -4
- package/dist/types/src/InputMode.stories.d.ts.map +1 -1
- package/dist/types/src/TextEditor.stories.d.ts +34 -35
- package/dist/types/src/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts +3 -0
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/blocks.d.ts +18 -0
- package/dist/types/src/components/EditorToolbar/blocks.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/comment.d.ts +17 -0
- package/dist/types/src/components/EditorToolbar/comment.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/formatting.d.ts +18 -0
- package/dist/types/src/components/EditorToolbar/formatting.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/headings.d.ts +18 -0
- package/dist/types/src/components/EditorToolbar/headings.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/index.d.ts +3 -0
- package/dist/types/src/components/EditorToolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/lists.d.ts +18 -0
- package/dist/types/src/components/EditorToolbar/lists.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/util.d.ts +58 -0
- package/dist/types/src/components/EditorToolbar/util.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/viewMode.d.ts +18 -0
- package/dist/types/src/components/EditorToolbar/viewMode.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts +5 -6
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/comments.d.ts +3 -4
- package/dist/types/src/extensions/comments.d.ts.map +1 -1
- package/dist/types/src/extensions/factories.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/editorAction.d.ts +12 -0
- package/dist/types/src/extensions/markdown/editorAction.d.ts.map +1 -0
- package/dist/types/src/extensions/markdown/formatting.d.ts +14 -12
- package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/index.d.ts +1 -1
- package/dist/types/src/extensions/markdown/index.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/styles.d.ts.map +1 -1
- package/dist/types/src/hooks/useActionHandler.d.ts +2 -2
- package/dist/types/src/hooks/useActionHandler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/styles/stack-item-content-class-names.d.ts +3 -0
- package/dist/types/src/styles/stack-item-content-class-names.d.ts.map +1 -0
- package/dist/types/src/styles/theme.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -29
- package/src/InputMode.stories.tsx +7 -10
- package/src/components/EditorToolbar/EditorToolbar.tsx +106 -0
- package/src/components/EditorToolbar/blocks.ts +41 -0
- package/src/components/EditorToolbar/comment.ts +23 -0
- package/src/components/EditorToolbar/formatting.ts +41 -0
- package/src/components/EditorToolbar/headings.ts +59 -0
- package/src/components/EditorToolbar/index.ts +6 -0
- package/src/components/EditorToolbar/lists.ts +40 -0
- package/src/components/EditorToolbar/util.ts +65 -0
- package/src/components/EditorToolbar/viewMode.ts +48 -0
- package/src/components/index.ts +1 -1
- package/src/extensions/automerge/automerge.stories.tsx +2 -2
- package/src/extensions/comments.ts +12 -19
- package/src/extensions/factories.ts +11 -5
- package/src/extensions/markdown/decorate.ts +1 -1
- package/src/extensions/markdown/{action.ts → editorAction.ts} +22 -20
- package/src/extensions/markdown/formatting.test.ts +7 -6
- package/src/extensions/markdown/formatting.ts +20 -24
- package/src/extensions/markdown/index.ts +1 -1
- package/src/extensions/markdown/styles.ts +21 -0
- package/src/hooks/useActionHandler.ts +4 -4
- package/src/index.ts +4 -0
- package/src/styles/markdown.ts +1 -1
- package/src/styles/stack-item-content-class-names.ts +17 -0
- package/src/styles/theme.ts +2 -3
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -34
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/extensions/markdown/action.d.ts +0 -9
- package/dist/types/src/extensions/markdown/action.d.ts.map +0 -1
- package/src/components/Toolbar/Toolbar.tsx +0 -522
- package/src/components/Toolbar/index.ts +0 -5
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/comment.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAarE,eAAO,MAAM,aAAa,UAAW,kBAAkB;;;;;;;;;;;;;;CAGrD,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { type NodeArg } from '@dxos/app-graph';
|
2
|
+
import { type EditorToolbarState } from './util';
|
3
|
+
export declare const createFormatting: (state: EditorToolbarState) => {
|
4
|
+
nodes: (Readonly<Omit<Readonly<{
|
5
|
+
id: string;
|
6
|
+
type: string;
|
7
|
+
cacheable?: string[];
|
8
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
9
|
+
data: import("@dxos/app-graph").ActionData;
|
10
|
+
}>, "properties"> & {
|
11
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
12
|
+
}> | NodeArg<any>)[];
|
13
|
+
edges: {
|
14
|
+
source: string;
|
15
|
+
target: string;
|
16
|
+
}[];
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=formatting.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/formatting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAuB9F,eAAO,MAAM,gBAAgB,UAAW,kBAAkB;;;;;;;;;;;;;;CAUzD,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { type NodeArg } from '@dxos/app-graph';
|
2
|
+
import { type EditorToolbarState } from './util';
|
3
|
+
export declare const createHeadings: (state: EditorToolbarState) => {
|
4
|
+
nodes: (Readonly<Omit<Readonly<{
|
5
|
+
id: string;
|
6
|
+
type: string;
|
7
|
+
cacheable?: string[];
|
8
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
9
|
+
data: import("@dxos/app-graph").ActionData;
|
10
|
+
}>, "properties"> & {
|
11
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
12
|
+
}> | NodeArg<any>)[];
|
13
|
+
edges: {
|
14
|
+
source: string;
|
15
|
+
target: string;
|
16
|
+
}[];
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=headings.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"headings.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/headings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAwC9F,eAAO,MAAM,cAAc,UAAW,kBAAkB;;;;;;;;;;;;;;CAWvD,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,KAAK,kBAAkB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { type NodeArg } from '@dxos/app-graph';
|
2
|
+
import { type EditorToolbarState } from './util';
|
3
|
+
export declare const createLists: (state: EditorToolbarState) => {
|
4
|
+
nodes: (Readonly<Omit<Readonly<{
|
5
|
+
id: string;
|
6
|
+
type: string;
|
7
|
+
cacheable?: string[];
|
8
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
9
|
+
data: import("@dxos/app-graph").ActionData;
|
10
|
+
}>, "properties"> & {
|
11
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
12
|
+
}> | NodeArg<any>)[];
|
13
|
+
edges: {
|
14
|
+
source: string;
|
15
|
+
target: string;
|
16
|
+
}[];
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=lists.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/lists.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAqB9F,eAAO,MAAM,WAAW,UAAW,kBAAkB;;;;;;;;;;;;;;CAWpD,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { type ReactiveObject } from '@dxos/live-object';
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
3
|
+
import { type MenuSeparator, type MenuItemGroup, type ToolbarMenuActionGroupProperties, type MenuActionProperties, type ActionGraphProps } from '@dxos/react-ui-menu';
|
4
|
+
import type { EditorAction, EditorActionPayload, EditorViewMode, Formatting } from '../../extensions';
|
5
|
+
export type EditorToolbarState = Formatting & Partial<{
|
6
|
+
comment: boolean;
|
7
|
+
viewMode: EditorViewMode;
|
8
|
+
selection: boolean;
|
9
|
+
}>;
|
10
|
+
export declare const useEditorToolbarState: (initialState?: Partial<EditorToolbarState>) => ReactiveObject<EditorToolbarState>;
|
11
|
+
export type EditorToolbarFeatureFlags = Partial<{
|
12
|
+
headings: boolean;
|
13
|
+
formatting: boolean;
|
14
|
+
lists: boolean;
|
15
|
+
blocks: boolean;
|
16
|
+
comment: boolean;
|
17
|
+
search: boolean;
|
18
|
+
viewMode: boolean;
|
19
|
+
}>;
|
20
|
+
export type EditorToolbarActionGraphProps = {
|
21
|
+
state: ReactiveObject<EditorToolbarState>;
|
22
|
+
customActions?: () => ActionGraphProps;
|
23
|
+
onAction: (action: EditorAction) => void;
|
24
|
+
};
|
25
|
+
export type EditorToolbarProps = ThemedClassName<EditorToolbarActionGraphProps & EditorToolbarFeatureFlags & {
|
26
|
+
attendableId?: string;
|
27
|
+
role?: string;
|
28
|
+
}>;
|
29
|
+
export type EditorToolbarItem = EditorAction | MenuItemGroup | MenuSeparator;
|
30
|
+
export declare const createEditorAction: (payload: EditorActionPayload & Partial<MenuActionProperties>, icon: string, label?: Label, id?: string) => EditorAction;
|
31
|
+
export declare const createEditorActionGroup: (id: string, props: Omit<ToolbarMenuActionGroupProperties, "icon">, icon?: string) => {
|
32
|
+
id: string;
|
33
|
+
type: string;
|
34
|
+
properties: {
|
35
|
+
label: Label;
|
36
|
+
value: string | (string & string[]);
|
37
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
38
|
+
hidden?: boolean | undefined;
|
39
|
+
disabled?: boolean | undefined;
|
40
|
+
checked?: boolean | undefined;
|
41
|
+
variant: "dropdownMenu" | "toggleGroup";
|
42
|
+
iconOnly: boolean;
|
43
|
+
testId?: string | undefined;
|
44
|
+
selectCardinality: "single" | "multiple";
|
45
|
+
icon: string | undefined;
|
46
|
+
};
|
47
|
+
data: typeof import("@dxos/app-graph").actionGroupSymbol;
|
48
|
+
};
|
49
|
+
export declare const editorToolbarSearch: Readonly<Omit<Readonly<{
|
50
|
+
id: string;
|
51
|
+
type: string;
|
52
|
+
cacheable?: string[];
|
53
|
+
properties: Readonly<MenuActionProperties & EditorActionPayload>;
|
54
|
+
data: import("@dxos/app-graph").ActionData;
|
55
|
+
}>, "properties"> & {
|
56
|
+
properties: Readonly<MenuActionProperties & EditorActionPayload>;
|
57
|
+
}>;
|
58
|
+
//# sourceMappingURL=util.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/util.ts"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gCAAgC,EACrC,KAAK,oBAAoB,EAGzB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGtG,MAAM,MAAM,kBAAkB,GAAG,UAAU,GACzC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE9E,eAAO,MAAM,qBAAqB,kBAAkB,OAAO,CAAC,kBAAkB,CAAC,uCAE9E,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAE1C,aAAa,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACvC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC9C,6BAA6B,GAAG,yBAAyB,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CACrG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;AAE7E,eAAO,MAAM,kBAAkB,YACpB,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,QACtD,MAAM,UACL,KAAK,OACR,MAAM,KAC8C,YAAY,CAAC;AAEvE,eAAO,MAAM,uBAAuB,OAC9B,MAAM,SACH,IAAI,CAAC,gCAAgC,EAAE,MAAM,CAAC,SAC9C,MAAM;;;;;;;;;;;;;;;;;CACiD,CAAC;AAEjE,eAAO,MAAM,mBAAmB;;;;;;;;EAA0E,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { type NodeArg } from '@dxos/app-graph';
|
2
|
+
import { type EditorToolbarState } from './util';
|
3
|
+
export declare const createViewMode: (state: EditorToolbarState) => {
|
4
|
+
nodes: (Readonly<Omit<Readonly<{
|
5
|
+
id: string;
|
6
|
+
type: string;
|
7
|
+
cacheable?: string[];
|
8
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
9
|
+
data: import("@dxos/app-graph").ActionData;
|
10
|
+
}>, "properties"> & {
|
11
|
+
properties: Readonly<import("@dxos/react-ui-menu").MenuActionProperties & import("../..").EditorActionPayload>;
|
12
|
+
}> | NodeArg<any>)[];
|
13
|
+
edges: {
|
14
|
+
source: string;
|
15
|
+
target: string;
|
16
|
+
}[];
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=viewMode.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewMode.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/viewMode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AA6B9F,eAAO,MAAM,cAAc,UAAW,kBAAkB;;;;;;;;;;;;;;CAWvD,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './EditorToolbar';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import '@dxos-theme';
|
2
2
|
import '@preact/signals-react';
|
3
|
-
import React from 'react';
|
4
3
|
import { DocAccessor, type Space } from '@dxos/react-client/echo';
|
5
4
|
import { type Identity } from '@dxos/react-client/halo';
|
6
5
|
type EditorProps = {
|
@@ -11,9 +10,9 @@ type EditorProps = {
|
|
11
10
|
};
|
12
11
|
declare const _default: {
|
13
12
|
title: string;
|
14
|
-
component: ({ source, autoFocus, space, identity }: EditorProps) =>
|
15
|
-
decorators: import("@storybook/react
|
16
|
-
render: () =>
|
13
|
+
component: ({ source, autoFocus, space, identity }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
14
|
+
decorators: import("@storybook/react").Decorator[];
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
17
16
|
parameters: {
|
18
17
|
translations: {
|
19
18
|
'en-US': {
|
@@ -50,7 +49,7 @@ declare const _default: {
|
|
50
49
|
export default _default;
|
51
50
|
export declare const Default: {};
|
52
51
|
export declare const WithEcho: {
|
53
|
-
decorators: import("@storybook/react
|
54
|
-
render: () =>
|
52
|
+
decorators: import("@storybook/react").Decorator[];
|
53
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
55
54
|
};
|
56
55
|
//# sourceMappingURL=automerge.stories.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,uBAAuB,CAAC;AAM/B,OAAO,EACL,WAAW,EAMX,KAAK,KAAK,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAgBrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;;;wDAEsD,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDnE,wBAME;AAsBF,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,eAAO,MAAM,QAAQ;;;CAmBpB,CAAC"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { type Extension, StateField, type EditorState } from '@codemirror/state';
|
2
2
|
import { type Command, EditorView, type Rect } from '@codemirror/view';
|
3
3
|
import { type UnsubscribeCallback } from '@dxos/async';
|
4
|
+
import { type ReactiveObject } from '@dxos/live-object';
|
5
|
+
import { type EditorToolbarState } from '../components';
|
4
6
|
import { type Comment, type Range } from '../types';
|
5
7
|
type CommentState = {
|
6
8
|
comment: Comment;
|
@@ -87,10 +89,7 @@ export declare const scrollThreadIntoView: (view: EditorView, id: string, center
|
|
87
89
|
*/
|
88
90
|
export declare const selectionOverlapsComment: (state: EditorState) => boolean;
|
89
91
|
export declare const createExternalCommentSync: (id: string, subscribe: (sink: () => void) => UnsubscribeCallback, getComments: () => Comment[]) => Extension;
|
90
|
-
export declare const useCommentState: () =>
|
91
|
-
comment: boolean;
|
92
|
-
selection: boolean;
|
93
|
-
}, Extension];
|
92
|
+
export declare const useCommentState: (state: ReactiveObject<EditorToolbarState>) => Extension;
|
94
93
|
/**
|
95
94
|
* @deprecated This hook will be removed in future versions. Use the new comment sync extension instead.
|
96
95
|
* Update comments state field.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../src/extensions/comments.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,SAAS,EAEd,UAAU,EAGV,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,KAAK,OAAO,EAEZ,UAAU,EACV,KAAK,IAAI,EAGV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../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AAM,CAAC;CAClB,CAAC;AAsBF,eAAO,MAAM,qBAAqB,YAAa,sBAAsB,KAAG,SA8CvE,CAAC;AAMF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE;YACP,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;CACH,CAAC;AAQF;;GAEG;AACH,eAAO,MAAM,qBAAqB,oFAK/B,sBAAsB,KAAQ,SAWhC,CAAC;AAMF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAAI,CAAC,iCAAiC,mBAAmB,CAAC,CAAC,CAAC,KAAG,SAAS,EA2BxG,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { type EditorView } from '@codemirror/view';
|
2
|
+
import { type Action } from '@dxos/app-graph';
|
3
|
+
import { type MenuActionProperties } from '@dxos/react-ui-menu';
|
4
|
+
export type PayloadType = 'view-mode' | 'blockquote' | 'strong' | 'codeblock' | 'comment' | 'heading' | 'image' | 'emphasis' | 'code' | 'link' | 'list-bullet' | 'list-ordered' | 'list-task' | 'mention' | 'prompt' | 'search' | 'strikethrough' | 'table';
|
5
|
+
export type EditorActionPayload = {
|
6
|
+
type: PayloadType;
|
7
|
+
data?: any;
|
8
|
+
};
|
9
|
+
export type EditorAction = Action<MenuActionProperties & EditorActionPayload>;
|
10
|
+
export type EditorPayloadHandler = (view: EditorView, payload: EditorActionPayload) => void;
|
11
|
+
export declare const processEditorPayload: EditorPayloadHandler;
|
12
|
+
//# sourceMappingURL=editorAction.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editorAction.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/editorAction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAsBhE,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,SAAS,GACT,SAAS,GACT,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,aAAa,GACb,cAAc,GACd,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,OAAO,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,CAAC;AAE9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAE5F,eAAO,MAAM,oBAAoB,EAAE,oBAyDlC,CAAC"}
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import { type Extension, type StateCommand, type EditorState } from '@codemirror/state';
|
2
2
|
import { EditorView } from '@codemirror/view';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
import { type ReactiveObject } from '@dxos/live-object';
|
4
|
+
import { type EditorToolbarState } from '../../components';
|
5
|
+
export type Formatting = Partial<{
|
6
|
+
blankLine: boolean;
|
7
|
+
blockType: 'codeblock' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'tablecell' | null;
|
8
|
+
blockQuote: boolean;
|
9
|
+
strong: boolean;
|
10
|
+
emphasis: boolean;
|
11
|
+
strikethrough: boolean;
|
12
|
+
code: boolean;
|
13
|
+
link: boolean;
|
14
|
+
listStyle: null | 'ordered' | 'bullet' | 'task';
|
15
|
+
}>;
|
14
16
|
export declare const formattingEquals: (a: Formatting, b: Formatting) => boolean;
|
15
17
|
export declare enum Inline {
|
16
18
|
Strong = 0,
|
@@ -57,5 +59,5 @@ export declare const getFormatting: (state: EditorState) => Formatting;
|
|
57
59
|
/**
|
58
60
|
* Hook provides an extension to compute the current formatting state.
|
59
61
|
*/
|
60
|
-
export declare const useFormattingState: () =>
|
62
|
+
export declare const useFormattingState: (state: ReactiveObject<EditorToolbarState>) => Extension;
|
61
63
|
//# sourceMappingURL=formatting.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,WAAW,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAU,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,WAAW,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAU,MAAM,kBAAkB,CAAC;AAItD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC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,MAAM,WAAW,SAAU,UAAU,SAS3C,CAAC;AA4BF,eAAO,MAAM,UAAU,EAAE,YAUxB,CAAC;AAGF,eAAO,MAAM,OAAO,oBAAoB;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,KAAQ,YA6FhF,CAAC;AAMF,eAAO,MAAM,OAAO,SAAU,IAAI,KAAG,YAmJpC,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,YA+DvC,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,YAOvC,CAAC;AAqBF,eAAO,MAAM,aAAa,WAAY,OAAO,KAAG,YAyE/C,CAAC;AAEF,eAAO,MAAM,aAAa,cAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,cAAuB,CAAC;AAErD,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,YA8D1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YA0C7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAE7B,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEnC,eAAO,MAAM,gBAAgB,cAAc,iBAAiB,KAAQ,SAanE,CAAC;AA4CF;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,WAAW,KAAG,UAqKlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAW,cAAc,CAAC,kBAAkB,CAAC,KAAG,SAY9E,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
@@ -1 +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,
|
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,uCA0H3B,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { type EditorView } from '@codemirror/view';
|
2
|
-
import { type
|
3
|
-
export declare const useActionHandler: (view?: EditorView | null) =>
|
2
|
+
import { type EditorAction } from '../extensions';
|
3
|
+
export declare const useActionHandler: (view?: EditorView | null) => (action: EditorAction) => void | null | undefined;
|
4
4
|
//# sourceMappingURL=useActionHandler.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useActionHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useActionHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"useActionHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useActionHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,eAAe,CAAC;AAExE,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,IAAI,cAC3B,YAAY,4BACzC,CAAC"}
|
@@ -7,6 +7,7 @@ export * from './components';
|
|
7
7
|
export * from './defaults';
|
8
8
|
export * from './extensions';
|
9
9
|
export * from './hooks';
|
10
|
+
export { stackItemContentEditorClassNames, stackItemContentToolbarClassNames, } from './styles/stack-item-content-class-names';
|
10
11
|
export * from './types';
|
11
12
|
export * from './util';
|
12
13
|
export { translations };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,yCAAyC,CAAC;AACjD,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stack-item-content-class-names.d.ts","sourceRoot":"","sources":["../../../../src/styles/stack-item-content-class-names.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gCAAgC,UAAW,MAAM,WAI3D,CAAC;AAEJ,eAAO,MAAM,iCAAiC,UAAW,MAAM,WAI5D,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,WA8M1B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":"5.7.
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dxos/react-ui-editor",
|
3
|
-
"version": "0.7.5-main.
|
3
|
+
"version": "0.7.5-main.b19bfc8",
|
4
4
|
"description": "Document editing experience within a DXOS shell.",
|
5
5
|
"homepage": "https://dxos.org",
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
7
7
|
"license": "MIT",
|
8
8
|
"author": "DXOS.org",
|
9
9
|
"sideEffects": true,
|
10
|
+
"type": "module",
|
10
11
|
"exports": {
|
11
12
|
".": {
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
@@ -34,12 +35,13 @@
|
|
34
35
|
"@codemirror/state": "^6.4.1",
|
35
36
|
"@codemirror/theme-one-dark": "^6.1.2",
|
36
37
|
"@codemirror/view": "^6.34.1",
|
37
|
-
"@fluentui/react-tabster": "
|
38
|
+
"@fluentui/react-tabster": "9.23.3",
|
38
39
|
"@lezer/common": "^1.2.2",
|
39
40
|
"@lezer/generator": "^1.7.1",
|
40
41
|
"@lezer/highlight": "^1.2.1",
|
41
42
|
"@lezer/markdown": "^1.3.1",
|
42
|
-
"@
|
43
|
+
"@preact/signals-react": "^1.3.8",
|
44
|
+
"@radix-ui/react-context": "1.1.1",
|
43
45
|
"@replit/codemirror-vim": "^6.2.1",
|
44
46
|
"@replit/codemirror-vscode-keymap": "^6.0.2",
|
45
47
|
"codemirror": "^6.0.1",
|
@@ -48,24 +50,24 @@
|
|
48
50
|
"lodash.get": "^4.4.2",
|
49
51
|
"lodash.merge": "^4.6.2",
|
50
52
|
"lodash.sortby": "^4.7.0",
|
51
|
-
"react-dropzone": "^14.2.3",
|
52
53
|
"style-mod": "^4.1.0",
|
53
|
-
"@dxos/async": "0.7.5-main.
|
54
|
-
"@dxos/
|
55
|
-
"@dxos/
|
56
|
-
"@dxos/
|
57
|
-
"@dxos/
|
58
|
-
"@dxos/
|
59
|
-
"@dxos/
|
60
|
-
"@dxos/
|
61
|
-
"@dxos/
|
62
|
-
"@dxos/
|
63
|
-
"@dxos/
|
64
|
-
"@dxos/
|
54
|
+
"@dxos/async": "0.7.5-main.b19bfc8",
|
55
|
+
"@dxos/automerge": "0.7.5-main.b19bfc8",
|
56
|
+
"@dxos/context": "0.7.5-main.b19bfc8",
|
57
|
+
"@dxos/app-graph": "0.7.5-main.b19bfc8",
|
58
|
+
"@dxos/debug": "0.7.5-main.b19bfc8",
|
59
|
+
"@dxos/display-name": "0.7.5-main.b19bfc8",
|
60
|
+
"@dxos/echo-schema": "0.7.5-main.b19bfc8",
|
61
|
+
"@dxos/invariant": "0.7.5-main.b19bfc8",
|
62
|
+
"@dxos/live-object": "0.7.5-main.b19bfc8",
|
63
|
+
"@dxos/log": "0.7.5-main.b19bfc8",
|
64
|
+
"@dxos/protocols": "0.7.5-main.b19bfc8",
|
65
|
+
"@dxos/react-hooks": "0.7.5-main.b19bfc8",
|
66
|
+
"@dxos/react-ui-menu": "0.7.5-main.b19bfc8",
|
67
|
+
"@dxos/util": "0.7.5-main.b19bfc8"
|
65
68
|
},
|
66
69
|
"devDependencies": {
|
67
70
|
"@phosphor-icons/react": "^2.1.5",
|
68
|
-
"@preact/signals-react": "^1.3.8",
|
69
71
|
"@types/chai": "^4.2.15",
|
70
72
|
"@types/chai-dom": "^1.11.0",
|
71
73
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
@@ -86,23 +88,23 @@
|
|
86
88
|
"vite": "5.4.7",
|
87
89
|
"vite-plugin-top-level-await": "^1.4.1",
|
88
90
|
"vite-plugin-wasm": "^3.3.0",
|
89
|
-
"@dxos/automerge": "0.7.5-main.
|
90
|
-
"@dxos/config": "0.7.5-main.
|
91
|
-
"@dxos/echo-signals": "0.7.5-main.
|
92
|
-
"@dxos/
|
93
|
-
"@dxos/
|
94
|
-
"@dxos/
|
95
|
-
"@dxos/react-ui": "0.7.5-main.
|
96
|
-
"@dxos/
|
97
|
-
"@dxos/
|
91
|
+
"@dxos/automerge": "0.7.5-main.b19bfc8",
|
92
|
+
"@dxos/config": "0.7.5-main.b19bfc8",
|
93
|
+
"@dxos/echo-signals": "0.7.5-main.b19bfc8",
|
94
|
+
"@dxos/random": "0.7.5-main.b19bfc8",
|
95
|
+
"@dxos/react-client": "0.7.5-main.b19bfc8",
|
96
|
+
"@dxos/keyboard": "0.7.5-main.b19bfc8",
|
97
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
98
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
|
99
|
+
"@dxos/storybook-utils": "0.7.5-main.b19bfc8"
|
98
100
|
},
|
99
101
|
"peerDependencies": {
|
100
102
|
"@phosphor-icons/react": "^2.1.5",
|
101
103
|
"react": "~18.2.0",
|
102
104
|
"react-dom": "~18.2.0",
|
103
|
-
"@dxos/react-
|
104
|
-
"@dxos/react-ui": "0.7.5-main.
|
105
|
-
"@dxos/react-
|
105
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
106
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
|
107
|
+
"@dxos/react-client": "0.7.5-main.b19bfc8"
|
106
108
|
},
|
107
109
|
"publishConfig": {
|
108
110
|
"access": "public"
|
@@ -7,10 +7,10 @@ import '@dxos-theme';
|
|
7
7
|
import React, { useState } from 'react';
|
8
8
|
|
9
9
|
import { Toolbar as NaturalToolbar, Select, useThemeContext } from '@dxos/react-ui';
|
10
|
-
import { attentionSurface, mx
|
10
|
+
import { attentionSurface, mx } from '@dxos/react-ui-theme';
|
11
11
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
12
12
|
|
13
|
-
import {
|
13
|
+
import { EditorToolbar, useEditorToolbarState } from './components';
|
14
14
|
import {
|
15
15
|
type EditorInputMode,
|
16
16
|
decorateMarkdown,
|
@@ -28,8 +28,9 @@ type StoryProps = { placeholder?: string; readonly?: boolean } & UseTextEditorPr
|
|
28
28
|
|
29
29
|
const DefaultStory = ({ autoFocus, initialValue, placeholder, readonly }: StoryProps) => {
|
30
30
|
const { themeMode } = useThemeContext();
|
31
|
-
const
|
32
|
-
const
|
31
|
+
const toolbarState = useEditorToolbarState({ viewMode: 'source' });
|
32
|
+
const trackFormatting = useFormattingState(toolbarState);
|
33
|
+
const [editorInputMode, _setEditorInputMode] = useState<EditorInputMode>('default');
|
33
34
|
const { parentRef, view } = useTextEditor(
|
34
35
|
() => ({
|
35
36
|
autoFocus,
|
@@ -54,11 +55,7 @@ const DefaultStory = ({ autoFocus, initialValue, placeholder, readonly }: StoryP
|
|
54
55
|
// Also not sure if view is even guaranteed to exist at this point.
|
55
56
|
return (
|
56
57
|
<div role='none' className={mx('fixed inset-0 flex flex-col')}>
|
57
|
-
<
|
58
|
-
<Toolbar.Markdown />
|
59
|
-
<EditorInputModeToolbar editorInputMode={editorInputMode} setEditorInputMode={setEditorInputMode} />
|
60
|
-
</Toolbar.Root>
|
61
|
-
|
58
|
+
{toolbarState && <EditorToolbar onAction={handleAction} state={toolbarState} />}
|
62
59
|
<div role='none' className='grow overflow-hidden'>
|
63
60
|
<div className={attentionSurface} ref={parentRef} />
|
64
61
|
</div>
|
@@ -66,7 +63,7 @@ const DefaultStory = ({ autoFocus, initialValue, placeholder, readonly }: StoryP
|
|
66
63
|
);
|
67
64
|
};
|
68
65
|
|
69
|
-
const
|
66
|
+
const _EditorInputModeToolbar = ({
|
70
67
|
editorInputMode,
|
71
68
|
setEditorInputMode,
|
72
69
|
}: {
|