@robylon/react-native-sdk 2.0.19-staging.23 → 2.0.19-staging.24
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/commonjs/components/ChatbotWebView.js +22 -102
- package/lib/commonjs/components/ChatbotWebView.js.map +1 -1
- package/lib/commonjs/versions/version.staging.js +1 -1
- package/lib/module/components/ChatbotWebView.js +22 -102
- package/lib/module/components/ChatbotWebView.js.map +1 -1
- package/lib/module/openChatbot.js +2 -1
- package/lib/module/openChatbot.js.map +1 -1
- package/lib/module/versions/version.staging.js +1 -1
- package/lib/typescript/components/ChatbotWebView.d.ts.map +1 -1
- package/lib/typescript/versions/version.staging.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ChatbotWebView.tsx +26 -111
- package/src/versions/version.staging.ts +1 -1
|
@@ -1,109 +1,29 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* {
|
|
8
|
-
pointer-events: auto !important;
|
|
9
|
-
cursor: auto !important;
|
|
10
|
-
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
|
|
11
|
-
touch-action: manipulation !important;
|
|
12
|
-
}
|
|
13
|
-
button,
|
|
14
|
-
[role="button"],
|
|
15
|
-
a,
|
|
16
|
-
input,
|
|
17
|
-
select,
|
|
18
|
-
textarea {
|
|
19
|
-
cursor: pointer !important;
|
|
20
|
-
user-select: none !important;
|
|
21
|
-
-webkit-user-select: none !important;
|
|
22
|
-
-webkit-touch-callout: none !important;
|
|
23
|
-
outline: none !important;
|
|
24
|
-
}
|
|
25
|
-
\`;
|
|
26
|
-
document.head.appendChild(style);
|
|
27
|
-
}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
|
|
2
|
+
// Set viewport
|
|
3
|
+
const meta = document.createElement('meta');
|
|
4
|
+
meta.name = 'viewport';
|
|
5
|
+
meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
|
|
6
|
+
document.head.appendChild(meta);
|
|
28
7
|
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
// Basic touch handling
|
|
9
|
+
document.documentElement.style.webkitTouchCallout = 'none';
|
|
10
|
+
document.documentElement.style.webkitUserSelect = 'none';
|
|
11
|
+
document.documentElement.style.userSelect = 'none';
|
|
12
|
+
|
|
13
|
+
// Make all interactive elements clickable
|
|
14
|
+
const style = document.createElement('style');
|
|
15
|
+
style.textContent = \`
|
|
16
|
+
* { touch-action: manipulation; }
|
|
17
|
+
button, [role="button"], a, input, select, textarea {
|
|
18
|
+
cursor: pointer !important;
|
|
19
|
+
-webkit-tap-highlight-color: transparent;
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Intercept and log all click events
|
|
40
|
-
document.addEventListener('click', function(e) {
|
|
41
|
-
const target = e.target;
|
|
42
|
-
console.log('Click event on:', {
|
|
43
|
-
tagName: target.tagName,
|
|
44
|
-
className: target.className,
|
|
45
|
-
id: target.id,
|
|
46
|
-
text: target.textContent,
|
|
47
|
-
rect: target.getBoundingClientRect()
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Force click event to propagate
|
|
51
|
-
e.stopPropagation = function() {};
|
|
52
|
-
e.cancelBubble = false;
|
|
53
|
-
}, true);
|
|
54
|
-
|
|
55
|
-
// Handle touch events
|
|
56
|
-
document.addEventListener('touchstart', function(e) {
|
|
57
|
-
const target = e.target;
|
|
58
|
-
target.click(); // Force click event
|
|
59
|
-
console.log('Touch event on:', target.tagName, target.className);
|
|
60
|
-
}, true);
|
|
61
|
-
|
|
62
|
-
// Ensure all buttons and clickable elements are properly configured
|
|
63
|
-
function makeElementsClickable() {
|
|
64
|
-
document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
|
|
65
|
-
el.style.setProperty('pointer-events', 'auto', 'important');
|
|
66
|
-
el.style.setProperty('cursor', 'pointer', 'important');
|
|
67
|
-
el.style.setProperty('touch-action', 'manipulation', 'important');
|
|
68
|
-
|
|
69
|
-
// Remove any click prevention
|
|
70
|
-
el.onclick = el.onclick || function() {};
|
|
71
|
-
el.addEventListener('click', function(e) {
|
|
72
|
-
e.stopPropagation = function() {};
|
|
73
|
-
console.log('Click handler activated for:', el.tagName, el.className);
|
|
74
|
-
}, true);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Run immediately and observe DOM changes
|
|
79
|
-
makeElementsClickable();
|
|
80
|
-
new MutationObserver(function(mutations) {
|
|
81
|
-
makeElementsClickable();
|
|
82
|
-
}).observe(document.body, {
|
|
83
|
-
childList: true,
|
|
84
|
-
subtree: true,
|
|
85
|
-
attributes: true,
|
|
86
|
-
attributeFilter: ['style', 'class']
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// Debug tap/click coordinates
|
|
90
|
-
document.addEventListener('touchstart', function(e) {
|
|
91
|
-
const touch = e.touches[0];
|
|
92
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
93
|
-
type: 'CONSOLE',
|
|
94
|
-
level: 'debug',
|
|
95
|
-
data: 'Touch coordinates: ' + JSON.stringify({
|
|
96
|
-
clientX: touch.clientX,
|
|
97
|
-
clientY: touch.clientY,
|
|
98
|
-
pageX: touch.pageX,
|
|
99
|
-
pageY: touch.pageY
|
|
100
|
-
})
|
|
101
|
-
}));
|
|
102
|
-
}, true);
|
|
21
|
+
\`;
|
|
22
|
+
document.head.appendChild(style);
|
|
103
23
|
|
|
104
24
|
true;
|
|
105
|
-
|
|
25
|
+
`;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
|
|
106
26
|
${defaultInjectedJavaScript}
|
|
107
27
|
${props.injectedJavaScript||""}
|
|
108
|
-
`,onMessage:
|
|
28
|
+
`,onMessage:props.onMessage,style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:_reactNative.Platform.OS==="android",automaticallyAdjustContentInsets:false,contentInsetAdjustmentBehavior:"never",decelerationRate:"normal",javaScriptEnabled:true,domStorageEnabled:true,scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
|
|
109
29
|
//# sourceMappingURL=ChatbotWebView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","Platform","OS","automaticallyAdjustContentInsets","contentInsetAdjustmentBehavior","decelerationRate","javaScriptEnabled","domStorageEnabled","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot":"../../../src","sources":["components/ChatbotWebView.tsx"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,mBAAA,CAAAF,OAAA,yBAA6D,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,wBAAAC,KAAA,MAAAC,YAAA,8GAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,CAAA,IAAAd,CAAA,gBAAAc,CAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,CAAA,OAAAG,CAAA,CAAAP,CAAA,CAAAC,MAAA,CAAAE,wBAAA,C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C,8BAA8B,CAAC,OAAO,CACtCC,gBAAgB,CAAC,QAAQ,CACzBC,iBAAiB,CAAE,IAAK,CACxBC,iBAAiB,CAAE,IAAK,CACxBC,aAAa,CAAE,IAAK,CACpBC,sBAAsB,CAAE,IAAK,EAC9B,CAAC,CAEN,CACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA3C,OAAA,CAEac,cAAc","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.24';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
|
@@ -1,109 +1,29 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* {
|
|
8
|
-
pointer-events: auto !important;
|
|
9
|
-
cursor: auto !important;
|
|
10
|
-
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
|
|
11
|
-
touch-action: manipulation !important;
|
|
12
|
-
}
|
|
13
|
-
button,
|
|
14
|
-
[role="button"],
|
|
15
|
-
a,
|
|
16
|
-
input,
|
|
17
|
-
select,
|
|
18
|
-
textarea {
|
|
19
|
-
cursor: pointer !important;
|
|
20
|
-
user-select: none !important;
|
|
21
|
-
-webkit-user-select: none !important;
|
|
22
|
-
-webkit-touch-callout: none !important;
|
|
23
|
-
outline: none !important;
|
|
24
|
-
}
|
|
25
|
-
\`;
|
|
26
|
-
document.head.appendChild(style);
|
|
27
|
-
}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
|
|
2
|
+
// Set viewport
|
|
3
|
+
const meta = document.createElement('meta');
|
|
4
|
+
meta.name = 'viewport';
|
|
5
|
+
meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
|
|
6
|
+
document.head.appendChild(meta);
|
|
28
7
|
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
// Basic touch handling
|
|
9
|
+
document.documentElement.style.webkitTouchCallout = 'none';
|
|
10
|
+
document.documentElement.style.webkitUserSelect = 'none';
|
|
11
|
+
document.documentElement.style.userSelect = 'none';
|
|
12
|
+
|
|
13
|
+
// Make all interactive elements clickable
|
|
14
|
+
const style = document.createElement('style');
|
|
15
|
+
style.textContent = \`
|
|
16
|
+
* { touch-action: manipulation; }
|
|
17
|
+
button, [role="button"], a, input, select, textarea {
|
|
18
|
+
cursor: pointer !important;
|
|
19
|
+
-webkit-tap-highlight-color: transparent;
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Intercept and log all click events
|
|
40
|
-
document.addEventListener('click', function(e) {
|
|
41
|
-
const target = e.target;
|
|
42
|
-
console.log('Click event on:', {
|
|
43
|
-
tagName: target.tagName,
|
|
44
|
-
className: target.className,
|
|
45
|
-
id: target.id,
|
|
46
|
-
text: target.textContent,
|
|
47
|
-
rect: target.getBoundingClientRect()
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Force click event to propagate
|
|
51
|
-
e.stopPropagation = function() {};
|
|
52
|
-
e.cancelBubble = false;
|
|
53
|
-
}, true);
|
|
54
|
-
|
|
55
|
-
// Handle touch events
|
|
56
|
-
document.addEventListener('touchstart', function(e) {
|
|
57
|
-
const target = e.target;
|
|
58
|
-
target.click(); // Force click event
|
|
59
|
-
console.log('Touch event on:', target.tagName, target.className);
|
|
60
|
-
}, true);
|
|
61
|
-
|
|
62
|
-
// Ensure all buttons and clickable elements are properly configured
|
|
63
|
-
function makeElementsClickable() {
|
|
64
|
-
document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
|
|
65
|
-
el.style.setProperty('pointer-events', 'auto', 'important');
|
|
66
|
-
el.style.setProperty('cursor', 'pointer', 'important');
|
|
67
|
-
el.style.setProperty('touch-action', 'manipulation', 'important');
|
|
68
|
-
|
|
69
|
-
// Remove any click prevention
|
|
70
|
-
el.onclick = el.onclick || function() {};
|
|
71
|
-
el.addEventListener('click', function(e) {
|
|
72
|
-
e.stopPropagation = function() {};
|
|
73
|
-
console.log('Click handler activated for:', el.tagName, el.className);
|
|
74
|
-
}, true);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Run immediately and observe DOM changes
|
|
79
|
-
makeElementsClickable();
|
|
80
|
-
new MutationObserver(function(mutations) {
|
|
81
|
-
makeElementsClickable();
|
|
82
|
-
}).observe(document.body, {
|
|
83
|
-
childList: true,
|
|
84
|
-
subtree: true,
|
|
85
|
-
attributes: true,
|
|
86
|
-
attributeFilter: ['style', 'class']
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// Debug tap/click coordinates
|
|
90
|
-
document.addEventListener('touchstart', function(e) {
|
|
91
|
-
const touch = e.touches[0];
|
|
92
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
93
|
-
type: 'CONSOLE',
|
|
94
|
-
level: 'debug',
|
|
95
|
-
data: 'Touch coordinates: ' + JSON.stringify({
|
|
96
|
-
clientX: touch.clientX,
|
|
97
|
-
clientY: touch.clientY,
|
|
98
|
-
pageX: touch.pageX,
|
|
99
|
-
pageY: touch.pageY
|
|
100
|
-
})
|
|
101
|
-
}));
|
|
102
|
-
}, true);
|
|
21
|
+
\`;
|
|
22
|
+
document.head.appendChild(style);
|
|
103
23
|
|
|
104
24
|
true;
|
|
105
|
-
|
|
25
|
+
`;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
|
|
106
26
|
${defaultInjectedJavaScript}
|
|
107
27
|
${props.injectedJavaScript||""}
|
|
108
|
-
`,onMessage:
|
|
28
|
+
`,onMessage:props.onMessage,style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:_reactNative.Platform.OS==="android",automaticallyAdjustContentInsets:false,contentInsetAdjustmentBehavior:"never",decelerationRate:"normal",javaScriptEnabled:true,domStorageEnabled:true,scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
|
|
109
29
|
//# sourceMappingURL=ChatbotWebView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","Platform","OS","automaticallyAdjustContentInsets","contentInsetAdjustmentBehavior","decelerationRate","javaScriptEnabled","domStorageEnabled","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot":"../../../src","sources":["components/ChatbotWebView.tsx"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,mBAAA,CAAAF,OAAA,yBAA6D,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,wBAAAC,KAAA,MAAAC,YAAA,8GAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,CAAA,IAAAd,CAAA,gBAAAc,CAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,CAAA,OAAAG,CAAA,CAAAP,CAAA,CAAAC,MAAA,CAAAE,wBAA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ACxCC,8BAA8B,CAAC,OAAO,CACtCC,gBAAgB,CAAC,QAAQ,CACzBC,iBAAiB,CAAE,IAAK,CACxBC,iBAAiB,CAAE,IAAK,CACxBC,aAAa,CAAE,IAAK,CACpBC,sBAAsB,CAAE,IAAK,EAC9B,CAAC,CAEN,CACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA3C,OAAA,CAEac,cAAc","ignoreList":[]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//# sourceMappingURL=openChatbot.js.mape",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
|
|
2
3
|
//# sourceMappingURL=openChatbot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.tsx"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.24';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatbotWebView.d.ts","sourceRoot":"","sources":["../../../src/components/ChatbotWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,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c,yFAsDnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.19-staging.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.19-staging.24";
|
|
2
2
|
//# sourceMappingURL=version.staging.d.ts.map
|
package/package.json
CHANGED
|
@@ -20,110 +20,30 @@ const ChatbotWebView = forwardRef<WebView, ChatbotWebViewProps>(
|
|
|
20
20
|
const { onDebugMessage, ...restProps } = props;
|
|
21
21
|
|
|
22
22
|
const defaultInjectedJavaScript = `
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* {
|
|
29
|
-
pointer-events: auto !important;
|
|
30
|
-
cursor: auto !important;
|
|
31
|
-
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
|
|
32
|
-
touch-action: manipulation !important;
|
|
33
|
-
}
|
|
34
|
-
button,
|
|
35
|
-
[role="button"],
|
|
36
|
-
a,
|
|
37
|
-
input,
|
|
38
|
-
select,
|
|
39
|
-
textarea {
|
|
40
|
-
cursor: pointer !important;
|
|
41
|
-
user-select: none !important;
|
|
42
|
-
-webkit-user-select: none !important;
|
|
43
|
-
-webkit-touch-callout: none !important;
|
|
44
|
-
outline: none !important;
|
|
45
|
-
}
|
|
46
|
-
\`;
|
|
47
|
-
document.head.appendChild(style);
|
|
48
|
-
}
|
|
23
|
+
// Set viewport
|
|
24
|
+
const meta = document.createElement('meta');
|
|
25
|
+
meta.name = 'viewport';
|
|
26
|
+
meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
|
|
27
|
+
document.head.appendChild(meta);
|
|
49
28
|
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
// Basic touch handling
|
|
30
|
+
document.documentElement.style.webkitTouchCallout = 'none';
|
|
31
|
+
document.documentElement.style.webkitUserSelect = 'none';
|
|
32
|
+
document.documentElement.style.userSelect = 'none';
|
|
33
|
+
|
|
34
|
+
// Make all interactive elements clickable
|
|
35
|
+
const style = document.createElement('style');
|
|
36
|
+
style.textContent = \`
|
|
37
|
+
* { touch-action: manipulation; }
|
|
38
|
+
button, [role="button"], a, input, select, textarea {
|
|
39
|
+
cursor: pointer !important;
|
|
40
|
+
-webkit-tap-highlight-color: transparent;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// Intercept and log all click events
|
|
61
|
-
document.addEventListener('click', function(e) {
|
|
62
|
-
const target = e.target;
|
|
63
|
-
console.log('Click event on:', {
|
|
64
|
-
tagName: target.tagName,
|
|
65
|
-
className: target.className,
|
|
66
|
-
id: target.id,
|
|
67
|
-
text: target.textContent,
|
|
68
|
-
rect: target.getBoundingClientRect()
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Force click event to propagate
|
|
72
|
-
e.stopPropagation = function() {};
|
|
73
|
-
e.cancelBubble = false;
|
|
74
|
-
}, true);
|
|
75
|
-
|
|
76
|
-
// Handle touch events
|
|
77
|
-
document.addEventListener('touchstart', function(e) {
|
|
78
|
-
const target = e.target;
|
|
79
|
-
target.click(); // Force click event
|
|
80
|
-
console.log('Touch event on:', target.tagName, target.className);
|
|
81
|
-
}, true);
|
|
82
|
-
|
|
83
|
-
// Ensure all buttons and clickable elements are properly configured
|
|
84
|
-
function makeElementsClickable() {
|
|
85
|
-
document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
|
|
86
|
-
el.style.setProperty('pointer-events', 'auto', 'important');
|
|
87
|
-
el.style.setProperty('cursor', 'pointer', 'important');
|
|
88
|
-
el.style.setProperty('touch-action', 'manipulation', 'important');
|
|
89
|
-
|
|
90
|
-
// Remove any click prevention
|
|
91
|
-
el.onclick = el.onclick || function() {};
|
|
92
|
-
el.addEventListener('click', function(e) {
|
|
93
|
-
e.stopPropagation = function() {};
|
|
94
|
-
console.log('Click handler activated for:', el.tagName, el.className);
|
|
95
|
-
}, true);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Run immediately and observe DOM changes
|
|
100
|
-
makeElementsClickable();
|
|
101
|
-
new MutationObserver(function(mutations) {
|
|
102
|
-
makeElementsClickable();
|
|
103
|
-
}).observe(document.body, {
|
|
104
|
-
childList: true,
|
|
105
|
-
subtree: true,
|
|
106
|
-
attributes: true,
|
|
107
|
-
attributeFilter: ['style', 'class']
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// Debug tap/click coordinates
|
|
111
|
-
document.addEventListener('touchstart', function(e) {
|
|
112
|
-
const touch = e.touches[0];
|
|
113
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
114
|
-
type: 'CONSOLE',
|
|
115
|
-
level: 'debug',
|
|
116
|
-
data: 'Touch coordinates: ' + JSON.stringify({
|
|
117
|
-
clientX: touch.clientX,
|
|
118
|
-
clientY: touch.clientY,
|
|
119
|
-
pageX: touch.pageX,
|
|
120
|
-
pageY: touch.pageY
|
|
121
|
-
})
|
|
122
|
-
}));
|
|
123
|
-
}, true);
|
|
42
|
+
\`;
|
|
43
|
+
document.head.appendChild(style);
|
|
124
44
|
|
|
125
45
|
true;
|
|
126
|
-
|
|
46
|
+
`;
|
|
127
47
|
|
|
128
48
|
return (
|
|
129
49
|
<WebView
|
|
@@ -133,22 +53,17 @@ const ChatbotWebView = forwardRef<WebView, ChatbotWebViewProps>(
|
|
|
133
53
|
${defaultInjectedJavaScript}
|
|
134
54
|
${props.injectedJavaScript || ""}
|
|
135
55
|
`}
|
|
136
|
-
onMessage={
|
|
137
|
-
|
|
138
|
-
try {
|
|
139
|
-
const data = JSON.parse(event.nativeEvent.data);
|
|
140
|
-
if (data.type === "CONSOLE") {
|
|
141
|
-
onDebugMessage?.(data.data);
|
|
142
|
-
}
|
|
143
|
-
} catch (e) {}
|
|
144
|
-
}}
|
|
145
|
-
style={[{ opacity: 0.99 }, props.style]} // Force new layer
|
|
56
|
+
onMessage={props.onMessage}
|
|
57
|
+
style={[{ opacity: 0.99 }, props.style]}
|
|
146
58
|
bounces={false}
|
|
147
59
|
showsHorizontalScrollIndicator={false}
|
|
148
60
|
showsVerticalScrollIndicator={false}
|
|
149
|
-
scalesPageToFit={
|
|
61
|
+
scalesPageToFit={Platform.OS === "android"}
|
|
150
62
|
automaticallyAdjustContentInsets={false}
|
|
63
|
+
contentInsetAdjustmentBehavior="never"
|
|
151
64
|
decelerationRate="normal"
|
|
65
|
+
javaScriptEnabled={true}
|
|
66
|
+
domStorageEnabled={true}
|
|
152
67
|
scrollEnabled={true}
|
|
153
68
|
directionalLockEnabled={true}
|
|
154
69
|
/>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not modify it manually.
|
|
2
|
-
export const SDK_VERSION = '2.0.19-staging.
|
|
2
|
+
export const SDK_VERSION = '2.0.19-staging.24';
|