@silexlabs/grapesjs-notifications 0.2.1 → 0.2.2-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/capabilities.d.ts +2 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/commands.d.ts +5 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities.ts +33 -0
- package/src/commands.ts +5 -0
- package/src/index.ts +25 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GrapesJs Notifications Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Centralized notification system for GrapesJS plugins. Displays errors, warnings and activity messages in a consistent UI.
|
|
4
4
|
|
|
5
5
|
It displays various types of notifications including errors, warnings, and activities, thereby facilitating a more interactive and responsive interface. The most important feature is probably that it allows users to interact with the notifications by clicking on them to select a specific component in the editor, go to a page or scroll to the component.
|
|
6
6
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,QA8BzF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const NOTIFICATION_ADD = "notifications:add";
|
|
2
|
+
export declare const NOTIFICATION_REMOVE = "notifications:remove";
|
|
3
|
+
export declare const NOTIFICATION_CLEAR = "notifications:clear";
|
|
4
|
+
export declare const NOTIFICATION_LIST = "notifications:list";
|
|
5
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,sBAAsB,CAAA;AACnD,eAAO,MAAM,mBAAmB,yBAAyB,CAAA;AACzD,eAAO,MAAM,kBAAkB,wBAAwB,CAAA;AACvD,eAAO,MAAM,iBAAiB,uBAAuB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Editor } from 'grapesjs';
|
|
2
2
|
import { NotificationManagerOptions, NOTIFICATION_CHANGED, NOTIFICATION_ADDED, NOTIFICATION_REMOVED, NOTIFICATION_CLEARED } from './NotificationManager';
|
|
3
|
-
export
|
|
4
|
-
export declare const NOTIFICATION_REMOVE = "notifications:remove";
|
|
5
|
-
export declare const NOTIFICATION_CLEAR = "notifications:clear";
|
|
3
|
+
export { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands';
|
|
6
4
|
export { NOTIFICATION_CHANGED, NOTIFICATION_ADDED, NOTIFICATION_REMOVED, NOTIFICATION_CLEARED };
|
|
7
5
|
export type { NotificationManagerOptions } from './NotificationManager';
|
|
8
6
|
export type { NotificationOptions } from './Notification';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,EAEL,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGzG,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,CAAA;AAGD,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;yBAiB7B,QAAQ,MAAM,EAAE,OAAM,OAAO,CAAC,0BAA0B,CAAM;;wBA2EtD,GAAG;2BACA,GAAG;;;AA5E9B,wBA+EC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @silexlabs/grapesjs-notifications - 0.2.1 */
|
|
2
|
-
!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["@silexlabs/grapesjs-notifications"]=e():t["@silexlabs/grapesjs-notifications"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})}},e={};t.r(e),t.d(e,{NOTIFICATION_ADD:()=>Dt,NOTIFICATION_ADDED:()=>a,NOTIFICATION_CHANGED:()=>r,NOTIFICATION_CLEAR:()=>Lt,NOTIFICATION_CLEARED:()=>c,NOTIFICATION_REMOVE:()=>zt,NOTIFICATION_REMOVED:()=>l,Notification:()=>s,default:()=>Kt});const n={'@silexlabs/grapesjs-notifications':{Close:'✖ Dismiss',CloseAll:'✖ Dismiss all',Select:'✓ Select component',Show:'↓ Show'}};var i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},i.apply(this,arguments)},s=function(){function t(t,e,n){var i=this;this.editor=t,this.id=null,this.componentId=null,this.group=null,this.options=this.getDefaultOptions(e),this.removeCallback=n,this.options.timeout&&(this.timeoutRef=setTimeout((function(){return i.remove()}),this.options.timeout)),this.id=e.id||null,this.message=this.options.message,this.type=this.options.type,this.componentId=e.componentId||null,this.group=e.group||null,this.model={attributes:e}}return t.prototype.select=function(){var t=this;if(this.options.componentId){var e=this.getAllComponents(this.editor).find((function(e){var n=e.component;e.page;return n.getId()===t.options.componentId}))||null;if(e){var n=e.component,i=e.page;this.editor.Pages.select(i),this.editor.select(n),this.editor.Canvas.scrollTo(n)}else console.error("Component with ID ".concat(this.options.componentId," not found")),this.editor.runCommand('notifications:add',{message:"Component with ID ".concat(this.options.componentId," not found"),type:'error'})}},t.prototype.remove=function(){this.removeCallback?this.removeCallback(this):this.editor.runCommand('notifications:remove',{notification:this}),this.timeoutRef&&clearTimeout(this.timeoutRef)},t.prototype.getSvgIcon=function(t){var e;return null===(e=this.options.icons)||void 0===e?void 0:e[t]},t.prototype.getDefaultOptions=function(t){return i({icons:i({info:"🚧",warning:"⚠",error:"🚫",success:"✅",group:"📌"},t.icons)},t)},t.prototype.getAllComponents=function(t){var e=this;return t.Pages.getAll().map((function(t){return e.getAllComponentInPage(t)})).flat()},t.prototype.getAllComponentInPage=function(t){var e=t.getMainComponent();return[{component:e,page:t}].concat(this.getAllChildrenComponent(e).map((function(e){return{component:e,page:t}})))},t.prototype.getAllChildrenComponent=function(t){var e=this,n=Array.from(t.components().models);return n.concat(n.map((function(t){return e.getAllChildrenComponent(t)})).flat())},t}(),o=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,s=0,o=e.length;s<o;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))},r='notifications:changed',a='notifications:added',l='notifications:removed',c='notifications:cleared',h=function(){function t(t,e,n){var i=this;this.editor=e,this.options=n,this.notifications=[],this.notifications=t.map((function(t){if('object'==typeof t&&t.message){return new s(i.editor,t,(function(t){return i.remove(t)}))}return t})).filter(Boolean)}return t.prototype.getAll=function(){return o([],this.notifications,!0)},t.prototype.add=function(t){var e=this;if(t.id){var n=this.notifications.find((function(e){return e.options.id===t.id}));n&&this.remove(n)}var i=new s(this.editor,t,(function(t){return e.remove(t)}));this.notifications.push(i),this.editor.trigger(a,i),this.editor.trigger(r,this.getAll())},t.prototype.remove=function(t){var e=this.notifications.findIndex((function(e){return e===t||e.model===t}));if(e>-1){var n=this.notifications.splice(e,1)[0];this.editor.trigger(l,n),this.editor.trigger(r,this.getAll())}},t.prototype.reset=function(){this.notifications=[],this.editor.trigger(c),this.editor.trigger(r,this.getAll())},t}();const d=globalThis,p=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,u=Symbol(),f=new WeakMap;class g{constructor(t,e,n){if(this._$cssResult$=!0,n!==u)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(p&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=f.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&f.set(e,t))}return t}toString(){return this.cssText}}const m=(t,e)=>{if(p)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=d.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},_=p?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new g("string"==typeof t?t:t+"",void 0,u))(e)})(t):t,{is:y,defineProperty:$,getOwnPropertyDescriptor:v,getOwnPropertyNames:A,getOwnPropertySymbols:b,getPrototypeOf:E}=Object,C=globalThis,S=C.trustedTypes,j=S?S.emptyScript:"",w=C.reactiveElementPolyfillSupport,x=(t,e)=>t,O={toAttribute(t,e){switch(e){case Boolean:t=t?j:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},P=(t,e)=>!y(t,e),I={attribute:!0,type:String,converter:O,reflect:!1,useDefault:!1,hasChanged:P};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=I){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&$(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:s}=v(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=i?.call(this);s?.call(this,e),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??I}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=E(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const t=this.properties,e=[...A(t),...b(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(_(t))}else void 0!==t&&e.push(_(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return m(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:O).toAttribute(e,n.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=n.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:O;this._$Em=i,this[i]=s.fromAttribute(e,t.type)??this._$Ej?.get(i)??null,this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){const i=this.constructor,s=this[t];if(n??=i.getPropertyOptions(t),!((n.hasChanged??P)(s,e)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==s||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,n,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[x("elementProperties")]=new Map,T[x("finalized")]=new Map,w?.({ReactiveElement:T}),(C.reactiveElementVersions??=[]).push("2.1.0");const N=globalThis,M=N.trustedTypes,U=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,H="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,k="?"+R,D=`<${k}>`,z=document,L=()=>z.createComment(""),B=t=>null===t||"object"!=typeof t&&"function"!=typeof t,K=Array.isArray,F=t=>K(t)||"function"==typeof t?.[Symbol.iterator],V="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,J=/>/g,Z=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,Q=/"/g,X=/^(?:script|style|textarea|title)$/i,Y=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),tt=Y(1),et=(Y(2),Y(3),Symbol.for("lit-noChange")),nt=Symbol.for("lit-nothing"),it=new WeakMap,st=z.createTreeWalker(z,129);function ot(t,e){if(!K(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==U?U.createHTML(e):e}const rt=(t,e)=>{const n=t.length-1,i=[];let s,o=2===e?"<svg>":3===e?"<math>":"",r=W;for(let e=0;e<n;e++){const n=t[e];let a,l,c=-1,h=0;for(;h<n.length&&(r.lastIndex=h,l=r.exec(n),null!==l);)h=r.lastIndex,r===W?"!--"===l[1]?r=q:void 0!==l[1]?r=J:void 0!==l[2]?(X.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=Z):void 0!==l[3]&&(r=Z):r===Z?">"===l[0]?(r=s??W,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?Z:'"'===l[3]?Q:G):r===Q||r===G?r=Z:r===q||r===J?r=W:(r=Z,s=void 0);const d=r===Z&&t[e+1].startsWith("/>")?" ":"";o+=r===W?n+D:c>=0?(i.push(a),n.slice(0,c)+H+n.slice(c)+R+d):n+R+(-2===c?e:d)}return[ot(t,o+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class at{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let s=0,o=0;const r=t.length-1,a=this.parts,[l,c]=rt(t,e);if(this.el=at.createElement(l,n),st.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=st.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(H)){const e=c[o++],n=i.getAttribute(t).split(R),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:r[2],strings:n,ctor:"."===r[1]?pt:"?"===r[1]?ut:"@"===r[1]?ft:dt}),i.removeAttribute(t)}else t.startsWith(R)&&(a.push({type:6,index:s}),i.removeAttribute(t));if(X.test(i.tagName)){const t=i.textContent.split(R),e=t.length-1;if(e>0){i.textContent=M?M.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],L()),st.nextNode(),a.push({type:2,index:++s});i.append(t[e],L())}}}else if(8===i.nodeType)if(i.data===k)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(R,t+1));)a.push({type:7,index:s}),t+=R.length-1}s++}}static createElement(t,e){const n=z.createElement("template");return n.innerHTML=t,n}}function lt(t,e,n=t,i){if(e===et)return e;let s=void 0!==i?n._$Co?.[i]:n._$Cl;const o=B(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),void 0===o?s=void 0:(s=new o(t),s._$AT(t,n,i)),void 0!==i?(n._$Co??=[])[i]=s:n._$Cl=s),void 0!==s&&(e=lt(t,s._$AS(t,e.values),s,i)),e}class ct{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,i=(t?.creationScope??z).importNode(e,!0);st.currentNode=i;let s=st.nextNode(),o=0,r=0,a=n[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new ht(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new gt(s,this,t)),this._$AV.push(e),a=n[++r]}o!==a?.index&&(s=st.nextNode(),o++)}return st.currentNode=z,i}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class ht{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=nt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=lt(this,t,e),B(t)?t===nt||null==t||""===t?(this._$AH!==nt&&this._$AR(),this._$AH=nt):t!==this._$AH&&t!==et&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==nt&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=at.createElement(ot(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new ct(i,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=it.get(t.strings);return void 0===e&&it.set(t.strings,e=new at(t)),e}k(t){K(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const s of t)i===e.length?e.push(n=new ht(this.O(L()),this.O(L()),this,this.options)):n=e[i],n._$AI(s),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class dt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,s){this.type=1,this._$AH=nt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=nt}_$AI(t,e=this,n,i){const s=this.strings;let o=!1;if(void 0===s)t=lt(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==et,o&&(this._$AH=t);else{const i=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=lt(this,i[n+r],e,r),a===et&&(a=this._$AH[r]),o||=!B(a)||a!==this._$AH[r],a===nt?t=nt:t!==nt&&(t+=(a??"")+s[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===nt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class pt extends dt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===nt?void 0:t}}class ut extends dt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==nt)}}class ft extends dt{constructor(t,e,n,i,s){super(t,e,n,i,s),this.type=5}_$AI(t,e=this){if((t=lt(this,t,e,0)??nt)===et)return;const n=this._$AH,i=t===nt&&n!==nt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==nt&&(n===nt||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class gt{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){lt(this,t)}}const mt=N.litHtmlPolyfillSupport;mt?.(at,ht),(N.litHtmlVersions??=[]).push("3.3.0");const _t=(t,e,n)=>{const i=n?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=n?.renderBefore??null;i._$litPart$=s=new ht(e.insertBefore(L(),t),t,void 0,n??{})}return s._$AI(t),s},yt=globalThis;class $t extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=_t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return et}}$t._$litElement$=!0,$t["finalized"]=!0,yt.litElementHydrateSupport?.({LitElement:$t});const vt=yt.litElementPolyfillSupport;vt?.({LitElement:$t});(yt.litElementVersions??=[]).push("4.2.0");const At=1,bt=2,Et=t=>(...e)=>({_$litDirective$:t,values:e});class Ct{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const St=Et(class extends Ct{constructor(t){if(super(t),t.type!==At||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return et}});class jt extends Ct{constructor(t){if(super(t),this.it=nt,t.type!==bt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===nt||null==t)return this._t=void 0,this.it=t;if(t===et)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}jt.directiveName="unsafeHTML",jt.resultType=1;const wt=Et(jt);var xt,Ot,Pt,It,Tt,Nt=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Mt=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,s=0,o=e.length;s<o;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))};function Ut(t,e,n,i){var s=Mt([],n,!0);i.reverse&&s.reverse();var o=function(t){var e={},n=[];return t.forEach((function(t){t.group&&!e[t.group]?(e[t.group]=!0,n.push(t.group)):t.group||n.push(t)})),n}(s).slice(0,i.maxNotifications||s.length);_t(tt(xt||(xt=Nt(["\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ","\n </ul>\n "],["\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ","\n </ul>\n "])),o.map((function(e){return'string'==typeof e?function(t,e,n,i){return tt(Pt||(Pt=Nt(["\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>📌 ","</div>\n <button @click="," class=\"gjs-btn-prim\">","</button>\n <button\n @click=","\n class=\"gjs-btn-prim\"\n >","</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "],["\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>\\u{1F4CC} ","</div>\n <button @click="," class=\"gjs-btn-prim\">","</button>\n <button\n @click=","\n class=\"gjs-btn-prim\"\n >","</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "])),n,(function(){return i.forEach((function(t){return t.remove()}))}),t.I18n.t('@silexlabs/grapesjs-notifications.CloseAll'),(function(t){return t.currentTarget.closest('details').toggleAttribute('open')}),t.I18n.t('@silexlabs/grapesjs-notifications.Show'),i.slice(0,e.maxNotifications||i.length).map((function(e){return tt(Ot||(Ot=Nt(["\n ","\n "],["\n ","\n "])),Ht(t,e))})))}(t,i,e,s.filter((function(t){return t.group===e}))):Ht(t,e)}))),function(t){if('string'==typeof t)return document.querySelector(t);return t}(e))}function Ht(t,e){return tt(Tt||(Tt=Nt(["\n <li class=",">\n <header class=\"gjs-sm-header gjs-label\">\n <span>","</span>\n <span class=\"gjs-sm-header\">","</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click="," class=\"gjs-btn-prim\">","</button>\n ","\n </footer>\n </li>\n "],["\n <li class=",">\n <header class=\"gjs-sm-header gjs-label\">\n <span>","</span>\n <span class=\"gjs-sm-header\">","</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click="," class=\"gjs-btn-prim\">","</button>\n ","\n </footer>\n </li>\n "])),St({'gjs-sm':!0,'gjs-one-bg':!0,'gjs-two-color':!0,'gjs-notification__item':!0,'gjs-notification__info':'info'===e.type,'gjs-notification__warning':'warning'===e.type,'gjs-notification__error':'error'===e.type,'gjs-notification__success':'success'===e.type}),e.getSvgIcon(e.type),wt(e.message),(function(){return e.remove()}),t.I18n.t('@silexlabs/grapesjs-notifications.Close'),e.componentId?tt(It||(It=Nt(["\n <button @click="," class=\"gjs-btn-prim\">","</button>\n "],["\n <button @click="," class=\"gjs-btn-prim\">","</button>\n "])),(function(){return e.select()}),t.I18n.t('@silexlabs/grapesjs-notifications.Select')):'')}var Rt=function(){function t(t){this.storeKey=t}return t.prototype.getAll=function(){return this.storeKey?JSON.parse(localStorage.getItem(this.storeKey)||'[]'):[]},t.prototype.save=function(t){this.storeKey&&localStorage.setItem(this.storeKey,JSON.stringify(t.map((function(t){var e;return{message:t.message,type:t.type,componentId:t.componentId,group:t.group,timeout:null===(e=t.options)||void 0===e?void 0:e.timeout}}))))},t}(),kt=void 0&&(void 0).__assign||function(){return kt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},kt.apply(this,arguments)},Dt='notifications:add',zt='notifications:remove',Lt='notifications:clear';function Bt(t){if(t)return t;var e=document.createElement('ul');return e.style.position='fixed',e.style.bottom='10px',e.style.zIndex='9999',document.body.appendChild(e),e}const Kt=function(t,e){void 0===e&&(e={});var i=kt({i18n:{},container:Bt(e.container),storeKey:void 0,maxNotifications:50,reverse:!1},e);t.I18n&&t.I18n.addMessages(kt({en:n},i.i18n));var s=i.storeKey?new Rt(i.storeKey):null,o=new h((null==s?void 0:s.getAll())||[],t,i);return t.Commands.add(Dt,{run:function(t,e,n){o.add(n)}}),t.Commands.add(zt,{run:function(t,e,n){var i=(null==n?void 0:n.notification)||n;o.remove(i)}}),t.Commands.add(Lt,{run:function(t){o.reset()}}),t.on(r,(function(e){var n=e||o.getAll();null==s||s.save(n),Ut(t,i.container,n,i)})),{getAll:function(){return o.getAll()},add:function(e){return t.runCommand(Dt,e)},remove:function(e){return t.runCommand(zt,e)},clear:function(){return t.runCommand(Lt)}}};return e})()));
|
|
1
|
+
/*! @silexlabs/grapesjs-notifications - 0.2.2-canary.1 */
|
|
2
|
+
!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["@silexlabs/grapesjs-notifications"]=e():t["@silexlabs/grapesjs-notifications"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})}},e={};t.r(e),t.d(e,{NOTIFICATION_ADD:()=>n,NOTIFICATION_ADDED:()=>p,NOTIFICATION_CHANGED:()=>h,NOTIFICATION_CLEAR:()=>s,NOTIFICATION_CLEARED:()=>u,NOTIFICATION_LIST:()=>o,NOTIFICATION_REMOVE:()=>i,NOTIFICATION_REMOVED:()=>d,Notification:()=>l,default:()=>Ft});var n='notifications:add',i='notifications:remove',s='notifications:clear',o='notifications:list';const r={'@silexlabs/grapesjs-notifications':{Close:'✖ Dismiss',CloseAll:'✖ Dismiss all',Select:'✓ Select component',Show:'↓ Show'}};var a=void 0&&(void 0).__assign||function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},a.apply(this,arguments)},l=function(){function t(t,e,n){var i=this;this.editor=t,this.id=null,this.componentId=null,this.group=null,this.options=this.getDefaultOptions(e),this.removeCallback=n,this.options.timeout&&(this.timeoutRef=setTimeout((function(){return i.remove()}),this.options.timeout)),this.id=e.id||null,this.message=this.options.message,this.type=this.options.type,this.componentId=e.componentId||null,this.group=e.group||null,this.model={attributes:e}}return t.prototype.select=function(){var t=this;if(this.options.componentId){var e=this.getAllComponents(this.editor).find((function(e){var n=e.component;e.page;return n.getId()===t.options.componentId}))||null;if(e){var n=e.component,i=e.page;this.editor.Pages.select(i),this.editor.select(n),this.editor.Canvas.scrollTo(n)}else console.error("Component with ID ".concat(this.options.componentId," not found")),this.editor.runCommand('notifications:add',{message:"Component with ID ".concat(this.options.componentId," not found"),type:'error'})}},t.prototype.remove=function(){this.removeCallback?this.removeCallback(this):this.editor.runCommand('notifications:remove',{notification:this}),this.timeoutRef&&clearTimeout(this.timeoutRef)},t.prototype.getSvgIcon=function(t){var e;return null===(e=this.options.icons)||void 0===e?void 0:e[t]},t.prototype.getDefaultOptions=function(t){return a({icons:a({info:"🚧",warning:"⚠",error:"🚫",success:"✅",group:"📌"},t.icons)},t)},t.prototype.getAllComponents=function(t){var e=this;return t.Pages.getAll().map((function(t){return e.getAllComponentInPage(t)})).flat()},t.prototype.getAllComponentInPage=function(t){var e=t.getMainComponent();return[{component:e,page:t}].concat(this.getAllChildrenComponent(e).map((function(e){return{component:e,page:t}})))},t.prototype.getAllChildrenComponent=function(t){var e=this,n=Array.from(t.components().models);return n.concat(n.map((function(t){return e.getAllChildrenComponent(t)})).flat())},t}(),c=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,s=0,o=e.length;s<o;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))},h='notifications:changed',p='notifications:added',d='notifications:removed',u='notifications:cleared',f=function(){function t(t,e,n){var i=this;this.editor=e,this.options=n,this.notifications=[],this.notifications=t.map((function(t){if('object'==typeof t&&t.message){return new l(i.editor,t,(function(t){return i.remove(t)}))}return t})).filter(Boolean)}return t.prototype.getAll=function(){return c([],this.notifications,!0)},t.prototype.add=function(t){var e=this;if(t.id){var n=this.notifications.find((function(e){return e.options.id===t.id}));n&&this.remove(n)}var i=new l(this.editor,t,(function(t){return e.remove(t)}));this.notifications.push(i),this.editor.trigger(p,i),this.editor.trigger(h,this.getAll())},t.prototype.remove=function(t){var e=this.notifications.findIndex((function(e){return e===t||e.model===t}));if(e>-1){var n=this.notifications.splice(e,1)[0];this.editor.trigger(d,n),this.editor.trigger(h,this.getAll())}},t.prototype.reset=function(){this.notifications=[],this.editor.trigger(u),this.editor.trigger(h,this.getAll())},t}();const g=globalThis,m=g.ShadowRoot&&(void 0===g.ShadyCSS||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,y=Symbol(),_=new WeakMap;class ${constructor(t,e,n){if(this._$cssResult$=!0,n!==y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(m&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=_.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&_.set(e,t))}return t}toString(){return this.cssText}}const v=(t,e)=>{if(m)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=g.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},A=m?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new $("string"==typeof t?t:t+"",void 0,y))(e)})(t):t,{is:b,defineProperty:w,getOwnPropertyDescriptor:E,getOwnPropertyNames:C,getOwnPropertySymbols:S,getPrototypeOf:j}=Object,x=globalThis,O=x.trustedTypes,I=O?O.emptyScript:"",T=x.reactiveElementPolyfillSupport,P=(t,e)=>t,N={toAttribute(t,e){switch(e){case Boolean:t=t?I:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},M=(t,e)=>!b(t,e),U={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:M};Symbol.metadata??=Symbol("metadata"),x.litPropertyMetadata??=new WeakMap;class R extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=U){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&w(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:s}=E(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=i?.call(this);s?.call(this,e),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??U}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=j(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const t=this.properties,e=[...C(t),...S(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(A(t))}else void 0!==t&&e.push(A(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return v(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:N).toAttribute(e,n.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=n.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:N;this._$Em=i,this[i]=s.fromAttribute(e,t.type)??this._$Ej?.get(i)??null,this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){const i=this.constructor,s=this[t];if(n??=i.getPropertyOptions(t),!((n.hasChanged??M)(s,e)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==s||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,n,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}R.elementStyles=[],R.shadowRootOptions={mode:"open"},R[P("elementProperties")]=new Map,R[P("finalized")]=new Map,T?.({ReactiveElement:R}),(x.reactiveElementVersions??=[]).push("2.1.0");const H=globalThis,k=H.trustedTypes,D=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,B="?"+L,q=`<${B}>`,F=document,K=()=>F.createComment(""),V=t=>null===t||"object"!=typeof t&&"function"!=typeof t,W=Array.isArray,J=t=>W(t)||"function"==typeof t?.[Symbol.iterator],Z="[ \t\n\f\r]",G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Q=/-->/g,X=/>/g,Y=RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,nt=/^(?:script|style|textarea|title)$/i,it=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),st=it(1),ot=(it(2),it(3),Symbol.for("lit-noChange")),rt=Symbol.for("lit-nothing"),at=new WeakMap,lt=F.createTreeWalker(F,129);function ct(t,e){if(!W(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==D?D.createHTML(e):e}const ht=(t,e)=>{const n=t.length-1,i=[];let s,o=2===e?"<svg>":3===e?"<math>":"",r=G;for(let e=0;e<n;e++){const n=t[e];let a,l,c=-1,h=0;for(;h<n.length&&(r.lastIndex=h,l=r.exec(n),null!==l);)h=r.lastIndex,r===G?"!--"===l[1]?r=Q:void 0!==l[1]?r=X:void 0!==l[2]?(nt.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=Y):void 0!==l[3]&&(r=Y):r===Y?">"===l[0]?(r=s??G,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?Y:'"'===l[3]?et:tt):r===et||r===tt?r=Y:r===Q||r===X?r=G:(r=Y,s=void 0);const p=r===Y&&t[e+1].startsWith("/>")?" ":"";o+=r===G?n+q:c>=0?(i.push(a),n.slice(0,c)+z+n.slice(c)+L+p):n+L+(-2===c?e:p)}return[ct(t,o+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class pt{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let s=0,o=0;const r=t.length-1,a=this.parts,[l,c]=ht(t,e);if(this.el=pt.createElement(l,n),lt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=lt.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(z)){const e=c[o++],n=i.getAttribute(t).split(L),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:r[2],strings:n,ctor:"."===r[1]?mt:"?"===r[1]?yt:"@"===r[1]?_t:gt}),i.removeAttribute(t)}else t.startsWith(L)&&(a.push({type:6,index:s}),i.removeAttribute(t));if(nt.test(i.tagName)){const t=i.textContent.split(L),e=t.length-1;if(e>0){i.textContent=k?k.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],K()),lt.nextNode(),a.push({type:2,index:++s});i.append(t[e],K())}}}else if(8===i.nodeType)if(i.data===B)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(L,t+1));)a.push({type:7,index:s}),t+=L.length-1}s++}}static createElement(t,e){const n=F.createElement("template");return n.innerHTML=t,n}}function dt(t,e,n=t,i){if(e===ot)return e;let s=void 0!==i?n._$Co?.[i]:n._$Cl;const o=V(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),void 0===o?s=void 0:(s=new o(t),s._$AT(t,n,i)),void 0!==i?(n._$Co??=[])[i]=s:n._$Cl=s),void 0!==s&&(e=dt(t,s._$AS(t,e.values),s,i)),e}class ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,i=(t?.creationScope??F).importNode(e,!0);lt.currentNode=i;let s=lt.nextNode(),o=0,r=0,a=n[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new ft(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new $t(s,this,t)),this._$AV.push(e),a=n[++r]}o!==a?.index&&(s=lt.nextNode(),o++)}return lt.currentNode=F,i}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=rt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=dt(this,t,e),V(t)?t===rt||null==t||""===t?(this._$AH!==rt&&this._$AR(),this._$AH=rt):t!==this._$AH&&t!==ot&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):J(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==rt&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=pt.createElement(ct(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new ut(i,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=at.get(t.strings);return void 0===e&&at.set(t.strings,e=new pt(t)),e}k(t){W(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const s of t)i===e.length?e.push(n=new ft(this.O(K()),this.O(K()),this,this.options)):n=e[i],n._$AI(s),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class gt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,s){this.type=1,this._$AH=rt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=rt}_$AI(t,e=this,n,i){const s=this.strings;let o=!1;if(void 0===s)t=dt(this,t,e,0),o=!V(t)||t!==this._$AH&&t!==ot,o&&(this._$AH=t);else{const i=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=dt(this,i[n+r],e,r),a===ot&&(a=this._$AH[r]),o||=!V(a)||a!==this._$AH[r],a===rt?t=rt:t!==rt&&(t+=(a??"")+s[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===rt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class mt extends gt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===rt?void 0:t}}class yt extends gt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==rt)}}class _t extends gt{constructor(t,e,n,i,s){super(t,e,n,i,s),this.type=5}_$AI(t,e=this){if((t=dt(this,t,e,0)??rt)===ot)return;const n=this._$AH,i=t===rt&&n!==rt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==rt&&(n===rt||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class $t{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){dt(this,t)}}const vt=H.litHtmlPolyfillSupport;vt?.(pt,ft),(H.litHtmlVersions??=[]).push("3.3.0");const At=(t,e,n)=>{const i=n?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=n?.renderBefore??null;i._$litPart$=s=new ft(e.insertBefore(K(),t),t,void 0,n??{})}return s._$AI(t),s},bt=globalThis;class wt extends R{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=At(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ot}}wt._$litElement$=!0,wt["finalized"]=!0,bt.litElementHydrateSupport?.({LitElement:wt});const Et=bt.litElementPolyfillSupport;Et?.({LitElement:wt});(bt.litElementVersions??=[]).push("4.2.0");const Ct=1,St=2,jt=t=>(...e)=>({_$litDirective$:t,values:e});class xt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Ot=jt(class extends xt{constructor(t){if(super(t),t.type!==Ct||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return ot}});class It extends xt{constructor(t){if(super(t),this.it=rt,t.type!==St)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===rt||null==t)return this._t=void 0,this.it=t;if(t===ot)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}It.directiveName="unsafeHTML",It.resultType=1;const Tt=jt(It);var Pt,Nt,Mt,Ut,Rt,Ht=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},kt=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,s=0,o=e.length;s<o;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))};function Dt(t,e,n,i){var s=kt([],n,!0);i.reverse&&s.reverse();var o=function(t){var e={},n=[];return t.forEach((function(t){t.group&&!e[t.group]?(e[t.group]=!0,n.push(t.group)):t.group||n.push(t)})),n}(s).slice(0,i.maxNotifications||s.length);At(st(Pt||(Pt=Ht(["\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ","\n </ul>\n "],["\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ","\n </ul>\n "])),o.map((function(e){return'string'==typeof e?function(t,e,n,i){return st(Mt||(Mt=Ht(["\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>📌 ","</div>\n <button @click="," class=\"gjs-btn-prim\">","</button>\n <button\n @click=","\n class=\"gjs-btn-prim\"\n >","</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "],["\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>\\u{1F4CC} ","</div>\n <button @click="," class=\"gjs-btn-prim\">","</button>\n <button\n @click=","\n class=\"gjs-btn-prim\"\n >","</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "])),n,(function(){return i.forEach((function(t){return t.remove()}))}),t.I18n.t('@silexlabs/grapesjs-notifications.CloseAll'),(function(t){return t.currentTarget.closest('details').toggleAttribute('open')}),t.I18n.t('@silexlabs/grapesjs-notifications.Show'),i.slice(0,e.maxNotifications||i.length).map((function(e){return st(Nt||(Nt=Ht(["\n ","\n "],["\n ","\n "])),zt(t,e))})))}(t,i,e,s.filter((function(t){return t.group===e}))):zt(t,e)}))),function(t){if('string'==typeof t)return document.querySelector(t);return t}(e))}function zt(t,e){return st(Rt||(Rt=Ht(["\n <li class=",">\n <header class=\"gjs-sm-header gjs-label\">\n <span>","</span>\n <span class=\"gjs-sm-header\">","</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click="," class=\"gjs-btn-prim\">","</button>\n ","\n </footer>\n </li>\n "],["\n <li class=",">\n <header class=\"gjs-sm-header gjs-label\">\n <span>","</span>\n <span class=\"gjs-sm-header\">","</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click="," class=\"gjs-btn-prim\">","</button>\n ","\n </footer>\n </li>\n "])),Ot({'gjs-sm':!0,'gjs-one-bg':!0,'gjs-two-color':!0,'gjs-notification__item':!0,'gjs-notification__info':'info'===e.type,'gjs-notification__warning':'warning'===e.type,'gjs-notification__error':'error'===e.type,'gjs-notification__success':'success'===e.type}),e.getSvgIcon(e.type),Tt(e.message),(function(){return e.remove()}),t.I18n.t('@silexlabs/grapesjs-notifications.Close'),e.componentId?st(Ut||(Ut=Ht(["\n <button @click="," class=\"gjs-btn-prim\">","</button>\n "],["\n <button @click="," class=\"gjs-btn-prim\">","</button>\n "])),(function(){return e.select()}),t.I18n.t('@silexlabs/grapesjs-notifications.Select')):'')}var Lt=function(){function t(t){this.storeKey=t}return t.prototype.getAll=function(){return this.storeKey?JSON.parse(localStorage.getItem(this.storeKey)||'[]'):[]},t.prototype.save=function(t){this.storeKey&&localStorage.setItem(this.storeKey,JSON.stringify(t.map((function(t){var e;return{message:t.message,type:t.type,componentId:t.componentId,group:t.group,timeout:null===(e=t.options)||void 0===e?void 0:e.timeout}}))))},t}(),Bt=void 0&&(void 0).__assign||function(){return Bt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Bt.apply(this,arguments)};function qt(t){if(t)return t;var e=document.createElement('ul');return e.style.position='fixed',e.style.bottom='10px',e.style.zIndex='9999',document.body.appendChild(e),e}const Ft=function(t,e){void 0===e&&(e={});var a=Bt({i18n:{},container:qt(e.container),storeKey:void 0,maxNotifications:50,reverse:!1},e);t.I18n&&t.I18n.addMessages(Bt({en:r},a.i18n));var l=a.storeKey?new Lt(a.storeKey):null,c=new f((null==l?void 0:l.getAll())||[],t,a);return t.Commands.add(n,{run:function(t,e,n){if(!(null==n?void 0:n.type))throw new Error('Required: type (one of: info, warning, error, success)');if(!(null==n?void 0:n.message))throw new Error('Required: message (notification text)');if(!['info','warning','error','success'].includes(n.type))throw new Error("Invalid type \"".concat(n.type,"\". Must be one of: info, warning, error, success"));c.add(n)}}),t.Commands.add(i,{run:function(t,e,n){var i=(null==n?void 0:n.notification)||n;c.remove(i)}}),t.Commands.add(s,{run:function(t){c.reset()}}),t.Commands.add(o,{run:function(){return c.getAll().map((function(t){return{type:t.type,message:t.message,group:t.group}}))}}),t.on(h,(function(e){var n=e||c.getAll();null==l||l.save(n),Dt(t,a.container,n,a)})),t.on('ai-capabilities:ready',(function(t){!function(t){t({id:n,command:n,description:'Show notification to user',inputSchema:{type:'object',required:['type','message'],properties:{type:{type:'string',enum:['info','warning','error','success']},message:{type:'string'},group:{type:'string'}}},tags:['notifications']}),t({id:s,command:s,description:'Clear all notifications',destructive:!0,tags:['notifications']}),t({id:o,command:o,description:'List all notifications',readOnly:!0,tags:['notifications']})}(t)})),{getAll:function(){return c.getAll()},add:function(e){return t.runCommand(n,e)},remove:function(e){return t.runCommand(i,e)},clear:function(){return t.runCommand(s)}}};return e})()));
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,qCAAuCD,IAE/CD,EAAK,qCAAuCC,GAC7C,CATD,CASyB,oBAAfK,WAA6BA,WAAgC,oBAAXC,OAAyBA,OAASC,MAAO,I,mBCRrG,IAAIC,EAAsB,CCA1BA,EAAwB,CAACP,EAAS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,aAAI,EAAJA,EAAM5B,eAAgB4B,EAC3C4T,EAAoB1W,OAAOkB,EAC7B,IAGF5B,EAAOsX,SAAS1T,IAAI4S,GAAoB,CACtCe,IAAG,SAACvX,GACFoX,EAAoB/S,OACtB,IAKFrE,EAAOyX,GAAGvU,GAAsB,SAACK,GAE/B,IAAMmU,EAAmBnU,GAAiB6T,EAAoBhV,SAE9D8U,SAAAA,EAASd,KAAKsB,GAEdC,GAAK3X,EAAQC,EAAQ+U,UAAW0C,EAAkBzX,EACpD,IAGO,CACLmC,OAAQ,WAAM,OAAAgV,EAAoBhV,QAApB,EACdwB,IAAK,SAAChC,GAAsB,OAAA5B,EAAO2B,WAAW2U,GAAkB1U,EAApC,EAC5BlB,OAAQ,SAACkB,GAAsB,OAAA5B,EAAO2B,WAAW4U,GAAqB3U,EAAvC,EAC/BgW,MAAO,WAAM,OAAA5X,EAAO2B,WAAW6U,GAAlB,EAEhB,E","sources":["webpack://@silexlabs/grapesjs-notifications/webpack/universalModuleDefinition","webpack://@silexlabs/grapesjs-notifications/webpack/bootstrap","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/define property getters","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/hasOwnProperty shorthand","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/make namespace object","webpack://@silexlabs/grapesjs-notifications/./src/locale/en.js","webpack://@silexlabs/grapesjs-notifications/./src/Notification.ts","webpack://@silexlabs/grapesjs-notifications/./src/NotificationManager.ts","webpack://@silexlabs/grapesjs-notifications/./node_modules/@lit/reactive-element/css-tag.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/@lit/reactive-element/reactive-element.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/lit-html.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-element/lit-element.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directive.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directives/class-map.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directives/unsafe-html.js","webpack://@silexlabs/grapesjs-notifications/./src/view.ts","webpack://@silexlabs/grapesjs-notifications/./src/Storage.ts","webpack://@silexlabs/grapesjs-notifications/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@silexlabs/grapesjs-notifications\"] = factory();\n\telse\n\t\troot[\"@silexlabs/grapesjs-notifications\"] = factory();\n})(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this), () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default {\n '@silexlabs/grapesjs-notifications': {\n 'Close': '\\u2716 Dismiss',\n 'CloseAll': '\\u2716 Dismiss all',\n 'Select': '\\u2713 Select component',\n 'Show': '\\u2193 Show',\n },\n};","import { Component, Page, Editor } from 'grapesjs'\n\nexport interface NotificationOptions {\n id?: string\n message: string\n group?: string\n timeout?: number\n componentId?: string\n type: 'info' | 'warning' | 'error' | 'success'\n icons: {\n info: string\n warning: string\n error: string\n success: string\n }\n}\n\nexport class Notification {\n id: string | null = null\n componentId: string | null = null\n group: string | null = null\n timeoutRef\n message: string\n type: 'info' | 'warning' | 'error' | 'success'\n options: NotificationOptions\n public model: any // For compatibility\n private removeCallback?: (notification: Notification) => void\n\n constructor(protected editor: Editor, options: NotificationOptions | any, removeCallback?: (notification: Notification) => void) {\n this.options = this.getDefaultOptions(options)\n this.removeCallback = removeCallback\n if (this.options.timeout) {\n this.timeoutRef = setTimeout(() => this.remove(), this.options.timeout)\n }\n this.id = options.id || null\n this.message = this.options.message!\n this.type = this.options.type!\n this.componentId = options.componentId || null\n this.group = options.group || null\n this.model = { attributes: options } // For compatibility with existing code\n }\n\n select() {\n if (this.options.componentId) {\n // This operation is heavy\n const found = this.getAllComponents(this.editor)\n .find(({component, page}) => component.getId() === this.options.componentId) || null\n if (found) {\n const {component, page} = found\n this.editor.Pages.select(page)\n this.editor.select(component)\n this.editor.Canvas.scrollTo(component)\n } else {\n console.error(`Component with ID ${this.options.componentId} not found`)\n this.editor.runCommand('notifications:add', {\n message: `Component with ID ${this.options.componentId} not found`,\n type: 'error',\n })\n }\n }\n }\n\n remove() {\n if (this.removeCallback) {\n this.removeCallback(this)\n } else {\n // Fallback to command if no callback provided\n this.editor.runCommand('notifications:remove', {\n notification: this\n })\n }\n this.timeoutRef && clearTimeout(this.timeoutRef)\n }\n\n getSvgIcon(type: string): string {\n return this.options.icons?.[type as keyof NotificationOptions['icons']]!\n }\n\n private getDefaultOptions(opts: Partial<NotificationOptions>): NotificationOptions {\n return {\n ...{\n icons: {\n info: '\\u{1F6A7}',\n warning: '\\u{26A0}',\n error: '\\u{1F6AB}',\n success: '\\u{2705}',\n group: '\\u{1F4CC}',\n ...opts.icons,\n },\n }, ...opts\n } as NotificationOptions\n }\n\n /**\n * Get all components in the editor\n * This is a heavy operation\n */\n private getAllComponents(editor: Editor) {\n return editor.Pages.getAll().map(page => this.getAllComponentInPage(page)).flat()\n }\n\n private getAllComponentInPage(page: Page): {component: Component, page: Page}[] {\n const body = page.getMainComponent() as Component\n return [{\n component: body,\n page,\n }].concat(\n this.getAllChildrenComponent(body)\n .map(component => ({component, page}))\n )\n }\n\n private getAllChildrenComponent(component: Component): Component[] {\n const children = Array.from(component.components().models)\n return children.concat(children.map(child => this.getAllChildrenComponent(child)).flat())\n }\n}\n","import { Editor } from \"grapesjs\"\nimport { Notification, NotificationOptions as BaseNotificationOptions } from \"./Notification\"\nimport { StyleInfo } from \"lit/directives/style-map\"\n\nexport interface NotificationOptions extends BaseNotificationOptions {\n id?: string\n}\n\n// Events\nexport const NOTIFICATION_CHANGED = 'notifications:changed'\nexport const NOTIFICATION_ADDED = 'notifications:added'\nexport const NOTIFICATION_REMOVED = 'notifications:removed'\nexport const NOTIFICATION_CLEARED = 'notifications:cleared'\n\nexport interface NotificationManagerOptions {\n style?: Readonly<StyleInfo>\n container: HTMLElement\n maxNotifications?: number\n reverse?: boolean\n timeout?: number\n storeKey?: string\n i18n?: any\n icons?: {\n info?: string\n warning?: string\n error?: string\n success?: string\n }\n}\n\n/**\n * GrapesJs plugin to manage notifications\n */\nexport class NotificationManager {\n private notifications: Notification[] = []\n\n constructor(initialNotifications: any[], protected editor: Editor, protected options: NotificationManagerOptions) {\n // Convert initial data to notification objects\n this.notifications = initialNotifications.map(data => {\n if (typeof data === 'object' && data.message) {\n const removeCallback = (notification: Notification) => this.remove(notification)\n return new Notification(this.editor, data, removeCallback)\n }\n return data\n }).filter(Boolean)\n }\n\n /**\n * Get all notifications\n */\n getAll(): Notification[] {\n return [...this.notifications]\n }\n\n /**\n * Add a notification\n */\n add(options: NotificationOptions): void {\n if (options.id) {\n // Remove any existing notification with the same id\n const existing = this.notifications.find(n => n.options.id === options.id)\n if (existing) {\n this.remove(existing)\n }\n }\n const removeCallback = (notification: Notification) => this.remove(notification)\n const notification = new Notification(this.editor, options, removeCallback)\n this.notifications.push(notification)\n this.editor.trigger(NOTIFICATION_ADDED, notification)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n\n /**\n * Remove a notification\n */\n remove(notification: Notification | any): void {\n const index = this.notifications.findIndex(n => n === notification || n.model === notification)\n if (index > -1) {\n const removed = this.notifications.splice(index, 1)[0]\n this.editor.trigger(NOTIFICATION_REMOVED, removed)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n }\n\n /**\n * Clear all notifications\n */\n reset(): void {\n this.notifications = []\n this.editor.trigger(NOTIFICATION_CLEARED)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.0\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?\"!--\"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp(\"</\"+u[2],\"g\")),c=m):void 0!==u[3]&&(c=m):c===m?\">\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:\".\"===e[1]?H:\"?\"===e[1]?I:\"@\"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l())}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1}c++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||\"\"===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const Z={M:e,P:h,A:o,C:1,L:V,R:M,D:u,V:S,I:R,H:k,N:I,U:L,B:H,F:z},j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push(\"3.3.0\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.0\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import { html, render as litRender, TemplateResult } from 'lit'\nimport { classMap } from 'lit-html/directives/class-map.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { Editor } from 'grapesjs'\nimport { Notification } from './Notification'\nimport { NotificationManagerOptions } from './NotificationManager'\n\nexport default function(editor: Editor, container: HTMLElement, notifs: Notification[], options: NotificationManagerOptions): void {\n const notifications = [...notifs]\n\n // Reverse if options.reverse is true\n if (options.reverse) {\n notifications.reverse()\n }\n \n const organizedNotifications = organizeNotifications(notifications)\n .slice(0, options.maxNotifications || notifications.length)\n\n litRender(html`\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ${\n organizedNotifications\n .map(item => typeof item === 'string' ? renderGroup(editor, options, item, notifications.filter(n => n.group === item)) : renderNotification(editor, item))\n }\n </ul>\n `, getContainer(container))\n}\n\nfunction getContainer(container: HTMLElement | string): HTMLElement {\n if (typeof container === 'string') {\n return document.querySelector(container) as HTMLElement\n }\n return container\n}\n\nfunction organizeNotifications(notifications: Notification[]): (Notification | string)[] {\n const groups: {[key: string]: boolean} = {}\n const organized: (Notification | string)[] = []\n\n notifications.forEach(notification => {\n if (notification.group && !groups[notification.group]) {\n groups[notification.group] = true\n organized.push(notification.group)\n } else if (!notification.group) {\n organized.push(notification)\n }\n })\n\n return organized\n}\n\nfunction renderGroup(editor: Editor, options: NotificationManagerOptions, groupName: string, groupedNotifications: Notification[]): TemplateResult {\n return html`\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>\\u{1F4CC} ${groupName}</div>\n <button @click=${() => groupedNotifications.forEach(notification => notification.remove())} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.CloseAll')}</button>\n <button\n @click=${(e: any) => e.currentTarget.closest('details').toggleAttribute('open')}\n class=\"gjs-btn-prim\"\n >${ editor.I18n.t('@silexlabs/grapesjs-notifications.Show') }</button>\n </summary>\n <ul>\n ${groupedNotifications\n .slice(0, options.maxNotifications || groupedNotifications.length)\n .map(notification => html`\n ${renderNotification(editor, notification)}\n `)}\n </ul>\n </details>\n </li>\n `\n}\n\nfunction renderNotification(editor: Editor, notification: Notification): TemplateResult {\n return html`\n <li class=${classMap({\n 'gjs-sm': true,\n 'gjs-one-bg': true,\n 'gjs-two-color': true,\n 'gjs-notification__item': true,\n 'gjs-notification__info': notification.type === 'info',\n 'gjs-notification__warning': notification.type === 'warning',\n 'gjs-notification__error': notification.type === 'error',\n 'gjs-notification__success': notification.type === 'success',\n })}>\n <header class=\"gjs-sm-header gjs-label\">\n <span>${notification.getSvgIcon(notification.type)}</span>\n <span class=\"gjs-sm-header\">${unsafeHTML(notification.message)}</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click=${() => notification.remove()} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.Close')}</button>\n ${notification.componentId ? html`\n <button @click=${() => notification.select()} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.Select')}</button>\n ` : ''}\n </footer>\n </li>\n `\n}\n","import { Notification } from './Notification'\n\n/**\n * @fileoverview Storage class\n * Stores the notifications in the local storage\n */\n\nexport class Storage {\n constructor(private storeKey?: string) {}\n \n getAll(): any[] {\n if(!this.storeKey) return []\n return JSON.parse(localStorage.getItem(this.storeKey) || '[]')\n }\n \n save(data: Notification[]) {\n if(!this.storeKey) return\n localStorage.setItem(this.storeKey, JSON.stringify(data.map(n => ({\n message: n.message,\n type: n.type,\n componentId: n.componentId,\n group: n.group,\n timeout: n.options?.timeout\n }))))\n }\n}\n","import { Editor } from 'grapesjs'\nimport en from './locale/en'\nimport { \n NotificationManager, \n NotificationManagerOptions,\n NOTIFICATION_CHANGED,\n NOTIFICATION_ADDED,\n NOTIFICATION_REMOVED,\n NOTIFICATION_CLEARED\n} from './NotificationManager'\nimport view from './view'\nimport { Storage } from './Storage'\n\n// Commands\nexport const NOTIFICATION_ADD = 'notifications:add'\nexport const NOTIFICATION_REMOVE = 'notifications:remove' \nexport const NOTIFICATION_CLEAR = 'notifications:clear'\n\n// Events (re-exported from NotificationManager)\nexport {\n NOTIFICATION_CHANGED,\n NOTIFICATION_ADDED,\n NOTIFICATION_REMOVED,\n NOTIFICATION_CLEARED\n}\n\n// Types\nexport type { NotificationManagerOptions } from './NotificationManager'\nexport type { NotificationOptions } from './Notification'\nexport { Notification } from './Notification'\n\n/**\n * Create a container if needed, make it sticky and append it to the body\n */\nfunction createDefaultContainer(container?: HTMLElement): HTMLElement {\n if (container) return container\n \n const el = document.createElement('ul')\n el.style.position = 'fixed'\n el.style.bottom = '10px'\n el.style.zIndex = '9999'\n document.body.appendChild(el)\n return el\n}\n\n// GrapesJS Plugin\nexport default (editor: Editor, opts: Partial<NotificationManagerOptions> = {}) => {\n const options = {\n i18n: {},\n container: createDefaultContainer(opts.container),\n storeKey: undefined,\n maxNotifications: 50,\n reverse: false,\n ...opts\n } as NotificationManagerOptions\n\n // Load i18n files\n editor.I18n && editor.I18n.addMessages({\n en,\n ...options.i18n,\n })\n\n // Create storage if needed\n const storage = options.storeKey ? new Storage(options.storeKey) : null\n\n // Create notification manager\n const notificationManager = new NotificationManager(storage?.getAll() || [], editor, options)\n\n // Add commands\n editor.Commands.add(NOTIFICATION_ADD, {\n run(editor: Editor, sender: any, options: any) {\n notificationManager.add(options)\n }\n })\n\n editor.Commands.add(NOTIFICATION_REMOVE, {\n run(editor: Editor, sender: any, data: any) {\n const notification = data?.notification || data\n notificationManager.remove(notification)\n }\n })\n\n editor.Commands.add(NOTIFICATION_CLEAR, {\n run(editor: Editor) {\n notificationManager.reset()\n }\n })\n\n\n // Handle notification changes\n editor.on(NOTIFICATION_CHANGED, (notifications) => {\n // Use the passed notifications array or get all as fallback\n const allNotifications = notifications || notificationManager.getAll()\n // Update storage\n storage?.save(allNotifications)\n // Render notifications\n view(editor, options.container, allNotifications, options)\n })\n\n // Public API accessible via commands and events only\n return {\n getAll: () => notificationManager.getAll(),\n add: (notification: any) => editor.runCommand(NOTIFICATION_ADD, notification),\n remove: (notification: any) => editor.runCommand(NOTIFICATION_REMOVE, notification),\n clear: () => editor.runCommand(NOTIFICATION_CLEAR)\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","window","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","editor","options","removeCallback","id","componentId","group","getDefaultOptions","timeout","timeoutRef","setTimeout","remove","message","type","model","attributes","select","found","getAllComponents","find","component","getId","page","Pages","Canvas","scrollTo","console","error","runCommand","notification","clearTimeout","getSvgIcon","icons","opts","info","warning","success","getAll","map","getAllComponentInPage","flat","body","getMainComponent","concat","getAllChildrenComponent","children","Array","from","components","models","child","NOTIFICATION_CHANGED","NOTIFICATION_ADDED","NOTIFICATION_REMOVED","NOTIFICATION_CLEARED","initialNotifications","notifications","data","Notification","filter","Boolean","add","existing","n","push","trigger","index","findIndex","removed","splice","reset","t","e","ShadowRoot","ShadyCSS","nativeShadow","Document","CSSStyleSheet","s","WeakMap","constructor","_$cssResult$","Error","cssText","styleSheet","length","replaceSync","set","toString","S","adoptedStyleSheets","document","createElement","litNonce","setAttribute","textContent","appendChild","c","cssRules","r","is","getOwnPropertyDescriptor","h","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","JSON","stringify","fromAttribute","i","Number","parse","f","b","attribute","String","converter","reflect","useDefault","hasChanged","metadata","litPropertyMetadata","y","HTMLElement","addInitializer","_$Ei","observedAttributes","finalize","_$Eh","keys","createProperty","state","create","wrapped","elementProperties","noAccessor","getPropertyDescriptor","requestUpdate","configurable","getPropertyOptions","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$ET","removeAttribute","_$Ej","hasAttribute","C","_$EP","has","_$Eq","reject","scheduleUpdate","performUpdate","shouldUpdate","willUpdate","hostUpdate","update","_$EM","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","toFixed","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","T","for","E","A","createTreeWalker","P","V","lastIndex","exec","test","startsWith","N","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","name","ctor","H","I","L","k","tagName","append","indexOf","innerHTML","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","M","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","_$AP","setConnected","element","fill","j","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","litHtmlPolyfillSupport","litHtmlVersions","B","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions","_$Ct","_$Ci","join","st","nt","classList","it","directiveName","_t","raw","resultType","container","notifs","organizedNotifications","groups","organized","organizeNotifications","maxNotifications","item","groupName","groupedNotifications","I18n","currentTarget","closest","renderNotification","renderGroup","querySelector","getContainer","storeKey","localStorage","getItem","save","setItem","NOTIFICATION_ADD","NOTIFICATION_REMOVE","NOTIFICATION_CLEAR","createDefaultContainer","style","position","bottom","zIndex","i18n","undefined","addMessages","en","storage","Storage","notificationManager","NotificationManager","Commands","run","sender","on","allNotifications","view","clear"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,qCAAuCD,IAE/CD,EAAK,qCAAuCC,GAC7C,CATD,CASyB,oBAAfK,WAA6BA,WAAgC,oBAAXC,OAAyBA,OAASC,MAAO,I,mBCRrG,IAAIC,EAAsB,CCA1BA,EAAwB,CAACP,EAASQ,KACjC,IAAI,IAAIC,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T,EACvB,IAGO,CACLtV,OAAQ,WAAM,OAAA6U,EAAoB7U,QAApB,EACdwB,IAAK,SAAChC,GAAsB,OAAA5B,EAAO2B,WAAW/B,EAAkBgC,EAApC,EAC5BlB,OAAQ,SAACkB,GAAsB,OAAA5B,EAAO2B,WAAW9B,EAAqB+B,EAAvC,EAC/BwW,MAAO,WAAM,OAAApY,EAAO2B,WAAW7B,EAAlB,EAEhB,E","sources":["webpack://@silexlabs/grapesjs-notifications/webpack/universalModuleDefinition","webpack://@silexlabs/grapesjs-notifications/webpack/bootstrap","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/define property getters","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/hasOwnProperty shorthand","webpack://@silexlabs/grapesjs-notifications/webpack/runtime/make namespace object","webpack://@silexlabs/grapesjs-notifications/./src/commands.ts","webpack://@silexlabs/grapesjs-notifications/./src/locale/en.js","webpack://@silexlabs/grapesjs-notifications/./src/Notification.ts","webpack://@silexlabs/grapesjs-notifications/./src/NotificationManager.ts","webpack://@silexlabs/grapesjs-notifications/./node_modules/@lit/reactive-element/css-tag.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/@lit/reactive-element/reactive-element.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/lit-html.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-element/lit-element.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directive.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directives/class-map.js","webpack://@silexlabs/grapesjs-notifications/./node_modules/lit-html/directives/unsafe-html.js","webpack://@silexlabs/grapesjs-notifications/./src/view.ts","webpack://@silexlabs/grapesjs-notifications/./src/Storage.ts","webpack://@silexlabs/grapesjs-notifications/./src/index.ts","webpack://@silexlabs/grapesjs-notifications/./src/capabilities.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@silexlabs/grapesjs-notifications\"] = factory();\n\telse\n\t\troot[\"@silexlabs/grapesjs-notifications\"] = factory();\n})(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this), () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// Command IDs for notifications\nexport const NOTIFICATION_ADD = 'notifications:add'\nexport const NOTIFICATION_REMOVE = 'notifications:remove'\nexport const NOTIFICATION_CLEAR = 'notifications:clear'\nexport const NOTIFICATION_LIST = 'notifications:list'\n","export default {\n '@silexlabs/grapesjs-notifications': {\n 'Close': '\\u2716 Dismiss',\n 'CloseAll': '\\u2716 Dismiss all',\n 'Select': '\\u2713 Select component',\n 'Show': '\\u2193 Show',\n },\n};","import { Component, Page, Editor } from 'grapesjs'\n\nexport interface NotificationOptions {\n id?: string\n message: string\n group?: string\n timeout?: number\n componentId?: string\n type: 'info' | 'warning' | 'error' | 'success'\n icons: {\n info: string\n warning: string\n error: string\n success: string\n }\n}\n\nexport class Notification {\n id: string | null = null\n componentId: string | null = null\n group: string | null = null\n timeoutRef\n message: string\n type: 'info' | 'warning' | 'error' | 'success'\n options: NotificationOptions\n public model: any // For compatibility\n private removeCallback?: (notification: Notification) => void\n\n constructor(protected editor: Editor, options: NotificationOptions | any, removeCallback?: (notification: Notification) => void) {\n this.options = this.getDefaultOptions(options)\n this.removeCallback = removeCallback\n if (this.options.timeout) {\n this.timeoutRef = setTimeout(() => this.remove(), this.options.timeout)\n }\n this.id = options.id || null\n this.message = this.options.message!\n this.type = this.options.type!\n this.componentId = options.componentId || null\n this.group = options.group || null\n this.model = { attributes: options } // For compatibility with existing code\n }\n\n select() {\n if (this.options.componentId) {\n // This operation is heavy\n const found = this.getAllComponents(this.editor)\n .find(({component, page}) => component.getId() === this.options.componentId) || null\n if (found) {\n const {component, page} = found\n this.editor.Pages.select(page)\n this.editor.select(component)\n this.editor.Canvas.scrollTo(component)\n } else {\n console.error(`Component with ID ${this.options.componentId} not found`)\n this.editor.runCommand('notifications:add', {\n message: `Component with ID ${this.options.componentId} not found`,\n type: 'error',\n })\n }\n }\n }\n\n remove() {\n if (this.removeCallback) {\n this.removeCallback(this)\n } else {\n // Fallback to command if no callback provided\n this.editor.runCommand('notifications:remove', {\n notification: this\n })\n }\n this.timeoutRef && clearTimeout(this.timeoutRef)\n }\n\n getSvgIcon(type: string): string {\n return this.options.icons?.[type as keyof NotificationOptions['icons']]!\n }\n\n private getDefaultOptions(opts: Partial<NotificationOptions>): NotificationOptions {\n return {\n ...{\n icons: {\n info: '\\u{1F6A7}',\n warning: '\\u{26A0}',\n error: '\\u{1F6AB}',\n success: '\\u{2705}',\n group: '\\u{1F4CC}',\n ...opts.icons,\n },\n }, ...opts\n } as NotificationOptions\n }\n\n /**\n * Get all components in the editor\n * This is a heavy operation\n */\n private getAllComponents(editor: Editor) {\n return editor.Pages.getAll().map(page => this.getAllComponentInPage(page)).flat()\n }\n\n private getAllComponentInPage(page: Page): {component: Component, page: Page}[] {\n const body = page.getMainComponent() as Component\n return [{\n component: body,\n page,\n }].concat(\n this.getAllChildrenComponent(body)\n .map(component => ({component, page}))\n )\n }\n\n private getAllChildrenComponent(component: Component): Component[] {\n const children = Array.from(component.components().models)\n return children.concat(children.map(child => this.getAllChildrenComponent(child)).flat())\n }\n}\n","import { Editor } from \"grapesjs\"\nimport { Notification, NotificationOptions as BaseNotificationOptions } from \"./Notification\"\nimport { StyleInfo } from \"lit/directives/style-map\"\n\nexport interface NotificationOptions extends BaseNotificationOptions {\n id?: string\n}\n\n// Events\nexport const NOTIFICATION_CHANGED = 'notifications:changed'\nexport const NOTIFICATION_ADDED = 'notifications:added'\nexport const NOTIFICATION_REMOVED = 'notifications:removed'\nexport const NOTIFICATION_CLEARED = 'notifications:cleared'\n\nexport interface NotificationManagerOptions {\n style?: Readonly<StyleInfo>\n container: HTMLElement\n maxNotifications?: number\n reverse?: boolean\n timeout?: number\n storeKey?: string\n i18n?: any\n icons?: {\n info?: string\n warning?: string\n error?: string\n success?: string\n }\n}\n\n/**\n * GrapesJs plugin to manage notifications\n */\nexport class NotificationManager {\n private notifications: Notification[] = []\n\n constructor(initialNotifications: any[], protected editor: Editor, protected options: NotificationManagerOptions) {\n // Convert initial data to notification objects\n this.notifications = initialNotifications.map(data => {\n if (typeof data === 'object' && data.message) {\n const removeCallback = (notification: Notification) => this.remove(notification)\n return new Notification(this.editor, data, removeCallback)\n }\n return data\n }).filter(Boolean)\n }\n\n /**\n * Get all notifications\n */\n getAll(): Notification[] {\n return [...this.notifications]\n }\n\n /**\n * Add a notification\n */\n add(options: NotificationOptions): void {\n if (options.id) {\n // Remove any existing notification with the same id\n const existing = this.notifications.find(n => n.options.id === options.id)\n if (existing) {\n this.remove(existing)\n }\n }\n const removeCallback = (notification: Notification) => this.remove(notification)\n const notification = new Notification(this.editor, options, removeCallback)\n this.notifications.push(notification)\n this.editor.trigger(NOTIFICATION_ADDED, notification)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n\n /**\n * Remove a notification\n */\n remove(notification: Notification | any): void {\n const index = this.notifications.findIndex(n => n === notification || n.model === notification)\n if (index > -1) {\n const removed = this.notifications.splice(index, 1)[0]\n this.editor.trigger(NOTIFICATION_REMOVED, removed)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n }\n\n /**\n * Clear all notifications\n */\n reset(): void {\n this.notifications = []\n this.editor.trigger(NOTIFICATION_CLEARED)\n this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.0\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?\"!--\"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp(\"</\"+u[2],\"g\")),c=m):void 0!==u[3]&&(c=m):c===m?\">\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:\".\"===e[1]?H:\"?\"===e[1]?I:\"@\"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l())}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1}c++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||\"\"===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const Z={M:e,P:h,A:o,C:1,L:V,R:M,D:u,V:S,I:R,H:k,N:I,U:L,B:H,F:z},j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push(\"3.3.0\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.0\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import { html, render as litRender, TemplateResult } from 'lit'\nimport { classMap } from 'lit-html/directives/class-map.js'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { Editor } from 'grapesjs'\nimport { Notification } from './Notification'\nimport { NotificationManagerOptions } from './NotificationManager'\n\nexport default function(editor: Editor, container: HTMLElement, notifs: Notification[], options: NotificationManagerOptions): void {\n const notifications = [...notifs]\n\n // Reverse if options.reverse is true\n if (options.reverse) {\n notifications.reverse()\n }\n \n const organizedNotifications = organizeNotifications(notifications)\n .slice(0, options.maxNotifications || notifications.length)\n\n litRender(html`\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class=\"gjs-notification\">\n ${\n organizedNotifications\n .map(item => typeof item === 'string' ? renderGroup(editor, options, item, notifications.filter(n => n.group === item)) : renderNotification(editor, item))\n }\n </ul>\n `, getContainer(container))\n}\n\nfunction getContainer(container: HTMLElement | string): HTMLElement {\n if (typeof container === 'string') {\n return document.querySelector(container) as HTMLElement\n }\n return container\n}\n\nfunction organizeNotifications(notifications: Notification[]): (Notification | string)[] {\n const groups: {[key: string]: boolean} = {}\n const organized: (Notification | string)[] = []\n\n notifications.forEach(notification => {\n if (notification.group && !groups[notification.group]) {\n groups[notification.group] = true\n organized.push(notification.group)\n } else if (!notification.group) {\n organized.push(notification)\n }\n })\n\n return organized\n}\n\nfunction renderGroup(editor: Editor, options: NotificationManagerOptions, groupName: string, groupedNotifications: Notification[]): TemplateResult {\n return html`\n <li class=\"gjs-sm gjs-one-bg gjs-two-color gjs-notification__group\">\n <details class=\"gjs-sm gjs-one-bg gjs-two-color\">\n <summary class=\"gjs-sm-header gjs-label\">\n <div>\\u{1F4CC} ${groupName}</div>\n <button @click=${() => groupedNotifications.forEach(notification => notification.remove())} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.CloseAll')}</button>\n <button\n @click=${(e: any) => e.currentTarget.closest('details').toggleAttribute('open')}\n class=\"gjs-btn-prim\"\n >${ editor.I18n.t('@silexlabs/grapesjs-notifications.Show') }</button>\n </summary>\n <ul>\n ${groupedNotifications\n .slice(0, options.maxNotifications || groupedNotifications.length)\n .map(notification => html`\n ${renderNotification(editor, notification)}\n `)}\n </ul>\n </details>\n </li>\n `\n}\n\nfunction renderNotification(editor: Editor, notification: Notification): TemplateResult {\n return html`\n <li class=${classMap({\n 'gjs-sm': true,\n 'gjs-one-bg': true,\n 'gjs-two-color': true,\n 'gjs-notification__item': true,\n 'gjs-notification__info': notification.type === 'info',\n 'gjs-notification__warning': notification.type === 'warning',\n 'gjs-notification__error': notification.type === 'error',\n 'gjs-notification__success': notification.type === 'success',\n })}>\n <header class=\"gjs-sm-header gjs-label\">\n <span>${notification.getSvgIcon(notification.type)}</span>\n <span class=\"gjs-sm-header\">${unsafeHTML(notification.message)}</span>\n </header>\n <footer class=\"gjs-sm-footer\">\n <button @click=${() => notification.remove()} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.Close')}</button>\n ${notification.componentId ? html`\n <button @click=${() => notification.select()} class=\"gjs-btn-prim\">${editor.I18n.t('@silexlabs/grapesjs-notifications.Select')}</button>\n ` : ''}\n </footer>\n </li>\n `\n}\n","import { Notification } from './Notification'\n\n/**\n * @fileoverview Storage class\n * Stores the notifications in the local storage\n */\n\nexport class Storage {\n constructor(private storeKey?: string) {}\n \n getAll(): any[] {\n if(!this.storeKey) return []\n return JSON.parse(localStorage.getItem(this.storeKey) || '[]')\n }\n \n save(data: Notification[]) {\n if(!this.storeKey) return\n localStorage.setItem(this.storeKey, JSON.stringify(data.map(n => ({\n message: n.message,\n type: n.type,\n componentId: n.componentId,\n group: n.group,\n timeout: n.options?.timeout\n }))))\n }\n}\n","import { Editor } from 'grapesjs'\nimport { registerCapabilities } from './capabilities'\nimport en from './locale/en'\nimport {\n NotificationManager,\n NotificationManagerOptions,\n NOTIFICATION_CHANGED,\n NOTIFICATION_ADDED,\n NOTIFICATION_REMOVED,\n NOTIFICATION_CLEARED\n} from './NotificationManager'\nimport view from './view'\nimport { Storage } from './Storage'\nimport { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'\n\n// Re-export command IDs\nexport { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'\n\n// Events (re-exported from NotificationManager)\nexport {\n NOTIFICATION_CHANGED,\n NOTIFICATION_ADDED,\n NOTIFICATION_REMOVED,\n NOTIFICATION_CLEARED\n}\n\n// Types\nexport type { NotificationManagerOptions } from './NotificationManager'\nexport type { NotificationOptions } from './Notification'\nexport { Notification } from './Notification'\n\n/**\n * Create a container if needed, make it sticky and append it to the body\n */\nfunction createDefaultContainer(container?: HTMLElement): HTMLElement {\n if (container) return container\n \n const el = document.createElement('ul')\n el.style.position = 'fixed'\n el.style.bottom = '10px'\n el.style.zIndex = '9999'\n document.body.appendChild(el)\n return el\n}\n\n// GrapesJS Plugin\nexport default (editor: Editor, opts: Partial<NotificationManagerOptions> = {}) => {\n const options = {\n i18n: {},\n container: createDefaultContainer(opts.container),\n storeKey: undefined,\n maxNotifications: 50,\n reverse: false,\n ...opts\n } as NotificationManagerOptions\n\n // Load i18n files\n editor.I18n && editor.I18n.addMessages({\n en,\n ...options.i18n,\n })\n\n // Create storage if needed\n const storage = options.storeKey ? new Storage(options.storeKey) : null\n\n // Create notification manager\n const notificationManager = new NotificationManager(storage?.getAll() || [], editor, options)\n\n // Add commands\n editor.Commands.add(NOTIFICATION_ADD, {\n run(editor: Editor, sender: any, options: any) {\n if (!options?.type) throw new Error('Required: type (one of: info, warning, error, success)')\n if (!options?.message) throw new Error('Required: message (notification text)')\n if (!['info', 'warning', 'error', 'success'].includes(options.type)) {\n throw new Error(`Invalid type \"${options.type}\". Must be one of: info, warning, error, success`)\n }\n notificationManager.add(options)\n }\n })\n\n editor.Commands.add(NOTIFICATION_REMOVE, {\n run(editor: Editor, sender: any, data: any) {\n const notification = data?.notification || data\n notificationManager.remove(notification)\n }\n })\n\n editor.Commands.add(NOTIFICATION_CLEAR, {\n run(editor: Editor) {\n notificationManager.reset()\n }\n })\n\n editor.Commands.add(NOTIFICATION_LIST, {\n run() {\n return notificationManager.getAll().map(n => ({\n type: n.type,\n message: n.message,\n group: n.group,\n }))\n }\n })\n\n // Handle notification changes\n editor.on(NOTIFICATION_CHANGED, (notifications) => {\n // Use the passed notifications array or get all as fallback\n const allNotifications = notifications || notificationManager.getAll()\n // Update storage\n storage?.save(allNotifications)\n // Render notifications\n view(editor, options.container, allNotifications, options)\n })\n\n // Register AI capabilities if grapesjs-ai-capabilities is loaded\n editor.on('ai-capabilities:ready', (addCapability: (def: Record<string, unknown>) => void) => {\n registerCapabilities(addCapability)\n })\n\n // Public API accessible via commands and events only\n return {\n getAll: () => notificationManager.getAll(),\n add: (notification: any) => editor.runCommand(NOTIFICATION_ADD, notification),\n remove: (notification: any) => editor.runCommand(NOTIFICATION_REMOVE, notification),\n clear: () => editor.runCommand(NOTIFICATION_CLEAR)\n }\n}\n","import { NOTIFICATION_ADD, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'\n\nexport function registerCapabilities(addCapability: (def: Record<string, unknown>) => void) {\n addCapability({\n id: NOTIFICATION_ADD,\n command: NOTIFICATION_ADD,\n description: 'Show notification to user',\n inputSchema: {\n type: 'object',\n required: ['type', 'message'],\n properties: {\n type: { type: 'string', enum: ['info', 'warning', 'error', 'success'] },\n message: { type: 'string' },\n group: { type: 'string' },\n },\n },\n tags: ['notifications'],\n })\n addCapability({\n id: NOTIFICATION_CLEAR,\n command: NOTIFICATION_CLEAR,\n description: 'Clear all notifications',\n destructive: true,\n tags: ['notifications'],\n })\n addCapability({\n id: NOTIFICATION_LIST,\n command: NOTIFICATION_LIST,\n description: 'List all notifications',\n readOnly: true,\n tags: ['notifications'],\n })\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","window","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","NOTIFICATION_ADD","NOTIFICATION_REMOVE","NOTIFICATION_CLEAR","NOTIFICATION_LIST","editor","options","removeCallback","id","componentId","group","getDefaultOptions","timeout","timeoutRef","setTimeout","remove","message","type","model","attributes","select","found","getAllComponents","find","component","getId","page","Pages","Canvas","scrollTo","console","error","runCommand","notification","clearTimeout","getSvgIcon","icons","opts","info","warning","success","getAll","map","getAllComponentInPage","flat","body","getMainComponent","concat","getAllChildrenComponent","children","Array","from","components","models","child","NOTIFICATION_CHANGED","NOTIFICATION_ADDED","NOTIFICATION_REMOVED","NOTIFICATION_CLEARED","initialNotifications","notifications","data","Notification","filter","Boolean","add","existing","n","push","trigger","index","findIndex","removed","splice","reset","t","e","ShadowRoot","ShadyCSS","nativeShadow","Document","CSSStyleSheet","s","WeakMap","constructor","_$cssResult$","Error","cssText","styleSheet","length","replaceSync","set","toString","S","adoptedStyleSheets","document","createElement","litNonce","setAttribute","textContent","appendChild","c","cssRules","r","is","getOwnPropertyDescriptor","h","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","d","u","toAttribute","JSON","stringify","fromAttribute","i","Number","parse","f","b","attribute","String","converter","reflect","useDefault","hasChanged","metadata","litPropertyMetadata","y","HTMLElement","addInitializer","_$Ei","observedAttributes","finalize","_$Eh","keys","createProperty","state","create","wrapped","elementProperties","noAccessor","getPropertyDescriptor","requestUpdate","configurable","getPropertyOptions","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$ET","removeAttribute","_$Ej","hasAttribute","C","_$EP","has","_$Eq","reject","scheduleUpdate","performUpdate","shouldUpdate","willUpdate","hostUpdate","update","_$EM","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","toFixed","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","T","for","E","A","createTreeWalker","P","V","lastIndex","exec","test","startsWith","N","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","name","ctor","H","I","L","k","tagName","append","indexOf","innerHTML","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","M","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","_$AP","setConnected","element","fill","j","arguments","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","litHtmlPolyfillSupport","litHtmlVersions","B","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions","_$Ct","_$Ci","join","st","nt","classList","it","directiveName","_t","raw","resultType","container","notifs","organizedNotifications","groups","organized","organizeNotifications","maxNotifications","item","groupName","groupedNotifications","I18n","currentTarget","closest","renderNotification","renderGroup","querySelector","getContainer","storeKey","localStorage","getItem","save","setItem","createDefaultContainer","style","position","bottom","zIndex","i18n","undefined","addMessages","en","storage","Storage","notificationManager","NotificationManager","Commands","run","sender","includes","on","allNotifications","view","addCapability","command","description","inputSchema","required","enum","tags","destructive","readOnly","registerCapabilities","clear"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexlabs/grapesjs-notifications",
|
|
3
|
-
"version": "0.2.1",
|
|
3
|
+
"version": "0.2.2-canary.1",
|
|
4
4
|
"description": "This GrapesJs plugin is designed to enhance the user experience within the editor by providing a robust notification system. This plugin captures and displays various types of notifications including errors, warnings, and activities, thereby facilitating a more interactive and responsive interface.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NOTIFICATION_ADD, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
2
|
+
|
|
3
|
+
export function registerCapabilities(addCapability: (def: Record<string, unknown>) => void) {
|
|
4
|
+
addCapability({
|
|
5
|
+
id: NOTIFICATION_ADD,
|
|
6
|
+
command: NOTIFICATION_ADD,
|
|
7
|
+
description: 'Show notification to user',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
required: ['type', 'message'],
|
|
11
|
+
properties: {
|
|
12
|
+
type: { type: 'string', enum: ['info', 'warning', 'error', 'success'] },
|
|
13
|
+
message: { type: 'string' },
|
|
14
|
+
group: { type: 'string' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['notifications'],
|
|
18
|
+
})
|
|
19
|
+
addCapability({
|
|
20
|
+
id: NOTIFICATION_CLEAR,
|
|
21
|
+
command: NOTIFICATION_CLEAR,
|
|
22
|
+
description: 'Clear all notifications',
|
|
23
|
+
destructive: true,
|
|
24
|
+
tags: ['notifications'],
|
|
25
|
+
})
|
|
26
|
+
addCapability({
|
|
27
|
+
id: NOTIFICATION_LIST,
|
|
28
|
+
command: NOTIFICATION_LIST,
|
|
29
|
+
description: 'List all notifications',
|
|
30
|
+
readOnly: true,
|
|
31
|
+
tags: ['notifications'],
|
|
32
|
+
})
|
|
33
|
+
}
|
package/src/commands.ts
ADDED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Editor } from 'grapesjs'
|
|
2
|
+
import { registerCapabilities } from './capabilities'
|
|
2
3
|
import en from './locale/en'
|
|
3
|
-
import {
|
|
4
|
-
NotificationManager,
|
|
4
|
+
import {
|
|
5
|
+
NotificationManager,
|
|
5
6
|
NotificationManagerOptions,
|
|
6
7
|
NOTIFICATION_CHANGED,
|
|
7
8
|
NOTIFICATION_ADDED,
|
|
@@ -10,11 +11,10 @@ import {
|
|
|
10
11
|
} from './NotificationManager'
|
|
11
12
|
import view from './view'
|
|
12
13
|
import { Storage } from './Storage'
|
|
14
|
+
import { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
13
15
|
|
|
14
|
-
//
|
|
15
|
-
export
|
|
16
|
-
export const NOTIFICATION_REMOVE = 'notifications:remove'
|
|
17
|
-
export const NOTIFICATION_CLEAR = 'notifications:clear'
|
|
16
|
+
// Re-export command IDs
|
|
17
|
+
export { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
18
18
|
|
|
19
19
|
// Events (re-exported from NotificationManager)
|
|
20
20
|
export {
|
|
@@ -69,6 +69,11 @@ export default (editor: Editor, opts: Partial<NotificationManagerOptions> = {})
|
|
|
69
69
|
// Add commands
|
|
70
70
|
editor.Commands.add(NOTIFICATION_ADD, {
|
|
71
71
|
run(editor: Editor, sender: any, options: any) {
|
|
72
|
+
if (!options?.type) throw new Error('Required: type (one of: info, warning, error, success)')
|
|
73
|
+
if (!options?.message) throw new Error('Required: message (notification text)')
|
|
74
|
+
if (!['info', 'warning', 'error', 'success'].includes(options.type)) {
|
|
75
|
+
throw new Error(`Invalid type "${options.type}". Must be one of: info, warning, error, success`)
|
|
76
|
+
}
|
|
72
77
|
notificationManager.add(options)
|
|
73
78
|
}
|
|
74
79
|
})
|
|
@@ -86,6 +91,15 @@ export default (editor: Editor, opts: Partial<NotificationManagerOptions> = {})
|
|
|
86
91
|
}
|
|
87
92
|
})
|
|
88
93
|
|
|
94
|
+
editor.Commands.add(NOTIFICATION_LIST, {
|
|
95
|
+
run() {
|
|
96
|
+
return notificationManager.getAll().map(n => ({
|
|
97
|
+
type: n.type,
|
|
98
|
+
message: n.message,
|
|
99
|
+
group: n.group,
|
|
100
|
+
}))
|
|
101
|
+
}
|
|
102
|
+
})
|
|
89
103
|
|
|
90
104
|
// Handle notification changes
|
|
91
105
|
editor.on(NOTIFICATION_CHANGED, (notifications) => {
|
|
@@ -97,6 +111,11 @@ export default (editor: Editor, opts: Partial<NotificationManagerOptions> = {})
|
|
|
97
111
|
view(editor, options.container, allNotifications, options)
|
|
98
112
|
})
|
|
99
113
|
|
|
114
|
+
// Register AI capabilities if grapesjs-ai-capabilities is loaded
|
|
115
|
+
editor.on('ai-capabilities:ready', (addCapability: (def: Record<string, unknown>) => void) => {
|
|
116
|
+
registerCapabilities(addCapability)
|
|
117
|
+
})
|
|
118
|
+
|
|
100
119
|
// Public API accessible via commands and events only
|
|
101
120
|
return {
|
|
102
121
|
getAll: () => notificationManager.getAll(),
|