@popgrids/embed 0.0.4 → 0.0.6

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.
Files changed (53) hide show
  1. package/AGENTS.md +11 -16
  2. package/README.md +3 -0
  3. package/dist/assets/wordmark-svg.d.ts +7 -0
  4. package/dist/assets/wordmark-svg.d.ts.map +1 -0
  5. package/dist/components/pop-account-switcher.d.ts +31 -0
  6. package/dist/components/pop-account-switcher.d.ts.map +1 -0
  7. package/dist/components/pop-auth-code.d.ts +22 -0
  8. package/dist/components/pop-auth-code.d.ts.map +1 -0
  9. package/dist/components/pop-auth-email.d.ts +18 -0
  10. package/dist/components/pop-auth-email.d.ts.map +1 -0
  11. package/dist/components/pop-auth-join.d.ts +20 -0
  12. package/dist/components/pop-auth-join.d.ts.map +1 -0
  13. package/dist/components/pop-auth-no-code.d.ts +14 -0
  14. package/dist/components/pop-auth-no-code.d.ts.map +1 -0
  15. package/dist/components/pop-auth-panel.d.ts +17 -7
  16. package/dist/components/pop-auth-panel.d.ts.map +1 -1
  17. package/dist/components/pop-button-link.d.ts +43 -0
  18. package/dist/components/pop-button-link.d.ts.map +1 -0
  19. package/dist/components/pop-comment-bar.d.ts +2 -0
  20. package/dist/components/pop-comment-bar.d.ts.map +1 -1
  21. package/dist/components/pop-comment-thread.d.ts.map +1 -1
  22. package/dist/components/pop-comment.d.ts +2 -0
  23. package/dist/components/pop-comment.d.ts.map +1 -1
  24. package/dist/components/pop-feed.d.ts +15 -0
  25. package/dist/components/pop-feed.d.ts.map +1 -1
  26. package/dist/components/pop-grid.d.ts +13 -0
  27. package/dist/components/pop-grid.d.ts.map +1 -1
  28. package/dist/components/pop-widget.d.ts.map +1 -1
  29. package/dist/components/refs.d.ts +8 -0
  30. package/dist/components/refs.d.ts.map +1 -0
  31. package/dist/embed.js +2622 -1785
  32. package/dist/embed.js.map +1 -1
  33. package/dist/index.cjs +1007 -119
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.ts +3 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1415 -565
  38. package/dist/index.js.map +1 -1
  39. package/dist/lib/backoff.d.ts +11 -0
  40. package/dist/lib/backoff.d.ts.map +1 -0
  41. package/dist/lib/popup-auth.d.ts +10 -4
  42. package/dist/lib/popup-auth.d.ts.map +1 -1
  43. package/dist/lib/position-feed.d.ts +9 -0
  44. package/dist/lib/position-feed.d.ts.map +1 -0
  45. package/dist/store/embed-auth-store.d.ts +204 -0
  46. package/dist/store/embed-auth-store.d.ts.map +1 -0
  47. package/dist/store/grid-store.d.ts +15 -0
  48. package/dist/store/grid-store.d.ts.map +1 -1
  49. package/dist/types/models.d.ts +12 -0
  50. package/dist/types/models.d.ts.map +1 -1
  51. package/package.json +7 -9
  52. package/dist/store/auth-store.d.ts +0 -8
  53. package/dist/store/auth-store.d.ts.map +0 -1
@@ -0,0 +1,11 @@
1
+ /**
2
+ * "Full jitter" exponential backoff (AWS's exponential-backoff-and-jitter
3
+ * recipe): the delay for a given attempt is a random value between 0 and the
4
+ * exponential ceiling, not the ceiling itself. Pure exponential backoff only
5
+ * bounds how hard one client retries — every client that disconnects at the
6
+ * same instant (a DO/Worker blip, a deploy) computes the identical delay
7
+ * sequence and retries in lockstep waves. Randomizing spreads a correlated
8
+ * mass-reconnect out over time instead of turning it into a thundering herd.
9
+ */
10
+ export declare function reconnectDelayMs(attempt: number, baseMs: number, capMs: number): number;
11
+ //# sourceMappingURL=backoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backoff.d.ts","sourceRoot":"","sources":["../../src/lib/backoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvF"}
@@ -9,14 +9,20 @@ export declare const AUTH_TIMEOUT_MS: number;
9
9
  export declare class PopupAuthError extends Error {
10
10
  constructor(message: string);
11
11
  }
12
+ export declare class PopupAuthCancelledError extends PopupAuthError {
13
+ constructor(message?: string);
14
+ }
15
+ export interface EmbedAuthSuccess {
16
+ user: AuthUser;
17
+ token: string;
18
+ expiresAt: number;
19
+ }
12
20
  export declare const buildEmbedLoginUrl: (apiUrl: string, publicKey: string, returnOrigin: string) => string;
13
21
  export declare const openPopgridsLoginPopup: (apiUrl: string, publicKey: string) => Window;
14
22
  export declare const waitForPopgridsAuth: (apiUrl: string, popup: Window, options?: {
15
- onAuthUser?: (user: AuthUser) => void;
16
- verifySignedIn?: () => Promise<boolean>;
23
+ onAuthSuccess?: (result: EmbedAuthSuccess) => void;
17
24
  }) => Promise<void>;
18
25
  export declare const signInWithPopup: (apiUrl: string, publicKey: string, options?: {
19
- onAuthUser?: (user: AuthUser) => void;
20
- verifySignedIn?: () => Promise<boolean>;
26
+ onAuthSuccess?: (result: EmbedAuthSuccess) => void;
21
27
  }) => Promise<void>;
22
28
  //# sourceMappingURL=popup-auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popup-auth.d.ts","sourceRoot":"","sources":["../../src/lib/popup-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAC1C,eAAO,MAAM,cAAc,+BAA+B,CAAC;AAC3D,eAAO,MAAM,eAAe,QAAgB,CAAC;AAI7C,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,cAAc,MAAM,WAMrB,CAAC;AAEF,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,EAAE,WAAW,MAAM,EAAE,cAAc,MAAM,WAKzF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,WAYvE,CAAC;AAiDF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,UAAU;IACR,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACpD,kBA4EC,CAAC;AAEL,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU;IACR,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACpD,kBAIF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Grid } from '../types/models.js';
2
+ /**
3
+ * Keeps the open panel (`feed`) placed against the collapsed widget per the
4
+ * grid's Position — "up", "down", or "auto" (flips to whichever side fits) —
5
+ * and at least 16px inside the viewport. Returns the cleanup that stops
6
+ * tracking.
7
+ */
8
+ export declare function positionFeed(widget: HTMLElement, feed: HTMLElement, position: Grid["position"]): () => void;
9
+ //# sourceMappingURL=position-feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position-feed.d.ts","sourceRoot":"","sources":["../../src/lib/position-feed.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAO/C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,GACzB,MAAM,IAAI,CAkCZ"}
@@ -0,0 +1,204 @@
1
+ import { AuthUser, OrgOption } from '../types/models.js';
2
+ export type EmbedAuthView = "idle" | "email" | "code" | "no-code";
3
+ /**
4
+ * Owns auth state for one `<pop-grid>` instance — registered per-element
5
+ * (see registry.ts) rather than as a page-global singleton, so multiple
6
+ * widgets with different publicKeys on the same page don't share identity.
7
+ */
8
+ export declare class EmbedAuthStore {
9
+ readonly apiUrl: string;
10
+ readonly publicKey: string;
11
+ /** In demo mode nobody signs in: no stored session, no cross-tab sync, no requests. */
12
+ readonly demo: boolean;
13
+ currentUser: import('@preact/signals-core').Signal<AuthUser | null>;
14
+ authError: import('@preact/signals-core').Signal<string | null>;
15
+ /** Label for the notice's button (it always just dismisses the notice). Set via showAuthError. */
16
+ authErrorAction: import('@preact/signals-core').Signal<string>;
17
+ /**
18
+ * Bumped each time the visitor dismisses the notice (vs. it clearing on its
19
+ * own, e.g. the panel closing) so the auth cards can hand focus back to
20
+ * their field — the notice made everything under it inert until now.
21
+ */
22
+ authNoticeDismissals: import('@preact/signals-core').Signal<number>;
23
+ /**
24
+ * When set, the notice is a rate-limit wait: its button becomes a
25
+ * countdown to this timestamp and the notice dismisses itself at zero.
26
+ */
27
+ authErrorRetryAt: import('@preact/signals-core').Signal<number | null>;
28
+ authPending: import('@preact/signals-core').Signal<boolean>;
29
+ /**
30
+ * Accounts the signed-in visitor can comment as (see switchOrganization) —
31
+ * populated after sign-in, independent of which one is currently active.
32
+ * The *active* account syncs across every same-browser tab (they share one
33
+ * token — see ADR 0011); this list itself doesn't need to, since it's the
34
+ * same accounts regardless of which is active.
35
+ */
36
+ organizations: import('@preact/signals-core').Signal<OrgOption[]>;
37
+ /** True while an organizations fetch is in flight — drives the switcher's spinner. */
38
+ organizationsLoading: import('@preact/signals-core').Signal<boolean>;
39
+ /**
40
+ * Inline email+OTP sign-in state (see pop-auth-panel.ts). Kept separate
41
+ * from authPending/authError above, which stay owned by the OAuth popup
42
+ * flow (requestSignIn) — the two flows can be mid-progress independently.
43
+ */
44
+ authView: import('@preact/signals-core').Signal<EmbedAuthView>;
45
+ otpEmail: import('@preact/signals-core').Signal<string>;
46
+ otpPending: import('@preact/signals-core').Signal<boolean>;
47
+ otpError: import('@preact/signals-core').Signal<string | null>;
48
+ otpExpiresAt: import('@preact/signals-core').Signal<number | null>;
49
+ private session;
50
+ private authSocket;
51
+ private authReconnectAttempt;
52
+ private authReconnectTimer;
53
+ private destroyed;
54
+ private onStorageEvent;
55
+ /**
56
+ * Every live store on this page. The `storage` event never fires in the
57
+ * document that made the write, so two grids with the same publicKey on
58
+ * one page (which share a localStorage key) would otherwise never hear
59
+ * about each other's sign-in or sign-out until reload — see notifySiblings.
60
+ */
61
+ private static instances;
62
+ private static syncing;
63
+ /** Applies a session change made elsewhere — another tab (storage event) or another grid on this page (notifySiblings). */
64
+ private applyExternalChange;
65
+ /** Pushes a local session change to other grids on this page sharing our publicKey. */
66
+ private notifySiblings;
67
+ constructor(opts: {
68
+ apiUrl: string;
69
+ publicKey: string;
70
+ demo?: boolean;
71
+ });
72
+ /** Closes the auth channel, cancels any pending reconnect, and stops listening for cross-tab changes — call from the owning element's disconnectedCallback. */
73
+ destroy(): void;
74
+ private readStoredSession;
75
+ /**
76
+ * Just the storage write, no side effects — for keeping the persisted
77
+ * session in sync with a sliding-expiry renewal (checkSession) without
78
+ * redoing loadOrganizations/reconnecting the auth channel for what's
79
+ * still the same identity. writeStoredSession (below) is for an actual
80
+ * sign-in (new or adopted from another tab), where those side effects
81
+ * are the point.
82
+ */
83
+ private persistSession;
84
+ private writeStoredSession;
85
+ private clearStoredSession;
86
+ /**
87
+ * Current token, or null if missing/expired (clearing state — and, if we
88
+ * were signed in, showing the "you were signed out" message — as a side
89
+ * effect of expiry). This is a local-only check against the last
90
+ * `expiresAt` this tab persisted: if the credential was actually renewed
91
+ * from a *different*, still-open tab/device while this one sat closed
92
+ * past its own locally-known expiry, this can call it expired a little
93
+ * early rather than re-confirming with the server — an occasional,
94
+ * low-stakes extra sign-in prompt, traded for not hitting the server on
95
+ * every single token read just to double-check a locally-expired date.
96
+ */
97
+ private get token();
98
+ /**
99
+ * Attaches the stored token (if any) and returns the response as-is — no
100
+ * retry-via-popup. Use for reads that should silently show "signed out"
101
+ * on 401 rather than interrupting the visitor (grid/comments GET, session
102
+ * check, WS connect-ticket mint — the last of which must also work for
103
+ * anonymous/signed-out visitors).
104
+ */
105
+ fetchWithToken(path: string, init?: RequestInit): Promise<Response>;
106
+ /**
107
+ * Same as fetchWithToken, but on a 401 prompts sign-in inline (the
108
+ * visitor's already looking at the open panel, mid-action — that's
109
+ * exactly what triggered this) and retries once. Use only for actions the
110
+ * visitor just explicitly initiated (post/edit/delete/flag a comment) —
111
+ * never for passive/background reads, since this interrupts them with a
112
+ * prompt.
113
+ *
114
+ * The request being retried already has whatever the visitor typed baked
115
+ * into it (e.g. postComment captures the comment body into the request
116
+ * before this ever runs) — requestInlineSignIn() only has to get them
117
+ * back to a valid session; it doesn't need to preserve or restore
118
+ * anything itself for the retry to pick up right where they left off.
119
+ */
120
+ authorizedFetch(path: string, init?: RequestInit): Promise<Response>;
121
+ private readError;
122
+ /** Transitions from the idle "Join the Conversation" state into the inline email form. */
123
+ startEmailSignIn(): void;
124
+ backToIdle(): void;
125
+ backToEmail(): void;
126
+ /**
127
+ * The code can no longer be used: drop back to the email step to request a
128
+ * new one. otpEmail is kept (in memory only) so the email field can be
129
+ * prefilled rather than making the visitor retype it.
130
+ */
131
+ expireOtp(): void;
132
+ /** One step back from the no-code help card, to the code entry it was opened from. */
133
+ backToCode(): void;
134
+ showNoCode(): void;
135
+ /** Sends (or resends) a sign-in code to `email`. No token yet — the visitor isn't signed in. */
136
+ sendOtp(email: string): Promise<boolean>;
137
+ resendOtp(): Promise<boolean>;
138
+ /** Verifies `code` against the in-progress email and, on success, signs the visitor in. */
139
+ verifyOtp(code: string): Promise<boolean>;
140
+ requestSignIn(): Promise<boolean>;
141
+ /**
142
+ * Resolves the promise a pending requestInlineSignIn() call is awaiting —
143
+ * set while one's in progress, called from verifyOtp()'s success path
144
+ * (true) and backToIdle() (false, abandoned). Not a public method: it's
145
+ * the completion half of requestInlineSignIn(), nothing else should call it.
146
+ */
147
+ private resolveInlineSignIn;
148
+ private inlineSignInPromise;
149
+ /**
150
+ * Reactive re-auth for authorizedFetch(): puts the widget into the inline
151
+ * sign-in flow (the panel's already open — that's what triggered this,
152
+ * mid-write) and waits for it to resolve, rather than opening the OAuth
153
+ * popup the way the old checkSession-driven path did. Concurrent callers
154
+ * (e.g. two writes racing into a 401 around the same time) join the same
155
+ * pending prompt instead of each resetting it back to the email step.
156
+ */
157
+ requestInlineSignIn(): Promise<boolean>;
158
+ private showAuthError;
159
+ /** A 429: show the wait as a countdown (see authErrorRetryAt) instead of letting the visitor hammer the endpoint. */
160
+ private showRateLimited;
161
+ dismissAuthError(): void;
162
+ clearAuthError(): void;
163
+ /**
164
+ * Fetches the accounts the signed-in visitor can comment as (for the
165
+ * switcher UI) — lazily: called on demand when the switcher's dropdown
166
+ * opens (pop-account-switcher.ts), not proactively on sign-in or page
167
+ * load. Once populated, `organizations` acts as its own cache — callers
168
+ * should check `organizations.value.length === 0` before calling this
169
+ * rather than calling it unconditionally, which also means a prior
170
+ * failed attempt gets retried the next time the dropdown opens rather
171
+ * than being stuck empty forever.
172
+ */
173
+ loadOrganizations(): Promise<void>;
174
+ /**
175
+ * Switches which account this widget's comments post as. Doesn't touch or
176
+ * read the main app's active org — but the api key itself (and thus which
177
+ * account it's scoped to server-side) is the same one every same-browser
178
+ * tab shares via localStorage (see ADR 0009), so a switch here already
179
+ * changes every other tab's underlying identity whether we tell them or
180
+ * not. persistSession below keeps their displayed state honest via the
181
+ * same native `storage` event sign-in already propagates through — see
182
+ * ADR 0011, which corrects ADR 0008's original "switching stays local"
183
+ * framing now that the token itself is shared.
184
+ */
185
+ switchOrganization(organizationId: string): Promise<boolean>;
186
+ /** Signs this identity out everywhere (main app + every other widget), not just this one. */
187
+ signOutEverywhere(): Promise<boolean>;
188
+ /** Shared cleanup for every way this widget learns it's signed out: a pushed session.revoked, a 401 from an authed call, an expired remembered sign-in, or the visitor's own sign-out. */
189
+ private handleSignedOut;
190
+ /**
191
+ * Opens the auth-only push channel — and, as its one other job, the sole
192
+ * point that verifies the token server-side and applies the sliding
193
+ * renewal (see docs/adr/0009 and 0010). Not called on construction:
194
+ * pop-feed.ts calls this once the panel first opens, since that's the
195
+ * first moment the widget actually needs to know anything about auth
196
+ * beyond what's already cached locally (the collapsed pill shows other
197
+ * commenters, never the current visitor's own identity). Safe to call
198
+ * repeatedly — no-ops once a socket is already open.
199
+ */
200
+ connectAuthChannel(): Promise<void>;
201
+ private scheduleAuthReconnect;
202
+ private closeAuthChannel;
203
+ }
204
+ //# sourceMappingURL=embed-auth-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-auth-store.d.ts","sourceRoot":"","sources":["../../src/store/embed-auth-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAgB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAmC5E,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAElE;;;;GAIG;AACH,qBAAa,cAAc;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,WAAW,yDAAiC;IAC5C,SAAS,uDAA+B;IACxC,kGAAkG;IAClG,eAAe,gDAAiC;IAChD;;;;OAIG;IACH,oBAAoB,gDAAa;IACjC;;;OAGG;IACH,gBAAgB,uDAA+B;IAC/C,WAAW,iDAAiB;IAE5B;;;;;;OAMG;IACH,aAAa,qDAA2B;IACxC,sFAAsF;IACtF,oBAAoB,iDAAiB;IAErC;;;;OAIG;IACH,QAAQ,uDAAiC;IACzC,QAAQ,gDAAsB;IAC9B,UAAU,iDAAiB;IAC3B,QAAQ,uDAA+B;IACvC,YAAY,uDAA+B;IAE3C,OAAO,CAAC,OAAO,CAA6B;IAQ5C,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,kBAAkB,CAA8C;I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,CAAC;IAmDzC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAsBvC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB,CAA6C;IACxE,OAAO,CAAC,mBAAmB,CAAiC;IAE5D;;;;;;;OAOG;IACH,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBvC,OAAO,CAAC,aAAa;IAWrB,qHAAqH;IACrH,OAAO,CAAC,eAAe;IAQvB,gBAAgB,IAAI,IAAI;IAKxB,cAAc,IAAI,IAAI;IAItB;;;;;;;;;OASG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BxC;;;;;;;;;;OAUG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlE,6FAA6F;IACvF,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAe3C,0LAA0L;IAC1L,OAAO,CAAC,eAAe;IAWvB;;;;;;;;;OASG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IA0FzC,OAAO,CAAC,qBAAqB;IAc7B,OAAO,CAAC,gBAAgB;CAezB"}
@@ -1,4 +1,5 @@
1
1
  import { Comment, CommentAuthor, Grid } from '../types/models.js';
2
+ import { EmbedAuthStore } from './embed-auth-store.js';
2
3
  /**
3
4
  * The five visual settings a `<pop-grid>` can override live via
4
5
  * `data-align`/`data-layout`/`data-position`/`data-icon`/`data-preview-count`
@@ -8,12 +9,20 @@ import { Comment, CommentAuthor, Grid } from '../types/models.js';
8
9
  * for that field with a plain spread.
9
10
  */
10
11
  export type GridOverrides = Partial<Pick<Grid, "align" | "layout" | "position" | "icon" | "previewCount">>;
12
+ /** What a `<pop-grid data-demo>` shows in place of a fetched grid — see pop-grid.ts's `demo`. */
13
+ export interface DemoData {
14
+ grid: Grid;
15
+ comments: Comment[];
16
+ }
11
17
  export declare class GridStore {
12
18
  readonly apiUrl: string;
13
19
  readonly publicKey: string;
14
20
  readonly pageUrl: string;
15
21
  readonly externalId: string | null;
22
+ /** Shows host-supplied data (`showDemo`) and never touches the network. */
23
+ readonly demo: boolean;
16
24
  readonly previewCount = 3;
25
+ private readonly authStore;
17
26
  /** The grid last fetched from the API — never read directly outside this
18
27
  * class; `grid` (below) is the override-aware value every consumer uses. */
19
28
  private _fetchedGrid;
@@ -35,6 +44,8 @@ export declare class GridStore {
35
44
  private reconnectTimer;
36
45
  private disposed;
37
46
  topLevelComments: import('@preact/signals-core').ReadonlySignal<Comment[]>;
47
+ /** Size of the comment avatars inside the open panel, set by the grid's Layout: 56px for "lg", otherwise 32px. */
48
+ commentSize: import('@preact/signals-core').ReadonlySignal<"sm" | "lg">;
38
49
  replyingToComment: import('@preact/signals-core').ReadonlySignal<Comment | null>;
39
50
  editingComment: import('@preact/signals-core').ReadonlySignal<Comment | null>;
40
51
  previewComments: import('@preact/signals-core').ReadonlySignal<Comment[]>;
@@ -44,7 +55,11 @@ export declare class GridStore {
44
55
  publicKey: string;
45
56
  pageUrl: string;
46
57
  externalId?: string | null;
58
+ demo?: boolean;
59
+ authStore: EmbedAuthStore;
47
60
  });
61
+ /** Stands in for `load()` in demo mode: shows the given data as if it had been fetched. */
62
+ showDemo({ grid, comments }: DemoData): void;
48
63
  /** Replaces the current override set wholesale (not a per-key merge) —
49
64
  * called with every override attribute `<pop-grid>` currently has set, so
50
65
  * removing an attribute correctly falls back to the fetched grid's value
@@ -1 +1 @@
1
- {"version":3,"file":"grid-store.d.ts","sourceRoot":"","sources":["../../src/store/grid-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAqBvE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CACjC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,CAAC,CACtE,CAAC;AAUF,qBAAa,SAAS;IACpB,QAAQ,CAAC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AAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAuBrE,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAezD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAStD,OAAO,CAAC,mBAAmB;CAG5B"}
@@ -44,4 +44,16 @@ export interface AuthUser {
44
44
  email: string;
45
45
  image: string | null;
46
46
  }
47
+ /** What's persisted to sessionStorage after a successful embed sign-in. */
48
+ export interface EmbedSession {
49
+ token: string;
50
+ expiresAt: number;
51
+ user: AuthUser;
52
+ }
53
+ /** One account the signed-in visitor can comment as — see EmbedAuthStore.organizations. */
54
+ export interface OrgOption {
55
+ id: string;
56
+ name: string;
57
+ image: string | null;
58
+ }
47
59
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/types/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAA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AM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,2FAA2F;AAC3F,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@popgrids/embed",
3
3
  "description": "PopGrids embeddable discussion widget",
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "PopGrids",
8
- "homepage": "https://github.com/popgrids/popgrids-embed#readme",
8
+ "homepage": "https://github.com/popgrids/popgrids/tree/main/packages/embed#readme",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/popgrids/popgrids-embed.git"
11
+ "url": "git+https://github.com/popgrids/popgrids.git",
12
+ "directory": "packages/embed"
12
13
  },
13
14
  "bugs": {
14
- "url": "https://github.com/popgrids/popgrids-embed/issues"
15
+ "url": "https://github.com/popgrids/popgrids/issues"
15
16
  },
16
17
  "keywords": [
17
18
  "popgrids",
@@ -50,7 +51,6 @@
50
51
  "composed-offset-position": "^0.0.6"
51
52
  },
52
53
  "devDependencies": {
53
- "@changesets/cli": "^2.31.0",
54
54
  "concurrently": "^10.0.3",
55
55
  "live-server": "^1.2.2",
56
56
  "prettier": "^3.8.4",
@@ -63,12 +63,10 @@
63
63
  "build:lib": "vite build",
64
64
  "build:embed": "vite build --config vite.embed.config.ts",
65
65
  "build": "rm -rf dist && pnpm run build:lib && pnpm run build:embed",
66
- "typecheck": "tsc --noEmit",
67
66
  "dev": "concurrently -k \"vite build --watch\" \"vite build --config vite.embed.config.ts --watch\"",
68
67
  "demo": "pnpm run build && npx serve . -p 5500 --cors",
69
68
  "demo:dev": "concurrently -k \"pnpm run dev\" \"live-server --port=5500 --open=demo --watch=dist,demo\"",
70
- "changeset": "changeset",
71
- "changeset:version": "changeset version",
72
- "clean": "rm -rf node_modules dist"
69
+ "clean": "rm -rf node_modules dist",
70
+ "check": "tsc --noEmit"
73
71
  }
74
72
  }
@@ -1,8 +0,0 @@
1
- import { AuthUser } from '../types/models.js';
2
- export declare const currentUser: import('@preact/signals-core').Signal<AuthUser | null>;
3
- export declare const authError: import('@preact/signals-core').Signal<string | null>;
4
- export declare const authPending: import('@preact/signals-core').Signal<boolean>;
5
- export declare function checkSession(apiUrl: string, publicKey: string, delays?: number[]): Promise<boolean>;
6
- export declare function requestSignIn(apiUrl: string, publicKey: string): Promise<boolean>;
7
- export declare function clearAuthError(): void;
8
- //# sourceMappingURL=auth-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-store.d.ts","sourceRoot":"","sources":["../../src/store/auth-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,WAAW,wDAAgC,CAAC;AACzD,eAAO,MAAM,SAAS,sDAA8B,CAAC;AACrD,eAAO,MAAM,WAAW,gDAAgB,CAAC;AAKzC,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAAM,EAA4B,GACzC,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC"}