@social-mail/social-mail-client 1.2.283 → 1.2.285
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/admin/AdminAppIndex.pack.js +21 -20
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +2 -2
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js +2 -20
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.js +19 -0
- package/dist/site-editor/editor/WebSitePageEditor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +21 -20
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +2 -2
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/pages/websites/studio/WebSiteStudioPage.tsx +24 -23
- package/src/site-editor/editor/WebSitePageEditor.tsx +24 -0
package/package.json
CHANGED
|
@@ -227,31 +227,32 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
async downloadHtml(file: IAppFile, cancelToken) {
|
|
230
|
-
|
|
230
|
+
const text = await FetchBuilder.get(file.downloadUrl)
|
|
231
231
|
.cancelToken(cancelToken)
|
|
232
232
|
.responseAsText(true);
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
233
|
+
return text;
|
|
234
|
+
// const parser = new DOMParser();
|
|
235
|
+
// const doc = parser.parseFromString(text, "text/html");
|
|
236
|
+
// const injects = Array.from(doc.documentElement.querySelectorAll("inject")) as HTMLElement[];
|
|
237
|
+
// for (const e of injects) {
|
|
238
|
+
// let src = e.getAttribute("src");
|
|
239
|
+
// if(src.startsWith("/")) {
|
|
240
|
+
// src = src.substring(1);
|
|
241
|
+
// } else {
|
|
242
|
+
// // will do it later
|
|
243
|
+
// }
|
|
244
|
+
// const injectedFile = await this.cloudFileService.children(this.root.appFileID, src)
|
|
245
|
+
// .firstOrDefault();
|
|
246
|
+
// text = await FetchBuilder.get(injectedFile.downloadUrl).responseAsText();
|
|
247
|
+
// const dom = parser.parseFromString(text, "text/html");
|
|
248
|
+
// const children = Array.from(dom.body.children);
|
|
249
|
+
// e.innerHTML = "";
|
|
250
|
+
// for (const iterator of children) {
|
|
251
|
+
// iterator.setAttribute("contentEditable", "false");
|
|
252
|
+
// e.appendChild(iterator);
|
|
253
|
+
// }
|
|
254
|
+
// }
|
|
255
|
+
// return doc.documentElement.outerHTML;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
async createIndexHtml() {
|
|
@@ -120,6 +120,30 @@ export default class WebSitePageEditor extends HtmlPageEditor {
|
|
|
120
120
|
this.htmlDocument.head.appendChild(script);
|
|
121
121
|
}
|
|
122
122
|
script.setAttribute("src", "//cdn.jsdelivr.net/npm/@social-mail/web-components@1.0.54/dist/components.webpack.js");
|
|
123
|
+
|
|
124
|
+
// inject injected component....
|
|
125
|
+
for(const e of Array.from(this.htmlDocument.querySelectorAll("inject"))) {
|
|
126
|
+
let src = e.getAttribute("src");
|
|
127
|
+
if(src.startsWith("/")) {
|
|
128
|
+
src = src.substring(1);
|
|
129
|
+
} else {
|
|
130
|
+
// will do it later
|
|
131
|
+
}
|
|
132
|
+
const file = await this.cloudFileService.children(this.folder.appFileID, src)
|
|
133
|
+
.firstOrDefault();
|
|
134
|
+
const text = await FetchBuilder.get(file.downloadUrl).responseAsText();
|
|
135
|
+
const parser = new DOMParser();
|
|
136
|
+
const dom = parser.parseFromString(text, "text/html");
|
|
137
|
+
const children = Array.from(dom.body.children);
|
|
138
|
+
for (const iterator of Array.from(e.children)) {
|
|
139
|
+
iterator.remove();
|
|
140
|
+
}
|
|
141
|
+
for (const iterator of children) {
|
|
142
|
+
iterator.setAttribute("contentEditable", "false");
|
|
143
|
+
iterator.remove();
|
|
144
|
+
e.appendChild(iterator);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
123
147
|
}
|
|
124
148
|
|
|
125
149
|
|