@domternal/extension-block-menu 0.7.0 → 0.7.1

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/index.d.cts CHANGED
@@ -242,14 +242,14 @@ interface BlockHandleOptions {
242
242
  */
243
243
  nestThreshold?: number;
244
244
  /**
245
- * Show a custom drop indicator line during drag-from-handle that
246
- * mirrors EXACTLY where the drop will land. Replaces the need for
247
- * `prosemirror-dropcursor` for our drag flow - `dropcursor` uses
248
- * PM's default `posAtCoords` which can disagree with our resolver
249
- * (especially in side-gutter / inter-block-gap drops).
250
- *
251
- * Set to `false` if you want the standard `prosemirror-dropcursor`
252
- * behaviour or are providing your own indicator.
245
+ * Custom drop indicator that mirrors exactly where a handle-drag will
246
+ * land. Replaces `prosemirror-dropcursor` for handle drags (PM's
247
+ * `posAtCoords` can disagree with our resolver in the side gutter /
248
+ * inter-block gap). While dragging, the editor gets a
249
+ * `dm-block-handle-dragging` class so the theme can hide the native
250
+ * `.ProseMirror-dropcursor` for this drag only; non-handle drags
251
+ * (text selection, external file drops) keep the native cursor.
252
+ * Set to `false` to use the native dropcursor instead.
253
253
  * @default true
254
254
  */
255
255
  dropIndicator?: boolean;
package/dist/index.d.ts CHANGED
@@ -242,14 +242,14 @@ interface BlockHandleOptions {
242
242
  */
243
243
  nestThreshold?: number;
244
244
  /**
245
- * Show a custom drop indicator line during drag-from-handle that
246
- * mirrors EXACTLY where the drop will land. Replaces the need for
247
- * `prosemirror-dropcursor` for our drag flow - `dropcursor` uses
248
- * PM's default `posAtCoords` which can disagree with our resolver
249
- * (especially in side-gutter / inter-block-gap drops).
250
- *
251
- * Set to `false` if you want the standard `prosemirror-dropcursor`
252
- * behaviour or are providing your own indicator.
245
+ * Custom drop indicator that mirrors exactly where a handle-drag will
246
+ * land. Replaces `prosemirror-dropcursor` for handle drags (PM's
247
+ * `posAtCoords` can disagree with our resolver in the side gutter /
248
+ * inter-block gap). While dragging, the editor gets a
249
+ * `dm-block-handle-dragging` class so the theme can hide the native
250
+ * `.ProseMirror-dropcursor` for this drag only; non-handle drags
251
+ * (text selection, external file drops) keep the native cursor.
252
+ * Set to `false` to use the native dropcursor instead.
253
253
  * @default true
254
254
  */
255
255
  dropIndicator?: boolean;
package/dist/index.js CHANGED
@@ -1165,6 +1165,7 @@ function createBlockHandlePlugin(options) {
1165
1165
  }, 0);
1166
1166
  startAutoScroll();
1167
1167
  startDragListeners();
1168
+ if (dropIndicator) editorEl?.classList.add("dm-block-handle-dragging");
1168
1169
  };
1169
1170
  const teardownDragPreview = () => {
1170
1171
  if (dragPreview) {
@@ -1181,6 +1182,7 @@ function createBlockHandlePlugin(options) {
1181
1182
  hideDropIndicator();
1182
1183
  teardownDragPreview();
1183
1184
  releaseDragPress();
1185
+ editorEl?.classList.remove("dm-block-handle-dragging");
1184
1186
  };
1185
1187
  return new Plugin({
1186
1188
  key: pluginKey,
@@ -1276,6 +1278,7 @@ function createBlockHandlePlugin(options) {
1276
1278
  dragBtn.removeEventListener("dragstart", onDragStart);
1277
1279
  dragBtn.removeEventListener("dragend", onDragEnd);
1278
1280
  editorEl?.classList.remove("dm-editor--has-block-handle");
1281
+ editorEl?.classList.remove("dm-block-handle-dragging");
1279
1282
  root.remove();
1280
1283
  editorEl = null;
1281
1284
  hoverEl = null;