@braglyio/emdash-widgets
v0.1.0
Published
Bragly review widgets for EmDash: a Bragly Widget editor block and a site-wide floating widget.
Readme
@braglyio/emdash-widgets
Native EmDash plugin that displays Bragly widgets on public pages. Pair with the Bragly Reviews registry plugin (../bragly) for account connection, widget IDs, and review stars.
Install
pnpm add @braglyio/emdash-widgets// astro.config.mjs
import { braglyWidgets } from "@braglyio/emdash-widgets";
export default defineConfig({
integrations: [emdash({ plugins: [braglyWidgets()] })],
});Features
- Bragly Widget block: type
/Bragly Widgetin the editor and paste a widget ID. A Bragly widget URL or a full embed snippet also works, because the ID is extracted. The block renders Bragly's inline embed (#bragly_widget_container+cdn.bragly.io/embed.js). If the ID is invalid, the block renders nothing. The block is only offered in rich-text (Portable Text) fields. Page-builder templates need a section type with a rich-text field. - Floating widget: in Plugins → Bragly Widgets → Settings (gear icon), set Floating Widget ID and Show Floating Widget On. This injects
app.bragly.io/api/embed/widget.jsviapage:fragments. The theme layout must render<EmDashBodyEnd page={...} />; the official templates do.
Develop
pnpm install
pnpm test # unit tests + Astro Container render of the block
pnpm typecheck
pnpm build # dist/index.mjs (runtime); src/astro ships as source
npm pack --dry-runPublish: npm publish --access public. This needs an npm account with publish rights on the @bragly scope. Keep VERSION in src/index.ts in sync with package.json.
