@buoy-gg/floating-tools-core 7.0.33 → 7.0.35
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/lib/commonjs/dial.js +3 -2
- package/lib/commonjs/fonts.js +31 -0
- package/lib/commonjs/icons/generated/glyph-icons.g.js +299 -0
- package/lib/commonjs/icons/generated/icon-data.g.js +89 -110
- package/lib/commonjs/icons/icon-primitives.js +32 -12
- package/lib/commonjs/icons/icon-primitives.native.js +50 -32
- package/lib/commonjs/icons/icon-renderer.js +31 -10
- package/lib/commonjs/icons/iconGlow.js +32 -0
- package/lib/commonjs/index.js +169 -0
- package/lib/module/dial.js +3 -2
- package/lib/module/fonts.js +28 -0
- package/lib/module/icons/generated/glyph-icons.g.js +296 -0
- package/lib/module/icons/generated/icon-data.g.js +89 -110
- package/lib/module/icons/icon-primitives.js +32 -12
- package/lib/module/icons/icon-primitives.native.js +50 -32
- package/lib/module/icons/icon-renderer.js +31 -10
- package/lib/module/icons/iconGlow.js +28 -0
- package/lib/module/index.js +9 -0
- package/lib/typescript/commonjs/dial.d.ts +2 -2
- package/lib/typescript/commonjs/dial.d.ts.map +1 -1
- package/lib/typescript/commonjs/fonts.d.ts +20 -0
- package/lib/typescript/commonjs/fonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/ask-buoy-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/ask-buoy-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/assets-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/assets-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/benchmark-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/benchmark-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/camera-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/camera-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/console-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/console-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/env-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/env-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/events-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/events-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/generated/glyph-icons.g.d.ts +145 -0
- package/lib/typescript/commonjs/icons/generated/glyph-icons.g.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/generated/icon-data.g.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/highlight-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/highlight-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/icon-primitives.d.ts +3 -1
- package/lib/typescript/commonjs/icons/icon-primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/icon-primitives.native.d.ts +7 -0
- package/lib/typescript/commonjs/icons/icon-primitives.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/icon-renderer.d.ts +33 -3
- package/lib/typescript/commonjs/icons/icon-renderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/iconGlow.d.ts +27 -0
- package/lib/typescript/commonjs/icons/iconGlow.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/image-overlay-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/image-overlay-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/images-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/images-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/impersonate-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/impersonate-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/jotai-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/jotai-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/network-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/network-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/query-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/query-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/redux-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/redux-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/renders-icon.d.ts +2 -2
- package/lib/typescript/commonjs/icons/renders-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/riverpod-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/riverpod-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/routes-icon.d.ts +21 -21
- package/lib/typescript/commonjs/icons/routes-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/scenarios-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/scenarios-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/sentry-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/sentry-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/storage-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/storage-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/time-machine-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/time-machine-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/wifi-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/wifi-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/zustand-icon.d.ts +1 -1
- package/lib/typescript/commonjs/icons/zustand-icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/module/dial.d.ts +2 -2
- package/lib/typescript/module/dial.d.ts.map +1 -1
- package/lib/typescript/module/fonts.d.ts +20 -0
- package/lib/typescript/module/fonts.d.ts.map +1 -0
- package/lib/typescript/module/icons/ask-buoy-icon.d.ts +1 -1
- package/lib/typescript/module/icons/ask-buoy-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/assets-icon.d.ts +1 -1
- package/lib/typescript/module/icons/assets-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/benchmark-icon.d.ts +1 -1
- package/lib/typescript/module/icons/benchmark-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/camera-icon.d.ts +1 -1
- package/lib/typescript/module/icons/camera-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/console-icon.d.ts +1 -1
- package/lib/typescript/module/icons/console-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/env-icon.d.ts +1 -1
- package/lib/typescript/module/icons/env-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/events-icon.d.ts +1 -1
- package/lib/typescript/module/icons/events-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/generated/glyph-icons.g.d.ts +145 -0
- package/lib/typescript/module/icons/generated/glyph-icons.g.d.ts.map +1 -0
- package/lib/typescript/module/icons/generated/icon-data.g.d.ts.map +1 -1
- package/lib/typescript/module/icons/highlight-icon.d.ts +1 -1
- package/lib/typescript/module/icons/highlight-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/icon-primitives.d.ts +3 -1
- package/lib/typescript/module/icons/icon-primitives.d.ts.map +1 -1
- package/lib/typescript/module/icons/icon-primitives.native.d.ts +7 -0
- package/lib/typescript/module/icons/icon-primitives.native.d.ts.map +1 -1
- package/lib/typescript/module/icons/icon-renderer.d.ts +33 -3
- package/lib/typescript/module/icons/icon-renderer.d.ts.map +1 -1
- package/lib/typescript/module/icons/iconGlow.d.ts +27 -0
- package/lib/typescript/module/icons/iconGlow.d.ts.map +1 -0
- package/lib/typescript/module/icons/image-overlay-icon.d.ts +1 -1
- package/lib/typescript/module/icons/image-overlay-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/images-icon.d.ts +1 -1
- package/lib/typescript/module/icons/images-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/impersonate-icon.d.ts +1 -1
- package/lib/typescript/module/icons/impersonate-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/jotai-icon.d.ts +1 -1
- package/lib/typescript/module/icons/jotai-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/network-icon.d.ts +1 -1
- package/lib/typescript/module/icons/network-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/query-icon.d.ts +1 -1
- package/lib/typescript/module/icons/query-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/redux-icon.d.ts +1 -1
- package/lib/typescript/module/icons/redux-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/renders-icon.d.ts +2 -2
- package/lib/typescript/module/icons/renders-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/riverpod-icon.d.ts +1 -1
- package/lib/typescript/module/icons/riverpod-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/routes-icon.d.ts +21 -21
- package/lib/typescript/module/icons/routes-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/scenarios-icon.d.ts +1 -1
- package/lib/typescript/module/icons/scenarios-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/sentry-icon.d.ts +1 -1
- package/lib/typescript/module/icons/sentry-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/storage-icon.d.ts +1 -1
- package/lib/typescript/module/icons/storage-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/time-machine-icon.d.ts +1 -1
- package/lib/typescript/module/icons/time-machine-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/wifi-icon.d.ts +1 -1
- package/lib/typescript/module/icons/wifi-icon.d.ts.map +1 -1
- package/lib/typescript/module/icons/zustand-icon.d.ts +1 -1
- package/lib/typescript/module/icons/zustand-icon.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.IconTriangle = exports.IconText = exports.IconSmoothArc = exports.IconSemicircle = exports.IconRect = exports.IconLine = exports.IconContainer = exports.IconCircle = exports.IconArc = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _iconGlow = require("./iconGlow.js");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
/**
|
|
11
12
|
* Icon Primitives - MOBILE (React Native)
|
|
@@ -24,15 +25,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
24
25
|
|
|
25
26
|
const IconContainer = ({
|
|
26
27
|
size,
|
|
27
|
-
children
|
|
28
|
+
children,
|
|
29
|
+
style
|
|
28
30
|
}) => {
|
|
29
|
-
const
|
|
31
|
+
const box = {
|
|
30
32
|
position: 'relative',
|
|
31
33
|
width: size,
|
|
32
34
|
height: size
|
|
33
35
|
};
|
|
34
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
35
|
-
style: style,
|
|
37
|
+
style: [box, style],
|
|
36
38
|
children: children
|
|
37
39
|
});
|
|
38
40
|
};
|
|
@@ -84,8 +86,8 @@ const IconCircleImpl = ({
|
|
|
84
86
|
width: 0,
|
|
85
87
|
height: 0
|
|
86
88
|
},
|
|
87
|
-
shadowOpacity:
|
|
88
|
-
shadowRadius: glowRadius *
|
|
89
|
+
shadowOpacity: _iconGlow.ICON_GLOW.filledShadowOpacity,
|
|
90
|
+
shadowRadius: glowRadius * _iconGlow.ICON_GLOW.filledRadiusScale
|
|
89
91
|
})
|
|
90
92
|
};
|
|
91
93
|
|
|
@@ -107,15 +109,15 @@ const IconCircleImpl = ({
|
|
|
107
109
|
// Matches icon bg - enables shadow
|
|
108
110
|
borderWidth: strokeW,
|
|
109
111
|
borderColor: glowColor,
|
|
110
|
-
opacity:
|
|
112
|
+
opacity: _iconGlow.ICON_GLOW.ringLayerOpacity,
|
|
111
113
|
transform: transforms.length > 0 ? transforms : undefined,
|
|
112
114
|
shadowColor: glowColor,
|
|
113
115
|
shadowOffset: {
|
|
114
116
|
width: 0,
|
|
115
117
|
height: 0
|
|
116
118
|
},
|
|
117
|
-
shadowOpacity:
|
|
118
|
-
shadowRadius:
|
|
119
|
+
shadowOpacity: _iconGlow.ICON_GLOW.ringShadowOpacity,
|
|
120
|
+
shadowRadius: _iconGlow.ICON_GLOW.ringShadowRadius
|
|
119
121
|
}
|
|
120
122
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
121
123
|
style: style
|
|
@@ -203,8 +205,8 @@ const IconRectImpl = ({
|
|
|
203
205
|
width: 0,
|
|
204
206
|
height: 0
|
|
205
207
|
},
|
|
206
|
-
shadowOpacity:
|
|
207
|
-
shadowRadius: glowRadius *
|
|
208
|
+
shadowOpacity: _iconGlow.ICON_GLOW.filledShadowOpacity,
|
|
209
|
+
shadowRadius: glowRadius * _iconGlow.ICON_GLOW.filledRadiusScale
|
|
208
210
|
})
|
|
209
211
|
};
|
|
210
212
|
|
|
@@ -221,17 +223,17 @@ const IconRectImpl = ({
|
|
|
221
223
|
width: width + glowExpand * 2,
|
|
222
224
|
height: height + glowExpand * 2,
|
|
223
225
|
borderRadius: borderRadius + glowExpand,
|
|
224
|
-
borderWidth: strokeW *
|
|
226
|
+
borderWidth: strokeW * _iconGlow.ICON_GLOW.rectBorderScale,
|
|
225
227
|
borderColor: glowColor,
|
|
226
|
-
opacity:
|
|
228
|
+
opacity: _iconGlow.ICON_GLOW.rectLayerOpacity,
|
|
227
229
|
transform: transforms.length > 0 ? transforms : undefined,
|
|
228
230
|
shadowColor: glowColor,
|
|
229
231
|
shadowOffset: {
|
|
230
232
|
width: 0,
|
|
231
233
|
height: 0
|
|
232
234
|
},
|
|
233
|
-
shadowOpacity:
|
|
234
|
-
shadowRadius: strokeW *
|
|
235
|
+
shadowOpacity: _iconGlow.ICON_GLOW.rectShadowOpacity,
|
|
236
|
+
shadowRadius: strokeW * _iconGlow.ICON_GLOW.rectShadowRadiusScale
|
|
235
237
|
}
|
|
236
238
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
237
239
|
style: style
|
|
@@ -414,14 +416,24 @@ const IconLineImpl = ({
|
|
|
414
416
|
const segCenterX = (prev.x + pt.x) / 2;
|
|
415
417
|
const segCenterY = (prev.y + pt.y) / 2;
|
|
416
418
|
|
|
417
|
-
// A capsule
|
|
418
|
-
//
|
|
419
|
+
// A capsule per segment. Interior joints OVERLAP by half a stroke on each side (a
|
|
420
|
+
// capsule exactly segLength long shrinks to a blob when the segment is shorter than
|
|
421
|
+
// the stroke, and neighbouring round ends leave notches on the outside of a turn —
|
|
422
|
+
// the route-path icon rendered as dashes). The chain's two ends stay exactly at the
|
|
423
|
+
// authored endpoints so a curve is the same length as a straight line.
|
|
424
|
+
const extS = i > 1 ? strokeWidth / 2 : 0;
|
|
425
|
+
const extE = i < segments ? strokeWidth / 2 : 0;
|
|
426
|
+
const ux = segLength > 0 ? segDx / segLength : 0;
|
|
427
|
+
const uy = segLength > 0 ? segDy / segLength : 0;
|
|
428
|
+
const capLength = segLength + extS + extE;
|
|
429
|
+
const capCenterX = segCenterX + ux * (extE - extS) / 2;
|
|
430
|
+
const capCenterY = segCenterY + uy * (extE - extS) / 2;
|
|
419
431
|
elements.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
420
432
|
style: {
|
|
421
433
|
position: 'absolute',
|
|
422
|
-
left:
|
|
423
|
-
top:
|
|
424
|
-
width:
|
|
434
|
+
left: capCenterX - capLength / 2,
|
|
435
|
+
top: capCenterY - strokeWidth / 2,
|
|
436
|
+
width: capLength,
|
|
425
437
|
height: strokeWidth,
|
|
426
438
|
borderRadius: strokeWidth / 2,
|
|
427
439
|
backgroundColor: stroke,
|
|
@@ -476,7 +488,7 @@ const IconLineImpl = ({
|
|
|
476
488
|
width: length,
|
|
477
489
|
height: strokeWidth,
|
|
478
490
|
backgroundColor: glowColor,
|
|
479
|
-
opacity:
|
|
491
|
+
opacity: _iconGlow.ICON_GLOW.lineLayerOpacity,
|
|
480
492
|
transform: [{
|
|
481
493
|
rotate: `${totalRotation}deg`
|
|
482
494
|
}],
|
|
@@ -487,8 +499,8 @@ const IconLineImpl = ({
|
|
|
487
499
|
width: 0,
|
|
488
500
|
height: 0
|
|
489
501
|
},
|
|
490
|
-
shadowOpacity:
|
|
491
|
-
shadowRadius:
|
|
502
|
+
shadowOpacity: _iconGlow.ICON_GLOW.lineShadowOpacity,
|
|
503
|
+
shadowRadius: _iconGlow.ICON_GLOW.lineShadowRadius
|
|
492
504
|
}
|
|
493
505
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
494
506
|
style: style
|
|
@@ -631,13 +643,19 @@ const IconArcImpl = ({
|
|
|
631
643
|
const x2 = cx + r * Math.cos(rad2);
|
|
632
644
|
const y2 = cy + r * Math.sin(rad2);
|
|
633
645
|
|
|
634
|
-
// Calculate segment geometry
|
|
646
|
+
// Calculate segment geometry. Interior joints overlap by half a stroke (same reason
|
|
647
|
+
// as the curved-line chain above); the arc's two ends stay at the authored angles.
|
|
635
648
|
const dx = x2 - x1;
|
|
636
649
|
const dy = y2 - y1;
|
|
637
|
-
const
|
|
650
|
+
const segLen = Math.sqrt(dx * dx + dy * dy);
|
|
638
651
|
const angle = Math.atan2(dy, dx) * (180 / Math.PI);
|
|
639
|
-
const
|
|
640
|
-
const
|
|
652
|
+
const extS = i > 0 ? strokeWidth / 2 : 0;
|
|
653
|
+
const extE = i < numSegments - 1 ? strokeWidth / 2 : 0;
|
|
654
|
+
const ux = segLen > 0 ? dx / segLen : 0;
|
|
655
|
+
const uy = segLen > 0 ? dy / segLen : 0;
|
|
656
|
+
const length = segLen + extS + extE;
|
|
657
|
+
const midX = (x1 + x2) / 2 + ux * (extE - extS) / 2;
|
|
658
|
+
const midY = (y1 + y2) / 2 + uy * (extE - extS) / 2;
|
|
641
659
|
const style = {
|
|
642
660
|
position: 'absolute',
|
|
643
661
|
left: midX - length / 2,
|
|
@@ -748,8 +766,8 @@ const IconSemicircleImpl = ({
|
|
|
748
766
|
width: 0,
|
|
749
767
|
height: 0
|
|
750
768
|
},
|
|
751
|
-
shadowOpacity:
|
|
752
|
-
shadowRadius: glowRadius *
|
|
769
|
+
shadowOpacity: _iconGlow.ICON_GLOW.filledShadowOpacity,
|
|
770
|
+
shadowRadius: glowRadius * _iconGlow.ICON_GLOW.filledRadiusScale
|
|
753
771
|
})
|
|
754
772
|
};
|
|
755
773
|
|
|
@@ -774,16 +792,16 @@ const IconSemicircleImpl = ({
|
|
|
774
792
|
borderTopRightRadius: half === 'top' || half === 'right' ? glowR : 0,
|
|
775
793
|
borderBottomLeftRadius: half === 'bottom' || half === 'left' ? glowR : 0,
|
|
776
794
|
borderBottomRightRadius: half === 'bottom' || half === 'right' ? glowR : 0,
|
|
777
|
-
borderWidth: strokeW *
|
|
795
|
+
borderWidth: strokeW * _iconGlow.ICON_GLOW.rectBorderScale,
|
|
778
796
|
borderColor: glowColor,
|
|
779
|
-
opacity:
|
|
797
|
+
opacity: _iconGlow.ICON_GLOW.rectLayerOpacity,
|
|
780
798
|
shadowColor: glowColor,
|
|
781
799
|
shadowOffset: {
|
|
782
800
|
width: 0,
|
|
783
801
|
height: 0
|
|
784
802
|
},
|
|
785
|
-
shadowOpacity:
|
|
786
|
-
shadowRadius: strokeW *
|
|
803
|
+
shadowOpacity: _iconGlow.ICON_GLOW.rectShadowOpacity,
|
|
804
|
+
shadowRadius: strokeW * _iconGlow.ICON_GLOW.rectShadowRadiusScale
|
|
787
805
|
}
|
|
788
806
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
789
807
|
style: style
|
|
@@ -129,8 +129,19 @@ function resolveColor(fill, color, bgColor) {
|
|
|
129
129
|
// Icon Renderer
|
|
130
130
|
// ===========================================
|
|
131
131
|
|
|
132
|
-
function renderIconData(data, size, colorOverride, bgColorOverride
|
|
132
|
+
function renderIconData(data, size, colorOverride, bgColorOverride,
|
|
133
|
+
/**
|
|
134
|
+
* REPLACES every authored stroke and border width (it does not scale them) —
|
|
135
|
+
* lucide's `strokeWidth` prop, for the uniform-weight GLYPH tier whose weight
|
|
136
|
+
* is caller-controlled. Applying it to a brand icon whose elements
|
|
137
|
+
* deliberately vary in weight would flatten it, so only the glyph components
|
|
138
|
+
* pass it. The Flutter twin is `BuoyIconPainter.strokeWidthOverride`.
|
|
139
|
+
*/
|
|
140
|
+
strokeWidthOverride, /** Merged over the icon's box — the lucide components' `style` passthrough. */
|
|
141
|
+
style) {
|
|
133
142
|
const scale = size / 24;
|
|
143
|
+
/** An authored width in icon units → pixels, honouring the override. */
|
|
144
|
+
const sw = authored => (strokeWidthOverride ?? authored) * scale;
|
|
134
145
|
const center = size / 2;
|
|
135
146
|
// Use colorOverride if provided, otherwise use the icon's default color
|
|
136
147
|
const color = colorOverride ?? data.color;
|
|
@@ -139,6 +150,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
139
150
|
const elements = data.elements;
|
|
140
151
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconPrimitives.IconContainer, {
|
|
141
152
|
size: size,
|
|
153
|
+
style: style,
|
|
142
154
|
children: elements.map((el, i) => {
|
|
143
155
|
if (el.type === 'circle') {
|
|
144
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconPrimitives.IconCircle, {
|
|
@@ -147,7 +159,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
147
159
|
r: el.r * scale,
|
|
148
160
|
fill: resolveColor(el.fill, color, bgColor),
|
|
149
161
|
borderColor: el.border ? resolveColor(el.borderColor, color, bgColor) ?? color : undefined,
|
|
150
|
-
borderWidth: el.border ? (el.borderWidth ?? 2)
|
|
162
|
+
borderWidth: el.border ? sw(el.borderWidth ?? 2) : 0,
|
|
151
163
|
opacity: el.opacity,
|
|
152
164
|
scaleX: el.scaleX,
|
|
153
165
|
scaleY: el.scaleY,
|
|
@@ -168,7 +180,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
168
180
|
height: el.height * scale,
|
|
169
181
|
fill: resolveColor(el.fill, color, bgColor),
|
|
170
182
|
borderColor: el.border ? resolveColor(el.borderColor, color, bgColor) ?? color : undefined,
|
|
171
|
-
borderWidth: el.border ? (el.borderWidth ?? 1)
|
|
183
|
+
borderWidth: el.border ? sw(el.borderWidth ?? 1) : 0,
|
|
172
184
|
borderRadius: (el.borderRadius ?? 0) * scale,
|
|
173
185
|
opacity: el.opacity,
|
|
174
186
|
glowColor: el.glow ? color : undefined,
|
|
@@ -185,7 +197,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
185
197
|
x2: center + el.x2 * scale,
|
|
186
198
|
y2: center + el.y2 * scale,
|
|
187
199
|
stroke: resolveColor(el.stroke ?? 'color', color, bgColor),
|
|
188
|
-
strokeWidth: (el.strokeWidth ?? 1)
|
|
200
|
+
strokeWidth: sw(el.strokeWidth ?? 1),
|
|
189
201
|
opacity: el.opacity,
|
|
190
202
|
glowColor: el.glow ? color : undefined,
|
|
191
203
|
glowRadius: el.glow ? (el.glowRadius ?? 4) * scale : 0,
|
|
@@ -215,7 +227,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
215
227
|
startAngle: el.startAngle,
|
|
216
228
|
endAngle: el.endAngle,
|
|
217
229
|
stroke: resolveColor(el.stroke ?? 'color', color, bgColor),
|
|
218
|
-
strokeWidth: (el.strokeWidth ?? 1.5)
|
|
230
|
+
strokeWidth: sw(el.strokeWidth ?? 1.5),
|
|
219
231
|
opacity: el.opacity,
|
|
220
232
|
segments: el.segments
|
|
221
233
|
}, i);
|
|
@@ -228,7 +240,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
228
240
|
half: el.half,
|
|
229
241
|
fill: resolveColor(el.fill, color, bgColor),
|
|
230
242
|
borderColor: el.border ? resolveColor(el.borderColor, color, bgColor) ?? color : undefined,
|
|
231
|
-
borderWidth: el.border ? (el.borderWidth ?? 2)
|
|
243
|
+
borderWidth: el.border ? sw(el.borderWidth ?? 2) : 0,
|
|
232
244
|
opacity: el.opacity,
|
|
233
245
|
glowColor: el.glow ? color : undefined,
|
|
234
246
|
glowRadius: el.glow ? (el.glowRadius ?? 4) * scale : 0
|
|
@@ -254,7 +266,7 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
254
266
|
cy: center + el.cy * scale,
|
|
255
267
|
r: el.r * scale,
|
|
256
268
|
stroke: resolveColor(el.stroke ?? 'color', color, bgColor),
|
|
257
|
-
strokeWidth: (el.strokeWidth ?? 2)
|
|
269
|
+
strokeWidth: sw(el.strokeWidth ?? 2),
|
|
258
270
|
opacity: el.opacity,
|
|
259
271
|
portion: el.portion ?? 'bottom'
|
|
260
272
|
}, i);
|
|
@@ -268,7 +280,14 @@ function renderIconData(data, size, colorOverride, bgColorOverride) {
|
|
|
268
280
|
// Icon Factory
|
|
269
281
|
// ===========================================
|
|
270
282
|
|
|
271
|
-
|
|
283
|
+
/**
|
|
284
|
+
* A Buoy icon component. Deliberately NOT `FC`: React's `FunctionComponent`
|
|
285
|
+
* type admits an async component (`Promise<ReactNode>`), so an `FC` is not
|
|
286
|
+
* assignable to the plain `(props) => ReactNode` slots callers declare for an
|
|
287
|
+
* icon — which is what the hand-drawn lucide components used to satisfy.
|
|
288
|
+
*/
|
|
289
|
+
|
|
290
|
+
function createIcon(data, opts) {
|
|
272
291
|
// Memoised because every prop is a primitive and the body is expensive: an
|
|
273
292
|
// icon rebuilds one element per shape in its data (dozens, for the detailed
|
|
274
293
|
// ones) on every render. Without this, any parent re-render — a settings
|
|
@@ -277,9 +296,11 @@ function createIcon(data) {
|
|
|
277
296
|
const Icon = ({
|
|
278
297
|
size = 24,
|
|
279
298
|
color,
|
|
280
|
-
bgColor
|
|
299
|
+
bgColor,
|
|
300
|
+
strokeWidth,
|
|
301
|
+
style
|
|
281
302
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
282
|
-
children: renderIconData(data, size, color, bgColor)
|
|
303
|
+
children: renderIconData(data, size, color, bgColor, opts?.glyph ? strokeWidth : undefined, style)
|
|
283
304
|
});
|
|
284
305
|
Icon.displayName = 'Icon';
|
|
285
306
|
return /*#__PURE__*/(0, _react.memo)(Icon);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ICON_GLOW = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Icon glow — the numbers behind every `glow: true` element, in ONE table so the ports read
|
|
9
|
+
* them instead of re-typing them (`pnpm parity styles` → Swift/Dart constants).
|
|
10
|
+
*
|
|
11
|
+
* RN renders a glow as a CALayer shadow. A filled element casts its own shadow; a border-only
|
|
12
|
+
* ring or a line gets a separate "glow layer" View drawn underneath (RN shadows need a
|
|
13
|
+
* background colour), with its own opacity and a FIXED shadow radius in points.
|
|
14
|
+
*/
|
|
15
|
+
const ICON_GLOW = exports.ICON_GLOW = {
|
|
16
|
+
/** Filled circle / rect: `shadowOpacity` and `shadowRadius = glowRadius × this`. */
|
|
17
|
+
filledShadowOpacity: 0.9,
|
|
18
|
+
filledRadiusScale: 0.8,
|
|
19
|
+
/** Border-only circle: black-filled twin ring under the real one. */
|
|
20
|
+
ringLayerOpacity: 0.5,
|
|
21
|
+
ringShadowOpacity: 0.9,
|
|
22
|
+
ringShadowRadius: 8,
|
|
23
|
+
/** Line: same line in the glow colour under the real one. */
|
|
24
|
+
lineLayerOpacity: 0.5,
|
|
25
|
+
lineShadowOpacity: 0.9,
|
|
26
|
+
lineShadowRadius: 8,
|
|
27
|
+
/** Border-only rect: twin expanded by the stroke width, border `strokeW × borderScale`. */
|
|
28
|
+
rectLayerOpacity: 0.4,
|
|
29
|
+
rectShadowOpacity: 0.8,
|
|
30
|
+
rectBorderScale: 2,
|
|
31
|
+
rectShadowRadiusScale: 4
|
|
32
|
+
};
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,156 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
FloatingToolsStore: true,
|
|
8
|
+
monoFont: true,
|
|
9
|
+
VISIBLE_HANDLE_WIDTH: true,
|
|
10
|
+
DRAG_THRESHOLD: true,
|
|
11
|
+
ANIMATION_DURATION: true,
|
|
12
|
+
EDGE_PADDING: true,
|
|
13
|
+
SAVE_DEBOUNCE_MS: true,
|
|
14
|
+
STORAGE_KEYS: true,
|
|
15
|
+
DevToolsStateManager: true,
|
|
16
|
+
devToolsStateManager: true,
|
|
17
|
+
devToolsReducer: true,
|
|
18
|
+
getUserStatusConfig: true,
|
|
19
|
+
getGripIconLayout: true,
|
|
20
|
+
filterValidChildren: true,
|
|
21
|
+
easing: true,
|
|
22
|
+
getEasing: true,
|
|
23
|
+
interpolate: true,
|
|
24
|
+
interpolatePosition: true,
|
|
25
|
+
floatingToolsColors: true,
|
|
26
|
+
withAlpha: true,
|
|
27
|
+
MAX_DIAL_SLOTS: true,
|
|
28
|
+
DIAL_START_ANGLE: true,
|
|
29
|
+
DIAL_BUTTON_SIZE: true,
|
|
30
|
+
DIAL_ICON_SIZE: true,
|
|
31
|
+
DIAL_ICON_GLYPH_SIZE: true,
|
|
32
|
+
DIAL_ICON_PADDING: true,
|
|
33
|
+
DIAL_GRID_LINE_COUNT: true,
|
|
34
|
+
dialColors: true,
|
|
35
|
+
dialStyles: true,
|
|
36
|
+
getGridLineRotations: true,
|
|
37
|
+
getDialLayout: true,
|
|
38
|
+
getIconAngle: true,
|
|
39
|
+
getIconPosition: true,
|
|
40
|
+
getAllIconPositions: true,
|
|
41
|
+
dialAnimationConfig: true,
|
|
42
|
+
getIconStaggerInputRange: true,
|
|
43
|
+
dialCSSBeziers: true,
|
|
44
|
+
generateDialCSSKeyframes: true,
|
|
45
|
+
getDialCSSAnimationStyles: true,
|
|
46
|
+
getDialCSSKeyframesString: true,
|
|
47
|
+
getSpiralAnimationPosition: true,
|
|
48
|
+
getStaggeredIconProgress: true,
|
|
49
|
+
USAGE_HALF_LIFE_MS: true,
|
|
50
|
+
USAGE_MIN_SCORE: true,
|
|
51
|
+
decayScore: true,
|
|
52
|
+
recordUsage: true,
|
|
53
|
+
rankToolIds: true,
|
|
54
|
+
pruneUsage: true,
|
|
55
|
+
SETTINGS_STORAGE_KEY: true,
|
|
56
|
+
MAX_SETTINGS_DIAL_SLOTS: true,
|
|
57
|
+
settingsTabs: true,
|
|
58
|
+
settingsColors: true,
|
|
59
|
+
toolColors: true,
|
|
60
|
+
getToolColor: true,
|
|
61
|
+
settingsStyles: true,
|
|
62
|
+
toolLabels: true,
|
|
63
|
+
getToolLabel: true,
|
|
64
|
+
toolDescriptions: true,
|
|
65
|
+
getToolDescription: true,
|
|
66
|
+
globalSettingsConfig: true,
|
|
67
|
+
enforceDialLimit: true,
|
|
68
|
+
sanitizeFloatingSettings: true,
|
|
69
|
+
mergeSettingsWithDefaults: true,
|
|
70
|
+
generateDefaultSettings: true,
|
|
71
|
+
countEnabledTools: true,
|
|
72
|
+
canEnableDialTool: true,
|
|
73
|
+
getEnabledToolIds: true,
|
|
74
|
+
SettingsEventBus: true,
|
|
75
|
+
settingsEventBus: true,
|
|
76
|
+
NetworkIcon: true,
|
|
77
|
+
NETWORK_ICON_COLOR: true,
|
|
78
|
+
EnvIcon: true,
|
|
79
|
+
ENV_ICON_COLOR: true,
|
|
80
|
+
StorageIcon: true,
|
|
81
|
+
STORAGE_ICON_COLOR: true,
|
|
82
|
+
RoutesIcon: true,
|
|
83
|
+
RoutePinIcon: true,
|
|
84
|
+
RoutePathIcon: true,
|
|
85
|
+
RouteDotIcon: true,
|
|
86
|
+
RouteTwoPinsIcon: true,
|
|
87
|
+
CurveTestA: true,
|
|
88
|
+
CurveTestB: true,
|
|
89
|
+
CurveTestC: true,
|
|
90
|
+
CurveTestD: true,
|
|
91
|
+
CurveTestE: true,
|
|
92
|
+
CurveTestF: true,
|
|
93
|
+
CurveTestG: true,
|
|
94
|
+
CurveTestH: true,
|
|
95
|
+
CurveTestI: true,
|
|
96
|
+
CurveTestJ: true,
|
|
97
|
+
CurveTestK: true,
|
|
98
|
+
CurveTestL: true,
|
|
99
|
+
CurveTestM: true,
|
|
100
|
+
CurveTestN: true,
|
|
101
|
+
CurveTestO: true,
|
|
102
|
+
CurveTestP: true,
|
|
103
|
+
ROUTES_ICON_COLOR: true,
|
|
104
|
+
QueryIcon: true,
|
|
105
|
+
QUERY_ICON_COLOR: true,
|
|
106
|
+
HighlighterIcon: true,
|
|
107
|
+
HIGHLIGHTER_ICON_COLOR: true,
|
|
108
|
+
RendersIcon: true,
|
|
109
|
+
RENDERS_ICON_COLOR: true,
|
|
110
|
+
BenchmarkIcon: true,
|
|
111
|
+
BENCHMARK_ICON_COLOR: true,
|
|
112
|
+
SentryIcon: true,
|
|
113
|
+
SENTRY_ICON_COLOR: true,
|
|
114
|
+
WifiIcon: true,
|
|
115
|
+
WIFI_ICON_COLOR: true,
|
|
116
|
+
HighlightIcon: true,
|
|
117
|
+
HIGHLIGHT_ICON_COLOR: true,
|
|
118
|
+
ReduxIcon: true,
|
|
119
|
+
REDUX_ICON_COLOR: true,
|
|
120
|
+
EventsIcon: true,
|
|
121
|
+
EVENTS_ICON_COLOR: true,
|
|
122
|
+
ConsoleIcon: true,
|
|
123
|
+
CONSOLE_ICON_COLOR: true,
|
|
124
|
+
TimeMachineIcon: true,
|
|
125
|
+
TIME_MACHINE_ICON_COLOR: true,
|
|
126
|
+
ScenariosIcon: true,
|
|
127
|
+
SCENARIOS_ICON_COLOR: true,
|
|
128
|
+
AskBuoyIcon: true,
|
|
129
|
+
ASK_BUOY_ICON_COLOR: true,
|
|
130
|
+
ImagesIcon: true,
|
|
131
|
+
IMAGES_ICON_COLOR: true,
|
|
132
|
+
CameraIcon: true,
|
|
133
|
+
CAMERA_ICON_COLOR: true,
|
|
134
|
+
AssetsIcon: true,
|
|
135
|
+
ASSETS_ICON_COLOR: true,
|
|
136
|
+
ImpersonateIcon: true,
|
|
137
|
+
IMPERSONATE_ICON_COLOR: true,
|
|
138
|
+
ImageOverlayIcon: true,
|
|
139
|
+
IMAGE_OVERLAY_ICON_COLOR: true,
|
|
140
|
+
ZustandIcon: true,
|
|
141
|
+
ZUSTAND_ICON_COLOR: true,
|
|
142
|
+
JotaiIcon: true,
|
|
143
|
+
JOTAI_ICON_COLOR: true,
|
|
144
|
+
RiverpodIcon: true,
|
|
145
|
+
RIVERPOD_ICON_COLOR: true,
|
|
146
|
+
createNode: true,
|
|
147
|
+
createLine: true,
|
|
148
|
+
createRing: true,
|
|
149
|
+
createDot: true,
|
|
150
|
+
createGlow: true,
|
|
151
|
+
createArrow: true,
|
|
152
|
+
createBar: true,
|
|
153
|
+
renderIconData: true,
|
|
154
|
+
createIcon: true
|
|
155
|
+
};
|
|
6
156
|
Object.defineProperty(exports, "ANIMATION_DURATION", {
|
|
7
157
|
enumerable: true,
|
|
8
158
|
get: function () {
|
|
@@ -807,6 +957,12 @@ Object.defineProperty(exports, "mergeSettingsWithDefaults", {
|
|
|
807
957
|
return _settings.mergeSettingsWithDefaults;
|
|
808
958
|
}
|
|
809
959
|
});
|
|
960
|
+
Object.defineProperty(exports, "monoFont", {
|
|
961
|
+
enumerable: true,
|
|
962
|
+
get: function () {
|
|
963
|
+
return _fonts.monoFont;
|
|
964
|
+
}
|
|
965
|
+
});
|
|
810
966
|
Object.defineProperty(exports, "pruneUsage", {
|
|
811
967
|
enumerable: true,
|
|
812
968
|
get: function () {
|
|
@@ -886,6 +1042,19 @@ Object.defineProperty(exports, "withAlpha", {
|
|
|
886
1042
|
}
|
|
887
1043
|
});
|
|
888
1044
|
var _FloatingToolsStore = require("./FloatingToolsStore.js");
|
|
1045
|
+
var _fonts = require("./fonts.js");
|
|
1046
|
+
var _glyphIconsG = require("./icons/generated/glyph-icons.g.js");
|
|
1047
|
+
Object.keys(_glyphIconsG).forEach(function (key) {
|
|
1048
|
+
if (key === "default" || key === "__esModule") return;
|
|
1049
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1050
|
+
if (key in exports && exports[key] === _glyphIconsG[key]) return;
|
|
1051
|
+
Object.defineProperty(exports, key, {
|
|
1052
|
+
enumerable: true,
|
|
1053
|
+
get: function () {
|
|
1054
|
+
return _glyphIconsG[key];
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
});
|
|
889
1058
|
var _constants = require("./constants.js");
|
|
890
1059
|
var _devToolsState = require("./devToolsState.js");
|
|
891
1060
|
var _utils = require("./utils.js");
|
package/lib/module/dial.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { monoFont } from "./fonts.js";
|
|
3
4
|
/**
|
|
4
5
|
* Dial Menu - Shared layout calculations, colors, and styling.
|
|
5
6
|
*
|
|
@@ -133,7 +134,7 @@ export const dialStyles = {
|
|
|
133
134
|
fontSize: 10,
|
|
134
135
|
fontWeight: '900',
|
|
135
136
|
letterSpacing: 1,
|
|
136
|
-
fontFamily:
|
|
137
|
+
fontFamily: monoFont
|
|
137
138
|
},
|
|
138
139
|
proText: {
|
|
139
140
|
fontSize: 8,
|
|
@@ -154,7 +155,7 @@ export const dialStyles = {
|
|
|
154
155
|
fontSize: 8,
|
|
155
156
|
fontWeight: '900',
|
|
156
157
|
letterSpacing: 0.3,
|
|
157
|
-
fontFamily:
|
|
158
|
+
fontFamily: monoFont,
|
|
158
159
|
marginTop: 2
|
|
159
160
|
},
|
|
160
161
|
/** Icon wrapper margin bottom */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The monospace family, per platform — THE seam for every `fontFamily` in Buoy.
|
|
7
|
+
*
|
|
8
|
+
* `"monospace"` is an ANDROID family name. iOS has no family called that, so
|
|
9
|
+
* React Native silently falls back to the system font: every code path, header
|
|
10
|
+
* name, JSON value and status chip Buoy renders "in monospace" was actually
|
|
11
|
+
* proportional on iOS. The cross-framework parity sheet is what surfaced it —
|
|
12
|
+
* Flutter resolves `monospace` to a real monospaced face, so its chips came out
|
|
13
|
+
* wider and taller than their RN twins and looked like a port bug.
|
|
14
|
+
*
|
|
15
|
+
* Menlo ships with every iOS version and is the family the ports can name too
|
|
16
|
+
* (Flutter `buoyMonoFont`, SwiftUI `Font.custom("Menlo", …)`), which is what
|
|
17
|
+
* makes the three frameworks draw the same glyphs.
|
|
18
|
+
*
|
|
19
|
+
* On web (the desktop dashboard, react-native-web) the generic `monospace`
|
|
20
|
+
* resolves to a thin, poorly-hinted browser default, so a curated stack is used
|
|
21
|
+
* there instead — the choice `packages/console` had already made locally.
|
|
22
|
+
*/
|
|
23
|
+
export const monoFont = Platform.select({
|
|
24
|
+
ios: "Menlo",
|
|
25
|
+
android: "monospace",
|
|
26
|
+
web: 'ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace',
|
|
27
|
+
default: "monospace"
|
|
28
|
+
}) ?? "monospace";
|