@builder.io/sdk-react-native 0.0.1-63 → 0.0.1-66
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-native",
|
|
3
3
|
"description": "Builder.io SDK for React Native",
|
|
4
|
-
"version": "0.0.1-
|
|
4
|
+
"version": "0.0.1-66",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
@@ -117,6 +117,13 @@ function RenderContent(props) {
|
|
|
117
117
|
function httpReqsData() {
|
|
118
118
|
return {};
|
|
119
119
|
}
|
|
120
|
+
function onClick(_event) {
|
|
121
|
+
if (useContent() && props.canTrack !== false) {
|
|
122
|
+
track("click", {
|
|
123
|
+
contentId: useContent().id
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
120
127
|
function evalExpression(expression) {
|
|
121
128
|
return expression.replace(/{{([^}]+)}}/g, (_match, group) => evaluate({
|
|
122
129
|
code: group,
|
|
@@ -174,7 +181,7 @@ function RenderContent(props) {
|
|
|
174
181
|
window.addEventListener("message", processMessage);
|
|
175
182
|
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
|
|
176
183
|
}
|
|
177
|
-
if (useContent()) {
|
|
184
|
+
if (useContent() && props.canTrack !== false) {
|
|
178
185
|
track("impression", {
|
|
179
186
|
contentId: useContent().id
|
|
180
187
|
});
|
|
@@ -236,10 +243,8 @@ function RenderContent(props) {
|
|
|
236
243
|
}
|
|
237
244
|
}
|
|
238
245
|
}, useContent() ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View, {
|
|
239
|
-
onClick: (event) =>
|
|
240
|
-
|
|
241
|
-
}),
|
|
242
|
-
"data-builder-content-id": (_e = useContent == null ? void 0 : useContent()) == null ? void 0 : _e.id
|
|
246
|
+
onClick: (event) => onClick(event),
|
|
247
|
+
"builder-content-id": (_e = useContent == null ? void 0 : useContent()) == null ? void 0 : _e.id
|
|
243
248
|
}, shouldRenderContentStyles() ? /* @__PURE__ */ React.createElement(RenderContentStyles, {
|
|
244
249
|
cssCode: (_g = (_f = useContent == null ? void 0 : useContent()) == null ? void 0 : _f.data) == null ? void 0 : _g.cssCode,
|
|
245
250
|
customFonts: (_i = (_h = useContent == null ? void 0 : useContent()) == null ? void 0 : _h.data) == null ? void 0 : _i.customFonts
|