Releases: Anbeeld/Elemap
Releases · Anbeeld/Elemap
v0.4.1
- Map and grid extensions can now be passed as a part of the initial config.
- Made extensions property a part of constructor arguments for all classes.
- Fixed map and grid extensions not applied when importing.
- Fixed render method of index map class not having container argument as optional.
- Fixed addExtensions and deleteExtensions not added as reserved names for property mangling.
v0.4.0
- Renamed extend into addExtentions and shrink into deleteExtentions to make them consistent with other method names.
- Added renderOnChange property and toggleRenderOnChange method to map class, false by default. Setting it to true will mean the map will re-render after every change that affects its visual representation, if the map was already rendered manually at least once before that.
- Added deleteTile and deleteTiles method to grid class, with same argument system as for creation methods.
- Added visible property and toggleVisibility method to tile class, true by default. Setting it to false allows to render tile elements without them being visible in any way except for grid size if the tile is on the edge.
- Added neighbors getter method to tile class, returning existing tiles that are adjacent to this one, as well as diagonals method to return diagonally adjacent tiles for rectangle grids.
- Added neighborCoords getter method to tile class, returning all coords that are adjacent to coords of this tile, as well as diagonalCoords method to return diagonally adjacent coords for rectangle grids.
- Added distanceToCoords method to tile class, returning distance in num of tiles to specified coords, with optional diagonals arguments for rectangle grids.
- Added alignedWithCoords method to tile class, returning true if specified coords are located in a straight line relative to this tile, with optional diagonals arguments for rectangle grids.
- updateStyle method of tile class now support removing styles, with replace argument being swapped for mode: "add"|"replace"|"remove". If mode is set to remove and current style has declarations matching the ones passes in decls argument, these declarations will be removed from the style. Alternatively, passing "clear" string in declaration will result in removing all current declarations in that category.
- createTiles method now takes coords as a first argument and size as a second, swapping them.
- deleteContent method can now take HTML elements to find the element, and returns a boolean indicating if it was successfuly deleted or not.
- Size argument now also supports arrays of two numbers, where first one is width and second one is height.
- Added delete method to SignedArray and SignedTable classes.
- Fixed pointer events being disabled on content HTML elements.
- Hovering content that is located on a tile now hovers that tile as well.
- Split container HTML element of content class into position and container.
- Added elemap-row class to row HTML elements and elemap-tile class to tile HTML elements to make it easier to target them with selectors.
- Moved ID imprinting on HTML elements from class names to data attributes.
- Changed coordinates data attributes naming template from data-elemap-x to data-coords-x.
- Fixed registry current ID not updating after importing, leading to IDs being reused if the imported snapshot contains IDs higher than the registry's current.
v0.3.10
v0.3.9
v0.3.8
- Improved addContent argument structure, with location now supporting various types from tile index class to an array of coordinates.
- Added contents getter to map index class to return all currently existing content objects.
- Added deleteContent method to map index class.
- Added ids getter for all index classes.
v0.3.7
- Added shrink method as an opposite to extend, which takes an array of property names or chains of names as strings (like category.product.attribute) and removes properties with these names from extensions.
- Made it possible to pass extensions to extend method as an array, e.g. [["key1", "value1"], ["key2.key3.key4", "value2"]].
- Fixed naming of some internal types and method arguments.
v0.3.6
v0.3.5
- Added tiles getter method to grid index class, returning SignedTable of index tile objects for all tiles the map has.
- Added elements getter method to tile index class, returning its outer and inner HTML elements.
- Grid frame HTML elements are now split into outer and inner, with the clip-path background attached to the inner one, allowing you to create a shadow for it using drop-shadow filter on the outer element.
- Replaced overcomplicated demangling for JavaScript in index classes with reserved property names in the Webpack configuration.
v0.3.4
- Renamed mutations to extensions, and mutate method to extend.
- Replaced report method with extensions getter method.
- createTile method now returns an object of the tile index class if it was created, or false if it wasn't. Same goes for createTiles method, but this one returns an array of them.
- Fixed TypeScript createTile method missing "replace" argument.
- Fixed getter methods of index classes returning any in TypeScript.
- Fixed carthesian coords not allowed in TypeScript for accessing hexagon map tiles.
- Fixed some types used in index classes still checking map type by string instead of MapType enum.
- Fixed incorrect naming scheme for internal types of the extension system.
- Renamed internal SomethingConstants types to SomethingProperties.
v0.3.3
- Creating tiles does not replace existing ones by default now, instead it can be enforced using a new optional "replace" argument in tile creating functions.
- Fixed row positions calculated sequentially, leading to incorrect positioning of tiles if there are empty rows between them.
- Fixed hexagon indentation applied to first tiles in a row or a column when there's no non-indented tiles at matching coordinates, resulting in additional margin between a map and a grid.
- Pseudo-exported GridOrientation and GridOffset enums as static getter methods of the index class, allowing to use them for configuration in TypeScript.
- Map type is now set by MapType enum in TypeScript instead of its string counterpart, with enum being pseudo-exported as a static getter method of the index class.
- tileByElement method now actually checks if the HTML element is listed as being owned by the tile, instead of just having the same coordinates.
- Rendering of tile specific styles is now performed after generic ones, preventing a number of issues.
- HTML elements and styles belonging to tiles that no longer exist are now removed on re-rendering.