How to use the @remirror/core.bool function in @remirror/core

To help you get started, we’ve selected a few @remirror/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / react / src / components / remirror.tsx View on Github external
options?: GetRootPropsConfig,
    children?: ReactNode,
  ): RefKeyRootProps => {
    // Ensure that this is the first time `getRootProps` is being called during
    // this render.
    if (this.rootPropsConfig.called) {
      throw new Error(
        '`getRootProps` has been called MULTIPLE times. It should only be called ONCE during render.',
      );
    }
    this.rootPropsConfig.called = true;

    const { refKey = 'ref', ...config } = options ?? Object.create(null);
    const { sx } = this.context;
    const css = sx(this.editorStyles);
    const extra = bool(css) ? { css } : {};

    return {
      [refKey]: this.onRef,
      key: this.uid,
      ...extra,
      ...config,
      children: children ?? this.renderChildren(null),
    } as RefKeyRootProps;
  };
github ifiokjr / remirror / @remirror / core-extensions / src / nodes / image.ts View on Github external
const hasCursor = (arg: T): arg is T & { $cursor: ResolvedPos } => {
  return bool(Cast(arg).$cursor);
};
github ifiokjr / remirror / @remirror / react-renderer / src / react-serializer.tsx View on Github external
public serializeNode(node: ProsemirrorNode): ReactNode {
    const Component = this.components[node.type.name];
    const options = this.options[node.type.name];
    const toDOM = this.nodes[node.type.name];

    let children: ReactNode;

    if (node.content.childCount > 0) {
      children = this.serializeFragment(node.content);
    }
    return bool(Component) ? (
      
        {children}
      
    ) : (
      toDOM && ReactSerializer.renderSpec(toDOM(node), children)
    );
  }
github ifiokjr / remirror / @remirror / extension-image / src / image-extension.ts View on Github external
const hasCursor = (arg: T): arg is T & { $cursor: ResolvedPos } => {
  return bool(Cast(arg).$cursor);
};
github ifiokjr / remirror / @remirror / react-renderer / src / react-serializer.tsx View on Github external
public serializeMark(mark: Mark, inline: boolean, wrappedElement: ReactNode): ReactNode {
    const toDOM = this.marks[mark.type.name];
    const Component = this.components[mark.type.name];
    const options = this.options[mark.type.name];

    return bool(Component) ? (
      
        {wrappedElement}
      
    ) : (
      toDOM && ReactSerializer.renderSpec(toDOM(mark, inline), wrappedElement)
    );
  }
github ifiokjr / remirror / @remirror / extension-emoji / src / emoji-helpers.ts View on Github external
export const isBaseEmoji = (emoji: BaseEmoji | CustomEmoji | undefined): emoji is BaseEmoji => {
  return bool(emoji && Cast(emoji).native);
};
github ifiokjr / remirror / @remirror / react / src / react-positioners.ts View on Github external
hasChanged({ oldState, newState }) {
    return !(bool(oldState) && oldState.doc.eq(newState.doc) && oldState.selection.eq(newState.selection));
  },