New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added package.json and UMD loader wrapper #14
Conversation
- Added package.json so that library can be used with package managers like npm - Wrapped library in Universal Module Definition code, avoiding the use of the global space if one of the common modules patterns are used.
- Added package.json so that library can be used with package managers like npm
- Added package.json so that library can be used with package managers like npm - Wrapped library in Universal Module Definition code, avoiding the use of the global space if one of the common modules patterns are used.
- Added package.json so that library can be used with package managers like npm
Conflicts: color-picker.js
Uhm, the issue already discussed here: #1
The The reasons behind my statement that I will never add any UMD patterns to my projects is because there are no(t yet)? standards on importing and exporting modules in the ECMAScript specification. Yes, I know that AMD and CommonJS are very popular and widely used but they are not part of the JavaScript itself. They are just another JavaScript products, like jQuery. So adding this pattern is like adding support for the jQuery plugin. Too much competition and choice. The solution is ES6 module syntax. |
Thanks for getting back to me. This is no problem.. I will use my fork of you project instead and may also make other changes of issues I'm seeing (ex. your .fit() method does not seem to account for color pickers inside of absolute positioned elements or elements that have offset applied to them). Thanks again for taking the time getting back to me... /Paul. |
There may also be a need for kind of HSLA color support because the reverse version of HSLA color converter is still buggy in the demo page. |
Maybe I should define context before offset parameter so that we can set custom boundaries like: // $.fit([boundaries[, offset]]); picker.fit(picker.picker.parentNode, [4, 10]); picker.fit(window, [4, 10]); // default |
I have not looked exactly at what the issue is in side of What you suggest might work.. I assume the array is offset from [top, right]? |
Left and top (X and Y). |
Hi Taufik,
I found your color-picker widget a few weeks ago and decided to use it for a few projects that I have. I neede da basic color picker and love that yours (in comparison ot many others outthere) is light in size, dependency free and not bloated with too many extra feature. What I found to be missing (for me :) ) is a
package.json
, which allows folks to use package managers (ex. npm) and (most important), that it provides support for use with module patterns, so that the glboal window space is not automtically poluted with theCP
namespace...With this contribution, I am providing:
package.json
filecolor-picker.js
to wrap the library in an UMD declaration.This will enable your library to be used with packge manager, as well as modern module loaders (ex. ES2015
import
orAMD
orCommonJS
.Thanks for your work on this and for sharing it on GitHub.
/Paul