{"_id":"@b00tc4mp/wings","_rev":"4-31a443800ab7d1395c6d82270b3e1ba5","name":"@b00tc4mp/wings","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.2":{"name":"@b00tc4mp/wings","description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","version":"1.0.2","homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"license":"MIT","main":"wings.js","type":"module","exports":{".":{"import":"./dist/wings.mjs","require":"./dist/wings.cjs"}},"scripts":{"build":"node build"},"_id":"@b00tc4mp/wings@1.0.2","gitHead":"0e5bb3987a6f94f91973930c248c1e6d88757ba7","bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-fYLsppgN5tDIPV/32za+w1G8aMDe616ny4UnIgBdV9v5zlQGgSrNC7G+nkHfdF3C3YDKLbB79NQfYNUUGTlwgg==","shasum":"f67ce86f1939b135976dee6a2e5b9190529ddef0","tarball":"https://registry.npmjs.org/@b00tc4mp/wings/-/wings-1.0.2.tgz","fileCount":32,"unpackedSize":385620,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFP804QMjNtKkDAnwVim7kX3L3q+ev9g3P8ivmjbkdRAiAm2dtSQT9wacYbEoixB7bjZtpfqWhjHeZ6dMK6cR9G9g=="}]},"_npmUser":{"name":"b00tc4mp","email":"pluscoders@gmail.com"},"directories":{},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wings_1.0.2_1703721846682_0.32733987196546077"},"_hasShrinkwrap":false},"1.1.0":{"name":"@b00tc4mp/wings","description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","version":"1.1.0","homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"license":"MIT","main":"wings.js","type":"module","exports":{".":{"import":"./dist/wings.mjs","require":"./dist/wings.cjs"}},"scripts":{"build":"node build","publish":"npm publish --access public"},"_id":"@b00tc4mp/wings@1.1.0","gitHead":"2f82db9e8b99d06d993353127e0cee4c6e393d57","bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Ic9bxjcG7Vgqzy5ZSmTWIDlozx4+K2NJhSirlBU3aGdXd0elyAU1vjsKBRvPoYC4twg3Q6g1mr3+0BLHfgaTyw==","shasum":"bdaa8dc3b156126ec89e4ade145e6611e8e6f06a","tarball":"https://registry.npmjs.org/@b00tc4mp/wings/-/wings-1.1.0.tgz","fileCount":34,"unpackedSize":396412,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcqqkBeh748HJi02f9l1dz6e0XU5lsd16kHRBpQaSUlAIhAINxsEO0QF3VVlL3y20GxQ6rDrh6eAAPHs/B6BcLi21q"}]},"_npmUser":{"name":"b00tc4mp","email":"pluscoders@gmail.com"},"directories":{},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wings_1.1.0_1703781400484_0.567922096344452"},"_hasShrinkwrap":false},"1.1.1":{"name":"@b00tc4mp/wings","description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","keywords":["Object-oriented","Component-based","UI","library","HTML","Canvas","Java","Swing","Wings"],"version":"1.1.1","homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"license":"MIT","main":"wings.js","type":"module","exports":{".":{"import":"./dist/wings.mjs","require":"./dist/wings.cjs"}},"scripts":{"build":"node build","publish":"npm publish --access public"},"_id":"@b00tc4mp/wings@1.1.1","gitHead":"22441baf2b327d25f731ba2eca09a14b8c20f391","bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-P6q2fgzClCu5z2Wb2dg+tMzy8t3S+o3hAfqqzCE2A38ZM7zQE1TxmSDjjqy1VdY2f70hLRu0W/BDU+27I98JKw==","shasum":"f4fbe9ed2d204ee450d32c1c4934f9b7a070f41b","tarball":"https://registry.npmjs.org/@b00tc4mp/wings/-/wings-1.1.1.tgz","fileCount":34,"unpackedSize":397096,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuKPQzj9ncw4m+fVB2vHrEfvkbAr82dAYQd/5t6KxSXgIhAJakKUZ+0DYDJeJKFaIxvh2c/tdP+cajFxRagy3y5szO"}]},"_npmUser":{"name":"b00tc4mp","email":"pluscoders@gmail.com"},"directories":{},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wings_1.1.1_1703801822127_0.3845616825940681"},"_hasShrinkwrap":false},"2.0.0":{"name":"@b00tc4mp/wings","version":"2.0.0","description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","keywords":["Object-oriented","Component-based","UI","library","HTML","Canvas","Java","Swing","Wings"],"homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"license":"MIT","main":"wings.js","type":"module","exports":{".":{"import":"./dist/wings.mjs","require":"./dist/wings.cjs"}},"scripts":{"build":"node build","publish":"npm publish"},"_id":"@b00tc4mp/wings@2.0.0","gitHead":"93d44d1bdb9f15abbe0bb4c1d271d551082741ed","bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-2poL/bq45/FBnvcVYrWAmNshbjRP0mrFOOayH6XN4oc0d2UZS4L4oLLwoONxzVM3E4w8jUi7J2znnO91TqXWbw==","shasum":"bd4957176e483205feca096d894f22d8f78ee052","tarball":"https://registry.npmjs.org/@b00tc4mp/wings/-/wings-2.0.0.tgz","fileCount":35,"unpackedSize":403637,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFg7ftROrmWOalVjMqomfDg4k1bMwubiZoTZrfkmWwRGAiB2zXlT70R0rjkokc2ur6s49m/UePbalO09Kj0z/xcC2g=="}]},"_npmUser":{"name":"b00tc4mp","email":"pluscoders@gmail.com"},"directories":{},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wings_2.0.0_1703981983042_0.5425126963025189"},"_hasShrinkwrap":false},"2.0.1":{"name":"@b00tc4mp/wings","version":"2.0.1","description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","keywords":["Object-oriented","Component-based","UI","library","HTML","Canvas","Java","Swing","Wings"],"homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"license":"MIT","main":"wings.js","type":"module","exports":{".":{"import":"./dist/wings.mjs","require":"./dist/wings.cjs"}},"scripts":{"build":"node build","deploy":"npm publish"},"_id":"@b00tc4mp/wings@2.0.1","gitHead":"54e04a658a77511b633d6de8f925b160c92ad99b","bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-xOpJXUkaZKxMPafodJo4Mp6Uu+Vygn7uGgA0OyD/55WAE/4cJOBJzSqqF3Uv7WJK9ytoRcHWohYcixcIOVppaA==","shasum":"b9fbcd09bc60c41a80aee45db6f18bbad204aa6a","tarball":"https://registry.npmjs.org/@b00tc4mp/wings/-/wings-2.0.1.tgz","fileCount":35,"unpackedSize":403674,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz3K8hnSO8jlsi5IhuLgDGo3J49Ce0N4+SLfuzhtCMQQIgE3e2Ew37jX7scr0KZa1QoIu/FRwnTw2xT+blZgMzhio="}]},"_npmUser":{"name":"b00tc4mp","email":"pluscoders@gmail.com"},"directories":{},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wings_2.0.1_1703982908269_0.7054848755773069"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-28T00:04:06.551Z","1.0.2":"2023-12-28T00:04:06.971Z","modified":"2023-12-31T00:35:08.797Z","1.1.0":"2023-12-28T16:36:40.696Z","1.1.1":"2023-12-28T22:17:02.454Z","2.0.0":"2023-12-31T00:19:43.219Z","2.0.1":"2023-12-31T00:35:08.636Z"},"maintainers":[{"name":"b00tc4mp","email":"pluscoders@gmail.com"}],"description":"Object-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)","homepage":"https://b00tc4mp.github.io/wings","repository":{"type":"git","url":"git+https://github.com/b00tc4mp/wings.git"},"author":{"name":"manuelbarzi"},"bugs":{"url":"https://github.com/b00tc4mp/wings/issues"},"license":"MIT","readme":"![Alt text](./images/logo.svg \"Wings\")\n\nObject-oriented Component-based UI JavaScript library for HTML Canvas (inspired by Java Swing)\n\n## Installation\n\n```sh\n$ npm i @b00tc4mp/wings\n```\n\n## Usage\n\n```html\n<!-- create a canvas in html -->\n<canvas id=\"toggling-saluter\" width=\"300px\" height=\"300px\">\n```\n\n```js\n// import wings in javascript (esm)\nimport Wings from '@b00tc4mp/wings'\n// or require it (cjs)\n// const Wings = require('@b00tc4mp/wings')\n\n// destructure it\nconst { View, Component } = Wings\n\n// instantiate a view linked to a canvas\nconst view = new View(document.getElementById('toggling-saluter'))\n\n// create a saluter abstraction\nclass TogglingSaluter extends Component {\n\tconstructor(hello, bye) {\n\t\tsuper()\n\n\t\t// set the dimensions\n\t\tthis.width = 150\n\t\tthis.height = 50\n\n\t\t// set colors\n\t\tthis.backgroundColor = 'magenta'\n\t\tthis.borderColor = 'cyan'\n\t\tthis.borderWidth = 5\n\n\t\t// set the text height for the salutation\n\t\tthis.textHeight = 16\n\n\t\t// init the salutation value \n\t\tthis.hello = hello\n\t\tthis.bye = bye\n\t\tthis.salutation = this.hello\n\n\t\t// add behavior to toggle the salutation on click\n\t\tthis.on('MouseClick', () => {\n\t\t\tif (this.salutation === this.hello)\n\t\t\t\tthis.salutation = this.bye\n\t\t\telse\n\t\t\t\tthis.salutation = this.hello\n\t\t})\n\t}\n\n\tpaint(context) {\n\t\t// paint the base layer\n\t\tsuper.paint(context)\n\n\t\t// paint the saluter value centered in the component\n\t\tcontext.fillStyle = 'white'\n\t\tcontext.font = this.textHeight + 'px verdana'\n\t\tconst width = context.measureText(this.salutation).width\n\t\tcontext.fillText(\n\t\t\tthis.salutation,\n\t\t\t(this.width - width) / 2,\n\t\t\t(this.height + this.textHeight) / 2\n\t\t)\n\t}\n}\n\n// instantiate a saluter and center it at the top of the view\nconst saluter = new TogglingSaluter('Hello, World!', 'Bye, World!')\n\nsaluter.x = (view.width - saluter.width) / 2\nsaluter.y = (view.height / 3 - saluter.height) / 2\n\n// add the saluter to the view\nview.add(saluter)\n\n// instantiate a saluter and center it in the view\nconst saluter2 = new TogglingSaluter('Hola Mundo!', 'Adiós, Mundo!')\n\nsaluter2.x = (view.width - saluter2.width) / 2\nsaluter2.y = (view.height - saluter2.height) / 2\n\n// add the saluter to the view\nview.add(saluter2)\n\n// instantiate a saluter and center it at the bottom of the view\nconst saluter3 = new TogglingSaluter('Ciao Mondo!', 'Addio, Mondo!')\n\nsaluter3.x = (view.width - saluter3.width) / 2\nsaluter3.y = (view.height * 5 / 3 - saluter3.height) / 2\n\n// add the saluter to the view\nview.add(saluter3)\n\n// and that's it\n```\n\nSee more examples at https://b00tc4mp.github.io/wings","readmeFilename":"README.md","keywords":["Object-oriented","Component-based","UI","library","HTML","Canvas","Java","Swing","Wings"]}