myio-js-library 0.1.510 → 0.1.511

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/dist/index.cjs CHANGED
@@ -1193,7 +1193,7 @@ module.exports = __toCommonJS(index_exports);
1193
1193
  // package.json
1194
1194
  var package_default = {
1195
1195
  name: "myio-js-library",
1196
- version: "0.1.510",
1196
+ version: "0.1.511",
1197
1197
  description: "A clean, standalone JS SDK for MYIO projects",
1198
1198
  license: "MIT",
1199
1199
  repository: "github:gh-myio/myio-js-library",
@@ -142559,28 +142559,44 @@ var HEADER_ANNOTATIONS_STYLES = `
142559
142559
  align-items: center;
142560
142560
  gap: 4px;
142561
142561
  }
142562
+ /* Header action buttons \u2014 mirror src/utils/InfoTooltip.ts pattern
142563
+ (24\xD724 button with white-ish bg, SVG 14\xD714, slate hover, emerald
142564
+ pinned state). RFC-0203 M7 follow-up: alignment with InfoTooltip. */
142562
142565
  .myio-annotations-panel-action {
142563
- width: 28px;
142564
- height: 28px;
142566
+ width: 24px;
142567
+ height: 24px;
142568
+ border: none;
142569
+ background: rgba(255, 255, 255, 0.7);
142570
+ border-radius: 4px;
142571
+ cursor: pointer;
142565
142572
  display: inline-flex;
142566
142573
  align-items: center;
142567
142574
  justify-content: center;
142568
- border: 1px solid transparent;
142569
- border-radius: 6px;
142570
- background: transparent;
142575
+ transition: background 0.15s ease, color 0.15s ease;
142571
142576
  color: #64748b;
142572
- cursor: pointer;
142573
- font-size: 14px;
142574
- transition: background 0.15s, color 0.15s;
142577
+ padding: 0;
142575
142578
  }
142576
142579
  .myio-annotations-panel-action:hover {
142577
- background: rgba(108, 92, 231, 0.1);
142578
- color: #4c3aac;
142580
+ background: rgba(255, 255, 255, 0.95);
142581
+ color: #1e293b;
142579
142582
  }
142580
142583
  .myio-annotations-panel-action:focus-visible {
142581
142584
  outline: 2px solid #6c5ce7;
142582
142585
  outline-offset: 2px;
142583
142586
  }
142587
+ /* Pinned state \u2014 emerald-700, matches InfoTooltip */
142588
+ .myio-annotations-panel-action.pinned {
142589
+ background: #047857;
142590
+ color: #ffffff;
142591
+ }
142592
+ .myio-annotations-panel-action.pinned:hover {
142593
+ background: #065f46;
142594
+ }
142595
+ .myio-annotations-panel-action svg {
142596
+ width: 14px;
142597
+ height: 14px;
142598
+ display: block;
142599
+ }
142584
142600
 
142585
142601
  /* Tabs */
142586
142602
  .myio-annotations-tabs {
@@ -142639,6 +142655,25 @@ var HEADER_ANNOTATIONS_STYLES = `
142639
142655
  padding-bottom: 6px;
142640
142656
  }
142641
142657
  .myio-annotations-toolbar-count { font-weight: 600; }
142658
+ .myio-annotations-toolbar-spacer { flex: 1; }
142659
+ .myio-annotations-toolbar-mini {
142660
+ font: inherit;
142661
+ font-size: 11px;
142662
+ font-weight: 600;
142663
+ color: #64748b;
142664
+ background: transparent;
142665
+ border: 1px solid #e2e8f0;
142666
+ border-radius: 4px;
142667
+ padding: 2px 8px;
142668
+ margin-left: 4px;
142669
+ cursor: pointer;
142670
+ transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
142671
+ }
142672
+ .myio-annotations-toolbar-mini:hover {
142673
+ background: rgba(108, 92, 231, 0.08);
142674
+ color: #4c3aac;
142675
+ border-color: rgba(108, 92, 231, 0.3);
142676
+ }
142642
142677
 
142643
142678
  .myio-annotations-toolbar-search {
142644
142679
  flex: 1;
@@ -142795,6 +142830,26 @@ var HEADER_ANNOTATIONS_STYLES = `
142795
142830
  font-size: 12px;
142796
142831
  font-weight: 700;
142797
142832
  color: #334155;
142833
+ cursor: pointer;
142834
+ user-select: none;
142835
+ transition: background 0.15s ease;
142836
+ }
142837
+ .myio-annotations-group-header:hover {
142838
+ background: #f1f5f9;
142839
+ }
142840
+ .myio-annotations-group-header:focus-visible {
142841
+ outline: 2px solid #6c5ce7;
142842
+ outline-offset: -2px;
142843
+ }
142844
+ .myio-annotations-group-chevron {
142845
+ display: inline-block;
142846
+ width: 10px;
142847
+ font-size: 10px;
142848
+ color: #94a3b8;
142849
+ transition: transform 0.15s ease;
142850
+ }
142851
+ .myio-annotations-group.is-collapsed .myio-annotations-group-header {
142852
+ border-bottom-color: transparent;
142798
142853
  }
142799
142854
  .myio-annotations-group-icon { font-size: 14px; }
142800
142855
  .myio-annotations-group-label { flex: 1; }
@@ -142812,13 +142867,21 @@ var HEADER_ANNOTATIONS_STYLES = `
142812
142867
  border-bottom-color: #fde68a;
142813
142868
  }
142814
142869
 
142815
- /* Item */
142870
+ /* Item \u2014 rendered as <button>, so must reset UA defaults
142871
+ (RFC-0203 M7 follow-up: black border + non-100% width came from
142872
+ browser default button styling). */
142816
142873
  .myio-annotations-item {
142817
142874
  display: grid;
142818
142875
  grid-template-columns: 22px 1fr auto;
142819
142876
  gap: 10px;
142820
142877
  padding: 10px 12px;
142878
+ width: 100%;
142879
+ border: none;
142821
142880
  border-bottom: 1px solid #f1f5f9;
142881
+ background: transparent;
142882
+ color: inherit;
142883
+ font: inherit;
142884
+ text-align: left;
142822
142885
  cursor: pointer;
142823
142886
  transition: background 0.12s;
142824
142887
  }
@@ -143759,7 +143822,7 @@ function _formatDate(iso) {
143759
143822
  // src/components/header-annotations-panel/HeaderAnnotationsPanel.ts
143760
143823
  var TABS = [
143761
143824
  { id: "identifier", label: "Por Identificador" },
143762
- { id: "device", label: "Por Device" },
143825
+ { id: "device", label: "Por Dispositivo" },
143763
143826
  { id: "domain", label: "Por Dom\xEDnio" }
143764
143827
  ];
143765
143828
  var TAB_STORAGE_KEY = "myio.annotations.activeTab";
@@ -143773,6 +143836,8 @@ var HeaderAnnotationsPanel = class {
143773
143836
  sortBy = DEFAULT_SORT;
143774
143837
  filter = createDefaultFilter();
143775
143838
  isOpen = false;
143839
+ // RFC-0203 follow-up — collapsible group state per (tab,key). Default: expanded.
143840
+ collapsedKeys = /* @__PURE__ */ new Set();
143776
143841
  // RFC-0203 M6 — Tooltip behaviors state
143777
143842
  isPinned = false;
143778
143843
  isMaximized = false;
@@ -144090,28 +144155,47 @@ var HeaderAnnotationsPanel = class {
144090
144155
  const bodyHtml = this._renderBody(groups);
144091
144156
  return `
144092
144157
  <div class="myio-annotations-panel-header" data-region="header" data-drag-handle>
144093
- <h2 class="myio-annotations-panel-title" id="${PANEL_DOM_ID}-title">
144094
- <span class="myio-annotations-icon" aria-hidden="true">\u{1F4CB}</span>Anota\xE7\xF5es
144095
- </h2>
144158
+ <span class="myio-annotations-icon" aria-hidden="true">\u{1F4CB}</span>
144159
+ <h2 class="myio-annotations-panel-title" id="${PANEL_DOM_ID}-title">Anota\xE7\xF5es</h2>
144096
144160
  <span class="myio-annotations-panel-meta">${totalAllUnfiltered} ativas \xB7 ${pending} pendentes \xB7 ${overdue} vencidas</span>
144097
144161
  <div class="myio-annotations-panel-actions">
144098
144162
  <button
144099
- class="myio-annotations-panel-action ${this.isMaximized ? "is-active" : ""}"
144163
+ class="myio-annotations-panel-action ${this.isPinned ? "pinned" : ""}"
144164
+ type="button"
144165
+ data-action="pin"
144166
+ title="${this.isPinned ? "Desafixar" : "Fixar na tela"}"
144167
+ aria-label="${this.isPinned ? "Desafixar painel" : "Fixar painel"}"
144168
+ aria-pressed="${this.isPinned}"
144169
+ >
144170
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
144171
+ <path d="M9 4v6l-2 4v2h10v-2l-2-4V4"/>
144172
+ <line x1="12" y1="16" x2="12" y2="21"/>
144173
+ <line x1="8" y1="4" x2="16" y2="4"/>
144174
+ </svg>
144175
+ </button>
144176
+ <button
144177
+ class="myio-annotations-panel-action"
144100
144178
  type="button"
144101
144179
  data-action="maximize"
144102
144180
  title="${this.isMaximized ? "Restaurar" : "Maximizar"}"
144103
144181
  aria-label="${this.isMaximized ? "Restaurar tamanho" : "Maximizar painel"}"
144104
144182
  aria-pressed="${this.isMaximized}"
144105
- >${this.isMaximized ? "\u{1F5D7}" : "\u2922"}</button>
144183
+ >
144184
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
144185
+ <rect x="3" y="3" width="18" height="18" rx="2"/>
144186
+ </svg>
144187
+ </button>
144106
144188
  <button
144107
- class="myio-annotations-panel-action ${this.isPinned ? "is-active" : ""}"
144189
+ class="myio-annotations-panel-action"
144108
144190
  type="button"
144109
- data-action="pin"
144110
- title="${this.isPinned ? "Desafixar" : "Afixar painel"}"
144111
- aria-label="${this.isPinned ? "Desafixar painel" : "Afixar painel"}"
144112
- aria-pressed="${this.isPinned}"
144113
- >\u{1F4CC}</button>
144114
- <button class="myio-annotations-panel-action" type="button" data-action="close" title="Fechar" aria-label="Fechar painel">\u2715</button>
144191
+ data-action="close"
144192
+ title="Fechar"
144193
+ aria-label="Fechar painel"
144194
+ >
144195
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
144196
+ <path d="M18 6L6 18M6 6l12 12"/>
144197
+ </svg>
144198
+ </button>
144115
144199
  </div>
144116
144200
  </div>
144117
144201
  <div class="myio-annotations-tabs" role="tablist" aria-label="Modo de agrupamento">${tabsHtml}</div>
@@ -144158,6 +144242,9 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
144158
144242
  </div>
144159
144243
  <div class="myio-annotations-toolbar-row myio-annotations-toolbar-meta">
144160
144244
  <span class="myio-annotations-toolbar-count">${showingHtml}</span>
144245
+ <span class="myio-annotations-toolbar-spacer"></span>
144246
+ <button type="button" class="myio-annotations-toolbar-mini" data-action="expand-all" title="Expandir todos os grupos">\u25BC Expandir tudo</button>
144247
+ <button type="button" class="myio-annotations-toolbar-mini" data-action="collapse-all" title="Recolher todos os grupos">\u25B6 Recolher tudo</button>
144161
144248
  </div>
144162
144249
  <div id="myio-anno-filters" class="myio-annotations-filters" hidden>${this._renderFilters()}</div>
144163
144250
  </div>`;
@@ -144229,17 +144316,56 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
144229
144316
  const items = group.devices.flatMap(
144230
144317
  (d) => d.annotations.map((a) => renderAnnotationItemCard(d, a, term))
144231
144318
  );
144232
- const groupClass = isNoIdentifier ? "myio-annotations-group myio-annotations-group--no-id" : "myio-annotations-group";
144319
+ const compoundKey = `${this.activeTab}::${group.key}`;
144320
+ const isCollapsed = this.collapsedKeys.has(compoundKey);
144321
+ const baseClass = isNoIdentifier ? "myio-annotations-group myio-annotations-group--no-id" : "myio-annotations-group";
144322
+ const groupClass = isCollapsed ? `${baseClass} is-collapsed` : baseClass;
144323
+ const itemsHtml = isCollapsed ? `<div class="myio-annotations-items" hidden></div>` : `<div class="myio-annotations-items">${items.join("\n")}</div>`;
144233
144324
  return `
144234
144325
  <section class="${groupClass}">
144235
- <header class="myio-annotations-group-header">
144326
+ <header class="myio-annotations-group-header" role="button" tabindex="0"
144327
+ data-group-toggle="${escapeHtml6(group.key)}"
144328
+ aria-expanded="${!isCollapsed}"
144329
+ title="${isCollapsed ? "Expandir grupo" : "Recolher grupo"}">
144330
+ <span class="myio-annotations-group-chevron" aria-hidden="true">${isCollapsed ? "\u25B6" : "\u25BC"}</span>
144236
144331
  ${group.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml6(group.icon)}</span>` : ""}
144237
144332
  <span class="myio-annotations-group-label">${escapeHtml6(group.label)}</span>
144238
144333
  <span class="myio-annotations-group-count">${group.totalAnnotations}</span>
144239
144334
  </header>
144240
- ${items.join("\n")}
144335
+ ${itemsHtml}
144241
144336
  </section>`;
144242
144337
  }
144338
+ /** Toggle a single group's collapsed state (scoped to current tab). */
144339
+ _toggleGroupCollapsed(groupKey) {
144340
+ const compoundKey = `${this.activeTab}::${groupKey}`;
144341
+ if (this.collapsedKeys.has(compoundKey)) {
144342
+ this.collapsedKeys.delete(compoundKey);
144343
+ } else {
144344
+ this.collapsedKeys.add(compoundKey);
144345
+ }
144346
+ if (this.isOpen) this._render();
144347
+ }
144348
+ /** Expand every group in the current tab. */
144349
+ _expandAll() {
144350
+ const prefix = `${this.activeTab}::`;
144351
+ let changed = false;
144352
+ for (const k of Array.from(this.collapsedKeys)) {
144353
+ if (k.startsWith(prefix)) {
144354
+ this.collapsedKeys.delete(k);
144355
+ changed = true;
144356
+ }
144357
+ }
144358
+ if (changed && this.isOpen) this._render();
144359
+ }
144360
+ /** Collapse every group in the current tab. */
144361
+ _collapseAll() {
144362
+ const orch = this.opts.getOrchestrator();
144363
+ if (!orch) return;
144364
+ const rawGroups = orch.getGroups(this.activeTab, this.filter);
144365
+ const prefix = `${this.activeTab}::`;
144366
+ for (const g of rawGroups) this.collapsedKeys.add(`${prefix}${g.key}`);
144367
+ if (this.isOpen) this._render();
144368
+ }
144243
144369
  _bindInteractiveElements() {
144244
144370
  if (!this.root) return;
144245
144371
  const tabBtns = Array.from(this.root.querySelectorAll(".myio-annotations-tab"));
@@ -144311,6 +144437,22 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
144311
144437
  if (exportBtn) {
144312
144438
  exportBtn.addEventListener("click", () => this._openExportFlow());
144313
144439
  }
144440
+ const expandAllBtn = this.root.querySelector('[data-action="expand-all"]');
144441
+ if (expandAllBtn) expandAllBtn.addEventListener("click", () => this._expandAll());
144442
+ const collapseAllBtn = this.root.querySelector('[data-action="collapse-all"]');
144443
+ if (collapseAllBtn) collapseAllBtn.addEventListener("click", () => this._collapseAll());
144444
+ const groupHeaders = this.root.querySelectorAll("[data-group-toggle]");
144445
+ groupHeaders.forEach((h) => {
144446
+ const key = h.getAttribute("data-group-toggle") || "";
144447
+ h.addEventListener("click", () => this._toggleGroupCollapsed(key));
144448
+ h.addEventListener("keydown", (e) => {
144449
+ const ke = e;
144450
+ if (ke.key === "Enter" || ke.key === " ") {
144451
+ ke.preventDefault();
144452
+ this._toggleGroupCollapsed(key);
144453
+ }
144454
+ });
144455
+ });
144314
144456
  const searchInput = this.root.querySelector('[data-input="search"]');
144315
144457
  if (searchInput) {
144316
144458
  searchInput.addEventListener("input", () => {
package/dist/index.d.cts CHANGED
@@ -19489,6 +19489,7 @@ declare class HeaderAnnotationsPanel {
19489
19489
  private sortBy;
19490
19490
  private filter;
19491
19491
  private isOpen;
19492
+ private collapsedKeys;
19492
19493
  private isPinned;
19493
19494
  private isMaximized;
19494
19495
  private isDragging;
@@ -19546,6 +19547,12 @@ declare class HeaderAnnotationsPanel {
19546
19547
  private _activeFilterCount;
19547
19548
  private _renderBody;
19548
19549
  private _renderGroup;
19550
+ /** Toggle a single group's collapsed state (scoped to current tab). */
19551
+ private _toggleGroupCollapsed;
19552
+ /** Expand every group in the current tab. */
19553
+ private _expandAll;
19554
+ /** Collapse every group in the current tab. */
19555
+ private _collapseAll;
19549
19556
  private _bindInteractiveElements;
19550
19557
  /** After a re-render triggered by a filter checkbox, re-open the filter panel
19551
19558
  * so the user keeps the context visible. */
package/dist/index.js CHANGED
@@ -546,7 +546,7 @@ var init_template_card = __esm({
546
546
  // package.json
547
547
  var package_default = {
548
548
  name: "myio-js-library",
549
- version: "0.1.510",
549
+ version: "0.1.511",
550
550
  description: "A clean, standalone JS SDK for MYIO projects",
551
551
  license: "MIT",
552
552
  repository: "github:gh-myio/myio-js-library",
@@ -141912,28 +141912,44 @@ var HEADER_ANNOTATIONS_STYLES = `
141912
141912
  align-items: center;
141913
141913
  gap: 4px;
141914
141914
  }
141915
+ /* Header action buttons \u2014 mirror src/utils/InfoTooltip.ts pattern
141916
+ (24\xD724 button with white-ish bg, SVG 14\xD714, slate hover, emerald
141917
+ pinned state). RFC-0203 M7 follow-up: alignment with InfoTooltip. */
141915
141918
  .myio-annotations-panel-action {
141916
- width: 28px;
141917
- height: 28px;
141919
+ width: 24px;
141920
+ height: 24px;
141921
+ border: none;
141922
+ background: rgba(255, 255, 255, 0.7);
141923
+ border-radius: 4px;
141924
+ cursor: pointer;
141918
141925
  display: inline-flex;
141919
141926
  align-items: center;
141920
141927
  justify-content: center;
141921
- border: 1px solid transparent;
141922
- border-radius: 6px;
141923
- background: transparent;
141928
+ transition: background 0.15s ease, color 0.15s ease;
141924
141929
  color: #64748b;
141925
- cursor: pointer;
141926
- font-size: 14px;
141927
- transition: background 0.15s, color 0.15s;
141930
+ padding: 0;
141928
141931
  }
141929
141932
  .myio-annotations-panel-action:hover {
141930
- background: rgba(108, 92, 231, 0.1);
141931
- color: #4c3aac;
141933
+ background: rgba(255, 255, 255, 0.95);
141934
+ color: #1e293b;
141932
141935
  }
141933
141936
  .myio-annotations-panel-action:focus-visible {
141934
141937
  outline: 2px solid #6c5ce7;
141935
141938
  outline-offset: 2px;
141936
141939
  }
141940
+ /* Pinned state \u2014 emerald-700, matches InfoTooltip */
141941
+ .myio-annotations-panel-action.pinned {
141942
+ background: #047857;
141943
+ color: #ffffff;
141944
+ }
141945
+ .myio-annotations-panel-action.pinned:hover {
141946
+ background: #065f46;
141947
+ }
141948
+ .myio-annotations-panel-action svg {
141949
+ width: 14px;
141950
+ height: 14px;
141951
+ display: block;
141952
+ }
141937
141953
 
141938
141954
  /* Tabs */
141939
141955
  .myio-annotations-tabs {
@@ -141992,6 +142008,25 @@ var HEADER_ANNOTATIONS_STYLES = `
141992
142008
  padding-bottom: 6px;
141993
142009
  }
141994
142010
  .myio-annotations-toolbar-count { font-weight: 600; }
142011
+ .myio-annotations-toolbar-spacer { flex: 1; }
142012
+ .myio-annotations-toolbar-mini {
142013
+ font: inherit;
142014
+ font-size: 11px;
142015
+ font-weight: 600;
142016
+ color: #64748b;
142017
+ background: transparent;
142018
+ border: 1px solid #e2e8f0;
142019
+ border-radius: 4px;
142020
+ padding: 2px 8px;
142021
+ margin-left: 4px;
142022
+ cursor: pointer;
142023
+ transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
142024
+ }
142025
+ .myio-annotations-toolbar-mini:hover {
142026
+ background: rgba(108, 92, 231, 0.08);
142027
+ color: #4c3aac;
142028
+ border-color: rgba(108, 92, 231, 0.3);
142029
+ }
141995
142030
 
141996
142031
  .myio-annotations-toolbar-search {
141997
142032
  flex: 1;
@@ -142148,6 +142183,26 @@ var HEADER_ANNOTATIONS_STYLES = `
142148
142183
  font-size: 12px;
142149
142184
  font-weight: 700;
142150
142185
  color: #334155;
142186
+ cursor: pointer;
142187
+ user-select: none;
142188
+ transition: background 0.15s ease;
142189
+ }
142190
+ .myio-annotations-group-header:hover {
142191
+ background: #f1f5f9;
142192
+ }
142193
+ .myio-annotations-group-header:focus-visible {
142194
+ outline: 2px solid #6c5ce7;
142195
+ outline-offset: -2px;
142196
+ }
142197
+ .myio-annotations-group-chevron {
142198
+ display: inline-block;
142199
+ width: 10px;
142200
+ font-size: 10px;
142201
+ color: #94a3b8;
142202
+ transition: transform 0.15s ease;
142203
+ }
142204
+ .myio-annotations-group.is-collapsed .myio-annotations-group-header {
142205
+ border-bottom-color: transparent;
142151
142206
  }
142152
142207
  .myio-annotations-group-icon { font-size: 14px; }
142153
142208
  .myio-annotations-group-label { flex: 1; }
@@ -142165,13 +142220,21 @@ var HEADER_ANNOTATIONS_STYLES = `
142165
142220
  border-bottom-color: #fde68a;
142166
142221
  }
142167
142222
 
142168
- /* Item */
142223
+ /* Item \u2014 rendered as <button>, so must reset UA defaults
142224
+ (RFC-0203 M7 follow-up: black border + non-100% width came from
142225
+ browser default button styling). */
142169
142226
  .myio-annotations-item {
142170
142227
  display: grid;
142171
142228
  grid-template-columns: 22px 1fr auto;
142172
142229
  gap: 10px;
142173
142230
  padding: 10px 12px;
142231
+ width: 100%;
142232
+ border: none;
142174
142233
  border-bottom: 1px solid #f1f5f9;
142234
+ background: transparent;
142235
+ color: inherit;
142236
+ font: inherit;
142237
+ text-align: left;
142175
142238
  cursor: pointer;
142176
142239
  transition: background 0.12s;
142177
142240
  }
@@ -143112,7 +143175,7 @@ function _formatDate(iso) {
143112
143175
  // src/components/header-annotations-panel/HeaderAnnotationsPanel.ts
143113
143176
  var TABS = [
143114
143177
  { id: "identifier", label: "Por Identificador" },
143115
- { id: "device", label: "Por Device" },
143178
+ { id: "device", label: "Por Dispositivo" },
143116
143179
  { id: "domain", label: "Por Dom\xEDnio" }
143117
143180
  ];
143118
143181
  var TAB_STORAGE_KEY = "myio.annotations.activeTab";
@@ -143126,6 +143189,8 @@ var HeaderAnnotationsPanel = class {
143126
143189
  sortBy = DEFAULT_SORT;
143127
143190
  filter = createDefaultFilter();
143128
143191
  isOpen = false;
143192
+ // RFC-0203 follow-up — collapsible group state per (tab,key). Default: expanded.
143193
+ collapsedKeys = /* @__PURE__ */ new Set();
143129
143194
  // RFC-0203 M6 — Tooltip behaviors state
143130
143195
  isPinned = false;
143131
143196
  isMaximized = false;
@@ -143443,28 +143508,47 @@ var HeaderAnnotationsPanel = class {
143443
143508
  const bodyHtml = this._renderBody(groups);
143444
143509
  return `
143445
143510
  <div class="myio-annotations-panel-header" data-region="header" data-drag-handle>
143446
- <h2 class="myio-annotations-panel-title" id="${PANEL_DOM_ID}-title">
143447
- <span class="myio-annotations-icon" aria-hidden="true">\u{1F4CB}</span>Anota\xE7\xF5es
143448
- </h2>
143511
+ <span class="myio-annotations-icon" aria-hidden="true">\u{1F4CB}</span>
143512
+ <h2 class="myio-annotations-panel-title" id="${PANEL_DOM_ID}-title">Anota\xE7\xF5es</h2>
143449
143513
  <span class="myio-annotations-panel-meta">${totalAllUnfiltered} ativas \xB7 ${pending} pendentes \xB7 ${overdue} vencidas</span>
143450
143514
  <div class="myio-annotations-panel-actions">
143451
143515
  <button
143452
- class="myio-annotations-panel-action ${this.isMaximized ? "is-active" : ""}"
143516
+ class="myio-annotations-panel-action ${this.isPinned ? "pinned" : ""}"
143517
+ type="button"
143518
+ data-action="pin"
143519
+ title="${this.isPinned ? "Desafixar" : "Fixar na tela"}"
143520
+ aria-label="${this.isPinned ? "Desafixar painel" : "Fixar painel"}"
143521
+ aria-pressed="${this.isPinned}"
143522
+ >
143523
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
143524
+ <path d="M9 4v6l-2 4v2h10v-2l-2-4V4"/>
143525
+ <line x1="12" y1="16" x2="12" y2="21"/>
143526
+ <line x1="8" y1="4" x2="16" y2="4"/>
143527
+ </svg>
143528
+ </button>
143529
+ <button
143530
+ class="myio-annotations-panel-action"
143453
143531
  type="button"
143454
143532
  data-action="maximize"
143455
143533
  title="${this.isMaximized ? "Restaurar" : "Maximizar"}"
143456
143534
  aria-label="${this.isMaximized ? "Restaurar tamanho" : "Maximizar painel"}"
143457
143535
  aria-pressed="${this.isMaximized}"
143458
- >${this.isMaximized ? "\u{1F5D7}" : "\u2922"}</button>
143536
+ >
143537
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
143538
+ <rect x="3" y="3" width="18" height="18" rx="2"/>
143539
+ </svg>
143540
+ </button>
143459
143541
  <button
143460
- class="myio-annotations-panel-action ${this.isPinned ? "is-active" : ""}"
143542
+ class="myio-annotations-panel-action"
143461
143543
  type="button"
143462
- data-action="pin"
143463
- title="${this.isPinned ? "Desafixar" : "Afixar painel"}"
143464
- aria-label="${this.isPinned ? "Desafixar painel" : "Afixar painel"}"
143465
- aria-pressed="${this.isPinned}"
143466
- >\u{1F4CC}</button>
143467
- <button class="myio-annotations-panel-action" type="button" data-action="close" title="Fechar" aria-label="Fechar painel">\u2715</button>
143544
+ data-action="close"
143545
+ title="Fechar"
143546
+ aria-label="Fechar painel"
143547
+ >
143548
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
143549
+ <path d="M18 6L6 18M6 6l12 12"/>
143550
+ </svg>
143551
+ </button>
143468
143552
  </div>
143469
143553
  </div>
143470
143554
  <div class="myio-annotations-tabs" role="tablist" aria-label="Modo de agrupamento">${tabsHtml}</div>
@@ -143511,6 +143595,9 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
143511
143595
  </div>
143512
143596
  <div class="myio-annotations-toolbar-row myio-annotations-toolbar-meta">
143513
143597
  <span class="myio-annotations-toolbar-count">${showingHtml}</span>
143598
+ <span class="myio-annotations-toolbar-spacer"></span>
143599
+ <button type="button" class="myio-annotations-toolbar-mini" data-action="expand-all" title="Expandir todos os grupos">\u25BC Expandir tudo</button>
143600
+ <button type="button" class="myio-annotations-toolbar-mini" data-action="collapse-all" title="Recolher todos os grupos">\u25B6 Recolher tudo</button>
143514
143601
  </div>
143515
143602
  <div id="myio-anno-filters" class="myio-annotations-filters" hidden>${this._renderFilters()}</div>
143516
143603
  </div>`;
@@ -143582,17 +143669,56 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
143582
143669
  const items = group.devices.flatMap(
143583
143670
  (d) => d.annotations.map((a) => renderAnnotationItemCard(d, a, term))
143584
143671
  );
143585
- const groupClass = isNoIdentifier ? "myio-annotations-group myio-annotations-group--no-id" : "myio-annotations-group";
143672
+ const compoundKey = `${this.activeTab}::${group.key}`;
143673
+ const isCollapsed = this.collapsedKeys.has(compoundKey);
143674
+ const baseClass = isNoIdentifier ? "myio-annotations-group myio-annotations-group--no-id" : "myio-annotations-group";
143675
+ const groupClass = isCollapsed ? `${baseClass} is-collapsed` : baseClass;
143676
+ const itemsHtml = isCollapsed ? `<div class="myio-annotations-items" hidden></div>` : `<div class="myio-annotations-items">${items.join("\n")}</div>`;
143586
143677
  return `
143587
143678
  <section class="${groupClass}">
143588
- <header class="myio-annotations-group-header">
143679
+ <header class="myio-annotations-group-header" role="button" tabindex="0"
143680
+ data-group-toggle="${escapeHtml6(group.key)}"
143681
+ aria-expanded="${!isCollapsed}"
143682
+ title="${isCollapsed ? "Expandir grupo" : "Recolher grupo"}">
143683
+ <span class="myio-annotations-group-chevron" aria-hidden="true">${isCollapsed ? "\u25B6" : "\u25BC"}</span>
143589
143684
  ${group.icon ? `<span class="myio-annotations-group-icon" aria-hidden="true">${escapeHtml6(group.icon)}</span>` : ""}
143590
143685
  <span class="myio-annotations-group-label">${escapeHtml6(group.label)}</span>
143591
143686
  <span class="myio-annotations-group-count">${group.totalAnnotations}</span>
143592
143687
  </header>
143593
- ${items.join("\n")}
143688
+ ${itemsHtml}
143594
143689
  </section>`;
143595
143690
  }
143691
+ /** Toggle a single group's collapsed state (scoped to current tab). */
143692
+ _toggleGroupCollapsed(groupKey) {
143693
+ const compoundKey = `${this.activeTab}::${groupKey}`;
143694
+ if (this.collapsedKeys.has(compoundKey)) {
143695
+ this.collapsedKeys.delete(compoundKey);
143696
+ } else {
143697
+ this.collapsedKeys.add(compoundKey);
143698
+ }
143699
+ if (this.isOpen) this._render();
143700
+ }
143701
+ /** Expand every group in the current tab. */
143702
+ _expandAll() {
143703
+ const prefix = `${this.activeTab}::`;
143704
+ let changed = false;
143705
+ for (const k of Array.from(this.collapsedKeys)) {
143706
+ if (k.startsWith(prefix)) {
143707
+ this.collapsedKeys.delete(k);
143708
+ changed = true;
143709
+ }
143710
+ }
143711
+ if (changed && this.isOpen) this._render();
143712
+ }
143713
+ /** Collapse every group in the current tab. */
143714
+ _collapseAll() {
143715
+ const orch = this.opts.getOrchestrator();
143716
+ if (!orch) return;
143717
+ const rawGroups = orch.getGroups(this.activeTab, this.filter);
143718
+ const prefix = `${this.activeTab}::`;
143719
+ for (const g of rawGroups) this.collapsedKeys.add(`${prefix}${g.key}`);
143720
+ if (this.isOpen) this._render();
143721
+ }
143596
143722
  _bindInteractiveElements() {
143597
143723
  if (!this.root) return;
143598
143724
  const tabBtns = Array.from(this.root.querySelectorAll(".myio-annotations-tab"));
@@ -143664,6 +143790,22 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
143664
143790
  if (exportBtn) {
143665
143791
  exportBtn.addEventListener("click", () => this._openExportFlow());
143666
143792
  }
143793
+ const expandAllBtn = this.root.querySelector('[data-action="expand-all"]');
143794
+ if (expandAllBtn) expandAllBtn.addEventListener("click", () => this._expandAll());
143795
+ const collapseAllBtn = this.root.querySelector('[data-action="collapse-all"]');
143796
+ if (collapseAllBtn) collapseAllBtn.addEventListener("click", () => this._collapseAll());
143797
+ const groupHeaders = this.root.querySelectorAll("[data-group-toggle]");
143798
+ groupHeaders.forEach((h) => {
143799
+ const key = h.getAttribute("data-group-toggle") || "";
143800
+ h.addEventListener("click", () => this._toggleGroupCollapsed(key));
143801
+ h.addEventListener("keydown", (e) => {
143802
+ const ke = e;
143803
+ if (ke.key === "Enter" || ke.key === " ") {
143804
+ ke.preventDefault();
143805
+ this._toggleGroupCollapsed(key);
143806
+ }
143807
+ });
143808
+ });
143667
143809
  const searchInput = this.root.querySelector('[data-input="search"]');
143668
143810
  if (searchInput) {
143669
143811
  searchInput.addEventListener("input", () => {