@websolutespa/bom-llm 2.0.2 → 2.0.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/umd/index.js CHANGED
@@ -19902,7 +19902,8 @@
19902
19902
  embedded,
19903
19903
  portal,
19904
19904
  send,
19905
- setEmbed
19905
+ setEmbed,
19906
+ setCurrentContext
19906
19907
  } = _ref;
19907
19908
  const props = {
19908
19909
  opened: opened != null ? opened : embedded != null || threadId != null ? true : false,
@@ -20071,6 +20072,10 @@
20071
20072
  const opened = !state.opened;
20072
20073
  if (opened) {
20073
20074
  state.openingContext = openingContext;
20075
+ setCurrentContext(openingContext ? {
20076
+ context: openingContext,
20077
+ title: 'opening-context'
20078
+ } : undefined);
20074
20079
  }
20075
20080
  pushDataLayer({
20076
20081
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close',
@@ -20094,6 +20099,10 @@
20094
20099
  set(state => {
20095
20100
  if (opened) {
20096
20101
  state.openingContext = openingContext;
20102
+ setCurrentContext(openingContext ? {
20103
+ context: openingContext,
20104
+ title: 'opening-context'
20105
+ } : undefined);
20097
20106
  }
20098
20107
  pushDataLayer({
20099
20108
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close',
@@ -20164,14 +20173,16 @@
20164
20173
  } = _ref2;
20165
20174
  const {
20166
20175
  send,
20167
- setEmbed
20176
+ setEmbed,
20177
+ setCurrentContext
20168
20178
  } = useLlm(state => state.actions);
20169
20179
  const storeRef = reactExports.useRef();
20170
20180
  if (!storeRef.current) {
20171
20181
  storeRef.current = createLlmViewStore({
20172
20182
  ...props,
20173
20183
  send,
20174
- setEmbed
20184
+ setEmbed,
20185
+ setCurrentContext
20175
20186
  });
20176
20187
  }
20177
20188
  return storeRef.current && /*#__PURE__*/jsxRuntimeExports.jsx(LlmViewContext.Provider, {
@@ -45687,7 +45698,7 @@ ${Object.entries(vars).map(_ref2 => {
45687
45698
  currentContext,
45688
45699
  systemContext: {
45689
45700
  ...systemContext,
45690
- ...currentContext.context
45701
+ ...currentContext?.context
45691
45702
  }
45692
45703
  }));
45693
45704
  },