diff --git a/.circleci/config.yml b/.circleci/config.yml index e2c130225d..be228e9a6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: circleci/node:latest-browsers + - image: circleci/node:current-browsers working_directory: ~/repo @@ -11,7 +11,7 @@ jobs: - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} + - v1-dependencies-{{ checksum "package-lock.json" }} - v1-dependencies- - run: @@ -21,7 +21,7 @@ jobs: - save_cache: paths: - node_modules - key: v1-dependencies-{{ checksum "package.json" }} + key: v1-dependencies-{{ checksum "package-lock.json" }} - run: name: Run Tests diff --git a/README.md b/README.md index e933ab6d2b..7c789b6835 100644 --- a/README.md +++ b/README.md @@ -41,29 +41,17 @@ See the following examples for more detail on bundling OpenLayers with your appl * Using [Parcel](https://github.com/openlayers/ol-parcel) * Using [Browserify](https://github.com/openlayers/ol-browserify) -## IntelliSense support and type checking for VS Code +## Sponsors -The `ol` package contains a `src/` folder with JSDoc annotated sources. TypeScript can get type definitions from these sources with a `jsconfig.json` config file in the project root: -```js -{ - "compilerOptions": { - "checkJs": true, - // Point to the JSDoc typed sources when using modules from the ol package - "baseUrl": "./", - "paths": { - "ol": ["node_modules/ol/src"], - "ol/*": ["node_modules/ol/src/*"] - } - }, - "include": [ - "**/*.js", - "node_modules/ol/**/*.js" - ] -} -``` -Project template with this configuration: https://gist.github.com/9a7253cb4712e8bf38d75d8ac898e36c. +OpenLayers appreciates contributions of all kinds. We especially want to thank our fiscal sponsors who contribute to ongoing project maintenance. -Note that the above only works when authoring in plain JavaScript. For similar configurations with a `tsconfig.json` in TypeScript projects, your mileage may vary. +![Pozi logo](./sponsor-logos/pozi.png) + +> Pozi helps connect communities through spatial thinking. +> We love Openlayers and it forms a core part of our platform. +> https://pozi.com/ https://app.pozi.com/ + +See our [Open Collective](https://opencollective.com/openlayers/contribute/sponsors-214/checkout) page if you too are interested in becoming a regular sponsor. ## Supported Browsers diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 865f3858ae..6ade599999 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -1,5 +1,11 @@ ## Upgrade notes +### v6.3.0 + +#### Vector source loading when extent crosses +/-180 + +Previously, when an extent crossed the date line, vector source loaders were called with an extent with 540 degrees of longitude. Now, two loader calls with the visible extent on both sides of the projection extent are issued. This should not require any application code changes, but may affect custom loaders. + ### v6.0.0 #### Backwards incompatible changes @@ -77,7 +83,7 @@ Generally, the responsibility of applying center/rotation/resolutions constraint ##### The view `extent` option now applies to the whole viewport -Previously, this options only constrained the view *center*. This behaviour can still be obtained by specifying `constrainCenterOnly` in the view options. +Previously, this options only constrained the view *center*. This behaviour can still be obtained by specifying `constrainOnlyCenter` in the view options. As a side effect, the view `rotate` method is gone and has been replaced with `adjustRotation` which takes a delta as input. diff --git a/changelog/v6.0.0.md b/changelog/v6.0.0.md index b109e2d2d1..02d7aafb5f 100644 --- a/changelog/v6.0.0.md +++ b/changelog/v6.0.0.md @@ -83,7 +83,7 @@ Generally, the responsibility of applying center/rotation/resolutions constraint ##### The view `extent` option now applies to the whole viewport -Previously, this options only constrained the view *center*. This behaviour can still be obtained by specifying `constrainCenterOnly` in the view options. +Previously, this options only constrained the view *center*. This behaviour can still be obtained by specifying `constrainOnlyCenter` in the view options. As a side effect, the view `rotate` method is gone and has been replaced with `adjustRotation` which takes a delta as input. diff --git a/changelog/v6.2.0.md b/changelog/v6.2.0.md new file mode 100644 index 0000000000..843559c45f --- /dev/null +++ b/changelog/v6.2.0.md @@ -0,0 +1,196 @@ +# 6.2.0 + +With almost 90 pull requests, this release brings several new features, performance improvements and bug fixes. In addition to that, we once again improved the API documentation and the example pages. + +## New features and improvements + +* Mousewheel zooming now brings the same user experience as trackpad zooming. One click on the wheel no longer means a jump of a whole zoom level. Instead, depending on the speed of moving the wheel, the user has fine-grained control over zoom increments/decrements. +* Users now have better control over the initial map viewport when the aspect ratio of the map is different from a specified initial extent. +* Text rendering has been optimized for decluttering and improved for rotated views. This means lower memory footprint and no more blurry text when the map is rotated. **Note:** Whit this change, the label cache has been deprecated. +* A new `displacement` option for icon, circle and regular shape styles makes positioning of point symbolizers more flexible. +* Several improvements have been made to the KML parser for reading styles, bringing the rendered result much closer to Google Earth. +* OpenLayers is now less aggressive on stopping events and preventing event default behavior. This means that users have more control over events, making it easier to use interactive SVGs as layers and to embed maps on scrollable pages. +* Vector tile layers now have a `vector` render mode, which brings improved zooming experience for sources with not too much data. +* We replaced the previous pointer events polyfill to elm-pep, which should work better in web components. + +## List of all changes + + * [#10613](https://github.com/openlayers/openlayers/pull/10613) - Show KML name labels for Points in MultiGeometry ([@mike-000](https://github.com/mike-000)) + * [#10632](https://github.com/openlayers/openlayers/pull/10632) - Draw interaction: Append coordinates to polygons and lines (reworked) ([@jahow](https://github.com/jahow)) + * [#9565](https://github.com/openlayers/openlayers/pull/9565) - Make mousewheel zoom behave like trackpad zoom. ([@dbrnz](https://github.com/dbrnz)) + * [#10580](https://github.com/openlayers/openlayers/pull/10580) - Fix KML Polystyle outline 0 conflict with Linestyle for linestrings ([@mike-000](https://github.com/mike-000)) + * [#10612](https://github.com/openlayers/openlayers/pull/10612) - Make examples work in Internet Explorer ([@ahocevar](https://github.com/ahocevar)) + * [#10587](https://github.com/openlayers/openlayers/pull/10587) - Adds option to View for using larger resolution value when clamping #10586 ([@jeremy-smith-maco](https://github.com/jeremy-smith-maco)) + * [#10607](https://github.com/openlayers/openlayers/pull/10607) - Update elm-pep to fix builds for IE < 11 ([@ahocevar](https://github.com/ahocevar)) + * [#10598](https://github.com/openlayers/openlayers/pull/10598) - Remove inheritDoc to work around JSDoc issue ([@ahocevar](https://github.com/ahocevar)) + * [#10574](https://github.com/openlayers/openlayers/pull/10574) - Text rendering improvements ([@ahocevar](https://github.com/ahocevar)) + * [#10591](https://github.com/openlayers/openlayers/pull/10591) - Remove obsolete license notice ([@ahocevar](https://github.com/ahocevar)) + * [#10588](https://github.com/openlayers/openlayers/pull/10588) - Sort doc navigation properly and add missing modules ([@ahocevar](https://github.com/ahocevar)) + * [#10581](https://github.com/openlayers/openlayers/pull/10581) - Use package-lock.json for the checksum calculation ([@DanielRuf](https://github.com/DanielRuf)) + * [#10584](https://github.com/openlayers/openlayers/pull/10584) - fixed issue with version throwing an error if it is null ([@MrSoUndso](https://github.com/MrSoUndso)) + * [#10575](https://github.com/openlayers/openlayers/pull/10575) - Fix ol/layer/Graticule rendercomplete problem ([@mike-000](https://github.com/mike-000)) + * [#10562](https://github.com/openlayers/openlayers/pull/10562) - Zoomify: Separate the service pixel ratio and the device pixel ratio ([@crubier](https://github.com/crubier)) + * [#10573](https://github.com/openlayers/openlayers/pull/10573) - Replace Bing layer with MapTiler in example ([@mike-000](https://github.com/mike-000)) + * [#10570](https://github.com/openlayers/openlayers/pull/10570) - Use correct extent for the vector image ([@ahocevar](https://github.com/ahocevar)) + * [#10572](https://github.com/openlayers/openlayers/pull/10572) - Assert each layer is only added to the map once ([@ahocevar](https://github.com/ahocevar)) + * [#10563](https://github.com/openlayers/openlayers/pull/10563) - More compatible way of exporting a map as pdf ([@ahocevar](https://github.com/ahocevar)) + * [#10545](https://github.com/openlayers/openlayers/pull/10545) - Make KML point feature styles compatible with declutter ([@mike-000](https://github.com/mike-000)) + * [#10542](https://github.com/openlayers/openlayers/pull/10542) - Replace Bing layer with MapTiler in KML example ([@mike-000](https://github.com/mike-000)) + * [#10543](https://github.com/openlayers/openlayers/pull/10543) - @api tag must not have a value. ([@MoonE](https://github.com/MoonE)) + * [#10547](https://github.com/openlayers/openlayers/pull/10547) - Only generate module apidoc pages when it contains api tags ([@MoonE](https://github.com/MoonE)) + * [#10502](https://github.com/openlayers/openlayers/pull/10502) - Stop events that originate with a removed target ([@walkermatt](https://github.com/walkermatt)) + * [#10527](https://github.com/openlayers/openlayers/pull/10527) - Remove label cache, render text directly to target canvas ([@ahocevar](https://github.com/ahocevar)) + * [#10534](https://github.com/openlayers/openlayers/pull/10534) - [GeoJSON] Read projection from CRS type EPSG ([@wussup](https://github.com/wussup)) + * [#10430](https://github.com/openlayers/openlayers/pull/10430) - Offset regular shape ([@Razi91](https://github.com/Razi91)) + * [#10513](https://github.com/openlayers/openlayers/pull/10513) - fixed flag-name in upgrade notes ([@fgubler](https://github.com/fgubler)) + * [#10504](https://github.com/openlayers/openlayers/pull/10504) - Fix for reset north when rotation is 360 degrees ([@mike-000](https://github.com/mike-000)) + * [#10510](https://github.com/openlayers/openlayers/pull/10510) - Remove build/apidoc before running jsdoc again ([@MoonE](https://github.com/MoonE)) + * [#10498](https://github.com/openlayers/openlayers/pull/10498) - Fixing issue #10497 on behalf of LarryHuang ([@gazza0](https://github.com/gazza0)) + * [#10496](https://github.com/openlayers/openlayers/pull/10496) - Do not stop events when dragging ([@ahocevar](https://github.com/ahocevar)) + * [#10478](https://github.com/openlayers/openlayers/pull/10478) - Do not abort and dispose of tiles ([@ahocevar](https://github.com/ahocevar)) + * [#10495](https://github.com/openlayers/openlayers/pull/10495) - typo in view.fit ([@danielklim](https://github.com/danielklim)) + * [#10473](https://github.com/openlayers/openlayers/pull/10473) - Fix for undefined source in Vector layer ([@mike-000](https://github.com/mike-000)) + * [#10484](https://github.com/openlayers/openlayers/pull/10484) - Use a function to get the value of the gradient ([@fredj](https://github.com/fredj)) + * [#10262](https://github.com/openlayers/openlayers/pull/10262) - Rework to make Document and XMLSerializer lazy and injectable ([@bjornharrtell](https://github.com/bjornharrtell)) + * [#10461](https://github.com/openlayers/openlayers/pull/10461) - Fix link in apidocs to ObjectEvent. ([@MoonE](https://github.com/MoonE)) + * [#10413](https://github.com/openlayers/openlayers/pull/10413) - Limit the ZoomSlider's range to the view's constrained resolution. ([@MoonE](https://github.com/MoonE)) + * [#10438](https://github.com/openlayers/openlayers/pull/10438) - Avoid accessing the DOM to read the viewport size too often ([@jahow](https://github.com/jahow)) + * [#10439](https://github.com/openlayers/openlayers/pull/10439) - WebGL points layer / add support for symbol rotation ([@jahow](https://github.com/jahow)) + * [#10434](https://github.com/openlayers/openlayers/pull/10434) - Disable image smoothing for the DEM source in the Sea Level example ([@mike-000](https://github.com/mike-000)) + * [#10417](https://github.com/openlayers/openlayers/pull/10417) - Replace Bing layer with MapTiler ([@mike-000](https://github.com/mike-000)) + * [#10415](https://github.com/openlayers/openlayers/pull/10415) - Control button span element pointer events ([@mike-000](https://github.com/mike-000)) + * [#10409](https://github.com/openlayers/openlayers/pull/10409) - Improve viewport computation in WebGL Postprocessing ([@jahow](https://github.com/jahow)) + * [#10119](https://github.com/openlayers/openlayers/pull/10119) - Add crossOrigin option to ol/format/KML for icons ([@mike-000](https://github.com/mike-000)) + * [#10181](https://github.com/openlayers/openlayers/pull/10181) - add tags to example docs ([@roemhildtg](https://github.com/roemhildtg)) + * [#10407](https://github.com/openlayers/openlayers/pull/10407) - Use render feature compatible extent check ([@ahocevar](https://github.com/ahocevar)) + * [#10340](https://github.com/openlayers/openlayers/pull/10340) - Draw circles and custom geometry in user coordinates ([@mike-000](https://github.com/mike-000)) + * [#10393](https://github.com/openlayers/openlayers/pull/10393) - getFeaturesInExtent function for ol/source/VectorTile ([@ahocevar](https://github.com/ahocevar)) + * [#10402](https://github.com/openlayers/openlayers/pull/10402) - Do not preventDefault on pointerdown ([@ahocevar](https://github.com/ahocevar)) + * [#10269](https://github.com/openlayers/openlayers/pull/10269) - Replace the BNG layer source in the Raster Reprojection example ([@mike-000](https://github.com/mike-000)) + * [#10394](https://github.com/openlayers/openlayers/pull/10394) - Remove map renderer element when disposing ([@ahocevar](https://github.com/ahocevar)) + * [#10391](https://github.com/openlayers/openlayers/pull/10391) - Use box-shadow css instead of filter ([@ahocevar](https://github.com/ahocevar)) + * [#10392](https://github.com/openlayers/openlayers/pull/10392) - Fix interim tile handing for vector tiles ([@ahocevar](https://github.com/ahocevar)) + * [#10380](https://github.com/openlayers/openlayers/pull/10380) - Adjust examples for layer canvas pixel ratio and rotation ([@mike-000](https://github.com/mike-000)) + * [#10384](https://github.com/openlayers/openlayers/pull/10384) - Include Transform typedef in API ([@mike-000](https://github.com/mike-000)) + * [#10385](https://github.com/openlayers/openlayers/pull/10385) - Import transpiled rbush ([@walkermatt](https://github.com/walkermatt)) + * [#10363](https://github.com/openlayers/openlayers/pull/10363) - Interactive SVG layer example ([@ahocevar](https://github.com/ahocevar)) + * [#10120](https://github.com/openlayers/openlayers/pull/10120) - Resolve constraints using anchor if following a cancelled animation ([@mike-000](https://github.com/mike-000)) + * [#10370](https://github.com/openlayers/openlayers/pull/10370) - Replace Bing layer with MapTiler ([@mike-000](https://github.com/mike-000)) + * [#10362](https://github.com/openlayers/openlayers/pull/10362) - Remove line that was accidently added with #10332 ([@ahocevar](https://github.com/ahocevar)) + * [#10309](https://github.com/openlayers/openlayers/pull/10309) - Bring back vector render mode for vector tile layers ([@ahocevar](https://github.com/ahocevar)) + * [#10332](https://github.com/openlayers/openlayers/pull/10332) - Conditional default prevention instead of touch-action: none ([@ahocevar](https://github.com/ahocevar)) + * [#10301](https://github.com/openlayers/openlayers/pull/10301) - Create hit detection data per layer and without requestAnimationFrame ([@ahocevar](https://github.com/ahocevar)) + * [#10347](https://github.com/openlayers/openlayers/pull/10347) - Set utfgrid tile as loaded after load instead of empty ([@adube](https://github.com/adube)) + * [#10344](https://github.com/openlayers/openlayers/pull/10344) - Fix lazy UTFGrid loading ([@ahocevar](https://github.com/ahocevar)) + * [#10321](https://github.com/openlayers/openlayers/pull/10321) - Support touch events for DragBox interaction ([@greggian](https://github.com/greggian)) + * [#10315](https://github.com/openlayers/openlayers/pull/10315) - Replace Bing sources in some examples ([@mike-000](https://github.com/mike-000)) + * [#10330](https://github.com/openlayers/openlayers/pull/10330) - Fix modifying circle geometries ([@greggian](https://github.com/greggian)) + * [#10318](https://github.com/openlayers/openlayers/pull/10318) - Use a minimalist pointer events polyfill ([@ahocevar](https://github.com/ahocevar)) + * [#10322](https://github.com/openlayers/openlayers/pull/10322) - Update tile grid option descriptions ([@mike-000](https://github.com/mike-000)) + * [#10308](https://github.com/openlayers/openlayers/pull/10308) - Fix feature lookup after removal of alpha ([@ahocevar](https://github.com/ahocevar)) + * [#10310](https://github.com/openlayers/openlayers/pull/10310) - Ensure that OverviewMap respects the initial rotation of attached Maps ([@brianhelba](https://github.com/brianhelba)) + * [#10302](https://github.com/openlayers/openlayers/pull/10302) - Do not use Math.sign() to support very old browsers ([@ahocevar](https://github.com/ahocevar)) + * [#10295](https://github.com/openlayers/openlayers/pull/10295) - Do not fail when hit detecting features without style ([@ahocevar](https://github.com/ahocevar)) + * [#10293](https://github.com/openlayers/openlayers/pull/10293) - Do not hit detect while tile is loading ([@ahocevar](https://github.com/ahocevar)) + * [#10292](https://github.com/openlayers/openlayers/pull/10292) - Fix typo in jsdoc in ol/source/WMTS ([@jomue](https://github.com/jomue)) + * [#10291](https://github.com/openlayers/openlayers/pull/10291) - tabindex without focus condition ([@ahocevar](https://github.com/ahocevar)) + * [#10286](https://github.com/openlayers/openlayers/pull/10286) - Use passive option to avoid Chrome warning ([@ahocevar](https://github.com/ahocevar)) + * [#10285](https://github.com/openlayers/openlayers/pull/10285) - Fix WMS GetLegendGraphic example codesandbox error ([@mike-000](https://github.com/mike-000)) + * [#10283](https://github.com/openlayers/openlayers/pull/10283) - Use the originalEvent in the targetNotEditable condition ([@fredj](https://github.com/fredj)) + * [#10282](https://github.com/openlayers/openlayers/pull/10282) - Fix documentation of Stroke.lineDash default value ([@jansule](https://github.com/jansule)) + * [#10259](https://github.com/openlayers/openlayers/pull/10259) - Remove all the sketch features in abortDrawing ([@fredj](https://github.com/fredj)) + * [#10265](https://github.com/openlayers/openlayers/pull/10265) - Update operators doc in WebGL points layer example ([@fredj](https://github.com/fredj)) + * [#10256](https://github.com/openlayers/openlayers/pull/10256) - Do not bypass measureTextWidth ([@ahocevar](https://github.com/ahocevar)) + * [#10264](https://github.com/openlayers/openlayers/pull/10264) - Remove unused variable from vertex shader ([@fredj](https://github.com/fredj)) + * [#10257](https://github.com/openlayers/openlayers/pull/10257) - Allow View.adjust* methods to take a null opt_anchor ([@brianhelba](https://github.com/brianhelba)) + * [#10261](https://github.com/openlayers/openlayers/pull/10261) - WebGL / do not throw error when shader compilation gives a warning ([@jahow](https://github.com/jahow)) + * [#10255](https://github.com/openlayers/openlayers/pull/10255) - Don't use instanceof HTMLElement in handleMapBrowserEvent ([@fredj](https://github.com/fredj)) + + +
+ Dependency Updates + + * [#10629](https://github.com/openlayers/openlayers/pull/10629) - Bump ol-mapbox-style from 6.0.0 to 6.0.1 ([@openlayers](https://github.com/openlayers)) + * [#10628](https://github.com/openlayers/openlayers/pull/10628) - Bump puppeteer from 2.1.0 to 2.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10627](https://github.com/openlayers/openlayers/pull/10627) - Bump handlebars from 4.7.2 to 4.7.3 ([@openlayers](https://github.com/openlayers)) + * [#10626](https://github.com/openlayers/openlayers/pull/10626) - Bump webpack-dev-server from 3.10.2 to 3.10.3 ([@openlayers](https://github.com/openlayers)) + * [#10600](https://github.com/openlayers/openlayers/pull/10600) - Bump puppeteer from 2.0.0 to 2.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10606](https://github.com/openlayers/openlayers/pull/10606) - Bump @babel/core from 7.8.3 to 7.8.4 ([@openlayers](https://github.com/openlayers)) + * [#10605](https://github.com/openlayers/openlayers/pull/10605) - Bump webpack-dev-server from 3.10.1 to 3.10.2 ([@openlayers](https://github.com/openlayers)) + * [#10604](https://github.com/openlayers/openlayers/pull/10604) - Bump rollup from 1.29.1 to 1.31.0 ([@openlayers](https://github.com/openlayers)) + * [#10603](https://github.com/openlayers/openlayers/pull/10603) - Bump @babel/preset-env from 7.8.3 to 7.8.4 ([@openlayers](https://github.com/openlayers)) + * [#10602](https://github.com/openlayers/openlayers/pull/10602) - Bump url-polyfill from 1.1.7 to 1.1.8 ([@openlayers](https://github.com/openlayers)) + * [#10601](https://github.com/openlayers/openlayers/pull/10601) - Bump terser-webpack-plugin from 2.3.2 to 2.3.4 ([@openlayers](https://github.com/openlayers)) + * [#10578](https://github.com/openlayers/openlayers/pull/10578) - Bump sinon from 8.1.0 to 8.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10577](https://github.com/openlayers/openlayers/pull/10577) - Bump mocha from 7.0.0 to 7.0.1 ([@openlayers](https://github.com/openlayers)) + * [#10576](https://github.com/openlayers/openlayers/pull/10576) - Bump rollup from 1.29.0 to 1.29.1 ([@openlayers](https://github.com/openlayers)) + * [#10551](https://github.com/openlayers/openlayers/pull/10551) - Bump handlebars from 4.7.1 to 4.7.2 ([@openlayers](https://github.com/openlayers)) + * [#10550](https://github.com/openlayers/openlayers/pull/10550) - Bump @babel/preset-env from 7.8.2 to 7.8.3 ([@openlayers](https://github.com/openlayers)) + * [#10549](https://github.com/openlayers/openlayers/pull/10549) - Bump sinon from 8.0.4 to 8.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10548](https://github.com/openlayers/openlayers/pull/10548) - Bump @babel/core from 7.8.0 to 7.8.3 ([@openlayers](https://github.com/openlayers)) + * [#10518](https://github.com/openlayers/openlayers/pull/10518) - Bump front-matter from 3.0.2 to 3.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10516](https://github.com/openlayers/openlayers/pull/10516) - Bump handlebars from 4.5.3 to 4.7.1 ([@openlayers](https://github.com/openlayers)) + * [#10514](https://github.com/openlayers/openlayers/pull/10514) - Bump terser-webpack-plugin from 2.3.1 to 2.3.2 ([@openlayers](https://github.com/openlayers)) + * [#10523](https://github.com/openlayers/openlayers/pull/10523) - Bump sinon from 8.0.2 to 8.0.4 ([@openlayers](https://github.com/openlayers)) + * [#10515](https://github.com/openlayers/openlayers/pull/10515) - Bump @babel/preset-env from 7.7.7 to 7.8.2 ([@openlayers](https://github.com/openlayers)) + * [#10517](https://github.com/openlayers/openlayers/pull/10517) - Bump karma-firefox-launcher from 1.2.0 to 1.3.0 ([@openlayers](https://github.com/openlayers)) + * [#10519](https://github.com/openlayers/openlayers/pull/10519) - Bump @babel/core from 7.7.7 to 7.8.0 ([@openlayers](https://github.com/openlayers)) + * [#10520](https://github.com/openlayers/openlayers/pull/10520) - Bump globby from 10.0.1 to 11.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10521](https://github.com/openlayers/openlayers/pull/10521) - Bump rollup-plugin-terser from 5.1.3 to 5.2.0 ([@openlayers](https://github.com/openlayers)) + * [#10522](https://github.com/openlayers/openlayers/pull/10522) - Bump rollup from 1.28.0 to 1.29.0 ([@openlayers](https://github.com/openlayers)) + * [#10480](https://github.com/openlayers/openlayers/pull/10480) - Bump mocha from 6.2.2 to 7.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10482](https://github.com/openlayers/openlayers/pull/10482) - Bump sinon from 8.0.1 to 8.0.2 ([@openlayers](https://github.com/openlayers)) + * [#10481](https://github.com/openlayers/openlayers/pull/10481) - Bump yargs from 15.0.2 to 15.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10479](https://github.com/openlayers/openlayers/pull/10479) - Bump rollup from 1.27.14 to 1.28.0 ([@openlayers](https://github.com/openlayers)) + * [#10466](https://github.com/openlayers/openlayers/pull/10466) - Bump webpack from 4.41.4 to 4.41.5 ([@openlayers](https://github.com/openlayers)) + * [#10467](https://github.com/openlayers/openlayers/pull/10467) - Bump sinon from 8.0.0 to 8.0.1 ([@openlayers](https://github.com/openlayers)) + * [#10450](https://github.com/openlayers/openlayers/pull/10450) - Bump @babel/core from 7.7.5 to 7.7.7 ([@openlayers](https://github.com/openlayers)) + * [#10449](https://github.com/openlayers/openlayers/pull/10449) - Bump eslint from 6.7.2 to 6.8.0 ([@openlayers](https://github.com/openlayers)) + * [#10448](https://github.com/openlayers/openlayers/pull/10448) - Bump rollup from 1.27.13 to 1.27.14 ([@openlayers](https://github.com/openlayers)) + * [#10447](https://github.com/openlayers/openlayers/pull/10447) - Bump @babel/preset-env from 7.7.6 to 7.7.7 ([@openlayers](https://github.com/openlayers)) + * [#10446](https://github.com/openlayers/openlayers/pull/10446) - Bump sinon from 7.5.0 to 8.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10445](https://github.com/openlayers/openlayers/pull/10445) - Bump webpack from 4.41.2 to 4.41.4 ([@openlayers](https://github.com/openlayers)) + * [#10444](https://github.com/openlayers/openlayers/pull/10444) - Bump terser-webpack-plugin from 2.3.0 to 2.3.1 ([@openlayers](https://github.com/openlayers)) + * [#10443](https://github.com/openlayers/openlayers/pull/10443) - Bump webpack-dev-server from 3.9.0 to 3.10.1 ([@openlayers](https://github.com/openlayers)) + * [#10425](https://github.com/openlayers/openlayers/pull/10425) - Bump elm-pep from 1.0.2 to 1.0.3 ([@openlayers](https://github.com/openlayers)) + * [#10427](https://github.com/openlayers/openlayers/pull/10427) - Bump webpack-cli from 3.3.2 to 3.3.10 ([@openlayers](https://github.com/openlayers)) + * [#10426](https://github.com/openlayers/openlayers/pull/10426) - Bump copy-webpack-plugin from 5.0.5 to 5.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10424](https://github.com/openlayers/openlayers/pull/10424) - Bump eslint from 6.7.1 to 6.7.2 ([@openlayers](https://github.com/openlayers)) + * [#10423](https://github.com/openlayers/openlayers/pull/10423) - Bump marked from 0.7.0 to 0.8.0 ([@openlayers](https://github.com/openlayers)) + * [#10422](https://github.com/openlayers/openlayers/pull/10422) - Bump url-polyfill from 1.1.5 to 1.1.7 ([@openlayers](https://github.com/openlayers)) + * [#10421](https://github.com/openlayers/openlayers/pull/10421) - Bump rollup-plugin-terser from 5.1.2 to 5.1.3 ([@openlayers](https://github.com/openlayers)) + * [#10420](https://github.com/openlayers/openlayers/pull/10420) - Bump terser-webpack-plugin from 2.2.2 to 2.3.0 ([@openlayers](https://github.com/openlayers)) + * [#10419](https://github.com/openlayers/openlayers/pull/10419) - Bump rollup from 1.27.9 to 1.27.13 ([@openlayers](https://github.com/openlayers)) + * [#10418](https://github.com/openlayers/openlayers/pull/10418) - Bump babel-loader from 8.0.5 to 8.0.6 ([@openlayers](https://github.com/openlayers)) + * [#10399](https://github.com/openlayers/openlayers/pull/10399) - Bump rollup from 1.25.1 to 1.27.9 ([@openlayers](https://github.com/openlayers)) + * [#10398](https://github.com/openlayers/openlayers/pull/10398) - Bump terser-webpack-plugin from 2.2.1 to 2.2.2 ([@openlayers](https://github.com/openlayers)) + * [#10397](https://github.com/openlayers/openlayers/pull/10397) - Bump @babel/core from 7.7.4 to 7.7.5 ([@openlayers](https://github.com/openlayers)) + * [#10396](https://github.com/openlayers/openlayers/pull/10396) - Bump @babel/preset-env from 7.7.4 to 7.7.6 ([@openlayers](https://github.com/openlayers)) + * [#10365](https://github.com/openlayers/openlayers/pull/10365) - Bump @babel/preset-env from 7.6.3 to 7.7.4 ([@openlayers](https://github.com/openlayers)) + * [#10366](https://github.com/openlayers/openlayers/pull/10366) - Bump karma-coverage-istanbul-reporter from 2.1.0 to 2.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10367](https://github.com/openlayers/openlayers/pull/10367) - Bump coveralls from 3.0.7 to 3.0.9 ([@openlayers](https://github.com/openlayers)) + * [#10368](https://github.com/openlayers/openlayers/pull/10368) - Bump sinon from 7.3.2 to 7.5.0 ([@openlayers](https://github.com/openlayers)) + * [#10369](https://github.com/openlayers/openlayers/pull/10369) - Bump @babel/core from 7.7.2 to 7.7.4 ([@openlayers](https://github.com/openlayers)) + * [#10337](https://github.com/openlayers/openlayers/pull/10337) - Bump fs-extra from 8.0.1 to 8.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10336](https://github.com/openlayers/openlayers/pull/10336) - Bump eslint from 6.6.0 to 6.7.1 ([@openlayers](https://github.com/openlayers)) + * [#10335](https://github.com/openlayers/openlayers/pull/10335) - Bump yargs from 14.2.0 to 15.0.2 ([@openlayers](https://github.com/openlayers)) + * [#10334](https://github.com/openlayers/openlayers/pull/10334) - Bump webpack-dev-middleware from 3.6.2 to 3.7.2 ([@openlayers](https://github.com/openlayers)) + * [#10333](https://github.com/openlayers/openlayers/pull/10333) - Bump copy-webpack-plugin from 5.0.4 to 5.0.5 ([@openlayers](https://github.com/openlayers)) + * [#10306](https://github.com/openlayers/openlayers/pull/10306) - Bump puppeteer from 1.20.0 to 2.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10307](https://github.com/openlayers/openlayers/pull/10307) - Bump @babel/core from 7.6.4 to 7.7.2 ([@openlayers](https://github.com/openlayers)) + * [#10305](https://github.com/openlayers/openlayers/pull/10305) - Bump proj4 from 2.5.0 to 2.6.0 ([@openlayers](https://github.com/openlayers)) + * [#10304](https://github.com/openlayers/openlayers/pull/10304) - Bump handlebars from 4.4.5 to 4.5.3 ([@openlayers](https://github.com/openlayers)) + * [#10303](https://github.com/openlayers/openlayers/pull/10303) - Bump glob from 7.1.5 to 7.1.6 ([@openlayers](https://github.com/openlayers)) + * [#10280](https://github.com/openlayers/openlayers/pull/10280) - Bump rollup-plugin-commonjs from 10.0.0 to 10.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10279](https://github.com/openlayers/openlayers/pull/10279) - Bump rollup-plugin-terser from 5.0.0 to 5.1.2 ([@openlayers](https://github.com/openlayers)) + * [#10278](https://github.com/openlayers/openlayers/pull/10278) - Bump eslint from 6.0.0 to 6.6.0 ([@openlayers](https://github.com/openlayers)) + * [#10277](https://github.com/openlayers/openlayers/pull/10277) - Bump karma-webpack from 4.0.0-rc.6 to 4.0.2 ([@openlayers](https://github.com/openlayers)) + * [#10276](https://github.com/openlayers/openlayers/pull/10276) - Bump webpack-dev-server from 3.3.1 to 3.9.0 ([@openlayers](https://github.com/openlayers)) + * [#10251](https://github.com/openlayers/openlayers/pull/10251) - Bump @babel/preset-env from 7.4.4 to 7.6.3 ([@openlayers](https://github.com/openlayers)) + * [#10250](https://github.com/openlayers/openlayers/pull/10250) - Bump buble from 0.19.7 to 0.19.8 ([@openlayers](https://github.com/openlayers)) + * [#10249](https://github.com/openlayers/openlayers/pull/10249) - Bump karma-firefox-launcher from 1.1.0 to 1.2.0 ([@openlayers](https://github.com/openlayers)) + * [#10248](https://github.com/openlayers/openlayers/pull/10248) - Bump html-to-image from 0.1.0 to 0.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10247](https://github.com/openlayers/openlayers/pull/10247) - Bump terser-webpack-plugin from 2.0.1 to 2.2.1 ([@openlayers](https://github.com/openlayers)) + + +
diff --git a/changelog/v6.2.1.md b/changelog/v6.2.1.md new file mode 100644 index 0000000000..17bb2f2ab0 --- /dev/null +++ b/changelog/v6.2.1.md @@ -0,0 +1,13 @@ +# 6.2.1 + +This is a bugfix release which resolves bundler issues due to a circular dependency, and brings a few documentation and example fixes. + +## List of all changes + + * [#10656](https://github.com/openlayers/openlayers/pull/10656) - Fix for export PDF example compatibility issues, and layer opacity handling. ([@mike-000](https://github.com/mike-000)) + * [#10653](https://github.com/openlayers/openlayers/pull/10653) - More reliable check for module content beyond classes ([@ahocevar](https://github.com/ahocevar)) + * [#10617](https://github.com/openlayers/openlayers/pull/10617) - Improve apidoc generation performance ([@MoonE](https://github.com/MoonE)) + * [#10625](https://github.com/openlayers/openlayers/pull/10625) - Apidoc cleanup navigation html ([@MoonE](https://github.com/MoonE)) + * [#10649](https://github.com/openlayers/openlayers/pull/10649) - Remove circular dependency ([@ahocevar](https://github.com/ahocevar)) + * [#10637](https://github.com/openlayers/openlayers/pull/10637) - Develop on 6.2.1 ([@openlayers](https://github.com/openlayers)) + diff --git a/changelog/v6.3.0.md b/changelog/v6.3.0.md new file mode 100644 index 0000000000..1107121b15 --- /dev/null +++ b/changelog/v6.3.0.md @@ -0,0 +1,123 @@ +# 6.3.0 + +With more than 70 pull requests, this release not only brings significant improvements to the API documentation. It also fixes some old bugs and brings frequently requested improvments. And good news for TypeScript users: OpenLayers now ships with type definitions in `.d.ts` files. + +## New features and improvements + +* Several improvements to the Graticule layer, like consistent labeling, no more missing graticule lines, and it now works for views that cross the date line. +* Better support for KML icon colors, as well as fills and outlines in PolyStyle +* Better `ol/Overlay` performance and support for panning off-screen overlays into view +* Most of the rendering code can now be run in web workers, e.g. to render to an OffscreenCanvas +* OpenLayers now works fine in web components with shadow root +* WebGL point layers now support rotation based on feature attributes + +## List of all changes + + * [#10490](https://github.com/openlayers/openlayers/pull/10490) - Select style multiple select interactions removed ([@bepremeg](https://github.com/bepremeg)) + * [#10531](https://github.com/openlayers/openlayers/pull/10531) - Dynamically chose the number of subdivisions based on the size of the Image to reproject ([@pjsg](https://github.com/pjsg)) + * [#10618](https://github.com/openlayers/openlayers/pull/10618) - Add apidoc-debug task to debug the apidoc generation process ([@MoonE](https://github.com/MoonE)) + * [#10343](https://github.com/openlayers/openlayers/pull/10343) - Correct interactions with circle geometries when using user coordinates ([@mike-000](https://github.com/mike-000)) + * [#10864](https://github.com/openlayers/openlayers/pull/10864) - Update dependencies ([@ahocevar](https://github.com/ahocevar)) + * [#10859](https://github.com/openlayers/openlayers/pull/10859) - Add an example of clipping layer based on a vector source ([@SDaron](https://github.com/SDaron)) + * [#10850](https://github.com/openlayers/openlayers/pull/10850) - API docs for enums ([@ahocevar](https://github.com/ahocevar)) + * [#10857](https://github.com/openlayers/openlayers/pull/10857) - Make OSM XML example work at dateline and replace Bing with MapTiler ([@mike-000](https://github.com/mike-000)) + * [#10858](https://github.com/openlayers/openlayers/pull/10858) - Perform auto-pan when adding an Overlay to a Map ([@ejn](https://github.com/ejn)) + * [#10646](https://github.com/openlayers/openlayers/pull/10646) - Write fill and outline in KML PolyStyle ([@mike-000](https://github.com/mike-000)) + * [#10800](https://github.com/openlayers/openlayers/pull/10800) - Make Overlay.panIntoView an API method ([@ejn](https://github.com/ejn)) + * [#10807](https://github.com/openlayers/openlayers/pull/10807) - Handle Graticule wrapX without calculating excess meridians ([@mike-000](https://github.com/mike-000)) + * [#10795](https://github.com/openlayers/openlayers/pull/10795) - Show graticule labels in wrapped worlds ([@mike-000](https://github.com/mike-000)) + * [#10824](https://github.com/openlayers/openlayers/pull/10824) - Fix drawing svg icon with color option in ie11 ([@MoonE](https://github.com/MoonE)) + * [#10802](https://github.com/openlayers/openlayers/pull/10802) - Apidoc add default-exported enums ([@MoonE](https://github.com/MoonE)) + * [#10805](https://github.com/openlayers/openlayers/pull/10805) - make ImageSourceEventType available for consumers ([@regileeso](https://github.com/regileeso)) + * [#10822](https://github.com/openlayers/openlayers/pull/10822) - parsing color from IconStyle in KML files ([@lysek](https://github.com/lysek)) + * [#10848](https://github.com/openlayers/openlayers/pull/10848) - Speed up Overlay element positioning using CSS translate() ([@horsenit](https://github.com/horsenit)) + * [#9590](https://github.com/openlayers/openlayers/pull/9590) - Calculate tile grid extent from extent of bottom-level tile matrix ([@mloskot](https://github.com/mloskot)) + * [#10845](https://github.com/openlayers/openlayers/pull/10845) - Fix createHitDetectionImageData error for features with no size ([@gedaiu](https://github.com/gedaiu)) + * [#10842](https://github.com/openlayers/openlayers/pull/10842) - Fix custom symbol example short description ([@mike-000](https://github.com/mike-000)) + * [#10828](https://github.com/openlayers/openlayers/pull/10828) - Offscreen canvas example ([@ahocevar](https://github.com/ahocevar)) + * [#10816](https://github.com/openlayers/openlayers/pull/10816) - Add 'funding' field to `package.json` ([@marcjansen](https://github.com/marcjansen)) + * [#10813](https://github.com/openlayers/openlayers/pull/10813) - Add sponsors section to the readme ([@tschaub](https://github.com/tschaub)) + * [#10474](https://github.com/openlayers/openlayers/pull/10474) - Fix for undefined source in Image layer ([@mike-000](https://github.com/mike-000)) + * [#10785](https://github.com/openlayers/openlayers/pull/10785) - Detect Zoomify server-side retina tiles ([@ahocevar](https://github.com/ahocevar)) + * [#10787](https://github.com/openlayers/openlayers/pull/10787) - Improved projection extent in the "Reprojection with EPSG.io Search" example ([@mike-000](https://github.com/mike-000)) + * [#10792](https://github.com/openlayers/openlayers/pull/10792) - Add support for EventListener Object ([@flexjoly](https://github.com/flexjoly)) + * [#10777](https://github.com/openlayers/openlayers/pull/10777) - Keep the render loop running during simulation ([@ahocevar](https://github.com/ahocevar)) + * [#10791](https://github.com/openlayers/openlayers/pull/10791) - iOS 12 touchmove: Prevent touchmove event default when no preceding pointer event ([@sosmo](https://github.com/sosmo)) + * [#10786](https://github.com/openlayers/openlayers/pull/10786) - Resolve constraints when updating size ([@ahocevar](https://github.com/ahocevar)) + * [#10788](https://github.com/openlayers/openlayers/pull/10788) - Add safeguard to handleTouchMove ([@sosmo](https://github.com/sosmo)) + * [#10722](https://github.com/openlayers/openlayers/pull/10722) - fix: handle layer clear event in case clear(true) called ([@jellyedwards](https://github.com/jellyedwards)) + * [#10723](https://github.com/openlayers/openlayers/pull/10723) - Improve the extent transforms used by Graticule and handle extents crossing the dateline ([@mike-000](https://github.com/mike-000)) + * [#10744](https://github.com/openlayers/openlayers/pull/10744) - Ensure the Modify Features Test example opens at correct zoom ([@mike-000](https://github.com/mike-000)) + * [#10767](https://github.com/openlayers/openlayers/pull/10767) - Replace Bing layer with MapTiler in examples ([@mike-000](https://github.com/mike-000)) + * [#10751](https://github.com/openlayers/openlayers/pull/10751) - Sort events / observables in all cases ([@MoonE](https://github.com/MoonE)) + * [#10763](https://github.com/openlayers/openlayers/pull/10763) - TypeScript: Fix inconsistent optionality in various APIs ([@jumpinjackie](https://github.com/jumpinjackie)) + * [#10758](https://github.com/openlayers/openlayers/pull/10758) - Allow using feature attributes for symbol rotation in WebGL layers ([@jahow](https://github.com/jahow)) + * [#10748](https://github.com/openlayers/openlayers/pull/10748) - Fix "Cannot read property 'anchor' of undefined" in ol/View ([@mike-000](https://github.com/mike-000)) + * [#10746](https://github.com/openlayers/openlayers/pull/10746) - Fix building apidoc on windows ([@MoonE](https://github.com/MoonE)) + * [#10720](https://github.com/openlayers/openlayers/pull/10720) - Apidoc better search ([@MoonE](https://github.com/MoonE)) + * [#10743](https://github.com/openlayers/openlayers/pull/10743) - Ignore user provided tile cache size when too small ([@ahocevar](https://github.com/ahocevar)) + * [#10736](https://github.com/openlayers/openlayers/pull/10736) - Allow cluster source to unlisten from its source ([@M393](https://github.com/M393)) + * [#10739](https://github.com/openlayers/openlayers/pull/10739) - Fix typo in trackpad timeout ([@ahocevar](https://github.com/ahocevar)) + * [#10740](https://github.com/openlayers/openlayers/pull/10740) - Document tabindex behavior for MouseWheelZoom and DragPan ([@matthias-ccri](https://github.com/matthias-ccri)) + * [#10738](https://github.com/openlayers/openlayers/pull/10738) - Fix text background decluttering ([@ahocevar](https://github.com/ahocevar)) + * [#10715](https://github.com/openlayers/openlayers/pull/10715) - Fix disappearing graticule labels when rotation returns to 0 ([@mike-000](https://github.com/mike-000)) + * [#10713](https://github.com/openlayers/openlayers/pull/10713) - Draw graticule labels in a postrender function ([@mike-000](https://github.com/mike-000)) + * [#10711](https://github.com/openlayers/openlayers/pull/10711) - Make sure that optional args are typed accordingly ([@ahocevar](https://github.com/ahocevar)) + * [#10710](https://github.com/openlayers/openlayers/pull/10710) - Fix stylefunction return type ([@ahocevar](https://github.com/ahocevar)) + * [#10709](https://github.com/openlayers/openlayers/pull/10709) - Fix type and documentation of style function ([@ahocevar](https://github.com/ahocevar)) + * [#10708](https://github.com/openlayers/openlayers/pull/10708) - Handle Select interactions with falsey select style ([@ahocevar](https://github.com/ahocevar)) + * [#10707](https://github.com/openlayers/openlayers/pull/10707) - Get default projection for overview map from main map. ([@AugustusKling](https://github.com/AugustusKling)) + * [#10699](https://github.com/openlayers/openlayers/pull/10699) - Make Select interaction work when there are multiple instances ([@ahocevar](https://github.com/ahocevar)) + * [#10694](https://github.com/openlayers/openlayers/pull/10694) - Draw image with configured opacity ([@M393](https://github.com/M393)) + * [#10703](https://github.com/openlayers/openlayers/pull/10703) - CI and test fixes ([@ahocevar](https://github.com/ahocevar)) + * [#10698](https://github.com/openlayers/openlayers/pull/10698) - Shadow root ([@ahocevar](https://github.com/ahocevar)) + * [#10688](https://github.com/openlayers/openlayers/pull/10688) - Publish type definition files ([@ahocevar](https://github.com/ahocevar)) + * [#10691](https://github.com/openlayers/openlayers/pull/10691) - Do not exceed color range ([@ahocevar](https://github.com/ahocevar)) + * [#10683](https://github.com/openlayers/openlayers/pull/10683) - Dispatch enterfullscreen and leavefullscreen from the FullScreen control ([@fredj](https://github.com/fredj)) + * [#10676](https://github.com/openlayers/openlayers/pull/10676) - Document that overviewmap view must use same projection as main map ([@mike-000](https://github.com/mike-000)) + * [#10678](https://github.com/openlayers/openlayers/pull/10678) - Add maxResolution option to ol/tilegrid.createXYZ() and ol/source/XYZ ([@mike-000](https://github.com/mike-000)) + * [#10690](https://github.com/openlayers/openlayers/pull/10690) - Document minZoom and maxZoom options for all layers ([@mike-000](https://github.com/mike-000)) + * [#10672](https://github.com/openlayers/openlayers/pull/10672) - Nicer mousewheel and trackpad zooming ([@ahocevar](https://github.com/ahocevar)) + * [#10687](https://github.com/openlayers/openlayers/pull/10687) - Increase timeout in listenImage test ([@fredj](https://github.com/fredj)) + * [#10684](https://github.com/openlayers/openlayers/pull/10684) - perf: only do expensive reload when texture changes ([@jellyedwards](https://github.com/jellyedwards)) + * [#10675](https://github.com/openlayers/openlayers/pull/10675) - typo ([@jipexu](https://github.com/jipexu)) + * [#10669](https://github.com/openlayers/openlayers/pull/10669) - More browser compatible Export Map example ([@mike-000](https://github.com/mike-000)) + * [#10667](https://github.com/openlayers/openlayers/pull/10667) - Do not render label with the current linedash ([@ahocevar](https://github.com/ahocevar)) + * [#10666](https://github.com/openlayers/openlayers/pull/10666) - Load polyfill before example specific scripts in examples template ([@mike-000](https://github.com/mike-000)) + * [#6526](https://github.com/openlayers/openlayers/pull/6526) - Draw interaction: add abortDrawing method and drawabort event ([@tchandelle](https://github.com/tchandelle)) + * [#10657](https://github.com/openlayers/openlayers/pull/10657) - Changelog for v6.2.1 ([@openlayers](https://github.com/openlayers)) + + +
+ Dependency Updates + + * [#10855](https://github.com/openlayers/openlayers/pull/10855) - Bump rollup from 2.1.0 to 2.3.0 ([@openlayers](https://github.com/openlayers)) + * [#10854](https://github.com/openlayers/openlayers/pull/10854) - Bump ol-mapbox-style from 6.1.0 to 6.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10853](https://github.com/openlayers/openlayers/pull/10853) - Bump buble from 0.19.8 to 0.20.0 ([@openlayers](https://github.com/openlayers)) + * [#10852](https://github.com/openlayers/openlayers/pull/10852) - Bump webpack from 4.42.0 to 4.42.1 ([@openlayers](https://github.com/openlayers)) + * [#10837](https://github.com/openlayers/openlayers/pull/10837) - Bump ol-mapbox-style from 6.0.1 to 6.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10836](https://github.com/openlayers/openlayers/pull/10836) - Bump coveralls from 3.0.9 to 3.0.11 ([@openlayers](https://github.com/openlayers)) + * [#10835](https://github.com/openlayers/openlayers/pull/10835) - Bump @babel/preset-env from 7.8.7 to 7.9.0 ([@openlayers](https://github.com/openlayers)) + * [#10834](https://github.com/openlayers/openlayers/pull/10834) - Bump rollup from 1.32.1 to 2.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10833](https://github.com/openlayers/openlayers/pull/10833) - Bump fs-extra from 8.1.0 to 9.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10832](https://github.com/openlayers/openlayers/pull/10832) - Bump @babel/core from 7.8.7 to 7.9.0 ([@openlayers](https://github.com/openlayers)) + * [#10831](https://github.com/openlayers/openlayers/pull/10831) - Bump babel-loader from 8.0.6 to 8.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10830](https://github.com/openlayers/openlayers/pull/10830) - Bump mocha from 7.1.0 to 7.1.1 ([@openlayers](https://github.com/openlayers)) + * [#10829](https://github.com/openlayers/openlayers/pull/10829) - Bump marked from 0.8.0 to 0.8.2 ([@openlayers](https://github.com/openlayers)) + * [#10811](https://github.com/openlayers/openlayers/pull/10811) - Bump sinon from 9.0.0 to 9.0.1 ([@openlayers](https://github.com/openlayers)) + * [#10810](https://github.com/openlayers/openlayers/pull/10810) - Bump rollup-plugin-terser from 5.2.0 to 5.3.0 ([@openlayers](https://github.com/openlayers)) + * [#10809](https://github.com/openlayers/openlayers/pull/10809) - Bump yargs from 15.3.0 to 15.3.1 ([@openlayers](https://github.com/openlayers)) + * [#10806](https://github.com/openlayers/openlayers/pull/10806) - [Security] Bump acorn from 6.1.1 to 6.4.1 ([@openlayers](https://github.com/openlayers)) + * [#10755](https://github.com/openlayers/openlayers/pull/10755) - Bump rollup from 1.31.1 to 1.32.0 ([@openlayers](https://github.com/openlayers)) + * [#10754](https://github.com/openlayers/openlayers/pull/10754) - Bump @babel/preset-env from 7.8.4 to 7.8.6 ([@openlayers](https://github.com/openlayers)) + * [#10753](https://github.com/openlayers/openlayers/pull/10753) - Bump mocha from 7.0.1 to 7.1.0 ([@openlayers](https://github.com/openlayers)) + * [#10752](https://github.com/openlayers/openlayers/pull/10752) - Bump @babel/core from 7.8.4 to 7.8.6 ([@openlayers](https://github.com/openlayers)) + * [#10725](https://github.com/openlayers/openlayers/pull/10725) - Bump elm-pep from 1.0.4 to 1.0.6 ([@openlayers](https://github.com/openlayers)) + * [#10726](https://github.com/openlayers/openlayers/pull/10726) - Bump sinon from 8.1.1 to 9.0.0 ([@openlayers](https://github.com/openlayers)) + * [#10680](https://github.com/openlayers/openlayers/pull/10680) - Bump terser-webpack-plugin from 2.3.4 to 2.3.5 ([@openlayers](https://github.com/openlayers)) + * [#10682](https://github.com/openlayers/openlayers/pull/10682) - Bump webpack from 4.41.5 to 4.41.6 ([@openlayers](https://github.com/openlayers)) + * [#10681](https://github.com/openlayers/openlayers/pull/10681) - Bump webpack-cli from 3.3.10 to 3.3.11 ([@openlayers](https://github.com/openlayers)) + * [#10679](https://github.com/openlayers/openlayers/pull/10679) - Bump rollup from 1.31.0 to 1.31.1 ([@openlayers](https://github.com/openlayers)) + + +
diff --git a/config/jsdoc/api/plugins/api.js b/config/jsdoc/api/plugins/api.js index 866b04064a..53e0a8c174 100644 --- a/config/jsdoc/api/plugins/api.js +++ b/config/jsdoc/api/plugins/api.js @@ -4,7 +4,7 @@ */ exports.defineTags = function(dictionary) { dictionary.defineTag('api', { - mustHaveValue: false, + mustNotHaveValue: true, canHaveType: false, canHaveName: false, onTagged: function(doclet, tag) { @@ -21,15 +21,11 @@ exports.defineTags = function(dictionary) { * from the documentation. */ -const api = []; +const api = {}; const classes = {}; const types = {}; const modules = {}; -function hasApiMembers(doclet) { - return doclet.longname.split('#')[0] == this.longname; -} - function includeAugments(doclet) { // Make sure that `observables` and `fires` are taken from an already processed `class` doclet. // This is necessary because JSDoc generates multiple doclets with the same longname. @@ -77,9 +73,6 @@ function includeAugments(doclet) { }); } cls._hideConstructor = true; - if (!cls.undocumented) { - cls._documented = true; - } } } } @@ -110,16 +103,43 @@ function includeTypes(doclet) { } } +const defaultExports = {}; +const path = require('path'); +const moduleRoot = path.join(process.cwd(), 'src'); + +// Tag default exported Identifiers because their name should be the same as the module name. +exports.astNodeVisitor = { + visitNode: function(node, e, parser, currentSourceName) { + if (node.parent && node.parent.type === 'ExportDefaultDeclaration') { + const modulePath = path.relative(moduleRoot, currentSourceName).replace(/\.js$/, ''); + const exportName = 'module:' + modulePath.replace(/\\/g, '/') + (node.name ? '~' + node.name : ''); + defaultExports[exportName] = true; + } + } +}; + +function sortOtherMembers(doclet) { + if (doclet.fires) { + doclet.fires.sort(function(a, b) { + return a.split(/#?event:/)[1] < b.split(/#?event:/)[1] ? -1 : 1; + }); + } + if (doclet.observables) { + doclet.observables.sort(function(a, b) { + return a.name < b.name ? -1 : 1; + }); + } +} + exports.handlers = { newDoclet: function(e) { const doclet = e.doclet; if (doclet.stability) { modules[doclet.longname.split(/[~\.]/).shift()] = true; - api.push(doclet); + api[doclet.longname.split('#')[0]] = true; } if (doclet.kind == 'class') { - modules[doclet.longname.split(/[~\.]/).shift()] = true; if (!(doclet.longname in classes)) { classes[doclet.longname] = doclet; } else if ('augments' in doclet) { @@ -134,22 +154,14 @@ exports.handlers = { parseComplete: function(e) { const doclets = e.doclets; + const byLongname = doclets.index.longname; for (let i = doclets.length - 1; i >= 0; --i) { const doclet = doclets[i]; if (doclet.stability) { if (doclet.kind == 'class') { includeAugments(doclet); } - if (doclet.fires) { - doclet.fires.sort(function(a, b) { - return a.split(/#?event:/)[1] < b.split(/#?event:/)[1] ? -1 : 1; - }); - } - if (doclet.observables) { - doclet.observables.sort(function(a, b) { - return a.name < b.name ? -1 : 1; - }); - } + sortOtherMembers(doclet); // Always document namespaces and items with stability annotation continue; } @@ -160,20 +172,32 @@ exports.handlers = { if (doclet.isEnum || doclet.kind == 'typedef') { continue; } - if (doclet.kind == 'class' && api.some(hasApiMembers, doclet)) { + if (doclet.kind == 'class' && doclet.longname in api) { // Mark undocumented classes with documented members as unexported. // This is used in ../template/tmpl/container.tmpl to hide the // constructor from the docs. doclet._hideConstructor = true; includeAugments(doclet); - } else if (!doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) { + sortOtherMembers(doclet); + } else if (!doclet._hideConstructor) { // Remove all other undocumented symbols doclet.undocumented = true; } - if (doclet._documented) { - delete doclet.undocumented; + if (doclet.memberof && byLongname[doclet.memberof] && + byLongname[doclet.memberof][0].isEnum && + !byLongname[doclet.memberof][0].properties.some(p => p.stability)) { + byLongname[doclet.memberof][0].undocumented = true; } } + }, + + processingComplete(e) { + const byLongname = e.doclets.index.longname; + for (const name in defaultExports) { + byLongname[name].forEach(function(doclet) { + doclet.isDefaultExport = true; + }); + } } }; diff --git a/config/jsdoc/api/plugins/inheritdoc.js b/config/jsdoc/api/plugins/inheritdoc.js index a399ae1007..6284a731ee 100755 --- a/config/jsdoc/api/plugins/inheritdoc.js +++ b/config/jsdoc/api/plugins/inheritdoc.js @@ -5,7 +5,7 @@ exports.defineTags = function(dictionary) { dictionary.defineTag('inheritDoc', { - mustHaveValue: false, + mustNotHaveValue: true, canHaveType: false, canHaveName: false, onTagged: function(doclet, tag) { @@ -42,62 +42,62 @@ exports.handlers = { parseComplete: function(e) { let ancestors, candidate, candidates, doclet, i, j, k, l, key; - let incompleteDoclet, stability, incomplete, incompletes; + let stability, incomplete, incompletes; const doclets = e.doclets; for (i = doclets.length - 1; i >= 0; --i) { doclet = doclets[i]; - if (doclet.augments) { - ancestors = [].concat(doclet.augments); - } incompletes = incompleteByClass[doclet.longname]; - if (ancestors && incompletes) { - // collect ancestors from the whole hierarchy - for (j = 0; j < ancestors.length; ++j) { - candidates = lookup[ancestors[j]]; - if (candidates) { - for (k = candidates.length - 1; k >= 0; --k) { - candidate = candidates[k]; - if (candidate.augments) { - ancestors = ancestors.concat(candidate.augments); - } + if (!doclet.augments || !incompletes) { + continue; + } + ancestors = doclet.augments.slice(); + // collect ancestors from the whole hierarchy + for (j = 0; j < ancestors.length; ++j) { + candidates = lookup[ancestors[j]]; + if (candidates) { + for (k = candidates.length - 1; k >= 0; --k) { + candidate = candidates[k]; + if (candidate.augments) { + Array.prototype.push.apply(ancestors, candidate.augments); } } } - // walk through all inheritDoc members - for (j = incompletes.length - 1; j >= 0; --j) { - incomplete = incompletes[j]; - candidates = lookup[doclet.longname + '#' + incomplete]; - if (candidates) { - // get the incomplete doclet that needs to be augmented - for (k = candidates.length - 1; k >= 0; --k) { - incompleteDoclet = candidates[k]; - if (incompleteDoclet.inheritdoc) { - break; - } + } + // walk through all inheritDoc members + let incompleteDoclet; + for (j = incompletes.length - 1; j >= 0; --j) { + incomplete = incompletes[j]; + candidates = lookup[doclet.longname + '#' + incomplete]; + if (candidates) { + // get the incomplete doclet that needs to be augmented + for (k = candidates.length - 1; k >= 0; --k) { + incompleteDoclet = candidates[k]; + if (incompleteDoclet.inheritdoc) { + break; } } - // find the documented ancestor - for (k = ancestors.length - 1; k >= 0; --k) { - candidates = lookup[ancestors[k] + '#' + incomplete]; - if (candidates) { - for (l = candidates.length - 1; l >= 0; --l) { - candidate = candidates[l]; - if (candidate && !candidate.inheritdoc) { - stability = candidate.stability || incompleteDoclet.stability; - if (stability) { - incompleteDoclet.stability = stability; - for (key in candidate) { - if (candidate.hasOwnProperty(key) && - keepKeys.indexOf(key) == -1) { - incompleteDoclet[key] = candidate[key]; - } + } + // find the documented ancestor + for (k = ancestors.length - 1; k >= 0; --k) { + candidates = lookup[ancestors[k] + '#' + incomplete]; + if (candidates) { + for (l = candidates.length - 1; l >= 0; --l) { + candidate = candidates[l]; + if (candidate && !candidate.inheritdoc) { + stability = candidate.stability || incompleteDoclet.stability; + if (stability) { + incompleteDoclet.stability = stability; + for (key in candidate) { + if (candidate.hasOwnProperty(key) && + keepKeys.indexOf(key) == -1) { + incompleteDoclet[key] = candidate[key]; } - // We have found a matching parent doc and applied it so we - // don't want to ignore this doclet anymore. - incompleteDoclet.ignore = false; - // We found a match so we can stop break - break; } + // We have found a matching parent doc and applied it so we + // don't want to ignore this doclet anymore. + incompleteDoclet.ignore = false; + // We found a match so we can stop break + break; } } } diff --git a/config/jsdoc/api/template/publish.js b/config/jsdoc/api/template/publish.js index 4bc6c21445..c1d4b56156 100644 --- a/config/jsdoc/api/template/publish.js +++ b/config/jsdoc/api/template/publish.js @@ -14,7 +14,6 @@ const path = require('jsdoc/lib/jsdoc/path'); const taffy = require('taffydb').taffy; const handle = require('jsdoc/lib/jsdoc/util/error').handle; const helper = require('jsdoc/lib/jsdoc/util/templateHelper'); -const _ = require('underscore'); const htmlsafe = helper.htmlsafe; const linkto = helper.linkto; const resolveAuthorLinks = helper.resolveAuthorLinks; @@ -188,6 +187,14 @@ function attachModuleSymbols(doclets, modules) { }); } +function getPrettyName(doclet) { + const fullname = doclet.longname.replace('module:', ''); + if (doclet.isDefaultExport) { + return fullname.split('~')[0]; + } + return fullname; +} + /** * Create the navigation sidebar. * @param {object} members The members that will be used to create the sidebar. @@ -203,27 +210,13 @@ function attachModuleSymbols(doclets, modules) { */ function buildNav(members) { const nav = []; - // merge namespaces and classes, then sort - const merged = members.modules.concat(members.classes); - merged.sort(function(a, b) { - if (a.longname > b.longname) { - return 1; - } - if (a.longname < b.longname) { - return -1; - } - return 0; - }); - - _.each(merged, function(v) { + members.classes.forEach(function(v) { // exclude interfaces from sidebar - if (v.interface !== true && v.kind === 'class') { + if (v.interface !== true) { nav.push({ type: 'class', longname: v.longname, - prettyname: v.longname - .split('~')[0] - .replace('module:', ''), + prettyname: getPrettyName(v), name: v.name, module: find({ kind: 'module', @@ -247,45 +240,57 @@ function buildNav(members) { memberof: v.longname }) }); - } else if (v.kind == 'module') { - const classes = find({ - kind: 'class', - memberof: v.longname - }); - const members = find({ - kind: 'member', - memberof: v.longname - }); - const methods = find({ - kind: 'function', - memberof: v.longname - }); - const typedefs = find({ - kind: 'typedef', - memberof: v.longname - }); - const events = find({ - kind: 'event', - memberof: v.longname - }); - // only add modules that have more to show than just a single class - if (classes.length !== 1 && (classes.length + members.length + methods.length + typedefs.length + events.length > 0)) { - nav.push({ - type: 'module', - longname: v.longname, - prettyname: v.longname - .split('~')[0] - .replace('module:', ''), - name: v.name, - members: members, - methods: methods, - typedefs: typedefs, - fires: v.fires, - events: events - }); - } } }); + members.modules.forEach(function(v) { + const classes = find({ + kind: 'class', + memberof: v.longname + }); + const members = find({ + kind: 'member', + memberof: v.longname + }); + const methods = find({ + kind: 'function', + memberof: v.longname + }); + const typedefs = find({ + kind: 'typedef', + memberof: v.longname + }); + const events = find({ + kind: 'event', + memberof: v.longname + }); + // Only add modules that contain more than just classes with their + // associated Options typedef + if (typedefs.length > classes.length || members.length + methods.length > 0) { + nav.push({ + type: 'module', + longname: v.longname, + prettyname: getPrettyName(v), + name: v.name, + members: members, + methods: methods, + typedefs: typedefs, + fires: v.fires, + events: events + }); + } + }); + + nav.sort(function(a, b) { + const prettyNameA = a.prettyname.toLowerCase(); + const prettyNameB = b.prettyname.toLowerCase(); + if (prettyNameA > prettyNameB) { + return 1; + } + if (prettyNameA < prettyNameB) { + return -1; + } + return 0; + }); return nav; } @@ -472,6 +477,7 @@ exports.publish = function(taffyData, opts, tutorials) { // index page displays information from package.json and lists files const files = find({kind: 'file'}); + view.navigationHtml = helper.resolveLinks(view.partial('navigation.tmpl')); generate('Index', [{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}].concat(files), indexUrl); diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index 22bcad9dff..8a053e5c7a 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -1,99 +1,258 @@ $(function () { - // Search Items - $('#include_modules').change(function (e) { - console.log('change'); - if ($(this).is(':checked')) { + 'use strict'; + // Allow user configuration? + const allowRegex = true; + const minInputForSearch = 1; + const minInputForFullText = 2; + const expandAllOnInputWithoutSearch = true; + + function constructRegex(searchTerm, makeRe, allowRegex) { + try { + if (allowRegex) { + return makeRe(searchTerm); + } + } catch (e) { + } + // In case of invalid regexp fall back to non-regexp, but still allow . to match / + return makeRe(searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/\\\./g, '[./]')); + } + + function getWeightFunction(searchTerm, allowRegex) { + function makeRe(searchTerm) { + return { + begin: new RegExp('\\b' + searchTerm), // Begin matches word boundary + baseName: new RegExp('\\b' + searchTerm + '[^/]*$'), // Begin matches word boundary of class / module name + fullName: new RegExp('\\b' + searchTerm + '(?:[~.]|$)'), // Complete word(s) of class / module matches + completeName: new RegExp('^' + searchTerm + '$') // Match from start to finish + } + } + const re = constructRegex(searchTerm, makeRe, allowRegex); + return function (matchedItem, beginOnly) { + // We could get smarter on the weight here + const name = matchedItem.dataset.name; + if (beginOnly) { + return re.baseName.test(name) ? 100 : 1; + } + // If everything else is equal, prefer shorter names, and prefer classes over modules + let weight = 10000 + matchedItem.dataset.longname.length - name.length * 100; + if (name.match(re.begin)) { + weight += 10000; + if (re.baseName.test(name)) { + weight += 10000; + if (re.fullName.test(name)) { + weight += 10000; + if (re.completeName.test(name)) { + weight += 10000; + } + } + } + } + return weight; + } + } + + const search = (function () { + const $navList = $('.navigation-list'); + const navListNode = $navList.get(0); + let $classItems; + let $members; + let stateClass = (function () { + $navList.removeClass('search-started searching'); + $navList.addClass('search-empty'); + return 'search-empty'; + })(); + let manualToggles = {}; + + // Show an item related a current documentation automatically + const longname = $('.page-title').data('filename') + .replace(/\.[a-z]+$/, '') + .replace('module-', 'module:') + .replace(/_/g, '/') + .replace(/-/g, '~'); + const currentItem = navListNode.querySelector('.item[data-longname="' + longname + '"]'); + if (currentItem) { + $navList.prepend(currentItem); + } + return { + $navList: $navList, + $currentItem: currentItem ? $(currentItem) : undefined, + lastSearchTerm: undefined, + lastState: {}, + getClassList: function () { + return $classItems || ($classItems = $navList.find('li.item')); + }, + getMembers: function () { + return $members || ($members = $navList.find('.item li')); + }, + changeStateClass: function (newClass) { + if (newClass !== stateClass) { + navListNode.classList.remove(stateClass); + navListNode.classList.add(newClass); + stateClass = newClass; + } + }, + manualToggle: function ($node, show) { + $node.addClass('toggle-manual'); + $node.toggleClass('toggle-manual-hide', !show); + $node.toggleClass('toggle-manual-show', show); + manualToggles[$node.data('longname')] = $node; + }, + clearManualToggles: function() { + for (let clsName in manualToggles) { + manualToggles[clsName].removeClass('toggle-manual toggle-manual-show toggle-manual-hide'); + } + manualToggles = {}; + }, + }; + })(); + + const dummy = {subItems: {}}; + function clearOldMatches(lastState, searchState) { + for (let itemName in lastState) { + const lastItem = lastState[itemName]; + const item = searchState[itemName]; + if (!item) { + lastItem.item.classList.remove('match'); + } + if (lastItem.subItems) { + clearOldMatches(lastItem.subItems, (item || dummy).subItems); + } + } + } + + function doSearch(searchTerm) { + searchTerm = searchTerm.toLowerCase(); + const lastSearchTerm = search.lastSearchTerm; + if (searchTerm === lastSearchTerm) { + return; + } + + // Avoid layout reflow by scrolling to top first. + search.$navList.scrollTop(0); + search.lastSearchTerm = searchTerm; + search.clearManualToggles(); + + if (searchTerm.length < minInputForSearch) { + const state = searchTerm.length && expandAllOnInputWithoutSearch ? 'search-started' : 'search-empty'; + search.changeStateClass(state); + if (lastSearchTerm !== undefined && lastSearchTerm.length >= minInputForSearch) { + // Restore the original, sorted order + search.$navList.append(search.getClassList()); + } + if (state === 'search-empty' && search.$currentItem) { + search.manualToggle(search.$currentItem, true); + } } else { - - } - }); - - var getSearchWeight = function (searchTerm, $matchedItem) { - let weight = 0; - // We could get smarter on the weight here - if ($matchedItem.data('shortname') - && $matchedItem.data('shortname').toLowerCase() === searchTerm.toLowerCase()) { - weight++; - } - return weight; - }; - - // sort function callback - var weightSorter = function (a, b) { - var aW = $(a).data('weight') || 0; - var bW = $(b).data('weight') || 0; - return bW - aW; - }; - - // Search Items - $('#search').on('keyup', function (e) { - var value = $(this).val(); - var $el = $('.navigation'); - - if (value && value.length > 1) { - var regexp = new RegExp(value, 'i'); - $el.find('li, .itemMembers').hide(); - - $el.find('li').each(function (i, v) { - const $item = $(v); - const name = $item.data('name'); - - if (name && regexp.test(name)) { - const $classEntry = $item.closest('.item'); - const $members = $item.closest('.itemMembers'); - - // Do the weight thing - $classEntry.removeData('weight'); - $classEntry.show(); - const weight = getSearchWeight(value, $classEntry); - $classEntry.data('weight', weight); - - $members.show(); - $classEntry.show(); - $item.show(); + search.changeStateClass('searching'); + searchTerm = searchTerm.toLowerCase(); + const beginOnly = searchTerm.length < minInputForFullText; + const getSearchWeight = getWeightFunction(searchTerm, allowRegex); + const re = constructRegex(searchTerm, function (searchTerm) { + return new RegExp((beginOnly ? '\\b' : '') + searchTerm); + }, allowRegex); + const navList = search.$navList.get(0); + const classes = []; + const searchState = {}; + search.getClassList().each(function (i, classEntry) { + const className = classEntry.dataset.longname; + if (!(className in searchState) && re.test(classEntry.dataset.name)) { + const cls = searchState[className] = { + item: classEntry, + // Do the weight thing + weight: getSearchWeight(classEntry, beginOnly) * 100000, + subItems: {} + }; + classes.push(cls); + classEntry.classList.add('match'); } }); + search.getMembers().each(function (i, li) { + const name = li.dataset.name; + if (re.test(name)) { + const itemMember = li.parentElement.parentElement; + const classEntry = itemMember.parentElement; + const className = classEntry.dataset.longname; + let cls = searchState[className]; + if (!cls) { + cls = searchState[className] = { + item: classEntry, + weight: 0, + subItems: {} + }; + classes.push(cls); + classEntry.classList.add('match'); + } + cls.weight += getSearchWeight(li, true); + const memberType = itemMember.dataset.type; + let members = cls.subItems[memberType]; + if (!members) { + members = cls.subItems[memberType] = { + item: itemMember, + subItems: {} + }; + itemMember.classList.add('match'); + } + members.subItems[name] = { item: li }; + li.classList.add('match'); + } + }); + clearOldMatches(search.lastState, searchState); + search.lastState = searchState; - $(".navigation ul.list li.item:visible") - .sort(weightSorter) // sort elements - .appendTo(".navigation ul.list"); // append again to the list - - } else { - $el.find('.item, .itemMembers').show(); + classes.sort(function (a, b) { + return a.weight - b.weight; + }); + for (let i = classes.length - 1; i >= 0; --i) { + navList.appendChild(classes[i].item); + } } + } - $el.find('.list').scrollTop(0); - }); + const searchInput = $('#search').get(0); + // Skip searches when typing fast. + let key; + function queueSearch() { + if (!key) { + key = setTimeout(function () { + key = undefined; + + const searchTerm = searchInput.value; + doSearch(searchTerm); + }, 0); + } + } + + // Search Items + searchInput.addEventListener('input', queueSearch); + doSearch(searchInput.value); // Toggle when click an item element - $('.navigation').on('click', '.toggle', function (e) { - $(this).parent().parent().find('.itemMembers').toggle(); + search.$navList.on('click', '.toggle', function (e) { + if (event.target.tagName.toLowerCase() === 'a') { + return; + } + const clsItem = $(this).closest('.item'); + let show; + if (clsItem.hasClass('toggle-manual-show')) { + show = false; + } else if (clsItem.hasClass('toggle-manual-hide')) { + show = true; + } else { + clsItem.find('.member-list li').each(function (i, v) { + show = $(v).is(':hidden'); + return !show; + }); + } + search.manualToggle(clsItem, !!show); }); - // Show an item related a current documentation automatically - var filename = $('.page-title').data('filename') - .replace(/\.[a-z]+$/, '') - .replace('module-', 'module:') - .replace(/_/g, '/') - .replace(/-/g, '~'); - var $currentItem = $('.navigation .item[data-name*="' + filename + '"]:eq(0)'); - - if ($currentItem.length) { - $currentItem - .remove() - .prependTo('.navigation .list') - .show() - .find('.itemMembers') - .show(); - } - // Auto resizing on navigation var _onResize = function () { var height = $(window).height(); var $el = $('.navigation'); - $el.height(height).find('.list').height(height - 133); + $el.height(height).find('.navigation-list').height(height - 133); }; $(window).on('resize', _onResize); @@ -137,22 +296,4 @@ $(function () { '' + textParts[1] + ''; }); - - // Highlighting current anchor - - var anchors = $('.anchor'); - var _onHashChange = function () { - var activeHash = window.document.location.hash - .replace(/\./g, '\\.') // Escape dot in element id - .replace(/\~/g, '\\~'); // Escape tilde in element id - - anchors.removeClass('highlighted'); - - if (activeHash.length > 0) { - anchors.filter(activeHash).addClass('highlighted'); - } - }; - - $(window).on('hashchange', _onHashChange); - _onHashChange(); }); diff --git a/config/jsdoc/api/template/static/styles/jaguar.css b/config/jsdoc/api/template/static/styles/jaguar.css index 2a105027ba..43a455cadf 100644 --- a/config/jsdoc/api/template/static/styles/jaguar.css +++ b/config/jsdoc/api/template/static/styles/jaguar.css @@ -51,7 +51,8 @@ body { width: 0px; height: 0px; } -.nameContainer .anchor.highlighted + h4 { +/* Highlighting current anchor */ +.nameContainer .anchor:target + h4 { background-color: #faebcc; } a { @@ -123,7 +124,7 @@ li { color: #fff; border-color: #555; } -.navigation .list { +.navigation .navigation-list { padding: 10px 15px 0 15px; position: relative; overflow: auto; @@ -135,6 +136,24 @@ li { border-bottom: 1px solid #333; } +.navigation .glyphicon { + margin-right: 3px; + flex-shrink: 0; +} +.navigation .item .glyphicon:before { + display: inline-block; +} +.navigation .item.toggle-manual .glyphicon:before { + transition: transform .1s; +} +.navigation .item-class.toggle-manual-show .glyphicon:before { + /* With 90deg the icon slightly slides left at transition end */ + transform: rotate(89.9deg); +} +.navigation .item-module.toggle-manual-show .glyphicon:before { + transform: rotate(45deg); +} + .navigation li.perfect-match { border: 5px solid orange; } @@ -147,8 +166,8 @@ li { } .navigation li.item .title { cursor: pointer; - position: relative; - display: block; + display: -ms-flexbox; + display: flex; font-size: 0.85em; } .navigation li.item .title a { @@ -183,10 +202,42 @@ li { padding-left: 8px; margin-top: 2px; } -.navigation li.item .itemMembers { - display: none; +.navigation li.item .member-list { padding-left: 8px; } + +/* search state */ +/* show all classes when search is empty */ +.navigation-list.search-empty .item { + display: block; +} +/* hide all members by default when search is empty */ +.navigation-list.search-empty .item .member-list { + display: none; +} +/* expand all members when input in search field available but too short to search */ +.navigation-list.search-started li, +.navigation-list.search-started .member-list { + display: block; +} +/* when searching hide everything that is not a match */ +.navigation-list.searching li, +.navigation-list.searching .member-list { + display: none; +} +.navigation-list.searching .match { + display: block; +} +/* allow user to hide / show members */ +.navigation-list .item.toggle-manual-show li, +.navigation-list .item.toggle-manual-show .member-list { + display: block!important; +} +.navigation-list:not(.searching) .item.toggle-manual-hide li, +.navigation-list:not(.searching) .item.toggle-manual-hide .member-list { + display: none!important; +} + .main { padding: 20px 20px; margin-left: 250px; diff --git a/config/jsdoc/api/template/tmpl/layout.tmpl b/config/jsdoc/api/template/tmpl/layout.tmpl index 5d257e5db6..22ccd319fd 100644 --- a/config/jsdoc/api/template/tmpl/layout.tmpl +++ b/config/jsdoc/api/template/tmpl/layout.tmpl @@ -92,7 +92,7 @@ var version = obj.packageInfo.version;
- +