@ibodr/editor 0.1.10 → 0.1.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.
package/editor.css CHANGED
@@ -159,9 +159,11 @@
159
159
  /* if you ever update --dr-color-background, update the hardcoded values in theme-init.js and globals.css
160
160
  they're there to make sure the background color matches the user's preference before the actual app loads*/
161
161
  --dr-color-grid: hsl(0, 0%, 43%);
162
- --dr-color-board-bg-line: hsl(210, 50%, 55%, 35%);
163
- --dr-color-board-bg-line-secondary: hsl(210, 50%, 55%, 18%);
164
- --dr-color-board-bg-chalkboard: hsl(160, 30%, 16%);
162
+ /* Board background patterns (see `.dr-bg-*` in the Background section below).
163
+ Light theme: subtle blue-gray lines, like ruled/graph paper on white. */
164
+ --dr-color-board-bg-line: hsl(210, 40%, 55%, 38%);
165
+ --dr-color-board-bg-line-secondary: hsl(210, 40%, 55%, 19%);
166
+ --dr-color-board-bg-dot: var(--dr-color-grid);
165
167
  /* UI */
166
168
  --dr-color-low: hsl(204, 16%, 94%);
167
169
  --dr-color-low-border: hsl(204, 16%, 92%);
@@ -216,9 +218,12 @@
216
218
  /* if you ever update --dr-color-background, update the hardcoded values in theme-init.js and globals.css
217
219
  they're there to make sure the background color matches the user's preference before the actual app loads*/
218
220
  --dr-color-grid: hsl(0, 0%, 40%);
219
- --dr-color-board-bg-line: hsl(210, 70%, 70%, 25%);
220
- --dr-color-board-bg-line-secondary: hsl(210, 70%, 70%, 13%);
221
- --dr-color-board-bg-chalkboard: hsl(160, 25%, 10%);
221
+ /* Board background patterns (see `.dr-bg-*` in the Background section below).
222
+ Dark theme: near-white lines at low opacity so they stay visible on the
223
+ near-black canvas without the blue cast used in the light theme. */
224
+ --dr-color-board-bg-line: hsl(0, 0%, 100%, 16%);
225
+ --dr-color-board-bg-line-secondary: hsl(0, 0%, 100%, 8%);
226
+ --dr-color-board-bg-dot: var(--dr-color-grid);
222
227
  /* UI */
223
228
  --dr-color-low: hsl(260, 4.5%, 10.5%);
224
229
  --dr-color-low-border: hsl(207, 10%, 10%);
@@ -348,103 +353,32 @@ input,
348
353
  height: 100%;
349
354
  }
350
355
 
351
- /* Board background patterns (`DrInstance.backgroundType`), independent from the
352
- dot grid rendered by `DefaultGrid` (used for snapping / `isGridMode`). */
353
-
354
- .dr-background__dots {
355
- background-image: radial-gradient(circle, var(--dr-color-board-bg-line) 1px, transparent 1px);
356
- background-size: 24px 24px;
357
- }
358
-
359
- .dr-background__grid {
360
- background-image:
361
- linear-gradient(to right, var(--dr-color-board-bg-line) 1px, transparent 1px),
362
- linear-gradient(to bottom, var(--dr-color-board-bg-line) 1px, transparent 1px);
363
- background-size: 48px 48px;
364
- }
365
-
366
- .dr-background__hex-grid {
367
- background-image:
368
- repeating-linear-gradient(
369
- 60deg,
370
- var(--dr-color-board-bg-line) 0,
371
- var(--dr-color-board-bg-line) 1px,
372
- transparent 1px,
373
- transparent 26px
374
- ),
375
- repeating-linear-gradient(
376
- -60deg,
377
- var(--dr-color-board-bg-line) 0,
378
- var(--dr-color-board-bg-line) 1px,
379
- transparent 1px,
380
- transparent 26px
381
- ),
382
- repeating-linear-gradient(
383
- 0deg,
384
- var(--dr-color-board-bg-line) 0,
385
- var(--dr-color-board-bg-line) 1px,
386
- transparent 1px,
387
- transparent 26px
388
- );
389
- }
390
-
391
- .dr-background__lined {
392
- background-image: repeating-linear-gradient(
393
- to bottom,
394
- transparent 0,
395
- transparent 31px,
396
- var(--dr-color-board-bg-line) 31px,
397
- var(--dr-color-board-bg-line) 32px
398
- );
399
- }
400
-
401
- .dr-background__double-line {
402
- background-image: repeating-linear-gradient(
403
- to bottom,
404
- transparent 0,
405
- transparent 24px,
406
- var(--dr-color-board-bg-line-secondary) 24px,
407
- var(--dr-color-board-bg-line-secondary) 25px,
408
- transparent 25px,
409
- transparent 39px,
410
- var(--dr-color-board-bg-line) 39px,
411
- var(--dr-color-board-bg-line) 40px
412
- );
413
- }
414
-
415
- .dr-background__double-line-slash {
416
- background-image:
417
- repeating-linear-gradient(
418
- 65deg,
419
- var(--dr-color-board-bg-line-secondary) 0,
420
- var(--dr-color-board-bg-line-secondary) 1px,
421
- transparent 1px,
422
- transparent 22px
423
- ),
424
- repeating-linear-gradient(
425
- to bottom,
426
- transparent 0,
427
- transparent 24px,
428
- var(--dr-color-board-bg-line-secondary) 24px,
429
- var(--dr-color-board-bg-line-secondary) 25px,
430
- transparent 25px,
431
- transparent 39px,
432
- var(--dr-color-board-bg-line) 39px,
433
- var(--dr-color-board-bg-line) 40px
434
- );
435
- }
436
-
437
- .dr-background__checkered {
438
- background-image:
439
- linear-gradient(to right, var(--dr-color-board-bg-line-secondary) 1px, transparent 1px),
440
- linear-gradient(to bottom, var(--dr-color-board-bg-line-secondary) 1px, transparent 1px);
441
- background-size: 20px 20px;
442
- }
443
-
444
- .dr-background__chalkboard {
445
- background-color: var(--dr-color-board-bg-chalkboard);
446
- background-image: radial-gradient(hsl(0, 0%, 100%, 4%) 1px, transparent 1px);
447
- background-size: 3px 3px;
356
+ /* Board background patterns (`DrInstance.backgroundType`), rendered as an SVG overlay
357
+ on top of `.dr-background`. Unlike the old CSS `background-image` version, this is
358
+ generated dynamically (see `DefaultBackground`) so the pattern pans and scales with
359
+ the camera exactly like the dot grid rendered by `DefaultGrid`. */
360
+ .dr-background-pattern {
361
+ position: absolute;
362
+ inset: 0px;
363
+ width: 100%;
364
+ height: 100%;
365
+ pointer-events: none;
366
+ }
367
+
368
+ .dr-bg-line {
369
+ stroke: var(--dr-color-board-bg-line);
370
+ stroke-width: 1px;
371
+ fill: none;
372
+ }
373
+
374
+ .dr-bg-line-secondary {
375
+ stroke: var(--dr-color-board-bg-line-secondary);
376
+ stroke-width: 1px;
377
+ fill: none;
378
+ }
379
+
380
+ .dr-bg-dot {
381
+ fill: var(--dr-color-board-bg-dot);
448
382
  }
449
383
 
450
384
  /* --------------------- Grid Layer --------------------- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibodr/editor",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -29,12 +29,12 @@
29
29
  "eventemitter3": "^4.0.7",
30
30
  "idb": "^7.1.1",
31
31
  "rbush": "^3.0.1",
32
- "@ibodr/schema": "0.1.10",
33
- "@ibodr/store": "0.1.10",
34
- "@ibodr/state": "0.1.10",
35
- "@ibodr/state-react": "0.1.10",
36
- "@ibodr/validate": "0.1.10",
37
- "@ibodr/utils": "0.1.10"
32
+ "@ibodr/schema": "0.1.12",
33
+ "@ibodr/state": "0.1.12",
34
+ "@ibodr/store": "0.1.12",
35
+ "@ibodr/state-react": "0.1.12",
36
+ "@ibodr/utils": "0.1.12",
37
+ "@ibodr/validate": "0.1.12"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^18.2.0 || ^19.2.1",