@kodaris/krubble-app-components 1.0.144 → 1.0.146
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/chatbot.d.ts +19 -0
- package/dist/chatbot.d.ts.map +1 -1
- package/dist/chatbot.js +14 -0
- package/dist/chatbot.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/krubble-app.bundled.js +29 -2
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +2 -3
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +29 -2
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +4 -5
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +16 -3
- package/dist/scaffold.js.map +1 -1
- package/package.json +1 -1
package/dist/krubble-app.umd.js
CHANGED
|
@@ -3631,6 +3631,20 @@
|
|
|
3631
3631
|
toggle() {
|
|
3632
3632
|
this._handleToggle();
|
|
3633
3633
|
}
|
|
3634
|
+
/**
|
|
3635
|
+
* Open the panel and send `payload.message` as if the user had typed it and pressed Enter.
|
|
3636
|
+
*
|
|
3637
|
+
* Lets a host app hand the assistant a predefined prompt (e.g. a "Migrate" button that
|
|
3638
|
+
* starts a skill for the current record). Goes through `_handleSubmit`, not `_send`, so
|
|
3639
|
+
* the streaming and pending-confirmation guards and the cancelable `message-submit`
|
|
3640
|
+
* event all apply exactly as they do for a typed message. Nothing is sent while a turn
|
|
3641
|
+
* is in flight; the message is dropped rather than queued.
|
|
3642
|
+
*/
|
|
3643
|
+
prompt(payload) {
|
|
3644
|
+
this.open();
|
|
3645
|
+
this._inputValue = payload.message;
|
|
3646
|
+
this._handleSubmit();
|
|
3647
|
+
}
|
|
3634
3648
|
// --- Private methods ---
|
|
3635
3649
|
/**
|
|
3636
3650
|
* Shows a full-viewport transparent overlay during drag/resize operations.
|
|
@@ -9489,6 +9503,17 @@
|
|
|
9489
9503
|
connectedCallback() {
|
|
9490
9504
|
super.connectedCallback();
|
|
9491
9505
|
this.installFetchInterceptor();
|
|
9506
|
+
// Dev only: mount the floating chatbot on document.body with the same id the production
|
|
9507
|
+
// shell gives its <kr-chatbot> (see operationsAppPortalWrapperIndex.ejs). It must live in
|
|
9508
|
+
// light DOM, not this template: apps reach it with document.getElementById('k-ai-chatbot')
|
|
9509
|
+
// to hand it prompts (KRChatbot.prompt), and an element inside this shadow root would be
|
|
9510
|
+
// invisible to that lookup. Same id in both places means apps need no dev/prod branch.
|
|
9511
|
+
if (this.isDev && !document.getElementById('k-ai-chatbot')) {
|
|
9512
|
+
const chatbot = document.createElement('kr-chatbot');
|
|
9513
|
+
chatbot.id = 'k-ai-chatbot';
|
|
9514
|
+
chatbot.hideToggle = true;
|
|
9515
|
+
document.body.appendChild(chatbot);
|
|
9516
|
+
}
|
|
9492
9517
|
}
|
|
9493
9518
|
// Attributes are not reflected into properties until after the first update,
|
|
9494
9519
|
// so loadPref() must run here (not connectedCallback) for user-type to be set.
|
|
@@ -9510,6 +9535,9 @@
|
|
|
9510
9535
|
disconnectedCallback() {
|
|
9511
9536
|
super.disconnectedCallback();
|
|
9512
9537
|
this.uninstallFetchInterceptor();
|
|
9538
|
+
if (this.isDev) {
|
|
9539
|
+
document.getElementById('k-ai-chatbot')?.remove();
|
|
9540
|
+
}
|
|
9513
9541
|
}
|
|
9514
9542
|
/**
|
|
9515
9543
|
* Installs global interceptors for fetch and XMLHttpRequest to track pending HTTP requests.
|
|
@@ -9732,7 +9760,7 @@
|
|
|
9732
9760
|
// Dev only: the footer "AI Assistant" button opens/closes the floating chatbot, mirroring how
|
|
9733
9761
|
// the production shell drives its own hide-toggle chatbot from the footer.
|
|
9734
9762
|
handleDevChatClick() {
|
|
9735
|
-
|
|
9763
|
+
document.getElementById('k-ai-chatbot')?.toggle();
|
|
9736
9764
|
}
|
|
9737
9765
|
/**
|
|
9738
9766
|
* Handles click on the nav header (logo/title) to navigate home.
|
|
@@ -10609,7 +10637,6 @@
|
|
|
10609
10637
|
AI Assistant
|
|
10610
10638
|
</button>
|
|
10611
10639
|
</div>
|
|
10612
|
-
<kr-chatbot hide-toggle></kr-chatbot>
|
|
10613
10640
|
`;
|
|
10614
10641
|
}
|
|
10615
10642
|
return body;
|