qumra-engine 2.0.96 → 2.0.98
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.
|
@@ -279,7 +279,13 @@ exports.default = new (class SeoExtension {
|
|
|
279
279
|
|
|
280
280
|
element.onclick = () => {
|
|
281
281
|
window.parent.postMessage(
|
|
282
|
-
{
|
|
282
|
+
{
|
|
283
|
+
type: "widgetAction",
|
|
284
|
+
action: "edit",
|
|
285
|
+
widgetId: element.getAttribute("widget-id"),
|
|
286
|
+
templateKey: element.getAttribute("template-key")
|
|
287
|
+
templateId: element.getAttribute("template-id")
|
|
288
|
+
},
|
|
283
289
|
"*"
|
|
284
290
|
);
|
|
285
291
|
};
|
|
@@ -314,7 +320,13 @@ exports.default = new (class SeoExtension {
|
|
|
314
320
|
const btnActions = {
|
|
315
321
|
'btn-edit': el => {
|
|
316
322
|
window.parent.postMessage(
|
|
317
|
-
{
|
|
323
|
+
{
|
|
324
|
+
type: "widgetAction",
|
|
325
|
+
action: "edit",
|
|
326
|
+
widgetId: el.getAttribute("widget-id"),
|
|
327
|
+
templateKey: el.getAttribute("template-key"),
|
|
328
|
+
templateId: el.getAttribute("template-id"),
|
|
329
|
+
},
|
|
318
330
|
"*"
|
|
319
331
|
);
|
|
320
332
|
},
|
|
@@ -322,7 +334,13 @@ exports.default = new (class SeoExtension {
|
|
|
322
334
|
|
|
323
335
|
'btn-delete': el => {
|
|
324
336
|
window.parent.postMessage(
|
|
325
|
-
|
|
337
|
+
{
|
|
338
|
+
type: "widgetAction",
|
|
339
|
+
action: "delete",
|
|
340
|
+
widgetId: el.getAttribute("widget-id"),
|
|
341
|
+
templateKey: el.getAttribute("template-key"),
|
|
342
|
+
templateId: el.getAttribute("template-id"),
|
|
343
|
+
},
|
|
326
344
|
"*"
|
|
327
345
|
);
|
|
328
346
|
}
|
|
@@ -20,14 +20,14 @@ exports.default = new (class WidgetExtension {
|
|
|
20
20
|
if (widgetPreview) {
|
|
21
21
|
return "";
|
|
22
22
|
}
|
|
23
|
-
if (templateKey === "main") {
|
|
24
|
-
|
|
25
|
-
<div style="padding: 12px; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; border-radius: 4px; margin: 8px 0;">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
}
|
|
23
|
+
// if (templateKey === "main") {
|
|
24
|
+
// return new nunjucks.runtime.SafeString(`
|
|
25
|
+
// <div style="padding: 12px; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; border-radius: 4px; margin: 8px 0;">
|
|
26
|
+
// ⚠️ <strong>لا يمكن تضمين قالب "{% template "main" %}" بشكل مباشر:</strong>
|
|
27
|
+
// <p>يمكنك استخدام "{% content %}" لعرض المحتوى الرئيسي للصفحة</p>
|
|
28
|
+
// </div>
|
|
29
|
+
// `);
|
|
30
|
+
// }
|
|
31
31
|
const templates = env.getGlobal("templates");
|
|
32
32
|
const template = templates.find((t) => t.key === templateKey);
|
|
33
33
|
const widgets = template?.widgets || [];
|