@websolutespa/bom-llm 0.0.47 → 0.0.49

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.49
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: theme & styles
8
+
9
+ ## 0.0.48
10
+
11
+ ### Patch Changes
12
+
13
+ - Fixing: decodeMessages
14
+
3
15
  ## 0.0.47
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ type IMedia = Record<string, unknown> & {
17
17
  type LlmCard = {
18
18
  id?: string;
19
19
  blockType?: string;
20
+ blockName?: string;
20
21
  icon?: IMedia;
21
22
  body: string;
22
23
  title: string;
@@ -810,8 +810,8 @@ llm-embed {
810
810
  position: relative;
811
811
  pointer-events: auto;
812
812
  inset: 0;
813
- background: var(--llm-color-background);
814
- color: var(--llm-color-foreground);
813
+ background: var(--llm-main-background);
814
+ color: var(--llm-main-foreground);
815
815
  }
816
816
  .llm .llm__content {
817
817
  position: relative;
@@ -822,6 +822,15 @@ llm-embed {
822
822
  width: 100%;
823
823
  overflow: hidden;
824
824
  }
825
+ .llm .llm__underlay {
826
+ position: absolute;
827
+ left: 0;
828
+ width: 100%;
829
+ bottom: 0;
830
+ height: 240px;
831
+ background: linear-gradient(transparent, var(--llm-main-background), var(--llm-main-background));
832
+ pointer-events: none;
833
+ }
825
834
  .llm.-embedded .llm__main {
826
835
  width: 100%;
827
836
  height: 100%;
@@ -849,12 +858,12 @@ llm-embed {
849
858
  }
850
859
  .llm:not(.-embedded) .llm__content {
851
860
  padding-top: 100px;
852
- padding-bottom: calc(100vh - 240px);
861
+ padding-bottom: min(256px, 40dvh);
853
862
  }
854
863
  @media (min-width: 1024px) {
855
864
  .llm:not(.-embedded) .llm__content {
856
865
  padding-top: 200px;
857
- padding-bottom: calc(100vh - 240px);
866
+ padding-bottom: min(256px, 40dvh);
858
867
  }
859
868
  }
860
869
  .llm:not(.-embedded).-custom-intro .llm__content {
@@ -1225,6 +1234,7 @@ llm-embed {
1225
1234
  color: var(--llm-hint-foreground);
1226
1235
  border: var(--llm-hint-border);
1227
1236
  font-family: var(--llm-hint-font-family);
1237
+ box-shadow: var(--llm-hint-box-shadow);
1228
1238
  backdrop-filter: blur(20px);
1229
1239
  }
1230
1240
  .llm .llm__hint:focus, .llm .llm__hint:focus-visible {
@@ -1243,11 +1253,17 @@ llm-embed {
1243
1253
  }
1244
1254
  .llm .llm__hint-title {
1245
1255
  display: flex;
1246
- align-items: center;
1247
1256
  gap: var(--llm-size-2, 1rem);
1248
1257
  text-transform: uppercase;
1249
1258
  color: var(--llm-hint-title-color, inherit);
1250
1259
  }
1260
+ .llm .llm__hint-title.row {
1261
+ flex-direction: row;
1262
+ align-items: center;
1263
+ }
1264
+ .llm .llm__hint-title.column {
1265
+ flex-direction: column;
1266
+ }
1251
1267
  .llm .llm__hint-title i {
1252
1268
  flex-shrink: 0;
1253
1269
  display: block;
@@ -1271,7 +1287,7 @@ llm-embed {
1271
1287
  .llm .llm__prompt-input {
1272
1288
  position: relative;
1273
1289
  box-shadow: var(--llm-shadow-xs);
1274
- border-radius: 8px;
1290
+ border-radius: var(--llm-input-border-radius, 8px);
1275
1291
  overflow: visible;
1276
1292
  background: var(--llm-input-background);
1277
1293
  width: 100%;
@@ -1334,7 +1350,7 @@ llm-embed {
1334
1350
  font-family: var(--llm-input-font-family);
1335
1351
  font-size: calc(var(--rem, 1rem) * 1);
1336
1352
  line-height: 1.3;
1337
- border-radius: 8px;
1353
+ border-radius: var(--llm-input-border-radius, 8px);
1338
1354
  background: transparent;
1339
1355
  color: var(--llm-input-foreground);
1340
1356
  pointer-events: auto;
@@ -1546,11 +1562,11 @@ llm-embed {
1546
1562
  align-items: center;
1547
1563
  column-gap: 0.35em;
1548
1564
  padding: 0.2em 1em;
1549
- border-radius: 8px;
1550
1565
  margin-bottom: 0.3rem;
1551
1566
  font-size: 12px;
1552
1567
  background: var(--llm-pill-background);
1553
1568
  color: var(--llm-pill-foreground);
1569
+ border-radius: 8px;
1554
1570
  backdrop-filter: blur(20px);
1555
1571
  }
1556
1572
  .llm .llm__prompt-upload-file:focus, .llm .llm__prompt-upload-file:focus-visible {
@@ -1626,8 +1642,8 @@ llm-embed {
1626
1642
  display: flex;
1627
1643
  align-items: center;
1628
1644
  justify-content: center;
1629
- background: var(--llm-trigger-background);
1630
- color: var(--llm-trigger-foreground);
1645
+ background: var(--llm-prompt-submit-background);
1646
+ color: var(--llm-prompt-submit-foreground);
1631
1647
  border-radius: 50%;
1632
1648
  }
1633
1649
  .llm .llm__prompt-submit:focus, .llm .llm__prompt-submit:focus-visible, .llm .llm__prompt-stop:focus, .llm .llm__prompt-stop:focus-visible {
@@ -1756,9 +1772,9 @@ llm-embed {
1756
1772
  line-height: var(--llm-typography-cta2-line-height);
1757
1773
  letter-spacing: var(--llm-typography-cta2-letter-spacing);
1758
1774
  font-size: clamp(var(--llm-typography-cta2-font-size-min) * 1px * var(--s, 1), var(--llm-typography-cta2-font-size-min) * 1px * var(--s, 1) + (var(--u, 1vw) * 100 - 375px) / 1545 * (var(--llm-typography-cta2-font-size-max) - var(--llm-typography-cta2-font-size-min)) * var(--s, 1), var(--llm-typography-cta2-font-size-max) * 1px * var(--s, 1));
1759
- padding: var(--llm-size-1, 0.5rem);
1760
- border-radius: var(--llm-pill-border-radius);
1775
+ padding: var(--llm-pill-padding, 8px);
1761
1776
  border: var(--llm-pill-border);
1777
+ border-radius: var(--llm-pill-border-radius);
1762
1778
  background: var(--llm-pill-background);
1763
1779
  color: var(--llm-pill-foreground);
1764
1780
  font-family: var(--llm-pill-font-family);
package/dist/umd/index.js CHANGED
@@ -17998,6 +17998,10 @@
17998
17998
  error: "#ff4848"
17999
17999
  };
18000
18000
  var border = "1px solid var(--llm-color-neutral-200)";
18001
+ var main = {
18002
+ background: "var(--llm-color-background)",
18003
+ foreground: "var(--llm-color-foreground)"
18004
+ };
18001
18005
  var canvas = {
18002
18006
  opacity: 0.8,
18003
18007
  enabled: true
@@ -18034,9 +18038,11 @@
18034
18038
  background: "linear-gradient(rgba(154, 154, 154, 0.2) 10%, rgba(221, 221, 221, 0.1) 80%)",
18035
18039
  foreground: "var(--llm-color-foreground)",
18036
18040
  border: "1px solid rgba(237, 237, 237, 0.3)",
18037
- borderRadius: "12px"
18041
+ borderRadius: "12px",
18042
+ boxShadow: "none"
18038
18043
  };
18039
18044
  var hintTitle = {
18045
+ flexDirection: "row",
18040
18046
  color: "var(--llm-color-foreground)"
18041
18047
  };
18042
18048
  var hintIcon = {
@@ -18045,6 +18051,7 @@
18045
18051
  color: "var(--llm-color-foreground)"
18046
18052
  };
18047
18053
  var pill = {
18054
+ padding: "8px",
18048
18055
  fontFamily: "var(--llm-font-primary)",
18049
18056
  background: "rgba(255, 255, 255, 0.2)",
18050
18057
  foreground: "var(--llm-color-title-foreground)",
@@ -18055,7 +18062,12 @@
18055
18062
  fontFamily: "var(--llm-font-secondary)",
18056
18063
  background: "var(--llm-color-neutral-100)",
18057
18064
  foreground: "var(--llm-color-neutral-900)",
18058
- accent: "var(--llm-color-base-100)"
18065
+ accent: "var(--llm-color-base-100)",
18066
+ borderRadius: "8px"
18067
+ };
18068
+ var promptSubmit = {
18069
+ background: "var(--llm-trigger-background)",
18070
+ foreground: "var(--llm-trigger-foreground)"
18059
18071
  };
18060
18072
  var checkbox = {
18061
18073
  border: "2px solid var(--llm-color-neutral-100)"
@@ -18115,6 +18127,7 @@
18115
18127
  typography: typography,
18116
18128
  color: color,
18117
18129
  border: border,
18130
+ main: main,
18118
18131
  canvas: canvas,
18119
18132
  chat: chat,
18120
18133
  trigger: trigger$1,
@@ -18125,6 +18138,7 @@
18125
18138
  hintIcon: hintIcon,
18126
18139
  pill: pill,
18127
18140
  input: input,
18141
+ promptSubmit: promptSubmit,
18128
18142
  checkbox: checkbox,
18129
18143
  user: user,
18130
18144
  assistant: assistant,
@@ -19238,22 +19252,23 @@ ${Object.entries(vars).map(_ref2 => {
19238
19252
  chunks: x.content.map(x => this.decodeChunk(x))
19239
19253
  };
19240
19254
  } else {
19241
- /*
19242
- if (x.role === 'user') {
19243
- return ({
19244
- ...x,
19245
- chunks: [{
19246
- type: 'text',
19247
- text: x.content,
19248
- }],
19249
- });
19250
- }
19251
- */
19252
19255
  this.lastUnparsedText = '';
19253
- return {
19256
+ const message = {
19254
19257
  ...x,
19255
19258
  chunks: this.chunksToChunkItems(this.textToChunks(x.content))
19256
19259
  };
19260
+ if (message.chunks.length === 0) {
19261
+ const chunk = {
19262
+ type: 'text',
19263
+ text: x.content
19264
+ };
19265
+ return {
19266
+ ...x,
19267
+ chunks: [chunk],
19268
+ content: [chunk]
19269
+ };
19270
+ }
19271
+ return message;
19257
19272
  }
19258
19273
  });
19259
19274
  }
@@ -29822,7 +29837,7 @@ void main(void) {
29822
29837
  const {
29823
29838
  width
29824
29839
  } = useWindowSize();
29825
- useLlm(state => state.app);
29840
+ const theme = useLlm(state => state.theme);
29826
29841
  const {
29827
29842
  send
29828
29843
  } = useLlmView(state => state.actions);
@@ -29840,12 +29855,13 @@ void main(void) {
29840
29855
  });
29841
29856
  };
29842
29857
  const getCard = (item, index) => {
29858
+ const direction = theme.hintTitle.flexDirection || 'row';
29843
29859
  return /*#__PURE__*/jsxRuntimeExports.jsxs("button", {
29844
29860
  type: "button",
29845
29861
  className: "llm__hint",
29846
29862
  onClick: () => onClick(item),
29847
29863
  children: [/*#__PURE__*/jsxRuntimeExports.jsxs("div", {
29848
- className: "llm__hint-title -llm-t-label1",
29864
+ className: getClassNames('llm__hint-title -llm-t-label1', direction),
29849
29865
  children: [item.icon && /*#__PURE__*/jsxRuntimeExports.jsx("i", {
29850
29866
  children: /*#__PURE__*/jsxRuntimeExports.jsx("img", {
29851
29867
  src: item.icon.src || item.icon.url,
@@ -30127,11 +30143,15 @@ void main(void) {
30127
30143
  }), extendedWelcomeText && (embedded ? /*#__PURE__*/jsxRuntimeExports.jsx(motion.h2, {
30128
30144
  variants: motionItem,
30129
30145
  className: "llm__intro-title -llm-t-display2",
30130
- children: extendedWelcomeText
30146
+ dangerouslySetInnerHTML: {
30147
+ __html: extendedWelcomeText
30148
+ }
30131
30149
  }) : /*#__PURE__*/jsxRuntimeExports.jsx(motion.h1, {
30132
30150
  variants: motionItem,
30133
30151
  className: "llm__intro-title -llm-t-display2",
30134
- children: extendedWelcomeText
30152
+ dangerouslySetInnerHTML: {
30153
+ __html: extendedWelcomeText
30154
+ }
30135
30155
  }))]
30136
30156
  }), hints.length > 0 && /*#__PURE__*/jsxRuntimeExports.jsx(motion.div, {
30137
30157
  variants: motionItem,
@@ -33649,6 +33669,7 @@ void main(void) {
33649
33669
 
33650
33670
  const Main = () => {
33651
33671
  const app = useLlm(state => state.app);
33672
+ const theme = useLlm(state => state.theme);
33652
33673
  const messages = useLlm(state => state.messages);
33653
33674
  const introed = useLlmView(state => state.introed);
33654
33675
  const visible = useLlmView(state => state.visible);
@@ -33734,13 +33755,18 @@ void main(void) {
33734
33755
  className: "llm__content",
33735
33756
  children: [/*#__PURE__*/jsxRuntimeExports.jsx(Intro, {}), messages && messages.length > 0 && /*#__PURE__*/jsxRuntimeExports.jsx(Thread, {})]
33736
33757
  })
33737
- }), shouldShowPrompt && /*#__PURE__*/jsxRuntimeExports.jsx(motion.main, {
33738
- className: "llm__bottom",
33739
- variants: slideIn(1),
33740
- initial: "hidden",
33741
- animate: "show",
33742
- exit: "exit",
33743
- children: /*#__PURE__*/jsxRuntimeExports.jsx(Prompt, {})
33758
+ }), shouldShowPrompt && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
33759
+ children: [app && !theme.canvas.enabled && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
33760
+ className: "llm__underlay",
33761
+ "aria-hidden": true
33762
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(motion.main, {
33763
+ className: "llm__bottom",
33764
+ variants: slideIn(1),
33765
+ initial: "hidden",
33766
+ animate: "show",
33767
+ exit: "exit",
33768
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(Prompt, {})
33769
+ })]
33744
33770
  })]
33745
33771
  }, "main-container");
33746
33772
  };