@totalpave/cordova-plugin-insets 0.1.6 → 0.1.8
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/CHANGELOG.md +3 -0
- package/package.json +11 -11
- package/plugin.xml +2 -2
- package/src/www/Insets.ts +6 -0
- package/www/insets.js +5 -0
- package/www/insets.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
7
|
+
## 0.1.7 (July 6, 2023)
|
|
8
|
+
- Fixed clobbers namespace to merge instead, since this particular plugin targets a shared namespace.
|
|
9
|
+
|
|
7
10
|
## 0.1.6 (April 20, 2023)
|
|
8
11
|
- Replaced `insets.getSystemWindowInset*` usages that was deprecated in API 30.
|
|
9
12
|
- Replaced `insets.consumeSystemWindowInsets` usages that was deprecated in API 30.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@totalpave/cordova-plugin-insets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Cordova Android Plugin to receive native information regarding the unsafe area insets.",
|
|
5
5
|
"main": "www/insets.js",
|
|
6
6
|
"types": "www/api.d.ts",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/totalpaveinc/cordova-plugin-insets#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@babel/core": "7.
|
|
29
|
-
"@babel/preset-env": "7.
|
|
30
|
-
"@babel/preset-typescript": "7.
|
|
31
|
-
"@babel/register": "7.
|
|
28
|
+
"@babel/core": "7.22.8",
|
|
29
|
+
"@babel/preset-env": "7.22.7",
|
|
30
|
+
"@babel/preset-typescript": "7.22.5",
|
|
31
|
+
"@babel/register": "7.22.5",
|
|
32
32
|
"@rollup/plugin-babel": "6.0.3",
|
|
33
|
-
"@rollup/plugin-commonjs": "
|
|
34
|
-
"@rollup/plugin-node-resolve": "15.0
|
|
33
|
+
"@rollup/plugin-commonjs": "25.0.2",
|
|
34
|
+
"@rollup/plugin-node-resolve": "15.1.0",
|
|
35
35
|
"@types/cordova": "11.0.0",
|
|
36
|
-
"rollup": "3.
|
|
36
|
+
"rollup": "3.26.2",
|
|
37
37
|
"rollup-plugin-progress": "1.1.2",
|
|
38
|
-
"rollup-plugin-typescript2": "0.
|
|
38
|
+
"rollup-plugin-typescript2": "0.35.0",
|
|
39
39
|
"ts-node": "10.9.1",
|
|
40
|
-
"typescript": "5.
|
|
40
|
+
"typescript": "5.1.6"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"cordovaDependencies": {
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"tslib": "2.
|
|
50
|
+
"tslib": "2.6.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="@totalpave/cordova-plugin-insets" version="0.1.
|
|
2
|
+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="@totalpave/cordova-plugin-insets" version="0.1.8">
|
|
3
3
|
<name>cordova-plugin-insets</name>
|
|
4
4
|
<description>Cordova Android Plugin to receive native information regarding the unsafe area insets</description>
|
|
5
5
|
<author>Total Pave Inc.</author>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<repo>https://github.com/totalpaveinc/cordova-plugin-unsafe-insets</repo>
|
|
9
9
|
|
|
10
10
|
<js-module src="www/insets.js" name="Insets">
|
|
11
|
-
<
|
|
11
|
+
<merges target="totalpave" />
|
|
12
12
|
</js-module>
|
|
13
13
|
|
|
14
14
|
<platform name="android">
|
package/src/www/Insets.ts
CHANGED
|
@@ -46,6 +46,12 @@ export class Insets {
|
|
|
46
46
|
return this.initPromise;
|
|
47
47
|
}
|
|
48
48
|
this.initPromise = new Promise<void>((resolve, reject) => {
|
|
49
|
+
// no-op on iOS, still installs to iOS so apps don't need to do platform checks.
|
|
50
|
+
if (cordova.platformId === 'ios') {
|
|
51
|
+
resolve();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
// Setup promise resolving mechanism.
|
|
50
56
|
// We don't use the cordova callback functions as they will be called multiple times over the lifespan of an app.
|
|
51
57
|
let func = () => {
|
package/www/insets.js
CHANGED
|
@@ -28,6 +28,11 @@ class Insets {
|
|
|
28
28
|
return this.initPromise;
|
|
29
29
|
}
|
|
30
30
|
this.initPromise = new Promise((resolve, reject) => {
|
|
31
|
+
// no-op on iOS, still installs to iOS so apps don't need to do platform checks.
|
|
32
|
+
if (cordova.platformId === 'ios') {
|
|
33
|
+
resolve();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
31
36
|
// Setup promise resolving mechanism.
|
|
32
37
|
// We don't use the cordova callback functions as they will be called multiple times over the lifespan of an app.
|
|
33
38
|
let func = () => {
|
package/www/insets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insets.js","sources":["../src/www/Insets.ts"],"sourcesContent":["/*\n Copyright 2022 Total Pave Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nexport const SERVICE_NAME: string = \"Insets\";\n\nexport interface IInsets {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport type IInsetCallbackFunc = (inset: IInsets) => void;\n\nexport class Insets {\n private static initPromise: Promise<void>;\n private static listeners: Array<Function> = [];\n private static insets: IInsets = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n\n /**\n * Initializes javascript side of the plugin.\n * \n * This function is called automatically on deviceready.\n * @internal\n */\n public static __init(): Promise<void> {\n if (this.initPromise) {\n return this.initPromise;\n }\n this.initPromise = new Promise<void>((resolve, reject) => {\n // Setup promise resolving mechanism.\n // We don't use the cordova callback functions as they will be called multiple times over the lifespan of an app.\n let func = () => {\n resolve();\n Insets.removeListener(func);\n }\n Insets.addListener(func);\n\n // Setup cordova callback.\n cordova.exec(\n (insets: IInsets) => {\n Insets.insets = insets;\n for (let i = 0, listeners = Insets.listeners.slice(), length = listeners.length; i < length; ++i) {\n listeners[i](insets);\n }\n },\n reject,\n SERVICE_NAME,\n \"setListener\",\n []\n );\n });\n }\n\n public static addListener(callback: IInsetCallbackFunc) {\n this.listeners.push(callback);\n }\n\n public static removeListener(callback: IInsetCallbackFunc) {\n let index = this.listeners.indexOf(callback);\n if (index === -1) {\n return;\n }\n this.listeners.splice(index, 1);\n }\n\n /**\n * @returns Last emitted insets.\n */ \n public static getInsets(): IInsets {\n return Insets.insets;\n }\n};\n\ndocument.addEventListener('deviceready', function() {\n Insets.__init();\n});\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;AAcE;AAEK,MAAM,YAAY,GAAW,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"insets.js","sources":["../src/www/Insets.ts"],"sourcesContent":["/*\n Copyright 2022 Total Pave Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\nexport const SERVICE_NAME: string = \"Insets\";\n\nexport interface IInsets {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport type IInsetCallbackFunc = (inset: IInsets) => void;\n\nexport class Insets {\n private static initPromise: Promise<void>;\n private static listeners: Array<Function> = [];\n private static insets: IInsets = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n\n /**\n * Initializes javascript side of the plugin.\n * \n * This function is called automatically on deviceready.\n * @internal\n */\n public static __init(): Promise<void> {\n if (this.initPromise) {\n return this.initPromise;\n }\n this.initPromise = new Promise<void>((resolve, reject) => {\n // no-op on iOS, still installs to iOS so apps don't need to do platform checks.\n if (cordova.platformId === 'ios') {\n resolve();\n return;\n }\n\n // Setup promise resolving mechanism.\n // We don't use the cordova callback functions as they will be called multiple times over the lifespan of an app.\n let func = () => {\n resolve();\n Insets.removeListener(func);\n }\n Insets.addListener(func);\n\n // Setup cordova callback.\n cordova.exec(\n (insets: IInsets) => {\n Insets.insets = insets;\n for (let i = 0, listeners = Insets.listeners.slice(), length = listeners.length; i < length; ++i) {\n listeners[i](insets);\n }\n },\n reject,\n SERVICE_NAME,\n \"setListener\",\n []\n );\n });\n }\n\n public static addListener(callback: IInsetCallbackFunc) {\n this.listeners.push(callback);\n }\n\n public static removeListener(callback: IInsetCallbackFunc) {\n let index = this.listeners.indexOf(callback);\n if (index === -1) {\n return;\n }\n this.listeners.splice(index, 1);\n }\n\n /**\n * @returns Last emitted insets.\n */ \n public static getInsets(): IInsets {\n return Insets.insets;\n }\n};\n\ndocument.addEventListener('deviceready', function() {\n Insets.__init();\n});\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;AAcE;AAEK,MAAM,YAAY,GAAW,QAAQ,CAAC;MAWhC,MAAM,CAAA;AAUf;;;;;AAKG;AACI,IAAA,OAAO,MAAM,GAAA;QAChB,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,OAAO,IAAI,CAAC,WAAW,CAAC;AAC3B,SAAA;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EA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