@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/translations.ts":{"bytes":4288,"imports":[],"format":"esm"},"src/components/EditorContent/controller.ts":{"bytes":3541,"imports":[],"format":"esm"},"src/hooks/useTextEditor.ts":{"bytes":17751,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":477,"imports":[{"path":"src/hooks/useTextEditor.ts","kind":"import-statement","original":"./useTextEditor"}],"format":"esm"},"src/components/EditorContent/EditorContent.tsx":{"bytes":8977,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"src/components/EditorContent/controller.ts","kind":"import-statement","original":"./controller"}],"format":"esm"},"src/components/EditorContent/index.ts":{"bytes":586,"imports":[{"path":"src/components/EditorContent/controller.ts","kind":"import-statement","original":"./controller"},{"path":"src/components/EditorContent/EditorContent.tsx","kind":"import-statement","original":"./EditorContent"}],"format":"esm"},"src/components/EditorMenuProvider/menu.ts":{"bytes":6114,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/popover.ts":{"bytes":30750,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/menu-presets.ts":{"bytes":12559,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"}],"format":"esm"},"src/components/EditorMenuProvider/EditorMenuProvider.tsx":{"bytes":21761,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/useEditorMenu.ts":{"bytes":18389,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorMenuProvider/menu.ts","kind":"import-statement","original":"./menu"},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"}],"format":"esm"},"src/components/EditorMenuProvider/index.ts":{"bytes":882,"imports":[{"path":"src/components/EditorMenuProvider/menu.ts","kind":"import-statement","original":"./menu"},{"path":"src/components/EditorMenuProvider/menu-presets.ts","kind":"import-statement","original":"./menu-presets"},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"},{"path":"src/components/EditorMenuProvider/EditorMenuProvider.tsx","kind":"import-statement","original":"./EditorMenuProvider"},{"path":"src/components/EditorMenuProvider/useEditorMenu.ts","kind":"import-statement","original":"./useEditorMenu"}],"format":"esm"},"src/components/EditorToolbar/actions.ts":{"bytes":8850,"imports":[{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"src/components/EditorToolbar/blocks.ts":{"bytes":7080,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/formatting.ts":{"bytes":7401,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/headings.ts":{"bytes":7687,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/image.ts":{"bytes":2178,"imports":[{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/search.ts":{"bytes":2432,"imports":[{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/view-mode.ts":{"bytes":5982,"imports":[{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/EditorToolbar.tsx":{"bytes":13903,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"},{"path":"src/components/EditorToolbar/blocks.ts","kind":"import-statement","original":"./blocks"},{"path":"src/components/EditorToolbar/formatting.ts","kind":"import-statement","original":"./formatting"},{"path":"src/components/EditorToolbar/headings.ts","kind":"import-statement","original":"./headings"},{"path":"src/components/EditorToolbar/image.ts","kind":"import-statement","original":"./image"},{"path":"src/components/EditorToolbar/search.ts","kind":"import-statement","original":"./search"},{"path":"src/components/EditorToolbar/view-mode.ts","kind":"import-statement","original":"./view-mode"}],"format":"esm"},"src/components/EditorToolbar/useEditorToolbar.ts":{"bytes":1964,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorToolbar/index.ts":{"bytes":1016,"imports":[{"path":"src/components/EditorToolbar/EditorToolbar.tsx","kind":"import-statement","original":"./EditorToolbar"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"},{"path":"src/components/EditorToolbar/useEditorToolbar.ts","kind":"import-statement","original":"./useEditorToolbar"}],"format":"esm"},"src/components/Editor/Editor.tsx":{"bytes":15022,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/EditorContent/index.ts","kind":"import-statement","original":"../EditorContent"},{"path":"src/components/EditorMenuProvider/index.ts","kind":"import-statement","original":"../EditorMenuProvider"},{"path":"src/components/EditorToolbar/index.ts","kind":"import-statement","original":"../EditorToolbar"}],"format":"esm"},"src/components/Editor/index.ts":{"bytes":470,"imports":[{"path":"src/components/Editor/Editor.tsx","kind":"import-statement","original":"./Editor"}],"format":"esm"},"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx":{"bytes":8575,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorPreviewProvider/index.ts":{"bytes":520,"imports":[{"path":"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx","kind":"import-statement","original":"./EditorPreviewProvider"}],"format":"esm"},"src/components/index.ts":{"bytes":1457,"imports":[{"path":"src/components/Editor/index.ts","kind":"import-statement","original":"./Editor"},{"path":"src/components/EditorContent/index.ts","kind":"import-statement","original":"./EditorContent"},{"path":"src/components/EditorMenuProvider/index.ts","kind":"import-statement","original":"./EditorMenuProvider"},{"path":"src/components/EditorPreviewProvider/index.ts","kind":"import-statement","original":"./EditorPreviewProvider"},{"path":"src/components/EditorToolbar/index.ts","kind":"import-statement","original":"./EditorToolbar"}],"format":"esm"},"src/index.ts":{"bytes":805,"imports":[{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":104875},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["Editor","EditorContent","EditorMenuProvider","EditorPreviewProvider","EditorToolbar","createEditorController","createMenuGroup","filterMenuGroups","formattingCommands","getMenuItem","getNextMenuItem","getPreviousMenuItem","linkSlashCommands","popover","popoverRangeEffect","popoverStateField","translations","useEditorMenu","useEditorPreview","useEditorToolbar","useTextEditor"],"entryPoint":"src/index.ts","inputs":{"src/translations.ts":{"bytesInOutput":1225},"src/components/Editor/Editor.tsx":{"bytesInOutput":2920},"src/components/EditorContent/controller.ts":{"bytesInOutput":665},"src/components/EditorContent/EditorContent.tsx":{"bytesInOutput":1894},"src/hooks/useTextEditor.ts":{"bytesInOutput":4228},"src/components/EditorMenuProvider/menu.ts":{"bytesInOutput":1066},"src/components/EditorMenuProvider/menu-presets.ts":{"bytesInOutput":3394},"src/components/EditorMenuProvider/popover.ts":{"bytesInOutput":6843},"src/components/EditorMenuProvider/EditorMenuProvider.tsx":{"bytesInOutput":5450},"src/components/EditorMenuProvider/useEditorMenu.ts":{"bytesInOutput":4094},"src/components/EditorToolbar/EditorToolbar.tsx":{"bytesInOutput":2546},"src/components/EditorToolbar/actions.ts":{"bytesInOutput":1875},"src/components/EditorToolbar/blocks.ts":{"bytesInOutput":1524},"src/components/EditorToolbar/formatting.ts":{"bytesInOutput":1553},"src/components/EditorToolbar/headings.ts":{"bytesInOutput":1706},"src/components/EditorToolbar/image.ts":{"bytesInOutput":348},"src/components/EditorToolbar/search.ts":{"bytesInOutput":395},"src/components/EditorToolbar/view-mode.ts":{"bytesInOutput":1188},"src/components/EditorToolbar/index.ts":{"bytesInOutput":0},"src/components/EditorToolbar/useEditorToolbar.ts":{"bytesInOutput":208},"src/components/index.ts":{"bytesInOutput":0},"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx":{"bytesInOutput":1929},"src/index.ts":{"bytesInOutput":0}},"bytes":46625}}}
|
|
1
|
+
{"inputs":{"src/translations.ts":{"bytes":4288,"imports":[],"format":"esm"},"src/components/EditorContent/controller.ts":{"bytes":3541,"imports":[],"format":"esm"},"src/hooks/useTextEditor.ts":{"bytes":17751,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":477,"imports":[{"path":"src/hooks/useTextEditor.ts","kind":"import-statement","original":"./useTextEditor"}],"format":"esm"},"src/components/EditorContent/EditorContent.tsx":{"bytes":8985,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"src/components/EditorContent/controller.ts","kind":"import-statement","original":"./controller"}],"format":"esm"},"src/components/EditorContent/index.ts":{"bytes":586,"imports":[{"path":"src/components/EditorContent/controller.ts","kind":"import-statement","original":"./controller"},{"path":"src/components/EditorContent/EditorContent.tsx","kind":"import-statement","original":"./EditorContent"}],"format":"esm"},"src/components/EditorMenuProvider/menu.ts":{"bytes":6114,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/popover.ts":{"bytes":30750,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/menu-presets.ts":{"bytes":12559,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"}],"format":"esm"},"src/components/EditorMenuProvider/EditorMenuProvider.tsx":{"bytes":21357,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorMenuProvider/useEditorMenu.ts":{"bytes":19470,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorMenuProvider/menu.ts","kind":"import-statement","original":"./menu"},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"}],"format":"esm"},"src/components/EditorMenuProvider/index.ts":{"bytes":882,"imports":[{"path":"src/components/EditorMenuProvider/menu.ts","kind":"import-statement","original":"./menu"},{"path":"src/components/EditorMenuProvider/menu-presets.ts","kind":"import-statement","original":"./menu-presets"},{"path":"src/components/EditorMenuProvider/popover.ts","kind":"import-statement","original":"./popover"},{"path":"src/components/EditorMenuProvider/EditorMenuProvider.tsx","kind":"import-statement","original":"./EditorMenuProvider"},{"path":"src/components/EditorMenuProvider/useEditorMenu.ts","kind":"import-statement","original":"./useEditorMenu"}],"format":"esm"},"src/components/EditorToolbar/actions.ts":{"bytes":9020,"imports":[{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"src/components/EditorToolbar/blocks.ts":{"bytes":7250,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/formatting.ts":{"bytes":7571,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/headings.ts":{"bytes":7823,"imports":[{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/image.ts":{"bytes":2293,"imports":[{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/search.ts":{"bytes":2551,"imports":[{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/view-mode.ts":{"bytes":6156,"imports":[{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"}],"format":"esm"},"src/components/EditorToolbar/EditorToolbar.tsx":{"bytes":13166,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"},{"path":"src/components/EditorToolbar/blocks.ts","kind":"import-statement","original":"./blocks"},{"path":"src/components/EditorToolbar/formatting.ts","kind":"import-statement","original":"./formatting"},{"path":"src/components/EditorToolbar/headings.ts","kind":"import-statement","original":"./headings"},{"path":"src/components/EditorToolbar/image.ts","kind":"import-statement","original":"./image"},{"path":"src/components/EditorToolbar/search.ts","kind":"import-statement","original":"./search"},{"path":"src/components/EditorToolbar/view-mode.ts","kind":"import-statement","original":"./view-mode"}],"format":"esm"},"src/components/EditorToolbar/useEditorToolbar.ts":{"bytes":1964,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorToolbar/index.ts":{"bytes":1016,"imports":[{"path":"src/components/EditorToolbar/EditorToolbar.tsx","kind":"import-statement","original":"./EditorToolbar"},{"path":"src/components/EditorToolbar/actions.ts","kind":"import-statement","original":"./actions"},{"path":"src/components/EditorToolbar/useEditorToolbar.ts","kind":"import-statement","original":"./useEditorToolbar"}],"format":"esm"},"src/components/Editor/Editor.tsx":{"bytes":15666,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/EditorContent/index.ts","kind":"import-statement","original":"../EditorContent"},{"path":"src/components/EditorMenuProvider/index.ts","kind":"import-statement","original":"../EditorMenuProvider"},{"path":"src/components/EditorToolbar/index.ts","kind":"import-statement","original":"../EditorToolbar"}],"format":"esm"},"src/components/Editor/index.ts":{"bytes":470,"imports":[{"path":"src/components/Editor/Editor.tsx","kind":"import-statement","original":"./Editor"}],"format":"esm"},"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx":{"bytes":8426,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/EditorPreviewProvider/index.ts":{"bytes":520,"imports":[{"path":"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx","kind":"import-statement","original":"./EditorPreviewProvider"}],"format":"esm"},"src/components/index.ts":{"bytes":1457,"imports":[{"path":"src/components/Editor/index.ts","kind":"import-statement","original":"./Editor"},{"path":"src/components/EditorContent/index.ts","kind":"import-statement","original":"./EditorContent"},{"path":"src/components/EditorMenuProvider/index.ts","kind":"import-statement","original":"./EditorMenuProvider"},{"path":"src/components/EditorPreviewProvider/index.ts","kind":"import-statement","original":"./EditorPreviewProvider"},{"path":"src/components/EditorToolbar/index.ts","kind":"import-statement","original":"./EditorToolbar"}],"format":"esm"},"src/index.ts":{"bytes":805,"imports":[{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":105391},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/react-ui-menu","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@codemirror/search","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["Editor","EditorContent","EditorMenuProvider","EditorPreviewProvider","EditorToolbar","createEditorController","createMenuGroup","filterMenuGroups","formattingCommands","getMenuItem","getNextMenuItem","getPreviousMenuItem","linkSlashCommands","popover","popoverRangeEffect","popoverStateField","translations","useEditorMenu","useEditorPreview","useEditorToolbar","useTextEditor"],"entryPoint":"src/index.ts","inputs":{"src/translations.ts":{"bytesInOutput":1225},"src/components/Editor/Editor.tsx":{"bytesInOutput":3048},"src/components/EditorContent/controller.ts":{"bytesInOutput":665},"src/components/EditorContent/EditorContent.tsx":{"bytesInOutput":1898},"src/hooks/useTextEditor.ts":{"bytesInOutput":4228},"src/components/EditorMenuProvider/menu.ts":{"bytesInOutput":1066},"src/components/EditorMenuProvider/menu-presets.ts":{"bytesInOutput":3394},"src/components/EditorMenuProvider/popover.ts":{"bytesInOutput":6843},"src/components/EditorMenuProvider/EditorMenuProvider.tsx":{"bytesInOutput":5489},"src/components/EditorMenuProvider/useEditorMenu.ts":{"bytesInOutput":4334},"src/components/EditorToolbar/EditorToolbar.tsx":{"bytesInOutput":2342},"src/components/EditorToolbar/actions.ts":{"bytesInOutput":1929},"src/components/EditorToolbar/blocks.ts":{"bytesInOutput":1578},"src/components/EditorToolbar/formatting.ts":{"bytesInOutput":1607},"src/components/EditorToolbar/headings.ts":{"bytesInOutput":1746},"src/components/EditorToolbar/image.ts":{"bytesInOutput":373},"src/components/EditorToolbar/search.ts":{"bytesInOutput":420},"src/components/EditorToolbar/view-mode.ts":{"bytesInOutput":1242},"src/components/EditorToolbar/index.ts":{"bytesInOutput":0},"src/components/EditorToolbar/useEditorToolbar.ts":{"bytesInOutput":208},"src/components/index.ts":{"bytesInOutput":0},"src/components/EditorPreviewProvider/EditorPreviewProvider.tsx":{"bytesInOutput":1900},"src/index.ts":{"bytesInOutput":0}},"bytes":47109}}}
|
|
@@ -298,7 +298,7 @@ var EditorContent = /* @__PURE__ */ forwardRef(({ classNames, id, extensions, se
|
|
|
298
298
|
]);
|
|
299
299
|
return /* @__PURE__ */ React.createElement("div", {
|
|
300
300
|
role: "none",
|
|
301
|
-
className: mx("
|
|
301
|
+
className: mx("w-full outline-hidden focus:border-accent-surface focus-within:border-neutral-focus-indicator", classNames),
|
|
302
302
|
ref: parentRef,
|
|
303
303
|
...focusable ? focusAttributes : {}
|
|
304
304
|
});
|
|
@@ -704,7 +704,7 @@ import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
|
704
704
|
import React2, { Fragment, useCallback as useCallback2, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
|
|
705
705
|
import { addEventListener } from "@dxos/async";
|
|
706
706
|
import { invariant } from "@dxos/invariant";
|
|
707
|
-
import { DX_ANCHOR_ACTIVATE, Icon, Popover, toLocalizedString, useDynamicRef, useThemeContext, useTranslation } from "@dxos/react-ui";
|
|
707
|
+
import { DX_ANCHOR_ACTIVATE, Icon, Popover, ScrollArea, toLocalizedString, useDynamicRef, useThemeContext, useTranslation } from "@dxos/react-ui";
|
|
708
708
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-editor/src/components/EditorMenuProvider/EditorMenuProvider.tsx";
|
|
709
709
|
var EditorMenuProvider = ({ children, view, groups, currentItem, open: openProp, defaultOpen, numItems = 8, onOpenChange, onActivate, onSelect, onCancel }) => {
|
|
710
710
|
const { tx } = useThemeContext();
|
|
@@ -716,7 +716,7 @@ var EditorMenuProvider = ({ children, view, groups, currentItem, open: openProp,
|
|
|
716
716
|
onChange: (open2) => {
|
|
717
717
|
invariant(viewRef.current, void 0, {
|
|
718
718
|
F: __dxlog_file2,
|
|
719
|
-
L:
|
|
719
|
+
L: 66,
|
|
720
720
|
S: void 0,
|
|
721
721
|
A: [
|
|
722
722
|
"viewRef.current",
|
|
@@ -735,8 +735,8 @@ var EditorMenuProvider = ({ children, view, groups, currentItem, open: openProp,
|
|
|
735
735
|
return;
|
|
736
736
|
}
|
|
737
737
|
return addEventListener(root, DX_ANCHOR_ACTIVATE, (event) => {
|
|
738
|
-
const { trigger,
|
|
739
|
-
if (!
|
|
738
|
+
const { trigger, dxn } = event;
|
|
739
|
+
if (!dxn) {
|
|
740
740
|
triggerRef.current = trigger;
|
|
741
741
|
if (onActivate) {
|
|
742
742
|
onActivate({
|
|
@@ -758,7 +758,7 @@ var EditorMenuProvider = ({ children, view, groups, currentItem, open: openProp,
|
|
|
758
758
|
const handleSelect = useCallback2((item) => {
|
|
759
759
|
invariant(viewRef.current, void 0, {
|
|
760
760
|
F: __dxlog_file2,
|
|
761
|
-
L:
|
|
761
|
+
L: 101,
|
|
762
762
|
S: void 0,
|
|
763
763
|
A: [
|
|
764
764
|
"viewRef.current",
|
|
@@ -782,34 +782,36 @@ var EditorMenuProvider = ({ children, view, groups, currentItem, open: openProp,
|
|
|
782
782
|
virtualRef: triggerRef
|
|
783
783
|
}), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
|
|
784
784
|
align: "start",
|
|
785
|
-
classNames:
|
|
786
|
-
|
|
787
|
-
}, [
|
|
788
|
-
"overflow-y-auto",
|
|
785
|
+
classNames: [
|
|
786
|
+
"flex flex-col",
|
|
789
787
|
!menuGroups.length && "hidden"
|
|
790
|
-
]
|
|
788
|
+
],
|
|
791
789
|
style: {
|
|
792
790
|
maxBlockSize: 36 * numItems + 10
|
|
793
791
|
},
|
|
794
|
-
|
|
795
|
-
* NOTE: We keep the focus in the editor, but Radix routes escape key.
|
|
796
|
-
*/
|
|
792
|
+
// NOTE: We keep the focus in the editor, but Radix routes escape key.
|
|
797
793
|
onEscapeKeyDown: () => {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
794
|
+
const currentView = viewRef.current;
|
|
795
|
+
if (currentView) {
|
|
796
|
+
onCancel?.({
|
|
797
|
+
view: currentView
|
|
798
|
+
});
|
|
799
|
+
}
|
|
801
800
|
},
|
|
802
801
|
onOpenAutoFocus: (event) => event.preventDefault()
|
|
803
802
|
}, /* @__PURE__ */ React2.createElement(Popover.Viewport, {
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
asChild: true,
|
|
804
|
+
classNames: "dx-container"
|
|
805
|
+
}, /* @__PURE__ */ React2.createElement(ScrollArea.Root, {
|
|
806
|
+
thin: true
|
|
807
|
+
}, /* @__PURE__ */ React2.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React2.createElement(Menu, {
|
|
806
808
|
groups: menuGroups,
|
|
807
809
|
currentItem,
|
|
808
810
|
onSelect: handleSelect
|
|
809
|
-
})), /* @__PURE__ */ React2.createElement(Popover.Arrow, null))), /* @__PURE__ */ React2.createElement("div", {
|
|
810
|
-
ref: setRoot,
|
|
811
|
+
})))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null))), /* @__PURE__ */ React2.createElement("div", {
|
|
811
812
|
role: "none",
|
|
812
|
-
className: "contents"
|
|
813
|
+
className: "contents",
|
|
814
|
+
ref: setRoot
|
|
813
815
|
}, children));
|
|
814
816
|
};
|
|
815
817
|
var Menu = ({ groups, currentItem, onSelect }) => {
|
|
@@ -821,14 +823,14 @@ var Menu = ({ groups, currentItem, onSelect }) => {
|
|
|
821
823
|
currentItem,
|
|
822
824
|
onSelect
|
|
823
825
|
}), index < groups.length - 1 && /* @__PURE__ */ React2.createElement("div", {
|
|
824
|
-
className: tx("menu.separator",
|
|
826
|
+
className: tx("menu.separator", {})
|
|
825
827
|
}))));
|
|
826
828
|
};
|
|
827
829
|
var MenuGroup = ({ group, currentItem, onSelect }) => {
|
|
828
830
|
const { tx } = useThemeContext();
|
|
829
831
|
const { t } = useTranslation();
|
|
830
832
|
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, group.label && /* @__PURE__ */ React2.createElement("div", {
|
|
831
|
-
className: tx("menu.groupLabel",
|
|
833
|
+
className: tx("menu.groupLabel", {})
|
|
832
834
|
}, /* @__PURE__ */ React2.createElement("span", null, toLocalizedString(group.label, t))), group.items.map((item) => /* @__PURE__ */ React2.createElement(MenuItem, {
|
|
833
835
|
key: item.id,
|
|
834
836
|
item,
|
|
@@ -856,8 +858,8 @@ var MenuItem = ({ item, current, onSelect }) => {
|
|
|
856
858
|
]);
|
|
857
859
|
return /* @__PURE__ */ React2.createElement("li", {
|
|
858
860
|
ref: listRef,
|
|
859
|
-
className: tx("menu.item",
|
|
860
|
-
current && "bg-
|
|
861
|
+
className: tx("menu.item", {}, [
|
|
862
|
+
current && "bg-hover-surface"
|
|
861
863
|
]),
|
|
862
864
|
onClick: handleSelect
|
|
863
865
|
}, item.icon && /* @__PURE__ */ React2.createElement(Icon, {
|
|
@@ -936,10 +938,21 @@ var useEditorMenu = ({ trigger, triggerKey, placeholder: placeholder2, filter =
|
|
|
936
938
|
handleOpenChange
|
|
937
939
|
]);
|
|
938
940
|
const handleSelect = useCallback3(({ view, item }) => {
|
|
941
|
+
const { range } = view.state.field(popoverStateField) ?? {};
|
|
942
|
+
if (range) {
|
|
943
|
+
view.dispatch({
|
|
944
|
+
changes: {
|
|
945
|
+
from: range.from,
|
|
946
|
+
to: range.to,
|
|
947
|
+
insert: ""
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
}
|
|
939
951
|
void item.onSelect?.({
|
|
940
952
|
view,
|
|
941
953
|
head: view.state.selection.main.head
|
|
942
954
|
});
|
|
955
|
+
view.focus();
|
|
943
956
|
}, []);
|
|
944
957
|
const handleCancel = useCallback3(({ view }) => {
|
|
945
958
|
const { range, trigger: trigger2 } = view.state.field(popoverStateField) ?? {};
|
|
@@ -1021,7 +1034,7 @@ var useEditorMenu = ({ trigger, triggerKey, placeholder: placeholder2, filter =
|
|
|
1021
1034
|
import { Atom } from "@effect-atom/atom-react";
|
|
1022
1035
|
import React3, { memo, useMemo as useMemo3 } from "react";
|
|
1023
1036
|
import { ElevationProvider } from "@dxos/react-ui";
|
|
1024
|
-
import {
|
|
1037
|
+
import { Menu as Menu2, MenuBuilder, useMenuActions } from "@dxos/react-ui-menu";
|
|
1025
1038
|
|
|
1026
1039
|
// src/components/EditorToolbar/actions.ts
|
|
1027
1040
|
import { createMenuAction, createMenuItemGroup } from "@dxos/react-ui-menu";
|
|
@@ -1043,11 +1056,13 @@ var createLists = (state, getView) => {
|
|
|
1043
1056
|
edges: [
|
|
1044
1057
|
{
|
|
1045
1058
|
source: "root",
|
|
1046
|
-
target: "list"
|
|
1059
|
+
target: "list",
|
|
1060
|
+
relation: "child"
|
|
1047
1061
|
},
|
|
1048
1062
|
...listActionsMap.map(({ id }) => ({
|
|
1049
1063
|
source: listGroupAction.id,
|
|
1050
|
-
target: id
|
|
1064
|
+
target: id,
|
|
1065
|
+
relation: "child"
|
|
1051
1066
|
}))
|
|
1052
1067
|
]
|
|
1053
1068
|
};
|
|
@@ -1151,11 +1166,13 @@ var createBlocks = (state, getView) => {
|
|
|
1151
1166
|
edges: [
|
|
1152
1167
|
{
|
|
1153
1168
|
source: "root",
|
|
1154
|
-
target: "block"
|
|
1169
|
+
target: "block",
|
|
1170
|
+
relation: "child"
|
|
1155
1171
|
},
|
|
1156
1172
|
...blockActions.map(({ id }) => ({
|
|
1157
1173
|
source: blockGroupAction.id,
|
|
1158
|
-
target: id
|
|
1174
|
+
target: id,
|
|
1175
|
+
relation: "child"
|
|
1159
1176
|
}))
|
|
1160
1177
|
]
|
|
1161
1178
|
};
|
|
@@ -1204,11 +1221,13 @@ var createFormatting = (state, getView) => {
|
|
|
1204
1221
|
edges: [
|
|
1205
1222
|
{
|
|
1206
1223
|
source: "root",
|
|
1207
|
-
target: "formatting"
|
|
1224
|
+
target: "formatting",
|
|
1225
|
+
relation: "child"
|
|
1208
1226
|
},
|
|
1209
1227
|
...formattingActions.map(({ id }) => ({
|
|
1210
1228
|
source: formattingGroupAction.id,
|
|
1211
|
-
target: id
|
|
1229
|
+
target: id,
|
|
1230
|
+
relation: "child"
|
|
1212
1231
|
}))
|
|
1213
1232
|
]
|
|
1214
1233
|
};
|
|
@@ -1224,13 +1243,13 @@ var createHeadingGroupAction = (value) => createEditorActionGroup("heading", {
|
|
|
1224
1243
|
value
|
|
1225
1244
|
}, "ph--text-h--regular");
|
|
1226
1245
|
var createHeadingActions = (currentLevel, getView) => Object.entries({
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1246
|
+
0: "ph--paragraph--regular",
|
|
1247
|
+
1: "ph--text-h-one--regular",
|
|
1248
|
+
2: "ph--text-h-two--regular",
|
|
1249
|
+
3: "ph--text-h-three--regular",
|
|
1250
|
+
4: "ph--text-h-four--regular",
|
|
1251
|
+
5: "ph--text-h-five--regular",
|
|
1252
|
+
6: "ph--text-h-six--regular"
|
|
1234
1253
|
}).map(([levelStr, icon]) => {
|
|
1235
1254
|
const level = parseInt(levelStr);
|
|
1236
1255
|
return createEditorAction(`heading--${levelStr}`, {
|
|
@@ -1262,11 +1281,13 @@ var createHeadings = (state, getView) => {
|
|
|
1262
1281
|
edges: [
|
|
1263
1282
|
{
|
|
1264
1283
|
source: "root",
|
|
1265
|
-
target: "heading"
|
|
1284
|
+
target: "heading",
|
|
1285
|
+
relation: "child"
|
|
1266
1286
|
},
|
|
1267
1287
|
...headingActions.map(({ id }) => ({
|
|
1268
1288
|
source: headingGroupAction.id,
|
|
1269
|
-
target: id
|
|
1289
|
+
target: id,
|
|
1290
|
+
relation: "child"
|
|
1270
1291
|
}))
|
|
1271
1292
|
]
|
|
1272
1293
|
};
|
|
@@ -1284,7 +1305,8 @@ var createImageUpload = (onImageUpload) => ({
|
|
|
1284
1305
|
edges: [
|
|
1285
1306
|
{
|
|
1286
1307
|
source: "root",
|
|
1287
|
-
target: "image"
|
|
1308
|
+
target: "image",
|
|
1309
|
+
relation: "child"
|
|
1288
1310
|
}
|
|
1289
1311
|
]
|
|
1290
1312
|
});
|
|
@@ -1302,7 +1324,8 @@ var createSearch = (getView) => ({
|
|
|
1302
1324
|
edges: [
|
|
1303
1325
|
{
|
|
1304
1326
|
source: "root",
|
|
1305
|
-
target: "search"
|
|
1327
|
+
target: "search",
|
|
1328
|
+
relation: "child"
|
|
1306
1329
|
}
|
|
1307
1330
|
]
|
|
1308
1331
|
});
|
|
@@ -1343,11 +1366,13 @@ var createViewMode = (state, onViewModeChange) => {
|
|
|
1343
1366
|
edges: [
|
|
1344
1367
|
{
|
|
1345
1368
|
source: "root",
|
|
1346
|
-
target: "viewMode"
|
|
1369
|
+
target: "viewMode",
|
|
1370
|
+
relation: "child"
|
|
1347
1371
|
},
|
|
1348
1372
|
...viewModeActions.map(({ id }) => ({
|
|
1349
1373
|
source: viewModeGroupAction.id,
|
|
1350
|
-
target: id
|
|
1374
|
+
target: id,
|
|
1375
|
+
relation: "child"
|
|
1351
1376
|
}))
|
|
1352
1377
|
]
|
|
1353
1378
|
};
|
|
@@ -1358,11 +1383,11 @@ var EditorToolbar = /* @__PURE__ */ memo(({ classNames, role, attendableId, onAc
|
|
|
1358
1383
|
const menuProps = useEditorToolbarActionGraph(props);
|
|
1359
1384
|
return /* @__PURE__ */ React3.createElement(ElevationProvider, {
|
|
1360
1385
|
elevation: role === "section" ? "positioned" : "base"
|
|
1361
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
1386
|
+
}, /* @__PURE__ */ React3.createElement(Menu2.Root, {
|
|
1362
1387
|
...menuProps,
|
|
1363
1388
|
attendableId,
|
|
1364
1389
|
onAction
|
|
1365
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
1390
|
+
}, /* @__PURE__ */ React3.createElement(Menu2.Toolbar, {
|
|
1366
1391
|
classNames,
|
|
1367
1392
|
textBlockWidth: true
|
|
1368
1393
|
})));
|
|
@@ -1389,41 +1414,34 @@ var useEditorToolbarActionGraph = ({ state, getView, customActions, ...features
|
|
|
1389
1414
|
};
|
|
1390
1415
|
var createToolbarActions = ({ state, getView, customActions, ...features }) => {
|
|
1391
1416
|
return Atom.make((get) => {
|
|
1392
|
-
const graph = {
|
|
1393
|
-
nodes: [],
|
|
1394
|
-
edges: []
|
|
1395
|
-
};
|
|
1396
|
-
const addSubGraph = (graph2, subGraph) => {
|
|
1397
|
-
graph2.nodes.push(...subGraph.nodes);
|
|
1398
|
-
graph2.edges.push(...subGraph.edges);
|
|
1399
|
-
};
|
|
1400
1417
|
const stateSnapshot = get(state);
|
|
1418
|
+
const builder = MenuBuilder.make();
|
|
1401
1419
|
if (features?.showHeadings ?? true) {
|
|
1402
|
-
|
|
1420
|
+
builder.subgraph(createHeadings(stateSnapshot, getView));
|
|
1403
1421
|
}
|
|
1404
1422
|
if (features?.showFormatting ?? true) {
|
|
1405
|
-
|
|
1423
|
+
builder.subgraph(createFormatting(stateSnapshot, getView));
|
|
1406
1424
|
}
|
|
1407
1425
|
if (features?.showLists ?? true) {
|
|
1408
|
-
|
|
1426
|
+
builder.subgraph(createLists(stateSnapshot, getView));
|
|
1409
1427
|
}
|
|
1410
1428
|
if (features?.showBlocks ?? true) {
|
|
1411
|
-
|
|
1429
|
+
builder.subgraph(createBlocks(stateSnapshot, getView));
|
|
1412
1430
|
}
|
|
1413
1431
|
if (features?.onImageUpload) {
|
|
1414
|
-
|
|
1432
|
+
builder.subgraph(createImageUpload(features.onImageUpload));
|
|
1415
1433
|
}
|
|
1416
|
-
|
|
1434
|
+
builder.separator("gap");
|
|
1417
1435
|
if (customActions) {
|
|
1418
|
-
|
|
1436
|
+
builder.subgraph(get(customActions));
|
|
1419
1437
|
}
|
|
1420
1438
|
if (features?.showSearch ?? true) {
|
|
1421
|
-
|
|
1439
|
+
builder.subgraph(createSearch(getView));
|
|
1422
1440
|
}
|
|
1423
1441
|
if (features?.onViewModeChange) {
|
|
1424
|
-
|
|
1442
|
+
builder.subgraph(createViewMode(stateSnapshot, features.onViewModeChange));
|
|
1425
1443
|
}
|
|
1426
|
-
return
|
|
1444
|
+
return builder.build();
|
|
1427
1445
|
});
|
|
1428
1446
|
};
|
|
1429
1447
|
|
|
@@ -1465,15 +1483,17 @@ var EditorRoot = /* @__PURE__ */ forwardRef2(({ children, extensions: extensions
|
|
|
1465
1483
|
}, children));
|
|
1466
1484
|
});
|
|
1467
1485
|
EditorRoot.displayName = "Editor.Root";
|
|
1486
|
+
var EDITOR_VIEWPORT_NAME = "Editor.Viewport";
|
|
1468
1487
|
var EditorViewport = ({ classNames, children }) => {
|
|
1469
1488
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
1470
1489
|
role: "none",
|
|
1471
|
-
className: mx2("grid grid-rows-[min-content_1fr]
|
|
1490
|
+
className: mx2("grid grid-rows-[min-content_1fr] h-full overflow-hidden", classNames)
|
|
1472
1491
|
}, children);
|
|
1473
1492
|
};
|
|
1474
|
-
EditorViewport.displayName =
|
|
1493
|
+
EditorViewport.displayName = EDITOR_VIEWPORT_NAME;
|
|
1494
|
+
var EDITOR_CONTENT_NAME = "Editor.Content";
|
|
1475
1495
|
var EditorContent2 = ({ extensions: providedExtensions, ...props }) => {
|
|
1476
|
-
const { extensions: additionalExtensions = [], setController } = useEditorContext(
|
|
1496
|
+
const { extensions: additionalExtensions = [], setController } = useEditorContext(EDITOR_CONTENT_NAME);
|
|
1477
1497
|
const extensions = useMemo5(() => [
|
|
1478
1498
|
additionalExtensions,
|
|
1479
1499
|
providedExtensions
|
|
@@ -1487,13 +1507,14 @@ var EditorContent2 = ({ extensions: providedExtensions, ...props }) => {
|
|
|
1487
1507
|
ref: setController
|
|
1488
1508
|
});
|
|
1489
1509
|
};
|
|
1490
|
-
EditorContent2.displayName =
|
|
1510
|
+
EditorContent2.displayName = EDITOR_CONTENT_NAME;
|
|
1511
|
+
var EDITOR_TOOLBAR_NAME = "Editor.Toolbar";
|
|
1491
1512
|
var EditorToolbar2 = (props) => {
|
|
1492
|
-
const { controller, state } = useEditorContext(
|
|
1513
|
+
const { controller, state } = useEditorContext(EDITOR_TOOLBAR_NAME);
|
|
1493
1514
|
const getView = useCallback4(() => {
|
|
1494
1515
|
invariant3(controller?.view, void 0, {
|
|
1495
1516
|
F: __dxlog_file4,
|
|
1496
|
-
L:
|
|
1517
|
+
L: 146,
|
|
1497
1518
|
S: void 0,
|
|
1498
1519
|
A: [
|
|
1499
1520
|
"controller?.view",
|
|
@@ -1510,7 +1531,7 @@ var EditorToolbar2 = (props) => {
|
|
|
1510
1531
|
state
|
|
1511
1532
|
});
|
|
1512
1533
|
};
|
|
1513
|
-
EditorToolbar2.displayName =
|
|
1534
|
+
EditorToolbar2.displayName = EDITOR_TOOLBAR_NAME;
|
|
1514
1535
|
var Editor = {
|
|
1515
1536
|
Root: EditorRoot,
|
|
1516
1537
|
Viewport: EditorViewport,
|
|
@@ -1529,20 +1550,20 @@ var EditorPreviewProvider = ({ children, onLookup }) => {
|
|
|
1529
1550
|
const [value, setValue] = useState5({});
|
|
1530
1551
|
const [open, setOpen] = useState5(false);
|
|
1531
1552
|
const handleActivate = useCallback5((event) => {
|
|
1532
|
-
const {
|
|
1553
|
+
const { dxn, label, trigger } = event;
|
|
1533
1554
|
setValue((value2) => ({
|
|
1534
1555
|
...value2,
|
|
1535
1556
|
link: {
|
|
1536
1557
|
label,
|
|
1537
|
-
|
|
1558
|
+
dxn
|
|
1538
1559
|
},
|
|
1539
1560
|
pending: true
|
|
1540
1561
|
}));
|
|
1541
|
-
triggerRef.current =
|
|
1562
|
+
triggerRef.current = trigger;
|
|
1542
1563
|
queueMicrotask(() => setOpen(true));
|
|
1543
1564
|
void onLookup?.({
|
|
1544
1565
|
label,
|
|
1545
|
-
|
|
1566
|
+
dxn
|
|
1546
1567
|
}).then((target) => setValue((value2) => ({
|
|
1547
1568
|
...value2,
|
|
1548
1569
|
target: target ?? void 0,
|
|
@@ -1574,9 +1595,9 @@ var EditorPreviewProvider = ({ children, onLookup }) => {
|
|
|
1574
1595
|
}, /* @__PURE__ */ React5.createElement(Popover2.VirtualTrigger, {
|
|
1575
1596
|
virtualRef: triggerRef
|
|
1576
1597
|
}), /* @__PURE__ */ React5.createElement("div", {
|
|
1577
|
-
ref: setRoot,
|
|
1578
1598
|
role: "none",
|
|
1579
|
-
className: "contents"
|
|
1599
|
+
className: "contents",
|
|
1600
|
+
ref: setRoot
|
|
1580
1601
|
}, children)));
|
|
1581
1602
|
};
|
|
1582
1603
|
export {
|