From d78a6a2ff6a52a5ea57c69b966cbb2e867608d8c Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 15 Nov 2021 10:45:08 -0500 Subject: [PATCH 01/26] 0.14.0-dev --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d0cf0d..e70283c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lil-gui", - "version": "0.13.0", + "version": "0.14.0-dev", "author": { "name": "George Michael Brower" }, From 642e4741bc1834e64ece5818a23bc57ef25a260f Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 15 Nov 2021 20:24:19 -0500 Subject: [PATCH 02/26] fix extra dim disabled inputs on iOS --- style/inputs.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/style/inputs.scss b/style/inputs.scss index b5394f8..931d93c 100644 --- a/style/inputs.scss +++ b/style/inputs.scss @@ -21,6 +21,9 @@ background: var(--focus-color); } } + &:disabled { + opacity: 1; // override default iOS style, we already dim .controller + } } input[type='text'] { From 37ddc7e246717ef765c7da667a62404f25ecdf94 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 15 Nov 2021 20:40:49 -0500 Subject: [PATCH 03/26] entire boolean controller is cursor: pointer (#13) --- style/inputs.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/style/inputs.scss b/style/inputs.scss index 931d93c..2f5b667 100644 --- a/style/inputs.scss +++ b/style/inputs.scss @@ -40,6 +40,7 @@ width: var(--checkbox-size); border-radius: var(--widget-border-radius); text-align: center; + cursor: pointer; &:checked:before { font-family: 'lil-gui'; content: '✓'; From 3e7a209cb1cf239a1be0301e3cb1701cc53f9df0 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 15 Nov 2021 20:42:09 -0500 Subject: [PATCH 04/26] update todos --- TODO | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TODO b/TODO index 22cbc4f..e25c8c1 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,9 @@ only way to default to a keyboard with numbers, decimals and a negative sign on ios is with input[type=number]. i hate unstyling that thing +[ ] -webkit-tap-highlight is still on boolean and option + but there's no :active style on either without it + 0.13 [-] test color malform/edge cases From cb7a668cc33841e36682e3b4e05ce51cb4404ad8 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Wed, 17 Nov 2021 14:41:52 -0500 Subject: [PATCH 05/26] add gui.onFinishChange --- Changelog.md | 4 ++++ Guide.md | 2 ++ examples/kitchen-sink/index.html | 4 ++++ src/Controller.js | 2 ++ src/GUI.js | 33 ++++++++++++++++++++++++++++++++ 5 files changed, 45 insertions(+) diff --git a/Changelog.md b/Changelog.md index aeb48d4..b779d83 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# 0.14.0 + +- Added `gui.onFinishChange` for symmetry with `gui.onChange`. + # 0.13.0 28.56kb, 8.24kb gzipped diff --git a/Guide.md b/Guide.md index c6ec886..5ef15d4 100644 --- a/Guide.md +++ b/Guide.md @@ -202,6 +202,8 @@ gui.onChange( event => { `GUI.onChange` events bubble upward. A handler applied to the root GUI will fire after every change. Handlers applied to folders will only be called after changes to that folder or its descendents. +`GUI.onFinishChange` works just like `GUI.onChange`, but it only fires at the end of change events. + ### Listening and Updating If a value controlled by the GUI is changed in code anywhere outside of the GUI, the new value won't diff --git a/examples/kitchen-sink/index.html b/examples/kitchen-sink/index.html index 7b39534..3bdf3f2 100644 --- a/examples/kitchen-sink/index.html +++ b/examples/kitchen-sink/index.html @@ -308,6 +308,10 @@ gui.addColor( { Color: 0xaa00ff }, 'Color' ).onChange( change ).onFinishChange( finishChange ); + gui.onFinishChange( e => { + console.log( 'gui.onFinishChange', e ); + } ); + } ); make( { title: 'Customization' }, gui => { diff --git a/src/Controller.js b/src/Controller.js index efbefd5..3d71471 100644 --- a/src/Controller.js +++ b/src/Controller.js @@ -166,6 +166,8 @@ export default class Controller { */ _callOnFinishChange() { + this.parent._callOnFinishChange( this ); + if ( this._changed && this._onFinishChange !== undefined ) { this._onFinishChange.call( this, this.getValue() ); } diff --git a/src/GUI.js b/src/GUI.js index d0e6a1d..1b02014 100644 --- a/src/GUI.js +++ b/src/GUI.js @@ -488,6 +488,39 @@ export default class GUI { } } + /** + * Pass a function to be called whenever a controller in this GUI has finished changing. + * @param {function({object:object, property:string, value:any, controller:Controller})} callback + * @returns {this} + * @example + * gui.onFinishChange( event => { + * event.object // object that was modified + * event.property // string, name of property + * event.value // new value of controller + * event.controller // controller that was modified + * } ); + */ + onFinishChange( callback ) { + this._onFinishChange = callback; + return this; + } + + _callOnFinishChange( controller ) { + + if ( this.parent ) { + this.parent._callOnFinishChange( controller ); + } + + if ( this._onFinishChange !== undefined ) { + this._onFinishChange.call( this, { + object: controller.object, + property: controller.property, + value: controller.getValue(), + controller + } ); + } + } + /** * Destroys all DOM elements and event listeners associated with this GUI */ From 2c23571cc5eded04e95b2be24387d0bb73f54492 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Wed, 17 Nov 2021 15:06:12 -0500 Subject: [PATCH 06/26] changelog / todo --- Changelog.md | 2 ++ TODO | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index b779d83..27fd936 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,8 @@ # 0.14.0 - Added `gui.onFinishChange` for symmetry with `gui.onChange`. +- Fixed a bug that stopped iOS users from typing negative numbers. ([Note](#)) +- Minor CSS fixes. # 0.13.0 diff --git a/TODO b/TODO index e25c8c1..c37595f 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ 0.14 -[ ] GUI.onFinishChange (branch: undo) +[x] GUI.onFinishChange (branch: undo) [ ] ios negative numbers (branch: typenumber) the spec for inputmode=decimal doesn't mandate a negative sign only way to default to a keyboard with numbers, decimals and a negative sign From 89917f09c0a8f7a4a8f9fd76d1bdeb5b2c896162 Mon Sep 17 00:00:00 2001 From: georgealways Date: Wed, 17 Nov 2021 17:01:53 -0500 Subject: [PATCH 07/26] iOS: show a fully functional numeric keyboard ( input[type=number] ) (#16) --- src/NumberController.js | 4 ++-- style/inputs.scss | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/NumberController.js b/src/NumberController.js index 98a8352..0aecef3 100644 --- a/src/NumberController.js +++ b/src/NumberController.js @@ -56,8 +56,8 @@ export default class NumberController extends Controller { _initInput() { this.$input = document.createElement( 'input' ); - this.$input.setAttribute( 'type', 'text' ); - this.$input.setAttribute( 'inputmode', 'decimal' ); + this.$input.setAttribute( 'type', 'number' ); + this.$input.setAttribute( 'step', 'any' ); this.$input.setAttribute( 'aria-labelledby', this.$name.id ); this.$widget.appendChild( this.$input ); diff --git a/style/inputs.scss b/style/inputs.scss index 2f5b667..a5afd84 100644 --- a/style/inputs.scss +++ b/style/inputs.scss @@ -26,13 +26,26 @@ } } - input[type='text'] { + input[type='text'], + input[type='number'] { padding: var(--widget-padding); &:focus { background: var(--focus-color); } } + // Hide number spinners + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + input[type='checkbox'] { appearance: none; -webkit-appearance: none; @@ -53,7 +66,6 @@ box-shadow: inset 0 0 0 1px var(--focus-color); } } - } button { From d834247968aa154ff01cbc1eaa19358a14fc8fcb Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Wed, 17 Nov 2021 17:04:35 -0500 Subject: [PATCH 08/26] update todos --- TODO | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index c37595f..26f3b0b 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ 0.14 [x] GUI.onFinishChange (branch: undo) -[ ] ios negative numbers (branch: typenumber) +[x] ios negative numbers (branch: typenumber) the spec for inputmode=decimal doesn't mandate a negative sign only way to default to a keyboard with numbers, decimals and a negative sign on ios is with input[type=number]. i hate unstyling that thing @@ -9,6 +9,8 @@ [ ] -webkit-tap-highlight is still on boolean and option but there's no :active style on either without it +[ ] move --string-color and --number-color to inputs.scss + 0.13 [-] test color malform/edge cases From 7359d465ca0d864718ea0c0bd55260ca8895782b Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 09:09:00 -0500 Subject: [PATCH 09/26] example description --- scripts/homepage.hbs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/homepage.hbs.html b/scripts/homepage.hbs.html index 3b79cb2..1368035 100644 --- a/scripts/homepage.hbs.html +++ b/scripts/homepage.hbs.html @@ -987,7 +987,7 @@

Examples

Hot Swap - Replaces dat.gui across all three.js example pages. Except for a few, this was done just by replacing the import URL.
  • PixiJS Filters Demo Hot Swap - - Replacing a very long dat.gui.
  • + Replaces a very long dat.gui. From 5b443226a1287d2c5e9ede9b03f1b79f694974fd Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 10:38:28 -0500 Subject: [PATCH 10/26] simplify FunctionController css --- package.json | 2 +- style/controllers.scss | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e70283c..ebd00e7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test": "node -r esm tests/utils/runner.js", "api": "node -r esm scripts/api.js --write", "homepage": "node -r esm scripts/homepage.js", - "server": "browser-sync start -s -f '$npm_package_main' 'index.html' 'examples' --no-open --no-notify --no-ui --no-ghost-mode --no-inject-changes", + "server": "browser-sync start -s -f 'dist' 'index.html' 'examples' --no-open --no-notify --no-ui --no-ghost-mode --no-inject-changes", "preversion": "npm run build && npm test", "prepublishOnly": "npm run build && npm test", "dev": "npm run build:all && node -r esm scripts/dev.js" diff --git a/style/controllers.scss b/style/controllers.scss index 426d8ef..f108387 100644 --- a/style/controllers.scss +++ b/style/controllers.scss @@ -14,7 +14,9 @@ } } - .name { + // > is used here to avoid styling FunctionController's .name, + // which gets put inside of its widget. + > .name { min-width: var(--name-width); flex-shrink: 0; white-space: pre; @@ -31,11 +33,6 @@ } } - .controller.function .name { - line-height: unset; - padding: 0; - } - .controller.string input { color: var(--string-color); } From 55bfadab17b730766fc9bf5133efcff1ba1db7f8 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 10:44:00 -0500 Subject: [PATCH 11/26] save some bytes with inset --- style/controllers.scss | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/style/controllers.scss b/style/controllers.scss index f108387..c6adab6 100644 --- a/style/controllers.scss +++ b/style/controllers.scss @@ -54,10 +54,7 @@ position: absolute; border-radius: var(--widget-border-radius); border: 1px solid #fff9; - left: 0; - right: 0; - top: 0; - bottom: 0; + inset: 0; } } } @@ -111,9 +108,7 @@ font-family: 'lil-gui'; content: '↕'; position: absolute; - top: 0; - right: 0; - bottom: 0; + inset: 0 0 0 auto; padding-right: 0.375em; } } From 72b49157aeb4a4ad3932d332e034ec40443ee26d Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 10:48:47 -0500 Subject: [PATCH 12/26] css simplify button text vert alignment --- style/inputs.scss | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/style/inputs.scss b/style/inputs.scss index a5afd84..5fc020d 100644 --- a/style/inputs.scss +++ b/style/inputs.scss @@ -89,10 +89,7 @@ text-align: center; - // tried to center vertically via flex, didn't work... - // shouldn't this just be 1? focus border makes this weird - // .725 seemed to line up for mobile & desktop - line-height: calc(var(--widget-height) * 0.725); + line-height: calc(var(--widget-height) - 4px); @include can-hover { &:hover { From c2c8a2649be31f39d8c357c8fbd1ba1903703965 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 16:30:02 -0500 Subject: [PATCH 13/26] update todos --- TODO | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 26f3b0b..0045638 100644 --- a/TODO +++ b/TODO @@ -6,10 +6,14 @@ only way to default to a keyboard with numbers, decimals and a negative sign on ios is with input[type=number]. i hate unstyling that thing -[ ] -webkit-tap-highlight is still on boolean and option - but there's no :active style on either without it +[-] -webkit-tap-highlight is still on boolean and option + but there's no :active style on either without it (branch: mobileactivestates) -[ ] move --string-color and --number-color to inputs.scss +[ ] button text-transform: none + this was there to compensate for a very broad css selector in the three.js + examples while developing, shouldn't be there + +[-] move --string-color and --number-color to inputs.scss 0.13 From c66ac0578666cfaf0ccb7fa2f58a4d3ee99b3395 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 16:33:09 -0500 Subject: [PATCH 14/26] changelog --- Changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 27fd936..20e57fa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,9 @@ # 0.14.0 +29.04kb, 8.31kb gzipped + - Added `gui.onFinishChange` for symmetry with `gui.onChange`. -- Fixed a bug that stopped iOS users from typing negative numbers. ([Note](#)) +- Fixed a bug that stopped iOS users from typing negative numbers. ([Note](https://github.com/georgealways/lil-gui/pull/16)) - Minor CSS fixes. # 0.13.0 From 043698bbc59b37214c0161184046556062789e08 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 17:43:11 -0500 Subject: [PATCH 15/26] fix horizontal scrollbar on homepage --- scripts/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/api.js b/scripts/api.js index fee3d84..3428fa6 100644 --- a/scripts/api.js +++ b/scripts/api.js @@ -254,7 +254,7 @@ function paramsToSignature( params ) { .map( singleParamToSignature ) .join( ', ' ); - return `( ${paramList} )`; + return `( ${paramList} )`; } From 1a91ca2a1f3dccffe987dd5ceac72ce15e83f299 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Thu, 18 Nov 2021 20:30:07 -0500 Subject: [PATCH 16/26] homepage hljs palette tweak --- scripts/homepage.hbs.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/homepage.hbs.html b/scripts/homepage.hbs.html index 1368035..5b9acdb 100644 --- a/scripts/homepage.hbs.html +++ b/scripts/homepage.hbs.html @@ -22,10 +22,10 @@ --link: #005dcc; --pre-code: #d1d0cc; --inline-code: #926501; - --code-number: #73c6ee; - --code-string: #a3c04a; - --code-literal: #db80c7; - --code-special: #6ed3d3; + --code-number: #6cb2e3; + --code-string: #a6bf5c; + --code-literal: #bd75cb; + --code-special: #80d3c7; --code-comment: #84858a; --pre-background: #372d39; --toc-width: 210px; From e88f394e70d9a645b3f6a7202412719041902f8f Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Fri, 19 Nov 2021 19:26:06 -0500 Subject: [PATCH 17/26] gui.onFinishChange only fires if there's a change --- src/Controller.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Controller.js b/src/Controller.js index 3d71471..d033a3e 100644 --- a/src/Controller.js +++ b/src/Controller.js @@ -166,10 +166,14 @@ export default class Controller { */ _callOnFinishChange() { - this.parent._callOnFinishChange( this ); + if ( this._changed ) { + + this.parent._callOnFinishChange( this ); + + if ( this._onFinishChange !== undefined ) { + this._onFinishChange.call( this, this.getValue() ); + } - if ( this._changed && this._onFinishChange !== undefined ) { - this._onFinishChange.call( this, this.getValue() ); } this._changed = false; From 5a7ff0ca422108f327e2d5f5c6680fd7b3c2eca6 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sat, 20 Nov 2021 21:59:22 -0500 Subject: [PATCH 18/26] remove package_config vars from npm scripts --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ebd00e7..7af7e31 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "scripts": { "build": "npm run icons && npm run sass && npm run sass:min && npm run rollup", "build:all": "npm run build && npm run api && npm run homepage", - "sass": "sass style/index.scss $npm_package_config_style --no-source-map --no-charset", - "sass:min": "sass style/index.scss $npm_package_config_styleMin --no-charset --no-source-map --style=compressed", + "sass": "sass style/index.scss dist/lil-gui.css --no-source-map --no-charset", + "sass:min": "sass style/index.scss dist/lil-gui.min.css --no-charset --no-source-map --style=compressed", "rollup": "rollup -c", "lint": "eslint .", "icons": "node -r esm scripts/icons.js", From c1b223e8e580d38fdfc412c288ae0e8e7a4ec743 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sat, 20 Nov 2021 22:00:20 -0500 Subject: [PATCH 19/26] script param order consistency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7af7e31..165b1f5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "scripts": { "build": "npm run icons && npm run sass && npm run sass:min && npm run rollup", "build:all": "npm run build && npm run api && npm run homepage", - "sass": "sass style/index.scss dist/lil-gui.css --no-source-map --no-charset", + "sass": "sass style/index.scss dist/lil-gui.css --no-charset --no-source-map", "sass:min": "sass style/index.scss dist/lil-gui.min.css --no-charset --no-source-map --style=compressed", "rollup": "rollup -c", "lint": "eslint .", From d2c66d7f49b2611eec24722929be1a4378db5d6d Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sun, 21 Nov 2021 13:10:58 -0500 Subject: [PATCH 20/26] generate d.ts file for typescript users --- package-lock.json | 24 ++++++++++++++++++++++-- package.json | 5 ++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f432e9..aeb89b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lil-gui", - "version": "0.13.0", + "version": "0.14.0-dev", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "lil-gui", - "version": "0.13.0", + "version": "0.14.0-dev", "license": "MIT", "devDependencies": { "browser-sync": "^2.27.7", @@ -22,6 +22,7 @@ "rollup": "^1.17.0", "sass": "^1.22.10", "terser": "^4.3.8", + "typescript": "^4.5.2", "webfont": "^11.2.26" } }, @@ -4547,6 +4548,19 @@ "node": ">=8" } }, + "node_modules/typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/typical": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", @@ -8570,6 +8584,12 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "dev": true + }, "typical": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", diff --git a/package.json b/package.json index 165b1f5..1ecb905 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "homepage": "https://lil-gui.georgealways.com", "module": "dist/lil-gui.esm.js", "main": "dist/lil-gui.umd.js", + "types": "dist/lil-gui.esm.d.ts", "config": { "style": "dist/lil-gui.css", "styleMin": "dist/lil-gui.min.css" @@ -22,10 +23,11 @@ "icons": "node -r esm scripts/icons.js", "test": "node -r esm tests/utils/runner.js", "api": "node -r esm scripts/api.js --write", + "types": "tsc dist/lil-gui.esm.js --declaration --allowJs --emitDeclarationOnly --outDir dist", "homepage": "node -r esm scripts/homepage.js", "server": "browser-sync start -s -f 'dist' 'index.html' 'examples' --no-open --no-notify --no-ui --no-ghost-mode --no-inject-changes", "preversion": "npm run build && npm test", - "prepublishOnly": "npm run build && npm test", + "prepublishOnly": "npm run clean && npm run build && npm run types && npm test", "dev": "npm run build:all && node -r esm scripts/dev.js" }, "files": [ @@ -46,6 +48,7 @@ "rollup": "^1.17.0", "sass": "^1.22.10", "terser": "^4.3.8", + "typescript": "^4.5.2", "webfont": "^11.2.26" }, "eslintIgnore": [ From 46cb91e49495c37348d8a3a0abec9cee6b065d1c Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sun, 21 Nov 2021 13:22:34 -0500 Subject: [PATCH 21/26] npm clean script --- package-lock.json | 1 + package.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/package-lock.json b/package-lock.json index aeb89b4..db856d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "jsdoc-api": "^5.0.2", "markdown-it": "^9.1.0", "onchange": "^6.0.0", + "rimraf": "^3.0.2", "rollup": "^1.17.0", "sass": "^1.22.10", "terser": "^4.3.8", diff --git a/package.json b/package.json index 1ecb905..56b5523 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "types": "tsc dist/lil-gui.esm.js --declaration --allowJs --emitDeclarationOnly --outDir dist", "homepage": "node -r esm scripts/homepage.js", "server": "browser-sync start -s -f 'dist' 'index.html' 'examples' --no-open --no-notify --no-ui --no-ghost-mode --no-inject-changes", + "clean": "rimraf -rf dist/*", "preversion": "npm run build && npm test", "prepublishOnly": "npm run clean && npm run build && npm run types && npm test", "dev": "npm run build:all && node -r esm scripts/dev.js" @@ -45,6 +46,7 @@ "jsdoc-api": "^5.0.2", "markdown-it": "^9.1.0", "onchange": "^6.0.0", + "rimraf": "^3.0.2", "rollup": "^1.17.0", "sass": "^1.22.10", "terser": "^4.3.8", From 08194311f5d815dd275998f46afb064d94494a1a Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sun, 21 Nov 2021 14:02:29 -0500 Subject: [PATCH 22/26] changelog dts --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 20e57fa..8031743 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ 29.04kb, 8.31kb gzipped - Added `gui.onFinishChange` for symmetry with `gui.onChange`. +- Added a `d.ts` file for TypeScript users. - Fixed a bug that stopped iOS users from typing negative numbers. ([Note](https://github.com/georgealways/lil-gui/pull/16)) - Minor CSS fixes. From 568a58048d1ad6df2d7893bd13cddc178c2d0302 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sun, 21 Nov 2021 15:03:25 -0500 Subject: [PATCH 23/26] bold gzip size --- scripts/homepage.hbs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/homepage.hbs.html b/scripts/homepage.hbs.html index 5b9acdb..bc60038 100644 --- a/scripts/homepage.hbs.html +++ b/scripts/homepage.hbs.html @@ -972,7 +972,7 @@

    API

    {{{ readme }}} Built Source • - Minified = {{ sizeMin }}kb, {{ sizeGzip }}kb gzipped + Minified = {{ sizeMin }}kb, {{ sizeGzip }}kb gzipped From 2530720339fdd178283d044b4b7e87a0137204a5 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Sun, 21 Nov 2021 16:21:32 -0500 Subject: [PATCH 24/26] better cdn links in guide --- Guide.md | 4 ++-- scripts/homepage.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Guide.md b/Guide.md index 5ef15d4..3fcfd73 100644 --- a/Guide.md +++ b/Guide.md @@ -23,14 +23,14 @@ For quick sketches, you can import lil-gui directly from a CDN. ```html ``` The library is also available in UMD format under the namespace `lil`. ```html - + diff --git a/scripts/homepage.js b/scripts/homepage.js index 5c2b4e8..b1aca5b 100644 --- a/scripts/homepage.js +++ b/scripts/homepage.js @@ -47,8 +47,8 @@ guide = guide.replace( /^## ([\s\S]*?)$/gm, function( _, heading ) { } ); -// include version in CDN examples, bad form to use bare/latest -guide = guide.replace( /@VERSION/g, '@' + pkg.version ); +// include major & minor version in CDN examples, bad form to use bare/latest +guide = guide.replace( /@VERSION/g, '@' + pkg.version.substring( 0, pkg.version.lastIndexOf( '.' ) ) ); // API.md // ----------------------------------------------------------------------------- From 6fedcabc38953d20bd4d9c5bdd1b3998316e1c8e Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 22 Nov 2021 08:30:00 -0500 Subject: [PATCH 25/26] update todos --- TODO | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 0045638..7166e08 100644 --- a/TODO +++ b/TODO @@ -9,9 +9,10 @@ [-] -webkit-tap-highlight is still on boolean and option but there's no :active style on either without it (branch: mobileactivestates) -[ ] button text-transform: none +[-] button text-transform: none this was there to compensate for a very broad css selector in the three.js - examples while developing, shouldn't be there + examples while developing, shouldn't be there. + well, in truth there's a bunch of 'resets' in the .lil-gui { selector too [-] move --string-color and --number-color to inputs.scss From dce2b0c2119e3f422c624f87034fd2273fd33880 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 22 Nov 2021 08:43:59 -0500 Subject: [PATCH 26/26] dropdown vertical alignment --- style/icons/u2195-dropdown.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/style/icons/u2195-dropdown.svg b/style/icons/u2195-dropdown.svg index bd9005f..cdeba84 100644 --- a/style/icons/u2195-dropdown.svg +++ b/style/icons/u2195-dropdown.svg @@ -3,7 +3,7 @@ - - + +