@websolutespa/bom-llm 0.0.49 → 0.0.51

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @websolutespa/bom-llm
2
2
 
3
+ ## 0.0.51
4
+
5
+ ### Patch Changes
6
+
7
+ - Added: disclaimer footer & header ctas
8
+
9
+ ## 0.0.50
10
+
11
+ ### Patch Changes
12
+
13
+ - Modified idle timeout
14
+
3
15
  ## 0.0.49
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -23,16 +23,24 @@ type LlmCard = {
23
23
  title: string;
24
24
  message?: string;
25
25
  };
26
+ type LlmLogo = {
27
+ logo: IMedia;
28
+ };
26
29
  type LlmSampleInputText = {
27
- id: string;
30
+ id?: string;
28
31
  sampleInputText: string;
29
32
  };
33
+ type LlmHeaderCta = {
34
+ id?: string;
35
+ title: string;
36
+ href: string;
37
+ target: string;
38
+ icon?: IMedia;
39
+ };
30
40
  type LlmRecognitionMode = ('none' | 'default') & string;
31
41
  type LlmSynthesisMode = ('none' | 'default' | 'elevenlabs') & string;
32
42
  type LlmContents = {
33
- additionalLogos?: {
34
- logo: IMedia;
35
- }[];
43
+ additionalLogos?: LlmLogo[];
36
44
  collapsedWelcomeText?: string;
37
45
  collapsedWelcomeTextCta?: string;
38
46
  collapsedWelcomeTextHover?: string;
@@ -41,6 +49,7 @@ type LlmContents = {
41
49
  disableSpeechRecognition?: boolean;
42
50
  disableSpeechSynthesis?: boolean;
43
51
  disclaimer?: string;
52
+ disclaimerFooter?: boolean;
44
53
  enableUpload?: boolean;
45
54
  extendedWelcomeText?: string;
46
55
  intro?: string;
@@ -50,7 +59,8 @@ type LlmContents = {
50
59
  openingSound?: IMedia;
51
60
  promptPlaceholder?: string;
52
61
  recognitionMode?: LlmRecognitionMode;
53
- sampleInputTexts: LlmSampleInputText[];
62
+ sampleInputTexts?: LlmSampleInputText[];
63
+ headerCtas?: LlmHeaderCta[];
54
64
  shortWelcomeText?: string;
55
65
  synthesisMode?: LlmSynthesisMode;
56
66
  textToSpeechApiKey?: string;
@@ -889,7 +889,6 @@ llm-embed {
889
889
  position: absolute;
890
890
  left: 0;
891
891
  bottom: 0;
892
- padding-bottom: var(--llm-size-5, 2.5rem);
893
892
  width: 100%;
894
893
  z-index: 2;
895
894
  }
@@ -924,6 +923,14 @@ llm-embed {
924
923
  backdrop-filter: blur(20px);
925
924
  background: rgba(255, 255, 255, 0.2);
926
925
  }
926
+ .llm .llm__header.-has-cta .llm__header-back-label {
927
+ display: none;
928
+ }
929
+ @media (min-width: 1024px) {
930
+ .llm .llm__header.-has-cta .llm__header-back-label {
931
+ display: block;
932
+ }
933
+ }
927
934
  .llm .llm__header-wrapper {
928
935
  display: flex;
929
936
  justify-content: space-between;
@@ -1041,6 +1048,92 @@ llm-embed {
1041
1048
  width: auto !important;
1042
1049
  white-space: normal !important;
1043
1050
  }
1051
+ .llm .llm__header-ctas {
1052
+ display: inline-flex;
1053
+ flex-direction: column;
1054
+ align-items: center;
1055
+ gap: var(--llm-size-1, 0.5rem);
1056
+ }
1057
+ @media (min-width: 1024px) {
1058
+ .llm .llm__header-ctas {
1059
+ flex-direction: row;
1060
+ justify-content: center;
1061
+ }
1062
+ }
1063
+ .llm .llm__header-cta {
1064
+ margin: 0;
1065
+ padding: 0;
1066
+ border: none;
1067
+ text-decoration: none;
1068
+ background: none;
1069
+ appearance: none;
1070
+ font-family: inherit;
1071
+ font-style: inherit;
1072
+ font-variant-ligatures: inherit;
1073
+ font-variant-caps: inherit;
1074
+ font-variant-numeric: inherit;
1075
+ font-variant-east-asian: inherit;
1076
+ font-weight: inherit;
1077
+ font-stretch: inherit;
1078
+ text-rendering: inherit;
1079
+ letter-spacing: inherit;
1080
+ word-spacing: inherit;
1081
+ line-height: inherit;
1082
+ text-transform: none;
1083
+ text-indent: inherit;
1084
+ text-shadow: none;
1085
+ text-align: inherit;
1086
+ pointer-events: auto;
1087
+ cursor: pointer;
1088
+ outline: 2px solid transparent;
1089
+ outline-offset: 2px;
1090
+ align-items: center;
1091
+ gap: var(--llm-size-1, 0.5rem);
1092
+ user-select: none;
1093
+ font-weight: 800;
1094
+ padding: var(--llm-header-cta-padding);
1095
+ border-radius: var(--llm-header-cta-border-radius);
1096
+ background: var(--llm-header-cta-background);
1097
+ color: var(--llm-header-cta-foreground);
1098
+ font-size: 14px;
1099
+ display: none;
1100
+ }
1101
+ .llm .llm__header-cta:focus, .llm .llm__header-cta:focus-visible {
1102
+ outline-color: var(--llm-color-outline);
1103
+ }
1104
+ .llm .llm__header-cta:hover {
1105
+ outline-color: color-mix(in srgb, var(--llm-color-outline) 10%, transparent 90%);
1106
+ }
1107
+ .llm .llm__header-cta:active {
1108
+ outline-color: var(--llm-color-accent-foreground);
1109
+ }
1110
+ .llm .llm__header-cta:first-child {
1111
+ display: inline-flex;
1112
+ }
1113
+ @media (min-width: 1024px) {
1114
+ .llm .llm__header-cta {
1115
+ display: inline-flex;
1116
+ font-size: var(--llm-header-cta-font-size);
1117
+ }
1118
+ }
1119
+ .llm .llm__header-cta.-icon {
1120
+ padding-right: 0.8em;
1121
+ }
1122
+ .llm .llm__header-cta i {
1123
+ flex-shrink: 0;
1124
+ line-height: 0;
1125
+ display: block;
1126
+ width: 1em;
1127
+ height: 1em;
1128
+ color: var(--llm-header-cta-foreground, inherit);
1129
+ transition: transform ease-in-out 200ms;
1130
+ }
1131
+ .llm .llm__header-cta i svg {
1132
+ fill: currentColor;
1133
+ }
1134
+ .llm .llm__header-cta:hover i {
1135
+ transform: scale(1.2, 1.2);
1136
+ }
1044
1137
  .llm .llm__header-back {
1045
1138
  margin: 0;
1046
1139
  padding: 0;
@@ -1791,18 +1884,16 @@ llm-embed {
1791
1884
  outline-color: var(--llm-color-accent-foreground);
1792
1885
  }
1793
1886
  .llm .llm__prompt-footer {
1887
+ /*
1794
1888
  position: absolute;
1889
+ right: 0;
1890
+ left: 0;
1891
+ bottom: 0;
1892
+ */
1795
1893
  display: flex;
1796
1894
  justify-content: center;
1797
1895
  align-items: center;
1798
- right: 0;
1799
- left: 0;
1800
- padding: 4px 0 0 0;
1801
- }
1802
- @media (min-width: 1024px) {
1803
- .llm .llm__prompt-footer {
1804
- padding: 6px 0;
1805
- }
1896
+ padding: 10px 15px;
1806
1897
  }
1807
1898
  .llm .llm__prompt-powered-by {
1808
1899
  margin: 0;
@@ -1835,8 +1926,10 @@ llm-embed {
1835
1926
  display: flex;
1836
1927
  justify-content: center;
1837
1928
  align-items: center;
1929
+ white-space: nowrap;
1838
1930
  column-gap: 4px;
1839
1931
  font-size: 11px;
1932
+ line-height: 1.1;
1840
1933
  color: var(--llm-color-foreground);
1841
1934
  opacity: 0.4;
1842
1935
  transition: opacity ease-in-out 250ms;
@@ -1858,6 +1951,18 @@ llm-embed {
1858
1951
  .llm .llm__prompt-powered-by:hover {
1859
1952
  opacity: 1;
1860
1953
  }
1954
+ .llm .llm__prompt-disclaimer {
1955
+ padding: 0 calc(var(--rem, 1rem) * 0.3);
1956
+ font-size: 10px;
1957
+ line-height: 1.1;
1958
+ color: var(--llm-color-foreground);
1959
+ opacity: 0.4;
1960
+ }
1961
+ @media (min-width: 1024px) {
1962
+ .llm .llm__prompt-disclaimer {
1963
+ font-size: 11px;
1964
+ }
1965
+ }
1861
1966
 
1862
1967
  .llm .llm__message--user .llm__text .llm__text-body {
1863
1968
  line-height: 1;
package/dist/umd/index.js CHANGED
@@ -18120,6 +18120,13 @@
18120
18120
  lg: "0 8px 50px -8px rgba(0, 0, 0, 0.6)",
18121
18121
  xl: "0 10px 60px -10px rgba(0, 0, 0, 0.8)"
18122
18122
  };
18123
+ var headerCta = {
18124
+ fontSize: "18px",
18125
+ padding: "0.5em 1em",
18126
+ borderRadius: "2em",
18127
+ background: "var(--llm-color-primary-background)",
18128
+ foreground: "var(--llm-color-primary-foreground)"
18129
+ };
18123
18130
  var theme = {
18124
18131
  mode: mode,
18125
18132
  scale: scale,
@@ -18148,7 +18155,8 @@
18148
18155
  cardVideo: cardVideo,
18149
18156
  product: product,
18150
18157
  productLabel: productLabel,
18151
- shadow: shadow
18158
+ shadow: shadow,
18159
+ headerCta: headerCta
18152
18160
  };
18153
18161
 
18154
18162
  const defaultTheme = theme;
@@ -18274,14 +18282,11 @@ ${Object.entries(vars).map(_ref2 => {
18274
18282
  "extendedWelcomeText": "Ciao, sono l\"Ambasciatore AI di Pesaro2024. Più cose mi dirai su ciò che ti piace, più sarò in grado di aiutarti.",
18275
18283
  "disclaimer": "Le risposte che riceverai sono create automaticamente elaborando sia le informazioni presenti sul nostro sito che altre informazioni presenti sul web. Controlla sempre la correttezza delle informazioni fornite.",
18276
18284
  "sampleInputTexts": [{
18277
- "sampleInputText": "Quali sono gli eventi che posso raggiungere a piedi dalla stazione dei treni?",
18278
- "id": "656095350d5d91982799c3fd"
18285
+ "sampleInputText": "Quali sono gli eventi che posso raggiungere a piedi dalla stazione dei treni?"
18279
18286
  }, {
18280
- "sampleInputText": "Mostra i prossimi eventi di fotografia",
18281
- "id": "6560954e0d5d91982799c3fe"
18287
+ "sampleInputText": "Mostra i prossimi eventi di fotografia"
18282
18288
  }, {
18283
- "sampleInputText": "Chi partecipa a Pesaro2024?",
18284
- "id": "6560955b0d5d91982799c3ff"
18289
+ "sampleInputText": "Chi partecipa a Pesaro2024?"
18285
18290
  }],
18286
18291
  "layoutBuilder": [{
18287
18292
  "icon": {
@@ -18400,14 +18405,11 @@ ${Object.entries(vars).map(_ref2 => {
18400
18405
  "extendedWelcomeText": "Hi, I'm the AI ​​Ambassador of Pesaro2024. The more you tell me about what you like, the more I will be able to help you.",
18401
18406
  "disclaimer": "The answers you will receive are created automatically by processing both the information on our site and other information on the web. Always check the correctness of the information provided.",
18402
18407
  "sampleInputTexts": [{
18403
- "sampleInputText": "What events can I walk to from the train station?",
18404
- "id": "656095350d5d91982799c3fd"
18408
+ "sampleInputText": "What events can I walk to from the train station?"
18405
18409
  }, {
18406
- "sampleInputText": "Shows upcoming photography events",
18407
- "id": "6560954e0d5d91982799c3fe"
18410
+ "sampleInputText": "Shows upcoming photography events"
18408
18411
  }, {
18409
- "sampleInputText": "Who participates in Pesaro2024?",
18410
- "id": "6560955b0d5d91982799c3ff"
18412
+ "sampleInputText": "Who participates in Pesaro2024?"
18411
18413
  }],
18412
18414
  "layoutBuilder": [{
18413
18415
  "icon": {
@@ -22756,7 +22758,7 @@ ${Object.entries(vars).map(_ref2 => {
22756
22758
  set(() => ({
22757
22759
  idle: true
22758
22760
  }));
22759
- }, 6000);
22761
+ }, 8000);
22760
22762
  };
22761
22763
  const handleIdleTimes = () => {
22762
22764
  let to = setIdleTimeout();
@@ -24564,9 +24566,12 @@ void main(void) {
24564
24566
  const logoMini = app?.contents?.logoMini;
24565
24567
  const openingSound = app?.contents?.openingSound;
24566
24568
  const additionalLogos = app?.contents?.additionalLogos;
24569
+ const headerCtas = app?.contents?.headerCtas;
24570
+ const hasHeaderCtas = headerCtas && headerCtas.length > 0;
24567
24571
  const classes = getClassNames('llm__header', {
24568
24572
  hidden,
24569
- fixed
24573
+ fixed,
24574
+ '-has-cta': hasHeaderCtas
24570
24575
  });
24571
24576
  return /*#__PURE__*/jsxRuntimeExports.jsx("nav", {
24572
24577
  className: classes,
@@ -24598,11 +24603,30 @@ void main(void) {
24598
24603
  className: "llm__header-skip",
24599
24604
  children: label('llm.skip')
24600
24605
  }), dismissable && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
24601
- children: [/*#__PURE__*/jsxRuntimeExports.jsxs("button", {
24606
+ children: [hasHeaderCtas && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
24607
+ className: "llm__header-ctas",
24608
+ children: headerCtas.map((x, i) => /*#__PURE__*/jsxRuntimeExports.jsxs("a", {
24609
+ href: x.href,
24610
+ target: x.target || '_blank',
24611
+ className: getClassNames('llm__header-cta', {
24612
+ '-icon': x.icon != null
24613
+ }),
24614
+ children: [x.title, " ", x.icon && /*#__PURE__*/jsxRuntimeExports.jsx("i", {
24615
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("img", {
24616
+ src: x.icon.src || x.icon.url,
24617
+ alt: ""
24618
+ })
24619
+ })]
24620
+ }, i))
24621
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("button", {
24602
24622
  type: "button",
24623
+ "aria-label": label('llm.back'),
24603
24624
  className: "llm__header-back -llm-t-cta3",
24604
24625
  onClick: () => open(),
24605
- children: [label('llm.back'), /*#__PURE__*/jsxRuntimeExports.jsx(IconLlmArrowCornerRightUp, {})]
24626
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
24627
+ className: "llm__header-back-label",
24628
+ children: label('llm.back')
24629
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(IconLlmArrowCornerRightUp, {})]
24606
24630
  }), openingSound && /*#__PURE__*/jsxRuntimeExports.jsx("audio", {
24607
24631
  src: openingSound.src || openingSound.url,
24608
24632
  autoPlay: true,
@@ -30200,7 +30224,7 @@ void main(void) {
30200
30224
  className: "llm__prompt-suggestions",
30201
30225
  children: /*#__PURE__*/jsxRuntimeExports.jsx("div", {
30202
30226
  className: "llm__suggestions",
30203
- children: app?.contents.sampleInputTexts.map((s, j) => /*#__PURE__*/jsxRuntimeExports.jsx("button", {
30227
+ children: app?.contents.sampleInputTexts?.map((s, j) => /*#__PURE__*/jsxRuntimeExports.jsx("button", {
30204
30228
  type: "button",
30205
30229
  className: "llm__pill",
30206
30230
  onClick: () => onClick(s),
@@ -30214,7 +30238,7 @@ void main(void) {
30214
30238
  <section className="llm__prompt-suggestions">
30215
30239
  <div className="llm__suggestions">
30216
30240
  <Swiper {...swiperProps} onInit={swiper => swiper.update()}>
30217
- {app?.contents.sampleInputTexts.map((s, j) => (
30241
+ {app?.contents.sampleInputTexts?.map((s, j) => (
30218
30242
  <SwiperSlide key={j}>
30219
30243
  <button type="button" className="llm__pill" onClick={() => onClick(s)}>
30220
30244
  {s.sampleInputText}
@@ -30274,9 +30298,12 @@ void main(void) {
30274
30298
  const hasSpeechSynthesis = hasSpeechSynthesisSupport();
30275
30299
  const hasSpeechRecognition = hasSpeechRecognitionSupport();
30276
30300
  const hasUpload = hasUploadSupport();
30277
- return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
30301
+ const appDisclaimer = app?.contents.disclaimer;
30302
+ const appDisclaimerFooter = app?.contents.disclaimerFooter;
30303
+ const disclaimer = appDisclaimerFooter ? appDisclaimer || label('llm.disclaimer') : '';
30304
+ return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
30278
30305
  className: "llm__prompt",
30279
- children: /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
30306
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs("div", {
30280
30307
  className: "llm__container",
30281
30308
  children: [messages.length === 0 && /*#__PURE__*/jsxRuntimeExports.jsx(Suggestions, {}), /*#__PURE__*/jsxRuntimeExports.jsx("section", {
30282
30309
  id: "llm-prompt",
@@ -30362,22 +30389,27 @@ void main(void) {
30362
30389
  })]
30363
30390
  })]
30364
30391
  })
30365
- }), /*#__PURE__*/jsxRuntimeExports.jsx("nav", {
30366
- className: "llm__prompt-footer",
30367
- children: /*#__PURE__*/jsxRuntimeExports.jsxs("a", {
30368
- className: "llm__prompt-powered-by",
30369
- href: "https://www.websolute.com/",
30370
- target: "_blank",
30371
- rel: "noreferrer",
30372
- title: "Powered by Websolute",
30373
- children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
30374
- children: "powered by"
30375
- }), " ", /*#__PURE__*/jsxRuntimeExports.jsx(IconWebsolute, {
30376
- "aria-label": "Websolute"
30377
- })]
30378
- })
30379
30392
  })]
30380
- })
30393
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("nav", {
30394
+ className: "llm__prompt-footer",
30395
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs("a", {
30396
+ className: "llm__prompt-powered-by",
30397
+ href: "https://www.websolute.com/",
30398
+ target: "_blank",
30399
+ rel: "noreferrer",
30400
+ title: "Powered by Websolute",
30401
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
30402
+ children: "powered by"
30403
+ }), " ", /*#__PURE__*/jsxRuntimeExports.jsx(IconWebsolute, {
30404
+ "aria-label": "Websolute"
30405
+ })]
30406
+ }), disclaimer && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
30407
+ className: "llm__prompt-disclaimer",
30408
+ dangerouslySetInnerHTML: {
30409
+ __html: disclaimer
30410
+ }
30411
+ })]
30412
+ })]
30381
30413
  });
30382
30414
  };
30383
30415