drill-widgets 2.7.3 → 2.7.4
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.
|
@@ -8084,7 +8084,7 @@ function Zt(i, e = {}) {
|
|
|
8084
8084
|
const n = document.createElement(
|
|
8085
8085
|
"builder-widget"
|
|
8086
8086
|
);
|
|
8087
|
-
return e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`
|
|
8087
|
+
return e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
|
|
8088
8088
|
}
|
|
8089
8089
|
function ei(i, e) {
|
|
8090
8090
|
if (!customElements.get("runner-widget"))
|
|
@@ -8116,7 +8116,7 @@ function ei(i, e) {
|
|
|
8116
8116
|
} catch (o) {
|
|
8117
8117
|
console.error("Error executing onInstanceUpdated callback:", o);
|
|
8118
8118
|
}
|
|
8119
|
-
}), t.appendChild(n), console.log(`
|
|
8119
|
+
}), t.appendChild(n), console.log(`Drill Runner mounted on #${i}`), n;
|
|
8120
8120
|
}
|
|
8121
8121
|
function ti(i, e) {
|
|
8122
8122
|
const t = i.getFormData(), n = JSON.parse(JSON.stringify(e));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(D,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(D=typeof globalThis<"u"?globalThis:D||self,A(D.
|
|
1
|
+
(function(D,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(D=typeof globalThis<"u"?globalThis:D||self,A(D.Drill={}))})(this,function(D){"use strict";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ve,defineProperty:je,getOwnPropertyDescriptor:
|
|
9
|
+
*/const{is:Ve,defineProperty:je,getOwnPropertyDescriptor:Qe,getOwnPropertyNames:Be,getOwnPropertySymbols:qe,getPrototypeOf:Ge}=Object,M=globalThis,Se=M.trustedTypes,Ye=Se?Se.emptyScript:"",oe=M.reactiveElementPolyfillSupport,W=(i,e)=>i,Y={toAttribute(i,e){switch(e){case Boolean:i=i?Ye:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ae=(i,e)=>!Ve(i,e),we={attribute:!0,type:String,converter:Y,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);let N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=we){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&je(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){const{get:s,set:r}=Qe(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);r==null||r.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??we}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;const e=Ge(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){const t=this.properties,n=[...Be(t),...qe(t)];for(const s of n)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const s of n)t.unshift(ye(s))}else e!==void 0&&t.push(ye(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return He(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var r;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const o=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:Y).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,o;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=n.getPropertyOptions(s),d=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:Y;this._$Em=s,this[s]=d.fromAttribute(t,a.type)??((o=this._$Ej)==null?void 0:o.get(s))??null,this._$Em=null}}requestUpdate(e,t,n){var s;if(e!==void 0){const r=this.constructor,o=this[e];if(n??(n=r.getPropertyOptions(e)),!((n.hasChanged??ae)(o,t)||n.useDefault&&n.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},o){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s){const{wrapped:a}=o,d=this[r];a!==!0||this._$AL.has(r)||d===void 0||this.C(r,void 0,o,d)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(n=this._$EO)==null||n.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var s;return(s=n.hostUpdated)==null?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[W("elementProperties")]=new Map,N[W("finalized")]=new Map,oe==null||oe({ReactiveElement:N}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const H=globalThis,J=H.trustedTypes,ke=J?J.createPolicy("lit-html",{createHTML:i=>i}):void 0,$e="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,De="?"+T,Je=`<${De}>`,F=document,V=()=>F.createComment(""),j=i=>i===null||typeof i!="object"&&typeof i!="function",de=Array.isArray,Ke=i=>de(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",le=`[
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ae=/'/g,Me=/"/g,Te=/^(?:script|style|textarea|title)$/i,Xe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=Xe(1),I=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Fe=new WeakMap,U=F.createTreeWalker(F,129);function ze(i,e){if(!de(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ke!==void 0?ke.createHTML(e):e}const Ze=(i,e)=>{const t=i.length-1,n=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=
|
|
14
|
+
\f\r]`,Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ce=/-->/g,Ee=/>/g,z=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ae=/'/g,Me=/"/g,Te=/^(?:script|style|textarea|title)$/i,Xe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=Xe(1),I=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Fe=new WeakMap,U=F.createTreeWalker(F,129);function ze(i,e){if(!de(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ke!==void 0?ke.createHTML(e):e}const Ze=(i,e)=>{const t=i.length-1,n=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=Q;for(let a=0;a<t;a++){const d=i[a];let p,c,u=-1,h=0;for(;h<d.length&&(o.lastIndex=h,c=o.exec(d),c!==null);)h=o.lastIndex,o===Q?c[1]==="!--"?o=Ce:c[1]!==void 0?o=Ee:c[2]!==void 0?(Te.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=z):c[3]!==void 0&&(o=z):o===z?c[0]===">"?(o=s??Q,u=-1):c[1]===void 0?u=-2:(u=o.lastIndex-c[2].length,p=c[1],o=c[3]===void 0?z:c[3]==='"'?Me:Ae):o===Me||o===Ae?o=z:o===Ce||o===Ee?o=Q:(o=z,s=void 0);const f=o===z&&i[a+1].startsWith("/>")?" ":"";r+=o===Q?d+Je:u>=0?(n.push(p),d.slice(0,u)+$e+d.slice(u)+T+f):d+T+(u===-2?a:f)}return[ze(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class B{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0;const a=e.length-1,d=this.parts,[p,c]=Ze(e,t);if(this.el=B.createElement(p,n),U.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=U.nextNode())!==null&&d.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const u of s.getAttributeNames())if(u.endsWith($e)){const h=c[o++],f=s.getAttribute(u).split(T),b=/([.?@])?(.*)/.exec(h);d.push({type:1,index:r,name:b[2],strings:f,ctor:b[1]==="."?tt:b[1]==="?"?it:b[1]==="@"?nt:K}),s.removeAttribute(u)}else u.startsWith(T)&&(d.push({type:6,index:r}),s.removeAttribute(u));if(Te.test(s.tagName)){const u=s.textContent.split(T),h=u.length-1;if(h>0){s.textContent=J?J.emptyScript:"";for(let f=0;f<h;f++)s.append(u[f],V()),U.nextNode(),d.push({type:2,index:++r});s.append(u[h],V())}}}else if(s.nodeType===8)if(s.data===De)d.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(T,u+1))!==-1;)d.push({type:7,index:r}),u+=T.length-1}r++}}static createElement(e,t){const n=F.createElement("template");return n.innerHTML=e,n}}function O(i,e,t=i,n){var o,a;if(e===I)return e;let s=n!==void 0?(o=t._$Co)==null?void 0:o[n]:t._$Cl;const r=j(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=s:t._$Cl=s),s!==void 0&&(e=O(i,s._$AS(i,e.values),s,n)),e}class et{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,s=((e==null?void 0:e.creationScope)??F).importNode(t,!0);U.currentNode=s;let r=U.nextNode(),o=0,a=0,d=n[0];for(;d!==void 0;){if(o===d.index){let p;d.type===2?p=new q(r,r.nextSibling,this,e):d.type===1?p=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(p=new st(r,this,e)),this._$AV.push(p),d=n[++a]}o!==(d==null?void 0:d.index)&&(r=U.nextNode(),o++)}return U.currentNode=F,s}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class q{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=O(this,e,t),j(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ke(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==v&&j(this._$AH)?this._$AA.nextSibling.data=e:this.T(F.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=B.createElement(ze(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(t);else{const o=new et(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Fe.get(e.strings);return t===void 0&&Fe.set(e.strings,t=new B(e)),t}k(e){de(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,s=0;for(const r of e)s===t.length?t.push(n=new q(this.O(V()),this.O(V()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=v,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=v}_$AI(e,t=this,n,s){const r=this.strings;let o=!1;if(r===void 0)e=O(this,e,t,0),o=!j(e)||e!==this._$AH&&e!==I,o&&(this._$AH=e);else{const a=e;let d,p;for(e=r[0],d=0;d<r.length-1;d++)p=O(this,a[n+d],t,d),p===I&&(p=this._$AH[d]),o||(o=!j(p)||p!==this._$AH[d]),p===v?e=v:e!==v&&(e+=(p??"")+r[d+1]),this._$AH[d]=p}o&&!s&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class tt extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}}class it extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==v)}}class nt extends K{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=O(this,e,t,0)??v)===I)return;const n=this._$AH,s=e===v&&n!==v||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==v&&(n===v||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class st{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){O(this,e)}}const pe=H.litHtmlPolyfillSupport;pe==null||pe(B,q),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.3.0");const rt=(i,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let s=n._$litPart$;if(s===void 0){const r=(t==null?void 0:t.renderBefore)??null;n._$litPart$=s=new q(e.insertBefore(V(),r),r,void 0,t??{})}return s._$AI(i),s};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -3560,7 +3560,7 @@ Use **bold** and *italic* text.`;break}const n=this._templateData.steps.map(r=>r
|
|
|
3560
3560
|
</div>
|
|
3561
3561
|
<hr class="print-question-separator" />
|
|
3562
3562
|
|
|
3563
|
-
${r?
|
|
3563
|
+
${r?Qt(i,o):""}
|
|
3564
3564
|
${i.steps.map(d=>Tt(d)).join(`
|
|
3565
3565
|
`)}
|
|
3566
3566
|
</div>
|
|
@@ -3690,7 +3690,7 @@ Use **bold** and *italic* text.`;break}const n=this._templateData.steps.map(r=>r
|
|
|
3690
3690
|
`}}function Wt(i,e){if(!e)return'<div class="print-response-value file-response"><span class="print-no-response">No file uploaded</span></div>';const t=typeof e=="string";if(typeof e=="object"&&e.name)return`
|
|
3691
3691
|
<div class="print-response-value file-response">
|
|
3692
3692
|
📎 ${g(e.name)}
|
|
3693
|
-
${e.size?` <span class="file-size">(${
|
|
3693
|
+
${e.size?` <span class="file-size">(${Bt(e.size)})</span>`:""}
|
|
3694
3694
|
</div>
|
|
3695
3695
|
`;if(t){const s=qt(e);return`
|
|
3696
3696
|
<div class="print-response-value file-response">
|
|
@@ -3712,7 +3712,7 @@ Use **bold** and *italic* text.`;break}const n=this._templateData.steps.map(r=>r
|
|
|
3712
3712
|
<div class="signature-fallback">
|
|
3713
3713
|
<div class="signature-error">Unable to display signature</div>
|
|
3714
3714
|
</div>
|
|
3715
|
-
`}function Vt(i){return["text_input","textarea","select","number","radio","checkbox","date","file_upload","signature"].includes(i.type)}function jt(i,e){return e==null?void 0:e.find(t=>t.elementId===i)}function
|
|
3715
|
+
`}function Vt(i){return["text_input","textarea","select","number","radio","checkbox","date","file_upload","signature"].includes(i.type)}function jt(i,e){return e==null?void 0:e.find(t=>t.elementId===i)}function Qt(i,e){return`
|
|
3716
3716
|
<div class="runner-card" style="margin-bottom: 40px; border-left: 4px solid #3b82f6;">
|
|
3717
3717
|
<div style="display: flex; justify-content: between; align-items: center; gap: 20px;">
|
|
3718
3718
|
<div>
|
|
@@ -3730,7 +3730,7 @@ Use **bold** and *italic* text.`;break}const n=this._templateData.steps.map(r=>r
|
|
|
3730
3730
|
</div>
|
|
3731
3731
|
</div>
|
|
3732
3732
|
</div>
|
|
3733
|
-
`}function g(i){if(i==null)return"";const e=String(i);return{innerHTML:""}.innerHTML||e.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n])}function
|
|
3733
|
+
`}function g(i){if(i==null)return"";const e=String(i);return{innerHTML:""}.innerHTML||e.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n])}function Bt(i){if(i===0)return"0 Bytes";const e=1024,t=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(i)/Math.log(e));return parseFloat((i/Math.pow(e,n)).toFixed(2))+" "+t[n]}function qt(i){try{return new URL(i).pathname.split("/").pop()||""||"Uploaded File"}catch{const e=i.split("/"),t=e[e.length-1];return t&&t.includes(".")?t:"Uploaded File"}}function Gt(i){return i==null?"":String(i).replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`(.*)`/gim,"<code>$1</code>").replace(/\n/gim,"<br>")}function Yt(){return`
|
|
3734
3734
|
/* Print Layout Styles - Extracted from step-styles.ts */
|
|
3735
3735
|
.print-layout {
|
|
3736
3736
|
width: 100%;
|
|
@@ -4235,4 +4235,4 @@ Use **bold** and *italic* text.`;break}const n=this._templateData.steps.map(r=>r
|
|
|
4235
4235
|
margin: 2px 0;
|
|
4236
4236
|
line-height: 1.4;
|
|
4237
4237
|
}
|
|
4238
|
-
`}function Jt(i,e={}){if(!customElements.get("builder-widget"))return console.error("Error: <builder-widget> is not defined. Make sure it was imported."),null;const t=document.getElementById(i);if(!t)return console.error(`Error: Target element with ID '${i}' not found.`),null;t.innerHTML="";const n=document.createElement("builder-widget");return e.onWorkflowCreated&&(n.onWorkflowCreated=e.onWorkflowCreated),e.onWorkflowDeleted&&(n.onWorkflowDeleted=e.onWorkflowDeleted),e.onWorkflowUpdated&&(n.onWorkflowUpdated=e.onWorkflowUpdated),t.appendChild(n),console.log(`
|
|
4238
|
+
`}function Jt(i,e={}){if(!customElements.get("builder-widget"))return console.error("Error: <builder-widget> is not defined. Make sure it was imported."),null;const t=document.getElementById(i);if(!t)return console.error(`Error: Target element with ID '${i}' not found.`),null;t.innerHTML="";const n=document.createElement("builder-widget");return e.onWorkflowCreated&&(n.onWorkflowCreated=e.onWorkflowCreated),e.onWorkflowDeleted&&(n.onWorkflowDeleted=e.onWorkflowDeleted),e.onWorkflowUpdated&&(n.onWorkflowUpdated=e.onWorkflowUpdated),t.appendChild(n),console.log(`Drill Builder mounted on #${i}`),n}function Kt(i,e){if(!customElements.get("runner-widget"))return console.error("Error: <runner-widget> is not defined. Make sure it was imported."),null;const t=document.getElementById(i);if(!t)return console.error(`Error: Target element with ID '${i}' not found.`),null;if(e.mode==="preview"){if(!e||!e.workflow)return console.error("Error: Workflow data must be provided for preview mode."),t.innerHTML='<p style="color: red;">Error: Workflow data required for preview mode.</p>',null;if(!e.workflow.steps||e.workflow.steps.length===0)return console.error("Error: Workflow provided to runner has no steps defined."),t.innerHTML='<p style="color: red;">Error: Workflow has no steps.</p>',null}else{if(!e||!e.instance)return console.error("Error: Instance data must be provided in runner config."),t.innerHTML='<p style="color: red;">Error: Instance data required.</p>',null;if(!e.instance.steps||e.instance.steps.length===0)return console.error("Error: Instance provided to runner has no steps defined."),t.innerHTML='<p style="color: red;">Error: Instance has no steps.</p>',null}t.innerHTML="";const n=document.createElement("runner-widget");return e.mode==="preview"?(n.workflow=e.workflow,n.mode="preview"):(n.instance=e.instance,n.mode=e.mode||"default"),e.mode&&(n.mode=e.mode),e.isLoading!==void 0&&(n.isLoading=e.isLoading),e.onSignatureCaptured&&(n.onSignatureCaptured=e.onSignatureCaptured),e.onFileUploaded&&(n.onFileUploaded=e.onFileUploaded),e.currentUser&&(n.currentUser=e.currentUser),e.onInstanceUpdated&&n.addEventListener("instance-updated",s=>{const r=s;try{e.onInstanceUpdated(r.detail)}catch(o){console.error("Error executing onInstanceUpdated callback:",o)}}),t.appendChild(n),console.log(`Drill Runner mounted on #${i}`),n}function Xt(i,e){const t=i.getFormData(),n=JSON.parse(JSON.stringify(e));return n.steps&&n.steps.forEach(s=>{s.responses||(s.responses=[]),s.elements.forEach(r=>{if(r.type==="text_input"||r.type==="textarea"||r.type==="select"||r.type==="number"||r.type==="radio"||r.type==="checkbox"||r.type==="date"||r.type==="file_upload"||r.type==="signature"){const o=t[r.id];if(o!==void 0){let a=s.responses.find(d=>d.elementId===r.id);a?(a.value=o,a.answeredAt=new Date):(a={elementId:r.id,value:o,answeredAt:new Date},s.responses.push(a))}}})}),n}function Zt(i,e){const t={};e.steps&&e.steps.forEach(n=>{n.responses&&n.responses.forEach(s=>{t[s.elementId]=s.value})}),i.restoreFormData(),console.log("Form data restored to runner widget:",t)}D.createBuilder=Jt,D.createRunner=Kt,D.generateInstanceHTML=Mt,D.restoreFormDataToRunner=Zt,D.updateInstanceFromRunnerForm=Xt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
package/dist/lib.d.ts
CHANGED
|
@@ -75,14 +75,14 @@ export declare interface ContentElement extends BaseElement {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Creates and mounts the
|
|
78
|
+
* Creates and mounts the Drill Workflow Builder widget.
|
|
79
79
|
* @param targetElementId The ID of the DOM element to mount the widget into.
|
|
80
80
|
* @param config Configuration options including callbacks.
|
|
81
81
|
*/
|
|
82
82
|
export declare function createBuilder(targetElementId: string, config?: BuilderConfig): BuilderWidget | null;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Creates and mounts the
|
|
85
|
+
* Creates and mounts the Drill Workflow Runner widget.
|
|
86
86
|
* @param targetElementId The ID of the DOM element to mount the widget into.
|
|
87
87
|
* @param config Configuration options including instance and callbacks.
|
|
88
88
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drill-widgets",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"description": "Easily embed powerful workflow building and running capabilities into your web applications with Lit-based web components. Includes HTML export for server-side PDF generation.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "tsc && vite build && node scripts/build-html.js",
|
|
8
8
|
"preview": "vite preview",
|
|
9
|
-
"test": "
|
|
9
|
+
"test": "vitest",
|
|
10
|
+
"test:coverage": "vitest run --coverage"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
12
13
|
"workflow",
|
|
@@ -44,8 +45,10 @@
|
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/uuid": "^10.0.0",
|
|
48
|
+
"@vitest/coverage-v8": "^4.0.1",
|
|
47
49
|
"typescript": "^5.8.3",
|
|
48
|
-
"vite": "^6.3.0"
|
|
50
|
+
"vite": "^6.3.0",
|
|
51
|
+
"vitest": "^4.0.1"
|
|
49
52
|
},
|
|
50
53
|
"repository": {
|
|
51
54
|
"type": "git",
|