@ckeditor/ckeditor5-fullscreen 49.0.0-alpha.4 → 49.0.0-alpha.6

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.
@@ -254,8 +254,8 @@ export declare class FullscreenAbstractEditorHandler {
254
254
  */
255
255
  private _restoreRevisionHistoryCallbacks;
256
256
  /**
257
- * Adds an event listener when the dialog opens to adjust its position in fullscreen mode,
258
- * utilizing the empty space on the right side of the editable element.
257
+ * Adjusts the position of the open dialog to the editable moved to the fullscreen mode, and adds an event listener when
258
+ * the dialog opens to adjust its position in fullscreen mode, utilizing the empty space on the right side of the editable element.
259
259
  */
260
260
  private _registerFullscreenDialogPositionAdjustments;
261
261
  /**
@@ -273,7 +273,7 @@ export declare class FullscreenAbstractEditorHandler {
273
273
  /**
274
274
  * Adjusts the dialog position to utilize the empty space on the right side of the editable.
275
275
  * The new dialog position should be on the right side of the fullscreen view with a 30px margin.
276
- * Only dialogs with the position set to "editor-top-side" should have their position changed.
276
+ * Only dialogs with the position set to "editor-top-side" and not dragged by the user should have their position changed.
277
277
  */
278
278
  private _setNewDialogPosition;
279
279
  /**
package/dist/index.js CHANGED
@@ -410,7 +410,6 @@ var FullscreenAbstractEditorHandler = class {
410
410
  /* v8 ignore if -- @preserve */
411
411
  if (this._editor.plugins.has("AITabs")) this._handleAITabsTransfer();
412
412
  if (this._editor.plugins.has("SourceEditing") && this._editor.plugins.has("DocumentOutlineUI")) this._editor.plugins.get("SourceEditing").on("change:isSourceEditingMode", this._sourceEditingCallback);
413
- if (this._editor.plugins.has("Dialog")) this._registerFullscreenDialogPositionAdjustments();
414
413
  const elementsToKeepVisible = [
415
414
  this.getWrapper(),
416
415
  this._editor.ui.view.body.bodyCollectionContainer,
@@ -427,6 +426,7 @@ var FullscreenAbstractEditorHandler = class {
427
426
  this._adjustVisibleElements();
428
427
  this._setupResizeObserver();
429
428
  this._disableContextualBalloonPositionHandler = registerFullscreenBalloonOffsetCorrection(this._editor, this.getWrapper());
429
+ if (this._editor.plugins.has("Dialog")) this._registerFullscreenDialogPositionAdjustments();
430
430
  this._editor.ui.update();
431
431
  if (this._editor.config.get("fullscreen.onEnterCallback")) this._editor.config.get("fullscreen.onEnterCallback")(this.getWrapper());
432
432
  }
@@ -674,12 +674,14 @@ var FullscreenAbstractEditorHandler = class {
674
674
  });
675
675
  }
676
676
  /**
677
- * Adds an event listener when the dialog opens to adjust its position in fullscreen mode,
678
- * utilizing the empty space on the right side of the editable element.
677
+ * Adjusts the position of the open dialog to the editable moved to the fullscreen mode, and adds an event listener when
678
+ * the dialog opens to adjust its position in fullscreen mode, utilizing the empty space on the right side of the editable element.
679
679
  */
680
680
  _registerFullscreenDialogPositionAdjustments() {
681
681
  const dialog = this._editor.plugins.get("Dialog");
682
+ const dialogView = dialog.view;
682
683
  this._setNewDialogPosition();
684
+ if (dialogView && !dialogView.wasMoved) dialogView.updatePosition();
683
685
  dialog.on("change:isOpen", this.updateDialogPositionCallback, { priority: "highest" });
684
686
  }
685
687
  /**
@@ -689,7 +691,7 @@ var FullscreenAbstractEditorHandler = class {
689
691
  const dialog = this._editor.plugins.get("Dialog");
690
692
  const dialogView = dialog.view;
691
693
  if (dialogView && dialogView.position === null) dialogView.position = DialogViewPosition.EDITOR_TOP_SIDE;
692
- if (dialogView) dialogView.updatePosition();
694
+ if (dialogView && !dialogView.wasMoved) dialogView.updatePosition();
693
695
  dialog.off("change:isOpen", this.updateDialogPositionCallback);
694
696
  }
695
697
  /**
@@ -705,11 +707,11 @@ var FullscreenAbstractEditorHandler = class {
705
707
  /**
706
708
  * Adjusts the dialog position to utilize the empty space on the right side of the editable.
707
709
  * The new dialog position should be on the right side of the fullscreen view with a 30px margin.
708
- * Only dialogs with the position set to "editor-top-side" should have their position changed.
710
+ * Only dialogs with the position set to "editor-top-side" and not dragged by the user should have their position changed.
709
711
  */
710
712
  _setNewDialogPosition() {
711
713
  const dialogView = this._editor.plugins.get("Dialog").view;
712
- if (!dialogView || dialogView.position !== DialogViewPosition.EDITOR_TOP_SIDE) return;
714
+ if (!dialogView || dialogView.position !== DialogViewPosition.EDITOR_TOP_SIDE || dialogView.wasMoved) return;
713
715
  const keepRightEdgeContainerVisible = new Rect(this._wrapper.querySelector(".ck-fullscreen__right-edge")).getVisible();
714
716
  const relativeContainer = keepRightEdgeContainerVisible ? this._wrapper.querySelector(".ck-fullscreen__right-edge") : this._wrapper;
715
717
  const relativeContainerRect = new Rect(relativeContainer).getVisible();