UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

18 lines 592 B
import { getATLContextUrl } from '@atlaskit/atlassian-context'; import { linkPreferencesPath } from './constants'; export function isTextAtPos(pos) { return function (_ref) { var tr = _ref.tr; var node = tr.doc.nodeAt(pos); return !!node && node.isText; }; } export function isLinkAtPos(pos) { return function (state) { var node = state.doc.nodeAt(pos); return !!node && !!state.schema.marks.link.isInSet(node.marks); }; } export var getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() { return getATLContextUrl('id') + linkPreferencesPath; };