Socket
Socket
Sign inDemoInstall

@grammarly/editor-sdk

Package Overview
Dependencies
Maintainers
7
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grammarly/editor-sdk - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

lib/index.esm.js

@@ -17,2 +17,2 @@ /**

*/
function findScript(url){const scripts=document.querySelectorAll(`script[src^="${url}"]`);return scripts[0]}function injectScript(url){const script=document.createElement("script");script.src=url;document.head.appendChild(script);return script}const promises=new Map;const scripts=new Set;function initGrammarlyGlobalAPI(){if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else if(scripts.has(url)){return window.Grammarly}else{const grammarlyPromise=new Promise(((resolve,reject)=>{if(typeof window==="undefined"){return resolve(null)}try{let script=findScript(url);if(script!=null){console.warn(`<script src="${url}" /> already exists.`)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url)}script.addEventListener("load",(()=>{if(window.Grammarly!=null){scripts.add(url);resolve(window.Grammarly)}else{reject(new Error("Grammarly not available"))}}));script.addEventListener("error",(function(){reject(new Error(`Failed to load ${url}`))}))}catch(error){return reject(error)}}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.0.1".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId){var _a,_b;const Grammarly=await loadScript((_a=undefined)!==null&&_a!==void 0?_a:`https://js.${(_b="grammarly.com")!==null&&_b!==void 0?_b:"grammarly.com"}/grammarly-editor-sdk@${resolvedVersion}`,clientId);if(clientId!=null){return new Grammarly.EditorFactory(clientId)}}export{init};
function findScript(url){const scripts=document.querySelectorAll(`script[src^="${url}"]`);return scripts[0]}function injectScript(url){const script=document.createElement("script");script.src=url;document.head.appendChild(script);return script}const promises=new Map;const scripts=new Set;function initGrammarlyGlobalAPI(){if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else if(scripts.has(url)){return window.Grammarly}else{const grammarlyPromise=new Promise(((resolve,reject)=>{if(typeof window==="undefined"){return resolve(null)}try{let script=findScript(url);if(script!=null){console.warn(`<script src="${url}" /> already exists.`)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url)}script.addEventListener("load",(()=>{if(window.Grammarly!=null){scripts.add(url);resolve(window.Grammarly)}else{reject(new Error("Grammarly not available"))}}));script.addEventListener("error",(function(){reject(new Error(`Failed to load ${url}`))}))}catch(error){return reject(error)}}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.0.2".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId){var _a,_b;const Grammarly=await loadScript((_a=undefined)!==null&&_a!==void 0?_a:`https://js.${(_b="grammarly.com")!==null&&_b!==void 0?_b:"grammarly.com"}/grammarly-editor-sdk@${resolvedVersion}`,clientId);if(clientId!=null){return new Grammarly.EditorFactory(clientId)}}export{init};

@@ -17,2 +17,2 @@ /**

*/
!function(){"use strict";const n=new Map,r=new Set;async function t(t,e){if(null==window.Grammarly&&(window.Grammarly={}),n.has(t))return await n.get(t);if(r.has(t))return window.Grammarly;{const i=new Promise(((n,i)=>{if("undefined"==typeof window)return n(null);try{let a=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(t);null!=a?console.warn(`<script src="${t}" /> already exists.`):a=function(n){const r=document.createElement("script");return r.src=n,document.head.appendChild(r),r}(null!=e?`${t}?clientId=${e}`:t),a.addEventListener("load",(()=>{null!=window.Grammarly?(r.add(t),n(window.Grammarly)):i(new Error("Grammarly not available"))})),a.addEventListener("error",(function(){i(new Error(`Failed to load ${t}`))}))}catch(n){return i(n)}}));return n.set(t,i),i}}const[e,i]="1.0.1".split("."),a=`${e}.${i}`;async function o(n){var r;const e=await t((void 0,`https://js.${null!==(r="grammarly.com")?r:"grammarly.com"}/grammarly-editor-sdk@${a}`),n);if(null!=n)return new e.EditorFactory(n)}const c=function(){const n=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(n){const r=n.src;if(r){const n=new URL(r).searchParams.get("clientId");if(null!=n)return n}const t=n.getAttribute("clientId");if(null!=t)return t}}(),l=null!=c?o(c):void 0;window.Grammarly.init=async(n=c)=>{const r=c===n?await l:null!=n?await o(n):void 0;if(null==r)throw new Error('A "clientId" is required to init Grammarly SDK.');return r}}();
!function(){"use strict";const n=new Map,r=new Set;async function t(t,e){if(null==window.Grammarly&&(window.Grammarly={}),n.has(t))return await n.get(t);if(r.has(t))return window.Grammarly;{const i=new Promise(((n,i)=>{if("undefined"==typeof window)return n(null);try{let a=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(t);null!=a?console.warn(`<script src="${t}" /> already exists.`):a=function(n){const r=document.createElement("script");return r.src=n,document.head.appendChild(r),r}(null!=e?`${t}?clientId=${e}`:t),a.addEventListener("load",(()=>{null!=window.Grammarly?(r.add(t),n(window.Grammarly)):i(new Error("Grammarly not available"))})),a.addEventListener("error",(function(){i(new Error(`Failed to load ${t}`))}))}catch(n){return i(n)}}));return n.set(t,i),i}}const[e,i]="1.0.2".split("."),a=`${e}.${i}`;async function o(n){var r;const e=await t((void 0,`https://js.${null!==(r="grammarly.com")?r:"grammarly.com"}/grammarly-editor-sdk@${a}`),n);if(null!=n)return new e.EditorFactory(n)}const c=function(){const n=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(n){const r=n.src;if(r){const n=new URL(r).searchParams.get("clientId");if(null!=n)return n}const t=n.getAttribute("clientId");if(null!=t)return t}}(),l=null!=c?o(c):void 0;window.Grammarly.init=async(n=c)=>{const r=c===n?await l:null!=n?await o(n):void 0;if(null==r)throw new Error('A "clientId" is required to init Grammarly SDK.');return r}}();

@@ -17,2 +17,2 @@ /**

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function findScript(url){const scripts=document.querySelectorAll(`script[src^="${url}"]`);return scripts[0]}function injectScript(url){const script=document.createElement("script");script.src=url;document.head.appendChild(script);return script}const promises=new Map;const scripts=new Set;function initGrammarlyGlobalAPI(){if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else if(scripts.has(url)){return window.Grammarly}else{const grammarlyPromise=new Promise(((resolve,reject)=>{if(typeof window==="undefined"){return resolve(null)}try{let script=findScript(url);if(script!=null){console.warn(`<script src="${url}" /> already exists.`)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url)}script.addEventListener("load",(()=>{if(window.Grammarly!=null){scripts.add(url);resolve(window.Grammarly)}else{reject(new Error("Grammarly not available"))}}));script.addEventListener("error",(function(){reject(new Error(`Failed to load ${url}`))}))}catch(error){return reject(error)}}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.0.1".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId){var _a,_b;const Grammarly=await loadScript((_a=undefined)!==null&&_a!==void 0?_a:`https://js.${(_b="grammarly.com")!==null&&_b!==void 0?_b:"grammarly.com"}/grammarly-editor-sdk@${resolvedVersion}`,clientId);if(clientId!=null){return new Grammarly.EditorFactory(clientId)}}exports.init=init;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function findScript(url){const scripts=document.querySelectorAll(`script[src^="${url}"]`);return scripts[0]}function injectScript(url){const script=document.createElement("script");script.src=url;document.head.appendChild(script);return script}const promises=new Map;const scripts=new Set;function initGrammarlyGlobalAPI(){if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else if(scripts.has(url)){return window.Grammarly}else{const grammarlyPromise=new Promise(((resolve,reject)=>{if(typeof window==="undefined"){return resolve(null)}try{let script=findScript(url);if(script!=null){console.warn(`<script src="${url}" /> already exists.`)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url)}script.addEventListener("load",(()=>{if(window.Grammarly!=null){scripts.add(url);resolve(window.Grammarly)}else{reject(new Error("Grammarly not available"))}}));script.addEventListener("error",(function(){reject(new Error(`Failed to load ${url}`))}))}catch(error){return reject(error)}}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.0.2".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId){var _a,_b;const Grammarly=await loadScript((_a=undefined)!==null&&_a!==void 0?_a:`https://js.${(_b="grammarly.com")!==null&&_b!==void 0?_b:"grammarly.com"}/grammarly-editor-sdk@${resolvedVersion}`,clientId);if(clientId!=null){return new Grammarly.EditorFactory(clientId)}}exports.init=init;

@@ -5,3 +5,3 @@ {

"description": "Grammarly writing SDK for web editors",
"version": "1.0.1",
"version": "1.0.2",
"main": "lib/index.js",

@@ -27,4 +27,4 @@ "module": "lib/index.esm.js",

"devDependencies": {
"@grammarly/plugin-core": "1.0.1",
"@grammarly/plugin-editor": "1.0.1",
"@grammarly/plugin-core": "1.0.2",
"@grammarly/plugin-editor": "1.0.2",
"@microsoft/api-extractor": "^7.15.1",

@@ -31,0 +31,0 @@ "@types/jest": "^26.0.22",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc