@grammarly/editor-sdk
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -18,4 +18,2 @@ /** | ||
export { Event, EventListener } from '@grammarly/reactivity'; | ||
/** | ||
@@ -22,0 +20,0 @@ * Identifier used to authenticate with Grammarly. |
@@ -18,4 +18,2 @@ /** | ||
export { Event, EventListener } from '@grammarly/reactivity'; | ||
/** | ||
@@ -22,0 +20,0 @@ * Identifier used to authenticate with Grammarly. |
@@ -17,2 +17,2 @@ /** | ||
*/ | ||
function t(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var r=new Map;class e extends Error{constructor(r,e){var n=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",r.toString()),e.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(n,"Minified error #").concat(r,": See ").concat(a.toString()," for details."),this.args=e,this.code=r,this.url=a.toString()}toUserMessage(){var t=r.get("".concat(this.code));if(null==t)return[this];var e=new Map(this.args.map(((t,r)=>["${".concat(r,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var r;return null!==(r=e.get(t))&&void 0!==r?r:t}))}static setMessages(t){r=t}static create(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&r.push(a);var o=new e(t,r,n);return o.stack=null==a?void 0:a.stack,o}}const n=new WeakMap;async function a(t,r,e){return await o("@grammarly/editor-sdk",t,r,e)}async function o(t,r,a,o){if("undefined"==typeof window&&void 0===o)throw new e(21,[]);const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",location.origin);null!=r&&s.searchParams.set("clientId",r),s.searchParams.set("packageName",t);const i=await async function(t,r){const a=n.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((n,a)=>{try{let n=function(t,r){return t.document.querySelectorAll(`script[src^="${r.replace(/\?.*$/,"")}"]`)[0]}(t,r);null!=n?o():(n=function(t,r){const e=t.document.createElement("script");return e.src=r,t.document.head.appendChild(e),e}(t,r),n.addEventListener("load",o),n.addEventListener("error",(function(){try{throw new e(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function o(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new e(22,[]);n(t.Grammarly)}catch(t){a(t)}}}));return n.set(t,o),await o}(null!=o?o:window,s.toString());if(null!=r)return new i.EditorSDK(r,a)}const s={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{o as _init,s as callbackToEventName,a as init}; | ||
function t(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var r=new Map;class e extends Error{constructor(r,e){var n=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",r.toString()),e.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(n,"Minified error #").concat(r,": See ").concat(a.toString()," for details."),this.args=e,this.code=r,this.url=a.toString()}toUserMessage(){var t=r.get("".concat(this.code));if(null==t)return[this];var e=new Map(this.args.map(((t,r)=>["${".concat(r,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var r;return null!==(r=e.get(t))&&void 0!==r?r:t}))}static setMessages(t){r=t}static create(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&r.push(a);var o=new e(t,r,n);return o.stack=null==a?void 0:a.stack,o}}const n=new WeakMap;async function a(t,r,e){return await o("@grammarly/editor-sdk",t,r,e)}async function o(t,r,a,o){if("undefined"==typeof window&&void 0===o)throw new e(21,[]);const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",window.location.origin);null!=r&&s.searchParams.set("clientId",r),s.searchParams.set("packageName",t);const i=await async function(t,r){const a=n.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((n,a)=>{try{let n=function(t,r){return t.document.querySelectorAll(`script[src^="${r.replace(/\?.*$/,"")}"]`)[0]}(t,r);null!=n?o():(n=function(t,r){const e=t.document.createElement("script");return e.src=r,t.document.head.appendChild(e),e}(t,r),n.addEventListener("load",o),n.addEventListener("error",(function(){try{throw new e(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function o(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new e(22,[]);n(t.Grammarly)}catch(t){a(t)}}}));return n.set(t,o),await o}(null!=o?o:window,s.toString());if(null!=r)return new i.EditorSDK(r,a)}const s={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{o as _init,s as callbackToEventName,a as init}; |
@@ -17,2 +17,2 @@ /** | ||
*/ | ||
!function(){"use strict";function t(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var r=new Map;class n extends Error{constructor(r,n){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",r.toString()),n.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(r,": See ").concat(a.toString()," for details."),this.args=n,this.code=r,this.url=a.toString()}toUserMessage(){var t=r.get("".concat(this.code));if(null==t)return[this];var n=new Map(this.args.map(((t,r)=>["${".concat(r,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var r;return null!==(r=n.get(t))&&void 0!==r?r:t}))}static setMessages(t){r=t}static create(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&r.push(a);var c=new n(t,r,e);return c.stack=null==a?void 0:a.stack,c}}const e=new WeakMap;async function a(t,r,a){return await async function(t,r,a,c){if("undefined"==typeof window&&void 0===c)throw new n(21,[]);const i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",location.origin);null!=r&&i.searchParams.set("clientId",r),i.searchParams.set("packageName","@grammarly/editor-sdk");const o=await async function(t,r){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const c=new Promise(((e,a)=>{try{let e=function(t,r){return t.document.querySelectorAll(`script[src^="${r.replace(/\?.*$/,"")}"]`)[0]}(t,r);null!=e?c():(e=function(t,r){const n=t.document.createElement("script");return n.src=r,t.document.head.appendChild(n),n}(t,r),e.addEventListener("load",c),e.addEventListener("error",(function(){try{throw new n(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function c(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new n(22,[]);e(t.Grammarly)}catch(t){a(t)}}}));return e.set(t,c),await c}(null!=c?c:window,i.toString());if(null!=r)return new o.EditorSDK(r,a)}(0,t,r,a)}const c=function(){const t=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(t){const r=t.src;if(r){const t=new URL(r).searchParams.get("clientId");if(null!=t)return t}const n=t.getAttribute("clientId");if(null!=n)return n}}(),i=async function(t){return await t.catch((t=>{console.error(t.message)}))}(null!=c?a(c):a());window.Grammarly.init=async(t=c)=>{const r=c===t?await i:null!=t?await a(t):void 0;if(null==r)throw new n(20,[]);return r}}(); | ||
!function(){"use strict";function t(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var r=new Map;class n extends Error{constructor(r,n){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",r.toString()),n.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(r,": See ").concat(a.toString()," for details."),this.args=n,this.code=r,this.url=a.toString()}toUserMessage(){var t=r.get("".concat(this.code));if(null==t)return[this];var n=new Map(this.args.map(((t,r)=>["${".concat(r,"}"),t])));return t.split(/(\${\d+})/).filter((t=>""!==t)).map((t=>{var r;return null!==(r=n.get(t))&&void 0!==r?r:t}))}static setMessages(t){r=t}static create(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&r.push(a);var c=new n(t,r,e);return c.stack=null==a?void 0:a.stack,c}}const e=new WeakMap;async function a(t,r,a){return await async function(t,r,a,c){if("undefined"==typeof window&&void 0===c)throw new n(21,[]);const i=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",window.location.origin);null!=r&&i.searchParams.set("clientId",r),i.searchParams.set("packageName","@grammarly/editor-sdk");const o=await async function(t,r){const a=e.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const c=new Promise(((e,a)=>{try{let e=function(t,r){return t.document.querySelectorAll(`script[src^="${r.replace(/\?.*$/,"")}"]`)[0]}(t,r);null!=e?c():(e=function(t,r){const n=t.document.createElement("script");return n.src=r,t.document.head.appendChild(n),n}(t,r),e.addEventListener("load",c),e.addEventListener("error",(function(){try{throw new n(23,[])}catch(t){a(t)}})))}catch(t){return a(t)}function c(){try{if(null==t.Grammarly||"function"!=typeof t.Grammarly.EditorSDK)throw new n(22,[]);e(t.Grammarly)}catch(t){a(t)}}}));return e.set(t,c),await c}(null!=c?c:window,i.toString());if(null!=r)return new o.EditorSDK(r,a)}(0,t,r,a)}const c=function(){const t=function(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript}();if(t){const r=t.src;if(r){const t=new URL(r).searchParams.get("clientId");if(null!=t)return t}const n=t.getAttribute("clientId");if(null!=n)return n}}(),i=async function(t){return await t.catch((t=>{console.error(t.message)}))}(null!=c?a(c):a());window.Grammarly.init=async(t=c)=>{const r=c===t?await i:null!=t?await a(t):void 0;if(null==r)throw new n(20,[]);return r}}(); |
@@ -17,2 +17,2 @@ /** | ||
*/ | ||
"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){var n=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",e.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(n,"Minified error #").concat(e,": See ").concat(a.toString()," for details."),this.args=r,this.code=e,this.url=a.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}))}static setMessages(t){e=t}static create(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&e.push(a);var o=new r(t,e,n);return o.stack=null==a?void 0:a.stack,o}}const n=new WeakMap;async function a(t,e){const a=n.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((n,a)=>{try{let n=function(t,e){return t.document.querySelectorAll(`script[src^="${e.replace(/\?.*$/,"")}"]`)[0]}(t,e);null!=n?o():(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",o),n.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,[]);n(t.Grammarly)}catch(t){a(t)}}}));return n.set(t,o),await o}async function o(t,e,n,o){if("undefined"==typeof window&&void 0===o)throw new r(21,[]);const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",location.origin);null!=e&&s.searchParams.set("clientId",e),s.searchParams.set("packageName",t);const i=await a(null!=o?o:window,s.toString());if(null!=e)return new i.EditorSDK(e,n)}exports._init=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,r){return await o("@grammarly/editor-sdk",t,e,r)}; | ||
"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){var n=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",e.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(n,"Minified error #").concat(e,": See ").concat(a.toString()," for details."),this.args=r,this.code=e,this.url=a.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}))}static setMessages(t){e=t}static create(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3?arguments[3]:void 0;null!=a&&e.push(a);var o=new r(t,e,n);return o.stack=null==a?void 0:a.stack,o}}const n=new WeakMap;async function a(t,e){const a=n.get(t);if(null!=a)return await a;!function(t){null==t.Grammarly&&(t.Grammarly={})}(t);const o=new Promise(((n,a)=>{try{let n=function(t,e){return t.document.querySelectorAll(`script[src^="${e.replace(/\?.*$/,"")}"]`)[0]}(t,e);null!=n?o():(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",o),n.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,[]);n(t.Grammarly)}catch(t){a(t)}}}));return n.set(t,o),await o}async function o(t,e,n,o){if("undefined"==typeof window&&void 0===o)throw new r(21,[]);const s=new URL("https://js.grammarly.com/grammarly-editor-sdk@2.0",window.location.origin);null!=e&&s.searchParams.set("clientId",e),s.searchParams.set("packageName",t);const i=await a(null!=o?o:window,s.toString());if(null!=e)return new i.EditorSDK(e,n)}exports._init=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,r){return await o("@grammarly/editor-sdk",t,e,r)}; |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "./lib/index.js", | ||
@@ -41,6 +41,6 @@ "module": "./lib/index.esm.js", | ||
"devDependencies": { | ||
"@grammarly/plugin-core": "2.0.1", | ||
"@grammarly/plugin-editor": "2.0.1", | ||
"@grammarly/plugin-invariant": "2.0.1", | ||
"@grammarly/plugin-reactivity": "2.0.1", | ||
"@grammarly/plugin-core": "2.0.2", | ||
"@grammarly/plugin-editor": "2.0.2", | ||
"@grammarly/plugin-invariant": "2.0.2", | ||
"@grammarly/plugin-reactivity": "2.0.2", | ||
"@microsoft/api-extractor": "^7.28.7", | ||
@@ -47,0 +47,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
71178
1563