@aigens/aigens-sdk-core 0.1.2 → 0.4.1
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/AigensAigensSdkCore.podspec +1 -0
- package/README.md +28 -0
- package/android/build.gradle +8 -7
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +2 -0
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +98 -1
- package/dist/docs.json +69 -0
- package/dist/esm/definitions.d.ts +12 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +5 -1
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +2 -0
- package/ios/Plugin/CorePlugin.swift +68 -0
- package/ios/Plugin/WebContainerViewController.swift +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -26,6 +26,7 @@ npx cap sync
|
|
26
26
|
* [`getFinishData(...)`](#getfinishdata)
|
27
27
|
* [`setTextZoom(...)`](#settextzoom)
|
28
28
|
* [`readClipboard()`](#readclipboard)
|
29
|
+
* [`addCalender(...)`](#addcalender)
|
29
30
|
* [Interfaces](#interfaces)
|
30
31
|
* [Type Aliases](#type-aliases)
|
31
32
|
|
@@ -219,6 +220,21 @@ Promise<any>: { value: string, type: 'text/plain' }
|
|
219
220
|
--------------------
|
220
221
|
|
221
222
|
|
223
|
+
### addCalender(...)
|
224
|
+
|
225
|
+
```typescript
|
226
|
+
addCalender(options: CalendarOptions) => Promise<{ notPermission?: boolean; resultCode?: number; }>
|
227
|
+
```
|
228
|
+
|
229
|
+
| Param | Type |
|
230
|
+
| ------------- | ----------------------------------------------------------- |
|
231
|
+
| **`options`** | <code><a href="#calendaroptions">CalendarOptions</a></code> |
|
232
|
+
|
233
|
+
**Returns:** <code>Promise<{ notPermission?: boolean; resultCode?: number; }></code>
|
234
|
+
|
235
|
+
--------------------
|
236
|
+
|
237
|
+
|
222
238
|
### Interfaces
|
223
239
|
|
224
240
|
|
@@ -255,6 +271,18 @@ Promise<any>: { value: string, type: 'text/plain' }
|
|
255
271
|
| **`display`** | <code><a href="#permissionstate">PermissionState</a></code> |
|
256
272
|
|
257
273
|
|
274
|
+
#### CalendarOptions
|
275
|
+
|
276
|
+
| Prop | Type |
|
277
|
+
| --------------- | -------------------- |
|
278
|
+
| **`title`** | <code>string</code> |
|
279
|
+
| **`isAllDay`** | <code>boolean</code> |
|
280
|
+
| **`beginTime`** | <code>number</code> |
|
281
|
+
| **`endTime`** | <code>number</code> |
|
282
|
+
| **`location`** | <code>string</code> |
|
283
|
+
| **`notes`** | <code>string</code> |
|
284
|
+
|
285
|
+
|
258
286
|
### Type Aliases
|
259
287
|
|
260
288
|
|
package/android/build.gradle
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
ext {
|
2
|
-
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
6
|
+
|
6
7
|
}
|
7
8
|
|
8
9
|
buildscript {
|
@@ -11,7 +12,7 @@ buildscript {
|
|
11
12
|
jcenter()
|
12
13
|
}
|
13
14
|
dependencies {
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
15
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
15
16
|
}
|
16
17
|
}
|
17
18
|
|
@@ -36,8 +37,8 @@ android {
|
|
36
37
|
abortOnError false
|
37
38
|
}
|
38
39
|
compileOptions {
|
39
|
-
sourceCompatibility JavaVersion.
|
40
|
-
targetCompatibility JavaVersion.
|
40
|
+
sourceCompatibility JavaVersion.VERSION_11
|
41
|
+
targetCompatibility JavaVersion.VERSION_11
|
41
42
|
}
|
42
43
|
}
|
43
44
|
|
@@ -698,6 +698,8 @@ public class WebContainerActivity extends BridgeActivity {
|
|
698
698
|
} catch (android.content.ActivityNotFoundException e) {
|
699
699
|
Log.e(TAG, "Error sending sms " + url + ":" + e.toString());
|
700
700
|
}
|
701
|
+
}else if (CorePlugin.coreListener != null && CorePlugin.coreListener.isInterceptedUrl(url, view, activity)) {
|
702
|
+
return true;
|
701
703
|
}
|
702
704
|
return false;
|
703
705
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
package com.aigens.sdk.plugins;
|
2
2
|
|
3
|
+
import android.Manifest;
|
3
4
|
import android.app.Activity;
|
4
5
|
import android.content.ClipData;
|
5
6
|
import android.content.ClipDescription;
|
@@ -11,15 +12,22 @@ import android.content.pm.PackageManager;
|
|
11
12
|
import android.net.Uri;
|
12
13
|
import android.os.Handler;
|
13
14
|
import android.webkit.WebSettings;
|
15
|
+
import android.webkit.WebView;
|
16
|
+
|
17
|
+
import androidx.activity.result.ActivityResult;
|
14
18
|
import androidx.core.app.NotificationManagerCompat;
|
15
19
|
|
16
20
|
import com.aigens.sdk.WebContainerActivity;
|
17
21
|
import com.getcapacitor.JSArray;
|
18
22
|
import com.getcapacitor.JSObject;
|
23
|
+
import com.getcapacitor.PermissionState;
|
19
24
|
import com.getcapacitor.Plugin;
|
20
25
|
import com.getcapacitor.PluginCall;
|
21
26
|
import com.getcapacitor.PluginMethod;
|
27
|
+
import com.getcapacitor.annotation.ActivityCallback;
|
22
28
|
import com.getcapacitor.annotation.CapacitorPlugin;
|
29
|
+
import com.getcapacitor.annotation.Permission;
|
30
|
+
import com.getcapacitor.annotation.PermissionCallback;
|
23
31
|
|
24
32
|
import org.json.JSONException;
|
25
33
|
|
@@ -29,10 +37,21 @@ import java.util.Iterator;
|
|
29
37
|
import java.util.List;
|
30
38
|
import java.util.Locale;
|
31
39
|
import java.util.Map;
|
40
|
+
import java.util.TimeZone;
|
32
41
|
|
33
|
-
@CapacitorPlugin(
|
42
|
+
@CapacitorPlugin(
|
43
|
+
name = "Core",
|
44
|
+
permissions = {
|
45
|
+
@Permission(strings = { Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR }, alias = CorePlugin.CALENDAR_PERMISSION),
|
46
|
+
}
|
47
|
+
)
|
34
48
|
public class CorePlugin extends Plugin {
|
35
49
|
|
50
|
+
static final String CALENDAR_PERMISSION = "calendarPermission";
|
51
|
+
public interface CoreListener {
|
52
|
+
public boolean isInterceptedUrl(String url, WebView view, Activity activity);
|
53
|
+
}
|
54
|
+
static public CoreListener coreListener;
|
36
55
|
public static final int REQUEST_CODE_OPEN_URL = 100001;
|
37
56
|
|
38
57
|
public static boolean DEBUG = false;
|
@@ -318,6 +337,84 @@ public class CorePlugin extends Plugin {
|
|
318
337
|
call.resolve(object);
|
319
338
|
}
|
320
339
|
|
340
|
+
private void presentCalendar(PluginCall call) {
|
341
|
+
String title = call.getString("title");
|
342
|
+
Long beginTime = call.getLong("beginTime");
|
343
|
+
Long endTime = call.getLong("endTime");
|
344
|
+
String location = call.getString("location");
|
345
|
+
String notes = call.getString("notes");
|
346
|
+
|
347
|
+
boolean isAllDay = call.getBoolean("isAllDay", false);
|
348
|
+
if (title == null) {
|
349
|
+
call.reject("missing title");
|
350
|
+
return;
|
351
|
+
}
|
352
|
+
final Intent calIntent = new Intent(Intent.ACTION_EDIT).setType("vnd.android.cursor.item/event")
|
353
|
+
.putExtra("title", title).putExtra("hasAlarm", 1);
|
354
|
+
|
355
|
+
if (isAllDay) {
|
356
|
+
calIntent.putExtra("allDay", true);
|
357
|
+
if (beginTime != null) {
|
358
|
+
calIntent.putExtra("beginTime",
|
359
|
+
beginTime + TimeZone.getDefault().getOffset(beginTime));
|
360
|
+
}
|
361
|
+
if (endTime != null) {
|
362
|
+
calIntent.putExtra("endTime",
|
363
|
+
endTime + TimeZone.getDefault().getOffset(endTime));
|
364
|
+
}
|
365
|
+
calIntent.putExtra("eventTimezone", "TIMEZONE_UTC");
|
366
|
+
}else {
|
367
|
+
if (beginTime != null) {
|
368
|
+
calIntent.putExtra("beginTime", beginTime);
|
369
|
+
}
|
370
|
+
if (endTime != null) {
|
371
|
+
calIntent.putExtra("endTime",
|
372
|
+
endTime);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
if (location != null) {
|
376
|
+
calIntent.putExtra("eventLocation", location);
|
377
|
+
}
|
378
|
+
if (notes != null) {
|
379
|
+
calIntent.putExtra("description", notes);
|
380
|
+
}
|
381
|
+
|
382
|
+
startActivityForResult(call, calIntent, "presentCalendarResult");
|
383
|
+
|
384
|
+
}
|
385
|
+
|
386
|
+
@ActivityCallback
|
387
|
+
private void presentCalendarResult(PluginCall call, ActivityResult result) {
|
388
|
+
if (call == null) {
|
389
|
+
return;
|
390
|
+
}
|
391
|
+
JSObject ret = new JSObject();
|
392
|
+
ret.put("notPermission", false);
|
393
|
+
ret.put("resultCode", result.getResultCode());
|
394
|
+
call.resolve(ret);
|
395
|
+
// Do something with the result data
|
396
|
+
}
|
397
|
+
@PluginMethod()
|
398
|
+
public void addCalendar(PluginCall call) {
|
399
|
+
if (getPermissionState(CorePlugin.CALENDAR_PERMISSION) != PermissionState.GRANTED) {
|
400
|
+
requestPermissionForAlias(CorePlugin.CALENDAR_PERMISSION, call, "calendarPermsCallback");
|
401
|
+
} else {
|
402
|
+
presentCalendar(call);
|
403
|
+
}
|
404
|
+
}
|
405
|
+
|
406
|
+
@PermissionCallback
|
407
|
+
private void calendarPermsCallback(PluginCall call) {
|
408
|
+
if (getPermissionState(CorePlugin.CALENDAR_PERMISSION) == PermissionState.GRANTED) {
|
409
|
+
presentCalendar(call);
|
410
|
+
} else {
|
411
|
+
JSObject ret = new JSObject();
|
412
|
+
ret.put("notPermission", true);
|
413
|
+
call.resolve(ret);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
|
321
418
|
@PluginMethod
|
322
419
|
public void setTextZoom(PluginCall call) {
|
323
420
|
Float value = call.getFloat("value");
|
package/dist/docs.json
CHANGED
@@ -205,6 +205,24 @@
|
|
205
205
|
"docs": "Promise<any>: { value: string, type: 'text/plain' }",
|
206
206
|
"complexTypes": [],
|
207
207
|
"slug": "readclipboard"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"name": "addCalender",
|
211
|
+
"signature": "(options: CalendarOptions) => Promise<{ notPermission?: boolean; resultCode?: number; }>",
|
212
|
+
"parameters": [
|
213
|
+
{
|
214
|
+
"name": "options",
|
215
|
+
"docs": "",
|
216
|
+
"type": "CalendarOptions"
|
217
|
+
}
|
218
|
+
],
|
219
|
+
"returns": "Promise<{ notPermission?: boolean | undefined; resultCode?: number | undefined; }>",
|
220
|
+
"tags": [],
|
221
|
+
"docs": "",
|
222
|
+
"complexTypes": [
|
223
|
+
"CalendarOptions"
|
224
|
+
],
|
225
|
+
"slug": "addcalender"
|
208
226
|
}
|
209
227
|
],
|
210
228
|
"properties": []
|
@@ -343,6 +361,57 @@
|
|
343
361
|
"type": "PermissionState"
|
344
362
|
}
|
345
363
|
]
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"name": "CalendarOptions",
|
367
|
+
"slug": "calendaroptions",
|
368
|
+
"docs": "",
|
369
|
+
"tags": [],
|
370
|
+
"methods": [],
|
371
|
+
"properties": [
|
372
|
+
{
|
373
|
+
"name": "title",
|
374
|
+
"tags": [],
|
375
|
+
"docs": "",
|
376
|
+
"complexTypes": [],
|
377
|
+
"type": "string"
|
378
|
+
},
|
379
|
+
{
|
380
|
+
"name": "isAllDay",
|
381
|
+
"tags": [],
|
382
|
+
"docs": "",
|
383
|
+
"complexTypes": [],
|
384
|
+
"type": "boolean | undefined"
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"name": "beginTime",
|
388
|
+
"tags": [],
|
389
|
+
"docs": "",
|
390
|
+
"complexTypes": [],
|
391
|
+
"type": "number | undefined"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"name": "endTime",
|
395
|
+
"tags": [],
|
396
|
+
"docs": "",
|
397
|
+
"complexTypes": [],
|
398
|
+
"type": "number | undefined"
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"name": "location",
|
402
|
+
"tags": [],
|
403
|
+
"docs": "",
|
404
|
+
"complexTypes": [],
|
405
|
+
"type": "string | undefined"
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"name": "notes",
|
409
|
+
"tags": [],
|
410
|
+
"docs": "",
|
411
|
+
"complexTypes": [],
|
412
|
+
"type": "string | undefined"
|
413
|
+
}
|
414
|
+
]
|
346
415
|
}
|
347
416
|
],
|
348
417
|
"enums": [],
|
@@ -36,6 +36,18 @@ export interface CorePlugin {
|
|
36
36
|
* Promise<any>: { value: string, type: 'text/plain' }
|
37
37
|
*/
|
38
38
|
readClipboard(): Promise<any>;
|
39
|
+
addCalender(options: CalendarOptions): Promise<{
|
40
|
+
notPermission?: boolean;
|
41
|
+
resultCode?: number;
|
42
|
+
}>;
|
43
|
+
}
|
44
|
+
export interface CalendarOptions {
|
45
|
+
title: string;
|
46
|
+
isAllDay?: boolean;
|
47
|
+
beginTime?: number;
|
48
|
+
endTime?: number;
|
49
|
+
location?: string;
|
50
|
+
notes?: string;
|
39
51
|
}
|
40
52
|
export interface Member {
|
41
53
|
"memberCode"?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nexport interface CorePlugin {\n echo(options: any): Promise<any>;\n dismiss(options: any): Promise<any>;\n finish(options: any): Promise<any>;\n getMember(options: any): Promise<{ member: Member }>;\n getDeeplink(options: any): Promise<{ deeplink: Deeplink }>;\n openBrowser(options: any): Promise<any>;\n isInstalledApp(options: { key: string }): Promise<{ install: boolean }>;\n getIsProductionEnvironment(): Promise<{ isPrd: boolean }>;\n openExternalUrl(options: { url: string }): Promise<any>;\n checkNotificationPermissions(): Promise<PermissionStatus>;\n getFinishData(options: any): Promise<{closedData: any}>;\n /**\n *\n * @param value : 0 - 1\n */\n setTextZoom(options: { value: number }): Promise<any>;\n\n /**\n * Promise<any>: { value: string, type: 'text/plain' }\n */\n readClipboard(): Promise<any>;\n}\nexport interface Member {\n \"memberCode\"?: string;\n \"source\"?: string;\n \"sessionId\"?: string;\n \"pushId\"?: string;\n \"deviceId\": string;\n \"universalLink\"?: string;\n \"appleMerchantId\"?: string;\n \"cachedOrderContext\"?: boolean;\n \"name\"?: string;\n \"email\"?: string;\n \"phone\"?: string;\n}\nexport interface Deeplink {\n \"addItemId\"?: string;\n \"addDiscountCode\"?: string;\n \"addOfferId\"?: string;\n}\n\nexport interface PermissionStatus {\n display: PermissionState;\n}\n\n"]}
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nexport interface CorePlugin {\n echo(options: any): Promise<any>;\n dismiss(options: any): Promise<any>;\n finish(options: any): Promise<any>;\n getMember(options: any): Promise<{ member: Member }>;\n getDeeplink(options: any): Promise<{ deeplink: Deeplink }>;\n openBrowser(options: any): Promise<any>;\n isInstalledApp(options: { key: string }): Promise<{ install: boolean }>;\n getIsProductionEnvironment(): Promise<{ isPrd: boolean }>;\n openExternalUrl(options: { url: string }): Promise<any>;\n checkNotificationPermissions(): Promise<PermissionStatus>;\n getFinishData(options: any): Promise<{closedData: any}>;\n /**\n *\n * @param value : 0 - 1\n */\n setTextZoom(options: { value: number }): Promise<any>;\n\n /**\n * Promise<any>: { value: string, type: 'text/plain' }\n */\n readClipboard(): Promise<any>;\n\n addCalender(options: CalendarOptions): Promise<{notPermission?: boolean, resultCode?: number}>;\n}\nexport interface CalendarOptions {\n title: string,\n isAllDay?: boolean,\n beginTime?: number,\n endTime?: number,\n location?: string,\n notes?: string\n}\n\nexport interface Member {\n \"memberCode\"?: string;\n \"source\"?: string;\n \"sessionId\"?: string;\n \"pushId\"?: string;\n \"deviceId\": string;\n \"universalLink\"?: string;\n \"appleMerchantId\"?: string;\n \"cachedOrderContext\"?: boolean;\n \"name\"?: string;\n \"email\"?: string;\n \"phone\"?: string;\n}\nexport interface Deeplink {\n \"addItemId\"?: string;\n \"addDiscountCode\"?: string;\n \"addOfferId\"?: string;\n}\n\nexport interface PermissionStatus {\n display: PermissionState;\n}\n\n"]}
|
package/dist/esm/web.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
2
|
-
import type { CorePlugin, Deeplink, Member, PermissionStatus } from './definitions';
|
2
|
+
import type { CalendarOptions, CorePlugin, Deeplink, Member, PermissionStatus } from './definitions';
|
3
3
|
export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
4
4
|
echo(options: any): Promise<any>;
|
5
5
|
getMember(options: any): Promise<{
|
@@ -30,4 +30,8 @@ export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
|
30
30
|
value: number;
|
31
31
|
}): Promise<any>;
|
32
32
|
readClipboard(): Promise<any>;
|
33
|
+
addCalender(options: CalendarOptions): Promise<{
|
34
|
+
notPermission?: boolean;
|
35
|
+
resultCode?: number;
|
36
|
+
}>;
|
33
37
|
}
|
package/dist/esm/web.js
CHANGED
@@ -70,5 +70,9 @@ export class CoreWeb extends WebPlugin {
|
|
70
70
|
const text = await navigator.clipboard.readText();
|
71
71
|
return { value: text, type: 'text/plain' };
|
72
72
|
}
|
73
|
+
async addCalender(options) {
|
74
|
+
options;
|
75
|
+
return { notPermission: true };
|
76
|
+
}
|
73
77
|
}
|
74
78
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAClC,KAAK,CAAC,IAAI,CAAC,OAAY;QACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAY;;QACxB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,MAAM,GAAG,MAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,MAAM,CAAC;QAC1C,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAAY;;QAC1B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,QAAQ,GAAG,MAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,QAAQ,CAAC;QAC9C,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAY;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KA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AC,SAAS,CAAC,SAAS;YACpB,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAC/B;YACE,MAAM,IAAI,CAAC,WAAW,CAClB,sDAAsD,CACzD,CAAC;SACL;QAED,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC/C,CAAC;CAEJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { CorePlugin, Deeplink, Member, PermissionStatus } from './definitions';\n\n\nexport class CoreWeb extends WebPlugin implements CorePlugin {\n async echo(options: any): Promise<any> {\n console.log('ECHO', options);\n return options;\n }\n\n async getMember(options: any): Promise<{ member: Member }> {\n console.log('GET MEMBER', options);\n var result = {} as any;\n var w = window as any;\n result.member = w.aigens?.context?.member;\n return result;\n }\n async getDeeplink(options: any): Promise<{ deeplink: Deeplink }> {\n console.log('GET Deeplink', options);\n var result = {} as any;\n var w = window as any;\n result.deeplink = w.aigens?.context?.deeplink;\n return result;\n }\n\n async dismiss(options: any): Promise<any> {\n console.log('DISMISS', options);\n return options;\n }\n\n async finish(options: any): Promise<any> {\n console.log('FINISH', options);\n return options;\n }\n\n async openBrowser(options: any): Promise<any> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async isInstalledApp(options: { key: string }): Promise<{ install: boolean }> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async openExternalUrl(options: { url: string }): Promise<any> {\n window.open(options.url, \"_blank\");\n return {\n open: true\n }\n }\n\n async getIsProductionEnvironment(): Promise<{ isPrd: boolean }> {\n return { isPrd: true };\n }\n\n async checkNotificationPermissions(): Promise<PermissionStatus> {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n\n async getFinishData(options: any): Promise<{ closedData: any }> {\n return { closedData: options }\n }\n\n async setTextZoom(options: { value: number }): Promise<any> {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n } catch (error) {\n }\n }\n return options;\n }\n\n async readClipboard(): Promise<any> {\n if (\n typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText\n ) {\n throw this.unavailable(\n 'Reading from clipboard not supported in this browser',\n );\n }\n\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n\n}\n"]}
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAClC,KAAK,CAAC,IAAI,CAAC,OAAY;QACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAY;;QACxB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,MAAM,GAAG,MAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,MAAM,CAAC;QAC1C,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAAY;;QAC1B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,QAAQ,GAAG,MAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,QAAQ,CAAC;QAC9C,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAY;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,O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KAAK,CAAC,aAAa;QACf,IACI,OAAO,SAAS,KAAK,WAAW;YAChC,CAAC,SAAS,CAAC,SAAS;YACpB,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAC/B;YACE,MAAM,IAAI,CAAC,WAAW,CAClB,sDAAsD,CACzD,CAAC;SACL;QAED,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAwB;QACtC,OAAO,CAAA;QACP,OAAO,EAAC,aAAa,EAAE,IAAI,EAAC,CAAA;IAChC,CAAC;CAEJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { CalendarOptions, CorePlugin, Deeplink, Member, PermissionStatus } from './definitions';\n\n\nexport class CoreWeb extends WebPlugin implements CorePlugin {\n async echo(options: any): Promise<any> {\n console.log('ECHO', options);\n return options;\n }\n\n async getMember(options: any): Promise<{ member: Member }> {\n console.log('GET MEMBER', options);\n var result = {} as any;\n var w = window as any;\n result.member = w.aigens?.context?.member;\n return result;\n }\n async getDeeplink(options: any): Promise<{ deeplink: Deeplink }> {\n console.log('GET Deeplink', options);\n var result = {} as any;\n var w = window as any;\n result.deeplink = w.aigens?.context?.deeplink;\n return result;\n }\n\n async dismiss(options: any): Promise<any> {\n console.log('DISMISS', options);\n return options;\n }\n\n async finish(options: any): Promise<any> {\n console.log('FINISH', options);\n return options;\n }\n\n async openBrowser(options: any): Promise<any> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async isInstalledApp(options: { key: string }): Promise<{ install: boolean }> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async openExternalUrl(options: { url: string }): Promise<any> {\n window.open(options.url, \"_blank\");\n return {\n open: true\n }\n }\n\n async getIsProductionEnvironment(): Promise<{ isPrd: boolean }> {\n return { isPrd: true };\n }\n\n async checkNotificationPermissions(): Promise<PermissionStatus> {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n\n async getFinishData(options: any): Promise<{ closedData: any }> {\n return { closedData: options }\n }\n\n async setTextZoom(options: { value: number }): Promise<any> {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n } catch (error) {\n }\n }\n return options;\n }\n\n async readClipboard(): Promise<any> {\n if (\n typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText\n ) {\n throw this.unavailable(\n 'Reading from clipboard not supported in this browser',\n );\n }\n\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n\n async addCalender(options: CalendarOptions): Promise<{notPermission?: boolean, resultCode?: number}> {\n options\n return {notPermission: true}\n }\n\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
@@ -79,6 +79,9 @@ class CoreWeb extends core.WebPlugin {
|
|
79
79
|
const text = await navigator.clipboard.readText();
|
80
80
|
return { value: text, type: 'text/plain' };
|
81
81
|
}
|
82
|
+
async addCalender(options) {
|
83
|
+
return { notPermission: true };
|
84
|
+
}
|
82
85
|
}
|
83
86
|
|
84
87
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,SAAS,CAAC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G,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACjG,aAAa;AACb,YAAY,OAAO,KAAK,EAAE;AAC1B,aAAa;AACb,SAAS;AACT,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW;AAC5C,YAAY,CAAC,SAAS,CAAC,SAAS;AAChC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;AAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;AAC3F,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACnD,KAAK;AACL;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalender(options) {\n options;\n return { notPermission: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC3C,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;AACxB,QAAQ,IAAI,CAAC,GAAG,MAAM,CA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AK,WAAW;AAC5C,YAAY,CAAC,SAAS,CAAC,SAAS;AAChC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;AAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;AAC3F,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
@@ -76,6 +76,9 @@ var capacitorCore = (function (exports, core) {
|
|
76
76
|
const text = await navigator.clipboard.readText();
|
77
77
|
return { value: text, type: 'text/plain' };
|
78
78
|
}
|
79
|
+
async addCalender(options) {
|
80
|
+
return { notPermission: true };
|
81
|
+
}
|
79
82
|
}
|
80
83
|
|
81
84
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IAC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,OAAO,KAAK,EAAE;IAC1B,aAAa;IACb,SAAS;IACT,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW;IAC5C,YAAY,CAAC,SAAS,CAAC,SAAS;IAChC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;IAC3F,SAAS;IACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACnD,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalender(options) {\n options;\n return { notPermission: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;IACxB,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC;IACvB,QAAQ,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,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CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;IAC3F,SAAS;IACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACvC,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/CorePlugin.m
CHANGED
@@ -17,5 +17,7 @@ CAP_PLUGIN(CorePlugin, "Core",
|
|
17
17
|
CAP_PLUGIN_METHOD(getFinishData, CAPPluginReturnPromise);
|
18
18
|
CAP_PLUGIN_METHOD(setTextZoom, CAPPluginReturnPromise);
|
19
19
|
CAP_PLUGIN_METHOD(readClipboard, CAPPluginReturnPromise);
|
20
|
+
CAP_PLUGIN_METHOD(addCalendar, CAPPluginReturnPromise);
|
21
|
+
|
20
22
|
|
21
23
|
)
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import Foundation
|
2
2
|
import Capacitor
|
3
3
|
import UIKit
|
4
|
+
import EventKitUI
|
4
5
|
|
6
|
+
@objc public protocol CoreDelegate: AnyObject {
|
7
|
+
func isInterceptedUrl(url: URL, webview: WKWebView) -> Bool
|
8
|
+
}
|
5
9
|
|
6
10
|
var aigensDebug = false;
|
7
11
|
/**
|
@@ -11,6 +15,8 @@ var aigensDebug = false;
|
|
11
15
|
@objc(CorePlugin)
|
12
16
|
public class CorePlugin: CAPPlugin {
|
13
17
|
|
18
|
+
static public var coreDelegate: CoreDelegate?
|
19
|
+
|
14
20
|
public static let shared = CorePlugin()
|
15
21
|
private let implementation = Core()
|
16
22
|
public static var member: Dictionary<String, Any>?
|
@@ -268,6 +274,61 @@ public class CorePlugin: CAPPlugin {
|
|
268
274
|
}
|
269
275
|
}
|
270
276
|
|
277
|
+
private func showNewEvent(_ askPermission: Bool, _ call: CAPPluginCall) {
|
278
|
+
let store = EKEventStore()
|
279
|
+
if askPermission {
|
280
|
+
store.requestAccess(to: .event) { (granted, error) in
|
281
|
+
if granted {
|
282
|
+
DispatchQueue.main.async {
|
283
|
+
self.showNewEvent(false, call)
|
284
|
+
}
|
285
|
+
}else {
|
286
|
+
call.resolve(["notPermission": true])
|
287
|
+
}
|
288
|
+
}
|
289
|
+
return
|
290
|
+
}
|
291
|
+
|
292
|
+
let event = EKEvent(eventStore: store)
|
293
|
+
let title = call.getString("title", "")
|
294
|
+
if title == "" {
|
295
|
+
call.reject("missing title")
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
event.title = title
|
299
|
+
if let notes = call.getString("notes") {
|
300
|
+
event.notes = notes;
|
301
|
+
}
|
302
|
+
if let location = call.getString("location") {
|
303
|
+
event.location = location
|
304
|
+
}
|
305
|
+
let isAllDay = call.getBool("isAllDay", false)
|
306
|
+
event.isAllDay = isAllDay
|
307
|
+
// event.availability = .busy
|
308
|
+
// event.structuredLocation = ...
|
309
|
+
if let beginTime = call.getDouble("beginTime") {
|
310
|
+
event.startDate = Date(timeIntervalSince1970: beginTime / 1000)
|
311
|
+
}
|
312
|
+
|
313
|
+
if let endTime = call.getDouble("endTime") {
|
314
|
+
event.endDate = Date(timeIntervalSince1970: endTime / 1000)
|
315
|
+
}
|
316
|
+
|
317
|
+
|
318
|
+
let vc = EKEventEditViewController()
|
319
|
+
vc.event = event
|
320
|
+
vc.eventStore = store // <-- this needs to be the same event store you used for EKEvent
|
321
|
+
vc.editViewDelegate = self
|
322
|
+
self.bridge?.viewController?.present(vc, animated: true, completion: nil)
|
323
|
+
|
324
|
+
call.resolve(["notPermission": false, "resultCode": 0])
|
325
|
+
|
326
|
+
}
|
327
|
+
|
328
|
+
@objc func addCalendar(_ call: CAPPluginCall) {
|
329
|
+
showNewEvent(true, call)
|
330
|
+
}
|
331
|
+
|
271
332
|
@objc func setTextZoom(_ call: CAPPluginCall) {
|
272
333
|
call.unimplemented("ios does not implement.")
|
273
334
|
}
|
@@ -331,3 +392,10 @@ func aigensprint<T>(_ message:T,file:String = #file,_ funcName:String = #functio
|
|
331
392
|
}
|
332
393
|
|
333
394
|
}
|
395
|
+
|
396
|
+
|
397
|
+
extension CorePlugin: EKEventEditViewDelegate {
|
398
|
+
public func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) {
|
399
|
+
controller.dismiss(animated: true)
|
400
|
+
}
|
401
|
+
}
|
@@ -372,6 +372,13 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
372
372
|
return
|
373
373
|
}
|
374
374
|
|
375
|
+
if let del = CorePlugin.coreDelegate {
|
376
|
+
if del.isInterceptedUrl(url: navURL, webview: webView) {
|
377
|
+
decisionHandler(.cancel)
|
378
|
+
return
|
379
|
+
}
|
380
|
+
}
|
381
|
+
|
375
382
|
aigensprint("navURL--:\(navURL)")
|
376
383
|
if !universalLink.isEmpty && (navURL.absoluteString.starts(with: universalLink) || universalLink.contains("aigens=true") || universalLink.contains("aigens/true")) {
|
377
384
|
|