ace-colorpicker-rpk 0.0.12

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.
Files changed (238) hide show
  1. package/.babelrc +30 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
  4. package/ChangeLogs.md +22 -0
  5. package/LICENSE +21 -0
  6. package/README.md +117 -0
  7. package/addon/ace-colorpicker.css +1074 -0
  8. package/addon/ace-colorpicker.js +9602 -0
  9. package/addon/sample/colorpicker.html +199 -0
  10. package/config/rollup.config.dev.js +52 -0
  11. package/config/rollup.config.prod.js +53 -0
  12. package/dist/ace-colorpicker.css +1074 -0
  13. package/dist/ace-colorpicker.js +9736 -0
  14. package/dist/ace-colorpicker.min.js +1 -0
  15. package/gl.html +56 -0
  16. package/index.html +172 -0
  17. package/package.json +87 -0
  18. package/resources/image/ace-editor.png +0 -0
  19. package/resources/image/colorpaletts.png +0 -0
  20. package/resources/image/colorpicker.png +0 -0
  21. package/resources/image/grapes.jpg +0 -0
  22. package/resources/image/palette-type.png +0 -0
  23. package/resources/image/scalecolors-title.png +0 -0
  24. package/resources/image/scalecolors.png +0 -0
  25. package/resources/image/screen-shot.png +0 -0
  26. package/resources/image/sketch-type.png +0 -0
  27. package/src/colorpicker/BaseBox.js +94 -0
  28. package/src/colorpicker/BaseColorPicker.js +404 -0
  29. package/src/colorpicker/BaseModule.js +19 -0
  30. package/src/colorpicker/BaseSlider.js +97 -0
  31. package/src/colorpicker/BaseStore.js +71 -0
  32. package/src/colorpicker/UIElement.js +46 -0
  33. package/src/colorpicker/VerticalSlider.js +57 -0
  34. package/src/colorpicker/chromedevtool/ColorControl.js +47 -0
  35. package/src/colorpicker/chromedevtool/index.js +36 -0
  36. package/src/colorpicker/index.js +37 -0
  37. package/src/colorpicker/macos/ColorControl.js +47 -0
  38. package/src/colorpicker/macos/index.js +38 -0
  39. package/src/colorpicker/mini/ColorControl.js +40 -0
  40. package/src/colorpicker/mini/index.js +24 -0
  41. package/src/colorpicker/mini-vertical/ColorControl.js +35 -0
  42. package/src/colorpicker/mini-vertical/index.js +23 -0
  43. package/src/colorpicker/module/ColorManager.js +111 -0
  44. package/src/colorpicker/module/ColorSetsList.js +132 -0
  45. package/src/colorpicker/ring/ColorControl.js +47 -0
  46. package/src/colorpicker/ring/index.js +42 -0
  47. package/src/colorpicker/ui/ColorInformation.js +216 -0
  48. package/src/colorpicker/ui/ColorPalette.js +130 -0
  49. package/src/colorpicker/ui/ColorRing.js +68 -0
  50. package/src/colorpicker/ui/ColorSetsChooser.js +96 -0
  51. package/src/colorpicker/ui/ColorWheel.js +257 -0
  52. package/src/colorpicker/ui/CurrentColorSets.js +81 -0
  53. package/src/colorpicker/ui/CurrentColorSetsContextMenu.js +63 -0
  54. package/src/colorpicker/ui/control/Hue.js +40 -0
  55. package/src/colorpicker/ui/control/Opacity.js +65 -0
  56. package/src/colorpicker/ui/control/Value.js +50 -0
  57. package/src/colorpicker/ui/control/VerticalHue.js +39 -0
  58. package/src/colorpicker/ui/control/VerticalOpacity.js +55 -0
  59. package/src/colorpicker/vscode/ColorControl.js +40 -0
  60. package/src/colorpicker/vscode/index.js +82 -0
  61. package/src/colorpicker/xd/ColorControl.js +36 -0
  62. package/src/colorpicker/xd/index.js +36 -0
  63. package/src/extension/ace/colorview.js +198 -0
  64. package/src/extension/ace/index.js +11 -0
  65. package/src/index.js +12 -0
  66. package/src/scss/colorpicker.scss +65 -0
  67. package/src/scss/colorview.scss +32 -0
  68. package/src/scss/component/button.scss +33 -0
  69. package/src/scss/component/colorchooser.scss +141 -0
  70. package/src/scss/component/colorsets-contextmenu.scss +33 -0
  71. package/src/scss/component/colorsets.scss +89 -0
  72. package/src/scss/component/control.scss +93 -0
  73. package/src/scss/component/gradient-editor.scss +260 -0
  74. package/src/scss/component/gradient-picker.scss +241 -0
  75. package/src/scss/component/information.scss +141 -0
  76. package/src/scss/component/palette.scss +45 -0
  77. package/src/scss/index.scss +5 -0
  78. package/src/scss/mixins.scss +21 -0
  79. package/src/scss/themes/macos.scss +71 -0
  80. package/src/scss/themes/mini-vertical.scss +94 -0
  81. package/src/scss/themes/mini.scss +76 -0
  82. package/src/scss/themes/palette.scss +85 -0
  83. package/src/scss/themes/ring.scss +57 -0
  84. package/src/scss/themes/sketch.scss +172 -0
  85. package/src/scss/themes/vscode.scss +93 -0
  86. package/src/scss/themes/xd.scss +88 -0
  87. package/src/util/Blender.js +29 -0
  88. package/src/util/Canvas.js +128 -0
  89. package/src/util/Color.js +27 -0
  90. package/src/util/ColorNames.js +14 -0
  91. package/src/util/Dom.js +361 -0
  92. package/src/util/Event.js +30 -0
  93. package/src/util/EventMachin.js +349 -0
  94. package/src/util/GL.js +8 -0
  95. package/src/util/HueColor.js +49 -0
  96. package/src/util/ImageFilter.js +9 -0
  97. package/src/util/ImageLoader.js +137 -0
  98. package/src/util/Kmeans.js +237 -0
  99. package/src/util/Matrix.js +196 -0
  100. package/src/util/State.js +42 -0
  101. package/src/util/blend/composite.js +124 -0
  102. package/src/util/blend/non-separable.js +118 -0
  103. package/src/util/blend/separable.js +76 -0
  104. package/src/util/filter/StackBlur.js +517 -0
  105. package/src/util/filter/functions.js +829 -0
  106. package/src/util/filter/image/crop.js +16 -0
  107. package/src/util/filter/image/flipH.js +23 -0
  108. package/src/util/filter/image/flipV.js +25 -0
  109. package/src/util/filter/image/histogram.js +45 -0
  110. package/src/util/filter/image/index.js +18 -0
  111. package/src/util/filter/image/resize.js +18 -0
  112. package/src/util/filter/image/rotate.js +39 -0
  113. package/src/util/filter/image/rotateDegree.js +53 -0
  114. package/src/util/filter/index.js +11 -0
  115. package/src/util/filter/matrix/blur.js +12 -0
  116. package/src/util/filter/matrix/emboss.js +17 -0
  117. package/src/util/filter/matrix/gaussian-blur-5x.js +17 -0
  118. package/src/util/filter/matrix/gaussian-blur.js +16 -0
  119. package/src/util/filter/matrix/grayscale2.js +16 -0
  120. package/src/util/filter/matrix/index.js +58 -0
  121. package/src/util/filter/matrix/kirsch-horizontal.js +13 -0
  122. package/src/util/filter/matrix/kirsch-vertical.js +13 -0
  123. package/src/util/filter/matrix/laplacian-5x.js +16 -0
  124. package/src/util/filter/matrix/laplacian.js +14 -0
  125. package/src/util/filter/matrix/motion-blur-2.js +18 -0
  126. package/src/util/filter/matrix/motion-blur-3.js +19 -0
  127. package/src/util/filter/matrix/motion-blur.js +18 -0
  128. package/src/util/filter/matrix/negative.js +16 -0
  129. package/src/util/filter/matrix/normal.js +11 -0
  130. package/src/util/filter/matrix/sepia2.js +16 -0
  131. package/src/util/filter/matrix/sharpen.js +14 -0
  132. package/src/util/filter/matrix/sobel-horizontal.js +11 -0
  133. package/src/util/filter/matrix/sobel-vertical.js +11 -0
  134. package/src/util/filter/matrix/stack-blur.js +15 -0
  135. package/src/util/filter/matrix/transparency.js +16 -0
  136. package/src/util/filter/matrix/unsharp-masking.js +16 -0
  137. package/src/util/filter/multi/index.js +9 -0
  138. package/src/util/filter/multi/kirsch.js +7 -0
  139. package/src/util/filter/multi/sobel.js +7 -0
  140. package/src/util/filter/multi/vintage.js +7 -0
  141. package/src/util/filter/pixel/bitonal.js +24 -0
  142. package/src/util/filter/pixel/brightness.js +19 -0
  143. package/src/util/filter/pixel/brownie.js +23 -0
  144. package/src/util/filter/pixel/clip.js +21 -0
  145. package/src/util/filter/pixel/contrast.js +18 -0
  146. package/src/util/filter/pixel/gamma.js +13 -0
  147. package/src/util/filter/pixel/gradient.js +52 -0
  148. package/src/util/filter/pixel/grayscale.js +27 -0
  149. package/src/util/filter/pixel/hue.js +28 -0
  150. package/src/util/filter/pixel/index.js +52 -0
  151. package/src/util/filter/pixel/invert.js +16 -0
  152. package/src/util/filter/pixel/kodachrome.js +23 -0
  153. package/src/util/filter/pixel/matrix.js +28 -0
  154. package/src/util/filter/pixel/noise.js +24 -0
  155. package/src/util/filter/pixel/opacity.js +14 -0
  156. package/src/util/filter/pixel/polaroid.js +23 -0
  157. package/src/util/filter/pixel/saturation.js +30 -0
  158. package/src/util/filter/pixel/sepia.js +28 -0
  159. package/src/util/filter/pixel/shade.js +21 -0
  160. package/src/util/filter/pixel/shift.js +23 -0
  161. package/src/util/filter/pixel/solarize.js +23 -0
  162. package/src/util/filter/pixel/technicolor.js +23 -0
  163. package/src/util/filter/pixel/threshold-color.js +35 -0
  164. package/src/util/filter/pixel/threshold.js +7 -0
  165. package/src/util/filter/pixel/tint.js +20 -0
  166. package/src/util/functions/formatter.js +99 -0
  167. package/src/util/functions/fromCMYK.js +17 -0
  168. package/src/util/functions/fromHSL.js +52 -0
  169. package/src/util/functions/fromHSV.js +64 -0
  170. package/src/util/functions/fromLAB.js +99 -0
  171. package/src/util/functions/fromRGB.js +220 -0
  172. package/src/util/functions/fromYCrCb.js +16 -0
  173. package/src/util/functions/func.js +194 -0
  174. package/src/util/functions/image.js +145 -0
  175. package/src/util/functions/math.js +56 -0
  176. package/src/util/functions/mixin.js +164 -0
  177. package/src/util/functions/parser.js +294 -0
  178. package/src/util/gl/filter/index.js +9 -0
  179. package/src/util/gl/filter/matrix/blur.js +9 -0
  180. package/src/util/gl/filter/matrix/emboss.js +17 -0
  181. package/src/util/gl/filter/matrix/gaussian-blur-5x.js +15 -0
  182. package/src/util/gl/filter/matrix/gaussian-blur.js +19 -0
  183. package/src/util/gl/filter/matrix/grayscale2.js +13 -0
  184. package/src/util/gl/filter/matrix/index.js +55 -0
  185. package/src/util/gl/filter/matrix/kirsch-horizontal.js +11 -0
  186. package/src/util/gl/filter/matrix/kirsch-vertical.js +11 -0
  187. package/src/util/gl/filter/matrix/laplacian-5x.js +13 -0
  188. package/src/util/gl/filter/matrix/laplacian.js +11 -0
  189. package/src/util/gl/filter/matrix/motion-blur-2.js +17 -0
  190. package/src/util/gl/filter/matrix/motion-blur-3.js +17 -0
  191. package/src/util/gl/filter/matrix/motion-blur.js +17 -0
  192. package/src/util/gl/filter/matrix/negative.js +13 -0
  193. package/src/util/gl/filter/matrix/normal.js +8 -0
  194. package/src/util/gl/filter/matrix/sepia2.js +13 -0
  195. package/src/util/gl/filter/matrix/sharpen.js +11 -0
  196. package/src/util/gl/filter/matrix/sobel-horizontal.js +11 -0
  197. package/src/util/gl/filter/matrix/sobel-vertical.js +11 -0
  198. package/src/util/gl/filter/matrix/transparency.js +13 -0
  199. package/src/util/gl/filter/matrix/unsharp-masking.js +14 -0
  200. package/src/util/gl/filter/multi/index.js +9 -0
  201. package/src/util/gl/filter/multi/kirsch.js +7 -0
  202. package/src/util/gl/filter/multi/sobel.js +7 -0
  203. package/src/util/gl/filter/multi/vintage.js +7 -0
  204. package/src/util/gl/filter/pixel/bitonal.js +22 -0
  205. package/src/util/gl/filter/pixel/brightness.js +14 -0
  206. package/src/util/gl/filter/pixel/brownie.js +11 -0
  207. package/src/util/gl/filter/pixel/chaos.js +20 -0
  208. package/src/util/gl/filter/pixel/clip.js +20 -0
  209. package/src/util/gl/filter/pixel/contrast.js +16 -0
  210. package/src/util/gl/filter/pixel/gamma.js +16 -0
  211. package/src/util/gl/filter/pixel/gradient.js +59 -0
  212. package/src/util/gl/filter/pixel/grayscale.js +22 -0
  213. package/src/util/gl/filter/pixel/hue.js +19 -0
  214. package/src/util/gl/filter/pixel/index.js +54 -0
  215. package/src/util/gl/filter/pixel/invert.js +18 -0
  216. package/src/util/gl/filter/pixel/kodachrome.js +11 -0
  217. package/src/util/gl/filter/pixel/matrix.js +29 -0
  218. package/src/util/gl/filter/pixel/noise.js +18 -0
  219. package/src/util/gl/filter/pixel/opacity.js +17 -0
  220. package/src/util/gl/filter/pixel/polaroid.js +11 -0
  221. package/src/util/gl/filter/pixel/saturation.js +20 -0
  222. package/src/util/gl/filter/pixel/sepia.js +19 -0
  223. package/src/util/gl/filter/pixel/shade.js +20 -0
  224. package/src/util/gl/filter/pixel/shift.js +11 -0
  225. package/src/util/gl/filter/pixel/solarize.js +21 -0
  226. package/src/util/gl/filter/pixel/technicolor.js +11 -0
  227. package/src/util/gl/filter/pixel/threshold-color.js +15 -0
  228. package/src/util/gl/filter/pixel/threshold.js +7 -0
  229. package/src/util/gl/filter/pixel/tint.js +25 -0
  230. package/src/util/gl/filter/util.js +185 -0
  231. package/src/util/gl/functions.js +158 -0
  232. package/src/util/gl/index.js +543 -0
  233. package/src/util/index.js +17 -0
  234. package/stand.html +975 -0
  235. package/test/util.Blend.spec.js +15 -0
  236. package/test/util.Color.spec.js +200 -0
  237. package/test/util.Filter.spec.js +12 -0
  238. package/test/util.ImageFilter.spec.js +16 -0
package/index.html ADDED
@@ -0,0 +1,172 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+
7
+ <meta property="og:title" content="ColorPicker for AceEditor Addon" />
8
+ <meta property="og:description" content="Very Simple ColorPicker for AceEditor" />
9
+ <meta property="og:url" content="https://easylogic.github.io/ace-colorpicker/" />
10
+ <meta property="og:image" content="https://easylogic.github.com/ace-colorpicker/resources/image/screen-shot.png" />
11
+
12
+ <meta name="twitter:card" content="summary_large_image">
13
+ <meta name="twitter:site" content="https://easylogic.github.io/ace-colorpicker/">
14
+ <meta name="twitter:creator" content="@easylogic">
15
+ <meta name="twitter:title" content="ColorPicker for AceEditor Addon">
16
+ <meta name="twitter:description" content="Very Simple ColorPicker for AceEditor">
17
+ <meta name="twitter:image" content="https://easylogic.github.com/ace-colorpicker/resources/image/screen-shot.png">
18
+
19
+ <script type="text/javascript" src="https://ajaxorg.github.io/ace-builds/src/ace.js"></script>
20
+
21
+ <link rel="stylesheet"
22
+ href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
23
+ <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
24
+
25
+ <link rel="stylesheet" href="./addon/ace-colorpicker.css" />
26
+ <script type="text/javascript" src="./addon/ace-colorpicker.js" ></script>
27
+
28
+
29
+ <style type="text/css">
30
+ html, body {
31
+ padding:0px;
32
+ margin:0px;
33
+ }
34
+ h1.title {
35
+ margin-top:0px;
36
+ color: white;
37
+ padding: 50px;
38
+ text-align: center;
39
+ font-size: 50px;
40
+ text-shadow: 1px 1px 1px rgb(255, 255, 255);
41
+ }
42
+
43
+ section {
44
+ background-color: rgb(29, 37, 43);
45
+ min-height: 900px;
46
+
47
+ }
48
+
49
+
50
+ .ace-area {
51
+ max-width: 800px;
52
+ height: 600px;
53
+ margin: 0 auto;
54
+ position: relative;
55
+ }
56
+
57
+ #sample_text_area {
58
+ position: absolute;
59
+ top: 0;
60
+ right: 0;
61
+ bottom: 0;
62
+ left: 0;
63
+ }
64
+
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
69
+
70
+ <section class="main">
71
+ <h1 class="title">
72
+ AceEditor ColorPicker AddOn
73
+ <div>
74
+ <iframe src="https://ghbtns.com/github-btn.html?user=easylogic&repo=ace-colorpicker&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
75
+ </div>
76
+
77
+ </h1>
78
+ <div class="ace-area">
79
+
80
+ <div id="sample_text_area">
81
+ .sample-green .red {
82
+ background-color: green;
83
+ color: blue;
84
+ }
85
+
86
+ </div>
87
+ <pre><code class="javascript">// AceEditor Addon
88
+ var cm = AceEditor.fromTextArea(document.getElementById("sample_text_area"), {
89
+ colorpicker : {
90
+ mode : 'edit'
91
+ }
92
+ });</code></pre>
93
+ </div>
94
+
95
+ </section>
96
+
97
+ <section class="colorpicker-style-list">
98
+ <h1 >ColorPicker Style</h1>
99
+ <div>
100
+ <div class="colorpicker-type">
101
+ <h3>Chrome Devtool Style</h3>
102
+ <div class="colorpicker-style" data-type="default"></div>
103
+ </div>
104
+ <div class="colorpicker-type">
105
+ <h3>Adobe XD Style</h3>
106
+ <div class="colorpicker-style" data-type="xd"></div>
107
+ </div>
108
+ <div class="colorpicker-type">
109
+ <h3>Sketch Style</h3>
110
+ <div class="colorpicker-style" data-type="sketch"></div>
111
+ </div>
112
+ <div class="colorpicker-type">
113
+ <h3>MacOS Style</h3>
114
+ <div class="colorpicker-style" data-type="macos"></div>
115
+ </div>
116
+ <div class="colorpicker-type">
117
+ <h3>Ring Style</h3>
118
+ <div class="colorpicker-style" data-type="ring"></div>
119
+ </div>
120
+
121
+ <div class="colorpicker-type">
122
+ <h3>Mini Style</h3>
123
+ <div class="colorpicker-style" data-type="mini"></div>
124
+ </div>
125
+
126
+ <div class="colorpicker-type">
127
+ <h3>Mini Vertical Style</h3>
128
+ <div class="colorpicker-style" data-type="mini-vertical"></div>
129
+ </div>
130
+
131
+ <div class="colorpicker-type">
132
+ <h3>VSCode Style</h3>
133
+ <div class="colorpicker-style" data-type="vscode"></div>
134
+ </div>
135
+
136
+
137
+ <!-- <div class="colorpicker-type">
138
+ <h3>Only Palette Style</h3>
139
+ <div class="colorpicker-style" data-type="palette"></div>
140
+ </div> -->
141
+ <pre><code class="javascript">{
142
+ colorpicker : {
143
+ type : 'palette' // or 'sketch', default type is 'chromedevtool'
144
+ }
145
+ }</code></pre>
146
+
147
+ </div>
148
+
149
+ </section>
150
+
151
+
152
+ <footer>
153
+ &copy; easylogic colorpicker - MIT license
154
+ <div class="email">cyberuls@gmail.com</div>
155
+ </footer>
156
+
157
+ <script type="text/javascript">
158
+
159
+ var editor = ace.edit("sample_text_area");
160
+ editor.setTheme("ace/theme/solarized_light");
161
+ editor.session.setMode("ace/mode/scss", () => {
162
+ AceColorPicker.load(ace, editor);
163
+ })
164
+
165
+
166
+
167
+ </script>
168
+ <script>hljs.initHighlightingOnLoad();</script>
169
+
170
+ </body>
171
+
172
+ </html>
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "ace-colorpicker-rpk",
3
+ "version": "0.0.12",
4
+ "description": "simple colorpicker for ACE Editor",
5
+ "main": "./dist/ace-colorpicker.js",
6
+ "scripts": {
7
+ "pub": "npm run build && npm publish",
8
+ "build": "NODE_ENV=production rollup --config config/rollup.config.prod.js",
9
+ "dev": "NODE_ENV=development rollup -w --config config/rollup.config.dev.js",
10
+ "docs": "http-server ./docs",
11
+ "test": "NODE_ENV=test jest --watch",
12
+ "release": "release-it *"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/easylogic/ace-colorpicker.git"
17
+ },
18
+ "keywords": [
19
+ "ace",
20
+ "colorview",
21
+ "colorpicker",
22
+ "imagefilter",
23
+ "color",
24
+ "rgb",
25
+ "webgl",
26
+ "chromdevtool",
27
+ "macos",
28
+ "sketch",
29
+ "palette"
30
+ ],
31
+ "author": "easylogic",
32
+ "license": "MIT",
33
+ "bugs": {
34
+ "url": "https://github.com/easylogic/ace-colorpicker/issues"
35
+ },
36
+ "homepage": "https://colorpicker.easylogic.studio/",
37
+ "devDependencies": {
38
+ "autoprefixer": "^7.2.5",
39
+ "babel-cli": "^6.26.0",
40
+ "babel-core": "^6.26.0",
41
+ "babel-jest": "^22.4.1",
42
+ "babel-plugin-external-helpers": "^6.22.0",
43
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
44
+ "babel-plugin-transform-object-rest-spread": "^6.26.0",
45
+ "babel-preset-env": "^1.6.1",
46
+ "babel-preset-es2015": "^6.24.1",
47
+ "babel-preset-es2015-rollup": "^3.0.0",
48
+ "babel-preset-minify": "^0.2.0",
49
+ "cross-env": "^5.1.1",
50
+ "http-server": "^0.11.1",
51
+ "jest": "^22.4.2",
52
+ "jest-cli": "^22.4.2",
53
+ "jest-report": "^0.1.11",
54
+ "release-it": "^14.11.3",
55
+ "rollup": "^0.52.1",
56
+ "rollup-plugin-babel": "^3.0.3",
57
+ "rollup-plugin-css-only": "^0.2.0",
58
+ "rollup-plugin-glslify": "^1.0.5",
59
+ "rollup-plugin-json": "^2.3.0",
60
+ "rollup-plugin-livereload": "^0.6.0",
61
+ "rollup-plugin-minify": "^1.0.3",
62
+ "rollup-plugin-peer-deps-external": "^2.2.0",
63
+ "rollup-plugin-postcss": "^1.2.7",
64
+ "rollup-plugin-scss": "^0.4.0",
65
+ "rollup-plugin-serve": "^0.4.2",
66
+ "rollup-plugin-uglify": "^2.0.1",
67
+ "rollup-watch": "^4.3.1",
68
+ "uglify-es": "^3.2.2"
69
+ },
70
+ "dependencies": {},
71
+ "jest": {
72
+ "modulePaths": [
73
+ "<rootDir>/src",
74
+ "<rootDir>/node_modules"
75
+ ],
76
+ "globals": {
77
+ "NODE_ENV": "test"
78
+ },
79
+ "verbose": false,
80
+ "moduleFileExtensions": [
81
+ "js",
82
+ "json"
83
+ ],
84
+ "testRegex": "test/.*\\.spec\\.js$",
85
+ "testEnvironment": "node"
86
+ }
87
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,94 @@
1
+
2
+ import Event from '../util/Event'
3
+ import UIElement from './UIElement';
4
+
5
+ export default class BaseBox extends UIElement {
6
+
7
+ constructor (opt) {
8
+ super(opt)
9
+
10
+ this.source = 'base-box'
11
+ }
12
+
13
+
14
+ refresh () {
15
+
16
+ }
17
+
18
+ refreshColorUI (e) {
19
+
20
+ }
21
+
22
+ /** push change event */
23
+ changeColor (opt) {
24
+ this.$store.dispatch('/changeColor',Object.assign({
25
+ source: this.source
26
+ }, opt || {}))
27
+ }
28
+
29
+ // Event Bindings
30
+ 'mouseup document' (e) {
31
+ this.onDragEnd(e);
32
+ }
33
+
34
+ 'mousemove document' (e) {
35
+ this.onDragMove(e);
36
+ }
37
+
38
+ 'mousedown $bar' (e) {
39
+ e.preventDefault();
40
+ this.isDown = true;
41
+ }
42
+
43
+ 'mousedown $container' (e) {
44
+ this.isDown = true
45
+ this.onDragStart(e);
46
+ }
47
+
48
+ 'touchend document' (e) {
49
+ this.onDragEnd(e);
50
+ }
51
+
52
+ 'touchmove document' (e) {
53
+ this.onDragMove(e);
54
+ }
55
+
56
+ 'touchstart $bar' (e) {
57
+ e.preventDefault();
58
+ this.isDown = true;
59
+ }
60
+
61
+ 'touchstart $container' (e) {
62
+ this.onDragStart(e);
63
+ }
64
+
65
+
66
+ onDragStart (e) {
67
+ this.isDown = true;
68
+ this.refreshColorUI(e);
69
+ }
70
+
71
+ onDragMove (e) {
72
+ if (this.isDown) {
73
+ this.refreshColorUI(e);
74
+ }
75
+ }
76
+
77
+ /* called when mouse is ended move */
78
+ onDragEnd (e) {
79
+ if (this.isDown) {
80
+ this.$store.emit('lastUpdateColor');
81
+ this.isDown = false
82
+ }
83
+ }
84
+
85
+
86
+ '@changeColor' (sourceType) {
87
+ if (this.source != sourceType) {
88
+ this.refresh()
89
+ }
90
+ }
91
+
92
+ '@initColor' () { this.refresh() }
93
+
94
+ }