lisichatbot 2.2.4 → 2.2.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +18 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -3653,6 +3653,23 @@ function init(flowName, flowConfig, options = {}) {
3653
3653
  if (flowConfig.config) {
3654
3654
  Object.assign(config, flowConfig.config);
3655
3655
  }
3656
+
3657
+ // Inject mobile breakpoint styles if configured
3658
+ if (config.mobileBreakpoint) {
3659
+ const mobileStyleId = 'cf-mobile-styles';
3660
+ let mobileStyle = document.getElementById(mobileStyleId);
3661
+ if (mobileStyle) mobileStyle.remove();
3662
+ mobileStyle = document.createElement('style');
3663
+ mobileStyle.id = mobileStyleId;
3664
+ mobileStyle.textContent = `
3665
+ @media (max-width: ${config.mobileBreakpoint}px) {
3666
+ [data-chat-element="user-message-wrapper"] {
3667
+ margin-bottom: 0.375rem !important;
3668
+ }
3669
+ }
3670
+ `;
3671
+ document.head.appendChild(mobileStyle);
3672
+ }
3656
3673
 
3657
3674
  if (flowConfig.customRangeErrors) {
3658
3675
  // console.log('✅ Using custom range errors from flow object');
@@ -4003,7 +4020,7 @@ function injectStyles() {
4003
4020
  style.id = styleId;
4004
4021
  style.textContent = `
4005
4022
  [data-chat-element="user-message-wrapper"] {
4006
- margin-bottom: 0px;
4023
+ margin-bottom: 16px;
4007
4024
  display: inline-flex;
4008
4025
  max-width: 70%;
4009
4026
  align-self: flex-end;