@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 +6 -0
- package/dist/cjs/index.js +21 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/useLlm/useLlmView.js +21 -8
- package/dist/esm/useLlm/useLlmView.js.map +1 -1
- package/dist/types/useLlm/useLlmView.d.ts +2 -1
- package/dist/types/useLlm/useLlmView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/useLlm/useLlmView.tsx +16 -12
package/CHANGELOG.md
CHANGED
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
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|