@grapesjs/studio-sdk-plugins 1.0.21-rc.1 → 1.0.21
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/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +41 -41
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +21 -21
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/googleFontsAssetProvider/shared.d.ts +3 -0
- package/dist/googleFontsAssetProvider/typesSchema.d.ts +2 -2
- package/dist/index.cjs.js +17 -17
- package/dist/index.es.js +227 -226
- package/dist/index.umd.js +15 -15
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +109 -108
- package/dist/prosemirror/index.umd.js +7 -7
- package/dist/prosemirror/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const V="app.grapesjs.com",k="app-stage.grapesjs.com",I=[V,k,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],X="license:check:start",j="license:check:end",F=()=>typeof window<"u",q=({isDev:e,isStage:a})=>`${e?"":`https://${a?k:V}`}/api`,J=()=>{const e=F()&&window.location.hostname;return!!e&&(I.includes(e)||I.some(a=>e.endsWith(a)))};function z(e){return typeof e=="function"}async function Q({path:e,baseApiUrl:a,method:u="GET",headers:l={},params:d,body:n}){const
|
|
1
|
+
"use strict";const V="app.grapesjs.com",k="app-stage.grapesjs.com",I=[V,k,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],X="license:check:start",j="license:check:end",F=()=>typeof window<"u",q=({isDev:e,isStage:a})=>`${e?"":`https://${a?k:V}`}/api`,J=()=>{const e=F()&&window.location.hostname;return!!e&&(I.includes(e)||I.some(a=>e.endsWith(a)))};function z(e){return typeof e=="function"}async function Q({path:e,baseApiUrl:a,method:u="GET",headers:l={},params:d,body:n}){const o=`${a||q({isDev:!1,isStage:!1})}${e}`,m={method:u,headers:{"Content-Type":"application/json",...l}};n&&(m.body=JSON.stringify(n));const h=d?new URLSearchParams(d).toString():"",t=h?`?${h}`:"",s=await fetch(`${o}${t}`,m);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var P=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(P||{});const W={[P.free]:0,[P.startup]:10,[P.business]:20,[P.enterprise]:30};function Z(e){const a=e;return a.init=u=>l=>e(l,u),a}const ee=e=>Z(e);async function te({editor:e,plan:a,pluginName:u,licenseKey:l,cleanup:d}){let n="",c=!1;const o=J(),m=t=>{console.warn("Cleanup plugin:",u,"Reason:",t),d()},h=(t={})=>{var E;const{error:s,sdkLicense:r}=t,i=(E=t.plan)==null?void 0:E.category;if(!(r||t.license)||s)m(s||"Invalid license");else if(i){const b=W[a],v=W[i];b>v&&m({pluginRequiredPlan:a,licensePlan:i})}};e.on(X,t=>{n=t==null?void 0:t.baseApiUrl,c=!0}),e.on(j,t=>{h(t)}),setTimeout(async()=>{if(!c){if(o)return;if(l){const t=await ne({licenseKey:l,pluginName:u,baseApiUrl:n});t&&h(t)}else m("The `licenseKey` option not provided")}},2e3)}async function ne(e){const{licenseKey:a,pluginName:u,baseApiUrl:l}=e;try{return(await Q({baseApiUrl:l,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:u}})).result||{}}catch(d){return console.error("Error during SDK license check:",d),!1}}const oe="canvasAbsoluteMode",se=P.startup,ce=(e,a,u)=>{const l=u.enableAbsolute??(m=>m.hasAbsolute),n=(Array.isArray(a)?a:a?[a]:[...e.getSelectedAll()])[0];if(!n)return;const c=n.getEl();return{result:z(l)?l({component:n,hasAbsolute:!!c&&getComputedStyle(c).position==="absolute"}):!1,component:n,dmode:n.get("dmode")}};function B({guideMatched:e,canvasView:a}){var L;const u=e.guide.x===void 0?"y":"x";let l=0,d=0,n=0,c=0;const{guide:o,matched:m}=e,h=a.getElBoxRect(o.componentView.el),t=a.getElBoxRect(((L=m.componentView)==null?void 0:L.el)||m.componentEl),s=h.y,r=h.y+h.height,i=h.x,x=h.x+h.width,E=t.y,b=t.y+t.height,v=t.x,_=t.x+t.width,S=Math.max(0,s-b),p=Math.max(0,E-r),w=Math.max(0,i-_),A=Math.max(0,v-x),f=S>p,g=w>A,y=o.type;return u==="x"&&(y==="l"?(l=i,f?(d=b,n=S):(d=r,n=p)):y==="r"?(l=x,f?(d=b,n=S):(d=r,n=p)):y==="x"&&(l=i-(i-x)/2,f?(d=b,n=S):(d=r,n=p))),u==="y"&&(y==="t"?(d=s,g?(l=_,c=w):(l=x,c=A)):y==="b"?(d=r,g?(l=_,c=w):(l=x,c=A)):y==="y"&&(d=s-(s-r)/2,g?(l=_,c=w):(l=x,c=A))),{axis:u,x:l,y:d,width:c,height:n}}function ie({guideMatched:e,component:a,canvasView:u}){const l=e.guide.x===void 0?"x":"y",{guide:d,matched:n}=e,c=d.type,o=n.type,m=u.getElementPos(d.componentView.el).rect,h=u.getElementPos(n.componentView.el).rect;if(l==="x"){const t=m.height,s=h.top,r=h.top+h.height;let i=0;c==="t"?o==="t"?i=s-t:o==="b"?i=r-t:o==="y"&&(i=s-t-(s-r)/2):c==="b"?o==="t"?i=s-t*2:o==="b"?i=r-t*2:o==="y"&&(i=s-t*2-(s-r)/2):c==="y"&&(o==="t"?i=s-t*1.5:o==="b"?i=r-t*1.5:o==="y"&&(i=s-t*1.5-(s-r)/2)),a.addStyle({top:`${i-5}px`},{partial:!0})}if(l==="y"){const t=m.width,s=h.left,r=h.left+h.width;let i=0;c==="l"?o==="l"?i=s:o==="r"?i=r:o==="x"&&(i=s-(s-r)/2):c==="r"?o==="l"?i=s-t:o==="r"?i=r-t:o==="x"&&(i=s-t-(s-r)/2):c==="x"&&(o==="l"?i=s-t/2:o==="r"&&(i=r-t/2)),a.addStyle({left:`${i}px`},{partial:!0})}}function H({snapping:e,editor:a,props:u}){var R,O;const{command:l,guidesMatched:d}=u,n=u.component,c=n.getEl(),o=a.Canvas.getCanvasView(),{x:m,y:h}=e??{x:10,y:10},t=l.opts.event,s=t.clientX,r=t.clientY;if(!n.__lastSnappedPosition){const T=o.getElBoxRect(c),M=s-T.x,D=r-T.y;n.__lastSnappedPosition={left:T.x,top:T.y},n.__dragOffset={x:M,y:D}}const i=((R=n.__dragOffset)==null?void 0:R.x)||0,x=((O=n.__dragOffset)==null?void 0:O.y)||0,E=n.__lastSnappedPosition,b=s-E.left-i,v=r-E.top-x;let _=E.left,S=E.top;const p=d==null?void 0:d[0],w=(p==null?void 0:p.guide.type)==="l",A=(p==null?void 0:p.guide.type)==="x",f=(p==null?void 0:p.guide.type)==="r",g=(p==null?void 0:p.guide.type)==="t",y=(p==null?void 0:p.guide.type)==="b",L=(p==null?void 0:p.guide.type)==="y";if(p){const{x:T,y:M}=B({guideMatched:p,canvasView:o}),D=c.offsetWidth,G=c.offsetHeight;w?_=T:f?_=T-D:A?_=T-D/2:g?S=M:y?S=M-G:L&&(S=M-G/2),n.__lastSnappedGuideMatched=p}else Math.abs(b)>=m&&(_=Math.round((E.left+b)/m)*m,n.__lastSnappedGuideMatched=null),Math.abs(v)>=h&&(S=Math.round((E.top+v)/h)*h,n.__lastSnappedGuideMatched=null);return n.addStyle({left:`${_}px`,top:`${S}px`},{partial:!0}),n.__lastSnappedPosition={left:_,top:S},{x:_,y:S,guideMatched:n.__lastSnappedGuideMatched}}function ae({snapping:e,props:a,editor:u}){const{x:l,y:d}=H({snapping:e,props:a,editor:u}),n=a.component;n.addStyle({left:`${l}px`,top:`${d}px`}),delete n.__lastSnappedPosition,delete n.__lastSnappedGuideMatched}const le="core:component-drag",de="studio:setDragAbsolute",fe="dmode:start",Y="dmode:move",K="dmode:end",$="dragAbsolute",re="select",pe="hover",ue="spacing",he=function(e,a={}){const{Commands:u}=e,l=u.events,d=u.getConfig().defaultOptions??{},n=`${l.runBeforeCommand}tlb-move`;d[le]={run:f=>({...f,skipGuidesRender:!0})};const{snapping:c,locking:o,globalAbsolute:m=!0}=a;m&&e.setDragMode("absolute");const h=!!(c!=null&&c.x||c!=null&&c.y),t=!!(o!=null&&o.x||o!=null&&o.y),{Canvas:s}=e;let r=null;const i=f=>{const{component:g,guidesMatched:y,command:L}=f,R=g.view,O=e.Canvas.getCanvasView(),T=g.getEl();let M=y.map(C=>C.matched.componentEl),D=y.map(C=>B({guideMatched:C,canvasView:O}));if(h){const{guideMatched:C}=H({snapping:c,props:f,editor:e});C?(M=[C.matched.componentEl],D=[B({guideMatched:C,canvasView:O})]):(M=[],D=[])}if(t)if(L.opts.event.shiftKey)if(!r)r=y[0];else{const N=r,U=N.guide.x===void 0?"x":"y";(U==="x"&&(o==null?void 0:o.x)||U==="y"&&(o==null?void 0:o.y))&&(ie({guideMatched:N,component:g,canvasView:O}),M=[N.matched.componentEl],D=[B({guideMatched:N,canvasView:O})])}else r=null;const G={id:$,type:$,component:g,componentView:R,originComponent:T,matchedComponents:M,originMatchedDistances:D};s.addSpot(G)},x=({enabled:f})=>{e.runCommand(de,{enabled:f})},E=({type:f})=>{s.removeSpots({type:f})},b=()=>{E({type:re}),E({type:pe}),E({type:ue})},v=f=>{x({enabled:!0}),i(f),b()},_=f=>{i(f),b()},S=f=>{E({type:$}),h&&ae({snapping:c,props:f,editor:e}),x({enabled:!1})},A=[[fe,f=>{v(f),e.on(Y,_);const g=()=>{S(f),e.off(Y,_),e.off(K,g)};e.on(K,g)}],[n,f=>{if(m)return;const g=f.options.target,y=ce(e,g,a);y!=null&&y.result&&!y.dmode&&(y.component.set({dmode:"absolute"}),f.options.mode="absolute")}]];A.forEach(([f,g])=>e.on(f,g)),te({editor:e,licenseKey:a.licenseKey,plan:se,pluginName:oe,cleanup:()=>{x({enabled:!1}),A.forEach(([f,g])=>e.off(f,g))}})},me=ee(he);module.exports=me;
|
|
@@ -61,8 +61,8 @@ async function te({
|
|
|
61
61
|
console.warn("Cleanup plugin:", u, "Reason:", t), d();
|
|
62
62
|
}, h = (t = {}) => {
|
|
63
63
|
var E;
|
|
64
|
-
const { error: s, sdkLicense:
|
|
65
|
-
if (!(
|
|
64
|
+
const { error: s, sdkLicense: r } = t, i = (E = t.plan) == null ? void 0 : E.category;
|
|
65
|
+
if (!(r || t.license) || s)
|
|
66
66
|
m(s || "Invalid license");
|
|
67
67
|
else if (i) {
|
|
68
68
|
const b = W[a], v = W[i];
|
|
@@ -117,8 +117,8 @@ function B({
|
|
|
117
117
|
var L;
|
|
118
118
|
const u = e.guide.x === void 0 ? "y" : "x";
|
|
119
119
|
let l = 0, d = 0, n = 0, c = 0;
|
|
120
|
-
const { guide: o, matched: m } = e, h = a.getElBoxRect(o.componentView.el), t = a.getElBoxRect(((L = m.componentView) == null ? void 0 : L.el) || m.componentEl), s = h.y,
|
|
121
|
-
return u === "x" && (y === "l" ? (l = i,
|
|
120
|
+
const { guide: o, matched: m } = e, h = a.getElBoxRect(o.componentView.el), t = a.getElBoxRect(((L = m.componentView) == null ? void 0 : L.el) || m.componentEl), s = h.y, r = h.y + h.height, i = h.x, x = h.x + h.width, E = t.y, b = t.y + t.height, v = t.x, _ = t.x + t.width, S = Math.max(0, s - b), p = Math.max(0, E - r), w = Math.max(0, i - _), A = Math.max(0, v - x), f = S > p, g = w > A, y = o.type;
|
|
121
|
+
return u === "x" && (y === "l" ? (l = i, f ? (d = b, n = S) : (d = r, n = p)) : y === "r" ? (l = x, f ? (d = b, n = S) : (d = r, n = p)) : y === "x" && (l = i - (i - x) / 2, f ? (d = b, n = S) : (d = r, n = p))), u === "y" && (y === "t" ? (d = s, g ? (l = _, c = w) : (l = x, c = A)) : y === "b" ? (d = r, g ? (l = _, c = w) : (l = x, c = A)) : y === "y" && (d = s - (s - r) / 2, g ? (l = _, c = w) : (l = x, c = A))), { axis: u, x: l, y: d, width: c, height: n };
|
|
122
122
|
}
|
|
123
123
|
function ie({
|
|
124
124
|
guideMatched: e,
|
|
@@ -127,14 +127,14 @@ function ie({
|
|
|
127
127
|
}) {
|
|
128
128
|
const l = e.guide.x === void 0 ? "x" : "y", { guide: d, matched: n } = e, c = d.type, o = n.type, m = u.getElementPos(d.componentView.el).rect, h = u.getElementPos(n.componentView.el).rect;
|
|
129
129
|
if (l === "x") {
|
|
130
|
-
const t = m.height, s = h.top,
|
|
130
|
+
const t = m.height, s = h.top, r = h.top + h.height;
|
|
131
131
|
let i = 0;
|
|
132
|
-
c === "t" ? o === "t" ? i = s - t : o === "b" ? i =
|
|
132
|
+
c === "t" ? o === "t" ? i = s - t : o === "b" ? i = r - t : o === "y" && (i = s - t - (s - r) / 2) : c === "b" ? o === "t" ? i = s - t * 2 : o === "b" ? i = r - t * 2 : o === "y" && (i = s - t * 2 - (s - r) / 2) : c === "y" && (o === "t" ? i = s - t * 1.5 : o === "b" ? i = r - t * 1.5 : o === "y" && (i = s - t * 1.5 - (s - r) / 2)), a.addStyle({ top: `${i - 5}px` }, { partial: !0 });
|
|
133
133
|
}
|
|
134
134
|
if (l === "y") {
|
|
135
|
-
const t = m.width, s = h.left,
|
|
135
|
+
const t = m.width, s = h.left, r = h.left + h.width;
|
|
136
136
|
let i = 0;
|
|
137
|
-
c === "l" ? o === "l" ? i = s : o === "r" ? i =
|
|
137
|
+
c === "l" ? o === "l" ? i = s : o === "r" ? i = r : o === "x" && (i = s - (s - r) / 2) : c === "r" ? o === "l" ? i = s - t : o === "r" ? i = r - t : o === "x" && (i = s - t - (s - r) / 2) : c === "x" && (o === "l" ? i = s - t / 2 : o === "r" && (i = r - t / 2)), a.addStyle({ left: `${i}px` }, { partial: !0 });
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
function H({
|
|
@@ -143,17 +143,17 @@ function H({
|
|
|
143
143
|
props: u
|
|
144
144
|
}) {
|
|
145
145
|
var R, O;
|
|
146
|
-
const { command: l, guidesMatched: d } = u, n = u.component, c = n.getEl(), o = a.Canvas.getCanvasView(), { x: m, y: h } = e ?? { x: 10, y: 10 }, t = l.opts.event, s = t.clientX,
|
|
146
|
+
const { command: l, guidesMatched: d } = u, n = u.component, c = n.getEl(), o = a.Canvas.getCanvasView(), { x: m, y: h } = e ?? { x: 10, y: 10 }, t = l.opts.event, s = t.clientX, r = t.clientY;
|
|
147
147
|
if (!n.__lastSnappedPosition) {
|
|
148
|
-
const T = o.getElBoxRect(c), M = s - T.x, D =
|
|
148
|
+
const T = o.getElBoxRect(c), M = s - T.x, D = r - T.y;
|
|
149
149
|
n.__lastSnappedPosition = { left: T.x, top: T.y }, n.__dragOffset = { x: M, y: D };
|
|
150
150
|
}
|
|
151
|
-
const i = ((R = n.__dragOffset) == null ? void 0 : R.x) || 0, x = ((O = n.__dragOffset) == null ? void 0 : O.y) || 0, E = n.__lastSnappedPosition, b = s - E.left - i, v =
|
|
151
|
+
const i = ((R = n.__dragOffset) == null ? void 0 : R.x) || 0, x = ((O = n.__dragOffset) == null ? void 0 : O.y) || 0, E = n.__lastSnappedPosition, b = s - E.left - i, v = r - E.top - x;
|
|
152
152
|
let _ = E.left, S = E.top;
|
|
153
|
-
const p = d == null ? void 0 : d[0], w = (p == null ? void 0 : p.guide.type) === "l", A = (p == null ? void 0 : p.guide.type) === "x",
|
|
153
|
+
const p = d == null ? void 0 : d[0], w = (p == null ? void 0 : p.guide.type) === "l", A = (p == null ? void 0 : p.guide.type) === "x", f = (p == null ? void 0 : p.guide.type) === "r", g = (p == null ? void 0 : p.guide.type) === "t", y = (p == null ? void 0 : p.guide.type) === "b", L = (p == null ? void 0 : p.guide.type) === "y";
|
|
154
154
|
if (p) {
|
|
155
155
|
const { x: T, y: M } = B({ guideMatched: p, canvasView: o }), D = c.offsetWidth, G = c.offsetHeight;
|
|
156
|
-
w ? _ = T :
|
|
156
|
+
w ? _ = T : f ? _ = T - D : A ? _ = T - D / 2 : g ? S = M : y ? S = M - G : L && (S = M - G / 2), n.__lastSnappedGuideMatched = p;
|
|
157
157
|
} else
|
|
158
158
|
Math.abs(b) >= m && (_ = Math.round((E.left + b) / m) * m, n.__lastSnappedGuideMatched = null), Math.abs(v) >= h && (S = Math.round((E.top + v) / h) * h, n.__lastSnappedGuideMatched = null);
|
|
159
159
|
return n.addStyle({ left: `${_}px`, top: `${S}px` }, { partial: !0 }), n.__lastSnappedPosition = { left: _, top: S }, { x: _, y: S, guideMatched: n.__lastSnappedGuideMatched };
|
|
@@ -169,32 +169,32 @@ function ae({
|
|
|
169
169
|
const le = "core:component-drag", de = "studio:setDragAbsolute", fe = "dmode:start", Y = "dmode:move", K = "dmode:end", $ = "dragAbsolute", re = "select", pe = "hover", ue = "spacing", he = function(e, a = {}) {
|
|
170
170
|
const { Commands: u } = e, l = u.events, d = u.getConfig().defaultOptions ?? {}, n = `${l.runBeforeCommand}tlb-move`;
|
|
171
171
|
d[le] = {
|
|
172
|
-
run: (
|
|
173
|
-
...
|
|
172
|
+
run: (f) => ({
|
|
173
|
+
...f,
|
|
174
174
|
skipGuidesRender: !0
|
|
175
175
|
})
|
|
176
176
|
};
|
|
177
177
|
const { snapping: c, locking: o, globalAbsolute: m = !0 } = a;
|
|
178
178
|
m && e.setDragMode("absolute");
|
|
179
179
|
const h = !!(c != null && c.x || c != null && c.y), t = !!(o != null && o.x || o != null && o.y), { Canvas: s } = e;
|
|
180
|
-
let
|
|
181
|
-
const i = (
|
|
182
|
-
const { component: g, guidesMatched: y, command: L } =
|
|
180
|
+
let r = null;
|
|
181
|
+
const i = (f) => {
|
|
182
|
+
const { component: g, guidesMatched: y, command: L } = f, R = g.view, O = e.Canvas.getCanvasView(), T = g.getEl();
|
|
183
183
|
let M = y.map((C) => C.matched.componentEl), D = y.map((C) => B({ guideMatched: C, canvasView: O }));
|
|
184
184
|
if (h) {
|
|
185
|
-
const { guideMatched: C } = H({ snapping: c, props:
|
|
185
|
+
const { guideMatched: C } = H({ snapping: c, props: f, editor: e });
|
|
186
186
|
C ? (M = [C.matched.componentEl], D = [B({ guideMatched: C, canvasView: O })]) : (M = [], D = []);
|
|
187
187
|
}
|
|
188
188
|
if (t)
|
|
189
189
|
if (L.opts.event.shiftKey)
|
|
190
|
-
if (!
|
|
191
|
-
|
|
190
|
+
if (!r)
|
|
191
|
+
r = y[0];
|
|
192
192
|
else {
|
|
193
|
-
const N =
|
|
193
|
+
const N = r, U = N.guide.x === void 0 ? "x" : "y";
|
|
194
194
|
(U === "x" && (o == null ? void 0 : o.x) || U === "y" && (o == null ? void 0 : o.y)) && (ie({ guideMatched: N, component: g, canvasView: O }), M = [N.matched.componentEl], D = [B({ guideMatched: N, canvasView: O })]);
|
|
195
195
|
}
|
|
196
196
|
else
|
|
197
|
-
|
|
197
|
+
r = null;
|
|
198
198
|
const G = {
|
|
199
199
|
id: $,
|
|
200
200
|
type: $,
|
|
@@ -205,39 +205,39 @@ const le = "core:component-drag", de = "studio:setDragAbsolute", fe = "dmode:sta
|
|
|
205
205
|
originMatchedDistances: D
|
|
206
206
|
};
|
|
207
207
|
s.addSpot(G);
|
|
208
|
-
}, x = ({ enabled:
|
|
209
|
-
e.runCommand(de, { enabled:
|
|
210
|
-
}, E = ({ type:
|
|
211
|
-
s.removeSpots({ type:
|
|
208
|
+
}, x = ({ enabled: f }) => {
|
|
209
|
+
e.runCommand(de, { enabled: f });
|
|
210
|
+
}, E = ({ type: f }) => {
|
|
211
|
+
s.removeSpots({ type: f });
|
|
212
212
|
}, b = () => {
|
|
213
213
|
E({ type: re }), E({ type: pe }), E({ type: ue });
|
|
214
|
-
}, v = (
|
|
215
|
-
x({ enabled: !0 }), i(
|
|
216
|
-
}, _ = (
|
|
217
|
-
i(
|
|
218
|
-
}, S = (
|
|
219
|
-
E({ type: $ }), h && ae({ snapping: c, props:
|
|
214
|
+
}, v = (f) => {
|
|
215
|
+
x({ enabled: !0 }), i(f), b();
|
|
216
|
+
}, _ = (f) => {
|
|
217
|
+
i(f), b();
|
|
218
|
+
}, S = (f) => {
|
|
219
|
+
E({ type: $ }), h && ae({ snapping: c, props: f, editor: e }), x({ enabled: !1 });
|
|
220
220
|
}, A = [
|
|
221
|
-
[fe, (
|
|
222
|
-
v(
|
|
221
|
+
[fe, (f) => {
|
|
222
|
+
v(f), e.on(Y, _);
|
|
223
223
|
const g = () => {
|
|
224
|
-
S(
|
|
224
|
+
S(f), e.off(Y, _), e.off(K, g);
|
|
225
225
|
};
|
|
226
226
|
e.on(K, g);
|
|
227
227
|
}],
|
|
228
|
-
[n, (
|
|
228
|
+
[n, (f) => {
|
|
229
229
|
if (m) return;
|
|
230
|
-
const g =
|
|
231
|
-
y != null && y.result && !y.dmode && y.component.set({ dmode: "absolute" });
|
|
230
|
+
const g = f.options.target, y = ce(e, g, a);
|
|
231
|
+
y != null && y.result && !y.dmode && (y.component.set({ dmode: "absolute" }), f.options.mode = "absolute");
|
|
232
232
|
}]
|
|
233
233
|
];
|
|
234
|
-
A.forEach(([
|
|
234
|
+
A.forEach(([f, g]) => e.on(f, g)), te({
|
|
235
235
|
editor: e,
|
|
236
236
|
licenseKey: a.licenseKey,
|
|
237
237
|
plan: se,
|
|
238
238
|
pluginName: oe,
|
|
239
239
|
cleanup: () => {
|
|
240
|
-
x({ enabled: !1 }), A.forEach(([
|
|
240
|
+
x({ enabled: !1 }), A.forEach(([f, g]) => e.off(f, g));
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
}, ge = ee(he);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(P,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(P=typeof globalThis<"u"?globalThis:P||self,P.StudioSdkPlugins_canvasAbsoluteMode=L())})(this,function(){"use strict";const P="app.grapesjs.com",L="app-stage.grapesjs.com",W=[P,L,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],X="license:check:start",j="license:check:end",F=()=>typeof window<"u",q=({isDev:e,isStage:l})=>`${e?"":`https://${l?L:P}`}/api`,J=()=>{const e=F()&&window.location.hostname;return!!e&&(W.includes(e)||W.some(l=>e.endsWith(l)))};function z(e){return typeof e=="function"}async function Q({path:e,baseApiUrl:l,method:u="GET",headers:a={},params:d,body:n}){const o=`${l||q({isDev:!1,isStage:!1})}${e}`,m={method:u,headers:{"Content-Type":"application/json",...a}};n&&(m.body=JSON.stringify(n));const h=d?new URLSearchParams(d).toString():"",t=h?`?${h}`:"",s=await fetch(`${o}${t}`,m);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var R=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(R||{});const Y={[R.free]:0,[R.startup]:10,[R.business]:20,[R.enterprise]:30};function Z(e){const l=e;return l.init=u=>a=>e(a,u),l}const ee=e=>Z(e);async function te({editor:e,plan:l,pluginName:u,licenseKey:a,cleanup:d}){let n="",i=!1;const o=J(),m=t=>{console.warn("Cleanup plugin:",u,"Reason:",t),d()},h=(t={})=>{var E;const{error:s,sdkLicense:
|
|
1
|
+
(function(P,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(P=typeof globalThis<"u"?globalThis:P||self,P.StudioSdkPlugins_canvasAbsoluteMode=L())})(this,function(){"use strict";const P="app.grapesjs.com",L="app-stage.grapesjs.com",W=[P,L,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],X="license:check:start",j="license:check:end",F=()=>typeof window<"u",q=({isDev:e,isStage:l})=>`${e?"":`https://${l?L:P}`}/api`,J=()=>{const e=F()&&window.location.hostname;return!!e&&(W.includes(e)||W.some(l=>e.endsWith(l)))};function z(e){return typeof e=="function"}async function Q({path:e,baseApiUrl:l,method:u="GET",headers:a={},params:d,body:n}){const o=`${l||q({isDev:!1,isStage:!1})}${e}`,m={method:u,headers:{"Content-Type":"application/json",...a}};n&&(m.body=JSON.stringify(n));const h=d?new URLSearchParams(d).toString():"",t=h?`?${h}`:"",s=await fetch(`${o}${t}`,m);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var R=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(R||{});const Y={[R.free]:0,[R.startup]:10,[R.business]:20,[R.enterprise]:30};function Z(e){const l=e;return l.init=u=>a=>e(a,u),l}const ee=e=>Z(e);async function te({editor:e,plan:l,pluginName:u,licenseKey:a,cleanup:d}){let n="",i=!1;const o=J(),m=t=>{console.warn("Cleanup plugin:",u,"Reason:",t),d()},h=(t={})=>{var E;const{error:s,sdkLicense:r}=t,c=(E=t.plan)==null?void 0:E.category;if(!(r||t.license)||s)m(s||"Invalid license");else if(c){const b=Y[l],v=Y[c];b>v&&m({pluginRequiredPlan:l,licensePlan:c})}};e.on(X,t=>{n=t==null?void 0:t.baseApiUrl,i=!0}),e.on(j,t=>{h(t)}),setTimeout(async()=>{if(!i){if(o)return;if(a){const t=await ne({licenseKey:a,pluginName:u,baseApiUrl:n});t&&h(t)}else m("The `licenseKey` option not provided")}},2e3)}async function ne(e){const{licenseKey:l,pluginName:u,baseApiUrl:a}=e;try{return(await Q({baseApiUrl:a,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:u}})).result||{}}catch(d){return console.error("Error during SDK license check:",d),!1}}const oe="canvasAbsoluteMode",se=R.startup,ie=(e,l,u)=>{const a=u.enableAbsolute??(m=>m.hasAbsolute),n=(Array.isArray(l)?l:l?[l]:[...e.getSelectedAll()])[0];if(!n)return;const i=n.getEl();return{result:z(a)?a({component:n,hasAbsolute:!!i&&getComputedStyle(i).position==="absolute"}):!1,component:n,dmode:n.get("dmode")}};function N({guideMatched:e,canvasView:l}){var G;const u=e.guide.x===void 0?"y":"x";let a=0,d=0,n=0,i=0;const{guide:o,matched:m}=e,h=l.getElBoxRect(o.componentView.el),t=l.getElBoxRect(((G=m.componentView)==null?void 0:G.el)||m.componentEl),s=h.y,r=h.y+h.height,c=h.x,S=h.x+h.width,E=t.y,b=t.y+t.height,v=t.x,x=t.x+t.width,_=Math.max(0,s-b),p=Math.max(0,E-r),w=Math.max(0,c-x),A=Math.max(0,v-S),f=_>p,g=w>A,y=o.type;return u==="x"&&(y==="l"?(a=c,f?(d=b,n=_):(d=r,n=p)):y==="r"?(a=S,f?(d=b,n=_):(d=r,n=p)):y==="x"&&(a=c-(c-S)/2,f?(d=b,n=_):(d=r,n=p))),u==="y"&&(y==="t"?(d=s,g?(a=x,i=w):(a=S,i=A)):y==="b"?(d=r,g?(a=x,i=w):(a=S,i=A)):y==="y"&&(d=s-(s-r)/2,g?(a=x,i=w):(a=S,i=A))),{axis:u,x:a,y:d,width:i,height:n}}function ce({guideMatched:e,component:l,canvasView:u}){const a=e.guide.x===void 0?"x":"y",{guide:d,matched:n}=e,i=d.type,o=n.type,m=u.getElementPos(d.componentView.el).rect,h=u.getElementPos(n.componentView.el).rect;if(a==="x"){const t=m.height,s=h.top,r=h.top+h.height;let c=0;i==="t"?o==="t"?c=s-t:o==="b"?c=r-t:o==="y"&&(c=s-t-(s-r)/2):i==="b"?o==="t"?c=s-t*2:o==="b"?c=r-t*2:o==="y"&&(c=s-t*2-(s-r)/2):i==="y"&&(o==="t"?c=s-t*1.5:o==="b"?c=r-t*1.5:o==="y"&&(c=s-t*1.5-(s-r)/2)),l.addStyle({top:`${c-5}px`},{partial:!0})}if(a==="y"){const t=m.width,s=h.left,r=h.left+h.width;let c=0;i==="l"?o==="l"?c=s:o==="r"?c=r:o==="x"&&(c=s-(s-r)/2):i==="r"?o==="l"?c=s-t:o==="r"?c=r-t:o==="x"&&(c=s-t-(s-r)/2):i==="x"&&(o==="l"?c=s-t/2:o==="r"&&(c=r-t/2)),l.addStyle({left:`${c}px`},{partial:!0})}}function k({snapping:e,editor:l,props:u}){var B,O;const{command:a,guidesMatched:d}=u,n=u.component,i=n.getEl(),o=l.Canvas.getCanvasView(),{x:m,y:h}=e??{x:10,y:10},t=a.opts.event,s=t.clientX,r=t.clientY;if(!n.__lastSnappedPosition){const T=o.getElBoxRect(i),M=s-T.x,D=r-T.y;n.__lastSnappedPosition={left:T.x,top:T.y},n.__dragOffset={x:M,y:D}}const c=((B=n.__dragOffset)==null?void 0:B.x)||0,S=((O=n.__dragOffset)==null?void 0:O.y)||0,E=n.__lastSnappedPosition,b=s-E.left-c,v=r-E.top-S;let x=E.left,_=E.top;const p=d==null?void 0:d[0],w=(p==null?void 0:p.guide.type)==="l",A=(p==null?void 0:p.guide.type)==="x",f=(p==null?void 0:p.guide.type)==="r",g=(p==null?void 0:p.guide.type)==="t",y=(p==null?void 0:p.guide.type)==="b",G=(p==null?void 0:p.guide.type)==="y";if(p){const{x:T,y:M}=N({guideMatched:p,canvasView:o}),D=i.offsetWidth,$=i.offsetHeight;w?x=T:f?x=T-D:A?x=T-D/2:g?_=M:y?_=M-$:G&&(_=M-$/2),n.__lastSnappedGuideMatched=p}else Math.abs(b)>=m&&(x=Math.round((E.left+b)/m)*m,n.__lastSnappedGuideMatched=null),Math.abs(v)>=h&&(_=Math.round((E.top+v)/h)*h,n.__lastSnappedGuideMatched=null);return n.addStyle({left:`${x}px`,top:`${_}px`},{partial:!0}),n.__lastSnappedPosition={left:x,top:_},{x,y:_,guideMatched:n.__lastSnappedGuideMatched}}function le({snapping:e,props:l,editor:u}){const{x:a,y:d}=k({snapping:e,props:l,editor:u}),n=l.component;n.addStyle({left:`${a}px`,top:`${d}px`}),delete n.__lastSnappedPosition,delete n.__lastSnappedGuideMatched}const ae="core:component-drag",de="studio:setDragAbsolute",fe="dmode:start",K="dmode:move",V="dmode:end",I="dragAbsolute",re="select",pe="hover",ue="spacing";return ee(function(e,l={}){const{Commands:u}=e,a=u.events,d=u.getConfig().defaultOptions??{},n=`${a.runBeforeCommand}tlb-move`;d[ae]={run:f=>({...f,skipGuidesRender:!0})};const{snapping:i,locking:o,globalAbsolute:m=!0}=l;m&&e.setDragMode("absolute");const h=!!(i!=null&&i.x||i!=null&&i.y),t=!!(o!=null&&o.x||o!=null&&o.y),{Canvas:s}=e;let r=null;const c=f=>{const{component:g,guidesMatched:y,command:G}=f,B=g.view,O=e.Canvas.getCanvasView(),T=g.getEl();let M=y.map(C=>C.matched.componentEl),D=y.map(C=>N({guideMatched:C,canvasView:O}));if(h){const{guideMatched:C}=k({snapping:i,props:f,editor:e});C?(M=[C.matched.componentEl],D=[N({guideMatched:C,canvasView:O})]):(M=[],D=[])}if(t)if(G.opts.event.shiftKey)if(!r)r=y[0];else{const U=r,H=U.guide.x===void 0?"x":"y";(H==="x"&&(o==null?void 0:o.x)||H==="y"&&(o==null?void 0:o.y))&&(ce({guideMatched:U,component:g,canvasView:O}),M=[U.matched.componentEl],D=[N({guideMatched:U,canvasView:O})])}else r=null;const $={id:I,type:I,component:g,componentView:B,originComponent:T,matchedComponents:M,originMatchedDistances:D};s.addSpot($)},S=({enabled:f})=>{e.runCommand(de,{enabled:f})},E=({type:f})=>{s.removeSpots({type:f})},b=()=>{E({type:re}),E({type:pe}),E({type:ue})},v=f=>{S({enabled:!0}),c(f),b()},x=f=>{c(f),b()},_=f=>{E({type:I}),h&&le({snapping:i,props:f,editor:e}),S({enabled:!1})},A=[[fe,f=>{v(f),e.on(K,x);const g=()=>{_(f),e.off(K,x),e.off(V,g)};e.on(V,g)}],[n,f=>{if(m)return;const g=f.options.target,y=ie(e,g,l);y!=null&&y.result&&!y.dmode&&(y.component.set({dmode:"absolute"}),f.options.mode="absolute")}]];A.forEach(([f,g])=>e.on(f,g)),te({editor:e,licenseKey:l.licenseKey,plan:se,pluginName:oe,cleanup:()=>{S({enabled:!1}),A.forEach(([f,g])=>e.off(f,g))}})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(p||{}),y=(e=>(e.toastAdd="studio:toastAdd",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.projectFiles="studio:projectFiles",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.setDragAbsolute="studio:setDragAbsolute",e))(y||{});const R="app.grapesjs.com",x="app-stage.grapesjs.com",
|
|
1
|
+
"use strict";var p=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(p||{}),y=(e=>(e.toastAdd="studio:toastAdd",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.projectFiles="studio:projectFiles",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.setDragAbsolute="studio:setDragAbsolute",e))(y||{});const R="app.grapesjs.com",x="app-stage.grapesjs.com",w=[R,x,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],G="license:check:start",$="license:check:end",I=()=>typeof window<"u",U=({isDev:e,isStage:t})=>`${e?"":`https://${t?x:R}`}/api`,M=()=>{const e=I()&&window.location.hostname;return!!e&&(w.includes(e)||w.some(t=>e.endsWith(t)))};async function j({path:e,baseApiUrl:t,method:s="GET",headers:n={},params:o,body:a}){const l=`${t||U({isDev:!1,isStage:!1})}${e}`,c={method:s,headers:{"Content-Type":"application/json",...n}};a&&(c.body=JSON.stringify(a));const u=o?new URLSearchParams(o).toString():"",r=u?`?${u}`:"",g=await fetch(`${l}${r}`,c);if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);return g.json()}const L={[p.free]:0,[p.startup]:10,[p.business]:20,[p.enterprise]:30};function B(e){const t=e;return t.init=s=>n=>e(n,s),t}const E=e=>B(e);async function N({editor:e,plan:t,pluginName:s,licenseKey:n,cleanup:o}){let a="",i=!1;const l=M(),c=r=>{console.warn("Cleanup plugin:",s,"Reason:",r),o()},u=(r={})=>{var A;const{error:g,sdkLicense:f}=r,d=(A=r.plan)==null?void 0:A.category;if(!(f||r.license)||g)c(g||"Invalid license");else if(d){const O=L[t],k=L[d];O>k&&c({pluginRequiredPlan:t,licensePlan:d})}};e.on(G,r=>{a=r==null?void 0:r.baseApiUrl,i=!0}),e.on($,r=>{u(r)}),setTimeout(async()=>{if(!i){if(l)return;if(n){const r=await W({licenseKey:n,pluginName:s,baseApiUrl:a});r&&u(r)}else c("The `licenseKey` option not provided")}},2e3)}async function W(e){const{licenseKey:t,pluginName:s,baseApiUrl:n}=e;try{return(await j({baseApiUrl:n,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:s}})).result||{}}catch(o){return console.error("Error during SDK license check:",o),!1}}const b=e=>e.replaceAll('"',"").replaceAll("'",""),v=e=>e.includes(",")?e:/\s/.test(e)?`"${b(e)}"`:b(e),F=(e,t,s)=>({family:e,variant:t,...s}),D=(e,t)=>{e=v(e);const{menuVariant:s,variants:n}=t;return{family:e,familyLabel:b(e),menuVariant:s&&F(v(`menuFont-${b(e)}`),"regular",s),variants:Object.assign({},...Object.entries(n).map(([o,a])=>({[o]:F(e,o,a)})))}},T=(e,t)=>{var l;const s=D(e.family,e),n=s.menuVariant??((l=Object.values(s.variants))==null?void 0:l[0]);if(!n)return"Arial, Helvetica, sans-serif";const{source:o,descriptors:a}=n,i=b(n.family);if(!t){const c=new FontFace(i,`url("${o}")`,a),u=Array.from(document.fonts.values()).filter(r=>r.family===i);for(const r of u)document.fonts.delete(r);document.fonts.add(c),c.load().catch(()=>{})}return v(i)},_=e=>{const{family:t,menu:s,axes:n}=e,o=!!n,a=Object.assign({},...e.variants.map(i=>{var r,g;let l,c;if(o){const f=n.find(d=>d.tag==="wght");if(f){const{start:d,end:P}=f;l=`${d} ${P}`}}return l||(l=((r=i.match(/\d+/))==null?void 0:r[0])??"400"),c=((g=i.match(/[a-zA-Z]+/))==null?void 0:g[0])==="italic"?"italic":void 0,{[i]:{source:e.files[i],descriptors:{style:c,weight:l}}}}));return D(t,{menuVariant:{source:s},variants:a})},K=e=>({id:`${e.family}/${e.version}`,type:"font",src:e.menu,name:e.family,customData:{font:_(e),needsLoading:!0}}),V=e=>{const{font:t}=e.customData;return e.customData.needsLoading?(e.customData.needsLoading=!1,T(t)):T(t,!0)};let h;const H=e=>{const t=[];for(const s of Object.keys(e)){let n=e[s];n&&(Array.isArray(n)?t.push(...n.map(o=>[s,o.toString()])):(n=n.toString(),t.push([s,n])))}return new URLSearchParams(t)},z=e=>{const{apiKey:t,searchParams:s}=e,n=(o={})=>{const a="https://www.googleapis.com/webfonts/v1/webfonts",i=H(o);return`${a}?${i}`};return{id:"google-fonts",types:["font"],label:({editor:o})=>o.I18n.t("googleFontsAssetProvider.providerLabel"),search:{reloadOnInput:!1},async onLoad(){var u;if(h)return h;const o={key:t,sort:"alpha",subset:"latin",capability:["WOFF2","VF"]},a=s==null?void 0:s(),i={...o,...a},c=await(await fetch(n(i))).json();return(u=c.items)!=null&&u.length?(h=c.items.map(K),h):[]},itemLayout:o=>{const a=h.find(l=>l.id===o.assetProps.id),i=V(a);return{type:"column",onClick:()=>o.onSelect(a),htmlAttrs:{title:a.name},style:{borderWidth:"1px",borderRadius:8,overflow:"hidden",cursor:"pointer"},children:[{type:"text",content:a.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:i,fontSize:"24px",paddingLeft:"8px",paddingRight:"8px"}},{type:"text",content:a.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"16px",paddingLeft:"8px",paddingRight:"8px"}}]}}}},q={googleFontsAssetProvider:{searchBtn:"Search on Google Fonts",modalTitle:"Select Font",providerLabel:"Google Fonts"}},J="googleFontsAssetProvider",Q=p.startup,Z=function(e,t){const{i18n:s={}}=t,n=z(t);e.runCommand(y.assetProviderAdd,{provider:n}),e.I18n.addMessages({en:q,...s}),N({editor:e,licenseKey:t.licenseKey,plan:Q,pluginName:J,cleanup:()=>{e.runCommand(y.assetProviderRemove,{id:n.id})}})},S=E(Z);module.exports=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var p = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(p || {}), y = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.projectFiles = "studio:projectFiles", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.getStateContextMenu = "studio:getStateContextMenu", e.setStateContextMenu = "studio:setStateContextMenu", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e.layoutUpdate = "studio:layoutUpdate", e.layoutGet = "studio:layoutGet", e.layoutConfigGet = "studio:layoutConfigGet", e.layoutConfigSet = "studio:layoutConfigSet", e.getStateTheme = "studio:getStateTheme", e.setStateTheme = "studio:setStateTheme", e.assetProviderGet = "studio:assetProviderGet", e.assetProviderAdd = "studio:assetProviderAdd", e.assetProviderRemove = "studio:assetProviderRemove", e.fontGet = "studio:fontGet", e.fontAdd = "studio:fontAdd", e.fontRemove = "studio:fontRemove", e.fontManagerOpen = "studio:fontManagerOpen", e.menuFontLoad = "studio:menuFontLoad", e.toggleStateDataSource = "studio:toggleStateDataSource", e.getStateDataSource = "studio:getStateDataSource", e.setDragAbsolute = "studio:setDragAbsolute", e))(y || {});
|
|
2
|
-
const R = "app.grapesjs.com", x = "app-stage.grapesjs.com",
|
|
2
|
+
const R = "app.grapesjs.com", x = "app-stage.grapesjs.com", w = [
|
|
3
3
|
R,
|
|
4
4
|
x,
|
|
5
5
|
"localhost",
|
|
@@ -10,9 +10,9 @@ const R = "app.grapesjs.com", x = "app-stage.grapesjs.com", A = [
|
|
|
10
10
|
// For stackblitz.com demos
|
|
11
11
|
"-sandpack.codesandbox.io"
|
|
12
12
|
// For Sandpack demos
|
|
13
|
-
],
|
|
13
|
+
], G = "license:check:start", $ = "license:check:end", I = () => typeof window < "u", U = ({ isDev: e, isStage: t }) => `${e ? "" : `https://${t ? x : R}`}/api`, M = () => {
|
|
14
14
|
const e = I() && window.location.hostname;
|
|
15
|
-
return !!e && (
|
|
15
|
+
return !!e && (w.includes(e) || w.some((t) => e.endsWith(t)));
|
|
16
16
|
};
|
|
17
17
|
async function j({
|
|
18
18
|
path: e,
|
|
@@ -46,7 +46,7 @@ function B(e) {
|
|
|
46
46
|
return t.init = (s) => (n) => e(n, s), t;
|
|
47
47
|
}
|
|
48
48
|
const E = (e) => /* @__PURE__ */ B(e);
|
|
49
|
-
async function
|
|
49
|
+
async function N({
|
|
50
50
|
editor: e,
|
|
51
51
|
plan: t,
|
|
52
52
|
pluginName: s,
|
|
@@ -57,8 +57,8 @@ async function W({
|
|
|
57
57
|
const l = M(), c = (a) => {
|
|
58
58
|
console.warn("Cleanup plugin:", s, "Reason:", a), o();
|
|
59
59
|
}, u = (a = {}) => {
|
|
60
|
-
var
|
|
61
|
-
const { error: g, sdkLicense: f } = a, d = (
|
|
60
|
+
var A;
|
|
61
|
+
const { error: g, sdkLicense: f } = a, d = (A = a.plan) == null ? void 0 : A.category;
|
|
62
62
|
if (!(f || a.license) || g)
|
|
63
63
|
c(g || "Invalid license");
|
|
64
64
|
else if (d) {
|
|
@@ -66,22 +66,22 @@ async function W({
|
|
|
66
66
|
O > k && c({ pluginRequiredPlan: t, licensePlan: d });
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
e.on(
|
|
69
|
+
e.on(G, (a) => {
|
|
70
70
|
r = a == null ? void 0 : a.baseApiUrl, i = !0;
|
|
71
|
-
}), e.on(
|
|
71
|
+
}), e.on($, (a) => {
|
|
72
72
|
u(a);
|
|
73
73
|
}), setTimeout(async () => {
|
|
74
74
|
if (!i) {
|
|
75
75
|
if (l) return;
|
|
76
76
|
if (n) {
|
|
77
|
-
const a = await
|
|
77
|
+
const a = await W({ licenseKey: n, pluginName: s, baseApiUrl: r });
|
|
78
78
|
a && u(a);
|
|
79
79
|
} else
|
|
80
80
|
c("The `licenseKey` option not provided");
|
|
81
81
|
}
|
|
82
82
|
}, 2e3);
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
84
|
+
async function W(e) {
|
|
85
85
|
const { licenseKey: t, pluginName: s, baseApiUrl: n } = e;
|
|
86
86
|
try {
|
|
87
87
|
return (await j({
|
|
@@ -129,7 +129,7 @@ const b = (e) => e.replaceAll('"', "").replaceAll("'", ""), v = (e) => e.include
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
return v(i);
|
|
132
|
-
},
|
|
132
|
+
}, _ = (e) => {
|
|
133
133
|
const { family: t, menu: s, axes: n } = e, o = !!n, r = Object.assign(
|
|
134
134
|
{},
|
|
135
135
|
...e.variants.map((i) => {
|
|
@@ -159,13 +159,13 @@ const b = (e) => e.replaceAll('"', "").replaceAll("'", ""), v = (e) => e.include
|
|
|
159
159
|
},
|
|
160
160
|
variants: r
|
|
161
161
|
});
|
|
162
|
-
},
|
|
162
|
+
}, K = (e) => ({
|
|
163
163
|
id: `${e.family}/${e.version}`,
|
|
164
164
|
type: "font",
|
|
165
165
|
src: e.menu,
|
|
166
166
|
name: e.family,
|
|
167
|
-
customData: { font:
|
|
168
|
-
}),
|
|
167
|
+
customData: { font: _(e), needsLoading: !0 }
|
|
168
|
+
}), V = (e) => {
|
|
169
169
|
const { font: t } = e.customData;
|
|
170
170
|
return e.customData.needsLoading ? (e.customData.needsLoading = !1, T(t)) : T(t, !0);
|
|
171
171
|
};
|
|
@@ -200,10 +200,10 @@ const H = (e) => {
|
|
|
200
200
|
...o,
|
|
201
201
|
...r
|
|
202
202
|
}, c = await (await fetch(n(i))).json();
|
|
203
|
-
return (u = c.items) != null && u.length ? (h = c.items.map(
|
|
203
|
+
return (u = c.items) != null && u.length ? (h = c.items.map(K), h) : [];
|
|
204
204
|
},
|
|
205
205
|
itemLayout: (o) => {
|
|
206
|
-
const r = h.find((l) => l.id === o.assetProps.id), i =
|
|
206
|
+
const r = h.find((l) => l.id === o.assetProps.id), i = V(r);
|
|
207
207
|
return {
|
|
208
208
|
type: "column",
|
|
209
209
|
onClick: () => o.onSelect(r),
|
|
@@ -252,21 +252,21 @@ const H = (e) => {
|
|
|
252
252
|
modalTitle: "Select Font",
|
|
253
253
|
providerLabel: "Google Fonts"
|
|
254
254
|
}
|
|
255
|
-
}, J = "googleFontsAssetProvider", Q = function(e, t) {
|
|
255
|
+
}, J = "googleFontsAssetProvider", Q = p.startup, Z = function(e, t) {
|
|
256
256
|
const { i18n: s = {} } = t, n = z(t);
|
|
257
257
|
e.runCommand(y.assetProviderAdd, { provider: n }), e.I18n.addMessages({
|
|
258
258
|
en: q,
|
|
259
259
|
...s
|
|
260
|
-
}),
|
|
260
|
+
}), N({
|
|
261
261
|
editor: e,
|
|
262
262
|
licenseKey: t.licenseKey,
|
|
263
|
-
plan:
|
|
263
|
+
plan: Q,
|
|
264
264
|
pluginName: J,
|
|
265
265
|
cleanup: () => {
|
|
266
266
|
e.runCommand(y.assetProviderRemove, { id: n.id });
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
|
-
},
|
|
269
|
+
}, S = E(Z);
|
|
270
270
|
export {
|
|
271
|
-
|
|
271
|
+
S as default
|
|
272
272
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(d=typeof globalThis<"u"?globalThis:d||self,d.StudioSdkPlugins_googleFontsAssetProvider=p())})(this,function(){"use strict";var d=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(d||{}),p=(e=>(e.toastAdd="studio:toastAdd",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.projectFiles="studio:projectFiles",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.setDragAbsolute="studio:setDragAbsolute",e))(p||{});const P="app.grapesjs.com",A="app-stage.grapesjs.com",w=[P,A,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",O="license:check:end"
|
|
1
|
+
(function(d,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(d=typeof globalThis<"u"?globalThis:d||self,d.StudioSdkPlugins_googleFontsAssetProvider=p())})(this,function(){"use strict";var d=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(d||{}),p=(e=>(e.toastAdd="studio:toastAdd",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.projectFiles="studio:projectFiles",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.setDragAbsolute="studio:setDragAbsolute",e))(p||{});const P="app.grapesjs.com",A="app-stage.grapesjs.com",w=[P,A,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",O="license:check:end",G=()=>typeof window<"u",$=({isDev:e,isStage:t})=>`${e?"":`https://${t?A:P}`}/api`,I=()=>{const e=G()&&window.location.hostname;return!!e&&(w.includes(e)||w.some(t=>e.endsWith(t)))};async function U({path:e,baseApiUrl:t,method:s="GET",headers:n={},params:o,body:a}){const l=`${t||$({isDev:!1,isStage:!1})}${e}`,c={method:s,headers:{"Content-Type":"application/json",...n}};a&&(c.body=JSON.stringify(a));const u=o?new URLSearchParams(o).toString():"",r=u?`?${u}`:"",g=await fetch(`${l}${r}`,c);if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);return g.json()}const L={[d.free]:0,[d.startup]:10,[d.business]:20,[d.enterprise]:30};function M(e){const t=e;return t.init=s=>n=>e(n,s),t}const j=e=>M(e);async function B({editor:e,plan:t,pluginName:s,licenseKey:n,cleanup:o}){let a="",i=!1;const l=I(),c=r=>{console.warn("Cleanup plugin:",s,"Reason:",r),o()},u=(r={})=>{var k;const{error:g,sdkLicense:y}=r,f=(k=r.plan)==null?void 0:k.category;if(!(y||r.license)||g)c(g||"Invalid license");else if(f){const S=L[t],J=L[f];S>J&&c({pluginRequiredPlan:t,licensePlan:f})}};e.on(D,r=>{a=r==null?void 0:r.baseApiUrl,i=!0}),e.on(O,r=>{u(r)}),setTimeout(async()=>{if(!i){if(l)return;if(n){const r=await E({licenseKey:n,pluginName:s,baseApiUrl:a});r&&u(r)}else c("The `licenseKey` option not provided")}},2e3)}async function E(e){const{licenseKey:t,pluginName:s,baseApiUrl:n}=e;try{return(await U({baseApiUrl:n,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:s}})).result||{}}catch(o){return console.error("Error during SDK license check:",o),!1}}const h=e=>e.replaceAll('"',"").replaceAll("'",""),v=e=>e.includes(",")?e:/\s/.test(e)?`"${h(e)}"`:h(e),F=(e,t,s)=>({family:e,variant:t,...s}),T=(e,t)=>{e=v(e);const{menuVariant:s,variants:n}=t;return{family:e,familyLabel:h(e),menuVariant:s&&F(v(`menuFont-${h(e)}`),"regular",s),variants:Object.assign({},...Object.entries(n).map(([o,a])=>({[o]:F(e,o,a)})))}},x=(e,t)=>{var l;const s=T(e.family,e),n=s.menuVariant??((l=Object.values(s.variants))==null?void 0:l[0]);if(!n)return"Arial, Helvetica, sans-serif";const{source:o,descriptors:a}=n,i=h(n.family);if(!t){const c=new FontFace(i,`url("${o}")`,a),u=Array.from(document.fonts.values()).filter(r=>r.family===i);for(const r of u)document.fonts.delete(r);document.fonts.add(c),c.load().catch(()=>{})}return v(i)},N=e=>{const{family:t,menu:s,axes:n}=e,o=!!n,a=Object.assign({},...e.variants.map(i=>{var r,g;let l,c;if(o){const y=n.find(f=>f.tag==="wght");if(y){const{start:f,end:R}=y;l=`${f} ${R}`}}return l||(l=((r=i.match(/\d+/))==null?void 0:r[0])??"400"),c=((g=i.match(/[a-zA-Z]+/))==null?void 0:g[0])==="italic"?"italic":void 0,{[i]:{source:e.files[i],descriptors:{style:c,weight:l}}}}));return T(t,{menuVariant:{source:s},variants:a})},W=e=>({id:`${e.family}/${e.version}`,type:"font",src:e.menu,name:e.family,customData:{font:N(e),needsLoading:!0}}),_=e=>{const{font:t}=e.customData;return e.customData.needsLoading?(e.customData.needsLoading=!1,x(t)):x(t,!0)};let b;const K=e=>{const t=[];for(const s of Object.keys(e)){let n=e[s];n&&(Array.isArray(n)?t.push(...n.map(o=>[s,o.toString()])):(n=n.toString(),t.push([s,n])))}return new URLSearchParams(t)},V=e=>{const{apiKey:t,searchParams:s}=e,n=(o={})=>{const a="https://www.googleapis.com/webfonts/v1/webfonts",i=K(o);return`${a}?${i}`};return{id:"google-fonts",types:["font"],label:({editor:o})=>o.I18n.t("googleFontsAssetProvider.providerLabel"),search:{reloadOnInput:!1},async onLoad(){var u;if(b)return b;const o={key:t,sort:"alpha",subset:"latin",capability:["WOFF2","VF"]},a=s==null?void 0:s(),i={...o,...a},c=await(await fetch(n(i))).json();return(u=c.items)!=null&&u.length?(b=c.items.map(W),b):[]},itemLayout:o=>{const a=b.find(l=>l.id===o.assetProps.id),i=_(a);return{type:"column",onClick:()=>o.onSelect(a),htmlAttrs:{title:a.name},style:{borderWidth:"1px",borderRadius:8,overflow:"hidden",cursor:"pointer"},children:[{type:"text",content:a.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:i,fontSize:"24px",paddingLeft:"8px",paddingRight:"8px"}},{type:"text",content:a.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"16px",paddingLeft:"8px",paddingRight:"8px"}}]}}}},H={googleFontsAssetProvider:{searchBtn:"Search on Google Fonts",modalTitle:"Select Font",providerLabel:"Google Fonts"}},z="googleFontsAssetProvider",q=d.startup;return j(function(e,t){const{i18n:s={}}=t,n=V(t);e.runCommand(p.assetProviderAdd,{provider:n}),e.I18n.addMessages({en:H,...s}),B({editor:e,licenseKey:t.licenseKey,plan:q,pluginName:z,cleanup:()=>{e.runCommand(p.assetProviderRemove,{id:n.id})}})})});
|
|
@@ -75,11 +75,11 @@ export interface BaseGoogleFontsSearchParams {
|
|
|
75
75
|
}
|
|
76
76
|
export interface BaseGoogleFontsAssetProviderOptions extends SDKPluginOptions {
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Google font API key. Get yours at https://console.cloud.google.com/
|
|
79
79
|
*/
|
|
80
80
|
apiKey?: string;
|
|
81
81
|
/**
|
|
82
|
-
* Override search params used for listing
|
|
82
|
+
* Override search params used for the listing.
|
|
83
83
|
*/
|
|
84
84
|
searchParams?: '__fn__';
|
|
85
85
|
i18n?: Messages;
|