@verdocs/web-sdk-react 2.3.70 → 2.3.72
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,5 +1,9 @@
|
|
|
1
1
|
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
2
|
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Transforms a React event name to a browser event name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
3
7
|
/**
|
|
4
8
|
* Checks if an event is supported in the current execution environment.
|
|
5
9
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
@@ -57,6 +57,16 @@ export const getClassName = (classList, newProps, oldProps) => {
|
|
|
57
57
|
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
58
58
|
return finalClassNames.join(' ');
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Transforms a React event name to a browser event name.
|
|
62
|
+
*/
|
|
63
|
+
export const transformReactEventName = (eventNameSuffix) => {
|
|
64
|
+
switch (eventNameSuffix) {
|
|
65
|
+
case 'doubleclick':
|
|
66
|
+
return 'dblclick';
|
|
67
|
+
}
|
|
68
|
+
return eventNameSuffix;
|
|
69
|
+
};
|
|
60
70
|
/**
|
|
61
71
|
* Checks if an event is supported in the current execution environment.
|
|
62
72
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
@@ -66,7 +76,7 @@ export const isCoveredByReact = (eventNameSuffix) => {
|
|
|
66
76
|
return true;
|
|
67
77
|
}
|
|
68
78
|
else {
|
|
69
|
-
const eventName = 'on' + eventNameSuffix;
|
|
79
|
+
const eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
70
80
|
let isSupported = eventName in document;
|
|
71
81
|
if (!isSupported) {
|
|
72
82
|
const element = document.createElement('div');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdocs/web-sdk-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.72",
|
|
4
4
|
"description": "Verdocs Web SDK for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"typescript": "^5.3.3"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@verdocs/web-sdk": "^2.3.
|
|
33
|
+
"@verdocs/web-sdk": "^2.3.71"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^18.2.0",
|