qumra-engine 2.0.129 → 2.0.130

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.
@@ -1,4 +1,4 @@
1
- import { runtime } from "nunjucks";
1
+ import { runtime } from 'nunjucks';
2
2
  declare const _default: {
3
3
  tags: string[];
4
4
  parse(parser: any, nodes: any): any;
@@ -4,16 +4,17 @@ const nunjucks_1 = require("nunjucks");
4
4
  const globals_1 = require("../../store/globals");
5
5
  exports.default = new (class SeoExtension {
6
6
  constructor() {
7
- this.tags = ["qumra_head"];
7
+ this.tags = ['qumra_head'];
8
8
  }
9
9
  parse(parser, nodes) {
10
10
  const tok = parser.nextToken();
11
11
  parser.advanceAfterBlockEnd(tok.value);
12
- return new nodes.CallExtension(this, "run", null);
12
+ return new nodes.CallExtension(this, 'run', null);
13
13
  }
14
14
  run({ env, ctx }) {
15
- const injectionCode = (0, globals_1.getGlobal)("injectionCode");
16
- return new nunjucks_1.runtime.SafeString(`
15
+ const injectionCode = (0, globals_1.getGlobal)('injectionCode');
16
+ const isIframe = !!env.getGlobal('isIframe');
17
+ let scripts = `
17
18
  ${injectionCode.head}
18
19
 
19
20
  <script>
@@ -33,6 +34,10 @@ exports.default = new (class SeoExtension {
33
34
  --warning-color: #facc15;
34
35
  }
35
36
  </style>
36
- `);
37
+ `;
38
+ if (isIframe) {
39
+ scripts += `<qumra-selector></qumra-selector>`;
40
+ }
41
+ return new nunjucks_1.runtime.SafeString(scripts);
37
42
  }
38
43
  })();
@@ -18,7 +18,7 @@ exports.default = new (class SeoExtension {
18
18
  ${injectionCode.body}
19
19
  `;
20
20
  if (isIframe) {
21
- scripts += `https://cdn.qumra.cloud/lib/bridge/1.0.0/qumra-bridge.js`;
21
+ scripts += `<qumra-selector></qumra-selector>`;
22
22
  }
23
23
  return new nunjucks_1.runtime.SafeString(scripts);
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.129",
3
+ "version": "2.0.130",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {