@ably/ui 17.14.0 → 18.0.0-dev.dbc599e55b
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/Flash.js +1 -1
- package/core/Flash.js.map +1 -1
- package/core/Icon/components/icon-display-asset-tracking-col.js +2 -0
- package/core/Icon/components/icon-display-asset-tracking-col.js.map +1 -0
- package/core/Icon/components/icon-gui-prod-asset-tracking-outline.js +2 -0
- package/core/Icon/components/icon-gui-prod-asset-tracking-outline.js.map +1 -0
- package/core/Icon/components/icon-gui-prod-asset-tracking-solid.js +2 -0
- package/core/Icon/components/icon-gui-prod-asset-tracking-solid.js.map +1 -0
- package/core/Icon/components/icon-product-asset-tracking-mono.js +2 -0
- package/core/Icon/components/icon-product-asset-tracking-mono.js.map +1 -0
- package/core/Icon/components/icon-product-asset-tracking.js +2 -0
- package/core/Icon/components/icon-product-asset-tracking.js.map +1 -0
- package/core/SessionData.js +2 -0
- package/core/SessionData.js.map +1 -0
- package/core/scripts.js +1 -1
- package/core/scripts.js.map +1 -1
- package/index.d.ts +143 -60
- package/package.json +5 -5
- package/core/ConnectStateWrapper.js +0 -2
- package/core/ConnectStateWrapper.js.map +0 -1
- package/core/remote-blogs-posts.js +0 -2
- package/core/remote-blogs-posts.js.map +0 -1
- package/core/remote-data-store.js +0 -2
- package/core/remote-data-store.js.map +0 -1
- package/core/remote-session-data.js +0 -2
- package/core/remote-session-data.js.map +0 -1
package/core/Flash.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{useEffect,useState,useRef}from"react";import DOMPurify from"dompurify";import
|
|
1
|
+
import React,{useEffect,useState,useRef,createContext,useContext,useCallback,useMemo}from"react";import DOMPurify from"dompurify";import Icon from"./Icon";const FLASH_DATA_ID="ui-flashes";const FlashContext=createContext(undefined);const FlashProvider=({children})=>{const[flashes,setFlashes]=useState([]);const removeFlash=useCallback(flashId=>{setFlashes(prev=>prev.filter(item=>item.id!==flashId))},[]);const addFlashes=useCallback(newFlashes=>{setFlashes(prev=>{const withIds=newFlashes.filter(flash=>!prev.some(existing=>existing.content===flash.content&&existing.type===flash.type)).map(flash=>({...flash,id:Math.random().toString(36).slice(2),removed:false,removeFlash}));return[...prev,...withIds]})},[removeFlash]);const contextValue=useMemo(()=>({flashes,addFlashes,removeFlash}),[flashes,addFlashes,removeFlash]);return React.createElement(FlashContext.Provider,{value:contextValue},children)};const useFlashContext=()=>{const context=useContext(FlashContext);if(context===undefined){throw new Error("useFlashContext must be used within FlashProvider")}return context};const FLASH_BG_COLOR={error:"bg-gui-error",success:"bg-zingy-green",notice:"bg-electric-cyan",info:"bg-electric-cyan",alert:"bg-active-orange"};const FLASH_TEXT_COLOR={error:"text-white",success:"text-cool-black",notice:"text-cool-black",info:"text-cool-black",alert:"text-white"};const AUTO_HIDE=["success","info","notice"];const AUTO_HIDE_TIME=8e3;const useAutoHide=(type,closeFlash)=>{const timeoutId=useRef(null);useEffect(()=>{if(AUTO_HIDE.includes(type)){timeoutId.current=setTimeout(()=>{closeFlash()},AUTO_HIDE_TIME)}return()=>{if(timeoutId.current){clearTimeout(timeoutId.current)}}},[type,closeFlash])};const Flash=({id,type,content,removeFlash})=>{const ref=useRef(null);const[closed,setClosed]=useState(false);const[flashHeight,setFlashHeight]=useState(0);const closeFlash=()=>{if(ref.current){setFlashHeight(ref.current.getBoundingClientRect().height)}setClosed(true);setTimeout(()=>{if(id){removeFlash(id)}},100)};useAutoHide(type,closeFlash);const animateEntry=!closed;let style;if(flashHeight&&!closed){style={height:`${flashHeight}px`}}else if(closed){style={height:0,marginTop:0,zIndex:-1}}else{style={}}const safeContent=DOMPurify.sanitize(content,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","data-method"],ALLOWED_URI_REGEXP:/^\/[^/]/});const withIcons={notice:"icon-gui-ably-badge",success:"icon-gui-check-outline",error:"icon-gui-exclamation-triangle-outline",alert:"icon-gui-exclamation-triangle-outline",info:""};const iconColor={notice:"text-cool-black",success:"text-cool-black",error:"text-white",alert:"text-white",info:""};return React.createElement("div",{className:`ui-flash-message ui-grid-px ${animateEntry?"ui-flash-message-enter":""}`,style:style,ref:ref,"data-id":"ui-flash","data-testid":"ui-flash"},React.createElement("div",{className:`${FLASH_BG_COLOR[type]} p-8 flex align-center rounded shadow-container-subtle`},withIcons[type]&&iconColor[type]&&React.createElement(Icon,{name:withIcons[type],color:iconColor[type],size:"1.5rem",additionalCSS:"mr-4 self-baseline"}),React.createElement("p",{className:`ui-text-p1 mr-4 ${FLASH_TEXT_COLOR[type]}`,dangerouslySetInnerHTML:{__html:safeContent}}),React.createElement("button",{type:"button",className:"p-0 ml-auto self-start focus:outline-none focus-base",onClick:closeFlash},iconColor[type]&&React.createElement(Icon,{name:"icon-gui-x-mark-outline",color:iconColor[type],size:"1.5rem",additionalCSS:"transition-colors"}))))};const Flashes=()=>{const{flashes}=useFlashContext();return React.createElement("div",{className:"ui-flash","data-id":FLASH_DATA_ID},flashes.filter(item=>!item.removed).map(flash=>React.createElement(Flash,{key:flash.id,...flash})))};const BackendFlashes=({flashes})=>{const context=useContext(FlashContext);const addFlashes=context?.addFlashes;useEffect(()=>{if(!addFlashes){console.warn("BackendFlashes must be used within FlashProvider");return}const transformedFlashes=flashes.map(flash=>{const[type,content]=flash;return{type:type,content}});if(transformedFlashes.length>0){addFlashes(transformedFlashes)}},[flashes,addFlashes]);if(!context)return null;return React.createElement(Flashes,null)};export{FLASH_DATA_ID,Flashes,FlashProvider,useFlashContext};export default BackendFlashes;
|
|
2
2
|
//# sourceMappingURL=Flash.js.map
|
package/core/Flash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/Flash.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from \"react\";\nimport DOMPurify from \"dompurify\";\nimport { getRemoteDataStore } from \"./remote-data-store.js\";\nimport ConnectStateWrapper from \"./ConnectStateWrapper\";\nimport Icon from \"./Icon\";\nimport { ColorClass } from \"./styles/colors/types\";\nimport { IconName } from \"./Icon/types\";\n\ntype FlashPropsType = \"error\" | \"success\" | \"notice\" | \"info\" | \"alert\";\n\ntype FlashProps = {\n id: string;\n removed: boolean;\n type: FlashPropsType;\n content: string;\n removeFlash: (id: string) => void;\n};\n\ntype FlashesProps = {\n flashes: { items: Pick<FlashProps, \"type\" | \"content\">[] };\n};\n\ntype BackendFlashesProps = {\n flashes: string[][];\n};\n\nconst REDUCER_KEY = \"flashes\";\nconst FLASH_DATA_ID = \"ui-flashes\";\n\nconst initialState = { items: [] };\n\nconst reducerFlashes = {\n [REDUCER_KEY]: (\n state: {\n items: FlashProps[];\n } = initialState,\n action: { type: string; payload: FlashProps | FlashProps[] },\n ) => {\n switch (action.type) {\n case \"flash/push\": {\n const flashes = Array.isArray(action.payload)\n ? action.payload\n : [action.payload];\n return { items: [...state.items, ...flashes] };\n }\n default:\n return state;\n }\n },\n};\n\n// Not cool but redux isn't a long term plan here\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst selectFlashes = (store: any): { items: FlashProps[] } =>\n store.getState()[REDUCER_KEY];\n\nconst FLASH_BG_COLOR = {\n error: \"bg-gui-error\",\n success: \"bg-zingy-green\",\n notice: \"bg-electric-cyan\",\n info: \"bg-electric-cyan\",\n alert: \"bg-active-orange\",\n};\n\nconst FLASH_TEXT_COLOR = {\n error: \"text-white\",\n success: \"text-cool-black\",\n notice: \"text-cool-black\",\n info: \"text-cool-black\",\n alert: \"text-white\",\n};\n\nconst AUTO_HIDE = [\"success\", \"info\", \"notice\"];\nconst AUTO_HIDE_TIME = 8000;\n\nconst useAutoHide = (type: string, closeFlash: () => void) => {\n const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (AUTO_HIDE.includes(type)) {\n timeoutId.current = setTimeout(() => {\n closeFlash();\n }, AUTO_HIDE_TIME);\n }\n\n return () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n }\n };\n }, [type, closeFlash]);\n};\n\nconst Flash = ({ id, type, content, removeFlash }: FlashProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [closed, setClosed] = useState(false);\n const [flashHeight, setFlashHeight] = useState(0);\n\n const closeFlash = () => {\n if (ref.current) {\n setFlashHeight(ref.current.getBoundingClientRect().height);\n }\n\n setClosed(true);\n\n setTimeout(() => {\n if (id) {\n removeFlash(id);\n }\n }, 100);\n };\n\n useAutoHide(type, closeFlash);\n\n const animateEntry = !closed;\n\n let style;\n\n if (flashHeight && !closed) {\n style = { height: `${flashHeight}px` };\n } else if (closed) {\n style = { height: 0, marginTop: 0, zIndex: -1 };\n } else {\n style = {};\n }\n\n const safeContent = DOMPurify.sanitize(content, {\n ALLOWED_TAGS: [\"a\"],\n ALLOWED_ATTR: [\"href\", \"data-method\"],\n ALLOWED_URI_REGEXP: /^\\/[^/]/,\n });\n\n const withIcons: Record<FlashPropsType, IconName | \"\"> = {\n notice: \"icon-gui-ably-badge\",\n success: \"icon-gui-check-outline\",\n error: \"icon-gui-exclamation-triangle-outline\",\n alert: \"icon-gui-exclamation-triangle-outline\",\n info: \"\",\n };\n\n const iconColor: Record<FlashPropsType, ColorClass | \"\"> = {\n notice: \"text-cool-black\",\n success: \"text-cool-black\",\n error: \"text-white\",\n alert: \"text-white\",\n info: \"\",\n };\n\n return (\n <div\n className={`ui-flash-message ui-grid-px ${\n animateEntry ? \"ui-flash-message-enter\" : \"\"\n }`}\n style={style}\n ref={ref}\n data-id=\"ui-flash\"\n data-testid=\"ui-flash\"\n >\n <div\n className={`${FLASH_BG_COLOR[type]} p-8 flex align-center rounded shadow-container-subtle`}\n >\n {withIcons[type] && iconColor[type] && (\n <Icon\n name={withIcons[type]}\n color={iconColor[type]}\n size=\"1.5rem\"\n additionalCSS=\"mr-4 self-baseline\"\n />\n )}\n <p\n className={`ui-text-p1 mr-4 ${FLASH_TEXT_COLOR[type]}`}\n dangerouslySetInnerHTML={{ __html: safeContent }}\n />\n <button\n type=\"button\"\n className=\"p-0 ml-auto self-start focus:outline-none\"\n onClick={closeFlash}\n >\n {iconColor[type] && (\n <Icon\n name=\"icon-gui-x-mark-outline\"\n color={iconColor[type]}\n size=\"1.5rem\"\n additionalCSS=\"transition-colors\"\n />\n )}\n </button>\n </div>\n </div>\n );\n};\n\nconst Flashes = ({ flashes }: FlashesProps) => {\n const [flashesWithIds, setFlashesWithIds] = useState<FlashProps[]>([]);\n\n const removeFlash = (flashId: string) =>\n setFlashesWithIds((items) => items.filter((item) => item.id !== flashId));\n\n useEffect(() => {\n if (!flashes?.items?.length) return;\n\n setFlashesWithIds((state) => {\n const newFlashes = (flashes.items ?? [])\n .filter(\n (flash) =>\n !state.some(\n (existing) =>\n existing.content === flash.content &&\n existing.type === flash.type,\n ),\n )\n .map((flash) => ({\n ...flash,\n id: Math.random().toString(36).slice(2),\n removed: false,\n removeFlash,\n }));\n\n return newFlashes.length > 0 ? [...state, ...newFlashes] : state;\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [flashes]);\n\n return (\n <div className=\"ui-flash\" data-id={FLASH_DATA_ID}>\n {flashesWithIds\n .filter((item) => !item.removed)\n .map((flash) => (\n <Flash key={flash.id} {...flash} />\n ))}\n </div>\n );\n};\n\nconst BackendFlashes = ({ flashes }: BackendFlashesProps) => {\n useEffect(() => {\n const transformedFlashes =\n flashes.map((flash) => {\n const [type, content] = flash;\n return { type, content };\n }) || [];\n\n if (transformedFlashes.length > 0) {\n const store = getRemoteDataStore();\n\n store.dispatch({\n type: \"flash/push\",\n payload: transformedFlashes,\n });\n }\n }, [flashes]);\n\n const WrappedFlashes = ConnectStateWrapper(Flashes, {\n flashes: selectFlashes,\n });\n\n return <WrappedFlashes />;\n};\n\nexport { reducerFlashes, FLASH_DATA_ID, Flashes };\nexport default BackendFlashes;\n"],"names":["React","useEffect","useState","useRef","DOMPurify","getRemoteDataStore","ConnectStateWrapper","Icon","REDUCER_KEY","FLASH_DATA_ID","initialState","items","reducerFlashes","state","action","type","flashes","Array","isArray","payload","selectFlashes","store","getState","FLASH_BG_COLOR","error","success","notice","info","alert","FLASH_TEXT_COLOR","AUTO_HIDE","AUTO_HIDE_TIME","useAutoHide","closeFlash","timeoutId","includes","current","setTimeout","clearTimeout","Flash","id","content","removeFlash","ref","closed","setClosed","flashHeight","setFlashHeight","getBoundingClientRect","height","animateEntry","style","marginTop","zIndex","safeContent","sanitize","ALLOWED_TAGS","ALLOWED_ATTR","ALLOWED_URI_REGEXP","withIcons","iconColor","div","className","data-id","data-testid","name","color","size","additionalCSS","p","dangerouslySetInnerHTML","__html","button","onClick","Flashes","flashesWithIds","setFlashesWithIds","flashId","filter","item","length","newFlashes","flash","some","existing","map","Math","random","toString","slice","removed","key","BackendFlashes","transformedFlashes","dispatch","WrappedFlashes"],"mappings":"AAAA,OAAOA,OAASC,SAAS,CAAEC,QAAQ,CAAEC,MAAM,KAAQ,OAAQ,AAC3D,QAAOC,cAAe,WAAY,AAClC,QAASC,kBAAkB,KAAQ,wBAAyB,AAC5D,QAAOC,wBAAyB,uBAAwB,AACxD,QAAOC,SAAU,QAAS,CAsB1B,MAAMC,YAAc,UACpB,MAAMC,cAAgB,aAEtB,MAAMC,aAAe,CAAEC,MAAO,EAAE,AAAC,EAEjC,MAAMC,eAAiB,CACrB,CAACJ,YAAY,CAAE,CACbK,MAEIH,YAAY,CAChBI,UAEA,OAAQA,OAAOC,IAAI,EACjB,IAAK,aAAc,CACjB,MAAMC,QAAUC,MAAMC,OAAO,CAACJ,OAAOK,OAAO,EACxCL,OAAOK,OAAO,CACd,CAACL,OAAOK,OAAO,CAAC,CACpB,MAAO,CAAER,MAAO,IAAIE,MAAMF,KAAK,IAAKK,QAAQ,AAAC,CAC/C,CACA,QACE,OAAOH,KACX,CACF,CACF,EAIA,MAAMO,cAAgB,AAACC,OACrBA,MAAMC,QAAQ,EAAE,CAACd,YAAY,CAE/B,MAAMe,eAAiB,CACrBC,MAAO,eACPC,QAAS,iBACTC,OAAQ,mBACRC,KAAM,mBACNC,MAAO,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
{"version":3,"sources":["../../src/core/Flash.tsx"],"sourcesContent":["import React, {\n useEffect,\n useState,\n useRef,\n createContext,\n useContext,\n useCallback,\n useMemo,\n PropsWithChildren,\n} from \"react\";\nimport DOMPurify from \"dompurify\";\nimport Icon from \"./Icon\";\nimport { ColorClass } from \"./styles/colors/types\";\nimport { IconName } from \"./Icon/types\";\n\ntype FlashPropsType = \"error\" | \"success\" | \"notice\" | \"info\" | \"alert\";\n\ntype FlashProps = {\n id: string;\n removed: boolean;\n type: FlashPropsType;\n content: string;\n removeFlash: (id: string) => void;\n};\n\ntype BackendFlashesProps = {\n flashes: string[][];\n};\n\nconst FLASH_DATA_ID = \"ui-flashes\";\n\ntype FlashContextType = {\n flashes: FlashProps[];\n addFlashes: (flashes: Pick<FlashProps, \"type\" | \"content\">[]) => void;\n removeFlash: (id: string) => void;\n};\n\nconst FlashContext = createContext<FlashContextType | undefined>(undefined);\n\ntype FlashProviderProps = PropsWithChildren;\n\n/**\n * FlashProvider - Context provider for managing flash messages throughout the application.\n *\n * Maintains a global list of flash messages and provides methods to add/remove them.\n * Automatically deduplicates messages with the same type and content to prevent duplicates.\n * Use this at the app root level and access via useFlashContext() in child components.\n */\nconst FlashProvider = ({ children }: FlashProviderProps) => {\n const [flashes, setFlashes] = useState<FlashProps[]>([]);\n\n const removeFlash = useCallback((flashId: string) => {\n setFlashes((prev) => prev.filter((item) => item.id !== flashId));\n }, []);\n\n const addFlashes = useCallback(\n (newFlashes: Pick<FlashProps, \"type\" | \"content\">[]) => {\n setFlashes((prev) => {\n const withIds = newFlashes\n .filter(\n (flash) =>\n !prev.some(\n (existing) =>\n existing.content === flash.content &&\n existing.type === flash.type,\n ),\n )\n .map((flash) => ({\n ...flash,\n id: Math.random().toString(36).slice(2),\n removed: false,\n removeFlash,\n }));\n\n return [...prev, ...withIds];\n });\n },\n [removeFlash],\n );\n\n const contextValue = useMemo(\n () => ({ flashes, addFlashes, removeFlash }),\n [flashes, addFlashes, removeFlash],\n );\n\n return (\n <FlashContext.Provider value={contextValue}>\n {children}\n </FlashContext.Provider>\n );\n};\n\nconst useFlashContext = () => {\n const context = useContext(FlashContext);\n if (context === undefined) {\n throw new Error(\"useFlashContext must be used within FlashProvider\");\n }\n return context;\n};\n\nconst FLASH_BG_COLOR = {\n error: \"bg-gui-error\",\n success: \"bg-zingy-green\",\n notice: \"bg-electric-cyan\",\n info: \"bg-electric-cyan\",\n alert: \"bg-active-orange\",\n};\n\nconst FLASH_TEXT_COLOR = {\n error: \"text-white\",\n success: \"text-cool-black\",\n notice: \"text-cool-black\",\n info: \"text-cool-black\",\n alert: \"text-white\",\n};\n\nconst AUTO_HIDE = [\"success\", \"info\", \"notice\"];\nconst AUTO_HIDE_TIME = 8000;\n\nconst useAutoHide = (type: string, closeFlash: () => void) => {\n const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (AUTO_HIDE.includes(type)) {\n timeoutId.current = setTimeout(() => {\n closeFlash();\n }, AUTO_HIDE_TIME);\n }\n\n return () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n }\n };\n }, [type, closeFlash]);\n};\n\n/**\n * Flash - Individual flash message component with animations and auto-dismiss.\n *\n * Displays a colored notification banner with an icon, message content, and close button.\n * Success/info/notice messages auto-hide after 8 seconds. Error/alert messages require\n * manual dismissal. Uses CSS animations for smooth entry/exit and height transitions\n * on close. Content is sanitized with DOMPurify to allow safe HTML links from backend.\n */\nconst Flash = ({ id, type, content, removeFlash }: FlashProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [closed, setClosed] = useState(false);\n const [flashHeight, setFlashHeight] = useState(0);\n\n const closeFlash = () => {\n if (ref.current) {\n setFlashHeight(ref.current.getBoundingClientRect().height);\n }\n\n setClosed(true);\n\n setTimeout(() => {\n if (id) {\n removeFlash(id);\n }\n }, 100);\n };\n\n useAutoHide(type, closeFlash);\n\n const animateEntry = !closed;\n\n let style;\n\n if (flashHeight && !closed) {\n style = { height: `${flashHeight}px` };\n } else if (closed) {\n style = { height: 0, marginTop: 0, zIndex: -1 };\n } else {\n style = {};\n }\n\n const safeContent = DOMPurify.sanitize(content, {\n ALLOWED_TAGS: [\"a\"],\n ALLOWED_ATTR: [\"href\", \"data-method\"],\n ALLOWED_URI_REGEXP: /^\\/[^/]/,\n });\n\n const withIcons: Record<FlashPropsType, IconName | \"\"> = {\n notice: \"icon-gui-ably-badge\",\n success: \"icon-gui-check-outline\",\n error: \"icon-gui-exclamation-triangle-outline\",\n alert: \"icon-gui-exclamation-triangle-outline\",\n info: \"\",\n };\n\n const iconColor: Record<FlashPropsType, ColorClass | \"\"> = {\n notice: \"text-cool-black\",\n success: \"text-cool-black\",\n error: \"text-white\",\n alert: \"text-white\",\n info: \"\",\n };\n\n return (\n <div\n className={`ui-flash-message ui-grid-px ${\n animateEntry ? \"ui-flash-message-enter\" : \"\"\n }`}\n style={style}\n ref={ref}\n data-id=\"ui-flash\"\n data-testid=\"ui-flash\"\n >\n <div\n className={`${FLASH_BG_COLOR[type]} p-8 flex align-center rounded shadow-container-subtle`}\n >\n {withIcons[type] && iconColor[type] && (\n <Icon\n name={withIcons[type]}\n color={iconColor[type]}\n size=\"1.5rem\"\n additionalCSS=\"mr-4 self-baseline\"\n />\n )}\n <p\n className={`ui-text-p1 mr-4 ${FLASH_TEXT_COLOR[type]}`}\n dangerouslySetInnerHTML={{ __html: safeContent }}\n />\n <button\n type=\"button\"\n className=\"p-0 ml-auto self-start focus:outline-none focus-base\"\n onClick={closeFlash}\n >\n {iconColor[type] && (\n <Icon\n name=\"icon-gui-x-mark-outline\"\n color={iconColor[type]}\n size=\"1.5rem\"\n additionalCSS=\"transition-colors\"\n />\n )}\n </button>\n </div>\n </div>\n );\n};\n\n/**\n * Flashes - Container component that renders all active flash messages.\n *\n * Reads from FlashContext and displays each flash message in order.\n * Use this component where you want flash messages to appear in your layout\n * (typically near the top of the page). Filters out removed messages.\n */\nconst Flashes = () => {\n const { flashes } = useFlashContext();\n\n return (\n <div className=\"ui-flash\" data-id={FLASH_DATA_ID}>\n {flashes\n .filter((item) => !item.removed)\n .map((flash) => (\n <Flash key={flash.id} {...flash} />\n ))}\n </div>\n );\n};\n\n/**\n * BackendFlashes - Integration component for server-side flash messages (default export).\n *\n * Receives flash messages from backend as an array of [type, content] tuples and adds\n * them to the FlashContext on mount. Primary use case is hydrating flash messages from\n * Rails or other backend frameworks. Renders the Flashes component to display messages.\n * Must be used within FlashProvider.\n */\nconst BackendFlashes = ({ flashes }: BackendFlashesProps) => {\n const context = useContext(FlashContext);\n const addFlashes = context?.addFlashes;\n\n useEffect(() => {\n if (!addFlashes) {\n console.warn(\"BackendFlashes must be used within FlashProvider\");\n return;\n }\n\n const transformedFlashes = flashes.map((flash) => {\n const [type, content] = flash;\n return { type: type as FlashPropsType, content };\n });\n\n if (transformedFlashes.length > 0) {\n addFlashes(transformedFlashes);\n }\n }, [flashes, addFlashes]);\n\n if (!context) return null;\n\n return <Flashes />;\n};\n\nexport { FLASH_DATA_ID, Flashes, FlashProvider, useFlashContext };\nexport default BackendFlashes;\n"],"names":["React","useEffect","useState","useRef","createContext","useContext","useCallback","useMemo","DOMPurify","Icon","FLASH_DATA_ID","FlashContext","undefined","FlashProvider","children","flashes","setFlashes","removeFlash","flashId","prev","filter","item","id","addFlashes","newFlashes","withIds","flash","some","existing","content","type","map","Math","random","toString","slice","removed","contextValue","Provider","value","useFlashContext","context","Error","FLASH_BG_COLOR","error","success","notice","info","alert","FLASH_TEXT_COLOR","AUTO_HIDE","AUTO_HIDE_TIME","useAutoHide","closeFlash","timeoutId","includes","current","setTimeout","clearTimeout","Flash","ref","closed","setClosed","flashHeight","setFlashHeight","getBoundingClientRect","height","animateEntry","style","marginTop","zIndex","safeContent","sanitize","ALLOWED_TAGS","ALLOWED_ATTR","ALLOWED_URI_REGEXP","withIcons","iconColor","div","className","data-id","data-testid","name","color","size","additionalCSS","p","dangerouslySetInnerHTML","__html","button","onClick","Flashes","key","BackendFlashes","console","warn","transformedFlash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AAE,CAAG,GAAGI,KAAK,IAIzC,EAUA,MAAMmE,eAAiB,CAAC,CAAE9E,OAAO,CAAuB,IACtD,MAAM0B,QAAUpC,WAAWM,cAC3B,MAAMY,WAAakB,SAASlB,WAE5BtB,UAAU,KACR,GAAI,CAACsB,WAAY,CACfuE,QAAQC,IAAI,CAAC,oDACb,MACF,CAEA,MAAMC,mBAAqBjF,QAAQgB,GAAG,CAAC,AAACL,QACtC,KAAM,CAACI,KAAMD,QAAQ,CAAGH,MACxB,MAAO,CAAEI,KAAMA,KAAwBD,OAAQ,CACjD,GAEA,GAAImE,mBAAmBC,MAAM,CAAG,EAAG,CACjC1E,WAAWyE,mBACb,CACF,EAAG,CAACjF,QAASQ,WAAW,EAExB,GAAI,CAACkB,QAAS,OAAO,KAErB,OAAO,oBAACkD,aACV,CAEA,QAASjF,aAAa,CAAEiF,OAAO,CAAE9E,aAAa,CAAE2B,eAAe,CAAG,AAClE,gBAAeqD,cAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as React from"react";import{forwardRef}from"react";const IconDisplayAssetTrackingCol=({title,titleId,...props},ref)=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:48,height:48,fill:"none",viewBox:"0 0 48 48",ref:ref,"aria-labelledby":titleId,...props},title?React.createElement("title",{id:titleId},title):null,React.createElement("path",{stroke:"#03020D",strokeLinejoin:"bevel",strokeMiterlimit:10,strokeWidth:1.5,d:"M40 35.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"}),React.createElement("path",{fill:"#03020D",d:"m40.02 44.5-.557.502a.75.75 0 0 0 1.114 0zm-6.27-12.96c0-3.47 2.81-6.29 6.25-6.29v-1.5c-4.276 0-7.75 3.5-7.75 7.79zM40 25.25c3.458 0 6.25 2.819 6.25 6.29h1.5c0-4.289-3.453-7.79-7.75-7.79zm6.25 6.29c0 1.148-.39 2.495-1.025 3.912-.63 1.406-1.479 2.825-2.337 4.099a46 46 0 0 1-3.408 4.428l-.014.015-.003.004.557.502c.557.502.558.501.558.501l.001-.002q.003 0 .005-.005l.016-.018.061-.069.228-.262a47.613 47.613 0 0 0 3.243-4.256c.886-1.316 1.784-2.812 2.462-4.323.673-1.501 1.156-3.074 1.156-4.526zM40.02 44.5l.557-.502v-.001q-.003 0-.004-.004l-.014-.015-.056-.063-.217-.249a46.488 46.488 0 0 1-3.155-4.124c-.864-1.276-1.716-2.695-2.35-4.1-.64-1.416-1.031-2.76-1.031-3.902h-1.5c0 1.449.486 3.02 1.163 4.519.682 1.51 1.584 3.007 2.476 4.324A48 48 0 0 0 39.46 45l.001.002z"}),React.createElement("path",{stroke:"#03020D",strokeLinejoin:"bevel",strokeMiterlimit:10,strokeWidth:1.5,d:"M8 13.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"}),React.createElement("path",{fill:"#03020D",d:"m8.02 22.5-.557.502a.75.75 0 0 0 1.115 0zM1.75 9.54c0-3.47 2.81-6.29 6.25-6.29v-1.5C3.724 1.75.25 5.25.25 9.54zM8 3.25c3.458 0 6.25 2.819 6.25 6.29h1.5c0-4.289-3.453-7.79-7.75-7.79zm6.25 6.29c0 1.148-.39 2.495-1.025 3.912-.63 1.406-1.479 2.825-2.337 4.099a46 46 0 0 1-3.408 4.428l-.014.015-.003.004.557.502.558.501.001-.002.005-.005.077-.087.228-.262a47.602 47.602 0 0 0 3.243-4.256c.886-1.316 1.784-2.812 2.462-4.323.673-1.501 1.156-3.074 1.156-4.526zM8.02 22.5l.557-.502v-.001q-.003 0-.004-.004l-.014-.015-.056-.063q-.076-.085-.216-.249a46.466 46.466 0 0 1-3.155-4.124c-.864-1.276-1.717-2.695-2.352-4.1-.639-1.416-1.03-2.76-1.03-3.902H.25c0 1.449.486 3.02 1.163 4.519.682 1.51 1.584 3.007 2.476 4.324a48 48 0 0 0 3.551 4.594l.017.018.004.005.001.002z"}),React.createElement("path",{stroke:"#03020D",strokeLinecap:"round",strokeWidth:1.5,d:"M34 44.5H12a4 4 0 0 1-4-4v-3a4 4 0 0 1 4-4h1"}),React.createElement("circle",{cx:18,cy:33.5,r:3,fill:"#FF5416"}),React.createElement("circle",{cx:14.25,cy:23.25,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:23.25,cy:33.5,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:23.25,cy:23.25,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:26.25,cy:33.5,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:26.25,cy:23.25,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:28.25,cy:28.5,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:28.25,cy:25.5,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:28.25,cy:31.5,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:20.25,cy:23.25,r:.75,fill:"#FF5416"}),React.createElement("circle",{cx:17.25,cy:23.25,r:.75,fill:"#FF5416"}));const ForwardRef=forwardRef(IconDisplayAssetTrackingCol);export default ForwardRef;
|
|
2
|
+
//# sourceMappingURL=icon-display-asset-tracking-col.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/Icon/components/icon-display-asset-tracking-col.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\ninterface SVGRProps {\n title?: string;\n titleId?: string;\n}\nconst IconDisplayAssetTrackingCol = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & SVGRProps, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" width={48} height={48} fill=\"none\" viewBox=\"0 0 48 48\" ref={ref} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path stroke=\"#03020D\" strokeLinejoin=\"bevel\" strokeMiterlimit={10} strokeWidth={1.5} d=\"M40 35.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z\" /><path fill=\"#03020D\" d=\"m40.02 44.5-.557.502a.75.75 0 0 0 1.114 0zm-6.27-12.96c0-3.47 2.81-6.29 6.25-6.29v-1.5c-4.276 0-7.75 3.5-7.75 7.79zM40 25.25c3.458 0 6.25 2.819 6.25 6.29h1.5c0-4.289-3.453-7.79-7.75-7.79zm6.25 6.29c0 1.148-.39 2.495-1.025 3.912-.63 1.406-1.479 2.825-2.337 4.099a46 46 0 0 1-3.408 4.428l-.014.015-.003.004.557.502c.557.502.558.501.558.501l.001-.002q.003 0 .005-.005l.016-.018.061-.069.228-.262a47.613 47.613 0 0 0 3.243-4.256c.886-1.316 1.784-2.812 2.462-4.323.673-1.501 1.156-3.074 1.156-4.526zM40.02 44.5l.557-.502v-.001q-.003 0-.004-.004l-.014-.015-.056-.063-.217-.249a46.488 46.488 0 0 1-3.155-4.124c-.864-1.276-1.716-2.695-2.35-4.1-.64-1.416-1.031-2.76-1.031-3.902h-1.5c0 1.449.486 3.02 1.163 4.519.682 1.51 1.584 3.007 2.476 4.324A48 48 0 0 0 39.46 45l.001.002z\" /><path stroke=\"#03020D\" strokeLinejoin=\"bevel\" strokeMiterlimit={10} strokeWidth={1.5} d=\"M8 13.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z\" /><path fill=\"#03020D\" d=\"m8.02 22.5-.557.502a.75.75 0 0 0 1.115 0zM1.75 9.54c0-3.47 2.81-6.29 6.25-6.29v-1.5C3.724 1.75.25 5.25.25 9.54zM8 3.25c3.458 0 6.25 2.819 6.25 6.29h1.5c0-4.289-3.453-7.79-7.75-7.79zm6.25 6.29c0 1.148-.39 2.495-1.025 3.912-.63 1.406-1.479 2.825-2.337 4.099a46 46 0 0 1-3.408 4.428l-.014.015-.003.004.557.502.558.501.001-.002.005-.005.077-.087.228-.262a47.602 47.602 0 0 0 3.243-4.256c.886-1.316 1.784-2.812 2.462-4.323.673-1.501 1.156-3.074 1.156-4.526zM8.02 22.5l.557-.502v-.001q-.003 0-.004-.004l-.014-.015-.056-.063q-.076-.085-.216-.249a46.466 46.466 0 0 1-3.155-4.124c-.864-1.276-1.717-2.695-2.352-4.1-.639-1.416-1.03-2.76-1.03-3.902H.25c0 1.449.486 3.02 1.163 4.519.682 1.51 1.584 3.007 2.476 4.324a48 48 0 0 0 3.551 4.594l.017.018.004.005.001.002z\" /><path stroke=\"#03020D\" strokeLinecap=\"round\" strokeWidth={1.5} d=\"M34 44.5H12a4 4 0 0 1-4-4v-3a4 4 0 0 1 4-4h1\" /><circle cx={18} cy={33.5} r={3} fill=\"#FF5416\" /><circle cx={14.25} cy={23.25} r={0.75} fill=\"#FF5416\" /><circle cx={23.25} cy={33.5} r={0.75} fill=\"#FF5416\" /><circle cx={23.25} cy={23.25} r={0.75} fill=\"#FF5416\" /><circle cx={26.25} cy={33.5} r={0.75} fill=\"#FF5416\" /><circle cx={26.25} cy={23.25} r={0.75} fill=\"#FF5416\" /><circle cx={28.25} cy={28.5} r={0.75} fill=\"#FF5416\" /><circle cx={28.25} cy={25.5} r={0.75} fill=\"#FF5416\" /><circle cx={28.25} cy={31.5} r={0.75} fill=\"#FF5416\" /><circle cx={20.25} cy={23.25} r={0.75} fill=\"#FF5416\" /><circle cx={17.25} cy={23.25} r={0.75} fill=\"#FF5416\" /></svg>;\nconst ForwardRef = forwardRef(IconDisplayAssetTrackingCol);\nexport default ForwardRef;"],"names":["React","forwardRef","IconDisplayAssetTrackingCol","title","titleId","props","ref","svg","xmlns","width","height","fill","viewBox","aria-labelledby","id","path","stroke","strokeLinejoin","strokeMiterlimit","strokeWidth","d","strokeLinecap","circle","cx","cy","r","ForwardRef"],"mappings":"AAAA,UAAYA,UAAW,OAAQ,AAE/B,QAAcC,UAAU,KAAQ,OAAQ,CAKxC,MAAMC,4BAA8B,CAAC,CACnCC,KAAK,CACLC,OAAO,CACP,GAAGC,MACiC,CAAEC,MAA4B,oBAACC,OAAIC,MAAM,6BAA6BC,MAAO,GAAIC,OAAQ,GAAIC,KAAK,OAAOC,QAAQ,YAAYN,IAAKA,IAAKO,kBAAiBT,QAAU,GAAGC,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conGuiProdAssetTrackingOutline=({title,titleId,...props},ref)=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:ref,"aria-labelledby":titleId,...props},title?React.createElement("title",{id:titleId},title):null,React.createElement("path",{fill:"currentColor",d:"m13.32 20.397.558.5zm-2.64 0-.558.5zm7.807-10.167c0 .644-.2 1.42-.571 2.292-.369.865-.888 1.779-1.482 2.685-1.189 1.813-2.64 3.538-3.672 4.69l1.116 1c1.056-1.176 2.563-2.964 3.81-4.867.624-.952 1.193-1.947 1.608-2.92.411-.965.69-1.953.69-2.88zM12 3.743a6.487 6.487 0 0 1 6.487 6.487h1.5A7.987 7.987 0 0 0 12 2.243zM5.513 10.23A6.487 6.487 0 0 1 12 3.743v-1.5a7.987 7.987 0 0 0-7.987 7.987zm5.726 9.666c-1.033-1.151-2.484-2.876-3.673-4.689-.594-.906-1.113-1.82-1.482-2.685-.371-.871-.57-1.648-.57-2.292h-1.5c0 .927.279 1.915.69 2.88.415.973.984 1.968 1.608 2.92 1.248 1.903 2.755 3.691 3.81 4.868zm1.523 0a1.01 1.01 0 0 1-1.524 0l-1.116 1.002a2.51 2.51 0 0 0 3.756 0zm1.383-9.666c0 1.185-.96 2.145-2.145 2.145v1.5a3.645 3.645 0 0 0 3.645-3.645zM12 8.085c1.185 0 2.145.96 2.145 2.145h1.5A3.645 3.645 0 0 0 12 6.585zM9.855 10.23c0-1.184.96-2.145 2.145-2.145v-1.5a3.645 3.645 0 0 0-3.645 3.645zM12 12.375a2.145 2.145 0 0 1-2.145-2.145h-1.5A3.645 3.645 0 0 0 12 13.875z"}));const ForwardRef=forwardRef(IconGuiProdAssetTrackingOutline);export default ForwardRef;
|
|
2
|
+
//# sourceMappingURL=icon-gui-prod-asset-tracking-outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/Icon/components/icon-gui-prod-asset-tracking-outline.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\ninterface SVGRProps {\n title?: string;\n titleId?: string;\n}\nconst IconGuiProdAssetTrackingOutline = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & SVGRProps, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} fill=\"none\" viewBox=\"0 0 24 24\" ref={ref} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fill=\"currentColor\" d=\"m13.32 20.397.558.5zm-2.64 0-.558.5zm7.807-10.167c0 .644-.2 1.42-.571 2.292-.369.865-.888 1.779-1.482 2.685-1.189 1.813-2.64 3.538-3.672 4.69l1.116 1c1.056-1.176 2.563-2.964 3.81-4.867.624-.952 1.193-1.947 1.608-2.92.411-.965.69-1.953.69-2.88zM12 3.743a6.487 6.487 0 0 1 6.487 6.487h1.5A7.987 7.987 0 0 0 12 2.243zM5.513 10.23A6.487 6.487 0 0 1 12 3.743v-1.5a7.987 7.987 0 0 0-7.987 7.987zm5.726 9.666c-1.033-1.151-2.484-2.876-3.673-4.689-.594-.906-1.113-1.82-1.482-2.685-.371-.871-.57-1.648-.57-2.292h-1.5c0 .927.279 1.915.69 2.88.415.973.984 1.968 1.608 2.92 1.248 1.903 2.755 3.691 3.81 4.868zm1.523 0a1.01 1.01 0 0 1-1.524 0l-1.116 1.002a2.51 2.51 0 0 0 3.756 0zm1.383-9.666c0 1.185-.96 2.145-2.145 2.145v1.5a3.645 3.645 0 0 0 3.645-3.645zM12 8.085c1.185 0 2.145.96 2.145 2.145h1.5A3.645 3.645 0 0 0 12 6.585zM9.855 10.23c0-1.184.96-2.145 2.145-2.145v-1.5a3.645 3.645 0 0 0-3.645 3.645zM12 12.375a2.145 2.145 0 0 1-2.145-2.145h-1.5A3.645 3.645 0 0 0 12 13.875z\" /></svg>;\nconst ForwardRef = forwardRef(IconGuiProdAssetTrackingOutline);\nexport default ForwardRef;"],"names":["React","forwardRef","IconGuiProdAssetTrackingOutline","title","titleId","props","ref","svg","xmlns","width","height","fill","viewBox","aria-labelledby","id","path","d","ForwardRef"],"mappings":"AAAA,UAAYA,UAAW,OAAQ,AAE/B,QAAcC,UAAU,KAAQ,OAAQ,CAKxC,MAAMC,gCAAkC,CAAC,CACvCC,KAAK,CACLC,OAAO,CACP,GAAGC,MACiC,CAAEC,MAA4B,oBAACC,OAAIC,MAAM,6BAA6BC,MAAO,GAAIC,OAAQ,GAAIC,KAAK,OAAOC,QAAQ,YAAYN,IAAKA,IAAKO,kBAAiBT,QAAU,GAAGC,KAAK,EAAGF,MAAQ,oBAACA,SAAMW,GAAIV,SAAUD,OAAiB,KAAK,oBAACY,QAAKJ,KAAK,eAAeK,EAAE,08BAClS,MAAMC,WAAahB,WAAWC,gCAC9B,gBAAee,UAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as React from"react";import{forwardRef}from"react";const IconGuiProdAssetTrackingSolid=({title,titleId,...props},ref)=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:ref,"aria-labelledby":titleId,...props},title?React.createElement("title",{id:titleId},title):null,React.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.013 10.23a7.987 7.987 0 0 1 15.974 0c0 .927-.28 1.915-.691 2.88-.415.973-.984 1.968-1.608 2.92-1.247 1.903-2.754 3.691-3.81 4.868a2.51 2.51 0 0 1-3.756 0c-1.055-1.177-2.562-2.965-3.81-4.868-.624-.952-1.193-1.947-1.608-2.92-.411-.965-.69-1.953-.69-2.88m4.342 0a3.645 3.645 0 1 1 7.29 0 3.645 3.645 0 0 1-7.29 0",clipRule:"evenodd"}));const ForwardRef=forwardRef(IconGuiProdAssetTrackingSolid);export default ForwardRef;
|
|
2
|
+
//# sourceMappingURL=icon-gui-prod-asset-tracking-solid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/Icon/components/icon-gui-prod-asset-tracking-solid.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\ninterface SVGRProps {\n title?: string;\n titleId?: string;\n}\nconst IconGuiProdAssetTrackingSolid = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & SVGRProps, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} fill=\"none\" viewBox=\"0 0 24 24\" ref={ref} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fill=\"currentColor\" fillRule=\"evenodd\" d=\"M4.013 10.23a7.987 7.987 0 0 1 15.974 0c0 .927-.28 1.915-.691 2.88-.415.973-.984 1.968-1.608 2.92-1.247 1.903-2.754 3.691-3.81 4.868a2.51 2.51 0 0 1-3.756 0c-1.055-1.177-2.562-2.965-3.81-4.868-.624-.952-1.193-1.947-1.608-2.92-.411-.965-.69-1.953-.69-2.88m4.342 0a3.645 3.645 0 1 1 7.29 0 3.645 3.645 0 0 1-7.29 0\" clipRule=\"evenodd\" /></svg>;\nconst ForwardRef = forwardRef(IconGuiProdAssetTrackingSolid);\nexport default ForwardRef;"],"names":["React","forwardRef","IconGuiProdAssetTrackingSolid","title","titleId","props","ref","svg","xmlns","width","height","fill","viewBox","aria-labelledby","id","path","fillRule","d","clipRule","ForwardRef"],"mappings":"AAAA,UAAYA,UAAW,OAAQ,AAE/B,QAAcC,UAAU,KAAQ,OAAQ,CAKxC,MAAMC,8BAAgC,CAAC,CACrCC,KAAK,CACLC,OAAO,CACP,GAAGC,MACiC,CAAEC,MAA4B,oBAACC,OAAIC,MAAM,6BAA6BC,MAAO,GAAIC,OAAQ,GAAIC,KAAK,OAAOC,QAAQ,YAAYN,IAAKA,IAAKO,kBAAiBT,QAAU,GAAGC,KAAK,EAAGF,MAAQ,oBAACA,SAAMW,GAAIV,SAAUD,OAAiB,KAAK,oBAACY,QAAKJ,KAAK,eAAeK,SAAS,UAAUC,EAAE,2TAA2TC,SAAS,aACznB,MAAMC,WAAalB,WAAWC,8BAC9B,gBAAeiB,UAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as React from"react";import{forwardRef}from"react";const IconProductAssetTrackingMono=({title,titleId,...props},ref)=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:128,height:128,fill:"none",viewBox:"0 0 128 128",ref:ref,"aria-labelledby":titleId,...props},title?React.createElement("title",{id:titleId},title):null,React.createElement("path",{fill:"currentColor",d:"m72.208 116.222-1.861-1.669zm-16.416 0-1.86 1.669zM106.5 53c0 4.412-1.355 9.548-3.723 15.103-2.358 5.532-5.658 11.333-9.396 17.034-7.477 11.404-16.582 22.22-23.034 29.416l3.722 3.338c6.528-7.28 15.82-18.308 23.493-30.013 3.838-5.852 7.302-11.922 9.814-17.814 2.502-5.868 4.124-11.71 4.124-17.064zM64 10.5c23.472 0 42.5 19.028 42.5 42.5h5c0-26.233-21.266-47.5-47.5-47.5zM21.5 53c0-23.472 19.028-42.5 42.5-42.5v-5C37.767 5.5 16.5 26.767 16.5 53zm36.154 61.553c-6.453-7.196-15.558-18.012-23.035-29.416-3.738-5.701-7.038-11.502-9.396-17.034C22.855 62.548 21.5 57.413 21.5 53h-5c0 5.355 1.622 11.196 4.124 17.064 2.512 5.892 5.976 11.962 9.814 17.815 7.674 11.704 16.965 22.732 23.493 30.012zm12.693 0c-3.442 3.837-9.252 3.837-12.693 0l-3.723 3.338c5.429 6.053 14.71 6.053 20.138 0zM79.5 53c0 8.56-6.94 15.5-15.5 15.5v5c11.322 0 20.5-9.178 20.5-20.5zM64 37.5c8.56 0 15.5 6.94 15.5 15.5h5c0-11.322-9.178-20.5-20.5-20.5zM48.5 53c0-8.56 6.94-15.5 15.5-15.5v-5c-11.322 0-20.5 9.178-20.5 20.5zM64 68.5c-8.56 0-15.5-6.94-15.5-15.5h-5c0 11.322 9.178 20.5 20.5 20.5z"}));const ForwardRef=forwardRef(IconProductAssetTrackingMono);export default ForwardRef;
|
|
2
|
+
//# sourceMappingURL=icon-product-asset-tracking-mono.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/Icon/components/icon-product-asset-tracking-mono.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\ninterface SVGRProps {\n title?: string;\n titleId?: string;\n}\nconst IconProductAssetTrackingMono = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & SVGRProps, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} fill=\"none\" viewBox=\"0 0 128 128\" ref={ref} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fill=\"currentColor\" d=\"m72.208 116.222-1.861-1.669zm-16.416 0-1.86 1.669zM106.5 53c0 4.412-1.355 9.548-3.723 15.103-2.358 5.532-5.658 11.333-9.396 17.034-7.477 11.404-16.582 22.22-23.034 29.416l3.722 3.338c6.528-7.28 15.82-18.308 23.493-30.013 3.838-5.852 7.302-11.922 9.814-17.814 2.502-5.868 4.124-11.71 4.124-17.064zM64 10.5c23.472 0 42.5 19.028 42.5 42.5h5c0-26.233-21.266-47.5-47.5-47.5zM21.5 53c0-23.472 19.028-42.5 42.5-42.5v-5C37.767 5.5 16.5 26.767 16.5 53zm36.154 61.553c-6.453-7.196-15.558-18.012-23.035-29.416-3.738-5.701-7.038-11.502-9.396-17.034C22.855 62.548 21.5 57.413 21.5 53h-5c0 5.355 1.622 11.196 4.124 17.064 2.512 5.892 5.976 11.962 9.814 17.815 7.674 11.704 16.965 22.732 23.493 30.012zm12.693 0c-3.442 3.837-9.252 3.837-12.693 0l-3.723 3.338c5.429 6.053 14.71 6.053 20.138 0zM79.5 53c0 8.56-6.94 15.5-15.5 15.5v5c11.322 0 20.5-9.178 20.5-20.5zM64 37.5c8.56 0 15.5 6.94 15.5 15.5h5c0-11.322-9.178-20.5-20.5-20.5zM48.5 53c0-8.56 6.94-15.5 15.5-15.5v-5c-11.322 0-20.5 9.178-20.5 20.5zM64 68.5c-8.56 0-15.5-6.94-15.5-15.5h-5c0 11.322 9.178 20.5 20.5 20.5z\" /></svg>;\nconst ForwardRef = forwardRef(IconProductAssetTrackingMono);\nexport default ForwardRef;"],"names":["React","forwardRef","IconProductAssetTrackingMono","title","titleId","props","ref","svg","xmlns","width","height","fill","viewBox","aria-labelledby","id","path","d","ForwardRef"],"mappings":"AAAA,UAAYA,UAAW,OAAQ,AAE/B,QAAcC,UAAU,KAAQ,OAAQ,CAKxC,MAAMC,6BAA+B,CAAC,CACpCC,KAAK,CACLC,OAAO,CACP,GAAGC,MACiC,CAAEC,MAA4B,oBAACC,OAAIC,MAAM,6BAA6BC,MAAO,IAAKC,OAAQ,IAAKC,KAAK,OAAOC,QAAQ,cAAcN,IAAKA,IAAKO,kBAAiBT,QAAU,GAAGC,KAAK,EAAGF,MAAQ,oBAACA,SAAMW,GAAIV,SAAUD,OAAiB,KAAK,oBAACY,QAAKJ,KAAK,eAAeK,EAAE,miCACtS,MAAMC,WAAahB,WAAWC,6BAC9B,gBAAee,UAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as React from"react";import{forwardRef}from"react";const IconProductAssetTracking=({title,titleId,...props},ref)=>React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:128,height:128,fill:"none",viewBox:"0 0 128 128",ref:ref,"aria-labelledby":titleId,...props},title?React.createElement("title",{id:titleId},title):null,React.createElement("defs",null,React.createElement("linearGradient",{id:"paint0_linear_3807_424",x1:64,x2:64,y1:26.421,y2:111.391,gradientUnits:"userSpaceOnUse"},React.createElement("stop",{stopColor:"#FF5416"}),React.createElement("stop",{offset:1,stopColor:"#FF2739"}))),React.createElement("path",{fill:"url(#paint0_linear_3807_424)",fillRule:"evenodd",d:"M72.208 116.222C85.188 101.747 109 72.533 109 53c0-24.853-20.147-45-45-45S19 28.147 19 53c0 19.533 23.811 48.747 36.792 63.222 4.435 4.945 11.98 4.945 16.416 0M64 71c9.941 0 18-8.059 18-18s-8.059-18-18-18-18 8.059-18 18 8.059 18 18 18",clipRule:"evenodd"}));const ForwardRef=forwardRef(IconProductAssetTracking);export default ForwardRef;
|
|
2
|
+
//# sourceMappingURL=icon-product-asset-tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/Icon/components/icon-product-asset-tracking.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { SVGProps } from \"react\";\nimport { Ref, forwardRef } from \"react\";\ninterface SVGRProps {\n title?: string;\n titleId?: string;\n}\nconst IconProductAssetTracking = ({\n title,\n titleId,\n ...props\n}: SVGProps<SVGSVGElement> & SVGRProps, ref: Ref<SVGSVGElement>) => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} fill=\"none\" viewBox=\"0 0 128 128\" ref={ref} aria-labelledby={titleId} {...props}>{title ? <title id={titleId}>{title}</title> : null}<defs><linearGradient id=\"paint0_linear_3807_424\" x1={64} x2={64} y1={26.421} y2={111.391} gradientUnits=\"userSpaceOnUse\"><stop stopColor=\"#FF5416\" /><stop offset={1} stopColor=\"#FF2739\" /></linearGradient></defs><path fill=\"url(#paint0_linear_3807_424)\" fillRule=\"evenodd\" d=\"M72.208 116.222C85.188 101.747 109 72.533 109 53c0-24.853-20.147-45-45-45S19 28.147 19 53c0 19.533 23.811 48.747 36.792 63.222 4.435 4.945 11.98 4.945 16.416 0M64 71c9.941 0 18-8.059 18-18s-8.059-18-18-18-18 8.059-18 18 8.059 18 18 18\" clipRule=\"evenodd\" /></svg>;\nconst ForwardRef = forwardRef(IconProductAssetTracking);\nexport default ForwardRef;"],"names":["React","forwardRef","IconProductAssetTracking","title","titleId","props","ref","svg","xmlns","width","height","fill","viewBox","aria-labelledby","id","defs","linearGradient","x1","x2","y1","y2","gradientUnits","stop","stopColor","offset","path","fillRule","d","clipRule","ForwardRef"],"mappings":"AAAA,UAAYA,UAAW,OAAQ,AAE/B,QAAcC,UAAU,KAAQ,OAAQ,CAKxC,MAAMC,yBAA2B,CAAC,CAChCC,KAAK,CACLC,OAAO,CACP,GAAGC,MACiC,CAAEC,MAA4B,oBAACC,OAAIC,MAAM,6BAA6BC,MAAO,IAAKC,OAAQ,IAAKC,KAAK,OAAOC,QAAQ,cAAcN,IAAKA,IAAKO,kBAAiBT,QAAU,GAAGC,KAAK,EAAGF,MAAQ,oBAACA,SAAMW,GAAIV,SAAUD,OAAiB,KAAK,oBAACY,YAAK,oBAACC,kBAAeF,GAAG,yBAAyBG,GAAI,GAAIC,GAAI,GAAIC,GAAI,OAAQC,GAAI,QAASC,cAAc,kBAAiB,oBAACC,QAAKC,UAAU,YAAY,oBAACD,QAAKE,OAAQ,EAAGD,UAAU,cAAoC,oBAACE,QAAKd,KAAK,+BAA+Be,SAAS,UAAUC,EAAE,6OAA6OC,SAAS,aACpxB,MAAMC,WAAa5B,WAAWC,yBAC9B,gBAAe2B,UAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React,{createContext,useContext,useMemo}from"react";import useSWR from"swr";const SessionDataContext=createContext(undefined);const fetcher=async url=>{const options={headers:{accept:"application/json"},cache:"no-cache"};if(typeof false!=="undefined"&&false){options.credentials="include"}const res=await fetch(url,options);if(!res.ok){throw new Error("Failed to fetch session data")}const contentType=res.headers.get("content-type");if(!contentType?.includes("application/json")){throw new Error("Session endpoint is not serving json")}const data=await res.json();if(data.error==="not-found"){return null}return data};const SESSION_SWR_OPTIONS={revalidateOnFocus:false,revalidateOnReconnect:false,shouldRetryOnError:false,onError:err=>{console.warn("Could not fetch session data due to error:",err)}};export const SessionDataProvider=({children,sessionDataUrl})=>{const{data,error,isLoading}=useSWR(sessionDataUrl||null,fetcher,SESSION_SWR_OPTIONS);const contextValue=useMemo(()=>({sessionData:data??null,isLoading,error}),[data,isLoading,error]);return React.createElement(SessionDataContext.Provider,{value:contextValue},children)};export const useSessionData=()=>{const context=useContext(SessionDataContext);if(context===undefined){throw new Error("useSessionData must be used within SessionDataProvider")}return context};export const useSessionDataDirect=sessionDataUrl=>{const{data,error,isLoading}=useSWR(sessionDataUrl||null,fetcher,SESSION_SWR_OPTIONS);return{sessionData:data??null,isLoading,error}};
|
|
2
|
+
//# sourceMappingURL=SessionData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/SessionData.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n PropsWithChildren,\n useMemo,\n} from \"react\";\nimport useSWR from \"swr\";\n\n// Feature flag for enabling credentials in fetch requests\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare const __ENABLE_FETCH_WITH_CREDENTIALS__: boolean | undefined;\n\ntype SessionUser = {\n firstName?: string;\n lastName?: string;\n email?: string;\n};\n\ntype SessionData = {\n user?: SessionUser;\n} | null;\n\ntype SessionDataContextType = {\n sessionData: SessionData;\n isLoading: boolean;\n error: Error | undefined;\n};\n\nconst SessionDataContext = createContext<SessionDataContextType | undefined>(\n undefined,\n);\n\ntype SessionDataProviderProps = PropsWithChildren<{\n sessionDataUrl?: string;\n}>;\n\n/**\n * fetcher - Retrieves session data from a backend API endpoint.\n *\n * Makes a JSON request to fetch current user session information. Optionally includes\n * credentials (cookies) based on the __ENABLE_FETCH_WITH_CREDENTIALS__ feature flag.\n * Handles \"not-found\" responses gracefully by returning null instead of throwing.\n * Validates response is JSON to prevent parsing errors.\n */\nconst fetcher = async (url: string): Promise<SessionData> => {\n const options: RequestInit = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n // Check if credentials should be included (feature flag)\n if (\n typeof __ENABLE_FETCH_WITH_CREDENTIALS__ !== \"undefined\" &&\n __ENABLE_FETCH_WITH_CREDENTIALS__\n ) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(url, options);\n\n if (!res.ok) {\n throw new Error(\"Failed to fetch session data\");\n }\n\n const contentType = res.headers.get(\"content-type\");\n if (!contentType?.includes(\"application/json\")) {\n throw new Error(\"Session endpoint is not serving json\");\n }\n\n const data = await res.json();\n\n // Handle \"not found\" error gracefully\n if (data.error === \"not-found\") {\n return null;\n }\n\n return data;\n};\n\nconst SESSION_SWR_OPTIONS = {\n revalidateOnFocus: false,\n revalidateOnReconnect: false,\n shouldRetryOnError: false,\n onError: (err: Error) => {\n console.warn(\"Could not fetch session data due to error:\", err);\n },\n};\n\n/**\n * SessionDataProvider - Context provider for managing user session data throughout the app.\n *\n * Fetches and caches session data using SWR (stale-while-revalidate) from the provided URL.\n * Exposes session data, loading state, and errors through context. Use this at the app root\n * level and access via useSessionData() hook in child components. Disables auto-revalidation\n * to avoid excessive network requests - session data is fetched once on mount.\n */\nexport const SessionDataProvider = ({\n children,\n sessionDataUrl,\n}: SessionDataProviderProps) => {\n const { data, error, isLoading } = useSWR<SessionData>(\n sessionDataUrl || null,\n fetcher,\n SESSION_SWR_OPTIONS,\n );\n\n const contextValue = useMemo(\n () => ({\n sessionData: data ?? null,\n isLoading,\n error,\n }),\n [data, isLoading, error],\n );\n\n return (\n <SessionDataContext.Provider value={contextValue}>\n {children}\n </SessionDataContext.Provider>\n );\n};\n\n/**\n * useSessionData - Hook to access session data from SessionDataProvider context.\n *\n * Returns the current user session data, loading state, and any errors from the provider.\n * Must be used within a SessionDataProvider or will throw an error. Use this hook in\n * components that need to read or display user session information.\n */\nexport const useSessionData = () => {\n const context = useContext(SessionDataContext);\n if (context === undefined) {\n throw new Error(\"useSessionData must be used within SessionDataProvider\");\n }\n return context;\n};\n\n/**\n * useSessionDataDirect - Direct session data hook without requiring a provider (legacy).\n *\n * Fetches session data using SWR directly, bypassing the context provider pattern.\n * Provided for backward compatibility with code that doesn't use SessionDataProvider.\n * For new code, prefer using SessionDataProvider + useSessionData() for better\n * performance and centralized session management.\n */\nexport const useSessionDataDirect = (sessionDataUrl?: string) => {\n const { data, error, isLoading } = useSWR<SessionData>(\n sessionDataUrl || null,\n fetcher,\n SESSION_SWR_OPTIONS,\n );\n\n return {\n sessionData: data ?? null,\n isLoading,\n error,\n };\n};\n"],"names":["React","createContext","useContext","useMemo","useSWR","SessionDataContext","undefined","fetcher","url","options","headers","accept","cache","credentials","res","fetch","ok","Error","contentType","get","includes","data","json","error","SESSION_SWR_OPTIONS","revalidateOnFocus","revalidateOnReconnect","shouldRetryOnError","onError","err","console","warn","SessionDataProvider","children","sessionDataUrl","isLoading","contextValue","sessionData","Provider","value","useSessionData","context","useSessionDataDirect"],"mappings":"AAAA,OAAOA,OACLC,aAAa,CACbC,UAAU,CAEVC,OAAO,KACF,OAAQ,AACf,QAAOC,WAAY,KAAM,CAsBzB,MAAMC,mBAAqBJ,cACzBK,WAeF,MAAMC,QAAU,MAAOC,MACrB,MAAMC,QAAuB,CAC3BC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAGA,GACE,OAgGD,QAhG8C,aAgG9C,MA9FC,CACAH,QAAQI,WAAW,CAAG,SACxB,CAEA,MAAMC,IAAM,MAAMC,MAAMP,IAAKC,SAE7B,GAAI,CAACK,IAAIE,EAAE,CAAE,CACX,MAAM,IAAIC,MAAM,+BAClB,CAEA,MAAMC,YAAcJ,IAAIJ,OAAO,CAACS,GAAG,CAAC,gBACpC,GAAI,CAACD,aAAaE,SAAS,oBAAqB,CAC9C,MAAM,IAAIH,MAAM,uCAClB,CAEA,MAAMI,KAAO,MAAMP,IAAIQ,IAAI,GAG3B,GAAID,KAAKE,KAAK,GAAK,YAAa,CAC9B,OAAO,IACT,CAEA,OAAOF,IACT,EAEA,MAAMG,oBAAsB,CAC1BC,kBAAmB,MACnBC,sBAAuB,MACvBC,mBAAoB,MACpBC,QAAS,AAACC,MACRC,QAAQC,IAAI,CAAC,6CAA8CF,IAC7D,CACF,CAUA,QAAO,MAAMG,oBAAsB,CAAC,CAClCC,QAAQ,CACRC,cAAc,CACW,IACzB,KAAM,CAAEb,IAAI,CAAEE,KAAK,CAAEY,SAAS,CAAE,CAAG/B,OACjC8B,gBAAkB,KAClB3B,QACAiB,qBAGF,MAAMY,aAAejC,QACnB,IAAO,CAAA,CACLkC,YAAahB,MAAQ,KACrBc,UACAZ,KACF,CAAA,EACA,CAACF,KAAMc,UAAWZ,MAAM,EAG1B,OACE,oBAAClB,mBAAmBiC,QAAQ,EAACC,MAAOH,cACjCH,SAGP,CAAE,AASF,QAAO,MAAMO,eAAiB,KAC5B,MAAMC,QAAUvC,WAAWG,oBAC3B,GAAIoC,UAAYnC,UAAW,CACzB,MAAM,IAAIW,MAAM,yDAClB,CACA,OAAOwB,OACT,CAAE,AAUF,QAAO,MAAMC,qBAAuB,AAACR,iBACnC,KAAM,CAAEb,IAAI,CAAEE,KAAK,CAAEY,SAAS,CAAE,CAAG/B,OACjC8B,gBAAkB,KAClB3B,QACAiB,qBAGF,MAAO,CACLa,YAAahB,MAAQ,KACrBc,UACAZ,KACF,CACF,CAAE"}
|
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"./
|
|
1
|
+
import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export*from"./SessionData";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 \"./
|
|
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 \"./SessionData\";\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,eAAgB,AAC9B,YAAc,aAAc"}
|
package/index.d.ts
CHANGED
|
@@ -506,12 +506,6 @@ export default CodeSnippet;
|
|
|
506
506
|
//# sourceMappingURL=CodeSnippet.d.ts.map
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
declare module '@ably/ui/core/ConnectStateWrapper' {
|
|
510
|
-
const ConnectStateWrapper: (Component: any, selectors: any) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
511
|
-
export default ConnectStateWrapper;
|
|
512
|
-
//# sourceMappingURL=ConnectStateWrapper.d.ts.map
|
|
513
|
-
}
|
|
514
|
-
|
|
515
509
|
declare module '@ably/ui/core/ContentTile' {
|
|
516
510
|
import React from "react";
|
|
517
511
|
import { type BadgeProps } from "@ably/ui/core/Badge";
|
|
@@ -675,6 +669,7 @@ export default FeaturedLink;
|
|
|
675
669
|
}
|
|
676
670
|
|
|
677
671
|
declare module '@ably/ui/core/Flash' {
|
|
672
|
+
import { PropsWithChildren } from "react";
|
|
678
673
|
type FlashPropsType = "error" | "success" | "notice" | "info" | "alert";
|
|
679
674
|
type FlashProps = {
|
|
680
675
|
id: string;
|
|
@@ -683,28 +678,43 @@ type FlashProps = {
|
|
|
683
678
|
content: string;
|
|
684
679
|
removeFlash: (id: string) => void;
|
|
685
680
|
};
|
|
686
|
-
type FlashesProps = {
|
|
687
|
-
flashes: {
|
|
688
|
-
items: Pick<FlashProps, "type" | "content">[];
|
|
689
|
-
};
|
|
690
|
-
};
|
|
691
681
|
type BackendFlashesProps = {
|
|
692
682
|
flashes: string[][];
|
|
693
683
|
};
|
|
694
684
|
const FLASH_DATA_ID = "ui-flashes";
|
|
695
|
-
|
|
696
|
-
flashes:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
type: string;
|
|
700
|
-
payload: FlashProps | FlashProps[];
|
|
701
|
-
}) => {
|
|
702
|
-
items: FlashProps[];
|
|
703
|
-
};
|
|
685
|
+
type FlashContextType = {
|
|
686
|
+
flashes: FlashProps[];
|
|
687
|
+
addFlashes: (flashes: Pick<FlashProps, "type" | "content">[]) => void;
|
|
688
|
+
removeFlash: (id: string) => void;
|
|
704
689
|
};
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
690
|
+
type FlashProviderProps = PropsWithChildren;
|
|
691
|
+
/**
|
|
692
|
+
* FlashProvider - Context provider for managing flash messages throughout the application.
|
|
693
|
+
*
|
|
694
|
+
* Maintains a global list of flash messages and provides methods to add/remove them.
|
|
695
|
+
* Automatically deduplicates messages with the same type and content to prevent duplicates.
|
|
696
|
+
* Use this at the app root level and access via useFlashContext() in child components.
|
|
697
|
+
*/
|
|
698
|
+
const FlashProvider: ({ children }: FlashProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
699
|
+
const useFlashContext: () => FlashContextType;
|
|
700
|
+
/**
|
|
701
|
+
* Flashes - Container component that renders all active flash messages.
|
|
702
|
+
*
|
|
703
|
+
* Reads from FlashContext and displays each flash message in order.
|
|
704
|
+
* Use this component where you want flash messages to appear in your layout
|
|
705
|
+
* (typically near the top of the page). Filters out removed messages.
|
|
706
|
+
*/
|
|
707
|
+
const Flashes: () => import("react/jsx-runtime").JSX.Element;
|
|
708
|
+
/**
|
|
709
|
+
* BackendFlashes - Integration component for server-side flash messages (default export).
|
|
710
|
+
*
|
|
711
|
+
* Receives flash messages from backend as an array of [type, content] tuples and adds
|
|
712
|
+
* them to the FlashContext on mount. Primary use case is hydrating flash messages from
|
|
713
|
+
* Rails or other backend frameworks. Renders the Flashes component to display messages.
|
|
714
|
+
* Must be used within FlashProvider.
|
|
715
|
+
*/
|
|
716
|
+
const BackendFlashes: ({ flashes }: BackendFlashesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
717
|
+
export { FLASH_DATA_ID, Flashes, FlashProvider, useFlashContext };
|
|
708
718
|
export default BackendFlashes;
|
|
709
719
|
//# sourceMappingURL=Flash.d.ts.map
|
|
710
720
|
}
|
|
@@ -994,6 +1004,17 @@ export default ForwardRef;
|
|
|
994
1004
|
//# sourceMappingURL=icon-display-architectural-guidance.d.ts.map
|
|
995
1005
|
}
|
|
996
1006
|
|
|
1007
|
+
declare module '@ably/ui/core/Icon/components/icon-display-asset-tracking-col' {
|
|
1008
|
+
import * as React from "react";
|
|
1009
|
+
interface SVGRProps {
|
|
1010
|
+
title?: string;
|
|
1011
|
+
titleId?: string;
|
|
1012
|
+
}
|
|
1013
|
+
const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
1014
|
+
export default ForwardRef;
|
|
1015
|
+
//# sourceMappingURL=icon-display-asset-tracking-col.d.ts.map
|
|
1016
|
+
}
|
|
1017
|
+
|
|
997
1018
|
declare module '@ably/ui/core/Icon/components/icon-display-authentication' {
|
|
998
1019
|
import * as React from "react";
|
|
999
1020
|
interface SVGRProps {
|
|
@@ -2336,6 +2357,28 @@ export default ForwardRef;
|
|
|
2336
2357
|
//# sourceMappingURL=icon-gui-prod-ai-transport-solid.d.ts.map
|
|
2337
2358
|
}
|
|
2338
2359
|
|
|
2360
|
+
declare module '@ably/ui/core/Icon/components/icon-gui-prod-asset-tracking-outline' {
|
|
2361
|
+
import * as React from "react";
|
|
2362
|
+
interface SVGRProps {
|
|
2363
|
+
title?: string;
|
|
2364
|
+
titleId?: string;
|
|
2365
|
+
}
|
|
2366
|
+
const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2367
|
+
export default ForwardRef;
|
|
2368
|
+
//# sourceMappingURL=icon-gui-prod-asset-tracking-outline.d.ts.map
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
declare module '@ably/ui/core/Icon/components/icon-gui-prod-asset-tracking-solid' {
|
|
2372
|
+
import * as React from "react";
|
|
2373
|
+
interface SVGRProps {
|
|
2374
|
+
title?: string;
|
|
2375
|
+
titleId?: string;
|
|
2376
|
+
}
|
|
2377
|
+
const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2378
|
+
export default ForwardRef;
|
|
2379
|
+
//# sourceMappingURL=icon-gui-prod-asset-tracking-solid.d.ts.map
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2339
2382
|
declare module '@ably/ui/core/Icon/components/icon-gui-prod-chat-outline' {
|
|
2340
2383
|
import * as React from "react";
|
|
2341
2384
|
interface SVGRProps {
|
|
@@ -2523,6 +2566,28 @@ export default ForwardRef;
|
|
|
2523
2566
|
//# sourceMappingURL=icon-product-ai-transport.d.ts.map
|
|
2524
2567
|
}
|
|
2525
2568
|
|
|
2569
|
+
declare module '@ably/ui/core/Icon/components/icon-product-asset-tracking-mono' {
|
|
2570
|
+
import * as React from "react";
|
|
2571
|
+
interface SVGRProps {
|
|
2572
|
+
title?: string;
|
|
2573
|
+
titleId?: string;
|
|
2574
|
+
}
|
|
2575
|
+
const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2576
|
+
export default ForwardRef;
|
|
2577
|
+
//# sourceMappingURL=icon-product-asset-tracking-mono.d.ts.map
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
declare module '@ably/ui/core/Icon/components/icon-product-asset-tracking' {
|
|
2581
|
+
import * as React from "react";
|
|
2582
|
+
interface SVGRProps {
|
|
2583
|
+
title?: string;
|
|
2584
|
+
titleId?: string;
|
|
2585
|
+
}
|
|
2586
|
+
const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2587
|
+
export default ForwardRef;
|
|
2588
|
+
//# sourceMappingURL=icon-product-asset-tracking.d.ts.map
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2526
2591
|
declare module '@ably/ui/core/Icon/components/icon-product-chat-mono' {
|
|
2527
2592
|
import * as React from "react";
|
|
2528
2593
|
interface SVGRProps {
|
|
@@ -6006,6 +6071,60 @@ export default SegmentedControl;
|
|
|
6006
6071
|
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
6007
6072
|
}
|
|
6008
6073
|
|
|
6074
|
+
declare module '@ably/ui/core/SessionData' {
|
|
6075
|
+
import { PropsWithChildren } from "react";
|
|
6076
|
+
type SessionUser = {
|
|
6077
|
+
firstName?: string;
|
|
6078
|
+
lastName?: string;
|
|
6079
|
+
email?: string;
|
|
6080
|
+
};
|
|
6081
|
+
type SessionData = {
|
|
6082
|
+
user?: SessionUser;
|
|
6083
|
+
} | null;
|
|
6084
|
+
type SessionDataContextType = {
|
|
6085
|
+
sessionData: SessionData;
|
|
6086
|
+
isLoading: boolean;
|
|
6087
|
+
error: Error | undefined;
|
|
6088
|
+
};
|
|
6089
|
+
type SessionDataProviderProps = PropsWithChildren<{
|
|
6090
|
+
sessionDataUrl?: string;
|
|
6091
|
+
}>;
|
|
6092
|
+
/**
|
|
6093
|
+
* SessionDataProvider - Context provider for managing user session data throughout the app.
|
|
6094
|
+
*
|
|
6095
|
+
* Fetches and caches session data using SWR (stale-while-revalidate) from the provided URL.
|
|
6096
|
+
* Exposes session data, loading state, and errors through context. Use this at the app root
|
|
6097
|
+
* level and access via useSessionData() hook in child components. Disables auto-revalidation
|
|
6098
|
+
* to avoid excessive network requests - session data is fetched once on mount.
|
|
6099
|
+
*/
|
|
6100
|
+
export const SessionDataProvider: ({ children, sessionDataUrl, }: SessionDataProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6101
|
+
/**
|
|
6102
|
+
* useSessionData - Hook to access session data from SessionDataProvider context.
|
|
6103
|
+
*
|
|
6104
|
+
* Returns the current user session data, loading state, and any errors from the provider.
|
|
6105
|
+
* Must be used within a SessionDataProvider or will throw an error. Use this hook in
|
|
6106
|
+
* components that need to read or display user session information.
|
|
6107
|
+
*/
|
|
6108
|
+
export const useSessionData: () => SessionDataContextType;
|
|
6109
|
+
/**
|
|
6110
|
+
* useSessionDataDirect - Direct session data hook without requiring a provider (legacy).
|
|
6111
|
+
*
|
|
6112
|
+
* Fetches session data using SWR directly, bypassing the context provider pattern.
|
|
6113
|
+
* Provided for backward compatibility with code that doesn't use SessionDataProvider.
|
|
6114
|
+
* For new code, prefer using SessionDataProvider + useSessionData() for better
|
|
6115
|
+
* performance and centralized session management.
|
|
6116
|
+
*/
|
|
6117
|
+
export const useSessionDataDirect: (sessionDataUrl?: string) => {
|
|
6118
|
+
sessionData: {
|
|
6119
|
+
user?: SessionUser;
|
|
6120
|
+
} | null;
|
|
6121
|
+
isLoading: boolean;
|
|
6122
|
+
error: any;
|
|
6123
|
+
};
|
|
6124
|
+
export {};
|
|
6125
|
+
//# sourceMappingURL=SessionData.d.ts.map
|
|
6126
|
+
}
|
|
6127
|
+
|
|
6009
6128
|
declare module '@ably/ui/core/Slider/component' {
|
|
6010
6129
|
export default Slider;
|
|
6011
6130
|
function Slider({ container, mqEnableThreshold }: {
|
|
@@ -6429,50 +6548,14 @@ export default function reactRenderer(components: Record<string, React.FC>): voi
|
|
|
6429
6548
|
//# sourceMappingURL=react-renderer.d.ts.map
|
|
6430
6549
|
}
|
|
6431
6550
|
|
|
6432
|
-
declare module '@ably/ui/core/remote-blogs-posts' {
|
|
6433
|
-
export function fetchBlogPosts(store: any, blogUrl: any): Promise<void>;
|
|
6434
|
-
export namespace reducerBlogPosts {
|
|
6435
|
-
function blogPosts(state: {
|
|
6436
|
-
recent: null;
|
|
6437
|
-
} | undefined, action: any): {
|
|
6438
|
-
recent: any;
|
|
6439
|
-
};
|
|
6440
|
-
}
|
|
6441
|
-
export function selectRecentBlogPosts(store: any): any;
|
|
6442
|
-
//# sourceMappingURL=remote-blogs-posts.d.ts.map
|
|
6443
|
-
}
|
|
6444
|
-
|
|
6445
|
-
declare module '@ably/ui/core/remote-data-store' {
|
|
6446
|
-
export function attachStoreToWindow(store: any): void;
|
|
6447
|
-
export function getRemoteDataStore(): any;
|
|
6448
|
-
export function connectState(selector: any, setState: any): void;
|
|
6449
|
-
export function createRemoteDataStore(reducers: any): any;
|
|
6450
|
-
//# sourceMappingURL=remote-data-store.d.ts.map
|
|
6451
|
-
}
|
|
6452
|
-
|
|
6453
6551
|
declare module '@ably/ui/core/remote-data-util' {
|
|
6454
6552
|
export function isJsonResponse(contentType: any): any;
|
|
6455
6553
|
//# sourceMappingURL=remote-data-util.d.ts.map
|
|
6456
6554
|
}
|
|
6457
6555
|
|
|
6458
|
-
declare module '@ably/ui/core/remote-session-data' {
|
|
6459
|
-
export function fetchSessionData(store: any, sessionUrl: any): Promise<void>;
|
|
6460
|
-
export namespace reducerSessionData {
|
|
6461
|
-
function session(state: {
|
|
6462
|
-
data: null;
|
|
6463
|
-
} | undefined, action: any): {
|
|
6464
|
-
data: any;
|
|
6465
|
-
};
|
|
6466
|
-
}
|
|
6467
|
-
export function selectSessionData(store: any): any;
|
|
6468
|
-
//# sourceMappingURL=remote-session-data.d.ts.map
|
|
6469
|
-
}
|
|
6470
|
-
|
|
6471
6556
|
declare module '@ably/ui/core/scripts' {
|
|
6472
6557
|
export { default as loadSprites } from "@ably/ui/core/load-sprites";
|
|
6473
|
-
export * from "@ably/ui/core/
|
|
6474
|
-
export * from "@ably/ui/core/remote-blogs-posts";
|
|
6475
|
-
export * from "@ably/ui/core/remote-session-data";
|
|
6558
|
+
export * from "@ably/ui/core/SessionData";
|
|
6476
6559
|
export * from "@ably/ui/core/dom-query";
|
|
6477
6560
|
export { default as reactRenderer, renderComponent } from "@ably/ui/core/react-renderer";
|
|
6478
6561
|
//# sourceMappingURL=scripts.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0-dev.dbc599e55b",
|
|
4
4
|
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@types/react": "^18.3.1",
|
|
38
38
|
"@types/react-dom": "^18.3.0",
|
|
39
39
|
"@types/svg-sprite": "^0.0.39",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
41
|
-
"@typescript-eslint/parser": "^8.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
41
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
42
42
|
"@vitejs/plugin-react-swc": "^4.0.1",
|
|
43
43
|
"@vitest/browser": "3.2.4",
|
|
44
44
|
"@vitest/coverage-v8": "3.2.4",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
52
52
|
"eslint-plugin-storybook": "^10.2.0",
|
|
53
53
|
"heroicons": "^2.2.0",
|
|
54
|
+
"http-server": "14.1.1",
|
|
54
55
|
"jsdom": "^28.0.0",
|
|
55
56
|
"mixpanel-browser": "^2.74.0",
|
|
56
57
|
"msw": "2.12.0",
|
|
@@ -87,10 +88,9 @@
|
|
|
87
88
|
"js-cookie": "^3.0.5",
|
|
88
89
|
"react": "^18.2.0",
|
|
89
90
|
"react-dom": "^18.3.1",
|
|
90
|
-
"redux": "^4.0.5",
|
|
91
91
|
"scroll-lock": "^2.1.4",
|
|
92
92
|
"swr": "^2.2.5",
|
|
93
|
-
"tailwind-merge": "^
|
|
93
|
+
"tailwind-merge": "^3.4.1"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"mixpanel-browser": "^2.60.0 || <3",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import React,{useEffect,useState}from"react";import{connectState,getRemoteDataStore}from"./remote-data-store";const ConnectStateWrapper=(Component,selectors)=>{const[state,setState]=useState({});const setStateForKey=key=>storeState=>setState(()=>({[key]:storeState}));useEffect(()=>{const store=getRemoteDataStore();const resolvedState=Object.keys(selectors).reduce((acc,key)=>({...acc,[key]:selectors[key](store)}),{});setState(resolvedState);Object.keys(selectors).forEach(key=>{connectState(selectors[key],setStateForKey(key))})},[]);const WrappedComponent=props=>React.createElement(Component,{...props,...state});return WrappedComponent};export default ConnectStateWrapper;
|
|
2
|
-
//# sourceMappingURL=ConnectStateWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/ConnectStateWrapper.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nimport { connectState, getRemoteDataStore } from \"./remote-data-store\";\n\n/*\n Connect a react component to a global store.\n This is similar to what react-redux does but uses our global store so\n can share state with other React mount points or anything that uses the\n store.\n - selectors is an object where keys are your prop names and values are your select\n functions that work on the store to retrieve the state you are interested in\n - initial state is set in useEffect so the wrapped component needs to handle it's props set to undefined initially\n*/\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst ConnectStateWrapper = (Component: any, selectors: any) => {\n const [state, setState] = useState({});\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setStateForKey = (key: string) => (storeState: any) =>\n setState(() => ({ [key]: storeState }));\n\n useEffect(() => {\n const store = getRemoteDataStore();\n const resolvedState = Object.keys(selectors).reduce(\n (acc, key) => ({ ...acc, [key]: selectors[key](store) }),\n {},\n );\n\n // Set initial state\n setState(resolvedState);\n\n // Create a store subscription for each selector. Depending on your use case, this can be inefficient.\n // When optimising for renders, look for wins with selectors better for your use and using connectState directly.\n Object.keys(selectors).forEach((key) => {\n connectState(selectors[key], setStateForKey(key));\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const WrappedComponent = (props: any) => <Component {...props} {...state} />;\n\n return WrappedComponent;\n};\n\nexport default ConnectStateWrapper;\n"],"names":["React","useEffect","useState","connectState","getRemoteDataStore","ConnectStateWrapper","Component","selectors","state","setState","setStateForKey","key","storeState","store","resolvedState","Object","keys","reduce","acc","forEach","WrappedComponent","props"],"mappings":"AAAA,OAAOA,OAASC,SAAS,CAAEC,QAAQ,KAAQ,OAAQ,AAEnD,QAASC,YAAY,CAAEC,kBAAkB,KAAQ,qBAAsB,CAavE,MAAMC,oBAAsB,CAACC,UAAgBC,aAC3C,KAAM,CAACC,MAAOC,SAAS,CAAGP,SAAS,CAAC,GAGpC,MAAMQ,eAAiB,AAACC,KAAgB,AAACC,YACvCH,SAAS,IAAO,CAAA,CAAE,CAACE,IAAI,CAAEC,UAAW,CAAA,GAEtCX,UAAU,KACR,MAAMY,MAAQT,qBACd,MAAMU,cAAgBC,OAAOC,IAAI,CAACT,WAAWU,MAAM,CACjD,CAACC,IAAKP,MAAS,CAAA,CAAE,GAAGO,GAAG,CAAE,CAACP,IAAI,CAAEJ,SAAS,CAACI,IAAI,CAACE,MAAO,CAAA,EACtD,CAAC,GAIHJ,SAASK,eAITC,OAAOC,IAAI,CAACT,WAAWY,OAAO,CAAC,AAACR,MAC9BR,aAAaI,SAAS,CAACI,IAAI,CAAED,eAAeC,KAC9C,EAEF,EAAG,EAAE,EAGL,MAAMS,iBAAmB,AAACC,OAAe,oBAACf,WAAW,GAAGe,KAAK,CAAG,GAAGb,KAAK,GAExE,OAAOY,gBACT,CAEA,gBAAef,mBAAoB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{isJsonResponse}from"./remote-data-util";const fetchBlogPosts=async(store,blogUrl)=>{try{if(!blogUrl){console.log(`Skipping fetching blog posts, invalid blogUrl: "${blogUrl}"`);return}const options={headers:{accept:"application/json"},cache:"no-cache"};if(false){options.credentials="include"}const res=await fetch(blogUrl,options);if(isJsonResponse(res.headers.get("content-type"))){const payload=await res.json();store.dispatch({type:"blog/loaded",payload})}else{throw new Error("Blog posts url is not serving json")}}catch(e){console.warn("Could not fetch blog posts due to error:",e)}};const initialState={recent:null};const REDUCER_KEY="blogPosts";const reducerBlogPosts={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"blog/loaded":return{...state,recent:action.payload};default:return state}}};const selectRecentBlogPosts=store=>store.getState()[REDUCER_KEY]?.recent;export{fetchBlogPosts,reducerBlogPosts,selectRecentBlogPosts};
|
|
2
|
-
//# sourceMappingURL=remote-blogs-posts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,SAAuC,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,2 +0,0 @@
|
|
|
1
|
-
import{createStore,combineReducers}from"redux";export const attachStoreToWindow=store=>{window.AblyUi=window.AblyUi||{};window.AblyUi.RemoteDataStore=store};export const getRemoteDataStore=()=>{if(!window.AblyUi.RemoteDataStore){throw new Error("Remote store was called before one was created")}return window.AblyUi.RemoteDataStore};export const connectState=(selector,setState)=>{const store=getRemoteDataStore();let cachedOldState=selector(store);store.subscribe(()=>{const newState=selector(store);if(newState===cachedOldState){return}cachedOldState=newState;setState(newState)})};export const createRemoteDataStore=reducers=>createStore(combineReducers(reducers));
|
|
2
|
-
//# sourceMappingURL=remote-data-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/remote-data-store.js"],"sourcesContent":["import { createStore, combineReducers } from \"redux\";\n\nexport const attachStoreToWindow = (store) => {\n window.AblyUi = window.AblyUi || {};\n window.AblyUi.RemoteDataStore = store;\n};\n\nexport const getRemoteDataStore = () => {\n if (!window.AblyUi.RemoteDataStore) {\n throw new Error(\"Remote store was called before one was created\");\n }\n\n return window.AblyUi.RemoteDataStore;\n};\n\nexport const connectState = (selector, setState) => {\n const store = getRemoteDataStore();\n let cachedOldState = selector(store);\n\n store.subscribe(() => {\n const newState = selector(store);\n\n // Do nothing, state is the same\n if (newState === cachedOldState) {\n return;\n }\n\n cachedOldState = newState;\n setState(newState);\n });\n};\n\nexport const createRemoteDataStore = (reducers) =>\n createStore(combineReducers(reducers));\n"],"names":["createStore","combineReducers","attachStoreToWindow","store","window","AblyUi","RemoteDataStore","getRemoteDataStore","Error","connectState","selector","setState","cachedOldState","subscribe","newState","createRemoteDataStore","reducers"],"mappings":"AAAA,OAASA,WAAW,CAAEC,eAAe,KAAQ,OAAQ,AAErD,QAAO,MAAMC,oBAAsB,AAACC,QAClCC,OAAOC,MAAM,CAAGD,OAAOC,MAAM,EAAI,CAAC,CAClCD,CAAAA,OAAOC,MAAM,CAACC,eAAe,CAAGH,KAClC,CAAE,AAEF,QAAO,MAAMI,mBAAqB,KAChC,GAAI,CAACH,OAAOC,MAAM,CAACC,eAAe,CAAE,CAClC,MAAM,IAAIE,MAAM,iDAClB,CAEA,OAAOJ,OAAOC,MAAM,CAACC,eAAe,AACtC,CAAE,AAEF,QAAO,MAAMG,aAAe,CAACC,SAAUC,YACrC,MAAMR,MAAQI,qBACd,IAAIK,eAAiBF,SAASP,OAE9BA,MAAMU,SAAS,CAAC,KACd,MAAMC,SAAWJ,SAASP,OAG1B,GAAIW,WAAaF,eAAgB,CAC/B,MACF,CAEAA,eAAiBE,SACjBH,SAASG,SACX,EACF,CAAE,AAEF,QAAO,MAAMC,sBAAwB,AAACC,UACpChB,YAAYC,gBAAgBe,UAAW"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{isJsonResponse}from"./remote-data-util";const NOT_FOUND_ERROR_CODE="not-found";const fetchSessionData=async(store,sessionUrl)=>{const sessionLoaded=(payload={})=>store.dispatch({type:"session/loaded",payload});try{if(!sessionUrl){console.log(`Skipping fetching session, invalid sessionUrl: "${sessionUrl}"`);sessionLoaded();return}const options={headers:{accept:"application/json"},cache:"no-cache"};if(false){options.credentials="include"}const res=await fetch(sessionUrl,options);const jsonResponse=isJsonResponse(res.headers.get("content-type"));if(!jsonResponse){throw new Error("Session endpoint is not serving json")}const payload=await res.json();if(payload.error===NOT_FOUND_ERROR_CODE){sessionLoaded()}else{sessionLoaded(payload)}}catch(e){sessionLoaded();console.warn("Could not fetch session data due to error:",e)}};const initialState={data:null};const REDUCER_KEY="session";const reducerSessionData={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"session/loaded":return{...state,data:action.payload};default:return state}}};const selectSessionData=store=>store.getState()[REDUCER_KEY]?.data;export{fetchSessionData,reducerSessionData,selectSessionData};
|
|
2
|
-
//# sourceMappingURL=remote-session-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAA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