Socket
Socket
Sign inDemoInstall

@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.3.17 to 2.3.18

2

lib/editor-sdk.beta.d.ts

@@ -297,3 +297,3 @@ /**

*
* Overall API for the Editor SDK which can be used to create an {@link Editor}, which represent HTML editors enhanced with Grammarly.
* Overall API for the Editor SDK which can be used to create an {@link Editor}, which represents an HTML editor enhanced with Grammarly.
*

@@ -300,0 +300,0 @@ * @example

@@ -297,3 +297,3 @@ /**

*
* Overall API for the Editor SDK which can be used to create an {@link Editor}, which represent HTML editors enhanced with Grammarly.
* Overall API for the Editor SDK which can be used to create an {@link Editor}, which represents an HTML editor enhanced with Grammarly.
*

@@ -300,0 +300,0 @@ * @example

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

*/
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),t(this,"_c",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]))),e=t.split(/(\${\d+})/).filter((t=>""!==t));return e.map((t=>{var n;return null!==(n=r.get(t))&&void 0!==n?n:t}))}toJSON(){return{name:"InvariantError",message:this.message,description:this._n,code:this.code,args:this.args,stack:this.stack}}static setMessages(t){n=t}static create(t,n,e,a){null!=a&&n.push(a);var o=new r(t,n,e);return o.stack=null==a?void 0:a.stack,o._n=e,o}}const e=new WeakMap;async function a(t,n){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((e,a)=>{try{let e=function(t,n){return t.document.querySelectorAll(`script[src^="${n.replace(/\?.*$/,"")}"]`)[0]}(t,n);null!=e?o():(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",o),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function o(){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,o),await o}async function o(t,n,r){return await s("@grammarly/editor-sdk",t,n,r)}async function s(t,n,e,o){if("undefined"==typeof window&&void 0===o)throw new r(21,[]);const s=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=o?o:window);"null"===s&&(null!=o?o:window).top!==(null!=o?o:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.3",s);null!=n&&i.searchParams.set("clientId",n),i.searchParams.set("packageName",t);const c=await a(null!=o?o:window,i.toString());if(null!=n)return new c.EditorSDK(n,e)}const i={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onSuggestionCardAction:"suggestion-card-action",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"};export{i as callbackToEventName,o as init,s as init_with_packageName};
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),t(this,"_c",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]))),e=t.split(/(\${\d+})/).filter((t=>""!==t));return e.map((t=>{var n;return null!==(n=r.get(t))&&void 0!==n?n:t}))}toJSON(){return{name:"InvariantError",message:this.message,description:this._m,code:this.code,args:this.args,stack:this.stack}}static setMessages(t){n=t}static create(t,n,e,a){null!=a&&n.push(a);var o=new r(t,n,e);return o.stack=null==a?void 0:a.stack,o._m=e,o}}const e=new WeakMap;async function a(t,n){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((e,a)=>{try{let e=function(t,n){return t.document.querySelectorAll(`script[src^="${n.replace(/\?.*$/,"")}"]`)[0]}(t,n);null!=e?o():(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",o),e.addEventListener("error",(function(){try{throw new r(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function o(){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,o),await o}async function o(t,n,r){return await s("@grammarly/editor-sdk",t,n,r)}async function s(t,n,e,o){if("undefined"==typeof window&&void 0===o)throw new r(21,[]);const s=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=o?o:window);"null"===s&&(null!=o?o:window).top!==(null!=o?o:window)&&console.warn("Grammarly is not supported in IFrames with `null` origin. Consider adding `sandbox='allow-same-origin allow-scripts'` to <iframe> element.");const i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.3",s);null!=n&&i.searchParams.set("clientId",n),i.searchParams.set("packageName",t);const c=await a(null!=o?o:window,i.toString());if(null!=n)return new c.EditorSDK(n,e)}const i={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onSuggestionCardAction:"suggestion-card-action",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"};export{i as callbackToEventName,o as init,s as init_with_packageName};

@@ -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){super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0),t(this,"_c",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]))),r=t.split(/(\${\d+})/).filter((t=>""!==t));return r.map((t=>{var e;return null!==(e=n.get(t))&&void 0!==e?e:t}))}toJSON(){return{name:"InvariantError",message:this.message,description:this._n,code:this.code,args:this.args,stack:this.stack}}static setMessages(t){e=t}static create(t,e,r,o){null!=o&&e.push(o);var a=new n(t,e,r);return a.stack=null==o?void 0:o.stack,a._n=r,a}}const r=new WeakMap;async function o(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}async function a(t,e,r,a){if("undefined"==typeof window&&void 0===a)throw new n(21,[]);const s=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=a?a:window);"null"===s&&(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 i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.3",s);null!=e&&i.searchParams.set("clientId",e),i.searchParams.set("packageName",t);const c=await o(null!=a?a:window,i.toString());if(null!=e)return new c.EditorSDK(e,r)}exports.callbackToEventName={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onSuggestionCardAction:"suggestion-card-action",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"},exports.init=async function(t,e,n){return await a("@grammarly/editor-sdk",t,e,n)},exports.init_with_packageName=a;
"use strict";function t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=new Map;class r extends Error{constructor(e,r){super(),t(this,"args",void 0),t(this,"code",void 0),t(this,"url",void 0),t(this,"_c",void 0);var n=new URL("https://developer.grammarly.com/docs/error-explainer");n.searchParams.set("code",e.toString()),r.forEach((t=>n.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&&n.searchParams.set("trace",this.stack),this.message="Minified error #".concat(e,": See ").concat(n.toString()," for details."),this.args=r,this.code=e,this.url=n.toString()}toUserMessage(){var t=e.get("".concat(this.code));if(null==t)return[this];var r=new Map(this.args.map(((t,e)=>["${".concat(e,"}"),t]))),n=t.split(/(\${\d+})/).filter((t=>""!==t));return n.map((t=>{var e;return null!==(e=r.get(t))&&void 0!==e?e:t}))}toJSON(){return{name:"InvariantError",message:this.message,description:this._m,code:this.code,args:this.args,stack:this.stack}}static setMessages(t){e=t}static create(t,e,n,o){null!=o&&e.push(o);var a=new r(t,e,n);return a.stack=null==o?void 0:o.stack,a._m=n,a}}const n=new WeakMap;async function o(t,e){const o=n.get(t);if(null!=o)return await o;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const a=new Promise(((n,o)=>{try{let n=function(t,e){return t.document.querySelectorAll(`script[src^="${e.replace(/\?.*$/,"")}"]`)[0]}(t,e);null!=n?a():(n=function(t,e){const r=t.document.createElement("script");return r.src=e,t.document.head.appendChild(r),r}(t,e),n.addEventListener("load",a),n.addEventListener("error",(function(){try{throw new r(23,[])}catch(t){o(t)}})))}catch(t){return o(t)}function a(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new r(22,[]);n(t.Grammarly)}catch(t){o(t)}}}));return n.set(t,a),await a}async function a(t,e,n,a){if("undefined"==typeof window&&void 0===a)throw new r(21,[]);const s=function(t){return"null"!==t.location.origin?t.location.origin:"null"!==t.origin?t.origin:"null"}(null!=a?a:window);"null"===s&&(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 i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.3",s);null!=e&&i.searchParams.set("clientId",e),i.searchParams.set("packageName",t);const c=await o(null!=a?a:window,i.toString());if(null!=e)return new c.EditorSDK(e,n)}exports.callbackToEventName={onBeforeSuggestionCardOpen:"before-suggestion-card-open",onSuggestionCardOpen:"suggestion-card-open",onSuggestionCardClose:"suggestion-card-close",onSuggestionCardAction:"suggestion-card-action",onPluginTurnedOff:"plugin-turned-off",onPluginError:"plugin-error",onDocumentStats:"document-stats",onSessionStats:"session-stats"},exports.init=async function(t,e,r){return await a("@grammarly/editor-sdk",t,e,r)},exports.init_with_packageName=a;

@@ -22,3 +22,3 @@ {

],
"version": "2.3.17",
"version": "2.3.18",
"main": "./lib/index.js",

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

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

@@ -53,0 +53,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