@ably/ui 18.1.0 → 18.3.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.
package/index.d.ts CHANGED
@@ -304,14 +304,6 @@ export default Button;
304
304
  //# sourceMappingURL=Button.d.ts.map
305
305
  }
306
306
 
307
- declare module '@ably/ui/core/Code/Code.test' {
308
- /**
309
- * @vitest-environment jsdom
310
- */
311
- export {};
312
- //# sourceMappingURL=Code.test.d.ts.map
313
- }
314
-
315
307
  declare module '@ably/ui/core/Code/component' {
316
308
  export default highlightEl;
317
309
  function highlightEl(el: any): void;
@@ -348,14 +340,6 @@ export default ApiKeySelector;
348
340
  //# sourceMappingURL=ApiKeySelector.d.ts.map
349
341
  }
350
342
 
351
- declare module '@ably/ui/core/CodeSnippet/CodeSnippet.test' {
352
- /**
353
- * @vitest-environment jsdom
354
- */
355
- export {};
356
- //# sourceMappingURL=CodeSnippet.test.d.ts.map
357
- }
358
-
359
343
  declare module '@ably/ui/core/CodeSnippet/CopyButton' {
360
344
  type CopyButtonProps = {
361
345
  onCopy: () => void;
@@ -430,11 +414,6 @@ export default languages;
430
414
  //# sourceMappingURL=languages.d.ts.map
431
415
  }
432
416
 
433
- declare module '@ably/ui/core/CodeSnippet/languages.test' {
434
- export {};
435
- //# sourceMappingURL=languages.test.d.ts.map
436
- }
437
-
438
417
  declare module '@ably/ui/core/CodeSnippet' {
439
418
  import React from "react";
440
419
  import { SDKType } from "@ably/ui/core/CodeSnippet/languages";
@@ -6321,14 +6300,6 @@ export function useThemedScrollpoints(scrollpoints: ThemedScrollpoint[]): string
6321
6300
  //# sourceMappingURL=use-themed-scrollpoints.d.ts.map
6322
6301
  }
6323
6302
 
6324
- declare module '@ably/ui/core/hooks/use-themed-scrollpoints.test' {
6325
- /**
6326
- * @vitest-environment jsdom
6327
- */
6328
- export {};
6329
- //# sourceMappingURL=use-themed-scrollpoints.test.d.ts.map
6330
- }
6331
-
6332
6303
  declare module '@ably/ui/core/insights/command-queue' {
6333
6304
  import { AnalyticsService, InsightsConfig, InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
6334
6305
  export class InsightsCommandQueue implements AnalyticsService {
@@ -6345,8 +6316,6 @@ export class InsightsCommandQueue implements AnalyticsService {
6345
6316
  identify(_identity: InsightsIdentity): void;
6346
6317
  trackPageView(_options?: TrackPageViewOptions): void;
6347
6318
  track(_event: string, _properties?: Record<string, unknown>): void;
6348
- startSessionRecording(): void;
6349
- stopSessionRecording(): void;
6350
6319
  setupObserver(): () => void;
6351
6320
  }
6352
6321
  //# sourceMappingURL=command-queue.d.ts.map
@@ -6372,20 +6341,10 @@ export const disableDebugMode: () => void;
6372
6341
  export const identify: (identity: InsightsIdentity) => void;
6373
6342
  export const trackPageView: (options?: TrackPageViewOptions) => void;
6374
6343
  export const track: (event: string, properties?: Record<string, unknown>) => void;
6375
- export const startSessionRecording: () => void;
6376
- export const stopSessionRecording: () => void;
6377
6344
  export const setupObserver: () => () => void;
6378
6345
  //# sourceMappingURL=index.d.ts.map
6379
6346
  }
6380
6347
 
6381
- declare module '@ably/ui/core/insights/index.test' {
6382
- /**
6383
- * @vitest-environment jsdom
6384
- */
6385
- export {};
6386
- //# sourceMappingURL=index.test.d.ts.map
6387
- }
6388
-
6389
6348
  declare module '@ably/ui/core/insights/logger' {
6390
6349
  export const debug: (...args: unknown[]) => void;
6391
6350
  export const info: (...args: unknown[]) => void;
@@ -6396,25 +6355,16 @@ export const error: (...args: unknown[]) => void;
6396
6355
 
6397
6356
  declare module '@ably/ui/core/insights/mixpanel' {
6398
6357
  import { InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
6399
- export const initMixpanel: (token: string, autoCapture?: boolean, debug?: boolean, recordSessionsPercent?: number) => void;
6358
+ export const MIXPANEL_EU_API_HOST = "https://api-eu.mixpanel.com";
6359
+ export const initMixpanel: (token: string, autoCapture?: boolean, debug?: boolean, apiHost?: string) => void;
6400
6360
  export const enableDebugMode: () => void;
6401
6361
  export const disableDebugMode: () => void;
6402
6362
  export const identify: ({ userId, accountId, organisationId, email, name, ...properties }: InsightsIdentity) => void;
6403
6363
  export const trackPageView: (properties?: TrackPageViewOptions) => void;
6404
6364
  export const track: (event: string, properties?: Record<string, unknown>) => void;
6405
- export const startSessionRecording: () => void;
6406
- export const stopSessionRecording: () => void;
6407
6365
  //# sourceMappingURL=mixpanel.d.ts.map
6408
6366
  }
6409
6367
 
6410
- declare module '@ably/ui/core/insights/mixpanel.test' {
6411
- /**
6412
- * @vitest-environment jsdom
6413
- */
6414
- export {};
6415
- //# sourceMappingURL=mixpanel.test.d.ts.map
6416
- }
6417
-
6418
6368
  declare module '@ably/ui/core/insights/posthog' {
6419
6369
  import { InsightsIdentity } from "@ably/ui/core/types";
6420
6370
  export const initPosthog: (apiKey: string, apiHost: string) => void;
@@ -6423,31 +6373,19 @@ export const disableDebugMode: () => void;
6423
6373
  export const identify: ({ userId, accountId, organisationId, email, name, ...properties }: InsightsIdentity) => void;
6424
6374
  export const trackPageView: (properties?: Record<string, unknown>) => void;
6425
6375
  export const track: (event: string, properties?: Record<string, unknown>) => void;
6426
- export const startSessionRecording: () => void;
6427
- export const stopSessionRecording: () => void;
6428
6376
  //# sourceMappingURL=posthog.d.ts.map
6429
6377
  }
6430
6378
 
6431
- declare module '@ably/ui/core/insights/posthog.test' {
6432
- /**
6433
- * @vitest-environment jsdom
6434
- */
6435
- export {};
6436
- //# sourceMappingURL=posthog.test.d.ts.map
6437
- }
6438
-
6439
6379
  declare module '@ably/ui/core/insights/service' {
6440
6380
  import type { AnalyticsService, InsightsConfig, InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
6441
6381
  export class InsightsService implements AnalyticsService {
6442
6382
  private debugMode;
6443
- initInsights({ mixpanelToken, mixpanelAutoCapture, mixpanelRecordSessionsPercent, posthogApiKey, posthogApiHost, debug, }: InsightsConfig): void;
6383
+ initInsights({ mixpanelToken, mixpanelAutoCapture, mixpanelApiHost, posthogApiKey, posthogApiHost, debug, }: InsightsConfig): void;
6444
6384
  enableDebugMode(): void;
6445
6385
  disableDebugMode(): void;
6446
6386
  identify(identity: InsightsIdentity): void;
6447
6387
  trackPageView(options?: TrackPageViewOptions): void;
6448
6388
  track(event: string, properties?: Record<string, unknown>): void;
6449
- startSessionRecording(): void;
6450
- stopSessionRecording(): void;
6451
6389
  setupObserver(): () => void;
6452
6390
  }
6453
6391
  //# sourceMappingURL=service.d.ts.map
@@ -6458,7 +6396,7 @@ export type InsightsConfig = {
6458
6396
  debug: boolean;
6459
6397
  mixpanelToken: string;
6460
6398
  mixpanelAutoCapture: boolean;
6461
- mixpanelRecordSessionsPercent: number;
6399
+ mixpanelApiHost?: string;
6462
6400
  posthogApiKey: string;
6463
6401
  posthogApiHost: string;
6464
6402
  };
@@ -6469,8 +6407,6 @@ export interface AnalyticsService {
6469
6407
  identify: (identity: InsightsIdentity) => void;
6470
6408
  trackPageView: (options?: TrackPageViewOptions) => void;
6471
6409
  track: (event: string, properties?: Record<string, unknown>) => void;
6472
- startSessionRecording: () => void;
6473
- stopSessionRecording: () => void;
6474
6410
  setupObserver: () => () => void;
6475
6411
  }
6476
6412
  export type Command = {
@@ -6602,6 +6538,50 @@ export const componentMaxHeight: (...heights: number[]) => string;
6602
6538
  //# sourceMappingURL=heights.d.ts.map
6603
6539
  }
6604
6540
 
6541
+ declare module '@ably/ui/core/utils/sanitize-html' {
6542
+ /**
6543
+ * sanitizeInlineMarkup — tightest allowlist, intended for short pieces of
6544
+ * trusted-but-defence-in-depthed text (flash messages, banner bodies that
6545
+ * already went through Rails sanitisation). Only inline links to same-origin
6546
+ * paths survive.
6547
+ *
6548
+ * Use this for surfaces where the producer (Rails helper, backend flash)
6549
+ * already sanitised the input and React-side sanitisation is the second
6550
+ * layer of defence.
6551
+ */
6552
+ export const sanitizeInlineMarkup: (input: string | null | undefined) => string;
6553
+ /**
6554
+ * sanitizeRichText — mirror of DashboardNoticeHelper::SANITISE_TAGS on the
6555
+ * Rails side. Use for content that an admin types as light HTML (banner
6556
+ * body text, dashboard notices). Keeps href so links work; same-origin URI
6557
+ * restriction prevents the URI from carrying a script payload.
6558
+ *
6559
+ * Tag set deliberately matches the server-side allowlist so the trust
6560
+ * boundary is identical regardless of which side did the rendering.
6561
+ */
6562
+ export const sanitizeRichText: (input: string | null | undefined) => string;
6563
+ /**
6564
+ * sanitizeMarketingHtml — wider allowlist for Contentful-sourced marketing
6565
+ * content (the `ContentfulBlockHtml` escape-hatch field). Trust boundary is
6566
+ * "compromised Contentful editor account" — wider than inline/rich-text but
6567
+ * still blocks scripts, event handlers, and non-http(s) URIs.
6568
+ *
6569
+ * Not suitable for the Ghost blog body. A survey of all 396 published Ably
6570
+ * blog posts (built locally against Ghost) shows the body legitimately
6571
+ * contains HubSpot CTA scripts (~70 posts), Twitter widget scripts, YouTube
6572
+ * and Vimeo iframes (~50), and inline SVG diagrams (~130). Sanitising those
6573
+ * with this allowlist would silently break the site. Ghost body is treated
6574
+ * as a trusted-CMS surface in the ADR — editor account control is the
6575
+ * security boundary.
6576
+ *
6577
+ * Marketing copy needs headings, lists, code blocks, blockquotes, and
6578
+ * external links, so the URI rule allows http(s) instead of being clamped
6579
+ * to relative paths.
6580
+ */
6581
+ export const sanitizeMarketingHtml: (input: string | null | undefined) => string;
6582
+ //# sourceMappingURL=sanitize-html.d.ts.map
6583
+ }
6584
+
6605
6585
  declare module '@ably/ui/core/utils/syntax-highlighter-registry' {
6606
6586
  export default registry;
6607
6587
  const registry: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "18.1.0",
3
+ "version": "18.3.1",
4
4
  "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,11 +37,12 @@
37
37
  "@types/react": "^18.3.1",
38
38
  "@types/react-dom": "^18.3.0",
39
39
  "@types/svg-sprite": "^0.0.39",
40
- "@typescript-eslint/eslint-plugin": "^8.59.0",
41
- "@typescript-eslint/parser": "^8.59.0",
40
+ "@typescript-eslint/eslint-plugin": "^8.61.0",
41
+ "@typescript-eslint/parser": "^8.61.0",
42
42
  "@vitejs/plugin-react-swc": "^4.3.0",
43
- "@vitest/browser": "3.2.4",
44
- "@vitest/coverage-v8": "3.2.4",
43
+ "@vitest/browser": "^4.1.8",
44
+ "@vitest/browser-playwright": "^4.1.8",
45
+ "@vitest/coverage-v8": "^4.1.8",
45
46
  "autoprefixer": "^10.5.0",
46
47
  "eslint": "^8.57.1",
47
48
  "eslint-config-prettier": "^10.1.8",
@@ -49,15 +50,15 @@
49
50
  "eslint-plugin-react": "^7.35.0",
50
51
  "eslint-plugin-react-hooks": "^7.1.1",
51
52
  "eslint-plugin-react-perf": "^3.3.3",
52
- "eslint-plugin-storybook": "^10.3.3",
53
+ "eslint-plugin-storybook": "^10.4.0",
53
54
  "heroicons": "^2.2.0",
54
55
  "http-server": "14.1.1",
55
56
  "jsdom": "^29.1.0",
56
- "mixpanel-browser": "^2.78.0",
57
+ "mixpanel-browser": "^2.79.0",
57
58
  "msw": "2.14.3",
58
59
  "msw-storybook-addon": "^2.0.7",
59
- "playwright": "^1.59.1",
60
- "posthog-js": "1.372.3",
60
+ "playwright": "^1.60.0",
61
+ "posthog-js": "1.383.3",
61
62
  "prettier": "^3.8.0",
62
63
  "storybook": "^10.4.0",
63
64
  "svg-sprite": "^2.0.4",
@@ -65,7 +66,7 @@
65
66
  "ts-node": "^10.9.2",
66
67
  "typescript": "6.0.2",
67
68
  "vite": "^7.3.2",
68
- "vitest": "^3.2.4"
69
+ "vitest": "^4.1.8"
69
70
  },
70
71
  "dependencies": {
71
72
  "@heroicons/react": "^2.2.0",
@@ -78,7 +79,7 @@
78
79
  "@radix-ui/react-tooltip": "^1.2.8",
79
80
  "array-flat-polyfill": "^1.0.1",
80
81
  "clsx": "^2.1.1",
81
- "dompurify": "^3.4.0",
82
+ "dompurify": "^3.4.9",
82
83
  "embla-carousel": "^8.6.0",
83
84
  "embla-carousel-autoplay": "^8.6.0",
84
85
  "embla-carousel-react": "^8.6.0",