@eclipse-papyrus/papyrus-web-parent 2026.2.0

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 (340) hide show
  1. package/.prettierrc +22 -0
  2. package/.project +11 -0
  3. package/.turbo/cache/2e7de991e3eb5b77-meta.json +1 -0
  4. package/.turbo/cache/2e7de991e3eb5b77.tar.zst +0 -0
  5. package/.turbo/cache/6d4efa6c3019818e-meta.json +1 -0
  6. package/.turbo/cache/6d4efa6c3019818e.tar.zst +0 -0
  7. package/.turbo/cache/904b84e8ab6fefb1-meta.json +1 -0
  8. package/.turbo/cache/904b84e8ab6fefb1.tar.zst +0 -0
  9. package/.turbo/cache/b657accc57a869a6-meta.json +1 -0
  10. package/.turbo/cache/b657accc57a869a6.tar.zst +0 -0
  11. package/.turbo/cookies/1.cookie +0 -0
  12. package/.turbo/cookies/2.cookie +0 -0
  13. package/.turbo/cookies/3.cookie +0 -0
  14. package/.turbo/cookies/4.cookie +0 -0
  15. package/.turbo/cookies/5.cookie +0 -0
  16. package/.turbo/cookies/6.cookie +0 -0
  17. package/.turbo/cookies/7.cookie +0 -0
  18. package/.turbo/cookies/8.cookie +0 -0
  19. package/.turbo/daemon/8a1f25190e5082e3-turbo.log.2026-04-01 +0 -0
  20. package/package.json +32 -0
  21. package/papyrus-web/.env.development +2 -0
  22. package/papyrus-web/.prettierrc +22 -0
  23. package/papyrus-web/.turbo/turbo-build.log +30 -0
  24. package/papyrus-web/.turbo/turbo-format-lint.log +6 -0
  25. package/papyrus-web/README.adoc +84 -0
  26. package/papyrus-web/dist/assets/Lato-Black-B_kLSaRn.ttf +0 -0
  27. package/papyrus-web/dist/assets/Lato-BlackItalic-B2JUbIh8.ttf +0 -0
  28. package/papyrus-web/dist/assets/Lato-Bold-DBmunEOG.ttf +0 -0
  29. package/papyrus-web/dist/assets/Lato-BoldItalic-DfTVlc2v.ttf +0 -0
  30. package/papyrus-web/dist/assets/Lato-Italic-CxPt6gM6.ttf +0 -0
  31. package/papyrus-web/dist/assets/Lato-Light-Cg7pVZQZ.ttf +0 -0
  32. package/papyrus-web/dist/assets/Lato-LightItalic-BkbZ6uep.ttf +0 -0
  33. package/papyrus-web/dist/assets/Lato-Regular-57KsL5Ww.ttf +0 -0
  34. package/papyrus-web/dist/assets/Lato-Thin-CvSM47fD.ttf +0 -0
  35. package/papyrus-web/dist/assets/Lato-ThinItalic-9M4CJfMt.ttf +0 -0
  36. package/papyrus-web/dist/assets/browser-ponyfill-CVpHIrSq.js +2 -0
  37. package/papyrus-web/dist/assets/index-CjSWMYED.js +6122 -0
  38. package/papyrus-web/dist/assets/index-DJjGIuFa.css +1 -0
  39. package/papyrus-web/dist/assets/papyrus-icon-DqmMeq_6.png +0 -0
  40. package/papyrus-web/dist/favicon.ico +0 -0
  41. package/papyrus-web/dist/index.html +42 -0
  42. package/papyrus-web/dist/manifest.json +15 -0
  43. package/papyrus-web/dist/papyrus.ico +0 -0
  44. package/papyrus-web/index.html +41 -0
  45. package/papyrus-web/package.json +104 -0
  46. package/papyrus-web/public/favicon.ico +0 -0
  47. package/papyrus-web/public/manifest.json +15 -0
  48. package/papyrus-web/public/papyrus.ico +0 -0
  49. package/papyrus-web/src/ReactFlow.css +17 -0
  50. package/papyrus-web/src/core/PapyrusIcon.tsx +17 -0
  51. package/papyrus-web/src/core/PapyrusNavigationBarIcon.tsx +46 -0
  52. package/papyrus-web/src/core/URL.ts +34 -0
  53. package/papyrus-web/src/extensions/ExtensionRegistryMergeStrategy.ts +50 -0
  54. package/papyrus-web/src/fonts/Lato/Lato-Black.ttf +0 -0
  55. package/papyrus-web/src/fonts/Lato/Lato-BlackItalic.ttf +0 -0
  56. package/papyrus-web/src/fonts/Lato/Lato-Bold.ttf +0 -0
  57. package/papyrus-web/src/fonts/Lato/Lato-BoldItalic.ttf +0 -0
  58. package/papyrus-web/src/fonts/Lato/Lato-Italic.ttf +0 -0
  59. package/papyrus-web/src/fonts/Lato/Lato-Light.ttf +0 -0
  60. package/papyrus-web/src/fonts/Lato/Lato-LightItalic.ttf +0 -0
  61. package/papyrus-web/src/fonts/Lato/Lato-Regular.ttf +0 -0
  62. package/papyrus-web/src/fonts/Lato/Lato-Thin.ttf +0 -0
  63. package/papyrus-web/src/fonts/Lato/Lato-ThinItalic.ttf +0 -0
  64. package/papyrus-web/src/fonts/Lato/OFL.txt +93 -0
  65. package/papyrus-web/src/fonts.css +81 -0
  66. package/papyrus-web/src/footer/Footer.tsx +50 -0
  67. package/papyrus-web/src/icons/papyrus-icon.png +0 -0
  68. package/papyrus-web/src/index.tsx +325 -0
  69. package/papyrus-web/src/portals.css +16 -0
  70. package/papyrus-web/src/react-app-env.d.ts +1 -0
  71. package/papyrus-web/src/reset.css +218 -0
  72. package/papyrus-web/src/variables.css +111 -0
  73. package/papyrus-web/src/vite-env.d.ts +1 -0
  74. package/papyrus-web/tsconfig.json +34 -0
  75. package/papyrus-web/vite.config.js +24 -0
  76. package/papyrus-web-components/.prettierrc +22 -0
  77. package/papyrus-web-components/.turbo/turbo-build.log +77 -0
  78. package/papyrus-web-components/.turbo/turbo-format-lint.log +6 -0
  79. package/papyrus-web-components/README.adoc +13 -0
  80. package/papyrus-web-components/dist/diagram-tools/EditProjectView.types.d.ts +48 -0
  81. package/papyrus-web-components/dist/diagram-tools/EditProjectView.types.d.ts.map +1 -0
  82. package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.d.ts +3 -0
  83. package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.d.ts.map +1 -0
  84. package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.types.d.ts +33 -0
  85. package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.types.d.ts.map +1 -0
  86. package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.d.ts +15 -0
  87. package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.d.ts.map +1 -0
  88. package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.types.d.ts +20 -0
  89. package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.types.d.ts.map +1 -0
  90. package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.d.ts +3 -0
  91. package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.d.ts.map +1 -0
  92. package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.types.d.ts +53 -0
  93. package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.types.d.ts.map +1 -0
  94. package/papyrus-web-components/dist/diagram-tools/TransferModal.d.ts +3 -0
  95. package/papyrus-web-components/dist/diagram-tools/TransferModal.d.ts.map +1 -0
  96. package/papyrus-web-components/dist/diagram-tools/TransferModal.types.d.ts +32 -0
  97. package/papyrus-web-components/dist/diagram-tools/TransferModal.types.d.ts.map +1 -0
  98. package/papyrus-web-components/dist/index.d.ts +61 -0
  99. package/papyrus-web-components/dist/index.d.ts.map +1 -0
  100. package/papyrus-web-components/dist/nodes/NodesDocumentTransform.d.ts +15 -0
  101. package/papyrus-web-components/dist/nodes/NodesDocumentTransform.d.ts.map +1 -0
  102. package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.d.ts +18 -0
  103. package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.d.ts.map +1 -0
  104. package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.types.d.ts +29 -0
  105. package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.types.d.ts.map +1 -0
  106. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeConverter.d.ts +21 -0
  107. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeConverter.d.ts.map +1 -0
  108. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeLayoutHandler.d.ts +23 -0
  109. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeLayoutHandler.d.ts.map +1 -0
  110. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListConverter.d.ts +21 -0
  111. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListConverter.d.ts.map +1 -0
  112. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListLayoutHandler.d.ts +23 -0
  113. package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListLayoutHandler.d.ts.map +1 -0
  114. package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.d.ts +3 -0
  115. package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.d.ts.map +1 -0
  116. package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.types.d.ts +34 -0
  117. package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.types.d.ts.map +1 -0
  118. package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeConverter.d.ts +22 -0
  119. package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeConverter.d.ts.map +1 -0
  120. package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeLayoutHandler.d.ts +23 -0
  121. package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeLayoutHandler.d.ts.map +1 -0
  122. package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.d.ts +15 -0
  123. package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.d.ts.map +1 -0
  124. package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.types.d.ts +33 -0
  125. package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.types.d.ts.map +1 -0
  126. package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeConverter.d.ts +23 -0
  127. package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeConverter.d.ts.map +1 -0
  128. package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeLayoutHandler.d.ts +25 -0
  129. package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeLayoutHandler.d.ts.map +1 -0
  130. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.d.ts +18 -0
  131. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.d.ts.map +1 -0
  132. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.types.d.ts +23 -0
  133. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.types.d.ts.map +1 -0
  134. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeConverter.d.ts +21 -0
  135. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeConverter.d.ts.map +1 -0
  136. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeLayoutHandler.d.ts +21 -0
  137. package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeLayoutHandler.d.ts.map +1 -0
  138. package/papyrus-web-components/dist/nodes/note/NoteLabel.d.ts +18 -0
  139. package/papyrus-web-components/dist/nodes/note/NoteLabel.d.ts.map +1 -0
  140. package/papyrus-web-components/dist/nodes/note/NoteNode.d.ts +19 -0
  141. package/papyrus-web-components/dist/nodes/note/NoteNode.d.ts.map +1 -0
  142. package/papyrus-web-components/dist/nodes/note/NoteNode.types.d.ts +41 -0
  143. package/papyrus-web-components/dist/nodes/note/NoteNode.types.d.ts.map +1 -0
  144. package/papyrus-web-components/dist/nodes/note/NoteNodeConverter.d.ts +21 -0
  145. package/papyrus-web-components/dist/nodes/note/NoteNodeConverter.d.ts.map +1 -0
  146. package/papyrus-web-components/dist/nodes/note/NoteNodeLayoutHandler.d.ts +21 -0
  147. package/papyrus-web-components/dist/nodes/note/NoteNodeLayoutHandler.d.ts.map +1 -0
  148. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.d.ts +18 -0
  149. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.d.ts.map +1 -0
  150. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.types.d.ts +23 -0
  151. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.types.d.ts.map +1 -0
  152. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeConverter.d.ts +21 -0
  153. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeConverter.d.ts.map +1 -0
  154. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeLayoutHandler.d.ts +21 -0
  155. package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeLayoutHandler.d.ts.map +1 -0
  156. package/papyrus-web-components/dist/nodes/package/PackageNode.d.ts +18 -0
  157. package/papyrus-web-components/dist/nodes/package/PackageNode.d.ts.map +1 -0
  158. package/papyrus-web-components/dist/nodes/package/PackageNode.types.d.ts +29 -0
  159. package/papyrus-web-components/dist/nodes/package/PackageNode.types.d.ts.map +1 -0
  160. package/papyrus-web-components/dist/nodes/package/PackageNodeConverter.d.ts +21 -0
  161. package/papyrus-web-components/dist/nodes/package/PackageNodeConverter.d.ts.map +1 -0
  162. package/papyrus-web-components/dist/nodes/package/PackageNodeLayoutHandler.d.ts +23 -0
  163. package/papyrus-web-components/dist/nodes/package/PackageNodeLayoutHandler.d.ts.map +1 -0
  164. package/papyrus-web-components/dist/nodes/package/PackageNodeListConverter.d.ts +21 -0
  165. package/papyrus-web-components/dist/nodes/package/PackageNodeListConverter.d.ts.map +1 -0
  166. package/papyrus-web-components/dist/nodes/package/PackageNodeListLayoutHandler.d.ts +24 -0
  167. package/papyrus-web-components/dist/nodes/package/PackageNodeListLayoutHandler.d.ts.map +1 -0
  168. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.d.ts +18 -0
  169. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.d.ts.map +1 -0
  170. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.d.ts +23 -0
  171. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.d.ts.map +1 -0
  172. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.d.ts +21 -0
  173. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.d.ts.map +1 -0
  174. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.d.ts +20 -0
  175. package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.d.ts.map +1 -0
  176. package/papyrus-web-components/dist/papyrus-web-components.es.js +11710 -0
  177. package/papyrus-web-components/dist/papyrus-web-components.umd.js +11664 -0
  178. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.d.ts +3 -0
  179. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.d.ts.map +1 -0
  180. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.types.d.ts +55 -0
  181. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.types.d.ts.map +1 -0
  182. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModalMachine.d.ts +65 -0
  183. package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModalMachine.d.ts.map +1 -0
  184. package/papyrus-web-components/dist/profile/apply-profile/UMLModelTreeItemContextMenuContribution.d.ts +16 -0
  185. package/papyrus-web-components/dist/profile/apply-profile/UMLModelTreeItemContextMenuContribution.d.ts.map +1 -0
  186. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.d.ts +15 -0
  187. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.d.ts.map +1 -0
  188. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.types.d.ts +48 -0
  189. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.types.d.ts.map +1 -0
  190. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModalMachine.d.ts +65 -0
  191. package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModalMachine.d.ts.map +1 -0
  192. package/papyrus-web-components/dist/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.d.ts +16 -0
  193. package/papyrus-web-components/dist/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.d.ts.map +1 -0
  194. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.d.ts +16 -0
  195. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.d.ts.map +1 -0
  196. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.types.d.ts +72 -0
  197. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.types.d.ts.map +1 -0
  198. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.d.ts +16 -0
  199. package/papyrus-web-components/dist/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.d.ts.map +1 -0
  200. package/papyrus-web-components/dist/widgets/CustomWidgetsDocumentTransform.d.ts +15 -0
  201. package/papyrus-web-components/dist/widgets/CustomWidgetsDocumentTransform.d.ts.map +1 -0
  202. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceFragment.types.d.ts +145 -0
  203. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceFragment.types.d.ts.map +1 -0
  204. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceIcon.d.ts +16 -0
  205. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceIcon.d.ts.map +1 -0
  206. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferencePreview.d.ts +19 -0
  207. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferencePreview.d.ts.map +1 -0
  208. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceSection.d.ts +21 -0
  209. package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceSection.d.ts.map +1 -0
  210. package/papyrus-web-components/dist/widgets/containmentReference/ReorderIcon.d.ts +18 -0
  211. package/papyrus-web-components/dist/widgets/containmentReference/ReorderIcon.d.ts.map +1 -0
  212. package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.d.ts +17 -0
  213. package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.d.ts.map +1 -0
  214. package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.types.d.ts +23 -0
  215. package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.types.d.ts.map +1 -0
  216. package/papyrus-web-components/dist/widgets/customImage/AddImageIcon.d.ts +17 -0
  217. package/papyrus-web-components/dist/widgets/customImage/AddImageIcon.d.ts.map +1 -0
  218. package/papyrus-web-components/dist/widgets/customImage/CustomImageFragment.types.d.ts +83 -0
  219. package/papyrus-web-components/dist/widgets/customImage/CustomImageFragment.types.d.ts.map +1 -0
  220. package/papyrus-web-components/dist/widgets/customImage/CustomImageIcon.d.ts +17 -0
  221. package/papyrus-web-components/dist/widgets/customImage/CustomImageIcon.d.ts.map +1 -0
  222. package/papyrus-web-components/dist/widgets/customImage/CustomImagePreview.d.ts +20 -0
  223. package/papyrus-web-components/dist/widgets/customImage/CustomImagePreview.d.ts.map +1 -0
  224. package/papyrus-web-components/dist/widgets/customImage/CustomImageSection.d.ts +21 -0
  225. package/papyrus-web-components/dist/widgets/customImage/CustomImageSection.d.ts.map +1 -0
  226. package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.d.ts +17 -0
  227. package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.d.ts.map +1 -0
  228. package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.types.d.ts +29 -0
  229. package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.types.d.ts.map +1 -0
  230. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionFragment.types.d.ts +97 -0
  231. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionFragment.types.d.ts.map +1 -0
  232. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionIcon.d.ts +16 -0
  233. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionIcon.d.ts.map +1 -0
  234. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionPreview.d.ts +6 -0
  235. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionPreview.d.ts.map +1 -0
  236. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionSection.d.ts +21 -0
  237. package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionSection.d.ts.map +1 -0
  238. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPreview.d.ts +19 -0
  239. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPreview.d.ts.map +1 -0
  240. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.d.ts +7 -0
  241. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.d.ts.map +1 -0
  242. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.d.ts +135 -0
  243. package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.d.ts.map +1 -0
  244. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioFragment.type.d.ts +42 -0
  245. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioFragment.type.d.ts.map +1 -0
  246. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioIcon.d.ts +16 -0
  247. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioIcon.d.ts.map +1 -0
  248. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioPreview.d.ts +19 -0
  249. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioPreview.d.ts.map +1 -0
  250. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioSection.d.ts +18 -0
  251. package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioSection.d.ts.map +1 -0
  252. package/papyrus-web-components/package.json +105 -0
  253. package/papyrus-web-components/src/diagram-tools/EditProjectView.types.ts +56 -0
  254. package/papyrus-web-components/src/diagram-tools/FilterableSortableList.tsx +172 -0
  255. package/papyrus-web-components/src/diagram-tools/FilterableSortableList.types.ts +34 -0
  256. package/papyrus-web-components/src/diagram-tools/ModelBrowserFilterBar.tsx +73 -0
  257. package/papyrus-web-components/src/diagram-tools/ModelBrowserFilterBar.types.ts +19 -0
  258. package/papyrus-web-components/src/diagram-tools/PapyrusPopupToolContribution.tsx +206 -0
  259. package/papyrus-web-components/src/diagram-tools/PapyrusPopupToolContribution.types.ts +61 -0
  260. package/papyrus-web-components/src/diagram-tools/TransferModal.tsx +235 -0
  261. package/papyrus-web-components/src/diagram-tools/TransferModal.types.ts +35 -0
  262. package/papyrus-web-components/src/index.ts +61 -0
  263. package/papyrus-web-components/src/nodes/NodesDocumentTransform.ts +242 -0
  264. package/papyrus-web-components/src/nodes/cuboid/CuboidNode.tsx +183 -0
  265. package/papyrus-web-components/src/nodes/cuboid/CuboidNode.types.ts +30 -0
  266. package/papyrus-web-components/src/nodes/cuboid/CuboidNodeConverter.ts +201 -0
  267. package/papyrus-web-components/src/nodes/cuboid/CuboidNodeLayoutHandler.ts +283 -0
  268. package/papyrus-web-components/src/nodes/cuboid/CuboidNodeListConverter.ts +238 -0
  269. package/papyrus-web-components/src/nodes/cuboid/CuboidNodeListLayoutHandler.ts +260 -0
  270. package/papyrus-web-components/src/nodes/customImage/CustomImageNode.tsx +153 -0
  271. package/papyrus-web-components/src/nodes/customImage/CustomImageNode.types.ts +37 -0
  272. package/papyrus-web-components/src/nodes/customImage/CustomImageNodeConverter.ts +212 -0
  273. package/papyrus-web-components/src/nodes/customImage/CustomImageNodeLayoutHandler.ts +53 -0
  274. package/papyrus-web-components/src/nodes/ellipse/EllipseNode.tsx +119 -0
  275. package/papyrus-web-components/src/nodes/ellipse/EllipseNode.types.ts +35 -0
  276. package/papyrus-web-components/src/nodes/ellipse/EllipseNodeConverter.ts +208 -0
  277. package/papyrus-web-components/src/nodes/ellipse/EllipseNodeLayoutHandler.ts +284 -0
  278. package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNode.tsx +156 -0
  279. package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNode.types.ts +23 -0
  280. package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNodeConverter.ts +200 -0
  281. package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNodeLayoutHandler.ts +118 -0
  282. package/papyrus-web-components/src/nodes/note/NoteLabel.tsx +146 -0
  283. package/papyrus-web-components/src/nodes/note/NoteNode.tsx +168 -0
  284. package/papyrus-web-components/src/nodes/note/NoteNode.types.ts +43 -0
  285. package/papyrus-web-components/src/nodes/note/NoteNodeConverter.ts +200 -0
  286. package/papyrus-web-components/src/nodes/note/NoteNodeLayoutHandler.ts +85 -0
  287. package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNode.tsx +153 -0
  288. package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNode.types.ts +23 -0
  289. package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNodeConverter.ts +200 -0
  290. package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNodeLayoutHandler.ts +116 -0
  291. package/papyrus-web-components/src/nodes/package/PackageNode.tsx +200 -0
  292. package/papyrus-web-components/src/nodes/package/PackageNode.types.ts +30 -0
  293. package/papyrus-web-components/src/nodes/package/PackageNodeConverter.ts +243 -0
  294. package/papyrus-web-components/src/nodes/package/PackageNodeLayoutHandler.ts +229 -0
  295. package/papyrus-web-components/src/nodes/package/PackageNodeListConverter.ts +254 -0
  296. package/papyrus-web-components/src/nodes/package/PackageNodeListLayoutHandler.ts +253 -0
  297. package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.tsx +155 -0
  298. package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.ts +23 -0
  299. package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.ts +205 -0
  300. package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.ts +55 -0
  301. package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModal.tsx +238 -0
  302. package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModal.types.tsx +65 -0
  303. package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModalMachine.tsx +175 -0
  304. package/papyrus-web-components/src/profile/apply-profile/UMLModelTreeItemContextMenuContribution.tsx +74 -0
  305. package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModal.tsx +248 -0
  306. package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModal.types.ts +57 -0
  307. package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModalMachine.ts +185 -0
  308. package/papyrus-web-components/src/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.tsx +70 -0
  309. package/papyrus-web-components/src/profile/publish-profile/PublishProfileDialog.tsx +380 -0
  310. package/papyrus-web-components/src/profile/publish-profile/PublishProfileDialog.types.ts +84 -0
  311. package/papyrus-web-components/src/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.tsx +59 -0
  312. package/papyrus-web-components/src/widgets/CustomWidgetsDocumentTransform.ts +215 -0
  313. package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceFragment.types.ts +178 -0
  314. package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceIcon.tsx +38 -0
  315. package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferencePreview.tsx +106 -0
  316. package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceSection.tsx +508 -0
  317. package/papyrus-web-components/src/widgets/containmentReference/ReorderIcon.tsx +31 -0
  318. package/papyrus-web-components/src/widgets/containmentReference/dialogs/CreateNewChildDialog.tsx +104 -0
  319. package/papyrus-web-components/src/widgets/containmentReference/dialogs/CreateNewChildDialog.types.ts +24 -0
  320. package/papyrus-web-components/src/widgets/customImage/AddImageIcon.tsx +35 -0
  321. package/papyrus-web-components/src/widgets/customImage/CustomImageFragment.types.ts +98 -0
  322. package/papyrus-web-components/src/widgets/customImage/CustomImageIcon.tsx +34 -0
  323. package/papyrus-web-components/src/widgets/customImage/CustomImagePreview.tsx +87 -0
  324. package/papyrus-web-components/src/widgets/customImage/CustomImageSection.tsx +348 -0
  325. package/papyrus-web-components/src/widgets/dialogs/ReorderItemsDialog.tsx +145 -0
  326. package/papyrus-web-components/src/widgets/dialogs/ReorderItemsDialog.types.ts +30 -0
  327. package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionFragment.types.ts +117 -0
  328. package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionIcon.tsx +36 -0
  329. package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionPreview.tsx +163 -0
  330. package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionSection.tsx +548 -0
  331. package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPreview.tsx +158 -0
  332. package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPropertySection.tsx +616 -0
  333. package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.ts +162 -0
  334. package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioFragment.type.ts +49 -0
  335. package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioIcon.tsx +36 -0
  336. package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioPreview.tsx +88 -0
  337. package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioSection.tsx +128 -0
  338. package/papyrus-web-components/tsconfig.json +14 -0
  339. package/papyrus-web-components/vite.config.js +26 -0
  340. package/turbo.json +31 -0
@@ -0,0 +1,185 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2021, 2025 CEA LIST, Obeo.
3
+ * This program and the accompanying materials
4
+ * are made available under the terms of the Eclipse Public License v2.0
5
+ * which accompanies this distribution, and is available at
6
+ * https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ *
10
+ * Contributors:
11
+ * Obeo - initial API and implementation
12
+ *******************************************************************************/
13
+ import {
14
+ GQLApplyStereotypeMutationData,
15
+ GQLGetStereotypesQueryData,
16
+ GQLStereotypeMetadata,
17
+ } from './ApplyStereotypeModal.types';
18
+ import { assign, Machine } from 'xstate';
19
+
20
+ export interface ApplyStereotypeModalStateSchema {
21
+ states: {
22
+ toast: {
23
+ states: {
24
+ visible: {};
25
+ hidden: {};
26
+ };
27
+ };
28
+ applyStereotypeModal: {
29
+ states: {
30
+ loading: {};
31
+ valid: {};
32
+ applyingStereotype: {};
33
+ success: {};
34
+ };
35
+ };
36
+ };
37
+ }
38
+
39
+ export type SchemaValue = {
40
+ applyStereotypeModal: 'loading' | 'valid' | 'applyingStereotype' | 'success';
41
+ toast: 'visible' | 'hidden';
42
+ };
43
+
44
+ export interface ApplyStereotypeModalContext {
45
+ selectedStereotypeId: string;
46
+ stereotypes: GQLStereotypeMetadata[];
47
+ message: string | null;
48
+ }
49
+
50
+ export type ShowToastEvent = { type: 'SHOW_TOAST'; message: string };
51
+ export type HideToastEvent = { type: 'HIDE_TOAST' };
52
+ export type FetchedStereotypesEvent = {
53
+ type: 'HANDLE_FETCHED_STEREOTYPES';
54
+ data: GQLGetStereotypesQueryData;
55
+ };
56
+ export type ChangeStereotypeEvent = {
57
+ type: 'CHANGE_STEREOTYPE';
58
+ stereotypeId: string;
59
+ };
60
+
61
+ export type ApplyStereotypeEvent = { type: 'APPLY_STEREOTYPE' };
62
+ export type HandleResponseEvent = { type: 'HANDLE_RESPONSE'; data: GQLApplyStereotypeMutationData };
63
+ export type ApplyStereotypeModalEvent =
64
+ | FetchedStereotypesEvent
65
+ | ChangeStereotypeEvent
66
+ | ApplyStereotypeEvent
67
+ | HandleResponseEvent
68
+ | ShowToastEvent
69
+ | HideToastEvent;
70
+
71
+ export const applyStereotypeModalMachine = Machine<
72
+ ApplyStereotypeModalContext,
73
+ ApplyStereotypeModalStateSchema,
74
+ ApplyStereotypeModalEvent
75
+ >(
76
+ {
77
+ id: 'ApplyStereotypesModal',
78
+ type: 'parallel',
79
+ context: {
80
+ selectedStereotypeId: '',
81
+ stereotypes: [],
82
+ message: null,
83
+ },
84
+ states: {
85
+ toast: {
86
+ initial: 'hidden',
87
+ states: {
88
+ hidden: {
89
+ on: {
90
+ SHOW_TOAST: {
91
+ target: 'visible',
92
+ actions: 'setMessage',
93
+ },
94
+ },
95
+ },
96
+ visible: {
97
+ on: {
98
+ HIDE_TOAST: {
99
+ target: 'hidden',
100
+ actions: 'clearMessage',
101
+ },
102
+ },
103
+ },
104
+ },
105
+ },
106
+ applyStereotypeModal: {
107
+ initial: 'loading',
108
+ states: {
109
+ loading: {
110
+ on: {
111
+ HANDLE_FETCHED_STEREOTYPES: [
112
+ {
113
+ target: 'valid',
114
+ actions: 'updateStereotypes',
115
+ },
116
+ ],
117
+ },
118
+ },
119
+ valid: {
120
+ on: {
121
+ CHANGE_STEREOTYPE: [
122
+ {
123
+ actions: 'updateStereotype',
124
+ },
125
+ ],
126
+ APPLY_STEREOTYPE: [
127
+ {
128
+ target: 'applyingStereotype',
129
+ },
130
+ ],
131
+ },
132
+ },
133
+ applyingStereotype: {
134
+ on: {
135
+ HANDLE_RESPONSE: [
136
+ {
137
+ cond: 'isResponseSuccessful',
138
+ target: 'success',
139
+ },
140
+ {
141
+ target: 'valid',
142
+ },
143
+ ],
144
+ },
145
+ },
146
+ success: {
147
+ type: 'final',
148
+ },
149
+ },
150
+ },
151
+ },
152
+ },
153
+ {
154
+ guards: {
155
+ isResponseSuccessful: (_, event) => {
156
+ const { data } = event as HandleResponseEvent;
157
+ return data.applyStereotype.__typename === 'ApplyStereotypeSuccessPayload';
158
+ },
159
+ },
160
+ actions: {
161
+ updateStereotypes: assign((_, event) => {
162
+ const { data } = event as FetchedStereotypesEvent;
163
+ const stereotypes = data.viewer.editingContext.stereotypeMetatadas;
164
+ const selectedStereotypeId = stereotypes.length > 0 ? stereotypes[0].id : '';
165
+ const name = stereotypes.length > 0 ? stereotypes[0].label : '';
166
+ return {
167
+ stereotypes,
168
+ selectedStereotypeId,
169
+ name,
170
+ };
171
+ }),
172
+ updateStereotype: assign((_, event) => {
173
+ const { stereotypeId } = event as ChangeStereotypeEvent;
174
+ return { selectedStereotypeId: stereotypeId };
175
+ }),
176
+ setMessage: assign((_, event) => {
177
+ const { message } = event as ShowToastEvent;
178
+ return { message };
179
+ }),
180
+ clearMessage: assign((_) => {
181
+ return { message: null };
182
+ }),
183
+ },
184
+ }
185
+ );
@@ -0,0 +1,70 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2021, 2025 CEA LIST, Obeo.
3
+ * This program and the accompanying materials
4
+ * are made available under the terms of the Eclipse Public License v2.0
5
+ * which accompanies this distribution, and is available at
6
+ * https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ *
10
+ * Contributors:
11
+ * Obeo - initial API and implementation
12
+ *******************************************************************************/
13
+ import { TreeItemContextMenuComponentProps } from '@eclipse-sirius/sirius-components-trees';
14
+ import ListItemIcon from '@mui/material/ListItemIcon';
15
+ import ListItemText from '@mui/material/ListItemText';
16
+ import MenuItem from '@mui/material/MenuItem';
17
+ import AddIcon from '@mui/icons-material/Add';
18
+ import { forwardRef, Fragment, useState } from 'react';
19
+ import { ApplyStereotypeModal } from './ApplyStereotypeModal';
20
+
21
+ type Modal = 'ApplyStereotype';
22
+
23
+ export const UMLElementTreeItemContextMenuContribution = forwardRef(
24
+ (
25
+ { editingContextId, item, treeId, readOnly, onClose }: TreeItemContextMenuComponentProps,
26
+ ref: React.ForwardedRef<HTMLLIElement>
27
+ ) => {
28
+ const [modal, setModal] = useState<Modal | null>(null);
29
+
30
+ const onAppliedStereotype = () => {
31
+ onClose();
32
+ };
33
+
34
+ let modalElement: JSX.Element | null = null;
35
+ if (modal === 'ApplyStereotype') {
36
+ modalElement = (
37
+ <ApplyStereotypeModal
38
+ editingContextId={editingContextId}
39
+ item={item}
40
+ onAppliedStereotype={onAppliedStereotype}
41
+ onClose={onClose}
42
+ />
43
+ );
44
+ }
45
+
46
+ const isApplyStereotypeMenuVisible =
47
+ treeId.startsWith('explorer://') && item.editable && item.kind.includes('siriusComponents://semantic?domain=uml');
48
+ if (isApplyStereotypeMenuVisible) {
49
+ return (
50
+ <Fragment key="umlelement-tree-item-context-menu-contribution">
51
+ <MenuItem
52
+ key="apply-stereotype"
53
+ data-testid="apply-stereotype"
54
+ onClick={() => setModal('ApplyStereotype')}
55
+ ref={ref}
56
+ disabled={readOnly}
57
+ aria-disabled>
58
+ <ListItemIcon>
59
+ <AddIcon fontSize="small" />
60
+ </ListItemIcon>
61
+ <ListItemText primary="Apply a stereotype" />
62
+ </MenuItem>
63
+ {modalElement}
64
+ </Fragment>
65
+ );
66
+ } else {
67
+ return null;
68
+ }
69
+ }
70
+ );
@@ -0,0 +1,380 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2023, 2025 CEA LIST, Obeo.
3
+ *
4
+ * All rights reserved. This program and the accompanying materials
5
+ * are made available under the terms of the Eclipse Public License 2.0
6
+ * which accompanies this distribution, and is available at
7
+ * https://www.eclipse.org/legal/epl-2.0/
8
+ *
9
+ * SPDX-License-Identifier: EPL-2.0
10
+ *
11
+ * Contributors:
12
+ * Obeo - Initial API and implementation
13
+ *******************************************************************************/
14
+
15
+ import { gql, useMutation, useQuery } from '@apollo/client';
16
+ import Button from '@mui/material/Button';
17
+ import Checkbox from '@mui/material/Checkbox';
18
+ import Dialog from '@mui/material/Dialog';
19
+ import DialogActions from '@mui/material/DialogActions';
20
+ import DialogContent from '@mui/material/DialogContent';
21
+ import DialogTitle from '@mui/material/DialogTitle';
22
+ import FormControlLabel from '@mui/material/FormControlLabel';
23
+ import IconButton from '@mui/material/IconButton';
24
+ import Snackbar from '@mui/material/Snackbar';
25
+ import { makeStyles } from 'tss-react/mui';
26
+ import TextField from '@mui/material/TextField';
27
+ import Typography from '@mui/material/Typography';
28
+ import CloseIcon from '@mui/icons-material/Close';
29
+ import { useEffect, useState } from 'react';
30
+ import {
31
+ ErrorPayload,
32
+ GQLGetProfileLastVersionQueryData,
33
+ GQLGetProfileLastVersionQueryVariables,
34
+ NewVersionKind,
35
+ PublishProfileData,
36
+ PublishProfileDialogProps,
37
+ PublishProfileDialogState,
38
+ PublishProfileVariables,
39
+ } from './PublishProfileDialog.types';
40
+
41
+ const publishProfileMutation = gql`
42
+ mutation publishProfile($input: PublishProfileInput!) {
43
+ publishProfile(input: $input) {
44
+ __typename
45
+ ... on ErrorPayload {
46
+ message
47
+ }
48
+ }
49
+ }
50
+ `;
51
+ const getProfileLastVersion = gql`
52
+ query getProfileLastVersion($editingContextId: ID!, $profileId: ID!) {
53
+ viewer {
54
+ editingContext(editingContextId: $editingContextId) {
55
+ profileLastVersion(profileId: $profileId) {
56
+ major
57
+ minor
58
+ micro
59
+ }
60
+ }
61
+ }
62
+ }
63
+ `;
64
+
65
+ const usePublishProfileDialogStyles = makeStyles()((theme) => ({
66
+ content: {
67
+ display: 'flex',
68
+ flexDirection: 'column',
69
+ gap: theme.spacing(3),
70
+ },
71
+ main: {
72
+ display: 'grid',
73
+ gridTemplateColumns: '1fr 1fr',
74
+ gridTemplateRows: '1fr',
75
+ gap: theme.spacing(4),
76
+ },
77
+ version: {
78
+ display: 'flex',
79
+ flexDirection: 'column',
80
+ },
81
+ versionEntries: {
82
+ display: 'grid',
83
+ gridTemplateRows: 'repeat(4, 1fr)',
84
+ gridTemplateColumns: '3fr 1fr',
85
+ gap: theme.spacing(1),
86
+ },
87
+ info: {},
88
+ comments: {},
89
+ copyright: {},
90
+ }));
91
+
92
+ export const PublishProfileDialog = ({ editingContextId, item, onClose }: PublishProfileDialogProps) => {
93
+ const { classes } = usePublishProfileDialogStyles();
94
+
95
+ const [state, setState] = useState<PublishProfileDialogState>({
96
+ customVersion: '0.0.0',
97
+ selectedNewVersionKind: 'Development',
98
+ date: '',
99
+ author: '',
100
+ comments: '',
101
+ copyright: '',
102
+ message: null,
103
+ });
104
+
105
+ // DATE MANAGMENT
106
+ useEffect(() => {
107
+ const currentDate = new Date();
108
+ const year = currentDate.toLocaleString('default', { year: 'numeric' });
109
+ const month = currentDate.toLocaleString('default', { month: '2-digit' });
110
+ const day = currentDate.toLocaleString('default', { day: '2-digit' });
111
+
112
+ setState((prevState) => ({
113
+ ...prevState,
114
+ date: `${year}-${month}-${day}`,
115
+ }));
116
+ }, []);
117
+
118
+ const onDateChange = (event) => {
119
+ const {
120
+ target: { value },
121
+ } = event;
122
+ setState((prevState) => ({
123
+ ...prevState,
124
+ date: value,
125
+ }));
126
+ };
127
+
128
+ //VERSION MANAGEMENT
129
+ let currentVersion = 'Loading...';
130
+ let newDevVersion = 'Loading...';
131
+ let newReleaseVersion = 'Loading...';
132
+ let newMajorVersion = 'Loading...';
133
+
134
+ const {
135
+ loading: loadingQuery,
136
+ error: errorQuery,
137
+ data: dataQuery,
138
+ } = useQuery<GQLGetProfileLastVersionQueryData, GQLGetProfileLastVersionQueryVariables>(getProfileLastVersion, {
139
+ variables: { editingContextId, profileId: item.id },
140
+ });
141
+ if (dataQuery?.viewer?.editingContext?.profileLastVersion) {
142
+ const { major, minor, micro } = dataQuery.viewer.editingContext.profileLastVersion;
143
+ currentVersion = `${major}.${minor}.${micro}`;
144
+ newDevVersion = `${major}.${minor}.${micro + 1}`;
145
+ newReleaseVersion = `${major}.${minor + 1}.0`;
146
+ newMajorVersion = `${major + 1}.0.0`;
147
+ }
148
+
149
+ useEffect(() => {
150
+ if (!loadingQuery) {
151
+ if (errorQuery) {
152
+ setState((prevState) => ({ ...prevState, message: errorQuery.message }));
153
+ } else if (!dataQuery?.viewer?.editingContext?.profileLastVersion) {
154
+ setState((prevState) => ({ ...prevState, message: 'Failed to retrieve the current version of the profile' }));
155
+ }
156
+ }
157
+ }, [loadingQuery, dataQuery, errorQuery]);
158
+
159
+ const onChange = (name: string, event) => {
160
+ const {
161
+ target: { value },
162
+ } = event;
163
+ setState((prevState) => ({ ...prevState, [name]: value }));
164
+ };
165
+
166
+ const onCheckboxChange = (versionKind: NewVersionKind) => {
167
+ setState((prevState) => ({ ...prevState, selectedNewVersionKind: versionKind }));
168
+ };
169
+
170
+ // VALIDATION
171
+ const isPublishEnabled = () => {
172
+ let valid: boolean = !loadingQuery && dataQuery?.viewer?.editingContext?.profileLastVersion !== null;
173
+ if (valid && state.selectedNewVersionKind === 'Custom') {
174
+ const versions = state.customVersion.split('.');
175
+ valid =
176
+ versions.length === 3 &&
177
+ isCorrectDigit(versions[0]) &&
178
+ isCorrectDigit(versions[1]) &&
179
+ isCorrectDigit(versions[2]);
180
+ }
181
+ return valid;
182
+ };
183
+
184
+ const isCorrectDigit = (str) => {
185
+ var n = Math.floor(Number(str));
186
+ return n !== Infinity && String(n) === str && n >= 0;
187
+ };
188
+
189
+ // PUBLISH ACTION
190
+ const [publishProfile, { data, error }] = useMutation<PublishProfileData, PublishProfileVariables>(
191
+ publishProfileMutation
192
+ );
193
+ useEffect(() => {
194
+ if (error) setState((prevState) => ({ ...prevState, message: error.message }));
195
+ if (data && data.publishProfile.__typename === 'ErrorPayload') {
196
+ const errorPayload = data.publishProfile as ErrorPayload;
197
+ setState((prevState) => ({ ...prevState, message: errorPayload.message }));
198
+ } else if (data && data.publishProfile.__typename === 'PublishProfileSuccessPayload') {
199
+ onClose();
200
+ }
201
+ }, [data, error, onClose]);
202
+
203
+ const handlePublishProfile: React.MouseEventHandler<HTMLButtonElement> = () => {
204
+ let version: String;
205
+ if (state.selectedNewVersionKind === 'Development') {
206
+ version = newDevVersion;
207
+ } else if (state.selectedNewVersionKind === 'Release') {
208
+ version = newReleaseVersion;
209
+ } else if (state.selectedNewVersionKind === 'Major') {
210
+ version = newMajorVersion;
211
+ } else {
212
+ version = state.customVersion;
213
+ }
214
+ const variables: PublishProfileVariables = {
215
+ input: {
216
+ id: crypto.randomUUID(),
217
+ editingContextId,
218
+ objectId: item.id,
219
+ version: version,
220
+ comment: state.comments,
221
+ copyright: state.copyright,
222
+ author: state.author,
223
+ date: state.date,
224
+ saveOCLConstraint: true,
225
+ },
226
+ };
227
+ publishProfile({ variables });
228
+ };
229
+
230
+ return (
231
+ <>
232
+ <Dialog open={true} onClose={onClose} maxWidth="md" fullWidth data-testid="publish-profile-dialog">
233
+ <DialogTitle>Publish the profile</DialogTitle>
234
+ <DialogContent className={classes.content}>
235
+ <div className={classes.main}>
236
+ <div className={classes.version}>
237
+ <Typography gutterBottom>Version</Typography>
238
+ <Typography variant="caption">previous version: {currentVersion}</Typography>
239
+ <div className={classes.versionEntries}>
240
+ <FormControlLabel
241
+ control={
242
+ <Checkbox
243
+ name="custom"
244
+ color="primary"
245
+ checked={state.selectedNewVersionKind === 'Development'}
246
+ onChange={(_) => onCheckboxChange('Development')}
247
+ />
248
+ }
249
+ label="Development version"
250
+ />
251
+ <Typography>{newDevVersion}</Typography>
252
+ <FormControlLabel
253
+ control={
254
+ <Checkbox
255
+ name="custom"
256
+ color="primary"
257
+ checked={state.selectedNewVersionKind === 'Release'}
258
+ onChange={(_) => onCheckboxChange('Release')}
259
+ />
260
+ }
261
+ label="Release version"
262
+ />
263
+ <Typography>{newReleaseVersion}</Typography>
264
+ <FormControlLabel
265
+ control={
266
+ <Checkbox
267
+ name="custom"
268
+ color="primary"
269
+ checked={state.selectedNewVersionKind === 'Major'}
270
+ onChange={(_) => onCheckboxChange('Major')}
271
+ />
272
+ }
273
+ label="Major release"
274
+ />
275
+ <Typography>{newMajorVersion}</Typography>
276
+ <FormControlLabel
277
+ control={
278
+ <Checkbox
279
+ name="custom"
280
+ color="primary"
281
+ checked={state.selectedNewVersionKind === 'Custom'}
282
+ onChange={(_) => onCheckboxChange('Custom')}
283
+ />
284
+ }
285
+ label="Custom"
286
+ />
287
+ <TextField
288
+ variant="outlined"
289
+ margin="dense"
290
+ value={state.customVersion}
291
+ onChange={(event) => onChange('customVersion', event)}
292
+ fullWidth
293
+ disabled={state.selectedNewVersionKind !== 'Custom'}
294
+ />
295
+ </div>
296
+ </div>
297
+
298
+ <div className={classes.info}>
299
+ <Typography gutterBottom>Info</Typography>
300
+ <TextField
301
+ id="date"
302
+ label="Date"
303
+ type="date"
304
+ defaultValue={state.date}
305
+ onChange={onDateChange}
306
+ InputLabelProps={{
307
+ shrink: true,
308
+ }}
309
+ />
310
+ <TextField
311
+ data-testid="publish-profile-author"
312
+ label="Author"
313
+ value={state.author}
314
+ onChange={(event) => onChange('author', event)}
315
+ fullWidth
316
+ />
317
+ </div>
318
+ </div>
319
+
320
+ <div className={classes.comments}>
321
+ <TextField
322
+ data-testid="publish-profile-comment"
323
+ label="Comments"
324
+ value={state.comments}
325
+ onChange={(event) => onChange('comments', event)}
326
+ multiline
327
+ minRows={4}
328
+ fullWidth
329
+ />
330
+ </div>
331
+
332
+ <div className={classes.copyright}>
333
+ <TextField
334
+ data-testid="publish-profile-copyright"
335
+ label="Copyright"
336
+ value={state.copyright}
337
+ onChange={(event) => onChange('copyright', event)}
338
+ multiline
339
+ minRows={4}
340
+ fullWidth
341
+ />
342
+ </div>
343
+ </DialogContent>
344
+ <DialogActions>
345
+ <Button onClick={onClose} variant="contained" color="secondary">
346
+ Cancel
347
+ </Button>
348
+ <Button
349
+ data-testid="publish-profile-publish"
350
+ onClick={handlePublishProfile}
351
+ variant="contained"
352
+ color="primary"
353
+ disabled={!isPublishEnabled()}>
354
+ Publish
355
+ </Button>
356
+ </DialogActions>
357
+ </Dialog>
358
+ <Snackbar
359
+ anchorOrigin={{
360
+ vertical: 'bottom',
361
+ horizontal: 'right',
362
+ }}
363
+ open={!!state.message}
364
+ autoHideDuration={3000}
365
+ onClose={() => setState((prevState) => ({ ...prevState, message: null }))}
366
+ message={state.message}
367
+ action={
368
+ <IconButton
369
+ size="small"
370
+ aria-label="close"
371
+ color="inherit"
372
+ onClick={() => setState((prevState) => ({ ...prevState, message: null }))}>
373
+ <CloseIcon fontSize="small" />
374
+ </IconButton>
375
+ }
376
+ data-testid="error"
377
+ />
378
+ </>
379
+ );
380
+ };