mftsccs-browser 2.0.17-beta → 2.0.18-beta
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.
|
@@ -22027,6 +22027,320 @@ class BuilderStatefulWidget extends _StatefulWidget__WEBPACK_IMPORTED_MODULE_0__
|
|
|
22027
22027
|
}
|
|
22028
22028
|
|
|
22029
22029
|
|
|
22030
|
+
/***/ }),
|
|
22031
|
+
|
|
22032
|
+
/***/ "./src/Widgets/RenderWidgetService.ts":
|
|
22033
|
+
/*!********************************************!*\
|
|
22034
|
+
!*** ./src/Widgets/RenderWidgetService.ts ***!
|
|
22035
|
+
\********************************************/
|
|
22036
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
22037
|
+
|
|
22038
|
+
__webpack_require__.r(__webpack_exports__);
|
|
22039
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22040
|
+
/* harmony export */ renderLatestWidget: () => (/* binding */ renderLatestWidget),
|
|
22041
|
+
/* harmony export */ renderPage: () => (/* binding */ renderPage),
|
|
22042
|
+
/* harmony export */ renderWidget: () => (/* binding */ renderWidget)
|
|
22043
|
+
/* harmony export */ });
|
|
22044
|
+
/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../app */ "./src/app.ts");
|
|
22045
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22046
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22047
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22048
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
22049
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22050
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22051
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22052
|
+
});
|
|
22053
|
+
};
|
|
22054
|
+
|
|
22055
|
+
function renderPage(pageId, attachNode, props) {
|
|
22056
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22057
|
+
var _a;
|
|
22058
|
+
const widgets = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetRelation)(pageId, "the_page_body");
|
|
22059
|
+
if ((_a = widgets === null || widgets === void 0 ? void 0 : widgets[0]) === null || _a === void 0 ? void 0 : _a.id)
|
|
22060
|
+
yield renderWidget(widgets[0].id, attachNode, props);
|
|
22061
|
+
});
|
|
22062
|
+
}
|
|
22063
|
+
function renderLatestWidget(widgetId, attachNode, props) {
|
|
22064
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22065
|
+
var _a;
|
|
22066
|
+
const widgets = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetRelation)(widgetId, "the_widget_latest");
|
|
22067
|
+
if ((widgets === null || widgets === void 0 ? void 0 : widgets.length) == 0)
|
|
22068
|
+
yield renderWidget(widgetId, attachNode, props);
|
|
22069
|
+
else {
|
|
22070
|
+
const latestWidgetId = (_a = widgets === null || widgets === void 0 ? void 0 : widgets[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
22071
|
+
if (latestWidgetId)
|
|
22072
|
+
yield renderWidget(latestWidgetId, attachNode, props);
|
|
22073
|
+
}
|
|
22074
|
+
});
|
|
22075
|
+
}
|
|
22076
|
+
function renderWidget(widgetId, attachNode, props) {
|
|
22077
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22078
|
+
try {
|
|
22079
|
+
const widgetTree = yield getWidgetFromId(widgetId);
|
|
22080
|
+
const appElement = attachNode;
|
|
22081
|
+
// const newWidget = await convertWidgetTreeToWidget(
|
|
22082
|
+
yield convertWidgetTreeToWidget(widgetTree, appElement, undefined, props);
|
|
22083
|
+
// add newWidget css to the page
|
|
22084
|
+
const style = document.createElement("style");
|
|
22085
|
+
style.innerHTML = widgetTree.css;
|
|
22086
|
+
appElement.appendChild(style);
|
|
22087
|
+
// add newWidget js to the page
|
|
22088
|
+
const script = document.createElement("script");
|
|
22089
|
+
script.innerHTML = widgetTree.js;
|
|
22090
|
+
appElement.appendChild(script);
|
|
22091
|
+
// remove class wb-initial-empty from all elements that have it from fspagePreview
|
|
22092
|
+
const wbInitialEmpty = appElement.querySelectorAll(".wb-initial-empty");
|
|
22093
|
+
wbInitialEmpty.forEach((el) => {
|
|
22094
|
+
el.classList.remove("wb-initial-empty");
|
|
22095
|
+
}); // add the css for the class fspage-preview
|
|
22096
|
+
document
|
|
22097
|
+
.querySelectorAll('[onclick="widgetSelected(event)"]')
|
|
22098
|
+
.forEach((element) => {
|
|
22099
|
+
element.removeAttribute("onclick");
|
|
22100
|
+
}); // remove the onclick event from the widget container
|
|
22101
|
+
}
|
|
22102
|
+
catch (error) {
|
|
22103
|
+
console.error("Error Caught Rendering Widget");
|
|
22104
|
+
}
|
|
22105
|
+
});
|
|
22106
|
+
}
|
|
22107
|
+
/**
|
|
22108
|
+
* This function builds a widget tree. This tree is built fully along with its children
|
|
22109
|
+
* This tree can then be used to build the whole dom for the widget.
|
|
22110
|
+
* This has recursive property so that the recursion can be used to build this tree.
|
|
22111
|
+
* @param widgetId the id of the widget
|
|
22112
|
+
* @returns WidgetTree.
|
|
22113
|
+
*/
|
|
22114
|
+
function getWidgetFromId(widgetId_1) {
|
|
22115
|
+
return __awaiter(this, arguments, void 0, function* (widgetId, visitedWidgets = [], token = "") {
|
|
22116
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36;
|
|
22117
|
+
try {
|
|
22118
|
+
const widgetNode = new _app__WEBPACK_IMPORTED_MODULE_0__.WidgetTree();
|
|
22119
|
+
const output = yield getWidgetCodeFromId(widgetId, token);
|
|
22120
|
+
visitedWidgets.push(widgetId);
|
|
22121
|
+
const widgetInfo = (_a = output === null || output === void 0 ? void 0 : output.data) === null || _a === void 0 ? void 0 : _a.the_widget;
|
|
22122
|
+
widgetNode.name = (_d = (_c = (_b = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_name) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.the_name;
|
|
22123
|
+
widgetNode.html = (_g = (_f = (_e = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_html) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.the_html;
|
|
22124
|
+
widgetNode.css = (_k = (_j = (_h = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_css) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.the_css;
|
|
22125
|
+
widgetNode.js = (_o = (_m = (_l = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_js) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.the_js;
|
|
22126
|
+
widgetNode.origin = Number((_r = (_q = (_p = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_origin) === null || _p === void 0 ? void 0 : _p[0]) === null || _q === void 0 ? void 0 : _q.data) === null || _r === void 0 ? void 0 : _r.the_originid);
|
|
22127
|
+
widgetNode.version =
|
|
22128
|
+
(_u = (_t = (_s = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_version) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.data) === null || _u === void 0 ? void 0 : _u.the_version;
|
|
22129
|
+
widgetNode.clean = (_x = (_w = (_v = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_clean) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.data) === null || _x === void 0 ? void 0 : _x.the_clean;
|
|
22130
|
+
widgetNode.timestamp =
|
|
22131
|
+
(_0 = (_z = (_y = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_timestamp) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.data) === null || _0 === void 0 ? void 0 : _0.the_timestamp;
|
|
22132
|
+
widgetNode.id = output.id;
|
|
22133
|
+
const widgetTypeValue = (_3 = (_2 = (_1 = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_type) === null || _1 === void 0 ? void 0 : _1[0]) === null || _2 === void 0 ? void 0 : _2.data) === null || _3 === void 0 ? void 0 : _3.the_type;
|
|
22134
|
+
if (widgetTypeValue == "null" || widgetTypeValue == null) {
|
|
22135
|
+
widgetNode.type = "the_element_name";
|
|
22136
|
+
}
|
|
22137
|
+
else {
|
|
22138
|
+
widgetNode.type = widgetTypeValue;
|
|
22139
|
+
}
|
|
22140
|
+
widgetNode.after_render =
|
|
22141
|
+
(_6 = (_5 = (_4 = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_after_render) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.data) === null || _6 === void 0 ? void 0 : _6.the_after_render;
|
|
22142
|
+
widgetNode.before_render =
|
|
22143
|
+
(_9 = (_8 = (_7 = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_before_render) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.data) === null || _9 === void 0 ? void 0 : _9.the_before_render;
|
|
22144
|
+
widgetNode.update = (_12 = (_11 = (_10 = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_update) === null || _10 === void 0 ? void 0 : _10[0]) === null || _11 === void 0 ? void 0 : _11.data) === null || _12 === void 0 ? void 0 : _12.the_update;
|
|
22145
|
+
widgetNode.widgetId = widgetId;
|
|
22146
|
+
widgetNode.mount_child =
|
|
22147
|
+
(_15 = (_14 = (_13 = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_mount_child) === null || _13 === void 0 ? void 0 : _13[0]) === null || _14 === void 0 ? void 0 : _14.data) === null || _15 === void 0 ? void 0 : _15.the_mount_child;
|
|
22148
|
+
const childWidgets = widgetInfo === null || widgetInfo === void 0 ? void 0 : widgetInfo.the_widget_s_child;
|
|
22149
|
+
// if there are children present in the widget then convert the children to widget and put it inside of the tree.
|
|
22150
|
+
if (childWidgets === null || childWidgets === void 0 ? void 0 : childWidgets.length) {
|
|
22151
|
+
for (let i = 0; i < childWidgets.length; i++) {
|
|
22152
|
+
const childWidgetId = ((_19 = (_18 = (_17 = (_16 = childWidgets[i]) === null || _16 === void 0 ? void 0 : _16.data.the_child_widget) === null || _17 === void 0 ? void 0 : _17.the_child_widget_info) === null || _18 === void 0 ? void 0 : _18[0]) === null || _19 === void 0 ? void 0 : _19.id) ||
|
|
22153
|
+
((_24 = (_23 = (_22 = (_21 = (_20 = childWidgets[i]) === null || _20 === void 0 ? void 0 : _20.data.the_child_widget) === null || _21 === void 0 ? void 0 : _21.the_child_widget_parent) === null || _22 === void 0 ? void 0 : _22[0]) === null || _23 === void 0 ? void 0 : _23.data) === null || _24 === void 0 ? void 0 : _24.the_parent);
|
|
22154
|
+
const childWidget = yield getWidgetFromId(childWidgetId, visitedWidgets, token);
|
|
22155
|
+
const childWidgetTypeValue = (_30 = (_29 = (_28 = (_27 = (_26 = (_25 = childWidgets[i]) === null || _25 === void 0 ? void 0 : _25.data) === null || _26 === void 0 ? void 0 : _26.the_child_widget) === null || _27 === void 0 ? void 0 : _27.the_child_widget_type) === null || _28 === void 0 ? void 0 : _28[0]) === null || _29 === void 0 ? void 0 : _29.data) === null || _30 === void 0 ? void 0 : _30.the_type;
|
|
22156
|
+
const childWidgetWrapperId = (_36 = (_35 = (_34 = (_33 = (_32 = (_31 = childWidgets[i]) === null || _31 === void 0 ? void 0 : _31.data) === null || _32 === void 0 ? void 0 : _32.the_child_widget) === null || _33 === void 0 ? void 0 : _33.the_child_widget_wrapper) === null || _34 === void 0 ? void 0 : _34[0]) === null || _35 === void 0 ? void 0 : _35.data) === null || _36 === void 0 ? void 0 : _36.the_wrapper;
|
|
22157
|
+
if (childWidgetTypeValue == "null" || childWidgetTypeValue == null) {
|
|
22158
|
+
childWidget.type = "the_element_name";
|
|
22159
|
+
}
|
|
22160
|
+
else {
|
|
22161
|
+
childWidget.type = childWidgetTypeValue;
|
|
22162
|
+
}
|
|
22163
|
+
childWidget.wrapper = childWidgetWrapperId;
|
|
22164
|
+
widgetNode.children.push(childWidget);
|
|
22165
|
+
}
|
|
22166
|
+
}
|
|
22167
|
+
return widgetNode;
|
|
22168
|
+
}
|
|
22169
|
+
catch (ex) {
|
|
22170
|
+
console.error("error", ex);
|
|
22171
|
+
throw ex;
|
|
22172
|
+
}
|
|
22173
|
+
});
|
|
22174
|
+
}
|
|
22175
|
+
/**
|
|
22176
|
+
*
|
|
22177
|
+
* @param tree Widget tree from getWidgetFromId(widgetId);
|
|
22178
|
+
* @param parentElement this is the dom element on which we want to add our widget
|
|
22179
|
+
* @returns the widgetree with widgets attached inside of it.
|
|
22180
|
+
* Also this will add the tree to the dom.
|
|
22181
|
+
*/
|
|
22182
|
+
function convertWidgetTreeToWidget(tree_1, parentElement_1) {
|
|
22183
|
+
return __awaiter(this, arguments, void 0, function* (tree, parentElement, isMain = true, props) {
|
|
22184
|
+
var _a, _b;
|
|
22185
|
+
const newWidget = new _app__WEBPACK_IMPORTED_MODULE_0__.BuilderStatefulWidget();
|
|
22186
|
+
newWidget.html = tree.html;
|
|
22187
|
+
newWidget.widgetType = tree.type;
|
|
22188
|
+
newWidget.componentDidMountFunction = tree.before_render;
|
|
22189
|
+
newWidget.addEventFunction = tree.after_render;
|
|
22190
|
+
newWidget.mountChildWidgetsFunction = tree.mount_child;
|
|
22191
|
+
// newWidget.css = newWidget.css ? newWidget.css : "";
|
|
22192
|
+
if (props)
|
|
22193
|
+
newWidget.data = props;
|
|
22194
|
+
parentElement.innerHTML = "";
|
|
22195
|
+
const newParent = parentElement;
|
|
22196
|
+
//let newParent = appendWidgetContainerToParent(parentElement, tree.id, isMain);
|
|
22197
|
+
isMain = false;
|
|
22198
|
+
if (newParent) {
|
|
22199
|
+
yield newWidget.mount(newParent);
|
|
22200
|
+
tree.widget = newWidget;
|
|
22201
|
+
if (tree.children.length > 0) {
|
|
22202
|
+
if (((_a = newWidget.childWidgetElement) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
22203
|
+
for (let i = 0; i < ((_b = tree.children) === null || _b === void 0 ? void 0 : _b.length); i++) {
|
|
22204
|
+
const child = tree.children[i];
|
|
22205
|
+
for (let j = 0; j < newWidget.childWidgetElement.length; j++) {
|
|
22206
|
+
const widgetElement = newWidget.childWidgetElement[j];
|
|
22207
|
+
if (child.id ===
|
|
22208
|
+
Number(widgetElement.getAttribute("data-widgetid")) &&
|
|
22209
|
+
child.wrapper === widgetElement.id) {
|
|
22210
|
+
const clearedChildWidget = clearDraggedWidget(child);
|
|
22211
|
+
const childWidget = yield convertWidgetTreeToWidget(clearedChildWidget, widgetElement, isMain);
|
|
22212
|
+
newWidget.childWidgets.push(childWidget);
|
|
22213
|
+
newWidget.css =
|
|
22214
|
+
newWidget.css +
|
|
22215
|
+
`div[data-widgetid="${child.id}"] { ${child.css} }`;
|
|
22216
|
+
childWidget.dataChange((value) => {
|
|
22217
|
+
var _a;
|
|
22218
|
+
console.log("This is the data change in child", value);
|
|
22219
|
+
const type = (_a = value === null || value === void 0 ? void 0 : value.type) === null || _a === void 0 ? void 0 : _a.characterValue;
|
|
22220
|
+
if (type) {
|
|
22221
|
+
newWidget.childrenData[type] = value;
|
|
22222
|
+
}
|
|
22223
|
+
console.log("new child data", newWidget.childrenData);
|
|
22224
|
+
});
|
|
22225
|
+
}
|
|
22226
|
+
}
|
|
22227
|
+
}
|
|
22228
|
+
}
|
|
22229
|
+
}
|
|
22230
|
+
}
|
|
22231
|
+
console.log("newWidget ->", newWidget);
|
|
22232
|
+
// Unwrap specific containers
|
|
22233
|
+
yield unwrapContainers(parentElement, ".mftsccs-marking-element");
|
|
22234
|
+
yield unwrapContainers(parentElement, ".widget_container");
|
|
22235
|
+
return newWidget;
|
|
22236
|
+
});
|
|
22237
|
+
}
|
|
22238
|
+
function getWidgetCodeFromId(widgetId, token) {
|
|
22239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22240
|
+
try {
|
|
22241
|
+
const searchFirst = new _app__WEBPACK_IMPORTED_MODULE_0__.SearchQuery();
|
|
22242
|
+
searchFirst.composition = widgetId;
|
|
22243
|
+
searchFirst.fullLinkers = [
|
|
22244
|
+
"the_widget",
|
|
22245
|
+
"the_widget_widget",
|
|
22246
|
+
"the_widget_name",
|
|
22247
|
+
"the_widget_html",
|
|
22248
|
+
"the_widget_css",
|
|
22249
|
+
"the_widget_js",
|
|
22250
|
+
"the_widget_timestamp",
|
|
22251
|
+
"the_widget_type",
|
|
22252
|
+
"the_widget_after_render",
|
|
22253
|
+
"the_widget_before_render",
|
|
22254
|
+
"the_widget_update",
|
|
22255
|
+
"the_widget_mount_child",
|
|
22256
|
+
"the_widget_clean",
|
|
22257
|
+
"the_widget_s_child",
|
|
22258
|
+
"the_widget_version",
|
|
22259
|
+
"the_widget_origin",
|
|
22260
|
+
];
|
|
22261
|
+
searchFirst.inpage = 100;
|
|
22262
|
+
const searchSecond = new _app__WEBPACK_IMPORTED_MODULE_0__.SearchQuery();
|
|
22263
|
+
searchSecond.fullLinkers = [
|
|
22264
|
+
"the_child_widget",
|
|
22265
|
+
"the_child_widget_type",
|
|
22266
|
+
"the_child_widget_parent",
|
|
22267
|
+
"the_child_widget_wrapper",
|
|
22268
|
+
"the_child_widget_info",
|
|
22269
|
+
];
|
|
22270
|
+
searchSecond.inpage = 100;
|
|
22271
|
+
const queryParams = [searchFirst, searchSecond];
|
|
22272
|
+
const output = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchLinkMultipleAll)(queryParams, token);
|
|
22273
|
+
console.log("getWidgetCodeFromId output ->", output);
|
|
22274
|
+
return output;
|
|
22275
|
+
}
|
|
22276
|
+
catch (error) {
|
|
22277
|
+
console.error("error", error);
|
|
22278
|
+
throw error;
|
|
22279
|
+
}
|
|
22280
|
+
});
|
|
22281
|
+
}
|
|
22282
|
+
function clearDraggedWidget(widgetTree) {
|
|
22283
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*\bclass=["'][^"']*\bwidget_container\b[^"']*["'][^>]*>/g, (match) => {
|
|
22284
|
+
return match.replace(/\bwidget_container\b/g, "").trim();
|
|
22285
|
+
});
|
|
22286
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*\bdraggable=["'][^"']*\btrue\b[^"']*["'][^>]*>/g, (match) => {
|
|
22287
|
+
return match.replace(/\btrue\b/g, "false").trim();
|
|
22288
|
+
});
|
|
22289
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*\bclass=["'][^"']*\bhover-element\b[^"']*["'][^>]*>/g, (match) => {
|
|
22290
|
+
return match.replace(/\bhover-element\b/g, "").trim();
|
|
22291
|
+
});
|
|
22292
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*\bclass=["'][^"']*\bwb-block\b[^"']*["'][^>]*>/g, (match) => {
|
|
22293
|
+
return match.replace(/\bwb-block\b/g, "").trim();
|
|
22294
|
+
});
|
|
22295
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*onclick="widgetSelected\(event\)"\s*,?\s*ondragover="_dragService\.dragOverWidgetElement\(event\)"\s*,?\s*ondrop="_dragService\.dropWidgetElement\(event\)"\s*,?\s*ondragstart="_dragService\.dragStartWidgetElement\(event\)"\s*,?\s*ondragend="_dragService\.dragEndWidgetElement\(event\)"[^>]*>/g, (match) => {
|
|
22296
|
+
return match
|
|
22297
|
+
.replace(/onclick="widgetSelected\(event\)"/g, 'onclick=""')
|
|
22298
|
+
.replace(/ondragover="_dragService\.dragOverWidgetElement\(event\)"/g, 'ondragover=""')
|
|
22299
|
+
.replace(/ondrop="_dragService\.dropWidgetElement\(event\)"/g, 'ondrop=""')
|
|
22300
|
+
.replace(/ondragstart="_dragService\.dragStartWidgetElement\(event\)"/g, 'ondragstart=""')
|
|
22301
|
+
.replace(/ondragend="_dragService\.dragEndWidgetElement\(event\)"/g, 'ondragend=""')
|
|
22302
|
+
.trim();
|
|
22303
|
+
});
|
|
22304
|
+
widgetTree.html = widgetTree.html.replace(/<[^>]*\bondragstart=["'][^"']*\b_dragService\.onWidgetDragStart\(event\)\b[^"']*["'][^>]*>/g, (match) => {
|
|
22305
|
+
return match
|
|
22306
|
+
.replace(/\b_dragService\.onWidgetDragStart\(event\)\b/g, "")
|
|
22307
|
+
.trim();
|
|
22308
|
+
});
|
|
22309
|
+
return widgetTree;
|
|
22310
|
+
}
|
|
22311
|
+
function unwrapWidgetContainers(widgetContainerEl, queryParam) {
|
|
22312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22313
|
+
// Select all div elements with the queryParam
|
|
22314
|
+
const widgetContainers = widgetContainerEl.querySelectorAll(queryParam);
|
|
22315
|
+
// Loop through each div and replace it with its inner content
|
|
22316
|
+
widgetContainers.forEach((element) => {
|
|
22317
|
+
// Move all child nodes of the div before the div
|
|
22318
|
+
while (element.firstChild) {
|
|
22319
|
+
element.parentNode.insertBefore(element.firstChild, element);
|
|
22320
|
+
}
|
|
22321
|
+
// Remove the empty div
|
|
22322
|
+
element.remove();
|
|
22323
|
+
});
|
|
22324
|
+
return widgetContainerEl;
|
|
22325
|
+
});
|
|
22326
|
+
}
|
|
22327
|
+
function unwrapContainers(parentElement, selector) {
|
|
22328
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22329
|
+
const elements = parentElement.querySelectorAll(selector);
|
|
22330
|
+
for (const el of elements) {
|
|
22331
|
+
const parent = el.parentElement;
|
|
22332
|
+
if (parent) {
|
|
22333
|
+
while (el.firstChild) {
|
|
22334
|
+
const unwrappedChild = yield unwrapWidgetContainers(el.firstChild, selector);
|
|
22335
|
+
parent.insertBefore(unwrappedChild, el);
|
|
22336
|
+
}
|
|
22337
|
+
parent.removeChild(el);
|
|
22338
|
+
}
|
|
22339
|
+
}
|
|
22340
|
+
});
|
|
22341
|
+
}
|
|
22342
|
+
|
|
22343
|
+
|
|
22030
22344
|
/***/ }),
|
|
22031
22345
|
|
|
22032
22346
|
/***/ "./src/Widgets/StatefulWidget.ts":
|
|
@@ -23471,6 +23785,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23471
23785
|
/* harmony export */ init: () => (/* binding */ init),
|
|
23472
23786
|
/* harmony export */ recursiveFetch: () => (/* reexport safe */ _Services_GetComposition__WEBPACK_IMPORTED_MODULE_7__.recursiveFetch),
|
|
23473
23787
|
/* harmony export */ recursiveFetchNew: () => (/* reexport safe */ _Services_Composition_BuildComposition__WEBPACK_IMPORTED_MODULE_46__.recursiveFetchNew),
|
|
23788
|
+
/* harmony export */ renderLatestWidget: () => (/* reexport safe */ _Widgets_RenderWidgetService__WEBPACK_IMPORTED_MODULE_120__.renderLatestWidget),
|
|
23789
|
+
/* harmony export */ renderPage: () => (/* reexport safe */ _Widgets_RenderWidgetService__WEBPACK_IMPORTED_MODULE_120__.renderPage),
|
|
23790
|
+
/* harmony export */ renderWidget: () => (/* reexport safe */ _Widgets_RenderWidgetService__WEBPACK_IMPORTED_MODULE_120__.renderWidget),
|
|
23474
23791
|
/* harmony export */ searchLinkMultipleListener: () => (/* reexport safe */ _WrapperFunctions_SearchLinkMultipleAllObservable__WEBPACK_IMPORTED_MODULE_70__.searchLinkMultipleListener),
|
|
23475
23792
|
/* harmony export */ sendMessage: () => (/* binding */ sendMessage),
|
|
23476
23793
|
/* harmony export */ serviceWorker: () => (/* binding */ serviceWorker),
|
|
@@ -23604,6 +23921,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23604
23921
|
/* harmony import */ var _Widgets_WidgetTree__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./Widgets/WidgetTree */ "./src/Widgets/WidgetTree.ts");
|
|
23605
23922
|
/* harmony import */ var _AccessTracker_accessTracker__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./AccessTracker/accessTracker */ "./src/AccessTracker/accessTracker.ts");
|
|
23606
23923
|
/* harmony import */ var _Services_CreateConnection_CreateConnectionEntity__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./Services/CreateConnection/CreateConnectionEntity */ "./src/Services/CreateConnection/CreateConnectionEntity.ts");
|
|
23924
|
+
/* harmony import */ var _Widgets_RenderWidgetService__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./Widgets/RenderWidgetService */ "./src/Widgets/RenderWidgetService.ts");
|
|
23607
23925
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23608
23926
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23609
23927
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23741,6 +24059,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23741
24059
|
|
|
23742
24060
|
|
|
23743
24061
|
|
|
24062
|
+
|
|
23744
24063
|
|
|
23745
24064
|
|
|
23746
24065
|
var serviceWorker;
|