@ddd-tool/domain-designer-ui-component 0.0.0-alpha.13 → 0.0.0-alpha.15

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/README.md CHANGED
@@ -1,7 +1,5 @@
1
- # 目标成为 ddd 建模的生产力工具
1
+ # Domain Designer - UI Component
2
2
 
3
3
  ## 试试效果
4
4
 
5
5
  <a href="https://stackblitz.com/~/github.com/ddd-tool/vue-domain-ui?file=src/views/design.ts" target="_blank">在线演示地址</a>
6
-
7
- - 推荐安装 Vue 插件
package/UI.vue.d.ts CHANGED
@@ -1,7 +1,13 @@
1
- import type { DomainDesigner } from '@ddd-tool/domain-designer-core';
1
+ import { type DomainDesigner } from '@ddd-tool/domain-designer-core';
2
2
  export type NonEmptyObject<T extends object> = keyof T extends never ? never : T;
3
3
  interface Props {
4
4
  designs: NonEmptyObject<Record<string, DomainDesigner>>;
5
5
  }
6
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
7
+ op: ({
8
+ $props: import("primevue/popover").PopoverProps & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
9
+ $slots: import("primevue/popover").PopoverSlots;
10
+ $emit: ((e: "show") => void) & ((e: "hide") => void);
11
+ } & import("primevue/popover").PopoverMethods) | null;
12
+ }, any>;
7
13
  export default _default;
package/common.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): T;
2
+ export declare function getOSType(): 'Windows Phone' | 'Windows' | 'Android' | 'Linux' | 'iOS' | 'MacOS' | 'Unknown OS';
@@ -9,7 +9,9 @@ declare function __VLS_template(): {
9
9
  rootEl: HTMLDivElement;
10
10
  };
11
11
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLDivElement>;
12
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {
13
+ containerRef: HTMLDivElement;
14
+ }, HTMLDivElement>;
13
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
14
16
  export default _default;
15
17
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -0,0 +1,7 @@
1
+ import type { NodeLike } from '#lib/domain/common';
2
+ interface Props {
3
+ node: NodeLike;
4
+ element: HTMLElement;
5
+ }
6
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLDivElement>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {
2
+ svgContainerRef: HTMLDivElement;
3
+ }, HTMLDivElement>;
2
4
  export default _default;
@@ -3,6 +3,7 @@ interface FocusFlowFn {
3
3
  (workflow: undefined, userStory?: string): void;
4
4
  (workflow: string, userStory: string): void;
5
5
  }
6
+ export declare const EMPTY_STORY = "__Empty__";
6
7
  export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Readonly<{
7
8
  states: Readonly<{
8
9
  design: Readonly<import("vue").Ref<{
@@ -31,7 +32,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
31
32
  readonly _getContext: () => {
32
33
  startWorkflow(name: string): string;
33
34
  defineUserStory(name: string, workflowNames: import("@ddd-tool/domain-designer-core/define").NonEmptyArray<string>): void;
34
- linkTo(srcRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Event" | "Agg" | "Policy" | "System" | "Service" | "ReadModel", srcCode: string, targetRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Event" | "Agg" | "Policy" | "System" | "Service" | "ReadModel", targetCode: string, linkType?: import("@ddd-tool/domain-designer-core/common").LinkType): void;
35
+ linkTo(srcRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Agg" | "Event" | "Policy" | "Service" | "System" | "ReadModel", srcCode: string, targetRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Agg" | "Event" | "Policy" | "Service" | "System" | "ReadModel", targetCode: string, linkType?: import("@ddd-tool/domain-designer-core/common").LinkType): void;
35
36
  getId(): string;
36
37
  getWorkflows(): Record<string, string[]>;
37
38
  getUserStories(): Record<string, string[]>;
@@ -253,7 +254,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
253
254
  readonly _getContext: () => {
254
255
  startWorkflow(name: string): string;
255
256
  defineUserStory(name: string, workflowNames: import("@ddd-tool/domain-designer-core/define").NonEmptyArray<string>): void;
256
- linkTo(srcRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Event" | "Agg" | "Policy" | "System" | "Service" | "ReadModel", srcCode: string, targetRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Event" | "Agg" | "Policy" | "System" | "Service" | "ReadModel", targetCode: string, linkType?: import("@ddd-tool/domain-designer-core/common").LinkType): void;
257
+ linkTo(srcRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Agg" | "Event" | "Policy" | "Service" | "System" | "ReadModel", srcCode: string, targetRule: "Info" | "Actor" | "Command" | "FacadeCommand" | "Agg" | "Event" | "Policy" | "Service" | "System" | "ReadModel", targetCode: string, linkType?: import("@ddd-tool/domain-designer-core/common").LinkType): void;
257
258
  getId(): string;
258
259
  getWorkflows(): Record<string, string[]>;
259
260
  getUserStories(): Record<string, string[]>;
@@ -462,6 +463,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
462
463
  }, {
463
464
  readonly [x: string]: readonly string[];
464
465
  }>>;
466
+ workflowPlayInterval: Readonly<import("vue").Ref<number, number>>;
465
467
  currentWorkflow: Readonly<import("vue").Ref<string | undefined, string | undefined>>;
466
468
  currentStory: Readonly<import("vue").Ref<string, string>>;
467
469
  currentDesignKey: Readonly<import("vue").Ref<string | undefined, string | undefined>>;
@@ -474,6 +476,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
474
476
  focusFlow: FocusFlowFn;
475
477
  downloadSvg: () => void;
476
478
  setDownloadEnabled: (b: boolean) => void;
479
+ setWorkflowPlayInterval: (i: number) => void;
477
480
  setDisplayReadModel: (b: boolean) => void;
478
481
  setDisplaySystem: (b: boolean) => void;
479
482
  setCurrentNode: (id: string | undefined) => void;
@@ -482,7 +485,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
482
485
  }>;
483
486
  events: Readonly<{
484
487
  onFocusNode: {
485
- latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string, string>>;
488
+ latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string>>;
486
489
  watchPublish: (cb: (event: {
487
490
  data: {
488
491
  readonly id: string | undefined;
@@ -491,7 +494,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
491
494
  }) => void) => import("vue").WatchHandle;
492
495
  };
493
496
  onFocusFlow: {
494
- latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string, string>>;
497
+ latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string>>;
495
498
  watchPublish: (cb: (event: {
496
499
  data: {
497
500
  readonly userStory: string;
@@ -503,7 +506,7 @@ export declare function useDiagramAgg(data?: Record<string, DomainDesigner>): Re
503
506
  }) => void) => import("vue").WatchHandle;
504
507
  };
505
508
  onDownloadSvg: {
506
- latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string, string>>;
509
+ latestVersion: import("vue").ComputedRef<import("vue").ShallowRef<string>>;
507
510
  watchPublish: (cb: (event: {
508
511
  data: {};
509
512
  version: string;
@@ -1,4 +1,4 @@
1
- export type I18nMessageKeys = 'constant.type' | 'constant.type.id' | 'constant.type.document' | 'constant.type.function' | 'constant.type.valueObject' | 'constant.type.version' | 'constant.relatedTypes' | 'constant.description' | 'constant.empty' | 'constant.others' | 'menu.focusOnUserStory' | 'menu.focusOnUserStory.focusNothing' | 'menu.settings' | 'menu.settings.renderExternalSystem' | 'menu.settings.renderReadModel' | 'menu.settings.language' | 'menu.settings.dataSource' | 'menu.help' | 'menu.exportSvg' | 'menu.replayWorkflow';
1
+ export type I18nMessageKeys = 'constant.type' | 'constant.type.id' | 'constant.type.document' | 'constant.type.function' | 'constant.type.valueObject' | 'constant.type.version' | 'constant.relatedTypes' | 'constant.description' | 'constant.empty' | 'constant.others' | 'menu.focusOnUserStory' | 'menu.focusOnUserStory.focusNothing' | 'menu.completenessAssist' | 'menu.settings' | 'menu.settings.renderExternalSystem' | 'menu.settings.renderReadModel' | 'menu.settings.language' | 'menu.settings.dataSource' | 'menu.help' | 'menu.exportSvg' | 'menu.replayWorkflow';
2
2
  export type I18nMessages = {
3
3
  [key in I18nMessageKeys]: string;
4
4
  };
package/index.css CHANGED
@@ -1 +1 @@
1
- .nomnoml[data-v-9de3e409]{height:100%;overflow:auto}.nomnoml text{cursor:pointer}@keyframes shining-info{0%{stroke-width:1px;stroke-opacity:.2;stroke:#000;-webkit-text-stroke-color:#000}to{stroke-width:1px;stroke-opacity:.8;stroke:#000;-webkit-text-stroke-color:#000}}@keyframes shining-node{0%{stroke-opacity:.2;stroke:#33322e;-webkit-text-stroke-color:#33322e}to{stroke-opacity:1;stroke:#33322e;-webkit-text-stroke-color:#33322e}}.nomnoml .highlight-info:not(.active) text{animation:shining-info .6s alternate infinite;-webkit-animation:shining-info .6s alternate infinite;-moz-animation:shining-info .6s alternate infinite}.nomnoml .highlight-desc:not(.active){animation:shining-info .6s alternate infinite;-webkit-animation:shining-info .6s alternate infinite;-moz-animation:shining-info .6s alternate infinite}.nomnoml .highlight-node g:first-child{animation:shining-node .6s alternate infinite;-webkit-animation:shining-node .6s alternate infinite;-moz-animation:shining-node .6s alternate infinite}.nomnoml .active,.nomnoml .active text{stroke-width:1px;stroke-opacity:.8;stroke:#000;-webkit-text-stroke-color:#000}.container{width:100vw;height:100vh;background-color:#f0f0f0;overflow:hidden;position:relative}.draggable{position:absolute;top:0;left:0;user-select:none;transform-origin:center}.p-dock{opacity:.4;transition:.5s}.p-dock:hover{opacity:1}.p-dock .p-dock-item:hover{scale:1.1}
1
+ .nomnoml[data-v-9ec6ae0d]{height:100%;overflow:auto}.nomnoml text{cursor:pointer}@keyframes shining-info{0%{stroke-width:1px;stroke-opacity:.2;stroke:#000;-webkit-text-stroke-color:#000}to{stroke-width:1px;stroke-opacity:.8;stroke:#000;-webkit-text-stroke-color:#000}}@keyframes shining-node{0%{stroke-opacity:.2;stroke:#33322e;-webkit-text-stroke-color:#33322e}to{stroke-opacity:1;stroke:#33322e;-webkit-text-stroke-color:#33322e}}.nomnoml .highlight-info:not(.active) text{animation:shining-info .6s alternate infinite;-webkit-animation:shining-info .6s alternate infinite;-moz-animation:shining-info .6s alternate infinite}.nomnoml .highlight-desc:not(.active){animation:shining-info .6s alternate infinite;-webkit-animation:shining-info .6s alternate infinite;-moz-animation:shining-info .6s alternate infinite}.nomnoml .highlight-node:not(.active) g:first-child{animation:shining-node .6s alternate infinite;-webkit-animation:shining-node .6s alternate infinite;-moz-animation:shining-node .6s alternate infinite}.nomnoml g[data-id].active text,.nomnoml tspan[data-id].active{stroke-width:1px;stroke-opacity:.8;stroke:#000;-webkit-text-stroke-color:#000}.nomnoml g.node.active{animation:shining-node .6s alternate infinite;-webkit-animation:shining-node .6s alternate infinite;-moz-animation:shining-node .6s alternate infinite}.container{width:100vw;height:100vh;background-color:#f0f0f0;overflow:hidden;position:relative}.draggable{position:absolute;top:0;left:0;user-select:none;transform-origin:0 0}.p-dock{opacity:.4;transition:.5s}.p-dock:hover{opacity:1}.p-dock .p-dock-item:hover{scale:1.1}.root-fieldset{opacity:.9;white-space:pre-line;position:absolute;right:4rem;top:0;width:30%}.root-fieldset .desc:before{content:"";display:inline-block;height:1rem;width:.5rem;border-radius:.25rem;margin-right:.5rem;background-color:#4441ff}