@magmonium/one 0.2.31 → 0.2.33
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/fesm2022/{magmonium-one-magmonium-one-E16R4TXb.mjs → magmonium-one-magmonium-one-B2yxkDxk.mjs} +213 -185
- package/fesm2022/magmonium-one-magmonium-one-B2yxkDxk.mjs.map +1 -0
- package/fesm2022/{magmonium-one-otp-Wnrx8dA_.mjs → magmonium-one-otp-BD-sIswJ.mjs} +2 -2
- package/fesm2022/{magmonium-one-otp-Wnrx8dA_.mjs.map → magmonium-one-otp-BD-sIswJ.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-password-0lBVEtva.mjs → magmonium-one-password-DLDYsPCr.mjs} +2 -2
- package/fesm2022/{magmonium-one-password-0lBVEtva.mjs.map → magmonium-one-password-DLDYsPCr.mjs.map} +1 -1
- package/fesm2022/{magmonium-one-toggle-1lISa76Z.mjs → magmonium-one-toggle-CfNrRJwI.mjs} +2 -2
- package/fesm2022/{magmonium-one-toggle-1lISa76Z.mjs.map → magmonium-one-toggle-CfNrRJwI.mjs.map} +1 -1
- package/fesm2022/magmonium-one.mjs +1 -1
- package/package.json +1 -1
- package/types/magmonium-one.d.ts +11 -11
- package/fesm2022/magmonium-one-magmonium-one-E16R4TXb.mjs.map +0 -1
|
@@ -3446,6 +3446,147 @@ function getNavWidgetEntry(appId) {
|
|
|
3446
3446
|
return windowRegistry().get(appId);
|
|
3447
3447
|
}
|
|
3448
3448
|
|
|
3449
|
+
const emptyResult = () => ({
|
|
3450
|
+
breadcrumb: { header: { label: '', id: '' }, trail: [] },
|
|
3451
|
+
navMenus: [],
|
|
3452
|
+
});
|
|
3453
|
+
/**
|
|
3454
|
+
* One trail/menu entry. `nav` names where it goes by NavId — the NavKind on the
|
|
3455
|
+
* target decides whether following it routes or opens a panel, so nothing here
|
|
3456
|
+
* chooses a link kind (ADR 0014).
|
|
3457
|
+
*/
|
|
3458
|
+
const toTrailItem = (navId, navMap, anchor) => {
|
|
3459
|
+
const nav = navMap[navId];
|
|
3460
|
+
return {
|
|
3461
|
+
id: navId,
|
|
3462
|
+
label: nav?.title ?? navIdSegment(navId),
|
|
3463
|
+
icon: nav?.icon,
|
|
3464
|
+
nav: navId,
|
|
3465
|
+
address: renderAddress(navId, navMap, anchor),
|
|
3466
|
+
};
|
|
3467
|
+
};
|
|
3468
|
+
/** A Nav that *is* its parent's own content rather than a place beside it. */
|
|
3469
|
+
const isDefaultNav = (navId) => navIdSegment(navId) === DEFAULT_NAV_SEGMENT;
|
|
3470
|
+
/**
|
|
3471
|
+
* The Nav the User is standing on as the nav shows it. A `default` node names
|
|
3472
|
+
* no place of its own — it is the route answering its parent's empty path — so
|
|
3473
|
+
* landing on `root_app_default` is standing on `root_app`, and the panel says
|
|
3474
|
+
* so rather than naming a segment that is on no menu.
|
|
3475
|
+
*/
|
|
3476
|
+
const visibleNavId = (navId) => {
|
|
3477
|
+
let id = navId;
|
|
3478
|
+
while (id !== ROOT_NAV$1 && isDefaultNav(id))
|
|
3479
|
+
id = parentNavId(id) ?? ROOT_NAV$1;
|
|
3480
|
+
return id;
|
|
3481
|
+
};
|
|
3482
|
+
/**
|
|
3483
|
+
* The direct children of a Nav. `children` is the authored list, but a Nav that
|
|
3484
|
+
* lists none is not childless: the map already holds every node fetched for
|
|
3485
|
+
* this descent, and a child is named by its own id. Reading the map when the
|
|
3486
|
+
* list is empty is what keeps a generated tree — whose `root.yml` names the app
|
|
3487
|
+
* and nothing else — from titling a leaf over an empty panel.
|
|
3488
|
+
*/
|
|
3489
|
+
const childIdsOf = (navId, navMap) => {
|
|
3490
|
+
const declared = navMap[navId]?.children;
|
|
3491
|
+
if (declared?.length)
|
|
3492
|
+
return declared;
|
|
3493
|
+
return Object.keys(navMap).filter((id) => parentNavId(id) === navId);
|
|
3494
|
+
};
|
|
3495
|
+
/**
|
|
3496
|
+
* The children a menu may draw. A Nav needs a title to be a row at all, and a
|
|
3497
|
+
* `default` node is not a row: it is its parent's own content, so it is
|
|
3498
|
+
* *transparent* — its own children take its place in the list, spliced where
|
|
3499
|
+
* it stood. `app → default → { trending, latest }` is one list of two rows
|
|
3500
|
+
* under app, which is the tree the User was drawing when they put a `default`
|
|
3501
|
+
* in the middle of it. Filtering the node out without adopting its children
|
|
3502
|
+
* left that app with no rows at all.
|
|
3503
|
+
*/
|
|
3504
|
+
const menuChildIds = (navId, navMap) => childIdsOf(navId, navMap).flatMap((childId) => {
|
|
3505
|
+
if (isDefaultNav(childId))
|
|
3506
|
+
return menuChildIds(childId, navMap);
|
|
3507
|
+
return navMap[childId]?.title ? [childId] : [];
|
|
3508
|
+
});
|
|
3509
|
+
/**
|
|
3510
|
+
* Whose children the menu draws. A Nav with rows of its own draws them — that
|
|
3511
|
+
* is the descent. A leaf has none, and descending into nothing left the panel
|
|
3512
|
+
* on an empty state; it draws its *siblings* instead, so the menu stays the
|
|
3513
|
+
* list the User moved through and the row they are on is the one marked
|
|
3514
|
+
* active. Root is the floor: its own children are the last list there is.
|
|
3515
|
+
*/
|
|
3516
|
+
const navMenuOwnerId = (navId, navMap, hasOwnContent = false) => {
|
|
3517
|
+
const visible = visibleNavId(navId);
|
|
3518
|
+
if (visible === ROOT_NAV$1 || menuChildIds(visible, navMap).length) {
|
|
3519
|
+
return visible;
|
|
3520
|
+
}
|
|
3521
|
+
// A panel that answers with a widget of its own keeps its own title —
|
|
3522
|
+
// titling it after its parent while showing its own content reads as the
|
|
3523
|
+
// wrong panel. Being a Murl is not that proof: a Murl leaf nothing is
|
|
3524
|
+
// registered for draws nothing, and an empty panel must not name itself.
|
|
3525
|
+
if (hasOwnContent)
|
|
3526
|
+
return visible;
|
|
3527
|
+
// Nothing of its own and no rows under it: hand the panel to the nearest
|
|
3528
|
+
// ancestor that has rows, so the User reads the list they are in with their
|
|
3529
|
+
// own row marked. Where no ancestor lists anything there is no better title
|
|
3530
|
+
// than the one we are on — a mistitled empty panel is worse than a titled one.
|
|
3531
|
+
for (let ancestor = parentNavId(visible); ancestor; ancestor = parentNavId(ancestor)) {
|
|
3532
|
+
const owner = visibleNavId(ancestor);
|
|
3533
|
+
if (menuChildIds(owner, navMap).length)
|
|
3534
|
+
return owner;
|
|
3535
|
+
if (owner === ROOT_NAV$1)
|
|
3536
|
+
break;
|
|
3537
|
+
}
|
|
3538
|
+
return visible;
|
|
3539
|
+
};
|
|
3540
|
+
const buildNavMenus = (navId, navMap, anchor) => menuChildIds(navId, navMap).map((childId) => toTrailItem(childId, navMap, anchor));
|
|
3541
|
+
/**
|
|
3542
|
+
* Merges a widget's emitted trail over the derived one, matching by depth.
|
|
3543
|
+
* With a single keyspace there is nothing to translate — an emitted entry is
|
|
3544
|
+
* already in the same ids everything else uses.
|
|
3545
|
+
*/
|
|
3546
|
+
const mergeTrail = (derived, override, derivedHeader) => {
|
|
3547
|
+
const depth = (id) => navIdChain(id).length;
|
|
3548
|
+
const trail = derived.map((item) => {
|
|
3549
|
+
const emitted = override.trail?.find((e) => depth(e.id) === depth(item.id));
|
|
3550
|
+
return emitted ? { ...item, ...emitted } : item;
|
|
3551
|
+
});
|
|
3552
|
+
return { trail, header: override.header ?? derivedHeader };
|
|
3553
|
+
};
|
|
3554
|
+
function deriveBreadcrumb(params) {
|
|
3555
|
+
const { navId, navMap, anchor, breadcrumb, navMenu, hasOwnContent } = params;
|
|
3556
|
+
if (!navId)
|
|
3557
|
+
return emptyResult();
|
|
3558
|
+
// The header and the trail belong to whichever Nav owns the menu below them:
|
|
3559
|
+
// on a leaf that is the parent, so the User reads the list they are in with
|
|
3560
|
+
// their own row marked, rather than a title over an empty panel.
|
|
3561
|
+
const ownerId = navMenuOwnerId(navId, navMap, hasOwnContent);
|
|
3562
|
+
// An emitted breadcrumb names the panel it was emitted for. Once the panel
|
|
3563
|
+
// has been handed up to an ancestor it is no longer that panel, so the
|
|
3564
|
+
// override would title the ancestor's list after the leaf we left.
|
|
3565
|
+
const ownPanel = ownerId === visibleNavId(navId);
|
|
3566
|
+
const chain = navIdChain(ownerId);
|
|
3567
|
+
const derivedTrail = chain
|
|
3568
|
+
.slice(0, -1)
|
|
3569
|
+
.filter((id) => !isDefaultNav(id))
|
|
3570
|
+
.map((id) => toTrailItem(id, navMap, anchor));
|
|
3571
|
+
const nav = navMap[ownerId];
|
|
3572
|
+
const derivedHeader = {
|
|
3573
|
+
id: ownerId,
|
|
3574
|
+
label: nav?.title ?? (ownerId === ROOT_NAV$1 ? '' : navIdSegment(ownerId)),
|
|
3575
|
+
icon: nav?.icon,
|
|
3576
|
+
nav: ownerId,
|
|
3577
|
+
address: renderAddress(ownerId, navMap, anchor),
|
|
3578
|
+
};
|
|
3579
|
+
const { trail, header } = breadcrumb && ownPanel
|
|
3580
|
+
? mergeTrail(derivedTrail, breadcrumb, derivedHeader)
|
|
3581
|
+
: { trail: derivedTrail, header: derivedHeader };
|
|
3582
|
+
return {
|
|
3583
|
+
breadcrumb: { trail, header },
|
|
3584
|
+
navMenus: navMenu?.length && ownPanel
|
|
3585
|
+
? navMenu
|
|
3586
|
+
: buildNavMenus(ownerId, navMap, anchor),
|
|
3587
|
+
};
|
|
3588
|
+
}
|
|
3589
|
+
|
|
3449
3590
|
/**
|
|
3450
3591
|
* Platform Nav — the chrome this library owns (CONTEXT.md Platform Nav,
|
|
3451
3592
|
* ADR 0016).
|
|
@@ -3463,15 +3604,9 @@ function getNavWidgetEntry(appId) {
|
|
|
3463
3604
|
* overrides by registering at the same NavId.
|
|
3464
3605
|
*/
|
|
3465
3606
|
/**
|
|
3466
|
-
* Platform
|
|
3467
|
-
*
|
|
3468
|
-
*
|
|
3469
|
-
* that already opens them. Root's runtime rows are App Navs only.
|
|
3470
|
-
*/
|
|
3471
|
-
const PLATFORM_ROOT_CHILDREN = [];
|
|
3472
|
-
/**
|
|
3473
|
-
* Platform Navs reached by a chrome button rather than a root row. Kept out of
|
|
3474
|
-
* `root.children` at runtime so the menu does not duplicate the menubar.
|
|
3607
|
+
* Platform Navs that also carry a chrome button — search, notification and user
|
|
3608
|
+
* in the menubar, settings in the footer. The button is a shortcut to the same
|
|
3609
|
+
* NavId the row names, not a substitute for it: one NavRef, reached either way.
|
|
3475
3610
|
*/
|
|
3476
3611
|
const PLATFORM_BUTTON_NAV_IDS = [
|
|
3477
3612
|
'root_search',
|
|
@@ -3479,6 +3614,13 @@ const PLATFORM_BUTTON_NAV_IDS = [
|
|
|
3479
3614
|
'root_user',
|
|
3480
3615
|
'root_settings',
|
|
3481
3616
|
];
|
|
3617
|
+
/**
|
|
3618
|
+
* Platform children rendered as rows in the root panel — the chrome, behind
|
|
3619
|
+
* whatever App Navs the app authored. A panel that listed the app's pages and
|
|
3620
|
+
* nothing else made chrome reachable only by finding its icon, so the rows are
|
|
3621
|
+
* the readable half of the same NavRefs the buttons hold.
|
|
3622
|
+
*/
|
|
3623
|
+
const PLATFORM_ROOT_CHILDREN = [...PLATFORM_BUTTON_NAV_IDS];
|
|
3482
3624
|
/**
|
|
3483
3625
|
* Root carries no title of its own — an app's `navs/root.yml` names the app,
|
|
3484
3626
|
* and that is the one field of root the asset owns outright.
|
|
@@ -3584,9 +3726,8 @@ const createPlatformNavMap = () => Object.fromEntries(Object.entries(PLATFORM_NA
|
|
|
3584
3726
|
* same id. An extensible one merges: the asset contributes its App Nav
|
|
3585
3727
|
* children (and, at `root`, the app's own `title` / `logo` / `icon`), the
|
|
3586
3728
|
* platform children follow, and NavKind and NavPresentation stay the
|
|
3587
|
-
* library's — so an asset cannot delete chrome
|
|
3588
|
-
*
|
|
3589
|
-
* redefine it.
|
|
3729
|
+
* library's — so an asset cannot delete chrome by omitting it from `root.yml`,
|
|
3730
|
+
* and shipping a closed Platform NavId cannot redefine it.
|
|
3590
3731
|
*/
|
|
3591
3732
|
const mergePlatformNav = (nav, navId) => {
|
|
3592
3733
|
const platform = PLATFORM_NAV_MAP[navId];
|
|
@@ -3595,10 +3736,9 @@ const mergePlatformNav = (nav, navId) => {
|
|
|
3595
3736
|
if (!isExtensiblePlatformNavId(navId))
|
|
3596
3737
|
return { ...platform };
|
|
3597
3738
|
const platformChildren = platform.children ?? [];
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
!(navId === ROOT_NAV$1 && PLATFORM_BUTTON_NAV_IDS.includes(childId)));
|
|
3739
|
+
// An app that listed a platform child of its own gets it once, in the
|
|
3740
|
+
// library's own place: the seed is what fixes chrome's order.
|
|
3741
|
+
const appChildren = (nav.children ?? []).filter((childId) => !platformChildren.includes(childId));
|
|
3602
3742
|
return {
|
|
3603
3743
|
...nav,
|
|
3604
3744
|
kind: platform.kind,
|
|
@@ -3620,151 +3760,6 @@ const unfetchedPlatformNav = (navId) => {
|
|
|
3620
3760
|
: undefined;
|
|
3621
3761
|
};
|
|
3622
3762
|
|
|
3623
|
-
const emptyResult = () => ({
|
|
3624
|
-
breadcrumb: { header: { label: '', id: '' }, trail: [] },
|
|
3625
|
-
navMenus: [],
|
|
3626
|
-
});
|
|
3627
|
-
/**
|
|
3628
|
-
* One trail/menu entry. `nav` names where it goes by NavId — the NavKind on the
|
|
3629
|
-
* target decides whether following it routes or opens a panel, so nothing here
|
|
3630
|
-
* chooses a link kind (ADR 0014).
|
|
3631
|
-
*/
|
|
3632
|
-
const toTrailItem = (navId, navMap, anchor) => {
|
|
3633
|
-
const nav = navMap[navId];
|
|
3634
|
-
return {
|
|
3635
|
-
id: navId,
|
|
3636
|
-
label: nav?.title ?? navIdSegment(navId),
|
|
3637
|
-
icon: nav?.icon,
|
|
3638
|
-
nav: navId,
|
|
3639
|
-
address: renderAddress(navId, navMap, anchor),
|
|
3640
|
-
};
|
|
3641
|
-
};
|
|
3642
|
-
/** A Nav that *is* its parent's own content rather than a place beside it. */
|
|
3643
|
-
const isDefaultNav = (navId) => navIdSegment(navId) === DEFAULT_NAV_SEGMENT;
|
|
3644
|
-
/**
|
|
3645
|
-
* The Nav the User is standing on as the nav shows it. A `default` node names
|
|
3646
|
-
* no place of its own — it is the route answering its parent's empty path — so
|
|
3647
|
-
* landing on `root_app_default` is standing on `root_app`, and the panel says
|
|
3648
|
-
* so rather than naming a segment that is on no menu.
|
|
3649
|
-
*/
|
|
3650
|
-
const visibleNavId = (navId) => {
|
|
3651
|
-
let id = navId;
|
|
3652
|
-
while (id !== ROOT_NAV$1 && isDefaultNav(id))
|
|
3653
|
-
id = parentNavId(id) ?? ROOT_NAV$1;
|
|
3654
|
-
return id;
|
|
3655
|
-
};
|
|
3656
|
-
/**
|
|
3657
|
-
* The direct children of a Nav. `children` is the authored list, but a Nav that
|
|
3658
|
-
* lists none is not childless: the map already holds every node fetched for
|
|
3659
|
-
* this descent, and a child is named by its own id. Reading the map when the
|
|
3660
|
-
* list is empty is what keeps a generated tree — whose `root.yml` names the app
|
|
3661
|
-
* and nothing else — from titling a leaf over an empty panel.
|
|
3662
|
-
*
|
|
3663
|
-
* The Platform Navs reached by a chrome button are the one exclusion. Root
|
|
3664
|
-
* seeds `children: []` on purpose, so that they are never rows beside the icons
|
|
3665
|
-
* that already open them; discovering them off the map would put them back.
|
|
3666
|
-
*/
|
|
3667
|
-
const childIdsOf = (navId, navMap) => {
|
|
3668
|
-
const declared = navMap[navId]?.children;
|
|
3669
|
-
if (declared?.length)
|
|
3670
|
-
return declared;
|
|
3671
|
-
return Object.keys(navMap).filter((id) => parentNavId(id) === navId && !PLATFORM_BUTTON_NAV_IDS.includes(id));
|
|
3672
|
-
};
|
|
3673
|
-
/**
|
|
3674
|
-
* The children a menu may draw. A Nav needs a title to be a row at all, and a
|
|
3675
|
-
* `default` node is not a row: it is its parent's own content, so it is
|
|
3676
|
-
* *transparent* — its own children take its place in the list, spliced where
|
|
3677
|
-
* it stood. `app → default → { trending, latest }` is one list of two rows
|
|
3678
|
-
* under app, which is the tree the User was drawing when they put a `default`
|
|
3679
|
-
* in the middle of it. Filtering the node out without adopting its children
|
|
3680
|
-
* left that app with no rows at all.
|
|
3681
|
-
*/
|
|
3682
|
-
const menuChildIds = (navId, navMap) => childIdsOf(navId, navMap).flatMap((childId) => {
|
|
3683
|
-
if (isDefaultNav(childId))
|
|
3684
|
-
return menuChildIds(childId, navMap);
|
|
3685
|
-
return navMap[childId]?.title ? [childId] : [];
|
|
3686
|
-
});
|
|
3687
|
-
/**
|
|
3688
|
-
* Whose children the menu draws. A Nav with rows of its own draws them — that
|
|
3689
|
-
* is the descent. A leaf has none, and descending into nothing left the panel
|
|
3690
|
-
* on an empty state; it draws its *siblings* instead, so the menu stays the
|
|
3691
|
-
* list the User moved through and the row they are on is the one marked
|
|
3692
|
-
* active. Root is the floor: its own children are the last list there is.
|
|
3693
|
-
*/
|
|
3694
|
-
const navMenuOwnerId = (navId, navMap, hasOwnContent = false) => {
|
|
3695
|
-
const visible = visibleNavId(navId);
|
|
3696
|
-
if (visible === ROOT_NAV$1 || menuChildIds(visible, navMap).length) {
|
|
3697
|
-
return visible;
|
|
3698
|
-
}
|
|
3699
|
-
// A panel that answers with a widget of its own keeps its own title —
|
|
3700
|
-
// titling it after its parent while showing its own content reads as the
|
|
3701
|
-
// wrong panel. Being a Murl is not that proof: a Murl leaf nothing is
|
|
3702
|
-
// registered for draws nothing, and an empty panel must not name itself.
|
|
3703
|
-
if (hasOwnContent)
|
|
3704
|
-
return visible;
|
|
3705
|
-
// Nothing of its own and no rows under it: hand the panel to the nearest
|
|
3706
|
-
// ancestor that has rows, so the User reads the list they are in with their
|
|
3707
|
-
// own row marked. Where no ancestor lists anything there is no better title
|
|
3708
|
-
// than the one we are on — a mistitled empty panel is worse than a titled one.
|
|
3709
|
-
for (let ancestor = parentNavId(visible); ancestor; ancestor = parentNavId(ancestor)) {
|
|
3710
|
-
const owner = visibleNavId(ancestor);
|
|
3711
|
-
if (menuChildIds(owner, navMap).length)
|
|
3712
|
-
return owner;
|
|
3713
|
-
if (owner === ROOT_NAV$1)
|
|
3714
|
-
break;
|
|
3715
|
-
}
|
|
3716
|
-
return visible;
|
|
3717
|
-
};
|
|
3718
|
-
const buildNavMenus = (navId, navMap, anchor) => menuChildIds(navId, navMap).map((childId) => toTrailItem(childId, navMap, anchor));
|
|
3719
|
-
/**
|
|
3720
|
-
* Merges a widget's emitted trail over the derived one, matching by depth.
|
|
3721
|
-
* With a single keyspace there is nothing to translate — an emitted entry is
|
|
3722
|
-
* already in the same ids everything else uses.
|
|
3723
|
-
*/
|
|
3724
|
-
const mergeTrail = (derived, override, derivedHeader) => {
|
|
3725
|
-
const depth = (id) => navIdChain(id).length;
|
|
3726
|
-
const trail = derived.map((item) => {
|
|
3727
|
-
const emitted = override.trail?.find((e) => depth(e.id) === depth(item.id));
|
|
3728
|
-
return emitted ? { ...item, ...emitted } : item;
|
|
3729
|
-
});
|
|
3730
|
-
return { trail, header: override.header ?? derivedHeader };
|
|
3731
|
-
};
|
|
3732
|
-
function deriveBreadcrumb(params) {
|
|
3733
|
-
const { navId, navMap, anchor, breadcrumb, navMenu, hasOwnContent } = params;
|
|
3734
|
-
if (!navId)
|
|
3735
|
-
return emptyResult();
|
|
3736
|
-
// The header and the trail belong to whichever Nav owns the menu below them:
|
|
3737
|
-
// on a leaf that is the parent, so the User reads the list they are in with
|
|
3738
|
-
// their own row marked, rather than a title over an empty panel.
|
|
3739
|
-
const ownerId = navMenuOwnerId(navId, navMap, hasOwnContent);
|
|
3740
|
-
// An emitted breadcrumb names the panel it was emitted for. Once the panel
|
|
3741
|
-
// has been handed up to an ancestor it is no longer that panel, so the
|
|
3742
|
-
// override would title the ancestor's list after the leaf we left.
|
|
3743
|
-
const ownPanel = ownerId === visibleNavId(navId);
|
|
3744
|
-
const chain = navIdChain(ownerId);
|
|
3745
|
-
const derivedTrail = chain
|
|
3746
|
-
.slice(0, -1)
|
|
3747
|
-
.filter((id) => !isDefaultNav(id))
|
|
3748
|
-
.map((id) => toTrailItem(id, navMap, anchor));
|
|
3749
|
-
const nav = navMap[ownerId];
|
|
3750
|
-
const derivedHeader = {
|
|
3751
|
-
id: ownerId,
|
|
3752
|
-
label: nav?.title ?? (ownerId === ROOT_NAV$1 ? '' : navIdSegment(ownerId)),
|
|
3753
|
-
icon: nav?.icon,
|
|
3754
|
-
nav: ownerId,
|
|
3755
|
-
address: renderAddress(ownerId, navMap, anchor),
|
|
3756
|
-
};
|
|
3757
|
-
const { trail, header } = breadcrumb && ownPanel
|
|
3758
|
-
? mergeTrail(derivedTrail, breadcrumb, derivedHeader)
|
|
3759
|
-
: { trail: derivedTrail, header: derivedHeader };
|
|
3760
|
-
return {
|
|
3761
|
-
breadcrumb: { trail, header },
|
|
3762
|
-
navMenus: navMenu?.length && ownPanel
|
|
3763
|
-
? navMenu
|
|
3764
|
-
: buildNavMenus(ownerId, navMap, anchor),
|
|
3765
|
-
};
|
|
3766
|
-
}
|
|
3767
|
-
|
|
3768
3763
|
class GetNavService {
|
|
3769
3764
|
httpService = inject(HttpService);
|
|
3770
3765
|
assetStore = inject(AssetStore);
|
|
@@ -3895,8 +3890,31 @@ const NavStore = signalStore({ providedIn: 'root' }, withState(initialState$3),
|
|
|
3895
3890
|
const navWidgetMaps = inject(NAV_WIDGET_MAP, {
|
|
3896
3891
|
optional: true,
|
|
3897
3892
|
});
|
|
3898
|
-
/**
|
|
3899
|
-
|
|
3893
|
+
/**
|
|
3894
|
+
* The one key. The route's NavId — with its Default Navs collapsed, they
|
|
3895
|
+
* name no place of their own — plus whatever Murl segments are open. An app
|
|
3896
|
+
* whose landing route is `root_default` anchored every panel it opened at
|
|
3897
|
+
* `root_default_search`, which nothing registers and no asset names, so the
|
|
3898
|
+
* chrome opened onto the page's own menu instead of onto itself.
|
|
3899
|
+
*/
|
|
3900
|
+
const anchorRouteNavId = computed(() => visibleNavId(store.routeNavId() ?? ROOT_NAV$1), ...(ngDevMode ? [{ debugName: "anchorRouteNavId" }] : /* istanbul ignore next */ []));
|
|
3901
|
+
const id = computed(() => navIdFor(anchorRouteNavId(), store.murl()), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
3902
|
+
/**
|
|
3903
|
+
* The keys a panel is looked up under, nearest first: the anchored one, and
|
|
3904
|
+
* — while a Murl is open — the root-anchored one behind it. A Murl is a
|
|
3905
|
+
* panel, and an Anchor is where it was opened from rather than what fills
|
|
3906
|
+
* it: with nothing registered for `/page|search`, the global `root_search`
|
|
3907
|
+
* is what that address meant, and falling through to it beats leaving the
|
|
3908
|
+
* page's own menu up while a panel is addressed.
|
|
3909
|
+
*/
|
|
3910
|
+
const widgetNavIds = computed(() => {
|
|
3911
|
+
const anchored = id();
|
|
3912
|
+
const murl = store.murl();
|
|
3913
|
+
if (!murl.length)
|
|
3914
|
+
return [anchored];
|
|
3915
|
+
const rooted = navIdFor(ROOT_NAV$1, murl);
|
|
3916
|
+
return anchored === rooted ? [anchored] : [anchored, rooted];
|
|
3917
|
+
}, ...(ngDevMode ? [{ debugName: "widgetNavIds" }] : /* istanbul ignore next */ []));
|
|
3900
3918
|
const hasMurl = computed(() => store.murl().length > 0, ...(ngDevMode ? [{ debugName: "hasMurl" }] : /* istanbul ignore next */ []));
|
|
3901
3919
|
const isNavOpened = computed(() => hasMurl() || store.navOpenedByUser(), ...(ngDevMode ? [{ debugName: "isNavOpened" }] : /* istanbul ignore next */ []));
|
|
3902
3920
|
const isMNavOpened = hasMurl;
|
|
@@ -3917,23 +3935,25 @@ const NavStore = signalStore({ providedIn: 'root' }, withState(initialState$3),
|
|
|
3917
3935
|
* element and leave theme / language blank.
|
|
3918
3936
|
*/
|
|
3919
3937
|
const widgetEntry = computed(() => {
|
|
3920
|
-
const navId = id();
|
|
3921
3938
|
const appNavId = store.appNavId();
|
|
3922
3939
|
const appLink = store.appLink();
|
|
3923
|
-
if (appLink && appNavId) {
|
|
3924
|
-
const registered = store.remoteWidgets()[appLink];
|
|
3925
|
-
const localId = toLocalNavId(navId, appNavId);
|
|
3926
|
-
if (registered && localId) {
|
|
3927
|
-
const entry = registered.widgetMap()[localId];
|
|
3928
|
-
if (entry)
|
|
3929
|
-
return { entry, remote: true };
|
|
3930
|
-
}
|
|
3931
|
-
}
|
|
3932
3940
|
const maps = navWidgetMaps ?? [];
|
|
3933
|
-
for (
|
|
3934
|
-
const
|
|
3935
|
-
if (
|
|
3936
|
-
|
|
3941
|
+
for (const candidate of widgetNavIds()) {
|
|
3942
|
+
const navId = candidate;
|
|
3943
|
+
if (appLink && appNavId) {
|
|
3944
|
+
const registered = store.remoteWidgets()[appLink];
|
|
3945
|
+
const localId = toLocalNavId(navId, appNavId);
|
|
3946
|
+
if (registered && localId) {
|
|
3947
|
+
const entry = registered.widgetMap()[localId];
|
|
3948
|
+
if (entry)
|
|
3949
|
+
return { entry, remote: true, navId: candidate };
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
for (let i = maps.length - 1; i >= 0; i--) {
|
|
3953
|
+
const entry = maps[i]()[navId];
|
|
3954
|
+
if (entry !== undefined)
|
|
3955
|
+
return { entry, remote: false, navId: candidate };
|
|
3956
|
+
}
|
|
3937
3957
|
}
|
|
3938
3958
|
return undefined;
|
|
3939
3959
|
}, ...(ngDevMode ? [{ debugName: "widgetEntry" }] : /* istanbul ignore next */ []));
|
|
@@ -3957,12 +3977,20 @@ const NavStore = signalStore({ providedIn: 'root' }, withState(initialState$3),
|
|
|
3957
3977
|
const appLink = store.appLink();
|
|
3958
3978
|
return appLink ? store.wcConfigMap()[appLink] : undefined;
|
|
3959
3979
|
}, ...(ngDevMode ? [{ debugName: "currentWcConfig" }] : /* istanbul ignore next */ []));
|
|
3980
|
+
/**
|
|
3981
|
+
* The Nav the open panel *is*, which is the key its content answered to.
|
|
3982
|
+
* A Murl that fell through to its root-anchored panel is showing that
|
|
3983
|
+
* panel, so the header and the trail are that one's too — reading them off
|
|
3984
|
+
* the anchored key would title the global panel after the page it opened
|
|
3985
|
+
* over.
|
|
3986
|
+
*/
|
|
3987
|
+
const panelNavId = computed(() => widgetEntry()?.navId ?? id(), ...(ngDevMode ? [{ debugName: "panelNavId" }] : /* istanbul ignore next */ []));
|
|
3960
3988
|
const breadcrumbResult = computed(() => {
|
|
3961
3989
|
const menuConfig = resolvedNavMenuConfig();
|
|
3962
3990
|
const widgetConfig = resolvedWidget();
|
|
3963
3991
|
const emittedMenu = menuConfig?.navMenu();
|
|
3964
3992
|
return deriveBreadcrumb({
|
|
3965
|
-
navId:
|
|
3993
|
+
navId: panelNavId(),
|
|
3966
3994
|
navMap: store.navMap(),
|
|
3967
3995
|
anchor: { navId: store.routeNavId() ?? ROOT_NAV$1, path: store.path() },
|
|
3968
3996
|
breadcrumb: menuConfig?.breadcramb?.() ??
|
|
@@ -6565,7 +6593,7 @@ class SectionFormItemComponent extends ConfigComponent {
|
|
|
6565
6593
|
break;
|
|
6566
6594
|
}
|
|
6567
6595
|
case InputType.TOGGLE: {
|
|
6568
|
-
const { ToggleInputComponent } = await import('./magmonium-one-toggle-
|
|
6596
|
+
const { ToggleInputComponent } = await import('./magmonium-one-toggle-CfNrRJwI.mjs');
|
|
6569
6597
|
this.createDynamicComponent(seq, ToggleInputComponent, [], true);
|
|
6570
6598
|
break;
|
|
6571
6599
|
}
|
|
@@ -6577,12 +6605,12 @@ class SectionFormItemComponent extends ConfigComponent {
|
|
|
6577
6605
|
break;
|
|
6578
6606
|
}
|
|
6579
6607
|
case InputType.PASSWORD: {
|
|
6580
|
-
const { PasswordInputComponent } = await import('./magmonium-one-password-
|
|
6608
|
+
const { PasswordInputComponent } = await import('./magmonium-one-password-DLDYsPCr.mjs');
|
|
6581
6609
|
this.createDynamicComponent(seq, PasswordInputComponent);
|
|
6582
6610
|
break;
|
|
6583
6611
|
}
|
|
6584
6612
|
case InputType.OTP: {
|
|
6585
|
-
const { OtpInputComponent } = await import('./magmonium-one-otp-
|
|
6613
|
+
const { OtpInputComponent } = await import('./magmonium-one-otp-BD-sIswJ.mjs');
|
|
6586
6614
|
this.createDynamicComponent(seq, OtpInputComponent);
|
|
6587
6615
|
break;
|
|
6588
6616
|
}
|
|
@@ -19985,7 +20013,7 @@ class WrapperInputComponent extends ConfigComponent {
|
|
|
19985
20013
|
break;
|
|
19986
20014
|
}
|
|
19987
20015
|
case InputType.TOGGLE: {
|
|
19988
|
-
const { ToggleInputComponent } = await import('./magmonium-one-toggle-
|
|
20016
|
+
const { ToggleInputComponent } = await import('./magmonium-one-toggle-CfNrRJwI.mjs');
|
|
19989
20017
|
this.createDynamicComponent(seq, ToggleInputComponent, [], true);
|
|
19990
20018
|
break;
|
|
19991
20019
|
}
|
|
@@ -19997,12 +20025,12 @@ class WrapperInputComponent extends ConfigComponent {
|
|
|
19997
20025
|
break;
|
|
19998
20026
|
}
|
|
19999
20027
|
case InputType.PASSWORD: {
|
|
20000
|
-
const { PasswordInputComponent } = await import('./magmonium-one-password-
|
|
20028
|
+
const { PasswordInputComponent } = await import('./magmonium-one-password-DLDYsPCr.mjs');
|
|
20001
20029
|
this.createDynamicComponent(seq, PasswordInputComponent);
|
|
20002
20030
|
break;
|
|
20003
20031
|
}
|
|
20004
20032
|
case InputType.OTP: {
|
|
20005
|
-
const { OtpInputComponent } = await import('./magmonium-one-otp-
|
|
20033
|
+
const { OtpInputComponent } = await import('./magmonium-one-otp-BD-sIswJ.mjs');
|
|
20006
20034
|
this.createDynamicComponent(seq, OtpInputComponent);
|
|
20007
20035
|
break;
|
|
20008
20036
|
}
|
|
@@ -34222,4 +34250,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
34222
34250
|
*/
|
|
34223
34251
|
|
|
34224
34252
|
export { DEFAULT_NAV_SEGMENT as $, ACCESS_DOMAINS as A, BaseInputComponent as B, COMPONENT_INPUT_REGISTRY as C, CardComponent as D, CardWrapperComponent as E, CarouselComponent as F, ChartComponent as G, CheckboxInputComponent as H, IS_DESIGN_MODE as I, ClearableInputComponent as J, ColComponent as K, LabelComponent as L, ColorPickerInputComponent as M, CommentItemComponent as N, CommentsApiService as O, CommentsComponent as P, CommentsStore as Q, ComponentInputComponent as R, ComponentStepperComponent as S, TranslatePipe as T, ConfigComponent as U, ConfirmComponent as V, ContextMenuComponent as W, CustomIconClass as X, CustomIconEditComponent as Y, DEFAULT_FILTER_RANGE_MODE as Z, DEFAULT_FILTER_VARIANT as _, BaseTextInputComponent as a, NAV_ID_SEP as a$, DEFAULT_SIZE as a0, DashboardCardComponent as a1, DateInputComponent as a2, DatePickerComponent as a3, DeviceService as a4, DomService as a5, Domain as a6, DotGridComponent as a7, DragListDirective as a8, DragListItemDirective as a9, InstrumentScoreComponent as aA, InterceptorObservables as aB, JumbotronComponent as aC, KeyValueComponent as aD, LAYOUT_ASSET_FOLDER as aE, LOGIN_COMPONENT as aF, LOGIN_STORE as aG, LanguageComponent as aH, LogoComponent as aI, MAG_SOCKET_EVENT as aJ, MHeroColorDirective as aK, MHeroComponent as aL, MODAL_REF as aM, MODAL_STORE_REF as aN, MRefDirective as aO, MStepComponent as aP, MURL_PARAM as aQ, MURL_SEP as aR, ManifestEnrichmentService as aS, MenuComponent as aT, ModalDirective as aU, ModalRef as aV, ModalStore as aW, MoneyPipe as aX, MultiRangeInputComponent as aY, MurlUrlSerializer as aZ, NAV_DEFAULT_MURL as a_, DraggableDirective as aa, DropdownInputComponent as ab, FILTER_GROUP_CONTEXT as ac, FILTER_RANGE_MODES as ad, FILTER_VARIANTS as ae, FLEX_VARIANTS as af, FOLDER_PICK_LISTENER as ag, FORM_ASSET_FOLDER as ah, FileService as ai, FileUploadDirective as aj, FileUploadInputComponent as ak, FlexComponent as al, FlexItemComponent as am, FormGroupComponent as an, FrameComponent as ao, FreezeService as ap, GRID_BREAKPOINTS as aq, GetNavService as ar, HeaderComponent$1 as as, HighlightDirective as at, HttpService as au, ICON_SOURCE as av, IS_SIDE_PANEL as aw, IconComponent as ax, ImgComponent as ay, InputType as az, TextOutputComponent as b, SectionBadgesComponent as b$, NAV_MAIN_BUTTONS as b0, NAV_SEGMENT_RE as b1, NAV_STORE_REF as b2, NAV_WC_COMPONENTS as b3, NAV_WIDGET_MAP as b4, NavComponent as b5, NavDetailsComponent as b6, NavHeaderComponent as b7, NavMenuComponent as b8, NavStore as b9, PwaInstallComponent as bA, ROOT_NAV$1 as bB, RadioGroupComponent as bC, RadioInputComponent as bD, RangeInputComponent as bE, RatingInputComponent as bF, ReactiveElementComponent as bG, RemoteComponent as bH, RemoteLoaderService as bI, ResizeElementComponent as bJ, RouteContainer as bK, RowComponent as bL, SEARCH_QUERY as bM, SEARCH_RESULTS_EVENT as bN, SECTION_ACCORDION_GROUP as bO, SECTION_FORM_CONTEXT as bP, SHARED_ICONS as bQ, SIZE_CONTEXT as bR, ScoreComponent as bS, ScrollComponent as bT, ScrollService as bU, SearchPanelComponent as bV, SearchStore as bW, SearchUserPanelComponent as bX, SectionAccordionDirective as bY, SectionAccordionGroupDirective as bZ, SectionBackComponent as b_, NavTrailComponent as ba, NothingComponent as bb, NotificationElementComponent as bc, NotificationGroupComponent as bd, NotificationPopupComponent as be, NotificationService as bf, NotificationStore as bg, NotificationType as bh, NotificationWidgetComponent as bi, ONE_ASSET_BASE_URL as bj, OPTIONS_SOURCE as bk, OVERLAY_WIDGETS as bl, OneApp as bm, OptionsSourceDirective as bn, OverlayBodyComponent as bo, OverlayRef as bp, OverlayService as bq, PLATFORM_BUTTON_NAV_IDS as br, PLATFORM_EXTENSIBLE_NAV_IDS as bs, PLATFORM_NAV_MAP as bt, PLATFORM_ROOT_CHILDREN as bu, PaginationComponent as bv, PanelComponent as bw, PercentagePipe as bx, PlaygroundComponent as by, PositionDirective as bz, ButtonComponent as c, UlComponent as c$, SectionButtonGroupComponent as c0, SectionCardComponent as c1, SectionCarouselComponent as c2, SectionComponent as c3, SectionFilterComponent as c4, SectionFilterGroupComponent as c5, SectionFilterMenuComponent as c6, SectionFilterPanelComponent as c7, SectionFilterRangePanelComponent as c8, SectionFooterComponent as c9, StrokeLinejoin as cA, SummaryComponent as cB, SvgGeneratorComponent as cC, SvgGeneratorService as cD, SvgService as cE, TOTAL_COLUMNS as cF, TRANSLATION_SOURCE as cG, TableComponent as cH, TechnicalMeterComponent as cI, TextInputComponent as cJ, TextareaInputComponent as cK, ThemeComponent as cL, ThemeDataService as cM, ThemeService as cN, ThemeStore as cO, TimeAgoPipe as cP, TimelineComponent as cQ, ToggleButtonComponent as cR, ToggleInputComponent as cS, ToggleRadioInputComponent as cT, ToolTipDirective as cU, TooltipComponent as cV, TranslateService as cW, TreeGridComponent as cX, URL_SEP as cY, USER_STORE_REF as cZ, USER_TAB_MAP as c_, SectionFormComponent as ca, SectionFormItemComponent as cb, SectionHeaderComponent as cc, SectionHeroComponent as cd, SectionPaginationComponent as ce, SectionSearchComponent as cf, SectionStepperComponent as cg, SectionTabsComponent as ch, SectionToggleComponent as ci, SectionToggleItemDirective as cj, SelectableCardInputComponent as ck, SelectorDirective as cl, SettingsSearchBarComponent as cm, SettingsSearchService as cn, ShapeComponent as co, SharedStoreRegistry as cp, SidePanelDirective as cq, Size as cr, SocketStore as cs, SortComponent as ct, StatComponent as cu, StepComponent as cv, StepperComponent as cw, StepsComponent as cx, StorageService as cy, StrokeLinecap as cz, APP_CONTEXT_REF as d, hexToRgb as d$, UniverseComponent as d0, UserApiService as d1, UserAvatarComponent as d2, UserComponent as d3, UserNavComponent as d4, UserSettingsComponent as d5, UserStore as d6, WC_ROUTE_CHANGED_EVENT as d7, WC_SEARCH_GROUPS as d8, WIN_USER_TAB_HOOK as d9, evaluate as dA, evaluateBool as dB, filterHoldsList as dC, filterHoldsOneBound as dD, filterHoldsOptions as dE, filterHoldsRange as dF, filterList as dG, filterOne as dH, filterPanelOf as dI, filterPanelWidth as dJ, filterRange as dK, filterTreeGridRows as dL, filterValueList as dM, filterValues as dN, flattenTreeGridRows as dO, formatBadgeCount as dP, fullName as dQ, generateClipPath as dR, generateTransform as dS, getClassList as dT, getProperty as dU, getScrollParent as dV, getTierFromPreviewPath as dW, getTreeGridRow as dX, getUniqueId as dY, getValue as dZ, hasErrorComputed as d_, WIN_USER_TAB_KEY as da, WatermarkComponent as db, WcRouterStore as dc, WrapperInputComponent as dd, anchorNavId as de, applyColorsToElement as df, bootstrapMagApp as dg, bootstrapPwaInstall as dh, buildWcBaseUrl as di, calculateLuminance as dj, calculateRanks as dk, cellText as dl, checkFilterCondition as dm, childNavId as dn, classListSignal as dp, coerceSize as dq, cornerEdge as dr, cornerSide as ds, createMap as dt, createPlatformNavMap as du, deriveAvatarGradient as dv, deriveContrastColor as dw, deriveOppositeColor as dx, derivePropertyName as dy, emailValidation as dz, ASSET_BASE_URL as e, provideSizeContext as e$, hslToRgb$1 as e0, initMagmoniumApp as e1, initialNotificationState as e2, initialState$2 as e3, initials as e4, injectAuthenticate as e5, injectInstallApp as e6, injectParentSize as e7, injectScrollSticky as e8, isButtonName as e9, minValidation as eA, miniMarkToHtml as eB, navIdChain as eC, navIdFor as eD, navIdSegment as eE, navIdToRoutePath as eF, navIdToSegments as eG, navToId as eH, parentNavId as eI, parseAddress as eJ, parseColor as eK, parsePatternNames as eL, patternValidation as eM, patternsValidation as eN, platformNavWidgets as eO, privateGuard as eP, processImageToSvg as eQ, provideAppContext as eR, provideMagAppConfig as eS, provideMagWcConfig as eT, provideMagWcRoutes as eU, provideModalComponents as eV, provideMurlUrlSerializer as eW, provideNavWidgets as eX, provideOverlayWidgets as eY, providePlatformNavWidgets as eZ, provideSearch as e_, isCancelledComputed as ea, isExtensiblePlatformNavId as eb, isJson as ec, isLoadingComputed as ed, isLocalhost as ee, isPlatformNavId as ef, isSize as eg, isTierPreview as eh, isUrlLocalhost as ei, isValidNavId as ej, isValidNavSegment as ek, isWebComponent as el, linkToId as em, linkToNav as en, loadingActions as eo, mInterceptor as ep, manualValidation as eq, matchFieldValidation as er, maxLengthValidation as es, maxValidation as et, mergePlatformNav as eu, mergeUnique as ev, mergeUniqueBy as ew, mergeUniqueWith as ex, minAgeValidation as ey, minLengthValidation as ez, AccordionBodyDirective as f, provideUserTabs as f0, publicGuard as f1, readFieldPatterns as f2, renderAddress as f3, requiredValidation as f4, resolveConfigAsset as f5, resolveIconSize as f6, resolvePallet as f7, resolvePatternRules as f8, resolveSize as f9, rgbToHex as fa, rgbToHsl as fb, rowHasChildren as fc, samePatterns as fd, segmentsToNavId as fe, setProperty as ff, setTreeGridChildren as fg, settingsWidgets as fh, shouldShowBadge as fi, splitNavId as fj, splitOnMatch as fk, stringToColor as fl, toAttrBool as fm, toAttrNumber as fn, toCssLength as fo, toHostNavId as fp, toLength$1 as fq, toLocalNavId as fr, toggleTreeGridRow as fs, unfetchedPlatformNav as ft, urlValidation as fu, AccordionComponent as g, AccordionGroupComponent as h, ActionComponent as i, AnimatedGraphsComponent as j, AppCardComponent as k, AppRelationType as l, AppTileComponent as m, AssetStore as n, AssetUrlPipe as o, Assets as p, AuthActivityPageComponent as q, AuthApiService as r, AuthStore as s, AutosizeDirective as t, BadgeComponent as u, BandingComponent as v, BaseArrayInputComponent as w, BaseRootWebComponent as x, BaseWebComponent as y, ButtonGroupComponent as z };
|
|
34225
|
-
//# sourceMappingURL=magmonium-one-magmonium-one-
|
|
34253
|
+
//# sourceMappingURL=magmonium-one-magmonium-one-B2yxkDxk.mjs.map
|