@corti/embedded-web 0.1.0-alpha.1
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/LICENSE +21 -0
- package/README.md +273 -0
- package/dist/CortiEmbedded.d.ts +102 -0
- package/dist/CortiEmbedded.js +452 -0
- package/dist/CortiEmbedded.js.map +1 -0
- package/dist/bundle.js +96 -0
- package/dist/corti-embedded.d.ts +1 -0
- package/dist/corti-embedded.js +5 -0
- package/dist/corti-embedded.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/internal-types.d.ts +231 -0
- package/dist/internal-types.js +2 -0
- package/dist/internal-types.js.map +1 -0
- package/dist/public-types.d.ts +238 -0
- package/dist/public-types.js +2 -0
- package/dist/public-types.js.map +1 -0
- package/dist/react/CortiEmbeddedReact.d.ts +25 -0
- package/dist/react/CortiEmbeddedReact.js +28 -0
- package/dist/react/CortiEmbeddedReact.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -0
- package/dist/styles/base.d.ts +4 -0
- package/dist/styles/base.js +10 -0
- package/dist/styles/base.js.map +1 -0
- package/dist/styles/container-styles.d.ts +1 -0
- package/dist/styles/container-styles.js +35 -0
- package/dist/styles/container-styles.js.map +1 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/styles/theme.js +101 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/PostMessageHandler.d.ts +119 -0
- package/dist/utils/PostMessageHandler.js +353 -0
- package/dist/utils/PostMessageHandler.js.map +1 -0
- package/dist/utils/baseUrl.d.ts +1 -0
- package/dist/utils/baseUrl.js +25 -0
- package/dist/utils/baseUrl.js.map +1 -0
- package/dist/utils/embedUrl.d.ts +2 -0
- package/dist/utils/embedUrl.js +23 -0
- package/dist/utils/embedUrl.js.map +1 -0
- package/dist/utils/errorFormatter.d.ts +10 -0
- package/dist/utils/errorFormatter.js +163 -0
- package/dist/utils/errorFormatter.js.map +1 -0
- package/dist/web-bundle.js +89 -0
- package/dist/web-index.d.ts +3 -0
- package/dist/web-index.js +3 -0
- package/dist/web-index.js.map +1 -0
- package/package.json +129 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var T=globalThis,I=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),ct=new WeakMap,R=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(I&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=ct.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ct.set(e,t))}return t}toString(){return this.cssText}},dt=r=>new R(typeof r=="string"?r:r+"",void 0,V),C=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1]),r[0]);return new R(e,r,V)},ht=(r,t)=>{if(I)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},J=I?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return dt(e)})(r):r;var{is:xt,defineProperty:Ut,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ot,getOwnPropertySymbols:Ht,getPrototypeOf:Lt}=Object,k=globalThis,lt=k.trustedTypes,Dt=lt?lt.emptyScript:"",Tt=k.reactiveElementPolyfillSupport,M=(r,t)=>r,x={toAttribute(r,t){switch(t){case Boolean:r=r?Dt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},N=(r,t)=>!xt(r,t),pt={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:N};Symbol.metadata??=Symbol("metadata"),k.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=pt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Pt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:i,set(n){let c=i?.call(this);o?.call(this,n),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??pt}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;let t=Lt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){let e=this.properties,s=[...Ot(e),...Ht(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(J(i))}else t!==void 0&&e.push(J(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ht(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:x).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:x;this._$Em=i;let c=n.fromAttribute(e,o.type);this[i]=c??this._$Ej?.get(i)??c,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??N)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s){let{wrapped:n}=o,c=this[i];n!==!0||this._$AL.has(i)||c===void 0||this.C(i,void 0,o,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[M("elementProperties")]=new Map,m[M("finalized")]=new Map,Tt?.({ReactiveElement:m}),(k.reactiveElementVersions??=[]).push("2.1.1");var tt=globalThis,q=tt.trustedTypes,ut=q?q.createPolicy("lit-html",{createHTML:r=>r}):void 0,$t="$lit$",y=`lit$${Math.random().toFixed(9).slice(2)}$`,_t="?"+y,It=`<${_t}>`,w=document,P=()=>w.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",et=Array.isArray,kt=r=>et(r)||typeof r?.[Symbol.iterator]=="function",K=`[
|
|
2
|
+
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ft=/-->/g,mt=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),gt=/'/g,yt=/"/g,vt=/^(?:script|style|textarea|title)$/i,st=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),rt=st(1),Gt=st(2),Zt=st(3),b=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),Et=new WeakMap,v=w.createTreeWalker(w,129);function wt(r,t){if(!et(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return ut!==void 0?ut.createHTML(t):t}var Nt=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=U;for(let c=0;c<e;c++){let a=r[c],h,l,d=-1,f=0;for(;f<a.length&&(n.lastIndex=f,l=n.exec(a),l!==null);)f=n.lastIndex,n===U?l[1]==="!--"?n=ft:l[1]!==void 0?n=mt:l[2]!==void 0?(vt.test(l[2])&&(i=RegExp("</"+l[2],"g")),n=_):l[3]!==void 0&&(n=_):n===_?l[0]===">"?(n=i??U,d=-1):l[1]===void 0?d=-2:(d=n.lastIndex-l[2].length,h=l[1],n=l[3]===void 0?_:l[3]==='"'?yt:gt):n===yt||n===gt?n=_:n===ft||n===mt?n=U:(n=_,i=void 0);let g=n===_&&r[c+1].startsWith("/>")?" ":"";o+=n===U?a+It:d>=0?(s.push(h),a.slice(0,d)+$t+a.slice(d)+y+g):a+y+(d===-2?c:g)}return[wt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},H=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,c=t.length-1,a=this.parts,[h,l]=Nt(t,e);if(this.el=r.createElement(h,s),v.currentNode=this.el.content,e===2||e===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=v.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(let d of i.getAttributeNames())if(d.endsWith($t)){let f=l[n++],g=i.getAttribute(d).split(y),D=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:D[2],strings:g,ctor:D[1]==="."?Z:D[1]==="?"?Q:D[1]==="@"?X:S}),i.removeAttribute(d)}else d.startsWith(y)&&(a.push({type:6,index:o}),i.removeAttribute(d));if(vt.test(i.tagName)){let d=i.textContent.split(y),f=d.length-1;if(f>0){i.textContent=q?q.emptyScript:"";for(let g=0;g<f;g++)i.append(d[g],P()),v.nextNode(),a.push({type:2,index:++o});i.append(d[f],P())}}}else if(i.nodeType===8)if(i.data===_t)a.push({type:2,index:o});else{let d=-1;for(;(d=i.data.indexOf(y,d+1))!==-1;)a.push({type:7,index:o}),d+=y.length-1}o++}}static createElement(t,e){let s=w.createElement("template");return s.innerHTML=t,s}};function A(r,t,e=r,s){if(t===b)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,o=O(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=A(r,i._$AS(r,t.values),i,s)),t}var G=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??w).importNode(e,!0);v.currentNode=i;let o=v.nextNode(),n=0,c=0,a=s[0];for(;a!==void 0;){if(n===a.index){let h;a.type===2?h=new L(o,o.nextSibling,this,t):a.type===1?h=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(h=new Y(o,this,t)),this._$AV.push(h),a=s[++c]}n!==a?.index&&(o=v.nextNode(),n++)}return v.currentNode=w,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=A(this,t,e),O(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):kt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(wt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let o=new G(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Et.get(t.strings);return e===void 0&&Et.set(t.strings,e=new H(t)),e}k(t){et(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.O(P()),this.O(P()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},S=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=A(this,t,e,0),n=!O(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else{let c=t,a,h;for(t=o[0],a=0;a<o.length-1;a++)h=A(this,c[s+a],e,a),h===b&&(h=this._$AH[a]),n||=!O(h)||h!==this._$AH[a],h===p?t=p:t!==p&&(t+=(h??"")+o[a+1]),this._$AH[a]=h}n&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Z=class extends S{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},Q=class extends S{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},X=class extends S{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=A(this,t,e,0)??p)===b)return;let s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Y=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){A(this,t)}};var qt=tt.litHtmlPolyfillSupport;qt?.(H,L),(tt.litHtmlVersions??=[]).push("3.3.1");var bt=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new L(t.insertBefore(P(),o),o,void 0,e??{})}return i._$AI(r),i};var it=globalThis,E=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=bt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};E._$litElement$=!0,E.finalized=!0,it.litElementHydrateSupport?.({LitElement:E});var Bt=it.litElementPolyfillSupport;Bt?.({LitElement:E});(it.litElementVersions??=[]).push("4.2.1");var zt={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:N},jt=(r=zt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(c){let a=t.get.call(this);t.set.call(this,c),this.requestUpdate(n,a,r)},init(c){return c!==void 0&&this.C(n,void 0,r,c),c}}}if(s==="setter"){let{name:n}=e;return function(c){let a=this[n];t.call(this,c),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function B(r){return(t,e)=>typeof e=="object"?jt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var At=C`
|
|
4
|
+
* {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
`;var St=C`
|
|
8
|
+
:host {
|
|
9
|
+
/* Make the component fill its container completely */
|
|
10
|
+
display: block;
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Handle visibility state */
|
|
26
|
+
:host([visibility='hidden']) {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Ensure iframe fills the entire component */
|
|
31
|
+
iframe {
|
|
32
|
+
width: 100% !important;
|
|
33
|
+
height: 100% !important;
|
|
34
|
+
border: none !important;
|
|
35
|
+
margin: 0 !important;
|
|
36
|
+
padding: 0 !important;
|
|
37
|
+
}
|
|
38
|
+
`;function j(r){let t;try{t=new URL(r)}catch{throw new Error("Invalid baseURL: not a parseable URL")}if(t.protocol!=="https:")throw new Error("Invalid baseURL: must use https");let e=t.host.toLowerCase();if(!/^assistant\.[a-z0-9-]+\.corti\.app$/i.test(e))throw new Error("Invalid baseURL: host must match assistant.xxx.corti.app");if(t.pathname&&t.pathname!=="/"&&t.pathname!=="")throw new Error("Invalid baseURL: must not include a path");if(t.username||t.password)throw new Error("Invalid baseURL: must not include credentials");return t.origin.replace(/\/+$/,"")}function ot(r){return`${r}/embedded`}function Rt(r,t){if(!r||r.startsWith("about:"))return!1;try{let e=new URL(r,window.location.href),s=new URL(t);return e.origin!==s.origin?!1:e.pathname.replace(/\/+$/,"")==="/embedded"}catch{return!1}}function Ft(r){try{return JSON.parse(r)}catch{return null}}function F(r){let t=r.match(/\b([1-5]\d{2})\b/);return t?t[1]:void 0}function nt(r){return typeof r=="object"&&r!==null&&("expected"in r||"code"in r||"path"in r||"message"in r)}function at(r){let{path:t,expected:e,message:s,code:i}=r;if(s)return s;let o=t&&t.length>0?t.join("."):"field";return e?`Invalid ${o}: expected ${e}`:i?`Validation error in ${o} (${i})`:`Validation error in ${o}`}function Ct(r){return r.length===0?"Unknown validation error":r.length===1?at(r[0]):`Multiple validation errors: ${r.map(at).join("; ")}`}function u(r,t="An error occurred"){if(!r)return{message:t,details:r};if(r instanceof Error){let e=F(r.message);return{message:r.message||t,code:e,details:r}}if(typeof r=="string"){let e=F(r);return{message:r,code:e,details:r}}if(Array.isArray(r)){if(r.every(nt)){let e=r;return{message:Ct(e),code:e[0]?.code,details:r}}return{message:`Multiple errors: ${r.length} item(s)`,details:r}}if(typeof r=="object"){let e=r;if(e.message&&typeof e.message=="string"){let s=e.message,{code:i}=e;if(i||(i=F(s)),e.details?.message&&typeof e.details.message=="string"){let o=Ft(e.details.message);Array.isArray(o)&&o.every(nt)&&(s=Ct(o))}return{message:s,code:i,details:e.details}}if(nt(e))return{message:at(e),code:e.code,details:r};if(e.error||e.message||e.detail){let s=e.error||e.message||e.detail,i=typeof s=="string"?s:t,o=e.code||e.status;return!o&&typeof s=="string"&&(o=F(s)),{message:i,code:o,details:r}}}return{message:t,details:r}}var W=class r{constructor(t,e={}){this.pendingRequests=new Map,this.messageListener=null,this.isReady=!1,this.iframe=t,this.callbacks=e,this.setupMessageListener()}setupMessageListener(){this.messageListener=t=>{if(t.source!==this.iframe.contentWindow)return;let e=this.getTrustedOrigin();if(!e||t.origin!==e)return;let{data:s}=t;if(s?.type==="CORTI_EMBEDDED_EVENT"){this.handleEvent(s);return}s.requestId&&this.pendingRequests.has(s.requestId)&&this.handleResponse(s)},window.addEventListener("message",this.messageListener)}handleEvent(t){let e=t.event,{payload:s}=t;switch((e==="ready"||e==="loaded")&&(this.isReady=!0),e){case"ready":case"loaded":this.callbacks.onReady?.();break;case"authChanged":this.callbacks.onAuthChanged?.(s);break;case"interactionCreated":this.callbacks.onInteractionCreated?.(s);break;case"recordingStarted":this.callbacks.onRecordingStarted?.();break;case"recordingStopped":this.callbacks.onRecordingStopped?.();break;case"documentGenerated":this.callbacks.onDocumentGenerated?.(s);break;case"documentUpdated":this.callbacks.onDocumentUpdated?.(s);break;case"navigationChanged":this.callbacks.onNavigationChanged?.(s);break;case"usage":this.callbacks.onUsage?.(s);break;default:console.warn(`Unhandled event type: ${e}`);break}}handleResponse(t){let e=this.pendingRequests.get(t.requestId);if(e){let{resolve:s,reject:i}=e;if(this.pendingRequests.delete(t.requestId),t.success===!1||t.error){let o={message:t.error||"Request failed",code:t.errorCode,details:t.errorDetails};this.callbacks.onError?.(o),i(o)}else s(t)}}destroy(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null),this.pendingRequests.clear()}updateCallbacks(t){this.callbacks={...this.callbacks,...t}}get ready(){return this.isReady}async waitForReady(t=3e4){return this.isReady?Promise.resolve():new Promise((e,s)=>{let i=setTimeout(()=>{s(new Error("Timeout waiting for iframe to be ready"))},t),o=n=>{n.source===this.iframe.contentWindow&&n.origin===this.getTrustedOrigin()&&n.data?.type==="CORTI_EMBEDDED_EVENT"&&n.data.event==="ready"&&(clearTimeout(i),window.removeEventListener("message",o),e())};window.addEventListener("message",o)})}async postMessage(t,e=1e4){if(!this.iframe.contentWindow)throw new Error("Iframe not ready");await this.waitForReady();let{contentWindow:s}=this.iframe,i=r.generateRequestId();return new Promise((o,n)=>{let c=setTimeout(()=>{this.pendingRequests.delete(i),n(new Error("Request timeout"))},e),a={resolve:d=>{clearTimeout(c),o(d)},reject:d=>{clearTimeout(c),n(d)}};this.pendingRequests.set(i,a);let h={...t,requestId:i},l=this.getTrustedOrigin();if(!l){this.pendingRequests.delete(i),n(new Error("Cannot determine trusted origin for postMessage"));return}s.postMessage(h,l)})}async auth(t){let e=await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"auth",payload:t});if(this.isReady=!1,e.payload&&typeof e.success)return e.payload.user;throw new Error(e.error)}async configureSession(t){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"configureSession",payload:t})}async navigate(t){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"navigate",payload:t})}async addFacts(t){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"addFacts",payload:t})}async createInteraction(t){let e=await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"createInteraction",payload:t});if(e.payload&&typeof e.success)return e.payload;throw new Error(e.error)}async startRecording(){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"startRecording",payload:{}})}async stopRecording(){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"stopRecording",payload:{}})}async getStatus(){let t=await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"getStatus",payload:{}});if(t.payload&&typeof t.success)return t.payload;throw new Error(t.error)}async configure(t){let e=await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"configure",payload:t});if(e.payload&&typeof e.success)return e.payload;throw new Error(e.error)}async setCredentials(t){await this.postMessage({type:"CORTI_EMBEDDED",version:"v1",action:"setCredentials",payload:t})}static generateRequestId(){return`req_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}getTrustedOrigin(){try{let t=this.iframe.getAttribute("src")||this.iframe.src;return t?new URL(t,window.location.href).origin:null}catch{return null}}};var Mt=function(r,t,e,s){var i=arguments.length,o=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,s);else for(var c=r.length-1;c>=0;c--)(n=r[c])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},$=class extends E{constructor(){super(...arguments),this.visibility="hidden",this.postMessageHandler=null,this.normalizedBaseURL=null}connectedCallback(){if(super.connectedCallback(),!this.baseURL){this.dispatchErrorEvent({message:"baseURL is required"});return}try{this.normalizedBaseURL=j(this.baseURL)}catch(t){throw this.dispatchErrorEvent({message:t.message||"Invalid baseURL"}),t}}disconnectedCallback(){super.disconnectedCallback(),this.postMessageHandler&&(this.postMessageHandler.destroy(),this.postMessageHandler=null)}async setupPostMessageHandler(){if(this.postMessageHandler)return;let t=this.getIframe();if(t?.contentWindow){let e={onReady:()=>{this.dispatchPublicEvent("ready",void 0)},onAuthChanged:s=>{this.dispatchPublicEvent("auth-changed",{user:s.user})},onInteractionCreated:s=>{this.dispatchPublicEvent("interaction-created",{interaction:s.interaction})},onRecordingStarted:()=>{this.dispatchPublicEvent("recording-started",void 0)},onRecordingStopped:()=>{this.dispatchPublicEvent("recording-stopped",void 0)},onDocumentGenerated:s=>{this.dispatchPublicEvent("document-generated",{document:s.document})},onDocumentUpdated:s=>{this.dispatchPublicEvent("document-updated",{document:s.document})},onNavigationChanged:s=>{this.dispatchPublicEvent("navigation-changed",{path:s.path})},onUsage:s=>{this.dispatchPublicEvent("usage",{creditsConsumed:s.creditsConsumed})},onError:s=>{this.dispatchErrorEvent(s)}};this.postMessageHandler=new W(t,e)}else this.dispatchErrorEvent({message:"No iframe or contentWindow available"})}dispatchPublicEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}dispatchErrorEvent(t){this.dispatchPublicEvent("error",t)}isRealIframeLoad(t){let e=t.getAttribute("src")||"";return this.normalizedBaseURL?Rt(e,this.normalizedBaseURL):!1}async handleIframeLoad(t){let e=t.target;if(e&&this.isRealIframeLoad(e))try{await this.setupPostMessageHandler()}catch(s){this.dispatchErrorEvent({message:`Failed to setup PostMessageHandler on iframe load: ${s}`})}}getIframe(){return this.shadowRoot?.querySelector("iframe")||null}updated(t){if(super.updated(t),t.has("baseURL")){try{this.normalizedBaseURL=j(this.baseURL)}catch(s){this.postMessageHandler&&(this.postMessageHandler.destroy(),this.postMessageHandler=null);let i=this.getIframe();i&&i.setAttribute("src","about:blank"),this.dispatchErrorEvent({message:s.message||"Invalid baseURL"});return}this.postMessageHandler&&(this.postMessageHandler.destroy(),this.postMessageHandler=null);let e=this.getIframe();if(e){let s=this.normalizedBaseURL?ot(this.normalizedBaseURL):"";e.getAttribute("src")!==s&&(e.setAttribute("src",s),e.setAttribute("allow",`microphone ${s}; camera ${s}; device-capture ${s}; display-capture ${s}`))}}}async auth(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{let e={access_token:t.access_token,token_type:t.token_type,expires_at:t.expires_at,expires_in:t.expires_in,refresh_expires_in:t.refresh_expires_in,refresh_token:t.refresh_token,id_token:t.id_token,"not-before-policy":t["not-before-policy"],session_state:t.session_state,scope:t.scope,profile:t.profile,mode:t.mode};return await this.postMessageHandler.auth(e)}catch(e){let s=u(e,"Authentication failed");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async createInteraction(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{let e=await this.postMessageHandler.createInteraction(t);return{id:e.id,createdAt:e.createdAt}}catch(e){let s=u(e,"Failed to create interaction");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async configureSession(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{let e={defaultLanguage:t.defaultLanguage,defaultOutputLanguage:t.defaultOutputLanguage,defaultTemplateKey:t.defaultTemplateKey,defaultMode:t.defaultMode};await this.postMessageHandler.configureSession(e)}catch(e){let s=u(e,"Failed to configure session");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async addFacts(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{let e={facts:t};await this.postMessageHandler.addFacts(e)}catch(e){let s=u(e,"Failed to add facts");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async navigate(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{let e={path:t};await this.postMessageHandler.navigate(e)}catch(e){let s=u(e,"Failed to navigate");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async startRecording(){if(!this.postMessageHandler)throw new Error("Component not ready");try{await this.postMessageHandler.startRecording()}catch(t){let e=u(t,"Failed to start recording");throw this.dispatchErrorEvent(e),new Error(JSON.stringify(e))}}async stopRecording(){if(!this.postMessageHandler)throw new Error("Component not ready");try{await this.postMessageHandler.stopRecording()}catch(t){let e=u(t,"Failed to stop recording");throw this.dispatchErrorEvent(e),new Error(JSON.stringify(e))}}async getStatus(){if(!this.postMessageHandler)return{ready:!1,auth:{authenticated:!1,user:void 0},currentUrl:void 0,interaction:void 0};try{return await this.postMessageHandler.getStatus()}catch(t){let e=u(t,"Failed to get status");throw this.dispatchErrorEvent(e),new Error(JSON.stringify(e))}}async configure(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{return await this.postMessageHandler.configure(t)}catch(e){let s=u(e,"Failed to configure component");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}async setCredentials(t){if(!this.postMessageHandler)throw new Error("Component not ready");try{if(!t.password)throw new Error("Password is required");await this.postMessageHandler.setCredentials(t)}catch(e){let s=u(e,"Failed to set credentials");throw this.dispatchErrorEvent(s),new Error(JSON.stringify(s))}}show(){this.visibility="visible"}hide(){this.visibility="hidden"}getDebugStatus(){let t=this.getIframe();return{ready:t?.contentDocument?.readyState==="complete",iframeExists:!!t,iframeSrc:t?.src,iframeContentWindow:!!t?.contentWindow,iframeContentDocument:!!t?.contentDocument,iframeReadyState:t?.contentDocument?.readyState,postMessageHandlerExists:!!this.postMessageHandler,postMessageHandlerReady:this.postMessageHandler?.ready||!1,baseURL:this.baseURL}}render(){return this.baseURL?rt`
|
|
39
|
+
<iframe
|
|
40
|
+
src=${ot(j(this.baseURL))}
|
|
41
|
+
title="Corti Embedded UI"
|
|
42
|
+
sandbox=${"allow-forms allow-modals allow-scripts allow-same-origin"}
|
|
43
|
+
allow="microphone *; camera *; device-capture *; display-capture *"
|
|
44
|
+
@load=${t=>this.handleIframeLoad(t)}
|
|
45
|
+
@unload=${()=>this.postMessageHandler?.destroy()}
|
|
46
|
+
style=${this.visibility==="hidden"?"display: none;":"display: block;"}
|
|
47
|
+
></iframe>
|
|
48
|
+
`:rt`<div>baseURL is required</div>`}};$.styles=[At,St];Mt([B({type:String,reflect:!0})],$.prototype,"visibility",void 0);Mt([B({type:String,reflect:!0})],$.prototype,"baseURL",void 0);customElements.get("corti-embedded")||customElements.define("corti-embedded",$);export{$ as CortiEmbedded};
|
|
49
|
+
/*! Bundled license information:
|
|
50
|
+
|
|
51
|
+
@lit/reactive-element/css-tag.js:
|
|
52
|
+
(**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2019 Google LLC
|
|
55
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
|
+
*)
|
|
57
|
+
|
|
58
|
+
@lit/reactive-element/reactive-element.js:
|
|
59
|
+
lit-html/lit-html.js:
|
|
60
|
+
lit-element/lit-element.js:
|
|
61
|
+
@lit/reactive-element/decorators/custom-element.js:
|
|
62
|
+
@lit/reactive-element/decorators/property.js:
|
|
63
|
+
@lit/reactive-element/decorators/state.js:
|
|
64
|
+
@lit/reactive-element/decorators/event-options.js:
|
|
65
|
+
@lit/reactive-element/decorators/base.js:
|
|
66
|
+
@lit/reactive-element/decorators/query.js:
|
|
67
|
+
@lit/reactive-element/decorators/query-all.js:
|
|
68
|
+
@lit/reactive-element/decorators/query-async.js:
|
|
69
|
+
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
70
|
+
(**
|
|
71
|
+
* @license
|
|
72
|
+
* Copyright 2017 Google LLC
|
|
73
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
+
*)
|
|
75
|
+
|
|
76
|
+
lit-html/is-server.js:
|
|
77
|
+
(**
|
|
78
|
+
* @license
|
|
79
|
+
* Copyright 2022 Google LLC
|
|
80
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
+
*)
|
|
82
|
+
|
|
83
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
84
|
+
(**
|
|
85
|
+
* @license
|
|
86
|
+
* Copyright 2021 Google LLC
|
|
87
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
+
*)
|
|
89
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import './corti-embedded.js';
|
|
2
|
+
export { CortiEmbedded } from './CortiEmbedded.js';
|
|
3
|
+
export type { AuthCredentials, ComponentStatus, ConfigureAppPayload, ConfigureAppResponsePayload, CortiEmbeddedAPI, EmbeddedEventData, Fact, InteractionDetails, SessionConfig, User, } from './public-types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-index.js","sourceRoot":"","sources":["../src/web-index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["import './corti-embedded.js';\n\nexport { CortiEmbedded } from './CortiEmbedded.js';\n\n// Export clean public types only\nexport type {\n AuthCredentials,\n ComponentStatus,\n ConfigureAppPayload,\n ConfigureAppResponsePayload,\n CortiEmbeddedAPI,\n EmbeddedEventData,\n Fact,\n InteractionDetails,\n SessionConfig,\n User,\n} from './public-types.js';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corti/embedded-web",
|
|
3
|
+
"description": "Web component for Corti Embedded",
|
|
4
|
+
"author": "Corti ApS",
|
|
5
|
+
"version": "0.1.0-alpha.1",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://help.corti.app",
|
|
9
|
+
"email": "help@corti.ai"
|
|
10
|
+
},
|
|
11
|
+
"repository": "github:corticph/embedded-web",
|
|
12
|
+
"homepage": "https://help.corti.app/",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"corti",
|
|
15
|
+
"embedded",
|
|
16
|
+
"web",
|
|
17
|
+
"sdk",
|
|
18
|
+
"react",
|
|
19
|
+
"react-component"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "dist/web-bundle.js",
|
|
23
|
+
"module": "dist/web-bundle.js",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/web-bundle.d.ts",
|
|
27
|
+
"import": "./dist/web-bundle.js",
|
|
28
|
+
"browser": "./dist/web-bundle.js",
|
|
29
|
+
"default": "./dist/web-bundle.js"
|
|
30
|
+
},
|
|
31
|
+
"./react": {
|
|
32
|
+
"types": "./dist/react/index.d.ts",
|
|
33
|
+
"import": "./dist/bundle.js",
|
|
34
|
+
"default": "./dist/bundle.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"jsdelivr": "./dist/web-bundle.js",
|
|
38
|
+
"browser": "./dist/web-bundle.js",
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"analyze": "cem analyze --litelement",
|
|
44
|
+
"build": "tsc && npm run analyze -- --exclude dist",
|
|
45
|
+
"build:bundle": "esbuild dist/index.js --bundle --outfile=dist/bundle.js --format=esm --platform=browser --external:react --define:process.env.NODE_ENV='\"production\"' --minify",
|
|
46
|
+
"build:web-bundle": "esbuild dist/web-index.js --bundle --outfile=dist/web-bundle.js --format=esm --platform=browser --define:process.env.NODE_ENV='\"production\"' --minify",
|
|
47
|
+
"build:demo": "esbuild demo/react-demo.tsx --bundle --outfile=demo/react-demo-bundle.js --format=esm --platform=browser --jsx=automatic --loader:.tsx=tsx",
|
|
48
|
+
"release": "npm run build && npm run build:bundle && npm run build:web-bundle && npm publish --access public --tag alpha",
|
|
49
|
+
"start": "npm run build && npm run build:demo && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"esbuild demo/react-demo.tsx --bundle --outfile=demo/react-demo-bundle.js --format=esm --platform=browser --jsx=automatic --loader:.tsx=tsx --watch\" \"web-dev-server\"",
|
|
50
|
+
"start:simple": "npm run build && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"web-dev-server\"",
|
|
51
|
+
"prepublish": "tsc && npm run analyze -- --exclude dist",
|
|
52
|
+
"lint": "eslint --ext .ts,.tsx src --ignore-path .gitignore && prettier \"src/**/*.{ts,tsx}\" --check --ignore-path .gitignore",
|
|
53
|
+
"format": "eslint --ext .ts,.tsx src --fix --ignore-path .gitignore && prettier \"src/**/*.{ts,tsx}\" --write --ignore-path .gitignore",
|
|
54
|
+
"test": "tsc -p tsconfig.test.json && wtr --coverage",
|
|
55
|
+
"test:watch": "concurrently -k -r \"tsc -p tsconfig.test.json --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@corti/sdk": "^0.5.0",
|
|
59
|
+
"@lit/react": "^1.0.8",
|
|
60
|
+
"lit": "^3.1.4"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
64
|
+
"@open-wc/eslint-config": "^12.0.3",
|
|
65
|
+
"@open-wc/testing": "^4.0.0",
|
|
66
|
+
"@types/mocha": "^10.0.7",
|
|
67
|
+
"@types/react": "^19.2.7",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
69
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
70
|
+
"@web/dev-server": "^0.4.6",
|
|
71
|
+
"@web/dev-server-esbuild": "^1.0.4",
|
|
72
|
+
"@web/test-runner": "^0.18.2",
|
|
73
|
+
"@web/test-runner-playwright": "^0.11.1",
|
|
74
|
+
"concurrently": "^8.2.2",
|
|
75
|
+
"esbuild": "0.27.0",
|
|
76
|
+
"eslint": "^8.57.0",
|
|
77
|
+
"eslint-config-prettier": "^9.1.0",
|
|
78
|
+
"prettier": "^3.3.2",
|
|
79
|
+
"react": "^19.2.1",
|
|
80
|
+
"react-dom": "^19.2.3",
|
|
81
|
+
"tslib": "^2.6.3",
|
|
82
|
+
"typescript": "^5.5.3"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
86
|
+
},
|
|
87
|
+
"customElements": "custom-elements.json",
|
|
88
|
+
"eslintConfig": {
|
|
89
|
+
"parser": "@typescript-eslint/parser",
|
|
90
|
+
"extends": [
|
|
91
|
+
"@open-wc",
|
|
92
|
+
"prettier"
|
|
93
|
+
],
|
|
94
|
+
"plugins": [
|
|
95
|
+
"@typescript-eslint"
|
|
96
|
+
],
|
|
97
|
+
"rules": {
|
|
98
|
+
"no-unused-vars": "off",
|
|
99
|
+
"@typescript-eslint/no-unused-vars": [
|
|
100
|
+
"error"
|
|
101
|
+
],
|
|
102
|
+
"import/no-unresolved": "off",
|
|
103
|
+
"import/extensions": [
|
|
104
|
+
"error",
|
|
105
|
+
"always",
|
|
106
|
+
{
|
|
107
|
+
"ignorePackages": true
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"import/no-extraneous-dependencies": [
|
|
111
|
+
"error",
|
|
112
|
+
{
|
|
113
|
+
"devDependencies": [
|
|
114
|
+
"**/*.config.js",
|
|
115
|
+
"**/*.config.ts",
|
|
116
|
+
"**/test/**",
|
|
117
|
+
"**/demo/**",
|
|
118
|
+
"**/*.test.js",
|
|
119
|
+
"**/*.test.ts"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"prettier": {
|
|
126
|
+
"singleQuote": true,
|
|
127
|
+
"arrowParens": "avoid"
|
|
128
|
+
}
|
|
129
|
+
}
|