mobility-toolbox-js 2.3.10 → 2.4.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/api/RealtimeAPI.d.ts +290 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +483 -0
- package/api/RoutingAPI.d.ts +37 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/RoutingAPI.js +35 -0
- package/api/StopsAPI.d.ts +38 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/StopsAPI.js +36 -0
- package/api/index.d.ts +4 -0
- package/api/index.d.ts.map +1 -0
- package/api/typedefs.d.ts +179 -0
- package/api/typedefs.d.ts.map +1 -0
- package/{src/api → api}/typedefs.js +1 -11
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/HttpAPI.js +57 -0
- package/common/api/WebSocketAPI.d.ts +153 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.js +341 -0
- package/common/controls/ControlCommon.d.ts +76 -0
- package/common/controls/ControlCommon.d.ts.map +1 -0
- package/common/controls/ControlCommon.js +150 -0
- package/common/controls/CopyrightControlCommon.d.ts +13 -0
- package/common/controls/CopyrightControlCommon.d.ts.map +1 -0
- package/common/controls/CopyrightControlCommon.js +34 -0
- package/common/controls/StopFinderControlCommon.d.ts +55 -0
- package/common/controls/StopFinderControlCommon.d.ts.map +1 -0
- package/common/controls/StopFinderControlCommon.js +144 -0
- package/common/index.d.ts +3 -0
- package/common/index.d.ts.map +1 -0
- package/common/layers/LayerCommon.d.ts +94 -0
- package/common/layers/LayerCommon.d.ts.map +1 -0
- package/common/layers/LayerCommon.js +244 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +288 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +779 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts +60 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.js +241 -0
- package/common/styles/index.d.ts +5 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.d.ts +36 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +276 -0
- package/common/styles/realtimeDelayStyle.d.ts +12 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +13 -0
- package/common/styles/realtimeHeadingStyle.d.ts +12 -0
- package/common/styles/realtimeHeadingStyle.d.ts.map +1 -0
- package/common/styles/realtimeHeadingStyle.js +87 -0
- package/common/styles/realtimeSimpleStyle.d.ts +4 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +23 -0
- package/common/typedefs.d.ts +183 -0
- package/common/typedefs.d.ts.map +1 -0
- package/{src/common → common}/typedefs.js +1 -1
- package/common/utils/compareDepartures.d.ts +11 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/compareDepartures.js +35 -0
- package/common/utils/createCanvas.d.ts +11 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +28 -0
- package/common/utils/createRealtimeFilters.d.ts +13 -0
- package/common/utils/createRealtimeFilters.d.ts.map +1 -0
- package/common/utils/createRealtimeFilters.js +74 -0
- package/common/utils/debounceDeparturesMessages.d.ts +13 -0
- package/common/utils/debounceDeparturesMessages.d.ts.map +1 -0
- package/common/utils/debounceDeparturesMessages.js +28 -0
- package/common/utils/debounceWebsocketMessages.d.ts +12 -0
- package/common/utils/debounceWebsocketMessages.d.ts.map +1 -0
- package/common/utils/debounceWebsocketMessages.js +30 -0
- package/common/utils/getLayersAsFlatArray.d.ts +4 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +16 -0
- package/common/utils/getMapboxMapCopyrights.d.ts +18 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.js +30 -0
- package/common/utils/getMapboxRender.d.ts +8 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +88 -0
- package/common/utils/getMaplibreRender.d.ts +9 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +40 -0
- package/{src/common/utils/getRealtimeModeSuffix.ts → common/utils/getRealtimeModeSuffix.d.ts} +2 -4
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.js +7 -0
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.js +18 -0
- package/common/utils/getVehiclePosition.d.ts +16 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.js +72 -0
- package/common/utils/index.d.ts +18 -0
- package/common/utils/index.d.ts.map +1 -0
- package/{src/common → common}/utils/index.js +2 -1
- package/common/utils/realtimeConfig.d.ts +53 -0
- package/common/utils/realtimeConfig.d.ts.map +1 -0
- package/common/utils/realtimeConfig.js +202 -0
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/removeDuplicate.js +15 -0
- package/common/utils/renderTrajectories.d.ts +17 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/renderTrajectories.js +110 -0
- package/common/utils/sortAndFilterDepartures.d.ts +16 -0
- package/common/utils/sortAndFilterDepartures.d.ts.map +1 -0
- package/common/utils/sortAndFilterDepartures.js +58 -0
- package/common/utils/sortByDelay.d.ts +4 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +21 -0
- package/common/utils/timeUtils.d.ts +24 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/timeUtils.js +39 -0
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/{src/iife.js → iife.js} +1 -3
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +10 -0
- package/mapbox/controls/CopyrightControl.d.ts +29 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/{src/mapbox/controls/CopyrightControl.ts → mapbox/controls/CopyrightControl.js} +21 -26
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/index.d.ts +6 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/layers/Layer.d.ts +59 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/Layer.js +101 -0
- package/mapbox/layers/RealtimeLayer.d.ts +180 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.js +270 -0
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/utils/getMercatorResolution.d.ts +9 -0
- package/mapbox/utils/getMercatorResolution.d.ts.map +1 -0
- package/mapbox/utils/getMercatorResolution.js +18 -0
- package/mapbox/utils/getSourceCoordinates.d.ts +9 -0
- package/mapbox/utils/getSourceCoordinates.d.ts.map +1 -0
- package/mapbox/utils/getSourceCoordinates.js +27 -0
- package/mapbox/utils/index.d.ts +3 -0
- package/mapbox/utils/index.d.ts.map +1 -0
- package/mbt.js +64822 -0
- package/mbt.js.map +7 -0
- package/mbt.min.js +1090 -0
- package/mbt.min.js.map +7 -0
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.js +68 -0
- package/ol/controls/RoutingControl.d.ts +193 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/RoutingControl.js +631 -0
- package/ol/controls/StopFinderControl.d.ts +30 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/{src/ol/controls/StopFinderControl.ts → ol/controls/StopFinderControl.js} +7 -10
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/layers/Layer.d.ts +86 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +174 -0
- package/ol/layers/MapGlLayer.d.ts +67 -0
- package/ol/layers/MapGlLayer.d.ts.map +1 -0
- package/ol/layers/MapGlLayer.js +218 -0
- package/ol/layers/MapboxLayer.d.ts +50 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.js +109 -0
- package/ol/layers/MapboxStyleLayer.d.ts +131 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +369 -0
- package/{src/ol/layers/MaplibreLayer.ts → ol/layers/MaplibreLayer.d.ts} +10 -21
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +34 -0
- package/ol/layers/RealtimeLayer.d.ts +202 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +332 -0
- package/ol/layers/RoutingLayer.d.ts +35 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.js +85 -0
- package/ol/layers/VectorLayer.d.ts +25 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.js +38 -0
- package/ol/layers/WMSLayer.d.ts +42 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.js +88 -0
- package/ol/layers/index.d.ts +9 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.js +33 -0
- package/ol/styles/fullTrajectoryStyle.d.ts +5 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.js +44 -0
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/{src/setupTests.js → setupTests.js} +7 -12
- package/.esdoc.js +0 -18
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -25
- package/.fixpackrc +0 -20
- package/.github/workflows/build.yml +0 -16
- package/.github/workflows/conventional-pr-title.yml +0 -16
- package/.github/workflows/cypress.yml +0 -101
- package/.github/workflows/test.yml +0 -17
- package/.husky/commit-msg +0 -4
- package/.husky/post-checkout +0 -4
- package/.husky/post-merge +0 -4
- package/.husky/post-rebase +0 -4
- package/.husky/pre-commit +0 -4
- package/.lintstagedrc.js +0 -10
- package/.nvmrc +0 -1
- package/.prettierrc.js +0 -5
- package/.stylelintrc.js +0 -4
- package/CHANGELOG.md +0 -132
- package/LICENSE +0 -21
- package/MIGRATION-V2.md +0 -248
- package/README.md +0 -42
- package/__mocks__/mapbox-gl.js +0 -81
- package/__mocks__/maplibre-gl.js +0 -81
- package/babel.config.js +0 -9
- package/commitlint.config.js +0 -1
- package/cypress/e2e/examples/api.cy.js +0 -7
- package/cypress/e2e/examples/examples.cy.js +0 -7
- package/cypress/e2e/examples/navigation.cy.js +0 -29
- package/cypress/fixtures/example.json +0 -5
- package/cypress/plugins/index.js +0 -21
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -20
- package/cypress.config.ts +0 -15
- package/data/fetchRoute.json +0 -292
- package/data/fetchTrajectories.json +0 -18
- package/data/fetchTrajectoryById.json +0 -3
- package/data/fetchTrajectoryStations.json +0 -18
- package/data/stopsSearch.json +0 -15
- package/dependabot.yml +0 -15
- package/doc/.eslintrc.json +0 -1
- package/doc/README.md +0 -34
- package/doc/next.config.js +0 -16
- package/doc/package.json +0 -41
- package/doc/pages/404.js +0 -5
- package/doc/pages/_app.js +0 -61
- package/doc/pages/_document.js +0 -64
- package/doc/pages/doc/[...slug].js +0 -23
- package/doc/pages/doc.js +0 -23
- package/doc/pages/example/[example].js +0 -52
- package/doc/pages/examples.js +0 -34
- package/doc/pages/index.js +0 -25
- package/doc/public/README.md +0 -15
- package/doc/public/favicon.ico +0 -0
- package/doc/public/static/assets/Lato-Black.ttf +0 -0
- package/doc/public/static/assets/Lato-BlackItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Bold.ttf +0 -0
- package/doc/public/static/assets/Lato-BoldItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Italic.ttf +0 -0
- package/doc/public/static/assets/Lato-Light.ttf +0 -0
- package/doc/public/static/assets/Lato-LightItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Regular.ttf +0 -0
- package/doc/public/static/assets/Lato-Thin.ttf +0 -0
- package/doc/public/static/assets/Lato-ThinItalic.ttf +0 -0
- package/doc/public/static/assets/OFL.txt +0 -93
- package/doc/public/static/examples/assets/tralis-live-map/index.js +0 -11
- package/doc/public/static/examples/assets/tralis-live-map/s1kreis.svg +0 -105
- package/doc/public/static/examples/assets/tralis-live-map/s20kreis.svg +0 -101
- package/doc/public/static/examples/assets/tralis-live-map/s2kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s3kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s4kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s6kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s7kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s8kreis.svg +0 -93
- package/doc/public/static/examples/assets/tralis-live-map/unknown.svg +0 -107
- package/doc/public/static/examples/layers.html +0 -11
- package/doc/public/static/examples/layers.js +0 -97
- package/doc/public/static/examples/mb-copyright.html +0 -26
- package/doc/public/static/examples/mb-copyright.js +0 -37
- package/doc/public/static/examples/mb-tracker.html +0 -1
- package/doc/public/static/examples/mb-tracker.js +0 -40
- package/doc/public/static/examples/mb-tracker.md +0 -1
- package/doc/public/static/examples/mb-tralis.html +0 -1
- package/doc/public/static/examples/mb-tralis.js +0 -34
- package/doc/public/static/examples/ol-copyright.html +0 -26
- package/doc/public/static/examples/ol-copyright.js +0 -43
- package/doc/public/static/examples/ol-mapbox-layer.html +0 -1
- package/doc/public/static/examples/ol-mapbox-layer.js +0 -28
- package/doc/public/static/examples/ol-mapbox-style-layer.html +0 -12
- package/doc/public/static/examples/ol-mapbox-style-layer.js +0 -48
- package/doc/public/static/examples/ol-query.html +0 -32
- package/doc/public/static/examples/ol-query.js +0 -83
- package/doc/public/static/examples/ol-routing.html +0 -26
- package/doc/public/static/examples/ol-routing.js +0 -65
- package/doc/public/static/examples/ol-routing.md +0 -1
- package/doc/public/static/examples/ol-stop-finder.html +0 -15
- package/doc/public/static/examples/ol-stop-finder.js +0 -35
- package/doc/public/static/examples/ol-stop-finder.md +0 -1
- package/doc/public/static/examples/ol-tracker.html +0 -1
- package/doc/public/static/examples/ol-tracker.js +0 -41
- package/doc/public/static/examples/ol-tracker.md +0 -1
- package/doc/public/static/examples/ol-tralis.html +0 -5
- package/doc/public/static/examples/ol-tralis.js +0 -62
- package/doc/public/static/examples/tralis-live-map.html +0 -1
- package/doc/public/static/examples/tralis-live-map.js +0 -67
- package/doc/public/static/examples/tralis-live-map.md +0 -3
- package/doc/public/static/img/live_tracker_mb.jpg +0 -0
- package/doc/public/static/img/live_tracker_munich.jpg +0 -0
- package/doc/public/static/img/live_tracker_ol.jpg +0 -0
- package/doc/public/static/img/mapbox.jpg +0 -0
- package/doc/public/static/img/mapbox_style.jpg +0 -0
- package/doc/public/static/img/ol-copyright.png +0 -0
- package/doc/public/static/img/query_objects.jpg +0 -0
- package/doc/public/static/img/routing.jpg +0 -0
- package/doc/public/static/img/simple_map.jpg +0 -0
- package/doc/public/static/img/stops.jpg +0 -0
- package/doc/public/vercel.svg +0 -4
- package/doc/src/components/CodeSandboxButton.js +0 -102
- package/doc/src/components/Documentation.js +0 -42
- package/doc/src/components/Esdoc/Anchor.js +0 -57
- package/doc/src/components/Esdoc/ClassDoc.js +0 -272
- package/doc/src/components/Esdoc/DeprecatedHTML.js +0 -16
- package/doc/src/components/Esdoc/DetailDocs.js +0 -279
- package/doc/src/components/Esdoc/DetailHTML.js +0 -33
- package/doc/src/components/Esdoc/DirectSubclassHTML.js +0 -30
- package/doc/src/components/Esdoc/DocBuilderUtils.js +0 -697
- package/doc/src/components/Esdoc/DocLinkHTML.js +0 -63
- package/doc/src/components/Esdoc/DocsLinkHTML.js +0 -38
- package/doc/src/components/Esdoc/Esdoc.js +0 -63
- package/doc/src/components/Esdoc/EsdocContent.js +0 -56
- package/doc/src/components/Esdoc/EsdocNavigation.js +0 -13
- package/doc/src/components/Esdoc/EsdocSearch.js +0 -78
- package/doc/src/components/Esdoc/ExperimentalHTML.js +0 -17
- package/doc/src/components/Esdoc/ExtendsChainHTML.js +0 -32
- package/doc/src/components/Esdoc/FileDocLinkHTML.js +0 -62
- package/doc/src/components/Esdoc/IdentifiersDoc.js +0 -113
- package/doc/src/components/Esdoc/IndirectSubclassHTML.js +0 -30
- package/doc/src/components/Esdoc/InheritedSummaryDoc.js +0 -70
- package/doc/src/components/Esdoc/InheritedSummaryHTML.js +0 -38
- package/doc/src/components/Esdoc/MixinClassesHTML.js +0 -29
- package/doc/src/components/Esdoc/NavDoc.js +0 -112
- package/doc/src/components/Esdoc/OverrideMethod.js +0 -44
- package/doc/src/components/Esdoc/OverrideMethodDescription.js +0 -35
- package/doc/src/components/Esdoc/Properties.js +0 -89
- package/doc/src/components/Esdoc/README.md +0 -45
- package/doc/src/components/Esdoc/SignatureHTML.js +0 -123
- package/doc/src/components/Esdoc/SingleDoc.js +0 -31
- package/doc/src/components/Esdoc/SummaryDoc.js +0 -160
- package/doc/src/components/Esdoc/SummaryHTML.js +0 -96
- package/doc/src/components/Esdoc/TypeDocLinkHTML.js +0 -251
- package/doc/src/components/Esdoc/index.js +0 -7
- package/doc/src/components/Esdoc/taffydb.js +0 -2070
- package/doc/src/components/Example.js +0 -200
- package/doc/src/components/ExampleCard.js +0 -126
- package/doc/src/components/Examples.js +0 -78
- package/doc/src/components/Home.js +0 -121
- package/doc/src/components/TrackerExample.js +0 -39
- package/doc/src/examples.js +0 -117
- package/doc/styles/App.scss +0 -53
- package/doc/styles/identifiers.css +0 -38
- package/doc/styles/search.css +0 -76
- package/doc/styles/style.css +0 -603
- package/esdoc/README.md +0 -27
- package/esdoc/plugins/MyPlugin.js +0 -69
- package/esdoc/plugins/dynamic-property-plugin/Plugin.js +0 -50
- package/esdoc/plugins/externals-plugin/Plugin.js +0 -45
- package/esdoc/plugins/externals-plugin/externals.js +0 -93
- package/esdoc/plugins/optional-chaining-plugin/Plugin.js +0 -8
- package/global-setup.js +0 -3
- package/jest.config.js +0 -24
- package/pull_request_template.md +0 -17
- package/scripts/read-pkg-json.js +0 -22
- package/src/api/RealtimeAPI.test.js +0 -144
- package/src/api/RealtimeAPI.ts +0 -712
- package/src/api/RoutingAPI.test.js +0 -41
- package/src/api/RoutingAPI.ts +0 -47
- package/src/api/StopsAPI.test.js +0 -34
- package/src/api/StopsAPI.ts +0 -45
- package/src/common/api/HttpAPI.test.js +0 -68
- package/src/common/api/HttpAPI.ts +0 -77
- package/src/common/api/WebSocketAPI.test.js +0 -421
- package/src/common/api/WebSocketAPI.ts +0 -515
- package/src/common/controls/ControlCommon.test.js +0 -106
- package/src/common/controls/ControlCommon.ts +0 -194
- package/src/common/controls/CopyrightControlCommon.ts +0 -41
- package/src/common/controls/StopFinderControlCommon.ts +0 -192
- package/src/common/layers/LayerCommon.test.js +0 -158
- package/src/common/layers/LayerCommon.ts +0 -321
- package/src/common/mixins/RealtimeLayerMixin.ts +0 -1168
- package/src/common/mixins/UserInteractionsLayerMixin.test.js +0 -227
- package/src/common/mixins/UserInteractionsLayerMixin.ts +0 -352
- package/src/common/styles/realtimeDefaultStyle.ts +0 -436
- package/src/common/styles/realtimeDelayStyle.ts +0 -27
- package/src/common/styles/realtimeHeadingStyle.ts +0 -138
- package/src/common/styles/realtimeSimpleStyle.ts +0 -25
- package/src/common/utils/compareDepartures.ts +0 -46
- package/src/common/utils/createCanvas.ts +0 -33
- package/src/common/utils/createRealtimeFilters.test.js +0 -100
- package/src/common/utils/createRealtimeFilters.ts +0 -96
- package/src/common/utils/debounceDeparturesMessages.ts +0 -52
- package/src/common/utils/debounceWebsocketMessages.ts +0 -47
- package/src/common/utils/getLayersAsFlatArray.ts +0 -17
- package/src/common/utils/getMapboxMapCopyrights.test.js +0 -47
- package/src/common/utils/getMapboxMapCopyrights.ts +0 -52
- package/src/common/utils/getMapboxRender.ts +0 -104
- package/src/common/utils/getMaplibreRender.ts +0 -54
- package/src/common/utils/getUrlWithParams.ts +0 -21
- package/src/common/utils/getVehiclePosition.ts +0 -92
- package/src/common/utils/realtimeConfig.test.js +0 -57
- package/src/common/utils/realtimeConfig.ts +0 -228
- package/src/common/utils/removeDuplicate.test.js +0 -22
- package/src/common/utils/removeDuplicate.ts +0 -22
- package/src/common/utils/renderTrajectories.ts +0 -194
- package/src/common/utils/sortAndFilterDepartures.ts +0 -78
- package/src/common/utils/sortByDelay.ts +0 -29
- package/src/common/utils/timeUtils.test.js +0 -16
- package/src/common/utils/timeUtils.ts +0 -45
- package/src/index.js +0 -10
- package/src/mapbox/layers/Layer.test.js +0 -217
- package/src/mapbox/layers/Layer.ts +0 -144
- package/src/mapbox/layers/RealtimeLayer.test.js +0 -13
- package/src/mapbox/layers/RealtimeLayer.ts +0 -350
- package/src/mapbox/utils/getMercatorResolution.ts +0 -21
- package/src/mapbox/utils/getSourceCoordinates.ts +0 -34
- package/src/ol/README.md +0 -0
- package/src/ol/controls/CopyrightControl.test.js +0 -211
- package/src/ol/controls/CopyrightControl.ts +0 -82
- package/src/ol/controls/RoutingControl.test.js +0 -205
- package/src/ol/controls/RoutingControl.ts +0 -869
- package/src/ol/controls/StopFinderControl.test.js +0 -59
- package/src/ol/controls/snapshots/RoutingControlRouteGen10.json +0 -58
- package/src/ol/controls/snapshots/RoutingControlRouteGen100.json +0 -292
- package/src/ol/controls/snapshots/RoutingControlRouteGen30.json +0 -69
- package/src/ol/controls/snapshots/RoutingControlRouteGen5.json +0 -58
- package/src/ol/controls/snapshots/RoutingControlRouteOSM.json +0 -759
- package/src/ol/controls/snapshots/RoutingControlStation1.json +0 -60
- package/src/ol/controls/snapshots/RoutingControlStation2.json +0 -49
- package/src/ol/layers/Layer.test.js +0 -212
- package/src/ol/layers/Layer.ts +0 -252
- package/src/ol/layers/MapGlLayer.ts +0 -294
- package/src/ol/layers/MapboxLayer.test.js +0 -190
- package/src/ol/layers/MapboxLayer.ts +0 -136
- package/src/ol/layers/MapboxStyleLayer.test.js +0 -258
- package/src/ol/layers/MapboxStyleLayer.ts +0 -466
- package/src/ol/layers/RealtimeLayer.test.js +0 -84
- package/src/ol/layers/RealtimeLayer.ts +0 -465
- package/src/ol/layers/RoutingLayer.test.js +0 -48
- package/src/ol/layers/RoutingLayer.ts +0 -113
- package/src/ol/layers/VectorLayer.test.js +0 -87
- package/src/ol/layers/VectorLayer.ts +0 -48
- package/src/ol/layers/WMSLayer.test.js +0 -65
- package/src/ol/layers/WMSLayer.ts +0 -114
- package/src/ol/styles/fullTrajectoryDelayStyle.ts +0 -37
- package/src/ol/styles/fullTrajectoryStyle.ts +0 -56
- package/tsconfig.json +0 -23
- /package/{src/api → api}/index.js +0 -0
- /package/{src/common → common}/index.js +0 -0
- /package/{src/common → common}/styles/index.js +0 -0
- /package/{src/mapbox → mapbox}/controls/index.js +0 -0
- /package/{src/mapbox → mapbox}/index.js +0 -0
- /package/{src/mapbox → mapbox}/layers/index.js +0 -0
- /package/{src/mapbox → mapbox}/utils/index.js +0 -0
- /package/{src/ol → ol}/controls/index.js +0 -0
- /package/{src/ol → ol}/index.js +0 -0
- /package/{src/ol → ol}/layers/index.js +0 -0
- /package/{src/ol → ol}/styles/index.js +0 -0
- /package/{src/types → types}/common.d.ts +0 -0
- /package/{src/types → types}/index.d.ts +0 -0
- /package/{src/types → types}/realtime.d.ts +0 -0
- /package/{src/types → types}/routing.d.ts +0 -0
- /package/{src/types → types}/stops.d.ts +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import DocLinkHTML from './DocLinkHTML';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* build mixin extends html.
|
|
7
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/ClassDocBuilder.js#L134
|
|
8
|
-
* @param {DocObject} doc - target class doc.
|
|
9
|
-
* @return {string} mixin extends html.
|
|
10
|
-
*/
|
|
11
|
-
function MixinClassesHTML({ doc }) {
|
|
12
|
-
if (!doc.extends) return '';
|
|
13
|
-
if (doc.extends.length <= 1) return '';
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div className="flat-list" data-ice="mixinExtends">
|
|
17
|
-
<h4>Mixin Extends:</h4>
|
|
18
|
-
<div>
|
|
19
|
-
{doc.extends.map((extend, idx) => (
|
|
20
|
-
<React.Fragment key={extend}>
|
|
21
|
-
<DocLinkHTML longname={extend} />{' '}
|
|
22
|
-
{idx !== doc.extends.length - 1 ? ', ' : ''}
|
|
23
|
-
</React.Fragment>
|
|
24
|
-
))}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
export default React.memo(MixinClassesHTML);
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-continue */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
|
4
|
-
/* eslint-disable react/prop-types */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import Anchor from './Anchor';
|
|
8
|
-
import { _find, escapeURLHash } from './DocBuilderUtils';
|
|
9
|
-
import DocLinkHTML from './DocLinkHTML';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* build common navigation output.
|
|
13
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L177
|
|
14
|
-
* @return {IceCap} navigation output.
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
function NavDoc() {
|
|
18
|
-
const kinds = ['class', 'function', 'variable']; // , 'typedef', 'external'];
|
|
19
|
-
|
|
20
|
-
// we display only public doc and not externals, feel free to reactivate them if you want.
|
|
21
|
-
const allDocs = _find({ kind: kinds }).filter((v) => v.access === 'public');
|
|
22
|
-
|
|
23
|
-
const kindOrder = {
|
|
24
|
-
class: 0,
|
|
25
|
-
interface: 1,
|
|
26
|
-
function: 2,
|
|
27
|
-
variable: 3,
|
|
28
|
-
typedef: 4,
|
|
29
|
-
external: 5,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Add a typedef doc to have a link to main type def page
|
|
33
|
-
allDocs.push({
|
|
34
|
-
access: 'public',
|
|
35
|
-
description: null,
|
|
36
|
-
export: false,
|
|
37
|
-
importPath: 'mobility-toolbox-js/src/index.js',
|
|
38
|
-
importStyle: 'typedef',
|
|
39
|
-
kind: 'typedef',
|
|
40
|
-
lineNumber: 1,
|
|
41
|
-
longname: 'typedefs',
|
|
42
|
-
memberof: 'src/index.js',
|
|
43
|
-
name: 'typedefs',
|
|
44
|
-
static: true,
|
|
45
|
-
undocument: true,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// see: IdentifiersDocBuilder#_buildIdentifierDoc
|
|
49
|
-
allDocs.sort((a, b) => {
|
|
50
|
-
const filePathA = a.longname.split('~')[0];
|
|
51
|
-
const filePathB = b.longname.split('~')[0];
|
|
52
|
-
const dirPathA = path.dirname(filePathA);
|
|
53
|
-
const dirPathB = path.dirname(filePathB);
|
|
54
|
-
const kindA = a.interface ? 'interface' : a.kind;
|
|
55
|
-
const kindB = b.interface ? 'interface' : b.kind;
|
|
56
|
-
if (dirPathA === dirPathB) {
|
|
57
|
-
if (kindA === kindB) {
|
|
58
|
-
return a.longname > b.longname ? 1 : -1;
|
|
59
|
-
}
|
|
60
|
-
return kindOrder[kindA] > kindOrder[kindB] ? 1 : -1;
|
|
61
|
-
}
|
|
62
|
-
return dirPathA > dirPathB ? 1 : -1;
|
|
63
|
-
});
|
|
64
|
-
let lastDirPath = '.';
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<div>
|
|
68
|
-
<ul>
|
|
69
|
-
{allDocs.map((doc) => {
|
|
70
|
-
const filePath = doc.longname.split('~')[0].replace(/^.*?[/]/, '');
|
|
71
|
-
const dirPath = path.dirname(filePath);
|
|
72
|
-
const kind = doc.interface ? 'interface' : doc.kind;
|
|
73
|
-
const kindText = kind.charAt(0).toUpperCase();
|
|
74
|
-
const kindClass = `kind-${kind}`;
|
|
75
|
-
// ice.load('name', this._buildDocLinkHTML(doc.longname));
|
|
76
|
-
// ice.load('kind', kindText);
|
|
77
|
-
// ice.attr('kind', 'class', kindClass);
|
|
78
|
-
// ice.text('dirPath', dirPath);
|
|
79
|
-
// ice.attr(
|
|
80
|
-
// 'dirPath',
|
|
81
|
-
// 'href',
|
|
82
|
-
// `identifiers.html#${escapeURLHash(dirPath)}`,
|
|
83
|
-
// );
|
|
84
|
-
// ice.drop('dirPath', lastDirPath === dirPath);
|
|
85
|
-
const displayDir = lastDirPath !== dirPath;
|
|
86
|
-
lastDirPath = dirPath;
|
|
87
|
-
return (
|
|
88
|
-
<li data-ice="doc" key={doc.longname}>
|
|
89
|
-
{displayDir && (
|
|
90
|
-
<Anchor
|
|
91
|
-
data-ice="dirPath"
|
|
92
|
-
className="nav-dir-path"
|
|
93
|
-
path={`/doc/identifiers%20html#${escapeURLHash(dirPath)}`}
|
|
94
|
-
>
|
|
95
|
-
{dirPath || 'api'}
|
|
96
|
-
</Anchor>
|
|
97
|
-
)}
|
|
98
|
-
<span data-ice="kind" className={kindClass}>
|
|
99
|
-
{kindText}
|
|
100
|
-
</span>
|
|
101
|
-
<span data-ice="name">
|
|
102
|
-
<DocLinkHTML longname={doc.longname} />
|
|
103
|
-
</span>
|
|
104
|
-
</li>
|
|
105
|
-
);
|
|
106
|
-
})}
|
|
107
|
-
</ul>
|
|
108
|
-
</div>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export default React.memo(NavDoc);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
|
-
/* eslint-disable no-continue */
|
|
3
|
-
/* eslint-disable no-restricted-syntax */
|
|
4
|
-
/* eslint-disable no-underscore-dangle */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { _findByName, _find } from './DocBuilderUtils';
|
|
7
|
-
import DocLinkHTML from './DocLinkHTML';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* build method of ancestor class link html.
|
|
11
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L952
|
|
12
|
-
* @param {DocObject} doc - target doc object.
|
|
13
|
-
* @returns {string} html link. if doc does not override ancestor method, returns empty.
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
function OverrideMethod({ doc }) {
|
|
17
|
-
const parentDoc = _findByName(doc.memberof)[0];
|
|
18
|
-
if (!parentDoc) return '';
|
|
19
|
-
if (!parentDoc._custom_extends_chains) return '';
|
|
20
|
-
|
|
21
|
-
const chains = [...parentDoc._custom_extends_chains].reverse();
|
|
22
|
-
for (const longname of chains) {
|
|
23
|
-
const superClassDoc = _findByName(longname)[0];
|
|
24
|
-
if (!superClassDoc) continue;
|
|
25
|
-
|
|
26
|
-
const superMethodDoc = _find({
|
|
27
|
-
name: doc.name,
|
|
28
|
-
memberof: superClassDoc.longname,
|
|
29
|
-
})[0];
|
|
30
|
-
if (!superMethodDoc) continue;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<DocLinkHTML
|
|
34
|
-
longname={superMethodDoc.longname}
|
|
35
|
-
text={`${superClassDoc.name}#${superMethodDoc.name}`}
|
|
36
|
-
inner
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default React.memo(OverrideMethod);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-continue */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { _findByName, _find } from './DocBuilderUtils';
|
|
6
|
-
/**
|
|
7
|
-
* build method of ancestor class description.
|
|
8
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L977
|
|
9
|
-
* @param {DocObject} doc - target doc object.
|
|
10
|
-
* @returns {string} description. if doc does not override ancestor method, returns empty.
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
const OverrideMethodDescription = ({ doc }) => {
|
|
14
|
-
const parentDoc = _findByName(doc.memberof)[0];
|
|
15
|
-
if (!parentDoc) return '';
|
|
16
|
-
if (!parentDoc._custom_extends_chains) return '';
|
|
17
|
-
|
|
18
|
-
const chains = [...parentDoc._custom_extends_chains].reverse();
|
|
19
|
-
for (const longname of chains) {
|
|
20
|
-
const superClassDoc = _findByName(longname)[0];
|
|
21
|
-
if (!superClassDoc) continue;
|
|
22
|
-
|
|
23
|
-
const superMethodDoc = _find({
|
|
24
|
-
name: doc.name,
|
|
25
|
-
memberof: superClassDoc.longname,
|
|
26
|
-
})[0];
|
|
27
|
-
if (!superMethodDoc) continue;
|
|
28
|
-
|
|
29
|
-
if (superMethodDoc.description) return superMethodDoc.description;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return '';
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default React.memo(OverrideMethodDescription);
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-array-index-key */
|
|
2
|
-
/* eslint-disable react/prop-types */
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import Markdown from 'react-markdown';
|
|
5
|
-
import TypeDocLinkHTML from './TypeDocLinkHTML';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* build properties output.
|
|
9
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L870
|
|
10
|
-
* @param {ParsedParam[]} [properties=[]] - properties in doc object.
|
|
11
|
-
* @param {string} title - output title.
|
|
12
|
-
* @return {IceCap} built properties output.
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
function Properties({ properties = [], title = 'Properties:' }) {
|
|
16
|
-
return (
|
|
17
|
-
<div data-ice="properties">
|
|
18
|
-
<h4 data-ice="title">{title}</h4>
|
|
19
|
-
<table className="params">
|
|
20
|
-
<thead>
|
|
21
|
-
<tr>
|
|
22
|
-
<td>Name</td>
|
|
23
|
-
<td>Type</td>
|
|
24
|
-
<td>Attribute</td>
|
|
25
|
-
<td>Description</td>
|
|
26
|
-
</tr>
|
|
27
|
-
</thead>
|
|
28
|
-
<tbody>
|
|
29
|
-
{properties.map((prop) => {
|
|
30
|
-
// appendix
|
|
31
|
-
const appendix = [];
|
|
32
|
-
if (prop.optional) {
|
|
33
|
-
appendix.push(<li>optional</li>);
|
|
34
|
-
}
|
|
35
|
-
if ('defaultValue' in prop) {
|
|
36
|
-
appendix.push(<li>default: {prop.defaultValue}</li>);
|
|
37
|
-
}
|
|
38
|
-
if (typeof prop.nullable === 'boolean') {
|
|
39
|
-
appendix.push(<li>nullable: {prop.nullable}</li>);
|
|
40
|
-
}
|
|
41
|
-
return (
|
|
42
|
-
<tr
|
|
43
|
-
key={prop.name}
|
|
44
|
-
data-ice="property"
|
|
45
|
-
data-depth={prop.name.split('.').length - 1}
|
|
46
|
-
>
|
|
47
|
-
<td
|
|
48
|
-
data-ice="name"
|
|
49
|
-
className="code"
|
|
50
|
-
data-depth={prop.name.split('.').length - 1}
|
|
51
|
-
>
|
|
52
|
-
{prop.name}
|
|
53
|
-
</td>
|
|
54
|
-
<td data-ice="type" className="code">
|
|
55
|
-
{prop.types.map((typeName, idx) => {
|
|
56
|
-
return (
|
|
57
|
-
<React.Fragment key={idx}>
|
|
58
|
-
<TypeDocLinkHTML typeName={typeName} />
|
|
59
|
-
{idx !== prop.types.length - 1 ? ' | ' : ''}
|
|
60
|
-
</React.Fragment>
|
|
61
|
-
);
|
|
62
|
-
})}
|
|
63
|
-
</td>
|
|
64
|
-
<td data-ice="appendix">
|
|
65
|
-
{!!appendix.length && (
|
|
66
|
-
<ul>
|
|
67
|
-
{appendix.map((comp, idx) => {
|
|
68
|
-
return (
|
|
69
|
-
<React.Fragment key={idx}>
|
|
70
|
-
{comp}
|
|
71
|
-
{idx !== appendix.length - 1 ? '\n' : ''}
|
|
72
|
-
</React.Fragment>
|
|
73
|
-
);
|
|
74
|
-
})}
|
|
75
|
-
</ul>
|
|
76
|
-
)}
|
|
77
|
-
</td>
|
|
78
|
-
<td data-ice="description">
|
|
79
|
-
<Markdown>{prop.description}</Markdown>
|
|
80
|
-
</td>
|
|
81
|
-
</tr>
|
|
82
|
-
);
|
|
83
|
-
})}
|
|
84
|
-
</tbody>
|
|
85
|
-
</table>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
export default React.memo(Properties);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# react-esdoc
|
|
2
|
-
|
|
3
|
-
This folder contains an implementation of the rendering of [esdoc-publish-html-plugin](https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin).
|
|
4
|
-
|
|
5
|
-
Every components in this folder is an implementation of a `_buildXXX` function in [Builder folder of the plugin](https://github.com/esdoc/esdoc-plugins/tree/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder)
|
|
6
|
-
In the documentation of the component you can find the link to the function it implements.
|
|
7
|
-
|
|
8
|
-
The original css from [esdoc-publish-html-plugin](https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin) is used. See `./css` folder.
|
|
9
|
-
|
|
10
|
-
## How does it work
|
|
11
|
-
|
|
12
|
-
The [esdoc-publish-html-plugin](https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin) creates an `index.json` in `apidoc/index.json` when we run `yarn apidoc`.
|
|
13
|
-
|
|
14
|
-
The `yarn apidoc` task copy automatically this `index.json` in this folder.
|
|
15
|
-
|
|
16
|
-
This json is loaded in `./DocBuilderUtils.js` then a in memory [taffy](http://taffydb.com/) database is loaded with its content.
|
|
17
|
-
This database is only used to facilitate the retrievment of data from the `ìndex.json` content.
|
|
18
|
-
|
|
19
|
-
## Components
|
|
20
|
-
|
|
21
|
-
Only 4 components must be used directly:
|
|
22
|
-
|
|
23
|
-
- Esdoc : The documentation layout.
|
|
24
|
-
- EsdocContent : The class/type/function documentation display.
|
|
25
|
-
- EsdocNavigation: The documentation navigation tool.
|
|
26
|
-
- EsdocSearch: The documentation search box.
|
|
27
|
-
|
|
28
|
-
## TODO
|
|
29
|
-
|
|
30
|
-
List of functionalities not implemented because we don't use it :
|
|
31
|
-
|
|
32
|
-
- Tests
|
|
33
|
-
- Decorators
|
|
34
|
-
- TODO
|
|
35
|
-
|
|
36
|
-
## Improvments
|
|
37
|
-
|
|
38
|
-
- Pass the index.json content as a parameter.
|
|
39
|
-
- Configure the replacement of '.' by '%20' in url to make it work with react-router.
|
|
40
|
-
- Configure the base url, currently /doc/ is append to all links except source links.
|
|
41
|
-
- Configure the github url, currently github.com/mobility-toolbox-js/... is append to all sources links.
|
|
42
|
-
- Create an esdoc plugin to generate only the index.json file, it should be easy using [esdoc-publish-html-plugin](https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin) code.
|
|
43
|
-
- Convert css to scss.
|
|
44
|
-
- Reactivate all eslint rules.
|
|
45
|
-
- Reactivate all stylelint rules.
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-array-index-key */
|
|
2
|
-
/* eslint-disable no-continue */
|
|
3
|
-
/* eslint-disable no-restricted-syntax */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import TypeDocLinkHTML from './TypeDocLinkHTML';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* build identifier signature html.
|
|
9
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L813
|
|
10
|
-
* @param {DocObject} doc - target doc object.
|
|
11
|
-
* @returns {string} signature html.
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
const SignatureHTML = ({ doc }) => {
|
|
15
|
-
// call signature
|
|
16
|
-
const callSignatures = [];
|
|
17
|
-
if (doc.params) {
|
|
18
|
-
for (const param of doc.params) {
|
|
19
|
-
const paramName = param.name;
|
|
20
|
-
if (paramName.indexOf('.') !== -1) continue; // for object property
|
|
21
|
-
if (paramName.indexOf('[') !== -1) continue; // for array property
|
|
22
|
-
|
|
23
|
-
const types = [];
|
|
24
|
-
for (const typeName of param.types) {
|
|
25
|
-
types.push(<TypeDocLinkHTML typeName={typeName} />);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
callSignatures.push(
|
|
29
|
-
<>
|
|
30
|
-
{`${paramName}: `}
|
|
31
|
-
{types.map((comp, idx) => {
|
|
32
|
-
return (
|
|
33
|
-
<React.Fragment key={idx}>
|
|
34
|
-
{comp}
|
|
35
|
-
{idx !== types.length - 1 ? ' | ' : ''}
|
|
36
|
-
</React.Fragment>
|
|
37
|
-
);
|
|
38
|
-
})}
|
|
39
|
-
</>,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// return signature
|
|
45
|
-
const returnSignatures = [];
|
|
46
|
-
if (doc.return) {
|
|
47
|
-
for (const typeName of doc.return.types) {
|
|
48
|
-
returnSignatures.push(<TypeDocLinkHTML typeName={typeName} />);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// type signature
|
|
53
|
-
let typeSignatures = [];
|
|
54
|
-
if (doc.type) {
|
|
55
|
-
for (const typeName of doc.type.types) {
|
|
56
|
-
typeSignatures.push(<TypeDocLinkHTML typeName={typeName} />);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// callback is not need type. because type is always function.
|
|
61
|
-
if (doc.kind === 'function') {
|
|
62
|
-
typeSignatures = [];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
let html = '';
|
|
66
|
-
const hasMoreThan1Param = callSignatures.length > 1;
|
|
67
|
-
if (callSignatures.length) {
|
|
68
|
-
html = (
|
|
69
|
-
<>
|
|
70
|
-
(
|
|
71
|
-
{callSignatures.map((comp, idx) => {
|
|
72
|
-
return (
|
|
73
|
-
<React.Fragment key={idx}>
|
|
74
|
-
{hasMoreThan1Param && <br />}
|
|
75
|
-
<span style={{ paddingLeft: hasMoreThan1Param ? 20 : 0 }}>
|
|
76
|
-
{comp}
|
|
77
|
-
{idx !== callSignatures.length - 1 ? ', ' : ''}
|
|
78
|
-
</span>
|
|
79
|
-
{hasMoreThan1Param && idx === callSignatures.length - 1 && <br />}
|
|
80
|
-
</React.Fragment>
|
|
81
|
-
);
|
|
82
|
-
})}
|
|
83
|
-
)
|
|
84
|
-
</>
|
|
85
|
-
);
|
|
86
|
-
} else if (['function', 'method', 'constructor'].includes(doc.kind)) {
|
|
87
|
-
html = '()';
|
|
88
|
-
}
|
|
89
|
-
if (returnSignatures.length)
|
|
90
|
-
html = (
|
|
91
|
-
<>
|
|
92
|
-
{html}
|
|
93
|
-
{`: `}
|
|
94
|
-
{returnSignatures.map((comp, idx) => {
|
|
95
|
-
return (
|
|
96
|
-
<React.Fragment key={idx}>
|
|
97
|
-
{comp}
|
|
98
|
-
{idx !== returnSignatures.length - 1 ? ' | ' : ''}
|
|
99
|
-
</React.Fragment>
|
|
100
|
-
);
|
|
101
|
-
})}
|
|
102
|
-
</>
|
|
103
|
-
);
|
|
104
|
-
if (typeSignatures.length)
|
|
105
|
-
html = (
|
|
106
|
-
<>
|
|
107
|
-
{html}
|
|
108
|
-
{`: `}
|
|
109
|
-
{typeSignatures.map((comp, idx) => {
|
|
110
|
-
return (
|
|
111
|
-
<React.Fragment key={idx}>
|
|
112
|
-
{comp}
|
|
113
|
-
{idx !== typeSignatures.length - 1 ? ' | ' : ''}
|
|
114
|
-
</React.Fragment>
|
|
115
|
-
);
|
|
116
|
-
})}
|
|
117
|
-
</>
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
return html;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export default React.memo(SignatureHTML);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-continue */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
|
4
|
-
/* eslint-disable react/prop-types */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import SummaryHTML from './SummaryHTML';
|
|
7
|
-
import DetailHTML from './DetailHTML';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* build single output.
|
|
11
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/SingleDocBuilder.js#L29
|
|
12
|
-
* @param {string} kind - target kind property.
|
|
13
|
-
* @returns {string} html of single output
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
function SingleDoc({ kind }) {
|
|
17
|
-
const title = kind.replace(/^(\w)/, (c) => c.toUpperCase());
|
|
18
|
-
return (
|
|
19
|
-
<>
|
|
20
|
-
<h1 data-ice="title">{title}</h1>
|
|
21
|
-
<div data-ice="summaries">
|
|
22
|
-
<SummaryHTML doc={null} kind={kind} title="Summary" />
|
|
23
|
-
</div>
|
|
24
|
-
<div data-ice="details">
|
|
25
|
-
<DetailHTML doc={null} kind={kind} title="" />
|
|
26
|
-
</div>
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default React.memo(SingleDoc);
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
|
-
/* eslint-disable react/no-array-index-key */
|
|
3
|
-
import React, { useMemo } from 'react';
|
|
4
|
-
import Markdown from 'react-markdown';
|
|
5
|
-
import DocLinkHTML from './DocLinkHTML';
|
|
6
|
-
import SignatureHTML from './SignatureHTML';
|
|
7
|
-
import ExperimentalHTML from './ExperimentalHTML';
|
|
8
|
-
import DeprecatedHTML from './DeprecatedHTML';
|
|
9
|
-
|
|
10
|
-
const showInheritedHref = (memberof, parentMemberOf) => {
|
|
11
|
-
const name = memberof.split('~');
|
|
12
|
-
if (name[0] === parentMemberOf) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
Inherited from:{' '}
|
|
18
|
-
<a href={`/doc/class/${memberof.replace('.', '%20')}%20html`}>
|
|
19
|
-
{name.length && name[1]}
|
|
20
|
-
</a>
|
|
21
|
-
</>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* build summary output html by docs.
|
|
26
|
-
* https://github.com/esdoc/esdoc-plugins/blob/2de5022baa569785a189056a99acd1d7ca8284b7/esdoc-publish-html-plugin/src/Builder/DocBuilder.js#L294
|
|
27
|
-
* @param {DocObject[]} docs - target docs.
|
|
28
|
-
* @param {string} title - summary title.
|
|
29
|
-
* @param {boolean} innerLink - if true, link in summary is inner link.
|
|
30
|
-
* @param {boolean} kindIcon - use kind icon.
|
|
31
|
-
* @param {string} memberof - memberof of the parent doc.
|
|
32
|
-
* @return {IceCap} summary output.
|
|
33
|
-
* @protected
|
|
34
|
-
*/
|
|
35
|
-
function SummaryDoc({
|
|
36
|
-
docs,
|
|
37
|
-
// eslint-disable-next-line no-unused-vars
|
|
38
|
-
title,
|
|
39
|
-
innerLink = false,
|
|
40
|
-
kindIcon = false,
|
|
41
|
-
memberof,
|
|
42
|
-
style,
|
|
43
|
-
}) {
|
|
44
|
-
const showInherited = useMemo(() => {
|
|
45
|
-
if (docs.length === 0) return null;
|
|
46
|
-
return ['member', 'method'].includes(docs[0].kind);
|
|
47
|
-
}, [docs]);
|
|
48
|
-
|
|
49
|
-
if (docs.length === 0) return null;
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<table className="summary" data-ice="summary">
|
|
53
|
-
{/* <thead>
|
|
54
|
-
<tr>
|
|
55
|
-
<td data-ice="title" colSpan="2">
|
|
56
|
-
{title}
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
</thead> */}
|
|
60
|
-
<tbody style={style}>
|
|
61
|
-
{docs
|
|
62
|
-
.filter((doc) => doc.access === 'public')
|
|
63
|
-
.map((doc, idx) => {
|
|
64
|
-
const kindKindIcon = doc.interface ? 'interface' : doc.kind;
|
|
65
|
-
return (
|
|
66
|
-
<tr data-ice="target" key={idx}>
|
|
67
|
-
{/* Hide the access (public) column */}
|
|
68
|
-
{/*
|
|
69
|
-
<td>
|
|
70
|
-
<span className="access" data-ice="access">
|
|
71
|
-
{doc.access}
|
|
72
|
-
</span>
|
|
73
|
-
{staticc && <span data-ice="static">{staticc}</span>}
|
|
74
|
-
{kind && (
|
|
75
|
-
<span className="kind" data-ice="kind">
|
|
76
|
-
{kind}
|
|
77
|
-
</span>
|
|
78
|
-
)}
|
|
79
|
-
<span className="abstract" data-ice="abstract">
|
|
80
|
-
{doc.abstract ? 'abstract' : ''}
|
|
81
|
-
</span>
|
|
82
|
-
<span className="override" data-ice="override" />
|
|
83
|
-
</td>
|
|
84
|
-
*/}
|
|
85
|
-
<td>
|
|
86
|
-
<div>
|
|
87
|
-
<p>
|
|
88
|
-
{kindIcon && (
|
|
89
|
-
<span
|
|
90
|
-
data-ice="kind-icon"
|
|
91
|
-
className={`kind-${kindKindIcon}`}
|
|
92
|
-
>
|
|
93
|
-
{kindKindIcon.charAt(0).toUpperCase()}
|
|
94
|
-
</span>
|
|
95
|
-
)}
|
|
96
|
-
<span data-ice="async">{doc.async ? 'async' : ''}</span>
|
|
97
|
-
<span data-ice="generator">
|
|
98
|
-
{doc.generator ? '*' : ''}
|
|
99
|
-
</span>
|
|
100
|
-
<span className="code" data-ice="name">
|
|
101
|
-
<DocLinkHTML
|
|
102
|
-
longname={doc.longname}
|
|
103
|
-
text={
|
|
104
|
-
doc.kind === 'constructor'
|
|
105
|
-
? `new ${
|
|
106
|
-
doc.longname.match(/~([^)]+)#constructor/)[1]
|
|
107
|
-
}`
|
|
108
|
-
: null
|
|
109
|
-
}
|
|
110
|
-
inner={innerLink}
|
|
111
|
-
kind={doc.kind}
|
|
112
|
-
/>
|
|
113
|
-
</span>
|
|
114
|
-
<span className="code" data-ice="signature">
|
|
115
|
-
<SignatureHTML doc={doc} />
|
|
116
|
-
</span>
|
|
117
|
-
</p>
|
|
118
|
-
</div>
|
|
119
|
-
</td>
|
|
120
|
-
<td>
|
|
121
|
-
<div>
|
|
122
|
-
<div className="deprecated" data-ice="deprecated">
|
|
123
|
-
<DeprecatedHTML doc={doc} />
|
|
124
|
-
</div>
|
|
125
|
-
<div className="experimental" data-ice="experimental">
|
|
126
|
-
<ExperimentalHTML doc={doc} />
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div data-ice="description">
|
|
130
|
-
<Markdown>{doc.description}</Markdown>
|
|
131
|
-
</div>
|
|
132
|
-
<div data-ice="inherited">
|
|
133
|
-
{showInherited
|
|
134
|
-
? showInheritedHref(doc.memberof, memberof)
|
|
135
|
-
: null}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</td>
|
|
139
|
-
{doc.version || doc.since ? (
|
|
140
|
-
<td>
|
|
141
|
-
{doc.version && (
|
|
142
|
-
<span className="version" data-ice="version">
|
|
143
|
-
{doc.version}{' '}
|
|
144
|
-
</span>
|
|
145
|
-
)}
|
|
146
|
-
{doc.since && (
|
|
147
|
-
<span className="since" data-ice="since">
|
|
148
|
-
{doc.since}{' '}
|
|
149
|
-
</span>
|
|
150
|
-
)}
|
|
151
|
-
</td>
|
|
152
|
-
) : null}
|
|
153
|
-
</tr>
|
|
154
|
-
);
|
|
155
|
-
})}
|
|
156
|
-
</tbody>
|
|
157
|
-
</table>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
export default React.memo(SummaryDoc);
|