@grapesjs/studio-sdk-plugins 1.0.33-rc.1 → 1.0.33
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/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +161 -156
- package/dist/accordionComponent/index.umd.js +9 -9
- package/dist/aiChat/chatManager.d.ts +15 -0
- package/dist/aiChat/clientTools.d.ts +3 -3
- package/dist/aiChat/clientToolsProcessors.d.ts +14 -1
- package/dist/aiChat/components/AiChatEmptyState.d.ts +4 -6
- package/dist/aiChat/components/AiChatError.d.ts +2 -1
- package/dist/aiChat/components/AiChatHeader.d.ts +2 -1
- package/dist/aiChat/components/AiChatInput/AssetsSection.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/AttachButton.d.ts +10 -0
- package/dist/aiChat/components/AiChatInput/ContextSection.d.ts +5 -0
- package/dist/aiChat/components/AiChatInput/DictateButton.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/TextAreaWithAutoResize.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/constants.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/hooks/useSpeechToText.d.ts +15 -0
- package/dist/aiChat/components/AiChatInput/index.d.ts +37 -0
- package/dist/aiChat/components/AiChatLoadingState.d.ts +2 -1
- package/dist/aiChat/components/AiChatMessage.d.ts +21 -9
- package/dist/aiChat/components/AiChatMessages.d.ts +5 -7
- package/dist/aiChat/components/AiChatMessagesStatus.d.ts +5 -0
- package/dist/aiChat/components/AiChatPanel.d.ts +2 -3
- package/dist/aiChat/components/AiChatProvider.d.ts +14 -0
- package/dist/aiChat/components/MemoizedMarkdown.d.ts +9 -0
- package/dist/aiChat/components/index.d.ts +24 -25
- package/dist/aiChat/components/utils.d.ts +12 -4
- package/dist/aiChat/index.cjs.d.ts +5 -0
- package/dist/aiChat/index.cjs.js +453 -0
- package/dist/aiChat/index.d.ts +4 -3
- package/dist/aiChat/index.es.d.ts +5 -0
- package/dist/aiChat/index.es.js +30930 -0
- package/dist/aiChat/index.js +453 -0
- package/dist/aiChat/index.umd.js +453 -0
- package/dist/aiChat/locales/en.d.ts +64 -0
- package/dist/aiChat/server/index.cjs.d.ts +4 -0
- package/dist/aiChat/server/index.cjs.js +309 -0
- package/dist/aiChat/server/index.d.ts +0 -50
- package/dist/aiChat/server/index.es.d.ts +4 -0
- package/dist/aiChat/server/index.es.js +876 -0
- package/dist/aiChat/server/index.js +309 -0
- package/dist/aiChat/server/index.umd.js +309 -0
- package/dist/aiChat/server/stream.d.ts +0 -6
- package/dist/aiChat/server/tools.d.ts +157 -51
- package/dist/aiChat/server/types.d.ts +108 -64
- package/dist/aiChat/types.d.ts +148 -108
- package/dist/aiChat/typesSchema.d.ts +238 -25
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +174 -169
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +161 -156
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +113 -108
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +137 -132
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +4 -4
- package/dist/canvasGridMode/index.es.js +168 -163
- package/dist/canvasGridMode/index.umd.js +8 -8
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +132 -127
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +5 -5
- package/dist/dataSourceEjs/index.es.js +151 -146
- package/dist/dataSourceEjs/index.umd.js +5 -5
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +91 -86
- package/dist/dataSourceHandlebars/index.umd.js +5 -5
- package/dist/dialogComponent/index.cjs.js +16 -16
- package/dist/dialogComponent/index.es.js +117 -112
- package/dist/dialogComponent/index.umd.js +16 -16
- package/dist/flexComponent/index.cjs.js +11 -11
- package/dist/flexComponent/index.es.js +416 -411
- package/dist/flexComponent/index.umd.js +11 -11
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +152 -147
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +127 -122
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +170 -165
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +27 -22
- package/dist/index.umd.js +1 -1
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +156 -151
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +197 -192
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +86 -81
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +121 -116
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +4 -4
- package/dist/presetPrintable/index.es.js +180 -175
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +6 -6
- package/dist/prosemirror/index.es.js +128 -123
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +127 -122
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +160 -155
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +25 -25
- package/dist/shapeDividerComponent/index.es.js +127 -122
- package/dist/shapeDividerComponent/index.umd.js +25 -25
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +197 -192
- package/dist/swiperComponent/index.umd.js +9 -9
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +227 -222
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +12 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +124 -119
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +5 -2
- package/dist/aiChat/components/AiChatInput.d.ts +0 -17
- package/dist/aiChat/server/stream-utils.d.ts +0 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
B,
|
|
3
|
-
L,
|
|
1
|
+
const H = "app.grapesjs.com", T = "app-stage.grapesjs.com", R = "app2.grapesjs.com", L = "app-stage2.grapesjs.com", z = [
|
|
4
2
|
H,
|
|
5
|
-
|
|
3
|
+
R,
|
|
4
|
+
T,
|
|
5
|
+
L,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -11,102 +11,107 @@ const B = "app.grapesjs.com", H = "app-stage.grapesjs.com", L = "app2.grapesjs.c
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
], E = "license:check:start", I = "license:check:end", P = () => typeof window < "u", N = ({
|
|
15
|
+
isDev: e,
|
|
16
|
+
isStage: i,
|
|
17
|
+
isPlatform: l
|
|
18
|
+
}) => `${e ? "" : `https://${i ? T : H}`}/${l ? "platform-api" : "api"}`, k = () => {
|
|
19
|
+
const e = P() && window.location.hostname;
|
|
20
|
+
return !!e && (z.includes(e) || z.some((i) => e.endsWith(i)));
|
|
17
21
|
};
|
|
18
22
|
async function D({
|
|
19
23
|
path: e,
|
|
20
|
-
baseApiUrl:
|
|
21
|
-
method:
|
|
22
|
-
headers:
|
|
23
|
-
params:
|
|
24
|
-
body:
|
|
24
|
+
baseApiUrl: i,
|
|
25
|
+
method: l = "GET",
|
|
26
|
+
headers: c = {},
|
|
27
|
+
params: n,
|
|
28
|
+
body: o
|
|
25
29
|
}) {
|
|
26
|
-
const
|
|
27
|
-
method:
|
|
30
|
+
const v = `${i || N({ isDev: !1, isStage: !1 })}${e}`, t = {
|
|
31
|
+
method: l,
|
|
28
32
|
headers: {
|
|
29
33
|
"Content-Type": "application/json",
|
|
30
|
-
...
|
|
34
|
+
...c
|
|
31
35
|
}
|
|
32
36
|
};
|
|
33
|
-
|
|
34
|
-
const r =
|
|
35
|
-
if (!
|
|
36
|
-
throw new Error(`HTTP error! status: ${
|
|
37
|
-
return
|
|
37
|
+
o && (t.body = JSON.stringify(o));
|
|
38
|
+
const r = n ? new URLSearchParams(n).toString() : "", g = r ? `?${r}` : "", s = await fetch(`${v}${g}`, t);
|
|
39
|
+
if (!s.ok)
|
|
40
|
+
throw new Error(`HTTP error! status: ${s.status}`);
|
|
41
|
+
return s.json();
|
|
38
42
|
}
|
|
39
43
|
var w = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(w || {});
|
|
40
|
-
const
|
|
44
|
+
const C = {
|
|
41
45
|
[w.free]: 0,
|
|
42
46
|
[w.startup]: 10,
|
|
43
47
|
[w.business]: 20,
|
|
44
48
|
[w.enterprise]: 30
|
|
45
49
|
};
|
|
46
50
|
function W(e) {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
51
|
+
const i = e;
|
|
52
|
+
return i.init = (l) => (c) => e(c, l), i;
|
|
49
53
|
}
|
|
50
54
|
const _ = (e) => /* @__PURE__ */ W(e);
|
|
51
55
|
async function U({
|
|
52
56
|
editor: e,
|
|
53
|
-
plan:
|
|
54
|
-
pluginName:
|
|
55
|
-
licenseKey:
|
|
56
|
-
|
|
57
|
+
plan: i,
|
|
58
|
+
pluginName: l,
|
|
59
|
+
licenseKey: c,
|
|
60
|
+
onLicenseCheckResponse: n,
|
|
61
|
+
cleanup: o
|
|
57
62
|
}) {
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
console.warn("Cleanup plugin:",
|
|
61
|
-
},
|
|
62
|
-
var
|
|
63
|
-
const { error:
|
|
64
|
-
if (!(
|
|
65
|
-
|
|
66
|
-
else if (
|
|
67
|
-
const
|
|
68
|
-
|
|
63
|
+
let p = "", v = !1;
|
|
64
|
+
const t = k(), r = (s) => {
|
|
65
|
+
console.warn("Cleanup plugin:", l, "Reason:", s), o();
|
|
66
|
+
}, g = (s = {}) => {
|
|
67
|
+
var y;
|
|
68
|
+
const { error: m, sdkLicense: b } = s, f = (y = s.plan) == null ? void 0 : y.category;
|
|
69
|
+
if (!(b || s.license) || m)
|
|
70
|
+
r(m || "Invalid license");
|
|
71
|
+
else if (f) {
|
|
72
|
+
const M = C[i], V = C[f];
|
|
73
|
+
M > V && r({ pluginRequiredPlan: i, licensePlan: f });
|
|
69
74
|
}
|
|
70
75
|
};
|
|
71
|
-
e.on(
|
|
72
|
-
|
|
73
|
-
}), e.on(
|
|
74
|
-
|
|
76
|
+
e.on(E, (s) => {
|
|
77
|
+
p = s == null ? void 0 : s.baseApiUrl, v = !0;
|
|
78
|
+
}), e.on(I, (s) => {
|
|
79
|
+
n == null || n(s), g(s);
|
|
75
80
|
}), setTimeout(async () => {
|
|
76
|
-
if (!
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
+
if (!v) {
|
|
82
|
+
if (t) return;
|
|
83
|
+
if (c) {
|
|
84
|
+
const s = await F({ licenseKey: c, pluginName: l, baseApiUrl: p });
|
|
85
|
+
n == null || n(s), s && g(s);
|
|
81
86
|
} else
|
|
82
|
-
|
|
87
|
+
r("The `licenseKey` option not provided");
|
|
83
88
|
}
|
|
84
89
|
}, 2e3);
|
|
85
90
|
}
|
|
86
91
|
async function F(e) {
|
|
87
|
-
const { licenseKey:
|
|
92
|
+
const { licenseKey: i, pluginName: l, baseApiUrl: c } = e;
|
|
88
93
|
try {
|
|
89
94
|
return (await D({
|
|
90
|
-
baseApiUrl:
|
|
91
|
-
path: `/sdk/${
|
|
95
|
+
baseApiUrl: c,
|
|
96
|
+
path: `/sdk/${i || "na"}`,
|
|
92
97
|
method: "POST",
|
|
93
98
|
params: {
|
|
94
99
|
d: window.location.hostname,
|
|
95
|
-
pn:
|
|
100
|
+
pn: l
|
|
96
101
|
}
|
|
97
102
|
})).result || {};
|
|
98
|
-
} catch (
|
|
99
|
-
return console.error("Error during SDK license check:",
|
|
103
|
+
} catch (n) {
|
|
104
|
+
return console.error("Error during SDK license check:", n), !1;
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
const O = (e,
|
|
103
|
-
var
|
|
104
|
-
return !!((
|
|
105
|
-
}, x = (e) => (
|
|
106
|
-
var
|
|
107
|
-
return ((
|
|
108
|
-
},
|
|
109
|
-
const { Components:
|
|
107
|
+
const O = (e, i) => {
|
|
108
|
+
var l;
|
|
109
|
+
return !!((l = e == null ? void 0 : e.classList) != null && l.contains(i));
|
|
110
|
+
}, x = (e) => (i) => {
|
|
111
|
+
var l;
|
|
112
|
+
return ((l = i.getAttribute) == null ? void 0 : l.call(i, $)) === e;
|
|
113
|
+
}, B = "gjs-plg-", $ = "data-type-role", Y = "shapeDividerComponent", K = w.startup, j = function(e, i = {}) {
|
|
114
|
+
const { Components: l, Blocks: c, Selectors: n } = e, o = "shape-divider", p = `${o}-cnt`, v = `${B}${o}`, t = `${B}${p}`, r = [
|
|
110
115
|
{
|
|
111
116
|
id: "tilt",
|
|
112
117
|
label: "Tilt",
|
|
@@ -126,7 +131,7 @@ const O = (e, a) => {
|
|
|
126
131
|
{
|
|
127
132
|
id: "triangle",
|
|
128
133
|
label: "Trinagle",
|
|
129
|
-
value: `<svg class="${
|
|
134
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
130
135
|
<path d="M1200 0L0 0 598.97 114.72 1200 0z"/>
|
|
131
136
|
</svg>`
|
|
132
137
|
},
|
|
@@ -140,7 +145,7 @@ const O = (e, a) => {
|
|
|
140
145
|
{
|
|
141
146
|
id: "triangle-asy",
|
|
142
147
|
label: "Trinagle asymmetrical",
|
|
143
|
-
value: `<svg class="${
|
|
148
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
144
149
|
<path d="M1200 0L0 0 892.25 114.72 1200 0z"></path>
|
|
145
150
|
</svg>`
|
|
146
151
|
},
|
|
@@ -154,21 +159,21 @@ const O = (e, a) => {
|
|
|
154
159
|
{
|
|
155
160
|
id: "book-inv",
|
|
156
161
|
label: "Book inverted",
|
|
157
|
-
value: `<svg class="${
|
|
162
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
158
163
|
<path d="M1200,0H0V120H281.94C572.9,116.24,602.45,3.86,602.45,3.86h0S632,116.24,923,120h277Z" ></path>
|
|
159
164
|
</svg>`
|
|
160
165
|
},
|
|
161
166
|
{
|
|
162
167
|
id: "hills",
|
|
163
168
|
label: "Hills",
|
|
164
|
-
value: `<svg class="${
|
|
169
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
165
170
|
<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
171
|
</svg>`
|
|
167
172
|
},
|
|
168
173
|
{
|
|
169
174
|
id: "hills-split",
|
|
170
175
|
label: "Hills split",
|
|
171
|
-
value: `<svg class="${
|
|
176
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
172
177
|
<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
178
|
<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
179
|
<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"/>
|
|
@@ -193,14 +198,14 @@ const O = (e, a) => {
|
|
|
193
198
|
{
|
|
194
199
|
id: "high-hills",
|
|
195
200
|
label: "High hills",
|
|
196
|
-
value: `<svg class="${
|
|
201
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
197
202
|
<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
203
|
</svg>`
|
|
199
204
|
},
|
|
200
205
|
{
|
|
201
206
|
id: "high-hills-split",
|
|
202
207
|
label: "High hills split",
|
|
203
|
-
value: `<svg class="${
|
|
208
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
204
209
|
<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
210
|
<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
211
|
<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"/>
|
|
@@ -225,14 +230,14 @@ const O = (e, a) => {
|
|
|
225
230
|
{
|
|
226
231
|
id: "pit",
|
|
227
232
|
label: "Pit",
|
|
228
|
-
value: `<svg class="${
|
|
233
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
229
234
|
<path d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
230
235
|
</svg>`
|
|
231
236
|
},
|
|
232
237
|
{
|
|
233
238
|
id: "pit-split",
|
|
234
239
|
label: "Pit split",
|
|
235
|
-
value: `<svg class="${
|
|
240
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
236
241
|
<path fill-opacity=".3" d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
237
242
|
<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
243
|
<path d="M119.8.1A541 541 0 01240 13.4V0H0v13.3A538.9 538.9 0 01119.8.1z"/>
|
|
@@ -257,14 +262,14 @@ const O = (e, a) => {
|
|
|
257
262
|
{
|
|
258
263
|
id: "windy-waves",
|
|
259
264
|
label: "Windy waves",
|
|
260
|
-
value: `<svg class="${
|
|
265
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
261
266
|
<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
267
|
</svg>`
|
|
263
268
|
},
|
|
264
269
|
{
|
|
265
270
|
id: "windy-waves-split",
|
|
266
271
|
label: "Windy waves split",
|
|
267
|
-
value: `<svg class="${
|
|
272
|
+
value: `<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
268
273
|
<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
274
|
<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
275
|
<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"/>
|
|
@@ -273,11 +278,11 @@ const O = (e, a) => {
|
|
|
273
278
|
{
|
|
274
279
|
id: "zigzag",
|
|
275
280
|
label: "Zigzag",
|
|
276
|
-
value: `<svg class="${
|
|
281
|
+
value: `<svg class="${t}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
|
|
277
282
|
<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
283
|
</svg>`
|
|
279
284
|
}
|
|
280
|
-
],
|
|
285
|
+
], g = {
|
|
281
286
|
tl: !1,
|
|
282
287
|
tc: !1,
|
|
283
288
|
tr: !1,
|
|
@@ -286,16 +291,16 @@ const O = (e, a) => {
|
|
|
286
291
|
bl: !1,
|
|
287
292
|
bc: !1,
|
|
288
293
|
br: !1
|
|
289
|
-
},
|
|
294
|
+
}, s = { ...g, bc: !0 }, m = { ...g, tc: !0 }, b = "shape", f = "flip-y", A = "flip-x", y = "Shape Divider", M = `<svg viewBox="0 0 22 22">
|
|
290
295
|
<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 = {} } =
|
|
292
|
-
e.on(
|
|
293
|
-
|
|
294
|
-
}),
|
|
295
|
-
isComponent: (
|
|
296
|
+
</svg>`, { block: V = {} } = i;
|
|
297
|
+
e.on(n.events.add, (a) => {
|
|
298
|
+
a.getFullName().startsWith(`.${v}`) && a.set({ private: !0 });
|
|
299
|
+
}), l.addType(o, {
|
|
300
|
+
isComponent: (a) => x(o)(a) || O(a, v),
|
|
296
301
|
block: V && {
|
|
297
|
-
label:
|
|
298
|
-
media:
|
|
302
|
+
label: y,
|
|
303
|
+
media: M,
|
|
299
304
|
category: "Extra",
|
|
300
305
|
select: !0,
|
|
301
306
|
...V
|
|
@@ -304,13 +309,13 @@ const O = (e, a) => {
|
|
|
304
309
|
defaults: {
|
|
305
310
|
droppable: !1,
|
|
306
311
|
highlightable: !1,
|
|
307
|
-
classes:
|
|
308
|
-
attributes: { [
|
|
309
|
-
components: { type:
|
|
310
|
-
styles: `.${
|
|
312
|
+
classes: v,
|
|
313
|
+
attributes: { [$]: o },
|
|
314
|
+
components: { type: p },
|
|
315
|
+
styles: `.${v} { position: relative; }`,
|
|
311
316
|
delegate: {
|
|
312
|
-
select: (
|
|
313
|
-
layer: (
|
|
317
|
+
select: (a) => a.findFirstType(p),
|
|
318
|
+
layer: (a) => a.findFirstType(p)
|
|
314
319
|
}
|
|
315
320
|
}
|
|
316
321
|
},
|
|
@@ -319,106 +324,106 @@ const O = (e, a) => {
|
|
|
319
324
|
this.el.style.height = "1px";
|
|
320
325
|
}
|
|
321
326
|
}
|
|
322
|
-
}),
|
|
323
|
-
isComponent: x(
|
|
327
|
+
}), l.addType(p, {
|
|
328
|
+
isComponent: x(p),
|
|
324
329
|
model: {
|
|
325
330
|
defaults: {
|
|
326
331
|
droppable: !1,
|
|
327
332
|
highlightable: !1,
|
|
328
|
-
classes:
|
|
333
|
+
classes: t,
|
|
329
334
|
emptyState: !0,
|
|
330
|
-
icon:
|
|
331
|
-
name:
|
|
335
|
+
icon: M,
|
|
336
|
+
name: y,
|
|
332
337
|
delegate: {
|
|
333
|
-
remove: (
|
|
334
|
-
move: (
|
|
335
|
-
copy: (
|
|
338
|
+
remove: (a) => a.parent(),
|
|
339
|
+
move: (a) => a.parent(),
|
|
340
|
+
copy: (a) => a.parent()
|
|
336
341
|
},
|
|
337
|
-
attributes: { [
|
|
338
|
-
[
|
|
339
|
-
resizable:
|
|
342
|
+
attributes: { [$]: p },
|
|
343
|
+
[b]: r[0].id,
|
|
344
|
+
resizable: s,
|
|
340
345
|
stylable: ["height", "width", "color"],
|
|
341
346
|
styles: `
|
|
342
|
-
.${
|
|
347
|
+
.${t} {
|
|
343
348
|
position: absolute;
|
|
344
349
|
width: 100%;
|
|
345
350
|
height: 100px;
|
|
346
351
|
color: black;
|
|
347
352
|
overflow: hidden;
|
|
348
353
|
}
|
|
349
|
-
.${
|
|
354
|
+
.${t} > svg {
|
|
350
355
|
height: 100%;
|
|
351
356
|
width: 100%;
|
|
352
357
|
transform: scaleY(-1);
|
|
353
358
|
}
|
|
354
|
-
.${
|
|
359
|
+
.${t}--fl-v {
|
|
355
360
|
transform: translateY(-100%);
|
|
356
361
|
}
|
|
357
|
-
.${
|
|
362
|
+
.${t}--fl-v-h {
|
|
358
363
|
transform: translateY(-100%);
|
|
359
364
|
}
|
|
360
|
-
.${
|
|
365
|
+
.${t}--fl-v > svg {
|
|
361
366
|
transform: scaleY(1);
|
|
362
367
|
}
|
|
363
|
-
.${
|
|
368
|
+
.${t}--fl-h > svg {
|
|
364
369
|
transform: scaleX(-1) scaleY(-1);
|
|
365
370
|
}
|
|
366
|
-
.${
|
|
371
|
+
.${t}--fl-v-h > svg {
|
|
367
372
|
transform: scaleY(1) scaleX(-1);
|
|
368
373
|
}
|
|
369
|
-
.${
|
|
374
|
+
.${t} > svg > path {
|
|
370
375
|
fill: currentColor;
|
|
371
376
|
}
|
|
372
|
-
.${
|
|
377
|
+
.${t}-inv > path {
|
|
373
378
|
transform: scale(-1, -1) translate(-100%, -100%);
|
|
374
379
|
}
|
|
375
380
|
`,
|
|
376
381
|
traits: [
|
|
377
382
|
{
|
|
378
383
|
type: "select",
|
|
379
|
-
name:
|
|
384
|
+
name: b,
|
|
380
385
|
label: "Shape",
|
|
381
386
|
changeProp: !0,
|
|
382
|
-
options: r.map(({ id:
|
|
383
|
-
id:
|
|
384
|
-
label:
|
|
387
|
+
options: r.map(({ id: a, label: d, value: h }) => ({
|
|
388
|
+
id: a,
|
|
389
|
+
label: d,
|
|
385
390
|
icon: { icon: h.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
|
|
386
391
|
}))
|
|
387
392
|
},
|
|
388
393
|
{
|
|
389
394
|
type: "checkbox",
|
|
390
|
-
name:
|
|
395
|
+
name: f,
|
|
391
396
|
label: "Flip vertically",
|
|
392
397
|
changeProp: !0
|
|
393
398
|
},
|
|
394
399
|
{
|
|
395
400
|
type: "checkbox",
|
|
396
|
-
name:
|
|
401
|
+
name: A,
|
|
397
402
|
label: "flip horizontally",
|
|
398
403
|
changeProp: !0
|
|
399
404
|
}
|
|
400
405
|
]
|
|
401
406
|
},
|
|
402
407
|
init() {
|
|
403
|
-
this.on(`change:${
|
|
408
|
+
this.on(`change:${b}`, this.onShapeChange), this.on(`change:${A} change:${f}`, this.onFlip), this.onShapeChange();
|
|
404
409
|
},
|
|
405
410
|
onShapeChange() {
|
|
406
|
-
const
|
|
411
|
+
const a = this.get(b), d = r.find((u) => u.id === a), h = (d == null ? void 0 : d.value) || this.getInnerHTML().trim();
|
|
407
412
|
this.components(""), h && this.set("content", h);
|
|
408
413
|
},
|
|
409
414
|
onFlip() {
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
|
|
415
|
+
const a = this.get(f), d = this.get(A), h = ["fl-v", "fl-h", "fl-v-h"].map((S) => `${t}--${S}`);
|
|
416
|
+
let u;
|
|
417
|
+
a && d ? u = h[2] : d ? u = h[1] : a && (u = h[0]), this.removeClass(h), u && this.addClass(u), this.set("resizable", a ? m : s);
|
|
413
418
|
}
|
|
414
419
|
}
|
|
415
420
|
}), U({
|
|
416
421
|
editor: e,
|
|
417
|
-
licenseKey:
|
|
422
|
+
licenseKey: i.licenseKey,
|
|
418
423
|
plan: K,
|
|
419
424
|
pluginName: Y,
|
|
420
425
|
cleanup: () => {
|
|
421
|
-
|
|
426
|
+
l.removeType(o), c.remove(o);
|
|
422
427
|
}
|
|
423
428
|
});
|
|
424
429
|
}, G = _(j);
|
|
@@ -1,22 +1,22 @@
|
|
|
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",
|
|
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",x=[b,"app2.grapesjs.com",m,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",R="license:check:end",I=()=>typeof window<"u",P=({isDev:e,isStage:a,isPlatform:l})=>`${e?"":`https://${a?m:b}`}/${l?"platform-api":"api"}`,E=()=>{const e=I()&&window.location.hostname;return!!e&&(x.includes(e)||x.some(a=>e.endsWith(a)))};async function L({path:e,baseApiUrl:a,method:l="GET",headers:c={},params:n,body:o}){const v=`${a||P({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...c}};o&&(t.body=JSON.stringify(o));const r=n?new URLSearchParams(n).toString():"",g=r?`?${r}`:"",s=await fetch(`${v}${g}`,t);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var y=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(y||{});const T={[y.free]:0,[y.startup]:10,[y.business]:20,[y.enterprise]:30};function D(e){const a=e;return a.init=l=>c=>e(c,l),a}const N=e=>D(e);async function _({editor:e,plan:a,pluginName:l,licenseKey:c,onLicenseCheckResponse:n,cleanup:o}){let p="",v=!1;const t=E(),r=s=>{console.warn("Cleanup plugin:",l,"Reason:",s),o()},g=(s={})=>{var A;const{error:M,sdkLicense:w}=s,u=(A=s.plan)==null?void 0:A.category;if(!(w||s.license)||M)r(M||"Invalid license");else if(u){const $=T[a],z=T[u];$>z&&r({pluginRequiredPlan:a,licensePlan:u})}};e.on(S,s=>{p=s==null?void 0:s.baseApiUrl,v=!0}),e.on(R,s=>{n==null||n(s),g(s)}),setTimeout(async()=>{if(!v){if(t)return;if(c){const s=await k({licenseKey:c,pluginName:l,baseApiUrl:p});n==null||n(s),s&&g(s)}else r("The `licenseKey` option not provided")}},2e3)}async function k(e){const{licenseKey:a,pluginName:l,baseApiUrl:c}=e;try{return(await L({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const O=(e,a)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(a))},B=e=>a=>{var l;return((l=a.getAttribute)==null?void 0:l.call(a,C))===e},H="gjs-plg-",C="data-type-role",W="shapeDividerComponent",U=y.startup;return N(function(e,a={}){const{Components:l,Blocks:c,Selectors:n}=e,o="shape-divider",p=`${o}-cnt`,v=`${H}${o}`,t=`${H}${p}`,r=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
2
2
|
<path d="M240 24V0L0 24h240z"/>
|
|
3
3
|
</svg>`},{id:"tilt-split",label:"Tilt split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
4
4
|
<path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
|
|
5
5
|
<path d="M240 24V3.7L0 24h240z"/>
|
|
6
6
|
<path fill-opacity=".3" d="M240 24V2L0 24h240z"/>
|
|
7
|
-
</svg>`},{id:"triangle",label:"Trinagle",value:`<svg class="${
|
|
7
|
+
</svg>`},{id:"triangle",label:"Trinagle",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
8
8
|
<path d="M1200 0L0 0 598.97 114.72 1200 0z"/>
|
|
9
9
|
</svg>`},{id:"triangle-inv",label:"Trinagle inverted",value:`<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
10
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="${
|
|
11
|
+
</svg>`},{id:"triangle-asy",label:"Trinagle asymmetrical",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
12
12
|
<path d="M1200 0L0 0 892.25 114.72 1200 0z"></path>
|
|
13
13
|
</svg>`},{id:"book",label:"Book",value:`<svg preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
14
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="${
|
|
15
|
+
</svg>`},{id:"book-inv",label:"Book inverted",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 1200 120">
|
|
16
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="${
|
|
17
|
+
</svg>`},{id:"hills",label:"Hills",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
18
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="${
|
|
19
|
+
</svg>`},{id:"hills-split",label:"Hills split",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
20
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
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
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"/>
|
|
@@ -26,9 +26,9 @@
|
|
|
26
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
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
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="${
|
|
29
|
+
</svg>`},{id:"high-hills",label:"High hills",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
30
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="${
|
|
31
|
+
</svg>`},{id:"high-hills-split",label:"High hills split",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
32
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
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
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"/>
|
|
@@ -38,9 +38,9 @@
|
|
|
38
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
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
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="${
|
|
41
|
+
</svg>`},{id:"pit",label:"Pit",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
42
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="${
|
|
43
|
+
</svg>`},{id:"pit-split",label:"Pit split",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
44
44
|
<path fill-opacity=".3" d="M240 24V0H0v24S47.9 5.1 119.8 5.1C191.8 5.1 240 24 240 24z"/>
|
|
45
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
46
|
<path d="M119.8.1A541 541 0 01240 13.4V0H0v13.3A538.9 538.9 0 01119.8.1z"/>
|
|
@@ -50,48 +50,48 @@
|
|
|
50
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
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
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="${
|
|
53
|
+
</svg>`},{id:"windy-waves",label:"Windy waves",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
54
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="${
|
|
55
|
+
</svg>`},{id:"windy-waves-split",label:"Windy waves split",value:`<svg class="${t}-inv" preserveAspectRatio="none" viewBox="0 0 240 24">
|
|
56
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
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
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="${
|
|
59
|
+
</svg>`},{id:"zigzag",label:"Zigzag",value:`<svg class="${t}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
|
|
60
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>`}],
|
|
61
|
+
</svg>`}],g={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},s={...g,bc:!0},M={...g,tc:!0},w="shape",u="flip-y",V="flip-x",A="Shape Divider",$=`<svg viewBox="0 0 22 22">
|
|
62
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:
|
|
64
|
-
.${
|
|
63
|
+
</svg>`,{block:z={}}=a;e.on(n.events.add,i=>{i.getFullName().startsWith(`.${v}`)&&i.set({private:!0})}),l.addType(o,{isComponent:i=>B(o)(i)||O(i,v),block:z&&{label:A,media:$,category:"Extra",select:!0,...z},model:{defaults:{droppable:!1,highlightable:!1,classes:v,attributes:{[C]:o},components:{type:p},styles:`.${v} { position: relative; }`,delegate:{select:i=>i.findFirstType(p),layer:i=>i.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(p,{isComponent:B(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:$,name:A,delegate:{remove:i=>i.parent(),move:i=>i.parent(),copy:i=>i.parent()},attributes:{[C]:p},[w]:r[0].id,resizable:s,stylable:["height","width","color"],styles:`
|
|
64
|
+
.${t} {
|
|
65
65
|
position: absolute;
|
|
66
66
|
width: 100%;
|
|
67
67
|
height: 100px;
|
|
68
68
|
color: black;
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
}
|
|
71
|
-
.${
|
|
71
|
+
.${t} > svg {
|
|
72
72
|
height: 100%;
|
|
73
73
|
width: 100%;
|
|
74
74
|
transform: scaleY(-1);
|
|
75
75
|
}
|
|
76
|
-
.${
|
|
76
|
+
.${t}--fl-v {
|
|
77
77
|
transform: translateY(-100%);
|
|
78
78
|
}
|
|
79
|
-
.${
|
|
79
|
+
.${t}--fl-v-h {
|
|
80
80
|
transform: translateY(-100%);
|
|
81
81
|
}
|
|
82
|
-
.${
|
|
82
|
+
.${t}--fl-v > svg {
|
|
83
83
|
transform: scaleY(1);
|
|
84
84
|
}
|
|
85
|
-
.${
|
|
85
|
+
.${t}--fl-h > svg {
|
|
86
86
|
transform: scaleX(-1) scaleY(-1);
|
|
87
87
|
}
|
|
88
|
-
.${
|
|
88
|
+
.${t}--fl-v-h > svg {
|
|
89
89
|
transform: scaleY(1) scaleX(-1);
|
|
90
90
|
}
|
|
91
|
-
.${
|
|
91
|
+
.${t} > svg > path {
|
|
92
92
|
fill: currentColor;
|
|
93
93
|
}
|
|
94
|
-
.${
|
|
94
|
+
.${t}-inv > path {
|
|
95
95
|
transform: scale(-1, -1) translate(-100%, -100%);
|
|
96
96
|
}
|
|
97
|
-
`,traits:[{type:"select",name:
|
|
97
|
+
`,traits:[{type:"select",name:w,label:"Shape",changeProp:!0,options:r.map(({id:i,label:d,value:h})=>({id:i,label:d,icon:{icon:h.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:V,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${w}`,this.onShapeChange),this.on(`change:${V} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const i=this.get(w),d=r.find(f=>f.id===i),h=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),h&&this.set("content",h)},onFlip(){const i=this.get(u),d=this.get(V),h=["fl-v","fl-h","fl-v-h"].map(F=>`${t}--${F}`);let f;i&&d?f=h[2]:d?f=h[1]:i&&(f=h[0]),this.removeClass(h),f&&this.addClass(f),this.set("resizable",i?M:s)}}}),_({editor:e,licenseKey:a.licenseKey,plan:U,pluginName:W,cleanup:()=>{l.removeType(o),c.remove(o)}})})});
|