@runtypelabs/persona 3.8.1 → 3.8.3
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 +16 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +20 -20
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +34 -14
- package/dist/theme-editor.js +34 -14
- package/dist/widget.css +102 -102
- package/package.json +1 -1
- package/src/components/approval-bubble.ts +1 -0
- package/src/components/message-bubble.ts +7 -7
- package/src/components/reasoning-bubble.ts +2 -2
- package/src/components/tool-bubble.ts +2 -2
- package/src/styles/widget.css +102 -102
- package/src/ui.ts +25 -4
package/dist/theme-editor.cjs
CHANGED
|
@@ -9585,19 +9585,19 @@ var createTimestamp = (message, timestampConfig) => {
|
|
|
9585
9585
|
return timestamp;
|
|
9586
9586
|
};
|
|
9587
9587
|
var getBubbleClasses = (role, layout = "bubble") => {
|
|
9588
|
-
const baseClasses = ["
|
|
9588
|
+
const baseClasses = ["persona-message-bubble", "persona-max-w-[85%]"];
|
|
9589
9589
|
switch (layout) {
|
|
9590
9590
|
case "flat":
|
|
9591
9591
|
if (role === "user") {
|
|
9592
9592
|
baseClasses.push(
|
|
9593
|
-
"
|
|
9593
|
+
"persona-message-user-bubble",
|
|
9594
9594
|
"persona-ml-auto",
|
|
9595
9595
|
"persona-text-persona-primary",
|
|
9596
9596
|
"persona-py-2"
|
|
9597
9597
|
);
|
|
9598
9598
|
} else {
|
|
9599
9599
|
baseClasses.push(
|
|
9600
|
-
"
|
|
9600
|
+
"persona-message-assistant-bubble",
|
|
9601
9601
|
"persona-text-persona-primary",
|
|
9602
9602
|
"persona-py-2"
|
|
9603
9603
|
);
|
|
@@ -9610,7 +9610,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9610
9610
|
);
|
|
9611
9611
|
if (role === "user") {
|
|
9612
9612
|
baseClasses.push(
|
|
9613
|
-
"
|
|
9613
|
+
"persona-message-user-bubble",
|
|
9614
9614
|
"persona-ml-auto",
|
|
9615
9615
|
"persona-bg-persona-accent",
|
|
9616
9616
|
"persona-text-white",
|
|
@@ -9620,7 +9620,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9620
9620
|
);
|
|
9621
9621
|
} else {
|
|
9622
9622
|
baseClasses.push(
|
|
9623
|
-
"
|
|
9623
|
+
"persona-message-assistant-bubble",
|
|
9624
9624
|
"persona-bg-persona-surface",
|
|
9625
9625
|
"persona-text-persona-primary",
|
|
9626
9626
|
"persona-px-3",
|
|
@@ -9639,7 +9639,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9639
9639
|
);
|
|
9640
9640
|
if (role === "user") {
|
|
9641
9641
|
baseClasses.push(
|
|
9642
|
-
"
|
|
9642
|
+
"persona-message-user-bubble",
|
|
9643
9643
|
"persona-ml-auto",
|
|
9644
9644
|
"persona-bg-persona-accent",
|
|
9645
9645
|
"persona-text-white",
|
|
@@ -9648,7 +9648,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9648
9648
|
);
|
|
9649
9649
|
} else {
|
|
9650
9650
|
baseClasses.push(
|
|
9651
|
-
"
|
|
9651
|
+
"persona-message-assistant-bubble",
|
|
9652
9652
|
"persona-bg-persona-surface",
|
|
9653
9653
|
"persona-border",
|
|
9654
9654
|
"persona-border-persona-message-border",
|
|
@@ -9844,8 +9844,8 @@ var createReasoningBubble = (message) => {
|
|
|
9844
9844
|
const bubble = createElement(
|
|
9845
9845
|
"div",
|
|
9846
9846
|
[
|
|
9847
|
-
"
|
|
9848
|
-
"
|
|
9847
|
+
"persona-message-bubble",
|
|
9848
|
+
"persona-reasoning-bubble",
|
|
9849
9849
|
"persona-w-full",
|
|
9850
9850
|
"persona-max-w-[85%]",
|
|
9851
9851
|
"persona-rounded-2xl",
|
|
@@ -9956,8 +9956,8 @@ var createToolBubble = (message, config) => {
|
|
|
9956
9956
|
const bubble = createElement(
|
|
9957
9957
|
"div",
|
|
9958
9958
|
[
|
|
9959
|
-
"
|
|
9960
|
-
"
|
|
9959
|
+
"persona-message-bubble",
|
|
9960
|
+
"persona-tool-bubble",
|
|
9961
9961
|
"persona-w-full",
|
|
9962
9962
|
"persona-max-w-[85%]",
|
|
9963
9963
|
"persona-rounded-2xl",
|
|
@@ -10179,6 +10179,7 @@ var createApprovalBubble = (message, config) => {
|
|
|
10179
10179
|
const bubble = createElement(
|
|
10180
10180
|
"div",
|
|
10181
10181
|
[
|
|
10182
|
+
"persona-approval-bubble",
|
|
10182
10183
|
"persona-w-full",
|
|
10183
10184
|
"persona-max-w-[85%]",
|
|
10184
10185
|
"persona-rounded-2xl",
|
|
@@ -13481,6 +13482,9 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13481
13482
|
selectedModelId: composerCfg == null ? void 0 : composerCfg.selectedModelId,
|
|
13482
13483
|
onModelChange: (modelId) => {
|
|
13483
13484
|
config.composer = { ...config.composer, selectedModelId: modelId };
|
|
13485
|
+
if (config.agent) {
|
|
13486
|
+
config.agent = { ...config.agent, model: modelId };
|
|
13487
|
+
}
|
|
13484
13488
|
},
|
|
13485
13489
|
onVoiceToggle: ((_A = config.voiceRecognition) == null ? void 0 : _A.enabled) === true ? () => {
|
|
13486
13490
|
composerVoiceBridge == null ? void 0 : composerVoiceBridge();
|
|
@@ -13527,6 +13531,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13527
13531
|
composerForm.style.marginLeft = "auto";
|
|
13528
13532
|
composerForm.style.marginRight = "auto";
|
|
13529
13533
|
}
|
|
13534
|
+
if (contentMaxWidth && suggestions) {
|
|
13535
|
+
suggestions.style.maxWidth = contentMaxWidth;
|
|
13536
|
+
suggestions.style.marginLeft = "auto";
|
|
13537
|
+
suggestions.style.marginRight = "auto";
|
|
13538
|
+
}
|
|
13530
13539
|
if (contentMaxWidth && attachmentPreviewsContainer) {
|
|
13531
13540
|
attachmentPreviewsContainer.style.maxWidth = contentMaxWidth;
|
|
13532
13541
|
attachmentPreviewsContainer.style.marginLeft = "auto";
|
|
@@ -13624,7 +13633,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13624
13633
|
const target = event.target;
|
|
13625
13634
|
const headerButton = target.closest('button[data-expand-header="true"]');
|
|
13626
13635
|
if (!headerButton) return;
|
|
13627
|
-
const bubble = headerButton.closest(".
|
|
13636
|
+
const bubble = headerButton.closest(".persona-reasoning-bubble, .persona-tool-bubble");
|
|
13628
13637
|
if (!bubble) return;
|
|
13629
13638
|
const messageId = bubble.getAttribute("data-message-id");
|
|
13630
13639
|
if (!messageId) return;
|
|
@@ -13644,6 +13653,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13644
13653
|
}
|
|
13645
13654
|
updateToolBubbleUI(messageId, bubble, config);
|
|
13646
13655
|
}
|
|
13656
|
+
messageCache.delete(messageId);
|
|
13647
13657
|
};
|
|
13648
13658
|
messagesWrapper.addEventListener("pointerdown", (event) => {
|
|
13649
13659
|
const target = event.target;
|
|
@@ -13731,7 +13741,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13731
13741
|
if (!approvalButton) return;
|
|
13732
13742
|
event.preventDefault();
|
|
13733
13743
|
event.stopPropagation();
|
|
13734
|
-
const approvalBubble = approvalButton.closest(".
|
|
13744
|
+
const approvalBubble = approvalButton.closest(".persona-approval-bubble");
|
|
13735
13745
|
if (!approvalBubble) return;
|
|
13736
13746
|
const messageId = approvalBubble.getAttribute("data-message-id");
|
|
13737
13747
|
if (!messageId) return;
|
|
@@ -14631,7 +14641,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14631
14641
|
if (wrapChrome) {
|
|
14632
14642
|
const componentWrapper = document.createElement("div");
|
|
14633
14643
|
componentWrapper.className = [
|
|
14634
|
-
"
|
|
14644
|
+
"persona-message-bubble",
|
|
14635
14645
|
"persona-max-w-[85%]",
|
|
14636
14646
|
"persona-rounded-2xl",
|
|
14637
14647
|
"persona-bg-persona-surface",
|
|
@@ -16729,6 +16739,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16729
16739
|
composerForm.style.marginLeft = "auto";
|
|
16730
16740
|
composerForm.style.marginRight = "auto";
|
|
16731
16741
|
}
|
|
16742
|
+
if (suggestions) {
|
|
16743
|
+
suggestions.style.maxWidth = updatedContentMaxWidth;
|
|
16744
|
+
suggestions.style.marginLeft = "auto";
|
|
16745
|
+
suggestions.style.marginRight = "auto";
|
|
16746
|
+
}
|
|
16732
16747
|
} else {
|
|
16733
16748
|
messagesWrapper.style.maxWidth = "";
|
|
16734
16749
|
messagesWrapper.style.marginLeft = "";
|
|
@@ -16739,6 +16754,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16739
16754
|
composerForm.style.marginLeft = "";
|
|
16740
16755
|
composerForm.style.marginRight = "";
|
|
16741
16756
|
}
|
|
16757
|
+
if (suggestions) {
|
|
16758
|
+
suggestions.style.maxWidth = "";
|
|
16759
|
+
suggestions.style.marginLeft = "";
|
|
16760
|
+
suggestions.style.marginRight = "";
|
|
16761
|
+
}
|
|
16742
16762
|
}
|
|
16743
16763
|
const statusIndicatorConfig = (_Qa = config.statusIndicator) != null ? _Qa : {};
|
|
16744
16764
|
const isVisible = (_Ra = statusIndicatorConfig.visible) != null ? _Ra : true;
|
package/dist/theme-editor.js
CHANGED
|
@@ -9480,19 +9480,19 @@ var createTimestamp = (message, timestampConfig) => {
|
|
|
9480
9480
|
return timestamp;
|
|
9481
9481
|
};
|
|
9482
9482
|
var getBubbleClasses = (role, layout = "bubble") => {
|
|
9483
|
-
const baseClasses = ["
|
|
9483
|
+
const baseClasses = ["persona-message-bubble", "persona-max-w-[85%]"];
|
|
9484
9484
|
switch (layout) {
|
|
9485
9485
|
case "flat":
|
|
9486
9486
|
if (role === "user") {
|
|
9487
9487
|
baseClasses.push(
|
|
9488
|
-
"
|
|
9488
|
+
"persona-message-user-bubble",
|
|
9489
9489
|
"persona-ml-auto",
|
|
9490
9490
|
"persona-text-persona-primary",
|
|
9491
9491
|
"persona-py-2"
|
|
9492
9492
|
);
|
|
9493
9493
|
} else {
|
|
9494
9494
|
baseClasses.push(
|
|
9495
|
-
"
|
|
9495
|
+
"persona-message-assistant-bubble",
|
|
9496
9496
|
"persona-text-persona-primary",
|
|
9497
9497
|
"persona-py-2"
|
|
9498
9498
|
);
|
|
@@ -9505,7 +9505,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9505
9505
|
);
|
|
9506
9506
|
if (role === "user") {
|
|
9507
9507
|
baseClasses.push(
|
|
9508
|
-
"
|
|
9508
|
+
"persona-message-user-bubble",
|
|
9509
9509
|
"persona-ml-auto",
|
|
9510
9510
|
"persona-bg-persona-accent",
|
|
9511
9511
|
"persona-text-white",
|
|
@@ -9515,7 +9515,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9515
9515
|
);
|
|
9516
9516
|
} else {
|
|
9517
9517
|
baseClasses.push(
|
|
9518
|
-
"
|
|
9518
|
+
"persona-message-assistant-bubble",
|
|
9519
9519
|
"persona-bg-persona-surface",
|
|
9520
9520
|
"persona-text-persona-primary",
|
|
9521
9521
|
"persona-px-3",
|
|
@@ -9534,7 +9534,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9534
9534
|
);
|
|
9535
9535
|
if (role === "user") {
|
|
9536
9536
|
baseClasses.push(
|
|
9537
|
-
"
|
|
9537
|
+
"persona-message-user-bubble",
|
|
9538
9538
|
"persona-ml-auto",
|
|
9539
9539
|
"persona-bg-persona-accent",
|
|
9540
9540
|
"persona-text-white",
|
|
@@ -9543,7 +9543,7 @@ var getBubbleClasses = (role, layout = "bubble") => {
|
|
|
9543
9543
|
);
|
|
9544
9544
|
} else {
|
|
9545
9545
|
baseClasses.push(
|
|
9546
|
-
"
|
|
9546
|
+
"persona-message-assistant-bubble",
|
|
9547
9547
|
"persona-bg-persona-surface",
|
|
9548
9548
|
"persona-border",
|
|
9549
9549
|
"persona-border-persona-message-border",
|
|
@@ -9739,8 +9739,8 @@ var createReasoningBubble = (message) => {
|
|
|
9739
9739
|
const bubble = createElement(
|
|
9740
9740
|
"div",
|
|
9741
9741
|
[
|
|
9742
|
-
"
|
|
9743
|
-
"
|
|
9742
|
+
"persona-message-bubble",
|
|
9743
|
+
"persona-reasoning-bubble",
|
|
9744
9744
|
"persona-w-full",
|
|
9745
9745
|
"persona-max-w-[85%]",
|
|
9746
9746
|
"persona-rounded-2xl",
|
|
@@ -9851,8 +9851,8 @@ var createToolBubble = (message, config) => {
|
|
|
9851
9851
|
const bubble = createElement(
|
|
9852
9852
|
"div",
|
|
9853
9853
|
[
|
|
9854
|
-
"
|
|
9855
|
-
"
|
|
9854
|
+
"persona-message-bubble",
|
|
9855
|
+
"persona-tool-bubble",
|
|
9856
9856
|
"persona-w-full",
|
|
9857
9857
|
"persona-max-w-[85%]",
|
|
9858
9858
|
"persona-rounded-2xl",
|
|
@@ -10074,6 +10074,7 @@ var createApprovalBubble = (message, config) => {
|
|
|
10074
10074
|
const bubble = createElement(
|
|
10075
10075
|
"div",
|
|
10076
10076
|
[
|
|
10077
|
+
"persona-approval-bubble",
|
|
10077
10078
|
"persona-w-full",
|
|
10078
10079
|
"persona-max-w-[85%]",
|
|
10079
10080
|
"persona-rounded-2xl",
|
|
@@ -13376,6 +13377,9 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13376
13377
|
selectedModelId: composerCfg == null ? void 0 : composerCfg.selectedModelId,
|
|
13377
13378
|
onModelChange: (modelId) => {
|
|
13378
13379
|
config.composer = { ...config.composer, selectedModelId: modelId };
|
|
13380
|
+
if (config.agent) {
|
|
13381
|
+
config.agent = { ...config.agent, model: modelId };
|
|
13382
|
+
}
|
|
13379
13383
|
},
|
|
13380
13384
|
onVoiceToggle: ((_A = config.voiceRecognition) == null ? void 0 : _A.enabled) === true ? () => {
|
|
13381
13385
|
composerVoiceBridge == null ? void 0 : composerVoiceBridge();
|
|
@@ -13422,6 +13426,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13422
13426
|
composerForm.style.marginLeft = "auto";
|
|
13423
13427
|
composerForm.style.marginRight = "auto";
|
|
13424
13428
|
}
|
|
13429
|
+
if (contentMaxWidth && suggestions) {
|
|
13430
|
+
suggestions.style.maxWidth = contentMaxWidth;
|
|
13431
|
+
suggestions.style.marginLeft = "auto";
|
|
13432
|
+
suggestions.style.marginRight = "auto";
|
|
13433
|
+
}
|
|
13425
13434
|
if (contentMaxWidth && attachmentPreviewsContainer) {
|
|
13426
13435
|
attachmentPreviewsContainer.style.maxWidth = contentMaxWidth;
|
|
13427
13436
|
attachmentPreviewsContainer.style.marginLeft = "auto";
|
|
@@ -13519,7 +13528,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13519
13528
|
const target = event.target;
|
|
13520
13529
|
const headerButton = target.closest('button[data-expand-header="true"]');
|
|
13521
13530
|
if (!headerButton) return;
|
|
13522
|
-
const bubble = headerButton.closest(".
|
|
13531
|
+
const bubble = headerButton.closest(".persona-reasoning-bubble, .persona-tool-bubble");
|
|
13523
13532
|
if (!bubble) return;
|
|
13524
13533
|
const messageId = bubble.getAttribute("data-message-id");
|
|
13525
13534
|
if (!messageId) return;
|
|
@@ -13539,6 +13548,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13539
13548
|
}
|
|
13540
13549
|
updateToolBubbleUI(messageId, bubble, config);
|
|
13541
13550
|
}
|
|
13551
|
+
messageCache.delete(messageId);
|
|
13542
13552
|
};
|
|
13543
13553
|
messagesWrapper.addEventListener("pointerdown", (event) => {
|
|
13544
13554
|
const target = event.target;
|
|
@@ -13626,7 +13636,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
13626
13636
|
if (!approvalButton) return;
|
|
13627
13637
|
event.preventDefault();
|
|
13628
13638
|
event.stopPropagation();
|
|
13629
|
-
const approvalBubble = approvalButton.closest(".
|
|
13639
|
+
const approvalBubble = approvalButton.closest(".persona-approval-bubble");
|
|
13630
13640
|
if (!approvalBubble) return;
|
|
13631
13641
|
const messageId = approvalBubble.getAttribute("data-message-id");
|
|
13632
13642
|
if (!messageId) return;
|
|
@@ -14526,7 +14536,7 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
14526
14536
|
if (wrapChrome) {
|
|
14527
14537
|
const componentWrapper = document.createElement("div");
|
|
14528
14538
|
componentWrapper.className = [
|
|
14529
|
-
"
|
|
14539
|
+
"persona-message-bubble",
|
|
14530
14540
|
"persona-max-w-[85%]",
|
|
14531
14541
|
"persona-rounded-2xl",
|
|
14532
14542
|
"persona-bg-persona-surface",
|
|
@@ -16624,6 +16634,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16624
16634
|
composerForm.style.marginLeft = "auto";
|
|
16625
16635
|
composerForm.style.marginRight = "auto";
|
|
16626
16636
|
}
|
|
16637
|
+
if (suggestions) {
|
|
16638
|
+
suggestions.style.maxWidth = updatedContentMaxWidth;
|
|
16639
|
+
suggestions.style.marginLeft = "auto";
|
|
16640
|
+
suggestions.style.marginRight = "auto";
|
|
16641
|
+
}
|
|
16627
16642
|
} else {
|
|
16628
16643
|
messagesWrapper.style.maxWidth = "";
|
|
16629
16644
|
messagesWrapper.style.marginLeft = "";
|
|
@@ -16634,6 +16649,11 @@ var createAgentExperience = (mount, initialConfig, runtimeOptions) => {
|
|
|
16634
16649
|
composerForm.style.marginLeft = "";
|
|
16635
16650
|
composerForm.style.marginRight = "";
|
|
16636
16651
|
}
|
|
16652
|
+
if (suggestions) {
|
|
16653
|
+
suggestions.style.maxWidth = "";
|
|
16654
|
+
suggestions.style.marginLeft = "";
|
|
16655
|
+
suggestions.style.marginRight = "";
|
|
16656
|
+
}
|
|
16637
16657
|
}
|
|
16638
16658
|
const statusIndicatorConfig = (_Qa = config.statusIndicator) != null ? _Qa : {};
|
|
16639
16659
|
const isVisible = (_Ra = statusIndicatorConfig.visible) != null ? _Ra : true;
|