@mirasen/chessboard 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mirasen/chessboard
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 09962d6: Prevent native mobile selection and callout behavior on the board surface and coordinate labels.
|
|
8
|
+
|
|
9
|
+
## 1.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- db4969e: Fix README
|
|
14
|
+
|
|
3
15
|
## 1.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/@mirasen/chessboard)
|
|
2
2
|
[](https://github.com/mirasen-io/chessboard/actions/workflows/ci.yml)
|
|
3
|
-
[](https://sonarcloud.io/summary/new_code?id=mirasen-io_chessboard)
|
|
4
|
-
[](https://sonarcloud.io/summary/new_code?id=mirasen-io_chessboard)
|
|
5
3
|
[](./LICENSE)
|
|
6
4
|
|
|
7
5
|
# @mirasen/chessboard
|
|
@@ -56,5 +56,10 @@ export function rendererCoordinatesRender(state, context, layer) {
|
|
|
56
56
|
'dominant-baseline': 'auto'
|
|
57
57
|
});
|
|
58
58
|
text.textContent = label;
|
|
59
|
+
// Keep coordinate labels visual-only so mobile browsers do not select them
|
|
60
|
+
// or treat them as pointer targets during board interaction.
|
|
61
|
+
text.style.setProperty('pointer-events', 'none');
|
|
62
|
+
text.style.setProperty('user-select', 'none');
|
|
63
|
+
text.style.setProperty('-webkit-user-select', 'none');
|
|
59
64
|
}
|
|
60
65
|
}
|
|
@@ -2,6 +2,11 @@ import { createSvgElement } from './helpers.js';
|
|
|
2
2
|
export function createSvgRoots(options) {
|
|
3
3
|
const { doc } = options;
|
|
4
4
|
const svgRoot = createSvgElement(doc, 'svg', { 'data-chessboard-id': 'svg-root' });
|
|
5
|
+
svgRoot.style.setProperty('user-select', 'none');
|
|
6
|
+
svgRoot.style.setProperty('-webkit-user-select', 'none');
|
|
7
|
+
svgRoot.style.setProperty('touch-action', 'pinch-zoom');
|
|
8
|
+
svgRoot.style.setProperty('-webkit-touch-callout', 'none');
|
|
9
|
+
svgRoot.style.setProperty('-webkit-tap-highlight-color', 'transparent');
|
|
5
10
|
const result = {
|
|
6
11
|
svgRoot,
|
|
7
12
|
defs: createSvgElement(doc, 'defs', { 'data-chessboard-id': 'defs-root' }),
|
|
@@ -29,10 +29,6 @@ export function createInteractionController(options) {
|
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
transmitTransientInput(internalState, context);
|
|
32
|
-
if (!context.rawEvent.defaultPrevented && context.rawEvent.cancelable) {
|
|
33
|
-
// Suppress native browser behavior for board-handled events.
|
|
34
|
-
context.rawEvent.preventDefault();
|
|
35
|
-
}
|
|
36
32
|
}
|
|
37
33
|
};
|
|
38
34
|
}
|
package/package.json
CHANGED