Remirror: v1.0.0-next.16 Release

Release date:
August 1, 2020
Previous version:
v1.0.0-next.15 (released July 31, 2020)
Magnitude:
7,928 Diff Delta
Contributors:
3 total committers
Data confidence:
Commits:

37 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored August 1, 2020
Authored August 1, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored August 1, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored August 1, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored August 1, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020
Authored July 31, 2020

Top Contributors in v1.0.0-next.16

ifiokjr
github-actions[bot]
ronnyroeller

Directory Browser for v1.0.0-next.16

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

Major Changes

  • e518ef1d: Rewrite the positioner extension with a new API for creating positioners.

Positioners now return an array of VirtualPositions or an empty array if no positions extension.

@remirror/react - Add useMultiPositioner. @remirror/react - Add virtualNode property for compatibility with popper-react

An example of creating a new positioner with the new API is below.

  import { Positioner, Coords, hasStateChanged } from '@remirror/extension-positioner';

  export const cursorPopupPositioner = Positioner.create<Coords>({
    hasChanged: hasStateChanged,

    /**
     * Only active when the selection is empty (one character)
     */
    getActive: (parameter) => {
      const { state, view } = parameter;

      if (!state.selection.empty) {
        return [];
      }

      return [view.coordsAtPos(state.selection.from)];
    },

    getPosition(parameter) {
      const { element, data: cursor } = parameter;
      const parent = element.offsetParent;

      if (!parent) {
        return emptyVirtualPosition;
      }

      // The box in which the bubble menu is positioned, to use as an anchor
      const parentBox = parent.getBoundingClientRect();

      // The popup menu element
      const elementBox = element.getBoundingClientRect();

      const calculatedLeft = cursor.left - parentBox.left;
      const calculatedRight = parentBox.right - cursor.right;

      const bottom = Math.trunc(cursor.bottom - parentBox.top);
      const top = Math.trunc(cursor.top - parentBox.top);
      const rect = new DOMRect(cursor.left, cursor.top, 0, cursor.bottom - cursor.top);
      const left =
        calculatedLeft + elementBox.width > parentBox.width
          ? calculatedLeft - elementBox.width
          : calculatedLeft;
      const right =
        calculatedRight + elementBox.width > parentBox.width
          ? calculatedRight - elementBox.width
          : calculatedRight;

      return { rect, right, left, bottom, top };
    },
  });
  • be9a9c17: Move all keymap functionality to KeymapExtension from @remirror/core. Remove all references to @remirror/extension-base-keymap.

Minor Changes

  • 206c1405: Extension to annotate content in your editor
  • f032db7e: Remove isEmptyParagraphNode and absoluteCoordinates exports from @remirror/core-utils.
  • 2592b7b3: Allow runtime updates of PlaceholderExtension emptyNodeClass option.

Patch Changes

  • a7037832: Use exact versions for @remirror package dependencies and peerDepedencies.

Closes #435

  • dcccc5fc: Add browser entrypoint to packages and shrink bundle size.
  • 231f664b: Upgrade dependencies.
  • 6c6d524e: Remove use of export * for better tree shaking.

Closes #406