brome-builder 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -4013,7 +4013,7 @@ function mn({ setEditorData: q, editorData: X, isEditorShouldLoad: K, setIsEdito
4013
4013
  q({ html: p, css: w });
4014
4014
  }), s.on("component:remove", () => {
4015
4015
  const p = s.getHtml(), w = s.getCss();
4016
- q({ html: p, css: w });
4016
+ console.log("removed : ", p), q({ html: p, css: w });
4017
4017
  }), () => {
4018
4018
  s.destroy();
4019
4019
  };
@@ -1267,7 +1267,7 @@ React keys must be passed directly to JSX without using spread:
1267
1267
  adipiscing elit, sed do eiusmod tempor incididunt ut
1268
1268
  labore et dolore magna aliquased do eiusmod tempor incididunt
1269
1269
  ut labore et dolore magna aliquased do eiusmod tempor
1270
- incididunt ut labore et dolore magna aliqua</p>`,attributes:{class:"fa fa-regular fa-file-lines"}},Link:{label:"Lien",category:"Basic",content:"<a>Link here</a>",media:Qt},"Hero Over Content Image":{label:"Hero",category:"Composants",content:ht,media:'<img width="100%" src="'+wt+'"/>'},"Blue Card":{label:"Blue Card",category:"Composants",content:bt,media:'<img width="100%" src="'+xt+'"/>'},"ordered-card":{label:"Ordered Card",category:"Composants",content:()=>At(Ft++),media:'<img width="100%" src="'+It+'"/>'},"Réduction Card":{label:"Réduction Card",category:"Composants",content:kt,media:'<img width="100%" src="'+We+'"/>'},"Attention Card":{label:"Attention Card",category:"Composants",content:yt,media:'<img width="100%" src="'+Ye+'"/>'},"Bon à savoir Card":{label:"Bon à savoir Card",category:"Composants",content:Ct,media:'<img width="100%" src="'+Ne+'"/>'},"Définition Card":{label:"Définition Card",category:"Composants",content:Et,media:'<img width="100%" src="'+Ue+'"/>'}};function Ht({setEditorData:q,editorData:X,isEditorShouldLoad:K,setIsEditorShouldLoad:V}){const[d,J]=se.useState(null),[n,o]=se.useState(!1);se.useEffect(()=>{const s=pt.init({i18n:{locale:"fr",detectLocale:!1,localeFallback:"en",messages:{fr:Xe}},container:"#editor",height:"100vh",plugins:[$e,tt,Rt,Mt,Zt,Ot,ft],pluginsOpts:{[$e]:{blocks:["text-basic"]},[tt]:{blocks:["column1","column2","column3","column3-7","image","video"],labelColumn1:"1 Colonne",labelColumn2:"2 Colonnes",labelColumn3:"3 Colonnes",labelColumn3_7:"3/7 Colonnes",labelColumn4:"4 Colonnes",labelImage:"Image",labelVideo:"Vidéo"},gjsTabs:{},gtsIcons:{}},canvas:{styles:["/src/styles/tabs.css","/src/styles/tailwind.css","/src/styles/tailwind-build.css"]},storageManager:!1});return Vt(s),J(s),s.getWrapper().addClass("gjs-wrapper"),s.on("component:update",()=>{const p=s.getHtml(),w=s.getCss();q({html:p,css:w})}),s.on("component:remove",()=>{const p=s.getHtml(),w=s.getCss();q({html:p,css:w})}),()=>{s.destroy()}},[]),se.useEffect(()=>{d&&X&&K&&(d.setComponents(X.html),d.setStyle(X.css),V(!1))},[d,X,K]),se.useEffect(()=>{if(d){d.Css.setRule(".gjs-wrapper",{direction:n?"rtl":"ltr"});const s=document.querySelector(".gjs-frame");if(s&&s.contentWindow&&s.contentWindow.document){const p=s.contentWindow.document.body;p.classList.toggle("rtl",n),p.classList.toggle("ltr",!n),p.setAttribute("dir",`${n?"rtl":"ltr"}`)}}},[d,n]);const a=()=>{o(s=>!s)};return se.useEffect(()=>{if(d){Object.entries(Kt).forEach(([g,B])=>{d.BlockManager.add(g,B)});const s=d.BlockManager.get("image");s&&s.set("category","Media");const p=d.BlockManager.get("video");p&&p.set("category","Media");const w=d.BlockManager.get("materialIcon");w&&w.set("category","Media");const I=d.BlockManager.get("column1");I&&I.set("category","Architecture");const z=d.BlockManager.get("column2");z&&z.set("category","Architecture");const m=d.BlockManager.get("column3");m&&m.set("category","Architecture");const S=d.BlockManager.get("column3-7");S&&S.set("category","Architecture");const E=d.BlockManager.get("tabs");E&&(E.set("category","Composants"),E.set("media",'<img width="100%" src="'+St+'"/>')),d.on("block:add",g=>{const B=d.getHtml(),v=d.getCss();q({html:B,css:v})}),d.on("component:add",g=>{const B=d.getHtml(),v=d.getCss();q({html:B,css:v})}),window.editorInstance=d;const A=document.querySelector(".gjs-pn-panel");if(A){A.innerHTML=`
1270
+ incididunt ut labore et dolore magna aliqua</p>`,attributes:{class:"fa fa-regular fa-file-lines"}},Link:{label:"Lien",category:"Basic",content:"<a>Link here</a>",media:Qt},"Hero Over Content Image":{label:"Hero",category:"Composants",content:ht,media:'<img width="100%" src="'+wt+'"/>'},"Blue Card":{label:"Blue Card",category:"Composants",content:bt,media:'<img width="100%" src="'+xt+'"/>'},"ordered-card":{label:"Ordered Card",category:"Composants",content:()=>At(Ft++),media:'<img width="100%" src="'+It+'"/>'},"Réduction Card":{label:"Réduction Card",category:"Composants",content:kt,media:'<img width="100%" src="'+We+'"/>'},"Attention Card":{label:"Attention Card",category:"Composants",content:yt,media:'<img width="100%" src="'+Ye+'"/>'},"Bon à savoir Card":{label:"Bon à savoir Card",category:"Composants",content:Ct,media:'<img width="100%" src="'+Ne+'"/>'},"Définition Card":{label:"Définition Card",category:"Composants",content:Et,media:'<img width="100%" src="'+Ue+'"/>'}};function Ht({setEditorData:q,editorData:X,isEditorShouldLoad:K,setIsEditorShouldLoad:V}){const[d,J]=se.useState(null),[n,o]=se.useState(!1);se.useEffect(()=>{const s=pt.init({i18n:{locale:"fr",detectLocale:!1,localeFallback:"en",messages:{fr:Xe}},container:"#editor",height:"100vh",plugins:[$e,tt,Rt,Mt,Zt,Ot,ft],pluginsOpts:{[$e]:{blocks:["text-basic"]},[tt]:{blocks:["column1","column2","column3","column3-7","image","video"],labelColumn1:"1 Colonne",labelColumn2:"2 Colonnes",labelColumn3:"3 Colonnes",labelColumn3_7:"3/7 Colonnes",labelColumn4:"4 Colonnes",labelImage:"Image",labelVideo:"Vidéo"},gjsTabs:{},gtsIcons:{}},canvas:{styles:["/src/styles/tabs.css","/src/styles/tailwind.css","/src/styles/tailwind-build.css"]},storageManager:!1});return Vt(s),J(s),s.getWrapper().addClass("gjs-wrapper"),s.on("component:update",()=>{const p=s.getHtml(),w=s.getCss();q({html:p,css:w})}),s.on("component:remove",()=>{const p=s.getHtml(),w=s.getCss();console.log("removed : ",p),q({html:p,css:w})}),()=>{s.destroy()}},[]),se.useEffect(()=>{d&&X&&K&&(d.setComponents(X.html),d.setStyle(X.css),V(!1))},[d,X,K]),se.useEffect(()=>{if(d){d.Css.setRule(".gjs-wrapper",{direction:n?"rtl":"ltr"});const s=document.querySelector(".gjs-frame");if(s&&s.contentWindow&&s.contentWindow.document){const p=s.contentWindow.document.body;p.classList.toggle("rtl",n),p.classList.toggle("ltr",!n),p.setAttribute("dir",`${n?"rtl":"ltr"}`)}}},[d,n]);const a=()=>{o(s=>!s)};return se.useEffect(()=>{if(d){Object.entries(Kt).forEach(([g,B])=>{d.BlockManager.add(g,B)});const s=d.BlockManager.get("image");s&&s.set("category","Media");const p=d.BlockManager.get("video");p&&p.set("category","Media");const w=d.BlockManager.get("materialIcon");w&&w.set("category","Media");const I=d.BlockManager.get("column1");I&&I.set("category","Architecture");const z=d.BlockManager.get("column2");z&&z.set("category","Architecture");const m=d.BlockManager.get("column3");m&&m.set("category","Architecture");const S=d.BlockManager.get("column3-7");S&&S.set("category","Architecture");const E=d.BlockManager.get("tabs");E&&(E.set("category","Composants"),E.set("media",'<img width="100%" src="'+St+'"/>')),d.on("block:add",g=>{const B=d.getHtml(),v=d.getCss();q({html:B,css:v})}),d.on("component:add",g=>{const B=d.getHtml(),v=d.getCss();q({html:B,css:v})}),window.editorInstance=d;const A=document.querySelector(".gjs-pn-panel");if(A){A.innerHTML=`
1271
1271
  <div class="logo_toggle_rtl">
1272
1272
  <img class="gjs-logo" src="/logo.png" alt="Logo" style="height: 25px;">
1273
1273
  <!-- <button id="toggle-direction" class="rounded-lg p-1 text-[currentColor] bg-transparent border-0" >-->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brome-builder",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "A React-based GrapesJS editor component.",
5
5
  "type": "module",
6
6
  "main": "dist/brome-builder.umd.js",