@design.estate/dees-wcctools 3.3.0 → 3.4.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.
@@ -41663,9 +41663,9 @@ __publicField(WccFrame, "styles", [
41663
41663
  __runInitializers(_init, 1, WccFrame);
41664
41664
 
41665
41665
  // ts_web/elements/wcc-sidebar.ts
41666
- var _collapsedSections_dec, _expandedElements_dec, _isNative_dec2, _dashboardRef_dec, _selectedType_dec, _selectedItem_dec, _a2, _WccSidebar_decorators, _init2, _selectedItem, _selectedType, _dashboardRef, _isNative2, _expandedElements, _collapsedSections;
41666
+ var _searchQuery_dec, _collapsedSections_dec, _expandedElements_dec, _isNative_dec2, _dashboardRef_dec, _selectedType_dec, _selectedItem_dec, _a2, _WccSidebar_decorators, _init2, _selectedItem, _selectedType, _dashboardRef, _isNative2, _expandedElements, _collapsedSections, _searchQuery;
41667
41667
  _WccSidebar_decorators = [t4("wcc-sidebar")];
41668
- var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ attribute: false })], _selectedType_dec = [n5({ attribute: false })], _dashboardRef_dec = [n5()], _isNative_dec2 = [n5()], _expandedElements_dec = [r5()], _collapsedSections_dec = [r5()], _a2) {
41668
+ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ attribute: false })], _selectedType_dec = [n5({ attribute: false })], _dashboardRef_dec = [n5()], _isNative_dec2 = [n5()], _expandedElements_dec = [r5()], _collapsedSections_dec = [r5()], _searchQuery_dec = [n5()], _a2) {
41669
41669
  constructor() {
41670
41670
  super(...arguments);
41671
41671
  __privateAdd(this, _selectedItem, __runInitializers(_init2, 8, this)), __runInitializers(_init2, 11, this);
@@ -41674,6 +41674,7 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41674
41674
  __privateAdd(this, _isNative2, __runInitializers(_init2, 20, this, false)), __runInitializers(_init2, 23, this);
41675
41675
  __privateAdd(this, _expandedElements, __runInitializers(_init2, 24, this, /* @__PURE__ */ new Set())), __runInitializers(_init2, 27, this);
41676
41676
  __privateAdd(this, _collapsedSections, __runInitializers(_init2, 28, this, /* @__PURE__ */ new Set())), __runInitializers(_init2, 31, this);
41677
+ __privateAdd(this, _searchQuery, __runInitializers(_init2, 32, this, "")), __runInitializers(_init2, 35, this);
41677
41678
  __publicField(this, "sectionsInitialized", false);
41678
41679
  }
41679
41680
  render() {
@@ -41899,7 +41900,48 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41899
41900
  ::-webkit-scrollbar-thumb:hover {
41900
41901
  background: rgba(255, 255, 255, 0.2);
41901
41902
  }
41903
+
41904
+ .search-container {
41905
+ padding: 0.5rem;
41906
+ border-bottom: 1px solid var(--border);
41907
+ }
41908
+
41909
+ .search-input {
41910
+ width: 100%;
41911
+ box-sizing: border-box;
41912
+ background: var(--input);
41913
+ border: 1px solid var(--border);
41914
+ border-radius: var(--radius);
41915
+ padding: 0.5rem 0.75rem;
41916
+ color: var(--foreground);
41917
+ font-size: 0.75rem;
41918
+ font-family: inherit;
41919
+ outline: none;
41920
+ transition: border-color 0.15s ease;
41921
+ }
41922
+
41923
+ .search-input:focus {
41924
+ border-color: var(--primary);
41925
+ }
41926
+
41927
+ .search-input::placeholder {
41928
+ color: var(--muted-foreground);
41929
+ }
41930
+
41931
+ .highlight {
41932
+ background: rgba(59, 130, 246, 0.3);
41933
+ border-radius: 2px;
41934
+ }
41902
41935
  </style>
41936
+ <div class="search-container">
41937
+ <input
41938
+ type="text"
41939
+ class="search-input"
41940
+ placeholder="Search..."
41941
+ .value=${this.searchQuery}
41942
+ @input=${this.handleSearchInput}
41943
+ />
41944
+ </div>
41903
41945
  <div class="menu">
41904
41946
  ${this.renderSections()}
41905
41947
  </div>
@@ -41925,6 +41967,11 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41925
41967
  renderSections() {
41926
41968
  this.initCollapsedSections();
41927
41969
  return this.dashboardRef.sections.map((section, index2) => {
41970
+ const entries = getSectionItems(section);
41971
+ const filteredEntries = entries.filter(([name]) => this.matchesSearch(name));
41972
+ if (filteredEntries.length === 0 && this.searchQuery) {
41973
+ return null;
41974
+ }
41928
41975
  const isCollapsed = this.collapsedSections.has(section.name);
41929
41976
  const sectionIcon = section.icon || (section.type === "pages" ? "insert_drive_file" : "widgets");
41930
41977
  return x`
@@ -41947,8 +41994,9 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41947
41994
  */
41948
41995
  renderSectionItems(section) {
41949
41996
  const entries = getSectionItems(section);
41997
+ const filteredEntries = entries.filter(([name]) => this.matchesSearch(name));
41950
41998
  if (section.type === "pages") {
41951
- return entries.map(([pageName, item]) => {
41999
+ return filteredEntries.map(([pageName, item]) => {
41952
42000
  return x`
41953
42001
  <div
41954
42002
  class="selectOption ${this.selectedItem === item ? "selected" : ""}"
@@ -41958,12 +42006,12 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41958
42006
  }}
41959
42007
  >
41960
42008
  <i class="material-symbols-outlined">insert_drive_file</i>
41961
- <div class="text">${pageName}</div>
42009
+ <div class="text">${this.highlightMatch(pageName)}</div>
41962
42010
  </div>
41963
42011
  `;
41964
42012
  });
41965
42013
  } else {
41966
- return entries.map(([elementName, item]) => {
42014
+ return filteredEntries.map(([elementName, item]) => {
41967
42015
  const anonItem = item;
41968
42016
  const demoCount = anonItem.demo ? getDemoCount(anonItem.demo) : 0;
41969
42017
  const isMultiDemo = anonItem.demo && hasMultipleDemos(anonItem.demo);
@@ -41977,7 +42025,7 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
41977
42025
  >
41978
42026
  <i class="material-symbols-outlined expand-icon">chevron_right</i>
41979
42027
  <i class="material-symbols-outlined">folder</i>
41980
- <div class="text">${elementName}</div>
42028
+ <div class="text">${this.highlightMatch(elementName)}</div>
41981
42029
  </div>
41982
42030
  ${isExpanded ? x`
41983
42031
  <div class="demo-children">
@@ -42010,7 +42058,7 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
42010
42058
  }}
42011
42059
  >
42012
42060
  <i class="material-symbols-outlined">featured_video</i>
42013
- <div class="text">${elementName}</div>
42061
+ <div class="text">${this.highlightMatch(elementName)}</div>
42014
42062
  </div>
42015
42063
  `;
42016
42064
  }
@@ -42035,6 +42083,26 @@ var WccSidebar = class extends (_a2 = DeesElement, _selectedItem_dec = [n5({ att
42035
42083
  }
42036
42084
  this.expandedElements = newSet;
42037
42085
  }
42086
+ handleSearchInput(e10) {
42087
+ const input = e10.target;
42088
+ this.searchQuery = input.value;
42089
+ this.dispatchEvent(new CustomEvent("searchChanged", { detail: this.searchQuery }));
42090
+ }
42091
+ matchesSearch(name) {
42092
+ if (!this.searchQuery) return true;
42093
+ return name.toLowerCase().includes(this.searchQuery.toLowerCase());
42094
+ }
42095
+ highlightMatch(text8) {
42096
+ if (!this.searchQuery) return x`${text8}`;
42097
+ const lowerText = text8.toLowerCase();
42098
+ const lowerQuery = this.searchQuery.toLowerCase();
42099
+ const index2 = lowerText.indexOf(lowerQuery);
42100
+ if (index2 === -1) return x`${text8}`;
42101
+ const before = text8.slice(0, index2);
42102
+ const match2 = text8.slice(index2, index2 + this.searchQuery.length);
42103
+ const after = text8.slice(index2 + this.searchQuery.length);
42104
+ return x`${before}<span class="highlight">${match2}</span>${after}`;
42105
+ }
42038
42106
  updated(changedProperties) {
42039
42107
  super.updated(changedProperties);
42040
42108
  if (changedProperties.has("selectedItem") && this.selectedItem) {
@@ -42095,12 +42163,14 @@ _dashboardRef = new WeakMap();
42095
42163
  _isNative2 = new WeakMap();
42096
42164
  _expandedElements = new WeakMap();
42097
42165
  _collapsedSections = new WeakMap();
42166
+ _searchQuery = new WeakMap();
42098
42167
  __decorateElement(_init2, 4, "selectedItem", _selectedItem_dec, WccSidebar, _selectedItem);
42099
42168
  __decorateElement(_init2, 4, "selectedType", _selectedType_dec, WccSidebar, _selectedType);
42100
42169
  __decorateElement(_init2, 4, "dashboardRef", _dashboardRef_dec, WccSidebar, _dashboardRef);
42101
42170
  __decorateElement(_init2, 4, "isNative", _isNative_dec2, WccSidebar, _isNative2);
42102
42171
  __decorateElement(_init2, 4, "expandedElements", _expandedElements_dec, WccSidebar, _expandedElements);
42103
42172
  __decorateElement(_init2, 4, "collapsedSections", _collapsedSections_dec, WccSidebar, _collapsedSections);
42173
+ __decorateElement(_init2, 4, "searchQuery", _searchQuery_dec, WccSidebar, _searchQuery);
42104
42174
  WccSidebar = __decorateElement(_init2, 0, "WccSidebar", _WccSidebar_decorators, WccSidebar);
42105
42175
  __runInitializers(_init2, 1, WccSidebar);
42106
42176
 
@@ -44412,7 +44482,7 @@ WccProperties = __decorateElement(_init5, 0, "WccProperties", _WccProperties_dec
44412
44482
  __runInitializers(_init5, 1, WccProperties);
44413
44483
 
44414
44484
  // ts_web/elements/wcc-dashboard.ts
44415
- var _wccFrame_dec, _warning_dec2, _selectedTheme_dec2, _selectedViewport_dec2, _selectedDemoIndex_dec, _selectedItem_dec3, _selectedItemName_dec, _selectedType_dec2, _selectedSection_dec, _sections_dec, _a6, _WccDashboard_decorators, _init6, _sections, _selectedSection, _selectedType2, _selectedItemName, _selectedItem3, _selectedDemoIndex, _selectedViewport2, _selectedTheme2, _warning2, _wccFrame;
44485
+ var _wccFrame_dec, _warning_dec2, _searchQuery_dec2, _selectedTheme_dec2, _selectedViewport_dec2, _selectedDemoIndex_dec, _selectedItem_dec3, _selectedItemName_dec, _selectedType_dec2, _selectedSection_dec, _sections_dec, _a6, _WccDashboard_decorators, _init6, _sections, _selectedSection, _selectedType2, _selectedItemName, _selectedItem3, _selectedDemoIndex, _selectedViewport2, _selectedTheme2, _searchQuery2, _warning2, _wccFrame;
44416
44486
  var getSectionItems = (section) => {
44417
44487
  let entries = Object.entries(section.items);
44418
44488
  if (section.filter) {
@@ -44424,7 +44494,7 @@ var getSectionItems = (section) => {
44424
44494
  return entries;
44425
44495
  };
44426
44496
  _WccDashboard_decorators = [t4("wcc-dashboard")];
44427
- var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _selectedSection_dec = [n5()], _selectedType_dec2 = [n5()], _selectedItemName_dec = [n5()], _selectedItem_dec3 = [n5()], _selectedDemoIndex_dec = [n5({ type: Number })], _selectedViewport_dec2 = [n5()], _selectedTheme_dec2 = [n5()], _warning_dec2 = [n5()], _wccFrame_dec = [r7("wcc-frame")], _a6) {
44497
+ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _selectedSection_dec = [n5()], _selectedType_dec2 = [n5()], _selectedItemName_dec = [n5()], _selectedItem_dec3 = [n5()], _selectedDemoIndex_dec = [n5({ type: Number })], _selectedViewport_dec2 = [n5()], _selectedTheme_dec2 = [n5()], _searchQuery_dec2 = [n5()], _warning_dec2 = [n5()], _wccFrame_dec = [r7("wcc-frame")], _a6) {
44428
44498
  constructor(config2) {
44429
44499
  super();
44430
44500
  __privateAdd(this, _sections, __runInitializers(_init6, 8, this, [])), __runInitializers(_init6, 11, this);
@@ -44435,11 +44505,12 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44435
44505
  __privateAdd(this, _selectedDemoIndex, __runInitializers(_init6, 28, this, 0)), __runInitializers(_init6, 31, this);
44436
44506
  __privateAdd(this, _selectedViewport2, __runInitializers(_init6, 32, this, "desktop")), __runInitializers(_init6, 35, this);
44437
44507
  __privateAdd(this, _selectedTheme2, __runInitializers(_init6, 36, this, "dark")), __runInitializers(_init6, 39, this);
44438
- __privateAdd(this, _warning2, __runInitializers(_init6, 40, this, null)), __runInitializers(_init6, 43, this);
44508
+ __privateAdd(this, _searchQuery2, __runInitializers(_init6, 40, this, "")), __runInitializers(_init6, 43, this);
44509
+ __privateAdd(this, _warning2, __runInitializers(_init6, 44, this, null)), __runInitializers(_init6, 47, this);
44439
44510
  __publicField(this, "frameScrollY", 0);
44440
44511
  __publicField(this, "sidebarScrollY", 0);
44441
44512
  __publicField(this, "scrollPositionsApplied", false);
44442
- __privateAdd(this, _wccFrame, __runInitializers(_init6, 44, this)), __runInitializers(_init6, 47, this);
44513
+ __privateAdd(this, _wccFrame, __runInitializers(_init6, 48, this)), __runInitializers(_init6, 51, this);
44443
44514
  __publicField(this, "scrollUpdateTimeout");
44444
44515
  __publicField(this, "scrollListenersAttached", false);
44445
44516
  if (config2 && config2.sections) {
@@ -44485,6 +44556,7 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44485
44556
  <wcc-sidebar
44486
44557
  .dashboardRef=${this}
44487
44558
  .selectedItem=${this.selectedItem}
44559
+ .searchQuery=${this.searchQuery}
44488
44560
  .isNative=${this.isNative}
44489
44561
  @selectedType=${(eventArg) => {
44490
44562
  this.selectedType = eventArg.detail;
@@ -44494,6 +44566,10 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44494
44566
  }}
44495
44567
  @selectedItem=${(eventArg) => {
44496
44568
  this.selectedItem = eventArg.detail;
44569
+ }}
44570
+ @searchChanged=${(eventArg) => {
44571
+ this.searchQuery = eventArg.detail;
44572
+ this.updateUrlWithScrollState();
44497
44573
  }}
44498
44574
  ></wcc-sidebar>
44499
44575
  <wcc-properties
@@ -44577,8 +44653,14 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44577
44653
  }
44578
44654
  }
44579
44655
  if (routeInfo.queryParams) {
44656
+ const search2 = routeInfo.queryParams.search;
44580
44657
  const frameScrollY = routeInfo.queryParams.frameScrollY;
44581
44658
  const sidebarScrollY = routeInfo.queryParams.sidebarScrollY;
44659
+ if (search2) {
44660
+ this.searchQuery = search2;
44661
+ } else {
44662
+ this.searchQuery = "";
44663
+ }
44582
44664
  if (frameScrollY) {
44583
44665
  this.frameScrollY = parseInt(frameScrollY);
44584
44666
  }
@@ -44588,6 +44670,8 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44588
44670
  setTimeout(() => {
44589
44671
  this.applyScrollPositions();
44590
44672
  }, 100);
44673
+ } else {
44674
+ this.searchQuery = "";
44591
44675
  }
44592
44676
  const domtoolsInstance = await dist_ts_exports25.elementBasic.setup();
44593
44677
  this.selectedTheme === "bright" ? domtoolsInstance.themeManager.goBright() : domtoolsInstance.themeManager.goDark();
@@ -44621,8 +44705,14 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44621
44705
  }
44622
44706
  }
44623
44707
  if (routeInfo.queryParams) {
44708
+ const search2 = routeInfo.queryParams.search;
44624
44709
  const frameScrollY = routeInfo.queryParams.frameScrollY;
44625
44710
  const sidebarScrollY = routeInfo.queryParams.sidebarScrollY;
44711
+ if (search2) {
44712
+ this.searchQuery = search2;
44713
+ } else {
44714
+ this.searchQuery = "";
44715
+ }
44626
44716
  if (frameScrollY) {
44627
44717
  this.frameScrollY = parseInt(frameScrollY);
44628
44718
  }
@@ -44632,6 +44722,8 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44632
44722
  setTimeout(() => {
44633
44723
  this.applyScrollPositions();
44634
44724
  }, 100);
44725
+ } else {
44726
+ this.searchQuery = "";
44635
44727
  }
44636
44728
  const domtoolsInstance = await dist_ts_exports25.elementBasic.setup();
44637
44729
  this.selectedTheme === "bright" ? domtoolsInstance.themeManager.goBright() : domtoolsInstance.themeManager.goDark();
@@ -44690,6 +44782,9 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44690
44782
  const sectionName = this.selectedSection ? encodeURIComponent(this.selectedSection.name) : this.selectedType;
44691
44783
  const baseUrl = `/wcctools-route/${sectionName}/${this.selectedItemName}/${this.selectedDemoIndex}/${this.selectedViewport}/${this.selectedTheme}`;
44692
44784
  const queryParams = new URLSearchParams();
44785
+ if (this.searchQuery) {
44786
+ queryParams.set("search", this.searchQuery);
44787
+ }
44693
44788
  if (this.frameScrollY > 0) {
44694
44789
  queryParams.set("frameScrollY", this.frameScrollY.toString());
44695
44790
  }
@@ -44730,6 +44825,9 @@ var WccDashboard2 = class extends (_a6 = DeesElement, _sections_dec = [n5()], _s
44730
44825
  const sectionName = this.selectedSection ? encodeURIComponent(this.selectedSection.name) : this.selectedType;
44731
44826
  const baseUrl = `/wcctools-route/${sectionName}/${this.selectedItemName}/${this.selectedDemoIndex}/${this.selectedViewport}/${this.selectedTheme}`;
44732
44827
  const queryParams = new URLSearchParams();
44828
+ if (this.searchQuery) {
44829
+ queryParams.set("search", this.searchQuery);
44830
+ }
44733
44831
  if (this.frameScrollY > 0) {
44734
44832
  queryParams.set("frameScrollY", this.frameScrollY.toString());
44735
44833
  }
@@ -44764,6 +44862,7 @@ _selectedItem3 = new WeakMap();
44764
44862
  _selectedDemoIndex = new WeakMap();
44765
44863
  _selectedViewport2 = new WeakMap();
44766
44864
  _selectedTheme2 = new WeakMap();
44865
+ _searchQuery2 = new WeakMap();
44767
44866
  _warning2 = new WeakMap();
44768
44867
  _wccFrame = new WeakMap();
44769
44868
  __decorateElement(_init6, 4, "sections", _sections_dec, WccDashboard2, _sections);
@@ -44774,6 +44873,7 @@ __decorateElement(_init6, 4, "selectedItem", _selectedItem_dec3, WccDashboard2,
44774
44873
  __decorateElement(_init6, 4, "selectedDemoIndex", _selectedDemoIndex_dec, WccDashboard2, _selectedDemoIndex);
44775
44874
  __decorateElement(_init6, 4, "selectedViewport", _selectedViewport_dec2, WccDashboard2, _selectedViewport2);
44776
44875
  __decorateElement(_init6, 4, "selectedTheme", _selectedTheme_dec2, WccDashboard2, _selectedTheme2);
44876
+ __decorateElement(_init6, 4, "searchQuery", _searchQuery_dec2, WccDashboard2, _searchQuery2);
44777
44877
  __decorateElement(_init6, 4, "warning", _warning_dec2, WccDashboard2, _warning2);
44778
44878
  __decorateElement(_init6, 4, "wccFrame", _wccFrame_dec, WccDashboard2, _wccFrame);
44779
44879
  WccDashboard2 = __decorateElement(_init6, 0, "WccDashboard", _WccDashboard_decorators, WccDashboard2);