@grammarly/editor-sdk
Advanced tools
Comparing version 1.0.0-beta.12 to 1.0.0-beta.13
@@ -7,2 +7,139 @@ /** | ||
/** | ||
* Categories of suggestions that can be muted. | ||
* | ||
* @remarks | ||
* `false` means any suggestions belonging to that category will be "muted" (not visible to the user) | ||
* | ||
* @public | ||
*/ | ||
interface SuggestionCategories { | ||
/** | ||
* Suggests alternatives to overused words. | ||
* | ||
* @defaultValue true | ||
*/ | ||
Variety?: boolean; | ||
/** | ||
* Suggests more vivid vocabulary. | ||
* | ||
* @defaultValue true | ||
*/ | ||
Vocabulary?: boolean; | ||
/** | ||
* Suggests ways to sound more natural and fluent. | ||
* | ||
* @defaultValue true | ||
*/ | ||
Fluency?: boolean; | ||
/** | ||
* Flags missing Oxford commas, also known as serial commas. | ||
* | ||
* @defaultValue false | ||
*/ | ||
OxfordComma?: boolean; | ||
/** | ||
* Flags unnecessary use of ellipses (...). | ||
* | ||
* @defaultValue false | ||
*/ | ||
UnnecessaryEllipses?: boolean; | ||
/** | ||
* Flags instances of punctuation falling after quotation marks. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PunctuationWithQuotation?: boolean; | ||
/** | ||
* Suggests completing all sentence fragments, including some that may be using intentionally. | ||
* | ||
* @defaultValue false | ||
*/ | ||
StylisticFragments?: boolean; | ||
/** | ||
* Flags use of personal pronouns like "I" or "you" in academic writing. | ||
* | ||
* @defaultValue false | ||
*/ | ||
InformalPronounsAcademic?: boolean; | ||
/** | ||
* Flags use of conjunctions like "but" or "and" at the beginning of sentences. | ||
* | ||
* @defaultValue false | ||
*/ | ||
ConjunctionAtStartOfSentence?: boolean; | ||
/** | ||
* Flags prepositions that fall at the end of a sentence. | ||
* | ||
* @defaultValue false | ||
*/ | ||
PrepositionAtTheEndOfSentence?: boolean; | ||
/** | ||
* Suggests rewriting phrases to avoid split infinitives. | ||
* | ||
* @defaultValue true | ||
*/ | ||
SplitInfinitive?: boolean; | ||
/** | ||
* Suggests adding spacing when writing times (9 am instead of 9am). | ||
* | ||
* @defaultValue true | ||
*/ | ||
MissingSpaces?: boolean; | ||
/** | ||
* Flags instances of passive voice use. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PassiveVoice?: boolean; | ||
/** | ||
* Identifies hard-to-read sentences. | ||
* | ||
* @defaultValue true | ||
*/ | ||
ReadabilityFillerwords?: boolean; | ||
/** | ||
* Suggests splitting hard-to-read sentences to improve readability. | ||
* | ||
* @defaultValue true | ||
*/ | ||
ReadabilityTransforms?: boolean; | ||
/** | ||
* Suggests respectful, person-first language. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PersonFirstLanguage?: boolean; | ||
/** | ||
* Suggests alternatives to potentially gender-biased phrasing. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PossiblyBiasedLanguageGenderRelated?: boolean; | ||
/** | ||
* Flags LGBTQIA+-related terms that may be seen as disrespectful. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PossiblyBiasedLanguageLgbtRelated?: boolean; | ||
/** | ||
* Flags LGBTQIA+-related terms that may be seen as outdated, clinical, or not fully accepted in some contexts. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PossiblyOutdatedLanguageLgbtRelated?: boolean; | ||
/** | ||
* Flags reclaimed LGBTQIA+-related terms that may still be seen as disrespectful in some contexts. | ||
* | ||
* @defaultValue true | ||
*/ | ||
ReclaimedLanguage?: boolean; | ||
/** | ||
* Offers alternatives to potentially outdated or biased descriptions. | ||
* | ||
* @defaultValue true | ||
*/ | ||
PossiblyBiasedLanguage?: boolean; | ||
} | ||
/** | ||
* Statistics about the Grammarly session. | ||
@@ -76,5 +213,2 @@ * | ||
* | ||
* @remarks | ||
* Related: {@link https://developer.grammarly.com/docs/rate-limits.html | Rate Limits} | ||
* | ||
* @public | ||
@@ -96,6 +230,6 @@ */ | ||
}; | ||
/** @internal */ | ||
features?: GrammarlyFeaturesConfig; | ||
/** Context of the input document that informs Grammarly suggestions. */ | ||
document?: DocumentConfig; | ||
/** Categories of suggestions that can be muted. */ | ||
suggestions?: SuggestionCategories; | ||
/** | ||
@@ -126,50 +260,2 @@ * Callback to receive stats about the user-entered text and Grammarly session. | ||
/** | ||
* Configuration for Grammarly text-checking features. | ||
* | ||
* @internal | ||
*/ | ||
interface GrammarlyFeaturesConfig { | ||
/** | ||
* Whether to show tone detection "emogenie" near the Grammarly button. | ||
* @defaultValue true | ||
*/ | ||
emogenie?: boolean; | ||
/** | ||
* Whether to enable full-sentence rewrites. | ||
* @defaultValue true | ||
*/ | ||
fullSentenceRewrite?: boolean; | ||
/** | ||
* Whether to enable plagiarism detection. | ||
* @defaultValue false | ||
* | ||
* @internal | ||
*/ | ||
plagiarism?: boolean; | ||
/** | ||
* Whether to identify hard-to-read sentences. | ||
* @defaultValue true | ||
*/ | ||
readability?: boolean; | ||
/** | ||
* Whether to flag series of repetitive sentences. | ||
* @defaultValue true | ||
*/ | ||
sentenceVariety?: boolean; | ||
/** | ||
* Whether to include tone suggestions, eg politeness. | ||
* @defaultValue true | ||
*/ | ||
tone?: boolean; | ||
/** | ||
* Whether to enable stats including word count, reading time and readability score. | ||
* | ||
* @remarks | ||
* Use `onTextStats` to access these. | ||
* | ||
* @defaultValue false | ||
*/ | ||
textStats?: boolean; | ||
} | ||
/** | ||
* Characteristics and context of the document that inform Grammarly suggestions. | ||
@@ -182,3 +268,3 @@ * | ||
* Which English dialect should be assumed? | ||
* @defaultValue american | ||
* @defaultValue "american" | ||
* | ||
@@ -191,3 +277,3 @@ * @remarks | ||
* What is the style or type of writing? | ||
* @defaultValue general | ||
* @defaultValue "general" | ||
*/ | ||
@@ -285,2 +371,2 @@ domain?: Domain; | ||
export { ClientId, Dialect, DocumentConfig, Domain, Editor, EditorConfig, EditorFactory, GrammarlyFeaturesConfig, PluginDisableReason, SessionStats, SessionSuggestionBreakdown, TextStats, Time, init }; | ||
export { ClientId, Dialect, DocumentConfig, Domain, Editor, EditorConfig, EditorFactory, PluginDisableReason, SessionStats, SessionSuggestionBreakdown, SuggestionCategories, TextStats, Time, init }; |
@@ -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.body.appendChild(script);return script}const promises=new Map;const scripts=new Set;async function loadScript(url,clientId){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 resolvedVersion="1.0.0-beta.12";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.body.appendChild(script);return script}const promises=new Map;const scripts=new Set;async function loadScript(url,clientId){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 resolvedVersion="1.0.0-beta.13";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"; | ||
* limitations under the License. | ||
*/const n=new Map,t=new Set;async function r(r,e){if(n.has(r))return await n.get(r);if(t.has(r))return window.Grammarly;{const c=new Promise(((n,c)=>{if("undefined"==typeof window)return n(null);try{let i=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(r);null!=i?console.warn(`<script src="${r}" /> already exists.`):i=function(n){const t=document.createElement("script");return t.src=n,document.body.appendChild(t),t}(null!=e?`${r}?clientId=${e}`:r),i.addEventListener("load",(()=>{null!=window.Grammarly?(t.add(r),n(window.Grammarly)):c(new Error("Grammarly not available"))})),i.addEventListener("error",(function(){c(new Error(`Failed to load ${r}`))}))}catch(n){return c(n)}}));return n.set(r,c),c}}async function e(n){var t;const e=await r((void 0,`https://js.${null!==(t="grammarly.com")?t:"grammarly.com"}/grammarly-editor-sdk@1.0.0-beta.12`),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 t=n.src;if(t){const n=new URL(t).searchParams.get("clientId");if(null!=n)return n}const r=n.getAttribute("clientId");if(null!=r)return r}}();null!=c?e(c):e()}(); | ||
*/const n=new Map,t=new Set;async function r(r,e){if(n.has(r))return await n.get(r);if(t.has(r))return window.Grammarly;{const c=new Promise(((n,c)=>{if("undefined"==typeof window)return n(null);try{let i=function(n){return document.querySelectorAll(`script[src^="${n}"]`)[0]}(r);null!=i?console.warn(`<script src="${r}" /> already exists.`):i=function(n){const t=document.createElement("script");return t.src=n,document.body.appendChild(t),t}(null!=e?`${r}?clientId=${e}`:r),i.addEventListener("load",(()=>{null!=window.Grammarly?(t.add(r),n(window.Grammarly)):c(new Error("Grammarly not available"))})),i.addEventListener("error",(function(){c(new Error(`Failed to load ${r}`))}))}catch(n){return c(n)}}));return n.set(r,c),c}}async function e(n){var t;const e=await r((void 0,`https://js.${null!==(t="grammarly.com")?t:"grammarly.com"}/grammarly-editor-sdk@1.0.0-beta.13`),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 t=n.src;if(t){const n=new URL(t).searchParams.get("clientId");if(null!=n)return n}const r=n.getAttribute("clientId");if(null!=r)return r}}();null!=c?e(c):e()}(); |
@@ -17,2 +17,2 @@ "use strict"; | ||
* limitations under the License. | ||
*/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.body.appendChild(script);return script}const promises=new Map;const scripts=new Set;async function loadScript(url,clientId){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 resolvedVersion="1.0.0-beta.12";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; | ||
*/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.body.appendChild(script);return script}const promises=new Map;const scripts=new Set;async function loadScript(url,clientId){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 resolvedVersion="1.0.0-beta.13";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.0-beta.12", | ||
"version": "1.0.0-beta.13", | ||
"main": "lib/index.js", | ||
@@ -27,4 +27,4 @@ "module": "lib/index.esm.js", | ||
"devDependencies": { | ||
"@grammarly/plugin-core": "1.0.0-beta.12", | ||
"@grammarly/plugin-editor": "1.0.0-beta.12", | ||
"@grammarly/plugin-core": "1.0.0-beta.13", | ||
"@grammarly/plugin-editor": "1.0.0-beta.13", | ||
"@microsoft/api-extractor": "^7.15.1", | ||
@@ -31,0 +31,0 @@ "@types/jest": "^26.0.22", |
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
27486
422