@ably/ui 17.13.0-dev.d6a24f68 → 17.13.1-dev.5fb54a0a
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/AGENTS.md +337 -0
- package/core/Expander.js +1 -1
- package/core/Expander.js.map +1 -1
- package/core/Flash.js +1 -1
- package/core/Flash.js.map +1 -1
- package/core/Icon/components/icon-display-ephemeral-messages-dark-col.js +2 -0
- package/core/Icon/components/icon-display-ephemeral-messages-dark-col.js.map +1 -0
- package/core/Icon/components/icon-display-message-annotations-dark-col.js +2 -0
- package/core/Icon/components/icon-display-message-annotations-dark-col.js.map +1 -0
- package/core/Icon/components/icon-gui-square-3-stack-3d.js +2 -0
- package/core/Icon/components/icon-gui-square-3-stack-3d.js.map +1 -0
- package/core/Icon/components/index.js +1 -1
- package/core/Icon/components/index.js.map +1 -1
- package/core/Icon/computed-icons/display-icons.js +1 -1
- package/core/Icon/computed-icons/display-icons.js.map +1 -1
- package/core/hooks/use-themed-scrollpoints.js +1 -1
- package/core/hooks/use-themed-scrollpoints.js.map +1 -1
- package/core/icons/display/icon-display-ephemeral-messages-dark-col.svg +6 -0
- package/core/icons/display/icon-display-message-annotations-dark-col.svg +11 -0
- package/core/insights/posthog.js +1 -1
- package/core/insights/posthog.js.map +1 -1
- package/core/remote-blogs-posts.js.map +1 -1
- package/core/remote-session-data.js.map +1 -1
- package/core/scripts.js +1 -1
- package/core/scripts.js.map +1 -1
- package/core/sprites-display.svg +1 -1
- package/index.d.ts +49 -45
- package/package.json +8 -9
- package/core/ConnectStateWrapper.js +0 -2
- package/core/ConnectStateWrapper.js.map +0 -1
- package/core/CookieMessage/component.css +0 -15
- package/core/CookieMessage.js +0 -2
- package/core/CookieMessage.js.map +0 -1
- package/core/remote-data-store.js +0 -2
- package/core/remote-data-store.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/hooks/use-themed-scrollpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport { ThemedScrollpoint } from \"../Header/types\";\n\nconst HEADER_HEIGHT = 64;\n\nexport function useThemedScrollpoints(\n scrollpoints: ThemedScrollpoint[],\n): string {\n const [activeClassName, setActiveClassName] = useState<string>(\"\");\n\n const previousClassNameRef = useRef<string>(\"\");\n const observerRef = useRef<IntersectionObserver | null>(null);\n const initialCheckDoneRef = useRef<boolean>(false);\n const intersectingElementsRef = useRef<\n Map<string, IntersectionObserverEntry>\n >(new Map());\n\n useEffect(() => {\n if (scrollpoints.length === 0) {\n // Clear active className when scrollpoints becomes empty\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setActiveClassName(\"\");\n previousClassNameRef.current = \"\";\n return;\n }\n\n const intersectingElements = intersectingElementsRef.current;\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/core/hooks/use-themed-scrollpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport { ThemedScrollpoint } from \"../Header/types\";\n\nconst HEADER_HEIGHT = 64;\n\nexport function useThemedScrollpoints(\n scrollpoints: ThemedScrollpoint[],\n): string {\n const [activeClassName, setActiveClassName] = useState<string>(\"\");\n\n const previousClassNameRef = useRef<string>(\"\");\n const observerRef = useRef<IntersectionObserver | null>(null);\n const initialCheckDoneRef = useRef<boolean>(false);\n const rafIdRef = useRef<number | null>(null);\n const intersectingElementsRef = useRef<\n Map<string, IntersectionObserverEntry>\n >(new Map());\n\n useEffect(() => {\n if (scrollpoints.length === 0) {\n // Clear active className when scrollpoints becomes empty\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setActiveClassName(\"\");\n previousClassNameRef.current = \"\";\n return;\n }\n\n let isMounted = true;\n const intersectingElements = intersectingElementsRef.current;\n\n // Function to find and update the best matching scrollpoint\n const updateBestMatch = (useEntryRects = false) => {\n // Find the best match from ALL currently intersecting elements\n // Strategy: Pick the element whose top edge is closest to the header position\n // Use scrollpoints array order as tiebreaker when distances are equal\n let bestMatch: {\n scrollpoint: ThemedScrollpoint;\n distance: number;\n index: number;\n } | null = null;\n\n for (const [id, entry] of intersectingElements) {\n const scrollpointIndex = scrollpoints.findIndex((sp) => sp.id === id);\n if (scrollpointIndex === -1) continue;\n\n const scrollpoint = scrollpoints[scrollpointIndex];\n\n // For observer callbacks, use entry.boundingClientRect (for test compatibility)\n // For scroll handler, get fresh position data\n const rect = useEntryRects\n ? (entry.boundingClientRect ?? entry.target.getBoundingClientRect())\n : entry.target.getBoundingClientRect();\n\n // Only consider elements at or past the header line\n // This prevents selecting elements that are marked as \"intersecting\" by rootMargin\n // but haven't actually reached the header position yet\n if (rect.top > HEADER_HEIGHT) continue;\n\n // Calculate distance from element's top edge to header position\n const distance = Math.abs(rect.top - HEADER_HEIGHT);\n\n // Pick element with smallest distance; if equal, pick earlier in scrollpoints array\n if (\n !bestMatch ||\n distance < bestMatch.distance ||\n (distance === bestMatch.distance &&\n scrollpointIndex < bestMatch.index)\n ) {\n bestMatch = { scrollpoint, distance, index: scrollpointIndex };\n }\n }\n\n if (\n bestMatch &&\n bestMatch.scrollpoint.className !== previousClassNameRef.current\n ) {\n previousClassNameRef.current = bestMatch.scrollpoint.className;\n setActiveClassName(bestMatch.scrollpoint.className);\n }\n };\n\n observerRef.current = new IntersectionObserver(\n (entries) => {\n // Update the map of currently intersecting elements\n for (const entry of entries) {\n const id = (entry.target as HTMLElement).id;\n if (entry.isIntersecting) {\n intersectingElements.set(id, entry);\n } else {\n intersectingElements.delete(id);\n }\n }\n\n // Schedule best match calculation using entry rects\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n }\n\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n if (!isMounted) return;\n updateBestMatch(true); // Use entry.boundingClientRect\n });\n },\n {\n rootMargin: `-${HEADER_HEIGHT}px 0px 0px 0px`,\n threshold: 0,\n },\n );\n\n // Lightweight scroll handler to re-evaluate on scroll (gets fresh position data)\n const handleScroll = () => {\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n }\n\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n if (!isMounted) return;\n updateBestMatch(false); // Get fresh position data\n });\n };\n\n window.addEventListener(\"scroll\", handleScroll, { passive: true });\n\n scrollpoints.forEach(({ id }) => {\n const element = document.getElementById(id);\n if (element) {\n observerRef.current?.observe(element);\n } else {\n console.warn(\n `useThemedScrollpoints: Element with id \"${id}\" not found in DOM`,\n );\n }\n });\n\n // Manually check initial intersection state since IntersectionObserver\n // callbacks only fire on changes, not on initial observation\n // Use a small timeout to ensure DOM is fully laid out\n const timeoutId = setTimeout(() => {\n if (initialCheckDoneRef.current) {\n return;\n }\n initialCheckDoneRef.current = true;\n\n // Manually populate the intersection map for initial check\n // (observer callbacks haven't fired yet)\n for (const scrollpoint of scrollpoints) {\n const element = document.getElementById(scrollpoint.id);\n if (element) {\n // Create a minimal entry with just the target\n intersectingElements.set(scrollpoint.id, {\n target: element,\n } as unknown as IntersectionObserverEntry);\n }\n }\n\n // Run initial best match calculation (gets fresh position data)\n updateBestMatch(false);\n }, 0);\n\n return () => {\n isMounted = false;\n clearTimeout(timeoutId);\n window.removeEventListener(\"scroll\", handleScroll);\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n observerRef.current?.disconnect();\n observerRef.current = null;\n initialCheckDoneRef.current = false;\n intersectingElements.clear();\n };\n }, [scrollpoints]);\n\n return activeClassName;\n}\n"],"names":["useState","useEffect","useRef","HEADER_HEIGHT","useThemedScrollpoints","scrollpoints","activeClassName","setActiveClassName","previousClassNameRef","observerRef","initialCheckDoneRef","rafIdRef","intersectingElementsRef","Map","length","current","isMounted","intersectingElements","updateBestMatch","useEntryRects","bestMatch","id","entry","scrollpointIndex","findIndex","sp","scrollpoint","rect","boundingClientRect","target","getBoundingClientRect","top","distance","Math","abs","index","className","IntersectionObserver","entries","isIntersecting","set","delete","cancelAnimationFrame","requestAnimationFrame","rootMargin","threshold","handleScroll","window","addEventListener","passive","forEach","element","document","getElementById","observe","console","warn","timeoutId","setTimeout","clearTimeout","removeEventListener","disconnect","clear"],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0.75 21.75C0.75 33.348 10.152 42.75 21.75 42.75C33.348 42.75 42.75 33.348 42.75 21.75C42.75 10.152 33.348 0.75 21.75 0.75" stroke="#FF5416" stroke-width="1.5" stroke-linecap="round" stroke-dasharray="1.5 5"/>
|
|
3
|
+
<rect x="10.75" y="13.75" width="22" height="16" rx="1.86335" stroke="#C6CED9" stroke-width="1.60714"/>
|
|
4
|
+
<path d="M11.75 14.75L22.0601 21.75L31.75 14.75" stroke="#C6CED9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M0.75 21.75C0.75 10.152 10.152 0.75 21.75 0.75" stroke="#FF5416" stroke-width="1.5" stroke-linecap="round" stroke-dasharray="1.5 5"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="45" height="48" viewBox="0 0 45 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.1372 42.3263C15.9301 42.685 15.4714 42.8079 15.1127 42.6008L15.1026 42.595C14.7439 42.3879 14.621 41.9292 14.8281 41.5705C15.0352 41.2118 15.4939 41.0889 15.8526 41.296L15.8627 41.3018C16.2214 41.5089 16.3443 41.9676 16.1372 42.3263ZM28.8632 42.3263C28.6561 41.9676 28.779 41.5089 29.1377 41.3018L29.1477 41.296C29.5064 41.0889 29.9651 41.2118 30.1722 41.5705C30.3793 41.9292 30.2564 42.3879 29.8977 42.595L29.8877 42.6008C29.529 42.8079 29.0703 42.685 28.8632 42.3263ZM33.8807 39.4294C33.6736 39.0707 33.7965 38.612 34.1552 38.4049L34.1652 38.3991C34.5239 38.192 34.9826 38.3149 35.1897 38.6736C35.3968 39.0324 35.2739 39.4911 34.9152 39.6982L34.9052 39.7039C34.5465 39.911 34.0878 39.7881 33.8807 39.4294ZM11.1197 39.4294C10.9126 39.7881 10.4539 39.911 10.0951 39.7039L10.0851 39.6982C9.72641 39.4911 9.6035 39.0324 9.81061 38.6736C10.0177 38.3149 10.4764 38.192 10.8351 38.3991L10.8451 38.4049C11.2039 38.612 11.3268 39.0707 11.1197 39.4294ZM41.5527 27.6526C41.1385 27.6526 40.8027 27.3168 40.8027 26.9026L40.8027 26.8911C40.8027 26.4768 41.1385 26.1411 41.5527 26.1411C41.9669 26.1411 42.3027 26.4768 42.3027 26.8911L42.3027 26.9026C42.3027 27.3168 41.9669 27.6526 41.5527 27.6526ZM3.44762 27.6526C3.0334 27.6526 2.69762 27.3168 2.69762 26.9026L2.69762 26.891C2.69762 26.4768 3.0334 26.141 3.44762 26.141C3.86183 26.141 4.19762 26.4768 4.19762 26.891L4.19762 26.9026C4.19762 27.3168 3.86183 27.6526 3.44762 27.6526ZM41.5527 21.8589C41.1385 21.8589 40.8027 21.5231 40.8027 21.1089L40.8027 21.0973C40.8027 20.6831 41.1385 20.3473 41.5527 20.3473C41.9669 20.3473 42.3027 20.6831 42.3027 21.0973L42.3027 21.1089C42.3027 21.5231 41.9669 21.8589 41.5527 21.8589ZM3.44762 21.8589C3.0334 21.8589 2.69762 21.5231 2.69762 21.1089L2.69762 21.0973C2.69762 20.6831 3.0334 20.3473 3.44762 20.3473C3.86183 20.3473 4.19762 20.6831 4.19762 21.0973L4.19762 21.1089C4.19762 21.5231 3.86183 21.8589 3.44762 21.8589ZM35.1897 9.32629C34.9826 9.68501 34.5239 9.80791 34.1652 9.60081L34.1552 9.59503C33.7965 9.38792 33.6736 8.92923 33.8807 8.57051C34.0878 8.21179 34.5465 8.08888 34.9052 8.29599L34.9152 8.30177C35.2739 8.50888 35.3969 8.96757 35.1897 9.32629ZM9.81061 9.32629C9.60351 8.96757 9.72641 8.50887 10.0851 8.30177L10.0951 8.29599C10.4539 8.08888 10.9126 8.21179 11.1197 8.5705C11.3268 8.92922 11.2039 9.38792 10.8451 9.59503L10.8351 9.6008C10.4764 9.80791 10.0177 9.68501 9.81061 9.32629ZM30.1722 6.42942C29.9651 6.78814 29.5064 6.91105 29.1477 6.70394L29.1377 6.69816C28.779 6.49105 28.6561 6.03236 28.8632 5.67364C29.0703 5.31492 29.529 5.19202 29.8877 5.39912L29.8977 5.4049C30.2564 5.61201 30.3793 6.0707 30.1722 6.42942ZM14.8281 6.42942C14.621 6.0707 14.7439 5.61201 15.1027 5.4049L15.1127 5.39912C15.4714 5.19201 15.9301 5.31492 16.1372 5.67364C16.3443 6.03236 16.2214 6.49105 15.8627 6.69816L15.8527 6.70394C15.4939 6.91105 15.0352 6.78814 14.8281 6.42942Z" fill="#C6CED9"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.5 8C24.7091 8 26.5 6.20914 26.5 4C26.5 1.79086 24.7091 0 22.5 0C20.2909 0 18.5 1.79086 18.5 4C18.5 6.20914 20.2909 8 22.5 8Z" fill="#FF5416"/>
|
|
4
|
+
<path d="M40.5 38C42.7091 38 44.5 36.2091 44.5 34C44.5 31.7909 42.7091 30 40.5 30C38.2909 30 36.5 31.7909 36.5 34C36.5 36.2091 38.2909 38 40.5 38Z" fill="#FF5416"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.90967 10C1.35738 10 0.909668 10.4477 0.909668 11V17C0.909668 17.5523 1.35738 18 1.90967 18H7.90967C8.46195 18 8.90967 17.5523 8.90967 17V11C8.90967 10.4477 8.46195 10 7.90967 10H1.90967Z" fill="#FF5416"/>
|
|
6
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 40C18.9477 40 18.5 40.4477 18.5 41V47C18.5 47.5523 18.9477 48 19.5 48H25.5C26.0523 48 26.5 47.5523 26.5 47V41C26.5 40.4477 26.0523 40 25.5 40H19.5Z" fill="#FF5416"/>
|
|
7
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.366 10.5C40.9811 9.83333 40.0189 9.83333 39.634 10.5L36.1699 16.5C35.785 17.1667 36.2661 18 37.0359 18H43.9641C44.7339 18 45.215 17.1667 44.8301 16.5L41.366 10.5Z" fill="#FF5416"/>
|
|
8
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.33162 30.5C4.94672 29.8333 3.98447 29.8333 3.59957 30.5L0.135467 36.5C-0.249434 37.1667 0.231691 38 1.00149 38H7.92969C8.69949 38 9.18062 37.1667 8.79572 36.5L5.33162 30.5Z" fill="#FF5416"/>
|
|
9
|
+
<rect x="12.6875" y="17" width="20.125" height="14" rx="1.75" stroke="#C6CED9" stroke-width="1.5"/>
|
|
10
|
+
<path d="M13.3437 17.6562L23.0417 24.4375L32.1562 17.6562" stroke="#C6CED9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
</svg>
|
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,...properties})=>{if(!userId){return}if(userId!==posthog.get_distinct_id()){posthog.identify(userId,{email,name,...properties})}if(accountId){posthog.group("account",accountId)}if(organisationId){posthog.group("organisation",organisationId)}};export const trackPageView=properties=>{posthog.capture("$pageview",properties)};export const track=(event,properties)=>{posthog.capture(event,properties)};export const startSessionRecording=()=>{posthog.startSessionRecording()};export const stopSessionRecording=()=>{posthog.stopSessionRecording()};
|
|
1
|
+
import posthog from"posthog-js";export const initPosthog=(apiKey,apiHost)=>{if(!apiKey){return}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,...properties})=>{if(!userId){return}if(userId!==posthog.get_distinct_id()){posthog.identify(userId,{email,name,...properties})}if(accountId){posthog.group("account",accountId)}if(organisationId){posthog.group("organisation",organisationId)}};export const trackPageView=properties=>{posthog.capture("$pageview",properties)};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 ...properties\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, ...properties });\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 = (properties?: Record<string, unknown>) => {\n posthog.capture(\"$pageview\", properties);\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n posthog.capture(event, properties);\n};\n\nexport const startSessionRecording = () => {\n posthog.startSessionRecording();\n};\n\nexport const stopSessionRecording = () => {\n posthog.stopSessionRecording();\n};\n"],"names":["posthog","initPosthog","apiKey","apiHost","init","api_host","capture_pageview","enableDebugMode","debug","disableDebugMode","identify","userId","accountId","organisationId","email","name","properties","get_distinct_id","group","trackPageView","capture","track","event","startSessionRecording","stopSessionRecording"],"mappings":"AAAA,OAAOA,YAAa,YAAa,AAIjC,QAAO,MAAMC,YAAc,CAACC,OAAgBC,
|
|
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 if (!apiKey) {\n return;\n }\n\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 ...properties\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, ...properties });\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 = (properties?: Record<string, unknown>) => {\n posthog.capture(\"$pageview\", properties);\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n posthog.capture(event, properties);\n};\n\nexport const startSessionRecording = () => {\n posthog.startSessionRecording();\n};\n\nexport const stopSessionRecording = () => {\n posthog.stopSessionRecording();\n};\n"],"names":["posthog","initPosthog","apiKey","apiHost","init","api_host","capture_pageview","enableDebugMode","debug","disableDebugMode","identify","userId","accountId","organisationId","email","name","properties","get_distinct_id","group","trackPageView","capture","track","event","startSessionRecording","stopSessionRecording"],"mappings":"AAAA,OAAOA,YAAa,YAAa,AAIjC,QAAO,MAAMC,YAAc,CAACC,OAAgBC,WAC1C,GAAI,CAACD,OAAQ,CACX,MACF,CAEAF,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,CACJ,GAAGC,WACc,IAGjB,GAAI,CAACL,OAAQ,CACX,MACF,CAEA,GAAIA,SAAWX,QAAQiB,eAAe,GAAI,CACxCjB,QAAQU,QAAQ,CAACC,OAAQ,CAAEG,MAAOC,KAAM,GAAGC,UAAU,AAAC,EACxD,CAGA,GAAIJ,UAAW,CACbZ,QAAQkB,KAAK,CAAC,UAAWN,UAC3B,CAGA,GAAIC,eAAgB,CAClBb,QAAQkB,KAAK,CAAC,eAAgBL,eAChC,CACF,CAAE,AAEF,QAAO,MAAMM,cAAgB,AAACH,aAC5BhB,QAAQoB,OAAO,CAAC,YAAaJ,WAC/B,CAAE,AAEF,QAAO,MAAMK,MAAQ,CAACC,MAAeN,cACnChB,QAAQoB,OAAO,CAACE,MAAON,WACzB,CAAE,AAEF,QAAO,MAAMO,sBAAwB,KACnCvB,QAAQuB,qBAAqB,EAC/B,CAAE,AAEF,QAAO,MAAMC,qBAAuB,KAClCxB,QAAQwB,oBAAoB,EAC9B,CAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/remote-blogs-posts.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst fetchBlogPosts = async (store, blogUrl) => {\n try {\n if (!blogUrl) {\n console.log(\n `Skipping fetching blog posts, invalid blogUrl: \"${blogUrl}\"`,\n );\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(blogUrl, options);\n\n if (isJsonResponse(res.headers.get(\"content-type\"))) {\n const payload = await res.json();\n store.dispatch({ type: \"blog/loaded\", payload });\n } else {\n throw new Error(\"Blog posts url is not serving json\");\n }\n } catch (e) {\n console.warn(\"Could not fetch blog posts due to error:\", e);\n }\n};\n\nconst initialState = { recent: null };\n\nconst REDUCER_KEY = \"blogPosts\";\n\nconst reducerBlogPosts = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"blog/loaded\":\n return { ...state, recent: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectRecentBlogPosts = (store) => store.getState()[REDUCER_KEY]?.recent;\n\nexport { fetchBlogPosts, reducerBlogPosts, selectRecentBlogPosts };\n"],"names":["isJsonResponse","fetchBlogPosts","store","blogUrl","console","log","options","headers","accept","cache","credentials","res","fetch","get","payload","json","dispatch","type","Error","e","warn","initialState","recent","REDUCER_KEY","reducerBlogPosts","state","action","selectRecentBlogPosts","getState"],"mappings":"AAEA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,eAAiB,MAAOC,MAAOC,WACnC,GAAI,CACF,GAAI,CAACA,QAAS,CACZC,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEF,QAAQ,CAAC,CAAC,EAE/D,MACF,CAEA,MAAMG,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,
|
|
1
|
+
{"version":3,"sources":["../../src/core/remote-blogs-posts.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst fetchBlogPosts = async (store, blogUrl) => {\n try {\n if (!blogUrl) {\n console.log(\n `Skipping fetching blog posts, invalid blogUrl: \"${blogUrl}\"`,\n );\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(blogUrl, options);\n\n if (isJsonResponse(res.headers.get(\"content-type\"))) {\n const payload = await res.json();\n store.dispatch({ type: \"blog/loaded\", payload });\n } else {\n throw new Error(\"Blog posts url is not serving json\");\n }\n } catch (e) {\n console.warn(\"Could not fetch blog posts due to error:\", e);\n }\n};\n\nconst initialState = { recent: null };\n\nconst REDUCER_KEY = \"blogPosts\";\n\nconst reducerBlogPosts = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"blog/loaded\":\n return { ...state, recent: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectRecentBlogPosts = (store) => store.getState()[REDUCER_KEY]?.recent;\n\nexport { fetchBlogPosts, reducerBlogPosts, selectRecentBlogPosts };\n"],"names":["isJsonResponse","fetchBlogPosts","store","blogUrl","console","log","options","headers","accept","cache","credentials","res","fetch","get","payload","json","dispatch","type","Error","e","warn","initialState","recent","REDUCER_KEY","reducerBlogPosts","state","action","selectRecentBlogPosts","getState"],"mappings":"AAEA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,eAAiB,MAAOC,MAAOC,WACnC,GAAI,CACF,GAAI,CAACA,QAAS,CACZC,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEF,QAAQ,CAAC,CAAC,EAE/D,MACF,CAEA,MAAMG,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,GAWJ,MAX2C,CACrCH,QAAQI,WAAW,CAAG,SACxB,CAEA,MAAMC,IAAM,MAAMC,MAAMT,QAASG,SAEjC,GAAIN,eAAeW,IAAIJ,OAAO,CAACM,GAAG,CAAC,iBAAkB,CACnD,MAAMC,QAAU,MAAMH,IAAII,IAAI,GAC9Bb,MAAMc,QAAQ,CAAC,CAAEC,KAAM,cAAeH,OAAQ,EAChD,KAAO,CACL,MAAM,IAAII,MAAM,qCAClB,CACF,CAAE,MAAOC,EAAG,CACVf,QAAQgB,IAAI,CAAC,2CAA4CD,EAC3D,CACF,EAEA,MAAME,aAAe,CAAEC,OAAQ,IAAK,EAEpC,MAAMC,YAAc,YAEpB,MAAMC,iBAAmB,CACvB,CAACD,YAAY,CAAE,CAACE,MAAQJ,YAAY,CAAEK,UACpC,OAAQA,OAAOT,IAAI,EACjB,IAAK,cACH,MAAO,CAAE,GAAGQ,KAAK,CAAEH,OAAQI,OAAOZ,OAAO,AAAC,CAC5C,SACE,OAAOW,KACX,CACF,CACF,EAEA,MAAME,sBAAwB,AAACzB,OAAUA,MAAM0B,QAAQ,EAAE,CAACL,YAAY,EAAED,MAExE,QAASrB,cAAc,CAAEuB,gBAAgB,CAAEG,qBAAqB,CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/remote-session-data.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\n// Fetches current users session data\n// Assumes an authenticated session, so will only work when used on ably.com/ably.io\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst NOT_FOUND_ERROR_CODE = \"not-found\";\n\nconst fetchSessionData = async (store, sessionUrl) => {\n const sessionLoaded = (payload = {}) =>\n store.dispatch({ type: \"session/loaded\", payload });\n\n try {\n if (!sessionUrl) {\n console.log(\n `Skipping fetching session, invalid sessionUrl: \"${sessionUrl}\"`,\n );\n sessionLoaded();\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(sessionUrl, options);\n const jsonResponse = isJsonResponse(res.headers.get(\"content-type\"));\n\n if (!jsonResponse) {\n throw new Error(\"Session endpoint is not serving json\");\n }\n\n const payload = await res.json();\n\n if (payload.error === NOT_FOUND_ERROR_CODE) {\n sessionLoaded();\n } else {\n sessionLoaded(payload);\n }\n } catch (e) {\n sessionLoaded();\n console.warn(\"Could not fetch session data due to error:\", e);\n }\n};\n\nconst initialState = { data: null };\n\nconst REDUCER_KEY = \"session\";\n\nconst reducerSessionData = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"session/loaded\":\n return { ...state, data: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectSessionData = (store) => store.getState()[REDUCER_KEY]?.data;\n\nexport { fetchSessionData, reducerSessionData, selectSessionData };\n"],"names":["isJsonResponse","NOT_FOUND_ERROR_CODE","fetchSessionData","store","sessionUrl","sessionLoaded","payload","dispatch","type","console","log","options","headers","accept","cache","credentials","res","fetch","jsonResponse","get","Error","json","error","e","warn","initialState","data","REDUCER_KEY","reducerSessionData","state","action","selectSessionData","getState"],"mappings":"AAKA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,qBAAuB,YAE7B,MAAMC,iBAAmB,MAAOC,MAAOC,cACrC,MAAMC,cAAgB,CAACC,QAAU,CAAC,CAAC,GACjCH,MAAMI,QAAQ,CAAC,CAAEC,KAAM,iBAAkBF,OAAQ,GAEnD,GAAI,CACF,GAAI,CAACF,WAAY,CACfK,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEN,WAAW,CAAC,CAAC,EAElEC,gBACA,MACF,CAEA,MAAMM,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,
|
|
1
|
+
{"version":3,"sources":["../../src/core/remote-session-data.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\n// Fetches current users session data\n// Assumes an authenticated session, so will only work when used on ably.com/ably.io\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst NOT_FOUND_ERROR_CODE = \"not-found\";\n\nconst fetchSessionData = async (store, sessionUrl) => {\n const sessionLoaded = (payload = {}) =>\n store.dispatch({ type: \"session/loaded\", payload });\n\n try {\n if (!sessionUrl) {\n console.log(\n `Skipping fetching session, invalid sessionUrl: \"${sessionUrl}\"`,\n );\n sessionLoaded();\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(sessionUrl, options);\n const jsonResponse = isJsonResponse(res.headers.get(\"content-type\"));\n\n if (!jsonResponse) {\n throw new Error(\"Session endpoint is not serving json\");\n }\n\n const payload = await res.json();\n\n if (payload.error === NOT_FOUND_ERROR_CODE) {\n sessionLoaded();\n } else {\n sessionLoaded(payload);\n }\n } catch (e) {\n sessionLoaded();\n console.warn(\"Could not fetch session data due to error:\", e);\n }\n};\n\nconst initialState = { data: null };\n\nconst REDUCER_KEY = \"session\";\n\nconst reducerSessionData = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"session/loaded\":\n return { ...state, data: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectSessionData = (store) => store.getState()[REDUCER_KEY]?.data;\n\nexport { fetchSessionData, reducerSessionData, selectSessionData };\n"],"names":["isJsonResponse","NOT_FOUND_ERROR_CODE","fetchSessionData","store","sessionUrl","sessionLoaded","payload","dispatch","type","console","log","options","headers","accept","cache","credentials","res","fetch","jsonResponse","get","Error","json","error","e","warn","initialState","data","REDUCER_KEY","reducerSessionData","state","action","selectSessionData","getState"],"mappings":"AAKA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,qBAAuB,YAE7B,MAAMC,iBAAmB,MAAOC,MAAOC,cACrC,MAAMC,cAAgB,CAACC,QAAU,CAAC,CAAC,GACjCH,MAAMI,QAAQ,CAAC,CAAEC,KAAM,iBAAkBF,OAAQ,GAEnD,GAAI,CACF,GAAI,CAACF,WAAY,CACfK,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEN,WAAW,CAAC,CAAC,EAElEC,gBACA,MACF,CAEA,MAAMM,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,GACkB,MADqB,CACrCH,QAAQI,WAAW,CAAG,SACxB,CAEA,MAAMC,IAAM,MAAMC,MAAMb,WAAYO,SACpC,MAAMO,aAAelB,eAAegB,IAAIJ,OAAO,CAACO,GAAG,CAAC,iBAEpD,GAAI,CAACD,aAAc,CACjB,MAAM,IAAIE,MAAM,uCAClB,CAEA,MAAMd,QAAU,MAAMU,IAAIK,IAAI,GAE9B,GAAIf,QAAQgB,KAAK,GAAKrB,qBAAsB,CAC1CI,eACF,KAAO,CACLA,cAAcC,QAChB,CACF,CAAE,MAAOiB,EAAG,CACVlB,gBACAI,QAAQe,IAAI,CAAC,6CAA8CD,EAC7D,CACF,EAEA,MAAME,aAAe,CAAEC,KAAM,IAAK,EAElC,MAAMC,YAAc,UAEpB,MAAMC,mBAAqB,CACzB,CAACD,YAAY,CAAE,CAACE,MAAQJ,YAAY,CAAEK,UACpC,OAAQA,OAAOtB,IAAI,EACjB,IAAK,iBACH,MAAO,CAAE,GAAGqB,KAAK,CAAEH,KAAMI,OAAOxB,OAAO,AAAC,CAC1C,SACE,OAAOuB,KACX,CACF,CACF,EAEA,MAAME,kBAAoB,AAAC5B,OAAUA,MAAM6B,QAAQ,EAAE,CAACL,YAAY,EAAED,IAEpE,QAASxB,gBAAgB,CAAE0B,kBAAkB,CAAEG,iBAAiB,CAAG"}
|
package/core/scripts.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export*from"./remote-
|
|
1
|
+
import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export*from"./remote-blogs-posts";export*from"./remote-session-data";export*from"./dom-query";
|
|
2
2
|
//# sourceMappingURL=scripts.js.map
|
package/core/scripts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/scripts.js"],"sourcesContent":["import \"array-flat-polyfill\";\n\nexport { default as reactRenderer, renderComponent } from \"./react-renderer\";\nexport { default as loadSprites } from \"./load-sprites\";\n\nexport * from \"./remote-
|
|
1
|
+
{"version":3,"sources":["../../src/core/scripts.js"],"sourcesContent":["import \"array-flat-polyfill\";\n\nexport { default as reactRenderer, renderComponent } from \"./react-renderer\";\nexport { default as loadSprites } from \"./load-sprites\";\n\nexport * from \"./remote-blogs-posts\";\nexport * from \"./remote-session-data\";\nexport * from \"./dom-query\";\n"],"names":["default","reactRenderer","renderComponent","loadSprites"],"mappings":"AAAA,MAAO,qBAAsB,AAE7B,QAASA,WAAWC,aAAa,CAAEC,eAAe,KAAQ,kBAAmB,AAC7E,QAASF,WAAWG,WAAW,KAAQ,gBAAiB,AAExD,YAAc,sBAAuB,AACrC,YAAc,uBAAwB,AACtC,YAAc,aAAc"}
|