@baasix/lexical 0.0.11 → 0.0.12

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/index.js CHANGED
@@ -8576,7 +8576,7 @@ function NotesComponent({
8576
8576
  setIsEditing(false);
8577
8577
  }, []);
8578
8578
  return /* @__PURE__ */ jsx23(BlockWithAlignableContents4, { className, format, nodeKey, children: /* @__PURE__ */ jsxs13("div", { style: { position: "relative" }, children: [
8579
- isEditable && !isEditing && /* @__PURE__ */ jsx23(
8579
+ isEditable && /* @__PURE__ */ jsx23(
8580
8580
  "button",
8581
8581
  {
8582
8582
  type: "button",
@@ -8601,37 +8601,13 @@ function NotesComponent({
8601
8601
  children: "Edit Notes"
8602
8602
  }
8603
8603
  ),
8604
- isEditing ? /* @__PURE__ */ jsxs13("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
8605
- /* @__PURE__ */ jsxs13("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
8606
- /* @__PURE__ */ jsx23("span", { style: { fontSize: 13, fontWeight: 600, color: CARD_STYLES.notes.headingColor }, children: "Edit Notes" }),
8607
- /* @__PURE__ */ jsxs13("div", { style: { display: "flex", gap: 4 }, children: [
8608
- /* @__PURE__ */ jsx23(
8609
- "button",
8610
- {
8611
- type: "button",
8612
- onClick: cancelEdit,
8613
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
8614
- children: "Cancel"
8615
- }
8616
- ),
8617
- /* @__PURE__ */ jsx23(
8618
- "button",
8619
- {
8620
- type: "button",
8621
- onClick: saveChanges,
8622
- disabled: !preview,
8623
- style: { padding: "2px 10px", fontSize: 12, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
8624
- children: "Save"
8625
- }
8626
- )
8627
- ] })
8628
- ] }),
8604
+ /* @__PURE__ */ jsx23("div", { dangerouslySetInnerHTML: { __html: html } }),
8605
+ isEditing && /* @__PURE__ */ jsx23(Modal, { onClose: cancelEdit, title: "Edit Notes", children: /* @__PURE__ */ jsxs13("div", { style: { minWidth: 500 }, children: [
8629
8606
  /* @__PURE__ */ jsx23(
8630
8607
  "textarea",
8631
8608
  {
8632
8609
  value: editText,
8633
8610
  onChange: (e) => setEditText(e.target.value),
8634
- onMouseDown: (e) => e.stopPropagation(),
8635
8611
  style: {
8636
8612
  width: "100%",
8637
8613
  minHeight: 150,
@@ -8644,11 +8620,15 @@ function NotesComponent({
8644
8620
  }
8645
8621
  }
8646
8622
  ),
8647
- preview && /* @__PURE__ */ jsxs13("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" }, children: [
8623
+ preview && /* @__PURE__ */ jsxs13("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto" }, children: [
8648
8624
  /* @__PURE__ */ jsx23("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
8649
8625
  /* @__PURE__ */ jsx23("div", { dangerouslySetInnerHTML: { __html: preview } })
8626
+ ] }),
8627
+ /* @__PURE__ */ jsxs13("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 12 }, children: [
8628
+ /* @__PURE__ */ jsx23("button", { type: "button", onClick: cancelEdit, style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" }, children: "Cancel" }),
8629
+ /* @__PURE__ */ jsx23("button", { type: "button", onClick: saveChanges, disabled: !preview, style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 }, children: "Save" })
8650
8630
  ] })
8651
- ] }) : /* @__PURE__ */ jsx23("div", { dangerouslySetInnerHTML: { __html: html } })
8631
+ ] }) })
8652
8632
  ] }) });
8653
8633
  }
8654
8634
  var DATA_ATTR = "data-lexical-notes";
@@ -9014,7 +8994,7 @@ function RevisionComponent({
9014
8994
  setItems((prev) => prev.filter((_, i) => i !== index));
9015
8995
  }, []);
9016
8996
  return /* @__PURE__ */ jsx26(BlockWithAlignableContents5, { className, format, nodeKey, children: /* @__PURE__ */ jsxs16("div", { style: { position: "relative" }, children: [
9017
- isEditable && !isEditing && /* @__PURE__ */ jsx26(
8997
+ isEditable && /* @__PURE__ */ jsx26(
9018
8998
  "button",
9019
8999
  {
9020
9000
  type: "button",
@@ -9039,31 +9019,8 @@ function RevisionComponent({
9039
9019
  children: "Edit Revision"
9040
9020
  }
9041
9021
  ),
9042
- isEditing ? /* @__PURE__ */ jsxs16("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
9043
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
9044
- /* @__PURE__ */ jsx26("span", { style: { fontSize: 13, fontWeight: 600, color: "#c2703a" }, children: "Edit Revision Points" }),
9045
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", gap: 4 }, children: [
9046
- /* @__PURE__ */ jsx26(
9047
- "button",
9048
- {
9049
- type: "button",
9050
- onClick: cancelEdit,
9051
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
9052
- children: "Cancel"
9053
- }
9054
- ),
9055
- /* @__PURE__ */ jsx26(
9056
- "button",
9057
- {
9058
- type: "button",
9059
- onClick: saveChanges,
9060
- disabled: !preview,
9061
- style: { padding: "2px 10px", fontSize: 12, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
9062
- children: "Save"
9063
- }
9064
- )
9065
- ] })
9066
- ] }),
9022
+ /* @__PURE__ */ jsx26("div", { dangerouslySetInnerHTML: { __html: html } }),
9023
+ isEditing && /* @__PURE__ */ jsx26(Modal, { onClose: cancelEdit, title: "Edit Revision Points", children: /* @__PURE__ */ jsxs16("div", { style: { minWidth: 500 }, children: [
9067
9024
  items.map((item, index) => /* @__PURE__ */ jsxs16("div", { style: { display: "flex", gap: 4, marginBottom: 4, alignItems: "center" }, children: [
9068
9025
  /* @__PURE__ */ jsx26(
9069
9026
  "input",
@@ -9072,7 +9029,6 @@ function RevisionComponent({
9072
9029
  placeholder: "Revision point",
9073
9030
  value: item,
9074
9031
  onChange: (e) => updateItem(index, e.target.value),
9075
- onMouseDown: (e) => e.stopPropagation(),
9076
9032
  style: { flex: 1, padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4 }
9077
9033
  }
9078
9034
  ),
@@ -9095,11 +9051,15 @@ function RevisionComponent({
9095
9051
  children: "+ Add Point"
9096
9052
  }
9097
9053
  ),
9098
- preview && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" }, children: [
9054
+ preview && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto" }, children: [
9099
9055
  /* @__PURE__ */ jsx26("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
9100
9056
  /* @__PURE__ */ jsx26("div", { dangerouslySetInnerHTML: { __html: preview } })
9057
+ ] }),
9058
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 12 }, children: [
9059
+ /* @__PURE__ */ jsx26("button", { type: "button", onClick: cancelEdit, style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" }, children: "Cancel" }),
9060
+ /* @__PURE__ */ jsx26("button", { type: "button", onClick: saveChanges, disabled: !preview, style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 }, children: "Save" })
9101
9061
  ] })
9102
- ] }) : /* @__PURE__ */ jsx26("div", { dangerouslySetInnerHTML: { __html: html } })
9062
+ ] }) })
9103
9063
  ] }) });
9104
9064
  }
9105
9065
  var DATA_ATTR2 = "data-lexical-revision";
@@ -9318,57 +9278,36 @@ function TerminologyComponent({
9318
9278
  const removeItem = useCallback15((index) => {
9319
9279
  setItems((prev) => prev.filter((_, i) => i !== index));
9320
9280
  }, []);
9321
- return /* @__PURE__ */ jsx28(BlockWithAlignableContents6, { className, format, nodeKey, children: /* @__PURE__ */ jsxs18("div", { style: { position: "relative" }, children: [
9322
- isEditable && !isEditing && /* @__PURE__ */ jsx28(
9323
- "button",
9324
- {
9325
- type: "button",
9326
- onClick: openEditor,
9327
- onMouseDown: (e) => e.preventDefault(),
9328
- style: {
9329
- position: "absolute",
9330
- top: 4,
9331
- right: 4,
9332
- zIndex: 10,
9333
- background: CARD_STYLES.terminology.keyColor,
9334
- color: "#fff",
9335
- border: "none",
9336
- borderRadius: 4,
9337
- padding: "2px 8px",
9338
- fontSize: 12,
9339
- cursor: "pointer",
9340
- opacity: 0,
9341
- transition: "opacity 0.15s"
9342
- },
9343
- className: "html-block-edit-btn",
9344
- children: "Edit Terminology"
9345
- }
9346
- ),
9347
- isEditing ? /* @__PURE__ */ jsxs18("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
9348
- /* @__PURE__ */ jsxs18("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
9349
- /* @__PURE__ */ jsx28("span", { style: { fontSize: 13, fontWeight: 600, color: CARD_STYLES.terminology.keyColor }, children: "Edit Terminology" }),
9350
- /* @__PURE__ */ jsxs18("div", { style: { display: "flex", gap: 4 }, children: [
9351
- /* @__PURE__ */ jsx28(
9352
- "button",
9353
- {
9354
- type: "button",
9355
- onClick: cancelEdit,
9356
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
9357
- children: "Cancel"
9358
- }
9359
- ),
9360
- /* @__PURE__ */ jsx28(
9361
- "button",
9362
- {
9363
- type: "button",
9364
- onClick: saveChanges,
9365
- disabled: !preview,
9366
- style: { padding: "2px 10px", fontSize: 12, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
9367
- children: "Save"
9368
- }
9369
- )
9370
- ] })
9371
- ] }),
9281
+ return /* @__PURE__ */ jsxs18(BlockWithAlignableContents6, { className, format, nodeKey, children: [
9282
+ /* @__PURE__ */ jsxs18("div", { style: { position: "relative" }, children: [
9283
+ isEditable && /* @__PURE__ */ jsx28(
9284
+ "button",
9285
+ {
9286
+ type: "button",
9287
+ onClick: openEditor,
9288
+ onMouseDown: (e) => e.preventDefault(),
9289
+ style: {
9290
+ position: "absolute",
9291
+ top: 4,
9292
+ right: 4,
9293
+ zIndex: 10,
9294
+ background: CARD_STYLES.terminology.keyColor,
9295
+ color: "#fff",
9296
+ border: "none",
9297
+ borderRadius: 4,
9298
+ padding: "2px 8px",
9299
+ fontSize: 12,
9300
+ cursor: "pointer",
9301
+ opacity: 0,
9302
+ transition: "opacity 0.15s"
9303
+ },
9304
+ className: "html-block-edit-btn",
9305
+ children: "Edit Terminology"
9306
+ }
9307
+ ),
9308
+ /* @__PURE__ */ jsx28("div", { dangerouslySetInnerHTML: { __html: html } })
9309
+ ] }),
9310
+ isEditing && /* @__PURE__ */ jsx28(Modal, { onClose: cancelEdit, title: "Edit Terminology", children: /* @__PURE__ */ jsxs18("div", { style: { minWidth: 500 }, children: [
9372
9311
  items.map((item, index) => /* @__PURE__ */ jsxs18("div", { style: { display: "flex", gap: 4, marginBottom: 4, alignItems: "center" }, children: [
9373
9312
  /* @__PURE__ */ jsx28(
9374
9313
  "input",
@@ -9377,7 +9316,6 @@ function TerminologyComponent({
9377
9316
  placeholder: "Term",
9378
9317
  value: item.term,
9379
9318
  onChange: (e) => updateItem(index, "term", e.target.value),
9380
- onMouseDown: (e) => e.stopPropagation(),
9381
9319
  style: { width: "30%", padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4 }
9382
9320
  }
9383
9321
  ),
@@ -9388,7 +9326,6 @@ function TerminologyComponent({
9388
9326
  placeholder: "Definition",
9389
9327
  value: item.definition,
9390
9328
  onChange: (e) => updateItem(index, "definition", e.target.value),
9391
- onMouseDown: (e) => e.stopPropagation(),
9392
9329
  style: { flex: 1, padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4 }
9393
9330
  }
9394
9331
  ),
@@ -9407,16 +9344,37 @@ function TerminologyComponent({
9407
9344
  {
9408
9345
  type: "button",
9409
9346
  onClick: addItem,
9410
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, background: "#fff", cursor: "pointer", marginTop: 4 },
9347
+ style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, background: "#fff", cursor: "pointer", marginTop: 4, marginBottom: 8 },
9411
9348
  children: "+ Add Term"
9412
9349
  }
9413
9350
  ),
9414
- preview && /* @__PURE__ */ jsxs18("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" }, children: [
9351
+ preview && /* @__PURE__ */ jsxs18("div", { style: { marginBottom: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto" }, children: [
9415
9352
  /* @__PURE__ */ jsx28("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
9416
9353
  /* @__PURE__ */ jsx28("div", { dangerouslySetInnerHTML: { __html: preview } })
9354
+ ] }),
9355
+ /* @__PURE__ */ jsxs18("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8 }, children: [
9356
+ /* @__PURE__ */ jsx28(
9357
+ "button",
9358
+ {
9359
+ type: "button",
9360
+ onClick: cancelEdit,
9361
+ style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
9362
+ children: "Cancel"
9363
+ }
9364
+ ),
9365
+ /* @__PURE__ */ jsx28(
9366
+ "button",
9367
+ {
9368
+ type: "button",
9369
+ onClick: saveChanges,
9370
+ disabled: !preview,
9371
+ style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
9372
+ children: "Save"
9373
+ }
9374
+ )
9417
9375
  ] })
9418
- ] }) : /* @__PURE__ */ jsx28("div", { dangerouslySetInnerHTML: { __html: html } })
9419
- ] }) });
9376
+ ] }) })
9377
+ ] });
9420
9378
  }
9421
9379
  var DATA_ATTR3 = "data-lexical-terminology";
9422
9380
  var TerminologyNode = class _TerminologyNode extends DecoratorBlockNode6 {
@@ -9690,7 +9648,7 @@ function TextCardsComponent({
9690
9648
  }, []);
9691
9649
  const styles = CARD_STYLES.textCards;
9692
9650
  return /* @__PURE__ */ jsx30(BlockWithAlignableContents7, { className, format, nodeKey, children: /* @__PURE__ */ jsxs20("div", { style: { position: "relative" }, children: [
9693
- isEditable && !isEditing && /* @__PURE__ */ jsx30(
9651
+ isEditable && /* @__PURE__ */ jsx30(
9694
9652
  "button",
9695
9653
  {
9696
9654
  type: "button",
@@ -9715,31 +9673,8 @@ function TextCardsComponent({
9715
9673
  children: "Edit Text Cards"
9716
9674
  }
9717
9675
  ),
9718
- isEditing ? /* @__PURE__ */ jsxs20("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
9719
- /* @__PURE__ */ jsxs20("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
9720
- /* @__PURE__ */ jsx30("span", { style: { fontSize: 13, fontWeight: 600, color: "rgba(76, 175, 80, 0.8)" }, children: "Edit Text Cards" }),
9721
- /* @__PURE__ */ jsxs20("div", { style: { display: "flex", gap: 4 }, children: [
9722
- /* @__PURE__ */ jsx30(
9723
- "button",
9724
- {
9725
- type: "button",
9726
- onClick: cancelEdit,
9727
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
9728
- children: "Cancel"
9729
- }
9730
- ),
9731
- /* @__PURE__ */ jsx30(
9732
- "button",
9733
- {
9734
- type: "button",
9735
- onClick: saveChanges,
9736
- disabled: !preview,
9737
- style: { padding: "2px 10px", fontSize: 12, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
9738
- children: "Save"
9739
- }
9740
- )
9741
- ] })
9742
- ] }),
9676
+ /* @__PURE__ */ jsx30("div", { dangerouslySetInnerHTML: { __html: html } }),
9677
+ isEditing && /* @__PURE__ */ jsx30(Modal, { onClose: cancelEdit, title: "Edit Text Cards", children: /* @__PURE__ */ jsxs20("div", { style: { minWidth: 500 }, children: [
9743
9678
  concepts.map((concept, cIdx) => /* @__PURE__ */ jsxs20("div", { style: { border: "1px solid #e5e7eb", borderRadius: 6, padding: 8, marginBottom: 8, background: "#fff" }, children: [
9744
9679
  /* @__PURE__ */ jsxs20("div", { style: { display: "flex", gap: 4, marginBottom: 6, alignItems: "center" }, children: [
9745
9680
  /* @__PURE__ */ jsxs20("span", { style: { fontSize: 12, fontWeight: 600, color: "#4caf50", minWidth: 80 }, children: [
@@ -9754,7 +9689,6 @@ function TextCardsComponent({
9754
9689
  placeholder: "Concept title",
9755
9690
  value: concept.conceptTitle,
9756
9691
  onChange: (e) => updateConceptTitle(cIdx, e.target.value),
9757
- onMouseDown: (e) => e.stopPropagation(),
9758
9692
  style: { flex: 1, padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4 }
9759
9693
  }
9760
9694
  ),
@@ -9779,7 +9713,6 @@ function TextCardsComponent({
9779
9713
  placeholder: `${label} content...`,
9780
9714
  value: section.content,
9781
9715
  onChange: (e) => updateSection(cIdx, sIdx, e.target.value),
9782
- onMouseDown: (e) => e.stopPropagation(),
9783
9716
  style: { width: "100%", padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, minHeight: 40, resize: "vertical" }
9784
9717
  }
9785
9718
  )
@@ -9795,11 +9728,15 @@ function TextCardsComponent({
9795
9728
  children: "+ Add Concept"
9796
9729
  }
9797
9730
  ),
9798
- preview && /* @__PURE__ */ jsxs20("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" }, children: [
9731
+ preview && /* @__PURE__ */ jsxs20("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto" }, children: [
9799
9732
  /* @__PURE__ */ jsx30("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
9800
9733
  /* @__PURE__ */ jsx30("div", { dangerouslySetInnerHTML: { __html: preview } })
9734
+ ] }),
9735
+ /* @__PURE__ */ jsxs20("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 12 }, children: [
9736
+ /* @__PURE__ */ jsx30("button", { type: "button", onClick: cancelEdit, style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" }, children: "Cancel" }),
9737
+ /* @__PURE__ */ jsx30("button", { type: "button", onClick: saveChanges, disabled: !preview, style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 }, children: "Save" })
9801
9738
  ] })
9802
- ] }) : /* @__PURE__ */ jsx30("div", { dangerouslySetInnerHTML: { __html: html } })
9739
+ ] }) })
9803
9740
  ] }) });
9804
9741
  }
9805
9742
  var DATA_ATTR4 = "data-lexical-text-cards";
@@ -10249,7 +10186,7 @@ function QuestionsCardsComponent({
10249
10186
  }, []);
10250
10187
  const styles = CARD_STYLES.questionsCards;
10251
10188
  return /* @__PURE__ */ jsx32(BlockWithAlignableContents8, { className, format, nodeKey, children: /* @__PURE__ */ jsxs22("div", { style: { position: "relative" }, children: [
10252
- isEditable && !isEditing && /* @__PURE__ */ jsx32(
10189
+ isEditable && /* @__PURE__ */ jsx32(
10253
10190
  "button",
10254
10191
  {
10255
10192
  type: "button",
@@ -10274,31 +10211,8 @@ function QuestionsCardsComponent({
10274
10211
  children: "Edit Questions Card"
10275
10212
  }
10276
10213
  ),
10277
- isEditing ? /* @__PURE__ */ jsxs22("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
10278
- /* @__PURE__ */ jsxs22("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
10279
- /* @__PURE__ */ jsx32("span", { style: { fontSize: 13, fontWeight: 600, color: "rgba(25, 118, 210, 0.8)" }, children: "Edit Questions Card" }),
10280
- /* @__PURE__ */ jsxs22("div", { style: { display: "flex", gap: 4 }, children: [
10281
- /* @__PURE__ */ jsx32(
10282
- "button",
10283
- {
10284
- type: "button",
10285
- onClick: cancelEdit,
10286
- style: { padding: "2px 10px", fontSize: 12, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
10287
- children: "Cancel"
10288
- }
10289
- ),
10290
- /* @__PURE__ */ jsx32(
10291
- "button",
10292
- {
10293
- type: "button",
10294
- onClick: saveChanges,
10295
- disabled: !preview,
10296
- style: { padding: "2px 10px", fontSize: 12, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 },
10297
- children: "Save"
10298
- }
10299
- )
10300
- ] })
10301
- ] }),
10214
+ /* @__PURE__ */ jsx32("div", { dangerouslySetInnerHTML: { __html: html } }),
10215
+ isEditing && /* @__PURE__ */ jsx32(Modal, { onClose: cancelEdit, title: "Edit Questions Card", children: /* @__PURE__ */ jsxs22("div", { style: { minWidth: 500 }, children: [
10302
10216
  qaPairs.map((qa, qIdx) => /* @__PURE__ */ jsxs22("div", { style: { border: "1px solid #e5e7eb", borderRadius: 6, padding: 8, marginBottom: 8, background: "#fff" }, children: [
10303
10217
  /* @__PURE__ */ jsxs22("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 4 }, children: [
10304
10218
  /* @__PURE__ */ jsxs22("span", { style: { fontSize: 12, fontWeight: 600, color: "#1976d2" }, children: [
@@ -10323,7 +10237,6 @@ function QuestionsCardsComponent({
10323
10237
  placeholder: "Enter question text...",
10324
10238
  value: qa.question,
10325
10239
  onChange: (e) => updateQA(qIdx, "question", e.target.value),
10326
- onMouseDown: (e) => e.stopPropagation(),
10327
10240
  style: { width: "100%", padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, minHeight: 40, resize: "vertical" }
10328
10241
  }
10329
10242
  )
@@ -10336,7 +10249,6 @@ function QuestionsCardsComponent({
10336
10249
  placeholder: "Enter answer text...",
10337
10250
  value: qa.answer,
10338
10251
  onChange: (e) => updateQA(qIdx, "answer", e.target.value),
10339
- onMouseDown: (e) => e.stopPropagation(),
10340
10252
  style: { width: "100%", padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, minHeight: 60, resize: "vertical" }
10341
10253
  }
10342
10254
  )
@@ -10354,7 +10266,6 @@ function QuestionsCardsComponent({
10354
10266
  placeholder: `${label} content...`,
10355
10267
  value: section.content,
10356
10268
  onChange: (e) => updateSection(qIdx, sIdx, e.target.value),
10357
- onMouseDown: (e) => e.stopPropagation(),
10358
10269
  style: { width: "100%", padding: "4px 6px", fontSize: 12, border: "1px solid #ddd", borderRadius: 4, minHeight: 40, resize: "vertical" }
10359
10270
  }
10360
10271
  )
@@ -10371,11 +10282,15 @@ function QuestionsCardsComponent({
10371
10282
  children: "+ Add Question"
10372
10283
  }
10373
10284
  ),
10374
- preview && /* @__PURE__ */ jsxs22("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" }, children: [
10285
+ preview && /* @__PURE__ */ jsxs22("div", { style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto" }, children: [
10375
10286
  /* @__PURE__ */ jsx32("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
10376
10287
  /* @__PURE__ */ jsx32("div", { dangerouslySetInnerHTML: { __html: preview } })
10288
+ ] }),
10289
+ /* @__PURE__ */ jsxs22("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 12 }, children: [
10290
+ /* @__PURE__ */ jsx32("button", { type: "button", onClick: cancelEdit, style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" }, children: "Cancel" }),
10291
+ /* @__PURE__ */ jsx32("button", { type: "button", onClick: saveChanges, disabled: !preview, style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer", opacity: preview ? 1 : 0.5 }, children: "Save" })
10377
10292
  ] })
10378
- ] }) : /* @__PURE__ */ jsx32("div", { dangerouslySetInnerHTML: { __html: html } })
10293
+ ] }) })
10379
10294
  ] }) });
10380
10295
  }
10381
10296
  var DATA_ATTR5 = "data-lexical-questions-cards";
@@ -10698,7 +10613,7 @@ function HtmlBlockComponent({
10698
10613
  format,
10699
10614
  nodeKey,
10700
10615
  children: /* @__PURE__ */ jsxs25("div", { style: { position: "relative" }, children: [
10701
- isEditable && !isEditing && /* @__PURE__ */ jsx35(
10616
+ isEditable && /* @__PURE__ */ jsx35(
10702
10617
  "button",
10703
10618
  {
10704
10619
  type: "button",
@@ -10723,52 +10638,14 @@ function HtmlBlockComponent({
10723
10638
  children: "Edit HTML"
10724
10639
  }
10725
10640
  ),
10726
- isEditing ? /* @__PURE__ */ jsxs25("div", { style: { border: "1px solid #ccc", borderRadius: 4, padding: 8, background: "#f9f9f9" }, children: [
10727
- /* @__PURE__ */ jsxs25("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 6 }, children: [
10728
- /* @__PURE__ */ jsx35("span", { style: { fontSize: 12, fontWeight: 600, color: "#333" }, children: "Edit HTML Source" }),
10729
- /* @__PURE__ */ jsxs25("div", { style: { display: "flex", gap: 4 }, children: [
10730
- /* @__PURE__ */ jsx35(
10731
- "button",
10732
- {
10733
- type: "button",
10734
- onClick: cancelEdit,
10735
- style: {
10736
- padding: "2px 10px",
10737
- fontSize: 12,
10738
- border: "1px solid #ccc",
10739
- borderRadius: 4,
10740
- background: "#fff",
10741
- cursor: "pointer"
10742
- },
10743
- children: "Cancel"
10744
- }
10745
- ),
10746
- /* @__PURE__ */ jsx35(
10747
- "button",
10748
- {
10749
- type: "button",
10750
- onClick: saveHtml,
10751
- style: {
10752
- padding: "2px 10px",
10753
- fontSize: 12,
10754
- border: "none",
10755
- borderRadius: 4,
10756
- background: "#2563eb",
10757
- color: "#fff",
10758
- cursor: "pointer"
10759
- },
10760
- children: "Save"
10761
- }
10762
- )
10763
- ] })
10764
- ] }),
10641
+ /* @__PURE__ */ jsx35("div", { dangerouslySetInnerHTML: { __html: html } }),
10642
+ isEditing && /* @__PURE__ */ jsx35(Modal, { onClose: cancelEdit, title: "Edit HTML Source", children: /* @__PURE__ */ jsxs25("div", { style: { minWidth: 500 }, children: [
10765
10643
  /* @__PURE__ */ jsx35(
10766
10644
  "textarea",
10767
10645
  {
10768
10646
  ref: textareaRef,
10769
10647
  value: editValue,
10770
10648
  onChange: (e) => setEditValue(e.target.value),
10771
- onMouseDown: (e) => e.stopPropagation(),
10772
10649
  style: {
10773
10650
  width: "100%",
10774
10651
  minHeight: 150,
@@ -10777,21 +10654,36 @@ function HtmlBlockComponent({
10777
10654
  padding: 8,
10778
10655
  border: "1px solid #ddd",
10779
10656
  borderRadius: 4,
10780
- resize: "vertical"
10657
+ resize: "vertical",
10658
+ marginBottom: 8
10781
10659
  }
10782
10660
  }
10783
10661
  ),
10784
- /* @__PURE__ */ jsxs25(
10785
- "div",
10786
- {
10787
- style: { marginTop: 8, padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff" },
10788
- children: [
10789
- /* @__PURE__ */ jsx35("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
10790
- /* @__PURE__ */ jsx35("div", { dangerouslySetInnerHTML: { __html: editValue } })
10791
- ]
10792
- }
10793
- )
10794
- ] }) : /* @__PURE__ */ jsx35("div", { dangerouslySetInnerHTML: { __html: html } })
10662
+ /* @__PURE__ */ jsxs25("div", { style: { padding: 8, border: "1px solid #e5e7eb", borderRadius: 4, background: "#fff", maxHeight: 200, overflow: "auto", marginBottom: 8 }, children: [
10663
+ /* @__PURE__ */ jsx35("span", { style: { fontSize: 11, color: "#888", display: "block", marginBottom: 4 }, children: "Preview:" }),
10664
+ /* @__PURE__ */ jsx35("div", { dangerouslySetInnerHTML: { __html: editValue } })
10665
+ ] }),
10666
+ /* @__PURE__ */ jsxs25("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8 }, children: [
10667
+ /* @__PURE__ */ jsx35(
10668
+ "button",
10669
+ {
10670
+ type: "button",
10671
+ onClick: cancelEdit,
10672
+ style: { padding: "6px 16px", fontSize: 13, border: "1px solid #ccc", borderRadius: 4, background: "#fff", cursor: "pointer" },
10673
+ children: "Cancel"
10674
+ }
10675
+ ),
10676
+ /* @__PURE__ */ jsx35(
10677
+ "button",
10678
+ {
10679
+ type: "button",
10680
+ onClick: saveHtml,
10681
+ style: { padding: "6px 16px", fontSize: 13, border: "none", borderRadius: 4, background: "#2563eb", color: "#fff", cursor: "pointer" },
10682
+ children: "Save"
10683
+ }
10684
+ )
10685
+ ] })
10686
+ ] }) })
10795
10687
  ] })
10796
10688
  }
10797
10689
  );