@devaccel-labs/comment-service 0.7.0 → 0.8.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.
@@ -1,2 +1,3 @@
1
1
  export { captureAnchor, resolveInDocument } from "./capture.js";
2
- export { CommentToolbar, type ToolbarPosition, type ToolbarTheme } from "./toolbar.js";
2
+ export { CommentToolbar, type ToolbarSource } from "./loader.js";
3
+ export type { ToolbarPosition, ToolbarProps, ToolbarTheme } from "./toolbar.js";
@@ -0,0 +1,10 @@
1
+ import type { ToolbarProps } from "./toolbar.js";
2
+ export type ToolbarSource = "latest" | "bundled";
3
+ export declare function CommentToolbar({ source, sessionPath, pollMs, position, theme, navigate, }: ToolbarProps & {
4
+ /**
5
+ * "latest" (default) loads the newest compatible toolbar from the comment service, so fixes ship
6
+ * without a dependency upgrade, and falls back to the copy in this package if that fails.
7
+ * "bundled" always uses the copy in this package.
8
+ */
9
+ source?: ToolbarSource;
10
+ }): null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The contract between the loader in the npm package and the toolbar the Worker serves at
3
+ * `/v1/toolbar/<runtimeVersion>.js`. Bump it only when `mount` or `ToolbarProps` change incompatibly,
4
+ * and commit the last build of the old version under apps/worker/public/v1/toolbar/ first so apps
5
+ * still on it keep working.
6
+ */
7
+ export declare const runtimeVersion = 1;
@@ -0,0 +1,7 @@
1
+ import { type ToolbarProps } from "./toolbar.js";
2
+ export { runtimeVersion } from "./runtime-version.js";
3
+ export type ToolbarHandle = {
4
+ update(props: ToolbarProps): void;
5
+ unmount(): void;
6
+ };
7
+ export declare function mount(container: HTMLElement, props: ToolbarProps): ToolbarHandle;
@@ -1,6 +1,6 @@
1
1
  export type ToolbarPosition = "bottom-left" | "bottom-center" | "bottom-right";
2
2
  export type ToolbarTheme = "light" | "dark" | "system";
3
- export declare function CommentToolbar({ sessionPath, pollMs, position, theme, navigate, }: {
3
+ export type ToolbarProps = {
4
4
  sessionPath?: string;
5
5
  pollMs?: number;
6
6
  /** Default bar position. Each person can override it from their menu. */
@@ -12,4 +12,5 @@ export declare function CommentToolbar({ sessionPath, pollMs, position, theme, n
12
12
  * Without it, selecting a comment from another page does a full page load.
13
13
  */
14
14
  navigate?: (href: string) => void;
15
- }): import("react").ReactPortal | null;
15
+ };
16
+ export declare function ToolbarApp({ sessionPath, pollMs, position, theme, navigate, }: ToolbarProps): import("react").ReactPortal | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devaccel-labs/comment-service",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "In-UI component comments for TanStack Start on Cloudflare. Anchors survive redeploys.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",