@juice-js/layout 2.4.1 → 2.4.2-alpha.3

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/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@juice-js/layout",
3
- "version": "2.4.1",
3
+ "version": "2.4.2-alpha.3",
4
4
  "description": "Juice layout",
5
5
  "author": {
6
6
  "name": "jack@creatorflow.io"
7
7
  },
8
8
  "license": "MIT",
9
9
  "bugs": {
10
- "url": "https://github.com/creatorflow-io/juice-layout/issues"
10
+ "url": "https://github.com/PavellisLabs/juice-layout/issues"
11
11
  },
12
- "homepage": "https://github.com/creatorflow-io/juice-layout#readme",
12
+ "homepage": "https://github.com/PavellisLabs/juice-layout#readme",
13
13
  "publishConfig": {
14
14
  "access": "public",
15
15
  "provenance": true
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/creatorflow-io/juice-layout.git"
19
+ "url": "git+https://github.com/PavellisLabs/juice-layout.git"
20
20
  },
21
21
  "peerDependencies": {
22
- "@juice-js/core": "2.4.1",
23
- "@juice-js/localize": "2.4.1"
22
+ "@juice-js/core": "2.4.2-alpha.3",
23
+ "@juice-js/localize": "2.4.2-alpha.3"
24
24
  },
25
25
  "dependencies": {
26
26
  "tslib": "^2.3.0"
@@ -40,5 +40,5 @@
40
40
  "typings": "types/juice-js-layout.d.ts",
41
41
  "type": "module",
42
42
  "readme": "ERROR: No README data found!",
43
- "_id": "@juice-js/layout@2.4.1"
43
+ "_id": "@juice-js/layout@2.4.2-alpha.3"
44
44
  }
@@ -96,6 +96,16 @@ $palettes: ('teal': palettes.$teal, 'indigo': palettes.$indigo);
96
96
  html, body, app-root, app-page, app-page > .container { height: 100%; margin: 0; display: block; }
97
97
  .p-4 { padding: 1rem !important; }
98
98
 
99
+ // Touch targets of at least 40px on a phone: the shell's own toolbar (its icon buttons, and any select or chip an app
100
+ // puts in it), never the pages' content.
101
+ @media (max-width: 599.98px) {
102
+ app-page > .container > .mat-toolbar {
103
+ .mat-mdc-icon-button.mat-mdc-button-base { width: 40px; height: 40px; padding: 8px; }
104
+ .mat-mdc-form-field-infix { min-height: 40px; }
105
+ .mat-mdc-chip.mat-mdc-standard-chip { min-height: 40px; }
106
+ }
107
+ }
108
+
99
109
  ::-webkit-scrollbar { width: 10px; height: 10px; }
100
110
  ::-webkit-scrollbar-thumb { background: var(--mat-sys-outline-variant); border-radius: 10px; }
101
111
  ::-webkit-scrollbar-track { background: transparent; }
@@ -4,7 +4,7 @@ import { TenantService, MenuItem, MenuService, AsyncDialog } from '@juice-js/cor
4
4
  import { BreakpointObserver } from '@angular/cdk/layout';
5
5
  import * as _juice_js_layout from '@juice-js/layout';
6
6
  import * as i11 from '@angular/router';
7
- import { ActivatedRoute, Router } from '@angular/router';
7
+ import { ActivatedRoute, IsActiveMatchOptions, Router } from '@angular/router';
8
8
  import { OAuthService } from 'angular-oauth2-oidc';
9
9
  import * as i12 from '@angular/common';
10
10
  import * as i13 from '@ngx-translate/core';
@@ -37,6 +37,7 @@ declare class LayoutConfig {
37
37
  pageSwitcher: boolean;
38
38
  palettes: LayoutPalette[];
39
39
  defaultPalette: string | undefined;
40
+ mainLandmark: boolean;
40
41
  constructor(options?: ILayoutConfig);
41
42
  }
42
43
  interface ILayoutConfig {
@@ -63,6 +64,11 @@ interface ILayoutConfig {
63
64
  * `layout.theme((default: …))` changed it).
64
65
  */
65
66
  defaultPalette?: string;
67
+ /**
68
+ * Whether the shell marks its content area as the page's main landmark (`role="main"`). Set false when the pages
69
+ * bring their own `<main>`: a page has one. Default true.
70
+ */
71
+ mainLandmark?: boolean;
66
72
  }
67
73
  /** A colour palette, as `layout.theme()` names it and the palette menu shows it. */
68
74
  interface LayoutPalette {
@@ -110,6 +116,8 @@ declare class LayoutService {
110
116
  favicon(): string;
111
117
  brandName(): string;
112
118
  brandLogo(): string;
119
+ /** Whether the shell's content area is the page's main landmark (LayoutConfig.mainLandmark, default true). */
120
+ mainLandmark(): boolean;
113
121
  settingUrl(): string | undefined;
114
122
  userImageUrl(username: string): string;
115
123
  static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService, [{ optional: true; }, null]>;
@@ -252,9 +260,16 @@ declare class PageComponent {
252
260
  readonly toolbarItems: Type<unknown>[];
253
261
  isMobile: boolean;
254
262
  isSnavOpenned: boolean;
263
+ /**
264
+ * True while the shell is first drawn: the sidenav's width, its mode and the menu's open groups settle with no
265
+ * animation (an animated settle on load shifts the page under the reader).
266
+ */
267
+ settling: boolean;
255
268
  constructor(service: LayoutService, search: SearchService,
256
269
  /** The page switcher: its keys are live while the shell is, and the shell shows it (see the constructor). */
257
270
  switcher: PageSwitcherService, breakpointObserver: BreakpointObserver, cdr: ChangeDetectorRef);
271
+ /** The skip link: moves the focus to the page, without touching the URL (the router owns it). */
272
+ skipToContent(event: Event): void;
258
273
  /**
259
274
  * Shows the page switcher in a dialog while it is open (the dialog brings the focus trap, Escape, the backdrop and
260
275
  * gives focus back), and its keys while the shell is on screen.
@@ -378,6 +393,15 @@ declare class NavMenuComponent {
378
393
  constructor(service: MenuService, layout: LayoutService, tenantService: TenantService, route: ActivatedRoute, breakpointObserver: BreakpointObserver, cdr: ChangeDetectorRef, switcher: PageSwitcherService);
379
394
  /** The items that show as a group: they have pages the side menu shows. */
380
395
  groups: Set<MenuItem>;
396
+ private readonly router;
397
+ /**
398
+ * The path of the entry on display, across all the menu's entries (also the pages in groups): the most specific one,
399
+ * so `/alerts/rules` is marked on `/alerts/rules` and `/alerts` is not.
400
+ */
401
+ activeLink: string | null;
402
+ private refreshActive;
403
+ /** Whether the entry is the page on display (or the page the one on display is under). */
404
+ isCurrent(item: MenuItem): boolean;
381
405
  toggle(): void;
382
406
  mouseEnter(): void;
383
407
  mouseLeave(): void;
@@ -403,6 +427,11 @@ declare class ExpandableMenuComponent {
403
427
  /** While the group is closed: its own count and its pages' together. */
404
428
  protected readonly closedBadge: i0.Signal<_juice_js_layout.MenuBadge | null>;
405
429
  isExpanded: boolean;
430
+ /**
431
+ * The path of the entry on display across the whole menu (the most specific one, see `mostSpecificLink`), given by
432
+ * the menu. Left out (undefined), the group goes by its own pages alone.
433
+ */
434
+ activeLink?: string | null;
406
435
  set item(value: MenuItem);
407
436
  get item(): MenuItem;
408
437
  TooltipPosition: typeof TooltipPosition;
@@ -422,10 +451,13 @@ declare class ExpandableMenuComponent {
422
451
  * How a child's link matches: with the pages under it, unless other pages of the group sit under it too (a link to
423
452
  * `/` or to the tenant's root), which would make it match every page.
424
453
  */
425
- private matching;
454
+ /** Whether a page of the group is the page on display. */
455
+ protected isChildActive(child: MenuItem): boolean;
456
+ protected matching(link: string, links?: readonly string[]): IsActiveMatchOptions;
457
+ private get childLinks();
426
458
  private isActive;
427
459
  static ɵfac: i0.ɵɵFactoryDeclaration<ExpandableMenuComponent, never>;
428
- static ɵcmp: i0.ɵɵComponentDeclaration<ExpandableMenuComponent, "juice-expandable-menu", never, { "isExpanded": { "alias": "isExpanded"; "required": false; }; "item": { "alias": "item"; "required": false; }; }, {}, never, never, false, never>;
460
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpandableMenuComponent, "juice-expandable-menu", never, { "isExpanded": { "alias": "isExpanded"; "required": false; }; "activeLink": { "alias": "activeLink"; "required": false; }; "item": { "alias": "item"; "required": false; }; }, {}, never, never, false, never>;
429
461
  }
430
462
 
431
463
  declare class PageNotfoundComponent {