@ddd-tool/domain-designer-ui-component 0.0.0-alpha.16 → 0.0.0-alpha.17
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/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -247,7 +247,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
247
247
|
|
|
248
248
|
`,pu="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let hu=(t=21)=>{let e="",o=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=pu[o[t]&63];return e};function bu(t,e=!0,o=!1){const n=Ie();let i;const r=Ie(!1);let a=()=>{};const d=new Proxy(t,{apply:function(v,C,E){let k=v(...E);if(k instanceof Error){if(n.value=k,i=k,e)throw a(),k}else r.value=!0,n.value=void 0,i=!0,a()}}),A=()=>{},g=new Proxy(v=>{n.value=v},{apply:function(v,C,E){v(...E),A(...E)}});return{promise:new Promise((v,C)=>{if(e&&i instanceof Error){C(i);return}else if(i===!0){v();return}let E;o&&(E=setTimeout(()=>{const k=new Error("timeout!");n.value=k,e&&C(k)},o)),a=()=>{E&&(clearTimeout(E),E=void 0),v()}}),callback:d,onError:g,resolved:Ue(()=>r.value),error:Ue(()=>n.value)}}function mu(){return hu()}function or(t){let e=Vs("0");const o={},n=Ks([]);function i(d){const A=vu(e.value);o[A]={data:Qn(d)},e.value=A}const r=d=>rt(e,A=>{d({data:o[A].data,version:A})}),a={latestVersion:Ue(()=>e),watchPublish:r};return{watchHandles:n,publish:async d=>{i(d)},api:a}}function vu(t){if(+t<Number.MAX_SAFE_INTEGER)return(parseInt(t)+1).toString();let e=t.split("").reverse().join(""),o="1";const n=Math.max(e.length,o.length);let i=0,r=[];for(let a=0;a<n;a++){const d=a<e.length?parseInt(e[a],10):0,A=a<o.length?parseInt(o[a],10):0,g=d+A+i;r.push(g%10),i=Math.floor(g/10)}return i>0&&r.push(i),r.reverse().join("")}function Iu(t){const e=Cu(t);return In({states:e.states,commands:e.commands,events:e.events})}function Cu(t){const e=t.states;for(const a of Object.keys(t.states))e[a]=Qn(e[a]);const o=In(t.states),n=Qn(t.commands),i={},r=t.events;for(const a in t.events)i[a]=r[a].api;return In({states:o,commands:n,events:In(i),destroy:t.destroy})}function va(t){const{callback:e,onError:o,promise:n,resolved:i}=bu(()=>{},!1,5e3);function r(C){if(i.value===!0)throw new Error("Agg already initialized");a.push(C())}const a=[],d=t({onCreated(C){Promise.resolve().then(C)},onBeforeInitialize:r,isInitialized:Ue(()=>i.value),untilInitialized:n});setTimeout(()=>Promise.all(a).then(()=>{e()}).catch(C=>{o(C)}));const A=d.states||{},g=d.commands||{},v=d.events||{};return{_code:mu(),type:"Singleton",api:Iu({states:A,commands:g,events:v,destroy:()=>{}}),isInitialized:i,async untilInitialized(){return await n.catch(C=>{throw new Error(`Failed to initialize Agg: ${C.message}
|
|
249
249
|
Stack : ${C.stack||"unkown"}`)})}}}function*yu(t,e,o){const n=t._getContext();for(const i in n.getAggs()){const r=n.getAggs()[i];yield`[<aggregation id=${r._attributes.__id}> ${r._attributes.name}: Aggregation ${_o(r._attributes.infos)} ${Ft(r._attributes.description)}]`}for(const i in n.getCommands()){const r=n.getCommands()[i];yield`[<command id=${r._attributes.__id}> ${r._attributes.name}: Command ${_o(r._attributes.infos)} ${Ft(r._attributes.description)}]`}for(const i in n.getFacadeCommands()){const r=n.getFacadeCommands()[i];yield`[<facadeCommand id=${r._attributes.__id}> ${r._attributes.name}: FacadeCommand ${_o(r._attributes.infos)} ${Ft(r._attributes.description)}]`}for(const i in n.getEvents()){const r=n.getEvents()[i];yield`[<event id=${r._attributes.__id}> ${r._attributes.name}: Event ${_o(r._attributes.infos)} ${Ft(r._attributes.description)}]`}for(const i in n.getServices()){const r=n.getServices()[i];yield`[<service id=${r._attributes.__id}> ${r._attributes.name}: Service ${Ft(r._attributes.description)}]`}for(const i in n.getActors()){const r=n.getActors()[i];yield`[<actor id=${r._attributes.__id}> ${r._attributes.name}: Actor ${Ft(r._attributes.description)}]`}for(const i in n.getPolicies()){const r=n.getPolicies()[i];yield`[<policy id=${r._attributes.__id}> ${r._attributes.name}: Policy ${Ft(r._attributes.description)}]`}if(e)for(const i in n.getReadModels()){const r=n.getReadModels()[i];yield`[<readModel id=${r._attributes.__id}> ${r._attributes.name}: ReadModel ${_o(r._attributes.infos)} ${Ft(r._attributes.description)}]`}if(o)for(const i in n.getSystems()){const r=n.getSystems()[i];yield`[<system id=${r._attributes.__id}> ${r._attributes.name}: System ${Ft(r._attributes.description)}]`}for(const i in n.getLinks()){const r=n.getLinks()[i],[a,d,A,g]=i.split(",");!e&&(a==="ReadModel"||A==="ReadModel")||!o&&(a==="System"||A==="System")||(r==="Association"?yield`[${d}] -> [${g}]`:r==="Aggregation"?yield`[${d}] o- [${g}]`:r==="Dependency"&&(yield`[${g}] <-- [${d}]`))}}function _o(t){if(!t)return"";function e(n){return n?"*":"-"}const o=[""];for(const n in t){const i=t[n],r=i._attributes.type,a=e(i._attributes.description);r==="Document"?o.push(`|${a} ${i._attributes.name}: Document`):r==="Function"?o.push(`|${a} ${i._attributes.name}: Function`):r==="Id"?o.push(`|${a} ${i._attributes.name}: Id`):r==="ValueObject"?o.push(`|${a} ${i._attributes.name}: Value`):r==="Version"?o.push(`|${a} ${i._attributes.name}: Version`):isNever(r)}return o.join(`
|
|
250
|
-
`)}function Ft(t){if(!t)return"";const e=t._attributes.template,o=t._attributes.inject;return"|"+e.reduce((i,r,a)=>{const d=o[a]?o[a].toFormat():"";return i+r+d},"")}let nr;const Vt="__Empty__";function Bu(t){return va(()=>{const e=Ie(t),o=Ie(Object.keys(t).length?Object.keys(t)[0]:void 0),n=Ue(()=>{if(o.value)return e.value[o.value]}),i=Ue(()=>o.value?Object.keys(e.value):[]),r=Ie(!0),a=Ie(!0),d=Ue(()=>{if(console.debug("generate code"),!n.value)return"";const M=[],H=yu(n.value,r.value,a.value);let Ae=H.next();for(;!Ae.done;)M.push(Ae.value),Ae=H.next();return M.join(`
|
|
250
|
+
`)}function Ft(t){if(!t)return"";const e=t._attributes.template,o=t._attributes.inject;return"|"+e.reduce((i,r,a)=>{const d=o[a]?o[a].toFormat():"";return i+r+d},"")}let nr;const Vt="__Empty__";function Bu(t){return va(()=>{const e=Ie(t),o=Ie(Object.keys(t).length?Object.keys(t)[0]:void 0),n=Ue(()=>{if(o.value)return e.value[o.value]}),i=Ue(()=>o.value?Object.keys(e.value):[]),r=Ie(!0),a=Ie(!0),d=Ue(()=>{if(console.debug("generate nomnoml code"),!n.value)return"";const M=[],H=yu(n.value,r.value,a.value);let Ae=H.next();for(;!Ae.done;)M.push(Ae.value),Ae=H.next();return M.join(`
|
|
251
251
|
`)}),A=Ie(Vt),g=Ie(),v=Ue(()=>n.value?n.value._getContext().getWorkflows():{}),C=Ue(()=>{if(!n.value)return{[Vt]:[]};const M={},H=Object.keys(v.value).map(Ae=>Ae);for(const Ae in n.value._getContext().getUserStories()){const me=n.value._getContext().getUserStories()[Ae];for(const oe of me)H.includes(oe)&&H.splice(H.indexOf(oe),1);M[Ae]=me}return M[Vt]=H,M}),E=or();function k(M,H="Others"){g.value=M,A.value=H,E.publish({userStory:H,workflow:M,displayReadModel:r.value,displaySystem:a.value})}const D=Ie(300),_=Ie(),K=or(),j=Ie(!0),X=or();return{states:{design:n,designKeys:i,code:d,userStories:C,workflows:v,workflowPlayInterval:D,currentWorkflow:g,currentStory:A,currentDesignKey:o,currentNode:_,downloadEnabled:j,displayReadModel:r,displaySystem:a},commands:{focusFlow:k,downloadSvg(){X.publish({})},setDownloadEnabled(M){j.value=M},setWorkflowPlayInterval(M){M>=0&&(D.value=M)},setDisplayReadModel(M){r.value=M},setDisplaySystem(M){a.value=M},setCurrentNode(M){_.value=M,K.publish({id:M})},switchDesign(M){o.value=M},getIdMap(){return n.value?n.value._getContext().getIdMap():{}}},events:{onFocusNode:K,onFocusFlow:E,onDownloadSvg:X}}})}function Ia(t){if(!nr){if(!t)throw new Error("need data");nr=Bu(t)}return nr.api}const Eu=Object.freeze(["Command","FacadeCommand","Event","Agg","ReadModel"]);function Qu(t){return typeof t.inner=="object"&&t._attributes&&Eu.includes(t._attributes.rule)}function Ca(t){return t._attributes&&typeof t._attributes.__id=="string"&&typeof t._attributes.rule=="string"}function ya(t){return t&&t._attributes&&t._attributes.rule==="Info"}function wu(t){return t&&t._attributes&&t._attributes.rule==="Agg"}function ku(t){return t&&t._attributes&&t._attributes.rule==="Command"}function Su(t){return t&&t._attributes&&t._attributes.rule==="FacadeCommand"}function xu(t){return t&&t._attributes&&t._attributes.rule==="Event"}function Du(t){return t&&t._attributes&&t._attributes.rule==="ReadModel"}const fr=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Lu=()=>{},Ru=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),_n=Object.assign,Dt=Array.isArray,mo=t=>typeof t=="function",qt=t=>typeof t=="string",Nu=t=>typeof t=="symbol",fo=t=>t!==null&&typeof t=="object";let Mi;const $n=()=>Mi||(Mi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pr(t){if(Dt(t)){const e={};for(let o=0;o<t.length;o++){const n=t[o],i=qt(n)?_u(n):Pr(n);if(i)for(const r in i)e[r]=i[r]}return e}else if(qt(t)||fo(t))return t}const Fu=/;(?![^(]*\))/g,Ou=/:([^]+)/,Mu=/\/\*[^]*?\*\//g;function _u(t){const e={};return t.replace(Mu,"").split(Fu).forEach(o=>{if(o){const n=o.split(Ou);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Yr(t){let e="";if(qt(t))e=t;else if(Dt(t))for(let o=0;o<t.length;o++){const n=Yr(t[o]);n&&(e+=n+" ")}else if(fo(t))for(const o in t)t[o]&&(e+=o+" ");return e.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(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Nu));function Ba(t){return pr(t)?Ba(t.__v_raw):!!(t&&t.__v_isReactive)}function pr(t){return!!(t&&t.__v_isReadonly)}function rr(t){return!!(t&&t.__v_isShallow)}function hr(t){return t?!!t.__v_raw:!1}function po(t){const e=t&&t.__v_raw;return e?po(e):t}function Hr(t){return t?t.__v_isRef===!0:!1}const ho=[];function $u(t){ho.push(t)}function Gu(){ho.pop()}let ir=!1;function tn(t,...e){if(ir)return;ir=!0;const o=ho.length?ho[ho.length-1].component:null,n=o&&o.appContext.config.warnHandler,i=Tu();if(n)Jr(n,o,11,[t+e.map(r=>{var a,d;return(d=(a=r.toString)==null?void 0:a.call(r))!=null?d:JSON.stringify(r)}).join(""),o&&o.proxy,i.map(({vnode:r})=>`at <${_a(o,r.type)}>`).join(`
|
|
252
252
|
`),i]);else{const r=[`[Vue warn]: ${t}`,...e];i.length&&r.push(`
|
|
253
253
|
`,...Pu(i))}ir=!1}function Tu(){let t=ho[ho.length-1];if(!t)return[];const e=[];for(;t;){const o=e[0];o&&o.vnode===t?o.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}function Pu(t){const e=[];return t.forEach((o,n)=>{e.push(...n===0?[]:[`
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-tool/domain-designer-ui-component",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@ddd-tool/domain-designer-core": "0.0.0-alpha.
|
|
7
|
+
"@ddd-tool/domain-designer-core": "0.0.0-alpha.21",
|
|
8
8
|
"@primevue/themes": "^4.2.5",
|
|
9
9
|
"nomnoml": "^1.7.0",
|
|
10
10
|
"primeicons": "^7.0.0",
|