@yanqirenshi/ihub.core 0.0.0-stage → 0.1.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +275 -3
- package/dist/DataGate.js +124 -0
- package/dist/Github.js +55 -0
- package/dist/IHub.js +77 -0
- package/dist/components/assemblies/Account/Avater.js +58 -0
- package/dist/components/assemblies/Account/Menu/Foot.js +16 -0
- package/dist/components/assemblies/Account/Menu/Head.js +12 -0
- package/dist/components/assemblies/Account/Menu/Item.js +16 -0
- package/dist/components/assemblies/Account/Menu/Tabs.js +31 -0
- package/dist/components/assemblies/Account/Menu.js +60 -0
- package/dist/components/assemblies/Account.js +33 -0
- package/dist/components/assemblies/AddWbsNode.js +141 -0
- package/dist/components/assemblies/GithubOAuth.js +115 -0
- package/dist/components/assemblies/Link.js +21 -0
- package/dist/components/assemblies/TabbedPage.js +36 -0
- package/dist/components/assemblies/TableTMRelationships.js +73 -0
- package/dist/components/assemblies/TabsSearchParam.js +25 -0
- package/dist/components/assemblies/WBSTable.js +64 -0
- package/dist/components/assemblies/frames/Frame.js +128 -0
- package/dist/components/assemblies/frames/FrameTabs.js +34 -0
- package/dist/components/assemblies/frames/FrameWbsNode.js +41 -0
- package/dist/components/assemblies/frames/FrameWbsNodeTabs.js +46 -0
- package/dist/components/assemblies/index.js +12 -0
- package/dist/components/pages/Account.js +19 -0
- package/dist/components/pages/Actions.js +23 -0
- package/dist/components/pages/Api.js +17 -0
- package/dist/components/pages/Assemblies.js +23 -0
- package/dist/components/pages/Auth.js +23 -0
- package/dist/components/pages/Batchs.js +17 -0
- package/dist/components/pages/Business.js +23 -0
- package/dist/components/pages/ClassDiagram.js +23 -0
- package/dist/components/pages/Classes.js +17 -0
- package/dist/components/pages/Cockpit.js +57 -0
- package/dist/components/pages/DDD.js +25 -0
- package/dist/components/pages/Data.js +19 -0
- package/dist/components/pages/Design.js +30 -0
- package/dist/components/pages/DevOps.js +17 -0
- package/dist/components/pages/ExternalResources.js +20 -0
- package/dist/components/pages/Help/Section01.js +42 -0
- package/dist/components/pages/Help/Section02.js +42 -0
- package/dist/components/pages/Help/Section03.js +42 -0
- package/dist/components/pages/Help/Slide.js +28 -0
- package/dist/components/pages/Help.js +52 -0
- package/dist/components/pages/Markets.js +17 -0
- package/dist/components/pages/Messages.js +19 -0
- package/dist/components/pages/Organizations.js +17 -0
- package/dist/components/pages/Parts.js +23 -0
- package/dist/components/pages/Screen.js +23 -0
- package/dist/components/pages/Screens.js +24 -0
- package/dist/components/pages/Scrum.js +19 -0
- package/dist/components/pages/ScrumProject.js +53 -0
- package/dist/components/pages/ScrumProjectItem/Tabs.js +26 -0
- package/dist/components/pages/ScrumProjectItem.js +92 -0
- package/dist/components/pages/SystemDynamics.js +23 -0
- package/dist/components/pages/SystemEnvironment.js +19 -0
- package/dist/components/pages/SystemicDesign.js +86 -0
- package/dist/components/pages/SystemicDesignContents.js +40 -0
- package/dist/components/pages/Wbs.js +26 -0
- package/dist/components/pages/WbsNode.js +46 -0
- package/dist/components/pages/docs/BPMN.js +21 -0
- package/dist/components/pages/docs/Classes.js +23 -0
- package/dist/components/pages/docs/CustomerJourneyMap.js +26 -0
- package/dist/components/pages/docs/ER.js +18 -0
- package/dist/components/pages/docs/PAD.js +18 -0
- package/dist/components/pages/docs/Procedures.js +23 -0
- package/dist/components/pages/docs/ScreenTransitionDiagram.js +17 -0
- package/dist/components/pages/docs/TM.js +18 -0
- package/dist/components/pages/docs/UML.js +18 -0
- package/dist/components/pages/docs/UseCase.js +23 -0
- package/dist/components/pages/docs/UserScenario.js +23 -0
- package/dist/components/pages/docs/index.js +11 -0
- package/dist/components/pages/index.js +30 -0
- package/dist/components/panels/ER.js +187 -0
- package/dist/components/panels/HelpEmpty.js +18 -0
- package/dist/components/panels/Loading.js +21 -0
- package/dist/components/panels/Procedures.js +7 -0
- package/dist/components/panels/SystemDynamics.js +7 -0
- package/dist/components/panels/TM.js +196 -0
- package/dist/components/panels/Wbs.js +25 -0
- package/dist/components/panels/account/Menus.js +52 -0
- package/dist/components/panels/account/Models.js +14 -0
- package/dist/components/panels/account/Operators.js +52 -0
- package/dist/components/panels/account/Pages.js +68 -0
- package/dist/components/panels/bpmn/DATA.js +131 -0
- package/dist/components/panels/bpmn/Methods.js +26 -0
- package/dist/components/panels/bpmn/Overview.js +66 -0
- package/dist/components/panels/bpmn/Palettes/Level1.js +186 -0
- package/dist/components/panels/bpmn/Palettes/Level2.js +22 -0
- package/dist/components/panels/bpmn/Palettes/Level2Table.js +399 -0
- package/dist/components/panels/bpmn/Palettes.js +22 -0
- package/dist/components/panels/bpmn/Styles.js +26 -0
- package/dist/components/panels/cockpit/components/Card.js +29 -0
- package/dist/components/panels/cockpit/components/Cockpit.js +34 -0
- package/dist/components/panels/cockpit/components/Overview.js +218 -0
- package/dist/components/panels/cockpit/components/cards/GithubIssue.js +46 -0
- package/dist/components/panels/cockpit/index.js +3 -0
- package/dist/components/panels/ddd/DeclarativeDesign.js +14 -0
- package/dist/components/panels/ddd/HandsOnModeler.js +14 -0
- package/dist/components/panels/ddd/LayerArchitecture.js +93 -0
- package/dist/components/panels/ddd/ModelDrivenDesign.js +14 -0
- package/dist/components/panels/ddd/Overview.js +191 -0
- package/dist/components/panels/ddd/UbiquitousLanguage.js +14 -0
- package/dist/components/panels/design/Assemblies.js +19 -0
- package/dist/components/panels/design/Events.js +19 -0
- package/dist/components/panels/design/Panels.js +24 -0
- package/dist/components/panels/design/Parts.js +19 -0
- package/dist/components/panels/index.js +10 -0
- package/dist/components/panels/messages/Model.js +15 -0
- package/dist/components/panels/scd/SystemConfigurationDiagram.js +177 -0
- package/dist/components/panels/sogh/Account.js +22 -0
- package/dist/components/panels/sogh/Help.js +7 -0
- package/dist/components/panels/sogh/Projects.js +40 -0
- package/dist/components/panels/sogh/Repositories.js +44 -0
- package/dist/components/panels/sogh/index.js +4 -0
- package/dist/components/panels/std/ScreenTransitionDiagram.js +181 -0
- package/dist/components/panels/systemic_design/ActantsMap.js +7 -0
- package/dist/components/panels/systemic_design/ActorsMap.js +7 -0
- package/dist/components/panels/systemic_design/AdaptiveCycleStrategy.js +7 -0
- package/dist/components/panels/systemic_design/ChangeReadiness.js +7 -0
- package/dist/components/panels/systemic_design/CollaborationModel.js +7 -0
- package/dist/components/panels/systemic_design/Connector.js +7 -0
- package/dist/components/panels/systemic_design/ContextualInterview.js +7 -0
- package/dist/components/panels/systemic_design/ContextualVariations.js +7 -0
- package/dist/components/panels/systemic_design/EcosystemGovernance.js +7 -0
- package/dist/components/panels/systemic_design/FutureStateScenarios.js +7 -0
- package/dist/components/panels/systemic_design/InfluenceMap.js +7 -0
- package/dist/components/panels/systemic_design/InterventionStrategy.js +7 -0
- package/dist/components/panels/systemic_design/IterativeInquiry.js +7 -0
- package/dist/components/panels/systemic_design/MulticapitalsSystemsMap.js +7 -0
- package/dist/components/panels/systemic_design/NicheDiscovery.js +7 -0
- package/dist/components/panels/systemic_design/ProcessEnneagram.js +7 -0
- package/dist/components/panels/systemic_design/ResearchQuestions.js +7 -0
- package/dist/components/panels/systemic_design/RichContext.js +7 -0
- package/dist/components/panels/systemic_design/RoadmapForTransitionByDesign.js +7 -0
- package/dist/components/panels/systemic_design/SocialEcosystem.js +7 -0
- package/dist/components/panels/systemic_design/StakeholderDimensions.js +7 -0
- package/dist/components/panels/systemic_design/StakeholderMobilisation.js +7 -0
- package/dist/components/panels/systemic_design/StoryLoopDiagram.js +7 -0
- package/dist/components/panels/systemic_design/SystemsMap.js +7 -0
- package/dist/components/panels/systemic_design/TheoryOfSystemsChangeAndAction.js +7 -0
- package/dist/components/panels/systemic_design/ThreeHorizons.js +7 -0
- package/dist/components/panels/systemic_design/ValueProposition.js +7 -0
- package/dist/components/panels/systemic_design/index.js +27 -0
- package/dist/components/parts/ErrorBoundary.js +29 -0
- package/dist/components/parts/HeadWbsPage.js +22 -0
- package/dist/components/parts/ItemWbsNode.js +23 -0
- package/dist/components/parts/LinkInSite.js +16 -0
- package/dist/components/parts/LinkOutSite.js +18 -0
- package/dist/components/parts/LinkWBS.js +16 -0
- package/dist/components/parts/Tabs.js +32 -0
- package/dist/components/parts/index.js +7 -0
- package/dist/config.js +121 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/usePageTabs.js +325 -0
- package/dist/index.css +84 -0
- package/dist/index.js +29 -0
- package/dist/manegers/colors.js +110 -0
- package/dist/manegers/deployment.js +11 -0
- package/dist/manegers/diagram.js +46 -0
- package/dist/manegers/er.js +10 -0
- package/dist/manegers/index.js +4 -0
- package/dist/manegers/overview.js +11 -0
- package/dist/manegers/sitemap.js +11 -0
- package/dist/manegers/sogh.js +3 -0
- package/dist/manegers/tm.js +13 -0
- package/dist/manegers/wbs.js +214 -0
- package/dist/redux/api/dataApi.js +114 -0
- package/dist/redux/hooks.js +3 -0
- package/dist/redux/slices/accountMenuSlice.js +51 -0
- package/dist/redux/slices/cockpitSlice.js +27 -0
- package/dist/redux/slices/githubAuthSlice.js +43 -0
- package/dist/redux/slices/operatorsSlice.js +42 -0
- package/dist/redux/slices/scrumProjectItemSlice.js +63 -0
- package/dist/redux/slices/scrumProjectSlice.js +72 -0
- package/dist/redux/slices/scrumSlice.js +45 -0
- package/dist/redux/slices/windowSlice.js +17 -0
- package/dist/redux/store.js +39 -0
- package/examples/app/env.local.template +1 -0
- package/examples/app/gitignore +15 -0
- package/examples/app/package.template.json +54 -0
- package/examples/app/public/bpmn/business-rule-task.svg +1 -0
- package/examples/app/public/bpmn/call-activity.svg +1 -0
- package/examples/app/public/bpmn/end-event-message.svg +1 -0
- package/examples/app/public/bpmn/end-event-multiple.svg +1 -0
- package/examples/app/public/bpmn/end-event-none.svg +1 -0
- package/examples/app/public/bpmn/end-event-terminate.svg +1 -0
- package/examples/app/public/bpmn/level2/event-end-none.svg +1 -0
- package/examples/app/public/bpmn/level2/event-intermediate-none.svg +1 -0
- package/examples/app/public/bpmn/level2/event-start-none.svg +1 -0
- package/examples/app/public/bpmn/manual-task.svg +1 -0
- package/examples/app/public/bpmn/receive-task.svg +1 -0
- package/examples/app/public/bpmn/script-task.svg +1 -0
- package/examples/app/public/bpmn/send-task.svg +1 -0
- package/examples/app/public/bpmn/service-task.svg +1 -0
- package/examples/app/public/bpmn/start-event-message.svg +1 -0
- package/examples/app/public/bpmn/start-event-multiple.svg +1 -0
- package/examples/app/public/bpmn/start-event-none.svg +1 -0
- package/examples/app/public/bpmn/start-event-timer.svg +1 -0
- package/examples/app/public/bpmn/subprocess-collapsed.svg +1 -0
- package/examples/app/public/bpmn/subprocess-expanded.svg +1 -0
- package/examples/app/public/bpmn/task.svg +1 -0
- package/examples/app/public/bpmn/user-task.svg +1 -0
- package/examples/app/public/ddd/overview_from_book_01.png +0 -0
- package/examples/app/public/ddd/overview_from_book_02.png +0 -0
- package/examples/app/public/favicon.ico +0 -0
- package/examples/app/public/imgs/tm/2024-01-27_130647.png +0 -0
- package/examples/app/public/imgs/tm/2024-01-27_130706.png +0 -0
- package/examples/app/public/imgs/tm/2024-01-27_130724.png +0 -0
- package/examples/app/public/imgs/tm/2024-01-27_130740.png +0 -0
- package/examples/app/public/index.html +40 -0
- package/examples/app/public/logo192.png +0 -0
- package/examples/app/public/logo512.png +0 -0
- package/examples/app/public/manifest.json +25 -0
- package/examples/app/public/robots.txt +3 -0
- package/examples/app/public/std/contents.png +0 -0
- package/examples/app/public/std/dialog.png +0 -0
- package/examples/app/public/std/dialog_message.png +0 -0
- package/examples/app/public/std/dialog_modal.png +0 -0
- package/examples/app/public/std/frame_base.png +0 -0
- package/examples/app/public/std/halfmodal.png +0 -0
- package/examples/app/public/std/menu.png +0 -0
- package/examples/app/public/std/sidemenu.png +0 -0
- package/examples/app/public/std/transparent/contents_transparent.png +0 -0
- package/examples/app/public/std/transparent/dialog_message_transparent.png +0 -0
- package/examples/app/public/std/transparent/dialog_modal_transparent.png +0 -0
- package/examples/app/public/std/transparent/dialog_transparent.png +0 -0
- package/examples/app/public/std/transparent/frame_base_transparent.png +0 -0
- package/examples/app/public/std/transparent/menu_transparent.png +0 -0
- package/examples/app/public/systemic_design/ACTANTS-MAP-1@05_Listening-to-the-System.svg +196 -0
- package/examples/app/public/systemic_design/ACTANTS-MAP-2@06_Listening-to-the-System.svg +711 -0
- package/examples/app/public/systemic_design/ACTORS/343/203/274MAP@01_Framing_the_System.svg +1087 -0
- package/examples/app/public/systemic_design/ADAPTIVE-CYCLE-STRATEGY@38_Fostering-the-Transition.svg +524 -0
- package/examples/app/public/systemic_design/CHANGE-READINESS@34_Planning-the-Change-Process.svg +263 -0
- package/examples/app/public/systemic_design/COLLABORATION-MODEL@39_Planning-the-Change-Process.svg +268 -0
- package/examples/app/public/systemic_design/CONNECTOR@31_Designing-the-intervention-model.svg +204 -0
- package/examples/app/public/systemic_design/CONTEXTUAL-INTERVIEW@07_Listening-to-the-system.svg +644 -0
- package/examples/app/public/systemic_design/CONTEXTUAL-VARIATIONS@28_Exploring-the-Possibility-Space.svg +252 -0
- package/examples/app/public/systemic_design/ECOSYSTEM-GOVERNANCE@35_Planning-the-Change-Process.svg +219 -0
- package/examples/app/public/systemic_design/FUTURE-STATE-SCENARIOS-1@29_Exploring-the-Possibility-Space.svg +344 -0
- package/examples/app/public/systemic_design/FUTURE-STATE-SCENARIOS-2@30_Exploring-the-Possibility-Space.svg +284 -0
- package/examples/app/public/systemic_design/INFLUENCE-MAP@25_Understanding-the-System.svg +710 -0
- package/examples/app/public/systemic_design/INTERVENTION-STRATEGY-1@32_Exploring-the-Possibility-Space.svg +1506 -0
- package/examples/app/public/systemic_design/INTERVENTION-STRATEGY-2@33_Exploring-the-Possibility-Space.svg +366 -0
- package/examples/app/public/systemic_design/ITERATIVE-INQUIRY@02_Framing-the-System.svg +757 -0
- package/examples/app/public/systemic_design/MULTICAPITALS-SYSTEMS-MAP@23_Understanding-the-System.svg +1239 -0
- package/examples/app/public/systemic_design/NICHE-DISCOVERY@03_Framing-the-System.svg +1021 -0
- package/examples/app/public/systemic_design/PROCESS-ENNEAGRAM@36_Planning-the-Change-Process.svg +244 -0
- package/examples/app/public/systemic_design/RESEARCH-QUESTIONS@08_Listening-to-the-System.svg +1299 -0
- package/examples/app/public/systemic_design/RICH-CONTEXT@04_Framing-the-System.svg +1810 -0
- package/examples/app/public/systemic_design/ROADMAP-FOR-TRANSITION-BY-DESIGN@41_Fostering-the-Transition.svg +576 -0
- package/examples/app/public/systemic_design/SOCIAL-ECOSYSTEM-1@20_Understanding-the-System.svg +1089 -0
- package/examples/app/public/systemic_design/SOCIAL-ECOSYSTEM-2@21_Understanding-the-System.svg +486 -0
- package/examples/app/public/systemic_design/STAKEHOLDER-DIMENSIONS@09_Listening-to-the-System.svg +1514 -0
- package/examples/app/public/systemic_design/STAKEHOLDER-MOBILISATION@40_Fostering-the-Transition.svg +240 -0
- package/examples/app/public/systemic_design/STORY-LOOP-DIAGRAM@22_Understanding-the-System.svg +214 -0
- package/examples/app/public/systemic_design/SYSTEMS-MAP@24_Understanding-the-System.svg +264 -0
- package/examples/app/public/systemic_design/THEORY-OF-SYSTEMS-CHANGE-AND-ACTION@37_Planning-the-Change-Process.svg +269 -0
- package/examples/app/public/systemic_design/THREE-HORIZONS@26_Envisioning-Desired-Futures.svg +328 -0
- package/examples/app/public/systemic_design/VALUE-PROPOSITION@27_Envisioning-Desired-Futures.svg +392 -0
- package/examples/app/public/systemic_design/outcome_map.png +0 -0
- package/examples/app/public/systemic_design/paradox_card.png +0 -0
- package/examples/app/public/systemic_design/synthesis_map.png +0 -0
- package/examples/app/src/Router.js +89 -0
- package/examples/app/src/config/ACCOUNT_MENUS.js +155 -0
- package/examples/app/src/config/ACCOUNT_MENU_COLORS.js +22 -0
- package/examples/app/src/config/COLORS.js +28 -0
- package/examples/app/src/config/ICONS.js +50 -0
- package/examples/app/src/config/OPERATOR_ITEMS.js +46 -0
- package/examples/app/src/config/README.md +6 -0
- package/examples/app/src/index.css +4 -0
- package/examples/app/src/index.js +68 -0
- package/examples/app/src/js/reportWebVitals.js +13 -0
- package/examples/app/src/js/serviceWorkerRegistration.js +137 -0
- package/examples/app/src/operators/AccountMenuSettings.js +145 -0
- package/examples/app/src/operators/Operators.js +20 -0
- package/examples/app/src/operators/Other.js +24 -0
- package/examples/app/src/operators/ProjectItemForm.js +283 -0
- package/examples/app/src/operators/dockColor.js +8 -0
- package/examples/app/src/operators/labels.js +66 -0
- package/examples/app/src/setupProxy.js +12 -0
- package/examples/app/src/wbs/NotFoundWbsNodeComponent.js +20 -0
- package/examples/app/src/wbs/NotFoundWbsNodeData.js +18 -0
- package/examples/data/README.md +7 -0
- package/examples/data/deployment/edges.json +25 -0
- package/examples/data/deployment/nodes.json +103 -0
- package/examples/data/er/attributes.json +34 -0
- package/examples/data/er/entities.json +72 -0
- package/examples/data/er/identifiers.json +18 -0
- package/examples/data/er/relationships.json +28 -0
- package/examples/data/er/schemas.json +1 -0
- package/examples/data/overview/edges.json +13 -0
- package/examples/data/overview/nodes.json +75 -0
- package/examples/data/sitemap/edges.json +17 -0
- package/examples/data/sitemap/nodes.json +1058 -0
- package/examples/data/systemic_design/sections.json +306 -0
- package/examples/data/tm/attributes.json +18 -0
- package/examples/data/tm/entities.json +86 -0
- package/examples/data/tm/identifiers.json +12 -0
- package/examples/data/tm/relationships.json +28 -0
- package/examples/data/wbs/projects.json +6 -0
- package/examples/data/wbs/wbs.json +68 -0
- package/examples/data/wbs/workpackages.json +1 -0
- package/examples/wbs/NotFoundWbsNode.js +18 -0
- package/examples/wbs/P1025.js +239 -0
- package/examples/wbs/P1029.js +22 -0
- package/examples/wbs/P1030.js +43 -0
- package/examples/wbs/P1031/TableOverview.js +119 -0
- package/examples/wbs/P1031.js +22 -0
- package/examples/wbs/P1032.js +22 -0
- package/examples/wbs/P1033/Attribute.js +9 -0
- package/examples/wbs/P1033/Description.js +22 -0
- package/examples/wbs/P1033/Entity.js +11 -0
- package/examples/wbs/P1033/Identifier.js +9 -0
- package/examples/wbs/P1033/Relationship.js +29 -0
- package/examples/wbs/P1033.js +41 -0
- package/examples/wbs/screen/P1000031.js +18 -0
- package/examples/wbs/screen/P1000032.js +18 -0
- package/examples/wbs/screen/P1000033.js +18 -0
- package/examples/wbs/screen/P1000034.js +18 -0
- package/examples/wbs/screen/P1000035.js +18 -0
- package/examples/wbs/screen/P1000036.js +26 -0
- package/examples/wbs/screen/P1000037.js +18 -0
- package/examples/wbs/screen/P1000038.js +18 -0
- package/examples/wbs/screen/P1000039.js +18 -0
- package/examples/wbs/screen/P1000040.js +18 -0
- package/examples/wbs/screen/P1000041.js +18 -0
- package/examples/wbs/screen/P1000042.js +18 -0
- package/examples/wbs/screen/P1000043.js +18 -0
- package/examples/wbs/screen/P1000044.js +18 -0
- package/examples/wbs/screen/P1000045.js +18 -0
- package/examples/wbs/screen/P1000046.js +18 -0
- package/examples/wbs/screen/P1000047.js +18 -0
- package/examples/wbs/screen/P1000048.js +18 -0
- package/examples/wbs/screen/P1000049.js +18 -0
- package/examples/wbs/screen/P1000050.js +18 -0
- package/examples/wbs/screen/P1000051.js +18 -0
- package/examples/wbs/screen/P1000052.js +18 -0
- package/examples/wbs/screen/P1000053.js +18 -0
- package/examples/wbs/screen/P1000054.js +18 -0
- package/examples/wbs/screen/P1000055.js +18 -0
- package/examples/wbs/screen/P1000056.js +18 -0
- package/examples/wbs/screen/P1000057.js +18 -0
- package/examples/wbs/screen/P1000058.js +18 -0
- package/examples/wbs/screen/P1000059.js +18 -0
- package/examples/wbs/screen/P1000060.js +18 -0
- package/examples/wbs/screen/P1000061.js +18 -0
- package/examples/wbs/screen/P1000062.js +18 -0
- package/package.json +89 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# 更新履歴 (@yanqirenshi/ihub.core)
|
|
2
|
+
|
|
3
|
+
`@yanqirenshi/ihub.srv` と同じ版にそろえて出します。
|
|
4
|
+
版は [semver](https://semver.org/lang/ja/) で付けます。0.x の間は、設定の形・公開する部品・データのフォーマットを変えるときに、minor を上げます。
|
|
5
|
+
(リポジトリ全体の更新履歴は、[ルートの CHANGELOG.md](https://github.com/yanqirenshi/iHub/blob/main/CHANGELOG.md) にあります)
|
|
6
|
+
|
|
7
|
+
## 0.1.0 (2026-11)
|
|
8
|
+
|
|
9
|
+
iHub のコア (`src/ihub/`) を、npm のパッケージにした、最初の版です。
|
|
10
|
+
iHub をフォルダごとコピーして使っていたアプリは、[コピー版からの移行](https://github.com/yanqirenshi/iHub/blob/main/docs/src/content/migrate.md) を見てください。
|
|
11
|
+
|
|
12
|
+
### 切り出し
|
|
13
|
+
|
|
14
|
+
- `src/ihub/` を、パッケージにした。Babel で変換した ESM を `dist/` に入れて配布する。(`type: module` は付けていない。CRA の webpack で、CommonJS のパッケージの既定の import が壊れるため)
|
|
15
|
+
- 公開する名前: `IHub`・`createStore`・`ConfigProvider`・`useConfig`・`resolveConfig`・`pages`・`docPages`・`panels`・`Frame` などの中間の部品・`ItemWbsNode` などの小さな部品・`usePageTabs`・`manegers`・`wbs`・`useWbs`・`sogh`・`dataApi` のフック・`fetchRepositories`・`fetchProjectsV2`。
|
|
16
|
+
- 雛形を入れた。(`examples/data`・`examples/wbs`・`examples/app`。`ihub-srv init` / `init --app` がコピーする)
|
|
17
|
+
|
|
18
|
+
### 設定の形
|
|
19
|
+
|
|
20
|
+
- アプリは、設定 (`config`) を組み立てて、`<IHub config={config}>` に渡す。コアは、アプリのファイルを import しない。
|
|
21
|
+
- 設定の項目: `app`・`menus` (必須)・`menuColors`・`colors`・`operators` (必須)・`wbs` (必須)・`tabs`・`panels`・`help`・`github`。
|
|
22
|
+
- 書き込んだ画面の id を送るヘッダー名は、`app.name` から作る。(`X-{app.name}-Client`)
|
|
23
|
+
- bulma と `index.css` は、`<IHub>` が読む。アプリの `index.css` は、`<IHub>` の import より後に読む。
|
|
24
|
+
|
|
25
|
+
### 拡張点
|
|
26
|
+
|
|
27
|
+
- ページのタブとパネルを、設定の `tabs`・`panels` で、足す・差し替える・消せる。`TabbedPage` を公開した。
|
|
28
|
+
- Help の内容を、設定の `help.sections` で差し替えられる。
|
|
29
|
+
|
|
30
|
+
### ER 図
|
|
31
|
+
|
|
32
|
+
- ER のテーブルの色 (`color: { base, inner }`) に対応した。(`@yanqirenshi/model.er` 0.2.0・`@yanqirenshi/d3.er` 0.6.0)
|
|
33
|
+
`er/entities.json` に書くと、その色で描かれる。インスペクタ (テーブルの見出しを右クリック) の「背景色 (外枠)」「背景色 (内側)」で書き換えられる。書いていないときは、既定の色。
|
|
34
|
+
|
|
35
|
+
### GitHub の OAuth
|
|
36
|
+
|
|
37
|
+
- OAuth のトークン (API サーバーが持つ) を先に使い、無ければ個人用アクセストークン (`github.token`) を使う。
|
|
38
|
+
- `GithubOAuth` (認証・切断のボタンと状態) を、Scrum のページの Account タブに出す。公開もしている。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Satoshi Iwasaki (yanqirenshi@gmail.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,275 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @yanqirenshi/ihub.core
|
|
2
|
+
|
|
3
|
+
iHub のコア (画面の部品) です。
|
|
4
|
+
アプリの設計データ (ER 図・TM・画面遷移図・システム構成図・Systemic Design・WBS など) を、図や表で見て、編集する画面を作ります。
|
|
5
|
+
データは、API サーバー ([@yanqirenshi/ihub.srv](../ihub.srv/README.md)) から読み書きします。
|
|
6
|
+
|
|
7
|
+
親の issue: [#65](https://github.com/yanqirenshi/iHub/issues/65)
|
|
8
|
+
|
|
9
|
+
## 入れる
|
|
10
|
+
|
|
11
|
+
新しいアプリは、雛形から作ります。(マニュアルの「導入のしかた」)
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npx --yes --legacy-peer-deps --package=@yanqirenshi/ihub.core --package=@yanqirenshi/ihub.srv -- ihub-srv init --app
|
|
15
|
+
npm install
|
|
16
|
+
npx ihub-srv init
|
|
17
|
+
npm start
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`ihub-srv init --app` が、`package.json` (下の `overrides` も入ります)・`src/index.js` などのアプリのファイルを作ります。
|
|
21
|
+
すでにあるアプリに入れるときは、次のとおりです。
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
npm install @yanqirenshi/ihub.core @yanqirenshi/ihub.srv
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
iHub をコピーして使っていたアプリは、マニュアルの「コピー版からの移行」を見てください。
|
|
28
|
+
|
|
29
|
+
次のパッケージは、アプリのものと 1 つにするため、アプリで入れます。(peerDependencies)
|
|
30
|
+
|
|
31
|
+
`react`・`react-dom`・`react-redux`・`@reduxjs/toolkit`・`react-router`・`react-router-dom`・`@mui/material`・`@mui/icons-material`・`@emotion/react`・`@emotion/styled`
|
|
32
|
+
|
|
33
|
+
`tion` (iHub が使うパッケージ) は、`react-router-dom` の 6 を求めているため、`react-router-dom` の 7 を使うときは、アプリの `package.json` に次の `overrides` が要ります。
|
|
34
|
+
(無いと、`npm install` が `ERESOLVE` で失敗します)
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"overrides": {
|
|
39
|
+
"tion": {
|
|
40
|
+
"react-router-dom": "$react-router-dom"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 使う
|
|
47
|
+
|
|
48
|
+
アプリの `src/index.js` で、設定 (`config`) を組み立てて、`<IHub>` に渡します。
|
|
49
|
+
参照アプリ (このリポジトリのルートの `src/index.js`) が、そのまま見本です。
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
import { IHub, pages } from '@yanqirenshi/ihub.core';
|
|
53
|
+
import React from 'react';
|
|
54
|
+
import ReactDOM from 'react-dom/client';
|
|
55
|
+
import { Routes, Route } from 'react-router-dom';
|
|
56
|
+
|
|
57
|
+
import { PAGES, makePages } from './config/ACCOUNT_MENUS.js';
|
|
58
|
+
import OPERATOR_ITEMS from './config/OPERATOR_ITEMS.js';
|
|
59
|
+
import Operators from './operators/Operators.js';
|
|
60
|
+
import { withIcons, withoutIcons } from './operators/labels.js';
|
|
61
|
+
import NotFoundWbsNodeData from './wbs/NotFoundWbsNodeData.js';
|
|
62
|
+
import NotFoundWbsNodeComponent from './wbs/NotFoundWbsNodeComponent.js';
|
|
63
|
+
import './index.css';
|
|
64
|
+
|
|
65
|
+
// 設定は、モジュールの中で 1 つだけ作ります。(作り直すと、ストアも作り直されます)
|
|
66
|
+
const config = {
|
|
67
|
+
app: { name: 'my-app' },
|
|
68
|
+
menus: { pages: PAGES, makePages },
|
|
69
|
+
operators: { items: OPERATOR_ITEMS, Leafs: Operators, labels: { withIcons, withoutIcons } },
|
|
70
|
+
wbs: {
|
|
71
|
+
page: (path)=> import(`./wbs/${path}.js`),
|
|
72
|
+
NotFoundData: NotFoundWbsNodeData,
|
|
73
|
+
NotFoundComponent: NotFoundWbsNodeComponent,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
78
|
+
<React.StrictMode>
|
|
79
|
+
<IHub config={config}>
|
|
80
|
+
<Routes>
|
|
81
|
+
<Route path='/' element={<pages.Cockpit/>} />
|
|
82
|
+
<Route path='/data' element={<pages.Data/>} />
|
|
83
|
+
<Route path='/wbs/:wbs_id' element={<pages.WbsNode/>} />
|
|
84
|
+
</Routes>
|
|
85
|
+
</IHub>
|
|
86
|
+
</React.StrictMode>
|
|
87
|
+
);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 設定 (config)
|
|
91
|
+
|
|
92
|
+
| 項目 | 内容 | 既定 |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `app.name` | 画面の名前。書き込んだ画面の id を API サーバーへ送るヘッダー名 (`X-{name}-Client`) に使う。API サーバー (`ihub-srv --app-name`・`createApp` の `app_name`) と同じ名前にする | `iHub` |
|
|
95
|
+
| `menus` | サイドメニュー。`pages` は既定のページ、`makePages` は個人の設定 (on/off) を反映したページを作る関数 | (必須) |
|
|
96
|
+
| `menuColors` | サイドメニューの色 (`background`・`text`・`avatar`) | `{}` |
|
|
97
|
+
| `colors` | 配色 (`base`・`main`・`sub`・`accent`)。CSS の色 (`'#rrggbb'`) | `{}` |
|
|
98
|
+
| `operators` | ドック。`items` はボタンの一覧、`Leafs` は吹き出しの中身、`labels` は `{ withIcons, withoutIcons }` | (必須) |
|
|
99
|
+
| `wbs` | WBS のノードのページ。`page` はページを読み込む関数、`NotFoundData`・`NotFoundComponent` はページが無いときの表示 | (必須) |
|
|
100
|
+
| `tabs` | ページのタブ。`{ ページの id: { selected, list } }`。既定のタブに重ねる ([ページのタブとパネルを足す](#ページのタブとパネルを足す)) | `{}` |
|
|
101
|
+
| `panels` | タブの code → パネルの部品。`{ ページの id: { code: 部品 } }`。既定に重ねる | `{}` |
|
|
102
|
+
| `help` | Help の内容 (`sections`。部品の配列) | iHub の 3 つ |
|
|
103
|
+
| `github` | GitHub の個人用アクセストークン (`token`) | 無し |
|
|
104
|
+
|
|
105
|
+
- 動的 `import()` (`wbs.page`) は、ページのあるアプリ側に書きます。(webpack がアプリのフォルダを束ねるため)
|
|
106
|
+
- 必須の項目が無いときは、起動したときに、どの項目が無いかを示すエラーになります。
|
|
107
|
+
- 詳しくは、`src/config.js` のコメントを見てください。
|
|
108
|
+
|
|
109
|
+
## ページのタブとパネルを足す
|
|
110
|
+
|
|
111
|
+
タブのあるページ (`pages.Data`・`pages.Batchs`・`pages.Business` など) は、タブの一覧と、タブごとのパネルの表で描いています。
|
|
112
|
+
アプリは、コアの中を触らずに、`config.tabs` でタブを、`config.panels` でパネルを重ねられます。
|
|
113
|
+
(ページの id は、`hooks/usePageTabs.js` の `TAB_DEFS` の名前です。`PAGE_DATA`・`PAGE_BATCHS`・`PAGE_BUSINESS`・`PAGE_DESIGN` など)
|
|
114
|
+
|
|
115
|
+
例: Data のページに、DFD のタブを足します。(UkiyoSnow/hub が、`usePageTabs.js` と `pages/Data.js` を書き換えて足していたものです)
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
import Dfd from './components/panels/Dfd.js';
|
|
119
|
+
|
|
120
|
+
const config = {
|
|
121
|
+
// (省略)
|
|
122
|
+
tabs: { PAGE_DATA: { list: [{ code: 'dfd', label: 'DFD' }] } }, // タブを足す
|
|
123
|
+
panels: { PAGE_DATA: { dfd: Dfd } }, // そのタブに出すパネル
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- パネルは、`({ tab })` を受け取る関数の部品です。`tab` は、選んでいるタブ (`{ code, label }`) です。
|
|
128
|
+
- パネルの部品は、モジュールの中で 1 つだけ作ります。(描画のたびに作り直すと、タブを切り替えるたびに作り直されます)
|
|
129
|
+
- 選んだタブは、URL の `?tab=` で決まります。(例: `/data?tab=dfd`)
|
|
130
|
+
|
|
131
|
+
`tabs[ページの id]` の重ね方:
|
|
132
|
+
|
|
133
|
+
| 項目 | 内容 |
|
|
134
|
+
|---|---|
|
|
135
|
+
| `selected` | 初めに開くタブの code。既定を上書きします |
|
|
136
|
+
| `list` | タブの一覧。`code` が同じものは差し替え、無いものは末尾に足します |
|
|
137
|
+
| `{ code, hidden: true }` | そのタブを消します。(消したタブが初めに開くタブのときは、先頭のタブになります) |
|
|
138
|
+
|
|
139
|
+
```jsx
|
|
140
|
+
tabs: {
|
|
141
|
+
PAGE_DATA: {
|
|
142
|
+
selected: 'dfd', // 初めに DFD を開く
|
|
143
|
+
list: [
|
|
144
|
+
{ code: 'dfd', label: 'DFD' }, // 足す
|
|
145
|
+
{ code: 'wbs', label: '作業' }, // 名前を変える (差し替え)
|
|
146
|
+
{ code: 'help', hidden: true }, // Help のタブを消す
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`panels[ページの id][code]` は、既定のパネルを上書きします。
|
|
153
|
+
(既定のタブのパネルも、同じ code で差し替えられます。例: `panels: { PAGE_DATA: { 'er-diagram': MyEr } }`)
|
|
154
|
+
設定を渡さないときは、いままでどおりのタブとパネルです。
|
|
155
|
+
|
|
156
|
+
アプリのページも、同じ形で作れます。
|
|
157
|
+
|
|
158
|
+
```jsx
|
|
159
|
+
import { TabbedPage } from '@yanqirenshi/ihub.core';
|
|
160
|
+
|
|
161
|
+
const PANELS = { overview: Overview, notes: Notes };
|
|
162
|
+
|
|
163
|
+
export default function MyPage () {
|
|
164
|
+
return <TabbedPage pageId="PAGE_MY" panels={PANELS}/>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// 設定: tabs: { PAGE_MY: { selected: 'overview', list: [{ code: 'overview', label: '概要' }, { code: 'notes', label: 'メモ' }] } }
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Help を差し替える
|
|
171
|
+
|
|
172
|
+
`config.help.sections` に、部品の配列を渡すと、Help のページの内容 (縦に並ぶスライド) が変わります。
|
|
173
|
+
各部品は、`{ size }` (画面に収まる大きさ `{ w, h }`) を受け取ります。
|
|
174
|
+
既定は、iHub の 3 つです。
|
|
175
|
+
|
|
176
|
+
```jsx
|
|
177
|
+
import Section01 from './components/help/Section01.js';
|
|
178
|
+
import Section02 from './components/help/Section02.js';
|
|
179
|
+
|
|
180
|
+
const config = {
|
|
181
|
+
// (省略)
|
|
182
|
+
help: { sections: [Section01, Section02] },
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### ページの id
|
|
187
|
+
|
|
188
|
+
| ページの id | ページ | タブの code | 初めに開くタブ |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| `PAGE_API` | `pages.Api` (参照アプリでは `/api`) | `wbs`・`help` | `wbs` |
|
|
191
|
+
| `PAGE_BATCHS` | `pages.Batchs` (参照アプリでは `/batchs`) | `wbs`・`help` | `wbs` |
|
|
192
|
+
| `PAGE_BPMN` | `docPages.BPMN` (参照アプリでは `/bpmn`) | `palettes`・`styles`・`methods`・`overview` | `palettes` |
|
|
193
|
+
| `PAGE_BUSINESS` | `pages.Business` (参照アプリでは `/business`) | `systemic-design`・`tm`・`procedures`・`wbs`・`help` | `tm` |
|
|
194
|
+
| `PAGE_COCKPIT` | `pages.Cockpit` (参照アプリでは `/`) | `cockpit`・`overview` | `cockpit` |
|
|
195
|
+
| `PAGE_CLASSES` | `pages.Classes` (参照アプリでは `/classes`) | `class-diagram`・`wbs`・`help` | `class-diagram` |
|
|
196
|
+
| `PAGE_DATA` | `pages.Data` (参照アプリでは `/data`) | `er-diagram`・`wbs`・`help` | `er-diagram` |
|
|
197
|
+
| `PAGE_DDD` | `pages.DDD` (参照アプリでは `/ddd`) | `ubiquitous-language`・`model-driven-design`・`hands-on-modeler`・`declarative-design`・`layer-architecture`・`overview` | `layer-architecture` |
|
|
198
|
+
| `PAGE_DESIGN` | `pages.Design` (参照アプリでは `/design`) | `ui-panels`・`ui-assemblies`・`ui-parts`・`ui-events`・`wbs`・`help` | `ui-parts` |
|
|
199
|
+
| `PAGE_DEVOPS` | `pages.DevOps` (参照アプリでは `/devops`) | `bpmn`・`wbs`・`help` | `bpmn` |
|
|
200
|
+
| `PAGE_MARKETS` | `pages.Markets` (参照アプリでは `/markets`) | `user-scenario`・`customer-journey-map`・`use-case`・`wbs`・`help` | `user-scenario` |
|
|
201
|
+
| `PAGE_MESSAGES` | `pages.Messages` (参照アプリでは `/message`) | `model`・`wbs`・`help` | `wbs` |
|
|
202
|
+
| `PAGE_ORGANIZATIONS` | `pages.Organizations` (参照アプリでは `/organizations`) | `wbs`・`help` | `wbs` |
|
|
203
|
+
| `PAGE_SCREENS` | `pages.Screens` (参照アプリでは `/screens`) | `screen-transition-diagram`・`screens`・`wbs`・`help` | `screen-transition-diagram` |
|
|
204
|
+
| `PAGE_SYSTEMS` | `pages.SystemEnvironment` (参照アプリでは `/system-environment`) | `system-configuration-diagram`・`wbs`・`help` | `system-configuration-diagram` |
|
|
205
|
+
| `PAGE_ACCOUNT` | `pages.Account` (参照アプリでは `/account`) | `menus`・`operators`・`pages` | `menus` |
|
|
206
|
+
| `PAGE_EXTERNAL_RESOURCES` | `pages.ExternalResources` (参照アプリでは `/external-resources`) | `wbs` | `wbs` |
|
|
207
|
+
| `PAGE_SCRUM` | `pages.Scrum` (参照アプリでは `/scrum`) | `timeline`・`gantt-chart`・`issues`・`pull-requests`・`repositories`・`projects`・`account`・`help` | `projects` |
|
|
208
|
+
|
|
209
|
+
タブの名前 (label) は、`hooks/usePageTabs.js` の `TAB_DEFS` にあります。
|
|
210
|
+
`TabbedPage` で作った自分のページは、`pageId` に、好きな id (`PAGE_MY` など) を付けられます。
|
|
211
|
+
|
|
212
|
+
## GitHub との接続
|
|
213
|
+
|
|
214
|
+
画面は、GitHub (Scrum・コックピット・Issue の追加) に、次のどちらかのトークンで接続します。
|
|
215
|
+
両方あるときは、OAuth のトークンを先に使います。
|
|
216
|
+
|
|
217
|
+
1. OAuth で得たトークン。API サーバー ([@yanqirenshi/ihub.srv](../ihub.srv/README.md)) に OAuth App の Client ID と Client secret を設定すると使えます。(環境変数 `GITHUB_OAUTH_CLIENT_ID`・`GITHUB_OAUTH_CLIENT_SECRET`、または `createApp({ github })`)
|
|
218
|
+
Scrum のページの Account タブの `GithubOAuth` (認証・切断のボタンと状態) で、認証します。
|
|
219
|
+
2. 個人用アクセストークン。設定の `github.token` に渡します。
|
|
220
|
+
|
|
221
|
+
どちらも設定しないときは、GitHub には接続しません。(ほかの機能は、いままでどおり使えます)
|
|
222
|
+
OAuth App の作り方と環境変数は、[GitHub との連携](https://github.com/yanqirenshi/iHub/blob/main/docs/src/content/github.md) を見てください。
|
|
223
|
+
`GithubOAuth` は、自分のページにも置けます。(`import { GithubOAuth } from '@yanqirenshi/ihub.core'`)
|
|
224
|
+
|
|
225
|
+
## 公開しているもの
|
|
226
|
+
|
|
227
|
+
```js
|
|
228
|
+
import { IHub, pages, Frame } from '@yanqirenshi/ihub.core';
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
| 名前 | 内容 |
|
|
232
|
+
|---|---|
|
|
233
|
+
| `IHub` | 画面全体。テーマ・全体のスタイル・Redux のストア・ルーター・データの読み込み・GitHub の接続をまとめて、`children` を描く |
|
|
234
|
+
| `ConfigProvider`・`useConfig`・`resolveConfig`・`DEFAULT_CONFIG`・`clientHeaderName` | 設定 |
|
|
235
|
+
| `createStore` | 設定からストアを作る (`IHub` が使う) |
|
|
236
|
+
| `pages` | ページ (`pages.Cockpit`・`pages.Data`・`pages.WbsNode` など) |
|
|
237
|
+
| `docPages` | ドキュメントのページ (`docPages.ER`・`docPages.TM` など) |
|
|
238
|
+
| `panels` | ページの中身 (`panels.ER`・`panels.TM` など) |
|
|
239
|
+
| `GithubOAuth`・`Frame`・`FrameTabs`・`FrameWbsNode`・`FrameWbsNodeTabs`・`TabbedPage`・`Link`・`TableTMRelationships` など | 中間の部品 (`components/assemblies/index.js`) |
|
|
240
|
+
| `ItemWbsNode`・`LinkWBS`・`Tabs` など | 小さな部品 (`components/parts/index.js`) |
|
|
241
|
+
| `usePageTabs`・`mergeTabs` | ページのタブ |
|
|
242
|
+
| `manegers`・`wbs`・`useWbs`・`sogh` | データのマネージャ |
|
|
243
|
+
| `dataApi`・`useGetDataQuery`・`usePatchCollectionMutation`・`useAddRecordMutation`・`usePatchRecordMutation`・`useCollections`・`errorMessage` | API サーバーからのデータの読み書き |
|
|
244
|
+
| `fetchRepositories`・`fetchProjectsV2` | GitHub (Scrum) |
|
|
245
|
+
|
|
246
|
+
## CSS
|
|
247
|
+
|
|
248
|
+
`<IHub>` が、bulma と iHub の CSS (`index.css`) を読みます。
|
|
249
|
+
アプリの `index.css` は、iHub の CSS のあとに読み込んで、見た目を上書きします。
|
|
250
|
+
そのため、`src/index.js` では、`@yanqirenshi/ihub.core` の import より後に、アプリの `index.css` を import してください。
|
|
251
|
+
|
|
252
|
+
`index.css` だけを読みたいときは、`@yanqirenshi/ihub.core/index.css` で読めます。
|
|
253
|
+
|
|
254
|
+
## 雛形 (examples)
|
|
255
|
+
|
|
256
|
+
| パス | 内容 |
|
|
257
|
+
|---|---|
|
|
258
|
+
| `examples/data/` | `data/` の雛形。`ihub-srv init` がコピーします |
|
|
259
|
+
| `examples/wbs/` | WBS のノードのページの例。`src/wbs/` にコピーして使えます |
|
|
260
|
+
| `examples/app/` | アプリのファイル (`src/`・`public/`・`.gitignore` など) の雛形。`ihub-srv init --app` がコピーします。`src/` と `public/` は、iHub のリポジトリの参照アプリから、ビルドのときに作ります |
|
|
261
|
+
|
|
262
|
+
`@yanqirenshi/ihub.core/examples/*` から、パスで読めます。
|
|
263
|
+
|
|
264
|
+
## ビルド
|
|
265
|
+
|
|
266
|
+
`src/` を、Babel で `dist/` (ESM) に変換します。
|
|
267
|
+
(CRA は、`node_modules` の JSX を変換しないため)
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
npm run build -w @yanqirenshi/ihub.core
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- 開発中は、`npm run build:watch -w @yanqirenshi/ihub.core` で、直すたびに自動でビルドします。(iHub のリポジトリのルートの `npm start` が、一緒に動かします)
|
|
274
|
+
- `dist/` は、git に入れません。
|
|
275
|
+
- `package.json` に `"type": "module"` は書いていません。(webpack が、`dist/` を厳密な ESM として扱い、`import sogh from 'sogh'` のように、CommonJS のパッケージの既定の import が動かなくなるため)
|
package/dist/DataGate.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useDispatch, useStore } from 'react-redux';
|
|
3
|
+
import Alert from '@mui/material/Alert';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import Snackbar from '@mui/material/Snackbar';
|
|
6
|
+
import S from '@mui/material/Typography';
|
|
7
|
+
import Loading from './components/panels/Loading.js';
|
|
8
|
+
import { CLIENT_ID, collectionUpdated, dataApi, useGetDataQuery } from './redux/api/dataApi.js';
|
|
9
|
+
import { menuPagesChanged } from './redux/slices/accountMenuSlice.js';
|
|
10
|
+
import { setWbsData } from './manegers/wbs.js';
|
|
11
|
+
import { useConfig } from './config.js';
|
|
12
|
+
|
|
13
|
+
// API サーバーからデータを読み込んでから、画面を表示する。
|
|
14
|
+
// そのあとは変更の通知を受けて、変わったコレクションだけを読み直す。
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
export default function DataGate(props) {
|
|
17
|
+
const {
|
|
18
|
+
menus
|
|
19
|
+
} = useConfig();
|
|
20
|
+
const {
|
|
21
|
+
data,
|
|
22
|
+
error
|
|
23
|
+
} = useGetDataQuery();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const [notice, closeNotice] = useDataEvents();
|
|
26
|
+
const actives = data?.collections['local/account_menus'];
|
|
27
|
+
|
|
28
|
+
// サイドメニューに、個人の設定 (on/off) を反映する。
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (actives) dispatch(menuPagesChanged(menus.makePages(actives)));
|
|
31
|
+
}, [actives, menus, dispatch]);
|
|
32
|
+
if (error) return /*#__PURE__*/_jsx(LoadError, {
|
|
33
|
+
error: error
|
|
34
|
+
});
|
|
35
|
+
if (!data) return /*#__PURE__*/_jsx(Loading, {});
|
|
36
|
+
|
|
37
|
+
// WBS のマネージャは描画の中でそのまま使われるので、描画の前に作り直す。(同じデータなら何もしない)
|
|
38
|
+
setWbsData(data.collections);
|
|
39
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
40
|
+
children: [props.children, /*#__PURE__*/_jsx(DataNotice, {
|
|
41
|
+
notice: notice,
|
|
42
|
+
onClose: closeNotice
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// API サーバーからの変更の通知 (GET /api/events) を受ける。
|
|
48
|
+
// 戻り値は、フォーマットに合わないデータの知らせと、それを閉じる関数。
|
|
49
|
+
function useDataEvents() {
|
|
50
|
+
const dispatch = useDispatch();
|
|
51
|
+
const store = useStore();
|
|
52
|
+
const [notice, setNotice] = useState(null);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const etagOf = name => dataApi.endpoints.getData.select()(store.getState()).data?.etags[name];
|
|
55
|
+
const reload = async name => {
|
|
56
|
+
const res = await fetch(`/api/${name}`);
|
|
57
|
+
if (res.ok) dispatch(collectionUpdated(await res.json()));
|
|
58
|
+
};
|
|
59
|
+
const source = new EventSource('/api/events');
|
|
60
|
+
|
|
61
|
+
// 接続したとき (つながり直したときも) は、取りこぼした変更を読み直す。
|
|
62
|
+
source.addEventListener('ready', e => {
|
|
63
|
+
const {
|
|
64
|
+
etags
|
|
65
|
+
} = JSON.parse(e.data);
|
|
66
|
+
for (const [name, etag] of Object.entries(etags)) if (etagOf(name) && etagOf(name) !== etag) reload(name);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// ほかで変わったコレクションを読み直す。(このタブの書き込みは、書き込んだときに反映済み)
|
|
70
|
+
source.addEventListener('changed', e => {
|
|
71
|
+
const event = JSON.parse(e.data);
|
|
72
|
+
setNotice(current => current?.name === event.name ? null : current);
|
|
73
|
+
if (event.client === CLIENT_ID || etagOf(event.name) === event.etag) return;
|
|
74
|
+
reload(event.name);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// フォーマットやルールに合わないデータは、画面に反映せずに知らせる。
|
|
78
|
+
source.addEventListener('invalid', e => setNotice(JSON.parse(e.data)));
|
|
79
|
+
return () => source.close();
|
|
80
|
+
}, [dispatch, store]);
|
|
81
|
+
return [notice, () => setNotice(null)];
|
|
82
|
+
}
|
|
83
|
+
function DataNotice(props) {
|
|
84
|
+
const notice = props.notice;
|
|
85
|
+
return /*#__PURE__*/_jsx(Snackbar, {
|
|
86
|
+
open: !!notice,
|
|
87
|
+
anchorOrigin: {
|
|
88
|
+
vertical: 'top',
|
|
89
|
+
horizontal: 'center'
|
|
90
|
+
},
|
|
91
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
92
|
+
severity: "warning",
|
|
93
|
+
onClose: props.onClose,
|
|
94
|
+
sx: {
|
|
95
|
+
whiteSpace: 'pre-wrap'
|
|
96
|
+
},
|
|
97
|
+
children: notice && [`data/${notice.name}.json がフォーマットやルールに合っていないため、画面に反映していません。`, ...notice.errors.slice(0, 5)].join('\n')
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function LoadError(props) {
|
|
102
|
+
const error = props.error;
|
|
103
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
104
|
+
sx: {
|
|
105
|
+
p: 6
|
|
106
|
+
},
|
|
107
|
+
children: [/*#__PURE__*/_jsx(S, {
|
|
108
|
+
variant: "h5",
|
|
109
|
+
children: "データを読み込めませんでした。"
|
|
110
|
+
}), /*#__PURE__*/_jsx(S, {
|
|
111
|
+
sx: {
|
|
112
|
+
mt: 2
|
|
113
|
+
},
|
|
114
|
+
children: "API サーバーが起動しているか、確かめてください。(npm start で、画面と一緒に起動します)"
|
|
115
|
+
}), /*#__PURE__*/_jsx(S, {
|
|
116
|
+
sx: {
|
|
117
|
+
mt: 2,
|
|
118
|
+
color: '#888',
|
|
119
|
+
whiteSpace: 'pre-wrap'
|
|
120
|
+
},
|
|
121
|
+
children: error.data?.message || `${error.status} ${error.error || ''}`
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
package/dist/Github.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import { useConfig } from './config.js';
|
|
4
|
+
import { authStarted, oauthConfigured, authSucceeded, authFailed } from './redux/slices/githubAuthSlice.js';
|
|
5
|
+
import sogh from './manegers/sogh.js';
|
|
6
|
+
|
|
7
|
+
// 接続に使うトークンを決める。
|
|
8
|
+
// OAuth で得たトークン (API サーバーがメモリに持つ) を先に使い、無ければ個人用アクセストークン (設定の github.token) を使う。
|
|
9
|
+
// API サーバーに OAuth App が設定されていない (configured: false) ときは、個人用アクセストークンだけで接続する。
|
|
10
|
+
async function chooseToken(dispatch, pat) {
|
|
11
|
+
try {
|
|
12
|
+
const res = await fetch('/api/github/token');
|
|
13
|
+
if (res.ok) {
|
|
14
|
+
const {
|
|
15
|
+
configured,
|
|
16
|
+
token
|
|
17
|
+
} = await res.json();
|
|
18
|
+
dispatch(oauthConfigured(configured));
|
|
19
|
+
if (token) return {
|
|
20
|
+
token,
|
|
21
|
+
source: 'oauth'
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
} catch (e) {
|
|
25
|
+
// API サーバーが動いていないときは、個人用アクセストークンだけで試す。
|
|
26
|
+
}
|
|
27
|
+
return pat ? {
|
|
28
|
+
token: pat,
|
|
29
|
+
source: 'pat'
|
|
30
|
+
} : null;
|
|
31
|
+
}
|
|
32
|
+
export default function Github(props) {
|
|
33
|
+
const dispatch = useDispatch();
|
|
34
|
+
const {
|
|
35
|
+
github
|
|
36
|
+
} = useConfig();
|
|
37
|
+
const auth = useSelector(s => s.githubAuth.value);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if (null !== auth) return;
|
|
40
|
+
dispatch(authStarted());
|
|
41
|
+
chooseToken(dispatch, github.token).then(chosen => {
|
|
42
|
+
if (!chosen) {
|
|
43
|
+
dispatch(authFailed());
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
sogh.connect(chosen.token, viewer => dispatch(authSucceeded({
|
|
47
|
+
avatarUrl: viewer.avatarUrl(),
|
|
48
|
+
login: viewer.login(),
|
|
49
|
+
source: chosen.source
|
|
50
|
+
})), error => dispatch(authFailed()));
|
|
51
|
+
});
|
|
52
|
+
}, [auth, github, dispatch]); // TODO: setAuthed これ入れたないなぁ。。。
|
|
53
|
+
|
|
54
|
+
return null;
|
|
55
|
+
}
|
package/dist/IHub.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// WBS の表 (@yanqirenshi/table.wbs) の見た目。index.css より先に読み、iHub 側で上書きできるようにする
|
|
2
|
+
import 'bulma/css/bulma.min.css';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Provider, useDispatch } from 'react-redux';
|
|
6
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
7
|
+
import Box from '@mui/material/Box';
|
|
8
|
+
import GlobalStyles from '@mui/material/GlobalStyles';
|
|
9
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
10
|
+
import { ConfigProvider, resolveConfig } from './config.js';
|
|
11
|
+
import { createStore } from './redux/store.js';
|
|
12
|
+
import { globalStyles, makeTheme } from './manegers/colors.js';
|
|
13
|
+
import { windowResized } from './redux/slices/windowSlice.js';
|
|
14
|
+
import DataGate from './DataGate.js';
|
|
15
|
+
import Github from './Github.js';
|
|
16
|
+
|
|
17
|
+
// 窓の大きさを、ストアに知らせ続ける。
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
function useWindowSize() {
|
|
20
|
+
const dispatch = useDispatch();
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const handleResize = () => dispatch(windowResized({
|
|
23
|
+
w: window.innerWidth,
|
|
24
|
+
h: window.innerHeight
|
|
25
|
+
}));
|
|
26
|
+
handleResize();
|
|
27
|
+
window.addEventListener('resize', handleResize);
|
|
28
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
29
|
+
}, [dispatch]);
|
|
30
|
+
}
|
|
31
|
+
function Body({
|
|
32
|
+
children
|
|
33
|
+
}) {
|
|
34
|
+
useWindowSize();
|
|
35
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
36
|
+
className: "theme-color5",
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Github, {}), children]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// iHub の画面全体。
|
|
42
|
+
// テーマ・全体のスタイル・Redux のストア・ルーター・データの読み込み・GitHub の接続・窓の大きさの監視をまとめ、
|
|
43
|
+
// children (アプリの Router など) を描く。
|
|
44
|
+
//
|
|
45
|
+
// <IHub config={config}>
|
|
46
|
+
// <Router/>
|
|
47
|
+
// </IHub>
|
|
48
|
+
//
|
|
49
|
+
// config は、config.js の形。モジュールの中で 1 つだけ作って渡す。(作り直すと、ストアも作り直される)
|
|
50
|
+
export default function IHub({
|
|
51
|
+
config,
|
|
52
|
+
children
|
|
53
|
+
}) {
|
|
54
|
+
const resolved = React.useMemo(() => resolveConfig(config), [config]);
|
|
55
|
+
const store = React.useMemo(() => createStore(resolved), [resolved]);
|
|
56
|
+
const theme = React.useMemo(() => makeTheme(resolved.colors), [resolved]);
|
|
57
|
+
const styles = React.useMemo(() => globalStyles(resolved.colors), [resolved]);
|
|
58
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
59
|
+
config: resolved,
|
|
60
|
+
children: /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
61
|
+
theme: theme,
|
|
62
|
+
children: [/*#__PURE__*/_jsx(GlobalStyles, {
|
|
63
|
+
styles: styles
|
|
64
|
+
}), /*#__PURE__*/_jsx(Provider, {
|
|
65
|
+
store: store,
|
|
66
|
+
children: /*#__PURE__*/_jsx(BrowserRouter, {
|
|
67
|
+
children: /*#__PURE__*/_jsx(DataGate, {
|
|
68
|
+
children: /*#__PURE__*/_jsx(Body, {
|
|
69
|
+
children: children
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export { IHub };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import AvatarIcon from '@mui/material/Avatar';
|
|
4
|
+
import Beach from '@yanqirenshi/beach';
|
|
5
|
+
// import * as u from '../../libs/yutils/index.js';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const u = new Beach();
|
|
8
|
+
export default function Avater(props) {
|
|
9
|
+
const menu = props.menu;
|
|
10
|
+
const actions = props.actions;
|
|
11
|
+
const change = actions.menu.change;
|
|
12
|
+
const click = () => change(u.catom(menu, new_menu => {
|
|
13
|
+
new_menu.avater.clicked = !new_menu.avater.clicked;
|
|
14
|
+
if (new_menu.avater.clicked) return;
|
|
15
|
+
new_menu.avater.enterd = false;
|
|
16
|
+
new_menu.menu.enterd = false;
|
|
17
|
+
}));
|
|
18
|
+
const enterd = () => change(u.catom(menu, new_menu => {
|
|
19
|
+
new_menu.avater.enterd = true;
|
|
20
|
+
new_menu.menu.enterd = true;
|
|
21
|
+
}));
|
|
22
|
+
const leaved = () => change(u.catom(menu, new_menu => {
|
|
23
|
+
new_menu.avater.enterd = false;
|
|
24
|
+
}));
|
|
25
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
26
|
+
className: menu.avater.clicked ? 'pair-color1' : 'theme-color3',
|
|
27
|
+
sx: sx(menu),
|
|
28
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
29
|
+
sx: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
background: '#fff',
|
|
34
|
+
width: 44,
|
|
35
|
+
height: 44,
|
|
36
|
+
borderRadius: 44
|
|
37
|
+
},
|
|
38
|
+
children: /*#__PURE__*/_jsx(AvatarIcon, {
|
|
39
|
+
alt: "Yanqirenshi",
|
|
40
|
+
src: "https://avatars.githubusercontent.com/u/346975?s=400&u=9689e695c587cadccb01c45a8d5df58d4d61cf1e&v=4",
|
|
41
|
+
onClick: click,
|
|
42
|
+
onMouseEnter: enterd,
|
|
43
|
+
onMouseLeave: leaved
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function sx(menu) {
|
|
49
|
+
return {
|
|
50
|
+
position: 'fixed',
|
|
51
|
+
top: 18,
|
|
52
|
+
left: 22,
|
|
53
|
+
padding: 0.5,
|
|
54
|
+
borderRadius: 44,
|
|
55
|
+
zIndex: 8888888,
|
|
56
|
+
boxSizing: 'border-box'
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export default function Foot(props) {
|
|
4
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
5
|
+
sx: {
|
|
6
|
+
borderTop: '1px solid #eee',
|
|
7
|
+
pt: 1,
|
|
8
|
+
pb: 1,
|
|
9
|
+
paddingLeft: '22px',
|
|
10
|
+
paddingRight: '22px'
|
|
11
|
+
},
|
|
12
|
+
children: /*#__PURE__*/_jsx("p", {
|
|
13
|
+
children: "Sign Out"
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
}
|