@integry/sdk 4.5.17 → 4.5.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.
package/dist/esm/index.csm.js
CHANGED
|
@@ -2236,7 +2236,7 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
|
|
|
2236
2236
|
keyValue="${`${l}.${e}`}"
|
|
2237
2237
|
/>`))}
|
|
2238
2238
|
</div>
|
|
2239
|
-
`};var us,ms={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};fe(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(us||(us={}));const hs=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=us.AppFields,onTagClick:a=()=>null,onOptionClick:l=()=>null,fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:_=!1,refreshRootStepData:u,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:v="",tagsComponent:x=null}=e,[w,b]=Oe(s),$=Re([]),C=Re(null),[I,L]=Oe(!1),[k,S]=Oe(""),[M,A]=Oe(!1),[D,T]=Oe(!1),[F,E]=Oe(y),[O,N]=Oe(!1);Ne((()=>{let e=i;Array.isArray(i)||(e=[]),$.current=(e||[]).map(((e,t)=>$.current[t]??{current:null}))}),[i]);const R=document.getElementById(r),W=()=>{const e=R?R.getBoundingClientRect().bottom:"";let t={top:R?`${e}px`:"",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"};return R&&R.getBoundingClientRect().bottom+210>window.innerHeight-8&&(t={bottom:window.innerHeight-R.getBoundingClientRect().top+"px",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"}),t};C.current=W();const z=()=>{C.current=W(),L((e=>!e))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.trim().length?e:e.filter((e=>e.value.toLowerCase().includes(t.trim().toLowerCase())))},P=e=>{b(e),p&&p(e)};Ne((()=>(d&&!o&&d.startsWith("{")&&d.endsWith("}")&&P(us.AppFields),window.addEventListener("scroll",z,!0),()=>window.removeEventListener("scroll",z))),[]);const V=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];A(!1),T(e)},U=()=>{u&&(A(!0),u(V))};let Z=[];
|
|
2239
|
+
`};var us,ms={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};fe(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(us||(us={}));const hs=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=us.AppFields,onTagClick:a=()=>null,onOptionClick:l=()=>null,fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:_=!1,refreshRootStepData:u,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:v="",tagsComponent:x=null}=e,[w,b]=Oe(s),$=Re([]),C=Re(null),[I,L]=Oe(!1),[k,S]=Oe(""),[M,A]=Oe(!1),[D,T]=Oe(!1),[F,E]=Oe(y),[O,N]=Oe(!1);Ne((()=>{let e=i;Array.isArray(i)||(e=[]),$.current=(e||[]).map(((e,t)=>$.current[t]??{current:null}))}),[i]);const R=document.getElementById(r),W=()=>{const e=R?R.getBoundingClientRect().bottom:"";let t={top:R?`${e}px`:"",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"};return R&&R.getBoundingClientRect().bottom+210>window.innerHeight-8&&(t={bottom:window.innerHeight-R.getBoundingClientRect().top+"px",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"}),t};C.current=W();const z=()=>{C.current=W(),L((e=>!e))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.trim().length?e:e.filter((e=>e.value.toLowerCase().includes(t.trim().toLowerCase())))},P=e=>{b(e),p&&p(e)};Ne((()=>(d&&!o&&d.startsWith("{")&&d.endsWith("}")&&P(us.AppFields),window.addEventListener("scroll",z,!0),()=>window.removeEventListener("scroll",z))),[]);const V=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];A(!1),T(e)},U=()=>{u&&(A(!0),u(V))};let Z=[];if(d&&(Z=g?JSON.parse(d):[d]),x){const e=f(x,{onSelect:()=>alert("Selected!")});console.log(e)}return B` <div
|
|
2240
2240
|
class=${`${ms.tagMenu} ${_?ms.tagMenuWithSearch:""}`}
|
|
2241
2241
|
style=${R&&C?.current?C.current:""}
|
|
2242
2242
|
>
|
|
@@ -2301,8 +2301,7 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
|
|
|
2301
2301
|
</span>
|
|
2302
2302
|
</div>`}
|
|
2303
2303
|
</div>`:B` <div className="${ms.mappedFieldMenu}">
|
|
2304
|
-
${x?B
|
|
2305
|
-
<//>`:B`${Object.keys(c?n:ps(n,k)).length>0?Object.keys(c?n:ps(n,k)).map(((e,t,i)=>B`
|
|
2304
|
+
${x?B`hello`:B`${Object.keys(c?n:ps(n,k)).length>0?Object.keys(c?n:ps(n,k)).map(((e,t,i)=>B`
|
|
2306
2305
|
<${_s}
|
|
2307
2306
|
objectKey="${e}"
|
|
2308
2307
|
keyValue="${e}"
|
|
@@ -7011,26 +7010,14 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
|
|
|
7011
7010
|
</div>
|
|
7012
7011
|
</div>
|
|
7013
7012
|
`}
|
|
7014
|
-
`}});const ap=e
|
|
7015
|
-
<div>
|
|
7016
|
-
${Object.keys(o).map(((e,t,i)=>B`
|
|
7017
|
-
<${_s}
|
|
7018
|
-
objectKey="${e}"
|
|
7019
|
-
keyValue="${e}"
|
|
7020
|
-
objectData="${o[e]}"
|
|
7021
|
-
onSelect=${n}
|
|
7022
|
-
isRoot="${!0}"
|
|
7023
|
-
/>
|
|
7024
|
-
`))}
|
|
7025
|
-
</div>
|
|
7026
|
-
`},lp={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class rp{static SDK_VERSION="4.5.17";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
|
|
7013
|
+
`}});const ap={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class lp{static SDK_VERSION="4.5.19";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
|
|
7027
7014
|
<${Il}
|
|
7028
7015
|
message="SDK failed to load"
|
|
7029
7016
|
debug=${n.debug}
|
|
7030
7017
|
config=${n.debug?e:null}
|
|
7031
7018
|
>
|
|
7032
7019
|
<//>
|
|
7033
|
-
`,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${
|
|
7020
|
+
`,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${lp.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
|
|
7034
7021
|
<${re.Provider}
|
|
7035
7022
|
value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
|
|
7036
7023
|
>
|
|
@@ -7314,10 +7301,10 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
|
|
|
7314
7301
|
isReadOnly="${!1}"
|
|
7315
7302
|
selectedAuthId="${t.connectedAccountId}"
|
|
7316
7303
|
accountConnected=${!0}
|
|
7317
|
-
tagsComponent=${
|
|
7304
|
+
tagsComponent=${t.tagsComponent}
|
|
7318
7305
|
onFieldChangeCallback=${t.onFieldChangeCallback}
|
|
7319
7306
|
tagsTree=${t.tagsTree}
|
|
7320
7307
|
/>
|
|
7321
7308
|
<//>
|
|
7322
7309
|
<//>
|
|
7323
|
-
</div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}export{
|
|
7310
|
+
</div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}export{ap as Helpers,lp as IntegryJS,B as html};
|
package/dist/umd/index.umd.js
CHANGED
|
@@ -2236,7 +2236,7 @@
|
|
|
2236
2236
|
keyValue="${`${l}.${e}`}"
|
|
2237
2237
|
/>`))}
|
|
2238
2238
|
</div>
|
|
2239
|
-
`};var us,ms={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};fe(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(us||(us={}));const hs=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=us.AppFields,onTagClick:a=()=>null,onOptionClick:l=()=>null,fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:_=!1,refreshRootStepData:u,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:v="",tagsComponent:x=null}=e,[w,b]=Oe(s),$=Re([]),C=Re(null),[I,L]=Oe(!1),[k,S]=Oe(""),[M,A]=Oe(!1),[D,T]=Oe(!1),[F,E]=Oe(y),[O,N]=Oe(!1);Ne((()=>{let e=i;Array.isArray(i)||(e=[]),$.current=(e||[]).map(((e,t)=>$.current[t]??{current:null}))}),[i]);const R=document.getElementById(r),W=()=>{const e=R?R.getBoundingClientRect().bottom:"";let t={top:R?`${e}px`:"",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"};return R&&R.getBoundingClientRect().bottom+210>window.innerHeight-8&&(t={bottom:window.innerHeight-R.getBoundingClientRect().top+"px",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"}),t};C.current=W();const z=()=>{C.current=W(),L((e=>!e))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.trim().length?e:e.filter((e=>e.value.toLowerCase().includes(t.trim().toLowerCase())))},P=e=>{b(e),p&&p(e)};Ne((()=>(d&&!o&&d.startsWith("{")&&d.endsWith("}")&&P(us.AppFields),window.addEventListener("scroll",z,!0),()=>window.removeEventListener("scroll",z))),[]);const V=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];A(!1),T(e)},U=()=>{u&&(A(!0),u(V))};let Z=[];
|
|
2239
|
+
`};var us,ms={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};fe(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(us||(us={}));const hs=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=us.AppFields,onTagClick:a=()=>null,onOptionClick:l=()=>null,fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:_=!1,refreshRootStepData:u,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:v="",tagsComponent:x=null}=e,[w,b]=Oe(s),$=Re([]),C=Re(null),[I,L]=Oe(!1),[k,S]=Oe(""),[M,A]=Oe(!1),[D,T]=Oe(!1),[F,E]=Oe(y),[O,N]=Oe(!1);Ne((()=>{let e=i;Array.isArray(i)||(e=[]),$.current=(e||[]).map(((e,t)=>$.current[t]??{current:null}))}),[i]);const R=document.getElementById(r),W=()=>{const e=R?R.getBoundingClientRect().bottom:"";let t={top:R?`${e}px`:"",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"};return R&&R.getBoundingClientRect().bottom+210>window.innerHeight-8&&(t={bottom:window.innerHeight-R.getBoundingClientRect().top+"px",left:R?`${R.getBoundingClientRect().left}px`:"",display:R&&!ds(R,"steps-body-container")?"none":"block",maxWidth:R?`${R.getBoundingClientRect().width}px`:"342px"}),t};C.current=W();const z=()=>{C.current=W(),L((e=>!e))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.trim().length?e:e.filter((e=>e.value.toLowerCase().includes(t.trim().toLowerCase())))},P=e=>{b(e),p&&p(e)};Ne((()=>(d&&!o&&d.startsWith("{")&&d.endsWith("}")&&P(us.AppFields),window.addEventListener("scroll",z,!0),()=>window.removeEventListener("scroll",z))),[]);const V=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];A(!1),T(e)},U=()=>{u&&(A(!0),u(V))};let Z=[];if(d&&(Z=g?JSON.parse(d):[d]),x){const e=f(x,{onSelect:()=>alert("Selected!")});console.log(e)}return B` <div
|
|
2240
2240
|
class=${`${ms.tagMenu} ${_?ms.tagMenuWithSearch:""}`}
|
|
2241
2241
|
style=${R&&C?.current?C.current:""}
|
|
2242
2242
|
>
|
|
@@ -2301,8 +2301,7 @@
|
|
|
2301
2301
|
</span>
|
|
2302
2302
|
</div>`}
|
|
2303
2303
|
</div>`:B` <div className="${ms.mappedFieldMenu}">
|
|
2304
|
-
${x?B
|
|
2305
|
-
<//>`:B`${Object.keys(c?n:ps(n,k)).length>0?Object.keys(c?n:ps(n,k)).map(((e,t,i)=>B`
|
|
2304
|
+
${x?B`hello`:B`${Object.keys(c?n:ps(n,k)).length>0?Object.keys(c?n:ps(n,k)).map(((e,t,i)=>B`
|
|
2306
2305
|
<${_s}
|
|
2307
2306
|
objectKey="${e}"
|
|
2308
2307
|
keyValue="${e}"
|
|
@@ -7011,26 +7010,14 @@
|
|
|
7011
7010
|
</div>
|
|
7012
7011
|
</div>
|
|
7013
7012
|
`}
|
|
7014
|
-
`}});
|
|
7015
|
-
<div>
|
|
7016
|
-
${Object.keys(o).map(((e,t,i)=>B`
|
|
7017
|
-
<${_s}
|
|
7018
|
-
objectKey="${e}"
|
|
7019
|
-
keyValue="${e}"
|
|
7020
|
-
objectData="${o[e]}"
|
|
7021
|
-
onSelect=${n}
|
|
7022
|
-
isRoot="${!0}"
|
|
7023
|
-
/>
|
|
7024
|
-
`))}
|
|
7025
|
-
</div>
|
|
7026
|
-
`};class lp{static SDK_VERSION="4.5.17";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
|
|
7013
|
+
`}});class ap{static SDK_VERSION="4.5.19";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
|
|
7027
7014
|
<${Il}
|
|
7028
7015
|
message="SDK failed to load"
|
|
7029
7016
|
debug=${n.debug}
|
|
7030
7017
|
config=${n.debug?e:null}
|
|
7031
7018
|
>
|
|
7032
7019
|
<//>
|
|
7033
|
-
`,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${
|
|
7020
|
+
`,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${ap.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
|
|
7034
7021
|
<${re.Provider}
|
|
7035
7022
|
value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
|
|
7036
7023
|
>
|
|
@@ -7314,10 +7301,10 @@
|
|
|
7314
7301
|
isReadOnly="${!1}"
|
|
7315
7302
|
selectedAuthId="${t.connectedAccountId}"
|
|
7316
7303
|
accountConnected=${!0}
|
|
7317
|
-
tagsComponent=${
|
|
7304
|
+
tagsComponent=${t.tagsComponent}
|
|
7318
7305
|
onFieldChangeCallback=${t.onFieldChangeCallback}
|
|
7319
7306
|
tagsTree=${t.tagsTree}
|
|
7320
7307
|
/>
|
|
7321
7308
|
<//>
|
|
7322
7309
|
<//>
|
|
7323
|
-
</div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}return
|
|
7310
|
+
</div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}return ap.Helpers={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}},ap.html=B,ap}));
|
package/package.json
CHANGED
|
@@ -216,6 +216,8 @@ const FieldDropdown = (props: FieldMenuProps) => {
|
|
|
216
216
|
const tagsComponentRender = createElement(tagsComponent, {
|
|
217
217
|
onSelect: () => alert('Selected!'),
|
|
218
218
|
});
|
|
219
|
+
// eslint-disable-next-line no-console
|
|
220
|
+
console.log(tagsComponentRender);
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
return html` <div
|
|
@@ -343,8 +345,7 @@ const FieldDropdown = (props: FieldMenuProps) => {
|
|
|
343
345
|
</div>`
|
|
344
346
|
: html` <div className="${styles.mappedFieldMenu}">
|
|
345
347
|
${tagsComponent
|
|
346
|
-
? html
|
|
347
|
-
<//>`
|
|
348
|
+
? html`hello`
|
|
348
349
|
: html`${Object.keys(
|
|
349
350
|
!isEditable ? searchJSON(tags, searchValue) : tags,
|
|
350
351
|
).length > 0
|
package/src/index.ts
CHANGED
|
@@ -2018,7 +2018,7 @@ export class IntegryJS {
|
|
|
2018
2018
|
isReadOnly="${false}"
|
|
2019
2019
|
selectedAuthId="${options.connectedAccountId}"
|
|
2020
2020
|
accountConnected=${true}
|
|
2021
|
-
tagsComponent=${
|
|
2021
|
+
tagsComponent=${options.tagsComponent}
|
|
2022
2022
|
onFieldChangeCallback=${options.onFieldChangeCallback}
|
|
2023
2023
|
tagsTree=${options.tagsTree}
|
|
2024
2024
|
/>
|