@dxos/react-ui-editor 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
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 +100 -79
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +100 -79
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Editor/Editor.d.ts.map +1 -1
- package/dist/types/src/components/EditorMenuProvider/EditorMenuProvider.d.ts.map +1 -1
- package/dist/types/src/components/EditorMenuProvider/useEditorMenu.d.ts.map +1 -1
- package/dist/types/src/components/EditorPreviewProvider/EditorPreviewProvider.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/actions.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/actions.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/blocks.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/blocks.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/formatting.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/formatting.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/headings.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/headings.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/image.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/image.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/search.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/search.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts +1 -0
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts.map +1 -1
- package/dist/types/src/stories/Automerge.stories.d.ts +1 -0
- package/dist/types/src/stories/Automerge.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Comments.stories.d.ts +1 -1
- package/dist/types/src/stories/Experimental.stories.d.ts +1 -1
- package/dist/types/src/stories/Markdown.stories.d.ts +1 -1
- package/dist/types/src/stories/Preview.stories.d.ts +1 -1
- package/dist/types/src/stories/Preview.stories.d.ts.map +1 -1
- package/dist/types/src/stories/TextEditor.stories.d.ts +1 -1
- package/dist/types/src/stories/components/EditorStory.d.ts +2 -2
- package/dist/types/src/stories/components/EditorStory.d.ts.map +1 -1
- package/dist/types/src/stories/components/util.d.ts +3 -3
- package/dist/types/src/stories/components/util.d.ts.map +1 -1
- package/dist/types/src/util/react.d.ts +1 -4
- package/dist/types/src/util/react.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -45
- package/src/components/Editor/Editor.stories.tsx +1 -1
- package/src/components/Editor/Editor.tsx +12 -6
- package/src/components/EditorContent/EditorContent.tsx +1 -1
- package/src/components/EditorMenuProvider/EditorMenuProvider.tsx +19 -24
- package/src/components/EditorMenuProvider/useEditorMenu.ts +6 -0
- package/src/components/EditorPreviewProvider/EditorPreviewProvider.tsx +5 -7
- package/src/components/EditorToolbar/EditorToolbar.tsx +17 -33
- package/src/components/EditorToolbar/actions.ts +2 -2
- package/src/components/EditorToolbar/blocks.ts +2 -2
- package/src/components/EditorToolbar/formatting.ts +2 -2
- package/src/components/EditorToolbar/headings.ts +9 -9
- package/src/components/EditorToolbar/image.ts +2 -2
- package/src/components/EditorToolbar/search.ts +2 -2
- package/src/components/EditorToolbar/view-mode.ts +2 -2
- package/src/stories/Automerge.stories.tsx +8 -10
- package/src/stories/CommandDialog.stories.tsx +5 -5
- package/src/stories/Comments.stories.tsx +4 -4
- package/src/stories/EditorToolbar.stories.tsx +4 -4
- package/src/stories/Experimental.stories.tsx +3 -3
- package/src/stories/Markdown.stories.tsx +2 -2
- package/src/stories/Outliner.stories.tsx +2 -2
- package/src/stories/Popover.stories.tsx +3 -3
- package/src/stories/Preview.stories.tsx +57 -47
- package/src/stories/Tags.stories.tsx +5 -5
- package/src/stories/TextEditor.stories.tsx +2 -2
- package/src/stories/Theme.stories.tsx +2 -2
- package/src/stories/components/EditorStory.tsx +3 -5
- package/src/stories/components/util.tsx +19 -22
- package/src/util/react.tsx +2 -11
package/src/util/react.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type FC
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
6
|
import { createRoot } from 'react-dom/client';
|
|
7
7
|
|
|
8
8
|
import { ThemeProvider, Tooltip } from '@dxos/react-ui';
|
|
@@ -14,22 +14,13 @@ import { defaultTx } from '@dxos/ui-theme';
|
|
|
14
14
|
*/
|
|
15
15
|
export const str = (...lines: string[]) => lines.join('\n');
|
|
16
16
|
|
|
17
|
-
/** @deprecated */
|
|
18
|
-
// TODO(wittjosiah): Replace with portals which are lighter weight and inherit context from the main react tree.
|
|
19
|
-
export const renderRoot = <T extends Element>(root: T, node: ReactNode): T => {
|
|
20
|
-
createRoot(root).render(<ThemeProvider tx={defaultTx}>{node}</ThemeProvider>);
|
|
21
|
-
return root;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
17
|
/**
|
|
25
|
-
* Utility to create a renderer for a React component.
|
|
26
18
|
* @deprecated
|
|
27
19
|
*/
|
|
28
20
|
export const createRenderer =
|
|
29
21
|
<TProps extends object>(Component: FC<TProps>): RenderCallback<TProps> =>
|
|
30
22
|
(el, props) => {
|
|
31
|
-
|
|
32
|
-
el,
|
|
23
|
+
createRoot(el).render(
|
|
33
24
|
<ThemeProvider tx={defaultTx}>
|
|
34
25
|
<Tooltip.Provider>
|
|
35
26
|
<Component {...props} />
|