@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,548 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo.
|
|
3
|
+
*
|
|
4
|
+
* All rights reserved. This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
8
|
+
*
|
|
9
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
10
|
+
*
|
|
11
|
+
* Contributors:
|
|
12
|
+
* Obeo - Initial API and implementation
|
|
13
|
+
***************************************************************************/
|
|
14
|
+
|
|
15
|
+
import { PropertySectionComponentProps, PropertySectionLabel } from '@eclipse-sirius/sirius-components-forms';
|
|
16
|
+
|
|
17
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
18
|
+
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
|
19
|
+
import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp';
|
|
20
|
+
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
|
|
21
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
22
|
+
import MuiAccordion from '@mui/material/Accordion';
|
|
23
|
+
import MuiAccordionDetails from '@mui/material/AccordionDetails';
|
|
24
|
+
import MuiAccordionSummary from '@mui/material/AccordionSummary';
|
|
25
|
+
import Box from '@mui/material/Box';
|
|
26
|
+
import Button from '@mui/material/Button';
|
|
27
|
+
import Dialog from '@mui/material/Dialog';
|
|
28
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
29
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
30
|
+
import DialogContentText from '@mui/material/DialogContentText';
|
|
31
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
32
|
+
import IconButton from '@mui/material/IconButton';
|
|
33
|
+
import List from '@mui/material/List';
|
|
34
|
+
import ListItemButton from '@mui/material/ListItemButton';
|
|
35
|
+
import ListItemText from '@mui/material/ListItemText';
|
|
36
|
+
import TextField from '@mui/material/TextField';
|
|
37
|
+
import Typography from '@mui/material/Typography';
|
|
38
|
+
import { useTheme } from '@mui/material/styles';
|
|
39
|
+
import { makeStyles, withStyles } from 'tss-react/mui';
|
|
40
|
+
|
|
41
|
+
import { gql, useMutation } from '@apollo/client';
|
|
42
|
+
import { useMultiToast } from '@eclipse-sirius/sirius-components-core';
|
|
43
|
+
import { useEffect, useState } from 'react';
|
|
44
|
+
import {
|
|
45
|
+
GQLAddLanguageData,
|
|
46
|
+
GQLAddLanguageInput,
|
|
47
|
+
GQLAddLanguagePayload,
|
|
48
|
+
GQLAddLanguageVariables,
|
|
49
|
+
GQLDeleteLanguageData,
|
|
50
|
+
GQLDeleteLanguagePayload,
|
|
51
|
+
GQLDeleteLanguageVariables,
|
|
52
|
+
GQLEditLanguageBodyData,
|
|
53
|
+
GQLEditLanguageBodyInput,
|
|
54
|
+
GQLEditLanguageBodyVariables,
|
|
55
|
+
GQLErrorPayload,
|
|
56
|
+
GQLLanguageExpression,
|
|
57
|
+
GQLMoveLanguageData,
|
|
58
|
+
GQLMoveLanguageInput,
|
|
59
|
+
GQLMoveLanguageVariables,
|
|
60
|
+
GQLSuccessPayload,
|
|
61
|
+
} from './LanguageExpressionFragment.types';
|
|
62
|
+
|
|
63
|
+
const Accordion = withStyles(MuiAccordion, (theme) => ({
|
|
64
|
+
root: {
|
|
65
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
66
|
+
boxShadow: 'none',
|
|
67
|
+
'&:not(:last-child)': {
|
|
68
|
+
borderBottom: 0,
|
|
69
|
+
},
|
|
70
|
+
'&:before': {
|
|
71
|
+
display: 'none',
|
|
72
|
+
},
|
|
73
|
+
'&$expanded': {
|
|
74
|
+
margin: 'auto',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
expanded: {},
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
const AccordionSummary = withStyles(MuiAccordionSummary, (_theme) => ({
|
|
81
|
+
root: {
|
|
82
|
+
backgroundColor: 'rgba(0, 0, 0, .03)',
|
|
83
|
+
borderBottom: '1px solid rgba(0, 0, 0, .125)',
|
|
84
|
+
marginBottom: -1,
|
|
85
|
+
minHeight: 56,
|
|
86
|
+
paddingLeft: 8,
|
|
87
|
+
flexDirection: 'row-reverse',
|
|
88
|
+
'& .MuiAccordionSummary-expandIcon.Mui-expanded': {
|
|
89
|
+
transform: 'rotate(90deg)',
|
|
90
|
+
},
|
|
91
|
+
'& .MuiIconButton-edgeEnd': {
|
|
92
|
+
marginRight: 0,
|
|
93
|
+
},
|
|
94
|
+
'&$expanded': {
|
|
95
|
+
minHeight: 56,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
content: {
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
'&$expanded': {
|
|
101
|
+
margin: '12px 0',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
expanded: {},
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const AccordionDetails = withStyles(MuiAccordionDetails, (theme) => ({
|
|
108
|
+
root: {
|
|
109
|
+
padding: theme.spacing(1),
|
|
110
|
+
borderTop: '1px solid rgba(0, 0, 0, .125)',
|
|
111
|
+
},
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const useStyles = makeStyles()(() => ({
|
|
115
|
+
paper: {
|
|
116
|
+
minWidth: '450px',
|
|
117
|
+
},
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
export const addLanguageMutation = gql`
|
|
121
|
+
mutation addLanguage($input: AddLanguageInput!) {
|
|
122
|
+
addLanguage(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
|
+
export const deleteLanguageMutation = gql`
|
|
141
|
+
mutation deleteLanguage($input: DeleteLanguageInput!) {
|
|
142
|
+
deleteLanguage(input: $input) {
|
|
143
|
+
__typename
|
|
144
|
+
... on ErrorPayload {
|
|
145
|
+
messages {
|
|
146
|
+
body
|
|
147
|
+
level
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
... on SuccessPayload {
|
|
151
|
+
messages {
|
|
152
|
+
body
|
|
153
|
+
level
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
export const editLanguageBodyMutation = gql`
|
|
161
|
+
mutation editLanguageBody($input: EditLanguageBodyInput!) {
|
|
162
|
+
editLanguageBody(input: $input) {
|
|
163
|
+
__typename
|
|
164
|
+
... on ErrorPayload {
|
|
165
|
+
messages {
|
|
166
|
+
body
|
|
167
|
+
level
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
... on SuccessPayload {
|
|
171
|
+
messages {
|
|
172
|
+
body
|
|
173
|
+
level
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
export const moveLanguageMutation = gql`
|
|
181
|
+
mutation moveLanguage($input: MoveLanguageInput!) {
|
|
182
|
+
moveLanguage(input: $input) {
|
|
183
|
+
__typename
|
|
184
|
+
... on ErrorPayload {
|
|
185
|
+
messages {
|
|
186
|
+
body
|
|
187
|
+
level
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
... on SuccessPayload {
|
|
191
|
+
messages {
|
|
192
|
+
body
|
|
193
|
+
level
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
`;
|
|
199
|
+
export const LanguageExpressionSection = ({
|
|
200
|
+
editingContextId,
|
|
201
|
+
formId,
|
|
202
|
+
widget,
|
|
203
|
+
readOnly,
|
|
204
|
+
}: PropertySectionComponentProps<GQLLanguageExpression>) => {
|
|
205
|
+
const { addErrorMessage, addMessages } = useMultiToast();
|
|
206
|
+
const { classes } = useStyles();
|
|
207
|
+
const theme = useTheme();
|
|
208
|
+
const [expanded, setExpanded] = useState<string | false>(false);
|
|
209
|
+
const [addLanguageDialogOpen, setAddLanguageDialogOpen] = useState(false);
|
|
210
|
+
const [selectedPredefinedLanguage, setSelectedPredefinedLanguage] = useState('');
|
|
211
|
+
const [newLanguage, setNewLanguage] = useState('');
|
|
212
|
+
const [currentBody, setCurrentBody] = useState('');
|
|
213
|
+
const [knownLanguagesSelected, setKnownLanguagesSelected] = useState(false);
|
|
214
|
+
|
|
215
|
+
const [addLanguageApi, { loading: addLanguageLoading, data: addLanguageData, error: addLanguageError }] = useMutation<
|
|
216
|
+
GQLAddLanguageData,
|
|
217
|
+
GQLAddLanguageVariables
|
|
218
|
+
>(addLanguageMutation);
|
|
219
|
+
|
|
220
|
+
const [deleteLanguageApi, { loading: deleteLanguageLoading, data: deleteLanguageData, error: deleteLanguageError }] =
|
|
221
|
+
useMutation<GQLDeleteLanguageData, GQLDeleteLanguageVariables>(deleteLanguageMutation);
|
|
222
|
+
|
|
223
|
+
const [
|
|
224
|
+
editLanguageBodyApi,
|
|
225
|
+
{ loading: editLanguageBodyLoading, data: editLanguageBodyData, error: editLanguageBodyError },
|
|
226
|
+
] = useMutation<GQLEditLanguageBodyData, GQLEditLanguageBodyVariables>(editLanguageBodyMutation);
|
|
227
|
+
|
|
228
|
+
const [moveLanguageApi, { loading: moveLanguageLoading, data: moveLanguageData, error: moveLanguageError }] =
|
|
229
|
+
useMutation<GQLMoveLanguageData, GQLMoveLanguageVariables>(moveLanguageMutation);
|
|
230
|
+
|
|
231
|
+
const isErrorPayload = (payload: GQLAddLanguagePayload | GQLDeleteLanguagePayload): payload is GQLErrorPayload =>
|
|
232
|
+
payload.__typename === 'ErrorPayload';
|
|
233
|
+
const isSuccessPayload = (payload: GQLAddLanguagePayload | GQLDeleteLanguagePayload): payload is GQLSuccessPayload =>
|
|
234
|
+
payload.__typename === 'SuccessPayload';
|
|
235
|
+
|
|
236
|
+
useEffect(() => {
|
|
237
|
+
if (!addLanguageLoading) {
|
|
238
|
+
if (addLanguageError) {
|
|
239
|
+
addErrorMessage('An unexpected error has occurred, please refresh the page');
|
|
240
|
+
}
|
|
241
|
+
if (addLanguageData) {
|
|
242
|
+
const { addLanguage } = addLanguageData;
|
|
243
|
+
if (isErrorPayload(addLanguage) || isSuccessPayload(addLanguage)) {
|
|
244
|
+
addMessages(addLanguage.messages);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}, [addLanguageLoading, addLanguageError, addLanguageData]);
|
|
249
|
+
|
|
250
|
+
useEffect(() => {
|
|
251
|
+
if (!deleteLanguageLoading) {
|
|
252
|
+
if (deleteLanguageError) {
|
|
253
|
+
addErrorMessage('An unexpected error has occurred, please refresh the page');
|
|
254
|
+
}
|
|
255
|
+
if (deleteLanguageData) {
|
|
256
|
+
const { deleteLanguage } = deleteLanguageData;
|
|
257
|
+
if (isErrorPayload(deleteLanguage) || isSuccessPayload(deleteLanguage)) {
|
|
258
|
+
addMessages(deleteLanguage.messages);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}, [deleteLanguageLoading, deleteLanguageError, deleteLanguageData]);
|
|
263
|
+
|
|
264
|
+
useEffect(() => {
|
|
265
|
+
if (!editLanguageBodyLoading) {
|
|
266
|
+
if (editLanguageBodyError) {
|
|
267
|
+
addErrorMessage('An unexpected error has occurred, please refresh the page');
|
|
268
|
+
}
|
|
269
|
+
if (editLanguageBodyData) {
|
|
270
|
+
const { editLanguageBody } = editLanguageBodyData;
|
|
271
|
+
if (isErrorPayload(editLanguageBody) || isSuccessPayload(editLanguageBody)) {
|
|
272
|
+
addMessages(editLanguageBody.messages);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}, [editLanguageBodyLoading, editLanguageBodyError, editLanguageBodyData]);
|
|
277
|
+
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
if (!moveLanguageLoading) {
|
|
280
|
+
if (moveLanguageError) {
|
|
281
|
+
addErrorMessage('An unexpected error has occurred, please refresh the page');
|
|
282
|
+
}
|
|
283
|
+
if (moveLanguageData) {
|
|
284
|
+
const { moveLanguage } = moveLanguageData;
|
|
285
|
+
if (isErrorPayload(moveLanguage) || isSuccessPayload(moveLanguage)) {
|
|
286
|
+
addMessages(moveLanguage.messages);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}, [moveLanguageLoading, moveLanguageError, moveLanguageData]);
|
|
291
|
+
|
|
292
|
+
const handlePanelExpansion = (panel: string) => (_event: React.SyntheticEvent, expanded: boolean) => {
|
|
293
|
+
setExpanded(expanded ? panel : false);
|
|
294
|
+
if (expanded) {
|
|
295
|
+
// language body is now visible
|
|
296
|
+
const body = getLanguage(panel)?.body;
|
|
297
|
+
if (body !== undefined) {
|
|
298
|
+
setCurrentBody(body);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
const handleDeleteLanguage = (language: string) => {
|
|
304
|
+
const input: GQLAddLanguageInput = {
|
|
305
|
+
id: crypto.randomUUID(),
|
|
306
|
+
editingContextId,
|
|
307
|
+
representationId: formId,
|
|
308
|
+
languageExpressionId: widget.id,
|
|
309
|
+
language,
|
|
310
|
+
};
|
|
311
|
+
const variables: GQLAddLanguageVariables = { input };
|
|
312
|
+
deleteLanguageApi({ variables });
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// Move language operations
|
|
316
|
+
|
|
317
|
+
const moveLanguage = (language, direction) => {
|
|
318
|
+
const input: GQLMoveLanguageInput = {
|
|
319
|
+
id: crypto.randomUUID(),
|
|
320
|
+
editingContextId,
|
|
321
|
+
representationId: formId,
|
|
322
|
+
languageExpressionId: widget.id,
|
|
323
|
+
language: language.label,
|
|
324
|
+
direction,
|
|
325
|
+
};
|
|
326
|
+
const variables: GQLMoveLanguageVariables = { input };
|
|
327
|
+
moveLanguageApi({ variables });
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
const moveLanguageUp = (language) => moveLanguage(language, 'BACKWARD');
|
|
331
|
+
const moveLanguageDown = (language) => moveLanguage(language, 'FORWARD');
|
|
332
|
+
|
|
333
|
+
// Add language dialog
|
|
334
|
+
|
|
335
|
+
const handleAddLanguage = () => {
|
|
336
|
+
closeAddLanguageDialog();
|
|
337
|
+
const language = knownLanguagesSelected ? selectedPredefinedLanguage : newLanguage;
|
|
338
|
+
const input: GQLAddLanguageInput = {
|
|
339
|
+
id: crypto.randomUUID(),
|
|
340
|
+
editingContextId,
|
|
341
|
+
representationId: formId,
|
|
342
|
+
languageExpressionId: widget.id,
|
|
343
|
+
language,
|
|
344
|
+
};
|
|
345
|
+
const variables: GQLAddLanguageVariables = { input };
|
|
346
|
+
addLanguageApi({ variables });
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
const openAddLanguageDialog = () => {
|
|
350
|
+
setSelectedPredefinedLanguage('');
|
|
351
|
+
setNewLanguage('');
|
|
352
|
+
setAddLanguageDialogOpen(true);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const closeAddLanguageDialog = () => {
|
|
356
|
+
setKnownLanguagesSelected(false);
|
|
357
|
+
setAddLanguageDialogOpen(false);
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
const handlePredefinedLanguageSelected = (_: React.MouseEvent<HTMLDivElement, MouseEvent>, language: string) => {
|
|
361
|
+
setSelectedPredefinedLanguage(language);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const handleNewLanguageChange = (event) => {
|
|
365
|
+
setNewLanguage(event.target.value);
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const handleKnownLanguagesFocusGained = () => {
|
|
369
|
+
setKnownLanguagesSelected(true);
|
|
370
|
+
setNewLanguage('');
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
const handleNewLanguageFocusGained = () => {
|
|
374
|
+
setKnownLanguagesSelected(false);
|
|
375
|
+
setSelectedPredefinedLanguage('');
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const isAlreadyExisting = (language: string): boolean => {
|
|
379
|
+
return widget.languages ? widget.languages.some((l) => l.label === language) : false;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
const handleLanguageBodyChange = (_language: string) => (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
383
|
+
setCurrentBody(event.target.value);
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const getLanguage = (label) => {
|
|
387
|
+
const language = widget.languages?.find((l) => l.label === label);
|
|
388
|
+
if (!language) {
|
|
389
|
+
addErrorMessage('Language has changed, please refresh the page');
|
|
390
|
+
return undefined;
|
|
391
|
+
} else return language;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const handleLanguageBodyFocusLost =
|
|
395
|
+
(lang: string) => (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
396
|
+
const language = getLanguage(lang);
|
|
397
|
+
if (language && language.body !== event.target.value) {
|
|
398
|
+
const input: GQLEditLanguageBodyInput = {
|
|
399
|
+
id: crypto.randomUUID(),
|
|
400
|
+
editingContextId,
|
|
401
|
+
representationId: formId,
|
|
402
|
+
languageExpressionId: widget.id,
|
|
403
|
+
language: language.label,
|
|
404
|
+
newBody: event.target.value,
|
|
405
|
+
};
|
|
406
|
+
const variables: GQLEditLanguageBodyVariables = { input };
|
|
407
|
+
editLanguageBodyApi({ variables });
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
return (
|
|
412
|
+
<div data-testid="language-expression-widget">
|
|
413
|
+
<div style={{ display: 'flex' }}>
|
|
414
|
+
<PropertySectionLabel
|
|
415
|
+
editingContextId={editingContextId}
|
|
416
|
+
formId={formId}
|
|
417
|
+
widget={widget}
|
|
418
|
+
data-testid={widget.label}
|
|
419
|
+
/>
|
|
420
|
+
<IconButton
|
|
421
|
+
data-testid="le-open-add-language-dialog"
|
|
422
|
+
onClick={openAddLanguageDialog}
|
|
423
|
+
disabled={readOnly || widget.readOnly}
|
|
424
|
+
style={{ marginLeft: 'auto' }}>
|
|
425
|
+
<AddIcon />
|
|
426
|
+
</IconButton>
|
|
427
|
+
</div>
|
|
428
|
+
{(widget.languages ?? []).map((lang, index) => {
|
|
429
|
+
return (
|
|
430
|
+
<Accordion
|
|
431
|
+
key={index}
|
|
432
|
+
expanded={expanded === lang.label}
|
|
433
|
+
onChange={handlePanelExpansion(lang.label)}
|
|
434
|
+
square
|
|
435
|
+
data-testid={`le-language-${lang.label}`}
|
|
436
|
+
elevation={0}>
|
|
437
|
+
<AccordionSummary
|
|
438
|
+
aria-controls="panel1d-content"
|
|
439
|
+
expandIcon={<ArrowForwardIosSharpIcon style={{ fontSize: '0.9rem' }} />}
|
|
440
|
+
id="panel1d-header">
|
|
441
|
+
<Typography>{lang.label}</Typography>
|
|
442
|
+
<Box sx={{ marginLeft: 'auto' }}>
|
|
443
|
+
<IconButton
|
|
444
|
+
size="small"
|
|
445
|
+
data-testid={`le-language-${lang.label}-up`}
|
|
446
|
+
disabled={index === 0 || moveLanguageLoading || readOnly || widget.readOnly}
|
|
447
|
+
onClick={(event) => {
|
|
448
|
+
moveLanguageUp(lang);
|
|
449
|
+
event.stopPropagation();
|
|
450
|
+
}}>
|
|
451
|
+
<ArrowUpwardIcon />
|
|
452
|
+
</IconButton>
|
|
453
|
+
<IconButton
|
|
454
|
+
size="small"
|
|
455
|
+
data-testid={`le-language-${lang.label}-down`}
|
|
456
|
+
disabled={
|
|
457
|
+
index === (widget.languages?.length ?? 0) - 1 || moveLanguageLoading || readOnly || widget.readOnly
|
|
458
|
+
}
|
|
459
|
+
onClick={(event) => {
|
|
460
|
+
moveLanguageDown(lang);
|
|
461
|
+
event.stopPropagation();
|
|
462
|
+
}}>
|
|
463
|
+
<ArrowDownwardIcon />
|
|
464
|
+
</IconButton>
|
|
465
|
+
<IconButton
|
|
466
|
+
size="small"
|
|
467
|
+
data-testid={`le-language-${lang.label}-delete`}
|
|
468
|
+
disabled={readOnly || widget.readOnly}
|
|
469
|
+
onClick={(event) => {
|
|
470
|
+
handleDeleteLanguage(lang.label);
|
|
471
|
+
event.stopPropagation();
|
|
472
|
+
}}>
|
|
473
|
+
<DeleteIcon />
|
|
474
|
+
</IconButton>
|
|
475
|
+
</Box>
|
|
476
|
+
</AccordionSummary>
|
|
477
|
+
<AccordionDetails>
|
|
478
|
+
<TextField
|
|
479
|
+
data-testid={`le-language-${lang.label}-body`}
|
|
480
|
+
fullWidth
|
|
481
|
+
id="outlined-multiline-flexible"
|
|
482
|
+
value={currentBody}
|
|
483
|
+
disabled={readOnly || widget.readOnly}
|
|
484
|
+
onChange={handleLanguageBodyChange(lang.label)}
|
|
485
|
+
onBlur={handleLanguageBodyFocusLost(lang.label)}
|
|
486
|
+
multiline
|
|
487
|
+
variant="outlined"
|
|
488
|
+
minRows={5}
|
|
489
|
+
maxRows={8}
|
|
490
|
+
/>
|
|
491
|
+
</AccordionDetails>
|
|
492
|
+
</Accordion>
|
|
493
|
+
);
|
|
494
|
+
})}
|
|
495
|
+
<Dialog
|
|
496
|
+
open={addLanguageDialogOpen}
|
|
497
|
+
data-testid="le-add-language-dialog"
|
|
498
|
+
onClose={closeAddLanguageDialog}
|
|
499
|
+
classes={{ paper: classes.paper }}>
|
|
500
|
+
<DialogTitle>Add Language</DialogTitle>
|
|
501
|
+
<DialogContent>
|
|
502
|
+
<DialogContentText>Known languages</DialogContentText>
|
|
503
|
+
<List
|
|
504
|
+
style={{
|
|
505
|
+
border: `2px solid ${knownLanguagesSelected ? theme.palette.selected : 'rgba(0, 0, 0, .125)'}`,
|
|
506
|
+
borderRadius: '4px',
|
|
507
|
+
}}
|
|
508
|
+
data-testid="le-add-language-dialog-know-languages"
|
|
509
|
+
onFocus={handleKnownLanguagesFocusGained}>
|
|
510
|
+
{widget.predefinedLanguages.map((lang, index) => (
|
|
511
|
+
<ListItemButton
|
|
512
|
+
key={index}
|
|
513
|
+
data-testid={`le-add-language-dialog-language-${lang}`}
|
|
514
|
+
disabled={isAlreadyExisting(lang)}
|
|
515
|
+
selected={selectedPredefinedLanguage === lang}
|
|
516
|
+
onClick={(event) => handlePredefinedLanguageSelected(event, lang)}>
|
|
517
|
+
<ListItemText primary={lang} />
|
|
518
|
+
</ListItemButton>
|
|
519
|
+
))}
|
|
520
|
+
</List>
|
|
521
|
+
<TextField
|
|
522
|
+
data-testid="le-add-language-dialog-new-language"
|
|
523
|
+
style={{ marginTop: '1rem' }}
|
|
524
|
+
fullWidth
|
|
525
|
+
variant="outlined"
|
|
526
|
+
label="New language"
|
|
527
|
+
placeholder="New language"
|
|
528
|
+
value={newLanguage}
|
|
529
|
+
onChange={handleNewLanguageChange}
|
|
530
|
+
onFocus={handleNewLanguageFocusGained}
|
|
531
|
+
error={isAlreadyExisting(newLanguage)}
|
|
532
|
+
helperText={`${isAlreadyExisting(newLanguage) ? 'This language already exists' : ''}`}
|
|
533
|
+
/>
|
|
534
|
+
</DialogContent>
|
|
535
|
+
<DialogActions>
|
|
536
|
+
<Button
|
|
537
|
+
data-testid="le-add-language-dialog-ok"
|
|
538
|
+
color="primary"
|
|
539
|
+
variant="contained"
|
|
540
|
+
disabled={(selectedPredefinedLanguage === '' && newLanguage === '') || isAlreadyExisting(newLanguage)}
|
|
541
|
+
onClick={handleAddLanguage}>
|
|
542
|
+
Ok
|
|
543
|
+
</Button>
|
|
544
|
+
</DialogActions>
|
|
545
|
+
</Dialog>
|
|
546
|
+
</div>
|
|
547
|
+
);
|
|
548
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo.
|
|
3
|
+
*
|
|
4
|
+
* All rights reserved. This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
8
|
+
*
|
|
9
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
10
|
+
*
|
|
11
|
+
* Contributors:
|
|
12
|
+
* Obeo - Initial API and implementation
|
|
13
|
+
*****************************************************************************/
|
|
14
|
+
|
|
15
|
+
import { useSelection } from '@eclipse-sirius/sirius-components-core';
|
|
16
|
+
import { WidgetProps } from '@eclipse-sirius/sirius-components-formdescriptioneditors';
|
|
17
|
+
import { getTextDecorationLineValue, GQLList, ListStyleProps } from '@eclipse-sirius/sirius-components-forms';
|
|
18
|
+
import { TextField } from '@mui/material';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
20
|
+
import { makeStyles } from 'tss-react/mui';
|
|
21
|
+
import Table from '@mui/material/Table';
|
|
22
|
+
import TableBody from '@mui/material/TableBody';
|
|
23
|
+
import TableCell from '@mui/material/TableCell';
|
|
24
|
+
import TableRow from '@mui/material/TableRow';
|
|
25
|
+
import Typography from '@mui/material/Typography';
|
|
26
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
27
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
28
|
+
import HelpOutlineOutlined from '@mui/icons-material/HelpOutlineOutlined';
|
|
29
|
+
import ImageIcon from '@mui/icons-material/Image';
|
|
30
|
+
import { useEffect, useRef, useState } from 'react';
|
|
31
|
+
|
|
32
|
+
const useStyles = makeStyles<ListStyleProps>()(
|
|
33
|
+
(theme, { color, fontSize, italic, bold, underline, strikeThrough }) => ({
|
|
34
|
+
style: {
|
|
35
|
+
color: color ?? undefined,
|
|
36
|
+
fontSize: fontSize ?? undefined,
|
|
37
|
+
fontStyle: italic ? 'italic' : undefined,
|
|
38
|
+
fontWeight: bold ? 'bold' : undefined,
|
|
39
|
+
textDecorationLine: getTextDecorationLineValue(underline, strikeThrough),
|
|
40
|
+
},
|
|
41
|
+
icon: {
|
|
42
|
+
width: '16px',
|
|
43
|
+
height: '16px',
|
|
44
|
+
marginRight: theme.spacing(2),
|
|
45
|
+
},
|
|
46
|
+
selected: {
|
|
47
|
+
color: theme.palette.selected,
|
|
48
|
+
},
|
|
49
|
+
propertySectionLabel: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
type PrimitiveListWidgetProps = WidgetProps<GQLList>;
|
|
58
|
+
|
|
59
|
+
export const PrimitiveListWidgetPreview = ({ widget }: PrimitiveListWidgetProps) => {
|
|
60
|
+
const props: ListStyleProps = {
|
|
61
|
+
color: widget.style?.color ?? null,
|
|
62
|
+
fontSize: widget.style?.fontSize ?? null,
|
|
63
|
+
italic: widget.style?.italic ?? null,
|
|
64
|
+
bold: widget.style?.bold ?? null,
|
|
65
|
+
underline: widget.style?.underline ?? null,
|
|
66
|
+
strikeThrough: widget.style?.strikeThrough ?? null,
|
|
67
|
+
};
|
|
68
|
+
const { classes } = useStyles(props);
|
|
69
|
+
|
|
70
|
+
const [selected, setSelected] = useState<Boolean>(false);
|
|
71
|
+
const ref = useRef<HTMLDivElement | null>(null);
|
|
72
|
+
|
|
73
|
+
const { selection } = useSelection();
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (ref.current && selection.entries.find((entry) => entry.id === widget.id)) {
|
|
77
|
+
ref.current.focus();
|
|
78
|
+
setSelected(true);
|
|
79
|
+
} else {
|
|
80
|
+
setSelected(false);
|
|
81
|
+
}
|
|
82
|
+
}, [widget, selection]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div onFocus={() => setSelected(true)} onBlur={() => setSelected(false)} ref={ref} tabIndex={0}>
|
|
86
|
+
<div className={classes.propertySectionLabel}>
|
|
87
|
+
<Typography variant="subtitle2" className={selected ? classes.selected : ''}>
|
|
88
|
+
{widget.label}
|
|
89
|
+
</Typography>
|
|
90
|
+
{widget.hasHelpText ? <HelpOutlineOutlined color="secondary" style={{ marginLeft: 8, fontSize: 16 }} /> : null}
|
|
91
|
+
</div>
|
|
92
|
+
<Table size="small">
|
|
93
|
+
<TableBody>
|
|
94
|
+
<TableRow>
|
|
95
|
+
<TableCell>
|
|
96
|
+
{' '}
|
|
97
|
+
<Typography color="textPrimary" className={classes.style}>
|
|
98
|
+
<ImageIcon className={classes.icon} />
|
|
99
|
+
Primitive value 1
|
|
100
|
+
</Typography>
|
|
101
|
+
</TableCell>
|
|
102
|
+
<TableCell align="right">
|
|
103
|
+
<IconButton aria-label="deleteListItem">
|
|
104
|
+
<DeleteIcon />
|
|
105
|
+
</IconButton>
|
|
106
|
+
</TableCell>
|
|
107
|
+
</TableRow>
|
|
108
|
+
<TableRow>
|
|
109
|
+
<TableCell>
|
|
110
|
+
{' '}
|
|
111
|
+
<Typography color="textPrimary" className={classes.style}>
|
|
112
|
+
<ImageIcon className={classes.icon} />
|
|
113
|
+
Primitive value 2
|
|
114
|
+
</Typography>
|
|
115
|
+
</TableCell>
|
|
116
|
+
<TableCell align="right">
|
|
117
|
+
<IconButton aria-label="deleteListItem">
|
|
118
|
+
<DeleteIcon />
|
|
119
|
+
</IconButton>
|
|
120
|
+
</TableCell>
|
|
121
|
+
</TableRow>
|
|
122
|
+
<TableRow>
|
|
123
|
+
<TableCell>
|
|
124
|
+
{' '}
|
|
125
|
+
<Typography color="textPrimary" className={classes.style}>
|
|
126
|
+
<ImageIcon className={classes.icon} />
|
|
127
|
+
Primitive value 3
|
|
128
|
+
</Typography>
|
|
129
|
+
</TableCell>
|
|
130
|
+
<TableCell align="right">
|
|
131
|
+
<IconButton aria-label="deleteListItem">
|
|
132
|
+
<DeleteIcon />
|
|
133
|
+
</IconButton>
|
|
134
|
+
</TableCell>
|
|
135
|
+
</TableRow>
|
|
136
|
+
<TableRow key="Add">
|
|
137
|
+
<TableCell>
|
|
138
|
+
<TextField
|
|
139
|
+
id={'new-item-text-field' + widget.id}
|
|
140
|
+
label="New item"
|
|
141
|
+
type="text"
|
|
142
|
+
size="small"
|
|
143
|
+
value=""
|
|
144
|
+
fullWidth
|
|
145
|
+
className={classes.style}
|
|
146
|
+
/>
|
|
147
|
+
</TableCell>
|
|
148
|
+
<TableCell align="right">
|
|
149
|
+
<IconButton size="small">
|
|
150
|
+
<AddIcon />
|
|
151
|
+
</IconButton>
|
|
152
|
+
</TableCell>
|
|
153
|
+
</TableRow>
|
|
154
|
+
</TableBody>
|
|
155
|
+
</Table>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
};
|