@ohif/app 3.10.0-beta.113 → 3.10.0-beta.115

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 (66) hide show
  1. package/dist/1568.bundle.af4308b321dfab0445e6.js +6562 -0
  2. package/dist/{1919.bundle.fae108d3c6ad35ed05ae.js → 1919.bundle.8bd683b21cbfe1cb71a7.js} +12 -8
  3. package/dist/1919.css +1 -1
  4. package/dist/{870.bundle.26a075bb828c43c13794.js → 2308.bundle.8db15bbd9d5833f21526.js} +54 -135
  5. package/dist/{870.css → 2308.css} +1 -1
  6. package/dist/{2701.bundle.c9ea5a2bd0df31dd3aaa.js → 2701.bundle.b68c4419910024a0758d.js} +14 -10
  7. package/dist/3480.bundle.22f8a106b17da4d7e826.js +7495 -0
  8. package/dist/{3677.bundle.22ecea02fae99fc4b073.js → 3677.bundle.4a319db2fd495efa4564.js} +1648 -1654
  9. package/dist/{5770.bundle.700382010763de7c58fd.js → 4113.bundle.8fccd7af6118fde173aa.js} +34 -80
  10. package/dist/{4202.bundle.add83801fbc8227d551b.js → 4202.bundle.c86958c59da67316127c.js} +1 -1
  11. package/dist/{4526.bundle.bf1047785c90ef0a9fec.js → 4526.bundle.7b394677fd5dc4fad06f.js} +6 -6
  12. package/dist/{99.bundle.f7e8de6d86029ec75605.js → 4675.bundle.b7e00e5915520885fa1f.js} +967 -2
  13. package/dist/4743.bundle.9faa6ddab058d9a939f4.js +6634 -0
  14. package/dist/{4759.bundle.0d60078f58f5a56c0157.js → 4759.bundle.e4ff22f9db3f555aad7b.js} +4 -0
  15. package/dist/4759.css +1 -1
  16. package/dist/{2236.bundle.2fbf9a607e380f3bdd7f.js → 4789.bundle.5bc2d9e5507319d9cadf.js} +22327 -22350
  17. package/dist/{4834.bundle.750ec176d0ef84772b0a.js → 4834.bundle.6b5e7e0fc3343ec1960a.js} +1 -1
  18. package/dist/{4991.bundle.aa561005b9bff1f391af.js → 4991.bundle.897fe8cb1e85dbf31543.js} +4 -0
  19. package/dist/5258.bundle.f95ab2e02467a734bdb6.js +4519 -0
  20. package/dist/{5915.bundle.84b8c2aa4d4a8c7e40a2.js → 5341.bundle.2f963b49a4856e342cd1.js} +48327 -48879
  21. package/dist/{5674.bundle.05e639d0871778c8093a.js → 5674.bundle.977cff87c10fbb29cbb3.js} +4 -0
  22. package/dist/5674.css +1 -1
  23. package/dist/{573.bundle.ae0bd4f3e1f4eac8ae43.js → 573.bundle.9549b3f7fa44438654f0.js} +1 -1
  24. package/dist/{6027.bundle.32be836eef7308434394.js → 6027.bundle.d85e8a6bae1085cda03e.js} +3 -5
  25. package/dist/{8888.bundle.f6a648dc743772c89787.js → 6139.bundle.12d9035382cda028683b.js} +26538 -32458
  26. package/dist/{6201.bundle.11e6c535543d13b0bb98.js → 6201.bundle.db75c77eb056cb88c2b0.js} +4 -4
  27. package/dist/6201.css +1 -1
  28. package/dist/{6341.bundle.5e868cc5104bc834fcbc.js → 6341.bundle.40ae99e784ab35e9407c.js} +11 -21
  29. package/dist/6341.css +1 -1
  30. package/dist/{5038.bundle.790dfe509bc9841701b0.js → 6727.bundle.ffc91186f23237ec35c4.js} +4022 -11619
  31. package/dist/{6734.bundle.1a6cfb006f9a16963b0d.js → 6734.bundle.6829e6ba782c290fb687.js} +2 -2
  32. package/dist/6734.css +1 -1
  33. package/dist/6752.bundle.e33e02dd8f006be51464.js +2249 -0
  34. package/dist/{7197.bundle.3503d1951304cac940fa.js → 7197.bundle.e8529fdc03c3cc927e38.js} +50 -41
  35. package/dist/7197.css +1 -1
  36. package/dist/{5692.bundle.22ae2ac093b6d6b65a6e.js → 7942.bundle.a76695b6bc780cbf0b23.js} +474 -513
  37. package/dist/{8008.bundle.74e51bdb02ff5d264f50.js → 8008.bundle.bbb188c7a9c5358b5682.js} +4 -9
  38. package/dist/{810.bundle.342fc8fac8ae665558c6.js → 810.bundle.e388d7b970d9622441c4.js} +10 -10
  39. package/dist/810.css +1 -1
  40. package/dist/{8228.bundle.4bcb42b49355447ef23c.js → 8228.bundle.9532c8d75799a8d9c093.js} +2 -2
  41. package/dist/{8259.bundle.39723f9c04717f80687e.js → 8259.bundle.0f474d990a129494e1df.js} +3 -3
  42. package/dist/8402.css +1 -1
  43. package/dist/{8558.bundle.56d667a6969a60bab102.js → 8558.bundle.ffb653dfb0104bdd128e.js} +5 -1
  44. package/dist/8834.bundle.88696f3afc37982b4273.js +14581 -0
  45. package/dist/{9026.bundle.90271a421048d1adc3db.js → 9026.bundle.317d3f9be65ef67b9bff.js} +15 -10
  46. package/dist/{9551.bundle.44d1426054e46cf5d673.js → 9551.bundle.92b13000deb4aa87f2fd.js} +4 -9
  47. package/dist/{9072.bundle.49293623f9ed4582eeeb.js → 9855.bundle.ba46a4315a78373262ad.js} +451 -393
  48. package/dist/{9862.bundle.a4ccc41bcff91a46d37e.js → 9862.bundle.e44946f8d28ded1e722f.js} +3 -3
  49. package/dist/{9890.bundle.07483064f31feb5718a4.js → 9890.bundle.711bf3486194cdd5c039.js} +6 -6
  50. package/dist/9890.css +1 -1
  51. package/dist/app-config.js +8 -1
  52. package/dist/{app.bundle.3dc9aa5b6077224cc394.js → app.bundle.aac0f76ff17b3e978aa1.js} +55160 -53512
  53. package/dist/app.bundle.css +2 -2
  54. package/dist/{polySeg.bundle.d41f5224f4efc124505a.js → compute.bundle.fa052dcf2ef82b4950ad.js} +4 -3
  55. package/dist/{histogram-worker.bundle.6b0dbbdb168d711efad4.js → histogram-worker.bundle.986106c30f091f2cef47.js} +2 -1
  56. package/dist/index.html +1 -1
  57. package/dist/polySeg.bundle.7d21e7dc9b361089e3a5.js +250 -0
  58. package/dist/{suv-peak-worker.bundle.4ca63044b76f51350d34.js → suv-peak-worker.bundle.f22f853b6599f7ec6f0c.js} +6 -5
  59. package/dist/sw.js +1 -1
  60. package/package.json +19 -19
  61. package/dist/2045.bundle.aaa10dff6d93bec47a45.js +0 -9708
  62. package/dist/6896.bundle.ca9b905abe733f279387.js +0 -7147
  63. /package/dist/{213.bundle.a98935570805e4a7b9b2.js → 213.bundle.533d331e72ec5aa85b1c.js} +0 -0
  64. /package/dist/{2424.bundle.4f1eeae6a8f248dd34c1.js → 2424.bundle.4f39ac6cdb1a28a0ded3.js} +0 -0
  65. /package/dist/{2825.bundle.a9ed7e8b46a92a157797.js → 2825.bundle.f6bfd4cc1a286ebb1b38.js} +0 -0
  66. /package/dist/{7955.bundle.eba45d4238f7e762545d.js → 7955.bundle.24dbe9de87056ecbb422.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[5692],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[7942],{
3
3
 
4
- /***/ 45692:
4
+ /***/ 47942:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
6
 
7
7
  // ESM COMPAT FLAG
@@ -15,9 +15,9 @@ __webpack_require__.d(__webpack_exports__, {
15
15
  PanelStudyBrowserHeader: () => (/* reexport */ PanelStudyBrowserHeader),
16
16
  StaticWadoClient: () => (/* reexport */ StaticWadoClient),
17
17
  callInputDialog: () => (/* reexport */ callInputDialog),
18
- callLabelAutocompleteDialog: () => (/* reexport */ callLabelAutocompleteDialog),
18
+ callInputDialogAutoComplete: () => (/* reexport */ callInputDialogAutoComplete),
19
19
  cleanDenaturalizedDataset: () => (/* reexport */ cleanDenaturalizedDataset),
20
- colorPickerDialog: () => (/* reexport */ utils_colorPickerDialog),
20
+ colorPickerDialog: () => (/* reexport */ colorPickerDialog),
21
21
  createReportAsync: () => (/* reexport */ Actions_createReportAsync),
22
22
  createReportDialogPrompt: () => (/* reexport */ CreateReportDialogPrompt),
23
23
  "default": () => (/* binding */ default_src),
@@ -26,7 +26,6 @@ __webpack_require__.d(__webpack_exports__, {
26
26
  promptLabelAnnotation: () => (/* reexport */ utils_promptLabelAnnotation),
27
27
  promptSaveReport: () => (/* reexport */ utils_promptSaveReport),
28
28
  requestDisplaySetCreationForStudy: () => (/* reexport */ Panels_requestDisplaySetCreationForStudy),
29
- showLabelAnnotationPopup: () => (/* reexport */ showLabelAnnotationPopup),
30
29
  useDisplaySetSelectorStore: () => (/* reexport */ useDisplaySetSelectorStore),
31
30
  useHangingProtocolStageIndexStore: () => (/* reexport */ useHangingProtocolStageIndexStore),
32
31
  usePatientInfo: () => (/* reexport */ hooks_usePatientInfo),
@@ -2851,18 +2850,16 @@ var react = __webpack_require__(86326);
2851
2850
  // EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
2852
2851
  var prop_types = __webpack_require__(97598);
2853
2852
  var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
2854
- // EXTERNAL MODULE: ../../ui/src/index.js + 694 modules
2855
- var ui_src = __webpack_require__(12318);
2853
+ // EXTERNAL MODULE: ../../ui/src/index.js + 693 modules
2854
+ var ui_src = __webpack_require__(61533);
2856
2855
  // EXTERNAL MODULE: ./state/index.js + 1 modules
2857
2856
  var state = __webpack_require__(45981);
2858
2857
  // EXTERNAL MODULE: ../../../node_modules/react-router-dom/dist/index.js
2859
2858
  var dist = __webpack_require__(4194);
2860
2859
  // EXTERNAL MODULE: ../../../node_modules/react-i18next/dist/es/index.js + 15 modules
2861
2860
  var es = __webpack_require__(99993);
2862
- // EXTERNAL MODULE: ../../ui-next/src/index.ts + 2637 modules
2863
- var ui_next_src = __webpack_require__(52441);
2864
- // EXTERNAL MODULE: ../../i18n/src/index.js + 150 modules
2865
- var i18n_src = __webpack_require__(16076);
2861
+ // EXTERNAL MODULE: ../../ui-next/src/index.ts + 2653 modules
2862
+ var ui_next_src = __webpack_require__(95371);
2866
2863
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/Toolbar.tsx
2867
2864
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2868
2865
 
@@ -3036,19 +3033,16 @@ var index = __webpack_require__(50484);
3036
3033
 
3037
3034
 
3038
3035
 
3039
-
3040
-
3041
- const {
3042
- availableLanguages,
3043
- defaultLanguage,
3044
- currentLanguage
3045
- } = i18n_src/* default */.A;
3046
3036
  function ViewerHeader({
3047
- hotkeysManager,
3048
- extensionManager,
3049
- servicesManager,
3050
3037
  appConfig
3051
3038
  }) {
3039
+ const {
3040
+ servicesManager,
3041
+ extensionManager
3042
+ } = (0,src/* useSystem */.Jg)();
3043
+ const {
3044
+ customizationService
3045
+ } = servicesManager.services;
3052
3046
  const navigate = (0,dist/* useNavigate */.Zp)();
3053
3047
  const location = (0,dist/* useLocation */.zy)();
3054
3048
  const onClickReturnButton = () => {
@@ -3072,58 +3066,25 @@ function ViewerHeader({
3072
3066
  t
3073
3067
  } = (0,es/* useTranslation */.Bd)();
3074
3068
  const {
3075
- show,
3076
- hide
3077
- } = (0,ui_src/* useModal */.hS)();
3078
- const {
3079
- hotkeyDefinitions,
3080
- hotkeyDefaults
3081
- } = hotkeysManager;
3082
- const versionNumber = "3.10.0-beta.113";
3083
- const commitHash = "d25809eed073d3f308f6af8244ceae7df8c2ee35";
3069
+ show
3070
+ } = (0,ui_next_src/* useModal */.hS)();
3071
+ const AboutModal = customizationService.getCustomization('ohif.aboutModal');
3072
+ const UserPreferencesModal = customizationService.getCustomization('ohif.userPreferencesModal');
3084
3073
  const menuOptions = [{
3085
3074
  title: t('Header:About'),
3086
3075
  icon: 'info',
3087
3076
  onClick: () => show({
3088
- content: ui_src/* AboutModal */.VT,
3077
+ content: AboutModal,
3089
3078
  title: t('AboutModal:About OHIF Viewer'),
3090
- contentProps: {
3091
- versionNumber,
3092
- commitHash
3093
- },
3094
- containerDimensions: 'max-w-4xl max-h-4xl'
3079
+ containerClassName: 'max-w-md'
3095
3080
  })
3096
3081
  }, {
3097
3082
  title: t('Header:Preferences'),
3098
3083
  icon: 'settings',
3099
3084
  onClick: () => show({
3085
+ content: UserPreferencesModal,
3100
3086
  title: t('UserPreferencesModal:User preferences'),
3101
- content: ui_src/* UserPreferences */.im,
3102
- containerDimensions: 'w-[70%] max-w-[900px]',
3103
- contentProps: {
3104
- hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
3105
- hotkeyDefinitions,
3106
- currentLanguage: currentLanguage(),
3107
- availableLanguages,
3108
- defaultLanguage,
3109
- onCancel: () => {
3110
- src/* hotkeys */.ot.stopRecord();
3111
- src/* hotkeys */.ot.unpause();
3112
- hide();
3113
- },
3114
- onSubmit: ({
3115
- hotkeyDefinitions,
3116
- language
3117
- }) => {
3118
- if (language.value !== currentLanguage().value) {
3119
- i18n_src/* default */.A.changeLanguage(language.value);
3120
- }
3121
- hotkeysManager.setHotkeys(hotkeyDefinitions);
3122
- hide();
3123
- },
3124
- onReset: () => hotkeysManager.restoreDefaultBindings(),
3125
- hotkeysModule: src/* hotkeys */.ot
3126
- }
3087
+ containerClassName: 'flex max-w-4xl p-6 flex-col'
3127
3088
  })
3128
3089
  }];
3129
3090
  if (appConfig.oidc) {
@@ -4344,153 +4305,45 @@ function _createGetImageSrcFromImageIdFn(extensionManager) {
4344
4305
  }
4345
4306
  }
4346
4307
  /* harmony default export */ const Panels_WrappedPanelStudyBrowser = (WrappedPanelStudyBrowser);
4347
- ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/_shared/PROMPT_RESPONSES.ts
4348
- const PROMPT_RESPONSES_RESPONSE = {
4349
- NO_NEVER: -1,
4350
- CANCEL: 0,
4351
- CREATE_REPORT: 1,
4352
- ADD_SERIES: 2,
4353
- SET_STUDY_AND_SERIES: 3,
4354
- NO_NOT_FOR_SERIES: 4
4355
- };
4356
- /* harmony default export */ const PROMPT_RESPONSES = (PROMPT_RESPONSES_RESPONSE);
4308
+ // EXTERNAL MODULE: ../../../extensions/default/src/utils/_shared/PROMPT_RESPONSES.ts
4309
+ var PROMPT_RESPONSES = __webpack_require__(96357);
4357
4310
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Panels/createReportDialogPrompt.tsx
4358
4311
 
4359
-
4360
-
4361
- function CreateReportDialogPrompt(uiDialogService, {
4362
- extensionManager
4312
+ function CreateReportDialogPrompt({
4313
+ title = 'Create Report',
4314
+ extensionManager,
4315
+ servicesManager
4363
4316
  }) {
4317
+ const {
4318
+ uiDialogService,
4319
+ customizationService
4320
+ } = servicesManager.services;
4321
+ const dataSources = extensionManager.getDataSourcesForUI();
4322
+ const ReportDialog = customizationService.getCustomization('ohif.createReportDialog');
4323
+ const allowMultipleDataSources = window.config.allowMultiSelectExport;
4364
4324
  return new Promise(function (resolve, reject) {
4365
- let dialogId = undefined;
4366
- const _handleClose = () => {
4367
- // Dismiss dialog
4368
- uiDialogService.dismiss({
4369
- id: dialogId
4370
- });
4371
- // Notify of cancel action
4372
- resolve({
4373
- action: PROMPT_RESPONSES.CANCEL,
4374
- value: undefined,
4375
- dataSourceName: undefined
4376
- });
4377
- };
4378
-
4379
- /**
4380
- *
4381
- * @param {string} param0.action - value of action performed
4382
- * @param {string} param0.value - value from input field
4383
- */
4384
- const _handleFormSubmit = ({
4385
- action,
4386
- value
4387
- }) => {
4388
- uiDialogService.dismiss({
4389
- id: dialogId
4390
- });
4391
- switch (action.id) {
4392
- case 'save':
4325
+ uiDialogService.show({
4326
+ id: 'report-dialog',
4327
+ title,
4328
+ content: ReportDialog,
4329
+ contentProps: {
4330
+ dataSources: allowMultipleDataSources ? dataSources : undefined,
4331
+ onSave: async ({
4332
+ reportName,
4333
+ dataSource: selectedDataSource
4334
+ }) => {
4393
4335
  resolve({
4394
- action: PROMPT_RESPONSES.CREATE_REPORT,
4395
- value: value.label,
4396
- dataSourceName: value.dataSourceName
4336
+ value: reportName,
4337
+ dataSourceName: selectedDataSource,
4338
+ action: PROMPT_RESPONSES/* default */.A.CREATE_REPORT
4397
4339
  });
4398
- break;
4399
- case 'cancel':
4340
+ },
4341
+ onCancel: () => {
4400
4342
  resolve({
4401
- action: PROMPT_RESPONSES.CANCEL,
4343
+ action: PROMPT_RESPONSES/* default */.A.CANCEL,
4402
4344
  value: undefined,
4403
4345
  dataSourceName: undefined
4404
4346
  });
4405
- break;
4406
- }
4407
- };
4408
- const dataSourcesOpts = Object.keys(extensionManager.dataSourceMap).filter(ds => {
4409
- const configuration = extensionManager.dataSourceDefs[ds]?.configuration;
4410
- const supportsStow = configuration?.supportsStow ?? configuration?.wadoRoot;
4411
- return supportsStow;
4412
- }).map(ds => {
4413
- return {
4414
- value: ds,
4415
- label: ds,
4416
- placeHolder: ds
4417
- };
4418
- });
4419
- dialogId = uiDialogService.create({
4420
- centralize: true,
4421
- isDraggable: false,
4422
- content: ui_src/* Dialog */.lG,
4423
- useLastPosition: false,
4424
- showOverlay: true,
4425
- contentProps: {
4426
- title: 'Create Report',
4427
- value: {
4428
- label: '',
4429
- dataSourceName: extensionManager.activeDataSource
4430
- },
4431
- noCloseButton: true,
4432
- onClose: _handleClose,
4433
- actions: [{
4434
- id: 'cancel',
4435
- text: 'Cancel',
4436
- type: ui_src/* ButtonEnums.type */.Ny.NW.secondary
4437
- }, {
4438
- id: 'save',
4439
- text: 'Save',
4440
- type: ui_src/* ButtonEnums.type */.Ny.NW.primary
4441
- }],
4442
- // TODO: Should be on button press...
4443
- onSubmit: _handleFormSubmit,
4444
- body: ({
4445
- value,
4446
- setValue
4447
- }) => {
4448
- const onChangeHandler = event => {
4449
- event.persist();
4450
- setValue(value => ({
4451
- ...value,
4452
- label: event.target.value
4453
- }));
4454
- };
4455
- const onKeyPressHandler = event => {
4456
- if (event.key === 'Enter') {
4457
- uiDialogService.dismiss({
4458
- id: dialogId
4459
- });
4460
- resolve({
4461
- action: PROMPT_RESPONSES.CREATE_REPORT,
4462
- value: value.label
4463
- });
4464
- }
4465
- };
4466
- return /*#__PURE__*/react.createElement(react.Fragment, null, dataSourcesOpts.length > 1 && window.config?.allowMultiSelectExport && /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("label", {
4467
- className: "text-[14px] leading-[1.2] text-white"
4468
- }, "Data Source"), /*#__PURE__*/react.createElement(ui_src/* Select */.l6, {
4469
- closeMenuOnSelect: true,
4470
- className: "border-primary-main mt-2 bg-black",
4471
- options: dataSourcesOpts,
4472
- placeholder: dataSourcesOpts.find(option => option.value === value.dataSourceName).placeHolder,
4473
- value: value.dataSourceName,
4474
- onChange: evt => {
4475
- setValue(v => ({
4476
- ...v,
4477
- dataSourceName: evt.value
4478
- }));
4479
- },
4480
- isClearable: false
4481
- })), /*#__PURE__*/react.createElement("div", {
4482
- className: "mt-3"
4483
- }, /*#__PURE__*/react.createElement(ui_src/* Input */.pd, {
4484
- autoFocus: true,
4485
- label: "Enter the report name",
4486
- labelClassName: "text-white text-[14px] leading-[1.2]",
4487
- className: "border-primary-main bg-black",
4488
- type: "text",
4489
- value: value.label,
4490
- onChange: onChangeHandler,
4491
- onKeyPress: onKeyPressHandler,
4492
- required: true
4493
- })));
4494
4347
  }
4495
4348
  }
4496
4349
  });
@@ -4640,8 +4493,8 @@ function areAllImageOrientationsEqual(instances) {
4640
4493
  }
4641
4494
  return true;
4642
4495
  }
4643
- // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 1 modules
4644
- var esm = __webpack_require__(3823);
4496
+ // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js
4497
+ var esm = __webpack_require__(40230);
4645
4498
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/calculateScanAxisNormal.ts
4646
4499
 
4647
4500
 
@@ -5855,8 +5708,8 @@ function adaptItem(item, subProps) {
5855
5708
  }
5856
5709
  return newItem;
5857
5710
  }
5858
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 95 modules
5859
- var dist_esm = __webpack_require__(31856);
5711
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js
5712
+ var dist_esm = __webpack_require__(4667);
5860
5713
  ;// CONCATENATED MODULE: ../../../extensions/default/src/CustomizableContextMenu/ContextMenuController.tsx
5861
5714
  var _ContextMenuController;
5862
5715
 
@@ -5881,9 +5734,7 @@ class ContextMenuController {
5881
5734
  this.commandsManager = commandsManager;
5882
5735
  }
5883
5736
  closeContextMenu() {
5884
- this.services.uiDialogService.dismiss({
5885
- id: 'context-menu'
5886
- });
5737
+ this.services.uiDialogService.hide('context-menu');
5887
5738
  }
5888
5739
 
5889
5740
  /**
@@ -5923,23 +5774,18 @@ class ContextMenuController {
5923
5774
  }
5924
5775
  }
5925
5776
  const items = getMenuItems(selectorProps || contextMenuProps, event, menus, menuId);
5777
+ if (!items) {
5778
+ return;
5779
+ }
5926
5780
  const ContextMenu = this.services.customizationService.getCustomization('ui.contextMenu');
5927
- this.services.uiDialogService.dismiss({
5928
- id: 'context-menu'
5929
- });
5930
- this.services.uiDialogService.create({
5781
+ this.services.uiDialogService.hide('context-menu');
5782
+ this.services.uiDialogService.show({
5931
5783
  id: 'context-menu',
5932
- isDraggable: false,
5933
- preservePosition: false,
5934
- preventCutOf: true,
5935
5784
  defaultPosition: ContextMenuController._getDefaultPosition(defaultPointsPosition, event?.detail || event, viewportElement),
5936
- event,
5937
5785
  content: ContextMenu,
5938
- // This naming is part of the uiDialogService convention
5939
- // Clicking outside simply closes the dialog box.
5940
- onClickOutside: () => this.services.uiDialogService.dismiss({
5941
- id: 'context-menu'
5942
- }),
5786
+ shouldCloseOnEsc: true,
5787
+ shouldCloseOnOverlayClick: true,
5788
+ unstyled: true,
5943
5789
  contentProps: {
5944
5790
  items,
5945
5791
  selectorProps,
@@ -5948,9 +5794,7 @@ class ContextMenuController {
5948
5794
  subMenu,
5949
5795
  eventData: event?.detail || event,
5950
5796
  onClose: () => {
5951
- this.services.uiDialogService.dismiss({
5952
- id: 'context-menu'
5953
- });
5797
+ this.services.uiDialogService.hide('context-menu');
5954
5798
  },
5955
5799
  /**
5956
5800
  * Displays a sub-menu, removing this menu
@@ -6095,7 +5939,7 @@ const RowComponent = ({
6095
5939
  ...style,
6096
5940
  ...rowStyle
6097
5941
  },
6098
- className: classnames_default()('hover:bg-secondary-main border-secondary-light flex w-full flex-row items-center break-all bg-black text-base transition duration-300', lineHeightClassName),
5942
+ className: classnames_default()('hover:bg-secondary-main border-secondary-light text-foreground flex w-full flex-row items-center break-all bg-black text-base transition duration-300', lineHeightClassName),
6099
5943
  key: keyPrefix
6100
5944
  }, isChildOrParent && /*#__PURE__*/react.createElement("div", {
6101
5945
  style: {
@@ -6309,7 +6153,7 @@ function DicomTagTable({
6309
6153
  itemCount: visibleRows.length,
6310
6154
  itemSize: getItemSize(visibleRows),
6311
6155
  width: '100%',
6312
- className: "ohif-scrollbar"
6156
+ className: "ohif-scrollbar text-foreground"
6313
6157
  }, getRowComponent({
6314
6158
  rows: visibleRows
6315
6159
  }))));
@@ -6451,7 +6295,8 @@ const DicomTagBrowser = ({
6451
6295
  className: "text-muted-foreground flex h-6 items-center text-xs"
6452
6296
  }, "Search metadata"), /*#__PURE__*/react.createElement(ui_src/* InputFilterText */.Cv, {
6453
6297
  placeholder: "Search metadata...",
6454
- onDebounceChange: setFilterValue
6298
+ onDebounceChange: setFilterValue,
6299
+ className: "text-foreground"
6455
6300
  })))), /*#__PURE__*/react.createElement(DicomTagBrowser_DicomTagTable, {
6456
6301
  rows: filteredRows
6457
6302
  }));
@@ -7557,11 +7402,10 @@ const commandsModule = ({
7557
7402
  content: DicomTagBrowser_DicomTagBrowser,
7558
7403
  contentProps: {
7559
7404
  displaySets,
7560
- displaySetInstanceUID: defaultDisplaySetInstanceUID,
7561
- onClose: UIModalService.hide
7405
+ displaySetInstanceUID: defaultDisplaySetInstanceUID
7562
7406
  },
7563
- containerDimensions: 'w-[70%] max-w-[900px]',
7564
- title: 'DICOM Tag Browser'
7407
+ title: 'DICOM Tag Browser',
7408
+ containerClassName: 'max-w-3xl'
7565
7409
  });
7566
7410
  },
7567
7411
  /**
@@ -9274,7 +9118,6 @@ function DataSourceConfigurationModalComponent({
9274
9118
 
9275
9119
 
9276
9120
 
9277
-
9278
9121
  function DataSourceConfigurationComponent({
9279
9122
  servicesManager,
9280
9123
  extensionManager
@@ -9285,7 +9128,7 @@ function DataSourceConfigurationComponent({
9285
9128
  const {
9286
9129
  show,
9287
9130
  hide
9288
- } = (0,ui_src/* useModal */.hS)();
9131
+ } = (0,ui_next_src/* useModal */.hS)();
9289
9132
  const {
9290
9133
  customizationService
9291
9134
  } = servicesManager.services;
@@ -9595,6 +9438,195 @@ const {
9595
9438
  /* harmony default export */ const notificationCustomization = ({
9596
9439
  'ui.notificationComponent': ui_src/* Notification */.Eg
9597
9440
  });
9441
+ // EXTERNAL MODULE: ../../../node_modules/browser-detect/dist/browser-detect.es5.js
9442
+ var browser_detect_es5 = __webpack_require__(88123);
9443
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/customizations/aboutModalCustomization.tsx
9444
+
9445
+
9446
+
9447
+ function AboutModalDefault() {
9448
+ const {
9449
+ os,
9450
+ version,
9451
+ name
9452
+ } = (0,browser_detect_es5/* default */.A)();
9453
+ const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`;
9454
+ const versionNumber = "3.10.0-beta.115";
9455
+ const commitHash = "a3b51aa8dba07c26c585c8b815bb6e427bcd461f";
9456
+ const [main, beta] = versionNumber.split('-');
9457
+ return /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT, {
9458
+ className: "w-[400px]"
9459
+ }, /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.ProductName, null, "OHIF Viewer"), /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.ProductVersion, null, main), beta && /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.ProductBeta, null, beta), /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.Body, null, /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.DetailItem, {
9460
+ label: "Commit Hash",
9461
+ value: commitHash
9462
+ }), /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.DetailItem, {
9463
+ label: "Current Browser & OS",
9464
+ value: `${browser}, ${os}`
9465
+ }), /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VT.SocialItem, {
9466
+ icon: "SocialGithub",
9467
+ url: "OHIF/Viewers",
9468
+ text: "github.com/OHIF/Viewers"
9469
+ })));
9470
+ }
9471
+ /* harmony default export */ const aboutModalCustomization = ({
9472
+ 'ohif.aboutModal': AboutModalDefault
9473
+ });
9474
+ // EXTERNAL MODULE: ../../i18n/src/index.js + 150 modules
9475
+ var i18n_src = __webpack_require__(16076);
9476
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/customizations/userPreferencesCustomization.tsx
9477
+
9478
+
9479
+
9480
+
9481
+
9482
+
9483
+ const {
9484
+ availableLanguages,
9485
+ defaultLanguage,
9486
+ currentLanguage: currentLanguageFn
9487
+ } = i18n_src/* default */.A;
9488
+ function UserPreferencesModalDefault({
9489
+ hide
9490
+ }) {
9491
+ const {
9492
+ hotkeysManager
9493
+ } = (0,src/* useSystem */.Jg)();
9494
+ const {
9495
+ t
9496
+ } = (0,es/* useTranslation */.Bd)('UserPreferencesModal');
9497
+ const {
9498
+ hotkeyDefinitions = {},
9499
+ hotkeyDefaults = {}
9500
+ } = hotkeysManager;
9501
+ const currentLanguage = currentLanguageFn();
9502
+ const [state, setState] = (0,react.useState)({
9503
+ hotkeyDefinitions: hotkeyDefinitions,
9504
+ languageValue: currentLanguage.value
9505
+ });
9506
+ const onLanguageChangeHandler = value => {
9507
+ setState(state => ({
9508
+ ...state,
9509
+ languageValue: value
9510
+ }));
9511
+ };
9512
+ const onHotkeyChangeHandler = (id, newKeys) => {
9513
+ setState(state => ({
9514
+ ...state,
9515
+ hotkeyDefinitions: {
9516
+ ...state.hotkeyDefinitions,
9517
+ [id]: {
9518
+ ...state.hotkeyDefinitions[id],
9519
+ keys: newKeys
9520
+ }
9521
+ }
9522
+ }));
9523
+ };
9524
+ const onResetHandler = () => {
9525
+ setState(state => ({
9526
+ ...state,
9527
+ languageValue: defaultLanguage.value,
9528
+ hotkeyDefinitions: hotkeyDefaults
9529
+ }));
9530
+ hotkeysManager.restoreDefaultBindings();
9531
+ };
9532
+ return /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM, null, /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM.Body, null, /*#__PURE__*/react.createElement("div", {
9533
+ className: "mb-3 flex items-center space-x-14"
9534
+ }, /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM.SubHeading, null, t('Language')), /*#__PURE__*/react.createElement(ui_next_src/* Select */.l6, {
9535
+ defaultValue: state.languageValue,
9536
+ onValueChange: onLanguageChangeHandler
9537
+ }, /*#__PURE__*/react.createElement(ui_next_src/* SelectTrigger */.bq, {
9538
+ className: "w-60",
9539
+ "aria-label": "Language"
9540
+ }, /*#__PURE__*/react.createElement(ui_next_src/* SelectValue */.yv, {
9541
+ placeholder: t('Select language')
9542
+ })), /*#__PURE__*/react.createElement(ui_next_src/* SelectContent */.gC, null, availableLanguages.map(lang => /*#__PURE__*/react.createElement(ui_next_src/* SelectItem */.eb, {
9543
+ key: lang.value,
9544
+ value: lang.value
9545
+ }, lang.label))))), /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM.SubHeading, null, t('Hotkeys')), /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM.HotkeysGrid, null, Object.entries(state.hotkeyDefinitions).map(([id, definition]) => /*#__PURE__*/react.createElement(ui_next_src/* UserPreferencesModal */.xM.Hotkey, {
9546
+ key: id,
9547
+ label: t(definition.label),
9548
+ value: definition.keys,
9549
+ onChange: newKeys => onHotkeyChangeHandler(id, newKeys),
9550
+ placeholder: definition.keys,
9551
+ hotkeys: src/* hotkeys */.ot
9552
+ })))), /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es, null, /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Left, null, /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Auxiliary, {
9553
+ onClick: onResetHandler
9554
+ }, t('Reset to defaults'))), /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Right, null, /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Secondary, {
9555
+ onClick: () => {
9556
+ src/* hotkeys */.ot.stopRecord();
9557
+ src/* hotkeys */.ot.unpause();
9558
+ hide();
9559
+ }
9560
+ }, t('Cancel')), /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Primary, {
9561
+ onClick: () => {
9562
+ if (state.languageValue !== currentLanguage.value) {
9563
+ i18n_src/* default */.A.changeLanguage(state.languageValue);
9564
+ }
9565
+ hotkeysManager.setHotkeys(state.hotkeyDefinitions);
9566
+ src/* hotkeys */.ot.stopRecord();
9567
+ src/* hotkeys */.ot.unpause();
9568
+ hide();
9569
+ }
9570
+ }, t('Save')))));
9571
+ }
9572
+ /* harmony default export */ const userPreferencesCustomization = ({
9573
+ 'ohif.userPreferencesModal': UserPreferencesModalDefault
9574
+ });
9575
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/customizations/reportDialogCustomization.tsx
9576
+
9577
+
9578
+
9579
+ function ReportDialog({
9580
+ dataSources,
9581
+ hide,
9582
+ onSave,
9583
+ onCancel
9584
+ }) {
9585
+ const [selectedDataSource, setSelectedDataSource] = (0,react.useState)(dataSources?.[0]?.value ?? null);
9586
+ const handleSave = reportName => {
9587
+ onSave({
9588
+ reportName,
9589
+ dataSource: selectedDataSource
9590
+ });
9591
+ hide();
9592
+ };
9593
+ const handleCancel = () => {
9594
+ onCancel();
9595
+ hide();
9596
+ };
9597
+ const showDataSourceSelect = dataSources?.length > 1;
9598
+ return /*#__PURE__*/react.createElement("div", {
9599
+ className: "text-foreground mt-2 flex min-w-[400px] max-w-md flex-col gap-4"
9600
+ }, /*#__PURE__*/react.createElement("div", {
9601
+ className: "flex flex-col gap-3"
9602
+ }, /*#__PURE__*/react.createElement("div", {
9603
+ className: showDataSourceSelect ? 'flex gap-4' : ''
9604
+ }, showDataSourceSelect && /*#__PURE__*/react.createElement("div", {
9605
+ className: "mt-1 w-1/3"
9606
+ }, /*#__PURE__*/react.createElement(ui_next_src/* Select */.l6, {
9607
+ value: selectedDataSource,
9608
+ onValueChange: setSelectedDataSource
9609
+ }, /*#__PURE__*/react.createElement(ui_next_src/* SelectTrigger */.bq, null, /*#__PURE__*/react.createElement(ui_next_src/* SelectValue */.yv, {
9610
+ placeholder: "Select a data source"
9611
+ })), /*#__PURE__*/react.createElement(ui_next_src/* SelectContent */.gC, null, dataSources.map(source => /*#__PURE__*/react.createElement(ui_next_src/* SelectItem */.eb, {
9612
+ key: source.value,
9613
+ value: source.value
9614
+ }, source.label))))), /*#__PURE__*/react.createElement("div", {
9615
+ className: showDataSourceSelect ? 'mt-1 w-2/3' : 'w-full'
9616
+ }, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Field, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Input, {
9617
+ placeholder: "Report name"
9618
+ }))))), /*#__PURE__*/react.createElement("div", {
9619
+ className: "flex justify-end gap-2"
9620
+ }, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Actions, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.ActionsSecondary, {
9621
+ onClick: handleCancel
9622
+ }, "Cancel"), /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.ActionsPrimary, {
9623
+ onClick: handleSave
9624
+ }, "Save"))))));
9625
+ }
9626
+
9627
+ /* harmony default export */ const reportDialogCustomization = ({
9628
+ 'ohif.createReportDialog': ReportDialog
9629
+ });
9598
9630
  ;// CONCATENATED MODULE: ../../../extensions/default/src/customizations/hotkeyBindingsCustomization.ts
9599
9631
 
9600
9632
  /* harmony default export */ const hotkeyBindingsCustomization = ({
@@ -9808,6 +9840,9 @@ function waitForElement(selector, maxAttempts = 20, interval = 25) {
9808
9840
 
9809
9841
 
9810
9842
 
9843
+
9844
+
9845
+
9811
9846
 
9812
9847
 
9813
9848
 
@@ -9857,6 +9892,9 @@ function getCustomizationModule({
9857
9892
  ...labellingFlowCustomization,
9858
9893
  ...contextMenuUICustomization,
9859
9894
  ...notificationCustomization,
9895
+ ...aboutModalCustomization,
9896
+ ...userPreferencesCustomization,
9897
+ ...reportDialogCustomization,
9860
9898
  ...hotkeyBindingsCustomization,
9861
9899
  ...onboardingCustomization
9862
9900
  }
@@ -10210,7 +10248,6 @@ function fixMultiValueKeys(naturalData, keys = ['ImageType']) {
10210
10248
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Actions/createReportAsync.tsx
10211
10249
 
10212
10250
 
10213
-
10214
10251
  /**
10215
10252
  *
10216
10253
  * @param {*} servicesManager
@@ -10225,15 +10262,11 @@ async function createReportAsync({
10225
10262
  uiNotificationService,
10226
10263
  uiDialogService
10227
10264
  } = servicesManager.services;
10228
- const loadingDialogId = uiDialogService.create({
10229
- showOverlay: true,
10230
- isDraggable: false,
10231
- centralize: true,
10232
- content: Loading
10233
- });
10234
10265
  try {
10235
10266
  const naturalizedReport = await getReport();
10236
- if (!naturalizedReport) return;
10267
+ if (!naturalizedReport) {
10268
+ return;
10269
+ }
10237
10270
 
10238
10271
  // The "Mode" route listens for DicomMetadataStore changes
10239
10272
  // When a new instance is added, it listens and
@@ -10255,16 +10288,9 @@ async function createReportAsync({
10255
10288
  });
10256
10289
  throw new Error(`Failed to store ${reportType}. Error: ${error.message || 'Unknown error'}`);
10257
10290
  } finally {
10258
- uiDialogService.dismiss({
10259
- id: loadingDialogId
10260
- });
10291
+ uiDialogService.hide('loading-dialog');
10261
10292
  }
10262
10293
  }
10263
- function Loading() {
10264
- return /*#__PURE__*/react.createElement("div", {
10265
- className: "text-primary-active"
10266
- }, "Loading...");
10267
- }
10268
10294
  /* harmony default export */ const Actions_createReportAsync = (createReportAsync);
10269
10295
  ;// CONCATENATED MODULE: ../../../extensions/default/src/stores/useUIStateStore.ts
10270
10296
 
@@ -10326,165 +10352,83 @@ const useUIStateStore = (0,zustand_esm/* create */.vt)()(useUIStateStore_DEBUG_S
10326
10352
 
10327
10353
 
10328
10354
 
10355
+ function InputDialogDefault({
10356
+ hide,
10357
+ onSave,
10358
+ placeholder = 'Enter value',
10359
+ defaultValue = '',
10360
+ submitOnEnter
10361
+ }) {
10362
+ return /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f, {
10363
+ submitOnEnter: submitOnEnter,
10364
+ defaultValue: defaultValue
10365
+ }, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Field, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Input, {
10366
+ placeholder: placeholder
10367
+ })), /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.Actions, null, /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.ActionsSecondary, {
10368
+ onClick: hide
10369
+ }, "Cancel"), /*#__PURE__*/react.createElement(ui_next_src/* InputDialog */.f.ActionsPrimary, {
10370
+ onClick: value => {
10371
+ onSave(value);
10372
+ hide();
10373
+ }
10374
+ }, "Save")));
10375
+ }
10376
+
10329
10377
  /**
10330
- *
10331
- * @param {*} data
10332
- * @param {*} data.text
10333
- * @param {*} data.label
10334
- * @param {*} event
10335
- * @param {*} callback
10336
- * @param {*} isArrowAnnotateInputDialog
10337
- * @param {*} dialogConfig
10338
- * @param {string?} dialogConfig.dialogTitle - title of the input dialog
10339
- * @param {string?} dialogConfig.inputLabel - show label above the input
10378
+ * Shows an input dialog for entering text with customizable options
10379
+ * @param uiDialogService - Service for showing UI dialogs
10380
+ * @param onSave - Callback function called when save button is clicked with entered value
10381
+ * @param defaultValue - Initial value to show in input field
10382
+ * @param title - Title text to show in dialog header
10383
+ * @param placeholder - Placeholder text for input field
10384
+ * @param submitOnEnter - Whether to submit dialog when Enter key is pressed
10340
10385
  */
10341
-
10342
- function callInputDialog(uiDialogService, data, callback, isArrowAnnotateInputDialog = true, dialogConfig = {}) {
10386
+ async function callInputDialog({
10387
+ uiDialogService,
10388
+ defaultValue = '',
10389
+ title = 'Annotation',
10390
+ placeholder = '',
10391
+ submitOnEnter = true
10392
+ }) {
10343
10393
  const dialogId = 'dialog-enter-annotation';
10344
- const label = data ? isArrowAnnotateInputDialog ? data.text : data.label : '';
10345
- const {
10346
- dialogTitle = 'Annotation',
10347
- inputLabel = 'Enter your annotation',
10348
- validateFunc = value => true
10349
- } = dialogConfig;
10350
- const onSubmitHandler = ({
10351
- action,
10352
- value
10353
- }) => {
10354
- switch (action.id) {
10355
- case 'save':
10356
- if (typeof validateFunc === 'function' && !validateFunc(value.label)) {
10357
- return;
10358
- }
10359
- callback(value.label, action.id);
10360
- break;
10361
- case 'cancel':
10362
- callback('', action.id);
10363
- break;
10364
- }
10365
- uiDialogService.dismiss({
10366
- id: dialogId
10367
- });
10368
- };
10369
- if (uiDialogService) {
10370
- uiDialogService.create({
10394
+ const value = await new Promise(resolve => {
10395
+ uiDialogService.show({
10371
10396
  id: dialogId,
10372
- centralize: true,
10373
- isDraggable: false,
10374
- showOverlay: true,
10375
- content: ui_src/* Dialog */.lG,
10397
+ content: InputDialogDefault,
10398
+ title: title,
10399
+ shouldCloseOnEsc: true,
10376
10400
  contentProps: {
10377
- title: dialogTitle,
10378
- value: {
10379
- label
10401
+ onSave: value => {
10402
+ resolve(value);
10380
10403
  },
10381
- noCloseButton: true,
10382
- onClose: () => uiDialogService.dismiss({
10383
- id: dialogId
10384
- }),
10385
- actions: [{
10386
- id: 'cancel',
10387
- text: 'Cancel',
10388
- type: ui_src/* ButtonEnums.type */.Ny.NW.secondary
10389
- }, {
10390
- id: 'save',
10391
- text: 'Save',
10392
- type: ui_src/* ButtonEnums.type */.Ny.NW.primary
10393
- }],
10394
- onSubmit: onSubmitHandler,
10395
- body: ({
10396
- value,
10397
- setValue
10398
- }) => {
10399
- return /*#__PURE__*/react.createElement(ui_src/* Input */.pd, {
10400
- autoFocus: true,
10401
- className: "border-primary-main bg-black",
10402
- type: "text",
10403
- id: "annotation",
10404
- label: inputLabel,
10405
- labelClassName: "text-white text-[14px] leading-[1.2]",
10406
- value: value.label,
10407
- onChange: event => {
10408
- event.persist();
10409
- setValue(value => ({
10410
- ...value,
10411
- label: event.target.value
10412
- }));
10413
- },
10414
- onKeyPress: event => {
10415
- if (event.key === 'Enter') {
10416
- onSubmitHandler({
10417
- value,
10418
- action: {
10419
- id: 'save'
10420
- }
10421
- });
10422
- }
10423
- }
10424
- });
10425
- }
10404
+ placeholder,
10405
+ defaultValue,
10406
+ submitOnEnter
10426
10407
  }
10427
10408
  });
10428
- }
10429
- }
10430
- function callLabelAutocompleteDialog(uiDialogService, callback, dialogConfig, labelConfig, renderContent = ui_src/* LabellingFlow */.nd) {
10431
- const exclusive = labelConfig ? labelConfig.exclusive : false;
10432
- const dropDownItems = labelConfig ? labelConfig.items : [];
10433
- const {
10434
- validateFunc = value => true
10435
- } = dialogConfig;
10436
- const labellingDoneCallback = value => {
10437
- if (typeof value === 'string') {
10438
- if (typeof validateFunc === 'function' && !validateFunc(value)) {
10439
- return;
10440
- }
10441
- callback(value, 'save');
10442
- } else {
10443
- callback('', 'cancel');
10444
- }
10445
- uiDialogService.dismiss({
10446
- id: 'select-annotation'
10447
- });
10448
- };
10449
- uiDialogService.create({
10450
- id: 'select-annotation',
10451
- centralize: true,
10452
- isDraggable: false,
10453
- showOverlay: true,
10454
- content: renderContent,
10455
- contentProps: {
10456
- labellingDoneCallback: labellingDoneCallback,
10457
- measurementData: {
10458
- label: ''
10459
- },
10460
- componentClassName: {},
10461
- labelData: dropDownItems,
10462
- exclusive: exclusive
10463
- }
10464
10409
  });
10410
+ return value;
10465
10411
  }
10466
- function showLabelAnnotationPopup(measurement, uiDialogService, labelConfig, renderContent = ui_src/* LabellingFlow */.nd) {
10412
+ async function callInputDialogAutoComplete({
10413
+ measurement,
10414
+ uiDialogService,
10415
+ labelConfig,
10416
+ renderContent = ui_src/* LabellingFlow */.nd
10417
+ }) {
10467
10418
  const exclusive = labelConfig ? labelConfig.exclusive : false;
10468
10419
  const dropDownItems = labelConfig ? labelConfig.items : [];
10469
- return new Promise((resolve, reject) => {
10420
+ const value = await new Promise((resolve, reject) => {
10470
10421
  const labellingDoneCallback = value => {
10471
- uiDialogService.dismiss({
10472
- id: 'select-annotation'
10473
- });
10422
+ uiDialogService.hide('select-annotation');
10474
10423
  if (typeof value === 'string') {
10475
10424
  measurement.label = value;
10476
10425
  }
10477
10426
  resolve(measurement);
10478
10427
  };
10479
- uiDialogService.create({
10428
+ uiDialogService.show({
10480
10429
  id: 'select-annotation',
10481
- isDraggable: false,
10482
- showOverlay: true,
10430
+ title: 'Annotation',
10483
10431
  content: renderContent,
10484
- defaultPosition: {
10485
- x: window.innerWidth / 2,
10486
- y: window.innerHeight / 2
10487
- },
10488
10432
  contentProps: {
10489
10433
  labellingDoneCallback: labellingDoneCallback,
10490
10434
  measurementData: measurement,
@@ -10494,6 +10438,7 @@ function showLabelAnnotationPopup(measurement, uiDialogService, labelConfig, ren
10494
10438
  }
10495
10439
  });
10496
10440
  });
10441
+ return value;
10497
10442
  }
10498
10443
  /* harmony default export */ const utils_callInputDialog = ((/* unused pure expression or super */ null && (callInputDialog)));
10499
10444
  // EXTERNAL MODULE: ../../../node_modules/react-color/es/index.js + 219 modules
@@ -10506,71 +10451,30 @@ var react_color_es = __webpack_require__(69175);
10506
10451
 
10507
10452
 
10508
10453
 
10509
- function colorPickerDialog(uiDialogService, rgbaColor, callback) {
10510
- const dialogId = 'pick-color';
10511
- const onSubmitHandler = ({
10512
- action,
10513
- value
10514
- }) => {
10515
- switch (action.id) {
10516
- case 'save':
10517
- callback(value.rgbaColor, action.id);
10518
- break;
10519
- case 'cancel':
10520
- callback('', action.id);
10521
- break;
10522
- }
10523
- uiDialogService.dismiss({
10524
- id: dialogId
10525
- });
10454
+ function ColorPickerDialog({
10455
+ value,
10456
+ hide,
10457
+ onSave
10458
+ }) {
10459
+ const [color, setColor] = (0,react.useState)(value);
10460
+ const handleChange = color => {
10461
+ setColor(color.rgb);
10526
10462
  };
10527
- if (uiDialogService) {
10528
- uiDialogService.create({
10529
- id: dialogId,
10530
- centralize: true,
10531
- isDraggable: false,
10532
- showOverlay: true,
10533
- content: ui_src/* Dialog */.lG,
10534
- contentProps: {
10535
- title: 'Segment Color',
10536
- value: {
10537
- rgbaColor
10538
- },
10539
- noCloseButton: true,
10540
- onClose: () => uiDialogService.dismiss({
10541
- id: dialogId
10542
- }),
10543
- actions: [{
10544
- id: 'cancel',
10545
- text: 'Cancel',
10546
- type: 'primary'
10547
- }, {
10548
- id: 'save',
10549
- text: 'Save',
10550
- type: 'secondary'
10551
- }],
10552
- onSubmit: onSubmitHandler,
10553
- body: ({
10554
- value,
10555
- setValue
10556
- }) => {
10557
- const handleChange = color => {
10558
- setValue({
10559
- rgbaColor: color.rgb
10560
- });
10561
- };
10562
- return /*#__PURE__*/react.createElement(react_color_es/* ChromePicker */.xk, {
10563
- color: value.rgbaColor,
10564
- onChange: handleChange,
10565
- presetColors: [],
10566
- width: 300
10567
- });
10568
- }
10569
- }
10570
- });
10571
- }
10463
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement(react_color_es/* ChromePicker */.xk, {
10464
+ color: color,
10465
+ onChange: handleChange,
10466
+ presetColors: [],
10467
+ width: 300
10468
+ }), /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es, null, /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Right, null, /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Secondary, {
10469
+ onClick: hide
10470
+ }, "Cancel"), /*#__PURE__*/react.createElement(ui_next_src/* FooterAction */.es.Primary, {
10471
+ onClick: () => {
10472
+ hide();
10473
+ onSave(color);
10474
+ }
10475
+ }, "Save"))));
10572
10476
  }
10573
- /* harmony default export */ const utils_colorPickerDialog = (colorPickerDialog);
10477
+ /* harmony default export */ const colorPickerDialog = (ColorPickerDialog);
10574
10478
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/getNextSRSeriesNumber.js
10575
10479
  const MIN_SR_SERIES_NUMBER = 4700;
10576
10480
  function getNextSRSeriesNumber(displaySetService) {
@@ -10580,65 +10484,64 @@ function getNextSRSeriesNumber(displaySetService) {
10580
10484
  const maxSeriesNumber = Math.max(...srSeriesNumbers, MIN_SR_SERIES_NUMBER);
10581
10485
  return maxSeriesNumber + 1;
10582
10486
  }
10583
- ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/promptSaveReport.js
10487
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/promptSaveReport.tsx
10584
10488
 
10585
10489
 
10586
10490
 
10587
10491
 
10588
- async function promptSaveReport({
10589
- servicesManager,
10590
- commandsManager,
10591
- extensionManager
10592
- }, ctx, evt) {
10492
+
10493
+ /**
10494
+ * Prompts the user to save a report and handles the report creation process
10495
+ * @param services - Object containing required services and managers
10496
+ * @param ctx - The current context containing tracked study and series information
10497
+ * @param evt - The event object containing viewport and save-related data
10498
+ */
10499
+ async function promptSaveReport(services, ctx, evt) {
10500
+ const {
10501
+ servicesManager,
10502
+ extensionManager,
10503
+ commandsManager
10504
+ } = services;
10593
10505
  const {
10594
- uiDialogService,
10595
10506
  measurementService,
10596
10507
  displaySetService
10597
10508
  } = servicesManager.services;
10598
- const viewportId = evt.viewportId === undefined ? evt.data.viewportId : evt.viewportId;
10599
- const isBackupSave = evt.isBackupSave === undefined ? evt.data.isBackupSave : evt.isBackupSave;
10600
- const StudyInstanceUID = evt?.data?.StudyInstanceUID;
10601
- const SeriesInstanceUID = evt?.data?.SeriesInstanceUID;
10509
+ const viewportId = evt.viewportId ?? evt.data?.viewportId;
10510
+ const isBackupSave = evt.isBackupSave ?? evt.data?.isBackupSave;
10511
+ const {
10512
+ StudyInstanceUID,
10513
+ SeriesInstanceUID
10514
+ } = evt?.data ?? {};
10602
10515
  const {
10603
10516
  trackedStudy,
10604
10517
  trackedSeries
10605
10518
  } = ctx;
10519
+ const dataSources = extensionManager.getDataSources();
10520
+ const {
10521
+ value: reportName,
10522
+ dataSourceName: dataSource,
10523
+ action
10524
+ } = await CreateReportDialogPrompt({
10525
+ servicesManager,
10526
+ extensionManager
10527
+ });
10606
10528
  let displaySetInstanceUIDs;
10607
10529
  try {
10608
- const promptResult = await CreateReportDialogPrompt(uiDialogService, {
10609
- extensionManager
10610
- });
10611
- if (promptResult.action === PROMPT_RESPONSES.CREATE_REPORT) {
10612
- const dataSources = extensionManager.getDataSources();
10613
- const dataSource = dataSources[0];
10614
- const measurements = measurementService.getMeasurements();
10615
- const trackedMeasurements = measurements.filter(m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)).filter(m => m.referencedImageId != null);
10616
- const SeriesDescription =
10617
- // isUndefinedOrEmpty
10618
- promptResult.value === undefined || promptResult.value === '' ? 'Research Derived Series' // default
10619
- : promptResult.value; // provided value
10620
-
10530
+ if (action === PROMPT_RESPONSES/* default */.A.CREATE_REPORT) {
10531
+ const selectedDataSource = dataSource ?? dataSources[0];
10532
+ const trackedMeasurements = getTrackedMeasurements(measurementService, trackedStudy, trackedSeries);
10621
10533
  const SeriesNumber = getNextSRSeriesNumber(displaySetService);
10622
- const getReport = async () => {
10623
- return commandsManager.runCommand('storeMeasurements', {
10624
- measurementData: trackedMeasurements,
10625
- dataSource,
10626
- additionalFindingTypes: ['ArrowAnnotate'],
10627
- options: {
10628
- SeriesDescription,
10629
- SeriesNumber
10630
- }
10631
- }, 'CORNERSTONE_STRUCTURED_REPORT');
10632
- };
10633
- displaySetInstanceUIDs = await Actions_createReportAsync({
10534
+ displaySetInstanceUIDs = await handleReportCreation({
10634
10535
  servicesManager,
10635
- getReport
10536
+ commandsManager,
10537
+ trackedMeasurements,
10538
+ selectedDataSource,
10539
+ reportName,
10540
+ SeriesNumber
10636
10541
  });
10637
- } else if (promptResult.action === RESPONSE.CANCEL) {
10638
- // Do nothing
10639
10542
  }
10640
10543
  return {
10641
- userResponse: promptResult.action,
10544
+ userResponse: action,
10642
10545
  createdDisplaySetInstanceUIDs: displaySetInstanceUIDs,
10643
10546
  StudyInstanceUID,
10644
10547
  SeriesInstanceUID,
@@ -10649,6 +10552,38 @@ async function promptSaveReport({
10649
10552
  return null;
10650
10553
  }
10651
10554
  }
10555
+
10556
+ /**
10557
+ * Gets tracked measurements based on study and series criteria
10558
+ */
10559
+ function getTrackedMeasurements(measurementService, trackedStudy, trackedSeries) {
10560
+ return measurementService.getMeasurements().filter(m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID)).filter(m => m.referencedImageId != null);
10561
+ }
10562
+
10563
+ /**
10564
+ * Handles the creation of the report using the measurement service
10565
+ */
10566
+ async function handleReportCreation({
10567
+ servicesManager,
10568
+ commandsManager,
10569
+ trackedMeasurements,
10570
+ selectedDataSource,
10571
+ reportName,
10572
+ SeriesNumber
10573
+ }) {
10574
+ return Actions_createReportAsync({
10575
+ servicesManager,
10576
+ getReport: () => commandsManager.runCommand('storeMeasurements', {
10577
+ measurementData: trackedMeasurements,
10578
+ dataSource: selectedDataSource,
10579
+ additionalFindingTypes: ['ArrowAnnotate'],
10580
+ options: {
10581
+ SeriesDescription: reportName,
10582
+ SeriesNumber
10583
+ }
10584
+ }, 'CORNERSTONE_STRUCTURED_REPORT')
10585
+ });
10586
+ }
10652
10587
  /* harmony default export */ const utils_promptSaveReport = (promptSaveReport);
10653
10588
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/promptLabelAnnotation.js
10654
10589
 
@@ -10658,7 +10593,8 @@ function promptLabelAnnotation({
10658
10593
  const {
10659
10594
  measurementService,
10660
10595
  customizationService,
10661
- toolGroupService
10596
+ toolGroupService,
10597
+ uiDialogService
10662
10598
  } = servicesManager.services;
10663
10599
  const {
10664
10600
  viewportId,
@@ -10667,29 +10603,36 @@ function promptLabelAnnotation({
10667
10603
  measurementId,
10668
10604
  toolName
10669
10605
  } = evt;
10670
- return new Promise(async function (resolve) {
10671
- const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
10672
- const activeToolOptions = toolGroup.getToolConfiguration(toolName);
10673
- if (activeToolOptions.getTextCallback) {
10674
- resolve({
10675
- StudyInstanceUID,
10676
- SeriesInstanceUID,
10677
- viewportId
10678
- });
10679
- } else {
10680
- const labelConfig = customizationService.getCustomization('measurementLabels');
10681
- const measurement = measurementService.getMeasurement(measurementId);
10682
- const renderContent = customizationService.getCustomization('ui.labellingComponent');
10683
- const value = await showLabelAnnotationPopup(measurement, servicesManager.services.uiDialogService, labelConfig, renderContent);
10684
- measurementService.update(measurementId, {
10685
- ...value
10686
- }, true);
10687
- resolve({
10688
- StudyInstanceUID,
10689
- SeriesInstanceUID,
10690
- viewportId
10691
- });
10692
- }
10606
+ return new Promise(resolve => {
10607
+ (async () => {
10608
+ const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
10609
+ const activeToolOptions = toolGroup.getToolConfiguration(toolName);
10610
+ if (activeToolOptions.getTextCallback) {
10611
+ resolve({
10612
+ StudyInstanceUID,
10613
+ SeriesInstanceUID,
10614
+ viewportId
10615
+ });
10616
+ } else {
10617
+ const labelConfig = customizationService.getCustomization('measurementLabels');
10618
+ const measurement = measurementService.getMeasurement(measurementId);
10619
+ const renderContent = customizationService.getCustomization('ui.labellingComponent');
10620
+ const value = await callInputDialogAutoComplete({
10621
+ measurement,
10622
+ uiDialogService,
10623
+ labelConfig,
10624
+ renderContent
10625
+ });
10626
+ measurementService.update(measurementId, {
10627
+ ...value
10628
+ }, true);
10629
+ resolve({
10630
+ StudyInstanceUID,
10631
+ SeriesInstanceUID,
10632
+ viewportId
10633
+ });
10634
+ }
10635
+ })();
10693
10636
  });
10694
10637
  }
10695
10638
  /* harmony default export */ const utils_promptLabelAnnotation = (promptLabelAnnotation);
@@ -10776,6 +10719,24 @@ const defaultExtension = {
10776
10719
  /* harmony default export */ const default_src = (defaultExtension);
10777
10720
 
10778
10721
 
10722
+ /***/ }),
10723
+
10724
+ /***/ 96357:
10725
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10726
+
10727
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10728
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
10729
+ /* harmony export */ });
10730
+ const RESPONSE = {
10731
+ NO_NEVER: -1,
10732
+ CANCEL: 0,
10733
+ CREATE_REPORT: 1,
10734
+ ADD_SERIES: 2,
10735
+ SET_STUDY_AND_SERIES: 3,
10736
+ NO_NOT_FOR_SERIES: 4
10737
+ };
10738
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RESPONSE);
10739
+
10779
10740
  /***/ })
10780
10741
 
10781
10742
  }]);