@design.estate/dees-wcctools 3.1.1 → 3.2.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-wcctools",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "private": false,
5
5
  "description": "A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-wcctools',
6
- version: '3.1.1',
6
+ version: '3.2.0',
7
7
  description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
8
8
  }
@@ -925,16 +925,16 @@ export class WccProperties extends DeesElement {
925
925
  this.dashboardRef.buildUrl();
926
926
  }
927
927
 
928
- public async scheduleUpdate() {
929
- try {
930
- await this.createProperties();
931
- } catch (error) {
932
- console.error('Error creating properties:', error);
933
- // Clear property content on error to show clean state
934
- this.propertyContent = [];
928
+ protected updated(changedProperties: Map<string, unknown>) {
929
+ super.updated(changedProperties);
930
+
931
+ // Only recreate properties when selectedItem changes
932
+ if (changedProperties.has('selectedItem')) {
933
+ this.createProperties().catch(error => {
934
+ console.error('Error creating properties:', error);
935
+ this.propertyContent = [];
936
+ });
935
937
  }
936
- // Always call super.scheduleUpdate to ensure component updates
937
- super.scheduleUpdate();
938
938
  }
939
939
 
940
940
  public selectViewport(viewport: TEnvironment) {
@@ -308,6 +308,27 @@ export class WccSidebar extends DeesElement {
308
308
  this.expandedElements = newSet;
309
309
  }
310
310
 
311
+ protected updated(changedProperties: Map<string, unknown>) {
312
+ super.updated(changedProperties);
313
+
314
+ // Auto-expand folder when a multi-demo element is selected
315
+ if (changedProperties.has('selectedItem') && this.selectedItem) {
316
+ const elementName = Object.keys(this.dashboardRef.elements).find(
317
+ name => this.dashboardRef.elements[name] === this.selectedItem
318
+ );
319
+ if (elementName) {
320
+ const item = this.dashboardRef.elements[elementName] as any;
321
+ if (item.demo && hasMultipleDemos(item.demo)) {
322
+ if (!this.expandedElements.has(elementName)) {
323
+ const newSet = new Set(this.expandedElements);
324
+ newSet.add(elementName);
325
+ this.expandedElements = newSet;
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+
311
332
  public selectItem(typeArg: TElementType, itemNameArg: string, itemArg: TTemplateFactory | DeesElement, demoIndex: number = 0) {
312
333
  console.log('selected item');
313
334
  console.log(itemNameArg);