@thangph2146/nextjs-editor 1.0.9 → 1.0.10

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
@@ -2113,17 +2113,12 @@ function ContentEditable({
2113
2113
  placeholder: placeholder2,
2114
2114
  className,
2115
2115
  placeholderClassName,
2116
- placeholderDefaults = true,
2117
- readOnly = false
2116
+ placeholderDefaults = true
2118
2117
  }) {
2119
2118
  return /* @__PURE__ */ jsx17(
2120
2119
  LexicalContentEditable,
2121
2120
  {
2122
- className: cn(
2123
- "ContentEditable__root relative block px-8 py-4 focus:outline-none",
2124
- readOnly ? "min-h-0" : "min-h-72",
2125
- className
2126
- ),
2121
+ className: cn("ContentEditable__root relative block min-h-72 px-8 py-4 focus:outline-none", className),
2127
2122
  "aria-placeholder": placeholder2,
2128
2123
  "aria-label": placeholder2 || "Editor n\u1ED9i dung",
2129
2124
  placeholder: /* @__PURE__ */ jsx17(
@@ -2633,39 +2628,20 @@ function ImageComponent({
2633
2628
  e.stopPropagation();
2634
2629
  setIsViewOriginalOpen(true);
2635
2630
  }, [isEditable]);
2636
- const imageWrapper = /* @__PURE__ */ jsx19(
2637
- "div",
2631
+ const imageWrapper = /* @__PURE__ */ jsx19("div", { draggable, children: isLoadError ? /* @__PURE__ */ jsx19(BrokenImage, {}) : /* @__PURE__ */ jsx19(
2632
+ LazyImage,
2638
2633
  {
2639
- draggable,
2640
- ...!isEditable && {
2641
- role: "button",
2642
- tabIndex: 0,
2643
- onClick: handleViewOriginal,
2644
- onKeyDown: (e) => {
2645
- if (e.key === "Enter" || e.key === " ") {
2646
- e.preventDefault();
2647
- handleViewOriginal(e);
2648
- }
2649
- },
2650
- style: { cursor: "pointer", pointerEvents: "auto" },
2651
- className: "block w-full"
2652
- },
2653
- children: isLoadError ? /* @__PURE__ */ jsx19(BrokenImage, {}) : /* @__PURE__ */ jsx19(
2654
- LazyImage,
2655
- {
2656
- className: imageClassName,
2657
- src,
2658
- altText,
2659
- imageRef,
2660
- width: responsiveDimensions.width,
2661
- height: responsiveDimensions.height,
2662
- maxWidth,
2663
- onError: () => setIsLoadError(true),
2664
- fetchPriority: isPriority ? "high" : "auto"
2665
- }
2666
- )
2634
+ className: imageClassName,
2635
+ src,
2636
+ altText,
2637
+ imageRef,
2638
+ width: responsiveDimensions.width,
2639
+ height: responsiveDimensions.height,
2640
+ maxWidth,
2641
+ onError: () => setIsLoadError(true),
2642
+ fetchPriority: isPriority ? "high" : "auto"
2667
2643
  }
2668
- );
2644
+ ) });
2669
2645
  return /* @__PURE__ */ jsx19(
2670
2646
  Suspense,
2671
2647
  {
@@ -2682,8 +2658,7 @@ function ImageComponent({
2682
2658
  {
2683
2659
  type: "button",
2684
2660
  onClick: handleViewOriginal,
2685
- className: "block w-full cursor-pointer border-0 bg-transparent p-0 text-left outline-none [&>div]:outline-none",
2686
- style: { pointerEvents: "auto" },
2661
+ className: "cursor-pointer border-0 bg-transparent p-0 text-left outline-none [&>div]:outline-none",
2687
2662
  "aria-label": "Xem h\xECnh g\u1ED1c",
2688
2663
  children: imageWrapper
2689
2664
  }
@@ -2734,20 +2709,20 @@ function ImageComponent({
2734
2709
  className: "max-w-[96vw] max-h-[96vh] w-[96vw] h-[96vh] overflow-hidden flex flex-col p-0 gap-0 rounded-xl border shadow-2xl",
2735
2710
  "aria-describedby": "view-original-image-desc",
2736
2711
  children: [
2737
- /* @__PURE__ */ jsx19(DialogHeader, { className: "shrink-0 px-4 pt-3 pb-3 pr-12 border-b border-border/50 bg-muted/20 rounded-t-xl text-center sm:text-center", children: /* @__PURE__ */ jsx19(DialogTitle, { className: "text-sm font-semibold", children: "Xem h\xECnh g\u1ED1c" }) }),
2712
+ /* @__PURE__ */ jsx19(DialogHeader, { className: "shrink-0 px-4 pt-3 pb-3 pr-12 border-b border-border/50 bg-muted/20 rounded-t-xl", children: /* @__PURE__ */ jsx19(DialogTitle, { className: "text-sm font-semibold", children: "Xem h\xECnh g\u1ED1c" }) }),
2738
2713
  /* @__PURE__ */ jsx19(
2739
2714
  "div",
2740
2715
  {
2741
2716
  id: "view-original-image-desc",
2742
- className: "flex-1 min-h-0 w-full max-w-full overflow-x-hidden overflow-y-auto flex items-center justify-center p-4 bg-black/10",
2743
- children: /* @__PURE__ */ jsx19("div", { className: "max-w-full max-h-full min-w-0 min-h-0 flex items-center justify-center", children: /* @__PURE__ */ jsx19(
2717
+ className: "flex-1 min-h-0 overflow-auto flex items-center justify-center p-4 bg-black/10",
2718
+ children: /* @__PURE__ */ jsx19(
2744
2719
  "img",
2745
2720
  {
2746
2721
  src,
2747
2722
  alt: altText || "H\xECnh g\u1ED1c",
2748
- className: "min-w-0 min-h-0 max-w-full max-h-full w-auto h-auto object-contain rounded-lg select-none"
2723
+ className: "max-w-full max-h-full w-auto h-auto object-contain rounded-lg select-none"
2749
2724
  }
2750
- ) })
2725
+ )
2751
2726
  }
2752
2727
  ),
2753
2728
  /* @__PURE__ */ jsx19(DialogFooter, { className: "shrink-0 flex-row justify-center gap-2 px-4 py-3 border-t border-border/50 bg-muted/20 rounded-b-xl", children: /* @__PURE__ */ jsx19(
@@ -33540,8 +33515,7 @@ function Plugins({
33540
33515
  ContentEditable,
33541
33516
  {
33542
33517
  placeholder: readOnly ? "" : placeholder,
33543
- readOnly,
33544
- className: readOnly ? "cursor-default select-text border-0 bg-transparent shadow-none" : ""
33518
+ className: `ContentEditable__root relative block min-h-72 px-8 py-4 focus:outline-none ${readOnly ? "cursor-default select-text border border-border rounded-md" : ""}`
33545
33519
  }
33546
33520
  ) }) }),
33547
33521
  ErrorBoundary: LexicalErrorBoundary2,
@@ -33717,11 +33691,10 @@ function Editor({
33717
33691
  {
33718
33692
  ref: editorRef,
33719
33693
  className: cn(
33720
- "bg-background rounded-lg w-full",
33721
- readOnly ? "shadow-none" : "shadow"
33694
+ "w-full min-w-0",
33695
+ !readOnly && "bg-background rounded-lg shadow"
33722
33696
  ),
33723
33697
  id: "editor-x",
33724
- "data-readonly": readOnly ? "true" : void 0,
33725
33698
  children: /* @__PURE__ */ jsx96(EditorContainerProvider, { value: { maxWidth: editorMaxWidth }, children: /* @__PURE__ */ jsx96(
33726
33699
  LexicalComposer,
33727
33700
  {