@bikdotai/bik-component-library 0.0.564-beta.picker.7 → 0.0.564-beta.picker.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/WhatsAppTextEditor/CustomEditor.styled.js +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),b=require("../../constants/Theme.js");function e(c){return c&&"object"==typeof c&&"default"in c?c:{default:c}}var l=e(c);const d=l.default("div","production"===process.env.NODE_ENV?{target:"e91dva42"}:{target:"e91dva42",label:"Container"})("background:",b.COLORS.surface.standard,";border:",(c=>c.isError?2:1),"px solid ",(c=>c.isError?b.COLORS.stroke.negative.vibrant:b.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRW9DIiwiZmlsZSI6IkN1c3RvbUVkaXRvci5zdHlsZWQudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuZXhwb3J0IGNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRiYWNrZ3JvdW5kOiAke0NPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAkeyhwcm9wcykgPT4gKHByb3BzLmlzRXJyb3IgPyAyIDogMSl9cHggc29saWRcblx0XHQkeyhwcm9wcykgPT4gcHJvcHMuaXNFcnJvciA/IENPTE9SUy5zdHJva2UubmVnYXRpdmUudmlicmFudCA6IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBUZXh0U3BhY2UgPSBzdHlsZWQudGV4dGFyZWEgYFxuXHR3aWR0aDogMTAwJTtcblxuXHRib3JkZXI6IDA7XG5cdHBhZGRpbmc6IDEycHggMTZweDtcblx0cmVzaXplOiBub25lO1xuXHRjb2xvcjogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblxuXHQmOmZvY3VzLXdpdGhpbiB7XG5cdFx0Ym9yZGVyOiAwO1xuXHRcdG91dGxpbmU6IDA7XG5cdH1cbmA7XHJcbmV4cG9ydCBjb25zdCBPdXRlckNvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuXHRnYXA6IDhweDtcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUN1c3RvbUVkaXRvci5zdHlsZWQuanMubWFwIl19 */")),t=l.default("textarea","production"===process.env.NODE_ENV?{target:"e91dva41"}:{target:"e91dva41",label:"TextSpace"})("width:100%;border:0;padding:12px 16px;resize:none;color:",b.COLORS.content.primary,";&:focus-within{border:0;outline:0;}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUXlDIiwiZmlsZSI6IkN1c3RvbUVkaXRvci5zdHlsZWQudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuZXhwb3J0IGNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRiYWNrZ3JvdW5kOiAke0NPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAkeyhwcm9wcykgPT4gKHByb3BzLmlzRXJyb3IgPyAyIDogMSl9cHggc29saWRcblx0XHQkeyhwcm9wcykgPT4gcHJvcHMuaXNFcnJvciA/IENPTE9SUy5zdHJva2UubmVnYXRpdmUudmlicmFudCA6IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBUZXh0U3BhY2UgPSBzdHlsZWQudGV4dGFyZWEgYFxuXHR3aWR0aDogMTAwJTtcblxuXHRib3JkZXI6IDA7XG5cdHBhZGRpbmc6IDEycHggMTZweDtcblx0cmVzaXplOiBub25lO1xuXHRjb2xvcjogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblxuXHQmOmZvY3VzLXdpdGhpbiB7XG5cdFx0Ym9yZGVyOiAwO1xuXHRcdG91dGxpbmU6IDA7XG5cdH1cbmA7XHJcbmV4cG9ydCBjb25zdCBPdXRlckNvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuXHRnYXA6IDhweDtcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUN1c3RvbUVkaXRvci5zdHlsZWQuanMubWFwIl19 */")),a=l.default("div","production"===process.env.NODE_ENV?{target:"e91dva40"}:{target:"e91dva40",label:"OuterContainer"})("production"===process.env.NODE_ENV?{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"}:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUJ5QyIsImZpbGUiOiJDdXN0b21FZGl0b3Iuc3R5bGVkLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmV4cG9ydCBjb25zdCBDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHtDT0xPUlMuc3VyZmFjZS5zdGFuZGFyZH07XG5cdGJvcmRlcjogJHsocHJvcHMpID0+IChwcm9wcy5pc0Vycm9yID8gMiA6IDEpfXB4IHNvbGlkXG5cdFx0JHsocHJvcHMpID0+IHByb3BzLmlzRXJyb3IgPyBDT0xPUlMuc3Ryb2tlLm5lZ2F0aXZlLnZpYnJhbnQgOiBDT0xPUlMuc3Ryb2tlLnByaW1hcnl9O1xuXHRib3JkZXItcmFkaXVzOiA0cHg7XG5gO1xyXG5leHBvcnQgY29uc3QgVGV4dFNwYWNlID0gc3R5bGVkLnRleHRhcmVhIGBcblx0d2lkdGg6IDEwMCU7XG5cblx0Ym9yZGVyOiAwO1xuXHRwYWRkaW5nOiAxMnB4IDE2cHg7XG5cdHJlc2l6ZTogbm9uZTtcblx0Y29sb3I6ICR7Q09MT1JTLmNvbnRlbnQucHJpbWFyeX07XG5cblx0Jjpmb2N1cy13aXRoaW4ge1xuXHRcdGJvcmRlcjogMDtcblx0XHRvdXRsaW5lOiAwO1xuXHR9XG5gO1xyXG5leHBvcnQgY29uc3QgT3V0ZXJDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0ZGlzcGxheTogZmxleDtcblx0ZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblx0Z2FwOiA4cHg7XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1DdXN0b21FZGl0b3Iuc3R5bGVkLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}});exports.Container=d,exports.OuterContainer=a,exports.TextSpace=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../assets/icons/info.svg.js"),r=require("../../helpers/BaseWhatsappContentLang.helper.js"),o=require("react"),l=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),s=require("./CustomEditor.styled.js"),c=require("./WhatsAppTextEditorHeader.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(o);const d="Character limit reached",v=new r.BaseWhatsappContentLangHelper,p={[c.EditorActionTypes.BOLD]:"*",[c.EditorActionTypes.ITALIC]:"_",[c.EditorActionTypes.STRIKETHROUGH]:"~"},g=a.default.forwardRef(((r,u)=>{var a,g,{onChange:h,onClickVariable:f,text:x,RightComponent:j,error:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../assets/icons/info.svg.js"),r=require("../../helpers/BaseWhatsappContentLang.helper.js"),o=require("react"),l=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),s=require("./CustomEditor.styled.js"),c=require("./WhatsAppTextEditorHeader.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(o);const d="Character limit reached",v=new r.BaseWhatsappContentLangHelper,p={[c.EditorActionTypes.BOLD]:"*",[c.EditorActionTypes.ITALIC]:"_",[c.EditorActionTypes.STRIKETHROUGH]:"~"},g=a.default.forwardRef(((r,u)=>{var a,g,{onChange:h,onClickVariable:f,text:x,RightComponent:j,error:m,limit:C,onError:E,rows:O,actions:T}=r,y=e.__rest(r,["onChange","onClickVariable","text","RightComponent","error","limit","onError","rows","actions"]);const b=o.useRef(null);function S(e){const t=null==b?void 0:b.current;null!=t&&(t.selectionStart?(t.focus(),t.selectionEnd=e):t.focus())}function L(e){var t,n;let r=null!==(n=null===(t=b.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(b.current&&e){const t=b.current.selectionStart,n=b.current.selectionEnd,o=e;if(t===n)return w(o);{r=v.wrappWildcard(t,n,o,r);const e=v.getHTML(r);return b.current.value=r,{text:r,html:e}}}return{text:r,html:r}}function w(e){var t,n;let r=null!==(n=null===(t=b.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(b.current&&e){const t=b.current.selectionStart;if(t===b.current.selectionEnd)return R(e,t)}return{text:r,html:r}}function R(e,t){var n,r;let o=null!==(r=null===(n=b.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";o=o.slice(0,t)+e+o.slice(t);const l=v.getHTML(o);return b.current.value=o,{text:o,html:l}}o.useImperativeHandle(u,(()=>({addTextOrWrap:L,addText:w,get(){var e,t;return null!==(t=null===(e=b.current)||void 0===e?void 0:e.value)&&void 0!==t?t:""},setCaretPosition:S}))),o.useEffect((()=>{if(null==b?void 0:b.current){b.current.value=x||"";const e=v.getHTML(x||"");null==h||h(x||"",e)}}),[x]),o.useEffect((()=>{var e,t;(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.value)&&C&&((null===(t=null==b?void 0:b.current)||void 0===t?void 0:t.value.length)>C?null==E||E(d):null==E||E(null!=m?m:""))}),[null===(a=null==b?void 0:b.current)||void 0===a?void 0:a.value.length]);const H=o.useRef(null);console.log("textSpaceRef",b);const q=()=>{H.current&&b.current&&(H.current.scrollTop=b.current.scrollTop,H.current.scrollLeft=b.current.scrollLeft)};return t.jsxs(s.OuterContainer,{children:[t.jsxs(s.Container,Object.assign({isError:!!m},{children:[t.jsx(c.WhatsAppTextEditorHeader,{actions:T,ref:b,onActionSelect:function(e){if((null==p?void 0:p[e])&&b.current){const t=b.current.selectionStart;if(t===b.current.selectionEnd){R(null==p?void 0:p[e],t);const{text:n,html:r}=R(null==p?void 0:p[e],t);S(t+1),null==h||h(n,r)}else{const{text:t,html:n}=L(null==p?void 0:p[e]);null==h||h(t,n)}}},RightComponent:j,onEmojiClick:function(e){const{text:t,html:n}=w(e);null==h||h(t,n)}}),t.jsxs("div",Object.assign({style:{position:"relative",background:""}},{children:[t.jsx("div",Object.assign({contentEditable:!1,ref:H,style:{position:"absolute",top:0,left:0,pointerEvents:"none",color:"transparent",zIndex:1,width:"100%",whiteSpace:"pre-wrap",wordWrap:"break-word",padding:"12px 16px",maxHeight:"100%",overflow:"auto",height:"48px"}},{children:(()=>{var e;const n=(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.value)||"";console.log(n);const r=/(\{\{.*?\}\})/g,o=n.split(r);return console.log(o),o.map(((e,n)=>r.test(e)?t.jsx("span",Object.assign({onClick:()=>{console.log(e),null==f||f(e)},onMouseEnter:()=>{console.log("hover",e)},style:{color:"purple",cursor:"pointer",pointerEvents:"auto"}},{children:e}),n):e))})()})),t.jsx(s.TextSpace,Object.assign({style:{zIndex:2,background:"none"},ref:b,onChange:function(e){const t=e.target.value,n=v.getHTML(t);null==h||h(t,n),q()}},y,{rows:O,onScroll:q}))]}))]})),m&&m!==d?t.jsxs("div",Object.assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t.jsx(n.default,{width:16,height:16,color:l.COLORS.content.negative}),t.jsx(i.BodyCaption,Object.assign({color:l.COLORS.content.negative},{children:m}))]})):t.jsx(t.Fragment,{children:C&&(null==b?void 0:b.current)?t.jsxs(i.BodyCaption,Object.assign({style:{color:m===d||(null===(g=null==b?void 0:b.current)||void 0===g?void 0:g.value.length)>C?l.COLORS.content.negative:l.COLORS.content.secondary}},{children:[b.current.value.length,"/",C]})):t.jsx(t.Fragment,{})})]})}));g.displayName="WhatsAppTextEditor",exports.WhatsAppTextEditor=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),a=require("../../assets/icons/cross.svg.js"),i=require("../../assets/icons/plus.svg.js"),l=require("../../assets/icons/triangle_error.svg.js"),r=require("react"),n=require("../../constants/Theme.js"),o=require("../accordion/Accordion.js"),c=require("../icon-button/IconButton.js"),d=require("../input/Input.js"),u=require("../list-item/ListItem.js"),h=require("../switch/Switch.js"),b=require("../tooltips/Tooltip.js"),p=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),a=require("../../assets/icons/cross.svg.js"),i=require("../../assets/icons/plus.svg.js"),l=require("../../assets/icons/triangle_error.svg.js"),r=require("react"),n=require("../../constants/Theme.js"),o=require("../accordion/Accordion.js"),c=require("../icon-button/IconButton.js"),d=require("../input/Input.js"),u=require("../list-item/ListItem.js"),h=require("../switch/Switch.js"),b=require("../tooltips/Tooltip.js"),p=require("../TypographyStyle.js"),j=require("./context.js"),g=require("./DefaultVariableContent.js"),x=require("./model.js"),y=require("./NoResult.js"),m=require("./recommendVaribles.js"),f=require("./searchVariables.js"),v=require("./styles.js"),O=require("./SubHeaderItems.js");const S=(e,t)=>{if(0===t.length)return e;const a=e.toLowerCase().indexOf(t.toLowerCase());if(-1===a)return e;const i=e.slice(0,a),l=e.slice(a,a+t.length),r=e.slice(a+t.length);return s.jsxs("span",{children:[i,s.jsx("b",Object.assign({style:{color:n.COLORS.content.primary}},{children:l})),r]})},C=/.*\..*/;exports.VariablePickerContent=V=>{const{data:w,onSelect:R,showHeader:k,showBackButton:q,hideHeaderCross:T,onBackButtonClick:B,isEvaluationList:I,autoOpenFirst:L,headerText:N,contentHeight:_}=V,[D,E]=r.useState(w),[H,P]=r.useState(""),[$,F]=r.useState([]),[A,M]=r.useState(""),[W,z]=r.useState(!1),[K,G]=r.useState([]),[J,Q]=r.useState(!1),[U,X]=r.useState(),Y=J&&V.type===x.PickerType.EMBEDDED&&!T;console.log("variables",D),r.useEffect((()=>{Z(!0)}),[]),r.useEffect((()=>{$.length>0?G([$[$.length-1]]):G(w)}),[$]);const Z=s=>e.__awaiter(void 0,void 0,void 0,(function*(){if(z(s),s){const e=m.showOnlyRecommendedVariables(D,$);E(e)}else if($.length>0){const e=A==$[$.length-1].displayName;if(H.length>0&&e){const e=f.searchVariables(H,K,$);E(e)}else E([$[$.length-1].variables])}else if(H.length>0){const e=f.searchVariables(H,K,$);E(e)}else E(w)})),ee=()=>{if(_)return _;let e=131;return $.length>0&&(e+=32),(V.showHeader||V.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},se=e=>{if(!V.disabled)if(I){const s=(e=>{if(e.actualValue.match(C)){const s=e.actualValue.replace("{{","").replace("}}","").split(".");let t=s[0];return s.forEach(((e,s)=>{if(0===s)return;const a=(e=>/\w+\[\d+\]/g.test(e))(e);if(a){const s=e.match(/(\w+)\[(\d+)\]/);if(s){const e=s[1],a=s[2];t+=`['${e}'][${a}]`}}else t+=`['${e}']`})),t}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);R(Object.assign(Object.assign({},e),{actualValue:s}))}else{if(e.isDefaultValueSupported)return X(e),void Q(!0);R(e)}};return s.jsx(j.VariablePickerContext.Provider,Object.assign({value:{variables:D,searchText:H,subHeaderStack:$,showRecommended:W,setSubHeaderStack:F,setSearchText:P,setVariables:E,setShowRecommended:z}},{children:s.jsxs("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(k||q||J)&&s.jsxs(v.HeaderWrapper,Object.assign({openDefault:J},{children:[s.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(q||J)&&s.jsx(c.IconButton,{Icon:()=>s.jsx(t.default,{width:16,height:16,style:{display:"flex",color:n.COLORS.content.primary}}),onClick:()=>{J?J&&Q(!1):B&&B()}}),(k||J)&&s.jsx(p.TitleRegular,{children:J?"Set up":null!=N?N:"Select Variable"})]})),Y&&s.jsx(c.IconButton,{style:{color:"#212121"},Icon:a.default,onClick:()=>V.onClose&&V.onClose()})]})),J&&U?s.jsx(g.DefaultVariableContent,{variable:U,onInsertVariable:e=>{R(e),console.log("uploa",e)}}):s.jsxs(s.Fragment,{children:[s.jsx("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:n.COLORS.surface.subdued,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:s.jsx(d.Input,{id:"search-bar-v3-picker",onBlur:e=>{V.onSearchBlur&&V.onSearchBlur(e)},value:H,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||M("");const s=f.searchVariables(e,K,$);if(W){const e=m.showOnlyRecommendedVariables(s,$);E(e)}else E(s);P(e);const t=$.length>0?$[$.length-1].displayName:"home";M(t)}})})),s.jsxs(v.RecommendWrapper,{children:[s.jsx(p.BodySecondary,Object.assign({style:{color:n.COLORS.content.secondary}},{children:"Only Recommended"})),s.jsx(h.Switch,{value:W,onValueChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield Z(s)}))})]}),$.length>0&&s.jsxs(v.BackHeader,{children:[s.jsx("div",Object.assign({style:{position:"absolute",left:16}},{children:s.jsx(c.IconButton,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>s.jsx(t.default,{width:12,height:12,style:{color:n.COLORS.content.secondary}}),onClick:e=>{e.stopPropagation();let s=H;const t=[...$],a=t.pop();if(F(t),a.displayName===A&&(P(""),s=""),s.length>0){const e=t.length>0?[t[t.length-1]]:w,a=f.searchVariables(s,e,t);if(W){const e=m.showOnlyRecommendedVariables(a,t);E(e)}else E(a)}else if(t.length>0)if(W){const e=m.showOnlyRecommendedVariables([t[t.length-1].variables],t);E(e)}else E([t[t.length-1].variables]);else if(W){const e=m.showOnlyRecommendedVariables(w,$);E(e)}else E(w)}})})),s.jsx(p.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:$[$.length-1].displayName}))]}),s.jsx(s.Fragment,{children:D.length>0?s.jsx(v.Container,Object.assign({height:ee()},{children:D.map(((e,t)=>{var a,r;return e.displayName&&void 0!==e.variables?s.jsx("div",Object.assign({style:{borderBottom:`1px solid ${n.COLORS.stroke.primary}`}},{children:s.jsx(o.BikAccordion,Object.assign({autoOpen:L&&0===t,headerPadding:"12px 16px",header:s.jsx(p.TitleSmall,Object.assign({style:{color:n.COLORS.content.secondary}},{children:S(e.displayName,H)}))},{children:s.jsx(O.default,{parentVariable:e,disabled:null!==(a=V.disabled)&&void 0!==a&&a,searchText:H,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported)return X(e),void Q(!0);R(e)}})}))}),e.displayName+W):e.displayName?s.jsx(b.Tooltip,Object.assign({body:O.renderTooltipBody(e),placement:"bottom"},{children:s.jsx(u.ListItem,{variant:V.disabled?"readonly":(null==e?void 0:e.selected)?"selected":"default",version:"2.0",leadingIcon:(null==e?void 0:e.selected)||V.disabled?s.jsx(s.Fragment,{}):s.jsx(i.default,{width:14,height:14}),customListItemLabel:s.jsxs("div",Object.assign({style:{display:"flex",gap:4}},{children:[s.jsx(p.BodySecondary,Object.assign({style:{fontSize:"14px",color:n.COLORS.text.primary}},{children:S(e.displayName,H)})),!e.isAvailable&&s.jsx(b.Tooltip,Object.assign({body:"Not Recommended"},{children:s.jsx("div",Object.assign({style:{display:"flex",marginTop:2}},{children:s.jsx(l.default,{width:16,height:16,color:n.COLORS.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>se(e)},t)}),t):s.jsx(O.default,{disabled:null!==(r=V.disabled)&&void 0!==r&&r,searchText:H,variable:e,onSelect:e=>se(e)},t)}))})):s.jsx(y.default,{height:ee(),searchText:H})})]})]}))}))},exports.highlightSearchText=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"@emotion/styled/base";import{COLORS as
|
|
1
|
+
import c from"@emotion/styled/base";import{COLORS as b}from"../../constants/Theme.js";const l=c("div","production"===process.env.NODE_ENV?{target:"e91dva42"}:{target:"e91dva42",label:"Container"})("background:",b.surface.standard,";border:",(c=>c.isError?2:1),"px solid ",(c=>c.isError?b.stroke.negative.vibrant:b.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRW9DIiwiZmlsZSI6IkN1c3RvbUVkaXRvci5zdHlsZWQudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuZXhwb3J0IGNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRiYWNrZ3JvdW5kOiAke0NPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAkeyhwcm9wcykgPT4gKHByb3BzLmlzRXJyb3IgPyAyIDogMSl9cHggc29saWRcblx0XHQkeyhwcm9wcykgPT4gcHJvcHMuaXNFcnJvciA/IENPTE9SUy5zdHJva2UubmVnYXRpdmUudmlicmFudCA6IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBUZXh0U3BhY2UgPSBzdHlsZWQudGV4dGFyZWEgYFxuXHR3aWR0aDogMTAwJTtcblxuXHRib3JkZXI6IDA7XG5cdHBhZGRpbmc6IDEycHggMTZweDtcblx0cmVzaXplOiBub25lO1xuXHRjb2xvcjogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblxuXHQmOmZvY3VzLXdpdGhpbiB7XG5cdFx0Ym9yZGVyOiAwO1xuXHRcdG91dGxpbmU6IDA7XG5cdH1cbmA7XHJcbmV4cG9ydCBjb25zdCBPdXRlckNvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuXHRnYXA6IDhweDtcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUN1c3RvbUVkaXRvci5zdHlsZWQuanMubWFwIl19 */")),d=c("textarea","production"===process.env.NODE_ENV?{target:"e91dva41"}:{target:"e91dva41",label:"TextSpace"})("width:100%;border:0;padding:12px 16px;resize:none;color:",b.content.primary,";&:focus-within{border:0;outline:0;}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUXlDIiwiZmlsZSI6IkN1c3RvbUVkaXRvci5zdHlsZWQudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuZXhwb3J0IGNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRiYWNrZ3JvdW5kOiAke0NPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAkeyhwcm9wcykgPT4gKHByb3BzLmlzRXJyb3IgPyAyIDogMSl9cHggc29saWRcblx0XHQkeyhwcm9wcykgPT4gcHJvcHMuaXNFcnJvciA/IENPTE9SUy5zdHJva2UubmVnYXRpdmUudmlicmFudCA6IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBUZXh0U3BhY2UgPSBzdHlsZWQudGV4dGFyZWEgYFxuXHR3aWR0aDogMTAwJTtcblxuXHRib3JkZXI6IDA7XG5cdHBhZGRpbmc6IDEycHggMTZweDtcblx0cmVzaXplOiBub25lO1xuXHRjb2xvcjogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblxuXHQmOmZvY3VzLXdpdGhpbiB7XG5cdFx0Ym9yZGVyOiAwO1xuXHRcdG91dGxpbmU6IDA7XG5cdH1cbmA7XHJcbmV4cG9ydCBjb25zdCBPdXRlckNvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuXHRnYXA6IDhweDtcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUN1c3RvbUVkaXRvci5zdHlsZWQuanMubWFwIl19 */")),X=c("div","production"===process.env.NODE_ENV?{target:"e91dva40"}:{target:"e91dva40",label:"OuterContainer"})("production"===process.env.NODE_ENV?{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"}:{name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkN1c3RvbUVkaXRvci5zdHlsZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUJ5QyIsImZpbGUiOiJDdXN0b21FZGl0b3Iuc3R5bGVkLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmV4cG9ydCBjb25zdCBDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHtDT0xPUlMuc3VyZmFjZS5zdGFuZGFyZH07XG5cdGJvcmRlcjogJHsocHJvcHMpID0+IChwcm9wcy5pc0Vycm9yID8gMiA6IDEpfXB4IHNvbGlkXG5cdFx0JHsocHJvcHMpID0+IHByb3BzLmlzRXJyb3IgPyBDT0xPUlMuc3Ryb2tlLm5lZ2F0aXZlLnZpYnJhbnQgOiBDT0xPUlMuc3Ryb2tlLnByaW1hcnl9O1xuXHRib3JkZXItcmFkaXVzOiA0cHg7XG5gO1xyXG5leHBvcnQgY29uc3QgVGV4dFNwYWNlID0gc3R5bGVkLnRleHRhcmVhIGBcblx0d2lkdGg6IDEwMCU7XG5cblx0Ym9yZGVyOiAwO1xuXHRwYWRkaW5nOiAxMnB4IDE2cHg7XG5cdHJlc2l6ZTogbm9uZTtcblx0Y29sb3I6ICR7Q09MT1JTLmNvbnRlbnQucHJpbWFyeX07XG5cblx0Jjpmb2N1cy13aXRoaW4ge1xuXHRcdGJvcmRlcjogMDtcblx0XHRvdXRsaW5lOiAwO1xuXHR9XG5gO1xyXG5leHBvcnQgY29uc3QgT3V0ZXJDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0ZGlzcGxheTogZmxleDtcblx0ZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblx0Z2FwOiA4cHg7XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1DdXN0b21FZGl0b3Iuc3R5bGVkLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}});export{l as Container,X as OuterContainer,d as TextSpace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import o from"../../assets/icons/info.svg.js";import{BaseWhatsappContentLangHelper as l}from"../../helpers/BaseWhatsappContentLang.helper.js";import i,{useRef as c,useImperativeHandle as u,useEffect as s}from"react";import{COLORS as a}from"../../constants/Theme.js";import{BodyCaption as d}from"../TypographyStyle.js";import{OuterContainer as v,Container as p,TextSpace as g}from"./CustomEditor.styled.js";import{EditorActionTypes as h,WhatsAppTextEditorHeader as m}from"./WhatsAppTextEditorHeader.js";const f="Character limit reached",x=new l,j={[h.BOLD]:"*",[h.ITALIC]:"_",[h.STRIKETHROUGH]:"~"},
|
|
1
|
+
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import o from"../../assets/icons/info.svg.js";import{BaseWhatsappContentLangHelper as l}from"../../helpers/BaseWhatsappContentLang.helper.js";import i,{useRef as c,useImperativeHandle as u,useEffect as s}from"react";import{COLORS as a}from"../../constants/Theme.js";import{BodyCaption as d}from"../TypographyStyle.js";import{OuterContainer as v,Container as p,TextSpace as g}from"./CustomEditor.styled.js";import{EditorActionTypes as h,WhatsAppTextEditorHeader as m}from"./WhatsAppTextEditorHeader.js";const f="Character limit reached",x=new l,j={[h.BOLD]:"*",[h.ITALIC]:"_",[h.STRIKETHROUGH]:"~"},b=i.forwardRef(((l,i)=>{var h,b,{onChange:E,onClickVariable:C,text:T,RightComponent:w,error:y,limit:O,onError:S,rows:L,actions:H}=l,k=t(l,["onChange","onClickVariable","text","RightComponent","error","limit","onError","rows","actions"]);const R=c(null);function I(t){const e=null==R?void 0:R.current;null!=e&&(e.selectionStart?(e.focus(),e.selectionEnd=t):e.focus())}function W(t){var e,n;let r=null!==(n=null===(e=R.current)||void 0===e?void 0:e.value)&&void 0!==n?n:"";if(R.current&&t){const e=R.current.selectionStart,n=R.current.selectionEnd,o=t;if(e===n)return M(o);{r=x.wrappWildcard(e,n,o,r);const t=x.getHTML(r);return R.current.value=r,{text:r,html:t}}}return{text:r,html:r}}function M(t){var e,n;let r=null!==(n=null===(e=R.current)||void 0===e?void 0:e.value)&&void 0!==n?n:"";if(R.current&&t){const e=R.current.selectionStart;if(e===R.current.selectionEnd)return A(t,e)}return{text:r,html:r}}function A(t,e){var n,r;let o=null!==(r=null===(n=R.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";o=o.slice(0,e)+t+o.slice(e);const l=x.getHTML(o);return R.current.value=o,{text:o,html:l}}u(i,(()=>({addTextOrWrap:W,addText:M,get(){var t,e;return null!==(e=null===(t=R.current)||void 0===t?void 0:t.value)&&void 0!==e?e:""},setCaretPosition:I}))),s((()=>{if(null==R?void 0:R.current){R.current.value=T||"";const t=x.getHTML(T||"");null==E||E(T||"",t)}}),[T]),s((()=>{var t,e;(null===(t=null==R?void 0:R.current)||void 0===t?void 0:t.value)&&O&&((null===(e=null==R?void 0:R.current)||void 0===e?void 0:e.value.length)>O?null==S||S(f):null==S||S(null!=y?y:""))}),[null===(h=null==R?void 0:R.current)||void 0===h?void 0:h.value.length]);const _=c(null);console.log("textSpaceRef",R);const z=()=>{_.current&&R.current&&(_.current.scrollTop=R.current.scrollTop,_.current.scrollLeft=R.current.scrollLeft)};return e(v,{children:[e(p,Object.assign({isError:!!y},{children:[n(m,{actions:H,ref:R,onActionSelect:function(t){if((null==j?void 0:j[t])&&R.current){const e=R.current.selectionStart;if(e===R.current.selectionEnd){A(null==j?void 0:j[t],e);const{text:n,html:r}=A(null==j?void 0:j[t],e);I(e+1),null==E||E(n,r)}else{const{text:e,html:n}=W(null==j?void 0:j[t]);null==E||E(e,n)}}},RightComponent:w,onEmojiClick:function(t){const{text:e,html:n}=M(t);null==E||E(e,n)}}),e("div",Object.assign({style:{position:"relative",background:""}},{children:[n("div",Object.assign({contentEditable:!1,ref:_,style:{position:"absolute",top:0,left:0,pointerEvents:"none",color:"transparent",zIndex:1,width:"100%",whiteSpace:"pre-wrap",wordWrap:"break-word",padding:"12px 16px",maxHeight:"100%",overflow:"auto",height:"48px"}},{children:(()=>{var t;const e=(null===(t=null==R?void 0:R.current)||void 0===t?void 0:t.value)||"";console.log(e);const r=/(\{\{.*?\}\})/g,o=e.split(r);return console.log(o),o.map(((t,e)=>r.test(t)?n("span",Object.assign({onClick:()=>{console.log(t),null==C||C(t)},onMouseEnter:()=>{console.log("hover",t)},style:{color:"purple",cursor:"pointer",pointerEvents:"auto"}},{children:t}),e):t))})()})),n(g,Object.assign({style:{zIndex:2,background:"none"},ref:R,onChange:function(t){const e=t.target.value,n=x.getHTML(e);null==E||E(e,n),z()}},k,{rows:L,onScroll:z}))]}))]})),y&&y!==f?e("div",Object.assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[n(o,{width:16,height:16,color:a.content.negative}),n(d,Object.assign({color:a.content.negative},{children:y}))]})):n(r,{children:O&&(null==R?void 0:R.current)?e(d,Object.assign({style:{color:y===f||(null===(b=null==R?void 0:R.current)||void 0===b?void 0:b.value.length)>O?a.content.negative:a.content.secondary}},{children:[R.current.value.length,"/",O]})):n(r,{})})]})}));b.displayName="WhatsAppTextEditor";export{b as WhatsAppTextEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as s,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/cross.svg.js";import a from"../../assets/icons/plus.svg.js";import n from"../../assets/icons/triangle_error.svg.js";import{useState as r,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{PickerType as w}from"./model.js";import S from"./NoResult.js";import{showOnlyRecommendedVariables as k}from"./recommendVaribles.js";import{searchVariables as C}from"./searchVariables.js";import{HeaderWrapper as V,RecommendWrapper as T,BackHeader as I,Container as N}from"./styles.js";import B,{renderTooltipBody as R}from"./SubHeaderItems.js";const D=(e,o)=>{if(0===o.length)return e;const i=e.toLowerCase().indexOf(o.toLowerCase());if(-1===i)return e;const l=e.slice(0,i),a=e.slice(i,i+o.length),n=e.slice(i+o.length);return s("span",{children:[l,t("b",Object.assign({style:{color:d.content.primary}},{children:a})),n]})},E=/.*\..*/,H=H=>{const{data:L,onSelect:$,showHeader:P,showBackButton:_,hideHeaderCross:A,onBackButtonClick:z,isEvaluationList:F,autoOpenFirst:K,headerText:M,contentHeight:q}=H,[G,J]=r(L),[Q,U]=r(""),[W,X]=r([]),[Y,Z]=r(""),[ee,te]=r(!1),[se,oe]=r([]),[ie,le]=r(!1),[ae,ne]=r(),re=ie&&H.type===w.EMBEDDED&&!A;console.log("variables",G),c((()=>{ce(!0)}),[]),c((()=>{W.length>0?oe([W[W.length-1]]):oe(L)}),[W]);const ce=t=>e(void 0,void 0,void 0,(function*(){if(te(t),t){const e=k(G,W);J(e)}else if(W.length>0){const e=Y==W[W.length-1].displayName;if(Q.length>0&&e){const e=C(Q,se,W);J(e)}else J([W[W.length-1].variables])}else if(Q.length>0){const e=C(Q,se,W);J(e)}else J(L)})),de=()=>{if(q)return q;let e=131;return W.length>0&&(e+=32),(H.showHeader||H.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},he=e=>{if(!H.disabled)if(F){const t=(e=>{if(e.actualValue.match(E)){const t=e.actualValue.replace("{{","").replace("}}","").split(".");let s=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];s+=`['${e}'][${o}]`}}else s+=`['${e}']`})),s}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);$(Object.assign(Object.assign({},e),{actualValue:t}))}else{if(e.isDefaultValueSupported)return ne(e),void le(!0);$(e)}};return t(x.Provider,Object.assign({value:{variables:G,searchText:Q,subHeaderStack:W,showRecommended:ee,setSubHeaderStack:X,setSearchText:U,setVariables:J,setShowRecommended:te}},{children:s("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(P||_||ie)&&s(V,Object.assign({openDefault:ie},{children:[s("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(_||ie)&&t(p,{Icon:()=>t(i,{width:16,height:16,style:{display:"flex",color:d.content.primary}}),onClick:()=>{ie?ie&&le(!1):z&&z()}}),(P||ie)&&t(f,{children:ie?"Set up":null!=M?M:"Select Variable"})]})),re&&t(p,{style:{color:"#212121"},Icon:l,onClick:()=>H.onClose&&H.onClose()})]})),ie&&ae?t(O,{variable:ae,onInsertVariable:e=>{$(e),console.log("uploa",e)}}):s(o,{children:[t("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:d.surface.subdued,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:t(m,{id:"search-bar-v3-picker",onBlur:e=>{H.onSearchBlur&&H.onSearchBlur(e)},value:Q,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||Z("");const t=C(e,se,W);if(ee){const e=k(t,W);J(e)}else J(t);U(e);const s=W.length>0?W[W.length-1].displayName:"home";Z(s)}})})),s(T,{children:[t(y,Object.assign({style:{color:d.content.secondary}},{children:"Only Recommended"})),t(g,{value:ee,onValueChange:t=>e(void 0,void 0,void 0,(function*(){yield ce(t)}))})]}),W.length>0&&s(I,{children:[t("div",Object.assign({style:{position:"absolute",left:16}},{children:t(p,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>t(i,{width:12,height:12,style:{color:d.content.secondary}}),onClick:e=>{e.stopPropagation();let t=Q;const s=[...W],o=s.pop();if(X(s),o.displayName===Y&&(U(""),t=""),t.length>0){const e=s.length>0?[s[s.length-1]]:L,o=C(t,e,s);if(ee){const e=k(o,s);J(e)}else J(o)}else if(s.length>0)if(ee){const e=k([s[s.length-1].variables],s);J(e)}else J([s[s.length-1].variables]);else if(ee){const e=k(L,W);J(e)}else J(L)}})})),t(v,Object.assign({style:{color:d.content.secondary}},{children:W[W.length-1].displayName}))]}),t(o,{children:G.length>0?t(N,Object.assign({height:de()},{children:G.map(((e,i)=>{var l,r;return e.displayName&&void 0!==e.variables?t("div",Object.assign({style:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:t(h,Object.assign({autoOpen:K&&0===i,headerPadding:"12px 16px",header:t(j,Object.assign({style:{color:d.content.secondary}},{children:D(e.displayName,Q)}))},{children:t(B,{parentVariable:e,disabled:null!==(l=H.disabled)&&void 0!==l&&l,searchText:Q,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported)return ne(e),void le(!0);$(e)}})}))}),e.displayName+ee):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(a,{width:14,height:14}),customListItemLabel:s("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(y,Object.assign({style:{fontSize:"14px",color:d.text.primary}},{children:D(e.displayName,Q)})),!e.isAvailable&&t(b,Object.assign({body:"Not Recommended"},{children:t("div",Object.assign({style:{display:"flex",marginTop:2}},{children:t(n,{width:16,height:16,color:d.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>he(e)},i)}),i):t(B,{disabled:null!==(r=H.disabled)&&void 0!==r&&r,searchText:Q,variable:e,onSelect:e=>he(e)},i)}))})):t(S,{height:de(),searchText:Q})})]})]}))}))};export{H as VariablePickerContent,D as highlightSearchText};
|