@websolutespa/bom-llm 2.0.3 → 2.0.4

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/umd/index.js CHANGED
@@ -19901,6 +19901,7 @@
19901
19901
  opened,
19902
19902
  embedded,
19903
19903
  portal,
19904
+ clear,
19904
19905
  send,
19905
19906
  setEmbed,
19906
19907
  setCurrentContext
@@ -20072,10 +20073,15 @@
20072
20073
  const opened = !state.opened;
20073
20074
  if (opened) {
20074
20075
  state.openingContext = openingContext;
20075
- setCurrentContext(openingContext ? {
20076
- context: openingContext,
20077
- title: 'opening-context'
20078
- } : undefined);
20076
+ if (openingContext) {
20077
+ clear();
20078
+ setCurrentContext({
20079
+ context: openingContext,
20080
+ title: 'opening-context'
20081
+ });
20082
+ } else {
20083
+ setCurrentContext();
20084
+ }
20079
20085
  }
20080
20086
  pushDataLayer({
20081
20087
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close',
@@ -20099,10 +20105,15 @@
20099
20105
  set(state => {
20100
20106
  if (opened) {
20101
20107
  state.openingContext = openingContext;
20102
- setCurrentContext(openingContext ? {
20103
- context: openingContext,
20104
- title: 'opening-context'
20105
- } : undefined);
20108
+ if (openingContext) {
20109
+ clear();
20110
+ setCurrentContext({
20111
+ context: openingContext,
20112
+ title: 'opening-context'
20113
+ });
20114
+ } else {
20115
+ setCurrentContext();
20116
+ }
20106
20117
  }
20107
20118
  pushDataLayer({
20108
20119
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close',
@@ -20172,6 +20183,7 @@
20172
20183
  ...props
20173
20184
  } = _ref2;
20174
20185
  const {
20186
+ clear,
20175
20187
  send,
20176
20188
  setEmbed,
20177
20189
  setCurrentContext
@@ -20180,6 +20192,7 @@
20180
20192
  if (!storeRef.current) {
20181
20193
  storeRef.current = createLlmViewStore({
20182
20194
  ...props,
20195
+ clear,
20183
20196
  send,
20184
20197
  setEmbed,
20185
20198
  setCurrentContext