@e-llm-studio/instant-learning 1.3.22 → 1.3.24-alpha.2

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.
Files changed (50) hide show
  1. package/dist/cjs/features/LearningManagement/LearningManagement.js +27 -0
  2. package/dist/cjs/features/LearningManagement/LearningManagement.js.map +1 -1
  3. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +4 -2
  4. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
  5. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +11 -1
  6. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
  7. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +39 -29
  8. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
  9. package/dist/cjs/features/LearningManagement/utils/learningFlow.js +92 -0
  10. package/dist/cjs/features/LearningManagement/utils/learningFlow.js.map +1 -1
  11. package/dist/cjs/schema-driven/components/FileUploadField.js +76 -13
  12. package/dist/cjs/schema-driven/components/FileUploadField.js.map +1 -1
  13. package/dist/cjs/schema-driven/components/FileUploadField.module.css.js +1 -1
  14. package/dist/cjs/schema-driven/components/PromptTextEditorField.js +100 -23
  15. package/dist/cjs/schema-driven/components/PromptTextEditorField.js.map +1 -1
  16. package/dist/cjs/schema-driven/utils/fileUploadService.js +46 -0
  17. package/dist/cjs/schema-driven/utils/fileUploadService.js.map +1 -1
  18. package/dist/features/LearningManagement/LearningManagement.js +27 -0
  19. package/dist/features/LearningManagement/LearningManagement.js.map +1 -1
  20. package/dist/features/LearningManagement/LearningTemplateLayout.js +4 -2
  21. package/dist/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
  22. package/dist/features/LearningManagement/RuleContent/RuleContent.js +11 -1
  23. package/dist/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
  24. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +41 -31
  25. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
  26. package/dist/features/LearningManagement/utils/learningFlow.js +92 -1
  27. package/dist/features/LearningManagement/utils/learningFlow.js.map +1 -1
  28. package/dist/schema-driven/components/FileUploadField.js +78 -15
  29. package/dist/schema-driven/components/FileUploadField.js.map +1 -1
  30. package/dist/schema-driven/components/FileUploadField.module.css.js +1 -1
  31. package/dist/schema-driven/components/PromptTextEditorField.js +100 -23
  32. package/dist/schema-driven/components/PromptTextEditorField.js.map +1 -1
  33. package/dist/schema-driven/utils/fileUploadService.js +45 -1
  34. package/dist/schema-driven/utils/fileUploadService.js.map +1 -1
  35. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +11 -1
  36. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  37. package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
  38. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +9 -0
  39. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  40. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts +9 -0
  41. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
  42. package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
  43. package/dist/types/src/features/LearningManagement/utils/learningFlow.d.ts +4 -0
  44. package/dist/types/src/features/LearningManagement/utils/learningFlow.d.ts.map +1 -1
  45. package/dist/types/src/schema-driven/components/FileUploadField.d.ts +1 -1
  46. package/dist/types/src/schema-driven/components/FileUploadField.d.ts.map +1 -1
  47. package/dist/types/src/schema-driven/components/PromptTextEditorField.d.ts.map +1 -1
  48. package/dist/types/src/schema-driven/utils/fileUploadService.d.ts +26 -0
  49. package/dist/types/src/schema-driven/utils/fileUploadService.d.ts.map +1 -1
  50. package/package.json +5 -5
@@ -187,7 +187,7 @@ const InstantLearningModalDynamic = ({
187
187
  is_publishing,
188
188
  projectId
189
189
  }) => {
190
- 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;
190
+ 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, _z;
191
191
  const [scopeData, setScopeData] = React.useState({
192
192
  station: initialScope,
193
193
  tiers: ["Tier 1"]
@@ -266,19 +266,6 @@ const InstantLearningModalDynamic = ({
266
266
  setScopeData((prev) => ({ ...prev, station: initialScope }));
267
267
  }
268
268
  }, [isOpen, initialScope]);
269
- React.useEffect(() => {
270
- if (!isOpen) {
271
- useDynamicFormStore.useDynamicFormStore.getState().resetStore();
272
- return;
273
- }
274
- hasSnapshottedForCloseRef.current = false;
275
- hasInvokedPostSaveCallbackRef.current = false;
276
- hasInvokedSuccessfulSaveCloseCallbackRef.current = false;
277
- const prefilled = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData;
278
- if (prefilled && Object.keys(prefilled).length > 0) {
279
- useDynamicFormStore.useDynamicFormStore.getState().initializeStore(prefilled);
280
- }
281
- }, [isOpen, dynamicFormConfig]);
282
269
  React.useEffect(() => {
283
270
  return () => {
284
271
  useDynamicFormStore.useDynamicFormStore.getState().resetStore();
@@ -296,10 +283,20 @@ const InstantLearningModalDynamic = ({
296
283
  return (_d2 = (_b2 = (_a2 = s.teachMeConfig) == null ? void 0 : _a2.learningMetadataComponents) == null ? void 0 : _b2.teachMe) != null ? _d2 : (_c2 = s.teachMeConfig) == null ? void 0 : _c2.learningMetadataComponents;
297
284
  }
298
285
  );
299
- const fieldLabelMap = React.useMemo(
300
- () => dynamicFormSchema ? PayloadUtils.buildFieldLabelMap(dynamicFormSchema) : void 0,
301
- [dynamicFormSchema]
302
- );
286
+ console.log(dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData, "dynamicFormConfig?.prefilledData");
287
+ React.useEffect(() => {
288
+ if (!isOpen) {
289
+ useDynamicFormStore.useDynamicFormStore.getState().resetStore();
290
+ return;
291
+ }
292
+ hasSnapshottedForCloseRef.current = false;
293
+ hasInvokedPostSaveCallbackRef.current = false;
294
+ hasInvokedSuccessfulSaveCloseCallbackRef.current = false;
295
+ const prefilled = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData;
296
+ if (prefilled && Object.keys(prefilled).length > 0) {
297
+ useDynamicFormStore.useDynamicFormStore.getState().initializeStore(prefilled);
298
+ }
299
+ }, [isOpen, dynamicFormConfig]);
303
300
  React.useEffect(() => {
304
301
  var _a2;
305
302
  if (!isOpen || learningFlow.resolveIsEditMode({ flow, editingRule, editingVariants })) return;
@@ -311,6 +308,15 @@ const InstantLearningModalDynamic = ({
311
308
  useDynamicFormStore.useDynamicFormStore.getState().initializeStore({}, variantData);
312
309
  }
313
310
  }, [isOpen, dynamicFormConfig, dynamicFormSchema, flow, editingRule, editingVariants]);
311
+ React.useEffect(() => {
312
+ var _a2;
313
+ if (!isOpen) return;
314
+ learningFlow.seedHostFormValues(dynamicFormSchema, (_a2 = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData) != null ? _a2 : {});
315
+ }, [isOpen, dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData, dynamicFormSchema]);
316
+ const fieldLabelMap = React.useMemo(
317
+ () => dynamicFormSchema ? PayloadUtils.buildFieldLabelMap(dynamicFormSchema) : void 0,
318
+ [dynamicFormSchema]
319
+ );
314
320
  const selectedRuleSetId = useLearningTemplateStore.useLearningTemplateStore((state) => state.selectedRuleSetId);
315
321
  const schemaRuleSetId = PayloadUtils.resolveSchemaRuleSetId(
316
322
  ((_b = (_a = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _a.learningMetadataComponents) == null ? void 0 : _b.teachMe) || ((_c = useLMSConfigStore.useTeachMeConfigStore.getState().teachMeConfig) == null ? void 0 : _c.learningMetadataComponents),
@@ -1151,6 +1157,7 @@ const InstantLearningModalDynamic = ({
1151
1157
  prefilled,
1152
1158
  PayloadUtils.getVariantPrefilledData(dynamicFormSchema, prefilled)
1153
1159
  );
1160
+ learningFlow.seedHostFormValues(dynamicFormSchema, prefilled);
1154
1161
  }
1155
1162
  }
1156
1163
  if (!useExternalWorkflowStore.useExternalWorkflowStore.getState().isContinueModalOpen) {
@@ -3585,7 +3592,7 @@ const InstantLearningModalDynamic = ({
3585
3592
  const tierWtaMap = whenToApplyConditions.get(tierKey);
3586
3593
  const tierWntaMap = whenNotToApplyConditions.get(tierKey);
3587
3594
  variantsToUpdate.forEach((variant, index) => {
3588
- 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;
3595
+ 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, _z2, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
3589
3596
  const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.description || "";
3590
3597
  const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
3591
3598
  const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
@@ -3801,7 +3808,7 @@ const InstantLearningModalDynamic = ({
3801
3808
  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),
3802
3809
  is_enabled: variant.is_enabled,
3803
3810
  appsecData: {
3804
- application: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _z : "",
3811
+ application: (_z2 = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _z2 : "",
3805
3812
  scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
3806
3813
  applicationLevelModuleId: (_A = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _A : "",
3807
3814
  applicationLevelResourceId: (_B = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _B : ""
@@ -3959,7 +3966,7 @@ const InstantLearningModalDynamic = ({
3959
3966
  const tierWtaMap = whenToApplyConditions.get(tierKey);
3960
3967
  const tierWntaMap = whenNotToApplyConditions.get(tierKey);
3961
3968
  allVariants.forEach((variant, index) => {
3962
- 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;
3969
+ 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, _z2, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
3963
3970
  const description = (tierDescMap == null ? void 0 : tierDescMap.get(index)) || variant.rule_description || variant.description || "";
3964
3971
  const wtaConditions = (tierWtaMap == null ? void 0 : tierWtaMap.get(index)) || [];
3965
3972
  const wntaConditions = (tierWntaMap == null ? void 0 : tierWntaMap.get(index)) || [];
@@ -4169,7 +4176,7 @@ const InstantLearningModalDynamic = ({
4169
4176
  application: (_x2 = rbacConfig == null ? void 0 : rbacConfig.applicationId) != null ? _x2 : "",
4170
4177
  scopeLevelModuleId: (rbacConfig == null ? void 0 : rbacConfig.moduleId) || "",
4171
4178
  applicationLevelModuleId: (_y2 = rbacConfig == null ? void 0 : rbacConfig.applicationModuleId) != null ? _y2 : "",
4172
- applicationLevelResourceId: (_z = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _z : ""
4179
+ applicationLevelResourceId: (_z2 = rbacConfig == null ? void 0 : rbacConfig.applicationResourceId) != null ? _z2 : ""
4173
4180
  }
4174
4181
  };
4175
4182
  const baselineVariants = baselineTierVariants.get(tierKey) || [];
@@ -5063,12 +5070,15 @@ const InstantLearningModalDynamic = ({
5063
5070
  setPendingEditId,
5064
5071
  conflictReason,
5065
5072
  usedFor: learningFlow.resolveIsEditMode({ flow: flow != null ? flow : mode === "EDIT" ? "edit" : void 0, editingRule, editingVariants }) ? "Edit" : "Create",
5073
+ scopeId: effectiveRuleSetId,
5074
+ instanceId: (_q = useLearningTemplateStore.useLearningTemplateStore.getState().ilInstanceId) != null ? _q : void 0,
5075
+ appIntegrationId: applicationIntegrationId,
5066
5076
  projectId: projectId || (uiStateLabels == null ? void 0 : uiStateLabels.projectId),
5067
5077
  // JSON-driven operational config (dropdown option sources + host-prefilled
5068
5078
  // values). Kept out of uiStateLabels so labels stay label-only; the schema
5069
5079
  // renderer / ComponentRegistry read these off uiState.
5070
- dynamicOptions: (_q = dynamicFormConfig == null ? void 0 : dynamicFormConfig.dynamicOptions) != null ? _q : {},
5071
- prefilledData: (_r = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData) != null ? _r : {},
5080
+ dynamicOptions: (_r = dynamicFormConfig == null ? void 0 : dynamicFormConfig.dynamicOptions) != null ? _r : {},
5081
+ prefilledData: (_s = dynamicFormConfig == null ? void 0 : dynamicFormConfig.prefilledData) != null ? _s : {},
5072
5082
  ...ilLabels,
5073
5083
  scrollTrigger,
5074
5084
  ...uiStateLabels,
@@ -5713,7 +5723,7 @@ const InstantLearningModalDynamic = ({
5713
5723
  ThinkingBulbIconComponent: /* @__PURE__ */ jsxRuntime.jsx(MockBulbIcon, {}),
5714
5724
  customSections: customSections != null ? customSections : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
5715
5725
  customMetaData: customMetaDataRef,
5716
- 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) || ""),
5726
+ chatTitle: editingRule ? ((_t = uiStateLabels == null ? void 0 : uiStateLabels.chatTitleEdit) != null ? _t : configuration.CHAT_TITLE_EDIT).replace("{scope}", (ruleSet == null ? void 0 : ruleSet.ruleSetName) || "") : ((_u = uiStateLabels == null ? void 0 : uiStateLabels.chatTitle) != null ? _u : configuration.CHAT_TITLE).replace("{scope}", (ruleSet == null ? void 0 : ruleSet.ruleSetName) || ""),
5717
5727
  formTitle: (uiState == null ? void 0 : uiState.formTitle) || configuration.FORM_TITLE,
5718
5728
  showSavedMessage: false,
5719
5729
  savedMessage,
@@ -5748,7 +5758,7 @@ const InstantLearningModalDynamic = ({
5748
5758
  isFormDirty,
5749
5759
  initialChatMessage: editingRule ? getEditRuleChatMessage(
5750
5760
  editingRule.ruleTitle || "this rule",
5751
- ((_u = editingVariants == null ? void 0 : editingVariants[focusedVariantIndex != null ? focusedVariantIndex : 0]) == null ? void 0 : _u.is_user_accepted_risk) === true
5761
+ ((_v = editingVariants == null ? void 0 : editingVariants[focusedVariantIndex != null ? focusedVariantIndex : 0]) == null ? void 0 : _v.is_user_accepted_risk) === true
5752
5762
  ) : initialChatMessage != null ? initialChatMessage : configuration.INITIAL_CHAT_MESSAGE,
5753
5763
  validateCustom: () => {
5754
5764
  var _a2, _b2, _c2;
@@ -5808,9 +5818,9 @@ const InstantLearningModalDynamic = ({
5808
5818
  initialDraftMessage,
5809
5819
  socketTimeOutInMilliSeconds: configuration.SOCKET_TIMEOUT,
5810
5820
  userDetails: {
5811
- name: `${(_v = user == null ? void 0 : user.firstname) != null ? _v : ""} ${(_w = user == null ? void 0 : user.lastname) != null ? _w : ""}`.trim() || "Guest Userr",
5812
- id: (_x = user == null ? void 0 : user._id) != null ? _x : "Guest Userr",
5813
- email: (_y = user == null ? void 0 : user.email) != null ? _y : "guestUserr@example.com"
5821
+ name: `${(_w = user == null ? void 0 : user.firstname) != null ? _w : ""} ${(_x = user == null ? void 0 : user.lastname) != null ? _x : ""}`.trim() || "Guest Userr",
5822
+ id: (_y = user == null ? void 0 : user._id) != null ? _y : "Guest Userr",
5823
+ email: (_z = user == null ? void 0 : user.email) != null ? _z : "guestUserr@example.com"
5814
5824
  },
5815
5825
  hasRequiredFields: hasRequiredFieldsForButton
5816
5826
  }