@jsenv/navi 0.29.438 → 0.29.439
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/dev/jsenv_navi.js +44 -6
- package/dist/dev/jsenv_navi.js.map +2 -2
- package/dist/jsenv_navi.js +44 -6
- package/dist/jsenv_navi.js.map +2 -2
- package/docs/dynamic_import.md +3 -1
- package/docs/resource.md +3 -2
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -38269,13 +38269,10 @@ let activeRouteActionsPrevious = new Set();
|
|
|
38269
38269
|
* The route actions asking something for the page on screen: their route
|
|
38270
38270
|
* matches and their params getter returns something — the running ones, not
|
|
38271
38271
|
* every matching one, so an action bound to every page that asks only when a
|
|
38272
|
-
* popup is open over it counts while it is open.
|
|
38273
|
-
*
|
|
38272
|
+
* popup is open over it counts while it is open. The page's code included (see
|
|
38273
|
+
* `activeRouteReadsSignal` for the set to rerun). Read by `keepPageOnScreen`.
|
|
38274
38274
|
* The set is handed out again only when its members change.
|
|
38275
38275
|
*
|
|
38276
|
-
* A page's code is declared as a route action too; `action.meta.verb` says
|
|
38277
|
-
* which ones read data.
|
|
38278
|
-
*
|
|
38279
38276
|
* @type {import("@preact/signals").ReadonlySignal<Set<object>>}
|
|
38280
38277
|
*/
|
|
38281
38278
|
const activeRouteActionsSignal = computed(() => {
|
|
@@ -38292,6 +38289,36 @@ const activeRouteActionsSignal = computed(() => {
|
|
|
38292
38289
|
return active;
|
|
38293
38290
|
});
|
|
38294
38291
|
|
|
38292
|
+
let activeRouteReadsPrevious = new Set();
|
|
38293
|
+
/**
|
|
38294
|
+
* `activeRouteActionsSignal` without the page's code: what to rerun to read
|
|
38295
|
+
* the page on screen again, the app back from the background. A page's code
|
|
38296
|
+
* has nothing to read again — a module does not change until a deploy — and
|
|
38297
|
+
* rerunning it is not free: a page reading its code the delegated way
|
|
38298
|
+
* (`useAsyncData(CODE)` under a `<Loading>`) leaves the document for the frame
|
|
38299
|
+
* the import takes, and its lists lose their scroll position.
|
|
38300
|
+
*
|
|
38301
|
+
* Code is told by its answer: a function (the page component) or a module
|
|
38302
|
+
* namespace. An import that failed has none and stays in the set; rerun, it
|
|
38303
|
+
* fails again at once, since the document refuses a module it failed to fetch.
|
|
38304
|
+
*
|
|
38305
|
+
* @type {import("@preact/signals").ReadonlySignal<Set<object>>}
|
|
38306
|
+
*/
|
|
38307
|
+
const activeRouteReadsSignal = computed(() => {
|
|
38308
|
+
const reads = new Set();
|
|
38309
|
+
for (const routeAction of activeRouteActionsSignal.value) {
|
|
38310
|
+
if (isCode(routeAction.valueSignal.value)) {
|
|
38311
|
+
continue;
|
|
38312
|
+
}
|
|
38313
|
+
reads.add(routeAction);
|
|
38314
|
+
}
|
|
38315
|
+
if (haveSameMembers(reads, activeRouteReadsPrevious)) {
|
|
38316
|
+
return activeRouteReadsPrevious;
|
|
38317
|
+
}
|
|
38318
|
+
activeRouteReadsPrevious = reads;
|
|
38319
|
+
return reads;
|
|
38320
|
+
});
|
|
38321
|
+
|
|
38295
38322
|
/**
|
|
38296
38323
|
* Binds an action to a route: it runs when the route matches, with the params
|
|
38297
38324
|
* the effect reads off the address, runs again on a `reload()`, and is aborted
|
|
@@ -38448,6 +38475,17 @@ const anyMatchingRouteSignal = (routes) => {
|
|
|
38448
38475
|
return anyMatchingSignal;
|
|
38449
38476
|
};
|
|
38450
38477
|
|
|
38478
|
+
const isCode = (value) => {
|
|
38479
|
+
if (typeof value === "function") {
|
|
38480
|
+
return true;
|
|
38481
|
+
}
|
|
38482
|
+
return (
|
|
38483
|
+
value !== null &&
|
|
38484
|
+
typeof value === "object" &&
|
|
38485
|
+
value[Symbol.toStringTag] === "Module"
|
|
38486
|
+
);
|
|
38487
|
+
};
|
|
38488
|
+
|
|
38451
38489
|
const rootActionOf = (action) => {
|
|
38452
38490
|
if (action.isProxy) {
|
|
38453
38491
|
return rootActionOf(getActionPrivateProperties(action).currentAction);
|
|
@@ -94374,5 +94412,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
94374
94412
|
})
|
|
94375
94413
|
});
|
|
94376
94414
|
|
|
94377
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, BadgeList, Binder, Box, Button, ButtonCopyToClipboard, CalloutStatusIcon, Caption, CardLayout, CheckSvg, CheckboxGroup, CloseSvg, Code, Col, Colgroup, Color, ConstructionSvg, ControlGroup, ControlSwap, DaySpin, Details, Dialog, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, Expandable, EyeClosedSvg, EyeSvg, Field, FixedBar, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, InfoSvg, Input, InputDuration, Interpolate, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, List, ListItem, ListItemGroup, ListItems, Loading, LoadingDotsSvg, LoadingIndicator, LoadingIndicatorFluid, LoadingOutline, MessageBox, Meter, Nav, NaviDebug, NetworkPolicyError, NumberSpin, Paragraph, Picker, Popover, Popup, Quantity, RadioGroup, Route, RouteTransitionArea, RouteTravel, RowNumberCol, RowNumberTableCell, SVGMaskOverlay, SearchSvg, Select, SelectableInput, SelectionContext, Separator, SettingsSvg, SidePanel, Slide, SlideContainer, Spin, SpinGroup, SplitButton, StarSvg, Step, StepList, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextBox, Textarea, TextareaCharCount, Thead, Time, TimeRange, TimeRangeSpin, TimeRangeWheel, TimeSpin, TimeWheel, Title, Tr, UITransition, Unit, UserSvg, ViewportLayout, Wheel, WheelGroup, WheelItem, actionRunEffect, activeRouteActionsSignal, anyMatchingRouteSignal, applySearch, arraySignalMembership, canNavBackSignal, canNavForwardSignal, coarsePointerSignal, compareTwoJsValues, constraintFromValidityRule, createAction, createAvailableConstraint, createRequestCanceller, createSearch, createSelectionKeyboardShortcuts, createSlot, defineInteractionDetector, defineRouteDefaultTransition, defineRouteTransition, detectHorizontalOverflow, dispatchRequestSetUIState, enableDebugActions, enableDebugOnDocumentLoading, enableVirtualKeyboardOverlay, ensureDocumentStartViewTransition, errorIsDisplayed, filterTableSelection, getNowHours, getNowHoursRoundedToStep, isCellSelected, isColumnSelected, isNetworkPolicyError, isRowSelected, isScrolling, isToday, keepPageOnScreen, languagesSignal, localStorageSignal, markAsOutsideTextFlow, markErrorAsDisplayedBy, moveArrayItemByIndex, moveFocusTo, navBack, navForward, navIntegratedVia, navTo, naviI18n, openCallout, preloadUrl, rawUrlPart, registerGlobalConstraint, reload, rerunActions, resource, route, routeAction, routeFallback, scrollActivitySignal, setBaseUrl, setNetworkPolicy, setPreferredLanguage, setSupportedLanguages, setUrlTargetOptions, setupRoutes, smallTouchScreenSignal, stateSignal, stopLoad, stringifyTableSelectionValue, swapArrayItemByIndex, syncOwnedResourceToSignals, syncResourceToSignals, triggerNaviCommand, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutElement, useCalloutRequestClose, useCanNavBack, useCanNavForward, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDependenciesDiff, useDisplayedLayoutEffect, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useInputGroup, useKeyboardShortcuts, useNavState, useNetworkPolicyReason, useOrderedColumns, usePickerState, usePopupMode, useRouteStatus, useSearchText, useSelectableElement, useSelectionController, useSignalSync, useSlideContainer, useSlideValue, useStateArray, useTitleLevel, useTransitionCover, useUrlSearchParam, useUrlTargetId, valueInLocalStorage, windowWidthSignal };
|
|
94415
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, BadgeList, Binder, Box, Button, ButtonCopyToClipboard, CalloutStatusIcon, Caption, CardLayout, CheckSvg, CheckboxGroup, CloseSvg, Code, Col, Colgroup, Color, ConstructionSvg, ControlGroup, ControlSwap, DaySpin, Details, Dialog, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, Expandable, EyeClosedSvg, EyeSvg, Field, FixedBar, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, InfoSvg, Input, InputDuration, Interpolate, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, List, ListItem, ListItemGroup, ListItems, Loading, LoadingDotsSvg, LoadingIndicator, LoadingIndicatorFluid, LoadingOutline, MessageBox, Meter, Nav, NaviDebug, NetworkPolicyError, NumberSpin, Paragraph, Picker, Popover, Popup, Quantity, RadioGroup, Route, RouteTransitionArea, RouteTravel, RowNumberCol, RowNumberTableCell, SVGMaskOverlay, SearchSvg, Select, SelectableInput, SelectionContext, Separator, SettingsSvg, SidePanel, Slide, SlideContainer, Spin, SpinGroup, SplitButton, StarSvg, Step, StepList, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextBox, Textarea, TextareaCharCount, Thead, Time, TimeRange, TimeRangeSpin, TimeRangeWheel, TimeSpin, TimeWheel, Title, Tr, UITransition, Unit, UserSvg, ViewportLayout, Wheel, WheelGroup, WheelItem, actionRunEffect, activeRouteActionsSignal, activeRouteReadsSignal, anyMatchingRouteSignal, applySearch, arraySignalMembership, canNavBackSignal, canNavForwardSignal, coarsePointerSignal, compareTwoJsValues, constraintFromValidityRule, createAction, createAvailableConstraint, createRequestCanceller, createSearch, createSelectionKeyboardShortcuts, createSlot, defineInteractionDetector, defineRouteDefaultTransition, defineRouteTransition, detectHorizontalOverflow, dispatchRequestSetUIState, enableDebugActions, enableDebugOnDocumentLoading, enableVirtualKeyboardOverlay, ensureDocumentStartViewTransition, errorIsDisplayed, filterTableSelection, getNowHours, getNowHoursRoundedToStep, isCellSelected, isColumnSelected, isNetworkPolicyError, isRowSelected, isScrolling, isToday, keepPageOnScreen, languagesSignal, localStorageSignal, markAsOutsideTextFlow, markErrorAsDisplayedBy, moveArrayItemByIndex, moveFocusTo, navBack, navForward, navIntegratedVia, navTo, naviI18n, openCallout, preloadUrl, rawUrlPart, registerGlobalConstraint, reload, rerunActions, resource, route, routeAction, routeFallback, scrollActivitySignal, setBaseUrl, setNetworkPolicy, setPreferredLanguage, setSupportedLanguages, setUrlTargetOptions, setupRoutes, smallTouchScreenSignal, stateSignal, stopLoad, stringifyTableSelectionValue, swapArrayItemByIndex, syncOwnedResourceToSignals, syncResourceToSignals, triggerNaviCommand, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutElement, useCalloutRequestClose, useCanNavBack, useCanNavForward, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDependenciesDiff, useDisplayedLayoutEffect, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useInputGroup, useKeyboardShortcuts, useNavState, useNetworkPolicyReason, useOrderedColumns, usePickerState, usePopupMode, useRouteStatus, useSearchText, useSelectableElement, useSelectionController, useSignalSync, useSlideContainer, useSlideValue, useStateArray, useTitleLevel, useTransitionCover, useUrlSearchParam, useUrlTargetId, valueInLocalStorage, windowWidthSignal };
|
|
94378
94416
|
//# sourceMappingURL=jsenv_navi.js.map
|