@jsenv/navi 0.20.21 → 0.21.1
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 +70 -40
- package/dist/jsenv_navi.js.map +4 -4
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -9315,7 +9315,7 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9315
9315
|
/**
|
|
9316
9316
|
* Helper: Check if a literal value can be reached through available parameters
|
|
9317
9317
|
*/
|
|
9318
|
-
const canReachLiteralValue = (literalValue, params) => {
|
|
9318
|
+
const canReachLiteralValue = (literalValue, params, literalPosition) => {
|
|
9319
9319
|
// Check parent's own parameters (signals and user params)
|
|
9320
9320
|
const parentCanProvide = connections.some((conn) => {
|
|
9321
9321
|
const signalValue = conn.signal.value;
|
|
@@ -9325,31 +9325,31 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9325
9325
|
effectiveValue === literalValue && conn.isCustomValue(effectiveValue)
|
|
9326
9326
|
);
|
|
9327
9327
|
});
|
|
9328
|
+
if (parentCanProvide) {
|
|
9329
|
+
return true;
|
|
9330
|
+
}
|
|
9328
9331
|
|
|
9329
9332
|
// Check user-provided parameters
|
|
9330
9333
|
const userCanProvide = Object.entries(params).some(
|
|
9331
9334
|
([, value]) => value === literalValue,
|
|
9332
9335
|
);
|
|
9336
|
+
if (userCanProvide) {
|
|
9337
|
+
return true;
|
|
9338
|
+
}
|
|
9333
9339
|
|
|
9334
|
-
// Check if any descendant signal
|
|
9335
|
-
//
|
|
9336
|
-
//
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
const descendantSignals = getDescendantSignals(patternObject);
|
|
9346
|
-
|
|
9347
|
-
const systemCanProvide = descendantSignals.some((conn) => {
|
|
9340
|
+
// Check if any descendant path signal provides this literal value AT THE SAME position.
|
|
9341
|
+
// A signal from /map/isochrone/:tab can provide a literal at position 2 (tab position),
|
|
9342
|
+
// but NOT a literal at position 1 (panel position) — even if the signal value matches.
|
|
9343
|
+
// descendantPathSignals is a Map<segmentIndex, conn[]> precomputed during setupPatterns.
|
|
9344
|
+
const connsAtPosition =
|
|
9345
|
+
patternObject.descendantPathSignals.get(literalPosition);
|
|
9346
|
+
if (!connsAtPosition) {
|
|
9347
|
+
return false;
|
|
9348
|
+
}
|
|
9349
|
+
return connsAtPosition.some((conn) => {
|
|
9348
9350
|
const signalValue = conn.signal.value;
|
|
9349
9351
|
return signalValue === literalValue && conn.isCustomValue(signalValue);
|
|
9350
9352
|
});
|
|
9351
|
-
|
|
9352
|
-
return parentCanProvide || userCanProvide || systemCanProvide;
|
|
9353
9353
|
};
|
|
9354
9354
|
const checkChildRouteCompatibility = (childPatternObj, params) => {
|
|
9355
9355
|
const childParams = {};
|
|
@@ -9419,7 +9419,7 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
9419
9419
|
}
|
|
9420
9420
|
// Parent doesn't have a segment at this position - child extends beyond parent
|
|
9421
9421
|
// Check if any available parameter can produce this literal value
|
|
9422
|
-
else if (!canReachLiteralValue(literalValue, params)) {
|
|
9422
|
+
else if (!canReachLiteralValue(literalValue, params, childPosition)) {
|
|
9423
9423
|
if (DEBUG$2) {
|
|
9424
9424
|
console.debug(
|
|
9425
9425
|
`[${pattern}] INCOMPATIBLE with ${childPatternObj.originalPattern}: cannot reach literal segment "${literalValue}" at position ${childPosition} - no viable parameter path`,
|
|
@@ -11045,6 +11045,7 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
|
|
|
11045
11045
|
children: [],
|
|
11046
11046
|
parent: null,
|
|
11047
11047
|
depth: 0, // Will be calculated after relationships are built
|
|
11048
|
+
descendantPathSignals: new Map(), // Precomputed during setupPatterns (Map<segmentIndex, conn[]>)
|
|
11048
11049
|
|
|
11049
11050
|
// Pattern methods (formerly patternObj methods)
|
|
11050
11051
|
originalPattern: pattern,
|
|
@@ -12138,7 +12139,35 @@ const setupRoutePatterns = (routePatterns) => {
|
|
|
12138
12139
|
);
|
|
12139
12140
|
}
|
|
12140
12141
|
}
|
|
12141
|
-
// Phase 5:
|
|
12142
|
+
// Phase 5: Precompute descendant path signals for each pattern (used by canReachLiteralValue)
|
|
12143
|
+
// Stored as a Map<segmentIndex, conn[]> for O(1) lookup by position.
|
|
12144
|
+
for (const routePattern of routePatternSet) {
|
|
12145
|
+
const descendantPathSignalsByIndex = new Map();
|
|
12146
|
+
const collectDescendantPathSignals = (patternObj) => {
|
|
12147
|
+
for (const conn of patternObj.connections) {
|
|
12148
|
+
if (conn.paramType === "path") {
|
|
12149
|
+
const paramSegment = patternObj.pattern.segments.find(
|
|
12150
|
+
(seg) => seg.type === "param" && seg.name === conn.paramName,
|
|
12151
|
+
);
|
|
12152
|
+
if (paramSegment) {
|
|
12153
|
+
const { index } = paramSegment;
|
|
12154
|
+
let conns = descendantPathSignalsByIndex.get(index);
|
|
12155
|
+
if (!conns) {
|
|
12156
|
+
conns = [];
|
|
12157
|
+
descendantPathSignalsByIndex.set(index, conns);
|
|
12158
|
+
}
|
|
12159
|
+
conns.push(conn);
|
|
12160
|
+
}
|
|
12161
|
+
}
|
|
12162
|
+
}
|
|
12163
|
+
for (const child of patternObj.children) {
|
|
12164
|
+
collectDescendantPathSignals(child);
|
|
12165
|
+
}
|
|
12166
|
+
};
|
|
12167
|
+
collectDescendantPathSignals(routePattern);
|
|
12168
|
+
routePattern.descendantPathSignals = descendantPathSignalsByIndex;
|
|
12169
|
+
}
|
|
12170
|
+
// Phase 6: Calculate depths for all patterns
|
|
12142
12171
|
for (const routePattern of routePatternSet) {
|
|
12143
12172
|
calculatePatternDepth(routePattern);
|
|
12144
12173
|
}
|
|
@@ -21135,8 +21164,6 @@ installImportMetaCssBuild(import.meta);import.meta.css = [/* css */`
|
|
|
21135
21164
|
--button-outline-width: 1px;
|
|
21136
21165
|
--button-border-width: 1px;
|
|
21137
21166
|
--button-border-radius: 2px;
|
|
21138
|
-
--button-padding-x: var(--button-padding, 6px);
|
|
21139
|
-
--button-padding-y: var(--button-padding, 1px);
|
|
21140
21167
|
/* default */
|
|
21141
21168
|
--button-outline-color: var(--navi-focus-outline-color);
|
|
21142
21169
|
--button-loader-color: var(--navi-loader-color);
|
|
@@ -21185,14 +21212,29 @@ installImportMetaCssBuild(import.meta);import.meta.css = [/* css */`
|
|
|
21185
21212
|
}
|
|
21186
21213
|
|
|
21187
21214
|
.navi_button {
|
|
21188
|
-
/* Internal
|
|
21189
|
-
/* allowing to override them on interactions (like hover, disabled, etc.) */
|
|
21215
|
+
/* Internal vars — prefixed with --x- to signal they are private, do not use from outside */
|
|
21190
21216
|
--x-button-outline-width: var(--button-outline-width);
|
|
21191
21217
|
--x-button-border-radius: var(--button-border-radius);
|
|
21192
21218
|
--x-button-border-width: var(--button-border-width);
|
|
21193
21219
|
--x-button-outer-width: calc(
|
|
21194
21220
|
var(--x-button-border-width) + var(--x-button-outline-width)
|
|
21195
21221
|
);
|
|
21222
|
+
--x-button-padding-top: var(
|
|
21223
|
+
--button-padding-top,
|
|
21224
|
+
var(--button-padding-y, var(--button-padding, 1px))
|
|
21225
|
+
);
|
|
21226
|
+
--x-button-padding-right: var(
|
|
21227
|
+
--button-padding-right,
|
|
21228
|
+
var(--button-padding-x, var(--button-padding, 6px))
|
|
21229
|
+
);
|
|
21230
|
+
--x-button-padding-bottom: var(
|
|
21231
|
+
--button-padding-bottom,
|
|
21232
|
+
var(--button-padding-y, var(--button-padding, 1px))
|
|
21233
|
+
);
|
|
21234
|
+
--x-button-padding-left: var(
|
|
21235
|
+
--button-padding-left,
|
|
21236
|
+
var(--button-padding-x, var(--button-padding, 6px))
|
|
21237
|
+
);
|
|
21196
21238
|
--x-button-outline-color: var(--button-outline-color);
|
|
21197
21239
|
--x-button-border-color: var(--button-border-color);
|
|
21198
21240
|
--x-button-background: var(--button-background);
|
|
@@ -21222,22 +21264,10 @@ installImportMetaCssBuild(import.meta);import.meta.css = [/* css */`
|
|
|
21222
21264
|
aspect-ratio: inherit;
|
|
21223
21265
|
width: 100%;
|
|
21224
21266
|
height: 100%;
|
|
21225
|
-
padding-top: var(
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
);
|
|
21229
|
-
padding-right: var(
|
|
21230
|
-
--button-padding-right,
|
|
21231
|
-
var(--button-padding-x, var(--button-padding, unset))
|
|
21232
|
-
);
|
|
21233
|
-
padding-bottom: var(
|
|
21234
|
-
--button-padding-bottom,
|
|
21235
|
-
var(--button-padding-y, var(--button-padding, unset))
|
|
21236
|
-
);
|
|
21237
|
-
padding-left: var(
|
|
21238
|
-
--button-padding-left,
|
|
21239
|
-
var(--button-padding-x, var(--button-padding, unset))
|
|
21240
|
-
);
|
|
21267
|
+
padding-top: var(--x-button-padding-top);
|
|
21268
|
+
padding-right: var(--x-button-padding-right);
|
|
21269
|
+
padding-bottom: var(--x-button-padding-bottom);
|
|
21270
|
+
padding-left: var(--x-button-padding-left);
|
|
21241
21271
|
align-items: inherit;
|
|
21242
21272
|
justify-content: inherit;
|
|
21243
21273
|
color: var(--x-button-color);
|
|
@@ -32009,5 +32039,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
32009
32039
|
})
|
|
32010
32040
|
});
|
|
32011
32041
|
|
|
32012
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextPlaceholder, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
32042
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextPlaceholder, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
32013
32043
|
//# sourceMappingURL=jsenv_navi.js.map
|