@capacitor/share 8.0.0-dev-2444-20251112T191749.0 → 8.0.0-dev-2440-20251112T200157.0
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/android/src/main/java/com/capacitorjs/plugins/share/SharePlugin.java +10 -9
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +12 -12
|
@@ -31,16 +31,17 @@ public class SharePlugin extends Plugin {
|
|
|
31
31
|
|
|
32
32
|
@Override
|
|
33
33
|
public void load() {
|
|
34
|
-
broadcastReceiver =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
broadcastReceiver =
|
|
35
|
+
new BroadcastReceiver() {
|
|
36
|
+
@Override
|
|
37
|
+
public void onReceive(Context context, Intent intent) {
|
|
38
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
39
|
+
chosenComponent = intent.getParcelableExtra(Intent.EXTRA_CHOSEN_COMPONENT, ComponentName.class);
|
|
40
|
+
} else {
|
|
41
|
+
chosenComponent = getParcelableExtraLegacy(intent, Intent.EXTRA_CHOSEN_COMPONENT);
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
+
};
|
|
44
45
|
ContextCompat.registerReceiver(
|
|
45
46
|
getContext(),
|
|
46
47
|
broadcastReceiver,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const Share = registerPlugin('Share', {
|
|
3
|
-
web: () => import('./web').then(
|
|
3
|
+
web: () => import('./web').then(m => new m.ShareWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export { Share };
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { SharePlugin } from './definitions';\n\nconst Share = registerPlugin<SharePlugin>('Share', {\n web: () => import('./web').then(m => new m.ShareWeb()),\n});\n\nexport * from './definitions';\nexport { Share };\n"]}
|
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;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,QAAQ;QACZ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACzD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACzD,MAAM,IAAI,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,SAAS,CAAC,KAAK,CAAC;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,GAAG,EAAE,OAAO,CAAC,GAAG;SACjB,CAAC,CAAC;QACH,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n CanShareResult,\n ShareOptions,\n SharePlugin,\n ShareResult,\n} from './definitions';\n\nexport class ShareWeb extends WebPlugin implements SharePlugin {\n async canShare(): Promise<CanShareResult> {\n if (typeof navigator === 'undefined' || !navigator.share) {\n return { value: false };\n } else {\n return { value: true };\n }\n }\n async share(options: ShareOptions): Promise<ShareResult> {\n if (typeof navigator === 'undefined' || !navigator.share) {\n throw this.unavailable('Share API not available in this browser');\n }\n\n await navigator.share({\n title: options.title,\n text: options.text,\n url: options.url,\n });\n return {};\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
5
|
const Share = core.registerPlugin('Share', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ShareWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class ShareWeb extends core.WebPlugin {
|
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 Share = registerPlugin('Share', {\n web: () => import('./web').then(
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Share = registerPlugin('Share', {\n web: () => import('./web').then(m => new m.ShareWeb()),\n});\nexport * from './definitions';\nexport { Share };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ShareWeb extends WebPlugin {\n async canShare() {\n if (typeof navigator === 'undefined' || !navigator.share) {\n return { value: false };\n }\n else {\n return { value: true };\n }\n }\n async share(options) {\n if (typeof navigator === 'undefined' || !navigator.share) {\n throw this.unavailable('Share API not available in this browser');\n }\n await navigator.share({\n title: options.title,\n text: options.text,\n url: options.url,\n });\n return {};\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;AACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1D,CAAC;;ACFM,MAAM,QAAQ,SAASC,cAAS,CAAC;AACxC,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AAClE,YAAY,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;AACnC,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;AAClC,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AAClE,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,yCAAyC,CAAC;AAC7E,QAAQ;AACR,QAAQ,MAAM,SAAS,CAAC,KAAK,CAAC;AAC9B,YAAY,KAAK,EAAE,OAAO,CAAC,KAAK;AAChC,YAAY,IAAI,EAAE,OAAO,CAAC,IAAI;AAC9B,YAAY,GAAG,EAAE,OAAO,CAAC,GAAG;AAC5B,SAAS,CAAC;AACV,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ var capacitorShare = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Share = core.registerPlugin('Share', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ShareWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class ShareWeb extends core.WebPlugin {
|
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 Share = registerPlugin('Share', {\n web: () => import('./web').then(
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Share = registerPlugin('Share', {\n web: () => import('./web').then(m => new m.ShareWeb()),\n});\nexport * from './definitions';\nexport { Share };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ShareWeb extends WebPlugin {\n async canShare() {\n if (typeof navigator === 'undefined' || !navigator.share) {\n return { value: false };\n }\n else {\n return { value: true };\n }\n }\n async share(options) {\n if (typeof navigator === 'undefined' || !navigator.share) {\n throw this.unavailable('Share API not available in this browser');\n }\n await navigator.share({\n title: options.title,\n text: options.text,\n url: options.url,\n });\n return {};\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;;ICFM,MAAM,QAAQ,SAASC,cAAS,CAAC;IACxC,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;IAClE,YAAY,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;IACnC,QAAQ;IACR,aAAa;IACb,YAAY,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;IAClC,QAAQ;IACR,IAAI;IACJ,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;IACzB,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;IAClE,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,yCAAyC,CAAC;IAC7E,QAAQ;IACR,QAAQ,MAAM,SAAS,CAAC,KAAK,CAAC;IAC9B,YAAY,KAAK,EAAE,OAAO,CAAC,KAAK;IAChC,YAAY,IAAI,EAAE,OAAO,CAAC,IAAI;IAC9B,YAAY,GAAG,EAAE,OAAO,CAAC,GAAG;IAC5B,SAAS,CAAC;IACV,QAAQ,OAAO,EAAE;IACjB,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/share",
|
|
3
|
-
"version": "8.0.0-dev-
|
|
3
|
+
"version": "8.0.0-dev-2440-20251112T200157.0",
|
|
4
4
|
"description": "The Share API provides methods for sharing content in any sharing-enabled apps the user may have installed.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
38
38
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
39
39
|
"eslint": "eslint . --ext ts",
|
|
40
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"
|
|
40
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api SharePlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
43
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@capacitor/android": "next",
|
|
51
51
|
"@capacitor/core": "next",
|
|
52
|
-
"@capacitor/docgen": "0.
|
|
52
|
+
"@capacitor/docgen": "0.3.0",
|
|
53
53
|
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
|
-
"@ionic/prettier-config": "
|
|
56
|
-
"@ionic/swiftlint-config": "^
|
|
57
|
-
"eslint": "^8.57.
|
|
58
|
-
"prettier": "
|
|
59
|
-
"prettier-plugin-java": "
|
|
60
|
-
"rimraf": "^6.0
|
|
61
|
-
"rollup": "^4.
|
|
62
|
-
"swiftlint": "^
|
|
63
|
-
"typescript": "
|
|
55
|
+
"@ionic/prettier-config": "~1.0.1",
|
|
56
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
57
|
+
"eslint": "^8.57.1",
|
|
58
|
+
"prettier": "~2.3.0",
|
|
59
|
+
"prettier-plugin-java": "~1.0.2",
|
|
60
|
+
"rimraf": "^6.1.0",
|
|
61
|
+
"rollup": "^4.53.2",
|
|
62
|
+
"swiftlint": "^2.0.0",
|
|
63
|
+
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@capacitor/core": "next"
|