@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
|
@@ -172,6 +172,7 @@ const InstantLearningModalDynamic = ({
|
|
|
172
172
|
initialDraftMessage,
|
|
173
173
|
postSaveCallback,
|
|
174
174
|
initialChatMessage,
|
|
175
|
+
initialAddChatMessage,
|
|
175
176
|
applicationIntegrationId,
|
|
176
177
|
contentModeMappingId,
|
|
177
178
|
instantLearningId,
|
|
@@ -184,7 +185,7 @@ const InstantLearningModalDynamic = ({
|
|
|
184
185
|
mode,
|
|
185
186
|
is_publishing
|
|
186
187
|
}) => {
|
|
187
|
-
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;
|
|
188
|
+
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;
|
|
188
189
|
const [scopeData, setScopeData] = React.useState({
|
|
189
190
|
station: initialScope,
|
|
190
191
|
tiers: ["Tier 1"]
|
|
@@ -281,7 +282,7 @@ const InstantLearningModalDynamic = ({
|
|
|
281
282
|
}
|
|
282
283
|
};
|
|
283
284
|
}, []);
|
|
284
|
-
useDynamicFormStore.useDynamicFormStore((s) => s.globalData);
|
|
285
|
+
const dynamicGlobalData = useDynamicFormStore.useDynamicFormStore((s) => s.globalData);
|
|
285
286
|
useDynamicFormStore.useDynamicFormStore((s) => s.variantData);
|
|
286
287
|
const dynamicFormSchema = useLMSConfigStore.useTeachMeConfigStore(
|
|
287
288
|
(s) => {
|
|
@@ -673,6 +674,7 @@ const InstantLearningModalDynamic = ({
|
|
|
673
674
|
const [ruleIdInCurrentSession, setRuleIdInCurrentSession] = React.useState([]);
|
|
674
675
|
const [editVariantIndex, setEditVariantIndex] = React.useState(void 0);
|
|
675
676
|
const [sendMessageInChat, setSendMessageInChat] = React.useState("");
|
|
677
|
+
const isSendingInitialAddMessageRef = React.useRef(false);
|
|
676
678
|
const [stagedAiResponse, setStagedAiResponse] = React.useState(null);
|
|
677
679
|
const [variantIds, setVariantIds] = React.useState([]);
|
|
678
680
|
const [newVariantIds, setNewVariantIds] = React.useState([]);
|
|
@@ -804,6 +806,24 @@ const InstantLearningModalDynamic = ({
|
|
|
804
806
|
}, 2e3);
|
|
805
807
|
}
|
|
806
808
|
}, [isSendSaveMessage]);
|
|
809
|
+
React.useEffect(() => {
|
|
810
|
+
if (isOpen && (initialAddChatMessage == null ? void 0 : initialAddChatMessage.trim()) && !isSendingInitialAddMessageRef.current) {
|
|
811
|
+
console.debug("[TeachMe initial message] Dynamic modal dispatching chat signal", {
|
|
812
|
+
initialAddChatMessage
|
|
813
|
+
});
|
|
814
|
+
isSendingInitialAddMessageRef.current = true;
|
|
815
|
+
setSendMessageInChat(initialAddChatMessage);
|
|
816
|
+
}
|
|
817
|
+
if (!isOpen) {
|
|
818
|
+
console.debug("[TeachMe initial message] Dynamic modal reset send guard");
|
|
819
|
+
isSendingInitialAddMessageRef.current = false;
|
|
820
|
+
}
|
|
821
|
+
}, [isOpen, initialAddChatMessage]);
|
|
822
|
+
React.useEffect(() => {
|
|
823
|
+
if (sendMessageInChat === initialAddChatMessage && initialAddChatMessage) {
|
|
824
|
+
console.debug("[TeachMe initial message] Dynamic modal state now holds chat signal");
|
|
825
|
+
}
|
|
826
|
+
}, [sendMessageInChat, initialAddChatMessage]);
|
|
807
827
|
React.useEffect(() => {
|
|
808
828
|
if (isOpen && triggerValidateMessage && !isSendingValidateRef.current) {
|
|
809
829
|
isSendingValidateRef.current = true;
|
|
@@ -1186,7 +1206,13 @@ const InstantLearningModalDynamic = ({
|
|
|
1186
1206
|
["tier_2", /* @__PURE__ */ new Map()]
|
|
1187
1207
|
])
|
|
1188
1208
|
);
|
|
1189
|
-
setSendMessageInChat(
|
|
1209
|
+
setSendMessageInChat((currentMessage) => {
|
|
1210
|
+
if (isSendingInitialAddMessageRef.current && (initialAddChatMessage == null ? void 0 : initialAddChatMessage.trim())) {
|
|
1211
|
+
console.debug("[TeachMe initial message] Preserving chat signal during form reset");
|
|
1212
|
+
return currentMessage;
|
|
1213
|
+
}
|
|
1214
|
+
return "";
|
|
1215
|
+
});
|
|
1190
1216
|
setReasoning({
|
|
1191
1217
|
ruleTitle: "",
|
|
1192
1218
|
ruleDescription: "",
|
|
@@ -1349,7 +1375,15 @@ const InstantLearningModalDynamic = ({
|
|
|
1349
1375
|
}
|
|
1350
1376
|
}
|
|
1351
1377
|
},
|
|
1352
|
-
[
|
|
1378
|
+
[
|
|
1379
|
+
dispatch,
|
|
1380
|
+
initialScope,
|
|
1381
|
+
editingRule,
|
|
1382
|
+
editingTier,
|
|
1383
|
+
editingVariants,
|
|
1384
|
+
focusedVariantIndex,
|
|
1385
|
+
initialAddChatMessage
|
|
1386
|
+
]
|
|
1353
1387
|
);
|
|
1354
1388
|
const extractAndParseResponse1 = (data) => {
|
|
1355
1389
|
if (typeof data !== "string") return data;
|
|
@@ -1398,6 +1432,17 @@ const InstantLearningModalDynamic = ({
|
|
|
1398
1432
|
console.log("variantIds", variantIds);
|
|
1399
1433
|
setShowComparison(true);
|
|
1400
1434
|
}, [variantIds]);
|
|
1435
|
+
const getSuccessToastMessage = React.useCallback(
|
|
1436
|
+
(fallback) => {
|
|
1437
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
1438
|
+
const rawToast = typeof (uiStateLabels == null ? void 0 : uiStateLabels.successToastMessage) === "string" && uiStateLabels.successToastMessage.trim() !== "" ? uiStateLabels.successToastMessage.trim() : typeof ((_a2 = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _a2.successToastMessage) === "string" && ((_c2 = (_b2 = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _b2.successToastMessage) == null ? void 0 : _c2.trim()) !== "" ? (_e2 = (_d2 = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _d2.successToastMessage) == null ? void 0 : _e2.trim() : void 0;
|
|
1439
|
+
if (rawToast) {
|
|
1440
|
+
return rawToast.replace(/\{scope\}/g, (ruleSet == null ? void 0 : ruleSet.ruleSetName) || "");
|
|
1441
|
+
}
|
|
1442
|
+
return fallback;
|
|
1443
|
+
},
|
|
1444
|
+
[uiStateLabels == null ? void 0 : uiStateLabels.successToastMessage, ruleSet == null ? void 0 : ruleSet.ruleSetName]
|
|
1445
|
+
);
|
|
1401
1446
|
const myCustomHandlers = {
|
|
1402
1447
|
/**
|
|
1403
1448
|
* Handles the 'Let me connect the dots for you...' header message.
|
|
@@ -1903,7 +1948,7 @@ const InstantLearningModalDynamic = ({
|
|
|
1903
1948
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: InstantLearningModal_module["default"].iconSuccess }),
|
|
1904
1949
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${InstantLearningModal_module["default"].toastTitle} ${InstantLearningModal_module["default"].toastTitleSuccess}`, children: "Success" })
|
|
1905
1950
|
] }),
|
|
1906
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: isAnyCreated ? "Learning saved successfully!" : "Changes saved successfully!" })
|
|
1951
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: getSuccessToastMessage(isAnyCreated ? "Learning saved successfully!" : "Changes saved successfully!") })
|
|
1907
1952
|
] })
|
|
1908
1953
|
});
|
|
1909
1954
|
setIsCloseModal(true);
|
|
@@ -3451,7 +3496,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3451
3496
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: InstantLearningModal_module["default"].iconSuccess }),
|
|
3452
3497
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${InstantLearningModal_module["default"].toastTitle} ${InstantLearningModal_module["default"].toastTitleSuccess}`, children: "Success" })
|
|
3453
3498
|
] }),
|
|
3454
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: "Learning saved successfully!" })
|
|
3499
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: getSuccessToastMessage("Learning saved successfully!") })
|
|
3455
3500
|
] })
|
|
3456
3501
|
});
|
|
3457
3502
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -3532,7 +3577,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3532
3577
|
const tierWtaMap = whenToApplyConditions.get(tierKey);
|
|
3533
3578
|
const tierWntaMap = whenNotToApplyConditions.get(tierKey);
|
|
3534
3579
|
variantsToUpdate.forEach((variant, index) => {
|
|
3535
|
-
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,
|
|
3580
|
+
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;
|
|
3536
3581
|
const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.description || "";
|
|
3537
3582
|
const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
|
|
3538
3583
|
const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
|
|
@@ -3745,7 +3790,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3745
3790
|
tierLinkId: existingLinkId != null ? existingLinkId : null,
|
|
3746
3791
|
variantType: variantTypeToUse,
|
|
3747
3792
|
// Send is_user_accepted_risk directly from the variant state or fallback to props; defaulting to false
|
|
3748
|
-
is_user_accepted_risk: !!((
|
|
3793
|
+
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),
|
|
3749
3794
|
is_enabled: variant.is_enabled,
|
|
3750
3795
|
appsecData: {
|
|
3751
3796
|
application: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _z : "",
|
|
@@ -3832,7 +3877,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3832
3877
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: InstantLearningModal_module["default"].iconSuccess }),
|
|
3833
3878
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${InstantLearningModal_module["default"].toastTitle} ${InstantLearningModal_module["default"].toastTitleSuccess}`, children: "Success" })
|
|
3834
3879
|
] }),
|
|
3835
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: "Changes saved successfully!" })
|
|
3880
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: getSuccessToastMessage("Changes saved successfully!") })
|
|
3836
3881
|
] })
|
|
3837
3882
|
});
|
|
3838
3883
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -3906,7 +3951,7 @@ const InstantLearningModalDynamic = ({
|
|
|
3906
3951
|
const tierWtaMap = whenToApplyConditions.get(tierKey);
|
|
3907
3952
|
const tierWntaMap = whenNotToApplyConditions.get(tierKey);
|
|
3908
3953
|
allVariants.forEach((variant, index) => {
|
|
3909
|
-
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,
|
|
3954
|
+
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;
|
|
3910
3955
|
const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.rule_description || variant.description || "";
|
|
3911
3956
|
const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
|
|
3912
3957
|
const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
|
|
@@ -4115,7 +4160,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4115
4160
|
appsecData: {
|
|
4116
4161
|
application: (_x2 = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _x2 : "",
|
|
4117
4162
|
scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
|
|
4118
|
-
applicationLevelModuleId: (
|
|
4163
|
+
applicationLevelModuleId: (_y2 = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _y2 : "",
|
|
4119
4164
|
applicationLevelResourceId: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _z : ""
|
|
4120
4165
|
}
|
|
4121
4166
|
};
|
|
@@ -4218,7 +4263,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4218
4263
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: InstantLearningModal_module["default"].iconSuccess }),
|
|
4219
4264
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${InstantLearningModal_module["default"].toastTitle} ${InstantLearningModal_module["default"].toastTitleSuccess}`, children: "Success" })
|
|
4220
4265
|
] }),
|
|
4221
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: "Changes saved successfully!" })
|
|
4266
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: `${InstantLearningModal_module["default"].toastMessage} ${InstantLearningModal_module["default"].toastMessageSuccess}`, children: getSuccessToastMessage("Changes saved successfully!") })
|
|
4222
4267
|
] })
|
|
4223
4268
|
});
|
|
4224
4269
|
closeTimeoutRef.current = setTimeout(() => {
|
|
@@ -4281,8 +4326,32 @@ const InstantLearningModalDynamic = ({
|
|
|
4281
4326
|
scopeData.tiers.length ? scopeData.tiers.map(normalizeTierKey) : void 0,
|
|
4282
4327
|
isEditFlow || isLoadAndEditModeRef.current ? void 0 : [newVariantMapIndexRef.current]
|
|
4283
4328
|
);
|
|
4284
|
-
const
|
|
4329
|
+
const pickTitle = (src) => {
|
|
4330
|
+
if (!src) return "";
|
|
4331
|
+
const preferred = ["rule_title", "ruleTitle", "title", "template_title"];
|
|
4332
|
+
const keys = [
|
|
4333
|
+
...preferred.filter((k) => k in src),
|
|
4334
|
+
...Object.keys(src).filter((k) => /title/i.test(k) && !preferred.includes(k))
|
|
4335
|
+
];
|
|
4336
|
+
for (const k of keys) {
|
|
4337
|
+
const v = src[k];
|
|
4338
|
+
const s = typeof v === "string" ? v : typeof (v == null ? void 0 : v.value) === "string" ? v.value : "";
|
|
4339
|
+
if (s.trim()) return s.trim();
|
|
4340
|
+
}
|
|
4341
|
+
return "";
|
|
4342
|
+
};
|
|
4343
|
+
const draftTierKey = ((_f = scopeData.tiers) == null ? void 0 : _f[0]) ? normalizeTierKey(scopeData.tiers[0]) : "tier_1";
|
|
4344
|
+
const draftVariantIdx = editVariantIndex != null ? editVariantIndex : 0;
|
|
4345
|
+
const draftRootPayload = dynamicFormSchema ? PayloadUtils.generatePayloadFromSchema(dynamicFormSchema, draftTierKey, draftVariantIdx).rootPayload : {};
|
|
4346
|
+
const effectiveRuleTitle = pickTitle(draftRootPayload) || pickTitle(dynamicGlobalData) || ruleTitle.trim();
|
|
4347
|
+
const canSaveDraft = !isEditFlow && effectiveRuleTitle.length > 0;
|
|
4285
4348
|
const saveDraftDisabledTooltip = isEditFlow ? "Drafts cannot be saved in Edit Mode." : "Add a learning title before saving a draft.";
|
|
4349
|
+
const hasRequiredFieldsForButton = () => {
|
|
4350
|
+
var _a2, _b2, _c2;
|
|
4351
|
+
if (isEditFlow) return true;
|
|
4352
|
+
const jsonSchema = ((_b2 = (_a2 = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _a2.learningMetadataComponents) == null ? void 0 : _b2.teachMe) || ((_c2 = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _c2.learningMetadataComponents);
|
|
4353
|
+
return hasRequiredFieldsForCurrentSave(jsonSchema);
|
|
4354
|
+
};
|
|
4286
4355
|
const saveDraft$1 = async () => {
|
|
4287
4356
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
4288
4357
|
if (!canSaveDraft) {
|
|
@@ -4343,8 +4412,8 @@ const InstantLearningModalDynamic = ({
|
|
|
4343
4412
|
}
|
|
4344
4413
|
}
|
|
4345
4414
|
}, [isSaveRule, isAiStreaming]);
|
|
4346
|
-
const editTierKey = ((
|
|
4347
|
-
const editIndex = (
|
|
4415
|
+
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";
|
|
4416
|
+
const editIndex = (_i = editVariantIndex != null ? editVariantIndex : focusedVariantIndex) != null ? _i : 0;
|
|
4348
4417
|
const isVariantAccordionOpen = editVariantIndex != null;
|
|
4349
4418
|
const currentAccordionData = isVariantAccordionOpen ? structuredAIResponse == null ? void 0 : structuredAIResponse[editIndex] : null;
|
|
4350
4419
|
const activeVariant = structuredAIResponse && (structuredAIResponse == null ? void 0 : structuredAIResponse.find(
|
|
@@ -4442,7 +4511,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4442
4511
|
}
|
|
4443
4512
|
};
|
|
4444
4513
|
const uiStateVariants = isEditFlow ? buildVariantsMap() : {};
|
|
4445
|
-
const marketplaceEditVariantId = instantLearningId && isEditFlow ? "variant_0" in uiStateVariants ? "variant_0" : (
|
|
4514
|
+
const marketplaceEditVariantId = instantLearningId && isEditFlow ? "variant_0" in uiStateVariants ? "variant_0" : (_j = Object.keys(uiStateVariants)[0]) != null ? _j : null : variantIdToBeEdited;
|
|
4446
4515
|
customMetaDataRef.current = {
|
|
4447
4516
|
send_metadata_to_orchestrator: false,
|
|
4448
4517
|
is_draft_flow: isDraftFlow,
|
|
@@ -4453,12 +4522,12 @@ const InstantLearningModalDynamic = ({
|
|
|
4453
4522
|
LearningTerm: useLMSConfigStore.dt("agents.LearningTerm", "Learnings"),
|
|
4454
4523
|
mode_name: baseModeName ? baseModeName : void 0,
|
|
4455
4524
|
x_full_url: buildXFullUrl(),
|
|
4456
|
-
agents_from_ilkb_config: (
|
|
4525
|
+
agents_from_ilkb_config: (_k = useLMSConfigStore.useLMSConfigStore.getState().lmsConfig) == null ? void 0 : _k.agents,
|
|
4457
4526
|
appsecData: {
|
|
4458
|
-
application: (
|
|
4527
|
+
application: (_l = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _l : "",
|
|
4459
4528
|
scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
|
|
4460
|
-
applicationLevelModuleId: (
|
|
4461
|
-
applicationLevelResourceId: (
|
|
4529
|
+
applicationLevelModuleId: (_m = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _m : "",
|
|
4530
|
+
applicationLevelResourceId: (_n = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _n : ""
|
|
4462
4531
|
},
|
|
4463
4532
|
save_api_payload: (() => {
|
|
4464
4533
|
var _a2, _b2, _c2, _d2;
|
|
@@ -4502,7 +4571,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4502
4571
|
)) == null ? void 0 : _g2.tier_id) || "",
|
|
4503
4572
|
topic_id: null,
|
|
4504
4573
|
scope_id: effectiveRuleSetId,
|
|
4505
|
-
question_title:
|
|
4574
|
+
question_title: effectiveRuleTitle,
|
|
4506
4575
|
variantType: resolveVariantTypeForPayload(
|
|
4507
4576
|
tierKey,
|
|
4508
4577
|
targetIndex,
|
|
@@ -4578,7 +4647,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4578
4647
|
description: config.IL_CONFIG_CONSTANTS.CATEGORY
|
|
4579
4648
|
}
|
|
4580
4649
|
],
|
|
4581
|
-
originalQuestion:
|
|
4650
|
+
originalQuestion: effectiveRuleTitle,
|
|
4582
4651
|
questionId: null,
|
|
4583
4652
|
variantType: resolveVariantTypeForPayload(
|
|
4584
4653
|
tierKey,
|
|
@@ -4727,7 +4796,7 @@ const InstantLearningModalDynamic = ({
|
|
|
4727
4796
|
backward_compatibility: useLearningTemplateStore.useLearningTemplateStore.getState().backwardCompatibility,
|
|
4728
4797
|
ruleset_id: effectiveRuleSetId,
|
|
4729
4798
|
...initialRuleSetId ? { initial_ruleset_id: initialRuleSetId } : {},
|
|
4730
|
-
current_variants_length: editingRule ? Array.isArray(structuredAIResponse) && structuredAIResponse.length > 0 ? Math.max(((
|
|
4799
|
+
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,
|
|
4731
4800
|
tiers: useLearningTemplateStore.useLearningTemplateStore.getState().tiers,
|
|
4732
4801
|
authToken: (user == null ? void 0 : user.accessToken) || "",
|
|
4733
4802
|
...is_publishing && { is_publishing }
|
|
@@ -4989,8 +5058,8 @@ const InstantLearningModalDynamic = ({
|
|
|
4989
5058
|
// JSON-driven operational config (dropdown option sources + host-prefilled
|
|
4990
5059
|
// values). Kept out of uiStateLabels so labels stay label-only; the schema
|
|
4991
5060
|
// renderer / ComponentRegistry read these off uiState.
|
|
4992
|
-
dynamicOptions: (
|
|
4993
|
-
prefilledData: (
|
|
5061
|
+
dynamicOptions: (_q = dynamicFormConfig == null ? void 0 : dynamicFormConfig.dynamicOptions) != null ? _q : {},
|
|
5062
|
+
prefilledData: (_r = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData) != null ? _r : {},
|
|
4994
5063
|
...ilLabels,
|
|
4995
5064
|
scrollTrigger,
|
|
4996
5065
|
...uiStateLabels,
|
|
@@ -5619,7 +5688,7 @@ const InstantLearningModalDynamic = ({
|
|
|
5619
5688
|
ThinkingBulbIconComponent: /* @__PURE__ */ jsxRuntime.jsx(MockBulbIcon, {}),
|
|
5620
5689
|
customSections: customSections != null ? customSections : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
5621
5690
|
customMetaData: customMetaDataRef,
|
|
5622
|
-
chatTitle: editingRule ? ((
|
|
5691
|
+
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) || ""),
|
|
5623
5692
|
formTitle: (uiState == null ? void 0 : uiState.formTitle) || configuration.FORM_TITLE,
|
|
5624
5693
|
showSavedMessage: false,
|
|
5625
5694
|
savedMessage,
|
|
@@ -5650,7 +5719,7 @@ const InstantLearningModalDynamic = ({
|
|
|
5650
5719
|
isFormDirty,
|
|
5651
5720
|
initialChatMessage: editingRule ? getEditRuleChatMessage(
|
|
5652
5721
|
editingRule.ruleTitle || "this rule",
|
|
5653
|
-
((
|
|
5722
|
+
((_u = editingVariants == null ? void 0 : editingVariants[focusedVariantIndex != null ? focusedVariantIndex : 0]) == null ? void 0 : _u.is_user_accepted_risk) === true
|
|
5654
5723
|
) : initialChatMessage != null ? initialChatMessage : configuration.INITIAL_CHAT_MESSAGE,
|
|
5655
5724
|
validateCustom: () => {
|
|
5656
5725
|
var _a2, _b2, _c2;
|
|
@@ -5710,10 +5779,11 @@ const InstantLearningModalDynamic = ({
|
|
|
5710
5779
|
initialDraftMessage,
|
|
5711
5780
|
socketTimeOutInMilliSeconds: configuration.SOCKET_TIMEOUT,
|
|
5712
5781
|
userDetails: {
|
|
5713
|
-
name: `${(
|
|
5714
|
-
id: (
|
|
5715
|
-
email: (
|
|
5716
|
-
}
|
|
5782
|
+
name: `${(_v = user == null ? void 0 : user.firstname) != null ? _v : ""} ${(_w = user == null ? void 0 : user.lastname) != null ? _w : ""}`.trim() || "Guest Userr",
|
|
5783
|
+
id: (_x = user == null ? void 0 : user._id) != null ? _x : "Guest Userr",
|
|
5784
|
+
email: (_y = user == null ? void 0 : user.email) != null ? _y : "guestUserr@example.com"
|
|
5785
|
+
},
|
|
5786
|
+
hasRequiredFields: hasRequiredFieldsForButton
|
|
5717
5787
|
}
|
|
5718
5788
|
),
|
|
5719
5789
|
/* @__PURE__ */ jsxRuntime.jsx(
|