@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36
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 +175 -162
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/index.cjs.js +64 -64
- package/dist/aiChat/index.es.js +5785 -5757
- package/dist/aiChat/index.js +64 -64
- package/dist/aiChat/index.umd.js +63 -63
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +204 -191
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +183 -170
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +134 -121
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +165 -152
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +245 -232
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +155 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +257 -244
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +216 -203
- package/dist/dataSourceHandlebars/index.umd.js +7 -7
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +141 -128
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +484 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +173 -160
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +160 -147
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +196 -183
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +121 -108
- package/dist/index.umd.js +18 -18
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +157 -144
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -232
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +106 -93
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +157 -144
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +181 -168
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +385 -372
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +200 -187
- 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 +118 -105
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +129 -116
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +203 -190
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +257 -244
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +121 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
H,
|
|
3
|
-
nt,
|
|
1
|
+
const Y = "app.grapesjs.com", H = "app-stage.grapesjs.com", rt = "app2.grapesjs.com", st = "app-stage2.grapesjs.com", j = [
|
|
4
2
|
Y,
|
|
5
3
|
rt,
|
|
4
|
+
H,
|
|
5
|
+
st,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -11,15 +11,15 @@ const H = "app.grapesjs.com", Y = "app-stage.grapesjs.com", nt = "app2.grapesjs.
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
14
|
+
], at = "license:check:end", it = () => typeof window < "u", lt = ({
|
|
15
15
|
isDev: t,
|
|
16
16
|
isStage: e,
|
|
17
17
|
isPlatform: r
|
|
18
|
-
}) => `${t ? "" : `https://${e ?
|
|
18
|
+
}) => `${t ? "" : `https://${e ? H : Y}`}/${r ? "platform-api" : "api"}`, ct = () => {
|
|
19
19
|
const t = it() && window.location.hostname;
|
|
20
|
-
return !!t && (
|
|
20
|
+
return !!t && (j.includes(t) || j.some((e) => t.endsWith(e)));
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function X(t) {
|
|
23
23
|
return typeof t == "function";
|
|
24
24
|
}
|
|
25
25
|
async function pt({
|
|
@@ -30,21 +30,21 @@ async function pt({
|
|
|
30
30
|
params: o,
|
|
31
31
|
body: i
|
|
32
32
|
}) {
|
|
33
|
-
const
|
|
33
|
+
const a = `${e || lt({ isDev: !1, isStage: !1 })}${t}`, p = {
|
|
34
34
|
method: r,
|
|
35
35
|
headers: {
|
|
36
36
|
"Content-Type": "application/json",
|
|
37
37
|
...n
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
i && (
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
throw new Error(`HTTP error! status: ${
|
|
44
|
-
return
|
|
40
|
+
i && (p.body = JSON.stringify(i));
|
|
41
|
+
const d = o ? new URLSearchParams(o).toString() : "", c = d ? `?${d}` : "", l = await fetch(`${a}${c}`, p);
|
|
42
|
+
if (!l.ok)
|
|
43
|
+
throw new Error(`HTTP error! status: ${l.status}`);
|
|
44
|
+
return l.json();
|
|
45
45
|
}
|
|
46
|
-
var G = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(G || {});
|
|
47
|
-
const
|
|
46
|
+
var G = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(G || {}), _ = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", t.dialogExportCode = "studio:dialogExportCode", t.dialogImportCode = "studio:dialogImportCode", t.sidebarLeftSet = "studio:sidebarLeft:set", t.sidebarLeftGet = "studio:sidebarLeft:get", t.sidebarLeftToggle = "studio:sidebarLeft:toggle", t.sidebarRightSet = "studio:sidebarRight:set", t.sidebarRightGet = "studio:sidebarRight:get", t.sidebarRightToggle = "studio:sidebarRight:toggle", t.sidebarTopSet = "studio:sidebarTop:set", t.sidebarTopGet = "studio:sidebarTop:get", t.sidebarTopToggle = "studio:sidebarTop:toggle", t.sidebarBottomSet = "studio:sidebarBottom:set", t.sidebarBottomGet = "studio:sidebarBottom:get", t.sidebarBottomToggle = "studio:sidebarBottom:toggle", t.symbolAdd = "studio:symbolAdd", t.symbolDetach = "studio:symbolDetach", t.symbolOverride = "studio:symbolOverride", t.symbolPropagateStyles = "studio:propagateStyles", t.getPagesConfig = "studio:getPagesConfig", t.setPagesConfig = "studio:setPagesConfig", t.getPageSettings = "studio:getPageSettings", t.setPageSettings = "studio:setPageSettings", t.clearPage = "studio:clearPage", t.projectFiles = "studio:projectFiles", t.validateCode = "studio:validateCode", t.canvasReload = "studio:canvasReload", t.getBlocksPanel = "studio:getBlocksPanel", t.setBlocksPanel = "studio:setBlocksPanel", t.getStateContextMenu = "studio:getStateContextMenu", t.setStateContextMenu = "studio:setStateContextMenu", t.contextMenuComponent = "studio:contextMenuComponent", t.layoutAdd = "studio:layoutAdd", t.layoutRemove = "studio:layoutRemove", t.layoutToggle = "studio:layoutToggle", t.layoutUpdate = "studio:layoutUpdate", t.layoutGet = "studio:layoutGet", t.layoutConfigGet = "studio:layoutConfigGet", t.layoutConfigSet = "studio:layoutConfigSet", t.layoutComponentAdd = "studio:layoutComponentAdd", t.layoutComponentGet = "studio:layoutComponentGet", t.layoutComponentRemove = "studio:layoutComponentRemove", t.layoutComponentRender = "studio:layoutComponentRender", t.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", t.settings = "studio:settings", t.assetProviderGet = "studio:assetProviderGet", t.assetProviderAdd = "studio:assetProviderAdd", t.assetProviderRemove = "studio:assetProviderRemove", t.fontGet = "studio:fontGet", t.fontAdd = "studio:fontAdd", t.fontRemove = "studio:fontRemove", t.fontManagerOpen = "studio:fontManagerOpen", t.menuFontLoad = "studio:menuFontLoad", t.toggleStateDataSource = "studio:toggleStateDataSource", t.getStateDataSource = "studio:getStateDataSource", t.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", t.dataSourceSetImporter = "studio:dataSourceSetImporter", t.dataSourceSetExporter = "studio:dataSourceSetExporter", t.setDragAbsolute = "studio:setDragAbsolute", t))(_ || {});
|
|
47
|
+
const W = {
|
|
48
48
|
[G.free]: 0,
|
|
49
49
|
[G.startup]: 10,
|
|
50
50
|
[G.business]: 20,
|
|
@@ -54,8 +54,8 @@ function dt(t) {
|
|
|
54
54
|
const e = t;
|
|
55
55
|
return e.init = (r) => (n) => t(n, r), e;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
async function
|
|
57
|
+
const gt = (t) => /* @__PURE__ */ dt(t);
|
|
58
|
+
async function ut({
|
|
59
59
|
editor: t,
|
|
60
60
|
plan: e,
|
|
61
61
|
pluginName: r,
|
|
@@ -63,35 +63,48 @@ async function mt({
|
|
|
63
63
|
onLicenseCheckResponse: o,
|
|
64
64
|
cleanup: i
|
|
65
65
|
}) {
|
|
66
|
-
let s = "",
|
|
67
|
-
const
|
|
68
|
-
console.warn("Cleanup plugin:", r, "Reason:",
|
|
69
|
-
},
|
|
66
|
+
let s = "", a;
|
|
67
|
+
const p = (l) => {
|
|
68
|
+
console.warn("Cleanup plugin:", r, "Reason:", l), i();
|
|
69
|
+
}, d = (l = {}) => {
|
|
70
70
|
var w;
|
|
71
|
-
const { error:
|
|
72
|
-
if (!(
|
|
73
|
-
|
|
71
|
+
const { error: g, sdkLicense: u } = l, h = (w = l.plan) == null ? void 0 : w.category;
|
|
72
|
+
if (!(u || l.license) || g)
|
|
73
|
+
p(g || "Invalid license");
|
|
74
74
|
else if (h) {
|
|
75
|
-
const
|
|
76
|
-
|
|
75
|
+
const v = W[e], R = W[h];
|
|
76
|
+
v > R && p({ pluginRequiredPlan: e, licensePlan: h });
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
t.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
79
|
+
t.Commands.has(_.settings) && (a = t.runCommand(_.settings), s = (a == null ? void 0 : a.baseUrl) || "");
|
|
80
|
+
const c = (l) => {
|
|
81
|
+
o == null || o(l), l && d(l);
|
|
82
|
+
};
|
|
83
|
+
if (!a) {
|
|
84
|
+
t.onReady(async () => {
|
|
85
|
+
if (!ct())
|
|
86
|
+
if (n) {
|
|
87
|
+
const l = await mt({ licenseKey: n, pluginName: r, baseApiUrl: s });
|
|
88
|
+
c(l);
|
|
89
|
+
} else
|
|
90
|
+
p("The `licenseKey` option not provided");
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (a.licensePlan || a.licenseError) {
|
|
95
|
+
const l = ft(a);
|
|
96
|
+
c(l);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
t.on(at, (l) => c(l));
|
|
93
100
|
}
|
|
94
|
-
|
|
101
|
+
const ft = (t) => ({
|
|
102
|
+
sdkLicense: t.license,
|
|
103
|
+
license: t.license,
|
|
104
|
+
error: t.licenseError,
|
|
105
|
+
plan: t.licensePlan
|
|
106
|
+
});
|
|
107
|
+
async function mt(t) {
|
|
95
108
|
const { licenseKey: e, pluginName: r, baseApiUrl: n } = t;
|
|
96
109
|
try {
|
|
97
110
|
return (await pt({
|
|
@@ -107,10 +120,10 @@ async function gt(t) {
|
|
|
107
120
|
return console.error("Error during SDK license check:", o), !1;
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
|
-
const N = "canvasGridMode",
|
|
123
|
+
const N = "canvasGridMode", yt = G.startup, F = "component-grid-mode", D = "grid-mode", M = "gjs-drag-grid-spot", K = `${M}__grid-item`, J = `${M}__grid-target`, Q = `${M}__snapped`, ht = `${M}__container`, wt = () => {
|
|
111
124
|
const t = "data-gjs-drag-grid-style", e = document, r = "var(--gs-theme-cl-cmp-bg1, var(--gjs-color-highlight))", n = "var(--gs-theme-cl-cmp-bg2, var(--gjs-color-blue))", o = e.querySelector(`style[${t}]`) || e.createElement("style");
|
|
112
125
|
o.setAttribute(t, "true"), o.innerHTML = `
|
|
113
|
-
.${
|
|
126
|
+
.${K} {
|
|
114
127
|
outline: 2px solid ${n};
|
|
115
128
|
background: ${r};
|
|
116
129
|
outline-offset: -2px;
|
|
@@ -119,14 +132,14 @@ const N = "canvasGridMode", ft = G.startup, F = "component-grid-mode", A = "grid
|
|
|
119
132
|
height: 100%;
|
|
120
133
|
opacity: 0.1;
|
|
121
134
|
}
|
|
122
|
-
.${
|
|
135
|
+
.${Q} {
|
|
123
136
|
width: 100%;
|
|
124
137
|
height: 100%;
|
|
125
138
|
outline: 2px solid ${n};
|
|
126
139
|
outline-offset: -2px;
|
|
127
140
|
position: absolute;
|
|
128
141
|
}
|
|
129
|
-
.${
|
|
142
|
+
.${J} {
|
|
130
143
|
position: absolute;
|
|
131
144
|
z-index: -1;
|
|
132
145
|
background: ${r};
|
|
@@ -136,41 +149,41 @@ const N = "canvasGridMode", ft = G.startup, F = "component-grid-mode", A = "grid
|
|
|
136
149
|
}
|
|
137
150
|
`, e.head.appendChild(o);
|
|
138
151
|
};
|
|
139
|
-
function
|
|
140
|
-
const { editor: e, type: r } = t, n =
|
|
141
|
-
if (!
|
|
152
|
+
function Z(t) {
|
|
153
|
+
const { editor: e, type: r } = t, n = Rt(e, t.component), o = O(e, n.component);
|
|
154
|
+
if (!Tt(e, n, o, r))
|
|
142
155
|
return {
|
|
143
156
|
target: n,
|
|
144
157
|
container: o,
|
|
145
|
-
startScroll:
|
|
158
|
+
startScroll: ot(e).scroll,
|
|
146
159
|
shadowContainerEl: document.createElement("div"),
|
|
147
160
|
shadowSnappedEl: document.createElement("div"),
|
|
148
161
|
shadowTargetEl: document.createElement("div"),
|
|
149
162
|
spot: e.Canvas.addSpot({
|
|
150
|
-
type:
|
|
163
|
+
type: D,
|
|
151
164
|
component: o.component
|
|
152
165
|
})
|
|
153
166
|
};
|
|
154
167
|
}
|
|
155
|
-
function Z(t) {
|
|
156
|
-
const { editor: e, shadowTargetEl: r, shadowSnappedEl: n, shadowContainerEl: o, spotEl: i, target: s, container: l } = t, { Canvas: d } = e, c = e.config.stylePrefix;
|
|
157
|
-
i == null || i.appendChild(o), o == null || o.appendChild(r), o == null || o.appendChild(n), wt(o, l), St(r, s, l), bt(n, s), $t(o, l.el), s.el.style.opacity = "0";
|
|
158
|
-
const p = d.getSpots().filter((a) => a.type !== A);
|
|
159
|
-
e.em.stopDefault({ preserveSelected: !0 }), d.removeSpots(p), d.startAutoscroll(), d.getBody().classList.add(`${c}is__grabbing`);
|
|
160
|
-
}
|
|
161
168
|
function V(t) {
|
|
162
|
-
const { editor: e,
|
|
169
|
+
const { editor: e, shadowTargetEl: r, shadowSnappedEl: n, shadowContainerEl: o, spotEl: i, target: s, container: a } = t, { Canvas: p } = e, d = e.config.stylePrefix;
|
|
170
|
+
i == null || i.appendChild(o), o == null || o.appendChild(r), o == null || o.appendChild(n), bt(o, a), vt(r, s, a), $t(n, s), St(o, a.el), s.el.style.opacity = "0";
|
|
171
|
+
const c = p.getSpots().filter((l) => l.type !== D);
|
|
172
|
+
e.em.stopDefault({ preserveSelected: !0 }), p.removeSpots(c), p.startAutoscroll(), p.getBody().classList.add(`${d}is__grabbing`);
|
|
173
|
+
}
|
|
174
|
+
function tt(t) {
|
|
175
|
+
const { editor: e, shadowSnappedEl: r, shadowContainerEl: n, target: o, cancelled: i } = t, { Canvas: s } = e, a = e.config.stylePrefix, { component: p } = o;
|
|
163
176
|
if (!i) {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
"grid-area":
|
|
177
|
+
const d = window.getComputedStyle(r);
|
|
178
|
+
p.addStyle({
|
|
179
|
+
"grid-area": d.gridArea,
|
|
167
180
|
width: "",
|
|
168
181
|
height: ""
|
|
169
182
|
});
|
|
170
183
|
}
|
|
171
|
-
o.el.style.opacity = "", n.contains(r) && (n == null || n.removeChild(r)), e.getModel().runDefault({ preserveSelected: 1 }), s.stopAutoscroll(), s.getBody().classList.remove(`${
|
|
184
|
+
o.el.style.opacity = "", n.contains(r) && (n == null || n.removeChild(r)), e.getModel().runDefault({ preserveSelected: 1 }), s.stopAutoscroll(), s.getBody().classList.remove(`${a}is__grabbing`), s.removeSpots({ type: D }), e.select(p);
|
|
172
185
|
}
|
|
173
|
-
function
|
|
186
|
+
function bt(t, {
|
|
174
187
|
rows: e,
|
|
175
188
|
columns: r
|
|
176
189
|
}) {
|
|
@@ -179,31 +192,31 @@ function wt(t, {
|
|
|
179
192
|
n[o] = [];
|
|
180
193
|
for (let i = 0; i < e.length; i++) {
|
|
181
194
|
const s = document.createElement("div");
|
|
182
|
-
s.className =
|
|
195
|
+
s.className = K, s.style.gridArea = `${i + 1} / ${o + 1}`, n[o][i] = s, t.appendChild(s);
|
|
183
196
|
}
|
|
184
197
|
}
|
|
185
198
|
return n;
|
|
186
199
|
}
|
|
187
|
-
function
|
|
188
|
-
return t.className =
|
|
189
|
-
}
|
|
190
|
-
function bt(t, e) {
|
|
191
|
-
const r = ot(e.el, e.computedStyles);
|
|
192
|
-
return t.className = J, t.style.gridArea = `${r.row.start} / ${r.column.start} / ${r.row.end} / ${r.column.end}`, t;
|
|
200
|
+
function vt(t, e, r) {
|
|
201
|
+
return t.className = J, t.style.top = `${e.offset.top - r.offset.top}px`, t.style.left = `${e.offset.left - r.offset.left}px`, t.style.width = `${e.offset.width + e.margin.left + e.margin.right}px`, t.style.height = `${e.offset.height + e.margin.top + e.margin.bottom}px`, t;
|
|
193
202
|
}
|
|
194
203
|
function $t(t, e) {
|
|
204
|
+
const r = nt(e.el, e.computedStyles);
|
|
205
|
+
return t.className = Q, t.style.gridArea = `${r.row.start} / ${r.column.start} / ${r.row.end} / ${r.column.end}`, t;
|
|
206
|
+
}
|
|
207
|
+
function St(t, e) {
|
|
195
208
|
const r = window.getComputedStyle(e);
|
|
196
|
-
t.className =
|
|
209
|
+
t.className = ht, t.style.position = "relative", t.style.display = r.display, t.style.gap = r.gap, t.style.padding = r.padding, t.style.border = r.border, t.style.gridTemplateColumns = r.gridTemplateColumns, t.style.gridTemplateRows = r.gridTemplateRows;
|
|
197
210
|
}
|
|
198
|
-
function
|
|
211
|
+
function et(t, e) {
|
|
199
212
|
if (e) {
|
|
200
213
|
if (Array.isArray(e))
|
|
201
214
|
return [...e].pop();
|
|
202
215
|
} else return [...t.getSelectedAll()].pop();
|
|
203
216
|
return e;
|
|
204
217
|
}
|
|
205
|
-
function
|
|
206
|
-
const r =
|
|
218
|
+
function Rt(t, e) {
|
|
219
|
+
const r = et(t, e), n = r.getEl(), o = window.getComputedStyle(n);
|
|
207
220
|
return {
|
|
208
221
|
component: r,
|
|
209
222
|
el: n,
|
|
@@ -217,7 +230,7 @@ function Ct(t, e) {
|
|
|
217
230
|
computedStyles: o
|
|
218
231
|
};
|
|
219
232
|
}
|
|
220
|
-
function
|
|
233
|
+
function O(t, e) {
|
|
221
234
|
const r = e.parent(), n = r.getEl(), o = window.getComputedStyle(n);
|
|
222
235
|
return {
|
|
223
236
|
component: r,
|
|
@@ -238,7 +251,7 @@ function L(t, e) {
|
|
|
238
251
|
}
|
|
239
252
|
};
|
|
240
253
|
}
|
|
241
|
-
function
|
|
254
|
+
function T(t, e, r, n, o = 1) {
|
|
242
255
|
let i = 0;
|
|
243
256
|
for (let s = e; s <= t.length; s++) {
|
|
244
257
|
if (i + (t[s - 1] + n) * o > r)
|
|
@@ -247,7 +260,7 @@ function E(t, e, r, n, o = 1) {
|
|
|
247
260
|
}
|
|
248
261
|
return t.length + 1;
|
|
249
262
|
}
|
|
250
|
-
function
|
|
263
|
+
function ot(t) {
|
|
251
264
|
const { scrollY: e, scrollX: r } = t.Canvas.getWindow();
|
|
252
265
|
return {
|
|
253
266
|
scroll: {
|
|
@@ -256,20 +269,20 @@ function et(t) {
|
|
|
256
269
|
}
|
|
257
270
|
};
|
|
258
271
|
}
|
|
259
|
-
function
|
|
272
|
+
function Tt(t, e, r, n) {
|
|
260
273
|
const o = (i) => t.em.logWarning(i);
|
|
261
274
|
return n === "draggable" && e.component.get(n) === !1 ? (o(`[${N}] The element is not ${n}`), !0) : r.computedStyles.display !== "grid" ? (o(`[${N}] The container does not have style display:grid`), !0) : !1;
|
|
262
275
|
}
|
|
263
|
-
function
|
|
264
|
-
const n =
|
|
276
|
+
function L(t, e, r = {}) {
|
|
277
|
+
const n = et(t, e), o = n == null ? void 0 : n.parent(), i = o == null ? void 0 : o.getEl();
|
|
265
278
|
if (!o || !i)
|
|
266
279
|
return !1;
|
|
267
|
-
const { enableGrid: s } = r,
|
|
268
|
-
return
|
|
280
|
+
const { enableGrid: s } = r, a = window.getComputedStyle(i).display === "grid";
|
|
281
|
+
return X(s) ? s({ component: n, parent: o, isParentGrid: a }) : a;
|
|
269
282
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
272
|
-
const r = t.ownerDocument.defaultView, n = e || r.getComputedStyle(t), o = n.gridArea.split("/").some((
|
|
283
|
+
const U = (t) => t.split(" ").map((e) => parseFloat(e));
|
|
284
|
+
function nt(t, e) {
|
|
285
|
+
const r = t.ownerDocument.defaultView, n = e || r.getComputedStyle(t), o = n.gridArea.split("/").some((b) => isNaN(parseInt(b.trim()))), i = {
|
|
273
286
|
isComputed: o,
|
|
274
287
|
raw: n.gridArea
|
|
275
288
|
};
|
|
@@ -285,144 +298,144 @@ function ot(t, e) {
|
|
|
285
298
|
end: parseInt(n.gridColumnEnd)
|
|
286
299
|
}
|
|
287
300
|
};
|
|
288
|
-
const s = t.parentElement,
|
|
289
|
-
let
|
|
290
|
-
for (let
|
|
291
|
-
const I = $[
|
|
292
|
-
if (
|
|
293
|
-
return
|
|
294
|
-
|
|
301
|
+
const s = t.parentElement, a = r.getComputedStyle(s), p = parseFloat(a.columnGap) || 0, d = parseFloat(a.rowGap) || 0, c = U(a.gridTemplateColumns), l = U(a.gridTemplateRows), g = parseFloat(a.paddingLeft) || 0, u = parseFloat(a.paddingTop) || 0, h = s.getBoundingClientRect(), m = t.getBoundingClientRect(), w = (b, $, x, S, C) => {
|
|
302
|
+
let E = 1, P = S + C;
|
|
303
|
+
for (let A = 0; A < $.length; A++) {
|
|
304
|
+
const I = $[A], z = P + I;
|
|
305
|
+
if (b >= P && b < z)
|
|
306
|
+
return E;
|
|
307
|
+
P = z + x, E++;
|
|
295
308
|
}
|
|
296
309
|
return -1;
|
|
297
|
-
},
|
|
310
|
+
}, v = w(m.left, c, p, h.left, g), R = w(m.right - 1, c, p, h.left, g) + 1, y = w(m.top, l, d, h.top, u), f = w(m.bottom - 1, l, d, h.top, u) + 1;
|
|
298
311
|
return {
|
|
299
312
|
...i,
|
|
300
313
|
row: {
|
|
301
314
|
start: y,
|
|
302
|
-
end:
|
|
315
|
+
end: f
|
|
303
316
|
},
|
|
304
317
|
column: {
|
|
305
|
-
start:
|
|
306
|
-
end:
|
|
318
|
+
start: v,
|
|
319
|
+
end: R
|
|
307
320
|
}
|
|
308
321
|
};
|
|
309
322
|
}
|
|
310
|
-
function
|
|
323
|
+
function xt(t) {
|
|
311
324
|
t.Commands.add(F, {
|
|
312
325
|
stop() {
|
|
313
326
|
},
|
|
314
327
|
run(e, r, n = {}) {
|
|
315
|
-
const o =
|
|
328
|
+
const o = Z({ editor: e, component: n.target, type: "draggable" });
|
|
316
329
|
if (!o) {
|
|
317
330
|
this.stopCommand();
|
|
318
331
|
return;
|
|
319
332
|
}
|
|
320
|
-
const { spot: i, target: s, shadowContainerEl:
|
|
321
|
-
let { container:
|
|
333
|
+
const { spot: i, target: s, shadowContainerEl: a, shadowSnappedEl: p, shadowTargetEl: d, startScroll: c } = o;
|
|
334
|
+
let { container: l } = o, g;
|
|
322
335
|
new e.Utils.Dragger({
|
|
323
336
|
doc: s.el.ownerDocument,
|
|
324
337
|
onStart: () => {
|
|
325
|
-
|
|
326
|
-
|
|
338
|
+
g = setTimeout(() => {
|
|
339
|
+
V({
|
|
327
340
|
editor: e,
|
|
328
|
-
shadowTargetEl:
|
|
329
|
-
shadowSnappedEl:
|
|
330
|
-
shadowContainerEl:
|
|
341
|
+
shadowTargetEl: d,
|
|
342
|
+
shadowSnappedEl: p,
|
|
343
|
+
shadowContainerEl: a,
|
|
331
344
|
spotEl: i.attributes.spotEl,
|
|
332
345
|
target: s,
|
|
333
|
-
container:
|
|
334
|
-
}),
|
|
346
|
+
container: l
|
|
347
|
+
}), l = O(e, s.component);
|
|
335
348
|
}, 10);
|
|
336
349
|
},
|
|
337
|
-
onEnd: (h,
|
|
338
|
-
clearTimeout(
|
|
350
|
+
onEnd: (h, m, { cancelled: w }) => {
|
|
351
|
+
clearTimeout(g), tt({
|
|
339
352
|
editor: e,
|
|
340
|
-
shadowSnappedEl:
|
|
341
|
-
shadowContainerEl:
|
|
353
|
+
shadowSnappedEl: p,
|
|
354
|
+
shadowContainerEl: a,
|
|
342
355
|
target: s,
|
|
343
356
|
cancelled: w
|
|
344
357
|
}), this.stopCommand(), e.em.set("_cmpDrag", 1);
|
|
345
358
|
},
|
|
346
|
-
setPosition: ({ x: h, y:
|
|
347
|
-
const { scroll: w } =
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
), I = Math.min(
|
|
351
|
-
|
|
359
|
+
setPosition: ({ x: h, y: m }) => {
|
|
360
|
+
const { scroll: w } = ot(e), { columns: v, rows: R, gap: y, offset: f, padding: b } = l, { offset: $, margin: x } = s, S = $.top - f.top - b.top - x.top + m - c.top + w.top, C = $.left - f.left - b.left - x.left + h - c.left + w.left, E = Math.min(T(v, 1, C, y.column, 0.5), v.length), P = Math.min(T(R, 1, S, y.row, 0.5), R.length), A = Math.min(
|
|
361
|
+
T(v, E, $.width, y.column) + 1,
|
|
362
|
+
v.length + 1
|
|
363
|
+
), I = Math.min(T(R, P, $.height, y.row) + 1, R.length + 1);
|
|
364
|
+
p.style.gridArea = `${P} / ${E} / ${I} / ${A}`, d.style.top = `${S + b.top}px`, d.style.left = `${C + b.left}px`;
|
|
352
365
|
}
|
|
353
366
|
}).start(n.event);
|
|
354
367
|
}
|
|
355
368
|
});
|
|
356
369
|
}
|
|
357
|
-
function
|
|
358
|
-
const r =
|
|
370
|
+
function Pt(t, e) {
|
|
371
|
+
const r = Z({ editor: t, component: e.component, type: "resizable" });
|
|
359
372
|
if (!r)
|
|
360
373
|
return;
|
|
361
|
-
const { onMove: n, onEnd: o } = e.options || {}, { spot: i, target: s, shadowContainerEl:
|
|
362
|
-
let { container:
|
|
374
|
+
const { onMove: n, onEnd: o } = e.options || {}, { spot: i, target: s, shadowContainerEl: a, shadowSnappedEl: p, shadowTargetEl: d } = r;
|
|
375
|
+
let { container: c } = r, l = "", g;
|
|
363
376
|
return {
|
|
364
|
-
onStart: (
|
|
365
|
-
|
|
366
|
-
|
|
377
|
+
onStart: (u) => {
|
|
378
|
+
l = u.target.dataset.gjsHandler || "", g = setTimeout(() => {
|
|
379
|
+
V({
|
|
367
380
|
editor: t,
|
|
368
|
-
shadowTargetEl:
|
|
369
|
-
shadowSnappedEl:
|
|
370
|
-
shadowContainerEl:
|
|
381
|
+
shadowTargetEl: d,
|
|
382
|
+
shadowSnappedEl: p,
|
|
383
|
+
shadowContainerEl: a,
|
|
371
384
|
spotEl: i.attributes.spotEl,
|
|
372
385
|
target: s,
|
|
373
|
-
container:
|
|
374
|
-
}),
|
|
386
|
+
container: c
|
|
387
|
+
}), c = O(t, s.component);
|
|
375
388
|
}, 10), t.trigger("component:resize", { ...s, type: "start" });
|
|
376
389
|
},
|
|
377
|
-
onEnd: (
|
|
378
|
-
const { startDim:
|
|
379
|
-
clearTimeout(
|
|
390
|
+
onEnd: (u, h) => {
|
|
391
|
+
const { startDim: m, rectDim: w } = h.resizer, v = JSON.stringify(m) === JSON.stringify(w);
|
|
392
|
+
clearTimeout(g), tt({ editor: t, shadowSnappedEl: p, shadowContainerEl: a, target: s, cancelled: v }), o == null || o(u, h);
|
|
380
393
|
},
|
|
381
|
-
onMove: (
|
|
382
|
-
const
|
|
383
|
-
t:
|
|
394
|
+
onMove: (u, h) => {
|
|
395
|
+
const m = nt(p), w = s.margin.left, v = s.margin.top, R = s.margin.bottom, y = s.margin.right, { w: f, t: b, l: $, h: x } = h.resizer.rectDim, S = {
|
|
396
|
+
t: b - v,
|
|
384
397
|
l: $ - w,
|
|
385
|
-
h: x +
|
|
386
|
-
w:
|
|
398
|
+
h: x + v + R,
|
|
399
|
+
w: f + w + y
|
|
387
400
|
};
|
|
388
|
-
|
|
389
|
-
|
|
401
|
+
l.endsWith("l") && (m.column.start = T(
|
|
402
|
+
c.columns,
|
|
390
403
|
1,
|
|
391
|
-
|
|
392
|
-
|
|
404
|
+
S.l - c.offset.left - c.padding.left,
|
|
405
|
+
c.gap.column,
|
|
393
406
|
0.5
|
|
394
|
-
)),
|
|
395
|
-
|
|
407
|
+
)), l.startsWith("t") && (m.row.start = T(
|
|
408
|
+
c.rows,
|
|
396
409
|
1,
|
|
397
|
-
|
|
398
|
-
|
|
410
|
+
S.t - c.offset.top - c.padding.top,
|
|
411
|
+
c.gap.row,
|
|
399
412
|
0.5
|
|
400
|
-
)),
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
)),
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
)),
|
|
413
|
+
)), l.endsWith("r") && (m.column.end = Math.max(
|
|
414
|
+
T(c.columns, m.column.start, S.w, c.gap.column, 0.5),
|
|
415
|
+
m.column.start + 1
|
|
416
|
+
)), l.startsWith("b") && (m.row.end = Math.max(
|
|
417
|
+
T(c.rows, m.row.start, S.h, c.gap.row, 0.5),
|
|
418
|
+
m.row.start + 1
|
|
419
|
+
)), p.style.gridArea = `${m.row.start} / ${m.column.start} / ${m.row.end} / ${m.column.end}`, d.style.width = `${S.w}px`, d.style.height = `${S.h}px`, d.style.left = `${S.l - c.offset.left}px`, d.style.top = `${S.t - c.offset.top}px`, n == null || n(u, h);
|
|
407
420
|
}
|
|
408
421
|
};
|
|
409
422
|
}
|
|
410
|
-
const
|
|
423
|
+
const k = ["px", "%", "em", "rem", "vw", "vh"], Gt = (t, e) => {
|
|
411
424
|
const r = t.Styles.getSectors().find((n) => !!n.getProperty(e));
|
|
412
425
|
return {
|
|
413
426
|
sector: r,
|
|
414
427
|
property: r ? r.getProperty(e) : void 0
|
|
415
428
|
};
|
|
416
|
-
},
|
|
429
|
+
}, Et = (t, e) => Gt(t, e), At = (t, { x: e, y: r, mergable: n } = {}) => {
|
|
417
430
|
const o = {
|
|
418
431
|
property: `${t}-x`,
|
|
419
432
|
type: "integer",
|
|
420
|
-
units:
|
|
433
|
+
units: k,
|
|
421
434
|
...e
|
|
422
435
|
}, i = {
|
|
423
436
|
property: `${t}-y`,
|
|
424
437
|
type: "integer",
|
|
425
|
-
units:
|
|
438
|
+
units: k,
|
|
426
439
|
...r
|
|
427
440
|
};
|
|
428
441
|
return {
|
|
@@ -430,39 +443,39 @@ const U = ["px", "%", "em", "rem", "vw", "vh"], Tt = (t, e) => {
|
|
|
430
443
|
type: "composite",
|
|
431
444
|
properties: [o, i],
|
|
432
445
|
...n && {
|
|
433
|
-
fromStyle(s, { name:
|
|
434
|
-
const [
|
|
446
|
+
fromStyle(s, { name: a, separator: p, property: d }) {
|
|
447
|
+
const [c, l] = d.getProperties(), [g, u] = (s[a] || "").split(p);
|
|
435
448
|
return {
|
|
436
|
-
[
|
|
437
|
-
[
|
|
449
|
+
[c.getId()]: s[c.getName()] || g || "",
|
|
450
|
+
[l.getId()]: s[l.getName()] || u || g || ""
|
|
438
451
|
};
|
|
439
452
|
},
|
|
440
|
-
toStyle(s, { name:
|
|
441
|
-
const [
|
|
453
|
+
toStyle(s, { name: a, property: p }) {
|
|
454
|
+
const [d, c] = p.getProperties(), l = s[d.getId()], g = s[c.getId()];
|
|
442
455
|
return {
|
|
443
|
-
[
|
|
456
|
+
[a]: l === g ? l : `${l} ${g}`
|
|
444
457
|
};
|
|
445
458
|
}
|
|
446
459
|
}
|
|
447
460
|
};
|
|
448
|
-
},
|
|
449
|
-
function
|
|
461
|
+
}, B = { display: ["grid"] };
|
|
462
|
+
function Dt(t = "") {
|
|
450
463
|
const e = /^repeat\(\s*(\d+)\s*,\s*(.+)\s*\)$/i, r = /^minmax\(\s*(.+?)\s*,\s*(.+?)\s*\)$/i, n = t.match(e);
|
|
451
464
|
if (!n)
|
|
452
465
|
return null;
|
|
453
466
|
const o = parseInt(n[1], 10), i = n[2];
|
|
454
|
-
let s = i,
|
|
455
|
-
const
|
|
456
|
-
return
|
|
467
|
+
let s = i, a = i;
|
|
468
|
+
const p = i.match(r);
|
|
469
|
+
return p && (s = p[1], a = p[2]), {
|
|
457
470
|
total: o,
|
|
458
|
-
min: s ===
|
|
459
|
-
max:
|
|
471
|
+
min: s === a ? "" : s,
|
|
472
|
+
max: a
|
|
460
473
|
};
|
|
461
474
|
}
|
|
462
|
-
function
|
|
475
|
+
function Mt(t = {}) {
|
|
463
476
|
let e = "", r = "", n = "", o = "";
|
|
464
|
-
const i = (
|
|
465
|
-
return
|
|
477
|
+
const i = (m) => m.split("/").map((w) => w.trim()).filter(Boolean), s = t["grid-area"] || "", a = t["grid-column"] || "", p = t["grid-row"] || "", d = i(s), c = i(a), l = i(p), g = d.length, u = c.length, h = l.length;
|
|
478
|
+
return g === 4 ? (n = d[0], e = d[1], o = d[2], r = d[3]) : g === 3 ? (n = d[0], e = d[1], o = d[2]) : g === 2 ? (n = d[0], e = d[1]) : g === 1 && (n = d[0]), u === 2 ? (e = c[0], r = c[1]) : u === 1 && (e = c[0]), h === 2 ? (n = l[0], o = l[1]) : h === 1 && (n = l[0]), {
|
|
466
479
|
columnStart: e,
|
|
467
480
|
columnEnd: r,
|
|
468
481
|
rowStart: n,
|
|
@@ -475,7 +488,7 @@ function q(t) {
|
|
|
475
488
|
property: e,
|
|
476
489
|
label: r,
|
|
477
490
|
type: "composite",
|
|
478
|
-
requires:
|
|
491
|
+
requires: B,
|
|
479
492
|
generic: !0,
|
|
480
493
|
properties: [
|
|
481
494
|
{
|
|
@@ -504,24 +517,24 @@ function q(t) {
|
|
|
504
517
|
}
|
|
505
518
|
],
|
|
506
519
|
fromStyle(i, s) {
|
|
507
|
-
const { name:
|
|
520
|
+
const { name: a, property: p } = s, [d, c, l] = p.getProperties(), g = i[a], u = Dt(g), h = (u == null ? void 0 : u.max) ?? o;
|
|
508
521
|
return {
|
|
509
|
-
[
|
|
510
|
-
[
|
|
511
|
-
[
|
|
522
|
+
[d.id]: (u == null ? void 0 : u.total) ?? n,
|
|
523
|
+
[c.id]: (u == null ? void 0 : u.min) ?? "",
|
|
524
|
+
[l.id]: h === o ? "" : h
|
|
512
525
|
};
|
|
513
526
|
},
|
|
514
|
-
toStyle(i, { name: s, property:
|
|
515
|
-
const [d, c
|
|
527
|
+
toStyle(i, { name: s, property: a }) {
|
|
528
|
+
const [p, d, c] = a.getProperties(), l = i[p.id], g = i[d.id], u = i[c.id] || o, h = g && u ? `minmax(${g}, ${u})` : u;
|
|
516
529
|
return {
|
|
517
|
-
[s]: `repeat(${
|
|
530
|
+
[s]: `repeat(${l || n}, ${h})`
|
|
518
531
|
};
|
|
519
532
|
}
|
|
520
533
|
};
|
|
521
534
|
}
|
|
522
|
-
function
|
|
535
|
+
function Ct(t, e) {
|
|
523
536
|
if (!e.styleableGrid) return;
|
|
524
|
-
const { property: r, ...n } =
|
|
537
|
+
const { property: r, ...n } = Et(t, "display");
|
|
525
538
|
if (!r) return;
|
|
526
539
|
const o = r.getOption("grid"), i = n.sector;
|
|
527
540
|
o || r.addOption({ id: "grid", label: "Grid" }), i.addProperty(
|
|
@@ -539,8 +552,8 @@ function Dt(t, e) {
|
|
|
539
552
|
), i.addProperty(
|
|
540
553
|
{
|
|
541
554
|
id: "grid-gap",
|
|
542
|
-
requires:
|
|
543
|
-
...
|
|
555
|
+
requires: B,
|
|
556
|
+
...At("gap", {
|
|
544
557
|
x: { id: "grid-row-gap", label: "Row", property: "row-gap", min: 0, default: "0" },
|
|
545
558
|
y: { id: "grid-column-gap", label: "Column", property: "column-gap", min: 0, default: "0" },
|
|
546
559
|
mergable: !0
|
|
@@ -552,7 +565,7 @@ function Dt(t, e) {
|
|
|
552
565
|
type: "composite",
|
|
553
566
|
property: "grid-area",
|
|
554
567
|
label: "Grid area",
|
|
555
|
-
requiresParent:
|
|
568
|
+
requiresParent: B,
|
|
556
569
|
// detached: true,
|
|
557
570
|
generic: !0,
|
|
558
571
|
properties: [
|
|
@@ -582,51 +595,51 @@ function Dt(t, e) {
|
|
|
582
595
|
}
|
|
583
596
|
],
|
|
584
597
|
fromStyle(s) {
|
|
585
|
-
const
|
|
598
|
+
const a = Mt(s);
|
|
586
599
|
return {
|
|
587
|
-
"grid-column-start": s["grid-column-start"] ||
|
|
588
|
-
"grid-column-end": s["grid-column-end"] ||
|
|
589
|
-
"grid-row-start": s["grid-row-start"] ||
|
|
590
|
-
"grid-row-end": s["grid-row-end"] ||
|
|
600
|
+
"grid-column-start": s["grid-column-start"] || a.columnStart,
|
|
601
|
+
"grid-column-end": s["grid-column-end"] || a.columnEnd,
|
|
602
|
+
"grid-row-start": s["grid-row-start"] || a.rowStart,
|
|
603
|
+
"grid-row-end": s["grid-row-end"] || a.rowEnd
|
|
591
604
|
};
|
|
592
605
|
},
|
|
593
|
-
toStyle(s, { name:
|
|
594
|
-
const
|
|
606
|
+
toStyle(s, { name: a }) {
|
|
607
|
+
const p = s["grid-row-start"] || "auto", d = s["grid-row-end"] || "auto", c = s["grid-column-start"] || "auto", l = s["grid-column-end"] || "auto";
|
|
595
608
|
return {
|
|
596
|
-
[
|
|
609
|
+
[a]: `${p} / ${c} / ${d} / ${l}`
|
|
597
610
|
};
|
|
598
611
|
}
|
|
599
612
|
},
|
|
600
613
|
{}
|
|
601
614
|
);
|
|
602
615
|
}
|
|
603
|
-
const
|
|
616
|
+
const It = function(t, e = {}) {
|
|
604
617
|
const r = {
|
|
605
618
|
itemResizable: !0,
|
|
606
619
|
...e
|
|
607
|
-
}, { Canvas: n, Commands: o, Components: i } = t, { itemResizable: s } = r,
|
|
608
|
-
let
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
|
|
620
|
+
}, { Canvas: n, Commands: o, Components: i } = t, { itemResizable: s } = r, a = n.events, p = o.events, d = i.events, c = `${p.runBeforeCommand}tlb-move`, l = `${p.runBeforeCommand}resize`;
|
|
621
|
+
let g;
|
|
622
|
+
xt(t);
|
|
623
|
+
const u = ({ options: y }) => {
|
|
624
|
+
L(t, y.target, r) && (t.runCommand(F, { ...y }), y.abort = !0);
|
|
612
625
|
}, h = (y) => {
|
|
613
|
-
const { options:
|
|
614
|
-
|
|
615
|
-
},
|
|
626
|
+
const { options: f } = y;
|
|
627
|
+
L(t, f.component, r) && (f.options = Object.assign(f.options || {}, Pt(t, f)));
|
|
628
|
+
}, m = () => {
|
|
616
629
|
const y = n.getSpots({
|
|
617
|
-
type:
|
|
630
|
+
type: D
|
|
618
631
|
}).pop();
|
|
619
632
|
if (!y) return;
|
|
620
|
-
let
|
|
621
|
-
|
|
633
|
+
let f = y.attributes.spotEl;
|
|
634
|
+
f || (f = document.createElement("div"), f.className = M, y.set({ spotEl: f })), Object.entries(y.getStyle()).forEach(([b, $]) => f.style.setProperty(b, $)), g == null || g.appendChild(f);
|
|
622
635
|
}, w = ({ spot: y }) => {
|
|
623
|
-
const
|
|
624
|
-
y.type !==
|
|
636
|
+
const f = y.attributes.spotEl;
|
|
637
|
+
y.type !== D || !f || g == null || g.removeChild(f);
|
|
625
638
|
};
|
|
626
639
|
if (s) {
|
|
627
|
-
const y = (
|
|
628
|
-
const
|
|
629
|
-
return typeof
|
|
640
|
+
const y = (f) => {
|
|
641
|
+
const b = X(s) ? s({ component: f }) : s;
|
|
642
|
+
return typeof b == "boolean" ? b : {
|
|
630
643
|
tl: !1,
|
|
631
644
|
tc: !1,
|
|
632
645
|
tr: !1,
|
|
@@ -635,41 +648,41 @@ const Mt = function(t, e = {}) {
|
|
|
635
648
|
bl: !1,
|
|
636
649
|
bc: !1,
|
|
637
650
|
br: !1,
|
|
638
|
-
...
|
|
651
|
+
...b
|
|
639
652
|
};
|
|
640
653
|
};
|
|
641
|
-
t.on(
|
|
642
|
-
const { component:
|
|
643
|
-
if (
|
|
644
|
-
const $ = y(
|
|
645
|
-
|
|
654
|
+
t.on(d.resizeInit, (f) => {
|
|
655
|
+
const { component: b } = f;
|
|
656
|
+
if (L(t, b, r)) {
|
|
657
|
+
const $ = y(b);
|
|
658
|
+
f.resizable = $;
|
|
646
659
|
}
|
|
647
660
|
});
|
|
648
661
|
}
|
|
649
|
-
const
|
|
650
|
-
[
|
|
651
|
-
[
|
|
652
|
-
[
|
|
653
|
-
[
|
|
662
|
+
const v = [
|
|
663
|
+
[c, u],
|
|
664
|
+
[l, h],
|
|
665
|
+
[a.spot, m],
|
|
666
|
+
[a.spotRemove, w]
|
|
654
667
|
];
|
|
655
|
-
|
|
656
|
-
t.on(y,
|
|
668
|
+
v.forEach(([y, f]) => {
|
|
669
|
+
t.on(y, f);
|
|
657
670
|
}), t.onReady(() => {
|
|
658
|
-
|
|
671
|
+
g = n.getSpotsEl(), wt(), Ct(t, r);
|
|
659
672
|
});
|
|
660
|
-
const
|
|
661
|
-
delete t.Commands.commands[F],
|
|
662
|
-
t.off(y,
|
|
673
|
+
const R = () => {
|
|
674
|
+
delete t.Commands.commands[F], v.forEach(([y, f]) => {
|
|
675
|
+
t.off(y, f);
|
|
663
676
|
});
|
|
664
677
|
};
|
|
665
|
-
|
|
678
|
+
ut({
|
|
666
679
|
editor: t,
|
|
667
680
|
licenseKey: r.licenseKey,
|
|
668
|
-
plan:
|
|
681
|
+
plan: yt,
|
|
669
682
|
pluginName: N,
|
|
670
|
-
cleanup:
|
|
683
|
+
cleanup: R
|
|
671
684
|
});
|
|
672
|
-
},
|
|
685
|
+
}, Lt = gt(It);
|
|
673
686
|
export {
|
|
674
|
-
|
|
687
|
+
Lt as default
|
|
675
688
|
};
|