@lv-x-software-house/x_view 1.3.6 → 1.3.8

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.
Files changed (3) hide show
  1. package/dist/index.js +146 -83
  2. package/dist/index.mjs +157 -84
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2208,7 +2208,6 @@ var userActionHandlers = {
2208
2208
  }
2209
2209
  });
2210
2210
  if (updates.length > 0) {
2211
- console.log(`[syncQuestTemplateFlags] Sincronizando ${updates.length} quests...`);
2212
2211
  for (const quest of updates) {
2213
2212
  const idx = sceneDataRef.current.quest_nodes.findIndex((q) => String(q.id) === String(quest.id));
2214
2213
  if (idx !== -1) sceneDataRef.current.quest_nodes[idx] = quest;
@@ -2550,7 +2549,7 @@ var userActionHandlers = {
2550
2549
  if (actions.delete_file && nodeData) {
2551
2550
  const urls = extractFileUrlsFromProperties(nodeData);
2552
2551
  if (urls.length > 0) {
2553
- Promise.all(urls.map((url) => actions.delete_file(url))).then(() => console.log("Arquivos do node deletados.")).catch(
2552
+ Promise.all(urls.map((url) => actions.delete_file(url))).catch(
2554
2553
  (err) => console.error("Erro ao deletar arquivos do node:", err)
2555
2554
  );
2556
2555
  }
@@ -2961,7 +2960,6 @@ var userActionHandlers = {
2961
2960
  }
2962
2961
  if (foundProcess && foundTreeContext) {
2963
2962
  if (foundTreeContext.nodeRef.is_choice) {
2964
- console.log("N\xF3 de escolha detectado. Aguardando sele\xE7\xE3o manual.");
2965
2963
  keepOpen = true;
2966
2964
  if (context.setters.setDetailsNode) {
2967
2965
  context.setters.setDetailsNode({ ...nodeToSave, _scrollToChoice: true });
@@ -6778,7 +6776,9 @@ function CustomPropertyDisplay({
6778
6776
  if (!file || targetIndex === null || !onUploadFile) return;
6779
6777
  const MAX_SIZE = 10 * 1024 * 1024;
6780
6778
  if (file.size > MAX_SIZE) {
6781
- alert("O arquivo \xE9 muito grande. O limite m\xE1ximo de tamanho permitido \xE9 de 10MB.");
6779
+ alert(
6780
+ "Upload de imagens acima de 10MB n\xE3o est\xE1 dispon\xEDvel neste momento. Recomendamos armazen\xE1-la em um servi\xE7o de personal cloud storage e guardar apenas o link no x.plore."
6781
+ );
6782
6782
  return;
6783
6783
  }
6784
6784
  try {
@@ -6872,7 +6872,9 @@ function CustomPropertyDisplay({
6872
6872
  const baseInput = "w-full bg-slate-800/70 p-2 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-400/60 transition-all duration-150";
6873
6873
  const renderEditView = () => {
6874
6874
  var _a;
6875
- const isKeyFixed = ["links", "images", "date", "documents"].includes(tempProp.type);
6875
+ const isKeyFixed = ["links", "images", "date", "documents"].includes(
6876
+ tempProp.type
6877
+ );
6876
6878
  const availableOptions = [
6877
6879
  { value: "links", label: "Links", unique: true },
6878
6880
  { value: "images", label: "Images", unique: true },
@@ -6881,7 +6883,9 @@ function CustomPropertyDisplay({
6881
6883
  { value: "text", label: "Texto", unique: false },
6882
6884
  { value: "number", label: "N\xFAmero", unique: false },
6883
6885
  { value: "list", label: "Lista", unique: false }
6884
- ].filter((opt) => !opt.unique || !unavailableTypes.includes(opt.value) || tempProp.type === opt.value);
6886
+ ].filter(
6887
+ (opt) => !opt.unique || !unavailableTypes.includes(opt.value) || tempProp.type === opt.value
6888
+ );
6885
6889
  const currentTypeLabel = ((_a = availableOptions.find((o) => o.value === tempProp.type)) == null ? void 0 : _a.label) || tempProp.type;
6886
6890
  return /* @__PURE__ */ import_react4.default.createElement("div", { className: "w-full space-y-2" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react4.default.createElement(
6887
6891
  "input",
@@ -6901,7 +6905,12 @@ function CustomPropertyDisplay({
6901
6905
  className: "w-full flex items-center justify-between gap-2 bg-slate-800/70 p-2 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-1 focus:ring-indigo-400/60 hover:bg-slate-700/70 transition-colors"
6902
6906
  },
6903
6907
  /* @__PURE__ */ import_react4.default.createElement("span", { className: "truncate" }, currentTypeLabel),
6904
- /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiChevronDown, { className: `text-slate-400 transition-transform ${isTypeDropdownOpen ? "rotate-180" : ""}` })
6908
+ /* @__PURE__ */ import_react4.default.createElement(
6909
+ import_fi3.FiChevronDown,
6910
+ {
6911
+ className: `text-slate-400 transition-transform ${isTypeDropdownOpen ? "rotate-180" : ""}`
6912
+ }
6913
+ )
6905
6914
  ), isTypeDropdownOpen && /* @__PURE__ */ import_react4.default.createElement("ul", { className: "absolute right-0 top-full mt-1 z-50 w-32 bg-slate-800 border border-white/10 rounded-lg shadow-xl overflow-y-auto max-h-48 custom-scrollbar py-1" }, availableOptions.map((opt) => /* @__PURE__ */ import_react4.default.createElement("li", { key: opt.value }, /* @__PURE__ */ import_react4.default.createElement(
6906
6915
  "button",
6907
6916
  {
@@ -6914,7 +6923,16 @@ function CustomPropertyDisplay({
6914
6923
  var _a2, _b, _c, _d, _e;
6915
6924
  switch (tempProp.type) {
6916
6925
  case "number":
6917
- return /* @__PURE__ */ import_react4.default.createElement("input", { type: "number", placeholder: "Valor num\xE9rico", value: tempProp.value, onChange: (e) => handlePropChange("value", e.target.value), className: baseInput });
6926
+ return /* @__PURE__ */ import_react4.default.createElement(
6927
+ "input",
6928
+ {
6929
+ type: "number",
6930
+ placeholder: "Valor num\xE9rico",
6931
+ value: tempProp.value,
6932
+ onChange: (e) => handlePropChange("value", e.target.value),
6933
+ className: baseInput
6934
+ }
6935
+ );
6918
6936
  case "date": {
6919
6937
  const dateType = ((_a2 = tempProp.value) == null ? void 0 : _a2.type) || "Data";
6920
6938
  const noSpinnerClass = "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none";
@@ -6931,15 +6949,20 @@ function CustomPropertyDisplay({
6931
6949
  handlePropChange("value", newValue);
6932
6950
  };
6933
6951
  const handleDateValueChange = (dateField, dateValue) => {
6934
- handlePropChange("value", { ...tempProp.value, [dateField]: dateValue });
6952
+ handlePropChange("value", {
6953
+ ...tempProp.value,
6954
+ [dateField]: dateValue
6955
+ });
6935
6956
  };
6936
6957
  const handleFullDateChange = (e) => {
6937
6958
  const rawValue = e.target.value;
6938
6959
  const digits = rawValue.replace(/\D/g, "");
6939
6960
  const len = digits.length;
6940
6961
  let formattedValue = digits;
6941
- if (len > 2 && len <= 4) formattedValue = `${digits.slice(0, 2)}/${digits.slice(2)}`;
6942
- else if (len > 4) formattedValue = `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
6962
+ if (len > 2 && len <= 4)
6963
+ formattedValue = `${digits.slice(0, 2)}/${digits.slice(2)}`;
6964
+ else if (len > 4)
6965
+ formattedValue = `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
6943
6966
  handleDateValueChange("value", formattedValue);
6944
6967
  };
6945
6968
  return /* @__PURE__ */ import_react4.default.createElement("div", { className: "space-y-2 p-2 bg-slate-900/60 rounded-lg border border-white/10" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex items-center justify-center gap-1 rounded-lg bg-slate-800/50 p-1" }, ["Data", "Ano", "Date Interval"].map((t) => /* @__PURE__ */ import_react4.default.createElement(
@@ -6951,7 +6974,17 @@ function CustomPropertyDisplay({
6951
6974
  className: `flex-1 text-xs px-2 py-1.5 rounded-md transition-colors ${dateType === t ? "bg-indigo-600 text-white font-semibold shadow" : "hover:bg-slate-700/50"}`
6952
6975
  },
6953
6976
  t === "Date Interval" ? "Intervalo" : t
6954
- ))), dateType === "Data" && /* @__PURE__ */ import_react4.default.createElement("input", { type: "text", placeholder: "DD/MM/AAAA", value: ((_b = tempProp.value) == null ? void 0 : _b.value) || "", onChange: handleFullDateChange, maxLength: "10", className: baseInput }), dateType === "Ano" && /* @__PURE__ */ import_react4.default.createElement(
6977
+ ))), dateType === "Data" && /* @__PURE__ */ import_react4.default.createElement(
6978
+ "input",
6979
+ {
6980
+ type: "text",
6981
+ placeholder: "DD/MM/AAAA",
6982
+ value: ((_b = tempProp.value) == null ? void 0 : _b.value) || "",
6983
+ onChange: handleFullDateChange,
6984
+ maxLength: "10",
6985
+ className: baseInput
6986
+ }
6987
+ ), dateType === "Ano" && /* @__PURE__ */ import_react4.default.createElement(
6955
6988
  "input",
6956
6989
  {
6957
6990
  type: "number",
@@ -6999,7 +7032,11 @@ function CustomPropertyDisplay({
6999
7032
  type: "text",
7000
7033
  placeholder: tempProp.type === "images" || tempProp.type === "documents" ? "ID" : "Nome",
7001
7034
  value: item.name,
7002
- onChange: (e) => handleListItemChange(itemIndex, "name", e.target.value),
7035
+ onChange: (e) => handleListItemChange(
7036
+ itemIndex,
7037
+ "name",
7038
+ e.target.value
7039
+ ),
7003
7040
  className: "min-w-0 flex-1 bg-slate-800/70 p-2 text-xs rounded-md border border-white/10 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-indigo-400/60"
7004
7041
  }
7005
7042
  ), /* @__PURE__ */ import_react4.default.createElement(
@@ -7008,7 +7045,11 @@ function CustomPropertyDisplay({
7008
7045
  type: "text",
7009
7046
  placeholder: tempProp.type === "images" ? "URL da Imagem" : tempProp.type === "documents" ? "URL do Documento" : "Valor",
7010
7047
  value: item.value,
7011
- onChange: (e) => handleListItemChange(itemIndex, "value", e.target.value),
7048
+ onChange: (e) => handleListItemChange(
7049
+ itemIndex,
7050
+ "value",
7051
+ e.target.value
7052
+ ),
7012
7053
  className: "min-w-0 flex-1 bg-slate-800/70 p-2 text-xs rounded-md border border-white/10 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-indigo-400/60"
7013
7054
  }
7014
7055
  ), (tempProp.type === "images" || tempProp.type === "documents") && /* @__PURE__ */ import_react4.default.createElement(
@@ -7021,11 +7062,53 @@ function CustomPropertyDisplay({
7021
7062
  title: "Upload de Arquivo"
7022
7063
  },
7023
7064
  uploadingItemIndex === itemIndex ? /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiLoader, { className: "animate-spin" }) : /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiUpload, { size: 12 })
7024
- ), /* @__PURE__ */ import_react4.default.createElement("button", { type: "button", onClick: () => handleRemoveListItem(itemIndex), className: "flex-shrink-0 w-7 h-7 grid place-items-center bg-red-600/60 hover:bg-red-600 rounded-full text-xs font-bold transition-colors", "aria-label": "Remover item" }, "\xD7"))), /* @__PURE__ */ import_react4.default.createElement("button", { type: "button", onClick: () => handleAddListItem(), className: "mt-1 w-full px-2 py-1.5 bg-slate-700/70 hover:bg-slate-600 rounded-md transition-colors text-xs" }, "Adicionar Item"));
7065
+ ), /* @__PURE__ */ import_react4.default.createElement(
7066
+ "button",
7067
+ {
7068
+ type: "button",
7069
+ onClick: () => handleRemoveListItem(itemIndex),
7070
+ className: "flex-shrink-0 w-7 h-7 grid place-items-center bg-red-600/60 hover:bg-red-600 rounded-full text-xs font-bold transition-colors",
7071
+ "aria-label": "Remover item"
7072
+ },
7073
+ "\xD7"
7074
+ ))), /* @__PURE__ */ import_react4.default.createElement(
7075
+ "button",
7076
+ {
7077
+ type: "button",
7078
+ onClick: () => handleAddListItem(),
7079
+ className: "mt-1 w-full px-2 py-1.5 bg-slate-700/70 hover:bg-slate-600 rounded-md transition-colors text-xs"
7080
+ },
7081
+ "Adicionar Item"
7082
+ ));
7025
7083
  default:
7026
- return /* @__PURE__ */ import_react4.default.createElement("input", { type: "text", placeholder: "Valor", value: tempProp.value, onChange: (e) => handlePropChange("value", e.target.value), className: baseInput });
7084
+ return /* @__PURE__ */ import_react4.default.createElement(
7085
+ "input",
7086
+ {
7087
+ type: "text",
7088
+ placeholder: "Valor",
7089
+ value: tempProp.value,
7090
+ onChange: (e) => handlePropChange("value", e.target.value),
7091
+ className: baseInput
7092
+ }
7093
+ );
7027
7094
  }
7028
- })()), /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex justify-end items-center gap-2 pt-1" }, /* @__PURE__ */ import_react4.default.createElement("button", { onClick: handleCancel, type: "button", className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiX, { className: "text-red-400" })), /* @__PURE__ */ import_react4.default.createElement("button", { onClick: handleSave, type: "button", className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiCheck, { className: "text-green-400" }))));
7095
+ })()), /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex justify-end items-center gap-2 pt-1" }, /* @__PURE__ */ import_react4.default.createElement(
7096
+ "button",
7097
+ {
7098
+ onClick: handleCancel,
7099
+ type: "button",
7100
+ className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors"
7101
+ },
7102
+ /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiX, { className: "text-red-400" })
7103
+ ), /* @__PURE__ */ import_react4.default.createElement(
7104
+ "button",
7105
+ {
7106
+ onClick: handleSave,
7107
+ type: "button",
7108
+ className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors"
7109
+ },
7110
+ /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiCheck, { className: "text-green-400" })
7111
+ )));
7029
7112
  };
7030
7113
  const renderDisplayView = () => /* @__PURE__ */ import_react4.default.createElement("div", { className: "w-full space-y-2 text-sm" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ import_react4.default.createElement("p", { className: "font-semibold text-slate-200" }, prop.key), /* @__PURE__ */ import_react4.default.createElement("span", { className: "text-xs capitalize bg-slate-700/50 px-2 py-0.5 rounded text-slate-400" }, prop.type)), /* @__PURE__ */ import_react4.default.createElement("div", { className: "text-slate-300 pl-1" }, (() => {
7031
7114
  switch (prop.type) {
@@ -7053,7 +7136,10 @@ function CustomPropertyDisplay({
7053
7136
  if (isTextureMode) {
7054
7137
  onSelectTexture(item.value);
7055
7138
  } else {
7056
- onOpenImageViewer == null ? void 0 : onOpenImageViewer(prop.value.map((img) => ({ ...img })), index);
7139
+ onOpenImageViewer == null ? void 0 : onOpenImageViewer(
7140
+ prop.value.map((img) => ({ ...img })),
7141
+ index
7142
+ );
7057
7143
  }
7058
7144
  },
7059
7145
  className: `w-16 h-16 rounded-md bg-cover bg-center bg-slate-700 outline-none transition-all shadow-md ${isSelected ? "ring-4 ring-green-500 scale-105 z-10" : isTextureMode ? "hover:ring-4 hover:ring-indigo-400/50 cursor-pointer" : "hover:ring-2 hover:ring-indigo-400 cursor-zoom-in"}`,
@@ -7063,7 +7149,17 @@ function CustomPropertyDisplay({
7063
7149
  ), isSelected && /* @__PURE__ */ import_react4.default.createElement("div", { className: "absolute -top-2 -right-2 bg-green-500 text-white rounded-full p-0.5 shadow-sm" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiCheck, { size: 12 })));
7064
7150
  }));
7065
7151
  case "links":
7066
- return /* @__PURE__ */ import_react4.default.createElement("ul", { className: "space-y-1.5 max-h-40 overflow-y-auto custom-scrollbar" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ import_react4.default.createElement("li", { key: item.id }, /* @__PURE__ */ import_react4.default.createElement("a", { href: item.value, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-2 text-indigo-400 hover:text-indigo-300 hover:underline transition-colors" }, item.name, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiExternalLink, { className: "opacity-60", size: 12 })))));
7152
+ return /* @__PURE__ */ import_react4.default.createElement("ul", { className: "space-y-1.5 max-h-40 overflow-y-auto custom-scrollbar" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ import_react4.default.createElement("li", { key: item.id }, /* @__PURE__ */ import_react4.default.createElement(
7153
+ "a",
7154
+ {
7155
+ href: item.value,
7156
+ target: "_blank",
7157
+ rel: "noopener noreferrer",
7158
+ className: "inline-flex items-center gap-2 text-indigo-400 hover:text-indigo-300 hover:underline transition-colors"
7159
+ },
7160
+ item.name,
7161
+ /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiExternalLink, { className: "opacity-60", size: 12 })
7162
+ ))));
7067
7163
  case "documents":
7068
7164
  return /* @__PURE__ */ import_react4.default.createElement("div", { className: "space-y-2 mt-1" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ import_react4.default.createElement(
7069
7165
  "a",
@@ -7091,7 +7187,30 @@ function CustomPropertyDisplay({
7091
7187
  onMouseLeave: () => setIsHovered(false)
7092
7188
  },
7093
7189
  isEditing ? renderEditView() : renderDisplayView(),
7094
- !isEditing && !readOnly && /* @__PURE__ */ import_react4.default.createElement("div", { className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}` }, /* @__PURE__ */ import_react4.default.createElement("button", { onClick: () => setIsEditing(true), className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors", title: "Editar" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiEdit3, { size: 14 })), /* @__PURE__ */ import_react4.default.createElement("button", { onClick: onRemove, className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors", title: "Remover" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiTrash2, { size: 14 })))
7190
+ !isEditing && !readOnly && /* @__PURE__ */ import_react4.default.createElement(
7191
+ "div",
7192
+ {
7193
+ className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}`
7194
+ },
7195
+ /* @__PURE__ */ import_react4.default.createElement(
7196
+ "button",
7197
+ {
7198
+ onClick: () => setIsEditing(true),
7199
+ className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors",
7200
+ title: "Editar"
7201
+ },
7202
+ /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiEdit3, { size: 14 })
7203
+ ),
7204
+ /* @__PURE__ */ import_react4.default.createElement(
7205
+ "button",
7206
+ {
7207
+ onClick: onRemove,
7208
+ className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors",
7209
+ title: "Remover"
7210
+ },
7211
+ /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiTrash2, { size: 14 })
7212
+ )
7213
+ )
7095
7214
  );
7096
7215
  }
7097
7216
 
@@ -8249,7 +8368,6 @@ function DescriptionDisplay({
8249
8368
  mentionCount++;
8250
8369
  }
8251
8370
  });
8252
- console.log("[DescriptionDisplay] flatNavigation computed:", navItems.length, "items", navItems);
8253
8371
  return navItems;
8254
8372
  }, [sections]);
8255
8373
  const [currentStepIndex, setCurrentStepIndex] = (0, import_react7.useState)(0);
@@ -8296,24 +8414,14 @@ function DescriptionDisplay({
8296
8414
  const handleKeyDown = (e) => {
8297
8415
  if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA") return;
8298
8416
  const currentItem = flatNavigation[currentStepIndex];
8299
- if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(e.key)) {
8300
- console.log(`[DescriptionDisplay] Key pressed: ${e.key}`, {
8301
- currentStepIndex,
8302
- flatNavigationLength: flatNavigation.length,
8303
- currentItem,
8304
- currentBranchDirection
8305
- });
8306
- }
8307
8417
  if (e.key === "ArrowRight") {
8308
8418
  e.preventDefault();
8309
8419
  e.stopPropagation();
8310
8420
  if (currentStepIndex === 0 && currentBranchDirection === "left") {
8311
- console.log("[DescriptionDisplay] ArrowRight: Navigating back from left branch");
8312
8421
  if (onBranchNav) onBranchNav(null, "back");
8313
8422
  return;
8314
8423
  }
8315
8424
  if (currentItem && currentItem.type === "mention" && onBranchNav) {
8316
- console.log("[DescriptionDisplay] ArrowRight: Opening right branch for node", currentItem.nodeId);
8317
8425
  onBranchNav(currentItem.nodeId, "open", "right");
8318
8426
  return;
8319
8427
  }
@@ -8322,12 +8430,10 @@ function DescriptionDisplay({
8322
8430
  e.preventDefault();
8323
8431
  e.stopPropagation();
8324
8432
  if (currentStepIndex === 0 && currentBranchDirection === "right") {
8325
- console.log("[DescriptionDisplay] ArrowLeft: Navigating back from right branch");
8326
8433
  if (onBranchNav) onBranchNav(null, "back");
8327
8434
  return;
8328
8435
  }
8329
8436
  if (currentItem && currentItem.type === "mention" && onBranchNav) {
8330
- console.log("[DescriptionDisplay] ArrowLeft: Opening left branch for node", currentItem.nodeId);
8331
8437
  onBranchNav(currentItem.nodeId, "open", "left");
8332
8438
  return;
8333
8439
  }
@@ -8335,29 +8441,16 @@ function DescriptionDisplay({
8335
8441
  if (e.key === "ArrowDown") {
8336
8442
  e.preventDefault();
8337
8443
  if (flatNavigation.length > 1) {
8338
- setCurrentStepIndex((prev) => {
8339
- const next = Math.min(prev + 1, flatNavigation.length - 1);
8340
- console.log(`[DescriptionDisplay] ArrowDown: ${prev} -> ${next}`);
8341
- return next;
8342
- });
8444
+ setCurrentStepIndex((prev) => Math.min(prev + 1, flatNavigation.length - 1));
8343
8445
  }
8344
8446
  }
8345
8447
  if (e.key === "ArrowUp") {
8346
8448
  e.preventDefault();
8347
8449
  if (flatNavigation.length > 1) {
8348
- setCurrentStepIndex((prev) => {
8349
- const next = Math.max(prev - 1, 0);
8350
- console.log(`[DescriptionDisplay] ArrowUp: ${prev} -> ${next}`);
8351
- return next;
8352
- });
8450
+ setCurrentStepIndex((prev) => Math.max(prev - 1, 0));
8353
8451
  }
8354
8452
  }
8355
8453
  };
8356
- console.log("[DescriptionDisplay] Attaching keydown listener", {
8357
- flatNavigationLength: flatNavigation.length,
8358
- currentStepIndex,
8359
- currentBranchDirection
8360
- });
8361
8454
  window.addEventListener("keydown", handleKeyDown);
8362
8455
  return () => {
8363
8456
  window.removeEventListener("keydown", handleKeyDown);
@@ -11725,7 +11818,6 @@ function InSceneCreationForm({
11725
11818
  if (typeInput.trim() === "") {
11726
11819
  result = validExistingTypes.filter((t) => !types.includes(t));
11727
11820
  } else {
11728
- console.log("InSceneCreationForm: Filtrando tipos com input:", typeInput);
11729
11821
  try {
11730
11822
  const lowercasedInput = typeInput.toLowerCase();
11731
11823
  result = validExistingTypes.filter((t) => {
@@ -13708,7 +13800,6 @@ function NodeDetailsPanel({
13708
13800
  if (typeInput.trim() === "") {
13709
13801
  setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
13710
13802
  } else {
13711
- console.log("NodeDetailsPanel: Filtrando tipos com input:", typeInput);
13712
13803
  try {
13713
13804
  const lowercasedInput = typeInput.toLowerCase();
13714
13805
  setFilteredTypes(
@@ -14647,7 +14738,6 @@ function QuestDetailsPanel({
14647
14738
  if (typeInput.trim() === "") {
14648
14739
  setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
14649
14740
  } else {
14650
- console.log("QuestDetailsPanel: Filtrando tipos com input:", typeInput);
14651
14741
  try {
14652
14742
  const lowercasedInput = typeInput.toLowerCase();
14653
14743
  setFilteredTypes(
@@ -19855,7 +19945,6 @@ function XViewScene({
19855
19945
  const type = viewParams == null ? void 0 : viewParams.type;
19856
19946
  const tab = type === "database" ? "datasets" : "views";
19857
19947
  const targetUrl = `/dashboard/xview?tab=${tab}`;
19858
- console.log("X-View: Navegando para o Dashboard", { type, tab, targetUrl });
19859
19948
  try {
19860
19949
  router.push(targetUrl);
19861
19950
  } catch (e) {
@@ -20478,18 +20567,6 @@ function XViewScene({
20478
20567
  };
20479
20568
  parentDataRef.current = sceneResponse.data.parent;
20480
20569
  ancestryDataRef.current = sceneResponse.data.ancestry;
20481
- console.log(
20482
- "Console de sceneResponse.data.scene:",
20483
- sceneDataRef.current
20484
- );
20485
- console.log(
20486
- "Console de sceneResponse.data.parent:",
20487
- parentDataRef.current
20488
- );
20489
- console.log(
20490
- "Console de sceneResponse.data.ancestry:",
20491
- ancestryDataRef.current
20492
- );
20493
20570
  setNodeCounter(sceneResponse.data.node_counter || 0);
20494
20571
  if (sceneResponse.data.node_limit !== void 0) {
20495
20572
  setNodeLimit(sceneResponse.data.node_limit);
@@ -22870,11 +22947,6 @@ function XViewScene({
22870
22947
  }
22871
22948
  });
22872
22949
  }
22873
- console.log("[handleRenderAncestry] Start", {
22874
- ancestryId: ancestryObject.ancestry_id,
22875
- allowedSectionIds: allowedSectionIds ? Array.from(allowedSectionIds) : null,
22876
- activeSectionIdForFocus
22877
- });
22878
22950
  const { ancestryGroup, nodeObjects, renderer, renderedAncestries } = stateRef.current;
22879
22951
  const currentRenderLimit = stateRef.current.maxAncestryRenderIndex || 0;
22880
22952
  const isFullRenderRequest = !normalizedAllowedIds;
@@ -23172,11 +23244,6 @@ function XViewScene({
23172
23244
  let currentAnchorPosition = currentAnchorMesh.userData.id ? targetPositionsCache.get(String(currentAnchorMesh.userData.id)) || currentAnchorMesh.position : currentAnchorMesh.position;
23173
23245
  for (const section of sections) {
23174
23246
  const deveRenderizar = checkShouldRender(section);
23175
- console.log("[handleRenderAncestry] Section check:", {
23176
- id: section.id,
23177
- numericId: section.section_numeric_id,
23178
- deveRenderizar
23179
- });
23180
23247
  if (deveRenderizar) {
23181
23248
  const sectionNodes = section.children || [];
23182
23249
  if (sectionNodes.length > 0) {
@@ -24039,15 +24106,9 @@ function XViewScene({
24039
24106
  }, []);
24040
24107
  const handleSaveAncestry = (0, import_react37.useCallback)(
24041
24108
  async (ancestryName, ancestryDescription, ancestrySections, keepOpen = false, treeOverride = null, ancestryCustomProps = {}) => {
24042
- var _a2, _b2;
24109
+ var _a2;
24043
24110
  const treeToUse = treeOverride || ancestryMode.tree;
24044
24111
  const { isEditMode, currentAncestryId } = ancestryMode;
24045
- console.log("[handleSaveAncestry] received:", {
24046
- name: ancestryName,
24047
- descLength: ancestryDescription == null ? void 0 : ancestryDescription.length,
24048
- sectionsCount: ancestrySections == null ? void 0 : ancestrySections.length,
24049
- treeRoot: (_a2 = treeToUse.node) == null ? void 0 : _a2.id
24050
- });
24051
24112
  if (!treeToUse || !treeToUse.node) {
24052
24113
  alert(
24053
24114
  "Erro: A estrutura da ancestralidade \xE9 inv\xE1lida (Node raiz ausente)."
@@ -24252,7 +24313,7 @@ function XViewScene({
24252
24313
  currentAncestryId: ancestryObjectToSave.ancestry_id
24253
24314
  }));
24254
24315
  }
24255
- if (readingMode.isActive && ((_b2 = readingMode.ancestry) == null ? void 0 : _b2.ancestry_id) === ancestryObjectToSave.ancestry_id) {
24316
+ if (readingMode.isActive && ((_a2 = readingMode.ancestry) == null ? void 0 : _a2.ancestry_id) === ancestryObjectToSave.ancestry_id) {
24256
24317
  setReadingMode((prev) => ({
24257
24318
  ...prev,
24258
24319
  ancestry: ancestryObjectToSave
@@ -25701,7 +25762,9 @@ function XViewScene({
25701
25762
  const res = await onUpgrade();
25702
25763
  if (res.success) {
25703
25764
  setNodeLimit(-1);
25704
- alert("Upgrade realizado com sucesso! Sua conta agora \xE9 Premium.");
25765
+ alert(
25766
+ "Upgrade realizado com sucesso! Sua conta agora \xE9 Premium."
25767
+ );
25705
25768
  } else {
25706
25769
  alert("Erro ao realizar upgrade: " + res.error);
25707
25770
  }
package/dist/index.mjs CHANGED
@@ -2169,7 +2169,6 @@ var userActionHandlers = {
2169
2169
  }
2170
2170
  });
2171
2171
  if (updates.length > 0) {
2172
- console.log(`[syncQuestTemplateFlags] Sincronizando ${updates.length} quests...`);
2173
2172
  for (const quest of updates) {
2174
2173
  const idx = sceneDataRef.current.quest_nodes.findIndex((q) => String(q.id) === String(quest.id));
2175
2174
  if (idx !== -1) sceneDataRef.current.quest_nodes[idx] = quest;
@@ -2511,7 +2510,7 @@ var userActionHandlers = {
2511
2510
  if (actions.delete_file && nodeData) {
2512
2511
  const urls = extractFileUrlsFromProperties(nodeData);
2513
2512
  if (urls.length > 0) {
2514
- Promise.all(urls.map((url) => actions.delete_file(url))).then(() => console.log("Arquivos do node deletados.")).catch(
2513
+ Promise.all(urls.map((url) => actions.delete_file(url))).catch(
2515
2514
  (err) => console.error("Erro ao deletar arquivos do node:", err)
2516
2515
  );
2517
2516
  }
@@ -2922,7 +2921,6 @@ var userActionHandlers = {
2922
2921
  }
2923
2922
  if (foundProcess && foundTreeContext) {
2924
2923
  if (foundTreeContext.nodeRef.is_choice) {
2925
- console.log("N\xF3 de escolha detectado. Aguardando sele\xE7\xE3o manual.");
2926
2924
  keepOpen = true;
2927
2925
  if (context.setters.setDetailsNode) {
2928
2926
  context.setters.setDetailsNode({ ...nodeToSave, _scrollToChoice: true });
@@ -6690,7 +6688,17 @@ import { v4 as uuidv43 } from "uuid";
6690
6688
 
6691
6689
  // src/components/CustomPropertyDisplay.jsx
6692
6690
  import React3, { useState as useState4, useRef as useRef3, useEffect as useEffect3 } from "react";
6693
- import { FiCheck, FiX, FiEdit3, FiTrash2, FiExternalLink, FiFileText, FiChevronDown, FiUpload, FiLoader } from "react-icons/fi";
6691
+ import {
6692
+ FiCheck,
6693
+ FiX,
6694
+ FiEdit3,
6695
+ FiTrash2,
6696
+ FiExternalLink,
6697
+ FiFileText,
6698
+ FiChevronDown,
6699
+ FiUpload,
6700
+ FiLoader
6701
+ } from "react-icons/fi";
6694
6702
  function CustomPropertyDisplay({
6695
6703
  prop,
6696
6704
  onUpdate,
@@ -6739,7 +6747,9 @@ function CustomPropertyDisplay({
6739
6747
  if (!file || targetIndex === null || !onUploadFile) return;
6740
6748
  const MAX_SIZE = 10 * 1024 * 1024;
6741
6749
  if (file.size > MAX_SIZE) {
6742
- alert("O arquivo \xE9 muito grande. O limite m\xE1ximo de tamanho permitido \xE9 de 10MB.");
6750
+ alert(
6751
+ "Upload de imagens acima de 10MB n\xE3o est\xE1 dispon\xEDvel neste momento. Recomendamos armazen\xE1-la em um servi\xE7o de personal cloud storage e guardar apenas o link no x.plore."
6752
+ );
6743
6753
  return;
6744
6754
  }
6745
6755
  try {
@@ -6833,7 +6843,9 @@ function CustomPropertyDisplay({
6833
6843
  const baseInput = "w-full bg-slate-800/70 p-2 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-400/60 transition-all duration-150";
6834
6844
  const renderEditView = () => {
6835
6845
  var _a;
6836
- const isKeyFixed = ["links", "images", "date", "documents"].includes(tempProp.type);
6846
+ const isKeyFixed = ["links", "images", "date", "documents"].includes(
6847
+ tempProp.type
6848
+ );
6837
6849
  const availableOptions = [
6838
6850
  { value: "links", label: "Links", unique: true },
6839
6851
  { value: "images", label: "Images", unique: true },
@@ -6842,7 +6854,9 @@ function CustomPropertyDisplay({
6842
6854
  { value: "text", label: "Texto", unique: false },
6843
6855
  { value: "number", label: "N\xFAmero", unique: false },
6844
6856
  { value: "list", label: "Lista", unique: false }
6845
- ].filter((opt) => !opt.unique || !unavailableTypes.includes(opt.value) || tempProp.type === opt.value);
6857
+ ].filter(
6858
+ (opt) => !opt.unique || !unavailableTypes.includes(opt.value) || tempProp.type === opt.value
6859
+ );
6846
6860
  const currentTypeLabel = ((_a = availableOptions.find((o) => o.value === tempProp.type)) == null ? void 0 : _a.label) || tempProp.type;
6847
6861
  return /* @__PURE__ */ React3.createElement("div", { className: "w-full space-y-2" }, /* @__PURE__ */ React3.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React3.createElement(
6848
6862
  "input",
@@ -6862,7 +6876,12 @@ function CustomPropertyDisplay({
6862
6876
  className: "w-full flex items-center justify-between gap-2 bg-slate-800/70 p-2 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-1 focus:ring-indigo-400/60 hover:bg-slate-700/70 transition-colors"
6863
6877
  },
6864
6878
  /* @__PURE__ */ React3.createElement("span", { className: "truncate" }, currentTypeLabel),
6865
- /* @__PURE__ */ React3.createElement(FiChevronDown, { className: `text-slate-400 transition-transform ${isTypeDropdownOpen ? "rotate-180" : ""}` })
6879
+ /* @__PURE__ */ React3.createElement(
6880
+ FiChevronDown,
6881
+ {
6882
+ className: `text-slate-400 transition-transform ${isTypeDropdownOpen ? "rotate-180" : ""}`
6883
+ }
6884
+ )
6866
6885
  ), isTypeDropdownOpen && /* @__PURE__ */ React3.createElement("ul", { className: "absolute right-0 top-full mt-1 z-50 w-32 bg-slate-800 border border-white/10 rounded-lg shadow-xl overflow-y-auto max-h-48 custom-scrollbar py-1" }, availableOptions.map((opt) => /* @__PURE__ */ React3.createElement("li", { key: opt.value }, /* @__PURE__ */ React3.createElement(
6867
6886
  "button",
6868
6887
  {
@@ -6875,7 +6894,16 @@ function CustomPropertyDisplay({
6875
6894
  var _a2, _b, _c, _d, _e;
6876
6895
  switch (tempProp.type) {
6877
6896
  case "number":
6878
- return /* @__PURE__ */ React3.createElement("input", { type: "number", placeholder: "Valor num\xE9rico", value: tempProp.value, onChange: (e) => handlePropChange("value", e.target.value), className: baseInput });
6897
+ return /* @__PURE__ */ React3.createElement(
6898
+ "input",
6899
+ {
6900
+ type: "number",
6901
+ placeholder: "Valor num\xE9rico",
6902
+ value: tempProp.value,
6903
+ onChange: (e) => handlePropChange("value", e.target.value),
6904
+ className: baseInput
6905
+ }
6906
+ );
6879
6907
  case "date": {
6880
6908
  const dateType = ((_a2 = tempProp.value) == null ? void 0 : _a2.type) || "Data";
6881
6909
  const noSpinnerClass = "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none";
@@ -6892,15 +6920,20 @@ function CustomPropertyDisplay({
6892
6920
  handlePropChange("value", newValue);
6893
6921
  };
6894
6922
  const handleDateValueChange = (dateField, dateValue) => {
6895
- handlePropChange("value", { ...tempProp.value, [dateField]: dateValue });
6923
+ handlePropChange("value", {
6924
+ ...tempProp.value,
6925
+ [dateField]: dateValue
6926
+ });
6896
6927
  };
6897
6928
  const handleFullDateChange = (e) => {
6898
6929
  const rawValue = e.target.value;
6899
6930
  const digits = rawValue.replace(/\D/g, "");
6900
6931
  const len = digits.length;
6901
6932
  let formattedValue = digits;
6902
- if (len > 2 && len <= 4) formattedValue = `${digits.slice(0, 2)}/${digits.slice(2)}`;
6903
- else if (len > 4) formattedValue = `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
6933
+ if (len > 2 && len <= 4)
6934
+ formattedValue = `${digits.slice(0, 2)}/${digits.slice(2)}`;
6935
+ else if (len > 4)
6936
+ formattedValue = `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
6904
6937
  handleDateValueChange("value", formattedValue);
6905
6938
  };
6906
6939
  return /* @__PURE__ */ React3.createElement("div", { className: "space-y-2 p-2 bg-slate-900/60 rounded-lg border border-white/10" }, /* @__PURE__ */ React3.createElement("div", { className: "flex items-center justify-center gap-1 rounded-lg bg-slate-800/50 p-1" }, ["Data", "Ano", "Date Interval"].map((t) => /* @__PURE__ */ React3.createElement(
@@ -6912,7 +6945,17 @@ function CustomPropertyDisplay({
6912
6945
  className: `flex-1 text-xs px-2 py-1.5 rounded-md transition-colors ${dateType === t ? "bg-indigo-600 text-white font-semibold shadow" : "hover:bg-slate-700/50"}`
6913
6946
  },
6914
6947
  t === "Date Interval" ? "Intervalo" : t
6915
- ))), dateType === "Data" && /* @__PURE__ */ React3.createElement("input", { type: "text", placeholder: "DD/MM/AAAA", value: ((_b = tempProp.value) == null ? void 0 : _b.value) || "", onChange: handleFullDateChange, maxLength: "10", className: baseInput }), dateType === "Ano" && /* @__PURE__ */ React3.createElement(
6948
+ ))), dateType === "Data" && /* @__PURE__ */ React3.createElement(
6949
+ "input",
6950
+ {
6951
+ type: "text",
6952
+ placeholder: "DD/MM/AAAA",
6953
+ value: ((_b = tempProp.value) == null ? void 0 : _b.value) || "",
6954
+ onChange: handleFullDateChange,
6955
+ maxLength: "10",
6956
+ className: baseInput
6957
+ }
6958
+ ), dateType === "Ano" && /* @__PURE__ */ React3.createElement(
6916
6959
  "input",
6917
6960
  {
6918
6961
  type: "number",
@@ -6960,7 +7003,11 @@ function CustomPropertyDisplay({
6960
7003
  type: "text",
6961
7004
  placeholder: tempProp.type === "images" || tempProp.type === "documents" ? "ID" : "Nome",
6962
7005
  value: item.name,
6963
- onChange: (e) => handleListItemChange(itemIndex, "name", e.target.value),
7006
+ onChange: (e) => handleListItemChange(
7007
+ itemIndex,
7008
+ "name",
7009
+ e.target.value
7010
+ ),
6964
7011
  className: "min-w-0 flex-1 bg-slate-800/70 p-2 text-xs rounded-md border border-white/10 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-indigo-400/60"
6965
7012
  }
6966
7013
  ), /* @__PURE__ */ React3.createElement(
@@ -6969,7 +7016,11 @@ function CustomPropertyDisplay({
6969
7016
  type: "text",
6970
7017
  placeholder: tempProp.type === "images" ? "URL da Imagem" : tempProp.type === "documents" ? "URL do Documento" : "Valor",
6971
7018
  value: item.value,
6972
- onChange: (e) => handleListItemChange(itemIndex, "value", e.target.value),
7019
+ onChange: (e) => handleListItemChange(
7020
+ itemIndex,
7021
+ "value",
7022
+ e.target.value
7023
+ ),
6973
7024
  className: "min-w-0 flex-1 bg-slate-800/70 p-2 text-xs rounded-md border border-white/10 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-indigo-400/60"
6974
7025
  }
6975
7026
  ), (tempProp.type === "images" || tempProp.type === "documents") && /* @__PURE__ */ React3.createElement(
@@ -6982,11 +7033,53 @@ function CustomPropertyDisplay({
6982
7033
  title: "Upload de Arquivo"
6983
7034
  },
6984
7035
  uploadingItemIndex === itemIndex ? /* @__PURE__ */ React3.createElement(FiLoader, { className: "animate-spin" }) : /* @__PURE__ */ React3.createElement(FiUpload, { size: 12 })
6985
- ), /* @__PURE__ */ React3.createElement("button", { type: "button", onClick: () => handleRemoveListItem(itemIndex), className: "flex-shrink-0 w-7 h-7 grid place-items-center bg-red-600/60 hover:bg-red-600 rounded-full text-xs font-bold transition-colors", "aria-label": "Remover item" }, "\xD7"))), /* @__PURE__ */ React3.createElement("button", { type: "button", onClick: () => handleAddListItem(), className: "mt-1 w-full px-2 py-1.5 bg-slate-700/70 hover:bg-slate-600 rounded-md transition-colors text-xs" }, "Adicionar Item"));
7036
+ ), /* @__PURE__ */ React3.createElement(
7037
+ "button",
7038
+ {
7039
+ type: "button",
7040
+ onClick: () => handleRemoveListItem(itemIndex),
7041
+ className: "flex-shrink-0 w-7 h-7 grid place-items-center bg-red-600/60 hover:bg-red-600 rounded-full text-xs font-bold transition-colors",
7042
+ "aria-label": "Remover item"
7043
+ },
7044
+ "\xD7"
7045
+ ))), /* @__PURE__ */ React3.createElement(
7046
+ "button",
7047
+ {
7048
+ type: "button",
7049
+ onClick: () => handleAddListItem(),
7050
+ className: "mt-1 w-full px-2 py-1.5 bg-slate-700/70 hover:bg-slate-600 rounded-md transition-colors text-xs"
7051
+ },
7052
+ "Adicionar Item"
7053
+ ));
6986
7054
  default:
6987
- return /* @__PURE__ */ React3.createElement("input", { type: "text", placeholder: "Valor", value: tempProp.value, onChange: (e) => handlePropChange("value", e.target.value), className: baseInput });
7055
+ return /* @__PURE__ */ React3.createElement(
7056
+ "input",
7057
+ {
7058
+ type: "text",
7059
+ placeholder: "Valor",
7060
+ value: tempProp.value,
7061
+ onChange: (e) => handlePropChange("value", e.target.value),
7062
+ className: baseInput
7063
+ }
7064
+ );
6988
7065
  }
6989
- })()), /* @__PURE__ */ React3.createElement("div", { className: "flex justify-end items-center gap-2 pt-1" }, /* @__PURE__ */ React3.createElement("button", { onClick: handleCancel, type: "button", className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors" }, /* @__PURE__ */ React3.createElement(FiX, { className: "text-red-400" })), /* @__PURE__ */ React3.createElement("button", { onClick: handleSave, type: "button", className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors" }, /* @__PURE__ */ React3.createElement(FiCheck, { className: "text-green-400" }))));
7066
+ })()), /* @__PURE__ */ React3.createElement("div", { className: "flex justify-end items-center gap-2 pt-1" }, /* @__PURE__ */ React3.createElement(
7067
+ "button",
7068
+ {
7069
+ onClick: handleCancel,
7070
+ type: "button",
7071
+ className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors"
7072
+ },
7073
+ /* @__PURE__ */ React3.createElement(FiX, { className: "text-red-400" })
7074
+ ), /* @__PURE__ */ React3.createElement(
7075
+ "button",
7076
+ {
7077
+ onClick: handleSave,
7078
+ type: "button",
7079
+ className: "w-8 h-8 grid place-items-center rounded-lg hover:bg-white/10 transition-colors"
7080
+ },
7081
+ /* @__PURE__ */ React3.createElement(FiCheck, { className: "text-green-400" })
7082
+ )));
6990
7083
  };
6991
7084
  const renderDisplayView = () => /* @__PURE__ */ React3.createElement("div", { className: "w-full space-y-2 text-sm" }, /* @__PURE__ */ React3.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ React3.createElement("p", { className: "font-semibold text-slate-200" }, prop.key), /* @__PURE__ */ React3.createElement("span", { className: "text-xs capitalize bg-slate-700/50 px-2 py-0.5 rounded text-slate-400" }, prop.type)), /* @__PURE__ */ React3.createElement("div", { className: "text-slate-300 pl-1" }, (() => {
6992
7085
  switch (prop.type) {
@@ -7014,7 +7107,10 @@ function CustomPropertyDisplay({
7014
7107
  if (isTextureMode) {
7015
7108
  onSelectTexture(item.value);
7016
7109
  } else {
7017
- onOpenImageViewer == null ? void 0 : onOpenImageViewer(prop.value.map((img) => ({ ...img })), index);
7110
+ onOpenImageViewer == null ? void 0 : onOpenImageViewer(
7111
+ prop.value.map((img) => ({ ...img })),
7112
+ index
7113
+ );
7018
7114
  }
7019
7115
  },
7020
7116
  className: `w-16 h-16 rounded-md bg-cover bg-center bg-slate-700 outline-none transition-all shadow-md ${isSelected ? "ring-4 ring-green-500 scale-105 z-10" : isTextureMode ? "hover:ring-4 hover:ring-indigo-400/50 cursor-pointer" : "hover:ring-2 hover:ring-indigo-400 cursor-zoom-in"}`,
@@ -7024,7 +7120,17 @@ function CustomPropertyDisplay({
7024
7120
  ), isSelected && /* @__PURE__ */ React3.createElement("div", { className: "absolute -top-2 -right-2 bg-green-500 text-white rounded-full p-0.5 shadow-sm" }, /* @__PURE__ */ React3.createElement(FiCheck, { size: 12 })));
7025
7121
  }));
7026
7122
  case "links":
7027
- return /* @__PURE__ */ React3.createElement("ul", { className: "space-y-1.5 max-h-40 overflow-y-auto custom-scrollbar" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ React3.createElement("li", { key: item.id }, /* @__PURE__ */ React3.createElement("a", { href: item.value, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-2 text-indigo-400 hover:text-indigo-300 hover:underline transition-colors" }, item.name, /* @__PURE__ */ React3.createElement(FiExternalLink, { className: "opacity-60", size: 12 })))));
7123
+ return /* @__PURE__ */ React3.createElement("ul", { className: "space-y-1.5 max-h-40 overflow-y-auto custom-scrollbar" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ React3.createElement("li", { key: item.id }, /* @__PURE__ */ React3.createElement(
7124
+ "a",
7125
+ {
7126
+ href: item.value,
7127
+ target: "_blank",
7128
+ rel: "noopener noreferrer",
7129
+ className: "inline-flex items-center gap-2 text-indigo-400 hover:text-indigo-300 hover:underline transition-colors"
7130
+ },
7131
+ item.name,
7132
+ /* @__PURE__ */ React3.createElement(FiExternalLink, { className: "opacity-60", size: 12 })
7133
+ ))));
7028
7134
  case "documents":
7029
7135
  return /* @__PURE__ */ React3.createElement("div", { className: "space-y-2 mt-1" }, Array.isArray(prop.value) && prop.value.map((item) => /* @__PURE__ */ React3.createElement(
7030
7136
  "a",
@@ -7052,7 +7158,30 @@ function CustomPropertyDisplay({
7052
7158
  onMouseLeave: () => setIsHovered(false)
7053
7159
  },
7054
7160
  isEditing ? renderEditView() : renderDisplayView(),
7055
- !isEditing && !readOnly && /* @__PURE__ */ React3.createElement("div", { className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}` }, /* @__PURE__ */ React3.createElement("button", { onClick: () => setIsEditing(true), className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors", title: "Editar" }, /* @__PURE__ */ React3.createElement(FiEdit3, { size: 14 })), /* @__PURE__ */ React3.createElement("button", { onClick: onRemove, className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors", title: "Remover" }, /* @__PURE__ */ React3.createElement(FiTrash2, { size: 14 })))
7161
+ !isEditing && !readOnly && /* @__PURE__ */ React3.createElement(
7162
+ "div",
7163
+ {
7164
+ className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}`
7165
+ },
7166
+ /* @__PURE__ */ React3.createElement(
7167
+ "button",
7168
+ {
7169
+ onClick: () => setIsEditing(true),
7170
+ className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors",
7171
+ title: "Editar"
7172
+ },
7173
+ /* @__PURE__ */ React3.createElement(FiEdit3, { size: 14 })
7174
+ ),
7175
+ /* @__PURE__ */ React3.createElement(
7176
+ "button",
7177
+ {
7178
+ onClick: onRemove,
7179
+ className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors",
7180
+ title: "Remover"
7181
+ },
7182
+ /* @__PURE__ */ React3.createElement(FiTrash2, { size: 14 })
7183
+ )
7184
+ )
7056
7185
  );
7057
7186
  }
7058
7187
 
@@ -8210,7 +8339,6 @@ function DescriptionDisplay({
8210
8339
  mentionCount++;
8211
8340
  }
8212
8341
  });
8213
- console.log("[DescriptionDisplay] flatNavigation computed:", navItems.length, "items", navItems);
8214
8342
  return navItems;
8215
8343
  }, [sections]);
8216
8344
  const [currentStepIndex, setCurrentStepIndex] = useState7(0);
@@ -8257,24 +8385,14 @@ function DescriptionDisplay({
8257
8385
  const handleKeyDown = (e) => {
8258
8386
  if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA") return;
8259
8387
  const currentItem = flatNavigation[currentStepIndex];
8260
- if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(e.key)) {
8261
- console.log(`[DescriptionDisplay] Key pressed: ${e.key}`, {
8262
- currentStepIndex,
8263
- flatNavigationLength: flatNavigation.length,
8264
- currentItem,
8265
- currentBranchDirection
8266
- });
8267
- }
8268
8388
  if (e.key === "ArrowRight") {
8269
8389
  e.preventDefault();
8270
8390
  e.stopPropagation();
8271
8391
  if (currentStepIndex === 0 && currentBranchDirection === "left") {
8272
- console.log("[DescriptionDisplay] ArrowRight: Navigating back from left branch");
8273
8392
  if (onBranchNav) onBranchNav(null, "back");
8274
8393
  return;
8275
8394
  }
8276
8395
  if (currentItem && currentItem.type === "mention" && onBranchNav) {
8277
- console.log("[DescriptionDisplay] ArrowRight: Opening right branch for node", currentItem.nodeId);
8278
8396
  onBranchNav(currentItem.nodeId, "open", "right");
8279
8397
  return;
8280
8398
  }
@@ -8283,12 +8401,10 @@ function DescriptionDisplay({
8283
8401
  e.preventDefault();
8284
8402
  e.stopPropagation();
8285
8403
  if (currentStepIndex === 0 && currentBranchDirection === "right") {
8286
- console.log("[DescriptionDisplay] ArrowLeft: Navigating back from right branch");
8287
8404
  if (onBranchNav) onBranchNav(null, "back");
8288
8405
  return;
8289
8406
  }
8290
8407
  if (currentItem && currentItem.type === "mention" && onBranchNav) {
8291
- console.log("[DescriptionDisplay] ArrowLeft: Opening left branch for node", currentItem.nodeId);
8292
8408
  onBranchNav(currentItem.nodeId, "open", "left");
8293
8409
  return;
8294
8410
  }
@@ -8296,29 +8412,16 @@ function DescriptionDisplay({
8296
8412
  if (e.key === "ArrowDown") {
8297
8413
  e.preventDefault();
8298
8414
  if (flatNavigation.length > 1) {
8299
- setCurrentStepIndex((prev) => {
8300
- const next = Math.min(prev + 1, flatNavigation.length - 1);
8301
- console.log(`[DescriptionDisplay] ArrowDown: ${prev} -> ${next}`);
8302
- return next;
8303
- });
8415
+ setCurrentStepIndex((prev) => Math.min(prev + 1, flatNavigation.length - 1));
8304
8416
  }
8305
8417
  }
8306
8418
  if (e.key === "ArrowUp") {
8307
8419
  e.preventDefault();
8308
8420
  if (flatNavigation.length > 1) {
8309
- setCurrentStepIndex((prev) => {
8310
- const next = Math.max(prev - 1, 0);
8311
- console.log(`[DescriptionDisplay] ArrowUp: ${prev} -> ${next}`);
8312
- return next;
8313
- });
8421
+ setCurrentStepIndex((prev) => Math.max(prev - 1, 0));
8314
8422
  }
8315
8423
  }
8316
8424
  };
8317
- console.log("[DescriptionDisplay] Attaching keydown listener", {
8318
- flatNavigationLength: flatNavigation.length,
8319
- currentStepIndex,
8320
- currentBranchDirection
8321
- });
8322
8425
  window.addEventListener("keydown", handleKeyDown);
8323
8426
  return () => {
8324
8427
  window.removeEventListener("keydown", handleKeyDown);
@@ -11737,7 +11840,6 @@ function InSceneCreationForm({
11737
11840
  if (typeInput.trim() === "") {
11738
11841
  result = validExistingTypes.filter((t) => !types.includes(t));
11739
11842
  } else {
11740
- console.log("InSceneCreationForm: Filtrando tipos com input:", typeInput);
11741
11843
  try {
11742
11844
  const lowercasedInput = typeInput.toLowerCase();
11743
11845
  result = validExistingTypes.filter((t) => {
@@ -13740,7 +13842,6 @@ function NodeDetailsPanel({
13740
13842
  if (typeInput.trim() === "") {
13741
13843
  setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
13742
13844
  } else {
13743
- console.log("NodeDetailsPanel: Filtrando tipos com input:", typeInput);
13744
13845
  try {
13745
13846
  const lowercasedInput = typeInput.toLowerCase();
13746
13847
  setFilteredTypes(
@@ -14708,7 +14809,6 @@ function QuestDetailsPanel({
14708
14809
  if (typeInput.trim() === "") {
14709
14810
  setFilteredTypes(validExistingTypes.filter((t) => !types.includes(t)));
14710
14811
  } else {
14711
- console.log("QuestDetailsPanel: Filtrando tipos com input:", typeInput);
14712
14812
  try {
14713
14813
  const lowercasedInput = typeInput.toLowerCase();
14714
14814
  setFilteredTypes(
@@ -19947,7 +20047,6 @@ function XViewScene({
19947
20047
  const type = viewParams == null ? void 0 : viewParams.type;
19948
20048
  const tab = type === "database" ? "datasets" : "views";
19949
20049
  const targetUrl = `/dashboard/xview?tab=${tab}`;
19950
- console.log("X-View: Navegando para o Dashboard", { type, tab, targetUrl });
19951
20050
  try {
19952
20051
  router.push(targetUrl);
19953
20052
  } catch (e) {
@@ -20570,18 +20669,6 @@ function XViewScene({
20570
20669
  };
20571
20670
  parentDataRef.current = sceneResponse.data.parent;
20572
20671
  ancestryDataRef.current = sceneResponse.data.ancestry;
20573
- console.log(
20574
- "Console de sceneResponse.data.scene:",
20575
- sceneDataRef.current
20576
- );
20577
- console.log(
20578
- "Console de sceneResponse.data.parent:",
20579
- parentDataRef.current
20580
- );
20581
- console.log(
20582
- "Console de sceneResponse.data.ancestry:",
20583
- ancestryDataRef.current
20584
- );
20585
20672
  setNodeCounter(sceneResponse.data.node_counter || 0);
20586
20673
  if (sceneResponse.data.node_limit !== void 0) {
20587
20674
  setNodeLimit(sceneResponse.data.node_limit);
@@ -22962,11 +23049,6 @@ function XViewScene({
22962
23049
  }
22963
23050
  });
22964
23051
  }
22965
- console.log("[handleRenderAncestry] Start", {
22966
- ancestryId: ancestryObject.ancestry_id,
22967
- allowedSectionIds: allowedSectionIds ? Array.from(allowedSectionIds) : null,
22968
- activeSectionIdForFocus
22969
- });
22970
23052
  const { ancestryGroup, nodeObjects, renderer, renderedAncestries } = stateRef.current;
22971
23053
  const currentRenderLimit = stateRef.current.maxAncestryRenderIndex || 0;
22972
23054
  const isFullRenderRequest = !normalizedAllowedIds;
@@ -23264,11 +23346,6 @@ function XViewScene({
23264
23346
  let currentAnchorPosition = currentAnchorMesh.userData.id ? targetPositionsCache.get(String(currentAnchorMesh.userData.id)) || currentAnchorMesh.position : currentAnchorMesh.position;
23265
23347
  for (const section of sections) {
23266
23348
  const deveRenderizar = checkShouldRender(section);
23267
- console.log("[handleRenderAncestry] Section check:", {
23268
- id: section.id,
23269
- numericId: section.section_numeric_id,
23270
- deveRenderizar
23271
- });
23272
23349
  if (deveRenderizar) {
23273
23350
  const sectionNodes = section.children || [];
23274
23351
  if (sectionNodes.length > 0) {
@@ -24131,15 +24208,9 @@ function XViewScene({
24131
24208
  }, []);
24132
24209
  const handleSaveAncestry = useCallback8(
24133
24210
  async (ancestryName, ancestryDescription, ancestrySections, keepOpen = false, treeOverride = null, ancestryCustomProps = {}) => {
24134
- var _a2, _b2;
24211
+ var _a2;
24135
24212
  const treeToUse = treeOverride || ancestryMode.tree;
24136
24213
  const { isEditMode, currentAncestryId } = ancestryMode;
24137
- console.log("[handleSaveAncestry] received:", {
24138
- name: ancestryName,
24139
- descLength: ancestryDescription == null ? void 0 : ancestryDescription.length,
24140
- sectionsCount: ancestrySections == null ? void 0 : ancestrySections.length,
24141
- treeRoot: (_a2 = treeToUse.node) == null ? void 0 : _a2.id
24142
- });
24143
24214
  if (!treeToUse || !treeToUse.node) {
24144
24215
  alert(
24145
24216
  "Erro: A estrutura da ancestralidade \xE9 inv\xE1lida (Node raiz ausente)."
@@ -24344,7 +24415,7 @@ function XViewScene({
24344
24415
  currentAncestryId: ancestryObjectToSave.ancestry_id
24345
24416
  }));
24346
24417
  }
24347
- if (readingMode.isActive && ((_b2 = readingMode.ancestry) == null ? void 0 : _b2.ancestry_id) === ancestryObjectToSave.ancestry_id) {
24418
+ if (readingMode.isActive && ((_a2 = readingMode.ancestry) == null ? void 0 : _a2.ancestry_id) === ancestryObjectToSave.ancestry_id) {
24348
24419
  setReadingMode((prev) => ({
24349
24420
  ...prev,
24350
24421
  ancestry: ancestryObjectToSave
@@ -25793,7 +25864,9 @@ function XViewScene({
25793
25864
  const res = await onUpgrade();
25794
25865
  if (res.success) {
25795
25866
  setNodeLimit(-1);
25796
- alert("Upgrade realizado com sucesso! Sua conta agora \xE9 Premium.");
25867
+ alert(
25868
+ "Upgrade realizado com sucesso! Sua conta agora \xE9 Premium."
25869
+ );
25797
25870
  } else {
25798
25871
  alert("Erro ao realizar upgrade: " + res.error);
25799
25872
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
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",