qumra-engine 2.0.93 → 2.0.95

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.
@@ -51,6 +51,7 @@ exports.default = new (class SeoExtension {
51
51
  pointer-events: all;
52
52
  opacity: 0;
53
53
  animation: toolbarSlideIn 0.3s ease-out forwards;
54
+ z-index: 10;
54
55
  }
55
56
 
56
57
  @keyframes toolbarSlideIn {
@@ -114,25 +115,7 @@ exports.default = new (class SeoExtension {
114
115
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
115
116
  }
116
117
 
117
- .btn-copy {
118
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
119
- color: white;
120
- }
121
118
 
122
- .btn-copy:hover {
123
- transform: scale(1.1);
124
- box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
125
- }
126
-
127
- .btn-settings {
128
- background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
129
- color: white;
130
- }
131
-
132
- .btn-settings:hover {
133
- transform: scale(1.1);
134
- box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
135
- }
136
119
 
137
120
  /* تأثير النبض اللطيف */
138
121
  #selector-outline::before {
@@ -148,6 +131,7 @@ exports.default = new (class SeoExtension {
148
131
  z-index: -1;
149
132
  animation: gradientShift 3s ease infinite;
150
133
  opacity: 0.6;
134
+ curser: pointer;
151
135
  }
152
136
 
153
137
  @keyframes gradientShift {
@@ -262,8 +246,6 @@ exports.default = new (class SeoExtension {
262
246
  <div id="selector-outline">
263
247
  <div id="selector-toolbar">
264
248
  <button class="control-btn btn-edit" title="تحرير" id="btn-edit">✏️</button>
265
- <button class="control-btn btn-copy" title="نسخ" id="btn-copy">📋</button>
266
- <button class="control-btn btn-settings" title="إعدادات" id="btn-settings">⚙️</button>
267
249
  <button class="control-btn btn-delete" title="حذف" id="btn-delete">🗑️</button>
268
250
  </div>
269
251
  <div class="corner-dot top-left"></div>
@@ -281,8 +263,6 @@ exports.default = new (class SeoExtension {
281
263
  const outline = document.getElementById('selector-outline');
282
264
  const btnEdit = document.getElementById('btn-edit');
283
265
  const btnDelete = document.getElementById('btn-delete');
284
- const btnCopy = document.getElementById('btn-copy');
285
- const btnSettings = document.getElementById('btn-settings');
286
266
  let selectedElement = null;
287
267
  let hoverTimeout = null;
288
268
 
@@ -296,6 +276,14 @@ exports.default = new (class SeoExtension {
296
276
  outline.style.left = \`\${rect.left + window.scrollX - 4}px\`;
297
277
  outline.style.width = \`\${rect.width + 8}px\`;
298
278
  outline.style.height = \`\${rect.height + 8}px\`;
279
+
280
+ element.onclick = () => {
281
+ window.parent.postMessage(
282
+ { type: "widgetAction", action: "edit", widgetId: element.getAttribute("widget-id"), templateKey: element.getAttribute("template-key") },
283
+ "*"
284
+ );
285
+ };
286
+
299
287
  }
300
288
 
301
289
  function hideSelector() {
@@ -326,25 +314,15 @@ exports.default = new (class SeoExtension {
326
314
  const btnActions = {
327
315
  'btn-edit': el => {
328
316
  window.parent.postMessage(
329
- { type: "widgetAction", action: "edit", widgetId: el.getAttribute("widget-id") },
330
- "*"
331
- );
332
- },
333
- 'btn-copy': el => {
334
- window.parent.postMessage(
335
- { type: "widgetAction", action: "copy", widgetId: el.getAttribute("widget-id") },
336
- "*"
337
- );
338
- },
339
- 'btn-settings': el => {
340
- window.parent.postMessage(
341
- { type: "widgetAction", action: "settings", widgetId: el.getAttribute("widget-id") },
317
+ { type: "widgetAction", action: "edit", widgetId: el.getAttribute("widget-id"), templateKey: el.getAttribute("template-key") },
342
318
  "*"
343
319
  );
344
320
  },
321
+
322
+
345
323
  'btn-delete': el => {
346
324
  window.parent.postMessage(
347
- { type: "widgetAction", action: "delete", widgetId: el.getAttribute("widget-id") },
325
+ { type: "widgetAction", action: "delete", widgetId: el.getAttribute("widget-id"), templateKey: el.getAttribute("template-key") },
348
326
  "*"
349
327
  );
350
328
  }
@@ -29,7 +29,8 @@ exports.default = new (class WidgetExtension {
29
29
  `);
30
30
  }
31
31
  const templates = env.getGlobal("templates");
32
- const widgets = templates.find((t) => t.key === templateKey)?.widgets || [];
32
+ const template = templates.find((t) => t.key === templateKey);
33
+ const widgets = template?.widgets || [];
33
34
  const renderedWidgets = [];
34
35
  for (const widget of widgets) {
35
36
  const widgetTemplatePath = (0, normalizeWidgetPath_1.normalizeWidgetPath)(widget.widget);
@@ -57,7 +58,7 @@ exports.default = new (class WidgetExtension {
57
58
  }
58
59
  if (isIframe) {
59
60
  renderedWidgets.push(`
60
- <section widget-id="${widget._id}" id="qumra-widget-id-${widget._id}">
61
+ <section widget-id="${widget._id}" id="qumra-widget-id-${widget._id}" template-key="${templateKey}" >
61
62
  ${html}
62
63
  </section>
63
64
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.93",
3
+ "version": "2.0.95",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {