dinocollab-core 2.0.5 → 2.0.7
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/dist/mfe-shared/auth.debug.js +2 -0
- package/dist/mfe-shared/auth.debug.js.map +1 -0
- package/dist/mfe-shared/cart.debug.js +2 -0
- package/dist/mfe-shared/cart.debug.js.map +1 -0
- package/dist/mfe-shared/cart.js +1 -1
- package/dist/mfe-shared/cart.js.map +1 -1
- package/dist/mfe-shared/cart.types.js +2 -0
- package/dist/mfe-shared/cart.types.js.map +1 -0
- package/dist/mfe-shared/index.js +1 -1
- package/dist/mfe-shared/navigation.debug.js +2 -0
- package/dist/mfe-shared/navigation.debug.js.map +1 -0
- package/dist/types/mfe-shared/auth.debug.d.ts +8 -0
- package/dist/types/mfe-shared/cart.d.ts +10 -33
- package/dist/types/mfe-shared/cart.types.d.ts +31 -0
- package/dist/types/mfe-shared/index.d.ts +5 -2
- package/dist/types/mfe-shared/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{slicedToArray as t,objectSpread2 as e,toConsumableArray as r,defineProperty as o}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,jsx as n}from"react/jsx-runtime";import{useState as a,useEffect as l}from"react";import{AUTH_CHANNELS as c}from"./auth.types.js";var d=function(d){var s=a({}),p=t(s,2),f=p[0],m=p[1],u=d.channelPrefix||"mfe:auth:";l((function(){var t=Object.values(c),i=function(i){var n=i,a=n.type;if(t.includes(a)){var l=Date.now(),c=n.detail;m((function(t){var i=t[a]||{channel:a,history:[]},n=[{channel:a,payload:c,timestamp:l}].concat(r(i.history.slice(0,9)));return e(e({},t),{},o({},a,e(e({},i),{},{history:n})))}))}};return t.forEach((function(t){window.addEventListener(t,i)})),function(){t.forEach((function(t){window.removeEventListener(t,i)}))}}),[u]);var h=e({position:"fixed",top:"10px",right:"10px",background:"rgba(0, 0, 0, 0.9)",color:"#fff",padding:"12px",borderRadius:"8px",fontSize:"12px",fontFamily:"monospace",zIndex:9999,maxWidth:"400px",maxHeight:"500px",overflow:"auto",border:"2px solid #4CAF50"},d.style);return i("div",{style:h,children:[n("h4",{style:{margin:"0 0 10px 0",color:"#4CAF50"},children:d.title||"MFE Auth Debug Panel"}),0===Object.keys(f).length?n("div",{style:{color:"#888"},children:"No auth events yet..."}):Object.entries(f).map((function(e){var r=t(e,2),o=r[0],a=r[1];return i("div",{style:{marginBottom:"15px"},children:[n("div",{style:{fontWeight:"bold",color:"#FFD700",marginBottom:"5px"},children:o.replace(u,"")}),a.history.map((function(t,e){return i("div",{style:{marginBottom:"5px",paddingLeft:"10px",borderLeft:"2px solid #555",fontSize:"11px"},children:[n("div",{style:{color:"#888"},children:new Date(t.timestamp).toLocaleTimeString()}),n("div",{style:{color:"#fff"},children:JSON.stringify(t.payload,null,2)})]},"".concat(t.timestamp,"-").concat(e))}))]},o)}))]})};export{d as MfeAuthDebugPanel};
|
|
2
|
+
//# sourceMappingURL=auth.debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.debug.js","sources":["../../src/mfe-shared/auth.debug.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { AUTH_CHANNELS } from './auth.types'\r\n\r\ninterface IEventHistoryEntry {\r\n channel: string\r\n payload: any\r\n timestamp: number\r\n}\r\n\r\ninterface IEventDebugData {\r\n channel: string\r\n history: IEventHistoryEntry[]\r\n}\r\n\r\ninterface IDebugPanelProps {\r\n title?: string\r\n style?: React.CSSProperties\r\n channelPrefix?: string\r\n}\r\n\r\nexport const MfeAuthDebugPanel: React.FC<IDebugPanelProps> = (props) => {\r\n const [events, setEvents] = useState<Record<string, IEventDebugData>>({})\r\n const channelPrefix = props.channelPrefix || 'mfe:auth:'\r\n\r\n useEffect(() => {\r\n const authChannels = Object.values(AUTH_CHANNELS)\r\n\r\n const handleEvent = (e: Event) => {\r\n const customEvent = e as CustomEvent\r\n const channel = customEvent.type\r\n\r\n if (!authChannels.includes(channel)) return\r\n\r\n const timestamp = Date.now()\r\n const payload = customEvent.detail\r\n\r\n setEvents((prev) => {\r\n const existing = prev[channel] || { channel, history: [] }\r\n const newHistory = [\r\n { channel, payload, timestamp },\r\n ...existing.history.slice(0, 9) // Keep last 10 events\r\n ]\r\n\r\n return {\r\n ...prev,\r\n [channel]: {\r\n ...existing,\r\n history: newHistory\r\n }\r\n }\r\n })\r\n }\r\n\r\n // Listen to all auth channels\r\n authChannels.forEach((channel) => {\r\n window.addEventListener(channel, handleEvent)\r\n })\r\n\r\n return () => {\r\n authChannels.forEach((channel) => {\r\n window.removeEventListener(channel, handleEvent)\r\n })\r\n }\r\n }, [channelPrefix])\r\n\r\n const panelStyle: React.CSSProperties = {\r\n position: 'fixed',\r\n top: '10px',\r\n right: '10px',\r\n background: 'rgba(0, 0, 0, 0.9)',\r\n color: '#fff',\r\n padding: '12px',\r\n borderRadius: '8px',\r\n fontSize: '12px',\r\n fontFamily: 'monospace',\r\n zIndex: 9999,\r\n maxWidth: '400px',\r\n maxHeight: '500px',\r\n overflow: 'auto',\r\n border: '2px solid #4CAF50',\r\n ...props.style\r\n }\r\n\r\n return (\r\n <div style={panelStyle}>\r\n <h4 style={{ margin: '0 0 10px 0', color: '#4CAF50' }}>\r\n {props.title || 'MFE Auth Debug Panel'}\r\n </h4>\r\n \r\n {Object.keys(events).length === 0 ? (\r\n <div style={{ color: '#888' }}>No auth events yet...</div>\r\n ) : (\r\n Object.entries(events).map(([channel, data]) => (\r\n <div key={channel} style={{ marginBottom: '15px' }}>\r\n <div style={{ fontWeight: 'bold', color: '#FFD700', marginBottom: '5px' }}>\r\n {channel.replace(channelPrefix, '')}\r\n </div>\r\n \r\n {data.history.map((event, index) => (\r\n <div\r\n key={`${event.timestamp}-${index}`}\r\n style={{\r\n marginBottom: '5px',\r\n paddingLeft: '10px',\r\n borderLeft: '2px solid #555',\r\n fontSize: '11px'\r\n }}\r\n >\r\n <div style={{ color: '#888' }}>\r\n {new Date(event.timestamp).toLocaleTimeString()}\r\n </div>\r\n <div style={{ color: '#fff' }}>\r\n {JSON.stringify(event.payload, null, 2)}\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n ))\r\n )}\r\n </div>\r\n )\r\n}\r\n"],"names":["MfeAuthDebugPanel","props","_useState","useState","_useState2","_slicedToArray","events","setEvents","channelPrefix","useEffect","authChannels","Object","values","AUTH_CHANNELS","handleEvent","e","customEvent","channel","type","includes","timestamp","Date","now","payload","detail","prev","existing","history","newHistory","concat","_toConsumableArray","slice","_objectSpread","_defineProperty","forEach","window","addEventListener","removeEventListener","panelStyle","position","top","right","background","color","padding","borderRadius","fontSize","fontFamily","zIndex","maxWidth","maxHeight","overflow","border","style","_jsxs","children","_jsx","margin","title","keys","length","entries","map","_ref","_ref2","data","marginBottom","fontWeight","replace","event","index","paddingLeft","borderLeft","toLocaleTimeString","JSON","stringify"],"mappings":"6RAoBaA,EAAgD,SAACC,GAC5D,IAAAC,EAA4BC,EAA0C,IAAGC,EAAAC,EAAAH,EAAA,GAAlEI,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAClBI,EAAgBP,EAAMO,eAAiB,YAE7CC,GAAU,WACR,IAAMC,EAAeC,OAAOC,OAAOC,GAE7BC,EAAc,SAACC,GACnB,IAAMC,EAAcD,EACdE,EAAUD,EAAYE,KAE5B,GAAKR,EAAaS,SAASF,GAA3B,CAEA,IAAMG,EAAYC,KAAKC,MACjBC,EAAUP,EAAYQ,OAE5BjB,GAAU,SAACkB,GACT,IAAMC,EAAWD,EAAKR,IAAY,CAAEA,QAAAA,EAASU,QAAS,IAChDC,EACJ,CAAA,CAAEX,QAAAA,EAASM,QAAAA,EAASH,UAAAA,IAAWS,OAAAC,EAC5BJ,EAASC,QAAQI,MAAM,EAAG,KAG/B,OAAAC,EAAAA,EAAA,CAAA,EACKP,GAAIQ,CAAAA,EAAAA,EACNhB,CAAAA,EAAAA,EAAOe,EAAAA,KACHN,GAAQ,C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BAE7BjB,EAAA,MAAA,CAAKH,MAAO,CAAEV,MAAO,QAClBY,SAAAmB,KAAKC,UAAUN,EAAM9C,QAAS,KAAM,OAZlC,GAAAM,OAAGwC,EAAMjD,UAAS,KAAAS,OAAIyC,GAcvB,MArBArD,EAuBJ,MAKhB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{slicedToArray as e,objectSpread2 as t,defineProperty as r,toConsumableArray as n}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,jsx as a}from"react/jsx-runtime";import{useState as o,useEffect as l}from"react";var d=function(d){var c,s,u=o({}),f=e(u,2),m=f[0],p=f[1],v=d.channelPrefix||"mfe:cart:";return l((function(){var e=["mfe:cart:add","mfe:cart:remove","mfe:cart:clear","mfe:cart:init_request","mfe:cart:init_response","mfe:cart:update"],i=function(e){var i=e,a=i.type;i.detail&&a.startsWith(v)&&p((function(e){var o,l,d=(null===(o=e[a])||void 0===o?void 0:o.history)||[];return t(t({},e),{},r({},a,{channel:a,history:[].concat(n(d),[{channel:a,payload:(null===(l=i.detail)||void 0===l?void 0:l.payload)||i.detail,timestamp:Date.now()}]).slice(-20)}))}))};return e.forEach((function(e){window.addEventListener(e,i)})),function(){e.forEach((function(e){window.removeEventListener(e,i)}))}}),[v]),i("div",{style:t({position:"fixed",width:400,maxHeight:400,overflow:"auto",background:"#222",color:"#fff",zIndex:9999,fontSize:12,padding:8,borderRadius:8},null!==(c=d.style)&&void 0!==c?c:{bottom:0,right:0}),children:[a("strong",{children:null!==(s=d.title)&&void 0!==s?s:"MFE Event Bridge Debug Panel"}),0===Object.values(m).length&&a("div",{children:"No event activity yet."}),Object.values(m).map((function(e){return i("div",{style:{marginTop:8,borderTop:"1px solid #444",paddingTop:4},children:[i("div",{children:[a("b",{children:"Channel:"})," ",e.channel]}),a("div",{style:{maxHeight:120,overflow:"auto",background:"#333",padding:4,borderRadius:4},children:e.history.map((function(e,t){return i("div",{style:{marginBottom:2},children:[i("span",{style:{color:"#aaa"},children:[new Date(e.timestamp).toLocaleTimeString(),":"]}),a("pre",{style:{display:"inline",margin:0,color:"#0f0"},children:JSON.stringify(e.payload,null,2)})]},t)}))})]},e.channel)}))]})};export{d as MfeCartDebugPanel,d as default};
|
|
2
|
+
//# sourceMappingURL=cart.debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.debug.js","sources":["../../src/mfe-shared/cart.debug.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\r\n\r\ninterface IEventHistoryEntry {\r\n channel: string\r\n payload: any\r\n timestamp: number\r\n}\r\n\r\ninterface IEventDebugData {\r\n channel: string\r\n history: IEventHistoryEntry[]\r\n}\r\n\r\ninterface IDebugPanelProps {\r\n title?: string\r\n style?: React.CSSProperties\r\n channelPrefix?: string\r\n}\r\n\r\nexport const MfeCartDebugPanel: React.FC<IDebugPanelProps> = (props) => {\r\n const [events, setEvents] = useState<Record<string, IEventDebugData>>({})\r\n const channelPrefix = props.channelPrefix || 'mfe:cart:'\r\n\r\n useEffect(() => {\r\n const cartChannels = ['mfe:cart:add', 'mfe:cart:remove', 'mfe:cart:clear', 'mfe:cart:init_request', 'mfe:cart:init_response', 'mfe:cart:update']\r\n\r\n const handleEvent = (e: Event) => {\r\n const customEvent = e as CustomEvent\r\n const channel = customEvent.type\r\n\r\n if (customEvent.detail && channel.startsWith(channelPrefix)) {\r\n setEvents((prev) => {\r\n const prevHistory = prev[channel]?.history || []\r\n return {\r\n ...prev,\r\n [channel]: {\r\n channel,\r\n history: [\r\n ...prevHistory,\r\n {\r\n channel,\r\n payload: customEvent.detail?.payload || customEvent.detail,\r\n timestamp: Date.now()\r\n }\r\n ].slice(-20) // keep last 20\r\n }\r\n }\r\n })\r\n }\r\n }\r\n\r\n // Listen to cart events\r\n cartChannels.forEach((channel) => {\r\n window.addEventListener(channel, handleEvent)\r\n })\r\n\r\n // Clean up\r\n return () => {\r\n cartChannels.forEach((channel) => {\r\n window.removeEventListener(channel, handleEvent)\r\n })\r\n }\r\n }, [channelPrefix])\r\n\r\n return (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n width: 400,\r\n maxHeight: 400,\r\n overflow: 'auto',\r\n background: '#222',\r\n color: '#fff',\r\n zIndex: 9999,\r\n fontSize: 12,\r\n padding: 8,\r\n borderRadius: 8,\r\n ...(props.style ?? { bottom: 0, right: 0 })\r\n }}\r\n >\r\n <strong>{props.title ?? 'MFE Event Bridge Debug Panel'}</strong>\r\n {Object.values(events).length === 0 && <div>No event activity yet.</div>}\r\n {Object.values(events).map((eventData) => (\r\n <div key={eventData.channel} style={{ marginTop: 8, borderTop: '1px solid #444', paddingTop: 4 }}>\r\n <div>\r\n <b>Channel:</b> {eventData.channel}\r\n </div>\r\n <div style={{ maxHeight: 120, overflow: 'auto', background: '#333', padding: 4, borderRadius: 4 }}>\r\n {eventData.history.map((entry, idx) => (\r\n <div key={idx} style={{ marginBottom: 2 }}>\r\n <span style={{ color: '#aaa' }}>{new Date(entry.timestamp).toLocaleTimeString()}:</span>\r\n <pre style={{ display: 'inline', margin: 0, color: '#0f0' }}>{JSON.stringify(entry.payload, null, 2)}</pre>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n )\r\n}\r\n\r\nexport default MfeCartDebugPanel\r\n"],"names":["MfeCartDebugPanel","props","_props$style","_props$title","_useState","useState","_useState2","_slicedToArray","events","setEvents","channelPrefix","useEffect","cartChannels","handleEvent","e","customEvent","channel","type","detail","startsWith","prev","_prev$channel","_customEvent$detail","prevHistory","history","_objectSpread","_defineProperty","concat","_toConsumableArray","payload","timestamp","Date","now","slice","forEach","window","addEventListener","removeEventListener","_jsxs","style","position","width","maxHeight","overflow","background","color","zIndex","fontSize","padding","borderRadius","bottom","right","children","_jsx","title","Object","values","length","map","eventData","marginTop","borderTop","paddingTop","entry","idx","marginBottom","toLocaleTimeString","display","margin","JSON","stringify"],"mappings":"6OAmBaA,EAAgD,SAACC,GAAS,IAAAC,EAAAC,E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J,EAAA,MAAA,CAAAD,SAAA,2BACtCG,OAAOC,OAAOhD,GAAQkD,KAAI,SAACC,GAAS,OACnCrB,SAA6BC,MAAO,CAAEqB,UAAW,EAAGC,UAAW,iBAAkBC,WAAY,GAAGV,SAAA,CAC9Fd,EACE,MAAA,CAAAc,SAAA,CAAAC,EAAA,IAAA,CAAAD,SAAA,iBAAiBO,EAAU3C,WAE7BqC,SAAKd,MAAO,CAAEG,UAAW,IAAKC,SAAU,OAAQC,WAAY,OAAQI,QAAS,EAAGC,aAAc,GAC3FG,SAAAO,EAAUnC,QAAQkC,KAAI,SAACK,EAAOC,GAAG,OAChC1B,SAAeC,MAAO,CAAE0B,aAAc,GAAGb,SAAA,CACvCd,EAAM,OAAA,CAAAC,MAAO,CAAEM,MAAO,kBAAW,IAAId,KAAKgC,EAAMjC,WAAWoC,qBAAoB,OAC/Eb,EAAK,MAAA,CAAAd,MAAO,CAAE4B,QAAS,SAAUC,OAAQ,EAAGvB,MAAO,QAAWO,SAAAiB,KAAKC,UAAUP,EAAMlC,QAAS,KAAM,OAF1FmC,EAIX,QAVKL,EAAU3C,QAYd,MAId"}
|
package/dist/mfe-shared/cart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as r,toConsumableArray as t}from"../_virtual/_rollupPluginBabelHelpers.js";import{useState as
|
|
1
|
+
import{slicedToArray as r,toConsumableArray as t}from"../_virtual/_rollupPluginBabelHelpers.js";import{useMemo as n,useState as i,useRef as e,useEffect as o,useCallback as u}from"react";import{mfeBridge as a}from"./mfe-bridge.js";import{isBrowser as f}from"./environment.js";import{CART_CHANNELS as c}from"./cart.types.js";function s(u){var s=n((function(){return(null==u?void 0:u.storageKey)||"mfe_cart_items"}),[null==u?void 0:u.storageKey]),l=n((function(){return(null==u?void 0:u.idGetter)||function(r){return r.ProductId}}),[null==u?void 0:u.idGetter]),g=i([]),S=r(g,2),m=S[0],y=S[1],N=e(!1);return o((function(){if(f()){var r=localStorage.getItem(s);if(r)try{var n=JSON.parse(r);Array.isArray(n)&&(y(n),N.current=!0)}catch(r){console.error("Failed to parse cart from localStorage:",r)}var i=a.subscribe(c.ADD,(function(r){y((function(n){var i,e=l(r),o=n.findIndex((function(r){return l(r)===e}));if(o>=0?(i=t(n))[o]=r:i=[].concat(t(n),[r]),JSON.stringify(i)!==JSON.stringify(n)){if(f()){var u=localStorage.getItem(s);JSON.stringify(i)!==u&&localStorage.setItem(s,JSON.stringify(i))}return i}return n}))})),e=a.subscribe(c.REMOVE,(function(r){y((function(t){var n=t.filter((function(t){return l(t)!==r.id}));if(JSON.stringify(n)!==JSON.stringify(t)){if(f()){var i=localStorage.getItem(s);JSON.stringify(n)!==i&&localStorage.setItem(s,JSON.stringify(n))}return n}return t}))})),o=a.subscribe(c.CLEAR,(function(){y([]),f()&&localStorage.removeItem(s)})),u=a.subscribe(c.UPDATE,(function(r){y((function(t){if(JSON.stringify(r)!==JSON.stringify(t)){if(f()){var n=localStorage.getItem(s);JSON.stringify(r)!==n&&localStorage.setItem(s,JSON.stringify(r))}return r}return t}))})),g=a.subscribe(c.INIT_REQUEST,(function(){y((function(r){return r.length>0&&a.publish(c.INIT_RESPONSE,r),r}))})),S=a.subscribe(c.INIT_RESPONSE,(function(r){!N.current&&r&&r.length>0&&y((function(t){if(JSON.stringify(r)!==JSON.stringify(t)){if(f()){var n=localStorage.getItem(s);JSON.stringify(r)!==n&&localStorage.setItem(s,JSON.stringify(r))}return N.current=!0,r}return t}))}));return N.current||a.publish(c.INIT_REQUEST,null),function(){i(),e(),o(),u(),g(),S()}}}),[s,l]),{items:m,totalItems:m.length}}function l(){return{addToCart:u((function(r){a.publish(c.ADD,r)}),[]),removeFromCart:u((function(r){a.publish(c.REMOVE,{id:r})}),[]),clearCart:u((function(){a.publish(c.CLEAR,null)}),[]),updateCart:u((function(r){a.publish(c.UPDATE,r)}),[])}}export{l as useMfeCartActions,s as useMfeCartStore};
|
|
2
2
|
//# sourceMappingURL=cart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.js","sources":["../../src/mfe-shared/cart.tsx"],"sourcesContent":["/**\r\n * cart.tsx - Shared shopping cart system for micro-frontends\r\n *\r\n * This module provides hooks for managing a shared shopping cart across\r\n * multiple micro-frontends. The cart state is synchronized using the\r\n * mfeBridge communication system and persisted in localStorage.\r\n */\r\n\r\nimport { useEffect, useState, useRef, useCallback } from 'react'\r\nimport { mfeBridge } from './mfe-bridge'\r\nimport { isBrowser } from './environment'\r\n\r\n/** LocalStorage key for persisting cart items */\r\nconst CART_STORAGE_KEY = 'mfe_cart_items'\r\n\r\n/** Communication channels for cart operations */\r\nexport const CART_CHANNELS = {\r\n /** Add an item to the cart */\r\n ADD: 'mfe:cart:add',\r\n /** Remove an item from the cart */\r\n REMOVE: 'mfe:cart:remove',\r\n /** Clear all items from the cart */\r\n CLEAR: 'mfe:cart:clear',\r\n /** Request initial cart data (when a new MFE loads) */\r\n INIT_REQUEST: 'mfe:cart:init_request',\r\n /** Response with cart data (to initialize a new MFE) */\r\n INIT_RESPONSE: 'mfe:cart:init_response',\r\n /** Update the entire cart at once */\r\n UPDATE: 'mfe:cart:update'\r\n}\r\n\r\n/**\r\n * Shopping cart item structure\r\n */\r\nexport interface ICartItem {\r\n /** Unique identifier for the item */\r\n id: number\r\n /** Display name of the item */\r\n name: string\r\n /** Quantity of this item in the cart */\r\n quantity: number\r\n /** Price per unit of the item */\r\n price: number\r\n}\r\n\r\n/**\r\n * Hook to manage cart state across microFE\r\n * This hook will:\r\n * - Initialize cart from localStorage\r\n * - Listen for cart events (add, remove, clear, update)\r\n * - Provide current cart state\r\n */\r\nexport const useMfeCartStore = () => {\r\n const [items, setItems] = useState<ICartItem[]>([])\r\n\r\n // Mark as initialized\r\n const initialized = useRef(false)\r\n\r\n useEffect(() => {\r\n // Skip localStorage operations in non-browser environments\r\n if (!isBrowser()) {\r\n return\r\n }\r\n\r\n // Restore from localStorage if available\r\n const storedItems = localStorage.getItem(CART_STORAGE_KEY)\r\n if (storedItems) {\r\n try {\r\n const parsedItems = JSON.parse(storedItems)\r\n if (Array.isArray(parsedItems)) {\r\n setItems(parsedItems)\r\n initialized.current = true\r\n }\r\n } catch (e) {\r\n console.error('Failed to parse cart from localStorage:', e)\r\n }\r\n }\r\n\r\n // Subscribe to cart events\r\n const unsubAdd = mfeBridge.subscribe(CART_CHANNELS.ADD, (payload: ICartItem) => {\r\n console.log('Item added to cart:', payload)\r\n setItems((prev) => {\r\n const newItems = [...prev, payload]\r\n if (JSON.stringify(newItems) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(CART_STORAGE_KEY)\r\n if (JSON.stringify(newItems) !== current) {\r\n localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(newItems))\r\n }\r\n }\r\n return newItems\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n const unsubRemove = mfeBridge.subscribe(CART_CHANNELS.REMOVE, (payload: { id: number }) => {\r\n setItems((prev) => {\r\n const newItems = prev.filter((item) => item.id !== payload.id)\r\n if (JSON.stringify(newItems) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(CART_STORAGE_KEY)\r\n if (JSON.stringify(newItems) !== current) {\r\n localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(newItems))\r\n }\r\n }\r\n return newItems\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n const unsubClear = mfeBridge.subscribe(CART_CHANNELS.CLEAR, () => {\r\n setItems([])\r\n if (isBrowser()) {\r\n localStorage.removeItem(CART_STORAGE_KEY)\r\n }\r\n })\r\n\r\n const unsubUpdate = mfeBridge.subscribe(CART_CHANNELS.UPDATE, (payload: ICartItem[]) => {\r\n setItems((prev) => {\r\n if (JSON.stringify(payload) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(CART_STORAGE_KEY)\r\n if (JSON.stringify(payload) !== current) {\r\n localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(payload))\r\n }\r\n }\r\n return payload\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n // Subscribe to init requests from other microFEs\r\n const unsubInitReq = mfeBridge.subscribe(CART_CHANNELS.INIT_REQUEST, () => {\r\n // If state is already available, return it to other microFEs\r\n if (items.length > 0) {\r\n mfeBridge.publish(CART_CHANNELS.INIT_RESPONSE, items)\r\n }\r\n })\r\n\r\n // Subscribe to init responses if state is not available\r\n const unsubInitRes = mfeBridge.subscribe(CART_CHANNELS.INIT_RESPONSE, (payload: ICartItem[]) => {\r\n if (!initialized.current && payload && payload.length > 0) {\r\n setItems(payload)\r\n if (isBrowser()) {\r\n localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(payload))\r\n }\r\n initialized.current = true\r\n }\r\n })\r\n\r\n // When mounted, send init request (only if no state from localStorage)\r\n if (!initialized.current) {\r\n mfeBridge.publish(CART_CHANNELS.INIT_REQUEST, null)\r\n }\r\n\r\n return () => {\r\n unsubAdd()\r\n unsubRemove()\r\n unsubClear()\r\n unsubUpdate()\r\n unsubInitReq()\r\n unsubInitRes()\r\n }\r\n }, [])\r\n\r\n return { items, totalItems: items.length }\r\n}\r\n\r\n/**\r\n * Hook to provide cart actions\r\n * This hook will:\r\n * - Only perform actions, not manage state\r\n * - Use mfeEventBridge to communicate with other microFEs\r\n * - Provide add, remove, clear, and update actions\r\n */\r\nexport const useMfeCartActions = () => {\r\n // Add item to cart\r\n const addToCart = useCallback((item: ICartItem) => {\r\n mfeBridge.publish(CART_CHANNELS.ADD, item)\r\n }, [])\r\n\r\n // Remove item from cart\r\n const removeFromCart = useCallback((itemId: number) => {\r\n mfeBridge.publish(CART_CHANNELS.REMOVE, { id: itemId })\r\n }, [])\r\n\r\n // Clear cart\r\n const clearCart = useCallback(() => {\r\n mfeBridge.publish(CART_CHANNELS.CLEAR, null)\r\n }, [])\r\n\r\n // Update entire cart\r\n const updateCart = useCallback((items: ICartItem[]) => {\r\n mfeBridge.publish(CART_CHANNELS.UPDATE, items)\r\n }, [])\r\n\r\n return {\r\n addToCart,\r\n removeFromCart,\r\n clearCart,\r\n updateCart\r\n }\r\n}\r\n"],"names":["CART_STORAGE_KEY","CART_CHANNELS","ADD","REMOVE","CLEAR","INIT_REQUEST","INIT_RESPONSE","UPDATE","useMfeCartStore","_useState","useState","_useState2","_slicedToArray","items","setItems","initialized","useRef","useEffect","isBrowser","storedItems","localStorage","getItem","parsedItems","JSON","parse","Array","isArray","current","e","console","error","unsubAdd","mfeBridge","subscribe","payload","log","prev","newItems","concat","_toConsumableArray","stringify","setItem","unsubRemove","filter","item","id","unsubClear","removeItem","unsubUpdate","unsubInitReq","length","publish","unsubInitRes","totalItems","useMfeCartActions","addToCart","useCallback","removeFromCart","itemId","clearCart","updateCart"],"mappings":"sQAaA,IAAMA,EAAmB,iBAGZC,EAAgB,CAE3BC,IAAK,eAELC,OAAQ,kBAERC,MAAO,iBAEPC,aAAc,wBAEdC,cAAe,yBAEfC,OAAQ,mBAwBGC,EAAkB,WAC7B,IAAAC,EAA0BC,EAAsB,IAAGC,EAAAC,EAAAH,EAAA,GAA5CI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAGhBI,EAAcC,GAAO,GAmH3B,OAjHAC,GAAU,WAER,GAAKC,IAAL,CAKA,IAAMC,EAAcC,aAAaC,QAAQrB,GACzC,GAAImB,EACF,IACE,IAAMG,EAAcC,KAAKC,MAAML,GAC3BM,MAAMC,QAAQJ,KAChBR,EAASQ,GACTP,EAAYY,SAAU,EAEzB,CAAC,MAAOC,GACPC,QAAQC,MAAM,0CAA2CF,EAC1D,CAIH,IAAMG,EAAWC,EAAUC,UAAUhC,EAAcC,KAAK,SAACgC,GACvDL,QAAQM,IAAI,sBAAuBD,GACnCpB,GAAS,SAACsB,GACR,IAAMC,KAAQC,OAAAC,EAAOH,GAAMF,CAAAA,IAC3B,GAAIX,KAAKiB,UAAUH,KAAcd,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ASoB,GACLhB,KACFE,aAAaqB,QAAQzC,EAAkBuB,KAAKiB,UAAUN,IAExDnB,EAAYY,SAAU,EAE1B,IAOA,OAJKZ,EAAYY,SACfK,EAAUmB,QAAQlD,EAAcI,aAAc,MAGzC,WACL0B,IACAW,IACAI,IACAE,IACAC,IACAG,GACD,CA1GA,CA2GF,GAAE,IAEI,CAAEvC,MAAAA,EAAOwC,WAAYxC,EAAMqC,OACpC,EASaI,EAAoB,WAqB/B,MAAO,CACLC,UApBgBC,GAAY,SAACZ,GAC7BZ,EAAUmB,QAAQlD,EAAcC,IAAK0C,EACtC,GAAE,IAmBDa,eAhBqBD,GAAY,SAACE,GAClC1B,EAAUmB,QAAQlD,EAAcE,OAAQ,CAAE0C,GAAIa,GAC/C,GAAE,IAeDC,UAZgBH,GAAY,WAC5BxB,EAAUmB,QAAQlD,EAAcG,MAAO,KACxC,GAAE,IAWDwD,WARiBJ,GAAY,SAAC3C,GAC9BmB,EAAUmB,QAAQlD,EAAcM,OAAQM,EACzC,GAAE,IAQL"}
|
|
1
|
+
{"version":3,"file":"cart.js","sources":["../../src/mfe-shared/cart.tsx"],"sourcesContent":["/**\r\n * cart.tsx - Shared shopping cart system for micro-frontends\r\n *\r\n * This module provides hooks for managing a shared shopping cart across\r\n * multiple micro-frontends. The cart state is synchronized using the\r\n * mfeBridge communication system and persisted in localStorage.\r\n */\r\n\r\nimport { useEffect, useState, useRef, useCallback, useMemo } from 'react'\r\nimport { mfeBridge } from './mfe-bridge'\r\nimport { isBrowser } from './environment'\r\nimport { ICartItem, CART_CHANNELS } from './cart.types'\r\n\r\n/** LocalStorage key for persisting cart items */\r\nconst CART_STORAGE_KEY = 'mfe_cart_items'\r\n\r\nexport interface IMfeCartStoreConfigs<T = any> {\r\n storageKey: string\r\n idGetter?: (item: T) => string\r\n}\r\n\r\n/**\r\n * Hook to manage cart state across microFE\r\n * This hook will:\r\n * - Initialize cart from localStorage\r\n * - Listen for cart events (add, remove, clear, update)\r\n * - Provide current cart state\r\n */\r\nexport function useMfeCartStore<O = any, T extends ICartItem<O> = ICartItem<O>>(configs?: IMfeCartStoreConfigs<T>) {\r\n // Use provided storage key or default to CART_STORAGE_KEY\r\n const cartStorageKey = useMemo(() => configs?.storageKey || CART_STORAGE_KEY, [configs?.storageKey])\r\n\r\n // Default idGetter uses ProductId, but can be customized\r\n const getItemId = useMemo(() => configs?.idGetter || ((item: T) => item.ProductId), [configs?.idGetter])\r\n\r\n // State to hold cart items\r\n const [items, setItems] = useState<T[]>([])\r\n\r\n // Mark as initialized\r\n const initialized = useRef(false)\r\n\r\n useEffect(() => {\r\n // Skip localStorage operations in non-browser environments\r\n if (!isBrowser()) {\r\n return\r\n }\r\n\r\n // Restore from localStorage if available\r\n const storedItems = localStorage.getItem(cartStorageKey)\r\n if (storedItems) {\r\n try {\r\n const parsedItems = JSON.parse(storedItems)\r\n if (Array.isArray(parsedItems)) {\r\n setItems(parsedItems)\r\n initialized.current = true\r\n }\r\n } catch (e) {\r\n console.error('Failed to parse cart from localStorage:', e)\r\n }\r\n }\r\n\r\n // Subscribe to cart events\r\n const unsubAdd = mfeBridge.subscribe(CART_CHANNELS.ADD, (payload: T) => {\r\n setItems((prev) => {\r\n const itemId = getItemId(payload)\r\n const existingIndex = prev.findIndex((item) => getItemId(item) === itemId)\r\n\r\n let newItems: T[]\r\n if (existingIndex >= 0) {\r\n // Update existing item\r\n newItems = [...prev]\r\n newItems[existingIndex] = payload\r\n } else {\r\n // Add new item\r\n newItems = [...prev, payload]\r\n }\r\n\r\n if (JSON.stringify(newItems) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(cartStorageKey)\r\n if (JSON.stringify(newItems) !== current) {\r\n localStorage.setItem(cartStorageKey, JSON.stringify(newItems))\r\n }\r\n }\r\n return newItems\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n const unsubRemove = mfeBridge.subscribe(CART_CHANNELS.REMOVE, (payload: { id: string }) => {\r\n setItems((prev) => {\r\n const newItems = prev.filter((item) => getItemId(item) !== payload.id)\r\n if (JSON.stringify(newItems) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(cartStorageKey)\r\n if (JSON.stringify(newItems) !== current) {\r\n localStorage.setItem(cartStorageKey, JSON.stringify(newItems))\r\n }\r\n }\r\n return newItems\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n const unsubClear = mfeBridge.subscribe(CART_CHANNELS.CLEAR, () => {\r\n setItems([])\r\n if (isBrowser()) {\r\n localStorage.removeItem(cartStorageKey)\r\n }\r\n })\r\n\r\n const unsubUpdate = mfeBridge.subscribe(CART_CHANNELS.UPDATE, (payload: T[]) => {\r\n setItems((prev) => {\r\n if (JSON.stringify(payload) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(cartStorageKey)\r\n if (JSON.stringify(payload) !== current) {\r\n localStorage.setItem(cartStorageKey, JSON.stringify(payload))\r\n }\r\n }\r\n return payload\r\n }\r\n return prev\r\n })\r\n })\r\n\r\n // Subscribe to init requests from other microFEs\r\n const unsubInitReq = mfeBridge.subscribe(CART_CHANNELS.INIT_REQUEST, () => {\r\n // Use callback to get current state to avoid stale closure\r\n setItems((currentItems) => {\r\n if (currentItems.length > 0) {\r\n mfeBridge.publish(CART_CHANNELS.INIT_RESPONSE, currentItems)\r\n }\r\n return currentItems // No change to state\r\n })\r\n })\r\n\r\n // Subscribe to init responses if state is not available\r\n const unsubInitRes = mfeBridge.subscribe(CART_CHANNELS.INIT_RESPONSE, (payload: T[]) => {\r\n if (!initialized.current && payload && payload.length > 0) {\r\n setItems((prev) => {\r\n if (JSON.stringify(payload) !== JSON.stringify(prev)) {\r\n // Save to localStorage only if value changed\r\n if (isBrowser()) {\r\n const current = localStorage.getItem(cartStorageKey)\r\n if (JSON.stringify(payload) !== current) {\r\n localStorage.setItem(cartStorageKey, JSON.stringify(payload))\r\n }\r\n }\r\n initialized.current = true\r\n return payload\r\n }\r\n return prev\r\n })\r\n }\r\n })\r\n\r\n // When mounted, send init request (only if no state from localStorage)\r\n if (!initialized.current) {\r\n mfeBridge.publish(CART_CHANNELS.INIT_REQUEST, null)\r\n }\r\n\r\n return () => {\r\n unsubAdd()\r\n unsubRemove()\r\n unsubClear()\r\n unsubUpdate()\r\n unsubInitReq()\r\n unsubInitRes()\r\n }\r\n }, [cartStorageKey, getItemId])\r\n\r\n return { items, totalItems: items.length }\r\n}\r\n\r\n/**\r\n * Hook to provide cart actions\r\n * This hook will:\r\n * - Only perform actions, not manage state\r\n * - Use mfeEventBridge to communicate with other microFEs\r\n * - Provide add, remove, clear, and update actions\r\n */\r\nexport function useMfeCartActions<O = any, T extends ICartItem<O> = ICartItem<O>>() {\r\n // Add item to cart\r\n const addToCart = useCallback((item: T) => {\r\n mfeBridge.publish(CART_CHANNELS.ADD, item)\r\n }, [])\r\n\r\n // Remove item from cart\r\n const removeFromCart = useCallback((id: string) => {\r\n mfeBridge.publish(CART_CHANNELS.REMOVE, { id })\r\n }, [])\r\n\r\n // Clear cart\r\n const clearCart = useCallback(() => {\r\n mfeBridge.publish(CART_CHANNELS.CLEAR, null)\r\n }, [])\r\n\r\n // Update entire cart\r\n const updateCart = useCallback((items: T[]) => {\r\n mfeBridge.publish(CART_CHANNELS.UPDATE, items)\r\n }, [])\r\n\r\n return {\r\n addToCart,\r\n removeFromCart,\r\n clearCart,\r\n updateCart\r\n }\r\n}\r\n"],"names":["useMfeCartStore","configs","cartStorageKey","useMemo","storageKey","getItemId","idGetter","item","ProductId","_useState","useState","_useState2","_slicedToArray","items","setItems","initialized","useRef","useEffect","isBrowser","storedItems","localStorage","getItem","parsedItems","JSON","parse","Array","isArray","current","e","console","error","unsubAdd","mfeBridge","subscribe","CART_CHANNELS","ADD","payload","prev","newItems","itemId","existingIndex","findIndex","_toConsumableArray","concat","stringify","setItem","unsubRemove","REMOVE","filter","id","unsubClear","CLEAR","removeItem","unsubUpdate","UPDATE","unsubInitReq","INIT_REQUEST","currentItems","length","publish","INIT_RESPONSE","unsubInitRes","totalItems","useMfeCartActions","addToCart","useCallback","removeFromCart","clearCart","updateCart"],"mappings":"mUA4BM,SAAUA,EAAgEC,GAE9E,IAAMC,EAAiBC,GAAQ,WAAA,OAAMF,eAAAA,EAASG,aAhBvB,mBAgBuD,CAACH,eAAAA,EAASG,aAGlFC,EAAYF,GAAQ,WAAA,OAAMF,aAAO,EAAPA,EAASK,WAAa,SAACC,GAAO,OAAKA,EAAKC,SAAU,IAAE,CAACP,eAAAA,EAASK,WAG9FG,EAA0BC,EAAc,IAAGC,EAAAC,EAAAH,EAAA,GAApCI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAGhBI,EAAcC,GAAO,GA0I3B,OAxIAC,GAAU,WAER,GAAKC,IAAL,CAKA,IAAMC,EAAcC,aAAaC,QAAQnB,GACzC,GAAIiB,EACF,IACE,IAAMG,EAAcC,KAAKC,MAAML,GAC3BM,MAAMC,QAAQJ,KAChBR,EAASQ,GACTP,EAAYY,SAAU,EAEzB,CAAC,MAAOC,GACPC,QAAQC,MAAM,0CAA2CF,EAC1D,CAIH,IAAMG,EAAWC,EAAUC,UAAUC,EAAcC,KAAK,SAACC,GACvDtB,GAAS,SAACuB,GACR,IAGIC,EAHEC,EAASlC,EAAU+B,GACnBI,EAAgBH,EAAKI,WAAU,SAAClC,GAAI,OAAKF,EAAUE,KAAUgC,KAYnE,GATIC,GAAiB,GAEnBF,EAAQI,EAAOL,IACNG,GAAiBJ,EAG1BE,EAAQ,GAAAK,OAAAD,EAAOL,GAAI,CAAED,IAGnBb,KAAKqB,UAAUN,KAAcf,KAAKqB,UAAUP,GAAO,CAErD,GAAInB,IAAa,CACf,IAAMS,EAAUP,aAAaC,QAAQnB,GACjCqB,KAAKqB,UAAUN,KAAcX,GAC/BP,aAAayB,QAAQ3C,EAAgBqB,KAAKqB,UAAUN,GAEvD,CACD,OAAOA,C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AC9BP,aAAayB,QAAQ3C,EAAgBqB,KAAKqB,UAAUR,GAEvD,CAED,OADArB,EAAYY,SAAU,EACfS,CACR,CACD,OAAOC,CACT,GAEJ,IAOA,OAJKtB,EAAYY,SACfK,EAAU2B,QAAQzB,EAAcsB,aAAc,MAGzC,WACLzB,IACAe,IACAI,IACAG,IACAE,IACAM,GACD,CAjIA,CAkIH,GAAG,CAAC3D,EAAgBG,IAEb,CAAEQ,MAAAA,EAAOiD,WAAYjD,EAAM6C,OACpC,UASgBK,IAqBd,MAAO,CACLC,UApBgBC,GAAY,SAAC1D,GAC7ByB,EAAU2B,QAAQzB,EAAcC,IAAK5B,EACtC,GAAE,IAmBD2D,eAhBqBD,GAAY,SAAChB,GAClCjB,EAAU2B,QAAQzB,EAAca,OAAQ,CAAEE,GAAAA,GAC3C,GAAE,IAeDkB,UAZgBF,GAAY,WAC5BjC,EAAU2B,QAAQzB,EAAciB,MAAO,KACxC,GAAE,IAWDiB,WARiBH,GAAY,SAACpD,GAC9BmB,EAAU2B,QAAQzB,EAAcoB,OAAQzC,EACzC,GAAE,IAQL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.types.js","sources":["../../src/mfe-shared/cart.types.ts"],"sourcesContent":["/**\r\n * cart.types.ts - Type definitions for the shopping cart system\r\n */\r\n\r\nexport type CartItemType = 'Media' | 'Audio'\r\n\r\n/**\r\n * Shopping cart item structure\r\n */\r\nexport interface ICartItem<O = any> {\r\n ProductId: string\r\n PricePackageId: string\r\n Amount: number\r\n SocialUrl?: string\r\n Type?: CartItemType\r\n ProductName?: string\r\n Options?: O\r\n}\r\n\r\n/** Communication channels for cart operations */\r\nexport const CART_CHANNELS = {\r\n /** Add an item to the cart */\r\n ADD: 'mfe:cart:add',\r\n /** Remove an item from the cart */\r\n REMOVE: 'mfe:cart:remove',\r\n /** Clear all items from the cart */\r\n CLEAR: 'mfe:cart:clear',\r\n /** Request initial cart data (when a new MFE loads) */\r\n INIT_REQUEST: 'mfe:cart:init_request',\r\n /** Response with cart data (to initialize a new MFE) */\r\n INIT_RESPONSE: 'mfe:cart:init_response',\r\n /** Update the entire cart at once */\r\n UPDATE: 'mfe:cart:update'\r\n} as const\r\n"],"names":["CART_CHANNELS","ADD","REMOVE","CLEAR","INIT_REQUEST","INIT_RESPONSE","UPDATE"],"mappings":"AAoBO,IAAMA,EAAgB,CAE3BC,IAAK,eAELC,OAAQ,kBAERC,MAAO,iBAEPC,aAAc,wBAEdC,cAAe,yBAEfC,OAAQ"}
|
package/dist/mfe-shared/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{mfeBridge}from"./mfe-bridge.js";export{MfeAuthProvider,useMfeAuth}from"./auth.js";export{AUTH_CHANNELS}from"./auth.types.js";export{SsrAuthProvider}from"./auth.ssr.js";export{
|
|
1
|
+
export{mfeBridge}from"./mfe-bridge.js";export{MfeAuthProvider,useMfeAuth}from"./auth.js";export{AUTH_CHANNELS}from"./auth.types.js";export{SsrAuthProvider}from"./auth.ssr.js";export{useMfeCartActions,useMfeCartStore}from"./cart.js";export{CART_CHANNELS}from"./cart.types.js";export{SsrCartProvider}from"./cart.ssr.js";export{MfeLink,MfeNavigateProvider,NAVIGATION_CHANNELS,useMfeNavigate}from"./navigation.js";export{isBrowser}from"./environment.js";export{HydrationGuard,useHydration}from"./hydration-helper.js";export{MfeAuthDebugPanel}from"./auth.debug.js";export{MfeCartDebugPanel}from"./cart.debug.js";export{MfeNavigateDebugPanel}from"./navigation.debug.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{slicedToArray as e,objectSpread2 as r,toConsumableArray as n}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as a}from"react";var l=function(l){var s=l.style,c=o([]),d=e(c,2),f=d[0],m=d[1];return a((function(){var e=function(e){var r=e.detail,t=r.primaryHref,i=r.secondaryHref,o=r.internal,a=r.options;m((function(e){return[{primaryHref:t,secondaryHref:i,internal:o,options:a}].concat(n(e.slice(0,9)))}))};return globalThis.addEventListener("mfe:navigate",e),function(){return globalThis.removeEventListener("mfe:navigate",e)}}),[]),t("div",{style:r({position:"fixed",background:"rgba(0,0,0,0.8)",color:"#fff",padding:12,borderRadius:8,fontSize:12,zIndex:9999,maxWidth:320,maxHeight:240,overflowY:"auto",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"},null!=s?s:{bottom:16,left:16}),children:[i("div",{style:{fontWeight:"bold",marginBottom:8},children:"MFE Navigate Debug"}),0===f.length?i("div",{style:{opacity:.7},children:"No navigation events"}):i("ul",{style:{margin:0,padding:0,listStyle:"none"},children:f.map((function(e,r){var n;return t("li",{style:{marginBottom:4},children:[i("span",{style:{color:"#90ee90"},children:e.primaryHref}),e.secondaryHref&&t("span",{style:{color:"#ffa500",marginLeft:8},children:["→ ",e.secondaryHref]}),e.internal&&i("span",{style:{color:"#87ceeb",marginLeft:8},children:"[internal]"}),(null===(n=e.options)||void 0===n?void 0:n.target)&&t("span",{style:{color:"#ffb6c1",marginLeft:8},children:["(",e.options.target,")"]})]},r)}))})]})};export{l as MfeNavigateDebugPanel};
|
|
2
|
+
//# sourceMappingURL=navigation.debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.debug.js","sources":["../../src/mfe-shared/navigation.debug.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\r\nimport type { FC } from 'react'\r\nimport type { IMfeNavigate } from './navigation'\r\n\r\nconst MAX_EVENTS = 10\r\n\r\nexport const MfeNavigateDebugPanel: FC<{ style?: React.CSSProperties }> = ({ style }) => {\r\n const [debugEvents, setDebugEvents] = useState<IMfeNavigate[]>([])\r\n\r\n useEffect(() => {\r\n const handleNavigate = (e: CustomEvent) => {\r\n const { primaryHref, secondaryHref, internal, options } = e.detail as IMfeNavigate\r\n setDebugEvents((events) => [{ primaryHref, secondaryHref, internal, options }, ...events.slice(0, MAX_EVENTS - 1)])\r\n }\r\n globalThis.addEventListener('mfe:navigate', handleNavigate as EventListener)\r\n return () => globalThis.removeEventListener('mfe:navigate', handleNavigate as EventListener)\r\n }, [])\r\n\r\n return (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n background: 'rgba(0,0,0,0.8)',\r\n color: '#fff',\r\n padding: 12,\r\n borderRadius: 8,\r\n fontSize: 12,\r\n zIndex: 9999,\r\n maxWidth: 320,\r\n maxHeight: 240,\r\n overflowY: 'auto',\r\n boxShadow: '0 2px 8px rgba(0,0,0,0.2)',\r\n ...(style ?? { bottom: 16, left: 16 })\r\n }}\r\n >\r\n <div style={{ fontWeight: 'bold', marginBottom: 8 }}>MFE Navigate Debug</div>\r\n {debugEvents.length === 0 ? (\r\n <div style={{ opacity: 0.7 }}>No navigation events</div>\r\n ) : (\r\n <ul style={{ margin: 0, padding: 0, listStyle: 'none' }}>\r\n {debugEvents.map((ev, idx) => (\r\n <li key={idx} style={{ marginBottom: 4 }}>\r\n <span style={{ color: '#90ee90' }}>{ev.primaryHref}</span>\r\n {ev.secondaryHref && <span style={{ color: '#ffa500', marginLeft: 8 }}>→ {ev.secondaryHref}</span>}\r\n {ev.internal && <span style={{ color: '#87ceeb', marginLeft: 8 }}>[internal]</span>}\r\n {ev.options?.target && <span style={{ color: '#ffb6c1', marginLeft: 8 }}>({ev.options.target})</span>}\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </div>\r\n )\r\n}\r\n"],"names":["MfeNavigateDebugPanel","_ref","style","_useState","useState","_useState2","_slicedToArray","debugEvents","setDebugEvents","useEffect","handleNavigate","e","_e$detail","detail","primaryHref","secondaryHref","internal","options","events","concat","_toConsumableArray","slice","MAX_EVENTS","globalThis","addEventListener","removeEventListener","_jsxs","_objectSpread","position","background","color","padding","borderRadius","fontSize","zIndex","maxWidth","maxHeight","overflowY","boxShadow","bottom","left","children","_jsx","fontWeight","marginBottom","length","opacity","margin","listStyle","map","ev","idx","_ev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cACtCoC,EAAGnC,eAAiBW,UAAMxB,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAQZ,SAAA,CAAA,KAAAS,EAAGnC,iBAC5EmC,EAAGlC,UAAY0B,EAAM,OAAA,CAAAxC,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAGZ,SAAA,gBACrD,QAAVW,EAAAF,EAAGjC,eAAO,IAAAmC,OAAA,EAAVA,EAAYE,SAAU5B,UAAMxB,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAOZ,SAAA,CAAA,IAAAS,EAAGjC,QAAQqC,OAAM,SAJrFH,EAMV,QAKX"}
|
|
@@ -5,33 +5,10 @@
|
|
|
5
5
|
* multiple micro-frontends. The cart state is synchronized using the
|
|
6
6
|
* mfeBridge communication system and persisted in localStorage.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Remove an item from the cart */
|
|
13
|
-
REMOVE: string;
|
|
14
|
-
/** Clear all items from the cart */
|
|
15
|
-
CLEAR: string;
|
|
16
|
-
/** Request initial cart data (when a new MFE loads) */
|
|
17
|
-
INIT_REQUEST: string;
|
|
18
|
-
/** Response with cart data (to initialize a new MFE) */
|
|
19
|
-
INIT_RESPONSE: string;
|
|
20
|
-
/** Update the entire cart at once */
|
|
21
|
-
UPDATE: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Shopping cart item structure
|
|
25
|
-
*/
|
|
26
|
-
export interface ICartItem {
|
|
27
|
-
/** Unique identifier for the item */
|
|
28
|
-
id: number;
|
|
29
|
-
/** Display name of the item */
|
|
30
|
-
name: string;
|
|
31
|
-
/** Quantity of this item in the cart */
|
|
32
|
-
quantity: number;
|
|
33
|
-
/** Price per unit of the item */
|
|
34
|
-
price: number;
|
|
8
|
+
import { ICartItem } from './cart.types';
|
|
9
|
+
export interface IMfeCartStoreConfigs<T = any> {
|
|
10
|
+
storageKey: string;
|
|
11
|
+
idGetter?: (item: T) => string;
|
|
35
12
|
}
|
|
36
13
|
/**
|
|
37
14
|
* Hook to manage cart state across microFE
|
|
@@ -40,8 +17,8 @@ export interface ICartItem {
|
|
|
40
17
|
* - Listen for cart events (add, remove, clear, update)
|
|
41
18
|
* - Provide current cart state
|
|
42
19
|
*/
|
|
43
|
-
export declare
|
|
44
|
-
items:
|
|
20
|
+
export declare function useMfeCartStore<O = any, T extends ICartItem<O> = ICartItem<O>>(configs?: IMfeCartStoreConfigs<T>): {
|
|
21
|
+
items: T[];
|
|
45
22
|
totalItems: number;
|
|
46
23
|
};
|
|
47
24
|
/**
|
|
@@ -51,9 +28,9 @@ export declare const useMfeCartStore: () => {
|
|
|
51
28
|
* - Use mfeEventBridge to communicate with other microFEs
|
|
52
29
|
* - Provide add, remove, clear, and update actions
|
|
53
30
|
*/
|
|
54
|
-
export declare
|
|
55
|
-
addToCart: (item:
|
|
56
|
-
removeFromCart: (
|
|
31
|
+
export declare function useMfeCartActions<O = any, T extends ICartItem<O> = ICartItem<O>>(): {
|
|
32
|
+
addToCart: (item: T) => void;
|
|
33
|
+
removeFromCart: (id: string) => void;
|
|
57
34
|
clearCart: () => void;
|
|
58
|
-
updateCart: (items:
|
|
35
|
+
updateCart: (items: T[]) => void;
|
|
59
36
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cart.types.ts - Type definitions for the shopping cart system
|
|
3
|
+
*/
|
|
4
|
+
export type CartItemType = 'Media' | 'Audio';
|
|
5
|
+
/**
|
|
6
|
+
* Shopping cart item structure
|
|
7
|
+
*/
|
|
8
|
+
export interface ICartItem<O = any> {
|
|
9
|
+
ProductId: string;
|
|
10
|
+
PricePackageId: string;
|
|
11
|
+
Amount: number;
|
|
12
|
+
SocialUrl?: string;
|
|
13
|
+
Type?: CartItemType;
|
|
14
|
+
ProductName?: string;
|
|
15
|
+
Options?: O;
|
|
16
|
+
}
|
|
17
|
+
/** Communication channels for cart operations */
|
|
18
|
+
export declare const CART_CHANNELS: {
|
|
19
|
+
/** Add an item to the cart */
|
|
20
|
+
readonly ADD: "mfe:cart:add";
|
|
21
|
+
/** Remove an item from the cart */
|
|
22
|
+
readonly REMOVE: "mfe:cart:remove";
|
|
23
|
+
/** Clear all items from the cart */
|
|
24
|
+
readonly CLEAR: "mfe:cart:clear";
|
|
25
|
+
/** Request initial cart data (when a new MFE loads) */
|
|
26
|
+
readonly INIT_REQUEST: "mfe:cart:init_request";
|
|
27
|
+
/** Response with cart data (to initialize a new MFE) */
|
|
28
|
+
readonly INIT_RESPONSE: "mfe:cart:init_response";
|
|
29
|
+
/** Update the entire cart at once */
|
|
30
|
+
readonly UPDATE: "mfe:cart:update";
|
|
31
|
+
};
|
|
@@ -12,8 +12,8 @@ export type { IAuthState, IUser } from './auth.types';
|
|
|
12
12
|
export { AUTH_CHANNELS } from './auth.types';
|
|
13
13
|
export { SsrAuthProvider } from './auth.ssr';
|
|
14
14
|
export { useMfeCartStore, useMfeCartActions } from './cart';
|
|
15
|
-
export type { ICartItem } from './cart';
|
|
16
|
-
export { CART_CHANNELS } from './cart';
|
|
15
|
+
export type { ICartItem } from './cart.types';
|
|
16
|
+
export { CART_CHANNELS } from './cart.types';
|
|
17
17
|
export { SsrCartProvider } from './cart.ssr';
|
|
18
18
|
export { useMfeNavigate, MfeLink, MfeNavigateProvider } from './navigation';
|
|
19
19
|
export type { IMfeNavigate, IMfeLinkProps, NavigateFunction, AppSite, IMfeNavigateProviderProps } from './navigation';
|
|
@@ -21,3 +21,6 @@ export { NAVIGATION_CHANNELS } from './navigation';
|
|
|
21
21
|
export { isBrowser } from './environment';
|
|
22
22
|
export { HydrationGuard, useHydration } from './hydration-helper';
|
|
23
23
|
export type { IHydrationState } from './hydration-helper';
|
|
24
|
+
export { MfeAuthDebugPanel } from './auth.debug';
|
|
25
|
+
export { MfeCartDebugPanel } from './cart.debug';
|
|
26
|
+
export { MfeNavigateDebugPanel } from './navigation.debug';
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type { IAuthState, IUser } from './auth.types';
|
|
8
8
|
export type { IMfeAuthProviderProps as IAuthProviderProps, ILoginParams, ILoginResponse } from './auth';
|
|
9
|
-
export type { ICartItem } from './cart';
|
|
9
|
+
export type { ICartItem } from './cart.types';
|
|
10
10
|
export type { AppSite, IMfeNavigate, IMfeNavigateHref, IMfeLinkProps, NavigateFunction, IMfeNavigateProviderProps as IMfeNavigateReactProviderProps } from './navigation';
|
|
11
11
|
export type { IHydrationState } from './hydration-helper';
|