Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@
"name": "@aossie-org/social-share-button",
"version": "1.0.4",
"description": "Lightweight social sharing component for web applications",
"main": "src/social-share-button.js",
"main": "./src/social-share-button.js",
"module": "./src/social-share-button.mjs",
"exports": {
".": {
"import": "./src/social-share-button.mjs",
"require": "./src/social-share-button.js",
"default": "./src/social-share-button.mjs"
},
"./analytics": {
"import": "./src/social-share-analytics.mjs",
"require": "./src/social-share-analytics.js",
"default": "./src/social-share-analytics.mjs"
},
"./react": "./src/social-share-button-react.jsx",
"./preact": "./src/social-share-button-preact.jsx",
"./qwik": "./src/social-share-button-qwik.tsx",
"./css": "./src/social-share-button.css",
"./src/*": "./src/*",
"./package.json": "./package.json"
},
"files": [
"src/package.json",
"src/social-share-button.js",
"src/social-share-button.mjs",
"src/social-share-button.css",
"src/social-share-button-react.jsx",
"src/social-share-button-preact.jsx",
"src/social-share-button-qwik.tsx",
"src/social-share-analytics.js",
"src/social-share-analytics.mjs",
"README.md",
"LICENSE"
],
Expand Down
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
18 changes: 18 additions & 0 deletions src/social-share-analytics.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* ES module entry point for the analytics adapters.
*
* social-share-analytics.js is also usable as a classic <script> tag, so it
* cannot contain `export` syntax. This file is the module entry instead.
*/
import adapters from "./social-share-analytics.js";

export default adapters;
export const {
SocialShareAnalyticsPlugin,
GoogleAnalyticsAdapter,
MixpanelAdapter,
SegmentAdapter,
PlausibleAdapter,
PostHogAdapter,
CustomAdapter,
} = adapters;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
11 changes: 11 additions & 0 deletions src/social-share-button.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* ES module entry point for SocialShareButton.
*
* social-share-button.js is also served directly to browsers as a classic
* <script> tag from the CDN, so it cannot contain `export` syntax. This file
* is the module entry instead, and simply re-exports the class from it.
*/
import SocialShareButton from "./social-share-button.js";

export default SocialShareButton;
export { SocialShareButton };
Loading