Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@grammarly/editor-sdk

Package Overview
Dependencies
Maintainers
8
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 2.2.0 to 2.2.1

22

lib/editor-sdk.beta.d.ts

@@ -59,2 +59,4 @@ /**

*
* {@link https://codesandbox.io/s/github/grammarly/grammarly-for-developers/tree/main/examples/editor-sdk-react-stats | Try it now}
*
* @public

@@ -86,11 +88,11 @@ * @since v1.9.0

/**
* The style or type of writing to be checked.
* The style or type of writing to be analyzed.
*
* @remarks
*
* You can select the style of the document that best corresponds to the type of writing you're checking in order to get the most accurate and relevant suggestions:
* You can select the style of the document that best corresponds to the type of writing you're analyzing in order to get the most accurate and relevant suggestions:
*
* - **`academic`:** Designed to check text against stricter, academic writing criteria.
* - **`academic`:** Designed to analyze text against stricter, academic writing criteria.
*
* - **`business`:** Designed to check text against formal writing criteria.
* - **`business`:** Designed to analyze text against formal writing criteria.
*

@@ -622,3 +624,3 @@ * - **`general`:** Designed for a medium level of strictness. This is the default domain.

* <li>Suggestions Sent: <span data-field="suggestionsSent"></span></li>
* <li>Words checked: <span data-field="wordsChecked"></span></li>
* <li>Words analyzed: <span data-field="wordsChecked"></span></li>
* </ul>

@@ -690,3 +692,3 @@ * ```

duration: number;
/** Total words checked during the session. */
/** Total words analyzed during the session. */
wordsChecked: number;

@@ -716,4 +718,10 @@ /** Suggestions provided by Grammarly. */

* @remarks
* "off" means any suggestions belonging to that category will be "muted" (not visible to the user)
* Keep the following rules in mind when configuring suggestion categories:
*
* - The following categories are turned "off" by default: `conjunctionAtStartOfSentence`, `informalPronounsAcademic`, `oxfordComma`, `passiveVoice`, `prepositionAtTheEndOfSentence`, `stylisticFragments`, and `unnecessaryEllipses`.
*
* - If a category is set to "off", any suggestions belonging to that category will be "muted" (not visible to the user).
*
* - If a user has connected their Grammarly account to your application, the full set of customized suggestions from their user profile will always take precedence.
*
* @public

@@ -720,0 +728,0 @@ */

@@ -59,2 +59,4 @@ /**

*
* {@link https://codesandbox.io/s/github/grammarly/grammarly-for-developers/tree/main/examples/editor-sdk-react-stats | Try it now}
*
* @public

@@ -86,11 +88,11 @@ * @since v1.9.0

/**
* The style or type of writing to be checked.
* The style or type of writing to be analyzed.
*
* @remarks
*
* You can select the style of the document that best corresponds to the type of writing you're checking in order to get the most accurate and relevant suggestions:
* You can select the style of the document that best corresponds to the type of writing you're analyzing in order to get the most accurate and relevant suggestions:
*
* - **`academic`:** Designed to check text against stricter, academic writing criteria.
* - **`academic`:** Designed to analyze text against stricter, academic writing criteria.
*
* - **`business`:** Designed to check text against formal writing criteria.
* - **`business`:** Designed to analyze text against formal writing criteria.
*

@@ -614,3 +616,3 @@ * - **`general`:** Designed for a medium level of strictness. This is the default domain.

* <li>Suggestions Sent: <span data-field="suggestionsSent"></span></li>
* <li>Words checked: <span data-field="wordsChecked"></span></li>
* <li>Words analyzed: <span data-field="wordsChecked"></span></li>
* </ul>

@@ -682,3 +684,3 @@ * ```

duration: number;
/** Total words checked during the session. */
/** Total words analyzed during the session. */
wordsChecked: number;

@@ -708,4 +710,10 @@ /** Suggestions provided by Grammarly. */

* @remarks
* "off" means any suggestions belonging to that category will be "muted" (not visible to the user)
* Keep the following rules in mind when configuring suggestion categories:
*
* - The following categories are turned "off" by default: `conjunctionAtStartOfSentence`, `informalPronounsAcademic`, `oxfordComma`, `passiveVoice`, `prepositionAtTheEndOfSentence`, `stylisticFragments`, and `unnecessaryEllipses`.
*
* - If a category is set to "off", any suggestions belonging to that category will be "muted" (not visible to the user).
*
* - If a user has connected their Grammarly account to your application, the full set of customized suggestions from their user profile will always take precedence.
*
* @public

@@ -712,0 +720,0 @@ */

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

*/
function n(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}var t=new Map;class r extends Error{constructor(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";super(),n(this,"args",void 0),n(this,"code",void 0),n(this,"url",void 0);var o=new URL("https://developer.grammarly.com/docs/error-explainer");o.searchParams.set("code",t.toString()),r.forEach((n=>o.searchParams.append("args",function(n){if(n instanceof Error)return n.message+"\n"+String(n.stack);if(null==n)return"null";if("object"==typeof n)try{return Object.prototype.toString.call(n)}catch(n){}return String(n)}(n)))),null!=this.stack&&o.searchParams.set("trace",this.stack),this.message="".concat(e,"Minified error #").concat(t,": See ").concat(o.toString()," for details."),this.args=r,this.code=t,this.url=o.toString()}toUserMessage(){var n=t.get("".concat(this.code));if(null==n)return[this];var r=new Map(this.args.map(((n,t)=>["${".concat(t,"}"),n])));return n.split(/(\${\d+})/).filter((n=>""!==n)).map((n=>{var t;return null!==(t=r.get(n))&&void 0!==t?t:n}))}static setMessages(n){t=n}static create(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;null!=o&&t.push(o);var a=new r(n,t,e);return a.stack=null==o?void 0:o.stack,a}}const e=new WeakMap;async function o(n,t,r){return await a("@grammarly/editor-sdk",n,t,r)}async function a(n,t,o,a){if("undefined"==typeof window&&void 0===a)throw new r(21,[]);const i=function(n){return"null"!==n.location.origin?n.location.origin:"null"!==n.origin?n.origin:"null"}(null!=a?a:window);"null"===i&&(null!=a?a:window).top!==(null!=a?a:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",i);null!=t&&s.searchParams.set("clientId",t),s.searchParams.set("packageName",n);const c=await async function(n,t){const o=e.get(n);if(null!=o)return await o;!function(n){null==n.Grammarly&&(n.Grammarly={})}(n);const a=new Promise(((e,o)=>{try{let e=function(n,t){return n.document.querySelectorAll(`script[src^="${t.replace(/\?.*$/,"")}"]`)[0]}(n,t);null!=e?a():(e=function(n,t){const r=n.document.createElement("script");return r.src=t,n.document.head.appendChild(r),r}(n,t),e.addEventListener("load",a),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(n){o(n)}})))}catch(n){return o(n)}function a(){try{if(null==n.Grammarly||"function"!=typeof n.Grammarly.EditorSDK)throw new r(22,[]);e(n.Grammarly)}catch(n){o(n)}}}));return e.set(n,a),await a}(null!=a?a:window,s.toString());if(null!=t)return new c.EditorSDK(t,o)}const i={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"};export{i as callbackToEventName,o as init,a as init_with_packageName};
function n(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}var t=new Map;class r extends Error{constructor(t,r){super(),n(this,"args",void 0),n(this,"code",void 0),n(this,"url",void 0);var e=new URL("https://developer.grammarly.com/docs/error-explainer");e.searchParams.set("code",t.toString()),r.forEach((n=>e.searchParams.append("args",function(n){if(n instanceof Error)return n.message+"\n"+String(n.stack);if(null==n)return"null";if("object"==typeof n)try{return Object.prototype.toString.call(n)}catch(n){}return String(n)}(n)))),null!=this.stack&&e.searchParams.set("trace",this.stack),this.message="Minified error #".concat(t,": See ").concat(e.toString()," for details."),this.args=r,this.code=t,this.url=e.toString()}toUserMessage(){var n=t.get("".concat(this.code));if(null==n)return[this];var r=new Map(this.args.map(((n,t)=>["${".concat(t,"}"),n])));return n.split(/(\${\d+})/).filter((n=>""!==n)).map((n=>{var t;return null!==(t=r.get(n))&&void 0!==t?t:n}))}static setMessages(n){t=n}static create(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;null!=o&&t.push(o);var a=new r(n,t,e);return a.stack=null==o?void 0:o.stack,a}}const e=new WeakMap;async function o(n,t,r){return await a("@grammarly/editor-sdk",n,t,r)}async function a(n,t,o,a){if("undefined"==typeof window&&void 0===a)throw new r(21,[]);const i=function(n){return"null"!==n.location.origin?n.location.origin:"null"!==n.origin?n.origin:"null"}(null!=a?a:window);"null"===i&&(null!=a?a:window).top!==(null!=a?a:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",i);null!=t&&s.searchParams.set("clientId",t),s.searchParams.set("packageName",n);const l=await async function(n,t){const o=e.get(n);if(null!=o)return await o;!function(n){null==n.Grammarly&&(n.Grammarly={})}(n);const a=new Promise(((e,o)=>{try{let e=function(n,t){return n.document.querySelectorAll(`script[src^="${t.replace(/\?.*$/,"")}"]`)[0]}(n,t);null!=e?a():(e=function(n,t){const r=n.document.createElement("script");return r.src=t,n.document.head.appendChild(r),r}(n,t),e.addEventListener("load",a),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(n){o(n)}})))}catch(n){return o(n)}function a(){try{if(null==n.Grammarly||"function"!=typeof n.Grammarly.EditorSDK)throw new r(22,[]);e(n.Grammarly)}catch(n){o(n)}}}));return e.set(n,a),await a}(null!=a?a:window,s.toString());if(null!=t)return new l.EditorSDK(t,o)}const i={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"};export{i as callbackToEventName,o as init,a as init_with_packageName};

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

*/
!function(){"use strict";function t(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var n=new Map;class r extends Error{constructor(n,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0);var a=new URL("https://developer.grammarly.com/docs/error-explainer");a.searchParams.set("code",n.toString()),r.forEach((t=>a.searchParams.append("args",function(t){if(t instanceof Error)return t.message+"\n"+String(t.stack);if(null==t)return"null";if("object"==typeof t)try{return Object.prototype.toString.call(t)}catch(t){}return String(t)}(t)))),null!=this.stack&&a.searchParams.set("trace",this.stack),this.message="".concat(e,"Minified error #").concat(n,": See ").concat(a.toString()," for details."),this.args=r,this.code=n,this.url=a.toString()}toUserMessage(){var t=n.get("".concat(this.code));if(null==t)return[this];var r=new Map(this.args.map(((t,n)=>["${".concat(n,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var n;return null!==(n=r.get(t))&&void 0!==n?n:t}))}static setMessages(t){n=t}static create(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&n.push(a);var i=new r(t,n,e);return i.stack=null==a?void 0:a.stack,i}}const e=new WeakMap;async function a(t,n,a){return await async function(t,n,a,i){if("undefined"==typeof window&&void 0===i)throw new r(21,[]);const o=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=i?i:window);"null"===o&&(null!=i?i:window).top!==(null!=i?i:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const c=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",o);null!=n&&c.searchParams.set("clientId",n),c.searchParams.set("packageName","@grammarly/editor-sdk");const s=await async function(t,n){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const i=new Promise(((e,a)=>{try{let e=function(t,n){return t.document.querySelectorAll(`script[src^="${n.replace(/\?.*$/,"")}"]`)[0]}(t,n);null!=e?i():(e=function(t,n){const r=t.document.createElement("script");return r.src=n,t.document.head.appendChild(r),r}(t,n),e.addEventListener("load",i),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function i(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new r(22,[]);e(t.Grammarly)}catch(t){a(t)}}}));return e.set(t,i),await i}(null!=i?i:window,c.toString());if(null!=n)return new s.EditorSDK(n,a)}(0,t,n,a)}const i=function(){const t=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(t){const n=t.src;if(n){const t=new URL(n).searchParams.get("clientId");if(null!=t)return t}const r=t.getAttribute("clientId");if(null!=r)return r}}(),o=async function(t){return await t.catch((t=>{console.error(t.message)}))}(null!=i?a(i):a());window.Grammarly.init=async(t=i)=>{const n=i===t?await o:null!=t?await a(t):void 0;if(null==n)throw new r(20,[]);return n}}();
!function(){"use strict";function t(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var n=new Map;class r extends Error{constructor(n,r){super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0);var e=new URL("https://developer.grammarly.com/docs/error-explainer");e.searchParams.set("code",n.toString()),r.forEach((t=>e.searchParams.append("args",function(t){if(t instanceof Error)return t.message+"\n"+String(t.stack);if(null==t)return"null";if("object"==typeof t)try{return Object.prototype.toString.call(t)}catch(t){}return String(t)}(t)))),null!=this.stack&&e.searchParams.set("trace",this.stack),this.message="Minified error #".concat(n,": See ").concat(e.toString()," for details."),this.args=r,this.code=n,this.url=e.toString()}toUserMessage(){var t=n.get("".concat(this.code));if(null==t)return[this];var r=new Map(this.args.map(((t,n)=>["${".concat(n,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var n;return null!==(n=r.get(t))&&void 0!==n?n:t}))}static setMessages(t){n=t}static create(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&n.push(a);var i=new r(t,n,e);return i.stack=null==a?void 0:a.stack,i}}const e=new WeakMap;async function a(t,n,a){return await async function(t,n,a,i){if("undefined"==typeof window&&void 0===i)throw new r(21,[]);const o=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=i?i:window);"null"===o&&(null!=i?i:window).top!==(null!=i?i:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const c=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",o);null!=n&&c.searchParams.set("clientId",n),c.searchParams.set("packageName","@grammarly/editor-sdk");const s=await async function(t,n){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const i=new Promise(((e,a)=>{try{let e=function(t,n){return t.document.querySelectorAll(`script[src^="${n.replace(/\?.*$/,"")}"]`)[0]}(t,n);null!=e?i():(e=function(t,n){const r=t.document.createElement("script");return r.src=n,t.document.head.appendChild(r),r}(t,n),e.addEventListener("load",i),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function i(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new r(22,[]);e(t.Grammarly)}catch(t){a(t)}}}));return e.set(t,i),await i}(null!=i?i:window,c.toString());if(null!=n)return new s.EditorSDK(n,a)}(0,t,n,a)}const i=function(){const t=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(t){const n=t.src;if(n){const t=new URL(n).searchParams.get("clientId");if(null!=t)return t}const r=t.getAttribute("clientId");if(null!=r)return r}}(),o=async function(t){return await t.catch((t=>{console.error(t.message)}))}(null!=i?a(i):a());window.Grammarly.init=async(t=i)=>{const n=i===t?await o:null!=t?await a(t):void 0;if(null==n)throw new r(20,[]);return n}}();

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

*/
"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=new Map;class n extends Error{constructor(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0);var o=new URL("https://developer.grammarly.com/docs/error-explainer");o.searchParams.set("code",e.toString()),n.forEach((t=>o.searchParams.append("args",function(t){if(t instanceof Error)return t.message+"\n"+String(t.stack);if(null==t)return"null";if("object"==typeof t)try{return Object.prototype.toString.call(t)}catch(t){}return String(t)}(t)))),null!=this.stack&&o.searchParams.set("trace",this.stack),this.message="".concat(r,"Minified error #").concat(e,": See ").concat(o.toString()," for details."),this.args=n,this.code=e,this.url=o.toString()}toUserMessage(){var t=e.get("".concat(this.code));if(null==t)return[this];var n=new Map(this.args.map(((t,e)=>["${".concat(e,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var e;return null!==(e=n.get(t))&&void 0!==e?e:t}))}static setMessages(t){e=t}static create(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;null!=o&&e.push(o);var a=new n(t,e,r);return a.stack=null==o?void 0:o.stack,a}}const r=new WeakMap;async function o(t,e,o,a){if("undefined"==typeof window&&void 0===a)throw new n(21,[]);const i=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=a?a:window);"null"===i&&(null!=a?a:window).top!==(null!=a?a:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",i);null!=e&&s.searchParams.set("clientId",e),s.searchParams.set("packageName",t);const l=await async function(t,e){const o=r.get(t);if(null!=o)return await o;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const a=new Promise(((r,o)=>{try{let r=function(t,e){return t.document.querySelectorAll(`script[src^="${e.replace(/\?.*$/,"")}"]`)[0]}(t,e);null!=r?a():(r=function(t,e){const n=t.document.createElement("script");return n.src=e,t.document.head.appendChild(n),n}(t,e),r.addEventListener("load",a),r.addEventListener("error",(function(){try{throw new n(23,[])}catch(t){o(t)}})))}catch(t){return o(t)}function a(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new n(22,[]);r(t.Grammarly)}catch(t){o(t)}}}));return r.set(t,a),await a}(null!=a?a:window,s.toString());if(null!=e)return new l.EditorSDK(e,o)}exports.callbackToEventName={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"},exports.init=async function(t,e,n){return await o("@grammarly/editor-sdk",t,e,n)},exports.init_with_packageName=o;
"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=new Map;class n extends Error{constructor(e,n){super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0);var r=new URL("https://developer.grammarly.com/docs/error-explainer");r.searchParams.set("code",e.toString()),n.forEach((t=>r.searchParams.append("args",function(t){if(t instanceof Error)return t.message+"\n"+String(t.stack);if(null==t)return"null";if("object"==typeof t)try{return Object.prototype.toString.call(t)}catch(t){}return String(t)}(t)))),null!=this.stack&&r.searchParams.set("trace",this.stack),this.message="Minified error #".concat(e,": See ").concat(r.toString()," for details."),this.args=n,this.code=e,this.url=r.toString()}toUserMessage(){var t=e.get("".concat(this.code));if(null==t)return[this];var n=new Map(this.args.map(((t,e)=>["${".concat(e,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var e;return null!==(e=n.get(t))&&void 0!==e?e:t}))}static setMessages(t){e=t}static create(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;null!=o&&e.push(o);var a=new n(t,e,r);return a.stack=null==o?void 0:o.stack,a}}const r=new WeakMap;async function o(t,e,o,a){if("undefined"==typeof window&&void 0===a)throw new n(21,[]);const i=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=a?a:window);"null"===i&&(null!=a?a:window).top!==(null!=a?a:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.2",i);null!=e&&s.searchParams.set("clientId",e),s.searchParams.set("packageName",t);const l=await async function(t,e){const o=r.get(t);if(null!=o)return await o;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const a=new Promise(((r,o)=>{try{let r=function(t,e){return t.document.querySelectorAll(`script[src^="${e.replace(/\?.*$/,"")}"]`)[0]}(t,e);null!=r?a():(r=function(t,e){const n=t.document.createElement("script");return n.src=e,t.document.head.appendChild(n),n}(t,e),r.addEventListener("load",a),r.addEventListener("error",(function(){try{throw new n(23,[])}catch(t){o(t)}})))}catch(t){return o(t)}function a(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new n(22,[]);r(t.Grammarly)}catch(t){o(t)}}}));return r.set(t,a),await a}(null!=a?a:window,s.toString());if(null!=e)return new l.EditorSDK(e,o)}exports.callbackToEventName={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"},exports.init=async function(t,e,n){return await o("@grammarly/editor-sdk",t,e,n)},exports.init_with_packageName=o;

@@ -16,3 +16,3 @@ {

],
"version": "2.2.0",
"version": "2.2.1",
"main": "./lib/index.js",

@@ -40,6 +40,6 @@ "module": "./lib/index.esm.js",

"devDependencies": {
"@grammarly/plugin-core": "2.2.0",
"@grammarly/plugin-editor": "2.2.0",
"@grammarly/plugin-invariant": "2.2.0",
"@grammarly/plugin-reactivity": "2.2.0",
"@grammarly/plugin-core": "2.2.1",
"@grammarly/plugin-editor": "2.2.1",
"@grammarly/plugin-invariant": "2.2.1",
"@grammarly/plugin-reactivity": "2.2.1",
"@microsoft/api-extractor": "^7.28.7",

@@ -46,0 +46,0 @@ "@testing-library/jest-dom": "^5.11.10",

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