@base-framework/base 3.7.69 → 3.7.71

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.
@@ -25,13 +25,22 @@ export class Router {
25
25
  */
26
26
  lastMatchedRoute: object | null;
27
27
  /**
28
- * Tracks the most recently applied scrollTo selector so we can
29
- * detect when navigation moves to a different scroll target
30
- * (a fresh page) versus staying within the same target group
31
- * (e.g. switching sibling tabs that share a sticky header).
32
- * @type {string|null}
28
+ * Identifier of the switch group that owned the most recently
29
+ * applied scroll-target intent. When the next target intent
30
+ * comes from the same group it is treated as a sibling-tab
31
+ * switch (snap-to-sticky); when it comes from a different group
32
+ * (or no group) it is treated as a fresh page navigation and
33
+ * the page is reset to the top first.
34
+ * @type {*}
33
35
  */
34
- lastScrollTarget: string | null;
36
+ lastScrollGroup: any;
37
+ /**
38
+ * Transient field set by `checkGroup` so `select` knows which
39
+ * switch group is currently asking for selection. Cleared after
40
+ * each group's iteration.
41
+ * @type {*}
42
+ */
43
+ currentGroupId: any;
35
44
  /**
36
45
  * Monotonic token used to cancel pending scroll-target waits
37
46
  * when a newer navigation begins.
@@ -146,6 +155,21 @@ export class Router {
146
155
  * @returns {number} the switch id.
147
156
  */
148
157
  resumeSwitch(group: Array<object>, container: object): number;
158
+ /**
159
+ * Runs `checkGroup` for a switch group that is being registered
160
+ * mid-render (after `checkActiveRoutes` has already applied its
161
+ * scroll intent). Any scroll intent produced here is consumed
162
+ * silently — we only use it to seed `lastScrollGroup` so the
163
+ * very first sibling-tab click on this page is recognized as a
164
+ * sibling switch instead of being treated as fresh navigation.
165
+ *
166
+ * @protected
167
+ * @param {*} id
168
+ * @param {object[]} switchArray
169
+ * @returns {void}
170
+ */
171
+ protected checkGroupForRegistration(id: any, switchArray: object[]): void;
172
+ scrollIntent: any;
149
173
  /**
150
174
  * This will get a switch group by id.
151
175
  *
@@ -237,17 +261,6 @@ export class Router {
237
261
  * @param {string} [path]
238
262
  */
239
263
  protected checkActiveRoutes(path?: string): void;
240
- /**
241
- * Reset scroll intent before checking routes.
242
- * Routes will set this during select().
243
- */
244
- scrollIntent: {
245
- type: string;
246
- selector: any;
247
- } | {
248
- type: string;
249
- selector?: undefined;
250
- };
251
264
  /**
252
265
  * Checks all switch groups against the given path.
253
266
  * Activates the first matching route or falls back to the first route in the group if none match.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "3.7.69",
3
+ "version": "3.7.71",
4
4
  "description": "This is a javascript framework.",
5
5
  "main": "./dist/base.js",
6
6
  "type": "module",