@ably/ui 17.5.1 → 17.5.5-dev.2c7f8b5d
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/core/insights/command-queue.js +1 -1
- package/core/insights/command-queue.js.map +1 -1
- package/core/insights/datalayer.js +1 -1
- package/core/insights/datalayer.js.map +1 -1
- package/core/insights/index.js +1 -1
- package/core/insights/index.js.map +1 -1
- package/core/insights/index.test.js +1 -1
- package/core/insights/index.test.js.map +1 -1
- package/core/insights/mixpanel.js +1 -1
- package/core/insights/mixpanel.js.map +1 -1
- package/core/insights/service.js +1 -1
- package/core/insights/service.js.map +1 -1
- package/core/insights/types.js.map +1 -1
- package/core/react-renderer.js.map +1 -1
- package/core/styles.components.css +14 -0
- package/index.d.ts +587 -0
- package/package.json +3 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import{InsightsService}from"./service";import*as logger from"./logger";export class InsightsCommandQueue{executeInitInsights(config){this.debugMode=!!config.debug;if(this.debugMode){logger.debug("Initializing insights")}this.realImplementation=new InsightsService;this.realImplementation.initInsights(config);this.isInitialized=true;this.processQueue()}processQueue(){if(this.debugMode){logger.debug(`Processing ${this.queue.length} queued commands`)}while(this.queue.length>0){const cmd=this.queue.shift();if(cmd&&this.realImplementation&&typeof this.realImplementation[cmd.methodName]==="function"){try{if(this.debugMode){logger.debug(`Executing queued command: ${cmd.methodName}`,cmd.args)}const fn=this.realImplementation[cmd.methodName];fn.apply(this.realImplementation,cmd.args)}catch(e){if(this.debugMode){logger.error(`Error executing queued command: ${cmd.methodName}`,e)}}}}}initInsights(_config){}enableDebugMode(){}disableDebugMode(){}identify(_identity){}trackPageView(){}track(_event,_properties){}startSessionRecording(){}stopSessionRecording(){}setupObserver(){return()=>{}}constructor(){_define_property(this,"isInitialized",false);_define_property(this,"queue",[]);_define_property(this,"debugMode",false);_define_property(this,"realImplementation",null);return new Proxy(this,{get:(target,prop)=>{if(prop in target&&typeof target[prop]!=="function"){return target[prop]}return(...args)=>{if(!target.isInitialized||!target.realImplementation){if(prop==="initInsights"){target.executeInitInsights(args[0]);return}if(target.debugMode){logger.debug(`Queuing method call: ${String(prop)}`,args)}target.queue.push({methodName:prop,args});return}if(typeof target.realImplementation[prop]==="function"){return target.realImplementation[prop](...args)}}}})}}
|
|
1
|
+
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import{InsightsService}from"./service";import*as logger from"./logger";export class InsightsCommandQueue{executeInitInsights(config){this.debugMode=!!config.debug;if(this.debugMode){logger.debug("Initializing insights")}this.realImplementation=new InsightsService;this.realImplementation.initInsights(config);this.isInitialized=true;this.processQueue()}processQueue(){if(this.debugMode){logger.debug(`Processing ${this.queue.length} queued commands`)}while(this.queue.length>0){const cmd=this.queue.shift();if(cmd&&this.realImplementation&&typeof this.realImplementation[cmd.methodName]==="function"){try{if(this.debugMode){logger.debug(`Executing queued command: ${cmd.methodName}`,cmd.args)}const fn=this.realImplementation[cmd.methodName];fn.apply(this.realImplementation,cmd.args)}catch(e){if(this.debugMode){logger.error(`Error executing queued command: ${cmd.methodName}`,e)}}}}}initInsights(_config){}enableDebugMode(){}disableDebugMode(){}identify(_identity){}trackPageView(_options){}track(_event,_properties){}startSessionRecording(){}stopSessionRecording(){}setupObserver(){return()=>{}}constructor(){_define_property(this,"isInitialized",false);_define_property(this,"queue",[]);_define_property(this,"debugMode",false);_define_property(this,"realImplementation",null);return new Proxy(this,{get:(target,prop)=>{if(prop in target&&typeof target[prop]!=="function"){return target[prop]}return(...args)=>{if(!target.isInitialized||!target.realImplementation){if(prop==="initInsights"){target.executeInitInsights(args[0]);return}if(target.debugMode){logger.debug(`Queuing method call: ${String(prop)}`,args)}target.queue.push({methodName:prop,args});return}if(typeof target.realImplementation[prop]==="function"){return target.realImplementation[prop](...args)}}}})}}
|
|
2
2
|
//# sourceMappingURL=command-queue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/command-queue.ts"],"sourcesContent":["import {\n AnalyticsService,\n Command,\n InsightsConfig,\n InsightsIdentity,\n} from \"./types\";\nimport { InsightsService } from \"./service\";\nimport * as logger from \"./logger\";\n\n// Queue handler that will collect commands before initialization\nexport class InsightsCommandQueue implements AnalyticsService {\n private isInitialized: boolean = false;\n private queue: Command[] = [];\n private debugMode: boolean = false;\n private realImplementation: InsightsService | null = null;\n\n constructor() {\n // Create a proxy that will either queue commands or execute them directly\n return new Proxy(this, {\n get: (target: InsightsCommandQueue, prop:
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/command-queue.ts"],"sourcesContent":["import {\n AnalyticsService,\n Command,\n InsightsConfig,\n InsightsIdentity,\n TrackPageViewOptions,\n} from \"./types\";\nimport { InsightsService } from \"./service\";\nimport * as logger from \"./logger\";\n\n// Queue handler that will collect commands before initialization\nexport class InsightsCommandQueue implements AnalyticsService {\n private isInitialized: boolean = false;\n private queue: Command[] = [];\n private debugMode: boolean = false;\n private realImplementation: InsightsService | null = null;\n\n constructor() {\n // Create a proxy that will either queue commands or execute them directly\n return new Proxy(this, {\n get: (target: InsightsCommandQueue, prop: keyof InsightsCommandQueue) => {\n // Return actual properties of the queue\n if (prop in target && typeof target[prop] !== \"function\") {\n return target[prop];\n }\n\n // Return a function that either queues or executes the method call\n return (...args: unknown[]) => {\n if (!target.isInitialized || !target.realImplementation) {\n // Queue the command for later execution\n if (prop === \"initInsights\") {\n // Special handling for initInsights - execute it right away\n target.executeInitInsights(args[0] as InsightsConfig);\n return;\n }\n\n // For debug logging\n if (target.debugMode) {\n logger.debug(`Queuing method call: ${String(prop)}`, args);\n }\n\n target.queue.push({\n methodName: prop,\n args,\n });\n\n return;\n }\n\n // Execute the command immediately on the real implementation\n if (typeof target.realImplementation[prop] === \"function\") {\n return (\n target.realImplementation[prop] as (...args: unknown[]) => unknown\n )(...args);\n }\n };\n },\n });\n }\n\n // Special handling for init since it needs to happen right away\n private executeInitInsights(config: InsightsConfig): void {\n this.debugMode = !!config.debug;\n\n if (this.debugMode) {\n logger.debug(\"Initializing insights\");\n }\n\n // Create and initialize the real implementation\n this.realImplementation = new InsightsService();\n this.realImplementation.initInsights(config);\n\n // Mark as initialized and process the queue\n this.isInitialized = true;\n this.processQueue();\n }\n\n // Process all queued commands\n private processQueue(): void {\n if (this.debugMode) {\n logger.debug(`Processing ${this.queue.length} queued commands`);\n }\n\n while (this.queue.length > 0) {\n const cmd = this.queue.shift();\n if (\n cmd &&\n this.realImplementation &&\n typeof this.realImplementation[cmd.methodName] === \"function\"\n ) {\n try {\n if (this.debugMode) {\n logger.debug(\n `Executing queued command: ${cmd.methodName}`,\n cmd.args,\n );\n }\n\n const fn = this.realImplementation[cmd.methodName] as (\n ...args: unknown[]\n ) => unknown;\n\n // Execute the command with the real implementation\n fn.apply(this.realImplementation, cmd.args as unknown[]);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\n `Error executing queued command: ${cmd.methodName}`,\n e,\n );\n }\n }\n }\n }\n }\n\n // Implement all methods required by AnalyticsService to satisfy TypeScript\n // (These won't be called directly due to the proxy)\n initInsights(_config: InsightsConfig): void {}\n enableDebugMode(): void {}\n disableDebugMode(): void {}\n identify(_identity: InsightsIdentity): void {}\n trackPageView(_options?: TrackPageViewOptions): void {}\n track(_event: string, _properties?: Record<string, unknown>): void {}\n startSessionRecording(): void {}\n stopSessionRecording(): void {}\n setupObserver(): () => void {\n return () => {};\n }\n}\n"],"names":["InsightsService","logger","InsightsCommandQueue","executeInitInsights","config","debugMode","debug","realImplementation","initInsights","isInitialized","processQueue","queue","length","cmd","shift","methodName","args","fn","apply","e","error","_config","enableDebugMode","disableDebugMode","identify","_identity","trackPageView","_options","track","_event","_properties","startSessionRecording","stopSessionRecording","setupObserver","constructor","Proxy","get","target","prop","String","push"],"mappings":"o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Aaa,OAAuB,CAAQ,CAAC,CAC7CC,iBAAwB,CAAC,CACzBC,kBAAyB,CAAC,CAC1BC,SAASC,SAA2B,CAAQ,CAAC,CAC7CC,cAAcC,QAA+B,CAAQ,CAAC,CACtDC,MAAMC,MAAc,CAAEC,WAAqC,CAAQ,CAAC,CACpEC,uBAA8B,CAAC,CAC/BC,sBAA6B,CAAC,CAC9BC,eAA4B,CAC1B,MAAO,KAAO,CAChB,CA/GAC,aAAc,CALd,sBAAQzB,gBAAyB,OACjC,sBAAQE,QAAmB,EAAE,EAC7B,sBAAQN,YAAqB,OAC7B,sBAAQE,qBAA6C,MAInD,OAAO,IAAI4B,MAAM,IAAI,CAAE,CACrBC,IAAK,CAACC,OAA8BC,QAElC,GAAIA,QAAQD,QAAU,OAAOA,MAAM,CAACC,KAAK,GAAK,WAAY,CACxD,OAAOD,MAAM,CAACC,KAAK,AACrB,CAGA,MAAO,CAAC,GAAGtB,QACT,GAAI,CAACqB,OAAO5B,aAAa,EAAI,CAAC4B,OAAO9B,kBAAkB,CAAE,CAEvD,GAAI+B,OAAS,eAAgB,CAE3BD,OAAOlC,mBAAmB,CAACa,IAAI,CAAC,EAAE,EAClC,MACF,CAGA,GAAIqB,OAAOhC,SAAS,CAAE,CACpBJ,OAAOK,KAAK,CAAC,CAAC,qBAAqB,EAAEiC,OAAOD,MAAM,CAAC,CAAEtB,KACvD,CAEAqB,OAAO1B,KAAK,CAAC6B,IAAI,CAAC,CAChBzB,WAAYuB,KACZtB,IACF,GAEA,MACF,CAGA,GAAI,OAAOqB,OAAO9B,kBAAkB,CAAC+B,KAAK,GAAK,WAAY,CACzD,OAAO,AACLD,OAAO9B,kBAAkB,CAAC+B,KAAK,IAC5BtB,KACP,CACF,CACF,CACF,EACF,CAuEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const track=(event,properties)=>{if(typeof window==="undefined"){return}const dataLayer=window.dataLayer||[];window.dataLayer=dataLayer;window.dataLayer.push({event,...properties})};
|
|
1
|
+
export const track=(event,properties)=>{if(typeof window==="undefined"){return}const dataLayer=window.dataLayer||[];window.dataLayer=dataLayer;window.dataLayer.push({event,...properties})};export const trackPageView=()=>{track("client-side-route-change")};
|
|
2
2
|
//# sourceMappingURL=datalayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/datalayer.ts"],"sourcesContent":["declare global {\n interface Window {\n dataLayer: unknown[];\n }\n}\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const dataLayer = window.dataLayer || [];\n window.dataLayer = dataLayer;\n\n window.dataLayer.push({\n event,\n ...properties,\n });\n};\n"],"names":["track","event","properties","window","dataLayer","push"],"mappings":"AAMA,OAAO,MAAMA,MAAQ,CAACC,MAAeC,cACnC,GAAI,OAAOC,SAAW,YAAa,CACjC,MACF,CAEA,MAAMC,UAAYD,OAAOC,SAAS,EAAI,EAAE,AACxCD,CAAAA,OAAOC,SAAS,CAAGA,UAEnBD,OAAOC,SAAS,CAACC,IAAI,CAAC,CACpBJ,MACA,GAAGC,UAAU,AACf,EACF,CAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/datalayer.ts"],"sourcesContent":["declare global {\n interface Window {\n dataLayer: unknown[];\n }\n}\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const dataLayer = window.dataLayer || [];\n window.dataLayer = dataLayer;\n\n window.dataLayer.push({\n event,\n ...properties,\n });\n};\n\nexport const trackPageView = () => {\n track(\"client-side-route-change\");\n};\n"],"names":["track","event","properties","window","dataLayer","push","trackPageView"],"mappings":"AAMA,OAAO,MAAMA,MAAQ,CAACC,MAAeC,cACnC,GAAI,OAAOC,SAAW,YAAa,CACjC,MACF,CAEA,MAAMC,UAAYD,OAAOC,SAAS,EAAI,EAAE,AACxCD,CAAAA,OAAOC,SAAS,CAAGA,UAEnBD,OAAOC,SAAS,CAACC,IAAI,CAAC,CACpBJ,MACA,GAAGC,UAAU,AACf,EACF,CAAE,AAEF,QAAO,MAAMI,cAAgB,KAC3BN,MAAM,2BACR,CAAE"}
|
package/core/insights/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{InsightsCommandQueue}from"./command-queue";const insights=new InsightsCommandQueue;export const initInsights=config=>insights.initInsights(config);export const enableDebugMode=()=>insights.enableDebugMode();export const disableDebugMode=()=>insights.disableDebugMode();export const identify=identity=>insights.identify(identity);export const trackPageView=
|
|
1
|
+
import{InsightsCommandQueue}from"./command-queue";const insights=new InsightsCommandQueue;export const initInsights=config=>insights.initInsights(config);export const enableDebugMode=()=>insights.enableDebugMode();export const disableDebugMode=()=>insights.disableDebugMode();export const identify=identity=>insights.identify(identity);export const trackPageView=options=>insights.trackPageView(options);export const track=(event,properties)=>insights.track(event,properties);export const startSessionRecording=()=>insights.startSessionRecording();export const stopSessionRecording=()=>insights.stopSessionRecording();export const setupObserver=()=>insights.setupObserver();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/index.ts"],"sourcesContent":["import {\n InsightsConfig,\n InsightsIdentity,\n TrackPageViewOptions,\n} from \"./types\";\nimport { InsightsCommandQueue } from \"./command-queue\";\nexport type { InsightsConfig };\n\n// Hi and welcome 👋\n//\n// The insights code is written using a Command Queue, or Deferred Execution pattern.\n// This pattern is useful when you need to queue up actions that should wait until\n// some initialization is complete. In this case, we want to queue up all the analytics\n// commands until the analytics service is initialized. This way, we can ensure that\n// no analytics events are lost during the initialization process. It looks wildly\n// different than other parts of Ably UI, but if you squint you realise it looks very\n// much like the services it's wrapping.\n//\n// There are three pieces working together here:\n// - The `AnalyticsService` interface, which defines the public methods that the insights\n// service will expose.\n// - The `InsightsCommandQueue` class, which is the main entry point for the insights\n// service. It acts as a proxy that will either queue up commands or execute\n// them directly on the real implementation.\n// - The `InsightsService` class, which is the real implementation that will be used\n// after initialization. It's responsible for initializing the underlying analytics\n// services (Mixpanel, Posthog & the data layer) and executing the queued commands.\n\n// Create the singleton instance with the command queue pattern\nconst insights = new InsightsCommandQueue();\n\n// Export the methods with the same interface as before\nexport const initInsights = (config: InsightsConfig) =>\n insights.initInsights(config);\nexport const enableDebugMode = () => insights.enableDebugMode();\nexport const disableDebugMode = () => insights.disableDebugMode();\nexport const identify = (identity: InsightsIdentity) =>\n insights.identify(identity);\nexport const trackPageView = (options?: TrackPageViewOptions) =>\n insights.trackPageView(options);\nexport const track = (event: string, properties?: Record<string, unknown>) =>\n insights.track(event, properties);\nexport const startSessionRecording = () => insights.startSessionRecording();\nexport const stopSessionRecording = () => insights.stopSessionRecording();\nexport const setupObserver = () => insights.setupObserver();\n"],"names":["InsightsCommandQueue","insights","initInsights","config","enableDebugMode","disableDebugMode","identify","identity","trackPageView","options","track","event","properties","startSessionRecording","stopSessionRecording","setupObserver"],"mappings":"AAKA,OAASA,oBAAoB,KAAQ,iBAAkB,CAwBvD,MAAMC,SAAW,IAAID,oBAGrB,QAAO,MAAME,aAAe,AAACC,QAC3BF,SAASC,YAAY,CAACC,OAAQ,AAChC,QAAO,MAAMC,gBAAkB,IAAMH,SAASG,eAAe,EAAG,AAChE,QAAO,MAAMC,iBAAmB,IAAMJ,SAASI,gBAAgB,EAAG,AAClE,QAAO,MAAMC,SAAW,AAACC,UACvBN,SAASK,QAAQ,CAACC,SAAU,AAC9B,QAAO,MAAMC,cAAgB,AAACC,SAC5BR,SAASO,aAAa,CAACC,QAAS,AAClC,QAAO,MAAMC,MAAQ,CAACC,MAAeC,aACnCX,SAASS,KAAK,CAACC,MAAOC,WAAY,AACpC,QAAO,MAAMC,sBAAwB,IAAMZ,SAASY,qBAAqB,EAAG,AAC5E,QAAO,MAAMC,qBAAuB,IAAMb,SAASa,oBAAoB,EAAG,AAC1E,QAAO,MAAMC,cAAgB,IAAMd,SAASc,aAAa,EAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{describe,expect,beforeEach,afterEach,it,vi}from"vitest";import*as datalayer from"./datalayer";import*as mixpanel from"./mixpanel";import*as posthog from"./posthog";import*as logger from"./logger";import*as insights from"./index";vi.mock("./datalayer",()=>({track:vi.fn()}));vi.mock("./mixpanel",()=>({initMixpanel:vi.fn(),enableDebugMode:vi.fn(),disableDebugMode:vi.fn(),identify:vi.fn(),trackPageView:vi.fn(),track:vi.fn(),startSessionRecording:vi.fn(),stopSessionRecording:vi.fn()}));vi.mock("./posthog",()=>({initPosthog:vi.fn(),enableDebugMode:vi.fn(),disableDebugMode:vi.fn(),identify:vi.fn(),trackPageView:vi.fn(),track:vi.fn(),startSessionRecording:vi.fn(),stopSessionRecording:vi.fn()}));vi.mock("./logger",()=>({debug:vi.fn(),info:vi.fn(),warn:vi.fn(),error:vi.fn()}));describe("Insights Command Queue",()=>{const testConfig={debug:true,mixpanelToken:"test-token",mixpanelAutoCapture:false,mixpanelRecordSessionsPercent:10,posthogApiKey:"test-key",posthogApiHost:"test-host"};const testIdentity={userId:"user-123",accountId:"account-456",organisationId:"org-789",email:"test@example.com",name:"Test User"};beforeEach(()=>{vi.clearAllMocks();vi.resetModules()});afterEach(()=>{document.body.replaceWith(document.body.cloneNode(true))});describe("Pre-initialization Queueing",()=>{it("should queue methods called before initialization",async()=>{insights.track("early_event",{early:true});insights.identify(testIdentity);insights.trackPageView();expect(mixpanel.track).not.toHaveBeenCalled();expect(posthog.track).not.toHaveBeenCalled();expect(datalayer.track).not.toHaveBeenCalled();expect(mixpanel.identify).not.toHaveBeenCalled();expect(posthog.identify).not.toHaveBeenCalled();expect(mixpanel.trackPageView).not.toHaveBeenCalled();expect(posthog.trackPageView).not.toHaveBeenCalled();insights.initInsights(testConfig);expect(mixpanel.initMixpanel).toHaveBeenCalledWith(testConfig.mixpanelToken,testConfig.mixpanelAutoCapture,testConfig.debug,testConfig.mixpanelRecordSessionsPercent);expect(posthog.initPosthog).toHaveBeenCalledWith(testConfig.posthogApiKey,testConfig.posthogApiHost);expect(mixpanel.track).toHaveBeenCalledWith("early_event",{early:true});expect(posthog.track).toHaveBeenCalledWith("early_event",{early:true});expect(datalayer.track).toHaveBeenCalledWith("early_event",{early:true});expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);expect(posthog.identify).toHaveBeenCalledWith(testIdentity);expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled()});it("should handle errors in queued methods gracefully",async()=>{mixpanel.track.mockImplementationOnce(()=>{throw new Error("Mixpanel error")});insights.track("error_event",{error:true});insights.trackPageView();insights.initInsights(testConfig);expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Mixpanel"),expect.any(Error));expect(posthog.track).toHaveBeenCalledWith("error_event",{error:true});expect(datalayer.track).toHaveBeenCalledWith("error_event",{error:true});expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled()})});describe("Post-initialization Direct Execution",()=>{beforeEach(()=>{insights.initInsights(testConfig);vi.clearAllMocks()});it("should directly call methods after initialization",()=>{insights.track("post_init_event",{post:true});expect(mixpanel.track).toHaveBeenCalledWith("post_init_event",{post:true});expect(posthog.track).toHaveBeenCalledWith("post_init_event",{post:true});expect(datalayer.track).toHaveBeenCalledWith("post_init_event",{post:true})});it("should handle all exported methods correctly",()=>{insights.identify(testIdentity);expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);expect(posthog.identify).toHaveBeenCalledWith(testIdentity);insights.trackPageView();expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();insights.startSessionRecording();expect(mixpanel.startSessionRecording).toHaveBeenCalled();expect(posthog.startSessionRecording).toHaveBeenCalled();insights.stopSessionRecording();expect(mixpanel.stopSessionRecording).toHaveBeenCalled();expect(posthog.stopSessionRecording).toHaveBeenCalled();insights.enableDebugMode();expect(mixpanel.enableDebugMode).toHaveBeenCalled();expect(posthog.enableDebugMode).toHaveBeenCalled();insights.disableDebugMode();expect(mixpanel.disableDebugMode).toHaveBeenCalled();expect(posthog.disableDebugMode).toHaveBeenCalled()})});describe("Observer Setup",()=>{beforeEach(()=>{insights.initInsights(testConfig);vi.clearAllMocks()});it("should set up click event observer and track clicks",()=>{const cleanup=insights.setupObserver();const testElement=document.createElement("button");testElement.setAttribute("data-insight-event","button_clicked");testElement.setAttribute("data-insight-button-id","test-123");document.body.appendChild(testElement);testElement.click();expect(mixpanel.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});expect(posthog.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});expect(datalayer.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});cleanup();vi.clearAllMocks();testElement.click();expect(mixpanel.track).not.toHaveBeenCalled()});it("should handle nested elements correctly",()=>{insights.setupObserver();const parentElement=document.createElement("div");parentElement.setAttribute("data-insight-event","container_clicked");parentElement.setAttribute("data-insight-container-id","parent-container");const childElement=document.createElement("span");childElement.textContent="Click me";parentElement.appendChild(childElement);document.body.appendChild(parentElement);childElement.click();expect(mixpanel.track).toHaveBeenCalledWith("container_clicked",{containerId:"parent-container"})})});describe("Error Handling",()=>{it("should handle initialization errors gracefully",()=>{mixpanel.initMixpanel.mockImplementationOnce(()=>{throw new Error("Mixpanel init error")});expect(()=>{insights.initInsights(testConfig)}).not.toThrow();expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to initialize Mixpanel"),expect.any(Error))});it("should handle runtime errors in methods",()=>{insights.initInsights(testConfig);vi.clearAllMocks();mixpanel.track.mockImplementationOnce(()=>{throw new Error("Mixpanel track error")});posthog.track.mockImplementationOnce(()=>{throw new Error("Posthog track error")});expect(()=>{insights.track("error_test",{test:true})}).not.toThrow();expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Mixpanel"),expect.any(Error));expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Posthog"),expect.any(Error));expect(datalayer.track).toHaveBeenCalledWith("error_test",{test:true})})});describe("Debug Mode",()=>{it("should respect debug flag in config",()=>{insights.initInsights(testConfig);expect(logger.debug).toHaveBeenCalledWith(expect.stringContaining("Initializing insights"));vi.clearAllMocks();insights.track("debug_test",{debug:true});expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("Tracking event"),expect.objectContaining({event:"debug_test",properties:{debug:true}}))});it("should not log debug info when debug is false",()=>{insights.initInsights({...testConfig,debug:false});vi.clearAllMocks();insights.track("no_debug_test",{debug:false});expect(logger.info).not.toHaveBeenCalled()})})});
|
|
1
|
+
import{describe,expect,beforeEach,afterEach,it,vi}from"vitest";import*as datalayer from"./datalayer";import*as mixpanel from"./mixpanel";import*as posthog from"./posthog";import*as logger from"./logger";import*as insights from"./index";vi.mock("./datalayer",()=>({track:vi.fn(),trackPageView:vi.fn()}));vi.mock("./mixpanel",()=>({initMixpanel:vi.fn(),enableDebugMode:vi.fn(),disableDebugMode:vi.fn(),identify:vi.fn(),trackPageView:vi.fn(),track:vi.fn(),startSessionRecording:vi.fn(),stopSessionRecording:vi.fn()}));vi.mock("./posthog",()=>({initPosthog:vi.fn(),enableDebugMode:vi.fn(),disableDebugMode:vi.fn(),identify:vi.fn(),trackPageView:vi.fn(),track:vi.fn(),startSessionRecording:vi.fn(),stopSessionRecording:vi.fn()}));vi.mock("./logger",()=>({debug:vi.fn(),info:vi.fn(),warn:vi.fn(),error:vi.fn()}));describe("Insights Command Queue",()=>{const testConfig={debug:true,mixpanelToken:"test-token",mixpanelAutoCapture:false,mixpanelRecordSessionsPercent:10,posthogApiKey:"test-key",posthogApiHost:"test-host"};const testIdentity={userId:"user-123",accountId:"account-456",organisationId:"org-789",email:"test@example.com",name:"Test User"};beforeEach(()=>{vi.clearAllMocks();vi.resetModules()});afterEach(()=>{document.body.replaceWith(document.body.cloneNode(true))});describe("Pre-initialization Queueing",()=>{it("should queue methods called before initialization",async()=>{insights.track("early_event",{early:true});insights.identify(testIdentity);insights.trackPageView();expect(mixpanel.track).not.toHaveBeenCalled();expect(posthog.track).not.toHaveBeenCalled();expect(datalayer.track).not.toHaveBeenCalled();expect(mixpanel.identify).not.toHaveBeenCalled();expect(posthog.identify).not.toHaveBeenCalled();expect(mixpanel.trackPageView).not.toHaveBeenCalled();expect(posthog.trackPageView).not.toHaveBeenCalled();expect(datalayer.trackPageView).not.toHaveBeenCalled();insights.initInsights(testConfig);expect(mixpanel.initMixpanel).toHaveBeenCalledWith(testConfig.mixpanelToken,testConfig.mixpanelAutoCapture,testConfig.debug,testConfig.mixpanelRecordSessionsPercent);expect(posthog.initPosthog).toHaveBeenCalledWith(testConfig.posthogApiKey,testConfig.posthogApiHost);expect(mixpanel.track).toHaveBeenCalledWith("early_event",{early:true});expect(posthog.track).toHaveBeenCalledWith("early_event",{early:true});expect(datalayer.track).toHaveBeenCalledWith("early_event",{early:true});expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);expect(posthog.identify).toHaveBeenCalledWith(testIdentity);expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();expect(datalayer.trackPageView).not.toHaveBeenCalled()});it("should handle errors in queued methods gracefully",async()=>{mixpanel.track.mockImplementationOnce(()=>{throw new Error("Mixpanel error")});insights.track("error_event",{error:true});insights.trackPageView();insights.initInsights(testConfig);expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Mixpanel"),expect.any(Error));expect(posthog.track).toHaveBeenCalledWith("error_event",{error:true});expect(datalayer.track).toHaveBeenCalledWith("error_event",{error:true});expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();expect(datalayer.trackPageView).not.toHaveBeenCalled()});it("should report page view to GTM as well when includeDataLayer is true",()=>{insights.trackPageView({includeDataLayer:true});expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();expect(datalayer.trackPageView).toHaveBeenCalled()})});describe("Post-initialization Direct Execution",()=>{beforeEach(()=>{insights.initInsights(testConfig);vi.clearAllMocks()});it("should directly call methods after initialization",()=>{insights.track("post_init_event",{post:true});expect(mixpanel.track).toHaveBeenCalledWith("post_init_event",{post:true});expect(posthog.track).toHaveBeenCalledWith("post_init_event",{post:true});expect(datalayer.track).toHaveBeenCalledWith("post_init_event",{post:true})});it("should handle all exported methods correctly",()=>{insights.identify(testIdentity);expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);expect(posthog.identify).toHaveBeenCalledWith(testIdentity);insights.trackPageView();expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();expect(datalayer.trackPageView).not.toHaveBeenCalled();insights.startSessionRecording();expect(mixpanel.startSessionRecording).toHaveBeenCalled();expect(posthog.startSessionRecording).toHaveBeenCalled();insights.stopSessionRecording();expect(mixpanel.stopSessionRecording).toHaveBeenCalled();expect(posthog.stopSessionRecording).toHaveBeenCalled();insights.enableDebugMode();expect(mixpanel.enableDebugMode).toHaveBeenCalled();expect(posthog.enableDebugMode).toHaveBeenCalled();insights.disableDebugMode();expect(mixpanel.disableDebugMode).toHaveBeenCalled();expect(posthog.disableDebugMode).toHaveBeenCalled()});it("should report page view to GTM as well when includeDataLayer is true",()=>{insights.trackPageView({includeDataLayer:true});expect(mixpanel.trackPageView).toHaveBeenCalled();expect(posthog.trackPageView).toHaveBeenCalled();expect(datalayer.trackPageView).toHaveBeenCalled()})});describe("Observer Setup",()=>{beforeEach(()=>{insights.initInsights(testConfig);vi.clearAllMocks()});it("should set up click event observer and track clicks",()=>{const cleanup=insights.setupObserver();const testElement=document.createElement("button");testElement.setAttribute("data-insight-event","button_clicked");testElement.setAttribute("data-insight-button-id","test-123");document.body.appendChild(testElement);testElement.click();expect(mixpanel.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});expect(posthog.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});expect(datalayer.track).toHaveBeenCalledWith("button_clicked",{buttonId:"test-123"});cleanup();vi.clearAllMocks();testElement.click();expect(mixpanel.track).not.toHaveBeenCalled()});it("should handle nested elements correctly",()=>{insights.setupObserver();const parentElement=document.createElement("div");parentElement.setAttribute("data-insight-event","container_clicked");parentElement.setAttribute("data-insight-container-id","parent-container");const childElement=document.createElement("span");childElement.textContent="Click me";parentElement.appendChild(childElement);document.body.appendChild(parentElement);childElement.click();expect(mixpanel.track).toHaveBeenCalledWith("container_clicked",{containerId:"parent-container"})})});describe("Error Handling",()=>{it("should handle initialization errors gracefully",()=>{mixpanel.initMixpanel.mockImplementationOnce(()=>{throw new Error("Mixpanel init error")});expect(()=>{insights.initInsights(testConfig)}).not.toThrow();expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to initialize Mixpanel"),expect.any(Error))});it("should handle runtime errors in methods",()=>{insights.initInsights(testConfig);vi.clearAllMocks();mixpanel.track.mockImplementationOnce(()=>{throw new Error("Mixpanel track error")});posthog.track.mockImplementationOnce(()=>{throw new Error("Posthog track error")});expect(()=>{insights.track("error_test",{test:true})}).not.toThrow();expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Mixpanel"),expect.any(Error));expect(logger.error).toHaveBeenCalledWith(expect.stringContaining("Failed to track event in Posthog"),expect.any(Error));expect(datalayer.track).toHaveBeenCalledWith("error_test",{test:true})})});describe("Debug Mode",()=>{it("should respect debug flag in config",()=>{insights.initInsights(testConfig);expect(logger.debug).toHaveBeenCalledWith(expect.stringContaining("Initializing insights"));vi.clearAllMocks();insights.track("debug_test",{debug:true});expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("Tracking event"),expect.objectContaining({event:"debug_test",properties:{debug:true}}))});it("should not log debug info when debug is false",()=>{insights.initInsights({...testConfig,debug:false});vi.clearAllMocks();insights.track("no_debug_test",{debug:false});expect(logger.info).not.toHaveBeenCalled()})})});
|
|
2
2
|
//# sourceMappingURL=index.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/index.test.ts"],"sourcesContent":["/**\n * @vitest-environment jsdom\n */\n\nimport { describe, expect, beforeEach, afterEach, it, vi } from \"vitest\";\n\nimport * as datalayer from \"./datalayer\";\nimport * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport * as logger from \"./logger\";\nimport * as insights from \"./index\";\n\n// Mock the dependencies\nvi.mock(\"./datalayer\", () => ({\n track: vi.fn(),\n}));\n\nvi.mock(\"./mixpanel\", () => ({\n initMixpanel: vi.fn(),\n enableDebugMode: vi.fn(),\n disableDebugMode: vi.fn(),\n identify: vi.fn(),\n trackPageView: vi.fn(),\n track: vi.fn(),\n startSessionRecording: vi.fn(),\n stopSessionRecording: vi.fn(),\n}));\n\nvi.mock(\"./posthog\", () => ({\n initPosthog: vi.fn(),\n enableDebugMode: vi.fn(),\n disableDebugMode: vi.fn(),\n identify: vi.fn(),\n trackPageView: vi.fn(),\n track: vi.fn(),\n startSessionRecording: vi.fn(),\n stopSessionRecording: vi.fn(),\n}));\n\nvi.mock(\"./logger\", () => ({\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n}));\n\ndescribe(\"Insights Command Queue\", () => {\n const testConfig = {\n debug: true,\n mixpanelToken: \"test-token\",\n mixpanelAutoCapture: false,\n mixpanelRecordSessionsPercent: 10,\n posthogApiKey: \"test-key\",\n posthogApiHost: \"test-host\",\n };\n\n const testIdentity = {\n userId: \"user-123\",\n accountId: \"account-456\",\n organisationId: \"org-789\",\n email: \"test@example.com\",\n name: \"Test User\",\n };\n\n beforeEach(() => {\n // Clear all mocks before each test\n vi.clearAllMocks();\n\n // Reset the module to clear any internal state\n vi.resetModules();\n });\n\n afterEach(() => {\n // Cleanup document event listeners\n document.body.replaceWith(document.body.cloneNode(true));\n });\n\n describe(\"Pre-initialization Queueing\", () => {\n it(\"should queue methods called before initialization\", async () => {\n // Call methods before initialization\n insights.track(\"early_event\", { early: true });\n insights.identify(testIdentity);\n insights.trackPageView();\n\n // Verify nothing has been called yet on the underlying services\n expect(mixpanel.track).not.toHaveBeenCalled();\n expect(posthog.track).not.toHaveBeenCalled();\n expect(datalayer.track).not.toHaveBeenCalled();\n expect(mixpanel.identify).not.toHaveBeenCalled();\n expect(posthog.identify).not.toHaveBeenCalled();\n expect(mixpanel.trackPageView).not.toHaveBeenCalled();\n expect(posthog.trackPageView).not.toHaveBeenCalled();\n\n // Now initialize\n insights.initInsights(testConfig);\n\n // Initialize should be called immediately\n expect(mixpanel.initMixpanel).toHaveBeenCalledWith(\n testConfig.mixpanelToken,\n testConfig.mixpanelAutoCapture,\n testConfig.debug,\n testConfig.mixpanelRecordSessionsPercent,\n );\n expect(posthog.initPosthog).toHaveBeenCalledWith(\n testConfig.posthogApiKey,\n testConfig.posthogApiHost,\n );\n\n // Queued methods should now be called in the correct order\n expect(mixpanel.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n expect(posthog.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n\n expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);\n expect(posthog.identify).toHaveBeenCalledWith(testIdentity);\n\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n });\n\n it(\"should handle errors in queued methods gracefully\", async () => {\n // Setup an error for one of the methods\n mixpanel.track.mockImplementationOnce(() => {\n throw new Error(\"Mixpanel error\");\n });\n\n // Call methods before initialization\n insights.track(\"error_event\", { error: true });\n insights.trackPageView();\n\n // Now initialize\n insights.initInsights(testConfig);\n\n // Should have logged the error but continued processing the queue\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Mixpanel\"),\n expect.any(Error),\n );\n\n // The other methods should still be called\n expect(posthog.track).toHaveBeenCalledWith(\"error_event\", {\n error: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"error_event\", {\n error: true,\n });\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n });\n });\n\n describe(\"Post-initialization Direct Execution\", () => {\n beforeEach(() => {\n // Initialize first\n insights.initInsights(testConfig);\n // Clear the mocks to focus on post-init behavior\n vi.clearAllMocks();\n });\n\n it(\"should directly call methods after initialization\", () => {\n // Call methods after initialization\n insights.track(\"post_init_event\", { post: true });\n\n // Should be called immediately\n expect(mixpanel.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n expect(posthog.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n });\n\n it(\"should handle all exported methods correctly\", () => {\n // Test each exported method\n insights.identify(testIdentity);\n expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);\n expect(posthog.identify).toHaveBeenCalledWith(testIdentity);\n\n insights.trackPageView();\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n\n insights.startSessionRecording();\n expect(mixpanel.startSessionRecording).toHaveBeenCalled();\n expect(posthog.startSessionRecording).toHaveBeenCalled();\n\n insights.stopSessionRecording();\n expect(mixpanel.stopSessionRecording).toHaveBeenCalled();\n expect(posthog.stopSessionRecording).toHaveBeenCalled();\n\n insights.enableDebugMode();\n expect(mixpanel.enableDebugMode).toHaveBeenCalled();\n expect(posthog.enableDebugMode).toHaveBeenCalled();\n\n insights.disableDebugMode();\n expect(mixpanel.disableDebugMode).toHaveBeenCalled();\n expect(posthog.disableDebugMode).toHaveBeenCalled();\n });\n });\n\n describe(\"Observer Setup\", () => {\n beforeEach(() => {\n insights.initInsights(testConfig);\n vi.clearAllMocks();\n });\n\n it(\"should set up click event observer and track clicks\", () => {\n // Setup observer\n const cleanup = insights.setupObserver();\n\n // Create a test element with insight attributes\n const testElement = document.createElement(\"button\");\n testElement.setAttribute(\"data-insight-event\", \"button_clicked\");\n testElement.setAttribute(\"data-insight-button-id\", \"test-123\");\n document.body.appendChild(testElement);\n\n // Simulate click\n testElement.click();\n\n // Should track the event\n expect(mixpanel.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n expect(posthog.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n\n // Test cleanup\n cleanup();\n\n // Reset tracking mocks\n vi.clearAllMocks();\n\n // Click again - should not track\n testElement.click();\n expect(mixpanel.track).not.toHaveBeenCalled();\n });\n\n it(\"should handle nested elements correctly\", () => {\n // Setup observer\n insights.setupObserver();\n\n // Create parent element with insight attributes\n const parentElement = document.createElement(\"div\");\n parentElement.setAttribute(\"data-insight-event\", \"container_clicked\");\n parentElement.setAttribute(\n \"data-insight-container-id\",\n \"parent-container\",\n );\n\n // Create child element without insights\n const childElement = document.createElement(\"span\");\n childElement.textContent = \"Click me\";\n\n // Nest elements\n parentElement.appendChild(childElement);\n document.body.appendChild(parentElement);\n\n // Click the child element\n childElement.click();\n\n // Should find and use the parent's insight attributes\n expect(mixpanel.track).toHaveBeenCalledWith(\"container_clicked\", {\n containerId: \"parent-container\",\n });\n });\n });\n\n describe(\"Error Handling\", () => {\n it(\"should handle initialization errors gracefully\", () => {\n // Setup an error in initialization\n mixpanel.initMixpanel.mockImplementationOnce(() => {\n throw new Error(\"Mixpanel init error\");\n });\n\n // Should not throw when initializing\n expect(() => {\n insights.initInsights(testConfig);\n }).not.toThrow();\n\n // Should log the error\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to initialize Mixpanel\"),\n expect.any(Error),\n );\n });\n\n it(\"should handle runtime errors in methods\", () => {\n // Initialize first\n insights.initInsights(testConfig);\n vi.clearAllMocks();\n\n // Setup errors in tracking\n mixpanel.track.mockImplementationOnce(() => {\n throw new Error(\"Mixpanel track error\");\n });\n\n posthog.track.mockImplementationOnce(() => {\n throw new Error(\"Posthog track error\");\n });\n\n // Should not throw when tracking\n expect(() => {\n insights.track(\"error_test\", { test: true });\n }).not.toThrow();\n\n // Should log the errors\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Mixpanel\"),\n expect.any(Error),\n );\n\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Posthog\"),\n expect.any(Error),\n );\n\n // Should still try to track with datalayer\n expect(datalayer.track).toHaveBeenCalledWith(\"error_test\", {\n test: true,\n });\n });\n });\n\n describe(\"Debug Mode\", () => {\n it(\"should respect debug flag in config\", () => {\n // Initialize with debug: true\n insights.initInsights(testConfig);\n\n // Should log debug messages\n expect(logger.debug).toHaveBeenCalledWith(\n expect.stringContaining(\"Initializing insights\"),\n );\n\n // Clear mocks and test tracking\n vi.clearAllMocks();\n insights.track(\"debug_test\", { debug: true });\n\n // Should log info about tracking\n expect(logger.info).toHaveBeenCalledWith(\n expect.stringContaining(\"Tracking event\"),\n expect.objectContaining({\n event: \"debug_test\",\n properties: { debug: true },\n }),\n );\n });\n\n it(\"should not log debug info when debug is false\", () => {\n // Initialize with debug: false\n insights.initInsights({\n ...testConfig,\n debug: false,\n });\n\n // Clear mocks and test tracking\n vi.clearAllMocks();\n insights.track(\"no_debug_test\", { debug: false });\n\n // Should not log info about tracking\n expect(logger.info).not.toHaveBeenCalled();\n });\n });\n});\n"],"names":["describe","expect","beforeEach","afterEach","it","vi","datalayer","mixpanel","posthog","logger","insights","mock","track","fn","initMixpanel","enableDebugMode","disableDebugMode","identify","trackPageView","startSessionRecording","stopSessionRecording","initPosthog","debug","info","warn","error","testConfig","mixpanelToken","mixpanelAutoCapture","mixpanelRecordSessionsPercent","posthogApiKey","posthogApiHost","testIdentity","userId","accountId","organisationId","email","name","clearAllMocks","resetModules","document","body","replaceWith","cloneNode","early","not","toHaveBeenCalled","initInsights","toHaveBeenCalledWith","mockImplementationOnce","Error","stringContaining","any","post","cleanup","setupObserver","testElement","createElement","setAttribute","appendChild","click","buttonId","parentElement","childElement","textContent","containerId","toThrow","test","objectContaining","event","properties"],"mappings":"AAIA,OAASA,QAAQ,CAAEC,MAAM,CAAEC,UAAU,CAAEC,SAAS,CAAEC,EAAE,CAAEC,EAAE,KAAQ,QAAS,AAEzE,WAAYC,cAAe,aAAc,AACzC,WAAYC,aAAc,YAAa,AACvC,WAAYC,YAAa,WAAY,AACrC,WAAYC,WAAY,UAAW,AACnC,WAAYC,aAAc,SAAU,CAGpCL,GAAGM,IAAI,CAAC,cAAe,IAAO,CAAA,CAC5BC,MAAOP,GAAGQ,EAAE,EACd,CAAA,GAEAR,GAAGM,IAAI,CAAC,aAAc,IAAO,CAAA,CAC3BG,aAAcT,GAAGQ,EAAE,GACnBE,gBAAiBV,GAAGQ,EAAE,GACtBG,iBAAkBX,GAAGQ,EAAE,GACvBI,SAAUZ,GAAGQ,EAAE,GACfK,cAAeb,GAAGQ,EAAE,GACpBD,MAAOP,GAAGQ,EAAE,GACZM,sBAAuBd,GAAGQ,EAAE,GAC5BO,qBAAsBf,GAAGQ,EAAE,EAC7B,CAAA,GAEAR,GAAGM,IAAI,CAAC,YAAa,IAAO,CAAA,CAC1BU,YAAahB,GAAGQ,EAAE,GAClBE,gBAAiBV,GAAGQ,EAAE,GACtBG,iBAAkBX,GAAGQ,EAAE,GACvBI,SAAUZ,GAAGQ,EAAE,GACfK,cAAeb,GAAGQ,EAAE,GACpBD,MAAOP,GAAGQ,EAAE,GACZM,sBAAuBd,GAAGQ,EAAE,GAC5BO,qBAAsBf,GAAGQ,EAAE,EAC7B,CAAA,GAEAR,GAAGM,IAAI,CAAC,WAAY,IAAO,CAAA,CACzBW,MAAOjB,GAAGQ,EAAE,GACZU,KAAMlB,GAAGQ,EAAE,GACXW,KAAMnB,GAAGQ,EAAE,GACXY,MAAOpB,GAAGQ,EAAE,EACd,CAAA,GAEAb,SAAS,yBAA0B,KACjC,MAAM0B,WAAa,CACjBJ,MAAO,KACPK,cAAe,aACfC,oBAA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OAAO,KACLS,SAASE,KAAK,CAAC,aAAc,CAAEuD,KAAM,IAAK,EAC5C,GAAGtB,GAAG,CAACqB,OAAO,GAGdjE,OAAOQ,OAAOgB,KAAK,EAAEuB,oBAAoB,CACvC/C,OAAOkD,gBAAgB,CAAC,qCACxBlD,OAAOmD,GAAG,CAACF,QAGbjD,OAAOQ,OAAOgB,KAAK,EAAEuB,oBAAoB,CACvC/C,OAAOkD,gBAAgB,CAAC,oCACxBlD,OAAOmD,GAAG,CAACF,QAIbjD,OAAOK,UAAUM,KAAK,EAAEoC,oBAAoB,CAAC,aAAc,CACzDmB,KAAM,IACR,EACF,EACF,GAEAnE,SAAS,aAAc,KACrBI,GAAG,sCAAuC,KAExCM,SAASqC,YAAY,CAACrB,YAGtBzB,OAAOQ,OAAOa,KAAK,EAAE0B,oBAAoB,CACvC/C,OAAOkD,gBAAgB,CAAC,0BAI1B9C,GAAGiC,aAAa,GAChB5B,SAASE,KAAK,CAAC,aAAc,CAAEU,MAAO,IAAK,GAG3CrB,OAAOQ,OAAOc,IAAI,EAAEyB,oBAAoB,CACtC/C,OAAOkD,gBAAgB,CAAC,kBACxBlD,OAAOmE,gBAAgB,CAAC,CACtBC,MAAO,aACPC,WAAY,CAAEhD,MAAO,IAAK,CAC5B,GAEJ,GAEAlB,GAAG,gDAAiD,KAElDM,SAASqC,YAAY,CAAC,CACpB,GAAGrB,UAAU,CACbJ,MAAO,KACT,GAGAjB,GAAGiC,aAAa,GAChB5B,SAASE,KAAK,CAAC,gBAAiB,CAAEU,MAAO,KAAM,GAG/CrB,OAAOQ,OAAOc,IAAI,EAAEsB,GAAG,CAACC,gBAAgB,EAC1C,EACF,EACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/index.test.ts"],"sourcesContent":["/**\n * @vitest-environment jsdom\n */\n\nimport { describe, expect, beforeEach, afterEach, it, vi, Mock } from \"vitest\";\n\nimport * as datalayer from \"./datalayer\";\nimport * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport * as logger from \"./logger\";\nimport * as insights from \"./index\";\n\n// Mock the dependencies\nvi.mock(\"./datalayer\", () => ({\n track: vi.fn(),\n trackPageView: vi.fn(),\n}));\n\nvi.mock(\"./mixpanel\", () => ({\n initMixpanel: vi.fn(),\n enableDebugMode: vi.fn(),\n disableDebugMode: vi.fn(),\n identify: vi.fn(),\n trackPageView: vi.fn(),\n track: vi.fn(),\n startSessionRecording: vi.fn(),\n stopSessionRecording: vi.fn(),\n}));\n\nvi.mock(\"./posthog\", () => ({\n initPosthog: vi.fn(),\n enableDebugMode: vi.fn(),\n disableDebugMode: vi.fn(),\n identify: vi.fn(),\n trackPageView: vi.fn(),\n track: vi.fn(),\n startSessionRecording: vi.fn(),\n stopSessionRecording: vi.fn(),\n}));\n\nvi.mock(\"./logger\", () => ({\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n}));\n\ndescribe(\"Insights Command Queue\", () => {\n const testConfig = {\n debug: true,\n mixpanelToken: \"test-token\",\n mixpanelAutoCapture: false,\n mixpanelRecordSessionsPercent: 10,\n posthogApiKey: \"test-key\",\n posthogApiHost: \"test-host\",\n };\n\n const testIdentity = {\n userId: \"user-123\",\n accountId: \"account-456\",\n organisationId: \"org-789\",\n email: \"test@example.com\",\n name: \"Test User\",\n };\n\n beforeEach(() => {\n // Clear all mocks before each test\n vi.clearAllMocks();\n\n // Reset the module to clear any internal state\n vi.resetModules();\n });\n\n afterEach(() => {\n // Cleanup document event listeners\n document.body.replaceWith(document.body.cloneNode(true));\n });\n\n describe(\"Pre-initialization Queueing\", () => {\n it(\"should queue methods called before initialization\", async () => {\n // Call methods before initialization\n insights.track(\"early_event\", { early: true });\n insights.identify(testIdentity);\n insights.trackPageView();\n\n // Verify nothing has been called yet on the underlying services\n expect(mixpanel.track).not.toHaveBeenCalled();\n expect(posthog.track).not.toHaveBeenCalled();\n expect(datalayer.track).not.toHaveBeenCalled();\n expect(mixpanel.identify).not.toHaveBeenCalled();\n expect(posthog.identify).not.toHaveBeenCalled();\n expect(mixpanel.trackPageView).not.toHaveBeenCalled();\n expect(posthog.trackPageView).not.toHaveBeenCalled();\n expect(datalayer.trackPageView).not.toHaveBeenCalled();\n\n // Now initialize\n insights.initInsights(testConfig);\n\n // Initialize should be called immediately\n expect(mixpanel.initMixpanel).toHaveBeenCalledWith(\n testConfig.mixpanelToken,\n testConfig.mixpanelAutoCapture,\n testConfig.debug,\n testConfig.mixpanelRecordSessionsPercent,\n );\n expect(posthog.initPosthog).toHaveBeenCalledWith(\n testConfig.posthogApiKey,\n testConfig.posthogApiHost,\n );\n\n // Queued methods should now be called in the correct order\n expect(mixpanel.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n expect(posthog.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"early_event\", {\n early: true,\n });\n\n expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);\n expect(posthog.identify).toHaveBeenCalledWith(testIdentity);\n\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n expect(datalayer.trackPageView).not.toHaveBeenCalled();\n });\n\n it(\"should handle errors in queued methods gracefully\", async () => {\n // Setup an error for one of the methods\n (mixpanel.track as Mock).mockImplementationOnce(() => {\n throw new Error(\"Mixpanel error\");\n });\n\n // Call methods before initialization\n insights.track(\"error_event\", { error: true });\n insights.trackPageView();\n\n // Now initialize\n insights.initInsights(testConfig);\n\n // Should have logged the error but continued processing the queue\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Mixpanel\"),\n expect.any(Error),\n );\n\n // The other methods should still be called\n expect(posthog.track).toHaveBeenCalledWith(\"error_event\", {\n error: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"error_event\", {\n error: true,\n });\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n expect(datalayer.trackPageView).not.toHaveBeenCalled();\n });\n\n it(\"should report page view to GTM as well when includeDataLayer is true\", () => {\n insights.trackPageView({ includeDataLayer: true });\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n expect(datalayer.trackPageView).toHaveBeenCalled();\n });\n });\n\n describe(\"Post-initialization Direct Execution\", () => {\n beforeEach(() => {\n // Initialize first\n insights.initInsights(testConfig);\n // Clear the mocks to focus on post-init behavior\n vi.clearAllMocks();\n });\n\n it(\"should directly call methods after initialization\", () => {\n // Call methods after initialization\n insights.track(\"post_init_event\", { post: true });\n\n // Should be called immediately\n expect(mixpanel.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n expect(posthog.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"post_init_event\", {\n post: true,\n });\n });\n\n it(\"should handle all exported methods correctly\", () => {\n // Test each exported method\n insights.identify(testIdentity);\n expect(mixpanel.identify).toHaveBeenCalledWith(testIdentity);\n expect(posthog.identify).toHaveBeenCalledWith(testIdentity);\n\n insights.trackPageView();\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n expect(datalayer.trackPageView).not.toHaveBeenCalled();\n\n insights.startSessionRecording();\n expect(mixpanel.startSessionRecording).toHaveBeenCalled();\n expect(posthog.startSessionRecording).toHaveBeenCalled();\n\n insights.stopSessionRecording();\n expect(mixpanel.stopSessionRecording).toHaveBeenCalled();\n expect(posthog.stopSessionRecording).toHaveBeenCalled();\n\n insights.enableDebugMode();\n expect(mixpanel.enableDebugMode).toHaveBeenCalled();\n expect(posthog.enableDebugMode).toHaveBeenCalled();\n\n insights.disableDebugMode();\n expect(mixpanel.disableDebugMode).toHaveBeenCalled();\n expect(posthog.disableDebugMode).toHaveBeenCalled();\n });\n\n it(\"should report page view to GTM as well when includeDataLayer is true\", () => {\n insights.trackPageView({ includeDataLayer: true });\n expect(mixpanel.trackPageView).toHaveBeenCalled();\n expect(posthog.trackPageView).toHaveBeenCalled();\n expect(datalayer.trackPageView).toHaveBeenCalled();\n });\n });\n\n describe(\"Observer Setup\", () => {\n beforeEach(() => {\n insights.initInsights(testConfig);\n vi.clearAllMocks();\n });\n\n it(\"should set up click event observer and track clicks\", () => {\n // Setup observer\n const cleanup = insights.setupObserver();\n\n // Create a test element with insight attributes\n const testElement = document.createElement(\"button\");\n testElement.setAttribute(\"data-insight-event\", \"button_clicked\");\n testElement.setAttribute(\"data-insight-button-id\", \"test-123\");\n document.body.appendChild(testElement);\n\n // Simulate click\n testElement.click();\n\n // Should track the event\n expect(mixpanel.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n expect(posthog.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n expect(datalayer.track).toHaveBeenCalledWith(\"button_clicked\", {\n buttonId: \"test-123\",\n });\n\n // Test cleanup\n cleanup();\n\n // Reset tracking mocks\n vi.clearAllMocks();\n\n // Click again - should not track\n testElement.click();\n expect(mixpanel.track).not.toHaveBeenCalled();\n });\n\n it(\"should handle nested elements correctly\", () => {\n // Setup observer\n insights.setupObserver();\n\n // Create parent element with insight attributes\n const parentElement = document.createElement(\"div\");\n parentElement.setAttribute(\"data-insight-event\", \"container_clicked\");\n parentElement.setAttribute(\n \"data-insight-container-id\",\n \"parent-container\",\n );\n\n // Create child element without insights\n const childElement = document.createElement(\"span\");\n childElement.textContent = \"Click me\";\n\n // Nest elements\n parentElement.appendChild(childElement);\n document.body.appendChild(parentElement);\n\n // Click the child element\n childElement.click();\n\n // Should find and use the parent's insight attributes\n expect(mixpanel.track).toHaveBeenCalledWith(\"container_clicked\", {\n containerId: \"parent-container\",\n });\n });\n });\n\n describe(\"Error Handling\", () => {\n it(\"should handle initialization errors gracefully\", () => {\n // Setup an error in initialization\n (mixpanel.initMixpanel as Mock).mockImplementationOnce(() => {\n throw new Error(\"Mixpanel init error\");\n });\n\n // Should not throw when initializing\n expect(() => {\n insights.initInsights(testConfig);\n }).not.toThrow();\n\n // Should log the error\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to initialize Mixpanel\"),\n expect.any(Error),\n );\n });\n\n it(\"should handle runtime errors in methods\", () => {\n // Initialize first\n insights.initInsights(testConfig);\n vi.clearAllMocks();\n\n // Setup errors in tracking\n (mixpanel.track as Mock).mockImplementationOnce(() => {\n throw new Error(\"Mixpanel track error\");\n });\n\n (posthog.track as Mock).mockImplementationOnce(() => {\n throw new Error(\"Posthog track error\");\n });\n\n // Should not throw when tracking\n expect(() => {\n insights.track(\"error_test\", { test: true });\n }).not.toThrow();\n\n // Should log the errors\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Mixpanel\"),\n expect.any(Error),\n );\n\n expect(logger.error).toHaveBeenCalledWith(\n expect.stringContaining(\"Failed to track event in Posthog\"),\n expect.any(Error),\n );\n\n // Should still try to track with datalayer\n expect(datalayer.track).toHaveBeenCalledWith(\"error_test\", {\n test: true,\n });\n });\n });\n\n describe(\"Debug Mode\", () => {\n it(\"should respect debug flag in config\", () => {\n // Initialize with debug: true\n insights.initInsights(testConfig);\n\n // Should log debug messages\n expect(logger.debug).toHaveBeenCalledWith(\n expect.stringContaining(\"Initializing insights\"),\n );\n\n // Clear mocks and test tracking\n vi.clearAllMocks();\n insights.track(\"debug_test\", { debug: true });\n\n // Should log info about tracking\n expect(logger.info).toHaveBeenCalledWith(\n expect.stringContaining(\"Tracking event\"),\n expect.objectContaining({\n event: \"debug_test\",\n properties: { debug: true },\n }),\n );\n });\n\n it(\"should not log debug info when debug is false\", () => {\n // Initialize with debug: false\n insights.initInsights({\n ...testConfig,\n debug: false,\n });\n\n // Clear mocks and test tracking\n vi.clearAllMocks();\n insights.track(\"no_debug_test\", { debug: false });\n\n // Should not log info about tracking\n expect(logger.info).not.toHaveBeenCalled();\n });\n });\n});\n"],"names":["describe","expect","beforeEach","afterEach","it","vi","datalayer","mixpanel","posthog","logger","insights","mock","track","fn","trackPageView","initMixpanel","enableDebugMode","disableDebugMode","identify","startSessionRecording","stopSessionRecording","initPosthog","debug","info","warn","error","testConfig","mixpanelToken","mixpanelAutoCapture","mixpanelRecordSessionsPercent","posthogApiKey","posthogApiHost","testIdentity","userId","accountId","organisationId","email","name","clearAllMocks","resetModules","document","body","replaceWith","cloneNode","early","not","toHaveBeenCalled","initInsights","toHaveBeenCalledWith","mockImplementationOnce","Error","stringContaining","any","includeDataLayer","post","cleanup","setupObserver","testElement","createElement","setAttribute","appendChild","click","buttonId","parentElement","childElement","textContent","containerId","toThrow","test","objectContaining","event","properties"],"mappings":"AAIA,OAASA,QAAQ,CAAEC,MAAM,CAAEC,UAAU,CAAEC,SAAS,CAAEC,EAAE,CAAEC,EAAE,KAAc,QAAS,AAE/E,WAAYC,cAAe,aAAc,AACzC,WAAYC,aAAc,YAAa,AACvC,WAAYC,YAAa,WAAY,AACrC,WAAYC,WAAY,UAAW,AACnC,WAAYC,aAAc,SAAU,CAGpCL,GAAGM,IAAI,CAAC,cAAe,IAAO,CAAA,CAC5BC,MAAOP,GAAGQ,EAAE,GACZC,cAAeT,GAAGQ,EAAE,EACtB,CAAA,GAEAR,GAAGM,IAAI,CAAC,aAAc,IAAO,CAAA,CAC3BI,aAAcV,GAAGQ,EAAE,GACnBG,gBAAiBX,GAAGQ,EAAE,GACtBI,iBAAkBZ,GAAGQ,EAAE,GACvBK,SAAUb,GAAGQ,EAAE,GACfC,cAAeT,GAAGQ,EAAE,GACpBD,MAAOP,GAAGQ,EAAE,GACZM,sBAAuBd,GAAGQ,EAAE,GAC5BO,qBAAsBf,GAAGQ,EAAE,EAC7B,CAAA,GAEAR,GAAGM,IAAI,CAAC,YAAa,IAAO,CAAA,CAC1BU,YAAahB,GAAGQ,EAAE,GAClBG,gBAAiBX,GAAGQ,EAAE,GACtBI,iBAAkBZ,GAAGQ,EAAE,GACvBK,SAAUb,GAAGQ,E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B,CACvC/C,OAAOkD,gBAAgB,CAAC,qCACxBlD,OAAOmD,GAAG,CAACF,QAGbjD,OAAOQ,OAAOgB,KAAK,EAAEuB,oBAAoB,CACvC/C,OAAOkD,gBAAgB,CAAC,oCACxBlD,OAAOmD,GAAG,CAACF,QAIbjD,OAAOK,UAAUM,KAAK,EAAEoC,oBAAoB,CAAC,aAAc,CACzDoB,KAAM,IACR,EACF,EACF,GAEApE,SAAS,aAAc,KACrBI,GAAG,sCAAuC,KAExCM,SAASqC,YAAY,CAACrB,YAGtBzB,OAAOQ,OAAOa,KAAK,EAAE0B,oBAAoB,CACvC/C,OAAOkD,gBAAgB,CAAC,0BAI1B9C,GAAGiC,aAAa,GAChB5B,SAASE,KAAK,CAAC,aAAc,CAAEU,MAAO,IAAK,GAG3CrB,OAAOQ,OAAOc,IAAI,EAAEyB,oBAAoB,CACtC/C,OAAOkD,gBAAgB,CAAC,kBACxBlD,OAAOoE,gBAAgB,CAAC,CACtBC,MAAO,aACPC,WAAY,CAAEjD,MAAO,IAAK,CAC5B,GAEJ,GAEAlB,GAAG,gDAAiD,KAElDM,SAASqC,YAAY,CAAC,CACpB,GAAGrB,UAAU,CACbJ,MAAO,KACT,GAGAjB,GAAGiC,aAAa,GAChB5B,SAASE,KAAK,CAAC,gBAAiB,CAAEU,MAAO,KAAM,GAG/CrB,OAAOQ,OAAOc,IAAI,EAAEsB,GAAG,CAACC,gBAAgB,EAC1C,EACF,EACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import mixpanel from"mixpanel-browser";export const initMixpanel=(token,autoCapture=false,debug=false,recordSessionsPercent=1)=>{const blockSelectors=["[ph-no-capture]",'[data-sl="mask"]'];if(!token){console.warn("Mixpanel token not provided, skipping initialization");return}mixpanel.init(token,{debug:debug,persistence:"localStorage",autocapture:autoCapture?{block_selectors:blockSelectors,capture_text_content:true}:false,track_pageview:false,record_sessions_percent:recordSessionsPercent,record_mask_text_selector:
|
|
1
|
+
import mixpanel from"mixpanel-browser";export const initMixpanel=(token,autoCapture=false,debug=false,recordSessionsPercent=1)=>{const blockSelectors=["[ph-no-capture]",'[data-sl="mask"]'];if(!token){console.warn("Mixpanel token not provided, skipping initialization");return}mixpanel.init(token,{debug:debug,persistence:"localStorage",autocapture:autoCapture?{block_selectors:blockSelectors,capture_text_content:true}:false,track_pageview:false,record_sessions_percent:recordSessionsPercent,record_mask_text_selector:undefined})};export const enableDebugMode=()=>{mixpanel.set_config({debug:true})};export const disableDebugMode=()=>{mixpanel.set_config({debug:false})};export const identify=({userId,accountId,organisationId,email,name})=>{if(!userId){return}mixpanel.identify(userId.toString());if(email||name){mixpanel.people.set({$email:email,$name:name})}if(accountId){mixpanel.people.union({accounts:[accountId.toString()]})}if(organisationId){mixpanel.people.set({organization_id:[organisationId.toString()]})}};const redactUrlSegments=()=>{const pathSegments=window.location.pathname.split("/");const redactedSegments=pathSegments.map(segment=>{return/^\d+$/.test(segment)?"{redacted}":segment});const url=new URL(window.location.href);url.pathname=redactedSegments.join("/");return decodeURI(url.toString()).toLowerCase()};export const trackPageView=()=>{mixpanel.track_pageview({redacted_path:redactUrlSegments()})};export const track=(event,properties)=>{mixpanel.track(event,properties)};export const startSessionRecording=()=>{mixpanel.start_session_recording()};export const stopSessionRecording=()=>{mixpanel.stop_session_recording()};
|
|
2
2
|
//# sourceMappingURL=mixpanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/mixpanel.ts"],"sourcesContent":["import mixpanel from \"mixpanel-browser\";\n\nimport { InsightsIdentity } from \"./types\";\n\nexport const initMixpanel = (\n token: string,\n autoCapture: boolean = false,\n debug: boolean = false,\n recordSessionsPercent = 1,\n) => {\n const blockSelectors = [\"[ph-no-capture]\", '[data-sl=\"mask\"]'];\n if (!token) {\n console.warn(\"Mixpanel token not provided, skipping initialization\");\n return;\n }\n\n mixpanel.init(token, {\n debug: debug,\n persistence: \"localStorage\",\n autocapture: autoCapture\n ? {\n block_selectors: blockSelectors,\n capture_text_content: true,\n }\n : false,\n track_pageview: false, // We'll track page views manually\n record_sessions_percent: recordSessionsPercent,\n record_mask_text_selector:
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/mixpanel.ts"],"sourcesContent":["import mixpanel from \"mixpanel-browser\";\n\nimport { InsightsIdentity } from \"./types\";\n\nexport const initMixpanel = (\n token: string,\n autoCapture: boolean = false,\n debug: boolean = false,\n recordSessionsPercent = 1,\n) => {\n const blockSelectors = [\"[ph-no-capture]\", '[data-sl=\"mask\"]'];\n if (!token) {\n console.warn(\"Mixpanel token not provided, skipping initialization\");\n return;\n }\n\n mixpanel.init(token, {\n debug: debug,\n persistence: \"localStorage\",\n autocapture: autoCapture\n ? {\n block_selectors: blockSelectors,\n capture_text_content: true,\n }\n : false,\n track_pageview: false, // We'll track page views manually\n record_sessions_percent: recordSessionsPercent,\n record_mask_text_selector: undefined, // Prevents all text from being masked - we have other masking configured/enabled\n });\n};\n\nexport const enableDebugMode = () => {\n mixpanel.set_config({ debug: true });\n};\n\nexport const disableDebugMode = () => {\n mixpanel.set_config({ debug: false });\n};\n\nexport const identify = ({\n userId,\n accountId,\n organisationId,\n email,\n name,\n}: InsightsIdentity) => {\n // In very rare cases we might have a user without an account, so we'll\n // let null/undefined/blank strings through on that one\n if (!userId) {\n return;\n }\n\n mixpanel.identify(userId.toString());\n\n if (email || name) {\n mixpanel.people.set({ $email: email, $name: name });\n }\n\n if (accountId) {\n mixpanel.people.union({ accounts: [accountId.toString()] });\n }\n\n if (organisationId) {\n mixpanel.people.set({ organization_id: [organisationId.toString()] });\n }\n};\n\n// Simple function to replace all digits in a URL path with {redacted},\n// purely to make reporting based on aggregates easier\nconst redactUrlSegments = () => {\n const pathSegments = window.location.pathname.split(\"/\");\n\n const redactedSegments = pathSegments.map((segment) => {\n // Check if the segment contains only digits\n return /^\\d+$/.test(segment) ? \"{redacted}\" : segment;\n });\n\n // Join the segments back together\n const url = new URL(window.location.href);\n url.pathname = redactedSegments.join(\"/\");\n\n return decodeURI(url.toString()).toLowerCase();\n};\n\nexport const trackPageView = () => {\n // Add the redacted URL to the page view event for reporting\n mixpanel.track_pageview({\n redacted_path: redactUrlSegments(),\n });\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n mixpanel.track(event, properties);\n};\n\nexport const startSessionRecording = () => {\n mixpanel.start_session_recording();\n};\n\nexport const stopSessionRecording = () => {\n mixpanel.stop_session_recording();\n};\n"],"names":["mixpanel","initMixpanel","token","autoCapture","debug","recordSessionsPercent","blockSelectors","console","warn","init","persistence","autocapture","block_selectors","capture_text_content","track_pageview","record_sessions_percent","record_mask_text_selector","undefined","enableDebugMode","set_config","disableDebugMode","identify","userId","accountId","organisationId","email","name","toString","people","set","$email","$name","union","accounts","organization_id","redactUrlSegments","pathSegments","window","location","pathname","split","redactedSegments","map","segment","test","url","URL","href","join","decodeURI","toLowerCase","trackPageView","redacted_path","track","event","properties","startSessionRecording","start_session_recording","stopSessionRecording","stop_session_recording"],"mappings":"AAAA,OAAOA,aAAc,kBAAmB,AAIxC,QAAO,MAAMC,aAAe,CAC1BC,MACAC,YAAuB,KAAK,CAC5BC,MAAiB,KAAK,CACtBC,sBAAwB,CAAC,IAEzB,MAAMC,eAAiB,CAAC,kBAAmB,mBAAmB,CAC9D,GAAI,CAACJ,MAAO,CACVK,QAAQC,IAAI,CAAC,wDACb,MACF,CAEAR,SAASS,IAAI,CAACP,MAAO,CACnBE,MAAOA,MACPM,YAAa,eACbC,YAAaR,YACT,CACES,gBAAiBN,eACjBO,qBAAsB,IACxB,EACA,MACJC,eAAgB,MAChBC,wBAAyBV,sBACzBW,0BAA2BC,SAC7B,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7BlB,SAASmB,UAAU,CAAC,CAAEf,MAAO,IAAK,EACpC,CAAE,AAEF,QAAO,MAAMgB,iBAAmB,KAC9BpB,SAASmB,UAAU,CAAC,CAAEf,MAAO,KAAM,EACrC,CAAE,AAEF,QAAO,MAAM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
1
|
-
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import*as datalayer from"./datalayer";import*as mixpanel from"./mixpanel";import*as posthog from"./posthog";import*as logger from"./logger";export class InsightsService{initInsights({mixpanelToken,mixpanelAutoCapture,mixpanelRecordSessionsPercent=1,posthogApiKey,posthogApiHost,debug=false}){this.debugMode=!!debug;if(this.debugMode){logger.debug("InsightService: Initializing insights")}try{mixpanel.initMixpanel(mixpanelToken,mixpanelAutoCapture,this.debugMode,mixpanelRecordSessionsPercent)}catch(e){if(this.debugMode){logger.error("Failed to initialize Mixpanel",e)}}try{posthog.initPosthog(posthogApiKey,posthogApiHost)}catch(e){if(this.debugMode){logger.error("Failed to initialize Posthog",e)}}}enableDebugMode(){this.debugMode=true;logger.debug("Enabling debug mode");try{mixpanel.enableDebugMode();posthog.enableDebugMode()}catch(e){logger.error("Failed to enable debug mode",e)}}disableDebugMode(){this.debugMode=false;logger.debug("Disabling debug mode");try{mixpanel.disableDebugMode();posthog.disableDebugMode()}catch(e){logger.error("Failed to disable debug mode",e)}}identify(identity){const{userId,accountId,organisationId,email,name}=identity;if(!userId){if(this.debugMode){logger.warn("User ID not provided, skipping identify")}return}if(this.debugMode){logger.info("Identifying user",{userId,accountId,organisationId,email,name})}try{mixpanel.identify({userId,accountId,organisationId,email,name})}catch(e){if(this.debugMode){logger.error("Failed to identify user in Mixpanel",e)}}try{posthog.identify({userId,accountId,organisationId,email,name})}catch(e){if(this.debugMode){logger.error("Failed to identify user in Posthog",e)}}}trackPageView(){if(this.debugMode){logger.info("Tracking page view")}try{mixpanel.trackPageView()}catch(e){if(this.debugMode){logger.error("Failed to track page view in Mixpanel",e)}}try{posthog.trackPageView()}catch(e){if(this.debugMode){logger.error("Failed to track page view in Posthog",e)}}}track(event,properties){if(this.debugMode){logger.info("Tracking event",{event,properties})}try{mixpanel.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Mixpanel",e)}}try{posthog.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Posthog",e)}}try{datalayer.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Datalayer",e)}}}startSessionRecording(){if(this.debugMode){logger.info("Starting session recording")}try{mixpanel.startSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to start session recording in Mixpanel",e)}}try{posthog.startSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to start session recording in Posthog",e)}}}stopSessionRecording(){if(this.debugMode){logger.info("Stopping session recording")}try{mixpanel.stopSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to stop session recording in Mixpanel",e)}}try{posthog.stopSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to stop session recording in Posthog",e)}}}setupObserver(){const getInsightAttributes=element=>{const MAX_ATTRIBUTES=10;let count=0;const attributes={};for(const attr of element.attributes){if(count>=MAX_ATTRIBUTES)break;if(attr.name.startsWith("data-insight-")){if(!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name))continue;if(typeof attr.value!=="string"||attr.value.length>100)continue;const key=attr.name.replace("data-insight-","").split("-").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");attributes[key]=attr.value;count++}}return attributes};const findClosestElementWithInsights=element=>{let current=element;while(current&¤t!==document.body){const insights=getInsightAttributes(current);if(Object.keys(insights).length>0){return insights}current=current.parentElement}return null};const handleClick=event=>{if(!(event.target instanceof HTMLElement))return;const insights=findClosestElementWithInsights(event.target);if(insights){const{event:eventName,...properties}=insights;this.track(eventName||"element_clicked",properties)}};document.body.addEventListener("click",handleClick);return()=>{document.body.removeEventListener("click",handleClick)}}constructor(){_define_property(this,"debugMode",false)}}
|
|
1
|
+
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import*as datalayer from"./datalayer";import*as mixpanel from"./mixpanel";import*as posthog from"./posthog";import*as logger from"./logger";export class InsightsService{initInsights({mixpanelToken,mixpanelAutoCapture,mixpanelRecordSessionsPercent=1,posthogApiKey,posthogApiHost,debug=false}){this.debugMode=!!debug;if(this.debugMode){logger.debug("InsightService: Initializing insights")}try{mixpanel.initMixpanel(mixpanelToken,mixpanelAutoCapture,this.debugMode,mixpanelRecordSessionsPercent)}catch(e){if(this.debugMode){logger.error("Failed to initialize Mixpanel",e)}}try{posthog.initPosthog(posthogApiKey,posthogApiHost)}catch(e){if(this.debugMode){logger.error("Failed to initialize Posthog",e)}}}enableDebugMode(){this.debugMode=true;logger.debug("Enabling debug mode");try{mixpanel.enableDebugMode();posthog.enableDebugMode()}catch(e){logger.error("Failed to enable debug mode",e)}}disableDebugMode(){this.debugMode=false;logger.debug("Disabling debug mode");try{mixpanel.disableDebugMode();posthog.disableDebugMode()}catch(e){logger.error("Failed to disable debug mode",e)}}identify(identity){const{userId,accountId,organisationId,email,name}=identity;if(!userId){if(this.debugMode){logger.warn("User ID not provided, skipping identify")}return}if(this.debugMode){logger.info("Identifying user",{userId,accountId,organisationId,email,name})}try{mixpanel.identify({userId,accountId,organisationId,email,name})}catch(e){if(this.debugMode){logger.error("Failed to identify user in Mixpanel",e)}}try{posthog.identify({userId,accountId,organisationId,email,name})}catch(e){if(this.debugMode){logger.error("Failed to identify user in Posthog",e)}}}trackPageView(options){if(this.debugMode){logger.info("Tracking page view")}try{mixpanel.trackPageView()}catch(e){if(this.debugMode){logger.error("Failed to track page view in Mixpanel",e)}}try{posthog.trackPageView()}catch(e){if(this.debugMode){logger.error("Failed to track page view in Posthog",e)}}if(options?.includeDataLayer){try{datalayer.trackPageView()}catch(e){if(this.debugMode){logger.error("Failed to track page view in GTM",e)}}}}track(event,properties){if(this.debugMode){logger.info("Tracking event",{event,properties})}try{mixpanel.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Mixpanel",e)}}try{posthog.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Posthog",e)}}try{datalayer.track(event,properties)}catch(e){if(this.debugMode){logger.error("Failed to track event in Datalayer",e)}}}startSessionRecording(){if(this.debugMode){logger.info("Starting session recording")}try{mixpanel.startSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to start session recording in Mixpanel",e)}}try{posthog.startSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to start session recording in Posthog",e)}}}stopSessionRecording(){if(this.debugMode){logger.info("Stopping session recording")}try{mixpanel.stopSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to stop session recording in Mixpanel",e)}}try{posthog.stopSessionRecording()}catch(e){if(this.debugMode){logger.error("Failed to stop session recording in Posthog",e)}}}setupObserver(){const getInsightAttributes=element=>{const MAX_ATTRIBUTES=10;let count=0;const attributes={};for(const attr of Array.from(element.attributes)){if(count>=MAX_ATTRIBUTES)break;if(attr.name.startsWith("data-insight-")){if(!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name))continue;if(typeof attr.value!=="string"||attr.value.length>100)continue;const key=attr.name.replace("data-insight-","").split("-").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");attributes[key]=attr.value;count++}}return attributes};const findClosestElementWithInsights=element=>{let current=element;while(current&¤t!==document.body){const insights=getInsightAttributes(current);if(Object.keys(insights).length>0){return insights}current=current.parentElement}return null};const handleClick=event=>{if(!(event.target instanceof HTMLElement))return;const insights=findClosestElementWithInsights(event.target);if(insights){const{event:eventName,...properties}=insights;this.track(eventName||"element_clicked",properties)}};document.body.addEventListener("click",handleClick);return()=>{document.body.removeEventListener("click",handleClick)}}constructor(){_define_property(this,"debugMode",false)}}
|
|
2
2
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/service.ts"],"sourcesContent":["import type {\n AnalyticsService,\n InsightsConfig,\n InsightsIdentity,\n} from \"./types\";\nimport * as datalayer from \"./datalayer\";\nimport * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport * as logger from \"./logger\";\n\n// The real implementation that will be used after initialization\nexport class InsightsService implements AnalyticsService {\n private debugMode: boolean = false;\n\n initInsights({\n mixpanelToken,\n mixpanelAutoCapture,\n mixpanelRecordSessionsPercent = 1,\n posthogApiKey,\n posthogApiHost,\n debug = false,\n }: InsightsConfig): void {\n this.debugMode = !!debug;\n\n if (this.debugMode) {\n logger.debug(\"InsightService: Initializing insights\");\n }\n\n try {\n mixpanel.initMixpanel(\n mixpanelToken,\n mixpanelAutoCapture,\n this.debugMode,\n mixpanelRecordSessionsPercent,\n );\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to initialize Mixpanel\", e);\n }\n }\n\n try {\n posthog.initPosthog(posthogApiKey, posthogApiHost);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to initialize Posthog\", e);\n }\n }\n }\n\n enableDebugMode(): void {\n this.debugMode = true;\n logger.debug(\"Enabling debug mode\");\n\n try {\n mixpanel.enableDebugMode();\n posthog.enableDebugMode();\n } catch (e) {\n logger.error(\"Failed to enable debug mode\", e);\n }\n }\n\n disableDebugMode(): void {\n this.debugMode = false;\n logger.debug(\"Disabling debug mode\");\n\n try {\n mixpanel.disableDebugMode();\n posthog.disableDebugMode();\n } catch (e) {\n logger.error(\"Failed to disable debug mode\", e);\n }\n }\n\n identify(identity: InsightsIdentity): void {\n const { userId, accountId, organisationId, email, name } = identity;\n\n // In very rare cases we might have a user without an account, so we'll\n // let null/undefined/blank strings through on that one\n if (!userId) {\n if (this.debugMode) {\n logger.warn(\"User ID not provided, skipping identify\");\n }\n return;\n }\n\n if (this.debugMode) {\n logger.info(\"Identifying user\", {\n userId,\n accountId,\n organisationId,\n email,\n name,\n });\n }\n\n try {\n mixpanel.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to identify user in Mixpanel\", e);\n }\n }\n\n try {\n posthog.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to identify user in Posthog\", e);\n }\n }\n }\n\n trackPageView(): void {\n if (this.debugMode) {\n logger.info(\"Tracking page view\");\n }\n\n try {\n mixpanel.trackPageView();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track page view in Mixpanel\", e);\n }\n }\n\n try {\n posthog.trackPageView();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track page view in Posthog\", e);\n }\n }\n }\n\n track(event: string, properties?: Record<string, unknown>): void {\n if (this.debugMode) {\n logger.info(\"Tracking event\", { event, properties });\n }\n\n try {\n mixpanel.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Mixpanel\", e);\n }\n }\n\n try {\n posthog.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Posthog\", e);\n }\n }\n\n try {\n datalayer.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Datalayer\", e);\n }\n }\n }\n\n startSessionRecording(): void {\n if (this.debugMode) {\n logger.info(\"Starting session recording\");\n }\n\n try {\n mixpanel.startSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to start session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.startSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to start session recording in Posthog\", e);\n }\n }\n }\n\n stopSessionRecording(): void {\n if (this.debugMode) {\n logger.info(\"Stopping session recording\");\n }\n\n try {\n mixpanel.stopSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to stop session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.stopSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to stop session recording in Posthog\", e);\n }\n }\n }\n\n setupObserver(): () => void {\n // Helper to get all data-insight-* attributes from an element\n const getInsightAttributes = (\n element,\n ): { event?: string; [key: string]: string | undefined } => {\n // limit how many data attributes we'll process\n const MAX_ATTRIBUTES = 10;\n let count = 0;\n\n const attributes: { event?: string; [key: string]: string | undefined } =\n {};\n\n for (const attr of element.attributes) {\n if (count >= MAX_ATTRIBUTES) break;\n if (attr.name.startsWith(\"data-insight-\")) {\n // Validate attribute name format\n if (!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name)) continue;\n\n // Sanitize attribute value\n if (typeof attr.value !== \"string\" || attr.value.length > 100)\n continue;\n\n // Convert data-insight-event-name to eventName\n const key = attr.name\n .replace(\"data-insight-\", \"\")\n .split(\"-\")\n .map((part, index) =>\n index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1),\n )\n .join(\"\");\n attributes[key] = attr.value;\n count++;\n }\n }\n return attributes;\n };\n\n // Helper to find closest element with data-insight attributes\n const findClosestElementWithInsights = (element) => {\n let current = element;\n while (current && current !== document.body) {\n const insights = getInsightAttributes(current);\n if (Object.keys(insights).length > 0) {\n return insights;\n }\n current = current.parentElement;\n }\n return null;\n };\n\n // Global click handler\n const handleClick = (event: MouseEvent): void => {\n if (!(event.target instanceof HTMLElement)) return;\n const insights = findClosestElementWithInsights(event.target);\n if (insights) {\n // Extract special properties if they exist\n const { event: eventName, ...properties } = insights;\n this.track(eventName || \"element_clicked\", properties);\n }\n };\n\n // Add listener to document body to catch all clicks\n document.body.addEventListener(\"click\", handleClick);\n\n // Return cleanup function in case it's needed\n return () => {\n document.body.removeEventListener(\"click\", handleClick);\n };\n }\n}\n"],"names":["datalayer","mixpanel","posthog","logger","InsightsService","initInsights","mixpanelToken","mixpanelAutoCapture","mixpanelRecordSessionsPercent","posthogApiKey","posthogApiHost","debug","debugMode","initMixpanel","e","error","initPosthog","enableDebugMode","disableDebugMode","identify","identity","userId","accountId","organisationId","email","name","warn","info","trackPageView","track","event","properties","startSessionRecording","stopSessionRecording","setupObserver","getInsightAttributes","element","MAX_ATTRIBUTES","count","attributes","attr","startsWith","test","value","length","key","replace","split","map","part","index","charAt","toUpperCase","slice","join","findClosestElementWithInsights","current","document","body","insights","Object","keys","parentElement","handleClick","target","HTMLElement","eventName","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CAACU,mBAAmB,CAAC,QAASL,YAC7C,CACF,eAzQA,sBAAQnD,YAAqB,OA0Q/B"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/service.ts"],"sourcesContent":["import type {\n AnalyticsService,\n InsightsConfig,\n InsightsIdentity,\n TrackPageViewOptions,\n} from \"./types\";\nimport * as datalayer from \"./datalayer\";\nimport * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport * as logger from \"./logger\";\n\n// The real implementation that will be used after initialization\nexport class InsightsService implements AnalyticsService {\n private debugMode: boolean = false;\n\n initInsights({\n mixpanelToken,\n mixpanelAutoCapture,\n mixpanelRecordSessionsPercent = 1,\n posthogApiKey,\n posthogApiHost,\n debug = false,\n }: InsightsConfig): void {\n this.debugMode = !!debug;\n\n if (this.debugMode) {\n logger.debug(\"InsightService: Initializing insights\");\n }\n\n try {\n mixpanel.initMixpanel(\n mixpanelToken,\n mixpanelAutoCapture,\n this.debugMode,\n mixpanelRecordSessionsPercent,\n );\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to initialize Mixpanel\", e);\n }\n }\n\n try {\n posthog.initPosthog(posthogApiKey, posthogApiHost);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to initialize Posthog\", e);\n }\n }\n }\n\n enableDebugMode(): void {\n this.debugMode = true;\n logger.debug(\"Enabling debug mode\");\n\n try {\n mixpanel.enableDebugMode();\n posthog.enableDebugMode();\n } catch (e) {\n logger.error(\"Failed to enable debug mode\", e);\n }\n }\n\n disableDebugMode(): void {\n this.debugMode = false;\n logger.debug(\"Disabling debug mode\");\n\n try {\n mixpanel.disableDebugMode();\n posthog.disableDebugMode();\n } catch (e) {\n logger.error(\"Failed to disable debug mode\", e);\n }\n }\n\n identify(identity: InsightsIdentity): void {\n const { userId, accountId, organisationId, email, name } = identity;\n\n // In very rare cases we might have a user without an account, so we'll\n // let null/undefined/blank strings through on that one\n if (!userId) {\n if (this.debugMode) {\n logger.warn(\"User ID not provided, skipping identify\");\n }\n return;\n }\n\n if (this.debugMode) {\n logger.info(\"Identifying user\", {\n userId,\n accountId,\n organisationId,\n email,\n name,\n });\n }\n\n try {\n mixpanel.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to identify user in Mixpanel\", e);\n }\n }\n\n try {\n posthog.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to identify user in Posthog\", e);\n }\n }\n }\n\n trackPageView(options?: TrackPageViewOptions): void {\n if (this.debugMode) {\n logger.info(\"Tracking page view\");\n }\n\n try {\n mixpanel.trackPageView();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track page view in Mixpanel\", e);\n }\n }\n\n try {\n posthog.trackPageView();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track page view in Posthog\", e);\n }\n }\n\n if (options?.includeDataLayer) {\n try {\n datalayer.trackPageView();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track page view in GTM\", e);\n }\n }\n }\n }\n\n track(event: string, properties?: Record<string, unknown>): void {\n if (this.debugMode) {\n logger.info(\"Tracking event\", { event, properties });\n }\n\n try {\n mixpanel.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Mixpanel\", e);\n }\n }\n\n try {\n posthog.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Posthog\", e);\n }\n }\n\n try {\n datalayer.track(event, properties);\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to track event in Datalayer\", e);\n }\n }\n }\n\n startSessionRecording(): void {\n if (this.debugMode) {\n logger.info(\"Starting session recording\");\n }\n\n try {\n mixpanel.startSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to start session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.startSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to start session recording in Posthog\", e);\n }\n }\n }\n\n stopSessionRecording(): void {\n if (this.debugMode) {\n logger.info(\"Stopping session recording\");\n }\n\n try {\n mixpanel.stopSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to stop session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.stopSessionRecording();\n } catch (e) {\n if (this.debugMode) {\n logger.error(\"Failed to stop session recording in Posthog\", e);\n }\n }\n }\n\n setupObserver(): () => void {\n // Helper to get all data-insight-* attributes from an element\n const getInsightAttributes = (\n element: HTMLElement,\n ): { event?: string; [key: string]: string | undefined } => {\n // limit how many data attributes we'll process\n const MAX_ATTRIBUTES = 10;\n let count = 0;\n\n const attributes: { event?: string; [key: string]: string | undefined } =\n {};\n\n for (const attr of Array.from(element.attributes)) {\n if (count >= MAX_ATTRIBUTES) break;\n if (attr.name.startsWith(\"data-insight-\")) {\n // Validate attribute name format\n if (!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name)) continue;\n\n // Sanitize attribute value\n if (typeof attr.value !== \"string\" || attr.value.length > 100)\n continue;\n\n // Convert data-insight-event-name to eventName\n const key = attr.name\n .replace(\"data-insight-\", \"\")\n .split(\"-\")\n .map((part: string, index: number) =>\n index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1),\n )\n .join(\"\");\n attributes[key] = attr.value;\n count++;\n }\n }\n return attributes;\n };\n\n // Helper to find closest element with data-insight attributes\n const findClosestElementWithInsights = (element: HTMLElement) => {\n let current = element;\n while (current && current !== document.body) {\n const insights = getInsightAttributes(current);\n if (Object.keys(insights).length > 0) {\n return insights;\n }\n\n current = current.parentElement as HTMLElement;\n }\n return null;\n };\n\n // Global click handler\n const handleClick = (event: MouseEvent): void => {\n if (!(event.target instanceof HTMLElement)) return;\n const insights = findClosestElementWithInsights(event.target);\n if (insights) {\n // Extract special properties if they exist\n const { event: eventName, ...properties } = insights;\n this.track(eventName || \"element_clicked\", properties);\n }\n };\n\n // Add listener to document body to catch all clicks\n document.body.addEventListener(\"click\", handleClick);\n\n // Return cleanup function in case it's needed\n return () => {\n document.body.removeEventListener(\"click\", handleClick);\n };\n }\n}\n"],"names":["datalayer","mixpanel","posthog","logger","InsightsService","initInsights","mixpanelToken","mixpanelAutoCapture","mixpanelRecordSessionsPercent","posthogApiKey","posthogApiHost","debug","debugMode","initMixpanel","e","error","initPosthog","enableDebugMode","disableDebugMode","identify","identity","userId","accountId","organisationId","email","name","warn","info","trackPageView","options","includeDataLayer","track","event","properties","startSessionRecording","stopSessionRecording","setupObserver","getInsightAttributes","element","MAX_ATTRIBUTES","count","attributes","attr","Array","from","startsWith","test","value","length","key","replace","split","map","part","index","charAt","toUpperCase","slice","join","findClosestElementWithInsights","current","document","body","insights","Object","keys","parentElement","handleClick","target","HTMLElement","eventName","addEventListener","removeEventListener"],"mappings":"oLAMA,UAAYA,cAAe,aAAc,AACzC,WAAYC,aAAc,YAAa,AACvC,WAAYC,YAAa,WAAY,AACrC,WAAYC,WAAY,UAAW,AAGnC,QAAO,MAAMC,gBAGXC,aAAa,CACXC,aAAa,CACbC,mBAAmB,CACnBC,8BAAgC,CAAC,CACjCC,aAAa,CACbC,cAAc,CACdC,MAAQ,KAAK,CACE,CAAQ,CACvB,IAAI,CAACC,SAAS,CAAG,CAAC,CAACD,MAEnB,GAAI,IAAI,CAACC,SAAS,CAAE,CAClBT,OAAOQ,KAAK,CAAC,wCACf,CAEA,GAAI,CACFV,SAASY,YAAY,CACnBP,cACAC,oBACA,IAAI,CAACK,SAAS,CACdJ,8BAEJ,CAAE,MAAOM,EAAG,CACV,GAAI,IAAI,CAACF,SAAS,CAAE,CAClBT,OAAOY,KAAK,CAAC,gCAAiCD,EAChD,CACF,CAEA,GAAI,CACFZ,QAAQc,WAAW,CAACP,cAAeC,eACrC,CAAE,MAAOI,EAAG,CACV,GAAI,IAAI,CAACF,SAAS,CAAE,CAClBT,OAAOY,KAAK,CAAC,+BAAgCD,EAC/C,CACF,CACF,CAEAG,iBAAwB,CACtB,IAAI,CAACL,SAAS,CA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,CAAGP,KAAKK,KAAK,AAC5BP,CAAAA,OACF,CACF,CACA,OAAOC,UACT,EAGA,MAAMkB,+BAAiC,AAACrB,UACtC,IAAIsB,QAAUtB,QACd,MAAOsB,SAAWA,UAAYC,SAASC,IAAI,CAAE,CAC3C,MAAMC,SAAW1B,qBAAqBuB,SACtC,GAAII,OAAOC,IAAI,CAACF,UAAUf,MAAM,CAAG,EAAG,CACpC,OAAOe,QACT,CAEAH,QAAUA,QAAQM,aAAa,AACjC,CACA,OAAO,IACT,EAGA,MAAMC,YAAc,AAACnC,QACnB,GAAI,CAAEA,CAAAA,MAAMoC,MAAM,YAAYC,WAAU,EAAI,OAC5C,MAAMN,SAAWJ,+BAA+B3B,MAAMoC,MAAM,EAC5D,GAAIL,SAAU,CAEZ,KAAM,CAAE/B,MAAOsC,SAAS,CAAE,GAAGrC,WAAY,CAAG8B,SAC5C,IAAI,CAAChC,KAAK,CAACuC,WAAa,kBAAmBrC,WAC7C,CACF,EAGA4B,SAASC,IAAI,CAACS,gBAAgB,CAAC,QAASJ,aAGxC,MAAO,KACLN,SAASC,IAAI,CAACU,mBAAmB,CAAC,QAASL,YAC7C,CACF,eApRA,sBAAQvD,YAAqB,OAqR/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/types.ts"],"sourcesContent":["export type InsightsConfig = {\n debug: boolean;\n mixpanelToken: string;\n mixpanelAutoCapture: boolean;\n mixpanelRecordSessionsPercent: number;\n posthogApiKey: string;\n posthogApiHost: string;\n};\n\n// Define the interface for our analytics service\nexport interface AnalyticsService {\n initInsights: (config: InsightsConfig) => void;\n enableDebugMode: () => void;\n disableDebugMode: () => void;\n identify: (identity: InsightsIdentity) => void;\n trackPageView: () => void;\n track: (event: string, properties?: Record<string, unknown>) => void;\n startSessionRecording: () => void;\n stopSessionRecording: () => void;\n setupObserver: () => () => void;\n}\n\n// Command type for our queue\nexport type Command = {\n methodName: keyof AnalyticsService;\n args: unknown[];\n};\n\nexport type InsightsIdentity = {\n userId: string;\n accountId: string;\n organisationId?: string;\n email?: string;\n name?: string;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/types.ts"],"sourcesContent":["export type InsightsConfig = {\n debug: boolean;\n mixpanelToken: string;\n mixpanelAutoCapture: boolean;\n mixpanelRecordSessionsPercent: number;\n posthogApiKey: string;\n posthogApiHost: string;\n};\n\n// Define the interface for our analytics service\nexport interface AnalyticsService {\n initInsights: (config: InsightsConfig) => void;\n enableDebugMode: () => void;\n disableDebugMode: () => void;\n identify: (identity: InsightsIdentity) => void;\n trackPageView: (options?: TrackPageViewOptions) => void;\n track: (event: string, properties?: Record<string, unknown>) => void;\n startSessionRecording: () => void;\n stopSessionRecording: () => void;\n setupObserver: () => () => void;\n}\n\n// Command type for our queue\nexport type Command = {\n methodName: keyof AnalyticsService;\n args: unknown[];\n};\n\nexport type InsightsIdentity = {\n userId: string;\n accountId: string;\n organisationId?: string;\n email?: string;\n name?: string;\n};\n\nexport type TrackPageViewOptions = {\n includeDataLayer?: boolean;\n};\n"],"names":[],"mappings":"AAoCA,QAEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/react-renderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\nconst renderComponent = (Component
|
|
1
|
+
{"version":3,"sources":["../../src/core/react-renderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\nconst renderComponent = (\n Component: React.FC,\n props: React.ComponentProps<React.FC>,\n node: HTMLElement,\n) => {\n const root = createRoot(node);\n root.render(<Component {...props} />);\n};\n\nexport { renderComponent };\n\nexport default function reactRenderer(components: Record<string, React.FC>) {\n const reactComponents = document.querySelectorAll(\"[data-react]\");\n\n Array.from(reactComponents).forEach((node) => {\n const className = node.getAttribute(\"data-react\") ?? \"\";\n const Constructor = components[className];\n\n if (!Constructor) return;\n\n const propsJson = node.getAttribute(\"data-react-props\");\n const props = propsJson && JSON.parse(propsJson || \"\");\n\n const root = createRoot(node);\n root.render(<Constructor {...props} />);\n\n node.removeAttribute(\"data-react\");\n node.removeAttribute(\"data-react-props\");\n });\n}\n"],"names":["React","createRoot","renderComponent","Component","props","node","root","render","reactRenderer","components","reactComponents","document","querySelectorAll","Array","from","forEach","className","getAttribute","Constructor","propsJson","JSON","parse","removeAttribute"],"mappings":"AAAA,OAAOA,UAAW,OAAQ,AAC1B,QAASC,UAAU,KAAQ,kBAAmB,CAE9C,MAAMC,gBAAkB,CACtBC,UACAC,MACAC,QAEA,MAAMC,KAAOL,WAAWI,MACxBC,KAAKC,MAAM,cAAC,oBAACJ,UAAcC,OAC7B,CAEA,QAASF,eAAe,CAAG,AAE3B,gBAAe,SAASM,cAAcC,UAAoC,EACxE,MAAMC,gBAAkBC,SAASC,gBAAgB,CAAC,gBAElDC,MAAMC,IAAI,CAACJ,iBAAiBK,OAAO,CAAC,AAACV,OACnC,MAAMW,UAAYX,KAAKY,YAAY,CAAC,eAAiB,GACrD,MAAMC,YAAcT,UAAU,CAACO,UAAU,CAEzC,GAAI,CAACE,YAAa,OAElB,MAAMC,UAAYd,KAAKY,YAAY,CAAC,oBACpC,MAAMb,MAAQe,WAAaC,KAAKC,KAAK,CAACF,WAAa,IAEnD,MAAMb,KAAOL,WAAWI,MACxBC,KAAKC,MAAM,cAAC,oBAACW,YAAgBd,QAE7BC,KAAKiB,eAAe,CAAC,cACrBjB,KAAKiB,eAAe,CAAC,mBACvB,EACF"}
|
|
@@ -53,6 +53,20 @@
|
|
|
53
53
|
@apply -my-0.5 sm:-my-1 md:-my-2;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
.ui-section-spacing-collapse-order-first {
|
|
57
|
+
&-full { @apply -mb-8 sm:-mb-16 md:-mb-32; }
|
|
58
|
+
&-half { @apply -mb-4 sm:-mb-8 md:-mb-16; }
|
|
59
|
+
&-quarter{ @apply -mb-2 sm:-mb-4 md:-mb-8 ; }
|
|
60
|
+
&-eighth { @apply -mb-1 sm:-mb-2 md:-mb-4 ; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ui-section-spacing-collapse-order-last {
|
|
64
|
+
&-full { @apply -mt-8 sm:-mt-16 md:-mt-32; }
|
|
65
|
+
&-half { @apply -mt-4 sm:-mt-8 md:-mt-16; }
|
|
66
|
+
&-quarter{ @apply -mt-2 sm:-mt-4 md:-mt-8 ; }
|
|
67
|
+
&-eighth { @apply -mt-1 sm:-mt-2 md:-mt-4 ; }
|
|
68
|
+
}
|
|
69
|
+
|
|
56
70
|
.ui-content-spacing {
|
|
57
71
|
@apply my-10 sm:my-12 md:my-16;
|
|
58
72
|
}
|
package/index.d.ts
CHANGED
|
@@ -289,6 +289,12 @@ export default Button;
|
|
|
289
289
|
//# sourceMappingURL=Button.d.ts.map
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
declare module '@ably/ui/core/Code/component' {
|
|
293
|
+
export default highlightEl;
|
|
294
|
+
function highlightEl(el: any): void;
|
|
295
|
+
//# sourceMappingURL=component.d.ts.map
|
|
296
|
+
}
|
|
297
|
+
|
|
292
298
|
declare module '@ably/ui/core/Code' {
|
|
293
299
|
type CodeProps = {
|
|
294
300
|
language: string;
|
|
@@ -4706,6 +4712,368 @@ export default ForwardRef;
|
|
|
4706
4712
|
//# sourceMappingURL=icon-tech-zeromq.d.ts.map
|
|
4707
4713
|
}
|
|
4708
4714
|
|
|
4715
|
+
declare module '@ably/ui/core/Icon/components' {
|
|
4716
|
+
import IconDisplay48hrs from "@ably/ui/core/icon-display-48hrs";
|
|
4717
|
+
import IconDisplayAblyChannels from "@ably/ui/core/icon-display-ably-channels";
|
|
4718
|
+
import IconDisplayAboutAblyCol from "@ably/ui/core/icon-display-about-ably-col";
|
|
4719
|
+
import IconDisplayApiKeys from "@ably/ui/core/icon-display-api-keys";
|
|
4720
|
+
import IconDisplayApi from "@ably/ui/core/icon-display-api";
|
|
4721
|
+
import IconDisplayArchitecturalGuidance from "@ably/ui/core/icon-display-architectural-guidance";
|
|
4722
|
+
import IconDisplayAssetTrackingCol from "@ably/ui/core/icon-display-asset-tracking-col";
|
|
4723
|
+
import IconDisplayAuthentication from "@ably/ui/core/icon-display-authentication";
|
|
4724
|
+
import IconDisplayAvatarStack from "@ably/ui/core/icon-display-avatar-stack";
|
|
4725
|
+
import IconDisplayBrowser from "@ably/ui/core/icon-display-browser";
|
|
4726
|
+
import IconDisplayCalendar from "@ably/ui/core/icon-display-calendar";
|
|
4727
|
+
import IconDisplayCallMobile from "@ably/ui/core/icon-display-call-mobile";
|
|
4728
|
+
import IconDisplayCareersCol from "@ably/ui/core/icon-display-careers-col";
|
|
4729
|
+
import IconDisplayCaseStudiesCol from "@ably/ui/core/icon-display-case-studies-col";
|
|
4730
|
+
import IconDisplayChatCol from "@ably/ui/core/icon-display-chat-col";
|
|
4731
|
+
import IconDisplayChatMono from "@ably/ui/core/icon-display-chat-mono";
|
|
4732
|
+
import IconDisplayChatStackCol from "@ably/ui/core/icon-display-chat-stack-col";
|
|
4733
|
+
import IconDisplayChatStack from "@ably/ui/core/icon-display-chat-stack";
|
|
4734
|
+
import IconDisplayCloudServers from "@ably/ui/core/icon-display-cloud-servers";
|
|
4735
|
+
import IconDisplayCompareTechCol from "@ably/ui/core/icon-display-compare-tech-col";
|
|
4736
|
+
import IconDisplayConnectionStateRecovery from "@ably/ui/core/icon-display-connection-state-recovery";
|
|
4737
|
+
import IconDisplayConsumerGroups from "@ably/ui/core/icon-display-consumer-groups";
|
|
4738
|
+
import IconDisplayCustomCname from "@ably/ui/core/icon-display-custom-cname";
|
|
4739
|
+
import IconDisplayCustom from "@ably/ui/core/icon-display-custom";
|
|
4740
|
+
import IconDisplayCustomersCol from "@ably/ui/core/icon-display-customers-col";
|
|
4741
|
+
import IconDisplayDataBroadcastCol from "@ably/ui/core/icon-display-data-broadcast-col";
|
|
4742
|
+
import IconDisplayDataBroadcastMono from "@ably/ui/core/icon-display-data-broadcast-mono";
|
|
4743
|
+
import IconDisplayDataSynchronizationCol from "@ably/ui/core/icon-display-data-synchronization-col";
|
|
4744
|
+
import IconDisplayDedicatedCluster from "@ably/ui/core/icon-display-dedicated-cluster";
|
|
4745
|
+
import IconDisplayDeltas from "@ably/ui/core/icon-display-deltas";
|
|
4746
|
+
import IconDisplayDocsCol from "@ably/ui/core/icon-display-docs-col";
|
|
4747
|
+
import IconDisplayDocumentation from "@ably/ui/core/icon-display-documentation";
|
|
4748
|
+
import IconDisplayDynamicChannelGroups from "@ably/ui/core/icon-display-dynamic-channel-groups";
|
|
4749
|
+
import IconDisplayEdgeNetwork from "@ably/ui/core/icon-display-edge-network";
|
|
4750
|
+
import IconDisplayElasticity from "@ably/ui/core/icon-display-elasticity";
|
|
4751
|
+
import IconDisplayEqualisersMono from "@ably/ui/core/icon-display-equalisers-mono";
|
|
4752
|
+
import IconDisplayEventsCol from "@ably/ui/core/icon-display-events-col";
|
|
4753
|
+
import IconDisplayExactlyOnceDelivery from "@ably/ui/core/icon-display-exactly-once-delivery";
|
|
4754
|
+
import IconDisplayExamplesCol from "@ably/ui/core/icon-display-examples-col";
|
|
4755
|
+
import IconDisplayFanOut from "@ably/ui/core/icon-display-fan-out";
|
|
4756
|
+
import IconDisplayFirehose from "@ably/ui/core/icon-display-firehose";
|
|
4757
|
+
import IconDisplayGdpr from "@ably/ui/core/icon-display-gdpr";
|
|
4758
|
+
import IconDisplayGeneralComms from "@ably/ui/core/icon-display-general-comms";
|
|
4759
|
+
import IconDisplayGranularPermissions from "@ably/ui/core/icon-display-granular-permissions";
|
|
4760
|
+
import IconDisplayHipaaMono from "@ably/ui/core/icon-display-hipaa-mono";
|
|
4761
|
+
import IconDisplayHipaa from "@ably/ui/core/icon-display-hipaa";
|
|
4762
|
+
import IconDisplayHistory from "@ably/ui/core/icon-display-history";
|
|
4763
|
+
import IconDisplayIntegrationsCol from "@ably/ui/core/icon-display-integrations-col";
|
|
4764
|
+
import IconDisplayIntegrations from "@ably/ui/core/icon-display-integrations";
|
|
4765
|
+
import IconDisplayItSupportAccess from "@ably/ui/core/icon-display-it-support-access";
|
|
4766
|
+
import IconDisplayItSupportHelpdesk from "@ably/ui/core/icon-display-it-support-helpdesk";
|
|
4767
|
+
import IconDisplayKafkaAtTheEdgeCol from "@ably/ui/core/icon-display-kafka-at-the-edge-col";
|
|
4768
|
+
import IconDisplayLaptop from "@ably/ui/core/icon-display-laptop";
|
|
4769
|
+
import IconDisplayLastSeen from "@ably/ui/core/icon-display-last-seen";
|
|
4770
|
+
import IconDisplayLightbulbCol from "@ably/ui/core/icon-display-lightbulb-col";
|
|
4771
|
+
import IconDisplayLiveChat from "@ably/ui/core/icon-display-live-chat";
|
|
4772
|
+
import IconDisplayLiveUpdatesResultsMetricsCol from "@ably/ui/core/icon-display-live-updates-results-metrics-col";
|
|
4773
|
+
import IconDisplayMapPin from "@ably/ui/core/icon-display-map-pin";
|
|
4774
|
+
import IconDisplayMessageBatching from "@ably/ui/core/icon-display-message-batching";
|
|
4775
|
+
import IconDisplayMessagePersistence from "@ably/ui/core/icon-display-message-persistence";
|
|
4776
|
+
import IconDisplayMessageQueues from "@ably/ui/core/icon-display-message-queues";
|
|
4777
|
+
import IconDisplayMessage from "@ably/ui/core/icon-display-message";
|
|
4778
|
+
import IconDisplayMultiUserSpacesCol from "@ably/ui/core/icon-display-multi-user-spaces-col";
|
|
4779
|
+
import IconDisplayObserveAnalytics from "@ably/ui/core/icon-display-observe-analytics";
|
|
4780
|
+
import IconDisplayPadlockClosed from "@ably/ui/core/icon-display-padlock-closed";
|
|
4781
|
+
import IconDisplayPlatform from "@ably/ui/core/icon-display-platform";
|
|
4782
|
+
import IconDisplayPlay from "@ably/ui/core/icon-display-play";
|
|
4783
|
+
import IconDisplayPremiumSupport from "@ably/ui/core/icon-display-premium-support";
|
|
4784
|
+
import IconDisplayPrivacyShieldFramework from "@ably/ui/core/icon-display-privacy-shield-framework";
|
|
4785
|
+
import IconDisplayPrivateLink from "@ably/ui/core/icon-display-private-link";
|
|
4786
|
+
import IconDisplayPushNotificationsCol from "@ably/ui/core/icon-display-push-notifications-col";
|
|
4787
|
+
import IconDisplayPushNotificationsMono from "@ably/ui/core/icon-display-push-notifications-mono";
|
|
4788
|
+
import IconDisplayPushNotifications from "@ably/ui/core/icon-display-push-notifications";
|
|
4789
|
+
import IconDisplayQuickstartGuidesCol from "@ably/ui/core/icon-display-quickstart-guides-col";
|
|
4790
|
+
import IconDisplayReactions from "@ably/ui/core/icon-display-reactions";
|
|
4791
|
+
import IconDisplayReadReceipts from "@ably/ui/core/icon-display-read-receipts";
|
|
4792
|
+
import IconDisplayResourcesCol from "@ably/ui/core/icon-display-resources-col";
|
|
4793
|
+
import IconDisplayRewind from "@ably/ui/core/icon-display-rewind";
|
|
4794
|
+
import IconDisplaySdksCol from "@ably/ui/core/icon-display-sdks-col";
|
|
4795
|
+
import IconDisplaySendReceivedMessages from "@ably/ui/core/icon-display-send-received-messages";
|
|
4796
|
+
import IconDisplayServers from "@ably/ui/core/icon-display-servers";
|
|
4797
|
+
import IconDisplayShoppingCart from "@ably/ui/core/icon-display-shopping-cart";
|
|
4798
|
+
import IconDisplaySla from "@ably/ui/core/icon-display-sla";
|
|
4799
|
+
import IconDisplaySoc2Type2Mono from "@ably/ui/core/icon-display-soc2-type2-mono";
|
|
4800
|
+
import IconDisplaySoc2Type2 from "@ably/ui/core/icon-display-soc2-type2";
|
|
4801
|
+
import IconDisplaySubscriptionFilters from "@ably/ui/core/icon-display-subscription-filters";
|
|
4802
|
+
import IconDisplaySupportChatMono from "@ably/ui/core/icon-display-support-chat-mono";
|
|
4803
|
+
import IconDisplaySystemMetadata from "@ably/ui/core/icon-display-system-metadata";
|
|
4804
|
+
import IconDisplayTechAccountComms from "@ably/ui/core/icon-display-tech-account-comms";
|
|
4805
|
+
import IconDisplayTutorialsDemosCol from "@ably/ui/core/icon-display-tutorials-demos-col";
|
|
4806
|
+
import IconDisplayVirtualEventsCol from "@ably/ui/core/icon-display-virtual-events-col";
|
|
4807
|
+
import IconDisplayVirtualEvents from "@ably/ui/core/icon-display-virtual-events";
|
|
4808
|
+
export { IconDisplay48hrs, IconDisplayAblyChannels, IconDisplayAboutAblyCol, IconDisplayApiKeys, IconDisplayApi, IconDisplayArchitecturalGuidance, IconDisplayAssetTrackingCol, IconDisplayAuthentication, IconDisplayAvatarStack, IconDisplayBrowser, IconDisplayCalendar, IconDisplayCallMobile, IconDisplayCareersCol, IconDisplayCaseStudiesCol, IconDisplayChatCol, IconDisplayChatMono, IconDisplayChatStackCol, IconDisplayChatStack, IconDisplayCloudServers, IconDisplayCompareTechCol, IconDisplayConnectionStateRecovery, IconDisplayConsumerGroups, IconDisplayCustomCname, IconDisplayCustom, IconDisplayCustomersCol, IconDisplayDataBroadcastCol, IconDisplayDataBroadcastMono, IconDisplayDataSynchronizationCol, IconDisplayDedicatedCluster, IconDisplayDeltas, IconDisplayDocsCol, IconDisplayDocumentation, IconDisplayDynamicChannelGroups, IconDisplayEdgeNetwork, IconDisplayElasticity, IconDisplayEqualisersMono, IconDisplayEventsCol, IconDisplayExactlyOnceDelivery, IconDisplayExamplesCol, IconDisplayFanOut, IconDisplayFirehose, IconDisplayGdpr, IconDisplayGeneralComms, IconDisplayGranularPermissions, IconDisplayHipaaMono, IconDisplayHipaa, IconDisplayHistory, IconDisplayIntegrationsCol, IconDisplayIntegrations, IconDisplayItSupportAccess, IconDisplayItSupportHelpdesk, IconDisplayKafkaAtTheEdgeCol, IconDisplayLaptop, IconDisplayLastSeen, IconDisplayLightbulbCol, IconDisplayLiveChat, IconDisplayLiveUpdatesResultsMetricsCol, IconDisplayMapPin, IconDisplayMessageBatching, IconDisplayMessagePersistence, IconDisplayMessageQueues, IconDisplayMessage, IconDisplayMultiUserSpacesCol, IconDisplayObserveAnalytics, IconDisplayPadlockClosed, IconDisplayPlatform, IconDisplayPlay, IconDisplayPremiumSupport, IconDisplayPrivacyShieldFramework, IconDisplayPrivateLink, IconDisplayPushNotificationsCol, IconDisplayPushNotificationsMono, IconDisplayPushNotifications, IconDisplayQuickstartGuidesCol, IconDisplayReactions, IconDisplayReadReceipts, IconDisplayResourcesCol, IconDisplayRewind, IconDisplaySdksCol, IconDisplaySendReceivedMessages, IconDisplayServers, IconDisplayShoppingCart, IconDisplaySla, IconDisplaySoc2Type2Mono, IconDisplaySoc2Type2, IconDisplaySubscriptionFilters, IconDisplaySupportChatMono, IconDisplaySystemMetadata, IconDisplayTechAccountComms, IconDisplayTutorialsDemosCol, IconDisplayVirtualEventsCol, IconDisplayVirtualEvents, };
|
|
4809
|
+
import IconGuiAblyBadge from "@ably/ui/core/icon-gui-ably-badge";
|
|
4810
|
+
import IconGuiCheckCircledFill from "@ably/ui/core/icon-gui-check-circled-fill";
|
|
4811
|
+
import IconGuiCheckLotusCircled from "@ably/ui/core/icon-gui-check-lotus-circled";
|
|
4812
|
+
import IconGuiChecklistChecked from "@ably/ui/core/icon-gui-checklist-checked";
|
|
4813
|
+
import IconGuiCodeDoc from "@ably/ui/core/icon-gui-code-doc";
|
|
4814
|
+
import IconGuiCursor from "@ably/ui/core/icon-gui-cursor";
|
|
4815
|
+
import IconGuiExpand from "@ably/ui/core/icon-gui-expand";
|
|
4816
|
+
import IconGuiFilterFlowStep0 from "@ably/ui/core/icon-gui-filter-flow-step-0";
|
|
4817
|
+
import IconGuiFilterFlowStep1 from "@ably/ui/core/icon-gui-filter-flow-step-1";
|
|
4818
|
+
import IconGuiFilterFlowStep2 from "@ably/ui/core/icon-gui-filter-flow-step-2";
|
|
4819
|
+
import IconGuiFilterFlowStep3 from "@ably/ui/core/icon-gui-filter-flow-step-3";
|
|
4820
|
+
import IconGuiFlowerGrowth from "@ably/ui/core/icon-gui-flower-growth";
|
|
4821
|
+
import IconGuiFurtherReading from "@ably/ui/core/icon-gui-further-reading";
|
|
4822
|
+
import IconGuiGlasses from "@ably/ui/core/icon-gui-glasses";
|
|
4823
|
+
import IconGuiHistory from "@ably/ui/core/icon-gui-history";
|
|
4824
|
+
import IconGuiLiveChat from "@ably/ui/core/icon-gui-live-chat";
|
|
4825
|
+
import IconGuiMouse from "@ably/ui/core/icon-gui-mouse";
|
|
4826
|
+
import IconGuiPartial from "@ably/ui/core/icon-gui-partial";
|
|
4827
|
+
import IconGuiPitfall from "@ably/ui/core/icon-gui-pitfall";
|
|
4828
|
+
import IconGuiProdAssetTrackingOutline from "@ably/ui/core/icon-gui-prod-asset-tracking-outline";
|
|
4829
|
+
import IconGuiProdAssetTrackingSolid from "@ably/ui/core/icon-gui-prod-asset-tracking-solid";
|
|
4830
|
+
import IconGuiProdChatOutline from "@ably/ui/core/icon-gui-prod-chat-outline";
|
|
4831
|
+
import IconGuiProdChatSolid from "@ably/ui/core/icon-gui-prod-chat-solid";
|
|
4832
|
+
import IconGuiProdLiveobjectsOutline from "@ably/ui/core/icon-gui-prod-liveobjects-outline";
|
|
4833
|
+
import IconGuiProdLiveobjectsSolid from "@ably/ui/core/icon-gui-prod-liveobjects-solid";
|
|
4834
|
+
import IconGuiProdLivesyncOutline from "@ably/ui/core/icon-gui-prod-livesync-outline";
|
|
4835
|
+
import IconGuiProdLivesyncSolid from "@ably/ui/core/icon-gui-prod-livesync-solid";
|
|
4836
|
+
import IconGuiProdPubsubOutline from "@ably/ui/core/icon-gui-prod-pubsub-outline";
|
|
4837
|
+
import IconGuiProdPubsubSolid from "@ably/ui/core/icon-gui-prod-pubsub-solid";
|
|
4838
|
+
import IconGuiProdSpacesOutline from "@ably/ui/core/icon-gui-prod-spaces-outline";
|
|
4839
|
+
import IconGuiProdSpacesSolid from "@ably/ui/core/icon-gui-prod-spaces-solid";
|
|
4840
|
+
import IconGuiQuoteMarksFill from "@ably/ui/core/icon-gui-quote-marks-fill";
|
|
4841
|
+
import IconGuiRefresh from "@ably/ui/core/icon-gui-refresh";
|
|
4842
|
+
import IconGuiResources from "@ably/ui/core/icon-gui-resources";
|
|
4843
|
+
import IconGuiSpinnerDark from "@ably/ui/core/icon-gui-spinner-dark";
|
|
4844
|
+
import IconGuiSpinnerLight from "@ably/ui/core/icon-gui-spinner-light";
|
|
4845
|
+
export { IconGuiAblyBadge, IconGuiCheckCircledFill, IconGuiCheckLotusCircled, IconGuiChecklistChecked, IconGuiCodeDoc, IconGuiCursor, IconGuiExpand, IconGuiFilterFlowStep0, IconGuiFilterFlowStep1, IconGuiFilterFlowStep2, IconGuiFilterFlowStep3, IconGuiFlowerGrowth, IconGuiFurtherReading, IconGuiGlasses, IconGuiHistory, IconGuiLiveChat, IconGuiMouse, IconGuiPartial, IconGuiPitfall, IconGuiProdAssetTrackingOutline, IconGuiProdAssetTrackingSolid, IconGuiProdChatOutline, IconGuiProdChatSolid, IconGuiProdLiveobjectsOutline, IconGuiProdLiveobjectsSolid, IconGuiProdLivesyncOutline, IconGuiProdLivesyncSolid, IconGuiProdPubsubOutline, IconGuiProdPubsubSolid, IconGuiProdSpacesOutline, IconGuiProdSpacesSolid, IconGuiQuoteMarksFill, IconGuiRefresh, IconGuiResources, IconGuiSpinnerDark, IconGuiSpinnerLight, };
|
|
4846
|
+
import IconProductAssetTrackingMono from "@ably/ui/core/icon-product-asset-tracking-mono";
|
|
4847
|
+
import IconProductAssetTracking from "@ably/ui/core/icon-product-asset-tracking";
|
|
4848
|
+
import IconProductChatMono from "@ably/ui/core/icon-product-chat-mono";
|
|
4849
|
+
import IconProductChat from "@ably/ui/core/icon-product-chat";
|
|
4850
|
+
import IconProductLiveobjectsDark from "@ably/ui/core/icon-product-liveobjects-dark";
|
|
4851
|
+
import IconProductLiveobjectsMono from "@ably/ui/core/icon-product-liveobjects-mono";
|
|
4852
|
+
import IconProductLiveobjects from "@ably/ui/core/icon-product-liveobjects";
|
|
4853
|
+
import IconProductLivesyncMono from "@ably/ui/core/icon-product-livesync-mono";
|
|
4854
|
+
import IconProductLivesync from "@ably/ui/core/icon-product-livesync";
|
|
4855
|
+
import IconProductPlatformMono from "@ably/ui/core/icon-product-platform-mono";
|
|
4856
|
+
import IconProductPlatform from "@ably/ui/core/icon-product-platform";
|
|
4857
|
+
import IconProductPubsubMono from "@ably/ui/core/icon-product-pubsub-mono";
|
|
4858
|
+
import IconProductPubsub from "@ably/ui/core/icon-product-pubsub";
|
|
4859
|
+
import IconProductSpacesMono from "@ably/ui/core/icon-product-spaces-mono";
|
|
4860
|
+
import IconProductSpaces from "@ably/ui/core/icon-product-spaces";
|
|
4861
|
+
export { IconProductAssetTrackingMono, IconProductAssetTracking, IconProductChatMono, IconProductChat, IconProductLiveobjectsDark, IconProductLiveobjectsMono, IconProductLiveobjects, IconProductLivesyncMono, IconProductLivesync, IconProductPlatformMono, IconProductPlatform, IconProductPubsubMono, IconProductPubsub, IconProductSpacesMono, IconProductSpaces, };
|
|
4862
|
+
import IconSocialDiscordMono from "@ably/ui/core/icon-social-discord-mono";
|
|
4863
|
+
import IconSocialDiscord from "@ably/ui/core/icon-social-discord";
|
|
4864
|
+
import IconSocialFacebookMono from "@ably/ui/core/icon-social-facebook-mono";
|
|
4865
|
+
import IconSocialFacebook from "@ably/ui/core/icon-social-facebook";
|
|
4866
|
+
import IconSocialGithubMono from "@ably/ui/core/icon-social-github-mono";
|
|
4867
|
+
import IconSocialGithub from "@ably/ui/core/icon-social-github";
|
|
4868
|
+
import IconSocialGlassdoorMono from "@ably/ui/core/icon-social-glassdoor-mono";
|
|
4869
|
+
import IconSocialGlassdoor from "@ably/ui/core/icon-social-glassdoor";
|
|
4870
|
+
import IconSocialGoogleMono from "@ably/ui/core/icon-social-google-mono";
|
|
4871
|
+
import IconSocialGoogle from "@ably/ui/core/icon-social-google";
|
|
4872
|
+
import IconSocialLinkedinMono from "@ably/ui/core/icon-social-linkedin-mono";
|
|
4873
|
+
import IconSocialLinkedin from "@ably/ui/core/icon-social-linkedin";
|
|
4874
|
+
import IconSocialSlackMono from "@ably/ui/core/icon-social-slack-mono";
|
|
4875
|
+
import IconSocialSlack from "@ably/ui/core/icon-social-slack";
|
|
4876
|
+
import IconSocialStackoverflowMono from "@ably/ui/core/icon-social-stackoverflow-mono";
|
|
4877
|
+
import IconSocialStackoverflow from "@ably/ui/core/icon-social-stackoverflow";
|
|
4878
|
+
import IconSocialTwitterMono from "@ably/ui/core/icon-social-twitter-mono";
|
|
4879
|
+
import IconSocialTwitter from "@ably/ui/core/icon-social-twitter";
|
|
4880
|
+
import IconSocialXMono from "@ably/ui/core/icon-social-x-mono";
|
|
4881
|
+
import IconSocialX from "@ably/ui/core/icon-social-x";
|
|
4882
|
+
import IconSocialYoutubeMono from "@ably/ui/core/icon-social-youtube-mono";
|
|
4883
|
+
import IconSocialYoutube from "@ably/ui/core/icon-social-youtube";
|
|
4884
|
+
export { IconSocialDiscordMono, IconSocialDiscord, IconSocialFacebookMono, IconSocialFacebook, IconSocialGithubMono, IconSocialGithub, IconSocialGlassdoorMono, IconSocialGlassdoor, IconSocialGoogleMono, IconSocialGoogle, IconSocialLinkedinMono, IconSocialLinkedin, IconSocialSlackMono, IconSocialSlack, IconSocialStackoverflowMono, IconSocialStackoverflow, IconSocialTwitterMono, IconSocialTwitter, IconSocialXMono, IconSocialX, IconSocialYoutubeMono, IconSocialYoutube, };
|
|
4885
|
+
import IconTechAblyApiStreamer from "@ably/ui/core/icon-tech-ably-api-streamer";
|
|
4886
|
+
import IconTechAblyFirehose from "@ably/ui/core/icon-tech-ably-firehose";
|
|
4887
|
+
import IconTechAblyNative from "@ably/ui/core/icon-tech-ably-native";
|
|
4888
|
+
import IconTechAbly from "@ably/ui/core/icon-tech-ably";
|
|
4889
|
+
import IconTechActivemq from "@ably/ui/core/icon-tech-activemq";
|
|
4890
|
+
import IconTechActivitypub from "@ably/ui/core/icon-tech-activitypub";
|
|
4891
|
+
import IconTechAerospike from "@ably/ui/core/icon-tech-aerospike";
|
|
4892
|
+
import IconTechAkka from "@ably/ui/core/icon-tech-akka";
|
|
4893
|
+
import IconTechAmazonEc2 from "@ably/ui/core/icon-tech-amazon-ec2";
|
|
4894
|
+
import IconTechAmazonEventBridge from "@ably/ui/core/icon-tech-amazon-event-bridge";
|
|
4895
|
+
import IconTechAmqp091 from "@ably/ui/core/icon-tech-amqp091";
|
|
4896
|
+
import IconTechAmqp10 from "@ably/ui/core/icon-tech-amqp10";
|
|
4897
|
+
import IconTechAndroidFull from "@ably/ui/core/icon-tech-android-full";
|
|
4898
|
+
import IconTechAndroidHead from "@ably/ui/core/icon-tech-android-head";
|
|
4899
|
+
import IconTechAngular from "@ably/ui/core/icon-tech-angular";
|
|
4900
|
+
import IconTechAnycable from "@ably/ui/core/icon-tech-anycable";
|
|
4901
|
+
import IconTechApacheCassandra from "@ably/ui/core/icon-tech-apache-cassandra";
|
|
4902
|
+
import IconTechApacheCordova from "@ably/ui/core/icon-tech-apache-cordova";
|
|
4903
|
+
import IconTechApacheKafka from "@ably/ui/core/icon-tech-apache-kafka";
|
|
4904
|
+
import IconTechApacheSpark from "@ably/ui/core/icon-tech-apache-spark";
|
|
4905
|
+
import IconTechApachepulsar from "@ably/ui/core/icon-tech-apachepulsar";
|
|
4906
|
+
import IconTechApachestorm from "@ably/ui/core/icon-tech-apachestorm";
|
|
4907
|
+
import IconTechApns from "@ably/ui/core/icon-tech-apns";
|
|
4908
|
+
import IconTechAssemblyai from "@ably/ui/core/icon-tech-assemblyai";
|
|
4909
|
+
import IconTechAtmosphere from "@ably/ui/core/icon-tech-atmosphere";
|
|
4910
|
+
import IconTechAwsAppSync from "@ably/ui/core/icon-tech-aws-app-sync";
|
|
4911
|
+
import IconTechAwsAurora from "@ably/ui/core/icon-tech-aws-aurora";
|
|
4912
|
+
import IconTechAwsGatewayWebsockets from "@ably/ui/core/icon-tech-aws-gateway-websockets";
|
|
4913
|
+
import IconTechAwsSns from "@ably/ui/core/icon-tech-aws-sns";
|
|
4914
|
+
import IconTechAwsSqs from "@ably/ui/core/icon-tech-aws-sqs";
|
|
4915
|
+
import IconTechAws from "@ably/ui/core/icon-tech-aws";
|
|
4916
|
+
import IconTechAwsiot from "@ably/ui/core/icon-tech-awsiot";
|
|
4917
|
+
import IconTechAwskinesis from "@ably/ui/core/icon-tech-awskinesis";
|
|
4918
|
+
import IconTechAwslambda from "@ably/ui/core/icon-tech-awslambda";
|
|
4919
|
+
import IconTechAwssqs from "@ably/ui/core/icon-tech-awssqs";
|
|
4920
|
+
import IconTechAzureApi from "@ably/ui/core/icon-tech-azure-api";
|
|
4921
|
+
import IconTechAzureArchiveApi from "@ably/ui/core/icon-tech-azure-archive-api";
|
|
4922
|
+
import IconTechAzureBus from "@ably/ui/core/icon-tech-azure-bus";
|
|
4923
|
+
import IconTechAzureCosmos from "@ably/ui/core/icon-tech-azure-cosmos";
|
|
4924
|
+
import IconTechAzureEventHub from "@ably/ui/core/icon-tech-azure-event-hub";
|
|
4925
|
+
import IconTechAzureFunctions from "@ably/ui/core/icon-tech-azure-functions";
|
|
4926
|
+
import IconTechAzureSearch from "@ably/ui/core/icon-tech-azure-search";
|
|
4927
|
+
import IconTechAzureStaticWebApp from "@ably/ui/core/icon-tech-azure-static-web-app";
|
|
4928
|
+
import IconTechAzureStaticWebApps from "@ably/ui/core/icon-tech-azure-static-web-apps";
|
|
4929
|
+
import IconTechAzureStorage from "@ably/ui/core/icon-tech-azure-storage";
|
|
4930
|
+
import IconTechAzureWebPubsub from "@ably/ui/core/icon-tech-azure-web-pubsub";
|
|
4931
|
+
import IconTechAzurefunctions from "@ably/ui/core/icon-tech-azurefunctions";
|
|
4932
|
+
import IconTechAzureservicebus from "@ably/ui/core/icon-tech-azureservicebus";
|
|
4933
|
+
import IconTechAzuresignalR from "@ably/ui/core/icon-tech-azuresignalR";
|
|
4934
|
+
import IconTechBayeux from "@ably/ui/core/icon-tech-bayeux";
|
|
4935
|
+
import IconTechC from "@ably/ui/core/icon-tech-c";
|
|
4936
|
+
import IconTechCentrifugo from "@ably/ui/core/icon-tech-centrifugo";
|
|
4937
|
+
import IconTechClientSideFrameworks from "@ably/ui/core/icon-tech-client-side-frameworks";
|
|
4938
|
+
import IconTechClojure from "@ably/ui/core/icon-tech-clojure";
|
|
4939
|
+
import IconTechCloudflareDurableObjects from "@ably/ui/core/icon-tech-cloudflare-durable-objects";
|
|
4940
|
+
import IconTechCloudflareworkers from "@ably/ui/core/icon-tech-cloudflareworkers";
|
|
4941
|
+
import IconTechCocoa from "@ably/ui/core/icon-tech-cocoa";
|
|
4942
|
+
import IconTechConfluent from "@ably/ui/core/icon-tech-confluent";
|
|
4943
|
+
import IconTechCord from "@ably/ui/core/icon-tech-cord";
|
|
4944
|
+
import IconTechCsharp from "@ably/ui/core/icon-tech-csharp";
|
|
4945
|
+
import IconTechCurl from "@ably/ui/core/icon-tech-curl";
|
|
4946
|
+
import IconTechCustomwebhooks from "@ably/ui/core/icon-tech-customwebhooks";
|
|
4947
|
+
import IconTechDatadog from "@ably/ui/core/icon-tech-datadog";
|
|
4948
|
+
import IconTechDesignPatterns from "@ably/ui/core/icon-tech-design-patterns";
|
|
4949
|
+
import IconTechDevplatforms from "@ably/ui/core/icon-tech-devplatforms";
|
|
4950
|
+
import IconTechDiffusionData from "@ably/ui/core/icon-tech-diffusion-data";
|
|
4951
|
+
import IconTechDjango from "@ably/ui/core/icon-tech-django";
|
|
4952
|
+
import IconTechEngineio from "@ably/ui/core/icon-tech-engineio";
|
|
4953
|
+
import IconTechEventDrivenServers from "@ably/ui/core/icon-tech-event-driven-servers";
|
|
4954
|
+
import IconTechFanoutIo from "@ably/ui/core/icon-tech-fanout-io";
|
|
4955
|
+
import IconTechFastApi from "@ably/ui/core/icon-tech-fast-api";
|
|
4956
|
+
import IconTechFauna from "@ably/ui/core/icon-tech-fauna";
|
|
4957
|
+
import IconTechFeatherjs from "@ably/ui/core/icon-tech-featherjs";
|
|
4958
|
+
import IconTechFirebaseCloudMessaging from "@ably/ui/core/icon-tech-firebase-cloud-messaging";
|
|
4959
|
+
import IconTechFirebase from "@ably/ui/core/icon-tech-firebase";
|
|
4960
|
+
import IconTechFlutter from "@ably/ui/core/icon-tech-flutter";
|
|
4961
|
+
import IconTechGcloudbigquery from "@ably/ui/core/icon-tech-gcloudbigquery";
|
|
4962
|
+
import IconTechGclouddataflow from "@ably/ui/core/icon-tech-gclouddataflow";
|
|
4963
|
+
import IconTechGcloudfunctions from "@ably/ui/core/icon-tech-gcloudfunctions";
|
|
4964
|
+
import IconTechGcloudpubsub from "@ably/ui/core/icon-tech-gcloudpubsub";
|
|
4965
|
+
import IconTechGo from "@ably/ui/core/icon-tech-go";
|
|
4966
|
+
import IconTechGrpc from "@ably/ui/core/icon-tech-grpc";
|
|
4967
|
+
import IconTechHivemq from "@ably/ui/core/icon-tech-hivemq";
|
|
4968
|
+
import IconTechHttp2 from "@ably/ui/core/icon-tech-http2";
|
|
4969
|
+
import IconTechHttp3 from "@ably/ui/core/icon-tech-http3";
|
|
4970
|
+
import IconTechHttprest from "@ably/ui/core/icon-tech-httprest";
|
|
4971
|
+
import IconTechIdempotency from "@ably/ui/core/icon-tech-idempotency";
|
|
4972
|
+
import IconTechIfttt from "@ably/ui/core/icon-tech-ifttt";
|
|
4973
|
+
import IconTechIntegrations from "@ably/ui/core/icon-tech-integrations";
|
|
4974
|
+
import IconTechIosGeneric from "@ably/ui/core/icon-tech-ios-generic";
|
|
4975
|
+
import IconTechIos from "@ably/ui/core/icon-tech-ios";
|
|
4976
|
+
import IconTechIpados from "@ably/ui/core/icon-tech-ipados";
|
|
4977
|
+
import IconTechIpfs from "@ably/ui/core/icon-tech-ipfs";
|
|
4978
|
+
import IconTechIronmq from "@ably/ui/core/icon-tech-ironmq";
|
|
4979
|
+
import IconTechJava from "@ably/ui/core/icon-tech-java";
|
|
4980
|
+
import IconTechJavascript from "@ably/ui/core/icon-tech-javascript";
|
|
4981
|
+
import IconTechJms from "@ably/ui/core/icon-tech-jms";
|
|
4982
|
+
import IconTechJsonWebTokens from "@ably/ui/core/icon-tech-json-web-tokens";
|
|
4983
|
+
import IconTechJson from "@ably/ui/core/icon-tech-json";
|
|
4984
|
+
import IconTechKaazing from "@ably/ui/core/icon-tech-kaazing";
|
|
4985
|
+
import IconTechKotlin from "@ably/ui/core/icon-tech-kotlin";
|
|
4986
|
+
import IconTechKsqlDb from "@ably/ui/core/icon-tech-ksql-db";
|
|
4987
|
+
import IconTechKubernetes from "@ably/ui/core/icon-tech-kubernetes";
|
|
4988
|
+
import IconTechLaravelBroadcast from "@ably/ui/core/icon-tech-laravel-broadcast";
|
|
4989
|
+
import IconTechLaravelEcho from "@ably/ui/core/icon-tech-laravel-echo";
|
|
4990
|
+
import IconTechLightstreamer from "@ably/ui/core/icon-tech-lightstreamer";
|
|
4991
|
+
import IconTechLiveblocks from "@ably/ui/core/icon-tech-liveblocks";
|
|
4992
|
+
import IconTechLongpolling from "@ably/ui/core/icon-tech-longpolling";
|
|
4993
|
+
import IconTechMacos from "@ably/ui/core/icon-tech-macos";
|
|
4994
|
+
import IconTechMatrix from "@ably/ui/core/icon-tech-matrix";
|
|
4995
|
+
import IconTechMeteor from "@ably/ui/core/icon-tech-meteor";
|
|
4996
|
+
import IconTechMongoDb from "@ably/ui/core/icon-tech-mongo-db";
|
|
4997
|
+
import IconTechMono from "@ably/ui/core/icon-tech-mono";
|
|
4998
|
+
import IconTechMqtt from "@ably/ui/core/icon-tech-mqtt";
|
|
4999
|
+
import IconTechMysql from "@ably/ui/core/icon-tech-mysql";
|
|
5000
|
+
import IconTechNativeScript from "@ably/ui/core/icon-tech-native-script";
|
|
5001
|
+
import IconTechNet from "@ably/ui/core/icon-tech-net";
|
|
5002
|
+
import IconTechNetlify from "@ably/ui/core/icon-tech-netlify";
|
|
5003
|
+
import IconTechNextjs from "@ably/ui/core/icon-tech-nextjs";
|
|
5004
|
+
import IconTechNkn from "@ably/ui/core/icon-tech-nkn";
|
|
5005
|
+
import IconTechNodejs from "@ably/ui/core/icon-tech-nodejs";
|
|
5006
|
+
import IconTechObjectivec from "@ably/ui/core/icon-tech-objectivec";
|
|
5007
|
+
import IconTechOpenai from "@ably/ui/core/icon-tech-openai";
|
|
5008
|
+
import IconTechParseServer from "@ably/ui/core/icon-tech-parse-server";
|
|
5009
|
+
import IconTechPhp from "@ably/ui/core/icon-tech-php";
|
|
5010
|
+
import IconTechPlanetscale from "@ably/ui/core/icon-tech-planetscale";
|
|
5011
|
+
import IconTechPostgres from "@ably/ui/core/icon-tech-postgres";
|
|
5012
|
+
import IconTechPrisma from "@ably/ui/core/icon-tech-prisma";
|
|
5013
|
+
import IconTechProgramminglanguages from "@ably/ui/core/icon-tech-programminglanguages";
|
|
5014
|
+
import IconTechProtcolAdaptors from "@ably/ui/core/icon-tech-protcol-adaptors";
|
|
5015
|
+
import IconTechProtocols from "@ably/ui/core/icon-tech-protocols";
|
|
5016
|
+
import IconTechPubSub from "@ably/ui/core/icon-tech-pub-sub";
|
|
5017
|
+
import IconTechPubnub from "@ably/ui/core/icon-tech-pubnub";
|
|
5018
|
+
import IconTechPushTechnology from "@ably/ui/core/icon-tech-push-technology";
|
|
5019
|
+
import IconTechPusher from "@ably/ui/core/icon-tech-pusher";
|
|
5020
|
+
import IconTechPython from "@ably/ui/core/icon-tech-python";
|
|
5021
|
+
import IconTechQuic from "@ably/ui/core/icon-tech-quic";
|
|
5022
|
+
import IconTechRabbitMQ from "@ably/ui/core/icon-tech-rabbitMQ";
|
|
5023
|
+
import IconTechRailsactioncable from "@ably/ui/core/icon-tech-railsactioncable";
|
|
5024
|
+
import IconTechReactApp from "@ably/ui/core/icon-tech-react-app";
|
|
5025
|
+
import IconTechReact from "@ably/ui/core/icon-tech-react";
|
|
5026
|
+
import IconTechReactnative from "@ably/ui/core/icon-tech-reactnative";
|
|
5027
|
+
import IconTechRedis from "@ably/ui/core/icon-tech-redis";
|
|
5028
|
+
import IconTechRedpanda from "@ably/ui/core/icon-tech-redpanda";
|
|
5029
|
+
import IconTechReplicache from "@ably/ui/core/icon-tech-replicache";
|
|
5030
|
+
import IconTechRethinkdb from "@ably/ui/core/icon-tech-rethinkdb";
|
|
5031
|
+
import IconTechRocketmq from "@ably/ui/core/icon-tech-rocketmq";
|
|
5032
|
+
import IconTechRuby from "@ably/ui/core/icon-tech-ruby";
|
|
5033
|
+
import IconTechScala from "@ably/ui/core/icon-tech-scala";
|
|
5034
|
+
import IconTechScaledrone from "@ably/ui/core/icon-tech-scaledrone";
|
|
5035
|
+
import IconTechServersentevents from "@ably/ui/core/icon-tech-serversentevents";
|
|
5036
|
+
import IconTechServersideframeworks from "@ably/ui/core/icon-tech-serversideframeworks";
|
|
5037
|
+
import IconTechSignalR from "@ably/ui/core/icon-tech-signalR";
|
|
5038
|
+
import IconTechSnowflake from "@ably/ui/core/icon-tech-snowflake";
|
|
5039
|
+
import IconTechSocketio from "@ably/ui/core/icon-tech-socketio";
|
|
5040
|
+
import IconTechSockjs from "@ably/ui/core/icon-tech-sockjs";
|
|
5041
|
+
import IconTechSolace from "@ably/ui/core/icon-tech-solace";
|
|
5042
|
+
import IconTechSpring from "@ably/ui/core/icon-tech-spring";
|
|
5043
|
+
import IconTechStomp from "@ably/ui/core/icon-tech-stomp";
|
|
5044
|
+
import IconTechStreamdataIo from "@ably/ui/core/icon-tech-streamdata-io";
|
|
5045
|
+
import IconTechStreamr from "@ably/ui/core/icon-tech-streamr";
|
|
5046
|
+
import IconTechSwift from "@ably/ui/core/icon-tech-swift";
|
|
5047
|
+
import IconTechSymfonyMercure from "@ably/ui/core/icon-tech-symfony-mercure";
|
|
5048
|
+
import IconTechSymfony from "@ably/ui/core/icon-tech-symfony";
|
|
5049
|
+
import IconTechTcpIp from "@ably/ui/core/icon-tech-tcp-ip";
|
|
5050
|
+
import IconTechTenefit from "@ably/ui/core/icon-tech-tenefit";
|
|
5051
|
+
import IconTechTerraform from "@ably/ui/core/icon-tech-terraform";
|
|
5052
|
+
import IconTechTvos from "@ably/ui/core/icon-tech-tvos";
|
|
5053
|
+
import IconTechTwilio from "@ably/ui/core/icon-tech-twilio";
|
|
5054
|
+
import IconTechTypescript from "@ably/ui/core/icon-tech-typescript";
|
|
5055
|
+
import IconTechUdpProtocol from "@ably/ui/core/icon-tech-udp-protocol";
|
|
5056
|
+
import IconTechUnity from "@ably/ui/core/icon-tech-unity";
|
|
5057
|
+
import IconTechVercel from "@ably/ui/core/icon-tech-vercel";
|
|
5058
|
+
import IconTechVscode from "@ably/ui/core/icon-tech-vscode";
|
|
5059
|
+
import IconTechVuejs from "@ably/ui/core/icon-tech-vuejs";
|
|
5060
|
+
import IconTechWamp from "@ably/ui/core/icon-tech-wamp";
|
|
5061
|
+
import IconTechWatchos from "@ably/ui/core/icon-tech-watchos";
|
|
5062
|
+
import IconTechWebPush from "@ably/ui/core/icon-tech-web-push";
|
|
5063
|
+
import IconTechWeb from "@ably/ui/core/icon-tech-web";
|
|
5064
|
+
import IconTechWebhooks from "@ably/ui/core/icon-tech-webhooks";
|
|
5065
|
+
import IconTechWebrtc from "@ably/ui/core/icon-tech-webrtc";
|
|
5066
|
+
import IconTechWebsockets from "@ably/ui/core/icon-tech-websockets";
|
|
5067
|
+
import IconTechWebsub from "@ably/ui/core/icon-tech-websub";
|
|
5068
|
+
import IconTechXamarin from "@ably/ui/core/icon-tech-xamarin";
|
|
5069
|
+
import IconTechXhrStreaming from "@ably/ui/core/icon-tech-xhr-streaming";
|
|
5070
|
+
import IconTechXmpp from "@ably/ui/core/icon-tech-xmpp";
|
|
5071
|
+
import IconTechZapier from "@ably/ui/core/icon-tech-zapier";
|
|
5072
|
+
import IconTechZeromq from "@ably/ui/core/icon-tech-zeromq";
|
|
5073
|
+
export { IconTechAblyApiStreamer, IconTechAblyFirehose, IconTechAblyNative, IconTechAbly, IconTechActivemq, IconTechActivitypub, IconTechAerospike, IconTechAkka, IconTechAmazonEc2, IconTechAmazonEventBridge, IconTechAmqp091, IconTechAmqp10, IconTechAndroidFull, IconTechAndroidHead, IconTechAngular, IconTechAnycable, IconTechApacheCassandra, IconTechApacheCordova, IconTechApacheKafka, IconTechApacheSpark, IconTechApachepulsar, IconTechApachestorm, IconTechApns, IconTechAssemblyai, IconTechAtmosphere, IconTechAwsAppSync, IconTechAwsAurora, IconTechAwsGatewayWebsockets, IconTechAwsSns, IconTechAwsSqs, IconTechAws, IconTechAwsiot, IconTechAwskinesis, IconTechAwslambda, IconTechAwssqs, IconTechAzureApi, IconTechAzureArchiveApi, IconTechAzureBus, IconTechAzureCosmos, IconTechAzureEventHub, IconTechAzureFunctions, IconTechAzureSearch, IconTechAzureStaticWebApp, IconTechAzureStaticWebApps, IconTechAzureStorage, IconTechAzureWebPubsub, IconTechAzurefunctions, IconTechAzureservicebus, IconTechAzuresignalR, IconTechBayeux, IconTechC, IconTechCentrifugo, IconTechClientSideFrameworks, IconTechClojure, IconTechCloudflareDurableObjects, IconTechCloudflareworkers, IconTechCocoa, IconTechConfluent, IconTechCord, IconTechCsharp, IconTechCurl, IconTechCustomwebhooks, IconTechDatadog, IconTechDesignPatterns, IconTechDevplatforms, IconTechDiffusionData, IconTechDjango, IconTechEngineio, IconTechEventDrivenServers, IconTechFanoutIo, IconTechFastApi, IconTechFauna, IconTechFeatherjs, IconTechFirebaseCloudMessaging, IconTechFirebase, IconTechFlutter, IconTechGcloudbigquery, IconTechGclouddataflow, IconTechGcloudfunctions, IconTechGcloudpubsub, IconTechGo, IconTechGrpc, IconTechHivemq, IconTechHttp2, IconTechHttp3, IconTechHttprest, IconTechIdempotency, IconTechIfttt, IconTechIntegrations, IconTechIosGeneric, IconTechIos, IconTechIpados, IconTechIpfs, IconTechIronmq, IconTechJava, IconTechJavascript, IconTechJms, IconTechJsonWebTokens, IconTechJson, IconTechKaazing, IconTechKotlin, IconTechKsqlDb, IconTechKubernetes, IconTechLaravelBroadcast, IconTechLaravelEcho, IconTechLightstreamer, IconTechLiveblocks, IconTechLongpolling, IconTechMacos, IconTechMatrix, IconTechMeteor, IconTechMongoDb, IconTechMono, IconTechMqtt, IconTechMysql, IconTechNativeScript, IconTechNet, IconTechNetlify, IconTechNextjs, IconTechNkn, IconTechNodejs, IconTechObjectivec, IconTechOpenai, IconTechParseServer, IconTechPhp, IconTechPlanetscale, IconTechPostgres, IconTechPrisma, IconTechProgramminglanguages, IconTechProtcolAdaptors, IconTechProtocols, IconTechPubSub, IconTechPubnub, IconTechPushTechnology, IconTechPusher, IconTechPython, IconTechQuic, IconTechRabbitMQ, IconTechRailsactioncable, IconTechReactApp, IconTechReact, IconTechReactnative, IconTechRedis, IconTechRedpanda, IconTechReplicache, IconTechRethinkdb, IconTechRocketmq, IconTechRuby, IconTechScala, IconTechScaledrone, IconTechServersentevents, IconTechServersideframeworks, IconTechSignalR, IconTechSnowflake, IconTechSocketio, IconTechSockjs, IconTechSolace, IconTechSpring, IconTechStomp, IconTechStreamdataIo, IconTechStreamr, IconTechSwift, IconTechSymfonyMercure, IconTechSymfony, IconTechTcpIp, IconTechTenefit, IconTechTerraform, IconTechTvos, IconTechTwilio, IconTechTypescript, IconTechUdpProtocol, IconTechUnity, IconTechVercel, IconTechVscode, IconTechVuejs, IconTechWamp, IconTechWatchos, IconTechWebPush, IconTechWeb, IconTechWebhooks, IconTechWebrtc, IconTechWebsockets, IconTechWebsub, IconTechXamarin, IconTechXhrStreaming, IconTechXmpp, IconTechZapier, IconTechZeromq, };
|
|
5074
|
+
//# sourceMappingURL=index.d.ts.map
|
|
5075
|
+
}
|
|
5076
|
+
|
|
4709
5077
|
declare module '@ably/ui/core/Icon/computed-icons/display-icons' {
|
|
4710
5078
|
export const displayIcons: readonly ["icon-display-48hrs", "icon-display-ably-channels", "icon-display-about-ably-col", "icon-display-api", "icon-display-api-keys", "icon-display-architectural-guidance", "icon-display-asset-tracking-col", "icon-display-authentication", "icon-display-avatar-stack", "icon-display-browser", "icon-display-calendar", "icon-display-call-mobile", "icon-display-careers-col", "icon-display-case-studies-col", "icon-display-chat-col", "icon-display-chat-mono", "icon-display-chat-stack", "icon-display-chat-stack-col", "icon-display-cloud-servers", "icon-display-compare-tech-col", "icon-display-connection-state-recovery", "icon-display-consumer-groups", "icon-display-custom", "icon-display-custom-cname", "icon-display-customers-col", "icon-display-data-broadcast-col", "icon-display-data-broadcast-mono", "icon-display-data-synchronization-col", "icon-display-dedicated-cluster", "icon-display-deltas", "icon-display-docs-col", "icon-display-documentation", "icon-display-dynamic-channel-groups", "icon-display-edge-network", "icon-display-elasticity", "icon-display-equalisers-mono", "icon-display-events-col", "icon-display-exactly-once-delivery", "icon-display-examples-col", "icon-display-fan-out", "icon-display-firehose", "icon-display-gdpr", "icon-display-general-comms", "icon-display-granular-permissions", "icon-display-hipaa", "icon-display-hipaa-mono", "icon-display-history", "icon-display-integrations", "icon-display-integrations-col", "icon-display-it-support-access", "icon-display-it-support-helpdesk", "icon-display-kafka-at-the-edge-col", "icon-display-laptop", "icon-display-last-seen", "icon-display-lightbulb-col", "icon-display-live-chat", "icon-display-live-updates-results-metrics-col", "icon-display-map-pin", "icon-display-message", "icon-display-message-batching", "icon-display-message-persistence", "icon-display-message-queues", "icon-display-multi-user-spaces-col", "icon-display-observe-analytics", "icon-display-padlock-closed", "icon-display-platform", "icon-display-play", "icon-display-premium-support", "icon-display-privacy-shield-framework", "icon-display-private-link", "icon-display-push-notifications", "icon-display-push-notifications-col", "icon-display-push-notifications-mono", "icon-display-quickstart-guides-col", "icon-display-reactions", "icon-display-read-receipts", "icon-display-resources-col", "icon-display-rewind", "icon-display-sdks-col", "icon-display-send-received-messages", "icon-display-servers", "icon-display-shopping-cart", "icon-display-sla", "icon-display-soc2-type2", "icon-display-soc2-type2-mono", "icon-display-subscription-filters", "icon-display-support-chat-mono", "icon-display-system-metadata", "icon-display-tech-account-comms", "icon-display-tutorials-demos-col", "icon-display-virtual-events", "icon-display-virtual-events-col"];
|
|
4711
5079
|
//# sourceMappingURL=display-icons.d.ts.map
|
|
@@ -5210,6 +5578,15 @@ export default SegmentedControl;
|
|
|
5210
5578
|
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
5211
5579
|
}
|
|
5212
5580
|
|
|
5581
|
+
declare module '@ably/ui/core/Slider/component' {
|
|
5582
|
+
export default Slider;
|
|
5583
|
+
function Slider({ container, mqEnableThreshold }: {
|
|
5584
|
+
container: any;
|
|
5585
|
+
mqEnableThreshold: any;
|
|
5586
|
+
}): void;
|
|
5587
|
+
//# sourceMappingURL=component.d.ts.map
|
|
5588
|
+
}
|
|
5589
|
+
|
|
5213
5590
|
declare module '@ably/ui/core/Slider' {
|
|
5214
5591
|
import { ReactNode } from "react";
|
|
5215
5592
|
interface SliderProps {
|
|
@@ -5397,6 +5774,11 @@ export default Tooltip;
|
|
|
5397
5774
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
5398
5775
|
}
|
|
5399
5776
|
|
|
5777
|
+
declare module '@ably/ui/core/css' {
|
|
5778
|
+
export function remsToPixelValue(remString: any): number;
|
|
5779
|
+
//# sourceMappingURL=css.d.ts.map
|
|
5780
|
+
}
|
|
5781
|
+
|
|
5400
5782
|
declare module '@ably/ui/core/dom-query' {
|
|
5401
5783
|
export const queryId: (val: string, root?: ParentNode) => Element | null;
|
|
5402
5784
|
export const queryIdAll: (val: string, root?: ParentNode) => NodeListOf<Element>;
|
|
@@ -5410,6 +5792,178 @@ export default useRailsUjsLinks;
|
|
|
5410
5792
|
//# sourceMappingURL=use-rails-ujs-hooks.d.ts.map
|
|
5411
5793
|
}
|
|
5412
5794
|
|
|
5795
|
+
declare module '@ably/ui/core/insights/command-queue' {
|
|
5796
|
+
import { AnalyticsService, InsightsConfig, InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
|
|
5797
|
+
export class InsightsCommandQueue implements AnalyticsService {
|
|
5798
|
+
private isInitialized;
|
|
5799
|
+
private queue;
|
|
5800
|
+
private debugMode;
|
|
5801
|
+
private realImplementation;
|
|
5802
|
+
constructor();
|
|
5803
|
+
private executeInitInsights;
|
|
5804
|
+
private processQueue;
|
|
5805
|
+
initInsights(_config: InsightsConfig): void;
|
|
5806
|
+
enableDebugMode(): void;
|
|
5807
|
+
disableDebugMode(): void;
|
|
5808
|
+
identify(_identity: InsightsIdentity): void;
|
|
5809
|
+
trackPageView(_options?: TrackPageViewOptions): void;
|
|
5810
|
+
track(_event: string, _properties?: Record<string, unknown>): void;
|
|
5811
|
+
startSessionRecording(): void;
|
|
5812
|
+
stopSessionRecording(): void;
|
|
5813
|
+
setupObserver(): () => void;
|
|
5814
|
+
}
|
|
5815
|
+
//# sourceMappingURL=command-queue.d.ts.map
|
|
5816
|
+
}
|
|
5817
|
+
|
|
5818
|
+
declare module '@ably/ui/core/insights/datalayer' {
|
|
5819
|
+
global {
|
|
5820
|
+
interface Window {
|
|
5821
|
+
dataLayer: unknown[];
|
|
5822
|
+
}
|
|
5823
|
+
}
|
|
5824
|
+
export const track: (event: string, properties?: Record<string, unknown>) => void;
|
|
5825
|
+
export const trackPageView: () => void;
|
|
5826
|
+
//# sourceMappingURL=datalayer.d.ts.map
|
|
5827
|
+
}
|
|
5828
|
+
|
|
5829
|
+
declare module '@ably/ui/core/insights' {
|
|
5830
|
+
import { InsightsConfig, InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
|
|
5831
|
+
export type { InsightsConfig };
|
|
5832
|
+
export const initInsights: (config: InsightsConfig) => void;
|
|
5833
|
+
export const enableDebugMode: () => void;
|
|
5834
|
+
export const disableDebugMode: () => void;
|
|
5835
|
+
export const identify: (identity: InsightsIdentity) => void;
|
|
5836
|
+
export const trackPageView: (options?: TrackPageViewOptions) => void;
|
|
5837
|
+
export const track: (event: string, properties?: Record<string, unknown>) => void;
|
|
5838
|
+
export const startSessionRecording: () => void;
|
|
5839
|
+
export const stopSessionRecording: () => void;
|
|
5840
|
+
export const setupObserver: () => () => void;
|
|
5841
|
+
//# sourceMappingURL=index.d.ts.map
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
declare module '@ably/ui/core/insights/index.test' {
|
|
5845
|
+
/**
|
|
5846
|
+
* @vitest-environment jsdom
|
|
5847
|
+
*/
|
|
5848
|
+
export {};
|
|
5849
|
+
//# sourceMappingURL=index.test.d.ts.map
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
declare module '@ably/ui/core/insights/logger' {
|
|
5853
|
+
export const debug: (...args: unknown[]) => void;
|
|
5854
|
+
export const info: (...args: unknown[]) => void;
|
|
5855
|
+
export const warn: (...args: unknown[]) => void;
|
|
5856
|
+
export const error: (...args: unknown[]) => void;
|
|
5857
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
5858
|
+
}
|
|
5859
|
+
|
|
5860
|
+
declare module '@ably/ui/core/insights/mixpanel' {
|
|
5861
|
+
import { InsightsIdentity } from "@ably/ui/core/types";
|
|
5862
|
+
export const initMixpanel: (token: string, autoCapture?: boolean, debug?: boolean, recordSessionsPercent?: number) => void;
|
|
5863
|
+
export const enableDebugMode: () => void;
|
|
5864
|
+
export const disableDebugMode: () => void;
|
|
5865
|
+
export const identify: ({ userId, accountId, organisationId, email, name, }: InsightsIdentity) => void;
|
|
5866
|
+
export const trackPageView: () => void;
|
|
5867
|
+
export const track: (event: string, properties?: Record<string, unknown>) => void;
|
|
5868
|
+
export const startSessionRecording: () => void;
|
|
5869
|
+
export const stopSessionRecording: () => void;
|
|
5870
|
+
//# sourceMappingURL=mixpanel.d.ts.map
|
|
5871
|
+
}
|
|
5872
|
+
|
|
5873
|
+
declare module '@ably/ui/core/insights/posthog' {
|
|
5874
|
+
import { InsightsIdentity } from "@ably/ui/core/types";
|
|
5875
|
+
export const initPosthog: (apiKey: string, apiHost: string) => void;
|
|
5876
|
+
export const enableDebugMode: () => void;
|
|
5877
|
+
export const disableDebugMode: () => void;
|
|
5878
|
+
export const identify: ({ userId, accountId, organisationId, email, name, }: InsightsIdentity) => void;
|
|
5879
|
+
export const trackPageView: () => void;
|
|
5880
|
+
export const track: (event: string, properties?: Record<string, unknown>) => void;
|
|
5881
|
+
export const startSessionRecording: () => void;
|
|
5882
|
+
export const stopSessionRecording: () => void;
|
|
5883
|
+
//# sourceMappingURL=posthog.d.ts.map
|
|
5884
|
+
}
|
|
5885
|
+
|
|
5886
|
+
declare module '@ably/ui/core/insights/service' {
|
|
5887
|
+
import type { AnalyticsService, InsightsConfig, InsightsIdentity, TrackPageViewOptions } from "@ably/ui/core/types";
|
|
5888
|
+
export class InsightsService implements AnalyticsService {
|
|
5889
|
+
private debugMode;
|
|
5890
|
+
initInsights({ mixpanelToken, mixpanelAutoCapture, mixpanelRecordSessionsPercent, posthogApiKey, posthogApiHost, debug, }: InsightsConfig): void;
|
|
5891
|
+
enableDebugMode(): void;
|
|
5892
|
+
disableDebugMode(): void;
|
|
5893
|
+
identify(identity: InsightsIdentity): void;
|
|
5894
|
+
trackPageView(options?: TrackPageViewOptions): void;
|
|
5895
|
+
track(event: string, properties?: Record<string, unknown>): void;
|
|
5896
|
+
startSessionRecording(): void;
|
|
5897
|
+
stopSessionRecording(): void;
|
|
5898
|
+
setupObserver(): () => void;
|
|
5899
|
+
}
|
|
5900
|
+
//# sourceMappingURL=service.d.ts.map
|
|
5901
|
+
}
|
|
5902
|
+
|
|
5903
|
+
declare module '@ably/ui/core/insights/types' {
|
|
5904
|
+
export type InsightsConfig = {
|
|
5905
|
+
debug: boolean;
|
|
5906
|
+
mixpanelToken: string;
|
|
5907
|
+
mixpanelAutoCapture: boolean;
|
|
5908
|
+
mixpanelRecordSessionsPercent: number;
|
|
5909
|
+
posthogApiKey: string;
|
|
5910
|
+
posthogApiHost: string;
|
|
5911
|
+
};
|
|
5912
|
+
export interface AnalyticsService {
|
|
5913
|
+
initInsights: (config: InsightsConfig) => void;
|
|
5914
|
+
enableDebugMode: () => void;
|
|
5915
|
+
disableDebugMode: () => void;
|
|
5916
|
+
identify: (identity: InsightsIdentity) => void;
|
|
5917
|
+
trackPageView: (options?: TrackPageViewOptions) => void;
|
|
5918
|
+
track: (event: string, properties?: Record<string, unknown>) => void;
|
|
5919
|
+
startSessionRecording: () => void;
|
|
5920
|
+
stopSessionRecording: () => void;
|
|
5921
|
+
setupObserver: () => () => void;
|
|
5922
|
+
}
|
|
5923
|
+
export type Command = {
|
|
5924
|
+
methodName: keyof AnalyticsService;
|
|
5925
|
+
args: unknown[];
|
|
5926
|
+
};
|
|
5927
|
+
export type InsightsIdentity = {
|
|
5928
|
+
userId: string;
|
|
5929
|
+
accountId: string;
|
|
5930
|
+
organisationId?: string;
|
|
5931
|
+
email?: string;
|
|
5932
|
+
name?: string;
|
|
5933
|
+
};
|
|
5934
|
+
export type TrackPageViewOptions = {
|
|
5935
|
+
includeDataLayer?: boolean;
|
|
5936
|
+
};
|
|
5937
|
+
//# sourceMappingURL=types.d.ts.map
|
|
5938
|
+
}
|
|
5939
|
+
|
|
5940
|
+
declare module '@ably/ui/core/load-sprites' {
|
|
5941
|
+
function _default(spritesUrls: any): void;
|
|
5942
|
+
export default _default;
|
|
5943
|
+
//# sourceMappingURL=load-sprites.d.ts.map
|
|
5944
|
+
}
|
|
5945
|
+
|
|
5946
|
+
declare module '@ably/ui/core/react-renderer' {
|
|
5947
|
+
import React from "react";
|
|
5948
|
+
const renderComponent: (Component: React.FC, props: React.ComponentProps<React.FC>, node: HTMLElement) => void;
|
|
5949
|
+
export { renderComponent };
|
|
5950
|
+
export default function reactRenderer(components: Record<string, React.FC>): void;
|
|
5951
|
+
//# sourceMappingURL=react-renderer.d.ts.map
|
|
5952
|
+
}
|
|
5953
|
+
|
|
5954
|
+
declare module '@ably/ui/core/remote-blogs-posts' {
|
|
5955
|
+
export function fetchBlogPosts(store: any, blogUrl: any): Promise<void>;
|
|
5956
|
+
export namespace reducerBlogPosts {
|
|
5957
|
+
function blogPosts(state: {
|
|
5958
|
+
recent: null;
|
|
5959
|
+
} | undefined, action: any): {
|
|
5960
|
+
recent: any;
|
|
5961
|
+
};
|
|
5962
|
+
}
|
|
5963
|
+
export function selectRecentBlogPosts(store: any): any;
|
|
5964
|
+
//# sourceMappingURL=remote-blogs-posts.d.ts.map
|
|
5965
|
+
}
|
|
5966
|
+
|
|
5413
5967
|
declare module '@ably/ui/core/remote-data-store' {
|
|
5414
5968
|
export function attachStoreToWindow(store: any): void;
|
|
5415
5969
|
export function getRemoteDataStore(): any;
|
|
@@ -5418,6 +5972,34 @@ export function createRemoteDataStore(reducers: any): any;
|
|
|
5418
5972
|
//# sourceMappingURL=remote-data-store.d.ts.map
|
|
5419
5973
|
}
|
|
5420
5974
|
|
|
5975
|
+
declare module '@ably/ui/core/remote-data-util' {
|
|
5976
|
+
export function isJsonResponse(contentType: any): any;
|
|
5977
|
+
//# sourceMappingURL=remote-data-util.d.ts.map
|
|
5978
|
+
}
|
|
5979
|
+
|
|
5980
|
+
declare module '@ably/ui/core/remote-session-data' {
|
|
5981
|
+
export function fetchSessionData(store: any, sessionUrl: any): Promise<void>;
|
|
5982
|
+
export namespace reducerSessionData {
|
|
5983
|
+
function session(state: {
|
|
5984
|
+
data: null;
|
|
5985
|
+
} | undefined, action: any): {
|
|
5986
|
+
data: any;
|
|
5987
|
+
};
|
|
5988
|
+
}
|
|
5989
|
+
export function selectSessionData(store: any): any;
|
|
5990
|
+
//# sourceMappingURL=remote-session-data.d.ts.map
|
|
5991
|
+
}
|
|
5992
|
+
|
|
5993
|
+
declare module '@ably/ui/core/scripts' {
|
|
5994
|
+
export { default as loadSprites } from "@ably/ui/core/load-sprites";
|
|
5995
|
+
export * from "@ably/ui/core/remote-data-store";
|
|
5996
|
+
export * from "@ably/ui/core/remote-blogs-posts";
|
|
5997
|
+
export * from "@ably/ui/core/remote-session-data";
|
|
5998
|
+
export * from "@ably/ui/core/dom-query";
|
|
5999
|
+
export { default as reactRenderer, renderComponent } from "@ably/ui/core/react-renderer";
|
|
6000
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
6001
|
+
}
|
|
6002
|
+
|
|
5421
6003
|
declare module '@ably/ui/core/styles/colors/types' {
|
|
5422
6004
|
export type ColorName = (typeof neutralColors)[number] | (typeof orangeColors)[number] | (typeof secondaryColors)[number] | (typeof guiColors)[number] | (typeof aliasedColors)[number];
|
|
5423
6005
|
export const variants: readonly ["", "dark:"];
|
|
@@ -5537,5 +6119,10 @@ export default useCopyToClipboard;
|
|
|
5537
6119
|
//# sourceMappingURL=useCopyToClipboard.d.ts.map
|
|
5538
6120
|
}
|
|
5539
6121
|
|
|
6122
|
+
declare module '@ably/ui/reset/scripts' {
|
|
6123
|
+
export {};
|
|
6124
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
6125
|
+
}
|
|
6126
|
+
|
|
5540
6127
|
declare module '@ably/ui/core/scripts';
|
|
5541
6128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "17.5.
|
|
3
|
+
"version": "17.5.5-dev.2c7f8b5d",
|
|
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",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
34
34
|
"@types/js-cookie": "^3.0.6",
|
|
35
35
|
"@types/lodash.throttle": "^4.1.9",
|
|
36
|
+
"@types/mixpanel-browser": "^2.60.0",
|
|
36
37
|
"@types/node": "^20",
|
|
37
38
|
"@types/react": "^18.3.1",
|
|
38
39
|
"@types/react-dom": "^18.3.0",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"scripts": {
|
|
105
106
|
"build:prebuild": "rm -rf core reset && mkdir -p dist/core",
|
|
106
107
|
"build:swc": "ts-node swc.config.ts",
|
|
107
|
-
"build:tsc": "tsc && node tsc.
|
|
108
|
+
"build:tsc": "tsc && ts-node tsc.ts && rm -r types",
|
|
108
109
|
"build:cleanup": "mv dist/* . && rm -r dist",
|
|
109
110
|
"build:icons": "ts-node scripts/generate-icons.ts",
|
|
110
111
|
"build": "pnpm build:prebuild && pnpm build:icons && pnpm build:swc && pnpm build:tsc && pnpm build:cleanup",
|