terrier-engine 4.38.0 → 4.38.2

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.
@@ -1,9 +1,11 @@
1
- import {NoState, PartTag} from "tuff-core/parts"
1
+ import {PartTag} from "tuff-core/parts"
2
2
  import {TerrierApp} from "../terrier/app"
3
3
  import {RouterPart} from "tuff-core/routing"
4
+ import { Action } from "../terrier/theme"
4
5
  import {routes} from "./dd-routes"
5
6
  import {DiveListPage} from "./dives/dive-list"
6
7
  import DdSession from "./dd-session"
8
+ import { DivePage } from "./dives/dive-page"
7
9
 
8
10
  class ContentRouterPart extends RouterPart {
9
11
  get defaultPart() {
@@ -16,7 +18,7 @@ class ContentRouterPart extends RouterPart {
16
18
 
17
19
  }
18
20
 
19
- export default class DdApp extends TerrierApp<NoState> {
21
+ export default class DdApp extends TerrierApp<{}> {
20
22
 
21
23
  contentPart!: ContentRouterPart
22
24
  session!: DdSession
@@ -39,4 +41,16 @@ export default class DdApp extends TerrierApp<NoState> {
39
41
  parent.part(this.overlayPart)
40
42
  }
41
43
 
44
+ /**
45
+ * App-specific subclasses should override this to
46
+ */
47
+ docsAction(): Action {
48
+ return {
49
+ title: 'Docs',
50
+ icon: 'glyp-help',
51
+ click: {key: DivePage.docsKey},
52
+ classes: ['data-dive-docs']
53
+ }
54
+ }
55
+
42
56
  }
@@ -1,19 +1,18 @@
1
1
  import PagePart from "../../terrier/parts/page-part"
2
2
  import Messages from "tuff-core/messages"
3
+ import DdApp from "../dd-app"
3
4
 
4
5
 
5
6
  export abstract class DivePage<T> extends PagePart<T> {
6
7
 
7
8
  static docsKey = Messages.untypedKey()
8
9
 
10
+ /**
11
+ * Add the docs action to the page.
12
+ */
9
13
  addDocsAction() {
10
-
11
- this.addAction({
12
- title: 'Docs',
13
- icon: 'glyp-help',
14
- click: {key: DivePage.docsKey},
15
- classes: ['data-dive-docs']
16
- }, 'tertiary')
14
+ const app = this.app as DdApp
15
+ this.addAction(app.docsAction(), 'tertiary')
17
16
  }
18
17
 
19
18
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.38.0",
7
+ "version": "4.38.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -193,7 +193,7 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
193
193
  continue;
194
194
  }
195
195
 
196
- fields.label(label => {
196
+ fields.label(`label-${def.name}`, label => {
197
197
  if (def.icon?.length) {
198
198
  label.i('.icon').class(def.icon)
199
199
  }