@tldraw/tldraw 4.4.0-next.84d68f44c848 → 4.4.0-next.bde73a32273d

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/dist-cjs/index.js CHANGED
@@ -19,7 +19,7 @@ var import_tldraw = require("tldraw");
19
19
  __reExport(index_exports, require("tldraw"), module.exports);
20
20
  (0, import_tldraw.registerTldrawLibraryVersion)(
21
21
  "@tldraw/tldraw",
22
- "4.4.0-next.84d68f44c848",
22
+ "4.4.0-next.bde73a32273d",
23
23
  "cjs"
24
24
  );
25
25
  //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@ import { registerTldrawLibraryVersion } from "tldraw";
2
2
  export * from "tldraw";
3
3
  registerTldrawLibraryVersion(
4
4
  "@tldraw/tldraw",
5
- "4.4.0-next.84d68f44c848",
5
+ "4.4.0-next.bde73a32273d",
6
6
  "esm"
7
7
  );
8
8
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/tldraw",
3
3
  "description": "A tiny little drawing editor.",
4
- "version": "4.4.0-next.84d68f44c848",
4
+ "version": "4.4.0-next.bde73a32273d",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -38,8 +38,7 @@
38
38
  "prepack": "yarn run -T tsx ../../internal/scripts/prepack.ts",
39
39
  "postpack": "../../internal/scripts/postpack.sh",
40
40
  "pack-tarball": "yarn pack",
41
- "lint": "yarn run -T tsx ../../internal/scripts/lint.ts",
42
- "context": "yarn run -T tsx ../../internal/scripts/context.ts"
41
+ "lint": "yarn run -T tsx ../../internal/scripts/lint.ts"
43
42
  },
44
43
  "files": [
45
44
  "tldraw.css",
@@ -48,7 +47,7 @@
48
47
  "src"
49
48
  ],
50
49
  "dependencies": {
51
- "tldraw": "4.4.0-next.84d68f44c848"
50
+ "tldraw": "4.4.0-next.bde73a32273d"
52
51
  },
53
52
  "peerDependencies": {
54
53
  "react": "^18.2.0 || ^19.2.1",
package/tldraw.css CHANGED
@@ -26,14 +26,25 @@
26
26
  --tl-radius-3: 9px;
27
27
  --tl-radius-4: 11px;
28
28
 
29
- /* Canvas z-index */
29
+ /*
30
+ * Canvas z-index
31
+ *
32
+ * .tl-canvas has `contain: strict` which creates its own stacking context.
33
+ * background, grid, shapes, overlays, and blocker are all children of .tl-canvas,
34
+ * so their z-indices are relative to the canvas, not the container.
35
+ *
36
+ * watermark and canvas-in-front are siblings of .tl-canvas (outside it),
37
+ * so they compete with the UI layer (.tlui-layout at z-index 300).
38
+ * canvas-in-front must be below the UI layer (300) to sit between
39
+ * the canvas and the UI.
40
+ */
30
41
  --tl-layer-canvas-hidden: -999999;
31
42
  --tl-layer-canvas-background: 100;
32
43
  --tl-layer-canvas-grid: 150;
33
44
  --tl-layer-watermark: 200;
45
+ --tl-layer-canvas-in-front: 250;
34
46
  --tl-layer-canvas-shapes: 300;
35
47
  --tl-layer-canvas-overlays: 500;
36
- --tl-layer-canvas-in-front: 600;
37
48
  --tl-layer-canvas-blocker: 10000;
38
49
 
39
50
  /* Canvas overlays z-index */
@@ -64,6 +75,7 @@
64
75
 
65
76
  /* Misc */
66
77
  --tl-zoom: 1;
78
+ --tl-tab-size: 2;
67
79
 
68
80
  /* Cursor SVGs */
69
81
  --tl-cursor-none: none;
@@ -150,6 +162,8 @@
150
162
  --tl-color-selection-fill: hsl(210, 100%, 56%, 24%);
151
163
  --tl-color-selection-stroke: hsl(214, 84%, 56%);
152
164
  --tl-color-background: hsl(210, 20%, 98%);
165
+ /* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css
166
+ they're there to make sure the background color matches the user's preference before the actual app loads*/
153
167
  --tl-color-brush-fill: hsl(0, 0%, 56%, 10.2%);
154
168
  --tl-color-brush-stroke: hsl(0, 0%, 56%, 25.1%);
155
169
  --tl-color-grid: hsl(0, 0%, 43%);
@@ -206,6 +220,8 @@
206
220
  --tl-color-selection-fill: hsl(209, 100%, 57%, 20%);
207
221
  --tl-color-selection-stroke: hsl(214, 84%, 56%);
208
222
  --tl-color-background: hsl(240, 5%, 6.5%);
223
+ /* if you ever update --tl-color-background, update the hardcoded values in theme-init.js and globals.css
224
+ they're there to make sure the background color matches the user's preference before the actual app loads*/
209
225
  --tl-color-brush-fill: hsl(0, 0%, 71%, 5.1%);
210
226
  --tl-color-brush-stroke: hsl(0, 0%, 71%, 25.1%);
211
227
  --tl-color-grid: hsl(0, 0%, 40%);
@@ -899,6 +915,10 @@ input,
899
915
  /* white-space: break-spaces; */
900
916
  }
901
917
 
918
+ .tl-rich-text {
919
+ tab-size: var(--tl-tab-size, 2);
920
+ }
921
+
902
922
  .tl-rich-text p {
903
923
  margin: 0;
904
924
  /* Depending on the extensions, <p> tags can be empty, without a <br />. */
@@ -1166,6 +1186,12 @@ input,
1166
1186
  contain: size layout;
1167
1187
  }
1168
1188
 
1189
+ .tl-canvas-indicators {
1190
+ position: absolute;
1191
+ inset: 0;
1192
+ pointer-events: none;
1193
+ }
1194
+
1169
1195
  /* ---------------------- Shape --------------------- */
1170
1196
 
1171
1197
  .tl-shape {
@@ -1540,15 +1566,6 @@ input,
1540
1566
  cursor: var(--tl-cursor-text);
1541
1567
  }
1542
1568
 
1543
- /* If mobile use 16px as font size */
1544
- /* On iOS, font size under 16px in an input will make the page zoom into the input 🤦‍♂️ */
1545
- /* https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/ */
1546
- @media (max-width: 600px) {
1547
- .tl-frame-heading {
1548
- font-size: 16px;
1549
- }
1550
- }
1551
-
1552
1569
  /* ------------------- Embed Shape ------------------ */
1553
1570
 
1554
1571
  .tl-embed {
@@ -1804,6 +1821,21 @@ it from receiving any pointer events or affecting the cursor. */
1804
1821
  /* @tldraw/ui */
1805
1822
 
1806
1823
  .tl-container {
1824
+ /*
1825
+ * UI z-index layers
1826
+ *
1827
+ * menu-click-capture and panels (.tlui-layout) participate in the
1828
+ * container-level stacking context alongside the canvas layers:
1829
+ * watermark (200) < canvas-in-front (250) < menu-click-capture (250) < panels (300)
1830
+ *
1831
+ * menus, toasts, header-footer, etc. are children of .tlui-layout
1832
+ * (which creates its own stacking context at z-index 300), so their
1833
+ * z-indices are relative to the layout, not the container.
1834
+ *
1835
+ * cursor and following-indicator are rendered inside canvas-in-front
1836
+ * (stacking context at z-index 250), so their z-indices are relative
1837
+ * to that context.
1838
+ */
1807
1839
  --tl-layer-above: 1;
1808
1840
  --tl-layer-focused-input: 10;
1809
1841
  --tl-layer-menu-click-capture: 250;
@@ -1840,13 +1872,15 @@ it from receiving any pointer events or affecting the cursor. */
1840
1872
  z-index: 0;
1841
1873
  }
1842
1874
 
1843
- .tlui-button:disabled {
1875
+ .tlui-button:disabled,
1876
+ .tlui-button[data-disabled] {
1844
1877
  color: var(--tl-color-text-3);
1845
1878
  text-shadow: none;
1846
1879
  cursor: default;
1847
1880
  }
1848
1881
 
1849
- .tlui-button:disabled .tlui-kbd {
1882
+ .tlui-button:disabled .tlui-kbd,
1883
+ .tlui-button[data-disabled] .tlui-kbd {
1850
1884
  color: var(--tl-color-text-3);
1851
1885
  }
1852
1886
 
@@ -1895,7 +1929,7 @@ it from receiving any pointer events or affecting the cursor. */
1895
1929
  }
1896
1930
 
1897
1931
  .tlui-button[data-isactive='true']::after,
1898
- .tlui-button[data-isactive='true']:not(:disabled, :focus-visible):active:after {
1932
+ .tlui-button[data-isactive='true']:not(:disabled, [data-disabled], :focus-visible):active:after {
1899
1933
  background: var(--tl-color-hint);
1900
1934
  opacity: 1;
1901
1935
  }
@@ -1911,11 +1945,11 @@ it from receiving any pointer events or affecting the cursor. */
1911
1945
  opacity: 1;
1912
1946
  }
1913
1947
 
1914
- .tlui-button:not(:disabled):hover {
1948
+ .tlui-button:not(:disabled, [data-disabled]):hover {
1915
1949
  z-index: 1;
1916
1950
  }
1917
1951
 
1918
- .tlui-button:not(:disabled):hover::after {
1952
+ .tlui-button:not(:disabled, [data-disabled]):hover::after {
1919
1953
  opacity: 1;
1920
1954
  }
1921
1955
  }
@@ -1954,11 +1988,11 @@ it from receiving any pointer events or affecting the cursor. */
1954
1988
  }
1955
1989
 
1956
1990
  @media (hover: hover) {
1957
- .tlui-button__primary:not(:disabled, :focus-visible):hover {
1991
+ .tlui-button__primary:not(:disabled, [data-disabled], :focus-visible):hover {
1958
1992
  color: var(--tl-color-primary);
1959
1993
  }
1960
1994
 
1961
- .tlui-button__danger:not(:disabled, :focus-visible):hover {
1995
+ .tlui-button__danger:not(:disabled, [data-disabled], :focus-visible):hover {
1962
1996
  color: var(--tl-color-danger);
1963
1997
  text-shadow: none;
1964
1998
  }
@@ -2046,11 +2080,11 @@ it from receiving any pointer events or affecting the cursor. */
2046
2080
  color: var(--tl-color-selected-contrast);
2047
2081
  }
2048
2082
 
2049
- .tlui-button__tool[aria-pressed='true']:not(:disabled, :focus-visible):active {
2083
+ .tlui-button__tool[aria-pressed='true']:not(:disabled, [data-disabled], :focus-visible):active {
2050
2084
  color: var(--tl-color-selected-contrast);
2051
2085
  }
2052
2086
 
2053
- .tlui-button__tool[aria-pressed='true']:not(:disabled)::after {
2087
+ .tlui-button__tool[aria-pressed='true']:not(:disabled, [data-disabled])::after {
2054
2088
  background: var(--tl-color-selected);
2055
2089
  opacity: 1;
2056
2090
  }
@@ -2324,6 +2358,52 @@ it from receiving any pointer events or affecting the cursor. */
2324
2358
  }
2325
2359
  }
2326
2360
 
2361
+ /* --------------------- Select --------------------- */
2362
+
2363
+ /* Trigger extends .tlui-button with space-between layout */
2364
+ .tlui-select__trigger {
2365
+ justify-content: space-between;
2366
+ gap: var(--tl-space-3);
2367
+ }
2368
+
2369
+ .tlui-select__trigger[data-state='open']::after {
2370
+ opacity: 1;
2371
+ }
2372
+
2373
+ .tlui-select__value {
2374
+ display: flex;
2375
+ align-items: center;
2376
+ gap: var(--tl-space-2);
2377
+ }
2378
+
2379
+ .tlui-select__chevron {
2380
+ flex-shrink: 0;
2381
+ color: var(--tl-color-text-2);
2382
+ }
2383
+
2384
+ /* Content extends .tlui-menu with Radix-aware sizing */
2385
+ .tlui-select__content {
2386
+ min-width: var(--radix-select-trigger-width);
2387
+ max-height: var(--radix-select-content-available-height);
2388
+ }
2389
+
2390
+ .tlui-select__viewport {
2391
+ padding: 4px 0;
2392
+ }
2393
+
2394
+ /* Item extends .tlui-button__checkbox with left-aligned text */
2395
+ .tlui-select__item {
2396
+ justify-content: flex-start;
2397
+ }
2398
+
2399
+ .tlui-select__item-indicator {
2400
+ visibility: hidden;
2401
+ }
2402
+
2403
+ .tlui-select__item[data-state='checked'] .tlui-select__item-indicator {
2404
+ visibility: visible;
2405
+ }
2406
+
2327
2407
  /* ----------------------- Kbd ---------------------- */
2328
2408
 
2329
2409
  .tlui-kbd {
@@ -3529,6 +3609,12 @@ tldraw? probably.
3529
3609
 
3530
3610
  /* Terrible fix to allow firefox users to scroll the dialog */
3531
3611
  overflow-x: auto;
3612
+
3613
+ scrollbar-width: none;
3614
+ }
3615
+
3616
+ .tlui-shortcuts-dialog__body::-webkit-scrollbar {
3617
+ display: none;
3532
3618
  }
3533
3619
 
3534
3620
  .tlui-shortcuts-dialog__body__tablet {