js-draw 0.1.3 → 0.1.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.1.4
2
+ * Option to enable pan gestures only if the editor has focus
3
+ * Text tool bug fixes and improvements.
4
+ * Defocus/blur editor when `Esc` key is pressed.
5
+
1
6
  # 0.1.3
2
7
  * Very minimalistic text tool.
3
8
  * Ability to load and save text.
package/README.md CHANGED
@@ -109,6 +109,13 @@ const editor = new Editor(document.body, {
109
109
  });
110
110
  ```
111
111
 
112
+ Alternatively, to only enable touchpad panning when the editor has focus,
113
+ ```ts
114
+ const editor = new Editor(document.body, {
115
+ wheelEventsEnabled: 'only-if-focused',
116
+ });
117
+ ```
118
+
112
119
  ### Localization
113
120
 
114
121
  See [src/localization.ts](src/localization.ts) for a list of strings.
@@ -149,25 +156,27 @@ const editor = new Editor(document.body, {
149
156
  The editor's color theme is specified using CSS. Its default theme looks like this:
150
157
  ```css
151
158
  .imageEditorContainer {
152
- /* Deafult colors for the editor -- light mode */
159
+ /* Deafult colors for the editor -- light mode */
153
160
 
154
161
  --primary-background-color: white;
155
162
  --primary-background-color-transparent: rgba(255, 255, 255, 0.5);
156
163
  --secondary-background-color: #faf;
157
164
  --primary-foreground-color: black;
158
165
  --secondary-foreground-color: black;
166
+ --primary-shadow-color: rgba(0, 0, 0, 0.5);
159
167
  }
160
168
 
161
169
  @media (prefers-color-scheme: dark) {
162
- .imageEditorContainer {
163
- /* Deafult colors for the editor -- dark mode */
164
-
165
- --primary-background-color: #151515;
166
- --primary-background-color-transparent: rgba(50, 50, 50, 0.5);
167
- --secondary-background-color: #607;
168
- --primary-foreground-color: white;
169
- --secondary-foreground-color: white;
170
- }
170
+ .imageEditorContainer {
171
+ /* Deafult colors for the editor -- dark mode */
172
+
173
+ --primary-background-color: #151515;
174
+ --primary-background-color-transparent: rgba(50, 50, 50, 0.5);
175
+ --secondary-background-color: #607;
176
+ --primary-foreground-color: white;
177
+ --secondary-foreground-color: white;
178
+ --primary-shadow-color: rgba(250, 250, 250, 0.5);
179
+ }
171
180
  }
172
181
  ```
173
182