neuphlo-editor 2.3.1 → 2.4.1

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.
@@ -706,6 +706,24 @@ MentionCommand.displayName = "MentionCommand";
706
706
  // src/headless/extensions/Mention/mention-node-view.tsx
707
707
  var import_react8 = require("@tiptap/react");
708
708
  var import_jsx_runtime5 = require("react/jsx-runtime");
709
+ var GRADIENT_MAP = {
710
+ red: "linear-gradient(135deg, #ef4444, #fb7185)",
711
+ coral: "linear-gradient(135deg, #f87171, #fb923c)",
712
+ orange: "linear-gradient(135deg, #f97316, #fbbf24)",
713
+ amber: "linear-gradient(135deg, #f59e0b, #facc15)",
714
+ lime: "linear-gradient(135deg, #84cc16, #4ade80)",
715
+ green: "linear-gradient(135deg, #10b981, #2dd4bf)",
716
+ teal: "linear-gradient(135deg, #14b8a6, #22d3ee)",
717
+ cyan: "linear-gradient(135deg, #06b6d4, #60a5fa)",
718
+ blue: "linear-gradient(135deg, #3b82f6, #818cf8)",
719
+ indigo: "linear-gradient(135deg, #6366f1, #a78bfa)",
720
+ violet: "linear-gradient(135deg, #8b5cf6, #a855f7)",
721
+ purple: "linear-gradient(135deg, #a855f7, #d946ef)",
722
+ fuchsia: "linear-gradient(135deg, #d946ef, #f472b6)",
723
+ pink: "linear-gradient(135deg, #ec4899, #fb7185)",
724
+ slate: "linear-gradient(135deg, #64748b, #71717a)",
725
+ stone: "linear-gradient(135deg, #78716c, #a3a3a3)"
726
+ };
709
727
  function NodeIcon() {
710
728
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0 }, children: [
711
729
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 3l8 4.5v9l-8 4.5l-8-4.5v-9l8-4.5" }),
@@ -752,7 +770,26 @@ var MentionNodeView = (props) => {
752
770
  children: [
753
771
  isNode && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NodeIcon, {}),
754
772
  isArticle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ArticleIcon, {}),
755
- !isReference && avatar && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
773
+ !isReference && avatar && avatar in GRADIENT_MAP && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
774
+ "div",
775
+ {
776
+ style: {
777
+ width: "20px",
778
+ height: "20px",
779
+ borderRadius: "50%",
780
+ background: GRADIENT_MAP[avatar],
781
+ color: "#ffffff",
782
+ display: "flex",
783
+ alignItems: "center",
784
+ justifyContent: "center",
785
+ fontSize: "8px",
786
+ fontWeight: 600,
787
+ flexShrink: 0
788
+ },
789
+ children: (label || id).split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase()
790
+ }
791
+ ),
792
+ !isReference && avatar && !(avatar in GRADIENT_MAP) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
756
793
  "img",
757
794
  {
758
795
  src: avatar,
@@ -897,7 +934,8 @@ var createMentionExtension = (options) => {
897
934
  nodeId: item.nodeId,
898
935
  slug: item.slug
899
936
  }
900
- }
937
+ },
938
+ { type: "text", text: " " }
901
939
  ]).run();
902
940
  },
903
941
  render: renderMentionSuggestion