🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

chessboard-element

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chessboard-element - npm Package Compare versions

Comparing version

to
1.0.0-pre.10

@@ -6,2 +6,3 @@ {

"name": "chess-board",
"path": "./src/lib/chessboard-element.ts",
"description": "A custom element that renders an interactive chess board.",

@@ -131,3 +132,3 @@ "attributes": [

"type": "RenderPieceFunction | undefined",
"default": "\"(piece: string, container: Element) => {\\n let pieceImage: string | undefined = undefined;\\n if (isString(this.pieceTheme)) {\\n pieceImage = interpolateTemplate(this.pieceTheme, {piece: piece});\\n } else if (isFunction(this.pieceTheme)) {\\n pieceImage = this.pieceTheme(piece);\\n }\\n if (pieceImage === undefined) {\\n renderWikipediaSVGPiece(piece, container);\\n } else {\\n render(html`<img class=\\\"piece-image\\\" src=${pieceImage} />`, container);\\n }\\n }\""
"default": "\"(piece: string, container: Element) => {\\n let pieceImage: string | undefined = undefined;\\n if (isString(this.pieceTheme)) {\\n pieceImage = interpolateTemplate(this.pieceTheme, {piece: piece});\\n } else if (isFunction(this.pieceTheme)) {\\n pieceImage = this.pieceTheme(piece);\\n }\\n if (pieceImage === undefined) {\\n renderWikipediaSVGPiece(piece, container);\\n } else {\\n render(\\n html`\\n <img class=\\\"piece-image\\\" src=${pieceImage} />\\n `,\\n container\\n );\\n }\\n }\""
},

@@ -134,0 +135,0 @@ {

@@ -205,3 +205,5 @@ /**

else {
render(html `<img class="piece-image" src=${pieceImage} />`, container);
render(html `
<img class="piece-image" src=${pieceImage} />
`, container);
}

@@ -208,0 +210,0 @@ };

import { render, svg, html } from 'lit-html';
export const renderPiece = (piece, container) => {
render(html `
<svg class="piece-image" viewBox="0 0 45 45">
${pieces[piece]}
</svg>
`, container);
<svg class="piece-image" viewBox="0 0 45 45">
${pieces[piece]}
</svg>
`, container);
};

@@ -9,0 +9,0 @@ // Pieces taked from: https://commons.wikimedia.org/wiki/Category:SVG_chess_pieces

@@ -7,3 +7,3 @@ {

"license": "MIT",
"version": "1.0.0-pre.9",
"version": "1.0.0-pre.10",
"repository": {

@@ -33,3 +33,4 @@ "type": "git",

"rollup-plugin-filesize": "^6.2.1",
"rollup-plugin-minify-html-literals": "^1.2.2",
"rollup-plugin-license": "^0.13.0",
"rollup-plugin-minify-html-literals": "^1.2.3",
"rollup-plugin-terser": "^5.1.3",

@@ -42,3 +43,4 @@ "typescript": "^3.7.2",

"serve": "es-dev-server --node-resolve",
"build": "tsc",
"build": "npm run build:ts && npm run analyze && npm run api",
"build:ts": "tsc",
"analyze": "wca analyze \"src/**/*.ts\" --outFile custom-elements.json",

@@ -45,0 +47,0 @@ "api": "wca src/lib/chessboard-element.ts -f json2 --outFile docs-src/_data/docs.json --inlineTypes",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet