@grapesjs/studio-sdk-plugins 1.0.38 → 1.0.39-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 +5 -5
- package/dist/accordionComponent/index.es.js +70 -67
- package/dist/accordionComponent/index.js +39 -0
- package/dist/accordionComponent/index.umd.js +4 -4
- package/dist/aiChat/components/AiChatHeader.d.ts +4 -5
- package/dist/aiChat/components/AiChatInput/index.d.ts +4 -5
- package/dist/aiChat/components/AiChatMessage.d.ts +7 -8
- package/dist/aiChat/components/index.d.ts +1 -1
- package/dist/aiChat/components/utils.d.ts +1 -1
- package/dist/aiChat/index.cjs.js +10 -376
- package/dist/aiChat/index.es.js +4569 -28851
- package/dist/aiChat/index.js +10 -376
- package/dist/aiChat/index.umd.js +11 -377
- package/dist/aiChat/server/index.cjs.d.ts +0 -1
- package/dist/aiChat/server/index.cjs.js +45 -45
- package/dist/aiChat/server/index.d.ts +0 -1
- package/dist/aiChat/server/index.es.d.ts +0 -1
- package/dist/aiChat/server/index.es.js +371 -427
- package/dist/aiChat/server/index.js +45 -45
- package/dist/aiChat/server/index.umd.js +41 -41
- package/dist/aiChat/server/stream.test.d.ts +1 -0
- package/dist/aiChat/types.d.ts +18 -4
- package/dist/aiChat/typesSchema.d.ts +13 -0
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +49 -46
- package/dist/animationComponent/index.js +519 -0
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +115 -112
- package/dist/canvasAbsoluteMode/index.js +1 -0
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +71 -68
- package/dist/canvasEmptyState/index.js +1 -0
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +3 -3
- package/dist/canvasFullSize/index.es.js +69 -66
- package/dist/canvasFullSize/index.js +10 -0
- package/dist/canvasFullSize/index.umd.js +4 -4
- package/dist/canvasGridMode/index.cjs.js +7 -7
- package/dist/canvasGridMode/index.es.js +142 -139
- package/dist/canvasGridMode/index.js +26 -0
- package/dist/canvasGridMode/index.umd.js +7 -7
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +78 -75
- package/dist/canvasScreenshot/index.js +1 -0
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/EjsExporter.d.ts +1 -1
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +40 -37
- package/dist/dataSourceEjs/index.js +21 -0
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/HandlebarsExporter.d.ts +2 -2
- package/dist/dataSourceHandlebars/constants.d.ts +1 -1
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +58 -55
- package/dist/dataSourceHandlebars/index.js +10 -0
- package/dist/dataSourceHandlebars/index.umd.js +2 -2
- package/dist/dialogComponent/index.cjs.js +11 -11
- package/dist/dialogComponent/index.es.js +72 -69
- package/dist/dialogComponent/index.js +59 -0
- package/dist/dialogComponent/index.umd.js +11 -11
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +151 -142
- package/dist/flexComponent/index.js +33 -0
- package/dist/flexComponent/index.umd.js +8 -8
- package/dist/flexComponent/typesSchema.d.ts +1 -1
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +93 -90
- package/dist/fsLightboxComponent/index.js +6 -0
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +112 -109
- package/dist/googleFontsAssetProvider/index.js +1 -0
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/googleFontsAssetProvider/utils.d.ts +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +80 -77
- package/dist/iconifyComponent/index.js +3 -0
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +970 -82
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +7422 -6145
- package/dist/index.umd.js +975 -87
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +95 -92
- package/dist/layoutSidebarButtons/index.js +1 -0
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +164 -161
- package/dist/lightGalleryComponent/index.js +1 -0
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/lightGalleryComponent/utils.d.ts +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +60 -57
- package/dist/linkImageComponent/index.js +12 -0
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +4 -4
- package/dist/listPagesComponent/index.es.js +57 -54
- package/dist/listPagesComponent/index.js +11 -0
- package/dist/listPagesComponent/index.umd.js +4 -4
- package/dist/listPagesComponent/utils.d.ts +1 -1
- package/dist/presetBlockLibrary/blocks.d.ts +6 -0
- package/dist/presetBlockLibrary/blocks.test.d.ts +2 -0
- package/dist/presetBlockLibrary/emailBlocks.d.ts +53 -0
- package/dist/presetBlockLibrary/index.cjs.d.ts +3 -0
- package/dist/presetBlockLibrary/index.cjs.js +889 -0
- package/dist/presetBlockLibrary/index.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.js +1408 -0
- package/dist/presetBlockLibrary/index.js +889 -0
- package/dist/presetBlockLibrary/index.test.d.ts +1 -0
- package/dist/presetBlockLibrary/index.umd.js +889 -0
- package/dist/presetBlockLibrary/shared.d.ts +3 -0
- package/dist/presetBlockLibrary/types.d.ts +24 -0
- package/dist/presetBlockLibrary/typesSchema.d.ts +47 -0
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +133 -130
- package/dist/presetPrintable/index.js +32 -0
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +8 -8
- package/dist/prosemirror/index.es.js +552 -549
- package/dist/prosemirror/index.js +10 -0
- package/dist/prosemirror/index.umd.js +9 -9
- package/dist/prosemirror/toolbar.d.ts +2 -2
- package/dist/prosemirror/types.d.ts +5 -5
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +137 -134
- 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 +74 -71
- package/dist/rteTinyMce/index.js +104 -0
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +91 -88
- package/dist/shapeDividerComponent/index.js +97 -0
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +7 -7
- package/dist/swiperComponent/index.es.js +95 -92
- package/dist/swiperComponent/index.js +45 -0
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +181 -178
- package/dist/tableComponent/index.js +1 -0
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/tableComponent/types.d.ts +3 -3
- package/dist/types.d.ts +14 -14
- package/dist/utils.d.ts +3 -2
- package/dist/utilsDataSources.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +90 -87
- package/dist/youtubeAssetProvider/index.js +1 -0
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +182 -34
- package/dist/aiChat/server/models.d.ts +0 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const ue = "app.grapesjs.com", de = "app-stage.grapesjs.com",
|
|
1
|
+
const ue = "app.grapesjs.com", de = "app-stage.grapesjs.com", me = "app2.grapesjs.com", ze = "app-stage2.grapesjs.com", ae = [
|
|
2
2
|
ue,
|
|
3
|
-
Pe,
|
|
4
|
-
de,
|
|
5
3
|
me,
|
|
4
|
+
de,
|
|
5
|
+
ze,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -15,12 +15,12 @@ const ue = "app.grapesjs.com", de = "app-stage.grapesjs.com", Pe = "app2.grapesj
|
|
|
15
15
|
// For Claude mcp app
|
|
16
16
|
".web-sandbox.oaiusercontent.com"
|
|
17
17
|
// For OpenAI mcp app
|
|
18
|
-
],
|
|
18
|
+
], Se = "license:check:end", xe = () => typeof window < "u", ve = ({
|
|
19
19
|
isDev: t,
|
|
20
20
|
isStage: e,
|
|
21
21
|
isPlatform: s
|
|
22
|
-
}) => `${t ? "" : `https://${e ? de : ue}`}/${s ? "platform-api" : "api"}`,
|
|
23
|
-
if (!
|
|
22
|
+
}) => `${t ? "" : `https://${e ? de : ue}`}/${s ? "platform-api" : "api"}`, we = () => {
|
|
23
|
+
if (!xe()) return "";
|
|
24
24
|
const { hostname: t } = window.location;
|
|
25
25
|
if (t) return t;
|
|
26
26
|
try {
|
|
@@ -28,14 +28,14 @@ const ue = "app.grapesjs.com", de = "app-stage.grapesjs.com", Pe = "app2.grapesj
|
|
|
28
28
|
} catch {
|
|
29
29
|
return "";
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
const t =
|
|
31
|
+
}, Re = () => {
|
|
32
|
+
const t = we();
|
|
33
33
|
return !!t && (ae.includes(t) || ae.some((e) => t.endsWith(e)));
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function Ge(t) {
|
|
36
36
|
return typeof t == "function";
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
38
|
+
async function Ce({
|
|
39
39
|
path: t,
|
|
40
40
|
baseApiUrl: e,
|
|
41
41
|
method: s = "GET",
|
|
@@ -43,32 +43,35 @@ async function Ge({
|
|
|
43
43
|
params: a,
|
|
44
44
|
body: i
|
|
45
45
|
}) {
|
|
46
|
-
const
|
|
46
|
+
const c = `${e || ve({ isDev: !1, isStage: !1 })}${t}`, l = {
|
|
47
47
|
method: s,
|
|
48
48
|
headers: {
|
|
49
49
|
"Content-Type": "application/json",
|
|
50
50
|
...n
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
i && (
|
|
54
|
-
const g = a ? new URLSearchParams(a).toString() : "", f = g ? `?${g}` : "", r = await fetch(`${
|
|
53
|
+
i && (l.body = JSON.stringify(i));
|
|
54
|
+
const g = a ? new URLSearchParams(a).toString() : "", f = g ? `?${g}` : "", r = await fetch(`${c}${f}`, l);
|
|
55
55
|
if (!r.ok)
|
|
56
56
|
throw new Error(`HTTP error! status: ${r.status}`);
|
|
57
57
|
return r.json();
|
|
58
58
|
}
|
|
59
|
-
var L = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(L || {}), W = /* @__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))(W || {}), ge = /* @__PURE__ */ ((t) => (t.web = "web", t.email = "email", t.document = "document", t.react = "react", t))(ge || {});
|
|
59
|
+
var L = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(L || {}), W = /* @__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.openBlocks = "studio:openBlocks", t.appendComponent = "studio:appendComponent", 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))(W || {}), ge = /* @__PURE__ */ ((t) => (t.web = "web", t.email = "email", t.document = "document", t.react = "react", t))(ge || {});
|
|
60
60
|
const ie = {
|
|
61
61
|
[L.free]: 0,
|
|
62
62
|
[L.startup]: 10,
|
|
63
63
|
[L.business]: 20,
|
|
64
64
|
[L.enterprise]: 30
|
|
65
65
|
};
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
return
|
|
66
|
+
function Ie(t, e) {
|
|
67
|
+
const s = t;
|
|
68
|
+
return s.init = (n) => {
|
|
69
|
+
const a = (i) => t(i, n);
|
|
70
|
+
return a.__gjsPluginId = e, a;
|
|
71
|
+
}, s;
|
|
69
72
|
}
|
|
70
|
-
const
|
|
71
|
-
async function
|
|
73
|
+
const Te = (t, e) => /* @__PURE__ */ Ie(t, e);
|
|
74
|
+
async function Ee({
|
|
72
75
|
editor: t,
|
|
73
76
|
plan: e,
|
|
74
77
|
pluginName: s,
|
|
@@ -76,51 +79,51 @@ async function Te({
|
|
|
76
79
|
onLicenseCheckResponse: a,
|
|
77
80
|
cleanup: i
|
|
78
81
|
}) {
|
|
79
|
-
let o = "",
|
|
80
|
-
const
|
|
81
|
-
console.warn("Cleanup plugin:", s, "Reason:", r), i();
|
|
82
|
+
let o = "", c;
|
|
83
|
+
const l = (r) => {
|
|
84
|
+
console.warn("Cleanup plugin:", s, "Reason:", r), i(t, s);
|
|
82
85
|
}, g = (r = {}) => {
|
|
83
86
|
var v;
|
|
84
87
|
const { error: h, sdkLicense: I } = r, b = (v = r.plan) == null ? void 0 : v.category;
|
|
85
88
|
if (!(I || r.license) || h)
|
|
86
|
-
|
|
89
|
+
l(h || "Invalid license");
|
|
87
90
|
else if (b) {
|
|
88
91
|
const G = ie[e], m = ie[b];
|
|
89
|
-
G > m &&
|
|
92
|
+
G > m && l({ pluginRequiredPlan: e, licensePlan: b });
|
|
90
93
|
}
|
|
91
94
|
};
|
|
92
|
-
t.Commands.has(W.settings) && (
|
|
95
|
+
t.Commands.has(W.settings) && (c = t.runCommand(W.settings), o = (c == null ? void 0 : c.baseUrl) || "");
|
|
93
96
|
const f = (r) => {
|
|
94
97
|
a == null || a(r), r && g(r);
|
|
95
98
|
};
|
|
96
|
-
if (!
|
|
99
|
+
if (!c) {
|
|
97
100
|
t.onReady(async () => {
|
|
98
|
-
if (!
|
|
101
|
+
if (!Re())
|
|
99
102
|
if (n) {
|
|
100
|
-
const r = await
|
|
103
|
+
const r = await Le({ licenseKey: n, pluginName: s, baseApiUrl: o });
|
|
101
104
|
f(r);
|
|
102
105
|
} else
|
|
103
|
-
|
|
106
|
+
l("The `licenseKey` option not provided");
|
|
104
107
|
});
|
|
105
108
|
return;
|
|
106
109
|
}
|
|
107
|
-
if (
|
|
108
|
-
const r =
|
|
110
|
+
if (c.licensePlan || c.licenseError) {
|
|
111
|
+
const r = Ae(c);
|
|
109
112
|
f(r);
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
|
-
t.on(
|
|
115
|
+
t.on(Se, (r) => f(r));
|
|
113
116
|
}
|
|
114
|
-
const
|
|
117
|
+
const Ae = (t) => ({
|
|
115
118
|
sdkLicense: t.license,
|
|
116
119
|
license: t.license,
|
|
117
120
|
error: t.licenseError,
|
|
118
121
|
plan: t.licensePlan
|
|
119
122
|
});
|
|
120
|
-
async function
|
|
123
|
+
async function Le(t) {
|
|
121
124
|
const { licenseKey: e, pluginName: s, baseApiUrl: n } = t;
|
|
122
125
|
try {
|
|
123
|
-
return (await
|
|
126
|
+
return (await Ce({
|
|
124
127
|
baseApiUrl: n,
|
|
125
128
|
path: `/sdk/${e || "na"}`,
|
|
126
129
|
method: "POST",
|
|
@@ -136,7 +139,7 @@ async function Ae(t) {
|
|
|
136
139
|
const he = (t) => (e) => {
|
|
137
140
|
var s;
|
|
138
141
|
return ((s = e.getAttribute) == null ? void 0 : s.call(e, se)) === t;
|
|
139
|
-
},
|
|
142
|
+
}, Me = (...t) => (e) => t.some((s) => e.is(s)), $e = (...t) => (e, s) => t.some((n) => s.is(n)), fe = "gjs-plg-", se = "data-type-role", D = class D {
|
|
140
143
|
constructor(e) {
|
|
141
144
|
this.config = e;
|
|
142
145
|
}
|
|
@@ -198,7 +201,7 @@ const U = class U {
|
|
|
198
201
|
};
|
|
199
202
|
U.CSS_FLEX_DIRECTION = "flex-direction";
|
|
200
203
|
let q = U;
|
|
201
|
-
const
|
|
204
|
+
const B = class B {
|
|
202
205
|
constructor(e) {
|
|
203
206
|
this.config = e;
|
|
204
207
|
}
|
|
@@ -206,7 +209,7 @@ const N = class N {
|
|
|
206
209
|
var n;
|
|
207
210
|
if ((n = this.config) != null && n.getSize) return this.config.getSize(e);
|
|
208
211
|
const s = e.componentColumn;
|
|
209
|
-
if (s.is(
|
|
212
|
+
if (s.is(B.MJML_COLUMN_TYPE)) {
|
|
210
213
|
const i = s.getAttributes().width;
|
|
211
214
|
if (i && (i.includes("%") || !isNaN(parseFloat(i))))
|
|
212
215
|
return parseFloat(i);
|
|
@@ -221,12 +224,12 @@ const N = class N {
|
|
|
221
224
|
this.config.setSize(e);
|
|
222
225
|
else {
|
|
223
226
|
const { componentColumn: n, sizeValue: a, partial: i } = e;
|
|
224
|
-
n.is(
|
|
227
|
+
n.is(B.MJML_COLUMN_TYPE) && n.addAttributes({ width: `${parseFloat(a)}%` }, { partial: i });
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
};
|
|
228
|
-
|
|
229
|
-
let Z =
|
|
231
|
+
B.MJML_COLUMN_TYPE = "mj-column";
|
|
232
|
+
let Z = B;
|
|
230
233
|
const X = class X {
|
|
231
234
|
constructor(e) {
|
|
232
235
|
this.config = e;
|
|
@@ -252,7 +255,7 @@ const X = class X {
|
|
|
252
255
|
};
|
|
253
256
|
X.MJML_SECTION_TYPE = "mj-section";
|
|
254
257
|
let Q = X;
|
|
255
|
-
class
|
|
258
|
+
class He {
|
|
256
259
|
constructor(e) {
|
|
257
260
|
this.config = e;
|
|
258
261
|
}
|
|
@@ -263,8 +266,8 @@ class $e {
|
|
|
263
266
|
if (!a) return 0;
|
|
264
267
|
let i = a;
|
|
265
268
|
if (a.tagName !== "TABLE") {
|
|
266
|
-
const
|
|
267
|
-
|
|
269
|
+
const c = a.querySelectorAll("table");
|
|
270
|
+
c.length && (i = c[0]);
|
|
268
271
|
}
|
|
269
272
|
return n ? i.clientHeight : i.clientWidth;
|
|
270
273
|
}
|
|
@@ -285,7 +288,7 @@ class M {
|
|
|
285
288
|
return this.handlerCache.has(s) || ($(e) ? this.handlerCache.set(s, {
|
|
286
289
|
sizeHandler: new Z(e),
|
|
287
290
|
gapHandler: new Q(e),
|
|
288
|
-
parentSizeHandler: new
|
|
291
|
+
parentSizeHandler: new He(e)
|
|
289
292
|
}) : this.handlerCache.set(s, {
|
|
290
293
|
sizeHandler: new K(e),
|
|
291
294
|
gapHandler: new J(e),
|
|
@@ -300,15 +303,15 @@ const oe = (t) => {
|
|
|
300
303
|
t.style.display = "none";
|
|
301
304
|
}, re = (t) => {
|
|
302
305
|
t.style.display = "block";
|
|
303
|
-
}, H = (t) => +parseFloat(`${t}`).toFixed(2), $ = (t) => t.projectType === ge.email,
|
|
306
|
+
}, H = (t) => +parseFloat(`${t}`).toFixed(2), $ = (t) => t.projectType === ge.email, Ve = (t) => t ? ["top", "bottom"] : ["left", "right"], De = (t) => {
|
|
304
307
|
const e = t.parent();
|
|
305
308
|
return e ? e.components().models.indexOf(t) === 0 : !1;
|
|
306
|
-
},
|
|
309
|
+
}, je = (t) => {
|
|
307
310
|
const e = t.parent();
|
|
308
311
|
if (!e) return !1;
|
|
309
312
|
const s = e.components().models;
|
|
310
313
|
return s.indexOf(t) === s.length - 1;
|
|
311
|
-
},
|
|
314
|
+
}, Be = (t) => {
|
|
312
315
|
const e = t.parent();
|
|
313
316
|
if (!e) return !1;
|
|
314
317
|
const s = e.components().models;
|
|
@@ -316,23 +319,29 @@ const oe = (t) => {
|
|
|
316
319
|
}, Ne = (t, e, s, n) => {
|
|
317
320
|
const i = t + (s ? e === "top" ? -1 : e === "bottom" ? 1 : 0 : e === "left" ? -1 : e === "right" ? 1 : 0);
|
|
318
321
|
return i >= 0 && i < n ? i : -1;
|
|
319
|
-
}, O = (t) => t === "top" || t === "bottom",
|
|
322
|
+
}, O = (t) => t === "top" || t === "bottom", _e = (t, e) => !!(De(t) && (e === "left" || e === "top") || je(t) && (e === "right" || e === "bottom")), Fe = (t) => {
|
|
320
323
|
const e = t.parent();
|
|
321
324
|
return e ? e.components().models.length > 1 : !1;
|
|
322
325
|
}, le = (t, e) => t === "right" || t === "bottom" ? e > 0 : e < 0, ne = (t, e, s = !1) => {
|
|
323
|
-
const n = !s, a = t.getEl();
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
const n = !s, a = n ? 0 : "", i = t.getEl();
|
|
327
|
+
let o;
|
|
328
|
+
try {
|
|
329
|
+
o = i ? window.getComputedStyle(i) : void 0;
|
|
330
|
+
} catch {
|
|
331
|
+
o = void 0;
|
|
332
|
+
}
|
|
333
|
+
if (!o)
|
|
334
|
+
return a;
|
|
335
|
+
const c = o[e] || "";
|
|
327
336
|
if (n) {
|
|
328
337
|
let l;
|
|
329
|
-
return typeof
|
|
338
|
+
return typeof c == "string" ? (l = parseFloat(c.replace(/[^-\d.]/g, "")), isNaN(l) && (l = 0)) : l = Number(c) || 0, l;
|
|
330
339
|
}
|
|
331
|
-
return
|
|
340
|
+
return c;
|
|
332
341
|
}, ce = (t, e, s) => {
|
|
333
342
|
const n = ee({ componentRow: t, isVertical: e }, s), a = t.components().models;
|
|
334
343
|
return n * (a.length - 1);
|
|
335
|
-
},
|
|
344
|
+
}, N = (t, e) => T(e).parentSizeHandler.isLayoutVertical({ componentRow: t }), _ = (t, e) => T(e).sizeHandler.getSize(t), ee = (t, e) => {
|
|
336
345
|
if (e != null && e.disableGapHandler) return 0;
|
|
337
346
|
const { gapHandler: s, parentSizeHandler: n } = T(e);
|
|
338
347
|
if (!s.isGapSupported()) return 0;
|
|
@@ -341,19 +350,19 @@ const oe = (t) => {
|
|
|
341
350
|
}, te = (t, e) => T(e).parentSizeHandler.getParentSize(t), V = (t, e) => {
|
|
342
351
|
T(e).sizeHandler.setSize(t);
|
|
343
352
|
}, ye = (t, e) => {
|
|
344
|
-
const s =
|
|
353
|
+
const s = _(t, e);
|
|
345
354
|
V({ ...t, sizeValue: `${s}%`, partial: !1 }, e);
|
|
346
355
|
}, be = (t, e) => {
|
|
347
356
|
if (e != null && e.disableGapHandler) return;
|
|
348
357
|
const { gapHandler: s } = T(e);
|
|
349
358
|
s.isGapSupported() && s.setGap(t);
|
|
350
|
-
},
|
|
359
|
+
}, Oe = (t, e) => {
|
|
351
360
|
const s = t.getStyle().gap;
|
|
352
361
|
if (!s) return;
|
|
353
|
-
const n = t.components().models, a = { componentRow: t, isVertical:
|
|
362
|
+
const n = t.components().models, a = { componentRow: t, isVertical: N(t, e) };
|
|
354
363
|
n.map((i) => ye({ ...a, componentColumn: i }, e)), be({ ...a, gapValue: String(s), partial: !1 }, e);
|
|
355
364
|
};
|
|
356
|
-
function
|
|
365
|
+
function ke(t, e) {
|
|
357
366
|
const { Blocks: s } = t, { typeColumn: n, typeRow: a, blocks: i } = e;
|
|
358
367
|
if (i === !1 || $(e)) return;
|
|
359
368
|
const o = (r) => ({
|
|
@@ -362,36 +371,36 @@ function Oe(t, e) {
|
|
|
362
371
|
type: n,
|
|
363
372
|
style: { "flex-basis": `${h}%` }
|
|
364
373
|
}))
|
|
365
|
-
}),
|
|
374
|
+
}), c = (r) => `<div class="gs-block-item__flex-row" style="display: flex; height: 1.75rem; width: 100%; flex-wrap: nowrap; gap: 0.5rem;">
|
|
366
375
|
${r.map((h) => `<div style="flex-basis: ${h}%; border-color: currentColor; border-width: 2px; border-radius: 0.12rem;"></div>`).join("")}
|
|
367
|
-
</div>`,
|
|
376
|
+
</div>`, l = (r, h) => ({
|
|
368
377
|
id: `flex-row-${h.join("-")}`,
|
|
369
378
|
label: r,
|
|
370
379
|
category: "Layout",
|
|
371
380
|
select: !0,
|
|
372
381
|
full: !0,
|
|
373
382
|
attributes: { class: "gs-block-item__flex gs-utl-w-full" },
|
|
374
|
-
media:
|
|
383
|
+
media: c(h),
|
|
375
384
|
content: o(h)
|
|
376
385
|
}), g = [
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
], f =
|
|
386
|
+
l("1 Column", [100]),
|
|
387
|
+
l("2 Columns 50/50", [50, 50]),
|
|
388
|
+
l("2 Columns 25/75", [25, 75]),
|
|
389
|
+
l("2 Columns 75/25", [75, 25]),
|
|
390
|
+
l("3 Columns", [33.33, 33.33, 33.33]),
|
|
391
|
+
l("3 Columns 50/25/25", [50, 25, 25]),
|
|
392
|
+
l("3 Columns 25/50/25", [25, 50, 25]),
|
|
393
|
+
l("3 Columns 25/25/50", [25, 25, 50]),
|
|
394
|
+
l("4 Columns", [25, 25, 25, 25]),
|
|
395
|
+
l("5 Columns", [20, 20, 20, 20, 20])
|
|
396
|
+
], f = Ge(i) ? i({ blocks: g }) : g;
|
|
388
397
|
return f.forEach((r) => s.add(r.id, r)), () => {
|
|
389
398
|
f.forEach((r) => s.remove(r.id));
|
|
390
399
|
};
|
|
391
400
|
}
|
|
392
|
-
const
|
|
393
|
-
const { Components: s } = t, { typeRow: n, typeColumn: a, extendTypeColumn: i } = e, o = `${fe}${a}`,
|
|
394
|
-
if (!(!a ||
|
|
401
|
+
const Ue = (t, e) => {
|
|
402
|
+
const { Components: s } = t, { typeRow: n, typeColumn: a, extendTypeColumn: i } = e, o = `${fe}${a}`, l = !!a && !!s.getType(a) && !i;
|
|
403
|
+
if (!(!a || l || $(e)))
|
|
395
404
|
return s.addType(a, {
|
|
396
405
|
isComponent: he(a),
|
|
397
406
|
model: {
|
|
@@ -401,7 +410,7 @@ const ke = (t, e) => {
|
|
|
401
410
|
emptyState: !0,
|
|
402
411
|
classes: o,
|
|
403
412
|
icon: '<svg viewBox="0 0 24 24"><path d="M14.5 2.3A1.8 1.8 0 0 0 12.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8zm-8 0A1.8 1.8 0 0 0 4.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',
|
|
404
|
-
draggable:
|
|
413
|
+
draggable: $e(n),
|
|
405
414
|
attributes: { [se]: a },
|
|
406
415
|
styles: `
|
|
407
416
|
.${o} {
|
|
@@ -413,9 +422,9 @@ const ke = (t, e) => {
|
|
|
413
422
|
}), () => {
|
|
414
423
|
s.removeType(a);
|
|
415
424
|
};
|
|
416
|
-
},
|
|
417
|
-
const { Components: s } = t, { typeRow: n, typeColumn: a, extendTypeRow: i } = e, o = `${fe}${n}`,
|
|
418
|
-
if (!(!n ||
|
|
425
|
+
}, Xe = (t, e) => {
|
|
426
|
+
const { Components: s } = t, { typeRow: n, typeColumn: a, extendTypeRow: i } = e, o = `${fe}${n}`, l = !!n && !!s.getType(n) && !i;
|
|
427
|
+
if (!(!n || l || $(e)))
|
|
419
428
|
return s.addType(n, {
|
|
420
429
|
isComponent: he(n),
|
|
421
430
|
model: {
|
|
@@ -425,7 +434,7 @@ const ke = (t, e) => {
|
|
|
425
434
|
icon: '<svg viewBox="0 0 24 24"><path d="M4 4.8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3A1.8 1.8 0 0 0 20 4.7zm0 8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',
|
|
426
435
|
emptyState: { styleIn: "width: 100%" },
|
|
427
436
|
attributes: { [se]: n },
|
|
428
|
-
droppable:
|
|
437
|
+
droppable: Me(a),
|
|
429
438
|
traits: [
|
|
430
439
|
// {
|
|
431
440
|
// type: 'number',
|
|
@@ -483,7 +492,7 @@ const ke = (t, e) => {
|
|
|
483
492
|
}), () => {
|
|
484
493
|
s.removeType(n);
|
|
485
494
|
};
|
|
486
|
-
},
|
|
495
|
+
}, Pe = "flexComponent", Ye = L.startup;
|
|
487
496
|
class We {
|
|
488
497
|
constructor() {
|
|
489
498
|
this.resizableChildTypes = /* @__PURE__ */ new Set(), this.gapAdjustableParentTypes = /* @__PURE__ */ new Set(), this.typeRelationships = /* @__PURE__ */ new Map();
|
|
@@ -524,12 +533,12 @@ class Ke {
|
|
|
524
533
|
const o = e.parent();
|
|
525
534
|
if (!o || !this.registry.isValidRelationship(o, e)) return;
|
|
526
535
|
i.snapEnabled = o.get("snap") ?? a.snapEnabled, i.snapDivisions = o.get("snap-divisions") ?? a.snapDivisions ?? 12;
|
|
527
|
-
const
|
|
536
|
+
const c = o.components().models, l = c.findIndex((h) => h.cid === e.cid), g = N(o, a), f = Ne(l, s, g, c.length);
|
|
528
537
|
f !== -1 && (i.adjacentIdx = f);
|
|
529
538
|
const r = { componentColumn: e, componentRow: o, isVertical: g };
|
|
530
|
-
if (i.startPercent =
|
|
531
|
-
const h =
|
|
532
|
-
i.neighborStartPercent =
|
|
539
|
+
if (i.startPercent = _(r, a), typeof i.adjacentIdx < "u") {
|
|
540
|
+
const h = c[i.adjacentIdx];
|
|
541
|
+
i.neighborStartPercent = _({ ...r, componentColumn: h }, a);
|
|
533
542
|
}
|
|
534
543
|
}
|
|
535
544
|
updateResizeByDelta(e, s, n) {
|
|
@@ -537,26 +546,26 @@ class Ke {
|
|
|
537
546
|
!a.resizing || !i || (a.snapEnabled ? this.updateSnapResize(e, s, n) : this.updateContinuesResize(e, s, n));
|
|
538
547
|
}
|
|
539
548
|
finishResize(e) {
|
|
540
|
-
const s = e.parent(), n = s == null ? void 0 : s.components().models, a = { componentRow: s, isVertical: !!s &&
|
|
549
|
+
const s = e.parent(), n = s == null ? void 0 : s.components().models, a = { componentRow: s, isVertical: !!s && N(s, this.opts) };
|
|
541
550
|
n == null || n.forEach((i) => ye({ ...a, componentColumn: i }, this.opts)), this.clearState(e);
|
|
542
551
|
}
|
|
543
552
|
updateContinuesResize(e, s, n) {
|
|
544
553
|
const a = this.getState(e), i = e.parent(), { opts: o } = this;
|
|
545
554
|
if (!i) return;
|
|
546
|
-
const
|
|
555
|
+
const c = o.minItemPercent ?? 0, l = O(s), g = te({ componentRow: i, isVertical: l }, o), f = ce(i, l, this.opts), h = 100 - f / g * 100, I = n / (g - f) * h, { startPercent: b = 0, neighborStartPercent: x = 0 } = a, v = { componentRow: i, isVertical: l, componentColumn: e, partial: !0 }, G = le(s, n) ? b + Math.abs(I) : b - Math.abs(I);
|
|
547
556
|
if (typeof a.adjacentIdx < "u") {
|
|
548
|
-
const m = i.components().models[a.adjacentIdx], w = b + x, z = w -
|
|
549
|
-
V({ ...v, sizeValue: `${H(
|
|
557
|
+
const m = i.components().models[a.adjacentIdx], w = b + x, z = w - c, p = Math.min(z, Math.max(c, G)), u = w - p;
|
|
558
|
+
V({ ...v, sizeValue: `${H(p)}%` }, o), V(
|
|
550
559
|
{ ...v, componentColumn: m, sizeValue: `${H(u)}%` },
|
|
551
560
|
o
|
|
552
561
|
);
|
|
553
562
|
} else {
|
|
554
|
-
const m = Math.max(
|
|
563
|
+
const m = Math.max(c, Math.min(h, G));
|
|
555
564
|
V({ ...v, sizeValue: `${H(m)}%` }, o);
|
|
556
565
|
}
|
|
557
566
|
}
|
|
558
567
|
updateSnapResize(e, s, n) {
|
|
559
|
-
const a = this.getState(e), i = e.parent(), o = O(s),
|
|
568
|
+
const a = this.getState(e), i = e.parent(), o = O(s), c = te({ componentRow: i, isVertical: o }, this.opts), l = ce(i, o, this.opts), g = c - l, f = n / g * 100, r = le(s, n), { startPercent: h = 0, snapDivisions: I = 12 } = a, b = r ? h + Math.abs(f) : h - Math.abs(f), x = 100 / I, v = Math.floor(b / x) * x, G = Math.ceil(b / x) * x, m = Math.abs(G - b), w = Math.abs(b - v), z = x * 0.2, S = m < w ? G : v;
|
|
560
569
|
if (S > 0 && S < 100 && (m < z || w < z) && a.lastSnappedPercent !== S) {
|
|
561
570
|
a.lastSnappedPercent = S;
|
|
562
571
|
let y = Math.abs(S - h) / 100 * g;
|
|
@@ -570,20 +579,20 @@ class Je {
|
|
|
570
579
|
}
|
|
571
580
|
updateGapByDelta(e, s, n, a) {
|
|
572
581
|
if (!this.registry.isGapAdjustableParent(e)) return;
|
|
573
|
-
const { opts: i } = this, o = Math.max(0, n + s),
|
|
574
|
-
(z, S) => z +
|
|
582
|
+
const { opts: i } = this, o = Math.max(0, n + s), c = te({ componentRow: e, isVertical: a }, i), l = o / c * 100, g = e.components().models, f = g.length - 1, r = { componentRow: e, isVertical: a }, h = g.reduce(
|
|
583
|
+
(z, S) => z + _({ ...r, componentColumn: S }, i),
|
|
575
584
|
0
|
|
576
|
-
), b = 100 -
|
|
585
|
+
), b = 100 - l * f, x = i.minItemPercent || 5;
|
|
577
586
|
if (b < x * g.length)
|
|
578
587
|
return;
|
|
579
|
-
const G = 100 - f *
|
|
588
|
+
const G = 100 - f * l, m = h - G, w = { componentRow: e, isVertical: a, partial: !0 };
|
|
580
589
|
g.map((z) => {
|
|
581
|
-
const S =
|
|
582
|
-
V({ ...w, componentColumn: z, sizeValue: `${H(
|
|
583
|
-
}), be({ ...w, gapValue: `${H(
|
|
590
|
+
const S = _({ ...r, componentColumn: z }, i), p = S - S / h * m;
|
|
591
|
+
V({ ...w, componentColumn: z, sizeValue: `${H(p)}%` }, i);
|
|
592
|
+
}), be({ ...w, gapValue: `${H(l)}%` }, i);
|
|
584
593
|
}
|
|
585
594
|
finishGapAdjust(e) {
|
|
586
|
-
|
|
595
|
+
Oe(e, this.opts);
|
|
587
596
|
}
|
|
588
597
|
}
|
|
589
598
|
class qe {
|
|
@@ -616,9 +625,9 @@ class qe {
|
|
|
616
625
|
const k = "gs-flex-spots", pe = `${k}__handle-size`, Ze = `${k}__handle-gap`;
|
|
617
626
|
function Qe(t, e) {
|
|
618
627
|
const { Canvas: s } = t, n = "flex-resize-spot";
|
|
619
|
-
let a, i, o,
|
|
628
|
+
let a, i, o, c, l = null, g = null;
|
|
620
629
|
const f = new We(), r = new qe(t, f, e), h = () => {
|
|
621
|
-
var
|
|
630
|
+
var p;
|
|
622
631
|
a = document.createElement("div"), a.className = k, a.style.display = "none", i = document.createElement("div"), i.className = `${k}__handles`, i.style.position = "absolute", i.style.pointerEvents = "none", i.style.zIndex = "21", o = {
|
|
623
632
|
left: document.createElement("div"),
|
|
624
633
|
right: document.createElement("div"),
|
|
@@ -637,7 +646,7 @@ function Qe(t, e) {
|
|
|
637
646
|
${P === "top" ? "top: 0px;" : ""}
|
|
638
647
|
${P === "bottom" ? "bottom: 0px;" : ""}
|
|
639
648
|
`, y.addEventListener("pointerdown", I(P)), i.appendChild(y);
|
|
640
|
-
}), !e.disableGapHandler && !$(e) && (
|
|
649
|
+
}), !e.disableGapHandler && !$(e) && (c = document.createElement("div"), c.className = Ze, c.style.cssText = `
|
|
641
650
|
position: absolute;
|
|
642
651
|
background-color: var(--gs-theme-cl-cmp-bg1, #3b97e3);
|
|
643
652
|
border-width: 2px;
|
|
@@ -647,70 +656,70 @@ function Qe(t, e) {
|
|
|
647
656
|
pointer-events: all;
|
|
648
657
|
max-width: 3rem;
|
|
649
658
|
max-height: 3rem;
|
|
650
|
-
`,
|
|
651
|
-
}, I = (
|
|
652
|
-
if (!
|
|
653
|
-
u.stopPropagation(), u.preventDefault(), r.startResize(
|
|
659
|
+
`, c.addEventListener("pointerdown", b()), i.appendChild(c)), a.append(i), (p = s.getSpotsEl()) == null || p.appendChild(a);
|
|
660
|
+
}, I = (p) => (u) => {
|
|
661
|
+
if (!l) return;
|
|
662
|
+
u.stopPropagation(), u.preventDefault(), r.startResize(l, p, u);
|
|
654
663
|
const y = u.clientX, P = u.clientY;
|
|
655
664
|
u.target.setPointerCapture(u.pointerId);
|
|
656
665
|
const d = (E) => {
|
|
657
|
-
const C = t.Canvas.getZoomMultiplier(), A = (E.clientX - y) * C,
|
|
658
|
-
r.updateResizeByDelta(
|
|
666
|
+
const C = t.Canvas.getZoomMultiplier(), A = (E.clientX - y) * C, F = (E.clientY - P) * C, Y = O(p) ? F : A;
|
|
667
|
+
r.updateResizeByDelta(l, p, Y);
|
|
659
668
|
}, R = () => {
|
|
660
|
-
r.finishResize(
|
|
669
|
+
r.finishResize(l), u.target.releasePointerCapture(u.pointerId), document.removeEventListener("pointermove", d), document.removeEventListener("pointerup", R);
|
|
661
670
|
};
|
|
662
671
|
document.addEventListener("pointermove", d), document.addEventListener("pointerup", R);
|
|
663
|
-
}, b = () => (
|
|
672
|
+
}, b = () => (p) => {
|
|
664
673
|
if (!g) return;
|
|
665
674
|
const u = g;
|
|
666
|
-
|
|
667
|
-
const y =
|
|
668
|
-
|
|
675
|
+
p.stopPropagation(), p.preventDefault();
|
|
676
|
+
const y = N(u, e), P = ee({ componentRow: u, isVertical: y }, e), d = p.clientX, R = p.clientY;
|
|
677
|
+
p.target.setPointerCapture(p.pointerId);
|
|
669
678
|
const E = (A) => {
|
|
670
|
-
const
|
|
679
|
+
const F = t.Canvas.getZoomMultiplier(), Y = y ? (A.clientY - R) * F : (A.clientX - d) * F;
|
|
671
680
|
r.updateGapByDelta(u, Y, P, y);
|
|
672
681
|
}, C = () => {
|
|
673
|
-
r.finishGapAdjust(u),
|
|
682
|
+
r.finishGapAdjust(u), p.target.releasePointerCapture(p.pointerId), document.removeEventListener("pointermove", E), document.removeEventListener("pointerup", C);
|
|
674
683
|
};
|
|
675
684
|
document.addEventListener("pointermove", E), document.addEventListener("pointerup", C);
|
|
676
|
-
}, x = (
|
|
677
|
-
const u =
|
|
678
|
-
if (!u || !a || (
|
|
685
|
+
}, x = (p) => {
|
|
686
|
+
const u = p.component;
|
|
687
|
+
if (!u || !a || (l = u, g = u.parent(), !g)) return;
|
|
679
688
|
const y = g;
|
|
680
689
|
re(a);
|
|
681
|
-
const P =
|
|
690
|
+
const P = p.getStyle();
|
|
682
691
|
i && Object.assign(i.style, P);
|
|
683
|
-
const d =
|
|
692
|
+
const d = N(y, e), R = Ve(d);
|
|
684
693
|
if (Object.values(o).forEach(oe), R.forEach((C) => {
|
|
685
|
-
if (
|
|
694
|
+
if (_e(u, C)) return;
|
|
686
695
|
const A = o[C];
|
|
687
696
|
re(A);
|
|
688
|
-
}), T(e).gapHandler.isGapSupported() &&
|
|
697
|
+
}), T(e).gapHandler.isGapSupported() && c && Fe(u)) {
|
|
689
698
|
const C = ee({ componentRow: y, isVertical: d }, e);
|
|
690
|
-
v(C, d,
|
|
699
|
+
v(C, d, Be(u));
|
|
691
700
|
}
|
|
692
|
-
}, v = (
|
|
693
|
-
const P = e.gapHandleSize, d =
|
|
701
|
+
}, v = (p, u, y = !1) => {
|
|
702
|
+
const P = e.gapHandleSize, d = c.style;
|
|
694
703
|
if (u) {
|
|
695
704
|
d.height = `${P}px`;
|
|
696
|
-
const R =
|
|
697
|
-
y ? (d.top = `-${(
|
|
705
|
+
const R = c.offsetHeight;
|
|
706
|
+
y ? (d.top = `-${(p + R) / 2}px`, d.bottom = "") : (d.bottom = `-${(p + R) / 2}px`, d.top = ""), d.width = "50%", d.left = "50%", d.transform = "translateX(-50%)", d.cursor = "row-resize";
|
|
698
707
|
} else {
|
|
699
708
|
d.width = `${P}px`;
|
|
700
|
-
const R =
|
|
701
|
-
y ? (d.left = `-${(
|
|
709
|
+
const R = c.offsetWidth;
|
|
710
|
+
y ? (d.left = `-${(p + R) / 2}px`, d.right = "") : (d.right = `-${(p + R) / 2}px`, d.left = ""), d.height = "50%", d.top = "50%", d.transform = "translateY(-50%)", d.cursor = "col-resize";
|
|
702
711
|
}
|
|
703
712
|
}, G = () => {
|
|
704
|
-
a && (oe(a),
|
|
713
|
+
a && (oe(a), l = null, g = null);
|
|
705
714
|
}, m = () => {
|
|
706
715
|
s.removeSpots({ type: n });
|
|
707
|
-
const
|
|
708
|
-
|
|
716
|
+
const p = t.getSelected(), u = p == null ? void 0 : p.parent();
|
|
717
|
+
p && u && f.isValidRelationship(u, p) ? s.addSpot({ type: n, component: p }) : G();
|
|
709
718
|
}, w = () => {
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
}, z = (
|
|
713
|
-
f.registerTypeRelationship(
|
|
719
|
+
const p = s.getSpots().filter((u) => u.type === n)[0];
|
|
720
|
+
p && x(p);
|
|
721
|
+
}, z = (p, u) => {
|
|
722
|
+
f.registerTypeRelationship(p, u);
|
|
714
723
|
};
|
|
715
724
|
t.onReady(() => {
|
|
716
725
|
h(), $(e) ? z("mj-section", "mj-column") : z(e.typeRow, e.typeColumn);
|
|
@@ -728,17 +737,17 @@ const et = function(t, e = {}) {
|
|
|
728
737
|
snapDivisions: 12,
|
|
729
738
|
minItemPercent: 5,
|
|
730
739
|
...e
|
|
731
|
-
}, n = [
|
|
732
|
-
|
|
740
|
+
}, n = [Xe(t, s), Ue(t, s)], a = Qe(t, s), i = ke(t, s);
|
|
741
|
+
Ee({
|
|
733
742
|
editor: t,
|
|
734
743
|
licenseKey: s.licenseKey,
|
|
735
744
|
plan: Ye,
|
|
736
|
-
pluginName:
|
|
745
|
+
pluginName: Pe,
|
|
737
746
|
cleanup: () => {
|
|
738
747
|
n.forEach((o) => o == null ? void 0 : o()), a(), i == null || i();
|
|
739
748
|
}
|
|
740
749
|
});
|
|
741
|
-
}, tt =
|
|
750
|
+
}, tt = Te(et, Pe);
|
|
742
751
|
export {
|
|
743
752
|
tt as default
|
|
744
753
|
};
|