@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,53 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* Copyright (c) 2024, 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 218
|
|
14
|
+
* Aurelien Didier (Artal Technologies) - Issue 218
|
|
15
|
+
*****************************************************************************/
|
|
16
|
+
import {
|
|
17
|
+
Diagram,
|
|
18
|
+
DiagramNodeType,
|
|
19
|
+
ForcedDimensions,
|
|
20
|
+
ILayoutEngine,
|
|
21
|
+
INodeLayoutHandler,
|
|
22
|
+
NodeData,
|
|
23
|
+
computePreviousSize,
|
|
24
|
+
} from '@eclipse-sirius/sirius-components-diagrams';
|
|
25
|
+
import { Node } from '@xyflow/react';
|
|
26
|
+
import { CustomImageNodeData } from './CustomImageNode.types';
|
|
27
|
+
|
|
28
|
+
export class CustomImageNodeLayoutHandler implements INodeLayoutHandler<NodeData> {
|
|
29
|
+
canHandle(node: Node<NodeData, DiagramNodeType>) {
|
|
30
|
+
return node.type === 'customImageNode';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
handle(
|
|
34
|
+
_layoutEngine: ILayoutEngine,
|
|
35
|
+
previousDiagram: Diagram | null,
|
|
36
|
+
node: Node<CustomImageNodeData, 'customImageNode'>,
|
|
37
|
+
_visibleNodes: Node<NodeData, DiagramNodeType>[],
|
|
38
|
+
_directChildren: Node<NodeData, DiagramNodeType>[],
|
|
39
|
+
_newlyAddedNodes: Node<NodeData, DiagramNodeType>[],
|
|
40
|
+
forceDimensions?: ForcedDimensions
|
|
41
|
+
) {
|
|
42
|
+
const previousNode = (previousDiagram?.nodes ?? []).find((previouseNode) => previouseNode.id === node.id);
|
|
43
|
+
const previousDimensions = computePreviousSize(previousNode, node);
|
|
44
|
+
|
|
45
|
+
node.width = forceDimensions?.width ?? previousDimensions.width;
|
|
46
|
+
const nodeHeight = forceDimensions?.height ?? previousDimensions.height;
|
|
47
|
+
if (nodeHeight > previousDimensions.height) {
|
|
48
|
+
node.height = nodeHeight;
|
|
49
|
+
} else {
|
|
50
|
+
node.height = previousDimensions.height;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 CEA LIST, Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Code duplicated from <a href="https://github.com/eclipse-sirius/sirius-web">Sirius Web</a> (packages\sirius-web\frontend\sirius-web\src\nodes\EllipseNode.tsx).
|
|
16
|
+
*/
|
|
17
|
+
import { getCSSColor } from '@eclipse-sirius/sirius-components-core';
|
|
18
|
+
import {
|
|
19
|
+
ConnectionCreationHandles,
|
|
20
|
+
ConnectionHandles,
|
|
21
|
+
ConnectionTargetHandle,
|
|
22
|
+
DiagramContext,
|
|
23
|
+
DiagramContextValue,
|
|
24
|
+
Label,
|
|
25
|
+
useConnectorNodeStyle,
|
|
26
|
+
useConnectionLineNodeStyle,
|
|
27
|
+
useDrop,
|
|
28
|
+
useDropNodeStyle,
|
|
29
|
+
useRefreshConnectionHandles,
|
|
30
|
+
} from '@eclipse-sirius/sirius-components-diagrams';
|
|
31
|
+
import { Theme, useTheme } from '@mui/material/styles';
|
|
32
|
+
import { Node, NodeProps, NodeResizer } from '@xyflow/react';
|
|
33
|
+
import React, { memo, useContext } from 'react';
|
|
34
|
+
import { EllipseNodeData, NodeComponentsMap } from './EllipseNode.types';
|
|
35
|
+
|
|
36
|
+
const ellipseNodeStyle = (
|
|
37
|
+
theme: Theme,
|
|
38
|
+
style: React.CSSProperties,
|
|
39
|
+
selected: boolean,
|
|
40
|
+
hovered: boolean,
|
|
41
|
+
faded: boolean
|
|
42
|
+
): React.CSSProperties => {
|
|
43
|
+
const ellipseNodeStyle: React.CSSProperties = {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
padding: '8px',
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
borderRadius: '50%',
|
|
49
|
+
border: 'black solid 1px',
|
|
50
|
+
opacity: faded ? '0.4' : '',
|
|
51
|
+
...style,
|
|
52
|
+
background: getCSSColor(String(style.background), theme),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if (selected || hovered) {
|
|
56
|
+
ellipseNodeStyle.outline = `${theme.palette.selected} solid 1px`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return ellipseNodeStyle;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const resizeLineStyle = (theme: Theme): React.CSSProperties => {
|
|
63
|
+
return { borderWidth: theme.spacing(0.15) };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const resizeHandleStyle = (theme: Theme): React.CSSProperties => {
|
|
67
|
+
return {
|
|
68
|
+
width: theme.spacing(1),
|
|
69
|
+
height: theme.spacing(1),
|
|
70
|
+
borderRadius: '100%',
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const EllipseNode: NodeComponentsMap['ellipseNode'] = memo(
|
|
75
|
+
({ data, id, selected, dragging }: NodeProps<Node<EllipseNodeData>>) => {
|
|
76
|
+
const { readOnly } = useContext<DiagramContextValue>(DiagramContext);
|
|
77
|
+
const theme = useTheme();
|
|
78
|
+
const { onDrop, onDragOver } = useDrop();
|
|
79
|
+
const { style: connectionFeedbackStyle } = useConnectorNodeStyle(id, data.nodeDescription.id);
|
|
80
|
+
const { style: dropFeedbackStyle } = useDropNodeStyle(data.isDropNodeTarget, data.isDropNodeCandidate, dragging);
|
|
81
|
+
const { style: connectionLineActiveNodeStyle } = useConnectionLineNodeStyle(data.connectionLinePositionOnNode);
|
|
82
|
+
|
|
83
|
+
const handleOnDrop = (event: React.DragEvent) => {
|
|
84
|
+
onDrop(event, id);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
useRefreshConnectionHandles(id, data.connectionHandles);
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
{data.nodeDescription?.userResizable !== 'NONE' && !readOnly ? (
|
|
92
|
+
<NodeResizer
|
|
93
|
+
handleStyle={{ ...resizeHandleStyle(theme) }}
|
|
94
|
+
lineStyle={{ ...resizeLineStyle(theme) }}
|
|
95
|
+
color={theme.palette.selected}
|
|
96
|
+
isVisible={!!selected}
|
|
97
|
+
shouldResize={() => !data.isBorderNode}
|
|
98
|
+
keepAspectRatio={data.nodeDescription?.keepAspectRatio}
|
|
99
|
+
/>
|
|
100
|
+
) : null}
|
|
101
|
+
<div
|
|
102
|
+
style={{
|
|
103
|
+
...ellipseNodeStyle(theme, data.style, !!selected, data.isHovered, data.faded),
|
|
104
|
+
...connectionFeedbackStyle,
|
|
105
|
+
...dropFeedbackStyle,
|
|
106
|
+
...connectionLineActiveNodeStyle,
|
|
107
|
+
}}
|
|
108
|
+
onDragOver={onDragOver}
|
|
109
|
+
onDrop={handleOnDrop}
|
|
110
|
+
data-testid={`Ellipse - ${data?.insideLabel?.text}`}>
|
|
111
|
+
{data.insideLabel ? <Label diagramElementId={id} label={data.insideLabel} faded={data.faded} /> : null}
|
|
112
|
+
{!!selected ? <ConnectionCreationHandles nodeId={id} /> : null}
|
|
113
|
+
<ConnectionTargetHandle nodeId={id} nodeDescription={data.nodeDescription} isHovered={data.isHovered} />
|
|
114
|
+
<ConnectionHandles connectionHandles={data.connectionHandles} />
|
|
115
|
+
</div>
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Code duplicated from <a href="https://github.com/eclipse-sirius/sirius-web">Sirius Web</a> (packages\sirius-web\frontend\sirius-web\src\nodes\EllipseNode.types.tsx).
|
|
16
|
+
*/
|
|
17
|
+
import { GQLNodeStyle, NodeData } from '@eclipse-sirius/sirius-components-diagrams';
|
|
18
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
19
|
+
import { FC } from 'react';
|
|
20
|
+
|
|
21
|
+
export interface EllipseNodeData extends NodeData {}
|
|
22
|
+
|
|
23
|
+
export interface GQLEllipseNodeStyle extends GQLNodeStyle {
|
|
24
|
+
background: string;
|
|
25
|
+
borderColor: string;
|
|
26
|
+
borderStyle: string;
|
|
27
|
+
borderSize: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface NodeDataMap {
|
|
31
|
+
ellipseNode: EllipseNodeData;
|
|
32
|
+
}
|
|
33
|
+
export type NodeComponentsMap = {
|
|
34
|
+
[K in keyof NodeDataMap]: FC<NodeProps<Node<NodeDataMap[K], K>>>;
|
|
35
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2026 Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Code duplicated from <a href="https://github.com/eclipse-sirius/sirius-web">Sirius Web</a> (packages\sirius-web\frontend\sirius-web\src\nodes\EllipseNodeConverter.tsx).
|
|
16
|
+
*/
|
|
17
|
+
import {
|
|
18
|
+
BorderNodePosition,
|
|
19
|
+
ConnectionHandle,
|
|
20
|
+
GQLDiagram,
|
|
21
|
+
GQLDiagramDescription,
|
|
22
|
+
GQLEdge,
|
|
23
|
+
GQLHandleLayoutData,
|
|
24
|
+
GQLNode,
|
|
25
|
+
GQLNodeDescription,
|
|
26
|
+
GQLNodeLayoutData,
|
|
27
|
+
GQLNodeStyle,
|
|
28
|
+
GQLViewModifier,
|
|
29
|
+
IConvertEngine,
|
|
30
|
+
INodeConverter,
|
|
31
|
+
convertHandles,
|
|
32
|
+
convertInsideLabel,
|
|
33
|
+
convertLineStyle,
|
|
34
|
+
convertOutsideLabels,
|
|
35
|
+
defaultHeight,
|
|
36
|
+
defaultWidth,
|
|
37
|
+
isListLayoutStrategy,
|
|
38
|
+
} from '@eclipse-sirius/sirius-components-diagrams';
|
|
39
|
+
import { Node, XYPosition } from '@xyflow/react';
|
|
40
|
+
import { EllipseNodeData, GQLEllipseNodeStyle } from './EllipseNode.types';
|
|
41
|
+
|
|
42
|
+
const defaultPosition: XYPosition = { x: 0, y: 0 };
|
|
43
|
+
|
|
44
|
+
const toEllipseNode = (
|
|
45
|
+
gqlDiagram: GQLDiagram,
|
|
46
|
+
gqlNode: GQLNode<GQLEllipseNodeStyle>,
|
|
47
|
+
gqlParentNode: GQLNode<GQLNodeStyle> | null,
|
|
48
|
+
nodeDescription: GQLNodeDescription,
|
|
49
|
+
isBorderNode: boolean,
|
|
50
|
+
gqlEdges: GQLEdge[]
|
|
51
|
+
): Node<EllipseNodeData> => {
|
|
52
|
+
const {
|
|
53
|
+
targetObjectId,
|
|
54
|
+
targetObjectLabel,
|
|
55
|
+
targetObjectKind,
|
|
56
|
+
descriptionId,
|
|
57
|
+
id,
|
|
58
|
+
insideLabel,
|
|
59
|
+
outsideLabels,
|
|
60
|
+
state,
|
|
61
|
+
pinned,
|
|
62
|
+
style,
|
|
63
|
+
labelEditable,
|
|
64
|
+
deletable,
|
|
65
|
+
} = gqlNode;
|
|
66
|
+
|
|
67
|
+
const handleLayoutData: GQLHandleLayoutData[] = gqlDiagram.layoutData.nodeLayoutData
|
|
68
|
+
.filter((nodeLayoutData) => nodeLayoutData.id === id)
|
|
69
|
+
.flatMap((nodeLayoutData) => nodeLayoutData.handleLayoutData);
|
|
70
|
+
|
|
71
|
+
const connectionHandles: ConnectionHandle[] = convertHandles(gqlNode.id, gqlEdges, handleLayoutData);
|
|
72
|
+
const gqlNodeLayoutData: GQLNodeLayoutData | undefined = gqlDiagram.layoutData.nodeLayoutData.find(
|
|
73
|
+
(nodeLayoutData) => nodeLayoutData.id === id
|
|
74
|
+
);
|
|
75
|
+
const isNew = gqlNodeLayoutData === undefined;
|
|
76
|
+
const resizedByUser = gqlNodeLayoutData?.resizedByUser ?? false;
|
|
77
|
+
const movedByUser = gqlNodeLayoutData?.movedByUser ?? false;
|
|
78
|
+
|
|
79
|
+
const data: EllipseNodeData = {
|
|
80
|
+
targetObjectId,
|
|
81
|
+
targetObjectLabel,
|
|
82
|
+
targetObjectKind,
|
|
83
|
+
descriptionId,
|
|
84
|
+
style: {
|
|
85
|
+
display: 'flex',
|
|
86
|
+
background: style.background,
|
|
87
|
+
borderColor: style.borderColor,
|
|
88
|
+
borderWidth: style.borderSize,
|
|
89
|
+
borderStyle: convertLineStyle(style.borderStyle),
|
|
90
|
+
},
|
|
91
|
+
insideLabel: null,
|
|
92
|
+
outsideLabels: convertOutsideLabels(outsideLabels, gqlDiagram.layoutData.labelLayoutData),
|
|
93
|
+
faded: state === GQLViewModifier.Faded,
|
|
94
|
+
pinned,
|
|
95
|
+
isBorderNode: isBorderNode,
|
|
96
|
+
nodeDescription,
|
|
97
|
+
defaultWidth: gqlNode.defaultWidth,
|
|
98
|
+
defaultHeight: gqlNode.defaultHeight,
|
|
99
|
+
borderNodePosition: isBorderNode ? BorderNodePosition.EAST : null,
|
|
100
|
+
connectionHandles,
|
|
101
|
+
labelEditable,
|
|
102
|
+
isNew,
|
|
103
|
+
resizedByUser,
|
|
104
|
+
movedByUser,
|
|
105
|
+
isListChild: isListLayoutStrategy(gqlParentNode?.style.childrenLayoutStrategy),
|
|
106
|
+
isDraggedNode: false,
|
|
107
|
+
isDropNodeTarget: false,
|
|
108
|
+
isDropNodeCandidate: false,
|
|
109
|
+
isHovered: false,
|
|
110
|
+
connectionLinePositionOnNode: 'none',
|
|
111
|
+
nodeAppearanceData: {
|
|
112
|
+
gqlStyle: style,
|
|
113
|
+
customizedStyleProperties: [],
|
|
114
|
+
},
|
|
115
|
+
minComputedWidth: gqlNodeLayoutData?.minComputedSize.width ?? null,
|
|
116
|
+
minComputedHeight: gqlNodeLayoutData?.minComputedSize.height ?? null,
|
|
117
|
+
deletable,
|
|
118
|
+
isLastNodeSelected: false,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
data.insideLabel = convertInsideLabel(
|
|
122
|
+
insideLabel,
|
|
123
|
+
data,
|
|
124
|
+
`${style.borderSize}px ${style.borderStyle} ${style.borderColor}`
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const node: Node<EllipseNodeData> = {
|
|
128
|
+
id,
|
|
129
|
+
type: 'ellipseNode',
|
|
130
|
+
data,
|
|
131
|
+
position: defaultPosition,
|
|
132
|
+
hidden: gqlNode.state === GQLViewModifier.Hidden,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
if (gqlParentNode) {
|
|
136
|
+
node.parentId = gqlParentNode.id;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const nodeLayoutData = gqlDiagram.layoutData.nodeLayoutData.filter((data) => data.id === id)[0];
|
|
140
|
+
if (nodeLayoutData) {
|
|
141
|
+
const {
|
|
142
|
+
position,
|
|
143
|
+
size: { height, width },
|
|
144
|
+
} = nodeLayoutData;
|
|
145
|
+
node.position = position;
|
|
146
|
+
node.height = height;
|
|
147
|
+
node.width = width;
|
|
148
|
+
node.style = {
|
|
149
|
+
...node.style,
|
|
150
|
+
width: `${node.width}px`,
|
|
151
|
+
height: `${node.height}px`,
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
node.height = data.defaultHeight ?? defaultHeight;
|
|
155
|
+
node.width = data.defaultWidth ?? defaultWidth;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return node;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export class EllipseNodeConverter implements INodeConverter {
|
|
162
|
+
canHandle(gqlNode: GQLNode<GQLNodeStyle>) {
|
|
163
|
+
return gqlNode.style.__typename === 'EllipseNodeStyle';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
handle(
|
|
167
|
+
convertEngine: IConvertEngine,
|
|
168
|
+
gqlDiagram: GQLDiagram,
|
|
169
|
+
gqlNode: GQLNode<GQLEllipseNodeStyle>,
|
|
170
|
+
gqlEdges: GQLEdge[],
|
|
171
|
+
parentNode: GQLNode<GQLNodeStyle> | null,
|
|
172
|
+
isBorderNode: boolean,
|
|
173
|
+
nodes: Node[],
|
|
174
|
+
diagramDescription: GQLDiagramDescription,
|
|
175
|
+
nodeDescriptions: GQLNodeDescription[]
|
|
176
|
+
) {
|
|
177
|
+
const nodeDescription = nodeDescriptions.find((description) => description.id === gqlNode.descriptionId);
|
|
178
|
+
if (nodeDescription) {
|
|
179
|
+
nodes.push(toEllipseNode(gqlDiagram, gqlNode, parentNode, nodeDescription, isBorderNode, gqlEdges));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const borderNodeDescriptions: GQLNodeDescription[] = (nodeDescription?.borderNodeDescriptionIds ?? []).flatMap(
|
|
183
|
+
(nodeDescriptionId) =>
|
|
184
|
+
diagramDescription.nodeDescriptions.filter((nodeDescription) => nodeDescription.id === nodeDescriptionId)
|
|
185
|
+
);
|
|
186
|
+
const childNodeDescriptions: GQLNodeDescription[] = (nodeDescription?.childNodeDescriptionIds ?? []).flatMap(
|
|
187
|
+
(nodeDescriptionId) =>
|
|
188
|
+
diagramDescription.nodeDescriptions.filter((nodeDescription) => nodeDescription.id === nodeDescriptionId)
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
convertEngine.convertNodes(
|
|
192
|
+
gqlDiagram,
|
|
193
|
+
gqlNode.borderNodes ?? [],
|
|
194
|
+
gqlNode,
|
|
195
|
+
nodes,
|
|
196
|
+
diagramDescription,
|
|
197
|
+
borderNodeDescriptions
|
|
198
|
+
);
|
|
199
|
+
convertEngine.convertNodes(
|
|
200
|
+
gqlDiagram,
|
|
201
|
+
gqlNode.childNodes ?? [],
|
|
202
|
+
gqlNode,
|
|
203
|
+
nodes,
|
|
204
|
+
diagramDescription,
|
|
205
|
+
childNodeDescriptions
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2023, 2025 Obeo.
|
|
3
|
+
* This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v2.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*
|
|
10
|
+
* Contributors:
|
|
11
|
+
* Obeo - initial API and implementation
|
|
12
|
+
*******************************************************************************/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Code duplicated from <a href="https://github.com/eclipse-sirius/sirius-web">Sirius Web</a> (packages\sirius-web\frontend\sirius-web\src\nodes\EllipseNodeLayoutHandler.tsx).
|
|
16
|
+
*/
|
|
17
|
+
import {
|
|
18
|
+
Diagram,
|
|
19
|
+
DiagramNodeType,
|
|
20
|
+
ForcedDimensions,
|
|
21
|
+
ILayoutEngine,
|
|
22
|
+
INodeLayoutHandler,
|
|
23
|
+
NodeData,
|
|
24
|
+
applyRatioOnNewNodeSizeValue,
|
|
25
|
+
computeNodesBox,
|
|
26
|
+
computePreviousPosition,
|
|
27
|
+
computePreviousSize,
|
|
28
|
+
findNodeIndex,
|
|
29
|
+
getBorderNodeExtent,
|
|
30
|
+
getChildNodePosition,
|
|
31
|
+
getDefaultOrMinHeight,
|
|
32
|
+
getDefaultOrMinWidth,
|
|
33
|
+
getEastBorderNodeFootprintHeight,
|
|
34
|
+
getHeaderHeightFootprint,
|
|
35
|
+
getInsideLabelWidthConstraint,
|
|
36
|
+
getNorthBorderNodeFootprintWidth,
|
|
37
|
+
getSouthBorderNodeFootprintWidth,
|
|
38
|
+
getWestBorderNodeFootprintHeight,
|
|
39
|
+
setBorderNodesPosition,
|
|
40
|
+
} from '@eclipse-sirius/sirius-components-diagrams';
|
|
41
|
+
import { Dimensions, Node, Position, XYPosition } from '@xyflow/react';
|
|
42
|
+
import { NodeHandle } from '@xyflow/system';
|
|
43
|
+
|
|
44
|
+
const borderNodeOffset = 5;
|
|
45
|
+
|
|
46
|
+
const findBorderNodePosition = (
|
|
47
|
+
borderNodePosition: XYPosition | undefined,
|
|
48
|
+
parentNode: Node | undefined
|
|
49
|
+
): number | null => {
|
|
50
|
+
if (borderNodePosition && parentNode?.width && parentNode.height) {
|
|
51
|
+
if (borderNodePosition.y < parentNode.height / 2) {
|
|
52
|
+
return borderNodePosition.x < parentNode.width / 2 ? 0 : 1;
|
|
53
|
+
} else {
|
|
54
|
+
return borderNodePosition.x < parentNode.width / 2 ? 2 : 3;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export class EllipseNodeLayoutHandler implements INodeLayoutHandler<NodeData> {
|
|
61
|
+
canHandle(node: Node<NodeData, DiagramNodeType>) {
|
|
62
|
+
return node.type === 'ellipseNode';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
handle(
|
|
66
|
+
layoutEngine: ILayoutEngine,
|
|
67
|
+
previousDiagram: Diagram | null,
|
|
68
|
+
node: Node<NodeData>,
|
|
69
|
+
visibleNodes: Node<NodeData, DiagramNodeType>[],
|
|
70
|
+
directChildren: Node<NodeData, DiagramNodeType>[],
|
|
71
|
+
newlyAddedNodes: Node<NodeData, DiagramNodeType>[],
|
|
72
|
+
forceDimensions?: ForcedDimensions
|
|
73
|
+
) {
|
|
74
|
+
layoutEngine.layoutNodes(previousDiagram, visibleNodes, directChildren, newlyAddedNodes);
|
|
75
|
+
|
|
76
|
+
const nodeIndex = findNodeIndex(visibleNodes, node.id);
|
|
77
|
+
const nodeElement = document.getElementById(`${node.id}-ellipseNode-${nodeIndex}`)?.children[0];
|
|
78
|
+
const borderWidth = nodeElement ? parseFloat(window.getComputedStyle(nodeElement).borderWidth) : 0;
|
|
79
|
+
const labelElement = document.getElementById(`${node.id}-label-${nodeIndex}`);
|
|
80
|
+
|
|
81
|
+
const borderNodes = directChildren.filter((node) => node.data.isBorderNode);
|
|
82
|
+
const directNodesChildren = directChildren.filter((child) => !child.data.isBorderNode);
|
|
83
|
+
|
|
84
|
+
// Update children position to be under the label and at the right padding.
|
|
85
|
+
directNodesChildren.forEach((child, index) => {
|
|
86
|
+
const previousNode = (previousDiagram?.nodes ?? []).find((previouseNode) => previouseNode.id === child.id);
|
|
87
|
+
const previousPosition = computePreviousPosition(previousNode, child);
|
|
88
|
+
const createdNode = newlyAddedNodes.find((node) => node?.id === child.id);
|
|
89
|
+
const headerHeightFootprint = labelElement ? getHeaderHeightFootprint(labelElement, null, null) : 0;
|
|
90
|
+
|
|
91
|
+
if (!!createdNode) {
|
|
92
|
+
child.position = createdNode.position;
|
|
93
|
+
if (child.position.y < borderWidth + headerHeightFootprint) {
|
|
94
|
+
child.position = { ...child.position, y: borderWidth + headerHeightFootprint };
|
|
95
|
+
}
|
|
96
|
+
} else if (previousPosition) {
|
|
97
|
+
child.position = previousPosition;
|
|
98
|
+
if (child.position.y < borderWidth + headerHeightFootprint) {
|
|
99
|
+
child.position = { ...child.position, y: borderWidth + headerHeightFootprint };
|
|
100
|
+
}
|
|
101
|
+
if (child.position.x < borderWidth) {
|
|
102
|
+
child.position = { ...child.position, x: borderWidth };
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
child.position = child.position = getChildNodePosition(visibleNodes, child, headerHeightFootprint, borderWidth);
|
|
106
|
+
const previousSibling = directNodesChildren[index - 1];
|
|
107
|
+
if (previousSibling) {
|
|
108
|
+
child.position = getChildNodePosition(
|
|
109
|
+
visibleNodes,
|
|
110
|
+
child,
|
|
111
|
+
headerHeightFootprint,
|
|
112
|
+
borderWidth,
|
|
113
|
+
previousSibling
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Update node to layout size
|
|
120
|
+
// WARN: We suppose label are always on top of children (that wrong)
|
|
121
|
+
const childrenContentBox = computeNodesBox(visibleNodes, directNodesChildren); // WARN: The current content box algorithm does not take the margin of direct children (it should)
|
|
122
|
+
const directChildrenAwareNodeWidth = childrenContentBox.x + childrenContentBox.width;
|
|
123
|
+
const northBorderNodeFootprintWidth = getNorthBorderNodeFootprintWidth(visibleNodes, borderNodes, previousDiagram);
|
|
124
|
+
const southBorderNodeFootprintWidth = getSouthBorderNodeFootprintWidth(visibleNodes, borderNodes, previousDiagram);
|
|
125
|
+
const labelOnlyWidth = getInsideLabelWidthConstraint(node.data.insideLabel, labelElement);
|
|
126
|
+
|
|
127
|
+
const nodeMinComputeWidth =
|
|
128
|
+
Math.max(
|
|
129
|
+
directChildrenAwareNodeWidth,
|
|
130
|
+
labelOnlyWidth,
|
|
131
|
+
northBorderNodeFootprintWidth,
|
|
132
|
+
southBorderNodeFootprintWidth
|
|
133
|
+
) +
|
|
134
|
+
borderWidth * 2;
|
|
135
|
+
|
|
136
|
+
// WARN: the label is not used for the height because children are already position under the label
|
|
137
|
+
const directChildrenAwareNodeHeight = childrenContentBox.y + childrenContentBox.height;
|
|
138
|
+
const eastBorderNodeFootprintHeight = getEastBorderNodeFootprintHeight(visibleNodes, borderNodes, previousDiagram);
|
|
139
|
+
const westBorderNodeFootprintHeight = getWestBorderNodeFootprintHeight(visibleNodes, borderNodes, previousDiagram);
|
|
140
|
+
|
|
141
|
+
const nodeMinComputeHeight =
|
|
142
|
+
Math.max(directChildrenAwareNodeHeight, eastBorderNodeFootprintHeight, westBorderNodeFootprintHeight) +
|
|
143
|
+
borderWidth * 2;
|
|
144
|
+
|
|
145
|
+
const nodeWith = forceDimensions?.width ?? getDefaultOrMinWidth(nodeMinComputeWidth, node);
|
|
146
|
+
const nodeHeight = getDefaultOrMinHeight(nodeMinComputeHeight, node);
|
|
147
|
+
|
|
148
|
+
const previousNode = (previousDiagram?.nodes ?? []).find((previouseNode) => previouseNode.id === node.id);
|
|
149
|
+
const previousDimensions = computePreviousSize(previousNode, node);
|
|
150
|
+
if (node.data.resizedByUser) {
|
|
151
|
+
if (nodeMinComputeWidth > previousDimensions.width) {
|
|
152
|
+
node.width = nodeMinComputeWidth;
|
|
153
|
+
} else {
|
|
154
|
+
node.width = previousDimensions.width;
|
|
155
|
+
}
|
|
156
|
+
if (nodeMinComputeHeight > previousDimensions.height) {
|
|
157
|
+
node.height = nodeMinComputeHeight;
|
|
158
|
+
} else {
|
|
159
|
+
node.height = previousDimensions.height;
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
node.width = nodeWith;
|
|
163
|
+
node.height = nodeHeight;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (node.data.nodeDescription?.keepAspectRatio) {
|
|
167
|
+
applyRatioOnNewNodeSizeValue(node);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Update border nodes positions
|
|
171
|
+
borderNodes.forEach((borderNode) => {
|
|
172
|
+
borderNode.extent = getBorderNodeExtent(node, borderNode);
|
|
173
|
+
});
|
|
174
|
+
setBorderNodesPosition(borderNodes, node, previousDiagram, this.calculateCustomNodeBorderNodePosition);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
calculateCustomNodeEdgeHandlePosition(
|
|
178
|
+
node: Node<NodeData>,
|
|
179
|
+
handlePosition: Position,
|
|
180
|
+
handle: NodeHandle
|
|
181
|
+
): XYPosition {
|
|
182
|
+
let offsetX = handle?.width ?? 0 / 2;
|
|
183
|
+
let offsetY = handle?.height ?? 0 / 2;
|
|
184
|
+
const nodeWidth: number = node.width ?? 0;
|
|
185
|
+
const nodeHeight: number = node.height ?? 0;
|
|
186
|
+
const a: number = nodeWidth / 2;
|
|
187
|
+
const b: number = nodeHeight / 2;
|
|
188
|
+
|
|
189
|
+
let realY: number = handle.y;
|
|
190
|
+
let realX: number = handle.x;
|
|
191
|
+
switch (handlePosition) {
|
|
192
|
+
case Position.Left:
|
|
193
|
+
realX = Math.sqrt((1 - Math.pow(handle.y + offsetY - b, 2) / Math.pow(b, 2)) * Math.pow(a, 2)) + a;
|
|
194
|
+
realX = nodeWidth - realX;
|
|
195
|
+
break;
|
|
196
|
+
case Position.Right:
|
|
197
|
+
realX = Math.sqrt((1 - Math.pow(handle.y + offsetY - b, 2) / Math.pow(b, 2)) * Math.pow(a, 2)) + a;
|
|
198
|
+
offsetX = -offsetX;
|
|
199
|
+
break;
|
|
200
|
+
case Position.Top:
|
|
201
|
+
realY = Math.sqrt((1 - Math.pow(handle.x + offsetX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
202
|
+
realY = nodeHeight - realY;
|
|
203
|
+
break;
|
|
204
|
+
case Position.Bottom:
|
|
205
|
+
realY = Math.sqrt((1 - Math.pow(handle.x + offsetX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
206
|
+
offsetY = -offsetY;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
x: realX + offsetX,
|
|
212
|
+
y: realY + offsetY,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
calculateCustomNodeBorderNodePosition(
|
|
217
|
+
parentNode: Node<NodeData>,
|
|
218
|
+
borderNode: XYPosition & Dimensions,
|
|
219
|
+
isDragging: boolean
|
|
220
|
+
): XYPosition {
|
|
221
|
+
let offsetX: number = 0;
|
|
222
|
+
let offsetY: number = 0;
|
|
223
|
+
const parentNodeWidth: number = parentNode.width ?? 0;
|
|
224
|
+
const parentNodeHeight: number = parentNode.height ?? 0;
|
|
225
|
+
const a: number = parentNodeWidth / 2;
|
|
226
|
+
const b: number = parentNodeHeight / 2;
|
|
227
|
+
const pos: number | null = findBorderNodePosition(borderNode, parentNode);
|
|
228
|
+
let realY: number = borderNode.y;
|
|
229
|
+
let realX: number;
|
|
230
|
+
if (borderNode.x < 0) {
|
|
231
|
+
return {
|
|
232
|
+
x: -borderNode.width + borderNodeOffset,
|
|
233
|
+
y: b - borderNode.height / 2,
|
|
234
|
+
};
|
|
235
|
+
} else if (borderNode.x >= parentNodeWidth - borderNodeOffset) {
|
|
236
|
+
return {
|
|
237
|
+
x: parentNodeWidth - borderNodeOffset,
|
|
238
|
+
y: b - borderNode.height / 2,
|
|
239
|
+
};
|
|
240
|
+
} else {
|
|
241
|
+
realX = borderNode.x;
|
|
242
|
+
}
|
|
243
|
+
if (!isDragging) {
|
|
244
|
+
switch (pos) {
|
|
245
|
+
case 0:
|
|
246
|
+
case 2:
|
|
247
|
+
realX += borderNode.width;
|
|
248
|
+
break;
|
|
249
|
+
default:
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
switch (pos) {
|
|
254
|
+
case 0:
|
|
255
|
+
realY = Math.sqrt((1 - Math.pow(realX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
256
|
+
realY = parentNodeHeight - realY;
|
|
257
|
+
offsetY = -borderNode.height + borderNodeOffset;
|
|
258
|
+
offsetX = -borderNode.width;
|
|
259
|
+
break;
|
|
260
|
+
case 1:
|
|
261
|
+
realY = Math.sqrt((1 - Math.pow(realX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
262
|
+
realY = parentNodeHeight - realY;
|
|
263
|
+
offsetY = -borderNode.height + borderNodeOffset;
|
|
264
|
+
break;
|
|
265
|
+
case 2:
|
|
266
|
+
realY = Math.sqrt((1 - Math.pow(realX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
267
|
+
offsetY = -borderNodeOffset;
|
|
268
|
+
offsetX = -borderNode.width;
|
|
269
|
+
break;
|
|
270
|
+
case 3:
|
|
271
|
+
realY = Math.sqrt((1 - Math.pow(realX - a, 2) / Math.pow(a, 2)) * Math.pow(b, 2)) + b;
|
|
272
|
+
offsetY = -borderNodeOffset;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
if (isNaN(realY)) {
|
|
276
|
+
realY = b;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return {
|
|
280
|
+
x: realX + offsetX,
|
|
281
|
+
y: realY + offsetY,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|