terrier-engine 4.4.28 → 4.4.31

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
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.4.28",
7
+ "version": "4.4.31",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -221,6 +221,10 @@ import PostRaw from '../images/icons/post.svg?raw'
221
221
  // @ts-ignore
222
222
  import PostSrc from '../images/icons/post.svg'
223
223
  // @ts-ignore
224
+ import PostsRaw from '../images/icons/posts.svg?raw'
225
+ // @ts-ignore
226
+ import PostsSrc from '../images/icons/posts.svg'
227
+ // @ts-ignore
224
228
  import PrClosedRaw from '../images/icons/pr_closed.svg?raw'
225
229
  // @ts-ignore
226
230
  import PrClosedSrc from '../images/icons/pr_closed.svg'
@@ -554,6 +558,10 @@ export const IconDefs: Record<HubIconName,{ raw: string, src: string }> = {
554
558
  raw: PostRaw,
555
559
  src: PostSrc,
556
560
  },
561
+ "hub-posts": {
562
+ raw: PostsRaw,
563
+ src: PostsSrc,
564
+ },
557
565
  "hub-pr_closed": {
558
566
  raw: PrClosedRaw,
559
567
  src: PrClosedSrc,
@@ -673,7 +681,7 @@ export const IconDefs: Record<HubIconName,{ raw: string, src: string }> = {
673
681
  }
674
682
 
675
683
  const Names = [
676
- 'hub-active', 'hub-admin', 'hub-archive', 'hub-arrow_down', 'hub-arrow_left', 'hub-arrow_right', 'hub-arrow_up', 'hub-assign', 'hub-attachment', 'hub-back', 'hub-badge', 'hub-board', 'hub-branch', 'hub-bug', 'hub-calculator', 'hub-checkmark', 'hub-close', 'hub-clypboard', 'hub-comment', 'hub-complete', 'hub-dashboard', 'hub-data_pull', 'hub-data_update', 'hub-database', 'hub-day', 'hub-delete', 'hub-documentation', 'hub-edit', 'hub-feature', 'hub-flex', 'hub-forward', 'hub-github', 'hub-history', 'hub-home', 'hub-image', 'hub-inbox', 'hub-info', 'hub-issue', 'hub-lane', 'hub-lane_asap', 'hub-lane_days', 'hub-lane_hours', 'hub-lane_weeks', 'hub-lanes_board', 'hub-level_complete', 'hub-level_highway', 'hub-level_on_ramp', 'hub-level_parking', 'hub-minus', 'hub-night', 'hub-origin', 'hub-pending', 'hub-plus', 'hub-post', 'hub-pr_closed', 'hub-pr_merged', 'hub-pr_open', 'hub-prioritized', 'hub-project', 'hub-question', 'hub-reaction', 'hub-read_mail', 'hub-recent', 'hub-refresh', 'hub-request', 'hub-settings', 'hub-status', 'hub-step_deploy', 'hub-step_develop', 'hub-step_investigate', 'hub-step_review', 'hub-step_test', 'hub-steps', 'hub-steps_board', 'hub-subscribe', 'hub-support', 'hub-terrier', 'hub-thumbs_up', 'hub-type', 'hub-unprioritized', 'hub-upload', 'hub-user', 'hub-users'
684
+ 'hub-active', 'hub-admin', 'hub-archive', 'hub-arrow_down', 'hub-arrow_left', 'hub-arrow_right', 'hub-arrow_up', 'hub-assign', 'hub-attachment', 'hub-back', 'hub-badge', 'hub-board', 'hub-branch', 'hub-bug', 'hub-calculator', 'hub-checkmark', 'hub-close', 'hub-clypboard', 'hub-comment', 'hub-complete', 'hub-dashboard', 'hub-data_pull', 'hub-data_update', 'hub-database', 'hub-day', 'hub-delete', 'hub-documentation', 'hub-edit', 'hub-feature', 'hub-flex', 'hub-forward', 'hub-github', 'hub-history', 'hub-home', 'hub-image', 'hub-inbox', 'hub-info', 'hub-issue', 'hub-lane', 'hub-lane_asap', 'hub-lane_days', 'hub-lane_hours', 'hub-lane_weeks', 'hub-lanes_board', 'hub-level_complete', 'hub-level_highway', 'hub-level_on_ramp', 'hub-level_parking', 'hub-minus', 'hub-night', 'hub-origin', 'hub-pending', 'hub-plus', 'hub-post', 'hub-posts', 'hub-pr_closed', 'hub-pr_merged', 'hub-pr_open', 'hub-prioritized', 'hub-project', 'hub-question', 'hub-reaction', 'hub-read_mail', 'hub-recent', 'hub-refresh', 'hub-request', 'hub-settings', 'hub-status', 'hub-step_deploy', 'hub-step_develop', 'hub-step_investigate', 'hub-step_review', 'hub-step_test', 'hub-steps', 'hub-steps_board', 'hub-subscribe', 'hub-support', 'hub-terrier', 'hub-thumbs_up', 'hub-type', 'hub-unprioritized', 'hub-upload', 'hub-user', 'hub-users'
677
685
  ] as const
678
686
 
679
687
  export type HubIconName = typeof Names[number]
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="currentColor" fill-rule="evenodd"><g transform="translate(11 4)"><path d="M5 0a5 5 0 1 1 0 10A5 5 0 0 1 5 0Zm0 .625a4.375 4.375 0 0 0-4.234 5.48A6.884 6.884 0 0 1 6.106.767 4.382 4.382 0 0 0 5 .625Z"/><circle cx="5" cy="5" r="5" fill-opacity="0.33" fill-rule="nonzero"/></g><path fill-opacity="0.33" fill-rule="nonzero" d="M4.715 20.971 6.667 19.8 14 13.2 11.8 11l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><path fill-opacity="0.33" fill-rule="nonzero" d="M4.715 20.971 6.667 19.8 14 13.2 11.8 11l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><g transform="translate(18 12)"><path d="M5 0a5 5 0 1 1 0 10A5 5 0 0 1 5 0Zm0 .625a4.375 4.375 0 0 0-4.234 5.48A6.884 6.884 0 0 1 6.106.767 4.382 4.382 0 0 0 5 .625Z"/><circle cx="5" cy="5" r="5" fill-opacity="0.33" fill-rule="nonzero"/></g><path fill-opacity="0.33" fill-rule="nonzero" d="m11.715 28.971 1.952-1.171L21 21.2 18.8 19l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><path fill-opacity="0.33" fill-rule="nonzero" d="m11.715 28.971 1.952-1.171L21 21.2 18.8 19l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#000" fill-rule="evenodd"><g transform="translate(11 4)"><path d="M5 0a5 5 0 1 1 0 10A5 5 0 0 1 5 0Zm0 .625a4.375 4.375 0 0 0-4.234 5.48A6.884 6.884 0 0 1 6.106.767 4.382 4.382 0 0 0 5 .625Z"/><circle cx="5" cy="5" r="5" fill-opacity=".25" fill-rule="nonzero"/></g><path fill-opacity=".25" fill-rule="nonzero" d="M4.715 20.971 6.667 19.8 14 13.2 11.8 11l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><path fill-opacity=".25" fill-rule="nonzero" d="M4.715 20.971 6.667 19.8 14 13.2 11.8 11l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><g transform="translate(18 12)"><path d="M5 0a5 5 0 1 1 0 10A5 5 0 0 1 5 0Zm0 .625a4.375 4.375 0 0 0-4.234 5.48A6.884 6.884 0 0 1 6.106.767 4.382 4.382 0 0 0 5 .625Z"/><circle cx="5" cy="5" r="5" fill-opacity=".25" fill-rule="nonzero"/></g><path fill-opacity=".25" fill-rule="nonzero" d="m11.715 28.971 1.952-1.171L21 21.2 18.8 19l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/><path fill-opacity=".25" fill-rule="nonzero" d="m11.715 28.971 1.952-1.171L21 21.2 18.8 19l-6.6 7.333-1.171 1.952a.5.5 0 0 0 .686.686Z"/></g></svg>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>icon-posts</title>
4
+ <g id="icon-posts" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="Group-2" transform="translate(3, 4)" fill="#000000">
6
+ <g id="Group" transform="translate(8, 0)">
7
+ <path d="M5,0 C7.76142375,0 10,2.23857625 10,5 C10,7.76142375 7.76142375,10 5,10 C2.23857625,10 0,7.76142375 0,5 C0,2.23857625 2.23857625,0 5,0 Z M5,0.625 C2.58375422,0.625 0.625,2.58375422 0.625,5 C0.625,5.38216593 0.67400063,5.75288715 0.766486301,6.10562843 C1.31818969,3.42748108 3.42748108,1.31818969 6.10622362,0.76606185 C5.75288715,0.67400063 5.38216593,0.625 5,0.625 Z" id="Oval-2"></path>
8
+ <circle id="Oval" fill-opacity="0.25" fill-rule="nonzero" cx="5" cy="5" r="5"></circle>
9
+ </g>
10
+ <path d="M1.71498585,16.9710085 L3.66666667,15.8 L3.66666667,15.8 L11,9.2 L8.8,7 L2.2,14.3333333 L1.02899151,16.2850141 C0.886917431,16.5218043 0.963699963,16.8289344 1.2004901,16.9710085 C1.35883129,17.0660132 1.55664466,17.0660132 1.71498585,16.9710085 Z" id="Path-25" fill-opacity="0.25" fill-rule="nonzero"></path>
11
+ <path d="M1.71498585,16.9710085 L3.66666667,15.8 L3.66666667,15.8 L11,9.2 L8.8,7 L2.2,14.3333333 L1.02899151,16.2850141 C0.886917431,16.5218043 0.963699963,16.8289344 1.2004901,16.9710085 C1.35883129,17.0660132 1.55664466,17.0660132 1.71498585,16.9710085 Z" id="Path-25-Copy" fill-opacity="0.25" fill-rule="nonzero"></path>
12
+ </g>
13
+ <g id="Group-2-Copy" transform="translate(10, 12)" fill="#000000">
14
+ <g id="Group" transform="translate(8, 0)">
15
+ <path d="M5,0 C7.76142375,0 10,2.23857625 10,5 C10,7.76142375 7.76142375,10 5,10 C2.23857625,10 0,7.76142375 0,5 C0,2.23857625 2.23857625,0 5,0 Z M5,0.625 C2.58375422,0.625 0.625,2.58375422 0.625,5 C0.625,5.38216593 0.67400063,5.75288715 0.766486301,6.10562843 C1.31818969,3.42748108 3.42748108,1.31818969 6.10622362,0.76606185 C5.75288715,0.67400063 5.38216593,0.625 5,0.625 Z" id="Oval-2"></path>
16
+ <circle id="Oval" fill-opacity="0.25" fill-rule="nonzero" cx="5" cy="5" r="5"></circle>
17
+ </g>
18
+ <path d="M1.71498585,16.9710085 L3.66666667,15.8 L3.66666667,15.8 L11,9.2 L8.8,7 L2.2,14.3333333 L1.02899151,16.2850141 C0.886917431,16.5218043 0.963699963,16.8289344 1.2004901,16.9710085 C1.35883129,17.0660132 1.55664466,17.0660132 1.71498585,16.9710085 Z" id="Path-25" fill-opacity="0.25" fill-rule="nonzero"></path>
19
+ <path d="M1.71498585,16.9710085 L3.66666667,15.8 L3.66666667,15.8 L11,9.2 L8.8,7 L2.2,14.3333333 L1.02899151,16.2850141 C0.886917431,16.5218043 0.963699963,16.8289344 1.2004901,16.9710085 C1.35883129,17.0660132 1.55664466,17.0660132 1.71498585,16.9710085 Z" id="Path-25-Copy" fill-opacity="0.25" fill-rule="nonzero"></path>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -1,11 +1,27 @@
1
1
  import ContentPart from "./content-part"
2
2
  import {PartTag} from "tuff-core/parts"
3
3
  import Fragments from "../fragments"
4
+ import {untypedKey} from "tuff-core/messages";
4
5
 
6
+ export type CollapsibleConfig = {
7
+ collapsed?: Boolean
8
+ chevronSide: string
9
+ }
5
10
  /**
6
11
  * A part that renders content inside a panel.
7
12
  */
8
- export default abstract class PanelPart<TState> extends ContentPart<TState> {
13
+ export default abstract class PanelPart<TState> extends ContentPart<TState & { collapsible?: CollapsibleConfig}> {
14
+
15
+ toggleCollapseKey = untypedKey()
16
+
17
+ async init() {
18
+ if (this.state.collapsible && !this.state.collapsible.chevronSide) {
19
+ this.state.collapsible.chevronSide = 'left'
20
+ this.onClick(this.toggleCollapseKey, _ => {
21
+ this.toggleCollapse()
22
+ })
23
+ }
24
+ }
9
25
 
10
26
  getLoadingContainer() {
11
27
  return this.element?.getElementsByClassName('tt-panel')[0]
@@ -24,6 +40,9 @@ export default abstract class PanelPart<TState> extends ContentPart<TState> {
24
40
  panel.class(...this.panelClasses)
25
41
  if (this._title?.length || this.hasActions('tertiary')) {
26
42
  panel.div('.panel-header', header => {
43
+ if (this.state.collapsible?.chevronSide == 'left') {
44
+ this.renderChevron(header)
45
+ }
27
46
  header.h2(h2 => {
28
47
  if (this._icon) {
29
48
  this.app.theme.renderIcon(h2, this._icon, 'link')
@@ -33,12 +52,38 @@ export default abstract class PanelPart<TState> extends ContentPart<TState> {
33
52
  header.div('.tertiary-actions', actions => {
34
53
  this.theme.renderActions(actions, this.getActions('tertiary'))
35
54
  })
55
+ if (this.state.collapsible?.chevronSide == 'right') {
56
+ this.renderChevron(header)
57
+ }
36
58
  })
37
59
  }
38
- panel.div('.panel-content', ...this.contentClasses, content => {
39
- this.renderContent(content)
40
- })
60
+ if (!this.state.collapsible?.collapsed) {
61
+ panel.div('.panel-content', ...this.contentClasses, content => {
62
+ this.renderContent(content)
63
+ })
64
+ }
65
+
41
66
  Fragments.panelActions(panel, this.getAllActions(), this.theme)
42
67
  })
43
68
  }
69
+
70
+ toggleCollapse() {
71
+ if (this.state.collapsible) {
72
+ this.state.collapsible.collapsed = !this.state.collapsible?.collapsed
73
+ this.dirty()
74
+ }
75
+ }
76
+
77
+ renderChevron(parent: PartTag) {
78
+ if (this.state.collapsible) {
79
+ parent.div('.collapsible-chevron', chev => {
80
+ this.renderChevronIcon(chev, this.state.collapsible?.collapsed!)
81
+ parent.emitClick(this.toggleCollapseKey)
82
+ })
83
+ }
84
+ }
85
+
86
+ renderChevronIcon(parent: PartTag, isCollapsed: Boolean) {
87
+ this.app.theme.renderIcon(parent, isCollapsed ? 'glyp-chevron_right' : 'glyp-chevron_down', 'white')
88
+ }
44
89
  }