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