@websolutespa/bom-mixer-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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-mixer-llm
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: useLlmView clear with openingContext
8
+
3
9
  ## 2.0.3
4
10
 
5
11
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -222,6 +222,7 @@ const createLlmViewStore = _ref => {
222
222
  opened,
223
223
  embedded,
224
224
  portal,
225
+ clear,
225
226
  send,
226
227
  setEmbed,
227
228
  setCurrentContext
@@ -391,10 +392,15 @@ const createLlmViewStore = _ref => {
391
392
  const opened = !state.opened;
392
393
  if (opened) {
393
394
  state.openingContext = openingContext;
394
- setCurrentContext(openingContext ? {
395
- context: openingContext,
396
- title: 'opening-context'
397
- } : undefined);
395
+ if (openingContext) {
396
+ clear();
397
+ setCurrentContext({
398
+ context: openingContext,
399
+ title: 'opening-context'
400
+ });
401
+ } else {
402
+ setCurrentContext();
403
+ }
398
404
  }
399
405
  pushDataLayer(Object.assign({
400
406
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close'
@@ -417,10 +423,15 @@ const createLlmViewStore = _ref => {
417
423
  set(state => {
418
424
  if (opened) {
419
425
  state.openingContext = openingContext;
420
- setCurrentContext(openingContext ? {
421
- context: openingContext,
422
- title: 'opening-context'
423
- } : undefined);
426
+ if (openingContext) {
427
+ clear();
428
+ setCurrentContext({
429
+ context: openingContext,
430
+ title: 'opening-context'
431
+ });
432
+ } else {
433
+ setCurrentContext();
434
+ }
424
435
  }
425
436
  pushDataLayer(Object.assign({
426
437
  event: opened ? state.openingContext ? 'llm_open_context' : 'llm_open' : 'llm_close'
@@ -489,6 +500,7 @@ function LlmViewProvider(_a) {
489
500
  } = _a,
490
501
  props = __rest(_a, ["children"]);
491
502
  const {
503
+ clear,
492
504
  send,
493
505
  setEmbed,
494
506
  setCurrentContext
@@ -496,6 +508,7 @@ function LlmViewProvider(_a) {
496
508
  const storeRef = React.useRef();
497
509
  if (!storeRef.current) {
498
510
  storeRef.current = createLlmViewStore(Object.assign(Object.assign({}, props), {
511
+ clear,
499
512
  send,
500
513
  setEmbed,
501
514
  setCurrentContext