@design.estate/dees-wcctools 3.7.0 → 3.8.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.
@@ -42106,7 +42106,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42106
42106
  }
42107
42107
 
42108
42108
  .sidebar-header.scrolled {
42109
- box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
42109
+ box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 1);
42110
42110
  border-bottom-color: var(--border);
42111
42111
  }
42112
42112
 
@@ -42428,6 +42428,11 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42428
42428
  margin-right: 0.25rem;
42429
42429
  }
42430
42430
 
42431
+ .item-group.group-highlight {
42432
+ background: rgba(59, 130, 246, 0.15);
42433
+ transition: background 0.3s ease;
42434
+ }
42435
+
42431
42436
  /* Resize handle */
42432
42437
  .resize-handle {
42433
42438
  position: absolute;
@@ -42509,13 +42514,35 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42509
42514
  }
42510
42515
  showContextMenu(e10, sectionName, itemName) {
42511
42516
  const isPinned = this.isPinned(sectionName, itemName);
42512
- WccContextmenu.show(e10, [
42517
+ const section = this.dashboardRef?.sections?.find((s8) => s8.name === sectionName);
42518
+ const sectionEntries = section ? getSectionItems(section) : [];
42519
+ const foundEntry = sectionEntries.find(([name]) => name === itemName);
42520
+ const item = foundEntry?.[1];
42521
+ const groups = item ? this.getElementGroups(item) : [];
42522
+ const menuItems = [
42513
42523
  {
42514
42524
  name: isPinned ? "Unpin" : "Pin",
42515
42525
  iconName: isPinned ? "push_pin" : "push_pin",
42516
42526
  action: () => this.togglePin(sectionName, itemName)
42517
42527
  }
42518
- ]);
42528
+ ];
42529
+ if (groups.length > 0) {
42530
+ menuItems.push({
42531
+ name: "Show in Group:",
42532
+ iconName: "folder",
42533
+ action: () => {
42534
+ },
42535
+ disabled: true
42536
+ });
42537
+ for (const groupName of groups) {
42538
+ menuItems.push({
42539
+ name: groupName,
42540
+ iconName: "label",
42541
+ action: () => this.scrollToGroup(sectionName, groupName)
42542
+ });
42543
+ }
42544
+ }
42545
+ WccContextmenu.show(e10, menuItems);
42519
42546
  }
42520
42547
  /**
42521
42548
  * Render the PINNED section (only if there are pinned items)
@@ -42553,7 +42580,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42553
42580
  ${pinnedEntries.map(({ sectionName, itemName, item, section }) => {
42554
42581
  const isSelected = this.selectedItem === item;
42555
42582
  const type5 = section.type === "elements" ? "element" : "page";
42556
- const icon = section.type === "elements" ? "featured_video" : "insert_drive_file";
42583
+ const icon = section.type === "elements" ? this.getElementGroups(item).length > 1 ? "library_books" : "featured_video" : "insert_drive_file";
42557
42584
  return b2`
42558
42585
  <div
42559
42586
  class="selectOption ${isSelected ? "selected" : ""}"
@@ -42582,7 +42609,13 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42582
42609
  this.initCollapsedSections();
42583
42610
  return this.dashboardRef.sections.map((section) => {
42584
42611
  const entries = getSectionItems(section);
42585
- const filteredEntries = entries.filter(([name]) => this.matchesSearch(name));
42612
+ const filteredEntries = entries.filter(([name, item]) => {
42613
+ if (this.matchesSearch(name)) return true;
42614
+ const rawGroups = item.demoGroups;
42615
+ if (!rawGroups) return false;
42616
+ const groups = Array.isArray(rawGroups) ? rawGroups : [rawGroups];
42617
+ return groups.some((g3) => this.matchesSearch(g3));
42618
+ });
42586
42619
  if (filteredEntries.length === 0 && this.searchQuery) {
42587
42620
  return null;
42588
42621
  }
@@ -42608,7 +42641,13 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42608
42641
  */
42609
42642
  renderSectionItems(section) {
42610
42643
  const entries = getSectionItems(section);
42611
- const filteredEntries = entries.filter(([name]) => this.matchesSearch(name));
42644
+ const filteredEntries = entries.filter(([name, item]) => {
42645
+ if (this.matchesSearch(name)) return true;
42646
+ const rawGroups = item.demoGroups;
42647
+ if (!rawGroups) return false;
42648
+ const groups = Array.isArray(rawGroups) ? rawGroups : [rawGroups];
42649
+ return groups.some((g3) => this.matchesSearch(g3));
42650
+ });
42612
42651
  if (section.type === "pages") {
42613
42652
  return filteredEntries.map(([pageName, item]) => {
42614
42653
  const isPinned = this.isPinned(section.name, pageName);
@@ -42630,11 +42669,14 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42630
42669
  const groupedItems = /* @__PURE__ */ new Map();
42631
42670
  for (const entry of filteredEntries) {
42632
42671
  const [, item] = entry;
42633
- const group = item.demoGroup || null;
42634
- if (!groupedItems.has(group)) {
42635
- groupedItems.set(group, []);
42672
+ const rawGroups = item.demoGroups;
42673
+ const groups = rawGroups ? Array.isArray(rawGroups) ? rawGroups : [rawGroups] : [null];
42674
+ for (const group of groups) {
42675
+ if (!groupedItems.has(group)) {
42676
+ groupedItems.set(group, []);
42677
+ }
42678
+ groupedItems.get(group).push(entry);
42636
42679
  }
42637
- groupedItems.get(group).push(entry);
42638
42680
  }
42639
42681
  const renderItems = [];
42640
42682
  const ungrouped = groupedItems.get(null) || [];
@@ -42643,8 +42685,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42643
42685
  }
42644
42686
  for (const [groupName, items] of groupedItems) {
42645
42687
  if (groupName === null) continue;
42646
- const firstElementName = items[0]?.[0] || "";
42647
- renderItems.push({ type: "group", groupName, items, sortKey: firstElementName.toLowerCase() });
42688
+ renderItems.push({ type: "group", groupName, items, sortKey: groupName.toLowerCase() });
42648
42689
  }
42649
42690
  renderItems.sort((a4, b4) => a4.sortKey.localeCompare(b4.sortKey));
42650
42691
  return renderItems.map((item) => {
@@ -42652,7 +42693,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42652
42693
  return this.renderElementItem(item.entry, section);
42653
42694
  } else {
42654
42695
  return b2`
42655
- <div class="item-group">
42696
+ <div class="item-group" data-group="${item.groupName}">
42656
42697
  <span class="item-group-legend">${item.groupName}</span>
42657
42698
  ${item.items.map((entry) => this.renderElementItem(entry, section))}
42658
42699
  </div>
@@ -42704,6 +42745,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42704
42745
  ` : null}
42705
42746
  `;
42706
42747
  } else {
42748
+ const icon = this.getElementGroups(item).length > 1 ? "library_books" : "featured_video";
42707
42749
  return b2`
42708
42750
  <div
42709
42751
  class="selectOption ${isSelected ? "selected" : ""} ${isPinned ? "pinned" : ""}"
@@ -42713,7 +42755,7 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42713
42755
  }}
42714
42756
  @contextmenu=${(e10) => this.showContextMenu(e10, section.name, elementName)}
42715
42757
  >
42716
- <i class="material-symbols-outlined">featured_video</i>
42758
+ <i class="material-symbols-outlined">${icon}</i>
42717
42759
  <div class="text">${this.highlightMatch(elementName)}</div>
42718
42760
  </div>
42719
42761
  `;
@@ -42754,6 +42796,26 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42754
42796
  if (!this.searchQuery) return true;
42755
42797
  return name.toLowerCase().includes(this.searchQuery.toLowerCase());
42756
42798
  }
42799
+ getElementGroups(item) {
42800
+ const raw2 = item?.demoGroups;
42801
+ if (!raw2) return [];
42802
+ return Array.isArray(raw2) ? raw2 : [raw2];
42803
+ }
42804
+ scrollToGroup(sectionName, groupName) {
42805
+ this.collapsedSections.delete(sectionName);
42806
+ this.searchQuery = "";
42807
+ this.requestUpdate();
42808
+ this.updateComplete.then(() => {
42809
+ const groupEl = this.shadowRoot?.querySelector(
42810
+ `.item-group[data-group="${groupName}"]`
42811
+ );
42812
+ if (groupEl) {
42813
+ groupEl.scrollIntoView({ behavior: "smooth", block: "center" });
42814
+ groupEl.classList.add("group-highlight");
42815
+ setTimeout(() => groupEl.classList.remove("group-highlight"), 1500);
42816
+ }
42817
+ });
42818
+ }
42757
42819
  highlightMatch(text8) {
42758
42820
  if (!this.searchQuery) return b2`${text8}`;
42759
42821
  const lowerText = text8.toLowerCase();