@bikdotai/bik-component-library 0.0.829-beta.0 → 0.0.829-beta.2
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/cjs/components/BikGiftedChat/Bubble/Bubble.js +1 -1
- package/dist/cjs/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +12 -0
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js +76 -71
- package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +12 -0
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("react"),l=require("../../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("react"),l=require("../../../constants/Theme.js"),P=require("../../../hooks/useWindowSize.js"),f=require("../GiftedChat/types.js"),M=require("../GiftedChat/utils.js"),v=require("./types.js"),q=n=>n&&typeof n=="object"&&"default"in n?n:{default:n},B=q(c),_=n=>{const{currentMessage:d,position:r,renderMessageText:A,renderTicks:j,renderTime:I,renderCustomView:g,isCustomViewBottom:y,isUnsatisfactoryMessageFn:h,messagesGroupedByAiTraceId:T,onPress:O,containerStyle:t,bubbleStyles:i,appType:k=v.GiftedChatAppType.Bik}=n,u=P.useWindowSize(),e=d,s=k===v.GiftedChatAppType.Manifest,b=c.useMemo(()=>e.category===M.Constants.ChatActivity.Category.ACTIVITY&&e.activityType===M.Constants.ChatActivity.Type.PRIVATE_NOTE,[e.category,e.activityType]),x=c.useMemo(()=>{const[C,a]=M.isStringifiedArray(e?.message);return C&&a&&Array.isArray(a)},[e?.message]),m=e?.channelId===f.MESSAGE_CHANNELS.SMTP||e?.channelName===f.MESSAGE_CHANNELS.SMTP,S=e?.channelId===f.MESSAGE_CHANNELS.GMAIL||e?.channelName===f.MESSAGE_CHANNELS.GMAIL,p=u&&!s&&!m&&!S,E=c.useMemo(()=>{const C={borderRadius:8,minHeight:20,margin:0,flexGrow:p?0:u?1:0,width:"100%"};let a={};if(s)return r==="left"?a=i&&typeof i.left=="object"?i.left:{}:a=i&&typeof i.right=="object"?i.right:{},{...a};if(r==="left")a={...S||m?{maxWidth:"100%"}:{},...b?{background:l.COLORS.background.warning.light}:{backgroundColor:e?.isPrivateMail?l.COLORS.background.blue.light:l.COLORS.background.base}};else{const R=h&&h({aiTraceId:e.eventProperties?.aiTraceId,messagesGroupedByAiTraceId:T});a={backgroundColor:e.status==="failed"||R?l.COLORS.background.negative.light:l.COLORS.background.brandUltraLight,...b?{background:l.COLORS.background.warning.light}:{},...!u&&x?{maxWidth:500}:{}}}const w=i&&typeof i=="object"?"left"in i||"right"in i?r==="left"?i.left??{}:i.right??{}:i:{};return{...C,...a,...w}},[e?.channelId,e?.channelName,e?.meta?.aiUsed,e?.status,e?.eventProperties?.aiTraceId,r,u,b,x,h,T,e?.isPrivateMail,i,s,p,m,S]),L=c.useCallback(()=>o.jsxs("div",{children:[!y&&g?.(n),A?.(n),y&&g?.(n)]}),[y,g,A,n]),N=c.useMemo(()=>!s||typeof t!="object"?{}:r==="left"&&"left"in t&&t.left&&typeof t.left=="object"?t.left:r==="right"&&"right"in t&&t.right&&typeof t.right=="object"?t.right:{},[s,t,r]),G=!s&&t&&typeof t=="object"?"left"in t||"right"in t?r==="left"?t.left??{}:t.right??{}:t:{};return o.jsx("div",{style:{display:"flex",marginTop:s?0:6,marginBottom:s?0:d?.messageInformation?.reactions?.length>0?24:6,flexGrow:p?0:u?1:0,...s?{alignItems:"flex-end",...r==="right"?{cursor:"pointer"}:{}}:{},...N,...G},...s?{onClick:O}:{},children:o.jsx("div",{style:E,children:o.jsxs("div",{children:[o.jsx("div",{id:d.chatActivityId||`message-${d.psqlId}`,children:L()}),o.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end"},children:[I?.(n),j?.(d)]})]})})})},H=B.default.memo(_);exports.Bubble=H;
|
|
2
2
|
//# sourceMappingURL=Bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubble.js","sources":["../../../../../src/components/BikGiftedChat/Bubble/Bubble.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { COLORS } from '../../../constants/Theme';\nimport { useWindowSize } from '../../../hooks/useWindowSize';\nimport { MESSAGE_CHANNELS } from '../GiftedChat/types';\nimport { Constants, isStringifiedArray } from '../GiftedChat/utils';\nimport { IMessage } from '../types';\nimport { BubbleProps, GiftedChatAppType } from './types';\n\nconst BubbleComponent = <TMessage extends IMessage = IMessage>(\n\tprops: BubbleProps<TMessage>,\n): React.ReactElement => {\n\tconst {\n\t\tcurrentMessage,\n\t\tposition,\n\t\trenderMessageText,\n\t\trenderTicks,\n\t\trenderTime,\n\t\trenderCustomView,\n\t\tisCustomViewBottom,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tonPress,\n\t\tcontainerStyle,\n\t\tbubbleStyles,\n\t\tappType = GiftedChatAppType.Bik,\n\t} = props;\n\n\tconst isMobile = useWindowSize();\n\tconst message = currentMessage as any;\n\tconst isManifestApp = appType === GiftedChatAppType.Manifest;\n\n\t// Check if message is a private note\n\tconst isPrivateNote = useMemo(\n\t\t() =>\n\t\t\tmessage.category === Constants.ChatActivity.Category.ACTIVITY &&\n\t\t\tmessage.activityType === Constants.ChatActivity.Type.PRIVATE_NOTE,\n\t\t[message.category, message.activityType],\n\t);\n\n\t// Check if message is a carousel (array of items)\n\tconst isCarouselMessage = useMemo(() => {\n\t\tconst [parsedSuccessfully, parsedMessage] = isStringifiedArray(\n\t\t\tmessage?.message,\n\t\t);\n\t\treturn parsedSuccessfully && parsedMessage && Array.isArray(parsedMessage);\n\t}, [message?.message]);\n\tconst isSmtp =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.SMTP ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.SMTP;\n\n\t// Generates wrapper styles for the message bubble\n\t// Handles position-based styling, channel-specific layouts, and message states\n\tconst wrapperStyles = useMemo((): React.CSSProperties => {\n\t\tconst baseStyles: React.CSSProperties = {\n\t\t\tborderRadius: 8,\n\t\t\tminHeight: 20,\n\t\t\tmargin: 0,\n\t\t\tflexGrow: isMobile ? 1 : 0,\n\t\t\twidth: '100%',\n\t\t};\n\n\t\t// Check if message is from email channels\n\t\tconst isGmail =\n\t\t\tmessage?.channelId === MESSAGE_CHANNELS.GMAIL ||\n\t\t\tmessage?.channelName === MESSAGE_CHANNELS.GMAIL;\n\n\t\tlet dynamicStyles: React.CSSProperties = {};\n\n\t\tif (isManifestApp) {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.left === 'object'\n\t\t\t\t\t\t? bubbleStyles.left\n\t\t\t\t\t\t: {};\n\t\t\t} else {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.right === 'object'\n\t\t\t\t\t\t? bubbleStyles.right\n\t\t\t\t\t\t: {};\n\t\t\t}\n\t\t\treturn { ...dynamicStyles };\n\t\t} else {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\t...(isMobile || isGmail || isSmtp ? { maxWidth: '100%' } : {}),\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tbackgroundColor: message?.isPrivateMail\n\t\t\t\t\t\t\t\t\t? COLORS.background.blue.light\n\t\t\t\t\t\t\t\t\t: COLORS.background.base,\n\t\t\t\t\t\t }),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst isUnsatisfactory =\n\t\t\t\t\tisUnsatisfactoryMessageFn &&\n\t\t\t\t\tisUnsatisfactoryMessageFn({\n\t\t\t\t\t\taiTraceId: message.eventProperties?.aiTraceId,\n\t\t\t\t\t\tmessagesGroupedByAiTraceId,\n\t\t\t\t\t});\n\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tmessage.status === 'failed' || isUnsatisfactory\n\t\t\t\t\t\t\t? COLORS.background.negative.light\n\t\t\t\t\t\t\t: COLORS.background.brandUltraLight,\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(!isMobile && isCarouselMessage ? { maxWidth: 500 } : {}),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tconst extraBubbleStyles: React.CSSProperties =\n\t\t\tbubbleStyles && typeof bubbleStyles === 'object'\n\t\t\t\t? 'left' in bubbleStyles || 'right' in bubbleStyles\n\t\t\t\t\t? position === 'left'\n\t\t\t\t\t\t? (bubbleStyles as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t\t: (bubbleStyles as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t\t: (bubbleStyles as React.CSSProperties)\n\t\t\t\t: {};\n\n\t\treturn { ...baseStyles, ...dynamicStyles, ...extraBubbleStyles };\n\t}, [\n\t\tmessage?.channelId,\n\t\tmessage?.channelName,\n\t\tmessage?.meta?.aiUsed,\n\t\tmessage?.status,\n\t\tmessage?.eventProperties?.aiTraceId,\n\t\tposition,\n\t\tisMobile,\n\t\tisPrivateNote,\n\t\tisCarouselMessage,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tmessage?.isPrivateMail,\n\t\tbubbleStyles,\n\t\tisManifestApp,\n\t]);\n\n\t// Renders the content of the message bubble\n\t// Handles custom views and message text in the correct order\n\tconst renderContent = useCallback(() => {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{!isCustomViewBottom && renderCustomView?.(props)}\n\n\t\t\t\t{renderMessageText?.(props)}\n\n\t\t\t\t{isCustomViewBottom && renderCustomView?.(props)}\n\t\t\t</div>\n\t\t);\n\t}, [isCustomViewBottom, renderCustomView, renderMessageText, props]);\n\n\tconst manifestContainerStyle = useMemo(() => {\n\t\tif (!isManifestApp || typeof containerStyle !== 'object') return {};\n\t\tif (\n\t\t\tposition === 'left' &&\n\t\t\t'left' in containerStyle &&\n\t\t\tcontainerStyle.left &&\n\t\t\ttypeof containerStyle.left === 'object'\n\t\t) {\n\t\t\treturn containerStyle.left;\n\t\t}\n\t\tif (\n\t\t\tposition === 'right' &&\n\t\t\t'right' in containerStyle &&\n\t\t\tcontainerStyle.right &&\n\t\t\ttypeof containerStyle.right === 'object'\n\t\t) {\n\t\t\treturn containerStyle.right;\n\t\t}\n\t\treturn {};\n\t}, [isManifestApp, containerStyle, position]);\n\n\tconst extraContainerStyle: React.CSSProperties =\n\t\t!isManifestApp && containerStyle && typeof containerStyle === 'object'\n\t\t\t? 'left' in containerStyle || 'right' in containerStyle\n\t\t\t\t? position === 'left'\n\t\t\t\t\t? (containerStyle as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t: (containerStyle as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t: (containerStyle as React.CSSProperties)\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tmarginTop: isManifestApp ? 0 : 6,\n\t\t\t\tmarginBottom: isManifestApp\n\t\t\t\t\t? 0\n\t\t\t\t\t: currentMessage?.['messageInformation']?.reactions?.length > 0\n\t\t\t\t\t? 24\n\t\t\t\t\t: 6,\n\t\t\t\tflexGrow: isMobile ? 1 : 0,\n\t\t\t\t...(isManifestApp\n\t\t\t\t\t? {\n\t\t\t\t\t\t\talignItems: 'flex-end',\n\t\t\t\t\t\t\t...(position === 'right' ? { cursor: 'pointer' } : {}),\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...manifestContainerStyle,\n\t\t\t\t...extraContainerStyle,\n\t\t\t}}\n\t\t\t{...(isManifestApp ? { onClick: onPress } : {})}\n\t\t>\n\t\t\t<div style={wrapperStyles}>\n\t\t\t\t<div>\n\t\t\t\t\t{/* Message content */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={\n\t\t\t\t\t\t\tcurrentMessage['chatActivityId'] ||\n\t\t\t\t\t\t\t`message-${currentMessage['psqlId']}`\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderContent()}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Message metadata (time and status) — bottom bar, time/ticks\n\t\t\t\t\t right-aligned. The 8px gap above comes from the time/ticks\n\t\t\t\t\t rows' own top padding. */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'row',\n\t\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderTime?.(props)}\n\t\t\t\t\t\t{renderTicks?.(currentMessage)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n// Export memoized version for performance\nexport const Bubble = React.memo(BubbleComponent) as typeof BubbleComponent;\n\nexport default Bubble;\n"],"names":["BubbleComponent","props","currentMessage","position","renderMessageText","renderTicks","renderTime","renderCustomView","isCustomViewBottom","isUnsatisfactoryMessageFn","messagesGroupedByAiTraceId","onPress","containerStyle","bubbleStyles","appType","GiftedChatAppType","isMobile","useWindowSize","message","isManifestApp","isPrivateNote","useMemo","Constants","isCarouselMessage","parsedSuccessfully","parsedMessage","isStringifiedArray","isSmtp","MESSAGE_CHANNELS","wrapperStyles","baseStyles","isGmail","dynamicStyles","COLORS","isUnsatisfactory","extraBubbleStyles","renderContent","useCallback","manifestContainerStyle","extraContainerStyle","jsx","jsxs","Bubble","React"],"mappings":"6XAQMA,EACLC,GACwB,CACxB,KAAM,CACL,eAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,0BAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,eAAAC,EACA,aAAAC,EACA,QAAAC,EAAUC,EAAAA,kBAAkB,GAAA,EACzBd,EAEEe,EAAWC,EAAAA,cAAA,EACXC,EAAUhB,EACViB,EAAgBL,IAAYC,EAAAA,kBAAkB,SAG9CK,EAAgBC,EAAAA,QACrB,IACCH,EAAQ,WAAaI,EAAAA,UAAU,aAAa,SAAS,UACrDJ,EAAQ,eAAiBI,EAAAA,UAAU,aAAa,KAAK,aACtD,CAACJ,EAAQ,SAAUA,EAAQ,YAAY,CAAA,EAIlCK,EAAoBF,EAAAA,QAAQ,IAAM,CACvC,KAAM,CAACG,EAAoBC,CAAa,EAAIC,EAAAA,mBAC3CR,GAAS,OAAA,EAEV,OAAOM,GAAsBC,GAAiB,MAAM,QAAQA,CAAa,CAC1E,EAAG,CAACP,GAAS,OAAO,CAAC,EACfS,EACLT,GAAS,YAAcU,EAAAA,iBAAiB,MACxCV,GAAS,cAAgBU,EAAAA,iBAAiB,KAIrCC,EAAgBR,EAAAA,QAAQ,IAA2B,CACxD,MAAMS,EAAkC,CACvC,aAAc,EACd,UAAW,GACX,OAAQ,EACR,SAAUd,EAAW,EAAI,EACzB,MAAO,MAAA,EAIFe,EACLb,GAAS,YAAcU,EAAAA,iBAAiB,OACxCV,GAAS,cAAgBU,EAAAA,iBAAiB,MAE3C,IAAII,EAAqC,CAAA,EAEzC,GAAIb,EACH,OAAIhB,IAAa,OAChB6B,EACCnB,GAAgB,OAAOA,EAAa,MAAS,SAC1CA,EAAa,KACb,CAAA,EAEJ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D,CAAA,CAAA,CAGH,EAGawC,EAASC,EAAAA,QAAM,KAAK3C,CAAe"}
|
|
1
|
+
{"version":3,"file":"Bubble.js","sources":["../../../../../src/components/BikGiftedChat/Bubble/Bubble.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { COLORS } from '../../../constants/Theme';\nimport { useWindowSize } from '../../../hooks/useWindowSize';\nimport { MESSAGE_CHANNELS } from '../GiftedChat/types';\nimport { Constants, isStringifiedArray } from '../GiftedChat/utils';\nimport { IMessage } from '../types';\nimport { BubbleProps, GiftedChatAppType } from './types';\n\nconst BubbleComponent = <TMessage extends IMessage = IMessage>(\n\tprops: BubbleProps<TMessage>,\n): React.ReactElement => {\n\tconst {\n\t\tcurrentMessage,\n\t\tposition,\n\t\trenderMessageText,\n\t\trenderTicks,\n\t\trenderTime,\n\t\trenderCustomView,\n\t\tisCustomViewBottom,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tonPress,\n\t\tcontainerStyle,\n\t\tbubbleStyles,\n\t\tappType = GiftedChatAppType.Bik,\n\t} = props;\n\n\tconst isMobile = useWindowSize();\n\tconst message = currentMessage as any;\n\tconst isManifestApp = appType === GiftedChatAppType.Manifest;\n\n\t// Check if message is a private note\n\tconst isPrivateNote = useMemo(\n\t\t() =>\n\t\t\tmessage.category === Constants.ChatActivity.Category.ACTIVITY &&\n\t\t\tmessage.activityType === Constants.ChatActivity.Type.PRIVATE_NOTE,\n\t\t[message.category, message.activityType],\n\t);\n\n\t// Check if message is a carousel (array of items)\n\tconst isCarouselMessage = useMemo(() => {\n\t\tconst [parsedSuccessfully, parsedMessage] = isStringifiedArray(\n\t\t\tmessage?.message,\n\t\t);\n\t\treturn parsedSuccessfully && parsedMessage && Array.isArray(parsedMessage);\n\t}, [message?.message]);\n\tconst isSmtp =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.SMTP ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.SMTP;\n\tconst isGmail =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.GMAIL ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.GMAIL;\n\n\t// CRM-4796/4797: on mobile, regular chat bubbles hug their content so the\n\t// agent(right)/customer(left) alignment and the bottom-right time are\n\t// visible. Email (SMTP/Gmail) bubbles are excluded — they stay full-width\n\t// and left-aligned with the time shown in the mail header.\n\tconst hugContentOnMobile = isMobile && !isManifestApp && !isSmtp && !isGmail;\n\n\t// Generates wrapper styles for the message bubble\n\t// Handles position-based styling, channel-specific layouts, and message states\n\tconst wrapperStyles = useMemo((): React.CSSProperties => {\n\t\tconst baseStyles: React.CSSProperties = {\n\t\t\tborderRadius: 8,\n\t\t\tminHeight: 20,\n\t\t\tmargin: 0,\n\t\t\tflexGrow: hugContentOnMobile ? 0 : isMobile ? 1 : 0,\n\t\t\twidth: '100%',\n\t\t};\n\n\t\tlet dynamicStyles: React.CSSProperties = {};\n\n\t\tif (isManifestApp) {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.left === 'object'\n\t\t\t\t\t\t? bubbleStyles.left\n\t\t\t\t\t\t: {};\n\t\t\t} else {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.right === 'object'\n\t\t\t\t\t\t? bubbleStyles.right\n\t\t\t\t\t\t: {};\n\t\t\t}\n\t\t\treturn { ...dynamicStyles };\n\t\t} else {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\t// CRM-4796: non-email mobile bubbles hug content (no full-width),\n\t\t\t\t\t// so only email/desktop-email keep maxWidth 100%.\n\t\t\t\t\t...(isGmail || isSmtp ? { maxWidth: '100%' } : {}),\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tbackgroundColor: message?.isPrivateMail\n\t\t\t\t\t\t\t\t\t? COLORS.background.blue.light\n\t\t\t\t\t\t\t\t\t: COLORS.background.base,\n\t\t\t\t\t\t }),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst isUnsatisfactory =\n\t\t\t\t\tisUnsatisfactoryMessageFn &&\n\t\t\t\t\tisUnsatisfactoryMessageFn({\n\t\t\t\t\t\taiTraceId: message.eventProperties?.aiTraceId,\n\t\t\t\t\t\tmessagesGroupedByAiTraceId,\n\t\t\t\t\t});\n\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tmessage.status === 'failed' || isUnsatisfactory\n\t\t\t\t\t\t\t? COLORS.background.negative.light\n\t\t\t\t\t\t\t: COLORS.background.brandUltraLight,\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(!isMobile && isCarouselMessage ? { maxWidth: 500 } : {}),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tconst extraBubbleStyles: React.CSSProperties =\n\t\t\tbubbleStyles && typeof bubbleStyles === 'object'\n\t\t\t\t? 'left' in bubbleStyles || 'right' in bubbleStyles\n\t\t\t\t\t? position === 'left'\n\t\t\t\t\t\t? (bubbleStyles as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t\t: (bubbleStyles as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t\t: (bubbleStyles as React.CSSProperties)\n\t\t\t\t: {};\n\n\t\treturn { ...baseStyles, ...dynamicStyles, ...extraBubbleStyles };\n\t}, [\n\t\tmessage?.channelId,\n\t\tmessage?.channelName,\n\t\tmessage?.meta?.aiUsed,\n\t\tmessage?.status,\n\t\tmessage?.eventProperties?.aiTraceId,\n\t\tposition,\n\t\tisMobile,\n\t\tisPrivateNote,\n\t\tisCarouselMessage,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tmessage?.isPrivateMail,\n\t\tbubbleStyles,\n\t\tisManifestApp,\n\t\thugContentOnMobile,\n\t\tisSmtp,\n\t\tisGmail,\n\t]);\n\n\t// Renders the content of the message bubble\n\t// Handles custom views and message text in the correct order\n\tconst renderContent = useCallback(() => {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{!isCustomViewBottom && renderCustomView?.(props)}\n\n\t\t\t\t{renderMessageText?.(props)}\n\n\t\t\t\t{isCustomViewBottom && renderCustomView?.(props)}\n\t\t\t</div>\n\t\t);\n\t}, [isCustomViewBottom, renderCustomView, renderMessageText, props]);\n\n\tconst manifestContainerStyle = useMemo(() => {\n\t\tif (!isManifestApp || typeof containerStyle !== 'object') return {};\n\t\tif (\n\t\t\tposition === 'left' &&\n\t\t\t'left' in containerStyle &&\n\t\t\tcontainerStyle.left &&\n\t\t\ttypeof containerStyle.left === 'object'\n\t\t) {\n\t\t\treturn containerStyle.left;\n\t\t}\n\t\tif (\n\t\t\tposition === 'right' &&\n\t\t\t'right' in containerStyle &&\n\t\t\tcontainerStyle.right &&\n\t\t\ttypeof containerStyle.right === 'object'\n\t\t) {\n\t\t\treturn containerStyle.right;\n\t\t}\n\t\treturn {};\n\t}, [isManifestApp, containerStyle, position]);\n\n\tconst extraContainerStyle: React.CSSProperties =\n\t\t!isManifestApp && containerStyle && typeof containerStyle === 'object'\n\t\t\t? 'left' in containerStyle || 'right' in containerStyle\n\t\t\t\t? position === 'left'\n\t\t\t\t\t? (containerStyle as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t: (containerStyle as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t: (containerStyle as React.CSSProperties)\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tmarginTop: isManifestApp ? 0 : 6,\n\t\t\t\tmarginBottom: isManifestApp\n\t\t\t\t\t? 0\n\t\t\t\t\t: currentMessage?.['messageInformation']?.reactions?.length > 0\n\t\t\t\t\t? 24\n\t\t\t\t\t: 6,\n\t\t\t\tflexGrow: hugContentOnMobile ? 0 : isMobile ? 1 : 0,\n\t\t\t\t...(isManifestApp\n\t\t\t\t\t? {\n\t\t\t\t\t\t\talignItems: 'flex-end',\n\t\t\t\t\t\t\t...(position === 'right' ? { cursor: 'pointer' } : {}),\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...manifestContainerStyle,\n\t\t\t\t...extraContainerStyle,\n\t\t\t}}\n\t\t\t{...(isManifestApp ? { onClick: onPress } : {})}\n\t\t>\n\t\t\t<div style={wrapperStyles}>\n\t\t\t\t<div>\n\t\t\t\t\t{/* Message content */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={\n\t\t\t\t\t\t\tcurrentMessage['chatActivityId'] ||\n\t\t\t\t\t\t\t`message-${currentMessage['psqlId']}`\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderContent()}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Message metadata (time and status) — bottom bar, time/ticks\n\t\t\t\t\t right-aligned. The 8px gap above comes from the time/ticks\n\t\t\t\t\t rows' own top padding. */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'row',\n\t\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderTime?.(props)}\n\t\t\t\t\t\t{renderTicks?.(currentMessage)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n// Export memoized version for performance\nexport const Bubble = React.memo(BubbleComponent) as typeof BubbleComponent;\n\nexport default Bubble;\n"],"names":["BubbleComponent","props","currentMessage","position","renderMessageText","renderTicks","renderTime","renderCustomView","isCustomViewBottom","isUnsatisfactoryMessageFn","messagesGroupedByAiTraceId","onPress","containerStyle","bubbleStyles","appType","GiftedChatAppType","isMobile","useWindowSize","message","isManifestApp","isPrivateNote","useMemo","Constants","isCarouselMessage","parsedSuccessfully","parsedMessage","isStringifiedArray","isSmtp","MESSAGE_CHANNELS","isGmail","hugContentOnMobile","wrapperStyles","baseStyles","dynamicStyles","COLORS","isUnsatisfactory","extraBubbleStyles","renderContent","useCallback","manifestContainerStyle","extraContainerStyle","jsx","jsxs","Bubble","React"],"mappings":"6XAQMA,EACLC,GACwB,CACxB,KAAM,CACL,eAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,0BAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,eAAAC,EACA,aAAAC,EACA,QAAAC,EAAUC,EAAAA,kBAAkB,GAAA,EACzBd,EAEEe,EAAWC,EAAAA,cAAA,EACXC,EAAUhB,EACViB,EAAgBL,IAAYC,EAAAA,kBAAkB,SAG9CK,EAAgBC,EAAAA,QACrB,IACCH,EAAQ,WAAaI,EAAAA,UAAU,aAAa,SAAS,UACrDJ,EAAQ,eAAiBI,EAAAA,UAAU,aAAa,KAAK,aACtD,CAACJ,EAAQ,SAAUA,EAAQ,YAAY,CAAA,EAIlCK,EAAoBF,EAAAA,QAAQ,IAAM,CACvC,KAAM,CAACG,EAAoBC,CAAa,EAAIC,EAAAA,mBAC3CR,GAAS,OAAA,EAEV,OAAOM,GAAsBC,GAAiB,MAAM,QAAQA,CAAa,CAC1E,EAAG,CAACP,GAAS,OAAO,CAAC,EACfS,EACLT,GAAS,YAAcU,EAAAA,iBAAiB,MACxCV,GAAS,cAAgBU,EAAAA,iBAAiB,KACrCC,EACLX,GAAS,YAAcU,EAAAA,iBAAiB,OACxCV,GAAS,cAAgBU,EAAAA,iBAAiB,MAMrCE,EAAqBd,GAAY,CAACG,GAAiB,CAACQ,GAAU,CAACE,EAI/DE,EAAgBV,EA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,SAAA,CAAAU,EAAAA,IAAC,MAAA,CACA,GACCvC,EAAe,gBACf,WAAWA,EAAe,MAAS,GAGnC,SAAAmC,EAAA,CAAc,CAAA,EAMhBK,EAAAA,KAAC,MAAA,CACA,MAAO,CACN,QAAS,OACT,cAAe,MACf,eAAgB,UAAA,EAGhB,SAAA,CAAApC,IAAaL,CAAK,EAClBI,IAAcH,CAAc,CAAA,CAAA,CAAA,CAC9B,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CAGH,EAGayC,EAASC,EAAAA,QAAM,KAAK5C,CAAe"}
|
|
@@ -50,6 +50,18 @@
|
|
|
50
50
|
height: 0;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/* CRM-4814: hidden in-flow copy of the placeholder so a multi-line
|
|
54
|
+
placeholder grows the editor instead of showing a scrollbar (the
|
|
55
|
+
zero-height float above adds no height). -1lh cancels the caret line. */
|
|
56
|
+
p.is-editor-empty:first-child::after {
|
|
57
|
+
content: attr(data-placeholder);
|
|
58
|
+
display: block;
|
|
59
|
+
visibility: hidden;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
margin-top: -1.5em; /* one line at the editor's line-height: 1.5 */
|
|
62
|
+
margin-top: -1lh;
|
|
63
|
+
}
|
|
64
|
+
|
|
53
65
|
/* Characters pasted beyond the soft character limit — rendered grey so the
|
|
54
66
|
overflow is visible but clearly marked (see CharacterLimitExtension). */
|
|
55
67
|
.bik-editor-overflow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\t/* The empty placeholder paragraph shouldn't inherit the rich-mode 1em\n\t\t block margin (email/SMTP/signature) — otherwise the placeholder text\n\t\t is pushed down. Real (non-empty) paragraphs keep their spacing. */\n\t\tp.is-editor-empty:first-child {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\n\t\t/* Characters pasted beyond the soft character limit — rendered grey so the\n\t\t overflow is visible but clearly marked (see CharacterLimitExtension). */\n\t\t.bik-editor-overflow {\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHeight","maxHeight","tightParagraphs","COLORS","jsonMode","css","BikJsonHeader","BikJsonError"],"mappings":"uNAGaA,EAAiBC,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUrB,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA,gBACtC,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAiBzC,CAAC,CAAE,gBAAAC,CAAA,IAAuBA,EAAkB,IAAM,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\t/* The empty placeholder paragraph shouldn't inherit the rich-mode 1em\n\t\t block margin (email/SMTP/signature) — otherwise the placeholder text\n\t\t is pushed down. Real (non-empty) paragraphs keep their spacing. */\n\t\tp.is-editor-empty:first-child {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\n\t\t/* CRM-4814: hidden in-flow copy of the placeholder so a multi-line\n\t\t placeholder grows the editor instead of showing a scrollbar (the\n\t\t zero-height float above adds no height). -1lh cancels the caret line. */\n\t\tp.is-editor-empty:first-child::after {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tdisplay: block;\n\t\t\tvisibility: hidden;\n\t\t\tpointer-events: none;\n\t\t\tmargin-top: -1.5em; /* one line at the editor's line-height: 1.5 */\n\t\t\tmargin-top: -1lh;\n\t\t}\n\n\t\t/* Characters pasted beyond the soft character limit — rendered grey so the\n\t\t overflow is visible but clearly marked (see CharacterLimitExtension). */\n\t\t.bik-editor-overflow {\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHeight","maxHeight","tightParagraphs","COLORS","jsonMode","css","BikJsonHeader","BikJsonError"],"mappings":"uNAGaA,EAAiBC,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUrB,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA,gBACtC,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBUC,EAAgBP,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgDvBQ,EAAeR,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
@@ -1,113 +1,118 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import R, { useMemo as
|
|
3
|
-
import { COLORS as
|
|
1
|
+
import { jsxs as T, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import R, { useMemo as d, useCallback as U } from "react";
|
|
3
|
+
import { COLORS as a } from "../../../constants/Theme.js";
|
|
4
4
|
import { useWindowSize as V } from "../../../hooks/useWindowSize.js";
|
|
5
|
-
import { MESSAGE_CHANNELS as
|
|
6
|
-
import { Constants as
|
|
7
|
-
import { GiftedChatAppType as
|
|
8
|
-
const
|
|
5
|
+
import { MESSAGE_CHANNELS as f } from "../GiftedChat/types.js";
|
|
6
|
+
import { Constants as x, isStringifiedArray as _ } from "../GiftedChat/utils.js";
|
|
7
|
+
import { GiftedChatAppType as A } from "./types.js";
|
|
8
|
+
const W = (o) => {
|
|
9
9
|
const {
|
|
10
10
|
currentMessage: l,
|
|
11
|
-
position:
|
|
12
|
-
renderMessageText:
|
|
13
|
-
renderTicks:
|
|
14
|
-
renderTime:
|
|
15
|
-
renderCustomView:
|
|
16
|
-
isCustomViewBottom:
|
|
17
|
-
isUnsatisfactoryMessageFn:
|
|
18
|
-
messagesGroupedByAiTraceId:
|
|
19
|
-
onPress:
|
|
11
|
+
position: n,
|
|
12
|
+
renderMessageText: v,
|
|
13
|
+
renderTicks: k,
|
|
14
|
+
renderTime: j,
|
|
15
|
+
renderCustomView: g,
|
|
16
|
+
isCustomViewBottom: m,
|
|
17
|
+
isUnsatisfactoryMessageFn: y,
|
|
18
|
+
messagesGroupedByAiTraceId: M,
|
|
19
|
+
onPress: w,
|
|
20
20
|
containerStyle: t,
|
|
21
21
|
bubbleStyles: i,
|
|
22
|
-
appType:
|
|
23
|
-
} =
|
|
24
|
-
() => e.category ===
|
|
22
|
+
appType: P = A.Bik
|
|
23
|
+
} = o, c = V(), e = l, r = P === A.Manifest, u = d(
|
|
24
|
+
() => e.category === x.ChatActivity.Category.ACTIVITY && e.activityType === x.ChatActivity.Type.PRIVATE_NOTE,
|
|
25
25
|
[e.category, e.activityType]
|
|
26
|
-
),
|
|
27
|
-
const [
|
|
26
|
+
), I = d(() => {
|
|
27
|
+
const [C, s] = _(
|
|
28
28
|
e?.message
|
|
29
29
|
);
|
|
30
|
-
return
|
|
31
|
-
}, [e?.message]),
|
|
32
|
-
const
|
|
30
|
+
return C && s && Array.isArray(s);
|
|
31
|
+
}, [e?.message]), h = e?.channelId === f.SMTP || e?.channelName === f.SMTP, b = e?.channelId === f.GMAIL || e?.channelName === f.GMAIL, p = c && !r && !h && !b, G = d(() => {
|
|
32
|
+
const C = {
|
|
33
33
|
borderRadius: 8,
|
|
34
34
|
minHeight: 20,
|
|
35
35
|
margin: 0,
|
|
36
|
-
flexGrow: c ? 1 : 0,
|
|
36
|
+
flexGrow: p ? 0 : c ? 1 : 0,
|
|
37
37
|
width: "100%"
|
|
38
|
-
}
|
|
39
|
-
let
|
|
40
|
-
if (
|
|
41
|
-
return
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
};
|
|
39
|
+
let s = {};
|
|
40
|
+
if (r)
|
|
41
|
+
return n === "left" ? s = i && typeof i.left == "object" ? i.left : {} : s = i && typeof i.right == "object" ? i.right : {}, { ...s };
|
|
42
|
+
if (n === "left")
|
|
43
|
+
s = {
|
|
44
|
+
// CRM-4796: non-email mobile bubbles hug content (no full-width),
|
|
45
|
+
// so only email/desktop-email keep maxWidth 100%.
|
|
46
|
+
...b || h ? { maxWidth: "100%" } : {},
|
|
47
|
+
...u ? {
|
|
48
|
+
background: a.background.warning.light
|
|
47
49
|
} : {
|
|
48
|
-
backgroundColor: e?.isPrivateMail ?
|
|
50
|
+
backgroundColor: e?.isPrivateMail ? a.background.blue.light : a.background.base
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
else {
|
|
52
|
-
const
|
|
54
|
+
const O = y && y({
|
|
53
55
|
aiTraceId: e.eventProperties?.aiTraceId,
|
|
54
|
-
messagesGroupedByAiTraceId:
|
|
56
|
+
messagesGroupedByAiTraceId: M
|
|
55
57
|
});
|
|
56
|
-
|
|
57
|
-
backgroundColor: e.status === "failed" ||
|
|
58
|
-
...
|
|
59
|
-
background:
|
|
58
|
+
s = {
|
|
59
|
+
backgroundColor: e.status === "failed" || O ? a.background.negative.light : a.background.brandUltraLight,
|
|
60
|
+
...u ? {
|
|
61
|
+
background: a.background.warning.light
|
|
60
62
|
} : {},
|
|
61
|
-
...!c &&
|
|
63
|
+
...!c && I ? { maxWidth: 500 } : {}
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
|
-
const
|
|
65
|
-
return { ...
|
|
66
|
+
const L = i && typeof i == "object" ? "left" in i || "right" in i ? n === "left" ? i.left ?? {} : i.right ?? {} : i : {};
|
|
67
|
+
return { ...C, ...s, ...L };
|
|
66
68
|
}, [
|
|
67
69
|
e?.channelId,
|
|
68
70
|
e?.channelName,
|
|
69
71
|
e?.meta?.aiUsed,
|
|
70
72
|
e?.status,
|
|
71
73
|
e?.eventProperties?.aiTraceId,
|
|
72
|
-
|
|
74
|
+
n,
|
|
73
75
|
c,
|
|
74
|
-
h,
|
|
75
|
-
v,
|
|
76
76
|
u,
|
|
77
|
-
|
|
77
|
+
I,
|
|
78
|
+
y,
|
|
79
|
+
M,
|
|
78
80
|
e?.isPrivateMail,
|
|
79
81
|
i,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
r,
|
|
83
|
+
p,
|
|
84
|
+
h,
|
|
85
|
+
b
|
|
86
|
+
]), B = U(() => /* @__PURE__ */ T("div", { children: [
|
|
87
|
+
!m && g?.(o),
|
|
88
|
+
v?.(o),
|
|
89
|
+
m && g?.(o)
|
|
90
|
+
] }), [m, g, v, o]), N = d(() => !r || typeof t != "object" ? {} : n === "left" && "left" in t && t.left && typeof t.left == "object" ? t.left : n === "right" && "right" in t && t.right && typeof t.right == "object" ? t.right : {}, [r, t, n]), E = !r && t && typeof t == "object" ? "left" in t || "right" in t ? n === "left" ? t.left ?? {} : t.right ?? {} : t : {};
|
|
91
|
+
return /* @__PURE__ */ S(
|
|
87
92
|
"div",
|
|
88
93
|
{
|
|
89
94
|
style: {
|
|
90
95
|
display: "flex",
|
|
91
|
-
marginTop:
|
|
92
|
-
marginBottom:
|
|
93
|
-
flexGrow: c ? 1 : 0,
|
|
94
|
-
...
|
|
96
|
+
marginTop: r ? 0 : 6,
|
|
97
|
+
marginBottom: r ? 0 : l?.messageInformation?.reactions?.length > 0 ? 24 : 6,
|
|
98
|
+
flexGrow: p ? 0 : c ? 1 : 0,
|
|
99
|
+
...r ? {
|
|
95
100
|
alignItems: "flex-end",
|
|
96
|
-
...
|
|
101
|
+
...n === "right" ? { cursor: "pointer" } : {}
|
|
97
102
|
} : {},
|
|
98
|
-
...
|
|
99
|
-
...
|
|
103
|
+
...N,
|
|
104
|
+
...E
|
|
100
105
|
},
|
|
101
|
-
...
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
106
|
+
...r ? { onClick: w } : {},
|
|
107
|
+
children: /* @__PURE__ */ S("div", { style: G, children: /* @__PURE__ */ T("div", { children: [
|
|
108
|
+
/* @__PURE__ */ S(
|
|
104
109
|
"div",
|
|
105
110
|
{
|
|
106
111
|
id: l.chatActivityId || `message-${l.psqlId}`,
|
|
107
|
-
children:
|
|
112
|
+
children: B()
|
|
108
113
|
}
|
|
109
114
|
),
|
|
110
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ T(
|
|
111
116
|
"div",
|
|
112
117
|
{
|
|
113
118
|
style: {
|
|
@@ -116,16 +121,16 @@ const O = (s) => {
|
|
|
116
121
|
justifyContent: "flex-end"
|
|
117
122
|
},
|
|
118
123
|
children: [
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
j?.(o),
|
|
125
|
+
k?.(l)
|
|
121
126
|
]
|
|
122
127
|
}
|
|
123
128
|
)
|
|
124
129
|
] }) })
|
|
125
130
|
}
|
|
126
131
|
);
|
|
127
|
-
},
|
|
132
|
+
}, J = R.memo(W);
|
|
128
133
|
export {
|
|
129
|
-
|
|
134
|
+
J as Bubble
|
|
130
135
|
};
|
|
131
136
|
//# sourceMappingURL=Bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubble.js","sources":["../../../../../src/components/BikGiftedChat/Bubble/Bubble.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { COLORS } from '../../../constants/Theme';\nimport { useWindowSize } from '../../../hooks/useWindowSize';\nimport { MESSAGE_CHANNELS } from '../GiftedChat/types';\nimport { Constants, isStringifiedArray } from '../GiftedChat/utils';\nimport { IMessage } from '../types';\nimport { BubbleProps, GiftedChatAppType } from './types';\n\nconst BubbleComponent = <TMessage extends IMessage = IMessage>(\n\tprops: BubbleProps<TMessage>,\n): React.ReactElement => {\n\tconst {\n\t\tcurrentMessage,\n\t\tposition,\n\t\trenderMessageText,\n\t\trenderTicks,\n\t\trenderTime,\n\t\trenderCustomView,\n\t\tisCustomViewBottom,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tonPress,\n\t\tcontainerStyle,\n\t\tbubbleStyles,\n\t\tappType = GiftedChatAppType.Bik,\n\t} = props;\n\n\tconst isMobile = useWindowSize();\n\tconst message = currentMessage as any;\n\tconst isManifestApp = appType === GiftedChatAppType.Manifest;\n\n\t// Check if message is a private note\n\tconst isPrivateNote = useMemo(\n\t\t() =>\n\t\t\tmessage.category === Constants.ChatActivity.Category.ACTIVITY &&\n\t\t\tmessage.activityType === Constants.ChatActivity.Type.PRIVATE_NOTE,\n\t\t[message.category, message.activityType],\n\t);\n\n\t// Check if message is a carousel (array of items)\n\tconst isCarouselMessage = useMemo(() => {\n\t\tconst [parsedSuccessfully, parsedMessage] = isStringifiedArray(\n\t\t\tmessage?.message,\n\t\t);\n\t\treturn parsedSuccessfully && parsedMessage && Array.isArray(parsedMessage);\n\t}, [message?.message]);\n\tconst isSmtp =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.SMTP ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.SMTP;\n\n\t// Generates wrapper styles for the message bubble\n\t// Handles position-based styling, channel-specific layouts, and message states\n\tconst wrapperStyles = useMemo((): React.CSSProperties => {\n\t\tconst baseStyles: React.CSSProperties = {\n\t\t\tborderRadius: 8,\n\t\t\tminHeight: 20,\n\t\t\tmargin: 0,\n\t\t\tflexGrow: isMobile ? 1 : 0,\n\t\t\twidth: '100%',\n\t\t};\n\n\t\t// Check if message is from email channels\n\t\tconst isGmail =\n\t\t\tmessage?.channelId === MESSAGE_CHANNELS.GMAIL ||\n\t\t\tmessage?.channelName === MESSAGE_CHANNELS.GMAIL;\n\n\t\tlet dynamicStyles: React.CSSProperties = {};\n\n\t\tif (isManifestApp) {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.left === 'object'\n\t\t\t\t\t\t? bubbleStyles.left\n\t\t\t\t\t\t: {};\n\t\t\t} else {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.right === 'object'\n\t\t\t\t\t\t? bubbleStyles.right\n\t\t\t\t\t\t: {};\n\t\t\t}\n\t\t\treturn { ...dynamicStyles };\n\t\t} else {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\t...(isMobile || isGmail || isSmtp ? { maxWidth: '100%' } : {}),\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tbackgroundColor: message?.isPrivateMail\n\t\t\t\t\t\t\t\t\t? COLORS.background.blue.light\n\t\t\t\t\t\t\t\t\t: COLORS.background.base,\n\t\t\t\t\t\t }),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst isUnsatisfactory =\n\t\t\t\t\tisUnsatisfactoryMessageFn &&\n\t\t\t\t\tisUnsatisfactoryMessageFn({\n\t\t\t\t\t\taiTraceId: message.eventProperties?.aiTraceId,\n\t\t\t\t\t\tmessagesGroupedByAiTraceId,\n\t\t\t\t\t});\n\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tmessage.status === 'failed' || isUnsatisfactory\n\t\t\t\t\t\t\t? COLORS.background.negative.light\n\t\t\t\t\t\t\t: COLORS.background.brandUltraLight,\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(!isMobile && isCarouselMessage ? { maxWidth: 500 } : {}),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tconst extraBubbleStyles: React.CSSProperties =\n\t\t\tbubbleStyles && typeof bubbleStyles === 'object'\n\t\t\t\t? 'left' in bubbleStyles || 'right' in bubbleStyles\n\t\t\t\t\t? position === 'left'\n\t\t\t\t\t\t? (bubbleStyles as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t\t: (bubbleStyles as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t\t: (bubbleStyles as React.CSSProperties)\n\t\t\t\t: {};\n\n\t\treturn { ...baseStyles, ...dynamicStyles, ...extraBubbleStyles };\n\t}, [\n\t\tmessage?.channelId,\n\t\tmessage?.channelName,\n\t\tmessage?.meta?.aiUsed,\n\t\tmessage?.status,\n\t\tmessage?.eventProperties?.aiTraceId,\n\t\tposition,\n\t\tisMobile,\n\t\tisPrivateNote,\n\t\tisCarouselMessage,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tmessage?.isPrivateMail,\n\t\tbubbleStyles,\n\t\tisManifestApp,\n\t]);\n\n\t// Renders the content of the message bubble\n\t// Handles custom views and message text in the correct order\n\tconst renderContent = useCallback(() => {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{!isCustomViewBottom && renderCustomView?.(props)}\n\n\t\t\t\t{renderMessageText?.(props)}\n\n\t\t\t\t{isCustomViewBottom && renderCustomView?.(props)}\n\t\t\t</div>\n\t\t);\n\t}, [isCustomViewBottom, renderCustomView, renderMessageText, props]);\n\n\tconst manifestContainerStyle = useMemo(() => {\n\t\tif (!isManifestApp || typeof containerStyle !== 'object') return {};\n\t\tif (\n\t\t\tposition === 'left' &&\n\t\t\t'left' in containerStyle &&\n\t\t\tcontainerStyle.left &&\n\t\t\ttypeof containerStyle.left === 'object'\n\t\t) {\n\t\t\treturn containerStyle.left;\n\t\t}\n\t\tif (\n\t\t\tposition === 'right' &&\n\t\t\t'right' in containerStyle &&\n\t\t\tcontainerStyle.right &&\n\t\t\ttypeof containerStyle.right === 'object'\n\t\t) {\n\t\t\treturn containerStyle.right;\n\t\t}\n\t\treturn {};\n\t}, [isManifestApp, containerStyle, position]);\n\n\tconst extraContainerStyle: React.CSSProperties =\n\t\t!isManifestApp && containerStyle && typeof containerStyle === 'object'\n\t\t\t? 'left' in containerStyle || 'right' in containerStyle\n\t\t\t\t? position === 'left'\n\t\t\t\t\t? (containerStyle as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t: (containerStyle as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t: (containerStyle as React.CSSProperties)\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tmarginTop: isManifestApp ? 0 : 6,\n\t\t\t\tmarginBottom: isManifestApp\n\t\t\t\t\t? 0\n\t\t\t\t\t: currentMessage?.['messageInformation']?.reactions?.length > 0\n\t\t\t\t\t? 24\n\t\t\t\t\t: 6,\n\t\t\t\tflexGrow: isMobile ? 1 : 0,\n\t\t\t\t...(isManifestApp\n\t\t\t\t\t? {\n\t\t\t\t\t\t\talignItems: 'flex-end',\n\t\t\t\t\t\t\t...(position === 'right' ? { cursor: 'pointer' } : {}),\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...manifestContainerStyle,\n\t\t\t\t...extraContainerStyle,\n\t\t\t}}\n\t\t\t{...(isManifestApp ? { onClick: onPress } : {})}\n\t\t>\n\t\t\t<div style={wrapperStyles}>\n\t\t\t\t<div>\n\t\t\t\t\t{/* Message content */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={\n\t\t\t\t\t\t\tcurrentMessage['chatActivityId'] ||\n\t\t\t\t\t\t\t`message-${currentMessage['psqlId']}`\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderContent()}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Message metadata (time and status) — bottom bar, time/ticks\n\t\t\t\t\t right-aligned. The 8px gap above comes from the time/ticks\n\t\t\t\t\t rows' own top padding. */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'row',\n\t\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderTime?.(props)}\n\t\t\t\t\t\t{renderTicks?.(currentMessage)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n// Export memoized version for performance\nexport const Bubble = React.memo(BubbleComponent) as typeof BubbleComponent;\n\nexport default Bubble;\n"],"names":["BubbleComponent","props","currentMessage","position","renderMessageText","renderTicks","renderTime","renderCustomView","isCustomViewBottom","isUnsatisfactoryMessageFn","messagesGroupedByAiTraceId","onPress","containerStyle","bubbleStyles","appType","GiftedChatAppType","isMobile","useWindowSize","message","isManifestApp","isPrivateNote","useMemo","Constants","isCarouselMessage","parsedSuccessfully","parsedMessage","isStringifiedArray","isSmtp","MESSAGE_CHANNELS","wrapperStyles","baseStyles","isGmail","dynamicStyles","COLORS","isUnsatisfactory","extraBubbleStyles","renderContent","useCallback","manifestContainerStyle","extraContainerStyle","jsx","jsxs","Bubble","React"],"mappings":";;;;;;;AAQA,MAAMA,IAAkB,CACvBC,MACwB;AACxB,QAAM;AAAA,IACL,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC,IAAUC,EAAkB;AAAA,EAAA,IACzBd,GAEEe,IAAWC,EAAA,GACXC,IAAUhB,GACViB,IAAgBL,MAAYC,EAAkB,UAG9CK,IAAgBC;AAAA,IACrB,MACCH,EAAQ,aAAaI,EAAU,aAAa,SAAS,YACrDJ,EAAQ,iBAAiBI,EAAU,aAAa,KAAK;AAAA,IACtD,CAACJ,EAAQ,UAAUA,EAAQ,YAAY;AAAA,EAAA,GAIlCK,IAAoBF,EAAQ,MAA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AAQ,CAAA,IAC1DA,EAAmD,SAAS,KAC7DA,IACF,CAAA;AAEJ,SACC,gBAAA4B;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,OAAO;AAAA,QACN,SAAS;AAAA,QACT,WAAWrB,IAAgB,IAAI;AAAA,QAC/B,cAAcA,IACX,IACAjB,GAAiB,oBAAuB,WAAW,SAAS,IAC5D,KACA;AAAA,QACH,UAAUc,IAAW,IAAI;AAAA,QACzB,GAAIG,IACD;AAAA,UACA,YAAY;AAAA,UACZ,GAAIhB,MAAa,UAAU,EAAE,QAAQ,UAAA,IAAc,CAAA;AAAA,QAAC,IAEpD,CAAA;AAAA,QACH,GAAGmC;AAAA,QACH,GAAGC;AAAA,MAAA;AAAA,MAEH,GAAIpB,IAAgB,EAAE,SAASR,EAAA,IAAY,CAAA;AAAA,MAE5C,UAAA,gBAAA6B,EAAC,OAAA,EAAI,OAAOX,GACX,4BAAC,OAAA,EAEA,UAAA;AAAA,QAAA,gBAAAW;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,IACCtC,EAAe,kBACf,WAAWA,EAAe,MAAS;AAAA,YAGnC,UAAAkC,EAAA;AAAA,UAAc;AAAA,QAAA;AAAA,QAMhB,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,OAAO;AAAA,cACN,SAAS;AAAA,cACT,eAAe;AAAA,cACf,gBAAgB;AAAA,YAAA;AAAA,YAGhB,UAAA;AAAA,cAAAnC,IAAaL,CAAK;AAAA,cAClBI,IAAcH,CAAc;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B,EAAA,CACD,EAAA,CACD;AAAA,IAAA;AAAA,EAAA;AAGH,GAGawC,IAASC,EAAM,KAAK3C,CAAe;"}
|
|
1
|
+
{"version":3,"file":"Bubble.js","sources":["../../../../../src/components/BikGiftedChat/Bubble/Bubble.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { COLORS } from '../../../constants/Theme';\nimport { useWindowSize } from '../../../hooks/useWindowSize';\nimport { MESSAGE_CHANNELS } from '../GiftedChat/types';\nimport { Constants, isStringifiedArray } from '../GiftedChat/utils';\nimport { IMessage } from '../types';\nimport { BubbleProps, GiftedChatAppType } from './types';\n\nconst BubbleComponent = <TMessage extends IMessage = IMessage>(\n\tprops: BubbleProps<TMessage>,\n): React.ReactElement => {\n\tconst {\n\t\tcurrentMessage,\n\t\tposition,\n\t\trenderMessageText,\n\t\trenderTicks,\n\t\trenderTime,\n\t\trenderCustomView,\n\t\tisCustomViewBottom,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tonPress,\n\t\tcontainerStyle,\n\t\tbubbleStyles,\n\t\tappType = GiftedChatAppType.Bik,\n\t} = props;\n\n\tconst isMobile = useWindowSize();\n\tconst message = currentMessage as any;\n\tconst isManifestApp = appType === GiftedChatAppType.Manifest;\n\n\t// Check if message is a private note\n\tconst isPrivateNote = useMemo(\n\t\t() =>\n\t\t\tmessage.category === Constants.ChatActivity.Category.ACTIVITY &&\n\t\t\tmessage.activityType === Constants.ChatActivity.Type.PRIVATE_NOTE,\n\t\t[message.category, message.activityType],\n\t);\n\n\t// Check if message is a carousel (array of items)\n\tconst isCarouselMessage = useMemo(() => {\n\t\tconst [parsedSuccessfully, parsedMessage] = isStringifiedArray(\n\t\t\tmessage?.message,\n\t\t);\n\t\treturn parsedSuccessfully && parsedMessage && Array.isArray(parsedMessage);\n\t}, [message?.message]);\n\tconst isSmtp =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.SMTP ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.SMTP;\n\tconst isGmail =\n\t\tmessage?.channelId === MESSAGE_CHANNELS.GMAIL ||\n\t\tmessage?.channelName === MESSAGE_CHANNELS.GMAIL;\n\n\t// CRM-4796/4797: on mobile, regular chat bubbles hug their content so the\n\t// agent(right)/customer(left) alignment and the bottom-right time are\n\t// visible. Email (SMTP/Gmail) bubbles are excluded — they stay full-width\n\t// and left-aligned with the time shown in the mail header.\n\tconst hugContentOnMobile = isMobile && !isManifestApp && !isSmtp && !isGmail;\n\n\t// Generates wrapper styles for the message bubble\n\t// Handles position-based styling, channel-specific layouts, and message states\n\tconst wrapperStyles = useMemo((): React.CSSProperties => {\n\t\tconst baseStyles: React.CSSProperties = {\n\t\t\tborderRadius: 8,\n\t\t\tminHeight: 20,\n\t\t\tmargin: 0,\n\t\t\tflexGrow: hugContentOnMobile ? 0 : isMobile ? 1 : 0,\n\t\t\twidth: '100%',\n\t\t};\n\n\t\tlet dynamicStyles: React.CSSProperties = {};\n\n\t\tif (isManifestApp) {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.left === 'object'\n\t\t\t\t\t\t? bubbleStyles.left\n\t\t\t\t\t\t: {};\n\t\t\t} else {\n\t\t\t\tdynamicStyles =\n\t\t\t\t\tbubbleStyles && typeof bubbleStyles.right === 'object'\n\t\t\t\t\t\t? bubbleStyles.right\n\t\t\t\t\t\t: {};\n\t\t\t}\n\t\t\treturn { ...dynamicStyles };\n\t\t} else {\n\t\t\tif (position === 'left') {\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\t// CRM-4796: non-email mobile bubbles hug content (no full-width),\n\t\t\t\t\t// so only email/desktop-email keep maxWidth 100%.\n\t\t\t\t\t...(isGmail || isSmtp ? { maxWidth: '100%' } : {}),\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tbackgroundColor: message?.isPrivateMail\n\t\t\t\t\t\t\t\t\t? COLORS.background.blue.light\n\t\t\t\t\t\t\t\t\t: COLORS.background.base,\n\t\t\t\t\t\t }),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst isUnsatisfactory =\n\t\t\t\t\tisUnsatisfactoryMessageFn &&\n\t\t\t\t\tisUnsatisfactoryMessageFn({\n\t\t\t\t\t\taiTraceId: message.eventProperties?.aiTraceId,\n\t\t\t\t\t\tmessagesGroupedByAiTraceId,\n\t\t\t\t\t});\n\n\t\t\t\tdynamicStyles = {\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tmessage.status === 'failed' || isUnsatisfactory\n\t\t\t\t\t\t\t? COLORS.background.negative.light\n\t\t\t\t\t\t\t: COLORS.background.brandUltraLight,\n\t\t\t\t\t...(isPrivateNote\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tbackground: COLORS.background.warning.light,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(!isMobile && isCarouselMessage ? { maxWidth: 500 } : {}),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tconst extraBubbleStyles: React.CSSProperties =\n\t\t\tbubbleStyles && typeof bubbleStyles === 'object'\n\t\t\t\t? 'left' in bubbleStyles || 'right' in bubbleStyles\n\t\t\t\t\t? position === 'left'\n\t\t\t\t\t\t? (bubbleStyles as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t\t: (bubbleStyles as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t\t: (bubbleStyles as React.CSSProperties)\n\t\t\t\t: {};\n\n\t\treturn { ...baseStyles, ...dynamicStyles, ...extraBubbleStyles };\n\t}, [\n\t\tmessage?.channelId,\n\t\tmessage?.channelName,\n\t\tmessage?.meta?.aiUsed,\n\t\tmessage?.status,\n\t\tmessage?.eventProperties?.aiTraceId,\n\t\tposition,\n\t\tisMobile,\n\t\tisPrivateNote,\n\t\tisCarouselMessage,\n\t\tisUnsatisfactoryMessageFn,\n\t\tmessagesGroupedByAiTraceId,\n\t\tmessage?.isPrivateMail,\n\t\tbubbleStyles,\n\t\tisManifestApp,\n\t\thugContentOnMobile,\n\t\tisSmtp,\n\t\tisGmail,\n\t]);\n\n\t// Renders the content of the message bubble\n\t// Handles custom views and message text in the correct order\n\tconst renderContent = useCallback(() => {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{!isCustomViewBottom && renderCustomView?.(props)}\n\n\t\t\t\t{renderMessageText?.(props)}\n\n\t\t\t\t{isCustomViewBottom && renderCustomView?.(props)}\n\t\t\t</div>\n\t\t);\n\t}, [isCustomViewBottom, renderCustomView, renderMessageText, props]);\n\n\tconst manifestContainerStyle = useMemo(() => {\n\t\tif (!isManifestApp || typeof containerStyle !== 'object') return {};\n\t\tif (\n\t\t\tposition === 'left' &&\n\t\t\t'left' in containerStyle &&\n\t\t\tcontainerStyle.left &&\n\t\t\ttypeof containerStyle.left === 'object'\n\t\t) {\n\t\t\treturn containerStyle.left;\n\t\t}\n\t\tif (\n\t\t\tposition === 'right' &&\n\t\t\t'right' in containerStyle &&\n\t\t\tcontainerStyle.right &&\n\t\t\ttypeof containerStyle.right === 'object'\n\t\t) {\n\t\t\treturn containerStyle.right;\n\t\t}\n\t\treturn {};\n\t}, [isManifestApp, containerStyle, position]);\n\n\tconst extraContainerStyle: React.CSSProperties =\n\t\t!isManifestApp && containerStyle && typeof containerStyle === 'object'\n\t\t\t? 'left' in containerStyle || 'right' in containerStyle\n\t\t\t\t? position === 'left'\n\t\t\t\t\t? (containerStyle as { left?: React.CSSProperties }).left ?? {}\n\t\t\t\t\t: (containerStyle as { right?: React.CSSProperties }).right ?? {}\n\t\t\t\t: (containerStyle as React.CSSProperties)\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tmarginTop: isManifestApp ? 0 : 6,\n\t\t\t\tmarginBottom: isManifestApp\n\t\t\t\t\t? 0\n\t\t\t\t\t: currentMessage?.['messageInformation']?.reactions?.length > 0\n\t\t\t\t\t? 24\n\t\t\t\t\t: 6,\n\t\t\t\tflexGrow: hugContentOnMobile ? 0 : isMobile ? 1 : 0,\n\t\t\t\t...(isManifestApp\n\t\t\t\t\t? {\n\t\t\t\t\t\t\talignItems: 'flex-end',\n\t\t\t\t\t\t\t...(position === 'right' ? { cursor: 'pointer' } : {}),\n\t\t\t\t\t }\n\t\t\t\t\t: {}),\n\t\t\t\t...manifestContainerStyle,\n\t\t\t\t...extraContainerStyle,\n\t\t\t}}\n\t\t\t{...(isManifestApp ? { onClick: onPress } : {})}\n\t\t>\n\t\t\t<div style={wrapperStyles}>\n\t\t\t\t<div>\n\t\t\t\t\t{/* Message content */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={\n\t\t\t\t\t\t\tcurrentMessage['chatActivityId'] ||\n\t\t\t\t\t\t\t`message-${currentMessage['psqlId']}`\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderContent()}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Message metadata (time and status) — bottom bar, time/ticks\n\t\t\t\t\t right-aligned. The 8px gap above comes from the time/ticks\n\t\t\t\t\t rows' own top padding. */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'row',\n\t\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderTime?.(props)}\n\t\t\t\t\t\t{renderTicks?.(currentMessage)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n// Export memoized version for performance\nexport const Bubble = React.memo(BubbleComponent) as typeof BubbleComponent;\n\nexport default Bubble;\n"],"names":["BubbleComponent","props","currentMessage","position","renderMessageText","renderTicks","renderTime","renderCustomView","isCustomViewBottom","isUnsatisfactoryMessageFn","messagesGroupedByAiTraceId","onPress","containerStyle","bubbleStyles","appType","GiftedChatAppType","isMobile","useWindowSize","message","isManifestApp","isPrivateNote","useMemo","Constants","isCarouselMessage","parsedSuccessfully","parsedMessage","isStringifiedArray","isSmtp","MESSAGE_CHANNELS","isGmail","hugContentOnMobile","wrapperStyles","baseStyles","dynamicStyles","COLORS","isUnsatisfactory","extraBubbleStyles","renderContent","useCallback","manifestContainerStyle","extraContainerStyle","jsx","jsxs","Bubble","React"],"mappings":";;;;;;;AAQA,MAAMA,IAAkB,CACvBC,MACwB;AACxB,QAAM;AAAA,IACL,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC,IAAUC,EAAkB;AAAA,EAAA,IACzBd,GAEEe,IAAWC,EAAA,GACXC,IAAUhB,GACViB,IAAgBL,MAAYC,EAAkB,UAG9CK,IAAgBC;AAAA,IACrB,MACCH,EAAQ,aAAaI,EAAU,aAAa,SAAS,YACrDJ,EAAQ,iBAAiBI,EAAU,aAAa,KAAK;AAAA,IACtD,CAACJ,EAAQ,UAAUA,EAAQ,YAAY;AAAA,EAAA,GAIlCK,IAAoBF,EAAQ,MAAM;AACvC,UAAM,CAACG,GAAoBC,CAAa,IAAIC;AAAA,MAC3CR,GAAS;AAAA,IAAA;AAEV,WAAOM,KAAsBC,KAAiB,MAAM,QAAQA,CAAa;AAAA,EAC1E,GAAG,CAACP,GAAS,OAAO,CAAC,GACfS,IACLT,GAAS,cAAcU,EAAiB,QACxCV,GAAS,gBAAgBU,EAAiB,MACrCC,IACLX,GAAS,cAAcU,EAAiB,SACxCV,GAAS,gBAAgBU,EAAiB,OAMrCE,IAAqBd,KAAY,CAACG,KAAiB,CAACQ,KAAU,CAACE,GAI/DE,IAAgBV,EAAQ,MAA2B;AACxD,UAAMW,IAAkC;AAAA,MACvC,cAAc;AAAA,MACd,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,UAAUF,IAAqB,IAAId,IAAW,IAAI;AAAA,MAClD,OAAO;AAAA,IAAA;AAGR,QAAIi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oC;AAAA,QACH,GAAGC;AAAA,MAAA;AAAA,MAEH,GAAIrB,IAAgB,EAAE,SAASR,EAAA,IAAY,CAAA;AAAA,MAE5C,UAAA,gBAAA8B,EAAC,OAAA,EAAI,OAAOV,GACX,4BAAC,OAAA,EAEA,UAAA;AAAA,QAAA,gBAAAU;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,IACCvC,EAAe,kBACf,WAAWA,EAAe,MAAS;AAAA,YAGnC,UAAAmC,EAAA;AAAA,UAAc;AAAA,QAAA;AAAA,QAMhB,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,OAAO;AAAA,cACN,SAAS;AAAA,cACT,eAAe;AAAA,cACf,gBAAgB;AAAA,YAAA;AAAA,YAGhB,UAAA;AAAA,cAAApC,IAAaL,CAAK;AAAA,cAClBI,IAAcH,CAAc;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B,EAAA,CACD,EAAA,CACD;AAAA,IAAA;AAAA,EAAA;AAGH,GAGayC,IAASC,EAAM,KAAK5C,CAAe;"}
|
|
@@ -52,6 +52,18 @@ const a = r.div`
|
|
|
52
52
|
height: 0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/* CRM-4814: hidden in-flow copy of the placeholder so a multi-line
|
|
56
|
+
placeholder grows the editor instead of showing a scrollbar (the
|
|
57
|
+
zero-height float above adds no height). -1lh cancels the caret line. */
|
|
58
|
+
p.is-editor-empty:first-child::after {
|
|
59
|
+
content: attr(data-placeholder);
|
|
60
|
+
display: block;
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
margin-top: -1.5em; /* one line at the editor's line-height: 1.5 */
|
|
64
|
+
margin-top: -1lh;
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/* Characters pasted beyond the soft character limit — rendered grey so the
|
|
56
68
|
overflow is visible but clearly marked (see CharacterLimitExtension). */
|
|
57
69
|
.bik-editor-overflow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\t/* The empty placeholder paragraph shouldn't inherit the rich-mode 1em\n\t\t block margin (email/SMTP/signature) — otherwise the placeholder text\n\t\t is pushed down. Real (non-empty) paragraphs keep their spacing. */\n\t\tp.is-editor-empty:first-child {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\n\t\t/* Characters pasted beyond the soft character limit — rendered grey so the\n\t\t overflow is visible but clearly marked (see CharacterLimitExtension). */\n\t\t.bik-editor-overflow {\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHeight","maxHeight","tightParagraphs","COLORS","jsonMode","css","BikJsonHeader","BikJsonError"],"mappings":";;AAGO,MAAMA,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUrB,CAAC,EAAE,WAAAC,QAAgBA,KAAa,MAAM;AAAA,gBACtC,CAAC,EAAE,WAAAC,QAAgBA,KAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAiBzC,CAAC,EAAE,iBAAAC,EAAA,MAAuBA,IAAkB,MAAM,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\t/* The empty placeholder paragraph shouldn't inherit the rich-mode 1em\n\t\t block margin (email/SMTP/signature) — otherwise the placeholder text\n\t\t is pushed down. Real (non-empty) paragraphs keep their spacing. */\n\t\tp.is-editor-empty:first-child {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\n\t\t/* CRM-4814: hidden in-flow copy of the placeholder so a multi-line\n\t\t placeholder grows the editor instead of showing a scrollbar (the\n\t\t zero-height float above adds no height). -1lh cancels the caret line. */\n\t\tp.is-editor-empty:first-child::after {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tdisplay: block;\n\t\t\tvisibility: hidden;\n\t\t\tpointer-events: none;\n\t\t\tmargin-top: -1.5em; /* one line at the editor's line-height: 1.5 */\n\t\t\tmargin-top: -1lh;\n\t\t}\n\n\t\t/* Characters pasted beyond the soft character limit — rendered grey so the\n\t\t overflow is visible but clearly marked (see CharacterLimitExtension). */\n\t\t.bik-editor-overflow {\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHe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