edytor 2.0.0 → 4.0.0
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/README.md +19 -4
- package/dist/block/block.svelte.js +2 -4
- package/dist/clipboard/htmlFlow.d.ts +20 -7
- package/dist/clipboard/htmlFlow.js +23 -15
- package/dist/clipboard/serializeClipboardFragment.d.ts +37 -4
- package/dist/clipboard/serializeClipboardFragment.js +6 -4
- package/dist/clipboard/textBlocks.d.ts +8 -0
- package/dist/clipboard/textBlocks.js +6 -2
- package/dist/cloudflare/DocumentRoom.d.ts +13 -9
- package/dist/cloudflare/DocumentRoom.js +10 -6
- package/dist/cloudflare/room/admission.js +3 -3
- package/dist/cloudflare/room/context.d.ts +28 -27
- package/dist/cloudflare/room/context.js +2 -2
- package/dist/cloudflare/room/purge.d.ts +6 -3
- package/dist/cloudflare/room/purge.js +44 -19
- package/dist/cloudflare/room/updates.d.ts +3 -4
- package/dist/cloudflare/room/updates.js +6 -8
- package/dist/cloudflare/routeDocumentSocket.d.ts +17 -0
- package/dist/cloudflare/routeDocumentSocket.js +53 -0
- package/dist/collaboration/comments/client.d.ts +1 -1
- package/dist/collaboration/comments/client.js +1 -1
- package/dist/collaboration/remoteSelection.js +3 -3
- package/dist/components/Edytor.svelte +2 -10
- package/dist/components/Edytor.svelte.d.ts +1 -3
- package/dist/crdt/admission.d.ts +5 -10
- package/dist/crdt/admission.js +5 -11
- package/dist/crdt/attribution/attribution.d.ts +31 -12
- package/dist/crdt/attribution/attribution.js +56 -18
- package/dist/crdt/attribution/block.d.ts +3 -3
- package/dist/crdt/attribution/block.js +7 -8
- package/dist/crdt/attribution/index.d.ts +1 -1
- package/dist/crdt/attribution/index.js +1 -1
- package/dist/crdt/data.d.ts +62 -31
- package/dist/crdt/data.js +211 -103
- package/dist/crdt/doc/delete.d.ts +1 -1
- package/dist/crdt/doc/delete.js +13 -30
- package/dist/crdt/doc/funnel.d.ts +7 -6
- package/dist/crdt/doc/funnel.js +39 -33
- package/dist/crdt/doc/gate.d.ts +3 -20
- package/dist/crdt/doc/gate.js +2 -41
- package/dist/crdt/doc/history.d.ts +25 -9
- package/dist/crdt/doc/history.js +152 -42
- package/dist/crdt/doc/layout.js +11 -22
- package/dist/crdt/doc/meta.js +12 -17
- package/dist/crdt/doc/moves.d.ts +1 -1
- package/dist/crdt/doc/moves.js +52 -32
- package/dist/crdt/doc/reads.js +2 -2
- package/dist/crdt/doc/seed.js +2 -2
- package/dist/crdt/doc/split-merge.js +12 -15
- package/dist/crdt/doc/steps.d.ts +25 -13
- package/dist/crdt/doc/steps.js +52 -122
- package/dist/crdt/doc/types.d.ts +21 -9
- package/dist/crdt/document.d.ts +21 -19
- package/dist/crdt/document.js +26 -23
- package/dist/crdt/edytor-doc.d.ts +66 -68
- package/dist/crdt/edytor-doc.js +21 -20
- package/dist/crdt/engine-api.d.ts +33 -1
- package/dist/crdt/engine.d.ts +0 -1
- package/dist/crdt/engine.js +1 -4
- package/dist/crdt/flow.d.ts +1 -1
- package/dist/crdt/flow.js +25 -27
- package/dist/crdt/index.d.ts +29 -28
- package/dist/crdt/index.js +3 -3
- package/dist/crdt/placement/display.d.ts +5 -30
- package/dist/crdt/placement/display.js +39 -144
- package/dist/crdt/placement/keys.d.ts +58 -0
- package/dist/crdt/placement/keys.js +90 -0
- package/dist/crdt/placement/model.d.ts +119 -118
- package/dist/crdt/placement/model.js +242 -142
- package/dist/crdt/placement/resolve.d.ts +123 -35
- package/dist/crdt/placement/resolve.js +187 -153
- package/dist/crdt/placement/slots.d.ts +134 -0
- package/dist/crdt/placement/slots.js +152 -0
- package/dist/crdt/protocol.d.ts +2 -2
- package/dist/crdt/protocol.js +2 -2
- package/dist/crdt/providers/index.d.ts +1 -1
- package/dist/crdt/providers/room.d.ts +26 -11
- package/dist/crdt/providers/room.js +77 -27
- package/dist/crdt/providers/websocket.d.ts +1 -1
- package/dist/crdt/providers/websocket.js +33 -32
- package/dist/crdt/purge.d.ts +17 -8
- package/dist/crdt/purge.js +236 -126
- package/dist/crdt/restore.d.ts +2 -2
- package/dist/crdt/restore.js +18 -34
- package/dist/crdt/schema.d.ts +22 -21
- package/dist/crdt/schema.js +29 -23
- package/dist/crdt/semantics.js +3 -1
- package/dist/crdt/storage.d.ts +1 -1
- package/dist/crdt/storage.js +1 -1
- package/dist/crdt/structs.d.ts +15 -15
- package/dist/crdt/structs.js +8 -22
- package/dist/crdt/text/index/cache.js +4 -0
- package/dist/crdt/text/index/claims.js +12 -0
- package/dist/crdt/text/index/fold.d.ts +2 -3
- package/dist/crdt/text/index/fold.js +194 -44
- package/dist/crdt/text/index/layout.js +5 -8
- package/dist/crdt/text/index/placement.d.ts +26 -18
- package/dist/crdt/text/index/placement.js +404 -138
- package/dist/crdt/text/index/records.d.ts +3 -3
- package/dist/crdt/text/index/records.js +24 -31
- package/dist/crdt/text/index/shared.d.ts +11 -3
- package/dist/crdt/text/index/shared.js +12 -3
- package/dist/crdt/text/index/state.d.ts +21 -17
- package/dist/crdt/text/index/state.js +15 -17
- package/dist/crdt/text/index/streams.d.ts +10 -5
- package/dist/crdt/text/index/streams.js +78 -27
- package/dist/crdt/text/items.d.ts +10 -3
- package/dist/crdt/text/items.js +7 -0
- package/dist/crdt/text/model.d.ts +77 -62
- package/dist/crdt/text/model.js +84 -169
- package/dist/crdt/text/ranges.d.ts +1 -1
- package/dist/crdt/text/ranges.js +3 -3
- package/dist/crdt/text/rows.d.ts +13 -7
- package/dist/crdt/text/rows.js +24 -7
- package/dist/crdt/text/runs.d.ts +17 -12
- package/dist/crdt/text/runs.js +24 -7
- package/dist/crdt/text/streams.d.ts +26 -13
- package/dist/crdt/text/streams.js +41 -14
- package/dist/crdt/vendor/yjs/UPSTREAM.md +568 -21
- package/dist/crdt/vendor/yjs/dts/global.d.ts +2 -0
- package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
- package/dist/crdt/vendor/yjs/dts/structs/AbstractStruct.d.ts +7 -0
- package/dist/crdt/vendor/yjs/dts/structs/Item.d.ts +194 -10
- package/dist/crdt/vendor/yjs/dts/utils/Doc.d.ts +6 -3
- package/dist/crdt/vendor/yjs/dts/utils/StructStore.d.ts +5 -18
- package/dist/crdt/vendor/yjs/dts/utils/Transaction.d.ts +15 -1
- package/dist/crdt/vendor/yjs/dts/utils/UpdateDecoder.d.ts +14 -6
- package/dist/crdt/vendor/yjs/dts/utils/UpdateEncoder.d.ts +33 -6
- package/dist/crdt/vendor/yjs/dts/utils/ids.d.ts +1 -65
- package/dist/crdt/vendor/yjs/dts/utils/marks.d.ts +6 -1
- package/dist/crdt/vendor/yjs/dts/ynode.d.ts +43 -7
- package/dist/crdt/vendor/yjs/global.d.ts +2 -0
- package/dist/crdt/vendor/yjs/src/index.js +1 -1
- package/dist/crdt/vendor/yjs/src/structs/AbstractStruct.js +10 -0
- package/dist/crdt/vendor/yjs/src/structs/Item.js +610 -51
- package/dist/crdt/vendor/yjs/src/utils/BlockSet.js +18 -9
- package/dist/crdt/vendor/yjs/src/utils/Doc.js +5 -3
- package/dist/crdt/vendor/yjs/src/utils/StructStore.js +5 -0
- package/dist/crdt/vendor/yjs/src/utils/Transaction.js +36 -13
- package/dist/crdt/vendor/yjs/src/utils/UpdateDecoder.js +88 -18
- package/dist/crdt/vendor/yjs/src/utils/UpdateEncoder.js +119 -32
- package/dist/crdt/vendor/yjs/src/utils/encoding.js +13 -1
- package/dist/crdt/vendor/yjs/src/utils/ids.js +7 -7
- package/dist/crdt/vendor/yjs/src/utils/marks.js +193 -8
- package/dist/crdt/vendor/yjs/src/utils/redo.js +1 -1
- package/dist/crdt/vendor/yjs/src/utils/transaction-helpers.js +1 -1
- package/dist/crdt/vendor/yjs/src/utils/updates.js +3 -3
- package/dist/crdt/vendor/yjs/src/ynode.js +177 -12
- package/dist/dnd/autoScroll.d.ts +15 -7
- package/dist/dnd/autoScroll.js +10 -15
- package/dist/dnd/dropIndicator.js +2 -5
- package/dist/dnd/external.d.ts +6 -0
- package/dist/dnd/external.js +17 -0
- package/dist/dnd/geometry.d.ts +2 -0
- package/dist/dnd/geometry.js +3 -4
- package/dist/dnd/placement.d.ts +1 -1
- package/dist/dnd/pragmatic.d.ts +3 -1
- package/dist/dnd/pragmatic.js +12 -2
- package/dist/dnd/vendor/pragmatic/UPSTREAM.md +51 -18
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/drop-target-for-external.d.ts +4 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/drop-target-for-external.js +6 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/element-adapter.d.ts +0 -2
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/element-adapter.js +4 -22
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/external-adapter-types.d.ts +26 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/external-adapter.d.ts +30 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/external-adapter.js +203 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/get-available-items.js +13 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/get-available-types.js +9 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/is-an-available-type.js +19 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/monitor-for-external.d.ts +4 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/adapter/monitor-for-external.js +6 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/honey-pot-fix/make-honey-pot-fix.js +4 -16
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/internal-types.d.ts +1 -8
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/make-adapter/make-drop-target.js +5 -6
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/make-adapter/make-monitor.js +2 -3
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.d.ts +1 -1
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.js +6 -24
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/contains-files.d.ts +2 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/contains-files.js +5 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/get-files.d.ts +3 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/get-files.js +12 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/native-types.d.ts +12 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/util/changing-window/is-entering-window-in-safari.js +10 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/util/changing-window/is-entering-window.js +55 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/entry-point/external.d.ts +4 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/entry-point/external.js +8 -0
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/internal-types.d.ts +0 -4
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/over-element/get-scroll-by.js +16 -72
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/over-element/try-scroll.js +1 -9
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/shared/configuration.js +4 -29
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/shared/get-scroll-change.js +2 -3
- package/dist/edytor.svelte.d.ts +2 -5
- package/dist/edytor.svelte.js +21 -32
- package/dist/events/beforeInputCommands.js +2 -2
- package/dist/events/onBeforeInput.js +1 -1
- package/dist/events/onDrop.d.ts +0 -6
- package/dist/events/onDrop.js +10 -23
- package/dist/events/onInput.d.ts +0 -12
- package/dist/events/onInput.js +1 -67
- package/dist/events/onPageHide.d.ts +3 -0
- package/dist/events/onPageHide.js +16 -0
- package/dist/export/forms.d.ts +627 -0
- package/dist/export/forms.js +749 -0
- package/dist/export/index.d.ts +170 -0
- package/dist/export/index.js +161 -0
- package/dist/export/markdown.d.ts +41 -0
- package/dist/export/markdown.js +585 -0
- package/dist/export/markdownWriter.d.ts +9 -0
- package/dist/export/markdownWriter.js +133 -0
- package/dist/export/mdx.d.ts +15 -0
- package/dist/export/mdx.js +33 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/kinds.js +1 -1
- package/dist/plugins/anchored.svelte.d.ts +21 -25
- package/dist/plugins/anchored.svelte.js +23 -39
- package/dist/plugins/blockHandles/BlockHandleController.svelte.js +24 -32
- package/dist/plugins/blockHandles/dragPreview.d.ts +26 -7
- package/dist/plugins/blockHandles/dragPreview.js +33 -0
- package/dist/plugins/blockMenu/BlockMenuController.svelte.d.ts +5 -0
- package/dist/plugins/blockMenu/BlockMenuController.svelte.js +7 -2
- package/dist/plugins/blockMenu/blockMenuPlugin.js +5 -50
- package/dist/plugins/chrome.d.ts +27 -5
- package/dist/plugins/chrome.js +24 -9
- package/dist/plugins/code/CodePlugin.svelte +12 -9
- package/dist/plugins/code/header.svelte.js +7 -11
- package/dist/plugins/code/languageMenu.svelte.d.ts +5 -2
- package/dist/plugins/code/languageMenu.svelte.js +13 -20
- package/dist/plugins/columns/ColumnsPlugin.svelte +7 -20
- package/dist/plugins/columns/resize.svelte.d.ts +2 -3
- package/dist/plugins/columns/resize.svelte.js +2 -5
- package/dist/plugins/comments/CommentsController.svelte.d.ts +6 -0
- package/dist/plugins/comments/CommentsController.svelte.js +20 -0
- package/dist/plugins/equation/EquationPlugin.svelte +12 -22
- package/dist/plugins/equation/equation.svelte.d.ts +7 -15
- package/dist/plugins/equation/equation.svelte.js +13 -50
- package/dist/plugins/equation/tex.d.ts +17 -0
- package/dist/plugins/equation/tex.js +42 -0
- package/dist/plugins/fileDrop.d.ts +38 -23
- package/dist/plugins/fileDrop.js +82 -76
- package/dist/plugins/find/FindController.svelte.d.ts +5 -0
- package/dist/plugins/find/FindController.svelte.js +14 -14
- package/dist/plugins/find/findPlugin.js +1 -15
- package/dist/plugins/image/ImageChrome.svelte +8 -2
- package/dist/plugins/image/ImagePlugin.svelte +15 -52
- package/dist/plugins/image/controls.svelte.js +16 -2
- package/dist/plugins/image/toolbar.svelte.d.ts +5 -4
- package/dist/plugins/image/toolbar.svelte.js +21 -31
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/list.svelte.d.ts +9 -0
- package/dist/plugins/list.svelte.js +18 -0
- package/dist/plugins/marquee/marqueePlugin.js +0 -4
- package/dist/plugins/media/AudioPlugin.svelte +1 -1
- package/dist/plugins/media/BookmarkPlugin.svelte +6 -97
- package/dist/plugins/media/EmbedPlugin.svelte +5 -90
- package/dist/plugins/media/EmptySlot.svelte +36 -20
- package/dist/plugins/media/EmptySlot.svelte.d.ts +6 -15
- package/dist/plugins/media/FilePlugin.svelte +1 -19
- package/dist/plugins/media/MediaEmpty.svelte +2 -55
- package/dist/plugins/media/MediaEmpty.svelte.d.ts +18 -14
- package/dist/plugins/media/SourceBlock.svelte +142 -52
- package/dist/plugins/media/SourceBlock.svelte.d.ts +10 -4
- package/dist/plugins/media/VideoPlugin.svelte +1 -1
- package/dist/plugins/media/empty.svelte.js +2 -7
- package/dist/plugins/media/media.d.ts +2 -63
- package/dist/plugins/media/media.js +1 -194
- package/dist/plugins/media/sources.d.ts +60 -0
- package/dist/plugins/media/sources.js +165 -0
- package/dist/plugins/media/urlPaste.svelte.d.ts +2 -1
- package/dist/plugins/media/urlPaste.svelte.js +12 -21
- package/dist/plugins/mention/MentionPlugin.svelte +8 -35
- package/dist/plugins/page/PagePlugin.svelte +2 -9
- package/dist/plugins/page/page.js +1 -1
- package/dist/plugins/pageLink/PageLinkPlugin.svelte +6 -13
- package/dist/plugins/richtext/RichTextPlugin.svelte +85 -197
- package/dist/plugins/richtext/body.js +1 -1
- package/dist/plugins/richtext/calloutIcons.svelte.d.ts +2 -2
- package/dist/plugins/richtext/calloutIcons.svelte.js +5 -7
- package/dist/plugins/richtext/richTextOperations.d.ts +1 -19
- package/dist/plugins/richtext/richTextOperations.js +3 -49
- package/dist/plugins/slashMenu/SlashMenuController.svelte.d.ts +2 -0
- package/dist/plugins/slashMenu/SlashMenuController.svelte.js +7 -0
- package/dist/plugins/slashMenu/slashMenuPlugin.js +5 -14
- package/dist/plugins/table/TableChrome.svelte +2 -3
- package/dist/plugins/table/TablePlugin.svelte +20 -54
- package/dist/plugins/table/chrome.svelte.d.ts +5 -2
- package/dist/plugins/table/chrome.svelte.js +30 -54
- package/dist/plugins/table/table.js +3 -3
- package/dist/plugins/toc/TocPlugin.svelte +2 -4
- package/dist/plugins/toolbar/ToolbarController.svelte.d.ts +7 -0
- package/dist/plugins/toolbar/ToolbarController.svelte.js +20 -13
- package/dist/plugins/toolbar/toolbarPlugin.js +19 -53
- package/dist/plugins/triggers/TriggerController.svelte.d.ts +7 -2
- package/dist/plugins/triggers/TriggerController.svelte.js +11 -4
- package/dist/plugins/triggers/place.js +1 -2
- package/dist/plugins/triggers/triggers.d.ts +6 -1
- package/dist/plugins/triggers/triggers.js +12 -13
- package/dist/plugins/uploads.svelte.d.ts +5 -2
- package/dist/plugins/uploads.svelte.js +25 -15
- package/dist/plugins.d.ts +26 -0
- package/dist/plugins.js +0 -24
- package/dist/selection/replaceSelection.js +2 -2
- package/dist/selection/selection.svelte.d.ts +4 -10
- package/dist/selection/selection.svelte.js +7 -11
- package/dist/session/bindings.js +1 -1
- package/dist/session/commands.d.ts +7 -11
- package/dist/session/commands.js +13 -19
- package/dist/session/inputRules.js +1 -1
- package/dist/session/navigation.js +1 -1
- package/dist/session/suggestions.svelte.d.ts +0 -11
- package/dist/session/suggestions.svelte.js +15 -3
- package/dist/session/uploads.d.ts +8 -8
- package/dist/surface/lines.js +1 -3
- package/dist/surface/observer.svelte.d.ts +17 -1
- package/dist/surface/observer.svelte.js +74 -19
- package/dist/surface/overlay.d.ts +0 -14
- package/dist/surface/overlay.js +0 -25
- package/dist/surface/projector.svelte.d.ts +15 -3
- package/dist/surface/projector.svelte.js +60 -9
- package/dist/text/text.svelte.js +3 -13
- package/dist/utils/sanitize.d.ts +38 -0
- package/dist/utils/sanitize.js +82 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +5 -0
- package/package.json +19 -2
- package/dist/crdt/placement/rank.d.ts +0 -87
- package/dist/crdt/placement/rank.js +0 -332
- package/dist/crdt/placement/source.d.ts +0 -43
- package/dist/crdt/placement/source.js +0 -66
- package/dist/crdt/text/delete-index.d.ts +0 -129
- package/dist/crdt/text/delete-index.js +0 -365
- package/dist/crdt/text/deletes.d.ts +0 -76
- package/dist/crdt/text/deletes.js +0 -362
- package/dist/crdt/text/index/anchored.d.ts +0 -17
- package/dist/crdt/text/index/anchored.js +0 -197
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/util/max-z-index.js +0 -3
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/util/supports-popover.js +0 -16
- package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/shared/is-axis-allowed.js +0 -3
- package/dist/plugins/code/LanguageMenu.svelte +0 -25
- package/dist/plugins/code/LanguageMenu.svelte.d.ts +0 -9
- package/dist/plugins/equation/EquationEditor.svelte +0 -27
- package/dist/plugins/equation/EquationEditor.svelte.d.ts +0 -9
- package/dist/plugins/image/ImageToolbarHost.svelte +0 -37
- package/dist/plugins/image/ImageToolbarHost.svelte.d.ts +0 -9
- package/dist/plugins/richtext/CalloutIconPicker.svelte +0 -26
- package/dist/plugins/richtext/CalloutIconPicker.svelte.d.ts +0 -9
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/honey-pot-fix/make-honey-pot-fix.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { bind, bindAll } from '../../bind-event-listener/index.js';
|
|
2
|
-
import { maxZIndex } from '../util/max-z-index.js';
|
|
3
2
|
import { popoverResetUserAgentStyles } from '../util/popover-reset-styles.js';
|
|
4
|
-
import { supportsPopover } from '../util/supports-popover.js';
|
|
5
3
|
import { honeyPotDataAttribute } from './honey-pot-data-attribute.js';
|
|
6
4
|
const honeyPotSize = 2;
|
|
7
5
|
const halfHoneyPotSize = honeyPotSize / 2;
|
|
@@ -137,9 +135,8 @@ function mountHoneyPot({
|
|
|
137
135
|
// including elements using z-index and other stacking contexts.
|
|
138
136
|
// "manual" means no light dismiss — we manage the lifecycle ourselves.
|
|
139
137
|
// Falls back to position:fixed + maxZIndex when the popover API is not available.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
138
|
+
// edytor: every supported engine has the Popover API (no fallback).
|
|
139
|
+
element.setAttribute('popover', 'manual');
|
|
143
140
|
|
|
144
141
|
// can shift during the drag thanks to Firefox
|
|
145
142
|
let clientRect = getHoneyPotRectFor({
|
|
@@ -147,14 +144,7 @@ function mountHoneyPot({
|
|
|
147
144
|
});
|
|
148
145
|
Object.assign(element.style, {
|
|
149
146
|
position: 'fixed',
|
|
150
|
-
...
|
|
151
|
-
// needs to come first as it has 'inset: unset' which
|
|
152
|
-
// needs to be overridden by our top / left values
|
|
153
|
-
popoverResetUserAgentStyles : {
|
|
154
|
-
// Fallback: using maximum possible z-index so that this element
|
|
155
|
-
// will always be on top of other positioned content.
|
|
156
|
-
zIndex: maxZIndex
|
|
157
|
-
}),
|
|
147
|
+
...popoverResetUserAgentStyles,
|
|
158
148
|
// Setting a background color explicitly to avoid any inherited styles.
|
|
159
149
|
// Looks like this could be `opacity: 0`, but worried that _might_
|
|
160
150
|
// cause the element to be ignored on some platforms.
|
|
@@ -172,9 +162,7 @@ function mountHoneyPot({
|
|
|
172
162
|
})
|
|
173
163
|
});
|
|
174
164
|
document.body.appendChild(element);
|
|
175
|
-
|
|
176
|
-
element.showPopover();
|
|
177
|
-
}
|
|
165
|
+
element.showPopover();
|
|
178
166
|
|
|
179
167
|
/**
|
|
180
168
|
* 🦊 In firefox we can get `"pointermove"` events after the drag
|
|
@@ -243,9 +243,7 @@ export type MonitorGetFeedbackArgs<DragType extends AllDragTypes> = {
|
|
|
243
243
|
*/
|
|
244
244
|
source: DragType['payload'];
|
|
245
245
|
};
|
|
246
|
-
export type MonitorArgs<DragType extends AllDragTypes> = Partial<AllEvents<DragType
|
|
247
|
-
canMonitor?: (args: MonitorGetFeedbackArgs<DragType>) => boolean;
|
|
248
|
-
};
|
|
246
|
+
export type MonitorArgs<DragType extends AllDragTypes> = Partial<AllEvents<DragType>>;
|
|
249
247
|
export type DropTargetGetFeedbackArgs<DragType extends AllDragTypes> = {
|
|
250
248
|
/**
|
|
251
249
|
* The users _current_ input
|
|
@@ -318,11 +316,6 @@ export type DropTargetArgs<DragType extends AllDragTypes> = {
|
|
|
318
316
|
* dropped on.
|
|
319
317
|
*/
|
|
320
318
|
canDrop?: (args: DropTargetGetFeedbackArgs<DragType>) => boolean;
|
|
321
|
-
/**
|
|
322
|
-
* Optionally provide a _drop effect_ to be applied when
|
|
323
|
-
* this drop target is the innermost drop target being dragged over.
|
|
324
|
-
*/
|
|
325
|
-
getDropEffect?: (args: DropTargetGetFeedbackArgs<DragType>) => DropTargetAllowedDropEffect;
|
|
326
319
|
/**
|
|
327
320
|
* Return `true` if you want your drop target to hold onto
|
|
328
321
|
* selection after the user is no longer dragging over this drop target.
|
|
@@ -51,7 +51,7 @@ export function makeDropTarget({
|
|
|
51
51
|
input,
|
|
52
52
|
result = []
|
|
53
53
|
}) {
|
|
54
|
-
var _args$getData, _args$getData2
|
|
54
|
+
var _args$getData, _args$getData2;
|
|
55
55
|
if (target == null) {
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
@@ -104,7 +104,8 @@ export function makeDropTarget({
|
|
|
104
104
|
|
|
105
105
|
// calculate our new record
|
|
106
106
|
const data = (_args$getData = (_args$getData2 = args.getData) === null || _args$getData2 === void 0 ? void 0 : _args$getData2.call(args, feedback)) !== null && _args$getData !== void 0 ? _args$getData : {};
|
|
107
|
-
|
|
107
|
+
// edytor: no drop target sets `getDropEffect`.
|
|
108
|
+
const dropEffect = defaultDropEffect;
|
|
108
109
|
const record = {
|
|
109
110
|
data,
|
|
110
111
|
element: args.element,
|
|
@@ -150,7 +151,6 @@ export function makeDropTarget({
|
|
|
150
151
|
const isCurrent = new Set(payload.location.current.dropTargets.map(record => record.element));
|
|
151
152
|
const visited = new Set();
|
|
152
153
|
for (const record of payload.location.previous.dropTargets) {
|
|
153
|
-
var _entry$onDropTargetCh;
|
|
154
154
|
visited.add(record.element);
|
|
155
155
|
const entry = registry.get(record.element);
|
|
156
156
|
const isOver = isCurrent.has(record.element);
|
|
@@ -158,7 +158,7 @@ export function makeDropTarget({
|
|
|
158
158
|
...payload,
|
|
159
159
|
self: record
|
|
160
160
|
};
|
|
161
|
-
|
|
161
|
+
// edytor: no drop target sets `onDropTargetChange`.
|
|
162
162
|
|
|
163
163
|
// if we cannot find the drop target in the current array, then it has been left
|
|
164
164
|
if (!isOver) {
|
|
@@ -167,7 +167,7 @@ export function makeDropTarget({
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
for (const record of payload.location.current.dropTargets) {
|
|
170
|
-
var _entry$
|
|
170
|
+
var _entry$onDragEnter;
|
|
171
171
|
// already published an update to this drop target
|
|
172
172
|
if (visited.has(record.element)) {
|
|
173
173
|
continue;
|
|
@@ -178,7 +178,6 @@ export function makeDropTarget({
|
|
|
178
178
|
self: record
|
|
179
179
|
};
|
|
180
180
|
const entry = registry.get(record.element);
|
|
181
|
-
entry === null || entry === void 0 ? void 0 : (_entry$onDropTargetCh2 = entry.onDropTargetChange) === null || _entry$onDropTargetCh2 === void 0 ? void 0 : _entry$onDropTargetCh2.call(entry, args);
|
|
182
181
|
entry === null || entry === void 0 ? void 0 : (_entry$onDragEnter = entry.onDragEnter) === null || _entry$onDragEnter === void 0 ? void 0 : _entry$onDragEnter.call(entry, args);
|
|
183
182
|
}
|
|
184
183
|
}
|
|
@@ -9,9 +9,8 @@ export function makeMonitor() {
|
|
|
9
9
|
// Monitor is allowed to monitor events if:
|
|
10
10
|
// 1. It has no `canMonitor` function (default is that a monitor can listen to everything)
|
|
11
11
|
// 2. `canMonitor` returns true
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
// edytor: no monitor sets `canMonitor`.
|
|
13
|
+
dragging.active.add(monitor);
|
|
15
14
|
}
|
|
16
15
|
function monitorForConsumers(args) {
|
|
17
16
|
// We are giving each `args` a new reference so that you
|
|
@@ -29,7 +29,7 @@ type RenderFn = ({ container, }: {
|
|
|
29
29
|
* });
|
|
30
30
|
*/
|
|
31
31
|
export declare function setCustomNativeDragPreview({ render, nativeSetDragImage, getOffset, }: {
|
|
32
|
-
getOffset
|
|
32
|
+
getOffset: GetOffsetFn;
|
|
33
33
|
render: RenderFn;
|
|
34
34
|
nativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'];
|
|
35
35
|
}): void;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { monitorForElements } from '../../../adapter/element-adapter.js';
|
|
2
2
|
import { isSafari } from '../../../util/is-safari.js';
|
|
3
|
-
import { maxZIndex } from '../../../util/max-z-index.js';
|
|
4
3
|
import { popoverResetUserAgentStyles } from '../../../util/popover-reset-styles.js';
|
|
5
|
-
import { supportsPopover } from '../../../util/supports-popover.js';
|
|
6
4
|
|
|
7
5
|
/** A function to remove the element that has been added to the `container`.
|
|
8
6
|
* @example () => root.unmount()
|
|
@@ -10,13 +8,6 @@ import { supportsPopover } from '../../../util/supports-popover.js';
|
|
|
10
8
|
|
|
11
9
|
/** A function that will render a preview element into a `container` `HTMLElement` */
|
|
12
10
|
|
|
13
|
-
/** By default we use the build in values for the native drag preview: {x: 0, y: 0} */
|
|
14
|
-
function defaultOffset() {
|
|
15
|
-
return {
|
|
16
|
-
x: 0,
|
|
17
|
-
y: 0
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
11
|
|
|
21
12
|
/** This function provides the ability to mount an element for it to be used as the native drag preview
|
|
22
13
|
*
|
|
@@ -37,7 +28,8 @@ function defaultOffset() {
|
|
|
37
28
|
export function setCustomNativeDragPreview({
|
|
38
29
|
render,
|
|
39
30
|
nativeSetDragImage,
|
|
40
|
-
|
|
31
|
+
// edytor: every caller gives its `getOffset`.
|
|
32
|
+
getOffset
|
|
41
33
|
}) {
|
|
42
34
|
const container = document.createElement('div');
|
|
43
35
|
|
|
@@ -50,23 +42,15 @@ export function setCustomNativeDragPreview({
|
|
|
50
42
|
// Falls back to position:fixed + maxZIndex when the popover API is not available.
|
|
51
43
|
// Note: the popover attribute must be set before the element is in the DOM.
|
|
52
44
|
// `.showPopover()` is called further below after the element is appended to the body.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
45
|
+
// edytor: every supported engine has the Popover API (no fallback).
|
|
46
|
+
container.setAttribute('popover', 'manual');
|
|
56
47
|
Object.assign(container.style, {
|
|
57
48
|
// Ensuring we don't cause reflow when adding the element to the page
|
|
58
49
|
// Using `position:fixed` rather than `position:absolute` so we are
|
|
59
50
|
// positioned on the current viewport.
|
|
60
51
|
// `position:fixed` also creates a new stacking context, so we don't need to do that here
|
|
61
52
|
position: 'fixed',
|
|
62
|
-
...
|
|
63
|
-
// needs to come first as it has 'inset: unset' which
|
|
64
|
-
// needs to be overridden by our top / left values
|
|
65
|
-
popoverResetUserAgentStyles : {
|
|
66
|
-
// Fallback: using maximum possible z-index so that this element
|
|
67
|
-
// will always be on top of other positioned content.
|
|
68
|
-
zIndex: maxZIndex
|
|
69
|
-
}),
|
|
53
|
+
...popoverResetUserAgentStyles,
|
|
70
54
|
// According to `mdn`, the element can be offscreen:
|
|
71
55
|
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage#imgelement
|
|
72
56
|
//
|
|
@@ -82,9 +66,7 @@ export function setCustomNativeDragPreview({
|
|
|
82
66
|
document.body.append(container);
|
|
83
67
|
|
|
84
68
|
// `.showPopover()` must be called after the element is in the DOM.
|
|
85
|
-
|
|
86
|
-
container.showPopover();
|
|
87
|
-
}
|
|
69
|
+
container.showPopover();
|
|
88
70
|
const unmount = render({
|
|
89
71
|
container
|
|
90
72
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Obtain an array of the dragged `File`s */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
3
|
+
export function getFiles({
|
|
4
|
+
source
|
|
5
|
+
}) {
|
|
6
|
+
return source.items
|
|
7
|
+
// unlike other media types, for files:
|
|
8
|
+
// item.kind is 'file'
|
|
9
|
+
// item.type is the type of file eg 'image/jpg'
|
|
10
|
+
// for other media types, item.type is the mime format
|
|
11
|
+
.filter(item => item.kind === 'file').map(item => item.getAsFile()).filter(file => file != null);
|
|
12
|
+
}
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/public-utils/external/native-types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExternalDragPayload } from '../../internal-types.js';
|
|
2
|
+
/** `ContainsSource` works for
|
|
3
|
+
* 1. `monitorForNative` > `canMonitor()`
|
|
4
|
+
* 2. `dropTargetForNative` > `canDrop()`
|
|
5
|
+
*
|
|
6
|
+
* We are also using `SourcePayload` as the parameter type for all native getters.
|
|
7
|
+
* For example, `getFiles({source}: SourcePayload)`
|
|
8
|
+
*/
|
|
9
|
+
export type ContainsSource = {
|
|
10
|
+
source: ExternalDragPayload;
|
|
11
|
+
};
|
|
12
|
+
export type PredicateFn = (args: ContainsSource) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isSafari } from '../is-safari.js';
|
|
2
|
+
import { symbols } from './count-events-for-safari.js';
|
|
3
|
+
export function isEnteringWindowInSafari({
|
|
4
|
+
dragEnter
|
|
5
|
+
}) {
|
|
6
|
+
if (!isSafari()) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return dragEnter.hasOwnProperty(symbols.isEnteringWindow);
|
|
10
|
+
}
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop/util/changing-window/is-entering-window.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { isFirefox } from '../is-firefox.js';
|
|
2
|
+
import { isSafari } from '../is-safari.js';
|
|
3
|
+
import { isEnteringWindowInSafari } from './is-entering-window-in-safari.js';
|
|
4
|
+
import { isFromAnotherWindow } from './is-from-another-window.js';
|
|
5
|
+
export function isEnteringWindow({
|
|
6
|
+
dragEnter
|
|
7
|
+
}) {
|
|
8
|
+
const {
|
|
9
|
+
type,
|
|
10
|
+
relatedTarget
|
|
11
|
+
} = dragEnter;
|
|
12
|
+
if (type !== 'dragenter') {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (isSafari()) {
|
|
16
|
+
return isEnteringWindowInSafari({
|
|
17
|
+
dragEnter
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// standard check
|
|
22
|
+
if (relatedTarget == null) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 🦊 Exception: `iframe` in Firefox (`125.0`)
|
|
28
|
+
*
|
|
29
|
+
* Case 1: parent `window` → child `iframe`
|
|
30
|
+
* `relatedTarget` is the `iframe` element in the parent `window`
|
|
31
|
+
* (foreign element)
|
|
32
|
+
*
|
|
33
|
+
* Case 2: child `iframe` → parent `window`
|
|
34
|
+
* `relatedTarget` is an element inside the child `iframe`
|
|
35
|
+
* (foreign element)
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
if (isFirefox()) {
|
|
39
|
+
return isFromAnotherWindow(relatedTarget);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 🌏 Exception: `iframe` in Chrome (`124.0`)
|
|
44
|
+
*
|
|
45
|
+
* Case 1: parent `window` → child `iframe`
|
|
46
|
+
* `relatedTarget` is `null` *(standard check)*
|
|
47
|
+
*
|
|
48
|
+
* Case 2: child `iframe` → parent `window`
|
|
49
|
+
* `relatedTarget` is the `iframe` element in the parent `window`
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
// Case 2
|
|
53
|
+
// Using `instanceof` check as the element will be in the same `window`
|
|
54
|
+
return relatedTarget instanceof HTMLIFrameElement;
|
|
55
|
+
}
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/entry-point/external.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ExternalDragType, CleanupFn } from '../../pragmatic-drag-and-drop/entry-point/types.js';
|
|
2
|
+
import type { ElementAutoScrollArgs, WindowAutoScrollArgs } from '../internal-types.js';
|
|
3
|
+
export declare const autoScrollForExternal: (args: ElementAutoScrollArgs<ExternalDragType>) => CleanupFn;
|
|
4
|
+
export declare const autoScrollWindowForExternal: (args?: WindowAutoScrollArgs<ExternalDragType>) => CleanupFn;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { monitorForExternal } from '../../pragmatic-drag-and-drop/adapter/monitor-for-external.js';
|
|
2
|
+
import { makeApi } from '../over-element/make-api.js';
|
|
3
|
+
const api = makeApi({
|
|
4
|
+
monitor: monitorForExternal
|
|
5
|
+
});
|
|
6
|
+
export const autoScrollForExternal = api.autoScroll;
|
|
7
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
8
|
+
export const autoScrollWindowForExternal = api.autoScrollWindow;
|
|
@@ -37,13 +37,9 @@ export type PublicConfig = Partial<{
|
|
|
37
37
|
export type ElementAutoScrollArgs<DragType extends AllDragTypes> = {
|
|
38
38
|
element: Element;
|
|
39
39
|
canScroll?: (args: ElementGetFeedbackArgs<DragType>) => boolean;
|
|
40
|
-
getAllowedAxis?: (args: ElementGetFeedbackArgs<DragType>) => AllowedAxis;
|
|
41
|
-
getConfiguration?: (args: ElementGetFeedbackArgs<DragType>) => PublicConfig;
|
|
42
40
|
};
|
|
43
41
|
export type WindowAutoScrollArgs<DragType extends AllDragTypes> = {
|
|
44
42
|
canScroll?: (args: WindowGetFeedbackArgs<DragType>) => boolean;
|
|
45
|
-
getAllowedAxis?: (args: WindowGetFeedbackArgs<DragType>) => AllowedAxis;
|
|
46
|
-
getConfiguration?: (args: WindowGetFeedbackArgs<DragType>) => PublicConfig;
|
|
47
43
|
};
|
|
48
44
|
export type Side = 'start' | 'end';
|
|
49
45
|
export type Axis = 'vertical' | 'horizontal';
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/over-element/get-scroll-by.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { canScrollOnEdge } from '../shared/can-scroll-on-edge.js';
|
|
2
|
-
import {
|
|
2
|
+
import { edges } from '../shared/edges.js';
|
|
3
3
|
import { getOverElementHitbox } from '../shared/get-over-element-hitbox.js';
|
|
4
4
|
import { getScrollChange } from '../shared/get-scroll-change.js';
|
|
5
|
-
import { isAxisAllowed } from '../shared/is-axis-allowed.js';
|
|
6
5
|
import { isWithin } from '../shared/is-within.js';
|
|
7
6
|
function getRectDefault(element) {
|
|
8
7
|
return element.getBoundingClientRect();
|
|
@@ -13,7 +12,6 @@ export function getScrollBy({
|
|
|
13
12
|
timeSinceLastFrame,
|
|
14
13
|
engagement,
|
|
15
14
|
config,
|
|
16
|
-
allowedAxis,
|
|
17
15
|
getRect = getRectDefault
|
|
18
16
|
}) {
|
|
19
17
|
const client = {
|
|
@@ -26,15 +24,6 @@ export function getScrollBy({
|
|
|
26
24
|
clientRect,
|
|
27
25
|
config
|
|
28
26
|
});
|
|
29
|
-
const axis = edgeAxisLookup[edge];
|
|
30
|
-
|
|
31
|
-
// Note: changing the allowed axis during a drag will not
|
|
32
|
-
// reset time dampening. It was decided it would be too
|
|
33
|
-
// complex to implement initially, and we can add it
|
|
34
|
-
// later if needed.
|
|
35
|
-
if (!isAxisAllowed(axis, allowedAxis)) {
|
|
36
|
-
return map;
|
|
37
|
-
}
|
|
38
27
|
if (!isWithin({
|
|
39
28
|
client,
|
|
40
29
|
clientRect: hitbox
|
|
@@ -50,66 +39,21 @@ export function getScrollBy({
|
|
|
50
39
|
});
|
|
51
40
|
return map;
|
|
52
41
|
}, new Map());
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const rightEdge = scrollableEdges.get('right');
|
|
69
|
-
if (rightEdge) {
|
|
70
|
-
return getScrollChange({
|
|
71
|
-
client,
|
|
72
|
-
edge: rightEdge.edge,
|
|
73
|
-
hitbox: rightEdge.hitbox,
|
|
74
|
-
axis,
|
|
75
|
-
timeSinceLastFrame,
|
|
76
|
-
engagement,
|
|
77
|
-
isDistanceDampeningEnabled: true,
|
|
78
|
-
config
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return 0;
|
|
82
|
-
})();
|
|
83
|
-
const top = (() => {
|
|
84
|
-
const axis = 'vertical';
|
|
85
|
-
const bottomEdge = scrollableEdges.get('bottom');
|
|
86
|
-
if (bottomEdge) {
|
|
87
|
-
return getScrollChange({
|
|
88
|
-
client,
|
|
89
|
-
edge: bottomEdge.edge,
|
|
90
|
-
hitbox: bottomEdge.hitbox,
|
|
91
|
-
axis,
|
|
92
|
-
timeSinceLastFrame,
|
|
93
|
-
engagement,
|
|
94
|
-
isDistanceDampeningEnabled: true,
|
|
95
|
-
config
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const topEdge = scrollableEdges.get('top');
|
|
99
|
-
if (topEdge) {
|
|
100
|
-
return getScrollChange({
|
|
101
|
-
client,
|
|
102
|
-
edge: topEdge.edge,
|
|
103
|
-
hitbox: topEdge.hitbox,
|
|
104
|
-
axis,
|
|
105
|
-
timeSinceLastFrame,
|
|
106
|
-
engagement,
|
|
107
|
-
isDistanceDampeningEnabled: true,
|
|
108
|
-
config
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return 0;
|
|
112
|
-
})();
|
|
42
|
+
// edytor: one change per axis, the first of its edges the pointer is over.
|
|
43
|
+
const change = (axis, first, second) => {
|
|
44
|
+
const entry = scrollableEdges.get(first) ?? scrollableEdges.get(second);
|
|
45
|
+
return entry ? getScrollChange({
|
|
46
|
+
client,
|
|
47
|
+
edge: entry.edge,
|
|
48
|
+
hitbox: entry.hitbox,
|
|
49
|
+
axis,
|
|
50
|
+
timeSinceLastFrame,
|
|
51
|
+
engagement,
|
|
52
|
+
config
|
|
53
|
+
}) : 0;
|
|
54
|
+
};
|
|
55
|
+
const left = change('horizontal', 'left', 'right');
|
|
56
|
+
const top = change('vertical', 'bottom', 'top');
|
|
113
57
|
return {
|
|
114
58
|
left,
|
|
115
59
|
top
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/over-element/try-scroll.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { internalConfig as config } from '../shared/configuration.js';
|
|
2
2
|
import { markAndGetEngagement } from '../shared/engagement-history.js';
|
|
3
3
|
import { selector } from './data-attributes.js';
|
|
4
4
|
import { getScrollBy } from './get-scroll-by.js';
|
|
@@ -16,7 +16,6 @@ function tryScrollElements({
|
|
|
16
16
|
left: true
|
|
17
17
|
}
|
|
18
18
|
}) {
|
|
19
|
-
var _container$getConfigu, _container$getAllowed, _container$getAllowed2;
|
|
20
19
|
// we cannot do any more scrolling
|
|
21
20
|
if (!isScrollingAvailable(available)) {
|
|
22
21
|
return available;
|
|
@@ -64,14 +63,11 @@ function tryScrollElements({
|
|
|
64
63
|
// Marking engagement even if no edges are scrollable.
|
|
65
64
|
// We are marking engagement as soon as the element is scrolled over
|
|
66
65
|
const engagement = markAndGetEngagement(element);
|
|
67
|
-
const config = getInternalConfig((_container$getConfigu = container.getConfiguration) === null || _container$getConfigu === void 0 ? void 0 : _container$getConfigu.call(container, feedback));
|
|
68
|
-
const allowedAxis = (_container$getAllowed = (_container$getAllowed2 = container.getAllowedAxis) === null || _container$getAllowed2 === void 0 ? void 0 : _container$getAllowed2.call(container, feedback)) !== null && _container$getAllowed !== void 0 ? _container$getAllowed : 'all';
|
|
69
66
|
const scrollBy = getScrollBy({
|
|
70
67
|
element,
|
|
71
68
|
engagement,
|
|
72
69
|
input,
|
|
73
70
|
timeSinceLastFrame,
|
|
74
|
-
allowedAxis,
|
|
75
71
|
config
|
|
76
72
|
});
|
|
77
73
|
|
|
@@ -111,7 +107,6 @@ function tryScrollWindow({
|
|
|
111
107
|
element
|
|
112
108
|
};
|
|
113
109
|
for (const entry of entries) {
|
|
114
|
-
var _entry$getConfigurati, _entry$getAllowedAxis, _entry$getAllowedAxis2;
|
|
115
110
|
// this entry is not allowing scrolling, we need to look for another
|
|
116
111
|
if (entry.canScroll && !entry.canScroll(feedback)) {
|
|
117
112
|
continue;
|
|
@@ -120,14 +115,11 @@ function tryScrollWindow({
|
|
|
120
115
|
// Note: if we had an event for when the user is leaving a tab
|
|
121
116
|
// we _could_ conceptually reset the engagement
|
|
122
117
|
const engagement = markAndGetEngagement(element);
|
|
123
|
-
const config = getInternalConfig((_entry$getConfigurati = entry.getConfiguration) === null || _entry$getConfigurati === void 0 ? void 0 : _entry$getConfigurati.call(entry, feedback));
|
|
124
|
-
const allowedAxis = (_entry$getAllowedAxis = (_entry$getAllowedAxis2 = entry.getAllowedAxis) === null || _entry$getAllowedAxis2 === void 0 ? void 0 : _entry$getAllowedAxis2.call(entry, feedback)) !== null && _entry$getAllowedAxis !== void 0 ? _entry$getAllowedAxis : 'all';
|
|
125
118
|
const scrollBy = getScrollBy({
|
|
126
119
|
element,
|
|
127
120
|
engagement,
|
|
128
121
|
input,
|
|
129
122
|
config,
|
|
130
|
-
allowedAxis,
|
|
131
123
|
getRect: element => DOMRect.fromRect({
|
|
132
124
|
y: 0,
|
|
133
125
|
x: 0,
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/shared/configuration.js
CHANGED
|
@@ -17,33 +17,8 @@ const baseConfig = {
|
|
|
17
17
|
maxMainAxisHitboxSize: 180
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* I explored trying to make the max scroll speed dynamic based on particular factors.
|
|
25
|
-
* However, it ended up being difficult to find a _perfect_ formula.
|
|
26
|
-
*
|
|
27
|
-
* Likely the perfect answer would involve:
|
|
28
|
-
* - the size of the scrollable element
|
|
29
|
-
* - the size of the scrollable element relative to the screen size
|
|
30
|
-
* - the size of the drag preview
|
|
31
|
-
* - the size of elements being scrolled in scrollable elements (expensive and difficult to compute)
|
|
32
|
-
*/
|
|
33
|
-
const maxPixelScrollPerSecond = {
|
|
34
|
-
// What the value would be if we were scrolling at 15px per frame at 60fps.
|
|
35
|
-
// This is the default as it works well for most experiences.
|
|
36
|
-
// In certain scenarios though it can feel a bit slow.
|
|
37
|
-
standard: 15 * 60,
|
|
38
|
-
// What the value would be if we were scrolling at 25px per frame at 60fps.
|
|
39
|
-
// This is not the default as it feels too fast for a lot of experiences.
|
|
40
|
-
fast: 25 * 60
|
|
20
|
+
// edytor: no element sets `getConfiguration`: the standard speed only.
|
|
21
|
+
export const internalConfig = {
|
|
22
|
+
...baseConfig,
|
|
23
|
+
maxPixelScrollPerSecond: 15 * 60
|
|
41
24
|
};
|
|
42
|
-
export function getInternalConfig(provided) {
|
|
43
|
-
var _provided$maxScrollSp;
|
|
44
|
-
return {
|
|
45
|
-
...baseConfig,
|
|
46
|
-
// only allowing limited control over the config at this stage
|
|
47
|
-
maxPixelScrollPerSecond: maxPixelScrollPerSecond[(_provided$maxScrollSp = provided === null || provided === void 0 ? void 0 : provided.maxScrollSpeed) !== null && _provided$maxScrollSp !== void 0 ? _provided$maxScrollSp : 'standard']
|
|
48
|
-
};
|
|
49
|
-
}
|
package/dist/dnd/vendor/pragmatic/pragmatic-drag-and-drop-auto-scroll/shared/get-scroll-change.js
CHANGED
|
@@ -62,7 +62,6 @@ export function getScrollChange({
|
|
|
62
62
|
axis,
|
|
63
63
|
hitbox,
|
|
64
64
|
edge,
|
|
65
|
-
isDistanceDampeningEnabled,
|
|
66
65
|
config
|
|
67
66
|
}) {
|
|
68
67
|
// We have two forms of speed dampening:
|
|
@@ -77,13 +76,13 @@ export function getScrollChange({
|
|
|
77
76
|
timeSinceLastFrame,
|
|
78
77
|
config
|
|
79
78
|
});
|
|
80
|
-
const percentageDistanceDampening =
|
|
79
|
+
const percentageDistanceDampening = getDistanceDampening({
|
|
81
80
|
client,
|
|
82
81
|
edge,
|
|
83
82
|
hitbox,
|
|
84
83
|
axis,
|
|
85
84
|
config
|
|
86
|
-
})
|
|
85
|
+
});
|
|
87
86
|
|
|
88
87
|
// Dampen speed by time
|
|
89
88
|
const percentageThroughTimeDampening = getPercentageInRange({
|
package/dist/edytor.svelte.d.ts
CHANGED
|
@@ -34,12 +34,9 @@ export type EdytorOptions = {
|
|
|
34
34
|
* The assembled document this view renders — shared facade, history,
|
|
35
35
|
* awareness and semantics live on it (see `crdt/document.ts`). When
|
|
36
36
|
* injected the view borrows it: `destroy()` releases only view-owned
|
|
37
|
-
* resources. When absent the view
|
|
38
|
-
* around `doc`/`awareness` (the legacy path — same behavior as before).
|
|
37
|
+
* resources. When absent the view owns a fresh one.
|
|
39
38
|
*/
|
|
40
39
|
document?: EdytorDocument;
|
|
41
|
-
doc?: YDoc;
|
|
42
|
-
awareness?: Awareness;
|
|
43
40
|
/** The local author of a view-owned document (with `document`, set it there). */
|
|
44
41
|
actor?: DocumentActor;
|
|
45
42
|
/** A view-owned document's `requireHydration` (with `document`, set it there). */
|
|
@@ -221,7 +218,7 @@ export declare class Edytor {
|
|
|
221
218
|
* discarded.
|
|
222
219
|
*
|
|
223
220
|
* Releases every listener the editor holds on potentially-SHARED objects
|
|
224
|
-
* — an injected
|
|
221
|
+
* — an injected document outlives a single editor, so an
|
|
225
222
|
* undestroyed mount leaks a facade `update` listener and the undo
|
|
226
223
|
* manager's doc observers forever.
|
|
227
224
|
*
|