@archilogic/extension-sdk 0.15.0 → 0.17.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @archilogic/extension-sdk
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 50b72f9: feat(extension-sdk): add a settings-change event carrying the host display units
8
+
9
+ ## 0.16.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ba96fbe: feat(extension-sdk): add the createActionRunner run-lifecycle helper
14
+ - ba96fbe: feat(extension-sdk): accept an undo label on runOperations
15
+
3
16
  ## 0.15.0
4
17
 
5
18
  ### Minor Changes
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>{if(!e||typeof e!=`object`)return!1;let{code:t,message:n}=e;return t===`METHOD_NOT_FOUND`||typeof n==`string`&&n.includes(`is not found`)},t=t=>{let{hostApi:n}=t,r=t.onError??(e=>console.warn(`[extension-sdk] action start failed:`,e)),i=null,a=!1,o=0,s=null,c=()=>{i?.update(t.controls()).catch(()=>{})},l=async l=>{if(a)return{status:`legacy-host`};let u=++o;s=u;let d=i;i=null,d?.stop().catch(()=>{});try{let e=await n.startActionRun({name:l,controls:t.controls(),onControl:e=>t.onControl?.(e),onEnd:e=>{u===o&&(i=null,t.onEnd?.(e))}});return u===o?e.status===`started`?(i=e.run,c(),{status:`started`}):{status:`unavailable`,reason:e.reason}:(e.status===`started`&&e.run.stop().catch(()=>{}),{status:`superseded`})}catch(t){return u===o?e(t)?(a=!0,{status:`legacy-host`}):(r(t),{status:`error`,error:t}):{status:`superseded`}}finally{s===u&&(s=null)}};return{start:l,ensure:e=>{a||i||s!==null||l(e)},stop:()=>{o++,s=null;let e=i;i=null,e?.stop().catch(()=>{})},sync:c,commit:async e=>{let t=i;if(t){let n=await t.commit(e);if(n.status!==`ended`)return{via:`action`,result:n}}return{via:`operations`,result:await n.runOperations({operations:e.operations,label:e.label})}},get running(){return i!==null},get legacyHost(){return a}}};exports.createActionRunner=t;