@e-llm-studio/instant-learning 1.3.11 → 1.3.13
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/ILMarketplaceWrapper.js +2 -0
- package/dist/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/ILMarketplaceWrapper.js +2 -0
- package/dist/cjs/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJ.js +3 -1
- package/dist/cjs/features/IL-OTJ/ILOTJ.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +5 -0
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -0
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/NormalChat.js +1 -0
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/NormalChat.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.js +32 -28
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.styles.js +1 -0
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.styles.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +18 -12
- package/dist/cjs/features/IL-OTJ/_components/molecules/Condition/ConditionList.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js +6 -2
- package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js.map +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +13 -2
- package/dist/cjs/features/LearningManagement/LearningManagement.js.map +1 -1
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +4 -2
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +4 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js.map +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +53 -21
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +101 -31
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js.map +1 -1
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +11 -0
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js.map +1 -1
- package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js +3 -4
- package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js.map +1 -1
- package/dist/cjs/schema-driven/components/PromptTextEditorField.js +5 -1
- package/dist/cjs/schema-driven/components/PromptTextEditorField.js.map +1 -1
- package/dist/cjs/schema-driven/components/VariantListField.js +6 -6
- package/dist/cjs/schema-driven/components/VariantListField.js.map +1 -1
- package/dist/cjs/schema-driven/primitives/Accordion.js +1 -1
- package/dist/cjs/schema-driven/primitives/Accordion.js.map +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js +3 -1
- package/dist/features/IL-OTJ/ILOTJ.js.map +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +5 -0
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -0
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/NormalChat.js +1 -0
- package/dist/features/IL-OTJ/_components/ChatComponents/NormalChat.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ILPopup.js +32 -28
- package/dist/features/IL-OTJ/_components/ILPopup.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ILPopup.styles.js +1 -0
- package/dist/features/IL-OTJ/_components/ILPopup.styles.js.map +1 -1
- package/dist/features/IL-OTJ/_components/molecules/Condition/ConditionList.js +18 -12
- package/dist/features/IL-OTJ/_components/molecules/Condition/ConditionList.js.map +1 -1
- package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/features/IL-marketplace/components/LearningManagementWrapper.js +6 -2
- package/dist/features/IL-marketplace/components/LearningManagementWrapper.js.map +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +13 -2
- package/dist/features/LearningManagement/LearningManagement.js.map +1 -1
- package/dist/features/LearningManagement/LearningTemplateLayout.js +4 -2
- package/dist/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleContent.js +4 -1
- package/dist/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
- package/dist/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/features/LearningManagement/RuleContent/VariantCard.js.map +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +53 -21
- package/dist/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +101 -31
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/features/LearningManagement/store/useLMSConfigStore.js.map +1 -1
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +12 -1
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js.map +1 -1
- package/dist/schema-driven/components/GlobalSetupAccordionField.js +3 -4
- package/dist/schema-driven/components/GlobalSetupAccordionField.js.map +1 -1
- package/dist/schema-driven/components/PromptTextEditorField.js +5 -1
- package/dist/schema-driven/components/PromptTextEditorField.js.map +1 -1
- package/dist/schema-driven/components/VariantListField.js +6 -6
- package/dist/schema-driven/components/VariantListField.js.map +1 -1
- package/dist/schema-driven/primitives/Accordion.js +1 -1
- package/dist/schema-driven/primitives/Accordion.js.map +1 -1
- package/dist/types/src/ILMarketplaceMockTest.d.ts.map +1 -1
- package/dist/types/src/ILMarketplaceWrapper.d.ts +5 -0
- package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +1 -0
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +2 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +2 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/NormalChat.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts +2 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.styles.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts +4 -1
- package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +5 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRenderer.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/GlobalSetupAccordionField.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/VariantListField.d.ts.map +1 -1
- package/dist/types/src/schema-driven/primitives/Accordion.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -164,6 +164,7 @@ const InstantLearningModalDynamic = ({
|
|
|
164
164
|
initialDraftMessage,
|
|
165
165
|
postSaveCallback,
|
|
166
166
|
initialChatMessage,
|
|
167
|
+
initialAddChatMessage,
|
|
167
168
|
applicationIntegrationId,
|
|
168
169
|
contentModeMappingId,
|
|
169
170
|
instantLearningId,
|
|
@@ -176,7 +177,7 @@ const InstantLearningModalDynamic = ({
|
|
|
176
177
|
mode,
|
|
177
178
|
is_publishing
|
|
178
179
|
}) => {
|
|
179
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
180
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
180
181
|
const [scopeData, setScopeData] = useState({
|
|
181
182
|
station: initialScope,
|
|
182
183
|
tiers: ["Tier 1"]
|
|
@@ -273,7 +274,7 @@ const InstantLearningModalDynamic = ({
|
|
|
273
274
|
}
|
|
274
275
|
};
|
|
275
276
|
}, []);
|
|
276
|
-
useDynamicFormStore((s) => s.globalData);
|
|
277
|
+
const dynamicGlobalData = useDynamicFormStore((s) => s.globalData);
|
|
277
278
|
useDynamicFormStore((s) => s.variantData);
|
|
278
279
|
const dynamicFormSchema = useTeachMeConfigStore(
|
|
279
280
|
(s) => {
|
|
@@ -665,6 +666,7 @@ const InstantLearningModalDynamic = ({
|
|
|
665
666
|
const [ruleIdInCurrentSession, setRuleIdInCurrentSession] = useState([]);
|
|
666
667
|
const [editVariantIndex, setEditVariantIndex] = useState(void 0);
|
|
667
668
|
const [sendMessageInChat, setSendMessageInChat] = useState("");
|
|
669
|
+
const isSendingInitialAddMessageRef = useRef(false);
|
|
668
670
|
const [stagedAiResponse, setStagedAiResponse] = useState(null);
|
|
669
671
|
const [variantIds, setVariantIds] = useState([]);
|
|
670
672
|
const [newVariantIds, setNewVariantIds] = useState([]);
|
|
@@ -796,6 +798,24 @@ const InstantLearningModalDynamic = ({
|
|
|
796
798
|
}, 2e3);
|
|
797
799
|
}
|
|
798
800
|
}, [isSendSaveMessage]);
|
|
801
|
+
useEffect(() => {
|
|
802
|
+
if (isOpen && (initialAddChatMessage == null ? void 0 : initialAddChatMessage.trim()) && !isSendingInitialAddMessageRef.current) {
|
|
803
|
+
console.debug("[TeachMe initial message] Dynamic modal dispatching chat signal", {
|
|
804
|
+
initialAddChatMessage
|
|
805
|
+
});
|
|
806
|
+
isSendingInitialAddMessageRef.current = true;
|
|
807
|
+
setSendMessageInChat(initialAddChatMessage);
|
|
808
|
+
}
|
|
809
|
+
if (!isOpen) {
|
|
810
|
+
console.debug("[TeachMe initial message] Dynamic modal reset send guard");
|
|
811
|
+
isSendingInitialAddMessageRef.current = false;
|
|
812
|
+
}
|
|
813
|
+
}, [isOpen, initialAddChatMessage]);
|
|
814
|
+
useEffect(() => {
|
|
815
|
+
if (sendMessageInChat === initialAddChatMessage && initialAddChatMessage) {
|
|
816
|
+
console.debug("[TeachMe initial message] Dynamic modal state now holds chat signal");
|
|
817
|
+
}
|
|
818
|
+
}, [sendMessageInChat, initialAddChatMessage]);
|
|
799
819
|
useEffect(() => {
|
|
800
820
|
if (isOpen && triggerValidateMessage && !isSendingValidateRef.current) {
|
|
801
821
|
isSendingValidateRef.current = true;
|
|
@@ -1178,7 +1198,13 @@ const InstantLearningModalDynamic = ({
|
|
|
1178
1198
|
["tier_2", /* @__PURE__ */ new Map()]
|
|
1179
1199
|
])
|
|
1180
1200
|
);
|
|
1181
|
-
setSendMessageInChat(
|
|
1201
|
+
setSendMessageInChat((currentMessage) => {
|
|
1202
|
+
if (isSendingInitialAddMessageRef.current && (initialAddChatMessage == null ? void 0 : initialAddChatMessage.trim())) {
|
|
1203
|
+
console.debug("[TeachMe initial message] Preserving chat signal during form reset");
|
|
1204
|
+
return currentMessage;
|
|
1205
|
+
}
|
|
1206
|
+
return "";
|
|
1207
|
+
});
|
|
1182
1208
|
setReasoning({
|
|
1183
1209
|
ruleTitle: "",
|
|
1184
1210
|
ruleDescription: "",
|
|
@@ -1341,7 +1367,15 @@ const InstantLearningModalDynamic = ({
|
|
|
1341
1367
|
}
|
|
1342
1368
|
}
|
|
1343
1369
|
},
|
|
1344
|
-
[
|
|
1370
|
+
[
|
|
1371
|
+
dispatch,
|
|
1372
|
+
initialScope,
|
|
1373
|
+
editingRule,
|
|
1374
|
+
editingTier,
|
|
1375
|
+
editingVariants,
|
|
1376
|
+
focusedVariantIndex,
|
|
1377
|
+
initialAddChatMessage
|
|
1378
|
+
]
|
|
1345
1379
|
);
|
|
1346
1380
|
const extractAndParseResponse1 = (data) => {
|
|
1347
1381
|
if (typeof data !== "string") return data;
|
|
@@ -1390,6 +1424,17 @@ const InstantLearningModalDynamic = ({
|
|
|
1390
1424
|
console.log("variantIds", variantIds);
|
|
1391
1425
|
setShowComparison(true);
|
|
1392
1426
|
}, [variantIds]);
|
|
1427
|
+
const getSuccessToastMessage = useCallback(
|
|
1428
|
+
(fallback) => {
|
|
1429
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
1430
|
+
const rawToast = typeof (uiStateLabels == null ? void 0 : uiStateLabels.successToastMessage) === "string" && uiStateLabels.successToastMessage.trim() !== "" ? uiStateLabels.successToastMessage.trim() : typeof ((_a2 = useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _a2.successToastMessage) === "string" && ((_c2 = (_b2 = useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _b2.successToastMessage) == null ? void 0 : _c2.trim()) !== "" ? (_e2 = (_d2 = useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _d2.successToastMessage) == null ? void 0 : _e2.trim() : void 0;
|
|
1431
|
+
if (rawToast) {
|
|
1432
|
+
return rawToast.replace(/\{scope\}/g, (ruleSet == null ? void 0 : ruleSet.ruleSetName) || "");
|
|
1433
|
+
}
|
|
1434
|
+
return fallback;
|
|
1435
|
+
},
|
|
1436
|
+
[uiStateLabels == null ? void 0 : uiStateLabels.successToastMessage, ruleSet == null ? void 0 : ruleSet.ruleSetName]
|
|
1437
|
+
);
|
|
1393
1438
|
const myCustomHandlers = {
|
|
1394
1439
|
/**
|
|
1395
1440
|
* Handles the 'Let me connect the dots for you...' header message.
|
|
@@ -1895,7 +1940,7 @@ const InstantLearningModalDynamic = ({
|
|
|
1895
1940
|
/* @__PURE__ */ jsx(Check, { className: toastStyles.iconSuccess }),
|
|
1896
1941
|
/* @__PURE__ */ jsx("span", { className: `${toastStyles.toastTitle} ${toastStyles.toastTitleSuccess}`, children: "Success" })
|
|
1897
1942
|
] }),
|
|
1898
|
-
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: isAnyCreated ? "Learning saved successfully!" : "Changes saved successfully!" })
|
|
1943
|
+
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: getSuccessToastMessage(isAnyCreated ? "Learning saved successfully!" : "Changes saved successfully!") })
|
|
1899
1944
|
] })
|
|
1900
1945
|
});
|
|
1901
1946
|
setIsCloseModal(true);
|
|
@@ -3443,7 +3488,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3443
3488
|
/* @__PURE__ */ jsx(Check, { className: toastStyles.iconSuccess }),
|
|
3444
3489
|
/* @__PURE__ */ jsx("span", { className: `${toastStyles.toastTitle} ${toastStyles.toastTitleSuccess}`, children: "Success" })
|
|
3445
3490
|
] }),
|
|
3446
|
-
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: "Learning saved successfully!" })
|
|
3491
|
+
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: getSuccessToastMessage("Learning saved successfully!") })
|
|
3447
3492
|
] })
|
|
3448
3493
|
});
|
|
3449
3494
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -3524,7 +3569,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3524
3569
|
const tierWtaMap = whenToApplyConditions.get(tierKey);
|
|
3525
3570
|
const tierWntaMap = whenNotToApplyConditions.get(tierKey);
|
|
3526
3571
|
variantsToUpdate.forEach((variant, index) => {
|
|
3527
|
-
var _a3, _b3, _c3, _d3, _e3, _f3, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2,
|
|
3572
|
+
var _a3, _b3, _c3, _d3, _e3, _f3, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
|
|
3528
3573
|
const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.description || "";
|
|
3529
3574
|
const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
|
|
3530
3575
|
const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
|
|
@@ -3737,7 +3782,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3737
3782
|
tierLinkId: existingLinkId != null ? existingLinkId : null,
|
|
3738
3783
|
variantType: variantTypeToUse,
|
|
3739
3784
|
// Send is_user_accepted_risk directly from the variant state or fallback to props; defaulting to false
|
|
3740
|
-
is_user_accepted_risk: !!((
|
|
3785
|
+
is_user_accepted_risk: !!((_y2 = (_x2 = (structuredAIResponse || [])[index]) == null ? void 0 : _x2.is_user_accepted_risk) != null ? _y2 : variant == null ? void 0 : variant.is_user_accepted_risk),
|
|
3741
3786
|
is_enabled: variant.is_enabled,
|
|
3742
3787
|
appsecData: {
|
|
3743
3788
|
application: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _z : "",
|
|
@@ -3824,7 +3869,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3824
3869
|
/* @__PURE__ */ jsx(Check, { className: toastStyles.iconSuccess }),
|
|
3825
3870
|
/* @__PURE__ */ jsx("span", { className: `${toastStyles.toastTitle} ${toastStyles.toastTitleSuccess}`, children: "Success" })
|
|
3826
3871
|
] }),
|
|
3827
|
-
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: "Changes saved successfully!" })
|
|
3872
|
+
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: getSuccessToastMessage("Changes saved successfully!") })
|
|
3828
3873
|
] })
|
|
3829
3874
|
});
|
|
3830
3875
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -3898,7 +3943,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3898
3943
|
const tierWtaMap = whenToApplyConditions.get(tierKey);
|
|
3899
3944
|
const tierWntaMap = whenNotToApplyConditions.get(tierKey);
|
|
3900
3945
|
allVariants.forEach((variant, index) => {
|
|
3901
|
-
var _a3, _b3, _c3, _d3, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2,
|
|
3946
|
+
var _a3, _b3, _c3, _d3, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
|
|
3902
3947
|
const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.rule_description || variant.description || "";
|
|
3903
3948
|
const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
|
|
3904
3949
|
const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
|
|
@@ -4107,7 +4152,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4107
4152
|
appsecData: {
|
|
4108
4153
|
application: (_x2 = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _x2 : "",
|
|
4109
4154
|
scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
|
|
4110
|
-
applicationLevelModuleId: (
|
|
4155
|
+
applicationLevelModuleId: (_y2 = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _y2 : "",
|
|
4111
4156
|
applicationLevelResourceId: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _z : ""
|
|
4112
4157
|
}
|
|
4113
4158
|
};
|
|
@@ -4210,7 +4255,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4210
4255
|
/* @__PURE__ */ jsx(Check, { className: toastStyles.iconSuccess }),
|
|
4211
4256
|
/* @__PURE__ */ jsx("span", { className: `${toastStyles.toastTitle} ${toastStyles.toastTitleSuccess}`, children: "Success" })
|
|
4212
4257
|
] }),
|
|
4213
|
-
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: "Changes saved successfully!" })
|
|
4258
|
+
/* @__PURE__ */ jsx("p", { className: `${toastStyles.toastMessage} ${toastStyles.toastMessageSuccess}`, children: getSuccessToastMessage("Changes saved successfully!") })
|
|
4214
4259
|
] })
|
|
4215
4260
|
});
|
|
4216
4261
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -4273,8 +4318,32 @@ const InstantLearningModalDynamic = ({
|
|
|
4273
4318
|
scopeData.tiers.length ? scopeData.tiers.map(normalizeTierKey) : void 0,
|
|
4274
4319
|
isEditFlow || isLoadAndEditModeRef.current ? void 0 : [newVariantMapIndexRef.current]
|
|
4275
4320
|
);
|
|
4276
|
-
const
|
|
4321
|
+
const pickTitle = (src) => {
|
|
4322
|
+
if (!src) return "";
|
|
4323
|
+
const preferred = ["rule_title", "ruleTitle", "title", "template_title"];
|
|
4324
|
+
const keys = [
|
|
4325
|
+
...preferred.filter((k) => k in src),
|
|
4326
|
+
...Object.keys(src).filter((k) => /title/i.test(k) && !preferred.includes(k))
|
|
4327
|
+
];
|
|
4328
|
+
for (const k of keys) {
|
|
4329
|
+
const v = src[k];
|
|
4330
|
+
const s = typeof v === "string" ? v : typeof (v == null ? void 0 : v.value) === "string" ? v.value : "";
|
|
4331
|
+
if (s.trim()) return s.trim();
|
|
4332
|
+
}
|
|
4333
|
+
return "";
|
|
4334
|
+
};
|
|
4335
|
+
const draftTierKey = ((_f = scopeData.tiers) == null ? void 0 : _f[0]) ? normalizeTierKey(scopeData.tiers[0]) : "tier_1";
|
|
4336
|
+
const draftVariantIdx = editVariantIndex != null ? editVariantIndex : 0;
|
|
4337
|
+
const draftRootPayload = dynamicFormSchema ? generatePayloadFromSchema(dynamicFormSchema, draftTierKey, draftVariantIdx).rootPayload : {};
|
|
4338
|
+
const effectiveRuleTitle = pickTitle(draftRootPayload) || pickTitle(dynamicGlobalData) || ruleTitle.trim();
|
|
4339
|
+
const canSaveDraft = !isEditFlow && effectiveRuleTitle.length > 0;
|
|
4277
4340
|
const saveDraftDisabledTooltip = isEditFlow ? "Drafts cannot be saved in Edit Mode." : "Add a learning title before saving a draft.";
|
|
4341
|
+
const hasRequiredFieldsForButton = () => {
|
|
4342
|
+
var _a2, _b2, _c2;
|
|
4343
|
+
if (isEditFlow) return true;
|
|
4344
|
+
const jsonSchema = ((_b2 = (_a2 = useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _a2.learningMetadataComponents) == null ? void 0 : _b2.teachMe) || ((_c2 = useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _c2.learningMetadataComponents);
|
|
4345
|
+
return hasRequiredFieldsForCurrentSave(jsonSchema);
|
|
4346
|
+
};
|
|
4278
4347
|
const saveDraft = async () => {
|
|
4279
4348
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
4280
4349
|
if (!canSaveDraft) {
|
|
@@ -4335,8 +4404,8 @@ const InstantLearningModalDynamic = ({
|
|
|
4335
4404
|
}
|
|
4336
4405
|
}
|
|
4337
4406
|
}, [isSaveRule, isAiStreaming]);
|
|
4338
|
-
const editTierKey = ((
|
|
4339
|
-
const editIndex = (
|
|
4407
|
+
const editTierKey = ((_h = ((_g = scopeData == null ? void 0 : scopeData.tiers) == null ? void 0 : _g[0]) || editingTier || "Tier 1") == null ? void 0 : _h.toLowerCase().replace(/ /g, "_")) || "tier_1";
|
|
4408
|
+
const editIndex = (_i = editVariantIndex != null ? editVariantIndex : focusedVariantIndex) != null ? _i : 0;
|
|
4340
4409
|
const isVariantAccordionOpen = editVariantIndex != null;
|
|
4341
4410
|
const currentAccordionData = isVariantAccordionOpen ? structuredAIResponse == null ? void 0 : structuredAIResponse[editIndex] : null;
|
|
4342
4411
|
const activeVariant = structuredAIResponse && (structuredAIResponse == null ? void 0 : structuredAIResponse.find(
|
|
@@ -4434,7 +4503,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4434
4503
|
}
|
|
4435
4504
|
};
|
|
4436
4505
|
const uiStateVariants = isEditFlow ? buildVariantsMap() : {};
|
|
4437
|
-
const marketplaceEditVariantId = instantLearningId && isEditFlow ? "variant_0" in uiStateVariants ? "variant_0" : (
|
|
4506
|
+
const marketplaceEditVariantId = instantLearningId && isEditFlow ? "variant_0" in uiStateVariants ? "variant_0" : (_j = Object.keys(uiStateVariants)[0]) != null ? _j : null : variantIdToBeEdited;
|
|
4438
4507
|
customMetaDataRef.current = {
|
|
4439
4508
|
send_metadata_to_orchestrator: false,
|
|
4440
4509
|
is_draft_flow: isDraftFlow,
|
|
@@ -4445,12 +4514,12 @@ const InstantLearningModalDynamic = ({
|
|
|
4445
4514
|
LearningTerm: dt("agents.LearningTerm", "Learnings"),
|
|
4446
4515
|
mode_name: baseModeName ? baseModeName : void 0,
|
|
4447
4516
|
x_full_url: buildXFullUrl(),
|
|
4448
|
-
agents_from_ilkb_config: (
|
|
4517
|
+
agents_from_ilkb_config: (_k = useLMSConfigStore.getState().lmsConfig) == null ? void 0 : _k.agents,
|
|
4449
4518
|
appsecData: {
|
|
4450
|
-
application: (
|
|
4519
|
+
application: (_l = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _l : "",
|
|
4451
4520
|
scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
|
|
4452
|
-
applicationLevelModuleId: (
|
|
4453
|
-
applicationLevelResourceId: (
|
|
4521
|
+
applicationLevelModuleId: (_m = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _m : "",
|
|
4522
|
+
applicationLevelResourceId: (_n = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _n : ""
|
|
4454
4523
|
},
|
|
4455
4524
|
save_api_payload: (() => {
|
|
4456
4525
|
var _a2, _b2, _c2, _d2;
|
|
@@ -4494,7 +4563,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4494
4563
|
)) == null ? void 0 : _g2.tier_id) || "",
|
|
4495
4564
|
topic_id: null,
|
|
4496
4565
|
scope_id: effectiveRuleSetId,
|
|
4497
|
-
question_title:
|
|
4566
|
+
question_title: effectiveRuleTitle,
|
|
4498
4567
|
variantType: resolveVariantTypeForPayload(
|
|
4499
4568
|
tierKey,
|
|
4500
4569
|
targetIndex,
|
|
@@ -4570,7 +4639,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4570
4639
|
description: IL_CONFIG_CONSTANTS.CATEGORY
|
|
4571
4640
|
}
|
|
4572
4641
|
],
|
|
4573
|
-
originalQuestion:
|
|
4642
|
+
originalQuestion: effectiveRuleTitle,
|
|
4574
4643
|
questionId: null,
|
|
4575
4644
|
variantType: resolveVariantTypeForPayload(
|
|
4576
4645
|
tierKey,
|
|
@@ -4719,7 +4788,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4719
4788
|
backward_compatibility: useLearningTemplateStore.getState().backwardCompatibility,
|
|
4720
4789
|
ruleset_id: effectiveRuleSetId,
|
|
4721
4790
|
...initialRuleSetId ? { initial_ruleset_id: initialRuleSetId } : {},
|
|
4722
|
-
current_variants_length: editingRule ? Array.isArray(structuredAIResponse) && structuredAIResponse.length > 0 ? Math.max(((
|
|
4791
|
+
current_variants_length: editingRule ? Array.isArray(structuredAIResponse) && structuredAIResponse.length > 0 ? Math.max(((_o = editingRule == null ? void 0 : editingRule.variants) == null ? void 0 : _o.length) || 0, structuredAIResponse.length) : (_p = editingRule == null ? void 0 : editingRule.variants) == null ? void 0 : _p.length : void 0,
|
|
4723
4792
|
tiers: useLearningTemplateStore.getState().tiers,
|
|
4724
4793
|
authToken: (user == null ? void 0 : user.accessToken) || "",
|
|
4725
4794
|
...is_publishing && { is_publishing }
|
|
@@ -4981,8 +5050,8 @@ const InstantLearningModalDynamic = ({
|
|
|
4981
5050
|
// JSON-driven operational config (dropdown option sources + host-prefilled
|
|
4982
5051
|
// values). Kept out of uiStateLabels so labels stay label-only; the schema
|
|
4983
5052
|
// renderer / ComponentRegistry read these off uiState.
|
|
4984
|
-
dynamicOptions: (
|
|
4985
|
-
prefilledData: (
|
|
5053
|
+
dynamicOptions: (_q = dynamicFormConfig == null ? void 0 : dynamicFormConfig.dynamicOptions) != null ? _q : {},
|
|
5054
|
+
prefilledData: (_r = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData) != null ? _r : {},
|
|
4986
5055
|
...ilLabels,
|
|
4987
5056
|
scrollTrigger,
|
|
4988
5057
|
...uiStateLabels,
|
|
@@ -5611,7 +5680,7 @@ const InstantLearningModalDynamic = ({
|
|
|
5611
5680
|
ThinkingBulbIconComponent: /* @__PURE__ */ jsx(MockBulbIcon, {}),
|
|
5612
5681
|
customSections: customSections != null ? customSections : /* @__PURE__ */ jsx(Fragment, {}),
|
|
5613
5682
|
customMetaData: customMetaDataRef,
|
|
5614
|
-
chatTitle: editingRule ? ((
|
|
5683
|
+
chatTitle: editingRule ? ((_s = uiStateLabels == null ? void 0 : uiStateLabels.chatTitleEdit) != null ? _s : configuration.CHAT_TITLE_EDIT).replace("{scope}", (ruleSet == null ? void 0 : ruleSet.ruleSetName) || "") : ((_t = uiStateLabels == null ? void 0 : uiStateLabels.chatTitle) != null ? _t : configuration.CHAT_TITLE).replace("{scope}", (ruleSet == null ? void 0 : ruleSet.ruleSetName) || ""),
|
|
5615
5684
|
formTitle: (uiState == null ? void 0 : uiState.formTitle) || configuration.FORM_TITLE,
|
|
5616
5685
|
showSavedMessage: false,
|
|
5617
5686
|
savedMessage,
|
|
@@ -5642,7 +5711,7 @@ const InstantLearningModalDynamic = ({
|
|
|
5642
5711
|
isFormDirty,
|
|
5643
5712
|
initialChatMessage: editingRule ? getEditRuleChatMessage(
|
|
5644
5713
|
editingRule.ruleTitle || "this rule",
|
|
5645
|
-
((
|
|
5714
|
+
((_u = editingVariants == null ? void 0 : editingVariants[focusedVariantIndex != null ? focusedVariantIndex : 0]) == null ? void 0 : _u.is_user_accepted_risk) === true
|
|
5646
5715
|
) : initialChatMessage != null ? initialChatMessage : configuration.INITIAL_CHAT_MESSAGE,
|
|
5647
5716
|
validateCustom: () => {
|
|
5648
5717
|
var _a2, _b2, _c2;
|
|
@@ -5702,10 +5771,11 @@ const InstantLearningModalDynamic = ({
|
|
|
5702
5771
|
initialDraftMessage,
|
|
5703
5772
|
socketTimeOutInMilliSeconds: configuration.SOCKET_TIMEOUT,
|
|
5704
5773
|
userDetails: {
|
|
5705
|
-
name: `${(
|
|
5706
|
-
id: (
|
|
5707
|
-
email: (
|
|
5708
|
-
}
|
|
5774
|
+
name: `${(_v = user == null ? void 0 : user.firstname) != null ? _v : ""} ${(_w = user == null ? void 0 : user.lastname) != null ? _w : ""}`.trim() || "Guest Userr",
|
|
5775
|
+
id: (_x = user == null ? void 0 : user._id) != null ? _x : "Guest Userr",
|
|
5776
|
+
email: (_y = user == null ? void 0 : user.email) != null ? _y : "guestUserr@example.com"
|
|
5777
|
+
},
|
|
5778
|
+
hasRequiredFields: hasRequiredFieldsForButton
|
|
5709
5779
|
}
|
|
5710
5780
|
),
|
|
5711
5781
|
/* @__PURE__ */ jsx(
|