@e-llm-studio/instant-learning 1.3.8 → 1.3.9
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/ComponentRegistry.js +52 -12
- package/dist/ComponentRegistry.js.map +1 -1
- package/dist/cjs/ComponentRegistry.js +52 -12
- package/dist/cjs/ComponentRegistry.js.map +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +62 -2
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +55 -7
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/cjs/schema-driven/components/GroupEditRow.js +4 -0
- package/dist/cjs/schema-driven/components/GroupEditRow.js.map +1 -1
- package/dist/cjs/schema-driven/components/RepeatableSectionField.js +247 -0
- package/dist/cjs/schema-driven/components/RepeatableSectionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/TableComponent.js +11 -2
- package/dist/cjs/schema-driven/components/TableComponent.js.map +1 -1
- package/dist/cjs/schema-driven/helper.js +14 -4
- package/dist/cjs/schema-driven/helper.js.map +1 -1
- package/dist/cjs/schema-driven/hooks/useSectionEditSession.js +2 -1
- package/dist/cjs/schema-driven/hooks/useSectionEditSession.js.map +1 -1
- package/dist/cjs/schema-driven/types.js.map +1 -1
- package/dist/cjs/schema-driven/utils/PayloadUtils.js +22 -12
- package/dist/cjs/schema-driven/utils/PayloadUtils.js.map +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +62 -2
- package/dist/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +55 -7
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/schema-driven/components/GroupEditRow.js +4 -0
- package/dist/schema-driven/components/GroupEditRow.js.map +1 -1
- package/dist/schema-driven/components/RepeatableSectionField.js +243 -0
- package/dist/schema-driven/components/RepeatableSectionField.js.map +1 -0
- package/dist/schema-driven/components/TableComponent.js +11 -2
- package/dist/schema-driven/components/TableComponent.js.map +1 -1
- package/dist/schema-driven/helper.js +14 -4
- package/dist/schema-driven/helper.js.map +1 -1
- package/dist/schema-driven/hooks/useSectionEditSession.js +2 -1
- package/dist/schema-driven/hooks/useSectionEditSession.js.map +1 -1
- package/dist/schema-driven/types.js.map +1 -1
- package/dist/schema-driven/utils/PayloadUtils.js +22 -12
- package/dist/schema-driven/utils/PayloadUtils.js.map +1 -1
- package/dist/types/src/ComponentRegistry.d.ts.map +1 -1
- package/dist/types/src/ILMarketplaceMockTest.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts +30 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts +12 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/GroupEditRow.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/RepeatableSectionField.d.ts +11 -0
- package/dist/types/src/schema-driven/components/RepeatableSectionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/TableComponent.d.ts.map +1 -1
- package/dist/types/src/schema-driven/helper.d.ts +1 -1
- package/dist/types/src/schema-driven/helper.d.ts.map +1 -1
- package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts.map +1 -1
- package/dist/types/src/schema-driven/types.d.ts +6 -0
- package/dist/types/src/schema-driven/types.d.ts.map +1 -1
- package/dist/types/src/schema-driven/utils/PayloadUtils.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -2,18 +2,58 @@ import React__default from 'react';
|
|
|
2
2
|
import FallbackField from './schema-driven/FallbackField.js';
|
|
3
3
|
|
|
4
4
|
const componentRegistry = {
|
|
5
|
-
TextInput: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
TextInput: {
|
|
6
|
+
importPath: () => import('./schema-driven/components/TextInputField.js'),
|
|
7
|
+
isContainer: false
|
|
8
|
+
},
|
|
9
|
+
PageRangeInput: {
|
|
10
|
+
importPath: () => import('./schema-driven/components/PageRangeInputField.js'),
|
|
11
|
+
isContainer: false
|
|
12
|
+
},
|
|
13
|
+
FlexRow: {
|
|
14
|
+
importPath: () => import('./schema-driven/components/GroupEditRow.js'),
|
|
15
|
+
isContainer: true
|
|
16
|
+
},
|
|
17
|
+
DropdownSection: {
|
|
18
|
+
importPath: () => import('./schema-driven/components/DropdownSectionField.js'),
|
|
19
|
+
isContainer: false
|
|
20
|
+
},
|
|
21
|
+
ConditionSection: {
|
|
22
|
+
importPath: () => import('./schema-driven/components/ConditionSectionField.js'),
|
|
23
|
+
isContainer: false
|
|
24
|
+
},
|
|
25
|
+
ConfigSection: {
|
|
26
|
+
importPath: () => import('./schema-driven/components/ConfigSectionField.js'),
|
|
27
|
+
isContainer: false
|
|
28
|
+
},
|
|
29
|
+
ScopeSection: {
|
|
30
|
+
importPath: () => import('./schema-driven/components/ScopeSectionField.js'),
|
|
31
|
+
isContainer: false
|
|
32
|
+
},
|
|
33
|
+
PromptTextEditor: {
|
|
34
|
+
importPath: () => import('./schema-driven/components/PromptTextEditorField.js'),
|
|
35
|
+
isContainer: false
|
|
36
|
+
},
|
|
37
|
+
Accordion: {
|
|
38
|
+
importPath: () => import('./schema-driven/primitives/Accordion.js'),
|
|
39
|
+
isContainer: true
|
|
40
|
+
},
|
|
41
|
+
VariantListWrapper: {
|
|
42
|
+
importPath: () => import('./schema-driven/components/VariantListField.js'),
|
|
43
|
+
isContainer: true
|
|
44
|
+
},
|
|
45
|
+
RepeatableSection: {
|
|
46
|
+
importPath: () => import('./schema-driven/components/RepeatableSectionField.js'),
|
|
47
|
+
isContainer: true
|
|
48
|
+
},
|
|
49
|
+
GlobalSetupAccordion: {
|
|
50
|
+
importPath: () => import('./schema-driven/components/GlobalSetupAccordionField.js'),
|
|
51
|
+
isContainer: true
|
|
52
|
+
},
|
|
53
|
+
TableComponent: {
|
|
54
|
+
importPath: () => import('./schema-driven/components/TableComponent.js'),
|
|
55
|
+
isContainer: false
|
|
56
|
+
}
|
|
17
57
|
};
|
|
18
58
|
const isRegistryComponentName = (name) => name in componentRegistry;
|
|
19
59
|
const lazyCache = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRegistry.js","sources":["../src/ComponentRegistry.tsx"],"sourcesContent":["// src/ComponentRegistry.tsx\nimport React from 'react';\nimport FallbackField from './schema-driven/FallbackField';\n\nexport interface RegistryEntry {\n importPath: () => Promise<{ default: React.ComponentType<any> }>;\n isContainer?: boolean; // container components receive `renderChildren` to render nested `properties`\n}\n\n// ─── COMPONENT DICTIONARY ────────────────────────────────\n// Maps a schema's `bpa_ui_component` to a lazily-loaded component. Each component\n// lives in its own file under schema-driven/components — to add one, create a file\n// with a default export and register a line here. Keep this file registration-only.\nexport const componentRegistry: Record<string, RegistryEntry> = {\n TextInput:
|
|
1
|
+
{"version":3,"file":"ComponentRegistry.js","sources":["../src/ComponentRegistry.tsx"],"sourcesContent":["// src/ComponentRegistry.tsx\nimport React from 'react';\nimport FallbackField from './schema-driven/FallbackField';\n\nexport interface RegistryEntry {\n importPath: () => Promise<{ default: React.ComponentType<any> }>;\n isContainer?: boolean; // container components receive `renderChildren` to render nested `properties`\n}\n\n// ─── COMPONENT DICTIONARY ────────────────────────────────\n// Maps a schema's `bpa_ui_component` to a lazily-loaded component. Each component\n// lives in its own file under schema-driven/components — to add one, create a file\n// with a default export and register a line here. Keep this file registration-only.\nexport const componentRegistry: Record<string, RegistryEntry> = {\n TextInput: {\n importPath: () => import('./schema-driven/components/TextInputField'),\n isContainer: false,\n },\n PageRangeInput: {\n importPath: () => import('./schema-driven/components/PageRangeInputField'),\n isContainer: false,\n },\n FlexRow: {\n importPath: () => import('./schema-driven/components/GroupEditRow'),\n isContainer: true,\n },\n DropdownSection: {\n importPath: () => import('./schema-driven/components/DropdownSectionField'),\n isContainer: false,\n },\n ConditionSection: {\n importPath: () => import('./schema-driven/components/ConditionSectionField'),\n isContainer: false,\n },\n ConfigSection: {\n importPath: () => import('./schema-driven/components/ConfigSectionField'),\n isContainer: false,\n },\n ScopeSection: {\n importPath: () => import('./schema-driven/components/ScopeSectionField'),\n isContainer: false,\n },\n PromptTextEditor: {\n importPath: () => import('./schema-driven/components/PromptTextEditorField'),\n isContainer: false,\n },\n Accordion: {\n importPath: () => import('./schema-driven/primitives/Accordion'),\n isContainer: true,\n },\n VariantListWrapper: {\n importPath: () => import('./schema-driven/components/VariantListField'),\n isContainer: true,\n },\n RepeatableSection: {\n importPath: () => import('./schema-driven/components/RepeatableSectionField'),\n isContainer: true,\n },\n GlobalSetupAccordion: {\n importPath: () => import('./schema-driven/components/GlobalSetupAccordionField'),\n isContainer: true,\n },\n TableComponent: {\n importPath: () => import('./schema-driven/components/TableComponent'),\n isContainer: false,\n },\n};\n\n// ─── UTILITIES & CACHE ────────────────────────────────\nexport const isRegistryComponentName = (name: string): boolean => name in componentRegistry;\n\nconst lazyCache = new Map<string, React.LazyExoticComponent<React.ComponentType<any>>>();\n\nexport const resolveRegistryComponent = (\n name?: string | null\n): React.LazyExoticComponent<React.ComponentType<any>> | null => {\n if (!name) return null;\n if (!isRegistryComponentName(name)) {\n console.warn(`[componentRegistry] Unknown bpa_ui_component: \"${name}\"`);\n return null;\n }\n\n if (!lazyCache.has(name)) {\n lazyCache.set(name, React.lazy(componentRegistry[name].importPath));\n }\n return lazyCache.get(name)!;\n};\n\nexport const resolveRegistryComponentOrFallback = (name?: string | null) =>\n resolveRegistryComponent(name) ?? FallbackField;\n\nexport const isContainerComponent = (name?: string | null): boolean =>\n !!name && isRegistryComponentName(name) && !!componentRegistry[name].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KAAA,CAAC,CAAC,IAAA,IAAQ,uBAAwB,CAAA,IAAI,CAAK,IAAA,CAAC,CAAC,iBAAA,CAAkB,IAAI,CAAE,CAAA;;;;"}
|
|
@@ -10,18 +10,58 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
|
|
12
12
|
const componentRegistry = {
|
|
13
|
-
TextInput: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
TextInput: {
|
|
14
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/TextInputField.js'); }),
|
|
15
|
+
isContainer: false
|
|
16
|
+
},
|
|
17
|
+
PageRangeInput: {
|
|
18
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/PageRangeInputField.js'); }),
|
|
19
|
+
isContainer: false
|
|
20
|
+
},
|
|
21
|
+
FlexRow: {
|
|
22
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/GroupEditRow.js'); }),
|
|
23
|
+
isContainer: true
|
|
24
|
+
},
|
|
25
|
+
DropdownSection: {
|
|
26
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/DropdownSectionField.js'); }),
|
|
27
|
+
isContainer: false
|
|
28
|
+
},
|
|
29
|
+
ConditionSection: {
|
|
30
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/ConditionSectionField.js'); }),
|
|
31
|
+
isContainer: false
|
|
32
|
+
},
|
|
33
|
+
ConfigSection: {
|
|
34
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/ConfigSectionField.js'); }),
|
|
35
|
+
isContainer: false
|
|
36
|
+
},
|
|
37
|
+
ScopeSection: {
|
|
38
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/ScopeSectionField.js'); }),
|
|
39
|
+
isContainer: false
|
|
40
|
+
},
|
|
41
|
+
PromptTextEditor: {
|
|
42
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/PromptTextEditorField.js'); }),
|
|
43
|
+
isContainer: false
|
|
44
|
+
},
|
|
45
|
+
Accordion: {
|
|
46
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/primitives/Accordion.js'); }),
|
|
47
|
+
isContainer: true
|
|
48
|
+
},
|
|
49
|
+
VariantListWrapper: {
|
|
50
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/VariantListField.js'); }),
|
|
51
|
+
isContainer: true
|
|
52
|
+
},
|
|
53
|
+
RepeatableSection: {
|
|
54
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/RepeatableSectionField.js'); }),
|
|
55
|
+
isContainer: true
|
|
56
|
+
},
|
|
57
|
+
GlobalSetupAccordion: {
|
|
58
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/GlobalSetupAccordionField.js'); }),
|
|
59
|
+
isContainer: true
|
|
60
|
+
},
|
|
61
|
+
TableComponent: {
|
|
62
|
+
importPath: () => Promise.resolve().then(function () { return require('./schema-driven/components/TableComponent.js'); }),
|
|
63
|
+
isContainer: false
|
|
64
|
+
}
|
|
25
65
|
};
|
|
26
66
|
const isRegistryComponentName = (name) => name in componentRegistry;
|
|
27
67
|
const lazyCache = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRegistry.js","sources":["../../src/ComponentRegistry.tsx"],"sourcesContent":["// src/ComponentRegistry.tsx\nimport React from 'react';\nimport FallbackField from './schema-driven/FallbackField';\n\nexport interface RegistryEntry {\n importPath: () => Promise<{ default: React.ComponentType<any> }>;\n isContainer?: boolean; // container components receive `renderChildren` to render nested `properties`\n}\n\n// ─── COMPONENT DICTIONARY ────────────────────────────────\n// Maps a schema's `bpa_ui_component` to a lazily-loaded component. Each component\n// lives in its own file under schema-driven/components — to add one, create a file\n// with a default export and register a line here. Keep this file registration-only.\nexport const componentRegistry: Record<string, RegistryEntry> = {\n TextInput:
|
|
1
|
+
{"version":3,"file":"ComponentRegistry.js","sources":["../../src/ComponentRegistry.tsx"],"sourcesContent":["// src/ComponentRegistry.tsx\nimport React from 'react';\nimport FallbackField from './schema-driven/FallbackField';\n\nexport interface RegistryEntry {\n importPath: () => Promise<{ default: React.ComponentType<any> }>;\n isContainer?: boolean; // container components receive `renderChildren` to render nested `properties`\n}\n\n// ─── COMPONENT DICTIONARY ────────────────────────────────\n// Maps a schema's `bpa_ui_component` to a lazily-loaded component. Each component\n// lives in its own file under schema-driven/components — to add one, create a file\n// with a default export and register a line here. Keep this file registration-only.\nexport const componentRegistry: Record<string, RegistryEntry> = {\n TextInput: {\n importPath: () => import('./schema-driven/components/TextInputField'),\n isContainer: false,\n },\n PageRangeInput: {\n importPath: () => import('./schema-driven/components/PageRangeInputField'),\n isContainer: false,\n },\n FlexRow: {\n importPath: () => import('./schema-driven/components/GroupEditRow'),\n isContainer: true,\n },\n DropdownSection: {\n importPath: () => import('./schema-driven/components/DropdownSectionField'),\n isContainer: false,\n },\n ConditionSection: {\n importPath: () => import('./schema-driven/components/ConditionSectionField'),\n isContainer: false,\n },\n ConfigSection: {\n importPath: () => import('./schema-driven/components/ConfigSectionField'),\n isContainer: false,\n },\n ScopeSection: {\n importPath: () => import('./schema-driven/components/ScopeSectionField'),\n isContainer: false,\n },\n PromptTextEditor: {\n importPath: () => import('./schema-driven/components/PromptTextEditorField'),\n isContainer: false,\n },\n Accordion: {\n importPath: () => import('./schema-driven/primitives/Accordion'),\n isContainer: true,\n },\n VariantListWrapper: {\n importPath: () => import('./schema-driven/components/VariantListField'),\n isContainer: true,\n },\n RepeatableSection: {\n importPath: () => import('./schema-driven/components/RepeatableSectionField'),\n isContainer: true,\n },\n GlobalSetupAccordion: {\n importPath: () => import('./schema-driven/components/GlobalSetupAccordionField'),\n isContainer: true,\n },\n TableComponent: {\n importPath: () => import('./schema-driven/components/TableComponent'),\n isContainer: false,\n },\n};\n\n// ─── UTILITIES & CACHE ────────────────────────────────\nexport const isRegistryComponentName = (name: string): boolean => name in componentRegistry;\n\nconst lazyCache = new Map<string, React.LazyExoticComponent<React.ComponentType<any>>>();\n\nexport const resolveRegistryComponent = (\n name?: string | null\n): React.LazyExoticComponent<React.ComponentType<any>> | null => {\n if (!name) return null;\n if (!isRegistryComponentName(name)) {\n console.warn(`[componentRegistry] Unknown bpa_ui_component: \"${name}\"`);\n return null;\n }\n\n if (!lazyCache.has(name)) {\n lazyCache.set(name, React.lazy(componentRegistry[name].importPath));\n }\n return lazyCache.get(name)!;\n};\n\nexport const resolveRegistryComponentOrFallback = (name?: string | null) =>\n resolveRegistryComponent(name) ?? FallbackField;\n\nexport const isContainerComponent = (name?: string | null): boolean =>\n !!name && isRegistryComponentName(name) && !!componentRegistry[name].isContainer;\n"],"names":["React","FallbackField"],"mappings":";;;;;;;;;;;AAaO,MAAM,iBAAmD,GAAA;AAAA,EAC9D,SAAW,EAAA;AAAA,IACT,UAAA,EAAY,MAAM,oDAAO,8CAA2C,KAAA;AAAA,IACpE,WAAa,EAAA,KAAA;AAAA,GACf;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,UAAA,EAAY,MAAM,oDAAO,mDAAgD,KAAA;AAAA,IACzE,WAAa,EAAA,KAAA;AAAA,GACf;AAAA,EACA,OAAS,EAAA;AAAA,IACP,UAAA,EAAY,MAAM,oDAAO,4CAAyC,KAAA;AAAA,IAClE,WAAa,EAAA,IAAA;AAAA,GACf;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,UAAA,EAAY,MAAM,oDAAO,oDAAiD,KAAA;AAAA,IAC1E,WAAa,EAAA,KAAA;AAAA,GACf;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,UAAA,EAAY,MAAM,oDAAO,qDAAkD,KAAA;AAAA,IAC3E,WAAa,EAAA,KAAA;AAAA,GACf;A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AAA,IAAA,CAAK,CAAkD,+CAAA,EAAA,IAAI,CAAG,CAAA,CAAA,CAAA,CAAA;AACtE,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAA,IAAI,CAAC,SAAA,CAAU,GAAI,CAAA,IAAI,CAAG,EAAA;AACxB,IAAU,SAAA,CAAA,GAAA,CAAI,MAAMA,yBAAM,CAAA,IAAA,CAAK,kBAAkB,IAAI,CAAA,CAAE,UAAU,CAAC,CAAA,CAAA;AAAA,GACpE;AACA,EAAO,OAAA,SAAA,CAAU,IAAI,IAAI,CAAA,CAAA;AAC3B,EAAA;AAEa,MAAA,kCAAA,GAAqC,CAAC,IAAsB,KAAA;AAxFzE,EAAA,IAAA,EAAA,CAAA;AAyFE,EAAyB,OAAA,CAAA,EAAA,GAAA,wBAAA,CAAA,IAAI,MAA7B,IAAkC,GAAA,EAAA,GAAAC,wBAAA,CAAA;AAAA,EAAA;AAE7B,MAAM,oBAAuB,GAAA,CAAC,IACnC,KAAA,CAAC,CAAC,IAAA,IAAQ,uBAAwB,CAAA,IAAI,CAAK,IAAA,CAAC,CAAC,iBAAA,CAAkB,IAAI,CAAE,CAAA;;;;;;;;"}
|
|
@@ -4156,7 +4156,7 @@ const InstantLearningModal = ({
|
|
|
4156
4156
|
setSaveApiStatus(apiConstants.SUCCESS);
|
|
4157
4157
|
setSavedMessage("Your learning draft has been saved successfully.");
|
|
4158
4158
|
setIsSavedSuccessfully(true);
|
|
4159
|
-
await (
|
|
4159
|
+
await invokePostSave("draft");
|
|
4160
4160
|
handleClose();
|
|
4161
4161
|
} catch (error) {
|
|
4162
4162
|
console.error("[DRAFT FLOW] Failed to save draft:", error);
|
|
@@ -4690,6 +4690,46 @@ const InstantLearningModal = ({
|
|
|
4690
4690
|
tiers: useLearningTemplateStore.useLearningTemplateStore.getState().tiers,
|
|
4691
4691
|
authToken: (user == null ? void 0 : user.accessToken) || ""
|
|
4692
4692
|
};
|
|
4693
|
+
const formStateBuilderRef = React.useRef();
|
|
4694
|
+
formStateBuilderRef.current = (mode) => {
|
|
4695
|
+
var _a2, _b2, _c2, _d2;
|
|
4696
|
+
const created = (_a2 = useLearningTemplateStore.useLearningTemplateStore.getState().createdVariantInfo) != null ? _a2 : [];
|
|
4697
|
+
const tierKeys = scopeData.tiers.map(normalizeTierKey);
|
|
4698
|
+
const clean = (items = []) => items.map((c) => sanitizeConditionText(c.text)).filter(Boolean);
|
|
4699
|
+
const variants = [];
|
|
4700
|
+
tierKeys.forEach((tierKey) => {
|
|
4701
|
+
var _a3, _b3, _c3, _d3;
|
|
4702
|
+
const createdForTier = (_b3 = (_a3 = created.find((c) => c.tierName === tierKey)) == null ? void 0 : _a3.variants) != null ? _b3 : [];
|
|
4703
|
+
Array.from((_d3 = (_c3 = configData.get(tierKey)) == null ? void 0 : _c3.keys()) != null ? _d3 : []).forEach((index, i) => {
|
|
4704
|
+
var _a4, _b4, _c4, _d4, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
|
|
4705
|
+
const item = (structuredAIResponse || [])[index] || {};
|
|
4706
|
+
const id = (_e2 = (_d4 = (_b4 = (_a4 = editingVariants == null ? void 0 : editingVariants[index]) == null ? void 0 : _a4.variantId) != null ? _b4 : item.variant_id) != null ? _d4 : (_c4 = createdForTier[i]) == null ? void 0 : _c4.id) != null ? _e2 : null;
|
|
4707
|
+
const meta = {
|
|
4708
|
+
...careLearningMetadataByVariant[id != null ? id : ""] || {},
|
|
4709
|
+
...item.learning_metadata || {}
|
|
4710
|
+
};
|
|
4711
|
+
variants.push({
|
|
4712
|
+
variantId: id,
|
|
4713
|
+
tier: tierKey,
|
|
4714
|
+
isDefault: !!((_g2 = (_f2 = configData.get(tierKey)) == null ? void 0 : _f2.get(index)) == null ? void 0 : _g2.is_default_enabled),
|
|
4715
|
+
description: filterText(((_h2 = ruleDescription.get(tierKey)) == null ? void 0 : _h2.get(index)) || ""),
|
|
4716
|
+
whenToApply: clean((_i2 = whenToApplyConditions.get(tierKey)) == null ? void 0 : _i2.get(index)),
|
|
4717
|
+
whenNotToApply: clean((_j2 = whenNotToApplyConditions.get(tierKey)) == null ? void 0 : _j2.get(index)),
|
|
4718
|
+
instructionPrompt: (_l2 = instructionPromptOverrides[(_k2 = getVariantStableKey(item)) != null ? _k2 : `idx-${index}`]) != null ? _l2 : learningMetadataUtils.getInstructionPromptValue(meta),
|
|
4719
|
+
learningMetadata: meta,
|
|
4720
|
+
schedulingConfig: pruneFlattenedDuplicates(rawAiConfig)
|
|
4721
|
+
});
|
|
4722
|
+
});
|
|
4723
|
+
});
|
|
4724
|
+
return {
|
|
4725
|
+
mode,
|
|
4726
|
+
questionId: (_c2 = (_b2 = lastLoadedQuestionIdRef.current) != null ? _b2 : editingRule == null ? void 0 : editingRule.ruleId) != null ? _c2 : null,
|
|
4727
|
+
ruleTitle,
|
|
4728
|
+
scope: { ruleSetId: (_d2 = ruleSet == null ? void 0 : ruleSet.ruleSetId) != null ? _d2 : "", station: scopeData.station, tiers: tierKeys },
|
|
4729
|
+
variants,
|
|
4730
|
+
createdVariantInfo: created
|
|
4731
|
+
};
|
|
4732
|
+
};
|
|
4693
4733
|
const nextVariantString = getNextVariantType(existingVariants);
|
|
4694
4734
|
const templateState = {
|
|
4695
4735
|
ruleTitle,
|
|
@@ -4969,7 +5009,8 @@ const InstantLearningModal = ({
|
|
|
4969
5009
|
const handleSaveSuccessAndClose = async () => {
|
|
4970
5010
|
if (postSaveCallback) {
|
|
4971
5011
|
try {
|
|
4972
|
-
|
|
5012
|
+
const mode = learningFlow.resolveIsEditMode({ flow, editingRule, editingVariants }) ? "edit" : "create";
|
|
5013
|
+
await invokePostSave(mode);
|
|
4973
5014
|
} catch (err) {
|
|
4974
5015
|
console.error("postSaveCallback threw after successful save \u2014 keeping modal open", err);
|
|
4975
5016
|
setIsError(true);
|
|
@@ -4981,6 +5022,25 @@ const InstantLearningModal = ({
|
|
|
4981
5022
|
}
|
|
4982
5023
|
handleClose();
|
|
4983
5024
|
};
|
|
5025
|
+
const invokePostSave = async (mode) => {
|
|
5026
|
+
var _a2, _b2;
|
|
5027
|
+
if (!postSaveCallback) return;
|
|
5028
|
+
let formState;
|
|
5029
|
+
try {
|
|
5030
|
+
formState = formStateBuilderRef.current(mode);
|
|
5031
|
+
} catch (e) {
|
|
5032
|
+
console.warn("[TeachMe] Failed to build form state for postSaveCallback", e);
|
|
5033
|
+
formState = {
|
|
5034
|
+
mode,
|
|
5035
|
+
questionId: (_a2 = lastLoadedQuestionIdRef.current) != null ? _a2 : null,
|
|
5036
|
+
ruleTitle,
|
|
5037
|
+
scope: { ruleSetId: (_b2 = ruleSet == null ? void 0 : ruleSet.ruleSetId) != null ? _b2 : "", station: scopeData.station, tiers: [] },
|
|
5038
|
+
variants: [],
|
|
5039
|
+
createdVariantInfo: []
|
|
5040
|
+
};
|
|
5041
|
+
}
|
|
5042
|
+
await postSaveCallback(formState);
|
|
5043
|
+
};
|
|
4984
5044
|
const hasConflictingConditions = () => {
|
|
4985
5045
|
const checkMap = (map) => {
|
|
4986
5046
|
return Array.from(map.values()).some(
|