cm-chessboard 8.7.10 → 8.8.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.
@@ -1,19 +1,14 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!--
3
- License: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
4
- https://creativecommons.org/licenses/by-sa/3.0/
5
-
6
- Author: Barak Michener
7
- -->
8
-
9
- <svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg">
10
- <title>cm-chessboard arrowheads</title>
11
- <desc>Arrowheads for cm-chessboard (https://shaack.com/projekte/cm-chessboard/)</desc>
12
- <g id="arrowDefault" transform="matrix(5.1931792,0,0,5.1931792,3.5980168,-0.83225447)">
13
- <path d="M 0.535156,0.398438 C 0.398438,0.507812 0.316406,0.671875 0.3125,0.847656 0.316406,1.02344 0.398438,1.1875 0.535156,1.29688 L 3.01172,3.35938 3.72266,4.01563 3.01172,4.64453 0.535156,6.67969 C 0.394531,6.79297 0.3125,6.96094 0.3125,7.13672 c 0,0.17578 0.082031,0.34375 0.222656,0.45703 0.328125,0.25781 0.792974,0.25781 1.117184,0 L 5.45703,4.46094 C 5.59766,4.34766 5.68359,4.17969 5.69141,4 5.69141,3.82031 5.60547,3.65234 5.45703,3.54297 L 1.64453,0.394531 C 1.31641,0.148438 0.859375,0.148438 0.535156,0.398438 Z m 0,0"
14
- class="head-fill"/>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>arrows</title>
4
+ <g id="arrows" stroke="none" fill="none" fill-rule="evenodd" stroke-width="1">
5
+ <g id="cm-chessboard-arrowheads" transform="translate(5, 1)" fill="#000000">
6
+ <g id="arrowPointy" fill-rule="nonzero">
7
+ <path d="M13.5896955,18.4060262 L3.04774642,4.12789972 C2.71970374,3.68359527 2.81395252,3.05748421 3.25825697,2.72944153 C3.58591001,2.48752592 4.02754261,2.46849386 4.37479285,2.68132465 L29.6089137,18.1473987 C30.0797924,18.4360018 30.227556,19.0516834 29.9389529,19.5225621 C29.8565135,19.6570685 29.7434202,19.7701618 29.6089137,19.8526013 L4.37479285,35.3186754 C3.90391418,35.6072784 3.28823259,35.4595148 2.99962954,34.9886362 C2.78679874,34.6413859 2.80583081,34.1997533 3.04774642,33.8721003 L13.5896955,19.5939738 C13.850383,19.2408959 13.850383,18.7591041 13.5896955,18.4060262 Z" id="Path"></path>
8
+ </g>
9
+ <g id="arrowDefault" transform="translate(3, 0)" fill-rule="nonzero">
10
+ <path d="M13.6380471,11.3573439 L23.0265544,19.1369941 C23.4518122,19.4893778 23.5108883,20.1197808 23.1585046,20.5450386 C23.1090352,20.6047384 23.0527907,20.6584826 22.9909045,20.705188 L13.6023972,27.7906743 C13.1615654,28.1233691 12.5344983,28.0357067 12.2018035,27.594875 C12.0708444,27.4213498 12,27.2098744 12,26.9924778 L12,12.1273413 C12,11.5750565 12.4477153,11.1273413 13,11.1273413 C13.2329818,11.1273413 13.4586517,11.2086906 13.6380471,11.3573439 Z" id="Path"></path>
11
+ </g>
12
+ </g>
15
13
  </g>
16
- <g id="arrowPointy">
17
- <path d="M 20,20 5,5 35,20 5,35 Z" class="head-fill"/>
18
- </g>
19
- </svg>
14
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "8.7.10",
3
+ "version": "8.8.0",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -29,7 +29,7 @@ export class Arrows extends Extension {
29
29
  // default chosen to preserve previous appearance where radius = 0.36 * min(squareWidth, squareHeight)
30
30
  // which corresponds to 0.72 of half the square size (0.36 / 0.5 = 0.72)
31
31
  offsetFrom: 0,
32
- offsetTo: 0.72
32
+ offsetTo: 0.55
33
33
  }
34
34
  Object.assign(this.props, props)
35
35
  if (this.chessboard.props.assetsCache) {
@@ -98,7 +98,7 @@ export class Arrows extends Extension {
98
98
  const x2 = cx2 - ux * rTo
99
99
  const y2 = cy2 - uy * rTo
100
100
 
101
- const width = ((view.scalingX + view.scalingY) / 2) * 4
101
+ const width = ((view.scalingX + view.scalingY) / 2) * 8
102
102
  let lineFill = Svg.addElement(arrowsGroup, "line")
103
103
  lineFill.setAttribute('x1', x1.toString())
104
104
  lineFill.setAttribute('x2', x2.toString())
@@ -9,10 +9,15 @@
9
9
  * Redrawing the same arrow or marker removes it.
10
10
  */
11
11
  import {Extension, EXTENSION_POINT} from "../../model/Extension.js"
12
- import {Arrows, ARROW_TYPE} from "../arrows/Arrows.js"
12
+ import {Arrows} from "../arrows/Arrows.js"
13
13
  import {Markers, MARKER_TYPE} from "../markers/Markers.js"
14
14
  import {Svg} from "../../lib/Svg.js"
15
15
 
16
+ export const ARROW_TYPE = {
17
+ default: {class: "arrow-default", slice: "arrowDefault", headSize: 7},
18
+ danger: {class: "arrow-danger", slice: "arrowDefault", headSize: 7}
19
+ }
20
+
16
21
  // Define persistent type objects for matching (strict equality used in core extensions)
17
22
  const ARROW_GREEN = {class: "arrow-green", slice: "arrowDefault", headSize: 7}
18
23
  const ARROW_ORANGE = {class: "arrow-orange", slice: "arrowDefault", headSize: 7}
@@ -217,7 +222,7 @@ export class RightClickAnnotator extends Extension {
217
222
  const x2 = cx2 - ux * rTo
218
223
  const y2 = cy2 - uy * rTo
219
224
 
220
- const width = ((view.scalingX + view.scalingY) / 2) * 4
225
+ const width = ((view.scalingX + view.scalingY) / 2) * 8
221
226
  let lineFill = Svg.addElement(arrowsGroup, "line")
222
227
  lineFill.setAttribute('x1', x1.toString())
223
228
  lineFill.setAttribute('x2', x2.toString())