@nowline/embed 0.2.5 → 0.4.1

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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Allowlist for the dev embed bundle's Firebase Auth gate.
3
+ *
4
+ * An email is allowlisted if either:
5
+ * 1. Its domain is in ALLOWED_DOMAINS (e.g. anything @nowline.io), OR
6
+ * 2. The exact lowercase email is in ALLOWED_EMAILS.
7
+ *
8
+ * Mirrors the commercial site's `auth-allowlist.ts` so both Lolay
9
+ * dev surfaces (the marketing site and the embed CDN dev tier) share
10
+ * one allowlist policy. Keep this short; when it grows past ~5 entries,
11
+ * migrate to Firebase custom claims (Admin SDK) or a Firestore
12
+ * `allowlist` collection.
13
+ *
14
+ * See specs/embed.md § Bootstrap status (dev auth gate) and
15
+ * the infrastructure deploy runbook § 4 for the deploy-side wiring.
16
+ */
17
+ export declare const ALLOWED_DOMAINS: readonly string[];
18
+ export declare const ALLOWED_EMAILS: readonly string[];
19
+ export declare function isAllowlisted(email: string | null | undefined): boolean;
20
+ //# sourceMappingURL=allowlist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../src/auth/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAmB,CAAC;AAEjE,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAE3C,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAQvE"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Allowlist for the dev embed bundle's Firebase Auth gate.
3
+ *
4
+ * An email is allowlisted if either:
5
+ * 1. Its domain is in ALLOWED_DOMAINS (e.g. anything @nowline.io), OR
6
+ * 2. The exact lowercase email is in ALLOWED_EMAILS.
7
+ *
8
+ * Mirrors the commercial site's `auth-allowlist.ts` so both Lolay
9
+ * dev surfaces (the marketing site and the embed CDN dev tier) share
10
+ * one allowlist policy. Keep this short; when it grows past ~5 entries,
11
+ * migrate to Firebase custom claims (Admin SDK) or a Firestore
12
+ * `allowlist` collection.
13
+ *
14
+ * See specs/embed.md § Bootstrap status (dev auth gate) and
15
+ * the infrastructure deploy runbook § 4 for the deploy-side wiring.
16
+ */
17
+ export const ALLOWED_DOMAINS = ['nowline.io'];
18
+ export const ALLOWED_EMAILS = [
19
+ // Add additional allowlisted Google account emails here, one per line.
20
+ ];
21
+ export function isAllowlisted(email) {
22
+ if (!email)
23
+ return false;
24
+ const normalized = email.trim().toLowerCase();
25
+ if (ALLOWED_EMAILS.includes(normalized))
26
+ return true;
27
+ const at = normalized.lastIndexOf('@');
28
+ if (at === -1)
29
+ return false;
30
+ const domain = normalized.slice(at + 1);
31
+ return ALLOWED_DOMAINS.includes(domain);
32
+ }
33
+ //# sourceMappingURL=allowlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowlist.js","sourceRoot":"","sources":["../../src/auth/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,YAAY,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAsB;AAC7C,uEAAuE;CAC1E,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,KAAgC;IAC1D,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,EAAE,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACxC,OAAO,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Build-time environment helpers for `@nowline/embed`.
3
+ *
4
+ * `__NOWLINE_EMBED_ENV__` is substituted at bundle time by esbuild's
5
+ * `define` (see `packages/embed/scripts/bundle.mjs`). The substitution
6
+ * lets the prod minified bundle dead-code-eliminate the dev auth gate
7
+ * and its Firebase imports — when the constant folds to the literal
8
+ * string `"prod"`, every `IS_DEV` branch becomes `false` and esbuild's
9
+ * minifier strips the dynamic-import site that pulls in `firebase/app`
10
+ * + `firebase/auth`.
11
+ *
12
+ * The `typeof` guards keep this module safe to import under vitest,
13
+ * where esbuild's define never runs and the identifier is undeclared.
14
+ */
15
+ export type EmbedEnv = 'dev' | 'prod';
16
+ export declare const EMBED_ENV: EmbedEnv;
17
+ export declare const IS_DEV: boolean;
18
+ export declare const IS_PROD: boolean;
19
+ export declare const EMBED_VERSION: string;
20
+ export declare const EMBED_SHA: string;
21
+ export declare const PROD_ORIGIN = "https://embed.nowline.io";
22
+ export declare const DEV_ORIGIN = "https://embed.nowline.dev";
23
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/auth/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEtC,eAAO,MAAM,SAAS,EAAE,QAGR,CAAC;AAEjB,eAAO,MAAM,MAAM,EAAE,OAA6B,CAAC;AACnD,eAAO,MAAM,OAAO,EAAE,OAA8B,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,MAC8D,CAAC;AAE3F,eAAO,MAAM,SAAS,EAAE,MAC4D,CAAC;AAErF,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,UAAU,8BAA8B,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Build-time environment helpers for `@nowline/embed`.
3
+ *
4
+ * `__NOWLINE_EMBED_ENV__` is substituted at bundle time by esbuild's
5
+ * `define` (see `packages/embed/scripts/bundle.mjs`). The substitution
6
+ * lets the prod minified bundle dead-code-eliminate the dev auth gate
7
+ * and its Firebase imports — when the constant folds to the literal
8
+ * string `"prod"`, every `IS_DEV` branch becomes `false` and esbuild's
9
+ * minifier strips the dynamic-import site that pulls in `firebase/app`
10
+ * + `firebase/auth`.
11
+ *
12
+ * The `typeof` guards keep this module safe to import under vitest,
13
+ * where esbuild's define never runs and the identifier is undeclared.
14
+ */
15
+ export const EMBED_ENV = typeof __NOWLINE_EMBED_ENV__ !== 'undefined' && __NOWLINE_EMBED_ENV__ === 'dev'
16
+ ? 'dev'
17
+ : 'prod';
18
+ export const IS_DEV = EMBED_ENV === 'dev';
19
+ export const IS_PROD = EMBED_ENV === 'prod';
20
+ export const EMBED_VERSION = typeof __NOWLINE_EMBED_VERSION__ !== 'undefined' ? __NOWLINE_EMBED_VERSION__ : '0.0.0';
21
+ export const EMBED_SHA = typeof __NOWLINE_EMBED_SHA__ !== 'undefined' ? __NOWLINE_EMBED_SHA__ : 'unknown';
22
+ export const PROD_ORIGIN = 'https://embed.nowline.io';
23
+ export const DEV_ORIGIN = 'https://embed.nowline.dev';
24
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/auth/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,MAAM,CAAC,MAAM,SAAS,GAClB,OAAO,qBAAqB,KAAK,WAAW,IAAI,qBAAqB,KAAK,KAAK;IAC3E,CAAC,CAAC,KAAK;IACP,CAAC,CAAC,MAAM,CAAC;AAEjB,MAAM,CAAC,MAAM,MAAM,GAAY,SAAS,KAAK,KAAK,CAAC;AACnD,MAAM,CAAC,MAAM,OAAO,GAAY,SAAS,KAAK,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GACtB,OAAO,yBAAyB,KAAK,WAAW,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC;AAE3F,MAAM,CAAC,MAAM,SAAS,GAClB,OAAO,qBAAqB,KAAK,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Client-side Firebase Auth gate for the dev embed bundle.
3
+ *
4
+ * Mirrors the commercial site's `firebase-auth.client.ts` so the
5
+ * two Lolay dev surfaces share one allowlist UX. Loaded only on the
6
+ * dev build (when `__NOWLINE_EMBED_ENV__ === 'dev'`); the prod build
7
+ * tree-shakes the dynamic import in `src/index.ts` and never pulls
8
+ * `firebase/app` or `firebase/auth` into the IIFE.
9
+ *
10
+ * Renders a full-viewport overlay with z-index 2147483647 so it sits
11
+ * above any host-page content. Until the visitor signs in with an
12
+ * allowlisted Google account, the overlay stays put; once allowlisted,
13
+ * it removes itself and the embed's auto-scan reaches the rendered
14
+ * SVG underneath. The host page is told nothing — the gate is purely
15
+ * client-side, opaque to the embedder.
16
+ *
17
+ * See specs/embed.md § Bootstrap status (dev auth gate) and
18
+ * the infrastructure deploy runbook § 4 for the deploy-side wiring.
19
+ */
20
+ export declare function startDevAuthGate(): void;
21
+ //# sourceMappingURL=firebase-auth.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-auth.client.d.ts","sourceRoot":"","sources":["../../src/auth/firebase-auth.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAyGH,wBAAgB,gBAAgB,IAAI,IAAI,CAkDvC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Client-side Firebase Auth gate for the dev embed bundle.
3
+ *
4
+ * Mirrors the commercial site's `firebase-auth.client.ts` so the
5
+ * two Lolay dev surfaces share one allowlist UX. Loaded only on the
6
+ * dev build (when `__NOWLINE_EMBED_ENV__ === 'dev'`); the prod build
7
+ * tree-shakes the dynamic import in `src/index.ts` and never pulls
8
+ * `firebase/app` or `firebase/auth` into the IIFE.
9
+ *
10
+ * Renders a full-viewport overlay with z-index 2147483647 so it sits
11
+ * above any host-page content. Until the visitor signs in with an
12
+ * allowlisted Google account, the overlay stays put; once allowlisted,
13
+ * it removes itself and the embed's auto-scan reaches the rendered
14
+ * SVG underneath. The host page is told nothing — the gate is purely
15
+ * client-side, opaque to the embedder.
16
+ *
17
+ * See specs/embed.md § Bootstrap status (dev auth gate) and
18
+ * the infrastructure deploy runbook § 4 for the deploy-side wiring.
19
+ */
20
+ import { initializeApp } from 'firebase/app';
21
+ import { GoogleAuthProvider, getAuth, onAuthStateChanged, signInWithPopup, signOut, } from 'firebase/auth';
22
+ import { isAllowlisted } from './allowlist.js';
23
+ const config = {
24
+ apiKey: typeof __NOWLINE_FIREBASE_API_KEY__ !== 'undefined' ? __NOWLINE_FIREBASE_API_KEY__ : '',
25
+ authDomain: typeof __NOWLINE_FIREBASE_AUTH_DOMAIN__ !== 'undefined'
26
+ ? __NOWLINE_FIREBASE_AUTH_DOMAIN__
27
+ : '',
28
+ projectId: typeof __NOWLINE_FIREBASE_PROJECT_ID__ !== 'undefined'
29
+ ? __NOWLINE_FIREBASE_PROJECT_ID__
30
+ : '',
31
+ appId: typeof __NOWLINE_FIREBASE_APP_ID__ !== 'undefined' ? __NOWLINE_FIREBASE_APP_ID__ : '',
32
+ };
33
+ const OVERLAY_ID = 'nowline-embed-dev-auth-overlay';
34
+ let app = null;
35
+ let auth = null;
36
+ function getOrCreateOverlay() {
37
+ let overlay = document.getElementById(OVERLAY_ID);
38
+ if (overlay)
39
+ return overlay;
40
+ overlay = document.createElement('div');
41
+ overlay.id = OVERLAY_ID;
42
+ overlay.setAttribute('role', 'dialog');
43
+ overlay.setAttribute('aria-modal', 'true');
44
+ overlay.setAttribute('aria-label', 'Internal preview sign-in');
45
+ overlay.style.cssText = [
46
+ 'position: fixed',
47
+ 'inset: 0',
48
+ 'z-index: 2147483647',
49
+ 'background-color: #ffffff',
50
+ 'color: #1a1a2e',
51
+ 'display: flex',
52
+ 'align-items: center',
53
+ 'justify-content: center',
54
+ 'padding: 1.5rem',
55
+ 'font-family: system-ui, -apple-system, "Segoe UI", sans-serif',
56
+ ].join(';');
57
+ document.body.appendChild(overlay);
58
+ return overlay;
59
+ }
60
+ function removeOverlay() {
61
+ const overlay = document.getElementById(OVERLAY_ID);
62
+ overlay?.remove();
63
+ }
64
+ function renderSignIn(overlay, onClick) {
65
+ overlay.innerHTML = `
66
+ <div style="max-width: 28rem; text-align: center;">
67
+ <div style="font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #5a5a6a; margin-bottom: 0.75rem;">embed.nowline.dev &mdash; internal preview</div>
68
+ <h1 style="font-size: 1.875rem; font-weight: 700; margin: 0 0 0.75rem;">Sign in to continue</h1>
69
+ <p style="margin: 0 0 1.5rem; color: #5a5a6a;">Access is limited to allowlisted Lolay accounts. Production embed is at <a href="https://embed.nowline.io" style="color: #1a4ed8;">embed.nowline.io</a>.</p>
70
+ <button type="button" id="nowline-embed-dev-signin-btn" style="display: inline-block; padding: 0.75rem 1.5rem; border-radius: 8px; background-color: #e53e3e; color: #ffffff; font-weight: 700; border: 1px solid transparent; cursor: pointer; font-size: 1rem;">Sign in with Google</button>
71
+ </div>
72
+ `;
73
+ const btn = overlay.querySelector('#nowline-embed-dev-signin-btn');
74
+ btn?.addEventListener('click', onClick);
75
+ }
76
+ function renderDenied(overlay, email, onSignOut) {
77
+ overlay.innerHTML = `
78
+ <div style="max-width: 28rem; text-align: center;">
79
+ <div style="font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #5a5a6a; margin-bottom: 0.75rem;">embed.nowline.dev &mdash; internal preview</div>
80
+ <h1 style="font-size: 1.875rem; font-weight: 700; margin: 0 0 0.75rem;">Access denied</h1>
81
+ <p style="margin: 0 0 1.5rem; color: #5a5a6a;">${escapeHtml(email)} is not on the allowlist for this preview environment. Production embed is publicly available at <a href="https://embed.nowline.io" style="color: #1a4ed8;">embed.nowline.io</a>.</p>
82
+ <button type="button" id="nowline-embed-dev-signout-btn" style="display: inline-block; padding: 0.75rem 1.5rem; border-radius: 8px; background-color: transparent; color: #1a1a2e; font-weight: 700; border: 1px solid #c0c0c0; cursor: pointer; font-size: 1rem;">Sign out</button>
83
+ </div>
84
+ `;
85
+ const btn = overlay.querySelector('#nowline-embed-dev-signout-btn');
86
+ btn?.addEventListener('click', onSignOut);
87
+ }
88
+ function escapeHtml(value) {
89
+ return value
90
+ .replace(/&/g, '&amp;')
91
+ .replace(/</g, '&lt;')
92
+ .replace(/>/g, '&gt;')
93
+ .replace(/"/g, '&quot;')
94
+ .replace(/'/g, '&#39;');
95
+ }
96
+ export function startDevAuthGate() {
97
+ if (typeof window === 'undefined' || typeof document === 'undefined')
98
+ return;
99
+ if (!config.apiKey || !config.authDomain || !config.projectId || !config.appId) {
100
+ // No firebase config baked in. Likely a local `pnpm bundle` without
101
+ // PUBLIC_FIREBASE_* exported (CI deploys always set them). Skip the
102
+ // overlay rather than render an unrecoverable dialog so devs aren't
103
+ // locked out of their own local builds.
104
+ console.warn('[nowline-embed-dev-auth-gate] Missing PUBLIC_FIREBASE_* env vars at build time; gate is disabled. Configure them in .github/workflows/embed-cdn.yml or your local environment to enable.');
105
+ return;
106
+ }
107
+ // Create the overlay up front so it covers content while Firebase
108
+ // initialises; subsequent renders call getOrCreateOverlay() again
109
+ // to find the same element.
110
+ getOrCreateOverlay();
111
+ app ??= initializeApp(config);
112
+ auth ??= getAuth(app);
113
+ const provider = new GoogleAuthProvider();
114
+ const handleSignIn = async () => {
115
+ try {
116
+ await signInWithPopup(auth, provider);
117
+ }
118
+ catch (err) {
119
+ console.error('[nowline-embed-dev-auth-gate] Sign-in failed:', err);
120
+ }
121
+ };
122
+ const handleSignOut = async () => {
123
+ try {
124
+ await signOut(auth);
125
+ }
126
+ catch (err) {
127
+ console.error('[nowline-embed-dev-auth-gate] Sign-out failed:', err);
128
+ }
129
+ };
130
+ onAuthStateChanged(auth, (user) => {
131
+ if (!user) {
132
+ renderSignIn(getOrCreateOverlay(), handleSignIn);
133
+ return;
134
+ }
135
+ if (!isAllowlisted(user.email)) {
136
+ renderDenied(getOrCreateOverlay(), user.email ?? 'unknown', handleSignOut);
137
+ return;
138
+ }
139
+ removeOverlay();
140
+ });
141
+ }
142
+ //# sourceMappingURL=firebase-auth.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firebase-auth.client.js","sourceRoot":"","sources":["../../src/auth/firebase-auth.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAoB,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEH,kBAAkB,EAClB,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,OAAO,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAU/C,MAAM,MAAM,GAAG;IACX,MAAM,EAAE,OAAO,4BAA4B,KAAK,WAAW,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE;IAC/F,UAAU,EACN,OAAO,gCAAgC,KAAK,WAAW;QACnD,CAAC,CAAC,gCAAgC;QAClC,CAAC,CAAC,EAAE;IACZ,SAAS,EACL,OAAO,+BAA+B,KAAK,WAAW;QAClD,CAAC,CAAC,+BAA+B;QACjC,CAAC,CAAC,EAAE;IACZ,KAAK,EAAE,OAAO,2BAA2B,KAAK,WAAW,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE;CAC/F,CAAC;AAEF,MAAM,UAAU,GAAG,gCAAgC,CAAC;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C;QAClD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAC;QACxE,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK,IAAmB,EAAE;QAC5C,IAAI,CAAC;YACD,MAAM,OAAO,CAAC,IAAY,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAC;QACzE,CAAC;IACL,CAAC,CAAC;IAEF,kBAAkB,CAAC,IAAY,EAAE,CAAC,IAAiB,EAAE,EAAE;QACnD,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,YAAY,CAAC,kBAAkB,EAAE,EAAE,YAAY,CAAC,CAAC;YACjD,OAAO;QACX,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,YAAY,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE,aAAa,CAAC,CAAC;YAC3E,OAAO;QACX,CAAC;QACD,aAAa,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,17 @@ import { type AutoScanInputs, type AutoScanResult } from './auto-scan.js';
2
2
  import { type EmbedParseResult, EmbedRenderError, type EmbedRenderOptions } from './pipeline.js';
3
3
  import { type EmbedTheme } from './theme.js';
4
4
  export { type AutoScanResult, type EmbedParseResult, EmbedRenderError, type EmbedTheme };
5
+ /**
6
+ * Bundle provenance, mirroring the legal-comment banner that
7
+ * `scripts/bundle.mjs` injects at the top of every artifact:
8
+ * `@nowline/embed <version> sha=<short-sha> built=<iso-utc>`.
9
+ *
10
+ * Exposed on the IIFE global as `nowline.version` / `nowline.sha` so
11
+ * pages and bug reports can identify the exact build without scraping
12
+ * the comment banner.
13
+ */
14
+ export declare const version: string;
15
+ export declare const sha: string;
5
16
  export interface InitializeOptions {
6
17
  /** `light`, `dark`, or `auto` (read once via `prefers-color-scheme`). */
7
18
  theme?: EmbedTheme;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,cAAc,EAEtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEH,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,kBAAkB,EAG1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,UAAU,EAAsC,MAAM,YAAY,CAAC;AAEjF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,CAAC;AAIzF,MAAM,WAAW,iBAAiB;IAC9B,yEAAyE;IACzE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,KAAK,CAAC,EAAE,IAAI,CAAC;CAChB;AAuBD,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,IAAI,CAchE;AAYD;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9F;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAErE;AAED;;;GAGG;AACH,wBAAsB,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAA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,CAAC,CAErE;AAED;;;GAGG;AACH,wBAAsB,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAUvF;AAED,4DAA4D;AAC5D,eAAO,MAAM,GAAG,aAAO,CAAC;AAkDxB,wBAAgB,eAAe,IAAI,IAAI,CAKtC"}
package/dist/index.js CHANGED
@@ -4,10 +4,22 @@
4
4
  //
5
5
  // The IIFE bundle exposes everything below as `window.nowline.*`. ESM
6
6
  // consumers import named exports from the package root.
7
+ import { EMBED_SHA, EMBED_VERSION } from './auth/env.js';
7
8
  import { __resetAutoScanForTests, runAutoScan, } from './auto-scan.js';
8
9
  import { __resetEmbedPipelineForTests, EmbedRenderError, parseSource, renderSource, } from './pipeline.js';
9
10
  import { effectiveTheme, resolveSystemTheme } from './theme.js';
10
11
  export { EmbedRenderError };
12
+ /**
13
+ * Bundle provenance, mirroring the legal-comment banner that
14
+ * `scripts/bundle.mjs` injects at the top of every artifact:
15
+ * `@nowline/embed <version> sha=<short-sha> built=<iso-utc>`.
16
+ *
17
+ * Exposed on the IIFE global as `nowline.version` / `nowline.sha` so
18
+ * pages and bug reports can identify the exact build without scraping
19
+ * the comment banner.
20
+ */
21
+ export const version = EMBED_VERSION;
22
+ export const sha = EMBED_SHA;
11
23
  const DEFAULT_SELECTOR = 'pre code.language-nowline, code.language-nowline';
12
24
  const initialConfig = {
13
25
  theme: 'auto',
@@ -90,6 +102,22 @@ export const run = init;
90
102
  // the auto-scan branch.
91
103
  if (typeof document !== 'undefined' && !autoStartScheduled) {
92
104
  autoStartScheduled = true;
105
+ // Dev-only Firebase Auth gate (embed.nowline.dev). The condition
106
+ // reads `__NOWLINE_EMBED_ENV__` directly so esbuild's `define`
107
+ // substitutes a literal string at minify time — the prod bundle
108
+ // sees `if ("prod" === "dev")` → `if (false)` and DCEs the dynamic
109
+ // import that pulls in `firebase/app` + `firebase/auth`.
110
+ // `check-size.mjs` asserts no `firebase` literal survives in the
111
+ // prod IIFE as a belt-and-suspenders check.
112
+ if (typeof __NOWLINE_EMBED_ENV__ !== 'undefined' && __NOWLINE_EMBED_ENV__ === 'dev') {
113
+ void import('./auth/firebase-auth.client.js')
114
+ .then(({ startDevAuthGate }) => {
115
+ startDevAuthGate();
116
+ })
117
+ .catch((err) => {
118
+ console.error('[nowline] dev auth gate failed to load:', err);
119
+ });
120
+ }
93
121
  const start = () => {
94
122
  if (!config.startOnLoad)
95
123
  return;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,uEAAuE;AACvE,0CAA0C;AAC1C,EAAE;AACF,sEAAsE;AACtE,wDAAwD;AAExD,OAAO,EACH,uBAAuB,EAGvB,WAAW,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,4BAA4B,EAE5B,gBAAgB,EAEhB,WAAW,EACX,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAmB,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,EAA8C,gBAAgB,EAAmB,CAAC;AAEzF,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;AAqC5E,MAAM,aAAa,GAAmB;IAClC,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,kBAAkB,EAAE;CACpC,CAAC;AAEF,IAAI,MAAM,GAAmB,EAAE,GAAG,aAAa,EAAE,CAAC;AAClD,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,UAA6B,EAAE;IACtD,MAAM,GAAG;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;QACpC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW;QACtD,QAAQ,EAAE,OAAO,CAAC,QA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