@vived/app 5.0.4 → 5.0.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.
Files changed (50) hide show
  1. package/dist/cjs/Callouts/Entities/CalloutEntity.js +1 -0
  2. package/dist/cjs/Callouts/Entities/CalloutEntity.js.map +1 -1
  3. package/dist/cjs/Callouts/Entities/CalloutEntity.test.js +1 -1
  4. package/dist/cjs/Callouts/Entities/CalloutEntity.test.js.map +1 -1
  5. package/dist/cjs/Label/Controller/index.js +2 -1
  6. package/dist/cjs/Label/Controller/index.js.map +1 -1
  7. package/dist/cjs/Label/Controller/submitCustomLabel.js +18 -0
  8. package/dist/cjs/Label/Controller/submitCustomLabel.js.map +1 -0
  9. package/dist/cjs/Label/Controller/submitCustomLabel.test.js +39 -0
  10. package/dist/cjs/Label/Controller/submitCustomLabel.test.js.map +1 -0
  11. package/dist/cjs/Label/Controller/updateCustomLabel.js +18 -0
  12. package/dist/cjs/Label/Controller/updateCustomLabel.js.map +1 -0
  13. package/dist/cjs/Label/Controller/updateCustomLabel.test.js +39 -0
  14. package/dist/cjs/Label/Controller/updateCustomLabel.test.js.map +1 -0
  15. package/dist/cjs/Label/UC/SetCustomLabelUC.js +13 -3
  16. package/dist/cjs/Label/UC/SetCustomLabelUC.js.map +1 -1
  17. package/dist/cjs/Label/UC/SetCustomLabelUC.test.js +14 -6
  18. package/dist/cjs/Label/UC/SetCustomLabelUC.test.js.map +1 -1
  19. package/dist/esm/Callouts/Entities/CalloutEntity.js +5 -4
  20. package/dist/esm/Callouts/Entities/CalloutEntity.js.map +1 -1
  21. package/dist/esm/Callouts/Entities/CalloutEntity.test.js +1 -1
  22. package/dist/esm/Callouts/Entities/CalloutEntity.test.js.map +1 -1
  23. package/dist/esm/Label/Controller/index.js +2 -1
  24. package/dist/esm/Label/Controller/index.js.map +1 -1
  25. package/dist/esm/Label/Controller/submitCustomLabel.js +15 -0
  26. package/dist/esm/Label/Controller/submitCustomLabel.js.map +1 -0
  27. package/dist/esm/Label/Controller/submitCustomLabel.test.js +37 -0
  28. package/dist/esm/Label/Controller/submitCustomLabel.test.js.map +1 -0
  29. package/dist/esm/Label/Controller/updateCustomLabel.js +15 -0
  30. package/dist/esm/Label/Controller/updateCustomLabel.js.map +1 -0
  31. package/dist/esm/Label/Controller/updateCustomLabel.test.js +37 -0
  32. package/dist/esm/Label/Controller/updateCustomLabel.test.js.map +1 -0
  33. package/dist/esm/Label/UC/SetCustomLabelUC.js +13 -3
  34. package/dist/esm/Label/UC/SetCustomLabelUC.js.map +1 -1
  35. package/dist/esm/Label/UC/SetCustomLabelUC.test.js +14 -6
  36. package/dist/esm/Label/UC/SetCustomLabelUC.test.js.map +1 -1
  37. package/dist/types/Callouts/Entities/CalloutEntity.d.ts.map +1 -1
  38. package/dist/types/Label/Controller/index.d.ts +2 -1
  39. package/dist/types/Label/Controller/index.d.ts.map +1 -1
  40. package/dist/types/Label/Controller/submitCustomLabel.d.ts +3 -0
  41. package/dist/types/Label/Controller/submitCustomLabel.d.ts.map +1 -0
  42. package/dist/types/Label/Controller/submitCustomLabel.test.d.ts +2 -0
  43. package/dist/types/Label/Controller/submitCustomLabel.test.d.ts.map +1 -0
  44. package/dist/types/Label/Controller/updateCustomLabel.d.ts +3 -0
  45. package/dist/types/Label/Controller/updateCustomLabel.d.ts.map +1 -0
  46. package/dist/types/Label/Controller/updateCustomLabel.test.d.ts +2 -0
  47. package/dist/types/Label/Controller/updateCustomLabel.test.d.ts.map +1 -0
  48. package/dist/types/Label/UC/SetCustomLabelUC.d.ts +3 -1
  49. package/dist/types/Label/UC/SetCustomLabelUC.d.ts.map +1 -1
  50. package/package.json +1 -1
@@ -133,6 +133,7 @@ class CalloutImp extends CalloutEntity {
133
133
  this.rootTransform.addChangeObserver(this.notifyOnChange);
134
134
  const labelAO = appObject.appObjectRepo.getOrCreate(myID + "_label");
135
135
  this.labelTransform = (0, Transform3D_1.makeTransform3D)(labelAO);
136
+ this.labelTransform.localRotation = core_1.Quaternion.FromYawPitchRoll(core_1.Angle.FromDegrees(180), core_1.Angle.FromDegrees(0), core_1.Angle.FromDegrees(0));
136
137
  this.labelTransform.addChangeObserver(this.notifyOnChange);
137
138
  }
138
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutEntity.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.ts"],"names":[],"mappings":";;;AA0FA,8CAEC;AA5FD,sCAUqB;AACrB,+DAA4D;AAC5D,kEAA+D;AAC/D,2EAGkD;AAClD,oEAG6C;AAC7C,wEAGgD;AAGnC,QAAA,oBAAoB,GAAW,GAAG,CAAC;AACnC,QAAA,oBAAoB,GAAW,GAAG,CAAC;AAgBhD,MAAsB,aAAc,SAAQ,sBAAe;IAGzD,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;;AAZH,sCA4CC;AA3CiB,kBAAI,GAAG,SAAS,CAAC;AA6CnC,SAAgB,iBAAiB,CAAC,SAAoB;IACpD,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAW,SAAQ,aAAa;IASpC,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI,CAAC,GAAW;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,a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,UAAU,GAAG,IAAI,mBAAY,CAChC;YACE,GAAG,EAAE,4BAAoB;YACzB,GAAG,EAAE,4BAAoB;YACzB,YAAY,EACV,4BAAoB;gBACpB,GAAG,GAAG,CAAC,4BAAoB,GAAG,4BAAoB,CAAC;SACtD,EACD,IAAI,CAAC,cAAc,CACpB,CAAC;QAEF,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAA,6BAAe,EAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,GAAG,IAAA,6BAAe,EAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import {\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo,\r\n Quaternion,\r\n QuaternionDTO,\r\n\r\n\r\n RangedNumber, Vector3,\r\n Vector3DTO\r\n} from \"@vived/core\";\r\nimport { Hideable } from \"../../Hideable/Entities/Hideable\";\r\nimport { LabelEntity } from \"../../Label/Entities/LabelEntity\";\r\nimport {\r\n OverlayColor,\r\n OverlayColorEnums\r\n} from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport {\r\n makeSelectable,\r\n Selectable\r\n} from \"../../Selection/Entities/Selectable\";\r\nimport {\r\n makeTransform3D,\r\n Transform3D\r\n} from \"../../Transform3D/Entities/Transform3D\";\r\nimport { CalloutRepo } from \"./CalloutRepo\";\r\n\r\nexport const CALLOUT_MINIMUM_SIZE: number = 0.3;\r\nexport const CALLOUT_MAXIMUM_SIZE: number = 1.3;\r\n\r\nexport type CalloutOffsetDirection = \"LEFT\" | \"RIGHT\" | \"UP\" | \"DOWN\";\r\n\r\nexport interface CalloutDTO {\r\n id: string;\r\n rootPosition: Vector3DTO;\r\n rootRotation: QuaternionDTO;\r\n labelPosition: Vector3DTO;\r\n size: number;\r\n parentID: string;\r\n label: string;\r\n defaultLabel: string;\r\n color: string;\r\n}\r\n\r\nexport abstract class CalloutEntity extends AppObjectEntity {\r\n static readonly type = \"CALLOUT\";\r\n\r\n static get(appObj: AppObject): CalloutEntity | undefined {\r\n return appObj.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): CalloutEntity | undefined {\r\n return appObjects.get(id)?.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n abstract get id(): string;\r\n abstract inRepo?: CalloutRepo;\r\n\r\n abstract readonly label: LabelEntity;\r\n abstract readonly rootTransform: Transform3D;\r\n abstract readonly labelTransform: Transform3D;\r\n abstract readonly hideable: Hideable;\r\n abstract readonly selectable: Selectable;\r\n abstract readonly overlayColor: OverlayColor;\r\n abstract readonly rangedSize: RangedNumber;\r\n\r\n abstract get size(): number;\r\n abstract set size(val: number);\r\n\r\n abstract get rootPosition(): Vector3;\r\n abstract set rootPosition(p: Vector3);\r\n\r\n abstract get rootRotation(): Quaternion;\r\n abstract set rootRotation(r: Quaternion);\r\n\r\n abstract get labelPosition(): Vector3;\r\n abstract set labelPosition(p: Vector3);\r\n\r\n abstract get labelRotation(): Quaternion;\r\n abstract set labelRotation(r: Quaternion);\r\n\r\n abstract get data(): CalloutDTO;\r\n abstract set data(dto: CalloutDTO);\r\n\r\n abstract get offsetDirection(): CalloutOffsetDirection;\r\n}\r\n\r\nexport function makeCalloutEntity(appObject: AppObject): CalloutEntity {\r\n return new CalloutImp(appObject);\r\n}\r\n\r\nclass CalloutImp extends CalloutEntity {\r\n readonly label: LabelEntity;\r\n readonly hideable: Hideable;\r\n readonly selectable: Selectable;\r\n readonly rootTransform: Transform3D;\r\n readonly labelTransform: Transform3D;\r\n readonly overlayColor: OverlayColor;\r\n readonly rangedSize: RangedNumber;\r\n\r\n get id() {\r\n return this.appObject.id;\r\n }\r\n\r\n get size(): number {\r\n return this.rangedSize.val;\r\n }\r\n set size(val: number) {\r\n this.rangedSize.val = val;\r\n }\r\n\r\n get rootPosition(): Vector3 {\r\n return this.rootTransform.localPosition;\r\n }\r\n set rootPosition(p: Vector3) {\r\n this.rootTransform.localPosition = p;\r\n }\r\n\r\n get rootRotation(): Quaternion {\r\n return this.rootTransform.localRotation;\r\n }\r\n set rootRotation(r: Quaternion) {\r\n this.rootTransform.localRotation = r;\r\n }\r\n\r\n get labelPosition(): Vector3 {\r\n return this.labelTransform.localPosition;\r\n }\r\n set labelPosition(p: Vector3) {\r\n this.labelTransform.localPosition = p;\r\n }\r\n\r\n get labelRotation(): Quaternion {\r\n return this.labelTransform.localRotation;\r\n }\r\n set labelRotation(r: Quaternion) {\r\n this.labelTransform.localRotation = r;\r\n }\r\n\r\n get offsetDirection(): CalloutOffsetDirection {\r\n const worldStartPos = this.rootTransform.worldPosition;\r\n const worldEndPos = this.labelTransform.worldPosition;\r\n const delta = Vector3.Subtract(worldEndPos, worldStartPos);\r\n\r\n let offsetDirection: CalloutOffsetDirection = \"LEFT\";\r\n if (Math.abs(delta.y) > Math.abs(delta.x)) {\r\n if (delta.y < 0) offsetDirection = \"DOWN\";\r\n else offsetDirection = \"UP\";\r\n } else {\r\n if (delta.x < 0) offsetDirection = \"LEFT\";\r\n else offsetDirection = \"RIGHT\";\r\n }\r\n\r\n return offsetDirection;\r\n }\r\n\r\n inRepo?: CalloutRepo;\r\n\r\n get data(): CalloutDTO {\r\n return {\r\n id: this.appObject.id,\r\n parentID: this.inRepo ? this.inRepo.appObject.id : \"\",\r\n rootPosition: this.rootPosition.dto,\r\n rootRotation: this.rootRotation.dto,\r\n labelPosition: this.labelPosition.dto,\r\n size: this.size,\r\n label: this.label.custom,\r\n defaultLabel: this.label.default,\r\n color: this.overlayColor.overlayColor,\r\n };\r\n }\r\n\r\n set data(dto: CalloutDTO) {\r\n this.rootPosition = Vector3.FromDTO(dto.rootPosition);\r\n this.rootRotation = Quaternion.FromDTO(dto.rootRotation);\r\n this.labelPosition = Vector3.FromDTO(dto.labelPosition);\r\n this.size = dto.size;\r\n this.label.custom = dto.label;\r\n this.label.default = dto.defaultLabel;\r\n const overlayColor = dto.color as OverlayColorEnums;\r\n this.overlayColor.overlayColor = overlayColor ?? OverlayColorEnums.WHITE;\r\n }\r\n\r\n dispose = () => {\r\n super.dispose();\r\n this.label.dispose();\r\n this.hideable.dispose();\r\n this.selectable.dispose();\r\n this.overlayColor.dispose();\r\n this.labelTransform.appObject.dispose();\r\n this.rootTransform.appObject.dispose();\r\n\r\n if (this.inRepo) {\r\n this.inRepo.removeForAppObject(this.appObject.id);\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, CalloutEntity.type);\r\n\r\n this.label = LabelEntity.addIfMissing(appObject);\r\n this.label.addChangeObserver(this.notifyOnChange);\r\n\r\n this.hideable = Hideable.addIfMissing(appObject);\r\n this.hideable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.overlayColor = OverlayColor.addIfMissing(appObject);\r\n this.overlayColor.addChangeObserver(this.notifyOnChange);\r\n\r\n this.selectable = makeSelectable(appObject);\r\n this.selectable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.rangedSize = new RangedNumber(\r\n {\r\n min: CALLOUT_MINIMUM_SIZE,\r\n max: CALLOUT_MAXIMUM_SIZE,\r\n initialValue:\r\n CALLOUT_MINIMUM_SIZE +\r\n 0.5 * (CALLOUT_MAXIMUM_SIZE - CALLOUT_MINIMUM_SIZE),\r\n },\r\n this.notifyOnChange\r\n );\r\n\r\n const myID = appObject.id;\r\n const rootAO = appObject.appObjectRepo.getOrCreate(myID + \"_root\");\r\n this.rootTransform = makeTransform3D(rootAO);\r\n this.rootTransform.addChangeObserver(this.notifyOnChange);\r\n\r\n const labelAO = appObject.appObjectRepo.getOrCreate(myID + \"_label\");\r\n this.labelTransform = makeTransform3D(labelAO);\r\n this.labelTransform.addChangeObserver(this.notifyOnChange);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CalloutEntity.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.ts"],"names":[],"mappings":";;;AA0FA,8CAEC;AA5FD,sCAUqB;AACrB,+DAA4D;AAC5D,kEAA+D;AAC/D,2EAGkD;AAClD,oEAG6C;AAC7C,wEAGgD;AAGnC,QAAA,oBAAoB,GAAW,GAAG,CAAC;AACnC,QAAA,oBAAoB,GAAW,GAAG,CAAC;AAgBhD,MAAsB,aAAc,SAAQ,sBAAe;IAGzD,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;;AAZH,sCA4CC;AA3CiB,kBAAI,GAAG,SAAS,CAAC;AA6CnC,SAAgB,iBAAiB,CAAC,SAAoB;IACpD,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAW,SAAQ,aAAa;IASpC,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI,CAAC,GAAW;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY;QACd,OA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AAC,CAAC;QAEvD,IAAI,CAAC,UAAU,GAAG,IAAI,mBAAY,CAChC;YACE,GAAG,EAAE,4BAAoB;YACzB,GAAG,EAAE,4BAAoB;YACzB,YAAY,EACV,4BAAoB;gBACpB,GAAG,GAAG,CAAC,4BAAoB,GAAG,4BAAoB,CAAC;SACtD,EACD,IAAI,CAAC,cAAc,CACpB,CAAC;QAEF,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAA,6BAAe,EAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,GAAG,IAAA,6BAAe,EAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,iBAAU,CAAC,gBAAgB,CAC7D,YAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EACtB,YAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EACpB,YAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CACrB,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import {\r\n Angle,\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo,\r\n Quaternion,\r\n QuaternionDTO,\r\n RangedNumber,\r\n Vector3,\r\n Vector3DTO,\r\n} from \"@vived/core\";\r\nimport { Hideable } from \"../../Hideable/Entities/Hideable\";\r\nimport { LabelEntity } from \"../../Label/Entities/LabelEntity\";\r\nimport {\r\n OverlayColor,\r\n OverlayColorEnums,\r\n} from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport {\r\n makeSelectable,\r\n Selectable,\r\n} from \"../../Selection/Entities/Selectable\";\r\nimport {\r\n makeTransform3D,\r\n Transform3D,\r\n} from \"../../Transform3D/Entities/Transform3D\";\r\nimport { CalloutRepo } from \"./CalloutRepo\";\r\n\r\nexport const CALLOUT_MINIMUM_SIZE: number = 0.3;\r\nexport const CALLOUT_MAXIMUM_SIZE: number = 1.3;\r\n\r\nexport type CalloutOffsetDirection = \"LEFT\" | \"RIGHT\" | \"UP\" | \"DOWN\";\r\n\r\nexport interface CalloutDTO {\r\n id: string;\r\n rootPosition: Vector3DTO;\r\n rootRotation: QuaternionDTO;\r\n labelPosition: Vector3DTO;\r\n size: number;\r\n parentID: string;\r\n label: string;\r\n defaultLabel: string;\r\n color: string;\r\n}\r\n\r\nexport abstract class CalloutEntity extends AppObjectEntity {\r\n static readonly type = \"CALLOUT\";\r\n\r\n static get(appObj: AppObject): CalloutEntity | undefined {\r\n return appObj.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): CalloutEntity | undefined {\r\n return appObjects.get(id)?.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n abstract get id(): string;\r\n abstract inRepo?: CalloutRepo;\r\n\r\n abstract readonly label: LabelEntity;\r\n abstract readonly rootTransform: Transform3D;\r\n abstract readonly labelTransform: Transform3D;\r\n abstract readonly hideable: Hideable;\r\n abstract readonly selectable: Selectable;\r\n abstract readonly overlayColor: OverlayColor;\r\n abstract readonly rangedSize: RangedNumber;\r\n\r\n abstract get size(): number;\r\n abstract set size(val: number);\r\n\r\n abstract get rootPosition(): Vector3;\r\n abstract set rootPosition(p: Vector3);\r\n\r\n abstract get rootRotation(): Quaternion;\r\n abstract set rootRotation(r: Quaternion);\r\n\r\n abstract get labelPosition(): Vector3;\r\n abstract set labelPosition(p: Vector3);\r\n\r\n abstract get labelRotation(): Quaternion;\r\n abstract set labelRotation(r: Quaternion);\r\n\r\n abstract get data(): CalloutDTO;\r\n abstract set data(dto: CalloutDTO);\r\n\r\n abstract get offsetDirection(): CalloutOffsetDirection;\r\n}\r\n\r\nexport function makeCalloutEntity(appObject: AppObject): CalloutEntity {\r\n return new CalloutImp(appObject);\r\n}\r\n\r\nclass CalloutImp extends CalloutEntity {\r\n readonly label: LabelEntity;\r\n readonly hideable: Hideable;\r\n readonly selectable: Selectable;\r\n readonly rootTransform: Transform3D;\r\n readonly labelTransform: Transform3D;\r\n readonly overlayColor: OverlayColor;\r\n readonly rangedSize: RangedNumber;\r\n\r\n get id() {\r\n return this.appObject.id;\r\n }\r\n\r\n get size(): number {\r\n return this.rangedSize.val;\r\n }\r\n set size(val: number) {\r\n this.rangedSize.val = val;\r\n }\r\n\r\n get rootPosition(): Vector3 {\r\n return this.rootTransform.localPosition;\r\n }\r\n set rootPosition(p: Vector3) {\r\n this.rootTransform.localPosition = p;\r\n }\r\n\r\n get rootRotation(): Quaternion {\r\n return this.rootTransform.localRotation;\r\n }\r\n set rootRotation(r: Quaternion) {\r\n this.rootTransform.localRotation = r;\r\n }\r\n\r\n get labelPosition(): Vector3 {\r\n return this.labelTransform.localPosition;\r\n }\r\n set labelPosition(p: Vector3) {\r\n this.labelTransform.localPosition = p;\r\n }\r\n\r\n get labelRotation(): Quaternion {\r\n return this.labelTransform.localRotation;\r\n }\r\n set labelRotation(r: Quaternion) {\r\n this.labelTransform.localRotation = r;\r\n }\r\n\r\n get offsetDirection(): CalloutOffsetDirection {\r\n const worldStartPos = this.rootTransform.worldPosition;\r\n const worldEndPos = this.labelTransform.worldPosition;\r\n const delta = Vector3.Subtract(worldEndPos, worldStartPos);\r\n\r\n let offsetDirection: CalloutOffsetDirection = \"LEFT\";\r\n if (Math.abs(delta.y) > Math.abs(delta.x)) {\r\n if (delta.y < 0) offsetDirection = \"DOWN\";\r\n else offsetDirection = \"UP\";\r\n } else {\r\n if (delta.x < 0) offsetDirection = \"LEFT\";\r\n else offsetDirection = \"RIGHT\";\r\n }\r\n\r\n return offsetDirection;\r\n }\r\n\r\n inRepo?: CalloutRepo;\r\n\r\n get data(): CalloutDTO {\r\n return {\r\n id: this.appObject.id,\r\n parentID: this.inRepo ? this.inRepo.appObject.id : \"\",\r\n rootPosition: this.rootPosition.dto,\r\n rootRotation: this.rootRotation.dto,\r\n labelPosition: this.labelPosition.dto,\r\n size: this.size,\r\n label: this.label.custom,\r\n defaultLabel: this.label.default,\r\n color: this.overlayColor.overlayColor,\r\n };\r\n }\r\n\r\n set data(dto: CalloutDTO) {\r\n this.rootPosition = Vector3.FromDTO(dto.rootPosition);\r\n this.rootRotation = Quaternion.FromDTO(dto.rootRotation);\r\n this.labelPosition = Vector3.FromDTO(dto.labelPosition);\r\n this.size = dto.size;\r\n this.label.custom = dto.label;\r\n this.label.default = dto.defaultLabel;\r\n const overlayColor = dto.color as OverlayColorEnums;\r\n this.overlayColor.overlayColor = overlayColor ?? OverlayColorEnums.WHITE;\r\n }\r\n\r\n dispose = () => {\r\n super.dispose();\r\n this.label.dispose();\r\n this.hideable.dispose();\r\n this.selectable.dispose();\r\n this.overlayColor.dispose();\r\n this.labelTransform.appObject.dispose();\r\n this.rootTransform.appObject.dispose();\r\n\r\n if (this.inRepo) {\r\n this.inRepo.removeForAppObject(this.appObject.id);\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, CalloutEntity.type);\r\n\r\n this.label = LabelEntity.addIfMissing(appObject);\r\n this.label.addChangeObserver(this.notifyOnChange);\r\n\r\n this.hideable = Hideable.addIfMissing(appObject);\r\n this.hideable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.overlayColor = OverlayColor.addIfMissing(appObject);\r\n this.overlayColor.addChangeObserver(this.notifyOnChange);\r\n\r\n this.selectable = makeSelectable(appObject);\r\n this.selectable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.rangedSize = new RangedNumber(\r\n {\r\n min: CALLOUT_MINIMUM_SIZE,\r\n max: CALLOUT_MAXIMUM_SIZE,\r\n initialValue:\r\n CALLOUT_MINIMUM_SIZE +\r\n 0.5 * (CALLOUT_MAXIMUM_SIZE - CALLOUT_MINIMUM_SIZE),\r\n },\r\n this.notifyOnChange\r\n );\r\n\r\n const myID = appObject.id;\r\n const rootAO = appObject.appObjectRepo.getOrCreate(myID + \"_root\");\r\n this.rootTransform = makeTransform3D(rootAO);\r\n this.rootTransform.addChangeObserver(this.notifyOnChange);\r\n\r\n const labelAO = appObject.appObjectRepo.getOrCreate(myID + \"_label\");\r\n this.labelTransform = makeTransform3D(labelAO);\r\n this.labelTransform.localRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(180),\r\n Angle.FromDegrees(0),\r\n Angle.FromDegrees(0)\r\n );\r\n this.labelTransform.addChangeObserver(this.notifyOnChange);\r\n }\r\n}\r\n"]}
@@ -114,7 +114,7 @@ describe("Callout Entity", () => {
114
114
  });
115
115
  it("Sets and gets the labelRotation", () => {
116
116
  const { callout, observer } = makeTestRig();
117
- expect(core_1.Quaternion.Close(callout.labelRotation, core_1.Quaternion.Identity())).toEqual(true);
117
+ expect(core_1.Quaternion.Close(callout.labelRotation, core_1.Quaternion.FromYawPitchRoll(core_1.Angle.FromDegrees(180), core_1.Angle.FromDegrees(0), core_1.Angle.FromDegrees(0)))).toEqual(true);
118
118
  const newQ = core_1.Quaternion.FromYawPitchRoll(core_1.Angle.FromDegrees(10), core_1.Angle.FromDegrees(20), core_1.Angle.FromDegrees(30));
119
119
  callout.labelRotation = newQ;
120
120
  expect(core_1.Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutEntity.test.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.test.ts"],"names":[],"mappings":";;AAAA,sCAA4E;AAC5E,2EAA6E;AAC7E,mDAAmE;AACnE,+CAAsD;AAEtD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,IAAA,wBAAi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AAG,EAAE;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,CAAC;QAElC,OAAO,CAAC,IAAI,GAAG;YACb,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,MAAM;YAChB,YAAY,EAAE,IAAI,cAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;YACtC,YAAY,EAAE,iBAAU,CAAC,gBAAgB,CACvC,YAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EACrB,YAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EACrB,YAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CACtB,CAAC,GAAG;YACL,aAAa,EAAE,IAAI,cAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;YACvC,YAAY,EAAE,eAAe;YAC7B,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,gCAAiB,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Angle, makeAppObjectRepo, Quaternion, Vector3 } from \"@vived/core\";\r\nimport { OverlayColorEnums } from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport { CalloutEntity, makeCalloutEntity } from \"./CalloutEntity\";\r\nimport { makeCalloutRepoEntity } from \"./CalloutRepo\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const calloutAO = appObjects.getOrCreate(\"calloutID\");\r\n const callout = makeCalloutEntity(calloutAO);\r\n const observer = jest.fn();\r\n callout.addChangeObserver(observer);\r\n\r\n const repoAO = appObjects.getOrCreate(\"repo\");\r\n const repo = makeCalloutRepoEntity(repoAO);\r\n repo.add(callout);\r\n callout.inRepo = repo;\r\n\r\n return { callout, appObjects, observer, repo };\r\n}\r\n\r\ndescribe(\"Callout Entity\", () => {\r\n it(\"Gets the entoty for the App Object\", () => {\r\n const { callout, appObjects } = makeTestRig();\r\n\r\n expect(CalloutEntity.getById(\"calloutID\", appObjects)).toEqual(callout);\r\n });\r\n\r\n it(\"Notifies when the Label changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n callout.label.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.label.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the hideable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.hideable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the hideable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.hideable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.hideable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the selectable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.selectable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the selectable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.selectable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.selectable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Removes itself from the repo\", () => {\r\n const { callout, repo } = makeTestRig();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(true);\r\n\r\n callout.dispose();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(false);\r\n });\r\n\r\n it(\"Notifies when the root transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.rootTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the root rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.rootTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the label transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.labelTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.labelTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.rootPosition).toEqual(Vector3.Zero());\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.rootTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.rootRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.rootRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.rootRotation, newQ)).toEqual(true);\r\n expect(Quaternion.Close(callout.rootTransform.localRotation, newQ)).toEqual(\r\n true\r\n );\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.labelPosition).toEqual(Vector3.Zero());\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.labelTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.labelRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.labelRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);\r\n expect(\r\n Quaternion.Close(callout.labelTransform.localRotation, newQ)\r\n ).toEqual(true);\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets the dto id\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.id).toEqual(\"calloutID\");\r\n });\r\n\r\n it(\"Sets the dto parent\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.parentID).toEqual(\"repo\");\r\n });\r\n\r\n it(\"Sets the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.rootPosition).toEqual(callout.rootPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n expect(callout.data.rootRotation).toEqual(callout.rootRotation.dto);\r\n });\r\n\r\n it(\"Sets the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.labelPosition).toEqual(callout.labelPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.custom = \"custom label\";\r\n\r\n expect(callout.data.label).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Sets the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.default = \"default label\";\r\n\r\n expect(callout.data.defaultLabel).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Sets the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.overlayColor.overlayColor = OverlayColorEnums.RED;\r\n\r\n expect(callout.data.color).toEqual(\"Red\");\r\n });\r\n\r\n it(\"Applies the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n });\r\n\r\n it(\"Applies the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.rootRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n )\r\n )\r\n ).toEqual(true);\r\n });\r\n\r\n it(\"Applies the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(4, 5, 6));\r\n });\r\n\r\n it(\"Applies the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.custom).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Applies the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.default).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Applies the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.overlayColor.overlayColor).toEqual(OverlayColorEnums.RED);\r\n });\r\n});\r\n"]}
1
+ {"version":3,"file":"CalloutEntity.test.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.test.ts"],"names":[],"mappings":";;AAAA,sCAA4E;AAC5E,2EAA6E;AAC7E,mDAAmE;AACnE,+CAAsD;AAEtD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,IAAA,wBAAiB,GAAE,CAAC;IAEvC,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,IAAA,iCAAiB,EAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAA,mCAAqB,EAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAEtB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC;AAED,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,o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,EAAE,eAAe;YAC7B,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,gCAAiB,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Angle, makeAppObjectRepo, Quaternion, Vector3 } from \"@vived/core\";\r\nimport { OverlayColorEnums } from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport { CalloutEntity, makeCalloutEntity } from \"./CalloutEntity\";\r\nimport { makeCalloutRepoEntity } from \"./CalloutRepo\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const calloutAO = appObjects.getOrCreate(\"calloutID\");\r\n const callout = makeCalloutEntity(calloutAO);\r\n const observer = jest.fn();\r\n callout.addChangeObserver(observer);\r\n\r\n const repoAO = appObjects.getOrCreate(\"repo\");\r\n const repo = makeCalloutRepoEntity(repoAO);\r\n repo.add(callout);\r\n callout.inRepo = repo;\r\n\r\n return { callout, appObjects, observer, repo };\r\n}\r\n\r\ndescribe(\"Callout Entity\", () => {\r\n it(\"Gets the entoty for the App Object\", () => {\r\n const { callout, appObjects } = makeTestRig();\r\n\r\n expect(CalloutEntity.getById(\"calloutID\", appObjects)).toEqual(callout);\r\n });\r\n\r\n it(\"Notifies when the Label changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n callout.label.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.label.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the hideable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.hideable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the hideable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.hideable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.hideable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the selectable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.selectable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the selectable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.selectable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.selectable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Removes itself from the repo\", () => {\r\n const { callout, repo } = makeTestRig();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(true);\r\n\r\n callout.dispose();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(false);\r\n });\r\n\r\n it(\"Notifies when the root transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.rootTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the root rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.rootTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the label transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.labelTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.labelTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.rootPosition).toEqual(Vector3.Zero());\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.rootTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.rootRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.rootRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.rootRotation, newQ)).toEqual(true);\r\n expect(Quaternion.Close(callout.rootTransform.localRotation, newQ)).toEqual(\r\n true\r\n );\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.labelPosition).toEqual(Vector3.Zero());\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.labelTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.labelRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(180),\r\n Angle.FromDegrees(0),\r\n Angle.FromDegrees(0)\r\n )\r\n )\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.labelRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);\r\n expect(\r\n Quaternion.Close(callout.labelTransform.localRotation, newQ)\r\n ).toEqual(true);\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets the dto id\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.id).toEqual(\"calloutID\");\r\n });\r\n\r\n it(\"Sets the dto parent\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.parentID).toEqual(\"repo\");\r\n });\r\n\r\n it(\"Sets the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.rootPosition).toEqual(callout.rootPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n expect(callout.data.rootRotation).toEqual(callout.rootRotation.dto);\r\n });\r\n\r\n it(\"Sets the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.labelPosition).toEqual(callout.labelPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.custom = \"custom label\";\r\n\r\n expect(callout.data.label).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Sets the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.default = \"default label\";\r\n\r\n expect(callout.data.defaultLabel).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Sets the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.overlayColor.overlayColor = OverlayColorEnums.RED;\r\n\r\n expect(callout.data.color).toEqual(\"Red\");\r\n });\r\n\r\n it(\"Applies the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n });\r\n\r\n it(\"Applies the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.rootRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n )\r\n )\r\n ).toEqual(true);\r\n });\r\n\r\n it(\"Applies the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(4, 5, 6));\r\n });\r\n\r\n it(\"Applies the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.custom).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Applies the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.default).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Applies the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.overlayColor.overlayColor).toEqual(OverlayColorEnums.RED);\r\n });\r\n});\r\n"]}
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ClearCustomLabel"), exports);
18
- __exportStar(require("./SetCustomLabel"), exports);
18
+ __exportStar(require("./updateCustomLabel"), exports);
19
+ __exportStar(require("./submitCustomLabel"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mDAAiC","sourcesContent":["export * from \"./ClearCustomLabel\";\r\nexport * from \"./SetCustomLabel\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC","sourcesContent":["export * from \"./ClearCustomLabel\";\r\nexport * from \"./updateCustomLabel\";\r\nexport * from \"./submitCustomLabel\";\r\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submitCustomLabel = submitCustomLabel;
4
+ const SetCustomLabelUC_1 = require("../UC/SetCustomLabelUC");
5
+ function submitCustomLabel(appObjectID, appObjectRepo) {
6
+ const appObject = appObjectRepo.get(appObjectID);
7
+ if (!appObject) {
8
+ appObjectRepo.submitWarning("submitCustomLabel Contorller", "App Object not found");
9
+ return;
10
+ }
11
+ const setCustomLabelUC = SetCustomLabelUC_1.SetCustomLabelUC.get(appObject);
12
+ if (!setCustomLabelUC) {
13
+ appObjectRepo.submitWarning("submitCustomLabel Controller", "SetCustomLabelUC was not added to App Object");
14
+ return;
15
+ }
16
+ setCustomLabelUC.submit();
17
+ }
18
+ //# sourceMappingURL=submitCustomLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.js","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.ts"],"names":[],"mappings":";;AAGA,8CAuBC;AAzBD,6DAA0D;AAE1D,SAAgB,iBAAiB,CAC/B,WAAmB,EACnB,aAA4B;IAE5B,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,sBAAsB,CACvB,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,mCAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,8CAA8C,CAC/C,CAAC;QACF,OAAO;IACT,CAAC;IAED,gBAAgB,CAAC,MAAM,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["import { AppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\n\r\nexport function submitCustomLabel(\r\n appObjectID: string,\r\n appObjectRepo: AppObjectRepo\r\n) {\r\n const appObject = appObjectRepo.get(appObjectID);\r\n if (!appObject) {\r\n appObjectRepo.submitWarning(\r\n \"submitCustomLabel Contorller\",\r\n \"App Object not found\"\r\n );\r\n return;\r\n }\r\n\r\n const setCustomLabelUC = SetCustomLabelUC.get(appObject);\r\n if (!setCustomLabelUC) {\r\n appObjectRepo.submitWarning(\r\n \"submitCustomLabel Controller\",\r\n \"SetCustomLabelUC was not added to App Object\"\r\n );\r\n return;\r\n }\r\n\r\n setCustomLabelUC.submit();\r\n}\r\n"]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@vived/core");
4
+ const SetCustomLabelUC_1 = require("../UC/SetCustomLabelUC");
5
+ const submitCustomLabel_1 = require("./submitCustomLabel");
6
+ function makeTestRig() {
7
+ const appObjects = (0, core_1.makeAppObjectRepo)();
8
+ const mockSubmitWarning = jest.fn();
9
+ appObjects.submitWarning = mockSubmitWarning;
10
+ const ao = appObjects.getOrCreate("App Object ID");
11
+ const clearCustomLabelUC = new SetCustomLabelUC_1.SetCustomLabelUC(ao);
12
+ const mockSubmitCustomLabel = jest.fn();
13
+ clearCustomLabelUC.submit = mockSubmitCustomLabel;
14
+ return {
15
+ appObjects,
16
+ ao,
17
+ mockSubmitWarning,
18
+ mockSubmitCustomLabel,
19
+ };
20
+ }
21
+ describe("Submit Custom Label Controller", () => {
22
+ it("Calls Submit Custom Label method", () => {
23
+ const { appObjects, ao, mockSubmitCustomLabel } = makeTestRig();
24
+ (0, submitCustomLabel_1.submitCustomLabel)(ao.id, appObjects);
25
+ expect(mockSubmitCustomLabel).toHaveBeenCalled();
26
+ });
27
+ it("Submits warning if App Object is not found", () => {
28
+ const { appObjects, mockSubmitWarning } = makeTestRig();
29
+ (0, submitCustomLabel_1.submitCustomLabel)("TEST AO", appObjects);
30
+ expect(mockSubmitWarning).toHaveBeenCalled();
31
+ });
32
+ it("Submits warning if SetCustomLabel UC was not added", () => {
33
+ const { appObjects, mockSubmitWarning } = makeTestRig();
34
+ const ao = appObjects.getOrCreate("TEST AO");
35
+ (0, submitCustomLabel_1.submitCustomLabel)(ao.id, appObjects);
36
+ expect(mockSubmitWarning).toHaveBeenCalled();
37
+ });
38
+ });
39
+ //# sourceMappingURL=submitCustomLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.test.js","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.test.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAChD,6DAA0D;AAC1D,2DAAwD;AAExD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,IAAA,wBAAiB,GAAE,CAAC;IAEvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACpC,UAAU,CAAC,aAAa,GAAG,iBAAiB,CAAC;IAE7C,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L,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\nimport { submitCustomLabel } from \"./submitCustomLabel\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n const ao = appObjects.getOrCreate(\"App Object ID\");\r\n\r\n const clearCustomLabelUC = new SetCustomLabelUC(ao);\r\n const mockSubmitCustomLabel = jest.fn();\r\n clearCustomLabelUC.submit = mockSubmitCustomLabel;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockSubmitWarning,\r\n mockSubmitCustomLabel,\r\n };\r\n}\r\n\r\ndescribe(\"Submit Custom Label Controller\", () => {\r\n it(\"Calls Submit Custom Label method\", () => {\r\n const { appObjects, ao, mockSubmitCustomLabel } = makeTestRig();\r\n\r\n submitCustomLabel(ao.id, appObjects);\r\n\r\n expect(mockSubmitCustomLabel).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if App Object is not found\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n\r\n submitCustomLabel(\"TEST AO\", appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if SetCustomLabel UC was not added\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"TEST AO\");\r\n\r\n submitCustomLabel(ao.id, appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCustomLabel = updateCustomLabel;
4
+ const SetCustomLabelUC_1 = require("../UC/SetCustomLabelUC");
5
+ function updateCustomLabel(customLabel, appObjectID, appObjectRepo) {
6
+ const appObject = appObjectRepo.get(appObjectID);
7
+ if (!appObject) {
8
+ appObjectRepo.submitWarning("updateCustomLabel Contorller", "App Object not found");
9
+ return;
10
+ }
11
+ const setCustomLabelUC = SetCustomLabelUC_1.SetCustomLabelUC.get(appObject);
12
+ if (!setCustomLabelUC) {
13
+ appObjectRepo.submitWarning("updateCustomLabel Controller", "SetCustomLabelUC was not added to App Object");
14
+ return;
15
+ }
16
+ setCustomLabelUC.update(customLabel);
17
+ }
18
+ //# sourceMappingURL=updateCustomLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.js","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.ts"],"names":[],"mappings":";;AAGA,8CAwBC;AA1BD,6DAA0D;AAE1D,SAAgB,iBAAiB,CAC/B,WAAmB,EACnB,WAAmB,EACnB,aAA4B;IAE5B,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,sBAAsB,CACvB,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,mCAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,8CAA8C,CAC/C,CAAC;QACF,OAAO;IACT,CAAC;IAED,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import { AppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\n\r\nexport function updateCustomLabel(\r\n customLabel: string,\r\n appObjectID: string,\r\n appObjectRepo: AppObjectRepo\r\n) {\r\n const appObject = appObjectRepo.get(appObjectID);\r\n if (!appObject) {\r\n appObjectRepo.submitWarning(\r\n \"updateCustomLabel Contorller\",\r\n \"App Object not found\"\r\n );\r\n return;\r\n }\r\n\r\n const setCustomLabelUC = SetCustomLabelUC.get(appObject);\r\n if (!setCustomLabelUC) {\r\n appObjectRepo.submitWarning(\r\n \"updateCustomLabel Controller\",\r\n \"SetCustomLabelUC was not added to App Object\"\r\n );\r\n return;\r\n }\r\n\r\n setCustomLabelUC.update(customLabel);\r\n}\r\n"]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@vived/core");
4
+ const SetCustomLabelUC_1 = require("../UC/SetCustomLabelUC");
5
+ const updateCustomLabel_1 = require("./updateCustomLabel");
6
+ function makeTestRig() {
7
+ const appObjects = (0, core_1.makeAppObjectRepo)();
8
+ const mockSubmitWarning = jest.fn();
9
+ appObjects.submitWarning = mockSubmitWarning;
10
+ const ao = appObjects.getOrCreate("App Object ID");
11
+ const clearCustomLabelUC = new SetCustomLabelUC_1.SetCustomLabelUC(ao);
12
+ const mockUpdateCustomLabel = jest.fn();
13
+ clearCustomLabelUC.update = mockUpdateCustomLabel;
14
+ return {
15
+ appObjects,
16
+ ao,
17
+ mockSubmitWarning,
18
+ mockUpdateCustomLabel,
19
+ };
20
+ }
21
+ describe("Update Custom Label Controller", () => {
22
+ it("Calls Set Custom Label method", () => {
23
+ const { appObjects, ao, mockUpdateCustomLabel } = makeTestRig();
24
+ (0, updateCustomLabel_1.updateCustomLabel)("custom", ao.id, appObjects);
25
+ expect(mockUpdateCustomLabel).toHaveBeenCalled();
26
+ });
27
+ it("Submits warning if App Object is not found", () => {
28
+ const { appObjects, mockSubmitWarning } = makeTestRig();
29
+ (0, updateCustomLabel_1.updateCustomLabel)("custom", "TEST AO", appObjects);
30
+ expect(mockSubmitWarning).toHaveBeenCalled();
31
+ });
32
+ it("Submits warning if SetCustomLabel UC was not added", () => {
33
+ const { appObjects, mockSubmitWarning } = makeTestRig();
34
+ const ao = appObjects.getOrCreate("TEST AO");
35
+ (0, updateCustomLabel_1.updateCustomLabel)("custom", ao.id, appObjects);
36
+ expect(mockSubmitWarning).toHaveBeenCalled();
37
+ });
38
+ });
39
+ //# sourceMappingURL=updateCustomLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.test.js","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.test.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAChD,6DAA0D;AAC1D,2DAAwD;AAExD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,IAAA,wBAAiB,GAAE,CAAC;IAEvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACpC,UAAU,CAAC,aAAa,GAAG,iBAAiB,CAAC;IAE7C,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAEnD,MAAM,kBAAkB,GAAG,IAAI,mCAAgB,CAAC,EAAE,CAAC,CAAC;IACpD,MAAM,qBAAqB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACxC,kBAAkB,CAAC,MAAM,GAAG,qBAAqB,CAAC;IAElD,OAAO;QACL,UAAU;QACV,EAAE;QACF,iBAAiB;QACjB,qBAAqB;KACtB,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,qBAAqB,EAAE,GAAG,WAAW,EAAE,CAAC;QAEhE,IAAA,qCAAiB,EAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAE/C,MAAM,CAAC,qBAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,WAAW,EAAE,CAAC;QAExD,IAAA,qCAAiB,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAEnD,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,WAAW,EAAE,CAAC;QACxD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE7C,IAAA,qCAAiB,EAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAE/C,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\nimport { updateCustomLabel } from \"./updateCustomLabel\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n const ao = appObjects.getOrCreate(\"App Object ID\");\r\n\r\n const clearCustomLabelUC = new SetCustomLabelUC(ao);\r\n const mockUpdateCustomLabel = jest.fn();\r\n clearCustomLabelUC.update = mockUpdateCustomLabel;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockSubmitWarning,\r\n mockUpdateCustomLabel,\r\n };\r\n}\r\n\r\ndescribe(\"Update Custom Label Controller\", () => {\r\n it(\"Calls Set Custom Label method\", () => {\r\n const { appObjects, ao, mockUpdateCustomLabel } = makeTestRig();\r\n\r\n updateCustomLabel(\"custom\", ao.id, appObjects);\r\n\r\n expect(mockUpdateCustomLabel).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if App Object is not found\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n\r\n updateCustomLabel(\"custom\", \"TEST AO\", appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if SetCustomLabel UC was not added\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"TEST AO\");\r\n\r\n updateCustomLabel(\"custom\", ao.id, appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -11,16 +11,26 @@ class SetCustomLabelUC extends core_1.AppObjectUC {
11
11
  }
12
12
  constructor(appObject) {
13
13
  super(appObject, SetCustomLabelUC.type);
14
- this.setCustomLabel = (customLabel) => {
14
+ this.update = (customLabel) => {
15
15
  if (!this.label) {
16
16
  this.warn("[SetCustomLabelUC] Unable to get Entity");
17
17
  return;
18
18
  }
19
- const prevLabel = this.label.custom;
20
19
  this.label.custom = customLabel;
21
- new SetCustomLabelUndoRedo_1.SetCustomLabelUndoRedo(prevLabel, customLabel, this.appObject);
22
20
  (0, Dispatcher_1.dispatchStateChange)(this.appObjects);
23
21
  };
22
+ this.submit = () => {
23
+ if (!this.label) {
24
+ this.warn("[SetCustomLabelUC] Unable to get Entity");
25
+ return;
26
+ }
27
+ if (this.localCustomLabel !== undefined) {
28
+ const prevLabel = this.localCustomLabel;
29
+ new SetCustomLabelUndoRedo_1.SetCustomLabelUndoRedo(prevLabel, this.label.custom, this.appObject);
30
+ this.localCustomLabel = this.label.display;
31
+ }
32
+ };
33
+ this.localCustomLabel = this.label?.display;
24
34
  }
25
35
  static get(appObj) {
26
36
  return appObj.getComponent(this.type);
@@ -1 +1 @@
1
- {"version":3,"file":"SetCustomLabelUC.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":";;;AAAA,sCAAqD;AACrD,iDAAuD;AACvD,0CAA0C;AAC1C,qEAAkE;AAElE,MAAa,gBAAiB,SAAQ,kBAAW;IAG/C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,uBAAuB,CAAc,sBAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAeD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAd1C,mBAAc,GAAG,CAAC,WAAmB,EAAE,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;YAEhC,IAAI,+CAAsB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YACnE,IAAA,gCAAmB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC;IAIF,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAmB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;;AA1BH,4CA2BC;AA1BiB,qBAAI,GAAG,kBAAkB,AAArB,CAAsB","sourcesContent":["import { AppObject, AppObjectUC } from \"@vived/core\";\r\nimport { dispatchStateChange } from \"../../Dispatcher\";\r\nimport { LabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUndoRedo } from \"./SetCustomLabelUndoRedo\";\r\n\r\nexport class SetCustomLabelUC extends AppObjectUC {\r\n static readonly type = \"SetCustomLabelUC\";\r\n\r\n private get label() {\r\n return this.getCachedLocalComponent<LabelEntity>(LabelEntity.type);\r\n }\r\n\r\n setCustomLabel = (customLabel: string) => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n\r\n const prevLabel = this.label.custom;\r\n this.label.custom = customLabel;\r\n\r\n new SetCustomLabelUndoRedo(prevLabel, customLabel, this.appObject);\r\n dispatchStateChange(this.appObjects);\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SetCustomLabelUC.type);\r\n }\r\n\r\n static get(appObj: AppObject): SetCustomLabelUC | undefined {\r\n return appObj.getComponent<SetCustomLabelUC>(this.type);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SetCustomLabelUC.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":";;;AAAA,sCAAqD;AACrD,iDAAuD;AACvD,0CAA0C;AAC1C,qEAAkE;AAElE,MAAa,gBAAiB,SAAQ,kBAAW;IAK/C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,uBAAuB,CAAc,sBAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IA0BD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAzB1C,WAAM,GAAG,CAAC,WAAmB,EAAE,EAAE;YAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;YAChC,IAAA,gCAAmB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,WAAM,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACxC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;gBAExC,IAAI,+CAAsB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBAEzE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC;QAKA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAmB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;;AAzCH,4CA0CC;AAzCiB,qBAAI,GAAG,kBAAkB,AAArB,CAAsB","sourcesContent":["import { AppObject, AppObjectUC } from \"@vived/core\";\r\nimport { dispatchStateChange } from \"../../Dispatcher\";\r\nimport { LabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUndoRedo } from \"./SetCustomLabelUndoRedo\";\r\n\r\nexport class SetCustomLabelUC extends AppObjectUC {\r\n static readonly type = \"SetCustomLabelUC\";\r\n\r\n private localCustomLabel?: string;\r\n\r\n private get label() {\r\n return this.getCachedLocalComponent<LabelEntity>(LabelEntity.type);\r\n }\r\n\r\n update = (customLabel: string) => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n this.label.custom = customLabel;\r\n dispatchStateChange(this.appObjects);\r\n };\r\n\r\n submit = () => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n\r\n if (this.localCustomLabel !== undefined) {\r\n const prevLabel = this.localCustomLabel;\r\n\r\n new SetCustomLabelUndoRedo(prevLabel, this.label.custom, this.appObject);\r\n\r\n this.localCustomLabel = this.label.display;\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SetCustomLabelUC.type);\r\n\r\n this.localCustomLabel = this.label?.display;\r\n }\r\n\r\n static get(appObj: AppObject): SetCustomLabelUC | undefined {\r\n return appObj.getComponent<SetCustomLabelUC>(this.type);\r\n }\r\n}\r\n"]}
@@ -28,24 +28,32 @@ describe("Set Custom Label UC", () => {
28
28
  it("Sets custom label", () => {
29
29
  const { label, setCustomLabelUC } = makeTestRig();
30
30
  label.custom = "";
31
- setCustomLabelUC.setCustomLabel("custom");
31
+ setCustomLabelUC.update("custom");
32
32
  expect(label.custom).toEqual("custom");
33
33
  });
34
34
  it("Submits warning if label entity was not added to App Object", () => {
35
35
  const { appObjects, mockSubmitWarning } = makeTestRig();
36
36
  const ao = appObjects.getOrCreate("testAO");
37
37
  const clearCustomLabel = new SetCustomLabelUC_1.SetCustomLabelUC(ao);
38
- clearCustomLabel.setCustomLabel("custom");
39
- expect(mockSubmitWarning).toHaveBeenCalledTimes(2);
38
+ clearCustomLabel.update("custom");
39
+ expect(mockSubmitWarning).toHaveBeenCalledTimes(3);
40
40
  });
41
41
  it("Dispatches state chagne when clear custom label", () => {
42
- const { label, setCustomLabelUC, mockDispatcher } = makeTestRig();
43
- setCustomLabelUC.setCustomLabel("custom");
42
+ const { setCustomLabelUC, mockDispatcher } = makeTestRig();
43
+ setCustomLabelUC.update("custom");
44
44
  expect(mockDispatcher.doDispatch).toHaveBeenCalled();
45
45
  });
46
46
  it("Submits and undo", () => {
47
+ const { setCustomLabelUC, mockUndo } = makeTestRig();
48
+ setCustomLabelUC.update("custom");
49
+ setCustomLabelUC.submit();
50
+ expect(mockUndo.submitAction).toHaveBeenCalled();
51
+ });
52
+ it("Submits undo operation with correct previous and current labels", () => {
47
53
  const { label, setCustomLabelUC, mockUndo } = makeTestRig();
48
- setCustomLabelUC.setCustomLabel("custom");
54
+ label.custom = "initial";
55
+ setCustomLabelUC.update("custom");
56
+ setCustomLabelUC.submit();
49
57
  expect(mockUndo.submitAction).toHaveBeenCalled();
50
58
  });
51
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SetCustomLabelUC.test.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.test.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAChD,4FAAy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CAAgB,CAAC,EAAE,CAAC,CAAC;QAClD,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;QAElE,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;QAE5D,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { MockDispatchStateChange } from \"../../Dispatcher/Mocks/MockDispatchStateChange\";\r\nimport { MockUndoRedo } from \"../../UndoRedo/Mocks/MockUndoRedo\";\r\nimport { makeLabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUC } from \"./SetCustomLabelUC\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = appObjects.getOrCreate(\"App\");\r\n\r\n const mockUndo = new MockUndoRedo(ao);\r\n const mockDispatcher = new MockDispatchStateChange(ao);\r\n\r\n const label = makeLabelEntity(ao);\r\n const setCustomLabelUC = new SetCustomLabelUC(ao);\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockUndo,\r\n mockDispatcher,\r\n label,\r\n setCustomLabelUC,\r\n mockSubmitWarning,\r\n };\r\n}\r\n\r\ndescribe(\"Set Custom Label UC\", () => {\r\n it(\"Sets custom label\", () => {\r\n const { label, setCustomLabelUC } = makeTestRig();\r\n\r\n label.custom = \"\";\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(label.custom).toEqual(\"custom\");\r\n });\r\n\r\n it(\"Submits warning if label entity was not added to App Object\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"testAO\");\r\n\r\n const clearCustomLabel = new SetCustomLabelUC(ao);\r\n clearCustomLabel.setCustomLabel(\"custom\");\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalledTimes(2);\r\n });\r\n\r\n it(\"Dispatches state chagne when clear custom label\", () => {\r\n const { label, setCustomLabelUC, mockDispatcher } = makeTestRig();\r\n\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(mockDispatcher.doDispatch).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits and undo\", () => {\r\n const { label, setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
1
+ {"version":3,"file":"SetCustomLabelUC.test.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.test.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAChD,4FAAyF;AACzF,oEAAiE;AACjE,0CAA8C;AAC9C,yDAAsD;AAEtD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,IAAA,wBAAiB,GAAE,CAAC;IAEvC,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,IAAI,2BAAY,CAAC,EAAE,CAAC,C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AgB,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;QAE3D,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAElC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;QAErD,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAE1B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;QAE5D,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QACzB,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAE1B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { MockDispatchStateChange } from \"../../Dispatcher/Mocks/MockDispatchStateChange\";\r\nimport { MockUndoRedo } from \"../../UndoRedo/Mocks/MockUndoRedo\";\r\nimport { makeLabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUC } from \"./SetCustomLabelUC\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = appObjects.getOrCreate(\"App\");\r\n\r\n const mockUndo = new MockUndoRedo(ao);\r\n const mockDispatcher = new MockDispatchStateChange(ao);\r\n\r\n const label = makeLabelEntity(ao);\r\n const setCustomLabelUC = new SetCustomLabelUC(ao);\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockUndo,\r\n mockDispatcher,\r\n label,\r\n setCustomLabelUC,\r\n mockSubmitWarning,\r\n };\r\n}\r\n\r\ndescribe(\"Set Custom Label UC\", () => {\r\n it(\"Sets custom label\", () => {\r\n const { label, setCustomLabelUC } = makeTestRig();\r\n\r\n label.custom = \"\";\r\n setCustomLabelUC.update(\"custom\");\r\n\r\n expect(label.custom).toEqual(\"custom\");\r\n });\r\n\r\n it(\"Submits warning if label entity was not added to App Object\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"testAO\");\r\n\r\n const clearCustomLabel = new SetCustomLabelUC(ao);\r\n clearCustomLabel.update(\"custom\");\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalledTimes(3);\r\n });\r\n\r\n it(\"Dispatches state chagne when clear custom label\", () => {\r\n const { setCustomLabelUC, mockDispatcher } = makeTestRig();\r\n\r\n setCustomLabelUC.update(\"custom\");\r\n\r\n expect(mockDispatcher.doDispatch).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits and undo\", () => {\r\n const { setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n setCustomLabelUC.update(\"custom\");\r\n setCustomLabelUC.submit();\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits undo operation with correct previous and current labels\", () => {\r\n const { label, setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n label.custom = \"initial\";\r\n setCustomLabelUC.update(\"custom\");\r\n setCustomLabelUC.submit();\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -1,9 +1,9 @@
1
- import { AppObjectEntity, Quaternion, RangedNumber, Vector3 } from "@vived/core";
1
+ import { Angle, AppObjectEntity, Quaternion, RangedNumber, Vector3, } from "@vived/core";
2
2
  import { Hideable } from "../../Hideable/Entities/Hideable";
3
3
  import { LabelEntity } from "../../Label/Entities/LabelEntity";
4
- import { OverlayColor, OverlayColorEnums } from "../../OverlayColor/Entities/OverlayColor";
5
- import { makeSelectable } from "../../Selection/Entities/Selectable";
6
- import { makeTransform3D } from "../../Transform3D/Entities/Transform3D";
4
+ import { OverlayColor, OverlayColorEnums, } from "../../OverlayColor/Entities/OverlayColor";
5
+ import { makeSelectable, } from "../../Selection/Entities/Selectable";
6
+ import { makeTransform3D, } from "../../Transform3D/Entities/Transform3D";
7
7
  export const CALLOUT_MINIMUM_SIZE = 0.3;
8
8
  export const CALLOUT_MAXIMUM_SIZE = 1.3;
9
9
  export class CalloutEntity extends AppObjectEntity {
@@ -128,6 +128,7 @@ class CalloutImp extends CalloutEntity {
128
128
  this.rootTransform.addChangeObserver(this.notifyOnChange);
129
129
  const labelAO = appObject.appObjectRepo.getOrCreate(myID + "_label");
130
130
  this.labelTransform = makeTransform3D(labelAO);
131
+ this.labelTransform.localRotation = Quaternion.FromYawPitchRoll(Angle.FromDegrees(180), Angle.FromDegrees(0), Angle.FromDegrees(0));
131
132
  this.labelTransform.addChangeObserver(this.notifyOnChange);
132
133
  }
133
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutEntity.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,UAAU,EAIV,YAAY,EAAE,OAAO,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,iBAAiB,EAClB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,cAAc,EAEf,MAAM,qCAAqC,CAAC;AAC7C,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AC,IAAI,GAAG,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import {\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo,\r\n Quaternion,\r\n QuaternionDTO,\r\n\r\n\r\n RangedNumber, Vector3,\r\n Vector3DTO\r\n} from \"@vived/core\";\r\nimport { Hideable } from \"../../Hideable/Entities/Hideable\";\r\nimport { LabelEntity } from \"../../Label/Entities/LabelEntity\";\r\nimport {\r\n OverlayColor,\r\n OverlayColorEnums\r\n} from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport {\r\n makeSelectable,\r\n Selectable\r\n} from \"../../Selection/Entities/Selectable\";\r\nimport {\r\n makeTransform3D,\r\n Transform3D\r\n} from \"../../Transform3D/Entities/Transform3D\";\r\nimport { CalloutRepo } from \"./CalloutRepo\";\r\n\r\nexport const CALLOUT_MINIMUM_SIZE: number = 0.3;\r\nexport const CALLOUT_MAXIMUM_SIZE: number = 1.3;\r\n\r\nexport type CalloutOffsetDirection = \"LEFT\" | \"RIGHT\" | \"UP\" | \"DOWN\";\r\n\r\nexport interface CalloutDTO {\r\n id: string;\r\n rootPosition: Vector3DTO;\r\n rootRotation: QuaternionDTO;\r\n labelPosition: Vector3DTO;\r\n size: number;\r\n parentID: string;\r\n label: string;\r\n defaultLabel: string;\r\n color: string;\r\n}\r\n\r\nexport abstract class CalloutEntity extends AppObjectEntity {\r\n static readonly type = \"CALLOUT\";\r\n\r\n static get(appObj: AppObject): CalloutEntity | undefined {\r\n return appObj.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): CalloutEntity | undefined {\r\n return appObjects.get(id)?.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n abstract get id(): string;\r\n abstract inRepo?: CalloutRepo;\r\n\r\n abstract readonly label: LabelEntity;\r\n abstract readonly rootTransform: Transform3D;\r\n abstract readonly labelTransform: Transform3D;\r\n abstract readonly hideable: Hideable;\r\n abstract readonly selectable: Selectable;\r\n abstract readonly overlayColor: OverlayColor;\r\n abstract readonly rangedSize: RangedNumber;\r\n\r\n abstract get size(): number;\r\n abstract set size(val: number);\r\n\r\n abstract get rootPosition(): Vector3;\r\n abstract set rootPosition(p: Vector3);\r\n\r\n abstract get rootRotation(): Quaternion;\r\n abstract set rootRotation(r: Quaternion);\r\n\r\n abstract get labelPosition(): Vector3;\r\n abstract set labelPosition(p: Vector3);\r\n\r\n abstract get labelRotation(): Quaternion;\r\n abstract set labelRotation(r: Quaternion);\r\n\r\n abstract get data(): CalloutDTO;\r\n abstract set data(dto: CalloutDTO);\r\n\r\n abstract get offsetDirection(): CalloutOffsetDirection;\r\n}\r\n\r\nexport function makeCalloutEntity(appObject: AppObject): CalloutEntity {\r\n return new CalloutImp(appObject);\r\n}\r\n\r\nclass CalloutImp extends CalloutEntity {\r\n readonly label: LabelEntity;\r\n readonly hideable: Hideable;\r\n readonly selectable: Selectable;\r\n readonly rootTransform: Transform3D;\r\n readonly labelTransform: Transform3D;\r\n readonly overlayColor: OverlayColor;\r\n readonly rangedSize: RangedNumber;\r\n\r\n get id() {\r\n return this.appObject.id;\r\n }\r\n\r\n get size(): number {\r\n return this.rangedSize.val;\r\n }\r\n set size(val: number) {\r\n this.rangedSize.val = val;\r\n }\r\n\r\n get rootPosition(): Vector3 {\r\n return this.rootTransform.localPosition;\r\n }\r\n set rootPosition(p: Vector3) {\r\n this.rootTransform.localPosition = p;\r\n }\r\n\r\n get rootRotation(): Quaternion {\r\n return this.rootTransform.localRotation;\r\n }\r\n set rootRotation(r: Quaternion) {\r\n this.rootTransform.localRotation = r;\r\n }\r\n\r\n get labelPosition(): Vector3 {\r\n return this.labelTransform.localPosition;\r\n }\r\n set labelPosition(p: Vector3) {\r\n this.labelTransform.localPosition = p;\r\n }\r\n\r\n get labelRotation(): Quaternion {\r\n return this.labelTransform.localRotation;\r\n }\r\n set labelRotation(r: Quaternion) {\r\n this.labelTransform.localRotation = r;\r\n }\r\n\r\n get offsetDirection(): CalloutOffsetDirection {\r\n const worldStartPos = this.rootTransform.worldPosition;\r\n const worldEndPos = this.labelTransform.worldPosition;\r\n const delta = Vector3.Subtract(worldEndPos, worldStartPos);\r\n\r\n let offsetDirection: CalloutOffsetDirection = \"LEFT\";\r\n if (Math.abs(delta.y) > Math.abs(delta.x)) {\r\n if (delta.y < 0) offsetDirection = \"DOWN\";\r\n else offsetDirection = \"UP\";\r\n } else {\r\n if (delta.x < 0) offsetDirection = \"LEFT\";\r\n else offsetDirection = \"RIGHT\";\r\n }\r\n\r\n return offsetDirection;\r\n }\r\n\r\n inRepo?: CalloutRepo;\r\n\r\n get data(): CalloutDTO {\r\n return {\r\n id: this.appObject.id,\r\n parentID: this.inRepo ? this.inRepo.appObject.id : \"\",\r\n rootPosition: this.rootPosition.dto,\r\n rootRotation: this.rootRotation.dto,\r\n labelPosition: this.labelPosition.dto,\r\n size: this.size,\r\n label: this.label.custom,\r\n defaultLabel: this.label.default,\r\n color: this.overlayColor.overlayColor,\r\n };\r\n }\r\n\r\n set data(dto: CalloutDTO) {\r\n this.rootPosition = Vector3.FromDTO(dto.rootPosition);\r\n this.rootRotation = Quaternion.FromDTO(dto.rootRotation);\r\n this.labelPosition = Vector3.FromDTO(dto.labelPosition);\r\n this.size = dto.size;\r\n this.label.custom = dto.label;\r\n this.label.default = dto.defaultLabel;\r\n const overlayColor = dto.color as OverlayColorEnums;\r\n this.overlayColor.overlayColor = overlayColor ?? OverlayColorEnums.WHITE;\r\n }\r\n\r\n dispose = () => {\r\n super.dispose();\r\n this.label.dispose();\r\n this.hideable.dispose();\r\n this.selectable.dispose();\r\n this.overlayColor.dispose();\r\n this.labelTransform.appObject.dispose();\r\n this.rootTransform.appObject.dispose();\r\n\r\n if (this.inRepo) {\r\n this.inRepo.removeForAppObject(this.appObject.id);\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, CalloutEntity.type);\r\n\r\n this.label = LabelEntity.addIfMissing(appObject);\r\n this.label.addChangeObserver(this.notifyOnChange);\r\n\r\n this.hideable = Hideable.addIfMissing(appObject);\r\n this.hideable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.overlayColor = OverlayColor.addIfMissing(appObject);\r\n this.overlayColor.addChangeObserver(this.notifyOnChange);\r\n\r\n this.selectable = makeSelectable(appObject);\r\n this.selectable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.rangedSize = new RangedNumber(\r\n {\r\n min: CALLOUT_MINIMUM_SIZE,\r\n max: CALLOUT_MAXIMUM_SIZE,\r\n initialValue:\r\n CALLOUT_MINIMUM_SIZE +\r\n 0.5 * (CALLOUT_MAXIMUM_SIZE - CALLOUT_MINIMUM_SIZE),\r\n },\r\n this.notifyOnChange\r\n );\r\n\r\n const myID = appObject.id;\r\n const rootAO = appObject.appObjectRepo.getOrCreate(myID + \"_root\");\r\n this.rootTransform = makeTransform3D(rootAO);\r\n this.rootTransform.addChangeObserver(this.notifyOnChange);\r\n\r\n const labelAO = appObject.appObjectRepo.getOrCreate(myID + \"_label\");\r\n this.labelTransform = makeTransform3D(labelAO);\r\n this.labelTransform.addChangeObserver(this.notifyOnChange);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CalloutEntity.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAEL,eAAe,EAEf,UAAU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GAAG,EAAE,oBAAoB;YACzB,GAAG,EAAE,oBAAoB;YACzB,YAAY,EACV,oBAAoB;gBACpB,GAAG,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;SACtD,EACD,IAAI,CAAC,cAAc,CACpB,CAAC;QAEF,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,UAAU,CAAC,gBAAgB,CAC7D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EACtB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EACpB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CACrB,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import {\r\n Angle,\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo,\r\n Quaternion,\r\n QuaternionDTO,\r\n RangedNumber,\r\n Vector3,\r\n Vector3DTO,\r\n} from \"@vived/core\";\r\nimport { Hideable } from \"../../Hideable/Entities/Hideable\";\r\nimport { LabelEntity } from \"../../Label/Entities/LabelEntity\";\r\nimport {\r\n OverlayColor,\r\n OverlayColorEnums,\r\n} from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport {\r\n makeSelectable,\r\n Selectable,\r\n} from \"../../Selection/Entities/Selectable\";\r\nimport {\r\n makeTransform3D,\r\n Transform3D,\r\n} from \"../../Transform3D/Entities/Transform3D\";\r\nimport { CalloutRepo } from \"./CalloutRepo\";\r\n\r\nexport const CALLOUT_MINIMUM_SIZE: number = 0.3;\r\nexport const CALLOUT_MAXIMUM_SIZE: number = 1.3;\r\n\r\nexport type CalloutOffsetDirection = \"LEFT\" | \"RIGHT\" | \"UP\" | \"DOWN\";\r\n\r\nexport interface CalloutDTO {\r\n id: string;\r\n rootPosition: Vector3DTO;\r\n rootRotation: QuaternionDTO;\r\n labelPosition: Vector3DTO;\r\n size: number;\r\n parentID: string;\r\n label: string;\r\n defaultLabel: string;\r\n color: string;\r\n}\r\n\r\nexport abstract class CalloutEntity extends AppObjectEntity {\r\n static readonly type = \"CALLOUT\";\r\n\r\n static get(appObj: AppObject): CalloutEntity | undefined {\r\n return appObj.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n static getById(\r\n id: string,\r\n appObjects: AppObjectRepo\r\n ): CalloutEntity | undefined {\r\n return appObjects.get(id)?.getComponent<CalloutEntity>(this.type);\r\n }\r\n\r\n abstract get id(): string;\r\n abstract inRepo?: CalloutRepo;\r\n\r\n abstract readonly label: LabelEntity;\r\n abstract readonly rootTransform: Transform3D;\r\n abstract readonly labelTransform: Transform3D;\r\n abstract readonly hideable: Hideable;\r\n abstract readonly selectable: Selectable;\r\n abstract readonly overlayColor: OverlayColor;\r\n abstract readonly rangedSize: RangedNumber;\r\n\r\n abstract get size(): number;\r\n abstract set size(val: number);\r\n\r\n abstract get rootPosition(): Vector3;\r\n abstract set rootPosition(p: Vector3);\r\n\r\n abstract get rootRotation(): Quaternion;\r\n abstract set rootRotation(r: Quaternion);\r\n\r\n abstract get labelPosition(): Vector3;\r\n abstract set labelPosition(p: Vector3);\r\n\r\n abstract get labelRotation(): Quaternion;\r\n abstract set labelRotation(r: Quaternion);\r\n\r\n abstract get data(): CalloutDTO;\r\n abstract set data(dto: CalloutDTO);\r\n\r\n abstract get offsetDirection(): CalloutOffsetDirection;\r\n}\r\n\r\nexport function makeCalloutEntity(appObject: AppObject): CalloutEntity {\r\n return new CalloutImp(appObject);\r\n}\r\n\r\nclass CalloutImp extends CalloutEntity {\r\n readonly label: LabelEntity;\r\n readonly hideable: Hideable;\r\n readonly selectable: Selectable;\r\n readonly rootTransform: Transform3D;\r\n readonly labelTransform: Transform3D;\r\n readonly overlayColor: OverlayColor;\r\n readonly rangedSize: RangedNumber;\r\n\r\n get id() {\r\n return this.appObject.id;\r\n }\r\n\r\n get size(): number {\r\n return this.rangedSize.val;\r\n }\r\n set size(val: number) {\r\n this.rangedSize.val = val;\r\n }\r\n\r\n get rootPosition(): Vector3 {\r\n return this.rootTransform.localPosition;\r\n }\r\n set rootPosition(p: Vector3) {\r\n this.rootTransform.localPosition = p;\r\n }\r\n\r\n get rootRotation(): Quaternion {\r\n return this.rootTransform.localRotation;\r\n }\r\n set rootRotation(r: Quaternion) {\r\n this.rootTransform.localRotation = r;\r\n }\r\n\r\n get labelPosition(): Vector3 {\r\n return this.labelTransform.localPosition;\r\n }\r\n set labelPosition(p: Vector3) {\r\n this.labelTransform.localPosition = p;\r\n }\r\n\r\n get labelRotation(): Quaternion {\r\n return this.labelTransform.localRotation;\r\n }\r\n set labelRotation(r: Quaternion) {\r\n this.labelTransform.localRotation = r;\r\n }\r\n\r\n get offsetDirection(): CalloutOffsetDirection {\r\n const worldStartPos = this.rootTransform.worldPosition;\r\n const worldEndPos = this.labelTransform.worldPosition;\r\n const delta = Vector3.Subtract(worldEndPos, worldStartPos);\r\n\r\n let offsetDirection: CalloutOffsetDirection = \"LEFT\";\r\n if (Math.abs(delta.y) > Math.abs(delta.x)) {\r\n if (delta.y < 0) offsetDirection = \"DOWN\";\r\n else offsetDirection = \"UP\";\r\n } else {\r\n if (delta.x < 0) offsetDirection = \"LEFT\";\r\n else offsetDirection = \"RIGHT\";\r\n }\r\n\r\n return offsetDirection;\r\n }\r\n\r\n inRepo?: CalloutRepo;\r\n\r\n get data(): CalloutDTO {\r\n return {\r\n id: this.appObject.id,\r\n parentID: this.inRepo ? this.inRepo.appObject.id : \"\",\r\n rootPosition: this.rootPosition.dto,\r\n rootRotation: this.rootRotation.dto,\r\n labelPosition: this.labelPosition.dto,\r\n size: this.size,\r\n label: this.label.custom,\r\n defaultLabel: this.label.default,\r\n color: this.overlayColor.overlayColor,\r\n };\r\n }\r\n\r\n set data(dto: CalloutDTO) {\r\n this.rootPosition = Vector3.FromDTO(dto.rootPosition);\r\n this.rootRotation = Quaternion.FromDTO(dto.rootRotation);\r\n this.labelPosition = Vector3.FromDTO(dto.labelPosition);\r\n this.size = dto.size;\r\n this.label.custom = dto.label;\r\n this.label.default = dto.defaultLabel;\r\n const overlayColor = dto.color as OverlayColorEnums;\r\n this.overlayColor.overlayColor = overlayColor ?? OverlayColorEnums.WHITE;\r\n }\r\n\r\n dispose = () => {\r\n super.dispose();\r\n this.label.dispose();\r\n this.hideable.dispose();\r\n this.selectable.dispose();\r\n this.overlayColor.dispose();\r\n this.labelTransform.appObject.dispose();\r\n this.rootTransform.appObject.dispose();\r\n\r\n if (this.inRepo) {\r\n this.inRepo.removeForAppObject(this.appObject.id);\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, CalloutEntity.type);\r\n\r\n this.label = LabelEntity.addIfMissing(appObject);\r\n this.label.addChangeObserver(this.notifyOnChange);\r\n\r\n this.hideable = Hideable.addIfMissing(appObject);\r\n this.hideable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.overlayColor = OverlayColor.addIfMissing(appObject);\r\n this.overlayColor.addChangeObserver(this.notifyOnChange);\r\n\r\n this.selectable = makeSelectable(appObject);\r\n this.selectable.addChangeObserver(this.notifyOnChange);\r\n\r\n this.rangedSize = new RangedNumber(\r\n {\r\n min: CALLOUT_MINIMUM_SIZE,\r\n max: CALLOUT_MAXIMUM_SIZE,\r\n initialValue:\r\n CALLOUT_MINIMUM_SIZE +\r\n 0.5 * (CALLOUT_MAXIMUM_SIZE - CALLOUT_MINIMUM_SIZE),\r\n },\r\n this.notifyOnChange\r\n );\r\n\r\n const myID = appObject.id;\r\n const rootAO = appObject.appObjectRepo.getOrCreate(myID + \"_root\");\r\n this.rootTransform = makeTransform3D(rootAO);\r\n this.rootTransform.addChangeObserver(this.notifyOnChange);\r\n\r\n const labelAO = appObject.appObjectRepo.getOrCreate(myID + \"_label\");\r\n this.labelTransform = makeTransform3D(labelAO);\r\n this.labelTransform.localRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(180),\r\n Angle.FromDegrees(0),\r\n Angle.FromDegrees(0)\r\n );\r\n this.labelTransform.addChangeObserver(this.notifyOnChange);\r\n }\r\n}\r\n"]}
@@ -112,7 +112,7 @@ describe("Callout Entity", () => {
112
112
  });
113
113
  it("Sets and gets the labelRotation", () => {
114
114
  const { callout, observer } = makeTestRig();
115
- expect(Quaternion.Close(callout.labelRotation, Quaternion.Identity())).toEqual(true);
115
+ expect(Quaternion.Close(callout.labelRotation, Quaternion.FromYawPitchRoll(Angle.FromDegrees(180), Angle.FromDegrees(0), Angle.FromDegrees(0)))).toEqual(true);
116
116
  const newQ = Quaternion.FromYawPitchRoll(Angle.FromDegrees(10), Angle.FromDegrees(20), Angle.FromDegrees(30));
117
117
  callout.labelRotation = newQ;
118
118
  expect(Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutEntity.test.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC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uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,CAAC;QAElC,OAAO,CAAC,IAAI,GAAG;YACb,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,MAAM;YAChB,YAAY,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;YACtC,YAAY,EAAE,UAAU,CAAC,gBAAgB,CACvC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EACrB,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EACrB,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CACtB,CAAC,GAAG;YACL,aAAa,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;YACvC,YAAY,EAAE,eAAe;YAC7B,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Angle, makeAppObjectRepo, Quaternion, Vector3 } from \"@vived/core\";\r\nimport { OverlayColorEnums } from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport { CalloutEntity, makeCalloutEntity } from \"./CalloutEntity\";\r\nimport { makeCalloutRepoEntity } from \"./CalloutRepo\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const calloutAO = appObjects.getOrCreate(\"calloutID\");\r\n const callout = makeCalloutEntity(calloutAO);\r\n const observer = jest.fn();\r\n callout.addChangeObserver(observer);\r\n\r\n const repoAO = appObjects.getOrCreate(\"repo\");\r\n const repo = makeCalloutRepoEntity(repoAO);\r\n repo.add(callout);\r\n callout.inRepo = repo;\r\n\r\n return { callout, appObjects, observer, repo };\r\n}\r\n\r\ndescribe(\"Callout Entity\", () => {\r\n it(\"Gets the entoty for the App Object\", () => {\r\n const { callout, appObjects } = makeTestRig();\r\n\r\n expect(CalloutEntity.getById(\"calloutID\", appObjects)).toEqual(callout);\r\n });\r\n\r\n it(\"Notifies when the Label changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n callout.label.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.label.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the hideable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.hideable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the hideable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.hideable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.hideable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the selectable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.selectable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the selectable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.selectable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.selectable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Removes itself from the repo\", () => {\r\n const { callout, repo } = makeTestRig();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(true);\r\n\r\n callout.dispose();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(false);\r\n });\r\n\r\n it(\"Notifies when the root transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.rootTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the root rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.rootTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the label transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.labelTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.labelTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.rootPosition).toEqual(Vector3.Zero());\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.rootTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.rootRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.rootRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.rootRotation, newQ)).toEqual(true);\r\n expect(Quaternion.Close(callout.rootTransform.localRotation, newQ)).toEqual(\r\n true\r\n );\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.labelPosition).toEqual(Vector3.Zero());\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.labelTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.labelRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.labelRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);\r\n expect(\r\n Quaternion.Close(callout.labelTransform.localRotation, newQ)\r\n ).toEqual(true);\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets the dto id\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.id).toEqual(\"calloutID\");\r\n });\r\n\r\n it(\"Sets the dto parent\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.parentID).toEqual(\"repo\");\r\n });\r\n\r\n it(\"Sets the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.rootPosition).toEqual(callout.rootPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n expect(callout.data.rootRotation).toEqual(callout.rootRotation.dto);\r\n });\r\n\r\n it(\"Sets the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.labelPosition).toEqual(callout.labelPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.custom = \"custom label\";\r\n\r\n expect(callout.data.label).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Sets the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.default = \"default label\";\r\n\r\n expect(callout.data.defaultLabel).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Sets the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.overlayColor.overlayColor = OverlayColorEnums.RED;\r\n\r\n expect(callout.data.color).toEqual(\"Red\");\r\n });\r\n\r\n it(\"Applies the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n });\r\n\r\n it(\"Applies the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.rootRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n )\r\n )\r\n ).toEqual(true);\r\n });\r\n\r\n it(\"Applies the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(4, 5, 6));\r\n });\r\n\r\n it(\"Applies the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.custom).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Applies the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.default).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Applies the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.overlayColor.overlayColor).toEqual(OverlayColorEnums.RED);\r\n });\r\n});\r\n"]}
1
+ {"version":3,"file":"CalloutEntity.test.js","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IAEvC,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;I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C,EAAE,CAAC,EACrB,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CACtB,CAAC,GAAG;YACL,aAAa,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;YACvC,YAAY,EAAE,eAAe;YAC7B,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Angle, makeAppObjectRepo, Quaternion, Vector3 } from \"@vived/core\";\r\nimport { OverlayColorEnums } from \"../../OverlayColor/Entities/OverlayColor\";\r\nimport { CalloutEntity, makeCalloutEntity } from \"./CalloutEntity\";\r\nimport { makeCalloutRepoEntity } from \"./CalloutRepo\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const calloutAO = appObjects.getOrCreate(\"calloutID\");\r\n const callout = makeCalloutEntity(calloutAO);\r\n const observer = jest.fn();\r\n callout.addChangeObserver(observer);\r\n\r\n const repoAO = appObjects.getOrCreate(\"repo\");\r\n const repo = makeCalloutRepoEntity(repoAO);\r\n repo.add(callout);\r\n callout.inRepo = repo;\r\n\r\n return { callout, appObjects, observer, repo };\r\n}\r\n\r\ndescribe(\"Callout Entity\", () => {\r\n it(\"Gets the entoty for the App Object\", () => {\r\n const { callout, appObjects } = makeTestRig();\r\n\r\n expect(CalloutEntity.getById(\"calloutID\", appObjects)).toEqual(callout);\r\n });\r\n\r\n it(\"Notifies when the Label changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n callout.label.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.label.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the hideable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.hideable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the hideable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.hideable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.hideable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the selectable changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.selectable.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the selectable\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.selectable.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.selectable.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Removes itself from the repo\", () => {\r\n const { callout, repo } = makeTestRig();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(true);\r\n\r\n callout.dispose();\r\n\r\n expect(repo.hasForAppObject(callout.appObject.id)).toEqual(false);\r\n });\r\n\r\n it(\"Notifies when the root transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.rootTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the root rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.rootTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Notifies when the label transform changes\", () => {\r\n const { callout, observer } = makeTestRig();\r\n observer.mockClear();\r\n\r\n callout.labelTransform.notifyOnChange();\r\n\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Disposes the label rootTransform\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelTransform.dispose = jest.fn();\r\n\r\n callout.dispose();\r\n\r\n expect(callout.labelTransform.dispose).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.rootPosition).toEqual(Vector3.Zero());\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.rootTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the rootRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(callout.rootRotation, Quaternion.Identity())\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.rootRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.rootRotation, newQ)).toEqual(true);\r\n expect(Quaternion.Close(callout.rootTransform.localRotation, newQ)).toEqual(\r\n true\r\n );\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelPosition\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(callout.labelPosition).toEqual(Vector3.Zero());\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(callout.labelTransform.localPosition).toEqual(new Vector3(1, 2, 3));\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets and gets the labelRotation\", () => {\r\n const { callout, observer } = makeTestRig();\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.labelRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(180),\r\n Angle.FromDegrees(0),\r\n Angle.FromDegrees(0)\r\n )\r\n )\r\n ).toEqual(true);\r\n const newQ = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n callout.labelRotation = newQ;\r\n\r\n expect(Quaternion.Close(callout.labelRotation, newQ)).toEqual(true);\r\n expect(\r\n Quaternion.Close(callout.labelTransform.localRotation, newQ)\r\n ).toEqual(true);\r\n expect(observer).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Sets the dto id\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.id).toEqual(\"calloutID\");\r\n });\r\n\r\n it(\"Sets the dto parent\", () => {\r\n const { callout } = makeTestRig();\r\n expect(callout.data.parentID).toEqual(\"repo\");\r\n });\r\n\r\n it(\"Sets the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.rootPosition).toEqual(callout.rootPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.rootRotation = Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n );\r\n\r\n expect(callout.data.rootRotation).toEqual(callout.rootRotation.dto);\r\n });\r\n\r\n it(\"Sets the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.labelPosition = new Vector3(1, 2, 3);\r\n\r\n expect(callout.data.labelPosition).toEqual(callout.labelPosition.dto);\r\n });\r\n\r\n it(\"Sets the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.custom = \"custom label\";\r\n\r\n expect(callout.data.label).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Sets the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.label.default = \"default label\";\r\n\r\n expect(callout.data.defaultLabel).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Sets the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.overlayColor.overlayColor = OverlayColorEnums.RED;\r\n\r\n expect(callout.data.color).toEqual(\"Red\");\r\n });\r\n\r\n it(\"Applies the dto root position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.rootPosition).toEqual(new Vector3(1, 2, 3));\r\n });\r\n\r\n it(\"Applies the dto root rotation\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(\r\n Quaternion.Close(\r\n callout.rootRotation,\r\n Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n )\r\n )\r\n ).toEqual(true);\r\n });\r\n\r\n it(\"Applies the dto label position\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.labelPosition).toEqual(new Vector3(4, 5, 6));\r\n });\r\n\r\n it(\"Applies the dto label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.custom).toEqual(\"custom label\");\r\n });\r\n\r\n it(\"Applies the dto default label\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.label.default).toEqual(\"default label\");\r\n });\r\n\r\n it(\"Applies the dto color\", () => {\r\n const { callout } = makeTestRig();\r\n\r\n callout.data = {\r\n id: \"calloutID\",\r\n parentID: \"repo\",\r\n rootPosition: new Vector3(1, 2, 3).dto,\r\n rootRotation: Quaternion.FromYawPitchRoll(\r\n Angle.FromDegrees(10),\r\n Angle.FromDegrees(20),\r\n Angle.FromDegrees(30)\r\n ).dto,\r\n labelPosition: new Vector3(4, 5, 6).dto,\r\n defaultLabel: \"default label\",\r\n label: \"custom label\",\r\n size: 5,\r\n color: \"Red\",\r\n };\r\n\r\n expect(callout.overlayColor.overlayColor).toEqual(OverlayColorEnums.RED);\r\n });\r\n});\r\n"]}
@@ -1,3 +1,4 @@
1
1
  export * from "./ClearCustomLabel";
2
- export * from "./SetCustomLabel";
2
+ export * from "./updateCustomLabel";
3
+ export * from "./submitCustomLabel";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./ClearCustomLabel\";\r\nexport * from \"./SetCustomLabel\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./ClearCustomLabel\";\r\nexport * from \"./updateCustomLabel\";\r\nexport * from \"./submitCustomLabel\";\r\n"]}
@@ -0,0 +1,15 @@
1
+ import { SetCustomLabelUC } from "../UC/SetCustomLabelUC";
2
+ export function submitCustomLabel(appObjectID, appObjectRepo) {
3
+ const appObject = appObjectRepo.get(appObjectID);
4
+ if (!appObject) {
5
+ appObjectRepo.submitWarning("submitCustomLabel Contorller", "App Object not found");
6
+ return;
7
+ }
8
+ const setCustomLabelUC = SetCustomLabelUC.get(appObject);
9
+ if (!setCustomLabelUC) {
10
+ appObjectRepo.submitWarning("submitCustomLabel Controller", "SetCustomLabelUC was not added to App Object");
11
+ return;
12
+ }
13
+ setCustomLabelUC.submit();
14
+ }
15
+ //# sourceMappingURL=submitCustomLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.js","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,aAA4B;IAE5B,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,sBAAsB,CACvB,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,8CAA8C,CAC/C,CAAC;QACF,OAAO;IACT,CAAC;IAED,gBAAgB,CAAC,MAAM,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["import { AppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\n\r\nexport function submitCustomLabel(\r\n appObjectID: string,\r\n appObjectRepo: AppObjectRepo\r\n) {\r\n const appObject = appObjectRepo.get(appObjectID);\r\n if (!appObject) {\r\n appObjectRepo.submitWarning(\r\n \"submitCustomLabel Contorller\",\r\n \"App Object not found\"\r\n );\r\n return;\r\n }\r\n\r\n const setCustomLabelUC = SetCustomLabelUC.get(appObject);\r\n if (!setCustomLabelUC) {\r\n appObjectRepo.submitWarning(\r\n \"submitCustomLabel Controller\",\r\n \"SetCustomLabelUC was not added to App Object\"\r\n );\r\n return;\r\n }\r\n\r\n setCustomLabelUC.submit();\r\n}\r\n"]}
@@ -0,0 +1,37 @@
1
+ import { makeAppObjectRepo } from "@vived/core";
2
+ import { SetCustomLabelUC } from "../UC/SetCustomLabelUC";
3
+ import { submitCustomLabel } from "./submitCustomLabel";
4
+ function makeTestRig() {
5
+ const appObjects = makeAppObjectRepo();
6
+ const mockSubmitWarning = jest.fn();
7
+ appObjects.submitWarning = mockSubmitWarning;
8
+ const ao = appObjects.getOrCreate("App Object ID");
9
+ const clearCustomLabelUC = new SetCustomLabelUC(ao);
10
+ const mockSubmitCustomLabel = jest.fn();
11
+ clearCustomLabelUC.submit = mockSubmitCustomLabel;
12
+ return {
13
+ appObjects,
14
+ ao,
15
+ mockSubmitWarning,
16
+ mockSubmitCustomLabel,
17
+ };
18
+ }
19
+ describe("Submit Custom Label Controller", () => {
20
+ it("Calls Submit Custom Label method", () => {
21
+ const { appObjects, ao, mockSubmitCustomLabel } = makeTestRig();
22
+ submitCustomLabel(ao.id, appObjects);
23
+ expect(mockSubmitCustomLabel).toHaveBeenCalled();
24
+ });
25
+ it("Submits warning if App Object is not found", () => {
26
+ const { appObjects, mockSubmitWarning } = makeTestRig();
27
+ submitCustomLabel("TEST AO", appObjects);
28
+ expect(mockSubmitWarning).toHaveBeenCalled();
29
+ });
30
+ it("Submits warning if SetCustomLabel UC was not added", () => {
31
+ const { appObjects, mockSubmitWarning } = makeTestRig();
32
+ const ao = appObjects.getOrCreate("TEST AO");
33
+ submitCustomLabel(ao.id, appObjects);
34
+ expect(mockSubmitWarning).toHaveBeenCalled();
35
+ });
36
+ });
37
+ //# sourceMappingURL=submitCustomLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.test.js","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IAEvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACpC,UAAU,CAAC,aAAa,GAAG,iBAAiB,CAAC;IAE7C,MAAM,E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Content":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\nimport { submitCustomLabel } from \"./submitCustomLabel\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n const ao = appObjects.getOrCreate(\"App Object ID\");\r\n\r\n const clearCustomLabelUC = new SetCustomLabelUC(ao);\r\n const mockSubmitCustomLabel = jest.fn();\r\n clearCustomLabelUC.submit = mockSubmitCustomLabel;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockSubmitWarning,\r\n mockSubmitCustomLabel,\r\n };\r\n}\r\n\r\ndescribe(\"Submit Custom Label Controller\", () => {\r\n it(\"Calls Submit Custom Label method\", () => {\r\n const { appObjects, ao, mockSubmitCustomLabel } = makeTestRig();\r\n\r\n submitCustomLabel(ao.id, appObjects);\r\n\r\n expect(mockSubmitCustomLabel).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if App Object is not found\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n\r\n submitCustomLabel(\"TEST AO\", appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if SetCustomLabel UC was not added\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"TEST AO\");\r\n\r\n submitCustomLabel(ao.id, appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -0,0 +1,15 @@
1
+ import { SetCustomLabelUC } from "../UC/SetCustomLabelUC";
2
+ export function updateCustomLabel(customLabel, appObjectID, appObjectRepo) {
3
+ const appObject = appObjectRepo.get(appObjectID);
4
+ if (!appObject) {
5
+ appObjectRepo.submitWarning("updateCustomLabel Contorller", "App Object not found");
6
+ return;
7
+ }
8
+ const setCustomLabelUC = SetCustomLabelUC.get(appObject);
9
+ if (!setCustomLabelUC) {
10
+ appObjectRepo.submitWarning("updateCustomLabel Controller", "SetCustomLabelUC was not added to App Object");
11
+ return;
12
+ }
13
+ setCustomLabelUC.update(customLabel);
14
+ }
15
+ //# sourceMappingURL=updateCustomLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.js","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,WAAmB,EACnB,aAA4B;IAE5B,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,sBAAsB,CACvB,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,aAAa,CAAC,aAAa,CACzB,8BAA8B,EAC9B,8CAA8C,CAC/C,CAAC;QACF,OAAO;IACT,CAAC;IAED,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import { AppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\n\r\nexport function updateCustomLabel(\r\n customLabel: string,\r\n appObjectID: string,\r\n appObjectRepo: AppObjectRepo\r\n) {\r\n const appObject = appObjectRepo.get(appObjectID);\r\n if (!appObject) {\r\n appObjectRepo.submitWarning(\r\n \"updateCustomLabel Contorller\",\r\n \"App Object not found\"\r\n );\r\n return;\r\n }\r\n\r\n const setCustomLabelUC = SetCustomLabelUC.get(appObject);\r\n if (!setCustomLabelUC) {\r\n appObjectRepo.submitWarning(\r\n \"updateCustomLabel Controller\",\r\n \"SetCustomLabelUC was not added to App Object\"\r\n );\r\n return;\r\n }\r\n\r\n setCustomLabelUC.update(customLabel);\r\n}\r\n"]}
@@ -0,0 +1,37 @@
1
+ import { makeAppObjectRepo } from "@vived/core";
2
+ import { SetCustomLabelUC } from "../UC/SetCustomLabelUC";
3
+ import { updateCustomLabel } from "./updateCustomLabel";
4
+ function makeTestRig() {
5
+ const appObjects = makeAppObjectRepo();
6
+ const mockSubmitWarning = jest.fn();
7
+ appObjects.submitWarning = mockSubmitWarning;
8
+ const ao = appObjects.getOrCreate("App Object ID");
9
+ const clearCustomLabelUC = new SetCustomLabelUC(ao);
10
+ const mockUpdateCustomLabel = jest.fn();
11
+ clearCustomLabelUC.update = mockUpdateCustomLabel;
12
+ return {
13
+ appObjects,
14
+ ao,
15
+ mockSubmitWarning,
16
+ mockUpdateCustomLabel,
17
+ };
18
+ }
19
+ describe("Update Custom Label Controller", () => {
20
+ it("Calls Set Custom Label method", () => {
21
+ const { appObjects, ao, mockUpdateCustomLabel } = makeTestRig();
22
+ updateCustomLabel("custom", ao.id, appObjects);
23
+ expect(mockUpdateCustomLabel).toHaveBeenCalled();
24
+ });
25
+ it("Submits warning if App Object is not found", () => {
26
+ const { appObjects, mockSubmitWarning } = makeTestRig();
27
+ updateCustomLabel("custom", "TEST AO", appObjects);
28
+ expect(mockSubmitWarning).toHaveBeenCalled();
29
+ });
30
+ it("Submits warning if SetCustomLabel UC was not added", () => {
31
+ const { appObjects, mockSubmitWarning } = makeTestRig();
32
+ const ao = appObjects.getOrCreate("TEST AO");
33
+ updateCustomLabel("custom", ao.id, appObjects);
34
+ expect(mockSubmitWarning).toHaveBeenCalled();
35
+ });
36
+ });
37
+ //# sourceMappingURL=updateCustomLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.test.js","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.test.ts"],"names":[],"mappings":"AAAA,OAAO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H,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,WAAW,EAAE,CAAC;QACxD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE7C,iBAAiB,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAE/C,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { SetCustomLabelUC } from \"../UC/SetCustomLabelUC\";\r\nimport { updateCustomLabel } from \"./updateCustomLabel\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n const ao = appObjects.getOrCreate(\"App Object ID\");\r\n\r\n const clearCustomLabelUC = new SetCustomLabelUC(ao);\r\n const mockUpdateCustomLabel = jest.fn();\r\n clearCustomLabelUC.update = mockUpdateCustomLabel;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockSubmitWarning,\r\n mockUpdateCustomLabel,\r\n };\r\n}\r\n\r\ndescribe(\"Update Custom Label Controller\", () => {\r\n it(\"Calls Set Custom Label method\", () => {\r\n const { appObjects, ao, mockUpdateCustomLabel } = makeTestRig();\r\n\r\n updateCustomLabel(\"custom\", ao.id, appObjects);\r\n\r\n expect(mockUpdateCustomLabel).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if App Object is not found\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n\r\n updateCustomLabel(\"custom\", \"TEST AO\", appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits warning if SetCustomLabel UC was not added\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"TEST AO\");\r\n\r\n updateCustomLabel(\"custom\", ao.id, appObjects);\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -8,16 +8,26 @@ export class SetCustomLabelUC extends AppObjectUC {
8
8
  }
9
9
  constructor(appObject) {
10
10
  super(appObject, SetCustomLabelUC.type);
11
- this.setCustomLabel = (customLabel) => {
11
+ this.update = (customLabel) => {
12
12
  if (!this.label) {
13
13
  this.warn("[SetCustomLabelUC] Unable to get Entity");
14
14
  return;
15
15
  }
16
- const prevLabel = this.label.custom;
17
16
  this.label.custom = customLabel;
18
- new SetCustomLabelUndoRedo(prevLabel, customLabel, this.appObject);
19
17
  dispatchStateChange(this.appObjects);
20
18
  };
19
+ this.submit = () => {
20
+ if (!this.label) {
21
+ this.warn("[SetCustomLabelUC] Unable to get Entity");
22
+ return;
23
+ }
24
+ if (this.localCustomLabel !== undefined) {
25
+ const prevLabel = this.localCustomLabel;
26
+ new SetCustomLabelUndoRedo(prevLabel, this.label.custom, this.appObject);
27
+ this.localCustomLabel = this.label.display;
28
+ }
29
+ };
30
+ this.localCustomLabel = this.label?.display;
21
31
  }
22
32
  static get(appObj) {
23
33
  return appObj.getComponent(this.type);
@@ -1 +1 @@
1
- {"version":3,"file":"SetCustomLabelUC.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAG/C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,uBAAuB,CAAc,WAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAeD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAd1C,mBAAc,GAAG,CAAC,WAAmB,EAAE,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;YAEhC,IAAI,sBAAsB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YACnE,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC;IAIF,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAmB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;;AAzBe,qBAAI,GAAG,kBAAkB,AAArB,CAAsB","sourcesContent":["import { AppObject, AppObjectUC } from \"@vived/core\";\r\nimport { dispatchStateChange } from \"../../Dispatcher\";\r\nimport { LabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUndoRedo } from \"./SetCustomLabelUndoRedo\";\r\n\r\nexport class SetCustomLabelUC extends AppObjectUC {\r\n static readonly type = \"SetCustomLabelUC\";\r\n\r\n private get label() {\r\n return this.getCachedLocalComponent<LabelEntity>(LabelEntity.type);\r\n }\r\n\r\n setCustomLabel = (customLabel: string) => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n\r\n const prevLabel = this.label.custom;\r\n this.label.custom = customLabel;\r\n\r\n new SetCustomLabelUndoRedo(prevLabel, customLabel, this.appObject);\r\n dispatchStateChange(this.appObjects);\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SetCustomLabelUC.type);\r\n }\r\n\r\n static get(appObj: AppObject): SetCustomLabelUC | undefined {\r\n return appObj.getComponent<SetCustomLabelUC>(this.type);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SetCustomLabelUC.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAK/C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,uBAAuB,CAAc,WAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IA0BD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAzB1C,WAAM,GAAG,CAAC,WAAmB,EAAE,EAAE;YAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;YAChC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,WAAM,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBACrD,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACxC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;gBAExC,IAAI,sBAAsB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBAEzE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC;QAKA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,OAAO,MAAM,CAAC,YAAY,CAAmB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;;AAxCe,qBAAI,GAAG,kBAAkB,AAArB,CAAsB","sourcesContent":["import { AppObject, AppObjectUC } from \"@vived/core\";\r\nimport { dispatchStateChange } from \"../../Dispatcher\";\r\nimport { LabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUndoRedo } from \"./SetCustomLabelUndoRedo\";\r\n\r\nexport class SetCustomLabelUC extends AppObjectUC {\r\n static readonly type = \"SetCustomLabelUC\";\r\n\r\n private localCustomLabel?: string;\r\n\r\n private get label() {\r\n return this.getCachedLocalComponent<LabelEntity>(LabelEntity.type);\r\n }\r\n\r\n update = (customLabel: string) => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n this.label.custom = customLabel;\r\n dispatchStateChange(this.appObjects);\r\n };\r\n\r\n submit = () => {\r\n if (!this.label) {\r\n this.warn(\"[SetCustomLabelUC] Unable to get Entity\");\r\n return;\r\n }\r\n\r\n if (this.localCustomLabel !== undefined) {\r\n const prevLabel = this.localCustomLabel;\r\n\r\n new SetCustomLabelUndoRedo(prevLabel, this.label.custom, this.appObject);\r\n\r\n this.localCustomLabel = this.label.display;\r\n }\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SetCustomLabelUC.type);\r\n\r\n this.localCustomLabel = this.label?.display;\r\n }\r\n\r\n static get(appObj: AppObject): SetCustomLabelUC | undefined {\r\n return appObj.getComponent<SetCustomLabelUC>(this.type);\r\n }\r\n}\r\n"]}
@@ -26,24 +26,32 @@ describe("Set Custom Label UC", () => {
26
26
  it("Sets custom label", () => {
27
27
  const { label, setCustomLabelUC } = makeTestRig();
28
28
  label.custom = "";
29
- setCustomLabelUC.setCustomLabel("custom");
29
+ setCustomLabelUC.update("custom");
30
30
  expect(label.custom).toEqual("custom");
31
31
  });
32
32
  it("Submits warning if label entity was not added to App Object", () => {
33
33
  const { appObjects, mockSubmitWarning } = makeTestRig();
34
34
  const ao = appObjects.getOrCreate("testAO");
35
35
  const clearCustomLabel = new SetCustomLabelUC(ao);
36
- clearCustomLabel.setCustomLabel("custom");
37
- expect(mockSubmitWarning).toHaveBeenCalledTimes(2);
36
+ clearCustomLabel.update("custom");
37
+ expect(mockSubmitWarning).toHaveBeenCalledTimes(3);
38
38
  });
39
39
  it("Dispatches state chagne when clear custom label", () => {
40
- const { label, setCustomLabelUC, mockDispatcher } = makeTestRig();
41
- setCustomLabelUC.setCustomLabel("custom");
40
+ const { setCustomLabelUC, mockDispatcher } = makeTestRig();
41
+ setCustomLabelUC.update("custom");
42
42
  expect(mockDispatcher.doDispatch).toHaveBeenCalled();
43
43
  });
44
44
  it("Submits and undo", () => {
45
+ const { setCustomLabelUC, mockUndo } = makeTestRig();
46
+ setCustomLabelUC.update("custom");
47
+ setCustomLabelUC.submit();
48
+ expect(mockUndo.submitAction).toHaveBeenCalled();
49
+ });
50
+ it("Submits undo operation with correct previous and current labels", () => {
45
51
  const { label, setCustomLabelUC, mockUndo } = makeTestRig();
46
- setCustomLabelUC.setCustomLabel("custom");
52
+ label.custom = "initial";
53
+ setCustomLabelUC.update("custom");
54
+ setCustomLabelUC.submit();
47
55
  expect(mockUndo.submitAction).toHaveBeenCalled();
48
56
  });
49
57
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SetCustomLabelUC.test.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.test.ts"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EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,WAAW,EAAE,CAAC;QACxD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE5C,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAClD,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;QAElE,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;QAE5D,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { MockDispatchStateChange } from \"../../Dispatcher/Mocks/MockDispatchStateChange\";\r\nimport { MockUndoRedo } from \"../../UndoRedo/Mocks/MockUndoRedo\";\r\nimport { makeLabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUC } from \"./SetCustomLabelUC\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = appObjects.getOrCreate(\"App\");\r\n\r\n const mockUndo = new MockUndoRedo(ao);\r\n const mockDispatcher = new MockDispatchStateChange(ao);\r\n\r\n const label = makeLabelEntity(ao);\r\n const setCustomLabelUC = new SetCustomLabelUC(ao);\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockUndo,\r\n mockDispatcher,\r\n label,\r\n setCustomLabelUC,\r\n mockSubmitWarning,\r\n };\r\n}\r\n\r\ndescribe(\"Set Custom Label UC\", () => {\r\n it(\"Sets custom label\", () => {\r\n const { label, setCustomLabelUC } = makeTestRig();\r\n\r\n label.custom = \"\";\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(label.custom).toEqual(\"custom\");\r\n });\r\n\r\n it(\"Submits warning if label entity was not added to App Object\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"testAO\");\r\n\r\n const clearCustomLabel = new SetCustomLabelUC(ao);\r\n clearCustomLabel.setCustomLabel(\"custom\");\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalledTimes(2);\r\n });\r\n\r\n it(\"Dispatches state chagne when clear custom label\", () => {\r\n const { label, setCustomLabelUC, mockDispatcher } = makeTestRig();\r\n\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(mockDispatcher.doDispatch).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits and undo\", () => {\r\n const { label, setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n setCustomLabelUC.setCustomLabel(\"custom\");\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
1
+ {"version":3,"file":"SetCustomLabelUC.test.js","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO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AC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { MockDispatchStateChange } from \"../../Dispatcher/Mocks/MockDispatchStateChange\";\r\nimport { MockUndoRedo } from \"../../UndoRedo/Mocks/MockUndoRedo\";\r\nimport { makeLabelEntity } from \"../Entities\";\r\nimport { SetCustomLabelUC } from \"./SetCustomLabelUC\";\r\n\r\nfunction makeTestRig() {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = appObjects.getOrCreate(\"App\");\r\n\r\n const mockUndo = new MockUndoRedo(ao);\r\n const mockDispatcher = new MockDispatchStateChange(ao);\r\n\r\n const label = makeLabelEntity(ao);\r\n const setCustomLabelUC = new SetCustomLabelUC(ao);\r\n\r\n const mockSubmitWarning = jest.fn();\r\n appObjects.submitWarning = mockSubmitWarning;\r\n\r\n return {\r\n appObjects,\r\n ao,\r\n mockUndo,\r\n mockDispatcher,\r\n label,\r\n setCustomLabelUC,\r\n mockSubmitWarning,\r\n };\r\n}\r\n\r\ndescribe(\"Set Custom Label UC\", () => {\r\n it(\"Sets custom label\", () => {\r\n const { label, setCustomLabelUC } = makeTestRig();\r\n\r\n label.custom = \"\";\r\n setCustomLabelUC.update(\"custom\");\r\n\r\n expect(label.custom).toEqual(\"custom\");\r\n });\r\n\r\n it(\"Submits warning if label entity was not added to App Object\", () => {\r\n const { appObjects, mockSubmitWarning } = makeTestRig();\r\n const ao = appObjects.getOrCreate(\"testAO\");\r\n\r\n const clearCustomLabel = new SetCustomLabelUC(ao);\r\n clearCustomLabel.update(\"custom\");\r\n\r\n expect(mockSubmitWarning).toHaveBeenCalledTimes(3);\r\n });\r\n\r\n it(\"Dispatches state chagne when clear custom label\", () => {\r\n const { setCustomLabelUC, mockDispatcher } = makeTestRig();\r\n\r\n setCustomLabelUC.update(\"custom\");\r\n\r\n expect(mockDispatcher.doDispatch).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits and undo\", () => {\r\n const { setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n setCustomLabelUC.update(\"custom\");\r\n setCustomLabelUC.submit();\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n\r\n it(\"Submits undo operation with correct previous and current labels\", () => {\r\n const { label, setCustomLabelUC, mockUndo } = makeTestRig();\r\n\r\n label.custom = \"initial\";\r\n setCustomLabelUC.update(\"custom\");\r\n setCustomLabelUC.submit();\r\n\r\n expect(mockUndo.submitAction).toHaveBeenCalled();\r\n });\r\n});\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutEntity.d.ts","sourceRoot":"","sources":["../../../../src/Callouts/Entities/CalloutEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EAGb,YAAY,EAAE,OAAO,EACrB,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EACL,YAAY,EAEb,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEL,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,WAAW,EACZ,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,oBAAoB,EAAE,MAAY,CAAC;AAChD,eAAO,MAAM,oBAAoB,EAAE,MAAY,CAAC;AAEhD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,UAAU,CAAC;IACzB,YAAY,EAAE,aAAa,CAAC;IAC5B,aAAa,EAAE,UAAU,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,K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AAQ,KAAK,aAAa,IAAI,UAAU,CAAC;IACzC,QAAQ,KAAK,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE;IAE1C,QAAQ,KAAK,IAAI,IAAI,UAAU,CAAC;IAChC,QAAQ,KAAK,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE;IAEnC,QAAQ,KAAK,eAAe,IAAI,sBAAsB,CAAC;CACxD;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,CAErE"}
@@ -1,3 +1,4 @@
1
1
  export * from "./ClearCustomLabel";
2
- export * from "./SetCustomLabel";
2
+ export * from "./updateCustomLabel";
3
+ export * from "./submitCustomLabel";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { AppObjectRepo } from "@vived/core";
2
+ export declare function submitCustomLabel(appObjectID: string, appObjectRepo: AppObjectRepo): void;
3
+ //# sourceMappingURL=submitCustomLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,aAAa,QAqB7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=submitCustomLabel.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitCustomLabel.test.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/submitCustomLabel.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { AppObjectRepo } from "@vived/core";
2
+ export declare function updateCustomLabel(customLabel: string, appObjectID: string, appObjectRepo: AppObjectRepo): void;
3
+ //# sourceMappingURL=updateCustomLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,aAAa,QAqB7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=updateCustomLabel.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCustomLabel.test.d.ts","sourceRoot":"","sources":["../../../../src/Label/Controller/updateCustomLabel.test.ts"],"names":[],"mappings":""}
@@ -1,8 +1,10 @@
1
1
  import { AppObject, AppObjectUC } from "@vived/core";
2
2
  export declare class SetCustomLabelUC extends AppObjectUC {
3
3
  static readonly type = "SetCustomLabelUC";
4
+ private localCustomLabel?;
4
5
  private get label();
5
- setCustomLabel: (customLabel: string) => void;
6
+ update: (customLabel: string) => void;
7
+ submit: () => void;
6
8
  constructor(appObject: AppObject);
7
9
  static get(appObj: AppObject): SetCustomLabelUC | undefined;
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SetCustomLabelUC.d.ts","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKrD,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,IAAI,sBAAsB;IAE1C,OAAO,KAAK,KAAK,GAEhB;IAED,cAAc,GAAI,aAAa,MAAM,UAWnC;gBAEU,SAAS,EAAE,SAAS;IAIhC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS;CAG5D"}
1
+ {"version":3,"file":"SetCustomLabelUC.d.ts","sourceRoot":"","sources":["../../../../src/Label/UC/SetCustomLabelUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKrD,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,CAAC,QAAQ,CAAC,IAAI,sBAAsB;IAE1C,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAElC,OAAO,KAAK,KAAK,GAEhB;IAED,MAAM,GAAI,aAAa,MAAM,UAO3B;IAEF,MAAM,aAaJ;gBAEU,SAAS,EAAE,SAAS;IAMhC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS;CAG5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/app",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "Public package of VIVED App Components",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",