@dxos/react-ui-editor 0.8.2-main.f11618f → 0.8.2-staging.7ac8446

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 (112) hide show
  1. package/dist/lib/browser/index.mjs +371 -499
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +379 -515
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +371 -499
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/{stories/InputMode.stories.d.ts → InputMode.stories.d.ts} +1 -1
  11. package/dist/types/src/InputMode.stories.d.ts.map +1 -0
  12. package/dist/types/src/{stories/TextEditorBasic.stories.d.ts → TextEditor.stories.d.ts} +35 -2
  13. package/dist/types/src/TextEditor.stories.d.ts.map +1 -0
  14. package/dist/types/src/components/EditorToolbar/util.d.ts +3 -3
  15. package/dist/types/src/components/EditorToolbar/util.d.ts.map +1 -1
  16. package/dist/types/src/components/EditorToolbar/{view-mode.d.ts → viewMode.d.ts} +1 -1
  17. package/dist/types/src/components/EditorToolbar/viewMode.d.ts.map +1 -0
  18. package/dist/types/src/defaults.d.ts +0 -1
  19. package/dist/types/src/defaults.d.ts.map +1 -1
  20. package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
  21. package/dist/types/src/extensions/command/command.d.ts +10 -5
  22. package/dist/types/src/extensions/command/command.d.ts.map +1 -1
  23. package/dist/types/src/extensions/command/hint.d.ts +2 -4
  24. package/dist/types/src/extensions/command/hint.d.ts.map +1 -1
  25. package/dist/types/src/extensions/command/index.d.ts +0 -1
  26. package/dist/types/src/extensions/command/index.d.ts.map +1 -1
  27. package/dist/types/src/extensions/command/menu.d.ts +2 -7
  28. package/dist/types/src/extensions/command/menu.d.ts.map +1 -1
  29. package/dist/types/src/extensions/command/preview.d.ts +12 -0
  30. package/dist/types/src/extensions/command/preview.d.ts.map +1 -0
  31. package/dist/types/src/extensions/command/state.d.ts +11 -9
  32. package/dist/types/src/extensions/command/state.d.ts.map +1 -1
  33. package/dist/types/src/extensions/comments.d.ts +7 -9
  34. package/dist/types/src/extensions/comments.d.ts.map +1 -1
  35. package/dist/types/src/extensions/index.d.ts +0 -1
  36. package/dist/types/src/extensions/index.d.ts.map +1 -1
  37. package/dist/types/src/extensions/markdown/decorate.d.ts +1 -4
  38. package/dist/types/src/extensions/markdown/decorate.d.ts.map +1 -1
  39. package/dist/types/src/extensions/markdown/formatting.d.ts +2 -2
  40. package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
  41. package/dist/types/src/extensions/markdown/link.d.ts +1 -4
  42. package/dist/types/src/extensions/markdown/link.d.ts.map +1 -1
  43. package/dist/types/src/fragments.d.ts +3 -0
  44. package/dist/types/src/fragments.d.ts.map +1 -0
  45. package/dist/types/src/hooks/useTextEditor.d.ts +1 -2
  46. package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
  47. package/dist/types/src/types.d.ts +0 -5
  48. package/dist/types/src/types.d.ts.map +1 -1
  49. package/dist/types/src/util/react.d.ts +1 -6
  50. package/dist/types/src/util/react.d.ts.map +1 -1
  51. package/package.json +27 -33
  52. package/src/{stories/InputMode.stories.tsx → InputMode.stories.tsx} +4 -4
  53. package/src/TextEditor.stories.tsx +856 -0
  54. package/src/components/EditorToolbar/EditorToolbar.tsx +2 -2
  55. package/src/components/EditorToolbar/util.ts +3 -3
  56. package/src/defaults.ts +3 -5
  57. package/src/extensions/automerge/automerge.stories.tsx +11 -3
  58. package/src/extensions/command/command.ts +27 -9
  59. package/src/extensions/command/hint.ts +30 -33
  60. package/src/extensions/command/index.ts +0 -1
  61. package/src/extensions/command/menu.ts +8 -11
  62. package/src/extensions/command/preview.ts +79 -0
  63. package/src/extensions/command/state.ts +61 -41
  64. package/src/extensions/comments.ts +9 -9
  65. package/src/extensions/folding.tsx +1 -1
  66. package/src/extensions/index.ts +0 -1
  67. package/src/extensions/markdown/decorate.ts +3 -4
  68. package/src/extensions/markdown/formatting.ts +2 -2
  69. package/src/extensions/markdown/image.ts +11 -12
  70. package/src/extensions/markdown/link.ts +24 -33
  71. package/src/fragments.ts +19 -0
  72. package/src/hooks/useTextEditor.ts +3 -4
  73. package/src/types.ts +0 -7
  74. package/src/util/react.tsx +2 -20
  75. package/dist/lib/browser/testing/index.mjs +0 -67
  76. package/dist/lib/browser/testing/index.mjs.map +0 -7
  77. package/dist/lib/node/testing/index.cjs +0 -101
  78. package/dist/lib/node/testing/index.cjs.map +0 -7
  79. package/dist/lib/node-esm/testing/index.mjs +0 -69
  80. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  81. package/dist/types/src/components/EditorToolbar/view-mode.d.ts.map +0 -1
  82. package/dist/types/src/extensions/command/action.d.ts +0 -17
  83. package/dist/types/src/extensions/command/action.d.ts.map +0 -1
  84. package/dist/types/src/extensions/preview/index.d.ts +0 -2
  85. package/dist/types/src/extensions/preview/index.d.ts.map +0 -1
  86. package/dist/types/src/extensions/preview/preview.d.ts +0 -39
  87. package/dist/types/src/extensions/preview/preview.d.ts.map +0 -1
  88. package/dist/types/src/stories/InputMode.stories.d.ts.map +0 -1
  89. package/dist/types/src/stories/TextEditorBasic.stories.d.ts.map +0 -1
  90. package/dist/types/src/stories/TextEditorComments.stories.d.ts +0 -13
  91. package/dist/types/src/stories/TextEditorComments.stories.d.ts.map +0 -1
  92. package/dist/types/src/stories/TextEditorPreview.stories.d.ts +0 -13
  93. package/dist/types/src/stories/TextEditorPreview.stories.d.ts.map +0 -1
  94. package/dist/types/src/stories/TextEditorSpecial.stories.d.ts +0 -19
  95. package/dist/types/src/stories/TextEditorSpecial.stories.d.ts.map +0 -1
  96. package/dist/types/src/stories/story-utils.d.ts +0 -53
  97. package/dist/types/src/stories/story-utils.d.ts.map +0 -1
  98. package/dist/types/src/testing/RefPopover.d.ts +0 -21
  99. package/dist/types/src/testing/RefPopover.d.ts.map +0 -1
  100. package/dist/types/src/testing/index.d.ts +0 -2
  101. package/dist/types/src/testing/index.d.ts.map +0 -1
  102. package/src/extensions/command/action.ts +0 -49
  103. package/src/extensions/preview/index.ts +0 -5
  104. package/src/extensions/preview/preview.ts +0 -271
  105. package/src/stories/TextEditorBasic.stories.tsx +0 -289
  106. package/src/stories/TextEditorComments.stories.tsx +0 -99
  107. package/src/stories/TextEditorPreview.stories.tsx +0 -239
  108. package/src/stories/TextEditorSpecial.stories.tsx +0 -107
  109. package/src/stories/story-utils.tsx +0 -329
  110. package/src/testing/RefPopover.tsx +0 -74
  111. package/src/testing/index.ts +0 -5
  112. /package/src/components/EditorToolbar/{view-mode.ts → viewMode.ts} +0 -0
@@ -1,11 +1,6 @@
1
1
  import { type EditorView, ViewPlugin, type ViewUpdate } from '@codemirror/view';
2
- import { type RenderCallback } from '../../types';
3
- export type FloatingMenuOptions = {
4
- renderMenu: RenderCallback<{
5
- onAction: () => void;
6
- }>;
7
- };
8
- export declare const floatingMenu: (options: FloatingMenuOptions) => ViewPlugin<{
2
+ import { type CommandOptions } from './command';
3
+ export declare const floatingMenu: (options: CommandOptions) => ViewPlugin<{
9
4
  button: HTMLElement;
10
5
  view: EditorView;
11
6
  rafId: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/menu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkB,KAAK,UAAU,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGhG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,cAAc,CAAC;QAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CACtD,CAAC;AAIF,eAAO,MAAM,YAAY,YAAa,mBAAmB;YAG3C,WAAW;UACb,UAAU;WACT,MAAM,GAAG,IAAI;mBAyBL,UAAU;;;;EAyD5B,CAAC"}
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/menu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkB,KAAK,UAAU,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,YAAY,YAAa,cAAc;YAGtC,WAAW;UACb,UAAU;WACT,MAAM,GAAG,IAAI;mBA2BL,UAAU;;;;EAwD5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ export type PreviewOptions = {
3
+ onRenderPreview: (el: HTMLElement, props: {
4
+ url: string;
5
+ text: string;
6
+ }) => void;
7
+ };
8
+ /**
9
+ * Create image decorations.
10
+ */
11
+ export declare const preview: (options: PreviewOptions) => Extension;
12
+ //# sourceMappingURL=preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/preview.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,YAAa,cAAc,KAAG,SASjD,CAAC"}
@@ -1,16 +1,18 @@
1
1
  import { StateField } from '@codemirror/state';
2
- import { type Tooltip } from '@codemirror/view';
3
- import { type Action } from './action';
4
- import { type RenderCallback } from '../../types';
5
- export declare const commandConfig: import("@codemirror/state").Facet<Partial<PopupOptions & import("./menu").FloatingMenuOptions & import("./hint").HintOptions>, Partial<PopupOptions & import("./menu").FloatingMenuOptions & import("./hint").HintOptions>>;
6
- export type PopupOptions = {
7
- renderDialog: RenderCallback<{
8
- onAction: (action?: Action) => void;
9
- }>;
10
- };
2
+ import { type Command, type KeyBinding, type Tooltip } from '@codemirror/view';
3
+ import { type CommandOptions } from './command';
11
4
  type CommandState = {
12
5
  tooltip?: Tooltip | null;
13
6
  };
7
+ export declare const commandConfig: import("@codemirror/state").Facet<CommandOptions, CommandOptions>;
14
8
  export declare const commandState: StateField<CommandState>;
9
+ export declare const openEffect: import("@codemirror/state").StateEffectType<{
10
+ pos: number;
11
+ fullWidth?: boolean;
12
+ }>;
13
+ export declare const closeEffect: import("@codemirror/state").StateEffectType<null>;
14
+ export declare const openCommand: Command;
15
+ export declare const closeCommand: Command;
16
+ export declare const commandKeyBindings: readonly KeyBinding[];
15
17
  export {};
16
18
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgC,KAAK,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAe,KAAK,MAAM,EAAc,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,aAAa,6NAAqC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,cAAc,CAAC;QAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC,CAAC;CACvE,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,YAAY,0BAmEvB,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,mEAAqC,CAAC;AAEhE,eAAO,MAAM,YAAY,0BAwDvB,CAAC;AAEH,eAAO,MAAM,UAAU;SAA6B,MAAM;gBAAc,OAAO;EAAK,CAAC;AACrF,eAAO,MAAM,WAAW,mDAA6B,CAAC;AAEtD,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAO1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAAS,UAAU,EAGnD,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { type EditorState, type Extension, StateField } from '@codemirror/state';
2
2
  import { type Command, EditorView, type Rect } from '@codemirror/view';
3
3
  import { type CleanupFn } from '@dxos/async';
4
- import { type Live } from '@dxos/live-object';
4
+ import { type ReactiveObject } from '@dxos/live-object';
5
5
  import { type EditorToolbarState } from '../components';
6
- import { type RenderCallback, type Comment, type Range } from '../types';
6
+ import { type Comment, type Range } from '../types';
7
7
  type CommentState = {
8
8
  comment: Comment;
9
9
  range: Range;
@@ -41,12 +41,6 @@ export type CommentsOptions = {
41
41
  * Key shortcut to create a new thread.
42
42
  */
43
43
  key?: string;
44
- /**
45
- * Called to render tooltip.
46
- */
47
- renderTooltip?: RenderCallback<{
48
- shortcut: string;
49
- }>;
50
44
  /**
51
45
  * Called to create a new thread and return the thread id.
52
46
  */
@@ -72,6 +66,10 @@ export type CommentsOptions = {
72
66
  * Called to notify which thread is currently closest to the cursor.
73
67
  */
74
68
  onSelect?: (state: CommentsState) => void;
69
+ /**
70
+ * Called to render tooltip.
71
+ */
72
+ onHover?: (el: Element, shortcut: string) => void;
75
73
  };
76
74
  /**
77
75
  * Comment threads.
@@ -91,7 +89,7 @@ export declare const scrollThreadIntoView: (view: EditorView, id: string, center
91
89
  */
92
90
  export declare const selectionOverlapsComment: (state: EditorState) => boolean;
93
91
  export declare const createExternalCommentSync: (id: string, subscribe: (sink: () => void) => CleanupFn, getComments: () => Comment[]) => Extension;
94
- export declare const useCommentState: (state: Live<EditorToolbarState>) => Extension;
92
+ export declare const useCommentState: (state: ReactiveObject<EditorToolbarState>) => Extension;
95
93
  /**
96
94
  * @deprecated This hook will be removed in future versions. Use the new comment sync extension instead.
97
95
  * Update comments state field.
@@ -1 +1 @@
1
- {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../../src/extensions/comments.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,KAAK,OAAO,EAEZ,UAAU,EACV,KAAK,IAAI,EAGV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAOzE,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CA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AIF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,aAAa,eAAe,KAAQ,SAiIxD,CAAC;AAMF,eAAO,MAAM,oBAAoB,SAAU,UAAU,MAAM,MAAM,2BA4BhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,UAAW,WAAW,KAAG,OAe7D,CAAC;AA8BF,eAAO,MAAM,yBAAyB,OAChC,MAAM,aACC,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,SAAS,eAC7B,MAAM,OAAO,EAAE,KAC3B,SAOA,CAAC;AAEJ,eAAO,MAAM,eAAe,UAAW,cAAc,CAAC,kBAAkB,CAAC,KAAG,SAW3E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,UAAU,GAAG,IAAI,GAAG,SAAS,MAAM,MAAM,aAAa,OAAO,EAAE,SAYhG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,mBAAoB,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,KAAG,SAcrF,CAAC"}
@@ -14,7 +14,6 @@ export * from './listener';
14
14
  export * from './markdown';
15
15
  export * from './mention';
16
16
  export * from './modes';
17
- export * from './preview';
18
17
  export * from './selection';
19
18
  export * from './typewriter';
20
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,4 +1,3 @@
1
- import { type RenderCallback } from '../../types';
2
1
  export interface DecorateOptions {
3
2
  /**
4
3
  * Prevents triggering decorations as the cursor moves through the document.
@@ -8,9 +7,7 @@ export interface DecorateOptions {
8
7
  from: number;
9
8
  to?: number;
10
9
  };
11
- renderLinkButton?: RenderCallback<{
12
- url: string;
13
- }>;
10
+ renderLinkButton?: (el: Element, url: string) => void;
14
11
  }
15
12
  export declare const decorateMarkdown: (options?: DecorateOptions) => import("@codemirror/state").Extension[];
16
13
  //# sourceMappingURL=decorate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/decorate.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAmflD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,gBAAgB,CAAC,EAAE,cAAc,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,gBAAgB,aAAa,eAAe,4CAgExD,CAAC"}
1
+ {"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/decorate.ts"],"names":[],"mappings":"AAmgBA,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,gBAAgB,aAAa,eAAe,4CAgExD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type Extension, type StateCommand, type EditorState } from '@codemirror/state';
2
2
  import { EditorView } from '@codemirror/view';
3
- import { type Live } from '@dxos/live-object';
3
+ import { type ReactiveObject } from '@dxos/live-object';
4
4
  import { type EditorToolbarState } from '../../components';
5
5
  export type Formatting = Partial<{
6
6
  blankLine: boolean;
@@ -59,5 +59,5 @@ export declare const getFormatting: (state: EditorState) => Formatting;
59
59
  /**
60
60
  * Hook provides an extension to compute the current formatting state.
61
61
  */
62
- export declare const useFormattingState: (state: Live<EditorToolbarState>) => Extension;
62
+ export declare const useFormattingState: (state: ReactiveObject<EditorToolbarState>) => Extension;
63
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,K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ip: RenderCallback<{
3
- url: string;
4
- }>) => import("@codemirror/state").Extension & {
1
+ export declare const linkTooltip: (render: (el: HTMLElement, url: string) => void) => import("@codemirror/state").Extension & {
5
2
  active: import("@codemirror/state").StateField<readonly import("@codemirror/view").Tooltip[]>;
6
3
  };
7
4
  //# sourceMappingURL=link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/link.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,WAAW,kBAAmB,cAAc,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;;CAiCzE,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/markdown/link.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,WAAW,WAAY,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;;CA0BzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const stackItemContentEditorClassNames: (role?: string) => string;
2
+ export declare const stackItemContentToolbarClassNames: (role?: string) => string;
3
+ //# sourceMappingURL=fragments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../../src/fragments.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gCAAgC,UAAW,MAAM,WAI3D,CAAC;AAEJ,eAAO,MAAM,iCAAiC,UAAW,MAAM,WAI5D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type EditorStateConfig, type Text } from '@codemirror/state';
1
+ import { type EditorStateConfig } from '@codemirror/state';
2
2
  import { EditorView } from '@codemirror/view';
3
3
  import { type TabsterTypes } from '@fluentui/react-tabster';
4
4
  import { type DependencyList, type KeyboardEventHandler, type RefObject } from 'react';
@@ -22,7 +22,6 @@ export type CursorInfo = {
22
22
  };
23
23
  export type UseTextEditorProps = Pick<EditorStateConfig, 'extensions'> & {
24
24
  id?: string;
25
- doc?: Text;
26
25
  initialValue?: string;
27
26
  className?: string;
28
27
  autoFocus?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextEditor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,EAAE,KAAK,eAAe,EAA6D,MAAM,eAAe,CAAC;AAGhH,MAAM,MAAM,aAAa,GAAG;IAE1B,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,eAAe,CAAC,EAAE,YAAY,CAAC,mBAAmB,GAAG;QACnD,QAAQ,EAAE,CAAC,CAAC;QACZ,OAAO,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CA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,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,aAAa,WACjB,aAAa,CAAC,kBAAkB,CAAC,SAClC,cAAc,KACnB,aA+HF,CAAC"}
@@ -1,4 +1,3 @@
1
- import { type EditorView } from '@codemirror/view';
2
1
  export type Range = {
3
2
  from: number;
4
3
  to: number;
@@ -7,8 +6,4 @@ export type Comment = {
7
6
  id: string;
8
7
  cursor?: string;
9
8
  };
10
- /**
11
- * Callback that renders into a DOM element within the editor.
12
- */
13
- export type RenderCallback<Props extends object> = (el: HTMLElement, props: Props, view: EditorView) => void;
14
9
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,MAAM,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,12 +1,7 @@
1
- import { type FC, type ReactNode } from 'react';
2
- import { type RenderCallback } from '../types';
1
+ import { type ReactNode } from 'react';
3
2
  export type ElementOptions = {
4
3
  className?: string;
5
4
  };
6
5
  export declare const createElement: (tag: string, options?: ElementOptions, children?: ReactNode) => HTMLElement;
7
6
  export declare const renderRoot: <T extends Element>(root: T, node: ReactNode) => T;
8
- /**
9
- * Utility to create a renderer for a React component.
10
- */
11
- export declare const createRenderer: <Props extends object>(Component: FC<Props>) => RenderCallback<Props>;
12
7
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../../src/util/react.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,YAAY,cAAc,aAAa,SAAS,KAAG,WAU3F,CAAC;AAIF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,OAAO,QAAQ,CAAC,QAAQ,SAAS,KAAG,CAGxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACxB,KAAK,SAAS,MAAM,aAAa,EAAE,CAAC,KAAK,CAAC,KAAG,cAAc,CAAC,KAAK,CAUjE,CAAC"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../../src/util/react.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ9C,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,YAAY,cAAc,aAAa,SAAS,KAAG,WAU3F,CAAC;AAIF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,OAAO,QAAQ,CAAC,QAAQ,SAAS,KAAG,CAGxE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-editor",
3
- "version": "0.8.2-main.f11618f",
3
+ "version": "0.8.2-staging.7ac8446",
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",
@@ -13,11 +13,6 @@
13
13
  "types": "./dist/types/src/index.d.ts",
14
14
  "browser": "./dist/lib/browser/index.mjs",
15
15
  "node": "./dist/lib/node-esm/index.mjs"
16
- },
17
- "./testing": {
18
- "types": "./dist/types/src/testing/index.d.ts",
19
- "browser": "./dist/lib/browser/testing/index.mjs",
20
- "node": "./dist/lib/node-esm/testing/index.mjs"
21
16
  }
22
17
  },
23
18
  "types": "dist/types/src/index.d.ts",
@@ -56,21 +51,20 @@
56
51
  "lodash.merge": "^4.6.2",
57
52
  "lodash.sortby": "^4.7.0",
58
53
  "style-mod": "^4.1.0",
59
- "@dxos/app-graph": "0.8.2-main.f11618f",
60
- "@dxos/context": "0.8.2-main.f11618f",
61
- "@dxos/async": "0.8.2-main.f11618f",
62
- "@dxos/automerge": "0.8.2-main.f11618f",
63
- "@dxos/debug": "0.8.2-main.f11618f",
64
- "@dxos/display-name": "0.8.2-main.f11618f",
65
- "@dxos/invariant": "0.8.2-main.f11618f",
66
- "@dxos/echo-schema": "0.8.2-main.f11618f",
67
- "@dxos/lit-ui": "0.8.2-main.f11618f",
68
- "@dxos/live-object": "0.8.2-main.f11618f",
69
- "@dxos/log": "0.8.2-main.f11618f",
70
- "@dxos/protocols": "0.8.2-main.f11618f",
71
- "@dxos/react-hooks": "0.8.2-main.f11618f",
72
- "@dxos/util": "0.8.2-main.f11618f",
73
- "@dxos/react-ui-menu": "0.8.2-main.f11618f"
54
+ "@dxos/app-graph": "0.8.2-staging.7ac8446",
55
+ "@dxos/automerge": "0.8.2-staging.7ac8446",
56
+ "@dxos/async": "0.8.2-staging.7ac8446",
57
+ "@dxos/context": "0.8.2-staging.7ac8446",
58
+ "@dxos/debug": "0.8.2-staging.7ac8446",
59
+ "@dxos/echo-schema": "0.8.2-staging.7ac8446",
60
+ "@dxos/display-name": "0.8.2-staging.7ac8446",
61
+ "@dxos/invariant": "0.8.2-staging.7ac8446",
62
+ "@dxos/live-object": "0.8.2-staging.7ac8446",
63
+ "@dxos/log": "0.8.2-staging.7ac8446",
64
+ "@dxos/protocols": "0.8.2-staging.7ac8446",
65
+ "@dxos/react-hooks": "0.8.2-staging.7ac8446",
66
+ "@dxos/react-ui-menu": "0.8.2-staging.7ac8446",
67
+ "@dxos/util": "0.8.2-staging.7ac8446"
74
68
  },
75
69
  "devDependencies": {
76
70
  "@phosphor-icons/react": "^2.1.5",
@@ -94,23 +88,23 @@
94
88
  "vite": "5.4.7",
95
89
  "vite-plugin-top-level-await": "^1.4.1",
96
90
  "vite-plugin-wasm": "^3.3.0",
97
- "@dxos/automerge": "0.8.2-main.f11618f",
98
- "@dxos/config": "0.8.2-main.f11618f",
99
- "@dxos/echo-signals": "0.8.2-main.f11618f",
100
- "@dxos/keyboard": "0.8.2-main.f11618f",
101
- "@dxos/react-client": "0.8.2-main.f11618f",
102
- "@dxos/react-ui": "0.8.2-main.f11618f",
103
- "@dxos/storybook-utils": "0.8.2-main.f11618f",
104
- "@dxos/react-ui-theme": "0.8.2-main.f11618f",
105
- "@dxos/random": "0.8.2-main.f11618f"
91
+ "@dxos/automerge": "0.8.2-staging.7ac8446",
92
+ "@dxos/config": "0.8.2-staging.7ac8446",
93
+ "@dxos/echo-signals": "0.8.2-staging.7ac8446",
94
+ "@dxos/keyboard": "0.8.2-staging.7ac8446",
95
+ "@dxos/random": "0.8.2-staging.7ac8446",
96
+ "@dxos/react-client": "0.8.2-staging.7ac8446",
97
+ "@dxos/react-ui": "0.8.2-staging.7ac8446",
98
+ "@dxos/storybook-utils": "0.8.2-staging.7ac8446",
99
+ "@dxos/react-ui-theme": "0.8.2-staging.7ac8446"
106
100
  },
107
101
  "peerDependencies": {
108
102
  "@phosphor-icons/react": "^2.1.5",
109
103
  "react": "~18.2.0",
110
104
  "react-dom": "~18.2.0",
111
- "@dxos/react-client": "0.8.2-main.f11618f",
112
- "@dxos/react-ui": "0.8.2-main.f11618f",
113
- "@dxos/react-ui-theme": "0.8.2-main.f11618f"
105
+ "@dxos/react-client": "0.8.2-staging.7ac8446",
106
+ "@dxos/react-ui-theme": "0.8.2-staging.7ac8446",
107
+ "@dxos/react-ui": "0.8.2-staging.7ac8446"
114
108
  },
115
109
  "publishConfig": {
116
110
  "access": "public"
@@ -10,7 +10,7 @@ import { Toolbar as NaturalToolbar, Select, useThemeContext } from '@dxos/react-
10
10
  import { attentionSurface, mx } from '@dxos/react-ui-theme';
11
11
  import { withLayout, withTheme } from '@dxos/storybook-utils';
12
12
 
13
- import { EditorToolbar, useEditorToolbarState } from '../components';
13
+ import { EditorToolbar, useEditorToolbarState } from './components';
14
14
  import {
15
15
  type EditorInputMode,
16
16
  decorateMarkdown,
@@ -20,9 +20,9 @@ import {
20
20
  createBasicExtensions,
21
21
  createThemeExtensions,
22
22
  InputModeExtensions,
23
- } from '../extensions';
24
- import { useActionHandler, useTextEditor, type UseTextEditorProps } from '../hooks';
25
- import translations from '../translations';
23
+ } from './extensions';
24
+ import { useActionHandler, useTextEditor, type UseTextEditorProps } from './hooks';
25
+ import translations from './translations';
26
26
 
27
27
  type StoryProps = { placeholder?: string; readOnly?: boolean } & UseTextEditorProps;
28
28