UNPKG

@atlaskit/editor-common

Version:

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

31 lines (30 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLinkPreferencesURLFromENV = void 0; exports.isLinkAtPos = isLinkAtPos; exports.isTextAtPos = isTextAtPos; var _constants = require("./constants"); function isTextAtPos(pos) { return function (state) { var node = state.doc.nodeAt(pos); return !!node && node.isText; }; } function isLinkAtPos(pos) { return function (state) { var node = state.doc.nodeAt(pos); return !!node && !!state.schema.marks.link.isInSet(node.marks); }; } var getLinkPreferencesURLFromENV = exports.getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() { if (process.env.NODE_ENV === 'production' && process.env.CLOUD_ENV === 'staging') { // only a production CLOUD_ENV staging environment has a different link preferences URL return _constants.stagingLinkPreferencesUrl; } else if (process.env.NODE_ENV === 'production') { return _constants.productionLinkPreferencesUrl; } else { return _constants.stagingLinkPreferencesUrl; } };