@objectifthunes/whiteboard 0.2.7 → 0.4.0

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.
@@ -1,7 +1,7 @@
1
1
  /* ── CSS Custom Properties (light defaults) ──────────── */
2
2
 
3
3
  :root {
4
- --wb-font-body: 'Segoe UI', sans-serif;
4
+ --wb-font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
5
5
  --wb-fs-2xs: 0.64rem;
6
6
  --wb-fs-xs: 0.68rem;
7
7
  --wb-fs-sm: 0.72rem;
@@ -120,6 +120,13 @@ button:disabled { cursor: not-allowed; opacity: 0.58; }
120
120
 
121
121
  input,
122
122
  textarea,
123
+ input:not([type]),
124
+ input[type='text'],
125
+ input[type='number'],
126
+ input[type='search'],
127
+ input[type='email'],
128
+ input[type='password'],
129
+ input[type='url'],
123
130
  select {
124
131
  width: 100%;
125
132
  border: 1px solid var(--wb-border);
@@ -141,6 +148,13 @@ textarea { min-height: 86px; resize: vertical; }
141
148
 
142
149
  input:focus,
143
150
  textarea:focus,
151
+ input:not([type]):focus,
152
+ input[type='text']:focus,
153
+ input[type='number']:focus,
154
+ input[type='search']:focus,
155
+ input[type='email']:focus,
156
+ input[type='password']:focus,
157
+ input[type='url']:focus,
144
158
  select:focus {
145
159
  outline: none;
146
160
  border-color: var(--wb-focus-border);
@@ -839,15 +853,15 @@ button.chip:hover {
839
853
  align-items: start;
840
854
  }
841
855
 
842
- .split-layout--element {
856
+ .split-layout--media-content {
843
857
  grid-template-columns: 84px minmax(0, 1fr);
844
858
  }
845
859
 
846
- .split-layout--character {
860
+ .split-layout--single {
847
861
  grid-template-columns: minmax(0, 1fr);
848
862
  }
849
863
 
850
- .split-layout--user {
864
+ .split-layout--media-content-actions {
851
865
  grid-template-columns: auto minmax(0, 1fr) auto;
852
866
  align-items: center;
853
867
  gap: var(--wb-gap-lg);
@@ -926,13 +940,13 @@ button.chip:hover {
926
940
  font-size: var(--wb-fs-sm);
927
941
  }
928
942
 
929
- .asset-title {
943
+ .card-title {
930
944
  font-size: var(--wb-fs-sm);
931
945
  font-weight: 600;
932
946
  word-break: break-word;
933
947
  }
934
948
 
935
- .asset-title--clamp {
949
+ .card-title--clamp {
936
950
  display: -webkit-box;
937
951
  overflow: hidden;
938
952
  -webkit-line-clamp: 2;
@@ -940,10 +954,6 @@ button.chip:hover {
940
954
  min-height: 2.1em;
941
955
  }
942
956
 
943
- .story-title {
944
- font-size: 0.88rem;
945
- }
946
-
947
957
  .page-title {
948
958
  font-size: 1.1rem;
949
959
  font-weight: 600;
@@ -1011,19 +1021,15 @@ button.chip:hover {
1011
1021
  gap: 0.4rem;
1012
1022
  }
1013
1023
 
1014
- .picker-grid--elements {
1015
- grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
1016
- }
1017
-
1018
- .picker-grid--characters {
1019
- grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
1020
- }
1021
-
1022
- .picker-grid--library {
1023
- grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
1024
- }
1025
-
1026
1024
  .picker-card {
1025
+ /* explicit layout: the button element global (inline-flex, centered,
1026
+ nowrap) must never turn this card into a clipped row */
1027
+ display: flex;
1028
+ flex-direction: column;
1029
+ align-items: stretch;
1030
+ justify-content: flex-start;
1031
+ gap: var(--wb-gap-sm);
1032
+ white-space: normal;
1027
1033
  width: 100%;
1028
1034
  border: 1px solid var(--wb-border);
1029
1035
  border-radius: var(--wb-radius-md);
@@ -1319,8 +1325,277 @@ button.chip:hover {
1319
1325
  bottom: 4.9rem;
1320
1326
  }
1321
1327
 
1322
- .split-layout--element,
1323
- .split-layout--user {
1328
+ .split-layout--media-content,
1329
+ .split-layout--media-content-actions {
1324
1330
  grid-template-columns: 1fr;
1325
1331
  }
1326
1332
  }
1333
+
1334
+ /* ── Surface ──────────────────────────────────────────────────────────
1335
+ The plain floating overlay container (outside any WhiteboardShell). */
1336
+ .surface {
1337
+ border: 1px solid var(--wb-border);
1338
+ border-radius: var(--wb-radius-lg);
1339
+ background: var(--wb-surface);
1340
+ box-shadow: var(--wb-shadow-soft);
1341
+ color: var(--wb-text);
1342
+ padding: 0.9rem;
1343
+ }
1344
+
1345
+ .surface--pad-sm {
1346
+ padding: 0.55rem;
1347
+ }
1348
+
1349
+ .surface--pad-none {
1350
+ padding: 0;
1351
+ }
1352
+
1353
+ /* ── Toolbar (horizontal sibling of .vertical-toolbar) ──────────────── */
1354
+ .toolbar {
1355
+ position: fixed;
1356
+ top: 0.72rem;
1357
+ left: 50%;
1358
+ z-index: 1200;
1359
+ display: flex;
1360
+ align-items: center;
1361
+ gap: var(--wb-gap-sm);
1362
+ transform: translateX(-50%);
1363
+ padding: 0.34rem;
1364
+ border: 1px solid var(--wb-border);
1365
+ border-radius: var(--wb-radius-lg);
1366
+ background: var(--wb-surface);
1367
+ box-shadow: var(--wb-shadow-soft);
1368
+ white-space: nowrap;
1369
+ }
1370
+
1371
+ .toolbar--bottom {
1372
+ top: auto;
1373
+ bottom: 0.72rem;
1374
+ }
1375
+
1376
+ .toolbar--static {
1377
+ position: static;
1378
+ transform: none;
1379
+ }
1380
+
1381
+ .toolbar__items,
1382
+ .toolbar__end {
1383
+ display: flex;
1384
+ align-items: center;
1385
+ gap: var(--wb-gap-sm);
1386
+ }
1387
+
1388
+ .toolbar__end {
1389
+ margin-left: var(--wb-gap-md);
1390
+ }
1391
+
1392
+ /* ── Checkbox & Switch ───────────────────────────────────────────────── */
1393
+ .checkbox {
1394
+ display: flex;
1395
+ align-items: center;
1396
+ justify-content: flex-start;
1397
+ gap: 0.5rem;
1398
+ width: 100%;
1399
+ cursor: pointer;
1400
+ font-size: var(--wb-fs-sm);
1401
+ color: var(--wb-text);
1402
+ white-space: normal;
1403
+ text-align: left;
1404
+ }
1405
+
1406
+ .checkbox__input {
1407
+ flex: none;
1408
+ width: 0.875rem;
1409
+ height: 0.875rem;
1410
+ margin: 0;
1411
+ accent-color: var(--wb-primary);
1412
+ cursor: pointer;
1413
+ }
1414
+
1415
+ .checkbox__text {
1416
+ min-width: 0;
1417
+ }
1418
+
1419
+ .checkbox__hint {
1420
+ color: var(--wb-text-muted);
1421
+ }
1422
+
1423
+ .switch__input {
1424
+ position: absolute;
1425
+ opacity: 0;
1426
+ pointer-events: none;
1427
+ }
1428
+
1429
+ .switch__track {
1430
+ flex: none;
1431
+ position: relative;
1432
+ width: 1.9rem;
1433
+ height: 1.05rem;
1434
+ border-radius: var(--wb-radius-pill);
1435
+ background: var(--wb-surface-active);
1436
+ border: 1px solid var(--wb-border);
1437
+ transition: background-color var(--wb-transition-fast);
1438
+ }
1439
+
1440
+ .switch__thumb {
1441
+ position: absolute;
1442
+ top: 1px;
1443
+ left: 1px;
1444
+ width: 0.85rem;
1445
+ height: 0.85rem;
1446
+ border-radius: 50%;
1447
+ background: var(--wb-white);
1448
+ box-shadow: var(--wb-shadow-soft);
1449
+ transition: transform var(--wb-transition-fast);
1450
+ }
1451
+
1452
+ .switch__input:checked + .switch__track {
1453
+ background: var(--wb-primary);
1454
+ border-color: var(--wb-primary);
1455
+ }
1456
+
1457
+ .switch__input:checked + .switch__track .switch__thumb {
1458
+ transform: translateX(0.85rem);
1459
+ }
1460
+
1461
+ .switch__input:focus-visible + .switch__track {
1462
+ box-shadow: 0 0 0 3px var(--wb-focus-shadow);
1463
+ }
1464
+
1465
+ /* ── Slider ──────────────────────────────────────────────────────────── */
1466
+ .slider {
1467
+ display: grid;
1468
+ gap: 0.3rem;
1469
+ width: 100%;
1470
+ }
1471
+
1472
+ .slider__head {
1473
+ display: flex;
1474
+ align-items: baseline;
1475
+ justify-content: space-between;
1476
+ gap: var(--wb-gap-sm);
1477
+ }
1478
+
1479
+ .slider__value {
1480
+ font-size: var(--wb-fs-xs);
1481
+ color: var(--wb-text-muted);
1482
+ font-variant-numeric: tabular-nums;
1483
+ }
1484
+
1485
+ .slider__input {
1486
+ appearance: none;
1487
+ -webkit-appearance: none;
1488
+ width: 100%;
1489
+ height: 0.95rem;
1490
+ margin: 0;
1491
+ background: transparent;
1492
+ cursor: pointer;
1493
+ }
1494
+
1495
+ .slider__input::-webkit-slider-runnable-track {
1496
+ height: 0.25rem;
1497
+ border-radius: var(--wb-radius-pill);
1498
+ background: var(--wb-surface-active);
1499
+ }
1500
+
1501
+ .slider__input::-moz-range-track {
1502
+ height: 0.25rem;
1503
+ border-radius: var(--wb-radius-pill);
1504
+ background: var(--wb-surface-active);
1505
+ }
1506
+
1507
+ .slider__input::-webkit-slider-thumb {
1508
+ -webkit-appearance: none;
1509
+ width: 0.8rem;
1510
+ height: 0.8rem;
1511
+ margin-top: -0.28rem;
1512
+ border-radius: 50%;
1513
+ border: none;
1514
+ background: var(--wb-primary);
1515
+ box-shadow: var(--wb-shadow-soft);
1516
+ }
1517
+
1518
+ .slider__input::-moz-range-thumb {
1519
+ width: 0.8rem;
1520
+ height: 0.8rem;
1521
+ border-radius: 50%;
1522
+ border: none;
1523
+ background: var(--wb-primary);
1524
+ box-shadow: var(--wb-shadow-soft);
1525
+ }
1526
+
1527
+ .slider__input:focus-visible {
1528
+ outline: none;
1529
+ }
1530
+
1531
+ .slider__input:focus-visible::-webkit-slider-thumb {
1532
+ box-shadow: 0 0 0 3px var(--wb-focus-shadow);
1533
+ }
1534
+
1535
+ .slider__input:focus-visible::-moz-range-thumb {
1536
+ box-shadow: 0 0 0 3px var(--wb-focus-shadow);
1537
+ }
1538
+
1539
+ /* ── Tooltip (CSS-only, hover + keyboard focus) ──────────────────────── */
1540
+ .tooltip {
1541
+ position: relative;
1542
+ display: inline-flex;
1543
+ }
1544
+
1545
+ .tooltip__bubble {
1546
+ position: absolute;
1547
+ bottom: calc(100% + 0.4rem);
1548
+ left: 50%;
1549
+ z-index: 1400;
1550
+ transform: translateX(-50%);
1551
+ padding: 0.22rem 0.5rem;
1552
+ border-radius: var(--wb-radius-sm);
1553
+ background: var(--wb-text);
1554
+ color: var(--wb-surface);
1555
+ font-size: var(--wb-fs-xs);
1556
+ line-height: 1.3;
1557
+ white-space: nowrap;
1558
+ opacity: 0;
1559
+ pointer-events: none;
1560
+ transition: opacity var(--wb-transition-fast);
1561
+ }
1562
+
1563
+ .tooltip--bottom .tooltip__bubble {
1564
+ bottom: auto;
1565
+ top: calc(100% + 0.4rem);
1566
+ }
1567
+
1568
+ .tooltip:hover .tooltip__bubble,
1569
+ .tooltip:focus-within .tooltip__bubble {
1570
+ opacity: 1;
1571
+ }
1572
+
1573
+ /* ── Kbd ─────────────────────────────────────────────────────────────── */
1574
+ .kbd {
1575
+ display: inline-block;
1576
+ padding: 0 0.32rem;
1577
+ border: 1px solid var(--wb-border);
1578
+ border-bottom-width: 2px;
1579
+ border-radius: var(--wb-radius-sm);
1580
+ background: var(--wb-surface-soft);
1581
+ color: var(--wb-text-secondary);
1582
+ font-family: ui-monospace, monospace;
1583
+ font-size: var(--wb-fs-xs);
1584
+ line-height: 1.5;
1585
+ }
1586
+
1587
+ /* ── Divider ─────────────────────────────────────────────────────────── */
1588
+ .divider {
1589
+ border: none;
1590
+ margin: 0;
1591
+ background: var(--wb-border);
1592
+ height: 1px;
1593
+ width: 100%;
1594
+ }
1595
+
1596
+ .divider--vertical {
1597
+ width: 1px;
1598
+ height: auto;
1599
+ align-self: stretch;
1600
+ min-height: 1rem;
1601
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectifthunes/whiteboard",
3
- "version": "0.2.7",
3
+ "version": "0.4.0",
4
4
  "description": "Pan/zoom whiteboard canvas with draggable panels, minimap, snap-to-grid, and zoom controls",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,6 +20,12 @@
20
20
  "sideEffects": [
21
21
  "*.css"
22
22
  ],
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "dev": "vite build --watch",
26
+ "typecheck": "tsc --noEmit",
27
+ "prepack": "pnpm run build"
28
+ },
23
29
  "peerDependencies": {
24
30
  "react": ">=18",
25
31
  "react-dom": ">=18",
@@ -34,10 +40,5 @@
34
40
  "vite": "^6.0.0",
35
41
  "vite-plugin-dts": "^4.0.0",
36
42
  "zustand": "^4.5.0"
37
- },
38
- "scripts": {
39
- "build": "vite build",
40
- "dev": "vite build --watch",
41
- "typecheck": "tsc --noEmit"
42
43
  }
43
44
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ObjectifThunes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.