@ddd-tool/domain-designer-ui-component 0.1.0-beta.5 → 0.1.0-beta.6

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.
@@ -0,0 +1 @@
1
+ export declare const EMPTY_STORY = "__Empty__";
@@ -1,2 +1,25 @@
1
- import type { DomainDesigner } from '@ddd-tool/domain-designer-core';
2
- export declare function nomnomlCodeGenerator<T extends DomainDesigner>(design: T, displayReadModel: boolean, displaySystem: boolean): Generator<string, void, unknown>;
1
+ import type { DomainDesignAgg, DomainDesigner } from '@ddd-tool/domain-designer-core';
2
+ export declare function nomnomlCodeGenerator<T extends DomainDesigner>(params: {
3
+ design: T;
4
+ currentStory: string;
5
+ displayReadModel: boolean;
6
+ displaySystem: boolean;
7
+ }): Generator<string, void, unknown>;
8
+ export declare function filterContext(params: {
9
+ design: DomainDesigner;
10
+ currentStory: string;
11
+ displayReadModel: boolean;
12
+ displaySystem: boolean;
13
+ }): {
14
+ aggs: DomainDesignAgg<any>[];
15
+ commands: import("@ddd-tool/domain-designer-core").DomainDesignCommand<any>[];
16
+ facadeCommands: import("@ddd-tool/domain-designer-core").DomainDesignFacadeCommand<any>[];
17
+ events: import("@ddd-tool/domain-designer-core").DomainDesignEvent<any>[];
18
+ services: import("@ddd-tool/domain-designer-core").DomainDesignService[];
19
+ actors: import("@ddd-tool/domain-designer-core").DomainDesignActor[];
20
+ policies: import("@ddd-tool/domain-designer-core").DomainDesignPolicy[];
21
+ readModels: import("@ddd-tool/domain-designer-core").DomainDesignReadModel<any>[];
22
+ systems: import("@ddd-tool/domain-designer-core").DomainDesignSystem[];
23
+ links: Record<string, import("@ddd-tool/domain-designer-core/common").LinkType>;
24
+ getIdMap: () => Record<string, import("@ddd-tool/domain-designer-core").DomainDesignObject>;
25
+ };
@@ -1,9 +1,9 @@
1
1
  import type { DomainDesigner } from '@ddd-tool/domain-designer-core';
2
+ export { EMPTY_STORY } from './define';
2
3
  interface FocusFlowFn {
3
4
  (workflow: undefined, userStory?: string): void;
4
5
  (workflow: string, userStory: string): void;
5
6
  }
6
- export declare const EMPTY_STORY = "__Empty__";
7
7
  export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Readonly<{
8
8
  states: Readonly<{
9
9
  design: Readonly<import("vue").Ref<{
@@ -191,6 +191,19 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
191
191
  commands: Readonly<{
192
192
  focusFlow: FocusFlowFn;
193
193
  downloadSvg: () => void;
194
+ filterContext: () => {
195
+ aggs: import("@ddd-tool/domain-designer-core").DomainDesignAgg<any>[];
196
+ commands: import("@ddd-tool/domain-designer-core").DomainDesignCommand<any>[];
197
+ facadeCommands: import("@ddd-tool/domain-designer-core").DomainDesignFacadeCommand<any>[];
198
+ events: import("@ddd-tool/domain-designer-core").DomainDesignEvent<any>[];
199
+ services: import("@ddd-tool/domain-designer-core").DomainDesignService[];
200
+ actors: import("@ddd-tool/domain-designer-core").DomainDesignActor[];
201
+ policies: import("@ddd-tool/domain-designer-core").DomainDesignPolicy[];
202
+ readModels: import("@ddd-tool/domain-designer-core").DomainDesignReadModel<any>[];
203
+ systems: import("@ddd-tool/domain-designer-core").DomainDesignSystem[];
204
+ links: Record<string, import("@ddd-tool/domain-designer-core/common").LinkType>;
205
+ getIdMap: () => Record<string, import("@ddd-tool/domain-designer-core").DomainDesignObject>;
206
+ };
194
207
  setDownloadEnabled: (b: boolean) => void;
195
208
  setWorkflowPlayInterval: (i: number) => void;
196
209
  setDisplayReadModel: (b: boolean) => void;
@@ -230,4 +243,3 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
230
243
  };
231
244
  }>;
232
245
  }>;
233
- export {};
package/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- .nomnoml[data-v-83e775ca] {
2
+ .nomnoml[data-v-ddc71b2c] {
3
3
  height: 100%;
4
4
  overflow: auto;
5
5
  }
package/index.js CHANGED
@@ -7117,7 +7117,7 @@ let __tla = (async () => {
7117
7117
  if (value.getTime && filter.getTime) return value.getTime() <= filter.getTime();
7118
7118
  else return value <= filter;
7119
7119
  },
7120
- gt: function gt2(value, filter) {
7120
+ gt: function gt(value, filter) {
7121
7121
  if (filter === void 0 || filter === null) {
7122
7122
  return true;
7123
7123
  }
@@ -13545,55 +13545,57 @@ Stack : ${c2.stack || "unkown"}`);
13545
13545
  }
13546
13546
  };
13547
13547
  }
13548
- function* nomnomlCodeGenerator(design, displayReadModel, displaySystem) {
13549
- const context = design._getContext();
13550
- for (const i2 in context.getAggs()) {
13551
- const agg2 = context.getAggs()[i2];
13548
+ const EMPTY_STORY = "__Empty__";
13549
+ function* nomnomlCodeGenerator(params) {
13550
+ const design = params.design;
13551
+ const currentStory = params.currentStory;
13552
+ const context = filterContext({
13553
+ design,
13554
+ currentStory
13555
+ });
13556
+ for (const i2 in context.aggs) {
13557
+ const agg2 = context.aggs[i2];
13552
13558
  yield `[<aggregation id=${agg2._attributes.__id}> ${agg2._attributes.name}: Aggregation ${infosToCode(agg2._attributes.infos)} ${noteToCode$1(agg2._attributes.note)}]`;
13553
13559
  }
13554
- for (const i2 in context.getCommands()) {
13555
- const command = context.getCommands()[i2];
13560
+ for (const i2 in context.commands) {
13561
+ const command = context.commands[i2];
13556
13562
  yield `[<command id=${command._attributes.__id}> ${command._attributes.name}: Command ${infosToCode(command._attributes.infos)} ${noteToCode$1(command._attributes.note)}]`;
13557
13563
  }
13558
- for (const i2 in context.getFacadeCommands()) {
13559
- const facadeCommand = context.getFacadeCommands()[i2];
13564
+ for (const i2 in context.facadeCommands) {
13565
+ const facadeCommand = context.facadeCommands[i2];
13560
13566
  yield `[<facadeCommand id=${facadeCommand._attributes.__id}> ${facadeCommand._attributes.name}: FacadeCommand ${infosToCode(facadeCommand._attributes.infos)} ${noteToCode$1(facadeCommand._attributes.note)}]`;
13561
13567
  }
13562
- for (const i2 in context.getEvents()) {
13563
- const event = context.getEvents()[i2];
13568
+ for (const i2 in context.events) {
13569
+ const event = context.events[i2];
13564
13570
  yield `[<event id=${event._attributes.__id}> ${event._attributes.name}: Event ${infosToCode(event._attributes.infos)} ${noteToCode$1(event._attributes.note)}]`;
13565
13571
  }
13566
- for (const i2 in context.getServices()) {
13567
- const service = context.getServices()[i2];
13572
+ for (const i2 in context.services) {
13573
+ const service = context.services[i2];
13568
13574
  yield `[<service id=${service._attributes.__id}> ${service._attributes.name}: Service ${noteToCode$1(service._attributes.note)}]`;
13569
13575
  }
13570
- for (const i2 in context.getActors()) {
13571
- const actor = context.getActors()[i2];
13576
+ for (const i2 in context.actors) {
13577
+ const actor = context.actors[i2];
13572
13578
  yield `[<actor id=${actor._attributes.__id}> ${actor._attributes.name}: Actor ${noteToCode$1(actor._attributes.note)}]`;
13573
13579
  }
13574
- for (const i2 in context.getPolicies()) {
13575
- const policy = context.getPolicies()[i2];
13580
+ for (const i2 in context.policies) {
13581
+ const policy = context.policies[i2];
13576
13582
  yield `[<policy id=${policy._attributes.__id}> ${policy._attributes.name}: Policy ${noteToCode$1(policy._attributes.note)}]`;
13577
13583
  }
13578
- if (displayReadModel) {
13579
- for (const i2 in context.getReadModels()) {
13580
- const readModel = context.getReadModels()[i2];
13581
- yield `[<readModel id=${readModel._attributes.__id}> ${readModel._attributes.name}: ReadModel ${infosToCode(readModel._attributes.infos)} ${noteToCode$1(readModel._attributes.note)}]`;
13582
- }
13584
+ for (const i2 in context.readModels) {
13585
+ const readModel = context.readModels[i2];
13586
+ yield `[<readModel id=${readModel._attributes.__id}> ${readModel._attributes.name}: ReadModel ${infosToCode(readModel._attributes.infos)} ${noteToCode$1(readModel._attributes.note)}]`;
13583
13587
  }
13584
- if (displaySystem) {
13585
- for (const i2 in context.getSystems()) {
13586
- const system = context.getSystems()[i2];
13587
- yield `[<system id=${system._attributes.__id}> ${system._attributes.name}: System ${noteToCode$1(system._attributes.note)}]`;
13588
- }
13588
+ for (const i2 in context.systems) {
13589
+ const system = context.systems[i2];
13590
+ yield `[<system id=${system._attributes.__id}> ${system._attributes.name}: System ${noteToCode$1(system._attributes.note)}]`;
13589
13591
  }
13590
- for (const i2 in context.getLinks()) {
13591
- const linkType = context.getLinks()[i2];
13592
+ for (const i2 in context.links) {
13593
+ const linkType = context.links[i2];
13592
13594
  const [_rule1, from, _rule2, to] = i2.split(",");
13593
- if (!displayReadModel && (_rule1 === "ReadModel" || _rule2 === "ReadModel")) {
13595
+ if (!params.displayReadModel && (_rule1 === "ReadModel" || _rule2 === "ReadModel")) {
13594
13596
  continue;
13595
13597
  }
13596
- if (!displaySystem && (_rule1 === "System" || _rule2 === "System")) {
13598
+ if (!params.displaySystem && (_rule1 === "System" || _rule2 === "System")) {
13597
13599
  continue;
13598
13600
  }
13599
13601
  if (linkType === "Association") {
@@ -13605,6 +13607,75 @@ Stack : ${c2.stack || "unkown"}`);
13605
13607
  }
13606
13608
  }
13607
13609
  }
13610
+ function filterContext(params) {
13611
+ const originalContext = params.design._getContext();
13612
+ const getIdMap = originalContext.getIdMap;
13613
+ let commands = originalContext.getCommands();
13614
+ let facadeCommands = originalContext.getFacadeCommands();
13615
+ let aggs = originalContext.getAggs();
13616
+ let events = originalContext.getEvents();
13617
+ let services = originalContext.getServices();
13618
+ let actors = originalContext.getActors();
13619
+ let policies = originalContext.getPolicies();
13620
+ let readModels = originalContext.getReadModels();
13621
+ let systems = originalContext.getSystems();
13622
+ let links = originalContext.getLinks();
13623
+ originalContext.getUserStories;
13624
+ if (isEmptyStory(params.currentStory)) {
13625
+ return {
13626
+ aggs,
13627
+ commands,
13628
+ facadeCommands,
13629
+ events,
13630
+ services,
13631
+ actors,
13632
+ policies,
13633
+ readModels,
13634
+ systems,
13635
+ links,
13636
+ getIdMap
13637
+ };
13638
+ }
13639
+ const workflows = [];
13640
+ for (const workflowName of originalContext.getUserStories()[params.currentStory]) {
13641
+ for (const id of originalContext.getWorkflows()[workflowName]) {
13642
+ workflows.push(id);
13643
+ }
13644
+ }
13645
+ commands = commands.filter((i2) => workflows.includes(i2._attributes.__id));
13646
+ facadeCommands = facadeCommands.filter((i2) => workflows.includes(i2._attributes.__id));
13647
+ aggs = aggs.filter((i2) => workflows.includes(i2._attributes.__id));
13648
+ events = events.filter((i2) => workflows.includes(i2._attributes.__id));
13649
+ services = services.filter((i2) => workflows.includes(i2._attributes.__id));
13650
+ actors = actors.filter((i2) => workflows.includes(i2._attributes.__id));
13651
+ policies = policies.filter((i2) => workflows.includes(i2._attributes.__id));
13652
+ readModels = readModels.filter((i2) => workflows.includes(i2._attributes.__id));
13653
+ systems = systems.filter((i2) => workflows.includes(i2._attributes.__id));
13654
+ links = {};
13655
+ const originalContextLinks = originalContext.getLinks();
13656
+ for (const k2 of Object.keys(originalContextLinks)) {
13657
+ const [_srcRule, srcId, _targetRule, targetId] = k2.split(",");
13658
+ if (workflows.includes(srcId) && workflows.includes(targetId)) {
13659
+ links[k2] = originalContextLinks[k2];
13660
+ }
13661
+ }
13662
+ return {
13663
+ aggs,
13664
+ commands,
13665
+ facadeCommands,
13666
+ events,
13667
+ services,
13668
+ actors,
13669
+ policies,
13670
+ readModels,
13671
+ systems,
13672
+ links,
13673
+ getIdMap
13674
+ };
13675
+ }
13676
+ function isEmptyStory(story) {
13677
+ return story === EMPTY_STORY;
13678
+ }
13608
13679
  function infosToCode(infos) {
13609
13680
  if (!infos) {
13610
13681
  return "";
@@ -13651,7 +13722,6 @@ Stack : ${c2.stack || "unkown"}`);
13651
13722
  return "|" + code;
13652
13723
  }
13653
13724
  let agg$1;
13654
- const EMPTY_STORY = "__Empty__";
13655
13725
  function createAgg(data) {
13656
13726
  return X$2(() => {
13657
13727
  const designRecords = ref(data);
@@ -13675,7 +13745,12 @@ Stack : ${c2.stack || "unkown"}`);
13675
13745
  return "";
13676
13746
  }
13677
13747
  const code2 = [];
13678
- const generator = nomnomlCodeGenerator(design.value, displayReadModel.value, displaySystem.value);
13748
+ const generator = nomnomlCodeGenerator({
13749
+ design: design.value,
13750
+ currentStory: currentStory.value,
13751
+ displayReadModel: displayReadModel.value,
13752
+ displaySystem: displaySystem.value
13753
+ });
13679
13754
  let item = generator.next();
13680
13755
  while (!item.done) {
13681
13756
  code2.push(item.value);
@@ -13712,12 +13787,17 @@ Stack : ${c2.stack || "unkown"}`);
13712
13787
  return result;
13713
13788
  });
13714
13789
  const onFocusFlow = x$2();
13715
- function focusFlow(workflow, userStory = "Others") {
13716
- currentWorkflow.value = workflow;
13790
+ function focusFlow(workflow, userStory = EMPTY_STORY) {
13791
+ var _a, _b;
13717
13792
  currentStory.value = userStory;
13793
+ if (userStory !== EMPTY_STORY && (!workflow || !((_a = design.value) == null ? void 0 : _a._getContext().getUserStories()[userStory].includes(workflow)))) {
13794
+ currentWorkflow.value = ((_b = design.value) == null ? void 0 : _b._getContext().getUserStories()[userStory][0]) || void 0;
13795
+ } else {
13796
+ currentWorkflow.value = workflow;
13797
+ }
13718
13798
  onFocusFlow.publish({
13719
13799
  userStory,
13720
- workflow,
13800
+ workflow: currentWorkflow.value,
13721
13801
  displayReadModel: displayReadModel.value,
13722
13802
  displaySystem: displaySystem.value
13723
13803
  });
@@ -13748,6 +13828,14 @@ Stack : ${c2.stack || "unkown"}`);
13748
13828
  downloadSvg() {
13749
13829
  onDownloadSvg.publish({});
13750
13830
  },
13831
+ filterContext() {
13832
+ return filterContext({
13833
+ design: design.value,
13834
+ currentStory: currentStory.value,
13835
+ displayReadModel: displayReadModel.value,
13836
+ displaySystem: displaySystem.value
13837
+ });
13838
+ },
13751
13839
  setDownloadEnabled(b2) {
13752
13840
  downloadEnabled.value = b2;
13753
13841
  },
@@ -13811,17 +13899,17 @@ Stack : ${c2.stack || "unkown"}`);
13811
13899
  function Ln(t2) {
13812
13900
  return t2 && t2._attributes && t2._attributes.rule === "Info";
13813
13901
  }
13814
- const yt = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
13902
+ const Et = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
13815
13903
  process.env.NODE_ENV !== "production" && Object.freeze([]);
13816
13904
  const Lt = () => {
13817
13905
  }, Re = (t2) => t2.charCodeAt(0) === 111 && t2.charCodeAt(1) === 110 && (t2.charCodeAt(2) > 122 || t2.charCodeAt(2) < 97), B = Object.assign, y$1 = Array.isArray, $$1 = (t2) => typeof t2 == "function", x$1 = (t2) => typeof t2 == "string", Z$1 = (t2) => typeof t2 == "symbol", R$1 = (t2) => t2 !== null && typeof t2 == "object";
13818
13906
  let $t;
13819
13907
  const dt = () => $t || ($t = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
13820
- function Rt(t2) {
13908
+ function Ft(t2) {
13821
13909
  if (y$1(t2)) {
13822
13910
  const e2 = {};
13823
13911
  for (let n2 = 0; n2 < t2.length; n2++) {
13824
- const s2 = t2[n2], r2 = x$1(s2) ? Me(s2) : Rt(s2);
13912
+ const s2 = t2[n2], r2 = x$1(s2) ? Me(s2) : Ft(s2);
13825
13913
  if (r2) for (const o2 in r2) e2[o2] = r2[o2];
13826
13914
  }
13827
13915
  return e2;
@@ -13837,11 +13925,11 @@ Stack : ${c2.stack || "unkown"}`);
13837
13925
  }
13838
13926
  }), e2;
13839
13927
  }
13840
- function Ft(t2) {
13928
+ function Ct(t2) {
13841
13929
  let e2 = "";
13842
13930
  if (x$1(t2)) e2 = t2;
13843
13931
  else if (y$1(t2)) for (let n2 = 0; n2 < t2.length; n2++) {
13844
- const s2 = Ft(t2[n2]);
13932
+ const s2 = Ct(t2[n2]);
13845
13933
  s2 && (e2 += s2 + " ");
13846
13934
  }
13847
13935
  else if (R$1(t2)) for (const n2 in t2) t2[n2] && (e2 += n2 + " ");
@@ -13877,12 +13965,12 @@ Stack : ${c2.stack || "unkown"}`);
13877
13965
  function en() {
13878
13966
  k$1.pop();
13879
13967
  }
13880
- let gt = false;
13968
+ let bt = false;
13881
13969
  function W$1(t2, ...e2) {
13882
- if (gt) return;
13883
- gt = true;
13970
+ if (bt) return;
13971
+ bt = true;
13884
13972
  const n2 = k$1.length ? k$1[k$1.length - 1].component : null, s2 = n2 && n2.appContext.config.warnHandler, r2 = nn();
13885
- if (s2) It(s2, n2, 11, [
13973
+ if (s2) Mt(s2, n2, 11, [
13886
13974
  t2 + e2.map((o2) => {
13887
13975
  var c2, i2;
13888
13976
  return (i2 = (c2 = o2.toString) == null ? void 0 : c2.call(o2)) != null ? i2 : JSON.stringify(o2);
@@ -13900,7 +13988,7 @@ Stack : ${c2.stack || "unkown"}`);
13900
13988
  r2.length && o2.push(`
13901
13989
  `, ...rn(r2));
13902
13990
  }
13903
- gt = false;
13991
+ bt = false;
13904
13992
  }
13905
13993
  function nn() {
13906
13994
  let t2 = k$1[k$1.length - 1];
@@ -13991,7 +14079,7 @@ Stack : ${c2.stack || "unkown"}`);
13991
14079
  15: "component update",
13992
14080
  16: "app unmount cleanup function"
13993
14081
  };
13994
- function It(t2, e2, n2, s2) {
14082
+ function Mt(t2, e2, n2, s2) {
13995
14083
  try {
13996
14084
  return s2 ? t2(...s2) : t2();
13997
14085
  } catch (r2) {
@@ -13999,7 +14087,7 @@ Stack : ${c2.stack || "unkown"}`);
13999
14087
  }
14000
14088
  }
14001
14089
  function oe(t2, e2, n2, s2 = true) {
14002
- const r2 = e2 ? e2.vnode : null, { errorHandler: o2, throwUnhandledErrorInProduction: c2 } = e2 && e2.appContext.config || yt;
14090
+ const r2 = e2 ? e2.vnode : null, { errorHandler: o2, throwUnhandledErrorInProduction: c2 } = e2 && e2.appContext.config || Et;
14003
14091
  if (e2) {
14004
14092
  let i2 = e2.parent;
14005
14093
  const a2 = e2.proxy, d2 = process.env.NODE_ENV !== "production" ? re[n2] : `https://vuejs.org/error-reference/#runtime-${n2}`;
@@ -14011,7 +14099,7 @@ Stack : ${c2.stack || "unkown"}`);
14011
14099
  i2 = i2.parent;
14012
14100
  }
14013
14101
  if (o2) {
14014
- It(o2, null, 10, [
14102
+ Mt(o2, null, 10, [
14015
14103
  t2,
14016
14104
  a2,
14017
14105
  d2
@@ -14032,7 +14120,7 @@ Stack : ${c2.stack || "unkown"}`);
14032
14120
  const L = [];
14033
14121
  let V$1 = null, K$1 = 0;
14034
14122
  const un = Promise.resolve();
14035
- let Ot = null;
14123
+ let Tt = null;
14036
14124
  const an = 100;
14037
14125
  function ln(t2) {
14038
14126
  let e2 = D + 1, n2 = O$1.length;
@@ -14049,7 +14137,7 @@ Stack : ${c2.stack || "unkown"}`);
14049
14137
  }
14050
14138
  }
14051
14139
  function se() {
14052
- Ot || (Ot = un.then(ie));
14140
+ Tt || (Tt = un.then(ie));
14053
14141
  }
14054
14142
  function dn(t2) {
14055
14143
  y$1(t2) ? L.push(...t2) : V$1 && t2.id === -1 ? V$1.splice(K$1 + 1, 0, t2) : t2.flags & 1 || (L.push(t2), t2.flags |= 1), se();
@@ -14079,7 +14167,7 @@ Stack : ${c2.stack || "unkown"}`);
14079
14167
  const n2 = O$1[D];
14080
14168
  if (n2 && !(n2.flags & 8)) {
14081
14169
  if (process.env.NODE_ENV !== "production" && e2(n2)) continue;
14082
- n2.flags & 4 && (n2.flags &= -2), It(n2, n2.i, n2.i ? 15 : 14), n2.flags & 4 || (n2.flags &= -2);
14170
+ n2.flags & 4 && (n2.flags &= -2), Mt(n2, n2.i, n2.i ? 15 : 14), n2.flags & 4 || (n2.flags &= -2);
14083
14171
  }
14084
14172
  }
14085
14173
  } finally {
@@ -14087,7 +14175,7 @@ Stack : ${c2.stack || "unkown"}`);
14087
14175
  const n2 = O$1[D];
14088
14176
  n2 && (n2.flags &= -2);
14089
14177
  }
14090
- D = -1, O$1.length = 0, _n(t2), Ot = null, (O$1.length || L.length) && ie(t2);
14178
+ D = -1, O$1.length = 0, _n(t2), Tt = null, (O$1.length || L.length) && ie(t2);
14091
14179
  }
14092
14180
  }
14093
14181
  function ce(t2, e2) {
@@ -14098,11 +14186,11 @@ Stack : ${c2.stack || "unkown"}`);
14098
14186
  }
14099
14187
  return t2.set(e2, n2 + 1), false;
14100
14188
  }
14101
- const bt = /* @__PURE__ */ new Map();
14189
+ const mt = /* @__PURE__ */ new Map();
14102
14190
  process.env.NODE_ENV !== "production" && (dt().__VUE_HMR_RUNTIME__ = {
14103
- createRecord: mt(pn),
14104
- rerender: mt(hn),
14105
- reload: mt(gn)
14191
+ createRecord: yt(pn),
14192
+ rerender: yt(hn),
14193
+ reload: yt(gn)
14106
14194
  });
14107
14195
  const ut = /* @__PURE__ */ new Map();
14108
14196
  function pn(t2, e2) {
@@ -14131,20 +14219,20 @@ Stack : ${c2.stack || "unkown"}`);
14131
14219
  ];
14132
14220
  for (let r2 = 0; r2 < s2.length; r2++) {
14133
14221
  const o2 = s2[r2], c2 = at(o2.type);
14134
- let i2 = bt.get(c2);
14135
- i2 || (c2 !== n2.initialDef && Ht(c2, e2), bt.set(c2, i2 = /* @__PURE__ */ new Set())), i2.add(o2), o2.appContext.propsCache.delete(o2.type), o2.appContext.emitsCache.delete(o2.type), o2.appContext.optionsCache.delete(o2.type), o2.ceReload ? (i2.add(o2), o2.ceReload(e2.styles), i2.delete(o2)) : o2.parent ? fn(() => {
14222
+ let i2 = mt.get(c2);
14223
+ i2 || (c2 !== n2.initialDef && Ht(c2, e2), mt.set(c2, i2 = /* @__PURE__ */ new Set())), i2.add(o2), o2.appContext.propsCache.delete(o2.type), o2.appContext.emitsCache.delete(o2.type), o2.appContext.optionsCache.delete(o2.type), o2.ceReload ? (i2.add(o2), o2.ceReload(e2.styles), i2.delete(o2)) : o2.parent ? fn(() => {
14136
14224
  o2.parent.update(), i2.delete(o2);
14137
14225
  }) : o2.appContext.reload ? o2.appContext.reload() : typeof window < "u" && window.location.reload(), o2.root.ce && o2 !== o2.root && o2.root.ce._removeChildStyle(c2);
14138
14226
  }
14139
14227
  dn(() => {
14140
- bt.clear();
14228
+ mt.clear();
14141
14229
  });
14142
14230
  }
14143
14231
  function Ht(t2, e2) {
14144
14232
  B(t2, e2);
14145
14233
  for (const n2 in t2) n2 !== "__file" && !(n2 in e2) && delete t2[n2];
14146
14234
  }
14147
- function mt(t2) {
14235
+ function yt(t2) {
14148
14236
  return (e2, n2) => {
14149
14237
  try {
14150
14238
  return t2(e2, n2);
@@ -14201,18 +14289,18 @@ Stack : ${c2.stack || "unkown"}`);
14201
14289
  appContext: null,
14202
14290
  ctx: lt
14203
14291
  };
14204
- return i2 ? (Mt(a2, n2), o2 & 128 && t2.normalize(a2)) : n2 && (a2.shapeFlag |= x$1(n2) ? 8 : 16), process.env.NODE_ENV !== "production" && a2.key !== a2.key && W$1("VNode created with invalid key (NaN). VNode type:", a2.type), a2;
14292
+ return i2 ? (Pt(a2, n2), o2 & 128 && t2.normalize(a2)) : n2 && (a2.shapeFlag |= x$1(n2) ? 8 : 16), process.env.NODE_ENV !== "production" && a2.key !== a2.key && W$1("VNode created with invalid key (NaN). VNode type:", a2.type), a2;
14205
14293
  }
14206
14294
  const Fn = process.env.NODE_ENV !== "production" ? Tn : _e;
14207
14295
  function _e(t2, e2 = null, n2 = null, s2 = 0, r2 = null, o2 = false) {
14208
14296
  if ((!t2 || t2 === yn) && (process.env.NODE_ENV !== "production" && !t2 && W$1(`Invalid vnode type when creating vnode: ${t2}.`), t2 = Sn), On(t2)) {
14209
14297
  const i2 = ft(t2, e2, true);
14210
- return n2 && Mt(i2, n2), i2.patchFlag = -2, i2;
14298
+ return n2 && Pt(i2, n2), i2.patchFlag = -2, i2;
14211
14299
  }
14212
14300
  if (be(t2) && (t2 = t2.__vccOpts), e2) {
14213
14301
  e2 = Cn(e2);
14214
14302
  let { class: i2, style: a2 } = e2;
14215
- i2 && !x$1(i2) && (e2.class = Ft(i2)), R$1(a2) && (ct(a2) && !y$1(a2) && (a2 = B({}, a2)), e2.style = Rt(a2));
14303
+ i2 && !x$1(i2) && (e2.class = Ct(i2)), R$1(a2) && (ct(a2) && !y$1(a2) && (a2 = B({}, a2)), e2.style = Ft(a2));
14216
14304
  }
14217
14305
  const c2 = x$1(t2) ? 1 : Nn(t2) ? 128 : mn(t2) ? 64 : R$1(t2) ? 4 : $$1(t2) ? 2 : 0;
14218
14306
  return process.env.NODE_ENV !== "production" && c2 & 4 && ct(t2) && (t2 = h(t2), W$1("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.", `
@@ -14264,14 +14352,14 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14264
14352
  function Dn(t2 = " ", e2 = 0) {
14265
14353
  return Fn(vn, null, t2, e2);
14266
14354
  }
14267
- function Mt(t2, e2) {
14355
+ function Pt(t2, e2) {
14268
14356
  let n2 = 0;
14269
14357
  const { shapeFlag: s2 } = t2;
14270
14358
  if (e2 == null) e2 = null;
14271
14359
  else if (y$1(e2)) n2 = 16;
14272
14360
  else if (typeof e2 == "object") if (s2 & 65) {
14273
14361
  const r2 = e2.default;
14274
- r2 && (r2._c && (r2._d = false), Mt(t2, r2()), r2._c && (r2._d = true));
14362
+ r2 && (r2._c && (r2._d = false), Pt(t2, r2()), r2._c && (r2._d = true));
14275
14363
  return;
14276
14364
  } else n2 = 32, !e2._ && !le(e2) && (e2._ctx = lt);
14277
14365
  else $$1(e2) ? (e2 = {
@@ -14286,11 +14374,11 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14286
14374
  const e2 = {};
14287
14375
  for (let n2 = 0; n2 < t2.length; n2++) {
14288
14376
  const s2 = t2[n2];
14289
- for (const r2 in s2) if (r2 === "class") e2.class !== s2.class && (e2.class = Ft([
14377
+ for (const r2 in s2) if (r2 === "class") e2.class !== s2.class && (e2.class = Ct([
14290
14378
  e2.class,
14291
14379
  s2.class
14292
14380
  ]));
14293
- else if (r2 === "style") e2.style = Rt([
14381
+ else if (r2 === "style") e2.style = Ft([
14294
14382
  e2.style,
14295
14383
  s2.style
14296
14384
  ]);
@@ -14397,7 +14485,7 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14397
14485
  };
14398
14486
  function o2(u2) {
14399
14487
  const f2 = [];
14400
- u2.type.props && u2.props && f2.push(c2("props", h(u2.props))), u2.setupState !== yt && f2.push(c2("setup", u2.setupState)), u2.data !== yt && f2.push(c2("data", h(u2.data)));
14488
+ u2.type.props && u2.props && f2.push(c2("props", h(u2.props))), u2.setupState !== Et && f2.push(c2("setup", u2.setupState)), u2.data !== Et && f2.push(c2("data", h(u2.data)));
14401
14489
  const _2 = a2(u2, "computed");
14402
14490
  _2 && f2.push(c2("computed", _2));
14403
14491
  const g2 = a2(u2, "inject");
@@ -14503,13 +14591,12 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14503
14591
  }
14504
14592
  process.env.NODE_ENV !== "production" && Mn();
14505
14593
  function preprocessSvg(diagramAgg, domStr) {
14506
- var _a;
14507
14594
  const parser = new DOMParser();
14508
14595
  if (/^\s+$/.test(domStr)) {
14509
14596
  return document.createElement("svg");
14510
14597
  }
14511
14598
  const svgDoc = parser.parseFromString(domStr, "image/svg+xml");
14512
- const context = (_a = diagramAgg.states.design.value) == null ? void 0 : _a._getContext();
14599
+ const context = diagramAgg.commands.filterContext();
14513
14600
  for (const node of Object.values(context.getIdMap())) {
14514
14601
  if (!isNodeLike(node)) {
14515
14602
  continue;
@@ -14549,6 +14636,9 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14549
14636
  const info = node.inner[key];
14550
14637
  const infoId = info._attributes.__id;
14551
14638
  const infoDoc = nodeDoc.querySelector(`[data-compartment="${index}"]`);
14639
+ if (!infoDoc) {
14640
+ continue;
14641
+ }
14552
14642
  infoDoc.dataset.id = infoId;
14553
14643
  {
14554
14644
  const text = infoDoc.querySelector("text");
@@ -14671,7 +14761,7 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14671
14761
  for (let i2 = 0; i2 < nodes.length; i2++) {
14672
14762
  const el = document.querySelector(`[data-name="${nodes[i2]}"]`);
14673
14763
  setTimeout(() => {
14674
- if (animationTask !== currentAnimationTask) return;
14764
+ if (animationTask !== currentAnimationTask || !el) return;
14675
14765
  el.style.transition = `opacity 0s`;
14676
14766
  el.style.opacity = "0.0";
14677
14767
  setTimeout(() => {
@@ -14690,13 +14780,12 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14690
14780
  const idMap = diagramAgg.commands.getIdMap();
14691
14781
  let items = data.workflow === void 0 ? [] : diagramAgg.states.workflows.value[data.workflow];
14692
14782
  items = items.filter((i2) => {
14693
- let b2 = true;
14694
14783
  if (!data.displayReadModel && idMap[i2]._attributes.rule === "ReadModel") {
14695
- b2 = false;
14784
+ return false;
14696
14785
  } else if (!data.displaySystem && idMap[i2]._attributes.rule === "System") {
14697
- b2 = false;
14786
+ return false;
14698
14787
  }
14699
- return b2;
14788
+ return true;
14700
14789
  });
14701
14790
  if (!data.displayReadModel || !data.displaySystem) {
14702
14791
  items = removeAdjacentDuplicates(items);
@@ -14769,7 +14858,7 @@ Component that was made reactive: `, t2)), Rn(t2, e2, n2, s2, r2, c2, o2, true);
14769
14858
  const Nomnoml = _export_sfc(_sfc_main$2, [
14770
14859
  [
14771
14860
  "__scopeId",
14772
- "data-v-83e775ca"
14861
+ "data-v-ddc71b2c"
14773
14862
  ]
14774
14863
  ]);
14775
14864
  function throttle(func, wait) {
@@ -25939,15 +26028,15 @@ input.p-select-label {
25939
26028
  }
25940
26029
  }
25941
26030
  ]);
25942
- watch([
25943
- currentStory,
25944
- currentWorkflow
25945
- ], ([story, workflow]) => {
25946
- if (workflow === void 0) {
25947
- diagramAgg.commands.focusFlow(void 0);
25948
- return;
26031
+ watch(currentStory, (story) => {
26032
+ var _a;
26033
+ if (story !== EMPTY_STORY) {
26034
+ currentWorkflow.value = (_a = diagramAgg.states.design.value) == null ? void 0 : _a._getContext().getUserStories()[story][0];
25949
26035
  }
25950
- diagramAgg.commands.focusFlow(workflow, story);
26036
+ diagramAgg.commands.focusFlow(currentWorkflow.value, story);
26037
+ });
26038
+ watch(currentWorkflow, (workflow) => {
26039
+ diagramAgg.commands.focusFlow(workflow, currentStory.value);
25951
26040
  });
25952
26041
  function handleNoFocus() {
25953
26042
  currentStory.value = EMPTY_STORY;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ddd-tool/domain-designer-ui-component",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@ddd-tool/domain-designer-core": "0.1.0-beta.5",
7
+ "@ddd-tool/domain-designer-core": "0.1.0-beta.7",
8
8
  "@primeuix/themes": "^1.0.0",
9
9
  "nomnoml": "^1.7.0",
10
10
  "primeicons": "^7.0.0",