@artstorefronts/arthelper-nav 0.1.0-alpha.6 → 0.1.0-alpha.8
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/README.md +38 -12
- package/dist/analytics.d.ts +42 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +30 -0
- package/dist/analytics.js.map +1 -0
- package/dist/index.css +53 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/nav-bar.d.ts.map +1 -1
- package/dist/nav-bar.js +10 -5
- package/dist/nav-bar.js.map +1 -1
- package/dist/resolve.d.ts +3 -3
- package/dist/resolve.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,8 +67,20 @@ is obviously this app, stop and ask — an id is added by an operator, not by yo
|
|
|
67
67
|
Without this, a user who collapsed the bar gets an expanded bar in the first byte and a
|
|
68
68
|
56px jump after hydration.
|
|
69
69
|
|
|
70
|
-
6. **
|
|
71
|
-
analytics
|
|
70
|
+
6. **Pass `onAppClick`** so this app's clicks reach the fleet-wide chart. The package ships
|
|
71
|
+
no analytics SDK — transport, identity and consent stay with you — but it does export the
|
|
72
|
+
event's shape, so use it rather than hand-writing the payload:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { suiteNavClickEvent } from '@artstorefronts/arthelper-nav';
|
|
76
|
+
|
|
77
|
+
onAppClick={(args) => yourTracker.track(...suiteNavClickEvent(args, '<this-app-id>'))}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Hand-writing it is how a satellite ends up sending `app_id` instead of `target_app_id`,
|
|
81
|
+
which does not fail — it silently splits the chart. One callback covers both the desktop
|
|
82
|
+
tiles and the mobile dropdown. If your tracker batches, flush on the way out: a tile is a
|
|
83
|
+
real cross-app `<a href>`, so the document is replaced and a queued batch dies with it.
|
|
72
84
|
|
|
73
85
|
## `configUrl` — the mistake to avoid
|
|
74
86
|
|
|
@@ -306,23 +318,37 @@ This is the same derivation both in-monorepo hosts (`client/`, `town-square/`) u
|
|
|
306
318
|
|
|
307
319
|
## `onAppClick`: the analytics seam
|
|
308
320
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
321
|
+
`onAppClick` fires immediately before navigation, from one shared handler behind both the
|
|
322
|
+
desktop tile row and the mobile dropdown — so it covers both surfaces and cannot
|
|
323
|
+
double-fire.
|
|
324
|
+
|
|
325
|
+
**The package ships no analytics SDK, deliberately.** Bundling one would run a second
|
|
326
|
+
instance alongside yours, racing it on device id and session, and would emit without your
|
|
327
|
+
identity or consent handling — producing clicks that cannot be joined to users. Transport,
|
|
328
|
+
identity and consent are yours.
|
|
329
|
+
|
|
330
|
+
What the package does own is the event's shape, because that is the part that drifts:
|
|
313
331
|
|
|
314
332
|
```ts
|
|
333
|
+
import { suiteNavClickEvent } from '@artstorefronts/arthelper-nav';
|
|
334
|
+
|
|
315
335
|
<NavProvider
|
|
316
|
-
activeAppId="my-app"
|
|
317
336
|
configUrl={NAV_CONFIG_URL}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}}
|
|
337
|
+
activeAppId="art-books"
|
|
338
|
+
onAppClick={(args) => amplitude.track(...suiteNavClickEvent(args, 'art_books'))}
|
|
321
339
|
>
|
|
322
340
|
```
|
|
323
341
|
|
|
324
|
-
|
|
325
|
-
`
|
|
342
|
+
It returns a `[name, properties]` pair, so the two cannot be paired wrongly. Properties are
|
|
343
|
+
`target_app_id` (the app clicked — the dimension click-throughs group on), `source_app`
|
|
344
|
+
(this app, passed in because hosts sharing a product surface share an `activeAppId` and so
|
|
345
|
+
cannot be told apart by it), and `collapsed`.
|
|
346
|
+
|
|
347
|
+
`SUITE_NAV_CLICK_EVENT` is exported too if your tracker needs the name separately.
|
|
348
|
+
|
|
349
|
+
**If your tracker batches, flush on the way out.** A tile is a real cross-app `<a href>`, so
|
|
350
|
+
the document is replaced and a queued batch dies with it — both ArtHelper hosts use their
|
|
351
|
+
tracker's on-exit variant for exactly this reason.
|
|
326
352
|
|
|
327
353
|
## SSR and the collapsed cookie
|
|
328
354
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { NavAppClickArgs } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The one spelling of the suite bar's click event.
|
|
4
|
+
*
|
|
5
|
+
* The package deliberately ships no analytics SDK. Bundling one would run a second
|
|
6
|
+
* instance alongside the host's — racing it on device id and session — and would emit
|
|
7
|
+
* without the host's identity or consent handling, producing clicks that cannot be joined
|
|
8
|
+
* to users. Transport, identity and consent stay with the host; only the event's shape
|
|
9
|
+
* lives here.
|
|
10
|
+
*
|
|
11
|
+
* What that leaves is a drift risk, and it is the whole reason this helper exists: a
|
|
12
|
+
* satellite that hand-writes `app_id` instead of `target_app_id`, or renames the event,
|
|
13
|
+
* silently splits the fleet-wide chart rather than failing. Name and properties travel
|
|
14
|
+
* together as one value so the two cannot be paired wrongly.
|
|
15
|
+
*/
|
|
16
|
+
declare const SUITE_NAV_CLICK_EVENT = "suite_nav_app_clicked";
|
|
17
|
+
type SuiteNavClickProperties<TSource extends string> = {
|
|
18
|
+
/** Catalog id of the app that was clicked — the dimension click-throughs group on. */
|
|
19
|
+
target_app_id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Which host emitted the click. Passed in rather than read off `activeAppId`, because
|
|
22
|
+
* hosts that are one product surface share an id — ArtHelper's client and town-square
|
|
23
|
+
* both declare `home`, so `activeAppId` cannot tell them apart.
|
|
24
|
+
*/
|
|
25
|
+
source_app: TSource;
|
|
26
|
+
/** Whether the bar was collapsed at click time. */
|
|
27
|
+
collapsed: boolean;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Builds the event as a `[name, properties]` pair, ready to spread into a tracker:
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* onAppClick={(args) => amplitude.track(...suiteNavClickEvent(args, 'art_books'))}
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* `TSource` is generic so the literal survives: a host whose tracker types `source_app` as
|
|
37
|
+
* a union of known apps still typechecks, which a widened `string` would not.
|
|
38
|
+
*/
|
|
39
|
+
declare function suiteNavClickEvent<TSource extends string>(args: NavAppClickArgs, sourceApp: TSource): [typeof SUITE_NAV_CLICK_EVENT, SuiteNavClickProperties<TSource>];
|
|
40
|
+
export { SUITE_NAV_CLICK_EVENT, suiteNavClickEvent };
|
|
41
|
+
export type { SuiteNavClickProperties };
|
|
42
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,qBAAqB,0BAA0B,CAAC;AAKtD,KAAK,uBAAuB,CAAC,OAAO,SAAS,MAAM,IAAI;IACrD,sFAAsF;IACtF,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;GASG;AACH,iBAAS,kBAAkB,CAAC,OAAO,SAAS,MAAM,EAChD,IAAI,EAAE,eAAe,EACrB,SAAS,EAAE,OAAO,GACjB,CAAC,OAAO,qBAAqB,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAElE;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;AACrD,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one spelling of the suite bar's click event.
|
|
3
|
+
*
|
|
4
|
+
* The package deliberately ships no analytics SDK. Bundling one would run a second
|
|
5
|
+
* instance alongside the host's — racing it on device id and session — and would emit
|
|
6
|
+
* without the host's identity or consent handling, producing clicks that cannot be joined
|
|
7
|
+
* to users. Transport, identity and consent stay with the host; only the event's shape
|
|
8
|
+
* lives here.
|
|
9
|
+
*
|
|
10
|
+
* What that leaves is a drift risk, and it is the whole reason this helper exists: a
|
|
11
|
+
* satellite that hand-writes `app_id` instead of `target_app_id`, or renames the event,
|
|
12
|
+
* silently splits the fleet-wide chart rather than failing. Name and properties travel
|
|
13
|
+
* together as one value so the two cannot be paired wrongly.
|
|
14
|
+
*/
|
|
15
|
+
const SUITE_NAV_CLICK_EVENT = 'suite_nav_app_clicked';
|
|
16
|
+
/**
|
|
17
|
+
* Builds the event as a `[name, properties]` pair, ready to spread into a tracker:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* onAppClick={(args) => amplitude.track(...suiteNavClickEvent(args, 'art_books'))}
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* `TSource` is generic so the literal survives: a host whose tracker types `source_app` as
|
|
24
|
+
* a union of known apps still typechecks, which a widened `string` would not.
|
|
25
|
+
*/
|
|
26
|
+
function suiteNavClickEvent(args, sourceApp) {
|
|
27
|
+
return [SUITE_NAV_CLICK_EVENT, { target_app_id: args.app.id, source_app: sourceApp, collapsed: args.collapsed }];
|
|
28
|
+
}
|
|
29
|
+
export { SUITE_NAV_CLICK_EVENT, suiteNavClickEvent };
|
|
30
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAkBtD;;;;;;;;;GASG;AACH,SAAS,kBAAkB,CACzB,IAAqB,EACrB,SAAkB;IAElB,OAAO,CAAC,qBAAqB,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;AACnH,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.css
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
* come back as a second release, not a second runtime branch.
|
|
32
32
|
* ------------------------------------------------------------------------- */
|
|
33
33
|
.ahsuite-bar,
|
|
34
|
-
.ahsuite-docked
|
|
34
|
+
.ahsuite-docked,
|
|
35
|
+
.ahsuite-panel {
|
|
35
36
|
--ahsuite-bar-bg: #12211a;
|
|
36
37
|
--ahsuite-bar-border: #ffffff1f;
|
|
37
38
|
--ahsuite-waffle-icon: #c4d2c8;
|
|
@@ -110,14 +111,40 @@
|
|
|
110
111
|
visibility 0s linear 0s;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
.ahsuite-bar
|
|
114
|
+
.ahsuite-bar *,
|
|
115
|
+
.ahsuite-panel,
|
|
116
|
+
.ahsuite-panel * {
|
|
114
117
|
box-sizing: border-box;
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Sticky is opt-in, and so is the stacking that comes with it. The z-index has to clear
|
|
122
|
+
* ordinary page content scrolling underneath and nothing else — in particular it must sit
|
|
123
|
+
* BELOW the host's modal layer, which is z-50 in both hosts (the shadcn/`@artstorefronts/ui`
|
|
124
|
+
* convention: `SheetContent`, `DialogContent` and their overlays are all `fixed z-50`,
|
|
125
|
+
* portaled to `document.body`).
|
|
126
|
+
*
|
|
127
|
+
* At 60 it outranked that layer, and because nothing between this bar and `<body>` opens a
|
|
128
|
+
* stacking context in either host, the comparison happened at the root: the bar painted
|
|
129
|
+
* through the top 56px of every modal. Below the md breakpoint the sidebar itself becomes
|
|
130
|
+
* one of those sheets, which is how it showed — the sidebar slid out with its head cut off.
|
|
131
|
+
* Client never saw it only because client mounts the bar without `sticky`, so it has no
|
|
132
|
+
* z-index at all and the portaled sheet wins by document order.
|
|
133
|
+
*
|
|
134
|
+
* It does NOT need to clear the host header (also z-50): the header sticks at the bar's own
|
|
135
|
+
* live height, so the two are never over the same pixels.
|
|
136
|
+
*
|
|
137
|
+
* `.ahsuite-panel` is why NavBar renders the panel as a SIBLING of the bar rather than a
|
|
138
|
+
* child. `.ahsuite-bar` sets `isolation: isolate`, so anything inside it is sealed into its
|
|
139
|
+
* stacking context and the panel's own z-index only ever ordered it against the bar's own
|
|
140
|
+
* children. The panel hangs DOWN over the host header and has to cover it — which needs a
|
|
141
|
+
* layer above 50 — while the bar needs one below 50. Nested, those two are the same number
|
|
142
|
+
* and cannot both hold; as siblings each gets the layer it actually needs.
|
|
143
|
+
*/
|
|
117
144
|
.ahsuite-bar--sticky {
|
|
118
145
|
position: sticky;
|
|
119
146
|
top: 0;
|
|
120
|
-
z-index:
|
|
147
|
+
z-index: 40;
|
|
121
148
|
}
|
|
122
149
|
|
|
123
150
|
/* Collapse ACTUALLY minimizes: the bar leaves layout completely, reserving
|
|
@@ -449,6 +476,11 @@ span.ahsuite-row {
|
|
|
449
476
|
flex: 0 0 18px;
|
|
450
477
|
}
|
|
451
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Rendered as a sibling of `.ahsuite-bar`, never inside it — `.ahsuite-bar` isolates, and a
|
|
481
|
+
* descendant cannot out-stack anything the bar itself sits under. This layer has to clear
|
|
482
|
+
* the host header (z-50 in both hosts) because the panel hangs down across it.
|
|
483
|
+
*/
|
|
452
484
|
.ahsuite-panel {
|
|
453
485
|
display: none;
|
|
454
486
|
position: fixed;
|
|
@@ -570,15 +602,29 @@ span.ahsuite-row {
|
|
|
570
602
|
display: inline-flex;
|
|
571
603
|
}
|
|
572
604
|
|
|
573
|
-
/* Nothing to centre once the tile row is gone, so the balancing pair stands down
|
|
574
|
-
*
|
|
575
|
-
*
|
|
605
|
+
/* Nothing to centre once the tile row is gone, so the balancing pair stands down: the
|
|
606
|
+
* brand takes its content width at the left and the trigger is pushed to the opposite
|
|
607
|
+
* end, giving the mobile bar the two anchors it reads best with — identity left, the
|
|
608
|
+
* one action right — instead of both crowded against each other with dead space after.
|
|
609
|
+
*
|
|
610
|
+
* `margin-left: auto` on the trigger rather than `flex: 1 1 auto` on the counterweight:
|
|
611
|
+
* an auto margin absorbs the free space BEFORE the item, so the trigger's right edge
|
|
612
|
+
* lands on the bar's own 12px padding and mirrors the waffle's left edge exactly.
|
|
613
|
+
*
|
|
614
|
+
* `.ahsuite-balance` is removed outright rather than zeroed. It is empty, so a zero
|
|
615
|
+
* basis would still leave it a flex item, and the bar's 10px `gap` applies between
|
|
616
|
+
* items whether or not they have width — the trigger would sit 22px from the edge
|
|
617
|
+
* against the waffle's 12px. Off the layout entirely, the gap goes with it. */
|
|
576
618
|
.ahsuite-brand {
|
|
577
619
|
flex: 0 0 auto;
|
|
578
620
|
}
|
|
579
621
|
|
|
622
|
+
.ahsuite-trigger {
|
|
623
|
+
margin-left: auto;
|
|
624
|
+
}
|
|
625
|
+
|
|
580
626
|
.ahsuite-balance {
|
|
581
|
-
|
|
627
|
+
display: none;
|
|
582
628
|
}
|
|
583
629
|
|
|
584
630
|
.ahsuite-panel {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { SUITE_NAV_CLICK_EVENT, suiteNavClickEvent } from './analytics.js';
|
|
1
2
|
export { useNav } from './context.js';
|
|
2
3
|
export { COLLAPSED_COOKIE } from './cookie.js';
|
|
3
4
|
export { FALLBACK_CONFIG } from './fallback.js';
|
|
@@ -5,6 +6,7 @@ export { NavBar } from './nav-bar.js';
|
|
|
5
6
|
export { NavTrigger } from './nav-trigger.js';
|
|
6
7
|
export { NavProvider } from './provider.js';
|
|
7
8
|
export { resolveApps } from './resolve.js';
|
|
9
|
+
export type { SuiteNavClickProperties } from './analytics.js';
|
|
8
10
|
export type { NavContextValue } from './context.js';
|
|
9
11
|
export type { NavBarProps } from './nav-bar.js';
|
|
10
12
|
export type { NavTriggerProps } from './nav-trigger.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/nav-bar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-bar.d.ts","sourceRoot":"","sources":["../src/nav-bar.tsx"],"names":[],"mappings":"AA4BA,UAAU,WAAW;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsED,iBAAS,MAAM,CAAC,EAAE,MAAc,EAAE,SAAS,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"nav-bar.d.ts","sourceRoot":"","sources":["../src/nav-bar.tsx"],"names":[],"mappings":"AA4BA,UAAU,WAAW;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsED,iBAAS,MAAM,CAAC,EAAE,MAAc,EAAE,SAAS,EAAE,EAAE,WAAW,2CAqJzD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/nav-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronDown, X } from 'lucide-react';
|
|
4
4
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useNav } from './context.js';
|
|
@@ -89,9 +89,14 @@ function NavBar({ sticky = false, className }) {
|
|
|
89
89
|
// on a CHANGE of `collapsed`, so it could never have policed a panel opened while
|
|
90
90
|
// already collapsed. What makes that unreachable is the stylesheet — a collapsed
|
|
91
91
|
// `.ahsuite-bar` is `visibility: hidden`, which takes `.ahsuite-trigger` out of the
|
|
92
|
-
// tab order and the
|
|
93
|
-
//
|
|
94
|
-
//
|
|
92
|
+
// tab order and the accessibility tree, so there is no way left to reach the control
|
|
93
|
+
// that opens the panel.
|
|
94
|
+
//
|
|
95
|
+
// This effect carries more weight than it used to. The panel is now a SIBLING of the
|
|
96
|
+
// bar rather than a descendant (see the stacking note below), so the bar's collapsed
|
|
97
|
+
// `visibility: hidden` no longer reaches it — an open panel would otherwise survive a
|
|
98
|
+
// collapse on screen with its trigger gone. Between the two, `hidden` on the panel is
|
|
99
|
+
// what removes it, and this is what sets it.
|
|
95
100
|
useEffect(() => {
|
|
96
101
|
if (!collapsed) {
|
|
97
102
|
return;
|
|
@@ -103,7 +108,7 @@ function NavBar({ sticky = false, className }) {
|
|
|
103
108
|
setOpen(false);
|
|
104
109
|
}, [activate]);
|
|
105
110
|
const classes = ['ahsuite-bar', sticky ? 'ahsuite-bar--sticky' : '', className ?? ''].filter(Boolean).join(' ');
|
|
106
|
-
return (_jsxs("div", { "aria-label": "ArtHelper suite", className: classes, "data-collapsed": collapsed ? 'true' : 'false', role: "navigation", children: [_jsxs("div", { className: "ahsuite-brand", children: [_jsx("button", { "aria-expanded": !collapsed, "aria-label": collapsed ? 'Show the suite bar' : 'Hide the suite bar', className: "ahsuite-waffle", onClick: toggle, type: "button", children: _jsx(WaffleIcon, {}) }), _jsxs("a", { "aria-label": `${WORDMARK_STRONG}${WORDMARK_LIGHT}`, className: "ahsuite-wordmark", href: WORDMARK_HREF, children: [_jsx("span", { className: "ahsuite-wordmark-strong", children: WORDMARK_STRONG }), _jsx("span", { className: "ahsuite-wordmark-light", children: WORDMARK_LIGHT })] })] }), _jsx("div", { className: "ahsuite-tiles", children: apps.map((entry) => (_jsx(Tile, { entry: entry, onActivate: onActivate }, entry.app.id))) }), _jsxs("button", { "aria-controls": "ahsuite-panel", "aria-expanded": open, "aria-haspopup": "true", className: "ahsuite-trigger", onClick: () => setOpen((current) => !current), ref: triggerRef, type: "button", children: [activeApp ? _jsx(Chip, { entry: activeApp }) : null, _jsx("span", { className: "ahsuite-trigger-label", children: activeApp?.app.label ?? 'Apps' }), _jsx(ChevronDown, { "aria-hidden": "true", className: "ahsuite-chevron", height: 18, strokeWidth: 2, width: 18 })] }), _jsx("span", { "aria-hidden": "true", className: "ahsuite-balance" }), _jsxs("div", { "aria-label": "Apps", className: "ahsuite-panel", hidden: !open, id: "ahsuite-panel", ref: panelRef, role: "dialog", children: [_jsxs("div", { className: "ahsuite-panel-head", children: [_jsx("span", { className: "ahsuite-panel-title", children: "Apps" }), _jsxs("button", { "aria-label": "Close", className: "ahsuite-close", onClick: () => setOpen(false), type: "button", children: [_jsx(X, { "aria-hidden": "true", className: "ahsuite-icon", height: 14, strokeWidth: 2, width: 14 }), _jsx("span", { children: "Close" })] })] }), apps.map((entry) => (_jsx(Row, { entry: entry, onActivate: onActivate }, entry.app.id)))] })] }));
|
|
111
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { "aria-label": "ArtHelper suite", className: classes, "data-collapsed": collapsed ? 'true' : 'false', role: "navigation", children: [_jsxs("div", { className: "ahsuite-brand", children: [_jsx("button", { "aria-expanded": !collapsed, "aria-label": collapsed ? 'Show the suite bar' : 'Hide the suite bar', className: "ahsuite-waffle", onClick: toggle, type: "button", children: _jsx(WaffleIcon, {}) }), _jsxs("a", { "aria-label": `${WORDMARK_STRONG}${WORDMARK_LIGHT}`, className: "ahsuite-wordmark", href: WORDMARK_HREF, children: [_jsx("span", { className: "ahsuite-wordmark-strong", children: WORDMARK_STRONG }), _jsx("span", { className: "ahsuite-wordmark-light", children: WORDMARK_LIGHT })] })] }), _jsx("div", { className: "ahsuite-tiles", children: apps.map((entry) => (_jsx(Tile, { entry: entry, onActivate: onActivate }, entry.app.id))) }), _jsxs("button", { "aria-controls": "ahsuite-panel", "aria-expanded": open, "aria-haspopup": "true", className: "ahsuite-trigger", onClick: () => setOpen((current) => !current), ref: triggerRef, type: "button", children: [activeApp ? _jsx(Chip, { entry: activeApp }) : null, _jsx("span", { className: "ahsuite-trigger-label", children: activeApp?.app.label ?? 'Apps' }), _jsx(ChevronDown, { "aria-hidden": "true", className: "ahsuite-chevron", height: 18, strokeWidth: 2, width: 18 })] }), _jsx("span", { "aria-hidden": "true", className: "ahsuite-balance" })] }), _jsxs("div", { "aria-label": "Apps", className: "ahsuite-panel", hidden: !open, id: "ahsuite-panel", ref: panelRef, role: "dialog", children: [_jsxs("div", { className: "ahsuite-panel-head", children: [_jsx("span", { className: "ahsuite-panel-title", children: "Apps" }), _jsxs("button", { "aria-label": "Close", className: "ahsuite-close", onClick: () => setOpen(false), type: "button", children: [_jsx(X, { "aria-hidden": "true", className: "ahsuite-icon", height: 14, strokeWidth: 2, width: 14 }), _jsx("span", { children: "Close" })] })] }), apps.map((entry) => (_jsx(Row, { entry: entry, onActivate: onActivate }, entry.app.id)))] })] }));
|
|
107
112
|
}
|
|
108
113
|
export { NavBar };
|
|
109
114
|
//# sourceMappingURL=nav-bar.js.map
|
package/dist/nav-bar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-bar.js","sourceRoot":"","sources":["../src/nav-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGjD;;;;;;;;;;GAUG;AACH;;;;GAIG;AACH,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAYlD,SAAS,SAAS,CAAC,KAAqB;IACtC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CA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ACjD,gCAAmB,OAAO,EAAC,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,aAC/F,KAAC,CAAC,mBAAa,MAAM,EAAC,SAAS,EAAC,cAAc,EAAC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,GAAI,EACxF,mCAAkB,IACX,IACL,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACnB,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,EAAqB,UAAU,EAAE,UAAU,IAApC,KAAK,CAAC,GAAG,CAAC,EAAE,CAA4B,CACjE,CAAC,IACE,IACL,CACJ,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/resolve.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ declare function hasDestination(app: NavApp): boolean;
|
|
|
23
23
|
* `fallbackConfig` arrive here identically.
|
|
24
24
|
*
|
|
25
25
|
* Note this is not a licence to invent destinations: only the ids the compiled-in
|
|
26
|
-
* FALLBACK_CONFIG actually carries
|
|
27
|
-
*
|
|
28
|
-
* guessing at a domain that may not exist on the stage yet.
|
|
26
|
+
* FALLBACK_CONFIG actually carries can be resolved this way, which is why an empty
|
|
27
|
+
* payload leaves a satellite host whose id is absent there with a genuinely empty bar
|
|
28
|
+
* rather than guessing at a domain that may not exist on the stage yet.
|
|
29
29
|
*/
|
|
30
30
|
declare function resolveApps(config: NavConfigPayload, activeAppId: string, fallback: NavConfigPayload): ResolvedNavApp[];
|
|
31
31
|
export { hasDestination, resolveApps };
|
package/dist/resolve.js
CHANGED
|
@@ -31,9 +31,9 @@ function findApp(apps, id) {
|
|
|
31
31
|
* `fallbackConfig` arrive here identically.
|
|
32
32
|
*
|
|
33
33
|
* Note this is not a licence to invent destinations: only the ids the compiled-in
|
|
34
|
-
* FALLBACK_CONFIG actually carries
|
|
35
|
-
*
|
|
36
|
-
* guessing at a domain that may not exist on the stage yet.
|
|
34
|
+
* FALLBACK_CONFIG actually carries can be resolved this way, which is why an empty
|
|
35
|
+
* payload leaves a satellite host whose id is absent there with a genuinely empty bar
|
|
36
|
+
* rather than guessing at a domain that may not exist on the stage yet.
|
|
37
37
|
*/
|
|
38
38
|
function resolveApps(config, activeAppId, fallback) {
|
|
39
39
|
const visible = config.apps.filter((app) => app.id === activeAppId || (app.enabled && hasDestination(app)));
|
package/package.json
CHANGED