@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +175 -162
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/index.cjs.js +64 -64
- package/dist/aiChat/index.es.js +5785 -5757
- package/dist/aiChat/index.js +64 -64
- package/dist/aiChat/index.umd.js +63 -63
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +204 -191
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +183 -170
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +134 -121
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +165 -152
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +245 -232
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +155 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +257 -244
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +216 -203
- package/dist/dataSourceHandlebars/index.umd.js +7 -7
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +141 -128
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +484 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +173 -160
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +160 -147
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +196 -183
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +121 -108
- package/dist/index.umd.js +18 -18
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +157 -144
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -232
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +106 -93
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +157 -144
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +181 -168
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +385 -372
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +200 -187
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +118 -105
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +129 -116
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +203 -190
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +257 -244
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +121 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const I = "app.grapesjs.com", m = "app-stage.grapesjs.com", v = "app2.grapesjs.com", O = "app-stage2.grapesjs.com", $ = [
|
|
2
|
+
I,
|
|
3
|
+
v,
|
|
4
|
+
m,
|
|
5
|
+
O,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -11,88 +11,101 @@ const $ = "app.grapesjs.com", b = "app-stage.grapesjs.com", w = "app2.grapesjs.c
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
15
|
-
isDev:
|
|
14
|
+
], w = "license:check:end", T = () => typeof window < "u", L = ({
|
|
15
|
+
isDev: s,
|
|
16
16
|
isStage: t,
|
|
17
17
|
isPlatform: e
|
|
18
|
-
}) => `${
|
|
19
|
-
const
|
|
20
|
-
return !!
|
|
18
|
+
}) => `${s ? "" : `https://${t ? m : I}`}/${e ? "platform-api" : "api"}`, k = () => {
|
|
19
|
+
const s = T() && window.location.hostname;
|
|
20
|
+
return !!s && ($.includes(s) || $.some((t) => s.endsWith(t)));
|
|
21
21
|
};
|
|
22
|
-
async function
|
|
23
|
-
path:
|
|
22
|
+
async function A({
|
|
23
|
+
path: s,
|
|
24
24
|
baseApiUrl: t,
|
|
25
25
|
method: e = "GET",
|
|
26
|
-
headers:
|
|
26
|
+
headers: r = {},
|
|
27
27
|
params: n,
|
|
28
|
-
body:
|
|
28
|
+
body: a
|
|
29
29
|
}) {
|
|
30
|
-
const i = `${t ||
|
|
30
|
+
const i = `${t || L({ isDev: !1, isStage: !1 })}${s}`, l = {
|
|
31
31
|
method: e,
|
|
32
32
|
headers: {
|
|
33
33
|
"Content-Type": "application/json",
|
|
34
|
-
...
|
|
34
|
+
...r
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
37
|
+
a && (l.body = JSON.stringify(a));
|
|
38
|
+
const c = n ? new URLSearchParams(n).toString() : "", u = c ? `?${c}` : "", p = await fetch(`${i}${u}`, l);
|
|
39
39
|
if (!p.ok)
|
|
40
40
|
throw new Error(`HTTP error! status: ${p.status}`);
|
|
41
41
|
return p.json();
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
const
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
43
|
+
var y = /* @__PURE__ */ ((s) => (s.free = "free", s.startup = "startup", s.business = "business", s.enterprise = "enterprise", s))(y || {}), b = /* @__PURE__ */ ((s) => (s.toastAdd = "studio:toastAdd", s.toastRemove = "studio:toastRemove", s.dialogOpen = "studio:dialogOpen", s.dialogClose = "studio:dialogClose", s.dialogExportCode = "studio:dialogExportCode", s.dialogImportCode = "studio:dialogImportCode", s.sidebarLeftSet = "studio:sidebarLeft:set", s.sidebarLeftGet = "studio:sidebarLeft:get", s.sidebarLeftToggle = "studio:sidebarLeft:toggle", s.sidebarRightSet = "studio:sidebarRight:set", s.sidebarRightGet = "studio:sidebarRight:get", s.sidebarRightToggle = "studio:sidebarRight:toggle", s.sidebarTopSet = "studio:sidebarTop:set", s.sidebarTopGet = "studio:sidebarTop:get", s.sidebarTopToggle = "studio:sidebarTop:toggle", s.sidebarBottomSet = "studio:sidebarBottom:set", s.sidebarBottomGet = "studio:sidebarBottom:get", s.sidebarBottomToggle = "studio:sidebarBottom:toggle", s.symbolAdd = "studio:symbolAdd", s.symbolDetach = "studio:symbolDetach", s.symbolOverride = "studio:symbolOverride", s.symbolPropagateStyles = "studio:propagateStyles", s.getPagesConfig = "studio:getPagesConfig", s.setPagesConfig = "studio:setPagesConfig", s.getPageSettings = "studio:getPageSettings", s.setPageSettings = "studio:setPageSettings", s.clearPage = "studio:clearPage", s.projectFiles = "studio:projectFiles", s.validateCode = "studio:validateCode", s.canvasReload = "studio:canvasReload", s.getBlocksPanel = "studio:getBlocksPanel", s.setBlocksPanel = "studio:setBlocksPanel", s.getStateContextMenu = "studio:getStateContextMenu", s.setStateContextMenu = "studio:setStateContextMenu", s.contextMenuComponent = "studio:contextMenuComponent", s.layoutAdd = "studio:layoutAdd", s.layoutRemove = "studio:layoutRemove", s.layoutToggle = "studio:layoutToggle", s.layoutUpdate = "studio:layoutUpdate", s.layoutGet = "studio:layoutGet", s.layoutConfigGet = "studio:layoutConfigGet", s.layoutConfigSet = "studio:layoutConfigSet", s.layoutComponentAdd = "studio:layoutComponentAdd", s.layoutComponentGet = "studio:layoutComponentGet", s.layoutComponentRemove = "studio:layoutComponentRemove", s.layoutComponentRender = "studio:layoutComponentRender", s.getStateTheme = "studio:getStateTheme", s.setStateTheme = "studio:setStateTheme", s.settings = "studio:settings", s.assetProviderGet = "studio:assetProviderGet", s.assetProviderAdd = "studio:assetProviderAdd", s.assetProviderRemove = "studio:assetProviderRemove", s.fontGet = "studio:fontGet", s.fontAdd = "studio:fontAdd", s.fontRemove = "studio:fontRemove", s.fontManagerOpen = "studio:fontManagerOpen", s.menuFontLoad = "studio:menuFontLoad", s.toggleStateDataSource = "studio:toggleStateDataSource", s.getStateDataSource = "studio:getStateDataSource", s.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", s.dataSourceSetImporter = "studio:dataSourceSetImporter", s.dataSourceSetExporter = "studio:dataSourceSetExporter", s.setDragAbsolute = "studio:setDragAbsolute", s))(b || {});
|
|
44
|
+
const S = {
|
|
45
|
+
[y.free]: 0,
|
|
46
|
+
[y.startup]: 10,
|
|
47
|
+
[y.business]: 20,
|
|
48
|
+
[y.enterprise]: 30
|
|
49
49
|
};
|
|
50
|
-
function
|
|
51
|
-
const t =
|
|
52
|
-
return t.init = (e) => (
|
|
50
|
+
function B(s) {
|
|
51
|
+
const t = s;
|
|
52
|
+
return t.init = (e) => (r) => s(r, e), t;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
async function
|
|
56
|
-
editor:
|
|
54
|
+
const N = (s) => /* @__PURE__ */ B(s);
|
|
55
|
+
async function M({
|
|
56
|
+
editor: s,
|
|
57
57
|
plan: t,
|
|
58
58
|
pluginName: e,
|
|
59
|
-
licenseKey:
|
|
59
|
+
licenseKey: r,
|
|
60
60
|
onLicenseCheckResponse: n,
|
|
61
|
-
cleanup:
|
|
61
|
+
cleanup: a
|
|
62
62
|
}) {
|
|
63
|
-
let
|
|
64
|
-
const
|
|
65
|
-
console.warn("Cleanup plugin:", e, "Reason:", p),
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
const { error: h, sdkLicense:
|
|
69
|
-
if (!(
|
|
63
|
+
let o = "", i;
|
|
64
|
+
const l = (p) => {
|
|
65
|
+
console.warn("Cleanup plugin:", e, "Reason:", p), a();
|
|
66
|
+
}, c = (p = {}) => {
|
|
67
|
+
var f;
|
|
68
|
+
const { error: h, sdkLicense: E } = p, g = (f = p.plan) == null ? void 0 : f.category;
|
|
69
|
+
if (!(E || p.license) || h)
|
|
70
70
|
l(h || "Invalid license");
|
|
71
|
-
else if (
|
|
72
|
-
const
|
|
73
|
-
|
|
71
|
+
else if (g) {
|
|
72
|
+
const x = S[t], P = S[g];
|
|
73
|
+
x > P && l({ pluginRequiredPlan: t, licensePlan: g });
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
76
|
+
s.Commands.has(b.settings) && (i = s.runCommand(b.settings), o = (i == null ? void 0 : i.baseUrl) || "");
|
|
77
|
+
const u = (p) => {
|
|
78
|
+
n == null || n(p), p && c(p);
|
|
79
|
+
};
|
|
80
|
+
if (!i) {
|
|
81
|
+
s.onReady(async () => {
|
|
82
|
+
if (!k())
|
|
83
|
+
if (r) {
|
|
84
|
+
const p = await j({ licenseKey: r, pluginName: e, baseApiUrl: o });
|
|
85
|
+
u(p);
|
|
86
|
+
} else
|
|
87
|
+
l("The `licenseKey` option not provided");
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (i.licensePlan || i.licenseError) {
|
|
92
|
+
const p = G(i);
|
|
93
|
+
u(p);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
s.on(w, (p) => u(p));
|
|
90
97
|
}
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
const G = (s) => ({
|
|
99
|
+
sdkLicense: s.license,
|
|
100
|
+
license: s.license,
|
|
101
|
+
error: s.licenseError,
|
|
102
|
+
plan: s.licensePlan
|
|
103
|
+
});
|
|
104
|
+
async function j(s) {
|
|
105
|
+
const { licenseKey: t, pluginName: e, baseApiUrl: r } = s;
|
|
93
106
|
try {
|
|
94
|
-
return (await
|
|
95
|
-
baseApiUrl:
|
|
107
|
+
return (await A({
|
|
108
|
+
baseApiUrl: r,
|
|
96
109
|
path: `/sdk/${t || "na"}`,
|
|
97
110
|
method: "POST",
|
|
98
111
|
params: {
|
|
@@ -104,36 +117,36 @@ async function M(o) {
|
|
|
104
117
|
return console.error("Error during SDK license check:", n), !1;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
|
-
const
|
|
108
|
-
const t =
|
|
120
|
+
const D = (s) => {
|
|
121
|
+
const t = s;
|
|
109
122
|
return t.logicalOperator === "and" || t.logicalOperator === "or";
|
|
110
|
-
},
|
|
111
|
-
...
|
|
123
|
+
}, F = (s, t) => (s.config.optsHtml = {
|
|
124
|
+
...s.config.optsHtml,
|
|
112
125
|
exporter: t
|
|
113
126
|
}, () => {
|
|
114
|
-
|
|
115
|
-
}),
|
|
127
|
+
s.config.optsHtml.exporter = void 0;
|
|
128
|
+
}), J = (s, t) => {
|
|
116
129
|
const e = (n) => {
|
|
117
|
-
const { input:
|
|
118
|
-
(!
|
|
119
|
-
},
|
|
120
|
-
return
|
|
121
|
-
|
|
130
|
+
const { input: a } = n, { contains: o } = t;
|
|
131
|
+
(!o || a.includes(o)) && (n.input = t.importer.import(a));
|
|
132
|
+
}, r = s.Parser.events.htmlBefore;
|
|
133
|
+
return s.on(r, e), () => {
|
|
134
|
+
s.off(r, e);
|
|
122
135
|
};
|
|
123
136
|
};
|
|
124
|
-
class
|
|
137
|
+
class W {
|
|
125
138
|
getVariableSyntax({ dataResolver: t }) {
|
|
126
|
-
const { defaultValue: e } = t,
|
|
127
|
-
return `<%= ${
|
|
139
|
+
const { defaultValue: e } = t, r = this.getFullPath(t), n = e ? ` || \`${e}\`` : "";
|
|
140
|
+
return `<%= ${r}${n} %>`;
|
|
128
141
|
}
|
|
129
142
|
getCollectionStartSyntax({ dataResolver: t }) {
|
|
130
|
-
const { collectionId: e, dataSource:
|
|
131
|
-
let
|
|
132
|
-
if (n !== void 0 ||
|
|
133
|
-
const
|
|
134
|
-
|
|
143
|
+
const { collectionId: e, dataSource: r, startIndex: n, endIndex: a } = t, o = (r == null ? void 0 : r.path) || e || "", i = this._sanitizeVariableName(e);
|
|
144
|
+
let l = "";
|
|
145
|
+
if (n !== void 0 || a !== void 0) {
|
|
146
|
+
const c = n ?? 0, u = a !== void 0 ? a : "";
|
|
147
|
+
l = `.slice(${c}${u !== "" ? `, ${u}` : ""})`;
|
|
135
148
|
}
|
|
136
|
-
return `<% ${
|
|
149
|
+
return `<% ${o}${l}.forEach(function(currentItem, index, arr) {
|
|
137
150
|
const startIndex = parseInt(${n ?? 0}, 10);
|
|
138
151
|
const endIndex = startIndex + arr.length;
|
|
139
152
|
const ${i}={ currentItem, currentIndex: startIndex + index, remainingItems: endIndex - (startIndex + index)} %>`;
|
|
@@ -153,37 +166,37 @@ const ${i}={ currentItem, currentIndex: startIndex + index, remainingItems: endI
|
|
|
153
166
|
getConditionalEndSyntax() {
|
|
154
167
|
return "<% } %>";
|
|
155
168
|
}
|
|
156
|
-
getFullPath({ collectionId: t, path: e, variableType:
|
|
157
|
-
return (t ? [this._sanitizeVariableName(t),
|
|
169
|
+
getFullPath({ collectionId: t, path: e, variableType: r }) {
|
|
170
|
+
return (t ? [this._sanitizeVariableName(t), r, e].filter(Boolean).join(".") : e) || "";
|
|
158
171
|
}
|
|
159
172
|
_parseCondition(t) {
|
|
160
173
|
if (!t) return "";
|
|
161
|
-
if (
|
|
162
|
-
const e = t.statements.map((
|
|
163
|
-
let n = e.length > 1 ? `(${e.join(`)${
|
|
174
|
+
if (D(t)) {
|
|
175
|
+
const e = t.statements.map((a) => this._parseCondition(a)), r = _[t.logicalOperator];
|
|
176
|
+
let n = e.length > 1 ? `(${e.join(`)${r}(`)})` : e[0];
|
|
164
177
|
return t.logicalOperator === "xor" && (n = `!!(${n})`), n;
|
|
165
178
|
} else {
|
|
166
|
-
const e = this._parseValue(t.left),
|
|
179
|
+
const e = this._parseValue(t.left), r = this._parseValue(t.right);
|
|
167
180
|
switch (t.operator) {
|
|
168
181
|
case "equals":
|
|
169
|
-
return `${e} === ${
|
|
182
|
+
return `${e} === ${r}`;
|
|
170
183
|
case ">":
|
|
171
184
|
case "<":
|
|
172
185
|
case ">=":
|
|
173
186
|
case "<=":
|
|
174
187
|
case "=":
|
|
175
188
|
case "!=":
|
|
176
|
-
return `${e} ${t.operator} ${
|
|
189
|
+
return `${e} ${t.operator} ${r}`;
|
|
177
190
|
case "contains":
|
|
178
|
-
return `${e}?.includes(${
|
|
191
|
+
return `${e}?.includes(${r})`;
|
|
179
192
|
case "startsWith":
|
|
180
|
-
return `${e}?.startsWith(${
|
|
193
|
+
return `${e}?.startsWith(${r})`;
|
|
181
194
|
case "endsWith":
|
|
182
|
-
return `${e}?.endsWith(${
|
|
195
|
+
return `${e}?.endsWith(${r})`;
|
|
183
196
|
case "equalsIgnoreCase":
|
|
184
|
-
return `${e}?.toLowerCase() === ${
|
|
197
|
+
return `${e}?.toLowerCase() === ${r}?.toLowerCase()`;
|
|
185
198
|
case "trimEquals":
|
|
186
|
-
return `${e}?.trim() === ${
|
|
199
|
+
return `${e}?.trim() === ${r}?.trim()`;
|
|
187
200
|
case "isTruthy":
|
|
188
201
|
return `!!${e}`;
|
|
189
202
|
case "isFalsy":
|
|
@@ -205,7 +218,7 @@ const ${i}={ currentItem, currentIndex: startIndex + index, remainingItems: endI
|
|
|
205
218
|
case "isBoolean":
|
|
206
219
|
return `typeof ${e} === 'boolean'`;
|
|
207
220
|
default:
|
|
208
|
-
return `${e} ${t.operator} ${
|
|
221
|
+
return `${e} ${t.operator} ${r}`;
|
|
209
222
|
}
|
|
210
223
|
}
|
|
211
224
|
}
|
|
@@ -213,11 +226,11 @@ const ${i}={ currentItem, currentIndex: startIndex + index, remainingItems: endI
|
|
|
213
226
|
return typeof t == "object" ? this.getFullPath(t) : typeof t == "string" ? `'${t.replace(/'/g, "\\'")}'` : String(t);
|
|
214
227
|
}
|
|
215
228
|
}
|
|
216
|
-
const
|
|
229
|
+
const _ = {
|
|
217
230
|
and: "&&",
|
|
218
231
|
or: "||",
|
|
219
232
|
xor: "^"
|
|
220
|
-
},
|
|
233
|
+
}, R = ["===", "==", "!==", "!=", "<=", ">=", "<", ">", "&&", "||"], U = {
|
|
221
234
|
"===": "=",
|
|
222
235
|
"==": "=",
|
|
223
236
|
"!==": "!=",
|
|
@@ -244,37 +257,37 @@ class V {
|
|
|
244
257
|
}
|
|
245
258
|
parseEjsTemplate(t) {
|
|
246
259
|
const e = [];
|
|
247
|
-
let
|
|
248
|
-
for (;
|
|
249
|
-
const n = t.indexOf("<%",
|
|
260
|
+
let r = 0;
|
|
261
|
+
for (; r < t.length; ) {
|
|
262
|
+
const n = t.indexOf("<%", r);
|
|
250
263
|
if (n === -1) {
|
|
251
|
-
|
|
264
|
+
r < t.length && e.push(this.createAppendLiteral(t.slice(r)));
|
|
252
265
|
break;
|
|
253
266
|
}
|
|
254
|
-
n >
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
267
|
+
n > r && e.push(this.createAppendLiteral(t.slice(r, n)));
|
|
268
|
+
const a = t.indexOf("%>", n);
|
|
269
|
+
if (a === -1)
|
|
257
270
|
throw new Error("Unclosed EJS tag");
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
const i =
|
|
271
|
+
const o = t.slice(n + 2, a).trim();
|
|
272
|
+
if (r = a + 2, o.startsWith("=") || o.startsWith("-")) {
|
|
273
|
+
const i = o.slice(1).trim();
|
|
261
274
|
e.push(this.createAppendExpression(i));
|
|
262
275
|
} else {
|
|
263
|
-
if (
|
|
276
|
+
if (o.startsWith("#"))
|
|
264
277
|
continue;
|
|
265
|
-
if (
|
|
266
|
-
const i = this.parseIfStatement(
|
|
267
|
-
e.push(i),
|
|
268
|
-
} else if (
|
|
269
|
-
const i = this.parseForStatement(
|
|
270
|
-
e.push(i),
|
|
278
|
+
if (o.startsWith("if")) {
|
|
279
|
+
const i = this.parseIfStatement(o, t, r);
|
|
280
|
+
e.push(i), r = i.endPos || r;
|
|
281
|
+
} else if (o.startsWith("for")) {
|
|
282
|
+
const i = this.parseForStatement(o, t, r);
|
|
283
|
+
e.push(i), r = i.endPos || r;
|
|
271
284
|
} else {
|
|
272
|
-
const i =
|
|
285
|
+
const i = o.match(/([\w][\w.-]*[\w])\s*\.\s*forEach\s*\(\s*(\w+)\s*=>\s*\{?/);
|
|
273
286
|
if (i) {
|
|
274
|
-
const
|
|
275
|
-
e.push(u),
|
|
287
|
+
const l = i[1], c = i[2], u = this.parseForEachStatement(l, c, t, r);
|
|
288
|
+
e.push(u), r = u.endPos || r;
|
|
276
289
|
} else
|
|
277
|
-
this.addMessage("info", `Unsupported scriptlet content: ${
|
|
290
|
+
this.addMessage("info", `Unsupported scriptlet content: ${o}`);
|
|
278
291
|
}
|
|
279
292
|
}
|
|
280
293
|
}
|
|
@@ -303,57 +316,57 @@ class V {
|
|
|
303
316
|
}
|
|
304
317
|
};
|
|
305
318
|
}
|
|
306
|
-
parseIfStatement(t, e,
|
|
319
|
+
parseIfStatement(t, e, r) {
|
|
307
320
|
const n = t.match(/if\s*\((.*)\)\s*\{?/);
|
|
308
321
|
if (!n)
|
|
309
322
|
throw new Error("Invalid if statement syntax");
|
|
310
|
-
const
|
|
311
|
-
let
|
|
312
|
-
const u = e.indexOf("<%",
|
|
313
|
-
if (u ===
|
|
323
|
+
const a = this.parseJsExpression(n[1]), { body: o, endPos: i } = this.parseTemplateBlock(e, r);
|
|
324
|
+
let l = null, c = i;
|
|
325
|
+
const u = e.indexOf("<%", c);
|
|
326
|
+
if (u === c) {
|
|
314
327
|
const p = e.indexOf("%>", u);
|
|
315
328
|
if (p !== -1) {
|
|
316
|
-
const h = e.slice(u + 2, p).trim(),
|
|
329
|
+
const h = e.slice(u + 2, p).trim(), E = p + 2 - u;
|
|
317
330
|
if (h.startsWith("} else if")) {
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
331
|
+
c = u + E;
|
|
332
|
+
const g = h.substring(h.indexOf("if")).trim(), d = this.parseIfStatement(g, e, c);
|
|
333
|
+
l = {
|
|
321
334
|
type: "IfStatement",
|
|
322
|
-
test:
|
|
323
|
-
consequent:
|
|
324
|
-
alternate:
|
|
325
|
-
},
|
|
335
|
+
test: d.test,
|
|
336
|
+
consequent: d.consequent,
|
|
337
|
+
alternate: d.alternate
|
|
338
|
+
}, c = d.endPos;
|
|
326
339
|
} else if (h.startsWith("} else")) {
|
|
327
|
-
|
|
328
|
-
const { body:
|
|
329
|
-
|
|
340
|
+
c = u + E;
|
|
341
|
+
const { body: g, endPos: d } = this.parseTemplateBlock(e, c);
|
|
342
|
+
l = {
|
|
330
343
|
type: "BlockStatement",
|
|
331
|
-
body:
|
|
332
|
-
},
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
} else h === "}" && (
|
|
344
|
+
body: g
|
|
345
|
+
}, c = d;
|
|
346
|
+
const f = e.indexOf("<%", c), x = e.indexOf("%>", f);
|
|
347
|
+
f === c && e.slice(f + 2, x).trim() === "}" && (c = x + 2);
|
|
348
|
+
} else h === "}" && (c = u + E);
|
|
336
349
|
}
|
|
337
350
|
}
|
|
338
351
|
return {
|
|
339
352
|
type: "IfStatement",
|
|
340
|
-
test:
|
|
353
|
+
test: a,
|
|
341
354
|
consequent: {
|
|
342
355
|
type: "BlockStatement",
|
|
343
|
-
body:
|
|
356
|
+
body: o
|
|
344
357
|
},
|
|
345
|
-
alternate:
|
|
346
|
-
endPos:
|
|
358
|
+
alternate: l,
|
|
359
|
+
endPos: c
|
|
347
360
|
};
|
|
348
361
|
}
|
|
349
|
-
parseForStatement(t, e,
|
|
362
|
+
parseForStatement(t, e, r) {
|
|
350
363
|
const n = t.match(/for\s*\((.*)\)\s*\{?/);
|
|
351
364
|
if (!n)
|
|
352
365
|
throw new Error("Invalid for statement syntax");
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
366
|
+
const a = n[1].split("of");
|
|
367
|
+
if (a.length !== 2)
|
|
355
368
|
throw new Error("Only for...of loops are supported");
|
|
356
|
-
const
|
|
369
|
+
const o = a[0].trim().replace(/^let\s+|^const\s+|^var\s+/, ""), i = a[1].trim(), { body: l, endPos: c } = this.parseTemplateBlock(e, r);
|
|
357
370
|
return {
|
|
358
371
|
type: "ForStatement",
|
|
359
372
|
init: {
|
|
@@ -362,7 +375,7 @@ class V {
|
|
|
362
375
|
declarations: [
|
|
363
376
|
{
|
|
364
377
|
type: "VariableDeclarator",
|
|
365
|
-
id: { type: "Identifier", name:
|
|
378
|
+
id: { type: "Identifier", name: o },
|
|
366
379
|
init: this.parseJsExpression(i)
|
|
367
380
|
}
|
|
368
381
|
]
|
|
@@ -371,72 +384,72 @@ class V {
|
|
|
371
384
|
update: null,
|
|
372
385
|
body: {
|
|
373
386
|
type: "BlockStatement",
|
|
374
|
-
body:
|
|
387
|
+
body: l
|
|
375
388
|
},
|
|
376
389
|
// Consume the closing '}' tag for the for loop
|
|
377
390
|
endPos: (() => {
|
|
378
|
-
const u = e.indexOf("<%",
|
|
379
|
-
return u ===
|
|
391
|
+
const u = e.indexOf("<%", c), p = e.indexOf("%>", u);
|
|
392
|
+
return u === c && e.slice(u + 2, p).trim() === "}" ? p + 2 : c;
|
|
380
393
|
})()
|
|
381
394
|
};
|
|
382
395
|
}
|
|
383
|
-
parseForEachStatement(t, e,
|
|
384
|
-
const { body:
|
|
396
|
+
parseForEachStatement(t, e, r, n) {
|
|
397
|
+
const { body: a, endPos: o } = this.parseTemplateBlock(r, n);
|
|
385
398
|
return {
|
|
386
399
|
type: "ForEachStatement",
|
|
387
400
|
collection: this.parseJsExpression(t),
|
|
388
401
|
itemIdentifier: { type: "Identifier", name: e },
|
|
389
402
|
body: {
|
|
390
403
|
type: "BlockStatement",
|
|
391
|
-
body:
|
|
404
|
+
body: a
|
|
392
405
|
},
|
|
393
406
|
endPos: (() => {
|
|
394
|
-
const i =
|
|
395
|
-
return i ===
|
|
407
|
+
const i = r.indexOf("<%", o), l = r.indexOf("%>", i);
|
|
408
|
+
return i === o && r.slice(i + 2, l).trim() === "}" ? l + 2 : o;
|
|
396
409
|
})()
|
|
397
410
|
};
|
|
398
411
|
}
|
|
399
412
|
parseTemplateBlock(t, e) {
|
|
400
|
-
const
|
|
413
|
+
const r = [];
|
|
401
414
|
let n = e;
|
|
402
415
|
for (; n < t.length; ) {
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
-
n < t.length &&
|
|
416
|
+
const a = t.indexOf("<%", n);
|
|
417
|
+
if (a === -1) {
|
|
418
|
+
n < t.length && r.push(this.createAppendLiteral(t.slice(n))), n = t.length;
|
|
406
419
|
break;
|
|
407
420
|
}
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
if (
|
|
421
|
+
a > n && r.push(this.createAppendLiteral(t.slice(n, a)));
|
|
422
|
+
const o = t.indexOf("%>", a);
|
|
423
|
+
if (o === -1)
|
|
411
424
|
throw new Error("Unclosed EJS tag within block");
|
|
412
|
-
const i = t.slice(
|
|
425
|
+
const i = t.slice(a + 2, o).trim();
|
|
413
426
|
if (i === "}" || i.startsWith("} else")) {
|
|
414
|
-
n =
|
|
427
|
+
n = a;
|
|
415
428
|
break;
|
|
416
429
|
}
|
|
417
|
-
if (n =
|
|
418
|
-
const
|
|
419
|
-
|
|
430
|
+
if (n = o + 2, i.startsWith("=") || i.startsWith("-")) {
|
|
431
|
+
const l = i.slice(1).trim();
|
|
432
|
+
r.push(this.createAppendExpression(l));
|
|
420
433
|
} else {
|
|
421
434
|
if (i.startsWith("#"))
|
|
422
435
|
continue;
|
|
423
436
|
if (i.startsWith("if")) {
|
|
424
|
-
const
|
|
425
|
-
|
|
437
|
+
const l = this.parseIfStatement(i, t, n);
|
|
438
|
+
r.push(l), n = l.endPos || n;
|
|
426
439
|
} else if (i.startsWith("for")) {
|
|
427
|
-
const
|
|
428
|
-
|
|
440
|
+
const l = this.parseForStatement(i, t, n);
|
|
441
|
+
r.push(l), n = l.endPos || n;
|
|
429
442
|
} else {
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
433
|
-
|
|
443
|
+
const l = i.match(/([\w][\w.-]*[\w])\s*\.\s*forEach\s*\(\s*(\w+)\s*=>\s*\{?/);
|
|
444
|
+
if (l) {
|
|
445
|
+
const c = l[1], u = l[2], p = this.parseForEachStatement(c, u, t, n);
|
|
446
|
+
r.push(p), n = p.endPos || n;
|
|
434
447
|
} else
|
|
435
448
|
this.addMessage("info", `Unsupported scriptlet content within block: ${i}`);
|
|
436
449
|
}
|
|
437
450
|
}
|
|
438
451
|
}
|
|
439
|
-
return { body:
|
|
452
|
+
return { body: r, endPos: n };
|
|
440
453
|
}
|
|
441
454
|
parseJsExpression(t) {
|
|
442
455
|
if (/^(['"]).*\1$/.test(t))
|
|
@@ -459,34 +472,34 @@ class V {
|
|
|
459
472
|
type: "Literal",
|
|
460
473
|
value: t === "true"
|
|
461
474
|
};
|
|
462
|
-
for (const n of
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
475
|
+
for (const n of R) {
|
|
476
|
+
const a = t.lastIndexOf(n);
|
|
477
|
+
if (a > 0 && t[a - 1] !== "!" && t[a - 1] !== "=" && t[a - 1] !== "<" && t[a - 1] !== ">")
|
|
465
478
|
return {
|
|
466
479
|
type: n === "&&" || n === "||" ? "LogicalExpression" : "BinaryExpression",
|
|
467
|
-
operator:
|
|
468
|
-
left: this.parseJsExpression(t.slice(0,
|
|
469
|
-
right: this.parseJsExpression(t.slice(
|
|
480
|
+
operator: U[n],
|
|
481
|
+
left: this.parseJsExpression(t.slice(0, a).trim()),
|
|
482
|
+
right: this.parseJsExpression(t.slice(a + n.length).trim())
|
|
470
483
|
};
|
|
471
484
|
}
|
|
472
|
-
const e = t.indexOf("."),
|
|
473
|
-
if (e > 0 && (
|
|
474
|
-
const n = e > 0 && (
|
|
475
|
-
let
|
|
485
|
+
const e = t.indexOf("."), r = t.indexOf("[");
|
|
486
|
+
if (e > 0 && (r === -1 || e < r) || r > 0 && (e === -1 || r < e)) {
|
|
487
|
+
const n = e > 0 && (r === -1 || e < r) ? e : r;
|
|
488
|
+
let a, o, i = !1;
|
|
476
489
|
if (n === e)
|
|
477
|
-
|
|
490
|
+
a = t.slice(0, e), o = { type: "Identifier", name: t.slice(e + 1) }, i = !1;
|
|
478
491
|
else {
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
492
|
+
a = t.slice(0, r);
|
|
493
|
+
const l = t.indexOf("]", r);
|
|
494
|
+
if (l === -1)
|
|
482
495
|
throw new Error("Unclosed bracket in expression");
|
|
483
|
-
const
|
|
484
|
-
|
|
496
|
+
const c = t.slice(r + 1, l);
|
|
497
|
+
o = /^(['"]).*\1$/.test(c) || /^-?\d+(\.\d+)?$/.test(c) ? this.parseJsExpression(c) : { type: "Identifier", name: c }, i = !0;
|
|
485
498
|
}
|
|
486
499
|
return {
|
|
487
500
|
type: "MemberExpression",
|
|
488
|
-
object: this.parseJsExpression(
|
|
489
|
-
property:
|
|
501
|
+
object: this.parseJsExpression(a),
|
|
502
|
+
property: o,
|
|
490
503
|
computed: i
|
|
491
504
|
};
|
|
492
505
|
}
|
|
@@ -529,8 +542,8 @@ class V {
|
|
|
529
542
|
}
|
|
530
543
|
handleProgram(t) {
|
|
531
544
|
let e = "";
|
|
532
|
-
for (const
|
|
533
|
-
e += this.astToGrapesJS(
|
|
545
|
+
for (const r of t.body)
|
|
546
|
+
e += this.astToGrapesJS(r);
|
|
534
547
|
return e;
|
|
535
548
|
}
|
|
536
549
|
handleVariableDeclaration(t) {
|
|
@@ -540,11 +553,11 @@ class V {
|
|
|
540
553
|
return t.expression.type === "CallExpression" && t.expression.callee.type === "Identifier" && t.expression.callee.name === "__append" && t.expression.arguments.length > 0 ? this.astToGrapesJS(t.expression.arguments[0]) : "";
|
|
541
554
|
}
|
|
542
555
|
handleIfStatement(t) {
|
|
543
|
-
const e = this.getConditionExpression(t.test),
|
|
556
|
+
const e = this.getConditionExpression(t.test), r = this.astToGrapesJS(t.consequent);
|
|
544
557
|
let n = "";
|
|
545
558
|
return t.alternate && (n = this.astToGrapesJS(t.alternate)), `
|
|
546
559
|
<data-condition data-gjs-data-resolver='${JSON.stringify({ condition: e })}'>
|
|
547
|
-
<data-condition-true-content>${
|
|
560
|
+
<data-condition-true-content>${r}</data-condition-true-content>
|
|
548
561
|
<data-condition-false-content>${n}</data-condition-false-content>
|
|
549
562
|
</data-condition>
|
|
550
563
|
`;
|
|
@@ -556,44 +569,44 @@ class V {
|
|
|
556
569
|
const e = t.init.declarations[0];
|
|
557
570
|
if (e.id.type !== "Identifier")
|
|
558
571
|
return this.addMessage("warning", "Unsupported for loop variable declaration id"), "";
|
|
559
|
-
let
|
|
572
|
+
let r = "";
|
|
560
573
|
if (e.init)
|
|
561
|
-
|
|
574
|
+
r = this.getExpressionString(e.init);
|
|
562
575
|
else
|
|
563
576
|
return this.addMessage("warning", "For loop collection is undefined"), "";
|
|
564
|
-
const n = e.id.name,
|
|
577
|
+
const n = e.id.name, a = n;
|
|
565
578
|
this.collectionStack.push(n);
|
|
566
|
-
const
|
|
579
|
+
const o = this.astToGrapesJS(t.body);
|
|
567
580
|
return this.collectionStack.pop(), `
|
|
568
581
|
<data-collection data-gjs-data-resolver='${JSON.stringify({
|
|
569
|
-
dataSource: { type: "data-variable", path:
|
|
570
|
-
collectionId:
|
|
582
|
+
dataSource: { type: "data-variable", path: r },
|
|
583
|
+
collectionId: a
|
|
571
584
|
})}'>
|
|
572
585
|
<data-collection-item>
|
|
573
|
-
${
|
|
586
|
+
${o}
|
|
574
587
|
</data-collection-item>
|
|
575
588
|
</data-collection>
|
|
576
589
|
`;
|
|
577
590
|
}
|
|
578
591
|
handleForEachStatement(t) {
|
|
579
|
-
const e = this.getExpressionString(t.collection),
|
|
580
|
-
this.collectionStack.push(
|
|
581
|
-
const
|
|
592
|
+
const e = this.getExpressionString(t.collection), r = t.itemIdentifier.name, n = r;
|
|
593
|
+
this.collectionStack.push(r);
|
|
594
|
+
const a = this.astToGrapesJS(t.body);
|
|
582
595
|
return this.collectionStack.pop(), `
|
|
583
596
|
<data-collection data-gjs-data-resolver='${JSON.stringify({
|
|
584
597
|
dataSource: { type: "data-variable", path: e },
|
|
585
598
|
collectionId: n
|
|
586
599
|
})}'>
|
|
587
600
|
<data-collection-item>
|
|
588
|
-
${
|
|
601
|
+
${a}
|
|
589
602
|
</data-collection-item>
|
|
590
603
|
</data-collection>
|
|
591
604
|
`;
|
|
592
605
|
}
|
|
593
606
|
handleBlockStatement(t) {
|
|
594
607
|
let e = "";
|
|
595
|
-
for (const
|
|
596
|
-
e += this.astToGrapesJS(
|
|
608
|
+
for (const r of t.body)
|
|
609
|
+
e += this.astToGrapesJS(r);
|
|
597
610
|
return e;
|
|
598
611
|
}
|
|
599
612
|
handleLiteral(t) {
|
|
@@ -602,9 +615,9 @@ class V {
|
|
|
602
615
|
handleIdentifier(t) {
|
|
603
616
|
let e = { path: t.name };
|
|
604
617
|
if (this.collectionStack.length > 0) {
|
|
605
|
-
const
|
|
606
|
-
t.name ===
|
|
607
|
-
collectionId:
|
|
618
|
+
const r = this.collectionStack[this.collectionStack.length - 1];
|
|
619
|
+
t.name === r && (e = {
|
|
620
|
+
collectionId: r,
|
|
608
621
|
variableType: "currentItem"
|
|
609
622
|
});
|
|
610
623
|
}
|
|
@@ -613,18 +626,18 @@ class V {
|
|
|
613
626
|
handleMemberExpression(t, e = {}) {
|
|
614
627
|
let n = { path: this.getExpressionString(t), ...e };
|
|
615
628
|
if (this.collectionStack.length > 0) {
|
|
616
|
-
const
|
|
617
|
-
let
|
|
629
|
+
const a = this.collectionStack[this.collectionStack.length - 1];
|
|
630
|
+
let o = t;
|
|
618
631
|
const i = [];
|
|
619
|
-
for (;
|
|
620
|
-
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
632
|
+
for (; o.type === "MemberExpression"; )
|
|
633
|
+
o.property.type === "Identifier" && !o.computed ? i.unshift(o.property.name) : o.property.type === "Literal" && o.computed ? i.unshift(String(o.property.value)) : i.unshift(this.getExpressionString(o.property)), o = o.object;
|
|
634
|
+
if (o.type === "Identifier" && o.name === a) {
|
|
635
|
+
const l = i.join(".");
|
|
623
636
|
n = {
|
|
624
637
|
...e,
|
|
625
|
-
collectionId:
|
|
638
|
+
collectionId: a,
|
|
626
639
|
variableType: "currentItem",
|
|
627
|
-
path:
|
|
640
|
+
path: l
|
|
628
641
|
};
|
|
629
642
|
}
|
|
630
643
|
}
|
|
@@ -641,8 +654,8 @@ class V {
|
|
|
641
654
|
handleCallExpression(t) {
|
|
642
655
|
var e;
|
|
643
656
|
if (t.callee.type === "Identifier" && t.callee.name === "include") {
|
|
644
|
-
const
|
|
645
|
-
return this.addMessage("info", `Partial includes are not fully supported: ${
|
|
657
|
+
const r = ((e = t.arguments[0]) == null ? void 0 : e.type) === "Literal" ? String(t.arguments[0].value) : "";
|
|
658
|
+
return this.addMessage("info", `Partial includes are not fully supported: ${r}`), "";
|
|
646
659
|
}
|
|
647
660
|
return "";
|
|
648
661
|
}
|
|
@@ -658,20 +671,20 @@ class V {
|
|
|
658
671
|
]
|
|
659
672
|
};
|
|
660
673
|
if (t.type === "MemberExpression") {
|
|
661
|
-
let e = this.getExpressionString(t),
|
|
662
|
-
return e.startsWith("!!") ? (
|
|
674
|
+
let e = this.getExpressionString(t), r = "isTruthy";
|
|
675
|
+
return e.startsWith("!!") ? (r = "isTruthy", e = e.slice(2)) : e.startsWith("!") && (r = "isFalsy", e = e.slice(1)), {
|
|
663
676
|
logicalOperator: "and",
|
|
664
677
|
statements: [
|
|
665
678
|
{
|
|
666
679
|
left: { type: "data-variable", path: e },
|
|
667
|
-
operator:
|
|
680
|
+
operator: r
|
|
668
681
|
}
|
|
669
682
|
]
|
|
670
683
|
};
|
|
671
684
|
}
|
|
672
685
|
if (t.type === "BinaryExpression" || t.type === "LogicalExpression") {
|
|
673
|
-
const e = this.getConditionExpression(t.left),
|
|
674
|
-
return `${e} ${t.operator} ${
|
|
686
|
+
const e = this.getConditionExpression(t.left), r = this.getConditionExpression(t.right);
|
|
687
|
+
return `${e} ${t.operator} ${r}`;
|
|
675
688
|
}
|
|
676
689
|
return t.type === "Literal" ? typeof t.value == "string" ? `'${t.value}'` : String(t.value ?? "") : this.getExpressionString(t);
|
|
677
690
|
}
|
|
@@ -682,16 +695,16 @@ class V {
|
|
|
682
695
|
case "Literal":
|
|
683
696
|
return String(t.value ?? "");
|
|
684
697
|
case "MemberExpression": {
|
|
685
|
-
const e = this.getExpressionString(t.object),
|
|
686
|
-
return t.computed ? `${e}[${
|
|
698
|
+
const e = this.getExpressionString(t.object), r = this.getExpressionString(t.property);
|
|
699
|
+
return t.computed ? `${e}[${r}]` : `${e}.${r}`;
|
|
687
700
|
}
|
|
688
701
|
case "BinaryExpression": {
|
|
689
|
-
const e = this.getExpressionString(t.left),
|
|
690
|
-
return `${e} ${t.operator} ${
|
|
702
|
+
const e = this.getExpressionString(t.left), r = this.getExpressionString(t.right);
|
|
703
|
+
return `${e} ${t.operator} ${r}`;
|
|
691
704
|
}
|
|
692
705
|
case "LogicalExpression": {
|
|
693
|
-
const e = this.getExpressionString(t.left),
|
|
694
|
-
return `${e} ${t.operator} ${
|
|
706
|
+
const e = this.getExpressionString(t.left), r = this.getExpressionString(t.right);
|
|
707
|
+
return `${e} ${t.operator} ${r}`;
|
|
695
708
|
}
|
|
696
709
|
default:
|
|
697
710
|
return this.addMessage("warning", `Unsupported expression type for getExpressionString: ${t.type}`), "";
|
|
@@ -704,21 +717,21 @@ class V {
|
|
|
704
717
|
});
|
|
705
718
|
}
|
|
706
719
|
}
|
|
707
|
-
const
|
|
708
|
-
const e =
|
|
720
|
+
const q = "dataSourceEjs", H = y.startup, K = function(s, t = {}) {
|
|
721
|
+
const e = F(s, new W()), r = J(s, {
|
|
709
722
|
contains: "<%",
|
|
710
723
|
importer: new V()
|
|
711
724
|
});
|
|
712
|
-
|
|
713
|
-
editor:
|
|
725
|
+
M({
|
|
726
|
+
editor: s,
|
|
714
727
|
licenseKey: t.licenseKey,
|
|
715
|
-
plan:
|
|
716
|
-
pluginName:
|
|
728
|
+
plan: H,
|
|
729
|
+
pluginName: q,
|
|
717
730
|
cleanup: () => {
|
|
718
|
-
e(),
|
|
731
|
+
e(), r();
|
|
719
732
|
}
|
|
720
733
|
});
|
|
721
|
-
},
|
|
734
|
+
}, z = N(K);
|
|
722
735
|
export {
|
|
723
|
-
|
|
736
|
+
z as default
|
|
724
737
|
};
|