@bikdotai/bik-component-library 0.0.809-beta.17 → 0.0.809-beta.19

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.
Files changed (105) hide show
  1. package/dist/cjs/components/list-item/themes.js +1 -1
  2. package/dist/cjs/components/list-item/themes.js.map +1 -1
  3. package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
  4. package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
  5. package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -1
  6. package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js.map +1 -1
  7. package/dist/cjs/components/variable-picker-v3/context.js +1 -1
  8. package/dist/cjs/components/variable-picker-v3/context.js.map +1 -1
  9. package/dist/cjs/editor/BikEditor.js +1 -1
  10. package/dist/cjs/editor/BikEditor.js.map +1 -1
  11. package/dist/cjs/editor/BikEditor.styles.js +3 -13
  12. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  13. package/dist/cjs/editor/BikEditor.types.js.map +1 -1
  14. package/dist/cjs/editor/BikEditor.utils.js +1 -1
  15. package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
  16. package/dist/cjs/editor/extensions/buildExtensions.js +1 -1
  17. package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
  18. package/dist/cjs/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js +2 -0
  19. package/dist/cjs/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js.map +1 -0
  20. package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js +2 -0
  21. package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +1 -0
  22. package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js +1 -1
  23. package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
  24. package/dist/cjs/src/components/variable-picker-v3/context.d.ts +4 -0
  25. package/dist/cjs/src/editor/BikEditor.styles.d.ts +0 -1
  26. package/dist/cjs/src/editor/BikEditor.types.d.ts +0 -2
  27. package/dist/cjs/src/editor/BikEditor.utils.d.ts +4 -8
  28. package/dist/cjs/src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.d.ts +7 -0
  29. package/dist/cjs/src/editor/extensions/plainClipboard/PlainClipboardExtension.d.ts +2 -0
  30. package/dist/cjs/src/editor/extensions/plainClipboard/pasteUtils.d.ts +8 -40
  31. package/dist/cjs/src/icons/Actions/Common actions/SendAirplane2.d.ts +7 -0
  32. package/dist/cjs/src/icons/BIK AI specific/AiAgent.d.ts +7 -0
  33. package/dist/cjs/src/icons/Informational/Communication/AtSymbol.d.ts +7 -0
  34. package/dist/cjs/src/icons/Informational/Communication/Hangup.d.ts +7 -0
  35. package/dist/cjs/src/icons/Informational/Communication/IncomingCall.d.ts +7 -0
  36. package/dist/cjs/src/icons/Informational/Communication/OutgoingCall.d.ts +7 -0
  37. package/dist/cjs/src/icons/Informational/Communication/PhoneCall.d.ts +7 -0
  38. package/dist/cjs/src/icons/Informational/Communication/Transcript.d.ts +7 -0
  39. package/dist/cjs/src/icons/Informational/Files and folders/BookOpen.d.ts +7 -0
  40. package/dist/cjs/src/icons/Informational/Identity/AiVoiceAgent.d.ts +7 -0
  41. package/dist/cjs/src/icons/Social/Channels/Subdued/FbCommentTicket.d.ts +6 -0
  42. package/dist/cjs/src/icons/Social/Channels/Subdued/FbTicket.d.ts +6 -0
  43. package/dist/cjs/src/icons/Social/Channels/Subdued/IgCommentTicket.d.ts +6 -0
  44. package/dist/cjs/src/icons/Social/Channels/Subdued/IgTicket.d.ts +6 -0
  45. package/dist/cjs/src/icons/Social/Channels/Subdued/MailTicket.d.ts +6 -0
  46. package/dist/cjs/src/icons/Social/Channels/Subdued/PhoneTicket.d.ts +6 -0
  47. package/dist/cjs/src/icons/Social/Channels/Subdued/TaskTicket.d.ts +6 -0
  48. package/dist/cjs/src/icons/Social/Channels/Subdued/WhatsappTicket.d.ts +6 -0
  49. package/dist/cjs/src/icons/Social/Channels/Subdued/index.d.ts +8 -0
  50. package/dist/esm/components/list-item/themes.js +1 -1
  51. package/dist/esm/components/list-item/themes.js.map +1 -1
  52. package/dist/esm/components/variable-picker-v3/Content.js +1 -1
  53. package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
  54. package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -1
  55. package/dist/esm/components/variable-picker-v3/SubHeaderItems.js.map +1 -1
  56. package/dist/esm/components/variable-picker-v3/context.js +1 -1
  57. package/dist/esm/components/variable-picker-v3/context.js.map +1 -1
  58. package/dist/esm/editor/BikEditor.js +1 -1
  59. package/dist/esm/editor/BikEditor.js.map +1 -1
  60. package/dist/esm/editor/BikEditor.styles.js +7 -17
  61. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  62. package/dist/esm/editor/BikEditor.types.js.map +1 -1
  63. package/dist/esm/editor/BikEditor.utils.js +1 -1
  64. package/dist/esm/editor/BikEditor.utils.js.map +1 -1
  65. package/dist/esm/editor/extensions/buildExtensions.js +1 -1
  66. package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
  67. package/dist/esm/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js +2 -0
  68. package/dist/esm/editor/extensions/plainClipboard/ClipboardNormalizationExtension.js.map +1 -0
  69. package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js +2 -0
  70. package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +1 -0
  71. package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js +1 -1
  72. package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
  73. package/dist/esm/src/components/variable-picker-v3/context.d.ts +4 -0
  74. package/dist/esm/src/editor/BikEditor.styles.d.ts +0 -1
  75. package/dist/esm/src/editor/BikEditor.types.d.ts +0 -2
  76. package/dist/esm/src/editor/BikEditor.utils.d.ts +4 -8
  77. package/dist/esm/src/editor/extensions/plainClipboard/ClipboardNormalizationExtension.d.ts +7 -0
  78. package/dist/esm/src/editor/extensions/plainClipboard/PlainClipboardExtension.d.ts +2 -0
  79. package/dist/esm/src/editor/extensions/plainClipboard/pasteUtils.d.ts +8 -40
  80. package/dist/esm/src/icons/Actions/Common actions/SendAirplane2.d.ts +7 -0
  81. package/dist/esm/src/icons/BIK AI specific/AiAgent.d.ts +7 -0
  82. package/dist/esm/src/icons/Informational/Communication/AtSymbol.d.ts +7 -0
  83. package/dist/esm/src/icons/Informational/Communication/Hangup.d.ts +7 -0
  84. package/dist/esm/src/icons/Informational/Communication/IncomingCall.d.ts +7 -0
  85. package/dist/esm/src/icons/Informational/Communication/OutgoingCall.d.ts +7 -0
  86. package/dist/esm/src/icons/Informational/Communication/PhoneCall.d.ts +7 -0
  87. package/dist/esm/src/icons/Informational/Communication/Transcript.d.ts +7 -0
  88. package/dist/esm/src/icons/Informational/Files and folders/BookOpen.d.ts +7 -0
  89. package/dist/esm/src/icons/Informational/Identity/AiVoiceAgent.d.ts +7 -0
  90. package/dist/esm/src/icons/Social/Channels/Subdued/FbCommentTicket.d.ts +6 -0
  91. package/dist/esm/src/icons/Social/Channels/Subdued/FbTicket.d.ts +6 -0
  92. package/dist/esm/src/icons/Social/Channels/Subdued/IgCommentTicket.d.ts +6 -0
  93. package/dist/esm/src/icons/Social/Channels/Subdued/IgTicket.d.ts +6 -0
  94. package/dist/esm/src/icons/Social/Channels/Subdued/MailTicket.d.ts +6 -0
  95. package/dist/esm/src/icons/Social/Channels/Subdued/PhoneTicket.d.ts +6 -0
  96. package/dist/esm/src/icons/Social/Channels/Subdued/TaskTicket.d.ts +6 -0
  97. package/dist/esm/src/icons/Social/Channels/Subdued/WhatsappTicket.d.ts +6 -0
  98. package/dist/esm/src/icons/Social/Channels/Subdued/index.d.ts +8 -0
  99. package/package.json +1 -1
  100. package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js +0 -2
  101. package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +0 -1
  102. package/dist/cjs/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +0 -13
  103. package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js +0 -2
  104. package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +0 -1
  105. package/dist/esm/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +0 -13
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as i,Fragment as o}from"react/jsx-runtime";import s from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/cross.svg.js";import a from"../../assets/icons/plus.svg.js";import r from"../../assets/icons/triangle_error.svg.js";import{useState as n,useEffect as c}from"react";import{COLORS as d}from"../../constants/Theme.js";import{BikAccordion as h}from"../accordion/Accordion.js";import{IconButton as p}from"../icon-button/IconButton.js";import{Input as m}from"../input/Input.js";import{ListItem as u}from"../list-item/ListItem.js";import{Switch as g}from"../switch/Switch.js";import{Tooltip as b}from"../tooltips/Tooltip.js";import{TitleRegular as f,BodySecondary as y,BodyCaption as v,TitleSmall as j}from"../TypographyStyle.js";import{VariablePickerContext as x}from"./context.js";import{DefaultVariableContent as O}from"./DefaultVariableContent.js";import{highlightSearchText as S}from"./highlightSearchText.js";import{PickerType as k}from"./model.js";import w from"./NoResult.js";import{showOnlyRecommendedVariables as V}from"./recommendVaribles.js";import{searchVariables as C}from"./searchVariables.js";import{HeaderWrapper as T,RecommendWrapper as I,BackHeader as N,Container as B}from"./styles.js";import D,{renderTooltipBody as R}from"./SubHeaderItems.js";const E=/.*\..*/,H=H=>{const{data:L,onSelect:$,showHeader:P,showBackButton:_,hideHeaderCross:A,onBackButtonClick:z,isEvaluationList:F,autoOpenFirst:K,headerText:M,contentHeight:q,onDefaultVariableSelect:G,skipDefaultVariableContent:J}=H,[Q,U]=n(L),[W,X]=n(""),[Y,Z]=n([]),[ee,te]=n(""),[ie,oe]=n(!1),[se,le]=n([]),[ae,re]=n(!1),[ne,ce]=n(),de=ae&&H.type===k.EMBEDDED&&!A;c((()=>{he(!0)}),[]),c((()=>{Y.length>0?le([Y[Y.length-1]]):le(L)}),[Y]);const he=t=>e(void 0,void 0,void 0,(function*(){if(oe(t),t){const e=V(Q,Y);U(e)}else if(Y.length>0){const e=ee==Y[Y.length-1].displayName;if(W.length>0&&e){const e=C(W,se,Y);U(e)}else U([Y[Y.length-1].variables])}else if(W.length>0){const e=C(W,se,Y);U(e)}else U(L)})),pe=()=>{if(q)return q;let e=131;return Y.length>0&&(e+=32),(H.showHeader||H.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},me=e=>{if(!H.disabled)if(F){const t=(e=>{if(e.actualValue.match(E)){const t=e.actualValue.replace("{{","").replace("}}","").split(".");let i=t[0];return t.forEach(((e,t)=>{if(0===t)return;const o=(e=>/\w+\[\d+\]/g.test(e))(e);if(o){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const e=t[1],o=t[2];i+=`['${e}'][${o}]`}}else i+=`['${e}']`})),i}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);$(Object.assign(Object.assign({},e),{actualValue:t}))}else{if(e.isDefaultValueSupported&&!J)return ce(e),void re(!0);$(e)}};return t(x.Provider,Object.assign({value:{variables:Q,searchText:W,subHeaderStack:Y,showRecommended:ie,setSubHeaderStack:Z,setSearchText:X,setVariables:U,setShowRecommended:oe}},{children:i("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:8,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(P||_||ae)&&i(T,Object.assign({openDefault:ae},{children:[i("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(_||ae)&&t(p,{Icon:()=>t(s,{width:16,height:16,style:{display:"flex",color:d.content.primary}}),onClick:()=>{ae?re(!1):z&&z()}}),(P||ae)&&t(f,{children:ae?"Set up":null!=M?M:"Select Variable"})]})),de&&t(p,{style:{color:"#212121"},Icon:l,onClick:()=>H.onClose&&H.onClose()})]})),ae&&ne&&!J?t(O,{variable:ne,onInsertVariable:e=>{$(e),null==G||G(e)}}):i(o,{children:[t("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:d.surface.subdued,borderTopLeftRadius:8,borderTopRightRadius:8}},{children:t(m,{id:"search-bar-v3-picker",onBlur:e=>{H.onSearchBlur&&H.onSearchBlur(e)},value:W,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||te("");const t=C(e,se,Y);if(ie){const e=V(t,Y);U(e)}else U(t);X(e);const i=Y.length>0?Y[Y.length-1].displayName:"home";te(i)}})})),i(I,{children:[t(y,Object.assign({style:{color:d.content.secondary}},{children:"Only Recommended"})),t(g,{value:ie,onValueChange:t=>e(void 0,void 0,void 0,(function*(){yield he(t)}))})]}),Y.length>0&&i(N,{children:[t("div",Object.assign({style:{position:"absolute",left:16}},{children:t(p,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>t(s,{width:12,height:12,style:{color:d.content.secondary}}),onClick:e=>{e.stopPropagation();let t=W;const i=[...Y],o=i.pop();if(Z(i),o.displayName===ee&&(X(""),t=""),t.length>0){const e=i.length>0?[i[i.length-1]]:L,o=C(t,e,i);if(ie){const e=V(o,i);U(e)}else U(o)}else if(i.length>0)if(ie){const e=V([i[i.length-1].variables],i);U(e)}else U([i[i.length-1].variables]);else if(ie){const e=V(L,Y);U(e)}else U(L)}})})),t(v,Object.assign({style:{color:d.content.secondary}},{children:Y[Y.length-1].displayName}))]}),t(o,{children:Q.length>0?t(B,Object.assign({height:pe()},{children:Q.map(((e,s)=>{var l,n;return e.displayName&&void 0!==e.variables?t("div",Object.assign({style:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:t(h,Object.assign({arrowColor:d.content.primary,autoOpen:K&&0===s,headerPadding:"12px 16px",header:t(j,Object.assign({style:{color:d.content.secondary}},{children:S(e.displayName,W)}))},{children:t(D,{parentVariable:e,disabled:null!==(l=H.disabled)&&void 0!==l&&l,searchText:W,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported&&!J)return ce(e),void re(!0);$(e)}})}))}),e.displayName+ie):e.displayName?t(b,Object.assign({body:R(e),placement:"bottom"},{children:t(u,{variant:H.disabled?"readonly":(null==e?void 0:e.selected)?"selected":"default",version:"2.0",leadingIcon:(null==e?void 0:e.selected)||H.disabled?t(o,{}):t("div",Object.assign({style:{flexShrink:0}},{children:t(a,{width:14,height:14})})),customListItemLabel:i("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(y,Object.assign({style:{fontSize:"14px",color:d.text.primary}},{children:S(e.displayName,W)})),!e.isAvailable&&t(b,Object.assign({body:"Not Recommended"},{children:t("div",Object.assign({style:{display:"flex",marginTop:2}},{children:t(r,{width:16,height:16,color:d.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>me(e)},s)}),s):t(D,{disabled:null!==(n=H.disabled)&&void 0!==n&&n,searchText:W,variable:e,onSelect:e=>me(e)},s)}))})):t(w,{height:pe(),searchText:W})})]})]}))}))};export{H as VariablePickerContent};
1
+ import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as o,Fragment as i}from"react/jsx-runtime";import s from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/cross.svg.js";import a from"../../assets/icons/plus.svg.js";import r from"../../assets/icons/triangle_error.svg.js";import{useState as n,useRef as c,useEffect as d}from"react";import{flushSync as h}from"react-dom";import{COLORS as p}from"../../constants/Theme.js";import{BikAccordion as m}from"../accordion/Accordion.js";import{IconButton as u}from"../icon-button/IconButton.js";import{Input as b}from"../input/Input.js";import{ListItem as g}from"../list-item/ListItem.js";import{Switch as f}from"../switch/Switch.js";import{Tooltip as v}from"../tooltips/Tooltip.js";import{TitleRegular as y,BodySecondary as j,BodyCaption as x,TitleSmall as O}from"../TypographyStyle.js";import{VariablePickerContext as S}from"./context.js";import{DefaultVariableContent as k}from"./DefaultVariableContent.js";import{highlightSearchText as w}from"./highlightSearchText.js";import{PickerType as T}from"./model.js";import V from"./NoResult.js";import{showOnlyRecommendedVariables as C}from"./recommendVaribles.js";import{searchVariables as N}from"./searchVariables.js";import{HeaderWrapper as I,RecommendWrapper as B,BackHeader as D,Container as R}from"./styles.js";import E,{renderTooltipBody as H}from"./SubHeaderItems.js";const L=/.*\..*/,P=P=>{const{data:$,onSelect:_,showHeader:A,showBackButton:z,hideHeaderCross:F,onBackButtonClick:K,isEvaluationList:M,autoOpenFirst:q,headerText:G,contentHeight:J,onDefaultVariableSelect:Q,skipDefaultVariableContent:U}=P,[W,X]=n($),[Y,Z]=n(""),[ee,te]=n([]),[oe,ie]=n(""),[se,le]=n(!1),[ae,re]=n([]),[ne,ce]=n(!1),[de,he]=n(),pe=c(null),me=c([]),ue=ne&&P.type===T.EMBEDDED&&!F;d((()=>{be(!0)}),[]),d((()=>{ee.length>0?re([ee[ee.length-1]]):re($)}),[ee]);const be=t=>e(void 0,void 0,void 0,(function*(){if(le(t),t){const e=C(W,ee);X(e)}else if(ee.length>0){const e=oe==ee[ee.length-1].displayName;if(Y.length>0&&e){const e=N(Y,ae,ee);X(e)}else X([ee[ee.length-1].variables])}else if(Y.length>0){const e=N(Y,ae,ee);X(e)}else X($)})),ge=()=>{if(J)return J;let e=131;return ee.length>0&&(e+=32),(P.showHeader||P.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},fe=e=>{if(!P.disabled)if(M){const t=(e=>{if(e.actualValue.match(L)){const t=e.actualValue.replace("{{","").replace("}}","").split(".");let o=t[0];return t.forEach(((e,t)=>{if(0===t)return;const i=(e=>/\w+\[\d+\]/g.test(e))(e);if(i){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const e=t[1],i=t[2];o+=`['${e}'][${i}]`}}else o+=`['${e}']`})),o}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);_(Object.assign(Object.assign({},e),{actualValue:t}))}else{if(e.isDefaultValueSupported&&!U)return he(e),void ce(!0);_(e)}};return t(S.Provider,Object.assign({value:{variables:W,searchText:Y,subHeaderStack:ee,showRecommended:se,setSubHeaderStack:te,setSearchText:Z,setVariables:X,setShowRecommended:le,containerRef:pe,scrollPositionStack:me}},{children:o("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:8,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(A||z||ne)&&o(I,Object.assign({openDefault:ne},{children:[o("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(z||ne)&&t(u,{Icon:()=>t(s,{width:16,height:16,style:{display:"flex",color:p.content.primary}}),onClick:()=>{ne?ce(!1):K&&K()}}),(A||ne)&&t(y,{children:ne?"Set up":null!=G?G:"Select Variable"})]})),ue&&t(u,{style:{color:"#212121"},Icon:l,onClick:()=>P.onClose&&P.onClose()})]})),ne&&de&&!U?t(k,{variable:de,onInsertVariable:e=>{_(e),null==Q||Q(e)}}):o(i,{children:[t("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:p.surface.subdued,borderTopLeftRadius:8,borderTopRightRadius:8}},{children:t(b,{id:"search-bar-v3-picker",onBlur:e=>{P.onSearchBlur&&P.onSearchBlur(e)},value:Y,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||ie("");const t=N(e,ae,ee);if(se){const e=C(t,ee);X(e)}else X(t);Z(e);const o=ee.length>0?ee[ee.length-1].displayName:"home";ie(o)}})})),o(B,{children:[t(j,Object.assign({style:{color:p.content.secondary}},{children:"Only Recommended"})),t(f,{value:se,onValueChange:t=>e(void 0,void 0,void 0,(function*(){yield be(t)}))})]}),ee.length>0&&o(D,{children:[t("div",Object.assign({style:{position:"absolute",left:16}},{children:t(u,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>t(s,{width:12,height:12,style:{color:p.content.secondary}}),onClick:e=>{var t;e.stopPropagation();let o=Y;const i=[...ee],s=i.pop();s.displayName===oe&&(o="");const l=null!==(t=me.current.pop())&&void 0!==t?t:0;if(h((()=>{if(te(i),s.displayName===oe&&Z(""),o.length>0){const e=i.length>0?[i[i.length-1]]:$,t=N(o,e,i);if(se){const e=C(t,i);X(e)}else X(t)}else if(i.length>0)if(se){const e=C([i[i.length-1].variables],i);X(e)}else X([i[i.length-1].variables]);else if(se){const e=C($,i);X(e)}else X($)})),pe.current&&l>0){const e=pe.current;setTimeout((()=>{e.scrollTo({top:l,behavior:"smooth"})}),300)}}})})),t(x,Object.assign({style:{color:p.content.secondary}},{children:ee[ee.length-1].displayName}))]}),t(i,{children:W.length>0?t(R,Object.assign({ref:pe,height:ge()},{children:W.map(((e,s)=>{var l,n;return e.displayName&&void 0!==e.variables?t("div",Object.assign({style:{borderBottom:`1px solid ${p.stroke.primary}`}},{children:t(m,Object.assign({arrowColor:p.content.primary,autoOpen:q&&0===s,headerPadding:"12px 16px",header:t(O,Object.assign({style:{color:p.content.secondary}},{children:w(e.displayName,Y)}))},{children:t(E,{parentVariable:e,disabled:null!==(l=P.disabled)&&void 0!==l&&l,searchText:Y,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported&&!U)return he(e),void ce(!0);_(e)}})}))}),e.displayName+se):e.displayName?t(v,Object.assign({body:H(e),placement:"bottom"},{children:t(g,{variant:P.disabled?"readonly":(null==e?void 0:e.selected)?"selected":"default",version:"2.0",leadingIcon:(null==e?void 0:e.selected)||P.disabled?t(i,{}):t("div",Object.assign({style:{flexShrink:0}},{children:t(a,{width:14,height:14})})),customListItemLabel:o("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(j,Object.assign({style:{fontSize:"14px",color:p.text.primary}},{children:w(e.displayName,Y)})),!e.isAvailable&&t(v,Object.assign({body:"Not Recommended"},{children:t("div",Object.assign({style:{display:"flex",marginTop:2}},{children:t(r,{width:16,height:16,color:p.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>fe(e)},s)}),s):t(E,{disabled:null!==(n=P.disabled)&&void 0!==n&&n,searchText:Y,variable:e,onSelect:e=>fe(e)},s)}))})):t(V,{height:ge(),searchText:Y})})]})]}))}))};export{P as VariablePickerContent};
2
2
  //# sourceMappingURL=Content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sources":["../../../../src/components/variable-picker-v3/Content.tsx"],"sourcesContent":["import BackIcon from '@src/assets/icons/arrow_back.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport AddIcon from '@src/assets/icons/plus.svg';\nimport WarnIcon from '@src/assets/icons/triangle_error.svg';\nimport React, { useEffect, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { BikAccordion } from '../accordion';\nimport { IconButton } from '../icon-button';\nimport { Input } from '../input';\nimport { ListItem } from '../list-item';\nimport { Switch } from '../switch';\nimport { Tooltip } from '../tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleRegular,\n\tTitleSmall,\n} from '../TypographyStyle';\nimport { VariablePickerContext } from './context';\nimport { DefaultVariableContent } from './DefaultVariableContent';\nimport { highlightSearchText } from './highlightSearchText';\nimport {\n\tPickerType,\n\tSubHeader,\n\tVariablePickerV3Props,\n\tVariableV3,\n} from './model';\nimport NoResult from './NoResult';\nimport { showOnlyRecommendedVariables } from './recommendVaribles';\nimport { searchVariables } from './searchVariables';\nimport {\n\tBackHeader,\n\tContainer,\n\tHeaderWrapper,\n\tRecommendWrapper,\n} from './styles';\nimport SubHeaderItems, { renderTooltipBody } from './SubHeaderItems';\n\ntype Props = VariablePickerV3Props;\n\nconst variableRegex = /.*\\..*/;\nconst checkIfArray = (value: string) => {\n\tconst regex = /\\w+\\[\\d+\\]/g;\n\treturn regex.test(value);\n};\n\nconst matchVariable = (variable: VariableV3) => {\n\tif (variable.actualValue.match(variableRegex)) {\n\t\tconst path = variable.actualValue\n\t\t\t.replace('{{', '')\n\t\t\t.replace('}}', '')\n\t\t\t.split('.');\n\t\tlet evalVariableValue = path[0];\n\t\tpath.forEach((value, index) => {\n\t\t\tif (index === 0) return;\n\t\t\tconst isArray = checkIfArray(value);\n\t\t\tif (isArray) {\n\t\t\t\t// ex: event_memberships[0] -> ['event_memberships'][0]\n\t\t\t\tconst matches = value.match(/(\\w+)\\[(\\d+)\\]/);\n\t\t\t\tif (matches) {\n\t\t\t\t\tconst arrayName = matches[1];\n\t\t\t\t\tconst index = matches[2];\n\t\t\t\t\tevalVariableValue = evalVariableValue + `['${arrayName}'][${index}]`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tevalVariableValue = evalVariableValue + `['${value}']`;\n\t\t\t}\n\t\t});\n\t\treturn evalVariableValue;\n\t} else {\n\t\tconst value = variable.actualValueEval\n\t\t\t? variable.actualValueEval\n\t\t\t: variable.actualValue;\n\t\treturn value;\n\t}\n};\n\nexport const VariablePickerContent: React.FC<Props> = (\n\tprops: VariablePickerV3Props,\n) => {\n\tconst {\n\t\tdata,\n\t\tonSelect,\n\t\tshowHeader,\n\t\tshowBackButton,\n\t\thideHeaderCross,\n\t\tonBackButtonClick,\n\t\tisEvaluationList,\n\t\tautoOpenFirst,\n\t\theaderText,\n\t\tcontentHeight,\n\t\tonDefaultVariableSelect,\n\t\tskipDefaultVariableContent,\n\t} = props;\n\n\tconst [variables, setVariables] = useState(data); // modified data after search\n\tconst [searchText, setSearchText] = useState<string>('');\n\tconst [subHeaderStack, setSubHeaderStack] = useState<any[]>([]); // push variable object after every level\n\tconst [searchedFrom, setSearchedFrom] = useState<string>(''); // from which level did the user search from\n\tconst [showRecommended, setShowRecommended] = useState<boolean>(false);\n\tconst [dataSource, setDataSource] = useState<any[]>([]); // for search, maintaining original copy\n\tconst [openDefaultVariablePanel, setOpenDefaultVariablePanel] =\n\t\tuseState(false);\n\tconst [chosenForDefault, setChosenForDefault] = useState<VariableV3 | null>();\n\tconst shouldShowHeaderInsideCross =\n\t\topenDefaultVariablePanel &&\n\t\tprops.type === PickerType.EMBEDDED &&\n\t\t!hideHeaderCross;\n\n\t// useEffect(() => {\n\t// \t// TODO: based on new data, update existing variables if available\n\t// \tsetVariables(data);\n\t// }, [data]);\n\n\tuseEffect(() => {\n\t\thandleRecommendedChange(true);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (subHeaderStack.length > 0) {\n\t\t\tsetDataSource([subHeaderStack[subHeaderStack.length - 1]]);\n\t\t} else {\n\t\t\tsetDataSource(data);\n\t\t}\n\t}, [subHeaderStack]);\n\n\tconst handleBackClick = (e: any) => {\n\t\te.stopPropagation();\n\t\tlet _searchText = searchText;\n\t\tconst newSubHeaderStack = [...subHeaderStack];\n\t\tconst poppedElement = newSubHeaderStack.pop();\n\t\tsetSubHeaderStack(newSubHeaderStack);\n\t\tif (poppedElement.displayName === searchedFrom) {\n\t\t\tsetSearchText('');\n\t\t\t_searchText = ''; // so that search is not trigerred in the below code\n\t\t}\n\t\tif (_searchText.length > 0) {\n\t\t\t// maintain the search result when going back\n\t\t\tconst dataSource =\n\t\t\t\tnewSubHeaderStack.length > 0\n\t\t\t\t\t? [newSubHeaderStack[newSubHeaderStack.length - 1]]\n\t\t\t\t\t: data;\n\t\t\tconst result = searchVariables(\n\t\t\t\t_searchText,\n\t\t\t\tdataSource,\n\t\t\t\tnewSubHeaderStack,\n\t\t\t);\n\t\t\tif (showRecommended) {\n\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\tresult,\n\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t);\n\t\t\t\tsetVariables(recommended);\n\t\t\t} else {\n\t\t\t\tsetVariables(result);\n\t\t\t}\n\t\t} else {\n\t\t\tif (newSubHeaderStack.length > 0) {\n\t\t\t\tif (showRecommended) {\n\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\t[newSubHeaderStack[newSubHeaderStack.length - 1].variables],\n\t\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables([\n\t\t\t\t\t\tnewSubHeaderStack[newSubHeaderStack.length - 1].variables,\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (showRecommended) {\n\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tsubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables(data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleRecommendedChange = async (val) => {\n\t\tsetShowRecommended(val);\n\t\tif (val) {\n\t\t\tconst output = showOnlyRecommendedVariables(variables, subHeaderStack);\n\t\t\tsetVariables(output);\n\t\t} else {\n\t\t\tif (subHeaderStack.length > 0) {\n\t\t\t\t// dont apply search if not in the page where search started\n\t\t\t\tconst isInSearchStartPage =\n\t\t\t\t\tsearchedFrom == subHeaderStack[subHeaderStack.length - 1].displayName;\n\t\t\t\tif (searchText.length > 0 && isInSearchStartPage) {\n\t\t\t\t\tconst result = searchVariables(\n\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\tdataSource,\n\t\t\t\t\t\tsubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(result);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables([subHeaderStack[subHeaderStack.length - 1].variables]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (searchText.length > 0) {\n\t\t\t\t\tconst result = searchVariables(\n\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\tdataSource,\n\t\t\t\t\t\tsubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(result);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables(data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst calculateHeight = () => {\n\t\tif (contentHeight) {\n\t\t\treturn contentHeight;\n\t\t}\n\t\tlet pickerContentHeight = 131;\n\t\tif (subHeaderStack.length > 0) {\n\t\t\tpickerContentHeight += 32;\n\t\t}\n\t\tif (props.showHeader || props.showBackButton) {\n\t\t\tpickerContentHeight += 40;\n\t\t}\n\t\treturn `calc(100% - ${pickerContentHeight}px)`;\n\t};\n\n\tconst onSearch = (text: string) => {\n\t\tif (!text) {\n\t\t\tsetSearchedFrom('');\n\t\t}\n\t\tconst result = searchVariables(text, dataSource, subHeaderStack);\n\t\tif (showRecommended) {\n\t\t\tconst recommended = showOnlyRecommendedVariables(result, subHeaderStack);\n\t\t\tsetVariables(recommended);\n\t\t} else {\n\t\t\tsetVariables(result);\n\t\t}\n\t\tsetSearchText(text);\n\t\tconst latestSubHeader =\n\t\t\tsubHeaderStack.length > 0\n\t\t\t\t? subHeaderStack[subHeaderStack.length - 1].displayName\n\t\t\t\t: 'home';\n\t\tsetSearchedFrom(latestSubHeader);\n\t};\n\n\tconst HeaderBackIcon = () => {\n\t\treturn (\n\t\t\t<BackIcon\n\t\t\t\twidth={16}\n\t\t\t\theight={16}\n\t\t\t\tstyle={{ display: 'flex', color: COLORS.content.primary }}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst GoBackIcon = () => {\n\t\treturn (\n\t\t\t<BackIcon\n\t\t\t\twidth={12}\n\t\t\t\theight={12}\n\t\t\t\tstyle={{ color: COLORS.content.secondary }}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst onSelectingVariable = (variable: VariableV3) => {\n\t\tif (props.disabled) return;\n\t\tif (isEvaluationList) {\n\t\t\tconst evalVariableValue = matchVariable(variable as VariableV3);\n\t\t\tonSelect({\n\t\t\t\t...variable,\n\t\t\t\tactualValue: evalVariableValue,\n\t\t\t} as VariableV3);\n\t\t} else {\n\t\t\tif (variable.isDefaultValueSupported && !skipDefaultVariableContent) {\n\t\t\t\tsetChosenForDefault(variable);\n\t\t\t\tsetOpenDefaultVariablePanel(true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSelect(variable as VariableV3);\n\t\t}\n\t};\n\n\treturn (\n\t\t<VariablePickerContext.Provider\n\t\t\tvalue={{\n\t\t\t\tvariables,\n\t\t\t\tsearchText,\n\t\t\t\tsubHeaderStack,\n\t\t\t\tshowRecommended,\n\t\t\t\tsetSubHeaderStack,\n\t\t\t\tsetSearchText,\n\t\t\t\tsetVariables,\n\t\t\t\tsetShowRecommended,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\ttabIndex={-1}\n\t\t\t\tid=\"variable-picker-v3\"\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: 'white',\n\t\t\t\t\tborderRadius: 8,\n\t\t\t\t\theight: '100%',\n\t\t\t\t\toutline: 'none',\n\t\t\t\t}}\n\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t>\n\t\t\t\t{(showHeader || showBackButton || openDefaultVariablePanel) && (\n\t\t\t\t\t<HeaderWrapper openDefault={openDefaultVariablePanel}>\n\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>\n\t\t\t\t\t\t\t{(showBackButton || openDefaultVariablePanel) && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\tIcon={HeaderBackIcon}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tif (openDefaultVariablePanel) {\n\t\t\t\t\t\t\t\t\t\t\tsetOpenDefaultVariablePanel(false);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonBackButtonClick && onBackButtonClick();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{(showHeader || openDefaultVariablePanel) && (\n\t\t\t\t\t\t\t\t<TitleRegular>\n\t\t\t\t\t\t\t\t\t{openDefaultVariablePanel\n\t\t\t\t\t\t\t\t\t\t? 'Set up'\n\t\t\t\t\t\t\t\t\t\t: headerText ?? 'Select Variable'}\n\t\t\t\t\t\t\t\t</TitleRegular>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{shouldShowHeaderInsideCross && (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tstyle={{ color: '#212121' }}\n\t\t\t\t\t\t\t\tIcon={CrossIcon}\n\t\t\t\t\t\t\t\tonClick={() => props.onClose && props.onClose()}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</HeaderWrapper>\n\t\t\t\t)}\n\t\t\t\t{openDefaultVariablePanel &&\n\t\t\t\tchosenForDefault &&\n\t\t\t\t!skipDefaultVariableContent ? (\n\t\t\t\t\t<DefaultVariableContent\n\t\t\t\t\t\tvariable={chosenForDefault}\n\t\t\t\t\t\tonInsertVariable={(updated) => {\n\t\t\t\t\t\t\tonSelect(updated);\n\t\t\t\t\t\t\tonDefaultVariableSelect?.(updated);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tpadding: '0 16px',\n\t\t\t\t\t\t\t\tpaddingTop: 12,\n\t\t\t\t\t\t\t\tbackgroundColor: COLORS.surface.subdued,\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 8,\n\t\t\t\t\t\t\t\tborderTopRightRadius: 8,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid=\"search-bar-v3-picker\"\n\t\t\t\t\t\t\t\tonBlur={(e) => {\n\t\t\t\t\t\t\t\t\tprops.onSearchBlur && props.onSearchBlur(e);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={searchText}\n\t\t\t\t\t\t\t\tnoKeyDownChange\n\t\t\t\t\t\t\t\tplaceholder=\"Search\"\n\t\t\t\t\t\t\t\tonChangeText={onSearch}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<RecommendWrapper>\n\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\tOnly Recommended\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\tvalue={showRecommended}\n\t\t\t\t\t\t\t\tonValueChange={async (val) => {\n\t\t\t\t\t\t\t\t\tawait handleRecommendedChange(val);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecommendWrapper>\n\t\t\t\t\t\t{subHeaderStack.length > 0 && (\n\t\t\t\t\t\t\t<BackHeader>\n\t\t\t\t\t\t\t\t<div style={{ position: 'absolute', left: 16 }}>\n\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\tid=\"back-btn-v3\"\n\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'flex' }}\n\t\t\t\t\t\t\t\t\t\tIcon={GoBackIcon}\n\t\t\t\t\t\t\t\t\t\tonClick={handleBackClick}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{subHeaderStack[subHeaderStack.length - 1].displayName}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</BackHeader>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{variables.length > 0 ? (\n\t\t\t\t\t\t\t\t<Container height={calculateHeight()}>\n\t\t\t\t\t\t\t\t\t{variables.map((variable, index) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tvariable.displayName &&\n\t\t\t\t\t\t\t\t\t\t\ttypeof variable.variables !== 'undefined'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={variable.displayName + showRecommended} // to re-render the component\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderBottom: `1px solid ${COLORS.stroke.primary}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<BikAccordion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrowColor={COLORS.content.primary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tautoOpen={autoOpenFirst && index === 0}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theaderPadding=\"12px 16px\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.content.secondary }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<SubHeaderItems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparentVariable={variable}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable={variable.variables}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect={(variable) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.isDefaultValueSupported &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!skipDefaultVariableContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetChosenForDefault(variable);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetOpenDefaultVariablePanel(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect(variable as VariableV3);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</BikAccordion>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (variable.displayName) {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\tbody={renderTooltipBody(variable as VariableV3)}\n\t\t\t\t\t\t\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.disabled\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'readonly'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: (variable as VariableV3)?.selected\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(variable as VariableV3)?.selected ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.disabled ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ flexShrink: 0 }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<AddIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{!variable.isAvailable && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Tooltip body=\"Not Recommended\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'flex', marginTop: 2 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<WarnIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: variable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: variable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubText={variable.description || ''}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelectingVariable(variable as VariableV3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<SubHeaderItems\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText}\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariable={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable as unknown as {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[key: string]: SubHeader | VariableV3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect={(variable: VariableV3) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelectingVariable(variable as VariableV3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t</Container>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<NoResult height={calculateHeight()} searchText={searchText} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</VariablePickerContext.Provider>\n\t);\n};\n"],"names":["variableRegex","VariablePickerContent","props","data","onSelect","showHeader","showBackButton","hideHeaderCross","onBackButtonClick","isEvaluationList","autoOpenFirst","headerText","contentHeight","onDefaultVariableSelect","skipDefaultVariableContent","variables","setVariables","useState","searchText","setSearchText","subHeaderStack","setSubHeaderStack","searchedFrom","setSearchedFrom","showRecommended","setShowRecommended","dataSource","setDataSource","openDefaultVariablePanel","setOpenDefaultVariablePanel","chosenForDefault","setChosenForDefault","shouldShowHeaderInsideCross","type","PickerType","EMBEDDED","useEffect","handleRecommendedChange","length","val","__awaiter","output","showOnlyRecommendedVariables","isInSearchStartPage","displayName","result","searchVariables","calculateHeight","pickerContentHeight","onSelectingVariable","variable","disabled","evalVariableValue","actualValue","match","path","replace","split","forEach","value","index","isArray","test","checkIfArray","matches","arrayName","actualValueEval","matchVariable","Object","isDefaultValueSupported","_jsx","VariablePickerContext","Provider","assign","children","_jsxs","tabIndex","id","style","backgroundColor","borderRadius","height","outline","onClick","e","stopPropagation","HeaderWrapper","openDefault","display","alignItems","gap","IconButton","Icon","HeaderBackIcon","BackIcon","width","color","COLORS","content","primary","TitleRegular","CrossIcon","onClose","DefaultVariableContent","onInsertVariable","updated","_Fragment","padding","paddingTop","surface","subdued","borderTopLeftRadius","borderTopRightRadius","Input","onBlur","onSearchBlur","noKeyDownChange","placeholder","onChangeText","text","recommended","latestSubHeader","RecommendWrapper","BodySecondary","secondary","Switch","onValueChange","BackHeader","position","left","GoBackIcon","_searchText","newSubHeaderStack","poppedElement","pop","BodyCaption","Container","map","borderBottom","stroke","BikAccordion","arrowColor","autoOpen","headerPadding","header","TitleSmall","highlightSearchText","SubHeaderItems","parentVariable","_a","Tooltip","body","renderTooltipBody","placement","ListItem","variant","selected","version","leadingIcon","flexShrink","AddIcon","customListItemLabel","fontSize","isAvailable","marginTop","WarnIcon","listItem","label","subText","description","_b","NoResult"],"mappings":"+0CAwCA,MAAMA,EAAgB,SAqCTC,EACZC,IAEA,MAAMC,KACLA,EAAIC,SACJA,EAAQC,WACRA,EAAUC,eACVA,EAAcC,gBACdA,EAAeC,kBACfA,EAAiBC,iBACjBA,EAAgBC,cAChBA,EAAaC,WACbA,EAAUC,cACVA,EAAaC,wBACbA,EAAuBC,2BACvBA,GACGZ,GAEGa,EAAWC,GAAgBC,EAASd,IACpCe,EAAYC,GAAiBF,EAAiB,KAC9CG,EAAgBC,GAAqBJ,EAAgB,KACrDK,GAAcC,IAAmBN,EAAiB,KAClDO,GAAiBC,IAAsBR,GAAkB,IACzDS,GAAYC,IAAiBV,EAAgB,KAC7CW,GAA0BC,IAChCZ,GAAS,IACHa,GAAkBC,IAAuBd,IAC1Ce,GACLJ,IACA1B,EAAM+B,OAASC,EAAWC,WACzB5B,EAOF6B,GAAU,KACTC,IAAwB,EAAK,GAC3B,IAEHD,GAAU,KACLhB,EAAekB,OAAS,EAC3BX,GAAc,CAACP,EAAeA,EAAekB,OAAS,KAEtDX,GAAcxB,EACd,GACC,CAACiB,IAEJ,MAyDMiB,GAAiCE,GAAOC,OAAA,OAAA,OAAA,GAAA,YAE7C,GADAf,GAAmBc,GACfA,EAAK,CACR,MAAME,EAASC,EAA6B3B,EAAWK,GACvDJ,EAAayB,EACb,MACA,GAAIrB,EAAekB,OAAS,EAAG,CAE9B,MAAMK,EACLrB,IAAgBF,EAAeA,EAAekB,OAAS,GAAGM,YAC3D,GAAI1B,EAAWoB,OAAS,GAAKK,EAAqB,CACjD,MAAME,EAASC,EACd5B,EACAQ,GACAN,GAEDJ,EAAa6B,EACb,MACA7B,EAAa,CAACI,EAAeA,EAAekB,OAAS,GAAGvB,WAEzD,MACA,GAAIG,EAAWoB,OAAS,EAAG,CAC1B,MAAMO,EAASC,EACd5B,EACAQ,GACAN,GAEDJ,EAAa6B,EACb,MACA7B,EAAab,EAI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ACCD,aAAA,EAAAA,EAAyB0G,UAC1B,WACA,UAEJC,QAAQ,MAERC,aACE5G,aAAA,EAAAA,EAAyB0G,WAC1B1J,EAAMiD,SACLmB,EAAKoC,EAAA,CAAA,GAELpC,EAAA,MAAAF,OAAAK,OAAA,CAAKK,MAAO,CAAEiF,WAAY,IAAG,CAAArF,SAC5BJ,EAAC0F,EAAO,CAACjE,MAAO,GAAId,OAAQ,QAI/BgF,oBACCtF,EAAA,MAAAP,OAAAK,OAAA,CACCK,MAAO,CACNU,QAAS,OACTE,IAAK,IACL,CAAAhB,SAAA,CAEDJ,EAACqD,EACAvD,OAAAK,OAAA,CAAAK,MAAO,CACNoF,SAAU,OACVlE,MAAOC,EAAOsB,KAAKpB,UACnB,CAAAzB,SAEAwE,EACAhG,EAASN,YACT1B,OAGAgC,EAASiH,aACV7F,EAACgF,EAAQlF,OAAAK,OAAA,CAAA8E,KAAK,mBACb,CAAA7E,SAAAJ,EAAA,MAAAF,OAAAK,OAAA,CACCK,MAAO,CAAEU,QAAS,OAAQ4E,UAAW,IAAG,CAAA1F,SAExCJ,EAAC+F,EACA,CAAAtE,MAAO,GACPd,OAAQ,GACRe,MAAOC,EAAOC,QAAQ0B,sBAO5B0C,SAAU,CACTC,MAAOrH,EAASN,YAChBe,MAAOT,EAASN,aAEjB4H,QAAStH,EAASuH,aAAe,GACjCtF,QAASA,IACRlC,GAAoBC,IAlDhBU,KAbDA,GAsENU,EAAC6E,EACA,CAAAhG,iBAAUuH,EAAAxK,EAAMiD,yBAChBjC,WAAYA,EAEZgC,SACCA,EAID9C,SAAW8C,GACVD,GAAoBC,IAPhBU,EAWP,OAIHU,EAACqG,EAAS,CAAA1F,OAAQlC,KAAmB7B,WAAYA,eAMtB"}
1
+ {"version":3,"file":"Content.js","sources":["../../../../src/components/variable-picker-v3/Content.tsx"],"sourcesContent":["import BackIcon from '@src/assets/icons/arrow_back.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport AddIcon from '@src/assets/icons/plus.svg';\nimport WarnIcon from '@src/assets/icons/triangle_error.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport { COLORS } from '@src/constants/Theme';\nimport { BikAccordion } from '../accordion';\nimport { IconButton } from '../icon-button';\nimport { Input } from '../input';\nimport { ListItem } from '../list-item';\nimport { Switch } from '../switch';\nimport { Tooltip } from '../tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleRegular,\n\tTitleSmall,\n} from '../TypographyStyle';\nimport { VariablePickerContext } from './context';\nimport { DefaultVariableContent } from './DefaultVariableContent';\nimport { highlightSearchText } from './highlightSearchText';\nimport {\n\tPickerType,\n\tSubHeader,\n\tVariablePickerV3Props,\n\tVariableV3,\n} from './model';\nimport NoResult from './NoResult';\nimport { showOnlyRecommendedVariables } from './recommendVaribles';\nimport { searchVariables } from './searchVariables';\nimport {\n\tBackHeader,\n\tContainer,\n\tHeaderWrapper,\n\tRecommendWrapper,\n} from './styles';\nimport SubHeaderItems, { renderTooltipBody } from './SubHeaderItems';\n\ntype Props = VariablePickerV3Props;\n\nconst variableRegex = /.*\\..*/;\nconst checkIfArray = (value: string) => {\n\tconst regex = /\\w+\\[\\d+\\]/g;\n\treturn regex.test(value);\n};\n\nconst matchVariable = (variable: VariableV3) => {\n\tif (variable.actualValue.match(variableRegex)) {\n\t\tconst path = variable.actualValue\n\t\t\t.replace('{{', '')\n\t\t\t.replace('}}', '')\n\t\t\t.split('.');\n\t\tlet evalVariableValue = path[0];\n\t\tpath.forEach((value, index) => {\n\t\t\tif (index === 0) return;\n\t\t\tconst isArray = checkIfArray(value);\n\t\t\tif (isArray) {\n\t\t\t\t// ex: event_memberships[0] -> ['event_memberships'][0]\n\t\t\t\tconst matches = value.match(/(\\w+)\\[(\\d+)\\]/);\n\t\t\t\tif (matches) {\n\t\t\t\t\tconst arrayName = matches[1];\n\t\t\t\t\tconst index = matches[2];\n\t\t\t\t\tevalVariableValue = evalVariableValue + `['${arrayName}'][${index}]`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tevalVariableValue = evalVariableValue + `['${value}']`;\n\t\t\t}\n\t\t});\n\t\treturn evalVariableValue;\n\t} else {\n\t\tconst value = variable.actualValueEval\n\t\t\t? variable.actualValueEval\n\t\t\t: variable.actualValue;\n\t\treturn value;\n\t}\n};\n\nexport const VariablePickerContent: React.FC<Props> = (\n\tprops: VariablePickerV3Props,\n) => {\n\tconst {\n\t\tdata,\n\t\tonSelect,\n\t\tshowHeader,\n\t\tshowBackButton,\n\t\thideHeaderCross,\n\t\tonBackButtonClick,\n\t\tisEvaluationList,\n\t\tautoOpenFirst,\n\t\theaderText,\n\t\tcontentHeight,\n\t\tonDefaultVariableSelect,\n\t\tskipDefaultVariableContent,\n\t} = props;\n\n\tconst [variables, setVariables] = useState(data); // modified data after search\n\tconst [searchText, setSearchText] = useState<string>('');\n\tconst [subHeaderStack, setSubHeaderStack] = useState<any[]>([]); // push variable object after every level\n\tconst [searchedFrom, setSearchedFrom] = useState<string>(''); // from which level did the user search from\n\tconst [showRecommended, setShowRecommended] = useState<boolean>(false);\n\tconst [dataSource, setDataSource] = useState<any[]>([]); // for search, maintaining original copy\n\tconst [openDefaultVariablePanel, setOpenDefaultVariablePanel] =\n\t\tuseState(false);\n\tconst [chosenForDefault, setChosenForDefault] = useState<VariableV3 | null>();\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst scrollPositionStack = useRef<number[]>([]);\n\tconst shouldShowHeaderInsideCross =\n\t\topenDefaultVariablePanel &&\n\t\tprops.type === PickerType.EMBEDDED &&\n\t\t!hideHeaderCross;\n\n\t// useEffect(() => {\n\t// \t// TODO: based on new data, update existing variables if available\n\t// \tsetVariables(data);\n\t// }, [data]);\n\n\tuseEffect(() => {\n\t\thandleRecommendedChange(true);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (subHeaderStack.length > 0) {\n\t\t\tsetDataSource([subHeaderStack[subHeaderStack.length - 1]]);\n\t\t} else {\n\t\t\tsetDataSource(data);\n\t\t}\n\t}, [subHeaderStack]);\n\n\tconst handleBackClick = (e: any) => {\n\t\te.stopPropagation();\n\t\tlet _searchText = searchText;\n\t\tconst newSubHeaderStack = [...subHeaderStack];\n\t\tconst poppedElement = newSubHeaderStack.pop();\n\t\tif (poppedElement.displayName === searchedFrom) {\n\t\t\t_searchText = ''; // so that search is not trigerred in the below code\n\t\t}\n\t\tconst savedScrollTop = scrollPositionStack.current.pop() ?? 0;\n\n\t\t// Use flushSync to force synchronous DOM update so scroll can be\n\t\t// restored immediately after the new content is rendered\n\t\tflushSync(() => {\n\t\t\tsetSubHeaderStack(newSubHeaderStack);\n\t\t\tif (poppedElement.displayName === searchedFrom) {\n\t\t\t\tsetSearchText('');\n\t\t\t}\n\t\t\tif (_searchText.length > 0) {\n\t\t\t\t// maintain the search result when going back\n\t\t\t\tconst dataSource =\n\t\t\t\t\tnewSubHeaderStack.length > 0\n\t\t\t\t\t\t? [newSubHeaderStack[newSubHeaderStack.length - 1]]\n\t\t\t\t\t\t: data;\n\t\t\t\tconst result = searchVariables(\n\t\t\t\t\t_searchText,\n\t\t\t\t\tdataSource,\n\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t);\n\t\t\t\tif (showRecommended) {\n\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (newSubHeaderStack.length > 0) {\n\t\t\t\t\tif (showRecommended) {\n\t\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\t\t[newSubHeaderStack[newSubHeaderStack.length - 1].variables],\n\t\t\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetVariables([\n\t\t\t\t\t\t\tnewSubHeaderStack[newSubHeaderStack.length - 1].variables,\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (showRecommended) {\n\t\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tnewSubHeaderStack,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetVariables(data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Restore scroll after accordion expand animation completes.\n\t\t// The BikAccordion uses a 250ms CSS transition on max-height when\n\t\t// autoOpen fires. We must wait for that to finish so the Container\n\t\t// has enough scrollHeight to scroll to the saved position.\n\t\tif (containerRef.current && savedScrollTop > 0) {\n\t\t\tconst el = containerRef.current;\n\t\t\tsetTimeout(() => {\n\t\t\t\tel.scrollTo({ top: savedScrollTop, behavior: 'smooth' });\n\t\t\t}, 300);\n\t\t}\n\t};\n\n\tconst handleRecommendedChange = async (val) => {\n\t\tsetShowRecommended(val);\n\t\tif (val) {\n\t\t\tconst output = showOnlyRecommendedVariables(variables, subHeaderStack);\n\t\t\tsetVariables(output);\n\t\t} else {\n\t\t\tif (subHeaderStack.length > 0) {\n\t\t\t\t// dont apply search if not in the page where search started\n\t\t\t\tconst isInSearchStartPage =\n\t\t\t\t\tsearchedFrom == subHeaderStack[subHeaderStack.length - 1].displayName;\n\t\t\t\tif (searchText.length > 0 && isInSearchStartPage) {\n\t\t\t\t\tconst result = searchVariables(\n\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\tdataSource,\n\t\t\t\t\t\tsubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(result);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables([subHeaderStack[subHeaderStack.length - 1].variables]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (searchText.length > 0) {\n\t\t\t\t\tconst result = searchVariables(\n\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\tdataSource,\n\t\t\t\t\t\tsubHeaderStack,\n\t\t\t\t\t);\n\t\t\t\t\tsetVariables(result);\n\t\t\t\t} else {\n\t\t\t\t\tsetVariables(data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst calculateHeight = () => {\n\t\tif (contentHeight) {\n\t\t\treturn contentHeight;\n\t\t}\n\t\tlet pickerContentHeight = 131;\n\t\tif (subHeaderStack.length > 0) {\n\t\t\tpickerContentHeight += 32;\n\t\t}\n\t\tif (props.showHeader || props.showBackButton) {\n\t\t\tpickerContentHeight += 40;\n\t\t}\n\t\treturn `calc(100% - ${pickerContentHeight}px)`;\n\t};\n\n\tconst onSearch = (text: string) => {\n\t\tif (!text) {\n\t\t\tsetSearchedFrom('');\n\t\t}\n\t\tconst result = searchVariables(text, dataSource, subHeaderStack);\n\t\tif (showRecommended) {\n\t\t\tconst recommended = showOnlyRecommendedVariables(result, subHeaderStack);\n\t\t\tsetVariables(recommended);\n\t\t} else {\n\t\t\tsetVariables(result);\n\t\t}\n\t\tsetSearchText(text);\n\t\tconst latestSubHeader =\n\t\t\tsubHeaderStack.length > 0\n\t\t\t\t? subHeaderStack[subHeaderStack.length - 1].displayName\n\t\t\t\t: 'home';\n\t\tsetSearchedFrom(latestSubHeader);\n\t};\n\n\tconst HeaderBackIcon = () => {\n\t\treturn (\n\t\t\t<BackIcon\n\t\t\t\twidth={16}\n\t\t\t\theight={16}\n\t\t\t\tstyle={{ display: 'flex', color: COLORS.content.primary }}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst GoBackIcon = () => {\n\t\treturn (\n\t\t\t<BackIcon\n\t\t\t\twidth={12}\n\t\t\t\theight={12}\n\t\t\t\tstyle={{ color: COLORS.content.secondary }}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst onSelectingVariable = (variable: VariableV3) => {\n\t\tif (props.disabled) return;\n\t\tif (isEvaluationList) {\n\t\t\tconst evalVariableValue = matchVariable(variable as VariableV3);\n\t\t\tonSelect({\n\t\t\t\t...variable,\n\t\t\t\tactualValue: evalVariableValue,\n\t\t\t} as VariableV3);\n\t\t} else {\n\t\t\tif (variable.isDefaultValueSupported && !skipDefaultVariableContent) {\n\t\t\t\tsetChosenForDefault(variable);\n\t\t\t\tsetOpenDefaultVariablePanel(true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSelect(variable as VariableV3);\n\t\t}\n\t};\n\n\treturn (\n\t\t<VariablePickerContext.Provider\n\t\t\tvalue={{\n\t\t\t\tvariables,\n\t\t\t\tsearchText,\n\t\t\t\tsubHeaderStack,\n\t\t\t\tshowRecommended,\n\t\t\t\tsetSubHeaderStack,\n\t\t\t\tsetSearchText,\n\t\t\t\tsetVariables,\n\t\t\t\tsetShowRecommended,\n\t\t\t\tcontainerRef,\n\t\t\t\tscrollPositionStack,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\ttabIndex={-1}\n\t\t\t\tid=\"variable-picker-v3\"\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: 'white',\n\t\t\t\t\tborderRadius: 8,\n\t\t\t\t\theight: '100%',\n\t\t\t\t\toutline: 'none',\n\t\t\t\t}}\n\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t>\n\t\t\t\t{(showHeader || showBackButton || openDefaultVariablePanel) && (\n\t\t\t\t\t<HeaderWrapper openDefault={openDefaultVariablePanel}>\n\t\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>\n\t\t\t\t\t\t\t{(showBackButton || openDefaultVariablePanel) && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\tIcon={HeaderBackIcon}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tif (openDefaultVariablePanel) {\n\t\t\t\t\t\t\t\t\t\t\tsetOpenDefaultVariablePanel(false);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonBackButtonClick && onBackButtonClick();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{(showHeader || openDefaultVariablePanel) && (\n\t\t\t\t\t\t\t\t<TitleRegular>\n\t\t\t\t\t\t\t\t\t{openDefaultVariablePanel\n\t\t\t\t\t\t\t\t\t\t? 'Set up'\n\t\t\t\t\t\t\t\t\t\t: headerText ?? 'Select Variable'}\n\t\t\t\t\t\t\t\t</TitleRegular>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{shouldShowHeaderInsideCross && (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tstyle={{ color: '#212121' }}\n\t\t\t\t\t\t\t\tIcon={CrossIcon}\n\t\t\t\t\t\t\t\tonClick={() => props.onClose && props.onClose()}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</HeaderWrapper>\n\t\t\t\t)}\n\t\t\t\t{openDefaultVariablePanel &&\n\t\t\t\tchosenForDefault &&\n\t\t\t\t!skipDefaultVariableContent ? (\n\t\t\t\t\t<DefaultVariableContent\n\t\t\t\t\t\tvariable={chosenForDefault}\n\t\t\t\t\t\tonInsertVariable={(updated) => {\n\t\t\t\t\t\t\tonSelect(updated);\n\t\t\t\t\t\t\tonDefaultVariableSelect?.(updated);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tpadding: '0 16px',\n\t\t\t\t\t\t\t\tpaddingTop: 12,\n\t\t\t\t\t\t\t\tbackgroundColor: COLORS.surface.subdued,\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 8,\n\t\t\t\t\t\t\t\tborderTopRightRadius: 8,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid=\"search-bar-v3-picker\"\n\t\t\t\t\t\t\t\tonBlur={(e) => {\n\t\t\t\t\t\t\t\t\tprops.onSearchBlur && props.onSearchBlur(e);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={searchText}\n\t\t\t\t\t\t\t\tnoKeyDownChange\n\t\t\t\t\t\t\t\tplaceholder=\"Search\"\n\t\t\t\t\t\t\t\tonChangeText={onSearch}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<RecommendWrapper>\n\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\tOnly Recommended\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\tvalue={showRecommended}\n\t\t\t\t\t\t\t\tonValueChange={async (val) => {\n\t\t\t\t\t\t\t\t\tawait handleRecommendedChange(val);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecommendWrapper>\n\t\t\t\t\t\t{subHeaderStack.length > 0 && (\n\t\t\t\t\t\t\t<BackHeader>\n\t\t\t\t\t\t\t\t<div style={{ position: 'absolute', left: 16 }}>\n\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\tid=\"back-btn-v3\"\n\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'flex' }}\n\t\t\t\t\t\t\t\t\t\tIcon={GoBackIcon}\n\t\t\t\t\t\t\t\t\t\tonClick={handleBackClick}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{subHeaderStack[subHeaderStack.length - 1].displayName}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</BackHeader>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{variables.length > 0 ? (\n\t\t\t\t\t\t\t\t<Container ref={containerRef} height={calculateHeight()}>\n\t\t\t\t\t\t\t\t\t{variables.map((variable, index) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tvariable.displayName &&\n\t\t\t\t\t\t\t\t\t\t\ttypeof variable.variables !== 'undefined'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={variable.displayName + showRecommended} // to re-render the component\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tborderBottom: `1px solid ${COLORS.stroke.primary}`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<BikAccordion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrowColor={COLORS.content.primary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tautoOpen={autoOpenFirst && index === 0}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theaderPadding=\"12px 16px\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.content.secondary }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<SubHeaderItems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparentVariable={variable}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable={variable.variables}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect={(variable) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.isDefaultValueSupported &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!skipDefaultVariableContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetChosenForDefault(variable);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetOpenDefaultVariablePanel(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect(variable as VariableV3);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</BikAccordion>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (variable.displayName) {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\tbody={renderTooltipBody(variable as VariableV3)}\n\t\t\t\t\t\t\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.disabled\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'readonly'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: (variable as VariableV3)?.selected\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(variable as VariableV3)?.selected ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprops.disabled ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ flexShrink: 0 }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<AddIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{!variable.isAvailable && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Tooltip body=\"Not Recommended\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'flex', marginTop: 2 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<WarnIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: variable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: variable.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubText={variable.description || ''}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelectingVariable(variable as VariableV3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<SubHeaderItems\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText}\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariable={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariable as unknown as {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[key: string]: SubHeader | VariableV3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonSelect={(variable: VariableV3) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSelectingVariable(variable as VariableV3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t</Container>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<NoResult height={calculateHeight()} searchText={searchText} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</VariablePickerContext.Provider>\n\t);\n};\n"],"names":["variableRegex","VariablePickerContent","props","data","onSelect","showHeader","showBackButton","hideHeaderCross","onBackButtonClick","isEvaluationList","autoOpenFirst","headerText","contentHeight","onDefaultVariableSelect","skipDefaultVariableContent","variables","setVariables","useState","searchText","setSearchText","subHeaderStack","setSubHeaderStack","searchedFrom","setSearchedFrom","showRecommended","setShowRecommended","dataSource","setDataSource","openDefaultVariablePanel","setOpenDefaultVariablePanel","chosenForDefault","setChosenForDefault","containerRef","useRef","scrollPositionStack","shouldShowHeaderInsideCross","type","PickerType","EMBEDDED","useEffect","handleRecommendedChange","length","val","__awaiter","output","showOnlyRecommendedVariables","isInSearchStartPage","displayName","result","searchVariables","calculateHeight","pickerContentHeight","onSelectingVariable","variable","disabled","evalVariableValue","actualValue","match","path","replace","split","forEach","value","index","isArray","test","checkIfArray","matches","arrayName","actualValueEval","matchVariable","Object","isDefaultValueSupported","_jsx","VariablePickerContext","Provider","assign","children","_jsxs","tabIndex","id","style","backgroundColor","borderRadius","height","outline","onClick","e","stopPropagation","HeaderWrapper","openDefault","display","alignItems","gap","IconButton","Icon","HeaderBackIcon","BackIcon","width","color","COLORS","content","primary","TitleRegular","CrossIcon","onClose","DefaultVariableContent","onInsertVariable","updated","_Fragment","padding","paddingTop","surface","subdued","borderTopLeftRadius","borderTopRightRadius","Input","onBlur","onSearchBlur","noKeyDownChange","placeholder","onChangeText","text","recommended","latestSubHeader","RecommendWrapper","BodySecondary","secondary","Switch","onValueChange","BackHeader","position","left","GoBackIcon","_searchText","newSubHeaderStack","poppedElement","pop","savedScrollTop","_a","current","flushSync","el","setTimeout","scrollTo","top","behavior","BodyCaption","Container","ref","map","borderBottom","stroke","BikAccordion","arrowColor","autoOpen","headerPadding","header","TitleSmall","highlightSearchText","SubHeaderItems","parentVariable","Tooltip","body","renderTooltipBody","placement","ListItem","variant","selected","version","leadingIcon","flexShrink","AddIcon","customListItemLabel","fontSize","isAvailable","marginTop","WarnIcon","listItem","label","subText","description","_b","NoResult"],"mappings":"i4CAyCA,MAAMA,EAAgB,SAqCTC,EACZC,IAEA,MAAMC,KACLA,EAAIC,SACJA,EAAQC,WACRA,EAAUC,eACVA,EAAcC,gBACdA,EAAeC,kBACfA,EAAiBC,iBACjBA,EAAgBC,cAChBA,EAAaC,WACbA,EAAUC,cACVA,EAAaC,wBACbA,EAAuBC,2BACvBA,GACGZ,GAEGa,EAAWC,GAAgBC,EAASd,IACpCe,EAAYC,GAAiBF,EAAiB,KAC9CG,GAAgBC,IAAqBJ,EAAgB,KACrDK,GAAcC,IAAmBN,EAAiB,KAClDO,GAAiBC,IAAsBR,GAAkB,IACzDS,GAAYC,IAAiBV,EAAgB,KAC7CW,GAA0BC,IAChCZ,GAAS,IACHa,GAAkBC,IAAuBd,IAC1Ce,GAAeC,EAAuB,MACtCC,GAAsBD,EAAiB,IACvCE,GACLP,IACA1B,EAAMkC,OAASC,EAAWC,WACzB/B,EAOFgC,GAAU,KACTC,IAAwB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E,MAAO,GAAId,OAAQ,QAI/ByF,oBACC/F,EAAA,MAAAP,OAAAK,OAAA,CACCK,MAAO,CACNU,QAAS,OACTE,IAAK,IACL,CAAAhB,SAAA,CAEDJ,EAACqD,EACAvD,OAAAK,OAAA,CAAAK,MAAO,CACN6F,SAAU,OACV3E,MAAOC,EAAOsB,KAAKpB,UACnB,CAAAzB,SAEAkF,EACA1G,EAASN,YACT7B,OAGAmC,EAAS0H,aACVtG,EAACyF,EAAQ3F,OAAAK,OAAA,CAAAuF,KAAK,mBACb,CAAAtF,SAAAJ,EAAA,MAAAF,OAAAK,OAAA,CACCK,MAAO,CAAEU,QAAS,OAAQqF,UAAW,IAAG,CAAAnG,SAExCJ,EAACwG,EACA,CAAA/E,MAAO,GACPd,OAAQ,GACRe,MAAOC,EAAOC,QAAQ0B,sBAO5BmD,SAAU,CACTC,MAAO9H,EAASN,YAChBe,MAAOT,EAASN,aAEjBqI,QAAS/H,EAASgI,aAAe,GACjC/F,QAASA,IACRlC,GAAoBC,IAlDhBU,KAbDA,GAsENU,EAACuF,EACA,CAAA1G,iBAAUgI,EAAApL,EAAMoD,yBAChBpC,WAAYA,EAEZmC,SACCA,EAIDjD,SAAWiD,GACVD,GAAoBC,IAPhBU,EAWP,OAIHU,EAAC8G,EAAS,CAAAnG,OAAQlC,KAAmBhC,WAAYA,eAMtB"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import s from"../../assets/icons/chevronRight.svg.js";import o from"../../assets/icons/plus.svg.js";import l from"../../assets/icons/sub_category.svg.js";import a from"../../assets/icons/triangle_error.svg.js";import r from"lodash/cloneDeep";import{COLORS as n}from"../../constants/Theme.js";import{ListItem as c}from"../list-item/ListItem.js";import{Tooltip as d}from"../tooltips/Tooltip.js";import{BodySecondary as m}from"../TypographyStyle.js";import{useVariablePickerContext as p}from"./context.js";import{highlightSearchText as b}from"./highlightSearchText.js";import{showOnlyRecommendedVariables as h}from"./recommendVaribles.js";const g=e=>{var t;return(null===(t=e.contextQ)||void 0===t?void 0:t.join(" > "))||""},v=v=>{const{onSelect:y,variable:f,searchText:j,disabled:u,parentVariable:x}=v,{subHeaderStack:O,setSubHeaderStack:I,setVariables:S,showRecommended:N}=p();return e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4}},{children:Object.keys(f).map(((p,v)=>{var T;if(void 0===f[p].variables||0===Object.keys((null===(T=f[p])||void 0===T?void 0:T.variables)||{}).length){const s=f[p];return e(d,Object.assign({body:g(s),placement:"bottom"},{children:e(c,{variant:u?"readonly":(null==s?void 0:s.selected)?"selected":"default",version:"2.0",leadingIcon:(null==s?void 0:s.selected)||u?e(t,{}):e("div",Object.assign({style:{flexShrink:0}},{children:e(o,{width:14,height:14})})),customListItemLabel:i("div",Object.assign({style:{display:"flex",gap:4}},{children:[e(m,Object.assign({style:{fontSize:"14px",color:n.text.primary}},{children:b(s.displayName,j)})),!s.isAvailable&&e(d,Object.assign({body:"Not Recommended"},{children:e("div",Object.assign({style:{display:"flex",marginTop:2}},{children:e(a,{width:16,height:16,color:n.content.secondary})}))}))]})),listItem:{label:s.displayName,value:s.displayName},subText:s.description||"",onClick:()=>{y(s)}})}),v)}return e(d,Object.assign({body:g(f[p]),placement:"bottom"},{children:e(c,{variant:"default",version:"2.0",listItem:{label:f[p].displayName,value:f[p].displayName},customListItemLabel:e("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:e(m,Object.assign({style:{fontSize:"14px",color:n.text.primary}},{children:b(f[p].displayName,j)}))})),leadingIcon:e(l,{width:14,height:14}),subText:f[p].description||"",trailingIcon:e(s,{width:10,height:10,color:"#212121"}),onClick:()=>{const e=r(f[p]);void 0!==x&&(e.contextQ=[x.displayName]);const t=[...O,e];if(I(t),N){const i=h([e.variables],t);S(i)}else S([e.variables])}})}),v)}))}))};export{v as default,g as renderTooltipBody};
1
+ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import s from"../../assets/icons/chevronRight.svg.js";import o from"../../assets/icons/plus.svg.js";import r from"../../assets/icons/sub_category.svg.js";import l from"../../assets/icons/triangle_error.svg.js";import a from"lodash/cloneDeep";import{COLORS as n}from"../../constants/Theme.js";import{ListItem as c}from"../list-item/ListItem.js";import{Tooltip as d}from"../tooltips/Tooltip.js";import{BodySecondary as m}from"../TypographyStyle.js";import{useVariablePickerContext as p}from"./context.js";import{highlightSearchText as b}from"./highlightSearchText.js";import{showOnlyRecommendedVariables as h}from"./recommendVaribles.js";const g=e=>{var t;return(null===(t=e.contextQ)||void 0===t?void 0:t.join(" > "))||""},v=v=>{const{onSelect:y,variable:u,searchText:f,disabled:j,parentVariable:x}=v,{subHeaderStack:O,setSubHeaderStack:S,setVariables:T,showRecommended:I,containerRef:k,scrollPositionStack:N}=p();return e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4}},{children:Object.keys(u).map(((p,v)=>{var w;if(void 0===u[p].variables||0===Object.keys((null===(w=u[p])||void 0===w?void 0:w.variables)||{}).length){const s=u[p];return e(d,Object.assign({body:g(s),placement:"bottom"},{children:e(c,{variant:j?"readonly":(null==s?void 0:s.selected)?"selected":"default",version:"2.0",leadingIcon:(null==s?void 0:s.selected)||j?e(t,{}):e("div",Object.assign({style:{flexShrink:0}},{children:e(o,{width:14,height:14})})),customListItemLabel:i("div",Object.assign({style:{display:"flex",gap:4}},{children:[e(m,Object.assign({style:{fontSize:"14px",color:n.text.primary}},{children:b(s.displayName,f)})),!s.isAvailable&&e(d,Object.assign({body:"Not Recommended"},{children:e("div",Object.assign({style:{display:"flex",marginTop:2}},{children:e(l,{width:16,height:16,color:n.content.secondary})}))}))]})),listItem:{label:s.displayName,value:s.displayName},subText:s.description||"",onClick:()=>{y(s)}})}),v)}return e(d,Object.assign({body:g(u[p]),placement:"bottom"},{children:e(c,{variant:"default",version:"2.0",listItem:{label:u[p].displayName,value:u[p].displayName},customListItemLabel:e("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:e(m,Object.assign({style:{fontSize:"14px",color:n.text.primary}},{children:b(u[p].displayName,f)}))})),leadingIcon:e(r,{width:14,height:14}),subText:u[p].description||"",trailingIcon:e(s,{width:10,height:10,color:"#212121"}),onClick:()=>{k.current&&(N.current.push(k.current.scrollTop),k.current.scrollTop=0);const e=a(u[p]);void 0!==x&&(e.contextQ=[x.displayName]);const t=[...O,e];if(S(t),I){const i=h([e.variables],t);T(i)}else T([e.variables])}})}),v)}))}))};export{v as default,g as renderTooltipBody};
2
2
  //# sourceMappingURL=SubHeaderItems.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubHeaderItems.js","sources":["../../../../src/components/variable-picker-v3/SubHeaderItems.tsx"],"sourcesContent":["import ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport AddIcon from '@src/assets/icons/plus.svg';\nimport SubCategoryIcon from '@src/assets/icons/sub_category.svg';\nimport WarnIcon from '@src/assets/icons/triangle_error.svg';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { COLORS } from '@src/constants/Theme';\nimport { ListItem } from '../list-item';\nimport { Tooltip } from '../tooltips';\nimport { BodySecondary } from '../TypographyStyle';\nimport { useVariablePickerContext } from './context';\nimport { highlightSearchText } from './highlightSearchText';\nimport { SubHeader, VariableListInterfaceV3, VariableV3 } from './model';\nimport { showOnlyRecommendedVariables } from './recommendVaribles';\n\ntype SubHeaderProps = {\n\tparentVariable?: VariableListInterfaceV3;\n\tdisabled: boolean;\n\tsearchText: string;\n\tonSelect: (variable: VariableV3) => void;\n\tvariable: { [key: string]: SubHeader | VariableV3 };\n};\n\nexport const renderTooltipBody = (variable: VariableV3) => {\n\treturn variable.contextQ?.join(' > ') || '';\n};\n\nconst SubHeaderItem: React.FC<SubHeaderProps> = (props: SubHeaderProps) => {\n\tconst { onSelect, variable, searchText, disabled, parentVariable } = props;\n\tconst { subHeaderStack, setSubHeaderStack, setVariables, showRecommended } =\n\t\tuseVariablePickerContext();\n\treturn (\n\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>\n\t\t\t{Object.keys(variable).map((key, index) => {\n\t\t\t\tif (\n\t\t\t\t\ttypeof variable[key].variables === 'undefined' ||\n\t\t\t\t\tObject.keys(variable[key]?.variables || {}).length === 0\n\t\t\t\t) {\n\t\t\t\t\tconst variableV3 = variable[key] as VariableV3;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tbody={renderTooltipBody(variableV3)}\n\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\t\t? 'readonly'\n\t\t\t\t\t\t\t\t\t\t: variableV3?.selected\n\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\t\t\tvariableV3?.selected || disabled ? (\n\t\t\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<div style={{ flexShrink: 0 }}>\n\t\t\t\t\t\t\t\t\t\t\t<AddIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(variableV3.displayName, searchText)}\n\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t{!variableV3.isAvailable && (\n\t\t\t\t\t\t\t\t\t\t\t<Tooltip body=\"Not Recommended\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ display: 'flex', marginTop: 2 }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<WarnIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\t\tlabel: variableV3.displayName,\n\t\t\t\t\t\t\t\t\tvalue: variableV3.displayName,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tsubText={variableV3.description || ''}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tonSelect(variableV3);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tbody={renderTooltipBody(variable[key] as VariableV3)}\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\tvariant={'default'}\n\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\tlabel: variable[key].displayName,\n\t\t\t\t\t\t\t\tvalue: variable[key].displayName,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{highlightSearchText(variable[key].displayName, searchText)}\n\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tleadingIcon={<SubCategoryIcon width={14} height={14} />}\n\t\t\t\t\t\t\tsubText={variable[key].description || ''}\n\t\t\t\t\t\t\ttrailingIcon={\n\t\t\t\t\t\t\t\t<ChevronRight width={10} height={10} color=\"#212121\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tconst currentVariable = cloneDeep(variable[key]) as SubHeader;\n\t\t\t\t\t\t\t\tif (typeof parentVariable !== 'undefined') {\n\t\t\t\t\t\t\t\t\tcurrentVariable.contextQ = [parentVariable.displayName];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst stack = [...subHeaderStack, currentVariable];\n\t\t\t\t\t\t\t\tsetSubHeaderStack(stack);\n\t\t\t\t\t\t\t\tif (showRecommended) {\n\t\t\t\t\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\t\t\t\t\t[currentVariable.variables],\n\t\t\t\t\t\t\t\t\t\tstack,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsetVariables([currentVariable.variables]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n};\n\nexport default SubHeaderItem;\n"],"names":["renderTooltipBody","variable","_a","contextQ","join","SubHeaderItem","props","onSelect","searchText","disabled","parentVariable","subHeaderStack","setSubHeaderStack","setVariables","showRecommended","useVariablePickerContext","_jsx","Object","assign","style","display","flexDirection","gap","children","keys","map","key","index","variables","length","variableV3","Tooltip","body","placement","ListItem","variant","selected","version","leadingIcon","_Fragment","flexShrink","AddIcon","width","height","customListItemLabel","_jsxs","BodySecondary","fontSize","color","COLORS","text","primary","highlightSearchText","displayName","isAvailable","marginTop","WarnIcon","content","secondary","listItem","label","value","subText","description","onClick","alignItems","SubCategoryIcon","trailingIcon","ChevronRight","currentVariable","cloneDeep","stack","recommended","showOnlyRecommendedVariables"],"mappings":"4rBAsBaA,MAAAA,EAAqBC,UACjC,OAAwB,QAAjBC,EAAAD,EAASE,gBAAQ,IAAAD,OAAA,EAAAA,EAAEE,KAAK,SAAU,EAAE,EAGtCC,EAA2CC,IAChD,MAAMC,SAAEA,EAAQN,SAAEA,EAAQO,WAAEA,EAAUC,SAAEA,EAAQC,eAAEA,GAAmBJ,GAC/DK,eAAEA,EAAcC,kBAAEA,EAAiBC,aAAEA,EAAYC,gBAAEA,GACxDC,IACD,OACCC,EAAA,MAAAC,OAAAC,OAAA,CAAKC,MAAO,CAAEC,QAAS,OAAQC,cAAe,SAAUC,IAAK,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DP,CACD,OACCX,EAACe,EAAOd,OAAAC,OAAA,CAEPc,KAAMhC,EAAkBC,EAASyB,IACjCO,UAAU,UAEV,CAAAV,SAAAP,EAACkB,EAAQ,CACRC,QAAS,UACTE,QAAQ,MACRsB,SAAU,CACTC,MAAO3D,EAASyB,GAAK2B,YACrBQ,MAAO5D,EAASyB,GAAK2B,aAEtBT,oBACC5B,EACC,MAAAC,OAAAC,OAAA,CAAAC,MAAO,CACNC,QAAS,OACT6C,WAAY,WACZ,CAAA1C,SAEDP,EAAC8B,EACA7B,OAAAC,OAAA,CAAAC,MAAO,CACN4B,SAAU,OACVC,MAAOC,EAAOC,KAAKC,UACnB,CAAA5B,SAEA6B,EAAoBnD,EAASyB,GAAK2B,YAAa7C,SAInD8B,YAAatB,EAACkD,EAAgB,CAAAxB,MAAO,GAAIC,OAAQ,KACjDmB,QAAS7D,EAASyB,GAAKqC,aAAe,GACtCI,aACCnD,EAACoD,EAAY,CAAC1B,MAAO,GAAIC,OAAQ,GAAIK,MAAM,YAE5CgB,QAASA,KACR,MAAMK,EAAkBC,EAAUrE,EAASyB,SACb,IAAnBhB,IACV2D,EAAgBlE,SAAW,CAACO,EAAe2C,cAE5C,MAAMkB,EAAQ,IAAI5D,EAAgB0D,GAElC,GADAzD,EAAkB2D,GACdzD,EAAiB,CACpB,MAAM0D,EAAcC,EACnB,CAACJ,EAAgBzC,WACjB2C,GAED1D,EAAa2D,EACb,MACA3D,EAAa,CAACwD,EAAgBzC,WAC9B,MAhDED,EAmDI,MAGP"}
1
+ {"version":3,"file":"SubHeaderItems.js","sources":["../../../../src/components/variable-picker-v3/SubHeaderItems.tsx"],"sourcesContent":["import ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport AddIcon from '@src/assets/icons/plus.svg';\nimport SubCategoryIcon from '@src/assets/icons/sub_category.svg';\nimport WarnIcon from '@src/assets/icons/triangle_error.svg';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { COLORS } from '@src/constants/Theme';\nimport { ListItem } from '../list-item';\nimport { Tooltip } from '../tooltips';\nimport { BodySecondary } from '../TypographyStyle';\nimport { useVariablePickerContext } from './context';\nimport { highlightSearchText } from './highlightSearchText';\nimport { SubHeader, VariableListInterfaceV3, VariableV3 } from './model';\nimport { showOnlyRecommendedVariables } from './recommendVaribles';\n\ntype SubHeaderProps = {\n\tparentVariable?: VariableListInterfaceV3;\n\tdisabled: boolean;\n\tsearchText: string;\n\tonSelect: (variable: VariableV3) => void;\n\tvariable: { [key: string]: SubHeader | VariableV3 };\n};\n\nexport const renderTooltipBody = (variable: VariableV3) => {\n\treturn variable.contextQ?.join(' > ') || '';\n};\n\nconst SubHeaderItem: React.FC<SubHeaderProps> = (props: SubHeaderProps) => {\n\tconst { onSelect, variable, searchText, disabled, parentVariable } = props;\n\tconst { subHeaderStack, setSubHeaderStack, setVariables, showRecommended, containerRef, scrollPositionStack } =\n\t\tuseVariablePickerContext();\n\treturn (\n\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>\n\t\t\t{Object.keys(variable).map((key, index) => {\n\t\t\t\tif (\n\t\t\t\t\ttypeof variable[key].variables === 'undefined' ||\n\t\t\t\t\tObject.keys(variable[key]?.variables || {}).length === 0\n\t\t\t\t) {\n\t\t\t\t\tconst variableV3 = variable[key] as VariableV3;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tbody={renderTooltipBody(variableV3)}\n\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\t\t? 'readonly'\n\t\t\t\t\t\t\t\t\t\t: variableV3?.selected\n\t\t\t\t\t\t\t\t\t\t? 'selected'\n\t\t\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\t\tleadingIcon={\n\t\t\t\t\t\t\t\t\tvariableV3?.selected || disabled ? (\n\t\t\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<div style={{ flexShrink: 0 }}>\n\t\t\t\t\t\t\t\t\t\t\t<AddIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{highlightSearchText(variableV3.displayName, searchText)}\n\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t{!variableV3.isAvailable && (\n\t\t\t\t\t\t\t\t\t\t\t<Tooltip body=\"Not Recommended\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ display: 'flex', marginTop: 2 }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<WarnIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\t\tlabel: variableV3.displayName,\n\t\t\t\t\t\t\t\t\tvalue: variableV3.displayName,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tsubText={variableV3.description || ''}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tonSelect(variableV3);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tbody={renderTooltipBody(variable[key] as VariableV3)}\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\tvariant={'default'}\n\t\t\t\t\t\t\tversion=\"2.0\"\n\t\t\t\t\t\t\tlistItem={{\n\t\t\t\t\t\t\t\tlabel: variable[key].displayName,\n\t\t\t\t\t\t\t\tvalue: variable[key].displayName,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcustomListItemLabel={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BodySecondary\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\t\t\t\t\tcolor: COLORS.text.primary,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{highlightSearchText(variable[key].displayName, searchText)}\n\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tleadingIcon={<SubCategoryIcon width={14} height={14} />}\n\t\t\t\t\t\t\tsubText={variable[key].description || ''}\n\t\t\t\t\t\t\ttrailingIcon={\n\t\t\t\t\t\t\t\t<ChevronRight width={10} height={10} color=\"#212121\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t// Save current scroll position before navigating into subcategory\n\t\t\t\t\t\t\t\tif (containerRef.current) {\n\t\t\t\t\t\t\t\t\tscrollPositionStack.current.push(containerRef.current.scrollTop);\n\t\t\t\t\t\t\t\t\tcontainerRef.current.scrollTop = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst currentVariable = cloneDeep(variable[key]) as SubHeader;\n\t\t\t\t\t\t\t\tif (typeof parentVariable !== 'undefined') {\n\t\t\t\t\t\t\t\t\tcurrentVariable.contextQ = [parentVariable.displayName];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst stack = [...subHeaderStack, currentVariable];\n\t\t\t\t\t\t\t\tsetSubHeaderStack(stack);\n\t\t\t\t\t\t\t\tif (showRecommended) {\n\t\t\t\t\t\t\t\t\tconst recommended = showOnlyRecommendedVariables(\n\t\t\t\t\t\t\t\t\t\t[currentVariable.variables],\n\t\t\t\t\t\t\t\t\t\tstack,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetVariables(recommended);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsetVariables([currentVariable.variables]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n};\n\nexport default SubHeaderItem;\n"],"names":["renderTooltipBody","variable","_a","contextQ","join","SubHeaderItem","props","onSelect","searchText","disabled","parentVariable","subHeaderStack","setSubHeaderStack","setVariables","showRecommended","containerRef","scrollPositionStack","useVariablePickerContext","_jsx","Object","assign","style","display","flexDirection","gap","children","keys","map","key","index","variables","length","variableV3","Tooltip","body","placement","ListItem","variant","selected","version","leadingIcon","_Fragment","flexShrink","AddIcon","width","height","customListItemLabel","_jsxs","BodySecondary","fontSize","color","COLORS","text","primary","highlightSearchText","displayName","isAvailable","marginTop","WarnIcon","content","secondary","listItem","label","value","subText","description","onClick","alignItems","SubCategoryIcon","trailingIcon","ChevronRight","current","push","scrollTop","currentVariable","cloneDeep","stack","recommended","showOnlyRecommendedVariables"],"mappings":"4rBAsBaA,MAAAA,EAAqBC,UACjC,OAAwB,QAAjBC,EAAAD,EAASE,gBAAQ,IAAAD,OAAA,EAAAA,EAAEE,KAAK,SAAU,EAAE,EAGtCC,EAA2CC,IAChD,MAAMC,SAAEA,EAAQN,SAAEA,EAAQO,WAAEA,EAAUC,SAAEA,EAAQC,eAAEA,GAAmBJ,GAC/DK,eAAEA,EAAcC,kBAAEA,EAAiBC,aAAEA,EAAYC,gBAAEA,EAAeC,aAAEA,EAAYC,oBAAEA,GACvFC,IACD,OACCC,EAAA,MAAAC,OAAAC,OAAA,CAAKC,MAAO,CAAEC,QAAS,OAAQC,cAAe,SAAUC,IAAK,IAAG,CAAAC,SAC9DN,OAAOO,KAAKzB,GAAU0B,KAAI,CAACC,EAAKC,WAChC,QACoC,IAA5B5B,EAAS2B,GAAKE,WACkC,IAAvDX,OAAOO,MAAoB,QAAfxB,EAAAD,EAAS2B,UAAM,IAAA1B,OAAA,EAAAA,EAAA4B,YAAa,CAAE,GAAEC,OAC3C,CACD,MAAMC,EAAa/B,EAAS2B,GAC5B,OACCV,EAACe,EAAOd,OAAAC,OAAA,CAEPc,KAAMlC,EAAkBgC,GACxBG,UAAU,UAEV,CAAAV,SAAAP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7B,OAAAC,OAAA,CAAAC,MAAO,CACN4B,SAAU,OACVC,MAAOC,EAAOC,KAAKC,UACnB,CAAA5B,SAEA6B,EAAoBrD,EAAS2B,GAAK2B,YAAa/C,SAInDgC,YAAatB,EAACkD,EAAgB,CAAAxB,MAAO,GAAIC,OAAQ,KACjDmB,QAAS/D,EAAS2B,GAAKqC,aAAe,GACtCI,aACCnD,EAACoD,EAAY,CAAC1B,MAAO,GAAIC,OAAQ,GAAIK,MAAM,YAE5CgB,QAASA,KAEJnD,EAAawD,UAChBvD,EAAoBuD,QAAQC,KAAKzD,EAAawD,QAAQE,WACtD1D,EAAawD,QAAQE,UAAY,GAElC,MAAMC,EAAkBC,EAAU1E,EAAS2B,SACb,IAAnBlB,IACVgE,EAAgBvE,SAAW,CAACO,EAAe6C,cAE5C,MAAMqB,EAAQ,IAAIjE,EAAgB+D,GAElC,GADA9D,EAAkBgE,GACd9D,EAAiB,CACpB,MAAM+D,EAAcC,EACnB,CAACJ,EAAgB5C,WACjB8C,GAED/D,EAAagE,EACb,MACAhE,EAAa,CAAC6D,EAAgB5C,WAC9B,MArDED,EAwDI,MAGP"}
@@ -1,2 +1,2 @@
1
- import e,{useContext as t}from"react";const a=e.createContext({searchText:"",setSearchText:()=>{},subHeaderStack:[],setSubHeaderStack:()=>{},variables:[],setVariables:()=>{},showRecommended:!1,setShowRecommended:()=>{}}),r=()=>t(a);export{a as VariablePickerContext,r as useVariablePickerContext};
1
+ import e,{useContext as t}from"react";const r=e.createContext({searchText:"",setSearchText:()=>{},subHeaderStack:[],setSubHeaderStack:()=>{},variables:[],setVariables:()=>{},showRecommended:!1,setShowRecommended:()=>{},containerRef:{current:null},scrollPositionStack:{current:[]}}),a=()=>t(r);export{r as VariablePickerContext,a as useVariablePickerContext};
2
2
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/variable-picker-v3/context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useContext } from 'react';\n\nexport const VariablePickerContext = React.createContext<{\n\tsearchText: string;\n\tsetSearchText: React.Dispatch<React.SetStateAction<string>>;\n\tsubHeaderStack: any[]; // TODO: type this\n\tsetSubHeaderStack: React.Dispatch<React.SetStateAction<any[]>>;\n\tvariables: any[]; // TODO: type this\n\tsetVariables: React.Dispatch<React.SetStateAction<any[]>>;\n\tshowRecommended: boolean;\n\tsetShowRecommended: React.Dispatch<React.SetStateAction<boolean>>;\n}>({\n\tsearchText: '',\n\tsetSearchText: () => {},\n\tsubHeaderStack: [],\n\tsetSubHeaderStack: () => {},\n\tvariables: [],\n\tsetVariables: () => {},\n\tshowRecommended: false,\n\tsetShowRecommended: () => {},\n});\n\nexport const useVariablePickerContext = () => useContext(VariablePickerContext);\n"],"names":["VariablePickerContext","React","createContext","searchText","setSearchText","subHeaderStack","setSubHeaderStack","variables","setVariables","showRecommended","setShowRecommended","useVariablePickerContext","useContext"],"mappings":"4CAGaA,EAAwBC,EAAMC,cASxC,CACFC,WAAY,GACZC,cAAeA,OACfC,eAAgB,GAChBC,kBAAmBA,OACnBC,UAAW,GACXC,aAAcA,OACdC,iBAAiB,EACjBC,mBAAoBA,SAGRC,EAA2BA,IAAMC,EAAWZ"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/variable-picker-v3/context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport React, { useContext } from 'react';\n\nexport const VariablePickerContext = React.createContext<{\n\tsearchText: string;\n\tsetSearchText: React.Dispatch<React.SetStateAction<string>>;\n\tsubHeaderStack: any[]; // TODO: type this\n\tsetSubHeaderStack: React.Dispatch<React.SetStateAction<any[]>>;\n\tvariables: any[]; // TODO: type this\n\tsetVariables: React.Dispatch<React.SetStateAction<any[]>>;\n\tshowRecommended: boolean;\n\tsetShowRecommended: React.Dispatch<React.SetStateAction<boolean>>;\n\tcontainerRef: React.RefObject<HTMLDivElement | null>;\n\tscrollPositionStack: React.MutableRefObject<number[]>;\n}>({\n\tsearchText: '',\n\tsetSearchText: () => {},\n\tsubHeaderStack: [],\n\tsetSubHeaderStack: () => {},\n\tvariables: [],\n\tsetVariables: () => {},\n\tshowRecommended: false,\n\tsetShowRecommended: () => {},\n\tcontainerRef: { current: null },\n\tscrollPositionStack: { current: [] },\n});\n\nexport const useVariablePickerContext = () => useContext(VariablePickerContext);\n"],"names":["VariablePickerContext","React","createContext","searchText","setSearchText","subHeaderStack","setSubHeaderStack","variables","setVariables","showRecommended","setShowRecommended","containerRef","current","scrollPositionStack","useVariablePickerContext","useContext"],"mappings":"4CAGaA,EAAwBC,EAAMC,cAWxC,CACFC,WAAY,GACZC,cAAeA,OACfC,eAAgB,GAChBC,kBAAmBA,OACnBC,UAAW,GACXC,aAAcA,OACdC,iBAAiB,EACjBC,mBAAoBA,OACpBC,aAAc,CAAEC,QAAS,MACzBC,oBAAqB,CAAED,QAAS,MAGpBE,EAA2BA,IAAMC,EAAWf"}
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as n}from"react/jsx-runtime";import{getMarkRange as e}from"../node_modules/@tiptap/core/dist/index.js";import{useEditor as o,EditorContent as r}from"@tiptap/react";import{forwardRef as i,useRef as l,useEffect as s,useImperativeHandle as c}from"react";import{BikEditorShell as a}from"./BikEditor.styles.js";import{DEFAULT_FORMAT_STATE as u}from"./BikEditor.types.js";import{buildSectionedContent as d,normalizeHtml as m,extractContent as g,extractActiveFormats as v,extractSectionContent as h,extractBodyContent as f,insertInlineHtml as p,setSectionContentInEditor as C,findSectionEndPos as S,findSectionStartPos as k}from"./BikEditor.utils.js";import{buildExtensions as y}from"./extensions/buildExtensions.js";import{LinkBubbleMenu as x}from"./floating/LinkBubbleMenu.js";function B(t){return Object.entries(t).map((t=>{let[n,e]=t;return`${n.replace(/([A-Z])/g,(t=>`-${t.toLowerCase()}`))}:${e}`})).join(";")}const b=i(((i,b)=>{var A,I,j,L,E,O,T;const{initialContent:w,sections:F,features:H,disabled:M,maxCharacters:z,shortcuts:R,sendShortcut:D,mentions:N,slashCommands:U,link:P,onPaste:$,onReady:q,onChange:G,onSend:J,onFocus:V,onBlur:W,onSelectionChange:Z,minHeight:_,maxHeight:K,paragraphGap:Q,style:X,className:Y,editorClassName:tt,editorStyle:nt}=i,et=(null==F?void 0:F.length)?d(m(null!=w?w:""),F.map((t=>Object.assign(Object.assign({},t),{content:m(t.content)})))):m(null!=w?w:""),ot=l([]),rt=l(!1),it=l(q);it.current=q;const lt=l(G);lt.current=G;const st=l(Z);st.current=Z;const ct=l(V);ct.current=V;const at=l(W);at.current=W;const ut=l(J);ut.current=J;const dt=l(null!==(A=null==N?void 0:N.agents)&&void 0!==A?A:[]);dt.current=null!==(I=null==N?void 0:N.agents)&&void 0!==I?I:[];const mt=l(null!==(j=null==N?void 0:N.teams)&&void 0!==j?j:[]);mt.current=null!==(L=null==N?void 0:N.teams)&&void 0!==L?L:[];const gt=l(null!==(E=null==U?void 0:U.items)&&void 0!==E?E:[]);gt.current=null!==(O=null==U?void 0:U.items)&&void 0!==O?O:[];const vt=o({extensions:y({features:H,placeholder:i.placeholder,maxCharacters:z,hasSections:(null!==(T=null==F?void 0:F.length)&&void 0!==T?T:0)>0,mentions:{agents:N?dt:void 0,teams:N?mt:void 0},slashCommands:U?gt:void 0,onPaste:$,onSend:J?t=>{var n;return null===(n=ut.current)||void 0===n?void 0:n.call(ut,t)}:void 0,sendShortcut:D,shortcuts:R,onMentionSelected:null==N?void 0:N.onSelect,onSlashCommandSelected:null==U?void 0:U.onSelect,renderMentionItem:null==N?void 0:N.renderItem,renderMentionDropdown:null==N?void 0:N.renderDropdown,renderSlashCommandItem:null==U?void 0:U.renderItem,renderSlashCommandDropdown:null==U?void 0:U.renderDropdown}),content:et,editable:!M,immediatelyRender:!1,editorProps:{attributes:Object.assign(Object.assign({},tt?{class:tt}:{}),nt?{style:B(nt)}:{})},onUpdate:t=>{let{editor:n}=t;var e;null===(e=lt.current)||void 0===e||e.call(lt,g(n))},onTransaction:t=>{let{editor:n}=t;var e;null===(e=st.current)||void 0===e||e.call(st,v(n))},onFocus:()=>{var t;return null===(t=ct.current)||void 0===t?void 0:t.call(ct)},onBlur:()=>{var t;return null===(t=at.current)||void 0===t?void 0:t.call(at)}});function ht(t){vt?t(vt):ot.current.push(t)}return s((()=>{var t;if(vt){if(ot.current.length>0){ot.current.splice(0).forEach((t=>t(vt)))}rt.current||(rt.current=!0,null===(t=it.current)||void 0===t||t.call(it))}}),[vt]),c(b,(()=>({focus:t=>ht((n=>n.commands.focus(t))),blur:()=>ht((t=>t.commands.blur())),clearContent:()=>ht((t=>t.commands.clearContent(!0))),setContent:t=>{const n=m(t);ht((t=>t.commands.setContent(n,{emitUpdate:!0})))},insertContent:t=>{const n=m(t);ht((t=>t.commands.insertContent(n)))},insertInlineContent:t=>{ht((n=>p(n,t)))},insertAtStart:t=>{const n=m(t);ht((t=>t.commands.insertContentAt(1,n)))},insertBlock:t=>{const n=m(t);ht((t=>t.commands.insertContentAt(t.state.doc.content.size,n)))},appendInline:t=>{const n=m(t);ht((t=>t.commands.insertContentAt(t.state.doc.content.size-1,n)))},insertAtEnd(t){this.insertBlock(t)},appendContent(t){this.appendInline(t)},getContent:()=>vt?g(vt):{html:"",text:"",isEmpty:!0,characterCount:0},getJSON:()=>{var t;return null!==(t=null==vt?void 0:vt.getJSON())&&void 0!==t?t:null},getMentions:()=>{const t=new Set,n=new Set;return vt?(vt.state.doc.descendants((e=>{"mentionAgent"===e.type.name&&null!=e.attrs.id?t.add(String(e.attrs.id)):"mentionTeam"===e.type.name&&null!=e.attrs.id&&n.add(String(e.attrs.id))})),{agentIds:Array.from(t),teamIds:Array.from(n)}):{agentIds:[],teamIds:[]}},getCursorPosition:()=>{if(!vt)return{from:0,to:0};const{from:t,to:n}=vt.state.selection;return{from:t,to:n}},insertAtPosition:(t,n)=>{const e=m(n);ht((n=>n.commands.insertContentAt(t,e)))},getSelectedText:()=>{if(!vt)return"";const{state:t}=vt,{from:n,to:o,empty:r}=t.selection;if(!r)return t.doc.textBetween(n,o," ");const i=t.schema.marks.link;if(i){const o=e(t.doc.resolve(n),i);if(o)return t.doc.textBetween(o.from,o.to," ")}return""},getCharacterCount:()=>{var t,n,e,o;return{count:null!==(o=null!==(e=null===(n=null===(t=null==vt?void 0:vt.storage.characterCount)||void 0===t?void 0:t.characters)||void 0===n?void 0:n.call(t))&&void 0!==e?e:null==vt?void 0:vt.getText().length)&&void 0!==o?o:0,limit:null!=z?z:null}},getSectionContent:t=>vt?h(vt,t):{html:"",text:"",isEmpty:!0,characterCount:0},setSectionContent:(t,n)=>{const e=m(n);ht((n=>C(n,t,e)))},focusSection:t=>{ht((n=>{if("body"===t){let t=n.state.doc.content.size-1;return n.state.doc.descendants(((e,o)=>("sectionDivider"===e.type.name&&t===n.state.doc.content.size-1&&(t=o-1),t===n.state.doc.content.size-1))),t<1&&(t=1),void n.chain().focus().setTextSelection(t).run()}let e=-1;n.state.doc.descendants(((n,o)=>{if(-1!==e)return!1;"sectionDivider"===n.type.name&&n.attrs.sectionId===t&&(e=o+n.nodeSize+1)})),-1!==e&&n.chain().focus().setTextSelection(e).run()}))},clearSection:t=>{ht((n=>C(n,t,"<p></p>")))},getBodyContent:()=>vt?f(vt):{html:"",text:"",isEmpty:!0,characterCount:0},setBodyContent:t=>{const n=m(t);ht((t=>C(t,"body",n)))},setBodyAndSections:(t,n)=>{const e=d(m(t),n.map((t=>({id:t.id,content:m(t.content)}))));ht((t=>t.commands.setContent(e,{emitUpdate:!0})))},appendBodyContent:t=>{const n=m(t);ht((t=>{const e=S(t,"body");t.commands.insertContentAt(e-1,n)}))},insertAtSectionStart:(t,n)=>{const e=m(n);ht((n=>{const o=k(n,t);-1!==o&&n.commands.insertContentAt(o,e)}))},insertAtSectionEnd:(t,n)=>{const e=m(n);ht((n=>{const o=S(n,t);n.commands.insertContentAt(o,e)}))},getActiveFormats:()=>vt?v(vt):u,actions:{toggleBold:()=>null==vt?void 0:vt.chain().focus().toggleBold().run(),toggleItalic:()=>null==vt?void 0:vt.chain().focus().toggleItalic().run(),toggleUnderline:()=>null==vt?void 0:vt.chain().focus().toggleUnderline().run(),toggleStrike:()=>null==vt?void 0:vt.chain().focus().toggleStrike().run(),toggleBulletList:()=>null==vt?void 0:vt.chain().focus().toggleBulletList().run(),toggleOrderedList:()=>null==vt?void 0:vt.chain().focus().toggleOrderedList().run(),toggleBlockquote:()=>null==vt?void 0:vt.chain().focus().toggleBlockquote().run(),toggleCodeBlock:()=>null==vt?void 0:vt.chain().focus().toggleCodeBlock().run(),setTextAlign:t=>null==vt?void 0:vt.chain().focus().setTextAlign(t).run(),setFontFamily:t=>null==vt?void 0:vt.chain().focus().setFontFamily(t).run(),setFontSize:t=>null==vt?void 0:vt.chain().focus().setFontSize(t).run(),setColor:t=>null==vt?void 0:vt.chain().focus().setColor(t).run(),setHighlight:t=>null==vt?void 0:vt.chain().focus().toggleHighlight({color:t}).run(),unsetColor:()=>null==vt?void 0:vt.chain().focus().unsetColor().run(),unsetHighlight:()=>null==vt?void 0:vt.chain().focus().unsetHighlight().run(),setLink:(t,n)=>{vt&&(void 0!==n?vt.chain().focus().extendMarkRange("link").command((e=>{let{tr:o,state:r}=e;const{from:i,to:l}=o.selection,s=r.schema.marks.link;if(!s)return!1;const c=r.schema.text(n,[s.create({href:t})]),a=r.schema.text(" ");return o.replaceWith(i,l,[c,a]),!0})).run():vt.chain().focus().extendMarkRange("link").setLink({href:t}).insertContent(" ").run())},updateLink:t=>null==vt?void 0:vt.chain().focus().extendMarkRange("link").setLink({href:t}).run(),removeLink:()=>null==vt?void 0:vt.chain().focus().extendMarkRange("link").unsetLink().run(),insertEmoji:t=>null==vt?void 0:vt.chain().focus().insertContent(t).run(),insertVariable:t=>null==vt?void 0:vt.chain().focus().insertContent(`{{${t}}}`).run(),insertHtml:t=>null==vt?void 0:vt.commands.insertContent(m(t)),undo:()=>null==vt?void 0:vt.chain().focus().undo().run(),redo:()=>null==vt?void 0:vt.chain().focus().redo().run(),canUndo:()=>{var t;return null!==(t=null==vt?void 0:vt.can().undo())&&void 0!==t&&t},canRedo:()=>{var t;return null!==(t=null==vt?void 0:vt.can().redo())&&void 0!==t&&t},toggleSuperscript:()=>null==vt?void 0:vt.chain().focus().toggleSuperscript().run(),toggleSubscript:()=>null==vt?void 0:vt.chain().focus().toggleSubscript().run(),insertImage:t=>null==vt?void 0:vt.chain().focus().setImage({src:t}).run()}})),[vt]),vt?t(a,Object.assign({minHeight:_,maxHeight:K,paragraphGap:Q,style:X,className:Y},{children:[n(r,{editor:vt}),n(x,{editor:vt,renderLinkTooltip:null==P?void 0:P.renderTooltip})]})):null}));b.displayName="BikEditor";export{b as BikEditor};
1
+ import{jsxs as t,jsx as n}from"react/jsx-runtime";import{getMarkRange as e}from"../node_modules/@tiptap/core/dist/index.js";import{useEditor as o,EditorContent as i}from"@tiptap/react";import{forwardRef as r,useRef as l,useEffect as s,useImperativeHandle as c}from"react";import{BikEditorShell as u}from"./BikEditor.styles.js";import{DEFAULT_FORMAT_STATE as d}from"./BikEditor.types.js";import{buildSectionedContent as a,normalizeHtml as m,extractContent as g,extractActiveFormats as v,extractSectionContent as h,extractBodyContent as f,insertInlineHtml as p,setSectionContentInEditor as C,findSectionEndPos as S,findSectionStartPos as k}from"./BikEditor.utils.js";import{buildExtensions as y}from"./extensions/buildExtensions.js";import{LinkBubbleMenu as x}from"./floating/LinkBubbleMenu.js";function B(t){return Object.entries(t).map((t=>{let[n,e]=t;return`${n.replace(/([A-Z])/g,(t=>`-${t.toLowerCase()}`))}:${e}`})).join(";")}const b=r(((r,b)=>{var A,I,j,L,E,O,T;const{initialContent:w,sections:F,features:H,disabled:M,maxCharacters:z,shortcuts:R,sendShortcut:D,mentions:N,slashCommands:U,link:P,onPaste:$,onReady:q,onChange:J,onSend:V,onFocus:W,onBlur:Z,onSelectionChange:_,minHeight:G,maxHeight:K,style:Q,className:X,editorClassName:Y,editorStyle:tt}=r,nt=(null==F?void 0:F.length)?a(m(null!=w?w:""),F.map((t=>Object.assign(Object.assign({},t),{content:m(t.content)})))):m(null!=w?w:""),et=l([]),ot=l(!1),it=l(q);it.current=q;const rt=l(J);rt.current=J;const lt=l(_);lt.current=_;const st=l(W);st.current=W;const ct=l(Z);ct.current=Z;const ut=l(V);ut.current=V;const dt=l(null!==(A=null==N?void 0:N.agents)&&void 0!==A?A:[]);dt.current=null!==(I=null==N?void 0:N.agents)&&void 0!==I?I:[];const at=l(null!==(j=null==N?void 0:N.teams)&&void 0!==j?j:[]);at.current=null!==(L=null==N?void 0:N.teams)&&void 0!==L?L:[];const mt=l(null!==(E=null==U?void 0:U.items)&&void 0!==E?E:[]);mt.current=null!==(O=null==U?void 0:U.items)&&void 0!==O?O:[];const gt=o({extensions:y({features:H,placeholder:r.placeholder,maxCharacters:z,hasSections:(null!==(T=null==F?void 0:F.length)&&void 0!==T?T:0)>0,mentions:{agents:N?dt:void 0,teams:N?at:void 0},slashCommands:U?mt:void 0,onPaste:$,onSend:V?t=>{var n;return null===(n=ut.current)||void 0===n?void 0:n.call(ut,t)}:void 0,sendShortcut:D,shortcuts:R,onMentionSelected:null==N?void 0:N.onSelect,onSlashCommandSelected:null==U?void 0:U.onSelect,renderMentionItem:null==N?void 0:N.renderItem,renderMentionDropdown:null==N?void 0:N.renderDropdown,renderSlashCommandItem:null==U?void 0:U.renderItem,renderSlashCommandDropdown:null==U?void 0:U.renderDropdown}),content:nt,editable:!M,immediatelyRender:!1,editorProps:{attributes:Object.assign(Object.assign({},Y?{class:Y}:{}),tt?{style:B(tt)}:{})},onUpdate:t=>{let{editor:n}=t;var e;null===(e=rt.current)||void 0===e||e.call(rt,g(n))},onTransaction:t=>{let{editor:n}=t;var e;null===(e=lt.current)||void 0===e||e.call(lt,v(n))},onFocus:()=>{var t;return null===(t=st.current)||void 0===t?void 0:t.call(st)},onBlur:()=>{var t;return null===(t=ct.current)||void 0===t?void 0:t.call(ct)}});function vt(t){gt?t(gt):et.current.push(t)}return s((()=>{var t;if(gt){if(et.current.length>0){et.current.splice(0).forEach((t=>t(gt)))}ot.current||(ot.current=!0,null===(t=it.current)||void 0===t||t.call(it))}}),[gt]),c(b,(()=>({focus:t=>vt((n=>n.commands.focus(t))),blur:()=>vt((t=>t.commands.blur())),clearContent:()=>vt((t=>t.commands.clearContent(!0))),setContent:t=>{const n=m(t);vt((t=>t.commands.setContent(n,{emitUpdate:!0})))},insertContent:t=>{const n=m(t);vt((t=>t.commands.insertContent(n)))},insertInlineContent:t=>{vt((n=>p(n,t)))},insertAtStart:t=>{const n=m(t);vt((t=>t.commands.insertContentAt(1,n)))},insertBlock:t=>{const n=m(t);vt((t=>t.commands.insertContentAt(t.state.doc.content.size,n)))},appendInline:t=>{const n=m(t);vt((t=>t.commands.insertContentAt(t.state.doc.content.size-1,n)))},insertAtEnd(t){this.insertBlock(t)},appendContent(t){this.appendInline(t)},getContent:()=>gt?g(gt):{html:"",text:"",isEmpty:!0,characterCount:0},getJSON:()=>{var t;return null!==(t=null==gt?void 0:gt.getJSON())&&void 0!==t?t:null},getMentions:()=>{const t=new Set,n=new Set;return gt?(gt.state.doc.descendants((e=>{"mentionAgent"===e.type.name&&null!=e.attrs.id?t.add(String(e.attrs.id)):"mentionTeam"===e.type.name&&null!=e.attrs.id&&n.add(String(e.attrs.id))})),{agentIds:Array.from(t),teamIds:Array.from(n)}):{agentIds:[],teamIds:[]}},getCursorPosition:()=>{if(!gt)return{from:0,to:0};const{from:t,to:n}=gt.state.selection;return{from:t,to:n}},insertAtPosition:(t,n)=>{const e=m(n);vt((n=>n.commands.insertContentAt(t,e)))},getSelectedText:()=>{if(!gt)return"";const{state:t}=gt,{from:n,to:o,empty:i}=t.selection;if(!i)return t.doc.textBetween(n,o," ");const r=t.schema.marks.link;if(r){const o=e(t.doc.resolve(n),r);if(o)return t.doc.textBetween(o.from,o.to," ")}return""},getCharacterCount:()=>{var t,n,e,o;return{count:null!==(o=null!==(e=null===(n=null===(t=null==gt?void 0:gt.storage.characterCount)||void 0===t?void 0:t.characters)||void 0===n?void 0:n.call(t))&&void 0!==e?e:null==gt?void 0:gt.getText().length)&&void 0!==o?o:0,limit:null!=z?z:null}},getSectionContent:t=>gt?h(gt,t):{html:"",text:"",isEmpty:!0,characterCount:0},setSectionContent:(t,n)=>{const e=m(n);vt((n=>C(n,t,e)))},focusSection:t=>{vt((n=>{if("body"===t){let t=n.state.doc.content.size-1;return n.state.doc.descendants(((e,o)=>("sectionDivider"===e.type.name&&t===n.state.doc.content.size-1&&(t=o-1),t===n.state.doc.content.size-1))),t<1&&(t=1),void n.chain().focus().setTextSelection(t).run()}let e=-1;n.state.doc.descendants(((n,o)=>{if(-1!==e)return!1;"sectionDivider"===n.type.name&&n.attrs.sectionId===t&&(e=o+n.nodeSize+1)})),-1!==e&&n.chain().focus().setTextSelection(e).run()}))},clearSection:t=>{vt((n=>C(n,t,"<p></p>")))},getBodyContent:()=>gt?f(gt):{html:"",text:"",isEmpty:!0,characterCount:0},setBodyContent:t=>{const n=m(t);vt((t=>C(t,"body",n)))},setBodyAndSections:(t,n)=>{const e=a(m(t),n.map((t=>({id:t.id,content:m(t.content)}))));vt((t=>t.commands.setContent(e,{emitUpdate:!0})))},appendBodyContent:t=>{const n=m(t);vt((t=>{const e=S(t,"body");t.commands.insertContentAt(e-1,n)}))},insertAtSectionStart:(t,n)=>{const e=m(n);vt((n=>{const o=k(n,t);-1!==o&&n.commands.insertContentAt(o,e)}))},insertAtSectionEnd:(t,n)=>{const e=m(n);vt((n=>{const o=S(n,t);n.commands.insertContentAt(o,e)}))},getActiveFormats:()=>gt?v(gt):d,actions:{toggleBold:()=>null==gt?void 0:gt.chain().focus().toggleBold().run(),toggleItalic:()=>null==gt?void 0:gt.chain().focus().toggleItalic().run(),toggleUnderline:()=>null==gt?void 0:gt.chain().focus().toggleUnderline().run(),toggleStrike:()=>null==gt?void 0:gt.chain().focus().toggleStrike().run(),toggleBulletList:()=>null==gt?void 0:gt.chain().focus().toggleBulletList().run(),toggleOrderedList:()=>null==gt?void 0:gt.chain().focus().toggleOrderedList().run(),toggleBlockquote:()=>null==gt?void 0:gt.chain().focus().toggleBlockquote().run(),toggleCodeBlock:()=>null==gt?void 0:gt.chain().focus().toggleCodeBlock().run(),setTextAlign:t=>null==gt?void 0:gt.chain().focus().setTextAlign(t).run(),setFontFamily:t=>null==gt?void 0:gt.chain().focus().setFontFamily(t).run(),setFontSize:t=>null==gt?void 0:gt.chain().focus().setFontSize(t).run(),setColor:t=>null==gt?void 0:gt.chain().focus().setColor(t).run(),setHighlight:t=>null==gt?void 0:gt.chain().focus().toggleHighlight({color:t}).run(),unsetColor:()=>null==gt?void 0:gt.chain().focus().unsetColor().run(),unsetHighlight:()=>null==gt?void 0:gt.chain().focus().unsetHighlight().run(),setLink:(t,n)=>{gt&&(void 0!==n?gt.chain().focus().extendMarkRange("link").command((e=>{let{tr:o,state:i}=e;const{from:r,to:l}=o.selection,s=i.schema.marks.link;if(!s)return!1;const c=i.schema.text(n,[s.create({href:t})]),u=i.schema.text(" ");return o.replaceWith(r,l,[c,u]),!0})).run():gt.chain().focus().extendMarkRange("link").setLink({href:t}).insertContent(" ").run())},updateLink:t=>null==gt?void 0:gt.chain().focus().extendMarkRange("link").setLink({href:t}).run(),removeLink:()=>null==gt?void 0:gt.chain().focus().extendMarkRange("link").unsetLink().run(),insertEmoji:t=>null==gt?void 0:gt.chain().focus().insertContent(t).run(),insertVariable:t=>null==gt?void 0:gt.chain().focus().insertContent(`{{${t}}}`).run(),insertHtml:t=>null==gt?void 0:gt.commands.insertContent(m(t)),undo:()=>null==gt?void 0:gt.chain().focus().undo().run(),redo:()=>null==gt?void 0:gt.chain().focus().redo().run(),canUndo:()=>{var t;return null!==(t=null==gt?void 0:gt.can().undo())&&void 0!==t&&t},canRedo:()=>{var t;return null!==(t=null==gt?void 0:gt.can().redo())&&void 0!==t&&t},toggleSuperscript:()=>null==gt?void 0:gt.chain().focus().toggleSuperscript().run(),toggleSubscript:()=>null==gt?void 0:gt.chain().focus().toggleSubscript().run(),insertImage:t=>null==gt?void 0:gt.chain().focus().setImage({src:t}).run()}})),[gt]),gt?t(u,Object.assign({minHeight:G,maxHeight:K,style:Q,className:X},{children:[n(i,{editor:gt}),n(x,{editor:gt,renderLinkTooltip:null==P?void 0:P.renderTooltip})]})):null}));b.displayName="BikEditor";export{b as BikEditor};
2
2
  //# sourceMappingURL=BikEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditor.js","sources":["../../../src/editor/BikEditor.tsx"],"sourcesContent":["'use client';\n\n/**\n * IMPLEMENTATION LAYER — TipTap-specific.\n * If the underlying editor is swapped, this file changes; BikEditor.types.ts and\n * src/editor/index.ts (the consumer contract) do NOT change.\n */\nimport { Editor, getMarkRange } from '@tiptap/core';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n} from 'react';\nimport { BikEditorShell } from './BikEditor.styles';\nimport {\n\tBikEditorProps,\n\tBikEditorRef,\n\tDEFAULT_FORMAT_STATE,\n} from './BikEditor.types';\nimport {\n\tbuildSectionedContent,\n\textractActiveFormats,\n\textractBodyContent,\n\textractContent,\n\textractSectionContent,\n\tfindSectionEndPos,\n\tfindSectionStartPos,\n\tinsertInlineHtml,\n\tnormalizeHtml,\n\tsetSectionContentInEditor,\n} from './BikEditor.utils';\nimport { buildExtensions } from './extensions/buildExtensions';\nimport { LinkBubbleMenu } from './floating/LinkBubbleMenu';\n\n/** Convert React.CSSProperties to an inline CSS string for editorProps.attributes. */\nfunction cssToString(style: React.CSSProperties): string {\n\treturn Object.entries(style)\n\t\t.map(\n\t\t\t([k, v]) => `${k.replace(/([A-Z])/g, (c) => `-${c.toLowerCase()}`)}:${v}`,\n\t\t)\n\t\t.join(';');\n}\n\nconst BikEditorInner = (\n\tprops: BikEditorProps,\n\tref: React.Ref<BikEditorRef>,\n) => {\n\tconst {\n\t\tinitialContent,\n\t\tsections,\n\t\tfeatures,\n\t\tdisabled,\n\t\tmaxCharacters,\n\t\tshortcuts,\n\t\tsendShortcut,\n\t\tmentions,\n\t\tslashCommands,\n\t\tlink,\n\t\tonPaste,\n\t\tonReady,\n\t\tonChange,\n\t\tonSend,\n\t\tonFocus,\n\t\tonBlur,\n\t\tonSelectionChange,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tparagraphGap,\n\t\tstyle,\n\t\tclassName,\n\t\teditorClassName,\n\t\teditorStyle,\n\t} = props;\n\n\tconst initialEditorContent = sections?.length\n\t\t? buildSectionedContent(\n\t\t\t\tnormalizeHtml(initialContent ?? ''),\n\t\t\t\tsections.map((s) => ({ ...s, content: normalizeHtml(s.content) })),\n\t\t )\n\t\t: normalizeHtml(initialContent ?? '');\n\n\t// ── Command queue ─────────────────────────────────────────────────────────\n\t// TipTap's useEditor initializes asynchronously; the editor instance is null\n\t// until the first commit. Any imperative method called before the editor is\n\t// ready is enqueued here and flushed automatically once it becomes non-null.\n\t// Consumers never need setTimeout or readiness guards.\n\tconst pendingQueue = useRef<Array<(e: Editor) => void>>([]);\n\tconst hasCalledOnReady = useRef(false);\n\t// Keep stable refs to all callbacks so useEditor receives the same function\n\t// identity on every render — prevents TipTap from re-registering event\n\t// handlers every time the parent re-renders with new inline function props.\n\tconst onReadyRef = useRef(onReady);\n\tonReadyRef.current = onReady;\n\tconst onChangeRef = useRef(onChange);\n\tonChangeRef.current = onChange;\n\tconst onSelectionChangeRef = useRef(onSelectionChange);\n\tonSelectionChangeRef.current = onSelectionChange;\n\tconst onFocusRef = useRef(onFocus);\n\tonFocusRef.current = onFocus;\n\tconst onBlurRef = useRef(onBlur);\n\tonBlurRef.current = onBlur;\n\tconst onSendRef = useRef(onSend);\n\tonSendRef.current = onSend;\n\tconst agentMentionsRef = useRef(mentions?.agents ?? []);\n\tagentMentionsRef.current = mentions?.agents ?? [];\n\tconst teamMentionsRef = useRef(mentions?.teams ?? []);\n\tteamMentionsRef.current = mentions?.teams ?? [];\n\tconst slashCommandsRef = useRef(slashCommands?.items ?? []);\n\tslashCommandsRef.current = slashCommands?.items ?? [];\n\n\tconst editor = useEditor({\n\t\textensions: buildExtensions({\n\t\t\tfeatures,\n\t\t\tplaceholder: props.placeholder,\n\t\t\tmaxCharacters,\n\t\t\thasSections: (sections?.length ?? 0) > 0,\n\t\t\tmentions: {\n\t\t\t\tagents: mentions ? agentMentionsRef : undefined,\n\t\t\t\tteams: mentions ? teamMentionsRef : undefined,\n\t\t\t},\n\t\t\tslashCommands: slashCommands ? slashCommandsRef : undefined,\n\t\t\tonPaste,\n\t\t\tonSend: onSend ? (snapshot) => onSendRef.current?.(snapshot) : undefined,\n\t\t\tsendShortcut,\n\t\t\tshortcuts,\n\t\t\tonMentionSelected: mentions?.onSelect,\n\t\t\tonSlashCommandSelected: slashCommands?.onSelect,\n\t\t\trenderMentionItem: mentions?.renderItem,\n\t\t\trenderMentionDropdown: mentions?.renderDropdown,\n\t\t\trenderSlashCommandItem: slashCommands?.renderItem,\n\t\t\trenderSlashCommandDropdown: slashCommands?.renderDropdown,\n\t\t}),\n\t\tcontent: initialEditorContent,\n\t\teditable: !disabled,\n\t\timmediatelyRender: false, // SSR-safe — NEVER remove this\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\t...(editorClassName ? { class: editorClassName } : {}),\n\t\t\t\t...(editorStyle ? { style: cssToString(editorStyle) } : {}),\n\t\t\t},\n\t\t},\n\t\tonUpdate: ({ editor: e }) => {\n\t\t\tonChangeRef.current?.(extractContent(e));\n\t\t},\n\t\tonTransaction: ({ editor: e }) => {\n\t\t\tonSelectionChangeRef.current?.(extractActiveFormats(e));\n\t\t},\n\t\tonFocus: () => onFocusRef.current?.(),\n\t\tonBlur: () => onBlurRef.current?.(),\n\t});\n\n\t// ── enqueue ───────────────────────────────────────────────────────────────\n\t// Run immediately if the editor is ready; otherwise defer to the queue.\n\t// Closures passed to enqueue MUST capture all parameters explicitly —\n\t// they must NOT close over `editor` (which would be null at enqueue time).\n\tfunction enqueue(op: (e: Editor) => void): void {\n\t\tif (editor) {\n\t\t\top(editor);\n\t\t} else {\n\t\t\tpendingQueue.current.push(op);\n\t\t}\n\t}\n\n\t// Flush the pending queue and fire onReady when editor transitions null → ready.\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\t\tif (pendingQueue.current.length > 0) {\n\t\t\tconst queue = pendingQueue.current.splice(0);\n\t\t\tqueue.forEach((op) => op(editor));\n\t\t}\n\t\tif (!hasCalledOnReady.current) {\n\t\t\thasCalledOnReady.current = true;\n\t\t\tonReadyRef.current?.();\n\t\t}\n\t}, [editor]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\t// ── Focus ────────────────────────────────────────────────────────\n\t\t\tfocus: (position) => enqueue((e) => e.commands.focus(position)),\n\t\t\tblur: () => enqueue((e) => e.commands.blur()),\n\n\t\t\t// ── Content ──────────────────────────────────────────────────────\n\t\t\tclearContent: () => enqueue((e) => e.commands.clearContent(true)),\n\t\t\tsetContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.setContent(normalised, { emitUpdate: true }));\n\t\t\t},\n\t\t\tinsertContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContent(normalised));\n\t\t\t},\n\t\t\tinsertInlineContent: (html) => {\n\t\t\t\tenqueue((e) => insertInlineHtml(e, html));\n\t\t\t},\n\t\t\tinsertAtStart: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(1, normalised));\n\t\t\t},\n\t\t\tinsertBlock: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\tappendInline: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// doc.content.size is after the last </p> (block boundary).\n\t\t\t\t// Subtract 1 to land inside the last paragraph so text appends\n\t\t\t\t// inline rather than being wrapped in a new paragraph each call.\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size - 1, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\t// Backwards-compatible aliases\n\t\t\tinsertAtEnd(html) {\n\t\t\t\tthis.insertBlock(html);\n\t\t\t},\n\t\t\tappendContent(html) {\n\t\t\t\tthis.appendInline(html);\n\t\t\t},\n\t\t\tgetContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tgetJSON: () => editor?.getJSON() ?? null,\n\t\t\tgetMentions: () => {\n\t\t\t\tconst agentIds = new Set<string>();\n\t\t\t\tconst teamIds = new Set<string>();\n\t\t\t\tif (!editor) return { agentIds: [], teamIds: [] };\n\t\t\t\teditor.state.doc.descendants((node) => {\n\t\t\t\t\tif (node.type.name === 'mentionAgent' && node.attrs['id'] != null) {\n\t\t\t\t\t\tagentIds.add(String(node.attrs['id']));\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tnode.type.name === 'mentionTeam' &&\n\t\t\t\t\t\tnode.attrs['id'] != null\n\t\t\t\t\t) {\n\t\t\t\t\t\tteamIds.add(String(node.attrs['id']));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn { agentIds: Array.from(agentIds), teamIds: Array.from(teamIds) };\n\t\t\t},\n\n\t\t\t// ── Selection ────────────────────────────────────────────────────\n\t\t\tgetCursorPosition: () => {\n\t\t\t\tif (!editor) return { from: 0, to: 0 };\n\t\t\t\tconst { from, to } = editor.state.selection;\n\t\t\t\treturn { from, to };\n\t\t\t},\n\t\t\tinsertAtPosition: (pos, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(pos, normalised));\n\t\t\t},\n\t\t\tgetSelectedText: () => {\n\t\t\t\tif (!editor) return '';\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { from, to, empty } = state.selection;\n\t\t\t\tif (!empty) {\n\t\t\t\t\treturn state.doc.textBetween(from, to, ' ');\n\t\t\t\t}\n\t\t\t\t// When the cursor is inside a link with nothing selected, return the\n\t\t\t\t// full link text — useful for pre-filling a link modal's text field.\n\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\tif (linkMarkType) {\n\t\t\t\t\tconst range = getMarkRange(state.doc.resolve(from), linkMarkType);\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\treturn state.doc.textBetween(range.from, range.to, ' ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t},\n\n\t\t\t// ── Character count ───────────────────────────────────────────────\n\t\t\tgetCharacterCount: () => ({\n\t\t\t\tcount:\n\t\t\t\t\teditor?.storage.characterCount?.characters?.() ??\n\t\t\t\t\teditor?.getText().length ??\n\t\t\t\t\t0,\n\t\t\t\tlimit: maxCharacters ?? null,\n\t\t\t}),\n\n\t\t\t// ── Sections ─────────────────────────────────────────────────────\n\t\t\tgetSectionContent: (sectionId) =>\n\t\t\t\teditor\n\t\t\t\t\t? extractSectionContent(editor, sectionId)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\n\t\t\tsetSectionContent: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, normalised));\n\t\t\t},\n\n\t\t\tfocusSection: (sectionId) => {\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tif (sectionId === 'body') {\n\t\t\t\t\t\tlet endOfBody = e.state.doc.content.size - 1;\n\t\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\t\tendOfBody === e.state.doc.content.size - 1\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tendOfBody = pos - 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn endOfBody === e.state.doc.content.size - 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (endOfBody < 1) endOfBody = 1;\n\t\t\t\t\t\te.chain().focus().setTextSelection(endOfBody).run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet targetPos = -1;\n\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\tif (targetPos !== -1) return false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// pos + nodeSize lands right after the divider;\n\t\t\t\t\t\t\t// +1 more puts us inside the first paragraph of that section.\n\t\t\t\t\t\t\ttargetPos = pos + node.nodeSize + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (targetPos !== -1) {\n\t\t\t\t\t\te.chain().focus().setTextSelection(targetPos).run();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tclearSection: (sectionId) => {\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, '<p></p>'));\n\t\t\t},\n\n\t\t\t// ── Convenience body shorthands ───────────────────────────────────\n\t\t\tgetBodyContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractBodyContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tsetBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, 'body', normalised));\n\t\t\t},\n\t\t\tsetBodyAndSections: (body, sections) => {\n\t\t\t\tconst html = buildSectionedContent(\n\t\t\t\t\tnormalizeHtml(body),\n\t\t\t\t\tsections.map((s) => ({\n\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\tcontent: normalizeHtml(s.content),\n\t\t\t\t\t})),\n\t\t\t\t);\n\t\t\t\tenqueue((e) => e.commands.setContent(html, { emitUpdate: true }));\n\t\t\t},\n\t\t\tappendBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// findSectionEndPos returns the position of the first divider (or\n\t\t\t\t// doc.content.size), which is the block boundary after the last </p>.\n\t\t\t\t// Subtract 1 to stay inside the last paragraph so successive calls\n\t\t\t\t// append inline text rather than creating a new paragraph each time.\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst boundaryPos = findSectionEndPos(e, 'body');\n\t\t\t\t\te.commands.insertContentAt(boundaryPos - 1, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionStart: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionStartPos(e, sectionId);\n\t\t\t\t\tif (pos !== -1) e.commands.insertContentAt(pos, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionEnd: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionEndPos(e, sectionId);\n\t\t\t\t\te.commands.insertContentAt(pos, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\t// ── Formats & actions ─────────────────────────────────────────────\n\t\t\tgetActiveFormats: () =>\n\t\t\t\teditor ? extractActiveFormats(editor) : DEFAULT_FORMAT_STATE,\n\t\t\tactions: {\n\t\t\t\ttoggleBold: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t\ttoggleItalic: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t\ttoggleUnderline: () => editor?.chain().focus().toggleUnderline().run(),\n\t\t\t\ttoggleStrike: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t\ttoggleBulletList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBulletList().run(),\n\t\t\t\ttoggleOrderedList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleOrderedList().run(),\n\t\t\t\ttoggleBlockquote: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBlockquote().run(),\n\t\t\t\ttoggleCodeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n\t\t\t\tsetTextAlign: (align) =>\n\t\t\t\t\teditor?.chain().focus().setTextAlign(align).run(),\n\t\t\t\tsetFontFamily: (font) =>\n\t\t\t\t\teditor?.chain().focus().setFontFamily(font).run(),\n\t\t\t\tsetFontSize: (size) => editor?.chain().focus().setFontSize(size).run(),\n\t\t\t\tsetColor: (color) => editor?.chain().focus().setColor(color).run(),\n\t\t\t\tsetHighlight: (color) =>\n\t\t\t\t\teditor?.chain().focus().toggleHighlight({ color }).run(),\n\t\t\t\tunsetColor: () => editor?.chain().focus().unsetColor().run(),\n\t\t\t\tunsetHighlight: () => editor?.chain().focus().unsetHighlight().run(),\n\t\t\t\tsetLink: (href, text) => {\n\t\t\t\t\tif (!editor) return;\n\t\t\t\t\tif (text !== undefined) {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.command(({ tr, state }) => {\n\t\t\t\t\t\t\t\tconst { from, to } = tr.selection;\n\t\t\t\t\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\t\t\t\t\tif (!linkMarkType) return false;\n\t\t\t\t\t\t\t\tconst linkNode = state.schema.text(text, [\n\t\t\t\t\t\t\t\t\tlinkMarkType.create({ href }),\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\tconst space = state.schema.text(' ');\n\t\t\t\t\t\t\t\ttr.replaceWith(from, to, [linkNode, space]);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t\t.insertContent(' ')\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tupdateLink: (href) =>\n\t\t\t\t\teditor\n\t\t\t\t\t\t?.chain()\n\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t.run(),\n\t\t\t\tremoveLink: () =>\n\t\t\t\t\teditor?.chain().focus().extendMarkRange('link').unsetLink().run(),\n\t\t\t\tinsertEmoji: (emoji) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(emoji).run(),\n\t\t\t\tinsertVariable: (variableName) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(`{{${variableName}}}`).run(),\n\t\t\t\tinsertHtml: (html) =>\n\t\t\t\t\teditor?.commands.insertContent(normalizeHtml(html)),\n\t\t\t\tundo: () => editor?.chain().focus().undo().run(),\n\t\t\t\tredo: () => editor?.chain().focus().redo().run(),\n\t\t\t\tcanUndo: () => editor?.can().undo() ?? false,\n\t\t\t\tcanRedo: () => editor?.can().redo() ?? false,\n\t\t\t\ttoggleSuperscript: () =>\n\t\t\t\t\teditor?.chain().focus().toggleSuperscript().run(),\n\t\t\t\ttoggleSubscript: () => editor?.chain().focus().toggleSubscript().run(),\n\t\t\t\tinsertImage: (src) => editor?.chain().focus().setImage({ src }).run(),\n\t\t\t},\n\t\t}),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[editor],\n\t);\n\n\tif (!editor) return null;\n\n\treturn (\n\t\t<BikEditorShell\n\t\t\tminHeight={minHeight}\n\t\t\tmaxHeight={maxHeight}\n\t\t\tparagraphGap={paragraphGap}\n\t\t\tstyle={style}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t<EditorContent editor={editor} />\n\t\t\t<LinkBubbleMenu editor={editor} renderLinkTooltip={link?.renderTooltip} />\n\t\t</BikEditorShell>\n\t);\n};\n\nexport const BikEditor = forwardRef<BikEditorRef, BikEditorProps>(\n\tBikEditorInner,\n);\nBikEditor.displayName = 'BikEditor';\n"],"names":["cssToString","style","Object","entries","map","_ref","k","v","replace","c","toLowerCase","join","BikEditor","forwardRef","BikEditorInner","props","ref","initialContent","sections","features","disabled","maxCharacters","shortcuts","sendShortcut","mentions","slashCommands","link","onPaste","onReady","onChange","onSend","onFocus","onBlur","onSelectionChange","minHeight","maxHeight","paragraphGap","className","editorClassName","editorStyle","initialEditorContent","length","buildSectionedContent","normalizeHtml","s","assign","content","pendingQueue","useRef","hasCalledOnReady","onReadyRef","current","onChangeRef","onSelectionChangeRef","onFocusRef","onBlurRef","onSendRef","agentMentionsRef","agents","_a","_b","teamMentionsRef","teams","_c","_d","slashCommandsRef","items","_e","_f","editor","useEditor","extensions","buildExtensions","placeholder","hasSections","_g","undefined","snapshot","call","onMentionSelected","onSelect","onSlashCommandSelected","renderMentionItem","renderItem","renderMentionDropdown","renderDropdown","renderSlashCommandItem","renderSlashCommandDropdown","editable","immediatelyRender","editorProps","attributes","class","onUpdate","_ref2","e","extractContent","onTransaction","_ref3","extractActiveFormats","enqueue","op","push","useEffect","splice","forEach","useImperativeHandle","focus","position","commands","blur","clearContent","setContent","html","normalised","emitUpdate","insertContent","insertInlineContent","insertInlineHtml","insertAtStart","insertContentAt","insertBlock","state","doc","size","appendInline","insertAtEnd","this","appendContent","getContent","text","isEmpty","characterCount","getJSON","getMentions","agentIds","Set","teamIds","descendants","node","type","name","attrs","add","String","Array","from","getCursorPosition","to","selection","insertAtPosition","pos","getSelectedText","empty","textBetween","linkMarkType","schema","marks","range","getMarkRange","resolve","getCharacterCount","count","storage","characters","getText","limit","getSectionContent","sectionId","extractSectionContent","setSectionContent","setSectionContentInEditor","focusSection","endOfBody","chain","setTextSelection","run","targetPos","nodeSize","clearSection","getBodyContent","extractBodyContent","setBodyContent","setBodyAndSections","body","id","appendBodyContent","boundaryPos","findSectionEndPos","insertAtSectionStart","findSectionStartPos","insertAtSectionEnd","getActiveFormats","DEFAULT_FORMAT_STATE","actions","toggleBold","toggleItalic","toggleUnderline","toggleStrike","toggleBulletList","toggleOrderedList","toggleBlockquote","toggleCodeBlock","setTextAlign","align","setFontFamily","font","setFontSize","setColor","color","setHighlight","toggleHighlight","unsetColor","unsetHighlight","setLink","href","extendMarkRange","command","_ref4","tr","linkNode","create","space","replaceWith","updateLink","removeLink","unsetLink","insertEmoji","emoji","insertVariable","variableName","insertHtml","undo","redo","canUndo","can","canRedo","toggleSuperscript","toggleSubscript","insertImage","src","setImage","_jsxs","BikEditorShell","children","_jsx","EditorContent","LinkBubbleMenu","renderLinkTooltip","renderTooltip","displayName"],"mappings":"yxBAqCA,SAASA,EAAYC,GACpB,OAAOC,OAAOC,QAAQF,GACpBG,KACAC,IAAA,IAAEC,EAAGC,GAAEF,EAAA,MAAK,GAAGC,EAAEE,QAAQ,YAAaC,OAAUA,EAAEC,qBAAoBH,GAAG,IAEzEI,KAAK,IACR,CAEA,MAgbaC,EAAYC,GAhbFC,CACtBC,EACAC,uBAEA,MAAMC,eACLA,EAAcC,SACdA,EAAQC,SACRA,EAAQC,SACRA,EAAQC,cACRA,EAAaC,UACbA,EAASC,aACTA,EAAYC,SACZA,EAAQC,cACRA,EAAaC,KACbA,EAAIC,QACJA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,OACRA,EAAMC,QACNA,EAAOC,OACPA,EAAMC,kBACNA,EAAiBC,UACjBA,EAASC,UACTA,EAASC,aACTA,EAAYnC,MACZA,EAAKoC,UACLA,EAASC,gBACTA,GAAeC,YACfA,IACGxB,EAEEyB,IAAuBtB,aAAQ,EAARA,EAAUuB,QACpCC,EACAC,EAAc1B,QAAAA,EAAkB,IAChCC,EAASd,KAAKwC,GAAY1C,OAAA2C,OAAA3C,OAAA2C,OAAA,CAAA,EAAAD,IAAGE,QAASH,EAAcC,EAAEE,cAEtDH,E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B9D,MACjE+D,YAAcC,GAAQ3K,cAAA,EAAAA,GAAQyG,QAAQnE,QAAQsI,SAAS,CAAED,QAAOhE,UAIlE,CAAC3G,KAGGA,GAGJ6K,EAACC,EAAcjP,OAAA2C,OAAA,CACdX,UAAWA,EACXC,UAAWA,EACXC,aAAcA,EACdnC,MAAOA,EACPoC,UAAWA,GAEX,CAAA+M,SAAA,CAAAC,EAACC,EAAc,CAAAjL,OAAQA,KACvBgL,EAACE,EAAc,CAAClL,OAAQA,GAAQmL,kBAAmB9N,aAAA,EAAAA,EAAM+N,oBAXvC,IAYF,IAOnB7O,EAAU8O,YAAc"}
1
+ {"version":3,"file":"BikEditor.js","sources":["../../../src/editor/BikEditor.tsx"],"sourcesContent":["'use client';\n\n/**\n * IMPLEMENTATION LAYER — TipTap-specific.\n * If the underlying editor is swapped, this file changes; BikEditor.types.ts and\n * src/editor/index.ts (the consumer contract) do NOT change.\n */\nimport { Editor, getMarkRange } from '@tiptap/core';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n} from 'react';\nimport { BikEditorShell } from './BikEditor.styles';\nimport {\n\tBikEditorProps,\n\tBikEditorRef,\n\tDEFAULT_FORMAT_STATE,\n} from './BikEditor.types';\nimport {\n\tbuildSectionedContent,\n\textractActiveFormats,\n\textractBodyContent,\n\textractContent,\n\textractSectionContent,\n\tfindSectionEndPos,\n\tfindSectionStartPos,\n\tinsertInlineHtml,\n\tnormalizeHtml,\n\tsetSectionContentInEditor,\n} from './BikEditor.utils';\nimport { buildExtensions } from './extensions/buildExtensions';\nimport { LinkBubbleMenu } from './floating/LinkBubbleMenu';\n\n/** Convert React.CSSProperties to an inline CSS string for editorProps.attributes. */\nfunction cssToString(style: React.CSSProperties): string {\n\treturn Object.entries(style)\n\t\t.map(\n\t\t\t([k, v]) => `${k.replace(/([A-Z])/g, (c) => `-${c.toLowerCase()}`)}:${v}`,\n\t\t)\n\t\t.join(';');\n}\n\nconst BikEditorInner = (\n\tprops: BikEditorProps,\n\tref: React.Ref<BikEditorRef>,\n) => {\n\tconst {\n\t\tinitialContent,\n\t\tsections,\n\t\tfeatures,\n\t\tdisabled,\n\t\tmaxCharacters,\n\t\tshortcuts,\n\t\tsendShortcut,\n\t\tmentions,\n\t\tslashCommands,\n\t\tlink,\n\t\tonPaste,\n\t\tonReady,\n\t\tonChange,\n\t\tonSend,\n\t\tonFocus,\n\t\tonBlur,\n\t\tonSelectionChange,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tstyle,\n\t\tclassName,\n\t\teditorClassName,\n\t\teditorStyle,\n\t} = props;\n\n\tconst initialEditorContent = sections?.length\n\t\t? buildSectionedContent(\n\t\t\t\tnormalizeHtml(initialContent ?? ''),\n\t\t\t\tsections.map((s) => ({ ...s, content: normalizeHtml(s.content) })),\n\t\t )\n\t\t: normalizeHtml(initialContent ?? '');\n\n\t// ── Command queue ─────────────────────────────────────────────────────────\n\t// TipTap's useEditor initializes asynchronously; the editor instance is null\n\t// until the first commit. Any imperative method called before the editor is\n\t// ready is enqueued here and flushed automatically once it becomes non-null.\n\t// Consumers never need setTimeout or readiness guards.\n\tconst pendingQueue = useRef<Array<(e: Editor) => void>>([]);\n\tconst hasCalledOnReady = useRef(false);\n\t// Keep stable refs to all callbacks so useEditor receives the same function\n\t// identity on every render — prevents TipTap from re-registering event\n\t// handlers every time the parent re-renders with new inline function props.\n\tconst onReadyRef = useRef(onReady);\n\tonReadyRef.current = onReady;\n\tconst onChangeRef = useRef(onChange);\n\tonChangeRef.current = onChange;\n\tconst onSelectionChangeRef = useRef(onSelectionChange);\n\tonSelectionChangeRef.current = onSelectionChange;\n\tconst onFocusRef = useRef(onFocus);\n\tonFocusRef.current = onFocus;\n\tconst onBlurRef = useRef(onBlur);\n\tonBlurRef.current = onBlur;\n\tconst onSendRef = useRef(onSend);\n\tonSendRef.current = onSend;\n\tconst agentMentionsRef = useRef(mentions?.agents ?? []);\n\tagentMentionsRef.current = mentions?.agents ?? [];\n\tconst teamMentionsRef = useRef(mentions?.teams ?? []);\n\tteamMentionsRef.current = mentions?.teams ?? [];\n\tconst slashCommandsRef = useRef(slashCommands?.items ?? []);\n\tslashCommandsRef.current = slashCommands?.items ?? [];\n\n\tconst editor = useEditor({\n\t\textensions: buildExtensions({\n\t\t\tfeatures,\n\t\t\tplaceholder: props.placeholder,\n\t\t\tmaxCharacters,\n\t\t\thasSections: (sections?.length ?? 0) > 0,\n\t\t\tmentions: {\n\t\t\t\tagents: mentions ? agentMentionsRef : undefined,\n\t\t\t\tteams: mentions ? teamMentionsRef : undefined,\n\t\t\t},\n\t\t\tslashCommands: slashCommands ? slashCommandsRef : undefined,\n\t\t\tonPaste,\n\t\t\tonSend: onSend ? (snapshot) => onSendRef.current?.(snapshot) : undefined,\n\t\t\tsendShortcut,\n\t\t\tshortcuts,\n\t\t\tonMentionSelected: mentions?.onSelect,\n\t\t\tonSlashCommandSelected: slashCommands?.onSelect,\n\t\t\trenderMentionItem: mentions?.renderItem,\n\t\t\trenderMentionDropdown: mentions?.renderDropdown,\n\t\t\trenderSlashCommandItem: slashCommands?.renderItem,\n\t\t\trenderSlashCommandDropdown: slashCommands?.renderDropdown,\n\t\t}),\n\t\tcontent: initialEditorContent,\n\t\teditable: !disabled,\n\t\timmediatelyRender: false, // SSR-safe — NEVER remove this\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\t...(editorClassName ? { class: editorClassName } : {}),\n\t\t\t\t...(editorStyle ? { style: cssToString(editorStyle) } : {}),\n\t\t\t},\n\t\t},\n\t\tonUpdate: ({ editor: e }) => {\n\t\t\tonChangeRef.current?.(extractContent(e));\n\t\t},\n\t\tonTransaction: ({ editor: e }) => {\n\t\t\tonSelectionChangeRef.current?.(extractActiveFormats(e));\n\t\t},\n\t\tonFocus: () => onFocusRef.current?.(),\n\t\tonBlur: () => onBlurRef.current?.(),\n\t});\n\n\t// ── enqueue ───────────────────────────────────────────────────────────────\n\t// Run immediately if the editor is ready; otherwise defer to the queue.\n\t// Closures passed to enqueue MUST capture all parameters explicitly —\n\t// they must NOT close over `editor` (which would be null at enqueue time).\n\tfunction enqueue(op: (e: Editor) => void): void {\n\t\tif (editor) {\n\t\t\top(editor);\n\t\t} else {\n\t\t\tpendingQueue.current.push(op);\n\t\t}\n\t}\n\n\t// Flush the pending queue and fire onReady when editor transitions null → ready.\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\t\tif (pendingQueue.current.length > 0) {\n\t\t\tconst queue = pendingQueue.current.splice(0);\n\t\t\tqueue.forEach((op) => op(editor));\n\t\t}\n\t\tif (!hasCalledOnReady.current) {\n\t\t\thasCalledOnReady.current = true;\n\t\t\tonReadyRef.current?.();\n\t\t}\n\t}, [editor]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\t// ── Focus ────────────────────────────────────────────────────────\n\t\t\tfocus: (position) => enqueue((e) => e.commands.focus(position)),\n\t\t\tblur: () => enqueue((e) => e.commands.blur()),\n\n\t\t\t// ── Content ──────────────────────────────────────────────────────\n\t\t\tclearContent: () => enqueue((e) => e.commands.clearContent(true)),\n\t\t\tsetContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.setContent(normalised, { emitUpdate: true }));\n\t\t\t},\n\t\t\tinsertContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContent(normalised));\n\t\t\t},\n\t\t\tinsertInlineContent: (html) => {\n\t\t\t\tenqueue((e) => insertInlineHtml(e, html));\n\t\t\t},\n\t\t\tinsertAtStart: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(1, normalised));\n\t\t\t},\n\t\t\tinsertBlock: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\tappendInline: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// doc.content.size is after the last </p> (block boundary).\n\t\t\t\t// Subtract 1 to land inside the last paragraph so text appends\n\t\t\t\t// inline rather than being wrapped in a new paragraph each call.\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size - 1, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\t// Backwards-compatible aliases\n\t\t\tinsertAtEnd(html) {\n\t\t\t\tthis.insertBlock(html);\n\t\t\t},\n\t\t\tappendContent(html) {\n\t\t\t\tthis.appendInline(html);\n\t\t\t},\n\t\t\tgetContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tgetJSON: () => editor?.getJSON() ?? null,\n\t\t\tgetMentions: () => {\n\t\t\t\tconst agentIds = new Set<string>();\n\t\t\t\tconst teamIds = new Set<string>();\n\t\t\t\tif (!editor) return { agentIds: [], teamIds: [] };\n\t\t\t\teditor.state.doc.descendants((node) => {\n\t\t\t\t\tif (node.type.name === 'mentionAgent' && node.attrs['id'] != null) {\n\t\t\t\t\t\tagentIds.add(String(node.attrs['id']));\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tnode.type.name === 'mentionTeam' &&\n\t\t\t\t\t\tnode.attrs['id'] != null\n\t\t\t\t\t) {\n\t\t\t\t\t\tteamIds.add(String(node.attrs['id']));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn { agentIds: Array.from(agentIds), teamIds: Array.from(teamIds) };\n\t\t\t},\n\n\t\t\t// ── Selection ────────────────────────────────────────────────────\n\t\t\tgetCursorPosition: () => {\n\t\t\t\tif (!editor) return { from: 0, to: 0 };\n\t\t\t\tconst { from, to } = editor.state.selection;\n\t\t\t\treturn { from, to };\n\t\t\t},\n\t\t\tinsertAtPosition: (pos, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(pos, normalised));\n\t\t\t},\n\t\t\tgetSelectedText: () => {\n\t\t\t\tif (!editor) return '';\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { from, to, empty } = state.selection;\n\t\t\t\tif (!empty) {\n\t\t\t\t\treturn state.doc.textBetween(from, to, ' ');\n\t\t\t\t}\n\t\t\t\t// When the cursor is inside a link with nothing selected, return the\n\t\t\t\t// full link text — useful for pre-filling a link modal's text field.\n\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\tif (linkMarkType) {\n\t\t\t\t\tconst range = getMarkRange(state.doc.resolve(from), linkMarkType);\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\treturn state.doc.textBetween(range.from, range.to, ' ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t},\n\n\t\t\t// ── Character count ───────────────────────────────────────────────\n\t\t\tgetCharacterCount: () => ({\n\t\t\t\tcount:\n\t\t\t\t\teditor?.storage.characterCount?.characters?.() ??\n\t\t\t\t\teditor?.getText().length ??\n\t\t\t\t\t0,\n\t\t\t\tlimit: maxCharacters ?? null,\n\t\t\t}),\n\n\t\t\t// ── Sections ─────────────────────────────────────────────────────\n\t\t\tgetSectionContent: (sectionId) =>\n\t\t\t\teditor\n\t\t\t\t\t? extractSectionContent(editor, sectionId)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\n\t\t\tsetSectionContent: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, normalised));\n\t\t\t},\n\n\t\t\tfocusSection: (sectionId) => {\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tif (sectionId === 'body') {\n\t\t\t\t\t\tlet endOfBody = e.state.doc.content.size - 1;\n\t\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\t\tendOfBody === e.state.doc.content.size - 1\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tendOfBody = pos - 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn endOfBody === e.state.doc.content.size - 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (endOfBody < 1) endOfBody = 1;\n\t\t\t\t\t\te.chain().focus().setTextSelection(endOfBody).run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet targetPos = -1;\n\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\tif (targetPos !== -1) return false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// pos + nodeSize lands right after the divider;\n\t\t\t\t\t\t\t// +1 more puts us inside the first paragraph of that section.\n\t\t\t\t\t\t\ttargetPos = pos + node.nodeSize + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (targetPos !== -1) {\n\t\t\t\t\t\te.chain().focus().setTextSelection(targetPos).run();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tclearSection: (sectionId) => {\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, '<p></p>'));\n\t\t\t},\n\n\t\t\t// ── Convenience body shorthands ───────────────────────────────────\n\t\t\tgetBodyContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractBodyContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tsetBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, 'body', normalised));\n\t\t\t},\n\t\t\tsetBodyAndSections: (body, sections) => {\n\t\t\t\tconst html = buildSectionedContent(\n\t\t\t\t\tnormalizeHtml(body),\n\t\t\t\t\tsections.map((s) => ({\n\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\tcontent: normalizeHtml(s.content),\n\t\t\t\t\t})),\n\t\t\t\t);\n\t\t\t\tenqueue((e) => e.commands.setContent(html, { emitUpdate: true }));\n\t\t\t},\n\t\t\tappendBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// findSectionEndPos returns the position of the first divider (or\n\t\t\t\t// doc.content.size), which is the block boundary after the last </p>.\n\t\t\t\t// Subtract 1 to stay inside the last paragraph so successive calls\n\t\t\t\t// append inline text rather than creating a new paragraph each time.\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst boundaryPos = findSectionEndPos(e, 'body');\n\t\t\t\t\te.commands.insertContentAt(boundaryPos - 1, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionStart: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionStartPos(e, sectionId);\n\t\t\t\t\tif (pos !== -1) e.commands.insertContentAt(pos, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionEnd: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionEndPos(e, sectionId);\n\t\t\t\t\te.commands.insertContentAt(pos, normalised);\n\t\t\t\t});\n\t\t\t},\n\t\t\t// ── Formats & actions ─────────────────────────────────────────────\n\t\t\tgetActiveFormats: () =>\n\t\t\t\teditor ? extractActiveFormats(editor) : DEFAULT_FORMAT_STATE,\n\t\t\tactions: {\n\t\t\t\ttoggleBold: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t\ttoggleItalic: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t\ttoggleUnderline: () => editor?.chain().focus().toggleUnderline().run(),\n\t\t\t\ttoggleStrike: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t\ttoggleBulletList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBulletList().run(),\n\t\t\t\ttoggleOrderedList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleOrderedList().run(),\n\t\t\t\ttoggleBlockquote: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBlockquote().run(),\n\t\t\t\ttoggleCodeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n\t\t\t\tsetTextAlign: (align) =>\n\t\t\t\t\teditor?.chain().focus().setTextAlign(align).run(),\n\t\t\t\tsetFontFamily: (font) =>\n\t\t\t\t\teditor?.chain().focus().setFontFamily(font).run(),\n\t\t\t\tsetFontSize: (size) => editor?.chain().focus().setFontSize(size).run(),\n\t\t\t\tsetColor: (color) => editor?.chain().focus().setColor(color).run(),\n\t\t\t\tsetHighlight: (color) =>\n\t\t\t\t\teditor?.chain().focus().toggleHighlight({ color }).run(),\n\t\t\t\tunsetColor: () => editor?.chain().focus().unsetColor().run(),\n\t\t\t\tunsetHighlight: () => editor?.chain().focus().unsetHighlight().run(),\n\t\t\t\tsetLink: (href, text) => {\n\t\t\t\t\tif (!editor) return;\n\t\t\t\t\tif (text !== undefined) {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.command(({ tr, state }) => {\n\t\t\t\t\t\t\t\tconst { from, to } = tr.selection;\n\t\t\t\t\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\t\t\t\t\tif (!linkMarkType) return false;\n\t\t\t\t\t\t\t\tconst linkNode = state.schema.text(text, [\n\t\t\t\t\t\t\t\t\tlinkMarkType.create({ href }),\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\tconst space = state.schema.text(' ');\n\t\t\t\t\t\t\t\ttr.replaceWith(from, to, [linkNode, space]);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t\t.insertContent(' ')\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tupdateLink: (href) =>\n\t\t\t\t\teditor\n\t\t\t\t\t\t?.chain()\n\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t.run(),\n\t\t\t\tremoveLink: () =>\n\t\t\t\t\teditor?.chain().focus().extendMarkRange('link').unsetLink().run(),\n\t\t\t\tinsertEmoji: (emoji) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(emoji).run(),\n\t\t\t\tinsertVariable: (variableName) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(`{{${variableName}}}`).run(),\n\t\t\t\tinsertHtml: (html) =>\n\t\t\t\t\teditor?.commands.insertContent(normalizeHtml(html)),\n\t\t\t\tundo: () => editor?.chain().focus().undo().run(),\n\t\t\t\tredo: () => editor?.chain().focus().redo().run(),\n\t\t\t\tcanUndo: () => editor?.can().undo() ?? false,\n\t\t\t\tcanRedo: () => editor?.can().redo() ?? false,\n\t\t\t\ttoggleSuperscript: () =>\n\t\t\t\t\teditor?.chain().focus().toggleSuperscript().run(),\n\t\t\t\ttoggleSubscript: () => editor?.chain().focus().toggleSubscript().run(),\n\t\t\t\tinsertImage: (src) => editor?.chain().focus().setImage({ src }).run(),\n\t\t\t},\n\t\t}),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[editor],\n\t);\n\n\tif (!editor) return null;\n\n\treturn (\n\t\t<BikEditorShell\n\t\t\tminHeight={minHeight}\n\t\t\tmaxHeight={maxHeight}\n\t\t\tstyle={style}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t<EditorContent editor={editor} />\n\t\t\t<LinkBubbleMenu editor={editor} renderLinkTooltip={link?.renderTooltip} />\n\t\t</BikEditorShell>\n\t);\n};\n\nexport const BikEditor = forwardRef<BikEditorRef, BikEditorProps>(\n\tBikEditorInner,\n);\nBikEditor.displayName = 'BikEditor';\n"],"names":["cssToString","style","Object","entries","map","_ref","k","v","replace","c","toLowerCase","join","BikEditor","forwardRef","BikEditorInner","props","ref","initialContent","sections","features","disabled","maxCharacters","shortcuts","sendShortcut","mentions","slashCommands","link","onPaste","onReady","onChange","onSend","onFocus","onBlur","onSelectionChange","minHeight","maxHeight","className","editorClassName","editorStyle","initialEditorContent","length","buildSectionedContent","normalizeHtml","s","assign","content","pendingQueue","useRef","hasCalledOnReady","onReadyRef","current","onChangeRef","onSelectionChangeRef","onFocusRef","onBlurRef","onSendRef","agentMentionsRef","agents","_a","_b","teamMentionsRef","teams","_c","_d","slashCommandsRef","items","_e","_f","editor","useEditor","extensions","buildExtensions","placeholder","hasSections","_g","undefined","snapshot","call","onMentionSelected","onSelect","onSlashCommandSelected","renderMentionItem","renderItem","renderMentionDropdown","renderDropdown","renderSlashCommandItem","renderSlashCommandDropdown","editable","immediatelyRender","editorProps","attributes","class","onUpdate","_ref2","e","extractContent","onTransaction","_ref3","extractActiveFormats","enqueue","op","push","useEffect","splice","forEach","useImperativeHandle","focus","position","commands","blur","clearContent","setContent","html","normalised","emitUpdate","insertContent","insertInlineContent","insertInlineHtml","insertAtStart","insertContentAt","insertBlock","state","doc","size","appendInline","insertAtEnd","this","appendContent","getContent","text","isEmpty","characterCount","getJSON","getMentions","agentIds","Set","teamIds","descendants","node","type","name","attrs","add","String","Array","from","getCursorPosition","to","selection","insertAtPosition","pos","getSelectedText","empty","textBetween","linkMarkType","schema","marks","range","getMarkRange","resolve","getCharacterCount","count","storage","characters","getText","limit","getSectionContent","sectionId","extractSectionContent","setSectionContent","setSectionContentInEditor","focusSection","endOfBody","chain","setTextSelection","run","targetPos","nodeSize","clearSection","getBodyContent","extractBodyContent","setBodyContent","setBodyAndSections","body","id","appendBodyContent","boundaryPos","findSectionEndPos","insertAtSectionStart","findSectionStartPos","insertAtSectionEnd","getActiveFormats","DEFAULT_FORMAT_STATE","actions","toggleBold","toggleItalic","toggleUnderline","toggleStrike","toggleBulletList","toggleOrderedList","toggleBlockquote","toggleCodeBlock","setTextAlign","align","setFontFamily","font","setFontSize","setColor","color","setHighlight","toggleHighlight","unsetColor","unsetHighlight","setLink","href","extendMarkRange","command","_ref4","tr","linkNode","create","space","replaceWith","updateLink","removeLink","unsetLink","insertEmoji","emoji","insertVariable","variableName","insertHtml","undo","redo","canUndo","can","canRedo","toggleSuperscript","toggleSubscript","insertImage","src","setImage","_jsxs","BikEditorShell","children","_jsx","EditorContent","LinkBubbleMenu","renderLinkTooltip","renderTooltip","displayName"],"mappings":"yxBAqCA,SAASA,EAAYC,GACpB,OAAOC,OAAOC,QAAQF,GACpBG,KACAC,IAAA,IAAEC,EAAGC,GAAEF,EAAA,MAAK,GAAGC,EAAEE,QAAQ,YAAaC,OAAUA,EAAEC,qBAAoBH,GAAG,IAEzEI,KAAK,IACR,CAEA,MA8aaC,EAAYC,GA9aFC,CACtBC,EACAC,uBAEA,MAAMC,eACLA,EAAcC,SACdA,EAAQC,SACRA,EAAQC,SACRA,EAAQC,cACRA,EAAaC,UACbA,EAASC,aACTA,EAAYC,SACZA,EAAQC,cACRA,EAAaC,KACbA,EAAIC,QACJA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,OACRA,EAAMC,QACNA,EAAOC,OACPA,EAAMC,kBACNA,EAAiBC,UACjBA,EAASC,UACTA,EAASlC,MACTA,EAAKmC,UACLA,EAASC,gBACTA,EAAeC,YACfA,IACGvB,EAEEwB,IAAuBrB,aAAQ,EAARA,EAAUsB,QACpCC,EACAC,EAAczB,QAAAA,EAAkB,IAChCC,EAASd,KAAKuC,GAAY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7D,MAC7C8D,gBAAiBA,IAAMzK,cAAM,EAANA,GAAQyG,QAAQnE,QAAQmI,kBAAkB9D,MACjE+D,YAAcC,GAAQ3K,cAAA,EAAAA,GAAQyG,QAAQnE,QAAQsI,SAAS,CAAED,QAAOhE,UAIlE,CAAC3G,KAGGA,GAGJ6K,EAACC,EAAchP,OAAA0C,OAAA,CACdV,UAAWA,EACXC,UAAWA,EACXlC,MAAOA,EACPmC,UAAWA,GAEX,CAAA+M,SAAA,CAAAC,EAACC,EAAa,CAACjL,OAAQA,KACvBgL,EAACE,EAAe,CAAAlL,OAAQA,GAAQmL,kBAAmB7N,aAAA,EAAAA,EAAM8N,oBAVvC,IAWF,IAOnB5O,EAAU6O,YAAc"}
@@ -1,10 +1,10 @@
1
- import e from"styled-components";import{COLORS as t}from"../constants/Theme.js";const r=e.div`
1
+ import e from"styled-components";import{COLORS as o}from"../constants/Theme.js";const t=e.div`
2
2
  position: relative;
3
3
  width: 100%;
4
4
 
5
5
  .ProseMirror {
6
- min-height: ${e=>{let{minHeight:t}=e;return null!=t?t:"80px"}};
7
- max-height: ${e=>{let{maxHeight:t}=e;return null!=t?t:"none"}};
6
+ min-height: ${e=>{let{minHeight:o}=e;return null!=o?o:"80px"}};
7
+ max-height: ${e=>{let{maxHeight:o}=e;return null!=o?o:"none"}};
8
8
  overflow-y: auto;
9
9
  outline: none;
10
10
  padding: 8px 12px;
@@ -20,17 +20,7 @@ import e from"styled-components";import{COLORS as t}from"../constants/Theme.js";
20
20
  /* Enter = new paragraph → visible gap. Shift+Enter = <br> inside
21
21
  the same paragraph → no gap. Matches Google Docs / Word behavior. */
22
22
  p + p {
23
- margin-top: ${e=>{let{paragraphGap:t}=e;return null!=t?t:"4px"}};
24
- }
25
-
26
- /* Blank lines (empty paragraphs) get their height from line-height
27
- alone — no extra margins. Prevents double-spacing when paragraphGap
28
- is large (e.g. 1em for email). */
29
- p.is-blank {
30
- margin-top: 0;
31
- }
32
- p.is-blank + p {
33
- margin-top: 0;
23
+ margin-top: 4px;
34
24
  }
35
25
 
36
26
  ul,
@@ -53,11 +43,11 @@ import e from"styled-components";import{COLORS as t}from"../constants/Theme.js";
53
43
  }
54
44
 
55
45
  .bik-mention {
56
- color: ${t.content.brand};
46
+ color: ${o.content.brand};
57
47
  padding: 1px 4px;
58
48
  }
59
49
  .bik-mention--team {
60
- color: ${t.content.brand};
50
+ color: ${o.content.brand};
61
51
  }
62
52
  .bik-variable {
63
53
  }
@@ -74,5 +64,5 @@ import e from"styled-components";import{COLORS as t}from"../constants/Theme.js";
74
64
  text-decoration-color: #6366f1;
75
65
  }
76
66
  }
77
- `;export{r as BikEditorShell};
67
+ `;export{t as BikEditorShell};
78
68
  //# sourceMappingURL=BikEditor.styles.js.map