@grammarly/editor-sdk
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -30,3 +30,3 @@ /** | ||
/** | ||
* Suggests alternatives to overused words. | ||
* Suggests alternatives to words that occur frequently in the same paragraph. | ||
* | ||
@@ -37,3 +37,3 @@ * @defaultValue true | ||
/** | ||
* Suggests more vivid vocabulary. | ||
* Suggests alternatives to bland and overused words such as "good" and "nice". | ||
* | ||
@@ -50,3 +50,3 @@ * @defaultValue true | ||
/** | ||
* Flags missing Oxford commas, also known as serial commas. | ||
* Suggests adding the Oxford comma after the second-to-last item in a list of things. | ||
* | ||
@@ -63,3 +63,3 @@ * @defaultValue false | ||
/** | ||
* Flags instances of punctuation falling after quotation marks. | ||
* Suggests placing punctuation before closing quotation marks. | ||
* | ||
@@ -70,3 +70,3 @@ * @defaultValue true | ||
/** | ||
* Suggests completing all sentence fragments, including some that may be using intentionally. | ||
* Suggests completing all incomplete sentences, including stylistic sentence fragments that may be intentional. | ||
* | ||
@@ -77,3 +77,3 @@ * @defaultValue false | ||
/** | ||
* Flags use of personal pronouns like "I" or "you" in academic writing. | ||
* Flags use of personal pronouns such as "I" and "you" in academic writing. | ||
* | ||
@@ -84,3 +84,3 @@ * @defaultValue false | ||
/** | ||
* Flags use of conjunctions like "but" or "and" at the beginning of sentences. | ||
* Flags use of conjunctions such as "but" and "and" at the beginning of sentences. | ||
* | ||
@@ -91,3 +91,3 @@ * @defaultValue false | ||
/** | ||
* Flags prepositions that fall at the end of a sentence. | ||
* Flags use of prepositions such as "with" and "in" at the end of sentences. | ||
* | ||
@@ -98,3 +98,3 @@ * @defaultValue false | ||
/** | ||
* Suggests rewriting phrases to avoid split infinitives. | ||
* Suggests rewriting split infinitives so that an adverb doesn't come between "to" and the verb. | ||
* | ||
@@ -105,3 +105,3 @@ * @defaultValue true | ||
/** | ||
* Suggests adding spacing when writing times (9 am instead of 9am). | ||
* Suggests adding missing spacing after a numeral when writing times. | ||
* | ||
@@ -112,3 +112,3 @@ * @defaultValue true | ||
/** | ||
* Flags instances of passive voice use. | ||
* Flags use of passive voice. | ||
* | ||
@@ -119,3 +119,3 @@ * @defaultValue true | ||
/** | ||
* Identifies hard-to-read sentences. | ||
* Flags long, complicated sentences that could potentially confuse your reader. | ||
* | ||
@@ -126,3 +126,3 @@ * @defaultValue true | ||
/** | ||
* Suggests splitting hard-to-read sentences to improve readability. | ||
* Suggests splitting long, complicated sentences that could potentially confuse your reader. | ||
* | ||
@@ -133,3 +133,3 @@ * @defaultValue true | ||
/** | ||
* Suggests respectful, person-first language. | ||
* Suggests using person-first language to refer respectfully to an individual with a disability. | ||
* | ||
@@ -146,3 +146,3 @@ * @defaultValue true | ||
/** | ||
* Flags LGBTQIA+-related terms that may be seen as disrespectful. | ||
* Flags LGBTQIA+-related terms that may be seen as biased in some contexts. | ||
* | ||
@@ -165,3 +165,3 @@ * @defaultValue true | ||
/** | ||
* Offers alternatives to potentially outdated or biased descriptions. | ||
* Suggests alternatives to potentially biased or outdated descriptions. | ||
* | ||
@@ -171,2 +171,14 @@ * @defaultValue true | ||
PossiblyBiasedLanguage?: boolean; | ||
/** | ||
* Suggests spelling out numbers zero through ten. | ||
* | ||
* @defaultValue true | ||
*/ | ||
NumbersZeroThroughTen?: boolean; | ||
/** | ||
* Suggests spelling out numbers at the beginning of sentences. | ||
* | ||
* @defaultValue true | ||
*/ | ||
NumbersBeginningSentences?: boolean; | ||
} | ||
@@ -173,0 +185,0 @@ |
@@ -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.2.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}; | ||
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.2.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";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.2.1".split("."),c=`${i}.${a}`;async function l(n){var r;const t=await o((void 0,`https://js.${null!==(r="grammarly.com")?r:"grammarly.com"}/grammarly-editor-sdk@${c}`),n);if(null!=n)return new t.EditorFactory(n)}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.2.2".split("."),c=`${i}.${a}`;async function l(n){var r;const t=await o((void 0,`https://js.${null!==(r="grammarly.com")?r:"grammarly.com"}/grammarly-editor-sdk@${c}`),n);if(null!=n)return new t.EditorFactory(n)}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.2.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});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.2.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.2.1", | ||
"version": "1.2.2", | ||
"main": "lib/index.js", | ||
@@ -27,4 +27,4 @@ "module": "lib/index.esm.js", | ||
"devDependencies": { | ||
"@grammarly/plugin-core": "1.2.1", | ||
"@grammarly/plugin-editor": "1.2.1", | ||
"@grammarly/plugin-core": "1.2.2", | ||
"@grammarly/plugin-editor": "1.2.2", | ||
"@microsoft/api-extractor": "^7.15.1", | ||
@@ -31,0 +31,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
31573
476