meta_workflows 0.9.33 → 0.9.35

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3496946526cd97d8ed5722ce2aef1c3e5a481e9345f41ee5a3902a001c7a1d9a
4
- data.tar.gz: 675a6e8c765f6479e7c766e0ae34d458c70b0804aebf720d0584606c734fe956
3
+ metadata.gz: 1fc32552e17235232a36f30cb278b377560b1062503c1bc97aa3fd1c1176565d
4
+ data.tar.gz: 35ccadac9b9b89610f8955b54ae7d0221706848c0927cfcb467f2aba3229cfb0
5
5
  SHA512:
6
- metadata.gz: 66d6d6ab599efe41489eba40a19e2c80d86e4331193981fc45d4deed838ae946da59d41eebc45639a747b9e7c9b8c2c67cf1b18a37387ad8aa310fd054c0eadb
7
- data.tar.gz: 24998761fb152ca8e78d3ffd4ab1c2b45863a84772e3678127066c37b8188a4e3982a2fdae7d981dc3ae85515668f6fab2bda5fb07bd767cc10844920bef8121
6
+ metadata.gz: 6df6283dcc5b758912dd82225db2a1d22dbcc8933301112396d6deaa1199bafc9bcaa48c17b8c91f647b1b3e705c6f6b75ca75e4462600068845c85f9c738447
7
+ data.tar.gz: 6b763b871857e8f0411e917e9a20075398d6a014fdb0e903ba0409c9f389a94ac84990533e2598d6f76d6eb557e1f9374fec32ad4a4a25d3e55043263d8a9773
@@ -23,8 +23,8 @@ export default class extends Controller {
23
23
  return;
24
24
  }
25
25
 
26
- // Check if we have structured input selections
27
- const hasStructuredSelections = this.hasStructuredInputTargets.some(input =>
26
+ const hasStructuredSelections = this.structuredInputTargets.length > 0 &&
27
+ this.structuredInputTargets.some(input =>
28
28
  input.checked || (input.type === 'range' && input.value !== input.min)
29
29
  );
30
30
 
@@ -19,22 +19,24 @@ function chevronDirection(tray, expanded) {
19
19
  }
20
20
 
21
21
  export default class extends Controller {
22
- static values = { name: String }
23
- static targets = ["content", "chevron"]
22
+ static targets = ["content", "chevron", "gammaTray", "betaTray", "deltaTray"]
24
23
 
25
24
  connect() {
25
+ const trayName = this.getTrayName();
26
+
26
27
  // Load state from cookies
27
- const savedState = getCookie(`tray_${this.nameValue}`);
28
+ const savedState = getCookie(`tray_${trayName}`);
28
29
  if (savedState === "collapsed") {
29
30
  this.expanded = false;
30
31
  } else {
31
32
  this.expanded = true;
32
33
  }
33
34
  this.updateTray();
35
+
34
36
  // Set chevron direction from cookie if present
35
37
  const chevron = this.hasChevronTarget ? this.chevronTarget : null;
36
38
  if (chevron) {
37
- const chevronCookie = getCookie(`chevron_${this.nameValue}`);
39
+ const chevronCookie = getCookie(`chevron_${trayName}`);
38
40
  if (chevronCookie) {
39
41
  chevron.classList.remove("fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-chevron-down");
40
42
  chevron.classList.add(chevronCookie);
@@ -42,65 +44,108 @@ export default class extends Controller {
42
44
  }
43
45
  }
44
46
 
45
- toggle() {
47
+ toggle(trayType = null) {
48
+ if (!trayType) {
49
+ trayType = this.getTrayName();
50
+ }
51
+
52
+ const trayTargetName = `${trayType}TrayTarget`;
53
+ const hasTrayTarget = `has${trayType.charAt(0).toUpperCase() + trayType.slice(1)}TrayTarget`;
54
+
55
+ if (!this[hasTrayTarget]) {
56
+ return;
57
+ }
58
+
46
59
  this.expanded = !this.expanded;
47
- // Save state to cookies
48
- setCookie(`tray_${this.nameValue}`, this.expanded ? "expanded" : "collapsed");
49
- // Save chevron direction to cookies
50
- setCookie(`chevron_${this.nameValue}`, chevronDirection(this.nameValue, this.expanded));
51
- this.updateTray();
60
+
61
+ setCookie(`tray_${trayType}`, this.expanded ? "expanded" : "collapsed");
62
+ setCookie(`chevron_${trayType}`, chevronDirection(trayType, this.expanded));
63
+
64
+ const updateMethod = `update${trayType.charAt(0).toUpperCase() + trayType.slice(1)}Tray`;
65
+ this[updateMethod](this.hasChevronTarget, this[trayTargetName]);
66
+ }
67
+
68
+ toggleGamma() {
69
+ this.toggle("gamma");
70
+ }
71
+
72
+ toggleBeta() {
73
+ this.toggle("beta");
74
+ }
75
+
76
+ toggleDelta() {
77
+ this.toggle("delta");
78
+ }
79
+
80
+ getTrayName() {
81
+ if (this.hasGammaTrayTarget) return "gamma";
82
+ if (this.hasBetaTrayTarget) return "beta";
83
+ if (this.hasDeltaTrayTarget) return "delta";
84
+ return "unknown";
85
+ }
86
+
87
+ getCurrentTrayElement() {
88
+ if (this.hasGammaTrayTarget) return this.gammaTrayTarget;
89
+ if (this.hasBetaTrayTarget) return this.betaTrayTarget;
90
+ if (this.hasDeltaTrayTarget) return this.deltaTrayTarget;
91
+ return this.element;
52
92
  }
53
93
 
54
94
  updateTray() {
95
+ const trayName = this.getTrayName();
55
96
  const hasChevron = this.hasChevronTarget;
97
+ const trayElement = this.getCurrentTrayElement();
56
98
 
57
- switch (this.nameValue) {
99
+ switch (trayName) {
58
100
  case "delta":
59
- this.updateDeltaTray(hasChevron);
101
+ this.updateDeltaTray(hasChevron, trayElement);
60
102
  break;
61
103
  case "beta":
62
- this.updateBetaTray(hasChevron);
104
+ this.updateBetaTray(hasChevron, trayElement);
63
105
  break;
64
106
  case "gamma":
65
- this.updateGammaTray(hasChevron);
107
+ this.updateGammaTray(hasChevron, trayElement);
66
108
  break;
67
109
  }
68
110
  }
69
111
 
70
- updateDeltaTray(hasChevron) {
112
+ updateDeltaTray(hasChevron, trayElement) {
71
113
  if (this.expanded) {
72
- this.element.classList.remove("collapsed");
73
- this.element.classList.add("h-[200px]");
114
+ trayElement.classList.remove("collapsed");
115
+ trayElement.classList.add("h-[200px]");
74
116
  this.updateChevronClasses(hasChevron, "fa-chevron-up", "fa-chevron-down");
75
117
  } else {
76
- this.element.classList.remove("h-[200px]");
77
- this.element.classList.add("collapsed");
118
+ trayElement.classList.remove("h-[200px]");
119
+ trayElement.classList.add("collapsed");
78
120
  this.updateChevronClasses(hasChevron, "fa-chevron-down", "fa-chevron-up");
79
121
  }
80
122
  }
81
123
 
82
- updateBetaTray(hasChevron) {
124
+ updateBetaTray(hasChevron, trayElement) {
83
125
  // Beta: open=left, collapsed=right
84
126
  if (this.expanded) {
85
- this.element.classList.remove("collapsed");
86
- this.element.classList.add("w-[300px]");
127
+ trayElement.classList.remove("collapsed");
128
+ trayElement.classList.add("w-[300px]");
87
129
  this.updateChevronClasses(hasChevron, "fa-chevron-right", "fa-chevron-left");
88
130
  } else {
89
- this.element.classList.remove("w-[300px]");
90
- this.element.classList.add("collapsed");
131
+ trayElement.classList.remove("w-[300px]");
132
+ trayElement.classList.add("collapsed");
91
133
  this.updateChevronClasses(hasChevron, "fa-chevron-left", "fa-chevron-right");
92
134
  }
93
135
  }
94
136
 
95
- updateGammaTray(hasChevron) {
137
+ updateGammaTray(hasChevron, trayElement) {
138
+ console.log(`Updating gamma tray - expanded: ${this.expanded}`);
96
139
  // Gamma: open=right, collapsed=left
97
140
  if (this.expanded) {
98
- this.element.classList.remove("collapsed");
99
- this.element.classList.add("w-[300px]");
141
+ console.log('Expanding gamma tray');
142
+ trayElement.classList.remove("collapsed");
143
+ trayElement.classList.add("w-[300px]");
100
144
  this.updateChevronClasses(hasChevron, "fa-chevron-left", "fa-chevron-right");
101
145
  } else {
102
- this.element.classList.remove("w-[300px]");
103
- this.element.classList.add("collapsed");
146
+ console.log('Collapsing gamma tray');
147
+ trayElement.classList.remove("w-[300px]");
148
+ trayElement.classList.add("collapsed");
104
149
  this.updateChevronClasses(hasChevron, "fa-chevron-right", "fa-chevron-left");
105
150
  }
106
151
  }
@@ -653,7 +653,7 @@
653
653
 
654
654
  /* Hide standard collapse button when Lexi tray is collapsed */
655
655
  .gamma-tray.lexi-tray.collapsed
656
- > button[data-action='click->tray#toggle']:not(.lexi-floating-avatar) {
656
+ > button[data-action='click->tray#toggleGamma']:not(.lexi-floating-avatar) {
657
657
  display: none;
658
658
  }
659
659
 
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- PATCH = 33 # this is automatically incremented by the build process
6
+ PATCH = 35 # this is automatically incremented by the build process
7
7
 
8
8
  VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_workflows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.33
4
+ version: 0.9.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy