@jsenv/navi 0.20.8 → 0.20.10
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/jsenv_navi.js +42 -110
- package/dist/jsenv_navi.js.map +15 -46
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -9347,18 +9347,9 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9347
9347
|
([, value]) => value === literalValue,
|
|
9348
9348
|
);
|
|
9349
9349
|
|
|
9350
|
-
// Check if any signal
|
|
9351
|
-
//
|
|
9352
|
-
|
|
9353
|
-
const signals = [];
|
|
9354
|
-
let current = pattern;
|
|
9355
|
-
while (current) {
|
|
9356
|
-
signals.push(...current.connections);
|
|
9357
|
-
current = current.parent;
|
|
9358
|
-
}
|
|
9359
|
-
return signals;
|
|
9360
|
-
};
|
|
9361
|
-
|
|
9350
|
+
// Check if any descendant signal can provide this literal
|
|
9351
|
+
// (ancestor signals are excluded since they operate on different path positions
|
|
9352
|
+
// that the current pattern has already "passed")
|
|
9362
9353
|
const getDescendantSignals = (pattern) => {
|
|
9363
9354
|
const signals = [...pattern.connections];
|
|
9364
9355
|
for (const child of pattern.children) {
|
|
@@ -9367,12 +9358,9 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9367
9358
|
return signals;
|
|
9368
9359
|
};
|
|
9369
9360
|
|
|
9370
|
-
const
|
|
9371
|
-
...getAncestorSignals(patternObject),
|
|
9372
|
-
...getDescendantSignals(patternObject),
|
|
9373
|
-
];
|
|
9361
|
+
const descendantSignals = getDescendantSignals(patternObject);
|
|
9374
9362
|
|
|
9375
|
-
const systemCanProvide =
|
|
9363
|
+
const systemCanProvide = descendantSignals.some((conn) => {
|
|
9376
9364
|
const signalValue = conn.signal.value;
|
|
9377
9365
|
return signalValue === literalValue && conn.isCustomValue(signalValue);
|
|
9378
9366
|
});
|
|
@@ -9956,8 +9944,12 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9956
9944
|
|
|
9957
9945
|
const parentPatternObj = currentPatternObj.parent;
|
|
9958
9946
|
|
|
9959
|
-
// Add parent's signal parameters
|
|
9947
|
+
// Add parent's signal parameters (query params only, not path params)
|
|
9948
|
+
// Path params from ancestors are structural path segments, not inheritable
|
|
9960
9949
|
for (const connection of parentPatternObj.connections) {
|
|
9950
|
+
if (connection.paramType === "path") {
|
|
9951
|
+
continue;
|
|
9952
|
+
}
|
|
9961
9953
|
const { paramName } = connection;
|
|
9962
9954
|
|
|
9963
9955
|
// Skip if child route already handles this parameter
|
|
@@ -10934,7 +10926,12 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
10934
10926
|
// Traverse up the parent chain to inherit parameters
|
|
10935
10927
|
while (currentParent) {
|
|
10936
10928
|
// Check parent's signal connections for non-default values to inherit
|
|
10929
|
+
// Only inherit query (search) parameters, not path parameters
|
|
10930
|
+
// Path parameters are structural and correspond to specific path segments
|
|
10937
10931
|
for (const parentConnection of currentParent.connections) {
|
|
10932
|
+
if (parentConnection.paramType === "path") {
|
|
10933
|
+
continue;
|
|
10934
|
+
}
|
|
10938
10935
|
const { paramName } = parentConnection;
|
|
10939
10936
|
if (paramName in finalParams) {
|
|
10940
10937
|
continue; // Already have this parameter
|
|
@@ -19143,6 +19140,7 @@ const TextOverflow = ({
|
|
|
19143
19140
|
const [OverflowPinnedElement, setOverflowPinnedElement] = useState(null);
|
|
19144
19141
|
return jsx(Text, {
|
|
19145
19142
|
flex: true,
|
|
19143
|
+
block: true,
|
|
19146
19144
|
as: "div",
|
|
19147
19145
|
nowWrap: noWrap,
|
|
19148
19146
|
pre: !noWrap
|
|
@@ -19722,6 +19720,9 @@ const RectangleLoadingSvg = ({
|
|
|
19722
19720
|
|
|
19723
19721
|
// ✅ Check if this should be a circle - only if width and height are nearly equal
|
|
19724
19722
|
const maxPossibleRadius = Math.min(drawableWidth, drawableHeight) / 2;
|
|
19723
|
+
radius = resolveCSSSize(radius, {
|
|
19724
|
+
availableSize: Math.min(width, height)
|
|
19725
|
+
});
|
|
19725
19726
|
const actualRadius = Math.min(radius || Math.min(drawableWidth, drawableHeight) * 0.05, maxPossibleRadius // ✅ Limité au radius maximum possible
|
|
19726
19727
|
);
|
|
19727
19728
|
const aspectRatio = Math.max(drawableWidth, drawableHeight) / Math.min(drawableWidth, drawableHeight);
|
|
@@ -19841,9 +19842,10 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
19841
19842
|
z-index: 1;
|
|
19842
19843
|
opacity: 0;
|
|
19843
19844
|
pointer-events: none;
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19845
|
+
|
|
19846
|
+
&[data-visible] {
|
|
19847
|
+
opacity: 1;
|
|
19848
|
+
}
|
|
19847
19849
|
}
|
|
19848
19850
|
`;
|
|
19849
19851
|
const LoaderBackground = ({
|
|
@@ -19852,6 +19854,7 @@ const LoaderBackground = ({
|
|
|
19852
19854
|
targetSelector,
|
|
19853
19855
|
color,
|
|
19854
19856
|
inset = 0,
|
|
19857
|
+
borderRadius = 0,
|
|
19855
19858
|
spacingTop = 0,
|
|
19856
19859
|
spacingLeft = 0,
|
|
19857
19860
|
spacingBottom = 0,
|
|
@@ -19880,6 +19883,7 @@ const LoaderBackground = ({
|
|
|
19880
19883
|
loading: loading,
|
|
19881
19884
|
color: color,
|
|
19882
19885
|
inset: inset,
|
|
19886
|
+
borderRadius: borderRadius,
|
|
19883
19887
|
spacingTop: spacingTop,
|
|
19884
19888
|
spacingLeft: spacingLeft,
|
|
19885
19889
|
spacingBottom: spacingBottom,
|
|
@@ -19892,6 +19896,7 @@ const LoaderBackgroundWithPortal = ({
|
|
|
19892
19896
|
loading,
|
|
19893
19897
|
color,
|
|
19894
19898
|
inset,
|
|
19899
|
+
borderRadius,
|
|
19895
19900
|
spacingTop,
|
|
19896
19901
|
spacingLeft,
|
|
19897
19902
|
spacingBottom,
|
|
@@ -19917,7 +19922,8 @@ const LoaderBackgroundWithPortal = ({
|
|
|
19917
19922
|
right: `${inset + spacingRight}px`
|
|
19918
19923
|
},
|
|
19919
19924
|
children: shouldShowSpinner && jsx(RectangleLoading, {
|
|
19920
|
-
color: color
|
|
19925
|
+
color: color,
|
|
19926
|
+
radius: borderRadius
|
|
19921
19927
|
})
|
|
19922
19928
|
}), children]
|
|
19923
19929
|
});
|
|
@@ -19926,100 +19932,25 @@ const LoaderBackgroundBasic = ({
|
|
|
19926
19932
|
loading,
|
|
19927
19933
|
targetSelector,
|
|
19928
19934
|
color,
|
|
19935
|
+
borderWidth = 0,
|
|
19936
|
+
borderRadius = 0,
|
|
19929
19937
|
spacingTop,
|
|
19930
19938
|
spacingLeft,
|
|
19931
19939
|
spacingBottom,
|
|
19932
19940
|
spacingRight,
|
|
19941
|
+
marginTop = 0,
|
|
19942
|
+
marginLeft = 0,
|
|
19943
|
+
marginBottom = 0,
|
|
19944
|
+
marginRight = 0,
|
|
19945
|
+
paddingTop = 0,
|
|
19946
|
+
paddingLeft = 0,
|
|
19947
|
+
paddingBottom = 0,
|
|
19948
|
+
paddingRight = 0,
|
|
19933
19949
|
inset,
|
|
19934
19950
|
children
|
|
19935
19951
|
}) => {
|
|
19936
19952
|
const shouldShowSpinner = useDebounceTrue(loading, 300);
|
|
19937
19953
|
const rectangleRef = useRef(null);
|
|
19938
|
-
const [, setOutlineOffset] = useState(0);
|
|
19939
|
-
const [borderRadius, setBorderRadius] = useState(0);
|
|
19940
|
-
const [borderTopWidth, setBorderTopWidth] = useState(0);
|
|
19941
|
-
const [borderLeftWidth, setBorderLeftWidth] = useState(0);
|
|
19942
|
-
const [borderRightWidth, setBorderRightWidth] = useState(0);
|
|
19943
|
-
const [borderBottomWidth, setBorderBottomWidth] = useState(0);
|
|
19944
|
-
const [marginTop, setMarginTop] = useState(0);
|
|
19945
|
-
const [marginBottom, setMarginBottom] = useState(0);
|
|
19946
|
-
const [marginLeft, setMarginLeft] = useState(0);
|
|
19947
|
-
const [marginRight, setMarginRight] = useState(0);
|
|
19948
|
-
const [paddingTop, setPaddingTop] = useState(0);
|
|
19949
|
-
const [paddingLeft, setPaddingLeft] = useState(0);
|
|
19950
|
-
const [paddingRight, setPaddingRight] = useState(0);
|
|
19951
|
-
const [paddingBottom, setPaddingBottom] = useState(0);
|
|
19952
|
-
const [currentColor, setCurrentColor] = useState(color);
|
|
19953
|
-
useLayoutEffect(() => {
|
|
19954
|
-
let animationFrame;
|
|
19955
|
-
const updateStyles = () => {
|
|
19956
|
-
const rectangle = rectangleRef.current;
|
|
19957
|
-
if (!rectangle) {
|
|
19958
|
-
return;
|
|
19959
|
-
}
|
|
19960
|
-
const container = rectangle.parentElement;
|
|
19961
|
-
const containedElement = rectangle.nextElementSibling;
|
|
19962
|
-
const target = targetSelector ? container.querySelector(targetSelector) : containedElement;
|
|
19963
|
-
if (target) {
|
|
19964
|
-
const {
|
|
19965
|
-
width,
|
|
19966
|
-
height
|
|
19967
|
-
} = target.getBoundingClientRect();
|
|
19968
|
-
const containedComputedStyle = window.getComputedStyle(containedElement);
|
|
19969
|
-
const targetComputedStyle = window.getComputedStyle(target);
|
|
19970
|
-
const newBorderTopWidth = resolveCSSSize(targetComputedStyle.borderTopWidth);
|
|
19971
|
-
const newBorderLeftWidth = resolveCSSSize(targetComputedStyle.borderLeftWidth);
|
|
19972
|
-
const newBorderRightWidth = resolveCSSSize(targetComputedStyle.borderRightWidth);
|
|
19973
|
-
const newBorderBottomWidth = resolveCSSSize(targetComputedStyle.borderBottomWidth);
|
|
19974
|
-
const newBorderRadius = resolveCSSSize(targetComputedStyle.borderRadius, {
|
|
19975
|
-
availableSize: Math.min(width, height)
|
|
19976
|
-
});
|
|
19977
|
-
const newOutlineColor = targetComputedStyle.outlineColor;
|
|
19978
|
-
const newBorderColor = targetComputedStyle.borderColor;
|
|
19979
|
-
const newDetectedColor = targetComputedStyle.color;
|
|
19980
|
-
const newOutlineOffset = resolveCSSSize(targetComputedStyle.outlineOffset);
|
|
19981
|
-
const newMarginTop = resolveCSSSize(targetComputedStyle.marginTop);
|
|
19982
|
-
const newMarginBottom = resolveCSSSize(targetComputedStyle.marginBottom);
|
|
19983
|
-
const newMarginLeft = resolveCSSSize(targetComputedStyle.marginLeft);
|
|
19984
|
-
const newMarginRight = resolveCSSSize(targetComputedStyle.marginRight);
|
|
19985
|
-
const paddingTop = resolveCSSSize(containedComputedStyle.paddingTop);
|
|
19986
|
-
const paddingLeft = resolveCSSSize(containedComputedStyle.paddingLeft);
|
|
19987
|
-
const paddingRight = resolveCSSSize(containedComputedStyle.paddingRight);
|
|
19988
|
-
const paddingBottom = resolveCSSSize(containedComputedStyle.paddingBottom);
|
|
19989
|
-
setBorderTopWidth(newBorderTopWidth);
|
|
19990
|
-
setBorderLeftWidth(newBorderLeftWidth);
|
|
19991
|
-
setBorderRightWidth(newBorderRightWidth);
|
|
19992
|
-
setBorderBottomWidth(newBorderBottomWidth);
|
|
19993
|
-
setBorderRadius(newBorderRadius);
|
|
19994
|
-
setOutlineOffset(newOutlineOffset);
|
|
19995
|
-
setMarginTop(newMarginTop);
|
|
19996
|
-
setMarginBottom(newMarginBottom);
|
|
19997
|
-
setMarginLeft(newMarginLeft);
|
|
19998
|
-
setMarginRight(newMarginRight);
|
|
19999
|
-
setPaddingTop(paddingTop);
|
|
20000
|
-
setPaddingLeft(paddingLeft);
|
|
20001
|
-
setPaddingRight(paddingRight);
|
|
20002
|
-
setPaddingBottom(paddingBottom);
|
|
20003
|
-
if (color) {
|
|
20004
|
-
// const resolvedColor = resolveCSSColor(color, rectangle, "css");
|
|
20005
|
-
// console.log(resolvedColor);
|
|
20006
|
-
setCurrentColor(color);
|
|
20007
|
-
} else if (newOutlineColor && newOutlineColor !== "rgba(0, 0, 0, 0)" && (document.activeElement === containedElement || newBorderColor === "rgba(0, 0, 0, 0)")) {
|
|
20008
|
-
setCurrentColor(newOutlineColor);
|
|
20009
|
-
} else if (newBorderColor && newBorderColor !== "rgba(0, 0, 0, 0)") {
|
|
20010
|
-
setCurrentColor(newBorderColor);
|
|
20011
|
-
} else {
|
|
20012
|
-
setCurrentColor(newDetectedColor);
|
|
20013
|
-
}
|
|
20014
|
-
}
|
|
20015
|
-
// updateStyles is very cheap so we run it every frame
|
|
20016
|
-
animationFrame = requestAnimationFrame(updateStyles);
|
|
20017
|
-
};
|
|
20018
|
-
updateStyles();
|
|
20019
|
-
return () => {
|
|
20020
|
-
cancelAnimationFrame(animationFrame);
|
|
20021
|
-
};
|
|
20022
|
-
}, [color, targetSelector]);
|
|
20023
19954
|
spacingTop += inset;
|
|
20024
19955
|
// spacingTop += outlineOffset;
|
|
20025
19956
|
// spacingTop -= borderTopWidth;
|
|
@@ -20044,7 +19975,7 @@ const LoaderBackgroundBasic = ({
|
|
|
20044
19975
|
spacingRight += paddingRight;
|
|
20045
19976
|
spacingBottom += paddingBottom;
|
|
20046
19977
|
}
|
|
20047
|
-
const maxBorderWidth = Math.max(
|
|
19978
|
+
const maxBorderWidth = Math.max(borderWidth);
|
|
20048
19979
|
const halfMaxBorderSize = maxBorderWidth / 2;
|
|
20049
19980
|
const size = halfMaxBorderSize < 2 ? 2 : halfMaxBorderSize;
|
|
20050
19981
|
const lineHalfSize = size / 2;
|
|
@@ -20065,7 +19996,7 @@ const LoaderBackgroundBasic = ({
|
|
|
20065
19996
|
},
|
|
20066
19997
|
children: loading && jsx(RectangleLoading, {
|
|
20067
19998
|
shouldShowSpinner: shouldShowSpinner,
|
|
20068
|
-
color:
|
|
19999
|
+
color: color,
|
|
20069
20000
|
radius: borderRadius,
|
|
20070
20001
|
size: size
|
|
20071
20002
|
})
|
|
@@ -24635,7 +24566,8 @@ const InputRadioBasic = props => {
|
|
|
24635
24566
|
loading: innerLoading,
|
|
24636
24567
|
inset: -1,
|
|
24637
24568
|
targetSelector: ".navi_radio_field",
|
|
24638
|
-
color: "var(--loader-color)"
|
|
24569
|
+
color: "var(--loader-color)",
|
|
24570
|
+
borderRadius: "50%"
|
|
24639
24571
|
}), renderRadioMemoized, jsx("span", {
|
|
24640
24572
|
className: "navi_radio_field",
|
|
24641
24573
|
children: appearance === "radio" ? jsxs("svg", {
|