@burdenoff/fe-libs 2026.1021.11 → 2026.1021.13

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,21 @@
1
+ /**
2
+ * Route patterns on which Rybbit must send nothing (G27).
3
+ *
4
+ * The syntax is Rybbit's own `data-skip-patterns` syntax, so one list drives
5
+ * both halves of the gate: RybbitSink hands it to the Rybbit script (which then
6
+ * sends no pageview or event while the URL matches) and applies it itself
7
+ * before injecting the script and before forwarding a bus event.
8
+ *
9
+ * - `*` matches one path segment: `/shared/*` matches `/shared/abc`, not `/shared/a/b`.
10
+ * - `**` matches any number of segments: `/share/**` matches `/share/a/b`.
11
+ * - `re:<regex>` is a raw regular expression tested against the pathname.
12
+ *
13
+ * Patterns are anchored at both ends, the same as Rybbit's matcher.
14
+ */
15
+ /** Compile one skip pattern exactly as the Rybbit script does. */
16
+ export declare function compileRybbitRoutePattern(pattern: string): RegExp;
17
+ /**
18
+ * True when `pathname` matches any pattern. An invalid pattern never matches
19
+ * (Rybbit logs and skips it too), so one typo cannot silence a whole shell.
20
+ */
21
+ export declare function isRybbitSkippedRoute(pathname: string | undefined, patterns: readonly string[] | undefined): boolean;
@@ -0,0 +1,20 @@
1
+ //#region src/shared/events/sinks/rybbitRoutes.ts
2
+ var e = "\0DS\0", t = "\0SS\0";
3
+ function n(n) {
4
+ if (n.startsWith("re:")) {
5
+ let e = n.slice(3);
6
+ if (!e) throw Error("Empty regex pattern");
7
+ return new RegExp(e);
8
+ }
9
+ let r = n.replace(/\*\*/g, e).replace(/\*/g, t).replace(/[.+?^${}()|[\]\\]/g, "\\$&");
10
+ return r = r.split(`/${e}/`).join("/(?:.+/)?"), r = r.split(e).join(".*"), r = r.split(t).join("[^/]+"), RegExp(`^${r}$`);
11
+ }
12
+ function r(e, t) {
13
+ if (!e || !t || t.length === 0) return !1;
14
+ for (let r of t) try {
15
+ if (n(r).test(e)) return !0;
16
+ } catch {}
17
+ return !1;
18
+ }
19
+ //#endregion
20
+ export { n as compileRybbitRoutePattern, r as isRybbitSkippedRoute };
@@ -85,6 +85,24 @@ export interface AppShellConfig {
85
85
  * purpose is that a stranger can read it.
86
86
  */
87
87
  consentRouteDenylist?: (pathname: string) => boolean;
88
+ /**
89
+ * Extra event names this shell forwards to Rybbit (G27), ADDED to the
90
+ * platform allowlist (or to `observability.rybbit.allowlist` when the shell
91
+ * overrides it) instead of replacing it. Lets a shell ship a new product
92
+ * event without waiting for, or forking, the platform list. Adding a name is
93
+ * still the deliberate privacy act described in RYBBIT_FRONTEND_ANALYTICS.md;
94
+ * RybbitSink keeps stripping identifier and sensitive keys either way. Pass a
95
+ * module-level constant: a new array identity re-subscribes the sink.
96
+ */
97
+ rybbitEvents?: readonly BurdenoffEventName[];
98
+ /**
99
+ * Routes on which NOTHING is sent to Rybbit (G27): no script load, no
100
+ * pageview, no event. In Rybbit's skip-pattern syntax (`*` = one segment,
101
+ * `**` = any depth, `re:` = regex), e.g. `['/shared/*']` for FluidGrids'
102
+ * public workflow viewer. Independent of `consentRouteDenylist`, which only
103
+ * hides the consent prompt. Pass a module-level constant.
104
+ */
105
+ rybbitSkipRoutes?: readonly string[];
88
106
  /**
89
107
  * Maps a pathname to the tour `pageId` used when looking up tours.
90
108
  *
@@ -159,6 +177,14 @@ export interface AppShellObservabilityEnv {
159
177
  * element, they override sonner's stylesheet defaults.
160
178
  */
161
179
  export declare const RICH_TOAST_TOKEN_STYLE: CSSProperties;
180
+ /**
181
+ * Adds a shell's own Rybbit event names (`AppShellConfig.rybbitEvents`, G27) to
182
+ * the allowlist that resolved for it, keeping the base order and dropping
183
+ * duplicates. With no base allowlist RybbitSink would fall back to
184
+ * DEFAULT_RYBBIT_ALLOWLIST, so that fallback is the base the extras extend.
185
+ * Returns the input unchanged when there is nothing to add.
186
+ */
187
+ export declare function withShellRybbitEvents(config: AppShellObservabilityConfig, extraEvents: readonly BurdenoffEventName[] | undefined): AppShellObservabilityConfig;
162
188
  export declare function resolveAppShellObservabilityConfig(productSlug: string, env: AppShellObservabilityEnv): AppShellObservabilityConfig;
163
189
  export interface AppShellProviderProps {
164
190
  config: AppShellConfig;