@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,616 @@
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 { gql, useLazyQuery, useMutation } from '@apollo/client';
15
+ import { IconOverlay, ServerContext, ServerContextValue, useMultiToast } from '@eclipse-sirius/sirius-components-core';
16
+ import { GQLListItem, PropertySectionLabel, getTextDecorationLineValue } from '@eclipse-sirius/sirius-components-forms';
17
+ import { Input, InputAdornment } from '@mui/material';
18
+ import FormControl from '@mui/material/FormControl';
19
+ import FormHelperText from '@mui/material/FormHelperText';
20
+ import IconButton from '@mui/material/IconButton';
21
+ import Table from '@mui/material/Table';
22
+ import TableBody from '@mui/material/TableBody';
23
+ import TextField from '@mui/material/TextField';
24
+ import TableCell from '@mui/material/TableCell';
25
+ import TableRow from '@mui/material/TableRow';
26
+ import Typography from '@mui/material/Typography';
27
+ import { makeStyles } from 'tss-react/mui';
28
+ import AddIcon from '@mui/icons-material/Add';
29
+ import DeleteIcon from '@mui/icons-material/Delete';
30
+ import BubbleChartIcon from '@mui/icons-material/BubbleChart';
31
+ import { MouseEvent, useContext, useEffect, useState } from 'react';
32
+ import {
33
+ GQLActionPrimitiveListItemMutationData,
34
+ GQLActionPrimitiveListItemMutationVariables,
35
+ GQLActionPrimitiveListItemPayload,
36
+ GQLActionableListItem,
37
+ GQLAddPrimitiveListItemMutationData,
38
+ GQLAddPrimitiveListItemPayload,
39
+ GQLDeletePrimitiveListItemMutationData,
40
+ GQLDeletePrimitiveListItemPayload,
41
+ GQLErrorPayload,
42
+ GQLFormDescription,
43
+ GQLGetPrimitiveListCandidatesQueryData,
44
+ GQLGetPrimitiveListCandidatesQueryVariables,
45
+ GQLPrimitiveListCandidate,
46
+ GQLReorderPrimitiveListItemsMutationData,
47
+ GQLReorderPrimitiveListItemsMutationVariables,
48
+ GQLReorderPrimitiveListItemsPayload,
49
+ GQLRepresentationDescription,
50
+ GQLSuccessPayload,
51
+ PrimitiveListAutocompleteState,
52
+ PrimitiveListPropertySectionProps,
53
+ PrimitiveListStyleProps,
54
+ } from './PrimitiveListWidgetPropertySection.types';
55
+
56
+ import Autocomplete from '@mui/material/Autocomplete';
57
+ import ReorderIcon from '../containmentReference/ReorderIcon';
58
+ import ReorderItemsDialog from '../dialogs/ReorderItemsDialog';
59
+
60
+ export const deletePrimitiveListItemMutation = gql`
61
+ mutation deletePrimitiveListItem($input: DeleteListItemInput!) {
62
+ deletePrimitiveListItem(input: $input) {
63
+ __typename
64
+ ... on ErrorPayload {
65
+ messages {
66
+ body
67
+ level
68
+ }
69
+ }
70
+ ... on SuccessPayload {
71
+ messages {
72
+ body
73
+ level
74
+ }
75
+ }
76
+ }
77
+ }
78
+ `;
79
+
80
+ export const addPrimitiveListItemMutation = gql`
81
+ mutation addPrimitiveListItem($input: AddPrimitiveListItemInput!) {
82
+ addPrimitiveListItem(input: $input) {
83
+ __typename
84
+ ... on ErrorPayload {
85
+ messages {
86
+ body
87
+ level
88
+ }
89
+ }
90
+ ... on SuccessPayload {
91
+ messages {
92
+ body
93
+ level
94
+ }
95
+ }
96
+ }
97
+ }
98
+ `;
99
+
100
+ export const reorderPrimitiveListItemsMutation = gql`
101
+ mutation reorderPrimitiveListItems($input: ReorderPrimitiveListItemsInput!) {
102
+ reorderPrimitiveListItems(input: $input) {
103
+ __typename
104
+ ... on ErrorPayload {
105
+ messages {
106
+ body
107
+ level
108
+ }
109
+ }
110
+ ... on SuccessPayload {
111
+ messages {
112
+ body
113
+ level
114
+ }
115
+ }
116
+ }
117
+ }
118
+ `;
119
+
120
+ export const actionPrimitiveListItemMutation = gql`
121
+ mutation actionPrimitiveListItemMutation($input: ActionListItemInput!) {
122
+ actionPrimitiveListItem(input: $input) {
123
+ __typename
124
+ ... on ErrorPayload {
125
+ messages {
126
+ body
127
+ level
128
+ }
129
+ }
130
+ ... on SuccessPayload {
131
+ messages {
132
+ body
133
+ level
134
+ }
135
+ }
136
+ }
137
+ }
138
+ `;
139
+
140
+ const getPrimitiveListCandidatesQuery = gql`
141
+ query getPrimitiveListCandidatesQuery($editingContextId: ID!, $representationId: ID!, $primitiveListId: ID!) {
142
+ viewer {
143
+ editingContext(editingContextId: $editingContextId) {
144
+ representation(representationId: $representationId) {
145
+ description {
146
+ ... on FormDescription {
147
+ primitiveListCandidates(primitiveListId: $primitiveListId) {
148
+ value
149
+ label
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ `;
158
+
159
+ const isFormDescription = (
160
+ representationDescription: GQLRepresentationDescription
161
+ ): representationDescription is GQLFormDescription => representationDescription.__typename === 'FormDescription';
162
+
163
+ const usePrimitiveListPropertySectionStyles = makeStyles<PrimitiveListStyleProps>()(
164
+ (_theme, { color, fontSize, italic, bold, underline, strikeThrough }) => ({
165
+ cell: {
166
+ display: 'flex',
167
+ flexDirection: 'row',
168
+ alignItems: 'center',
169
+ },
170
+ canBeSelectedItem: {
171
+ '&:hover': {
172
+ textDecoration: 'underline',
173
+ cursor: 'pointer',
174
+ },
175
+ },
176
+ style: {
177
+ color: color ?? undefined,
178
+ fontSize: fontSize ?? undefined,
179
+ fontStyle: italic ? 'italic' : undefined,
180
+ fontWeight: bold ? 'bold' : undefined,
181
+ textDecorationLine: getTextDecorationLineValue(underline, strikeThrough),
182
+ overflow: 'hidden',
183
+ textOverflow: 'ellipsis',
184
+ whiteSpace: 'nowrap',
185
+ flexGrow: 1,
186
+ },
187
+ autocomplete: {
188
+ display: 'flex',
189
+ justifyContent: 'space-between',
190
+ width: '100%',
191
+ },
192
+ })
193
+ );
194
+
195
+ const NONE_WIDGET_ITEM_ID = 'none';
196
+
197
+ const isErrorPayload = (
198
+ payload:
199
+ | GQLAddPrimitiveListItemPayload
200
+ | GQLDeletePrimitiveListItemPayload
201
+ | GQLReorderPrimitiveListItemsPayload
202
+ | GQLActionPrimitiveListItemPayload
203
+ ): payload is GQLErrorPayload => payload.__typename === 'ErrorPayload';
204
+
205
+ const isSuccessPayload = (
206
+ payload:
207
+ | GQLAddPrimitiveListItemPayload
208
+ | GQLDeletePrimitiveListItemPayload
209
+ | GQLReorderPrimitiveListItemsPayload
210
+ | GQLActionPrimitiveListItemPayload
211
+ ): payload is GQLSuccessPayload => payload.__typename === 'SuccessPayload';
212
+
213
+ export const PrimitiveListSection = ({
214
+ editingContextId,
215
+ formId,
216
+ widget,
217
+ readOnly,
218
+ }: PrimitiveListPropertySectionProps) => {
219
+ const props: PrimitiveListStyleProps = {
220
+ color: widget.style?.color ?? null,
221
+ fontSize: widget.style?.fontSize ?? null,
222
+ italic: widget.style?.italic ?? null,
223
+ bold: widget.style?.bold ?? null,
224
+ underline: widget.style?.underline ?? null,
225
+ strikeThrough: widget.style?.strikeThrough ?? null,
226
+ };
227
+ const { httpOrigin } = useContext<ServerContextValue>(ServerContext);
228
+ const [newValue, setNewValue] = useState<GQLPrimitiveListCandidate | undefined>(undefined);
229
+ const [openReorderDialog, setOpenReorderDialog] = useState<boolean>(false);
230
+ const { classes } = usePrimitiveListPropertySectionStyles(props);
231
+ const [autocompleteState, setAutocompleteState] = useState<PrimitiveListAutocompleteState>({
232
+ open: false,
233
+ candidates: null,
234
+ });
235
+ const loading = autocompleteState.open && autocompleteState.candidates === null;
236
+
237
+ let items = [...widget.items];
238
+ if (items.length === 0) {
239
+ items.push({
240
+ id: NONE_WIDGET_ITEM_ID,
241
+ iconURL: [],
242
+ label: 'None',
243
+ kind: 'Unknown',
244
+ deletable: false,
245
+ hasAction: false,
246
+ actionIconURL: '',
247
+ });
248
+ }
249
+
250
+ const [deleteListItem, { loading: deleteLoading, error: deleteError, data: deleteData }] =
251
+ useMutation<GQLDeletePrimitiveListItemMutationData>(deletePrimitiveListItemMutation);
252
+
253
+ const onDelete = (_: MouseEvent<HTMLElement>, item: GQLListItem) => {
254
+ const variables = {
255
+ input: {
256
+ id: crypto.randomUUID(),
257
+ editingContextId,
258
+ representationId: formId,
259
+ listId: widget.id,
260
+ listItemId: item.id,
261
+ },
262
+ };
263
+ deleteListItem({ variables });
264
+ };
265
+
266
+ const [addListItem, { loading: addLoading, error: addError, data: addData }] =
267
+ useMutation<GQLAddPrimitiveListItemMutationData>(addPrimitiveListItemMutation);
268
+
269
+ const onAdd = () => {
270
+ if (newValue && newValue.value.length && newValue?.value.length > 0) {
271
+ const variables = {
272
+ input: {
273
+ id: crypto.randomUUID(),
274
+ editingContextId,
275
+ representationId: formId,
276
+ listId: widget.id,
277
+ newValue: newValue.value,
278
+ },
279
+ };
280
+ addListItem({ variables });
281
+ }
282
+ };
283
+
284
+ const [reorderPrimitiveListItems, { loading: reorderLoading, error: reorderError, data: reorderData }] = useMutation<
285
+ GQLReorderPrimitiveListItemsMutationData,
286
+ GQLReorderPrimitiveListItemsMutationVariables
287
+ >(reorderPrimitiveListItemsMutation);
288
+
289
+ const [actionPrimitiveListItem, { loading: actionLoading, error: actionError, data: actionData }] = useMutation<
290
+ GQLActionPrimitiveListItemMutationData,
291
+ GQLActionPrimitiveListItemMutationVariables
292
+ >(actionPrimitiveListItemMutation);
293
+
294
+ const { addErrorMessage, addMessages } = useMultiToast();
295
+
296
+ useEffect(() => {
297
+ if (!deleteLoading) {
298
+ if (deleteError) {
299
+ addErrorMessage('An unexpected error has occurred, please refresh the page');
300
+ }
301
+ if (deleteData) {
302
+ const { deletePrimitiveListItem } = deleteData;
303
+ if (isErrorPayload(deletePrimitiveListItem) || isSuccessPayload(deletePrimitiveListItem)) {
304
+ addMessages(deletePrimitiveListItem.messages);
305
+ }
306
+ }
307
+ }
308
+ }, [deleteLoading, deleteError, deleteData]);
309
+
310
+ useEffect(() => {
311
+ if (!addLoading) {
312
+ if (addError) {
313
+ addErrorMessage('An unexpected error has occurred, please refresh the page');
314
+ }
315
+ if (addData) {
316
+ const { addPrimitiveListItem } = addData;
317
+ if (isSuccessPayload(addPrimitiveListItem)) {
318
+ setNewValue(undefined);
319
+ }
320
+ if (isErrorPayload(addPrimitiveListItem) || isSuccessPayload(addPrimitiveListItem)) {
321
+ addMessages(addPrimitiveListItem.messages);
322
+ }
323
+ }
324
+ }
325
+ }, [addLoading, addError, addData]);
326
+
327
+ useEffect(() => {
328
+ if (!reorderLoading) {
329
+ if (reorderError) {
330
+ addErrorMessage('An unexpected error has occurred, please refresh the page');
331
+ }
332
+ if (reorderData) {
333
+ const { reorderPrimitiveListItems } = reorderData;
334
+ if (isErrorPayload(reorderPrimitiveListItems) || isSuccessPayload(reorderPrimitiveListItems)) {
335
+ addMessages(reorderPrimitiveListItems.messages);
336
+ }
337
+ }
338
+ }
339
+ }, [reorderLoading, reorderError, reorderData]);
340
+
341
+ useEffect(() => {
342
+ if (!actionLoading) {
343
+ if (actionError) {
344
+ addErrorMessage('An unexpected error has occurred, please refresh the page');
345
+ }
346
+ if (actionData) {
347
+ const { actionPrimitiveListItem } = actionData;
348
+ if (isErrorPayload(actionPrimitiveListItem) || isSuccessPayload(actionPrimitiveListItem)) {
349
+ addMessages(actionPrimitiveListItem.messages);
350
+ }
351
+ }
352
+ }
353
+ }, [actionLoading, actionError, actionData]);
354
+
355
+ const callActionPrimitiveListItem = (_, item: GQLActionableListItem) => {
356
+ const variables: GQLActionPrimitiveListItemMutationVariables = {
357
+ input: {
358
+ id: crypto.randomUUID(),
359
+ editingContextId,
360
+ representationId: formId,
361
+ listId: widget.id,
362
+ itemId: item.id,
363
+ },
364
+ };
365
+ actionPrimitiveListItem({ variables });
366
+ };
367
+
368
+ const [
369
+ getPrimitiveListCandidates,
370
+ { loading: primitiveListCandidatesLoading, data: primitiveListCandidatesData, error: primitiveListCandidatesError },
371
+ ] = useLazyQuery<GQLGetPrimitiveListCandidatesQueryData, GQLGetPrimitiveListCandidatesQueryVariables>(
372
+ getPrimitiveListCandidatesQuery
373
+ );
374
+
375
+ useEffect(() => {
376
+ if (!primitiveListCandidatesLoading) {
377
+ if (primitiveListCandidatesError) {
378
+ addErrorMessage('An unexpected error has occurred, please refresh the page');
379
+ }
380
+ if (primitiveListCandidatesData) {
381
+ const representationDescription: GQLRepresentationDescription =
382
+ primitiveListCandidatesData.viewer.editingContext.representation.description;
383
+ if (isFormDescription(representationDescription)) {
384
+ setAutocompleteState((prevState) => {
385
+ return {
386
+ ...prevState,
387
+ candidates: representationDescription.primitiveListCandidates,
388
+ };
389
+ });
390
+ }
391
+ }
392
+ }
393
+ }, [primitiveListCandidatesLoading, primitiveListCandidatesData, primitiveListCandidatesError]);
394
+
395
+ useEffect(() => {
396
+ if (loading) {
397
+ getPrimitiveListCandidates({
398
+ variables: {
399
+ editingContextId,
400
+ representationId: formId,
401
+ primitiveListId: widget.id,
402
+ },
403
+ });
404
+ }
405
+ }, [loading]);
406
+
407
+ useEffect(() => {
408
+ if (!autocompleteState.open) {
409
+ setAutocompleteState((prevState) => {
410
+ return {
411
+ ...prevState,
412
+ candidates: null,
413
+ };
414
+ });
415
+ }
416
+ }, [widget]);
417
+
418
+ const getTableCellContent = (item: GQLActionableListItem): JSX.Element => {
419
+ return (
420
+ <TableCell className={classes.cell}>
421
+ <IconOverlay iconURLs={item.iconURL} alt={item.label} />
422
+ <Typography
423
+ className={classes.style}
424
+ color="textPrimary"
425
+ data-testid={`primitive-list-item-content-${item.label}`}>
426
+ {item.label}
427
+ </Typography>
428
+ {item.hasAction && (
429
+ <IconButton
430
+ aria-label="action item"
431
+ onClick={(event) => callActionPrimitiveListItem(event, item)}
432
+ size="small"
433
+ disabled={readOnly || widget.readOnly}
434
+ data-testid={`primitive-list-item-action-button-${item.label}`}>
435
+ {item.actionIconURL ? (
436
+ <img height="24" width="24" src={httpOrigin + item.actionIconURL} />
437
+ ) : (
438
+ <BubbleChartIcon />
439
+ )}
440
+ </IconButton>
441
+ )}
442
+ {item.deletable && (
443
+ <IconButton
444
+ aria-label="delete list item"
445
+ onClick={(event) => onDelete(event, item)}
446
+ size="small"
447
+ title="Delete item"
448
+ disabled={readOnly || !item.deletable || widget.readOnly}
449
+ data-testid={`primitive-list-item-delete-button-${item.label}`}>
450
+ <DeleteIcon />
451
+ </IconButton>
452
+ )}
453
+ </TableCell>
454
+ );
455
+ };
456
+
457
+ const freeValue = (
458
+ <Input
459
+ id={'new-item-text-field' + widget.id}
460
+ type="text"
461
+ value={newValue?.value || ''}
462
+ fullWidth
463
+ margin="dense"
464
+ placeholder="New Item"
465
+ disabled={readOnly || widget.readOnly}
466
+ data-testid={`primitive-list-input-${widget.label}`}
467
+ endAdornment={
468
+ <InputAdornment position="end">
469
+ <IconButton
470
+ data-testid={`primitive-list-add-${widget.label}`}
471
+ size="small"
472
+ onClick={(_) => onAdd()}
473
+ disabled={readOnly || widget.readOnly}>
474
+ <AddIcon />
475
+ </IconButton>
476
+ </InputAdornment>
477
+ }
478
+ onKeyPress={(event) => {
479
+ if (event.key === 'Enter') {
480
+ onAdd();
481
+ }
482
+ }}
483
+ onChange={(event) => setNewValue({ value: event.target.value, label: event.target.value })}
484
+ />
485
+ );
486
+
487
+ const handleAutocompleteChange = (_, value: GQLPrimitiveListCandidate) => {
488
+ setNewValue(value);
489
+ };
490
+
491
+ const strictValue = (
492
+ <div className={classes.autocomplete}>
493
+ <Autocomplete
494
+ data-testid={`${widget.label}-autocomplete`}
495
+ open={autocompleteState.open}
496
+ onOpen={() =>
497
+ setAutocompleteState((prevState) => {
498
+ return {
499
+ ...prevState,
500
+ open: true,
501
+ };
502
+ })
503
+ }
504
+ onClose={() =>
505
+ setAutocompleteState((prevState) => {
506
+ return {
507
+ ...prevState,
508
+ open: false,
509
+ };
510
+ })
511
+ }
512
+ loading={loading}
513
+ options={autocompleteState.candidates || []}
514
+ getOptionLabel={(option: GQLPrimitiveListCandidate) => option.label}
515
+ isOptionEqualToValue={(option: GQLPrimitiveListCandidate, value: GQLPrimitiveListCandidate) =>
516
+ option.value === value.value
517
+ }
518
+ clearOnEscape
519
+ openOnFocus
520
+ fullWidth
521
+ disableClearable
522
+ disabled={readOnly || widget.readOnly}
523
+ value={newValue}
524
+ onChange={handleAutocompleteChange}
525
+ renderInput={(params) => (
526
+ <TextField
527
+ {...params}
528
+ data-testid={`primitive-list-autocomplete-textfield-${widget.label}`}
529
+ variant="standard"
530
+ placeholder={'New Item'}
531
+ error={widget.diagnostics.length > 0}
532
+ helperText={widget.diagnostics[0]?.message}
533
+ />
534
+ )}
535
+ onKeyPress={(event) => {
536
+ if (event.key === 'Enter' && newValue) {
537
+ onAdd();
538
+ }
539
+ }}
540
+ />
541
+ <IconButton
542
+ aria-label="add"
543
+ size="small"
544
+ title="Add item"
545
+ disabled={readOnly || widget.readOnly || !newValue}
546
+ data-testid={`primitive-list-add-${widget.label}`}
547
+ onClick={() => onAdd()}>
548
+ <AddIcon />
549
+ </IconButton>
550
+ </div>
551
+ );
552
+
553
+ const addSection = (
554
+ <TableRow key="Add" data-testid={`primitive-list-add-section-${widget.label}`}>
555
+ <TableCell className={classes.cell}>{widget.hasCandidates ? strictValue : freeValue}</TableCell>
556
+ </TableRow>
557
+ );
558
+
559
+ const callReorderPrimitiveListItems = (valueId: string, fromIndex: number, toIndex: number) => {
560
+ if (valueId && fromIndex !== -1 && toIndex !== -1) {
561
+ const variables: GQLReorderPrimitiveListItemsMutationVariables = {
562
+ input: {
563
+ id: crypto.randomUUID(),
564
+ editingContextId,
565
+ representationId: formId,
566
+ listId: widget.id,
567
+ itemId: valueId,
568
+ fromIndex,
569
+ toIndex,
570
+ },
571
+ };
572
+ reorderPrimitiveListItems({ variables });
573
+ }
574
+ };
575
+
576
+ const isEnabled = !readOnly && !widget.readOnly && widget.canReorder && widget.items.length > 1;
577
+
578
+ return (
579
+ <>
580
+ <FormControl error={widget.diagnostics.length > 0} fullWidth>
581
+ <div style={{ display: 'flex' }}>
582
+ <PropertySectionLabel editingContextId={editingContextId} formId={formId} widget={widget} />
583
+ {widget.canReorder && (
584
+ <IconButton
585
+ style={{ marginLeft: 'auto', marginRight: '16px' }}
586
+ data-testid="containment-reference-reorder-children"
587
+ onClick={() => setOpenReorderDialog(true)}
588
+ disabled={!isEnabled}
589
+ size="small">
590
+ <ReorderIcon fill={`${isEnabled ? '#00000077' : '#B3BFC5'}`} />
591
+ </IconButton>
592
+ )}
593
+ </div>
594
+ <Table size="small">
595
+ <TableBody data-testid={`primitive-list-table-${widget.label}`}>
596
+ {items.map((item) => (
597
+ <TableRow key={item.id} data-testid={`primitive-list-item-${item.label}`}>
598
+ {getTableCellContent(item)}
599
+ </TableRow>
600
+ ))}
601
+ {widget.canAdd && addSection}
602
+ </TableBody>
603
+ </Table>
604
+
605
+ <FormHelperText>{widget.diagnostics[0]?.message}</FormHelperText>
606
+ </FormControl>
607
+ {openReorderDialog && (
608
+ <ReorderItemsDialog
609
+ items={widget.items.map(({ label, id, iconURL }) => ({ label, id, iconURL }))}
610
+ moveElement={callReorderPrimitiveListItems}
611
+ onClose={() => setOpenReorderDialog(false)}
612
+ />
613
+ )}
614
+ </>
615
+ );
616
+ };