@dxos/react-ui-editor 0.4.8-main.c67d72c → 0.4.8-main.cd60bd2

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.
Files changed (71) hide show
  1. package/dist/lib/browser/index.mjs +1926 -1743
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/components/TextEditor/TextEditor.d.ts +2 -2
  5. package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -1
  6. package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts +2 -1
  7. package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
  8. package/dist/types/src/components/Toolbar/Toolbar.d.ts +12 -11
  9. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  10. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +4 -2
  11. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  12. package/dist/types/src/extensions/automerge/automerge.stories.d.ts +1 -0
  13. package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
  14. package/dist/types/src/extensions/comments.d.ts.map +1 -1
  15. package/dist/types/src/extensions/dnd.d.ts +7 -1
  16. package/dist/types/src/extensions/dnd.d.ts.map +1 -1
  17. package/dist/types/src/extensions/factories.d.ts +5 -1
  18. package/dist/types/src/extensions/factories.d.ts.map +1 -1
  19. package/dist/types/src/extensions/index.d.ts +1 -1
  20. package/dist/types/src/extensions/index.d.ts.map +1 -1
  21. package/dist/types/src/extensions/markdown/action.d.ts +9 -0
  22. package/dist/types/src/extensions/markdown/action.d.ts.map +1 -0
  23. package/dist/types/src/extensions/markdown/bundle.d.ts.map +1 -1
  24. package/dist/types/src/extensions/markdown/formatting.d.ts +7 -4
  25. package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
  26. package/dist/types/src/extensions/markdown/image.d.ts +6 -0
  27. package/dist/types/src/extensions/markdown/image.d.ts.map +1 -1
  28. package/dist/types/src/extensions/markdown/index.d.ts +1 -0
  29. package/dist/types/src/extensions/markdown/index.d.ts.map +1 -1
  30. package/dist/types/src/extensions/modes.d.ts +2 -1
  31. package/dist/types/src/extensions/modes.d.ts.map +1 -1
  32. package/dist/types/src/extensions/state.d.ts +20 -0
  33. package/dist/types/src/extensions/state.d.ts.map +1 -0
  34. package/dist/types/src/hooks/useActionHandler.d.ts +2 -2
  35. package/dist/types/src/hooks/useActionHandler.d.ts.map +1 -1
  36. package/dist/types/src/hooks/useDocAccessor.d.ts +4 -2
  37. package/dist/types/src/hooks/useDocAccessor.d.ts.map +1 -1
  38. package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
  39. package/dist/types/src/hooks/useTextEditor.stories.d.ts +1 -0
  40. package/dist/types/src/hooks/useTextEditor.stories.d.ts.map +1 -1
  41. package/dist/types/src/themes/default.d.ts.map +1 -1
  42. package/dist/types/src/translations.d.ts +1 -0
  43. package/dist/types/src/translations.d.ts.map +1 -1
  44. package/package.json +26 -24
  45. package/src/components/TextEditor/TextEditor.stories.tsx +30 -6
  46. package/src/components/TextEditor/TextEditor.tsx +13 -12
  47. package/src/components/Toolbar/Toolbar.stories.tsx +23 -24
  48. package/src/components/Toolbar/Toolbar.tsx +102 -60
  49. package/src/extensions/automerge/automerge.ts +4 -4
  50. package/src/extensions/command/state.ts +2 -2
  51. package/src/extensions/comments.ts +2 -2
  52. package/src/extensions/dnd.ts +31 -9
  53. package/src/extensions/factories.ts +41 -15
  54. package/src/extensions/index.ts +1 -1
  55. package/src/extensions/markdown/action.ts +112 -0
  56. package/src/extensions/markdown/bundle.ts +8 -11
  57. package/src/extensions/markdown/formatting.test.ts +13 -13
  58. package/src/extensions/markdown/formatting.ts +95 -87
  59. package/src/extensions/markdown/image.ts +6 -0
  60. package/src/extensions/markdown/index.ts +1 -0
  61. package/src/extensions/modes.ts +11 -2
  62. package/src/extensions/state.ts +90 -0
  63. package/src/hooks/useActionHandler.ts +4 -85
  64. package/src/hooks/useDocAccessor.ts +8 -2
  65. package/src/hooks/useTextEditor.stories.tsx +3 -3
  66. package/src/hooks/useTextEditor.ts +3 -0
  67. package/src/themes/default.ts +24 -8
  68. package/src/translations.ts +1 -0
  69. package/dist/types/src/extensions/cursor-line-margin.d.ts +0 -7
  70. package/dist/types/src/extensions/cursor-line-margin.d.ts.map +0 -1
  71. package/src/extensions/cursor-line-margin.ts +0 -94
@@ -11,7 +11,7 @@ export type Formatting = {
11
11
  link: boolean;
12
12
  listStyle: null | 'ordered' | 'bullet' | 'task';
13
13
  };
14
- export declare const compareFormatting: (a: Formatting, b: Formatting) => boolean;
14
+ export declare const formattingEquals: (a: Formatting, b: Formatting) => boolean;
15
15
  export declare enum Inline {
16
16
  Strong = 0,
17
17
  Emphasis = 1,
@@ -34,7 +34,10 @@ export declare const toggleStrikethrough: StateCommand;
34
34
  export declare const toggleInlineCode: StateCommand;
35
35
  export declare const insertTable: (view: EditorView) => void;
36
36
  export declare const removeLink: StateCommand;
37
- export declare const addLink: StateCommand;
37
+ export declare const addLink: ({ url, image }?: {
38
+ url?: string | undefined;
39
+ image?: boolean | undefined;
40
+ }) => StateCommand;
38
41
  export declare const addList: (type: List) => StateCommand;
39
42
  export declare const removeList: (type: List) => StateCommand;
40
43
  export declare const toggleList: (type: List) => StateCommand;
@@ -52,7 +55,7 @@ export declare const formattingKeymap: (options?: FormattingOptions) => Extensio
52
55
  */
53
56
  export declare const getFormatting: (state: EditorState) => Formatting;
54
57
  /**
55
- * Hook computes the current formatting state.
58
+ * Hook provides an extension to compute the current formatting state.
56
59
  */
57
- export declare const useFormattingState: () => [Formatting | null, Extension];
60
+ export declare const useFormattingState: () => [Formatting | undefined, Extension];
58
61
  //# 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,KAA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CAAC;AAEJ,eAAO,MAAM,UAAU,SACd,IAAI,KAAG,YAwDb,CAAC;AAEJ,eAAO,MAAM,UAAU,SACd,IAAI,KAAG,YAMb,CAAC;AAqBJ,eAAO,MAAM,aAAa,WACf,OAAO,KAAG,YAwElB,CAAC;AAEJ,eAAO,MAAM,aAAa,cAAsB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,cAAuB,CAAC;AAErD,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,YAsD1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAyC7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAE7B,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEnC,eAAO,MAAM,gBAAgB,aAAa,iBAAiB,KAAQ,SASlE,CAAC;AA4CF;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,WAAW,KAAG,UAqKlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAO,CAAC,UAAU,GAAG,SAAS,EAAE,SAAS,CAoBvE,CAAC"}
@@ -1,4 +1,10 @@
1
1
  import { type Extension } from '@codemirror/state';
2
2
  export type ImageOptions = {};
3
3
  export declare const image: (options?: ImageOptions) => Extension;
4
+ export type ImageUploadOptions = {
5
+ onSelect: () => {
6
+ url: string;
7
+ };
8
+ };
9
+ export declare const imageUpload: (options?: ImageOptions) => void;
4
10
  //# sourceMappingURL=image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAG/G,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B,eAAO,MAAM,KAAK,aAAa,YAAY,KAAQ,SA8BlD,CAAC"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAG/G,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAE9B,eAAO,MAAM,KAAK,aAAa,YAAY,KAAQ,SA8BlD,CAAC;AA4DF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,WAAW,aAAa,YAAY,SAAY,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './action';
1
2
  export * from './bundle';
2
3
  export * from './decorate';
3
4
  export * from './formatting';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type Extension, Facet } from '@codemirror/state';
2
- export type EditorMode = 'default' | 'vim' | undefined;
2
+ export declare const focusEvent = "focus.container";
3
+ export type EditorMode = 'default' | 'vim' | 'vscode' | undefined;
3
4
  export type EditorConfig = {
4
5
  type: string;
5
6
  noTabster?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../../src/extensions/modes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAErB,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAgBpD,CAAC"}
1
+ {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../../src/extensions/modes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1D,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAErB,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAsBpD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ export type SelectionState = {
3
+ scrollTo: {
4
+ from: number;
5
+ };
6
+ selection: {
7
+ anchor: number;
8
+ head?: number;
9
+ };
10
+ };
11
+ export type StateOptions = {
12
+ setState: (id: string, state: SelectionState) => void;
13
+ getState: (id: string) => SelectionState | undefined;
14
+ };
15
+ export declare const localStorageStateStoreAdapter: StateOptions;
16
+ /**
17
+ * Track scrolling and selection state to be restored when switching to document.
18
+ */
19
+ export declare const state: ({ getState, setState }?: Partial<StateOptions>) => Extension;
20
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/extensions/state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,mBAAmB,CAAC;AAYhE,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACtD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;CACtD,CAAC;AAGF,eAAO,MAAM,6BAA6B,EAAE,YAU3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,4BAA4B,QAAQ,YAAY,CAAC,KAAQ,SA0C1E,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { EditorView } from '@codemirror/view';
2
- import type { ToolbarProps } from '../components';
1
+ import { type EditorView } from '@codemirror/view';
2
+ import { type ToolbarProps } from '../components';
3
3
  export declare const useActionHandler: (view?: EditorView | null) => ToolbarProps['onAction'];
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,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqBlD,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,IAAI,KAAG,YAAY,CAAC,UAAU,CAiElF,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;AAEnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,IAAI,KAAG,YAAY,CAAC,UAAU,CAElF,CAAC"}
@@ -1,5 +1,7 @@
1
- import { type DocAccessor, type TextObject } from '@dxos/echo-schema';
2
- export declare const useDocAccessor: <T = any>(text: TextObject) => {
1
+ import { type DocAccessor, type TextObject, type EchoReactiveObject } from '@dxos/echo-schema';
2
+ export declare const useDocAccessor: <T = any>(text: TextObject | EchoReactiveObject<{
3
+ content: string;
4
+ }>) => {
3
5
  id: string;
4
6
  doc: string | undefined;
5
7
  accessor: DocAccessor<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"useDocAccessor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDocAccessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAqB,KAAK,WAAW,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGzG,eAAO,MAAM,cAAc,kBACnB,UAAU;QACT,MAAM;SAAO,MAAM,GAAG,SAAS;;CASvC,CAAC"}
1
+ {"version":3,"file":"useDocAccessor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDocAccessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAG3B,eAAO,MAAM,cAAc,kBACnB,UAAU,GAAG,mBAAmB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;QACnD,MAAM;SAAO,MAAM,GAAG,SAAS;;CASvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAKlG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,YAAY,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAQ,MAAM,kBAAkB,4BAA2C,aAyEpG,CAAC"}
1
+ {"version":3,"file":"useTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAKlG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,YAAY,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAQ,MAAM,kBAAkB,4BAA2C,aA4EpG,CAAC"}
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  'blockquote label': string;
25
25
  'codeblock label': string;
26
26
  'comment label': string;
27
+ 'image label': string;
27
28
  'heading label': string;
28
29
  'table label': string;
29
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAwBpB,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;;;mBA2Ee,UAAU;;;;;;;;;;;;;;;;;;;;;;;;AAH3B,wBASE;AAEF,eAAO,MAAM,OAAO;;CAKnB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAQjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC"}
1
+ {"version":3,"file":"useTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAwBpB,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;;;mBA2Ee,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;AAH3B,wBASE;AAEF,eAAO,MAAM,OAAO;;CAKnB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAQjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/themes/default.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,WAAW,CAAC;AAKrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,WAgP1B,CAAC"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/themes/default.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,WAAW,CAAC;AAKrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,WAgQ1B,CAAC"}
@@ -13,6 +13,7 @@ declare const _default: {
13
13
  'blockquote label': string;
14
14
  'codeblock label': string;
15
15
  'comment label': string;
16
+ 'image label': string;
16
17
  'heading label': string;
17
18
  'table label': string;
18
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;AAEhD,wBAoBE"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;AAEhD,wBAqBE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-editor",
3
- "version": "0.4.8-main.c67d72c",
3
+ "version": "0.4.8-main.cd60bd2",
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",
@@ -30,27 +30,29 @@
30
30
  "@lezer/markdown": "^1.2.0",
31
31
  "@radix-ui/react-context": "^1.0.0",
32
32
  "@replit/codemirror-vim": "^6.0.14",
33
+ "@replit/codemirror-vscode-keymap": "^6.0.2",
33
34
  "codemirror": "^6.0.1",
34
35
  "lib0": "^0.2.65",
35
36
  "lodash.defaultsdeep": "^4.6.1",
36
37
  "lodash.get": "^4.4.2",
37
38
  "lodash.pick": "^4.4.0",
38
39
  "lodash.sortby": "^4.7.0",
40
+ "react-dropzone": "^14.2.3",
39
41
  "style-mod": "^4.1.0",
40
- "@dxos/async": "0.4.8-main.c67d72c",
41
- "@dxos/context": "0.4.8-main.c67d72c",
42
- "@dxos/automerge": "0.4.8-main.c67d72c",
43
- "@dxos/debug": "0.4.8-main.c67d72c",
44
- "@dxos/echo-schema": "0.4.8-main.c67d72c",
45
- "@dxos/display-name": "0.4.8-main.c67d72c",
46
- "@dxos/invariant": "0.4.8-main.c67d72c",
47
- "@dxos/log": "0.4.8-main.c67d72c",
48
- "@dxos/protocols": "0.4.8-main.c67d72c",
49
- "@dxos/react-async": "0.4.8-main.c67d72c",
50
- "@dxos/react-ui": "0.4.8-main.c67d72c",
51
- "@dxos/react-ui-theme": "0.4.8-main.c67d72c",
52
- "@dxos/util": "0.4.8-main.c67d72c",
53
- "@dxos/text-model": "0.4.8-main.c67d72c"
42
+ "@dxos/async": "0.4.8-main.cd60bd2",
43
+ "@dxos/debug": "0.4.8-main.cd60bd2",
44
+ "@dxos/automerge": "0.4.8-main.cd60bd2",
45
+ "@dxos/context": "0.4.8-main.cd60bd2",
46
+ "@dxos/display-name": "0.4.8-main.cd60bd2",
47
+ "@dxos/echo-schema": "0.4.8-main.cd60bd2",
48
+ "@dxos/invariant": "0.4.8-main.cd60bd2",
49
+ "@dxos/log": "0.4.8-main.cd60bd2",
50
+ "@dxos/protocols": "0.4.8-main.cd60bd2",
51
+ "@dxos/react-async": "0.4.8-main.cd60bd2",
52
+ "@dxos/react-ui": "0.4.8-main.cd60bd2",
53
+ "@dxos/react-ui-theme": "0.4.8-main.cd60bd2",
54
+ "@dxos/text-model": "0.4.8-main.cd60bd2",
55
+ "@dxos/util": "0.4.8-main.cd60bd2"
54
56
  },
55
57
  "devDependencies": {
56
58
  "@automerge/automerge-repo-network-broadcastchannel": "^1.1.1",
@@ -77,20 +79,20 @@
77
79
  "vite-plugin-top-level-await": "^1.4.1",
78
80
  "vite-plugin-wasm": "^3.3.0",
79
81
  "vitest": "^1.3.1",
80
- "@dxos/config": "0.4.8-main.c67d72c",
81
- "@dxos/echo-signals": "0.4.8-main.c67d72c",
82
- "@dxos/keyboard": "0.4.8-main.c67d72c",
83
- "@dxos/echo-typegen": "0.4.8-main.c67d72c",
84
- "@dxos/random": "0.4.8-main.c67d72c",
85
- "@dxos/react-client": "0.4.8-main.c67d72c",
86
- "@dxos/storybook-utils": "0.4.8-main.c67d72c",
87
- "@dxos/react-ui": "0.4.8-main.c67d72c"
82
+ "@dxos/config": "0.4.8-main.cd60bd2",
83
+ "@dxos/echo-signals": "0.4.8-main.cd60bd2",
84
+ "@dxos/echo-typegen": "0.4.8-main.cd60bd2",
85
+ "@dxos/keyboard": "0.4.8-main.cd60bd2",
86
+ "@dxos/random": "0.4.8-main.cd60bd2",
87
+ "@dxos/react-client": "0.4.8-main.cd60bd2",
88
+ "@dxos/react-ui": "0.4.8-main.cd60bd2",
89
+ "@dxos/storybook-utils": "0.4.8-main.cd60bd2"
88
90
  },
89
91
  "peerDependencies": {
90
92
  "@phosphor-icons/react": "^2.0.5",
91
93
  "react": "^18.2.0",
92
94
  "react-dom": "^18.2.0",
93
- "@dxos/react-client": "0.4.8-main.c67d72c"
95
+ "@dxos/react-client": "0.4.8-main.cd60bd2"
94
96
  },
95
97
  "publishConfig": {
96
98
  "access": "public"
@@ -13,6 +13,7 @@ import { createRoot } from 'react-dom/client';
13
13
  import { TextObject } from '@dxos/echo-schema';
14
14
  import { keySymbols, parseShortcut } from '@dxos/keyboard';
15
15
  import { PublicKey } from '@dxos/keys';
16
+ import { log } from '@dxos/log';
16
17
  import { faker } from '@dxos/random';
17
18
  import { Button, DensityProvider, Input, ThemeProvider, useThemeContext } from '@dxos/react-ui';
18
19
  import { baseSurface, defaultTx, getSize, mx, textBlockWidth } from '@dxos/react-ui-theme';
@@ -20,6 +21,7 @@ import { withTheme } from '@dxos/storybook-utils';
20
21
 
21
22
  import { TextEditor, type TextEditorProps } from './TextEditor';
22
23
  import {
24
+ EditorModes,
23
25
  annotations,
24
26
  autocomplete,
25
27
  blast,
@@ -31,20 +33,21 @@ import {
31
33
  createThemeExtensions,
32
34
  decorateMarkdown,
33
35
  defaultOptions,
34
- dnd,
36
+ dropFile,
35
37
  formattingKeymap,
36
38
  image,
37
39
  linkTooltip,
38
40
  listener,
39
41
  mention,
40
- useComments,
42
+ state,
41
43
  table,
42
44
  typewriter,
43
- EditorModes,
45
+ useComments,
44
46
  type CommandAction,
45
47
  type CommandOptions,
46
48
  type Comment,
47
49
  type CommentsOptions,
50
+ type SelectionState,
48
51
  } from '../../extensions';
49
52
  import { useDocAccessor } from '../../hooks';
50
53
  import translations from '../../translations';
@@ -241,7 +244,7 @@ type StoryProps = {
241
244
  } & Pick<TextEditorProps, 'extensions'>;
242
245
 
243
246
  const Story = ({
244
- id = 'test',
247
+ id = 'editor-' + PublicKey.random().toHex().slice(0, 8),
245
248
  text,
246
249
  comments,
247
250
  extensions: _extensions = [],
@@ -325,8 +328,18 @@ export const Empty = {
325
328
  render: () => <Story />,
326
329
  };
327
330
 
331
+ const global = new Map<string, SelectionState>();
332
+
328
333
  export const Scrolling = {
329
- render: () => <Story text={str('# Large Document', '', large)} />,
334
+ render: () => (
335
+ <Story
336
+ text={str('# Large Document', '', large)}
337
+ extensions={state({
338
+ setState: (id, state) => global.set(id, state),
339
+ getState: (id) => global.get(id),
340
+ })}
341
+ />
342
+ ),
330
343
  };
331
344
 
332
345
  export const ScrollingWithImages = {
@@ -489,7 +502,18 @@ export const Annotations = {
489
502
  };
490
503
 
491
504
  export const DND = {
492
- render: () => <Story text={str('# DND', '')} extensions={[dnd()]} />,
505
+ render: () => (
506
+ <Story
507
+ text={str('# DND', '')}
508
+ extensions={[
509
+ dropFile({
510
+ onDrop: (view, event) => {
511
+ log.info('drop', event);
512
+ },
513
+ }),
514
+ ]}
515
+ />
516
+ ),
493
517
  };
494
518
 
495
519
  const typewriterItems = localStorage.getItem('dxos.org/plugin/markdown/typewriter')?.split(',');
@@ -18,7 +18,7 @@ import React, {
18
18
  import { log } from '@dxos/log';
19
19
  import { isNotFalsy } from '@dxos/util';
20
20
 
21
- import { documentId, editorMode } from '../../extensions';
21
+ import { documentId, editorMode, focusEvent } from '../../extensions';
22
22
  import { logChanges } from '../../util';
23
23
 
24
24
  export type CursorInfo = {
@@ -34,7 +34,7 @@ export type TextEditorProps = Pick<EditorStateConfig, 'doc' | 'selection' | 'ext
34
34
  id?: string;
35
35
  className?: string;
36
36
  autoFocus?: boolean;
37
- scrollTo?: StateEffect<any>; // TODO(burdon): Restore scroll position: scrollTo EditorView.scrollSnapshot().
37
+ scrollTo?: StateEffect<unknown>;
38
38
  moveToEndOfLine?: boolean;
39
39
  debug?: boolean;
40
40
  dataTestId?: string;
@@ -56,14 +56,14 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
56
56
  extensions,
57
57
  className,
58
58
  autoFocus,
59
- scrollTo = EditorView.scrollIntoView(0),
59
+ scrollTo = EditorView.scrollIntoView(0, { yMargin: 0 }),
60
60
  moveToEndOfLine,
61
61
  debug,
62
62
  dataTestId,
63
63
  },
64
64
  forwardedRef,
65
65
  ) => {
66
- // TODO(burdon): Increments by 2!
66
+ // NOTE: Increments by 2 in strict mode.
67
67
  const [instanceId] = useState(() => `text-editor-${++instanceCount}`);
68
68
 
69
69
  // TODO(burdon): Make tabster optional.
@@ -85,7 +85,7 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
85
85
  // Create editor state and view.
86
86
  // The view is recreated if the model or extensions are changed.
87
87
  useEffect(() => {
88
- log('updating', { id, instanceId });
88
+ log('create', { id, instanceId });
89
89
 
90
90
  //
91
91
  // EditorState
@@ -104,7 +104,7 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
104
104
  // Focus.
105
105
  EditorView.updateListener.of((update) => {
106
106
  update.transactions.forEach((transaction) => {
107
- if (transaction.isUserEvent('focus.container')) {
107
+ if (transaction.isUserEvent(focusEvent)) {
108
108
  rootRef.current?.focus();
109
109
  }
110
110
  });
@@ -122,6 +122,7 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
122
122
  state,
123
123
  parent: rootRef.current!,
124
124
  scrollTo,
125
+
125
126
  // NOTE: Uncomment to debug/monitor all transactions.
126
127
  // https://codemirror.net/docs/ref/#view.EditorView.dispatch
127
128
  dispatchTransactions: (trs, view) => {
@@ -132,12 +133,10 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
132
133
  },
133
134
  });
134
135
 
135
- setView(view);
136
-
137
- // Position cursor at end of line.
138
- if (moveToEndOfLine) {
136
+ // Position cursor at end of first line.
137
+ if (moveToEndOfLine && !(scrollTo || selection)) {
139
138
  const { to } = view.state.doc.lineAt(0);
140
- view?.dispatch({ selection: { anchor: to } });
139
+ view.dispatch({ selection: { anchor: to } });
141
140
  }
142
141
 
143
142
  // Remove tabster attribute (rely on custom keymap).
@@ -145,9 +144,11 @@ export const TextEditor = forwardRef<EditorView | null, TextEditorProps>(
145
144
  rootRef.current?.removeAttribute('data-tabster');
146
145
  }
147
146
 
147
+ setView(view);
148
+
148
149
  return () => {
150
+ log('destroy', { id, instanceId });
149
151
  view?.destroy();
150
- setView(null);
151
152
  };
152
153
  }, [doc, selection, extensions]);
153
154
 
@@ -16,17 +16,17 @@ import { withTheme } from '@dxos/storybook-utils';
16
16
  import { Toolbar } from './Toolbar';
17
17
  import {
18
18
  type Comment,
19
- decorateMarkdown,
20
19
  comments,
21
20
  createBasicExtensions,
22
21
  createDataExtensions,
22
+ createMarkdownExtensions,
23
23
  createThemeExtensions,
24
+ decorateMarkdown,
24
25
  formattingKeymap,
26
+ image,
25
27
  table,
26
28
  useComments,
27
29
  useFormattingState,
28
- createMarkdownExtensions,
29
- image,
30
30
  } from '../../extensions';
31
31
  import { useActionHandler, useDocAccessor, useTextEditor } from '../../hooks';
32
32
  import translations from '../../translations';
@@ -34,15 +34,17 @@ import translations from '../../translations';
34
34
  faker.seed(101);
35
35
 
36
36
  const Story: FC<{ content: string }> = ({ content }) => {
37
+ console.log('STORY');
37
38
  const { themeMode } = useThemeContext();
38
39
  const [item] = useState({ text: new TextObject(content) });
39
40
  const { id, doc, accessor } = useDocAccessor(item.text);
40
41
  const [formattingState, formattingObserver] = useFormattingState();
41
- const { parentRef, view } = useTextEditor(
42
- () => ({
42
+ const { parentRef, view } = useTextEditor(() => {
43
+ return {
43
44
  id,
44
45
  doc,
45
46
  extensions: [
47
+ formattingObserver,
46
48
  createBasicExtensions(),
47
49
  createMarkdownExtensions({ themeMode }),
48
50
  createThemeExtensions({ themeMode, slots: { editor: { className: 'p-2' } } }),
@@ -58,39 +60,36 @@ const Story: FC<{ content: string }> = ({ content }) => {
58
60
  formattingKeymap(),
59
61
  image(),
60
62
  table(),
61
- formattingObserver,
62
63
  ],
63
- }),
64
- [id, accessor, themeMode],
65
- );
64
+ };
65
+ }, [id, accessor, formattingObserver, themeMode]);
66
+
67
+ const handleAction = useActionHandler(view);
66
68
 
67
69
  const [_comments, setComments] = useState<Comment[]>([]);
68
70
  useComments(view, id, _comments);
69
71
 
70
- const handleAction = useActionHandler(view);
71
-
72
72
  return (
73
- <div role='none' className='fixed inset-0 flex flex-col'>
74
- <Toolbar.Root onAction={handleAction} state={formattingState} classNames={textBlockWidth}>
75
- <Toolbar.Markdown />
76
- <Toolbar.Separator />
77
- <Toolbar.Extended />
78
- </Toolbar.Root>
79
- <div role='textbox' ref={parentRef} className={textBlockWidth} />;
80
- </div>
73
+ <Tooltip.Provider>
74
+ <div role='none' className='fixed inset-0 flex flex-col'>
75
+ <Toolbar.Root onAction={handleAction} state={formattingState} classNames={textBlockWidth}>
76
+ <Toolbar.Markdown />
77
+ <Toolbar.Custom onUpload={async (file) => ({ url: file.name })} />
78
+ <Toolbar.Separator />
79
+ <Toolbar.Actions />
80
+ </Toolbar.Root>
81
+ <div ref={parentRef} className={textBlockWidth} />
82
+ </div>
83
+ </Tooltip.Provider>
81
84
  );
82
85
  };
83
86
 
84
87
  export default {
85
88
  title: 'react-ui-editor/Toolbar',
86
89
  component: Toolbar,
87
- render: (args: any) => (
88
- <Tooltip.Provider>
89
- <Story {...args} />
90
- </Tooltip.Provider>
91
- ),
92
90
  decorators: [withTheme],
93
91
  parameters: { translations, layout: 'fullscreen' },
92
+ render: (args: any) => <Story {...args} />,
94
93
  };
95
94
 
96
95
  const content = [