@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,205 @@
1
+ /*****************************************************************************
2
+ * Copyright (c) 2023, 2026 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
+ import {
15
+ BorderNodePosition,
16
+ ConnectionHandle,
17
+ GQLDiagram,
18
+ GQLDiagramDescription,
19
+ GQLEdge,
20
+ GQLNode,
21
+ GQLNodeDescription,
22
+ GQLNodeLayoutData,
23
+ GQLNodeStyle,
24
+ GQLViewModifier,
25
+ IConvertEngine,
26
+ INodeConverter,
27
+ convertHandles,
28
+ convertLineStyle,
29
+ convertOutsideLabels,
30
+ isListLayoutStrategy,
31
+ convertInsideLabel,
32
+ GQLHandleLayoutData,
33
+ } from '@eclipse-sirius/sirius-components-diagrams';
34
+ import { Node, XYPosition } from '@xyflow/react';
35
+ import {
36
+ GQLRectangleWithExternalLabelNodeStyle,
37
+ RectangleWithExternalLabelNodeData,
38
+ } from './RectangleWithExternalLabelNode.types';
39
+
40
+ const defaultPosition: XYPosition = { x: 0, y: 0 };
41
+
42
+ const toRectangleWithExternalLabelNode = (
43
+ gqlDiagram: GQLDiagram,
44
+ gqlNode: GQLNode<GQLRectangleWithExternalLabelNodeStyle>,
45
+ gqlParentNode: GQLNode<GQLNodeStyle> | null,
46
+ nodeDescription: GQLNodeDescription,
47
+ isBorderNode: boolean,
48
+ gqlEdges: GQLEdge[]
49
+ ): Node<RectangleWithExternalLabelNodeData> => {
50
+ const {
51
+ targetObjectId,
52
+ targetObjectLabel,
53
+ targetObjectKind,
54
+ descriptionId,
55
+ id,
56
+ insideLabel,
57
+ outsideLabels,
58
+ state,
59
+ pinned,
60
+ style,
61
+ labelEditable,
62
+ deletable,
63
+ } = gqlNode;
64
+
65
+ const handleLayoutData: GQLHandleLayoutData[] = gqlDiagram.layoutData.nodeLayoutData
66
+ .filter((nodeLayoutData) => nodeLayoutData.id === id)
67
+ .flatMap((nodeLayoutData) => nodeLayoutData.handleLayoutData);
68
+
69
+ const connectionHandles: ConnectionHandle[] = convertHandles(gqlNode.id, gqlEdges, handleLayoutData);
70
+ const gqlNodeLayoutData: GQLNodeLayoutData | undefined = gqlDiagram.layoutData.nodeLayoutData.find(
71
+ (nodeLayoutData) => nodeLayoutData.id === id
72
+ );
73
+ const isNew = gqlNodeLayoutData === undefined;
74
+ const resizedByUser = gqlNodeLayoutData?.resizedByUser ?? false;
75
+ const movedByUser = gqlNodeLayoutData?.movedByUser ?? false;
76
+
77
+ const data: RectangleWithExternalLabelNodeData = {
78
+ targetObjectId,
79
+ targetObjectLabel,
80
+ targetObjectKind,
81
+ descriptionId,
82
+ style: {
83
+ display: 'flex',
84
+ background: style.background,
85
+ borderColor: style.borderColor,
86
+ borderWidth: style.borderSize,
87
+ borderStyle: convertLineStyle(style.borderStyle),
88
+ },
89
+ insideLabel: null,
90
+ outsideLabels: convertOutsideLabels(outsideLabels, gqlDiagram.layoutData.labelLayoutData),
91
+ faded: state === GQLViewModifier.Faded,
92
+ pinned,
93
+ isBorderNode: isBorderNode,
94
+ nodeDescription,
95
+ defaultWidth: gqlNode.defaultWidth,
96
+ defaultHeight: gqlNode.defaultHeight,
97
+ borderNodePosition: isBorderNode ? BorderNodePosition.EAST : null,
98
+ connectionHandles,
99
+ labelEditable,
100
+ isNew,
101
+ resizedByUser,
102
+ movedByUser,
103
+ isListChild: isListLayoutStrategy(gqlParentNode?.style.childrenLayoutStrategy),
104
+ isDraggedNode: false,
105
+ isDropNodeTarget: false,
106
+ isDropNodeCandidate: false,
107
+ isHovered: false,
108
+ connectionLinePositionOnNode: 'none',
109
+ nodeAppearanceData: {
110
+ gqlStyle: style,
111
+ customizedStyleProperties: [],
112
+ },
113
+ minComputedWidth: gqlNodeLayoutData?.minComputedSize.width ?? null,
114
+ minComputedHeight: gqlNodeLayoutData?.minComputedSize.height ?? null,
115
+ deletable,
116
+ isLastNodeSelected: false,
117
+ };
118
+
119
+ data.insideLabel = convertInsideLabel(
120
+ insideLabel,
121
+ data,
122
+ `${style.borderSize}px ${style.borderStyle} ${style.borderColor}`
123
+ );
124
+
125
+ const node: Node<RectangleWithExternalLabelNodeData> = {
126
+ id,
127
+ type: 'rectangleWithExternalLabelNode',
128
+ data,
129
+ position: defaultPosition,
130
+ hidden: gqlNode.state === GQLViewModifier.Hidden,
131
+ };
132
+
133
+ if (gqlParentNode) {
134
+ node.parentId = gqlParentNode.id;
135
+ }
136
+
137
+ const nodeLayoutData = gqlDiagram.layoutData.nodeLayoutData.filter((data) => data.id === id)[0];
138
+ if (nodeLayoutData) {
139
+ const {
140
+ position,
141
+ size: { height, width },
142
+ } = nodeLayoutData;
143
+ node.position = position;
144
+ node.height = height;
145
+ node.width = width;
146
+ node.style = {
147
+ ...node.style,
148
+ width: `${node.width}px`,
149
+ height: `${node.height}px`,
150
+ };
151
+ }
152
+
153
+ return node;
154
+ };
155
+
156
+ export class RectangleWithExternalLabelNodeConverter implements INodeConverter {
157
+ canHandle(gqlNode: GQLNode<GQLNodeStyle>) {
158
+ return gqlNode.style.__typename === 'RectangleWithExternalLabelNodeStyle';
159
+ }
160
+
161
+ handle(
162
+ convertEngine: IConvertEngine,
163
+ gqlDiagram: GQLDiagram,
164
+ gqlNode: GQLNode<GQLRectangleWithExternalLabelNodeStyle>,
165
+ gqlEdges: GQLEdge[],
166
+ parentNode: GQLNode<GQLNodeStyle> | null,
167
+ isBorderNode: boolean,
168
+ nodes: Node[],
169
+ diagramDescription: GQLDiagramDescription,
170
+ nodeDescriptions: GQLNodeDescription[]
171
+ ) {
172
+ const nodeDescription = nodeDescriptions.find((description) => description.id === gqlNode.descriptionId);
173
+ if (nodeDescription) {
174
+ nodes.push(
175
+ toRectangleWithExternalLabelNode(gqlDiagram, gqlNode, parentNode, nodeDescription, isBorderNode, gqlEdges)
176
+ );
177
+ }
178
+
179
+ const borderNodeDescriptions: GQLNodeDescription[] = (nodeDescription?.borderNodeDescriptionIds ?? []).flatMap(
180
+ (nodeDescriptionId) =>
181
+ diagramDescription.nodeDescriptions.filter((nodeDescription) => nodeDescription.id === nodeDescriptionId)
182
+ );
183
+ const childNodeDescriptions: GQLNodeDescription[] = (nodeDescription?.childNodeDescriptionIds ?? []).flatMap(
184
+ (nodeDescriptionId) =>
185
+ diagramDescription.nodeDescriptions.filter((nodeDescription) => nodeDescription.id === nodeDescriptionId)
186
+ );
187
+
188
+ convertEngine.convertNodes(
189
+ gqlDiagram,
190
+ gqlNode.borderNodes ?? [],
191
+ gqlNode,
192
+ nodes,
193
+ diagramDescription,
194
+ borderNodeDescriptions
195
+ );
196
+ convertEngine.convertNodes(
197
+ gqlDiagram,
198
+ gqlNode.childNodes ?? [],
199
+ gqlNode,
200
+ nodes,
201
+ diagramDescription,
202
+ childNodeDescriptions
203
+ );
204
+ }
205
+ }
@@ -0,0 +1,55 @@
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
+ import {
15
+ Diagram,
16
+ DiagramNodeType,
17
+ getBorderNodeExtent,
18
+ ILayoutEngine,
19
+ INodeLayoutHandler,
20
+ NodeData,
21
+ setBorderNodesPosition,
22
+ ForcedDimensions,
23
+ defaultWidth,
24
+ defaultHeight,
25
+ } from '@eclipse-sirius/sirius-components-diagrams';
26
+ import { Node } from '@xyflow/react';
27
+
28
+ export class RectangleWithExternalLabelNodeLayoutHandler implements INodeLayoutHandler<NodeData> {
29
+ canHandle(node: Node<NodeData, DiagramNodeType>) {
30
+ return node.type === 'rectangleWithExternalLabelNode';
31
+ }
32
+
33
+ handle(
34
+ layoutEngine: ILayoutEngine,
35
+ previousDiagram: Diagram | null,
36
+ node: Node<NodeData>,
37
+ visibleNodes: Node<NodeData, DiagramNodeType>[],
38
+ directChildren: Node<NodeData, DiagramNodeType>[],
39
+ newlyAddedNodes: Node<NodeData, DiagramNodeType>[],
40
+ _forceWidth?: ForcedDimensions
41
+ ) {
42
+ layoutEngine.layoutNodes(previousDiagram, visibleNodes, directChildren, newlyAddedNodes);
43
+
44
+ const borderNodes = directChildren.filter((node) => node.data.isBorderNode);
45
+
46
+ node.width = node.data.defaultWidth ?? defaultWidth;
47
+ node.height = node.data.defaultHeight ?? defaultHeight;
48
+
49
+ // Update border nodes positions
50
+ borderNodes.forEach((borderNode) => {
51
+ borderNode.extent = getBorderNodeExtent(node, borderNode);
52
+ });
53
+ setBorderNodesPosition(borderNodes, node, previousDiagram);
54
+ }
55
+ }
@@ -0,0 +1,238 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2019, 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 { gql, useMutation, useQuery } from '@apollo/client';
14
+ import Button from '@mui/material/Button';
15
+ import Dialog from '@mui/material/Dialog';
16
+ import DialogActions from '@mui/material/DialogActions';
17
+ import DialogContent from '@mui/material/DialogContent';
18
+ import DialogTitle from '@mui/material/DialogTitle';
19
+ import IconButton from '@mui/material/IconButton';
20
+ import InputLabel from '@mui/material/InputLabel';
21
+ import MenuItem from '@mui/material/MenuItem';
22
+ import Select from '@mui/material/Select';
23
+ import Snackbar from '@mui/material/Snackbar';
24
+ import { makeStyles } from 'tss-react/mui';
25
+ import CloseIcon from '@mui/icons-material/Close';
26
+ import { useMachine } from '@xstate/react';
27
+ import { useEffect } from 'react';
28
+ import { StateMachine } from 'xstate';
29
+ import {
30
+ ApplyProfileModalProps,
31
+ GQLApplyProfileMutationData,
32
+ GQLApplyProfilePayload,
33
+ GQLErrorPayload,
34
+ GQLGetProfilesQueryData,
35
+ GQLGetProfilesQueryVariables,
36
+ } from './ApplyProfileModal.types';
37
+ import {
38
+ ApplyProfileEvent,
39
+ ApplyProfileModalContext,
40
+ ApplyProfileModalEvent,
41
+ ChangeProfileEvent,
42
+ FetchedProfilesEvent,
43
+ HandleResponseEvent,
44
+ HideToastEvent,
45
+ SchemaValue,
46
+ ShowToastEvent,
47
+ applyProfileModalMachine,
48
+ ApplyProfileModalStateSchema,
49
+ } from './ApplyProfileModalMachine';
50
+
51
+ const applyProfileMutation = gql`
52
+ mutation applyProfile($input: ApplyProfileInput!) {
53
+ applyProfile(input: $input) {
54
+ __typename
55
+ ... on ApplyProfileSuccessPayload {
56
+ id
57
+ }
58
+ ... on ErrorPayload {
59
+ message
60
+ }
61
+ }
62
+ }
63
+ `;
64
+
65
+ const getUMLProfileMetadatasQuery = gql`
66
+ query getUMLProfileMetadatas {
67
+ viewer {
68
+ profileMetadatas {
69
+ label
70
+ uriPath
71
+ }
72
+ }
73
+ }
74
+ `;
75
+
76
+ const useApplyProfileModalStyles = makeStyles()((theme) => ({
77
+ form: {
78
+ display: 'flex',
79
+ flexDirection: 'column',
80
+ '& > *': {
81
+ marginBottom: theme.spacing(1),
82
+ },
83
+ },
84
+ }));
85
+
86
+ const isErrorPayload = (payload: GQLApplyProfilePayload): payload is GQLErrorPayload =>
87
+ payload.__typename === 'ErrorPayload';
88
+
89
+ export const ApplyProfileModal = ({ editingContextId, item, onAppliedProfile, onClose }: ApplyProfileModalProps) => {
90
+ const { classes } = useApplyProfileModalStyles();
91
+ const [{ value, context }, dispatch] =
92
+ useMachine<StateMachine<ApplyProfileModalContext, ApplyProfileModalStateSchema, ApplyProfileModalEvent>>(
93
+ applyProfileModalMachine
94
+ );
95
+ const { applyProfileModal, toast } = value as SchemaValue;
96
+ const { selectedProfileId, profiles, message } = context;
97
+
98
+ const {
99
+ loading: profilesLoading,
100
+ data: profilesData,
101
+ error: profilesError,
102
+ } = useQuery<GQLGetProfilesQueryData, GQLGetProfilesQueryVariables>(getUMLProfileMetadatasQuery, {
103
+ variables: { editingContextId, kind: item.kind },
104
+ });
105
+ useEffect(() => {
106
+ if (!profilesLoading) {
107
+ if (profilesError) {
108
+ const showToastEvent: ShowToastEvent = {
109
+ type: 'SHOW_TOAST',
110
+ message: 'An unexpected error has occurred, please refresh the page',
111
+ };
112
+ dispatch(showToastEvent);
113
+ }
114
+ if (profilesData) {
115
+ const fetchProfilesEvent: FetchedProfilesEvent = {
116
+ type: 'HANDLE_FETCHED_PROFILES',
117
+ data: profilesData,
118
+ };
119
+ dispatch(fetchProfilesEvent);
120
+ }
121
+ }
122
+ }, [profilesLoading, profilesData, profilesError, dispatch]);
123
+
124
+ const onProfileChange = (event) => {
125
+ const value = event.target.value;
126
+ const changeProfileEvent: ChangeProfileEvent = {
127
+ type: 'CHANGE_PROFILE',
128
+ profileId: value,
129
+ };
130
+ dispatch(changeProfileEvent);
131
+ };
132
+
133
+ const [applyProfile, { loading: applyProfileLoading, data: applyProfileData, error: applyProfileError }] =
134
+ useMutation<GQLApplyProfileMutationData>(applyProfileMutation);
135
+ useEffect(() => {
136
+ if (!applyProfileLoading) {
137
+ if (applyProfileError) {
138
+ const showToastEvent: ShowToastEvent = {
139
+ type: 'SHOW_TOAST',
140
+ message: 'An unexpected error has occurred, please refresh the page',
141
+ };
142
+ dispatch(showToastEvent);
143
+ }
144
+ if (applyProfileData) {
145
+ const handleResponseEvent: HandleResponseEvent = { type: 'HANDLE_RESPONSE', data: applyProfileData };
146
+ dispatch(handleResponseEvent);
147
+
148
+ const { applyProfile } = applyProfileData;
149
+ if (isErrorPayload(applyProfile)) {
150
+ const { message } = applyProfile;
151
+ const showToastEvent: ShowToastEvent = { type: 'SHOW_TOAST', message };
152
+ dispatch(showToastEvent);
153
+ }
154
+ }
155
+ }
156
+ }, [applyProfileLoading, applyProfileData, applyProfileError, dispatch]);
157
+
158
+ const onApplyProfile = () => {
159
+ dispatch({ type: 'APPLY_PROFILE' } as ApplyProfileEvent);
160
+ const input = {
161
+ id: crypto.randomUUID(),
162
+ editingContextId,
163
+ modelId: item.id,
164
+ profileUriPath: selectedProfileId,
165
+ };
166
+ applyProfile({ variables: { input } });
167
+ };
168
+
169
+ useEffect(() => {
170
+ if (applyProfileModal === 'success') {
171
+ onAppliedProfile();
172
+ }
173
+ }, [applyProfileModal, onAppliedProfile]);
174
+
175
+ return (
176
+ <>
177
+ <Dialog
178
+ open={true}
179
+ onClose={onClose}
180
+ aria-labelledby="dialog-title"
181
+ maxWidth="xs"
182
+ fullWidth
183
+ data-testid="apply-profile-dialog">
184
+ <DialogTitle id="dialog-title" data-testid="apply-profile-dialog-title">
185
+ Apply a profile
186
+ </DialogTitle>
187
+ <DialogContent data-testid="apply-profile-dialog-content">
188
+ <div className={classes.form}>
189
+ <InputLabel id="applyProfileModalProfileLabel">Object type</InputLabel>
190
+ <Select
191
+ value={selectedProfileId}
192
+ onChange={onProfileChange}
193
+ disabled={applyProfileModal === 'loading' || applyProfileModal === 'applyingProfile'}
194
+ labelId="applyProfileModalProfileLabel"
195
+ fullWidth
196
+ data-testid="profile">
197
+ {profiles.map((profile) => (
198
+ <MenuItem value={profile.uriPath} key={profile.uriPath}>
199
+ {profile.label}
200
+ </MenuItem>
201
+ ))}
202
+ </Select>
203
+ </div>
204
+ </DialogContent>
205
+ <DialogActions>
206
+ <Button
207
+ variant="contained"
208
+ disabled={applyProfileModal !== 'valid'}
209
+ data-testid="apply-profile-submit"
210
+ color="primary"
211
+ onClick={onApplyProfile}>
212
+ Apply
213
+ </Button>
214
+ </DialogActions>
215
+ </Dialog>
216
+ <Snackbar
217
+ anchorOrigin={{
218
+ vertical: 'bottom',
219
+ horizontal: 'right',
220
+ }}
221
+ open={toast === 'visible'}
222
+ autoHideDuration={3000}
223
+ onClose={() => dispatch({ type: 'HIDE_TOAST' } as HideToastEvent)}
224
+ message={message}
225
+ action={
226
+ <IconButton
227
+ size="small"
228
+ aria-label="close"
229
+ color="inherit"
230
+ onClick={() => dispatch({ type: 'HIDE_TOAST' } as HideToastEvent)}>
231
+ <CloseIcon fontSize="small" />
232
+ </IconButton>
233
+ }
234
+ data-testid="error"
235
+ />
236
+ </>
237
+ );
238
+ };
@@ -0,0 +1,65 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2022, 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
+ export interface ApplyProfileModalProps {
16
+ editingContextId: string;
17
+ item: any;
18
+ onClose: () => void;
19
+ onAppliedProfile: () => void;
20
+ }
21
+
22
+ export interface Profile {
23
+ uriPath: string;
24
+ label: string;
25
+ }
26
+
27
+ export interface GQLGetProfilesQueryVariables {
28
+ editingContextId: string;
29
+ kind: string;
30
+ }
31
+
32
+ export interface GQLGetProfilesQueryData {
33
+ viewer: GQLViewer;
34
+ }
35
+
36
+ export interface GQLViewer {
37
+ profileMetadatas: GQLProfileMetadata[];
38
+ }
39
+
40
+ export interface GQLProfileMetadata {
41
+ label: string;
42
+ uriPath: string;
43
+ }
44
+
45
+ export interface GQLApplyProfileMutationData {
46
+ applyProfile: GQLApplyProfilePayload;
47
+ }
48
+
49
+ export interface GQLApplyProfilePayload {
50
+ __typename: string;
51
+ }
52
+
53
+ export interface GQLApplyProfileSuccessPayload extends GQLApplyProfilePayload {
54
+ id: string;
55
+ }
56
+
57
+ export interface GQLObject {
58
+ id: string;
59
+ label: string;
60
+ kind: string;
61
+ }
62
+
63
+ export interface GQLErrorPayload extends GQLApplyProfilePayload {
64
+ message: string;
65
+ }