{"_id":"emdash-social-sharing","_rev":"3-c29d7b7bb360d983f02da73017574dec","name":"emdash-social-sharing","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"emdash-social-sharing","version":"0.1.0","keywords":["emdash","emdash-plugin","cms","plugin","social-sharing","sharing","portable-text","astro"],"author":{"name":"Mason James"},"license":"MIT","_id":"emdash-social-sharing@0.1.0","maintainers":[{"name":"masonjames","email":"masonjames@gmail.com"}],"homepage":"https://github.com/masonjames/emdash-social-sharing#readme","bugs":{"url":"https://github.com/masonjames/emdash-social-sharing/issues"},"dist":{"shasum":"63fa513a36a423814ca7206d8790b3169f0e0c10","tarball":"https://registry.npmjs.org/emdash-social-sharing/-/emdash-social-sharing-0.1.0.tgz","fileCount":17,"integrity":"sha512-QVmidwM14xIKL7i/PdiQaMxj71d0Aux0L0wNnFzhvTJicQrWCRUli76J9ZN0UrbxW0kLeam/UJKNmBzqxTutuQ==","signatures":[{"sig":"MEYCIQDpsWw/sz+/bnLSdDeqtLGt1X16PQhoSsmzyrhxbW/KggIhAOZ+LLVa/UrPGP1X/BX+yfGK9UVaa5roYoIYUV9eKmZ6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45157},"main":"src/index.ts","type":"module","types":"src/index.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./astro":{"types":"./src/astro/index.ts","default":"./src/astro/index.ts"},"./plugin":{"types":"./src/plugin.ts","default":"./src/plugin.ts"}},"gitHead":"601227abc64259c60d20d440c88e83d41ee2bb17","scripts":{"test":"vitest run","check":"pnpm typecheck && pnpm test","typecheck":"astro check && tsc --noEmit","pack:check":"npm pack --dry-run","test:watch":"vitest","prepublishOnly":"pnpm check"},"_npmUser":{"name":"masonjames","email":"masonjames@gmail.com"},"repository":{"url":"git+https://github.com/masonjames/emdash-social-sharing.git","type":"git"},"_npmVersion":"11.11.1","description":"Privacy-light social sharing controls for EmDash content and themes","directories":{},"_nodeVersion":"25.8.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"astro":"^6.0.0-beta.0","emdash":"^0.1.0","vitest":"^4.0.0","typescript":"^5.8.3","@types/node":"^22.15.17","@astrojs/check":"^0.9.8"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-social-sharing_0.1.0_1775182914532_0.4561986730807621","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"emdash-social-sharing","version":"0.1.1","keywords":["emdash","emdash-plugin","cms","plugin","social-sharing","sharing","portable-text","astro"],"author":{"name":"Mason James"},"license":"MIT","_id":"emdash-social-sharing@0.1.1","maintainers":[{"name":"masonjames","email":"masonjames@gmail.com"}],"homepage":"https://github.com/masonjames/emdash-social-sharing#readme","bugs":{"url":"https://github.com/masonjames/emdash-social-sharing/issues"},"dist":{"shasum":"abe669de40303f6258eaaca9ac65e825edc3f104","tarball":"https://registry.npmjs.org/emdash-social-sharing/-/emdash-social-sharing-0.1.1.tgz","fileCount":17,"integrity":"sha512-vGRAG3O6/K3+tICyvVfVR687iM/HWznVtWCjUyfDm7EWpr1gIQQiWhOVOB2/Zl3cta11TSQE4DCR5EOYI3RaEg==","signatures":[{"sig":"MEQCIFE7+Mhyhc0rlazZXzD6D3qBH2Zn+27HzZO+IAbxEv/cAiBsrp7yjaAyHq8crm3nfiBFm5eRYJVQv0vjqOH20tEkuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/emdash-social-sharing@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45157},"main":"src/index.ts","type":"module","types":"src/index.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./astro":{"types":"./src/astro/index.ts","default":"./src/astro/index.ts"},"./plugin":{"types":"./src/plugin.ts","default":"./src/plugin.ts"}},"gitHead":"cea9227eb73cc75aefaeb3201fbb90608d3c8479","scripts":{"test":"vitest run","check":"pnpm typecheck && pnpm test","typecheck":"astro check && tsc --noEmit","pack:check":"npm pack --dry-run","test:watch":"vitest","prepublishOnly":"pnpm check"},"_npmUser":{"name":"masonjames","email":"masonjames@gmail.com"},"repository":{"url":"git+https://github.com/masonjames/emdash-social-sharing.git","type":"git"},"_npmVersion":"10.9.4","description":"Privacy-light social sharing controls for EmDash content and themes","directories":{},"_nodeVersion":"22.22.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"astro":"^6.0.0-beta.0","emdash":"^0.1.0","vitest":"^4.0.0","typescript":"^5.8.3","@types/node":"^22.15.17","@astrojs/check":"^0.9.8"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-social-sharing_0.1.1_1775184320400_0.6414667066057069","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"emdash-social-sharing","version":"0.1.2","description":"Privacy-light social sharing controls for EmDash content and themes","type":"module","packageManager":"pnpm@10.33.0","main":"src/index.ts","types":"src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./plugin":{"types":"./src/plugin.ts","default":"./src/plugin.ts"},"./astro":{"types":"./src/astro/index.ts","default":"./src/astro/index.ts"},"./core":{"types":"./src/core/index.ts","default":"./src/core/index.ts"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"plugin":{"id":"social-sharing"},"keywords":["emdash","emdash-plugin","cms","plugin","social-sharing","sharing","portable-text","astro"],"author":{"name":"Mason James"},"license":"MIT","homepage":"https://github.com/masonjames/emdash-social-sharing#readme","bugs":{"url":"https://github.com/masonjames/emdash-social-sharing/issues"},"repository":{"type":"git","url":"git+https://github.com/masonjames/emdash-social-sharing.git"},"engines":{"node":">=20.0.0"},"scripts":{"test":"pnpm test:native","test:native":"vitest run","test:watch":"vitest","typecheck":"pnpm typecheck:native","typecheck:native":"astro check && tsc --noEmit","check:native":"pnpm typecheck:native && pnpm test:native","check:marketplace":"pnpm --dir marketplace check","check":"pnpm check:native && pnpm check:marketplace","pack:check":"npm pack --dry-run","prepublishOnly":"pnpm check:native"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.1.0"},"devDependencies":{"@astrojs/check":"^0.9.8","@types/node":"^22.15.17","astro":"^6.0.0-beta.0","emdash":"^0.1.0","tsdown":"0.20.3","typescript":"^5.8.3","vitest":"^4.0.0"},"gitHead":"a79292300c0b7d046c447877ab2a4e2bd69bd859","_id":"emdash-social-sharing@0.1.2","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-G+w7YfTKvBBLeQ48nUzPOCNK05DfA82ZHq2Il3ehzn2YZC+jJ6BiDYkJhdHcKvxO64fHcGwk4dPbIYzucNEhvA==","shasum":"8ba5e8254b85af93ad1148caeef8986e7a45a6be","tarball":"https://registry.npmjs.org/emdash-social-sharing/-/emdash-social-sharing-0.1.2.tgz","fileCount":18,"unpackedSize":48440,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDnJzIBOWsPPs8AxVtERDKcwLF/DLEOPKv2hxnyWBqxeAIhANUGCP4a8CW6YiOh79l2433ok/UFwW14Vxp5tovlkomL"}]},"_npmUser":{"name":"masonjames","email":"masonjames@gmail.com"},"directories":{},"maintainers":[{"name":"masonjames","email":"masonjames@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-social-sharing_0.1.2_1776108930215_0.9372737057611695"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-03T02:21:54.444Z","modified":"2026-04-13T19:35:30.499Z","0.1.0":"2026-04-03T02:21:54.690Z","0.1.1":"2026-04-03T02:45:20.551Z","0.1.2":"2026-04-13T19:35:30.347Z"},"bugs":{"url":"https://github.com/masonjames/emdash-social-sharing/issues"},"author":{"name":"Mason James"},"license":"MIT","homepage":"https://github.com/masonjames/emdash-social-sharing#readme","keywords":["emdash","emdash-plugin","cms","plugin","social-sharing","sharing","portable-text","astro"],"repository":{"type":"git","url":"git+https://github.com/masonjames/emdash-social-sharing.git"},"description":"Privacy-light social sharing controls for EmDash content and themes","maintainers":[{"name":"masonjames","email":"masonjames@gmail.com"}],"readme":"# emdash-social-sharing\n\nPrivacy-light social sharing for EmDash.\n\nThis plugin gives you:\n\n- an installable `socialShare` Portable Text block,\n- a reusable Astro component for theme templates,\n- sitewide share settings in the EmDash admin,\n- server-built share URLs with no third-party SDKs,\n- a progressively enhanced copy-link action that still works without JavaScript.\n\n## Status\n\n`emdash-social-sharing` is the **trusted / native** package for this plugin family.\n\nThat means:\n\n- install it in `plugins: []`,\n- do **not** install it in `sandboxed: []`,\n- it is the package you install from npm,\n- it remains named exactly `emdash-social-sharing`,\n- it provides the full feature set: admin settings, Astro rendering, and the `socialShare` Portable Text block.\n\nThis repository now also includes a separate **marketplace-safe companion** under `marketplace/`.\n\nThat companion:\n\n- is standard / sandboxed,\n- is bundleable with `emdash plugin bundle` / `emdash plugin publish`,\n- manages sitewide defaults through Block Kit,\n- does **not** provide Portable Text block registration or site-side Astro rendering.\n\n## Install Modes\n\n### 1. Trusted full plugin\n\n```bash\npnpm add emdash-social-sharing\n```\n\nRegister it in `astro.config.mjs`:\n\n```js\nimport { defineConfig } from \"astro/config\";\nimport { emdash } from \"emdash/astro\";\nimport { socialSharingPlugin } from \"emdash-social-sharing\";\n\nexport default defineConfig({\n\tintegrations: [\n\t\temdash({\n\t\t\tplugins: [socialSharingPlugin()],\n\t\t}),\n\t],\n});\n```\n\nSave that in `astro.config.mjs`.\n\n### 2. Marketplace companion\n\nThe marketplace-safe companion lives in `marketplace/` in this repository. It is a separate standard-format plugin source package used to produce a marketplace tarball.\n\nUse the marketplace companion when you want:\n\n- admin-installable settings management, and\n- sandboxed execution through the EmDash marketplace.\n\nUse the trusted npm package when you want:\n\n- the `socialShare` Portable Text block,\n- direct Astro rendering via `emdash-social-sharing/astro`, or\n- full parity with the current trusted plugin.\n\n### 3. Hybrid mode\n\nHybrid mode is supported:\n\n- install the marketplace companion for admin-managed defaults, and\n- import `SocialShare` from `emdash-social-sharing/astro` in your theme.\n\nDo **not** enable both runtimes at the same time. Use either:\n\n- the trusted runtime, or\n- the marketplace runtime,\n\nbut not both.\n\n## Theme usage\n\n```astro\n---\nimport { SocialShare } from \"emdash-social-sharing/astro\";\n\nconst canonicalUrl = post.seo?.canonicalUrl ?? Astro.url.href;\nconst shareTitle = post.title;\n---\n\n<SocialShare canonicalUrl={canonicalUrl} title={shareTitle} />\n```\n\n### Helpful props\n\n- `canonicalUrl` – preferred share URL when you have a canonical URL available\n- `url` – explicit share URL fallback\n- `title` – share title for X, Bluesky, and email targets\n- `variant` – `\"text\" | \"button-row\" | \"icon-label\"`\n- `density` – `\"default\" | \"compact\"`\n- `alignment` – `\"start\" | \"center\" | \"end\"`\n- `openInNewTab` – override the sitewide new-tab setting\n- `enabledActions` – explicit action override, e.g. `['x', 'linkedin', 'copy']`\n- `publisherHandles` – optional per-render handle overrides\n\nIf you omit `title`, the component still works. Direct usage can pass explicit share copy, and rendered blocks fall back to the current document title in the browser when needed.\n\n## Portable Text block\n\nOnce the plugin is enabled, editors can insert **Social Share** from the slash menu in any Portable Text field.\n\nThe block supports:\n\n- title override,\n- show-only / hide-selected network overrides,\n- variant override,\n- compact density,\n- alignment control.\n\nThe block uses the current page URL automatically. If you want custom share copy, use the title override field; otherwise the component will use the page title when it can.\n\n## Admin settings\n\nThe plugin ships sitewide defaults for:\n\n- X enabled\n- LinkedIn enabled\n- Bluesky enabled\n- email share enabled\n- copy-link enabled\n- default style variant\n- open links in a new tab\n- optional publisher handles for X and Bluesky\n\nThese settings are read at render time, so both theme components and PT blocks inherit them unless a local override is provided.\n\n## Supported actions\n\n- X / Twitter-style share intent\n- LinkedIn offsite share\n- Bluesky compose intent\n- email share\n- copy link\n\n## Style variants\n\n- `text`\n- `button-row`\n- `icon-label`\n\n## Privacy story\n\nThis plugin intentionally avoids the usual social-plugin baggage:\n\n- no third-party JavaScript SDKs,\n- no share counts,\n- no analytics pixels,\n- no tracking storage,\n- no automatic article-body injection,\n- no plugin routes or plugin storage for v1.\n\nThe only enhancement script is the small copy-link helper. Without JavaScript, readers still get a manual copy panel.\n\n## Notes\n\n- Because this is a render-layer plugin, changing sitewide settings on a fully static site still requires a rebuild/redeploy before the public HTML updates.\n- For the most precise share text, pass `title` from your theme template when you use the component directly.\n\n## Publishing\n\nThis repo now ships two release paths:\n\n### Trusted npm package\n\n- the root package is published to npm as `emdash-social-sharing`\n- CI runs `pnpm check` and `npm pack --dry-run`\n- the npm publish workflow runs on `v*.*.*` tags and `workflow_dispatch`\n- tag releases must match `package.json` exactly\n- the publish job uses npm provenance (`npm publish --provenance`)\n\n### Marketplace companion\n\n- the companion source package lives in `marketplace/`\n- validation runs through `pnpm --dir marketplace check`\n- marketplace bundle validation runs `emdash plugin bundle --dir marketplace --validateOnly`\n- this is the path to use before `emdash plugin publish` for the marketplace artifact\n\n## Marketplace compatibility\n\nCurrent EmDash marketplace publishing is for **standard / sandboxed** plugins bundled with `emdash plugin bundle` / `emdash plugin publish`.\n\nThe root `emdash-social-sharing` package is intentionally a **native / trusted** plugin because it depends on:\n\n- `admin.portableTextBlocks`, and\n- `componentsEntry` for site-side Astro block rendering.\n\nThat root npm package is therefore **not** itself marketplace-bundleable.\n\nTo support marketplace installation, this repository now includes a separate standard-format companion in `marketplace/` that:\n\n- reuses the same settings contract,\n- exposes a Block Kit settings page and dashboard widget,\n- validates with `emdash plugin bundle --validateOnly`, and\n- is the correct source package for `emdash plugin publish`.\n\nFeature parity remains intentionally split under current EmDash rules:\n\n- trusted package: full parity, including PT blocks and Astro rendering\n- marketplace companion: settings management only\n- hybrid mode: marketplace settings + direct Astro component import\n\n## Development\n\n```bash\npnpm install\npnpm test\npnpm typecheck\n```\n","readmeFilename":"README.md"}