@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,98 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo, Artal Technologies.
|
|
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
|
+
* Titouan BOUETE-GIRAUD (Artal Technologies) - Issue 210
|
|
14
|
+
*****************************************************************************/
|
|
15
|
+
import { GQLMessage } from '@eclipse-sirius/sirius-components-core';
|
|
16
|
+
import { GQLWidget } from '@eclipse-sirius/sirius-components-forms';
|
|
17
|
+
import { GQLReferenceWidgetStyle } from '@eclipse-sirius/sirius-components-widget-reference';
|
|
18
|
+
import { GQLImageMetadata, ProjectImagesSettingsModal } from '@eclipse-sirius/sirius-web-application';
|
|
19
|
+
|
|
20
|
+
export type CustomImageWidgetModal = 'Select' | ProjectImagesSettingsModal;
|
|
21
|
+
|
|
22
|
+
export interface CustomImageWidgetState {
|
|
23
|
+
modal: CustomImageWidgetModal | null;
|
|
24
|
+
url: string;
|
|
25
|
+
validImage: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GQLCustomImageWidget extends GQLWidget {
|
|
29
|
+
label: string;
|
|
30
|
+
currentUuid: string;
|
|
31
|
+
style: GQLReferenceWidgetStyle | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CustomImageWidgetStyleProps {
|
|
35
|
+
color: string | null;
|
|
36
|
+
fontSize: number | null;
|
|
37
|
+
italic: boolean | null;
|
|
38
|
+
bold: boolean | null;
|
|
39
|
+
underline: boolean | null;
|
|
40
|
+
strikeThrough: boolean | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface GQLNewUuidInput {
|
|
44
|
+
id: string;
|
|
45
|
+
editingContextId: string;
|
|
46
|
+
representationId: string;
|
|
47
|
+
customImageId: string;
|
|
48
|
+
newUuid: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface GQLRemoveUuidInput {
|
|
52
|
+
id: string;
|
|
53
|
+
editingContextId: string;
|
|
54
|
+
representationId: string;
|
|
55
|
+
customImageId: string;
|
|
56
|
+
removeUuid: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface GQLNewUuidData {
|
|
60
|
+
newUuid: GQLNewUuidPayload;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface GQLRemoveUuidData {
|
|
64
|
+
removeUuid: GQLRemoveUuidPayload;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface GQLNewUuidVariables {
|
|
68
|
+
input: GQLNewUuidInput;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface GQLRemoveUuidVariables {
|
|
72
|
+
input: GQLRemoveUuidInput;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface GQLNewUuidPayload {
|
|
76
|
+
__typename: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface GQLRemoveUuidPayload {
|
|
80
|
+
__typename: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface GQLSuccessPayload extends GQLNewUuidPayload, GQLRemoveUuidPayload {
|
|
84
|
+
messages: GQLMessage[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface GQLErrorPayload extends GQLNewUuidPayload, GQLRemoveUuidPayload {
|
|
88
|
+
messages: GQLMessage[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface SelectImageModalProps {
|
|
92
|
+
currentUuid: string;
|
|
93
|
+
images: GQLImageMetadata[];
|
|
94
|
+
onImageSelected: (newUuid: string) => void;
|
|
95
|
+
onClose: () => void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type CustomImageParams = 'projectId';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo, Artal Technologies.
|
|
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
|
+
* Titouan BOUETE-GIRAUD (Artal Technologies) - Issue 210
|
|
14
|
+
*****************************************************************************/
|
|
15
|
+
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon';
|
|
16
|
+
|
|
17
|
+
export const CustomImageIcon = (props: SvgIconProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<SvgIcon
|
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
aria-labelledby="title"
|
|
23
|
+
aria-describedby="desc"
|
|
24
|
+
role="img"
|
|
25
|
+
{...props}>
|
|
26
|
+
<g>
|
|
27
|
+
<rect fill="none" height="24" width="24" />
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
<path d="M 19 19 H 5 V 5 h 14 v 14 h 2 V 5 c 0 -1.1 -0.89 -2 -2 -2 H 5 C 3.9 3 3 3.9 3 5 v 14 c 0 1.1 0.9 2 2 2 h 14 c 1.11 0 2 -0.9 2 -2 h -2 M 19 14 L 15 10 L 11 16 L 8 13 L 5 16 L 5 18 L 8 15 L 11 18 L 15 12 L 19 16 M 11 7 A 1 1 0 0 0 11 9 A 1 1 0 0 0 11 7z" />
|
|
31
|
+
</g>
|
|
32
|
+
</SvgIcon>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2019, 2025 CEA LIST, Obeo, Artal Technologies.
|
|
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
|
+
* Titouan BOUETE-GIRAUD (Artal Technologies) - Issue 210
|
|
14
|
+
*****************************************************************************/
|
|
15
|
+
import { WidgetProps } from '@eclipse-sirius/sirius-components-formdescriptioneditors';
|
|
16
|
+
import { getTextDecorationLineValue } from '@eclipse-sirius/sirius-components-forms';
|
|
17
|
+
import { GQLReferenceWidgetStyle } from '@eclipse-sirius/sirius-components-widget-reference';
|
|
18
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
19
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
20
|
+
import HelpOutlineOutlinedIcon from '@mui/icons-material/HelpOutlineOutlined';
|
|
21
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
22
|
+
import IconButton from '@mui/material/IconButton';
|
|
23
|
+
import Typography from '@mui/material/Typography';
|
|
24
|
+
import { makeStyles } from 'tss-react/mui';
|
|
25
|
+
import { GQLCustomImageWidget } from './CustomImageFragment.types';
|
|
26
|
+
import { CustomImageIcon } from './CustomImageIcon';
|
|
27
|
+
|
|
28
|
+
const useStyles = makeStyles<GQLReferenceWidgetStyle>()(
|
|
29
|
+
(_theme, { color, fontSize, italic, bold, underline, strikeThrough }) => ({
|
|
30
|
+
style: {
|
|
31
|
+
color: color ?? undefined,
|
|
32
|
+
fontSize: fontSize ?? undefined,
|
|
33
|
+
fontStyle: italic ? 'italic' : undefined,
|
|
34
|
+
fontWeight: bold ? 'bold' : undefined,
|
|
35
|
+
textDecorationLine: getTextDecorationLineValue(underline, strikeThrough),
|
|
36
|
+
},
|
|
37
|
+
toolbar: {
|
|
38
|
+
marginLeft: 'auto',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
},
|
|
42
|
+
propertySectionLabel: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
type PropertySectionComponentProps = WidgetProps<GQLCustomImageWidget>;
|
|
51
|
+
|
|
52
|
+
export const CustomImagePreview = ({ widget }: PropertySectionComponentProps) => {
|
|
53
|
+
const styleProps: GQLReferenceWidgetStyle = {
|
|
54
|
+
color: widget.style?.color ?? null,
|
|
55
|
+
fontSize: widget.style?.fontSize ?? null,
|
|
56
|
+
italic: widget.style?.italic ?? null,
|
|
57
|
+
bold: widget.style?.bold ?? null,
|
|
58
|
+
underline: widget.style?.underline ?? null,
|
|
59
|
+
strikeThrough: widget.style?.strikeThrough ?? null,
|
|
60
|
+
};
|
|
61
|
+
const { classes } = useStyles(styleProps);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<div className={classes.propertySectionLabel}>
|
|
66
|
+
<Typography variant="subtitle2">{widget.label}</Typography>
|
|
67
|
+
{widget.hasHelpText ? (
|
|
68
|
+
<HelpOutlineOutlinedIcon color="secondary" style={{ marginLeft: 8, fontSize: 16 }} />
|
|
69
|
+
) : null}
|
|
70
|
+
</div>
|
|
71
|
+
<div data-testid={`custom-image-${widget.label}`} style={{ display: 'flex' }}>
|
|
72
|
+
<CustomImageIcon width="250%" />
|
|
73
|
+
<div className={classes.toolbar} data-testid="custom-image-toolbar">
|
|
74
|
+
<IconButton data-testid="custom-image-add" size="small" disabled>
|
|
75
|
+
<AddIcon />
|
|
76
|
+
</IconButton>
|
|
77
|
+
<IconButton data-testid="custom-image-select" size="small" disabled>
|
|
78
|
+
<MoreHorizIcon />
|
|
79
|
+
</IconButton>
|
|
80
|
+
<IconButton data-testid="custom-image-remove" size="small" disabled>
|
|
81
|
+
<DeleteIcon />
|
|
82
|
+
</IconButton>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo, Artal Technologies.
|
|
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
|
+
* Titouan BOUETE-GIRAUD (Artal Technologies) - Issue 210
|
|
14
|
+
*****************************************************************************/
|
|
15
|
+
|
|
16
|
+
import { gql, useMutation } from '@apollo/client';
|
|
17
|
+
import { ServerContext, ServerContextValue, getCSSColor, useMultiToast } from '@eclipse-sirius/sirius-components-core';
|
|
18
|
+
import {
|
|
19
|
+
PropertySectionComponentProps,
|
|
20
|
+
PropertySectionLabel,
|
|
21
|
+
getTextDecorationLineValue,
|
|
22
|
+
} from '@eclipse-sirius/sirius-components-forms';
|
|
23
|
+
import { UploadImageModal, useProjectImages } from '@eclipse-sirius/sirius-web-application';
|
|
24
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
25
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
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 DialogTitle from '@mui/material/DialogTitle';
|
|
31
|
+
import IconButton from '@mui/material/IconButton';
|
|
32
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
33
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
34
|
+
import Select from '@mui/material/Select';
|
|
35
|
+
import Typography from '@mui/material/Typography';
|
|
36
|
+
import { useContext, useEffect, useState } from 'react';
|
|
37
|
+
import { useParams } from 'react-router-dom';
|
|
38
|
+
import { makeStyles } from 'tss-react/mui';
|
|
39
|
+
import { AddImageIcon } from './AddImageIcon';
|
|
40
|
+
import {
|
|
41
|
+
CustomImageParams,
|
|
42
|
+
CustomImageWidgetState,
|
|
43
|
+
CustomImageWidgetStyleProps,
|
|
44
|
+
GQLCustomImageWidget,
|
|
45
|
+
GQLErrorPayload,
|
|
46
|
+
GQLNewUuidData,
|
|
47
|
+
GQLNewUuidInput,
|
|
48
|
+
GQLNewUuidPayload,
|
|
49
|
+
GQLNewUuidVariables,
|
|
50
|
+
GQLRemoveUuidData,
|
|
51
|
+
GQLRemoveUuidInput,
|
|
52
|
+
GQLRemoveUuidPayload,
|
|
53
|
+
GQLRemoveUuidVariables,
|
|
54
|
+
GQLSuccessPayload,
|
|
55
|
+
SelectImageModalProps,
|
|
56
|
+
} from './CustomImageFragment.types';
|
|
57
|
+
|
|
58
|
+
export const newUuidMutation = gql`
|
|
59
|
+
mutation newUuid($input: NewUuidInput!) {
|
|
60
|
+
newUuid(input: $input) {
|
|
61
|
+
__typename
|
|
62
|
+
... on ErrorPayload {
|
|
63
|
+
messages {
|
|
64
|
+
body
|
|
65
|
+
level
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
... on SuccessPayload {
|
|
69
|
+
messages {
|
|
70
|
+
body
|
|
71
|
+
level
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
export const removeUuidMutation = gql`
|
|
79
|
+
mutation removeUuid($input: RemoveUuidInput!) {
|
|
80
|
+
removeUuid(input: $input) {
|
|
81
|
+
__typename
|
|
82
|
+
... on ErrorPayload {
|
|
83
|
+
messages {
|
|
84
|
+
body
|
|
85
|
+
level
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
... on SuccessPayload {
|
|
89
|
+
messages {
|
|
90
|
+
body
|
|
91
|
+
level
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
const defaultErrorMessage = 'An unexpected error has occurred, please refresh the page';
|
|
99
|
+
|
|
100
|
+
const useStylesSection = makeStyles<CustomImageWidgetStyleProps>()(
|
|
101
|
+
(theme, { color, fontSize, italic, bold, underline, strikeThrough }) => ({
|
|
102
|
+
labelItemStyle: {
|
|
103
|
+
color: color ? getCSSColor(color, theme) : undefined,
|
|
104
|
+
fontSize: fontSize ?? undefined,
|
|
105
|
+
fontStyle: italic ? 'italic' : undefined,
|
|
106
|
+
fontWeight: bold ? 'bold' : undefined,
|
|
107
|
+
textDecorationLine: getTextDecorationLineValue(underline, strikeThrough),
|
|
108
|
+
},
|
|
109
|
+
toolbar: {
|
|
110
|
+
marginLeft: 'auto',
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
export const CustomImageSection = ({
|
|
118
|
+
widget,
|
|
119
|
+
editingContextId,
|
|
120
|
+
formId,
|
|
121
|
+
}: PropertySectionComponentProps<GQLCustomImageWidget>) => {
|
|
122
|
+
const { addErrorMessage, addMessages } = useMultiToast();
|
|
123
|
+
const { projectId: projectIdParam } = useParams<CustomImageParams>();
|
|
124
|
+
const projectId = projectIdParam ?? '';
|
|
125
|
+
|
|
126
|
+
const { httpOrigin } = useContext<ServerContextValue>(ServerContext);
|
|
127
|
+
const [state, setState] = useState<CustomImageWidgetState>({
|
|
128
|
+
modal: null,
|
|
129
|
+
url: widget.currentUuid ? httpOrigin + widget.currentUuid : '',
|
|
130
|
+
validImage: widget.currentUuid !== undefined && widget.currentUuid !== '',
|
|
131
|
+
});
|
|
132
|
+
const { data, loading, refreshImages } = useProjectImages(projectId);
|
|
133
|
+
const [newUuidApi, { loading: newUuidLoading, data: newUuidData, error: newUuidError }] = useMutation<
|
|
134
|
+
GQLNewUuidData,
|
|
135
|
+
GQLNewUuidVariables
|
|
136
|
+
>(newUuidMutation);
|
|
137
|
+
const [removeUuidApi, { loading: removeUuidLoading, data: removeUuidData, error: removeUuidError }] = useMutation<
|
|
138
|
+
GQLRemoveUuidData,
|
|
139
|
+
GQLRemoveUuidVariables
|
|
140
|
+
>(removeUuidMutation);
|
|
141
|
+
|
|
142
|
+
const isErrorPayload = (payload: GQLNewUuidPayload | GQLRemoveUuidPayload): payload is GQLErrorPayload =>
|
|
143
|
+
payload.__typename === 'ErrorPayload';
|
|
144
|
+
const isSuccessPayload = (payload: GQLNewUuidPayload | GQLRemoveUuidPayload): payload is GQLSuccessPayload =>
|
|
145
|
+
payload.__typename === 'SuccessPayload';
|
|
146
|
+
|
|
147
|
+
const styleProps: CustomImageWidgetStyleProps = {
|
|
148
|
+
color: widget.style?.color ?? null,
|
|
149
|
+
fontSize: widget.style?.fontSize ?? null,
|
|
150
|
+
italic: widget.style?.italic ?? null,
|
|
151
|
+
bold: widget.style?.bold ?? null,
|
|
152
|
+
underline: widget.style?.underline ?? null,
|
|
153
|
+
strikeThrough: widget.style?.strikeThrough ?? null,
|
|
154
|
+
};
|
|
155
|
+
const { classes } = useStylesSection(styleProps);
|
|
156
|
+
|
|
157
|
+
const onErrorLoadingImage = () => {
|
|
158
|
+
setState((prevState) => ({ ...prevState, validImage: false }));
|
|
159
|
+
addErrorMessage(defaultErrorMessage);
|
|
160
|
+
};
|
|
161
|
+
const handleAddImageButton = () => setState((prevState) => ({ ...prevState, modal: 'Upload' }));
|
|
162
|
+
const handleSelectImageButton = () => setState((prevState) => ({ ...prevState, modal: 'Select' }));
|
|
163
|
+
const handleRemoveImageButton = () => {
|
|
164
|
+
const input: GQLRemoveUuidInput = {
|
|
165
|
+
id: crypto.randomUUID(),
|
|
166
|
+
editingContextId,
|
|
167
|
+
representationId: formId,
|
|
168
|
+
customImageId: widget.id,
|
|
169
|
+
removeUuid: '',
|
|
170
|
+
};
|
|
171
|
+
const variables: GQLRemoveUuidVariables = { input };
|
|
172
|
+
removeUuidApi({ variables });
|
|
173
|
+
};
|
|
174
|
+
const closeModal = () => setState((prevState) => ({ ...prevState, modal: null }));
|
|
175
|
+
|
|
176
|
+
const onImageSelected = (newUuid: string) => {
|
|
177
|
+
const input: GQLNewUuidInput = {
|
|
178
|
+
id: crypto.randomUUID(),
|
|
179
|
+
editingContextId,
|
|
180
|
+
representationId: formId,
|
|
181
|
+
customImageId: widget.id,
|
|
182
|
+
newUuid: newUuid,
|
|
183
|
+
};
|
|
184
|
+
const variables: GQLNewUuidVariables = { input };
|
|
185
|
+
newUuidApi({ variables });
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
setState((prevState) => ({
|
|
190
|
+
...prevState,
|
|
191
|
+
url: widget.currentUuid ? httpOrigin + widget.currentUuid : '',
|
|
192
|
+
validImage: widget.currentUuid !== undefined && widget.currentUuid !== '',
|
|
193
|
+
}));
|
|
194
|
+
}, [widget.currentUuid]);
|
|
195
|
+
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
if (!newUuidLoading) {
|
|
198
|
+
if (newUuidError) {
|
|
199
|
+
addErrorMessage(defaultErrorMessage);
|
|
200
|
+
}
|
|
201
|
+
if (newUuidData) {
|
|
202
|
+
const { newUuid } = newUuidData;
|
|
203
|
+
if (isErrorPayload(newUuid) || isSuccessPayload(newUuid)) {
|
|
204
|
+
addMessages(newUuid.messages);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}, [newUuidLoading, newUuidError, newUuidData]);
|
|
209
|
+
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
if (!removeUuidLoading) {
|
|
212
|
+
if (removeUuidError) {
|
|
213
|
+
addErrorMessage(defaultErrorMessage);
|
|
214
|
+
}
|
|
215
|
+
if (removeUuidData) {
|
|
216
|
+
const { removeUuid } = removeUuidData;
|
|
217
|
+
if (isErrorPayload(removeUuid) || isSuccessPayload(removeUuid)) {
|
|
218
|
+
addMessages(removeUuid.messages);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}, [removeUuidLoading, removeUuidError, removeUuidData]);
|
|
223
|
+
|
|
224
|
+
let modal: JSX.Element | null = null;
|
|
225
|
+
if (state.modal === 'Upload') {
|
|
226
|
+
modal = (
|
|
227
|
+
<UploadImageModal
|
|
228
|
+
projectId={projectId}
|
|
229
|
+
onImageUploaded={() => {
|
|
230
|
+
refreshImages();
|
|
231
|
+
closeModal();
|
|
232
|
+
}}
|
|
233
|
+
onClose={closeModal}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
} else if (state.modal === 'Select') {
|
|
237
|
+
if (!loading && data) {
|
|
238
|
+
modal = (
|
|
239
|
+
<SelectImageModal
|
|
240
|
+
currentUuid={widget.currentUuid}
|
|
241
|
+
images={data?.viewer.project?.images ?? []}
|
|
242
|
+
onImageSelected={onImageSelected}
|
|
243
|
+
onClose={closeModal}
|
|
244
|
+
/>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return (
|
|
250
|
+
<>
|
|
251
|
+
<PropertySectionLabel
|
|
252
|
+
editingContextId={editingContextId}
|
|
253
|
+
formId={formId}
|
|
254
|
+
widget={widget}
|
|
255
|
+
data-testid={widget.label}
|
|
256
|
+
/>
|
|
257
|
+
<div data-testid={`custom-image-${widget.label}`} style={{ display: 'flex' }}>
|
|
258
|
+
{state.validImage ? (
|
|
259
|
+
<img id={widget.id} src={state.url} width="25%" onError={onErrorLoadingImage} />
|
|
260
|
+
) : (
|
|
261
|
+
<Typography data-testid="custom-image-widget-no-image" variant="caption">
|
|
262
|
+
No image
|
|
263
|
+
</Typography>
|
|
264
|
+
)}
|
|
265
|
+
<div className={classes.toolbar} data-testid="custom-image-widget-toolbar">
|
|
266
|
+
{modal}
|
|
267
|
+
<IconButton data-testid="custom-image-widget-add" onClick={handleAddImageButton} size="small">
|
|
268
|
+
<AddImageIcon />
|
|
269
|
+
</IconButton>
|
|
270
|
+
<IconButton data-testid="custom-image-widget-select" onClick={handleSelectImageButton} size="small">
|
|
271
|
+
<MoreHorizIcon />
|
|
272
|
+
</IconButton>
|
|
273
|
+
<IconButton data-testid="custom-image-widget-remove" onClick={handleRemoveImageButton} size="small">
|
|
274
|
+
<DeleteIcon />
|
|
275
|
+
</IconButton>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</>
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const useStylesModal = makeStyles()((theme) => ({
|
|
283
|
+
form: {
|
|
284
|
+
display: 'flex',
|
|
285
|
+
flexDirection: 'column',
|
|
286
|
+
paddingTop: theme.spacing(1),
|
|
287
|
+
paddingLeft: theme.spacing(2),
|
|
288
|
+
paddingRight: theme.spacing(2),
|
|
289
|
+
'& > *': {
|
|
290
|
+
marginBottom: theme.spacing(2),
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
}));
|
|
294
|
+
|
|
295
|
+
export const SelectImageModal = (props: SelectImageModalProps) => {
|
|
296
|
+
const { currentUuid, images, onImageSelected, onClose } = props;
|
|
297
|
+
const { classes } = useStylesModal();
|
|
298
|
+
const [symbol, setSymbol] = useState(currentUuid);
|
|
299
|
+
const { httpOrigin } = useContext<ServerContextValue>(ServerContext);
|
|
300
|
+
|
|
301
|
+
const handleChange = (event) => {
|
|
302
|
+
setSymbol(event.target.value);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
return (
|
|
306
|
+
<>
|
|
307
|
+
<Dialog open={true} onClose={onClose} aria-labelledby="dialog-title" fullWidth>
|
|
308
|
+
<DialogTitle id="dialog-title">Select a Symbol</DialogTitle>
|
|
309
|
+
<DialogContent>
|
|
310
|
+
<form id="select-image-form-id" encType="multipart/form-data" className={classes.form}>
|
|
311
|
+
<InputLabel>Symbol</InputLabel>
|
|
312
|
+
<Select data-testid="select-image-select" value={symbol} onChange={handleChange} displayEmpty>
|
|
313
|
+
<MenuItem data-testid="select-image-select-None" value={''}>
|
|
314
|
+
None
|
|
315
|
+
</MenuItem>
|
|
316
|
+
{images.map((image, index) => {
|
|
317
|
+
return (
|
|
318
|
+
<MenuItem data-testid={'select-image-select-' + image.label} key={index} value={image.url}>
|
|
319
|
+
<img
|
|
320
|
+
id={index.toString()}
|
|
321
|
+
src={httpOrigin + image.url}
|
|
322
|
+
width="5%"
|
|
323
|
+
style={{ marginLeft: '0.5rem', marginRight: '0.5rem' }}
|
|
324
|
+
/>
|
|
325
|
+
{image.label}
|
|
326
|
+
</MenuItem>
|
|
327
|
+
);
|
|
328
|
+
})}
|
|
329
|
+
</Select>
|
|
330
|
+
</form>
|
|
331
|
+
</DialogContent>
|
|
332
|
+
<DialogActions>
|
|
333
|
+
<Button
|
|
334
|
+
variant="contained"
|
|
335
|
+
color="primary"
|
|
336
|
+
form="upload-form-id"
|
|
337
|
+
data-testid="select-image-confirm"
|
|
338
|
+
onClick={() => {
|
|
339
|
+
onImageSelected(symbol);
|
|
340
|
+
onClose();
|
|
341
|
+
}}>
|
|
342
|
+
Confirm
|
|
343
|
+
</Button>
|
|
344
|
+
</DialogActions>
|
|
345
|
+
</Dialog>
|
|
346
|
+
</>
|
|
347
|
+
);
|
|
348
|
+
};
|