@grapesjs/studio-sdk-plugins 1.0.28 → 1.0.29
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 +98 -97
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +8 -7
- package/dist/canvasFullSize/index.es.js +145 -138
- package/dist/canvasFullSize/index.umd.js +9 -8
- package/dist/canvasFullSize/typesSchema.d.ts +5 -0
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +11 -11
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +13 -13
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +192 -95
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +7577 -7242
- package/dist/index.umd.js +192 -95
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +156 -154
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/presetPrintable/index.cjs.js +4 -4
- package/dist/presetPrintable/index.es.js +59 -59
- package/dist/presetPrintable/index.umd.js +1 -1
- package/dist/prosemirror/index.cjs.js +5 -5
- package/dist/prosemirror/index.es.js +100 -100
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +10 -10
- package/dist/rteTinyMce/index.umd.js +1 -1
- package/dist/shapeDividerComponent/index.cjs.d.ts +3 -0
- package/dist/shapeDividerComponent/index.cjs.js +97 -0
- package/dist/shapeDividerComponent/index.d.ts +3 -0
- package/dist/shapeDividerComponent/index.es.d.ts +3 -0
- package/dist/shapeDividerComponent/index.es.js +427 -0
- package/dist/shapeDividerComponent/index.umd.js +97 -0
- package/dist/shapeDividerComponent/shared.d.ts +3 -0
- package/dist/shapeDividerComponent/types.d.ts +10 -0
- package/dist/shapeDividerComponent/typesSchema.d.ts +9 -0
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +130 -122
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +9 -9
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +34 -34
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
const B = "app.grapesjs.com", H = "app-stage.grapesjs.com", L = "app2.grapesjs.com", S = "app-stage2.grapesjs.com", $ = [
|
|
2
|
+
B,
|
|
3
|
+
L,
|
|
4
|
+
H,
|
|
5
|
+
S,
|
|
6
|
+
"localhost",
|
|
7
|
+
"127.0.0.1",
|
|
8
|
+
".local-credentialless.webcontainer.io",
|
|
9
|
+
// For stackblitz.com demos
|
|
10
|
+
".local.webcontainer.io",
|
|
11
|
+
// For stackblitz.com demos
|
|
12
|
+
"-sandpack.codesandbox.io"
|
|
13
|
+
// For Sandpack demos
|
|
14
|
+
], k = "license:check:start", E = "license:check:end", I = () => typeof window < "u", P = ({ isDev: e, isStage: a }) => `${e ? "" : `https://${a ? H : B}`}/api`, N = () => {
|
|
15
|
+
const e = I() && window.location.hostname;
|
|
16
|
+
return !!e && ($.includes(e) || $.some((a) => e.endsWith(a)));
|
|
17
|
+
};
|
|
18
|
+
async function D({
|
|
19
|
+
path: e,
|
|
20
|
+
baseApiUrl: a,
|
|
21
|
+
method: i = "GET",
|
|
22
|
+
headers: o = {},
|
|
23
|
+
params: p,
|
|
24
|
+
body: n
|
|
25
|
+
}) {
|
|
26
|
+
const d = `${a || P({ isDev: !1, isStage: !1 })}${e}`, s = {
|
|
27
|
+
method: i,
|
|
28
|
+
headers: {
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
...o
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
n && (s.body = JSON.stringify(n));
|
|
34
|
+
const r = p ? new URLSearchParams(p).toString() : "", l = r ? `?${r}` : "", v = await fetch(`${d}${l}`, s);
|
|
35
|
+
if (!v.ok)
|
|
36
|
+
throw new Error(`HTTP error! status: ${v.status}`);
|
|
37
|
+
return v.json();
|
|
38
|
+
}
|
|
39
|
+
var w = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(w || {});
|
|
40
|
+
const z = {
|
|
41
|
+
[w.free]: 0,
|
|
42
|
+
[w.startup]: 10,
|
|
43
|
+
[w.business]: 20,
|
|
44
|
+
[w.enterprise]: 30
|
|
45
|
+
};
|
|
46
|
+
function W(e) {
|
|
47
|
+
const a = e;
|
|
48
|
+
return a.init = (i) => (o) => e(o, i), a;
|
|
49
|
+
}
|
|
50
|
+
const _ = (e) => /* @__PURE__ */ W(e);
|
|
51
|
+
async function U({
|
|
52
|
+
editor: e,
|
|
53
|
+
plan: a,
|
|
54
|
+
pluginName: i,
|
|
55
|
+
licenseKey: o,
|
|
56
|
+
cleanup: p
|
|
57
|
+
}) {
|
|
58
|
+
let n = "", c = !1;
|
|
59
|
+
const d = N(), s = (l) => {
|
|
60
|
+
console.warn("Cleanup plugin:", i, "Reason:", l), p();
|
|
61
|
+
}, r = (l = {}) => {
|
|
62
|
+
var b;
|
|
63
|
+
const { error: v, sdkLicense: A } = l, g = (b = l.plan) == null ? void 0 : b.category;
|
|
64
|
+
if (!(A || l.license) || v)
|
|
65
|
+
s(v || "Invalid license");
|
|
66
|
+
else if (g) {
|
|
67
|
+
const m = z[a], C = z[g];
|
|
68
|
+
m > C && s({ pluginRequiredPlan: a, licensePlan: g });
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
e.on(k, (l) => {
|
|
72
|
+
n = l == null ? void 0 : l.baseApiUrl, c = !0;
|
|
73
|
+
}), e.on(E, (l) => {
|
|
74
|
+
r(l);
|
|
75
|
+
}), setTimeout(async () => {
|
|
76
|
+
if (!c) {
|
|
77
|
+
if (d) return;
|
|
78
|
+
if (o) {
|
|
79
|
+
const l = await F({ licenseKey: o, pluginName: i, baseApiUrl: n });
|
|
80
|
+
l && r(l);
|
|
81
|
+
} else
|
|
82
|
+
s("The `licenseKey` option not provided");
|
|
83
|
+
}
|
|
84
|
+
}, 2e3);
|
|
85
|
+
}
|
|
86
|
+
async function F(e) {
|
|
87
|
+
const { licenseKey: a, pluginName: i, baseApiUrl: o } = e;
|
|
88
|
+
try {
|
|
89
|
+
return (await D({
|
|
90
|
+
baseApiUrl: o,
|
|
91
|
+
path: `/sdk/${a || "na"}`,
|
|
92
|
+
method: "POST",
|
|
93
|
+
params: {
|
|
94
|
+
d: window.location.hostname,
|
|
95
|
+
pn: i
|
|
96
|
+
}
|
|
97
|
+
})).result || {};
|
|
98
|
+
} catch (p) {
|
|
99
|
+
return console.error("Error during SDK license check:", p), !1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const O = (e, a) => {
|
|
103
|
+
var i;
|
|
104
|
+
return !!((i = e == null ? void 0 : e.classList) != null && i.contains(a));
|
|
105
|
+
}, x = (e) => (a) => {
|
|
106
|
+
var i;
|
|
107
|
+
return ((i = a.getAttribute) == null ? void 0 : i.call(a, M)) === e;
|
|
108
|
+
}, R = "gjs-plg-", M = "data-type-role", Y = "shapeDividerComponent", K = w.startup, j = function(e, a = {}) {
|
|
109
|
+
const { Components: i, Blocks: o, Selectors: p } = e, n = "shape-divider", c = `${n}-cnt`, d = `${R}${n}`, s = `${R}${c}`, r = [
|
|
110
|
+
{
|
|
111
|
+
id: "tilt",
|
|
112
|
+
label: "Tilt",
|
|
113
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
114
|
+
<path d="M240 24V0L0 24h240z"/>
|
|
115
|
+
</svg>`
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "tilt-split",
|
|
119
|
+
label: "Tilt split",
|
|
120
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
121
|
+
<path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
|
|
122
|
+
<path d="M240 24V3.7L0 24h240z"/>
|
|
123
|
+
<path fill-opacity=".3" d="M240 24V2L0 24h240z"/>
|
|
124
|
+
</svg>`
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "triangle",
|
|
128
|
+
label: "Trinagle",
|
|
129
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
130
|
+
<path d="M1200 0L0 0 598.97 114.72 1200 0z"/>
|
|
131
|
+
</svg>`
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "triangle-inv",
|
|
135
|
+
label: "Trinagle inverted",
|
|
136
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
137
|
+
<path d="M598.97 114.72L0 0 0 120 1200 120 1200 0 598.97 114.72z"></path>
|
|
138
|
+
</svg>`
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "triangle-asy",
|
|
142
|
+
label: "Trinagle asymmetrical",
|
|
143
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
144
|
+
<path d="M1200 0L0 0 892.25 114.72 1200 0z"></path>
|
|
145
|
+
</svg>`
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: "book",
|
|
149
|
+
label: "Book",
|
|
150
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
151
|
+
<path d="M602.45,3.86h0S572.9,116.24,281.94,120H923C632,116.24,602.45,3.86,602.45,3.86Z"></path>
|
|
152
|
+
</svg>`
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "book-inv",
|
|
156
|
+
label: "Book inverted",
|
|
157
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
158
|
+
<path d="M1200,0H0V120H281.94C572.9,116.24,602.45,3.86,602.45,3.86h0S632,116.24,923,120h277Z" ></path>
|
|
159
|
+
</svg>`
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: "hills",
|
|
163
|
+
label: "Hills",
|
|
164
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
165
|
+
<path d="M0 0v14.2a49 49 0 0110.3-2.7c17.5-2.8 24.4 6 43.5 11.1 26.8 7.2 39.3-19.2 63.4-19.2 22.6 0 40.4 27 65 18.6 14.7-5 19-14 39.9-17.6 7-1.3 13-1.8 17.9-1V0"/>
|
|
166
|
+
</svg>`
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "hills-split",
|
|
170
|
+
label: "Hills split",
|
|
171
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
172
|
+
<path d="M0 0v14.2a49 49 0 0110.3-2.7c17.5-2.8 24.4 6 43.5 11.1 26.8 7.2 39.3-19.2 63.4-19.2 22.6 0 40.4 27 65 18.6 14.7-5 19-14 39.9-17.6 7-1.3 13-1.8 17.9-1V0"/>
|
|
173
|
+
<path fill-opacity=".3" d="M0 0v18.1a49 49 0 0115.9-4.9c17-2.3 23.8 5.2 42.5 9.7C84.5 29 96.6 6.3 120 6.3c22.1 0 39.5 23.3 63.6 16 14.2-4.3 18.5-12 38.8-15.2A62.3 62.3 0 01240 6V0"/>
|
|
174
|
+
<path fill-opacity=".3" d="M0 0v13.4c3.8-.8 7.6-1.4 10.3-1.8 17.3-2.8 24.4 6 47.2 11.1 32 7.2 35-18.1 60.7-18.1 24.1 0 45.2 23 67.4 14.6 13.2-5 19-13.7 39.4-17.4 5.5-1 10.4-1.5 15-1.3V0"/>
|
|
175
|
+
</svg>`
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "low-hills",
|
|
179
|
+
label: "Low hills",
|
|
180
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
181
|
+
<path d="M240 24V0c-51.8 0-69.9 13.2-94.7 15.6-24.7 2.4-43.9-1.2-63.8-1-19.1 0-31.2 3.6-51.3 6.5A126 126 0 010 22V24h240z"/>
|
|
182
|
+
</svg>`
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: "low-hills-split",
|
|
186
|
+
label: "Low hills split",
|
|
187
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
188
|
+
<path fill-opacity=".3" d="M240 24V0c-51.8 0-69.9 13.2-94.7 15.6-24.7 2.4-43.9-1.2-63.8-1-19.1 0-31.2 3.6-51.3 6.5A126 126 0 010 22V24h240z"/>
|
|
189
|
+
<path fill-opacity=".3" d="M240 24V2.2c-51.8 0-69.9 12-94.7 14.2-24.7 2.1-43.9-1.1-63.8-1-19.1 0-31.2 3.3-51.3 6-14.6 1.8-25.9 1.2-30.2.8V24h240z"/>
|
|
190
|
+
<path d="M240 24V3.7c-51.8 0-69.9 11.7-94.7 14-24.7 2.4-43.9-3.2-63.8-3.1-19.1 0-31.2 3.6-51.3 6.5a128 128 0 01-30.2 1V24h240z"/>
|
|
191
|
+
</svg>`
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "high-hills",
|
|
195
|
+
label: "High hills",
|
|
196
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
197
|
+
<path d="M240 0H0v23.5c4.3.5 15.5 1.2 30.2-.9 20.1-2.8 32.1-6.2 51.3-6.3 20 0 39 3.4 63.8 1 24.8-2.2 42.9-15 94.7-15"/>
|
|
198
|
+
</svg>`
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "high-hills-split",
|
|
202
|
+
label: "High hills split",
|
|
203
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
204
|
+
<path fill-opacity=".3" d="M240 0H0v23.5c4.3.5 15.5 1.2 30.2-.9 20.1-2.8 32.1-6.2 51.3-6.3 20 0 39 3.4 63.8 1 24.8-2.2 42.9-15 94.7-15"/>
|
|
205
|
+
<path fill-opacity=".3" d="M240 0H0v23.4c4.3.4 15.5 1.2 30.2-1 20.1-3.1 32.1-6.9 51.3-7 20 0 39 6 63.8 3.4C170 16.3 188.2 4 240 4"/>
|
|
206
|
+
<path d="M0 23.3c4.3.5 15.5 1.3 30.2-1 20.1-3 32.1-6.8 51.3-7 20 0 39 3.8 63.8 1.2C170 14 188.2 0 240 0H0v23.3z"/>
|
|
207
|
+
</svg>`
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "large-hill",
|
|
211
|
+
label: "One hill",
|
|
212
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
213
|
+
<path d="M0 13.2V24h240V13.3A541.2 541.2 0 00119.8 0C69.2 0 27.6 6.9 0 13.2z"/>
|
|
214
|
+
</svg>`
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "large-hill-split",
|
|
218
|
+
label: "One hill split",
|
|
219
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
220
|
+
<path fill-opacity=".3" d="M0 13.2V24h240V13.3A541.2 541.2 0 00119.8 0C69.2 0 27.6 6.9 0 13.2z"/>
|
|
221
|
+
<path fill-opacity=".3" d="M0 18.9V24h240v-5A437.4 437.4 0 00119.8 2.7C64.4 2.7 21.6 12.6 0 19z"/>
|
|
222
|
+
<path d="M119.8 5.1C47.8 5.1 0 24 0 24h240S191.8 5.1 119.8 5.1z"/>
|
|
223
|
+
</svg>`
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "pit",
|
|
227
|
+
label: "Pit",
|
|
228
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
229
|
+
<path d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
230
|
+
</svg>`
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "pit-split",
|
|
234
|
+
label: "Pit split",
|
|
235
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
236
|
+
<path fill-opacity=".3" d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
237
|
+
<path fill-opacity=".3" d="M119.8 2.7c55.6 0 98.5 10 120.2 16.2V0H0v18.9A434.6 434.6 0 01119.8 2.7z"/>
|
|
238
|
+
<path d="M119.8.1A541 541 0 01240 13.4V0H0v13.3A538.9 538.9 0 01119.8.1z"/>
|
|
239
|
+
</svg>`
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: "waves",
|
|
243
|
+
label: "Waves",
|
|
244
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
245
|
+
<path d="M240 0c-4.6-.2-9.6.4-15 1.4-20.4 3.7-26.3 12.3-39.4 17.3C163.3 27 144 4 119.9 4c-25.6 0-30.5 25.3-62.5 18-22.8-5.1-29.8-13.8-47-11-2.8.4-6.6 1-10.4 1.8V24h240V0z"/>
|
|
246
|
+
</svg>`
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "waves-split",
|
|
250
|
+
label: "Waves split",
|
|
251
|
+
value: `<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
252
|
+
<path fill-opacity=".3" d="M240 0c-4.6-.2-9.6.4-15 1.4-20.4 3.7-26.3 12.3-39.4 17.3C163.3 27 144 4 119.9 4c-25.6 0-30.5 25.3-62.5 18-22.8-5.1-29.8-13.8-47-11-2.8.4-6.6 1-10.4 1.8V24h240V0z"/>
|
|
253
|
+
<path fill-opacity=".3" d="M222 3.9c-20.8 3.7-25.1 12.6-39.8 17.6C157.6 29.9 141.5 3 118.9 3 94.7 3 80.6 29.3 53.8 22c-19-5-26-13.8-43.5-11-3.7.6-7.2 1.5-10.3 2.7V24h240V2.9c-5-.8-10.9-.3-18 1z"/>
|
|
254
|
+
<path d="M240 5.7c-4.8-.6-10.6-.2-17.5.9-20.3 3.2-24.6 10.9-38.9 15.2-24 7.3-39.7-16-61.8-16-23.5 0-37.3 22.7-63.5 16.5C39.7 18 33 10.3 16 12.7c-6.1.9-11.5 2.6-15.9 6.7V24h240V5.7z"/>
|
|
255
|
+
</svg>`
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: "windy-waves",
|
|
259
|
+
label: "Windy waves",
|
|
260
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
261
|
+
<path d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
|
|
262
|
+
</svg>`
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "windy-waves-split",
|
|
266
|
+
label: "Windy waves split",
|
|
267
|
+
value: `<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
268
|
+
<path d="M0 0v14.9C21.6 4.7 57.5 0 71 4.3c16 4.8 9.6 19.3 26 18 14.5-1 25.5-13 40.5-12.9 11 0 10.1 6.6 21.7 7.5 12.1 1 17-7 36-11.4 17.6-4.2 33.4-6.1 44.8-5V0H0z"/>
|
|
269
|
+
<path fill-opacity=".3" d="M0 16.7C19.2 5.9 55.8 1 70 5 86 10 78.4 24 94.1 22.8c14-1 27.8-12.7 42.4-12.7 10.7 0 9.1 6.5 20.5 7.4 11.9.9 16.8-6.8 34.8-11.2 19.8-4.8 36.9-5 48.1-1.7V0H0"/>
|
|
270
|
+
<path fill-opacity=".3" d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
|
|
271
|
+
</svg>`
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "zigzag",
|
|
275
|
+
label: "Zigzag",
|
|
276
|
+
value: `<svg class="${s}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
|
|
277
|
+
<path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
|
|
278
|
+
</svg>`
|
|
279
|
+
}
|
|
280
|
+
], l = {
|
|
281
|
+
tl: !1,
|
|
282
|
+
tc: !1,
|
|
283
|
+
tr: !1,
|
|
284
|
+
cl: !1,
|
|
285
|
+
cr: !1,
|
|
286
|
+
bl: !1,
|
|
287
|
+
bc: !1,
|
|
288
|
+
br: !1
|
|
289
|
+
}, v = { ...l, bc: !0 }, A = { ...l, tc: !0 }, g = "shape", y = "flip-y", b = "flip-x", m = "Shape Divider", C = `<svg viewBox="0 0 22 22">
|
|
290
|
+
<path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
|
|
291
|
+
</svg>`, { block: V = {} } = a;
|
|
292
|
+
e.on(p.events.add, (t) => {
|
|
293
|
+
t.getFullName().startsWith(`.${d}`) && t.set({ private: !0 });
|
|
294
|
+
}), i.addType(n, {
|
|
295
|
+
isComponent: (t) => x(n)(t) || O(t, d),
|
|
296
|
+
block: V && {
|
|
297
|
+
label: m,
|
|
298
|
+
media: C,
|
|
299
|
+
category: "Extra",
|
|
300
|
+
select: !0,
|
|
301
|
+
...V
|
|
302
|
+
},
|
|
303
|
+
model: {
|
|
304
|
+
defaults: {
|
|
305
|
+
droppable: !1,
|
|
306
|
+
highlightable: !1,
|
|
307
|
+
classes: d,
|
|
308
|
+
attributes: { [M]: n },
|
|
309
|
+
components: { type: c },
|
|
310
|
+
styles: `.${d} { position: relative; }`,
|
|
311
|
+
delegate: {
|
|
312
|
+
select: (t) => t.findFirstType(c),
|
|
313
|
+
layer: (t) => t.findFirstType(c)
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
view: {
|
|
318
|
+
onRender() {
|
|
319
|
+
this.el.style.height = "1px";
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}), i.addType(c, {
|
|
323
|
+
isComponent: x(c),
|
|
324
|
+
model: {
|
|
325
|
+
defaults: {
|
|
326
|
+
droppable: !1,
|
|
327
|
+
highlightable: !1,
|
|
328
|
+
classes: s,
|
|
329
|
+
emptyState: !0,
|
|
330
|
+
icon: C,
|
|
331
|
+
name: m,
|
|
332
|
+
delegate: {
|
|
333
|
+
remove: (t) => t.parent(),
|
|
334
|
+
move: (t) => t.parent(),
|
|
335
|
+
copy: (t) => t.parent()
|
|
336
|
+
},
|
|
337
|
+
attributes: { [M]: c },
|
|
338
|
+
[g]: r[0].id,
|
|
339
|
+
resizable: v,
|
|
340
|
+
stylable: ["height", "width", "color"],
|
|
341
|
+
styles: `
|
|
342
|
+
.${s} {
|
|
343
|
+
position: absolute;
|
|
344
|
+
width: 100%;
|
|
345
|
+
height: 100px;
|
|
346
|
+
color: black;
|
|
347
|
+
overflow: hidden;
|
|
348
|
+
}
|
|
349
|
+
.${s} > svg {
|
|
350
|
+
height: 100%;
|
|
351
|
+
width: 100%;
|
|
352
|
+
transform: scaleY(-1);
|
|
353
|
+
}
|
|
354
|
+
.${s}--fl-v {
|
|
355
|
+
transform: translateY(-100%);
|
|
356
|
+
}
|
|
357
|
+
.${s}--fl-v-h {
|
|
358
|
+
transform: translateY(-100%);
|
|
359
|
+
}
|
|
360
|
+
.${s}--fl-v > svg {
|
|
361
|
+
transform: scaleY(1);
|
|
362
|
+
}
|
|
363
|
+
.${s}--fl-h > svg {
|
|
364
|
+
transform: scaleX(-1) scaleY(-1);
|
|
365
|
+
}
|
|
366
|
+
.${s}--fl-v-h > svg {
|
|
367
|
+
transform: scaleY(1) scaleX(-1);
|
|
368
|
+
}
|
|
369
|
+
.${s} > svg > path {
|
|
370
|
+
fill: currentColor;
|
|
371
|
+
}
|
|
372
|
+
.${s}-inv > path {
|
|
373
|
+
transform: scale(-1, -1) translate(-100%, -100%);
|
|
374
|
+
}
|
|
375
|
+
`,
|
|
376
|
+
traits: [
|
|
377
|
+
{
|
|
378
|
+
type: "select",
|
|
379
|
+
name: g,
|
|
380
|
+
label: "Shape",
|
|
381
|
+
changeProp: !0,
|
|
382
|
+
options: r.map(({ id: t, label: u, value: h }) => ({
|
|
383
|
+
id: t,
|
|
384
|
+
label: u,
|
|
385
|
+
icon: { icon: h.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
|
|
386
|
+
}))
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
type: "checkbox",
|
|
390
|
+
name: y,
|
|
391
|
+
label: "Flip vertically",
|
|
392
|
+
changeProp: !0
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
type: "checkbox",
|
|
396
|
+
name: b,
|
|
397
|
+
label: "flip horizontally",
|
|
398
|
+
changeProp: !0
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
init() {
|
|
403
|
+
this.on(`change:${g}`, this.onShapeChange), this.on(`change:${b} change:${y}`, this.onFlip), this.onShapeChange();
|
|
404
|
+
},
|
|
405
|
+
onShapeChange() {
|
|
406
|
+
const t = this.get(g), u = r.find((f) => f.id === t), h = (u == null ? void 0 : u.value) || this.getInnerHTML().trim();
|
|
407
|
+
this.components(""), h && this.set("content", h);
|
|
408
|
+
},
|
|
409
|
+
onFlip() {
|
|
410
|
+
const t = this.get(y), u = this.get(b), h = ["fl-v", "fl-h", "fl-v-h"].map((T) => `${s}--${T}`);
|
|
411
|
+
let f;
|
|
412
|
+
t && u ? f = h[2] : u ? f = h[1] : t && (f = h[0]), this.removeClass(h), f && this.addClass(f), this.set("resizable", t ? A : v);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}), U({
|
|
416
|
+
editor: e,
|
|
417
|
+
licenseKey: a.licenseKey,
|
|
418
|
+
plan: K,
|
|
419
|
+
pluginName: Y,
|
|
420
|
+
cleanup: () => {
|
|
421
|
+
i.removeType(n), o.remove(n);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}, G = _(j);
|
|
425
|
+
export {
|
|
426
|
+
G as default
|
|
427
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
(function(b,m){typeof exports=="object"&&typeof module<"u"?module.exports=m():typeof define=="function"&&define.amd?define(m):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_shapeDividerComponent=m())})(this,function(){"use strict";const b="app.grapesjs.com",m="app-stage.grapesjs.com",z=[b,"app2.grapesjs.com",m,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],H="license:check:start",L="license:check:end",S=()=>typeof window<"u",k=({isDev:e,isStage:i})=>`${e?"":`https://${i?m:b}`}/api`,I=()=>{const e=S()&&window.location.hostname;return!!e&&(z.includes(e)||z.some(i=>e.endsWith(i)))};async function P({path:e,baseApiUrl:i,method:a="GET",headers:o={},params:p,body:n}){const d=`${i||k({isDev:!1,isStage:!1})}${e}`,s={method:a,headers:{"Content-Type":"application/json",...o}};n&&(s.body=JSON.stringify(n));const r=p?new URLSearchParams(p).toString():"",l=r?`?${r}`:"",v=await fetch(`${d}${l}`,s);if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);return v.json()}var y=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(y||{});const x={[y.free]:0,[y.startup]:10,[y.business]:20,[y.enterprise]:30};function E(e){const i=e;return i.init=a=>o=>e(o,a),i}const D=e=>E(e);async function N({editor:e,plan:i,pluginName:a,licenseKey:o,cleanup:p}){let n="",c=!1;const d=I(),s=l=>{console.warn("Cleanup plugin:",a,"Reason:",l),p()},r=(l={})=>{var w;const{error:v,sdkLicense:$}=l,g=(w=l.plan)==null?void 0:w.category;if(!($||l.license)||v)s(v||"Invalid license");else if(g){const A=x[i],M=x[g];A>M&&s({pluginRequiredPlan:i,licensePlan:g})}};e.on(H,l=>{n=l==null?void 0:l.baseApiUrl,c=!0}),e.on(L,l=>{r(l)}),setTimeout(async()=>{if(!c){if(d)return;if(o){const l=await _({licenseKey:o,pluginName:a,baseApiUrl:n});l&&r(l)}else s("The `licenseKey` option not provided")}},2e3)}async function _(e){const{licenseKey:i,pluginName:a,baseApiUrl:o}=e;try{return(await P({baseApiUrl:o,path:`/sdk/${i||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const O=(e,i)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(i))},R=e=>i=>{var a;return((a=i.getAttribute)==null?void 0:a.call(i,V))===e},T="gjs-plg-",V="data-type-role",W="shapeDividerComponent",U=y.startup;return D(function(e,i={}){const{Components:a,Blocks:o,Selectors:p}=e,n="shape-divider",c=`${n}-cnt`,d=`${T}${n}`,s=`${T}${c}`,r=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
2
|
+
<path d="M240 24V0L0 24h240z"/>
|
|
3
|
+
</svg>`},{id:"tilt-split",label:"Tilt split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
4
|
+
<path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
|
|
5
|
+
<path d="M240 24V3.7L0 24h240z"/>
|
|
6
|
+
<path fill-opacity=".3" d="M240 24V2L0 24h240z"/>
|
|
7
|
+
</svg>`},{id:"triangle",label:"Trinagle",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
8
|
+
<path d="M1200 0L0 0 598.97 114.72 1200 0z"/>
|
|
9
|
+
</svg>`},{id:"triangle-inv",label:"Trinagle inverted",value:`<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
10
|
+
<path d="M598.97 114.72L0 0 0 120 1200 120 1200 0 598.97 114.72z"></path>
|
|
11
|
+
</svg>`},{id:"triangle-asy",label:"Trinagle asymmetrical",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
12
|
+
<path d="M1200 0L0 0 892.25 114.72 1200 0z"></path>
|
|
13
|
+
</svg>`},{id:"book",label:"Book",value:`<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
14
|
+
<path d="M602.45,3.86h0S572.9,116.24,281.94,120H923C632,116.24,602.45,3.86,602.45,3.86Z"></path>
|
|
15
|
+
</svg>`},{id:"book-inv",label:"Book inverted",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
16
|
+
<path d="M1200,0H0V120H281.94C572.9,116.24,602.45,3.86,602.45,3.86h0S632,116.24,923,120h277Z" ></path>
|
|
17
|
+
</svg>`},{id:"hills",label:"Hills",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
18
|
+
<path d="M0 0v14.2a49 49 0 0110.3-2.7c17.5-2.8 24.4 6 43.5 11.1 26.8 7.2 39.3-19.2 63.4-19.2 22.6 0 40.4 27 65 18.6 14.7-5 19-14 39.9-17.6 7-1.3 13-1.8 17.9-1V0"/>
|
|
19
|
+
</svg>`},{id:"hills-split",label:"Hills split",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
20
|
+
<path d="M0 0v14.2a49 49 0 0110.3-2.7c17.5-2.8 24.4 6 43.5 11.1 26.8 7.2 39.3-19.2 63.4-19.2 22.6 0 40.4 27 65 18.6 14.7-5 19-14 39.9-17.6 7-1.3 13-1.8 17.9-1V0"/>
|
|
21
|
+
<path fill-opacity=".3" d="M0 0v18.1a49 49 0 0115.9-4.9c17-2.3 23.8 5.2 42.5 9.7C84.5 29 96.6 6.3 120 6.3c22.1 0 39.5 23.3 63.6 16 14.2-4.3 18.5-12 38.8-15.2A62.3 62.3 0 01240 6V0"/>
|
|
22
|
+
<path fill-opacity=".3" d="M0 0v13.4c3.8-.8 7.6-1.4 10.3-1.8 17.3-2.8 24.4 6 47.2 11.1 32 7.2 35-18.1 60.7-18.1 24.1 0 45.2 23 67.4 14.6 13.2-5 19-13.7 39.4-17.4 5.5-1 10.4-1.5 15-1.3V0"/>
|
|
23
|
+
</svg>`},{id:"low-hills",label:"Low hills",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
24
|
+
<path d="M240 24V0c-51.8 0-69.9 13.2-94.7 15.6-24.7 2.4-43.9-1.2-63.8-1-19.1 0-31.2 3.6-51.3 6.5A126 126 0 010 22V24h240z"/>
|
|
25
|
+
</svg>`},{id:"low-hills-split",label:"Low hills split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
26
|
+
<path fill-opacity=".3" d="M240 24V0c-51.8 0-69.9 13.2-94.7 15.6-24.7 2.4-43.9-1.2-63.8-1-19.1 0-31.2 3.6-51.3 6.5A126 126 0 010 22V24h240z"/>
|
|
27
|
+
<path fill-opacity=".3" d="M240 24V2.2c-51.8 0-69.9 12-94.7 14.2-24.7 2.1-43.9-1.1-63.8-1-19.1 0-31.2 3.3-51.3 6-14.6 1.8-25.9 1.2-30.2.8V24h240z"/>
|
|
28
|
+
<path d="M240 24V3.7c-51.8 0-69.9 11.7-94.7 14-24.7 2.4-43.9-3.2-63.8-3.1-19.1 0-31.2 3.6-51.3 6.5a128 128 0 01-30.2 1V24h240z"/>
|
|
29
|
+
</svg>`},{id:"high-hills",label:"High hills",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
30
|
+
<path d="M240 0H0v23.5c4.3.5 15.5 1.2 30.2-.9 20.1-2.8 32.1-6.2 51.3-6.3 20 0 39 3.4 63.8 1 24.8-2.2 42.9-15 94.7-15"/>
|
|
31
|
+
</svg>`},{id:"high-hills-split",label:"High hills split",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
32
|
+
<path fill-opacity=".3" d="M240 0H0v23.5c4.3.5 15.5 1.2 30.2-.9 20.1-2.8 32.1-6.2 51.3-6.3 20 0 39 3.4 63.8 1 24.8-2.2 42.9-15 94.7-15"/>
|
|
33
|
+
<path fill-opacity=".3" d="M240 0H0v23.4c4.3.4 15.5 1.2 30.2-1 20.1-3.1 32.1-6.9 51.3-7 20 0 39 6 63.8 3.4C170 16.3 188.2 4 240 4"/>
|
|
34
|
+
<path d="M0 23.3c4.3.5 15.5 1.3 30.2-1 20.1-3 32.1-6.8 51.3-7 20 0 39 3.8 63.8 1.2C170 14 188.2 0 240 0H0v23.3z"/>
|
|
35
|
+
</svg>`},{id:"large-hill",label:"One hill",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
36
|
+
<path d="M0 13.2V24h240V13.3A541.2 541.2 0 00119.8 0C69.2 0 27.6 6.9 0 13.2z"/>
|
|
37
|
+
</svg>`},{id:"large-hill-split",label:"One hill split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
38
|
+
<path fill-opacity=".3" d="M0 13.2V24h240V13.3A541.2 541.2 0 00119.8 0C69.2 0 27.6 6.9 0 13.2z"/>
|
|
39
|
+
<path fill-opacity=".3" d="M0 18.9V24h240v-5A437.4 437.4 0 00119.8 2.7C64.4 2.7 21.6 12.6 0 19z"/>
|
|
40
|
+
<path d="M119.8 5.1C47.8 5.1 0 24 0 24h240S191.8 5.1 119.8 5.1z"/>
|
|
41
|
+
</svg>`},{id:"pit",label:"Pit",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
42
|
+
<path d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
43
|
+
</svg>`},{id:"pit-split",label:"Pit split",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
44
|
+
<path fill-opacity=".3" d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
45
|
+
<path fill-opacity=".3" d="M119.8 2.7c55.6 0 98.5 10 120.2 16.2V0H0v18.9A434.6 434.6 0 01119.8 2.7z"/>
|
|
46
|
+
<path d="M119.8.1A541 541 0 01240 13.4V0H0v13.3A538.9 538.9 0 01119.8.1z"/>
|
|
47
|
+
</svg>`},{id:"waves",label:"Waves",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
48
|
+
<path d="M240 0c-4.6-.2-9.6.4-15 1.4-20.4 3.7-26.3 12.3-39.4 17.3C163.3 27 144 4 119.9 4c-25.6 0-30.5 25.3-62.5 18-22.8-5.1-29.8-13.8-47-11-2.8.4-6.6 1-10.4 1.8V24h240V0z"/>
|
|
49
|
+
</svg>`},{id:"waves-split",label:"Waves split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
50
|
+
<path fill-opacity=".3" d="M240 0c-4.6-.2-9.6.4-15 1.4-20.4 3.7-26.3 12.3-39.4 17.3C163.3 27 144 4 119.9 4c-25.6 0-30.5 25.3-62.5 18-22.8-5.1-29.8-13.8-47-11-2.8.4-6.6 1-10.4 1.8V24h240V0z"/>
|
|
51
|
+
<path fill-opacity=".3" d="M222 3.9c-20.8 3.7-25.1 12.6-39.8 17.6C157.6 29.9 141.5 3 118.9 3 94.7 3 80.6 29.3 53.8 22c-19-5-26-13.8-43.5-11-3.7.6-7.2 1.5-10.3 2.7V24h240V2.9c-5-.8-10.9-.3-18 1z"/>
|
|
52
|
+
<path d="M240 5.7c-4.8-.6-10.6-.2-17.5.9-20.3 3.2-24.6 10.9-38.9 15.2-24 7.3-39.7-16-61.8-16-23.5 0-37.3 22.7-63.5 16.5C39.7 18 33 10.3 16 12.7c-6.1.9-11.5 2.6-15.9 6.7V24h240V5.7z"/>
|
|
53
|
+
</svg>`},{id:"windy-waves",label:"Windy waves",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
54
|
+
<path d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
|
|
55
|
+
</svg>`},{id:"windy-waves-split",label:"Windy waves split",value:`<svg class="${s}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
56
|
+
<path d="M0 0v14.9C21.6 4.7 57.5 0 71 4.3c16 4.8 9.6 19.3 26 18 14.5-1 25.5-13 40.5-12.9 11 0 10.1 6.6 21.7 7.5 12.1 1 17-7 36-11.4 17.6-4.2 33.4-6.1 44.8-5V0H0z"/>
|
|
57
|
+
<path fill-opacity=".3" d="M0 16.7C19.2 5.9 55.8 1 70 5 86 10 78.4 24 94.1 22.8c14-1 27.8-12.7 42.4-12.7 10.7 0 9.1 6.5 20.5 7.4 11.9.9 16.8-6.8 34.8-11.2 19.8-4.8 36.9-5 48.1-1.7V0H0"/>
|
|
58
|
+
<path fill-opacity=".3" d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
|
|
59
|
+
</svg>`},{id:"zigzag",label:"Zigzag",value:`<svg class="${s}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
|
|
60
|
+
<path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
|
|
61
|
+
</svg>`}],l={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},v={...l,bc:!0},$={...l,tc:!0},g="shape",C="flip-y",w="flip-x",A="Shape Divider",M=`<svg viewBox="0 0 22 22">
|
|
62
|
+
<path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
|
|
63
|
+
</svg>`,{block:B={}}=i;e.on(p.events.add,t=>{t.getFullName().startsWith(`.${d}`)&&t.set({private:!0})}),a.addType(n,{isComponent:t=>R(n)(t)||O(t,d),block:B&&{label:A,media:M,category:"Extra",select:!0,...B},model:{defaults:{droppable:!1,highlightable:!1,classes:d,attributes:{[V]:n},components:{type:c},styles:`.${d} { position: relative; }`,delegate:{select:t=>t.findFirstType(c),layer:t=>t.findFirstType(c)}}},view:{onRender(){this.el.style.height="1px"}}}),a.addType(c,{isComponent:R(c),model:{defaults:{droppable:!1,highlightable:!1,classes:s,emptyState:!0,icon:M,name:A,delegate:{remove:t=>t.parent(),move:t=>t.parent(),copy:t=>t.parent()},attributes:{[V]:c},[g]:r[0].id,resizable:v,stylable:["height","width","color"],styles:`
|
|
64
|
+
.${s} {
|
|
65
|
+
position: absolute;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100px;
|
|
68
|
+
color: black;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
.${s} > svg {
|
|
72
|
+
height: 100%;
|
|
73
|
+
width: 100%;
|
|
74
|
+
transform: scaleY(-1);
|
|
75
|
+
}
|
|
76
|
+
.${s}--fl-v {
|
|
77
|
+
transform: translateY(-100%);
|
|
78
|
+
}
|
|
79
|
+
.${s}--fl-v-h {
|
|
80
|
+
transform: translateY(-100%);
|
|
81
|
+
}
|
|
82
|
+
.${s}--fl-v > svg {
|
|
83
|
+
transform: scaleY(1);
|
|
84
|
+
}
|
|
85
|
+
.${s}--fl-h > svg {
|
|
86
|
+
transform: scaleX(-1) scaleY(-1);
|
|
87
|
+
}
|
|
88
|
+
.${s}--fl-v-h > svg {
|
|
89
|
+
transform: scaleY(1) scaleX(-1);
|
|
90
|
+
}
|
|
91
|
+
.${s} > svg > path {
|
|
92
|
+
fill: currentColor;
|
|
93
|
+
}
|
|
94
|
+
.${s}-inv > path {
|
|
95
|
+
transform: scale(-1, -1) translate(-100%, -100%);
|
|
96
|
+
}
|
|
97
|
+
`,traits:[{type:"select",name:g,label:"Shape",changeProp:!0,options:r.map(({id:t,label:u,value:h})=>({id:t,label:u,icon:{icon:h.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:C,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:w,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${g}`,this.onShapeChange),this.on(`change:${w} change:${C}`,this.onFlip),this.onShapeChange()},onShapeChange(){const t=this.get(g),u=r.find(f=>f.id===t),h=(u==null?void 0:u.value)||this.getInnerHTML().trim();this.components(""),h&&this.set("content",h)},onFlip(){const t=this.get(C),u=this.get(w),h=["fl-v","fl-h","fl-v-h"].map(F=>`${s}--${F}`);let f;t&&u?f=h[2]:u?f=h[1]:t&&(f=h[0]),this.removeClass(h),f&&this.addClass(f),this.set("resizable",t?$:v)}}}),N({editor:e,licenseKey:i.licenseKey,plan:U,pluginName:W,cleanup:()=>{a.removeType(n),o.remove(n)}})})});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockProperties } from '../types';
|
|
2
|
+
import { ShapeDividerComponentOptions as ShapeDividerComponentOptionsSchema } from './typesSchema';
|
|
3
|
+
export interface ShapeDividerComponentOptions extends Omit<ShapeDividerComponentOptionsSchema, 'block'> {
|
|
4
|
+
block?: Partial<BlockProperties> | false;
|
|
5
|
+
}
|
|
6
|
+
export interface ShapeDivider {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SDKPluginOptions } from '../utils';
|
|
2
|
+
export interface ShapeDividerComponentOptions extends SDKPluginOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Additional Block properties of the shape divider component. Pass `false` to avoid adding the block.
|
|
5
|
+
* @example
|
|
6
|
+
* { category: 'Extra', label: 'My label' }
|
|
7
|
+
*/
|
|
8
|
+
block?: 'Block';
|
|
9
|
+
}
|