@genesislcap/ai-assistant 15.28.1-FUI-0.6 → 15.28.1-reconnection-issues.1

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.
@@ -1209,21 +1209,6 @@
1209
1209
  },
1210
1210
  "privacy": "private"
1211
1211
  },
1212
- {
1213
- "kind": "method",
1214
- "name": "activeChanged",
1215
- "description": "Start/stop with `active`, so an idle overlay costs nothing.\n\nGuarded on `isConnected` because FAST invokes attribute-changed callbacks during\ninitialisation, before the element is in the document — `connectedCallback` is what decides\nfor an element that mounts already-active."
1216
- },
1217
- {
1218
- "kind": "method",
1219
- "name": "startAnimation",
1220
- "privacy": "private"
1221
- },
1222
- {
1223
- "kind": "method",
1224
- "name": "stopAnimation",
1225
- "privacy": "private"
1226
- },
1227
1212
  {
1228
1213
  "kind": "method",
1229
1214
  "name": "tick",
@@ -1 +1 @@
1
- {"version":3,"file":"chat-bubble.template.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-bubble/chat-bubble.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAQ,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgBlD,eAAO,MAAM,oBAAoB,QAAO,YAAY,CAAC,YAAY,CAmDhE,CAAC"}
1
+ {"version":3,"file":"chat-bubble.template.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-bubble/chat-bubble.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAQ,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgBlD,eAAO,MAAM,oBAAoB,QAAO,YAAY,CAAC,YAAY,CAiDhE,CAAC"}
@@ -31,18 +31,8 @@ export declare class AiHaloOverlay extends GenesisElement {
31
31
  private angle;
32
32
  private lastTime?;
33
33
  private animFrame?;
34
- /**
35
- * Start/stop with `active`, so an idle overlay costs nothing.
36
- *
37
- * Guarded on `isConnected` because FAST invokes attribute-changed callbacks during
38
- * initialisation, before the element is in the document — `connectedCallback` is what decides
39
- * for an element that mounts already-active.
40
- */
41
- activeChanged(): void;
42
34
  connectedCallback(): void;
43
35
  disconnectedCallback(): void;
44
- private startAnimation;
45
- private stopAnimation;
46
36
  private tick;
47
37
  }
48
38
  //# sourceMappingURL=halo-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"halo-overlay.d.ts","sourceRoot":"","sources":["../../../src/components/halo-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAQ,MAAM,uBAAuB,CAAC;AAwBvF;;;;;;;;;;;;GAYG;AACH,qBA0Ea,aAAc,SAAQ,cAAc;IACpB,MAAM,EAAE,OAAO,CAAS;IACnD,+FAA+F;IACpC,KAAK,EAAE,MAAM,CAAsB;IAC9F,qDAAqD;IAC/C,SAAS,EAAE,IAAI,GAAG,KAAK,CAAQ;IACrC,0CAA0C;IAE1C,UAAU,EAAE,MAAM,CAA4B;IAC9C,+CAA+C;IAE/C,WAAW,EAAE,MAAM,CAA6B;IAChD,2GAA2G;IAE3G,UAAU,EAAE,MAAM,CAA4B;IAE9C,iBAAiB;IAIjB,kBAAkB;IAIlB,iBAAiB;IAkBjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAO;IAEhD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B;;;;;;OAMG;IACH,aAAa;IAMb,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,IAAI;CAiBb"}
1
+ {"version":3,"file":"halo-overlay.d.ts","sourceRoot":"","sources":["../../../src/components/halo-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAQ,MAAM,uBAAuB,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,MAAM,GAAG,IACpB,CAAC;AAyJrD,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CA8qBpC,CAAC"}
1
+ {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAuC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQ1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAyHpD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB,kDAWpC,CAAC;AAoJF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,GAAI,GAAG,qBAAqB,KAAG,MAYlD,CAAC;AAEf;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,GAAI,GAAG,qBAAqB,KAAG,MAAM,GAAG,IACpB,CAAC;AAyJrD,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CA2qBpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-suggestions.d.ts","sourceRoot":"","sources":["../../../src/suggestions/chat-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAMf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwJ3D,qBAKa,eAAgB,SAAQ,cAAc;IAEjD,KAAK,EAAE,gBAAgB,CAAsB;IAE7C;;;;OAIG;IACkD,UAAU,UAAS;IAExE,YAAY,IAAI,IAAI;IAKpB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAGhD"}
1
+ {"version":3,"file":"chat-suggestions.d.ts","sourceRoot":"","sources":["../../../src/suggestions/chat-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAMf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAuJ3D,qBAKa,eAAgB,SAAQ,cAAc;IAEjD,KAAK,EAAE,gBAAgB,CAAsB;IAE7C;;;;OAIG;IACkD,UAAU,UAAS;IAExE,YAAY,IAAI,IAAI;IAKpB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAGhD"}
@@ -17,7 +17,6 @@ export const AiChatBubbleTemplate = () => {
17
17
  ${when((x) => !x.dialogOpen, html `
18
18
  <div
19
19
  class="bubble ${(x) => (x.hovered ? 'hovered' : '')}"
20
- part="bubble"
21
20
  style="${(x) => `translate: ${x.bubbleLeft}px ${x.bubbleTop}px`}"
22
21
  ${ref('bubbleEl')}
23
22
  @mousedown="${(x, c) => x.onBubbleMouseDown(c.event)}"
@@ -28,8 +27,8 @@ export const AiChatBubbleTemplate = () => {
28
27
  <img src="${(x) => x.imageSrc}" alt="AI" draggable="false" />
29
28
  `)}
30
29
  ${when((x) => !x.imageSrc, genesisIconTemplate)}
31
- <div class="pulse-ring" part="pulse-ring"></div>
32
- <div class="tooltip" part="tooltip" style="${(x) => x.tooltipStyle}" ${ref('tooltipEl')}>
30
+ <div class="pulse-ring"></div>
31
+ <div class="tooltip" style="${(x) => x.tooltipStyle}" ${ref('tooltipEl')}>
33
32
  ${(x) => x.title}
34
33
  </div>
35
34
  </div>
@@ -42,12 +41,11 @@ export const AiChatBubbleTemplate = () => {
42
41
  (x) => (x.dialogOpen ? [x] : []), html `
43
42
  <div
44
43
  class="dialog"
45
- part="dialog"
46
44
  style="${(x) => `translate: ${x.dialogLeft}px ${x.dialogTop}px; width: ${x.dialogWidth}px; height: ${x.dialogHeight}px`}"
47
45
  @chat-header-mousedown="${(x, c) => x.onDialogHeaderMouseDown(c.event)}"
48
46
  ${ref('dialogEl')}
49
47
  >
50
- <div class="dialog-content" part="dialog-content">
48
+ <div class="dialog-content">
51
49
  <slot name="dialog-content" ${slotted('dialogContent')}></slot>
52
50
  </div>
53
51
  </div>
@@ -55,45 +55,17 @@ let AiHaloOverlay = AiHaloOverlay_1 = class AiHaloOverlay extends GenesisElement
55
55
  glowSpreadChanged() {
56
56
  this.style.setProperty('--halo-glow-spread', `${this.glowSpread}%`);
57
57
  }
58
- /**
59
- * Start/stop with `active`, so an idle overlay costs nothing.
60
- *
61
- * Guarded on `isConnected` because FAST invokes attribute-changed callbacks during
62
- * initialisation, before the element is in the document — `connectedCallback` is what decides
63
- * for an element that mounts already-active.
64
- */
65
- activeChanged() {
66
- if (!this.isConnected)
67
- return;
68
- if (this.active)
69
- this.startAnimation();
70
- else
71
- this.stopAnimation();
72
- }
73
58
  connectedCallback() {
74
59
  super.connectedCallback();
75
- if (this.active)
76
- this.startAnimation();
60
+ this.tick();
77
61
  }
78
62
  disconnectedCallback() {
79
63
  super.disconnectedCallback();
80
- this.stopAnimation();
81
- }
82
- startAnimation() {
83
- // Re-entrant: `activeChanged` can fire for a value that is already applied, and a second
84
- // scheduled frame would double the rotation speed and leak the first handle.
85
- if (this.animFrame !== undefined)
86
- return;
87
- this.tick();
88
- }
89
- stopAnimation() {
90
64
  if (this.animFrame !== undefined) {
91
65
  cancelAnimationFrame(this.animFrame);
92
66
  this.animFrame = undefined;
93
67
  }
94
- // Reset the clock so a later restart doesn't apply one huge time delta. `angle` is
95
- // deliberately NOT reset: the halo fades out on opacity, so resuming from where it stopped
96
- // avoids a visible jump when it comes back.
68
+ // Reset the clock so a later reconnect doesn't apply one huge time delta.
97
69
  this.lastTime = undefined;
98
70
  }
99
71
  tick(now) {
@@ -114,19 +86,11 @@ let AiHaloOverlay = AiHaloOverlay_1 = class AiHaloOverlay extends GenesisElement
114
86
  this.animFrame = requestAnimationFrame((t) => this.tick(t));
115
87
  }
116
88
  };
117
- // TODO: The rAF loop is fine for demos but runs on the main thread, so heavy JS work can cause
118
- // the animation to stutter. Once @property inside Shadow DOM has solid cross-browser support,
119
- // consider switching back to a CSS @keyframes approach and removing
120
- // connectedCallback/disconnectedCallback/tick().
121
- //
122
- // The loop is GATED ON `active` (see startAnimation/stopAnimation). It used to tick
123
- // unconditionally from connectedCallback, which was written off as "negligible but non-zero"
124
- // idle cost — that undersold it. Every tick writes `--halo-angle` as an INLINE STYLE, so an
125
- // idle overlay mutates its own style attribute ~60x a second for the lifetime of the page.
126
- // Hosts mount these permanently and only toggle `active` (activity-halo and the assistant's
127
- // own chrome both do), so a typical app had several overlays rewriting inline styles forever
128
- // while showing nothing. The visible cost is in devtools: the Elements panel repaints on every
129
- // mutation, which makes inspecting or live-editing anywhere in the tree impractical.
89
+ // TODO: The rAF loop is fine for demos but has two drawbacks vs a pure CSS @property animation:
90
+ // 1. It runs on the main thread, so heavy JS work can cause the animation to stutter.
91
+ // 2. The loop ticks even when `active` is false (idle cost is negligible but non-zero).
92
+ // Once @property inside Shadow DOM has solid cross-browser support, consider switching back
93
+ // to a CSS @keyframes approach and removing connectedCallback/disconnectedCallback/tick().
130
94
  AiHaloOverlay.FULL_ROTATION_DEG = 360;
131
95
  __decorate([
132
96
  attr({ mode: 'boolean' })
@@ -47,19 +47,10 @@ const assistantAvatarTemplate = html `
47
47
  const parent = c.parent;
48
48
  return parent.imageSrc
49
49
  ? html `
50
- <img
51
- src="${() => parent.imageSrc}"
52
- alt="Assistant"
53
- class="avatar-img"
54
- part="avatar-img"
55
- />
50
+ <img src="${() => parent.imageSrc}" alt="Assistant" class="avatar-img" />
56
51
  `
57
52
  : html `
58
- <span
59
- class="avatar-icon"
60
- part="avatar-icon"
61
- :innerHTML="${() => parent.assistantIconSafe}"
62
- ></span>
53
+ <span class="avatar-icon" :innerHTML="${() => parent.assistantIconSafe}"></span>
63
54
  `;
64
55
  }}
65
56
  `;
@@ -68,14 +59,10 @@ const userAvatarTemplate = html `
68
59
  const parent = c.parent;
69
60
  return parent.userImageSrc
70
61
  ? html `
71
- <img src="${() => parent.userImageSrc}" alt="You" class="avatar-img" part="avatar-img" />
62
+ <img src="${() => parent.userImageSrc}" alt="You" class="avatar-img" />
72
63
  `
73
64
  : html `
74
- <span
75
- class="avatar-icon"
76
- part="avatar-icon"
77
- :innerHTML="${() => parent.userIconSafe}"
78
- ></span>
65
+ <span class="avatar-icon" :innerHTML="${() => parent.userIconSafe}"></span>
79
66
  `;
80
67
  }}
81
68
  `;
@@ -526,10 +513,7 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
526
513
  <div
527
514
  class="message-row ${(m) => messageType(m)} ${(m) => m.interaction ? `present-${interactionPresentation(m)}` : ''}"
528
515
  >
529
- <div
530
- class="avatar ${(m) => messageType(m)}"
531
- part="${(m) => `avatar avatar-${messageType(m)}`}"
532
- >
516
+ <div class="avatar ${(m) => messageType(m)}">
533
517
  ${when(
534
518
  // Keyed on messageType (not raw role) so a synthetic-user message,
535
519
  // which renders as 'user', gets the user avatar rather than the
@@ -544,8 +528,8 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
544
528
  // A 'bare' interaction owns its full presentation — suppress the
545
529
  // host sender label. Every other message keeps it.
546
530
  (m) => !(m.interaction && interactionPresentation(m) === 'bare'), html `
547
- <div class="sender" part="sender">
548
- <span class="sender-label" part="sender-label">
531
+ <div class="sender">
532
+ <span class="sender-label">
549
533
  ${(m, c) => {
550
534
  var _a;
551
535
  return messageType(m) === 'ai-function' &&
@@ -563,7 +547,7 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
563
547
  c.parent.timestampDisplay !== 'off', messageTimestampTemplate)}
564
548
  </div>
565
549
  `)}
566
- <div class="content" part="content">
550
+ <div class="content">
567
551
  ${when((m) => m.content, html `
568
552
  <ai-chat-markdown :content="${(m) => m.content}"></ai-chat-markdown>
569
553
  `)}
@@ -3,18 +3,17 @@ import { attr, customElement, GenesisElement, observable, html, css, repeat, whe
3
3
  const PILL_ANIMATION_STAGGER_MS = 70;
4
4
  const template = html `
5
5
  ${when((x) => x.state.status === 'loading', html `
6
- <div class="suggestions-container" part="suggestions-container">
6
+ <div class="suggestions-container">
7
7
  ${repeat(() => Array.from({ length: 3 }), html `
8
- <div class="suggestion-placeholder" part="suggestion-placeholder"></div>
8
+ <div class="suggestion-placeholder"></div>
9
9
  `)}
10
10
  </div>
11
11
  `)}
12
12
  ${when((x) => x.state.status === 'loaded', html `
13
- <div class="suggestions-container" part="suggestions-container">
13
+ <div class="suggestions-container">
14
14
  ${repeat((x) => x.state.suggestions, html `
15
15
  <button
16
16
  class="suggestion-pill"
17
- part="suggestion-pill"
18
17
  style="animation-delay: ${(_, c) => c.index * PILL_ANIMATION_STAGGER_MS}ms"
19
18
  @click="${(suggestion, c) => c.parent.handleSuggestionClick(suggestion)}"
20
19
  >
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.28.1-FUI-0.6",
4
+ "version": "15.28.1-reconnection-issues.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -74,26 +74,26 @@
74
74
  }
75
75
  },
76
76
  "devDependencies": {
77
- "@genesislcap/foundation-testing": "15.28.1-FUI-0.6",
78
- "@genesislcap/genx": "15.28.1-FUI-0.6",
79
- "@genesislcap/rollup-builder": "15.28.1-FUI-0.6",
80
- "@genesislcap/ts-builder": "15.28.1-FUI-0.6",
81
- "@genesislcap/uvu-playwright-builder": "15.28.1-FUI-0.6",
82
- "@genesislcap/vite-builder": "15.28.1-FUI-0.6",
83
- "@genesislcap/webpack-builder": "15.28.1-FUI-0.6",
77
+ "@genesislcap/foundation-testing": "15.28.1-reconnection-issues.1",
78
+ "@genesislcap/genx": "15.28.1-reconnection-issues.1",
79
+ "@genesislcap/rollup-builder": "15.28.1-reconnection-issues.1",
80
+ "@genesislcap/ts-builder": "15.28.1-reconnection-issues.1",
81
+ "@genesislcap/uvu-playwright-builder": "15.28.1-reconnection-issues.1",
82
+ "@genesislcap/vite-builder": "15.28.1-reconnection-issues.1",
83
+ "@genesislcap/webpack-builder": "15.28.1-reconnection-issues.1",
84
84
  "@types/dompurify": "^3.0.5",
85
85
  "@types/marked": "^5.0.2",
86
86
  "esbuild": "0.25.12"
87
87
  },
88
88
  "dependencies": {
89
- "@genesislcap/foundation-ai": "15.28.1-FUI-0.6",
90
- "@genesislcap/foundation-logger": "15.28.1-FUI-0.6",
91
- "@genesislcap/foundation-notifications": "15.28.1-FUI-0.6",
92
- "@genesislcap/foundation-redux": "15.28.1-FUI-0.6",
93
- "@genesislcap/foundation-ui": "15.28.1-FUI-0.6",
94
- "@genesislcap/foundation-utils": "15.28.1-FUI-0.6",
95
- "@genesislcap/rapid-design-system": "15.28.1-FUI-0.6",
96
- "@genesislcap/web-core": "15.28.1-FUI-0.6",
89
+ "@genesislcap/foundation-ai": "15.28.1-reconnection-issues.1",
90
+ "@genesislcap/foundation-logger": "15.28.1-reconnection-issues.1",
91
+ "@genesislcap/foundation-notifications": "15.28.1-reconnection-issues.1",
92
+ "@genesislcap/foundation-redux": "15.28.1-reconnection-issues.1",
93
+ "@genesislcap/foundation-ui": "15.28.1-reconnection-issues.1",
94
+ "@genesislcap/foundation-utils": "15.28.1-reconnection-issues.1",
95
+ "@genesislcap/rapid-design-system": "15.28.1-reconnection-issues.1",
96
+ "@genesislcap/web-core": "15.28.1-reconnection-issues.1",
97
97
  "dompurify": "^3.3.1",
98
98
  "marked": "^17.0.3"
99
99
  },