@repobit/dex-system-design 2.7.0 → 2.7.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.7.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.7.0...@repobit/dex-system-design@2.7.1) (2026-10-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **DEX-29014:** bd-tabs copies follow their panels
11
+
12
+
6
13
  ## [2.7.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@2.6.0...@repobit/dex-system-design@2.7.0) (2026-10-29)
7
14
 
8
15
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-system-design",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Design system based on Web Components.",
5
5
  "author": "Iordache Matei Cezar <miordache@bitdefender.com>",
6
6
  "homepage": "https://github.com/bitdefender/dex-core#readme",
@@ -180,5 +180,5 @@
180
180
  "volta": {
181
181
  "node": "24.22.1"
182
182
  },
183
- "gitHead": "a088b0f4c0e8f7bc64459aa8d5fd9a546a629dc0"
183
+ "gitHead": "d1a11b82de2a73a18c8b52705f5b64cafef64e58"
184
184
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifestVersion": 1,
3
3
  "package": "@repobit/dex-system-design",
4
- "packageVersion": "2.7.0",
4
+ "packageVersion": "2.7.1",
5
5
  "generatedFrom": [
6
6
  "package.json exports",
7
7
  "Lit static properties",
@@ -93,6 +93,41 @@ class BdTabs extends LitElement {
93
93
  this.selectedTab = index;
94
94
  }
95
95
 
96
+ /* A copy is of its panel as it was when it was taken, and a page often
97
+ finishes a panel after bd-tabs is on it: the site's tabs block appends
98
+ the panels, then decorates the blocks inside them -- a features block
99
+ becomes bd-features -- and asks for an update. A copy used to be taken
100
+ on every render, so that update read the finished panels; once copies
101
+ were kept (_cloneOf), the open tab went on showing the raw block rows,
102
+ and the hidden ones sized the section from them -- 3822px for a panel
103
+ that is 735.
104
+
105
+ So the copies follow the panels. A change to what a panel holds, its
106
+ children or its text, has every copy taken again; so does an update
107
+ nobody named a property for -- a bare requestUpdate() -- which is how a
108
+ page says it changed something else, an attribute. Attributes are not
109
+ watched: the components inside a panel reflect their own, and a copy
110
+ taken again restarts what the open tab holds. */
111
+ connectedCallback() {
112
+ super.connectedCallback();
113
+ this._panelObserver ??= new MutationObserver(() => this._recopy());
114
+ this._panelObserver.observe(this, { childList: true, subtree: true, characterData: true });
115
+ }
116
+
117
+ disconnectedCallback() {
118
+ super.disconnectedCallback();
119
+ this._panelObserver.disconnect();
120
+ }
121
+
122
+ willUpdate(changed) {
123
+ if (!changed.size) this._clones = new WeakMap();
124
+ }
125
+
126
+ _recopy() {
127
+ this._clones = new WeakMap();
128
+ this.requestUpdate();
129
+ }
130
+
96
131
  /**
97
132
  * Every panel is rendered, all of them in one grid cell, so the wrapper is
98
133
  * as tall as the tallest panel and switching tabs moves nothing below it.
@@ -116,7 +151,8 @@ class BdTabs extends LitElement {
116
151
  * page; leaving it swaps the copy back for a sizer, so its accordions return
117
152
  * to their authored state and its video stops, which is what leaving did
118
153
  * when only the active panel was in the DOM. A copy is kept while its panel
119
- * stays as it is, so a re-render does not rebuild the panel being read.
154
+ * stays as it is, so a re-render does not rebuild the panel being read;
155
+ * when the panel changes, every copy is taken again (connectedCallback).
120
156
  */
121
157
  _cloneOf(panel, live) {
122
158
  let copy = this._clones.get(panel);