tldraw 3.16.0-canary.a03de714c746 → 3.16.0-canary.a962044c3d3b

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 (105) hide show
  1. package/dist-cjs/index.d.ts +26 -1
  2. package/dist-cjs/index.js +4 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js +2 -1
  5. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
  6. package/dist-cjs/lib/ui/components/DefaultMenuPanel.js +3 -2
  7. package/dist-cjs/lib/ui/components/DefaultMenuPanel.js.map +2 -2
  8. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +1 -1
  9. package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
  10. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +2 -1
  11. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
  12. package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js +3 -2
  13. package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js.map +2 -2
  14. package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +2 -2
  15. package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +2 -2
  16. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +14 -14
  17. package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
  18. package/dist-cjs/lib/ui/components/StylePanel/DoubleDropdownPicker.js +3 -3
  19. package/dist-cjs/lib/ui/components/StylePanel/DoubleDropdownPicker.js.map +2 -2
  20. package/dist-cjs/lib/ui/components/StylePanel/DropdownPicker.js +26 -25
  21. package/dist-cjs/lib/ui/components/StylePanel/DropdownPicker.js.map +3 -3
  22. package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +6 -5
  23. package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js.map +2 -2
  24. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +7 -8
  25. package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
  26. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +2 -2
  27. package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
  28. package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js +4 -15
  29. package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js.map +3 -3
  30. package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +1 -1
  31. package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js.map +2 -2
  32. package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js +3 -2
  33. package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js.map +3 -3
  34. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +7 -4
  35. package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
  36. package/dist-cjs/lib/ui/components/primitives/layout.js +51 -0
  37. package/dist-cjs/lib/ui/components/primitives/layout.js.map +7 -0
  38. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +0 -1
  39. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  40. package/dist-cjs/lib/ui/version.js +3 -3
  41. package/dist-cjs/lib/ui/version.js.map +1 -1
  42. package/dist-esm/index.d.mts +26 -1
  43. package/dist-esm/index.mjs +7 -1
  44. package/dist-esm/index.mjs.map +2 -2
  45. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs +2 -1
  46. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
  47. package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs +3 -2
  48. package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs.map +2 -2
  49. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +1 -1
  50. package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
  51. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +2 -1
  52. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
  53. package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs +3 -2
  54. package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs.map +2 -2
  55. package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs +2 -2
  56. package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +2 -2
  57. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +14 -14
  58. package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
  59. package/dist-esm/lib/ui/components/StylePanel/DoubleDropdownPicker.mjs +3 -3
  60. package/dist-esm/lib/ui/components/StylePanel/DoubleDropdownPicker.mjs.map +2 -2
  61. package/dist-esm/lib/ui/components/StylePanel/DropdownPicker.mjs +26 -25
  62. package/dist-esm/lib/ui/components/StylePanel/DropdownPicker.mjs.map +2 -2
  63. package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs +6 -5
  64. package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs.map +2 -2
  65. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +7 -8
  66. package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
  67. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +2 -2
  68. package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
  69. package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs +4 -5
  70. package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs.map +2 -2
  71. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +1 -1
  72. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +2 -2
  73. package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs +3 -2
  74. package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs.map +2 -2
  75. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +7 -4
  76. package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
  77. package/dist-esm/lib/ui/components/primitives/layout.mjs +21 -0
  78. package/dist-esm/lib/ui/components/primitives/layout.mjs.map +7 -0
  79. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +0 -1
  80. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  81. package/dist-esm/lib/ui/version.mjs +3 -3
  82. package/dist-esm/lib/ui/version.mjs.map +1 -1
  83. package/package.json +3 -3
  84. package/src/index.ts +5 -0
  85. package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +2 -1
  86. package/src/lib/ui/components/DefaultMenuPanel.tsx +4 -3
  87. package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +1 -1
  88. package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +3 -2
  89. package/src/lib/ui/components/SharePanel/PeopleMenuItem.tsx +4 -3
  90. package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +3 -3
  91. package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +39 -43
  92. package/src/lib/ui/components/StylePanel/DoubleDropdownPicker.tsx +3 -3
  93. package/src/lib/ui/components/StylePanel/DropdownPicker.tsx +7 -6
  94. package/src/lib/ui/components/Toolbar/DefaultToolbar.tsx +7 -6
  95. package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +8 -9
  96. package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +2 -2
  97. package/src/lib/ui/components/primitives/TldrawUiButtonPicker.tsx +38 -36
  98. package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +1 -1
  99. package/src/lib/ui/components/primitives/TldrawUiPopover.tsx +4 -2
  100. package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +15 -9
  101. package/src/lib/ui/components/primitives/layout.tsx +33 -0
  102. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +0 -1
  103. package/src/lib/ui/version.ts +3 -3
  104. package/src/lib/ui.css +25 -70
  105. package/tldraw.css +25 -70
package/tldraw.css CHANGED
@@ -1941,12 +1941,6 @@ it from receiving any pointer events or affecting the cursor. */
1941
1941
  }
1942
1942
  }
1943
1943
 
1944
- /* Panel button */
1945
-
1946
- .tlui-button__panel {
1947
- position: relative;
1948
- }
1949
-
1950
1944
  /* Menu button */
1951
1945
 
1952
1946
  .tlui-button__menu {
@@ -1987,7 +1981,7 @@ it from receiving any pointer events or affecting the cursor. */
1987
1981
 
1988
1982
  /* Tool lock button */
1989
1983
 
1990
- .tlui-toolbar__lock-button {
1984
+ .tlui-main-toolbar__lock-button {
1991
1985
  position: absolute;
1992
1986
  top: 4px;
1993
1987
  right: 0px;
@@ -1998,7 +1992,7 @@ it from receiving any pointer events or affecting the cursor. */
1998
1992
  border-radius: var(--radius-2);
1999
1993
  }
2000
1994
 
2001
- .tlui-toolbar__lock-button::after {
1995
+ .tlui-main-toolbar__lock-button::after {
2002
1996
  top: 4px;
2003
1997
  left: 8px;
2004
1998
  inset: 4px;
@@ -2010,16 +2004,6 @@ it from receiving any pointer events or affecting the cursor. */
2010
2004
  position: relative;
2011
2005
  height: 48px;
2012
2006
  width: 48px;
2013
- margin-left: -2px;
2014
- margin-right: -2px;
2015
- }
2016
-
2017
- .tlui-button__tool:nth-of-type(1) {
2018
- margin-left: 0px;
2019
- }
2020
-
2021
- .tlui-button__tool:nth-last-of-type(1) {
2022
- margin-right: 0px;
2023
2007
  }
2024
2008
 
2025
2009
  .tlui-button__tool::after {
@@ -2050,47 +2034,30 @@ it from receiving any pointer events or affecting the cursor. */
2050
2034
  width: 16px;
2051
2035
  }
2052
2036
 
2053
- /* Button Row */
2037
+ /* Row layout */
2054
2038
 
2055
- .tlui-buttons__horizontal {
2039
+ .tlui-row {
2056
2040
  display: flex;
2057
2041
  flex-direction: row;
2042
+ padding: 0 2px;
2058
2043
  }
2059
- .tlui-buttons__horizontal > * {
2044
+ .tlui-row > * {
2060
2045
  margin-left: -2px;
2061
2046
  margin-right: -2px;
2062
2047
  }
2063
- .tlui-buttons__horizontal > *:nth-child(1) {
2064
- margin-left: 0px;
2065
- }
2066
- .tlui-buttons__horizontal > *:nth-last-child(1) {
2067
- margin-right: 0px;
2068
- }
2069
2048
 
2070
- /* Button Grid */
2049
+ /* Grid layout */
2071
2050
 
2072
- .tlui-buttons__grid {
2051
+ .tlui-grid {
2073
2052
  display: grid;
2074
- grid-template-columns: repeat(4, auto);
2053
+ grid-template-columns: repeat(4, 1fr);
2075
2054
  grid-auto-flow: row;
2076
2055
  overflow: hidden;
2056
+ padding: 2px;
2077
2057
  }
2078
- .tlui-buttons__grid > .tlui-button {
2058
+ .tlui-grid > * {
2079
2059
  margin: -2px;
2080
2060
  }
2081
- .tlui-buttons__grid > .tlui-button:nth-of-type(4n),
2082
- .tlui-buttons__vertical-align > .tlui-button:nth-of-type(3n) {
2083
- margin-right: 0px;
2084
- }
2085
- .tlui-buttons__grid > .tlui-button:nth-of-type(4n - 3) {
2086
- margin-left: 0px;
2087
- }
2088
- .tlui-buttons__grid > .tlui-button:nth-of-type(-n + 4) {
2089
- margin-top: 0px;
2090
- }
2091
- .tlui-buttons__grid > .tlui-button:nth-last-of-type(-n + 4) {
2092
- margin-bottom: 0px;
2093
- }
2094
2061
 
2095
2062
  /* Zoom button */
2096
2063
 
@@ -2813,12 +2780,8 @@ it from receiving any pointer events or affecting the cursor. */
2813
2780
  border-bottom: 1px solid var(--color-divider);
2814
2781
  }
2815
2782
 
2816
- .tlui-style-panel__row {
2817
- display: flex;
2818
- }
2819
- /* Only really used for the alignment picker */
2820
- .tlui-style-panel__row__extra-button {
2821
- margin-left: -2px;
2783
+ .tlui-style-panel__dropdown-picker:only-child {
2784
+ width: 100%;
2822
2785
  }
2823
2786
 
2824
2787
  .tlui-style-panel__double-select-picker {
@@ -2934,7 +2897,7 @@ it from receiving any pointer events or affecting the cursor. */
2934
2897
  /* --------------------- Toolbar -------------------- */
2935
2898
 
2936
2899
  /* Wide container */
2937
- .tlui-toolbar {
2900
+ .tlui-main-toolbar {
2938
2901
  grid-column: 1 / span 3;
2939
2902
  grid-row: 1;
2940
2903
  display: flex;
@@ -2945,7 +2908,7 @@ it from receiving any pointer events or affecting the cursor. */
2945
2908
  }
2946
2909
 
2947
2910
  /* Centered Content */
2948
- .tlui-toolbar__inner {
2911
+ .tlui-main-toolbar__inner {
2949
2912
  position: relative;
2950
2913
  width: fit-content;
2951
2914
  display: flex;
@@ -2953,12 +2916,12 @@ it from receiving any pointer events or affecting the cursor. */
2953
2916
  align-items: flex-end;
2954
2917
  }
2955
2918
 
2956
- .tlui-toolbar__left {
2919
+ .tlui-main-toolbar__left {
2957
2920
  width: fit-content;
2958
2921
  }
2959
2922
 
2960
2923
  /* Row of controls + lock button */
2961
- .tlui-toolbar__extras {
2924
+ .tlui-main-toolbar__extras {
2962
2925
  position: relative;
2963
2926
  z-index: var(--layer-above);
2964
2927
  width: 100%;
@@ -2967,11 +2930,11 @@ it from receiving any pointer events or affecting the cursor. */
2967
2930
  height: 48px;
2968
2931
  }
2969
2932
 
2970
- .tlui-toolbar__extras:empty {
2933
+ .tlui-main-toolbar__extras:empty {
2971
2934
  display: none;
2972
2935
  }
2973
2936
 
2974
- .tlui-toolbar__extras__controls {
2937
+ .tlui-main-toolbar__extras__controls {
2975
2938
  display: flex;
2976
2939
  position: relative;
2977
2940
  flex-direction: row;
@@ -2986,7 +2949,7 @@ it from receiving any pointer events or affecting the cursor. */
2986
2949
  width: fit-content;
2987
2950
  }
2988
2951
 
2989
- .tlui-toolbar__tools {
2952
+ .tlui-main-toolbar__tools {
2990
2953
  display: flex;
2991
2954
  flex-direction: row;
2992
2955
  align-items: center;
@@ -2997,37 +2960,29 @@ it from receiving any pointer events or affecting the cursor. */
2997
2960
  background: var(--color-panel);
2998
2961
  box-shadow: var(--shadow-2);
2999
2962
  }
3000
- .tlui-toolbar__tools__list {
3001
- display: flex;
3002
- flex-direction: row;
3003
- align-items: center;
3004
- }
3005
2963
 
3006
- .tlui-toolbar__overflow {
2964
+ .tlui-main-toolbar__overflow {
3007
2965
  width: 40px;
2966
+ margin-left: 2px;
3008
2967
  }
3009
2968
 
3010
- .tlui-layout__mobile .tlui-toolbar__overflow {
2969
+ .tlui-layout__mobile .tlui-main-toolbar__overflow {
3011
2970
  width: 32px;
3012
2971
  padding: 0px;
3013
2972
  }
3014
2973
 
3015
- .tlui-toolbar *[data-state='open']::after {
2974
+ .tlui-main-toolbar *[data-state='open']::after {
3016
2975
  background: linear-gradient(0deg, rgba(144, 144, 144, 0) 0%, var(--color-muted-2) 100%);
3017
2976
  opacity: 1;
3018
2977
  }
3019
2978
 
3020
2979
  @media (hover: hover) {
3021
- .tlui-toolbar *[data-state='open']:not(:hover)::after {
2980
+ .tlui-main-toolbar *[data-state='open']:not(:hover)::after {
3022
2981
  background: linear-gradient(0deg, rgba(144, 144, 144, 0) 0%, var(--color-muted-2) 100%);
3023
2982
  opacity: 1;
3024
2983
  }
3025
2984
  }
3026
2985
 
3027
- .tlui-layout__mobile .tlui-toolbar {
3028
- transition: transform 0.15s ease-out 0.05s;
3029
- }
3030
-
3031
2986
  /* ------------------- Tooltip -------------------- */
3032
2987
 
3033
2988
  .tlui-tooltip {