@builder.io/sdk-qwik 0.18.1 → 0.18.2
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.
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +18 -8
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +18 -8
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +18 -8
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +18 -8
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/components/content/components/enable-editor.qwik.cjs +18 -8
- package/lib/node/components/content/components/enable-editor.qwik.mjs +18 -8
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/package.json +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
|
@@ -14,6 +14,7 @@ const registerComponent = require("../../../functions/register-component.qwik.cj
|
|
|
14
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
15
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
16
16
|
const canTrack = require("../../../helpers/canTrack.qwik.cjs");
|
|
17
|
+
const cookie = require("../../../helpers/cookie.qwik.cjs");
|
|
17
18
|
const subscribeToEditor = require("../../../helpers/subscribe-to-editor.qwik.cjs");
|
|
18
19
|
const initEditing = require("../../../scripts/init-editing.qwik.cjs");
|
|
19
20
|
const animator = require("../../block/animator.qwik.cjs");
|
|
@@ -153,6 +154,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
153
154
|
const state = qwik.useStore({
|
|
154
155
|
ContentWrapper: props.contentWrapper || "div",
|
|
155
156
|
clicked: false,
|
|
157
|
+
hasExecuted: false,
|
|
156
158
|
httpReqsData: {},
|
|
157
159
|
httpReqsPending: {}
|
|
158
160
|
}, {
|
|
@@ -217,25 +219,32 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
217
219
|
state
|
|
218
220
|
]));
|
|
219
221
|
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
220
|
-
var _a2, _b2, _c, _d;
|
|
221
|
-
const [props2] = qwik.useLexicalScope();
|
|
222
|
+
var _a2, _b2, _c, _d, _e;
|
|
223
|
+
const [props2, state2] = qwik.useLexicalScope();
|
|
224
|
+
if (state2.hasExecuted)
|
|
225
|
+
return;
|
|
222
226
|
if (isBrowser.isBrowser()) {
|
|
227
|
+
state2.hasExecuted = true;
|
|
223
228
|
if (isEditing.isEditing() && !props2.isNestedRender) {
|
|
224
229
|
if (element)
|
|
225
230
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
226
231
|
}
|
|
227
232
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
const winningVariantId = cookie.getCookieSync({
|
|
234
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
235
|
+
canTrack: true
|
|
236
|
+
});
|
|
237
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
238
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
239
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
240
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
232
241
|
index$1._track({
|
|
233
242
|
apiHost: props2.apiHost,
|
|
234
243
|
type: "impression",
|
|
235
244
|
canTrack: true,
|
|
236
245
|
contentId,
|
|
237
246
|
apiKey: apiKeyProp,
|
|
238
|
-
variationId:
|
|
247
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
239
248
|
});
|
|
240
249
|
}
|
|
241
250
|
if (isPreviewing.isPreviewing() && !isEditing.isEditing()) {
|
|
@@ -244,7 +253,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
247
|
-
props
|
|
256
|
+
props,
|
|
257
|
+
state
|
|
248
258
|
]));
|
|
249
259
|
qwik.useContextProvider(builder_context, props.builderContextSignal);
|
|
250
260
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -12,6 +12,7 @@ import { createRegisterComponentMessage } from "../../../functions/register-comp
|
|
|
12
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
13
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
14
14
|
import { getDefaultCanTrack } from "../../../helpers/canTrack.qwik.mjs";
|
|
15
|
+
import { getCookieSync } from "../../../helpers/cookie.qwik.mjs";
|
|
15
16
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor.qwik.mjs";
|
|
16
17
|
import { registerInsertMenu, setupBrowserForEditing } from "../../../scripts/init-editing.qwik.mjs";
|
|
17
18
|
import { triggerAnimation } from "../../block/animator.qwik.mjs";
|
|
@@ -151,6 +152,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
151
152
|
const state = useStore({
|
|
152
153
|
ContentWrapper: props.contentWrapper || "div",
|
|
153
154
|
clicked: false,
|
|
155
|
+
hasExecuted: false,
|
|
154
156
|
httpReqsData: {},
|
|
155
157
|
httpReqsPending: {}
|
|
156
158
|
}, {
|
|
@@ -215,25 +217,32 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
215
217
|
state
|
|
216
218
|
]));
|
|
217
219
|
useOnDocument("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
218
|
-
var _a2, _b2, _c, _d;
|
|
219
|
-
const [props2] = useLexicalScope();
|
|
220
|
+
var _a2, _b2, _c, _d, _e;
|
|
221
|
+
const [props2, state2] = useLexicalScope();
|
|
222
|
+
if (state2.hasExecuted)
|
|
223
|
+
return;
|
|
220
224
|
if (isBrowser()) {
|
|
225
|
+
state2.hasExecuted = true;
|
|
221
226
|
if (isEditing() && !props2.isNestedRender) {
|
|
222
227
|
if (element)
|
|
223
228
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
224
229
|
}
|
|
225
230
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
const winningVariantId = getCookieSync({
|
|
232
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
233
|
+
canTrack: true
|
|
234
|
+
});
|
|
235
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
236
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
237
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
238
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
230
239
|
_track({
|
|
231
240
|
apiHost: props2.apiHost,
|
|
232
241
|
type: "impression",
|
|
233
242
|
canTrack: true,
|
|
234
243
|
contentId,
|
|
235
244
|
apiKey: apiKeyProp,
|
|
236
|
-
variationId:
|
|
245
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
237
246
|
});
|
|
238
247
|
}
|
|
239
248
|
if (isPreviewing() && !isEditing()) {
|
|
@@ -242,7 +251,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
242
251
|
}
|
|
243
252
|
}
|
|
244
253
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
245
|
-
props
|
|
254
|
+
props,
|
|
255
|
+
state
|
|
246
256
|
]));
|
|
247
257
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
248
258
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
@@ -14,6 +14,7 @@ const registerComponent = require("../../../functions/register-component.qwik.cj
|
|
|
14
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
15
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
16
16
|
const canTrack = require("../../../helpers/canTrack.qwik.cjs");
|
|
17
|
+
const cookie = require("../../../helpers/cookie.qwik.cjs");
|
|
17
18
|
const subscribeToEditor = require("../../../helpers/subscribe-to-editor.qwik.cjs");
|
|
18
19
|
const initEditing = require("../../../scripts/init-editing.qwik.cjs");
|
|
19
20
|
const animator = require("../../block/animator.qwik.cjs");
|
|
@@ -153,6 +154,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
153
154
|
const state = qwik.useStore({
|
|
154
155
|
ContentWrapper: props.contentWrapper || "div",
|
|
155
156
|
clicked: false,
|
|
157
|
+
hasExecuted: false,
|
|
156
158
|
httpReqsData: {},
|
|
157
159
|
httpReqsPending: {}
|
|
158
160
|
}, {
|
|
@@ -217,25 +219,32 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
217
219
|
state
|
|
218
220
|
]));
|
|
219
221
|
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
220
|
-
var _a2, _b2, _c, _d;
|
|
221
|
-
const [props2] = qwik.useLexicalScope();
|
|
222
|
+
var _a2, _b2, _c, _d, _e;
|
|
223
|
+
const [props2, state2] = qwik.useLexicalScope();
|
|
224
|
+
if (state2.hasExecuted)
|
|
225
|
+
return;
|
|
222
226
|
if (isBrowser.isBrowser()) {
|
|
227
|
+
state2.hasExecuted = true;
|
|
223
228
|
if (isEditing.isEditing() && !props2.isNestedRender) {
|
|
224
229
|
if (element)
|
|
225
230
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
226
231
|
}
|
|
227
232
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
const winningVariantId = cookie.getCookieSync({
|
|
234
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
235
|
+
canTrack: true
|
|
236
|
+
});
|
|
237
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
238
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
239
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
240
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
232
241
|
index$1._track({
|
|
233
242
|
apiHost: props2.apiHost,
|
|
234
243
|
type: "impression",
|
|
235
244
|
canTrack: true,
|
|
236
245
|
contentId,
|
|
237
246
|
apiKey: apiKeyProp,
|
|
238
|
-
variationId:
|
|
247
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
239
248
|
});
|
|
240
249
|
}
|
|
241
250
|
if (isPreviewing.isPreviewing() && !isEditing.isEditing()) {
|
|
@@ -244,7 +253,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
247
|
-
props
|
|
256
|
+
props,
|
|
257
|
+
state
|
|
248
258
|
]));
|
|
249
259
|
qwik.useContextProvider(builder_context, props.builderContextSignal);
|
|
250
260
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -12,6 +12,7 @@ import { createRegisterComponentMessage } from "../../../functions/register-comp
|
|
|
12
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
13
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
14
14
|
import { getDefaultCanTrack } from "../../../helpers/canTrack.qwik.mjs";
|
|
15
|
+
import { getCookieSync } from "../../../helpers/cookie.qwik.mjs";
|
|
15
16
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor.qwik.mjs";
|
|
16
17
|
import { registerInsertMenu, setupBrowserForEditing } from "../../../scripts/init-editing.qwik.mjs";
|
|
17
18
|
import { triggerAnimation } from "../../block/animator.qwik.mjs";
|
|
@@ -151,6 +152,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
151
152
|
const state = useStore({
|
|
152
153
|
ContentWrapper: props.contentWrapper || "div",
|
|
153
154
|
clicked: false,
|
|
155
|
+
hasExecuted: false,
|
|
154
156
|
httpReqsData: {},
|
|
155
157
|
httpReqsPending: {}
|
|
156
158
|
}, {
|
|
@@ -215,25 +217,32 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
215
217
|
state
|
|
216
218
|
]));
|
|
217
219
|
useOnDocument("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
218
|
-
var _a2, _b2, _c, _d;
|
|
219
|
-
const [props2] = useLexicalScope();
|
|
220
|
+
var _a2, _b2, _c, _d, _e;
|
|
221
|
+
const [props2, state2] = useLexicalScope();
|
|
222
|
+
if (state2.hasExecuted)
|
|
223
|
+
return;
|
|
220
224
|
if (isBrowser()) {
|
|
225
|
+
state2.hasExecuted = true;
|
|
221
226
|
if (isEditing() && !props2.isNestedRender) {
|
|
222
227
|
if (element)
|
|
223
228
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
224
229
|
}
|
|
225
230
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
const winningVariantId = getCookieSync({
|
|
232
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
233
|
+
canTrack: true
|
|
234
|
+
});
|
|
235
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
236
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
237
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
238
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
230
239
|
_track({
|
|
231
240
|
apiHost: props2.apiHost,
|
|
232
241
|
type: "impression",
|
|
233
242
|
canTrack: true,
|
|
234
243
|
contentId,
|
|
235
244
|
apiKey: apiKeyProp,
|
|
236
|
-
variationId:
|
|
245
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
237
246
|
});
|
|
238
247
|
}
|
|
239
248
|
if (isPreviewing() && !isEditing()) {
|
|
@@ -242,7 +251,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
242
251
|
}
|
|
243
252
|
}
|
|
244
253
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
245
|
-
props
|
|
254
|
+
props,
|
|
255
|
+
state
|
|
246
256
|
]));
|
|
247
257
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
248
258
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
@@ -14,6 +14,7 @@ const registerComponent = require("../../../functions/register-component.qwik.cj
|
|
|
14
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
15
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
16
16
|
const canTrack = require("../../../helpers/canTrack.qwik.cjs");
|
|
17
|
+
const cookie = require("../../../helpers/cookie.qwik.cjs");
|
|
17
18
|
const subscribeToEditor = require("../../../helpers/subscribe-to-editor.qwik.cjs");
|
|
18
19
|
const initEditing = require("../../../scripts/init-editing.qwik.cjs");
|
|
19
20
|
const animator = require("../../block/animator.qwik.cjs");
|
|
@@ -153,6 +154,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
153
154
|
const state = qwik.useStore({
|
|
154
155
|
ContentWrapper: props.contentWrapper || "div",
|
|
155
156
|
clicked: false,
|
|
157
|
+
hasExecuted: false,
|
|
156
158
|
httpReqsData: {},
|
|
157
159
|
httpReqsPending: {}
|
|
158
160
|
}, {
|
|
@@ -217,25 +219,32 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
217
219
|
state
|
|
218
220
|
]));
|
|
219
221
|
qwik.useOnDocument("readystatechange", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
220
|
-
var _a2, _b2, _c, _d;
|
|
221
|
-
const [props2] = qwik.useLexicalScope();
|
|
222
|
+
var _a2, _b2, _c, _d, _e;
|
|
223
|
+
const [props2, state2] = qwik.useLexicalScope();
|
|
224
|
+
if (state2.hasExecuted)
|
|
225
|
+
return;
|
|
222
226
|
if (isBrowser.isBrowser()) {
|
|
227
|
+
state2.hasExecuted = true;
|
|
223
228
|
if (isEditing.isEditing() && !props2.isNestedRender) {
|
|
224
229
|
if (element)
|
|
225
230
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
226
231
|
}
|
|
227
232
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
const winningVariantId = cookie.getCookieSync({
|
|
234
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
235
|
+
canTrack: true
|
|
236
|
+
});
|
|
237
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
238
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
239
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
240
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
232
241
|
index$1._track({
|
|
233
242
|
apiHost: props2.apiHost,
|
|
234
243
|
type: "impression",
|
|
235
244
|
canTrack: true,
|
|
236
245
|
contentId,
|
|
237
246
|
apiKey: apiKeyProp,
|
|
238
|
-
variationId:
|
|
247
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
239
248
|
});
|
|
240
249
|
}
|
|
241
250
|
if (isPreviewing.isPreviewing() && !isEditing.isEditing()) {
|
|
@@ -244,7 +253,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
247
|
-
props
|
|
256
|
+
props,
|
|
257
|
+
state
|
|
248
258
|
]));
|
|
249
259
|
qwik.useContextProvider(builder_context, props.builderContextSignal);
|
|
250
260
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -12,6 +12,7 @@ import { createRegisterComponentMessage } from "../../../functions/register-comp
|
|
|
12
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
13
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
14
14
|
import { getDefaultCanTrack } from "../../../helpers/canTrack.qwik.mjs";
|
|
15
|
+
import { getCookieSync } from "../../../helpers/cookie.qwik.mjs";
|
|
15
16
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor.qwik.mjs";
|
|
16
17
|
import { registerInsertMenu, setupBrowserForEditing } from "../../../scripts/init-editing.qwik.mjs";
|
|
17
18
|
import { triggerAnimation } from "../../block/animator.qwik.mjs";
|
|
@@ -151,6 +152,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
151
152
|
const state = useStore({
|
|
152
153
|
ContentWrapper: props.contentWrapper || "div",
|
|
153
154
|
clicked: false,
|
|
155
|
+
hasExecuted: false,
|
|
154
156
|
httpReqsData: {},
|
|
155
157
|
httpReqsPending: {}
|
|
156
158
|
}, {
|
|
@@ -215,25 +217,32 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
215
217
|
state
|
|
216
218
|
]));
|
|
217
219
|
useOnDocument("readystatechange", /* @__PURE__ */ inlinedQrl((event, element) => {
|
|
218
|
-
var _a2, _b2, _c, _d;
|
|
219
|
-
const [props2] = useLexicalScope();
|
|
220
|
+
var _a2, _b2, _c, _d, _e;
|
|
221
|
+
const [props2, state2] = useLexicalScope();
|
|
222
|
+
if (state2.hasExecuted)
|
|
223
|
+
return;
|
|
220
224
|
if (isBrowser()) {
|
|
225
|
+
state2.hasExecuted = true;
|
|
221
226
|
if (isEditing() && !props2.isNestedRender) {
|
|
222
227
|
if (element)
|
|
223
228
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
224
229
|
}
|
|
225
230
|
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
const winningVariantId = getCookieSync({
|
|
232
|
+
name: `builder.tests.${(_b2 = props2.builderContextSignal.content) == null ? void 0 : _b2.id}`,
|
|
233
|
+
canTrack: true
|
|
234
|
+
});
|
|
235
|
+
const variationId = (_c = element.attributes.getNamedItem("variationId")) == null ? void 0 : _c.value;
|
|
236
|
+
if (shouldTrackImpression && variationId === winningVariantId) {
|
|
237
|
+
const contentId = (_d = element.attributes.getNamedItem("contentId")) == null ? void 0 : _d.value;
|
|
238
|
+
const apiKeyProp = (_e = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _e.value;
|
|
230
239
|
_track({
|
|
231
240
|
apiHost: props2.apiHost,
|
|
232
241
|
type: "impression",
|
|
233
242
|
canTrack: true,
|
|
234
243
|
contentId,
|
|
235
244
|
apiKey: apiKeyProp,
|
|
236
|
-
variationId:
|
|
245
|
+
variationId: winningVariantId !== contentId ? winningVariantId : void 0
|
|
237
246
|
});
|
|
238
247
|
}
|
|
239
248
|
if (isPreviewing() && !isEditing()) {
|
|
@@ -242,7 +251,8 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
242
251
|
}
|
|
243
252
|
}
|
|
244
253
|
}, "EnableEditor_component_useOnDocument_H7syEGJXM4Y", [
|
|
245
|
-
props
|
|
254
|
+
props,
|
|
255
|
+
state
|
|
246
256
|
]));
|
|
247
257
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
248
258
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.18.
|
|
1
|
+
export declare const SDK_VERSION = "0.18.2";
|