@grammarly/editor-sdk
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -1831,4 +1831,2 @@ /** | ||
private readonly _resizeObserver; | ||
private readonly _hasViewportWidthChanged; | ||
private readonly _hasEditorWidthChanged; | ||
private readonly _highlights; | ||
@@ -1850,2 +1848,3 @@ private readonly _renderWorker; | ||
constructor(source: EditorTextManager, suggestions: SuggestionManager); | ||
private _renderNow; | ||
private _updatePriorityRange; | ||
@@ -1852,0 +1851,0 @@ private _getCaretPosition; |
@@ -17,2 +17,2 @@ /** | ||
*/ | ||
var ExceptionCodes={};ExceptionCodes[ExceptionCodes["UNKNOWN"]=1e3]="UNKNOWN";ExceptionCodes[ExceptionCodes["ENVIRONMENT_UNSUPPORTED"]=3001]="ENVIRONMENT_UNSUPPORTED";const messages={[ExceptionCodes.UNKNOWN]:"Unknown error",[ExceptionCodes.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class GrammarlyException extends Error{constructor(code=ExceptionCodes.UNKNOWN,message=messages[code]){super(message);this.code=code}}GrammarlyException.codes=ExceptionCodes;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;function initGrammarlyGlobalAPI(){if(typeof window==="undefined"){return}if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){if(typeof window==="undefined"){return await Promise.reject(new GrammarlyException(GrammarlyException.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"))}initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else{const grammarlyPromise=new Promise(((resolve,reject)=>{try{let script=findScript(url);if(script!=null){resolve(window.Grammarly)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url);script.addEventListener("load",(()=>{if(window.Grammarly!=null){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)}})).finally((()=>{promises.delete(url)}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.6.3".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId,config){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.EditorSDK(clientId,config)}}export{init}; | ||
var ExceptionCodes={};ExceptionCodes[ExceptionCodes["UNKNOWN"]=1e3]="UNKNOWN";ExceptionCodes[ExceptionCodes["ENVIRONMENT_UNSUPPORTED"]=3001]="ENVIRONMENT_UNSUPPORTED";const messages={[ExceptionCodes.UNKNOWN]:"Unknown error",[ExceptionCodes.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class GrammarlyException extends Error{constructor(code=ExceptionCodes.UNKNOWN,message=messages[code]){super(message);this.code=code}}GrammarlyException.codes=ExceptionCodes;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;function initGrammarlyGlobalAPI(){if(typeof window==="undefined"){return}if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){if(typeof window==="undefined"){return await Promise.reject(new GrammarlyException(GrammarlyException.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"))}initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else{const grammarlyPromise=new Promise(((resolve,reject)=>{try{let script=findScript(url);if(script!=null){resolve(window.Grammarly)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url);script.addEventListener("load",(()=>{if(window.Grammarly!=null){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)}})).finally((()=>{promises.delete(url)}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.6.4".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId,config){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.EditorSDK(clientId,config)}}export{init}; |
@@ -17,2 +17,2 @@ /** | ||
*/ | ||
!function(){"use strict";var n={};n[n.UNKNOWN=1e3]="UNKNOWN",n[n.ENVIRONMENT_UNSUPPORTED=3001]="ENVIRONMENT_UNSUPPORTED";const r={[n.UNKNOWN]:"Unknown error",[n.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class t extends Error{constructor(t=n.UNKNOWN,e=r[t]){super(e),this.code=t}}t.codes=n;const e=new Map;async function o(n,r){if("undefined"==typeof window)return await Promise.reject(new t(t.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"));if("undefined"!=typeof window&&null==window.Grammarly&&(window.Grammarly={}),e.has(n))return await e.get(n);{const t=new Promise(((t,e)=>{try{let o=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(n);null!=o?t(window.Grammarly):(o=function(n){const r=document.createElement("script");return r.src=n,document.head.appendChild(r),r}(null!=r?`${n}?clientId=${r}`:n),o.addEventListener("load",(()=>{null!=window.Grammarly?t(window.Grammarly):e(new Error("Grammarly not available"))})),o.addEventListener("error",(function(){e(new Error(`Failed to load ${n}`))})))}catch(n){return e(n)}})).finally((()=>{e.delete(n)}));return e.set(n,t),t}}const[i,a]="1.6.3".split("."),c=`${i}.${a}`;async function l(n,r){var t;const e=await o((void 0,`https://js.${null!==(t="grammarly.com")?t:"grammarly.com"}/grammarly-editor-sdk@${c}`),n);if(null!=n)return new e.EditorSDK(n,r)}const s=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}}(),u=null!=s?l(s):void 0;window.Grammarly.init=async(n=s)=>{const r=s===n?await u:null!=n?await l(n):void 0;if(null==r)throw new Error('A "clientId" is required to init Grammarly SDK.');return r}}(); | ||
!function(){"use strict";var n={};n[n.UNKNOWN=1e3]="UNKNOWN",n[n.ENVIRONMENT_UNSUPPORTED=3001]="ENVIRONMENT_UNSUPPORTED";const r={[n.UNKNOWN]:"Unknown error",[n.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class t extends Error{constructor(t=n.UNKNOWN,e=r[t]){super(e),this.code=t}}t.codes=n;const e=new Map;async function o(n,r){if("undefined"==typeof window)return await Promise.reject(new t(t.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"));if("undefined"!=typeof window&&null==window.Grammarly&&(window.Grammarly={}),e.has(n))return await e.get(n);{const t=new Promise(((t,e)=>{try{let o=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(n);null!=o?t(window.Grammarly):(o=function(n){const r=document.createElement("script");return r.src=n,document.head.appendChild(r),r}(null!=r?`${n}?clientId=${r}`:n),o.addEventListener("load",(()=>{null!=window.Grammarly?t(window.Grammarly):e(new Error("Grammarly not available"))})),o.addEventListener("error",(function(){e(new Error(`Failed to load ${n}`))})))}catch(n){return e(n)}})).finally((()=>{e.delete(n)}));return e.set(n,t),t}}const[i,a]="1.6.4".split("."),c=`${i}.${a}`;async function l(n,r){var t;const e=await o((void 0,`https://js.${null!==(t="grammarly.com")?t:"grammarly.com"}/grammarly-editor-sdk@${c}`),n);if(null!=n)return new e.EditorSDK(n,r)}const s=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}}(),u=null!=s?l(s):void 0;window.Grammarly.init=async(n=s)=>{const r=s===n?await u:null!=n?await l(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});var ExceptionCodes={};ExceptionCodes[ExceptionCodes["UNKNOWN"]=1e3]="UNKNOWN";ExceptionCodes[ExceptionCodes["ENVIRONMENT_UNSUPPORTED"]=3001]="ENVIRONMENT_UNSUPPORTED";const messages={[ExceptionCodes.UNKNOWN]:"Unknown error",[ExceptionCodes.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class GrammarlyException extends Error{constructor(code=ExceptionCodes.UNKNOWN,message=messages[code]){super(message);this.code=code}}GrammarlyException.codes=ExceptionCodes;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;function initGrammarlyGlobalAPI(){if(typeof window==="undefined"){return}if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){if(typeof window==="undefined"){return await Promise.reject(new GrammarlyException(GrammarlyException.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"))}initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else{const grammarlyPromise=new Promise(((resolve,reject)=>{try{let script=findScript(url);if(script!=null){resolve(window.Grammarly)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url);script.addEventListener("load",(()=>{if(window.Grammarly!=null){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)}})).finally((()=>{promises.delete(url)}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.6.3".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId,config){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.EditorSDK(clientId,config)}}exports.init=init; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ExceptionCodes={};ExceptionCodes[ExceptionCodes["UNKNOWN"]=1e3]="UNKNOWN";ExceptionCodes[ExceptionCodes["ENVIRONMENT_UNSUPPORTED"]=3001]="ENVIRONMENT_UNSUPPORTED";const messages={[ExceptionCodes.UNKNOWN]:"Unknown error",[ExceptionCodes.ENVIRONMENT_UNSUPPORTED]:"The environment is not supported"};class GrammarlyException extends Error{constructor(code=ExceptionCodes.UNKNOWN,message=messages[code]){super(message);this.code=code}}GrammarlyException.codes=ExceptionCodes;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;function initGrammarlyGlobalAPI(){if(typeof window==="undefined"){return}if(window.Grammarly!=null)return;window.Grammarly={}}async function loadScript(url,clientId){if(typeof window==="undefined"){return await Promise.reject(new GrammarlyException(GrammarlyException.codes.ENVIRONMENT_UNSUPPORTED,"Cannot load script in non-browser environment"))}initGrammarlyGlobalAPI();if(promises.has(url)){return await promises.get(url)}else{const grammarlyPromise=new Promise(((resolve,reject)=>{try{let script=findScript(url);if(script!=null){resolve(window.Grammarly)}else{script=injectScript(clientId!=null?`${url}?clientId=${clientId}`:url);script.addEventListener("load",(()=>{if(window.Grammarly!=null){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)}})).finally((()=>{promises.delete(url)}));promises.set(url,grammarlyPromise);return grammarlyPromise}}const[versionMajor,versionMinor]="1.6.4".split(".");const resolvedVersion=`${versionMajor}.${versionMinor}`;async function init(clientId,config){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.EditorSDK(clientId,config)}}exports.init=init; |
@@ -5,3 +5,3 @@ { | ||
"description": "Grammarly writing SDK for web editors", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"main": "lib/index.js", | ||
@@ -27,5 +27,5 @@ "module": "lib/index.esm.js", | ||
"devDependencies": { | ||
"@grammarly/plugin-core": "1.6.3", | ||
"@grammarly/plugin-editor": "1.6.3", | ||
"@grammarly/plugin-reactivity": "1.6.3", | ||
"@grammarly/plugin-core": "1.6.4", | ||
"@grammarly/plugin-editor": "1.6.4", | ||
"@grammarly/plugin-reactivity": "1.6.4", | ||
"@microsoft/api-extractor": "^7.15.1", | ||
@@ -32,0 +32,0 @@ "@testing-library/jest-dom": "^5.11.10", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83433
2210