qumra-engine 2.0.114 → 2.0.115

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.
@@ -386,6 +386,29 @@ exports.default = new (class SeoExtension {
386
386
  observer.observe(document.body, { childList: true, subtree: true });
387
387
  });
388
388
  </script>
389
+
390
+
391
+ <script>
392
+ window.addEventListener("message", (event) => {
393
+ // يفضل تتحقق من الـ origin لو عايز أمان أكتر
394
+ // if (event.origin !== "https://dashboard.qumra.cloud") return;
395
+
396
+ const data = event.data;
397
+
398
+ if (data?.type === "reRender") {
399
+ console.log("📩 تم استقبال رسالة إعادة الرندر:", data);
400
+ // هنا تقدر تنفذ أي كود لإعادة الرندر أو تحديث الصفحة
401
+ // مثلا:
402
+ // location.reload();
403
+ } else {
404
+ console.log("📩 رسالة وصلت:", data);
405
+ }
406
+ });
407
+ </script>
408
+
409
+
410
+
411
+
389
412
  `;
390
413
  }
391
414
  return new nunjucks_1.runtime.SafeString(scripts);
@@ -26,6 +26,9 @@ const prepareDataMiddleware = (req, res, next) => {
26
26
  if (req.query?.themeVersion) {
27
27
  params.set("themeVersion", String(req.query.themeVersion));
28
28
  }
29
+ if (req.query?.widget) {
30
+ params.set("widgetId", String(req.query.widget));
31
+ }
29
32
  if (req.query?.previewCategory) {
30
33
  params.set("previewCategory", String(req.query.previewCategory));
31
34
  }
@@ -38,6 +41,9 @@ const prepareDataMiddleware = (req, res, next) => {
38
41
  if (res.locals.preview && res.locals.themeWidget) {
39
42
  api = `${res.locals.renderApi}/render/preview-widget${themePath}`;
40
43
  }
44
+ else if (req.query?.widget && req.query?.jsonPreview) {
45
+ api = `${res.locals.renderApi}/render/rerender-widget${themePath}`;
46
+ }
41
47
  else {
42
48
  api = true
43
49
  ? `${res.locals.renderApi}/render${themePath}`
@@ -53,7 +59,7 @@ const prepareDataMiddleware = (req, res, next) => {
53
59
  Authorization,
54
60
  qdid: qdid,
55
61
  "client-ip": res.locals.clientIp || "",
56
- "market": res.locals.market || "",
62
+ market: res.locals.market || "",
57
63
  },
58
64
  })
59
65
  .then((engineResponse) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.114",
3
+ "version": "2.0.115",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {