@ably/ui 15.7.0-dev.a9daaf05 → 16.0.0-dev.937d7376
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/LegacyMeganav/MeganavBlogPostsList/component.js +2 -0
- package/core/LegacyMeganav/MeganavBlogPostsList/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControl/component.js +2 -0
- package/core/LegacyMeganav/MeganavControl/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js +2 -0
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js +2 -0
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js.map +1 -0
- package/core/LegacyMeganav/component.js +2 -0
- package/core/{Meganav → LegacyMeganav}/component.js.map +1 -1
- package/core/LegacyMeganav.js +2 -0
- package/core/LegacyMeganav.js.map +1 -0
- package/core/Meganav/.DS_Store +0 -0
- package/core/Meganav/Meganav.js +2 -0
- package/core/Meganav/Meganav.js.map +1 -0
- package/core/Meganav/MeganavMobile.js +2 -0
- package/core/Meganav/MeganavMobile.js.map +1 -0
- package/core/Meganav/MeganavPanel.js +2 -0
- package/core/Meganav/MeganavPanel.js.map +1 -0
- package/core/Meganav/data.js +2 -0
- package/core/Meganav/data.js.map +1 -0
- package/core/Meganav/images/fan-engagement-nav-image.png +0 -0
- package/core/Meganav/images/founders-nav-image.png +0 -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.js.map +1 -1
- package/core/MeganavControlMobileDropdown.js.map +1 -1
- 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/MeganavSearchPanel.js.map +1 -1
- 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/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/insights/index.js +1 -1
- package/core/insights/index.js.map +1 -1
- 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/index.d.ts +193 -109
- package/package.json +1 -1
- package/core/Meganav/component.js +0 -2
- package/core/Meganav.js +0 -2
- package/core/Meganav.js.map +0 -1
- package/core/MeganavBlogPostsList/component.js +0 -2
- package/core/MeganavBlogPostsList/component.js.map +0 -1
- package/core/MeganavControl/component.js +0 -2
- package/core/MeganavControl/component.js.map +0 -1
- package/core/MeganavControlMobileDropdown/component.js +0 -2
- package/core/MeganavControlMobileDropdown/component.js.map +0 -1
- package/core/MeganavControlMobilePanelClose/component.js +0 -2
- package/core/MeganavControlMobilePanelClose/component.js.map +0 -1
- package/core/MeganavControlMobilePanelOpen/component.js +0 -2
- package/core/MeganavControlMobilePanelOpen/component.js.map +0 -1
- package/core/MeganavSearchAutocomplete/component.js +0 -2
- package/core/MeganavSearchAutocomplete/component.js.map +0 -1
- package/core/MeganavSearchSuggestions/component.js +0 -2
- package/core/MeganavSearchSuggestions/component.js.map +0 -1
- package/core/insights/datalayer.js +0 -2
- package/core/insights/datalayer.js.map +0 -1
- package/core/styles/colors/computed-colors.json +0 -1
- /package/core/{Meganav → LegacyMeganav}/component.css +0 -0
- /package/core/{Meganav → LegacyMeganav}/component.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/insights/index.ts"],"sourcesContent":["import * as datalayer from \"./datalayer\";\nimport * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport { InsightsIdentity } from \"./types\";\n\nexport type InsightsConfig = {\n debug: boolean;\n mixpanelToken: string;\n mixpanelAutoCapture: boolean;\n mixpanelRecordSessionsPercent: number;\n posthogApiKey: string;\n posthogApiHost: string;\n};\n\nlet debugMode = false;\n\nexport const initInsights = ({\n mixpanelToken,\n mixpanelAutoCapture,\n mixpanelRecordSessionsPercent = 1,\n posthogApiKey,\n posthogApiHost,\n debug = false,\n}: InsightsConfig) => {\n debugMode = !!debug;\n\n try {\n mixpanel.initMixpanel(\n mixpanelToken,\n mixpanelAutoCapture,\n debugMode,\n mixpanelRecordSessionsPercent,\n );\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to initialize Mixpanel\", e);\n }\n }\n\n try {\n posthog.initPosthog(posthogApiKey, posthogApiHost);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to initialize Posthog\", e);\n }\n }\n\n try {\n datalayer.initDatalayer();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to initialize Datalayer\", e);\n }\n }\n};\n\nexport const enableDebugMode = () => {\n debugMode = true;\n try {\n mixpanel.enableDebugMode();\n posthog.enableDebugMode();\n } catch (e) {\n console.error(\"Failed to enable debug mode\", e);\n }\n};\n\nexport const disableDebugMode = () => {\n debugMode = false;\n try {\n mixpanel.disableDebugMode();\n posthog.disableDebugMode();\n } catch (e) {\n console.error(\"Failed to disable debug mode\", e);\n }\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 if (debugMode) {\n console.warn(\"User ID not provided, skipping identify\");\n }\n return;\n }\n\n try {\n mixpanel.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (debugMode) {\n console.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 (debugMode) {\n console.error(\"Failed to identify user in Posthog\", e);\n }\n }\n};\n\nexport const trackPageView = () => {\n try {\n mixpanel.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track page view in Mixpanel\", e);\n }\n }\n\n try {\n posthog.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track page view in Posthog\", e);\n }\n }\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n try {\n mixpanel.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track event in Mixpanel\", e);\n }\n }\n\n try {\n posthog.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track event in Posthog\", e);\n }\n }\n\n try {\n datalayer.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track event in Datalayer\", e);\n }\n }\n};\n\nexport const startSessionRecording = () => {\n try {\n mixpanel.startSessionRecording();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to start session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.startSessionRecording();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to start session recording in Posthog\", e);\n }\n }\n};\n\nexport const stopSessionRecording = () => {\n try {\n mixpanel.stopSessionRecording();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to stop session recording in Mixpanel\", e);\n }\n }\n\n try {\n posthog.stopSessionRecording();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to stop session recording in Posthog\", e);\n }\n }\n};\n\ntype InsightAttributes = {\n event?: string;\n [key: string]: string | undefined;\n};\n\nexport const setupObserver = () => {\n // Helper to get all data-insight-* attributes from an element\n const getInsightAttributes = (element): InsightAttributes => {\n // limit how many data attributes we'll process\n const MAX_ATTRIBUTES = 10;\n let count = 0;\n\n const attributes: InsightAttributes = {};\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) 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 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"],"names":["datalayer","mixpanel","posthog","debugMode","initInsights","mixpanelToken","mixpanelAutoCapture","mixpanelRecordSessionsPercent","posthogApiKey","posthogApiHost","debug","initMixpanel","e","console","error","initPosthog","initDatalayer","enableDebugMode","disableDebugMode","identify","userId","accountId","organisationId","email","name","warn","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":"AAAA,UAAYA,cAAe,aAAc,AACzC,WAAYC,aAAc,YAAa,AACvC,WAAYC,YAAa,WAAY,CAYrC,IAAIC,UAAY,KAEhB,QAAO,MAAMC,aAAe,CAAC,CAC3BC,aAAa,CACbC,mBAAmB,CACnBC,8BAAgC,CAAC,CACjCC,aAAa,CACbC,cAAc,CACdC,MAAQ,KAAK,CACE,IACfP,UAAY,CAAC,CAACO,MAEd,GAAI,CACFT,SAASU,YAAY,CACnBN,cACAC,oBACAH,UACAI,8BAEJ,CAAE,MAAOK,EAAG,CACV,GAAIT,UAAW,CACbU,QAAQC,KAAK,CAAC,gCAAiCF,EACjD,CACF,CAEA,GAAI,CACFV,QAAQa,WAAW,CAACP,cAAeC,eACrC,CAAE,MAAOG,EAAG,CACV,GAAIT,UAAW,CACbU,QAAQC,KAAK,CAAC,+BAAgCF,EAChD,CACF,CAEA,GAAI,CACFZ,UAAUgB,aAAa,EACzB,CAAE,MAAOJ,EAAG,CACV,GAAIT,UAAW,CACbU,QAAQC,KAAK,CAAC,iCAAkCF,EAClD,CACF,CACF,CAAE,AAEF,QAAO,MAAMK,gBAAkB,KAC7Bd,UAAY,KACZ,GAAI,CACFF,SAASgB,eAAe,GACxBf,QAAQe,eAAe,EACzB,CAAE,MAAOL,EAAG,CACVC,QAAQC,KAAK,CAAC,8BAA+BF,EAC/C,CACF,CAAE,AAEF,QAAO,MAAMM,iBAAmB,KAC9Bf,UAAY,MACZ,GAAI,CACFF,SAASiB,gB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ACNC,GAAG,CAAC,CAACC,KAAMC,QACVA,QAAU,EAAID,KAAOA,KAAKE,MAAM,CAAC,GAAGC,WAAW,GAAKH,KAAKI,KAAK,CAAC,IAEhEC,IAAI,CAAC,GACRf,CAAAA,UAAU,CAACM,IAAI,CAAGL,KAAKG,KAAK,AAC5BL,CAAAA,OACF,CACF,CACA,OAAOC,UACT,EAGA,MAAMgB,+BAAiC,AAACnB,UACtC,IAAIoB,QAAUpB,QACd,MAAOoB,SAAWA,UAAYC,SAASC,IAAI,CAAE,CAC3C,MAAMC,SAAWxB,qBAAqBqB,SACtC,GAAII,OAAOC,IAAI,CAACF,UAAUf,MAAM,CAAG,EAAG,CACpC,OAAOe,QACT,CACAH,QAAUA,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,SAC5C9B,MAAMqC,WAAa,kBAAmBnC,WACxC,CACF,EAGA0B,SAASC,IAAI,CAACS,gBAAgB,CAAC,QAASJ,aAGxC,MAAO,KACLN,SAASC,IAAI,CAACU,mBAAmB,CAAC,QAASL,YAC7C,CACF,CAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/insights/index.ts"],"sourcesContent":["import * as mixpanel from \"./mixpanel\";\nimport * as posthog from \"./posthog\";\nimport { InsightsIdentity } from \"./types\";\n\nexport type InsightsConfig = {\n debug: boolean;\n mixpanelToken: string;\n mixpanelAutoCapture: boolean;\n posthogApiKey: string;\n posthogApiHost: string;\n};\n\nlet debugMode = false;\n\nexport const initInsights = ({\n mixpanelToken,\n mixpanelAutoCapture,\n posthogApiKey,\n posthogApiHost,\n debug = false,\n}: InsightsConfig) => {\n debugMode = !!debug;\n\n try {\n mixpanel.initMixpanel(mixpanelToken, mixpanelAutoCapture, debugMode);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to initialize Mixpanel\", e);\n }\n }\n\n try {\n posthog.initPosthog(posthogApiKey, posthogApiHost);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to initialize Posthog\", e);\n }\n }\n};\n\nexport const enableDebugMode = () => {\n debugMode = true;\n try {\n mixpanel.enableDebugMode();\n posthog.enableDebugMode();\n } catch (e) {\n console.error(\"Failed to enable debug mode\", e);\n }\n};\n\nexport const disableDebugMode = () => {\n debugMode = false;\n try {\n mixpanel.disableDebugMode();\n posthog.disableDebugMode();\n } catch (e) {\n console.error(\"Failed to disable debug mode\", e);\n }\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 if (debugMode) {\n console.warn(\"User ID not provided, skipping identify\");\n }\n return;\n }\n\n try {\n mixpanel.identify({ userId, accountId, organisationId, email, name });\n } catch (e) {\n if (debugMode) {\n console.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 (debugMode) {\n console.error(\"Failed to identify user in Posthog\", e);\n }\n }\n};\n\nexport const trackPageView = () => {\n try {\n mixpanel.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track page view in Mixpanel\", e);\n }\n }\n\n try {\n posthog.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track page view in Posthog\", e);\n }\n }\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n try {\n mixpanel.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track event in Mixpanel\", e);\n }\n }\n\n try {\n posthog.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error(\"Failed to track event in Posthog\", e);\n }\n }\n};\n\ntype InsightAttributes = {\n event?: string;\n [key: string]: string | undefined;\n};\n\nexport const setupObserver = () => {\n // Helper to get all data-insight-* attributes from an element\n const getInsightAttributes = (element): InsightAttributes => {\n // limit how many data attributes we'll process\n const MAX_ATTRIBUTES = 10;\n let count = 0;\n\n const attributes: InsightAttributes = {};\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) 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 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"],"names":["mixpanel","posthog","debugMode","initInsights","mixpanelToken","mixpanelAutoCapture","posthogApiKey","posthogApiHost","debug","initMixpanel","e","console","error","initPosthog","enableDebugMode","disableDebugMode","identify","userId","accountId","organisationId","email","name","warn","trackPageView","track","event","properties","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":"AAAA,UAAYA,aAAc,YAAa,AACvC,WAAYC,YAAa,WAAY,CAWrC,IAAIC,UAAY,KAEhB,QAAO,MAAMC,aAAe,CAAC,CAC3BC,aAAa,CACbC,mBAAmB,CACnBC,aAAa,CACbC,cAAc,CACdC,MAAQ,KAAK,CACE,IACfN,UAAY,CAAC,CAACM,MAEd,GAAI,CACFR,SAASS,YAAY,CAACL,cAAeC,oBAAqBH,UAC5D,CAAE,MAAOQ,EAAG,CACV,GAAIR,UAAW,CACbS,QAAQC,KAAK,CAAC,gCAAiCF,EACjD,CACF,CAEA,GAAI,CACFT,QAAQY,WAAW,CAACP,cAAeC,eACrC,CAAE,MAAOG,EAAG,CACV,GAAIR,UAAW,CACbS,QAAQC,KAAK,CAAC,+BAAgCF,EAChD,CACF,CACF,CAAE,AAEF,QAAO,MAAMI,gBAAkB,KAC7BZ,UAAY,KACZ,GAAI,CACFF,SAASc,eAAe,GACxBb,QAAQa,eAAe,EACzB,CAAE,MAAOJ,EAAG,CACVC,QAAQC,KAAK,CAAC,8BAA+BF,EAC/C,CACF,CAAE,AAEF,QAAO,MAAMK,iBAAmB,KAC9Bb,UAAY,MACZ,GAAI,CACFF,SAASe,gBAAgB,GACzBd,QAAQc,gBAAgB,EAC1B,CAAE,MAAOL,EAAG,CACVC,QAAQC,KAAK,CAAC,+BAAgCF,EAChD,CACF,CAAE,AAEF,QAAO,MAAMM,SAAW,CAAC,CACvBC,MAAM,CACNC,SAAS,CACTC,cAAc,CACdC,KAAK,CACLC,IAAI,CACa,IAGjB,GAAI,CAACJ,OAAQ,CACX,GAAIf,UAAW,CACbS,QAAQW,IAAI,CAAC,0CACf,CACA,MACF,CAEA,GAAI,CACFtB,SAASgB,QAAQ,CAAC,CAAEC,OAAQC,UAAWC,eAAgBC,MAAOC,IAAK,EACrE,CAAE,MAA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AK,CAACC,MAAM,CAAG,IAAK,SAG/D,MAAMC,IAAML,KAAKZ,IAAI,CAClBkB,OAAO,CAAC,gBAAiB,IACzBC,KAAK,CAAC,KACNC,GAAG,CAAC,CAACC,KAAMC,QACVA,QAAU,EAAID,KAAOA,KAAKE,MAAM,CAAC,GAAGC,WAAW,GAAKH,KAAKI,KAAK,CAAC,IAEhEC,IAAI,CAAC,GACRf,CAAAA,UAAU,CAACM,IAAI,CAAGL,KAAKG,KAAK,AAC5BL,CAAAA,OACF,CACF,CACA,OAAOC,UACT,EAGA,MAAMgB,+BAAiC,AAACnB,UACtC,IAAIoB,QAAUpB,QACd,MAAOoB,SAAWA,UAAYC,SAASC,IAAI,CAAE,CAC3C,MAAMC,SAAWxB,qBAAqBqB,SACtC,GAAII,OAAOC,IAAI,CAACF,UAAUf,MAAM,CAAG,EAAG,CACpC,OAAOe,QACT,CACAH,QAAUA,QAAQM,aAAa,AACjC,CACA,OAAO,IACT,EAGA,MAAMC,YAAc,AAAC/B,QACnB,GAAI,CAAEA,CAAAA,MAAMgC,MAAM,YAAYC,WAAU,EAAI,OAC5C,MAAMN,SAAWJ,+BAA+BvB,MAAMgC,MAAM,EAC5D,GAAIL,SAAU,CAEZ,KAAM,CAAE3B,MAAOkC,SAAS,CAAE,GAAGjC,WAAY,CAAG0B,SAC5C5B,MAAMmC,WAAa,kBAAmBjC,WACxC,CACF,EAGAwB,SAASC,IAAI,CAACS,gBAAgB,CAAC,QAASJ,aAGxC,MAAO,KACLN,SAASC,IAAI,CAACU,mBAAmB,CAAC,QAASL,YAC7C,CACF,CAAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import mixpanel from"mixpanel-browser";export const initMixpanel=(token,autoCapture=false,debug=false
|
|
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({account_id:[accountId]})}if(organisationId){mixpanel.people.set({organisation_id:[organisationId]})}};export const trackPageView=mixpanel.track_pageview;export const track=mixpanel.track;
|
|
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
|
|
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({ account_id: [accountId] });\n }\n\n if (organisationId) {\n mixpanel.people.set({ organisation_id: [organisationId] });\n }\n};\n\nexport const trackPageView = mixpanel.track_pageview;\n\nexport const track = mixpanel.track;\n"],"names":["mixpanel","initMixpanel","token","autoCapture","debug","blockSelectors","console","warn","init","persistence","autocapture","block_selectors","track_pageview","enableDebugMode","set_config","disableDebugMode","identify","userId","accountId","organisationId","email","name","people","set","$email","$name","union","account_id","organisation_id","trackPageView","track"],"mappings":"AAAA,OAAOA,aAAc,kBAAmB,AAIxC,QAAO,MAAMC,aAAe,CAC1BC,MACAC,YAAuB,KAAK,CAC5BC,MAAiB,KAAK,IAEtB,MAAMC,eAAiB,CAAC,kBAAmB,mBAAmB,CAC9D,GAAI,CAACH,MAAO,CACVI,QAAQC,IAAI,CAAC,wDACb,MACF,CAEAP,SAASQ,IAAI,CAACN,MAAO,CACnBE,MAAOA,MACPK,YAAa,eACbC,YAAaP,YACT,CACEQ,gBAAiBN,cACnB,EACA,MACJO,eAAgB,KAClB,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7Bb,SAASc,UAAU,CAAC,CAAEV,MAAO,IAAK,EACpC,CAAE,AAEF,QAAO,MAAMW,iBAAmB,KAC9Bf,SAASc,UAAU,CAAC,CAAEV,MAAO,KAAM,EACrC,CAAE,AAEF,QAAO,MAAMY,SAAW,CAAC,CACvBC,MAAM,CACNC,SAAS,CACTC,cAAc,CACdC,KAAK,CACLC,IAAI,CACa,IAGjB,GAAI,CAACJ,OAAQ,CACX,MACF,CAEAjB,SAASgB,QAAQ,CAACC,QAElB,GAAIG,OAASC,KAAM,CACjBrB,SAASsB,MAAM,CAACC,GAAG,CAAC,CAAEC,OAAQJ,MAAOK,MAAOJ,IAAK,EACnD,CAEA,GAAIH,UAAW,CACblB,SAASsB,MAAM,CAACI,KAAK,CAAC,CAAEC,WAAY,CAACT,UAAU,AAAC,EAClD,CAEA,GAAIC,eAAgB,CAClBnB,SAASsB,MAAM,CAACC,GAAG,CAAC,CAAEK,gBAAiB,CAACT,eAAe,AAAC,EAC1D,CACF,CAAE,AAEF,QAAO,MAAMU,cAAgB7B,SAASY,cAAc,AAAC,AAErD,QAAO,MAAMkB,MAAQ9B,SAAS8B,KAAK,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)};
|
|
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
|
|
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"}
|
package/index.d.ts
CHANGED
|
@@ -475,9 +475,9 @@ type FlyoutProps = {
|
|
|
475
475
|
*/
|
|
476
476
|
menuItems: {
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
478
|
+
* name for the menu item.
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
name: string;
|
|
481
481
|
/**
|
|
482
482
|
* Optional content to be displayed in the flyout panel.
|
|
483
483
|
*/
|
|
@@ -579,6 +579,7 @@ export type HeaderSessionState = {
|
|
|
579
579
|
* Props for the Header component.
|
|
580
580
|
*/
|
|
581
581
|
export type HeaderProps = {
|
|
582
|
+
headerClassName?: string;
|
|
582
583
|
/**
|
|
583
584
|
* Optional search bar element.
|
|
584
585
|
*/
|
|
@@ -683,50 +684,63 @@ export default Icon;
|
|
|
683
684
|
//# sourceMappingURL=Icon.d.ts.map
|
|
684
685
|
}
|
|
685
686
|
|
|
686
|
-
declare module '@ably/ui/core/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
iconColor?: ColorClass | ColorThemeSet;
|
|
694
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
695
|
-
const LinkButton: React.FC<LinkButtonProps>;
|
|
696
|
-
export default LinkButton;
|
|
697
|
-
//# sourceMappingURL=LinkButton.d.ts.map
|
|
687
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControl/component' {
|
|
688
|
+
export default MeganavControl;
|
|
689
|
+
function MeganavControl(): {
|
|
690
|
+
teardown: () => void;
|
|
691
|
+
clear: () => void;
|
|
692
|
+
}[];
|
|
693
|
+
//# sourceMappingURL=component.d.ts.map
|
|
698
694
|
}
|
|
699
695
|
|
|
700
|
-
declare module '@ably/ui/core/
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
696
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobileDropdown/component' {
|
|
697
|
+
export default MeganavControlMobileDropdown;
|
|
698
|
+
function MeganavControlMobileDropdown({ clearPanels }: {
|
|
699
|
+
clearPanels: any;
|
|
700
|
+
}): {
|
|
701
|
+
teardown: () => void;
|
|
702
|
+
clear: () => void;
|
|
705
703
|
};
|
|
706
|
-
|
|
707
|
-
export default Loader;
|
|
708
|
-
//# sourceMappingURL=Loader.d.ts.map
|
|
704
|
+
//# sourceMappingURL=component.d.ts.map
|
|
709
705
|
}
|
|
710
706
|
|
|
711
|
-
declare module '@ably/ui/core/
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
logoAlt?: string;
|
|
717
|
-
href?: string;
|
|
718
|
-
additionalImgAttrs?: object;
|
|
719
|
-
additionalLinkAttrs?: object;
|
|
720
|
-
theme?: "light" | "dark";
|
|
721
|
-
variant?: "default" | "mono";
|
|
722
|
-
orientation?: "default" | "stacked";
|
|
723
|
-
};
|
|
724
|
-
const _default: React.MemoExoticComponent<({ dataId, href, additionalImgAttrs, additionalLinkAttrs, theme, variant, orientation, logoUrl, logoAlt, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
707
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobilePanelClose/component' {
|
|
708
|
+
function _default(): {
|
|
709
|
+
teardown: () => void;
|
|
710
|
+
clear: () => void;
|
|
711
|
+
}[];
|
|
725
712
|
export default _default;
|
|
726
|
-
//# sourceMappingURL=
|
|
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
|
|
727
723
|
}
|
|
728
724
|
|
|
729
|
-
declare module '@ably/ui/core/
|
|
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
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavSearchSuggestions/component' {
|
|
735
|
+
export default MeganavSearchSuggestions;
|
|
736
|
+
function MeganavSearchSuggestions(): {
|
|
737
|
+
teardown: () => void;
|
|
738
|
+
clear: () => void;
|
|
739
|
+
};
|
|
740
|
+
//# sourceMappingURL=component.d.ts.map
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
declare module '@ably/ui/core/LegacyMeganav/component' {
|
|
730
744
|
export default function Meganav({ themeName, addSearchApiKey }: {
|
|
731
745
|
themeName: any;
|
|
732
746
|
addSearchApiKey: any;
|
|
@@ -734,7 +748,7 @@ export default function Meganav({ themeName, addSearchApiKey }: {
|
|
|
734
748
|
//# sourceMappingURL=component.d.ts.map
|
|
735
749
|
}
|
|
736
750
|
|
|
737
|
-
declare module '@ably/ui/core/
|
|
751
|
+
declare module '@ably/ui/core/LegacyMeganav' {
|
|
738
752
|
import { ReactNode } from "react";
|
|
739
753
|
import { ColorClass } from "@ably/ui/core/styles/colors/types";
|
|
740
754
|
export type MeganavTheme = {
|
|
@@ -816,11 +830,136 @@ type MeganavProps = {
|
|
|
816
830
|
};
|
|
817
831
|
const Meganav: ({ paths, themeName, notice, loginLink, urlBase, addSearchApiKey, statusUrl, searchDataId, }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
818
832
|
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
|
+
export type MeganavNoticeBannerProps = {
|
|
882
|
+
props: {
|
|
883
|
+
title: string;
|
|
884
|
+
bodyText: string;
|
|
885
|
+
buttonLink: string;
|
|
886
|
+
buttonLabel: string;
|
|
887
|
+
closeBtn: boolean;
|
|
888
|
+
};
|
|
889
|
+
config: {
|
|
890
|
+
cookieId: string;
|
|
891
|
+
noticeId: string | number;
|
|
892
|
+
options: {
|
|
893
|
+
collapse: boolean;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
export type MeganavProps = {
|
|
898
|
+
sessionState: HeaderSessionState;
|
|
899
|
+
searchDataId: string;
|
|
900
|
+
notice?: MeganavNoticeBannerProps;
|
|
901
|
+
};
|
|
902
|
+
const Meganav: ({ sessionState, searchDataId, notice }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
903
|
+
export default Meganav;
|
|
819
904
|
//# sourceMappingURL=Meganav.d.ts.map
|
|
820
905
|
}
|
|
821
906
|
|
|
907
|
+
declare module '@ably/ui/core/Meganav/MeganavMobile' {
|
|
908
|
+
import { AccordionData } from ".@ably/ui/core/Accordion/types";
|
|
909
|
+
export const MeganavMobile: ({ mobileNavItems, }: {
|
|
910
|
+
mobileNavItems: AccordionData[];
|
|
911
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
912
|
+
//# sourceMappingURL=MeganavMobile.d.ts.map
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare module '@ably/ui/core/Meganav/MeganavPanel' {
|
|
916
|
+
import React from "react";
|
|
917
|
+
import { FlyoutPanelHighlight, FlyoutPanelList } from "@ably/ui/core/data";
|
|
918
|
+
export const MeganavPanel: ({ displayProductTile, panelLeft, panelLeftClassName, panelRightHeading, panelRightItems, panelRightBottom, }: {
|
|
919
|
+
displayProductTile?: boolean;
|
|
920
|
+
panelLeft?: FlyoutPanelHighlight;
|
|
921
|
+
panelLeftClassName?: string;
|
|
922
|
+
panelRightHeading?: string;
|
|
923
|
+
panelRightItems: FlyoutPanelList[];
|
|
924
|
+
panelRightBottom?: React.ReactNode;
|
|
925
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
926
|
+
//# sourceMappingURL=MeganavPanel.d.ts.map
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare module '@ably/ui/core/Meganav/data' {
|
|
930
|
+
import React from "react";
|
|
931
|
+
import { IconName } from ".@ably/ui/core/Icon/types";
|
|
932
|
+
export type FlyoutPanelList = {
|
|
933
|
+
label: string;
|
|
934
|
+
icon: IconName;
|
|
935
|
+
link: string;
|
|
936
|
+
isMobile?: boolean;
|
|
937
|
+
};
|
|
938
|
+
export type FlyoutPanelHighlight = {
|
|
939
|
+
heading: string;
|
|
940
|
+
content: string;
|
|
941
|
+
labelLink: string;
|
|
942
|
+
url: string;
|
|
943
|
+
image: string;
|
|
944
|
+
};
|
|
945
|
+
export type MenuItem = {
|
|
946
|
+
name: string;
|
|
947
|
+
link?: string;
|
|
948
|
+
isHiddenMobile?: boolean;
|
|
949
|
+
content?: React.ReactNode;
|
|
950
|
+
panelClassName?: string;
|
|
951
|
+
};
|
|
952
|
+
export const menuItemLinks: {
|
|
953
|
+
name: string;
|
|
954
|
+
link: string;
|
|
955
|
+
isHiddenMobile: boolean;
|
|
956
|
+
}[];
|
|
957
|
+
export const menuItemsForHeader: MenuItem[];
|
|
958
|
+
//# sourceMappingURL=data.d.ts.map
|
|
959
|
+
}
|
|
960
|
+
|
|
822
961
|
declare module '@ably/ui/core/MeganavBlogPostsList' {
|
|
823
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
962
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
824
963
|
type MeganavBlogPostsListProps = {
|
|
825
964
|
recentBlogPosts: {
|
|
826
965
|
link: string;
|
|
@@ -835,7 +974,7 @@ export default MeganavBlogPostsList;
|
|
|
835
974
|
}
|
|
836
975
|
|
|
837
976
|
declare module '@ably/ui/core/MeganavContentCompany' {
|
|
838
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
977
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/LegacyMeganav";
|
|
839
978
|
type MeganavContentCompanyProps = {
|
|
840
979
|
absUrl: AbsUrl;
|
|
841
980
|
paths?: MeganavPaths;
|
|
@@ -846,7 +985,7 @@ export default MeganavContentCompany;
|
|
|
846
985
|
}
|
|
847
986
|
|
|
848
987
|
declare module '@ably/ui/core/MeganavContentDevelopers' {
|
|
849
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
988
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
850
989
|
const MeganavContentDevelopers: ({ absUrl, statusUrl, }: {
|
|
851
990
|
absUrl: AbsUrl;
|
|
852
991
|
statusUrl: string;
|
|
@@ -856,7 +995,7 @@ export default MeganavContentDevelopers;
|
|
|
856
995
|
}
|
|
857
996
|
|
|
858
997
|
declare module '@ably/ui/core/MeganavContentProducts' {
|
|
859
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
998
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/LegacyMeganav";
|
|
860
999
|
type MeganavContentProductsProps = {
|
|
861
1000
|
paths?: MeganavPaths;
|
|
862
1001
|
absUrl: AbsUrl;
|
|
@@ -867,7 +1006,7 @@ export default MeganavContentProducts;
|
|
|
867
1006
|
}
|
|
868
1007
|
|
|
869
1008
|
declare module '@ably/ui/core/MeganavContentUseCases' {
|
|
870
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1009
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
871
1010
|
const MeganavContentUseCases: ({ absUrl }: {
|
|
872
1011
|
absUrl: AbsUrl;
|
|
873
1012
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -875,18 +1014,9 @@ export default MeganavContentUseCases;
|
|
|
875
1014
|
//# sourceMappingURL=MeganavContentUseCases.d.ts.map
|
|
876
1015
|
}
|
|
877
1016
|
|
|
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
|
-
|
|
887
1017
|
declare module '@ably/ui/core/MeganavControl' {
|
|
888
1018
|
import { ReactNode } from "react";
|
|
889
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
1019
|
+
import { MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
890
1020
|
type MeganavControlProps = {
|
|
891
1021
|
ariaControls: string;
|
|
892
1022
|
ariaLabel: string;
|
|
@@ -899,19 +1029,8 @@ export default MeganavControl;
|
|
|
899
1029
|
//# sourceMappingURL=MeganavControl.d.ts.map
|
|
900
1030
|
}
|
|
901
1031
|
|
|
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
|
-
|
|
913
1032
|
declare module '@ably/ui/core/MeganavControlMobileDropdown' {
|
|
914
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
1033
|
+
import { MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
915
1034
|
const MeganavControlMobileDropdown: ({ theme }: {
|
|
916
1035
|
theme: MeganavTheme;
|
|
917
1036
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -919,15 +1038,6 @@ export default MeganavControlMobileDropdown;
|
|
|
919
1038
|
//# sourceMappingURL=MeganavControlMobileDropdown.d.ts.map
|
|
920
1039
|
}
|
|
921
1040
|
|
|
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
|
-
|
|
931
1041
|
declare module '@ably/ui/core/MeganavControlMobilePanelClose' {
|
|
932
1042
|
type MeganavControlMobilePanelCloseProps = {
|
|
933
1043
|
ariaControls: string;
|
|
@@ -938,15 +1048,6 @@ export default MeganavControlMobilePanelClose;
|
|
|
938
1048
|
//# sourceMappingURL=MeganavControlMobilePanelClose.d.ts.map
|
|
939
1049
|
}
|
|
940
1050
|
|
|
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
|
-
|
|
950
1051
|
declare module '@ably/ui/core/MeganavControlMobilePanelOpen' {
|
|
951
1052
|
import { ReactNode } from "react";
|
|
952
1053
|
type MeganavControlMobilePanelOpenProps = {
|
|
@@ -960,7 +1061,7 @@ export default MeganavControlMobilePanelOpen;
|
|
|
960
1061
|
|
|
961
1062
|
declare module '@ably/ui/core/MeganavItemsDesktop' {
|
|
962
1063
|
import React from "react";
|
|
963
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/
|
|
1064
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
964
1065
|
type MeganavDesktopItems = {
|
|
965
1066
|
panels: MeganavPanels;
|
|
966
1067
|
paths?: MeganavPaths;
|
|
@@ -976,7 +1077,7 @@ export default _default;
|
|
|
976
1077
|
|
|
977
1078
|
declare module '@ably/ui/core/MeganavItemsMobile' {
|
|
978
1079
|
import React from "react";
|
|
979
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
1080
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
980
1081
|
type MeganavItemsMobileProps = {
|
|
981
1082
|
panels: MeganavPanels;
|
|
982
1083
|
paths?: MeganavPaths;
|
|
@@ -993,7 +1094,7 @@ export default _default;
|
|
|
993
1094
|
}
|
|
994
1095
|
|
|
995
1096
|
declare module '@ably/ui/core/MeganavItemsSignedIn' {
|
|
996
|
-
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
1097
|
+
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
997
1098
|
type MeganavItemsSignedIn = {
|
|
998
1099
|
sessionState: MeganavSessionState;
|
|
999
1100
|
theme: MeganavTheme;
|
|
@@ -1006,7 +1107,7 @@ export default MeganavItemsSignedIn;
|
|
|
1006
1107
|
}
|
|
1007
1108
|
|
|
1008
1109
|
declare module '@ably/ui/core/MeganavSearch' {
|
|
1009
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1110
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1010
1111
|
const MeganavSearch: ({ absUrl, dataId, }: {
|
|
1011
1112
|
absUrl: AbsUrl;
|
|
1012
1113
|
dataId?: string;
|
|
@@ -1015,15 +1116,6 @@ export default MeganavSearch;
|
|
|
1015
1116
|
//# sourceMappingURL=MeganavSearch.d.ts.map
|
|
1016
1117
|
}
|
|
1017
1118
|
|
|
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
|
-
|
|
1027
1119
|
declare module '@ably/ui/core/MeganavSearchAutocomplete' {
|
|
1028
1120
|
const MeganavSearchAutocomplete: () => import("react/jsx-runtime").JSX.Element;
|
|
1029
1121
|
export default MeganavSearchAutocomplete;
|
|
@@ -1031,7 +1123,7 @@ export default MeganavSearchAutocomplete;
|
|
|
1031
1123
|
}
|
|
1032
1124
|
|
|
1033
1125
|
declare module '@ably/ui/core/MeganavSearchPanel' {
|
|
1034
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1126
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1035
1127
|
const MeganavSearchPanel: ({ absUrl }: {
|
|
1036
1128
|
absUrl: AbsUrl;
|
|
1037
1129
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1039,17 +1131,8 @@ export default MeganavSearchPanel;
|
|
|
1039
1131
|
//# sourceMappingURL=MeganavSearchPanel.d.ts.map
|
|
1040
1132
|
}
|
|
1041
1133
|
|
|
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
|
-
|
|
1051
1134
|
declare module '@ably/ui/core/MeganavSearchSuggestions' {
|
|
1052
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1135
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1053
1136
|
type MeganavSearchSuggestionsProps = {
|
|
1054
1137
|
absUrl: AbsUrl;
|
|
1055
1138
|
displaySupportLink: boolean;
|
|
@@ -1060,6 +1143,7 @@ export default MeganavSearchSuggestions;
|
|
|
1060
1143
|
}
|
|
1061
1144
|
|
|
1062
1145
|
declare module '@ably/ui/core/Notice/component' {
|
|
1146
|
+
export const COLLAPSE_TRIGGER_DISTANCE: 5;
|
|
1063
1147
|
export default Notice;
|
|
1064
1148
|
function Notice({ bannerContainer, cookieId, noticeId, options }: {
|
|
1065
1149
|
bannerContainer: any;
|
|
@@ -1276,7 +1360,7 @@ export default ProductTile;
|
|
|
1276
1360
|
|
|
1277
1361
|
declare module '@ably/ui/core/SignOutLink' {
|
|
1278
1362
|
import { MouseEventHandler, ReactNode } from "react";
|
|
1279
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1363
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1280
1364
|
type SignOutLinkProps = {
|
|
1281
1365
|
token: string;
|
|
1282
1366
|
href: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0-dev.937d7376",
|
|
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",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import throttle from"lodash.throttle";import{queryId,queryIdAll}from"../dom-query";import MeganavControl from"../MeganavControl/component.js";import MeganavControlMobileDropdown from"../MeganavControlMobileDropdown/component.js";import MobilePanelOpenClick from"../MeganavControlMobilePanelOpen/component.js";import MobilePanelCloseClick from"../MeganavControlMobilePanelClose/component.js";import MeganavSearchAutocomplete from"../MeganavSearchAutocomplete/component.js";import MeganavSearchSuggestions from"../MeganavSearchSuggestions/component.js";const windowOnBlur=closeAll=>{window.onblur=()=>closeAll();return{teardown:()=>window.onblur=null}};const documentClick=closeAll=>{const meganav=queryId("meganav");const clickHandler=e=>{if(meganav.contains(e.target))return;closeAll()};document.addEventListener("click",clickHandler);return{teardown:()=>document.removeEventListener("click",clickHandler)}};const documentScroll=themeName=>{if(themeName!=="transparentToWhite")return{teardown:()=>{}};const meganav=queryId("meganav");const navItems=queryIdAll("meganav-link");const controlMobileDropdownMenu=queryId("meganav-control-mobile-dropdown-menu");const controlMobileDropdownClose=queryId("meganav-control-mobile-dropdown-close");const controls=queryIdAll("meganav-control");const signUpBtn=queryId("meganav-sign-up-btn");const invertTextCollection=[...Array.from(controls),...Array.from(navItems),queryId("meganav-logo")];const invertMobleDropdownColor=invert=>{const whiteToBlack=["ui-icon-white","ui-icon-cool-black"];const blackToWhite=[...whiteToBlack].reverse();if(invert){controlMobileDropdownMenu?.classList.replace(...whiteToBlack);controlMobileDropdownClose?.classList.replace(...whiteToBlack)}else{controlMobileDropdownMenu?.classList.replace(...blackToWhite);controlMobileDropdownClose?.classList.replace(...blackToWhite)}};const inverSignupBtnColors=invert=>{if(invert){signUpBtn?.classList.replace("bg-white","bg-cool-black");signUpBtn?.classList.replace("text-cool-black","text-white")}else{signUpBtn?.classList.replace("bg-cool-black","bg-white");signUpBtn?.classList.replace("text-white","text-cool-black")}};const scrollHandler=throttle(()=>{if(window.scrollY>5){meganav.classList.replace("bg-transparent","bg-white");inverSignupBtnColors(true);invertMobleDropdownColor(true);invertTextCollection.forEach(n=>n.classList.replace("text-white","text-cool-black"))}else{meganav.classList.replace("bg-white","bg-transparent");inverSignupBtnColors(false);invertMobleDropdownColor(false);invertTextCollection.forEach(n=>n.classList.replace("text-cool-black","text-white"))}},150);document.addEventListener("scroll",scrollHandler);return{teardown:()=>document.removeEventListener("scroll",scrollHandler)}};export default function Meganav({themeName,addSearchApiKey}){const controls=MeganavControl();const panelOpenControls=MobilePanelOpenClick();const panelCloseControls=MobilePanelCloseClick();const search=MeganavSearchAutocomplete(addSearchApiKey);const searchSuggestions=MeganavSearchSuggestions();const mobileDropdownControl=MeganavControlMobileDropdown({clearPanels:()=>[...panelOpenControls,...panelCloseControls].forEach(i=>i.clear())});const closeAll=()=>[mobileDropdownControl,searchSuggestions,...panelOpenControls,...panelCloseControls,...controls,...search].forEach(i=>i.clear());const teardowns=[documentScroll(themeName??null),documentClick(closeAll),windowOnBlur(closeAll),mobileDropdownControl,searchSuggestions,...controls,...panelOpenControls,...panelCloseControls,...search].map(i=>i.teardown);return()=>teardowns.forEach(teardown=>teardown())}
|
|
2
|
-
//# sourceMappingURL=component.js.map
|
package/core/Meganav.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import React,{useEffect,useState}from"react";import{connectState}from"./remote-data-store.js";import{selectSessionData}from"./remote-session-data.js";import Logo from"./Logo";import MeganavData from"./Meganav/component.json";import MeganavScripts from"./Meganav/component.js";import MeganavItemsDesktop from"./MeganavItemsDesktop";import MeganavItemsSignedIn from"./MeganavItemsSignedIn";import MeganavItemsMobile from"./MeganavItemsMobile";import Notice from"./Notice";import _absUrl from"./url-base.js";import MeganavContentProducts from"./MeganavContentProducts";import MeganavContentUseCases from"./MeganavContentUseCases";import MeganavContentCompany from"./MeganavContentCompany";import MeganavContentDevelopers from"./MeganavContentDevelopers";import MeganavSearch from"./MeganavSearch";const SignIn=({sessionState,theme,loginLink,absUrl,searchDataId})=>{return sessionState.signedIn?React.createElement(MeganavItemsSignedIn,{absUrl:absUrl,sessionState:sessionState,theme:theme,searchDataId:searchDataId}):React.createElement("ul",{className:"hidden md:flex items-center"},React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl("/contact"),className:`ui-meganav-link ${theme.textColor}`,"data-id":"meganav-link"},"Contact us")),React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl(loginLink),className:`ui-meganav-link mr-0 ${theme.textColor}`,"data-id":"meganav-link"},"Login")),React.createElement("li",{className:"ui-meganav-item"},React.createElement(MeganavSearch,{absUrl:absUrl,dataId:searchDataId})),React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl("/sign-up"),"data-id":"meganav-sign-up-btn",className:`ui-btn p-btn-small ${theme.buttonBackgroundColor} ${theme.buttonTextColor}`},"Sign up free")))};const SignInPlaceholder=()=>React.createElement("div",null);const panels={MeganavContentProducts,MeganavContentUseCases,MeganavContentCompany,MeganavContentDevelopers};const Meganav=({paths,themeName="white",notice,loginLink="/login",urlBase,addSearchApiKey,statusUrl,searchDataId})=>{const[sessionState,setSessionState]=useState();useEffect(()=>{connectState(selectSessionData,setSessionState)},[]);useEffect(()=>{const teardown=MeganavScripts({themeName,addSearchApiKey});return()=>teardown()},[sessionState]);const theme=MeganavData.themes[themeName];const absUrl=path=>_absUrl(path,urlBase);return React.createElement("nav",{className:`ui-meganav-wrapper ${theme.backgroundColor} ${theme.barShadow}`,"data-id":"meganav","aria-label":"Main"},notice&&React.createElement(Notice,{...notice.props,config:notice.config}),React.createElement("div",{className:"ui-meganav ui-grid-px"},React.createElement("div",{className:"mr-24"},React.createElement(Logo,{dataId:"meganav-logo",href:urlBase,logoUrl:paths?.logo})),React.createElement(MeganavItemsDesktop,{panels:panels,paths:paths,theme:theme,absUrl:absUrl,statusUrl:statusUrl}),sessionState?React.createElement(SignIn,{sessionState:sessionState,theme:theme,loginLink:loginLink,absUrl:absUrl,searchDataId:searchDataId}):React.createElement(SignInPlaceholder,null),React.createElement(MeganavItemsMobile,{panels:panels,sessionState:sessionState,paths:paths,theme:theme,loginLink:loginLink,absUrl:absUrl,statusUrl:statusUrl,searchDataId:searchDataId})))};export default Meganav;
|
|
2
|
-
//# sourceMappingURL=Meganav.js.map
|
package/core/Meganav.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/Meganav.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useState } from \"react\";\n\nimport { connectState } from \"./remote-data-store.js\";\nimport { selectSessionData } from \"./remote-session-data.js\";\n\nimport Logo from \"./Logo\";\nimport MeganavData from \"./Meganav/component.json\";\nimport MeganavScripts from \"./Meganav/component.js\";\nimport MeganavItemsDesktop from \"./MeganavItemsDesktop\";\nimport MeganavItemsSignedIn from \"./MeganavItemsSignedIn\";\nimport MeganavItemsMobile from \"./MeganavItemsMobile\";\nimport Notice from \"./Notice\";\nimport _absUrl from \"./url-base.js\";\nimport MeganavContentProducts from \"./MeganavContentProducts\";\nimport MeganavContentUseCases from \"./MeganavContentUseCases\";\nimport MeganavContentCompany from \"./MeganavContentCompany\";\nimport MeganavContentDevelopers from \"./MeganavContentDevelopers\";\nimport MeganavSearch from \"./MeganavSearch\";\nimport { ColorClass } from \"./styles/colors/types\";\n\nexport type MeganavTheme = {\n backgroundColor?: ColorClass;\n textColor?: ColorClass;\n buttonBackgroundColor?: ColorClass;\n buttonTextColor?: ColorClass;\n mobileMenuColor: ColorClass;\n logoTextColor?: ColorClass;\n barShadow?: string;\n};\n\nexport type AbsUrl = (path: string) => string;\n\nexport type MeganavPaths = {\n logo?: string;\n iconSprites: string;\n ablyStack: string;\n blogThumb1: string;\n blogThumb2: string;\n blogThumb3: string;\n awsLogo?: string;\n};\n\nexport type MeganavPanels = {\n [index: string]: ({\n paths,\n absUrl,\n statusUrl,\n }: {\n paths?: MeganavPaths;\n absUrl: (path: string) => string;\n statusUrl: string;\n }) => ReactNode;\n};\n\nexport type MeganavSessionState = {\n signedIn: boolean;\n logOut: {\n token: string;\n href: string;\n text: string;\n };\n accountName: string;\n preferredEmail: string;\n account: {\n links: {\n dashboard: {\n href: string;\n };\n };\n };\n mySettings: {\n text: string;\n href: string;\n };\n myAccessTokens: {\n text: string;\n href: string;\n };\n};\n\ntype SignInProps = {\n sessionState: MeganavSessionState;\n theme: MeganavTheme;\n loginLink: string;\n absUrl: AbsUrl;\n searchDataId?: string;\n};\n\n// This type is based on the API response from the notice API and the data\n// passed into the Meganav component, which then turns it into something\n// the Notice component can use. The type is exported for the benefit of\n// Voltaire\nexport type MeganavNoticeProps = {\n props: {\n title: string;\n bodyText: string;\n buttonLink: string;\n buttonLabel: string;\n closeBtn: boolean;\n };\n config: {\n cookieId: string;\n noticeId: string | number;\n options: {\n collapse: boolean;\n };\n };\n};\n\ntype MeganavProps = {\n paths?: MeganavPaths;\n themeName: \"white\" | \"black\" | \"transparentToWhite\";\n notice?: MeganavNoticeProps;\n loginLink?: string;\n urlBase?: string;\n addSearchApiKey: string;\n statusUrl: string;\n searchDataId?: string;\n};\n\nconst SignIn = ({\n sessionState,\n theme,\n loginLink,\n absUrl,\n searchDataId,\n}: SignInProps) => {\n return sessionState.signedIn ? (\n <MeganavItemsSignedIn\n absUrl={absUrl}\n sessionState={sessionState}\n theme={theme}\n searchDataId={searchDataId}\n />\n ) : (\n <ul className=\"hidden md:flex items-center\">\n <li className=\"ui-meganav-item\">\n <a\n href={absUrl(\"/contact\")}\n className={`ui-meganav-link ${theme.textColor}`}\n data-id=\"meganav-link\"\n >\n Contact us\n </a>\n </li>\n <li className=\"ui-meganav-item\">\n <a\n href={absUrl(loginLink)}\n className={`ui-meganav-link mr-0 ${theme.textColor}`}\n data-id=\"meganav-link\"\n >\n Login\n </a>\n </li>\n <li className=\"ui-meganav-item\">\n <MeganavSearch absUrl={absUrl} dataId={searchDataId} />\n </li>\n <li className=\"ui-meganav-item\">\n <a\n href={absUrl(\"/sign-up\")}\n data-id=\"meganav-sign-up-btn\"\n className={`ui-btn p-btn-small ${theme.buttonBackgroundColor} ${theme.buttonTextColor}`}\n >\n Sign up free\n </a>\n </li>\n </ul>\n );\n};\n\nconst SignInPlaceholder = () => <div />;\n\nconst panels = {\n MeganavContentProducts,\n MeganavContentUseCases,\n MeganavContentCompany,\n MeganavContentDevelopers,\n};\n\nconst Meganav = ({\n paths,\n themeName = \"white\",\n notice,\n loginLink = \"/login\",\n urlBase,\n addSearchApiKey,\n statusUrl,\n searchDataId,\n}: MeganavProps) => {\n const [sessionState, setSessionState] = useState<MeganavSessionState>();\n\n useEffect(() => {\n // Note if state is never updated, sessionState stays null and never removes the placeholder.\n // This makes SSR consistent (ie. we always show the placeholder)\n connectState(selectSessionData, setSessionState);\n }, []);\n\n useEffect(() => {\n const teardown = MeganavScripts({ themeName, addSearchApiKey });\n return () => teardown();\n }, [sessionState]);\n\n const theme = MeganavData.themes[themeName] as MeganavTheme;\n const absUrl = (path: string) => _absUrl(path, urlBase);\n\n return (\n <nav\n className={`ui-meganav-wrapper ${theme.backgroundColor} ${theme.barShadow}`}\n data-id=\"meganav\"\n aria-label=\"Main\"\n >\n {notice && <Notice {...notice.props} config={notice.config} />}\n <div className=\"ui-meganav ui-grid-px\">\n <div className=\"mr-24\">\n <Logo dataId=\"meganav-logo\" href={urlBase} logoUrl={paths?.logo} />\n </div>\n\n <MeganavItemsDesktop\n panels={panels}\n paths={paths}\n theme={theme}\n absUrl={absUrl}\n statusUrl={statusUrl}\n />\n\n {/* Because we load the session state through fetch, we display a placeholder until fetch returns */}\n {sessionState ? (\n <SignIn\n sessionState={sessionState}\n theme={theme}\n loginLink={loginLink}\n absUrl={absUrl}\n searchDataId={searchDataId}\n />\n ) : (\n <SignInPlaceholder />\n )}\n\n <MeganavItemsMobile\n panels={panels}\n sessionState={sessionState}\n paths={paths}\n theme={theme}\n loginLink={loginLink}\n absUrl={absUrl}\n statusUrl={statusUrl}\n searchDataId={searchDataId}\n />\n </div>\n </nav>\n );\n};\n\nexport default Meganav;\n"],"names":["React","useEffect","useState","connectState","selectSessionData","Logo","MeganavData","MeganavScripts","MeganavItemsDesktop","MeganavItemsSignedIn","MeganavItemsMobile","Notice","_absUrl","MeganavContentProducts","MeganavContentUseCases","MeganavContentCompany","MeganavContentDevelopers","MeganavSearch","SignIn","sessionState","theme","loginLink","absUrl","searchDataId","signedIn","ul","className","li","a","href","textColor","data-id","dataId","buttonBackgroundColor","buttonTextColor","SignInPlaceholder","div","panels","Meganav","paths","themeName","notice","urlBase","addSearchApiKey","statusUrl","setSessionState","teardown","themes","path","nav","backgroundColor","barShadow","aria-label","props","config","logoUrl","logo"],"mappings":"AAAA,OAAOA,OAAoBC,SAAS,CAAEC,QAAQ,KAAQ,OAAQ,AAE9D,QAASC,YAAY,KAAQ,wBAAyB,AACtD,QAASC,iBAAiB,KAAQ,0BAA2B,AAE7D,QAAOC,SAAU,QAAS,AAC1B,QAAOC,gBAAiB,0BAA2B,AACnD,QAAOC,mBAAoB,wBAAyB,AACpD,QAAOC,wBAAyB,uBAAwB,AACxD,QAAOC,yBAA0B,wBAAyB,AAC1D,QAAOC,uBAAwB,sBAAuB,AACtD,QAAOC,WAAY,UAAW,AAC9B,QAAOC,YAAa,eAAgB,AACpC,QAAOC,2BAA4B,0BAA2B,AAC9D,QAAOC,2BAA4B,0BAA2B,AAC9D,QAAOC,0BAA2B,yBAA0B,AAC5D,QAAOC,6BAA8B,4BAA6B,AAClE,QAAOC,kBAAmB,iBAAkB,CAuG5C,MAAMC,OAAS,CAAC,CACdC,YAA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AAS,AAAC0B,MAAiBpC,QAAQoC,KAAMN,SAE/C,OACE,oBAACO,OACCvB,UAAW,CAAC,mBAAmB,EAAEN,MAAM8B,eAAe,CAAC,CAAC,EAAE9B,MAAM+B,SAAS,CAAC,CAAC,CAC3EpB,UAAQ,UACRqB,aAAW,QAEVX,QAAU,oBAAC9B,QAAQ,GAAG8B,OAAOY,KAAK,CAAEC,OAAQb,OAAOa,MAAM,GAC1D,oBAAClB,OAAIV,UAAU,yBACb,oBAACU,OAAIV,UAAU,SACb,oBAACrB,MAAK2B,OAAO,eAAeH,KAAMa,QAASa,QAAShB,OAAOiB,QAG7D,oBAAChD,qBACC6B,OAAQA,OACRE,MAAOA,MACPnB,MAAOA,MACPE,OAAQA,OACRsB,UAAWA,YAIZzB,aACC,oBAACD,QACCC,aAAcA,aACdC,MAAOA,MACPC,UAAWA,UACXC,OAAQA,OACRC,aAAcA,eAGhB,oBAACY,wBAGH,oBAACzB,oBACC2B,OAAQA,OACRlB,aAAcA,aACdoB,MAAOA,MACPnB,MAAOA,MACPC,UAAWA,UACXC,OAAQA,OACRsB,UAAWA,UACXrB,aAAcA,gBAKxB,CAEA,gBAAee,OAAQ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{queryIdAll}from"../dom-query";import{selectRecentBlogPosts}from"../remote-blogs-posts";import{connectState}from"../remote-data-store";const template=({link,title,pubDate})=>{const[li,a,heading,copy]=["li","a","p","p"].map(el=>document.createElement(el));a.href=link;a.classList.add("ui-meganav-media","group");heading.textContent=title;heading.classList.add("ui-meganav-media-heading");copy.textContent=pubDate;copy.classList.add("ui-meganav-media-copy");a.appendChild(heading);a.appendChild(copy);li.appendChild(a);return li};export default(()=>{connectState(selectRecentBlogPosts,recentBlogPosts=>{if(Array.isArray(recentBlogPosts)&&recentBlogPosts.length>0){const sections=queryIdAll("meganav-company-panel-blog-section");const containers=queryIdAll("meganav-company-panel-recent-blog-posts");Array.from(containers).forEach(container=>{const fragment=document.createDocumentFragment();recentBlogPosts.forEach(post=>fragment.appendChild(template(post)));container.appendChild(fragment)});Array.from(sections).forEach(section=>section.classList.remove("hidden"))}})});
|
|
2
|
-
//# sourceMappingURL=component.js.map
|