@dxos/react-ui-editor 0.8.3 → 0.8.4-main.1f223c7
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/chunk-22UMM3QJ.mjs +22 -0
- package/dist/lib/browser/chunk-22UMM3QJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2498 -1380
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +72 -2
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/types/index.mjs +13 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YXYQPV6R.mjs +24 -0
- package/dist/lib/node-esm/chunk-YXYQPV6R.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2500 -1383
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +72 -2
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/types/index.mjs +14 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/components/{Popover → CommandMenu}/CommandMenu.d.ts +10 -6
- package/dist/types/src/components/CommandMenu/CommandMenu.d.ts.map +1 -0
- package/dist/types/src/components/CommandMenu/index.d.ts +2 -0
- package/dist/types/src/components/CommandMenu/index.d.ts.map +1 -0
- package/dist/types/src/components/Editor/Editor.d.ts +19 -0
- package/dist/types/src/components/Editor/Editor.d.ts.map +1 -0
- package/dist/types/src/components/Editor/index.d.ts +2 -0
- package/dist/types/src/components/Editor/index.d.ts.map +1 -0
- package/dist/types/src/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/blocks.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/formatting.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/headings.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/image.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/lists.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/search.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/util.d.ts +6 -5
- package/dist/types/src/components/EditorToolbar/util.d.ts.map +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts +1 -1
- package/dist/types/src/components/EditorToolbar/view-mode.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/defaults.d.ts.map +1 -1
- package/dist/types/src/extensions/autocomplete.d.ts +20 -7
- package/dist/types/src/extensions/autocomplete.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts +36 -45
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/defs.d.ts +1 -1
- package/dist/types/src/extensions/automerge/defs.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/sync.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/update-automerge.d.ts.map +1 -1
- package/dist/types/src/extensions/autoscroll.d.ts +10 -0
- package/dist/types/src/extensions/autoscroll.d.ts.map +1 -0
- package/dist/types/src/extensions/blast.d.ts.map +1 -1
- package/dist/types/src/extensions/command/action.d.ts +1 -1
- package/dist/types/src/extensions/command/action.d.ts.map +1 -1
- package/dist/types/src/extensions/command/command-menu.d.ts +1 -1
- package/dist/types/src/extensions/command/command-menu.d.ts.map +1 -1
- package/dist/types/src/extensions/command/command.d.ts.map +1 -1
- package/dist/types/src/extensions/command/floating-menu.d.ts.map +1 -1
- package/dist/types/src/extensions/command/hint.d.ts +2 -7
- package/dist/types/src/extensions/command/hint.d.ts.map +1 -1
- package/dist/types/src/extensions/command/index.d.ts +1 -1
- package/dist/types/src/extensions/command/index.d.ts.map +1 -1
- package/dist/types/src/extensions/command/state.d.ts +1 -1
- package/dist/types/src/extensions/command/state.d.ts.map +1 -1
- package/dist/types/src/extensions/command/typeahead.d.ts +7 -2
- package/dist/types/src/extensions/command/typeahead.d.ts.map +1 -1
- package/dist/types/src/extensions/command/useCommandMenu.d.ts +3 -4
- package/dist/types/src/extensions/command/useCommandMenu.d.ts.map +1 -1
- package/dist/types/src/extensions/comments.d.ts +1 -1
- package/dist/types/src/extensions/comments.d.ts.map +1 -1
- package/dist/types/src/extensions/dnd.d.ts.map +1 -1
- package/dist/types/src/extensions/factories.d.ts +15 -1
- package/dist/types/src/extensions/factories.d.ts.map +1 -1
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/action.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/bundle.d.ts +8 -2
- package/dist/types/src/extensions/markdown/bundle.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/changes.d.ts +1 -1
- package/dist/types/src/extensions/markdown/changes.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/decorate.d.ts +9 -1
- package/dist/types/src/extensions/markdown/decorate.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.test.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/highlight.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/image.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/link.d.ts.map +1 -1
- package/dist/types/src/extensions/modes.d.ts +0 -7
- package/dist/types/src/extensions/modes.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/outliner.d.ts +1 -1
- package/dist/types/src/extensions/outliner/outliner.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/selection.d.ts.map +1 -1
- package/dist/types/src/extensions/outliner/tree.d.ts +2 -2
- package/dist/types/src/extensions/outliner/tree.d.ts.map +1 -1
- package/dist/types/src/extensions/preview/preview.d.ts +3 -6
- package/dist/types/src/extensions/preview/preview.d.ts.map +1 -1
- package/dist/types/src/extensions/tags/extended-markdown.d.ts +10 -0
- package/dist/types/src/extensions/tags/extended-markdown.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/extended-markdown.test.d.ts +2 -0
- package/dist/types/src/extensions/tags/extended-markdown.test.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/index.d.ts +4 -0
- package/dist/types/src/extensions/tags/index.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/streamer.d.ts +12 -0
- package/dist/types/src/extensions/tags/streamer.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-tags.d.ts +71 -0
- package/dist/types/src/extensions/tags/xml-tags.d.ts.map +1 -0
- package/dist/types/src/extensions/tags/xml-util.d.ts +10 -0
- package/dist/types/src/extensions/tags/xml-util.d.ts.map +1 -0
- package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/stories/Command.stories.d.ts +12 -4
- package/dist/types/src/stories/Command.stories.d.ts.map +1 -1
- package/dist/types/src/stories/CommandMenu.stories.d.ts +11 -4
- package/dist/types/src/stories/CommandMenu.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Comments.stories.d.ts +21 -9
- package/dist/types/src/stories/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/stories/EditorToolbar.stories.d.ts +40 -3
- package/dist/types/src/stories/EditorToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Experimental.stories.d.ts +22 -12
- package/dist/types/src/stories/Experimental.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Markdown.stories.d.ts +32 -42
- package/dist/types/src/stories/Markdown.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Outliner.stories.d.ts +15 -20
- package/dist/types/src/stories/Outliner.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Preview.stories.d.ts +21 -6
- package/dist/types/src/stories/Preview.stories.d.ts.map +1 -1
- package/dist/types/src/stories/Tags.stories.d.ts +17 -0
- package/dist/types/src/stories/Tags.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TextEditor.stories.d.ts +38 -51
- package/dist/types/src/stories/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/EditorStory.d.ts +3 -6
- package/dist/types/src/stories/components/EditorStory.d.ts.map +1 -1
- package/dist/types/src/styles/theme.d.ts.map +1 -1
- package/dist/types/src/testing/PreviewPopover.d.ts +20 -0
- package/dist/types/src/testing/PreviewPopover.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/util.d.ts +1 -0
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +28 -29
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +21 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/cursor.d.ts.map +1 -1
- package/dist/types/src/util/debug.d.ts +1 -1
- package/dist/types/src/util/debug.d.ts.map +1 -1
- package/dist/types/src/util/decorations.d.ts +4 -0
- package/dist/types/src/util/decorations.d.ts.map +1 -0
- package/dist/types/src/util/dom.d.ts +2 -12
- package/dist/types/src/util/dom.d.ts.map +1 -1
- package/dist/types/src/util/domino.d.ts +18 -0
- package/dist/types/src/util/domino.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/react.d.ts +1 -1
- package/dist/types/src/util/react.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -55
- package/src/components/{Popover → CommandMenu}/CommandMenu.tsx +93 -26
- package/src/components/{Popover → CommandMenu}/index.ts +0 -2
- package/src/components/Editor/Editor.tsx +39 -0
- package/src/components/Editor/index.ts +5 -0
- package/src/components/EditorToolbar/EditorToolbar.tsx +40 -30
- package/src/components/EditorToolbar/blocks.ts +22 -25
- package/src/components/EditorToolbar/formatting.ts +22 -25
- package/src/components/EditorToolbar/headings.ts +10 -5
- package/src/components/EditorToolbar/image.ts +8 -4
- package/src/components/EditorToolbar/lists.ts +16 -19
- package/src/components/EditorToolbar/search.ts +8 -4
- package/src/components/EditorToolbar/util.ts +21 -9
- package/src/components/EditorToolbar/view-mode.ts +12 -7
- package/src/components/index.ts +2 -1
- package/src/defaults.ts +5 -2
- package/src/extensions/autocomplete.ts +204 -54
- package/src/extensions/automerge/automerge.stories.tsx +26 -17
- package/src/extensions/automerge/automerge.ts +4 -3
- package/src/extensions/automerge/defs.ts +1 -1
- package/src/extensions/automerge/sync.ts +1 -1
- package/src/extensions/automerge/update-automerge.ts +1 -1
- package/src/extensions/autoscroll.ts +157 -0
- package/src/extensions/awareness/awareness.ts +2 -2
- package/src/extensions/blast.ts +3 -16
- package/src/extensions/command/action.ts +1 -2
- package/src/extensions/command/command-menu.ts +7 -6
- package/src/extensions/command/command.ts +3 -3
- package/src/extensions/command/floating-menu.ts +10 -15
- package/src/extensions/command/hint.ts +2 -1
- package/src/extensions/command/index.ts +1 -1
- package/src/extensions/command/placeholder.ts +1 -1
- package/src/extensions/command/state.ts +4 -3
- package/src/extensions/command/typeahead.ts +28 -15
- package/src/extensions/command/useCommandMenu.ts +6 -9
- package/src/extensions/comments.ts +18 -13
- package/src/extensions/dnd.ts +1 -1
- package/src/extensions/factories.ts +22 -15
- package/src/extensions/folding.tsx +2 -2
- package/src/extensions/index.ts +2 -0
- package/src/extensions/markdown/action.ts +2 -1
- package/src/extensions/markdown/bundle.ts +25 -3
- package/src/extensions/markdown/changes.ts +1 -1
- package/src/extensions/markdown/decorate.ts +23 -14
- package/src/extensions/markdown/formatting.test.ts +7 -7
- package/src/extensions/markdown/formatting.ts +16 -14
- package/src/extensions/markdown/highlight.ts +1 -1
- package/src/extensions/markdown/image.ts +3 -4
- package/src/extensions/markdown/link.ts +3 -0
- package/src/extensions/markdown/table.ts +7 -1
- package/src/extensions/mention.ts +1 -1
- package/src/extensions/modes.ts +0 -9
- package/src/extensions/outliner/outliner.test.ts +3 -2
- package/src/extensions/outliner/outliner.ts +6 -5
- package/src/extensions/outliner/selection.ts +1 -1
- package/src/extensions/outliner/tree.test.ts +2 -1
- package/src/extensions/outliner/tree.ts +2 -2
- package/src/extensions/preview/preview.ts +59 -62
- package/src/extensions/tags/extended-markdown.test.ts +261 -0
- package/src/extensions/tags/extended-markdown.ts +78 -0
- package/src/extensions/tags/index.ts +7 -0
- package/src/extensions/tags/streamer.ts +244 -0
- package/src/extensions/tags/xml-tags.ts +335 -0
- package/src/extensions/tags/xml-util.ts +94 -0
- package/src/hooks/useTextEditor.ts +3 -15
- package/src/index.ts +1 -1
- package/src/stories/Command.stories.tsx +24 -31
- package/src/stories/CommandMenu.stories.tsx +29 -30
- package/src/stories/Comments.stories.tsx +10 -6
- package/src/stories/EditorToolbar.stories.tsx +10 -11
- package/src/stories/Experimental.stories.tsx +12 -8
- package/src/stories/Markdown.stories.tsx +21 -17
- package/src/stories/Outliner.stories.tsx +42 -30
- package/src/stories/Preview.stories.tsx +34 -33
- package/src/stories/Tags.stories.tsx +81 -0
- package/src/stories/TextEditor.stories.tsx +41 -35
- package/src/stories/components/EditorStory.tsx +9 -10
- package/src/styles/theme.ts +11 -10
- package/src/testing/PreviewPopover.tsx +78 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/util.ts +2 -0
- package/src/translations.ts +5 -3
- package/src/types/index.ts +5 -0
- package/src/types/types.ts +32 -0
- package/src/util/cursor.ts +2 -1
- package/src/util/debug.ts +2 -2
- package/src/util/decorations.ts +21 -0
- package/src/util/dom.ts +5 -27
- package/src/util/domino.ts +51 -0
- package/src/util/index.ts +2 -0
- package/src/util/react.tsx +1 -1
- package/dist/lib/node/index.cjs +0 -7754
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -29
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/types/src/components/Popover/CommandMenu.d.ts.map +0 -1
- package/dist/types/src/components/Popover/RefDropdownMenu.d.ts +0 -21
- package/dist/types/src/components/Popover/RefDropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Popover/RefPopover.d.ts +0 -34
- package/dist/types/src/components/Popover/RefPopover.d.ts.map +0 -1
- package/dist/types/src/components/Popover/index.d.ts +0 -4
- package/dist/types/src/components/Popover/index.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -14
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/Popover/RefDropdownMenu.tsx +0 -79
- package/src/components/Popover/RefPopover.tsx +0 -99
- package/src/types.ts +0 -23
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../../../../src/testing/util.ts"],
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport const str = (...lines: string[]) => lines.join('\\n');\n"],
|
5
|
-
"mappings": ";;;
|
6
|
-
"names": ["str", "lines", "join"]
|
3
|
+
"sources": ["../../../../src/testing/util.ts", "../../../../src/testing/PreviewPopover.tsx"],
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n/** deprecated Replace with @dxos/util trim */\n// TODO(burdon): Remove\nexport const str = (...lines: string[]) => lines.join('\\n');\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, type RefObject, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { type DxAnchorActivate, Popover } from '@dxos/react-ui';\n\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '../extensions';\n\ntype PreviewLookup = (link: PreviewLinkRef) => Promise<PreviewLinkTarget | null | undefined>;\n\ntype PreviewPopoverValue = Partial<{\n link: PreviewLinkRef;\n target: PreviewLinkTarget;\n pending: boolean;\n}>;\n\nconst [PreviewPopoverContextProvider, usePreviewPopover] = createContext<PreviewPopoverValue>('PreviewPopover', {});\n\ntype PopoverLookupProviderProps = PropsWithChildren<{\n onLookup?: PreviewLookup;\n}>;\n\nconst PreviewPopoverProvider = ({ children, onLookup }: PopoverLookupProviderProps) => {\n const trigger = useRef<HTMLElement | null>(null);\n const [value, setValue] = useState<PreviewPopoverValue>({});\n const [open, setOpen] = useState(false);\n\n const handleDxAnchorActivate = useCallback(\n (event: DxAnchorActivate) => {\n const { refId, label, trigger: dxTrigger } = event;\n setValue((value) => ({\n ...value,\n link: { label, ref: refId },\n pending: true,\n }));\n trigger.current = dxTrigger;\n queueMicrotask(() => setOpen(true));\n void onLookup?.({ label, ref: refId }).then((target) =>\n setValue((value) => ({\n ...value,\n target: target ?? undefined,\n pending: false,\n })),\n );\n },\n [onLookup],\n );\n\n const [rootRef, setRootRef] = useState<HTMLDivElement | null>(null);\n useEffect(() => {\n if (!rootRef || !handleDxAnchorActivate) {\n return;\n }\n\n return addEventListener(rootRef, 'dx-anchor-activate' as any, handleDxAnchorActivate, {\n capture: true,\n passive: false,\n });\n }, [rootRef, handleDxAnchorActivate]);\n\n return (\n <PreviewPopoverContextProvider pending={value.pending} link={value.link} target={value.target}>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.VirtualTrigger virtualRef={trigger as unknown as RefObject<HTMLButtonElement>} />\n <div role='none' className='contents' ref={setRootRef}>\n {children}\n </div>\n </Popover.Root>\n </PreviewPopoverContextProvider>\n );\n};\nexport { PreviewPopoverProvider, usePreviewPopover };\n\nexport type { PopoverLookupProviderProps, PreviewPopoverValue };\n"],
|
5
|
+
"mappings": ";;;AAMO,IAAMA,MAAM,IAAIC,UAAoBA,MAAMC,KAAK,IAAA;;;;ACFtD,SAASC,qBAAqB;AAC9B,OAAOC,SAAiDC,aAAaC,WAAWC,QAAQC,gBAAgB;AAExG,SAASC,wBAAwB;AACjC,SAAgCC,eAAe;AAY/C,IAAM,CAACC,+BAA+BC,iBAAAA,IAAqBC,cAAmC,kBAAkB,CAAC,CAAA;AAMjH,IAAMC,yBAAyB,CAAC,EAAEC,UAAUC,SAAQ,MAA8B;;;AAChF,UAAMC,UAAUC,OAA2B,IAAA;AAC3C,UAAM,CAACC,OAAOC,QAAAA,IAAYC,SAA8B,CAAC,CAAA;AACzD,UAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,KAAA;AAEjC,UAAMG,yBAAyBC,YAC7B,CAACC,UAAAA;AACC,YAAM,EAAEC,OAAOC,OAAOX,SAASY,UAAS,IAAKH;AAC7CN,eAAS,CAACD,YAAW;QACnB,GAAGA;QACHW,MAAM;UAAEF;UAAOG,KAAKJ;QAAM;QAC1BK,SAAS;MACX,EAAA;AACAf,cAAQgB,UAAUJ;AAClBK,qBAAe,MAAMX,QAAQ,IAAA,CAAA;AAC7B,WAAKP,WAAW;QAAEY;QAAOG,KAAKJ;MAAM,CAAA,EAAGQ,KAAK,CAACC,WAC3ChB,SAAS,CAACD,YAAW;QACnB,GAAGA;QACHiB,QAAQA,UAAUC;QAClBL,SAAS;MACX,EAAA,CAAA;IAEJ,GACA;MAAChB;KAAS;AAGZ,UAAM,CAACsB,SAASC,UAAAA,IAAclB,SAAgC,IAAA;AAC9DmB,cAAU,MAAA;AACR,UAAI,CAACF,WAAW,CAACd,wBAAwB;AACvC;MACF;AAEA,aAAOiB,iBAAiBH,SAAS,sBAA6Bd,wBAAwB;QACpFkB,SAAS;QACTC,SAAS;MACX,CAAA;IACF,GAAG;MAACL;MAASd;KAAuB;AAEpC,WACE,sBAAA,cAACb,+BAAAA;MAA8BqB,SAASb,MAAMa;MAASF,MAAMX,MAAMW;MAAMM,QAAQjB,MAAMiB;OACrF,sBAAA,cAACQ,QAAQC,MAAI;MAACvB;MAAYwB,cAAcvB;OACtC,sBAAA,cAACqB,QAAQG,gBAAc;MAACC,YAAY/B;QACpC,sBAAA,cAACgC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;MAAWpB,KAAKQ;OACxCxB,QAAAA,CAAAA,CAAAA;;;;AAKX;",
|
6
|
+
"names": ["str", "lines", "join", "createContext", "React", "useCallback", "useEffect", "useRef", "useState", "addEventListener", "Popover", "PreviewPopoverContextProvider", "usePreviewPopover", "createContext", "PreviewPopoverProvider", "children", "onLookup", "trigger", "useRef", "value", "setValue", "useState", "open", "setOpen", "handleDxAnchorActivate", "useCallback", "event", "refId", "label", "dxTrigger", "link", "ref", "pending", "current", "queueMicrotask", "then", "target", "undefined", "rootRef", "setRootRef", "useEffect", "addEventListener", "capture", "passive", "Popover", "Root", "onOpenChange", "VirtualTrigger", "virtualRef", "div", "role", "className"]
|
7
7
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
2
|
+
import {
|
3
|
+
EditorInputMode,
|
4
|
+
EditorInputModes,
|
5
|
+
EditorViewMode,
|
6
|
+
EditorViewModes
|
7
|
+
} from "../chunk-YXYQPV6R.mjs";
|
8
|
+
export {
|
9
|
+
EditorInputMode,
|
10
|
+
EditorInputModes,
|
11
|
+
EditorViewMode,
|
12
|
+
EditorViewModes
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type EditorView } from '@codemirror/view';
|
2
|
-
import React from 'react';
|
3
|
-
import { type Label } from '@dxos/react-ui';
|
2
|
+
import React, { type PropsWithChildren } from 'react';
|
3
|
+
import { type DxAnchorActivate, type Label } from '@dxos/react-ui';
|
4
4
|
import { type MaybePromise } from '@dxos/util';
|
5
5
|
export type CommandMenuGroup = {
|
6
6
|
id: string;
|
@@ -13,12 +13,16 @@ export type CommandMenuItem = {
|
|
13
13
|
icon?: string;
|
14
14
|
onSelect?: (view: EditorView, head: number) => MaybePromise<void>;
|
15
15
|
};
|
16
|
-
export type CommandMenuProps = {
|
16
|
+
export type CommandMenuProps = PropsWithChildren<{
|
17
17
|
groups: CommandMenuGroup[];
|
18
|
-
currentItem?: string;
|
19
18
|
onSelect: (item: CommandMenuItem) => void;
|
20
|
-
|
21
|
-
|
19
|
+
onActivate?: (event: DxAnchorActivate) => void;
|
20
|
+
currentItem?: string;
|
21
|
+
open?: boolean;
|
22
|
+
onOpenChange?: (nextOpen: boolean) => void;
|
23
|
+
defaultOpen?: boolean;
|
24
|
+
}>;
|
25
|
+
export declare const CommandMenuProvider: ({ groups, onSelect, onActivate, currentItem, children, open: propsOpen, onOpenChange, defaultOpen, }: CommandMenuProps) => React.JSX.Element;
|
22
26
|
export declare const getItem: (groups: CommandMenuGroup[], id?: string) => CommandMenuItem | undefined;
|
23
27
|
export declare const getNextItem: (groups: CommandMenuGroup[], id?: string) => CommandMenuItem;
|
24
28
|
export declare const getPreviousItem: (groups: CommandMenuGroup[], id?: string) => CommandMenuItem;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CommandMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/CommandMenu/CommandMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,EAAY,KAAK,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAG1G,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,KAAK,EAKX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAGH,eAAO,MAAM,mBAAmB,GAAI,sGASjC,gBAAgB,sBAqElB,CAAC;AAiEF,eAAO,MAAM,OAAO,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAAe,GAAG,SAEnF,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAIrE,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,gBAAgB,EAAE,EAAE,KAAK,MAAM,KAAG,eAIzE,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,KACzC,gBAAgB,EAKlB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,UAAU,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,SAK5E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,UAAU,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,SAW/E,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBA6E/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBA2B/B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CommandMenu/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { type EditorView } from '@codemirror/view';
|
2
|
+
import React from 'react';
|
3
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
4
|
+
import { type DataType } from '@dxos/schema';
|
5
|
+
import { type UseTextEditorProps } from '../../hooks';
|
6
|
+
export type EditorProps = ThemedClassName<{
|
7
|
+
id: string;
|
8
|
+
text: DataType.Text;
|
9
|
+
} & Omit<UseTextEditorProps, 'id'>>;
|
10
|
+
/**
|
11
|
+
* Minimal text editor.
|
12
|
+
*/
|
13
|
+
export declare const Editor: React.ForwardRefExoticComponent<Omit<{
|
14
|
+
id: string;
|
15
|
+
text: DataType.Text;
|
16
|
+
} & Omit<UseTextEditorProps, "id">, "className"> & {
|
17
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
18
|
+
} & React.RefAttributes<EditorView | undefined>>;
|
19
|
+
//# sourceMappingURL=Editor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,aAAa,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,eAAe,CACvC;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CACnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM;QARX,MAAM;UACJ,QAAQ,CAAC,IAAI;;;gDAsBtB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Editor/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/EditorToolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/EditorToolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAkB7C,OAAO,EAAsE,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAqGrH,eAAO,MAAM,aAAa,2EAAuD,kBAAkB,uBASjG,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/blocks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/blocks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/C,OAAO,EAAE,KAAK,kBAAkB,EAA+C,MAAM,QAAQ,CAAC;AAoC9F,eAAO,MAAM,YAAY,GAAI,OAAO,kBAAkB,EAAE,SAAS,MAAM,UAAU;;;;;;;;;;;;;;CAWhF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/formatting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/formatting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/C,OAAO,EAAE,KAAK,kBAAkB,EAA+C,MAAM,QAAQ,CAAC;AA2C9F,eAAO,MAAM,gBAAgB,GAAI,OAAO,kBAAkB,EAAE,SAAS,MAAM,UAAU;;;;;;;;;;;;;;CAUpF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"headings.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/headings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"headings.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/headings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAM/C,OAAO,EAAE,KAAK,kBAAkB,EAA+C,MAAM,QAAQ,CAAC;AAyC9F,eAAO,MAAM,cAAc,GAAI,OAAO,kBAAkB,EAAE,SAAS,MAAM,UAAU;;;;;;;;;;;;;;CAWlF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/image.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/image.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,iBAAiB,GAAI,eAAe,MAAM,IAAI;;;;;;;;;;;;;;CAGzD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/lists.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/lists.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/C,OAAO,EAAE,KAAK,kBAAkB,EAA+C,MAAM,QAAQ,CAAC;AAiC9F,eAAO,MAAM,WAAW,GAAI,OAAO,kBAAkB,EAAE,SAAS,MAAM,UAAU;;;;;;;;;;;;;;CAW/E,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/search.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/search.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAcnD,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,UAAU;;;;;;;;;;;;;;CAGpD,CAAC"}
|
@@ -3,8 +3,9 @@ import { type Rx } from '@effect-rx/rx-react';
|
|
3
3
|
import { type Action } from '@dxos/app-graph';
|
4
4
|
import { type Live } from '@dxos/live-object';
|
5
5
|
import { type ThemedClassName } from '@dxos/react-ui';
|
6
|
-
import { type
|
7
|
-
import type { EditorAction,
|
6
|
+
import { type ActionGraphProps, type MenuActionProperties, type MenuItemGroup, type MenuSeparator, type ToolbarMenuActionGroupProperties } from '@dxos/react-ui-menu';
|
7
|
+
import type { EditorAction, Formatting } from '../../extensions';
|
8
|
+
import { type EditorViewMode } from '../../types';
|
8
9
|
export type EditorToolbarState = Formatting & Partial<{
|
9
10
|
viewMode: EditorViewMode;
|
10
11
|
}>;
|
@@ -28,12 +29,12 @@ export type EditorToolbarProps = ThemedClassName<EditorToolbarActionGraphProps &
|
|
28
29
|
role?: string;
|
29
30
|
}>;
|
30
31
|
export type EditorToolbarItem = EditorAction | MenuItemGroup | MenuSeparator;
|
31
|
-
export declare const createEditorAction: (id: string, invoke: () => void
|
32
|
+
export declare const createEditorAction: (id: string, props: Partial<MenuActionProperties>, invoke: () => void) => Action<MenuActionProperties>;
|
32
33
|
export declare const createEditorActionGroup: (id: string, props: Omit<ToolbarMenuActionGroupProperties, "icon">, icon?: string) => {
|
33
34
|
id: string;
|
34
35
|
type: string;
|
35
36
|
properties: {
|
36
|
-
|
37
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
37
38
|
hidden?: boolean | undefined;
|
38
39
|
variant: "dropdownMenu" | "toggleGroup";
|
39
40
|
value: string | (string & string[]);
|
@@ -41,8 +42,8 @@ export declare const createEditorActionGroup: (id: string, props: Omit<ToolbarMe
|
|
41
42
|
iconOnly: boolean;
|
42
43
|
testId?: string | undefined;
|
43
44
|
checked?: boolean | undefined;
|
44
|
-
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
45
45
|
selectCardinality: "single" | "multiple";
|
46
|
+
label: import("@dxos/react-ui").Label;
|
46
47
|
icon: string | undefined;
|
47
48
|
};
|
48
49
|
data: typeof import("@dxos/app-graph").actionGroupSymbol;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gCAAgC,EAGtC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AAEpF,eAAO,MAAM,qBAAqB,GAAI,eAAc,OAAO,CAAC,kBAAkB,CAAM,6BAEnF,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAEhB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,UAAU,CAAC;IAE1B,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC9C,6BAA6B,GAAG,yBAAyB,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CACrG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;AAE7E,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,EAAE,OAAO,OAAO,CAAC,oBAAoB,CAAC,EAAE,QAAQ,MAAM,IAAI,KAK/F,MAAM,CAAC,oBAAoB,CAClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,IAAI,MAAM,EACV,OAAO,IAAI,CAAC,gCAAgC,EAAE,MAAM,CAAC,EACrD,OAAO,MAAM;;;;;;;;;;;;;;;;;CASd,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type NodeArg } from '@dxos/app-graph';
|
2
|
+
import { type EditorViewMode } from '../../types';
|
2
3
|
import { type EditorToolbarState } from './util';
|
3
|
-
import { type EditorViewMode } from '../../extensions';
|
4
4
|
export declare const createViewMode: (state: EditorToolbarState, onViewModeChange: (mode: EditorViewMode) => void) => {
|
5
5
|
nodes: (Readonly<Omit<Readonly<{
|
6
6
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/view-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../../../../src/components/EditorToolbar/view-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,KAAK,kBAAkB,EAA+C,MAAM,QAAQ,CAAC;AAgC9F,eAAO,MAAM,cAAc,GAAI,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI;;;;;;;;;;;;;;CAWzG,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/defaults.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,oDAAoD,CAAC;AAE7E,eAAO,MAAM,WAAW,EAAE,sBAAsB,CAAC,OAAO,CAOvD,CAAC;AAEF,eAAO,MAAM,YAAY,
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/defaults.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,oDAAoD,CAAC;AAE7E,eAAO,MAAM,WAAW,EAAE,sBAAsB,CAAC,OAAO,CAOvD,CAAC;AAEF,eAAO,MAAM,YAAY,uCAOvB,CAAC;AAEH,eAAO,MAAM,eAAe,uCAI1B,CAAC;AAEH,eAAO,MAAM,uBAAuB,sIACiG,CAAC;AAGtI,eAAO,MAAM,gCAAgC,GAAI,OAAO,MAAM,WAI3D,CAAC"}
|
@@ -1,13 +1,26 @@
|
|
1
|
-
import { type CompletionSource, type Completion } from '@codemirror/autocomplete';
|
2
1
|
import { type Extension } from '@codemirror/state';
|
3
|
-
export type AutocompleteResult = Completion;
|
4
2
|
export type AutocompleteOptions = {
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
fireIfEmpty?: boolean;
|
4
|
+
/**
|
5
|
+
* Callback triggered when Enter is pressed.
|
6
|
+
* @param text The current text in the editor
|
7
|
+
* @returns true if the editor should reset the document.
|
8
|
+
*/
|
9
|
+
onSubmit?: (text: string) => boolean | void;
|
10
|
+
/**
|
11
|
+
* Function that returns a list of suggestions based on the current text.
|
12
|
+
* @param text The current text before the cursor
|
13
|
+
* @returns Array of suggestion strings
|
14
|
+
*/
|
15
|
+
onSuggest?: (text: string) => string[];
|
16
|
+
/**
|
17
|
+
* ESC pressed.
|
18
|
+
*/
|
19
|
+
onCancel?: () => void;
|
8
20
|
};
|
9
21
|
/**
|
10
|
-
*
|
22
|
+
* Creates an autocomplete extension that shows inline suggestions.
|
23
|
+
* Pressing Tab will complete the suggestion.
|
11
24
|
*/
|
12
|
-
export declare const autocomplete: ({
|
25
|
+
export declare const autocomplete: ({ fireIfEmpty, onSubmit, onSuggest, onCancel }: AutocompleteOptions) => Extension;
|
13
26
|
//# sourceMappingURL=autocomplete.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/extensions/autocomplete.ts"],"names":[],"mappings":"AAIA,OAAO,
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/extensions/autocomplete.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAC;AAWzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,gDAAgD,mBAAmB,KAAG,SA+JlG,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"automerge.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.ts"],"names":[],"mappings":"AAOA,OAAO,
|
1
|
+
{"version":3,"file":"automerge.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQ3D,eAAO,MAAM,SAAS,GAAI,UAAU,WAAW,KAAG,SAmEjD,CAAC"}
|
@@ -1,56 +1,47 @@
|
|
1
1
|
import '@dxos-theme';
|
2
2
|
import '@preact/signals-react';
|
3
|
+
import { type StoryObj } from '@storybook/react-vite';
|
3
4
|
import React from 'react';
|
4
|
-
|
5
|
-
import { type Identity } from '@dxos/react-client/halo';
|
6
|
-
type EditorProps = {
|
7
|
-
source: DocAccessor;
|
8
|
-
autoFocus?: boolean;
|
9
|
-
space?: Space;
|
10
|
-
identity?: Identity;
|
11
|
-
};
|
12
|
-
declare const _default: {
|
5
|
+
declare const meta: {
|
13
6
|
title: string;
|
14
|
-
component:
|
7
|
+
component: any;
|
8
|
+
render: (args: unknown) => React.JSX.Element;
|
15
9
|
decorators: import("@storybook/react").Decorator[];
|
16
|
-
render: () => React.JSX.Element;
|
17
10
|
parameters: {
|
18
|
-
translations: {
|
19
|
-
'en-US': {
|
20
|
-
"react-ui-editor": {
|
21
|
-
'strong label':
|
22
|
-
'emphasis label':
|
23
|
-
'strikethrough label':
|
24
|
-
'code label':
|
25
|
-
'link label':
|
26
|
-
'list-bullet label':
|
27
|
-
'list-ordered label':
|
28
|
-
'list-task label':
|
29
|
-
'blockquote label':
|
30
|
-
'codeblock label':
|
31
|
-
'comment label':
|
32
|
-
'selection overlaps existing comment label':
|
33
|
-
'select text to comment label':
|
34
|
-
'image label':
|
35
|
-
'
|
36
|
-
'
|
37
|
-
'heading level label_zero':
|
38
|
-
'heading level label_one':
|
39
|
-
'heading level label_other':
|
40
|
-
'view mode label':
|
41
|
-
'preview mode label':
|
42
|
-
'readonly mode label':
|
43
|
-
'search label':
|
44
|
-
'source mode label':
|
11
|
+
translations: [{
|
12
|
+
readonly 'en-US': {
|
13
|
+
readonly "react-ui-editor": {
|
14
|
+
readonly 'strong label': "Bold";
|
15
|
+
readonly 'emphasis label': "Italics";
|
16
|
+
readonly 'strikethrough label': "Strikethrough";
|
17
|
+
readonly 'code label': "Code";
|
18
|
+
readonly 'link label': "Link";
|
19
|
+
readonly 'list-bullet label': "Bullet list";
|
20
|
+
readonly 'list-ordered label': "Numbered list";
|
21
|
+
readonly 'list-task label': "Task list";
|
22
|
+
readonly 'blockquote label': "Block quote";
|
23
|
+
readonly 'codeblock label': "Code block";
|
24
|
+
readonly 'comment label': "Create comment";
|
25
|
+
readonly 'selection overlaps existing comment label': "Selection overlaps existing comment";
|
26
|
+
readonly 'select text to comment label': "Select text to comment";
|
27
|
+
readonly 'image label': "Insert image";
|
28
|
+
readonly 'table label': "Create table";
|
29
|
+
readonly 'heading label': "Heading level";
|
30
|
+
readonly 'heading level label_zero': "Paragraph";
|
31
|
+
readonly 'heading level label_one': "Heading level {{count}}";
|
32
|
+
readonly 'heading level label_other': "Heading level {{count}}";
|
33
|
+
readonly 'view mode label': "Editor view";
|
34
|
+
readonly 'preview mode label': "Live preview";
|
35
|
+
readonly 'readonly mode label': "Read only";
|
36
|
+
readonly 'search label': "Search";
|
37
|
+
readonly 'source mode label': "Source";
|
45
38
|
};
|
46
39
|
};
|
47
|
-
}
|
40
|
+
}];
|
48
41
|
};
|
49
42
|
};
|
50
|
-
export default
|
51
|
-
|
52
|
-
export declare const
|
53
|
-
|
54
|
-
render: () => React.JSX.Element;
|
55
|
-
};
|
43
|
+
export default meta;
|
44
|
+
type Story = StoryObj<typeof meta>;
|
45
|
+
export declare const Default: Story;
|
46
|
+
export declare const WithEcho: Story;
|
56
47
|
//# sourceMappingURL=automerge.stories.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,uBAAuB,CAAC;AAI/B,OAAO,
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,uBAAuB,CAAC;AAI/B,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoGnD,QAAA,MAAM,IAAI;;eAEa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMW,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type Heads, type Prop } from '@automerge/automerge';
|
2
|
-
import { StateEffect, type StateField, type
|
2
|
+
import { type EditorState, StateEffect, type StateField, type Transaction } from '@codemirror/state';
|
3
3
|
export type State = {
|
4
4
|
path: Prop[];
|
5
5
|
lastHeads: Heads;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/defs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAc,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/defs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAc,KAAK,WAAW,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjH,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,SAAS,EAAE,KAAK,CAAC;IACjB,wBAAwB,EAAE,WAAW,EAAE,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,WAAW,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC,KAAG,IAAI,EAA6B,CAAC;AACzG,eAAO,MAAM,YAAY,GAAI,OAAO,WAAW,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC,KAAG,KAAqC,CAAC;AAElH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,0DAAsC,CAAC;AAErE,eAAO,MAAM,WAAW,GAAI,UAAU,KAAK,KAAG,WAAW,CAAC,WAAW,CAAuC,CAAC;AAE7G,eAAO,MAAM,mBAAmB,qDAA+B,CAAC;AAEhE,eAAO,MAAM,WAAW,GAAI,IAAI,WAAW,KAAG,OAE7C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/sync.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/sync.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,KAAK,KAAK,EAAwE,MAAM,QAAQ,CAAC;AAI1G;;GAEG;AACH,qBAAa,MAAM;IAKf,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAS;gBAIN,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC;IAG5C,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAelD,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAatC,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;CAkB1C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-automerge.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/update-automerge.ts"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,
|
1
|
+
{"version":3,"file":"update-automerge.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/update-automerge.ts"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAa,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,eAAO,MAAM,eAAe,GAC1B,OAAO,UAAU,CAAC,KAAK,CAAC,EACxB,QAAQ,UAAU,EAClB,cAAc,WAAW,EAAE,EAC3B,OAAO,WAAW,KACjB,KAAK,GAAG,SA+BV,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare const scrollToBottomEffect: import("@codemirror/state").StateEffectType<any>;
|
2
|
+
export type AutoScrollOptions = {
|
3
|
+
overscroll: number;
|
4
|
+
throttle: number;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* Extension that supports pinning the scroll position and automatically scrolls to the bottom when content is added.
|
8
|
+
*/
|
9
|
+
export declare const autoScroll: ({ overscroll, throttle }?: Partial<AutoScrollOptions>) => import("@codemirror/state").Extension[];
|
10
|
+
//# sourceMappingURL=autoscroll.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"autoscroll.d.ts","sourceRoot":"","sources":["../../../../src/extensions/autoscroll.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB,kDAA4B,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,UAAU,GAAI,2BAAmD,OAAO,CAAC,iBAAiB,CAAM,4CA8H5G,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"blast.d.ts","sourceRoot":"","sources":["../../../../src/extensions/blast.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"blast.d.ts","sourceRoot":"","sources":["../../../../src/extensions/blast.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,gBAAgB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,qBAAqB,EAAE;QAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IACpE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAU5B,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAS,OAAO,CAAC,YAAY,CAAkB,KAAG,SAmEvE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/action.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/action.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAIlF,MAAM,MAAM,MAAM,GACd;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEN,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAErD,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,EASnD,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { StateField } from '@codemirror/state';
|
2
|
-
import { type PlaceholderOptions } from './placeholder';
|
3
2
|
import { type Range } from '../../types';
|
3
|
+
import { type PlaceholderOptions } from './placeholder';
|
4
4
|
export type CommandMenuOptions = {
|
5
5
|
trigger: string | string[];
|
6
6
|
placeholder?: Partial<PlaceholderOptions>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/command-menu.ts"],"names":[],"mappings":"AAIA,OAAO,
|
1
|
+
{"version":3,"file":"command-menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/command-menu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,eAAe,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAG1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,kBAAkB,gFAmKtD,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,eAAO,MAAM,kBAAkB,kEAA4C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/command.ts"],"names":[],"mappings":"AAIA,OAAO,
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAC;AAMzD,OAAO,EAAE,KAAK,WAAW,EAAQ,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,KAAK,YAAY,EAA+B,MAAM,SAAS,CAAC;AAOzE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,SAatD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"floating-menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/floating-menu.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,UAAS,mBAAwB,
|
1
|
+
{"version":3,"file":"floating-menu.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/floating-menu.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,UAAS,mBAAwB,4CA+G7D,CAAC"}
|
@@ -8,17 +8,12 @@ export declare const hint: ({ delay, onHint }: HintOptions) => ViewPlugin<{
|
|
8
8
|
timeout: ReturnType<typeof setTimeout> | undefined;
|
9
9
|
update(update: ViewUpdate): void;
|
10
10
|
destroy(): void;
|
11
|
-
}>;
|
11
|
+
}, undefined>;
|
12
12
|
export declare class Hint extends WidgetType {
|
13
13
|
readonly content: string | HTMLElement;
|
14
14
|
constructor(content: string | HTMLElement);
|
15
15
|
toDOM(): HTMLSpanElement;
|
16
|
-
coordsAt(dom: HTMLElement):
|
17
|
-
left: number;
|
18
|
-
right: number;
|
19
|
-
top: number;
|
20
|
-
bottom: number;
|
21
|
-
} | null;
|
16
|
+
coordsAt(dom: HTMLElement): import("../..").Rect | null;
|
22
17
|
ignoreEvent(): boolean;
|
23
18
|
}
|
24
19
|
//# sourceMappingURL=hint.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hint.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/hint.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,UAAU,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"hint.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/hint.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,UAAU,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnG,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,mBAA2B,WAAW;;aAI5C,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS;mBAEnC,UAAU;;aAuC9B,CAAC;AAEF,qBAAa,IAAK,SAAQ,UAAU;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;gBAA7B,OAAO,EAAE,MAAM,GAAG,WAAW;IAIlD,KAAK,IAAI,eAAe;IAcf,QAAQ,CAAC,GAAG,EAAE,WAAW;IAgBzB,WAAW,IAAI,OAAO;CAGhC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { StateField } from '@codemirror/state';
|
2
2
|
import { type Tooltip } from '@codemirror/view';
|
3
|
-
import { type Action } from './action';
|
4
3
|
import { type RenderCallback } from '../../types';
|
4
|
+
import { type Action } from './action';
|
5
5
|
export declare const commandConfig: import("@codemirror/state").Facet<Partial<PopupOptions & import("./hint").HintOptions>, Partial<PopupOptions & import("./hint").HintOptions>>;
|
6
6
|
export type PopupOptions = {
|
7
7
|
renderDialog: RenderCallback<{
|
@@ -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,
|
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,EAAmB,KAAK,OAAO,EAAiC,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EAAE,KAAK,MAAM,EAA2B,MAAM,UAAU,CAAC;AAGhE,eAAO,MAAM,aAAa,+IAAqC,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,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,YAAY,0BAkEvB,CAAC"}
|
@@ -9,9 +9,14 @@ export type TypeaheadOptions = {
|
|
9
9
|
* CodeMirror extension for typeahead completion.
|
10
10
|
*/
|
11
11
|
export declare const typeahead: ({ onComplete }?: TypeaheadOptions) => Extension;
|
12
|
+
type CompletionOptions = {
|
13
|
+
default?: string;
|
14
|
+
minLength?: number;
|
15
|
+
};
|
12
16
|
/**
|
13
17
|
* Util to match current line to a static list of completions.
|
14
18
|
*/
|
15
|
-
export declare const staticCompletion: (completions: string[],
|
16
|
-
export declare const matchCompletion: (completion: string,
|
19
|
+
export declare const staticCompletion: (completions: string[], options?: CompletionOptions) => ({ line }: TypeaheadContext) => string | undefined;
|
20
|
+
export declare const matchCompletion: (completion: string, str: string, minLength?: number) => string | undefined;
|
21
|
+
export {};
|
17
22
|
//# sourceMappingURL=typeahead.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/typeahead.ts"],"names":[],"mappings":"AAIA,OAAO,
|
1
|
+
{"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/command/typeahead.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAyB,MAAM,mBAAmB,CAAC;AAa3F,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAGhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,iBAAgB,gBAAqB,KAAG,SA4DjE,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC1B,aAAa,MAAM,EAAE,EAAE,UAAS,iBAAsB,MACtD,UAAU,gBAAgB,uBAiB1B,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,EAAE,KAAK,MAAM,EAAE,kBAAa,KAAG,MAAM,GAAG,SAUzF,CAAC"}
|