@thanh01.pmt/interactive-quiz-kit 1.0.62 → 1.0.64

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.
@@ -72832,10 +72832,12 @@ var EditQuestionModal = ({
72832
72832
  gradeLevels = [],
72833
72833
  bloomLevels = []
72834
72834
  }) => {
72835
+ const [isMounted, setIsMounted] = React95.useState(false);
72835
72836
  const [editedQuestion, setEditedQuestion] = React95.useState(null);
72836
72837
  const [editedMetadata, setEditedMetadata] = React95.useState({});
72837
72838
  const hasDropdownMetadata = subjects.length > 0;
72838
72839
  React95.useEffect(() => {
72840
+ setIsMounted(true);
72839
72841
  if (questionData) {
72840
72842
  setEditedQuestion(JSON.parse(JSON.stringify(questionData)));
72841
72843
  setEditedMetadata({
@@ -72959,7 +72961,7 @@ var EditQuestionModal = ({
72959
72961
  if (!isOpen || !editedQuestion) return null;
72960
72962
  return /* @__PURE__ */ React95__namespace.default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
72961
72963
  if (!open) onClose();
72962
- } }, /* @__PURE__ */ React95__namespace.default.createElement(DialogContent2, { className: "w-full max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh] flex flex-col" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogHeader, { className: "shrink-0" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React95__namespace.default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React95__namespace.default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React95__namespace.default.createElement(ScrollArea2, { className: "flex-grow min-h-0 pr-6" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-6 py-4" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React95__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React95__namespace.default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e2) => handleSpecificFieldChange({ points: parseInt(e2.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React95__namespace.default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React95__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React95__namespace.default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React95__namespace.default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React95__namespace.default.createElement(DialogFooter, { className: "pt-4 border-t shrink-0" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React95__namespace.default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
72964
+ } }, /* @__PURE__ */ React95__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh]" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogHeader, null, /* @__PURE__ */ React95__namespace.default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React95__namespace.default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React95__namespace.default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React95__namespace.default.createElement(ScrollArea2, { className: "max-h-[calc(80vh-150px)] p-1 pr-6" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-6 p-4" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React95__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React95__namespace.default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e2) => handleSpecificFieldChange({ points: parseInt(e2.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React95__namespace.default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React95__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React95__namespace.default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React95__namespace.default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React95__namespace.default.createElement(DialogFooter, { className: "pt-4 border-t" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React95__namespace.default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
72963
72965
  };
72964
72966
 
72965
72967
  // src/react-ui/components/authoring/AIQuestionGeneratorModal.tsx
@@ -72767,10 +72767,12 @@ var EditQuestionModal = ({
72767
72767
  gradeLevels = [],
72768
72768
  bloomLevels = []
72769
72769
  }) => {
72770
+ const [isMounted, setIsMounted] = useState(false);
72770
72771
  const [editedQuestion, setEditedQuestion] = useState(null);
72771
72772
  const [editedMetadata, setEditedMetadata] = useState({});
72772
72773
  const hasDropdownMetadata = subjects.length > 0;
72773
72774
  useEffect(() => {
72775
+ setIsMounted(true);
72774
72776
  if (questionData) {
72775
72777
  setEditedQuestion(JSON.parse(JSON.stringify(questionData)));
72776
72778
  setEditedMetadata({
@@ -72894,7 +72896,7 @@ var EditQuestionModal = ({
72894
72896
  if (!isOpen || !editedQuestion) return null;
72895
72897
  return /* @__PURE__ */ React95__default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
72896
72898
  if (!open) onClose();
72897
- } }, /* @__PURE__ */ React95__default.createElement(DialogContent2, { className: "w-full max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh] flex flex-col" }, /* @__PURE__ */ React95__default.createElement(DialogHeader, { className: "shrink-0" }, /* @__PURE__ */ React95__default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React95__default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React95__default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React95__default.createElement(ScrollArea2, { className: "flex-grow min-h-0 pr-6" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-6 py-4" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React95__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React95__default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React95__default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e2) => handleSpecificFieldChange({ points: parseInt(e2.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React95__default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React95__default.createElement(SelectTrigger2, null, /* @__PURE__ */ React95__default.createElement(SelectValue2, null)), /* @__PURE__ */ React95__default.createElement(SelectContent2, null, /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React95__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React95__default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React95__default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React95__default.createElement(DialogFooter, { className: "pt-4 border-t shrink-0" }, /* @__PURE__ */ React95__default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React95__default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
72899
+ } }, /* @__PURE__ */ React95__default.createElement(DialogContent2, { className: "sm:max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh]" }, /* @__PURE__ */ React95__default.createElement(DialogHeader, null, /* @__PURE__ */ React95__default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React95__default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React95__default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React95__default.createElement(ScrollArea2, { className: "max-h-[calc(80vh-150px)] p-1 pr-6" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-6 p-4" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React95__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React95__default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React95__default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e2) => handleSpecificFieldChange({ points: parseInt(e2.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React95__default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React95__default.createElement(SelectTrigger2, null, /* @__PURE__ */ React95__default.createElement(SelectValue2, null)), /* @__PURE__ */ React95__default.createElement(SelectContent2, null, /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React95__default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React95__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React95__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React95__default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React95__default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React95__default.createElement(DialogFooter, { className: "pt-4 border-t" }, /* @__PURE__ */ React95__default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React95__default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
72898
72900
  };
72899
72901
 
72900
72902
  // src/react-ui/components/authoring/AIQuestionGeneratorModal.tsx
package/dist/react-ui.cjs CHANGED
@@ -99405,10 +99405,12 @@ var EditQuestionModal = ({
99405
99405
  gradeLevels = [],
99406
99406
  bloomLevels = []
99407
99407
  }) => {
99408
+ const [isMounted, setIsMounted] = React169.useState(false);
99408
99409
  const [editedQuestion, setEditedQuestion] = React169.useState(null);
99409
99410
  const [editedMetadata, setEditedMetadata] = React169.useState({});
99410
99411
  const hasDropdownMetadata = subjects.length > 0;
99411
99412
  React169.useEffect(() => {
99413
+ setIsMounted(true);
99412
99414
  if (questionData) {
99413
99415
  setEditedQuestion(JSON.parse(JSON.stringify(questionData)));
99414
99416
  setEditedMetadata({
@@ -99532,7 +99534,7 @@ var EditQuestionModal = ({
99532
99534
  if (!isOpen || !editedQuestion) return null;
99533
99535
  return /* @__PURE__ */ React169__namespace.default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
99534
99536
  if (!open) onClose();
99535
- } }, /* @__PURE__ */ React169__namespace.default.createElement(DialogContent2, { className: "w-full max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh] flex flex-col" }, /* @__PURE__ */ React169__namespace.default.createElement(DialogHeader, { className: "shrink-0" }, /* @__PURE__ */ React169__namespace.default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React169__namespace.default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React169__namespace.default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React169__namespace.default.createElement(ScrollArea2, { className: "flex-grow min-h-0 pr-6" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-6 py-4" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React169__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React169__namespace.default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e3) => handleSpecificFieldChange({ points: parseInt(e3.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React169__namespace.default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React169__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React169__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React169__namespace.default.createElement(SelectContent2, null, /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React169__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React169__namespace.default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React169__namespace.default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React169__namespace.default.createElement(DialogFooter, { className: "pt-4 border-t shrink-0" }, /* @__PURE__ */ React169__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React169__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React169__namespace.default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React169__namespace.default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
99537
+ } }, /* @__PURE__ */ React169__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh]" }, /* @__PURE__ */ React169__namespace.default.createElement(DialogHeader, null, /* @__PURE__ */ React169__namespace.default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React169__namespace.default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React169__namespace.default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React169__namespace.default.createElement(ScrollArea2, { className: "max-h-[calc(80vh-150px)] p-1 pr-6" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-6 p-4" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React169__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React169__namespace.default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e3) => handleSpecificFieldChange({ points: parseInt(e3.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React169__namespace.default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React169__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React169__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React169__namespace.default.createElement(SelectContent2, null, /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React169__namespace.default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React169__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__namespace.default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React169__namespace.default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React169__namespace.default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React169__namespace.default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React169__namespace.default.createElement(DialogFooter, { className: "pt-4 border-t" }, /* @__PURE__ */ React169__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React169__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React169__namespace.default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React169__namespace.default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
99536
99538
  };
99537
99539
 
99538
99540
  // src/react-ui/components/authoring/AIQuestionGeneratorModal.tsx
package/dist/react-ui.mjs CHANGED
@@ -99339,10 +99339,12 @@ var EditQuestionModal = ({
99339
99339
  gradeLevels = [],
99340
99340
  bloomLevels = []
99341
99341
  }) => {
99342
+ const [isMounted, setIsMounted] = useState(false);
99342
99343
  const [editedQuestion, setEditedQuestion] = useState(null);
99343
99344
  const [editedMetadata, setEditedMetadata] = useState({});
99344
99345
  const hasDropdownMetadata = subjects.length > 0;
99345
99346
  useEffect(() => {
99347
+ setIsMounted(true);
99346
99348
  if (questionData) {
99347
99349
  setEditedQuestion(JSON.parse(JSON.stringify(questionData)));
99348
99350
  setEditedMetadata({
@@ -99466,7 +99468,7 @@ var EditQuestionModal = ({
99466
99468
  if (!isOpen || !editedQuestion) return null;
99467
99469
  return /* @__PURE__ */ React169__default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
99468
99470
  if (!open) onClose();
99469
- } }, /* @__PURE__ */ React169__default.createElement(DialogContent2, { className: "w-full max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh] flex flex-col" }, /* @__PURE__ */ React169__default.createElement(DialogHeader, { className: "shrink-0" }, /* @__PURE__ */ React169__default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React169__default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React169__default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React169__default.createElement(ScrollArea2, { className: "flex-grow min-h-0 pr-6" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-6 py-4" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React169__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React169__default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React169__default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e3) => handleSpecificFieldChange({ points: parseInt(e3.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React169__default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React169__default.createElement(SelectTrigger2, null, /* @__PURE__ */ React169__default.createElement(SelectValue2, null)), /* @__PURE__ */ React169__default.createElement(SelectContent2, null, /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React169__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React169__default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React169__default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React169__default.createElement(DialogFooter, { className: "pt-4 border-t shrink-0" }, /* @__PURE__ */ React169__default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React169__default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React169__default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React169__default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
99471
+ } }, /* @__PURE__ */ React169__default.createElement(DialogContent2, { className: "sm:max-w-[600px] md:max-w-[800px] lg:max-w-[1000px] max-h-[90vh]" }, /* @__PURE__ */ React169__default.createElement(DialogHeader, null, /* @__PURE__ */ React169__default.createElement(DialogTitle2, { className: "font-headline text-2xl" }, questionData?.id && !questionData.id.startsWith("new_") && !questionData.id.startsWith("temp_") ? "Edit Question" : "Add New Question"), /* @__PURE__ */ React169__default.createElement(DialogDescription2, null, "Configure the details for this question. Current type:", " ", /* @__PURE__ */ React169__default.createElement("span", { className: "font-semibold" }, editedQuestion.questionType))), /* @__PURE__ */ React169__default.createElement(ScrollArea2, { className: "max-h-[calc(80vh-150px)] p-1 pr-6" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-6 p-4" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "prompt", className: "font-semibold" }, "Question Prompt"), /* @__PURE__ */ React169__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.prompt, onChange: (htmlContent) => handleSpecificFieldChange({ prompt: htmlContent }) })), renderSpecificForm(), /* @__PURE__ */ React169__default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 pt-4 border-t" }, /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "points" }, "Points"), /* @__PURE__ */ React169__default.createElement(Input, { id: "points", type: "number", value: editedQuestion.points || 0, onChange: (e3) => handleSpecificFieldChange({ points: parseInt(e3.target.value, 10) || 0 }), min: "0" })), /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "difficulty" }, "Difficulty"), /* @__PURE__ */ React169__default.createElement(Select2, { value: editedQuestion.difficulty || "medium", onValueChange: (value) => handleSpecificFieldChange({ difficulty: value }) }, /* @__PURE__ */ React169__default.createElement(SelectTrigger2, null, /* @__PURE__ */ React169__default.createElement(SelectValue2, null)), /* @__PURE__ */ React169__default.createElement(SelectContent2, null, /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "easy" }, "Easy"), /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "medium" }, "Medium"), /* @__PURE__ */ React169__default.createElement(SelectItem2, { value: "hard" }, "Hard"))))), /* @__PURE__ */ React169__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React169__default.createElement(Label2, { htmlFor: "explanation" }, "Explanation (Optional)"), /* @__PURE__ */ React169__default.createElement(SimpleMarkdownEditor, { value: editedQuestion.explanation || "", onChange: (htmlContent) => handleSpecificFieldChange({ explanation: htmlContent }), minHeight: "100px" })), /* @__PURE__ */ React169__default.createElement("details", { className: "group", open: hasDropdownMetadata }, /* @__PURE__ */ React169__default.createElement("summary", { className: "cursor-pointer font-semibold text-primary hover:underline" }, "Advanced Metadata (Optional)"), renderMetadataFields()))), /* @__PURE__ */ React169__default.createElement(DialogFooter, { className: "pt-4 border-t" }, /* @__PURE__ */ React169__default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React169__default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React169__default.createElement(Button, { type: "button", onClick: handleSaveClick }, /* @__PURE__ */ React169__default.createElement(Save, { className: "mr-2 h-4 w-4" }), " Save Question"))));
99470
99472
  };
99471
99473
 
99472
99474
  // src/react-ui/components/authoring/AIQuestionGeneratorModal.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thanh01.pmt/interactive-quiz-kit",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "A comprehensive library for creating, managing, and playing interactive quizzes, with AI generation and SCORM support.",
5
5
  "keywords": [
6
6
  "react",