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