@ably/ui 15.6.0-dev.eb9980fc → 15.7.0-dev.39da77a7
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/Flyout.js +1 -1
- package/core/Flyout.js.map +1 -1
- package/core/Header.js +1 -1
- package/core/Header.js.map +1 -1
- package/core/Meganav/component.js +2 -0
- package/core/{LegacyMeganav → Meganav}/component.js.map +1 -1
- package/core/Meganav.js +2 -0
- package/core/Meganav.js.map +1 -0
- package/core/MeganavBlogPostsList/component.js +2 -0
- package/core/MeganavBlogPostsList/component.js.map +1 -0
- package/core/MeganavBlogPostsList.js.map +1 -1
- package/core/MeganavContentCompany.js.map +1 -1
- package/core/MeganavContentDevelopers.js.map +1 -1
- package/core/MeganavContentProducts.js.map +1 -1
- package/core/MeganavContentUseCases.js.map +1 -1
- package/core/MeganavControl/component.js +2 -0
- package/core/MeganavControl/component.js.map +1 -0
- package/core/MeganavControl.js.map +1 -1
- package/core/MeganavControlMobileDropdown/component.js +2 -0
- package/core/MeganavControlMobileDropdown/component.js.map +1 -0
- package/core/MeganavControlMobileDropdown.js.map +1 -1
- package/core/MeganavControlMobilePanelClose/component.js +2 -0
- package/core/MeganavControlMobilePanelClose/component.js.map +1 -0
- package/core/MeganavControlMobilePanelOpen/component.js +2 -0
- package/core/MeganavControlMobilePanelOpen/component.js.map +1 -0
- package/core/MeganavItemsDesktop.js +1 -1
- package/core/MeganavItemsDesktop.js.map +1 -1
- package/core/MeganavItemsMobile.js +1 -1
- package/core/MeganavItemsMobile.js.map +1 -1
- package/core/MeganavItemsSignedIn.js.map +1 -1
- package/core/MeganavSearch.js.map +1 -1
- package/core/MeganavSearchAutocomplete/component.js +2 -0
- package/core/MeganavSearchAutocomplete/component.js.map +1 -0
- package/core/MeganavSearchPanel.js.map +1 -1
- package/core/MeganavSearchSuggestions/component.js +2 -0
- package/core/MeganavSearchSuggestions/component.js.map +1 -0
- package/core/MeganavSearchSuggestions.js.map +1 -1
- package/core/Notice/component.js +1 -1
- package/core/Notice/component.js.map +1 -1
- package/core/SignOutLink.js.map +1 -1
- package/core/insights/command-queue.js +2 -0
- package/core/insights/command-queue.js.map +1 -0
- package/core/insights/datalayer.js +2 -0
- package/core/insights/datalayer.js.map +1 -0
- package/core/insights/index.js +1 -1
- package/core/insights/index.js.map +1 -1
- package/core/insights/index.test.js +2 -0
- package/core/insights/index.test.js.map +1 -0
- package/core/insights/logger.js +2 -0
- package/core/insights/logger.js.map +1 -0
- package/core/insights/mixpanel.js +1 -1
- package/core/insights/mixpanel.js.map +1 -1
- package/core/insights/posthog.js +1 -1
- package/core/insights/posthog.js.map +1 -1
- package/core/insights/service.js +2 -0
- package/core/insights/service.js.map +1 -0
- package/core/insights/types.js.map +1 -1
- package/core/styles/colors/computed-colors.json +1 -0
- package/index.d.ts +109 -178
- package/package.json +8 -4
- package/core/LegacyMeganav/MeganavBlogPostsList/component.js +0 -2
- package/core/LegacyMeganav/MeganavBlogPostsList/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavControl/component.js +0 -2
- package/core/LegacyMeganav/MeganavControl/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js +0 -2
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js +0 -2
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js +0 -2
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js +0 -2
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js.map +0 -1
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js +0 -2
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js.map +0 -1
- package/core/LegacyMeganav/component.js +0 -2
- package/core/LegacyMeganav.js +0 -2
- package/core/LegacyMeganav.js.map +0 -1
- package/core/Meganav/.DS_Store +0 -0
- package/core/Meganav/Meganav.js +0 -2
- package/core/Meganav/Meganav.js.map +0 -1
- package/core/Meganav/MeganavMobile.js +0 -2
- package/core/Meganav/MeganavMobile.js.map +0 -1
- package/core/Meganav/MeganavPanel.js +0 -2
- package/core/Meganav/MeganavPanel.js.map +0 -1
- package/core/Meganav/data.js +0 -2
- package/core/Meganav/data.js.map +0 -1
- package/core/Meganav/images/fan-engagement-nav-image.png +0 -0
- package/core/Meganav/images/founders-nav-image.png +0 -0
- package/core/images/award/g2-best-meets-requirements-2025.png +0 -0
- package/core/images/award/g2-best-support-2025.png +0 -0
- package/core/images/award/g2-high-performer-2025.png +0 -0
- package/core/images/award/g2-users-most-likely-to-recommend-2025.png +0 -0
- /package/core/{LegacyMeganav → Meganav}/component.css +0 -0
- /package/core/{LegacyMeganav → Meganav}/component.json +0 -0
|
@@ -0,0 +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,E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B,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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const styles=[`background: #ff5416`,`border-radius: 0.5em`,`color: white`,`font-weight: bold`,`padding: 2px 0.5em`].join(";");export const debug=(...args)=>{console.debug(`%cinsights`,styles,...args)};export const info=(...args)=>{console.info(`%cinsights`,styles,...args)};export const warn=(...args)=>{console.warn(`%cinsights`,styles,...args)};export const error=(...args)=>{console.error(`%cinsights`,styles,...args)};
|
|
2
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/logger.ts"],"sourcesContent":["// Inspired by Gatsby's logging\n\nconst styles = [\n `background: #ff5416`, // orange-600\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n].join(\";\");\n\nexport const debug = (...args: unknown[]) => {\n console.debug(`%cinsights`, styles, ...args);\n};\n\nexport const info = (...args: unknown[]) => {\n console.info(`%cinsights`, styles, ...args);\n};\n\nexport const warn = (...args: unknown[]) => {\n console.warn(`%cinsights`, styles, ...args);\n};\n\nexport const error = (...args: unknown[]) => {\n console.error(`%cinsights`, styles, ...args);\n};\n"],"names":["styles","join","debug","args","console","info","warn","error"],"mappings":"AAEA,MAAMA,OAAS,CACb,CAAC,mBAAmB,CAAC,CACrB,CAAC,oBAAoB,CAAC,CACtB,CAAC,YAAY,CAAC,CACd,CAAC,iBAAiB,CAAC,CACnB,CAAC,kBAAkB,CAAC,CACrB,CAACC,IAAI,CAAC,IAEP,QAAO,MAAMC,MAAQ,CAAC,GAAGC,QACvBC,QAAQF,KAAK,CAAC,CAAC,UAAU,CAAC,CAAEF,UAAWG,KACzC,CAAE,AAEF,QAAO,MAAME,KAAO,CAAC,GAAGF,QACtBC,QAAQC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAEL,UAAWG,KACxC,CAAE,AAEF,QAAO,MAAMG,KAAO,CAAC,GAAGH,QACtBC,QAAQE,IAAI,CAAC,CAAC,UAAU,CAAC,CAAEN,UAAWG,KACxC,CAAE,AAEF,QAAO,MAAMI,MAAQ,CAAC,GAAGJ,QACvBC,QAAQG,KAAK,CAAC,CAAC,UAAU,CAAC,CAAEP,UAAWG,KACzC,CAAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import mixpanel from"mixpanel-browser";export const initMixpanel=(token,autoCapture=false,debug=false)=>{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}:false,track_pageview:false})};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);if(email||name){mixpanel.people.set({$email:email,$name:name})}if(accountId){mixpanel.people.union({
|
|
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})};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=mixpanel.track;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) => {\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 }\n : false,\n track_pageview: false, // We'll track page views manually\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);\n\n if (email || name) {\n mixpanel.people.set({ $email: email, $name: name });\n }\n\n if (accountId) {\n mixpanel.people.union({
|
|
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: number = 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 });\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 = mixpanel.track;\n\nexport const startSessionRecording = mixpanel.start_session_recording;\n\nexport const stopSessionRecording = mixpanel.stop_session_recording;\n"],"names":["mixpanel","initMixpanel","token","autoCapture","debug","recordSessionsPercent","blockSelectors","console","warn","init","persistence","autocapture","block_selectors","capture_text_content","track_pageview","record_sessions_percent","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","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,sBAAgC,CAAC,IAEjC,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,qBAC3B,EACF,CAAE,AAEF,QAAO,MAAMW,gBAAkB,KAC7BhB,SAASiB,UAAU,CAAC,CAAEb,MAAO,IAAK,EACpC,CAAE,AAEF,QAAO,MAAMc,iBAAmB,KAC9BlB,SAASiB,UAAU,CAAC,CAAEb,MAAO,KAAM,EACrC,CAAE,AAEF,QAAO,MAAMe,SAAW,CAAC,CACvBC,MAAM,CACNC,SAAS,CACTC,cAAc,CACdC,KAAK,CACLC,IAAI,CACa,IAGjB,GAAI,CAACJ,OAAQ,CACX,MACF,CAEApB,SAASmB,QAAQ,CAACC,OAAOK,QAAQ,IAEjC,GAAIF,OAASC,KAAM,CACjBxB,SAAS0B,MAAM,CAACC,GAAG,CAAC,CAAEC,OAAQL,MAAOM,MAAOL,IAAK,EACnD,CAEA,GAAIH,UAAW,CACbrB,SAAS0B,MAAM,CAACI,KAAK,CAAC,CAAEC,SAAU,CAACV,UAAUI,QAAQ,GAAG,AAAC,EAC3D,CAEA,GAAIH,eAAgB,CAClBtB,SAAS0B,MAAM,CAACC,GAAG,CAAC,CAAEK,gBAAiB,CAACV,eAAeG,QAAQ,GAAG,AAAC,EACrE,CACF,CAAE,CAIF,MAAMQ,kBAAoB,KACxB,MAAMC,aAAeC,OAAOC,QAAQ,CAACC,QAAQ,CAACC,KAAK,CAAC,KAEpD,MAAMC,iBAAmBL,aAAaM,GAAG,CAAC,AAACC,UAEzC,MAAO,QAAQC,IAAI,CAACD,SAAW,aAAeA,OAChD,GAGA,MAAME,IAAM,IAAIC,IAAIT,OAAOC,QAAQ,CAACS,IAAI,CACxCF,CAAAA,IAAIN,QAAQ,CAAGE,iBAAiBO,IAAI,CAAC,KAErC,OAAOC,UAAUJ,IAAIlB,QAAQ,IAAIuB,WAAW,EAC9C,CAEA,QAAO,MAAMC,cAAgB,KAE3BjD,SAASc,cAAc,CAAC,CACtBoC,cAAejB,mBACjB,EACF,CAAE,AAEF,QAAO,MAAMkB,MAAQnD,SAASmD,KAAK,AAAC,AAEpC,QAAO,MAAMC,sBAAwBpD,SAASqD,uBAAuB,AAAC,AAEtE,QAAO,MAAMC,qBAAuBtD,SAASuD,sBAAsB,AAAC"}
|
package/core/insights/posthog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import posthog from"posthog-js";export const initPosthog=(apiKey,apiHost)=>{posthog.init(apiKey,{api_host:apiHost,capture_pageview:false})};export const enableDebugMode=()=>{posthog.debug()};export const disableDebugMode=()=>{posthog.debug(false)};export const identify=({userId,accountId,organisationId,email,name})=>{if(!userId){return}if(userId!==posthog.get_distinct_id()){posthog.identify(userId,{email,name})}if(accountId){posthog.group("account",accountId)}if(organisationId){posthog.group("organisation",organisationId)}};export const trackPageView=()=>{posthog.capture("$pageview")};export const track=(event,properties)=>{posthog.capture(event,properties)};
|
|
1
|
+
import posthog from"posthog-js";export const initPosthog=(apiKey,apiHost)=>{posthog.init(apiKey,{api_host:apiHost,capture_pageview:false})};export const enableDebugMode=()=>{posthog.debug()};export const disableDebugMode=()=>{posthog.debug(false)};export const identify=({userId,accountId,organisationId,email,name})=>{if(!userId){return}if(userId!==posthog.get_distinct_id()){posthog.identify(userId,{email,name})}if(accountId){posthog.group("account",accountId)}if(organisationId){posthog.group("organisation",organisationId)}};export const trackPageView=()=>{posthog.capture("$pageview")};export const track=(event,properties)=>{posthog.capture(event,properties)};export const startSessionRecording=posthog.startSessionRecording;export const stopSessionRecording=posthog.stopSessionRecording;
|
|
2
2
|
//# sourceMappingURL=posthog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/posthog.ts"],"sourcesContent":["import posthog from \"posthog-js\";\n\nimport { InsightsIdentity } from \"./types\";\n\nexport const initPosthog = (apiKey: string, apiHost: string) => {\n posthog.init(apiKey, {\n api_host: apiHost,\n capture_pageview: false,\n });\n};\n\nexport const enableDebugMode = () => {\n posthog.debug();\n};\n\nexport const disableDebugMode = () => {\n posthog.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 if (userId !== posthog.get_distinct_id()) {\n posthog.identify(userId, { email, name });\n }\n\n // Associate all events in this session with this account\n if (accountId) {\n posthog.group(\"account\", accountId);\n }\n\n // Associate all events in this session with this organisation (if available)\n if (organisationId) {\n posthog.group(\"organisation\", organisationId);\n }\n};\n\nexport const trackPageView = () => {\n posthog.capture(\"$pageview\");\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n posthog.capture(event, properties);\n};\n"],"names":["posthog","initPosthog","apiKey","apiHost","init","api_host","capture_pageview","enableDebugMode","debug","disableDebugMode","identify","userId","accountId","organisationId","email","name","get_distinct_id","group","trackPageView","capture","track","event","properties"],"mappings":"AAAA,OAAOA,YAAa,YAAa,AAIjC,QAAO,MAAMC,YAAc,CAACC,OAAgBC,WAC1CH,QAAQI,IAAI,CAACF,OAAQ,CACnBG,SAAUF,QACVG,iBAAkB,KACpB,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7BP,QAAQQ,KAAK,EACf,CAAE,AAEF,QAAO,MAAMC,iBAAmB,KAC9BT,QAAQQ,KAAK,CAAC,MAChB,CAAE,AAEF,QAAO,MAAME,SAAW,CAAC,CACvBC,MAAM,CACNC,SAAS,CACTC,cAAc,CACdC,KAAK,CACLC,IAAI,CACa,IAGjB,GAAI,CAACJ,OAAQ,CACX,MACF,CAEA,GAAIA,SAAWX,QAAQgB,eAAe,GAAI,CACxChB,QAAQU,QAAQ,CAACC,OAAQ,CAAEG,MAAOC,IAAK,EACzC,CAGA,GAAIH,UAAW,CACbZ,QAAQiB,KAAK,CAAC,UAAWL,UAC3B,CAGA,GAAIC,eAAgB,CAClBb,QAAQiB,KAAK,CAAC,eAAgBJ,eAChC,CACF,CAAE,AAEF,QAAO,MAAMK,cAAgB,KAC3BlB,QAAQmB,OAAO,CAAC,YAClB,CAAE,AAEF,QAAO,MAAMC,MAAQ,CAACC,MAAeC,cACnCtB,QAAQmB,OAAO,CAACE,MAAOC,WACzB,CAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/posthog.ts"],"sourcesContent":["import posthog from \"posthog-js\";\n\nimport { InsightsIdentity } from \"./types\";\n\nexport const initPosthog = (apiKey: string, apiHost: string) => {\n posthog.init(apiKey, {\n api_host: apiHost,\n capture_pageview: false,\n });\n};\n\nexport const enableDebugMode = () => {\n posthog.debug();\n};\n\nexport const disableDebugMode = () => {\n posthog.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 if (userId !== posthog.get_distinct_id()) {\n posthog.identify(userId, { email, name });\n }\n\n // Associate all events in this session with this account\n if (accountId) {\n posthog.group(\"account\", accountId);\n }\n\n // Associate all events in this session with this organisation (if available)\n if (organisationId) {\n posthog.group(\"organisation\", organisationId);\n }\n};\n\nexport const trackPageView = () => {\n posthog.capture(\"$pageview\");\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n posthog.capture(event, properties);\n};\n\nexport const startSessionRecording = posthog.startSessionRecording;\n\nexport const stopSessionRecording = posthog.stopSessionRecording;\n"],"names":["posthog","initPosthog","apiKey","apiHost","init","api_host","capture_pageview","enableDebugMode","debug","disableDebugMode","identify","userId","accountId","organisationId","email","name","get_distinct_id","group","trackPageView","capture","track","event","properties","startSessionRecording","stopSessionRecording"],"mappings":"AAAA,OAAOA,YAAa,YAAa,AAIjC,QAAO,MAAMC,YAAc,CAACC,OAAgBC,WAC1CH,QAAQI,IAAI,CAACF,OAAQ,CACnBG,SAAUF,QACVG,iBAAkB,KACpB,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7BP,QAAQQ,KAAK,EACf,CAAE,AAEF,QAAO,MAAMC,iBAAmB,KAC9BT,QAAQQ,KAAK,CAAC,MAChB,CAAE,AAEF,QAAO,MAAME,SAAW,CAAC,CACvBC,MAAM,CACNC,SAAS,CACTC,cAAc,CACdC,KAAK,CACLC,IAAI,CACa,IAGjB,GAAI,CAACJ,OAAQ,CACX,MACF,CAEA,GAAIA,SAAWX,QAAQgB,eAAe,GAAI,CACxChB,QAAQU,QAAQ,CAACC,OAAQ,CAAEG,MAAOC,IAAK,EACzC,CAGA,GAAIH,UAAW,CACbZ,QAAQiB,KAAK,CAAC,UAAWL,UAC3B,CAGA,GAAIC,eAAgB,CAClBb,QAAQiB,KAAK,CAAC,eAAgBJ,eAChC,CACF,CAAE,AAEF,QAAO,MAAMK,cAAgB,KAC3BlB,QAAQmB,OAAO,CAAC,YAClB,CAAE,AAEF,QAAO,MAAMC,MAAQ,CAACC,MAAeC,cACnCtB,QAAQmB,OAAO,CAACE,MAAOC,WACzB,CAAE,AAEF,QAAO,MAAMC,sBAAwBvB,QAAQuB,qBAAqB,AAAC,AAEnE,QAAO,MAAMC,qBAAuBxB,QAAQwB,oBAAoB,AAAC"}
|
|
@@ -0,0 +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*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)}}
|
|
2
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +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","addEventListener","removeEventListener"],"mappings":"oLAKA,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,CAAG,KACjBT,OAAOQ,KAAK,CAAC,uBAEb,GAAI,CACFV,SAASgB,eAAe,G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AUA,QAAQM,aAAa,AACjC,CACA,OAAO,IACT,EAGA,MAAMC,YAAc,AAACjC,QACnB,GAAI,CAAEA,CAAAA,MAAMkC,MAAM,YAAYC,WAAU,EAAI,OAC5C,MAAMN,SAAWJ,+BAA+BzB,MAAMkC,MAAM,EAC5D,GAAIL,SAAU,CAEZ,KAAM,CAAE7B,MAAOoC,SAAS,CAAE,GAAGnC,WAAY,CAAG4B,SAC5C,IAAI,CAAC9B,KAAK,CAACqC,WAAa,kBAAmBnC,WAC7C,CACF,EAGA0B,SAASC,IAAI,CAACS,gBAAgB,CAAC,QAASJ,aAGxC,MAAO,KACLN,SAASC,IAAI,CAACU,mBAAmB,CAAC,QAASL,YAC7C,CACF,eAzQA,sBAAQnD,YAAqB,OA0Q/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/types.ts"],"sourcesContent":["export 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: () => 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":"AA4BA,QAME"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["bg-blue-400","bg-blue-100","bg-neutral-1300","bg-neutral-300","bg-neutral-200","bg-neutral-100","bg-neutral-000","bg-neutral-600","bg-orange-900","bg-orange-600","border-blue-400","border-neutral-200","border-neutral-600","border-neutral-500","border-orange-600","from-neutral-400","group-hover:bg-neutral-100","text-blue-600","text-blue-200","text-neutral-1300","text-neutral-300","text-neutral-000","text-neutral-1100","text-neutral-1000","text-neutral-800","text-neutral-700","text-neutral-600","text-neutral-500","text-orange-200","text-orange-600"]
|
package/index.d.ts
CHANGED
|
@@ -475,9 +475,9 @@ type FlyoutProps = {
|
|
|
475
475
|
*/
|
|
476
476
|
menuItems: {
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
478
|
+
* Label for the menu item.
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
label: string;
|
|
481
481
|
/**
|
|
482
482
|
* Optional content to be displayed in the flyout panel.
|
|
483
483
|
*/
|
|
@@ -579,7 +579,6 @@ export type HeaderSessionState = {
|
|
|
579
579
|
* Props for the Header component.
|
|
580
580
|
*/
|
|
581
581
|
export type HeaderProps = {
|
|
582
|
-
headerClassName?: string;
|
|
583
582
|
/**
|
|
584
583
|
* Optional search bar element.
|
|
585
584
|
*/
|
|
@@ -684,63 +683,50 @@ export default Icon;
|
|
|
684
683
|
//# sourceMappingURL=Icon.d.ts.map
|
|
685
684
|
}
|
|
686
685
|
|
|
687
|
-
declare module '@ably/ui/core/
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
686
|
+
declare module '@ably/ui/core/LinkButton' {
|
|
687
|
+
import React from "react";
|
|
688
|
+
import { ButtonPropsBase } from "@ably/ui/core/Button";
|
|
689
|
+
import { ColorClass, ColorThemeSet } from "@ably/ui/core/styles/colors/types";
|
|
690
|
+
export type LinkButtonProps = ButtonPropsBase & {
|
|
691
|
+
disabled?: boolean;
|
|
692
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
693
|
+
iconColor?: ColorClass | ColorThemeSet;
|
|
694
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
695
|
+
const LinkButton: React.FC<LinkButtonProps>;
|
|
696
|
+
export default LinkButton;
|
|
697
|
+
//# sourceMappingURL=LinkButton.d.ts.map
|
|
694
698
|
}
|
|
695
699
|
|
|
696
|
-
declare module '@ably/ui/core/
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
teardown: () => void;
|
|
702
|
-
clear: () => void;
|
|
700
|
+
declare module '@ably/ui/core/Loader' {
|
|
701
|
+
type LoaderProps = {
|
|
702
|
+
size?: string;
|
|
703
|
+
ringColor?: string;
|
|
704
|
+
additionalCSS?: string;
|
|
703
705
|
};
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobilePanelClose/component' {
|
|
708
|
-
function _default(): {
|
|
709
|
-
teardown: () => void;
|
|
710
|
-
clear: () => void;
|
|
711
|
-
}[];
|
|
712
|
-
export default _default;
|
|
713
|
-
//# sourceMappingURL=component.d.ts.map
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobilePanelOpen/component' {
|
|
717
|
-
function _default(): {
|
|
718
|
-
teardown: () => void;
|
|
719
|
-
clear: () => void;
|
|
720
|
-
}[];
|
|
721
|
-
export default _default;
|
|
722
|
-
//# sourceMappingURL=component.d.ts.map
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
declare module '@ably/ui/core/LegacyMeganav/MeganavSearchAutocomplete/component' {
|
|
726
|
-
function _default(apiKey: any): {
|
|
727
|
-
teardown: () => void;
|
|
728
|
-
clear: () => void;
|
|
729
|
-
}[];
|
|
730
|
-
export default _default;
|
|
731
|
-
//# sourceMappingURL=component.d.ts.map
|
|
706
|
+
const Loader: ({ ringColor, size, additionalCSS, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
707
|
+
export default Loader;
|
|
708
|
+
//# sourceMappingURL=Loader.d.ts.map
|
|
732
709
|
}
|
|
733
710
|
|
|
734
|
-
declare module '@ably/ui/core/
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
711
|
+
declare module '@ably/ui/core/Logo' {
|
|
712
|
+
import React from "react";
|
|
713
|
+
type LogoProps = {
|
|
714
|
+
dataId?: string;
|
|
715
|
+
logoUrl?: string;
|
|
716
|
+
logoAlt?: string;
|
|
717
|
+
href?: string;
|
|
718
|
+
additionalImgAttrs?: object;
|
|
719
|
+
additionalLinkAttrs?: object;
|
|
720
|
+
theme?: "light" | "dark";
|
|
721
|
+
variant?: "default" | "mono";
|
|
722
|
+
orientation?: "default" | "stacked";
|
|
739
723
|
};
|
|
740
|
-
|
|
724
|
+
const _default: React.MemoExoticComponent<({ dataId, href, additionalImgAttrs, additionalLinkAttrs, theme, variant, orientation, logoUrl, logoAlt, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
725
|
+
export default _default;
|
|
726
|
+
//# sourceMappingURL=Logo.d.ts.map
|
|
741
727
|
}
|
|
742
728
|
|
|
743
|
-
declare module '@ably/ui/core/
|
|
729
|
+
declare module '@ably/ui/core/Meganav/component' {
|
|
744
730
|
export default function Meganav({ themeName, addSearchApiKey }: {
|
|
745
731
|
themeName: any;
|
|
746
732
|
addSearchApiKey: any;
|
|
@@ -748,7 +734,7 @@ export default function Meganav({ themeName, addSearchApiKey }: {
|
|
|
748
734
|
//# sourceMappingURL=component.d.ts.map
|
|
749
735
|
}
|
|
750
736
|
|
|
751
|
-
declare module '@ably/ui/core/
|
|
737
|
+
declare module '@ably/ui/core/Meganav' {
|
|
752
738
|
import { ReactNode } from "react";
|
|
753
739
|
import { ColorClass } from "@ably/ui/core/styles/colors/types";
|
|
754
740
|
export type MeganavTheme = {
|
|
@@ -830,121 +816,11 @@ type MeganavProps = {
|
|
|
830
816
|
};
|
|
831
817
|
const Meganav: ({ paths, themeName, notice, loginLink, urlBase, addSearchApiKey, statusUrl, searchDataId, }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
832
818
|
export default Meganav;
|
|
833
|
-
//# sourceMappingURL=LegacyMeganav.d.ts.map
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
declare module '@ably/ui/core/LinkButton' {
|
|
837
|
-
import React from "react";
|
|
838
|
-
import { ButtonPropsBase } from "@ably/ui/core/Button";
|
|
839
|
-
import { ColorClass, ColorThemeSet } from "@ably/ui/core/styles/colors/types";
|
|
840
|
-
export type LinkButtonProps = ButtonPropsBase & {
|
|
841
|
-
disabled?: boolean;
|
|
842
|
-
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
843
|
-
iconColor?: ColorClass | ColorThemeSet;
|
|
844
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
845
|
-
const LinkButton: React.FC<LinkButtonProps>;
|
|
846
|
-
export default LinkButton;
|
|
847
|
-
//# sourceMappingURL=LinkButton.d.ts.map
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
declare module '@ably/ui/core/Loader' {
|
|
851
|
-
type LoaderProps = {
|
|
852
|
-
size?: string;
|
|
853
|
-
ringColor?: string;
|
|
854
|
-
additionalCSS?: string;
|
|
855
|
-
};
|
|
856
|
-
const Loader: ({ ringColor, size, additionalCSS, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
857
|
-
export default Loader;
|
|
858
|
-
//# sourceMappingURL=Loader.d.ts.map
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
declare module '@ably/ui/core/Logo' {
|
|
862
|
-
import React from "react";
|
|
863
|
-
type LogoProps = {
|
|
864
|
-
dataId?: string;
|
|
865
|
-
logoUrl?: string;
|
|
866
|
-
logoAlt?: string;
|
|
867
|
-
href?: string;
|
|
868
|
-
additionalImgAttrs?: object;
|
|
869
|
-
additionalLinkAttrs?: object;
|
|
870
|
-
theme?: "light" | "dark";
|
|
871
|
-
variant?: "default" | "mono";
|
|
872
|
-
orientation?: "default" | "stacked";
|
|
873
|
-
};
|
|
874
|
-
const _default: React.MemoExoticComponent<({ dataId, href, additionalImgAttrs, additionalLinkAttrs, theme, variant, orientation, logoUrl, logoAlt, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
875
|
-
export default _default;
|
|
876
|
-
//# sourceMappingURL=Logo.d.ts.map
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
declare module '@ably/ui/core/Meganav/Meganav' {
|
|
880
|
-
import { HeaderSessionState } from ".@ably/ui/core/Header";
|
|
881
|
-
import { MeganavNoticeProps } from ".@ably/ui/core/LegacyMeganav";
|
|
882
|
-
export type MeganavProps = {
|
|
883
|
-
sessionState: HeaderSessionState;
|
|
884
|
-
searchDataId: string;
|
|
885
|
-
notice?: MeganavNoticeProps;
|
|
886
|
-
};
|
|
887
|
-
const Meganav: ({ sessionState, searchDataId, notice }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
888
|
-
export default Meganav;
|
|
889
819
|
//# sourceMappingURL=Meganav.d.ts.map
|
|
890
820
|
}
|
|
891
821
|
|
|
892
|
-
declare module '@ably/ui/core/Meganav/MeganavMobile' {
|
|
893
|
-
import { AccordionData } from ".@ably/ui/core/Accordion/types";
|
|
894
|
-
export const MeganavMobile: ({ mobileNavItems, }: {
|
|
895
|
-
mobileNavItems: AccordionData[];
|
|
896
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
897
|
-
//# sourceMappingURL=MeganavMobile.d.ts.map
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
declare module '@ably/ui/core/Meganav/MeganavPanel' {
|
|
901
|
-
import React from "react";
|
|
902
|
-
import { FlyoutPanelHighlight, FlyoutPanelList } from "@ably/ui/core/data";
|
|
903
|
-
export const MeganavPanel: ({ displayProductTile, panelLeft, panelLeftClassName, panelRightHeading, panelRightItems, panelRightBottom, }: {
|
|
904
|
-
displayProductTile?: boolean;
|
|
905
|
-
panelLeft?: FlyoutPanelHighlight;
|
|
906
|
-
panelLeftClassName?: string;
|
|
907
|
-
panelRightHeading?: string;
|
|
908
|
-
panelRightItems: FlyoutPanelList[];
|
|
909
|
-
panelRightBottom?: React.ReactNode;
|
|
910
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
911
|
-
//# sourceMappingURL=MeganavPanel.d.ts.map
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
declare module '@ably/ui/core/Meganav/data' {
|
|
915
|
-
import React from "react";
|
|
916
|
-
import { IconName } from ".@ably/ui/core/Icon/types";
|
|
917
|
-
export type FlyoutPanelList = {
|
|
918
|
-
label: string;
|
|
919
|
-
icon: IconName;
|
|
920
|
-
link: string;
|
|
921
|
-
isMobile?: boolean;
|
|
922
|
-
};
|
|
923
|
-
export type FlyoutPanelHighlight = {
|
|
924
|
-
heading: string;
|
|
925
|
-
content: string;
|
|
926
|
-
labelLink: string;
|
|
927
|
-
url: string;
|
|
928
|
-
image: string;
|
|
929
|
-
};
|
|
930
|
-
export type MenuItem = {
|
|
931
|
-
name: string;
|
|
932
|
-
link?: string;
|
|
933
|
-
isHiddenMobile?: boolean;
|
|
934
|
-
content?: React.ReactNode;
|
|
935
|
-
panelClassName?: string;
|
|
936
|
-
};
|
|
937
|
-
export const menuItemLinks: {
|
|
938
|
-
name: string;
|
|
939
|
-
link: string;
|
|
940
|
-
isHiddenMobile: boolean;
|
|
941
|
-
}[];
|
|
942
|
-
export const menuItemsForHeader: MenuItem[];
|
|
943
|
-
//# sourceMappingURL=data.d.ts.map
|
|
944
|
-
}
|
|
945
|
-
|
|
946
822
|
declare module '@ably/ui/core/MeganavBlogPostsList' {
|
|
947
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
823
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
948
824
|
type MeganavBlogPostsListProps = {
|
|
949
825
|
recentBlogPosts: {
|
|
950
826
|
link: string;
|
|
@@ -959,7 +835,7 @@ export default MeganavBlogPostsList;
|
|
|
959
835
|
}
|
|
960
836
|
|
|
961
837
|
declare module '@ably/ui/core/MeganavContentCompany' {
|
|
962
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
838
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/Meganav";
|
|
963
839
|
type MeganavContentCompanyProps = {
|
|
964
840
|
absUrl: AbsUrl;
|
|
965
841
|
paths?: MeganavPaths;
|
|
@@ -970,7 +846,7 @@ export default MeganavContentCompany;
|
|
|
970
846
|
}
|
|
971
847
|
|
|
972
848
|
declare module '@ably/ui/core/MeganavContentDevelopers' {
|
|
973
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
849
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
974
850
|
const MeganavContentDevelopers: ({ absUrl, statusUrl, }: {
|
|
975
851
|
absUrl: AbsUrl;
|
|
976
852
|
statusUrl: string;
|
|
@@ -980,7 +856,7 @@ export default MeganavContentDevelopers;
|
|
|
980
856
|
}
|
|
981
857
|
|
|
982
858
|
declare module '@ably/ui/core/MeganavContentProducts' {
|
|
983
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
859
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/Meganav";
|
|
984
860
|
type MeganavContentProductsProps = {
|
|
985
861
|
paths?: MeganavPaths;
|
|
986
862
|
absUrl: AbsUrl;
|
|
@@ -991,7 +867,7 @@ export default MeganavContentProducts;
|
|
|
991
867
|
}
|
|
992
868
|
|
|
993
869
|
declare module '@ably/ui/core/MeganavContentUseCases' {
|
|
994
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
870
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
995
871
|
const MeganavContentUseCases: ({ absUrl }: {
|
|
996
872
|
absUrl: AbsUrl;
|
|
997
873
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -999,9 +875,18 @@ export default MeganavContentUseCases;
|
|
|
999
875
|
//# sourceMappingURL=MeganavContentUseCases.d.ts.map
|
|
1000
876
|
}
|
|
1001
877
|
|
|
878
|
+
declare module '@ably/ui/core/MeganavControl/component' {
|
|
879
|
+
export default MeganavControl;
|
|
880
|
+
function MeganavControl(): {
|
|
881
|
+
teardown: () => void;
|
|
882
|
+
clear: () => void;
|
|
883
|
+
}[];
|
|
884
|
+
//# sourceMappingURL=component.d.ts.map
|
|
885
|
+
}
|
|
886
|
+
|
|
1002
887
|
declare module '@ably/ui/core/MeganavControl' {
|
|
1003
888
|
import { ReactNode } from "react";
|
|
1004
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
889
|
+
import { MeganavTheme } from "@ably/ui/core/Meganav";
|
|
1005
890
|
type MeganavControlProps = {
|
|
1006
891
|
ariaControls: string;
|
|
1007
892
|
ariaLabel: string;
|
|
@@ -1014,8 +899,19 @@ export default MeganavControl;
|
|
|
1014
899
|
//# sourceMappingURL=MeganavControl.d.ts.map
|
|
1015
900
|
}
|
|
1016
901
|
|
|
902
|
+
declare module '@ably/ui/core/MeganavControlMobileDropdown/component' {
|
|
903
|
+
export default MeganavControlMobileDropdown;
|
|
904
|
+
function MeganavControlMobileDropdown({ clearPanels }: {
|
|
905
|
+
clearPanels: any;
|
|
906
|
+
}): {
|
|
907
|
+
teardown: () => void;
|
|
908
|
+
clear: () => void;
|
|
909
|
+
};
|
|
910
|
+
//# sourceMappingURL=component.d.ts.map
|
|
911
|
+
}
|
|
912
|
+
|
|
1017
913
|
declare module '@ably/ui/core/MeganavControlMobileDropdown' {
|
|
1018
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
914
|
+
import { MeganavTheme } from "@ably/ui/core/Meganav";
|
|
1019
915
|
const MeganavControlMobileDropdown: ({ theme }: {
|
|
1020
916
|
theme: MeganavTheme;
|
|
1021
917
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1023,6 +919,15 @@ export default MeganavControlMobileDropdown;
|
|
|
1023
919
|
//# sourceMappingURL=MeganavControlMobileDropdown.d.ts.map
|
|
1024
920
|
}
|
|
1025
921
|
|
|
922
|
+
declare module '@ably/ui/core/MeganavControlMobilePanelClose/component' {
|
|
923
|
+
function _default(): {
|
|
924
|
+
teardown: () => void;
|
|
925
|
+
clear: () => void;
|
|
926
|
+
}[];
|
|
927
|
+
export default _default;
|
|
928
|
+
//# sourceMappingURL=component.d.ts.map
|
|
929
|
+
}
|
|
930
|
+
|
|
1026
931
|
declare module '@ably/ui/core/MeganavControlMobilePanelClose' {
|
|
1027
932
|
type MeganavControlMobilePanelCloseProps = {
|
|
1028
933
|
ariaControls: string;
|
|
@@ -1033,6 +938,15 @@ export default MeganavControlMobilePanelClose;
|
|
|
1033
938
|
//# sourceMappingURL=MeganavControlMobilePanelClose.d.ts.map
|
|
1034
939
|
}
|
|
1035
940
|
|
|
941
|
+
declare module '@ably/ui/core/MeganavControlMobilePanelOpen/component' {
|
|
942
|
+
function _default(): {
|
|
943
|
+
teardown: () => void;
|
|
944
|
+
clear: () => void;
|
|
945
|
+
}[];
|
|
946
|
+
export default _default;
|
|
947
|
+
//# sourceMappingURL=component.d.ts.map
|
|
948
|
+
}
|
|
949
|
+
|
|
1036
950
|
declare module '@ably/ui/core/MeganavControlMobilePanelOpen' {
|
|
1037
951
|
import { ReactNode } from "react";
|
|
1038
952
|
type MeganavControlMobilePanelOpenProps = {
|
|
@@ -1046,7 +960,7 @@ export default MeganavControlMobilePanelOpen;
|
|
|
1046
960
|
|
|
1047
961
|
declare module '@ably/ui/core/MeganavItemsDesktop' {
|
|
1048
962
|
import React from "react";
|
|
1049
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/
|
|
963
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/Meganav";
|
|
1050
964
|
type MeganavDesktopItems = {
|
|
1051
965
|
panels: MeganavPanels;
|
|
1052
966
|
paths?: MeganavPaths;
|
|
@@ -1062,7 +976,7 @@ export default _default;
|
|
|
1062
976
|
|
|
1063
977
|
declare module '@ably/ui/core/MeganavItemsMobile' {
|
|
1064
978
|
import React from "react";
|
|
1065
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
979
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/Meganav";
|
|
1066
980
|
type MeganavItemsMobileProps = {
|
|
1067
981
|
panels: MeganavPanels;
|
|
1068
982
|
paths?: MeganavPaths;
|
|
@@ -1079,7 +993,7 @@ export default _default;
|
|
|
1079
993
|
}
|
|
1080
994
|
|
|
1081
995
|
declare module '@ably/ui/core/MeganavItemsSignedIn' {
|
|
1082
|
-
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
996
|
+
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/Meganav";
|
|
1083
997
|
type MeganavItemsSignedIn = {
|
|
1084
998
|
sessionState: MeganavSessionState;
|
|
1085
999
|
theme: MeganavTheme;
|
|
@@ -1092,7 +1006,7 @@ export default MeganavItemsSignedIn;
|
|
|
1092
1006
|
}
|
|
1093
1007
|
|
|
1094
1008
|
declare module '@ably/ui/core/MeganavSearch' {
|
|
1095
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1009
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
1096
1010
|
const MeganavSearch: ({ absUrl, dataId, }: {
|
|
1097
1011
|
absUrl: AbsUrl;
|
|
1098
1012
|
dataId?: string;
|
|
@@ -1101,6 +1015,15 @@ export default MeganavSearch;
|
|
|
1101
1015
|
//# sourceMappingURL=MeganavSearch.d.ts.map
|
|
1102
1016
|
}
|
|
1103
1017
|
|
|
1018
|
+
declare module '@ably/ui/core/MeganavSearchAutocomplete/component' {
|
|
1019
|
+
function _default(apiKey: any): {
|
|
1020
|
+
teardown: () => void;
|
|
1021
|
+
clear: () => void;
|
|
1022
|
+
}[];
|
|
1023
|
+
export default _default;
|
|
1024
|
+
//# sourceMappingURL=component.d.ts.map
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1104
1027
|
declare module '@ably/ui/core/MeganavSearchAutocomplete' {
|
|
1105
1028
|
const MeganavSearchAutocomplete: () => import("react/jsx-runtime").JSX.Element;
|
|
1106
1029
|
export default MeganavSearchAutocomplete;
|
|
@@ -1108,7 +1031,7 @@ export default MeganavSearchAutocomplete;
|
|
|
1108
1031
|
}
|
|
1109
1032
|
|
|
1110
1033
|
declare module '@ably/ui/core/MeganavSearchPanel' {
|
|
1111
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1034
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
1112
1035
|
const MeganavSearchPanel: ({ absUrl }: {
|
|
1113
1036
|
absUrl: AbsUrl;
|
|
1114
1037
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1116,8 +1039,17 @@ export default MeganavSearchPanel;
|
|
|
1116
1039
|
//# sourceMappingURL=MeganavSearchPanel.d.ts.map
|
|
1117
1040
|
}
|
|
1118
1041
|
|
|
1042
|
+
declare module '@ably/ui/core/MeganavSearchSuggestions/component' {
|
|
1043
|
+
export default MeganavSearchSuggestions;
|
|
1044
|
+
function MeganavSearchSuggestions(): {
|
|
1045
|
+
teardown: () => void;
|
|
1046
|
+
clear: () => void;
|
|
1047
|
+
};
|
|
1048
|
+
//# sourceMappingURL=component.d.ts.map
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1119
1051
|
declare module '@ably/ui/core/MeganavSearchSuggestions' {
|
|
1120
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1052
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
1121
1053
|
type MeganavSearchSuggestionsProps = {
|
|
1122
1054
|
absUrl: AbsUrl;
|
|
1123
1055
|
displaySupportLink: boolean;
|
|
@@ -1128,7 +1060,6 @@ export default MeganavSearchSuggestions;
|
|
|
1128
1060
|
}
|
|
1129
1061
|
|
|
1130
1062
|
declare module '@ably/ui/core/Notice/component' {
|
|
1131
|
-
export const COLLAPSE_TRIGGER_DISTANCE: 5;
|
|
1132
1063
|
export default Notice;
|
|
1133
1064
|
function Notice({ bannerContainer, cookieId, noticeId, options }: {
|
|
1134
1065
|
bannerContainer: any;
|
|
@@ -1345,7 +1276,7 @@ export default ProductTile;
|
|
|
1345
1276
|
|
|
1346
1277
|
declare module '@ably/ui/core/SignOutLink' {
|
|
1347
1278
|
import { MouseEventHandler, ReactNode } from "react";
|
|
1348
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1279
|
+
import { AbsUrl } from "@ably/ui/core/Meganav";
|
|
1349
1280
|
type SignOutLinkProps = {
|
|
1350
1281
|
token: string;
|
|
1351
1282
|
href: string;
|