@design.estate/dees-catalog 3.101.0 → 3.102.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.
@@ -176423,16 +176423,38 @@ var demoFunc63 = /* @__PURE__ */ __name(() => b2`
176423
176423
  init_dist_ts25();
176424
176424
  init_theme();
176425
176425
  init_dees_icon();
176426
- var _search_dec, _emptyText_dec2, _loading_dec4, _selectedSessionId_dec, _sessions_dec, _a88, _DeesHarnessSessionList_decorators, _init89, _sessions, _selectedSessionId, _loading4, _emptyText2, _search;
176426
+ var _collapsedGroupIds_dec, _dropSlot_dec, _draggingSessionId_dec, _search_dec, _enableGrouping_dec, _groups_dec2, _emptyText_dec2, _loading_dec4, _selectedSessionId_dec, _sessions_dec, _a88, _DeesHarnessSessionList_decorators, _init89, _sessions, _selectedSessionId, _loading4, _emptyText2, _groups2, _enableGrouping, _search, _draggingSessionId, _dropSlot, _collapsedGroupIds;
176427
176427
  _DeesHarnessSessionList_decorators = [customElement("dees-harness-session-list")];
176428
- var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = DeesElement, _sessions_dec = [n5({ attribute: false })], _selectedSessionId_dec = [n5()], _loading_dec4 = [n5({ type: Boolean })], _emptyText_dec2 = [n5()], _search_dec = [r5()], _a88) {
176428
+ var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = DeesElement, _sessions_dec = [n5({ attribute: false })], _selectedSessionId_dec = [n5()], _loading_dec4 = [n5({ type: Boolean })], _emptyText_dec2 = [n5()], _groups_dec2 = [n5({ attribute: false })], _enableGrouping_dec = [n5({ type: Boolean })], _search_dec = [r5()], _draggingSessionId_dec = [r5()], _dropSlot_dec = [r5()], _collapsedGroupIds_dec = [r5()], _a88) {
176429
176429
  constructor() {
176430
176430
  super(...arguments);
176431
176431
  __privateAdd(this, _sessions, __runInitializers(_init89, 8, this, [])), __runInitializers(_init89, 11, this);
176432
176432
  __privateAdd(this, _selectedSessionId, __runInitializers(_init89, 12, this, "")), __runInitializers(_init89, 15, this);
176433
176433
  __privateAdd(this, _loading4, __runInitializers(_init89, 16, this, false)), __runInitializers(_init89, 19, this);
176434
176434
  __privateAdd(this, _emptyText2, __runInitializers(_init89, 20, this, "No conversations yet.")), __runInitializers(_init89, 23, this);
176435
- __privateAdd(this, _search, __runInitializers(_init89, 24, this, "")), __runInitializers(_init89, 27, this);
176435
+ __privateAdd(this, _groups2, __runInitializers(_init89, 24, this, [])), __runInitializers(_init89, 27, this);
176436
+ __privateAdd(this, _enableGrouping, __runInitializers(_init89, 28, this, false)), __runInitializers(_init89, 31, this);
176437
+ __privateAdd(this, _search, __runInitializers(_init89, 32, this, "")), __runInitializers(_init89, 35, this);
176438
+ __privateAdd(this, _draggingSessionId, __runInitializers(_init89, 36, this, "")), __runInitializers(_init89, 39, this);
176439
+ __privateAdd(this, _dropSlot, __runInitializers(_init89, 40, this)), __runInitializers(_init89, 43, this);
176440
+ __privateAdd(this, _collapsedGroupIds, __runInitializers(_init89, 44, this, /* @__PURE__ */ new Set())), __runInitializers(_init89, 47, this);
176441
+ }
176442
+ get sessionsById() {
176443
+ return new Map(this.sessions.map((session) => [session.id, session]));
176444
+ }
176445
+ get groupedSessionIds() {
176446
+ const ids = /* @__PURE__ */ new Set();
176447
+ for (const group of this.groups) {
176448
+ for (const id of group.sessionIds) ids.add(id);
176449
+ }
176450
+ return ids;
176451
+ }
176452
+ /** Ungrouped sessions, most recent first. */
176453
+ get ungroupedSessions() {
176454
+ const grouped = this.groupedSessionIds;
176455
+ return [...this.sessions].filter((session) => !grouped.has(session.id)).sort(
176456
+ (left, right) => (right.updatedAt ?? right.createdAt ?? 0) - (left.updatedAt ?? left.createdAt ?? 0)
176457
+ );
176436
176458
  }
176437
176459
  get filteredSessions() {
176438
176460
  const query3 = this.search.trim().toLowerCase();
@@ -176448,7 +176470,7 @@ var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = Dees
176448
176470
  this.shadowRoot?.querySelector(".searchRow input")?.focus();
176449
176471
  }
176450
176472
  render() {
176451
- const sessions = this.filteredSessions;
176473
+ const groupingActive = this.enableGrouping && !this.search.trim();
176452
176474
  return b2`
176453
176475
  <div class="searchRow">
176454
176476
  <input
@@ -176460,15 +176482,110 @@ var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = Dees
176460
176482
  />
176461
176483
  </div>
176462
176484
  <div class="list">
176463
- ${this.loading ? b2`<div class="emptyNote">Loading conversations…</div>` : sessions.length ? sessions.map((session) => this.renderItem(session)) : b2`<div class="emptyNote">${this.sessions.length ? "No conversations match this search." : this.emptyText}</div>`}
176485
+ ${this.loading ? b2`<div class="emptyNote">Loading conversations…</div>` : groupingActive ? this.renderGroupedList() : this.renderFlatList()}
176464
176486
  </div>
176487
+ ${groupingActive ? b2`
176488
+ <div class="newGroupRow">
176489
+ <button
176490
+ class="newGroupButton"
176491
+ type="button"
176492
+ @click=${() => {
176493
+ this.dispatchEvent(
176494
+ new CustomEvent("harness-group-create-request", {
176495
+ bubbles: true,
176496
+ composed: true
176497
+ })
176498
+ );
176499
+ }}
176500
+ >
176501
+ <dees-icon icon="lucide:FolderPlus" iconSize="13"></dees-icon>
176502
+ New group
176503
+ </button>
176504
+ </div>
176505
+ ` : ""}
176506
+ `;
176507
+ }
176508
+ renderFlatList() {
176509
+ const sessions = this.filteredSessions;
176510
+ if (!sessions.length) {
176511
+ return b2`<div class="emptyNote">
176512
+ ${this.sessions.length ? "No conversations match this search." : this.emptyText}
176513
+ </div>`;
176514
+ }
176515
+ return b2`${sessions.map((session) => this.renderItem(session, null, -1))}`;
176516
+ }
176517
+ renderGroupedList() {
176518
+ const byId = this.sessionsById;
176519
+ const ungrouped = this.ungroupedSessions;
176520
+ if (!this.sessions.length && !this.groups.length) {
176521
+ return b2`<div class="emptyNote">${this.emptyText}</div>`;
176522
+ }
176523
+ return b2`
176524
+ ${this.groups.map((group) => {
176525
+ const members = group.sessionIds.map((id) => byId.get(id)).filter((session) => session !== void 0);
176526
+ const collapsed = this.collapsedGroupIds.has(group.id);
176527
+ const isHeaderDrop = this.dropSlot?.groupId === group.id && this.dropSlot.index === members.length && collapsed;
176528
+ return b2`
176529
+ <button
176530
+ class="groupHeader ${collapsed ? "collapsed" : ""} ${isHeaderDrop ? "dropTarget" : ""}"
176531
+ type="button"
176532
+ @click=${() => this.toggleGroupCollapsed(group.id)}
176533
+ @contextmenu=${(event) => {
176534
+ event.preventDefault();
176535
+ const detail = {
176536
+ group,
176537
+ clientX: event.clientX,
176538
+ clientY: event.clientY,
176539
+ originalEvent: event
176540
+ };
176541
+ this.dispatchEvent(
176542
+ new CustomEvent("harness-group-context", { detail, bubbles: true, composed: true })
176543
+ );
176544
+ }}
176545
+ @dragover=${(event) => this.handleDragOverSlot(event, group.id, members.length)}
176546
+ @drop=${(event) => this.handleDrop(event, group.id, members.length)}
176547
+ >
176548
+ <dees-icon class="chevron" icon="lucide:ChevronDown" iconSize="12"></dees-icon>
176549
+ <span>${group.name}</span>
176550
+ <span class="groupCount">${members.length}</span>
176551
+ </button>
176552
+ ${collapsed ? "" : this.renderSection(members, group.id)}
176553
+ `;
176554
+ })}
176555
+ ${this.groups.length && ungrouped.length ? b2`
176556
+ <button
176557
+ class="groupHeader"
176558
+ type="button"
176559
+ tabindex="-1"
176560
+ @dragover=${(event) => this.handleDragOverSlot(event, null, 0)}
176561
+ @drop=${(event) => this.handleDrop(event, null, 0)}
176562
+ >
176563
+ <span>Ungrouped</span>
176564
+ <span class="groupCount">${ungrouped.length}</span>
176565
+ </button>
176566
+ ` : ""}
176567
+ ${this.renderSection(ungrouped, null)}
176465
176568
  `;
176466
176569
  }
176467
- renderItem(session) {
176570
+ renderSection(sessions, groupId) {
176571
+ const slot = this.dropSlot;
176572
+ return b2`
176573
+ ${sessions.map(
176574
+ (session, index3) => b2`
176575
+ ${slot && slot.groupId === groupId && slot.index === index3 ? b2`<div class="dropLine"></div>` : ""}
176576
+ ${this.renderItem(session, groupId, index3)}
176577
+ `
176578
+ )}
176579
+ ${slot && slot.groupId === groupId && slot.index === sessions.length ? b2`<div class="dropLine"></div>` : ""}
176580
+ `;
176581
+ }
176582
+ renderItem(session, groupId, index3) {
176583
+ const draggable = this.enableGrouping && index3 >= 0;
176468
176584
  return b2`
176469
176585
  <button
176470
- class="item ${session.id === this.selectedSessionId ? "selected" : ""}"
176586
+ class="item ${session.id === this.selectedSessionId ? "selected" : ""} ${this.draggingSessionId === session.id ? "dragging" : ""}"
176471
176587
  type="button"
176588
+ draggable=${draggable ? "true" : "false"}
176472
176589
  @click=${() => this.emit("harness-session-select", session)}
176473
176590
  @dblclick=${() => this.emit("harness-session-open", session)}
176474
176591
  @keydown=${(event) => {
@@ -176485,6 +176602,29 @@ var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = Dees
176485
176602
  this.dispatchEvent(
176486
176603
  new CustomEvent("harness-session-context", { detail, bubbles: true, composed: true })
176487
176604
  );
176605
+ }}
176606
+ @dragstart=${(event) => {
176607
+ if (!draggable) return;
176608
+ this.draggingSessionId = session.id;
176609
+ event.dataTransfer?.setData("text/plain", session.id);
176610
+ if (event.dataTransfer) event.dataTransfer.effectAllowed = "move";
176611
+ }}
176612
+ @dragend=${() => {
176613
+ this.draggingSessionId = "";
176614
+ this.dropSlot = void 0;
176615
+ }}
176616
+ @dragover=${(event) => {
176617
+ if (!this.draggingSessionId || index3 < 0) return;
176618
+ event.preventDefault();
176619
+ const rect = event.currentTarget.getBoundingClientRect();
176620
+ const before = event.clientY < rect.top + rect.height / 2;
176621
+ this.setDropSlot(groupId, before ? index3 : index3 + 1);
176622
+ }}
176623
+ @drop=${(event) => {
176624
+ if (index3 < 0) return;
176625
+ const rect = event.currentTarget.getBoundingClientRect();
176626
+ const before = event.clientY < rect.top + rect.height / 2;
176627
+ this.handleDrop(event, groupId, before ? index3 : index3 + 1);
176488
176628
  }}
176489
176629
  >
176490
176630
  <span class="itemTitle">
@@ -176495,6 +176635,41 @@ var _DeesHarnessSessionList = class _DeesHarnessSessionList extends (_a88 = Dees
176495
176635
  </button>
176496
176636
  `;
176497
176637
  }
176638
+ toggleGroupCollapsed(groupIdArg) {
176639
+ const next2 = new Set(this.collapsedGroupIds);
176640
+ if (next2.has(groupIdArg)) {
176641
+ next2.delete(groupIdArg);
176642
+ } else {
176643
+ next2.add(groupIdArg);
176644
+ }
176645
+ this.collapsedGroupIds = next2;
176646
+ }
176647
+ setDropSlot(groupIdArg, indexArg) {
176648
+ const current = this.dropSlot;
176649
+ if (current && current.groupId === groupIdArg && current.index === indexArg) return;
176650
+ this.dropSlot = { groupId: groupIdArg, index: indexArg };
176651
+ }
176652
+ handleDragOverSlot(event, groupIdArg, indexArg) {
176653
+ if (!this.draggingSessionId) return;
176654
+ event.preventDefault();
176655
+ this.setDropSlot(groupIdArg, indexArg);
176656
+ }
176657
+ handleDrop(event, groupIdArg, indexArg) {
176658
+ event.preventDefault();
176659
+ event.stopPropagation();
176660
+ const sessionId = this.draggingSessionId || event.dataTransfer?.getData("text/plain") || "";
176661
+ this.draggingSessionId = "";
176662
+ this.dropSlot = void 0;
176663
+ if (!sessionId) return;
176664
+ const detail = {
176665
+ sessionId,
176666
+ groupId: groupIdArg,
176667
+ index: Math.max(0, indexArg)
176668
+ };
176669
+ this.dispatchEvent(
176670
+ new CustomEvent("harness-session-move", { detail, bubbles: true, composed: true })
176671
+ );
176672
+ }
176498
176673
  emit(name, session) {
176499
176674
  this.dispatchEvent(new CustomEvent(name, { detail: { session }, bubbles: true, composed: true }));
176500
176675
  }
@@ -176504,12 +176679,22 @@ _sessions = new WeakMap();
176504
176679
  _selectedSessionId = new WeakMap();
176505
176680
  _loading4 = new WeakMap();
176506
176681
  _emptyText2 = new WeakMap();
176682
+ _groups2 = new WeakMap();
176683
+ _enableGrouping = new WeakMap();
176507
176684
  _search = new WeakMap();
176685
+ _draggingSessionId = new WeakMap();
176686
+ _dropSlot = new WeakMap();
176687
+ _collapsedGroupIds = new WeakMap();
176508
176688
  __decorateElement(_init89, 4, "sessions", _sessions_dec, _DeesHarnessSessionList, _sessions);
176509
176689
  __decorateElement(_init89, 4, "selectedSessionId", _selectedSessionId_dec, _DeesHarnessSessionList, _selectedSessionId);
176510
176690
  __decorateElement(_init89, 4, "loading", _loading_dec4, _DeesHarnessSessionList, _loading4);
176511
176691
  __decorateElement(_init89, 4, "emptyText", _emptyText_dec2, _DeesHarnessSessionList, _emptyText2);
176692
+ __decorateElement(_init89, 4, "groups", _groups_dec2, _DeesHarnessSessionList, _groups2);
176693
+ __decorateElement(_init89, 4, "enableGrouping", _enableGrouping_dec, _DeesHarnessSessionList, _enableGrouping);
176512
176694
  __decorateElement(_init89, 4, "search", _search_dec, _DeesHarnessSessionList, _search);
176695
+ __decorateElement(_init89, 4, "draggingSessionId", _draggingSessionId_dec, _DeesHarnessSessionList, _draggingSessionId);
176696
+ __decorateElement(_init89, 4, "dropSlot", _dropSlot_dec, _DeesHarnessSessionList, _dropSlot);
176697
+ __decorateElement(_init89, 4, "collapsedGroupIds", _collapsedGroupIds_dec, _DeesHarnessSessionList, _collapsedGroupIds);
176513
176698
  _DeesHarnessSessionList = __decorateElement(_init89, 0, "DeesHarnessSessionList", _DeesHarnessSessionList_decorators, _DeesHarnessSessionList);
176514
176699
  __name(_DeesHarnessSessionList, "DeesHarnessSessionList");
176515
176700
  __publicField(_DeesHarnessSessionList, "demo", demoFunc63);
@@ -176586,6 +176771,10 @@ __publicField(_DeesHarnessSessionList, "styles", [
176586
176771
  box-shadow: inset 2px 0 0 var(--dees-color-accent-primary);
176587
176772
  }
176588
176773
 
176774
+ .item.dragging {
176775
+ opacity: 0.4;
176776
+ }
176777
+
176589
176778
  .itemTitle {
176590
176779
  display: flex;
176591
176780
  align-items: baseline;
@@ -176623,6 +176812,83 @@ __publicField(_DeesHarnessSessionList, "styles", [
176623
176812
  font-size: var(--dees-font-control-size-sm, 12px);
176624
176813
  text-align: center;
176625
176814
  }
176815
+
176816
+ .groupHeader {
176817
+ display: flex;
176818
+ align-items: center;
176819
+ gap: var(--dees-spacing-xs);
176820
+ width: 100%;
176821
+ margin-top: var(--dees-spacing-xs);
176822
+ padding: 2px var(--dees-spacing-sm);
176823
+ border: 0;
176824
+ border-radius: var(--dees-radius-md);
176825
+ background: transparent;
176826
+ color: var(--dees-color-text-secondary);
176827
+ cursor: pointer;
176828
+ font-family: inherit;
176829
+ font-size: var(--dees-font-caption1-size, 11px);
176830
+ font-weight: 650;
176831
+ text-transform: uppercase;
176832
+ letter-spacing: 0.05em;
176833
+ text-align: left;
176834
+ }
176835
+
176836
+ .groupHeader:hover {
176837
+ background: var(--dees-color-hover);
176838
+ }
176839
+
176840
+ .groupHeader .chevron {
176841
+ transition: transform var(--dees-transition-fast) var(--dees-ease-standard);
176842
+ }
176843
+
176844
+ .groupHeader.collapsed .chevron {
176845
+ transform: rotate(-90deg);
176846
+ }
176847
+
176848
+ .groupHeader .groupCount {
176849
+ margin-left: auto;
176850
+ font-weight: 500;
176851
+ text-transform: none;
176852
+ letter-spacing: normal;
176853
+ color: var(--dees-color-text-muted);
176854
+ }
176855
+
176856
+ .groupHeader.dropTarget {
176857
+ outline: 1px dashed var(--dees-color-accent-primary);
176858
+ outline-offset: -1px;
176859
+ }
176860
+
176861
+ .dropLine {
176862
+ height: 2px;
176863
+ margin: 0 var(--dees-spacing-sm);
176864
+ border-radius: 1px;
176865
+ background: var(--dees-color-accent-primary);
176866
+ }
176867
+
176868
+ .newGroupRow {
176869
+ flex: 0 0 auto;
176870
+ padding: var(--dees-spacing-xs) var(--dees-spacing-sm) var(--dees-spacing-sm);
176871
+ }
176872
+
176873
+ .newGroupButton {
176874
+ display: flex;
176875
+ align-items: center;
176876
+ gap: var(--dees-spacing-xs);
176877
+ width: 100%;
176878
+ padding: var(--dees-spacing-xs) var(--dees-spacing-sm);
176879
+ border: 1px dashed var(--dees-color-border-default);
176880
+ border-radius: var(--dees-radius-md);
176881
+ background: transparent;
176882
+ color: var(--dees-color-text-secondary);
176883
+ cursor: pointer;
176884
+ font-family: inherit;
176885
+ font-size: var(--dees-font-control-size-sm, 12px);
176886
+ }
176887
+
176888
+ .newGroupButton:hover {
176889
+ border-color: var(--dees-color-accent-primary);
176890
+ color: var(--dees-color-text-primary);
176891
+ }
176626
176892
  `
176627
176893
  ]);
176628
176894
  __runInitializers(_init89, 1, _DeesHarnessSessionList);
@@ -198399,7 +198665,7 @@ init_group_runtime();
198399
198665
  // ts_web/00_commitinfo_data.ts
198400
198666
  var commitinfo = {
198401
198667
  name: "@design.estate/dees-catalog",
198402
- version: "3.101.0",
198668
+ version: "3.102.0",
198403
198669
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
198404
198670
  };
198405
198671
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '3.101.0',
6
+ version: '3.102.0',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfd2ViLzAwX2NvbW1pdGluZm9fZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRztJQUN4QixJQUFJLEVBQUUsNkJBQTZCO0lBQ25DLE9BQU8sRUFBRSxTQUFTO0lBQ2xCLFdBQVcsRUFBRSxzSkFBc0o7Q0FDcEssQ0FBQSJ9
@@ -1,16 +1,28 @@
1
1
  import { DeesElement, type TemplateResult } from '@design.estate/dees-element';
2
- import type { IHarnessSessionMeta } from '../interfaces.js';
2
+ import type { IHarnessSessionGroup, IHarnessSessionMeta } from '../interfaces.js';
3
3
  import '../../00group-utility/dees-icon/dees-icon.js';
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
6
6
  'dees-harness-session-list': DeesHarnessSessionList;
7
7
  }
8
8
  }
9
+ interface IDropSlot {
10
+ groupId: string | null;
11
+ index: number;
12
+ }
9
13
  /**
10
14
  * Searchable conversation list, embeddable in a sidebar or a DeesModal.
11
15
  * Emits `harness-session-select` on click, `harness-session-open` on
12
16
  * double-click or Enter, and `harness-session-context` with viewport
13
17
  * pointer coordinates on right-click (the browser menu is suppressed).
18
+ *
19
+ * With `enableGrouping`, sessions render under user-defined `groups` and can
20
+ * be dragged between groups and reordered. The component never mutates its
21
+ * inputs: drops emit `harness-session-move`, the "new group" button emits
22
+ * `harness-group-create-request`, and right-clicking a group header emits
23
+ * `harness-group-context` — the host persists changes and passes fresh
24
+ * `groups` back in. Sessions in no group render in the trailing ungrouped
25
+ * section, recency-sorted. While a search query is active the list is flat.
14
26
  */
15
27
  export declare class DeesHarnessSessionList extends DeesElement {
16
28
  static demo: () => TemplateResult<1>;
@@ -19,11 +31,28 @@ export declare class DeesHarnessSessionList extends DeesElement {
19
31
  accessor selectedSessionId: string;
20
32
  accessor loading: boolean;
21
33
  accessor emptyText: string;
34
+ accessor groups: IHarnessSessionGroup[];
35
+ accessor enableGrouping: boolean;
22
36
  accessor search: string;
37
+ accessor draggingSessionId: string;
38
+ accessor dropSlot: IDropSlot | undefined;
39
+ accessor collapsedGroupIds: ReadonlySet<string>;
23
40
  static styles: import("@design.estate/dees-element").CSSResult[];
41
+ private get sessionsById();
42
+ private get groupedSessionIds();
43
+ /** Ungrouped sessions, most recent first. */
44
+ private get ungroupedSessions();
24
45
  private get filteredSessions();
25
46
  focusSearch(): void;
26
47
  render(): TemplateResult;
48
+ private renderFlatList;
49
+ private renderGroupedList;
50
+ private renderSection;
27
51
  private renderItem;
52
+ private toggleGroupCollapsed;
53
+ private setDropSlot;
54
+ private handleDragOverSlot;
55
+ private handleDrop;
28
56
  private emit;
29
57
  }
58
+ export {};