@opencx/widget 3.0.75 → 3.0.76
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/designs.cjs +1 -1
- package/dist/designs.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/src/headless/core/__tests__/test-utils.d.ts +5 -2
- package/dist/src/headless/core/api/api-caller.d.ts +5 -2
- package/dist/src/headless/core/api/schema.d.ts +10 -3
- package/dist/src/headless/core/types/json-value.d.ts +7 -0
- package/dist/src/headless/core/types/widget-config.d.ts +8 -6
- package/dist/{useWidgetTrigger-CwB0x_Pe.js → useWidgetTrigger-CJFrgKrO.js} +3 -3
- package/dist/{useWidgetTrigger-CwB0x_Pe.js.map → useWidgetTrigger-CJFrgKrO.js.map} +1 -1
- package/dist/{useWidgetTrigger-CiYy4rS2.cjs → useWidgetTrigger-D-OdmCtY.cjs} +2 -2
- package/dist/{useWidgetTrigger-CiYy4rS2.cjs.map → useWidgetTrigger-D-OdmCtY.cjs.map} +1 -1
- package/dist/{widget.ctx-DUaeXkNb.cjs → widget.ctx-D_eeZ2xk.cjs} +2 -2
- package/dist/{widget.ctx-DUaeXkNb.cjs.map → widget.ctx-D_eeZ2xk.cjs.map} +1 -1
- package/dist/{widget.ctx-COUAUyWX.js → widget.ctx-W1JQt9cl.js} +2 -1
- package/dist/{widget.ctx-COUAUyWX.js.map → widget.ctx-W1JQt9cl.js.map} +1 -1
- package/dist-embed/script.js +2 -2
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
package/dist/designs.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),uu=require("@radix-ui/react-popover"),X=require("react"),W=require("./useWidgetTrigger-CiYy4rS2.cjs"),lu=require("@radix-ui/react-dialog"),le=require("lucide-react"),va=require("clsx"),fr=require("react-dom"),cu=require("@radix-ui/react-slot"),be=require("framer-motion"),du=require("@radix-ui/react-avatar"),hu=require("@radix-ui/react-tooltip"),hi=require("tinycolor2"),fu=require("react-dropzone"),pu=require("@radix-ui/react-dropdown-menu"),Gn=require("zod");function It(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Dn=It(uu),ye=It(X),ze=It(lu),St=It(du),sn=It(hu),me=It(pu);function fi(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ne=st(/[A-Za-z]/),Ae=st(/[\dA-Za-z]/),mu=st(/[#-'*+\--9=?A-Z^-~]/);function Cn(e){return e!==null&&(e<32||e===127)}const pr=st(/\d/),gu=st(/[\dA-Fa-f]/),bu=st(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function se(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}const vn=st(new RegExp("\\p{P}|\\p{S}","u")),pt=st(/\s/);function st(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Pn=function(e){if(e==null)return yu;if(typeof e=="function")return Mn(e);if(typeof e=="object")return Array.isArray(e)?Tu(e):xu(e);if(typeof e=="string")return wu(e);throw new Error("Expected function, string, or object as test")};function Tu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pn(e[n]);return Mn(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function xu(e){const t=e;return Mn(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function wu(e){return Mn(t);function t(n){return n&&n.type===e}}function Mn(e){return t;function t(n,r,i){return!!(_u(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yu(){return!0}function _u(e){return e!==null&&typeof e=="object"&&"type"in e}const Pa=[],Au=!0,mr=!1,Cu="skip";function Ma(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Pn(i),s=r?-1:1;u(e,void 0,[])();function u(l,c,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=Pa,E,y,k;if((!t||a(l,c,d[d.length-1]||void 0))&&(p=ku(n(l,d)),p[0]===mr))return p;if("children"in l&&l.children){const _=l;if(_.children&&p[0]!==Cu)for(y=(r?_.children.length:-1)+s,k=d.concat(_);y>-1&&y<_.children.length;){const S=_.children[y];if(E=u(S,y,k)(),E[0]===mr)return E;y=typeof E[1]=="number"?E[1]:y+s}}return p}}}function ku(e){return Array.isArray(e)?e:typeof e=="number"?[Au,e]:e==null?Pa:[e]}function Nu(e,t,n){const i=Pn((n||{}).ignore||[]),a=Iu(t);let s=-1;for(;++s<a.length;)Ma(e,"text",u);function u(c,d){let h=-1,g;for(;++h<d.length;){const p=d[h],E=g?g.children:void 0;if(i(p,E?E.indexOf(p):void 0,g))return;g=p}if(g)return l(c,d)}function l(c,d){const h=d[d.length-1],g=a[s][0],p=a[s][1];let E=0;const k=h.children.indexOf(c);let _=!1,S=[];g.lastIndex=0;let L=g.exec(c.value);for(;L;){const M=L.index,F={index:L.index,input:L.input,stack:[...d,c]};let I=p(...L,F);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?g.lastIndex=M+1:(E!==M&&S.push({type:"text",value:c.value.slice(E,M)}),Array.isArray(I)?S.push(...I):I&&S.push(I),E=M+L[0].length,_=!0),!g.global)break;L=g.exec(c.value)}return _?(E<c.value.length&&S.push({type:"text",value:c.value.slice(E)}),h.children.splice(k,1,...S)):S=[c],k+S.length}}function Iu(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Su(i[0]),Ou(i[1])])}return t}function Su(e){return typeof e=="string"?new RegExp(Eu(e),"g"):e}function Ou(e){return typeof e=="function"?e:function(){return e}}const Qn="phrasing",Xn=["autolink","link","image","label"];function Lu(){return{transforms:[Fu],enter:{literalAutolink:Du,literalAutolinkEmail:Kn,literalAutolinkHttp:Kn,literalAutolinkWww:Kn},exit:{literalAutolink:Bu,literalAutolinkEmail:Mu,literalAutolinkHttp:vu,literalAutolinkWww:Pu}}}function Ru(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qn,notInConstruct:Xn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qn,notInConstruct:Xn},{character:":",before:"[ps]",after:"\\/",inConstruct:Qn,notInConstruct:Xn}]}}function Du(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kn(e){this.config.enter.autolinkProtocol.call(this,e)}function vu(e){this.config.exit.autolinkProtocol.call(this,e)}function Pu(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Mu(e){this.config.exit.autolinkEmail.call(this,e)}function Bu(e){this.exit(e)}function Fu(e){Nu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Hu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Uu]],{ignore:["link","linkReference"]})}function Hu(e,t,n,r,i){let a="";if(!Ba(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!zu(n)))return!1;const s=ju(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function Uu(e,t,n,r){return!Ba(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zu(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ju(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=fi(e,"(");let a=fi(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ba(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pt(n)||vn(n))&&(!t||n!==47)}function Ue(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Fa.peek=Zu;function Yu(){return{enter:{gfmFootnoteDefinition:qu,gfmFootnoteDefinitionLabelString:Vu,gfmFootnoteCall:Xu,gfmFootnoteCallString:Ku},exit:{gfmFootnoteDefinition:Qu,gfmFootnoteDefinitionLabelString:Gu,gfmFootnoteCall:Ju,gfmFootnoteCallString:$u}}}function Wu(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:el,footnoteReference:Fa}}}function qu(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vu(){this.buffer()}function Gu(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase()}function Qu(e){this.exit(e)}function Xu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ku(){this.buffer()}function $u(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase()}function Ju(e){this.exit(e)}function Fa(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),u(),s(),a+=i.move("]"),a}function Zu(){return"["}function el(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteDefinition"),u=n.enter("label");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),u(),a+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),a+=i.move(n.indentLines(n.containerFlow(e,i.current()),tl)),s(),a}function tl(e,t,n){return t===0?e:(n?"":" ")+e}const nl=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ha.peek=ol;function rl(){return{canContainEols:["delete"],enter:{strikethrough:al},exit:{strikethrough:sl}}}function il(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nl}],handlers:{delete:Ha}}}function al(e){this.enter({type:"delete",children:[]},e)}function sl(e){this.exit(e)}function Ha(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function ol(){return"~"}function ul(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||cl,i=[],a=[],s=[],u=[];let l=0,c=-1;for(;++c<e.length;){const E=[],y=[];let k=-1;for(e[c].length>l&&(l=e[c].length);++k<e[c].length;){const _=ll(e[c][k]);if(t.alignDelimiters!==!1){const S=r(_);y[k]=S,(u[k]===void 0||S>u[k])&&(u[k]=S)}E.push(_)}a[c]=E,s[c]=y}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<l;)i[d]=pi(n[d]);else{const E=pi(n);for(;++d<l;)i[d]=E}d=-1;const h=[],g=[];for(;++d<l;){const E=i[d];let y="",k="";E===99?(y=":",k=":"):E===108?y=":":E===114&&(k=":");let _=t.alignDelimiters===!1?1:Math.max(1,u[d]-y.length-k.length);const S=y+"-".repeat(_)+k;t.alignDelimiters!==!1&&(_=y.length+_+k.length,_>u[d]&&(u[d]=_),g[d]=_),h[d]=S}a.splice(1,0,h),s.splice(1,0,g),c=-1;const p=[];for(;++c<a.length;){const E=a[c],y=s[c];d=-1;const k=[];for(;++d<l;){const _=E[d]||"";let S="",L="";if(t.alignDelimiters!==!1){const M=u[d]-(y[d]||0),F=i[d];F===114?S=" ".repeat(M):F===99?M%2?(S=" ".repeat(M/2+.5),L=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),L=S):L=" ".repeat(M)}t.delimiterStart!==!1&&!d&&k.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&_==="")&&(t.delimiterStart!==!1||d)&&k.push(" "),t.alignDelimiters!==!1&&k.push(S),k.push(_),t.alignDelimiters!==!1&&k.push(L),t.padding!==!1&&k.push(" "),(t.delimiterEnd!==!1||d!==l-1)&&k.push("|")}p.push(t.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return p.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),uu=require("@radix-ui/react-popover"),X=require("react"),W=require("./useWidgetTrigger-D-OdmCtY.cjs"),lu=require("@radix-ui/react-dialog"),le=require("lucide-react"),va=require("clsx"),fr=require("react-dom"),cu=require("@radix-ui/react-slot"),be=require("framer-motion"),du=require("@radix-ui/react-avatar"),hu=require("@radix-ui/react-tooltip"),hi=require("tinycolor2"),fu=require("react-dropzone"),pu=require("@radix-ui/react-dropdown-menu"),Gn=require("zod");function It(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Dn=It(uu),ye=It(X),ze=It(lu),St=It(du),sn=It(hu),me=It(pu);function fi(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ne=st(/[A-Za-z]/),Ae=st(/[\dA-Za-z]/),mu=st(/[#-'*+\--9=?A-Z^-~]/);function Cn(e){return e!==null&&(e<32||e===127)}const pr=st(/\d/),gu=st(/[\dA-Fa-f]/),bu=st(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function se(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}const vn=st(new RegExp("\\p{P}|\\p{S}","u")),pt=st(/\s/);function st(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Pn=function(e){if(e==null)return yu;if(typeof e=="function")return Mn(e);if(typeof e=="object")return Array.isArray(e)?Tu(e):xu(e);if(typeof e=="string")return wu(e);throw new Error("Expected function, string, or object as test")};function Tu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pn(e[n]);return Mn(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function xu(e){const t=e;return Mn(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function wu(e){return Mn(t);function t(n){return n&&n.type===e}}function Mn(e){return t;function t(n,r,i){return!!(_u(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yu(){return!0}function _u(e){return e!==null&&typeof e=="object"&&"type"in e}const Pa=[],Au=!0,mr=!1,Cu="skip";function Ma(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Pn(i),s=r?-1:1;u(e,void 0,[])();function u(l,c,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=Pa,E,y,k;if((!t||a(l,c,d[d.length-1]||void 0))&&(p=ku(n(l,d)),p[0]===mr))return p;if("children"in l&&l.children){const _=l;if(_.children&&p[0]!==Cu)for(y=(r?_.children.length:-1)+s,k=d.concat(_);y>-1&&y<_.children.length;){const S=_.children[y];if(E=u(S,y,k)(),E[0]===mr)return E;y=typeof E[1]=="number"?E[1]:y+s}}return p}}}function ku(e){return Array.isArray(e)?e:typeof e=="number"?[Au,e]:e==null?Pa:[e]}function Nu(e,t,n){const i=Pn((n||{}).ignore||[]),a=Iu(t);let s=-1;for(;++s<a.length;)Ma(e,"text",u);function u(c,d){let h=-1,g;for(;++h<d.length;){const p=d[h],E=g?g.children:void 0;if(i(p,E?E.indexOf(p):void 0,g))return;g=p}if(g)return l(c,d)}function l(c,d){const h=d[d.length-1],g=a[s][0],p=a[s][1];let E=0;const k=h.children.indexOf(c);let _=!1,S=[];g.lastIndex=0;let L=g.exec(c.value);for(;L;){const M=L.index,F={index:L.index,input:L.input,stack:[...d,c]};let I=p(...L,F);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?g.lastIndex=M+1:(E!==M&&S.push({type:"text",value:c.value.slice(E,M)}),Array.isArray(I)?S.push(...I):I&&S.push(I),E=M+L[0].length,_=!0),!g.global)break;L=g.exec(c.value)}return _?(E<c.value.length&&S.push({type:"text",value:c.value.slice(E)}),h.children.splice(k,1,...S)):S=[c],k+S.length}}function Iu(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Su(i[0]),Ou(i[1])])}return t}function Su(e){return typeof e=="string"?new RegExp(Eu(e),"g"):e}function Ou(e){return typeof e=="function"?e:function(){return e}}const Qn="phrasing",Xn=["autolink","link","image","label"];function Lu(){return{transforms:[Fu],enter:{literalAutolink:Du,literalAutolinkEmail:Kn,literalAutolinkHttp:Kn,literalAutolinkWww:Kn},exit:{literalAutolink:Bu,literalAutolinkEmail:Mu,literalAutolinkHttp:vu,literalAutolinkWww:Pu}}}function Ru(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qn,notInConstruct:Xn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qn,notInConstruct:Xn},{character:":",before:"[ps]",after:"\\/",inConstruct:Qn,notInConstruct:Xn}]}}function Du(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kn(e){this.config.enter.autolinkProtocol.call(this,e)}function vu(e){this.config.exit.autolinkProtocol.call(this,e)}function Pu(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Mu(e){this.config.exit.autolinkEmail.call(this,e)}function Bu(e){this.exit(e)}function Fu(e){Nu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Hu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Uu]],{ignore:["link","linkReference"]})}function Hu(e,t,n,r,i){let a="";if(!Ba(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!zu(n)))return!1;const s=ju(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function Uu(e,t,n,r){return!Ba(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zu(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ju(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=fi(e,"(");let a=fi(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ba(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pt(n)||vn(n))&&(!t||n!==47)}function Ue(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Fa.peek=Zu;function Yu(){return{enter:{gfmFootnoteDefinition:qu,gfmFootnoteDefinitionLabelString:Vu,gfmFootnoteCall:Xu,gfmFootnoteCallString:Ku},exit:{gfmFootnoteDefinition:Qu,gfmFootnoteDefinitionLabelString:Gu,gfmFootnoteCall:Ju,gfmFootnoteCallString:$u}}}function Wu(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:el,footnoteReference:Fa}}}function qu(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vu(){this.buffer()}function Gu(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase()}function Qu(e){this.exit(e)}function Xu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ku(){this.buffer()}function $u(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase()}function Ju(e){this.exit(e)}function Fa(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),u(),s(),a+=i.move("]"),a}function Zu(){return"["}function el(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteDefinition"),u=n.enter("label");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),u(),a+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),a+=i.move(n.indentLines(n.containerFlow(e,i.current()),tl)),s(),a}function tl(e,t,n){return t===0?e:(n?"":" ")+e}const nl=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ha.peek=ol;function rl(){return{canContainEols:["delete"],enter:{strikethrough:al},exit:{strikethrough:sl}}}function il(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nl}],handlers:{delete:Ha}}}function al(e){this.enter({type:"delete",children:[]},e)}function sl(e){this.exit(e)}function Ha(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function ol(){return"~"}function ul(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||cl,i=[],a=[],s=[],u=[];let l=0,c=-1;for(;++c<e.length;){const E=[],y=[];let k=-1;for(e[c].length>l&&(l=e[c].length);++k<e[c].length;){const _=ll(e[c][k]);if(t.alignDelimiters!==!1){const S=r(_);y[k]=S,(u[k]===void 0||S>u[k])&&(u[k]=S)}E.push(_)}a[c]=E,s[c]=y}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<l;)i[d]=pi(n[d]);else{const E=pi(n);for(;++d<l;)i[d]=E}d=-1;const h=[],g=[];for(;++d<l;){const E=i[d];let y="",k="";E===99?(y=":",k=":"):E===108?y=":":E===114&&(k=":");let _=t.alignDelimiters===!1?1:Math.max(1,u[d]-y.length-k.length);const S=y+"-".repeat(_)+k;t.alignDelimiters!==!1&&(_=y.length+_+k.length,_>u[d]&&(u[d]=_),g[d]=_),h[d]=S}a.splice(1,0,h),s.splice(1,0,g),c=-1;const p=[];for(;++c<a.length;){const E=a[c],y=s[c];d=-1;const k=[];for(;++d<l;){const _=E[d]||"";let S="",L="";if(t.alignDelimiters!==!1){const M=u[d]-(y[d]||0),F=i[d];F===114?S=" ".repeat(M):F===99?M%2?(S=" ".repeat(M/2+.5),L=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),L=S):L=" ".repeat(M)}t.delimiterStart!==!1&&!d&&k.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&_==="")&&(t.delimiterStart!==!1||d)&&k.push(" "),t.alignDelimiters!==!1&&k.push(S),k.push(_),t.alignDelimiters!==!1&&k.push(L),t.padding!==!1&&k.push(" "),(t.delimiterEnd!==!1||d!==l-1)&&k.push("|")}p.push(t.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return p.join(`
|
|
2
2
|
`)}function ll(e){return e==null?"":String(e)}function cl(e){return e.length}function pi(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const mi={}.hasOwnProperty;function Ua(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&mi.call(i,e)){const l=String(i[e]);s=mi.call(u,l)?u[l]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function dl(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),hl);return i(),s}function hl(e,t,n){return">"+(n?"":" ")+e}function fl(e,t){return gi(e,t.inConstruct,!0)&&!gi(e,t.notInConstruct,!1)}function gi(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bi(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
3
3
|
`&&fl(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
4
4
|
`}function pl(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function ml(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function gl(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function bl(e,t,n,r){const i=gl(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ml(e,n)){const h=n.enter("codeIndented"),g=n.indentLines(a,El);return h(),g}const u=n.createTracker(r),l=i.repeat(Math.max(pl(a,i)+1,3)),c=n.enter("codeFenced");let d=u.move(l);if(e.lang){const h=n.enter(`codeFencedLang${s}`);d+=u.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...u.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);d+=u.move(" "),d+=u.move(n.safe(e.meta,{before:d,after:`
|
package/dist/designs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment as Qa, jsx as b, jsxs as U } from "react/jsx-runtime";
|
|
|
2
2
|
import * as Un from "@radix-ui/react-popover";
|
|
3
3
|
import * as Te from "react";
|
|
4
4
|
import an, { forwardRef as zr, useState as Fe, useImperativeHandle as Au, useRef as cn, useCallback as Cu, useMemo as Yr, useEffect as Ot, memo as ku, cloneElement as Nu, createElement as Ai } from "react";
|
|
5
|
-
import { l as Ci, m as Iu, a as We, u as mt, d as dn, g as zn, i as Su, c as Xa, h as Lt, e as Yn, j as hn, b as Ou, _ as Lu, W as Ru, k as Du } from "./useWidgetTrigger-
|
|
5
|
+
import { l as Ci, m as Iu, a as We, u as mt, d as dn, g as zn, i as Su, c as Xa, h as Lt, e as Yn, j as hn, b as Ou, _ as Lu, W as Ru, k as Du } from "./useWidgetTrigger-CJFrgKrO.js";
|
|
6
6
|
import * as Ue from "@radix-ui/react-dialog";
|
|
7
7
|
import { X as vu, PaperclipIcon as Pu, ImageIcon as Mu, CircleDashed as Bu, ArrowUpIcon as Fu, CircleCheckIcon as Hu, XIcon as jr, AlertCircle as Uu, Loader2 as zu, FileAudio2Icon as Yu, FileVideo2Icon as ju, FileIcon as Wu, ChevronRight as qu, Check as Vu, Circle as Gu, ChevronLeftIcon as Qu, EllipsisVerticalIcon as Xu, MessageCirclePlusIcon as Ku, LoaderIcon as $u, SendHorizontal as Ju, UserRoundIcon as Zu, ChevronRightIcon as el, ChevronDownIcon as tl } from "lucide-react";
|
|
8
8
|
import { clsx as Ka } from "clsx";
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-D_eeZ2xk.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-D-OdmCtY.cjs");function g(t,i,s){const{widgetCtx:{api:u}}=e.useWidget();return e._default(async r=>u.vote({action:r==="up"?"upvote":"downvote",messagePublicId:t,sessionId:i}).then(s),[u,t,i,s])}exports.WidgetProvider=e.WidgetProvider;exports.WidgetTriggerProvider=e.WidgetTriggerProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useWidgetTrigger=e.useWidgetTrigger;exports.useVote=g;
|
|
2
2
|
//# sourceMappingURL=react.cjs.map
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u, _ as r } from "./useWidgetTrigger-
|
|
2
|
-
import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-
|
|
1
|
+
import { u, _ as r } from "./useWidgetTrigger-CJFrgKrO.js";
|
|
2
|
+
import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-CJFrgKrO.js";
|
|
3
3
|
function g(e, s, t) {
|
|
4
4
|
const {
|
|
5
5
|
widgetCtx: { api: a }
|
|
@@ -82,7 +82,7 @@ export declare const TestUtils: {
|
|
|
82
82
|
email?: string;
|
|
83
83
|
non_verified_name?: string;
|
|
84
84
|
non_verified_custom_data?: {
|
|
85
|
-
[key: string]: string;
|
|
85
|
+
[key: string]: string | number | boolean;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
}, `${string}/${string}`>> | undefined): void;
|
|
@@ -159,13 +159,16 @@ export declare const TestUtils: {
|
|
|
159
159
|
uuid: string;
|
|
160
160
|
content: string;
|
|
161
161
|
session_id: string;
|
|
162
|
+
bot_token: string;
|
|
162
163
|
headers?: {
|
|
163
164
|
[key: string]: string;
|
|
164
165
|
} | null;
|
|
165
|
-
bot_token: string;
|
|
166
166
|
query_params?: {
|
|
167
167
|
[key: string]: string;
|
|
168
168
|
} | null;
|
|
169
|
+
body_properties?: {
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
} | null;
|
|
169
172
|
language?: string | null;
|
|
170
173
|
attachments?: {
|
|
171
174
|
id: string;
|
|
@@ -116,13 +116,16 @@ export declare class ApiCaller {
|
|
|
116
116
|
uuid: string;
|
|
117
117
|
content: string;
|
|
118
118
|
session_id: string;
|
|
119
|
+
bot_token: string;
|
|
119
120
|
headers?: {
|
|
120
121
|
[key: string]: string;
|
|
121
122
|
} | null;
|
|
122
|
-
bot_token: string;
|
|
123
123
|
query_params?: {
|
|
124
124
|
[key: string]: string;
|
|
125
125
|
} | null;
|
|
126
|
+
body_properties?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
} | null;
|
|
126
129
|
language?: string | null;
|
|
127
130
|
attachments?: {
|
|
128
131
|
id: string;
|
|
@@ -179,7 +182,7 @@ export declare class ApiCaller {
|
|
|
179
182
|
email?: string;
|
|
180
183
|
non_verified_name?: string;
|
|
181
184
|
non_verified_custom_data?: {
|
|
182
|
-
[key: string]: string;
|
|
185
|
+
[key: string]: string | number | boolean;
|
|
183
186
|
};
|
|
184
187
|
};
|
|
185
188
|
}, `${string}/${string}`>>;
|
|
@@ -171,7 +171,7 @@ export interface components {
|
|
|
171
171
|
email?: string;
|
|
172
172
|
non_verified_name?: string;
|
|
173
173
|
non_verified_custom_data?: {
|
|
174
|
-
[key: string]: string;
|
|
174
|
+
[key: string]: string | number | boolean;
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
177
|
CreateWidgetSessionDto: {
|
|
@@ -186,7 +186,7 @@ export interface components {
|
|
|
186
186
|
HandleContactMessageOutputDto: {
|
|
187
187
|
/** @enum {boolean} */
|
|
188
188
|
success: true;
|
|
189
|
-
code?: string | 'session_assigned_to_human_agent';
|
|
189
|
+
code?: string | 'session_assigned_to_human_agent' | 'response_cancelled';
|
|
190
190
|
autopilotResponse?: {
|
|
191
191
|
/** @enum {string} */
|
|
192
192
|
type: 'text';
|
|
@@ -196,6 +196,7 @@ export interface components {
|
|
|
196
196
|
};
|
|
197
197
|
id?: string;
|
|
198
198
|
mightSolveUserIssue: boolean;
|
|
199
|
+
completelyAndFullyCoveredUserIssue: boolean;
|
|
199
200
|
};
|
|
200
201
|
uiResponse?: {
|
|
201
202
|
/** @enum {string} */
|
|
@@ -245,13 +246,19 @@ export interface components {
|
|
|
245
246
|
uuid: string;
|
|
246
247
|
content: string;
|
|
247
248
|
session_id: string;
|
|
249
|
+
bot_token: string;
|
|
250
|
+
/** @description Additional headers to be included in the request of action calls */
|
|
248
251
|
headers?: {
|
|
249
252
|
[key: string]: string;
|
|
250
253
|
} | null;
|
|
251
|
-
|
|
254
|
+
/** @description Additional query parameters to be included in the query of action calls */
|
|
252
255
|
query_params?: {
|
|
253
256
|
[key: string]: string;
|
|
254
257
|
} | null;
|
|
258
|
+
/** @description Additional body properties to be included in the body of action calls */
|
|
259
|
+
body_properties?: {
|
|
260
|
+
[key: string]: unknown;
|
|
261
|
+
} | null;
|
|
255
262
|
language?: string | null;
|
|
256
263
|
attachments?: {
|
|
257
264
|
id: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentOrBotType } from './agent-or-bot';
|
|
2
|
+
import { JsonValue } from './json-value';
|
|
2
3
|
type UserBaseConfig = {
|
|
3
4
|
token: string;
|
|
4
5
|
data?: never;
|
|
@@ -220,19 +221,20 @@ export interface WidgetConfig {
|
|
|
220
221
|
*/
|
|
221
222
|
anchorTarget?: '_blank' | '_top';
|
|
222
223
|
/**
|
|
223
|
-
* Headers to be
|
|
224
|
-
* These headers will be sent with each AI action (AI tools) that the LLM can call.
|
|
225
|
-
* This is useful if your AI actions require authentication specific to each contact.
|
|
224
|
+
* Headers to be added to every Http AI action taken.
|
|
226
225
|
* @default undefined
|
|
227
226
|
*/
|
|
228
227
|
headers?: Record<string, string>;
|
|
229
228
|
/**
|
|
230
|
-
* Query params to be
|
|
231
|
-
* These query params will be sent with each AI action (AI tools) that the LLM can call.
|
|
232
|
-
* This is useful if you want to send extra information with each AI action.
|
|
229
|
+
* Query params to be added to every Http AI action taken.
|
|
233
230
|
* @default undefined
|
|
234
231
|
*/
|
|
235
232
|
queryParams?: Record<string, string>;
|
|
233
|
+
/**
|
|
234
|
+
* Properties to be added to the `body` of every Http AI action taken.
|
|
235
|
+
* @default undefined
|
|
236
|
+
*/
|
|
237
|
+
bodyProperties?: Record<string, JsonValue>;
|
|
236
238
|
/**
|
|
237
239
|
* Dynamic context to be sent with each send-message request from the widget.
|
|
238
240
|
* Useful if you want to send data regarding the current page the user is viewing.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z, { createContext as Fe, useRef as W, useState as Me, useMemo as Ne, useEffect as he, useContext as Ue, useSyncExternalStore as kt, useLayoutEffect as Jt, useCallback as ve, useDebugValue as Xt } from "react";
|
|
2
2
|
import { v4 as Qt } from "uuid";
|
|
3
3
|
import { jsx as it } from "react/jsx-runtime";
|
|
4
|
-
import { W as Zt } from "./widget.ctx-
|
|
5
|
-
const en = "3.0.
|
|
4
|
+
import { W as Zt } from "./widget.ctx-W1JQt9cl.js";
|
|
5
|
+
const en = "3.0.76";
|
|
6
6
|
class tn {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
this.components = [];
|
|
@@ -1347,4 +1347,4 @@ export {
|
|
|
1347
1347
|
nr as m,
|
|
1348
1348
|
Y as u
|
|
1349
1349
|
};
|
|
1350
|
-
//# sourceMappingURL=useWidgetTrigger-
|
|
1350
|
+
//# sourceMappingURL=useWidgetTrigger-CJFrgKrO.js.map
|