tldraw 3.16.0-canary.fa3749606e52 → 3.16.0-next.34fddf633325
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.d.ts +32 -34
- package/dist-cjs/index.js +7 -2
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js +1 -1
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js +10 -1
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js +35 -0
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js.map +7 -0
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js +3 -3
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +2 -0
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +168 -137
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +3 -2
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
- package/dist-cjs/lib/ui/components/menu-items.js +6 -0
- package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +11 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +267 -0
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +7 -0
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +1 -149
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js +3 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
- package/dist-cjs/lib/ui/context/actions.js +15 -0
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/context/events.js.map +1 -1
- package/dist-cjs/lib/ui/hooks/useTools.js +9 -76
- package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +3 -0
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-esm/index.d.mts +32 -34
- package/dist-esm/index.mjs +11 -3
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs +1 -1
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs +10 -1
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs +19 -0
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs.map +7 -0
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs +3 -5
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs +3 -1
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +168 -137
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +3 -3
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +3 -2
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
- package/dist-esm/lib/ui/components/menu-items.mjs +6 -0
- package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +11 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +237 -0
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +7 -0
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +3 -157
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs +3 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +15 -0
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/context/events.mjs.map +1 -1
- package/dist-esm/lib/ui/hooks/useTools.mjs +10 -83
- package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +3 -0
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +8 -2
- package/src/lib/shapes/arrow/arrowTargetState.ts +2 -1
- package/src/lib/shapes/shared/usePrefersReducedMotion.tsx +11 -1
- package/src/lib/tools/SelectTool/childStates/Translating.ts +1 -0
- package/src/lib/ui/components/AccessibilityMenu.tsx +20 -0
- package/src/lib/ui/components/MainMenu/DefaultMainMenuContent.tsx +4 -4
- package/src/lib/ui/components/StylePanel/DefaultStylePanel.tsx +3 -1
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +171 -128
- package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +3 -3
- package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +14 -11
- package/src/lib/ui/components/menu-items.tsx +8 -0
- package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +19 -3
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +313 -0
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +2 -213
- package/src/lib/ui/context/TldrawUiContextProvider.tsx +23 -20
- package/src/lib/ui/context/actions.tsx +15 -0
- package/src/lib/ui/context/events.tsx +1 -1
- package/src/lib/ui/hooks/useTools.tsx +10 -118
- package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +3 -0
- package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +3 -0
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/ui.css +57 -1
- package/src/test/arrows-megabus.test.tsx +12 -6
- package/src/test/inner-outer-margin.test.ts +315 -0
- package/tldraw.css +59 -1
package/tldraw.css
CHANGED
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
--color-selected: hsl(214, 84%, 56%);
|
|
168
168
|
--color-selected-contrast: hsl(0, 0%, 100%);
|
|
169
169
|
--color-focus: hsl(219, 65%, 50%);
|
|
170
|
+
--color-tooltip: hsla(200, 14%, 4%, 1);
|
|
170
171
|
/* Text */
|
|
171
172
|
--color-text: hsl(0, 0%, 0%);
|
|
172
173
|
--color-text-0: hsl(0, 0%, 11%);
|
|
@@ -222,6 +223,7 @@
|
|
|
222
223
|
--color-selected: hsl(217, 89%, 61%);
|
|
223
224
|
--color-selected-contrast: hsl(0, 0%, 100%);
|
|
224
225
|
--color-focus: hsl(217, 76%, 80%);
|
|
226
|
+
--color-tooltip: hsla(0, 0%, 100%, 1);
|
|
225
227
|
/* Text */
|
|
226
228
|
--color-text: hsl(210, 17%, 98%);
|
|
227
229
|
--color-text-0: hsl(0, 9%, 94%);
|
|
@@ -1875,7 +1877,7 @@ it from receiving any pointer events or affecting the cursor. */
|
|
|
1875
1877
|
opacity: 1;
|
|
1876
1878
|
}
|
|
1877
1879
|
|
|
1878
|
-
.tlui-button[aria-expanded='true'][data-direction='left']
|
|
1880
|
+
.tlui-button[aria-expanded='true'][data-direction='left'] {
|
|
1879
1881
|
background: linear-gradient(270deg, rgba(144, 144, 144, 0) 0%, var(--color-muted-2) 100%);
|
|
1880
1882
|
opacity: 1;
|
|
1881
1883
|
}
|
|
@@ -2778,6 +2780,12 @@ it from receiving any pointer events or affecting the cursor. */
|
|
|
2778
2780
|
max-width: 148px;
|
|
2779
2781
|
}
|
|
2780
2782
|
|
|
2783
|
+
.tlui-style-panel[data-show-ui-labels='true'] .tlui-button[data-isactive='true'] {
|
|
2784
|
+
border-radius: 10px;
|
|
2785
|
+
outline: 2px solid var(--color-text);
|
|
2786
|
+
outline-offset: -5px;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2781
2789
|
.tlui-style-panel::-webkit-scrollbar {
|
|
2782
2790
|
display: none;
|
|
2783
2791
|
}
|
|
@@ -2842,6 +2850,26 @@ it from receiving any pointer events or affecting the cursor. */
|
|
|
2842
2850
|
}
|
|
2843
2851
|
}
|
|
2844
2852
|
|
|
2853
|
+
/* Accessibility subheadings */
|
|
2854
|
+
|
|
2855
|
+
.tlui-style-panel__section .tlui-style-panel__subheading,
|
|
2856
|
+
.tlui-style-panel__section__common .tlui-style-panel__subheading,
|
|
2857
|
+
.tlui-style-panel__subheading + .tlui-slider__container {
|
|
2858
|
+
margin: 0;
|
|
2859
|
+
padding: var(--space-2) var(--space-3) 0px var(--space-4);
|
|
2860
|
+
font-size: 12px;
|
|
2861
|
+
font-weight: inherit;
|
|
2862
|
+
line-height: inherit;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
.tlui-style-panel .tlui-style-panel__subheading:nth-of-type(1) {
|
|
2866
|
+
padding-top: var(--space-3);
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
.tlui-style-panel__subheading + .tlui-slider__container {
|
|
2870
|
+
padding-top: 0px;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2845
2873
|
/* --------------------- Bottom --------------------- */
|
|
2846
2874
|
|
|
2847
2875
|
.tlui-layout__bottom {
|
|
@@ -3000,6 +3028,36 @@ it from receiving any pointer events or affecting the cursor. */
|
|
|
3000
3028
|
transition: transform 0.15s ease-out 0.05s;
|
|
3001
3029
|
}
|
|
3002
3030
|
|
|
3031
|
+
/* ------------------- Tooltip -------------------- */
|
|
3032
|
+
|
|
3033
|
+
.tlui-tooltip {
|
|
3034
|
+
font-size: 12px;
|
|
3035
|
+
padding: 2px 8px;
|
|
3036
|
+
border-radius: 4px;
|
|
3037
|
+
background-color: var(--color-tooltip);
|
|
3038
|
+
box-shadow: none;
|
|
3039
|
+
color: var(--color-text-shadow);
|
|
3040
|
+
max-width: 400px;
|
|
3041
|
+
width: fit-content;
|
|
3042
|
+
text-align: center;
|
|
3043
|
+
pointer-events: none;
|
|
3044
|
+
will-change: transform, opacity;
|
|
3045
|
+
z-index: 2;
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
.tlui-tooltip__arrow {
|
|
3049
|
+
fill: var(--color-tooltip);
|
|
3050
|
+
will-change: opacity;
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
[data-radix-popper-content-wrapper]:has(.tlui-tooltip) {
|
|
3054
|
+
z-index: var(--layer-toasts) !important;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
[data-radix-popper-content-wrapper]:has(.tlui-tooltip[data-should-animate='true']) {
|
|
3058
|
+
transition: all 0.1s ease-out;
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3003
3061
|
/* ------------------- Debug panel ------------------ */
|
|
3004
3062
|
|
|
3005
3063
|
.tlui-debug-panel {
|