@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.
- package/.prettierrc +22 -0
- package/.project +11 -0
- package/.turbo/cache/2e7de991e3eb5b77-meta.json +1 -0
- package/.turbo/cache/2e7de991e3eb5b77.tar.zst +0 -0
- package/.turbo/cache/6d4efa6c3019818e-meta.json +1 -0
- package/.turbo/cache/6d4efa6c3019818e.tar.zst +0 -0
- package/.turbo/cache/904b84e8ab6fefb1-meta.json +1 -0
- package/.turbo/cache/904b84e8ab6fefb1.tar.zst +0 -0
- package/.turbo/cache/b657accc57a869a6-meta.json +1 -0
- package/.turbo/cache/b657accc57a869a6.tar.zst +0 -0
- package/.turbo/cookies/1.cookie +0 -0
- package/.turbo/cookies/2.cookie +0 -0
- package/.turbo/cookies/3.cookie +0 -0
- package/.turbo/cookies/4.cookie +0 -0
- package/.turbo/cookies/5.cookie +0 -0
- package/.turbo/cookies/6.cookie +0 -0
- package/.turbo/cookies/7.cookie +0 -0
- package/.turbo/cookies/8.cookie +0 -0
- package/.turbo/daemon/8a1f25190e5082e3-turbo.log.2026-04-01 +0 -0
- package/package.json +32 -0
- package/papyrus-web/.env.development +2 -0
- package/papyrus-web/.prettierrc +22 -0
- package/papyrus-web/.turbo/turbo-build.log +30 -0
- package/papyrus-web/.turbo/turbo-format-lint.log +6 -0
- package/papyrus-web/README.adoc +84 -0
- package/papyrus-web/dist/assets/Lato-Black-B_kLSaRn.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-BlackItalic-B2JUbIh8.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-Bold-DBmunEOG.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-BoldItalic-DfTVlc2v.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-Italic-CxPt6gM6.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-Light-Cg7pVZQZ.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-LightItalic-BkbZ6uep.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-Regular-57KsL5Ww.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-Thin-CvSM47fD.ttf +0 -0
- package/papyrus-web/dist/assets/Lato-ThinItalic-9M4CJfMt.ttf +0 -0
- package/papyrus-web/dist/assets/browser-ponyfill-CVpHIrSq.js +2 -0
- package/papyrus-web/dist/assets/index-CjSWMYED.js +6122 -0
- package/papyrus-web/dist/assets/index-DJjGIuFa.css +1 -0
- package/papyrus-web/dist/assets/papyrus-icon-DqmMeq_6.png +0 -0
- package/papyrus-web/dist/favicon.ico +0 -0
- package/papyrus-web/dist/index.html +42 -0
- package/papyrus-web/dist/manifest.json +15 -0
- package/papyrus-web/dist/papyrus.ico +0 -0
- package/papyrus-web/index.html +41 -0
- package/papyrus-web/package.json +104 -0
- package/papyrus-web/public/favicon.ico +0 -0
- package/papyrus-web/public/manifest.json +15 -0
- package/papyrus-web/public/papyrus.ico +0 -0
- package/papyrus-web/src/ReactFlow.css +17 -0
- package/papyrus-web/src/core/PapyrusIcon.tsx +17 -0
- package/papyrus-web/src/core/PapyrusNavigationBarIcon.tsx +46 -0
- package/papyrus-web/src/core/URL.ts +34 -0
- package/papyrus-web/src/extensions/ExtensionRegistryMergeStrategy.ts +50 -0
- package/papyrus-web/src/fonts/Lato/Lato-Black.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-BlackItalic.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-Bold.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-BoldItalic.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-Italic.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-Light.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-LightItalic.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-Regular.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-Thin.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/Lato-ThinItalic.ttf +0 -0
- package/papyrus-web/src/fonts/Lato/OFL.txt +93 -0
- package/papyrus-web/src/fonts.css +81 -0
- package/papyrus-web/src/footer/Footer.tsx +50 -0
- package/papyrus-web/src/icons/papyrus-icon.png +0 -0
- package/papyrus-web/src/index.tsx +325 -0
- package/papyrus-web/src/portals.css +16 -0
- package/papyrus-web/src/react-app-env.d.ts +1 -0
- package/papyrus-web/src/reset.css +218 -0
- package/papyrus-web/src/variables.css +111 -0
- package/papyrus-web/src/vite-env.d.ts +1 -0
- package/papyrus-web/tsconfig.json +34 -0
- package/papyrus-web/vite.config.js +24 -0
- package/papyrus-web-components/.prettierrc +22 -0
- package/papyrus-web-components/.turbo/turbo-build.log +77 -0
- package/papyrus-web-components/.turbo/turbo-format-lint.log +6 -0
- package/papyrus-web-components/README.adoc +13 -0
- package/papyrus-web-components/dist/diagram-tools/EditProjectView.types.d.ts +48 -0
- package/papyrus-web-components/dist/diagram-tools/EditProjectView.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.d.ts +3 -0
- package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.types.d.ts +33 -0
- package/papyrus-web-components/dist/diagram-tools/FilterableSortableList.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.d.ts +15 -0
- package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.types.d.ts +20 -0
- package/papyrus-web-components/dist/diagram-tools/ModelBrowserFilterBar.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.d.ts +3 -0
- package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.types.d.ts +53 -0
- package/papyrus-web-components/dist/diagram-tools/PapyrusPopupToolContribution.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/TransferModal.d.ts +3 -0
- package/papyrus-web-components/dist/diagram-tools/TransferModal.d.ts.map +1 -0
- package/papyrus-web-components/dist/diagram-tools/TransferModal.types.d.ts +32 -0
- package/papyrus-web-components/dist/diagram-tools/TransferModal.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/index.d.ts +61 -0
- package/papyrus-web-components/dist/index.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/NodesDocumentTransform.d.ts +15 -0
- package/papyrus-web-components/dist/nodes/NodesDocumentTransform.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.types.d.ts +29 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeLayoutHandler.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListLayoutHandler.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/cuboid/CuboidNodeListLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.d.ts +3 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.types.d.ts +34 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeConverter.d.ts +22 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeLayoutHandler.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/customImage/CustomImageNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.d.ts +15 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.types.d.ts +33 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeConverter.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeLayoutHandler.d.ts +25 -0
- package/papyrus-web-components/dist/nodes/ellipse/EllipseNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.types.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeLayoutHandler.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/innerFlag/InnerFlagNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/note/NoteLabel.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/note/NoteLabel.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/note/NoteNode.d.ts +19 -0
- package/papyrus-web-components/dist/nodes/note/NoteNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/note/NoteNode.types.d.ts +41 -0
- package/papyrus-web-components/dist/nodes/note/NoteNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/note/NoteNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/note/NoteNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/note/NoteNodeLayoutHandler.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/note/NoteNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.types.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeLayoutHandler.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/outerFlag/OuterFlagNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNode.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/package/PackageNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNode.types.d.ts +29 -0
- package/papyrus-web-components/dist/nodes/package/PackageNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeLayoutHandler.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeListConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeListConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeListLayoutHandler.d.ts +24 -0
- package/papyrus-web-components/dist/nodes/package/PackageNodeListLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.d.ts +18 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.d.ts +23 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.d.ts +21 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.d.ts.map +1 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.d.ts +20 -0
- package/papyrus-web-components/dist/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.d.ts.map +1 -0
- package/papyrus-web-components/dist/papyrus-web-components.es.js +11710 -0
- package/papyrus-web-components/dist/papyrus-web-components.umd.js +11664 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.d.ts +3 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.types.d.ts +55 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModal.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModalMachine.d.ts +65 -0
- package/papyrus-web-components/dist/profile/apply-profile/ApplyProfileModalMachine.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-profile/UMLModelTreeItemContextMenuContribution.d.ts +16 -0
- package/papyrus-web-components/dist/profile/apply-profile/UMLModelTreeItemContextMenuContribution.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.d.ts +15 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.types.d.ts +48 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModal.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModalMachine.d.ts +65 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/ApplyStereotypeModalMachine.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.d.ts +16 -0
- package/papyrus-web-components/dist/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.d.ts +16 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.types.d.ts +72 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileDialog.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.d.ts +16 -0
- package/papyrus-web-components/dist/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/CustomWidgetsDocumentTransform.d.ts +15 -0
- package/papyrus-web-components/dist/widgets/CustomWidgetsDocumentTransform.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceFragment.types.d.ts +145 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceFragment.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceIcon.d.ts +16 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferencePreview.d.ts +19 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferencePreview.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceSection.d.ts +21 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ContainmentReferenceSection.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ReorderIcon.d.ts +18 -0
- package/papyrus-web-components/dist/widgets/containmentReference/ReorderIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.d.ts +17 -0
- package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.types.d.ts +23 -0
- package/papyrus-web-components/dist/widgets/containmentReference/dialogs/CreateNewChildDialog.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/customImage/AddImageIcon.d.ts +17 -0
- package/papyrus-web-components/dist/widgets/customImage/AddImageIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageFragment.types.d.ts +83 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageFragment.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageIcon.d.ts +17 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImagePreview.d.ts +20 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImagePreview.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageSection.d.ts +21 -0
- package/papyrus-web-components/dist/widgets/customImage/CustomImageSection.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.d.ts +17 -0
- package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.types.d.ts +29 -0
- package/papyrus-web-components/dist/widgets/dialogs/ReorderItemsDialog.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionFragment.types.d.ts +97 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionFragment.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionIcon.d.ts +16 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionPreview.d.ts +6 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionPreview.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionSection.d.ts +21 -0
- package/papyrus-web-components/dist/widgets/languageExpression/LanguageExpressionSection.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPreview.d.ts +19 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPreview.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.d.ts +7 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.d.ts +135 -0
- package/papyrus-web-components/dist/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioFragment.type.d.ts +42 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioFragment.type.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioIcon.d.ts +16 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioIcon.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioPreview.d.ts +19 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioPreview.d.ts.map +1 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioSection.d.ts +18 -0
- package/papyrus-web-components/dist/widgets/primitiveRadio/PrimitiveRadioSection.d.ts.map +1 -0
- package/papyrus-web-components/package.json +105 -0
- package/papyrus-web-components/src/diagram-tools/EditProjectView.types.ts +56 -0
- package/papyrus-web-components/src/diagram-tools/FilterableSortableList.tsx +172 -0
- package/papyrus-web-components/src/diagram-tools/FilterableSortableList.types.ts +34 -0
- package/papyrus-web-components/src/diagram-tools/ModelBrowserFilterBar.tsx +73 -0
- package/papyrus-web-components/src/diagram-tools/ModelBrowserFilterBar.types.ts +19 -0
- package/papyrus-web-components/src/diagram-tools/PapyrusPopupToolContribution.tsx +206 -0
- package/papyrus-web-components/src/diagram-tools/PapyrusPopupToolContribution.types.ts +61 -0
- package/papyrus-web-components/src/diagram-tools/TransferModal.tsx +235 -0
- package/papyrus-web-components/src/diagram-tools/TransferModal.types.ts +35 -0
- package/papyrus-web-components/src/index.ts +61 -0
- package/papyrus-web-components/src/nodes/NodesDocumentTransform.ts +242 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNode.tsx +183 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNode.types.ts +30 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNodeConverter.ts +201 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNodeLayoutHandler.ts +283 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNodeListConverter.ts +238 -0
- package/papyrus-web-components/src/nodes/cuboid/CuboidNodeListLayoutHandler.ts +260 -0
- package/papyrus-web-components/src/nodes/customImage/CustomImageNode.tsx +153 -0
- package/papyrus-web-components/src/nodes/customImage/CustomImageNode.types.ts +37 -0
- package/papyrus-web-components/src/nodes/customImage/CustomImageNodeConverter.ts +212 -0
- package/papyrus-web-components/src/nodes/customImage/CustomImageNodeLayoutHandler.ts +53 -0
- package/papyrus-web-components/src/nodes/ellipse/EllipseNode.tsx +119 -0
- package/papyrus-web-components/src/nodes/ellipse/EllipseNode.types.ts +35 -0
- package/papyrus-web-components/src/nodes/ellipse/EllipseNodeConverter.ts +208 -0
- package/papyrus-web-components/src/nodes/ellipse/EllipseNodeLayoutHandler.ts +284 -0
- package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNode.tsx +156 -0
- package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNode.types.ts +23 -0
- package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNodeConverter.ts +200 -0
- package/papyrus-web-components/src/nodes/innerFlag/InnerFlagNodeLayoutHandler.ts +118 -0
- package/papyrus-web-components/src/nodes/note/NoteLabel.tsx +146 -0
- package/papyrus-web-components/src/nodes/note/NoteNode.tsx +168 -0
- package/papyrus-web-components/src/nodes/note/NoteNode.types.ts +43 -0
- package/papyrus-web-components/src/nodes/note/NoteNodeConverter.ts +200 -0
- package/papyrus-web-components/src/nodes/note/NoteNodeLayoutHandler.ts +85 -0
- package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNode.tsx +153 -0
- package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNode.types.ts +23 -0
- package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNodeConverter.ts +200 -0
- package/papyrus-web-components/src/nodes/outerFlag/OuterFlagNodeLayoutHandler.ts +116 -0
- package/papyrus-web-components/src/nodes/package/PackageNode.tsx +200 -0
- package/papyrus-web-components/src/nodes/package/PackageNode.types.ts +30 -0
- package/papyrus-web-components/src/nodes/package/PackageNodeConverter.ts +243 -0
- package/papyrus-web-components/src/nodes/package/PackageNodeLayoutHandler.ts +229 -0
- package/papyrus-web-components/src/nodes/package/PackageNodeListConverter.ts +254 -0
- package/papyrus-web-components/src/nodes/package/PackageNodeListLayoutHandler.ts +253 -0
- package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.tsx +155 -0
- package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNode.types.ts +23 -0
- package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeConverter.ts +205 -0
- package/papyrus-web-components/src/nodes/rectangleWithExternalLabel/RectangleWithExternalLabelNodeLayoutHandler.ts +55 -0
- package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModal.tsx +238 -0
- package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModal.types.tsx +65 -0
- package/papyrus-web-components/src/profile/apply-profile/ApplyProfileModalMachine.tsx +175 -0
- package/papyrus-web-components/src/profile/apply-profile/UMLModelTreeItemContextMenuContribution.tsx +74 -0
- package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModal.tsx +248 -0
- package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModal.types.ts +57 -0
- package/papyrus-web-components/src/profile/apply-stereotype/ApplyStereotypeModalMachine.ts +185 -0
- package/papyrus-web-components/src/profile/apply-stereotype/UMLElementTreeItemContextMenuContribution.tsx +70 -0
- package/papyrus-web-components/src/profile/publish-profile/PublishProfileDialog.tsx +380 -0
- package/papyrus-web-components/src/profile/publish-profile/PublishProfileDialog.types.ts +84 -0
- package/papyrus-web-components/src/profile/publish-profile/PublishProfileTreeItemContextMenuContribution.tsx +59 -0
- package/papyrus-web-components/src/widgets/CustomWidgetsDocumentTransform.ts +215 -0
- package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceFragment.types.ts +178 -0
- package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceIcon.tsx +38 -0
- package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferencePreview.tsx +106 -0
- package/papyrus-web-components/src/widgets/containmentReference/ContainmentReferenceSection.tsx +508 -0
- package/papyrus-web-components/src/widgets/containmentReference/ReorderIcon.tsx +31 -0
- package/papyrus-web-components/src/widgets/containmentReference/dialogs/CreateNewChildDialog.tsx +104 -0
- package/papyrus-web-components/src/widgets/containmentReference/dialogs/CreateNewChildDialog.types.ts +24 -0
- package/papyrus-web-components/src/widgets/customImage/AddImageIcon.tsx +35 -0
- package/papyrus-web-components/src/widgets/customImage/CustomImageFragment.types.ts +98 -0
- package/papyrus-web-components/src/widgets/customImage/CustomImageIcon.tsx +34 -0
- package/papyrus-web-components/src/widgets/customImage/CustomImagePreview.tsx +87 -0
- package/papyrus-web-components/src/widgets/customImage/CustomImageSection.tsx +348 -0
- package/papyrus-web-components/src/widgets/dialogs/ReorderItemsDialog.tsx +145 -0
- package/papyrus-web-components/src/widgets/dialogs/ReorderItemsDialog.types.ts +30 -0
- package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionFragment.types.ts +117 -0
- package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionIcon.tsx +36 -0
- package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionPreview.tsx +163 -0
- package/papyrus-web-components/src/widgets/languageExpression/LanguageExpressionSection.tsx +548 -0
- package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPreview.tsx +158 -0
- package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPropertySection.tsx +616 -0
- package/papyrus-web-components/src/widgets/primitiveList/PrimitiveListWidgetPropertySection.types.ts +162 -0
- package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioFragment.type.ts +49 -0
- package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioIcon.tsx +36 -0
- package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioPreview.tsx +88 -0
- package/papyrus-web-components/src/widgets/primitiveRadio/PrimitiveRadioSection.tsx +128 -0
- package/papyrus-web-components/tsconfig.json +14 -0
- package/papyrus-web-components/vite.config.js +26 -0
- package/turbo.json +31 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2021, 2025 CEA LIST, Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
import { GQLApplyProfileMutationData, GQLGetProfilesQueryData, Profile } from './ApplyProfileModal.types';
|
|
14
|
+
import { assign, Machine } from 'xstate';
|
|
15
|
+
|
|
16
|
+
export interface ApplyProfileModalStateSchema {
|
|
17
|
+
states: {
|
|
18
|
+
toast: {
|
|
19
|
+
states: {
|
|
20
|
+
visible: {};
|
|
21
|
+
hidden: {};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
applyProfileModal: {
|
|
25
|
+
states: {
|
|
26
|
+
loading: {};
|
|
27
|
+
valid: {};
|
|
28
|
+
applyingProfile: {};
|
|
29
|
+
success: {};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type SchemaValue = {
|
|
36
|
+
applyProfileModal: 'loading' | 'valid' | 'applyingProfile' | 'success';
|
|
37
|
+
toast: 'visible' | 'hidden';
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export interface ApplyProfileModalContext {
|
|
41
|
+
selectedProfileId: string;
|
|
42
|
+
profiles: Profile[];
|
|
43
|
+
message: string | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ShowToastEvent = { type: 'SHOW_TOAST'; message: string };
|
|
47
|
+
export type HideToastEvent = { type: 'HIDE_TOAST' };
|
|
48
|
+
export type FetchedProfilesEvent = {
|
|
49
|
+
type: 'HANDLE_FETCHED_PROFILES';
|
|
50
|
+
data: GQLGetProfilesQueryData;
|
|
51
|
+
};
|
|
52
|
+
export type ChangeProfileEvent = {
|
|
53
|
+
type: 'CHANGE_PROFILE';
|
|
54
|
+
profileId: string;
|
|
55
|
+
};
|
|
56
|
+
export type ApplyProfileEvent = { type: 'APPLY_PROFILE' };
|
|
57
|
+
export type HandleResponseEvent = { type: 'HANDLE_RESPONSE'; data: GQLApplyProfileMutationData };
|
|
58
|
+
export type ApplyProfileModalEvent =
|
|
59
|
+
| FetchedProfilesEvent
|
|
60
|
+
| ChangeProfileEvent
|
|
61
|
+
| ApplyProfileEvent
|
|
62
|
+
| HandleResponseEvent
|
|
63
|
+
| ShowToastEvent
|
|
64
|
+
| HideToastEvent;
|
|
65
|
+
|
|
66
|
+
export const applyProfileModalMachine = Machine<
|
|
67
|
+
ApplyProfileModalContext,
|
|
68
|
+
ApplyProfileModalStateSchema,
|
|
69
|
+
ApplyProfileModalEvent
|
|
70
|
+
>(
|
|
71
|
+
{
|
|
72
|
+
id: 'ApplyProfileModal',
|
|
73
|
+
type: 'parallel',
|
|
74
|
+
context: {
|
|
75
|
+
selectedProfileId: '',
|
|
76
|
+
profiles: [],
|
|
77
|
+
message: null,
|
|
78
|
+
},
|
|
79
|
+
states: {
|
|
80
|
+
toast: {
|
|
81
|
+
initial: 'hidden',
|
|
82
|
+
states: {
|
|
83
|
+
hidden: {
|
|
84
|
+
on: {
|
|
85
|
+
SHOW_TOAST: {
|
|
86
|
+
target: 'visible',
|
|
87
|
+
actions: 'setMessage',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
visible: {
|
|
92
|
+
on: {
|
|
93
|
+
HIDE_TOAST: {
|
|
94
|
+
target: 'hidden',
|
|
95
|
+
actions: 'clearMessage',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
applyProfileModal: {
|
|
102
|
+
initial: 'loading',
|
|
103
|
+
states: {
|
|
104
|
+
loading: {
|
|
105
|
+
on: {
|
|
106
|
+
HANDLE_FETCHED_PROFILES: [
|
|
107
|
+
{
|
|
108
|
+
target: 'valid',
|
|
109
|
+
actions: 'updateProfiles',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
valid: {
|
|
115
|
+
on: {
|
|
116
|
+
CHANGE_PROFILE: [
|
|
117
|
+
{
|
|
118
|
+
actions: 'updateProfile',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
APPLY_PROFILE: [
|
|
122
|
+
{
|
|
123
|
+
target: 'applyingProfile',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
applyingProfile: {
|
|
129
|
+
on: {
|
|
130
|
+
HANDLE_RESPONSE: [
|
|
131
|
+
{
|
|
132
|
+
cond: 'isResponseSuccessful',
|
|
133
|
+
target: 'success',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
target: 'valid',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
success: {
|
|
142
|
+
type: 'final',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
guards: {
|
|
150
|
+
isResponseSuccessful: (_, event) => {
|
|
151
|
+
const { data } = event as HandleResponseEvent;
|
|
152
|
+
return data.applyProfile.__typename === 'ApplyProfileSuccessPayload';
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
actions: {
|
|
156
|
+
updateProfiles: assign((_, event) => {
|
|
157
|
+
const { data } = event as FetchedProfilesEvent;
|
|
158
|
+
const { profileMetadatas: profiles } = data.viewer;
|
|
159
|
+
const selectedProfileId = profiles.length > 0 ? profiles[0].uriPath : '';
|
|
160
|
+
return { profiles, selectedProfileId };
|
|
161
|
+
}),
|
|
162
|
+
updateProfile: assign((_, event) => {
|
|
163
|
+
const { profileId } = event as ChangeProfileEvent;
|
|
164
|
+
return { selectedProfileId: profileId };
|
|
165
|
+
}),
|
|
166
|
+
setMessage: assign((_, event) => {
|
|
167
|
+
const { message } = event as ShowToastEvent;
|
|
168
|
+
return { message };
|
|
169
|
+
}),
|
|
170
|
+
clearMessage: assign((_) => {
|
|
171
|
+
return { message: null };
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
);
|
package/papyrus-web-components/src/profile/apply-profile/UMLModelTreeItemContextMenuContribution.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2021, 2025 CEA LIST, Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
import { TreeItemContextMenuComponentProps } from '@eclipse-sirius/sirius-components-trees';
|
|
14
|
+
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
15
|
+
import ListItemText from '@mui/material/ListItemText';
|
|
16
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
17
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
18
|
+
import { forwardRef, Fragment, useState } from 'react';
|
|
19
|
+
import { ApplyProfileModal } from './ApplyProfileModal';
|
|
20
|
+
|
|
21
|
+
type Modal = 'ApplyProfile';
|
|
22
|
+
|
|
23
|
+
export const UMLModelTreeItemContextMenuContribution = forwardRef(
|
|
24
|
+
(
|
|
25
|
+
{ editingContextId, item, readOnly, treeId, onClose }: TreeItemContextMenuComponentProps,
|
|
26
|
+
ref: React.ForwardedRef<HTMLLIElement>
|
|
27
|
+
) => {
|
|
28
|
+
const [modal, setModal] = useState<Modal | null>(null);
|
|
29
|
+
|
|
30
|
+
const onAppliedProfile = () => {
|
|
31
|
+
onClose();
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
let modalElement: JSX.Element | null = null;
|
|
35
|
+
if (modal === 'ApplyProfile') {
|
|
36
|
+
modalElement = (
|
|
37
|
+
<ApplyProfileModal
|
|
38
|
+
editingContextId={editingContextId}
|
|
39
|
+
item={item}
|
|
40
|
+
onAppliedProfile={onAppliedProfile}
|
|
41
|
+
onClose={onClose}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (
|
|
47
|
+
treeId.startsWith('explorer://') &&
|
|
48
|
+
item.editable &&
|
|
49
|
+
(item.kind === 'siriusComponents://semantic?domain=uml&entity=Model' ||
|
|
50
|
+
item.kind === 'siriusComponents://semantic?domain=uml&entity=Package' ||
|
|
51
|
+
item.kind === 'siriusComponents://semantic?domain=uml&entity=Profile')
|
|
52
|
+
) {
|
|
53
|
+
return (
|
|
54
|
+
<Fragment key="umlmodel-tree-item-context-menu-contribution">
|
|
55
|
+
<MenuItem
|
|
56
|
+
key="apply-profile"
|
|
57
|
+
data-testid="apply-profile"
|
|
58
|
+
onClick={() => setModal('ApplyProfile')}
|
|
59
|
+
ref={ref}
|
|
60
|
+
disabled={readOnly}
|
|
61
|
+
aria-disabled>
|
|
62
|
+
<ListItemIcon>
|
|
63
|
+
<AddIcon fontSize="small" />
|
|
64
|
+
</ListItemIcon>
|
|
65
|
+
<ListItemText primary="Apply a profile" />
|
|
66
|
+
</MenuItem>
|
|
67
|
+
{modalElement}
|
|
68
|
+
</Fragment>
|
|
69
|
+
);
|
|
70
|
+
} else {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
@@ -0,0 +1,248 @@
|
|
|
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
|
+
|
|
14
|
+
import { gql, useMutation, useQuery } from '@apollo/client';
|
|
15
|
+
import Button from '@mui/material/Button';
|
|
16
|
+
import Dialog from '@mui/material/Dialog';
|
|
17
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
18
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
19
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
20
|
+
import IconButton from '@mui/material/IconButton';
|
|
21
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
22
|
+
import { useMachine } from '@xstate/react';
|
|
23
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
24
|
+
import Select from '@mui/material/Select';
|
|
25
|
+
import Snackbar from '@mui/material/Snackbar';
|
|
26
|
+
import { makeStyles } from 'tss-react/mui';
|
|
27
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
28
|
+
import { StateMachine } from 'xstate';
|
|
29
|
+
import { useEffect } from 'react';
|
|
30
|
+
import {
|
|
31
|
+
ApplyStereotypeModalProps,
|
|
32
|
+
GQLApplyStereotypeMutationData,
|
|
33
|
+
GQLApplyStereotypePayload,
|
|
34
|
+
GQLErrorPayload,
|
|
35
|
+
GQLGetStereotypesQueryData,
|
|
36
|
+
GQLGetStereotypesQueryVariables,
|
|
37
|
+
} from './ApplyStereotypeModal.types';
|
|
38
|
+
import {
|
|
39
|
+
ApplyStereotypeModalContext,
|
|
40
|
+
ApplyStereotypeModalEvent,
|
|
41
|
+
ChangeStereotypeEvent,
|
|
42
|
+
FetchedStereotypesEvent,
|
|
43
|
+
HandleResponseEvent,
|
|
44
|
+
HideToastEvent,
|
|
45
|
+
SchemaValue,
|
|
46
|
+
ShowToastEvent,
|
|
47
|
+
applyStereotypeModalMachine,
|
|
48
|
+
ApplyStereotypeModalStateSchema,
|
|
49
|
+
} from './ApplyStereotypeModalMachine';
|
|
50
|
+
|
|
51
|
+
const applyStereotypeMutation = gql`
|
|
52
|
+
mutation applyStereotype($input: ApplyStereotypeInput!) {
|
|
53
|
+
applyStereotype(input: $input) {
|
|
54
|
+
__typename
|
|
55
|
+
... on ApplyStereotypeSuccessPayload {
|
|
56
|
+
id
|
|
57
|
+
}
|
|
58
|
+
... on ErrorPayload {
|
|
59
|
+
message
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const getStereotypesQuery = gql`
|
|
66
|
+
query getStereotypes($editingContextId: ID!, $elementId: ID!) {
|
|
67
|
+
viewer {
|
|
68
|
+
editingContext(editingContextId: $editingContextId) {
|
|
69
|
+
stereotypeMetatadas(elementId: $elementId) {
|
|
70
|
+
id
|
|
71
|
+
label
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
const useApplyStereotypeModalStyles = makeStyles()((theme) => ({
|
|
79
|
+
form: {
|
|
80
|
+
display: 'flex',
|
|
81
|
+
flexDirection: 'column',
|
|
82
|
+
'& > *': {
|
|
83
|
+
marginBottom: theme.spacing(1),
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
const isErrorPayload = (payload: GQLApplyStereotypePayload): payload is GQLErrorPayload =>
|
|
89
|
+
payload.__typename === 'ErrorPayload';
|
|
90
|
+
|
|
91
|
+
export const ApplyStereotypeModal = ({
|
|
92
|
+
editingContextId,
|
|
93
|
+
item,
|
|
94
|
+
onAppliedStereotype,
|
|
95
|
+
onClose,
|
|
96
|
+
}: ApplyStereotypeModalProps) => {
|
|
97
|
+
const { classes } = useApplyStereotypeModalStyles();
|
|
98
|
+
const [{ value, context }, dispatch] =
|
|
99
|
+
useMachine<StateMachine<ApplyStereotypeModalContext, ApplyStereotypeModalStateSchema, ApplyStereotypeModalEvent>>(
|
|
100
|
+
applyStereotypeModalMachine
|
|
101
|
+
);
|
|
102
|
+
const { applyStereotypeModal, toast } = value as SchemaValue;
|
|
103
|
+
const { selectedStereotypeId, stereotypes, message } = context;
|
|
104
|
+
|
|
105
|
+
const {
|
|
106
|
+
loading: stereotypesLoading,
|
|
107
|
+
data: stereotypesData,
|
|
108
|
+
error: stereotypesError,
|
|
109
|
+
} = useQuery<GQLGetStereotypesQueryData, GQLGetStereotypesQueryVariables>(getStereotypesQuery, {
|
|
110
|
+
variables: { editingContextId, elementId: item.id },
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (!stereotypesLoading) {
|
|
115
|
+
if (stereotypesError) {
|
|
116
|
+
const showToastEvent: ShowToastEvent = {
|
|
117
|
+
type: 'SHOW_TOAST',
|
|
118
|
+
message: 'An unexpected error has occurred, please refresh the page',
|
|
119
|
+
};
|
|
120
|
+
dispatch(showToastEvent);
|
|
121
|
+
}
|
|
122
|
+
if (stereotypesData) {
|
|
123
|
+
const fetchStereotypesEvent: FetchedStereotypesEvent = {
|
|
124
|
+
type: 'HANDLE_FETCHED_STEREOTYPES',
|
|
125
|
+
data: stereotypesData,
|
|
126
|
+
};
|
|
127
|
+
dispatch(fetchStereotypesEvent);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, [stereotypesLoading, stereotypesData, stereotypesError, dispatch]);
|
|
131
|
+
|
|
132
|
+
const onStereotypeChange = (event) => {
|
|
133
|
+
const value = event.target.value;
|
|
134
|
+
const changeStereotypeEvent: ChangeStereotypeEvent = {
|
|
135
|
+
type: 'CHANGE_STEREOTYPE',
|
|
136
|
+
stereotypeId: value,
|
|
137
|
+
};
|
|
138
|
+
dispatch(changeStereotypeEvent);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const [applyStereotype, { loading: applyStereotypeLoading, data: applyStereotypeData, error: applyStereotypeError }] =
|
|
142
|
+
useMutation<GQLApplyStereotypeMutationData>(applyStereotypeMutation);
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (!applyStereotypeLoading) {
|
|
145
|
+
if (applyStereotypeError) {
|
|
146
|
+
const showToastEvent: ShowToastEvent = {
|
|
147
|
+
type: 'SHOW_TOAST',
|
|
148
|
+
message: 'An unexpected error has occurred, please refresh the page',
|
|
149
|
+
};
|
|
150
|
+
dispatch(showToastEvent);
|
|
151
|
+
}
|
|
152
|
+
if (applyStereotypeData) {
|
|
153
|
+
const handleResponseEvent: HandleResponseEvent = { type: 'HANDLE_RESPONSE', data: applyStereotypeData };
|
|
154
|
+
dispatch(handleResponseEvent);
|
|
155
|
+
|
|
156
|
+
const { applyStereotype } = applyStereotypeData;
|
|
157
|
+
if (isErrorPayload(applyStereotype)) {
|
|
158
|
+
const { message } = applyStereotype;
|
|
159
|
+
const showToastEvent: ShowToastEvent = { type: 'SHOW_TOAST', message };
|
|
160
|
+
dispatch(showToastEvent);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}, [applyStereotypeLoading, applyStereotypeData, applyStereotypeError, dispatch]);
|
|
165
|
+
|
|
166
|
+
const onApplyStereotype = () => {
|
|
167
|
+
dispatch({ type: 'APPLY_STEREOTYPE' } as ApplyStereotypeModalEvent);
|
|
168
|
+
const input = {
|
|
169
|
+
id: crypto.randomUUID(),
|
|
170
|
+
editingContextId,
|
|
171
|
+
elementId: item.id,
|
|
172
|
+
stereotypeId: selectedStereotypeId,
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
applyStereotype({ variables: { input } });
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (applyStereotypeModal === 'success') {
|
|
180
|
+
onAppliedStereotype();
|
|
181
|
+
}
|
|
182
|
+
}, [applyStereotypeModal, onAppliedStereotype]);
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<>
|
|
186
|
+
<Dialog
|
|
187
|
+
open={true}
|
|
188
|
+
onClose={onClose}
|
|
189
|
+
aria-labelledby="dialog-title"
|
|
190
|
+
maxWidth="xs"
|
|
191
|
+
fullWidth
|
|
192
|
+
data-testid="apply-stereotype-dialog">
|
|
193
|
+
<DialogTitle id="dialog-title" data-testid="apply-stereotype-dialog-title">
|
|
194
|
+
Apply a new stereotype
|
|
195
|
+
</DialogTitle>
|
|
196
|
+
<DialogContent data-testid="apply-stereotype-dialog-content">
|
|
197
|
+
<div className={classes.form}>
|
|
198
|
+
<InputLabel id="applyStereotypeModalStereotypeLabel">Stereotype</InputLabel>
|
|
199
|
+
<Select
|
|
200
|
+
value={selectedStereotypeId}
|
|
201
|
+
onChange={onStereotypeChange}
|
|
202
|
+
disabled={applyStereotypeModal === 'loading' || applyStereotypeModal === 'applyingStereotype'}
|
|
203
|
+
labelId="newDocumentModalStereotypeDescriptionLabel"
|
|
204
|
+
inputProps={{ 'data-testid': 'stereotype-input' }}
|
|
205
|
+
fullWidth
|
|
206
|
+
data-testid="stereotype">
|
|
207
|
+
{stereotypes.map((stereotype) => (
|
|
208
|
+
<MenuItem value={stereotype.id} key={stereotype.id} data-testid={stereotype.label}>
|
|
209
|
+
{stereotype.label}
|
|
210
|
+
</MenuItem>
|
|
211
|
+
))}
|
|
212
|
+
</Select>
|
|
213
|
+
</div>
|
|
214
|
+
</DialogContent>
|
|
215
|
+
<DialogActions>
|
|
216
|
+
<Button
|
|
217
|
+
variant="contained"
|
|
218
|
+
disabled={applyStereotypeModal !== 'valid'}
|
|
219
|
+
data-testid="apply-stereotype-submit"
|
|
220
|
+
color="primary"
|
|
221
|
+
onClick={onApplyStereotype}>
|
|
222
|
+
Apply
|
|
223
|
+
</Button>
|
|
224
|
+
</DialogActions>
|
|
225
|
+
</Dialog>
|
|
226
|
+
<Snackbar
|
|
227
|
+
anchorOrigin={{
|
|
228
|
+
vertical: 'bottom',
|
|
229
|
+
horizontal: 'right',
|
|
230
|
+
}}
|
|
231
|
+
open={toast === 'visible'}
|
|
232
|
+
autoHideDuration={3000}
|
|
233
|
+
onClose={() => dispatch({ type: 'HIDE_TOAST' } as HideToastEvent)}
|
|
234
|
+
message={message}
|
|
235
|
+
action={
|
|
236
|
+
<IconButton
|
|
237
|
+
size="small"
|
|
238
|
+
aria-label="close"
|
|
239
|
+
color="inherit"
|
|
240
|
+
onClick={() => dispatch({ type: 'HIDE_TOAST' } as HideToastEvent)}>
|
|
241
|
+
<CloseIcon fontSize="small" />
|
|
242
|
+
</IconButton>
|
|
243
|
+
}
|
|
244
|
+
data-testid="error"
|
|
245
|
+
/>
|
|
246
|
+
</>
|
|
247
|
+
);
|
|
248
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2021, 2025 CEA LIST, Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
|
|
14
|
+
export interface GQLGetStereotypesQueryVariables {
|
|
15
|
+
editingContextId: string;
|
|
16
|
+
elementId: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GQLGetStereotypesQueryData {
|
|
20
|
+
viewer: GQLViewer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GQLViewer {
|
|
24
|
+
editingContext: GQLEditingContext;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GQLEditingContext {
|
|
28
|
+
stereotypeMetatadas: GQLStereotypeMetadata[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GQLStereotypeMetadata {
|
|
32
|
+
label: string;
|
|
33
|
+
id: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ApplyStereotypeModalProps {
|
|
37
|
+
editingContextId: string;
|
|
38
|
+
item: any;
|
|
39
|
+
onAppliedStereotype: () => void;
|
|
40
|
+
onClose: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface GQLApplyStereotypeMutationData {
|
|
44
|
+
applyStereotype: GQLApplyStereotypePayload;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface GQLApplyStereotypePayload {
|
|
48
|
+
__typename: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface GQLApplyStereotypeSuccessPayload extends GQLApplyStereotypePayload {
|
|
52
|
+
id: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface GQLErrorPayload extends GQLApplyStereotypePayload {
|
|
56
|
+
message: string;
|
|
57
|
+
}
|