@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.
@@ -31,16 +31,17 @@ public class SharePlugin extends Plugin {
31
31
 
32
32
  @Override
33
33
  public void load() {
34
- broadcastReceiver = new BroadcastReceiver() {
35
- @Override
36
- public void onReceive(Context context, Intent intent) {
37
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
38
- chosenComponent = intent.getParcelableExtra(Intent.EXTRA_CHOSEN_COMPONENT, ComponentName.class);
39
- } else {
40
- chosenComponent = getParcelableExtraLegacy(intent, Intent.EXTRA_CHOSEN_COMPONENT);
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((m) => new m.ShareWeb()),
3
+ web: () => import('./web').then(m => new m.ShareWeb()),
4
4
  });
5
5
  export * from './definitions';
6
6
  export { Share };
@@ -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,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACzD,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"]}
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"]}
@@ -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,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,QAAQ;QACZ,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;YACxD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SACzB;aAAM;YACL,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;SACxB;IACH,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;YACxD,MAAM,IAAI,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC;SACnE;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 { CanShareResult, ShareOptions, SharePlugin, ShareResult } 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"]}
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"]}
@@ -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((m) => new m.ShareWeb()),
6
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ShareWeb()),
7
7
  });
8
8
 
9
9
  class ShareWeb extends core.WebPlugin {
@@ -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((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,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5D,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;;;;;;;;;"}
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((m) => new m.ShareWeb()),
5
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ShareWeb()),
6
6
  });
7
7
 
8
8
  class ShareWeb extends core.WebPlugin {
@@ -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((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,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,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;;;;;;;;;;;;;;;"}
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-2444-20251112T191749.0",
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}\" --plugin=prettier-plugin-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.2.2",
52
+ "@capacitor/docgen": "0.3.0",
53
53
  "@capacitor/ios": "next",
54
54
  "@ionic/eslint-config": "^0.4.0",
55
- "@ionic/prettier-config": "^4.0.0",
56
- "@ionic/swiftlint-config": "^1.1.2",
57
- "eslint": "^8.57.0",
58
- "prettier": "^3.6.2",
59
- "prettier-plugin-java": "^2.7.7",
60
- "rimraf": "^6.0.1",
61
- "rollup": "^4.26.0",
62
- "swiftlint": "^1.0.1",
63
- "typescript": "~4.1.5"
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"