@ddd-tool/domain-designer-ui-component 0.1.0-beta.0 → 0.1.0-beta.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.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
243
243
  #font: Times New Roman //consolas,Monaco
244
244
  #fontSize: 14
245
245
 
246
- `,J0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let W0=(e=21)=>{let t="",o=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=J0[o[e]&63];return t};function q0(e,t=!0,o=!1){const n=ye();let i;const r=ye(!1);let l=()=>{};const A=new Proxy(e,{apply:function(v,m,E){let k=v(...E);if(k instanceof Error){if(n.value=k,i=k,t)throw l(),k}else r.value=!0,n.value=void 0,i=!0,l()}}),c=()=>{},g=new Proxy(v=>{n.value=v},{apply:function(v,m,E){v(...E),c(...E)}});return{promise:new Promise((v,m)=>{if(t&&i instanceof Error){m(i);return}else if(i===!0){v();return}let E;o&&(E=setTimeout(()=>{const k=new Error("timeout!");n.value=k,t&&m(k)},o)),l=()=>{E&&(clearTimeout(E),E=void 0),v()}}),callback:A,onError:g,resolved:Ve(()=>r.value),error:Ve(()=>n.value)}}function Z0(){return W0()}function Xn(e){let t=Vs("0");const o={},n=Us([]);function i(A){const c=X0(t.value);o[c]={data:In(A)},t.value=c}const r=A=>at(t,c=>{A({data:o[c].data,version:c})}),l={latestVersion:Ve(()=>t),watchPublish:r};return{watchHandles:n,publish:async A=>{i(A)},api:l}}function X0(e){if(+e<Number.MAX_SAFE_INTEGER)return(parseInt(e)+1).toString();let t=e.split("").reverse().join(""),o="1";const n=Math.max(t.length,o.length);let i=0,r=[];for(let l=0;l<n;l++){const A=l<t.length?parseInt(t[l],10):0,c=l<o.length?parseInt(o[l],10):0,g=A+c+i;r.push(g%10),i=Math.floor(g/10)}return i>0&&r.push(i),r.reverse().join("")}function em(e){const t=tm(e);return hn({states:t.states,commands:t.commands,events:t.events})}function tm(e){const t=e.states;for(const l of Object.keys(e.states))t[l]=In(t[l]);const o=hn(e.states),n=In(e.commands),i={},r=e.events;for(const l in e.events)i[l]=r[l].api;return hn({states:o,commands:n,events:hn(i),destroy:e.destroy})}function va(e){const{callback:t,onError:o,promise:n,resolved:i}=q0(()=>{},!1,5e3);function r(m){if(i.value===!0)throw new Error("Agg already initialized");l.push(m())}const l=[],A=e({onCreated(m){Promise.resolve().then(m)},onBeforeInitialize:r,isInitialized:Ve(()=>i.value),untilInitialized:n});setTimeout(()=>Promise.all(l).then(()=>{t()}).catch(m=>{o(m)}));const c=A.states||{},g=A.commands||{},v=A.events||{};return{_code:Z0(),type:"Singleton",api:em({states:c,commands:g,events:v,destroy:()=>{}}),isInitialized:i,async untilInitialized(){return await n.catch(m=>{throw new Error(`Failed to initialize Agg: ${m.message}
246
+ `,J0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let W0=(e=21)=>{let t="",o=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=J0[o[e]&63];return t};function q0(e,t=!0,o=!1){const n=ye();let i;const r=ye(!1);let l=()=>{};const A=new Proxy(e,{apply:function(v,m,E){let k;try{k=v(...E)}catch(x){k=x}if(k instanceof Error){if(n.value=k,i=k,t)throw l(),k}else r.value=!0,n.value=void 0,i=!0,l()}}),c=()=>{},g=new Proxy(v=>{n.value=v},{apply:function(v,m,E){v(...E),c(...E)}});return{promise:new Promise((v,m)=>{if(t&&i instanceof Error){m(i);return}else if(i===!0){v();return}let E;o&&(E=setTimeout(()=>{const k=new Error("timeout!");n.value=k,t&&m(k)},o)),l=()=>{E&&(clearTimeout(E),E=void 0),v()}}),callback:A,onError:g,resolved:Ve(()=>r.value),error:Ve(()=>n.value)}}function Z0(){return W0()}function Xn(e){let t=Vs("0");const o={},n=Us([]);function i(A){const c=X0(t.value);o[c]={data:In(A)},t.value=c}const r=A=>at(t,c=>{A({data:o[c].data,version:c})}),l={latestVersion:Ve(()=>t),watchPublish:r};return{watchHandles:n,publish:async A=>{i(A)},api:l}}function X0(e){if(+e<Number.MAX_SAFE_INTEGER)return(parseInt(e)+1).toString();let t=e.split("").reverse().join(""),o="1";const n=Math.max(t.length,o.length);let i=0,r=[];for(let l=0;l<n;l++){const A=l<t.length?parseInt(t[l],10):0,c=l<o.length?parseInt(o[l],10):0,g=A+c+i;r.push(g%10),i=Math.floor(g/10)}return i>0&&r.push(i),r.reverse().join("")}function em(e){const t=tm(e);return hn({states:t.states,commands:t.commands,events:t.events})}function tm(e){const t=e.states;for(const l of Object.keys(e.states))t[l]=In(t[l]);const o=hn(e.states),n=In(e.commands),i={},r=e.events;for(const l in e.events)i[l]=r[l].api;return hn({states:o,commands:n,events:hn(i),destroy:e.destroy})}function va(e){const{callback:t,onError:o,promise:n,resolved:i}=q0(()=>{},!1,5e3);function r(m){if(i.value===!0)throw new Error("Agg already initialized");l.push(m())}const l=[],A=e({onCreated(m){Promise.resolve().then(m)},onBeforeInitialize:r,isInitialized:Ve(()=>i.value),untilInitialized:n});setTimeout(()=>Promise.all(l).then(()=>{t()}).catch(m=>{o(m)}));const c=A.states||{},g=A.commands||{},v=A.events||{};return{__id:Z0(),type:"Singleton",api:em({states:c,commands:g,events:v,destroy:()=>{}}),isInitialized:i,async untilInitialized(){return await n.catch(m=>{throw new Error(`Failed to initialize Agg: ${m.message}
247
247
  Stack : ${m.stack||"unkown"}`)})}}}function*om(e,t,o){const n=e._getContext();for(const i in n.getAggs()){const r=n.getAggs()[i];yield`[<aggregation id=${r._attributes.__id}> ${r._attributes.name}: Aggregation ${Oo(r._attributes.infos)} ${Rt(r._attributes.note)}]`}for(const i in n.getCommands()){const r=n.getCommands()[i];yield`[<command id=${r._attributes.__id}> ${r._attributes.name}: Command ${Oo(r._attributes.infos)} ${Rt(r._attributes.note)}]`}for(const i in n.getFacadeCommands()){const r=n.getFacadeCommands()[i];yield`[<facadeCommand id=${r._attributes.__id}> ${r._attributes.name}: FacadeCommand ${Oo(r._attributes.infos)} ${Rt(r._attributes.note)}]`}for(const i in n.getEvents()){const r=n.getEvents()[i];yield`[<event id=${r._attributes.__id}> ${r._attributes.name}: Event ${Oo(r._attributes.infos)} ${Rt(r._attributes.note)}]`}for(const i in n.getServices()){const r=n.getServices()[i];yield`[<service id=${r._attributes.__id}> ${r._attributes.name}: Service ${Rt(r._attributes.note)}]`}for(const i in n.getActors()){const r=n.getActors()[i];yield`[<actor id=${r._attributes.__id}> ${r._attributes.name}: Actor ${Rt(r._attributes.note)}]`}for(const i in n.getPolicies()){const r=n.getPolicies()[i];yield`[<policy id=${r._attributes.__id}> ${r._attributes.name}: Policy ${Rt(r._attributes.note)}]`}if(t)for(const i in n.getReadModels()){const r=n.getReadModels()[i];yield`[<readModel id=${r._attributes.__id}> ${r._attributes.name}: ReadModel ${Oo(r._attributes.infos)} ${Rt(r._attributes.note)}]`}if(o)for(const i in n.getSystems()){const r=n.getSystems()[i];yield`[<system id=${r._attributes.__id}> ${r._attributes.name}: System ${Rt(r._attributes.note)}]`}for(const i in n.getLinks()){const r=n.getLinks()[i],[l,A,c,g]=i.split(",");!t&&(l==="ReadModel"||c==="ReadModel")||!o&&(l==="System"||c==="System")||(r==="Association"?yield`[${A}] -> [${g}]`:r==="Aggregation"?yield`[${A}] o- [${g}]`:r==="Dependency"&&(yield`[${g}] <-- [${A}]`))}}function Oo(e){if(!e)return"";function t(n){return n?"*":"-"}const o=[""];for(const n in e){const i=e[n],r=i._attributes.type,l=t(i._attributes.note);r==="Document"?o.push(`|${l} ${i._attributes.name}: Document`):r==="Function"?o.push(`|${l} ${i._attributes.name}: Function`):r==="Id"?o.push(`|${l} ${i._attributes.name}: Id`):r==="ValueObject"?o.push(`|${l} ${i._attributes.name}: Value`):r==="Version"?o.push(`|${l} ${i._attributes.name}: Version`):isNever(r)}return o.join(`
248
248
  `)}function Rt(e){if(!e)return"";const t=e._attributes.template,o=e._attributes.inject;return"|"+t.reduce((i,r,l)=>{const A=o[l]?o[l].toFormat():"";return i+r+A},"")}let er;const Vt="__Empty__";function nm(e){return va(()=>{const t=ye(e),o=ye(Object.keys(e).length?Object.keys(e)[0]:void 0),n=Ve(()=>{if(o.value)return t.value[o.value]}),i=Ve(()=>o.value?Object.keys(t.value):[]),r=ye(!0),l=ye(!0),A=Ve(()=>{if(!n.value)return"";const q=[],N=om(n.value,r.value,l.value);let ne=N.next();for(;!ne.done;)q.push(ne.value),ne=N.next();return q.join(`
249
249
  `)}),c=ye(Vt),g=ye(),v=Ve(()=>n.value?n.value._getContext().getWorkflows():{}),m=Ve(()=>{if(!n.value)return{[Vt]:[]};const q={},N=Object.keys(v.value).map(ne=>ne);for(const ne in n.value._getContext().getUserStories()){const be=n.value._getContext().getUserStories()[ne];for(const ee of be)N.includes(ee)&&N.splice(N.indexOf(ee),1);q[ne]=be}return q[Vt]=N,q}),E=Xn();function k(q,N="Others"){g.value=q,c.value=N,E.publish({userStory:N,workflow:q,displayReadModel:r.value,displaySystem:l.value})}const x=ye(300),M=ye(),V=Xn(),H=ye(!0),te=Xn();return{states:{design:n,designKeys:i,code:A,userStories:m,workflows:v,workflowPlayInterval:x,currentWorkflow:g,currentStory:c,currentDesignKey:o,currentNode:M,downloadEnabled:H,displayReadModel:r,displaySystem:l},commands:{focusFlow:k,downloadSvg(){te.publish({})},setDownloadEnabled(q){H.value=q},setWorkflowPlayInterval(q){q>=0&&(x.value=q)},setDisplayReadModel(q){r.value=q},setDisplaySystem(q){l.value=q},setCurrentNode(q){M.value=q,V.publish({id:q})},switchDesign(q){o.value=q},getIdMap(){return n.value?n.value._getContext().getIdMap():{}}},events:{onFocusNode:V,onFocusFlow:E,onDownloadSvg:te}}})}function ya(e){if(!er){if(!e)throw new Error("need data");er=nm(e)}return er.api}const rm=Object.freeze(["Command","FacadeCommand","Event","Agg","ReadModel"]);function im(e){return typeof e.inner=="object"&&e._attributes&&rm.includes(e._attributes.rule)}function Ia(e){return e._attributes&&typeof e._attributes.__id=="string"&&typeof e._attributes.rule=="string"}function Ca(e){return e&&e._attributes&&e._attributes.rule==="Info"}const Ar=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const am=()=>{},sm=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Rn=Object.assign,xt=Array.isArray,mo=e=>typeof e=="function",qt=e=>typeof e=="string",lm=e=>typeof e=="symbol",fo=e=>e!==null&&typeof e=="object";let Fi;const Fn=()=>Fi||(Fi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Tr(e){if(xt(e)){const t={};for(let o=0;o<e.length;o++){const n=e[o],i=qt(n)?Am(n):Tr(n);if(i)for(const r in i)t[r]=i[r]}return t}else if(qt(e)||fo(e))return e}const dm=/;(?![^(]*\))/g,cm=/:([^]+)/,um=/\/\*[^]*?\*\//g;function Am(e){const t={};return e.replace(um,"").split(dm).forEach(o=>{if(o){const n=o.split(cm);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Gr(e){let t="";if(qt(e))t=e;else if(xt(e))for(let o=0;o<e.length;o++){const n=Gr(e[o]);n&&(t+=n+" ")}else if(fo(e))for(const o in e)e[o]&&(t+=o+" ");return t.trim()}Symbol(process.env.NODE_ENV!=="production"?"Object iterate":"");Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":"");Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(lm));function Ba(e){return gr(e)?Ba(e.__v_raw):!!(e&&e.__v_isReactive)}function gr(e){return!!(e&&e.__v_isReadonly)}function tr(e){return!!(e&&e.__v_isShallow)}function fr(e){return e?!!e.__v_raw:!1}function po(e){const t=e&&e.__v_raw;return t?po(t):e}function Pr(e){return e?e.__v_isRef===!0:!1}const ho=[];function gm(e){ho.push(e)}function fm(){ho.pop()}let or=!1;function Xo(e,...t){if(or)return;or=!0;const o=ho.length?ho[ho.length-1].component:null,n=o&&o.appContext.config.warnHandler,i=pm();if(n)Yr(n,o,11,[e+t.map(r=>{var l,A;return(A=(l=r.toString)==null?void 0:l.call(r))!=null?A:JSON.stringify(r)}).join(""),o&&o.proxy,i.map(({vnode:r})=>`at <${_a(o,r.type)}>`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-tool/domain-designer-ui-component",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.0-beta.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  "nomnoml": "^1.7.0",
10
10
  "primeicons": "^7.0.0",
11
11
  "primevue": "^4.3.1",
12
- "vue-fn": "0.0.3-alpha.37"
12
+ "vue-fn": "0.1.0-beta.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/jsdom": "^21.1.7",