@lv-x-software-house/x_view 1.3.0-dev.1 → 1.3.0-dev.2

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
@@ -14484,13 +14484,14 @@ function MentionPopover({ query, items, position, onSelect, onClose }) {
14484
14484
  "div",
14485
14485
  {
14486
14486
  style: { top: position.top, left: position.left, position: "fixed", zIndex: 9999 },
14487
- className: "bg-slate-900 border border-white/10 rounded-xl shadow-2xl py-1.5 min-w-[260px] max-h-[240px] overflow-y-auto custom-scrollbar animate-in fade-in zoom-in-95 duration-100",
14487
+ className: "bg-slate-900 border border-white/10 rounded-xl shadow-2xl py-1.5 min-w-[300px] max-h-[320px] overflow-y-auto custom-scrollbar animate-in fade-in zoom-in-95 duration-100",
14488
14488
  ref: listRef,
14489
14489
  onMouseDown: (e) => e.preventDefault()
14490
14490
  },
14491
14491
  filtered.length === 0 ? /* @__PURE__ */ import_react29.default.createElement("div", { className: "px-4 py-3 text-xs text-slate-500" }, "Nenhum resultado para", " ", /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-slate-300 font-medium" }, '"', query, '"')) : filtered.map((item, idx) => {
14492
14492
  const config = TYPE_CONFIG[item.type] || TYPE_CONFIG.node;
14493
14493
  const { Icon } = config;
14494
+ const isActive = idx === activeIndex;
14494
14495
  return /* @__PURE__ */ import_react29.default.createElement(
14495
14496
  "div",
14496
14497
  {
@@ -14500,11 +14501,11 @@ function MentionPopover({ query, items, position, onSelect, onClose }) {
14500
14501
  onSelect(item);
14501
14502
  },
14502
14503
  onMouseEnter: () => setActiveIndex(idx),
14503
- className: `flex items-center gap-2.5 px-3 py-2 cursor-pointer text-sm transition-colors duration-100 ${idx === activeIndex ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5"}`
14504
+ className: `flex items-center gap-3 px-3 py-2 cursor-pointer text-sm transition-colors duration-100 ${isActive ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5"}`
14504
14505
  },
14505
- /* @__PURE__ */ import_react29.default.createElement(Icon, { size: 13, className: config.color }),
14506
- /* @__PURE__ */ import_react29.default.createElement("span", { className: "flex-1 truncate font-medium" }, item.searchLabel || "Sem Nome"),
14507
- /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[9px] px-1.5 py-0.5 rounded-full bg-white/5 text-slate-500 border border-white/5 uppercase tracking-wide shrink-0" }, config.label)
14506
+ /* @__PURE__ */ import_react29.default.createElement("div", { className: `w-7 h-7 rounded bg-slate-800 flex items-center justify-center shrink-0 border border-white/5 ${isActive ? "border-indigo-500/50" : ""}` }, /* @__PURE__ */ import_react29.default.createElement(Icon, { size: 14, className: config.color })),
14507
+ /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex-1 min-w-0 flex flex-col py-0.5" }, /* @__PURE__ */ import_react29.default.createElement("span", { className: "truncate font-medium leading-tight" }, item.searchLabel || "Sem Nome"), item.type === "ancestry" ? /* @__PURE__ */ import_react29.default.createElement("span", { className: `text-[10px] truncate flex items-center gap-1 mt-0.5 ${isActive ? "text-indigo-200" : "text-slate-500"}` }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiCornerUpRight, { size: 10, className: "opacity-70" }), /* @__PURE__ */ import_react29.default.createElement("span", { className: "opacity-70" }, "Origem:"), " ", item.originNodeName) : item.nodeTypeLabel && /* @__PURE__ */ import_react29.default.createElement("span", { className: `text-[10px] uppercase font-bold tracking-tight truncate mt-0.5 ${isActive ? "text-indigo-100" : "text-slate-500"}` }, item.nodeTypeLabel)),
14508
+ /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[9px] px-1.5 py-0.5 rounded-full bg-white/5 text-slate-500 border border-white/5 uppercase tracking-wide shrink-0 self-start mt-1" }, config.label)
14508
14509
  );
14509
14510
  })
14510
14511
  );
@@ -15103,6 +15104,13 @@ function Boards({
15103
15104
  setIsLoaded(true);
15104
15105
  }
15105
15106
  }, [initialBoardItems, isLoaded]);
15107
+ const nodeNamesMap = (0, import_react31.useMemo)(() => {
15108
+ const map = /* @__PURE__ */ new Map();
15109
+ if (availableNodes) {
15110
+ availableNodes.forEach((n) => map.set(String(n.id), n.name));
15111
+ }
15112
+ return map;
15113
+ }, [availableNodes]);
15106
15114
  const allSearchableItems = (0, import_react31.useMemo)(() => {
15107
15115
  const items = [];
15108
15116
  availableAncestries.forEach((anc) => {
@@ -15111,24 +15119,26 @@ function Boards({
15111
15119
  id: String(anc.ancestry_id),
15112
15120
  type: "ancestry",
15113
15121
  searchLabel: anc.name || "",
15114
- searchDesc: anc.description || ""
15122
+ searchDesc: anc.description || "",
15123
+ originNodeName: nodeNamesMap.get(String(anc.ancestral_node)) || "Node Desconhecido"
15115
15124
  });
15116
15125
  });
15117
15126
  availableNodes.forEach((node) => {
15118
15127
  var _a;
15119
- let type = "node";
15120
- if (node.is_quest) type = "quest";
15121
- else if ((_a = node.version_node) == null ? void 0 : _a.is_version) type = "version";
15128
+ let mentionType = "node";
15129
+ if (node.is_quest) mentionType = "quest";
15130
+ else if ((_a = node.version_node) == null ? void 0 : _a.is_version) mentionType = "version";
15122
15131
  items.push({
15123
15132
  ...node,
15124
15133
  id: String(node.id),
15125
- type,
15134
+ type: mentionType,
15126
15135
  searchLabel: node.name || node.raw_title || "",
15127
- searchDesc: node.description || ""
15136
+ searchDesc: node.description || "",
15137
+ nodeTypeLabel: Array.isArray(node.type) ? node.type.join(" \u2022 ") : node.type
15128
15138
  });
15129
15139
  });
15130
15140
  return items;
15131
- }, [availableAncestries, availableNodes]);
15141
+ }, [availableAncestries, availableNodes, nodeNamesMap]);
15132
15142
  (0, import_react31.useEffect)(() => {
15133
15143
  if (!isLoaded || !onSave) return;
15134
15144
  const id = setTimeout(async () => {
package/dist/index.mjs CHANGED
@@ -14496,7 +14496,7 @@ import React29, { useEffect as useEffect23, useRef as useRef20, useState as useS
14496
14496
 
14497
14497
  // src/components/MentionPopover.jsx
14498
14498
  import React28, { useEffect as useEffect22, useRef as useRef19, useState as useState26, useMemo as useMemo12 } from "react";
14499
- import { FiLayers as FiLayers7, FiCheckSquare as FiCheckSquare3, FiGitBranch as FiGitBranch5, FiBox } from "react-icons/fi";
14499
+ import { FiLayers as FiLayers7, FiCheckSquare as FiCheckSquare3, FiGitBranch as FiGitBranch5, FiBox, FiCornerUpRight as FiCornerUpRight4 } from "react-icons/fi";
14500
14500
  var TYPE_CONFIG = {
14501
14501
  ancestry: { Icon: FiLayers7, color: "text-indigo-400", label: "Ancestralidade" },
14502
14502
  quest: { Icon: FiCheckSquare3, color: "text-emerald-400", label: "Quest" },
@@ -14547,13 +14547,14 @@ function MentionPopover({ query, items, position, onSelect, onClose }) {
14547
14547
  "div",
14548
14548
  {
14549
14549
  style: { top: position.top, left: position.left, position: "fixed", zIndex: 9999 },
14550
- className: "bg-slate-900 border border-white/10 rounded-xl shadow-2xl py-1.5 min-w-[260px] max-h-[240px] overflow-y-auto custom-scrollbar animate-in fade-in zoom-in-95 duration-100",
14550
+ className: "bg-slate-900 border border-white/10 rounded-xl shadow-2xl py-1.5 min-w-[300px] max-h-[320px] overflow-y-auto custom-scrollbar animate-in fade-in zoom-in-95 duration-100",
14551
14551
  ref: listRef,
14552
14552
  onMouseDown: (e) => e.preventDefault()
14553
14553
  },
14554
14554
  filtered.length === 0 ? /* @__PURE__ */ React28.createElement("div", { className: "px-4 py-3 text-xs text-slate-500" }, "Nenhum resultado para", " ", /* @__PURE__ */ React28.createElement("span", { className: "text-slate-300 font-medium" }, '"', query, '"')) : filtered.map((item, idx) => {
14555
14555
  const config = TYPE_CONFIG[item.type] || TYPE_CONFIG.node;
14556
14556
  const { Icon } = config;
14557
+ const isActive = idx === activeIndex;
14557
14558
  return /* @__PURE__ */ React28.createElement(
14558
14559
  "div",
14559
14560
  {
@@ -14563,11 +14564,11 @@ function MentionPopover({ query, items, position, onSelect, onClose }) {
14563
14564
  onSelect(item);
14564
14565
  },
14565
14566
  onMouseEnter: () => setActiveIndex(idx),
14566
- className: `flex items-center gap-2.5 px-3 py-2 cursor-pointer text-sm transition-colors duration-100 ${idx === activeIndex ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5"}`
14567
+ className: `flex items-center gap-3 px-3 py-2 cursor-pointer text-sm transition-colors duration-100 ${isActive ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5"}`
14567
14568
  },
14568
- /* @__PURE__ */ React28.createElement(Icon, { size: 13, className: config.color }),
14569
- /* @__PURE__ */ React28.createElement("span", { className: "flex-1 truncate font-medium" }, item.searchLabel || "Sem Nome"),
14570
- /* @__PURE__ */ React28.createElement("span", { className: "text-[9px] px-1.5 py-0.5 rounded-full bg-white/5 text-slate-500 border border-white/5 uppercase tracking-wide shrink-0" }, config.label)
14569
+ /* @__PURE__ */ React28.createElement("div", { className: `w-7 h-7 rounded bg-slate-800 flex items-center justify-center shrink-0 border border-white/5 ${isActive ? "border-indigo-500/50" : ""}` }, /* @__PURE__ */ React28.createElement(Icon, { size: 14, className: config.color })),
14570
+ /* @__PURE__ */ React28.createElement("div", { className: "flex-1 min-w-0 flex flex-col py-0.5" }, /* @__PURE__ */ React28.createElement("span", { className: "truncate font-medium leading-tight" }, item.searchLabel || "Sem Nome"), item.type === "ancestry" ? /* @__PURE__ */ React28.createElement("span", { className: `text-[10px] truncate flex items-center gap-1 mt-0.5 ${isActive ? "text-indigo-200" : "text-slate-500"}` }, /* @__PURE__ */ React28.createElement(FiCornerUpRight4, { size: 10, className: "opacity-70" }), /* @__PURE__ */ React28.createElement("span", { className: "opacity-70" }, "Origem:"), " ", item.originNodeName) : item.nodeTypeLabel && /* @__PURE__ */ React28.createElement("span", { className: `text-[10px] uppercase font-bold tracking-tight truncate mt-0.5 ${isActive ? "text-indigo-100" : "text-slate-500"}` }, item.nodeTypeLabel)),
14571
+ /* @__PURE__ */ React28.createElement("span", { className: "text-[9px] px-1.5 py-0.5 rounded-full bg-white/5 text-slate-500 border border-white/5 uppercase tracking-wide shrink-0 self-start mt-1" }, config.label)
14571
14572
  );
14572
14573
  })
14573
14574
  );
@@ -15166,6 +15167,13 @@ function Boards({
15166
15167
  setIsLoaded(true);
15167
15168
  }
15168
15169
  }, [initialBoardItems, isLoaded]);
15170
+ const nodeNamesMap = useMemo13(() => {
15171
+ const map = /* @__PURE__ */ new Map();
15172
+ if (availableNodes) {
15173
+ availableNodes.forEach((n) => map.set(String(n.id), n.name));
15174
+ }
15175
+ return map;
15176
+ }, [availableNodes]);
15169
15177
  const allSearchableItems = useMemo13(() => {
15170
15178
  const items = [];
15171
15179
  availableAncestries.forEach((anc) => {
@@ -15174,24 +15182,26 @@ function Boards({
15174
15182
  id: String(anc.ancestry_id),
15175
15183
  type: "ancestry",
15176
15184
  searchLabel: anc.name || "",
15177
- searchDesc: anc.description || ""
15185
+ searchDesc: anc.description || "",
15186
+ originNodeName: nodeNamesMap.get(String(anc.ancestral_node)) || "Node Desconhecido"
15178
15187
  });
15179
15188
  });
15180
15189
  availableNodes.forEach((node) => {
15181
15190
  var _a;
15182
- let type = "node";
15183
- if (node.is_quest) type = "quest";
15184
- else if ((_a = node.version_node) == null ? void 0 : _a.is_version) type = "version";
15191
+ let mentionType = "node";
15192
+ if (node.is_quest) mentionType = "quest";
15193
+ else if ((_a = node.version_node) == null ? void 0 : _a.is_version) mentionType = "version";
15185
15194
  items.push({
15186
15195
  ...node,
15187
15196
  id: String(node.id),
15188
- type,
15197
+ type: mentionType,
15189
15198
  searchLabel: node.name || node.raw_title || "",
15190
- searchDesc: node.description || ""
15199
+ searchDesc: node.description || "",
15200
+ nodeTypeLabel: Array.isArray(node.type) ? node.type.join(" \u2022 ") : node.type
15191
15201
  });
15192
15202
  });
15193
15203
  return items;
15194
- }, [availableAncestries, availableNodes]);
15204
+ }, [availableAncestries, availableNodes, nodeNamesMap]);
15195
15205
  useEffect24(() => {
15196
15206
  if (!isLoaded || !onSave) return;
15197
15207
  const id = setTimeout(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.3.0-dev.1",
3
+ "version": "1.3.0-dev.2",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",